Re: RE: [PATCH v4 2/3] reset: Add USB2PHY port reset driver for Renesas RZ/V2H(P)

From: ALOK TIWARI
Date: Mon Apr 14 2025 - 12:52:07 EST


Hi Fabrizio,

On 14-04-2025 21:13, Fabrizio Castro wrote:
Hi Alok,

Thanks for your email.

From: ALOK TIWARI <alok.a.tiwari@xxxxxxxxxx>
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