On Wed, 12 Oct 2011, Matthew Garrett wrote: > On Wed, Oct 12, 2011 at 09:03:00AM +0200, Oliver Neukum wrote: > > Am Dienstag, 11. Oktober 2011, 18:43:55 schrieb Alan Stern: > > > On Tue, 11 Oct 2011, Dmitry Torokhov wrote: > > > > > > 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? We may be talking about different things. choose_wakeup() is called for system suspend, whereas autosuspend_check() is called (obviously!) for autosuspend. Yes, choose_wakeup() uses device_may_wakeup(). But I was referring only to autosuspend (as was Dmitry). In autosuspend_check(), do_remote_wakeup is set to w, which is the result of or'ing all the intf->needs_remote_wakeup values. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html