linux-stable/drivers/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
..
acpica ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:12:22 +02:00
apei ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-10-13 20:40:09 +02:00
arm64 iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
dptf ACPI: DPTF: Drop stale link from Kconfig help 2022-09-28 17:26:25 +02:00
nfit ACPI: NFIT: fix a potential deadlock during NFIT teardown 2023-03-03 11:52:21 +01:00
numa ACPI: HMAT: Fix initiator registration for single-initiator systems 2022-11-18 23:55:40 -08:00
pmic
x86 ACPI: x86: utils: Add Cezanne to the list for forcing StorageD3Enable 2023-03-30 12:49:16 +02:00
ac.c ACPI: AC: Remove the leftover struct acpi_ac_bl 2022-09-24 18:22:59 +02:00
acpi_adxl.c
acpi_amba.c Merge branches 'acpi-ec', 'acpi-ac', 'acpi-fan', 'acpi-video' and 'acpi-amba' 2022-10-03 19:59:47 +02:00
acpi_apd.c ACPI: processor: Check for null return of devm_kzalloc() in fch_misc_setup() 2023-05-24 17:32:35 +01:00
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: Handle multiple records 2022-10-13 20:43:10 +02:00
acpi_fpdt.c ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address 2022-09-10 18:18:34 +02:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c Merge branch 'acpi-uid' 2022-10-03 20:09:22 +02:00
acpi_memhotplug.c
acpi_pad.c
acpi_pcc.c ACPI: PCC: Fix unintentional integer overflow 2022-10-26 13:33:31 +02:00
acpi_platform.c Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' 2022-09-30 20:28:22 +02:00
acpi_pnp.c
acpi_processor.c
acpi_tad.c
acpi_video.c ACPI: video: Make acpi_backlight=video work independent from GPU driver 2023-04-13 16:55:33 +02:00
acpi_watchdog.c
battery.c ACPI: battery: Fix missing NUL-termination with large strings 2023-03-10 09:32:56 +01:00
bgrt.c
blacklist.c
bus.c ACPI: bus: Ensure that notify handlers are not running after removal 2023-05-11 23:03:16 +09:00
button.c
container.c
cppc_acpi.c ACPI: CPPC: Disable FIE if registers in PCC regions 2022-09-24 18:43:46 +02:00
custom_method.c
debugfs.c
device_pm.c PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-03-11 13:55:33 +01:00
device_sysfs.c
dock.c
ec.c ACPI: EC: Fix oops when removing custom query handlers 2023-05-24 17:32:35 +01:00
ec_sys.c
event.c
evged.c
fan.h
fan_attr.c
fan_core.c ACPI: fan: Reorder symbols to get rid of a few forward declarations 2022-09-24 18:46:52 +02:00
glue.c ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops 2023-01-18 11:58:11 +01:00
hed.c
internal.h ACPI: scan: Eliminate __acpi_device_add() 2022-08-23 18:19:27 +02:00
ioapic.c
irq.c ACPI: irq: Fix some kernel-doc issues 2022-12-31 13:31:55 +01:00
Kconfig platform-drivers-x86 for v6.1-1 2022-10-05 10:38:24 -07:00
Makefile
nvs.c
osi.c ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string 2022-08-25 20:18:17 +02:00
osl.c
pci_irq.c
pci_link.c ACPI/PCI: Remove useless NULL pointer checks 2022-07-27 21:21:27 +02:00
pci_mcfg.c
pci_root.c ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() 2022-10-19 13:28:30 +02:00
pci_slot.c
pfr_telemetry.c ACPI: pfr_telemetry: use ACPI_FREE() to free acpi_object 2022-12-31 13:31:57 +01:00
pfr_update.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
platform_profile.c
power.c ACPI: PM: Do not turn of unused power resources on the Toshiba Click Mini 2023-05-11 23:03:38 +09:00
pptt.c ACPI: PPTT: Fix to avoid sleep in the atomic context when PPTT is absent 2023-03-22 13:34:04 +01:00
prmt.c ACPI: PRM: Check whether EFI runtime is available 2023-01-24 07:24:35 +01:00
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value 2022-12-31 13:32:57 +01:00
processor_pdc.c ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-11 23:03:11 +09:00
processor_perflib.c
processor_thermal.c ACPI: processor: Remove freq Qos request for all CPUs 2022-08-23 18:09:06 +02:00
processor_throttling.c
property.c Merge branch 'acpi-dev' 2022-09-30 20:05:16 +02:00
reboot.c
resource.c ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P 2023-06-09 10:34:14 +02:00
sbs.c ACPI: Drop parent field from struct acpi_device 2022-08-24 20:55:24 +02:00
sbshc.c ACPI: Drop parent field from struct acpi_device 2022-08-24 20:55:24 +02:00
sbshc.h
scan.c ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops 2023-01-18 11:58:11 +01:00
sleep.c ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:12:22 +02:00
sleep.h ACPI: s2idle: Add a new ->check() callback for platform_s2idle_ops 2022-09-09 17:37:40 +02:00
spcr.c
sysfs.c
tables.c
thermal.c ACPI: thermal: Drop some redundant code 2022-10-05 17:51:52 +02:00
tiny-power-button.c
utils.c Merge branch 'acpi-uid' 2022-10-03 20:09:22 +02:00
video_detect.c ACPI: video: Remove desktops without backlight DMI quirks 2023-05-24 17:32:36 +01:00
viot.c ACPI: VIOT: Initialize the correct IOMMU fwspec 2023-05-11 23:03:12 +09:00
wakeup.c