[Intel-gfx] ***UNCHECKED*** Re: [PATCH] drm/i915/gt: Wait for RCUs frees before asserting idle on unload

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 12 16:16:57 UTC 2020


Quoting Tvrtko Ursulin (2020-03-12 14:18:26)
> 
> On 12/03/2020 11:53, Chris Wilson wrote:
> > During driver unload, we have many asserts that we have released our
> > bookkeeping structs and are idle. In some cases, these struct are
> > protected by RCU and we do not release them until after an RCU grace
> > period.
> > 
> > Reported-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > Fixes: 130a95e9098e ("drm/i915/gem: Consolidate ctx->engines[] release")
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/gt/intel_gt.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> > index 3dea8881e915..d09f7596cb98 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> > +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> > @@ -667,6 +667,9 @@ void intel_gt_driver_release(struct intel_gt *gt)
> >   
> >   void intel_gt_driver_late_release(struct intel_gt *gt)
> >   {
> > +     /* We need to wait for inflight RCU frees to release their grip */
> > +     rcu_barrier();
> > +
> >       intel_uc_driver_late_release(&gt->uc);
> >       intel_gt_fini_requests(gt);
> >       intel_gt_fini_reset(gt);
> > 
> 
> Not sure if GT or GEM is the place, but liberal application seems 
> required anyway nowadays.
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Either after gem_fini_contexts or before here, both have reasonable
arguments. One being the point of assertion, the other the point of
expected release.
-Chris


More information about the Intel-gfx mailing list