Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f6a77d5 authored by Jiri Kosina's avatar Jiri Kosina Committed by Dmitry Torokhov
Browse files

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: default avatarHelmut Schaa <hschaa@novell.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent efd51846
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -952,9 +952,13 @@ 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");
		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;
		}
	}


#ifdef CONFIG_X86