Please describe your issue in as much detail as possible:
Recently, in Linux kernel 6.15.4, a patch was introduced to align the current_now sysfs property with its ABI definition in Documentation/ABI/testing/sysfs-class-power, where current_now is expected to pass a negative value rather than a positive value: https://github.com/torvalds/linux/commit/234f71555019d308c6bc6f98c78c5551cb8cd56a.
However, this created a problem for two userspace implementations of battery estimation on SteamOS: MangoHud and Steam's GamepadUI. In the case of MangoHud, the battery numbers now had some negative values and a nonsensical time remaining. In the case of Steam, the right QAM showed projected battery life as ?h ?m.
MSI Claw:
Steam Deck OLED:
This change is on its way to being reverted for now after I pointed these regressions out (see https://lore.kernel.org/all/CAJZ5v0hvPs2hSP+68+dAgtG-iJR8TBptt4ObTbB5iCf2=EXe=A@mail.gmail.com/), but I was requested to file bug reports against any implementations I came across that relied on the current_now property returning a positive value in case they want to try to fix this mismatch in the future.
Steps for reproducing this issue:
Install kernel 6.15.4 on top of SteamOS Main
Boot into the kernel
Check battery statistics in MangoHud's full preset and in the right QAM
Your system information
Please describe your issue in as much detail as possible:
Recently, in Linux kernel 6.15.4, a patch was introduced to align the
current_nowsysfs property with its ABI definition inDocumentation/ABI/testing/sysfs-class-power, wherecurrent_nowis expected to pass a negative value rather than a positive value: https://github.com/torvalds/linux/commit/234f71555019d308c6bc6f98c78c5551cb8cd56a.However, this created a problem for two userspace implementations of battery estimation on SteamOS: MangoHud and Steam's GamepadUI. In the case of MangoHud, the battery numbers now had some negative values and a nonsensical time remaining. In the case of Steam, the right QAM showed projected battery life as
?h ?m.MSI Claw:
Steam Deck OLED:
This change is on its way to being reverted for now after I pointed these regressions out (see https://lore.kernel.org/all/CAJZ5v0hvPs2hSP+68+dAgtG-iJR8TBptt4ObTbB5iCf2=EXe=A@mail.gmail.com/), but I was requested to file bug reports against any implementations I came across that relied on the
current_nowproperty returning a positive value in case they want to try to fix this mismatch in the future.Steps for reproducing this issue: