[PATCH RESEND] ARM: npcm: Add CPU hotplug callbacks for kexec support

William Kennington wak at google.com
Thu Nov 2 21:12:30 AEDT 2023


On Thu, Nov 2, 2023 at 1:39 AM Tomer Maimon <tmaimon77 at gmail.com> wrote:
>
> Hi William,
>
>
> On Thu, 2 Nov 2023 at 02:53, <william at wkennington.com> wrote:
> >
> > From: Brian Ma <chma0 at nuvoton.com>
> >
> > Add callbacks required for kexec to function. The NPCM7xx/NPCN8xx does
> > not expose controls for powering down CPU cores, so just wait in idle
> > loop.
> This patch is related only to NPCM7xx please modify NPCM7xx/NPCN8xx to NPCM7xx.

Fixed in v2 message.

> >
> > Signed-off-by: Brian Ma <chma0 at nuvoton.com>
> > Signed-off-by: William A. Kennington III <william at wkennington.com>
> > ---
> >  arch/arm/mach-npcm/platsmp.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c
> > index 41891d3aa124..6cc7b5894f08 100644
> > --- a/arch/arm/mach-npcm/platsmp.c
> > +++ b/arch/arm/mach-npcm/platsmp.c
> > @@ -69,10 +69,27 @@ static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)
> >
> >         iounmap(scu_base);
> >  }
> > +#ifdef CONFIG_HOTPLUG_CPU
> > +static void npcm7xx_cpu_die(unsigned int cpu)
> > +{
> > +       while (1)
> > +               cpu_do_idle();
> > +}
> > +
> > +static int npcm7xx_cpu_kill(unsigned int l_cpu)
> > +{
> > +       return 1;
> > +}
> > +#endif
> > +
> >
> >  static struct smp_operations npcm7xx_smp_ops __initdata = {
> >         .smp_prepare_cpus = npcm7xx_smp_prepare_cpus,
> >         .smp_boot_secondary = npcm7xx_smp_boot_secondary,
> > +#ifdef CONFIG_HOTPLUG_CPU
> > +       .cpu_die                        = npcm7xx_cpu_die,
> > +       .cpu_kill                       = npcm7xx_cpu_kill,
> > +#endif
> >  };
> >
> >  CPU_METHOD_OF_DECLARE(npcm7xx_smp, "nuvoton,npcm750-smp", &npcm7xx_smp_ops);
> > --
> > 2.42.0.820.g83a721a137-goog
> >
>
> Best regards,
>
> Tomer


More information about the openbmc mailing list