* [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine
[not found] <20160906170457.32393-1-bigeasy@linutronix.de>
@ 2016-09-06 17:04 ` Sebastian Andrzej Siewior
2016-09-06 18:14 ` Will Deacon
2016-09-06 17:04 ` [PATCH 02/21] ARM: shmobile: " Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 03/21] ARM: OMAP: wakeupgen: " Sebastian Andrzej Siewior
2 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-09-06 17:04 UTC (permalink / raw)
To: linux-arm-kernel
Install the callbacks via the state machine.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm64/kernel/fpsimd.c | 22 +++++-----------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 975b274ee7b5..394c61db5566 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -299,28 +299,16 @@ static inline void fpsimd_pm_init(void) { }
#endif /* CONFIG_CPU_PM */
#ifdef CONFIG_HOTPLUG_CPU
-static int fpsimd_cpu_hotplug_notifier(struct notifier_block *nfb,
- unsigned long action,
- void *hcpu)
+static int fpsimd_cpu_dead(unsigned int cpu)
{
- unsigned int cpu = (long)hcpu;
-
- switch (action) {
- case CPU_DEAD:
- case CPU_DEAD_FROZEN:
- per_cpu(fpsimd_last_state, cpu) = NULL;
- break;
- }
- return NOTIFY_OK;
+ per_cpu(fpsimd_last_state, cpu) = NULL;
+ return 0;
}
-static struct notifier_block fpsimd_cpu_hotplug_notifier_block = {
- .notifier_call = fpsimd_cpu_hotplug_notifier,
-};
-
static inline void fpsimd_hotplug_init(void)
{
- register_cpu_notifier(&fpsimd_cpu_hotplug_notifier_block);
+ cpuhp_setup_state_nocalls(CPUHP_ARM64_FPSIMD_DEAD, "arm64/fpsimd:dead",
+ NULL, fpsimd_cpu_dead);
}
#else
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index afd59e2ca4b3..0da071ff36d2 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -20,6 +20,7 @@ enum cpuhp_state {
CPUHP_SOFTIRQ_DEAD,
CPUHP_NET_MVNETA_DEAD,
CPUHP_CPUIDLE_DEAD,
+ CPUHP_ARM64_FPSIMD_DEAD,
CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE,
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 02/21] ARM: shmobile: Convert to hotplug state machine
[not found] <20160906170457.32393-1-bigeasy@linutronix.de>
2016-09-06 17:04 ` [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine Sebastian Andrzej Siewior
@ 2016-09-06 17:04 ` Sebastian Andrzej Siewior
2016-09-06 18:05 ` Geert Uytterhoeven
2016-09-06 17:04 ` [PATCH 03/21] ARM: OMAP: wakeupgen: " Sebastian Andrzej Siewior
2 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-09-06 17:04 UTC (permalink / raw)
To: linux-arm-kernel
Install the callbacks via the state machine.
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-sh at vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/mach-shmobile/platsmp-scu.c | 26 ++++++++------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index 8d478f1da265..d1ecaf37d142 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -21,26 +21,14 @@
static phys_addr_t shmobile_scu_base_phys;
static void __iomem *shmobile_scu_base;
-static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
+static int shmobile_scu_cpu_prepare(unsigned int cpu)
{
- unsigned int cpu = (long)hcpu;
-
- switch (action) {
- case CPU_UP_PREPARE:
- /* For this particular CPU register SCU SMP boot vector */
- shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
- shmobile_scu_base_phys);
- break;
- };
-
- return NOTIFY_OK;
+ /* For this particular CPU register SCU SMP boot vector */
+ shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
+ shmobile_scu_base_phys);
+ return 0;
}
-static struct notifier_block shmobile_smp_scu_notifier = {
- .notifier_call = shmobile_smp_scu_notifier_call,
-};
-
void __init shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
unsigned int max_cpus)
{
@@ -54,7 +42,9 @@ void __init shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
/* Use CPU notifier for reset vector control */
- register_cpu_notifier(&shmobile_smp_scu_notifier);
+ cpuhp_setup_state_nocalls(CPUHP_ARM_SHMOBILE_SCU_PREPARE,
+ "arm/shmobile-scu:prepare",
+ shmobile_scu_cpu_prepare, NULL);
}
#ifdef CONFIG_HOTPLUG_CPU
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 0da071ff36d2..008eed0c0787 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -35,6 +35,7 @@ enum cpuhp_state {
CPUHP_POWERPC_PMAC_PREPARE,
CPUHP_POWERPC_MMU_CTX_PREPARE,
CPUHP_NOTIFY_PREPARE,
+ CPUHP_ARM_SHMOBILE_SCU_PREPARE,
CPUHP_TIMERS_DEAD,
CPUHP_BRINGUP_CPU,
CPUHP_AP_IDLE_DEAD,
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 03/21] ARM: OMAP: wakeupgen: Convert to hotplug state machine
[not found] <20160906170457.32393-1-bigeasy@linutronix.de>
2016-09-06 17:04 ` [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 02/21] ARM: shmobile: " Sebastian Andrzej Siewior
@ 2016-09-06 17:04 ` Sebastian Andrzej Siewior
2016-09-13 22:24 ` Tony Lindgren
2 siblings, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-09-06 17:04 UTC (permalink / raw)
To: linux-arm-kernel
Install the callbacks via the state machine.
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/mach-omap2/omap-wakeupgen.c | 35 +++++++++++++----------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 0c4754386532..369f95a703ac 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -322,34 +322,25 @@ static void irq_save_secure_context(void)
#endif
#ifdef CONFIG_HOTPLUG_CPU
-static int irq_cpu_hotplug_notify(struct notifier_block *self,
- unsigned long action, void *hcpu)
+static int omap_wakeupgen_cpu_online(unsigned int cpu)
{
- unsigned int cpu = (unsigned int)hcpu;
-
- /*
- * Corresponding FROZEN transitions do not have to be handled,
- * they are handled by at a higher level
- * (drivers/cpuidle/coupled.c).
- */
- switch (action) {
- case CPU_ONLINE:
- wakeupgen_irqmask_all(cpu, 0);
- break;
- case CPU_DEAD:
- wakeupgen_irqmask_all(cpu, 1);
- break;
- }
- return NOTIFY_OK;
+ wakeupgen_irqmask_all(cpu, 0);
+ return 0;
}
-static struct notifier_block irq_hotplug_notifier = {
- .notifier_call = irq_cpu_hotplug_notify,
-};
+static int omap_wakeupgen_cpu_dead(unsigned int cpu)
+{
+ wakeupgen_irqmask_all(cpu, 1);
+ return 0;
+}
static void __init irq_hotplug_init(void)
{
- register_hotcpu_notifier(&irq_hotplug_notifier);
+ cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "arm/omap-wake:online",
+ omap_wakeupgen_cpu_online, NULL);
+ cpuhp_setup_state_nocalls(CPUHP_ARM_OMAP_WAKE_DEAD,
+ "arm/omap-wake:dead", NULL,
+ omap_wakeupgen_cpu_dead);
}
#else
static void __init irq_hotplug_init(void)
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 008eed0c0787..35859aafbbfc 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -21,6 +21,7 @@ enum cpuhp_state {
CPUHP_NET_MVNETA_DEAD,
CPUHP_CPUIDLE_DEAD,
CPUHP_ARM64_FPSIMD_DEAD,
+ CPUHP_ARM_OMAP_WAKE_DEAD,
CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE,
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 02/21] ARM: shmobile: Convert to hotplug state machine
2016-09-06 17:04 ` [PATCH 02/21] ARM: shmobile: " Sebastian Andrzej Siewior
@ 2016-09-06 18:05 ` Geert Uytterhoeven
2016-09-07 13:58 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-09-06 18:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi Sebastian,
CC linux-renesas-soc
On Tue, Sep 6, 2016 at 7:04 PM, Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
> Install the callbacks via the state machine.
Please describe why this is desirable.
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-sh at vger.kernel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> arch/arm/mach-shmobile/platsmp-scu.c | 26 ++++++++------------------
> include/linux/cpuhotplug.h | 1 +
> 2 files changed, 9 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
> index 8d478f1da265..d1ecaf37d142 100644
> --- a/arch/arm/mach-shmobile/platsmp-scu.c
> +++ b/arch/arm/mach-shmobile/platsmp-scu.c
> @@ -21,26 +21,14 @@
> static phys_addr_t shmobile_scu_base_phys;
> static void __iomem *shmobile_scu_base;
>
> -static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
> - unsigned long action, void *hcpu)
> +static int shmobile_scu_cpu_prepare(unsigned int cpu)
> {
> - unsigned int cpu = (long)hcpu;
> -
> - switch (action) {
> - case CPU_UP_PREPARE:
> - /* For this particular CPU register SCU SMP boot vector */
> - shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
> - shmobile_scu_base_phys);
> - break;
> - };
> -
> - return NOTIFY_OK;
> + /* For this particular CPU register SCU SMP boot vector */
> + shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
> + shmobile_scu_base_phys);
> + return 0;
> }
>
> -static struct notifier_block shmobile_smp_scu_notifier = {
> - .notifier_call = shmobile_smp_scu_notifier_call,
> -};
> -
> void __init shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
> unsigned int max_cpus)
> {
> @@ -54,7 +42,9 @@ void __init shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
> scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);
>
> /* Use CPU notifier for reset vector control */
> - register_cpu_notifier(&shmobile_smp_scu_notifier);
> + cpuhp_setup_state_nocalls(CPUHP_ARM_SHMOBILE_SCU_PREPARE,
> + "arm/shmobile-scu:prepare",
> + shmobile_scu_cpu_prepare, NULL);
> }
>
> #ifdef CONFIG_HOTPLUG_CPU
> diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
> index 0da071ff36d2..008eed0c0787 100644
> --- a/include/linux/cpuhotplug.h
> +++ b/include/linux/cpuhotplug.h
> @@ -35,6 +35,7 @@ enum cpuhp_state {
> CPUHP_POWERPC_PMAC_PREPARE,
> CPUHP_POWERPC_MMU_CTX_PREPARE,
> CPUHP_NOTIFY_PREPARE,
> + CPUHP_ARM_SHMOBILE_SCU_PREPARE,
> CPUHP_TIMERS_DEAD,
> CPUHP_BRINGUP_CPU,
> CPUHP_AP_IDLE_DEAD,
What's the rationale behind adding all these numbers and always
iterating over all
of them, even though most/all of them cannot be used at the same time
(e.g. CPUHP_SH_SH3X_PREPARE is for SuperH, while
CPUHP_ARM_SHMOBILE_SCU_PREPARE is for ARM)?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine
2016-09-06 17:04 ` [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine Sebastian Andrzej Siewior
@ 2016-09-06 18:14 ` Will Deacon
0 siblings, 0 replies; 7+ messages in thread
From: Will Deacon @ 2016-09-06 18:14 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 06, 2016 at 07:04:37PM +0200, Sebastian Andrzej Siewior wrote:
> Install the callbacks via the state machine.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> arch/arm64/kernel/fpsimd.c | 22 +++++-----------------
> include/linux/cpuhotplug.h | 1 +
> 2 files changed, 6 insertions(+), 17 deletions(-)
Looks fine to me:
Acked-by: Will Deacon <will.deacon@arm.com>
> diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
> index afd59e2ca4b3..0da071ff36d2 100644
> --- a/include/linux/cpuhotplug.h
> +++ b/include/linux/cpuhotplug.h
> @@ -20,6 +20,7 @@ enum cpuhp_state {
> CPUHP_SOFTIRQ_DEAD,
> CPUHP_NET_MVNETA_DEAD,
> CPUHP_CPUIDLE_DEAD,
> + CPUHP_ARM64_FPSIMD_DEAD,
> CPUHP_WORKQUEUE_PREP,
> CPUHP_POWER_NUMA_PREPARE,
> CPUHP_HRTIMERS_PREPARE,
Are you planning to take this via your tree? The arm64 queue already
touches cpuhotplug.h for the hw-breakpoint and debugmon changes, so
there's a simple conflict to address here.
Will
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 02/21] ARM: shmobile: Convert to hotplug state machine
2016-09-06 18:05 ` Geert Uytterhoeven
@ 2016-09-07 13:58 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-09-07 13:58 UTC (permalink / raw)
To: linux-arm-kernel
On 2016-09-06 20:05:37 [+0200], Geert Uytterhoeven wrote:
> Hi Sebastian,
Hi Geert,
> Please describe why this is desirable.
We have now an old and new infrastructure in place to handle hotplug
notifications while a CPU goes up and/or down. We want to get rid of the
old infrastructure and are converting its users away.
> > diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
> > index 0da071ff36d2..008eed0c0787 100644
> > --- a/include/linux/cpuhotplug.h
> > +++ b/include/linux/cpuhotplug.h
> > @@ -35,6 +35,7 @@ enum cpuhp_state {
> > CPUHP_POWERPC_PMAC_PREPARE,
> > CPUHP_POWERPC_MMU_CTX_PREPARE,
> > CPUHP_NOTIFY_PREPARE,
> > + CPUHP_ARM_SHMOBILE_SCU_PREPARE,
> > CPUHP_TIMERS_DEAD,
> > CPUHP_BRINGUP_CPU,
> > CPUHP_AP_IDLE_DEAD,
>
> What's the rationale behind adding all these numbers and always
> iterating over all
> of them, even though most/all of them cannot be used at the same time
> (e.g. CPUHP_SH_SH3X_PREPARE is for SuperH, while
> CPUHP_ARM_SHMOBILE_SCU_PREPARE is for ARM)?
PREPARE + STARTING states require static ids. The online callback has
dynamic allocations of ids since it was assumed that this is the most
common one.
We will most likely evaluate the situation once we done and total number
of IDS are not acceptable.
>
> Gr{oetje,eeting}s,
>
> Geert
>
Sebastian
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 03/21] ARM: OMAP: wakeupgen: Convert to hotplug state machine
2016-09-06 17:04 ` [PATCH 03/21] ARM: OMAP: wakeupgen: " Sebastian Andrzej Siewior
@ 2016-09-13 22:24 ` Tony Lindgren
0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2016-09-13 22:24 UTC (permalink / raw)
To: linux-arm-kernel
* Sebastian Andrzej Siewior <bigeasy@linutronix.de> [160906 10:06]:
> Install the callbacks via the state machine.
Assuming this will get merged with the series:
Acked-by: Tony Lindgren <tony@atomide.com>
If you want me to pick it, please let me know.
Regards,
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-09-13 22:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20160906170457.32393-1-bigeasy@linutronix.de>
2016-09-06 17:04 ` [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine Sebastian Andrzej Siewior
2016-09-06 18:14 ` Will Deacon
2016-09-06 17:04 ` [PATCH 02/21] ARM: shmobile: " Sebastian Andrzej Siewior
2016-09-06 18:05 ` Geert Uytterhoeven
2016-09-07 13:58 ` Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 03/21] ARM: OMAP: wakeupgen: " Sebastian Andrzej Siewior
2016-09-13 22:24 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).