public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: "Rafael J . Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	linux-acpi@vger.kernel.org (open list:ACPI),
	linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software
	Suspend, aka swsusp)),
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 0/4] Improvements to ACPI battery handling over s2idle
Date: Sat,  8 Feb 2025 10:22:06 -0600	[thread overview]
Message-ID: <20250208162210.3929473-1-superm1@kernel.org> (raw)

From: Mario Limonciello <mario.limonciello@amd.com>

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


             reply	other threads:[~2025-02-08 16:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-08 16:22 Mario Limonciello [this message]
2025-02-08 16:22 ` [PATCH 1/4] PM: Add sysfs file for energy consumed over sleep cycle Mario Limonciello
2025-02-08 16:22 ` [PATCH 2/4] ACPI: battery: Save and report battery capacity over suspend Mario Limonciello
2025-02-10 15:23   ` Sebastian Reichel
2025-02-10 21:24     ` Mario Limonciello
2025-02-08 16:22 ` [PATCH 3/4] ACPI: battery: Refactor wakeup reasons in acpi_battery_update() Mario Limonciello
2025-02-08 16:22 ` [PATCH 4/4] ACPI: battery: Wake system on AC plug or unplug in over s2idle Mario Limonciello
2025-02-08 17:59   ` Rafael J. Wysocki
2025-02-09 13:14     ` Mario Limonciello
2025-02-12 13:49       ` Armin Wolf
2025-02-12 13:57         ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250208162210.3929473-1-superm1@kernel.org \
    --to=superm1@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox