Commit 59d958d2 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

locking, x86: mce: Annotate cmci_discover_lock as raw

The cmci_discover_lock can be taken in atomic context (cpu bring
up sequence) and therefore cannot be preempted on -rt.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e12f65f7
...@@ -28,7 +28,7 @@ static DEFINE_PER_CPU(mce_banks_t, mce_banks_owned); ...@@ -28,7 +28,7 @@ static DEFINE_PER_CPU(mce_banks_t, mce_banks_owned);
* cmci_discover_lock protects against parallel discovery attempts * cmci_discover_lock protects against parallel discovery attempts
* which could race against each other. * which could race against each other.
*/ */
static DEFINE_SPINLOCK(cmci_discover_lock); static DEFINE_RAW_SPINLOCK(cmci_discover_lock);
#define CMCI_THRESHOLD 1 #define CMCI_THRESHOLD 1
...@@ -85,7 +85,7 @@ static void cmci_discover(int banks, int boot) ...@@ -85,7 +85,7 @@ static void cmci_discover(int banks, int boot)
int hdr = 0; int hdr = 0;
int i; int i;
spin_lock_irqsave(&cmci_discover_lock, flags); raw_spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) { for (i = 0; i < banks; i++) {
u64 val; u64 val;
...@@ -116,7 +116,7 @@ static void cmci_discover(int banks, int boot) ...@@ -116,7 +116,7 @@ static void cmci_discover(int banks, int boot)
WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks)));
} }
} }
spin_unlock_irqrestore(&cmci_discover_lock, flags); raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
if (hdr) if (hdr)
printk(KERN_CONT "\n"); printk(KERN_CONT "\n");
} }
...@@ -150,7 +150,7 @@ void cmci_clear(void) ...@@ -150,7 +150,7 @@ void cmci_clear(void)
if (!cmci_supported(&banks)) if (!cmci_supported(&banks))
return; return;
spin_lock_irqsave(&cmci_discover_lock, flags); raw_spin_lock_irqsave(&cmci_discover_lock, flags);
for (i = 0; i < banks; i++) { for (i = 0; i < banks; i++) {
if (!test_bit(i, __get_cpu_var(mce_banks_owned))) if (!test_bit(i, __get_cpu_var(mce_banks_owned)))
continue; continue;
...@@ -160,7 +160,7 @@ void cmci_clear(void) ...@@ -160,7 +160,7 @@ void cmci_clear(void)
wrmsrl(MSR_IA32_MCx_CTL2(i), val); wrmsrl(MSR_IA32_MCx_CTL2(i), val);
__clear_bit(i, __get_cpu_var(mce_banks_owned)); __clear_bit(i, __get_cpu_var(mce_banks_owned));
} }
spin_unlock_irqrestore(&cmci_discover_lock, flags); raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment