Commit graph

879,439 commits

Author SHA1 Message Date
Jay Jayanna
d7067f6740 net: qrtr: mhi: Set mhi driver data before registering with qrtr
The original design was to not send anything from qrtr-mhi until
a packet was received from the remote side. This would leave
enough time for the probe function to set up the driver_date.

With the new requirement to queue a hello packet (for Linux to
Linux communication), we may see the hello packet being scheduled
and sent before we can return and set the drvdata.

The changes to address the above requirement brings in a
possibility that driver_data in mhi layer is NULL sometimes.
Check device pointer for NULL in ul callback and return if
it is NULL.

Move the setting of driver data before registering it as an
endpoint with the qrtr framework.

Change-Id: Ida94d95485d2432f38e6cb0c82fa21af7bc73af3
Signed-off-by: Jay Jayanna <[email protected]>
2020-03-16 10:29:32 -07:00
Jordan Crouse
85de653589 msm: kgsl: Make OOB timeouts easier to debug
Instead of a vague message and a mask use actual string names and a nice
WARN() to make it easier for mere mortals to debug OOB timeouts.  Also
remove a unneeded global function and replace it with a smaller local
function.

Change-Id: Ic0dedbad470326854e8565d651d477cf54401f07
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:03 -06:00
Jordan Crouse
468361c1a9 msm: kgsl: Move ringbuffer start to target specific code
Currently the ringbuffer start sequence is a mix between generic and
target specific code (and some target specific behavior mixed into the
generic for good measure).  Move all the behavior to the target specific
code which duplicates a bit of code but increases our flexibility for
the future.

Change-Id: Ic0dedbadf0aa9c2af8acfde481f2b62d991f8c1e
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:03 -06:00
Jordan Crouse
2624c1e3d5 msm: kgsl: Remove unneeded parameters for the sharedmem funcs
We do not need to pass a struct kgsl_device pointer to
kgsl_sharedmem_writel and kgsl_sharedmem_writeq which makes life slightly
easier when we don't have to worry about dereferencing pointers. The same
goes for kgsl_sharedmem_set too but that function is only used twice and
can be easily replaced by a memset() so just do that instead.

Change-Id: Ic0dedbadef4bfef8da9bf4c89a6a36e27e6f7da5
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:02 -06:00
Jordan Crouse
97554c5d26 msm: kgsl: Read snapshot registers in the target specific functions
Read the common GPU status registers in the target specific snapshot
functions rather than using adreno_readreg() to read them from the
generic code.

Change-Id: Ic0dedbad17f8744827fda3ce5a035f3bc913ea3f
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:02 -06:00
Jordan Crouse
a72f365a37 msm: kgsl: Remove references to adreno_regs from target specific code
The adreno_regs are supposed to used to do register offset lookups from
generic code.  Since the target specific code already knows the register
offset it wants the lookup step is unessesary.

Change-Id: Ic0dedbad839e75006078b6d29ee99179a6680ade
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:01 -06:00
Jordan Crouse
6cf52e12f4 msm: kgsl: Remove soft fault registers from a5xx
All 5xx targets use hardware based fault detection so we don't need to
define soft fault registers that will never get used.

Change-Id: Ic0dedbad7e5029db3b70a333c59c9844251df6ae
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:01 -06:00
Sharat Masetty
c6393e3661 msm: kgsl: Print always on counters if HFI timed out
This patch adds some instrumentation to dump the always on
counters in case the polling routine timed out waiting for a response
from GMU after we send the HFI command. There are some cases
where we suspect that the polling logic may be prematurely timing
out. This patch should help throw more light into such cases.

Change-Id: I055d529cca7bb242420cfc7e37f2b4ad5ac43195
Signed-off-by: Sharat Masetty <[email protected]>
2020-03-16 09:52:00 -06:00
Jordan Crouse
59f2bbe3f4 msm: kgsl: Add a GMU core function to read the always on counter
Add a GMU core function to read the always on counter from the generic
KGSL code.

Change-Id: Ic0dedbad1f81140ea9b891366d18b6f2d94bf149
Signed-off-by: Hareesh Gundu <[email protected]>
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:52:00 -06:00
Puranam V G Tejaswi
4d2b26fbcf msm: kgsl: remove redundant check for usermem type
The check for usermem type, while updating the stat
for memory mapped to userspace is not required.
Memory with usermem type KGSL_MEM_ENTRY_ION is not
mapped to user by kgsl and the mapsize would always be
zero. So remove the unnecessary check for usermem type.

Change-Id: Iaa0b86d1c7160657de1d802f2cc10c3bdbdf84b3
Signed-off-by: Puranam V G Tejaswi <[email protected]>
2020-03-16 09:51:59 -06:00
Puranam V G Tejaswi
30a223f051 msm: kgsl: fix accounting of memory mapped to userspace
The mapsize of kgsl_memdesc and gpumem_mapped of process are
incremented only in vmfault handler. But for cache modes
write through and write back, pages are inserted in kgsl_mmap.
So account for those mappings also in gpumem_mapped.

Change-Id: I98e29b28fa6fd2915b03bdcb9c655015a926d0eb
Signed-off-by: Puranam V G Tejaswi <[email protected]>
2020-03-16 09:51:59 -06:00
Pankaj Gupta
eb33248e0e msm: kgsl: Dump GPU registers only when GX is ON
When we get a timeout in waiting for lowest idle level,
dump GX registers, only when GX is ON.

There could be a possibility that oob request to turn ON
GX gets fail, and we try to set state back to SLUMBER.
During this transition, wait_for_lowest_idle will be
called and will eventually time out. This will
trigger debug logs collection and will read GPU
registers, which will not have valid data.

Change-Id: If0420c40a5439683bccaffca2bbbbb874d2ad19e
Signed-off-by: Pankaj Gupta <[email protected]>
2020-03-16 09:51:58 -06:00
Pankaj Gupta
8a4b3ccb98 msm: kgsl: Configure IFPC perf counter in platform_setup
Currently ifpc counter is not enabled because gmu core is
disabled during probe.
This patch updates the check for configuring perfctr_ifpc_lo
during platform_setup.

Change-Id: Icebfba2bef89a6411f350c230b54d67f372de132
Signed-off-by: Pankaj Gupta <[email protected]>
2020-03-16 09:51:58 -06:00
Sharat Masetty
171b7a49c6 msm: kgsl: Fix conditional check for GMU_NONCACHED_USER
The conditional to initialize next_uncached_user_alloc is incorrect
and this patch simply fixes this.

Change-Id: I49c9aa5e2e84bf3c4855af6d166693683ce83c71
Signed-off-by: Sharat Masetty <[email protected]>
2020-03-16 09:51:57 -06:00
Pankaj Gupta
d4b3268d66 msm: kgsl: Return correctly from gmu_core_dev_wait_for_lowest_idle
Return value from a6xx_gmu_wait_for_lowest_idle is not
handled properly in its core function. Return correctly
from core function to handle error properly.
This will help to trigger GMU_FAULT and collect gmu
snapshot from gmu_stop or adreno_stop in case of any
idle timeout.

Change-Id: Iedffac031d11bf8eebadfcb10857c4e99142037f
Signed-off-by: Pankaj Gupta <[email protected]>
2020-03-16 09:51:57 -06:00
Jordan Crouse
ea01925637 msm: kgsl: Dump the always on counter for a6xx interrupts
If an interrupt occurs while GX is off it is useful to read the always
on counter value to match the error with the GMU trace.

Change-Id: Ic0dedbad923e37ebcb9c19dc26b0023a2bd0613c
Signed-off-by: Hareesh Gundu <[email protected]>
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:56 -06:00
Jordan Crouse
5fc8a2d9f0 msm: kgsl: Properly handle attach error for secure pagetable
Properly handle error paths in _init_secure_pt.

Change-Id: Ic0dedbadf297579a2cfbab6e40f2aac4752cca94
Signed-off-by: Deepak Kumar <[email protected]>
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:56 -06:00
Jordan Crouse
0f9ebd5579 msm: kgsl: Finish up probe cleanups
Do the last bits needed to make the probes defer capable. Fix a few more
device_node reference counts and fix up the probe failure unwind paths.

Change-Id: Ic0dedbadd6f4c9b46a02e9b6ea0b145c81b50520
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:55 -06:00
Jordan Crouse
fb77ada179 msm: kgsl: Handle a defer from IOMMU
of_dma_configure() will return -EPROBE_DEFER if the IOMMU driver isn't
set up yet. Propagate that error all the way back to probe.

Change-Id: Ic0dedbad3bdda6516386f6eeff485065f83aee9b
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:55 -06:00
Jordan Crouse
53aa77773b msm: kgsl: Cleanup the adreno SOC HW probe
The code to probe the sometimes used HW revision only needs to live in
adreno.c and we don't need to store a persistent member in adreno_device.
Localize all the code and pass the HW revision into the functions that
need it.

Change-Id: Ic0dedbaddafe258f6b6510f68867cff636963315
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:54 -06:00
Jordan Crouse
565c37064c msm: kgsl: Move context aware scaling to the scaling code
Context aware (CA) scaling is excluisvely a pwrscale concept so move all
the probing there.  This is mostly just a cut-and-paste except that the
speed_bin needs to move from Adreno to the kgsl_device so it can be
accessed from the pwrscale code.

Change-Id: Ic0dedbad54983ecf8b59b9a62991be6b4f26b242
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:53 -06:00
Jordan Crouse
9f1c0af630 msm: kgsl: Use the GPU platform device when it is appropriate
Throughout the history of the driver the GPU platform device and the
KGSL pseudo device have been used somewhat interchangeably which is
bad. The platform device should be used whenever dealing with hardware
or kernel resources so that we can get proper cleanup during probe.

While it is still okay to use the pseudo device for log messages,
using the platform device for log messages having to do with
resources is better since you can make a more direct correlation
between the log message and the device tree entry.

Change-Id: Ic0dedbad1fe2fd4d75ff738fc3942c7b20125683
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:53 -06:00
Jordan Crouse
ed253b59c0 msm: kgsl: Use booleans for power control features
Currently we use a bitmask for the power control features (SPTP, ACD, LM,
etc).  Move to individual booleans for each feature instead. Booleans
are less unweidly to use and require less if () statements.

Additionally if we properly use the Adreno feature flags when setting
and/or modifying the booleans we can get rid of the feature flag checks in
the rest of the code and use the control booleans as they are intended.

And finally, move some of the target specific control features to the
target specific code. This ensures that the target specific code can
control the feature and the other targets don't accidentally specify
the wrong state through sysfs. For example, if SPTP power collapse is
only available for a5xx then the sysfs file should only ever return
false for the other targets.

Change-Id: Ic0dedbad1828ae9163a1a1357828156cb3281914
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:52 -06:00
Jordan Crouse
8152ccc95e msm: kgsl: Fixup the GMU probe
Clean up the GMU probe to use standard functions and proper reference to
make it more defer tolerant.

Change-Id: Ic0dedbad7c561e24c07053ea3b19ef62e34621cb
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:52 -06:00
Jordan Crouse
76f54bf67f msm: kgsl: Fixup the RGMU probe
Fix the RGMU probe to use standard helper functions and do proper
reference counting.

Change-Id: Ic0dedbadf5af14338de83cd9041674cc6f1ea304
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:51 -06:00
Jordan Crouse
05fb678662 msm: kgsl: Move hw_isidle to target specific code
Currently, there is a custom hw_isidle function defined for a6xx but the
function pointer is removed in a6xx_start for non GMU/RGMU a6xx targets
which has the effect of falling back to the generic adreno_hw_isidle
function which confused at least two of us before we figured out what
was happening.

Instead of having a generic adreno_hw_isidle function except for a6xx, add
a hw_isidle function hook for all targets and do the GMU check in the
a6xx specific function. This also has the advantage of moving a a540
specific hack into the a5xx code and removes one of two usages of the
gpucore specific busy mask and the other is in soft fault detect.
Arguably we should get rid that too but for now we can just hardcode
the mask in there and remove the busy mask from the gpucore struct.

And finally it looks like adreno_isidle isn't used as a function hook,
so remove it from the device function tables and mark it static.

Change-Id: Ic0dedbad47fa5dee0e5d903a8f9dd9bf7230b759
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:51 -06:00
Jordan Crouse
c744ab5d9c msm: kgsl: Clean up the reset and soft reset paths
a6xx added a new function hook and path for doing a GPU reset that fell
back to the default reset path for a610 but a610 purposely skipped
soft reset and the hard reset path is very similar to that used by
GMU/RGMU enabled devices except for one little bit.

Furthermore, if a610 skipped soft reset then there are no a6xx targets
that do soft reset so there is no reason to have an a6xx specific
soft reset path. And further to that, there isn't any reason to have
any a6xx specific functions (like oob) in the generic soft reset path.

Make the a6xx reset support all a6xx targets, remove unused infrastructure
from the rest of the generic code and cleanup the generic functions
to be a little bit easier to understand.

Change-Id: Ic0dedbadd3570fe148a464ff0dc647d91099ae09
Signed-off-by: Jordan Crouse <[email protected]>
2020-03-16 09:51:50 -06:00
Mike Tipton
dd27df6115 interconnect: qcom: Support bcm-voter-specific TCS wait behavior
Currently, all bcm-voters follow the same logic for when a tcs_cmd needs
to wait for completion. This logic sets tcs_cmd::wait = true for the
last command in each TCS (AMC, WAKE, and SLEEP). However, this isn't
necessarily the desired behavior for each bcm-voter, so allow which
TCS's require wait-for-completion to be specified in devicetree.

Additionally, change the default behavior to only wait for completion in
AMC and WAKE sets. The SLEEP set generally does not require this, since
in essentially all cases resources are only being disabled in the sleep
set and that can happen asynchronously in parallel with the rest of the
power collapse sequence.

Change-Id: If782f88c2748f018863fe1cdbc8c82ad427c3e9f
Signed-off-by: Mike Tipton <[email protected]>
2020-03-15 23:06:57 -07:00
Mike Tipton
d76fc9c630 interconnect: qcom: Don't redefine bucket/tag macros
Replace internal bucket/tag macros with those defined in dt-bindings.

Change-Id: Id91dacaeb6b45174ee9e59056fe4bc497951a27a
Signed-off-by: Mike Tipton <[email protected]>
2020-03-15 23:06:55 -07:00
Mike Tipton
2f622be7ab dt-bindings: interconnect: Add generic qcom bindings
Add generic qcom interconnect bindings that are common across platforms.

Change-Id: Iffe00699c52cbb7d0566eebb252234bd4597ed0a
Signed-off-by: Mike Tipton <[email protected]>
2020-03-15 23:06:53 -07:00
Jishnu Prakash
108427ae28 leds: qpnp: Add snapshot of vibrator LDO driver
This is a snapshot of the vibrator LDO driver as of msm-4.19
'commit c527cd5c987ac (Merge "mhi: cntrl: qcom: allow printing
large strings to IPC logs")' with the following modifications:
	- Replace snprintf with scnprintf.

Change-Id: Id58fbcc33607c309366104fe72282c09c86a3227
Signed-off-by: Jishnu Prakash <[email protected]>
2020-03-15 08:19:03 -07:00
qctecmdr
058b861752 Merge "usb: dwc3: gadget: update the return value of pullup function" 2020-03-15 03:11:03 -07:00
qctecmdr
baa8778afd Merge "cnss_nl: Add new attributes for cld80211 attr list" 2020-03-15 03:11:03 -07:00
qctecmdr
d9918c71df Merge "NFC: Add timeout when waiting for responses in probe" 2020-03-15 03:11:03 -07:00
qctecmdr
99a3ac3183 Merge "msm: ipa3: Updating SRAM locations for lito" 2020-03-15 03:11:02 -07:00
qctecmdr
f8c0f9b08b Merge "msm: kgsl: Move event groups to the KGSL device" 2020-03-15 00:41:45 -07:00
qctecmdr
2da77626ea Merge "platform: msm: Add snapshot of msm_11ad driver" 2020-03-15 00:41:45 -07:00
qctecmdr
b5db7e5fa0 Merge "msm: ipa: Update source and dest resource group config values" 2020-03-15 00:41:45 -07:00
qctecmdr
ea6490aa33 Merge "arm64: defconfig: select CONFIG_USB_CONFIGFS_NCM on Lahaina" 2020-03-15 00:41:44 -07:00
qctecmdr
5f7d6431db Merge "usb: phy: qmp: Perform DP_COM_SW_RESET during portselect" 2020-03-15 00:41:44 -07:00
qctecmdr
543d28f8d8 Merge "USB: f_accessory: Check dev pointer before decoding ctrl request" 2020-03-15 00:41:43 -07:00
qctecmdr
95130fde9d Merge "dt-bindings: thermal_qti: Add thermal devicetree Macro" 2020-03-14 21:42:38 -07:00
qctecmdr
644e2c8cb3 Merge "usb: gsi: Dont mask read api for dpl_ctl node" 2020-03-14 21:42:38 -07:00
qctecmdr
501bac76d0 Merge "clk: qcom: clk-debug: Add mc_cc_debug_mux in gcc debug parent list" 2020-03-14 21:42:37 -07:00
qctecmdr
87da78b5f9 Merge "msm: pcie: lower event callback print prority" 2020-03-14 21:42:37 -07:00
qctecmdr
70bc75e1bd Merge "msm: kgsl: Add the list of protected registers for A660" 2020-03-14 21:42:36 -07:00
qctecmdr
5ae8b16b99 Merge "defconfig: Enable LMH DCVS driver for lahaina" 2020-03-14 21:42:36 -07:00
qctecmdr
0b61299a0d Merge "msm: kgsl: Refactor IOMMU register macros" 2020-03-14 21:42:36 -07:00
qctecmdr
4d500eb9cd Merge "defconfig: arm64: Enable hyp core control driver for Lahaiana" 2020-03-14 18:51:01 -07:00
qctecmdr
8e40478163 Merge "iommu: arm-smmu: Fix domain logger use-after-free" 2020-03-14 18:51:01 -07:00