[Intel-gfx] [PATCH] drm/i915/guc: Keep irq enabled during GuC cmd submission
Daniel Vetter
daniel at ffwll.ch
Fri Nov 20 00:45:42 PST 2015
On Thu, Nov 19, 2015 at 04:15:22PM -0800, yu.dai at intel.com wrote:
> From: Alex Dai <yu.dai at intel.com>
>
> When GuC Work Queue is full, driver will wait GuC for avaliable
> space by calling wait_for_atomic. If irq is disabled, lockup will
> happen because jiffies won't be updated.
>
> Issue is found in igt/gem_close_race.
>
> Signed-off-by: Alex Dai <yu.dai at intel.com>
> ---
> drivers/gpu/drm/i915/i915_guc_submission.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> index 0a6b007..bbfa6ed 100644
> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> @@ -597,14 +597,13 @@ int i915_guc_submit(struct i915_guc_client *client,
> {
> struct intel_guc *guc = client->guc;
> enum intel_ring_id ring_id = rq->ring->id;
> - unsigned long flags;
> int q_ret, b_ret;
>
> /* Need this because of the deferred pin ctx and ring */
> /* Shall we move this right after ring is pinned? */
> lr_context_update(rq);
>
> - spin_lock_irqsave(&client->wq_lock, flags);
> + spin_lock(&client->wq_lock);
Oh dear your busy-spinning for the hw under a spinlock. That's horribly
broken design, please fix this asap. _irqsave is the least of your
concerns here.
-Daniel
>
> q_ret = guc_add_workqueue_item(client, rq);
> if (q_ret == 0)
> @@ -620,7 +619,7 @@ int i915_guc_submit(struct i915_guc_client *client,
> } else {
> client->retcode = 0;
> }
> - spin_unlock_irqrestore(&client->wq_lock, flags);
> + spin_unlock(&client->wq_lock);
>
> spin_lock(&guc->host2guc_lock);
> guc->submissions[ring_id] += 1;
> --
> 2.5.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list