Skip to content

Commit bccc2f7

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
locking, powerpc: Annotate uic->lock as raw
uic->lock is protecting the interrupt controller hardware. This lock can not 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. Reported-by: Darcy L. Watkins <dwatkins@tranzeo.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 59d958d commit bccc2f7

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎arch/powerpc/sysdev/uic.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct uic {
4747
int index;
4848
int dcrbase;
4949

50-
spinlock_t lock;
50+
raw_spinlock_t lock;
5151

5252
/* The remapper for this UIC */
5353
struct irq_host *irqhost;
@@ -61,14 +61,14 @@ static void uic_unmask_irq(struct irq_data *d)
6161
u32 er, sr;
6262

6363
sr = 1 << (31-src);
64-
spin_lock_irqsave(&uic->lock, flags);
64+
raw_spin_lock_irqsave(&uic->lock, flags);
6565
/* ack level-triggered interrupts here */
6666
if (irqd_is_level_type(d))
6767
mtdcr(uic->dcrbase + UIC_SR, sr);
6868
er = mfdcr(uic->dcrbase + UIC_ER);
6969
er |= sr;
7070
mtdcr(uic->dcrbase + UIC_ER, er);
71-
spin_unlock_irqrestore(&uic->lock, flags);
71+
raw_spin_unlock_irqrestore(&uic->lock, flags);
7272
}
7373

7474
static void uic_mask_irq(struct irq_data *d)
@@ -78,11 +78,11 @@ static void uic_mask_irq(struct irq_data *d)
7878
unsigned long flags;
7979
u32 er;
8080

81-
spin_lock_irqsave(&uic->lock, flags);
81+
raw_spin_lock_irqsave(&uic->lock, flags);
8282
er = mfdcr(uic->dcrbase + UIC_ER);
8383
er &= ~(1 << (31 - src));
8484
mtdcr(uic->dcrbase + UIC_ER, er);
85-
spin_unlock_irqrestore(&uic->lock, flags);
85+
raw_spin_unlock_irqrestore(&uic->lock, flags);
8686
}
8787

8888
static void uic_ack_irq(struct irq_data *d)
@@ -91,9 +91,9 @@ static void uic_ack_irq(struct irq_data *d)
9191
unsigned int src = irqd_to_hwirq(d);
9292
unsigned long flags;
9393

94-
spin_lock_irqsave(&uic->lock, flags);
94+
raw_spin_lock_irqsave(&uic->lock, flags);
9595
mtdcr(uic->dcrbase + UIC_SR, 1 << (31-src));
96-
spin_unlock_irqrestore(&uic->lock, flags);
96+
raw_spin_unlock_irqrestore(&uic->lock, flags);
9797
}
9898

9999
static void uic_mask_ack_irq(struct irq_data *d)
@@ -104,7 +104,7 @@ static void uic_mask_ack_irq(struct irq_data *d)
104104
u32 er, sr;
105105

106106
sr = 1 << (31-src);
107-
spin_lock_irqsave(&uic->lock, flags);
107+
raw_spin_lock_irqsave(&uic->lock, flags);
108108
er = mfdcr(uic->dcrbase + UIC_ER);
109109
er &= ~sr;
110110
mtdcr(uic->dcrbase + UIC_ER, er);
@@ -118,7 +118,7 @@ static void uic_mask_ack_irq(struct irq_data *d)
118118
*/
119119
if (!irqd_is_level_type(d))
120120
mtdcr(uic->dcrbase + UIC_SR, sr);
121-
spin_unlock_irqrestore(&uic->lock, flags);
121+
raw_spin_unlock_irqrestore(&uic->lock, flags);
122122
}
123123

124124
static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
@@ -152,7 +152,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
152152

153153
mask = ~(1 << (31 - src));
154154

155-
spin_lock_irqsave(&uic->lock, flags);
155+
raw_spin_lock_irqsave(&uic->lock, flags);
156156
tr = mfdcr(uic->dcrbase + UIC_TR);
157157
pr = mfdcr(uic->dcrbase + UIC_PR);
158158
tr = (tr & mask) | (trigger << (31-src));
@@ -161,7 +161,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
161161
mtdcr(uic->dcrbase + UIC_PR, pr);
162162
mtdcr(uic->dcrbase + UIC_TR, tr);
163163

164-
spin_unlock_irqrestore(&uic->lock, flags);
164+
raw_spin_unlock_irqrestore(&uic->lock, flags);
165165

166166
return 0;
167167
}
@@ -254,7 +254,7 @@ static struct uic * __init uic_init_one(struct device_node *node)
254254
if (! uic)
255255
return NULL; /* FIXME: panic? */
256256

257-
spin_lock_init(&uic->lock);
257+
raw_spin_lock_init(&uic->lock);
258258
indexp = of_get_property(node, "cell-index", &len);
259259
if (!indexp || (len != sizeof(u32))) {
260260
printk(KERN_ERR "uic: Device node %s has missing or invalid "

0 commit comments

Comments
 (0)