devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: andersson@kernel.org, Thinh.Nguyen@synopsys.com,
	gregkh@linuxfoundation.org, mathias.nyman@intel.com,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 0/5] usb: dwc3: qcom: Allow runtime PM
Date: Mon, 27 Mar 2023 14:47:33 +0530	[thread overview]
Message-ID: <20230327091733.GA14584@thinkpad> (raw)
In-Reply-To: <cc7392c1-0ea1-29b3-fab6-19c843413724@linaro.org>

On Mon, Mar 27, 2023 at 11:01:35AM +0200, Konrad Dybcio wrote:
> 
> 
> On 25.03.2023 17:52, Manivannan Sadhasivam wrote:
> > Hi,
> > 
> > This series allows the dwc3-qcom driver to do runtime PM itself without
> > userspace intervention. Still, userspace is required to enable runtime PM
> > for dwc3 glue and xhci drivers as we cannot enable runtime PM for them.
> > But this series avoids one more additional step.
> What sort of 'userspace intervention' are we talking about?
> echo mem > /sys/power/state?
> 

I forgot to add that bit:

echo auto > /sys/devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.1.auto/power/control
echo auto > /sys/devices/platform/soc@0/a8f8800.usb/a800000.usb/power/control

You need to set "auto" for the runtime control for both xhci and dwc drivers.

Then if you don't connect a usb device, all 3 drivers (dwc3-qcom, dwc3, and
xhci) will become runtime suspended after a delay of 5s (default delay).

This can be confirmed by:

cat /sys/devices/platform/soc@0/a8f8800.usb/power/runtime_status

After connecting a usb device, they will all become "active".

Thanks,
Mani

> Konrad
> > 
> > While enabling runtime PM, I noticed that the xhci driver suspends before
> > catching the xhci interrupts during resume. This ended up deferring the
> > device enumeration for some time. So I included a patch adding autosuspend
> > delay of 200ms to the xhci driver. With this delay, usb enumeration happens
> > properly.
> > 
> > This series has been tested on SC8280XP-CRD and RB5 devices.
> > 
> > Thanks,
> > Mani
> > 
> > Manivannan Sadhasivam (5):
> >   arm64: dts: qcom: sc8280xp: Add missing dwc3 quirks
> >   xhci: host: Use 200ms autosuspend delay for runtime suspend
> >   usb: dwc3: qcom: Fix null ptr access during runtime_suspend()
> >   usb: dwc3: qcom: Clear pending interrupt before enabling wake
> >     interrupt
> >   usb: dwc3: qcom: Allow runtime PM
> > 
> >  arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 14 ++++++++++++++
> >  drivers/usb/dwc3/dwc3-qcom.c           | 13 +++++++++----
> >  drivers/usb/host/xhci-plat.c           |  2 ++
> >  3 files changed, 25 insertions(+), 4 deletions(-)
> > 

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2023-03-27  9:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 16:52 [PATCH 0/5] usb: dwc3: qcom: Allow runtime PM Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 1/5] arm64: dts: qcom: sc8280xp: Add missing dwc3 quirks Manivannan Sadhasivam
2023-03-28  8:54   ` Johan Hovold
2023-03-28  9:38     ` Manivannan Sadhasivam
2023-03-29  5:26       ` Manivannan Sadhasivam
2023-03-29  8:34         ` Johan Hovold
2023-03-29 11:24           ` Konrad Dybcio
2023-03-29 12:15             ` Johan Hovold
2023-03-29 13:23           ` Manivannan Sadhasivam
2023-04-04 11:25             ` Johan Hovold
2023-03-25 16:52 ` [PATCH 2/5] xhci: host: Use 200ms autosuspend delay for runtime suspend Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 3/5] usb: dwc3: qcom: Fix null ptr access during runtime_suspend() Manivannan Sadhasivam
2023-03-28  9:23   ` Johan Hovold
2023-03-28  9:47     ` Manivannan Sadhasivam
2023-03-28  9:51       ` Johan Hovold
2023-03-28 10:08         ` Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 4/5] usb: dwc3: qcom: Clear pending interrupt before enabling wake interrupt Manivannan Sadhasivam
2023-03-28  9:28   ` Johan Hovold
2023-03-28  9:50     ` Manivannan Sadhasivam
2023-03-25 16:52 ` [PATCH 5/5] usb: dwc3: qcom: Allow runtime PM Manivannan Sadhasivam
2023-03-28  9:46   ` Johan Hovold
2023-03-28 10:05     ` Manivannan Sadhasivam
2023-03-28 12:18       ` Johan Hovold
2023-03-28 12:57         ` Manivannan Sadhasivam
2023-03-28 13:35           ` Johan Hovold
2023-03-27  9:01 ` [PATCH 0/5] " Konrad Dybcio
2023-03-27  9:17   ` Manivannan Sadhasivam [this message]
2023-03-27  9:24     ` Konrad Dybcio
2023-03-27 10:10       ` Manivannan Sadhasivam
2023-03-27 10:33         ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230327091733.GA14584@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).