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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
Fix the RGMU probe to use standard helper functions and do proper
reference counting.
Change-Id: Ic0dedbadf5af14338de83cd9041674cc6f1ea304
Signed-off-by: Jordan Crouse <[email protected]>
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]>
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]>
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]>
Replace internal bucket/tag macros with those defined in dt-bindings.
Change-Id: Id91dacaeb6b45174ee9e59056fe4bc497951a27a
Signed-off-by: Mike Tipton <[email protected]>
Add generic qcom interconnect bindings that are common across platforms.
Change-Id: Iffe00699c52cbb7d0566eebb252234bd4597ed0a
Signed-off-by: Mike Tipton <[email protected]>
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]>