Re: [PATCH 1/5] introduce .wakeup_event ops

Alan Stern
2009-08-19T14:49:29Z

On Wed, 19 Aug 2009, Shaohua Li wrote:

> Introduce .wakeup_event(). When a device gets a wakeup event,
> the callback is called. The callback usually should check if the device
> really invokes wakeup event and disable wakeup event if yes.
>
> Usually driver should does nothing in the op as bus can handle it. But in some
> cases, like pci bus, UHCI controller doesn't use standard PME registers for
> wakeup, instead of using special approach. In this case, UHCI controller driver
> should implement this op.

I don't understand the reason behind this. Doesn't this sort of thing
belong in the bus and platform code, not in the PM core? (In the case
of UHCI, it should be handled by the platform, in the same way as
remote wakeup gets enabled before the suspend.)

Drivers don't have to be involved at all. When a wakeup signal is
detected, the driver's runtime_resume method should get called --
nothing more is needed.

Alan Stern