* Re: [PATCH] i8042: bugfix for controller detection failure
[not found] <afgut4ql5ujewc30qasvonpu.1386341346081@email.android.com>
@ 2013-12-06 16:14 ` Dmitry Torokhov
0 siblings, 0 replies; only message in thread
From: Dmitry Torokhov @ 2013-12-06 16:14 UTC (permalink / raw)
To: Pablo; +Cc: linux-input
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 <puretaurs@163.com>
> To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, Dmitry Torokhov <dtor@mail.ru>, 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.
>
> Signed-off-by: Zhong Jun <zhongjun@zte.com.cn>
> Tested-by: Zhong Jun <zhongjun@zte.com.cn>
> Reviewed-by: Wu Dongling <wudongling@zte.com.cn>
> 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
^ permalink raw reply [flat|nested] only message in thread