Re: [linux-pm] [PATCH v2] Add suspend/resume for HPET

From: Alan Stern
Date: Mon Apr 02 2007 - 10:17:01 EST


On Saturday March 31, 2007, David Brownell wrote:

> I'm about ready to test the appended patch... a "move one device" call
> might be safest at this point in the release cycle though.
>
> - Dave
>
> ======================== SNIP!
> Change how the PM list is constructed, so that devices are added right
> after their parents (when they have one) rather than at the end of the
> list. This preserves sequencing guarantees, but enables sequencing of
> suspend/resume operations by more important characteristics than "when
> device happened to enumerate" ... e.g. clocksources and clockevents
> at a clearly defined point during suspend and resume.
>
> This patch has a potential downside for devices that have multiple
> power dependencies and which "just happened to work" before.

Dave:

Would you mind retracting this patch? It will interfere with some work
I've been doing in USB, work that relies on exactly the sort of multiple
power dependency you mention.

The problem is this: When a low- or full-speed USB device is resumed
following a power loss (this is part of the "persistent USB" patch), it's
necessary for the corresponding EHCI root hub to be resumed first so that
the port's OWNER bit can be set properly.

It works fine as long as devices are resumed in order of registration,
because a low- or full-speed USB device can't be registered before the
high-speed root hub. (If it was, it would be disconnected when the
high-speed root hub initialized and took control of the port.) So this
isn't a "just happened to work" situation; it really is a critical
ordering dependency.

The clock source problem can be solved in other ways. For instance, right
now things are set up so that clock sources are registered at various
random times and the clockevents code adapts to use the best available
device, right?. So simply arrange for a clock source to "depart" as it is
suspended; then clockevents can fall back to using other lower-precision
sources. As long as devices suspend in reverse order of discovery, the
system should always function properly.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/