Re: [PATCH] PM / core: Fix direct_complete handling for devices with no callbacks

From: Rafael J. Wysocki
Date: Thu May 24 2018 - 05:21:35 EST


On Tuesday, May 22, 2018 1:41:06 PM CEST Ulf Hansson wrote:
> On 22 May 2018 at 13:02, Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> >
> > Commit 08810a4119aa (PM / core: Add NEVER_SKIP and SMART_PREPARE
> > driver flags) inadvertently prevented the power.direct_complete flag
> > from being set for devices without PM callbacks and with disabled
> > runtime PM which also prevents power.direct_complete from being set
> > for their parents. That led to problems including a resume crash on
> > HP ZBook 14u.
> >
> > Restore the previous behavior by causing power.direct_complete to be
> > set for those devices again, but do that in a more direct way to
> > avoid overlooking that case in the future.
> >
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=199693
> > Fixes: 08810a4119aa (PM / core: Add NEVER_SKIP and SMART_PREPARE driver flags)
> > Reported-by: Thomas Martitz <kugel@xxxxxxxxxxx>
> > Tested-by: Thomas Martitz <kugel@xxxxxxxxxxx>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> It seems like the resume path of HP ZBook 14u is kind of fragile,

Yes, it is.

> in case it *requires* dev->power.direct_complete to be set for devices
> like these. And that makes me wonder, that perhaps we should try to
> address that issue as well, no?

Yes, in principle.

But since the direct_complete handling needs to be fixed anyway, it doesn't
matter a lot in practice, because the resume issue on HP ZBook 14u will not
be reproducible anyway then. And since the dependency clearly is on a device
with no callbacks, I'm not worried too much about that.