[Intel-gfx] [PATCH 03/46] drm/i915: Track all held rpm wakerefs

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 7 13:22:32 UTC 2019


Quoting Mika Kuoppala (2019-01-07 13:14:00)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> > @@ -2011,6 +2011,8 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
> >  
> >  out:
> >       enable_rpm_wakeref_asserts(dev_priv);
> > +     if (!dev_priv->uncore.user_forcewake.count)
> > +             intel_runtime_pm_cleanup(dev_priv);
> >
> 
> Why would we have forcewake active in here?

Why would the user suspend while holding
open("/debug/dri/0/i915_user_forcewake")?

Because they can.
 
> Are you planning on extending the intel_runtime_pm_cleanup?
> Atleast in the callsite 'intel_runtime_assert_no_wakerefs' would
> make more sense.

Oh yes, yes, yes. The challenge is that we take the rpm wakeref with
such frequency and variety of lifetimes is that we end up with so much
tracked that it makes finding the leak very hard (and we cannot report
an underflow elsewhere at the moment for similar reasons). So this first
wave was to catch the easy stuff and report a leak on module unload, then
once everyone is tracking their own wakeref, we can do the must_check
annotation and WARN on underflow.
-Chris


More information about the Intel-gfx mailing list