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


Groups > linux.kernel > #1486819

[tip:smp/hotplug] mips/octeon/smp: Convert to hotplug state machine

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:smp/hotplug] mips/octeon/smp: Convert to hotplug state machine
Date Mon, 19 Sep 2016 22:00:02 +0200
Message-ID <sjcTo-1ej-41@gated-at.bofh.it> (permalink)
References <ses2K-4Ps-25@gated-at.bofh.it>
X-Original-To linux-tip-commits@vger.kernel.org
Reply-To tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, bigeasy@linutronix.de, ralf@linux-mips.org, peterz@infradead.org, linux-kernel@vger.kernel.org
Git-Commit-ID dd6d7c6f3dc136c1bec6def840f7fa53f84d1fe6
X-Mailer tip-git-log-daemon
Robot-ID <tip-bot.git.kernel.org>
Robot-Unsubscribe Contact <mailto:hpa@kernel.org> to get blacklisted from these emails
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Content-Type text/plain; charset=UTF-8
Content-Disposition inline
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 76
Organization linux.* mail to news gateway
X-Original-Cc tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, ralf@linux-mips.org, bigeasy@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 19 Sep 2016 12:58:14 -0700
X-Original-Message-ID <tip-dd6d7c6f3dc136c1bec6def840f7fa53f84d1fe6@git.kernel.org>
X-Original-References <20160906170457.32393-16-bigeasy@linutronix.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1486819

Show key headers only | View raw


Commit-ID:  dd6d7c6f3dc136c1bec6def840f7fa53f84d1fe6
Gitweb:     http://git.kernel.org/tip/dd6d7c6f3dc136c1bec6def840f7fa53f84d1fe6
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Tue, 6 Sep 2016 19:04:51 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 19 Sep 2016 21:44:32 +0200

mips/octeon/smp: Convert to hotplug state machine

Install the callbacks via the state machine.

[ tglx: Renamed the state to MIPS_SOC_PREPARE so it can be reused by other
  	SOCs ]

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160906170457.32393-16-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/mips/cavium-octeon/smp.c | 24 +++---------------------
 include/linux/cpuhotplug.h    |  1 +
 2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 4d457d60..256fe6f 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -380,29 +380,11 @@ static int octeon_update_boot_vector(unsigned int cpu)
 	return 0;
 }
 
-static int octeon_cpu_callback(struct notifier_block *nfb,
-	unsigned long action, void *hcpu)
-{
-	unsigned int cpu = (unsigned long)hcpu;
-
-	switch (action & ~CPU_TASKS_FROZEN) {
-	case CPU_UP_PREPARE:
-		octeon_update_boot_vector(cpu);
-		break;
-	case CPU_ONLINE:
-		pr_info("Cpu %d online\n", cpu);
-		break;
-	case CPU_DEAD:
-		break;
-	}
-
-	return NOTIFY_OK;
-}
-
 static int register_cavium_notifier(void)
 {
-	hotcpu_notifier(octeon_cpu_callback, 0);
-	return 0;
+	return cpuhp_setup_state_nocalls(CPUHP_MIPS_SOC_PREPARE,
+					 "mips/cavium:prepare",
+					 octeon_update_boot_vector, NULL);
 }
 late_initcall(register_cavium_notifier);
 
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index bb6231d..8f8a48b 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -44,6 +44,7 @@ enum cpuhp_state {
 	CPUHP_SH_SH3X_PREPARE,
 	CPUHP_TIMERS_DEAD,
 	CPUHP_NOTF_ERR_INJ_PREPARE,
+	CPUHP_MIPS_SOC_PREPARE,
 	CPUHP_BRINGUP_CPU,
 	CPUHP_AP_IDLE_DEAD,
 	CPUHP_AP_OFFLINE,

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[tip:smp/hotplug] mips/octeon/smp: Convert to hotplug state machine tip-bot for Sebastian Andrzej Siewior <tipbot@zytor.com> - 2016-09-19 22:00 +0200

csiph-web