[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201208140006.37977.rjw@sisk.pl>
Date: Tue, 14 Aug 2012 00:06:37 +0200
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Linux PM list <linux-pm@...r.kernel.org>,
Ming Lei <tom.leiming@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>
Subject: Re: [PATCH][Alternative][RFC] PM / Runtime: Introduce driver runtime PM work routine
On Monday, August 13, 2012, Alan Stern wrote:
> On Mon, 13 Aug 2012, Rafael J. Wysocki wrote:
>
> > > I guess the best we can say is that if you call pm_runtime_barrier()
> > > after updating the dev_pm_ops method pointers then after the barrier
> > > returns, the old method pointers will not be invoked and the old method
> > > routines will not be running. So we need an equivalent guarantee with
> > > regard to the pm_runtime_work pointer. (Yes, we could use a better
> > > name for that pointer.)
> > >
> > > Which means the code in the patch isn't quite right, because it saves
> > > the pm_runtime_work pointer before calling rpm_resume(). Maybe we
> > > should avoid looking at the pointer until rpm_resume() returns.
> >
> > Yes, we can do that.
> >
> > Alternatively, we can set power.work_in_progress before calling
> > rpm_resume(dev, 0) (i.e. regard the resume as a part of the work) to make
> > the barrier wait for all of it to complete.
>
> Yep, that would work. In fact, I did it that way in the proposed code
> posted earlier in this thread. (But that was just on general
> principles, not because I had this particular race in mind.)
OK
I need to prepare a new patch now, but first I'll send a couple of (minor)
fixes for the core runtime PM code.
Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists