Re: USB suspend/resume

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

 



On Tue, 22 Sep 2009, Yang Fei-AFY095 wrote:

> Hello All,
>  
> I'm currently having a USB class driver to control bus suspend/resume
> using autopm_get_interface and autopm_put_interface. This works fine
> until system wide suspend comes into the picture, which would suspend
> the bus again after the bus has already been suspended and resume the
> bus even the upper layer driver doesn't have anything to do.
>  
> I would like to change usb_suspend and usb_resume function in
> drivers/usb/core/driver.c so that the variable udev->skip_sys_resume can
> take effect preventing system wide suspend from suspending and resuming
> the bus un-necessarily.

It already has that effect.  So why do you want to change the code?

Note that in the future this behavior is likely to change, when USB 
switches over to the new driver-model runtime PM framework.

> But there is this comment in the usb_suspend
> function,
>  
>  /* If udev is already suspended, we can skip this suspend and
>   * we should also skip the upcoming system resume.  High-speed
>   * root hubs are an exception; they need to resume whenever the
>   * system wakes up in order for USB-PERSIST port handover to work
>   * properly.
>   */
>  if (udev->state == USB_STATE_SUSPENDED) {
>   if (udev->parent || udev->speed != USB_SPEED_HIGH)
>    udev->skip_sys_resume = 1;
>   return 0;
>  }
>  
>  
> My question is, if the host is connnecting to a high speed device, what
> would be the impact to remove the condition "udev->speed !=
> USB_SPEED_HIGH" in this function?

Removing that test would cause full-speed root hubs (i.e., USB-1.1 root 
hubs) to be resumed unnecessarily.  This is true regardless of whether 
the host is connected to a high-speed device.

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