]> git.hungrycats.org Git - linux/commitdiff
[PATCH] i8042 timer fix
authorAndrew Morton <akpm@osdl.org>
Sat, 24 Jan 2004 06:06:23 +0000 (22:06 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 24 Jan 2004 06:06:23 +0000 (22:06 -0800)
From: Jim Collette <jim@hamachi.net>

There's an exit path in i8042_interrupt() which forgets to rearm the timer.
It can make the mouse die when X is started.

drivers/input/serio/i8042.c

index 1371303c99cb7b68432dd352c8deea9ed66c23da..1fb178904b13dda9fe57e7eb0b22cf69d286d709 100644 (file)
@@ -377,6 +377,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        unsigned long flags;
        unsigned char str, data;
        unsigned int dfl;
+       int ret;
 
        spin_lock_irqsave(&i8042_lock, flags);
        str = i8042_read_status();
@@ -385,7 +386,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        if (~str & I8042_STR_OBF) {
                if (irq) dbg("Interrupt %d, without any data", irq);
-               return IRQ_RETVAL(0);
+               ret = 0;
+               goto out;
        }
 
        dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
@@ -428,9 +430,10 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        serio_interrupt(&i8042_kbd_port, data, dfl, regs);
 
 irq_ret:
-
+       ret = 1;
+out:
        mod_timer(&i8042_timer, jiffies + I8042_POLL_PERIOD);
-       return IRQ_RETVAL(1);
+       return IRQ_RETVAL(ret);
 }
 
 /*