drm/i915/guc: Clean up locks in GuC
authorAlex Dai <yu.dai@intel.com>
Thu, 3 Dec 2015 00:56:29 +0000 (16:56 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 3 Dec 2015 14:11:54 +0000 (15:11 +0100)
commit5a843307cdf5ffa65a9f2382b3827e86576bbfe8
tree860571cb59772a289bfd0ff2bd97d9bb042ddfb1
parentee7d6cfa4b15aafa1d87f913572f30dd64cdd85a
drm/i915/guc: Clean up locks in GuC

For now, remove the spinlocks that protected the GuC's
statistics block and work queue; they are only accessed
by code that already holds the global struct_mutex, and
so are redundant (until the big struct_mutex rewrite!).

The specific problem that the spinlocks caused was that
if the work queue was full, the driver would try to
spinwait for one jiffy, but with interrupts disabled the
jiffy count would not advance, leading to a system hang.
The issue was found using test case igt/gem_close_race.

The new version will usleep() instead, still holding
the struct_mutex but without any spinlocks.

v4: Reorganize commit message (Dave Gordon)
v3: Remove unnecessary whitespace churn
v2: Clean up wq_lock too
v1: Clean up host2guc lock as well

Signed-off-by: Alex Dai <yu.dai@intel.com>
Reviewed-by: Dave Gordon <david.s.gordon@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449104189-27591-1-git-send-email-yu.dai@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_guc_submission.c
drivers/gpu/drm/i915/intel_guc.h