From: Jiri Kosina Date: Tue, 17 Jun 2008 15:47:27 +0000 (-0400) Subject: Input: i8042 - retry failed CTR writes when resuming X-Git-Tag: v2.6.26-rc7~21^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f6a77d56523c14651236bc401a99b0e2aca2fdd;p=linux-2.6 Input: i8042 - retry failed CTR writes when resuming 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 Signed-off-by: Jiri Kosina Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 592ff55b62..170f71ee57 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -952,8 +952,12 @@ static int i8042_resume(struct platform_device *dev) 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; + } }