acrn-kernel/include/acpi
Rafael J. Wysocki 390aeb5ae7 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:12:22 +02:00
..
platform
acbuffer.h
acconfig.h
acexcep.h
acnames.h
acoutput.h
acpi.h
acpi_bus.h
acpi_drivers.h
acpi_io.h
acpi_lpat.h
acpi_numa.h
acpiosxf.h
acpixf.h ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:12:22 +02:00
acrestyp.h
actbl.h
actbl1.h
actbl2.h
actbl3.h tpm_crb: Add support for CRB devices based on Pluton 2023-06-28 11:12:17 +02:00
actypes.h
acuuid.h
apei.h
battery.h
button.h
cppc_acpi.h
ghes.h
hed.h
nfit.h
pcc.h
pdc_intel.h
processor.h
reboot.h
video.h