Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755096AbdGXLnD (ORCPT ); Mon, 24 Jul 2017 07:43:03 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:33169 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbdGXLm5 (ORCPT ); Mon, 24 Jul 2017 07:42:57 -0400 MIME-Version: 1.0 In-Reply-To: References: <2086ce508be1c1d75d47c892a5be9593b12fa6f3.1500619870.git.baolin.wang@linaro.org> <0f1345b4-292c-1881-8bba-d81293b9ace8@codeaurora.org> <50e53fba-1f69-6ba1-cc9d-8cb02a3e0468@codeaurora.org> From: Baolin Wang Date: Mon, 24 Jul 2017 19:42:56 +0800 Message-ID: Subject: Re: [PATCH] usb: dwc3: Support the dwc3 host suspend/resume To: Manu Gautam Cc: Felipe Balbi , Greg KH , USB , LKML , Linaro Kernel Mailman List , Mark Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2771 Lines: 73 Hi Manu, On 24 July 2017 at 17:38, Manu Gautam wrote: > Hi, > > > On 7/24/2017 2:45 PM, Baolin Wang wrote: >> Hi Manu, >> >> On 24 July 2017 at 16:42, Manu Gautam wrote: >>> Hi Baolin, >>> >>> >>> On 7/24/2017 11:26 AM, Baolin Wang wrote: >>> >>>>>>> Other than what I pushed in my patch - >>>>>>> ("usb: dwc3: Don't reinitialize core during host bus-suspend/resume") >>>>>>> Just performing pm_request_resume or handling same in dwc3 glue >>>>>>> driver should be sufficient. >>>>>> Yes. >>>>>> >>>>>>> Also, what is trigger for runtime_resume for your platform? >>>>>> In our platform glue layer, we have extcon events to notify there are >>>>>> devices connected, then gule layer will resume dwc3 device. >>>>>> >>>>> IMO you can just perform resume of &dwc->xhci->dev instead of resuming dwc3. >>>>> Since, dwc3 is parent of xhci that will trigger resume of dwc3 as well. >>>> I am not sure this is good enough but it seems can solve some >>>> problems, then we do not need resume/suspend host in dwc3 core. >>> In that case can we proceed with this patch: >>> [1] https://www.spinics.net/lists/linux-usb/msg158682.html >>> >>> For your platform you can pick this patch and resume dwc->xhci->dev resume >>> from your glue driver. >>> Do you have any other concerns? >> The same concern I explained in your patch. If we power off the >> controller when suspend, how can controller work well as host if we do >> not issue dwc3_core_init()? Suppose below cases: >> device attached: resume glue layer (power on dwc3 controller) ---> >> resume dwc3 device ---> resume xHCI device > Just resume won't do. XHCI also needs to be reinitialized. > >> no device attached: suspend xHCI device ---> suspend dwc3 device ---> >> suspend glue layer (we can power off the dwc3 controller now) >> >> Though now there are no upstreamed glue drivers will power off dwc3 >> controller, should we consider this situation? >> > > Can we discuss on that patch thread itself? > > How will this platform handle runtime PM with only external HUB > connected? Will runtime suspend take place? > Would connecting device to that HUB's port be detected? No, it should not suspend xHCI now. Maybe need get xHCI device usage counter for this case in case xHCI can suspend automatically if there are no device connected. > > Since, there is no upstreamed glue driver currently doing, we can > probably ignore that. Also, above sequnence wont work without xhci init. > > Also, for this particular case glue driver can take care of re-initializing of > dwc3 core as well. Glue layer can not re-initialize of dwc3 core now since dwc3_core_init() is not exported. Let's see what Felipe's suggestion on your patch thread. -- Baolin.wang Best Regards