Chris Wilson 5cba288466 drm/i915/gt: Unlock engine-pm after queuing the kernel context switch
In commit a79ca656b648 ("drm/i915: Push the wakeref->count deferral to
the backend"), I erroneously concluded that we last modify the engine
inside __i915_request_commit() meaning that we could enable concurrent
submission for userspace as we enqueued this request. However, this
falls into a trap with other users of the engine->kernel_context waking
up and submitting their request before the idle-switch is queued, with
the result that the kernel_context is executed out-of-sequence most
likely upsetting the GPU and certainly ourselves when we try to retire
the out-of-sequence requests.

As such we need to hold onto the effective engine->kernel_context mutex
lock (via the engine pm mutex proxy) until we have finish queuing the
request to the engine.

v2: Serialise against concurrent intel_gt_retire_requests()
v3: Describe the hairy locking scheme with intel_gt_retire_requests()
for future reference.
v4: Combine timeline->lock and engine pm release; it's hairy.

Fixes: a79ca656b648 ("drm/i915: Push the wakeref->count deferral to the backend")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191120165514.3955081-2-chris@chris-wilson.co.uk
2019-11-20 16:58:26 +00:00
..
2019-11-14 05:53:10 +10:00
2019-08-14 18:31:10 +02:00
2019-11-14 05:53:10 +10:00
2019-10-24 17:59:45 +02:00
2019-10-04 17:04:05 +01:00
2019-10-03 16:38:50 +02:00
2019-09-19 16:24:24 -07:00
2019-06-30 09:48:05 +02:00
2019-11-13 15:34:15 -05:00
2019-10-23 12:10:05 +02:00
2019-11-14 05:53:10 +10:00
2019-07-17 12:52:55 +02:00
2019-11-14 05:53:10 +10:00
2019-06-05 20:31:04 +02:00
2019-07-15 18:11:31 +02:00
2019-06-05 20:29:57 +02:00
2019-09-16 15:14:43 +02:00
2019-07-17 12:52:55 +02:00
2019-10-11 09:30:53 +10:00
2019-11-14 05:53:10 +10:00
2019-10-23 11:14:11 -04:00
2019-07-22 21:24:10 +02:00
2019-11-14 05:53:10 +10:00
2019-05-27 18:07:03 +02:00
2019-05-27 18:07:03 +02:00
2019-10-08 18:29:00 +02:00
2019-05-27 18:07:03 +02:00
2019-06-19 12:07:29 +02:00
2019-05-27 18:07:03 +02:00
2019-07-22 21:24:10 +02:00
2019-05-27 18:07:03 +02:00
2019-06-19 12:07:29 +02:00
2019-09-19 16:24:24 -07:00
2019-05-27 18:07:03 +02:00
2019-10-02 16:28:55 +03:00
2019-05-27 18:07:03 +02:00
2019-10-03 16:38:50 +02:00