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-next>] [day] [month] [year] [list]
Message-ID: <20251012233333.19144-2-val@packett.cool>
Date: Sun, 12 Oct 2025 20:32:17 -0300
From: Val Packett <val@...kett.cool>
To: Sebastian Reichel <sre@...nel.org>,
	Fenglin Wu <fenglin.wu@....qualcomm.com>,
	Neil Armstrong <neil.armstrong@...aro.org>,
	linux-arm-msm@...r.kernel.org,
	linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Val Packett <val@...kett.cool>
Subject: [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling

Currently, upowerd is unable to turn off the battery preservation mode[1]
on Qualcomm laptops, because it does that by setting the start threshold to
zero and the driver returns an error:

pmic_glink.power-supply.0: charge control start threshold exceed range: [50 - 95]

Kernel documentation says the end threshold must be clamped[2] but does
not say anything about the start threshold.

In this proposal I've special-cased start==0 to actually disable the
functionality via the enable bit, and otherwise made both start and
end thresholds be clamped to the acceptable range. Hopefully that's
fine? Or should the [1 - 49] range for start actually be rejected?

[1]: https://gitlab.freedesktop.org/upower/upower/-/issues/327
[2]: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power

Thanks,
~val

Val Packett (2):
  power: supply: qcom_battmgr: clamp charge control thresholds
  power: supply: qcom_battmgr: support disabling charge control

 drivers/power/supply/qcom_battmgr.c | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ