Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442667 > unrolled thread

[patch V2 00/67] cpuhotplug: Convert all priority notifiers to the state machine

Started byAnna-Maria Gleixner <anna-maria@linutronix.de>
First post2016-07-13 19:30 +0200
Last post2016-07-13 21:40 +0200
Articles 20 on this page of 117 — 18 participants

Back to article view | Back to linux.kernel


Contents

  [patch V2 00/67] cpuhotplug: Convert all priority notifiers to the  state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
    [patch V2 26/67] perf/x86/amd/power: Convert the hotplug notifier to  state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] perf/x86/amd/power: Convert the hotplug notifier  to state machine tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 49/67] arm/xen: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      Re: [patch V2 49/67] arm/xen: Convert to hotplug state machine Stefano Stabellini <sstabellini@kernel.org> - 2016-07-13 20:30 +0200
      [tip:smp/hotplug] arm/xen: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 51/67] hwtracing/coresight-etm3x: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] hwtracing/coresight-etm3x: Convert to hotplug  state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 59/67] smp: Convert core to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] smp/cfd: Convert core to hotplug state machine tip-bot for Richard Weinberger <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 55/67] hrtimer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] hrtimer: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 27/67] perf/core: Remove perf CPU notifier code Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] perf/core: Remove perf CPU notifier code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 40/67] clocksource/metag: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] clocksource/metag: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 21/67] sh/perf: Convert the hotplug notifiers to state  machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] sh/perf: Convert the hotplug notifiers to state  machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 13/67] perf/x86/amd/ibs: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] perf/x86/amd/ibs: Convert to hotplug state  machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 17/67] blackfin/perf: Convert hotplug notifier to state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] blackfin/perf: Convert hotplug notifier to state  machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 28/67] workqueue: Convert to state machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] workqueue: Convert to state machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 56/67] timers/core: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] timers/core: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 54/67] x86/tboot: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] x86/tboot: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 42/67] clocksource/mips-gic: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] clocksource/mips-gic: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 48/67] arm/twd: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] arm/twd: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 64/67] clocksource/armada-370-xp: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] clocksource/armada-370-xp: Convert to hotplug  state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:40 +0200
    [patch V2 47/67] arm/l2c: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      [tip:smp/hotplug] arm/l2c: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 09:20 +0200
        Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state  machine Ingo Molnar <mingo@kernel.org> - 2016-07-14 09:50 +0200
          Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 10:20 +0200
            Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state  machine Peter Zijlstra <peterz@infradead.org> - 2016-07-14 11:50 +0200
              Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 13:30 +0200
                Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state  machine Thomas Gleixner <tglx@linutronix.de> - 2016-07-14 13:40 +0200
                  Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-14 14:00 +0200
                    Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state  machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-15 16:20 +0200
                      Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-07-18 10:30 +0200
      [tip:smp/hotplug] leds/trigger/cpu: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:30 +0200
      Re: [patch V2 60/67] KVM/arm/arm64/vgic-new: Convert to hotplug state  machine Marc Zyngier <marc.zyngier@arm.com> - 2016-07-14 15:10 +0200
      [tip:smp/hotplug] KVM/arm/arm64/vgic-new: Convert to hotplug state  machine tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:40 +0200
    [patch V2 14/67] perf/x86/intel/rapl: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/x86/intel/rapl: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 01/67] cpuhotplug: Handle early registration gracefully Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] cpu/hotplug: Handle early registration gracefully tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:00 +0200
    [patch V2 32/67] x86/kvm/kvmclock: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] x86/kvm/kvmclock: Convert to hotplug state  machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 07/67] irqchip/bcm2836: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] irqchip/bcm2836: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 18/67] powerpc/perf: Convert book3s notifier to state  machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] powerpc/perf: Convert book3s notifier to state  machine callbacks tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 08/67] ARM: mvebu: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] ARM/mvebu: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 24/67] xtensa/perf: Convert the hotplug notifier to state  machine callbacks Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] xtensa/perf: Convert the hotplug notifier to  state machine callbacks tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 11/67] perf/x86/intel/uncore: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/x86/intel/uncore: Convert to hotplug state  machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 23/67] bus/arm-ccn: Convert to hotplug statemachine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      Re: [patch V2 23/67] bus/arm-ccn: Convert to hotplug statemachine Pawel Moll <pawel.moll@arm.com> - 2016-07-18 20:40 +0200
      [tip:smp/hotplug] bus/arm-ccn: Convert to hotplug statemachine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 25/67] perf/x86/amd/power: Change hotplug notifier to a  symmetric structure Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/x86/amd/power: Change hotplug notifier to a  symmetric structure tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 20/67] s390/perf: Convert the hotplug notifier to state  machine callbacks (Sampling) Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] s390/perf: Convert the hotplug notifier to state  machine callbacks (Sampling) tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 33/67] x86/apb_timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] x86/apb_timer: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 61/67] rcu: Convert rcutree to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] rcu: Convert rcutree to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:40 +0200
    [patch V2 31/67] KVM/x86: Remove superfluous SMP function call Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      Re: [patch V2 31/67] KVM/x86: Remove superfluous SMP function call Paolo Bonzini <pbonzini@redhat.com> - 2016-07-14 10:30 +0200
      [tip:smp/hotplug] KVM/x86: Remove superfluous SMP function call tip-bot for Anna-Maria Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 09/67] perf/core: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/core: Convert to hotplug state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 16/67] perf/x86/intel/cstate: Convert Intel CSTATE to  hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/x86/intel/cstate: Convert Intel CSTATE to  hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 22/67] bus/arm-cci: Convert to hotplug statemachine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      Re: [patch V2 22/67] bus/arm-cci: Convert to hotplug statemachine Punit Agrawal <punit.agrawal@arm.com> - 2016-07-15 14:40 +0200
      [tip:smp/hotplug] bus/arm-cci: Convert to hotplug statemachine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    [patch V2 34/67] arm: Convert VFP hotplug notifiers to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] arm: Convert VFP hotplug notifiers to state  machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 36/67] virt: Convert kvm hotplug to state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] virt: Convert kvm hotplug to state machine tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 37/67] ACPI/processor: Avoid STARTING/DYING actions in a  more logical way Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] ACPI/processor: Avoid STARTING/DYING actions in a  more logical way tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 41/67] clocksource/qcom-timer: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] clocksource/qcom-timer: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 52/67] hwtracing/coresight-etm4x: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] hwtracing/coresight-etm4x: Convert to hotplug  state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 38/67] clocksource/arm_arch_timer: Convert to hotplug state  machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] clocksource/arm_arch_timer: Convert to hotplug  state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:20 +0200
    [patch V2 45/67] arm/kvm/arch_timer: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] arm/kvm/arch_timer: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-14 23:50 +0200
        Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-15 02:10 +0200
          Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-15 02:30 +0200
            Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Ingo Molnar <mingo@kernel.org> - 2016-07-15 10:50 +0200
              Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Anton Blanchard <anton@samba.org> - 2016-07-15 14:20 +0200
            Re: [patch V2 30/67] powerpc/numa: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-15 18:30 +0200
              [PATCH v2] powerpc/numa: Convert to hotplug state machine Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-07-18 16:10 +0200
                [tip:smp/hotplug] powerpc/numa: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-22 22:00 +0200
    [patch V2 46/67] metag/perf: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] metag/perf: Convert to hotplug state machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 57/67] profile: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] profile: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-07-19 09:30 +0200
    [patch V2 12/67] perf/x86/amd/uncore: Convert to hotplug state machine Anna-Maria Gleixner <anna-maria@linutronix.de> - 2016-07-13 19:40 +0200
      [tip:smp/hotplug] perf/x86/amd/uncore: Convert to hotplug state  machine tip-bot for Richard Cochran <tipbot@zytor.com> - 2016-07-19 09:10 +0200
    Re: [patch V2 00/67] cpuhotplug: Convert all priority notifiers to  the state machine Jason Cooper <jason@lakedaemon.net> - 2016-07-13 21:40 +0200

Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →


#1442677 — [patch V2 17/67] blackfin/perf: Convert hotplug notifier to state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 17/67] blackfin/perf: Convert hotplug notifier to state machine
Message-ID<rUw8X-67L-63@gated-at.bofh.it>
In reply to#1442667
From: Thomas Gleixner <tglx@linutronix.de>

Install the callback via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Miao <realmz6@gmail.com>
Cc: adi-buildroot-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 arch/blackfin/kernel/perf_event.c | 26 +++++---------------------
 include/linux/cpuhotplug.h        |  1 +
 2 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/blackfin/kernel/perf_event.c b/arch/blackfin/kernel/perf_event.c
index 170d786..6355e97 100644
--- a/arch/blackfin/kernel/perf_event.c
+++ b/arch/blackfin/kernel/perf_event.c
@@ -453,29 +453,13 @@ static struct pmu pmu = {
 	.read        = bfin_pmu_read,
 };
 
-static void bfin_pmu_setup(int cpu)
+static int bfin_pmu_prepare_cpu(unsigned int cpu)
 {
 	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
+	bfin_write_PFCTL(0);
 	memset(cpuhw, 0, sizeof(struct cpu_hw_events));
-}
-
-static int
-bfin_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
-{
-	unsigned int cpu = (long)hcpu;
-
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_UP_PREPARE:
-		bfin_write_PFCTL(0);
-		bfin_pmu_setup(cpu);
-		break;
-
-	default:
-		break;
-	}
-
-	return NOTIFY_OK;
+	return 0;
 }
 
 static int __init bfin_pmu_init(void)
@@ -491,8 +475,8 @@ static int __init bfin_pmu_init(void)
 
 	ret = perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);
 	if (!ret)
-		perf_cpu_notifier(bfin_pmu_notifier);
-
+		cpuhp_setup_state(CPUHP_PERF_BFIN, "PERF_BFIN",
+				  bfin_pmu_prepare_cpu, NULL);
 	return ret;
 }
 early_initcall(bfin_pmu_init);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 68f4495..d54973e 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -9,6 +9,7 @@ enum cpuhp_state {
 	CPUHP_PERF_X86_UNCORE_PREP,
 	CPUHP_PERF_X86_AMD_UNCORE_PREP,
 	CPUHP_PERF_X86_RAPL_PREP,
+	CPUHP_PERF_BFIN,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1446119 — [tip:smp/hotplug] blackfin/perf: Convert hotplug notifier to state machine

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2016-07-19 09:10 +0200
Subject[tip:smp/hotplug] blackfin/perf: Convert hotplug notifier to state machine
Message-ID<rWxkf-YG-57@gated-at.bofh.it>
In reply to#1442677
Commit-ID:  a409f5ee2937cb15b4af485fa98b90946d9bea3a
Gitweb:     http://git.kernel.org/tip/a409f5ee2937cb15b4af485fa98b90946d9bea3a
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:19 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jul 2016 09:34:36 +0200

blackfin/perf: Convert hotplug notifier to state machine

Install the callback via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Miao <realmz6@gmail.com>
Cc: adi-buildroot-devel@lists.sourceforge.net
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153334.265797537@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/blackfin/kernel/perf_event.c | 26 +++++---------------------
 include/linux/cpuhotplug.h        |  1 +
 2 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/blackfin/kernel/perf_event.c b/arch/blackfin/kernel/perf_event.c
index 170d786..6355e97 100644
--- a/arch/blackfin/kernel/perf_event.c
+++ b/arch/blackfin/kernel/perf_event.c
@@ -453,29 +453,13 @@ static struct pmu pmu = {
 	.read        = bfin_pmu_read,
 };
 
-static void bfin_pmu_setup(int cpu)
+static int bfin_pmu_prepare_cpu(unsigned int cpu)
 {
 	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
+	bfin_write_PFCTL(0);
 	memset(cpuhw, 0, sizeof(struct cpu_hw_events));
-}
-
-static int
-bfin_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu)
-{
-	unsigned int cpu = (long)hcpu;
-
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_UP_PREPARE:
-		bfin_write_PFCTL(0);
-		bfin_pmu_setup(cpu);
-		break;
-
-	default:
-		break;
-	}
-
-	return NOTIFY_OK;
+	return 0;
 }
 
 static int __init bfin_pmu_init(void)
@@ -491,8 +475,8 @@ static int __init bfin_pmu_init(void)
 
 	ret = perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);
 	if (!ret)
-		perf_cpu_notifier(bfin_pmu_notifier);
-
+		cpuhp_setup_state(CPUHP_PERF_BFIN, "PERF_BFIN",
+				  bfin_pmu_prepare_cpu, NULL);
 	return ret;
 }
 early_initcall(bfin_pmu_init);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 68f4495..d54973e 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -9,6 +9,7 @@ enum cpuhp_state {
 	CPUHP_PERF_X86_UNCORE_PREP,
 	CPUHP_PERF_X86_AMD_UNCORE_PREP,
 	CPUHP_PERF_X86_RAPL_PREP,
+	CPUHP_PERF_BFIN,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,

[toc] | [prev] | [next] | [standalone]


#1442679 — [patch V2 28/67] workqueue: Convert to state machine callbacks

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 28/67] workqueue: Convert to state machine callbacks
Message-ID<rUw8X-67L-69@gated-at.bofh.it>
In reply to#1442667
From: Thomas Gleixner <tglx@linutronix.de>

Get rid of the prio ordering of the separate notifiers and use a proper state
callback pair.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 include/linux/cpu.h        |    9 ---
 include/linux/cpuhotplug.h |    2 
 include/linux/workqueue.h  |    6 ++
 kernel/cpu.c               |   10 ++++
 kernel/workqueue.c         |  108 +++++++++++++++++----------------------------
 5 files changed, 61 insertions(+), 74 deletions(-)

--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -55,15 +55,6 @@ extern ssize_t arch_cpu_release(const ch
 #endif
 struct notifier_block;
 
-/*
- * CPU notifier priorities.
- */
-enum {
-	/* bring up workqueues before normal notifiers and down after */
-	CPU_PRI_WORKQUEUE_UP	= 5,
-	CPU_PRI_WORKQUEUE_DOWN	= -5,
-};
-
 #define CPU_ONLINE		0x0002 /* CPU (unsigned)v is up */
 #define CPU_UP_PREPARE		0x0003 /* CPU (unsigned)v coming up */
 #define CPU_UP_CANCELED		0x0004 /* CPU (unsigned)v NOT coming up */
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -12,6 +12,7 @@ enum cpuhp_state {
 	CPUHP_PERF_BFIN,
 	CPUHP_PERF_POWER,
 	CPUHP_PERF_SUPERH,
+	CPUHP_WORKQUEUE_PREP,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
@@ -49,6 +50,7 @@ enum cpuhp_state {
 	CPUHP_AP_PERF_S390_SF_ONLINE,
 	CPUHP_AP_PERF_ARM_CCI_ONLINE,
 	CPUHP_AP_PERF_ARM_CCN_ONLINE,
+	CPUHP_AP_WORKQUEUE_ONLINE,
 	CPUHP_AP_NOTIFY_ONLINE,
 	CPUHP_AP_ONLINE_DYN,
 	CPUHP_AP_ONLINE_DYN_END		= CPUHP_AP_ONLINE_DYN + 30,
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -625,4 +625,10 @@ void wq_watchdog_touch(int cpu);
 static inline void wq_watchdog_touch(int cpu) { }
 #endif	/* CONFIG_WQ_WATCHDOG */
 
+#ifdef CONFIG_SMP
+int workqueue_prepare_cpu(unsigned int cpu);
+int workqueue_online_cpu(unsigned int cpu);
+int workqueue_offline_cpu(unsigned int cpu);
+#endif
+
 #endif
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1185,6 +1185,11 @@ static struct cpuhp_step cpuhp_bp_states
 		.startup = perf_event_init_cpu,
 		.teardown = perf_event_exit_cpu,
 	},
+	[CPUHP_WORKQUEUE_PREP] = {
+		.name = "workqueue prepare",
+		.startup = workqueue_prepare_cpu,
+		.teardown = NULL,
+	},
 	/*
 	 * Preparatory and dead notifiers. Will be replaced once the notifiers
 	 * are converted to states.
@@ -1265,6 +1270,11 @@ static struct cpuhp_step cpuhp_ap_states
 		.startup = perf_event_init_cpu,
 		.teardown = perf_event_exit_cpu,
 	},
+	[CPUHP_AP_WORKQUEUE_ONLINE] = {
+		.name = "workqueue online",
+		.startup = workqueue_online_cpu,
+		.teardown = workqueue_offline_cpu,
+	},
 
 	/*
 	 * Online/down_prepare notifiers. Will be removed once the notifiers
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4611,84 +4611,65 @@ static void restore_unbound_workers_cpum
 						  pool->attrs->cpumask) < 0);
 }
 
-/*
- * Workqueues should be brought up before normal priority CPU notifiers.
- * This will be registered high priority CPU notifier.
- */
-static int workqueue_cpu_up_callback(struct notifier_block *nfb,
-					       unsigned long action,
-					       void *hcpu)
+int workqueue_prepare_cpu(unsigned int cpu)
+{
+	struct worker_pool *pool;
+
+	for_each_cpu_worker_pool(pool, cpu) {
+		if (pool->nr_workers)
+			continue;
+		if (!create_worker(pool))
+			return -ENOMEM;
+	}
+	return 0;
+}
+
+int workqueue_online_cpu(unsigned int cpu)
 {
-	int cpu = (unsigned long)hcpu;
 	struct worker_pool *pool;
 	struct workqueue_struct *wq;
 	int pi;
 
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_UP_PREPARE:
-		for_each_cpu_worker_pool(pool, cpu) {
-			if (pool->nr_workers)
-				continue;
-			if (!create_worker(pool))
-				return NOTIFY_BAD;
-		}
-		break;
-
-	case CPU_DOWN_FAILED:
-	case CPU_ONLINE:
-		mutex_lock(&wq_pool_mutex);
+	mutex_lock(&wq_pool_mutex);
 
-		for_each_pool(pool, pi) {
-			mutex_lock(&pool->attach_mutex);
+	for_each_pool(pool, pi) {
+		mutex_lock(&pool->attach_mutex);
 
-			if (pool->cpu == cpu)
-				rebind_workers(pool);
-			else if (pool->cpu < 0)
-				restore_unbound_workers_cpumask(pool, cpu);
+		if (pool->cpu == cpu)
+			rebind_workers(pool);
+		else if (pool->cpu < 0)
+			restore_unbound_workers_cpumask(pool, cpu);
 
-			mutex_unlock(&pool->attach_mutex);
-		}
+		mutex_unlock(&pool->attach_mutex);
+	}
 
-		/* update NUMA affinity of unbound workqueues */
-		list_for_each_entry(wq, &workqueues, list)
-			wq_update_unbound_numa(wq, cpu, true);
+	/* update NUMA affinity of unbound workqueues */
+	list_for_each_entry(wq, &workqueues, list)
+		wq_update_unbound_numa(wq, cpu, true);
 
-		mutex_unlock(&wq_pool_mutex);
-		break;
-	}
-	return NOTIFY_OK;
+	mutex_unlock(&wq_pool_mutex);
+	return 0;
 }
 
-/*
- * Workqueues should be brought down after normal priority CPU notifiers.
- * This will be registered as low priority CPU notifier.
- */
-static int workqueue_cpu_down_callback(struct notifier_block *nfb,
-						 unsigned long action,
-						 void *hcpu)
+int workqueue_offline_cpu(unsigned int cpu)
 {
-	int cpu = (unsigned long)hcpu;
 	struct work_struct unbind_work;
 	struct workqueue_struct *wq;
 
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_DOWN_PREPARE:
-		/* unbinding per-cpu workers should happen on the local CPU */
-		INIT_WORK_ONSTACK(&unbind_work, wq_unbind_fn);
-		queue_work_on(cpu, system_highpri_wq, &unbind_work);
-
-		/* update NUMA affinity of unbound workqueues */
-		mutex_lock(&wq_pool_mutex);
-		list_for_each_entry(wq, &workqueues, list)
-			wq_update_unbound_numa(wq, cpu, false);
-		mutex_unlock(&wq_pool_mutex);
-
-		/* wait for per-cpu unbinding to finish */
-		flush_work(&unbind_work);
-		destroy_work_on_stack(&unbind_work);
-		break;
-	}
-	return NOTIFY_OK;
+	/* unbinding per-cpu workers should happen on the local CPU */
+	INIT_WORK_ONSTACK(&unbind_work, wq_unbind_fn);
+	queue_work_on(cpu, system_highpri_wq, &unbind_work);
+
+	/* update NUMA affinity of unbound workqueues */
+	mutex_lock(&wq_pool_mutex);
+	list_for_each_entry(wq, &workqueues, list)
+		wq_update_unbound_numa(wq, cpu, false);
+	mutex_unlock(&wq_pool_mutex);
+
+	/* wait for per-cpu unbinding to finish */
+	flush_work(&unbind_work);
+	destroy_work_on_stack(&unbind_work);
+	return 0;
 }
 
 #ifdef CONFIG_SMP
@@ -5490,9 +5471,6 @@ static int __init init_workqueues(void)
 
 	pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
 
-	cpu_notifier(workqueue_cpu_up_callback, CPU_PRI_WORKQUEUE_UP);
-	hotcpu_notifier(workqueue_cpu_down_callback, CPU_PRI_WORKQUEUE_DOWN);
-
 	wq_numa_init();
 
 	/* initialize CPU pools */

[toc] | [prev] | [next] | [standalone]


#1446146 — [tip:smp/hotplug] workqueue: Convert to state machine callbacks

Fromtip-bot for Thomas Gleixner <tipbot@zytor.com>
Date2016-07-19 09:20 +0200
Subject[tip:smp/hotplug] workqueue: Convert to state machine callbacks
Message-ID<rWxtV-129-47@gated-at.bofh.it>
In reply to#1442679
Commit-ID:  7ee681b25284782ecf380bf5ccf55f13c52fd0ce
Gitweb:     http://git.kernel.org/tip/7ee681b25284782ecf380bf5ccf55f13c52fd0ce
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:29 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 14 Jul 2016 09:34:43 +0200

workqueue: Convert to state machine callbacks

Get rid of the prio ordering of the separate notifiers and use a proper state
callback pair.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153335.197083890@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/cpu.h        |   9 ----
 include/linux/cpuhotplug.h |   2 +
 include/linux/workqueue.h  |   6 +++
 kernel/cpu.c               |  10 +++++
 kernel/workqueue.c         | 108 ++++++++++++++++++---------------------------
 5 files changed, 61 insertions(+), 74 deletions(-)

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index ca2dd86..797d9c8 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -55,15 +55,6 @@ extern ssize_t arch_cpu_release(const char *, size_t);
 #endif
 struct notifier_block;
 
-/*
- * CPU notifier priorities.
- */
-enum {
-	/* bring up workqueues before normal notifiers and down after */
-	CPU_PRI_WORKQUEUE_UP	= 5,
-	CPU_PRI_WORKQUEUE_DOWN	= -5,
-};
-
 #define CPU_ONLINE		0x0002 /* CPU (unsigned)v is up */
 #define CPU_UP_PREPARE		0x0003 /* CPU (unsigned)v coming up */
 #define CPU_UP_CANCELED		0x0004 /* CPU (unsigned)v NOT coming up */
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index acfeda1..60557a9 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -12,6 +12,7 @@ enum cpuhp_state {
 	CPUHP_PERF_BFIN,
 	CPUHP_PERF_POWER,
 	CPUHP_PERF_SUPERH,
+	CPUHP_WORKQUEUE_PREP,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
@@ -49,6 +50,7 @@ enum cpuhp_state {
 	CPUHP_AP_PERF_S390_SF_ONLINE,
 	CPUHP_AP_PERF_ARM_CCI_ONLINE,
 	CPUHP_AP_PERF_ARM_CCN_ONLINE,
+	CPUHP_AP_WORKQUEUE_ONLINE,
 	CPUHP_AP_NOTIFY_ONLINE,
 	CPUHP_AP_ONLINE_DYN,
 	CPUHP_AP_ONLINE_DYN_END		= CPUHP_AP_ONLINE_DYN + 30,
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index ca73c50..26cc1df 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -625,4 +625,10 @@ void wq_watchdog_touch(int cpu);
 static inline void wq_watchdog_touch(int cpu) { }
 #endif	/* CONFIG_WQ_WATCHDOG */
 
+#ifdef CONFIG_SMP
+int workqueue_prepare_cpu(unsigned int cpu);
+int workqueue_online_cpu(unsigned int cpu);
+int workqueue_offline_cpu(unsigned int cpu);
+#endif
+
 #endif
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3705d90..af53f82 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1185,6 +1185,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
 		.startup = perf_event_init_cpu,
 		.teardown = perf_event_exit_cpu,
 	},
+	[CPUHP_WORKQUEUE_PREP] = {
+		.name = "workqueue prepare",
+		.startup = workqueue_prepare_cpu,
+		.teardown = NULL,
+	},
 	/*
 	 * Preparatory and dead notifiers. Will be replaced once the notifiers
 	 * are converted to states.
@@ -1267,6 +1272,11 @@ static struct cpuhp_step cpuhp_ap_states[] = {
 		.startup = perf_event_init_cpu,
 		.teardown = perf_event_exit_cpu,
 	},
+	[CPUHP_AP_WORKQUEUE_ONLINE] = {
+		.name = "workqueue online",
+		.startup = workqueue_online_cpu,
+		.teardown = workqueue_offline_cpu,
+	},
 
 	/*
 	 * Online/down_prepare notifiers. Will be removed once the notifiers
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e1c0e99..c9dd5fb 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4611,84 +4611,65 @@ static void restore_unbound_workers_cpumask(struct worker_pool *pool, int cpu)
 						  pool->attrs->cpumask) < 0);
 }
 
-/*
- * Workqueues should be brought up before normal priority CPU notifiers.
- * This will be registered high priority CPU notifier.
- */
-static int workqueue_cpu_up_callback(struct notifier_block *nfb,
-					       unsigned long action,
-					       void *hcpu)
+int workqueue_prepare_cpu(unsigned int cpu)
+{
+	struct worker_pool *pool;
+
+	for_each_cpu_worker_pool(pool, cpu) {
+		if (pool->nr_workers)
+			continue;
+		if (!create_worker(pool))
+			return -ENOMEM;
+	}
+	return 0;
+}
+
+int workqueue_online_cpu(unsigned int cpu)
 {
-	int cpu = (unsigned long)hcpu;
 	struct worker_pool *pool;
 	struct workqueue_struct *wq;
 	int pi;
 
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_UP_PREPARE:
-		for_each_cpu_worker_pool(pool, cpu) {
-			if (pool->nr_workers)
-				continue;
-			if (!create_worker(pool))
-				return NOTIFY_BAD;
-		}
-		break;
-
-	case CPU_DOWN_FAILED:
-	case CPU_ONLINE:
-		mutex_lock(&wq_pool_mutex);
+	mutex_lock(&wq_pool_mutex);
 
-		for_each_pool(pool, pi) {
-			mutex_lock(&pool->attach_mutex);
+	for_each_pool(pool, pi) {
+		mutex_lock(&pool->attach_mutex);
 
-			if (pool->cpu == cpu)
-				rebind_workers(pool);
-			else if (pool->cpu < 0)
-				restore_unbound_workers_cpumask(pool, cpu);
+		if (pool->cpu == cpu)
+			rebind_workers(pool);
+		else if (pool->cpu < 0)
+			restore_unbound_workers_cpumask(pool, cpu);
 
-			mutex_unlock(&pool->attach_mutex);
-		}
+		mutex_unlock(&pool->attach_mutex);
+	}
 
-		/* update NUMA affinity of unbound workqueues */
-		list_for_each_entry(wq, &workqueues, list)
-			wq_update_unbound_numa(wq, cpu, true);
+	/* update NUMA affinity of unbound workqueues */
+	list_for_each_entry(wq, &workqueues, list)
+		wq_update_unbound_numa(wq, cpu, true);
 
-		mutex_unlock(&wq_pool_mutex);
-		break;
-	}
-	return NOTIFY_OK;
+	mutex_unlock(&wq_pool_mutex);
+	return 0;
 }
 
-/*
- * Workqueues should be brought down after normal priority CPU notifiers.
- * This will be registered as low priority CPU notifier.
- */
-static int workqueue_cpu_down_callback(struct notifier_block *nfb,
-						 unsigned long action,
-						 void *hcpu)
+int workqueue_offline_cpu(unsigned int cpu)
 {
-	int cpu = (unsigned long)hcpu;
 	struct work_struct unbind_work;
 	struct workqueue_struct *wq;
 
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_DOWN_PREPARE:
-		/* unbinding per-cpu workers should happen on the local CPU */
-		INIT_WORK_ONSTACK(&unbind_work, wq_unbind_fn);
-		queue_work_on(cpu, system_highpri_wq, &unbind_work);
-
-		/* update NUMA affinity of unbound workqueues */
-		mutex_lock(&wq_pool_mutex);
-		list_for_each_entry(wq, &workqueues, list)
-			wq_update_unbound_numa(wq, cpu, false);
-		mutex_unlock(&wq_pool_mutex);
-
-		/* wait for per-cpu unbinding to finish */
-		flush_work(&unbind_work);
-		destroy_work_on_stack(&unbind_work);
-		break;
-	}
-	return NOTIFY_OK;
+	/* unbinding per-cpu workers should happen on the local CPU */
+	INIT_WORK_ONSTACK(&unbind_work, wq_unbind_fn);
+	queue_work_on(cpu, system_highpri_wq, &unbind_work);
+
+	/* update NUMA affinity of unbound workqueues */
+	mutex_lock(&wq_pool_mutex);
+	list_for_each_entry(wq, &workqueues, list)
+		wq_update_unbound_numa(wq, cpu, false);
+	mutex_unlock(&wq_pool_mutex);
+
+	/* wait for per-cpu unbinding to finish */
+	flush_work(&unbind_work);
+	destroy_work_on_stack(&unbind_work);
+	return 0;
 }
 
 #ifdef CONFIG_SMP
@@ -5490,9 +5471,6 @@ static int __init init_workqueues(void)
 
 	pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
 
-	cpu_notifier(workqueue_cpu_up_callback, CPU_PRI_WORKQUEUE_UP);
-	hotcpu_notifier(workqueue_cpu_down_callback, CPU_PRI_WORKQUEUE_DOWN);
-
 	wq_numa_init();
 
 	/* initialize CPU pools */

[toc] | [prev] | [next] | [standalone]


#1442680 — [patch V2 56/67] timers/core: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 56/67] timers/core: Convert to hotplug state machine
Message-ID<rUw8X-67L-75@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

When tearing down, call timers_dead_cpu() before notify_dead().
There is a hidden dependency between:

 - timers
 - Block multiqueue
 - rcutree

If timers_dead_cpu() comes later than blk_mq_queue_reinit_notify()
that latter function causes a RCU stall.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 include/linux/cpuhotplug.h |    1 +
 include/linux/timer.h      |    6 ++++++
 kernel/cpu.c               |    5 +++++
 kernel/time/timer.c        |   25 ++-----------------------
 4 files changed, 14 insertions(+), 23 deletions(-)

--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -17,6 +17,7 @@ enum cpuhp_state {
 	CPUHP_WORKQUEUE_PREP,
 	CPUHP_POWER_NUMA_PREPARE,
 	CPUHP_HRTIMERS_PREPARE,
+	CPUHP_TIMERS_DEAD,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -273,4 +273,10 @@ unsigned long __round_jiffies_up_relativ
 unsigned long round_jiffies_up(unsigned long j);
 unsigned long round_jiffies_up_relative(unsigned long j);
 
+#ifdef CONFIG_HOTPLUG_CPU
+int timers_dead_cpu(unsigned int cpu);
+#else
+#define timers_dead_cpu NULL
+#endif
+
 #endif
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1195,6 +1195,11 @@ static struct cpuhp_step cpuhp_bp_states
 		.startup = hrtimers_prepare_cpu,
 		.teardown = hrtimers_dead_cpu,
 	},
+	[CPUHP_TIMERS_DEAD] = {
+		.name = "timers dead",
+		.startup = NULL,
+		.teardown = timers_dead_cpu,
+	},
 	/*
 	 * Preparatory and dead notifiers. Will be replaced once the notifiers
 	 * are converted to states.
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1804,7 +1804,7 @@ static void migrate_timer_list(struct ti
 	}
 }
 
-static void migrate_timers(int cpu)
+int timers_dead_cpu(unsigned int cpu)
 {
 	struct timer_base *old_base;
 	struct timer_base *new_base;
@@ -1831,29 +1831,9 @@ static void migrate_timers(int cpu)
 		spin_unlock_irq(&new_base->lock);
 		put_cpu_ptr(&timer_bases);
 	}
+	return 0;
 }
 
-static int timer_cpu_notify(struct notifier_block *self,
-				unsigned long action, void *hcpu)
-{
-	switch (action) {
-	case CPU_DEAD:
-	case CPU_DEAD_FROZEN:
-		migrate_timers((long)hcpu);
-		break;
-	default:
-		break;
-	}
-
-	return NOTIFY_OK;
-}
-
-static inline void timer_register_cpu_notifier(void)
-{
-	cpu_notifier(timer_cpu_notify, 0);
-}
-#else
-static inline void timer_register_cpu_notifier(void) { }
 #endif /* CONFIG_HOTPLUG_CPU */
 
 static void __init init_timer_cpu(int cpu)
@@ -1881,7 +1861,6 @@ void __init init_timers(void)
 {
 	init_timer_cpus();
 	init_timer_stats();
-	timer_register_cpu_notifier();
 	open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
 }
 

[toc] | [prev] | [next] | [standalone]


#1446163 — [tip:smp/hotplug] timers/core: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:30 +0200
Subject[tip:smp/hotplug] timers/core: Convert to hotplug state machine
Message-ID<rWxDA-15B-33@gated-at.bofh.it>
In reply to#1442680
Commit-ID:  24f73b99716a9cd8cbb345c41ced6b3b5ed94006
Gitweb:     http://git.kernel.org/tip/24f73b99716a9cd8cbb345c41ced6b3b5ed94006
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:59 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:41:42 +0200

timers/core: Convert to hotplug state machine

When tearing down, call timers_dead_cpu() before notify_dead().
There is a hidden dependency between:

 - timers
 - block multiqueue
 - rcutree

If timers_dead_cpu() comes later than blk_mq_queue_reinit_notify()
that latter function causes a RCU stall.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153337.566790058@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/cpuhotplug.h |  1 +
 include/linux/timer.h      |  6 ++++++
 kernel/cpu.c               |  5 +++++
 kernel/time/timer.c        | 25 ++-----------------------
 4 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 04ecc55..15d46d2 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -16,6 +16,7 @@ enum cpuhp_state {
 	CPUHP_X86_APB_DEAD,
 	CPUHP_WORKQUEUE_PREP,
 	CPUHP_HRTIMERS_PREPARE,
+	CPUHP_TIMERS_DEAD,
 	CPUHP_NOTIFY_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 4419506..51d601f 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -273,4 +273,10 @@ unsigned long __round_jiffies_up_relative(unsigned long j, int cpu);
 unsigned long round_jiffies_up(unsigned long j);
 unsigned long round_jiffies_up_relative(unsigned long j);
 
+#ifdef CONFIG_HOTPLUG_CPU
+int timers_dead_cpu(unsigned int cpu);
+#else
+#define timers_dead_cpu NULL
+#endif
+
 #endif
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 85500e7..e1017d9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1195,6 +1195,11 @@ static struct cpuhp_step cpuhp_bp_states[] = {
 		.startup = hrtimers_prepare_cpu,
 		.teardown = hrtimers_dead_cpu,
 	},
+	[CPUHP_TIMERS_DEAD] = {
+		.name = "timers dead",
+		.startup = NULL,
+		.teardown = timers_dead_cpu,
+	},
 	/*
 	 * Preparatory and dead notifiers. Will be replaced once the notifiers
 	 * are converted to states.
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index cb9ab40..555670a 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1804,7 +1804,7 @@ static void migrate_timer_list(struct timer_base *new_base, struct hlist_head *h
 	}
 }
 
-static void migrate_timers(int cpu)
+int timers_dead_cpu(unsigned int cpu)
 {
 	struct timer_base *old_base;
 	struct timer_base *new_base;
@@ -1831,29 +1831,9 @@ static void migrate_timers(int cpu)
 		spin_unlock_irq(&new_base->lock);
 		put_cpu_ptr(&timer_bases);
 	}
+	return 0;
 }
 
-static int timer_cpu_notify(struct notifier_block *self,
-				unsigned long action, void *hcpu)
-{
-	switch (action) {
-	case CPU_DEAD:
-	case CPU_DEAD_FROZEN:
-		migrate_timers((long)hcpu);
-		break;
-	default:
-		break;
-	}
-
-	return NOTIFY_OK;
-}
-
-static inline void timer_register_cpu_notifier(void)
-{
-	cpu_notifier(timer_cpu_notify, 0);
-}
-#else
-static inline void timer_register_cpu_notifier(void) { }
 #endif /* CONFIG_HOTPLUG_CPU */
 
 static void __init init_timer_cpu(int cpu)
@@ -1881,7 +1861,6 @@ void __init init_timers(void)
 {
 	init_timer_cpus();
 	init_timer_stats();
-	timer_register_cpu_notifier();
 	open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
 }
 

[toc] | [prev] | [next] | [standalone]


#1442681 — [patch V2 54/67] x86/tboot: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 54/67] x86/tboot: Convert to hotplug state machine
Message-ID<rUw8Y-67L-77@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Gang Wei <gang.wei@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ning Sun <ning.sun@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard L Maliszewski <richard.l.maliszewski@intel.com>
Cc: Shane Wang <shane.wang@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: tboot-devel@lists.sourceforge.net
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 arch/x86/kernel/tboot.c    | 25 ++++++++-----------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 9b0185f..654f6c6 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -323,25 +323,16 @@ static int tboot_wait_for_aps(int num_aps)
 	return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
 }
 
-static int tboot_cpu_callback(struct notifier_block *nfb, unsigned long action,
-			      void *hcpu)
+static int tboot_dying_cpu(unsigned int cpu)
 {
-	switch (action) {
-	case CPU_DYING:
-		atomic_inc(&ap_wfs_count);
-		if (num_online_cpus() == 1)
-			if (tboot_wait_for_aps(atomic_read(&ap_wfs_count)))
-				return NOTIFY_BAD;
-		break;
+	atomic_inc(&ap_wfs_count);
+	if (num_online_cpus() == 1) {
+		if (tboot_wait_for_aps(atomic_read(&ap_wfs_count)))
+			return -EBUSY;
 	}
-	return NOTIFY_OK;
+	return 0;
 }
 
-static struct notifier_block tboot_cpu_notifier =
-{
-	.notifier_call = tboot_cpu_callback,
-};
-
 #ifdef CONFIG_DEBUG_FS
 
 #define TBOOT_LOG_UUID	{ 0x26, 0x25, 0x19, 0xc0, 0x30, 0x6b, 0xb4, 0x4d, \
@@ -417,8 +408,8 @@ static __init int tboot_late_init(void)
 	tboot_create_trampoline();
 
 	atomic_set(&ap_wfs_count, 0);
-	register_hotcpu_notifier(&tboot_cpu_notifier);
-
+	cpuhp_setup_state(CPUHP_AP_X86_TBOOT_DYING, "AP_X86_TBOOT_DYING", NULL,
+			  tboot_dying_cpu);
 #ifdef CONFIG_DEBUG_FS
 	debugfs_create_file("tboot_log", S_IRUSR,
 			arch_debugfs_dir, NULL, &tboot_log_fops);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index da94513..c1597d6 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -54,6 +54,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_CORESIGHT4_STARTING,
 	CPUHP_AP_ARM64_ISNDEP_STARTING,
 	CPUHP_AP_LEDTRIG_STARTING,
+	CPUHP_AP_X86_TBOOT_DYING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,
 	CPUHP_TEARDOWN_CPU,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1446168 — [tip:smp/hotplug] x86/tboot: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:30 +0200
Subject[tip:smp/hotplug] x86/tboot: Convert to hotplug state machine
Message-ID<rWxDB-15B-47@gated-at.bofh.it>
In reply to#1442681
Commit-ID:  ae6a8a2ed721ecdbc15d32b2089af5ed2190adc7
Gitweb:     http://git.kernel.org/tip/ae6a8a2ed721ecdbc15d32b2089af5ed2190adc7
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:57 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:30 +0200

x86/tboot: Convert to hotplug state machine

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Gang Wei <gang.wei@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ning Sun <ning.sun@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard L Maliszewski <richard.l.maliszewski@intel.com>
Cc: Shane Wang <shane.wang@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Cc: tboot-devel@lists.sourceforge.net
Link: http://lkml.kernel.org/r/20160713153337.400227322@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/tboot.c    | 25 ++++++++-----------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index 9b0185f..654f6c6 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -323,25 +323,16 @@ static int tboot_wait_for_aps(int num_aps)
 	return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
 }
 
-static int tboot_cpu_callback(struct notifier_block *nfb, unsigned long action,
-			      void *hcpu)
+static int tboot_dying_cpu(unsigned int cpu)
 {
-	switch (action) {
-	case CPU_DYING:
-		atomic_inc(&ap_wfs_count);
-		if (num_online_cpus() == 1)
-			if (tboot_wait_for_aps(atomic_read(&ap_wfs_count)))
-				return NOTIFY_BAD;
-		break;
+	atomic_inc(&ap_wfs_count);
+	if (num_online_cpus() == 1) {
+		if (tboot_wait_for_aps(atomic_read(&ap_wfs_count)))
+			return -EBUSY;
 	}
-	return NOTIFY_OK;
+	return 0;
 }
 
-static struct notifier_block tboot_cpu_notifier =
-{
-	.notifier_call = tboot_cpu_callback,
-};
-
 #ifdef CONFIG_DEBUG_FS
 
 #define TBOOT_LOG_UUID	{ 0x26, 0x25, 0x19, 0xc0, 0x30, 0x6b, 0xb4, 0x4d, \
@@ -417,8 +408,8 @@ static __init int tboot_late_init(void)
 	tboot_create_trampoline();
 
 	atomic_set(&ap_wfs_count, 0);
-	register_hotcpu_notifier(&tboot_cpu_notifier);
-
+	cpuhp_setup_state(CPUHP_AP_X86_TBOOT_DYING, "AP_X86_TBOOT_DYING", NULL,
+			  tboot_dying_cpu);
 #ifdef CONFIG_DEBUG_FS
 	debugfs_create_file("tboot_log", S_IRUSR,
 			arch_debugfs_dir, NULL, &tboot_log_fops);
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index c5b96d0..070cc7f 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -53,6 +53,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_CORESIGHT4_STARTING,
 	CPUHP_AP_ARM64_ISNDEP_STARTING,
 	CPUHP_AP_LEDTRIG_STARTING,
+	CPUHP_AP_X86_TBOOT_DYING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,
 	CPUHP_TEARDOWN_CPU,

[toc] | [prev] | [next] | [standalone]


#1442682 — [patch V2 42/67] clocksource/mips-gic: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 42/67] clocksource/mips-gic: Convert to hotplug state machine
Message-ID<rUw8X-67L-71@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 drivers/clocksource/mips-gic-timer.c | 38 ++++++++++++------------------------
 include/linux/cpuhotplug.h           |  1 +
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 1572c7a..d91e872 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -49,10 +49,9 @@ struct irqaction gic_compare_irqaction = {
 	.name = "timer",
 };
 
-static void gic_clockevent_cpu_init(struct clock_event_device *cd)
+static void gic_clockevent_cpu_init(unsigned int cpu,
+				    struct clock_event_device *cd)
 {
-	unsigned int cpu = smp_processor_id();
-
 	cd->name		= "MIPS GIC";
 	cd->features		= CLOCK_EVT_FEAT_ONESHOT |
 				  CLOCK_EVT_FEAT_C3STOP;
@@ -79,19 +78,10 @@ static void gic_update_frequency(void *data)
 	clockevents_update_freq(this_cpu_ptr(&gic_clockevent_device), rate);
 }
 
-static int gic_cpu_notifier(struct notifier_block *nb, unsigned long action,
-				void *data)
+static int gic_starting_cpu(unsigned int cpu)
 {
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
-		break;
-	case CPU_DYING:
-		gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
-		break;
-	}
-
-	return NOTIFY_OK;
+	gic_clockevent_cpu_init(cpu, this_cpu_ptr(&gic_clockevent_device));
+	return 0;
 }
 
 static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
@@ -105,10 +95,11 @@ static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
 	return NOTIFY_OK;
 }
 
-
-static struct notifier_block gic_cpu_nb = {
-	.notifier_call = gic_cpu_notifier,
-};
+static int gic_dying_cpu(unsigned int cpu)
+{
+	gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
+	return 0;
+}
 
 static struct notifier_block gic_clk_nb = {
 	.notifier_call = gic_clk_notifier,
@@ -125,12 +116,9 @@ static int gic_clockevent_init(void)
 	if (ret < 0)
 		return ret;
 
-	ret = register_cpu_notifier(&gic_cpu_nb);
-	if (ret < 0)
-		pr_warn("GIC: Unable to register CPU notifier\n");
-
-	gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
-
+	cpuhp_setup_state(CPUHP_AP_MIPS_GIC_TIMER_STARTING,
+			  "AP_MIPS_GIC_TIMER_STARTING", gic_starting_cpu,
+			  gic_dying_cpu);
 	return 0;
 }
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 5121ec1..c052b04 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -41,6 +41,7 @@ enum cpuhp_state {
 	CPUHP_AP_DUMMY_TIMER_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
+	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1446155 — [tip:smp/hotplug] clocksource/mips-gic: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:30 +0200
Subject[tip:smp/hotplug] clocksource/mips-gic: Convert to hotplug state machine
Message-ID<rWxDA-15B-17@gated-at.bofh.it>
In reply to#1442682
Commit-ID:  2dab90932fd08f101a45acc0495ccd77b869da5d
Gitweb:     http://git.kernel.org/tip/2dab90932fd08f101a45acc0495ccd77b869da5d
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:44 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:26 +0200

clocksource/mips-gic: Convert to hotplug state machine

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153336.380737946@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 drivers/clocksource/mips-gic-timer.c | 38 ++++++++++++------------------------
 include/linux/cpuhotplug.h           |  1 +
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 1572c7a..d91e872 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -49,10 +49,9 @@ struct irqaction gic_compare_irqaction = {
 	.name = "timer",
 };
 
-static void gic_clockevent_cpu_init(struct clock_event_device *cd)
+static void gic_clockevent_cpu_init(unsigned int cpu,
+				    struct clock_event_device *cd)
 {
-	unsigned int cpu = smp_processor_id();
-
 	cd->name		= "MIPS GIC";
 	cd->features		= CLOCK_EVT_FEAT_ONESHOT |
 				  CLOCK_EVT_FEAT_C3STOP;
@@ -79,19 +78,10 @@ static void gic_update_frequency(void *data)
 	clockevents_update_freq(this_cpu_ptr(&gic_clockevent_device), rate);
 }
 
-static int gic_cpu_notifier(struct notifier_block *nb, unsigned long action,
-				void *data)
+static int gic_starting_cpu(unsigned int cpu)
 {
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
-		break;
-	case CPU_DYING:
-		gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
-		break;
-	}
-
-	return NOTIFY_OK;
+	gic_clockevent_cpu_init(cpu, this_cpu_ptr(&gic_clockevent_device));
+	return 0;
 }
 
 static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
@@ -105,10 +95,11 @@ static int gic_clk_notifier(struct notifier_block *nb, unsigned long action,
 	return NOTIFY_OK;
 }
 
-
-static struct notifier_block gic_cpu_nb = {
-	.notifier_call = gic_cpu_notifier,
-};
+static int gic_dying_cpu(unsigned int cpu)
+{
+	gic_clockevent_cpu_exit(this_cpu_ptr(&gic_clockevent_device));
+	return 0;
+}
 
 static struct notifier_block gic_clk_nb = {
 	.notifier_call = gic_clk_notifier,
@@ -125,12 +116,9 @@ static int gic_clockevent_init(void)
 	if (ret < 0)
 		return ret;
 
-	ret = register_cpu_notifier(&gic_cpu_nb);
-	if (ret < 0)
-		pr_warn("GIC: Unable to register CPU notifier\n");
-
-	gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
-
+	cpuhp_setup_state(CPUHP_AP_MIPS_GIC_TIMER_STARTING,
+			  "AP_MIPS_GIC_TIMER_STARTING", gic_starting_cpu,
+			  gic_dying_cpu);
 	return 0;
 }
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index d74d15a..456e3d9 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -40,6 +40,7 @@ enum cpuhp_state {
 	CPUHP_AP_DUMMY_TIMER_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
+	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,

[toc] | [prev] | [next] | [standalone]


#1442683 — [patch V2 48/67] arm/twd: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 48/67] arm/twd: Convert to hotplug state machine
Message-ID<rUw8Y-67L-81@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

Install the callbacks via the state machine. The callbacks won't be invoked on
already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 arch/arm/kernel/smp_twd.c  | 31 +++++++++++--------------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index b6ec65e..02d5e5e 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -310,24 +310,17 @@ static void twd_timer_setup(void)
 	enable_percpu_irq(clk->irq, 0);
 }
 
-static int twd_timer_cpu_notify(struct notifier_block *self,
-				unsigned long action, void *hcpu)
+static int twd_timer_starting_cpu(unsigned int cpu)
 {
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		twd_timer_setup();
-		break;
-	case CPU_DYING:
-		twd_timer_stop();
-		break;
-	}
-
-	return NOTIFY_OK;
+	twd_timer_setup();
+	return 0;
 }
 
-static struct notifier_block twd_timer_cpu_nb = {
-	.notifier_call = twd_timer_cpu_notify,
-};
+static int twd_timer_dying_cpu(unsigned int cpu)
+{
+	twd_timer_stop();
+	return 0;
+}
 
 static int __init twd_local_timer_common_register(struct device_node *np)
 {
@@ -345,9 +338,9 @@ static int __init twd_local_timer_common_register(struct device_node *np)
 		goto out_free;
 	}
 
-	err = register_cpu_notifier(&twd_timer_cpu_nb);
-	if (err)
-		goto out_irq;
+	cpuhp_setup_state_nocalls(CPUHP_AP_ARM_TWD_STARTING,
+				  "AP_ARM_TWD_STARTING",
+				  twd_timer_starting_cpu, twd_timer_dying_cpu);
 
 	twd_get_clock(np);
 	if (!of_property_read_bool(np, "always-on"))
@@ -365,8 +358,6 @@ static int __init twd_local_timer_common_register(struct device_node *np)
 
 	return 0;
 
-out_irq:
-	free_percpu_irq(twd_ppi, twd_evt);
 out_free:
 	iounmap(twd_base);
 	twd_base = NULL;
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 1876377..86ac982 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -41,6 +41,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_L2X0_STARTING,
 	CPUHP_AP_ARM_ARCH_TIMER_STARTING,
 	CPUHP_AP_DUMMY_TIMER_STARTING,
+	CPUHP_AP_ARM_TWD_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1446153 — [tip:smp/hotplug] arm/twd: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:30 +0200
Subject[tip:smp/hotplug] arm/twd: Convert to hotplug state machine
Message-ID<rWxDz-15B-9@gated-at.bofh.it>
In reply to#1442683
Commit-ID:  26b8768868c090151aa8c337773d429e0d5ca727
Gitweb:     http://git.kernel.org/tip/26b8768868c090151aa8c337773d429e0d5ca727
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:51 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:28 +0200

arm/twd: Convert to hotplug state machine

Install the callbacks via the state machine. The callbacks won't be invoked on
already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153336.881124821@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/arm/kernel/smp_twd.c  | 31 +++++++++++--------------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index b6ec65e..02d5e5e 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -310,24 +310,17 @@ static void twd_timer_setup(void)
 	enable_percpu_irq(clk->irq, 0);
 }
 
-static int twd_timer_cpu_notify(struct notifier_block *self,
-				unsigned long action, void *hcpu)
+static int twd_timer_starting_cpu(unsigned int cpu)
 {
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		twd_timer_setup();
-		break;
-	case CPU_DYING:
-		twd_timer_stop();
-		break;
-	}
-
-	return NOTIFY_OK;
+	twd_timer_setup();
+	return 0;
 }
 
-static struct notifier_block twd_timer_cpu_nb = {
-	.notifier_call = twd_timer_cpu_notify,
-};
+static int twd_timer_dying_cpu(unsigned int cpu)
+{
+	twd_timer_stop();
+	return 0;
+}
 
 static int __init twd_local_timer_common_register(struct device_node *np)
 {
@@ -345,9 +338,9 @@ static int __init twd_local_timer_common_register(struct device_node *np)
 		goto out_free;
 	}
 
-	err = register_cpu_notifier(&twd_timer_cpu_nb);
-	if (err)
-		goto out_irq;
+	cpuhp_setup_state_nocalls(CPUHP_AP_ARM_TWD_STARTING,
+				  "AP_ARM_TWD_STARTING",
+				  twd_timer_starting_cpu, twd_timer_dying_cpu);
 
 	twd_get_clock(np);
 	if (!of_property_read_bool(np, "always-on"))
@@ -365,8 +358,6 @@ static int __init twd_local_timer_common_register(struct device_node *np)
 
 	return 0;
 
-out_irq:
-	free_percpu_irq(twd_ppi, twd_evt);
 out_free:
 	iounmap(twd_base);
 	twd_base = NULL;
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 2057e64..ad48881 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -40,6 +40,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_L2X0_STARTING,
 	CPUHP_AP_ARM_ARCH_TIMER_STARTING,
 	CPUHP_AP_DUMMY_TIMER_STARTING,
+	CPUHP_AP_ARM_TWD_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,

[toc] | [prev] | [next] | [standalone]


#1442684 — [patch V2 64/67] clocksource/armada-370-xp: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 64/67] clocksource/armada-370-xp: Convert to hotplug state machine
Message-ID<rUw8Y-67L-79@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.


Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 drivers/clocksource/time-armada-370-xp.c |   41 ++++++++-----------------------
 include/linux/cpuhotplug.h               |    1 
 2 files changed, 12 insertions(+), 30 deletions(-)

--- a/drivers/clocksource/time-armada-370-xp.c
+++ b/drivers/clocksource/time-armada-370-xp.c
@@ -170,10 +170,10 @@ static irqreturn_t armada_370_xp_timer_i
 /*
  * Setup the local clock events for a CPU.
  */
-static int armada_370_xp_timer_setup(struct clock_event_device *evt)
+static int armada_370_xp_timer_starting_cpu(unsigned int cpu)
 {
+	struct clock_event_device *evt = per_cpu_ptr(armada_370_xp_evt, cpu);
 	u32 clr = 0, set = 0;
-	int cpu = smp_processor_id();
 
 	if (timer25Mhz)
 		set = TIMER0_25MHZ;
@@ -200,35 +200,15 @@ static int armada_370_xp_timer_setup(str
 	return 0;
 }
 
-static void armada_370_xp_timer_stop(struct clock_event_device *evt)
+static int armada_370_xp_timer_dying_cpu(unsigned int cpu)
 {
+	struct clock_event_device *evt = per_cpu_ptr(armada_370_xp_evt, cpu);
+
 	evt->set_state_shutdown(evt);
 	disable_percpu_irq(evt->irq);
+	return 0;
 }
 
-static int armada_370_xp_timer_cpu_notify(struct notifier_block *self,
-					   unsigned long action, void *hcpu)
-{
-	/*
-	 * Grab cpu pointer in each case to avoid spurious
-	 * preemptible warnings
-	 */
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
-		break;
-	case CPU_DYING:
-		armada_370_xp_timer_stop(this_cpu_ptr(armada_370_xp_evt));
-		break;
-	}
-
-	return NOTIFY_OK;
-}
-
-static struct notifier_block armada_370_xp_timer_cpu_nb = {
-	.notifier_call = armada_370_xp_timer_cpu_notify,
-};
-
 static u32 timer0_ctrl_reg, timer0_local_ctrl_reg;
 
 static int armada_370_xp_timer_suspend(void)
@@ -322,8 +302,6 @@ static int __init armada_370_xp_timer_co
 		return res;
 	}
 
-	register_cpu_notifier(&armada_370_xp_timer_cpu_nb);
-
 	armada_370_xp_evt = alloc_percpu(struct clock_event_device);
 	if (!armada_370_xp_evt)
 		return -ENOMEM;
@@ -341,9 +319,12 @@ static int __init armada_370_xp_timer_co
 		return res;
 	}
 
-	res = armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
+	res = cpuhp_setup_state(CPUHP_AP_ARMADA_TIMER_STARTING,
+				"AP_ARMADA_TIMER_STARTING",
+				armada_370_xp_timer_starting_cpu,
+				armada_370_xp_timer_dying_cpu);
 	if (res) {
-		pr_err("Failed to setup timer");
+		pr_err("Failed to setup hotplug state and timer");
 		return res;
 	}
 
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -54,6 +54,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_TWD_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
+	CPUHP_AP_ARMADA_TIMER_STARTING,
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
 	CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,

[toc] | [prev] | [next] | [standalone]


#1446202 — [tip:smp/hotplug] clocksource/armada-370-xp: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:40 +0200
Subject[tip:smp/hotplug] clocksource/armada-370-xp: Convert to hotplug state machine
Message-ID<rWxNh-18Q-45@gated-at.bofh.it>
In reply to#1442684
Commit-ID:  2c48fef74ca42d05c3efd4345b8a068ebf479a5f
Gitweb:     http://git.kernel.org/tip/2c48fef74ca42d05c3efd4345b8a068ebf479a5f
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:17:06 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:41:45 +0200

clocksource/armada-370-xp: Convert to hotplug state machine

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153338.229913786@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 drivers/clocksource/time-armada-370-xp.c | 41 +++++++++-----------------------
 include/linux/cpuhotplug.h               |  1 +
 2 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c
index 20ec066..719b478 100644
--- a/drivers/clocksource/time-armada-370-xp.c
+++ b/drivers/clocksource/time-armada-370-xp.c
@@ -170,10 +170,10 @@ static irqreturn_t armada_370_xp_timer_interrupt(int irq, void *dev_id)
 /*
  * Setup the local clock events for a CPU.
  */
-static int armada_370_xp_timer_setup(struct clock_event_device *evt)
+static int armada_370_xp_timer_starting_cpu(unsigned int cpu)
 {
+	struct clock_event_device *evt = per_cpu_ptr(armada_370_xp_evt, cpu);
 	u32 clr = 0, set = 0;
-	int cpu = smp_processor_id();
 
 	if (timer25Mhz)
 		set = TIMER0_25MHZ;
@@ -200,35 +200,15 @@ static int armada_370_xp_timer_setup(struct clock_event_device *evt)
 	return 0;
 }
 
-static void armada_370_xp_timer_stop(struct clock_event_device *evt)
+static int armada_370_xp_timer_dying_cpu(unsigned int cpu)
 {
+	struct clock_event_device *evt = per_cpu_ptr(armada_370_xp_evt, cpu);
+
 	evt->set_state_shutdown(evt);
 	disable_percpu_irq(evt->irq);
+	return 0;
 }
 
-static int armada_370_xp_timer_cpu_notify(struct notifier_block *self,
-					   unsigned long action, void *hcpu)
-{
-	/*
-	 * Grab cpu pointer in each case to avoid spurious
-	 * preemptible warnings
-	 */
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
-		break;
-	case CPU_DYING:
-		armada_370_xp_timer_stop(this_cpu_ptr(armada_370_xp_evt));
-		break;
-	}
-
-	return NOTIFY_OK;
-}
-
-static struct notifier_block armada_370_xp_timer_cpu_nb = {
-	.notifier_call = armada_370_xp_timer_cpu_notify,
-};
-
 static u32 timer0_ctrl_reg, timer0_local_ctrl_reg;
 
 static int armada_370_xp_timer_suspend(void)
@@ -322,8 +302,6 @@ static int __init armada_370_xp_timer_common_init(struct device_node *np)
 		return res;
 	}
 
-	register_cpu_notifier(&armada_370_xp_timer_cpu_nb);
-
 	armada_370_xp_evt = alloc_percpu(struct clock_event_device);
 	if (!armada_370_xp_evt)
 		return -ENOMEM;
@@ -341,9 +319,12 @@ static int __init armada_370_xp_timer_common_init(struct device_node *np)
 		return res;
 	}
 
-	res = armada_370_xp_timer_setup(this_cpu_ptr(armada_370_xp_evt));
+	res = cpuhp_setup_state(CPUHP_AP_ARMADA_TIMER_STARTING,
+				"AP_ARMADA_TIMER_STARTING",
+				armada_370_xp_timer_starting_cpu,
+				armada_370_xp_timer_dying_cpu);
 	if (res) {
-		pr_err("Failed to setup timer");
+		pr_err("Failed to setup hotplug state and timer");
 		return res;
 	}
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 7ad8a7e7..ee7f750 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -53,6 +53,7 @@ enum cpuhp_state {
 	CPUHP_AP_ARM_TWD_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
 	CPUHP_AP_QCOM_TIMER_STARTING,
+	CPUHP_AP_ARMADA_TIMER_STARTING,
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
 	CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,

[toc] | [prev] | [next] | [standalone]


#1442686 — [patch V2 47/67] arm/l2c: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 47/67] arm/l2c: Convert to hotplug state machine
Message-ID<rUw8Y-67L-85@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Brad Mouring <brad.mouring@ni.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 arch/arm/mm/cache-l2x0.c   | 27 +++++++++++++--------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index c61996c..cc12905 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -597,17 +597,16 @@ static void l2c310_configure(void __iomem *base)
 			      L310_POWER_CTRL);
 }
 
-static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, void *data)
+static int l2c310_starting_cpu(unsigned int cpu)
 {
-	switch (act & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
-		break;
-	case CPU_DYING:
-		set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1)));
-		break;
-	}
-	return NOTIFY_OK;
+	set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
+	return 0;
+}
+
+static int l2c310_dying_cpu(unsigned int cpu)
+{
+	set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1)));
+	return 0;
 }
 
 static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
@@ -678,10 +677,10 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 			power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis");
 	}
 
-	if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) {
-		set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
-		cpu_notifier(l2c310_cpu_enable_flz, 0);
-	}
+	if (aux & L310_AUX_CTRL_FULL_LINE_ZERO)
+		cpuhp_setup_state(CPUHP_AP_ARM_L2X0_STARTING,
+				  "AP_ARM_L2X0_STARTING", l2c310_starting_cpu,
+				  l2c310_dying_cpu);
 }
 
 static void __init l2c310_fixup(void __iomem *base, u32 cache_id,
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 5c66102..1876377 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -38,6 +38,7 @@ enum cpuhp_state {
 	CPUHP_AP_PERF_METAG_STARTING,
 	CPUHP_AP_ARM_VFP_STARTING,
 	CPUHP_AP_PERF_ARM_STARTING,
+	CPUHP_AP_ARM_L2X0_STARTING,
 	CPUHP_AP_ARM_ARCH_TIMER_STARTING,
 	CPUHP_AP_DUMMY_TIMER_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1446166 — [tip:smp/hotplug] arm/l2c: Convert to hotplug state machine

Fromtip-bot for Richard Cochran <tipbot@zytor.com>
Date2016-07-19 09:30 +0200
Subject[tip:smp/hotplug] arm/l2c: Convert to hotplug state machine
Message-ID<rWxDA-15B-35@gated-at.bofh.it>
In reply to#1442686
Commit-ID:  9eeb2264775f0b60fcff3d186bf54c90b0191650
Gitweb:     http://git.kernel.org/tip/9eeb2264775f0b60fcff3d186bf54c90b0191650
Author:     Richard Cochran <rcochran@linutronix.de>
AuthorDate: Wed, 13 Jul 2016 17:16:50 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 15 Jul 2016 10:40:28 +0200

arm/l2c: Convert to hotplug state machine

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Brad Mouring <brad.mouring@ni.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153336.801270887@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/arm/mm/cache-l2x0.c   | 27 +++++++++++++--------------
 include/linux/cpuhotplug.h |  1 +
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index c61996c..cc12905 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -597,17 +597,16 @@ static void l2c310_configure(void __iomem *base)
 			      L310_POWER_CTRL);
 }
 
-static int l2c310_cpu_enable_flz(struct notifier_block *nb, unsigned long act, void *data)
+static int l2c310_starting_cpu(unsigned int cpu)
 {
-	switch (act & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
-		break;
-	case CPU_DYING:
-		set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1)));
-		break;
-	}
-	return NOTIFY_OK;
+	set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
+	return 0;
+}
+
+static int l2c310_dying_cpu(unsigned int cpu)
+{
+	set_auxcr(get_auxcr() & ~(BIT(3) | BIT(2) | BIT(1)));
+	return 0;
 }
 
 static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
@@ -678,10 +677,10 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 			power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis");
 	}
 
-	if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) {
-		set_auxcr(get_auxcr() | BIT(3) | BIT(2) | BIT(1));
-		cpu_notifier(l2c310_cpu_enable_flz, 0);
-	}
+	if (aux & L310_AUX_CTRL_FULL_LINE_ZERO)
+		cpuhp_setup_state(CPUHP_AP_ARM_L2X0_STARTING,
+				  "AP_ARM_L2X0_STARTING", l2c310_starting_cpu,
+				  l2c310_dying_cpu);
 }
 
 static void __init l2c310_fixup(void __iomem *base, u32 cache_id,
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index 990052c..2057e64 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -37,6 +37,7 @@ enum cpuhp_state {
 	CPUHP_AP_PERF_METAG_STARTING,
 	CPUHP_AP_ARM_VFP_STARTING,
 	CPUHP_AP_PERF_ARM_STARTING,
+	CPUHP_AP_ARM_L2X0_STARTING,
 	CPUHP_AP_ARM_ARCH_TIMER_STARTING,
 	CPUHP_AP_DUMMY_TIMER_STARTING,
 	CPUHP_AP_METAG_TIMER_STARTING,

[toc] | [prev] | [next] | [standalone]


#1442687 — [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine

FromAnna-Maria Gleixner <anna-maria@linutronix.de>
Date2016-07-13 19:30 +0200
Subject[patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine
Message-ID<rUw8Y-67L-89@gated-at.bofh.it>
In reply to#1442667
From: Richard Cochran <rcochran@linutronix.de>

This is a straightforward conversion. We place this callback last
in the list so that the LED illuminates only after a successful
bring up sequence.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 drivers/leds/trigger/ledtrig-cpu.c | 32 +++++++++++++++-----------------
 include/linux/cpuhotplug.h         |  1 +
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/leds/trigger/ledtrig-cpu.c b/drivers/leds/trigger/ledtrig-cpu.c
index 938467f..4a6a182 100644
--- a/drivers/leds/trigger/ledtrig-cpu.c
+++ b/drivers/leds/trigger/ledtrig-cpu.c
@@ -92,25 +92,17 @@ static struct syscore_ops ledtrig_cpu_syscore_ops = {
 	.resume		= ledtrig_cpu_syscore_resume,
 };
 
-static int ledtrig_cpu_notify(struct notifier_block *self,
-					   unsigned long action, void *hcpu)
+static int ledtrig_starting_cpu(unsigned int cpu)
 {
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_STARTING:
-		ledtrig_cpu(CPU_LED_START);
-		break;
-	case CPU_DYING:
-		ledtrig_cpu(CPU_LED_STOP);
-		break;
-	}
-
-	return NOTIFY_OK;
+	ledtrig_cpu(CPU_LED_START);
+	return 0;
 }
 
-
-static struct notifier_block ledtrig_cpu_nb = {
-	.notifier_call = ledtrig_cpu_notify,
-};
+static int ledtrig_dying_cpu(unsigned int cpu)
+{
+	ledtrig_cpu(CPU_LED_STOP);
+	return 0;
+}
 
 static int __init ledtrig_cpu_init(void)
 {
@@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void)
 	}
 
 	register_syscore_ops(&ledtrig_cpu_syscore_ops);
-	register_cpu_notifier(&ledtrig_cpu_nb);
+
+	/*
+	 * FIXME: Why needs this to happen in the interrupt disabled
+	 * low level bringup phase of a cpu?
+	 */
+	cpuhp_setup_state(CPUHP_AP_LEDTRIG_STARTING, "AP_LEDTRIG_STARTING",
+			  ledtrig_starting_cpu, ledtrig_dying_cpu);
 
 	pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n");
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index c052b04..ef7bfa6 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -43,6 +43,7 @@ enum cpuhp_state {
 	CPUHP_AP_QCOM_TIMER_STARTING,
 	CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 	CPUHP_AP_KVM_STARTING,
+	CPUHP_AP_LEDTRIG_STARTING,
 	CPUHP_AP_NOTIFY_STARTING,
 	CPUHP_AP_ONLINE,
 	CPUHP_TEARDOWN_CPU,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1443137 — Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-07-14 09:20 +0200
SubjectRe: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine
Message-ID<rUJ69-6rX-13@gated-at.bofh.it>
In reply to#1442687
Hi Anna,

On 07/13/2016 07:16 PM, Anna-Maria Gleixner wrote:

 > -------- Original Message --------
 > Subject: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state 
machine
 > Date: Wed, 13 Jul 2016 17:16:45 +0000
 > From: Anna-Maria Gleixner <anna-maria@linutronix.de>
 > To: LKML <linux-kernel@vger.kernel.org>
 > CC: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar 
<mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, 
rt@linutronix.de, Richard Cochran <rcochran@linutronix.de>, Sebastian 
Andrzej Siewior <bigeasy@linutronix.de>, Jacek Anaszewski 
<j.anaszewski@samsung.com>, Linus Torvalds 
<torvalds@linux-foundation.org>, Linus Walleij 
<linus.walleij@linaro.org>, Paul Gortmaker 
<paul.gortmaker@windriver.com>, Richard Purdie <rpurdie@rpsys.net>, 
linux-leds@vger.kernel.org, Anna-Maria Gleixner <anna-maria@linutronix.de>
 >
 > From: Richard Cochran <rcochran@linutronix.de>
 >
 > This is a straightforward conversion. We place this callback last
 > in the list so that the LED illuminates only after a successful
 > bring up sequence.
 >
 > Signed-off-by: Richard Cochran <rcochran@linutronix.de>
 > Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
 > Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
 > Cc: Linus Torvalds <torvalds@linux-foundation.org>
 > Cc: Linus Walleij <linus.walleij@linaro.org>
 > Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
 > Cc: Peter Zijlstra <peterz@infradead.org>
 > Cc: Richard Purdie <rpurdie@rpsys.net>
 > Cc: Thomas Gleixner <tglx@linutronix.de>
 > Cc: linux-leds@vger.kernel.org
 > Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
 > ---
 >  drivers/leds/trigger/ledtrig-cpu.c | 32 +++++++++++++++-----------------
 >  include/linux/cpuhotplug.h         |  1 +
 >  2 files changed, 16 insertions(+), 17 deletions(-)
 >
 > diff --git a/drivers/leds/trigger/ledtrig-cpu.c 
b/drivers/leds/trigger/ledtrig-cpu.c
 > index 938467f..4a6a182 100644
 > --- a/drivers/leds/trigger/ledtrig-cpu.c
 > +++ b/drivers/leds/trigger/ledtrig-cpu.c
 > @@ -92,25 +92,17 @@ static struct syscore_ops ledtrig_cpu_syscore_ops = {
 >       .resume         = ledtrig_cpu_syscore_resume,
 >  };
 >
 > -static int ledtrig_cpu_notify(struct notifier_block *self,
 > -                                        unsigned long action, void 
*hcpu)
 > +static int ledtrig_starting_cpu(unsigned int cpu)
 >  {
 > -     switch (action & ~CPU_TASKS_FROZEN) {
 > -     case CPU_STARTING:
 > -             ledtrig_cpu(CPU_LED_START);
 > -             break;
 > -             break;
 > -     }
 > -
 > -     return NOTIFY_OK;
 > +     ledtrig_cpu(CPU_LED_START);
 > +     return 0;
 >  }
 >
 > -
 > -static struct notifier_block ledtrig_cpu_nb = {
 > -     .notifier_call = ledtrig_cpu_notify,
 > -};
 > +static int ledtrig_dying_cpu(unsigned int cpu)
 > +{
 > +     ledtrig_cpu(CPU_LED_STOP);
 > +     return 0;
 > +}
 >
 >  static int __init ledtrig_cpu_init(void)
 >  {
 > @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void)
 >       }
 >
 >       register_syscore_ops(&ledtrig_cpu_syscore_ops);
 > -     register_cpu_notifier(&ledtrig_cpu_nb);
 > +
 > +     /*
 > +      * FIXME: Why needs this to happen in the interrupt disabled
 > +      * low level bringup phase of a cpu?
 > +      */

Why wasn't it possible to clarify the issue before the
submission?

 > +     cpuhp_setup_state(CPUHP_AP_LEDTRIG_STARTING, "AP_LEDTRIG_STARTING",
 > +                       ledtrig_starting_cpu, ledtrig_dying_cpu);
 >
 >       pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n");
 >
 > diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
 > index c052b04..ef7bfa6 100644
 > --- a/include/linux/cpuhotplug.h
 > +++ b/include/linux/cpuhotplug.h
 > @@ -43,6 +43,7 @@ enum cpuhp_state {
 >       CPUHP_AP_QCOM_TIMER_STARTING,
 >       CPUHP_AP_MIPS_GIC_TIMER_STARTING,
 >       CPUHP_AP_KVM_STARTING,
 > +     CPUHP_AP_LEDTRIG_STARTING,
 >       CPUHP_AP_NOTIFY_STARTING,
 >       CPUHP_AP_ONLINE,
 >       CPUHP_TEARDOWN_CPU,
 > --


-- 
Best regards,
Jacek Anaszewski

[toc] | [prev] | [next] | [standalone]


#1443141 — Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine

FromIngo Molnar <mingo@kernel.org>
Date2016-07-14 09:50 +0200
SubjectRe: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine
Message-ID<rUJzb-6C2-5@gated-at.bofh.it>
In reply to#1443137
* Jacek Anaszewski <j.anaszewski@samsung.com> wrote:

> > @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void)
> >       }
> >
> >       register_syscore_ops(&ledtrig_cpu_syscore_ops);
> > -     register_cpu_notifier(&ledtrig_cpu_nb);
> > +
> > +     /*
> > +      * FIXME: Why needs this to happen in the interrupt disabled
> > +      * low level bringup phase of a cpu?
> > +      */
> 
> Why wasn't it possible to clarify the issue before the
> submission?

Nothing has been applied yet (this submission is part of the clarification 
process), are you fine with this conversion as-is, with a separate patch doing any 
followup fixes - or would you prefer another approach?

This CPU hotplug series tries to do straightforward conversions to the CPU hotplug 
state machine without changing behavior - while pointing out any problems that 
were found along the way.

I agree that the addition of this FIXME should probably have been pointed out in 
the changelog as well, but this patch was submitted once already with no feedback 
received - and that's the historic pattern with such types of series: only a low 
percentage of all driver maintainers replies so we have to be proactive to a 
certain degree to have a chance of improving core kernel infrastructure. It's 
better to add FIXMEs with open questions that to introduce subtle problems.

Thanks,

	Ingo

[toc] | [prev] | [next] | [standalone]


#1443161 — Re: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-07-14 10:20 +0200
SubjectRe: [patch V2 43/67] leds/trigger/cpu: Convert to hotplug state machine
Message-ID<rUK2i-75j-155@gated-at.bofh.it>
In reply to#1443141
On 07/14/2016 09:47 AM, Ingo Molnar wrote:
>
> * Jacek Anaszewski <j.anaszewski@samsung.com> wrote:
>
>>> @@ -133,7 +125,13 @@ static int __init ledtrig_cpu_init(void)
>>>        }
>>>
>>>        register_syscore_ops(&ledtrig_cpu_syscore_ops);
>>> -     register_cpu_notifier(&ledtrig_cpu_nb);
>>> +
>>> +     /*
>>> +      * FIXME: Why needs this to happen in the interrupt disabled
>>> +      * low level bringup phase of a cpu?
>>> +      */
>>
>> Why wasn't it possible to clarify the issue before the
>> submission?
>
> Nothing has been applied yet (this submission is part of the clarification
> process), are you fine with this conversion as-is, with a separate patch doing any
> followup fixes - or would you prefer another approach?
>
> This CPU hotplug series tries to do straightforward conversions to the CPU hotplug
> state machine without changing behavior - while pointing out any problems that
> were found along the way.
>
> I agree that the addition of this FIXME should probably have been pointed out in
> the changelog as well, but this patch was submitted once already with no feedback
> received - and that's the historic pattern with such types of series: only a low
> percentage of all driver maintainers replies so we have to be proactive to a
> certain degree to have a chance of improving core kernel infrastructure. It's
> better to add FIXMEs with open questions that to introduce subtle problems.

Thanks for the explanation. I'm OK with that approach.

Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>

-- 
Best regards,
Jacek Anaszewski

[toc] | [prev] | [next] | [standalone]


Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →

Back to top | Article view | linux.kernel


csiph-web