The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: ALOK TIWARI <alok.a.tiwari@oracle.com>
To: Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>
Cc: "linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: RE: [PATCH v4 2/3] reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)
Date: Mon, 14 Apr 2025 22:21:27 +0530	[thread overview]
Message-ID: <d71cea86-034c-4448-92de-217ea9d1d018@oracle.com> (raw)
In-Reply-To: <TYCPR01MB1209398B324FDB1691D80545FC2B32@TYCPR01MB12093.jpnprd01.prod.outlook.com>

Hi Fabrizio,

On 14-04-2025 21:13, Fabrizio Castro wrote:
> Hi Alok,
> 
> Thanks for your email.
> 
>> From: ALOK TIWARI <alok.a.tiwari@oracle.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

  reply	other threads:[~2025-04-14 16:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 13:00 [PATCH v4 0/3] Add USB2PHY Port Reset Control driver for Renesas RZ/V2H(P) SoC Prabhakar
2025-04-14 13:00 ` [PATCH v4 1/3] dt-bindings: reset: Document RZ/V2H(P) USB2PHY reset Prabhakar
2025-04-14 13:00 ` [PATCH v4 2/3] reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P) Prabhakar
2025-04-14 13:05   ` Biju Das
2025-04-14 13:12     ` Biju Das
2025-04-14 17:43     ` Lad, Prabhakar
2025-04-14 13:46   ` ALOK TIWARI
2025-04-14 15:43     ` Fabrizio Castro
2025-04-14 16:51       ` ALOK TIWARI [this message]
2025-04-14 17:46         ` Lad, Prabhakar
2025-04-14 13:00 ` [PATCH v4 3/3] MAINTAINERS: Add entry for Renesas RZ/V2H(P) USB2PHY Port Reset driver Prabhakar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d71cea86-034c-4448-92de-217ea9d1d018@oracle.com \
    --to=alok.a.tiwari@oracle.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox