iommu/arm-smmu: Avoid pathological RPM behaviour for unmaps
authorRob Clark <robdclark@chromium.org>
Thu, 31 Oct 2019 21:31:02 +0000 (14:31 -0700)
committerWill Deacon <will@kernel.org>
Fri, 1 Nov 2019 16:28:39 +0000 (16:28 +0000)
commitee9bdfedd3dc1b3303390663189defa4d6b9e458
treed48cda4b64c38e39a5e4fab236a6f2fead10918f
parentbdde4718aba368c33705ccff8f3e29586d41b69b
iommu/arm-smmu: Avoid pathological RPM behaviour for unmaps

When games, browser, or anything using a lot of GPU buffers exits, there
can be many hundreds or thousands of buffers to unmap and free.  If the
GPU is otherwise suspended, this can cause arm-smmu to resume/suspend
for each buffer, resulting 5-10 seconds worth of reprogramming the
context bank (arm_smmu_write_context_bank()/arm_smmu_write_s2cr()/etc).
To the user it would appear that the system just locked up.

A simple solution is to use pm_runtime_put_autosuspend() instead, so we
don't immediately suspend the SMMU device.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm-smmu.c