lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6w6pq2d2nlrun6cz6tq4fjzqri52n3sskrf2frj6wj4jxzzrcg@z3a5bykeixsu>
Date: Sun, 16 Feb 2025 18:43:58 +0100
From: Anthony Ruhier <aruhier@...lbox.org>
To: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, 
	linux-arm-msm@...r.kernel.org, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] power: supply: qcom_battmgr: abs() on POWER_NOW
 property

On Sat, Feb 15, 2025 at 04:08:25AM +0100, Sebastian Reichel wrote:
>
> There are other drivers reporting negative values as documented.
> Most of the embedded ones do this actually and there surely are
> (embedded) userspace programs relying on this by now. But the
> most used driver - generic ACPI battery - does not. That's why
> quite a few userspace tools handle it wrong without anyone
> noticing for quite some time. Fixing it to follow the ABI would
> obviously end up in a bunch of regression reports, so things are
> a bit messy :(
>
> > I think it is a problem of the 'acpi' tool. At least 'upower -d' uses
> > fabs internally since the initial commit in 2008.
>
> It's definitely sensible to fix the userspace tools. We can't change
> the documented ABI for current_now after that many years and while
> documentation for power_now is missing, it would be quite unexpected
> to have it behave differently than current_now. Also userspace
> tooling needs to handle current_now and power_now anyways. And we
> surely can't change the behaviour for all drivers reporting signed
> data. So let's keep qcom_battmgr as is. It follows the documented
> ABI and hopefully helps giving this more exposure (I'm typing this
> on a X1E laptop right now and can see your problem with waybar).
>
> But we should document the power_now property. It somehow fell
> through the cracks :)
>
> -- Sebastian

Hi Sebastian,
Thanks a lot for the detailed answer, that makes sense for me.
I was sending this patch more to know which direction to follow (changing the
driver or the userspace tools), and you answered it perfectly.

I started fixing the different desktop tools I use, starting with Waybar:
https://github.com/Alexays/Waybar/pull/3942

For powertop, the fix seems straightforward. For acpiclient, due to no activity
in almost 10 years, we'll see if it goes through.

--
Thanks,
Anthony Ruhier

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ