diff mbox series

[v3,1/2] dt-bindings: display/msm: dsi-controller-main: Fix deprecated compatible

Message ID 20230304-topic-dsi_fixup-v3-1-b8565944d0e6@linaro.org (mailing list archive)
State New, archived
Headers show
Series Fix up Qualcomm DSI bindings | expand

Commit Message

Konrad Dybcio March 4, 2023, 3:55 p.m. UTC
The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl"
alone. This however didn't quite work out and the property became
undocumented instead of deprecated. Fix that.

Fixes: 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bryan O'Donoghue March 4, 2023, 4:59 p.m. UTC | #1
On 04/03/2023 15:55, Konrad Dybcio wrote:
> The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl"
> alone. This however didn't quite work out and the property became
> undocumented instead of deprecated. Fix that.
> 
> Fixes: 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> index f195530ae964..d534451c8f7f 100644
> --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> @@ -35,7 +35,7 @@ properties:
>         - items:
>             - enum:
>                 - qcom,dsi-ctrl-6g-qcm2290
> -          - const: qcom,mdss-dsi-ctrl
> +              - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible
>           deprecated: true
>   
>     reg:
> 

This change would make compatible = "qcom,dsi-ctrl-6g-qcm2290", 
"qcom,mdss-dsi-ctrl"; break though

Take this example, I'm going to use 8916 because its easy.

If we apply your change to dsi-controller-main.yaml

diff --git 
a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml 
b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index e75a3efe4dace..e93c16431f0a1 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -34,7 +34,7 @@ properties:
        - items:
            - enum:
                - dsi-ctrl-6g-qcm2290
-          - const: qcom,mdss-dsi-ctrl
+              - qcom,mdss-dsi-ctrl
          deprecated: true

    reg:

and then make 8916 == compatible = "qcom,dsi-ctrl-6g-qcm2290", 
"qcom,mdss-dsi-ctrl";

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi 
b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 0733c2f4f3798..7332b5f66a09d 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -1094,7 +1094,7 @@ mdp5_intf1_out: endpoint {
                         };

                         dsi0: dsi@1a98000 {
-                               compatible = "qcom,msm8916-dsi-ctrl",
+                               compatible = "dsi-ctrl-6g-qcm2290",
                                              "qcom,mdss-dsi-ctrl";
                                 reg = <0x01a98000 0x25c>;
                                 reg-names = "dsi_ctrl";

arch/arm64/boot/dts/qcom/apq8016-sbc.dtb: dsi@1a98000: compatible: 
'oneOf' conditional failed, one must be fixed:
	['dsi-ctrl-6g-qcm2290', 'qcom,mdss-dsi-ctrl'] is too long


so compatible = "qcom,dsi-ctrl-6g-qcm2290", "qcom,mdss-dsi-ctrl"; is now 
invalid, not deprecated.

This change also makes compatible = "qcom,dsi-ctrl-6g-qcm2290" or 
compatible = "qcom,mdss-dsi-ctrl" standalone valid compatible which is 
again not what we want.

- enum:
     - qcom,dsi-ctrl-6g-qcm2290
     - qcom,mdss-dsi-ctrl

means either "qcom,dsi-ctrl-6g-qcm2290" or "qcom,mdss-dsi-ctrl" are 
valid compat strings...

As an example if you apply your change and then change the msm8916.dtsi 
to the below

diff --git 
a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml 
b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index e75a3efe4dace..e93c16431f0a1 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -34,7 +34,7 @@ properties:
        - items:
            - enum:
                - dsi-ctrl-6g-qcm2290
-          - const: qcom,mdss-dsi-ctrl
+              - qcom,mdss-dsi-ctrl
          deprecated: true

    reg:
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi 
b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 0733c2f4f3798..829fbe05b5713 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
                         };

                         dsi0: dsi@1a98000 {
-                               compatible = "qcom,msm8916-dsi-ctrl",
-                                            "qcom,mdss-dsi-ctrl";
+                               compatible = "qcom,mdss-dsi-ctrl";
                                 reg = <0x01a98000 0x25c>;
                                 reg-names = "dsi_ctrl";

Then test it with

make O=$BUILDDIR DT_DOC_CHECKER=$DT_DOC_CHECKER 
DT_EXTRACT_EX=$DT_EXTRACT_EX DT_MK_SCHEMA=$DT_MK_SCHEMA 
DT_CHECKER=$DT_CHECKER CHECKER_FLAGS=-W=1 CHECK_DTBS=y qcom/apq8016-sbc.dtb

you'll see no error. However if you just do this

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi 
b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 0733c2f4f3798..829fbe05b5713 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
                         };

                         dsi0: dsi@1a98000 {
-                               compatible = "qcom,msm8916-dsi-ctrl",
-                                            "qcom,mdss-dsi-ctrl";
+                               compatible = "qcom,mdss-dsi-ctrl";
                                 reg = <0x01a98000 0x25c>;
                                 reg-names = "dsi_ctrl";


and run the same test you get

apq8016-sbc.dtb: dsi@1a98000: compatible: 'oneOf' conditional failed, 
one must be fixed:
	['qcom,mdss-dsi-ctrl'] is too short
	'qcom,mdss-dsi-ctrl' is not one of ['qcom,apq8064-dsi-ctrl', 
'qcom,msm8916-dsi-ctrl', 'qcom,msm8953-dsi-ctrl', 
'qcom,msm8974-dsi-ctrl', 'qcom,msm8996-dsi-ctrl', 
'qcom,msm8998-dsi-ctrl', 'qcom,qcm2290-dsi-ctrl', 
'qcom,sc7180-dsi-ctrl', 'qcom,sc7280-dsi-ctrl', 'qcom,sdm660-dsi-ctrl', 
'qcom,sdm845-dsi-ctrl', 'qcom,sm8150-dsi-ctrl', 'qcom,sm8250-dsi-ctrl', 
'qcom,sm8350-dsi-ctrl', 'qcom,sm8450-dsi-ctrl', 'qcom,sm8550-dsi-ctrl']

---
bod
Konrad Dybcio March 4, 2023, 5:35 p.m. UTC | #2
On 4.03.2023 17:59, Bryan O'Donoghue wrote:
> On 04/03/2023 15:55, Konrad Dybcio wrote:
>> The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl"
>> alone. This however didn't quite work out and the property became
>> undocumented instead of deprecated. Fix that.
>>
>> Fixes: 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC")
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
>> index f195530ae964..d534451c8f7f 100644
>> --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
>> +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
>> @@ -35,7 +35,7 @@ properties:
>>         - items:
>>             - enum:
>>                 - qcom,dsi-ctrl-6g-qcm2290
>> -          - const: qcom,mdss-dsi-ctrl
>> +              - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible
>>           deprecated: true
>>       reg:
>>
> 
> This change would make compatible = "qcom,dsi-ctrl-6g-qcm2290", "qcom,mdss-dsi-ctrl"; break though
Intended, they were never supposed to go together, as at the time
before this patchset (and its stated dependency) the fallback
would not be sufficient, the driver wouldn't even probe.

> 
> Take this example, I'm going to use 8916 because its easy.
> 
> If we apply your change to dsi-controller-main.yaml
> 
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> index e75a3efe4dace..e93c16431f0a1 100644
> --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> @@ -34,7 +34,7 @@ properties:
>        - items:
>            - enum:
>                - dsi-ctrl-6g-qcm2290
> -          - const: qcom,mdss-dsi-ctrl
> +              - qcom,mdss-dsi-ctrl
>          deprecated: true
> 
>    reg:
> 
> and then make 8916 == compatible = "qcom,dsi-ctrl-6g-qcm2290", "qcom,mdss-dsi-ctrl";
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 0733c2f4f3798..7332b5f66a09d 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -1094,7 +1094,7 @@ mdp5_intf1_out: endpoint {
>                         };
> 
>                         dsi0: dsi@1a98000 {
> -                               compatible = "qcom,msm8916-dsi-ctrl",
> +                               compatible = "dsi-ctrl-6g-qcm2290",
>                                              "qcom,mdss-dsi-ctrl";
>                                 reg = <0x01a98000 0x25c>;
>                                 reg-names = "dsi_ctrl";
> 
> arch/arm64/boot/dts/qcom/apq8016-sbc.dtb: dsi@1a98000: compatible: 'oneOf' conditional failed, one must be fixed:
>     ['dsi-ctrl-6g-qcm2290', 'qcom,mdss-dsi-ctrl'] is too long
> 
> 
> so compatible = "qcom,dsi-ctrl-6g-qcm2290", "qcom,mdss-dsi-ctrl"; is now invalid, not deprecated.
Intended

> 
> This change also makes compatible = "qcom,dsi-ctrl-6g-qcm2290" or compatible = "qcom,mdss-dsi-ctrl" standalone valid compatible which is again not what we want.
-ish, it's marked as deprecated but it is valid.

> 
> - enum:
>     - qcom,dsi-ctrl-6g-qcm2290
>     - qcom,mdss-dsi-ctrl
> 
> means either "qcom,dsi-ctrl-6g-qcm2290" or "qcom,mdss-dsi-ctrl" are valid compat strings...
Correct

> 
> As an example if you apply your change and then change the msm8916.dtsi to the below
> 
> diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> index e75a3efe4dace..e93c16431f0a1 100644
> --- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> +++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
> @@ -34,7 +34,7 @@ properties:
>        - items:
>            - enum:
>                - dsi-ctrl-6g-qcm2290
> -          - const: qcom,mdss-dsi-ctrl
> +              - qcom,mdss-dsi-ctrl
>          deprecated: true
> 
>    reg:
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 0733c2f4f3798..829fbe05b5713 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
>                         };
> 
>                         dsi0: dsi@1a98000 {
> -                               compatible = "qcom,msm8916-dsi-ctrl",
> -                                            "qcom,mdss-dsi-ctrl";
> +                               compatible = "qcom,mdss-dsi-ctrl";
>                                 reg = <0x01a98000 0x25c>;
>                                 reg-names = "dsi_ctrl";
> 
> Then test it with
> 
> make O=$BUILDDIR DT_DOC_CHECKER=$DT_DOC_CHECKER DT_EXTRACT_EX=$DT_EXTRACT_EX DT_MK_SCHEMA=$DT_MK_SCHEMA DT_CHECKER=$DT_CHECKER CHECKER_FLAGS=-W=1 CHECK_DTBS=y qcom/apq8016-sbc.dtb
(sidenote: you can just do

make ARCH=.. OUT=.. CHECK_DTBS=y qcom/apq8016-sbc.dtb

the tools are picked up automatically by Kbuild)

> 
> you'll see no error. However if you just do this
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 0733c2f4f3798..829fbe05b5713 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
>                         };
> 
>                         dsi0: dsi@1a98000 {
> -                               compatible = "qcom,msm8916-dsi-ctrl",
> -                                            "qcom,mdss-dsi-ctrl";
> +                               compatible = "qcom,mdss-dsi-ctrl";
>                                 reg = <0x01a98000 0x25c>;
>                                 reg-names = "dsi_ctrl";
> 
> 
> and run the same test you get
Yes, correct. It's valid but it's deprecated, so the bindings are
sane. Keep in mind there's an ABI-like aspect to this.

Konrad
> 
> apq8016-sbc.dtb: dsi@1a98000: compatible: 'oneOf' conditional failed, one must be fixed:
>     ['qcom,mdss-dsi-ctrl'] is too short
>     'qcom,mdss-dsi-ctrl' is not one of ['qcom,apq8064-dsi-ctrl', 'qcom,msm8916-dsi-ctrl', 'qcom,msm8953-dsi-ctrl', 'qcom,msm8974-dsi-ctrl', 'qcom,msm8996-dsi-ctrl', 'qcom,msm8998-dsi-ctrl', 'qcom,qcm2290-dsi-ctrl', 'qcom,sc7180-dsi-ctrl', 'qcom,sc7280-dsi-ctrl', 'qcom,sdm660-dsi-ctrl', 'qcom,sdm845-dsi-ctrl', 'qcom,sm8150-dsi-ctrl', 'qcom,sm8250-dsi-ctrl', 'qcom,sm8350-dsi-ctrl', 'qcom,sm8450-dsi-ctrl', 'qcom,sm8550-dsi-ctrl']
> 
> ---
> bod
Bryan O'Donoghue March 4, 2023, 5:45 p.m. UTC | #3
On 04/03/2023 17:35, Konrad Dybcio wrote:
>> you'll see no error. However if you just do this
>>
>> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>> index 0733c2f4f3798..829fbe05b5713 100644
>> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>> @@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
>>                          };
>>
>>                          dsi0: dsi@1a98000 {
>> -                               compatible = "qcom,msm8916-dsi-ctrl",
>> -                                            "qcom,mdss-dsi-ctrl";
>> +                               compatible = "qcom,mdss-dsi-ctrl";
>>                                  reg = <0x01a98000 0x25c>;
>>                                  reg-names = "dsi_ctrl";
>>
>>
>> and run the same test you get
> Yes, correct. It's valid but it's deprecated, so the bindings are
> sane. Keep in mind there's an ABI-like aspect to this.
> 
> Konrad

The _driver_ will still accept "qcom,mdss-dsi-ctrl" which is ABI 
compliant but, I don't see why the yaml should.

If you declare a new .dts with only "qcom,mdss-dsi-ctrl", that should 
throw a yaml check error.

---
bod
Bryan O'Donoghue March 4, 2023, 5:53 p.m. UTC | #4
On 04/03/2023 17:45, Bryan O'Donoghue wrote:
> On 04/03/2023 17:35, Konrad Dybcio wrote:
>>> you'll see no error. However if you just do this
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi 
>>> b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> index 0733c2f4f3798..829fbe05b5713 100644
>>> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>> @@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
>>>                          };
>>>
>>>                          dsi0: dsi@1a98000 {
>>> -                               compatible = "qcom,msm8916-dsi-ctrl",
>>> -                                            "qcom,mdss-dsi-ctrl";
>>> +                               compatible = "qcom,mdss-dsi-ctrl";
>>>                                  reg = <0x01a98000 0x25c>;
>>>                                  reg-names = "dsi_ctrl";
>>>
>>>
>>> and run the same test you get
>> Yes, correct. It's valid but it's deprecated, so the bindings are
>> sane. Keep in mind there's an ABI-like aspect to this.
>>
>> Konrad
> 
> The _driver_ will still accept "qcom,mdss-dsi-ctrl" which is ABI 
> compliant but, I don't see why the yaml should.
> 
> If you declare a new .dts with only "qcom,mdss-dsi-ctrl", that should 
> throw a yaml check error.
> 
> ---
> bod

Actually. I agree with you, I just dislike it.

- "qcom,mdss-dsi-ctrl" <- the driver will accept this
- "qcom,dsi-ctrl-6g-qcm2290" <- the driver will not accept this

bah

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Krzysztof Kozlowski March 6, 2023, 8:54 a.m. UTC | #5
On 04/03/2023 16:55, Konrad Dybcio wrote:
> The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl"
> alone. This however didn't quite work out and the property became

s/property/compatible/

> undocumented instead of deprecated. Fix that.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
Konrad Dybcio March 6, 2023, 10:05 a.m. UTC | #6
On 4.03.2023 18:53, Bryan O'Donoghue wrote:
> On 04/03/2023 17:45, Bryan O'Donoghue wrote:
>> On 04/03/2023 17:35, Konrad Dybcio wrote:
>>>> you'll see no error. However if you just do this
>>>>
>>>> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>>> index 0733c2f4f3798..829fbe05b5713 100644
>>>> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>>> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
>>>> @@ -1094,8 +1094,7 @@ mdp5_intf1_out: endpoint {
>>>>                          };
>>>>
>>>>                          dsi0: dsi@1a98000 {
>>>> -                               compatible = "qcom,msm8916-dsi-ctrl",
>>>> -                                            "qcom,mdss-dsi-ctrl";
>>>> +                               compatible = "qcom,mdss-dsi-ctrl";
>>>>                                  reg = <0x01a98000 0x25c>;
>>>>                                  reg-names = "dsi_ctrl";
>>>>
>>>>
>>>> and run the same test you get
>>> Yes, correct. It's valid but it's deprecated, so the bindings are
>>> sane. Keep in mind there's an ABI-like aspect to this.
>>>
>>> Konrad
>>
>> The _driver_ will still accept "qcom,mdss-dsi-ctrl" which is ABI compliant but, I don't see why the yaml should.
>>
>> If you declare a new .dts with only "qcom,mdss-dsi-ctrl", that should throw a yaml check error.
>>
>> ---
>> bod
> 
> Actually. I agree with you, I just dislike it.
If I understand correctly, you are dissatisfied with dt_binding_check
not even throwing a warning when a deprecated binding is present.. I
agree, that could be improved..

Konrad
> 
> - "qcom,mdss-dsi-ctrl" <- the driver will accept this
> - "qcom,dsi-ctrl-6g-qcm2290" <- the driver will not accept this
> 
> bah
> 
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
index f195530ae964..d534451c8f7f 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
+++ b/Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
@@ -35,7 +35,7 @@  properties:
       - items:
           - enum:
               - qcom,dsi-ctrl-6g-qcm2290
-          - const: qcom,mdss-dsi-ctrl
+              - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible
         deprecated: true
 
   reg: