From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Roy Luo <royluo@google.com>
Cc: "Thinh Nguyen" <Thinh.Nguyen@synopsys.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Peter Griffin" <peter.griffin@linaro.org>,
"André Draszik" <andre.draszik@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Joy Chakraborty" <joychakr@google.com>,
"Naveen Kumar" <mnkumar@google.com>,
"Badhri Jagan Sridharan" <badhri@google.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] usb: dwc3: Add Google Tensor SoC DWC3 glue driver
Date: Thu, 6 Nov 2025 00:38:45 +0000 [thread overview]
Message-ID: <20251106003830.v22dnomurtqmqc2y@synopsys.com> (raw)
In-Reply-To: <CA+zupgy4qO9X=R7KqEru5kr7tYhgdw=9Z70sLNKj5DTS_J7KZw@mail.gmail.com>
On Tue, Nov 04, 2025, Roy Luo wrote:
> On Tue, Nov 4, 2025 at 10:07 AM Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
> >
> > On Fri, Oct 31, 2025, Roy Luo wrote:
> > > On Wed, Oct 29, 2025 at 6:35 PM Thinh Nguyen <Thinh.Nguyen@synopsys.com> wrote:
> >
> > In dwc3_google_suspend(), looks like is_hibernation is set after you
> > enable pme irq, probably very unlikely, but can the interrupt be
> > asserted then? If so, will there be another interrupt asserted?
> > Otherwise the current logic may think it was spurious interrupt a miss
> > an event.
>
> The pme interrupt can only be asserted after controller is in
> hibernation, that is, after the usb psw dom is turned off and
> the dwc3_google_usb_psw_pd_notifier() callback is
> completed. So no, the interrupt won't fire before is_hibernation
> is set.
Thanks for the confirmation.
<snip>
> > > >
> > > > I'm still trying to wrap my head around how usb_top_pd, usb_psw_pd, and
> > > > the google->dev are working together in the glue here, particularly why
> > > > usb_top_pd is needed. It seems usb_top_pd shouldn't be handled by this
> > > > glued? Do you do anything except setting wakeup-capable?
> > > >
> > > > BR,
> > > > Thinh
> > >
> > > To provide more context, the underlying usb power domain has 3 power
> > > states: Full Power, Power Gated, Off. The usb_top_pd and usb_psw_pd
> > > are the logical power domains to represent the 3 power states.
> > > - Full Power: usb_psw_pd ON, usb_top_p ON.
> > > - Power Gated: usb_psw_pd OFF, usb_top_p ON.
> > > - Off: usb_psw_pd OFF, usb_top_p OFF.
> > >
> > > To enter hibernation, the usb power domain must enter Power Gated
> > > state. To achieve this, this glue driver holds a handle to usb_top_pd
> > > and would cast a vote to keep it ON when attempting to enter
> > > hibernation. In addition, the usb_psw_pd runtime PM is directly tied
> > > to google->dev so that usb_psw_pd would be OFF when google->dev
> > > suspends. Together, the usb power domain would reach Power Gated
> > > state when device suspends.
> > >
> > > I hope this information helps.
> > >
> >
> > Yes. This is very helpful.
> >
> > So, while the glue driver is bound, usb_top_pd is always ON? Even when
> > xhci driver is not bound or when in device mode?
>
> Since usb_top_pd is the parent power domain of usb_psw_pd, and
> usb_psw_pd RPM is directly tied to glue device, usb_top_pd would
> be ON when glue device is active (because usb_psw_pd is ON)
> and would be OFF when glue device suspends in non-hibernation
> scenarios (because usb_psw_pd is OFF). In hibernation scenario,
> a vote is casted for usb_top_pd to keep it on even when the
> glue device is suspended and usb_psw_pd is OFF.
>
> To your question, usb_top_pd is not always ON because it would be
> turned off when the glue device suspends in non-hibernation scenario.
> When in device mode and provided dwc3 dev is active, usb_top_pd
> would be ON because its child usb_psw_pd is ON.
>
Thanks for the clarification and bearing with my questions.
If there's no device connected, do you role-switch back to default mode?
Often I see that the role-switch is defaulted to peripheral and switch
to default mode if there's no connection.
I want to check the case where the device may wakeup by connection but
cannot because it is not in host mode. Do you have a separate
TCPC/connector that can wakeup the system on attachment?
BR,
Thinh
next prev parent reply other threads:[~2025-11-06 0:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 23:34 [PATCH v4 0/2] Add Google Tensor SoC USB controller support Roy Luo
2025-10-17 23:34 ` [PATCH v4 1/2] dt-bindings: usb: dwc3: Add Google Tensor G5 DWC3 Roy Luo
2025-10-22 6:30 ` Krzysztof Kozlowski
2025-10-17 23:34 ` [PATCH v4 2/2] usb: dwc3: Add Google Tensor SoC DWC3 glue driver Roy Luo
2025-10-23 22:43 ` Thinh Nguyen
2025-10-25 0:25 ` Roy Luo
2025-10-30 1:02 ` Thinh Nguyen
2025-10-30 1:35 ` Thinh Nguyen
2025-11-01 0:49 ` Roy Luo
2025-11-01 6:10 ` Greg Kroah-Hartman
2025-11-04 10:28 ` Roy Luo
2025-11-04 2:07 ` Thinh Nguyen
2025-11-04 10:55 ` Roy Luo
2025-11-06 0:38 ` Thinh Nguyen [this message]
2025-11-06 2:38 ` Roy Luo
2025-11-06 23:48 ` Thinh Nguyen
2025-11-07 9:11 ` Roy Luo
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=20251106003830.v22dnomurtqmqc2y@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=andre.draszik@linaro.org \
--cc=badhri@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=joychakr@google.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mnkumar@google.com \
--cc=p.zabel@pengutronix.de \
--cc=peter.griffin@linaro.org \
--cc=robh@kernel.org \
--cc=royluo@google.com \
--cc=tudor.ambarus@linaro.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