public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Val Packett <val@packett.cool>,
	Sebastian Reichel <sre@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling
Date: Tue, 18 Nov 2025 10:29:35 +0800	[thread overview]
Message-ID: <d92cb96b-b398-45c1-964c-0ab551ca135f@oss.qualcomm.com> (raw)
In-Reply-To: <02db51aa-6e19-411f-875f-718b8215c373@oss.qualcomm.com>


On 11/17/2025 8:45 PM, Konrad Dybcio wrote:
> On 11/17/25 6:12 AM, Fenglin Wu wrote:
>> On 10/13/2025 7:32 AM, Val Packett wrote:
>>> 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?
>> It is fine to clamping the threshold to the acceptable range. Thank you for making the changes.
>>> Or should the [1 - 49] range for start actually be rejected?
>> The minimum charging start threshold was set to 50 to improve user experience. If the threshold is too low and the system keeps drawing power from the battery frequently due to a large system load and a weak charger, the laptop will only begin charging when the battery level falls below that threshold. If the user disconnects the charger at that time, then the device would be only having a battery below 50%. Setting the threshold at 50 ensures the battery always stays above 50%.
> So can we set it lower?
>
> Such decisions are best deferred to userspace and/or the user, which can
> limit what the kernel exposes as necessary/deemed useful
>
> Konrad

Yes, it can be set to a lower value.

However, I am still having concerns that the inappropriate start and end 
threshold settings would cause a very bad user experience if they are 
misused, since these thresholds are stored in nvmem and they won't be 
reset until battery is unplugged or completely drained. For example, if 
someone intentionally sets the start threshold to 1 and end threshold to 
6, and if the laptop was shutdown with a battery SoC less than the end 
threshold, I am not sure if <6% percent battery level would be good 
enough to boot up the laptop successfully, if it is not, then the laptop 
may not have chance to charge up until you hot plug the battery.

Also, from battery management firmware point of view, the charge control 
feature was mainly designed for battery health management, to slow the 
aging of Li-ion battery by preventing it from being frequently charged 
to full state. Having a too low minimum start threshold setting won't 
help anything on that.

Thanks

Fenglin


  reply	other threads:[~2025-11-18  2:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-12 23:32 [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling Val Packett
2025-10-12 23:32 ` [PATCH 1/2] power: supply: qcom_battmgr: clamp charge control thresholds Val Packett
2025-10-13  9:43   ` Konrad Dybcio
2025-10-12 23:32 ` [PATCH 2/2] power: supply: qcom_battmgr: support disabling charge control Val Packett
2025-11-17  5:22   ` Fenglin Wu
2025-11-03  0:48 ` [PATCH 0/2] power: supply: qcom_battmgr: improve charge control threshold handling Sebastian Reichel
2025-11-03  3:46   ` Val Packett
2025-11-03 14:41     ` Sebastian Reichel
2025-11-17  5:12 ` Fenglin Wu
2025-11-17 12:45   ` Konrad Dybcio
2025-11-18  2:29     ` Fenglin Wu [this message]
2025-11-18 10:13       ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d92cb96b-b398-45c1-964c-0ab551ca135f@oss.qualcomm.com \
    --to=fenglin.wu@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sre@kernel.org \
    --cc=val@packett.cool \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox