Re: [PATCH 2/2] clk: qcom: gcc-sc7280: Keep USB GDSC power domains on when USB wakeup is enabled

Johan Hovold
2022-08-24T08:48:42Z

On Tue, Aug 23, 2022 at 09:42:53AM -0700, Matthias Kaehlcke wrote:
> On Tue, Aug 23, 2022 at 01:16:36PM +0200, Johan Hovold wrote:
> > On Mon, Aug 22, 2022 at 11:53:11AM -0700, Matthias Kaehlcke wrote:
> > > Set GENPD_FLAG_ACTIVE_WAKEUP for the USB GDSC power domains of SC7280.
> > >
> > > Suggested-by: Johan Hovold <johan+linaro@kernel.org>
> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > > ---
> > >
> > > drivers/clk/qcom/gcc-sc7280.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c
> > > index 7ff64d4d5920..4ff855269467 100644
> > > --- a/drivers/clk/qcom/gcc-sc7280.c
> > > +++ b/drivers/clk/qcom/gcc-sc7280.c
> > > @@ -3125,6 +3125,7 @@ static struct gdsc gcc_usb30_prim_gdsc = {
> > > .gdscr = 0xf004,
> > > .pd = {
> > > .name = "gcc_usb30_prim_gdsc",
> > > + .flags = GENPD_FLAG_ACTIVE_WAKEUP,
> >
> > Have you verified that the power-domain doesn't need to remain on also
> > when USB isn't used for wakeup?
>
> So far I haven't observed issues with this on sc7180 and sc7280 when USB
> wakeup is disabled.

Ok, good.

I would have assumed that it needed to stay always-on before the
s/device_can_wakeup/device_may_wakeup/ change as before that the PHYs
would be left on regardless of the (sysfs) wakeup setting.

> > This is the case for sc8280xp and indicates that there are further
> > missing pieces here (at least for that platform).
>
> What are you observing on sc8280xp when wakeup is disabled?

The wakeup setting doesn't seem to have anything to do with the genpd
issues on sc8280xp and the controller doesn't resume properly regardless
of whether the PHYs have been disabled or not during suspend unless the
PD is left on.

Wakeup itself notably works either way.

Johan