linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Enable IPQ9574 TSENS support
@ 2023-04-28 14:52 Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-04-28 14:52 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan

This patch set enables tsens in IPQ9574

Depends on
	https://lore.kernel.org/linux-arm-msm/20230406061314.10916-1-quic_devipriy@quicinc.com/

Praveenkumar I (2):
  dt-bindings: thermal: tsens: Add ipq9574 compatible
  thermal/drivers/tsens: Add IPQ9574 support

Varadarajan Narayanan (2):
  arm64: dts: qcom: ipq9574: add tsens node
  arm64: dts: qcom: ipq9574: add thermal zone nodes

 .../devicetree/bindings/thermal/qcom-tsens.yaml    |   3 +
 arch/arm64/boot/dts/qcom/ipq9574.dtsi              | 217 +++++++++++++++++++++
 drivers/thermal/qcom/tsens.c                       |   3 +
 3 files changed, 223 insertions(+)

-- 
2.7.4


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

* [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-04-28 14:52 [PATCH 0/4] Enable IPQ9574 TSENS support Varadarajan Narayanan
@ 2023-04-28 14:52 ` Varadarajan Narayanan
  2023-05-01  7:08   ` Krzysztof Kozlowski
  2023-04-28 14:52 ` [PATCH 2/4] thermal/drivers/tsens: Add IPQ9574 support Varadarajan Narayanan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-04-28 14:52 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Praveenkumar I, Varadarajan Narayanan

From: Praveenkumar I <quic_ipkumar@quicinc.com>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
index d1ec963..8e2208c 100644
--- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
+++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens
 
   reg:
     items:
@@ -277,6 +278,7 @@ allOf:
           contains:
             enum:
               - qcom,ipq8074-tsens
+              - qcom,ipq9574-tsens
     then:
       properties:
         interrupts:
@@ -292,6 +294,7 @@ allOf:
           contains:
             enum:
               - qcom,ipq8074-tsens
+              - qcom,ipq9574-tsens
               - qcom,tsens-v0_1
               - qcom,tsens-v1
               - qcom,tsens-v2
-- 
2.7.4


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

* [PATCH 2/4] thermal/drivers/tsens: Add IPQ9574 support
  2023-04-28 14:52 [PATCH 0/4] Enable IPQ9574 TSENS support Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
@ 2023-04-28 14:52 ` Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 3/4] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
  3 siblings, 0 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-04-28 14:52 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Praveenkumar I, Varadarajan Narayanan

From: Praveenkumar I <quic_ipkumar@quicinc.com>

Qualcomm IPQ9574 uses tsens v2.3.1 IP, which is similar to IPQ8074 tsens.
Hence reusing the data_ipq8074 for IPQ9574.

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
 drivers/thermal/qcom/tsens.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index d321812..e752b7d 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -1093,6 +1093,9 @@ static const struct of_device_id tsens_table[] = {
 		.compatible = "qcom,ipq8074-tsens",
 		.data = &data_ipq8074,
 	}, {
+		.compatible = "qcom,ipq9574-tsens",
+		.data = &data_ipq8074,
+	}, {
 		.compatible = "qcom,mdm9607-tsens",
 		.data = &data_9607,
 	}, {
-- 
2.7.4


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

* [PATCH 3/4] arm64: dts: qcom: ipq9574: add tsens node
  2023-04-28 14:52 [PATCH 0/4] Enable IPQ9574 TSENS support Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 2/4] thermal/drivers/tsens: Add IPQ9574 support Varadarajan Narayanan
@ 2023-04-28 14:52 ` Varadarajan Narayanan
  2023-04-28 14:52 ` [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
  3 siblings, 0 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-04-28 14:52 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan, Praveenkumar I

IPQ9574 has a tsens v2.3.1 peripheral which monitors temperatures
around the various subsystems on the die.

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 93b4ba9..7cd5bdb 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -936,6 +936,15 @@
 			status = "disabled";
 		};
 
+		tsens: thermal-sensor@4a9000 {
+			compatible = "qcom,ipq9574-tsens";
+			reg = <0x4a9000 0x1000>, /* TM */
+			      <0x4a8000 0x1000>; /* SROT */
+			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "combined";
+			#qcom,sensors = <16>;
+			#thermal-sensor-cells = <1>;
+		};
 	};
 
 	timer {
-- 
2.7.4


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

* [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-04-28 14:52 [PATCH 0/4] Enable IPQ9574 TSENS support Varadarajan Narayanan
                   ` (2 preceding siblings ...)
  2023-04-28 14:52 ` [PATCH 3/4] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
@ 2023-04-28 14:52 ` Varadarajan Narayanan
  2023-04-28 19:49   ` Dmitry Baryshkov
  2023-05-01  7:14   ` Krzysztof Kozlowski
  3 siblings, 2 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-04-28 14:52 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan, Praveenkumar I

This patch adds thermal zone nodes for the various
sensors present in IPQ9574

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 7cd5bdb..a7cb2b4c 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -947,6 +947,214 @@
 		};
 	};
 
+	thermal_zones: thermal-zones {
+		tsens_tz_sensor3 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 3>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor4 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 4>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor5 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 5>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor6 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 6>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor7 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 7>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor8 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 8>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor9 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 9>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor10 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 10>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor11 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 11>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor12 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 12>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor13 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 13>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor14 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 14>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor15 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 15>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-- 
2.7.4


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

* Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-04-28 14:52 ` [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
@ 2023-04-28 19:49   ` Dmitry Baryshkov
  2023-05-02  8:04     ` Varadarajan Narayanan
  2023-05-01  7:14   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 16+ messages in thread
From: Dmitry Baryshkov @ 2023-04-28 19:49 UTC (permalink / raw)
  To: Varadarajan Narayanan
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Fri, 28 Apr 2023 at 17:53, Varadarajan Narayanan
<quic_varada@quicinc.com> wrote:
>
> This patch adds thermal zone nodes for the various
> sensors present in IPQ9574
>
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
>  1 file changed, 208 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> index 7cd5bdb..a7cb2b4c 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> @@ -947,6 +947,214 @@
>                 };
>         };
>
> +       thermal_zones: thermal-zones {
> +               tsens_tz_sensor3 {

Please provide sensible names for all thermal zones. Please follow the
examples in other DT files.

> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 3>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;

Can it really go up to 125 °C?

> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };

Please provide also a passive trip point, so that the passive cooling
can be engaged.

> +                       };
> +               };
> +
> +               tsens_tz_sensor4 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 4>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor5 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 5>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor6 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 6>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor7 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 7>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor8 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 8>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor9 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 9>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor10 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 10>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <120000>;
> +                                       hysteresis = <10000>;
> +                                       type = "critical";
> +                               };
> +
> +                               cpu-passive {
> +                                       temperature = <110000>;
> +                                       hysteresis = <1000>;
> +                                       type = "passive";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor11 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 11>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <120000>;
> +                                       hysteresis = <10000>;
> +                                       type = "critical";
> +                               };
> +
> +                               cpu-passive {
> +                                       temperature = <110000>;
> +                                       hysteresis = <1000>;
> +                                       type = "passive";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor12 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 12>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <120000>;
> +                                       hysteresis = <10000>;
> +                                       type = "critical";
> +                               };
> +
> +                               cpu-passive {
> +                                       temperature = <110000>;
> +                                       hysteresis = <1000>;
> +                                       type = "passive";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor13 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 13>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <120000>;
> +                                       hysteresis = <10000>;
> +                                       type = "critical";
> +                               };
> +
> +                               cpu-passive {
> +                                       temperature = <110000>;
> +                                       hysteresis = <1000>;
> +                                       type = "passive";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor14 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 14>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +
> +               tsens_tz_sensor15 {
> +                       polling-delay-passive = <0>;
> +                       polling-delay = <0>;
> +                       thermal-sensors = <&tsens 15>;
> +
> +                       trips {
> +                               cpu-critical {
> +                                       temperature = <125000>;
> +                                       hysteresis = <1000>;
> +                                       type = "critical";
> +                               };
> +                       };
> +               };
> +       };
> +
>         timer {
>                 compatible = "arm,armv8-timer";
>                 interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> --
> 2.7.4
>


-- 
With best wishes
Dmitry

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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-04-28 14:52 ` [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
@ 2023-05-01  7:08   ` Krzysztof Kozlowski
  2023-05-03  7:10     ` Varadarajan Narayanan
  0 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-01  7:08 UTC (permalink / raw)
  To: Varadarajan Narayanan, agross, andersson, konrad.dybcio, amitk,
	thara.gopinath, rafael, daniel.lezcano, rui.zhang, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-pm, devicetree,
	linux-kernel
  Cc: Praveenkumar I

On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> From: Praveenkumar I <quic_ipkumar@quicinc.com>
> 
> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
> 
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
>  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> index d1ec963..8e2208c 100644
> --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> @@ -66,6 +66,7 @@ properties:
>        - description: v2 of TSENS with combined interrupt
>          enum:
>            - qcom,ipq8074-tsens
> +          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them
compatible. 9574 followed by 8074.

Best regards,
Krzysztof


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

* Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-04-28 14:52 ` [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
  2023-04-28 19:49   ` Dmitry Baryshkov
@ 2023-05-01  7:14   ` Krzysztof Kozlowski
  2023-05-02  8:06     ` Varadarajan Narayanan
  1 sibling, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-01  7:14 UTC (permalink / raw)
  To: Varadarajan Narayanan, agross, andersson, konrad.dybcio, amitk,
	thara.gopinath, rafael, daniel.lezcano, rui.zhang, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-pm, devicetree,
	linux-kernel
  Cc: Praveenkumar I

On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> This patch adds thermal zone nodes for the various
> sensors present in IPQ9574
> 
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
>  1 file changed, 208 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> index 7cd5bdb..a7cb2b4c 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> @@ -947,6 +947,214 @@
>  		};
>  	};
>  
> +	thermal_zones: thermal-zones {
> +		tsens_tz_sensor3 {

No underscores in node names.

Don't invent your own names, use the ones we already have everywhere.


Best regards,
Krzysztof


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

* Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-04-28 19:49   ` Dmitry Baryshkov
@ 2023-05-02  8:04     ` Varadarajan Narayanan
  2023-05-02  8:39       ` Dmitry Baryshkov
  0 siblings, 1 reply; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-05-02  8:04 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Fri, Apr 28, 2023 at 10:49:34PM +0300, Dmitry Baryshkov wrote:
> On Fri, 28 Apr 2023 at 17:53, Varadarajan Narayanan
> <quic_varada@quicinc.com> wrote:
> >
> > This patch adds thermal zone nodes for the various
> > sensors present in IPQ9574
> >
> > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > ---
> >  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 208 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > index 7cd5bdb..a7cb2b4c 100644
> > --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > @@ -947,6 +947,214 @@
> >                 };
> >         };
> >
> > +       thermal_zones: thermal-zones {
> > +               tsens_tz_sensor3 {
>
> Please provide sensible names for all thermal zones. Please follow the
> examples in other DT files.

Ok.

> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 3>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
>
> Can it really go up to 125 °C?

The SoC product requirement is 120°C. It is capable of 125°C.
This was tested inside a thermal chamber and ensured that it
hits 125°C and system reboots at that temperature.

> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
>
> Please provide also a passive trip point, so that the passive cooling
> can be engaged.

The linux kernel cannot take any steps to initiate cooling for
components other than the 4 CPU cores. The f/w that runs on these
IP blocks have to take steps to initiate cooling. Additionally,
the passive temperature for the non-cpu sensors are not
characterised yet and I don't have the values now.

We have these nodes to be able to read the temperature of the
other blocks via the sysfs entry /sys/devices/virtual/thermal/*/temp
Have given the critical trip point so that the setup is rebooted
if the critical temperature is reached.

Have given passive trip point for the CPU core related thermal
nodes (tsens_tz_sensor10, tsens_tz_sensor11, tsens_tz_sensor12
and tsens_tz_sensor13).

If this is not acceptable, please let me know. Will remove the
non-cpu nodes and post a patch with just the CPU entries.

Thanks
Varada

> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor4 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 4>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor5 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 5>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor6 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 6>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor7 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 7>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor8 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 8>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor9 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 9>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor10 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 10>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <120000>;
> > +                                       hysteresis = <10000>;
> > +                                       type = "critical";
> > +                               };
> > +
> > +                               cpu-passive {
> > +                                       temperature = <110000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "passive";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor11 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 11>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <120000>;
> > +                                       hysteresis = <10000>;
> > +                                       type = "critical";
> > +                               };
> > +
> > +                               cpu-passive {
> > +                                       temperature = <110000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "passive";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor12 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 12>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <120000>;
> > +                                       hysteresis = <10000>;
> > +                                       type = "critical";
> > +                               };
> > +
> > +                               cpu-passive {
> > +                                       temperature = <110000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "passive";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor13 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 13>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <120000>;
> > +                                       hysteresis = <10000>;
> > +                                       type = "critical";
> > +                               };
> > +
> > +                               cpu-passive {
> > +                                       temperature = <110000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "passive";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor14 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 14>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +
> > +               tsens_tz_sensor15 {
> > +                       polling-delay-passive = <0>;
> > +                       polling-delay = <0>;
> > +                       thermal-sensors = <&tsens 15>;
> > +
> > +                       trips {
> > +                               cpu-critical {
> > +                                       temperature = <125000>;
> > +                                       hysteresis = <1000>;
> > +                                       type = "critical";
> > +                               };
> > +                       };
> > +               };
> > +       };
> > +
> >         timer {
> >                 compatible = "arm,armv8-timer";
> >                 interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> > --
> > 2.7.4
> >
>
>
> --
> With best wishes
> Dmitry

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

* Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-05-01  7:14   ` Krzysztof Kozlowski
@ 2023-05-02  8:06     ` Varadarajan Narayanan
  0 siblings, 0 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-05-02  8:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Mon, May 01, 2023 at 09:14:32AM +0200, Krzysztof Kozlowski wrote:
> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> > This patch adds thermal zone nodes for the various
> > sensors present in IPQ9574
> >
> > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > ---
> >  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 208 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > index 7cd5bdb..a7cb2b4c 100644
> > --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > @@ -947,6 +947,214 @@
> >  		};
> >  	};
> >
> > +	thermal_zones: thermal-zones {
> > +		tsens_tz_sensor3 {
>
> No underscores in node names.
>
> Don't invent your own names, use the ones we already have everywhere.

Thanks for the feedback. Will change and post and new version.

-Varada

>
> Best regards,
> Krzysztof
>

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

* Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-05-02  8:04     ` Varadarajan Narayanan
@ 2023-05-02  8:39       ` Dmitry Baryshkov
  0 siblings, 0 replies; 16+ messages in thread
From: Dmitry Baryshkov @ 2023-05-02  8:39 UTC (permalink / raw)
  To: Varadarajan Narayanan
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Tue, 2 May 2023 at 11:04, Varadarajan Narayanan
<quic_varada@quicinc.com> wrote:
>
> On Fri, Apr 28, 2023 at 10:49:34PM +0300, Dmitry Baryshkov wrote:
> > On Fri, 28 Apr 2023 at 17:53, Varadarajan Narayanan
> > <quic_varada@quicinc.com> wrote:
> > >
> > > This patch adds thermal zone nodes for the various
> > > sensors present in IPQ9574
> > >
> > > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> > > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > > ---
> > >  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
> > >  1 file changed, 208 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > > index 7cd5bdb..a7cb2b4c 100644
> > > --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> > > @@ -947,6 +947,214 @@
> > >                 };
> > >         };
> > >
> > > +       thermal_zones: thermal-zones {
> > > +               tsens_tz_sensor3 {
> >
> > Please provide sensible names for all thermal zones. Please follow the
> > examples in other DT files.
>
> Ok.
>
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 3>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> >
> > Can it really go up to 125 °C?
>
> The SoC product requirement is 120°C. It is capable of 125°C.
> This was tested inside a thermal chamber and ensured that it
> hits 125°C and system reboots at that temperature.

ack

>
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> >
> > Please provide also a passive trip point, so that the passive cooling
> > can be engaged.
>
> The linux kernel cannot take any steps to initiate cooling for
> components other than the 4 CPU cores. The f/w that runs on these
> IP blocks have to take steps to initiate cooling. Additionally,
> the passive temperature for the non-cpu sensors are not
> characterised yet and I don't have the values now.
>
> We have these nodes to be able to read the temperature of the
> other blocks via the sysfs entry /sys/devices/virtual/thermal/*/temp
> Have given the critical trip point so that the setup is rebooted
> if the critical temperature is reached.
>
> Have given passive trip point for the CPU core related thermal
> nodes (tsens_tz_sensor10, tsens_tz_sensor11, tsens_tz_sensor12
> and tsens_tz_sensor13).

That's the point why we asked for the logical names for the sensors,
like we have on the other platforms. Otherwise it is very hard to
understand what is going on.

>
> If this is not acceptable, please let me know. Will remove the
> non-cpu nodes and post a patch with just the CPU entries.

This is perfectly fine. Please take a look at other DTSI files.

>
> Thanks
> Varada
>
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor4 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 4>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor5 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 5>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor6 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 6>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor7 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 7>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor8 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 8>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor9 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 9>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor10 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 10>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <120000>;
> > > +                                       hysteresis = <10000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +
> > > +                               cpu-passive {
> > > +                                       temperature = <110000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "passive";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor11 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 11>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <120000>;
> > > +                                       hysteresis = <10000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +
> > > +                               cpu-passive {
> > > +                                       temperature = <110000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "passive";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor12 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 12>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <120000>;
> > > +                                       hysteresis = <10000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +
> > > +                               cpu-passive {
> > > +                                       temperature = <110000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "passive";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor13 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 13>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <120000>;
> > > +                                       hysteresis = <10000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +
> > > +                               cpu-passive {
> > > +                                       temperature = <110000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "passive";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor14 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 14>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +
> > > +               tsens_tz_sensor15 {
> > > +                       polling-delay-passive = <0>;
> > > +                       polling-delay = <0>;
> > > +                       thermal-sensors = <&tsens 15>;
> > > +
> > > +                       trips {
> > > +                               cpu-critical {
> > > +                                       temperature = <125000>;
> > > +                                       hysteresis = <1000>;
> > > +                                       type = "critical";
> > > +                               };
> > > +                       };
> > > +               };
> > > +       };
> > > +
> > >         timer {
> > >                 compatible = "arm,armv8-timer";
> > >                 interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
> > > --
> > > 2.7.4
> > >
> >
> >
> > --
> > With best wishes
> > Dmitry



-- 
With best wishes
Dmitry

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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-05-01  7:08   ` Krzysztof Kozlowski
@ 2023-05-03  7:10     ` Varadarajan Narayanan
  2023-05-03  7:42       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-05-03  7:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Mon, May 01, 2023 at 09:08:49AM +0200, Krzysztof Kozlowski wrote:
> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> > From: Praveenkumar I <quic_ipkumar@quicinc.com>
> >
> > Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
> >
> > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> > Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> > ---
> >  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> > index d1ec963..8e2208c 100644
> > --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> > +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> > @@ -66,6 +66,7 @@ properties:
> >        - description: v2 of TSENS with combined interrupt
> >          enum:
> >            - qcom,ipq8074-tsens
> > +          - qcom,ipq9574-tsens
>
> Your drive change indicates they are compatible, so make them
> compatible. 9574 followed by 8074.

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens"
instead of adding a "qcom,ipq9574-tsens" and no need to add an extra
entry to the driver like

	}, {
		.compatible = "qcom,ipq9574-tsens",
		.data = &data_ipq8074,
	}, {

Thanks
Varada


> Best regards,
> Krzysztof
>

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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-05-03  7:10     ` Varadarajan Narayanan
@ 2023-05-03  7:42       ` Krzysztof Kozlowski
  2023-05-04  4:57         ` Varadarajan Narayanan
  0 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-03  7:42 UTC (permalink / raw)
  To: Varadarajan Narayanan
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On 03/05/2023 09:10, Varadarajan Narayanan wrote:
> On Mon, May 01, 2023 at 09:08:49AM +0200, Krzysztof Kozlowski wrote:
>> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
>>> From: Praveenkumar I <quic_ipkumar@quicinc.com>
>>>
>>> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
>>>
>>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
>>> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
>>> ---
>>>  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>> index d1ec963..8e2208c 100644
>>> --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>> +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>> @@ -66,6 +66,7 @@ properties:
>>>        - description: v2 of TSENS with combined interrupt
>>>          enum:
>>>            - qcom,ipq8074-tsens
>>> +          - qcom,ipq9574-tsens
>>
>> Your drive change indicates they are compatible, so make them
>> compatible. 9574 followed by 8074.
> 
> Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens"
> instead of adding a "qcom,ipq9574-tsens" and no need to add an extra
> entry to the driver like

Assuming the devices are really compatible, which your driver change
suggests, I want to use two compatibles. 9574 followed by 8074 fallback,
just like we do for all Qualcomm IP blocks. Then as you said - no need
for driver change.

Best regards,
Krzysztof


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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-05-03  7:42       ` Krzysztof Kozlowski
@ 2023-05-04  4:57         ` Varadarajan Narayanan
  2023-05-04  6:22           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-05-04  4:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Wed, May 03, 2023 at 09:42:28AM +0200, Krzysztof Kozlowski wrote:
> On 03/05/2023 09:10, Varadarajan Narayanan wrote:
> > On Mon, May 01, 2023 at 09:08:49AM +0200, Krzysztof Kozlowski wrote:
> >> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> >>> From: Praveenkumar I <quic_ipkumar@quicinc.com>
> >>>
> >>> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
> >>>
> >>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> >>> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> >>> ---
> >>>  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
> >>>  1 file changed, 3 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>> index d1ec963..8e2208c 100644
> >>> --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>> +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>> @@ -66,6 +66,7 @@ properties:
> >>>        - description: v2 of TSENS with combined interrupt
> >>>          enum:
> >>>            - qcom,ipq8074-tsens
> >>> +          - qcom,ipq9574-tsens
> >>
> >> Your drive change indicates they are compatible, so make them
> >> compatible. 9574 followed by 8074.
> >
> > Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens"
> > instead of adding a "qcom,ipq9574-tsens" and no need to add an extra
> > entry to the driver like
>
> Assuming the devices are really compatible, which your driver change
> suggests, I want to use two compatibles. 9574 followed by 8074 fallback,
> just like we do for all Qualcomm IP blocks. Then as you said - no need
> for driver change.

With schema like this
	items:
	  - enum:
	      - qcom,ipq8074-tsens
	      - qcom,ipq9574-tsens
and DTS as
	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";

'make dtbs_check' gives the following error

arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:
        ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long

To fix the above error, I have to change the schema as

	items:
	  - enum:
	      - qcom,ipq8074-tsens
	      - qcom,ipq9574-tsens
	  - const: qcom,tsens-v2-combined-int

and change ipq8074 & ipq9754 DTS as

	compatible = "qcom,ipq8074-tsens", "qcom,tsens-v2-combined-int";
	compatible = "qcom,ipq9574-tsens", "qcom,tsens-v2-combined-int";

For this to work, have to introduce qcom,tsens-v2-combined-int in
the driver with
	}, {
		.compatible = "qcom,tsens-v2-combined-int",
		.data = &data_ipq8074,
	},

This i guess will defeat the purpose. So shall we leave it as it
is now, or shall I change driver, schema and ipq8074 + ip9574 DTS
with qcom,tsens-v2-combined-int? Let me know.

Thanks
Varada



> Best regards,
> Krzysztof

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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-05-04  4:57         ` Varadarajan Narayanan
@ 2023-05-04  6:22           ` Krzysztof Kozlowski
  2023-05-05 10:18             ` Varadarajan Narayanan
  0 siblings, 1 reply; 16+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-04  6:22 UTC (permalink / raw)
  To: Varadarajan Narayanan
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On 04/05/2023 06:57, Varadarajan Narayanan wrote:
> On Wed, May 03, 2023 at 09:42:28AM +0200, Krzysztof Kozlowski wrote:
>> On 03/05/2023 09:10, Varadarajan Narayanan wrote:
>>> On Mon, May 01, 2023 at 09:08:49AM +0200, Krzysztof Kozlowski wrote:
>>>> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
>>>>> From: Praveenkumar I <quic_ipkumar@quicinc.com>
>>>>>
>>>>> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
>>>>>
>>>>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
>>>>> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
>>>>>  1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>>>> index d1ec963..8e2208c 100644
>>>>> --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>>>> +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
>>>>> @@ -66,6 +66,7 @@ properties:
>>>>>        - description: v2 of TSENS with combined interrupt
>>>>>          enum:
>>>>>            - qcom,ipq8074-tsens
>>>>> +          - qcom,ipq9574-tsens
>>>>
>>>> Your drive change indicates they are compatible, so make them
>>>> compatible. 9574 followed by 8074.
>>>
>>> Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens"
>>> instead of adding a "qcom,ipq9574-tsens" and no need to add an extra
>>> entry to the driver like
>>
>> Assuming the devices are really compatible, which your driver change
>> suggests, I want to use two compatibles. 9574 followed by 8074 fallback,
>> just like we do for all Qualcomm IP blocks. Then as you said - no need
>> for driver change.
> 
> With schema like this
> 	items:
> 	  - enum:
> 	      - qcom,ipq8074-tsens
> 	      - qcom,ipq9574-tsens
> and DTS as
> 	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";

This file (and many others) shows you how to encode it in the DT schema

https://elixir.bootlin.com/linux/v6.3-rc6/source/Documentation/devicetree/bindings/sound/nvidia,tegra210-ope.yaml#L31

> 
> 'make dtbs_check' gives the following error
> 
> arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:
>         ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long
> 
> To fix the above error, I have to change the schema as
> 
> 	items:
> 	  - enum:
> 	      - qcom,ipq8074-tsens
> 	      - qcom,ipq9574-tsens
> 	  - const: qcom,tsens-v2-combined-int

This is not what we talked about.

Best regards,
Krzysztof


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

* Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-05-04  6:22           ` Krzysztof Kozlowski
@ 2023-05-05 10:18             ` Varadarajan Narayanan
  0 siblings, 0 replies; 16+ messages in thread
From: Varadarajan Narayanan @ 2023-05-05 10:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	linux-arm-msm, linux-pm, devicetree, linux-kernel,
	Praveenkumar I

On Thu, May 04, 2023 at 08:22:44AM +0200, Krzysztof Kozlowski wrote:
> On 04/05/2023 06:57, Varadarajan Narayanan wrote:
> > On Wed, May 03, 2023 at 09:42:28AM +0200, Krzysztof Kozlowski wrote:
> >> On 03/05/2023 09:10, Varadarajan Narayanan wrote:
> >>> On Mon, May 01, 2023 at 09:08:49AM +0200, Krzysztof Kozlowski wrote:
> >>>> On 28/04/2023 16:52, Varadarajan Narayanan wrote:
> >>>>> From: Praveenkumar I <quic_ipkumar@quicinc.com>
> >>>>>
> >>>>> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
> >>>>>
> >>>>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> >>>>> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> >>>>> ---
> >>>>>  Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
> >>>>>  1 file changed, 3 insertions(+)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>>>> index d1ec963..8e2208c 100644
> >>>>> --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>>>> +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
> >>>>> @@ -66,6 +66,7 @@ properties:
> >>>>>        - description: v2 of TSENS with combined interrupt
> >>>>>          enum:
> >>>>>            - qcom,ipq8074-tsens
> >>>>> +          - qcom,ipq9574-tsens
> >>>>
> >>>> Your drive change indicates they are compatible, so make them
> >>>> compatible. 9574 followed by 8074.
> >>>
> >>> Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens"
> >>> instead of adding a "qcom,ipq9574-tsens" and no need to add an extra
> >>> entry to the driver like
> >>
> >> Assuming the devices are really compatible, which your driver change
> >> suggests, I want to use two compatibles. 9574 followed by 8074 fallback,
> >> just like we do for all Qualcomm IP blocks. Then as you said - no need
> >> for driver change.
> >
> > With schema like this
> > 	items:
> > 	  - enum:
> > 	      - qcom,ipq8074-tsens
> > 	      - qcom,ipq9574-tsens
> > and DTS as
> > 	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";
>
> This file (and many others) shows you how to encode it in the DT schema
>
> https://elixir.bootlin.com/linux/v6.3-rc6/source/Documentation/devicetree/bindings/sound/nvidia,tegra210-ope.yaml#L31

Thanks for the pointer.
Will rework and post.

-Varada

> > 'make dtbs_check' gives the following error
> >
> > arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:
> >         ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long
> >
> > To fix the above error, I have to change the schema as
> >
> > 	items:
> > 	  - enum:
> > 	      - qcom,ipq8074-tsens
> > 	      - qcom,ipq9574-tsens
> > 	  - const: qcom,tsens-v2-combined-int
>
> This is not what we talked about.
>
> Best regards,
> Krzysztof
>

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

end of thread, other threads:[~2023-05-05 10:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 14:52 [PATCH 0/4] Enable IPQ9574 TSENS support Varadarajan Narayanan
2023-04-28 14:52 ` [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
2023-05-01  7:08   ` Krzysztof Kozlowski
2023-05-03  7:10     ` Varadarajan Narayanan
2023-05-03  7:42       ` Krzysztof Kozlowski
2023-05-04  4:57         ` Varadarajan Narayanan
2023-05-04  6:22           ` Krzysztof Kozlowski
2023-05-05 10:18             ` Varadarajan Narayanan
2023-04-28 14:52 ` [PATCH 2/4] thermal/drivers/tsens: Add IPQ9574 support Varadarajan Narayanan
2023-04-28 14:52 ` [PATCH 3/4] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
2023-04-28 14:52 ` [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
2023-04-28 19:49   ` Dmitry Baryshkov
2023-05-02  8:04     ` Varadarajan Narayanan
2023-05-02  8:39       ` Dmitry Baryshkov
2023-05-01  7:14   ` Krzysztof Kozlowski
2023-05-02  8:06     ` Varadarajan Narayanan

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).