On Thu, 26 Nov 2009, Oliver Neukum wrote: > > If not, you can be most efficient by doing something like this: > > > > if (!disconnected) { > > intf->needs_remote_wakeup = 0; > > if (currently autosuspended) > > How do I do that without a race? That line was written wrongly; it should be more like: if (there isn't an unbalanced autopm_get) But likely at this point you would never have an unbalanced autopm_get. > > usb_autopm_get_interface_no_resume(intf); > > usb_autopm_put_interface(intf); > > } > > > > This way if the device is already suspended, it won't be woken up again > > unnecessarily. > > This very much argues for having an API call for requesting > remote wakeup. Yes, that's a good idea. I'll keep it in the back of my mind. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html