From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Peter Chen <peter.chen@oss.qualcomm.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Bjorn Andersson <andersson@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johan Hovold <johan@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Wesley Cheng <wesley.cheng@oss.qualcomm.com>,
Udipto Goswami <udipto.goswami@oss.qualcomm.com>,
Jack Pham <jack.pham@oss.qualcomm.com>,
Pratham Pratap <pratham.pratap@oss.qualcomm.com>,
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
Prashanth K <prashanth.k@oss.qualcomm.com>,
Elson Serrao <elson.serrao@oss.qualcomm.com>,
"cros-qcom-dts-watchers@chromium.org"
<cros-qcom-dts-watchers@chromium.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/1] usb: dwc3: qcom: Keep wakeup option default off
Date: Fri, 4 Dec 2026 03:12:35 +0000 [thread overview]
Message-ID: <axIqBQ5A2xrEd4XD@vbox> (raw)
In-Reply-To: <axFVN1Hexh9T9WmH@hu-petche-lv.qualcomm.com>
On Thu, Dec 03, 2026, Peter Chen wrote:
> On 26-12-03 02:41:47, Thinh Nguyen wrote:
> > On Tue, Nov 24, 2026, Peter Chen wrote:
> > > On 26-11-24 03:11:17, Thinh Nguyen wrote:
> > > > On Thu, Nov 12, 2026, Peter Chen wrote:
> > > > > When talking about whole system wakeup chain for USB:
> > > > > dwc3 -> xhci-plat -> roothub -> downstream device
> > > > > it usually depends on user program (per user option), but not bind to
> > > > > kernel driver, considering some situations that USB device are disconnected
> > > > > and re-connected, its wakeup option may need to re-set, and one typical
> > > > > solution is enable wakeup options before system suspend.
> > > >
> > > > I see. Looks like dwc->sys_wakeup is already false since
> > > > device_init_wakeup() is called after dwc3_core_probe(). Can we fix that
> > > > separately so xhci follows power/wakeup at suspend?
> > > >
> > >
> > > Sure, but first, we need to align what behaviours we want:
> > > 1. Who decides dwc3 core has wakeup capabilities?
> > > dwc3 core or glue layer driver?
> >
> > Glue driver since it depends on the platform.
> >
> > > 2. How to decide dwc3 core has wakeup capabilities?
> > > Has wakeup capabilities by default (xhci/cadence/chipidea) or depends on
> > > DT/ACPI firmware setting like "wakeup-source" property?
> >
> > It should be up to the glue driver.
> >
> > > 3. Default on or off for wakeup option (value for power/wakeup)
> >
> > It should be up to each platform. For qcom, it's up to you and Bjorn.
> >
> > > 4. xhci-plat has wakeup capabilities by default, we only need to
> > > set its wakeup option as default on if dwc3 core does the same thing
> > > for question 3.
> > >
> >
> > The xhci should follow controller's power/wakeup setting at suspend. We
> > can do a check before suspend in pm_prepare(), perhaps something like
> > this (not tested):
> >
> > int dwc3_pm_prepare(struct dwc3 *dwc)
> > {
> > ...
> > if (dwc->xhci)
> > device_set_wakeup_enable(&dwc->xhci->dev,
> > device_may_wakeup(dwc->sysdev));
> > ...
> > }
>
> Good suggestion, and I tested it works.
Thanks for testing.
>
> If both wakeup capability and wakeup option are decided by glue layer,
> there is no reason dwc->sys_wakeup existed for dwc3 core, and there is
> no glue layer user for that. But there are behaviour changes, I am not
> sure if there is a regression.
We should keep sys_wakeup. It tracks the platform default setting at
probe, which the gadget start/stop needs. The pm_prepare() change only
affects xhci in host mode.
>
> - At host mode: anything the user writes to xhci's own power/wakeup is
> overwritten at every prepare. Before, it could be set independently of the parent.
That's intended. The controller's power/wakeup is the one that we should
check. The xhci platform device is recreated on role switch, so the
value written to it doesn't persist anyway.
>
> - At device mode, current wakeup option depends on whether gadget start/stop
> or without binding gadget driver. If delete dwc->sys_wakeup, it
> totally depends on glue layer. For commit f9aa41130ac6 ("usb: dwc3: Properly set
> system wakeup"), it describes a bug of enabling wakeup when gadget driver
> is not bound, it seems some other places enable wakeup option, and read dwc3 wakeup
> option, do some settings later. So, I am afraid there may be regression
> for platforms which set wakeup option default on and rely on dwc3 gadget driver
> disable it.
It's not affected if we keep sys_wakeup. For qcom, device_init_wakeup()
should be moved before dwc3_core_probe() so sys_wakeup matches the
glue's setting.
Thanks,
Thinh
prev parent reply other threads:[~2026-12-04 3:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 9:21 [PATCH 0/1] usb: dwc3: qcom: Keep wakeup option default off Peter Chen
2026-11-10 9:21 ` [PATCH 1/1] " Peter Chen
2026-11-10 9:35 ` sashiko-bot
2026-11-12 1:14 ` [PATCH 0/1] " Thinh Nguyen
2026-11-12 8:10 ` Peter Chen
2026-11-24 3:11 ` Thinh Nguyen
2026-11-25 4:47 ` Peter Chen
2026-11-25 9:30 ` Peter Chen
2026-12-03 2:41 ` Thinh Nguyen
2026-12-03 11:40 ` Peter Chen
2026-12-04 3:12 ` Thinh Nguyen [this message]
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=axIqBQ5A2xrEd4XD@vbox \
--to=thinh.nguyen@synopsys.com \
--cc=andersson@kernel.org \
--cc=cros-qcom-dts-watchers@chromium.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=elson.serrao@oss.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jack.pham@oss.qualcomm.com \
--cc=johan@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@oss.qualcomm.com \
--cc=prashanth.k@oss.qualcomm.com \
--cc=pratham.pratap@oss.qualcomm.com \
--cc=udipto.goswami@oss.qualcomm.com \
--cc=wesley.cheng@oss.qualcomm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.