diff mbox series

[v2,1/4] gpiolib: acpi: Correct comment for HP x2 10 honor_wakeup quirk

Message ID 20200302111225.6641-1-hdegoede@redhat.com
State New
Headers show
Series [v2,1/4] gpiolib: acpi: Correct comment for HP x2 10 honor_wakeup quirk | expand

Commit Message

Hans de Goede March 2, 2020, 11:12 a.m. UTC
Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
quirk mechanism") added a quirk for some models of the HP x2 10 series.

There are 2 issues with the comment describing the quirk:
1) The comment claims the DMI quirk applies to all Cherry Trail based HP x2
   10 models. In the mean time I have learned that there are at least 3
   models of the HP x2 10 models:

   Bay Trail SoC + AXP288 PMIC
   Cherry Trail SoC + AXP288 PMIC
   Cherry Trail SoC + TI PMIC

   And this quirk's DMI matches only match the Cherry Trail SoC + TI PMIC
   SoC, which is good because we want a slightly different quirk for the
   others. This commit updates the comment to make it clear that the quirk
   is only for the Cherry Trail SoC + TI PMIC models.

2) The comment says that it is ok to disable wakeup on all ACPI GPIO event
   handlers, because there is only the one for the embedded-controller
   events. This is not true, there also is a handler for the special
   INT0002 device which is related to USB wakeups. We need to also disable
   wakeups on that one because the device turns of the USB-keyboard built
   into the dock when closing the lid. The XHCI controller takes a while
   to notice this, so it only notices it when already suspended, causing
   a spurious wakeup because of this. So disabling wakeup on all handlers
   is the right thing to do, but not because there only is the one handler
   for the EC events. This commit updates the comment to correctly reflect
   this.

Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpio/gpiolib-acpi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Mika Westerberg March 2, 2020, 2:23 p.m. UTC | #1
On Mon, Mar 02, 2020 at 12:12:22PM +0100, Hans de Goede wrote:
> Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
> quirk mechanism") added a quirk for some models of the HP x2 10 series.
> 
> There are 2 issues with the comment describing the quirk:
> 1) The comment claims the DMI quirk applies to all Cherry Trail based HP x2
>    10 models. In the mean time I have learned that there are at least 3
>    models of the HP x2 10 models:
> 
>    Bay Trail SoC + AXP288 PMIC
>    Cherry Trail SoC + AXP288 PMIC
>    Cherry Trail SoC + TI PMIC
> 
>    And this quirk's DMI matches only match the Cherry Trail SoC + TI PMIC
>    SoC, which is good because we want a slightly different quirk for the
>    others. This commit updates the comment to make it clear that the quirk
>    is only for the Cherry Trail SoC + TI PMIC models.
> 
> 2) The comment says that it is ok to disable wakeup on all ACPI GPIO event
>    handlers, because there is only the one for the embedded-controller
>    events. This is not true, there also is a handler for the special
>    INT0002 device which is related to USB wakeups. We need to also disable
>    wakeups on that one because the device turns of the USB-keyboard built
>    into the dock when closing the lid. The XHCI controller takes a while
>    to notice this, so it only notices it when already suspended, causing
>    a spurious wakeup because of this. So disabling wakeup on all handlers
>    is the right thing to do, but not because there only is the one handler
>    for the EC events. This commit updates the comment to correctly reflect
>    this.
> 
> Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")

Not sure if Fixes tag is needed if you only correct comment but fine :)

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

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Linus Walleij March 9, 2020, 8:40 a.m. UTC | #2
On Mon, Mar 2, 2020 at 12:12 PM Hans de Goede <hdegoede@redhat.com> wrote:

> Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
> quirk mechanism") added a quirk for some models of the HP x2 10 series.
>
> There are 2 issues with the comment describing the quirk:
> 1) The comment claims the DMI quirk applies to all Cherry Trail based HP x2
>    10 models. In the mean time I have learned that there are at least 3
>    models of the HP x2 10 models:
>
>    Bay Trail SoC + AXP288 PMIC
>    Cherry Trail SoC + AXP288 PMIC
>    Cherry Trail SoC + TI PMIC
>
>    And this quirk's DMI matches only match the Cherry Trail SoC + TI PMIC
>    SoC, which is good because we want a slightly different quirk for the
>    others. This commit updates the comment to make it clear that the quirk
>    is only for the Cherry Trail SoC + TI PMIC models.
>
> 2) The comment says that it is ok to disable wakeup on all ACPI GPIO event
>    handlers, because there is only the one for the embedded-controller
>    events. This is not true, there also is a handler for the special
>    INT0002 device which is related to USB wakeups. We need to also disable
>    wakeups on that one because the device turns of the USB-keyboard built
>    into the dock when closing the lid. The XHCI controller takes a while
>    to notice this, so it only notices it when already suspended, causing
>    a spurious wakeup because of this. So disabling wakeup on all handlers
>    is the right thing to do, but not because there only is the one handler
>    for the EC events. This commit updates the comment to correctly reflect
>    this.
>
> Fixes: aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Patch applied with Mika's ACK.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 31fee5e918b7..a77edd31dd60 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -1345,12 +1345,14 @@  static const struct dmi_system_id gpiolib_acpi_quirks[] = {
 	},
 	{
 		/*
-		 * Various HP X2 10 Cherry Trail models use an external
-		 * embedded-controller connected via I2C + an ACPI GPIO
-		 * event handler. The embedded controller generates various
-		 * spurious wakeup events when suspended. So disable wakeup
-		 * for its handler (it uses the only ACPI GPIO event handler).
-		 * This breaks wakeup when opening the lid, the user needs
+		 * HP X2 10 models with Cherry Trail SoC + TI PMIC use an
+		 * external embedded-controller connected via I2C + an ACPI GPIO
+		 * event handler on INT33FF:01 pin 0, causing spurious wakeups.
+		 * When suspending by closing the LID, the power to the USB
+		 * keyboard is turned off, causing INT0002 ACPI events to
+		 * trigger once the XHCI controller notices the keyboard is
+		 * gone. So INT0002 events cause spurious wakeups too. Ignoring
+		 * EC wakes breaks wakeup when opening the lid, the user needs
 		 * to press the power-button to wakeup the system. The
 		 * alternative is suspend simply not working, which is worse.
 		 */