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


Groups > linux.kernel > #1700723

[PATCH v2 4/4] clocksource/arm_arch_timer: Use static_branch_enable_cpuslocked()

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject [PATCH v2 4/4] clocksource/arm_arch_timer: Use static_branch_enable_cpuslocked()
Date 2017-08-01 10:10 +0200
Message-ID <u9ApB-HZ-21@gated-at.bofh.it> (permalink)
References <u9ApA-HZ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use the new static_branch_enable_cpuslocked function to switch
the workaround static key on the CPU hotplug path.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/clocksource/arm_arch_timer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index aae87c4c546e..c62e71614c75 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -455,7 +455,11 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa
 			per_cpu(timer_unstable_counter_workaround, i) = wa;
 	}
 
-	static_branch_enable(&arch_timer_read_ool_enabled);
+	/*
+	 * Use the locked version, as we're called from the CPU
+	 * hotplug framework. Otherwise, we end-up in deadlock-land.
+	 */
+	static_branch_enable_cpuslocked(&arch_timer_read_ool_enabled);
 
 	/*
 	 * Don't use the vdso fastpath if errata require using the
-- 
2.11.0

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


Thread

[PATCH v2 0/4] Working around CPU hotplug and static keys locking Marc Zyngier <marc.zyngier@arm.com> - 2017-08-01 10:10 +0200
  [PATCH v2 2/4] jump_label: Split out code under the hotplug lock Marc Zyngier <marc.zyngier@arm.com> - 2017-08-01 10:10 +0200
    [tip:locking/core] jump_label: Split out code under the hotplug  lock tip-bot for Marc Zyngier <tipbot@zytor.com> - 2017-08-10 14:20 +0200
  [PATCH v2 3/4] jump_label: Provide hotplug context variants Marc Zyngier <marc.zyngier@arm.com> - 2017-08-01 10:10 +0200
    Re: [PATCH v2 3/4] jump_label: Provide hotplug context variants Peter Zijlstra <peterz@infradead.org> - 2017-08-02 16:40 +0200
      Re: [PATCH v2 3/4] jump_label: Provide hotplug context variants Marc Zyngier <marc.zyngier@arm.com> - 2017-08-02 17:10 +0200
    [tip:locking/core] jump_label: Provide hotplug context variants tip-bot for Marc Zyngier <tipbot@zytor.com> - 2017-08-10 14:20 +0200
  [PATCH v2 4/4] clocksource/arm_arch_timer: Use static_branch_enable_cpuslocked() Marc Zyngier <marc.zyngier@arm.com> - 2017-08-01 10:10 +0200
    [tip:locking/core] clocksource/arm_arch_timer: Use  static_branch_enable_cpuslocked() tip-bot for Marc Zyngier <tipbot@zytor.com> - 2017-08-10 14:20 +0200

csiph-web