mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] ARM: mstar: Drop OF node references after mapping
@ 2026-06-08 15:34 Yuho Choi
  2026-07-02 21:11 ` 최유호
  0 siblings, 1 reply; 3+ messages in thread
From: Yuho Choi @ 2026-06-08 15:34 UTC (permalink / raw)
  To: Daniel Palmer, Romain Perier, Russell King
  Cc: linux-arm-kernel, linux-kernel, Yuho Choi

of_find_compatible_node() returns a device node with its reference
count incremented. of_iomap() uses the node to map the register range,
but does not consume that reference.

Drop the node references after mapping the smpctrl and l3bridge
registers.

Fixes: 312b62b6610c ("ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs")
Fixes: 5919eec0f092 ("ARM: mstar: SMP support")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-mstar/mstarv7.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-mstar/mstarv7.c b/arch/arm/mach-mstar/mstarv7.c
index 274c4f0df270..64262b8f10a0 100644
--- a/arch/arm/mach-mstar/mstarv7.c
+++ b/arch/arm/mach-mstar/mstarv7.c
@@ -86,6 +86,7 @@ static int mstarv7_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 	np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
 	smpctrl = of_iomap(np, 0);
+	of_node_put(np);
 
 	if (!smpctrl)
 		return -ENODEV;
@@ -116,6 +117,7 @@ static void __init mstarv7_init(void)
 
 	np = of_find_compatible_node(NULL, NULL, "mstar,l3bridge");
 	l3bridge = of_iomap(np, 0);
+	of_node_put(np);
 	if (l3bridge)
 		soc_mb = mstarv7_mb;
 	else
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] ARM: mstar: Drop OF node references after mapping
  2026-06-08 15:34 [PATCH v1] ARM: mstar: Drop OF node references after mapping Yuho Choi
@ 2026-07-02 21:11 ` 최유호
  2026-07-03 15:26   ` Daniel Palmer
  0 siblings, 1 reply; 3+ messages in thread
From: 최유호 @ 2026-07-02 21:11 UTC (permalink / raw)
  To: Daniel Palmer, Romain Perier, Russell King; +Cc: linux-arm-kernel, linux-kernel

Hi,

Just a gentle ping on this patch.

I would appreciate any feedback when you have a chance to review this.

Thanks


On Mon, 8 Jun 2026 at 11:34, Yuho Choi <dbgh9129@gmail.com> wrote:
>
> of_find_compatible_node() returns a device node with its reference
> count incremented. of_iomap() uses the node to map the register range,
> but does not consume that reference.
>
> Drop the node references after mapping the smpctrl and l3bridge
> registers.
>
> Fixes: 312b62b6610c ("ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs")
> Fixes: 5919eec0f092 ("ARM: mstar: SMP support")
> Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
> ---
>  arch/arm/mach-mstar/mstarv7.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-mstar/mstarv7.c b/arch/arm/mach-mstar/mstarv7.c
> index 274c4f0df270..64262b8f10a0 100644
> --- a/arch/arm/mach-mstar/mstarv7.c
> +++ b/arch/arm/mach-mstar/mstarv7.c
> @@ -86,6 +86,7 @@ static int mstarv7_boot_secondary(unsigned int cpu, struct task_struct *idle)
>
>         np = of_find_compatible_node(NULL, NULL, "mstar,smpctrl");
>         smpctrl = of_iomap(np, 0);
> +       of_node_put(np);
>
>         if (!smpctrl)
>                 return -ENODEV;
> @@ -116,6 +117,7 @@ static void __init mstarv7_init(void)
>
>         np = of_find_compatible_node(NULL, NULL, "mstar,l3bridge");
>         l3bridge = of_iomap(np, 0);
> +       of_node_put(np);
>         if (l3bridge)
>                 soc_mb = mstarv7_mb;
>         else
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] ARM: mstar: Drop OF node references after mapping
  2026-07-02 21:11 ` 최유호
@ 2026-07-03 15:26   ` Daniel Palmer
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Palmer @ 2026-07-03 15:26 UTC (permalink / raw)
  To: 최유호
  Cc: Romain Perier, Russell King, linux-arm-kernel, linux-kernel

Hi,

On Fri, 3 Jul 2026 at 06:11, 최유호 <dbgh9129@gmail.com> wrote:
>
> Hi,
>
> Just a gentle ping on this patch.
>
> I would appreciate any feedback when you have a chance to review this.
>
> Thanks

In my opinion this doesn't really do anything. But since people are
sending the same patches (I guess because they have a tool finding
common patterns) I would accept a patch just to stop getting the same
patch again. :)

If we have to do this is there not a cleanup helper we can use to let
the compiler do it?

Thanks,

Daniel

- Sorry for the spam, gmail did its gmail thing where it decided I
want html email despite telling it I want plaintext in the settings.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-03 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 15:34 [PATCH v1] ARM: mstar: Drop OF node references after mapping Yuho Choi
2026-07-02 21:11 ` 최유호
2026-07-03 15:26   ` Daniel Palmer

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®