* [PATCH 0/2] Fix a spurious wakeup regression
@ 2023-01-16 19:37 Mario Limonciello
2023-01-16 19:37 ` [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI Mario Limonciello
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
0 siblings, 2 replies; 8+ messages in thread
From: Mario Limonciello @ 2023-01-16 19:37 UTC (permalink / raw)
To: Dmitry Torokhov, Benjamin Tissoires, Raul E Rangel, linux-gpio,
linux-acpi
Cc: regressions, Mario Limonciello, linux-kernel
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.
This had an unintended consequence on a Clevo NL50RU where the system
would wakeup immediately after suspending the system.
Reviewing the schematics and ACPI tables this appears to be a bug in
the ACPI tables, but it was exposed by that change.
To avoid the system waking up immediately after suspend disable wakeups
by default on this system.
Mario Limonciello (2):
gpiolib: acpi: Allow ignoring wake capability on pins that aren't in
_AEI
gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
drivers/gpio/gpiolib-acpi.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI
2023-01-16 19:37 [PATCH 0/2] Fix a spurious wakeup regression Mario Limonciello
@ 2023-01-16 19:37 ` Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
1 sibling, 1 reply; 8+ messages in thread
From: Mario Limonciello @ 2023-01-16 19:37 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko, Linus Walleij,
Bartosz Golaszewski
Cc: regressions, Mario Limonciello, Raul Rangel, linux-gpio,
linux-acpi, linux-kernel
Using the `ignore_wake` quirk or module parameter doesn't work for any pin
that has been specified in the _CRS instead of _AEI.
Extend the `acpi_gpio_irq_is_wake` check to cover both places.
Suggested-by: Raul Rangel <rrangel@chromium.org>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1722335
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/gpio/gpiolib-acpi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index bed0380c51360..4287555a12408 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -385,7 +385,7 @@ static bool acpi_gpio_in_ignore_list(const char *ignore_list, const char *contro
}
static bool acpi_gpio_irq_is_wake(struct device *parent,
- struct acpi_resource_gpio *agpio)
+ const struct acpi_resource_gpio *agpio)
{
unsigned int pin = agpio->pin_table[0];
@@ -778,7 +778,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
lookup->info.pin_config = agpio->pin_config;
lookup->info.debounce = agpio->debounce_timeout;
lookup->info.gpioint = gpioint;
- lookup->info.wake_capable = agpio->wake_capable == ACPI_WAKE_CAPABLE;
+ lookup->info.wake_capable = acpi_gpio_irq_is_wake(&lookup->info.adev->dev, agpio);
/*
* Polarity and triggering are only specified for GpioInt
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
2023-01-16 19:37 [PATCH 0/2] Fix a spurious wakeup regression Mario Limonciello
2023-01-16 19:37 ` [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI Mario Limonciello
@ 2023-01-16 19:37 ` Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
` (2 more replies)
1 sibling, 3 replies; 8+ messages in thread
From: Mario Limonciello @ 2023-01-16 19:37 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko, Linus Walleij,
Bartosz Golaszewski, Dmitry Torokhov, Raul E Rangel,
Benjamin Tissoires
Cc: regressions, Mario Limonciello, Werner Sembach, linux-gpio,
linux-acpi, linux-kernel
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>
---
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 4287555a12408..9ef0f5641b521 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -1623,6 +1623,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.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI
2023-01-16 19:37 ` [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI Mario Limonciello
@ 2023-01-17 8:33 ` Andy Shevchenko
0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-17 8:33 UTC (permalink / raw)
To: Mario Limonciello
Cc: Mika Westerberg, Linus Walleij, Bartosz Golaszewski, regressions,
Raul Rangel, linux-gpio, linux-acpi, linux-kernel
On Mon, Jan 16, 2023 at 01:37:01PM -0600, Mario Limonciello wrote:
> Using the `ignore_wake` quirk or module parameter doesn't work for any pin
> that has been specified in the _CRS instead of _AEI.
>
> Extend the `acpi_gpio_irq_is_wake` check to cover both places.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Suggested-by: Raul Rangel <rrangel@chromium.org>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1722335
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> drivers/gpio/gpiolib-acpi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index bed0380c51360..4287555a12408 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -385,7 +385,7 @@ static bool acpi_gpio_in_ignore_list(const char *ignore_list, const char *contro
> }
>
> static bool acpi_gpio_irq_is_wake(struct device *parent,
> - struct acpi_resource_gpio *agpio)
> + const struct acpi_resource_gpio *agpio)
> {
> unsigned int pin = agpio->pin_table[0];
>
> @@ -778,7 +778,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
> lookup->info.pin_config = agpio->pin_config;
> lookup->info.debounce = agpio->debounce_timeout;
> lookup->info.gpioint = gpioint;
> - lookup->info.wake_capable = agpio->wake_capable == ACPI_WAKE_CAPABLE;
> + lookup->info.wake_capable = acpi_gpio_irq_is_wake(&lookup->info.adev->dev, agpio);
>
> /*
> * Polarity and triggering are only specified for GpioInt
> --
> 2.34.1
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
@ 2023-01-17 8:33 ` Andy Shevchenko
2023-01-18 14:26 ` Bartosz Golaszewski
2023-01-18 20:44 ` Linus Walleij
2 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-01-17 8:33 UTC (permalink / raw)
To: Mario Limonciello
Cc: Mika Westerberg, Linus Walleij, Bartosz Golaszewski,
Dmitry Torokhov, Raul E Rangel, Benjamin Tissoires, regressions,
Werner Sembach, linux-gpio, linux-acpi, linux-kernel
On Mon, Jan 16, 2023 at 01:37:02PM -0600, Mario Limonciello wrote:
> 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.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 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>
> ---
> 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 4287555a12408..9ef0f5641b521 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -1623,6 +1623,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.34.1
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
@ 2023-01-18 14:26 ` Bartosz Golaszewski
2023-01-18 20:44 ` Linus Walleij
2 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2023-01-18 14:26 UTC (permalink / raw)
To: Mario Limonciello
Cc: Mika Westerberg, Andy Shevchenko, Linus Walleij, Dmitry Torokhov,
Raul E Rangel, Benjamin Tissoires, regressions, Werner Sembach,
linux-gpio, linux-acpi, linux-kernel
On Mon, Jan 16, 2023 at 8:37 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> 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>
> ---
> 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 4287555a12408..9ef0f5641b521 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -1623,6 +1623,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.34.1
>
Queued for fixes, thanks!
Bart
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
2023-01-18 14:26 ` Bartosz Golaszewski
@ 2023-01-18 20:44 ` Linus Walleij
2023-01-18 20:50 ` Limonciello, Mario
2 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2023-01-18 20:44 UTC (permalink / raw)
To: Mario Limonciello
Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
Dmitry Torokhov, Raul E Rangel, Benjamin Tissoires, regressions,
Werner Sembach, linux-gpio, linux-acpi, linux-kernel
On Mon, Jan 16, 2023 at 8:37 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:
> 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.
Now that is what I call proper root cause analysis. Hats off for this patch!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
2023-01-18 20:44 ` Linus Walleij
@ 2023-01-18 20:50 ` Limonciello, Mario
0 siblings, 0 replies; 8+ messages in thread
From: Limonciello, Mario @ 2023-01-18 20:50 UTC (permalink / raw)
To: Linus Walleij
Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
Dmitry Torokhov, Raul E Rangel, Benjamin Tissoires,
regressions@lists.linux.dev, Werner Sembach,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
[Public]
> -----Original Message-----
> From: Linus Walleij <linus.walleij@linaro.org>
> Sent: Wednesday, January 18, 2023 14:45
> To: Limonciello, Mario <Mario.Limonciello@amd.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; Bartosz Golaszewski
> <brgl@bgdev.pl>; Dmitry Torokhov <dmitry.torokhov@gmail.com>; Raul E
> Rangel <rrangel@chromium.org>; Benjamin Tissoires
> <benjamin.tissoires@redhat.com>; regressions@lists.linux.dev; Werner
> Sembach <wse@tuxedocomputers.com>; linux-gpio@vger.kernel.org; linux-
> acpi@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo
> NL5xRU
>
> On Mon, Jan 16, 2023 at 8:37 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>
> > 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.
>
> Now that is what I call proper root cause analysis. Hats off for this patch!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Raul should get some credit too here in the confirmation on that root cause.
It certainly really helps that the schematics for this system were readily available
on the web to confirm the hypothesis.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-01-18 20:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 19:37 [PATCH 0/2] Fix a spurious wakeup regression Mario Limonciello
2023-01-16 19:37 ` [PATCH 1/2] gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
2023-01-16 19:37 ` [PATCH 2/2] gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU Mario Limonciello
2023-01-17 8:33 ` Andy Shevchenko
2023-01-18 14:26 ` Bartosz Golaszewski
2023-01-18 20:44 ` Linus Walleij
2023-01-18 20:50 ` Limonciello, Mario
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox