From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Fenglin Wu <fenglin.wu@oss.qualcomm.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Sebastian Reichel <sre@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Subbaraman Narayanamurthy
<subbaraman.narayanamurthy@oss.qualcomm.com>,
David Collins <david.collins@oss.qualcomm.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, kernel@oss.qualcomm.com,
devicetree@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 6/8] dt-bindings: soc: qcom: pmic-glink: Move X1E80100 out of fallbacks
Date: Tue, 10 Jun 2025 14:22:21 +0200 [thread overview]
Message-ID: <024285a5-734a-4543-8a7b-897f8186904d@oss.qualcomm.com> (raw)
In-Reply-To: <9f332148-57ef-4716-8866-36c702a9aeb6@oss.qualcomm.com>
On 6/4/25 11:40 AM, Fenglin Wu wrote:
>
> On 6/3/2025 5:34 PM, Krzysztof Kozlowski wrote:
>> On 03/06/2025 09:41, Fenglin Wu wrote:
>>> On 6/3/2025 3:06 PM, Krzysztof Kozlowski wrote:
>>>> On 03/06/2025 08:59, Fenglin Wu wrote:
>>>>> On 6/3/2025 2:47 PM, Krzysztof Kozlowski wrote:
>>>>>> On 03/06/2025 08:42, Fenglin Wu wrote:
>>>>>>> On 6/2/2025 3:40 PM, Krzysztof Kozlowski wrote:
>>>>>>>> On 30/05/2025 09:35, Fenglin Wu via B4 Relay wrote:
>>>>>>>>> From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
>>>>>>>>>
>>>>>>>>> Move X1E80100 out of the fallbacks of SM8550 in pmic-glink support.
>>>>>>>> Why?
>>>>>>>>
>>>>>>>> Do not describe what you do here, it's obvious. We see it from the diff.
>>>>>>>>
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Krzysztof
>>>>>>> Previously, in qcom_battmgr driver, x1e80100 was specified with a match
>>>>>>> data the same as sc8280xp, also sm8550 was treated a fallback of sm8350
>>>>>>> without the need of a match data.
>>>>>>>
>>>>>>> In ucsi_glink driver, sm8550 had a match data and x1e80100 was treated
>>>>>>> as a fallback of sm8550. There was no issues to make x1e80100 as a
>>>>>>> fallback of sm8550 from both qcom_battmgr and ucsi_glink driver perspective.
>>>>>>>
>>>>>>> In patch [5/8] in this series, in qcom_battmgr driver, it added charge
>>>>>>> control functionality for sm8550 and x1e80100 differently hence
>>>>>>> different match data was specified for them, and it makes x1e80100 ad
>>>>>>> sm8550 incompatible and they need to be treated differently.
>>>>>> So you break ABI and that's your problem to fix. You cannot make devices
>>>>>> incompatible without good justification.
>>>>> I would say x1e80100 and sm8550 are different and incompatible from a
>>>>> battery management firmware support perspective. The x1e80100 follows
>>>>> the sc8280xp as a compute platform, whereas the sm8550 follows the
>>>>> sm8350 as a mobile platform.
>>>> Not correct arguments for compatibility.
>>>>
>>>>> The difference between them was initially ignored because the sm8550
>>>>> could use everything that the sm8350 has, and no match data needed to be
>>>>> specified for it. However, now the sm8550 has new features that the
>>>>> sm8350 doesn't have, requiring us to treat it differently, thus the
>>>>> incompatibility was acknowledged.
>>>> So they are perfectly compatible.
>>>>
>>>> I really do not understand what we are discussing here. Explain in
>>>> simple terms of DT spec: what is incompatible that SW cannot use one
>>>> interface to handle the other?
>>> 1. x1e80100 was a fallback of sc8280xp, it used "sc8280xp_bat_psy_desc"
>>
>> No, that's not true. Read the binding again:
>>
>> - qcom,x1e80100-pmic-glink
>> - const: qcom,sm8550-pmic-glink
>>
>> No fallback to sc8280xp.
>>
>>
>>> when registering the power supply device.
>>>
>>> 2. sm8550 was a fallback of sm8350, and they all used
>>
>> Also not true. The remaining fallback is not sm8350.
>>
>>
>>> "sm8350_bat_psy_desc" when registering the power supply device.
>>>
>>> 3. x1e80100 and sm8550 they are incompatible as they are using different
>>> data structure of "xxx_bat_psy_desc" and other “psy_desc" too, such as,
>>> ac/usb/wls.
>> Look at the driver and bindings now - they are compatible. It looks like
>> you made it incompatible and now you claim the "they are incompatible".
>> No, you did it. Look at the driver.
>>
>>
>>
>>> 4. For charge control functionality, it's only supported in the battery
>>> management firmware in x1e80100 and sm8550 platforms. And the change in
>>> battmgr driver (patch [5/8]) adds the support by using 2 additional
>>> power supply properties, which eventually need to be added in the
>>> "properties" data member of "xxx_bat_psy_desc" when registering power
>>> supply devices. Hence, "x1e80100_bat_psy_desc" and "sm8550_bat_psy_desc"
>>> are created and used separately when registering power supply device
>>> according to the "variant" value defined in the match data.
>>>
>>> The main code change is in [5/8], I am pasting a snippet which might
>>> help to explain this a little bit:
>>>
>>> - if (battmgr->variant == QCOM_BATTMGR_SC8280XP) {
>>> - battmgr->bat_psy = devm_power_supply_register(dev,
>>> &sc8280xp_bat_psy_desc, &psy_cfg);
>>> + if (battmgr->variant == QCOM_BATTMGR_SC8280XP ||
>>> battmgr->variant == QCOM_BATTMGR_X1E80100) {
>>> + if (battmgr->variant == QCOM_BATTMGR_X1E80100)
>>> + psy_desc = &x1e80100_bat_psy_desc;
>>> + else
>>> + psy_desc = &sc8280xp_bat_psy_desc;
>>> +
>>> + battmgr->bat_psy = devm_power_supply_register(dev,
>>> psy_desc, &psy_cfg);
>>> if (IS_ERR(battmgr->bat_psy))
>>> return dev_err_probe(dev,
>>> PTR_ERR(battmgr->bat_psy),
>>
>> This explains nothing to me. I think you did not get my questions at all
>> and just want to push whatever you have in drivers.
>>
>> Such ping pongs are just tiring, so go back to my previous email, read
>> it carefully and try harder to understand what compatibility means.
>>
>>
>> NAK, you are affecting the users and ABI with justification "I make it
>> now incompatible, so it is incompatible".
>>
>> Best regards,
>> Krzysztof
>
> Thanks for the explanation with patience. I misunderstood the fallback behavior.
>
> I was worried about if the compatible string matching would work correctly if both the device node and the driver declared multiple identical compatible strings.
>
> I understand now and even if the device node and the driver have defined multiple identical compatible strings, the best match which is the most specific compatible string will be found.
>
> So in the example below, for X1E80100-CRD, the battmgr driver will always match to "qcom,x1e80100-pmic-glink" which is the most specific compatible string defined at the beginning of the device node compatible string, and the compatibility has not been broken.
>
> In qcom_battmgr driver:
>
> static const struct of_device_id qcom_battmgr_of_variants[] = {
> ...
> { .compatible = "qcom,x1e80100-pmic-glink", .data = (void *)QCOM_BATTMGR_X1E80100 },
> { .compatible = "qcom,sm8550-pmic-glink", .data = (void *)QCOM_BATTMGR_SM8550 },
> ...
> };
>
> In x1-crd.dtsi:
>
> pmic-glink {
> compatible = "qcom,x1e80100-pmic-glink",
> "qcom,sm8550-pmic-glink",
> "qcom,pmic-glink";
> ...
>
> }
>
> Let me know if my understanding is correct. I will drop patch [6/8],[7/8],[8/8] in next version.
Unless we have some mobile-firmware-specific calls/behaviors that apply to
sm8550, but not to x1e80100 (which I don't believe we do), I think this is
fair
Konrad
next prev parent reply other threads:[~2025-06-10 12:22 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 7:35 [PATCH v2 0/8] power: supply: Add several features support in qcom-battmgr driver Fenglin Wu via B4 Relay
2025-05-30 7:35 ` [PATCH v2 1/8] power: supply: core: Add resistance power supply property Fenglin Wu via B4 Relay
2025-06-22 1:26 ` Sebastian Reichel
2025-06-30 8:28 ` Fenglin Wu
2025-07-07 0:15 ` Sebastian Reichel
2025-07-25 8:33 ` Fenglin Wu
2025-05-30 7:35 ` [PATCH v2 2/8] power: supply: core: Add state_of_health " Fenglin Wu via B4 Relay
2025-06-02 6:17 ` Dmitry Baryshkov
2025-06-03 4:50 ` Fenglin Wu
2025-06-03 10:35 ` Dmitry Baryshkov
2025-06-05 6:08 ` Fenglin Wu
2025-06-05 6:34 ` Dmitry Baryshkov
2025-06-22 1:17 ` Sebastian Reichel
2025-07-25 8:17 ` Fenglin Wu
2025-05-30 7:35 ` [PATCH v2 3/8] power: supply: qcom_battmgr: Add resistance " Fenglin Wu via B4 Relay
2025-06-02 6:17 ` Dmitry Baryshkov
2025-05-30 7:35 ` [PATCH v2 4/8] power: supply: qcom_battmgr: Add state_of_health property Fenglin Wu via B4 Relay
2025-05-30 7:35 ` [PATCH v2 5/8] power: supply: qcom_battmgr: Add charge control support Fenglin Wu via B4 Relay
2025-05-30 8:48 ` Bryan O'Donoghue
2025-05-30 9:37 ` Fenglin Wu
2025-05-30 10:11 ` Bryan O'Donoghue
2025-06-03 5:43 ` Fenglin Wu
2025-05-31 10:36 ` György Kurucz
2025-06-03 5:48 ` Fenglin Wu
2025-06-03 10:37 ` Dmitry Baryshkov
2025-06-07 9:46 ` Konrad Dybcio
2025-06-09 2:39 ` Fenglin Wu
2025-06-09 7:17 ` Dmitry Baryshkov
2025-06-10 12:19 ` Konrad Dybcio
2025-05-30 7:35 ` [PATCH v2 6/8] dt-bindings: soc: qcom: pmic-glink: Move X1E80100 out of fallbacks Fenglin Wu via B4 Relay
2025-06-02 6:38 ` Dmitry Baryshkov
2025-06-02 7:40 ` Krzysztof Kozlowski
2025-06-03 6:42 ` Fenglin Wu
2025-06-03 6:47 ` Krzysztof Kozlowski
2025-06-03 6:59 ` Fenglin Wu
2025-06-03 7:06 ` Krzysztof Kozlowski
2025-06-03 7:41 ` Fenglin Wu
2025-06-03 9:34 ` Krzysztof Kozlowski
2025-06-04 9:40 ` Fenglin Wu
2025-06-10 12:22 ` Konrad Dybcio [this message]
2025-05-30 7:35 ` [PATCH v2 7/8] usb: typec: ucsi_glink: Add UCSI quirk for X1E80100 platform Fenglin Wu via B4 Relay
2025-05-30 8:35 ` Bryan O'Donoghue
2025-05-30 7:35 ` [PATCH v2 8/8] arm64: dts: qcom: x1*: Remove qcom,sm8550-pmic-glink fallback Fenglin Wu via B4 Relay
2025-06-02 7:41 ` Krzysztof Kozlowski
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=024285a5-734a-4543-8a7b-897f8186904d@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=david.collins@oss.qualcomm.com \
--cc=devicetree@vger.kernel.org \
--cc=fenglin.wu@oss.qualcomm.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sre@kernel.org \
--cc=subbaraman.narayanamurthy@oss.qualcomm.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®