linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND] [PATCH] Input: add retry logic to resume with respect to CTR
@ 2008-06-12 13:12 Jiri Kosina
  0 siblings, 0 replies; only message in thread
From: Jiri Kosina @ 2008-06-12 13:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Andrew Morton; +Cc: linux-input, linux-kernel

There are systems that fail in i8042_resume() with

	i8042: Can't write CTR to resume

as i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR) fails even though the
controller claimed itself to be ready before.

One retry after failing write fixes the problems on the failing systems.

Reported-by: Helmut Schaa <hschaa@novell.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 drivers/input/serio/i8042.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- linux-2.6.25.orig/drivers/input/serio/i8042.c
+++ linux-2.6.25/drivers/input/serio/i8042.c
@@ -938,8 +938,12 @@ static int i8042_resume(struct platform_
 	i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS;
 	i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT);
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
-		printk(KERN_ERR "i8042: Can't write CTR to resume\n");
-		return -EIO;
+		printk(KERN_WARNING "i8042: Can't write CTR to resume, retrying ...\n");
+		msleep(50);
+		if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
+			printk(KERN_ERR "i8042: CTR write retry failed\n");
+			return -EIO;
+		}
 	}
 
 	if (i8042_mux_present) {

--
1.5.2.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-12 13:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-12 13:12 [RESEND] [PATCH] Input: add retry logic to resume with respect to CTR Jiri Kosina

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).