Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC
@ 2026-06-15 16:57 Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 1/6] dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property Neil Armstrong
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong, Abel Vesa, Konrad Dybcio

Recently, on Eliza & Milos, the CX has been tied up to the GCC,
but this is valid for most platforms including sm8[456]50.
So tie the CX power domain to the GCC as well, for the
same exact reasons as on Eliza & Milos.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Add missing power domains in example
- Pick review tags
- Link to v1: https://patch.msgid.link/20260424-topic-sm8x50-tie-gcc-to-cx-v1-0-4b6e09d532ce@linaro.org

---
Neil Armstrong (6):
      dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property
      dt-bindings: clock: qcom: sm8550-gcc: Add missing power-domains property
      dt-bindings: clock: qcom: sm8650-gcc: Add missing power-domains property
      arm64: dts: qcom: sm8450: Add missing CX power domain to GCC
      arm64: dts: qcom: sm8550: Add missing CX power domain to GCC
      arm64: dts: qcom: sm8650: Add missing CX power domain to GCC

 Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml | 6 ++++++
 Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml | 6 ++++++
 Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml | 6 ++++++
 arch/arm64/boot/dts/qcom/sm8450.dtsi                         | 1 +
 arch/arm64/boot/dts/qcom/sm8550.dtsi                         | 1 +
 arch/arm64/boot/dts/qcom/sm8650.dtsi                         | 2 ++
 6 files changed, 22 insertions(+)
---
base-commit: 8d6dbbbe3ba62de0a63e962ee004afb848c8e3ac
change-id: 20260424-topic-sm8x50-tie-gcc-to-cx-e756afa72bb8

Best regards,
--  
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/6] dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: " Neil Armstrong
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong

In order for the GCC votes on the GDSCs it provides to be propagated
to CX, CX needs to be declared as power domain of the GCC.

Document the missing power-domains property to that purpose.

Fixes: 72a0ca203ca7 ("dt-bindings: clock: Add SM8450 GCC clock bindings")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml
index 3169ac05e1d8..7e3713cfd498 100644
--- a/Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc-sm8450.yaml
@@ -47,10 +47,15 @@ properties:
       - const: usb3_phy_wrapper_gcc_usb30_pipe_clk # Optional clock
     minItems: 2
 
+  power-domains:
+    items:
+      - description: CX domain
+
 required:
   - compatible
   - clocks
   - clock-names
+  - power-domains
   - '#power-domain-cells'
 
 allOf:
@@ -66,6 +71,7 @@ examples:
       reg = <0x00100000 0x001f4200>;
       clocks = <&rpmhcc RPMH_CXO_CLK>, <&sleep_clk>;
       clock-names = "bi_tcxo", "sleep_clk";
+      power-domains = <&rpmhpd RPMHPD_CX>;
       #clock-cells = <1>;
       #reset-cells = <1>;
       #power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: Add missing power-domains property
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 1/6] dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  2026-06-15 17:03   ` sashiko-bot
  2026-06-15 16:57 ` [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: " Neil Armstrong
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong

In order for the GCC votes on the GDSCs it provides to be propagated
to CX, CX needs to be declared as power domain of the GCC.

Document the missing power-domains property to that purpose.

Fixes: 47ba9c50bbeb ("dt-bindings: clock: Add SM8550 GCC clocks")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
index c4e9b9bb63f5..19f06d27c7c1 100644
--- a/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
@@ -31,9 +31,14 @@ properties:
       - description: UFS Phy Tx symbol 0 clock source
       - description: USB3 Phy wrapper pipe clock source
 
+  power-domains:
+    items:
+      - description: CX domain
+
 required:
   - compatible
   - clocks
+  - power-domains
   - '#power-domain-cells'
 
 allOf:
@@ -55,6 +60,7 @@ examples:
                <&ufs_mem_phy 1>,
                <&ufs_mem_phy 2>,
                <&usb_1_qmpphy>;
+      power-domains = <&rpmhpd RPMHPD_CX>;
       #clock-cells = <1>;
       #reset-cells = <1>;
       #power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: Add missing power-domains property
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 1/6] dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: " Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  2026-06-15 17:05   ` sashiko-bot
  2026-06-15 16:57 ` [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC Neil Armstrong
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong

In order for the GCC votes on the GDSCs it provides to be propagated
to CX, CX needs to be declared as power domain of the GCC.

Document the missing power-domains property to that purpose.

Fixes: b69d932154dc ("dt-bindings: clock: qcom: document the SM8650 General Clock Controller")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
index c7143e2abc80..9c1504827cbf 100644
--- a/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
@@ -32,9 +32,14 @@ properties:
       - description: UFS Phy Tx symbol 0 clock source
       - description: USB3 Phy wrapper pipe clock source
 
+  power-domains:
+    items:
+      - description: CX domain
+
 required:
   - compatible
   - clocks
+  - power-domains
   - '#power-domain-cells'
 
 allOf:
@@ -58,6 +63,7 @@ examples:
                <&ufs_mem_phy 1>,
                <&ufs_mem_phy 2>,
                <&usb_1_qmpphy>;
+      power-domains = <&rpmhpd RPMHPD_CX>;
       #clock-cells = <1>;
       #reset-cells = <1>;
       #power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
                   ` (2 preceding siblings ...)
  2026-06-15 16:57 ` [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: " Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  2026-06-15 17:10   ` sashiko-bot
  2026-06-15 16:57 ` [PATCH v2 5/6] arm64: dts: qcom: sm8550: " Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 6/6] arm64: dts: qcom: sm8650: " Neil Armstrong
  5 siblings, 1 reply; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong, Abel Vesa, Konrad Dybcio

Unless CX is declared as the power-domain of GCC, votes (power and
performance) on the GDSCs it provides will not propagate to the CX,
which might result in under-voltage conditions.

Add the missing power-domains property to associate GCC with RPMHPD_CX.

Fixes: 5188049c9b36 ("arm64: dts: qcom: Add base SM8450 DTSI")
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index 56cb6e959e4e..2639790307d8 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -935,6 +935,7 @@ soc: soc@0 {
 		gcc: clock-controller@100000 {
 			compatible = "qcom,gcc-sm8450";
 			reg = <0x0 0x00100000 0x0 0x1f4200>;
+			power-domains = <&rpmhpd RPMHPD_CX>;
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 5/6] arm64: dts: qcom: sm8550: Add missing CX power domain to GCC
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
                   ` (3 preceding siblings ...)
  2026-06-15 16:57 ` [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  2026-06-15 16:57 ` [PATCH v2 6/6] arm64: dts: qcom: sm8650: " Neil Armstrong
  5 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong, Konrad Dybcio, Abel Vesa

Unless CX is declared as the power-domain of GCC, votes (power and
performance) on the GDSCs it provides will not propagate to the CX,
which might result in under-voltage conditions.

Add the missing power-domains property to associate GCC with RPMHPD_CX.

Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 396201905ef2..2cadcaae9e01 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -1183,6 +1183,7 @@ soc: soc@0 {
 		gcc: clock-controller@100000 {
 			compatible = "qcom,sm8550-gcc";
 			reg = <0 0x00100000 0 0x1f4200>;
+			power-domains = <&rpmhpd RPMHPD_CX>;
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 6/6] arm64: dts: qcom: sm8650: Add missing CX power domain to GCC
  2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
                   ` (4 preceding siblings ...)
  2026-06-15 16:57 ` [PATCH v2 5/6] arm64: dts: qcom: sm8550: " Neil Armstrong
@ 2026-06-15 16:57 ` Neil Armstrong
  5 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-06-15 16:57 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Vinod Koul, Abel Vesa,
	Konrad Dybcio, Sai Prakash Ranjan, Brian Masney
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel,
	Krzysztof Kozlowski, Neil Armstrong, Konrad Dybcio, Abel Vesa

Unless CX is declared as the power-domain of GCC, votes (power and
performance) on the GDSCs it provides will not propagate to the CX,
which might result in under-voltage conditions.

Add the missing power-domains property to associate GCC with RPMHPD_CX.

Fixes: d2350377997f ("arm64: dts: qcom: add initial SM8650 dtsi")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8650.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi
index 160ead25ecf7..8365e97436d6 100644
--- a/arch/arm64/boot/dts/qcom/sm8650.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi
@@ -1963,6 +1963,8 @@ gcc: clock-controller@100000 {
 				 <&ufs_mem_phy 2>,
 				 <&usb_dp_qmpphy QMP_USB43DP_USB3_PIPE_CLK>;
 
+			power-domains = <&rpmhpd RPMHPD_CX>;
+
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: Add missing power-domains property
  2026-06-15 16:57 ` [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: " Neil Armstrong
@ 2026-06-15 17:03   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-06-15 17:03 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: conor+dt, devicetree, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The devicetree binding example fails to compile because it uses the macro `RPMHPD_CX` without including its defining header.
--

commit 8ab50c22b4edbee1a4ec4ab581c1e5e14181a614
Author: Neil Armstrong <neil.armstrong@linaro.org>

dt-bindings: clock: qcom: sm8550-gcc: Add missing power-domains property

This commit adds the missing power-domains property to the SM8550 GCC clocks
binding so that GCC votes on provided GDSCs can be propagated to the CX domain.

> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
> --- a/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8550-gcc.yaml
[ ... ]
> @@ -55,6 +60,7 @@ examples:
>                 <&ufs_mem_phy 1>,
>                 <&ufs_mem_phy 2>,
>                 <&usb_1_qmpphy>;
> +      power-domains = <&rpmhpd RPMHPD_CX>;

[Severity: Low]
Does this example fail dt_binding_check because the RPMHPD_CX macro is used
without including <dt-bindings/power/qcom,rpmhpd.h>?

Without the header inclusion, the C preprocessor will not expand the macro,
which usually results in dtc throwing a syntax error when parsing the raw
string during schema validation.

>        #clock-cells = <1>;
>        #reset-cells = <1>;
>        #power-domain-cells = <1>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260615-topic-sm8x50-tie-gcc-to-cx-v2-0-6b5752dd4747@linaro.org?part=2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: Add missing power-domains property
  2026-06-15 16:57 ` [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: " Neil Armstrong
@ 2026-06-15 17:05   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-06-15 17:05 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: robh, devicetree, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing `#include <dt-bindings/power/qcom,rpmhpd.h>` in the device tree binding example causes `dt_binding_check` to fail with a syntax error.
--

commit cf54041a81ff607a5e2770b322af6489287fb22f
Author: Neil Armstrong <neil.armstrong@linaro.org>

dt-bindings: clock: qcom: sm8650-gcc: Add missing power-domains property

This commit declares CX as a power domain of the GCC to allow votes
on the GDSCs to be propagated. It adds the power-domains property to
the binding and updates the example accordingly.

> diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
> index c7143e2abc80c..9c1504827cbff 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,sm8650-gcc.yaml

[ ... ]

> @@ -58,6 +63,7 @@ examples:
>                 <&ufs_mem_phy 1>,
>                 <&ufs_mem_phy 2>,
>                 <&usb_1_qmpphy>;
> +      power-domains = <&rpmhpd RPMHPD_CX>;

[Severity: Low]
Does this example need to include <dt-bindings/power/qcom,rpmhpd.h> for the
RPMHPD_CX macro to be resolved?

Without the header include in the YAML file, the macro remains unexpanded
during preprocessing. This can cause dtc to fail with a syntax error during
make dt_binding_check because it expects an integer cell value inside the
property array.

>        #clock-cells = <1>;
>        #reset-cells = <1>;
>        #power-domain-cells = <1>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260615-topic-sm8x50-tie-gcc-to-cx-v2-0-6b5752dd4747@linaro.org?part=3

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC
  2026-06-15 16:57 ` [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC Neil Armstrong
@ 2026-06-15 17:10   ` sashiko-bot
  0 siblings, 0 replies; 10+ messages in thread
From: sashiko-bot @ 2026-06-15 17:10 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: conor+dt, robh, devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing `pm_genpd_remove()` and error path cleanup in `gdsc_register()` leads to use-after-free in `gpd_list` upon unbind or probe failure.
--

commit e4315c043469a13f84ee75ac94f4e0790692142c
Author: Neil Armstrong <neil.armstrong@linaro.org>

arm64: dts: qcom: sm8450: Add missing CX power domain to GCC

This commit associates the GCC with RPMHPD_CX by adding a power-domains
property to the device tree, preventing under-voltage conditions by allowing
votes to propagate.

> diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
> --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
> @@ -935,6 +935,7 @@ soc: soc@0 {
>  		gcc: clock-controller@100000 {
>  			compatible = "qcom,gcc-sm8450";
>  			reg = <0x0 0x00100000 0x0 0x1f4200>;
> +			power-domains = <&rpmhpd RPMHPD_CX>;

[Severity: High]
This is a pre-existing issue, but since this patch configures the power
domains for this device, it brings up a concern in the underlying Qualcomm
GDSC driver framework.

If probe fails or the module is unloaded, does the error handling in
gdsc_register() leave dangling pointers in the core gpd_list?

Looking at drivers/clk/qcom/gdsc.c:gdsc_register(), if a subsequent
gdsc_init() fails, it returns directly:

drivers/clk/qcom/gdsc.c:gdsc_register() {
    for (i = 0; i < num; i++) {
        if (!scs[i])
            continue;
        ...
        ret = gdsc_init(scs[i]);
        if (ret)
            return ret;
    }
}

This seems to leak the previously initialized power domains in the global
gpd_list because it misses calling pm_genpd_remove() for scs[0..i-1].

Similarly, if of_genpd_add_provider_onecell() fails at the end of the
function, it also returns immediately or bypasses domain removal:

drivers/clk/qcom/gdsc.c:gdsc_register() {
    ...
    return of_genpd_add_provider_onecell(dev->of_node, data);

err_pm_subdomain_remove:
    gdsc_pm_subdomain_remove(desc, i);

    return ret;
}

Furthermore, gdsc_unregister() removes subdomains and deletes the provider,
but entirely misses pm_genpd_remove() before the backing memory is freed
on module unload:

drivers/clk/qcom/gdsc.c:gdsc_unregister() {
    ...
    gdsc_pm_subdomain_remove(desc, num);
    of_genpd_del_provider(dev->of_node);
}

Could this result in a use-after-free kernel panic if gpd_list is iterated
(for example, by genpd_power_off_unused() or debugfs) after an unbind or
probe failure?

>  			#clock-cells = <1>;
>  			#reset-cells = <1>;
>  			#power-domain-cells = <1>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260615-topic-sm8x50-tie-gcc-to-cx-v2-0-6b5752dd4747@linaro.org?part=4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-06-15 17:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 16:57 [PATCH v2 0/6] arm64: dts: qcom: sm8[456]50: Add missing CX power domain to GCC Neil Armstrong
2026-06-15 16:57 ` [PATCH v2 1/6] dt-bindings: clock: qcom: gcc-sm8450: Add missing power-domains property Neil Armstrong
2026-06-15 16:57 ` [PATCH v2 2/6] dt-bindings: clock: qcom: sm8550-gcc: " Neil Armstrong
2026-06-15 17:03   ` sashiko-bot
2026-06-15 16:57 ` [PATCH v2 3/6] dt-bindings: clock: qcom: sm8650-gcc: " Neil Armstrong
2026-06-15 17:05   ` sashiko-bot
2026-06-15 16:57 ` [PATCH v2 4/6] arm64: dts: qcom: sm8450: Add missing CX power domain to GCC Neil Armstrong
2026-06-15 17:10   ` sashiko-bot
2026-06-15 16:57 ` [PATCH v2 5/6] arm64: dts: qcom: sm8550: " Neil Armstrong
2026-06-15 16:57 ` [PATCH v2 6/6] arm64: dts: qcom: sm8650: " Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox