[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0803261032140.4969-100000@iolanthe.rowland.org>
Date: Wed, 26 Mar 2008 10:40:27 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Oliver Neukum <oliver@...kum.org>
cc: "Rafael J. Wysocki" <rjw@...k.pl>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
<linux-pm@...ts.linux-foundation.org>,
Alexey Starikovskiy <astarikovskiy@...e.de>,
Johannes Berg <johannes@...solutions.net>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level
suspend and hibernation callbacks (rev. 2)
On Wed, 26 Mar 2008, Oliver Neukum wrote:
> 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?
It depends entirely on the driver and subsystem; generalizations are
not possible. When appropriate, they can copy the scheme used by USB.
Or they can make up their own scheme.
> > 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.
Nonsense.
> We've made
> a guarantee to drivers that they wil not be woken unless their parents are
> awake.
No we haven't. The guarantee is only that the PM core will call the
parent's resume method before calling the child's method. There is no
guarantee about whether the method succeeds or the parent is awake.
Remember, the whole purpose of this is to let drivers know when the
system is going to sleep or waking up. Proper handling of devices is
up to the drivers, not up to the core.
> 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.
Depends what you mean. In some cases it is possible -- i.e., you can
do it and the kernel won't crash, although the new children probably
won't be usable. In any case it doesn't matter; the PM core doesn't
care whether children are added to a dead parent, only drivers care.
> It's the very reason for this rewrite.
No it isn't. See Rafael's changelog ocmments; the rewrite is being
done for completely different reasons.
Alan Stern
--
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