Re: parallel suspend/resume

Alan Stern
2007-12-08T16:26:08Z

On Fri, 7 Dec 2007, David Brownell wrote:

> FWIW the appended patch removes that rude "order of registration"
> policy, so that the suspend/resume list matches the device tree.
> It's behaved OK on PCs and, in light duty, a few development boards;
> I've carried it around most of this year.

Actually I'm surprised that it works with USB devices.

As they are registered, you patch adds new devices to the list
immediately after their parents. This means that the children of a
particular device will be listed in reverse order of registration,
right?

So if you have a USB hub, the hub's children will be added following
the hub, and the hub's interface will come after all the children since
it gets registered before them. Hence during suspend, the interface's
suspend method will be called before any of the children are suspended.
But hub_suspend() will fail if there are unsuspended children.

This is an example of another implicit order dependency: A hub's
interface must be suspended after all the other children of that hub.
It's an artifact of the way USB devices are represented in the device
hierarchy; strictly speaking they should be children of the hub's
interface, not of the hub itself.

Alan Stern