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

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

 



On Thu, 27 Sep 2012, Ming Lei wrote:

> This patch sets hub device's default autosuspend delay as 0 to
> speedup bus suspend, see comments in code for details.
> 
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -1629,6 +1629,40 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  	desc = intf->cur_altsetting;
>  	hdev = interface_to_usbdev(intf);
>  
> +	/*
> +	 * Set default autosuspend delay as 0 to speedup bus suspend,
> +	 * based on the below considerations:
> +	 *
> +	 * - Unlike other drivers, the hub driver does not rely on the
> +	 *   autosuspend delay to provide enough time to handle a wakeup
> +	 *   event, and the submitted status URB is just to check future
> +	 *   change on hub downstream ports, so it is safe to do it.
> +	 *
> +	 * - The patch might cause one or more auto supend/resume for
> +	 *   below very rare devices when they are plugged into hub
> +	 *   first time:
> +	 *
> +	 *   	devices having trouble initializing, and disconnect
> +	 *   	themselves from the bus and then reconnect a second
> +	 *   	or so later
> +	 *
> +	 *   	devices just for downloading firmware, and disconnects
> +	 *   	themselves after completing it
> +	 *
> +	 *   These quite rare devices still can change the autosuspend
> +	 *   delay of their parent hub in the probe() to one appropriate
> +	 *   value to avoid the subtle problem if someone does care it.

It's not a good idea for some random USB driver to start changing the 
parent hub's autosuspend delay.  In fact, it's not a good idea for 
_any_ driver to start changing settings for devices it doesn't own.

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