* [PATCH] clk: rk808: fix OF node reference imbalance
@ 2026-04-07 9:50 Johan Hovold
2026-04-07 10:43 ` Sebastian Reichel
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Johan Hovold @ 2026-04-07 9:50 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, linux-clk, linux-kernel, Johan Hovold, stable,
Sebastian Reichel
The driver reuses the OF node of the parent multi-function device but
fails to take another reference to balance the one dropped by the
platform bus code when unbinding the MFD and deregistering the child
devices.
Fix this by using the intended helper for reusing OF nodes.
Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
Cc: stable@vger.kernel.org # 6.5
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/clk/clk-rk808.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
index f7412b137e5e..5a75b5c91555 100644
--- a/drivers/clk/clk-rk808.c
+++ b/drivers/clk/clk-rk808.c
@@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
struct rk808_clkout *rk808_clkout;
int ret;
- dev->of_node = pdev->dev.parent->of_node;
+ device_set_of_node_from_dev(dev, dev->parent);
rk808_clkout = devm_kzalloc(dev,
sizeof(*rk808_clkout), GFP_KERNEL);
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-07 9:50 [PATCH] clk: rk808: fix OF node reference imbalance Johan Hovold
@ 2026-04-07 10:43 ` Sebastian Reichel
2026-04-07 20:02 ` Brian Masney
2026-04-25 18:10 ` Stephen Boyd
2 siblings, 0 replies; 7+ messages in thread
From: Sebastian Reichel @ 2026-04-07 10:43 UTC (permalink / raw)
To: Johan Hovold
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]
Hi,
On Tue, Apr 07, 2026 at 11:50:27AM +0200, Johan Hovold wrote:
> The driver reuses the OF node of the parent multi-function device but
> fails to take another reference to balance the one dropped by the
> platform bus code when unbinding the MFD and deregistering the child
> devices.
>
> Fix this by using the intended helper for reusing OF nodes.
>
> Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
> Cc: stable@vger.kernel.org # 6.5
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Greetings,
-- Sebastian
> drivers/clk/clk-rk808.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
> index f7412b137e5e..5a75b5c91555 100644
> --- a/drivers/clk/clk-rk808.c
> +++ b/drivers/clk/clk-rk808.c
> @@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
> struct rk808_clkout *rk808_clkout;
> int ret;
>
> - dev->of_node = pdev->dev.parent->of_node;
> + device_set_of_node_from_dev(dev, dev->parent);
>
> rk808_clkout = devm_kzalloc(dev,
> sizeof(*rk808_clkout), GFP_KERNEL);
> --
> 2.52.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-07 9:50 [PATCH] clk: rk808: fix OF node reference imbalance Johan Hovold
2026-04-07 10:43 ` Sebastian Reichel
@ 2026-04-07 20:02 ` Brian Masney
2026-04-25 18:10 ` Stephen Boyd
2 siblings, 0 replies; 7+ messages in thread
From: Brian Masney @ 2026-04-07 20:02 UTC (permalink / raw)
To: Johan Hovold
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-kernel, stable,
Sebastian Reichel
On Tue, Apr 07, 2026 at 11:50:27AM +0200, Johan Hovold wrote:
> The driver reuses the OF node of the parent multi-function device but
> fails to take another reference to balance the one dropped by the
> platform bus code when unbinding the MFD and deregistering the child
> devices.
>
> Fix this by using the intended helper for reusing OF nodes.
>
> Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
> Cc: stable@vger.kernel.org # 6.5
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-07 9:50 [PATCH] clk: rk808: fix OF node reference imbalance Johan Hovold
2026-04-07 10:43 ` Sebastian Reichel
2026-04-07 20:02 ` Brian Masney
@ 2026-04-25 18:10 ` Stephen Boyd
2026-04-27 11:17 ` Heiko Stuebner
2 siblings, 1 reply; 7+ messages in thread
From: Stephen Boyd @ 2026-04-25 18:10 UTC (permalink / raw)
To: Johan Hovold, Heiko Stuebner
Cc: Michael Turquette, linux-clk, linux-kernel, Johan Hovold, stable,
Sebastian Reichel
Quoting Johan Hovold (2026-04-07 02:50:27)
> The driver reuses the OF node of the parent multi-function device but
> fails to take another reference to balance the one dropped by the
> platform bus code when unbinding the MFD and deregistering the child
> devices.
>
> Fix this by using the intended helper for reusing OF nodes.
>
> Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
> Cc: stable@vger.kernel.org # 6.5
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
+Heiko
> drivers/clk/clk-rk808.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
> index f7412b137e5e..5a75b5c91555 100644
> --- a/drivers/clk/clk-rk808.c
> +++ b/drivers/clk/clk-rk808.c
> @@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
> struct rk808_clkout *rk808_clkout;
> int ret;
>
> - dev->of_node = pdev->dev.parent->of_node;
> + device_set_of_node_from_dev(dev, dev->parent);
>
> rk808_clkout = devm_kzalloc(dev,
> sizeof(*rk808_clkout), GFP_KERNEL);
> --
> 2.52.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-25 18:10 ` Stephen Boyd
@ 2026-04-27 11:17 ` Heiko Stuebner
2026-04-27 12:03 ` Johan Hovold
0 siblings, 1 reply; 7+ messages in thread
From: Heiko Stuebner @ 2026-04-27 11:17 UTC (permalink / raw)
To: Johan Hovold, Stephen Boyd
Cc: Michael Turquette, linux-clk, linux-kernel, Johan Hovold, stable,
Sebastian Reichel
Am Samstag, 25. April 2026, 20:10:27 Mitteleuropäische Sommerzeit schrieb Stephen Boyd:
> Quoting Johan Hovold (2026-04-07 02:50:27)
> > The driver reuses the OF node of the parent multi-function device but
> > fails to take another reference to balance the one dropped by the
> > platform bus code when unbinding the MFD and deregistering the child
> > devices.
> >
> > Fix this by using the intended helper for reusing OF nodes.
> >
> > Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
> > Cc: stable@vger.kernel.org # 6.5
> > Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
>
> +Heiko
Looking at the device_set_of_node_from_dev() function, this is the
right move, so
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
It also seems the rk808-regulator.c might be another candidate for
this, as it also takes the node without of_node_get and manually
setting the of_node_reused flag.
Heiko
> > drivers/clk/clk-rk808.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
> > index f7412b137e5e..5a75b5c91555 100644
> > --- a/drivers/clk/clk-rk808.c
> > +++ b/drivers/clk/clk-rk808.c
> > @@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
> > struct rk808_clkout *rk808_clkout;
> > int ret;
> >
> > - dev->of_node = pdev->dev.parent->of_node;
> > + device_set_of_node_from_dev(dev, dev->parent);
> >
> > rk808_clkout = devm_kzalloc(dev,
> > sizeof(*rk808_clkout), GFP_KERNEL);
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-27 11:17 ` Heiko Stuebner
@ 2026-04-27 12:03 ` Johan Hovold
2026-04-27 12:34 ` Heiko Stuebner
0 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2026-04-27 12:03 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-kernel, stable,
Sebastian Reichel
On Mon, Apr 27, 2026 at 01:17:39PM +0200, Heiko Stuebner wrote:
> Looking at the device_set_of_node_from_dev() function, this is the
> right move, so
>
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Thanks for reviewing.
> It also seems the rk808-regulator.c might be another candidate for
> this, as it also takes the node without of_node_get and manually
> setting the of_node_reused flag.
That's fixed in 7.1-rc1:
65290b24d8a5 ("regulator: rk808: fix OF node reference imbalance")
Johan
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] clk: rk808: fix OF node reference imbalance
2026-04-27 12:03 ` Johan Hovold
@ 2026-04-27 12:34 ` Heiko Stuebner
0 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2026-04-27 12:34 UTC (permalink / raw)
To: Johan Hovold
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-kernel, stable,
Sebastian Reichel
Am Montag, 27. April 2026, 14:03:20 Mitteleuropäische Sommerzeit schrieb Johan Hovold:
> On Mon, Apr 27, 2026 at 01:17:39PM +0200, Heiko Stuebner wrote:
>
> > Looking at the device_set_of_node_from_dev() function, this is the
> > right move, so
> >
> > Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>
> Thanks for reviewing.
>
> > It also seems the rk808-regulator.c might be another candidate for
> > this, as it also takes the node without of_node_get and manually
> > setting the of_node_reused flag.
>
> That's fixed in 7.1-rc1:
>
> 65290b24d8a5 ("regulator: rk808: fix OF node reference imbalance")
nice ... should've looked there, instead of v7.0 :-)
Heiko
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-04-27 12:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 9:50 [PATCH] clk: rk808: fix OF node reference imbalance Johan Hovold
2026-04-07 10:43 ` Sebastian Reichel
2026-04-07 20:02 ` Brian Masney
2026-04-25 18:10 ` Stephen Boyd
2026-04-27 11:17 ` Heiko Stuebner
2026-04-27 12:03 ` Johan Hovold
2026-04-27 12:34 ` Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox