diff options
Diffstat (limited to 'arch/powerpc/platforms/celleb/interrupt.c')
-rw-r--r-- | arch/powerpc/platforms/celleb/interrupt.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/celleb/interrupt.c b/arch/powerpc/platforms/celleb/interrupt.c index c7c68ca70c82..69562a867876 100644 --- a/arch/powerpc/platforms/celleb/interrupt.c +++ b/arch/powerpc/platforms/celleb/interrupt.c | |||
@@ -34,7 +34,7 @@ static DEFINE_SPINLOCK(beatic_irq_mask_lock); | |||
34 | static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; | 34 | static uint64_t beatic_irq_mask_enable[(MAX_IRQS+255)/64]; |
35 | static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; | 35 | static uint64_t beatic_irq_mask_ack[(MAX_IRQS+255)/64]; |
36 | 36 | ||
37 | static struct irq_host *beatic_host = NULL; | 37 | static struct irq_host *beatic_host; |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * In this implementation, "virq" == "IRQ plug number", | 40 | * In this implementation, "virq" == "IRQ plug number", |
@@ -49,13 +49,13 @@ static inline void beatic_update_irq_mask(unsigned int irq_plug) | |||
49 | 49 | ||
50 | off = (irq_plug / 256) * 4; | 50 | off = (irq_plug / 256) * 4; |
51 | masks[0] = beatic_irq_mask_enable[off + 0] | 51 | masks[0] = beatic_irq_mask_enable[off + 0] |
52 | & beatic_irq_mask_ack[off + 0]; | 52 | & beatic_irq_mask_ack[off + 0]; |
53 | masks[1] = beatic_irq_mask_enable[off + 1] | 53 | masks[1] = beatic_irq_mask_enable[off + 1] |
54 | & beatic_irq_mask_ack[off + 1]; | 54 | & beatic_irq_mask_ack[off + 1]; |
55 | masks[2] = beatic_irq_mask_enable[off + 2] | 55 | masks[2] = beatic_irq_mask_enable[off + 2] |
56 | & beatic_irq_mask_ack[off + 2]; | 56 | & beatic_irq_mask_ack[off + 2]; |
57 | masks[3] = beatic_irq_mask_enable[off + 3] | 57 | masks[3] = beatic_irq_mask_enable[off + 3] |
58 | & beatic_irq_mask_ack[off + 3]; | 58 | & beatic_irq_mask_ack[off + 3]; |
59 | if (beat_set_interrupt_mask(irq_plug&~255UL, | 59 | if (beat_set_interrupt_mask(irq_plug&~255UL, |
60 | masks[0], masks[1], masks[2], masks[3]) != 0) | 60 | masks[0], masks[1], masks[2], masks[3]) != 0) |
61 | panic("Failed to set mask IRQ!"); | 61 | panic("Failed to set mask IRQ!"); |
@@ -96,7 +96,8 @@ static void beatic_end_irq(unsigned int irq_plug) | |||
96 | s64 err; | 96 | s64 err; |
97 | unsigned long flags; | 97 | unsigned long flags; |
98 | 98 | ||
99 | if ((err = beat_downcount_of_interrupt(irq_plug)) != 0) { | 99 | err = beat_downcount_of_interrupt(irq_plug); |
100 | if (err != 0) { | ||
100 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ | 101 | if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */ |
101 | panic("Failed to downcount IRQ! Error = %16lx", err); | 102 | panic("Failed to downcount IRQ! Error = %16lx", err); |
102 | 103 | ||
@@ -138,7 +139,8 @@ static int beatic_pic_host_map(struct irq_host *h, unsigned int virq, | |||
138 | struct irq_desc *desc = get_irq_desc(virq); | 139 | struct irq_desc *desc = get_irq_desc(virq); |
139 | int64_t err; | 140 | int64_t err; |
140 | 141 | ||
141 | if ((err = beat_construct_and_connect_irq_plug(virq, hw)) < 0) | 142 | err = beat_construct_and_connect_irq_plug(virq, hw); |
143 | if (err < 0) | ||
142 | return -EIO; | 144 | return -EIO; |
143 | 145 | ||
144 | desc->status |= IRQ_LEVEL; | 146 | desc->status |= IRQ_LEVEL; |
@@ -202,22 +204,22 @@ static inline unsigned int beatic_get_irq_plug(void) | |||
202 | beat_detect_pending_interrupts(i, pending); | 204 | beat_detect_pending_interrupts(i, pending); |
203 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 205 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
204 | "r"(pending[0] & beatic_irq_mask_enable[i/64+0] | 206 | "r"(pending[0] & beatic_irq_mask_enable[i/64+0] |
205 | & beatic_irq_mask_ack[i/64+0])); | 207 | & beatic_irq_mask_ack[i/64+0])); |
206 | if (ub != 64) | 208 | if (ub != 64) |
207 | return i + ub + 0; | 209 | return i + ub + 0; |
208 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 210 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
209 | "r"(pending[1] & beatic_irq_mask_enable[i/64+1] | 211 | "r"(pending[1] & beatic_irq_mask_enable[i/64+1] |
210 | & beatic_irq_mask_ack[i/64+1])); | 212 | & beatic_irq_mask_ack[i/64+1])); |
211 | if (ub != 64) | 213 | if (ub != 64) |
212 | return i + ub + 64; | 214 | return i + ub + 64; |
213 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 215 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
214 | "r"(pending[2] & beatic_irq_mask_enable[i/64+2] | 216 | "r"(pending[2] & beatic_irq_mask_enable[i/64+2] |
215 | & beatic_irq_mask_ack[i/64+2])); | 217 | & beatic_irq_mask_ack[i/64+2])); |
216 | if (ub != 64) | 218 | if (ub != 64) |
217 | return i + ub + 128; | 219 | return i + ub + 128; |
218 | __asm__ ("cntlzd %0,%1":"=r"(ub): | 220 | __asm__ ("cntlzd %0,%1":"=r"(ub): |
219 | "r"(pending[3] & beatic_irq_mask_enable[i/64+3] | 221 | "r"(pending[3] & beatic_irq_mask_enable[i/64+3] |
220 | & beatic_irq_mask_ack[i/64+3])); | 222 | & beatic_irq_mask_ack[i/64+3])); |
221 | if (ub != 64) | 223 | if (ub != 64) |
222 | return i + ub + 192; | 224 | return i + ub + 192; |
223 | } | 225 | } |
@@ -250,7 +252,7 @@ void __init beatic_init_IRQ(void) | |||
250 | 252 | ||
251 | /* Allocate an irq host */ | 253 | /* Allocate an irq host */ |
252 | beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, | 254 | beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, |
253 | &beatic_pic_host_ops, | 255 | &beatic_pic_host_ops, |
254 | 0); | 256 | 0); |
255 | BUG_ON(beatic_host == NULL); | 257 | BUG_ON(beatic_host == NULL); |
256 | irq_set_default_host(beatic_host); | 258 | irq_set_default_host(beatic_host); |