* [PATCH 0/3] Fixes for dtbs_check warnings on Mediatek XHCI nodes
@ 2022-06-17 22:29 Nícolas F. R. A. Prado
2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-06-17 22:29 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: AngeloGioacchino Del Regno, kernel, Nícolas F. R. A. Prado,
Allen-KH Cheng, Chunfeng Yun, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-kernel, linux-mediatek,
linux-usb
The two first patches fix inconsistencies in the mtk-xhci dt-binding,
while the third patch is a DTS change to use the clock order required by
the binding (and that was fixed in patch 2).
This series gets rid of a couple dtbs_check warnings on mt8192.dtsi and
another on mt8195.dtsi.
Nícolas F. R. A. Prado (3):
dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be
optional
dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing
arm64: dts: mt8192: Follow clock order for XHCI
.../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 10 ++++++++--
arch/arm64/boot/dts/mediatek/mt8192.dtsi | 6 +++---
2 files changed, 11 insertions(+), 5 deletions(-)
--
2.36.1
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional 2022-06-17 22:29 [PATCH 0/3] Fixes for dtbs_check warnings on Mediatek XHCI nodes Nícolas F. R. A. Prado @ 2022-06-17 22:29 ` Nícolas F. R. A. Prado 2022-06-18 1:30 ` Krzysztof Kozlowski 2022-06-19 7:47 ` Chunfeng Yun 2022-06-17 22:29 ` [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Nícolas F. R. A. Prado 2022-06-17 22:29 ` [PATCH 3/3] arm64: dts: mt8192: Follow clock order for XHCI Nícolas F. R. A. Prado 2 siblings, 2 replies; 18+ messages in thread From: Nícolas F. R. A. Prado @ 2022-06-17 22:29 UTC (permalink / raw) To: Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Nícolas F. R. A. Prado, Chunfeng Yun, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb Add missing "minItems: 1" to the interrupt-names property to allow the second interrupt-names, "wakeup", to be optional. Fixes: fe8e488058c4 ("dt-bindings: usb: mtk-xhci: add wakeup interrupt") Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> --- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml index 892718459d25..63cbc2b62d18 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml @@ -57,6 +57,7 @@ properties: - description: optional, wakeup interrupt used to support runtime PM interrupt-names: + minItems: 1 items: - const: host - const: wakeup -- 2.36.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional 2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado @ 2022-06-18 1:30 ` Krzysztof Kozlowski 2022-06-19 7:47 ` Chunfeng Yun 1 sibling, 0 replies; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-18 1:30 UTC (permalink / raw) To: Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Chunfeng Yun, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > Add missing "minItems: 1" to the interrupt-names property to allow the > second interrupt-names, "wakeup", to be optional. > > Fixes: fe8e488058c4 ("dt-bindings: usb: mtk-xhci: add wakeup interrupt") > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional 2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado 2022-06-18 1:30 ` Krzysztof Kozlowski @ 2022-06-19 7:47 ` Chunfeng Yun 1 sibling, 0 replies; 18+ messages in thread From: Chunfeng Yun @ 2022-06-19 7:47 UTC (permalink / raw) To: Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Fri, 2022-06-17 at 18:29 -0400, Nícolas F. R. A. Prado wrote: > Add missing "minItems: 1" to the interrupt-names property to allow > the > second interrupt-names, "wakeup", to be optional. > > Fixes: fe8e488058c4 ("dt-bindings: usb: mtk-xhci: add wakeup > interrupt") > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk- > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- > xhci.yaml > index 892718459d25..63cbc2b62d18 100644 > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > @@ -57,6 +57,7 @@ properties: > - description: optional, wakeup interrupt used to support > runtime PM > > interrupt-names: > + minItems: 1 > items: > - const: host > - const: wakeup Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Thanks ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-17 22:29 [PATCH 0/3] Fixes for dtbs_check warnings on Mediatek XHCI nodes Nícolas F. R. A. Prado 2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado @ 2022-06-17 22:29 ` Nícolas F. R. A. Prado 2022-06-18 1:25 ` Krzysztof Kozlowski 2022-06-19 7:40 ` Chunfeng Yun 2022-06-17 22:29 ` [PATCH 3/3] arm64: dts: mt8192: Follow clock order for XHCI Nícolas F. R. A. Prado 2 siblings, 2 replies; 18+ messages in thread From: Nícolas F. R. A. Prado @ 2022-06-17 22:29 UTC (permalink / raw) To: Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Nícolas F. R. A. Prado, Chunfeng Yun, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb The current clock list in the binding doesn't allow for one of the optional clocks to be missing and a subsequent clock to be present. An example where this is an issue is in mt8192.dtsi, which has "sys_ck", "ref_ck", "xhci_ck" and would cause dtbs_check warnings. Change the clock list in a way that allows the middle optional clocks to be missing, while still guaranteeing a fixed order. The "ref_ck" is kept as a const even though it is optional for simplicity, since it is present in all current dts files. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> --- .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml index 63cbc2b62d18..99a1b233ec90 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml @@ -80,8 +80,13 @@ properties: items: - const: sys_ck # required, the following ones are optional - const: ref_ck - - const: mcu_ck - - const: dma_ck + - enum: + - mcu_ck + - dma_ck + - xhci_ck + - enum: + - dma_ck + - xhci_ck - const: xhci_ck assigned-clocks: -- 2.36.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-17 22:29 ` [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Nícolas F. R. A. Prado @ 2022-06-18 1:25 ` Krzysztof Kozlowski 2022-06-19 7:46 ` Chunfeng Yun 2022-06-19 7:40 ` Chunfeng Yun 1 sibling, 1 reply; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-18 1:25 UTC (permalink / raw) To: Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Chunfeng Yun, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > The current clock list in the binding doesn't allow for one of the > optional clocks to be missing and a subsequent clock to be present. An > example where this is an issue is in mt8192.dtsi, which has "sys_ck", > "ref_ck", "xhci_ck" and would cause dtbs_check warnings. > > Change the clock list in a way that allows the middle optional clocks to > be missing, while still guaranteeing a fixed order. The "ref_ck" is kept > as a const even though it is optional for simplicity, since it is > present in all current dts files. > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > --- > > .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > index 63cbc2b62d18..99a1b233ec90 100644 > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > @@ -80,8 +80,13 @@ properties: > items: > - const: sys_ck # required, the following ones are optional > - const: ref_ck > - - const: mcu_ck > - - const: dma_ck > + - enum: > + - mcu_ck > + - dma_ck > + - xhci_ck > + - enum: > + - dma_ck > + - xhci_ck > - const: xhci_ck You allow now almost any order here, including incorrect like sys,ref,xhci,xhci,xhci. The order of clocks has to be fixed and we cannot allow flexibility. Are you sure that these clocks are actually optional (not wired to the device)? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-18 1:25 ` Krzysztof Kozlowski @ 2022-06-19 7:46 ` Chunfeng Yun 2022-06-19 12:05 ` Krzysztof Kozlowski 0 siblings, 1 reply; 18+ messages in thread From: Chunfeng Yun @ 2022-06-19 7:46 UTC (permalink / raw) To: Krzysztof Kozlowski, Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: > On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > > The current clock list in the binding doesn't allow for one of the > > optional clocks to be missing and a subsequent clock to be present. > > An > > example where this is an issue is in mt8192.dtsi, which has > > "sys_ck", > > "ref_ck", "xhci_ck" and would cause dtbs_check warnings. > > > > Change the clock list in a way that allows the middle optional > > clocks to > > be missing, while still guaranteeing a fixed order. The "ref_ck" is > > kept > > as a const even though it is optional for simplicity, since it is > > present in all current dts files. > > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > > > .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 > > +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > xhci.yaml > > index 63cbc2b62d18..99a1b233ec90 100644 > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > > @@ -80,8 +80,13 @@ properties: > > items: > > - const: sys_ck # required, the following ones are optional > > - const: ref_ck > > - - const: mcu_ck > > - - const: dma_ck > > + - enum: > > + - mcu_ck > > + - dma_ck > > + - xhci_ck > > + - enum: > > + - dma_ck > > + - xhci_ck > > - const: xhci_ck > > You allow now almost any order here, including incorrect like > sys,ref,xhci,xhci,xhci. > > The order of clocks has to be fixed and we cannot allow flexibility. > Are > you sure that these clocks are actually optional (not wired to the > device)? In fact, these optional clocks are fixed, due to no gates are provided, SW can't control them by CCF; In this case, I usually use a fixed clock, or ignore it. > > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-19 7:46 ` Chunfeng Yun @ 2022-06-19 12:05 ` Krzysztof Kozlowski 2022-06-20 6:59 ` Chunfeng Yun 0 siblings, 1 reply; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-19 12:05 UTC (permalink / raw) To: Chunfeng Yun, Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 19/06/2022 09:46, Chunfeng Yun wrote: > On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: >> On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: >>> The current clock list in the binding doesn't allow for one of the >>> optional clocks to be missing and a subsequent clock to be present. >>> An >>> example where this is an issue is in mt8192.dtsi, which has >>> "sys_ck", >>> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. >>> >>> Change the clock list in a way that allows the middle optional >>> clocks to >>> be missing, while still guaranteeing a fixed order. The "ref_ck" is >>> kept >>> as a const even though it is optional for simplicity, since it is >>> present in all current dts files. >>> >>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> >>> --- >>> >>> .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 >>> +++++++-- >>> 1 file changed, 7 insertions(+), 2 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>> xhci.yaml >>> index 63cbc2b62d18..99a1b233ec90 100644 >>> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml >>> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml >>> @@ -80,8 +80,13 @@ properties: >>> items: >>> - const: sys_ck # required, the following ones are optional >>> - const: ref_ck >>> - - const: mcu_ck >>> - - const: dma_ck >>> + - enum: >>> + - mcu_ck >>> + - dma_ck >>> + - xhci_ck >>> + - enum: >>> + - dma_ck >>> + - xhci_ck >>> - const: xhci_ck >> >> You allow now almost any order here, including incorrect like >> sys,ref,xhci,xhci,xhci. >> >> The order of clocks has to be fixed and we cannot allow flexibility. >> Are >> you sure that these clocks are actually optional (not wired to the >> device)? > In fact, these optional clocks are fixed, due to no gates are provided, > SW can't control them by CCF; > In this case, I usually use a fixed clock, or ignore it. But in some versions these clocks are controllable or not? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-19 12:05 ` Krzysztof Kozlowski @ 2022-06-20 6:59 ` Chunfeng Yun 2022-06-20 8:50 ` Krzysztof Kozlowski 0 siblings, 1 reply; 18+ messages in thread From: Chunfeng Yun @ 2022-06-20 6:59 UTC (permalink / raw) To: Krzysztof Kozlowski, Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: > On 19/06/2022 09:46, Chunfeng Yun wrote: > > On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: > > > On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > > > > The current clock list in the binding doesn't allow for one of > > > > the > > > > optional clocks to be missing and a subsequent clock to be > > > > present. > > > > An > > > > example where this is an issue is in mt8192.dtsi, which has > > > > "sys_ck", > > > > "ref_ck", "xhci_ck" and would cause dtbs_check warnings. > > > > > > > > Change the clock list in a way that allows the middle optional > > > > clocks to > > > > be missing, while still guaranteeing a fixed order. The > > > > "ref_ck" is > > > > kept > > > > as a const even though it is optional for simplicity, since it > > > > is > > > > present in all current dts files. > > > > > > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > > > --- > > > > > > > > .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 > > > > +++++++-- > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > diff --git > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > xhci.yaml > > > > index 63cbc2b62d18..99a1b233ec90 100644 > > > > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > xhci.yaml > > > > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > xhci.yaml > > > > @@ -80,8 +80,13 @@ properties: > > > > items: > > > > - const: sys_ck # required, the following ones are > > > > optional > > > > - const: ref_ck > > > > - - const: mcu_ck > > > > - - const: dma_ck > > > > + - enum: > > > > + - mcu_ck > > > > + - dma_ck > > > > + - xhci_ck > > > > + - enum: > > > > + - dma_ck > > > > + - xhci_ck > > > > - const: xhci_ck > > > > > > You allow now almost any order here, including incorrect like > > > sys,ref,xhci,xhci,xhci. > > > > > > The order of clocks has to be fixed and we cannot allow > > > flexibility. > > > Are > > > you sure that these clocks are actually optional (not wired to > > > the > > > device)? > > > > In fact, these optional clocks are fixed, due to no gates are > > provided, > > SW can't control them by CCF; > > In this case, I usually use a fixed clock, or ignore it. > > But in some versions these clocks are controllable or not? Some SoCs are controllable, some ones are not (fixed clock). > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-20 6:59 ` Chunfeng Yun @ 2022-06-20 8:50 ` Krzysztof Kozlowski 2022-06-20 15:50 ` Nícolas F. R. A. Prado 0 siblings, 1 reply; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-20 8:50 UTC (permalink / raw) To: Chunfeng Yun, Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 20/06/2022 08:59, Chunfeng Yun wrote: > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: >> On 19/06/2022 09:46, Chunfeng Yun wrote: >>> On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: >>>> On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: >>>>> The current clock list in the binding doesn't allow for one of >>>>> the >>>>> optional clocks to be missing and a subsequent clock to be >>>>> present. >>>>> An >>>>> example where this is an issue is in mt8192.dtsi, which has >>>>> "sys_ck", >>>>> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. >>>>> >>>>> Change the clock list in a way that allows the middle optional >>>>> clocks to >>>>> be missing, while still guaranteeing a fixed order. The >>>>> "ref_ck" is >>>>> kept >>>>> as a const even though it is optional for simplicity, since it >>>>> is >>>>> present in all current dts files. >>>>> >>>>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> >>>>> --- >>>>> >>>>> .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 >>>>> +++++++-- >>>>> 1 file changed, 7 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git >>>>> a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> index 63cbc2b62d18..99a1b233ec90 100644 >>>>> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>> xhci.yaml >>>>> @@ -80,8 +80,13 @@ properties: >>>>> items: >>>>> - const: sys_ck # required, the following ones are >>>>> optional >>>>> - const: ref_ck >>>>> - - const: mcu_ck >>>>> - - const: dma_ck >>>>> + - enum: >>>>> + - mcu_ck >>>>> + - dma_ck >>>>> + - xhci_ck >>>>> + - enum: >>>>> + - dma_ck >>>>> + - xhci_ck >>>>> - const: xhci_ck >>>> >>>> You allow now almost any order here, including incorrect like >>>> sys,ref,xhci,xhci,xhci. >>>> >>>> The order of clocks has to be fixed and we cannot allow >>>> flexibility. >>>> Are >>>> you sure that these clocks are actually optional (not wired to >>>> the >>>> device)? >>> >>> In fact, these optional clocks are fixed, due to no gates are >>> provided, >>> SW can't control them by CCF; >>> In this case, I usually use a fixed clock, or ignore it. >> >> But in some versions these clocks are controllable or not? > Some SoCs are controllable, some ones are not (fixed clock). Thanks for confirming. Then I would prefer to make these clocks required (not optional) and always provide them - via common clock framework or fixed-clock. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-20 8:50 ` Krzysztof Kozlowski @ 2022-06-20 15:50 ` Nícolas F. R. A. Prado 2022-06-21 7:14 ` Krzysztof Kozlowski 0 siblings, 1 reply; 18+ messages in thread From: Nícolas F. R. A. Prado @ 2022-06-20 15:50 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Chunfeng Yun, Greg Kroah-Hartman, Matthias Brugger, AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Mon, Jun 20, 2022 at 10:50:57AM +0200, Krzysztof Kozlowski wrote: > On 20/06/2022 08:59, Chunfeng Yun wrote: > > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: > >> On 19/06/2022 09:46, Chunfeng Yun wrote: > >>> On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: > >>>> On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > >>>>> The current clock list in the binding doesn't allow for one of > >>>>> the > >>>>> optional clocks to be missing and a subsequent clock to be > >>>>> present. > >>>>> An > >>>>> example where this is an issue is in mt8192.dtsi, which has > >>>>> "sys_ck", > >>>>> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. > >>>>> > >>>>> Change the clock list in a way that allows the middle optional > >>>>> clocks to > >>>>> be missing, while still guaranteeing a fixed order. The > >>>>> "ref_ck" is > >>>>> kept > >>>>> as a const even though it is optional for simplicity, since it > >>>>> is > >>>>> present in all current dts files. > >>>>> > >>>>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > >>>>> --- > >>>>> > >>>>> .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 > >>>>> +++++++-- > >>>>> 1 file changed, 7 insertions(+), 2 deletions(-) > >>>>> > >>>>> diff --git > >>>>> a/Documentation/devicetree/bindings/usb/mediatek,mtk- > >>>>> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- > >>>>> xhci.yaml > >>>>> index 63cbc2b62d18..99a1b233ec90 100644 > >>>>> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk- > >>>>> xhci.yaml > >>>>> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk- > >>>>> xhci.yaml > >>>>> @@ -80,8 +80,13 @@ properties: > >>>>> items: > >>>>> - const: sys_ck # required, the following ones are > >>>>> optional > >>>>> - const: ref_ck > >>>>> - - const: mcu_ck > >>>>> - - const: dma_ck > >>>>> + - enum: > >>>>> + - mcu_ck > >>>>> + - dma_ck > >>>>> + - xhci_ck > >>>>> + - enum: > >>>>> + - dma_ck > >>>>> + - xhci_ck > >>>>> - const: xhci_ck > >>>> > >>>> You allow now almost any order here, including incorrect like > >>>> sys,ref,xhci,xhci,xhci. > >>>> > >>>> The order of clocks has to be fixed and we cannot allow > >>>> flexibility. > >>>> Are > >>>> you sure that these clocks are actually optional (not wired to > >>>> the > >>>> device)? > >>> > >>> In fact, these optional clocks are fixed, due to no gates are > >>> provided, > >>> SW can't control them by CCF; > >>> In this case, I usually use a fixed clock, or ignore it. > >> > >> But in some versions these clocks are controllable or not? > > Some SoCs are controllable, some ones are not (fixed clock). > > Thanks for confirming. Then I would prefer to make these clocks required > (not optional) and always provide them - via common clock framework or > fixed-clock. Hi Krzysztof and Chunfeng, thank you both for the feedback. Since the solution I proposed in this patch is not acceptable I see two options: 1. Split the clocks in several if blocks matched by compatibles 2. Make the clocks required and use fixed-clock nodes for the missing clocks in the DT My understanding is that 1 is the desirable solution if the clock is really missing in some hardware variants, while 2 is desirable if all hardware variants really receive all the clocks, only that on some variants they're fixed and not controlable by SW. From what I'm reading of this discussion it seems that the latter is the case here and thus we should go for 2. Is this correct? Also Chunfeng, do you have information on whether the same is true for the MMC HW block? I recently submitted some changes to that binding [1] but I followed approach 1 there instead. However if all the clocks are present in the HW level there as well it would make more sense for me to change it to follow approach 2. Thanks, Nícolas [1] https://lore.kernel.org/all/20220617230114.2438875-1-nfraprado@collabora.com ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-20 15:50 ` Nícolas F. R. A. Prado @ 2022-06-21 7:14 ` Krzysztof Kozlowski 2022-06-22 1:57 ` Chunfeng Yun 0 siblings, 1 reply; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-21 7:14 UTC (permalink / raw) To: Nícolas F. R. A. Prado Cc: Chunfeng Yun, Greg Kroah-Hartman, Matthias Brugger, AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 20/06/2022 17:50, Nícolas F. R. A. Prado wrote: > On Mon, Jun 20, 2022 at 10:50:57AM +0200, Krzysztof Kozlowski wrote: >> On 20/06/2022 08:59, Chunfeng Yun wrote: >>> On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: >>>> On 19/06/2022 09:46, Chunfeng Yun wrote: >>>>> On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski wrote: >>>>>> On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: >>>>>>> The current clock list in the binding doesn't allow for one of >>>>>>> the >>>>>>> optional clocks to be missing and a subsequent clock to be >>>>>>> present. >>>>>>> An >>>>>>> example where this is an issue is in mt8192.dtsi, which has >>>>>>> "sys_ck", >>>>>>> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. >>>>>>> >>>>>>> Change the clock list in a way that allows the middle optional >>>>>>> clocks to >>>>>>> be missing, while still guaranteeing a fixed order. The >>>>>>> "ref_ck" is >>>>>>> kept >>>>>>> as a const even though it is optional for simplicity, since it >>>>>>> is >>>>>>> present in all current dts files. >>>>>>> >>>>>>> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> >>>>>>> --- >>>>>>> >>>>>>> .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 >>>>>>> +++++++-- >>>>>>> 1 file changed, 7 insertions(+), 2 deletions(-) >>>>>>> >>>>>>> diff --git >>>>>>> a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>>>> xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>>>> xhci.yaml >>>>>>> index 63cbc2b62d18..99a1b233ec90 100644 >>>>>>> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>>>> xhci.yaml >>>>>>> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk- >>>>>>> xhci.yaml >>>>>>> @@ -80,8 +80,13 @@ properties: >>>>>>> items: >>>>>>> - const: sys_ck # required, the following ones are >>>>>>> optional >>>>>>> - const: ref_ck >>>>>>> - - const: mcu_ck >>>>>>> - - const: dma_ck >>>>>>> + - enum: >>>>>>> + - mcu_ck >>>>>>> + - dma_ck >>>>>>> + - xhci_ck >>>>>>> + - enum: >>>>>>> + - dma_ck >>>>>>> + - xhci_ck >>>>>>> - const: xhci_ck >>>>>> >>>>>> You allow now almost any order here, including incorrect like >>>>>> sys,ref,xhci,xhci,xhci. >>>>>> >>>>>> The order of clocks has to be fixed and we cannot allow >>>>>> flexibility. >>>>>> Are >>>>>> you sure that these clocks are actually optional (not wired to >>>>>> the >>>>>> device)? >>>>> >>>>> In fact, these optional clocks are fixed, due to no gates are >>>>> provided, >>>>> SW can't control them by CCF; >>>>> In this case, I usually use a fixed clock, or ignore it. >>>> >>>> But in some versions these clocks are controllable or not? >>> Some SoCs are controllable, some ones are not (fixed clock). >> >> Thanks for confirming. Then I would prefer to make these clocks required >> (not optional) and always provide them - via common clock framework or >> fixed-clock. > > Hi Krzysztof and Chunfeng, > > thank you both for the feedback. > > Since the solution I proposed in this patch is not acceptable I see two options: > 1. Split the clocks in several if blocks matched by compatibles > 2. Make the clocks required and use fixed-clock nodes for the missing clocks in > the DT > > My understanding is that 1 is the desirable solution if the clock is really > missing in some hardware variants, while 2 is desirable if all hardware variants > really receive all the clocks, only that on some variants they're fixed and not > controlable by SW. > > From what I'm reading of this discussion it seems that the latter is the case > here and thus we should go for 2. Is this correct? This is how I understood it as well, so correct from my side. > > Also Chunfeng, do you have information on whether the same is true for the MMC > HW block? I recently submitted some changes to that binding [1] but I followed > approach 1 there instead. However if all the clocks are present in the HW level > there as well it would make more sense for me to change it to follow approach 2. > > Thanks, > Nícolas > > [1] https://lore.kernel.org/all/20220617230114.2438875-1-nfraprado@collabora.com Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-21 7:14 ` Krzysztof Kozlowski @ 2022-06-22 1:57 ` Chunfeng Yun 2022-06-22 6:10 ` Wenbin Mei 0 siblings, 1 reply; 18+ messages in thread From: Chunfeng Yun @ 2022-06-22 1:57 UTC (permalink / raw) To: Krzysztof Kozlowski, Nícolas F. R. A. Prado, Wenbin Mei Cc: Greg Kroah-Hartman, Matthias Brugger, AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Tue, 2022-06-21 at 09:14 +0200, Krzysztof Kozlowski wrote: > On 20/06/2022 17:50, Nícolas F. R. A. Prado wrote: > > On Mon, Jun 20, 2022 at 10:50:57AM +0200, Krzysztof Kozlowski > > wrote: > > > On 20/06/2022 08:59, Chunfeng Yun wrote: > > > > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: > > > > > On 19/06/2022 09:46, Chunfeng Yun wrote: > > > > > > On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski > > > > > > wrote: > > > > > > > On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > > > > > > > > The current clock list in the binding doesn't allow for > > > > > > > > one of > > > > > > > > the > > > > > > > > optional clocks to be missing and a subsequent clock to > > > > > > > > be > > > > > > > > present. > > > > > > > > An > > > > > > > > example where this is an issue is in mt8192.dtsi, which > > > > > > > > has > > > > > > > > "sys_ck", > > > > > > > > "ref_ck", "xhci_ck" and would cause dtbs_check > > > > > > > > warnings. > > > > > > > > > > > > > > > > Change the clock list in a way that allows the middle > > > > > > > > optional > > > > > > > > clocks to > > > > > > > > be missing, while still guaranteeing a fixed order. The > > > > > > > > "ref_ck" is > > > > > > > > kept > > > > > > > > as a const even though it is optional for simplicity, > > > > > > > > since it > > > > > > > > is > > > > > > > > present in all current dts files. > > > > > > > > > > > > > > > > Signed-off-by: Nícolas F. R. A. Prado < > > > > > > > > nfraprado@collabora.com> > > > > > > > > --- > > > > > > > > > > > > > > > > .../devicetree/bindings/usb/mediatek,mtk- > > > > > > > > xhci.yaml | 9 > > > > > > > > +++++++-- > > > > > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > diff --git > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > xhci.yaml > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > xhci.yaml > > > > > > > > index 63cbc2b62d18..99a1b233ec90 100644 > > > > > > > > --- > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > xhci.yaml > > > > > > > > +++ > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > xhci.yaml > > > > > > > > @@ -80,8 +80,13 @@ properties: > > > > > > > > items: > > > > > > > > - const: sys_ck # required, the following ones > > > > > > > > are > > > > > > > > optional > > > > > > > > - const: ref_ck > > > > > > > > - - const: mcu_ck > > > > > > > > - - const: dma_ck > > > > > > > > + - enum: > > > > > > > > + - mcu_ck > > > > > > > > + - dma_ck > > > > > > > > + - xhci_ck > > > > > > > > + - enum: > > > > > > > > + - dma_ck > > > > > > > > + - xhci_ck > > > > > > > > - const: xhci_ck > > > > > > > > > > > > > > You allow now almost any order here, including incorrect > > > > > > > like > > > > > > > sys,ref,xhci,xhci,xhci. > > > > > > > > > > > > > > The order of clocks has to be fixed and we cannot allow > > > > > > > flexibility. > > > > > > > Are > > > > > > > you sure that these clocks are actually optional (not > > > > > > > wired to > > > > > > > the > > > > > > > device)? > > > > > > > > > > > > In fact, these optional clocks are fixed, due to no gates > > > > > > are > > > > > > provided, > > > > > > SW can't control them by CCF; > > > > > > In this case, I usually use a fixed clock, or ignore it. > > > > > > > > > > But in some versions these clocks are controllable or not? > > > > > > > > Some SoCs are controllable, some ones are not (fixed clock). > > > > > > Thanks for confirming. Then I would prefer to make these clocks > > > required > > > (not optional) and always provide them - via common clock > > > framework or > > > fixed-clock. > > > > Hi Krzysztof and Chunfeng, > > > > thank you both for the feedback. > > > > Since the solution I proposed in this patch is not acceptable I see > > two options: > > 1. Split the clocks in several if blocks matched by compatibles > > 2. Make the clocks required and use fixed-clock nodes for the > > missing clocks in > > the DT > > > > My understanding is that 1 is the desirable solution if the clock > > is really > > missing in some hardware variants, while 2 is desirable if all > > hardware variants > > really receive all the clocks, only that on some variants they're > > fixed and not > > controlable by SW. > > > > From what I'm reading of this discussion it seems that the latter > > is the case > > here and thus we should go for 2. Is this correct? > > This is how I understood it as well, so correct from my side. Also right for me. > > > > > Also Chunfeng, do you have information on whether the same is true > > for the MMC > > HW block? I recently submitted some changes to that binding [1] but > > I followed > > approach 1 there instead. However if all the clocks are present in > > the HW level > > there as well it would make more sense for me to change it to > > follow approach 2. I discussed it with Wenbin, MMC seems a little different with USB, Hi Wenbin, Please give some comments about MMC, thanks > > > > Thanks, > > Nícolas > > > > [1] > > https://lore.kernel.org/all/20220617230114.2438875-1-nfraprado@collabora.com > > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-22 1:57 ` Chunfeng Yun @ 2022-06-22 6:10 ` Wenbin Mei 2022-06-22 13:22 ` Nícolas F. R. A. Prado 0 siblings, 1 reply; 18+ messages in thread From: Wenbin Mei @ 2022-06-22 6:10 UTC (permalink / raw) To: Chunfeng Yun, Krzysztof Kozlowski, Nícolas F. R. A. Prado Cc: Greg Kroah-Hartman, Matthias Brugger, AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Wed, 2022-06-22 at 09:57 +0800, Chunfeng Yun wrote: > On Tue, 2022-06-21 at 09:14 +0200, Krzysztof Kozlowski wrote: > > On 20/06/2022 17:50, Nícolas F. R. A. Prado wrote: > > > On Mon, Jun 20, 2022 at 10:50:57AM +0200, Krzysztof Kozlowski > > > wrote: > > > > On 20/06/2022 08:59, Chunfeng Yun wrote: > > > > > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: > > > > > > On 19/06/2022 09:46, Chunfeng Yun wrote: > > > > > > > On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski > > > > > > > wrote: > > > > > > > > On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > > > > > > > > > The current clock list in the binding doesn't allow > > > > > > > > > for > > > > > > > > > one of > > > > > > > > > the > > > > > > > > > optional clocks to be missing and a subsequent clock > > > > > > > > > to > > > > > > > > > be > > > > > > > > > present. > > > > > > > > > An > > > > > > > > > example where this is an issue is in mt8192.dtsi, > > > > > > > > > which > > > > > > > > > has > > > > > > > > > "sys_ck", > > > > > > > > > "ref_ck", "xhci_ck" and would cause dtbs_check > > > > > > > > > warnings. > > > > > > > > > > > > > > > > > > Change the clock list in a way that allows the middle > > > > > > > > > optional > > > > > > > > > clocks to > > > > > > > > > be missing, while still guaranteeing a fixed order. > > > > > > > > > The > > > > > > > > > "ref_ck" is > > > > > > > > > kept > > > > > > > > > as a const even though it is optional for simplicity, > > > > > > > > > since it > > > > > > > > > is > > > > > > > > > present in all current dts files. > > > > > > > > > > > > > > > > > > Signed-off-by: Nícolas F. R. A. Prado < > > > > > > > > > nfraprado@collabora.com> > > > > > > > > > --- > > > > > > > > > > > > > > > > > > .../devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > xhci.yaml | 9 > > > > > > > > > +++++++-- > > > > > > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > diff --git > > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > xhci.yaml > > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > xhci.yaml > > > > > > > > > index 63cbc2b62d18..99a1b233ec90 100644 > > > > > > > > > --- > > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > xhci.yaml > > > > > > > > > +++ > > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > xhci.yaml > > > > > > > > > @@ -80,8 +80,13 @@ properties: > > > > > > > > > items: > > > > > > > > > - const: sys_ck # required, the following > > > > > > > > > ones > > > > > > > > > are > > > > > > > > > optional > > > > > > > > > - const: ref_ck > > > > > > > > > - - const: mcu_ck > > > > > > > > > - - const: dma_ck > > > > > > > > > + - enum: > > > > > > > > > + - mcu_ck > > > > > > > > > + - dma_ck > > > > > > > > > + - xhci_ck > > > > > > > > > + - enum: > > > > > > > > > + - dma_ck > > > > > > > > > + - xhci_ck > > > > > > > > > - const: xhci_ck > > > > > > > > > > > > > > > > You allow now almost any order here, including > > > > > > > > incorrect > > > > > > > > like > > > > > > > > sys,ref,xhci,xhci,xhci. > > > > > > > > > > > > > > > > The order of clocks has to be fixed and we cannot allow > > > > > > > > flexibility. > > > > > > > > Are > > > > > > > > you sure that these clocks are actually optional (not > > > > > > > > wired to > > > > > > > > the > > > > > > > > device)? > > > > > > > > > > > > > > In fact, these optional clocks are fixed, due to no gates > > > > > > > are > > > > > > > provided, > > > > > > > SW can't control them by CCF; > > > > > > > In this case, I usually use a fixed clock, or ignore it. > > > > > > > > > > > > But in some versions these clocks are controllable or not? > > > > > > > > > > Some SoCs are controllable, some ones are not (fixed clock). > > > > > > > > Thanks for confirming. Then I would prefer to make these clocks > > > > required > > > > (not optional) and always provide them - via common clock > > > > framework or > > > > fixed-clock. > > > > > > Hi Krzysztof and Chunfeng, > > > > > > thank you both for the feedback. > > > > > > Since the solution I proposed in this patch is not acceptable I > > > see > > > two options: > > > 1. Split the clocks in several if blocks matched by compatibles > > > 2. Make the clocks required and use fixed-clock nodes for the > > > missing clocks in > > > the DT > > > > > > My understanding is that 1 is the desirable solution if the clock > > > is really > > > missing in some hardware variants, while 2 is desirable if all > > > hardware variants > > > really receive all the clocks, only that on some variants they're > > > fixed and not > > > controlable by SW. > > > > > > From what I'm reading of this discussion it seems that the latter > > > is the case > > > here and thus we should go for 2. Is this correct? > > > > This is how I understood it as well, so correct from my side. > > Also right for me. > > > > > > > > > Also Chunfeng, do you have information on whether the same is > > > true > > > for the MMC > > > HW block? I recently submitted some changes to that binding [1] > > > but > > > I followed > > > approach 1 there instead. However if all the clocks are present > > > in > > > the HW level > > > there as well it would make more sense for me to change it to > > > follow approach 2. > > I discussed it with Wenbin, MMC seems a little different with USB, > > Hi Wenbin, > > Please give some comments about MMC, thanks > Hi Chunfeng, As we discussed, the following change is the desirable solution for the Mediatek MMC HW. https://lists.infradead.org/pipermail/linux-mediatek/2022-June/043691.html Thanks. > > > > > > Thanks, > > > Nícolas > > > > > > [1] > > > https://lore.kernel.org/all/20220617230114.2438875-1-nfraprado@collabora.com > > > > > > Best regards, > > Krzysztof > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-22 6:10 ` Wenbin Mei @ 2022-06-22 13:22 ` Nícolas F. R. A. Prado 0 siblings, 0 replies; 18+ messages in thread From: Nícolas F. R. A. Prado @ 2022-06-22 13:22 UTC (permalink / raw) To: Wenbin Mei Cc: Chunfeng Yun, Krzysztof Kozlowski, Greg Kroah-Hartman, Matthias Brugger, AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Wed, Jun 22, 2022 at 02:10:55PM +0800, Wenbin Mei wrote: > On Wed, 2022-06-22 at 09:57 +0800, Chunfeng Yun wrote: > > On Tue, 2022-06-21 at 09:14 +0200, Krzysztof Kozlowski wrote: > > > On 20/06/2022 17:50, Nícolas F. R. A. Prado wrote: > > > > On Mon, Jun 20, 2022 at 10:50:57AM +0200, Krzysztof Kozlowski > > > > wrote: > > > > > On 20/06/2022 08:59, Chunfeng Yun wrote: > > > > > > On Sun, 2022-06-19 at 14:05 +0200, Krzysztof Kozlowski wrote: > > > > > > > On 19/06/2022 09:46, Chunfeng Yun wrote: > > > > > > > > On Fri, 2022-06-17 at 18:25 -0700, Krzysztof Kozlowski > > > > > > > > wrote: > > > > > > > > > On 17/06/2022 15:29, Nícolas F. R. A. Prado wrote: > > > > > > > > > > The current clock list in the binding doesn't allow > > > > > > > > > > for > > > > > > > > > > one of > > > > > > > > > > the > > > > > > > > > > optional clocks to be missing and a subsequent clock > > > > > > > > > > to > > > > > > > > > > be > > > > > > > > > > present. > > > > > > > > > > An > > > > > > > > > > example where this is an issue is in mt8192.dtsi, > > > > > > > > > > which > > > > > > > > > > has > > > > > > > > > > "sys_ck", > > > > > > > > > > "ref_ck", "xhci_ck" and would cause dtbs_check > > > > > > > > > > warnings. > > > > > > > > > > > > > > > > > > > > Change the clock list in a way that allows the middle > > > > > > > > > > optional > > > > > > > > > > clocks to > > > > > > > > > > be missing, while still guaranteeing a fixed order. > > > > > > > > > > The > > > > > > > > > > "ref_ck" is > > > > > > > > > > kept > > > > > > > > > > as a const even though it is optional for simplicity, > > > > > > > > > > since it > > > > > > > > > > is > > > > > > > > > > present in all current dts files. > > > > > > > > > > > > > > > > > > > > Signed-off-by: Nícolas F. R. A. Prado < > > > > > > > > > > nfraprado@collabora.com> > > > > > > > > > > --- > > > > > > > > > > > > > > > > > > > > .../devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > > xhci.yaml | 9 > > > > > > > > > > +++++++-- > > > > > > > > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > > > > > > > > > > > > > > > diff --git > > > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > > xhci.yaml > > > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > > xhci.yaml > > > > > > > > > > index 63cbc2b62d18..99a1b233ec90 100644 > > > > > > > > > > --- > > > > > > > > > > a/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > > xhci.yaml > > > > > > > > > > +++ > > > > > > > > > > b/Documentation/devicetree/bindings/usb/mediatek,mtk- > > > > > > > > > > xhci.yaml > > > > > > > > > > @@ -80,8 +80,13 @@ properties: > > > > > > > > > > items: > > > > > > > > > > - const: sys_ck # required, the following > > > > > > > > > > ones > > > > > > > > > > are > > > > > > > > > > optional > > > > > > > > > > - const: ref_ck > > > > > > > > > > - - const: mcu_ck > > > > > > > > > > - - const: dma_ck > > > > > > > > > > + - enum: > > > > > > > > > > + - mcu_ck > > > > > > > > > > + - dma_ck > > > > > > > > > > + - xhci_ck > > > > > > > > > > + - enum: > > > > > > > > > > + - dma_ck > > > > > > > > > > + - xhci_ck > > > > > > > > > > - const: xhci_ck > > > > > > > > > > > > > > > > > > You allow now almost any order here, including > > > > > > > > > incorrect > > > > > > > > > like > > > > > > > > > sys,ref,xhci,xhci,xhci. > > > > > > > > > > > > > > > > > > The order of clocks has to be fixed and we cannot allow > > > > > > > > > flexibility. > > > > > > > > > Are > > > > > > > > > you sure that these clocks are actually optional (not > > > > > > > > > wired to > > > > > > > > > the > > > > > > > > > device)? > > > > > > > > > > > > > > > > In fact, these optional clocks are fixed, due to no gates > > > > > > > > are > > > > > > > > provided, > > > > > > > > SW can't control them by CCF; > > > > > > > > In this case, I usually use a fixed clock, or ignore it. > > > > > > > > > > > > > > But in some versions these clocks are controllable or not? > > > > > > > > > > > > Some SoCs are controllable, some ones are not (fixed clock). > > > > > > > > > > Thanks for confirming. Then I would prefer to make these clocks > > > > > required > > > > > (not optional) and always provide them - via common clock > > > > > framework or > > > > > fixed-clock. > > > > > > > > Hi Krzysztof and Chunfeng, > > > > > > > > thank you both for the feedback. > > > > > > > > Since the solution I proposed in this patch is not acceptable I > > > > see > > > > two options: > > > > 1. Split the clocks in several if blocks matched by compatibles > > > > 2. Make the clocks required and use fixed-clock nodes for the > > > > missing clocks in > > > > the DT > > > > > > > > My understanding is that 1 is the desirable solution if the clock > > > > is really > > > > missing in some hardware variants, while 2 is desirable if all > > > > hardware variants > > > > really receive all the clocks, only that on some variants they're > > > > fixed and not > > > > controlable by SW. > > > > > > > > From what I'm reading of this discussion it seems that the latter > > > > is the case > > > > here and thus we should go for 2. Is this correct? > > > > > > This is how I understood it as well, so correct from my side. > > > > Also right for me. > > > > > > > > > > > > > Also Chunfeng, do you have information on whether the same is > > > > true > > > > for the MMC > > > > HW block? I recently submitted some changes to that binding [1] > > > > but > > > > I followed > > > > approach 1 there instead. However if all the clocks are present > > > > in > > > > the HW level > > > > there as well it would make more sense for me to change it to > > > > follow approach 2. > > > > I discussed it with Wenbin, MMC seems a little different with USB, > > > > Hi Wenbin, > > > > Please give some comments about MMC, thanks > > > Hi Chunfeng, > > As we discussed, the following change is the desirable solution for the > Mediatek MMC HW. > > https://lists.infradead.org/pipermail/linux-mediatek/2022-June/043691.html Got it, thank you both. I'll keep that approach for MMC then, and change the one here for USB. Thanks, Nícolas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-17 22:29 ` [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Nícolas F. R. A. Prado 2022-06-18 1:25 ` Krzysztof Kozlowski @ 2022-06-19 7:40 ` Chunfeng Yun 2022-06-19 11:49 ` Krzysztof Kozlowski 1 sibling, 1 reply; 18+ messages in thread From: Chunfeng Yun @ 2022-06-19 7:40 UTC (permalink / raw) To: Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On Fri, 2022-06-17 at 18:29 -0400, Nícolas F. R. A. Prado wrote: > The current clock list in the binding doesn't allow for one of the > optional clocks to be missing and a subsequent clock to be present. > An > example where this is an issue is in mt8192.dtsi, which has "sys_ck", > "ref_ck", "xhci_ck" and would cause dtbs_check warnings. How about using fixed clock instead to fix the check warning? Using enum way seems make it more complex. > > Change the clock list in a way that allows the middle optional clocks > to > be missing, while still guaranteeing a fixed order. The "ref_ck" is > kept > as a const even though it is optional for simplicity, since it is > present in all current dts files. > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > --- > > .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 9 > +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk- > xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk- > xhci.yaml > index 63cbc2b62d18..99a1b233ec90 100644 > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > @@ -80,8 +80,13 @@ properties: > items: > - const: sys_ck # required, the following ones are optional > - const: ref_ck > - - const: mcu_ck > - - const: dma_ck > + - enum: > + - mcu_ck > + - dma_ck > + - xhci_ck > + - enum: > + - dma_ck > + - xhci_ck > - const: xhci_ck > > assigned-clocks: ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing 2022-06-19 7:40 ` Chunfeng Yun @ 2022-06-19 11:49 ` Krzysztof Kozlowski 0 siblings, 0 replies; 18+ messages in thread From: Krzysztof Kozlowski @ 2022-06-19 11:49 UTC (permalink / raw) To: Chunfeng Yun, Nícolas F. R. A. Prado, Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek, linux-usb On 19/06/2022 09:40, Chunfeng Yun wrote: > On Fri, 2022-06-17 at 18:29 -0400, Nícolas F. R. A. Prado wrote: >> The current clock list in the binding doesn't allow for one of the >> optional clocks to be missing and a subsequent clock to be present. >> An >> example where this is an issue is in mt8192.dtsi, which has "sys_ck", >> "ref_ck", "xhci_ck" and would cause dtbs_check warnings. > How about using fixed clock instead to fix the check warning? > Using enum way seems make it more complex. > That would mean the clock is not actually optional. The DTS should reflect the hardware so either you have the clock there or not. Either it is an input or not. Of course there are some exceptions (like non-controllable clock or regulator which not always has to be modeled). Best regards, Krzysztof ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/3] arm64: dts: mt8192: Follow clock order for XHCI 2022-06-17 22:29 [PATCH 0/3] Fixes for dtbs_check warnings on Mediatek XHCI nodes Nícolas F. R. A. Prado 2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado 2022-06-17 22:29 ` [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Nícolas F. R. A. Prado @ 2022-06-17 22:29 ` Nícolas F. R. A. Prado 2 siblings, 0 replies; 18+ messages in thread From: Nícolas F. R. A. Prado @ 2022-06-17 22:29 UTC (permalink / raw) To: Greg Kroah-Hartman, Matthias Brugger Cc: AngeloGioacchino Del Regno, kernel, Nícolas F. R. A. Prado, Allen-KH Cheng, Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel, linux-kernel, linux-mediatek Even though "ref_ck" and "xhci_ck" are optional clocks for XHCI, the binding expects them to follow a specific order. Fix the order to get rid of a dtbs_check warning. Fixes: e5aac2258e66 ("arm64: dts: mt8192: Add xhci node") Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> --- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi index 733aec2e7f77..c8158b573bf8 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi @@ -723,9 +723,9 @@ xhci: usb@11200000 { assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D5_D4>, <&topckgen CLK_TOP_UNIVPLL_D5_D4>; clocks = <&infracfg CLK_INFRA_SSUSB>, - <&infracfg CLK_INFRA_SSUSB_XHCI>, - <&apmixedsys CLK_APMIXED_USBPLL>; - clock-names = "sys_ck", "xhci_ck", "ref_ck"; + <&apmixedsys CLK_APMIXED_USBPLL>, + <&infracfg CLK_INFRA_SSUSB_XHCI>; + clock-names = "sys_ck", "ref_ck", "xhci_ck"; wakeup-source; mediatek,syscon-wakeup = <&pericfg 0x420 102>; status = "disabled"; -- 2.36.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
end of thread, other threads:[~2022-06-22 13:22 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-06-17 22:29 [PATCH 0/3] Fixes for dtbs_check warnings on Mediatek XHCI nodes Nícolas F. R. A. Prado 2022-06-17 22:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: Allow wakeup interrupt-names to be optional Nícolas F. R. A. Prado 2022-06-18 1:30 ` Krzysztof Kozlowski 2022-06-19 7:47 ` Chunfeng Yun 2022-06-17 22:29 ` [PATCH 2/3] dt-bindings: usb: mtk-xhci: Allow middle optional clocks to be missing Nícolas F. R. A. Prado 2022-06-18 1:25 ` Krzysztof Kozlowski 2022-06-19 7:46 ` Chunfeng Yun 2022-06-19 12:05 ` Krzysztof Kozlowski 2022-06-20 6:59 ` Chunfeng Yun 2022-06-20 8:50 ` Krzysztof Kozlowski 2022-06-20 15:50 ` Nícolas F. R. A. Prado 2022-06-21 7:14 ` Krzysztof Kozlowski 2022-06-22 1:57 ` Chunfeng Yun 2022-06-22 6:10 ` Wenbin Mei 2022-06-22 13:22 ` Nícolas F. R. A. Prado 2022-06-19 7:40 ` Chunfeng Yun 2022-06-19 11:49 ` Krzysztof Kozlowski 2022-06-17 22:29 ` [PATCH 3/3] arm64: dts: mt8192: Follow clock order for XHCI Nícolas F. R. A. Prado
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).