From: Greg Kroah-Hartman Date: Sat, 12 Jul 2025 14:55:01 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.15.188~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4954abf23a30929708f1542e5e1ae48b51a1a55;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: revert-acpi-battery-negate-current-when-discharging.patch --- diff --git a/queue-5.15/revert-acpi-battery-negate-current-when-discharging.patch b/queue-5.15/revert-acpi-battery-negate-current-when-discharging.patch new file mode 100644 index 0000000000..fc37eb9166 --- /dev/null +++ b/queue-5.15/revert-acpi-battery-negate-current-when-discharging.patch @@ -0,0 +1,51 @@ +From de1675de39aa945bad5937d1fde4df3682670639 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 3 Jul 2025 12:54:55 +0200 +Subject: Revert "ACPI: battery: negate current when discharging" + +From: Rafael J. Wysocki + +commit de1675de39aa945bad5937d1fde4df3682670639 upstream. + +Revert commit 234f71555019 ("ACPI: battery: negate current when +discharging") breaks not one but several userspace implementations +of battery monitoring: Steam and MangoHud. Perhaps it breaks more, +but those are the two that have been tested. + +Reported-by: Matthew Schwartz +Closes: https://lore.kernel.org/linux-acpi/87C1B2AF-D430-4568-B620-14B941A8ABA4@linux.dev/ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/battery.c | 19 +++---------------- + 1 file changed, 3 insertions(+), 16 deletions(-) + +--- a/drivers/acpi/battery.c ++++ b/drivers/acpi/battery.c +@@ -250,23 +250,10 @@ static int acpi_battery_get_property(str + break; + case POWER_SUPPLY_PROP_CURRENT_NOW: + case POWER_SUPPLY_PROP_POWER_NOW: +- if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) { ++ if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) + ret = -ENODEV; +- break; +- } +- +- val->intval = battery->rate_now * 1000; +- /* +- * When discharging, the current should be reported as a +- * negative number as per the power supply class interface +- * definition. +- */ +- if (psp == POWER_SUPPLY_PROP_CURRENT_NOW && +- (battery->state & ACPI_BATTERY_STATE_DISCHARGING) && +- acpi_battery_handle_discharging(battery) +- == POWER_SUPPLY_STATUS_DISCHARGING) +- val->intval = -val->intval; +- ++ else ++ val->intval = battery->rate_now * 1000; + break; + case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: + case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: diff --git a/queue-5.15/series b/queue-5.15/series index f633ec05a3..383d747766 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -32,3 +32,4 @@ pinctrl-qcom-msm-mark-certain-pins-as-invalid-for-interrupts.patch drm-sched-increment-job-count-before-swapping-tail-spsc-queue.patch drm-gem-fix-race-in-drm_gem_handle_create_tail.patch usb-gadget-u_serial-fix-race-condition-in-tty-wakeup.patch +revert-acpi-battery-negate-current-when-discharging.patch