Re: [PATCH] i8042: bugfix for controller detection failure
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-12-06 16:14:25
Hi Pablo, On Fri, Dec 06, 2013 at 10:49:06PM +0800, Pablo wrote:
Subject: [PATCH] i8042: bugfix for controller detection failure From: Zhong Jun <redacted> To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, Dmitry Torokhov <redacted>, linux-input@vger.kernel.org if i8042 internal buffer is completely filled before i8042 initialization starting, function i8042_controller_check will fail because i8042_flush returns I8042_BUFFER_SIZE although i8042 internal buffer is completely cleared and I8042_STR_OBF bit of i8042 status register is cleared. To reproduce this bug, holding any key down while the kernel booting from scratch. After system is up, no i8042 entry in /sys/bus/platform/devices directory and key press is not responded.
I believe this problem shoudl be fixed by commit 2f0d2604134880f739642fd7c3ae55db33c838e7 Thanks.
quoted hunk
Signed-off-by: Zhong Jun <redacted> Tested-by: Zhong Jun <redacted> Reviewed-by: Wu Dongling <redacted> Reviewed-by: Jiang Biao jiang.biao2@zte.com.cn diff -up linux-2.6.32.61/drivers/input/serio/i8042.c.orig linux-2.6.32.61/drivers/input/serio/i8042.c--- linux-2.6.32.61/drivers/input/serio/i8042.c.orig 2013-11-29 16:42:37.788834724 +0800 +++ linux-2.6.32.61/drivers/input/serio/i8042.c 2013-11-29 16:46:42.371877282 +0800@@ -194,7 +194,7 @@ static int i8042_flush(void)spin_unlock_irqrestore(&i8042_lock, flags); - return i; + return i + (str & I8042_STR_OBF); } /*@@ -781,7 +781,7 @@ static int __init i8042_check_aux(void)static int i8042_controller_check(void) { - if (i8042_flush() == I8042_BUFFER_SIZE) { + if (i8042_flush() > I8042_BUFFER_SIZE) { printk(KERN_ERR "i8042.c: No controller found.\n"); return -ENODEV; }
-- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html