[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb
Subject:    Re: Changes to USB runtime PM
From:       Alan Stern <stern () rowland ! harvard ! edu>
Date:       2009-11-27 17:00:09
Message-ID: Pine.LNX.4.44L0.0911271152590.30903-100000 () netrider ! rowland ! org
[Download RAW message or body]

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic