mbox series

[0/6] fix all errors except one reported by dt_binding_check

Message ID 20201013160845.1772-1-thunder.leizhen@huawei.com
Headers show
Series fix all errors except one reported by dt_binding_check | expand

Message

Leizhen (ThunderTown) Oct. 13, 2020, 4:08 p.m. UTC
When people add multiple or common YAML files, they usually perform a full
dt_binding_check. Unfortunately, some YAML files cannot pass the self-check.
The errors or warning are listed below. It is necessary to eliminate them,
so that people's time and energy are not wasted every time when execute
comprehensive dt_binding_check.

This error is fixed by Patch 1:
/root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.example.dt.yaml: led-controller@33: multi-led@2:color:0:0: 9 is greater than the maximum of 8
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml

These errors are fixed by Patch 2:
/root/leizhen/linux-next/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.example.dt.yaml: ec@0: 'typec' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/extcon/extcon-usbc-cros-ec.example.dt.yaml: cros-ec@0: 'extcon0', 'extcon1' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.example.dt.yaml: cros-ec@0: 'ec-pwm' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.example.dt.yaml: ec@0: '#address-cells', '#size-cells', 'regulator@0' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dt.yaml: cros-ec@0: '#address-cells', '#size-cells', 'ec-codec@10500000' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

These errors are fixed by Patch 3 and 4:
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #address-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #size-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

Patch 5 and 6 fix the dtbs_check errors detected by Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpios' is a required property
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml

I have no good idea for this one, so leave it.
Documentation/devicetree/bindings/pci/xilinx-versal-cpm.example.dts:43.62-47.30: Warning (pci_device_reg): /example-0/versal/pcie@fca10000/interrupt-controller: missing PCI reg property


Zhen Lei (6):
  dt-bindings: leds: choose correct color value of multi-led
  dt-bindings: mfd: google,cros-ec: explicitly allow additional
    properties
  spi: dt-bindings: spi-controller: explicitly require
    #address-cells=<0> for slave mode
  dt-bindings: misc: explicitly add #address-cells for slave mode
  ARM: dts: mmp2-olpc-xo-1-75: explicitly add #address-cells=<0> for
    slave mode
  dt-bindings: misc: correct the property name cmd-gpios to cmd-gpio

 .../devicetree/bindings/leds/leds-lp55xx.yaml        |  2 +-
 .../devicetree/bindings/mfd/google,cros-ec.yaml      |  2 +-
 .../devicetree/bindings/misc/olpc,xo1.75-ec.yaml     |  8 +++++---
 .../devicetree/bindings/spi/spi-controller.yaml      | 20 ++++++++++++++------
 arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts              |  2 +-
 5 files changed, 22 insertions(+), 12 deletions(-)

Comments

Dan Murphy Oct. 13, 2020, 4:17 p.m. UTC | #1
Zhen

On 10/13/20 11:08 AM, Zhen Lei wrote:
> The color value of multi-led is fixed to "const: 8 #LED_COLOR_ID_MULTI",
> which is required by leds-class-multicolor.yaml.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>   Documentation/devicetree/bindings/leds/leds-lp55xx.yaml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
> index 58e974793a7976b..cd877e817ad1a1c 100644
> --- a/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
> @@ -197,7 +197,7 @@ examples:
>                  #address-cells = <1>;
>                  #size-cells = <0>;
>                  reg = <0x2>;
> -               color = <LED_COLOR_ID_RGB>;
> +               color = <LED_COLOR_ID_MULTI>;
>                  function = LED_FUNCTION_STANDBY;
>                  linux,default-trigger = "heartbeat";
>   

This is not correct.  ID_RGB is the correct variable here.

https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/commit/?h=for-next&id=3d93edc77515c6f51fa9bbbe2185e2ec32bad024

Correct fix is to update the leds-class-multicolor.yaml

Dan
Dan Murphy Oct. 13, 2020, 5:32 p.m. UTC | #2
Zhen

On 10/13/20 11:08 AM, Zhen Lei wrote:
> The property name used in arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts is
> cmd-gpio.
>
> arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:235:
> cmd-gpio = <&gpio 155 GPIO_ACTIVE_HIGH>;
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>   Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> index b3c45c046ba5e37..c7a06a9650db2ed 100644
> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> @@ -24,7 +24,7 @@ properties:
>     compatible:
>       const: olpc,xo1.75-ec
>   
> -  cmd-gpios:
> +  cmd-gpio:

Preference is gpios not gpio. But Rob H accept or reject

Dan
Leizhen (ThunderTown) Oct. 14, 2020, 1:08 a.m. UTC | #3
On 2020/10/14 0:17, Dan Murphy wrote:
> Zhen
> 
> On 10/13/20 11:08 AM, Zhen Lei wrote:
>> The color value of multi-led is fixed to "const: 8 #LED_COLOR_ID_MULTI",
>> which is required by leds-class-multicolor.yaml.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>   Documentation/devicetree/bindings/leds/leds-lp55xx.yaml | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
>> index 58e974793a7976b..cd877e817ad1a1c 100644
>> --- a/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
>> +++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml
>> @@ -197,7 +197,7 @@ examples:
>>                  #address-cells = <1>;
>>                  #size-cells = <0>;
>>                  reg = <0x2>;
>> -               color = <LED_COLOR_ID_RGB>;
>> +               color = <LED_COLOR_ID_MULTI>;
>>                  function = LED_FUNCTION_STANDBY;
>>                  linux,default-trigger = "heartbeat";
>>   
> 
> This is not correct.  ID_RGB is the correct variable here.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/commit/?h=for-next&id=3d93edc77515c6f51fa9bbbe2185e2ec32bad024
> 
> Correct fix is to update the leds-class-multicolor.yaml

OK

> 
> Dan
> 
> 
> .
>
Leizhen (ThunderTown) Oct. 14, 2020, 1:52 a.m. UTC | #4
On 2020/10/14 1:53, Dan Murphy wrote:
> Zhen
> 
> On 10/13/20 11:08 AM, Zhen Lei wrote:
>> There are so many properties have not been described in this yaml file,
>> and a lot of errors will be reported. Especially, some yaml files such as
>> google,cros-ec-typec.yaml, extcon-usbc-cros-ec.yaml can not pass the
>> self-check, because of the examples. So temporarily allow additional
>> properties to keep the comprehensive dt_binding_check result clean.
> 
> My preference is to fix the binding to pass the checks and not just work around the issues. Working around the issues may mean the issues never get fixed.

I agree with your first sentence:don't just work around the issues. But these
errors are so annoying. Hope someone can add the description of the missing properties.
I'm not familiar with this module anyway.

And I don't fully agree with your last sentence. After all, the main properties are listed,
and the ones that are not listed should be minor ones.

> 
> Dan
> 
> 
> .
>
Rob Herring (Arm) Oct. 14, 2020, 1:38 p.m. UTC | #5
On Wed, Oct 14, 2020 at 12:08:41AM +0800, Zhen Lei wrote:
> There are so many properties have not been described in this yaml file,
> and a lot of errors will be reported. Especially, some yaml files such as
> google,cros-ec-typec.yaml, extcon-usbc-cros-ec.yaml can not pass the
> self-check, because of the examples. So temporarily allow additional
> properties to keep the comprehensive dt_binding_check result clean.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

There's proper fixes for these under review.

Rob
Leizhen (ThunderTown) Oct. 15, 2020, 3:23 a.m. UTC | #6
On 2020/10/14 21:50, Rob Herring wrote:
> On Wed, Oct 14, 2020 at 09:29:26AM +0800, Leizhen (ThunderTown) wrote:
>>
>>
>> On 2020/10/14 1:32, Dan Murphy wrote:
>>> Zhen
>>>
>>> On 10/13/20 11:08 AM, Zhen Lei wrote:
>>>> The property name used in arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts is
>>>> cmd-gpio.
>>>>
>>>> arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:235:
>>>> cmd-gpio = <&gpio 155 GPIO_ACTIVE_HIGH>;
>>>>
>>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>>>> ---
>>>>   Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 6 +++---
>>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>>>> index b3c45c046ba5e37..c7a06a9650db2ed 100644
>>>> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>>>> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>>>> @@ -24,7 +24,7 @@ properties:
>>>>     compatible:
>>>>       const: olpc,xo1.75-ec
>>>>   -  cmd-gpios:
>>>> +  cmd-gpio:
>>>
>>> Preference is gpios not gpio. But Rob H accept or reject
>>
>> Look at the search result below. It seems that the driver have not been merged into mainline.
> 
> Yes, in drivers/platform/olpc/olpc-xo175-ec.c.
> 
> Your mistake is the gpiod api takes just 'cmd' as the GPIO core handles 
> both forms.

OK, thanks for your information. I have found that it defined by gpio_suffixes[].

> 
>> But the property name is really used as cmd-gpio at mmp2-olpc-xo-1-75.dts:235, I don't think
>> the mmp2-olpc-xo-1-75.dts can make a mistake. Otherwise, the driver will not work properly.
>> Meanwhile, Both names cmd-gpios and cmd-gpio seem to be in use. But I prefer cmd-gpio, after
>> all, only one gpio is assigned now. The motorola,cmd-gpios add "s" because it contains 3 gpio.
> 
> The preference is it is always '-gpios' just like it's always 
> 'interrupts' or 'clocks'.
> 
> However, whether to change this is really up to the OLPC folks. Given 
> the driver has always supported both forms, it should be okay to change 
> the dts. Though there could be other users besides the kernel.

If both "cmd-gpios" and "cmd-gpio" are supported, should we use enum to list both
of them in yaml? or use patternProperties?

I'm going to send v2 based on this idea.

> 
> Rob
> 
> .
>
Leizhen (ThunderTown) Oct. 15, 2020, 7:32 a.m. UTC | #7
On 2020/10/15 15:12, Lubomir Rintel wrote:
> Hi,
> 
> On Wed, Oct 14, 2020 at 12:08:45AM +0800, Zhen Lei wrote:
>> The property name used in arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts is
>> cmd-gpio.
>>
>> arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:235:
>> cmd-gpio = <&gpio 155 GPIO_ACTIVE_HIGH>;
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> 
> Thanks for the patch.
> 
> I've sent out an equivalent one some time ago:
> https://lore.kernel.org/lkml/20200925234805.228251-3-lkundrak@v3.sk/
> 
> In any case, either is fine with me.

Geert Uytterhoeven just replied me that the *-gpio form is deprecated. So your
patch is the correct one.

> 
> Acked-by: Lubomir Rintel <lkundrak@v3.sk>
> 
>> ---
>>  Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> index b3c45c046ba5e37..c7a06a9650db2ed 100644
>> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> @@ -24,7 +24,7 @@ properties:
>>    compatible:
>>      const: olpc,xo1.75-ec
>>  
>> -  cmd-gpios:
>> +  cmd-gpio:
>>      description: GPIO uspecifier of the CMD pin
>>      maxItems: 1
>>  
>> @@ -32,7 +32,7 @@ properties:
>>  
>>  required:
>>    - compatible
>> -  - cmd-gpios
>> +  - cmd-gpio
>>  
>>  additionalProperties: false
>>  
>> @@ -49,7 +49,7 @@ examples:
>>        slave {
>>          compatible = "olpc,xo1.75-ec";
>>          spi-cpha;
>> -        cmd-gpios = <&gpio 155 GPIO_ACTIVE_HIGH>;
>> +        cmd-gpio = <&gpio 155 GPIO_ACTIVE_HIGH>;
>>        };
>>      };
>>  
>> -- 
>> 1.8.3
>>
>>
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> .
>
Rob Herring (Arm) Oct. 16, 2020, 2:13 p.m. UTC | #8
On Wed, Oct 14, 2020 at 10:23 PM Leizhen (ThunderTown)
<thunder.leizhen@huawei.com> wrote:
>
>
>
> On 2020/10/14 21:50, Rob Herring wrote:
> > On Wed, Oct 14, 2020 at 09:29:26AM +0800, Leizhen (ThunderTown) wrote:
> >>
> >>
> >> On 2020/10/14 1:32, Dan Murphy wrote:
> >>> Zhen
> >>>
> >>> On 10/13/20 11:08 AM, Zhen Lei wrote:
> >>>> The property name used in arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts is
> >>>> cmd-gpio.
> >>>>
> >>>> arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:235:
> >>>> cmd-gpio = <&gpio 155 GPIO_ACTIVE_HIGH>;
> >>>>
> >>>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> >>>> ---
> >>>>   Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 6 +++---
> >>>>   1 file changed, 3 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> >>>> index b3c45c046ba5e37..c7a06a9650db2ed 100644
> >>>> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> >>>> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> >>>> @@ -24,7 +24,7 @@ properties:
> >>>>     compatible:
> >>>>       const: olpc,xo1.75-ec
> >>>>   -  cmd-gpios:
> >>>> +  cmd-gpio:
> >>>
> >>> Preference is gpios not gpio. But Rob H accept or reject
> >>
> >> Look at the search result below. It seems that the driver have not been merged into mainline.
> >
> > Yes, in drivers/platform/olpc/olpc-xo175-ec.c.
> >
> > Your mistake is the gpiod api takes just 'cmd' as the GPIO core handles
> > both forms.
>
> OK, thanks for your information. I have found that it defined by gpio_suffixes[].
>
> >
> >> But the property name is really used as cmd-gpio at mmp2-olpc-xo-1-75.dts:235, I don't think
> >> the mmp2-olpc-xo-1-75.dts can make a mistake. Otherwise, the driver will not work properly.
> >> Meanwhile, Both names cmd-gpios and cmd-gpio seem to be in use. But I prefer cmd-gpio, after
> >> all, only one gpio is assigned now. The motorola,cmd-gpios add "s" because it contains 3 gpio.
> >
> > The preference is it is always '-gpios' just like it's always
> > 'interrupts' or 'clocks'.
> >
> > However, whether to change this is really up to the OLPC folks. Given
> > the driver has always supported both forms, it should be okay to change
> > the dts. Though there could be other users besides the kernel.
>
> If both "cmd-gpios" and "cmd-gpio" are supported, should we use enum to list both
> of them in yaml? or use patternProperties?

No, we pick one or the other. Given Lubomir is okay with a dts change,
we should use just 'cmd-gpios'.

Rob