Commit 50fee3b3 authored by Thomas Gleixner's avatar Thomas Gleixner

ACPI: Convert c3_lock to atomic_spinlock

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent d227cf76
...@@ -919,7 +919,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, ...@@ -919,7 +919,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
} }
static int c3_cpu_count; static int c3_cpu_count;
static DEFINE_SPINLOCK(c3_lock); static DEFINE_ATOMIC_SPINLOCK(c3_lock);
/** /**
* acpi_idle_enter_bm - enters C3 with proper BM handling * acpi_idle_enter_bm - enters C3 with proper BM handling
...@@ -994,12 +994,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ...@@ -994,12 +994,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
* without doing anything. * without doing anything.
*/ */
if (pr->flags.bm_check && pr->flags.bm_control) { if (pr->flags.bm_check && pr->flags.bm_control) {
spin_lock(&c3_lock); atomic_spin_lock(&c3_lock);
c3_cpu_count++; c3_cpu_count++;
/* Disable bus master arbitration when all CPUs are in C3 */ /* Disable bus master arbitration when all CPUs are in C3 */
if (c3_cpu_count == num_online_cpus()) if (c3_cpu_count == num_online_cpus())
acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1); acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1);
spin_unlock(&c3_lock); atomic_spin_unlock(&c3_lock);
} else if (!pr->flags.bm_check) { } else if (!pr->flags.bm_check) {
ACPI_FLUSH_CPU_CACHE(); ACPI_FLUSH_CPU_CACHE();
} }
...@@ -1008,10 +1008,10 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ...@@ -1008,10 +1008,10 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
/* Re-enable bus master arbitration */ /* Re-enable bus master arbitration */
if (pr->flags.bm_check && pr->flags.bm_control) { if (pr->flags.bm_check && pr->flags.bm_control) {
spin_lock(&c3_lock); atomic_spin_lock(&c3_lock);
acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0); acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0);
c3_cpu_count--; c3_cpu_count--;
spin_unlock(&c3_lock); atomic_spin_unlock(&c3_lock);
} }
kt2 = ktime_get_real(); kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1)); idle_time = ktime_to_us(ktime_sub(kt2, kt1));
......
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