lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Aug 2016 10:25:55 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Baolin Wang <baolin.wang@...aro.org>
cc:	Peter Chen <hzpeterchen@...il.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	<stefan.koch10@...il.com>, Oliver Neukum <oneukum@...e.com>,
	Muhammad Falak R Wani <falakreyaz@...il.com>,
	Mark Brown <broonie@...nel.org>,
	USB <linux-usb@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: core: Add runtime resume checking

On Wed, 10 Aug 2016, Baolin Wang wrote:

> >> >> For example: No slave attached----> usb interface runtime suspend
> >> >> ----> usb device runtime suspend -----> xhci suspend -----> power off
> >> >> usb controller. After that if the system wants to enter suspend state,
> >> >> then it also will issue usb_dev_suspend(), then the
> >> >> pm_runtime_resume() function (issued in choose_wakeup() function) will
> >> >> return -ESHUTDOWN due to xhci has been suspend and hardware is not
> >> >> accessible.
> >> >
> >> > Why the controller does not be resumed when the root hub has issued
> >> > runtime resume?
> >>
> >> Because now there is no slave attached, we will not power on usb
> >> controller and resume xhci.
> >>
> >
> > I don't know why you set policy like this. Even the controller is
> > resumed, it will still be suspended by system suspend. What's more,
> > if you disallow it, how can you change your wakeup setting?
> > Eg, at runtime suspend, we enable wakeup by default. But for system
> > sleep, we disable wakeup by default.
> >
> > At runtime, if there is no device on the port, even we resumes the
> > controller and roohub, it still will be suspended soon.
> 
> For saving power, if there is no slave attached, why we need to power
> on usb controller and resume xhci? Especially for mobile device.

You need to power-on the USB controller in order to change the wakeup
setting.

> Moreover the usb device runtime suspend/resume is separate with xhci
> suspend/resume, when xhci entered suspend state, only slave attaching
> can resume xhci.

That's right.  Suppose the user wants the system to stay asleep when a
slave attaches.  But when you suspended the xHCI controller, it was set
to wake up when a new slave attaches.  So when a slave is attached, the 
controller will wake up the system.  That's bad.

If the wakeup setting needs to be changed when the system suspend
begins, then you have to power-on the controller to make that change.

Given a choice between using a little power or behaving incorrectly, 
you should choose to use the power.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ