mbox series

[v3,00/13] Use qmp_send to update co-processor load state

Message ID 1624560727-6870-1-git-send-email-sibis@codeaurora.org
Headers show
Series Use qmp_send to update co-processor load state | expand

Message

Sibi Sankar June 24, 2021, 6:51 p.m. UTC
The power domains exposed by the AOSS QMP driver control the load state
resources linked to modem, adsp, cdsp remoteprocs. These are used to
notify the Always on Subsystem (AOSS) that a particular co-processor is
up/down. AOSS uses this information to wait for the co-processors to
suspend before starting its sleep sequence. These co-processors enter
low-power modes independent to that of the application processor and
the load state resources linked to them are expected to remain unaltered
across system suspend/resume cycles. To achieve this behavior let's stop
modeling them as power-domains and replace them with generic qmp_send
interface instead.

https://lore.kernel.org/lkml/20200913034603.GV3715@yoga/
Previous dicussion on dropping power-domain support from AOSS QMP driver

Depends on:
qmp_send: https://patchwork.kernel.org/project/linux-arm-msm/cover/1623237532-20829-1-git-send-email-sibis@codeaurora.org/

V3:
 * Misc. documentation fixes [patch 2]:
  - Reduce power-domain maxItems due to load_state pd removal
  - Combine compatibles where possible with the load_state pd removal
  - Fixup the qcom,qmp ref to phandle type

V2:
 * load_state is currently broken on mainline so be safely dropped
   without side-effects.
 * Rebased on top of qmp_send v3 series.
 * Dropped R-b from Stephen and Rob on patch 3 due to the yaml
   conversion.
 * New patch [12] to drop unused aoss-qmp header.
 * Commit message update [patch 1] [Rob]
 * Reorder the series [Stephen]

Sibi Sankar (13):
  dt-bindings: soc: qcom: aoss: Drop power-domain bindings
  dt-bindings: remoteproc: qcom: pas: Add QMP bindings
  dt-bindings: remoteproc: qcom: Add QMP bindings
  remoteproc: qcom: q6v5: Use qmp_send to update co-processor load state
  arm64: dts: qcom: sc7180: Use QMP binding to control load state
  arm64: dts: qcom: sc7280: Use QMP binding to control load state
  arm64: dts: qcom: sdm845: Use QMP binding to control load state
  arm64: dts: qcom: sm8150: Use QMP binding to control load state
  arm64: dts: qcom: sm8250: Use QMP binding to control load state
  arm64: dts: qcom: sm8350: Use QMP binding to control load state
  soc: qcom: aoss: Drop power domain support
  dt-bindings: msm/dp: Remove aoss-qmp header
  dt-bindings: soc: qcom: aoss: Delete unused power-domain definitions

 .../bindings/display/msm/dp-controller.yaml        |   1 -
 .../devicetree/bindings/remoteproc/qcom,adsp.yaml  |  62 ++++++------
 .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |   7 +-
 .../devicetree/bindings/soc/qcom/qcom,aoss-qmp.txt |  16 +--
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |   9 +-
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |   2 -
 arch/arm64/boot/dts/qcom/sdm845.dtsi               |   8 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi               |  28 +++---
 arch/arm64/boot/dts/qcom/sm8250.dtsi               |  22 ++---
 arch/arm64/boot/dts/qcom/sm8350.dtsi               |  30 +++---
 drivers/remoteproc/qcom_q6v5.c                     |  56 ++++++++++-
 drivers/remoteproc/qcom_q6v5.h                     |   7 +-
 drivers/remoteproc/qcom_q6v5_adsp.c                |   7 +-
 drivers/remoteproc/qcom_q6v5_mss.c                 |  44 ++-------
 drivers/remoteproc/qcom_q6v5_pas.c                 |  80 ++++-----------
 drivers/remoteproc/qcom_q6v5_wcss.c                |   4 +-
 drivers/soc/qcom/qcom_aoss.c                       | 109 +--------------------
 include/dt-bindings/power/qcom-aoss-qmp.h          |  14 ---
 18 files changed, 184 insertions(+), 322 deletions(-)
 delete mode 100644 include/dt-bindings/power/qcom-aoss-qmp.h

Comments

Matthias Kaehlcke June 25, 2021, 10:16 p.m. UTC | #1
On Fri, Jun 25, 2021 at 12:22:07AM +0530, Sibi Sankar wrote:
> Delete unused power-domain definitions exposed by AOSS QMP.

> 

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

> Reviewed-by: Stephen Boyd <swboyd@chromium.org>

> Acked-by: Rob Herring <robh@kernel.org>


Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Rob Herring July 14, 2021, 7:34 p.m. UTC | #2
On Fri, Jun 25, 2021 at 12:21:56AM +0530, Sibi Sankar wrote:
> Add Qualcomm Mailbox Protocol (QMP) binding to replace the power domains

> exposed by the AOSS QMP node.


Not a compatible change. Explain why that's okay for all 
platforms/users.

> 

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

> ---

> 

> v3:

>  * Misc. documentation fixes:

>   - Reduce power-domain maxItems due to load_state pd removal

>   - Combine compatibles where possible with the load_state pd removal

>   - Fixup the qcom,qmp ref to phandle type

> 

>  .../devicetree/bindings/remoteproc/qcom,adsp.yaml  | 62 +++++++++++-----------

>  1 file changed, 30 insertions(+), 32 deletions(-)

> 

> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> index 9ea05e608bc1..ad85617b43fa 100644

> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> @@ -75,11 +75,11 @@ properties:

>  

>    power-domains:

>      minItems: 1

> -    maxItems: 3

> +    maxItems: 2

>  

>    power-domain-names:

>      minItems: 1

> -    maxItems: 3

> +    maxItems: 2

>  

>    firmware-name:

>      $ref: /schemas/types.yaml#/definitions/string

> @@ -89,6 +89,10 @@ properties:

>      maxItems: 1

>      description: Reference to the reserved-memory for the Hexagon core

>  

> +  qcom,qmp:

> +    $ref: /schemas/types.yaml#/definitions/phandle

> +    description: Reference to the AOSS side-channel message RAM.

> +

>    qcom,smem-states:

>      $ref: /schemas/types.yaml#/definitions/phandle-array

>      description: States used by the AP to signal the Hexagon core

> @@ -359,13 +363,11 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

>              - description: MX power domain

>              - description: MSS power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: cx

>              - const: mx

>              - const: mss

> @@ -381,43 +383,20 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

> -        power-domain-names:

> -          items:

> -            - const: load_state

> -            - const: cx

>  

>    - if:

>        properties:

>          compatible:

>            contains:

>              enum:

> +              - qcom,sdx55-mpss-pas

>                - qcom,sm8150-mpss-pas

>                - qcom,sm8350-mpss-pas

>      then:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

> -            - description: CX power domain

> -            - description: MSS power domain

> -        power-domain-names:

> -          items:

> -            - const: load_state

> -            - const: cx

> -            - const: mss

> -

> -  - if:

> -      properties:

> -        compatible:

> -          contains:

> -            enum:

> -              - qcom,sdx55-mpss-pas

> -    then:

> -      properties:

> -        power-domains:

> -          items:

>              - description: CX power domain

>              - description: MSS power domain

>          power-domain-names:

> @@ -439,12 +418,10 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: LCX power domain

>              - description: LMX power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: lcx

>              - const: lmx

>  

> @@ -458,12 +435,10 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

>              - description: MXC power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: cx

>              - const: mxc

>  

> @@ -499,6 +474,29 @@ allOf:

>              - const: mss_restart

>              - const: pdc_reset

>  

> +  - if:

> +      properties:

> +        compatible:

> +          contains:

> +            enum:

> +              - qcom,sc7180-mpss-pas

> +              - qcom,sm8150-adsp-pas

> +              - qcom,sm8150-cdsp-pas

> +              - qcom,sm8150-mpss-pas

> +              - qcom,sm8150-slpi-pas

> +              - qcom,sm8250-adsp-pas

> +              - qcom,sm8250-cdsp-pas

> +              - qcom,sm8250-slpi-pas

> +              - qcom,sm8350-adsp-pas

> +              - qcom,sm8350-cdsp-pas

> +              - qcom,sm8350-mpss-pas

> +              - qcom,sm8350-slpi-pas

> +    then:

> +      properties:

> +        qcom,qmp:

> +          items:

> +            - description: Reference to the AOSS side-channel message RAM.

> +

>  examples:

>    - |

>      #include <dt-bindings/clock/qcom,rpmcc.h>

> -- 

> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,

> a Linux Foundation Collaborative Project

> 

>
Sibi Sankar July 19, 2021, 4:30 p.m. UTC | #3
On 2021-07-15 01:04, Rob Herring wrote:
> On Fri, Jun 25, 2021 at 12:21:56AM +0530, Sibi Sankar wrote:

>> Add Qualcomm Mailbox Protocol (QMP) binding to replace the power 

>> domains

>> exposed by the AOSS QMP node.

> 

> Not a compatible change. Explain why that's okay for all

> platforms/users.


It's not meant for all platforms.
Rather we just replace the load-state
power-domain with the new qmp
property and it only affects the
compatibles covered below.

> 

>> 

>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

>> ---

>> 

>> v3:

>>  * Misc. documentation fixes:

>>   - Reduce power-domain maxItems due to load_state pd removal

>>   - Combine compatibles where possible with the load_state pd removal

>>   - Fixup the qcom,qmp ref to phandle type

>> 

>>  .../devicetree/bindings/remoteproc/qcom,adsp.yaml  | 62 

>> +++++++++++-----------

>>  1 file changed, 30 insertions(+), 32 deletions(-)

>> 

>> diff --git 

>> a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml 

>> b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

>> index 9ea05e608bc1..ad85617b43fa 100644

>> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

>> @@ -75,11 +75,11 @@ properties:

>> 

>>    power-domains:

>>      minItems: 1

>> -    maxItems: 3

>> +    maxItems: 2

>> 

>>    power-domain-names:

>>      minItems: 1

>> -    maxItems: 3

>> +    maxItems: 2

>> 

>>    firmware-name:

>>      $ref: /schemas/types.yaml#/definitions/string

>> @@ -89,6 +89,10 @@ properties:

>>      maxItems: 1

>>      description: Reference to the reserved-memory for the Hexagon 

>> core

>> 

>> +  qcom,qmp:

>> +    $ref: /schemas/types.yaml#/definitions/phandle

>> +    description: Reference to the AOSS side-channel message RAM.

>> +

>>    qcom,smem-states:

>>      $ref: /schemas/types.yaml#/definitions/phandle-array

>>      description: States used by the AP to signal the Hexagon core

>> @@ -359,13 +363,11 @@ allOf:

>>        properties:

>>          power-domains:

>>            items:

>> -            - description: Load State power domain

>>              - description: CX power domain

>>              - description: MX power domain

>>              - description: MSS power domain

>>          power-domain-names:

>>            items:

>> -            - const: load_state

>>              - const: cx

>>              - const: mx

>>              - const: mss

>> @@ -381,43 +383,20 @@ allOf:

>>        properties:

>>          power-domains:

>>            items:

>> -            - description: Load State power domain

>>              - description: CX power domain

>> -        power-domain-names:

>> -          items:

>> -            - const: load_state

>> -            - const: cx

>> 

>>    - if:

>>        properties:

>>          compatible:

>>            contains:

>>              enum:

>> +              - qcom,sdx55-mpss-pas

>>                - qcom,sm8150-mpss-pas

>>                - qcom,sm8350-mpss-pas

>>      then:

>>        properties:

>>          power-domains:

>>            items:

>> -            - description: Load State power domain

>> -            - description: CX power domain

>> -            - description: MSS power domain

>> -        power-domain-names:

>> -          items:

>> -            - const: load_state

>> -            - const: cx

>> -            - const: mss

>> -

>> -  - if:

>> -      properties:

>> -        compatible:

>> -          contains:

>> -            enum:

>> -              - qcom,sdx55-mpss-pas

>> -    then:

>> -      properties:

>> -        power-domains:

>> -          items:

>>              - description: CX power domain

>>              - description: MSS power domain

>>          power-domain-names:

>> @@ -439,12 +418,10 @@ allOf:

>>        properties:

>>          power-domains:

>>            items:

>> -            - description: Load State power domain

>>              - description: LCX power domain

>>              - description: LMX power domain

>>          power-domain-names:

>>            items:

>> -            - const: load_state

>>              - const: lcx

>>              - const: lmx

>> 

>> @@ -458,12 +435,10 @@ allOf:

>>        properties:

>>          power-domains:

>>            items:

>> -            - description: Load State power domain

>>              - description: CX power domain

>>              - description: MXC power domain

>>          power-domain-names:

>>            items:

>> -            - const: load_state

>>              - const: cx

>>              - const: mxc

>> 

>> @@ -499,6 +474,29 @@ allOf:

>>              - const: mss_restart

>>              - const: pdc_reset

>> 

>> +  - if:

>> +      properties:

>> +        compatible:

>> +          contains:

>> +            enum:

>> +              - qcom,sc7180-mpss-pas

>> +              - qcom,sm8150-adsp-pas

>> +              - qcom,sm8150-cdsp-pas

>> +              - qcom,sm8150-mpss-pas

>> +              - qcom,sm8150-slpi-pas

>> +              - qcom,sm8250-adsp-pas

>> +              - qcom,sm8250-cdsp-pas

>> +              - qcom,sm8250-slpi-pas

>> +              - qcom,sm8350-adsp-pas

>> +              - qcom,sm8350-cdsp-pas

>> +              - qcom,sm8350-mpss-pas

>> +              - qcom,sm8350-slpi-pas

>> +    then:

>> +      properties:

>> +        qcom,qmp:

>> +          items:

>> +            - description: Reference to the AOSS side-channel message 

>> RAM.

>> +

>>  examples:

>>    - |

>>      #include <dt-bindings/clock/qcom,rpmcc.h>

>> --

>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 

>> Forum,

>> a Linux Foundation Collaborative Project

>> 

>> 


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.
Bjorn Andersson July 19, 2021, 7:44 p.m. UTC | #4
On Thu 24 Jun 13:51 CDT 2021, Sibi Sankar wrote:

> Add Qualcomm Mailbox Protocol (QMP) binding to replace the power domains

> exposed by the AOSS QMP node.

> 


I think this would be a good opportunity to describe why you need to
make this change to the binding.

Regards,
Bjorn

> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

> ---

> 

> v3:

>  * Misc. documentation fixes:

>   - Reduce power-domain maxItems due to load_state pd removal

>   - Combine compatibles where possible with the load_state pd removal

>   - Fixup the qcom,qmp ref to phandle type

> 

>  .../devicetree/bindings/remoteproc/qcom,adsp.yaml  | 62 +++++++++++-----------

>  1 file changed, 30 insertions(+), 32 deletions(-)

> 

> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> index 9ea05e608bc1..ad85617b43fa 100644

> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml

> @@ -75,11 +75,11 @@ properties:

>  

>    power-domains:

>      minItems: 1

> -    maxItems: 3

> +    maxItems: 2

>  

>    power-domain-names:

>      minItems: 1

> -    maxItems: 3

> +    maxItems: 2

>  

>    firmware-name:

>      $ref: /schemas/types.yaml#/definitions/string

> @@ -89,6 +89,10 @@ properties:

>      maxItems: 1

>      description: Reference to the reserved-memory for the Hexagon core

>  

> +  qcom,qmp:

> +    $ref: /schemas/types.yaml#/definitions/phandle

> +    description: Reference to the AOSS side-channel message RAM.

> +

>    qcom,smem-states:

>      $ref: /schemas/types.yaml#/definitions/phandle-array

>      description: States used by the AP to signal the Hexagon core

> @@ -359,13 +363,11 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

>              - description: MX power domain

>              - description: MSS power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: cx

>              - const: mx

>              - const: mss

> @@ -381,43 +383,20 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

> -        power-domain-names:

> -          items:

> -            - const: load_state

> -            - const: cx

>  

>    - if:

>        properties:

>          compatible:

>            contains:

>              enum:

> +              - qcom,sdx55-mpss-pas

>                - qcom,sm8150-mpss-pas

>                - qcom,sm8350-mpss-pas

>      then:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

> -            - description: CX power domain

> -            - description: MSS power domain

> -        power-domain-names:

> -          items:

> -            - const: load_state

> -            - const: cx

> -            - const: mss

> -

> -  - if:

> -      properties:

> -        compatible:

> -          contains:

> -            enum:

> -              - qcom,sdx55-mpss-pas

> -    then:

> -      properties:

> -        power-domains:

> -          items:

>              - description: CX power domain

>              - description: MSS power domain

>          power-domain-names:

> @@ -439,12 +418,10 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: LCX power domain

>              - description: LMX power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: lcx

>              - const: lmx

>  

> @@ -458,12 +435,10 @@ allOf:

>        properties:

>          power-domains:

>            items:

> -            - description: Load State power domain

>              - description: CX power domain

>              - description: MXC power domain

>          power-domain-names:

>            items:

> -            - const: load_state

>              - const: cx

>              - const: mxc

>  

> @@ -499,6 +474,29 @@ allOf:

>              - const: mss_restart

>              - const: pdc_reset

>  

> +  - if:

> +      properties:

> +        compatible:

> +          contains:

> +            enum:

> +              - qcom,sc7180-mpss-pas

> +              - qcom,sm8150-adsp-pas

> +              - qcom,sm8150-cdsp-pas

> +              - qcom,sm8150-mpss-pas

> +              - qcom,sm8150-slpi-pas

> +              - qcom,sm8250-adsp-pas

> +              - qcom,sm8250-cdsp-pas

> +              - qcom,sm8250-slpi-pas

> +              - qcom,sm8350-adsp-pas

> +              - qcom,sm8350-cdsp-pas

> +              - qcom,sm8350-mpss-pas

> +              - qcom,sm8350-slpi-pas

> +    then:

> +      properties:

> +        qcom,qmp:

> +          items:

> +            - description: Reference to the AOSS side-channel message RAM.

> +

>  examples:

>    - |

>      #include <dt-bindings/clock/qcom,rpmcc.h>

> -- 

> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,

> a Linux Foundation Collaborative Project

>