[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMz4kuJzA6Fd+UOV-aocfS6ENgN925n62pa0=PknEO9hemSkcQ@mail.gmail.com>
Date: Thu, 11 Aug 2016 17:08:42 +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] usb: core: Add runtime resume checking
On 11 August 2016 at 16:44, Peter Chen <hzpeterchen@...il.com> wrote:
> On Thu, Aug 11, 2016 at 04:41:27PM +0800, Baolin Wang wrote:
>> >> >>
>> >> >> OK. But that is a real problem. It will pm_runtime_resume() falied
>> >> >> (issued in choose_wakeup()), cause usb controller has powered-off and
>> >> >> xHCI controller has suspended and we have no method to notify the user
>> >> >> to power-on USB controller. Any good suggestion to solve this, Alan
>> >> >> and Peter? Thanks.
>> >> >>
>> >> >
>> >> > Maybe you can show us the call stack why pm_runtime_resume has failed
>> >> > at your environment.
>> >>
>> >> OK. I try to explain it at below:
>> >>
>> >> For example: No slave attached----> usb interface runtime suspend
>> >> ----> usb device runtime suspend (routine is:
>> >> usb_suspend_device()--->generic_suspend() --> hcd_bus_suspend()-->
>> >> xhci_bus_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.
>> >>
>> >> We issue the pm_runtime_resume() function routine: 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. That is why
>> >> pm_runtime_resume failed.
>> >>
>> >
>> > What host controller driver you are using? Assume you are using
>> > xhci-plat.c. The problem for you is this driver does not implement
>>
>> Yes. I use xhci-plat.c.
>>
>> > runtime pm operations, so the flag HCD_FLAG_HW_ACCESSIBLE is not set.
>> > Maybe Robert's patch is a good start for you [1]
>> >
>> > [1] http://www.spinics.net/lists/linux-usb/msg144602.html
>>
>> OK. Maybe I need to implement the runtime PM callbacks for xhci-plat, right?
>>
>
> I think so.
OK. I try to look at it. Thanks.
>
> --
>
> Best Regards,
> Peter Chen
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists