diff options
author | Will Deacon <will.deacon@arm.com> | 2016-08-16 11:29:17 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-09-01 13:45:58 +0100 |
commit | e937dd5782688928d8c4050237b93b0a51faebee (patch) | |
tree | 51fcb617301f1d83808974c78df6cb6e6e1a5c67 /arch/arm64/kernel | |
parent | d7a83d127a64fd91ef1ad39b7e2d78db36cf388b (diff) | |
download | linux-e937dd5782688928d8c4050237b93b0a51faebee.tar.gz linux-e937dd5782688928d8c4050237b93b0a51faebee.tar.bz2 linux-e937dd5782688928d8c4050237b93b0a51faebee.zip |
arm64: debug: convert OS lock CPU hotplug notifier to new infrastructure
The arm64 debug monitor initialisation code uses a CPU hotplug notifier
to clear the OS lock when CPUs come online.
This patch converts the code to the new hotplug mechanism.
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r-- | arch/arm64/kernel/debug-monitors.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 2751ff9c0934..30821928106f 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -132,36 +132,18 @@ NOKPROBE_SYMBOL(disable_debug_monitors); /* * OS lock clearing. */ -static void clear_os_lock(void *unused) +static int clear_os_lock(unsigned int cpu) { asm volatile("msr oslar_el1, %0" : : "r" (0)); + isb(); + return 0; } -static int os_lock_notify(struct notifier_block *self, - unsigned long action, void *data) -{ - if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) - clear_os_lock(NULL); - return NOTIFY_OK; -} - -static struct notifier_block os_lock_nb = { - .notifier_call = os_lock_notify, -}; - static int debug_monitors_init(void) { - cpu_notifier_register_begin(); - - /* Clear the OS lock. */ - on_each_cpu(clear_os_lock, NULL, 1); - isb(); - - /* Register hotplug handler. */ - __register_cpu_notifier(&os_lock_nb); - - cpu_notifier_register_done(); - return 0; + return cpuhp_setup_state(CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING, + "CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING", + clear_os_lock, NULL); } postcore_initcall(debug_monitors_init); |