diff mbox series

[v2,2/4] dt-bindings: usb: mtk-xhci: Make all clocks required

Message ID 20220623193702.817996-3-nfraprado@collabora.com (mailing list archive)
State Accepted
Commit ebc4969ae125e65fdb563f66f4bfa7aec95f7eb4
Headers show
Series Fixes for dtbs_check warnings on Mediatek XHCI nodes | expand

Commit Message

Nícolas F. R. A. Prado June 23, 2022, 7:37 p.m. UTC
All of the clocks listed in the binding are always wired to the XHCI
controller hardware blocks on all SoCs. The reason some clocks were made
optional in the binding was to account for the fact that depending on
the SoC, some of the clocks might be fixed (ie not controlled by
software).

Given that the devicetree should represent the hardware, make all clocks
required in the binding. Subsequent patches will make the DTS changes to
specify fixed-clocks for the clocks that aren't controllable.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v2:
- Undid clock list changes that allowed middle clocks to be missing from
  v1 and made all clocks required instead
- Rewrote commit message and title

 Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Rob Herring June 27, 2022, 7:12 p.m. UTC | #1
On Thu, 23 Jun 2022 15:37:00 -0400, Nícolas F. R. A. Prado wrote:
> All of the clocks listed in the binding are always wired to the XHCI
> controller hardware blocks on all SoCs. The reason some clocks were made
> optional in the binding was to account for the fact that depending on
> the SoC, some of the clocks might be fixed (ie not controlled by
> software).
> 
> Given that the devicetree should represent the hardware, make all clocks
> required in the binding. Subsequent patches will make the DTS changes to
> specify fixed-clocks for the clocks that aren't controllable.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> ---
> 
> Changes in v2:
> - Undid clock list changes that allowed middle clocks to be missing from
>   v1 and made all clocks required instead
> - Rewrote commit message and title
> 
>  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11271000: usb@11270000:clocks: [[4294967295, 94], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11271000: usb@11270000:clock-names: ['sys_ck', 'ref_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11270000: clocks: [[4294967295, 94], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11270000: clock-names: ['sys_ck', 'ref_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@112c1000: usb@11270000:clocks: [[4294967295, 94], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@112c1000: usb@11270000:clock-names: ['sys_ck', 'ref_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11270000: clocks: [[4294967295, 94], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11270000: clock-names: ['sys_ck', 'ref_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11201000: usb@11200000:clocks: [[4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11201000: usb@11200000:clock-names: ['sys_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11200000: clocks: [[4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtu3.example.dtb: usb@11200000: clock-names: ['sys_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.example.dtb: usb@11270000: clocks: [[4294967295, 94], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.example.dtb: usb@11270000: clock-names: ['sys_ck', 'ref_ck'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Chunfeng Yun June 28, 2022, 12:57 a.m. UTC | #2
Hi Nícolas,

On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado wrote:
> All of the clocks listed in the binding are always wired to the XHCI
> controller hardware blocks on all SoCs. The reason some clocks were
> made
> optional in the binding was to account for the fact that depending on
> the SoC, some of the clocks might be fixed (ie not controlled by
> software).
> 
> Given that the devicetree should represent the hardware, make all
> clocks
> required in the binding. Subsequent patches will make the DTS changes
> to
> specify fixed-clocks for the clocks that aren't controllable.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> ---
> 
> Changes in v2:
> - Undid clock list changes that allowed middle clocks to be missing
> from
>   v1 and made all clocks required instead
> - Rewrote commit message and title
> 
>  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 +
> ---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> xhci.yaml
> index 63cbc2b62d18..1444d18ef9bc 100644
> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> @@ -67,7 +67,6 @@ properties:
>      maxItems: 1
>  
>    clocks:
> -    minItems: 1
>      items:
>        - description: Controller clock used by normal mode
>        - description: Reference clock used by low power mode etc
> @@ -76,9 +75,8 @@ properties:
>        - description: controller clock
>  
>    clock-names:
> -    minItems: 1
>      items:
> -      - const: sys_ck  # required, the following ones are optional
> +      - const: sys_ck
>        - const: ref_ck
>        - const: mcu_ck
>        - const: dma_ck

This patch causes more check warning, I prefer to leave dt-bindings
unchanged, but just fix mt8195's dts warning instead, thanks a lot
Nícolas F. R. A. Prado June 29, 2022, 6:55 p.m. UTC | #3
On Tue, Jun 28, 2022 at 08:57:45AM +0800, Chunfeng Yun wrote:
> Hi Nícolas,
> 
> On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado wrote:
> > All of the clocks listed in the binding are always wired to the XHCI
> > controller hardware blocks on all SoCs. The reason some clocks were
> > made
> > optional in the binding was to account for the fact that depending on
> > the SoC, some of the clocks might be fixed (ie not controlled by
> > software).
> > 
> > Given that the devicetree should represent the hardware, make all
> > clocks
> > required in the binding. Subsequent patches will make the DTS changes
> > to
> > specify fixed-clocks for the clocks that aren't controllable.
> > 
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > 
> > ---
> > 
> > Changes in v2:
> > - Undid clock list changes that allowed middle clocks to be missing
> > from
> >   v1 and made all clocks required instead
> > - Rewrote commit message and title
> > 
> >  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 +
> > ---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > xhci.yaml
> > index 63cbc2b62d18..1444d18ef9bc 100644
> > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > @@ -67,7 +67,6 @@ properties:
> >      maxItems: 1
> >  
> >    clocks:
> > -    minItems: 1
> >      items:
> >        - description: Controller clock used by normal mode
> >        - description: Reference clock used by low power mode etc
> > @@ -76,9 +75,8 @@ properties:
> >        - description: controller clock
> >  
> >    clock-names:
> > -    minItems: 1
> >      items:
> > -      - const: sys_ck  # required, the following ones are optional
> > +      - const: sys_ck
> >        - const: ref_ck
> >        - const: mcu_ck
> >        - const: dma_ck
> 
> This patch causes more check warning, I prefer to leave dt-bindings
> unchanged, but just fix mt8195's dts warning instead, thanks a lot

Hi Chunfeng,

the warnings reported by Rob's bot only happen if patches 3 and 4 aren't applied
to adapt the devicetrees. They are ABI breaking changes, but I understood this
as the desired solution from the discussion we had with Krzysztof on v1 [1].

I was expecting some feedback from Krzysztof or Matthias if this was an issue,
but it looks like Greg already merged the patch. I'll wait a bit for some
feedback and if this really was a misunderstanding I can send a revert patch.

Thanks,
Nícolas

[1] https://lore.kernel.org/all/20220622132219.36rvznhip2egujec@notapiano/
Rob Herring July 1, 2022, 9:37 p.m. UTC | #4
On Wed, Jun 29, 2022 at 02:55:46PM -0400, Nícolas F. R. A. Prado wrote:
> On Tue, Jun 28, 2022 at 08:57:45AM +0800, Chunfeng Yun wrote:
> > Hi Nícolas,
> > 
> > On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado wrote:
> > > All of the clocks listed in the binding are always wired to the XHCI
> > > controller hardware blocks on all SoCs. The reason some clocks were
> > > made
> > > optional in the binding was to account for the fact that depending on
> > > the SoC, some of the clocks might be fixed (ie not controlled by
> > > software).
> > > 
> > > Given that the devicetree should represent the hardware, make all
> > > clocks
> > > required in the binding. Subsequent patches will make the DTS changes
> > > to
> > > specify fixed-clocks for the clocks that aren't controllable.
> > > 
> > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > > 
> > > ---
> > > 
> > > Changes in v2:
> > > - Undid clock list changes that allowed middle clocks to be missing
> > > from
> > >   v1 and made all clocks required instead
> > > - Rewrote commit message and title
> > > 
> > >  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 +
> > > ---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > xhci.yaml
> > > index 63cbc2b62d18..1444d18ef9bc 100644
> > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > > @@ -67,7 +67,6 @@ properties:
> > >      maxItems: 1
> > >  
> > >    clocks:
> > > -    minItems: 1
> > >      items:
> > >        - description: Controller clock used by normal mode
> > >        - description: Reference clock used by low power mode etc
> > > @@ -76,9 +75,8 @@ properties:
> > >        - description: controller clock
> > >  
> > >    clock-names:
> > > -    minItems: 1
> > >      items:
> > > -      - const: sys_ck  # required, the following ones are optional
> > > +      - const: sys_ck
> > >        - const: ref_ck
> > >        - const: mcu_ck
> > >        - const: dma_ck
> > 
> > This patch causes more check warning, I prefer to leave dt-bindings
> > unchanged, but just fix mt8195's dts warning instead, thanks a lot
> 
> Hi Chunfeng,
> 
> the warnings reported by Rob's bot only happen if patches 3 and 4 aren't applied
> to adapt the devicetrees. They are ABI breaking changes, but I understood this
> as the desired solution from the discussion we had with Krzysztof on v1 [1].

The warnings have nothing to do with patches 3 and 4 as those are for 
dts files. It's examples in bindings that are the problem.

Rob
Chunfeng Yun July 2, 2022, 8:24 a.m. UTC | #5
On Fri, 2022-07-01 at 15:37 -0600, Rob Herring wrote:
> On Wed, Jun 29, 2022 at 02:55:46PM -0400, Nícolas F. R. A. Prado
> wrote:
> > On Tue, Jun 28, 2022 at 08:57:45AM +0800, Chunfeng Yun wrote:
> > > Hi Nícolas,
> > > 
> > > On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado wrote:
> > > > All of the clocks listed in the binding are always wired to the
> > > > XHCI
> > > > controller hardware blocks on all SoCs. The reason some clocks
> > > > were
> > > > made
> > > > optional in the binding was to account for the fact that
> > > > depending on
> > > > the SoC, some of the clocks might be fixed (ie not controlled
> > > > by
> > > > software).
> > > > 
> > > > Given that the devicetree should represent the hardware, make
> > > > all
> > > > clocks
> > > > required in the binding. Subsequent patches will make the DTS
> > > > changes
> > > > to
> > > > specify fixed-clocks for the clocks that aren't controllable.
> > > > 
> > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > > > 
> > > > ---
> > > > 
> > > > Changes in v2:
> > > > - Undid clock list changes that allowed middle clocks to be
> > > > missing
> > > > from
> > > >   v1 and made all clocks required instead
> > > > - Rewrote commit message and title
> > > > 
> > > >  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml |
> > > > 4 +
> > > > ---
> > > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > > 
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > xhci.yaml
> > > > index 63cbc2b62d18..1444d18ef9bc 100644
> > > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > xhci.yaml
> > > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > xhci.yaml
> > > > @@ -67,7 +67,6 @@ properties:
> > > >      maxItems: 1
> > > >  
> > > >    clocks:
> > > > -    minItems: 1
> > > >      items:
> > > >        - description: Controller clock used by normal mode
> > > >        - description: Reference clock used by low power mode
> > > > etc
> > > > @@ -76,9 +75,8 @@ properties:
> > > >        - description: controller clock
> > > >  
> > > >    clock-names:
> > > > -    minItems: 1
> > > >      items:
> > > > -      - const: sys_ck  # required, the following ones are
> > > > optional
> > > > +      - const: sys_ck
> > > >        - const: ref_ck
> > > >        - const: mcu_ck
> > > >        - const: dma_ck
> > > 
> > > This patch causes more check warning, I prefer to leave dt-
> > > bindings
> > > unchanged, but just fix mt8195's dts warning instead, thanks a
> > > lot
> > 
> > Hi Chunfeng,
> > 
> > the warnings reported by Rob's bot only happen if patches 3 and 4
> > aren't applied
> > to adapt the devicetrees. They are ABI breaking changes, but I
> > understood this
> > as the desired solution from the discussion we had with Krzysztof
> > on v1 [1].
> 
> The warnings have nothing to do with patches 3 and 4 as those are
> for 
> dts files. It's examples in bindings that are the problem.
Yes, I mean almost all existing dts supporting mtk-xhci will also cause
similar warnings, as changes in patches 3, 4;

It seems less flexible to make all clock required, not only changes all
existing ones but also need more changes if additional clock is added.

> 
> Rob
Nícolas F. R. A. Prado July 5, 2022, 8:36 p.m. UTC | #6
On Sat, Jul 02, 2022 at 04:24:12PM +0800, Chunfeng Yun wrote:
> On Fri, 2022-07-01 at 15:37 -0600, Rob Herring wrote:
> > On Wed, Jun 29, 2022 at 02:55:46PM -0400, Nícolas F. R. A. Prado
> > wrote:
> > > On Tue, Jun 28, 2022 at 08:57:45AM +0800, Chunfeng Yun wrote:
> > > > Hi Nícolas,
> > > > 
> > > > On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado wrote:
> > > > > All of the clocks listed in the binding are always wired to the
> > > > > XHCI
> > > > > controller hardware blocks on all SoCs. The reason some clocks
> > > > > were
> > > > > made
> > > > > optional in the binding was to account for the fact that
> > > > > depending on
> > > > > the SoC, some of the clocks might be fixed (ie not controlled
> > > > > by
> > > > > software).
> > > > > 
> > > > > Given that the devicetree should represent the hardware, make
> > > > > all
> > > > > clocks
> > > > > required in the binding. Subsequent patches will make the DTS
> > > > > changes
> > > > > to
> > > > > specify fixed-clocks for the clocks that aren't controllable.
> > > > > 
> > > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> > > > > 
> > > > > ---
> > > > > 
> > > > > Changes in v2:
> > > > > - Undid clock list changes that allowed middle clocks to be
> > > > > missing
> > > > > from
> > > > >   v1 and made all clocks required instead
> > > > > - Rewrote commit message and title
> > > > > 
> > > > >  Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml |
> > > > > 4 +
> > > > > ---
> > > > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > > > 
> > > > > diff --git
> > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > xhci.yaml
> > > > > index 63cbc2b62d18..1444d18ef9bc 100644
> > > > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > xhci.yaml
> > > > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > xhci.yaml
> > > > > @@ -67,7 +67,6 @@ properties:
> > > > >      maxItems: 1
> > > > >  
> > > > >    clocks:
> > > > > -    minItems: 1
> > > > >      items:
> > > > >        - description: Controller clock used by normal mode
> > > > >        - description: Reference clock used by low power mode
> > > > > etc
> > > > > @@ -76,9 +75,8 @@ properties:
> > > > >        - description: controller clock
> > > > >  
> > > > >    clock-names:
> > > > > -    minItems: 1
> > > > >      items:
> > > > > -      - const: sys_ck  # required, the following ones are
> > > > > optional
> > > > > +      - const: sys_ck
> > > > >        - const: ref_ck
> > > > >        - const: mcu_ck
> > > > >        - const: dma_ck
> > > > 
> > > > This patch causes more check warning, I prefer to leave dt-
> > > > bindings
> > > > unchanged, but just fix mt8195's dts warning instead, thanks a
> > > > lot
> > > 
> > > Hi Chunfeng,
> > > 
> > > the warnings reported by Rob's bot only happen if patches 3 and 4
> > > aren't applied
> > > to adapt the devicetrees. They are ABI breaking changes, but I
> > > understood this
> > > as the desired solution from the discussion we had with Krzysztof
> > > on v1 [1].
> > 
> > The warnings have nothing to do with patches 3 and 4 as those are
> > for 
> > dts files. It's examples in bindings that are the problem.

Sorry, you're right, I misread the errors.

> Yes, I mean almost all existing dts supporting mtk-xhci will also cause
> similar warnings, as changes in patches 3, 4;
> 
> It seems less flexible to make all clock required, not only changes all
> existing ones but also need more changes if additional clock is added.

Yes, that's a valid concern. I must have misunderstood the discussion in v1
then.

So, I'm going to send a revert for this change and send a new patch adding fixed
clocks on the dts for just mt8192 and mt8195 to fix the dtbs_check warnings.
Does that sound good?

Thanks,
Nícolas
Chunfeng Yun July 7, 2022, 1:10 a.m. UTC | #7
On Tue, 2022-07-05 at 16:36 -0400, Nícolas F. R. A. Prado wrote:
> On Sat, Jul 02, 2022 at 04:24:12PM +0800, Chunfeng Yun wrote:
> > On Fri, 2022-07-01 at 15:37 -0600, Rob Herring wrote:
> > > On Wed, Jun 29, 2022 at 02:55:46PM -0400, Nícolas F. R. A. Prado
> > > wrote:
> > > > On Tue, Jun 28, 2022 at 08:57:45AM +0800, Chunfeng Yun wrote:
> > > > > Hi Nícolas,
> > > > > 
> > > > > On Thu, 2022-06-23 at 15:37 -0400, Nícolas F. R. A. Prado
> > > > > wrote:
> > > > > > All of the clocks listed in the binding are always wired to
> > > > > > the
> > > > > > XHCI
> > > > > > controller hardware blocks on all SoCs. The reason some
> > > > > > clocks
> > > > > > were
> > > > > > made
> > > > > > optional in the binding was to account for the fact that
> > > > > > depending on
> > > > > > the SoC, some of the clocks might be fixed (ie not
> > > > > > controlled
> > > > > > by
> > > > > > software).
> > > > > > 
> > > > > > Given that the devicetree should represent the hardware,
> > > > > > make
> > > > > > all
> > > > > > clocks
> > > > > > required in the binding. Subsequent patches will make the
> > > > > > DTS
> > > > > > changes
> > > > > > to
> > > > > > specify fixed-clocks for the clocks that aren't
> > > > > > controllable.
> > > > > > 
> > > > > > Signed-off-by: Nícolas F. R. A. Prado <
> > > > > > nfraprado@collabora.com>
> > > > > > 
> > > > > > ---
> > > > > > 
> > > > > > Changes in v2:
> > > > > > - Undid clock list changes that allowed middle clocks to be
> > > > > > missing
> > > > > > from
> > > > > >   v1 and made all clocks required instead
> > > > > > - Rewrote commit message and title
> > > > > > 
> > > > > >  Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > > xhci.yaml |
> > > > > > 4 +
> > > > > > ---
> > > > > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > > > > 
> > > > > > diff --git
> > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > > xhci.yaml
> > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > > xhci.yaml
> > > > > > index 63cbc2b62d18..1444d18ef9bc 100644
> > > > > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > > xhci.yaml
> > > > > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-
> > > > > > xhci.yaml
> > > > > > @@ -67,7 +67,6 @@ properties:
> > > > > >      maxItems: 1
> > > > > >  
> > > > > >    clocks:
> > > > > > -    minItems: 1
> > > > > >      items:
> > > > > >        - description: Controller clock used by normal mode
> > > > > >        - description: Reference clock used by low power
> > > > > > mode
> > > > > > etc
> > > > > > @@ -76,9 +75,8 @@ properties:
> > > > > >        - description: controller clock
> > > > > >  
> > > > > >    clock-names:
> > > > > > -    minItems: 1
> > > > > >      items:
> > > > > > -      - const: sys_ck  # required, the following ones are
> > > > > > optional
> > > > > > +      - const: sys_ck
> > > > > >        - const: ref_ck
> > > > > >        - const: mcu_ck
> > > > > >        - const: dma_ck
> > > > > 
> > > > > This patch causes more check warning, I prefer to leave dt-
> > > > > bindings
> > > > > unchanged, but just fix mt8195's dts warning instead, thanks
> > > > > a
> > > > > lot
> > > > 
> > > > Hi Chunfeng,
> > > > 
> > > > the warnings reported by Rob's bot only happen if patches 3 and
> > > > 4
> > > > aren't applied
> > > > to adapt the devicetrees. They are ABI breaking changes, but I
> > > > understood this
> > > > as the desired solution from the discussion we had with
> > > > Krzysztof
> > > > on v1 [1].
> > > 
> > > The warnings have nothing to do with patches 3 and 4 as those are
> > > for 
> > > dts files. It's examples in bindings that are the problem.
> 
> Sorry, you're right, I misread the errors.
> 
> > Yes, I mean almost all existing dts supporting mtk-xhci will also
> > cause
> > similar warnings, as changes in patches 3, 4;
> > 
> > It seems less flexible to make all clock required, not only changes
> > all
> > existing ones but also need more changes if additional clock is
> > added.
> 
> Yes, that's a valid concern. I must have misunderstood the discussion
> in v1
> then.
> 
> So, I'm going to send a revert for this change and send a new patch
> adding fixed
> clocks on the dts for just mt8192 and mt8195 to fix the dtbs_check
> warnings.
> Does that sound good?
Yes, sound good, thanks a lot

> 
> Thanks,
> Nícolas
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index 63cbc2b62d18..1444d18ef9bc 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -67,7 +67,6 @@  properties:
     maxItems: 1
 
   clocks:
-    minItems: 1
     items:
       - description: Controller clock used by normal mode
       - description: Reference clock used by low power mode etc
@@ -76,9 +75,8 @@  properties:
       - description: controller clock
 
   clock-names:
-    minItems: 1
     items:
-      - const: sys_ck  # required, the following ones are optional
+      - const: sys_ck
       - const: ref_ck
       - const: mcu_ck
       - const: dma_ck