[linux-pm] [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 2)
Oliver Neukum
oliver at neukum.org
Wed Mar 26 07:24:17 PDT 2008
Am Mittwoch, 26. März 2008 15:10:01 schrieb Alan Stern:
> > > IMO you must always keep the ordering invariant. If a parent returns an error
> > > the PM core must not wake its children.
>
> Don't think of it that way. The PM core doesn't wake anything. It
> merely notifies drivers that the system sleep is ending, so that the
> drivers can wake their devices. It's up to the driver to detect
> whether the parent failed to resume, in which case the driver should
> take appropriate action.
How do you propose that every driver should check the power state
of its parent? Without locking the parent?
> The situation is no different from what happens when the user tries to
> access a mounted USB disk drive after the USB cable has been unplugged.
> The drivers take care of everything.
That completely throws away the reason to have a PM core. We've made
a guarantee to drivers that they wil not be woken unless their parents are
awake. In fact the semantics of the callbacks are defined in a way that
adding devices to a parent can be enabled. You cannot add children to a
dead parent. It's the very reason for this rewrite.
Regards
Oliver
More information about the linux-pm
mailing list