linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands
@ 2020-08-27 20:41 Raul E Rangel
  2020-08-27 20:41 ` [PATCH v2 2/2] Input: i8042 - Lock i8042_mutex before flushing Raul E Rangel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Raul E Rangel @ 2020-08-27 20:41 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, Shirish.S, Raul E Rangel, Andy Shevchenko,
	Dan Murphy, Darren Hart, Jacek Anaszewski, Lee, Chun-Yi,
	Pavel Machek, Rajat Jain, Stephen Boyd, linux-kernel, linux-leds,
	platform-driver-x86

The i8042_mutex must be held by writers of the AUX and KBD ports, as
well as users of i8042_command. There were a lot of users of
i8042_command that were not calling i8042_lock_chip/i8042_unlock_chip.
This resulted in i8042_commands being issues in between PS/2
transactions.

This change moves the mutex lock into i8042_command and removes the
burden of locking the mutex from the callers.

It is expected that the i8042_mutex is locked before calling
i8042_aux_write or i8042_kbd_write. This is currently done by the PS/2
layer via ps2_begin_command and ps2_end_command. Other modules
(serio_raw) do not currently lock the mutex, so there is still a
possibility for intermixed commands.

Link: https://lore.kernel.org/linux-input/CAHQZ30ANTeM-pgdYZ4AbgxsnevBJnJgKZ1Kg+Uy8oSXZUvz=og@mail.gmail.com
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
---
Tested this on a device with only a PS/2 keyboard. I was able to do
1200+ suspend/resume cycles.

Also tested this on a device with a PS/2 keyboard and a PS/2 mouse.
I was able to do 250+ iterations with out problems.

Changes in v2:
- Fixed bad indent
- Added Link: tag
- Removed left over rc variable

 drivers/input/serio/i8042.c         | 29 ++++++++++++++---------------
 drivers/leds/leds-clevo-mail.c      |  9 ---------
 drivers/platform/x86/acer-wmi.c     |  2 --
 drivers/platform/x86/amilo-rfkill.c |  6 +-----
 include/linux/i8042.h               | 10 ----------
 5 files changed, 15 insertions(+), 41 deletions(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 0dddf273afd94..65ca6b47f41e8 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -137,8 +137,7 @@ static DEFINE_SPINLOCK(i8042_lock);
 
 /*
  * Writers to AUX and KBD ports as well as users issuing i8042_command
- * directly should acquire i8042_mutex (by means of calling
- * i8042_lock_chip() and i8042_unlock_ship() helpers) to ensure that
+ * directly should acquire i8042_mutex to ensure that
  * they do not disturb each other (unfortunately in many i8042
  * implementations write to one of the ports will immediately abort
  * command that is being processed by another port).
@@ -173,18 +172,6 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id);
 static bool (*i8042_platform_filter)(unsigned char data, unsigned char str,
 				     struct serio *serio);
 
-void i8042_lock_chip(void)
-{
-	mutex_lock(&i8042_mutex);
-}
-EXPORT_SYMBOL(i8042_lock_chip);
-
-void i8042_unlock_chip(void)
-{
-	mutex_unlock(&i8042_mutex);
-}
-EXPORT_SYMBOL(i8042_unlock_chip);
-
 int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
 					struct serio *serio))
 {
@@ -343,10 +330,14 @@ int i8042_command(unsigned char *param, int command)
 	unsigned long flags;
 	int retval;
 
+	mutex_lock(&i8042_mutex);
+
 	spin_lock_irqsave(&i8042_lock, flags);
 	retval = __i8042_command(param, command);
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
+	mutex_unlock(&i8042_mutex);
+
 	return retval;
 }
 EXPORT_SYMBOL(i8042_command);
@@ -379,10 +370,18 @@ static int i8042_kbd_write(struct serio *port, unsigned char c)
 static int i8042_aux_write(struct serio *serio, unsigned char c)
 {
 	struct i8042_port *port = serio->port_data;
+	unsigned long flags;
+	int retval = 0;
+
+	spin_lock_irqsave(&i8042_lock, flags);
 
-	return i8042_command(&c, port->mux == -1 ?
+	retval = __i8042_command(&c, port->mux == -1 ?
 					I8042_CMD_AUX_SEND :
 					I8042_CMD_MUX_SEND + port->mux);
+
+	spin_unlock_irqrestore(&i8042_lock, flags);
+
+	return retval;
 }
 
 
diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
index f512e99b976b1..6c3d7e54f95cf 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -95,17 +95,12 @@ MODULE_DEVICE_TABLE(dmi, clevo_mail_led_dmi_table);
 static void clevo_mail_led_set(struct led_classdev *led_cdev,
 				enum led_brightness value)
 {
-	i8042_lock_chip();
-
 	if (value == LED_OFF)
 		i8042_command(NULL, CLEVO_MAIL_LED_OFF);
 	else if (value <= LED_HALF)
 		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_0_5HZ);
 	else
 		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_1HZ);
-
-	i8042_unlock_chip();
-
 }
 
 static int clevo_mail_led_blink(struct led_classdev *led_cdev,
@@ -114,8 +109,6 @@ static int clevo_mail_led_blink(struct led_classdev *led_cdev,
 {
 	int status = -EINVAL;
 
-	i8042_lock_chip();
-
 	if (*delay_on == 0 /* ms */ && *delay_off == 0 /* ms */) {
 		/* Special case: the leds subsystem requested us to
 		 * chose one user friendly blinking of the LED, and
@@ -142,8 +135,6 @@ static int clevo_mail_led_blink(struct led_classdev *led_cdev,
 		       *delay_on, *delay_off);
 	}
 
-	i8042_unlock_chip();
-
 	return status;
 }
 
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 60c18f21588dd..6cb6f800503b2 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1044,9 +1044,7 @@ static acpi_status WMID_set_u32(u32 value, u32 cap)
 			return AE_BAD_PARAMETER;
 		if (quirks->mailled == 1) {
 			param = value ? 0x92 : 0x93;
-			i8042_lock_chip();
 			i8042_command(&param, 0x1059);
-			i8042_unlock_chip();
 			return 0;
 		}
 		break;
diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c
index 493e169c8f615..c981c6e07ff94 100644
--- a/drivers/platform/x86/amilo-rfkill.c
+++ b/drivers/platform/x86/amilo-rfkill.c
@@ -28,12 +28,8 @@
 static int amilo_a1655_rfkill_set_block(void *data, bool blocked)
 {
 	u8 param = blocked ? A1655_WIFI_OFF : A1655_WIFI_ON;
-	int rc;
 
-	i8042_lock_chip();
-	rc = i8042_command(&param, A1655_WIFI_COMMAND);
-	i8042_unlock_chip();
-	return rc;
+	return i8042_command(&param, A1655_WIFI_COMMAND);
 }
 
 static const struct rfkill_ops amilo_a1655_rfkill_ops = {
diff --git a/include/linux/i8042.h b/include/linux/i8042.h
index 0261e2fb36364..1c081081c161d 100644
--- a/include/linux/i8042.h
+++ b/include/linux/i8042.h
@@ -55,8 +55,6 @@ struct serio;
 
 #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
 
-void i8042_lock_chip(void);
-void i8042_unlock_chip(void);
 int i8042_command(unsigned char *param, int command);
 int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
 					struct serio *serio));
@@ -65,14 +63,6 @@ int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
 
 #else
 
-static inline void i8042_lock_chip(void)
-{
-}
-
-static inline void i8042_unlock_chip(void)
-{
-}
-
 static inline int i8042_command(unsigned char *param, int command)
 {
 	return -ENODEV;
-- 
2.28.0.297.g1956fa8f8d-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] Input: i8042 - Lock i8042_mutex before flushing
  2020-08-27 20:41 [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Raul E Rangel
@ 2020-08-27 20:41 ` Raul E Rangel
  2020-10-28 20:35 ` [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Hans de Goede
  2020-12-07  6:40 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Raul E Rangel @ 2020-08-27 20:41 UTC (permalink / raw)
  To: linux-input
  Cc: dmitry.torokhov, Shirish.S, Raul E Rangel, Rajat Jain,
	Stephen Boyd, linux-kernel

Make i8042_flush lock the i8042_mutex before flushing the buffer. This
will prevent i8042_flush from clearing the buffer while a PS/2 command is
in progress. I'm not sure if this is really possible. We already
hold the lock when calling i8042_command, so this makes i8042_flush have
the same behavior.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
---

(no changes since v1)

 drivers/input/serio/i8042.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 65ca6b47f41e8..b7ed93c5095c4 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -254,6 +254,8 @@ static int i8042_flush(void)
 	int count = 0;
 	int retval = 0;
 
+	mutex_lock(&i8042_mutex);
+
 	spin_lock_irqsave(&i8042_lock, flags);
 
 	while ((str = i8042_read_status()) & I8042_STR_OBF) {
@@ -270,6 +272,8 @@ static int i8042_flush(void)
 
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
+	mutex_unlock(&i8042_mutex);
+
 	return retval;
 }
 
-- 
2.28.0.297.g1956fa8f8d-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands
  2020-08-27 20:41 [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Raul E Rangel
  2020-08-27 20:41 ` [PATCH v2 2/2] Input: i8042 - Lock i8042_mutex before flushing Raul E Rangel
@ 2020-10-28 20:35 ` Hans de Goede
  2020-12-07  6:40 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2020-10-28 20:35 UTC (permalink / raw)
  To: Raul E Rangel, linux-input
  Cc: dmitry.torokhov, Shirish.S, Andy Shevchenko, Dan Murphy,
	Darren Hart, Jacek Anaszewski, Lee, Chun-Yi, Pavel Machek,
	Rajat Jain, Stephen Boyd, linux-kernel, linux-leds,
	platform-driver-x86

Hi,

Quick self intro: I have take over drivers/platform/x86
maintainership from Andy; and I'm working my way through
the backlog of old patches in patchwork:
https://patchwork.kernel.org/project/platform-driver-x86/list/

On 8/27/20 10:41 PM, Raul E Rangel wrote:
> The i8042_mutex must be held by writers of the AUX and KBD ports, as
> well as users of i8042_command. There were a lot of users of
> i8042_command that were not calling i8042_lock_chip/i8042_unlock_chip.
> This resulted in i8042_commands being issues in between PS/2
> transactions.
> 
> This change moves the mutex lock into i8042_command and removes the
> burden of locking the mutex from the callers.
> 
> It is expected that the i8042_mutex is locked before calling
> i8042_aux_write or i8042_kbd_write. This is currently done by the PS/2
> layer via ps2_begin_command and ps2_end_command. Other modules
> (serio_raw) do not currently lock the mutex, so there is still a
> possibility for intermixed commands.
> 
> Link: https://lore.kernel.org/linux-input/CAHQZ30ANTeM-pgdYZ4AbgxsnevBJnJgKZ1Kg+Uy8oSXZUvz=og@mail.gmail.com
> Signed-off-by: Raul E Rangel <rrangel@chromium.org>

Patch looks good to me, you can add my:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

(for both the drivers/platform/x86 bits and in general).

Dmitry, feel free to merge this through the input tree, I don't
expect the touched pdx86 parts to see any changes this cycle.

Regards,

Hans





> ---
> Tested this on a device with only a PS/2 keyboard. I was able to do
> 1200+ suspend/resume cycles.
> 
> Also tested this on a device with a PS/2 keyboard and a PS/2 mouse.
> I was able to do 250+ iterations with out problems.
> 
> Changes in v2:
> - Fixed bad indent
> - Added Link: tag
> - Removed left over rc variable
> 
>  drivers/input/serio/i8042.c         | 29 ++++++++++++++---------------
>  drivers/leds/leds-clevo-mail.c      |  9 ---------
>  drivers/platform/x86/acer-wmi.c     |  2 --
>  drivers/platform/x86/amilo-rfkill.c |  6 +-----
>  include/linux/i8042.h               | 10 ----------
>  5 files changed, 15 insertions(+), 41 deletions(-)
> 
> diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
> index 0dddf273afd94..65ca6b47f41e8 100644
> --- a/drivers/input/serio/i8042.c
> +++ b/drivers/input/serio/i8042.c
> @@ -137,8 +137,7 @@ static DEFINE_SPINLOCK(i8042_lock);
>  
>  /*
>   * Writers to AUX and KBD ports as well as users issuing i8042_command
> - * directly should acquire i8042_mutex (by means of calling
> - * i8042_lock_chip() and i8042_unlock_ship() helpers) to ensure that
> + * directly should acquire i8042_mutex to ensure that
>   * they do not disturb each other (unfortunately in many i8042
>   * implementations write to one of the ports will immediately abort
>   * command that is being processed by another port).
> @@ -173,18 +172,6 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id);
>  static bool (*i8042_platform_filter)(unsigned char data, unsigned char str,
>  				     struct serio *serio);
>  
> -void i8042_lock_chip(void)
> -{
> -	mutex_lock(&i8042_mutex);
> -}
> -EXPORT_SYMBOL(i8042_lock_chip);
> -
> -void i8042_unlock_chip(void)
> -{
> -	mutex_unlock(&i8042_mutex);
> -}
> -EXPORT_SYMBOL(i8042_unlock_chip);
> -
>  int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
>  					struct serio *serio))
>  {
> @@ -343,10 +330,14 @@ int i8042_command(unsigned char *param, int command)
>  	unsigned long flags;
>  	int retval;
>  
> +	mutex_lock(&i8042_mutex);
> +
>  	spin_lock_irqsave(&i8042_lock, flags);
>  	retval = __i8042_command(param, command);
>  	spin_unlock_irqrestore(&i8042_lock, flags);
>  
> +	mutex_unlock(&i8042_mutex);
> +
>  	return retval;
>  }
>  EXPORT_SYMBOL(i8042_command);
> @@ -379,10 +370,18 @@ static int i8042_kbd_write(struct serio *port, unsigned char c)
>  static int i8042_aux_write(struct serio *serio, unsigned char c)
>  {
>  	struct i8042_port *port = serio->port_data;
> +	unsigned long flags;
> +	int retval = 0;
> +
> +	spin_lock_irqsave(&i8042_lock, flags);
>  
> -	return i8042_command(&c, port->mux == -1 ?
> +	retval = __i8042_command(&c, port->mux == -1 ?
>  					I8042_CMD_AUX_SEND :
>  					I8042_CMD_MUX_SEND + port->mux);
> +
> +	spin_unlock_irqrestore(&i8042_lock, flags);
> +
> +	return retval;
>  }
>  
>  
> diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
> index f512e99b976b1..6c3d7e54f95cf 100644
> --- a/drivers/leds/leds-clevo-mail.c
> +++ b/drivers/leds/leds-clevo-mail.c
> @@ -95,17 +95,12 @@ MODULE_DEVICE_TABLE(dmi, clevo_mail_led_dmi_table);
>  static void clevo_mail_led_set(struct led_classdev *led_cdev,
>  				enum led_brightness value)
>  {
> -	i8042_lock_chip();
> -
>  	if (value == LED_OFF)
>  		i8042_command(NULL, CLEVO_MAIL_LED_OFF);
>  	else if (value <= LED_HALF)
>  		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_0_5HZ);
>  	else
>  		i8042_command(NULL, CLEVO_MAIL_LED_BLINK_1HZ);
> -
> -	i8042_unlock_chip();
> -
>  }
>  
>  static int clevo_mail_led_blink(struct led_classdev *led_cdev,
> @@ -114,8 +109,6 @@ static int clevo_mail_led_blink(struct led_classdev *led_cdev,
>  {
>  	int status = -EINVAL;
>  
> -	i8042_lock_chip();
> -
>  	if (*delay_on == 0 /* ms */ && *delay_off == 0 /* ms */) {
>  		/* Special case: the leds subsystem requested us to
>  		 * chose one user friendly blinking of the LED, and
> @@ -142,8 +135,6 @@ static int clevo_mail_led_blink(struct led_classdev *led_cdev,
>  		       *delay_on, *delay_off);
>  	}
>  
> -	i8042_unlock_chip();
> -
>  	return status;
>  }
>  
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 60c18f21588dd..6cb6f800503b2 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -1044,9 +1044,7 @@ static acpi_status WMID_set_u32(u32 value, u32 cap)
>  			return AE_BAD_PARAMETER;
>  		if (quirks->mailled == 1) {
>  			param = value ? 0x92 : 0x93;
> -			i8042_lock_chip();
>  			i8042_command(&param, 0x1059);
> -			i8042_unlock_chip();
>  			return 0;
>  		}
>  		break;
> diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c
> index 493e169c8f615..c981c6e07ff94 100644
> --- a/drivers/platform/x86/amilo-rfkill.c
> +++ b/drivers/platform/x86/amilo-rfkill.c
> @@ -28,12 +28,8 @@
>  static int amilo_a1655_rfkill_set_block(void *data, bool blocked)
>  {
>  	u8 param = blocked ? A1655_WIFI_OFF : A1655_WIFI_ON;
> -	int rc;
>  
> -	i8042_lock_chip();
> -	rc = i8042_command(&param, A1655_WIFI_COMMAND);
> -	i8042_unlock_chip();
> -	return rc;
> +	return i8042_command(&param, A1655_WIFI_COMMAND);
>  }
>  
>  static const struct rfkill_ops amilo_a1655_rfkill_ops = {
> diff --git a/include/linux/i8042.h b/include/linux/i8042.h
> index 0261e2fb36364..1c081081c161d 100644
> --- a/include/linux/i8042.h
> +++ b/include/linux/i8042.h
> @@ -55,8 +55,6 @@ struct serio;
>  
>  #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
>  
> -void i8042_lock_chip(void);
> -void i8042_unlock_chip(void);
>  int i8042_command(unsigned char *param, int command);
>  int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
>  					struct serio *serio));
> @@ -65,14 +63,6 @@ int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
>  
>  #else
>  
> -static inline void i8042_lock_chip(void)
> -{
> -}
> -
> -static inline void i8042_unlock_chip(void)
> -{
> -}
> -
>  static inline int i8042_command(unsigned char *param, int command)
>  {
>  	return -ENODEV;
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands
  2020-08-27 20:41 [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Raul E Rangel
  2020-08-27 20:41 ` [PATCH v2 2/2] Input: i8042 - Lock i8042_mutex before flushing Raul E Rangel
  2020-10-28 20:35 ` [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Hans de Goede
@ 2020-12-07  6:40 ` Dmitry Torokhov
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2020-12-07  6:40 UTC (permalink / raw)
  To: Raul E Rangel
  Cc: linux-input, Shirish.S, Andy Shevchenko, Dan Murphy, Darren Hart,
	Jacek Anaszewski, Lee, Chun-Yi, Pavel Machek, Rajat Jain,
	Stephen Boyd, linux-kernel, linux-leds, platform-driver-x86

Hi Raul,

On Thu, Aug 27, 2020 at 02:41:53PM -0600, Raul E Rangel wrote:
> The i8042_mutex must be held by writers of the AUX and KBD ports, as
> well as users of i8042_command. There were a lot of users of
> i8042_command that were not calling i8042_lock_chip/i8042_unlock_chip.
> This resulted in i8042_commands being issues in between PS/2
> transactions.
> 
> This change moves the mutex lock into i8042_command and removes the
> burden of locking the mutex from the callers.

I think there is a benefit for allowing users issue a sequence of
commands to i8042 without interruptions, so I would prefer keeping
i8042_[un]lock_chip() in place.

Given that the issue you were observing was caused by i8042_port_close()
interfering with probing, maybe we could do something like this:


diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index abae23af0791..aff871001eda 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -344,6 +344,8 @@ int i8042_command(unsigned char *param, int command)
 	unsigned long flags;
 	int retval;
 
+	lockdep_assert_held(&i8042_mutex);
+
 	if (!i8042_present)
 		return -1;
 
@@ -364,6 +366,8 @@ static int i8042_kbd_write(struct serio *port, unsigned char c)
 	unsigned long flags;
 	int retval = 0;
 
+	lockdep_assert_held(&i8042_mutex);
+
 	spin_lock_irqsave(&i8042_lock, flags);
 
 	if (!(retval = i8042_wait_write())) {
@@ -411,6 +415,8 @@ static void i8042_port_close(struct serio *serio)
 		port_name = "KBD";
 	}
 
+	i8042_lock_chip();
+
 	i8042_ctr &= ~irq_bit;
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
 		pr_warn("Can't write CTR while closing %s port\n", port_name);
@@ -422,6 +428,8 @@ static void i8042_port_close(struct serio *serio)
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
 		pr_err("Can't reactivate %s port\n", port_name);
 
+	i8042_unlock_chip();
+
 	/*
 	 * See if there is any data appeared while we were messing with
 	 * port state.


Thanks.

-- 
Dmitry

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 20:41 [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Raul E Rangel
2020-08-27 20:41 ` [PATCH v2 2/2] Input: i8042 - Lock i8042_mutex before flushing Raul E Rangel
2020-10-28 20:35 ` [PATCH v2 1/2] Input: i8042 - Prevent intermixing i8042 commands Hans de Goede
2020-12-07  6:40 ` Dmitry Torokhov

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