News: 0001525356

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux Patches Adjust AC Plug/Unplug Behavior During s2idle To Match Windows

([Hardware] 5 Hours Ago AC Plug/Unplug While Sleeping)


A set of patches sent out on Saturday by AMD Linux engineer Mario Limonciello seek to adjust the Linux behavior for laptops/handhelds during AC plug/unplug events during s2idle to better match that of Microsoft Windows 11.

The hope is better matching the behavior of Microsoft Windows will lead to less bugs with different laptops experiencing platform issues due to different behavior than when the OEMs/ODMs are testing and validating on Microsoft Windows.

Mario Limonciello explained with [1]the proposed patch series :

"On Windows the system wakes up when connected or disconnected from an AC adapter. On Linux the system will momentarily wake up but immediately go back into suspend.

This difference in behavior can potentially expose lower level platform firmware bugs. For example entering/exiting HW sleep rapidly might not work properly. It's also inconsistent in that plugging in a dock might not wake up a system when it should.

This series most notably adjusts that behavior. It also adds a new sysfs file to determine how much battery was lost over the last sleep cycle which could aid in userspace statistics and in debugging high power consumption over s2idle."

So hopefully this change in behavior to match Microsoft Windows will lead to less laptop issues on Linux as well as other portable handhelds like the increasingly popular handheld gaming consoles. The [2]bug report leading to this change was for the Legion Go S with AMD Ryzen Z2 Go SoC.

Besides changing the behavior, the other interesting aspect of this is /sys/power/suspend_stats/last_sleep_energy as a new file to expose the amount of energy that the battery consumed during the last sleep cycle. The "last_sleep_energy" is reported in mAh.



[1] https://lore.kernel.org/linux-pm/20250208162210.3929473-1-superm1@kernel.org/

[2] https://gitlab.freedesktop.org/drm/amd/-/issues/3929



kcrudup

and.elf

There are places I'll remember
All my life though some have changed.
Some forever not for better
Some have gone and some remain.
All these places had their moments
With lovers and friends I still recall.
Some are dead and some are living,
In my life I've loved them all.

But of all these friends and lovers,
There is no one compared with you,
All these memories lose their meaning
When I think of love as something new.
Though I know I'll never lose affection
For people and things that went before,
I know I'll often stop and think about them
In my life I'll love you more.
-- Lennon/McCartney, "In My Life", 1965