[PATCH v2 03/21] reset: rzv2h-usb2phy: Keep PHY clock enabled for entire device lifetime

Philipp Zabel p.zabel at pengutronix.de
Wed Nov 5 07:59:24 PST 2025


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 at 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?

regards
Philipp



More information about the linux-phy mailing list