linux-stable/include/acpi
Rafael J. Wysocki 22db06337f ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep()
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+
2023-06-15 18:05:19 +02:00
..
platform ACPICA: add os specific support for Zephyr RTOS 2023-04-06 20:29:12 +02:00
acbuffer.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acconfig.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acexcep.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acnames.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acoutput.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpi.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpi_bus.h ACPI: utils: Fix acpi_evaluate_dsm_typed() redefinition error 2023-03-20 18:44:10 +01:00
acpi_drivers.h
acpi_io.h
acpi_lpat.h
acpi_numa.h
acpiosxf.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpixf.h ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-15 18:05:19 +02:00
acrestyp.h ACPICA: acpi_resource_irq: Replace 1-element arrays with flexible array 2023-04-06 20:29:12 +02:00
actbl.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
actbl1.h ACPICA: acpi_dmar_andd: Replace 1-element array with flexible array 2023-04-06 20:29:12 +02:00
actbl2.h ACPICA: acpi_madt_oem_data: Fix flexible array member definition 2023-04-06 20:29:12 +02:00
actbl3.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
actypes.h ACPI updates for 6.4-rc1 2023-04-25 18:37:41 -07:00
acuuid.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
apei.h
battery.h
button.h
cppc_acpi.h ACPI: CPPC: Add auto select register read/write support 2023-03-17 19:06:23 +01:00
ghes.h
hed.h
nfit.h
pcc.h
pdc_intel.h
processor.h
reboot.h
video.h ACPI: video: Remove register_backlight_delay module option and code 2023-04-11 20:55:46 +02:00