Commit 7db0747b authored by Evan Green's avatar Evan Green Committed by Kleber Sacilotto de Souza

Input: atmel_mxt_ts - disable IRQ across suspend

BugLink: https://bugs.launchpad.net/bugs/1858462

[ Upstream commit 463fa44e ]

Across suspend and resume, we are seeing error messages like the following:

atmel_mxt_ts i2c-PRP0001:00: __mxt_read_reg: i2c transfer failed (-121)
atmel_mxt_ts i2c-PRP0001:00: Failed to read T44 and T5 (-121)

This occurs because the driver leaves its IRQ enabled. Upon resume, there
is an IRQ pending, but the interrupt is serviced before both the driver and
the underlying I2C bus have been resumed. This causes EREMOTEIO errors.

Disable the IRQ in suspend, and re-enable it on resume. If there are cases
where the driver enters suspend with interrupts disabled, that's a bug we
should fix separately.
Signed-off-by: default avatarEvan Green <evgreen@chromium.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 53faaaee
...@@ -2701,6 +2701,8 @@ static int __maybe_unused mxt_suspend(struct device *dev) ...@@ -2701,6 +2701,8 @@ static int __maybe_unused mxt_suspend(struct device *dev)
mutex_unlock(&input_dev->mutex); mutex_unlock(&input_dev->mutex);
disable_irq(data->irq);
return 0; return 0;
} }
...@@ -2713,6 +2715,8 @@ static int __maybe_unused mxt_resume(struct device *dev) ...@@ -2713,6 +2715,8 @@ static int __maybe_unused mxt_resume(struct device *dev)
if (!input_dev) if (!input_dev)
return 0; return 0;
enable_irq(data->irq);
mutex_lock(&input_dev->mutex); mutex_lock(&input_dev->mutex);
if (input_dev->users) if (input_dev->users)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment