From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pablo <puretaurus@163.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] i8042: bugfix for controller detection failure
Date: Fri, 6 Dec 2013 08:14:20 -0800 [thread overview]
Message-ID: <20131206161419.GA4400@core.coreip.homeip.net> (raw)
In-Reply-To: <afgut4ql5ujewc30qasvonpu.1386341346081@email.android.com>
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
parent reply other threads:[~2013-12-06 16:14 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <afgut4ql5ujewc30qasvonpu.1386341346081@email.android.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131206161419.GA4400@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=puretaurus@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).