mbox series

[v2,00/13] mailbox/arm64/ qcom: rework compatibles for fallback

Message ID 20230314080917.68246-1-krzysztof.kozlowski@linaro.org
Headers show
Series mailbox/arm64/ qcom: rework compatibles for fallback | expand

Message

Krzysztof Kozlowski March 14, 2023, 8:09 a.m. UTC
Hi,

Changes since v1
================
1. Rebase
2. Make msm8994 fallback for several variants, not msm8953, because the latter
   actually might take some clocks.
3. Two new patches for SDX55.
4. Minor corrections in bindings style.
v1: https://lore.kernel.org/all/20230202161856.385825-1-krzysztof.kozlowski@linaro.org/

Description
===========

If entire approach is accepted (and correct), there are no dependencies and
patches can be picked independently.  Although the best in the same cycle, so
there will be no new `dtbs_check` warnings.

Best regards,
Krzysztof

Krzysztof Kozlowski (13):
  dt-bindings: mailbox: qcom,apcs-kpss-global: correct SDX55 clocks
  dt-bindings: mailbox: qcom,apcs-kpss-global: fix SDX55 'if' match
  dt-bindings: mailbox: qcom,apcs-kpss-global: use fallbacks
  mailbox: qcom-apcs-ipc: do not grow the of_device_id
  arm64: dts: qcom: ipq8074: add compatible fallback to mailbox
  arm64: dts: qcom: msm8976: add compatible fallback to mailbox
  arm64: dts: qcom: msm8998: add compatible fallback to mailbox
  arm64: dts: qcom: sdm630: add compatible fallback to mailbox
  arm64: dts: qcom: sm6115: add compatible fallback to mailbox
  arm64: dts: qcom: sm6125: add compatible fallback to mailbox
  arm64: dts: qcom: qcs404: add compatible fallback to mailbox
  arm64: dts: qcom: sc7180: add compatible fallback to mailbox
  arm64: dts: qcom: sm8150: add compatible fallback to mailbox

 .../mailbox/qcom,apcs-kpss-global.yaml        | 67 ++++++++++---------
 arch/arm64/boot/dts/qcom/ipq8074.dtsi         |  3 +-
 arch/arm64/boot/dts/qcom/msm8976.dtsi         |  3 +-
 arch/arm64/boot/dts/qcom/msm8998.dtsi         |  3 +-
 arch/arm64/boot/dts/qcom/qcs404.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sdm630.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm6115.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm6125.dtsi          |  3 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |  3 +-
 drivers/mailbox/qcom-apcs-ipc-mailbox.c       | 11 +--
 11 files changed, 60 insertions(+), 45 deletions(-)

Comments

Krzysztof Kozlowski March 16, 2023, 6:52 a.m. UTC | #1
On 14/03/2023 13:16, Dmitry Baryshkov wrote:
> On 14/03/2023 10:09, Krzysztof Kozlowski wrote:
>> Hi,
>>
>> Changes since v1
>> ================
>> 1. Rebase
>> 2. Make msm8994 fallback for several variants, not msm8953, because the latter
>>     actually might take some clocks.
> 
> Although the approach looks correct, I think that in some cases it tries 
> to mark devices compatible judging from the current driver, not from the 
> hardware itself.

Which is what compatibility is about...

> 
> For the reference, on msm8994 the apcs is a clock controller for the l2 
> clocks (which we do not support yet). If I'm not mistaken, on msm8976 
> the apcs region contains a mux for the cluster1 clocks. On sdm630/660 
> the apcs region also seems to be involved in CPU clocks scaling.

The question is this means they are incompatible?

> 
> On the other hand, the sc7180/sm8150 part seems logical.
> 


Best regards,
Krzysztof
Rob Herring (Arm) March 17, 2023, 9:07 p.m. UTC | #2
On Tue, Mar 14, 2023 at 09:09:05AM +0100, Krzysztof Kozlowski wrote:
> SDX55 and SDX65 DTS takes clocks in a bit different order.  Adjust
> bindings to the DTS.
> 

Fixes: ?

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml    | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> index d888ead09282..2992227631c4 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> @@ -97,14 +97,14 @@ allOf:
>        properties:
>          clocks:
>            items:
> +            - description: reference clock
>              - description: primary pll parent of the clock driver
>              - description: auxiliary parent
> -            - description: reference clock
>          clock-names:
>            items:
> +            - const: ref
>              - const: pll
>              - const: aux
> -            - const: ref
>    - if:
>        properties:
>          compatible:
> -- 
> 2.34.1
>
Rob Herring (Arm) March 17, 2023, 9:07 p.m. UTC | #3
On Tue, 14 Mar 2023 09:09:06 +0100, Krzysztof Kozlowski wrote:
> The qcom,sdx55-apcs-gcc is followed by another compatible (syscon), thus
> the 'if' clause must match by contains.
> 
> Fixes: 0d17014e9189 ("dt-bindings: mailbox: Add binding for SDX55 APCS")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml   | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>
Manivannan Sadhasivam March 20, 2023, 10:39 a.m. UTC | #4
On Tue, Mar 14, 2023 at 09:09:05AM +0100, Krzysztof Kozlowski wrote:
> SDX55 and SDX65 DTS takes clocks in a bit different order.  Adjust
> bindings to the DTS.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Manivannan Sadhasivam <mani@kernel.org>

Thanks,
Mani

> ---
>  .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml    | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> index d888ead09282..2992227631c4 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> @@ -97,14 +97,14 @@ allOf:
>        properties:
>          clocks:
>            items:
> +            - description: reference clock
>              - description: primary pll parent of the clock driver
>              - description: auxiliary parent
> -            - description: reference clock
>          clock-names:
>            items:
> +            - const: ref
>              - const: pll
>              - const: aux
> -            - const: ref
>    - if:
>        properties:
>          compatible:
> -- 
> 2.34.1
>
Manivannan Sadhasivam March 20, 2023, 10:40 a.m. UTC | #5
On Tue, Mar 14, 2023 at 09:09:06AM +0100, Krzysztof Kozlowski wrote:
> The qcom,sdx55-apcs-gcc is followed by another compatible (syscon), thus
> the 'if' clause must match by contains.
> 
> Fixes: 0d17014e9189 ("dt-bindings: mailbox: Add binding for SDX55 APCS")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Manivannan Sadhasivam <mani@kernel.org>

Thanks,
Mani

> ---
>  .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml   | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> index 2992227631c4..4d2f408a5efb 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> @@ -91,8 +91,9 @@ allOf:
>    - if:
>        properties:
>          compatible:
> -          enum:
> -            - qcom,sdx55-apcs-gcc
> +          contains:
> +            enum:
> +              - qcom,sdx55-apcs-gcc
>      then:
>        properties:
>          clocks:
> -- 
> 2.34.1
>
Dmitry Baryshkov March 22, 2023, 10:28 p.m. UTC | #6
On Wed, 22 Mar 2023 at 19:37, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 16/03/2023 07:52, Krzysztof Kozlowski wrote:
> > On 14/03/2023 13:16, Dmitry Baryshkov wrote:
> >> On 14/03/2023 10:09, Krzysztof Kozlowski wrote:
> >>> Hi,
> >>>
> >>> Changes since v1
> >>> ================
> >>> 1. Rebase
> >>> 2. Make msm8994 fallback for several variants, not msm8953, because the latter
> >>>     actually might take some clocks.
> >>
> >> Although the approach looks correct, I think that in some cases it tries
> >> to mark devices compatible judging from the current driver, not from the
> >> hardware itself.
> >
> > Which is what compatibility is about...

Well, I was trying to say that once we update the driver, the devices
will not be compatible. But probably our definitions of being
compatible differ.

> >
> >>
> >> For the reference, on msm8994 the apcs is a clock controller for the l2
> >> clocks (which we do not support yet). If I'm not mistaken, on msm8976
> >> the apcs region contains a mux for the cluster1 clocks. On sdm630/660
> >> the apcs region also seems to be involved in CPU clocks scaling.
> >
> > The question is this means they are incompatible?
>
> Since there are no more comments I assume they are actually compatible
> in the terms of SW interface.
Krzysztof Kozlowski March 23, 2023, 6:33 a.m. UTC | #7
On 22/03/2023 23:28, Dmitry Baryshkov wrote:
> On Wed, 22 Mar 2023 at 19:37, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 16/03/2023 07:52, Krzysztof Kozlowski wrote:
>>> On 14/03/2023 13:16, Dmitry Baryshkov wrote:
>>>> On 14/03/2023 10:09, Krzysztof Kozlowski wrote:
>>>>> Hi,
>>>>>
>>>>> Changes since v1
>>>>> ================
>>>>> 1. Rebase
>>>>> 2. Make msm8994 fallback for several variants, not msm8953, because the latter
>>>>>     actually might take some clocks.
>>>>
>>>> Although the approach looks correct, I think that in some cases it tries
>>>> to mark devices compatible judging from the current driver, not from the
>>>> hardware itself.
>>>
>>> Which is what compatibility is about...
> 
> Well, I was trying to say that once we update the driver, the devices
> will not be compatible. But probably our definitions of being
> compatible differ.

What do you want to update in the driver? What's going to happen with
it? What is missing?

Best regards,
Krzysztof