Am Donnerstag, 8. Februar 2007 17:00 schrieb Alan Stern:

> First of all, note that 3) above isn't a problem.  If a driver doesn't 
> have supports_autosuspend set, or if it calls usb_autopm_get_interface(), 
> then the device won't be autosuspended at all.  So we can eliminate this 
> case; it's already handled okay.

Yes.
 
> 1) reduces to 2) with x = 0.  So let's concentrate on 2).  The "when idle"  
> part is solved by adding the USB_DF_DEVICE_BUSY flag, leaving only the
> "delay = x" part.  You want this delay to be per-interface, and you want
> it to be settable by the user.  I'm not so sure this is a good 
> combination.

I insist on settability by the user.
The granularity is debateable.

> Let's consider a hypothetical example: an HID device with two interfaces,
> one for a keyboard and one for a mouse.  (By the way, this isn't how real
> USB mouse/keyboard combos work -- they are compound devices with an
> embedded hub, not composite devices.)  The user is willing to let the

But they be valid devices to build.

> keboard autosuspend after 3 seconds of inactivity, but doesn't want the
> mouse to suspend until after 20 seconds.  However it's not possible to
> suspend one or the other; we can only suspend both or neither.

Yes. It is clear that if both want idleness to be taken into account, we
need the maximum.

> A simple approach is to use a single device-wide inactivity delay of 20 
> seconds.  This won't be optimal; it doesn't handle situations where the 
> mouse has been idle for a long time while the keyboard gets used.  But at 
> least it's correct.  Futhermore it doesn't require the user to specify 
> two different delay values -- it would be one device, one delay.

We go to considerable lengths to present interfaces as devices. Each
interface would be its own input device to user space. We should not
make it important which logical devices are grouped together physically.

> A more complicated approach is to keep track of the activity level of each
> interface separately.  Apparently this is what you're in favor of, but it
> would involve considerably more work.  We would have to store the last
> time each interface was used (a jiffies value, not just an activity flag).  
> Deciding when the inactivity timer should expire would involve a
> non-trivial computation.

Only if you insist on the precision. You could simply check every interface's
flag if you are willing to lose a bit of precision. But you'd set a correct 
timer
next time.

        Regards
                Oliver


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to