[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMz4kuKduxnuhhFzeCKzP6J9Ab7x07f0_ugdrJXRTet56qga4Q@mail.gmail.com>
Date: Thu, 11 Aug 2016 11:11:08 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: Alan Stern <stern@...land.harvard.edu>
Cc: 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()
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.
>
>> After system entering resume state, if there is slave attached ----> power on
>> usb controller ----> xhci resume ----> usb device runtime resume ---->
>> usb interface runtime resume. But usb device will resume failed if runtime
>> errors is set ('-ESHUTDOWN'), thus we should clear the runtime errors in
>> choose_wakeup() function to avoid this situation.
>
> If the controller resumes correctly, this won't be necessary.
>
> Alan Stern
>
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists