* [PATCH RESEND net] net: mv643xx: fix OF node refcount
@ 2026-06-02 7:34 Bartosz Golaszewski
2026-06-04 15:34 ` Jakub Kicinski
2026-06-05 1:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2026-06-02 7:34 UTC (permalink / raw)
To: Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, brgl, Bartosz Golaszewski, stable
Platform devices created with platform_device_alloc() call
platform_device_release() when the last reference to the device's
kobject is dropped. This function calls of_node_put() unconditionally.
This works fine for devices created with platform_device_register_full()
but users of the split approach (platform_device_alloc() +
platform_device_add()) must bump the reference of the of_node they
assign manually. Add the missing call to of_node_get().
Cc: stable@vger.kernel.org
Fixes: 76723bca2802 ("net: mv643xx_eth: add DT parsing support")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Resending separately as requested by Jakub
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index f9055b3d6fb10..1881583be5ce2 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
goto put_err;
}
ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- ppdev->dev.of_node = pnp;
+ ppdev->dev.of_node = of_node_get(pnp);
ret = platform_device_add_resources(ppdev, &res, 1);
if (ret)
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND net] net: mv643xx: fix OF node refcount
2026-06-02 7:34 [PATCH RESEND net] net: mv643xx: fix OF node refcount Bartosz Golaszewski
@ 2026-06-04 15:34 ` Jakub Kicinski
2026-06-05 1:42 ` Jakub Kicinski
2026-06-05 1:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2026-06-04 15:34 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, netdev, linux-kernel, brgl, stable
On Tue, 2 Jun 2026 09:34:14 +0200 Bartosz Golaszewski wrote:
> Platform devices created with platform_device_alloc() call
> platform_device_release() when the last reference to the device's
> kobject is dropped. This function calls of_node_put() unconditionally.
> This works fine for devices created with platform_device_register_full()
> but users of the split approach (platform_device_alloc() +
> platform_device_add()) must bump the reference of the of_node they
> assign manually. Add the missing call to of_node_get().
Where is it released? I think it's important to note, I can amend
the commit message if needed..
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND net] net: mv643xx: fix OF node refcount
2026-06-04 15:34 ` Jakub Kicinski
@ 2026-06-05 1:42 ` Jakub Kicinski
0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2026-06-05 1:42 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, netdev, linux-kernel, brgl, stable
On Thu, 4 Jun 2026 08:34:30 -0700 Jakub Kicinski wrote:
> On Tue, 2 Jun 2026 09:34:14 +0200 Bartosz Golaszewski wrote:
> > Platform devices created with platform_device_alloc() call
> > platform_device_release() when the last reference to the device's
> > kobject is dropped. This function calls of_node_put() unconditionally.
> > This works fine for devices created with platform_device_register_full()
> > but users of the split approach (platform_device_alloc() +
> > platform_device_add()) must bump the reference of the of_node they
> > assign manually. Add the missing call to of_node_get().
>
> Where is it released? I think it's important to note, I can amend
> the commit message if needed..
Not enough coffee in the morning I guess.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH RESEND net] net: mv643xx: fix OF node refcount
2026-06-02 7:34 [PATCH RESEND net] net: mv643xx: fix OF node refcount Bartosz Golaszewski
2026-06-04 15:34 ` Jakub Kicinski
@ 2026-06-05 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-05 1:50 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: sebastian.hesselbarth, andrew+netdev, davem, edumazet, kuba,
pabeni, netdev, linux-kernel, brgl, stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 2 Jun 2026 09:34:14 +0200 you wrote:
> Platform devices created with platform_device_alloc() call
> platform_device_release() when the last reference to the device's
> kobject is dropped. This function calls of_node_put() unconditionally.
> This works fine for devices created with platform_device_register_full()
> but users of the split approach (platform_device_alloc() +
> platform_device_add()) must bump the reference of the of_node they
> assign manually. Add the missing call to of_node_get().
>
> [...]
Here is the summary with links:
- [RESEND,net] net: mv643xx: fix OF node refcount
https://git.kernel.org/netdev/net/c/4aacf509e537
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-05 1:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 7:34 [PATCH RESEND net] net: mv643xx: fix OF node refcount Bartosz Golaszewski
2026-06-04 15:34 ` Jakub Kicinski
2026-06-05 1:42 ` Jakub Kicinski
2026-06-05 1:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox