From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Biju Das <biju.das.jz@bp.renesas.com>,
"vkoul@kernel.org" <vkoul@kernel.org>,
"kishon@kernel.org" <kishon@kernel.org>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"geert+renesas@glider.be" <geert+renesas@glider.be>,
"magnus.damm" <magnus.damm@gmail.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: "linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v5 2/7] phy: renesas: rcar-gen3-usb2: Fix an error handling path in rcar_gen3_phy_usb2_probe()
Date: Tue, 19 Aug 2025 09:01:20 +0300 [thread overview]
Message-ID: <bc053bca-8dd9-4a50-a352-290b38a329b0@tuxon.dev> (raw)
In-Reply-To: <TY3PR01MB1134647BC6436CA61E0A200F98630A@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Hi, Biju,
On 8/19/25 08:49, Biju Das wrote:
> Hi Claudiu, Christophe,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Claudiu <claudiu.beznea@tuxon.dev>
>> Sent: 19 August 2025 06:42
>> Subject: [PATCH v5 2/7] phy: renesas: rcar-gen3-usb2: Fix an error handling path in
>> rcar_gen3_phy_usb2_probe()
>>
>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>
>> If an error occurs after the reset_control_deassert(),
>> reset_control_assert() must be called, as already done in the remove function.
>>
>> Use devm_add_action_or_reset() to add the missing call and simplify the
>> .remove() function accordingly.
>>
>> Fixes: 4eae16375357 ("phy: renesas: rcar-gen3-usb2: Add support to initialize the bus")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> [claudiu.beznea: removed "struct reset_control *rstc = data;" from rcar_gen3_reset_assert()]
>> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>> ---
>>
>> Changes in v5:
>> - none
>>
>> Changes in v4:
>> - none
>>
>> Changes in v3:
>> - collected tags
>>
>> Changes in v2:
>> - none; this patch is new; re-spinned the Christophe's work at
>>
>> https://lore.kernel.org/all/TYCPR01MB113329930BA5E2149C9BE2A1986672@TYCPR01MB11332.jpnprd01.prod.outloo
>> k.com/
>>
>>
>> drivers/phy/renesas/phy-rcar-gen3-usb2.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
>> index 47beb94cd424..d61c171d454f 100644
>> --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
>> +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
>> @@ -699,6 +699,11 @@ static enum usb_dr_mode rcar_gen3_get_dr_mode(struct device_node *np)
>> return candidate;
>> }
>>
>> +static void rcar_gen3_reset_assert(void *data) {
>> + reset_control_assert(data);
>> +}
>> +
>> static int rcar_gen3_phy_usb2_init_bus(struct rcar_gen3_chan *channel) {
>> struct device *dev = channel->dev;
>> @@ -717,6 +722,11 @@ static int rcar_gen3_phy_usb2_init_bus(struct rcar_gen3_chan *channel)
>> if (ret)
>> goto rpm_put;
>>
>> + ret = devm_add_action_or_reset(dev, rcar_gen3_reset_assert,
>> + channel->rstc);
>
> Now 'rstc' can be removed from struct rcar_gen3_chan and use the local rstc pointer
> as context variable here.
I can drop it now but it will be added later (after this series) along with
suspend to RAM support. That is the reason I preferred to still keep it.
Thank you,
Claudiu
>
> Cheers,
> Biju
>
>> + if (ret)
>> + goto rpm_put;
>> +
>> val = readl(channel->base + USB2_AHB_BUS_CTR);
>> val &= ~USB2_AHB_BUS_CTR_MBL_MASK;
>> val |= USB2_AHB_BUS_CTR_MBL_INCR4;
>> @@ -860,7 +870,6 @@ static void rcar_gen3_phy_usb2_remove(struct platform_device *pdev)
>> if (channel->is_otg_channel)
>> device_remove_file(&pdev->dev, &dev_attr_role);
>>
>> - reset_control_assert(channel->rstc);
>> pm_runtime_disable(&pdev->dev);
>> };
>>
>> --
>> 2.43.0
>
next prev parent reply other threads:[~2025-08-19 6:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 5:42 [PATCH v5 0/7] Add initial USB support for the Renesas RZ/G3S SoC Claudiu
2025-08-19 5:42 ` [PATCH v5 1/7] dt-bindings: phy: renesas,usb2-phy: Mark resets as required for RZ/G3S Claudiu
2025-08-19 6:29 ` Rob Herring (Arm)
2025-08-19 13:37 ` Rob Herring
2025-08-20 9:40 ` claudiu beznea
2025-08-19 5:42 ` [PATCH v5 2/7] phy: renesas: rcar-gen3-usb2: Fix an error handling path in rcar_gen3_phy_usb2_probe() Claudiu
2025-08-19 5:49 ` Biju Das
2025-08-19 6:01 ` claudiu beznea [this message]
2025-08-19 6:34 ` Biju Das
2025-08-19 5:42 ` [PATCH v5 3/7] dt-bindings: reset: renesas,rzg2l-usbphy-ctrl: Document RZ/G3S support Claudiu
2025-08-19 6:29 ` Rob Herring (Arm)
2025-08-19 5:42 ` [PATCH v5 4/7] reset: rzg2l-usbphy-ctrl: Add support for USB PWRRDY Claudiu
2025-08-30 12:39 ` Claudiu Beznea
2025-08-19 5:42 ` [PATCH v5 5/7] reset: rzg2l-usbphy-ctrl: Add support for RZ/G3S SoC Claudiu
2025-08-19 5:42 ` [PATCH v5 6/7] arm64: dts: renesas: r9a08g045: Add USB support Claudiu
2025-08-19 5:42 ` [PATCH v5 7/7] arm64: dts: renesas: rzg3s-smarc: Enable " Claudiu
2025-08-28 8:56 ` [PATCH v5 0/7] Add initial USB support for the Renesas RZ/G3S SoC Wolfram Sang
2025-08-28 18:51 ` claudiu beznea
2025-08-29 10:53 ` Wolfram Sang
2025-08-29 11:30 ` claudiu beznea
2025-08-29 11:51 ` Wolfram Sang
2025-08-29 12:17 ` claudiu beznea
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=bc053bca-8dd9-4a50-a352-290b38a329b0@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/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
all inboxes | Powered by JetHome®