msm: hotplug: Revert to original thresholds
msm: kgsl: Add new API's to track device mutex owner

Add new API's kgsl_mutex_lock/unlock to track device mutex owner.
Mutex owner is an atomic variable and all operations set/clear on
it are also atomic to avoid any race conditions.

If a thread tries to acquire the mutex using new API, try to acquire
the mutex only if mutex owner is not same as current thread. This is
to prevent deadlocks which can happen if a thread tries to acquire
mutex with mutex held.

Change-Id: I3da4d0427ede5458f6a663043c57a4799b72d8fd
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Flush TLB when mapping to IOMMU pagetable

Flush TLB when mapping to IOMMU pagetable, this is a requirement
for current IOMMU hardware.

Change-Id: I82e766f4869c737c1f5b73934eacaada40d46e10
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
ASoC: msm: fix RX3 MIX1 INP3 path setting

The path RX3 MIX1 INP3 is not functional as its setting a wrong
regiser.

CRs-Fixed: 631013
Change-Id: I1916a4c6e1b2399c146471ca7a20791c36e14962
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
Revert "msm: iommu: remove tlb_invalidate from the map calls"

This might cause TLB invalidate to hang on unmap calls.

This reverts commit 8da8a5a49ce5dcbb5b5f97da8d66b34129562e80.

Change-Id: Ibbe373d448a3bea5e75bc45dd0a16e79f57c092b
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
iommu: msm: Add support for LPAE bfb settings

Certain IOMMUs have support for LPAE and when LPAE is enabled
in these IOMMUs a different set of bfb register settings must
be used to achieve optimal performance.

Change-Id: I093bc90518431c6a9a7343e9062f90d8f5e04aeb
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
iommu: msm: Add base physical address to drvdata structure

Add the physical address value to the iommu drvdata structure. This
address is needed for debugging purposes when we get iommu page
faults and during iommu halt and tlb sync issues.

Change-Id: I2d4f36cdfe8a3da772839cb07cd186820f2e1f52
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Revert "iommu: msm: Add timeouts for some operations"

This reverts commit e77f861a361431d540284f044142ef452dc45ad9.
iommu: msm: Do not sleep for 10 ms when TLB sync does not complete

TLB sync might take longer than expected to complete and we wait for 10 ms
to recheck. This is causing jitter in some applications. Instead of waiting
too long to check whether TLB sync has completed we use function
readl_tight_poll_timeout to quickly poll the status without incurring sleep
delay.

We also ensure that if we do eventually time out on the TLB sync or iommu
halt we cause a crash to indicate that something has gone wrong.

CRs-fixed: 608971
Change-Id: I6b3e5155ab7aafa80432f95554d25cf0e2b753f9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
iommu: msm: Check VBIF state during IOMMU access timeout

Check whether halting the VBIF XIN when the TLB sync or IOMMU halt
times out clears the issue indicating an issue with the master not clearing
the VBIF FIFO.

Change-Id: I552f72db17e31a174ab2725bbecbf4ad98a9d378
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
defconfig: Enable VBIF check
msm: hotplug: Consider load instead of frequency for slowest cpu