tmp_suning_uos_patched/drivers/acpi
Rafael J. Wysocki 7b301750f7 ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake()
If the EC GPE status is not set after checking all of the other GPEs,
acpi_s2idle_wake() returns 'false', to indicate that the SCI event
that has just triggered is not a system wakeup one, but it does that
without canceling the pending wakeup and re-arming the SCI for system
wakeup which is a mistake, because it may cause s2idle_loop() to busy
spin until the next valid wakeup event.  [If that happens, the first
spurious wakeup is still pending after acpi_s2idle_wake() has
returned, so s2idle_enter() does nothing, acpi_s2idle_wake()
is called again and it sees that the SCI has triggered, but no GPEs
are active, so 'false' is returned again, and so on.]

Fix that by moving all of the GPE checking logic from
acpi_s2idle_wake() to acpi_ec_dispatch_gpe() and making the
latter return 'true' only if a non-EC GPE has triggered and
'false' otherwise, which will cause acpi_s2idle_wake() to
cancel the pending SCI wakeup and re-arm the SCI for system
wakeup regardless of the EC GPE status.

This also addresses a lockup observed on an Elitegroup EF20EA laptop
after attempting to wake it up from suspend-to-idle by a key press.

Fixes: d5406284ff ("ACPI: PM: s2idle: Refine active GPEs check")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=207603
Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Fixes: fdde0ff859 ("ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system")
Link: https://lore.kernel.org/linux-acpi/CAB4CAwdqo7=MvyG_PE+PGVfeA17AHF5i5JucgaKqqMX6mjArbQ@mail.gmail.com/
Reported-by: Chris Chiu <chiu@endlessm.com>
Tested-by: Chris Chiu <chiu@endlessm.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-05-11 10:11:38 +02:00
..
acpica Merge branch 'acpica' 2020-04-06 16:23:31 +02:00
apei x86/mm: split vmalloc_sync_all() 2020-03-21 18:56:06 -07:00
arm64 ACPI/IORT: Remove direct access of dev->iommu_fwspec 2020-03-27 11:12:19 +01:00
dptf ACPI: Update Tiger Lake ACPI device IDs 2020-04-01 13:20:21 +02:00
nfit Merge branch 'for-5.7/libnvdimm' into libnvdimm-for-next 2020-04-02 19:55:17 -07:00
numa ACPI: NUMA: Up-level "map to online node" functionality 2020-02-17 10:49:06 -08:00
pmic
x86 ACPI: Convert to new X86 CPU match macros 2020-03-24 21:30:50 +01:00
ac.c ACPI / AC: Cleanup DMI quirk table 2020-03-04 10:32:50 +01:00
acpi_adxl.c
acpi_amba.c
acpi_apd.c ACPI / APD: Add clock frequency for Hisilicon Hip08-Lite I2C controller 2020-02-03 12:03:18 +01:00
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c ACPI: Convert to new X86 CPU match macros 2020-03-24 21:30:50 +01:00
acpi_memhotplug.c
acpi_pad.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c
acpi_tad.c
acpi_video.c ACPI: video: remove redundant assignments to variable result 2020-03-04 10:43:04 +01:00
acpi_watchdog.c ACPI: watchdog: Fix gas->access_width usage 2020-02-13 23:51:30 +01:00
battery.c ACPI / battery: Cleanup Lenovo Ideapad Miix 320 DMI table entry 2020-03-04 10:32:50 +01:00
bgrt.c
blacklist.c
bus.c
button.c ACPI: button: Drop no longer necessary Asus T200TA lid_init_state quirk 2020-04-20 10:37:15 +02:00
cm_sbs.c
container.c
cppc_acpi.c ACPI: CPPC: clean up acpi_get_psd_map() 2020-03-28 13:25:41 +01:00
custom_method.c
debugfs.c
device_pm.c PM: ACPI: Output correct message on target power state 2020-04-27 10:33:40 +02:00
device_sysfs.c
dock.c
ec_sys.c
ec.c ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake() 2020-05-11 10:11:38 +02:00
event.c
evged.c
fan.c ACPI: fan: Use scnprintf() for avoiding potential buffer overflow 2020-03-14 11:11:58 +01:00
glue.c
hed.c
internal.h ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake() 2020-05-11 10:11:38 +02:00
ioapic.c
irq.c
Kconfig ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
Makefile ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
nvs.c
osi.c
osl.c ACPI: OSL: Add missing __acquires/__releases annotations 2020-03-04 10:40:48 +01:00
pci_irq.c
pci_link.c ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable 2020-04-20 10:36:22 +02:00
pci_mcfg.c
pci_root.c pci-v5.7-changes 2020-04-03 14:25:02 -07:00
pci_slot.c
power.c
pptt.c
proc.c ACPI: list_for_each_safe() -> list_for_each_entry_safe() 2020-03-04 10:48:00 +01:00
processor_core.c
processor_driver.c
processor_idle.c
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-04 16:28:24 +02:00
property.c
reboot.c
resource.c
sbs.c
sbshc.c
sbshc.h
scan.c treewide: remove redundant IS_ERR() before error code check 2020-02-04 03:05:27 +00:00
sleep.c ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake() 2020-05-11 10:11:38 +02:00
sleep.h ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-04 19:45:18 +02:00
spcr.c
sysfs.c
tables.c ACPICA: Add NHLT table signature 2020-03-30 14:52:33 +02:00
thermal.c ACPI: thermal: switch to use <linux/units.h> helpers 2020-01-31 10:30:39 -08:00
tiny-power-button.c ACPI: Add new tiny-power-button driver to directly signal init 2020-02-13 23:36:23 +01:00
utils.c
video_detect.c ACPI: video: Use native backlight on Acer Aspire 5783z 2020-04-01 11:18:31 +02:00
wakeup.c ACPI: PM: Add acpi_[un]register_wakeup_handler() 2020-04-04 19:45:18 +02:00