On Fri, 15 Apr 2011, Guennadi Liakhovetski wrote: > Restore the initial RPM_SUSPENDED runtime pm status, when disabling, > otherwise the following enable will not function. This happens, e.g., > when unloading and reloading drivers. > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx> > Cc: Simon Horman <horms@xxxxxxxxxxxx> > Cc: Magnus Damm <damm@xxxxxxxxxxxxx> > --- > > No, I do not claim to understand the thousand of states, flags, and > counters, this just happens to fix the problem for me. Feel free to make a > correct solution out of this. > > drivers/base/power/runtime.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c > index 3172c60..83d6898 100644 > --- a/drivers/base/power/runtime.c > +++ b/drivers/base/power/runtime.c > @@ -1012,8 +1012,10 @@ void __pm_runtime_disable(struct device *dev, bool check_resume) > pm_runtime_put_noidle(dev); > } > > - if (!dev->power.disable_depth++) > + if (!dev->power.disable_depth++) { > __pm_runtime_barrier(dev); > + dev->power.runtime_status = RPM_SUSPENDED; > + } > > out: > spin_unlock_irq(&dev->power.lock); This certainly doesn't look right. Can you explain in more detail the problem you are trying to solve? Alan Stern _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm