diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-17 01:07:06 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-17 01:07:06 -0500 |
commit | a216a4b6e6f1fdfd3d1f20f03d9d45f05a63d643 (patch) | |
tree | 6c593ead32aadd41014fec7a54357ff90b51de77 /drivers/input/serio/i8042.c | |
parent | 6c595fb12fa6c1fe382cc086fdade4acd93c643f (diff) |
Input: i8042 - fix shutdown issue on some boxes with active MUXes
MUX error handling has a workaround for KBCs that get confused which
port data came from and signal MUXERR while data is actually good.
Unfortunately this workaround hurts with KBCs that signal timeouts
as 0xfc (spec says that only 0xfd, 0xfe and 0xff are alowed with
MUXERR) since it causes endless attempts to rescan i8042 serio
ports. The solution is to treat 0xfc as timeout (0xfe).
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/i8042.c')
-rw-r--r-- | drivers/input/serio/i8042.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index d365f227ac56..debe9445488c 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -322,23 +322,27 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id) | |||
322 | dfl = 0; | 322 | dfl = 0; |
323 | if (str & I8042_STR_MUXERR) { | 323 | if (str & I8042_STR_MUXERR) { |
324 | dbg("MUX error, status is %02x, data is %02x", str, data); | 324 | dbg("MUX error, status is %02x, data is %02x", str, data); |
325 | switch (data) { | ||
326 | default: | ||
327 | /* | 325 | /* |
328 | * When MUXERR condition is signalled the data register can only contain | 326 | * When MUXERR condition is signalled the data register can only contain |
329 | * 0xfd, 0xfe or 0xff if implementation follows the spec. Unfortunately | 327 | * 0xfd, 0xfe or 0xff if implementation follows the spec. Unfortunately |
330 | * it is not always the case. Some KBC just get confused which port the | 328 | * it is not always the case. Some KBCs also report 0xfc when there is |
331 | * data came from and signal error leaving the data intact. They _do not_ | 329 | * nothing connected to the port while others sometimes get confused which |
332 | * revert to legacy mode (actually I've never seen KBC reverting to legacy | 330 | * port the data came from and signal error leaving the data intact. They |
333 | * mode yet, when we see one we'll add proper handling). | 331 | * _do not_ revert to legacy mode (actually I've never seen KBC reverting |
334 | * Anyway, we will assume that the data came from the same serio last byte | 332 | * to legacy mode yet, when we see one we'll add proper handling). |
333 | * Anyway, we process 0xfc, 0xfd, 0xfe and 0xff as timeouts, and for the | ||
334 | * rest assume that the data came from the same serio last byte | ||
335 | * was transmitted (if transmission happened not too long ago). | 335 | * was transmitted (if transmission happened not too long ago). |
336 | */ | 336 | */ |
337 | |||
338 | switch (data) { | ||
339 | default: | ||
337 | if (time_before(jiffies, last_transmit + HZ/10)) { | 340 | if (time_before(jiffies, last_transmit + HZ/10)) { |
338 | str = last_str; | 341 | str = last_str; |
339 | break; | 342 | break; |
340 | } | 343 | } |
341 | /* fall through - report timeout */ | 344 | /* fall through - report timeout */ |
345 | case 0xfc: | ||
342 | case 0xfd: | 346 | case 0xfd: |
343 | case 0xfe: dfl = SERIO_TIMEOUT; data = 0xfe; break; | 347 | case 0xfe: dfl = SERIO_TIMEOUT; data = 0xfe; break; |
344 | case 0xff: dfl = SERIO_PARITY; data = 0xfe; break; | 348 | case 0xff: dfl = SERIO_PARITY; data = 0xfe; break; |