[PATCH 1/2] Input: i8042 - Add warn when a command can't write its parameter

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE3523d

5 messages, 2 authors, 2017-01-22 · open the first message on its own page

[PATCH 1/2] Input: i8042 - Add warn when a command can't write its parameter

From: Marcos Paulo de Souza <hidden>
Date: 2016-12-06 23:46:13

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 <redacted>
---
 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

[PATCH 2/2] Input: i8042 - change dbg to pr_warn when returning errors

From: Marcos Paulo de Souza <hidden>
Date: 2016-12-06 23:46:10

Signed-off-by: Marcos Paulo de Souza <redacted>
---
 drivers/input/serio/i8042.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 1c70747..bc54ce5 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -323,13 +323,13 @@ static int __i8042_command(unsigned char *param, int command)
 	for (i = 0; i < ((command >> 8) & 0xf); i++) {
 		error = i8042_wait_read();
 		if (error) {
-			dbg("     -- i8042 (timeout)\n");
+			pr_warn("     -- i8042 (timeout)\n");
 			return error;
 		}
 
 		if (command == I8042_CMD_AUX_LOOP &&
 		    !(i8042_read_status() & I8042_STR_AUXDATA)) {
-			dbg("     -- i8042 (auxerr)\n");
+			pr_warn("     -- i8042 (auxerr)\n");
 			return -1;
 		}
 
-- 
2.9.3

Re: [PATCH 2/2] Input: i8042 - change dbg to pr_warn when returning errors

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2016-12-17 00:54:58

Hi Marcos,

On Tue, Dec 06, 2016 at 09:44:55PM -0200, Marcos Paulo de Souza wrote:
quoted hunk
Signed-off-by: Marcos Paulo de Souza <redacted>
---
 drivers/input/serio/i8042.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 1c70747..bc54ce5 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -323,13 +323,13 @@ static int __i8042_command(unsigned char *param, int command)
 	for (i = 0; i < ((command >> 8) & 0xf); i++) {
 		error = i8042_wait_read();
 		if (error) {
-			dbg("     -- i8042 (timeout)\n");
+			pr_warn("     -- i8042 (timeout)\n");
 			return error;
 		}
 
 		if (command == I8042_CMD_AUX_LOOP &&
 		    !(i8042_read_status() & I8042_STR_AUXDATA)) {
-			dbg("     -- i8042 (auxerr)\n");
+			pr_warn("     -- i8042 (auxerr)\n");
 			return -1;
No, we expect this to fail on some systems (that is the whole point of
testing using the LOOP command to verify that AUX port is there and is
wired properly), so we should not be issuing warnings - the system way
very well be functioning properly.

dbg() is always there, so just rerun the boot with i8042.debug and get
all the trace needed.

Thanks.

-- 
Dmitry

[PATCH -v2] Input: i8042: Add dbg msg when a command can't write its parameter

From: Marcos Paulo de Souza <hidden>
Date: 2017-01-22 17:56:23

This can happen in cases like bug #102951[1], so add a proper debug msg
as done in wait_read. Also, change wait_read debug message to differ from
wait_write.

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

Signed-off-by: Marcos Paulo de Souza <redacted>
---
Changes from v1:
 * use dbg instead of pr_warn

 drivers/input/serio/i8042.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 62685a7..cba6831 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) {
+			dbg("     -- i8042 (timeout wait_write)\n");
 			return error;
+		}
 		dbg("%02x -> i8042 (parameter)\n", param[i]);
 		i8042_write_data(param[i]);
 	}
@@ -321,7 +323,7 @@ static int __i8042_command(unsigned char *param, int command)
 	for (i = 0; i < ((command >> 8) & 0xf); i++) {
 		error = i8042_wait_read();
 		if (error) {
-			dbg("     -- i8042 (timeout)\n");
+			dbg("     -- i8042 (timeout wait_read)\n");
 			return error;
 		}
 
-- 
2.9.3

Re: [PATCH -v2] Input: i8042: Add dbg msg when a command can't write its parameter

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2017-01-22 22:30:38

On Sun, Jan 22, 2017 at 03:55:19PM -0200, Marcos Paulo de Souza wrote:
This can happen in cases like bug #102951[1], so add a proper debug msg
as done in wait_read. Also, change wait_read debug message to differ from
wait_write.

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

Signed-off-by: Marcos Paulo de Souza <redacted>
Applied, thank you.
quoted hunk
---
Changes from v1:
 * use dbg instead of pr_warn

 drivers/input/serio/i8042.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 62685a7..cba6831 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) {
+			dbg("     -- i8042 (timeout wait_write)\n");
 			return error;
+		}
 		dbg("%02x -> i8042 (parameter)\n", param[i]);
 		i8042_write_data(param[i]);
 	}
@@ -321,7 +323,7 @@ static int __i8042_command(unsigned char *param, int command)
 	for (i = 0; i < ((command >> 8) & 0xf); i++) {
 		error = i8042_wait_read();
 		if (error) {
-			dbg("     -- i8042 (timeout)\n");
+			dbg("     -- i8042 (timeout wait_read)\n");
 			return error;
 		}
 
-- 
2.9.3
-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help