diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2007-05-01 16:32:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:59:07 -0400 |
commit | 67dfb153a352e57e71404d550be7eb60d15d7f2d (patch) | |
tree | 675db4da976dedeba9c9ffbceb816f56701e9f94 /arch/m68k/mac/psc.c | |
parent | 647b804c8237aa35e19caf8e11ea8d5565107b0e (diff) |
m68k: Mac IRQ prep
Make sure that there are no slot IRQs asserted before leaving the nubus
handler. If there are and we don't then the nubus gets wedged because this
prevents a CA1 transition, which means no more nubus IRQs.
Make the interrupt dispatch loops terminate sooner.
Explicitly initialise the VIA latches to make the code more easily understood.
Also some cleanups.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/mac/psc.c')
-rw-r--r-- | arch/m68k/mac/psc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 401147985a96..1dba88247c6f 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c | |||
@@ -131,11 +131,8 @@ irqreturn_t psc_irq(int irq, void *dev_id) | |||
131 | { | 131 | { |
132 | int pIFR = pIFRbase + ((int) dev_id); | 132 | int pIFR = pIFRbase + ((int) dev_id); |
133 | int pIER = pIERbase + ((int) dev_id); | 133 | int pIER = pIERbase + ((int) dev_id); |
134 | int base_irq; | 134 | int irq_num; |
135 | int irq_bit,i; | 135 | unsigned char irq_bit, events; |
136 | unsigned char events; | ||
137 | |||
138 | base_irq = irq << 3; | ||
139 | 136 | ||
140 | #ifdef DEBUG_IRQS | 137 | #ifdef DEBUG_IRQS |
141 | printk("psc_irq: irq %d pIFR = 0x%02X pIER = 0x%02X\n", | 138 | printk("psc_irq: irq %d pIFR = 0x%02X pIER = 0x%02X\n", |
@@ -146,14 +143,18 @@ irqreturn_t psc_irq(int irq, void *dev_id) | |||
146 | if (!events) | 143 | if (!events) |
147 | return IRQ_NONE; | 144 | return IRQ_NONE; |
148 | 145 | ||
149 | for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) { | 146 | irq_num = irq << 3; |
150 | if (events & irq_bit) { | 147 | irq_bit = 1; |
148 | do { | ||
149 | if (events & irq_bit) { | ||
151 | psc_write_byte(pIER, irq_bit); | 150 | psc_write_byte(pIER, irq_bit); |
152 | psc_write_byte(pIFR, irq_bit); | 151 | psc_write_byte(pIFR, irq_bit); |
153 | m68k_handle_int(base_irq + i); | 152 | m68k_handle_int(irq_num); |
154 | psc_write_byte(pIER, irq_bit | 0x80); | 153 | psc_write_byte(pIER, irq_bit | 0x80); |
155 | } | 154 | } |
156 | } | 155 | irq_num++; |
156 | irq_bit <<= 1; | ||
157 | } while (events >= irq_bit); | ||
157 | return IRQ_HANDLED; | 158 | return IRQ_HANDLED; |
158 | } | 159 | } |
159 | 160 | ||