[PATCH v3 1/3] dt-bindings: pwm: amlogic: Add core clock for S4 like

Ronald Claveau linux-kernel-dev at aliel.fr
Sun Sep 27 08:14:17 PDT 2026


On 9/27/26 4:37 PM, sashiko-bot at kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] dt-bindings: pwm-amlogic: missing minItems allows validation bypass
> --
> 
> commit 359e122eac15df570817ba590b91f8958522a038
> Author: Ronald Claveau <linux-kernel-dev at aliel.fr>
> 
> dt-bindings: pwm: amlogic: Add core clock for S4 like
>     
> This commit adds a third system core clock to the Amlogic PWM controller 
> bindings for S4 and related devices. It updates the conditionals for the 
> S4 compatible string to require three clocks instead of two, and updates 
> the examples to match.
> 
>> diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>> index c337d85da40f1..e9cd5f1fdf264 100644
>> --- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
>> +++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml
> 
> [ ... ]
> 
>> @@ -143,9 +143,15 @@ allOf:
>>            items:
>>              - description: input clock of PWM channel A
>>              - description: input clock of PWM channel B
>> -        clock-names: false
>> +            - description: gate clock for the PWM controller
> 
> [Severity: Medium]
> Will dt-schema successfully enforce the minimum 3 items requirement intended 
> by the commit message?
> 
> Because the global `clocks` property definition has `minItems: 1` and JSON 
> Schema's `items` keyword only validates elements that are actually present, a 
> device tree node with `compatible = "amlogic,meson-s4-pwm"` and only 1 or 2 
> clocks will silently pass validation.
> 
> Does this block need an explicit `minItems: 3`?
> 

If I remove one clock, the validation fails

```
  CHKDT   ./Documentation/devicetree/bindings
  LINT    ./Documentation/devicetree/bindings
  STYLE   ./Documentation/devicetree/bindings
  DTEX    Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dts
  DTC [C]
Documentation/devicetree/bindings/thermal/amlogic,thermal.example.dtb
  DTC [C] Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb
/home/*redacted*/linux/Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb:
pwm at 1000 (amlogic,meson-s4-pwm): clock-names: ['channel-a', 'channel-b']
is too short
	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml
/home/*redacted*/linux/Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb:
pwm at 1000 (amlogic,meson-s4-pwm): clocks: [[4294967295], [4294967295]] is
too short
	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml
/home/*redacted*/linux/Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb:
pwm at 60000 (amlogic,t7-pwm): clock-names: ['channel-a', 'channel-b'] is
too short
	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml
/home/*redacted*/linux/Documentation/devicetree/bindings/pwm/pwm-amlogic.example.dtb:
pwm at 60000 (amlogic,t7-pwm): clocks: [[4294967295], [4294967295]] is too
short
	from schema $id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml
```

>> +        clock-names:
>> +          items:
>> +            - const: channel-a
>> +            - const: channel-b
>> +            - const: core
> 
> [Severity: Medium]
> Does this also require `minItems: 3`?
> 
> Supplying just "channel-a" and "channel-b" will still validate successfully 
> without a `minItems` constraint here.
> 
>>        required:
>>          - clocks
>> +        - clock-names
> 


-- 
Best regards,
Ronald



More information about the linux-amlogic mailing list