mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexandru Andrieș via B4 Relay" <devnull+alex.andries.aa.gmail.com@kernel.org>
To: Sebastian Reichel <sre@kernel.org>,
	 Neil Armstrong <neil.armstrong@linaro.org>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	stable@vger.kernel.org,
	"Alexandru Andrieș" <alex.andries.aa@gmail.com>
Subject: [PATCH 0/3] power: supply: qcom_battmgr: fix SM8350/SM8550 units, acks, and negative temp
Date: Thu, 19 Nov 2026 00:16:49 +0100	[thread overview]
Message-ID: <20261119-upstream-qcom-battmgr-fixes-v1-v1-0-ca83700c08c1@gmail.com> (raw)

Fix three issues in qcom_battmgr encountered while bringing up PMIC GLINK
battery reporting on a Xiaomi MIX 4 (xiaomi-odin, SM8350):

1. Set battmgr->unit to QCOM_BATTMGR_UNIT_mAh on SM8350 and SM8550 so
   charge_full and charge_full_design stop returning -ENODATA.
2. Complete &battmgr->ack on invalid payload length errors in both
   callbacks so callers receive -ENODATA immediately instead of stalling
   for 1s with -ETIMEDOUT and aborting power_supply_uevent().
3. Change status.temperature and qcom_battmgr_sc8280xp_convert_temp() to
   int and cast SM8350 BATT_TEMP values to s32 before dividing by 10 so
   sub-zero temperatures do not wrap into large positive values.

Testing:
- Built warning-free (W=1) on arm64 against commit 97d73c825122.
- Tested on a Xiaomi MIX 4 (xiaomi-odin, SM8350) with UPower 1.91.0.
- The SM8550 variant in patch 1, the SC8280XP paths in patches 2 and 3,
  and sub-zero battery temperatures (< 0 C) in patch 3 were not
  hardware-tested.

AI disclosure:
- Debugged and drafted with assistance from Gemini 4 Carbon
  (Antigravity), and reviewed and tested on hardware by the submitter.

---
Alexandru Andrieș (3):
      power: supply: qcom_battmgr: set mAh unit for SM8350 and SM8550
      power: supply: qcom_battmgr: complete ack on callback payload errors
      power: supply: qcom_battmgr: fix negative temperature values

 drivers/power/supply/qcom_battmgr.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)
---
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
change-id: 20261119-upstream-qcom-battmgr-fixes-v1-004f34587c42

Best regards,
--  
Alexandru Andrieș <alex.andries.aa@gmail.com>



             reply	other threads:[~2026-11-18 23:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 23:16 Alexandru Andrieș via B4 Relay [this message]
2026-11-18 23:16 ` [PATCH 1/3] power: supply: qcom_battmgr: set mAh unit for SM8350 and SM8550 Alexandru Andrieș via B4 Relay
2026-12-02  2:45   ` Sebastian Reichel
2026-11-18 23:16 ` [PATCH 2/3] power: supply: qcom_battmgr: complete ack on callback payload errors Alexandru Andrieș via B4 Relay
2026-11-18 23:16 ` [PATCH 3/3] power: supply: qcom_battmgr: fix negative temperature values Alexandru Andrieș via B4 Relay

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=20261119-upstream-qcom-battmgr-fixes-v1-v1-0-ca83700c08c1@gmail.com \
    --to=devnull+alex.andries.aa.gmail.com@kernel.org \
    --cc=alex.andries.aa@gmail.com \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@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=sebastian.reichel@collabora.com \
    --cc=sre@kernel.org \
    --cc=stable@vger.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®