linux/drivers
Rafael J. Wysocki cb1f65c1e1 PM: s2idle: ACPI: Fix wakeup interrupts handling
After commit e3728b50cd ("ACPI: PM: s2idle: Avoid possible race
related to the EC GPE") wakeup interrupts occurring immediately after
the one discarded by acpi_s2idle_wake() may be missed.  Moreover, if
the SCI triggers again immediately after the rearming in
acpi_s2idle_wake(), that wakeup may be missed too.

The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup()
when pm_wakeup_irq is 0, but that's not the case any more after the
interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is
cleared by the pm_wakeup_clear() call in s2idle_loop().  However,
there may be wakeup interrupts occurring in that time frame and if
that happens, they will be missed.

To address that issue first move the clearing of pm_wakeup_irq to
the point at which it is known that the interrupt causing
acpi_s2idle_wake() to tun will be discarded, before rearming the SCI
for wakeup.  Moreover, because that only reduces the size of the
time window in which the issue may manifest itself, allow
pm_system_irq_wakeup() to register two second wakeup interrupts in
a row and, when discarding the first one, replace it with the second
one.  [Of course, this assumes that only one wakeup interrupt can be
discarded in one go, but currently that is the case and I am not
aware of any plans to change that.]

Fixes: e3728b50cd ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE")
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-02-07 21:02:31 +01:00
..
accessibility Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
acpi PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-07 21:02:31 +01:00
amba
android
ata ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage 2022-02-04 16:44:23 +09:00
atm atm: iphase: remove redundant pointer skb 2022-01-13 12:50:48 +00:00
auxdisplay
base PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-07 21:02:31 +01:00
bcma
block bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
bluetooth virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
bus pci-v5.17-changes 2022-01-16 08:08:11 +02:00
cdrom cdrom: simplify subdirectory registration with register_sysctl() 2022-01-22 08:33:35 +02:00
char random: only call crng_finalize_init() for primary_crng 2022-02-04 19:22:32 +01:00
clk Some hot fixes for clk driver patches merged last week 2022-01-21 09:16:11 +02:00
clocksource
comedi
connector connector/cn_proc: Use task_is_in_init_pid_ns() 2022-01-26 18:57:09 -08:00
counter counter: fix an IS_ERR() vs NULL bug 2022-01-26 19:40:33 +01:00
cpufreq
cpuidle
crypto virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
cxl
dax Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
dca
devfreq
dio
dma dmaengine updates for v5.17-rc1 2022-01-18 14:03:34 +02:00
dma-buf dma-buf: heaps: Fix potential spectre v1 gadget 2022-02-01 13:18:09 +05:30
edac EDAC/xgene: Fix deferred probing 2022-01-30 01:06:35 +01:00
eisa
extcon
firewire
firmware efi: runtime: avoid EFIv2 runtime services on Apple x86 machines 2022-01-23 10:31:27 +01:00
fpga
fsi
gnss
gpio gpio: sim: check the label length when setting up device properties 2022-01-24 09:20:02 +01:00
gpu Merge tag 'drm-intel-fixes-2022-02-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2022-02-04 15:48:27 +10:00
greybus
hid HID: wacom: Avoid using stale array indicies to read contact count 2022-01-21 15:10:02 +01:00
hsi
hv Drivers: hv: balloon: account for vmbus packet header in max_pkt_size 2022-01-23 22:31:23 +00:00
hwmon hwmon: (nct6775) Fix crash in clear_caseopen 2022-01-24 14:32:47 -08:00
hwspinlock
hwtracing
i2c virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
i3c i3c: master: dw: check return of dw_i3c_master_get_free_pos() 2022-01-13 02:05:50 +01:00
idle
iio bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
infiniband RDMA/mlx4: Don't continue event handler after memory allocation failure 2022-02-01 10:12:26 -04:00
input ASoC: Fixes for v5.17 2022-02-01 16:52:54 +01:00
interconnect
iommu iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() 2022-02-04 12:57:26 +01:00
ipack
irqchip irqchip fixes for 5.17, take #1 2022-01-29 21:03:20 +01:00
isdn
leds LED updates for 5.17. Nothing major is happening here. 2022-01-12 16:59:22 -08:00
macintosh macintosh/mac_hid.c: simplify subdirectory registration with register_sysctl() 2022-01-22 08:33:35 +02:00
mailbox - qcom: misc updates to qcom-ipcc driver 2022-01-13 11:19:07 -08:00
mcb
md md: fix NULL pointer deref with nowait but no mddev->queue 2022-02-02 10:14:07 -08:00
media bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
memory MTD core changes: 2022-01-11 11:35:28 -08:00
memstick
message
mfd driver core changes for 5.17-rc1 2022-01-12 11:11:34 -08:00
misc eeprom: at25: Restore missing allocation 2022-01-22 13:32:48 +01:00
mmc bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
most
mtd - added support for more BCM47XX based devices 2022-01-14 15:08:36 +01:00
mux
net net: stmmac: ensure PTP time register reads are consistent 2022-02-03 13:54:19 -08:00
nfc nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION 2022-01-12 14:17:45 +00:00
ntb New AMD PCI ID for NTB, and a number of bug fixes for ntb_hw_switchtec 2022-01-17 08:14:18 +02:00
nubus proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
nvdimm virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
nvme nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() 2022-02-03 07:30:57 +01:00
nvmem
of Devicetree fixes for v5.17, take 1: 2022-01-22 09:52:17 +02:00
opp
parisc Merge branch 'akpm' (patches from Andrew) 2022-01-22 11:28:23 +02:00
parport
pci - Remove a bogus warning introduced by the recent PCI MSI irq affinity 2022-02-06 10:00:40 -08:00
pcmcia pci-v5.17-changes 2022-01-16 08:08:11 +02:00
perf Rework of the MSI interrupt infrastructure: 2022-01-13 09:05:29 -08:00
phy Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
pinctrl pinctrl: microchip-sgpio: Fix support for regmap 2022-01-31 12:07:31 +01:00
platform platform/x86: thinkpad_acpi: Fix incorrect use of platform profile on AMD platforms 2022-02-01 15:37:00 +01:00
pnp proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
power platform-drivers-x86 for v5.17-1 2022-01-11 11:26:57 -08:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v5.17-rc1 2022-01-20 13:25:01 +02:00
rapidio
ras
regulator regulator: MAX20086: add gpio/consumer.h 2022-01-19 16:47:39 +00:00
remoteproc remoteproc: qcom: q6v5: fix service routines build errors 2022-01-17 16:44:26 -06:00
reset SoC: Add support for StarFive JH7100 RISC-V SoC 2022-01-10 08:32:37 -08:00
rpmsg rpmsg fixes for v5.17-rc1 2022-01-27 11:23:26 +02:00
rtc rtc: sunplus: fix return value in sp_rtc_probe() 2022-01-16 23:50:34 +01:00
s390 scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices 2022-01-24 23:30:27 -05:00
sbus
scsi scsi: hisi_sas: Fix setting of hisi_sas_slot.is_internal 2022-01-31 16:50:59 -05:00
sh
siox
slimbus
soc bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
soundwire Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
spi spi: Fixes for v5.17 2022-02-01 12:39:37 -08:00
spmi
ssb
staging Merge branch 'signal-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2022-01-17 05:49:30 +02:00
target scsi: target: iscsi: Make sure the np under each tpg is unique 2022-01-24 23:30:24 -05:00
tc
tee ARM: SoC driver updates for v5.17 2022-01-10 08:13:52 -08:00
thermal thermal: int340x: Add Raptor Lake PCI device id 2022-01-17 19:48:07 +01:00
thunderbolt
tty serial: core: Initialize rs485 RTS polarity already on probe 2022-01-26 14:53:12 +01:00
uio
usb usb: cdnsp: Fix segmentation fault in cdns_lost_power function 2022-01-26 14:11:16 +01:00
vdpa virtio,vdpa,qemu_fw_cfg: features, cleanups, fixes 2022-01-18 10:05:48 +02:00
vfio VFIO updates for v5.17-rc1 2022-01-20 13:31:46 +02:00
vhost vdpa: Protect vdpa reset with cf_mutex 2022-01-14 18:50:54 -05:00
video * dma-buf/heaps: Fix potential spectre v1 gadget 2022-02-04 14:43:35 +10:00
virt bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
virtio vdpa: Allow to configure max data virtqueues 2022-01-14 18:50:53 -05:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.17-rc1 tag 2022-01-17 08:07:57 +02:00
xen
zorro proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
Kconfig
Makefile