aboutsummaryrefslogtreecommitdiff
path: root/arch/m68k/mac/psc.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2007-05-01 22:32:56 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 17:59:07 -0700
commit67dfb153a352e57e71404d550be7eb60d15d7f2d (patch)
tree675db4da976dedeba9c9ffbceb816f56701e9f94 /arch/m68k/mac/psc.c
parent647b804c8237aa35e19caf8e11ea8d5565107b0e (diff)
downloadlinux-2.6.34-ux500-67dfb153a352e57e71404d550be7eb60d15d7f2d.tar.gz
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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index 401147985a9..1dba88247c6 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)
{
int pIFR = pIFRbase + ((int) dev_id);
int pIER = pIERbase + ((int) dev_id);
- int base_irq;
- int irq_bit,i;
- unsigned char events;
-
- base_irq = irq << 3;
+ int irq_num;
+ unsigned char irq_bit, events;
#ifdef DEBUG_IRQS
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)
if (!events)
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) {
- if (events & irq_bit) {
+ irq_num = irq << 3;
+ irq_bit = 1;
+ do {
+ if (events & irq_bit) {
psc_write_byte(pIER, irq_bit);
psc_write_byte(pIFR, irq_bit);
- m68k_handle_int(base_irq + i);
+ m68k_handle_int(irq_num);
psc_write_byte(pIER, irq_bit | 0x80);
}
- }
+ irq_num++;
+ irq_bit <<= 1;
+ } while (events >= irq_bit);
return IRQ_HANDLED;
}