Re: [PATCH] USB: global suspend and remote wakeup don't mix

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

 



On Fri, 12 Jul 2013, Peter Chen wrote:

> On Thu, Jul 11, 2013 at 02:58:04PM -0400, Alan Stern wrote:
> > The hub driver was recently changed to use "global" suspend for system
> > suspend transitions on non-SuperSpeed buses.  This means that we don't
> > suspend devices individually by setting the suspend feature on the
> > upstream hub port; instead devices all go into suspend automatically
> > when the root hub stops transmitting packets.  The idea was to save
> > time and to avoid certain kinds of wakeup races.
> > 
> > Now it turns out that many hubs are buggy; they don't relay wakeup
> > requests from a downstream port to their upstream port if the
> > downstream port's suspend feature is not set (depending on the speed
> > of the downstream port, whether or not the hub is enabled for remote
> > wakeup, and possibly other factors).
> > 
> > We can't have hubs dropping wakeup requests.  Therefore this patch
> > goes partway back to the old policy: It sets the suspend feature for a
> > port if the device attached to that port or any of its descendants is
> > enabled for wakeup.  People will still be able to benefit from the
> > time savings if they don't care about wakeup and leave it disabled on
> > all their devices.
> > 
> 
> I have a question what kinds of cases we can get the time saving?
> 
> - For no hub cases (like most embedded devices), it just moves
> set suspendM at portsc from usb_port_suspend to ehci_bus_suspend

Right.  It has always worked this way, even before the
CONFIG_USB_SUSPEND option was removed.

> - For hub cases, since you said it must send suspend to hub at
> global suspend case (system suspend procedure), this suspend
> request procedure can't be skipped.

No -- it is necessary to send the suspend request to the hub _only_ if 
one of the devices beneath the hub is enabled for remote wakeup.  
Otherwise the suspend request can be skipped.

For example, if you had a USB flash drive plugged into a hub, it 
wouldn't be enabled for remote wakeup.  Therefore its port would not 
need a selective suspend.

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