[PATCH] net: renesas: rswitch-main: fix runtime PM cleanup

Jiawen Liu posted 1 patch 1 month, 1 week ago
[PATCH] net: renesas: rswitch-main: fix runtime PM cleanup
Posted by Jiawen Liu 1 month, 1 week ago
From: jiawen <1298662399@qq.com>

Update renesas_eth_sw_probe() for the confirmed driver lifecycle defect.

Keep the change limited to the concrete operation shown in the final
patch.

Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c
--- a/drivers/net/ethernet/renesas/rswitch_main.c
+++ b/drivers/net/ethernet/renesas/rswitch_main.c
@@ -2123,6 +2123,8 @@
 	{ /* Sentinel */ }
 };
 
+static void rswitch_deinit(struct rswitch_private *priv);
+
 static int renesas_eth_sw_probe(struct platform_device *pdev)
 {
 	const struct soc_device_attribute *attr;
@@ -2194,6 +2196,9 @@
 	ret = rswitch_register_notifiers();
 	if (ret) {
 		dev_err(&pdev->dev, "could not register notifiers\n");
+		rswitch_deinit(priv);
+		pm_runtime_put(&pdev->dev);
+		pm_runtime_disable(&pdev->dev);
 		return ret;
 	}
Re: [PATCH] net: renesas: rswitch-main: fix runtime PM cleanup
Posted by Andrew Lunn 1 month, 1 week ago
On Tue, Aug 18, 2026 at 04:41:35PM +0400, Jiawen Liu wrote:
> From: jiawen <1298662399@qq.com>
> 
> Update renesas_eth_sw_probe() for the confirmed driver lifecycle defect.
> 
> Keep the change limited to the concrete operation shown in the final
> patch.
> 
> Signed-off-by: jiawen <1298662399@qq.com>
> ---
> diff --git a/drivers/net/ethernet/renesas/rswitch_main.c b/drivers/net/ethernet/renesas/rswitch_main.c
> --- a/drivers/net/ethernet/renesas/rswitch_main.c
> +++ b/drivers/net/ethernet/renesas/rswitch_main.c
> @@ -2123,6 +2123,8 @@
>  	{ /* Sentinel */ }
>  };
>  
> +static void rswitch_deinit(struct rswitch_private *priv);
> +

Please don't add forward references. Add a patch which first moves
this function earlier. Then fix the issue.

    Andrew

---
pw-bot: cr
Re: [PATCH] net: renesas: rswitch-main: fix runtime PM cleanup
Posted by Geert Uytterhoeven 1 month, 1 week ago
Hi Jiawen,

Thanks for your patch!

On Tue, 18 Aug 2026 at 14:44, Jiawen Liu <1298662399@qq.com> wrote:
> From: jiawen <1298662399@qq.com>
>
> Update renesas_eth_sw_probe() for the confirmed driver lifecycle defect.
>
> Keep the change limited to the concrete operation shown in the final
> patch.

Please write a better patch description.

>
> Signed-off-by: jiawen <1298662399@qq.com>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds