aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-02-17 21:22:55 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-02-18 22:52:32 -0500
commit087d8c7d0cc8a79e6bd6223f9b0018483124e769 (patch)
tree7b0719010305512fcf811c9e11d28f314d907d79 /arch/powerpc
parent47e3c9046bc884d4f727df00f0b6ec73fa387e50 (diff)
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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/pmac_feature.h2
-rw-r--r--arch/powerpc/platforms/powermac/feature.c6
-rw-r--r--arch/powerpc/platforms/powermac/pfunc_base.c24
3 files changed, 16 insertions, 16 deletions
diff --git a/arch/powerpc/include/asm/pmac_feature.h b/arch/powerpc/include/asm/pmac_feature.h
index 877c35a4356e..00eedc5a4e61 100644
--- a/arch/powerpc/include/asm/pmac_feature.h
+++ b/arch/powerpc/include/asm/pmac_feature.h
@@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(struct device_node* child, int type);
378 * Those are exported by pmac feature for internal use by arch code 378 * Those are exported by pmac feature for internal use by arch code
379 * only like the platform function callbacks, do not use directly in drivers 379 * only like the platform function callbacks, do not use directly in drivers
380 */ 380 */
381extern spinlock_t feature_lock; 381extern raw_spinlock_t feature_lock;
382extern struct device_node *uninorth_node; 382extern struct device_node *uninorth_node;
383extern u32 __iomem *uninorth_base; 383extern u32 __iomem *uninorth_base;
384 384
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index fbc9bbd74dbd..424b633fbe0d 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2];
59 * We use a single global lock to protect accesses. Each driver has 59 * We use a single global lock to protect accesses. Each driver has
60 * to take care of its own locking 60 * to take care of its own locking
61 */ 61 */
62DEFINE_SPINLOCK(feature_lock); 62DEFINE_RAW_SPINLOCK(feature_lock);
63 63
64#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); 64#define LOCK(flags) raw_spin_lock_irqsave(&feature_lock, flags);
65#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); 65#define UNLOCK(flags) raw_spin_unlock_irqrestore(&feature_lock, flags);
66 66
67 67
68/* 68/*
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index db20de512f3e..f5e3cda6660e 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask)
50 value = ~value; 50 value = ~value;
51 51
52 /* Toggle the GPIO */ 52 /* Toggle the GPIO */
53 spin_lock_irqsave(&feature_lock, flags); 53 raw_spin_lock_irqsave(&feature_lock, flags);
54 tmp = readb(addr); 54 tmp = readb(addr);
55 tmp = (tmp & ~mask) | (value & mask); 55 tmp = (tmp & ~mask) | (value & mask);
56 DBG("Do write 0x%02x to GPIO %s (%p)\n", 56 DBG("Do write 0x%02x to GPIO %s (%p)\n",
57 tmp, func->node->full_name, addr); 57 tmp, func->node->full_name, addr);
58 writeb(tmp, addr); 58 writeb(tmp, addr);
59 spin_unlock_irqrestore(&feature_lock, flags); 59 raw_spin_unlock_irqrestore(&feature_lock, flags);
60 60
61 return 0; 61 return 0;
62} 62}
@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
145 struct macio_chip *macio = func->driver_data; 145 struct macio_chip *macio = func->driver_data;
146 unsigned long flags; 146 unsigned long flags;
147 147
148 spin_lock_irqsave(&feature_lock, flags); 148 raw_spin_lock_irqsave(&feature_lock, flags);
149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); 149 MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask));
150 spin_unlock_irqrestore(&feature_lock, flags); 150 raw_spin_unlock_irqrestore(&feature_lock, flags);
151 return 0; 151 return 0;
152} 152}
153 153
@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask)
168 struct macio_chip *macio = func->driver_data; 168 struct macio_chip *macio = func->driver_data;
169 unsigned long flags; 169 unsigned long flags;
170 170
171 spin_lock_irqsave(&feature_lock, flags); 171 raw_spin_lock_irqsave(&feature_lock, flags);
172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); 172 MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask));
173 spin_unlock_irqrestore(&feature_lock, flags); 173 raw_spin_unlock_irqrestore(&feature_lock, flags);
174 return 0; 174 return 0;
175} 175}
176 176
@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift,
223 if (args == NULL || args->count == 0) 223 if (args == NULL || args->count == 0)
224 return -EINVAL; 224 return -EINVAL;
225 225
226 spin_lock_irqsave(&feature_lock, flags); 226 raw_spin_lock_irqsave(&feature_lock, flags);
227 tmp = MACIO_IN32(offset); 227 tmp = MACIO_IN32(offset);
228 val = args->u[0].v << shift; 228 val = args->u[0].v << shift;
229 tmp = (tmp & ~mask) | (val & mask); 229 tmp = (tmp & ~mask) | (val & mask);
230 MACIO_OUT32(offset, tmp); 230 MACIO_OUT32(offset, tmp);
231 spin_unlock_irqrestore(&feature_lock, flags); 231 raw_spin_unlock_irqrestore(&feature_lock, flags);
232 return 0; 232 return 0;
233} 233}
234 234
@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift,
243 if (args == NULL || args->count == 0) 243 if (args == NULL || args->count == 0)
244 return -EINVAL; 244 return -EINVAL;
245 245
246 spin_lock_irqsave(&feature_lock, flags); 246 raw_spin_lock_irqsave(&feature_lock, flags);
247 tmp = MACIO_IN8(offset); 247 tmp = MACIO_IN8(offset);
248 val = args->u[0].v << shift; 248 val = args->u[0].v << shift;
249 tmp = (tmp & ~mask) | (val & mask); 249 tmp = (tmp & ~mask) | (val & mask);
250 MACIO_OUT8(offset, tmp); 250 MACIO_OUT8(offset, tmp);
251 spin_unlock_irqrestore(&feature_lock, flags); 251 raw_spin_unlock_irqrestore(&feature_lock, flags);
252 return 0; 252 return 0;
253} 253}
254 254
@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask)
278{ 278{
279 unsigned long flags; 279 unsigned long flags;
280 280
281 spin_lock_irqsave(&feature_lock, flags); 281 raw_spin_lock_irqsave(&feature_lock, flags);
282 /* This is fairly bogus in darwin, but it should work for our needs 282 /* This is fairly bogus in darwin, but it should work for our needs
283 * implemeted that way: 283 * implemeted that way:
284 */ 284 */
285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); 285 UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask));
286 spin_unlock_irqrestore(&feature_lock, flags); 286 raw_spin_unlock_irqrestore(&feature_lock, flags);
287 return 0; 287 return 0;
288} 288}
289 289