ACPI support fix for 7.1-rc5

Unbreak system wakeup on critical battery status in the ACPI battery
 driver inadvertently broken during the 7.0 development cycle.
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmoQURsSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1bYQH/285ZHlySoQOrVyChdDpn18ZImO7LP/J
 BNt88rytoK5z3//fGS7QHLeOy9TnoRBeSytTkIgNN8D9zSdYTIorUJufZVlIj6Ul
 kscJMf/F4ihcklRtN30SAwC5AScGfPmkj8BKG+eB2aHzfSjgNFIiItDD9qbca4rJ
 imcTgDUS2nAuuPHCv/ARX+nZjIeLkXzOUCene20lxWOd2Cs37Cbwi3lVphIRepK4
 +4b/Dgu334w9YG4nTCOtIsLfyCXm8lHNKjDUFikPuih+JiYwHJMqKvcmNZsF271m
 wcLc7V7DJiQxPU2X9doBspe2IKFZBAjzs26ghoKjrPEL+j1gijMJmq8=
 =4uNW
 -----END PGP SIGNATURE-----

Merge tag 'acpi-7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI support fix from Rafael Wysocki:
 "Unbreak system wakeup on critical battery status in the ACPI battery
  driver inadvertently broken during the 7.0 development cycle"

* tag 'acpi-7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: battery: Fix system wakeup on critical battery status
This commit is contained in:
Linus Torvalds 2026-05-22 07:06:21 -07:00
commit 28222dcdad

View File

@ -94,6 +94,7 @@ struct acpi_battery {
struct power_supply *bat;
struct power_supply_desc bat_desc;
struct acpi_device *device;
struct device *phys_dev;
struct notifier_block pm_nb;
struct list_head list;
unsigned long update_time;
@ -1033,7 +1034,7 @@ static int acpi_battery_update(struct acpi_battery *battery, bool resume)
if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||
(test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
(battery->capacity_now <= battery->alarm)))
acpi_pm_wakeup_event(&battery->device->dev);
acpi_pm_wakeup_event(battery->phys_dev);
return result;
}
@ -1231,6 +1232,7 @@ static int acpi_battery_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, battery);
battery->phys_dev = &pdev->dev;
battery->device = device;
result = devm_mutex_init(&pdev->dev, &battery->update_lock);