dt-bindings: mmc: fsl-imx-esdhc: allow more compatible combinations
Subsystems (3)
PATCH 1/1 dt-bindings: mmc: fsl-imx-esdhc: allow more compatible combinations
Currently make dtbs_check shows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.
Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/
Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make dtbs_check.
--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +24 -0
@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhc + - items: + - const: fsl,imx50-esdhc + - const: fsl,imx53-esdhc + - items: + - const: fsl,imx6sl-usdhc + - const: fsl,imx6q-usdhc + - items: + - const: fsl,imx6sll-usdhc + - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx6sx-usdhc + - const: fsl,imx6sl-usdhc + - items: + - const: fsl,imx6ul-usdhc + - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx6ull-usdhc + - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx7d-usdhc + - const: fsl,imx6sl-usdhc + - items: + - const: fsl,imx7ulp-usdhc + - const: fsl,imx6sx-usdhc - items: - enum: - fsl,imx8mq-usdhc
Signature · 1 line
2.30.2
Quoted 23 lines · Andreas Kemnade
Currently make
dtbs_checkshows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make
dtbs_check.Signed-off-by Andreas Kemnade <[email protected]>--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 39
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhc
You must drop the items from enum above. Binding saying:
compatible="A"
or:
compatible="A", "B"
is not correct. Either A is or is not compatible with B.
Quoted 14 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +14
-0+ - items: + - const: fsl,imx50-esdhc + - const: fsl,imx53-esdhc + - items: + - const: fsl,imx6sl-usdhc + - const: fsl,imx6q-usdhc + - items: + - const: fsl,imx6sll-usdhc + - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx6sx-usdhc + - const: fsl,imx6sl-usdhc + - items: + - const: fsl,imx6ul-usdhc
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 63
Quoted 10 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +10
-0+ - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx6ull-usdhc + - const: fsl,imx6sx-usdhc + - items: + - const: fsl,imx7d-usdhc + - const: fsl,imx6sl-usdhc + - items: + - const: fsl,imx7ulp-usdhc + - const: fsl,imx6sx-usdhc
Half of these should be enum (6ul, 7ulp etc) with fallback.
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 66
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0- items: - enum: - fsl,imx8mq-usdhc
Best regards,
Krzysztof
Quoted 33 lines · On Fri, 6 Jan 2023 09:41:01 +0100 Krzysztof Kozlowski…
Quoted 23 lines · Andreas Kemnade
Currently make
dtbs_checkshows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make
dtbs_check.Signed-off-by Andreas Kemnade <[email protected]>--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 39
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhcYou must drop the items from enum above. Binding saying:
compatible="A"
or:
compatible="A", "B"
Quoted 2 lines
is not correct. Either A is or is not compatible with B.
hmm, here we have A = B + some additional features
or
A = B + some additional features and additional quirks required.
For the latter we have e.g.
A=
static const struct esdhc_soc_data usdhc_imx6sx_data = {
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
| ESDHC_FLAG_STATE_LOST_IN_LPMODE
| ESDHC_FLAG_BROKEN_AUTO_CMD23,
};
B=
static const struct esdhc_soc_data usdhc_imx6sl_data = {
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536
| ESDHC_FLAG_HS200
| ESDHC_FLAG_BROKEN_AUTO_CMD23,
};so there is the difference in ESDHC_FLAG_STATE_LOST_IN_LPMODE. That might make no difference in some usage scenario (e.g. some bootloader not doing any LPMODE), but I wonder why
we need to *enforce* specifying such half-compatible things.
Regards,
Andreas
Quoted 36 lines · Andreas Kemnade
Quoted 33 lines · On Fri, 6 Jan 2023 09:41:01 +0100 Krzysztof Kozlowski…
Quoted 23 lines · Andreas Kemnade
Currently make
dtbs_checkshows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make
dtbs_check.Signed-off-by Andreas Kemnade <[email protected]>--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 39
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhcYou must drop the items from enum above. Binding saying:
compatible="A"
or:
compatible="A", "B"
Quoted 5 lines
Quoted 2 lines
is not correct. Either A is or is not compatible with B.
hmm, here we have A = B + some additional features
or
A = B + some additional features and additional quirks required.
So why do you allow A alone?
Quoted 17 lines
For the latter we have e.g.
A=static const struct esdhc_soc_data usdhc_imx6sx_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 | ESDHC_FLAG_STATE_LOST_IN_LPMODE | ESDHC_FLAG_BROKEN_AUTO_CMD23, }; B= static const struct esdhc_soc_data usdhc_imx6sl_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536 | ESDHC_FLAG_HS200 | ESDHC_FLAG_BROKEN_AUTO_CMD23, };
Quoted 4 lines
so there is the difference in
ESDHC_FLAG_STATE_LOST_IN_LPMODE. That might make no difference in some usage scenario (e.g. some bootloader not doing any LPMODE), but I wonder why
we need to *enforce* specifying such half-compatible things.
I asked to remove half-compatible. Not to enforce.
Best regards,
Krzysztof
Quoted 37 lines · On Sat, 7 Jan 2023 14:23:08 +0100 Krzysztof Kozlowski…
Quoted 36 lines · Andreas Kemnade
Quoted 33 lines · On Fri, 6 Jan 2023 09:41:01 +0100 Krzysztof Kozlowski…
Quoted 23 lines · Andreas Kemnade
Currently make
dtbs_checkshows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make
dtbs_check.Signed-off-by Andreas Kemnade <[email protected]>--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 39
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhcYou must drop the items from enum above. Binding saying:
compatible="A"
or:
compatible="A", "B"
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
is not correct. Either A is or is not compatible with B.
hmm, here we have A = B + some additional features
or
A = B + some additional features and additional quirks required.So why do you allow A alone?
because A is full-compatible, and B is half-compatible, because the additional required quirks are not applied.
Quoted 17 lines
Quoted 17 lines
For the latter we have e.g.
A=static const struct esdhc_soc_data usdhc_imx6sx_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 | ESDHC_FLAG_STATE_LOST_IN_LPMODE | ESDHC_FLAG_BROKEN_AUTO_CMD23, }; B= static const struct esdhc_soc_data usdhc_imx6sl_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536 | ESDHC_FLAG_HS200 | ESDHC_FLAG_BROKEN_AUTO_CMD23, };
Quoted 7 lines
Quoted 4 lines
so there is the difference in
ESDHC_FLAG_STATE_LOST_IN_LPMODE. That might make no difference in some usage scenario (e.g. some bootloader not doing any LPMODE), but I wonder why
we need to *enforce* specifying such half-compatible things.I asked to remove half-compatible. Not to enforce.
well B is half-compatible, I (and others) have sent patches to remove, but they were rejected. I consider these patches the way to go.
Regards,
Andreas
Quoted 42 lines · Andreas Kemnade
Quoted 39 lines · On Sat, 7 Jan 2023 14:23:08 +0100 Krzysztof Kozlowski…
Quoted 38 lines · Andreas Kemnade
Quoted 35 lines · On Fri, 6 Jan 2023 09:41:01 +0100 Krzysztof Kozlowski…
Quoted 23 lines · Andreas Kemnade
Currently make
dtbs_checkshows lots of errors because imx*.dtsi does not use single compatibles but combinations of them.
Allow all the combinations used there.Patches fixing the dtsi files according to binding documentation were submitted multiple times and are commonly rejected, so relax the rules. Example:
https://lore.kernel.org/linux-devicetree/[email protected]/Reason: compatibility of new dtbs with old kernels or bootloaders.
This will significantly reduce noise on make
dtbs_check.Signed-off-by Andreas Kemnade <[email protected]>--- .../bindings/mmc/fsl-imx-esdhc.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml properties: · line 39
Quoted 3 lines
Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.yaml +0
-0@@ -37,6 +37,30 @@ properties: - fsl,imx8mm-usdhc - fsl,imxrt1050-usdhc - nxp,s32g2-usdhcYou must drop the items from enum above. Binding saying:
compatible="A"
or:
compatible="A", "B"is not correct. Either A is or is not compatible with B.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
hmm, here we have A = B + some additional features
or
A = B + some additional features and additional quirks required.So why do you allow A alone?
because A is full-compatible, and B is half-compatible, because the additional required quirks are not applied.
As I explained you in private message you sent me:
That's not how compatibles are working. If device is not compatible with B, then you cannot have it as fallback, so the patch is not correct.
If device is A and is compatible with B, then keeping A and A+B is also incorrect because it is redundant.
This is not only here, it's everywhere, so I do not see the point to make exception for this device. Patch is incorrect.
Best regards,
Krzysztof
Quoted 22 lines
Quoted 22 lines
Quoted 21 lines
For the latter we have e.g.
A=static const struct esdhc_soc_data usdhc_imx6sx_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200 | ESDHC_FLAG_STATE_LOST_IN_LPMODE | ESDHC_FLAG_BROKEN_AUTO_CMD23, }; B= static const struct esdhc_soc_data usdhc_imx6sl_data = { .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536 | ESDHC_FLAG_HS200 | ESDHC_FLAG_BROKEN_AUTO_CMD23, };so there is the difference in
ESDHC_FLAG_STATE_LOST_IN_LPMODE. That might make no difference in some usage scenario (e.g. some bootloader not doing any LPMODE), but I wonder why
we need to *enforce* specifying such half-compatible things.
Quoted 4 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
well B is half-compatible, I (and others) have sent patches to remove, but they were rejected. I consider these patches the way to go.
No, they are not correct.
Best regards,
Krzysztof
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:
[...]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.
Quoted 5 lines
Quoted 2 lines
well B is half-compatible, I (and others) have sent patches to remove, but they were rejected. I consider these patches the way to go.
No, they are not correct.
Maybe there is some misunderstanding "these patches" = e.g.
https://lore.kernel.org/linux-devicetree/[email protected]/
Regards,
Andreas
_______________________________________________
linux-arm-kernel mailing list [email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 10 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.
I did not say that. It's not related to this problem.
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
Best regards,
Krzysztof
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:
compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/
compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))
having mismatch between binding definition and devicetree causes dtbs_check errors
-> also not nice.
I rather drop this patch and learn to live with dtbs_check errors for this one since I have no idea how to proceed. All roads are blocked. This all causes too much churn.
Regards,
Andreas
Quoted 28 lines · Andreas Kemnade
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:
Quoted 8 lines
compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))
No, half compatible is the A in such case.
Quoted 7 lines
having mismatch between binding definition and devicetree causes
dtbs_checkerrors
-> also not nice.I rather drop this patch and learn to live with
dtbs_checkerrors for this one since I have no idea how to proceed. All roads are blocked. This all causes too much churn.
And why you cannot implement what I asked for?
Best regards,
Krzysztof
Quoted 35 lines · On Sat, 7 Jan 2023 16:07:35 +0100 Krzysztof Kozlowski…
Quoted 34 lines · Andreas Kemnade
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/
Quoted 5 lines
Quoted 2 lines
compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))No, half compatible is the A in such case.
I think that there is some misunderstanding in here. I try once again.
Define compatible with "X" here:
To me it means:
device fully works with flags defined in:
static const struct esdhc_soc_data usdhc_X_data = { ... };
with usdhc_X_data referenced in
{ .compatible = "X", .data = &usdhc_X_data, },So if there is only "A" matching with above definition of compatibility
compatible = "A" would sound sane to me.
And scrutinizing the flags more and not just wanting to achieve error-free dtbs_check, I think is this in most cases where there is only "A".
If there is "A" and "B" which match that compatibility definition, you say that only compatible = "A", "B" is allowed, but not compatible = "A". In that case I would have no problem with that.
But if there is only "A" but no "B" matching the above definition, I would expect that only compatible = "A" is allowed but *not* compatible = "A", "B".
Regards,
Andreas
Quoted 62 lines · Andreas Kemnade
Quoted 35 lines · On Sat, 7 Jan 2023 16:07:35 +0100 Krzysztof Kozlowski…
Quoted 34 lines · Andreas Kemnade
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/Quoted 5 lines
Quoted 2 lines
compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))No, half compatible is the A in such case.
I think that there is some misunderstanding in here. I try once again.
Define compatible with "X" here:
To me it means:device fully works with flags defined in:
static const struct
esdhc_soc_datausdhc_X_data= { ... };with
usdhc_X_datareferenced in{ .compatible = "X", .data = &usdhc_X_data, },So if there is only "A" matching with above definition of compatibility
compatible = "A" would sound sane to me.And scrutinizing the flags more and not just wanting to achieve error-free
dtbs_check, I think is this in most cases where there is only "A".
Quoted 6 lines
If there is "A" and "B" which match that compatibility definition, you say that only compatible = "A", "B" is allowed, but not compatible = "A". In that case I would have no problem with that.
But if there is only "A" but no "B" matching the above definition, I would expect that only compatible = "A" is allowed but *not* compatible = "A", "B".
Sorry, I don't follow. I also do not understand what "matching" means in these terms (binding driver? of_match?) and also I do not know what is the "above definition".
Devicetree spec defines the compatibility - so this is the definition. There will be differences when applying it to different cases.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 70 lines · On Sun, 8 Jan 2023 15:45:44 +0100 Krzysztof Kozlowski…
Quoted 62 lines · Andreas Kemnade
Quoted 35 lines · On Sat, 7 Jan 2023 16:07:35 +0100 Krzysztof Kozlowski…
Quoted 34 lines · Andreas Kemnade
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/Quoted 5 lines
Quoted 2 lines
compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))No, half compatible is the A in such case.
I think that there is some misunderstanding in here. I try once again.
Define compatible with "X" here:
To me it means:device fully works with flags defined in:
static const struct
esdhc_soc_datausdhc_X_data= { ... };with
usdhc_X_datareferenced in{ .compatible = "X", .data = &usdhc_X_data, },So if there is only "A" matching with above definition of compatibility
compatible = "A" would sound sane to me.And scrutinizing the flags more and not just wanting to achieve error-free
dtbs_check, I think is this in most cases where there is only "A".Quoted 6 lines
If there is "A" and "B" which match that compatibility definition, you say that only compatible = "A", "B" is allowed, but not compatible = "A". In that case I would have no problem with that.
But if there is only "A" but no "B" matching the above definition, I would expect that only compatible = "A" is allowed but *not* compatible = "A", "B".
Quoted 7 lines
Sorry, I don't follow. I also do not understand what "matching" means in these terms (binding driver?
of_match?) and also I do not know what is the "above definition".Devicetree spec defines the compatibility - so this is the definition. There will be differences when applying it to different cases.
Ok, lets stop talking about A and B, lets be more specific. Hmm, I try to insert the missing bits here:
I am not convinced anymore that my patch is correct
- for dtb compatible formality
- for pure technical reasons
I am not convinced that your proposal is correct either.
- for pure technical reasons (for same resan as you state)
Especially this part I consider faulty:
+ - items:
+ - const: fsl,imx6sx-usdhc
+ - const: fsl,imx6sl-usdhc
Keyword: ESDHC_FLAG_STATE_LOST_IN_LPMODE (detailed that in an earlier mail).
Regards
Andreas
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 51 lines · Andreas Kemnade
Quoted 29 lines
Quoted 22 lines
Quoted 3 lines
No, half compatible is the A in such case.
I think that there is some misunderstanding in here. I try once again.
Define compatible with "X" here:
To me it means:device fully works with flags defined in:
static const struct
esdhc_soc_datausdhc_X_data= { ... };with
usdhc_X_datareferenced in{ .compatible = "X", .data = &usdhc_X_data, },So if there is only "A" matching with above definition of compatibility
compatible = "A" would sound sane to me.And scrutinizing the flags more and not just wanting to achieve error-free
dtbs_check, I think is this in most cases where there is only "A".Quoted 6 lines
If there is "A" and "B" which match that compatibility definition, you say that only compatible = "A", "B" is allowed, but not compatible = "A". In that case I would have no problem with that.
But if there is only "A" but no "B" matching the above definition, I would expect that only compatible = "A" is allowed but *not* compatible = "A", "B".
Quoted 7 lines
Sorry, I don't follow. I also do not understand what "matching" means in these terms (binding driver?
of_match?) and also I do not know what is the "above definition".Devicetree spec defines the compatibility - so this is the definition. There will be differences when applying it to different cases.
Ok, lets stop talking about A and B, lets be more specific. Hmm, I try to insert the missing bits here:
I am not convinced anymore that my patch is correct
- for dtb compatible formality
- for pure technical reasonsI am not convinced that your proposal is correct either.
- for pure technical reasons (for same resan as you state)Especially this part I consider faulty:
(quoted diff) +3
-0+ - items: + - const: fsl,imx6sx-usdhc + - const: fsl,imx6sl-usdhc
Quoted 2 lines
Keyword:
ESDHC_FLAG_STATE_LOST_IN_LPMODE(detailed that in an earlier mail).
I am not discussing here real compatibility for your hardware, as I don't know whether 6SX is or is not compatible with 6SL. I am saying that it either is or is not. Cannot be both at the same time.
Now for the question about 6SX+6SL. Rob responded here detailing when compatibility of SX and SL is valid. If your hardware fits this case, then remove the alone SX from enum and add SX+SL list like in this patch.
If your hardware does not fit, so there is no single 6SX client which can use 6SL compatible and work somehow (e.g. half-speed, reduced capabilities but still work correctly), then please bring back the DTS patches. I am not sure if other people who commented on DTS, are following our discussion here...
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Rob Herring
maintainerQuoted 62 lines · Andreas Kemnade
Quoted 35 lines · On Sat, 7 Jan 2023 16:07:35 +0100 Krzysztof Kozlowski…
Quoted 34 lines · Andreas Kemnade
Quoted 5 lines · On Sat, 7 Jan 2023 15:09:24 +0100 Krzysztof Kozlowski…
Quoted 4 lines · Andreas Kemnade
On Sat, 7 Jan 2023 15:00:56 +0100
Krzysztof Kozlowski <[email protected]> wrote:[...]
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
I asked to remove half-compatible. Not to enforce.
so you are saying that allowing
compatible = "A", "B"
is not ok, if B is not fully compatible. I agree with that one.I did not say that. It's not related to this problem.
You said "I asked to remove half-compatible" that means to me remove "B" if not fully compatible with A which sounds sane to me.
Quoted 5 lines
Again - you cannot have device which is and is not compatible with something else. It's not a Schroedinger's cat to be in two states, unless you explicitly document the cases (there are exception). If this is such exception, it requires it's own documentation.
so conclusion:
If having A and B half-compatible with A:compatible = "A" only: is allowed to specifiy it the binding (status quo),
but not allowed to make the actual dtsi match the binding documentation
https://lore.kernel.org/linux-devicetree/[email protected]/
and
https://lore.kernel.org/linux-devicetree/[email protected]/Quoted 5 lines
Quoted 2 lines
compatible = "A", "B" in the binding definition: is not allowed ("I asked to remove
half-compatible" (= removing B))No, half compatible is the A in such case.
I think that there is some misunderstanding in here. I try once again.
Define compatible with "X" here:
To me it means:device fully works with flags defined in:
static const struct
esdhc_soc_datausdhc_X_data= { ... };with
usdhc_X_datareferenced in{ .compatible = "X", .data = &usdhc_X_data, },So if there is only "A" matching with above definition of compatibility
compatible = "A" would sound sane to me.And scrutinizing the flags more and not just wanting to achieve error-free
dtbs_check, I think is this in most cases where there is only "A".
Quoted 6 lines
If there is "A" and "B" which match that compatibility definition, you say that only compatible = "A", "B" is allowed, but not compatible = "A". In that case I would have no problem with that.
But if there is only "A" but no "B" matching the above definition, I would expect that only compatible = "A" is allowed but *not* compatible = "A", "B".
A is either compatible with B or it isn't. You can look at that from the h/w perspective and client/OS perspective. From the h/w side, is the h/w interface the same or only has additions which can be ignored? On the client side, the question is whether a client that only understands B could use A's h/w without change. Looking at the match data is a good indicator of that for Linux. It's also possible the answer is different for different clients, but we only need 1 client that could benefit from compatibility.
Rob
Hi Rob,
Quoted 1 line · On Sun, 8 Jan 2023 16:46:33 -0600 Rob Herring <[email protected]> wrote:
A is either compatible with B or it isn't.
I think English and many natural languages allow to use the adjective in a non-black and white way to express things. So there can be things more compatible than others with certain levels of "gray" in between. But "compatible" in an artifical language like the devicetree can of course be more restrictive, so there needs to be a certian level of gray where the limit needs to be defined.The definition you give below.
Thanks for that.
Quoted 6 lines
You can look at that from
the h/w perspective and client/OS perspective. From the h/w side, is the h/w interface the same or only has additions which can be ignored? On the client side, the question is whether a client that only understands B could use A's h/w without change. Looking at the match data is a good indicator of that for Linux.
It seems that from a Linux client perspective that is a no in different cases, so B is not compatible.
Quoted 4 lines
It's also possible the answer is
different for different clients, but we only need 1 client that could benefit from compatibility.
On U-Boot side things seem to look different, since high speed modes are not enabled at all and pm is not done that much, so no quirks needed for that.
Looking at recent mainline u-boot.
{ .compatible = "fsl,imx51-esdhc", },
{ .compatible = "fsl,imx53-esdhc", },
{ .compatible = "fsl,imx6ul-usdhc", },
{ .compatible = "fsl,imx6sx-usdhc", },
{ .compatible = "fsl,imx6sl-usdhc", },
{ .compatible = "fsl,imx6q-usdhc", },So U-Boot will benefit from that additional compatible for fsl,imx6[su]ll-usdhc.
The first list of compatibles in U-Boot commit (96f0407b00f) was:
{ .compatible = "fsl,imx6ul-usdhc", },
{ .compatible = "fsl,imx6sx-usdhc", },
{ .compatible = "fsl,imx6sl-usdhc", },
{ .compatible = "fsl,imx6q-usdhc", },
{ .compatible = "fsl,imx7d-usdhc", },So replacing imx5X fallback compatibles with imx6something might be helpful for that old U-Boot. But I cannot fully jugde that, so I will not touch.
Well, I could also delete entries of this list and push a bunch of U-Boot forks somewhere, so creating a large number of different clients, which would then justify a long list of compatibles ;-)
But what initially worried me would be that there could be a client out there knowing only "B" and using all features but missing the in that case needed quirks for "A". Then adding "B" would cause harm. But apparently that is nothing to worry about.
I will send a reduced patch with just the things which are 100% clear to me.
Regards,
Andreas