On Thu, Aug 12, 2021 at 04:11:28PM +0200, Daniel Vetter wrote: > On Wed, Aug 11, 2021 at 01:16:18AM +0000, Matthew Brost wrote: > > Flush the work queue for GuC generated G2H messages durinr a GT reset. > > This is accomplished by spinning on the the list of outstanding G2H to > > go empty. > > > > Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface") > > Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx> > > Cc: <stable@xxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c > > index 3cd2da6f5c03..e5eb2df11b4a 100644 > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c > > @@ -727,6 +727,11 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc) > > wait_for_reset(guc, &guc->outstanding_submission_g2h); > > } while (!list_empty(&guc->ct.requests.incoming)); > > } > > + > > + /* Flush any GuC generated G2H */ > > + while (!list_empty(&guc->ct.requests.incoming)) > > + msleep(20); > > flush_work or flush_workqueue, beacuse that comes with lockdep > annotations. Dont hand-roll stuff like this if at all possible. lockdep puked when used that. Matt > -Daniel > > > + > > scrub_guc_desc_for_outstanding_g2h(guc); > > } > > > > -- > > 2.32.0 > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch