[PATCH V2] ARM: imx: add smp support for imx7d
Russell King - ARM Linux admin
linux at armlinux.org.uk
Sun Jan 17 07:31:59 EST 2021
On Sun, Jan 17, 2021 at 07:46:20PM +0800, Shawn Guo wrote:
> On Thu, Jan 07, 2021 at 01:31:57PM +0100, Marek Vasut wrote:
> > From: Anson Huang <b20788 at freescale.com>
> >
> > Add SMP support for i.MX7D, including CPU hotplug support, for
> > systems where TFA is not present.
> >
> > The arm,cpu-registers-not-fw-configured is required, otherwise the
> > timer does not work correctly.
>
> As DT change becomes another patch, this should be dropped.
>
> >
> > Signed-off-by: Anson Huang <b20788 at freescale.com>
> > Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel at mentor.com> # Fix merge conflicts
> > Signed-off-by: Leonard Crestez <leonard.crestez at nxp.com>
> > Signed-off-by: Marek Vasut <marex at denx.de> # heavy cleanup
>
> Checkpatch warnings:
>
> WARNING: usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc
> #151: FILE: arch/arm/mach-imx/platsmp.c:108:
> + for (i = ncores; i < NR_CPUS; i++)
False. This is initialising the cpu possible map, so can't use
cpu_possible().
> > +void imx_gpcv2_set_m_core_pgc(bool enable, u32 offset)
>
> static inline?
Only "static" not "static inline" in a .c file.
> > +void __init imx7_src_init(void)
> > +{
> > + struct device_node *np;
> > + gpr_v2 = true;
> > +
> > + np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-src");
> > + if (!np)
> > + return;
> > + src_base = of_iomap(np, 0);
> > + WARN_ON(!src_base);
>
> Don't we need of_node_put()?
I always worry about this. The resources of the node remains in use
after the initialisation function has completed, so why _shouldn't_
the node also have a reference to it - in the same way that any
bound driver effectively maintains a reference on its DT node for
its lifetime. The only difference is that system devices such as this
have a lifetime of the system.
It's not like you could drop the "fsl,imx7d-src" node at runtime and
the system will do the right thing.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
More information about the linux-arm-kernel
mailing list