From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: tomm.merciai@gmail.com, linux-renesas-soc@vger.kernel.org,
biju.das.jz@bp.renesas.com, Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Peter Rosin <peda@axentia.se>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/21] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime
Date: Thu, 6 Nov 2025 09:30:51 +0100 [thread overview]
Message-ID: <aQxcu8zNmIi8Hl7Y@tom-desktop> (raw)
In-Reply-To: <180fcd1307af02eadc6136512ef78226bc7c00dd.camel@pengutronix.de>
Hi Philipp,
Thanks for your review!
On Wed, Nov 05, 2025 at 04:59:24PM +0100, Philipp Zabel wrote:
> On Mi, 2025-11-05 at 16:38 +0100, Tommaso Merciai wrote:
> > The driver was disabling the USB2 PHY clock immediately after register
> > initialization in probe() and after each reset operation. This left the
> > PHY unclocked even though it must remain active for USB functionality.
> >
> > The behavior appeared to work only when another driver
> > (e.g., USB controller) had already enabled the clock, making operation
> > unreliable and hardware-dependent. In configurations where this driver
> > is the sole clock user, USB functionality would fail.
> >
> > Fix this by:
> > - Enabling the clock once in probe() via pm_runtime_resume_and_get()
> > - Removing all pm_runtime_put() calls from assert/deassert/status
> > - Registering a devm cleanup action to release the clock at removal
> > - Dropping the unnecessary rzv2h_usbphy_assert_helper() function
> >
> > This ensures the PHY clock remains enabled for the entire device lifetime,
> > preventing instability and aligning with hardware requirements.
> >
> > Fixes: e3911d7f865b ("reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)")
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v1->v2:
> > - Improve commit body and commit msg
> > - Added Fixes tag
> > - Dropped unnecessary rzv2h_usbphy_assert_helper() function
> >
> > drivers/reset/reset-rzv2h-usb2phy.c | 64 ++++++++---------------------
> > 1 file changed, 18 insertions(+), 46 deletions(-)
> >
> > diff --git a/drivers/reset/reset-rzv2h-usb2phy.c b/drivers/reset/reset-rzv2h-usb2phy.c
> > index ae643575b067..5bdd39274612 100644
> > --- a/drivers/reset/reset-rzv2h-usb2phy.c
> > +++ b/drivers/reset/reset-rzv2h-usb2phy.c
> [...]
> > @@ -175,14 +143,14 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
> > if (error)
> > return dev_err_probe(dev, error, "pm_runtime_resume_and_get failed\n");
> >
> > + error = devm_add_action_or_reset(dev, rzv2h_usb2phy_reset_pm_runtime_put,
> > + dev);
> > + if (error)
> > + return dev_err_probe(dev, error, "unable to register cleanup action\n");
> > +
> > for (unsigned int i = 0; i < data->init_val_count; i++)
> > writel(data->init_vals[i].val, priv->base + data->init_vals[i].reg);
> >
> > - /* keep usb2phy in asserted state */
> > - rzv2h_usbphy_assert_helper(priv);
>
> This change is not mentioned in the patch description.
>
> Is initially asserting the reset not required after all?
Since we removed the pm_runtime_put() call from the rzv2h_usb2phy_reset_probe() function,
and power management remains enabled for the entire lifetime of the driver, we also need
to remove rzv2h_usbphy_assert_helper() from rzv2h_usb2phy_reset_probe()
Additionally, when testing the unbind/bind USB2.0 chain, this causes an OOPS on my side.
I’ll mention this in the next version.
Thanks & Regards,
Tommaso
>
> regards
> Philipp
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: tomm.merciai@gmail.com, linux-renesas-soc@vger.kernel.org,
biju.das.jz@bp.renesas.com, Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Peter Rosin <peda@axentia.se>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/21] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime
Date: Thu, 6 Nov 2025 09:30:51 +0100 [thread overview]
Message-ID: <aQxcu8zNmIi8Hl7Y@tom-desktop> (raw)
In-Reply-To: <180fcd1307af02eadc6136512ef78226bc7c00dd.camel@pengutronix.de>
Hi Philipp,
Thanks for your review!
On Wed, Nov 05, 2025 at 04:59:24PM +0100, Philipp Zabel wrote:
> On Mi, 2025-11-05 at 16:38 +0100, Tommaso Merciai wrote:
> > The driver was disabling the USB2 PHY clock immediately after register
> > initialization in probe() and after each reset operation. This left the
> > PHY unclocked even though it must remain active for USB functionality.
> >
> > The behavior appeared to work only when another driver
> > (e.g., USB controller) had already enabled the clock, making operation
> > unreliable and hardware-dependent. In configurations where this driver
> > is the sole clock user, USB functionality would fail.
> >
> > Fix this by:
> > - Enabling the clock once in probe() via pm_runtime_resume_and_get()
> > - Removing all pm_runtime_put() calls from assert/deassert/status
> > - Registering a devm cleanup action to release the clock at removal
> > - Dropping the unnecessary rzv2h_usbphy_assert_helper() function
> >
> > This ensures the PHY clock remains enabled for the entire device lifetime,
> > preventing instability and aligning with hardware requirements.
> >
> > Fixes: e3911d7f865b ("reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)")
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v1->v2:
> > - Improve commit body and commit msg
> > - Added Fixes tag
> > - Dropped unnecessary rzv2h_usbphy_assert_helper() function
> >
> > drivers/reset/reset-rzv2h-usb2phy.c | 64 ++++++++---------------------
> > 1 file changed, 18 insertions(+), 46 deletions(-)
> >
> > diff --git a/drivers/reset/reset-rzv2h-usb2phy.c b/drivers/reset/reset-rzv2h-usb2phy.c
> > index ae643575b067..5bdd39274612 100644
> > --- a/drivers/reset/reset-rzv2h-usb2phy.c
> > +++ b/drivers/reset/reset-rzv2h-usb2phy.c
> [...]
> > @@ -175,14 +143,14 @@ static int rzv2h_usb2phy_reset_probe(struct platform_device *pdev)
> > if (error)
> > return dev_err_probe(dev, error, "pm_runtime_resume_and_get failed\n");
> >
> > + error = devm_add_action_or_reset(dev, rzv2h_usb2phy_reset_pm_runtime_put,
> > + dev);
> > + if (error)
> > + return dev_err_probe(dev, error, "unable to register cleanup action\n");
> > +
> > for (unsigned int i = 0; i < data->init_val_count; i++)
> > writel(data->init_vals[i].val, priv->base + data->init_vals[i].reg);
> >
> > - /* keep usb2phy in asserted state */
> > - rzv2h_usbphy_assert_helper(priv);
>
> This change is not mentioned in the patch description.
>
> Is initially asserting the reset not required after all?
Since we removed the pm_runtime_put() call from the rzv2h_usb2phy_reset_probe() function,
and power management remains enabled for the entire lifetime of the driver, we also need
to remove rzv2h_usbphy_assert_helper() from rzv2h_usb2phy_reset_probe()
Additionally, when testing the unbind/bind USB2.0 chain, this causes an OOPS on my side.
I’ll mention this in the next version.
Thanks & Regards,
Tommaso
>
> regards
> Philipp
next prev parent reply other threads:[~2025-11-06 8:31 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 15:38 [PATCH v2 00/21] Add USB2.0 support for RZ/G3E Tommaso Merciai
2025-11-05 15:38 ` Tommaso Merciai
2025-11-05 15:38 ` [PATCH v2 01/21] phy: renesas: rcar-gen3-usb2: Use devm_pm_runtime_enable() Tommaso Merciai
2025-11-05 15:38 ` Tommaso Merciai
2025-11-05 15:38 ` [PATCH v2 02/21] phy: renesas: rcar-gen3-usb2: Factor out VBUS control logic Tommaso Merciai
2025-11-05 15:38 ` Tommaso Merciai
2025-11-05 15:38 ` [PATCH v2 03/21] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime Tommaso Merciai
2025-11-05 15:38 ` Tommaso Merciai
2025-11-05 15:59 ` Philipp Zabel
2025-11-05 15:59 ` Philipp Zabel
2025-11-06 8:30 ` Tommaso Merciai [this message]
2025-11-06 8:30 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 04/21] dt-bindings: reset: renesas,rzv2h-usb2phy: Add '#mux-state-cells' property Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 17:16 ` Rob Herring (Arm)
2025-11-05 17:16 ` Rob Herring (Arm)
2025-11-07 17:18 ` Tommaso Merciai
2025-11-07 17:18 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 05/21] mux: Add driver for Renesas RZ/V2H USB VBUS_SEL mux Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 06/21] reset: rzv2h-usb2phy: Add support for VBUS mux controller registration Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 16:04 ` Philipp Zabel
2025-11-05 16:04 ` Philipp Zabel
2025-11-05 17:24 ` Tommaso Merciai
2025-11-05 17:24 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 07/21] dt-bindings: phy: renesas,usb2-phy: Document USB VBUS regulator Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 08/21] dt-bindings: phy: renesas,usb2-phy: Document mux-states property Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 09/21] phy: renesas: rcar-gen3-usb2: Add regulator for OTG VBUS control Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 10/21] phy: renesas: rcar-gen3-usb2: Use mux-state for phyrst management Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 11/21] dt-bindings: usb: renesas,usbhs: Add RZ/G3E SoC support Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 12/21] dt-bindings: phy: renesas,usb2-phy: Document RZ/G3E SoC Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 13/21] dt-bindings: reset: Document RZ/G3E USB2PHY reset Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 14/21] arm64: dts: renesas: r9a09g057: Add USB2.0 VBUS_SEL mux-controller support Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 15/21] arm64: dts: renesas: r9a09g056: " Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 16/21] arm64: dts: renesas: r9a09g056: Add USB2.0 PHY VBUS internal regulator node Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 17/21] arm64: dts: renesas: r9a09g056n48-rzv2n-evk: Enable USB2 PHY0 VBUS support Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 18/21] arm64: dts: renesas: r9a09g057: Add USB2.0 PHY VBUS internal regulator node Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 19/21] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable USB2 PHY0 VBUS support Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 20/21] arm64: dts: renesas: r9a09g047: Add USB2.0 support Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
2025-11-05 15:39 ` [PATCH v2 21/21] arm64: dts: renesas: r9a09g047e57-smarc: Enable " Tommaso Merciai
2025-11-05 15:39 ` Tommaso Merciai
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=aQxcu8zNmIi8Hl7Y@tom-desktop \
--to=tommaso.merciai.xr@bp.renesas.com \
--cc=arnd@arndb.de \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=peda@axentia.se \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--cc=tomm.merciai@gmail.com \
--cc=vkoul@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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.