[Intel-gfx] [PATCH] drm/i915: Try harder to finish the idle-worker

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 4 10:49:06 UTC 2017


Quoting Mika Kuoppala (2017-09-04 11:19:09)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> > +/*
> > + * Wait until the work is finally complete, even if it tries to postpone
> > + * by requeueing itself. Note, that if the worker never cancels itself,
> > + * we will spin forever.
> > + */
> > +static inline void drain_delayed_work(struct delayed_work *dw)
> > +{
> > +     do {
> > +             while (flush_delayed_work(dw))
> > +                     ;
> > +     } while (delayed_work_pending(dw));
> 
> So we end spinning if someone doesn't let go of mutex.
> 
> Add a timeout for doing this and let it slide into
> suspend with a error message anyways instead of spinning
> forever?

Such error messages already exist (NMI). But for us if we skip flushing
the work, we leave the driver in a very inconsistent state and expect to
blow up on resume. It's a lose-lose.
-Chris


More information about the Intel-gfx mailing list