Re: defficiencies in the hid autosuspend code
Alan Stern <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 4 Oct 2007, Oliver Neukum wrote:
> Am Donnerstag 04 Oktober 2007 schrieb Alan Stern:
> > On Thu, 4 Oct 2007, Oliver Neukum wrote:
> >
> > > Hi,
> > >
> > > I am thinking about putting the PID detection code back in.
> > >
> > > The problem I am now facing is that moving to a whitelist some
> > > opportunities are missed. What should happen to devices that can suspend
> > > just fine while not in use, like joysticks, but will fail if suspended while
> > > in use. It seems to me that a binary decision on autosuspend is not
> > > enough for USB HID devices. Should there be another channel?
> >
> > It depends on what you mean by "in use". Is the driver able to tell
> > when the joystick is in use? If it is, then all you have to do is put
> > usb_autopm_{get,put}_interface calls around the in-use interval.
>
> Unless, it is a PID device, I know that a joystick that is not opened
> is not in use. However if I use the same definition of "in use" to a mouse
> or a keyboard, they'll always be in use.
>
> I kind safely deal with the keyboard I have and the mouse shows the
> behavior that indicates that it would work if simple movement triggered
> remote wakeup.
>
> For joysticks I am usually saved by needs_remote_wakeup, but how
> do I deal with HID devices that support remote wakeup?
I'm not sure I understand your problem. Are you saying that some
devices will work okay with autosuspend so long as the device file
isn't open, whereas other devices will work okay even when the device
file is open?
In that case there are two possible solutions. One is to rely on
userspace to disable autosuspend whenever it opens the device file.
This may not be practical, but in the end something like it may turn
out to be best.
The other is to figure out some way for the driver to know whether the
open routine should call usb_autopm_get_interface(), and similarly for
the close routine. I don't like the idea of adding a sysfs attribute
for this, or even changing the power/level attribute (e.g., add an
"auto-closed" setting).
I am open to suggestions.
Alan Stern
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel