* [PATCH v2 0/3] dt-bindings: mmc: / ARM: qcom: add MSM8998 and cleanup driver of_device_id
@ 2022-07-12 15:02 Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 1/3] dt-bindings: mmc: sdhci-msm: add MSM8998 Krzysztof Kozlowski
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12 15:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
linux-mmc, devicetree, linux-kernel, linux-arm-msm
Cc: Krzysztof Kozlowski, Doug Anderson
Hi,
Changes since v1:
1. Add Rb tags.
2. Rework driver patch (now last in the series), after talk with Doug.
https://lore.kernel.org/linux-devicetree/CAD=FV=WGxQF4vPuRi7kWKoqTpe0RFsgH+J82C=sQbmncK_AFpw@mail.gmail.com/
Best regards,
Krzysztof
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>
Cc: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
Krzysztof Kozlowski (3):
dt-bindings: mmc: sdhci-msm: add MSM8998
arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible
mmc: sdhci-msm: drop redundant of_device_id entries
.../devicetree/bindings/mmc/sdhci-msm.yaml | 1 +
arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +-
drivers/mmc/host/sdhci-msm.c | 25 -------------------
3 files changed, 2 insertions(+), 26 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] dt-bindings: mmc: sdhci-msm: add MSM8998
2022-07-12 15:02 [PATCH v2 0/3] dt-bindings: mmc: / ARM: qcom: add MSM8998 and cleanup driver of_device_id Krzysztof Kozlowski
@ 2022-07-12 15:02 ` Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 2/3] arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries Krzysztof Kozlowski
2 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12 15:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
linux-mmc, devicetree, linux-kernel, linux-arm-msm
Cc: Krzysztof Kozlowski, Douglas Anderson
Add a MSM8998-specific SDCC compatible, because using only a generic
qcom,sdhci-msm-v4 fallback is deprecated.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>
Cc: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
---
Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
index 31a3ce208e1a..0853d0c32dc7 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
@@ -30,6 +30,7 @@ properties:
- qcom,msm8992-sdhci
- qcom,msm8994-sdhci
- qcom,msm8996-sdhci
+ - qcom,msm8998-sdhci
- const: qcom,sdhci-msm-v4 # for sdcc versions less than 5.0
- items:
- enum:
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible
2022-07-12 15:02 [PATCH v2 0/3] dt-bindings: mmc: / ARM: qcom: add MSM8998 and cleanup driver of_device_id Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 1/3] dt-bindings: mmc: sdhci-msm: add MSM8998 Krzysztof Kozlowski
@ 2022-07-12 15:02 ` Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries Krzysztof Kozlowski
2 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12 15:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
linux-mmc, devicetree, linux-kernel, linux-arm-msm
Cc: Krzysztof Kozlowski, Douglas Anderson
Add a MSM8998-specific SDCC compatible, because using only a generic
qcom,sdhci-msm-v4 fallback is deprecated.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
---
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>
Cc: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
---
arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
index 85bbd4f7306d..e263a59d84b0 100644
--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
@@ -2076,7 +2076,7 @@ qusb2phy: phy@c012000 {
};
sdhc2: mmc@c0a4900 {
- compatible = "qcom,sdhci-msm-v4";
+ compatible = "qcom,msm8998-sdhci", "qcom,sdhci-msm-v4";
reg = <0x0c0a4900 0x314>, <0x0c0a4000 0x800>;
reg-names = "hc_mem", "core_mem";
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries
2022-07-12 15:02 [PATCH v2 0/3] dt-bindings: mmc: / ARM: qcom: add MSM8998 and cleanup driver of_device_id Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 1/3] dt-bindings: mmc: sdhci-msm: add MSM8998 Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 2/3] arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible Krzysztof Kozlowski
@ 2022-07-12 15:02 ` Krzysztof Kozlowski
2022-07-13 15:57 ` Doug Anderson
2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12 15:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
linux-mmc, devicetree, linux-kernel, linux-arm-msm
Cc: Krzysztof Kozlowski, Doug Anderson
This reverts three commits:
1. Revert "mmc: sdhci-msm: Add compatible string check for sdx65"
This reverts commit 953706844f0f2fd4dc6984cc010fe6cf51c041f2.
2. Revert "mmc: sdhci-msm: Add compatible string check for sm8150"
This reverts commit 5acd6adb65802cc6f9986be3750179a820580d37.
3. Revert "mmc: sdhci-msm: Add SoC specific compatibles"
This reverts commit 466614a9765c6fb67e1464d0a3f1261db903834b.
The oldest commit 466614a9765c ("mmc: sdhci-msm: Add SoC specific
compatibles") did not specify what benefits such multiple compatibles
bring, therefore assume there is none. On the other hand such approach
brings a lot of churn to driver maintenance by expecting commit for
every new compatible, even though it is already covered by the fallback.
There is really no sense in duplicating of_device_id for each
variant, which is already covered by generic compatible fallback
qcom,sdhci-msm-v4 or qcom,sdhci-msm-v5.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>
Cc: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
---
drivers/mmc/host/sdhci-msm.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index e395411fb6fd..ff9f5b63c337 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2435,33 +2435,8 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
};
static const struct of_device_id sdhci_msm_dt_match[] = {
- /* Following two entries are deprecated (kept only for backward compatibility) */
{.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
{.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
- /* Add entries for sdcc versions less than 5.0 here */
- {.compatible = "qcom,apq8084-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8226-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8916-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8953-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8974-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8992-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8994-sdhci", .data = &sdhci_msm_mci_var},
- {.compatible = "qcom,msm8996-sdhci", .data = &sdhci_msm_mci_var},
- /*
- * Add entries for sdcc version 5.0 here. For SDCC version 5.0.0,
- * MCI registers are removed from SDCC interface and some registers
- * are moved to HC.
- */
- {.compatible = "qcom,qcs404-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sdx55-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sdx65-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sdm630-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sm6125-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sm6350-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sm8150-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sm8250-sdhci", .data = &sdhci_msm_v5_var},
- {.compatible = "qcom,sc7280-sdhci", .data = &sdhci_msm_v5_var},
- /* Add entries where soc specific handling is required, here */
{.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
{.compatible = "qcom,sc7180-sdhci", .data = &sdm845_sdhci_var},
{},
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries
2022-07-12 15:02 ` [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries Krzysztof Kozlowski
@ 2022-07-13 15:57 ` Doug Anderson
2022-07-13 16:07 ` Krzysztof Kozlowski
0 siblings, 1 reply; 7+ messages in thread
From: Doug Anderson @ 2022-07-13 15:57 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
Linux MMC List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML,
linux-arm-msm
Hi,
On Tue, Jul 12, 2022 at 8:02 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> This reverts three commits:
> 1. Revert "mmc: sdhci-msm: Add compatible string check for sdx65"
> This reverts commit 953706844f0f2fd4dc6984cc010fe6cf51c041f2.
>
> 2. Revert "mmc: sdhci-msm: Add compatible string check for sm8150"
> This reverts commit 5acd6adb65802cc6f9986be3750179a820580d37.
>
> 3. Revert "mmc: sdhci-msm: Add SoC specific compatibles"
> This reverts commit 466614a9765c6fb67e1464d0a3f1261db903834b.
>
> The oldest commit 466614a9765c ("mmc: sdhci-msm: Add SoC specific
> compatibles") did not specify what benefits such multiple compatibles
> bring, therefore assume there is none. On the other hand such approach
> brings a lot of churn to driver maintenance by expecting commit for
> every new compatible, even though it is already covered by the fallback.
>
> There is really no sense in duplicating of_device_id for each
> variant, which is already covered by generic compatible fallback
> qcom,sdhci-msm-v4 or qcom,sdhci-msm-v5.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Personally, I would have taken the extra step and added a comment in
the code to prevent someone from doing this again. Maybe like this:
/*
* In the device tree, all boards are required to have _two_ compatible
* strings listed: a SoC-specific one followed by a more generic one.
* Normally we can just rely on the generic string, but we always
* include both so that if we ever find a bug on a specific SoC that
* we need to workaround (like in sdm845/sc7180) that we can quickly
* work around it without any changes to the dts.
*/
In any case:
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries
2022-07-13 15:57 ` Doug Anderson
@ 2022-07-13 16:07 ` Krzysztof Kozlowski
2022-07-13 16:10 ` Doug Anderson
0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-13 16:07 UTC (permalink / raw)
To: Doug Anderson
Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
Linux MMC List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML,
linux-arm-msm
On 13/07/2022 17:57, Doug Anderson wrote:
> Hi,
>
> On Tue, Jul 12, 2022 at 8:02 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> This reverts three commits:
>> 1. Revert "mmc: sdhci-msm: Add compatible string check for sdx65"
>> This reverts commit 953706844f0f2fd4dc6984cc010fe6cf51c041f2.
>>
>> 2. Revert "mmc: sdhci-msm: Add compatible string check for sm8150"
>> This reverts commit 5acd6adb65802cc6f9986be3750179a820580d37.
>>
>> 3. Revert "mmc: sdhci-msm: Add SoC specific compatibles"
>> This reverts commit 466614a9765c6fb67e1464d0a3f1261db903834b.
>>
>> The oldest commit 466614a9765c ("mmc: sdhci-msm: Add SoC specific
>> compatibles") did not specify what benefits such multiple compatibles
>> bring, therefore assume there is none. On the other hand such approach
>> brings a lot of churn to driver maintenance by expecting commit for
>> every new compatible, even though it is already covered by the fallback.
>>
>> There is really no sense in duplicating of_device_id for each
>> variant, which is already covered by generic compatible fallback
>> qcom,sdhci-msm-v4 or qcom,sdhci-msm-v5.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Personally, I would have taken the extra step and added a comment in
> the code to prevent someone from doing this again. Maybe like this:
>
> /*
> * In the device tree, all boards are required to have _two_ compatible
> * strings listed: a SoC-specific one followed by a more generic one.
> * Normally we can just rely on the generic string, but we always
> * include both so that if we ever find a bug on a specific SoC that
> * we need to workaround (like in sdm845/sc7180) that we can quickly
> * work around it without any changes to the dts.
> */
This actually does not instruct the developer not to add new variants to
the driver, so how about something like:
/* Do not add new variants to the driver which are compatible with
generic ones, unless they need customization. */
?
The problem is that this applies to several such drivers on several
platforms (Qualcomm, NXP - these for sure use such pattern), so we would
be documenting something obvious, IMO.
>
> In any case:
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries
2022-07-13 16:07 ` Krzysztof Kozlowski
@ 2022-07-13 16:10 ` Doug Anderson
0 siblings, 0 replies; 7+ messages in thread
From: Doug Anderson @ 2022-07-13 16:10 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Adrian Hunter, Bhupesh Sharma,
Linux MMC List,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, LKML,
linux-arm-msm
Hi,
On Wed, Jul 13, 2022 at 9:07 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 13/07/2022 17:57, Doug Anderson wrote:
> > Hi,
> >
> > On Tue, Jul 12, 2022 at 8:02 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> This reverts three commits:
> >> 1. Revert "mmc: sdhci-msm: Add compatible string check for sdx65"
> >> This reverts commit 953706844f0f2fd4dc6984cc010fe6cf51c041f2.
> >>
> >> 2. Revert "mmc: sdhci-msm: Add compatible string check for sm8150"
> >> This reverts commit 5acd6adb65802cc6f9986be3750179a820580d37.
> >>
> >> 3. Revert "mmc: sdhci-msm: Add SoC specific compatibles"
> >> This reverts commit 466614a9765c6fb67e1464d0a3f1261db903834b.
> >>
> >> The oldest commit 466614a9765c ("mmc: sdhci-msm: Add SoC specific
> >> compatibles") did not specify what benefits such multiple compatibles
> >> bring, therefore assume there is none. On the other hand such approach
> >> brings a lot of churn to driver maintenance by expecting commit for
> >> every new compatible, even though it is already covered by the fallback.
> >>
> >> There is really no sense in duplicating of_device_id for each
> >> variant, which is already covered by generic compatible fallback
> >> qcom,sdhci-msm-v4 or qcom,sdhci-msm-v5.
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >
> > Personally, I would have taken the extra step and added a comment in
> > the code to prevent someone from doing this again. Maybe like this:
> >
> > /*
> > * In the device tree, all boards are required to have _two_ compatible
> > * strings listed: a SoC-specific one followed by a more generic one.
> > * Normally we can just rely on the generic string, but we always
> > * include both so that if we ever find a bug on a specific SoC that
> > * we need to workaround (like in sdm845/sc7180) that we can quickly
> > * work around it without any changes to the dts.
> > */
>
> This actually does not instruct the developer not to add new variants to
> the driver, so how about something like:
>
> /* Do not add new variants to the driver which are compatible with
> generic ones, unless they need customization. */
> ?
Sure, that would be fine.
> The problem is that this applies to several such drivers on several
> platforms (Qualcomm, NXP - these for sure use such pattern), so we would
> be documenting something obvious, IMO.
The problem is that the people adding to this file are probably not
device tree experts and may not know, so a short comment might be
worthwhile. If you don't think it's a good idea, though, I won't push.
-Doug
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-13 16:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 15:02 [PATCH v2 0/3] dt-bindings: mmc: / ARM: qcom: add MSM8998 and cleanup driver of_device_id Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 1/3] dt-bindings: mmc: sdhci-msm: add MSM8998 Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 2/3] arm64: dts: qcom: msm8998: add MSM8998 SDCC specific compatible Krzysztof Kozlowski
2022-07-12 15:02 ` [PATCH v2 3/3] mmc: sdhci-msm: drop redundant of_device_id entries Krzysztof Kozlowski
2022-07-13 15:57 ` Doug Anderson
2022-07-13 16:07 ` Krzysztof Kozlowski
2022-07-13 16:10 ` Doug Anderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.