[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+V-a8tJoBPBBQ+66m1P3fxJfFXsFg0fWajCoG0GOQRwEapqAg@mail.gmail.com>
Date: Mon, 14 Apr 2025 18:46:33 +0100
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: ALOK TIWARI <alok.a.tiwari@...cle.com>
Cc: Fabrizio Castro <fabrizio.castro.jz@...esas.com>, Philipp Zabel <p.zabel@...gutronix.de>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>, Magnus Damm <magnus.damm@...il.com>,
"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Biju Das <biju.das.jz@...renesas.com>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: RE: [PATCH v4 2/3] reset: Add USB2PHY port reset driver for
Renesas RZ/V2H(P)
Hi ALOK,
On Mon, Apr 14, 2025 at 5:51 PM ALOK TIWARI <alok.a.tiwari@...cle.com> wrote:
>
> Hi Fabrizio,
>
> On 14-04-2025 21:13, Fabrizio Castro wrote:
> > Hi Alok,
> >
> > Thanks for your email.
> >
> >> From: ALOK TIWARI <alok.a.tiwari@...cle.com>
> >> Sent: 14 April 2025 14:46
> >> Subject: Re: [PATCH v4 2/3] reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)
> >>
> >>
> >>> +static int rzv2h_usbphy_reset_assert(struct reset_controller_dev *rcdev,
> >>> + unsigned long id)
> >>> +{
> >>> + struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
> >>> + struct device *dev = priv->dev;
> >>> + int ret;
> >>> +
> >>> + ret = pm_runtime_resume_and_get(dev);
> >>> + if (ret) {
> >>
> >> nit: it will good if we check similar to reset-rzg2l-usbphy-ctrl.c
> >> pm_runtime_resume_and_get -> 0 on success, or a negative error code
> >> otherwise.
> >> 1 → if the device was resumed and incremented usage count
> >> 0 → if the device was already active or successfully resumed
> >> if (ret < 0)
> >
> > No.
> >
> > As you can see from:
> > https://urldefense.com/v3/__https://github.com/torvalds/linux/blob/master/include/linux/pm_runtime.h*L444__;Iw!!ACWV5N9M2RV99hQ!Ly8gpEBQHhYXOeCcKQavVHfM1XUSy1IubKnHjuQAgvfkK0jrMXc0ebBcvFRvNDcpaJwoUOk1JLLuzih2fLd7JReyapWOouY$
> >
> > pm_runtime_resume_and_get returns a negative error code or 0 (when
> > successful).
> >
> > The same explanation applies to your other comments.
> >
>
> Thanks to you for the explanation.
> I got you point.
>
> so We are keeping different styles of error checks:
> In reset-rzv2h-usb2phy.c, we check using if (error),
> Whereas in reset-rzg2l-usbphy-ctrl.c, we use if (error < 0)."
> https://github.com/torvalds/linux/blob/master/drivers/reset/reset-rzg2l-usbphy-ctrl.c#L148
>
Thanks for pointing that out. I'll update reset-rzg2l-usbphy-ctrl.c to
use the same style of error checks for consistency.
Cheers,
Prabhakar
Powered by blists - more mailing lists