linux-stable/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 ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acbuffer.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acconfig.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acexcep.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acnames.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acoutput.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acpi.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acpi_bus.h PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-03-11 13:55:33 +01:00
acpi_drivers.h
acpi_io.h Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_lpat.h
acpi_numa.h ACPI: processor: Replace kernel.h with the necessary inclusions 2021-11-24 17:44:04 +01:00
acpiosxf.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
acpixf.h ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:12:22 +02:00
acrestyp.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
actbl.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
actbl1.h ACPICA: Removed some tabs and // comments 2022-04-13 20:24:57 +02:00
actbl2.h ACPICA: IORT: Updates for revision E.d 2022-04-13 20:24:58 +02:00
actbl3.h tpm_crb: Add support for CRB devices based on Pluton 2023-06-28 11:12:17 +02:00
actypes.h ACPICA: Removed some tabs and // comments 2022-04-13 20:24:57 +02:00
acuuid.h ACPICA: Update copyright notices to the year 2022 2022-04-13 20:24:57 +02:00
apei.h ACPI: APEI: Fix missing ERST record id 2022-04-13 20:29:24 +02:00
battery.h
button.h
cppc_acpi.h ACPI: CPPC: Disable FIE if registers in PCC regions 2022-09-24 18:43:46 +02:00
ghes.h ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-10-13 20:40:09 +02:00
hed.h
nfit.h
pcc.h mailbox: pcc: Use PCC mailbox channel pointer instead of standard 2021-10-29 22:46:38 -05:00
pdc_intel.h
processor.h ACPI: processor: Drop leftover acpi_processor_get_limit_info() declaration 2022-06-29 19:01:23 +02:00
reboot.h
video.h ACPI: video: Add auto_detect arg to __acpi_video_get_backlight_type() 2023-04-13 16:55:33 +02:00