Re: [PATCH V3] input: Fix USB autosuspend on bcm5974
From: Matthew Garrett <mjg59@srcf.ucam.org>
Date: 2011-10-12 13:54:43
On Wed, Oct 12, 2011 at 09:03:00AM +0200, Oliver Neukum wrote:
Am Dienstag, 11. Oktober 2011, 18:43:55 schrieb Alan Stern:quoted
On Tue, 11 Oct 2011, Dmitry Torokhov wrote:quoted
quoted
Hmm, reading Alan's comment I can see why wakeup might be beneficial when system is in the sleep state, but while it is running and there is no driver or driver wants to disable wakeups I think we should accommodate it.Currently, wakeup is enabled for USB devices during autosuspend if and only if one or more of the interface drivers has set the intf->needs_remote_wakeup flag. Therefore all that usbhid should need to do is clear that flag when the device file is closed.Now I am confused because Matthew reported that his device generated remote wakeups without setting needs_remote_wakeup at all. Matthew, could you clarify?
I /think/ Alan's wrong here - do_remote_wakeup is set to device_may_wakeup(), which will be true if the device can generate remote wakeups even if nothing's asked for them. I'm basing this on autosuspend_check() and choose_wakeup(). Alan, am I misinterpreting this code? -- Matthew Garrett | mjg59@srcf.ucam.org