Re: [PATCH] i8042: bugfix for controller detection failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> To: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>, Dmitry Torokhov <dtor@xxxxxxx>, linux-input@xxxxxxxxxxxxxxx
> 
>     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@xxxxxxxxxx>
> Tested-by: Zhong Jun <zhongjun@xxxxxxxxxx>
> Reviewed-by: Wu Dongling <wudongling@xxxxxxxxxx>
> Reviewed-by: Jiang Biao jiang.biao2@xxxxxxxxxx
> 
> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux