lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aQxcu8zNmIi8Hl7Y@tom-desktop>
Date: Thu, 6 Nov 2025 09:30:51 +0100
From: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
To: Philipp Zabel <p.zabel@...gutronix.de>
Cc: tomm.merciai@...il.com, 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

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@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ