]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.1
authorSasha Levin <sashal@kernel.org>
Fri, 3 Feb 2023 01:50:40 +0000 (20:50 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 3 Feb 2023 01:50:40 +0000 (20:50 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.1/gpiolib-acpi-add-a-ignore-wakeup-quirk-for-clevo-nl5.patch [new file with mode: 0644]
queue-6.1/gpiolib-acpi-don-t-set-gpios-for-wakeup-in-s3-mode.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/gpiolib-acpi-add-a-ignore-wakeup-quirk-for-clevo-nl5.patch b/queue-6.1/gpiolib-acpi-add-a-ignore-wakeup-quirk-for-clevo-nl5.patch
new file mode 100644 (file)
index 0000000..7fbe873
--- /dev/null
@@ -0,0 +1,61 @@
+From a30d12b87fb578d28f9aa5bdb57dd1cb78582ce1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 16 Jan 2023 13:37:02 -0600
+Subject: gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+[ Upstream commit 4cb786180dfb5258ff3111181b5e4ecb1d4a297b ]
+
+commit 1796f808e4bb ("HID: i2c-hid: acpi: Stop setting wakeup_capable")
+changed the policy such that I2C touchpads may be able to wake up the
+system by default if the system is configured as such.
+
+However on Clevo NL5xRU there is a mistake in the ACPI tables that the
+TP_ATTN# signal connected to GPIO 9 is configured as ActiveLow and level
+triggered but connected to a pull up. As soon as the system suspends the
+touchpad loses power and then the system wakes up.
+
+To avoid this problem, introduce a quirk for this model that will prevent
+the wakeup capability for being set for GPIO 9.
+
+Fixes: 1796f808e4bb ("HID: i2c-hid: acpi: Stop setting wakeup_capable")
+Reported-by: Werner Sembach <wse@tuxedocomputers.com>
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1720627
+Co-developed-by: Werner Sembach <wse@tuxedocomputers.com>
+Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpiolib-acpi.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
+index 27f234637a15..e2ab4d5253be 100644
+--- a/drivers/gpio/gpiolib-acpi.c
++++ b/drivers/gpio/gpiolib-acpi.c
+@@ -1599,6 +1599,19 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] __initconst = {
+                       .ignore_interrupt = "AMDI0030:00@18",
+               },
+       },
++      {
++              /*
++               * Spurious wakeups from TP_ATTN# pin
++               * Found in BIOS 1.7.8
++               * https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1720627
++               */
++              .matches = {
++                      DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
++              },
++              .driver_data = &(struct acpi_gpiolib_dmi_quirk) {
++                      .ignore_wake = "ELAN0415:00@9",
++              },
++      },
+       {} /* Terminating entry */
+ };
+-- 
+2.39.0
+
diff --git a/queue-6.1/gpiolib-acpi-don-t-set-gpios-for-wakeup-in-s3-mode.patch b/queue-6.1/gpiolib-acpi-don-t-set-gpios-for-wakeup-in-s3-mode.patch
new file mode 100644 (file)
index 0000000..c2e5d33
--- /dev/null
@@ -0,0 +1,52 @@
+From b063e295dfc6464dc2567c6911eece9f21d1afb7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 21 Jan 2023 07:48:11 -0600
+Subject: gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+[ Upstream commit d63f11c02b8d3e54bdb65d8c309f73b7f474aec4 ]
+
+commit 1796f808e4bb ("HID: i2c-hid: acpi: Stop setting wakeup_capable")
+adjusted the policy to enable wakeup by default if the ACPI tables
+indicated that a device was wake capable.
+
+It was reported however that this broke suspend on at least two System76
+systems in S3 mode and two Lenovo Gen2a systems, but only with S3.
+When the machines are set to s2idle, wakeup behaves properly.
+
+Configuring the GPIOs for wakeup with S3 doesn't work properly, so only
+set it when the system supports low power idle.
+
+Fixes: 1796f808e4bb ("HID: i2c-hid: acpi: Stop setting wakeup_capable")
+Fixes: b38f2d5d9615c ("i2c: acpi: Use ACPI wake capability bit to set wake_irq")
+Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2357
+Link: https://bugzilla.redhat.com/show_bug.cgi?id=2162013
+Reported-by: Nathan Smythe <ncsmythe@scruboak.org>
+Tested-by: Nathan Smythe <ncsmythe@scruboak.org>
+Suggested-by: Raul Rangel <rrangel@chromium.org>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpiolib-acpi.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
+index e2ab4d5253be..fa3de3c3010c 100644
+--- a/drivers/gpio/gpiolib-acpi.c
++++ b/drivers/gpio/gpiolib-acpi.c
+@@ -1080,7 +1080,8 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, in
+                               dev_dbg(&adev->dev, "IRQ %d already in use\n", irq);
+                       }
+-                      if (wake_capable)
++                      /* avoid suspend issues with GPIOs when systems are using S3 */
++                      if (wake_capable && acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
+                               *wake_capable = info.wake_capable;
+                       return irq;
+-- 
+2.39.0
+
index 86da3125d823d424149bc27e96ce1e08bb95ff4a..c83321d223eb101abc404070b3c4f046b6b2020d 100644 (file)
@@ -21,3 +21,5 @@ dmaengine-imx-sdma-fix-a-possible-memory-leak-in-sdm.patch
 gpiolib-acpi-allow-ignoring-wake-capability-on-pins-.patch
 cifs-fix-return-of-uninitialized-rc-in-dfs_cache_upd.patch
 nvme-apple-only-reset-the-controller-when-rtkit-is-r.patch
+gpiolib-acpi-add-a-ignore-wakeup-quirk-for-clevo-nl5.patch
+gpiolib-acpi-don-t-set-gpios-for-wakeup-in-s3-mode.patch