Sleep and Wake in ACPI
How ACPI describes sleep states, wake sources, power methods, and the common debug path for instant wake, failed resume, and device wake bugs.
Sleep bugs are some of the most frustrating firmware bugs because the failure appears after the machine has already “worked.”
The system boots. Devices enumerate. Drivers load. Then the user closes the lid, presses power, or waits for idle sleep - and the machine refuses to sleep, wakes instantly, or resumes with broken devices.
ACPI is central to this path.
OS chooses a sleep state
The OS decides whether to enter S3, S4, S5, or a modern standby style state depending on platform capability.
OS evaluates methods and wake capabilities
Methods such as `_PTS`, `_GTS`, `_PRW`, `_DSW`, `_SxW`, `_PS3`, and `_PS0` may be involved.
Power management register transition
The OS writes PM control registers or platform-specific interfaces to enter the target state.
Wake source triggers resume
GPIO, GPE, power button, lid, EC, RTC, USB, or PCIe wake event brings the system back.
Firmware and OS restore devices
Devices must return to a consistent state before drivers continue operation.
ACPI objects commonly seen in sleep/wake debug
| Item | Value | Note |
|---|---|---|
| _S3 / _S4 / _S5 | Sleep state objects | Legacy state descriptors used by OS power management. |
| _PTS | Prepare To Sleep | AML method called before entering a sleep state. |
| _WAK | Wake method | AML method called after waking. |
| _PRW | Power Resources for Wake | Describes wake capability and GPE/wake source. |
| _PS0 / _PS3 | Device power methods | Move a device between D0 and D3-like power states. |
| _ON / _OFF | PowerResource methods | Control shared rails or power resources. |
Debug Diary: instant wake after S3
Symptom:
User selects sleep
Power LED blinks once
System wakes immediately
OS wake source: GPIO / ACPI / unknown
Debug path:
Check OS wake source log
↓
Find ACPI device with wake capability
↓
Inspect _PRW / GPIO wake descriptors
↓
Check GPE or GPIO event status before sleep
↓
Confirm event is cleared or masked properly
Common Pitfalls
_PRWpoints to the wrong GPE.- GPIO wake polarity is inverted.
- EC query event is not cleared before sleep.
- Device
_PS3turns off a rail needed by another wake device. _WAKrestores platform state too late.- S3 assumptions are reused on a platform that uses modern standby.
Sleep/wake debug checklist
Related notes
Found this useful?
Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.
Nội dung liên quan
Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.
GPIO OperationRegion
How ACPI models GPIO-backed platform state and why GPIO numbering, polarity, wake flags, and controller paths are common firmware bugs.
What is Power State S0-S5?
Quick note explaining Power State S0-S5 for BIOS/UEFI and embedded firmware readers.
What is EC & BIOS Handshake?
Quick note explaining EC & BIOS Handshake for BIOS/UEFI and embedded firmware readers.
Biến note thành bài viết hoàn chỉnh
Notes là nơi ghi nhanh khái niệm.