Legacy Kernel Caller preventing sleep mode
Solution 1:
Thanks for all the suggestions!
Finally I narrowed down the problem simply by trial and error, disabling devices and rebooting. It was a TV card driver hung and not releasing the power request despite being no longer in use.
EDIT:
Unfortunately, the problem with TV card is intermittently recurring. Googling shows it's also quite common. I found that disallowing the driver from making power requests with
Powercfg -requestsoverride Driver "Legacy Kernel Caller" System
solves it.
"Legacy Kernel Caller" is translated on different Windows language versions. On my Polish system it says "Starszego typu obiekt wywołujący jądro".
Solution 2:
From the start menu, type in "Performance Information and Tools".
Click the Advanced Tools and click generate a System Health Report. It should point out legacy driver issues.
Edit:
Also try powercfg -request
.