Re: [PATCH v1 1/2] Revert "PM: runtime: Update device status before letting suppliers suspend"

From: Rafael J. Wysocki
Date: Fri Mar 19 2021 - 09:44:44 EST


On Fri, Mar 19, 2021 at 2:31 PM Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote:
>
> On Thu, 18 Mar 2021 at 19:15, Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote:
> >
> > From: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>
> >
> > Revert commit 44cc89f76464 ("PM: runtime: Update device status
> > before letting suppliers suspend") that introduced a race condition
> > into __rpm_callback() which allowed a concurrent rpm_resume() to
> > run and resume the device prematurely after its status had been
> > changed to RPM_SUSPENDED by __rpm_callback().
>
> Huh, the code path is not entirely easy to follow. :-)
>
> Did you find this by code inspection or did you get an error report?

There was a bug report that caused me to look at the code once again.

> > Fixes: 44cc89f76464 ("PM: runtime: Update device status before letting suppliers suspend")
> > Link: https://lore.kernel.org/linux-pm/24dfb6fc-5d54-6ee2-9195-26428b7ecf8a@xxxxxxxxx/
> > Reported by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> > Cc: 4.10+ <stable@xxxxxxxxxxxxxxx> # 4.10+
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>

Thanks!