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] [day] [month] [year] [list]
Message-ID: <CAMz4kuLSag7REoeBkM9w6wK0BoT0v5oKfp1xL1Yx9kevf=QwQg@mail.gmail.com>
Date:	Thu, 11 Aug 2016 15:39:09 +0800
From:	Baolin Wang <baolin.wang@...aro.org>
To:	Peter Chen <hzpeterchen@...il.com>
Cc:	Alan Stern <stern@...land.harvard.edu>,
	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 v2] usb: core: Add runtime resume checking in choose_wakeup()

Hi Peter,

On 11 August 2016 at 14:52, Peter Chen <hzpeterchen@...il.com> wrote:
> On Thu, Aug 11, 2016 at 11:11:08AM +0800, Baolin Wang wrote:
>> On 10 August 2016 at 22:31, Alan Stern <stern@...land.harvard.edu> wrote:
>> > On Wed, 10 Aug 2016, Baolin Wang wrote:
>> >
>> >> Considering strict power management for mobile device, we should also power
>> >> off the usb controller if there are no slaves attached even though it is usb
>> >> host function, but it will meet usb device resume failure in below situation.
>> >>
>> >> Suppose that 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() issued in choose_wakeup()
>> >> function will return '-ESHUTDOWN' due to xhci has been suspend and hardware is
>> >> not accessible.
>> >
>> > No, this is wrong.  The pm_runtime_resume in choose_wakeup() should
>> > cause the xHCI controller to resume also.
>>
>> But now it won't, it just resume usb device not xHCI controller. I
>> suppose mainline kernel does not sopport this now.
>>
>
> Why? It works ok at my environment. The controller is the ancestor of
> the USB device, if the USB device would like to be woken up, the

Yes, the controller is the ancestor of the USB device. The routine
will be like below if we resume USB device:

usb_resume_device() ----> generic_resume() ----> hcd_bus_resume() --->
xhci_bus_resume(), but now xHCI is not accessible due to
xhci_suspend() is issued and USB controller is power off when no slave
attached. If we want to resume USB device sucessfully, we must
power-on USB controller and resume xhci by issuing xhci_resume(), but
now how to trigger the USB controller action and resume xHCI just from
pm_runtime_resume() function?

> controller will be woken up first.

I suppose your xHCI controller will not be suspended and your USB
controller will not be power-off when no slave attached (but now
system is not in suspend state), right?

-- 
Baolin.wang
Best Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ