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: <CA+V-a8sXDBZvOWJzD7SANPJLyeQaSA-0t24KJo=1Wwoz27JLLA@mail.gmail.com>
Date: Wed, 17 Apr 2024 21:59:50 +0100
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>, Biju Das <biju.das.jz@...renesas.com>, 
	linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org, 
	Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH] reset: reset-rzg2l-usbphy-ctrl: Ensure reset line is
 asserted in error path

Hi Geert,

Thank you for the review.

On Wed, Apr 17, 2024 at 3:38 PM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Thu, Mar 21, 2024 at 12:43 PM Prabhakar <prabhakar.csengg@...il.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> >
> > In the event of failure during devm_reset_controller_register(), ensure
> > that the reset line is asserted back.
> >
> > Fixes: bee08559701fb ("reset: renesas: Add RZ/G2L usbphy control driver")
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> > @@ -132,8 +132,10 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
> >         priv->rcdev.dev = dev;
> >
> >         error = devm_reset_controller_register(dev, &priv->rcdev);
> > -       if (error)
> > +       if (error) {
> > +               reset_control_assert(priv->rstc);
> >                 return error;
> > +       }
> >
> >         spin_lock_init(&priv->lock);
> >         dev_set_drvdata(dev, priv);
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
>
> Alternatively, you could register a cleanup handler with
> devm_add_action_or_reset(), like many drivers already do.
> Or better, turn devm_aspeed_peci_reset_control_deassert() into a
> generic helper, and convert all drivers[1] to use that.
>
Good point, I'll send an RFC patch for this.

> That would just leave us with undoing pm_runtime_enable(), which can
> be automated using devm_pm_runtime_enable() instead.
>
Agreed.

> [1] git grep -w devm.*reset_control_assert
>
Cheers,
Prabhakar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ