public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Marcos Paulo de Souza <marcos.souza.org@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] Input: i8042 - Add warn when a command can't write its parameter
Date: Tue,  6 Dec 2016 21:44:54 -0200	[thread overview]
Message-ID: <20161206234531.4320-1-marcos.souza.org@gmail.com> (raw)

This can happen in cases like bug #102951[1], so add a proper warn as done
in wait_read.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=102951

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/input/serio/i8042.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 89abfdb..1c70747 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -312,8 +312,10 @@ static int __i8042_command(unsigned char *param, int command)
 
 	for (i = 0; i < ((command >> 12) & 0xf); i++) {
 		error = i8042_wait_write();
-		if (error)
+		if (error) {
+			pr_warn("Can't write i8042 parameter, wait_write timed out\n");
 			return error;
+		}
 		dbg("%02x -> i8042 (parameter)\n", param[i]);
 		i8042_write_data(param[i]);
 	}
-- 
2.9.3

             reply	other threads:[~2016-12-06 23:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 23:44 Marcos Paulo de Souza [this message]
2016-12-06 23:44 ` [PATCH 2/2] Input: i8042 - change dbg to pr_warn when returning errors Marcos Paulo de Souza
2016-12-17  0:54   ` Dmitry Torokhov
2017-01-22 17:55 ` [PATCH -v2] Input: i8042: Add dbg msg when a command can't write its parameter Marcos Paulo de Souza
2017-01-22 22:30   ` 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=20161206234531.4320-1-marcos.souza.org@gmail.com \
    --to=marcos.souza.org@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox