aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/i8259.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-02-17 21:23:11 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-02-18 22:52:31 -0500
commit47e3c9046bc884d4f727df00f0b6ec73fa387e50 (patch)
treeb1e780abf188066eccac34db8c81607794eee4a4 /arch/powerpc/sysdev/i8259.c
parent7cc8a5e3f52c146d46d286f3778b09181639dc61 (diff)
powerpc: Convert i8259_lock to raw_spinlock
i8259_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/sysdev/i8259.c')
-rw-r--r--arch/powerpc/sysdev/i8259.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index d32581764bde..6323e70e6bf4 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -23,7 +23,7 @@ static unsigned char cached_8259[2] = { 0xff, 0xff };
23#define cached_A1 (cached_8259[0]) 23#define cached_A1 (cached_8259[0])
24#define cached_21 (cached_8259[1]) 24#define cached_21 (cached_8259[1])
25 25
26static DEFINE_SPINLOCK(i8259_lock); 26static DEFINE_RAW_SPINLOCK(i8259_lock);
27 27
28static struct irq_host *i8259_host; 28static struct irq_host *i8259_host;
29 29
@@ -42,7 +42,7 @@ unsigned int i8259_irq(void)
42 if (pci_intack) 42 if (pci_intack)
43 irq = readb(pci_intack); 43 irq = readb(pci_intack);
44 else { 44 else {
45 spin_lock(&i8259_lock); 45 raw_spin_lock(&i8259_lock);
46 lock = 1; 46 lock = 1;
47 47
48 /* Perform an interrupt acknowledge cycle on controller 1. */ 48 /* Perform an interrupt acknowledge cycle on controller 1. */
@@ -74,7 +74,7 @@ unsigned int i8259_irq(void)
74 irq = NO_IRQ; 74 irq = NO_IRQ;
75 75
76 if (lock) 76 if (lock)
77 spin_unlock(&i8259_lock); 77 raw_spin_unlock(&i8259_lock);
78 return irq; 78 return irq;
79} 79}
80 80
@@ -82,7 +82,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
82{ 82{
83 unsigned long flags; 83 unsigned long flags;
84 84
85 spin_lock_irqsave(&i8259_lock, flags); 85 raw_spin_lock_irqsave(&i8259_lock, flags);
86 if (irq_nr > 7) { 86 if (irq_nr > 7) {
87 cached_A1 |= 1 << (irq_nr-8); 87 cached_A1 |= 1 << (irq_nr-8);
88 inb(0xA1); /* DUMMY */ 88 inb(0xA1); /* DUMMY */
@@ -95,7 +95,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
95 outb(cached_21, 0x21); 95 outb(cached_21, 0x21);
96 outb(0x20, 0x20); /* Non-specific EOI */ 96 outb(0x20, 0x20); /* Non-specific EOI */
97 } 97 }
98 spin_unlock_irqrestore(&i8259_lock, flags); 98 raw_spin_unlock_irqrestore(&i8259_lock, flags);
99} 99}
100 100
101static void i8259_set_irq_mask(int irq_nr) 101static void i8259_set_irq_mask(int irq_nr)
@@ -110,13 +110,13 @@ static void i8259_mask_irq(unsigned int irq_nr)
110 110
111 pr_debug("i8259_mask_irq(%d)\n", irq_nr); 111 pr_debug("i8259_mask_irq(%d)\n", irq_nr);
112 112
113 spin_lock_irqsave(&i8259_lock, flags); 113 raw_spin_lock_irqsave(&i8259_lock, flags);
114 if (irq_nr < 8) 114 if (irq_nr < 8)
115 cached_21 |= 1 << irq_nr; 115 cached_21 |= 1 << irq_nr;
116 else 116 else
117 cached_A1 |= 1 << (irq_nr-8); 117 cached_A1 |= 1 << (irq_nr-8);
118 i8259_set_irq_mask(irq_nr); 118 i8259_set_irq_mask(irq_nr);
119 spin_unlock_irqrestore(&i8259_lock, flags); 119 raw_spin_unlock_irqrestore(&i8259_lock, flags);
120} 120}
121 121
122static void i8259_unmask_irq(unsigned int irq_nr) 122static void i8259_unmask_irq(unsigned int irq_nr)
@@ -125,13 +125,13 @@ static void i8259_unmask_irq(unsigned int irq_nr)
125 125
126 pr_debug("i8259_unmask_irq(%d)\n", irq_nr); 126 pr_debug("i8259_unmask_irq(%d)\n", irq_nr);
127 127
128 spin_lock_irqsave(&i8259_lock, flags); 128 raw_spin_lock_irqsave(&i8259_lock, flags);
129 if (irq_nr < 8) 129 if (irq_nr < 8)
130 cached_21 &= ~(1 << irq_nr); 130 cached_21 &= ~(1 << irq_nr);
131 else 131 else
132 cached_A1 &= ~(1 << (irq_nr-8)); 132 cached_A1 &= ~(1 << (irq_nr-8));
133 i8259_set_irq_mask(irq_nr); 133 i8259_set_irq_mask(irq_nr);
134 spin_unlock_irqrestore(&i8259_lock, flags); 134 raw_spin_unlock_irqrestore(&i8259_lock, flags);
135} 135}
136 136
137static struct irq_chip i8259_pic = { 137static struct irq_chip i8259_pic = {
@@ -241,7 +241,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
241 unsigned long flags; 241 unsigned long flags;
242 242
243 /* initialize the controller */ 243 /* initialize the controller */
244 spin_lock_irqsave(&i8259_lock, flags); 244 raw_spin_lock_irqsave(&i8259_lock, flags);
245 245
246 /* Mask all first */ 246 /* Mask all first */
247 outb(0xff, 0xA1); 247 outb(0xff, 0xA1);
@@ -273,7 +273,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
273 outb(cached_A1, 0xA1); 273 outb(cached_A1, 0xA1);
274 outb(cached_21, 0x21); 274 outb(cached_21, 0x21);
275 275
276 spin_unlock_irqrestore(&i8259_lock, flags); 276 raw_spin_unlock_irqrestore(&i8259_lock, flags);
277 277
278 /* create a legacy host */ 278 /* create a legacy host */
279 i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY, 279 i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY,