linux-stable/include
Rafael J. Wysocki 0c58e97b47 ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep()
commit 22db06337f upstream.

The addition of might_sleep() to down_timeout() caused the latter to
enable interrupts unconditionally in some cases, which in turn broke
the ACPI S3 wakeup path in acpi_suspend_enter(), where down_timeout()
is called by acpi_disable_all_gpes() via acpi_ut_acquire_mutex().

Namely, if CONFIG_DEBUG_ATOMIC_SLEEP is set, might_sleep() causes
might_resched() to be used and if CONFIG_PREEMPT_VOLUNTARY is set,
this triggers __cond_resched() which may call preempt_schedule_common(),
so __schedule() gets invoked and it ends up with enabled interrupts (in
the prev == next case).

Now, enabling interrupts early in the S3 wakeup path causes the kernel
to crash.

Address this by modifying acpi_suspend_enter() to disable GPEs without
attempting to acquire the sleeping lock which is not needed in that code
path anyway.

Fixes: 99409b935c ("locking/semaphore: Add might_sleep() to down_*() family")
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 11:14:04 +02:00
..
acpi ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:14:04 +02:00
asm-generic asm-generic: avoid __generic_cmpxchg_local warnings 2023-04-04 17:58:11 +02:00
clocksource
crypto
drm drm: fix drmm_mutex_init() 2023-05-30 14:17:24 +01:00
dt-bindings ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
keys
kunit
kvm KVM: arm64: timers: Convert per-vcpu virtual offset to a global value 2023-03-11 02:00:40 -08:00
linux ata: libata-scsi: Avoid deadlock on rescan after device resume 2023-06-28 11:13:57 +02:00
math-emu
media Revert "media: dvb-core: Fix use-after-free on race condition at dvb_frontend" 2023-06-21 16:02:17 +02:00
memory
misc
net neighbour: delete neigh_lookup_nodev as not used 2023-06-21 16:02:18 +02:00
pcmcia
ras
rdma RDMA/cma: Always set static rate to 0 for RoCE 2023-06-21 16:02:15 +02:00
rv
scsi scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD 2023-03-09 20:57:58 -05:00
soc
sound ASoC: Intel: avs: Account for UID of ACPI device 2023-06-21 16:02:06 +02:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-11 23:17:14 +09:00
trace writeback: fix dereferencing NULL mapping->host on writeback_page_template 2023-06-28 11:14:04 +02:00
uapi net: ethtool: correct MAX attribute value for stats 2023-06-21 16:02:15 +02:00
ufs scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc() 2023-06-09 10:48:08 +02:00
vdso
video
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-11 23:17:03 +09:00