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

Shaohua Li
2009-08-20T03:04:23Z

On Wed, Aug 19, 2009 at 10:49:30PM +0800, Alan Stern wrote:
> 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.
The only case is UHCI in my mind. Because UHCI has non-standard wakeup event
register. If BIOS doesn't handle it correctly (for example, not clear the wakeup
event after a GPE), we will keep see the wakeup event. And the bus/platform
level has no knowledge to handle such event.

Thanks,
Shaohua