diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2010-02-18 08:45:12 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2010-03-04 11:42:57 -0500 |
commit | 7e026f72cf05137e0b52b7aa5420e95a76bd3195 (patch) | |
tree | 5a2116ea486d15e8b24ac0e5fa3c0c82f3b54ef4 /arch/powerpc/platforms | |
parent | 3d98ffbffb16f2a1569b83cb78db0b5100e6c937 (diff) |
powerpc/85xx: Convert socrates_fpga_pic_lock to raw_spinlock
Interrupt controllers' hooks are executed in the atomic context, so
they are not permitted to sleep (with RT kernels non-raw spinlocks are
sleepable). So, socrates_fpga_pic_lock has to be a real (non-sleepable)
spinlock.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c index 42e87f08aa01..d48527ffc425 100644 --- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c +++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c | |||
@@ -50,7 +50,7 @@ static struct socrates_fpga_irq_info fpga_irqs[SOCRATES_FPGA_NUM_IRQS] = { | |||
50 | 50 | ||
51 | #define socrates_fpga_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) | 51 | #define socrates_fpga_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) |
52 | 52 | ||
53 | static DEFINE_SPINLOCK(socrates_fpga_pic_lock); | 53 | static DEFINE_RAW_SPINLOCK(socrates_fpga_pic_lock); |
54 | 54 | ||
55 | static void __iomem *socrates_fpga_pic_iobase; | 55 | static void __iomem *socrates_fpga_pic_iobase; |
56 | static struct irq_host *socrates_fpga_pic_irq_host; | 56 | static struct irq_host *socrates_fpga_pic_irq_host; |
@@ -80,9 +80,9 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq) | |||
80 | if (i == 3) | 80 | if (i == 3) |
81 | return NO_IRQ; | 81 | return NO_IRQ; |
82 | 82 | ||
83 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 83 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
84 | cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); | 84 | cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); |
85 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 85 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
86 | for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) { | 86 | for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) { |
87 | if (cause >> (i + 16)) | 87 | if (cause >> (i + 16)) |
88 | break; | 88 | break; |
@@ -116,12 +116,12 @@ static void socrates_fpga_pic_ack(unsigned int virq) | |||
116 | hwirq = socrates_fpga_irq_to_hw(virq); | 116 | hwirq = socrates_fpga_irq_to_hw(virq); |
117 | 117 | ||
118 | irq_line = fpga_irqs[hwirq].irq_line; | 118 | irq_line = fpga_irqs[hwirq].irq_line; |
119 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 119 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
120 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) | 120 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) |
121 | & SOCRATES_FPGA_IRQ_MASK; | 121 | & SOCRATES_FPGA_IRQ_MASK; |
122 | mask |= (1 << (hwirq + 16)); | 122 | mask |= (1 << (hwirq + 16)); |
123 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); | 123 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); |
124 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 124 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
125 | } | 125 | } |
126 | 126 | ||
127 | static void socrates_fpga_pic_mask(unsigned int virq) | 127 | static void socrates_fpga_pic_mask(unsigned int virq) |
@@ -134,12 +134,12 @@ static void socrates_fpga_pic_mask(unsigned int virq) | |||
134 | hwirq = socrates_fpga_irq_to_hw(virq); | 134 | hwirq = socrates_fpga_irq_to_hw(virq); |
135 | 135 | ||
136 | irq_line = fpga_irqs[hwirq].irq_line; | 136 | irq_line = fpga_irqs[hwirq].irq_line; |
137 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 137 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
138 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) | 138 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) |
139 | & SOCRATES_FPGA_IRQ_MASK; | 139 | & SOCRATES_FPGA_IRQ_MASK; |
140 | mask &= ~(1 << hwirq); | 140 | mask &= ~(1 << hwirq); |
141 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); | 141 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); |
142 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 142 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
143 | } | 143 | } |
144 | 144 | ||
145 | static void socrates_fpga_pic_mask_ack(unsigned int virq) | 145 | static void socrates_fpga_pic_mask_ack(unsigned int virq) |
@@ -152,13 +152,13 @@ static void socrates_fpga_pic_mask_ack(unsigned int virq) | |||
152 | hwirq = socrates_fpga_irq_to_hw(virq); | 152 | hwirq = socrates_fpga_irq_to_hw(virq); |
153 | 153 | ||
154 | irq_line = fpga_irqs[hwirq].irq_line; | 154 | irq_line = fpga_irqs[hwirq].irq_line; |
155 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 155 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
156 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) | 156 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) |
157 | & SOCRATES_FPGA_IRQ_MASK; | 157 | & SOCRATES_FPGA_IRQ_MASK; |
158 | mask &= ~(1 << hwirq); | 158 | mask &= ~(1 << hwirq); |
159 | mask |= (1 << (hwirq + 16)); | 159 | mask |= (1 << (hwirq + 16)); |
160 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); | 160 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); |
161 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 161 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
162 | } | 162 | } |
163 | 163 | ||
164 | static void socrates_fpga_pic_unmask(unsigned int virq) | 164 | static void socrates_fpga_pic_unmask(unsigned int virq) |
@@ -171,12 +171,12 @@ static void socrates_fpga_pic_unmask(unsigned int virq) | |||
171 | hwirq = socrates_fpga_irq_to_hw(virq); | 171 | hwirq = socrates_fpga_irq_to_hw(virq); |
172 | 172 | ||
173 | irq_line = fpga_irqs[hwirq].irq_line; | 173 | irq_line = fpga_irqs[hwirq].irq_line; |
174 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 174 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
175 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) | 175 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) |
176 | & SOCRATES_FPGA_IRQ_MASK; | 176 | & SOCRATES_FPGA_IRQ_MASK; |
177 | mask |= (1 << hwirq); | 177 | mask |= (1 << hwirq); |
178 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); | 178 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); |
179 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 179 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void socrates_fpga_pic_eoi(unsigned int virq) | 182 | static void socrates_fpga_pic_eoi(unsigned int virq) |
@@ -189,12 +189,12 @@ static void socrates_fpga_pic_eoi(unsigned int virq) | |||
189 | hwirq = socrates_fpga_irq_to_hw(virq); | 189 | hwirq = socrates_fpga_irq_to_hw(virq); |
190 | 190 | ||
191 | irq_line = fpga_irqs[hwirq].irq_line; | 191 | irq_line = fpga_irqs[hwirq].irq_line; |
192 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 192 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
193 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) | 193 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) |
194 | & SOCRATES_FPGA_IRQ_MASK; | 194 | & SOCRATES_FPGA_IRQ_MASK; |
195 | mask |= (1 << (hwirq + 16)); | 195 | mask |= (1 << (hwirq + 16)); |
196 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); | 196 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); |
197 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 197 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
198 | } | 198 | } |
199 | 199 | ||
200 | static int socrates_fpga_pic_set_type(unsigned int virq, | 200 | static int socrates_fpga_pic_set_type(unsigned int virq, |
@@ -220,14 +220,14 @@ static int socrates_fpga_pic_set_type(unsigned int virq, | |||
220 | default: | 220 | default: |
221 | return -EINVAL; | 221 | return -EINVAL; |
222 | } | 222 | } |
223 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 223 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
224 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQCFG); | 224 | mask = socrates_fpga_pic_read(FPGA_PIC_IRQCFG); |
225 | if (polarity) | 225 | if (polarity) |
226 | mask |= (1 << hwirq); | 226 | mask |= (1 << hwirq); |
227 | else | 227 | else |
228 | mask &= ~(1 << hwirq); | 228 | mask &= ~(1 << hwirq); |
229 | socrates_fpga_pic_write(FPGA_PIC_IRQCFG, mask); | 229 | socrates_fpga_pic_write(FPGA_PIC_IRQCFG, mask); |
230 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 230 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
@@ -314,14 +314,14 @@ void socrates_fpga_pic_init(struct device_node *pic) | |||
314 | 314 | ||
315 | socrates_fpga_pic_iobase = of_iomap(pic, 0); | 315 | socrates_fpga_pic_iobase = of_iomap(pic, 0); |
316 | 316 | ||
317 | spin_lock_irqsave(&socrates_fpga_pic_lock, flags); | 317 | raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags); |
318 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(0), | 318 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(0), |
319 | SOCRATES_FPGA_IRQ_MASK << 16); | 319 | SOCRATES_FPGA_IRQ_MASK << 16); |
320 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(1), | 320 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(1), |
321 | SOCRATES_FPGA_IRQ_MASK << 16); | 321 | SOCRATES_FPGA_IRQ_MASK << 16); |
322 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(2), | 322 | socrates_fpga_pic_write(FPGA_PIC_IRQMASK(2), |
323 | SOCRATES_FPGA_IRQ_MASK << 16); | 323 | SOCRATES_FPGA_IRQ_MASK << 16); |
324 | spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); | 324 | raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); |
325 | 325 | ||
326 | pr_info("FPGA PIC: Setting up Socrates FPGA PIC\n"); | 326 | pr_info("FPGA PIC: Setting up Socrates FPGA PIC\n"); |
327 | } | 327 | } |