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

Commit 018db6bb authored by Markus Armbruster's avatar Markus Armbruster Committed by Dmitry Torokhov
Browse files

Input: i8042 - restore control register when enabling port fails



When enabling interrupts for a port fails, the interrupt enable and
port enable bits remain set in i8042_ctr. Later writes of i8042_ctr
to the hardware could accidentally retry enabling interrupts. Clear
the bits on failure.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 20b3cdd6
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -385,6 +385,8 @@ static int i8042_enable_kbd_port(void)
	i8042_ctr |= I8042_CTR_KBDINT;
	i8042_ctr |= I8042_CTR_KBDINT;


	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
		i8042_ctr &= ~I8042_CTR_KBDINT;
		i8042_ctr |= I8042_CTR_KBDDIS;
		printk(KERN_ERR "i8042.c: Failed to enable KBD port.\n");
		printk(KERN_ERR "i8042.c: Failed to enable KBD port.\n");
		return -EIO;
		return -EIO;
	}
	}
@@ -402,6 +404,8 @@ static int i8042_enable_aux_port(void)
	i8042_ctr |= I8042_CTR_AUXINT;
	i8042_ctr |= I8042_CTR_AUXINT;


	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
		i8042_ctr &= ~I8042_CTR_AUXINT;
		i8042_ctr |= I8042_CTR_AUXDIS;
		printk(KERN_ERR "i8042.c: Failed to enable AUX port.\n");
		printk(KERN_ERR "i8042.c: Failed to enable AUX port.\n");
		return -EIO;
		return -EIO;
	}
	}