From: Andrey Moiseev <o2g.org.ru@gmail.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org
Subject: input: i8042 possible bug
Date: Tue, 03 Sep 2013 21:39:10 +0400 [thread overview]
Message-ID: <52261EBE.5010007@gmail.com> (raw)
Here is an extract from drivers/input/serio/i8042.c:
>
> static int i8042_flush(void)
> {
> unsigned long flags;
> unsigned char data, str;
> int i = 0;
>
> spin_lock_irqsave(&i8042_lock, flags);
>
> while (((str = i8042_read_status()) & I8042_STR_OBF) && (i < I8042_BUFFER_SIZE)) {
> udelay(50);
> data = i8042_read_data();
> i++;
> dbg("%02x <- i8042 (flush, %s)\n",
> data, str & I8042_STR_AUXDATA ? "aux" : "kbd");
> }
>
> spin_unlock_irqrestore(&i8042_lock, flags);
>
> return i;
> }
>
> static int i8042_controller_check(void)
> {
> if (i8042_flush() == I8042_BUFFER_SIZE) {
Doesn't it panic needlessly, while the buffer was initially full?
> pr_err("No controller found\n");
> return -ENODEV;
> }
>
> return 0;
> }
next reply other threads:[~2013-09-03 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 17:39 Andrey Moiseev [this message]
2013-09-03 18:11 ` input: i8042 possible bug Dmitry Torokhov
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=52261EBE.5010007@gmail.com \
--to=o2g.org.ru@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.