From: Sasha Levin Date: Fri, 3 Feb 2023 01:50:40 +0000 (-0500) Subject: Fixes for 6.1 X-Git-Tag: v4.14.305~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d28b536da2be4b0d804e28d4ece0577f586e7e41;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.1 Signed-off-by: Sasha Levin --- 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 index 00000000000..7fbe8732e17 --- /dev/null +++ b/queue-6.1/gpiolib-acpi-add-a-ignore-wakeup-quirk-for-clevo-nl5.patch @@ -0,0 +1,61 @@ +From a30d12b87fb578d28f9aa5bdb57dd1cb78582ce1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Jan 2023 13:37:02 -0600 +Subject: gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU + +From: Mario Limonciello + +[ 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 +Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1720627 +Co-developed-by: Werner Sembach +Signed-off-by: Werner Sembach +Signed-off-by: Mario Limonciello +Reviewed-by: Andy Shevchenko +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + 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 index 00000000000..c2e5d33b0e0 --- /dev/null +++ b/queue-6.1/gpiolib-acpi-don-t-set-gpios-for-wakeup-in-s3-mode.patch @@ -0,0 +1,52 @@ +From b063e295dfc6464dc2567c6911eece9f21d1afb7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 21 Jan 2023 07:48:11 -0600 +Subject: gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode + +From: Mario Limonciello + +[ 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 +Tested-by: Nathan Smythe +Suggested-by: Raul Rangel +Signed-off-by: Mario Limonciello +Acked-by: Andy Shevchenko +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + 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 + diff --git a/queue-6.1/series b/queue-6.1/series index 86da3125d82..c83321d223e 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -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