From: Mario Limonciello <mario.limonciello@xxxxxxx> 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(-) -- 2.43.0