[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d71cea86-034c-4448-92de-217ea9d1d018@oracle.com>
Date: Mon, 14 Apr 2025 22:21:27 +0530
From: ALOK TIWARI <alok.a.tiwari@...cle.com>
To: Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Prabhakar <prabhakar.csengg@...il.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>
Cc: "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 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
That's what I conclude for now.
>
> Kind regards,
> Fab
>
Thanks,
Alok
Powered by blists - more mailing lists