All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support
@ 2021-03-22 15:57 Bruce Mitchell
  2021-03-22 16:40 ` Bruce Mitchell
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Mitchell @ 2021-03-22 15:57 UTC (permalink / raw)
  To: Joel Stanley, openbmc; +Cc: Bruce Mitchell

These callbacks are required for kexec to function. The AST2600 does not
expose any controls for powering down it's CPU cores, so we borrow the
approach taken from socfpga and wait in the idle loop.

Author: Joel Stanley <joel@jms.id.au>

Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
---
 arch/arm/mach-aspeed/platsmp.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/mach-aspeed/platsmp.c b/arch/arm/mach-aspeed/platsmp.c
index 2324becf7991..1ae3ff5a9701 100644
--- a/arch/arm/mach-aspeed/platsmp.c
+++ b/arch/arm/mach-aspeed/platsmp.c
@@ -7,6 +7,8 @@
 #include <linux/of.h>
 #include <linux/smp.h>
 
+#include <asm/proc-fns.h>
+
 #define BOOT_ADDR	0x00
 #define BOOT_SIG	0x04
 
@@ -53,9 +55,27 @@ static void __init aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
 	iounmap(base);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void aspeed_g6_cpu_die(unsigned int cpu)
+{
+        /* Do WFI. If we wake up early, go back into WFI */
+        while (1)
+                cpu_do_idle();
+}
+
+static int aspeed_g6_cpu_kill(unsigned int cpu)
+{
+        return 1;
+}
+#endif
+
 static const struct smp_operations aspeed_smp_ops __initconst = {
 	.smp_prepare_cpus	= aspeed_g6_smp_prepare_cpus,
 	.smp_boot_secondary	= aspeed_g6_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_die		= aspeed_g6_cpu_die,
+	.cpu_kill		= aspeed_g6_cpu_kill,
+#endif
 };
 
 CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", &aspeed_smp_ops);
-- 
2.25.1


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

* Re: [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support
  2021-03-22 15:57 [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support Bruce Mitchell
@ 2021-03-22 16:40 ` Bruce Mitchell
  2021-03-22 18:07     ` Bruce Mitchell
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Mitchell @ 2021-03-22 16:40 UTC (permalink / raw)
  To: Joel Stanley, openbmc; +Cc: Andrew Jeffery, Eddie James

On 3/22/2021 08:57, Bruce Mitchell wrote:
> These callbacks are required for kexec to function. The AST2600 does not
> expose any controls for powering down it's CPU cores, so we borrow the
> approach taken from socfpga and wait in the idle loop.
> 
> Author: Joel Stanley <joel@jms.id.au>
> 
> Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
> ---
>   arch/arm/mach-aspeed/platsmp.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm/mach-aspeed/platsmp.c b/arch/arm/mach-aspeed/platsmp.c
> index 2324becf7991..1ae3ff5a9701 100644
> --- a/arch/arm/mach-aspeed/platsmp.c
> +++ b/arch/arm/mach-aspeed/platsmp.c
> @@ -7,6 +7,8 @@
>   #include <linux/of.h>
>   #include <linux/smp.h>
> 
> +#include <asm/proc-fns.h>
> +
>   #define BOOT_ADDR	0x00
>   #define BOOT_SIG	0x04
> 
> @@ -53,9 +55,27 @@ static void __init aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
>   	iounmap(base);
>   }
> 
> +#ifdef CONFIG_HOTPLUG_CPU
> +static void aspeed_g6_cpu_die(unsigned int cpu)
> +{
> +        /* Do WFI. If we wake up early, go back into WFI */
> +        while (1)
> +                cpu_do_idle();
> +}
> +
> +static int aspeed_g6_cpu_kill(unsigned int cpu)
> +{
> +        return 1;
> +}
> +#endif
> +
>   static const struct smp_operations aspeed_smp_ops __initconst = {
>   	.smp_prepare_cpus	= aspeed_g6_smp_prepare_cpus,
>   	.smp_boot_secondary	= aspeed_g6_boot_secondary,
> +#ifdef CONFIG_HOTPLUG_CPU
> +	.cpu_die		= aspeed_g6_cpu_die,
> +	.cpu_kill		= aspeed_g6_cpu_kill,
> +#endif
>   };
> 
>   CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", &aspeed_smp_ops);
> 

Adding Andrew Jeffery and Eddie James to the CC list.

-- 
Bruce

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

* Re: [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support
  2021-03-22 16:40 ` Bruce Mitchell
@ 2021-03-22 18:07     ` Bruce Mitchell
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Mitchell @ 2021-03-22 18:07 UTC (permalink / raw)
  To: Joel Stanley, openbmc, linux-kernel, linux-arm-kernel
  Cc: Andrew Jeffery, Eddie James

On 3/22/2021 09:40, Bruce Mitchell wrote:
> On 3/22/2021 08:57, Bruce Mitchell wrote:
>> These callbacks are required for kexec to function. The AST2600 does not
>> expose any controls for powering down it's CPU cores, so we borrow the
>> approach taken from socfpga and wait in the idle loop.
>>
>> Author: Joel Stanley <joel@jms.id.au>
>>
>> Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
>> ---
>>   arch/arm/mach-aspeed/platsmp.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/arm/mach-aspeed/platsmp.c 
>> b/arch/arm/mach-aspeed/platsmp.c
>> index 2324becf7991..1ae3ff5a9701 100644
>> --- a/arch/arm/mach-aspeed/platsmp.c
>> +++ b/arch/arm/mach-aspeed/platsmp.c
>> @@ -7,6 +7,8 @@
>>   #include <linux/of.h>
>>   #include <linux/smp.h>
>>
>> +#include <asm/proc-fns.h>
>> +
>>   #define BOOT_ADDR    0x00
>>   #define BOOT_SIG    0x04
>>
>> @@ -53,9 +55,27 @@ static void __init 
>> aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
>>       iounmap(base);
>>   }
>>
>> +#ifdef CONFIG_HOTPLUG_CPU
>> +static void aspeed_g6_cpu_die(unsigned int cpu)
>> +{
>> +        /* Do WFI. If we wake up early, go back into WFI */
>> +        while (1)
>> +                cpu_do_idle();
>> +}
>> +
>> +static int aspeed_g6_cpu_kill(unsigned int cpu)
>> +{
>> +        return 1;
>> +}
>> +#endif
>> +
>>   static const struct smp_operations aspeed_smp_ops __initconst = {
>>       .smp_prepare_cpus    = aspeed_g6_smp_prepare_cpus,
>>       .smp_boot_secondary    = aspeed_g6_boot_secondary,
>> +#ifdef CONFIG_HOTPLUG_CPU
>> +    .cpu_die        = aspeed_g6_cpu_die,
>> +    .cpu_kill        = aspeed_g6_cpu_kill,
>> +#endif
>>   };
>>
>>   CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", 
>> &aspeed_smp_ops);
>>
> 
> Adding Andrew Jeffery and Eddie James to the CC list.
> 

Adding linux-kernel@vger.kernel.org and 
linux-arm-kernel@lists.infradead.org based feedback.

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

* Re: [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support
@ 2021-03-22 18:07     ` Bruce Mitchell
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Mitchell @ 2021-03-22 18:07 UTC (permalink / raw)
  To: Joel Stanley, openbmc, linux-kernel, linux-arm-kernel
  Cc: Andrew Jeffery, Eddie James

On 3/22/2021 09:40, Bruce Mitchell wrote:
> On 3/22/2021 08:57, Bruce Mitchell wrote:
>> These callbacks are required for kexec to function. The AST2600 does not
>> expose any controls for powering down it's CPU cores, so we borrow the
>> approach taken from socfpga and wait in the idle loop.
>>
>> Author: Joel Stanley <joel@jms.id.au>
>>
>> Signed-off-by: Bruce Mitchell <bruce.mitchell@linux.vnet.ibm.com>
>> ---
>>   arch/arm/mach-aspeed/platsmp.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/arch/arm/mach-aspeed/platsmp.c 
>> b/arch/arm/mach-aspeed/platsmp.c
>> index 2324becf7991..1ae3ff5a9701 100644
>> --- a/arch/arm/mach-aspeed/platsmp.c
>> +++ b/arch/arm/mach-aspeed/platsmp.c
>> @@ -7,6 +7,8 @@
>>   #include <linux/of.h>
>>   #include <linux/smp.h>
>>
>> +#include <asm/proc-fns.h>
>> +
>>   #define BOOT_ADDR    0x00
>>   #define BOOT_SIG    0x04
>>
>> @@ -53,9 +55,27 @@ static void __init 
>> aspeed_g6_smp_prepare_cpus(unsigned int max_cpus)
>>       iounmap(base);
>>   }
>>
>> +#ifdef CONFIG_HOTPLUG_CPU
>> +static void aspeed_g6_cpu_die(unsigned int cpu)
>> +{
>> +        /* Do WFI. If we wake up early, go back into WFI */
>> +        while (1)
>> +                cpu_do_idle();
>> +}
>> +
>> +static int aspeed_g6_cpu_kill(unsigned int cpu)
>> +{
>> +        return 1;
>> +}
>> +#endif
>> +
>>   static const struct smp_operations aspeed_smp_ops __initconst = {
>>       .smp_prepare_cpus    = aspeed_g6_smp_prepare_cpus,
>>       .smp_boot_secondary    = aspeed_g6_boot_secondary,
>> +#ifdef CONFIG_HOTPLUG_CPU
>> +    .cpu_die        = aspeed_g6_cpu_die,
>> +    .cpu_kill        = aspeed_g6_cpu_kill,
>> +#endif
>>   };
>>
>>   CPU_METHOD_OF_DECLARE(aspeed_smp, "aspeed,ast2600-smp", 
>> &aspeed_smp_ops);
>>
> 
> Adding Andrew Jeffery and Eddie James to the CC list.
> 

Adding linux-kernel@vger.kernel.org and 
linux-arm-kernel@lists.infradead.org based feedback.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-03-22 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 15:57 [PATCH linux-next tag: next-20210322] ARM: aspeed: Add CPU hotplug callbacks for kexec support Bruce Mitchell
2021-03-22 16:40 ` Bruce Mitchell
2021-03-22 18:07   ` Bruce Mitchell
2021-03-22 18:07     ` Bruce Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.