Skip to content

Improvements to ACPI battery handling over s2idle

Mario Limonciello linux-acpi linux-pm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4PM: Add sysfs file for energy consumed over sleep cycleDocumentation/ABI/testing/sysfs-power include/linux/suspend.h kernel/power/main.c+20 -00 replies
2/4ACPI: battery: Save and report battery capacity over suspenddrivers/acpi/battery.c+26 -42 replies
3/4ACPI: battery: Refactor wakeup reasons in acpi_battery_update()drivers/acpi/battery.c+17 -70 replies
4/4ACPI: battery: Wake system on AC plug or unplug in over s2idledrivers/acpi/battery.c+8 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Improvements to ACPI battery handling over s2idle

From: Mario Limonciello <[email protected]>

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 [1]. 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.

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

Mario Limonciello (4):
PM: Add sysfs file for energy consumed over sleep cycle
ACPI: battery: Save and report battery capacity over suspend
ACPI: battery: Refactor wakeup reasons in acpi_battery_update()
ACPI: battery: Wake system on AC plug or unplug in over s2idle

 Documentation/ABI/testing/sysfs-power |  8 ++++
 drivers/acpi/battery.c                | 62 ++++++++++++++++++++++-----
 include/linux/suspend.h               |  2 +
 kernel/power/main.c                   | 10 +++++
 4 files changed, 71 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0