BACKPORT: msm: kgsl: Avoid unmap after kgsl system suspend

Smmu driver cannot safely handle unmap request after smmu device is
system suspended. So ensure kgsl doesn't initiate an unmap request
after kgsl system suspend as smmu device suspend happens after gpu's.

Kgsl does unmap from the following paths:
  1. Userspace unmap calls
  2. Mementry workqueue
  3. During reclaim

(1) is not a concern as userspace will be collapse before driver
suspend. So we need to ensure that mementry/events workqueues are
flushed and we don't participate in reclaim to take care off
(2) & (3) before kgsl system suspend completes.

[mkbestas]: Ignore kgsl_reclaim parts that don't exist in 5.4
Change-Id: Ibe2c8f5a90fd4d8d4cf212f17c04c52873738e36
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
This commit is contained in:
Akhil P Oommen 2022-09-20 18:41:17 +05:30 • committed by Michael Bestas
commit bf39effde5
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -1743,6 +1743,12 @@ static int adreno_pm_suspend(struct device *dev)
status = ops->pm_suspend(adreno_dev);
mutex_unlock(&device->mutex);
if (status)
return status;
flush_workqueue(device->events_wq);
flush_workqueue(kgsl_driver.mem_workqueue);
return status;
}