OSDN Git Service

drm/i915: Repeat flush of idle work during suspend
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 23 Dec 2016 14:57:56 +0000 (14:57 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 23 Dec 2016 16:07:11 +0000 (16:07 +0000)
commitbdeb978506a7cf59ee75ed61a7b6a3506d03a1e4
tree4d88a9af0a0222f261e95b2189d9fc71386b8066
parent28f412e02b15be73669d9882f8041d8e8b54f197
drm/i915: Repeat flush of idle work during suspend

The idle work handler is self-arming - if it detects that it needs to
run again it will queue itself from its work handler. Take greater care
when trying to drain the idle work, and double check that it is flushed.

The free worker has a similar issue where it is armed by an RCU task
which may be running concurrently with us.

This should hopefully help with the sporadic WARN_ON(dev_priv->gt.awake)
from i915_gem_suspend.

v2: Reuse drain_freed_objects.
v3: Don't try to flush the freed objects from the shrinker, as it may be
underneath the struct_mutex already.
v4: do while and comment upon the excess rcu_barrier in drain_freed_objects

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161223145804.6605-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c