drm/i915: remove user GTT mappings early during runtime suspend
authorImre Deak <imre.deak@intel.com>
Wed, 7 May 2014 16:57:49 +0000 (19:57 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 22 May 2014 19:49:49 +0000 (21:49 +0200)
commitd6102977643de5be2d7dc022fcd2c75ffff59a1b
tree92eb741ecc35fce63a505af7962d51361ce31b16
parentfa4f53c4416de49dd4cc3debd8be98d2c0ba0eb6
drm/i915: remove user GTT mappings early during runtime suspend

Currently user space can access GEM buffers mapped to GTT through
existing mappings concurrently while the platform specific suspend
handlers are running. Since these handlers may change the HW state in a
way that would break such accesses, remove the mappings before calling
the handlers. Spotted by Ville.

Also Chris pointed out that the lists that i915_gem_release_all_mmaps()
walks through need dev->struct_mutex, so take this lock. There is a
potential deadlock against a concurrent RPM resume, resolve this by
aborting and rescheduling the suspend (Daniel).

v2:
- take struct_mutex around i915_gem_release_all_mmaps() (Chris, Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Robert Beckett <robert.beckett@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c