[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <180fcd1307af02eadc6136512ef78226bc7c00dd.camel@pengutronix.de>
Date: Wed, 05 Nov 2025 16:59:24 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>,
tomm.merciai@...il.com
Cc: linux-renesas-soc@...r.kernel.org, biju.das.jz@...renesas.com, Vinod
Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>, Rob
Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor
Dooley <conor+dt@...nel.org>, Fabrizio Castro
<fabrizio.castro.jz@...esas.com>, Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com>, Peter Rosin <peda@...ntia.se>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>, Geert Uytterhoeven
<geert+renesas@...der.be>, Magnus Damm <magnus.damm@...il.com>, Arnd
Bergmann <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-phy@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 03/21] reset: rzv2h-usb2phy: Keep PHY clock enabled
for entire device lifetime
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@...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?
regards
Philipp
Powered by blists - more mailing lists