Skip to content

Commit

Permalink
Input: i8042 - retry failed CTR writes when resuming
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Jiri Kosina authored and Dmitry Torokhov committed Jun 17, 2008
1 parent efd5184 commit 2f6a77d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}


Expand Down

0 comments on commit 2f6a77d

Please sign in to comment.