Windows 11 unexpectedly enters S4/hibernate mode


dps_kane

Member
Local time
4:08 PM
Posts
2
OS
Windows 11 Pro
Hello,

I'm trying to diagnose an intermittent power-management problem on a Windows 11 laptop.

The laptop is a Lenovo Legion with Windows 11 Pro. I use it with the lid closed while connected to AC power. The lid-close action is configured so that the laptop continues running (if connected to AC power). A Python script runs continuously in the background.

This setup worked reliably for several weeks. Recently, however, the laptop sometimes unexpectedly stops running the script after being left alone for an unpredictable amount of time (roughly 1–4 hours). The cause: it goes into sleep mode.

When I open the lid again, Windows resumes and the Python script continues normally. The script is meant to be running the whole time, though.

I have encountered this behavior several times, but unfortunately it is annoying to reproduce this actively, because the waiting time varies significantly.

Power configuration​

The active power plan is Balanced.

For AC power:

  • Sleep after: 0 seconds (Never)
  • Hibernate after: 0 seconds (Never)
  • Hybrid sleep: Off
  • Wake timers: Enabled
The system supports S3 and S4:

The following sleep states are available:
Standby (S3)
Hibernate
Fast Startup

The following sleep states are not available:
Standby (S0 Low Power Idle)


Hibernate was enabled manually with:
powercfg /hibernate on
The problem may have started around the same period, although I am not certain whether the first occurrence was shortly after enabling or days later.

Event sequence​

The most recent occurrence produced the following events immediately before the sleep/hibernate transition.

Kernel-Power Event 105:
AcOnline: false
RemainingCapacity: 68560
FullChargeCapacity: 85690
(laptop is set up to only charge to 80% battery, hence the discrepancy)

Then Event 566:
Reason: 28
PreviousSessionId: 21
PreviousSessionType: 1
PreviousSessionDurationInUs: 3786114240
NextSessionId: 23
NextSessionType: 1
PowerStateAc: false
MonitorReason: 28
Then another Event 566:
Reason: 20
PreviousSessionId: 23
PreviousSessionType: 1
PreviousSessionDurationInUs: 8966
NextSessionId: 25
NextSessionType: 3
PowerStateAc: false
MonitorReason: 20
There were also two IsolatedUserMode events (ID 1 and 5, details on one:
Secure Trustlet ??\C:\WINDOWS\system32\BioIso.exe Id 4 and Pid 38988 started with status STATUS_SUCCESS.)
, followed by:

Kernel-Power Event 105:
AcOnline: true
RemainingCapacity: 68560
FullChargeCapacity: 85690
Then, about 0.25 seconds later:

Kernel-Power Event 42:
TargetState: 4
EffectiveState: 4
Reason: 0
Flags: 4
TransitionsToOn: 3
I understand that TargetState = 4 corresponds to S4/hibernate.

About 3 seconds later:

Kernel-Power Event 107:
TargetState: 4
EffectiveState: 4
WakeFromState: 4
ProgrammedWakeTimeAc: 1601-01-01T00:00:00.0000000Z
ProgrammedWakeTimeDc: 1601-01-01T00:00:00.0000000Z
WakeRequesterTypeAc: 0
WakeRequesterTypeDc: 0
This, I strongly assume, is not actually happening 3 seconds later, but when I open the lid of the laptop, just that it writes this event with the system time it had before entering sleep - because the next entry is something about changing the system time to the actual time.

The particularly strange part to me is:
AcOnline = false
immediately before the transition, followed by:
AcOnline = true
less than a second later.

The laptop was physically connected to AC power the entire time and nobody touched it.

After opening the laptop, I also ran:
powercfg /lastwake
which reported:
Wake History Count - 1
Wake History [0]
Wake Source Count - 1
Wake Source [0]
Type: Fixed Feature
Power Button

Other observations​

In earlier occurrences I saw:

  • Event 42: Sleep Reason: Button or Lid
  • Event 107 a few seconds later
  • Event 566 with Reason InputMouse
  • Event 566 with Reason SxTransition
  • Event 40 indicating that the HP WSD printer and scanner drivers stopped the power transition.
The HP printer is connected over Wi-Fi and has not changed - plus it was off or on standby. A Bluetooth mouse is also present, but it was physically switched off when the event occurred.
The laptop, charger, power outlet, printer and mouse had all been unchanged for weeks before this problem started.

Windows update history shows:
  • KB5095189 — July 15
  • KB5123304 — August 12
  • KB5121003 — August 12
  • KB5120708 — August 12
Lenovo's last update was in July.

I am uncertain whether the behavior started before Aug 12 or after, but my memory thinks it started a few days before that. I would strongly assume that enabling Hibernation Mode is the culprit.

My questions

  1. Does the Event 105 AcOnline=false → AcOnline=true sequence indicate that Windows/ACPI actually detected a brief loss of AC power?
  2. Could a very brief AC-power/charger detection event cause Windows to transition from the AC power plan and subsequently enter S4?
  3. Is there a way to determine what generated the transition to S4—for example, whether it came from ACPI/firmware, the lid sensor, a driver, or Windows power policy?
  4. Is there a more appropriate diagnostic tool/log than Event Viewer for investigating this? I am happy to provide powercfg reports or ETW traces if someone can tell me which ones would be useful.
  5. Could enabling Hibernate (powercfg /hibernate on) plausibly be related to this behavior?
My main requirement is simply that when the laptop is plugged in and the lid is closed, it must remain awake indefinitely. I would like to understand the cause rather than simply disabling every possible power-saving feature.

Any help interpreting the Event 105/566/42/107 sequence would be greatly appreciated
 

My Computer My Computer

At a glance

Windows 11 ProIntel Core Ultra 7 255HX, 2400 MHz, 20 Cores32GBNvidia RTX 5060
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo Legion
CPU
Intel Core Ultra 7 255HX, 2400 MHz, 20 Cores
Motherboard
LNVNB161216
Memory
32GB
Graphics Card(s)
Nvidia RTX 5060
Mouse
Logitech MX Master 3
Internet Speed
10 Gbs up/down
Browser
Brave
Could it be heat related due to being running while plugged in and the lid being closed? Heat build up can cause shutdown so maybe hibernate as well? Just guessing here.
 

My Computers My Computers

  • At a glance

    Windows 11 ProAMD Ryzen 9 8945HS32GB DDR5 SO-DIMMIntegrated AMD Radeon 780M (4.00 GHz)
    OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    GMKtec K11
    CPU
    AMD Ryzen 9 8945HS
    Memory
    32GB DDR5 SO-DIMM
    Graphics Card(s)
    Integrated AMD Radeon 780M (4.00 GHz)
    Monitor(s) Displays
    Benq 2250HM
    Screen Resolution
    1920 x 1080
    Hard Drives
    1 TB PCIe 4.0 NVMe M.2 SSD
  • At a glance

    Windows 11 HomeIntel® Core™ Ultra 7 - 255H processor16 GB LPDDR5 SDRAMIntel Arc 140T onboard graphics
    Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    ASUS Zenbook 14 OLED 14" Laptop - UX3405CA-QL192W
    CPU
    Intel® Core™ Ultra 7 - 255H processor
    Memory
    16 GB LPDDR5 SDRAM
    Graphics card(s)
    Intel Arc 140T onboard graphics
    Screen Resolution
    1920 x 1200 (16:10 WUXGA resolution) OLED Touchscreen
    Hard Drives
    1TB SSD
To anyone answering this poster...This is the second such thread in 24 hours for a Lenovo doing pretty much the exact same thing. Whether there is a common denominator or not I have no idea. Both have Intel Core Ultra 7 CPUs. Just saying this to make you aware.
The other thread is
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.9168i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.9168
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.9168AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.9168
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
  • System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.9168
Could it be heat related due to being running while plugged in and the lid being closed? Heat build up can cause shutdown so maybe hibernate as well? Just guessing here.
unlikely.heat behavior seems consistent since i bought the laptop. with closed lid it usually gets fairly cool fast always. even now.
so yeah, possible, but unlikely.


To anyone answering this poster...This is the second such thread in 24 hours for a Lenovo doing pretty much the exact same thing. Whether there is a common denominator or not I have no idea. Both have Intel Core Ultra 7 CPUs. Just saying this to make you aware.
The other thread is
might be something to it, but the problem there seems different ...



My current assumption is some fault in the power adapter that makes it lose AC power for a few ms.
sends the signal, laptop takes it and takes action. tries to go into hibernation for some weird reason. power comes back and those steps are not reversed.
 

My Computer My Computer

At a glance

Windows 11 ProIntel Core Ultra 7 255HX, 2400 MHz, 20 Cores32GBNvidia RTX 5060
OS
Windows 11 Pro
Computer type
Laptop
Manufacturer/Model
Lenovo Legion
CPU
Intel Core Ultra 7 255HX, 2400 MHz, 20 Cores
Motherboard
LNVNB161216
Memory
32GB
Graphics Card(s)
Nvidia RTX 5060
Mouse
Logitech MX Master 3
Internet Speed
10 Gbs up/down
Browser
Brave
-https://support.lenovo.com/nz/en/solutions/ht515870-how-to-disable-elliptic-virtual-lock-sensor-thinkpad
Also lenovo vantage you must disable My Device -> Smart assist you can uncheck the option that must say something like "User presence setting".
-https://forums.lenovo.com/t5/Lenovo-Yoga-Series-Laptops/Screen-goes-to-sleep-despite-power-setting-adjustment/m-p/5244693
 

My Computers My Computers

  • At a glance

    Windows 11 Pro latestAMD Ryzen 5 5700x32 gb 3200 mhz xmp (4x8)msi rtx3060 8gb
    OS
    Windows 11 Pro latest
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 5 5700x
    Motherboard
    Msi b550 gaming gen3
    Memory
    32 gb 3200 mhz xmp (4x8)
    Graphics Card(s)
    msi rtx3060 8gb
    Sound Card
    Audigy RX
    Monitor(s) Displays
    Philips 222V8LA/00
    Screen Resolution
    1980x1080
    Hard Drives
    MX500 Crucial
    PSU
    corsair cv 750
    Case
    q-tech
    Cooling
    amd wraith stealth
    Keyboard
    k81 gigabyte force
    Mouse
    zeroground daito
    Internet Speed
    100-10
    Browser
    Mozilla
    Antivirus
    Windows defender
  • At a glance

    windows 11 pro latesti5-2520M8Gb ddr3 1333 mhzhd3000
    Operating System
    windows 11 pro latest
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo T420
    CPU
    i5-2520M
    Memory
    8Gb ddr3 1333 mhz
    Graphics card(s)
    hd3000
    Sound Card
    on board
    Screen Resolution
    1366x768
    Hard Drives
    Team group lite 3d 240gb
    Internet Speed
    100-10
    Antivirus
    defender

Latest Support Threads

Back
Top Bottom