mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: joonhoekim <26rote@gmail.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Joonhoe Kim <26rote@gmail.com>,
	sre@kernel.org, kamal.wadhwa@oss.qualcomm.com,
	anjelique.melendez@oss.qualcomm.com,
	dhruvin.rajpura@oss.qualcomm.com, andersson@kernel.org,
	dmitry.baryshkov@oss.qualcomm.com, linux-arm-msm@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] power: supply: qcom_battmgr: expose the charge current limit
Date: Tue, 20 Oct 2026 22:23:48 +0900	[thread overview]
Message-ID: <20261020132350.953-1-26rote@gmail.com> (raw)
In-Reply-To: <4ec618a6-052b-47de-8418-e0e319af10ce@oss.qualcomm.com>

From: Joonhoe Kim <26rote@gmail.com>

On 10/20/26 11:55 AM, Konrad Dybcio wrote:
>> +	mutex_lock(&battmgr->lock);
>
> guard(mutex)(&battmgr->lock)

Will do.

>> +	if (!ret) {
>
> LLM suggests to add:
>
> -	if (!ret) {
> +	if (!ret && !battmgr->info.charge_ctrl_limit_max)
> +		ret = -ENODATA;
> +	if (!ret) {
>
> to prevent a possible zero-maximum value coming from the FW
> from messing with us here

Agreed. This firmware reports a maximum of 12.4 A, but a zero maximum
would clamp every write to 0, and a limit of 0 stops charging here until
the end threshold is moved below the capacity and back. Returning
-ENODATA is better than that.

Both in v2. I'll wait until Jingyi has had a chance to check the sign
in 1/2, then resend the two together.

Thanks,
Joonhoe Kim

  reply	other threads:[~2026-10-20 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 12:48 [PATCH 1/2] power: supply: qcom_battmgr: fix the battery current sign on Kaanapali Joonhoe Kim
2026-10-16 12:48 ` [PATCH 2/2] power: supply: qcom_battmgr: expose the charge current limit Joonhoe Kim
2026-10-20  8:55   ` Konrad Dybcio
2026-10-20  9:55   ` Konrad Dybcio
2026-10-20 13:23     ` joonhoekim [this message]
2026-10-16 13:34 ` [PATCH 1/2] power: supply: qcom_battmgr: fix the battery current sign on Kaanapali 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=20261020132350.953-1-26rote@gmail.com \
    --to=26rote@gmail.com \
    --cc=andersson@kernel.org \
    --cc=anjelique.melendez@oss.qualcomm.com \
    --cc=dhruvin.rajpura@oss.qualcomm.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=kamal.wadhwa@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=sre@kernel.org \
    /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

all inboxes | Powered by JetHome®