linux/drivers/acpi
Rajat Jain 2f844b61db ACPI: PM: Set enable_for_wake for wakeup GPEs during suspend-to-idle
I noticed that recently multiple systems (chromebooks) couldn't wake
from S0ix using LID or Keyboard after updating to a newer kernel. I
bisected and it turned up commit f941d3e41d ("ACPI: EC / PM: Disable
non-wakeup GPEs for suspend-to-idle"). I checked that the issue got
fixed if that commit was reverted.

I debugged and found that although PNP0C0D:00 (representing the LID)
is wake capable and should wakeup the system per the code in
acpi_wakeup_gpe_init() and in drivers/acpi/button.c:

localhost /sys # cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
LID0      S4    *enabled   platform:PNP0C0D:00
CREC      S5    *disabled  platform:GOOG0004:00
                *disabled  platform:cros-ec-dev.1.auto
                *disabled  platform:cros-ec-accel.0
                *disabled  platform:cros-ec-accel.1
                *disabled  platform:cros-ec-gyro.0
                *disabled  platform:cros-ec-ring.0
                *disabled  platform:cros-usbpd-charger.2.auto
                *disabled  platform:cros-usbpd-logger.3.auto
D015      S3    *enabled   i2c:i2c-ELAN0000:00
PENH      S3    *enabled   platform:PRP0001:00
XHCI      S3    *enabled   pci:0000:00:14.0
GLAN      S4    *disabled
WIFI      S3    *disabled  pci:0000:00:14.3
localhost /sys #

On debugging, I found that its corresponding GPE is not being enabled.
The particular GPE's "gpe_register_info->enable_for_wake" does not
have any bits set when acpi_enable_all_wakeup_gpes() comes around to
use it. I looked at code and could not find any other code path that
should set the bits in "enable_for_wake" bitmask for the wake enabled
devices for s2idle.  [I do see that it happens for S3 in
acpi_sleep_prepare()].

Thus I used the same call to enable the GPEs for wake enabled devices,
and verified that this fixes the regression I was seeing on multiple
of my devices.

[ rjw: The problem is that commit f941d3e41d ("ACPI: EC / PM:
  Disable non-wakeup GPEs for suspend-to-idle") forgot to add
  the acpi_enable_wakeup_devices() call for s2idle along with
  acpi_enable_all_wakeup_gpes(). ]

Fixes: f941d3e41d ("ACPI: EC / PM: Disable non-wakeup GPEs for suspend-to-idle")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=203579
Signed-off-by: Rajat Jain <rajatja@google.com>
[ rjw: Subject & changelog ]
Cc: 5.0+ <stable@vger.kernel.org> # 5.0+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-05-14 11:02:09 +02:00
..
acpica Merge branch 'acpica' 2019-05-06 10:49:01 +02:00
apei Merge branch 'acpi-apei' 2019-03-04 11:16:35 +01:00
arm64 Merge branch 'for-next/perf' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into for-next/core 2019-05-03 10:18:08 +01:00
dptf ACPI / DPTF: Use dev_get_drvdata() 2019-04-23 10:57:12 +02:00
nfit libnvdimm/security, acpi/nfit: unify zero-key for all security commands 2019-03-30 08:27:07 -07:00
pmic Linux 5.0-rc7 2019-02-18 13:27:15 +10:00
x86 ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book 2019-02-15 00:19:58 +01:00
ac.c ACPI updates for 4.18-rc1 2018-06-05 10:08:27 -07:00
acpi_adxl.c ACPI/ADXL: Add address translation interface using an ACPI DSM 2018-10-16 10:03:00 +02:00
acpi_amba.c
acpi_apd.c ACPI / APD: Add clock frequency for Hisilicon Hip08 SPI controller 2018-12-11 12:16:41 +01:00
acpi_cmos_rtc.c
acpi_configfs.c ACPICA: Rename nameseg length macro/define for clarity 2019-04-09 11:24:48 +02:00
acpi_dbg.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
acpi_extlog.c ACPI: Switch to use generic guid_t in acpi_evaluate_dsm() 2017-06-07 12:20:49 +02:00
acpi_ipmi.c acpi:ipmi: Convert ipmi_user_t to struct ipmi_user * 2018-09-18 16:15:33 -05:00
acpi_lpat.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
acpi_lpit.c ACPI / PM: LPIT: Register sysfs attributes based on FADT 2018-10-04 09:01:06 +02:00
acpi_lpss.c ACPI / LPSS: Use acpi_lpss_* instead of acpi_subsys_* functions for hibernate 2019-04-18 16:46:45 +02:00
acpi_memhotplug.c mm/memory_hotplug: make add_memory() take the device_hotplug_lock 2018-10-31 08:54:17 -07:00
acpi_pad.c ACPI: Add Hygon Dhyana support 2018-09-27 18:29:00 +02:00
acpi_platform.c ACPI / platform: Add SMB0001 HID to forbidden_id_list 2018-11-21 13:30:13 +01:00
acpi_pnp.c
acpi_processor.c ACPI / processor: Fix the return value of acpi_processor_ids_walk() 2018-10-04 08:58:32 +02:00
acpi_tad.c ACPI: TAD: Add low-level support for real time capability 2018-10-18 09:11:53 +02:00
acpi_video.c ACPI / video: Extend chassis-type detection with a "Lunch Box" check 2019-02-13 23:38:34 +01:00
acpi_watchdog.c ACPI / watchdog: Prefer iTCO_wdt always when WDAT table uses RTC SRAM 2018-05-24 10:52:49 +02:00
battery.c ACPI / battery: Do not export energy_full[_design] on devices without full_charge_capacity 2018-08-09 10:49:35 +02:00
bgrt.c ACPI: BGRT: constify attribute_group structures 2017-07-04 22:15:20 +02:00
blacklist.c dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
bus.c ACPI: use different default debug value than ACPICA 2019-03-25 10:45:59 +01:00
button.c ACPI: button: reinitialize button state upon resume 2019-04-12 10:29:01 +02:00
cm_sbs.c
container.c
cppc_acpi.c Merge branches 'acpi-scan', 'acpi-tables', 'acpi-misc' and 'acpi-pm' 2019-05-06 10:49:39 +02:00
custom_method.c ACPI: no need to check return value of debugfs_create functions 2019-01-22 19:45:52 +01:00
debugfs.c
device_pm.c ACPI: PM: Print debug messages when enabling GPEs for wakeup 2019-04-08 12:54:25 +02:00
device_sysfs.c ACPI / device_sysfs: Avoid OF modalias creation for removed device 2019-03-12 09:56:18 +01:00
dock.c ACPI: Mark expected switch fall-throughs 2017-11-09 00:55:16 +01:00
ec_sys.c ACPI: no need to check return value of debugfs_create functions 2019-01-22 19:45:52 +01:00
ec.c Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" 2019-02-01 12:56:49 +01:00
event.c ACPI: event: replace strcpy() by strscpy() 2019-04-23 10:54:26 +02:00
evged.c ACPI: GED: unregister interrupts during shutdown 2017-12-16 03:05:37 +01:00
fan.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
glue.c ACPI / glue: Add acpi_platform_notify() function 2018-11-26 18:19:11 +01:00
hed.c
internal.h ACPI: EC: Clean up probing for early EC 2019-01-29 11:01:30 +01:00
ioapic.c ACPI: fix whitespace in pr_fmt() to align log entries 2017-06-22 02:18:20 +02:00
irq.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
Kconfig ACPI / tables: table override from built-in initrd 2019-01-14 11:42:18 +01:00
Makefile ACPI / LPSS: Make PCI dependency explicit 2019-01-15 23:16:18 +01:00
numa.c device-dax for 5.1 2019-03-16 13:05:32 -07:00
nvs.c
osi.c ACPI / OSI: Add OEM _OSI string to enable dGPU direct output 2018-12-18 11:06:05 +01:00
osl.c ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset 2018-12-20 10:19:49 +01:00
pci_irq.c ACPI / PCI: fix GIC irq model default PCI IRQ polarity 2016-09-10 02:50:50 +02:00
pci_link.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
pci_mcfg.c PCI/ACPI: Add ThunderX pass2.x 2nd node MCFG quirk 2017-04-24 11:58:56 -05:00
pci_root.c PCI/ACPI: Allow _OSC presence to be optional for PCI 2018-09-17 16:32:24 -05:00
pci_slot.c dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
power.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
pptt.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor_core.c xen/ACPI: don't upload Px/Cx data for disabled processors 2018-08-20 14:46:18 -04:00
processor_driver.c ACPI: processor: use dev_dbg() instead of dev_warn() when CPPC probe failed 2017-07-27 01:51:06 +02:00
processor_idle.c ACPI / processor: Set P_LVL{2,3} idle state descriptions 2019-02-18 11:29:13 +01:00
processor_pdc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor_perflib.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
processor_thermal.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
processor_throttling.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
property.c PCI / ACPI: Identify untrusted PCI devices 2018-12-05 12:01:55 +03:00
reboot.c ACPI: Allow CONFIG_PCI to be unset for reboot 2018-12-20 10:19:49 +01:00
resource.c ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting 2019-02-24 21:12:01 +01:00
sbs.c ACPI / SBS: Fix GPE storm on recent MacBookPro's 2018-10-08 08:41:35 +02:00
sbshc.c ACPI / SBS: Fix rare oops when removing modules 2018-10-08 08:41:35 +02:00
sbshc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
scan.c Merge branches 'acpi-scan', 'acpi-tables', 'acpi-misc' and 'acpi-pm' 2019-05-06 10:49:39 +02:00
sleep.c ACPI: PM: Set enable_for_wake for wakeup GPEs during suspend-to-idle 2019-05-14 11:02:09 +02:00
sleep.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spcr.c ACPI: Fix comment typos 2019-03-26 22:33:43 +01:00
sysfs.c ACPICA: Rename nameseg length macro/define for clarity 2019-04-09 11:24:48 +02:00
tables.c Merge branches 'acpi-scan', 'acpi-tables', 'acpi-misc' and 'acpi-pm' 2019-05-06 10:49:39 +02:00
thermal.c dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
utils.c ACPI / utils: Remove deprecated function since no user left 2019-04-01 11:00:16 +02:00
video_detect.c Merge branches 'acpi-utils', 'acpi-video', 'acpi-soc' and 'acpi-button' 2019-05-06 10:50:08 +02:00
wakeup.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00