mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adil Hüsrev Tepe" <tadilhusrev@gmail.com>
To: Kaustabh Chakraborty <kauschluss@disroot.org>
Cc: Sebastian Reichel <sre@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Yassine Oudjana <y.oudjana@protonmail.com>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 0/3] power: supply: s2mu005-battery: add S2MU106 (Samsung Galaxy XCover5)
Date: Sun, 22 Nov 2026 21:54:30 +0300	[thread overview]
Message-ID: <20261122185429.557309-2-tadilhusrev@gmail.com> (raw)
In-Reply-To: <DN05PYTW4NV6.SOA0NRNOJBAR@disroot.org>

On Fri, 20 Nov 2026 21:22:14 +0530, Kaustabh Chakraborty wrote:
> Actually, this one was just fine. I didn't look at the patches
> meticulously but it seems like it does belong here. The correct approach
> would be to adjust the driver correctly so that it accepts both.
>
> The compatible patch is, in fact incorrect. The driver clearly uses two
> separate compatibles for the two devices, so there should not be any
> fallback.

Hi Kaustabh,

Thanks for taking a look. To be precise about what I was reacting to: the
unsoundness wasn't that the same driver matches two compatibles -- patch 3
did add a distinct match entry for each, with has_monout set correctly per
chip. It's that patch 1's binding declared the S2MU106 compatible as a
fallback to the S2MU005 one:

compatible = "samsung,s2mu106-fuel-gauge", "samsung,s2mu005-fuel-gauge";

That pattern exists so a kernel with no S2MU106-specific knowledge still
binds correctly via the old compatible alone. It doesn't hold here: a DT
node that lists only the old compatible (no S2MU106 string at all) still
matches s2mu005-battery.c's existing entry and takes the has_monout=true
path, reading MONOUT registers the S2MU106 doesn't have.

You're right that the actual fix is narrower than what I did: drop the
fallback from the binding (require samsung,s2mu106-fuel-gauge on its own),
keep extending s2mu005-battery.c as patches 2-3 did. I went further and
withdrew the whole series for a standalone driver, partly because I'd also
talked myself into a chip sharing three register offsets and their scaling
with another, on its own I2C address, not really belonging in that other
chip's device tree node/driver file. That's a shape preference more than a
bug fix, and I should have said so as a separate point rather than folding
it into the same withdrawal.

The standalone series (dt-bindings: power: supply: add
samsung,s2mu106-fuelgauge + power: supply: s2mu106-fuelgauge: add standalone
driver) is already out and hasn't had review yet. If you still think
reusing s2mu005-battery.c (minus the fallback) is the better shape, I'd
rather hear that case on that thread than have it settled by default --
I don't have a strong attachment either way beyond not wanting the MONOUT
bug back.

(Resent for the lists: my two earlier copies of this reply went out as
HTML and vger rejected both, so only you received them. Sorry for the
duplicate.)

Adil

      reply	other threads:[~2026-11-22 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  7:39 Adil Hüsrev Tepe
2026-11-16  7:39 ` [PATCH v1 1/3] dt-bindings: power: supply: samsung,s2mu005-fuel-gauge: add S2MU106 Adil Hüsrev Tepe
2026-11-16  7:39 ` [PATCH v1 2/3] power: supply: s2mu005-battery: make the alert interrupt optional Adil Hüsrev Tepe
2026-11-16  7:40 ` [PATCH v1 3/3] power: supply: s2mu005-battery: add S2MU106 support Adil Hüsrev Tepe
2026-11-17 10:41 ` [PATCH v1 0/3] power: supply: s2mu005-battery: add S2MU106 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-11-20 15:52   ` Kaustabh Chakraborty
2026-11-22 18:54     ` Adil Hüsrev Tepe [this message]

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=20261122185429.557309-2-tadilhusrev@gmail.com \
    --to=tadilhusrev@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kauschluss@disroot.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=y.oudjana@protonmail.com \
    /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®