Thread (43 messages) 43 messages, 8 authors, 2015-06-01

Re: [PATCH 2/5] PM / Wakeirq: Add automated device wake IRQ handling

From: Felipe Balbi <hidden>
Date: 2015-05-14 15:57:07
Also in: linux-omap, linux-pm, lkml

On Thu, May 14, 2015 at 11:51:10AM -0400, Alan Stern wrote:
On Wed, 13 May 2015, Felipe Balbi wrote:
quoted
This brings up a question, actually. What to do with devices which were
already runtime suspended when user initiated suspend-to-ram ? Do we
leave wakeups enabled, or do we revisit device_may_wakeup() and
conditionally runtime_resume the device, disable wakeup, and let its
->suspend() callback be called ?
In theory, the subsystem/device drivers already have code do this.  
They're supposed to, anyway.  The USB host stack does it in
drivers/usb/core/driver.c:choose_wakeup().
that answers the question, specifically, this comment and piece of code
do:

1395 static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
1396 {

[...]

1409         /* Enable remote wakeup if it is allowed, even if no interface drivers
1410          * actually want it.
1411          */
1412         w = device_may_wakeup(&udev->dev);
1413 
1414         /* If the device is autosuspended with the wrong wakeup setting,
1415          * autoresume now so the setting can be changed.
1416          */
1417         if (udev->state == USB_STATE_SUSPENDED && w != udev->do_remote_wakeup)
1418                 pm_runtime_resume(&udev->dev);
1419         udev->do_remote_wakeup = w;
1420 }

so that's something that also needs to be taken into consideration.

Thanks

-- 
balbi

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help