Re: [PATCH v1 2/2] USB: set hub's default autosuspend delay as 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 25 Sep 2012, Ming Lei wrote:

> On Tue, Sep 25, 2012 at 1:06 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Tue, 25 Sep 2012, Ming Lei wrote:
> >
> >> IMO, it should be reasonable to set the device's autosuspend delay
> >> as zero when its driver is unbound because no one can predict when
> >> the device will be bound to a new driver.
> >
> > It could be set to a low value, but it shouldn't be set to 0.  There
> 
> If so, I'd rather to keep the default 2 seconds. Changing it to zero can
> avoid one auto suspend timer which may increase CPU power usage.

By how much?  That is, how many times is an unbound USB device going to
be autosuspended?

Do you have any particular use cases in mind where the extra CPU power 
usage will matter?

> > aren't too many things you can do with an unbound device; lsusb is one
> > of the most common.
> 
> Considered 'lsusb' is a low frequency tool for final users, so could we just
> ignore it for the case?

It depends on the case.  What sort of device do you have in mind?

> > On the other hand, we already have a usbcore module parameter for
> > specifying the default autosuspend delay.  That's what the delay is set
> > to when a device is first initialized, before it is bound to anything.
> > Unfortunately the parameter's value is in seconds, not milliseconds, so
> > we can't set it to any positive value smaller than 1 second.
> 
> It is a global and can't be used to just change on unbound device.

That's right; it affects every device.

But think of it this way: Suppose there's no driver for a particular 
device.  Its autosuspend delay will get set to the default initially 
and then there won't be any driver to change it.  So when would the 
delay be changed to 0?

I'm not sure that this is something the kernel needs to worry about.  
Userspace can easily set the default delay to 0 whenever it wants to.  
This won't affect devices that are already plugged in... but userspace 
can also set the delays for those devices whenever it wants to.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux