Re: [PATCH v2 3/4] drm/i915: make assert_device_not_suspended more precise

Imre Deak
2015-11-18T16:10:39Z

On ke, 2015-11-18 at 16:47 +0100, Daniel Vetter wrote:
> On Wed, Nov 18, 2015 at 05:11:03PM +0200, Imre Deak wrote:
> > On ke, 2015-11-18 at 16:01 +0100, Daniel Vetter wrote:
> > > On Wed, Nov 18, 2015 at 04:58:46PM +0200, Imre Deak wrote:
> >
> > Otherwise assert_rpm_wakelock_held() also includes
> > assert_device_not_suspended(), since that should be true in all other
> > cases.
>
> Ok, that makes sense. Should be in the commit message ;-)

Yea, I pieced together the changes on the way based on the discussion
and ideas from Chris, so it's not all in the log:) Will update it.

> Instead of cooking our own, what about checking
> pci_dev->base.power.runtim_status == PM_SUSPENDING plus a comment?

Yea, I was thinking also about that. If you mean to use it instead of
the new wakelock ref: the problem with that is that PM_SUSPENDING gets
set only right before the handler is called (with an optional delay +
work item). But we want to check things already before, right after the
last ref is dropped from the driver's POV. This has btw the benefit
that we have coverage even if RPM is completely disabled.

If you meant to use RPM_SUSPENDED instead of pm.suspended, perhaps we
could do that. The only drawback that I can see now is accessing RPM
internals, not sure how big of an issue that is.

--Imre