Commit 087d8c7d authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Benjamin Herrenschmidt

powerpc: Convert feature_lock to raw_spinlock

feature_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 47e3c904
...@@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(struct device_node* child, int type); ...@@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(struct device_node* child, int type);
* Those are exported by pmac feature for internal use by arch code * Those are exported by pmac feature for internal use by arch code
* only like the platform function callbacks, do not use directly in drivers * only like the platform function callbacks, do not use directly in drivers
*/ */
extern spinlock_t feature_lock; extern raw_spinlock_t feature_lock;
extern struct device_node *uninorth_node; extern struct device_node *uninorth_node;
extern u32 __iomem *uninorth_base; extern u32 __iomem *uninorth_base;
......
...@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2]; ...@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2];
* We use a single global lock to protect accesses. Each driver has * We use a single global lock to protect accesses. Each driver has
* to take care of its own locking * to take care of its own locking
*/ */
DEFINE_SPINLOCK(feature_lock); DEFINE_RAW_SPINLOCK(feature_lock);
#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define LOCK(flags) raw_spin_lock_irqsave(&feature_lock, flags);
#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); #define UNLOCK(flags) raw_spin_unlock_irqrestore(&feature_lock, flags);
/* /*
......
...@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask) ...@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask)
value = ~value; value = ~value;
/* Toggle the GPIO */ /* Toggle the GPIO */
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
tmp = readb(addr); tmp = readb(addr);
tmp = (tmp & ~mask) | (value & mask); tmp = (tmp & ~mask) | (value & mask);
DBG("Do write 0x%02x to GPIO %s (%p)\n", DBG("Do write 0x%02x to GPIO %s (%p)\n",
tmp, func->node->full_name, addr); tmp, func->node->full_name, addr);
writeb(tmp, addr); writeb(tmp, addr);
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
...@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) ...@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
struct macio_chip *macio = func->driver_data; struct macio_chip *macio = func->driver_data;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask));
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
...@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask) ...@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask)
struct macio_chip *macio = func->driver_data; struct macio_chip *macio = func->driver_data;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask));
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
...@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift, ...@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift,
if (args == NULL || args->count == 0) if (args == NULL || args->count == 0)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
tmp = MACIO_IN32(offset); tmp = MACIO_IN32(offset);
val = args->u[0].v << shift; val = args->u[0].v << shift;
tmp = (tmp & ~mask) | (val & mask); tmp = (tmp & ~mask) | (val & mask);
MACIO_OUT32(offset, tmp); MACIO_OUT32(offset, tmp);
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
...@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift, ...@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift,
if (args == NULL || args->count == 0) if (args == NULL || args->count == 0)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
tmp = MACIO_IN8(offset); tmp = MACIO_IN8(offset);
val = args->u[0].v << shift; val = args->u[0].v << shift;
tmp = (tmp & ~mask) | (val & mask); tmp = (tmp & ~mask) | (val & mask);
MACIO_OUT8(offset, tmp); MACIO_OUT8(offset, tmp);
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
...@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) ...@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&feature_lock, flags); raw_spin_lock_irqsave(&feature_lock, flags);
/* This is fairly bogus in darwin, but it should work for our needs /* This is fairly bogus in darwin, but it should work for our needs
* implemeted that way: * implemeted that way:
*/ */
UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask));
spin_unlock_irqrestore(&feature_lock, flags); raw_spin_unlock_irqrestore(&feature_lock, flags);
return 0; return 0;
} }
......
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