Commit 7d725bdc authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Benjamin Herrenschmidt

powerpc: Convert nv_lock to raw_spinlock

nv_lock needs to be a real spinlock in RT. Convert it to raw_spinlock.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent be833f33
...@@ -80,7 +80,7 @@ static int is_core_99; ...@@ -80,7 +80,7 @@ static int is_core_99;
static int core99_bank = 0; static int core99_bank = 0;
static int nvram_partitions[3]; static int nvram_partitions[3];
// XXX Turn that into a sem // XXX Turn that into a sem
static DEFINE_SPINLOCK(nv_lock); static DEFINE_RAW_SPINLOCK(nv_lock);
static int (*core99_write_bank)(int bank, u8* datas); static int (*core99_write_bank)(int bank, u8* datas);
static int (*core99_erase_bank)(int bank); static int (*core99_erase_bank)(int bank);
...@@ -165,10 +165,10 @@ static unsigned char indirect_nvram_read_byte(int addr) ...@@ -165,10 +165,10 @@ static unsigned char indirect_nvram_read_byte(int addr)
unsigned char val; unsigned char val;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&nv_lock, flags); raw_spin_lock_irqsave(&nv_lock, flags);
out_8(nvram_addr, addr >> 5); out_8(nvram_addr, addr >> 5);
val = in_8(&nvram_data[(addr & 0x1f) << 4]); val = in_8(&nvram_data[(addr & 0x1f) << 4]);
spin_unlock_irqrestore(&nv_lock, flags); raw_spin_unlock_irqrestore(&nv_lock, flags);
return val; return val;
} }
...@@ -177,10 +177,10 @@ static void indirect_nvram_write_byte(int addr, unsigned char val) ...@@ -177,10 +177,10 @@ static void indirect_nvram_write_byte(int addr, unsigned char val)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&nv_lock, flags); raw_spin_lock_irqsave(&nv_lock, flags);
out_8(nvram_addr, addr >> 5); out_8(nvram_addr, addr >> 5);
out_8(&nvram_data[(addr & 0x1f) << 4], val); out_8(&nvram_data[(addr & 0x1f) << 4], val);
spin_unlock_irqrestore(&nv_lock, flags); raw_spin_unlock_irqrestore(&nv_lock, flags);
} }
...@@ -481,7 +481,7 @@ static void core99_nvram_sync(void) ...@@ -481,7 +481,7 @@ static void core99_nvram_sync(void)
if (!is_core_99 || !nvram_data || !nvram_image) if (!is_core_99 || !nvram_data || !nvram_image)
return; return;
spin_lock_irqsave(&nv_lock, flags); raw_spin_lock_irqsave(&nv_lock, flags);
if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE, if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
NVRAM_SIZE)) NVRAM_SIZE))
goto bail; goto bail;
...@@ -503,7 +503,7 @@ static void core99_nvram_sync(void) ...@@ -503,7 +503,7 @@ static void core99_nvram_sync(void)
if (core99_write_bank(core99_bank, nvram_image)) if (core99_write_bank(core99_bank, nvram_image))
printk("nvram: Error writing bank %d\n", core99_bank); printk("nvram: Error writing bank %d\n", core99_bank);
bail: bail:
spin_unlock_irqrestore(&nv_lock, flags); raw_spin_unlock_irqrestore(&nv_lock, flags);
#ifdef DEBUG #ifdef DEBUG
mdelay(2000); mdelay(2000);
......
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