All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix spurious wakes on ACPI platforms
@ 2021-12-20 23:43 Raul E Rangel
  2021-12-20 23:43 ` [PATCH 1/3] HID: i2c-hid-acpi: Remove explicit device_set_wakeup_capable Raul E Rangel
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Raul E Rangel @ 2021-12-20 23:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: mario.limonciello, linux-input, dianders, Raul E Rangel,
	Andy Shevchenko, Benjamin Tissoires, Benson Leung,
	Dmitry Torokhov, Enric Balletbo i Serra, Guenter Roeck,
	Gwendal Grignou, Hans de Goede, Jiri Kosina, Prashant Malani,
	jingle.wu

d62bd5ce12d7 ("pinctrl: amd: Implement irq_set_wake") gave the kernel
the ability to control the GPIO wake bit on AMD platforms. This
uncovered various drivers that were manually managing their wake
capabilities. This is problematic on ACPI systems because the ACPI
subsystem is responsible for managing the wake capabilities for the
device. ACPI devices need to define the `_PRW` property that defines the
GPE or GPIO that will be used to wake the system, and also the power
resources that must be enabled for the device to issue a wake.

The following real world example shows the problem:
* We have an ACPI HID device that has a power resource defined in `_PR0`
  and `_PR3`. It doesn't have `_PRW` so that means the device can't wake
  the system.
* The IRQ line is active level low for this device and is pulled up by the
  power resource defined in `_PR0`/`_PR3`.

The i2c-hid driver manually sets the device as wake capable, and the wake
flag gets set on the IRQ GPIO when entering suspend. As part of suspend,
ACPI will turn off the devices power resources since the device isn't a
wake source. This immediately triggers a wake because the IRQ line is
now low.

For devices that are marked as being wake capable (via `_PRW`), they
might use GPEs for wakes, while others might use the GPIO controller
(via _AEI). We need to respect the firmware configuration so we don't
have both the GPE and GPIO triggering a wake.

So when using ACPI, the correct thing to do is remove the driver from
managing the wake configuration. The ACPI subsystem has more knowledge of
the platform topology than the driver does.

This patch series fixes a few drivers that I noticed were incorrectly
setting the GPIO wake bit on my Guybrush Chromebook. I'm sure there will
be more.

I will be OOO until the New Year, so my responses will be delayed.


Raul E Rangel (3):
  HID: i2c-hid-acpi: Remove explicit device_set_wakeup_capable
  Input: elan_i2c - Use PM subsystem to manage wake irq
  platform/chrome: cros_ec: Don't enable wake pin if ACPI managed

 drivers/hid/i2c-hid/i2c-hid-acpi.c          |  5 -----
 drivers/input/mouse/elan_i2c_core.c         | 21 +++++++--------------
 drivers/platform/chrome/cros_ec.c           |  8 ++++++--
 include/linux/platform_data/cros_ec_proto.h |  1 -
 4 files changed, 13 insertions(+), 22 deletions(-)

-- 
2.34.1.307.g9b7440fafd-goog


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-01-31 12:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 23:43 [PATCH 0/3] Fix spurious wakes on ACPI platforms Raul E Rangel
2021-12-20 23:43 ` [PATCH 1/3] HID: i2c-hid-acpi: Remove explicit device_set_wakeup_capable Raul E Rangel
2021-12-21 18:49   ` Hans de Goede
2021-12-21 23:40     ` Raul Rangel
2021-12-23  8:41       ` Hans de Goede
2021-12-21 23:51     ` Raul Rangel
2021-12-20 23:43 ` [PATCH 2/3] Input: elan_i2c - Use PM subsystem to manage wake irq Raul E Rangel
2021-12-21  2:41   ` Dmitry Torokhov
2021-12-21 18:13     ` Raul Rangel
2021-12-23 14:42     ` Hans de Goede
2021-12-23 21:21       ` Dmitry Torokhov
2021-12-24 11:11         ` Hans de Goede
2021-12-25 13:51           ` Kai-Heng Feng
2022-01-31 12:41             ` Hans de Goede
2021-12-20 23:43 ` [PATCH 3/3] platform/chrome: cros_ec: Don't enable wake pin if ACPI managed Raul E Rangel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.