linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT
@ 2022-06-15  9:47 Francesco Dolcini
  2022-06-15  9:47 ` [PATCH v1 1/9] dt-bindings: thermal: Define trips node in $defs Francesco Dolcini
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:47 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

This series allows to specify the imx thermal drivers trip point from the device tree,
without this change the threshold are hard-coded and this might not be correct given the
thermal design of the final system.

This change is backward compatible with the existing device tree, and even
with this change in by default the thresholds are the same as before.

Toradex board are also updated to use a system-specific thresholds.

Discussion on the current design is here:
https://lore.kernel.org/all/4ba1d7d2-3e8c-ba60-37fd-9598f415c076@linaro.org/

One side note, after this change the dtbs checker starts complaining with this message

```
linux/arch/arm/boot/dts/imx6dl-alti6p.dtb: tempmon: '#thermal-sensor-cells' does not match any of the regexes: '^(automotive|commercial|extended-commercial|industrial)-thermal$', 'pinctrl-[0-9]+'
	From schema: linux/Documentation/devicetree/bindings/thermal/imx-thermal.yaml
```

to my understanding this is just a side effect, '#thermal-sensor-cells' is not changed in
any way by this series. I can fix that, I wonder if I should remove the property from the
imx dtsi files or add it to the binding yaml definition, not sure about it.
Anybody can advise?


Francesco Dolcini (9):
  dt-bindings: thermal: Define trips node in $defs
  thermal: thermal: Export OF trip helper function
  dt-bindings: thermal: imx: Add trips point
  imx: thermal: Configure trip point from DT
  ARM: dts: imx[67]: Add trips points
  ARM: dts: imx6qdl-apalis: Set CPU critical trip point
  ARM: dts: imx7-colibri: Set CPU critical trip point
  ARM: dts: imx6ull-colibri: Set CPU critical trip point
  ARM: dts: imx6qdl-colibri: Set CPU critical trip point

 .../bindings/thermal/imx-thermal.yaml         |  27 ++++
 .../bindings/thermal/thermal-zones.yaml       | 130 +++++++++---------
 arch/arm/boot/dts/imx-thermal.dtsi            |  61 ++++++++
 arch/arm/boot/dts/imx6qdl-apalis.dtsi         |  12 ++
 arch/arm/boot/dts/imx6qdl-colibri.dtsi        |  12 ++
 arch/arm/boot/dts/imx6qdl.dtsi                |   2 +
 arch/arm/boot/dts/imx6sl.dtsi                 |   2 +
 arch/arm/boot/dts/imx6sll.dtsi                |   2 +
 arch/arm/boot/dts/imx6sx.dtsi                 |   2 +
 arch/arm/boot/dts/imx6ul.dtsi                 |   2 +
 arch/arm/boot/dts/imx6ull-colibri.dtsi        |  12 ++
 arch/arm/boot/dts/imx7-colibri.dtsi           |  12 ++
 arch/arm/boot/dts/imx7s.dtsi                  |   2 +
 drivers/thermal/imx_thermal.c                 |  49 +++++++
 drivers/thermal/thermal_core.h                |   7 +
 drivers/thermal/thermal_of.c                  |   5 +-
 16 files changed, 274 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx-thermal.dtsi

-- 
2.25.1



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

* [PATCH v1 1/9] dt-bindings: thermal: Define trips node in $defs
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
@ 2022-06-15  9:47 ` Francesco Dolcini
  2022-06-15  9:47 ` [PATCH v1 2/9] thermal: thermal: Export OF trip helper function Francesco Dolcini
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:47 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Move `trips` definition to `#/$defs/trips-base` and just reference it
from the trips node. This allows to easily re-use this binding from
another binding file.

No functional changes expected.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 .../bindings/thermal/thermal-zones.yaml       | 130 +++++++++---------
 1 file changed, 67 insertions(+), 63 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 2d34f3ccb257..ba84233d20b7 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -10,6 +10,72 @@ title: Thermal zone binding
 maintainers:
   - Amit Kucheria <amitk@kernel.org>
 
+$defs:
+  trips-base:
+    type: object
+    description:
+      This node describes a set of points in the temperature domain at
+      which the thermal framework needs to take action. The actions to
+      be taken are defined in another node called cooling-maps.
+
+    patternProperties:
+      "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$":
+        type: object
+
+        properties:
+          temperature:
+            $ref: /schemas/types.yaml#/definitions/int32
+            minimum: -273000
+            maximum: 200000
+            description:
+              An integer expressing the trip temperature in millicelsius.
+
+          hysteresis:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description:
+              An unsigned integer expressing the hysteresis delta with
+              respect to the trip temperature property above, also in
+              millicelsius. Any cooling action initiated by the framework is
+              maintained until the temperature falls below
+              (trip temperature - hysteresis). This potentially prevents a
+              situation where the trip gets constantly triggered soon after
+              cooling action is removed.
+
+          type:
+            $ref: /schemas/types.yaml#/definitions/string
+            enum:
+              - active   # enable active cooling e.g. fans
+              - passive  # enable passive cooling e.g. throttling cpu
+              - hot      # send notification to driver
+              - critical # send notification to driver, trigger shutdown
+            description: |
+              There are four valid trip types: active, passive, hot,
+              critical.
+
+              The critical trip type is used to set the maximum
+              temperature threshold above which the HW becomes
+              unstable and underlying firmware might even trigger a
+              reboot. Hitting the critical threshold triggers a system
+              shutdown.
+
+              The hot trip type can be used to send a notification to
+              the thermal driver (if a .notify callback is registered).
+              The action to be taken is left to the driver.
+
+              The passive trip type can be used to slow down HW e.g. run
+              the CPU, GPU, bus at a lower frequency.
+
+              The active trip type can be used to control other HW to
+              help in cooling e.g. fans can be sped up or slowed down
+
+        required:
+          - temperature
+          - hysteresis
+          - type
+        additionalProperties: false
+
+    additionalProperties: false
+
 description: |
   Thermal management is achieved in devicetree by describing the sensor hardware
   and the software abstraction of cooling devices and thermal zones required to
@@ -105,69 +171,7 @@ patternProperties:
           10-inch tablet is around 4500mW.
 
       trips:
-        type: object
-        description:
-          This node describes a set of points in the temperature domain at
-          which the thermal framework needs to take action. The actions to
-          be taken are defined in another node called cooling-maps.
-
-        patternProperties:
-          "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$":
-            type: object
-
-            properties:
-              temperature:
-                $ref: /schemas/types.yaml#/definitions/int32
-                minimum: -273000
-                maximum: 200000
-                description:
-                  An integer expressing the trip temperature in millicelsius.
-
-              hysteresis:
-                $ref: /schemas/types.yaml#/definitions/uint32
-                description:
-                  An unsigned integer expressing the hysteresis delta with
-                  respect to the trip temperature property above, also in
-                  millicelsius. Any cooling action initiated by the framework is
-                  maintained until the temperature falls below
-                  (trip temperature - hysteresis). This potentially prevents a
-                  situation where the trip gets constantly triggered soon after
-                  cooling action is removed.
-
-              type:
-                $ref: /schemas/types.yaml#/definitions/string
-                enum:
-                  - active   # enable active cooling e.g. fans
-                  - passive  # enable passive cooling e.g. throttling cpu
-                  - hot      # send notification to driver
-                  - critical # send notification to driver, trigger shutdown
-                description: |
-                  There are four valid trip types: active, passive, hot,
-                  critical.
-
-                  The critical trip type is used to set the maximum
-                  temperature threshold above which the HW becomes
-                  unstable and underlying firmware might even trigger a
-                  reboot. Hitting the critical threshold triggers a system
-                  shutdown.
-
-                  The hot trip type can be used to send a notification to
-                  the thermal driver (if a .notify callback is registered).
-                  The action to be taken is left to the driver.
-
-                  The passive trip type can be used to slow down HW e.g. run
-                  the CPU, GPU, bus at a lower frequency.
-
-                  The active trip type can be used to control other HW to
-                  help in cooling e.g. fans can be sped up or slowed down
-
-            required:
-              - temperature
-              - hysteresis
-              - type
-            additionalProperties: false
-
-        additionalProperties: false
+        $ref: "#/$defs/trips-base"
 
       cooling-maps:
         type: object
-- 
2.25.1



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

* [PATCH v1 2/9] thermal: thermal: Export OF trip helper function
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
  2022-06-15  9:47 ` [PATCH v1 1/9] dt-bindings: thermal: Define trips node in $defs Francesco Dolcini
@ 2022-06-15  9:47 ` Francesco Dolcini
  2022-06-15 19:24   ` kernel test robot
  2022-06-15  9:47 ` [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point Francesco Dolcini
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:47 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Export function that populate thermal trip struct from a of node to be
able to re-use it in thermal drivers different from thermal_of.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 drivers/thermal/thermal_core.h | 7 +++++++
 drivers/thermal/thermal_of.c   | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 726e327b4205..81e6d041e79c 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -155,6 +155,8 @@ int of_thermal_get_ntrips(struct thermal_zone_device *);
 bool of_thermal_is_trip_valid(struct thermal_zone_device *, int);
 const struct thermal_trip *
 of_thermal_get_trip_points(struct thermal_zone_device *);
+int thermal_of_populate_trip(struct device_node *np,
+			     struct thermal_trip *trip);
 #else
 static inline int of_parse_thermal_zones(void) { return 0; }
 static inline int of_thermal_get_ntrips(struct thermal_zone_device *tz)
@@ -171,6 +173,11 @@ of_thermal_get_trip_points(struct thermal_zone_device *tz)
 {
 	return NULL;
 }
+static inline int thermal_of_populate_trip(struct device_node *np,
+					   struct thermal_trip *trip)
+{
+	return -ENOTSUP;
+}
 #endif
 
 int thermal_zone_device_is_enabled(struct thermal_zone_device *tz);
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index b65d435cb92f..dcd6571a3871 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -817,8 +817,8 @@ static int thermal_of_get_trip_type(struct device_node *np,
  *
  * Return: 0 on success, proper error code otherwise
  */
-static int thermal_of_populate_trip(struct device_node *np,
-				    struct thermal_trip *trip)
+int thermal_of_populate_trip(struct device_node *np,
+			     struct thermal_trip *trip)
 {
 	int prop;
 	int ret;
@@ -849,6 +849,7 @@ static int thermal_of_populate_trip(struct device_node *np,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(thermal_of_populate_trip);
 
 /**
  * thermal_of_build_thermal_zone - parse and fill one thermal zone data
-- 
2.25.1



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

* [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
  2022-06-15  9:47 ` [PATCH v1 1/9] dt-bindings: thermal: Define trips node in $defs Francesco Dolcini
  2022-06-15  9:47 ` [PATCH v1 2/9] thermal: thermal: Export OF trip helper function Francesco Dolcini
@ 2022-06-15  9:47 ` Francesco Dolcini
  2022-06-15 13:16   ` Rob Herring
  2022-06-15  9:47 ` [PATCH v1 4/9] imx: thermal: Configure trip point from DT Francesco Dolcini
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:47 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Add trips point to i.MX Thermal bindings for each temperature grade
(automotive, commercial, extended-commercial and industrial) to enable
specifying a different trip point than the hard-coded value.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 .../bindings/thermal/imx-thermal.yaml         | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/imx-thermal.yaml b/Documentation/devicetree/bindings/thermal/imx-thermal.yaml
index 16b57f57d103..e6349e40d6c6 100644
--- a/Documentation/devicetree/bindings/thermal/imx-thermal.yaml
+++ b/Documentation/devicetree/bindings/thermal/imx-thermal.yaml
@@ -54,6 +54,18 @@ properties:
   clocks:
     maxItems: 1
 
+patternProperties:
+  "^(automotive|commercial|extended-commercial|industrial)-thermal$":
+    type: object
+    description:
+      Thermal characteristics for each available temperature grade, this allows
+      to override the passive and critical trip points.
+    properties:
+      trips:
+        $ref: "thermal-zones.yaml#/$defs/trips-base"
+
+      additionalProperties: false
+
 required:
   - compatible
   - interrupts
@@ -98,5 +110,20 @@ examples:
              nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
              nvmem-cell-names = "calib", "temp_grade";
              clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>;
+
+             industrial-thermal {
+                 trips {
+                     temp_trip_passive_industrial: trip-point0 {
+                         temperature = <95000>;
+                         hysteresis = <0>;
+                         type = "passive";
+                     };
+                     temp_trip_crit_industrial: trip-point1 {
+                         temperature = <100000>;
+                         hysteresis = <0>;
+                         type = "critical";
+                     };
+                 };
+             };
         };
     };
-- 
2.25.1



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

* [PATCH v1 4/9] imx: thermal: Configure trip point from DT
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (2 preceding siblings ...)
  2022-06-15  9:47 ` [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point Francesco Dolcini
@ 2022-06-15  9:47 ` Francesco Dolcini
  2022-06-15 10:39   ` Marco Felsch
  2022-06-15  9:48 ` [PATCH v1 5/9] ARM: dts: imx[67]: Add trips points Francesco Dolcini
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:47 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Allow over-writing critical and passive trip point for each
temperature grade from the device tree, by default the pre-existing
hard-coded trip points are used.

This change enables configuring the system thermal characteristics into
the system-specific device tree instead of relying on global hard-coded
temperature thresholds that does not take into account the specific
system thermal design.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 drivers/thermal/imx_thermal.c | 49 +++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 16663373b682..ef3e152b5ee2 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -17,6 +17,8 @@
 #include <linux/nvmem-consumer.h>
 #include <linux/pm_runtime.h>
 
+#include "thermal_core.h"
+
 #define REG_SET		0x4
 #define REG_CLR		0x8
 #define REG_TOG		0xc
@@ -479,36 +481,83 @@ static int imx_init_calib(struct platform_device *pdev, u32 ocotp_ana1)
 	return 0;
 }
 
+static void imx_init_temp_from_of(struct platform_device *pdev, const char *name)
+{
+	struct imx_thermal_data *data = platform_get_drvdata(pdev);
+	struct device_node *thermal, *trips, *trip_point;
+
+	thermal = of_get_child_by_name(pdev->dev.of_node, name);
+	trips = of_get_child_by_name(thermal, "trips");
+
+	for_each_child_of_node(trips, trip_point) {
+		struct thermal_trip t;
+
+		if (thermal_of_populate_trip(trip_point, &t))
+			continue;
+
+		switch (t.type) {
+		case THERMAL_TRIP_PASSIVE:
+			data->temp_passive = t.temperature;
+			break;
+		case THERMAL_TRIP_CRITICAL:
+			data->temp_critical = t.temperature;
+			break;
+		default:
+			dev_dbg(&pdev->dev, "Ignoring trip type %d\n", t.type);
+			break;
+		}
+	};
+
+	of_node_put(trips);
+	of_node_put(thermal);
+
+	if (data->temp_passive >= data->temp_critical) {
+		dev_warn(&pdev->dev,
+			 "passive trip point must be lower than critical, fixing it up\n");
+		data->temp_passive = data->temp_critical - (1000 * 5);
+	}
+}
+
 static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
 {
 	struct imx_thermal_data *data = platform_get_drvdata(pdev);
+	const char *thermal_node_name;
 
 	/* The maximum die temp is specified by the Temperature Grade */
 	switch ((ocotp_mem0 >> 6) & 0x3) {
 	case 0: /* Commercial (0 to 95 °C) */
+		thermal_node_name = "commercial-thermal";
 		data->temp_grade = "Commercial";
 		data->temp_max = 95000;
 		break;
 	case 1: /* Extended Commercial (-20 °C to 105 °C) */
+		thermal_node_name = "extended-commercial-thermal";
 		data->temp_grade = "Extended Commercial";
 		data->temp_max = 105000;
 		break;
 	case 2: /* Industrial (-40 °C to 105 °C) */
+		thermal_node_name = "industrial-thermal";
 		data->temp_grade = "Industrial";
 		data->temp_max = 105000;
 		break;
 	case 3: /* Automotive (-40 °C to 125 °C) */
+		thermal_node_name = "automotive-thermal";
 		data->temp_grade = "Automotive";
 		data->temp_max = 125000;
 		break;
 	}
 
 	/*
+	 * Set defaults trips
+	 *
 	 * Set the critical trip point at 5 °C under max
 	 * Set the passive trip point at 10 °C under max (changeable via sysfs)
 	 */
 	data->temp_critical = data->temp_max - (1000 * 5);
 	data->temp_passive = data->temp_max - (1000 * 10);
+
+	/* Override critical/passive temperature from devicetree */
+	imx_init_temp_from_of(pdev, thermal_node_name);
 }
 
 static int imx_init_from_tempmon_data(struct platform_device *pdev)
-- 
2.25.1



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

* [PATCH v1 5/9] ARM: dts: imx[67]: Add trips points
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (3 preceding siblings ...)
  2022-06-15  9:47 ` [PATCH v1 4/9] imx: thermal: Configure trip point from DT Francesco Dolcini
@ 2022-06-15  9:48 ` Francesco Dolcini
  2022-06-15  9:48 ` [PATCH v1 6/9] ARM: dts: imx6qdl-apalis: Set CPU critical trip point Francesco Dolcini
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:48 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Add thermal trip point to the i.MX[67]* dtsi for each available
temperature grade.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/boot/dts/imx-thermal.dtsi | 61 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6qdl.dtsi     |  2 +
 arch/arm/boot/dts/imx6sl.dtsi      |  2 +
 arch/arm/boot/dts/imx6sll.dtsi     |  2 +
 arch/arm/boot/dts/imx6sx.dtsi      |  2 +
 arch/arm/boot/dts/imx6ul.dtsi      |  2 +
 arch/arm/boot/dts/imx7s.dtsi       |  2 +
 7 files changed, 73 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx-thermal.dtsi

diff --git a/arch/arm/boot/dts/imx-thermal.dtsi b/arch/arm/boot/dts/imx-thermal.dtsi
new file mode 100644
index 000000000000..2303f1a99d84
--- /dev/null
+++ b/arch/arm/boot/dts/imx-thermal.dtsi
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+//
+// Copyright 2022 Toradex
+
+automotive-thermal {
+	trips {
+		temp_trip_passive_automotive: trip-point0 {
+			temperature = <115000>;
+			hysteresis = <0>;
+			type = "passive";
+		};
+		temp_trip_crit_automotive: trip-point1 {
+			temperature = <120000>;
+			hysteresis = <0>;
+			type = "critical";
+		};
+	};
+};
+commercial-thermal {
+	trips {
+		temp_trip_passive_commercial: trip-point0 {
+			temperature = <85000>;
+			hysteresis = <0>;
+			type = "passive";
+		};
+		temp_trip_crit_commercial: trip-point1 {
+			temperature = <90000>;
+			hysteresis = <0>;
+			type = "critical";
+		};
+	};
+};
+extended-commercial-thermal {
+	trips {
+		temp_trip_passive_ecommercial: trip-point0 {
+			temperature = <95000>;
+			hysteresis = <0>;
+			type = "passive";
+		};
+		temp_trip_crit_ecommercial: trip-point1 {
+			temperature = <100000>;
+			hysteresis = <0>;
+			type = "critical";
+		};
+	};
+};
+industrial-thermal {
+	trips {
+		temp_trip_passive_industrial: trip-point0 {
+			temperature = <95000>;
+			hysteresis = <0>;
+			type = "passive";
+		};
+		temp_trip_crit_industrial: trip-point1 {
+			temperature = <100000>;
+			hysteresis = <0>;
+			type = "critical";
+		};
+	};
+};
+
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index d27beb47f9a3..0a492d9750dd 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -800,6 +800,8 @@ tempmon: tempmon {
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
 					#thermal-sensor-cells = <0>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 06a515121dfc..3719225126d0 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -628,6 +628,8 @@ tempmon: tempmon {
 					nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX6SL_CLK_PLL3_USB_OTG>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
diff --git a/arch/arm/boot/dts/imx6sll.dtsi b/arch/arm/boot/dts/imx6sll.dtsi
index d4a000c3dde7..3192dae452fd 100644
--- a/arch/arm/boot/dts/imx6sll.dtsi
+++ b/arch/arm/boot/dts/imx6sll.dtsi
@@ -530,6 +530,8 @@ tempmon: temperature-sensor {
 					nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX6SLL_CLK_PLL3_USB_OTG>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
index fc6334336b3d..d88c89696554 100644
--- a/arch/arm/boot/dts/imx6sx.dtsi
+++ b/arch/arm/boot/dts/imx6sx.dtsi
@@ -718,6 +718,8 @@ tempmon: tempmon {
 					nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX6SX_CLK_PLL3_USB_OTG>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi
index afeec01f6522..70d503c74e73 100644
--- a/arch/arm/boot/dts/imx6ul.dtsi
+++ b/arch/arm/boot/dts/imx6ul.dtsi
@@ -639,6 +639,8 @@ tempmon: tempmon {
 					nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX6UL_CLK_PLL3_USB_OTG>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi
index 008e3da460f1..887b3618d20e 100644
--- a/arch/arm/boot/dts/imx7s.dtsi
+++ b/arch/arm/boot/dts/imx7s.dtsi
@@ -604,6 +604,8 @@ tempmon: tempmon {
 					nvmem-cells = <&tempmon_calib>,	<&fuse_grade>;
 					nvmem-cell-names = "calib", "temp_grade";
 					clocks = <&clks IMX7D_PLL_SYS_MAIN_CLK>;
+
+					#include "imx-thermal.dtsi"
 				};
 			};
 
-- 
2.25.1



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

* [PATCH v1 6/9] ARM: dts: imx6qdl-apalis: Set CPU critical trip point
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (4 preceding siblings ...)
  2022-06-15  9:48 ` [PATCH v1 5/9] ARM: dts: imx[67]: Add trips points Francesco Dolcini
@ 2022-06-15  9:48 ` Francesco Dolcini
  2022-06-15  9:48 ` [PATCH v1 7/9] ARM: dts: imx7-colibri: " Francesco Dolcini
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:48 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Set CPU thermal critical trip point to the system designed value,
95 degrees for commercial grade modules, 105 for industrial and extended
commercial grade.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/boot/dts/imx6qdl-apalis.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
index bd763bae596b..21ee16f3926f 100644
--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -390,6 +390,18 @@ &ssi1 {
 	status = "okay";
 };
 
+&temp_trip_crit_commercial {
+	temperature = <95000>;
+};
+
+&temp_trip_crit_ecommercial {
+	temperature = <105000>;
+};
+
+&temp_trip_crit_industrial {
+	temperature = <105000>;
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1_dte &pinctrl_uart1_ctrl>;
-- 
2.25.1



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

* [PATCH v1 7/9] ARM: dts: imx7-colibri: Set CPU critical trip point
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (5 preceding siblings ...)
  2022-06-15  9:48 ` [PATCH v1 6/9] ARM: dts: imx6qdl-apalis: Set CPU critical trip point Francesco Dolcini
@ 2022-06-15  9:48 ` Francesco Dolcini
  2022-06-15  9:48 ` [PATCH v1 8/9] ARM: dts: imx6ull-colibri: " Francesco Dolcini
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:48 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Set CPU thermal critical trip point to the system designed value,
95 degrees for commercial grade modules, 105 for industrial and extended
commercial grade.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/boot/dts/imx7-colibri.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index f1c60b0cb143..ac6dfb664d53 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -430,6 +430,18 @@ &sai1 {
 	status = "okay";
 };
 
+&temp_trip_crit_commercial {
+	temperature = <95000>;
+};
+
+&temp_trip_crit_ecommercial {
+	temperature = <105000>;
+};
+
+&temp_trip_crit_industrial {
+	temperature = <105000>;
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1 &pinctrl_uart1_ctrl1 &pinctrl_uart1_ctrl2>;
-- 
2.25.1



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

* [PATCH v1 8/9] ARM: dts: imx6ull-colibri: Set CPU critical trip point
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (6 preceding siblings ...)
  2022-06-15  9:48 ` [PATCH v1 7/9] ARM: dts: imx7-colibri: " Francesco Dolcini
@ 2022-06-15  9:48 ` Francesco Dolcini
  2022-06-15  9:48 ` [PATCH v1 9/9] ARM: dts: imx6qdl-colibri: " Francesco Dolcini
  2022-06-15 10:42 ` [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Marco Felsch
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:48 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Set CPU thermal critical trip point to the system designed value,
95 degrees for commercial grade modules, 105 for industrial and extended
commercial grade.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/boot/dts/imx6ull-colibri.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
index 15621e03fa4d..6d8e1ef0315b 100644
--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -250,6 +250,18 @@ &snvs_pwrkey {
 	status = "disabled";
 };
 
+&temp_trip_crit_commercial {
+	temperature = <95000>;
+};
+
+&temp_trip_crit_ecommercial {
+	temperature = <105000>;
+};
+
+&temp_trip_crit_industrial {
+	temperature = <105000>;
+};
+
 /* Colibri UART_A */
 &uart1 {
 	pinctrl-names = "default";
-- 
2.25.1



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

* [PATCH v1 9/9] ARM: dts: imx6qdl-colibri: Set CPU critical trip point
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (7 preceding siblings ...)
  2022-06-15  9:48 ` [PATCH v1 8/9] ARM: dts: imx6ull-colibri: " Francesco Dolcini
@ 2022-06-15  9:48 ` Francesco Dolcini
  2022-06-15 10:42 ` [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Marco Felsch
  9 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15  9:48 UTC (permalink / raw)
  To: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Marco Felsch, Anson Huang
  Cc: Francesco Dolcini, Amit Kucheria, Zhang Rui, linux-pm,
	devicetree, Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

Set CPU thermal critical trip point to the system designed value,
95 degrees for commercial grade modules, 105 for industrial and extended
commercial grade.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/boot/dts/imx6qdl-colibri.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
index c383e0e4110c..fb7bdf65a0bd 100644
--- a/arch/arm/boot/dts/imx6qdl-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-colibri.dtsi
@@ -642,6 +642,18 @@ &ssi1 {
 	status = "okay";
 };
 
+&temp_trip_crit_commercial {
+	temperature = <95000>;
+};
+
+&temp_trip_crit_ecommercial {
+	temperature = <105000>;
+};
+
+&temp_trip_crit_industrial {
+	temperature = <105000>;
+};
+
 /* Colibri UART_A */
 &uart1 {
 	fsl,dte-mode;
-- 
2.25.1



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

* Re: [PATCH v1 4/9] imx: thermal: Configure trip point from DT
  2022-06-15  9:47 ` [PATCH v1 4/9] imx: thermal: Configure trip point from DT Francesco Dolcini
@ 2022-06-15 10:39   ` Marco Felsch
  2022-06-15 13:04     ` Francesco Dolcini
  0 siblings, 1 reply; 15+ messages in thread
From: Marco Felsch @ 2022-06-15 10:39 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Anson Huang, Amit Kucheria,
	Zhang Rui, linux-pm, devicetree, Pengutronix Kernel Team,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, linux-arm-kernel

Hi Francesco,

nice patch, only a few nits.

On 22-06-15, Francesco Dolcini wrote:
> Allow over-writing critical and passive trip point for each
> temperature grade from the device tree, by default the pre-existing
> hard-coded trip points are used.
> 
> This change enables configuring the system thermal characteristics into
> the system-specific device tree instead of relying on global hard-coded
> temperature thresholds that does not take into account the specific
> system thermal design.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  drivers/thermal/imx_thermal.c | 49 +++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 16663373b682..ef3e152b5ee2 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -17,6 +17,8 @@
>  #include <linux/nvmem-consumer.h>
>  #include <linux/pm_runtime.h>
>  
> +#include "thermal_core.h"
> +
>  #define REG_SET		0x4
>  #define REG_CLR		0x8
>  #define REG_TOG		0xc
> @@ -479,36 +481,83 @@ static int imx_init_calib(struct platform_device *pdev, u32 ocotp_ana1)
>  	return 0;
>  }
>  
> +static void imx_init_temp_from_of(struct platform_device *pdev, const char *name)
> +{
> +	struct imx_thermal_data *data = platform_get_drvdata(pdev);
> +	struct device_node *thermal, *trips, *trip_point;
> +
> +	thermal = of_get_child_by_name(pdev->dev.of_node, name);

here I would do:

	if (!thermal)
		return;

since the thermal node is only available with your dt-changes in place.

> +	trips = of_get_child_by_name(thermal, "trips");
> +
> +	for_each_child_of_node(trips, trip_point) {
> +		struct thermal_trip t;
> +
> +		if (thermal_of_populate_trip(trip_point, &t))
> +			continue;
> +
> +		switch (t.type) {
> +		case THERMAL_TRIP_PASSIVE:
> +			data->temp_passive = t.temperature;
> +			break;
> +		case THERMAL_TRIP_CRITICAL:
> +			data->temp_critical = t.temperature;
> +			break;
> +		default:
> +			dev_dbg(&pdev->dev, "Ignoring trip type %d\n", t.type);
			  ^
Maybe it is worth to use dev_info() since this never should happen and
if it happen, it is a bug/misconfiguration/misusage.

> +			break;
> +		}
> +	};
> +
> +	of_node_put(trips);
> +	of_node_put(thermal);
> +
> +	if (data->temp_passive >= data->temp_critical) {
> +		dev_warn(&pdev->dev,
> +			 "passive trip point must be lower than critical, fixing it up\n");
> +		data->temp_passive = data->temp_critical - (1000 * 5);
								^
			Magic number? Maybe it would be worth a comment.

Regards,
  Marco

> +	}
> +}
> +
>  static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
>  {
>  	struct imx_thermal_data *data = platform_get_drvdata(pdev);
> +	const char *thermal_node_name;
>  
>  	/* The maximum die temp is specified by the Temperature Grade */
>  	switch ((ocotp_mem0 >> 6) & 0x3) {
>  	case 0: /* Commercial (0 to 95 °C) */
> +		thermal_node_name = "commercial-thermal";
>  		data->temp_grade = "Commercial";
>  		data->temp_max = 95000;
>  		break;
>  	case 1: /* Extended Commercial (-20 °C to 105 °C) */
> +		thermal_node_name = "extended-commercial-thermal";
>  		data->temp_grade = "Extended Commercial";
>  		data->temp_max = 105000;
>  		break;
>  	case 2: /* Industrial (-40 °C to 105 °C) */
> +		thermal_node_name = "industrial-thermal";
>  		data->temp_grade = "Industrial";
>  		data->temp_max = 105000;
>  		break;
>  	case 3: /* Automotive (-40 °C to 125 °C) */
> +		thermal_node_name = "automotive-thermal";
>  		data->temp_grade = "Automotive";
>  		data->temp_max = 125000;
>  		break;
>  	}
>  
>  	/*
> +	 * Set defaults trips
> +	 *
>  	 * Set the critical trip point at 5 °C under max
>  	 * Set the passive trip point at 10 °C under max (changeable via sysfs)
>  	 */
>  	data->temp_critical = data->temp_max - (1000 * 5);
>  	data->temp_passive = data->temp_max - (1000 * 10);
> +
> +	/* Override critical/passive temperature from devicetree */
> +	imx_init_temp_from_of(pdev, thermal_node_name);
>  }
>  
>  static int imx_init_from_tempmon_data(struct platform_device *pdev)
> -- 
> 2.25.1
> 
> 
> 

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

* Re: [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT
  2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
                   ` (8 preceding siblings ...)
  2022-06-15  9:48 ` [PATCH v1 9/9] ARM: dts: imx6qdl-colibri: " Francesco Dolcini
@ 2022-06-15 10:42 ` Marco Felsch
  9 siblings, 0 replies; 15+ messages in thread
From: Marco Felsch @ 2022-06-15 10:42 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Daniel Lezcano, Rob Herring, Rafael J. Wysocki,
	Krzysztof Kozlowski, Shawn Guo, Anson Huang, Amit Kucheria,
	Zhang Rui, linux-pm, devicetree, Pengutronix Kernel Team,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, linux-arm-kernel

Hi Francesco,

nice work :)

On 22-06-15, Francesco Dolcini wrote:
> This series allows to specify the imx thermal drivers trip point from the device tree,
> without this change the threshold are hard-coded and this might not be correct given the
> thermal design of the final system.
> 
> This change is backward compatible with the existing device tree, and even
> with this change in by default the thresholds are the same as before.
> 
> Toradex board are also updated to use a system-specific thresholds.
> 
> Discussion on the current design is here:
> https://lore.kernel.org/all/4ba1d7d2-3e8c-ba60-37fd-9598f415c076@linaro.org/

Thanks for thanking our abbroaches and forming this patchset. I added
only a few comments.

Regards,
  Marco

> 
> One side note, after this change the dtbs checker starts complaining with this message
> 
> ```
> linux/arch/arm/boot/dts/imx6dl-alti6p.dtb: tempmon: '#thermal-sensor-cells' does not match any of the regexes: '^(automotive|commercial|extended-commercial|industrial)-thermal$', 'pinctrl-[0-9]+'
> 	From schema: linux/Documentation/devicetree/bindings/thermal/imx-thermal.yaml
> ```
> 
> to my understanding this is just a side effect, '#thermal-sensor-cells' is not changed in
> any way by this series. I can fix that, I wonder if I should remove the property from the
> imx dtsi files or add it to the binding yaml definition, not sure about it.
> Anybody can advise?
> 
> 
> Francesco Dolcini (9):
>   dt-bindings: thermal: Define trips node in $defs
>   thermal: thermal: Export OF trip helper function
>   dt-bindings: thermal: imx: Add trips point
>   imx: thermal: Configure trip point from DT
>   ARM: dts: imx[67]: Add trips points
>   ARM: dts: imx6qdl-apalis: Set CPU critical trip point
>   ARM: dts: imx7-colibri: Set CPU critical trip point
>   ARM: dts: imx6ull-colibri: Set CPU critical trip point
>   ARM: dts: imx6qdl-colibri: Set CPU critical trip point
> 
>  .../bindings/thermal/imx-thermal.yaml         |  27 ++++
>  .../bindings/thermal/thermal-zones.yaml       | 130 +++++++++---------
>  arch/arm/boot/dts/imx-thermal.dtsi            |  61 ++++++++
>  arch/arm/boot/dts/imx6qdl-apalis.dtsi         |  12 ++
>  arch/arm/boot/dts/imx6qdl-colibri.dtsi        |  12 ++
>  arch/arm/boot/dts/imx6qdl.dtsi                |   2 +
>  arch/arm/boot/dts/imx6sl.dtsi                 |   2 +
>  arch/arm/boot/dts/imx6sll.dtsi                |   2 +
>  arch/arm/boot/dts/imx6sx.dtsi                 |   2 +
>  arch/arm/boot/dts/imx6ul.dtsi                 |   2 +
>  arch/arm/boot/dts/imx6ull-colibri.dtsi        |  12 ++
>  arch/arm/boot/dts/imx7-colibri.dtsi           |  12 ++
>  arch/arm/boot/dts/imx7s.dtsi                  |   2 +
>  drivers/thermal/imx_thermal.c                 |  49 +++++++
>  drivers/thermal/thermal_core.h                |   7 +
>  drivers/thermal/thermal_of.c                  |   5 +-
>  16 files changed, 274 insertions(+), 65 deletions(-)
>  create mode 100644 arch/arm/boot/dts/imx-thermal.dtsi
> 
> -- 
> 2.25.1
> 
> 
> 

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

* Re: [PATCH v1 4/9] imx: thermal: Configure trip point from DT
  2022-06-15 10:39   ` Marco Felsch
@ 2022-06-15 13:04     ` Francesco Dolcini
  0 siblings, 0 replies; 15+ messages in thread
From: Francesco Dolcini @ 2022-06-15 13:04 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Francesco Dolcini, Daniel Lezcano, Rob Herring,
	Rafael J. Wysocki, Krzysztof Kozlowski, Shawn Guo, Anson Huang,
	Amit Kucheria, Zhang Rui, linux-pm, devicetree,
	Pengutronix Kernel Team, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, linux-arm-kernel

On Wed, Jun 15, 2022 at 12:39:56PM +0200, Marco Felsch wrote:
> On 22-06-15, Francesco Dolcini wrote:
> > +static void imx_init_temp_from_of(struct platform_device *pdev, const char *name)
> > +{
> > +	struct imx_thermal_data *data = platform_get_drvdata(pdev);
> > +	struct device_node *thermal, *trips, *trip_point;
> > +
> > +	thermal = of_get_child_by_name(pdev->dev.of_node, name);
> 
> here I would do:
> 
> 	if (!thermal)
> 		return;
> 
> since the thermal node is only available with your dt-changes in place.

I didn't do it since from my understanding both `of_get_child_by_name`
and `for_each_child_of_node` just handle correctly NULL as an input
parameter. Anyway, I agree that your suggested change would make
crystal clear that this is optional, I'll do it.

Francesco


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

* Re: [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point
  2022-06-15  9:47 ` [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point Francesco Dolcini
@ 2022-06-15 13:16   ` Rob Herring
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Herring @ 2022-06-15 13:16 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Daniel Lezcano, Rafael J. Wysocki, linux-pm, devicetree,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Zhang Rui, Marco Felsch, Anson Huang, Sascha Hauer,
	Krzysztof Kozlowski, linux-arm-kernel, Shawn Guo, Amit Kucheria,
	Rob Herring

On Wed, 15 Jun 2022 11:47:58 +0200, Francesco Dolcini wrote:
> Add trips point to i.MX Thermal bindings for each temperature grade
> (automotive, commercial, extended-commercial and industrial) to enable
> specifying a different trip point than the hard-coded value.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
>  .../bindings/thermal/imx-thermal.yaml         | 27 +++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/


temperature-sensor: compatible:0: 'fsl,imx6sll-tempmon' is not one of ['fsl,imx6q-tempmon', 'fsl,imx6sx-tempmon', 'fsl,imx7d-tempmon']
	arch/arm/boot/dts/imx6sll-evk.dtb
	arch/arm/boot/dts/imx6sll-kobo-clarahd.dtb
	arch/arm/boot/dts/imx6sll-kobo-librah2o.dtb

temperature-sensor: compatible: ['fsl,imx6sll-tempmon', 'fsl,imx6sx-tempmon'] is too long
	arch/arm/boot/dts/imx6sll-evk.dtb
	arch/arm/boot/dts/imx6sll-kobo-clarahd.dtb
	arch/arm/boot/dts/imx6sll-kobo-librah2o.dtb

tempmon: compatible:0: 'fsl,imx6ul-tempmon' is not one of ['fsl,imx6q-tempmon', 'fsl,imx6sx-tempmon', 'fsl,imx7d-tempmon']
	arch/arm/boot/dts/imx6ul-14x14-evk.dtb
	arch/arm/boot/dts/imx6ul-ccimx6ulsbcexpress.dtb
	arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dtb
	arch/arm/boot/dts/imx6ul-geam.dtb
	arch/arm/boot/dts/imx6ul-isiot-emmc.dtb
	arch/arm/boot/dts/imx6ul-isiot-nand.dtb
	arch/arm/boot/dts/imx6ul-kontron-n6310-s-43.dtb
	arch/arm/boot/dts/imx6ul-kontron-n6310-s.dtb
	arch/arm/boot/dts/imx6ull-14x14-evk.dtb
	arch/arm/boot/dts/imx6ull-colibri-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-iris-v2.dtb
	arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-iris-v2.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-iris-v2.dtb
	arch/arm/boot/dts/imx6ul-liteboard.dtb
	arch/arm/boot/dts/imx6ull-jozacp.dtb
	arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dtb
	arch/arm/boot/dts/imx6ull-opos6uldev.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-ff-rdk-emmc.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-ff-rdk-nand.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-lc-rdk-nand.dtb
	arch/arm/boot/dts/imx6ull-phytec-tauri-emmc.dtb
	arch/arm/boot/dts/imx6ull-phytec-tauri-nand.dtb
	arch/arm/boot/dts/imx6ull-tqma6ull2l-mba6ulx.dtb
	arch/arm/boot/dts/imx6ull-tqma6ull2-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-opos6uldev.dtb
	arch/arm/boot/dts/imx6ul-phytec-segin-ff-rdk-emmc.dtb
	arch/arm/boot/dts/imx6ul-phytec-segin-ff-rdk-nand.dtb
	arch/arm/boot/dts/imx6ul-pico-dwarf.dtb
	arch/arm/boot/dts/imx6ul-pico-hobbit.dtb
	arch/arm/boot/dts/imx6ul-pico-pi.dtb
	arch/arm/boot/dts/imx6ul-prti6g.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul1-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul2l-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul2-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-0010.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-0011.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-mainboard.dtb
	arch/arm/boot/dts/imx6ulz-14x14-evk.dtb
	arch/arm/boot/dts/imx6ulz-bsh-smm-m2.dtb

tempmon: compatible: ['fsl,imx6sx-tempmon', 'fsl,imx6q-tempmon'] is too long
	arch/arm/boot/dts/imx6sx-nitrogen6sx.dtb
	arch/arm/boot/dts/imx6sx-sabreauto.dtb
	arch/arm/boot/dts/imx6sx-sdb.dtb
	arch/arm/boot/dts/imx6sx-sdb-mqs.dtb
	arch/arm/boot/dts/imx6sx-sdb-reva.dtb
	arch/arm/boot/dts/imx6sx-sdb-sai.dtb
	arch/arm/boot/dts/imx6sx-softing-vining-2000.dtb
	arch/arm/boot/dts/imx6sx-udoo-neo-basic.dtb
	arch/arm/boot/dts/imx6sx-udoo-neo-extended.dtb
	arch/arm/boot/dts/imx6sx-udoo-neo-full.dtb

tempmon: compatible: ['fsl,imx6ul-tempmon', 'fsl,imx6sx-tempmon'] is too long
	arch/arm/boot/dts/imx6ul-14x14-evk.dtb
	arch/arm/boot/dts/imx6ul-ccimx6ulsbcexpress.dtb
	arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dtb
	arch/arm/boot/dts/imx6ul-geam.dtb
	arch/arm/boot/dts/imx6ul-isiot-emmc.dtb
	arch/arm/boot/dts/imx6ul-isiot-nand.dtb
	arch/arm/boot/dts/imx6ul-kontron-n6310-s-43.dtb
	arch/arm/boot/dts/imx6ul-kontron-n6310-s.dtb
	arch/arm/boot/dts/imx6ull-14x14-evk.dtb
	arch/arm/boot/dts/imx6ull-colibri-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-emmc-iris-v2.dtb
	arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-iris-v2.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-aster.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-eval-v3.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-iris.dtb
	arch/arm/boot/dts/imx6ull-colibri-wifi-iris-v2.dtb
	arch/arm/boot/dts/imx6ul-liteboard.dtb
	arch/arm/boot/dts/imx6ull-jozacp.dtb
	arch/arm/boot/dts/imx6ull-myir-mys-6ulx-eval.dtb
	arch/arm/boot/dts/imx6ull-opos6uldev.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-ff-rdk-emmc.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-ff-rdk-nand.dtb
	arch/arm/boot/dts/imx6ull-phytec-segin-lc-rdk-nand.dtb
	arch/arm/boot/dts/imx6ull-phytec-tauri-emmc.dtb
	arch/arm/boot/dts/imx6ull-phytec-tauri-nand.dtb
	arch/arm/boot/dts/imx6ull-tqma6ull2l-mba6ulx.dtb
	arch/arm/boot/dts/imx6ull-tqma6ull2-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-opos6uldev.dtb
	arch/arm/boot/dts/imx6ul-phytec-segin-ff-rdk-emmc.dtb
	arch/arm/boot/dts/imx6ul-phytec-segin-ff-rdk-nand.dtb
	arch/arm/boot/dts/imx6ul-pico-dwarf.dtb
	arch/arm/boot/dts/imx6ul-pico-hobbit.dtb
	arch/arm/boot/dts/imx6ul-pico-pi.dtb
	arch/arm/boot/dts/imx6ul-prti6g.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul1-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul2l-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tqma6ul2-mba6ulx.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-0010.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-0011.dtb
	arch/arm/boot/dts/imx6ul-tx6ul-mainboard.dtb
	arch/arm/boot/dts/imx6ulz-14x14-evk.dtb
	arch/arm/boot/dts/imx6ulz-bsh-smm-m2.dtb

tempmon: '#thermal-sensor-cells' does not match any of the regexes: '^(automotive|commercial|extended-commercial|industrial)-thermal$', 'pinctrl-[0-9]+'
	arch/arm/boot/dts/imx6dl-alti6p.dtb
	arch/arm/boot/dts/imx6dl-apf6dev.dtb
	arch/arm/boot/dts/imx6dl-aristainetos2_4.dtb
	arch/arm/boot/dts/imx6dl-aristainetos2_7.dtb
	arch/arm/boot/dts/imx6dl-aristainetos_4.dtb
	arch/arm/boot/dts/imx6dl-aristainetos_7.dtb
	arch/arm/boot/dts/imx6dl-b105pv2.dtb
	arch/arm/boot/dts/imx6dl-b105v2.dtb
	arch/arm/boot/dts/imx6dl-b125pv2.dtb
	arch/arm/boot/dts/imx6dl-b125v2.dtb
	arch/arm/boot/dts/imx6dl-b155v2.dtb
	arch/arm/boot/dts/imx6dl-colibri-aster.dtb
	arch/arm/boot/dts/imx6dl-colibri-eval-v3.dtb
	arch/arm/boot/dts/imx6dl-colibri-iris.dtb
	arch/arm/boot/dts/imx6dl-colibri-iris-v2.dtb
	arch/arm/boot/dts/imx6dl-cubox-i.dtb
	arch/arm/boot/dts/imx6dl-cubox-i-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6dl-cubox-i-som-v15.dtb
	arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dtb
	arch/arm/boot/dts/imx6dl-dhcom-picoitx.dtb
	arch/arm/boot/dts/imx6dl-eckelmann-ci4x10.dtb
	arch/arm/boot/dts/imx6dl-emcon-avari.dtb
	arch/arm/boot/dts/imx6dl-gw51xx.dtb
	arch/arm/boot/dts/imx6dl-gw52xx.dtb
	arch/arm/boot/dts/imx6dl-gw53xx.dtb
	arch/arm/boot/dts/imx6dl-gw54xx.dtb
	arch/arm/boot/dts/imx6dl-gw551x.dtb
	arch/arm/boot/dts/imx6dl-gw552x.dtb
	arch/arm/boot/dts/imx6dl-gw553x.dtb
	arch/arm/boot/dts/imx6dl-gw560x.dtb
	arch/arm/boot/dts/imx6dl-gw5903.dtb
	arch/arm/boot/dts/imx6dl-gw5904.dtb
	arch/arm/boot/dts/imx6dl-gw5907.dtb
	arch/arm/boot/dts/imx6dl-gw5910.dtb
	arch/arm/boot/dts/imx6dl-gw5912.dtb
	arch/arm/boot/dts/imx6dl-gw5913.dtb
	arch/arm/boot/dts/imx6dl-hummingboard2.dtb
	arch/arm/boot/dts/imx6dl-hummingboard2-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6dl-hummingboard2-som-v15.dtb
	arch/arm/boot/dts/imx6dl-hummingboard.dtb
	arch/arm/boot/dts/imx6dl-hummingboard-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6dl-hummingboard-som-v15.dtb
	arch/arm/boot/dts/imx6dl-icore.dtb
	arch/arm/boot/dts/imx6dl-icore-mipi.dtb
	arch/arm/boot/dts/imx6dl-icore-rqs.dtb
	arch/arm/boot/dts/imx6dl-lanmcu.dtb
	arch/arm/boot/dts/imx6dl-mamoj.dtb
	arch/arm/boot/dts/imx6dl-mba6a.dtb
	arch/arm/boot/dts/imx6dl-mba6b.dtb
	arch/arm/boot/dts/imx6dl-nit6xlite.dtb
	arch/arm/boot/dts/imx6dl-nitrogen6x.dtb
	arch/arm/boot/dts/imx6dl-phytec-mira-rdk-nand.dtb
	arch/arm/boot/dts/imx6dl-phytec-pbab01.dtb
	arch/arm/boot/dts/imx6dl-pico-dwarf.dtb
	arch/arm/boot/dts/imx6dl-pico-hobbit.dtb
	arch/arm/boot/dts/imx6dl-pico-nymph.dtb
	arch/arm/boot/dts/imx6dl-pico-pi.dtb
	arch/arm/boot/dts/imx6dl-plybas.dtb
	arch/arm/boot/dts/imx6dl-plym2m.dtb
	arch/arm/boot/dts/imx6dl-prtmvt.dtb
	arch/arm/boot/dts/imx6dl-prtrvt.dtb
	arch/arm/boot/dts/imx6dl-prtvt7.dtb
	arch/arm/boot/dts/imx6dl-rex-basic.dtb
	arch/arm/boot/dts/imx6dl-riotboard.dtb
	arch/arm/boot/dts/imx6dl-sabreauto.dtb
	arch/arm/boot/dts/imx6dl-sabrelite.dtb
	arch/arm/boot/dts/imx6dl-sabresd.dtb
	arch/arm/boot/dts/imx6dl-savageboard.dtb
	arch/arm/boot/dts/imx6dl-skov-revc-lt2.dtb
	arch/arm/boot/dts/imx6dl-skov-revc-lt6.dtb
	arch/arm/boot/dts/imx6dl-solidsense.dtb
	arch/arm/boot/dts/imx6dl-ts4900.dtb
	arch/arm/boot/dts/imx6dl-ts7970.dtb
	arch/arm/boot/dts/imx6dl-tx6dl-comtft.dtb
	arch/arm/boot/dts/imx6dl-tx6s-8034.dtb
	arch/arm/boot/dts/imx6dl-tx6s-8034-mb7.dtb
	arch/arm/boot/dts/imx6dl-tx6s-8035.dtb
	arch/arm/boot/dts/imx6dl-tx6s-8035-mb7.dtb
	arch/arm/boot/dts/imx6dl-tx6u-801x.dtb
	arch/arm/boot/dts/imx6dl-tx6u-8033.dtb
	arch/arm/boot/dts/imx6dl-tx6u-8033-mb7.dtb
	arch/arm/boot/dts/imx6dl-tx6u-80xx-mb7.dtb
	arch/arm/boot/dts/imx6dl-tx6u-811x.dtb
	arch/arm/boot/dts/imx6dl-tx6u-81xx-mb7.dtb
	arch/arm/boot/dts/imx6dl-udoo.dtb
	arch/arm/boot/dts/imx6dl-victgo.dtb
	arch/arm/boot/dts/imx6dl-vicut1.dtb
	arch/arm/boot/dts/imx6dl-wandboard.dtb
	arch/arm/boot/dts/imx6dl-wandboard-revb1.dtb
	arch/arm/boot/dts/imx6dl-wandboard-revd1.dtb
	arch/arm/boot/dts/imx6dl-yapp4-draco.dtb
	arch/arm/boot/dts/imx6dl-yapp4-hydra.dtb
	arch/arm/boot/dts/imx6dl-yapp4-orion.dtb
	arch/arm/boot/dts/imx6dl-yapp4-ursa.dtb
	arch/arm/boot/dts/imx6q-apalis-eval.dtb
	arch/arm/boot/dts/imx6q-apalis-ixora.dtb
	arch/arm/boot/dts/imx6q-apalis-ixora-v1.1.dtb
	arch/arm/boot/dts/imx6q-apf6dev.dtb
	arch/arm/boot/dts/imx6q-arm2.dtb
	arch/arm/boot/dts/imx6q-b450v3.dtb
	arch/arm/boot/dts/imx6q-b650v3.dtb
	arch/arm/boot/dts/imx6q-b850v3.dtb
	arch/arm/boot/dts/imx6q-bosch-acc.dtb
	arch/arm/boot/dts/imx6q-cm-fx6.dtb
	arch/arm/boot/dts/imx6q-cubox-i.dtb
	arch/arm/boot/dts/imx6q-cubox-i-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6q-cubox-i-som-v15.dtb
	arch/arm/boot/dts/imx6q-dfi-fs700-m60.dtb
	arch/arm/boot/dts/imx6q-dhcom-pdk2.dtb
	arch/arm/boot/dts/imx6q-display5-tianma-tm070-1280x768.dtb
	arch/arm/boot/dts/imx6q-dmo-edmqmx6.dtb
	arch/arm/boot/dts/imx6q-dms-ba16.dtb
	arch/arm/boot/dts/imx6q-ds.dtb
	arch/arm/boot/dts/imx6q-emcon-avari.dtb
	arch/arm/boot/dts/imx6q-evi.dtb
	arch/arm/boot/dts/imx6q-gk802.dtb
	arch/arm/boot/dts/imx6q-gw51xx.dtb
	arch/arm/boot/dts/imx6q-gw52xx.dtb
	arch/arm/boot/dts/imx6q-gw53xx.dtb
	arch/arm/boot/dts/imx6q-gw5400-a.dtb
	arch/arm/boot/dts/imx6q-gw54xx.dtb
	arch/arm/boot/dts/imx6q-gw551x.dtb
	arch/arm/boot/dts/imx6q-gw552x.dtb
	arch/arm/boot/dts/imx6q-gw553x.dtb
	arch/arm/boot/dts/imx6q-gw560x.dtb
	arch/arm/boot/dts/imx6q-gw5903.dtb
	arch/arm/boot/dts/imx6q-gw5904.dtb
	arch/arm/boot/dts/imx6q-gw5907.dtb
	arch/arm/boot/dts/imx6q-gw5910.dtb
	arch/arm/boot/dts/imx6q-gw5912.dtb
	arch/arm/boot/dts/imx6q-gw5913.dtb
	arch/arm/boot/dts/imx6q-h100.dtb
	arch/arm/boot/dts/imx6q-hummingboard2.dtb
	arch/arm/boot/dts/imx6q-hummingboard2-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6q-hummingboard2-som-v15.dtb
	arch/arm/boot/dts/imx6q-hummingboard.dtb
	arch/arm/boot/dts/imx6q-hummingboard-emmc-som-v15.dtb
	arch/arm/boot/dts/imx6q-hummingboard-som-v15.dtb
	arch/arm/boot/dts/imx6q-icore.dtb
	arch/arm/boot/dts/imx6q-icore-mipi.dtb
	arch/arm/boot/dts/imx6q-icore-ofcap10.dtb
	arch/arm/boot/dts/imx6q-icore-ofcap12.dtb
	arch/arm/boot/dts/imx6q-icore-rqs.dtb
	arch/arm/boot/dts/imx6q-kp-tpc.dtb
	arch/arm/boot/dts/imx6q-logicpd.dtb
	arch/arm/boot/dts/imx6q-marsboard.dtb
	arch/arm/boot/dts/imx6q-mba6a.dtb
	arch/arm/boot/dts/imx6q-mba6b.dtb
	arch/arm/boot/dts/imx6q-mccmon6.dtb
	arch/arm/boot/dts/imx6q-nitrogen6_max.dtb
	arch/arm/boot/dts/imx6q-nitrogen6_som2.dtb
	arch/arm/boot/dts/imx6q-nitrogen6x.dtb
	arch/arm/boot/dts/imx6q-novena.dtb
	arch/arm/boot/dts/imx6q-phytec-mira-rdk-emmc.dtb
	arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dtb
	arch/arm/boot/dts/imx6q-phytec-pbab01.dtb
	arch/arm/boot/dts/imx6q-pico-dwarf.dtb
	arch/arm/boot/dts/imx6q-pico-hobbit.dtb
	arch/arm/boot/dts/imx6q-pico-nymph.dtb
	arch/arm/boot/dts/imx6q-pico-pi.dtb
	arch/arm/boot/dts/imx6q-pistachio.dtb
	arch/arm/boot/dts/imx6qp-mba6b.dtb
	arch/arm/boot/dts/imx6qp-nitrogen6_max.dtb
	arch/arm/boot/dts/imx6qp-nitrogen6_som2.dtb
	arch/arm/boot/dts/imx6qp-phytec-mira-rdk-nand.dtb
	arch/arm/boot/dts/imx6qp-prtwd3.dtb
	arch/arm/boot/dts/imx6q-prti6q.dtb
	arch/arm/boot/dts/imx6q-prtwd2.dtb
	arch/arm/boot/dts/imx6qp-sabreauto.dtb
	arch/arm/boot/dts/imx6qp-sabresd.dtb
	arch/arm/boot/dts/imx6qp-tx6qp-8037.dtb
	arch/arm/boot/dts/imx6qp-tx6qp-8037-mb7.dtb
	arch/arm/boot/dts/imx6qp-tx6qp-8137.dtb
	arch/arm/boot/dts/imx6qp-tx6qp-8137-mb7.dtb
	arch/arm/boot/dts/imx6qp-vicutp.dtb
	arch/arm/boot/dts/imx6qp-wandboard-revd1.dtb
	arch/arm/boot/dts/imx6qp-yapp4-crux-plus.dtb
	arch/arm/boot/dts/imx6qp-zii-rdu2.dtb
	arch/arm/boot/dts/imx6q-rex-pro.dtb
	arch/arm/boot/dts/imx6q-sabreauto.dtb
	arch/arm/boot/dts/imx6q-sabrelite.dtb
	arch/arm/boot/dts/imx6q-sabresd.dtb
	arch/arm/boot/dts/imx6q-savageboard.dtb
	arch/arm/boot/dts/imx6q-sbc6x.dtb
	arch/arm/boot/dts/imx6q-skov-revc-lt2.dtb
	arch/arm/boot/dts/imx6q-skov-revc-lt6.dtb
	arch/arm/boot/dts/imx6q-skov-reve-mi1010ait-1cp1.dtb
	arch/arm/boot/dts/imx6q-solidsense.dtb
	arch/arm/boot/dts/imx6q-tbs2910.dtb
	arch/arm/boot/dts/imx6q-ts4900.dtb
	arch/arm/boot/dts/imx6q-ts7970.dtb
	arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dtb
	arch/arm/boot/dts/imx6q-tx6q-1010.dtb
	arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dtb
	arch/arm/boot/dts/imx6q-tx6q-1020.dtb
	arch/arm/boot/dts/imx6q-tx6q-1036.dtb
	arch/arm/boot/dts/imx6q-tx6q-1036-mb7.dtb
	arch/arm/boot/dts/imx6q-tx6q-10x0-mb7.dtb
	arch/arm/boot/dts/imx6q-tx6q-1110.dtb
	arch/arm/boot/dts/imx6q-tx6q-11x0-mb7.dtb
	arch/arm/boot/dts/imx6q-udoo.dtb
	arch/arm/boot/dts/imx6q-utilite-pro.dtb
	arch/arm/boot/dts/imx6q-var-dt6customboard.dtb
	arch/arm/boot/dts/imx6q-vicut1.dtb
	arch/arm/boot/dts/imx6q-wandboard.dtb
	arch/arm/boot/dts/imx6q-wandboard-revb1.dtb
	arch/arm/boot/dts/imx6q-wandboard-revd1.dtb
	arch/arm/boot/dts/imx6q-yapp4-crux.dtb
	arch/arm/boot/dts/imx6q-zii-rdu2.dtb
	arch/arm/boot/dts/imx6s-dhcom-drc02.dtb


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

* Re: [PATCH v1 2/9] thermal: thermal: Export OF trip helper function
  2022-06-15  9:47 ` [PATCH v1 2/9] thermal: thermal: Export OF trip helper function Francesco Dolcini
@ 2022-06-15 19:24   ` kernel test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2022-06-15 19:24 UTC (permalink / raw)
  To: Francesco Dolcini, Daniel Lezcano, Rob Herring,
	Rafael J. Wysocki, Krzysztof Kozlowski, Shawn Guo, Marco Felsch,
	Anson Huang
  Cc: kbuild-all, Francesco Dolcini, Amit Kucheria, Zhang Rui,
	linux-pm, devicetree, Pengutronix Kernel Team, Sascha Hauer,
	Fabio Estevam, NXP Linux Team, linux-arm-kernel

Hi Francesco,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on rafael-pm/thermal krzk/for-next krzk-mem-ctrl/for-next v5.19-rc2 next-20220615]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Francesco-Dolcini/imx-thermal-Allow-trip-point-configuration-from-DT/20220615-175857
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20220616/202206160331.en1dbvYm-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/e68c5a0d2b91a47a9df63a6309c0ed9e905fc20a
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Francesco-Dolcini/imx-thermal-Allow-trip-point-configuration-from-DT/20220615-175857
        git checkout e68c5a0d2b91a47a9df63a6309c0ed9e905fc20a
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/thermal/thermal_core.c:27:
   drivers/thermal/thermal_core.h: In function 'thermal_of_populate_trip':
>> drivers/thermal/thermal_core.h:179:17: error: 'ENOTSUP' undeclared (first use in this function); did you mean 'ENOTSUPP'?
     179 |         return -ENOTSUP;
         |                 ^~~~~~~
         |                 ENOTSUPP
   drivers/thermal/thermal_core.h:179:17: note: each undeclared identifier is reported only once for each function it appears in


vim +179 drivers/thermal/thermal_core.h

   150	
   151	/* device tree support */
   152	#ifdef CONFIG_THERMAL_OF
   153	int of_parse_thermal_zones(void);
   154	int of_thermal_get_ntrips(struct thermal_zone_device *);
   155	bool of_thermal_is_trip_valid(struct thermal_zone_device *, int);
   156	const struct thermal_trip *
   157	of_thermal_get_trip_points(struct thermal_zone_device *);
   158	int thermal_of_populate_trip(struct device_node *np,
   159				     struct thermal_trip *trip);
   160	#else
   161	static inline int of_parse_thermal_zones(void) { return 0; }
   162	static inline int of_thermal_get_ntrips(struct thermal_zone_device *tz)
   163	{
   164		return 0;
   165	}
   166	static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz,
   167						    int trip)
   168	{
   169		return false;
   170	}
   171	static inline const struct thermal_trip *
   172	of_thermal_get_trip_points(struct thermal_zone_device *tz)
   173	{
   174		return NULL;
   175	}
   176	static inline int thermal_of_populate_trip(struct device_node *np,
   177						   struct thermal_trip *trip)
   178	{
 > 179		return -ENOTSUP;
   180	}
   181	#endif
   182	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-06-15 19:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15  9:47 [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Francesco Dolcini
2022-06-15  9:47 ` [PATCH v1 1/9] dt-bindings: thermal: Define trips node in $defs Francesco Dolcini
2022-06-15  9:47 ` [PATCH v1 2/9] thermal: thermal: Export OF trip helper function Francesco Dolcini
2022-06-15 19:24   ` kernel test robot
2022-06-15  9:47 ` [PATCH v1 3/9] dt-bindings: thermal: imx: Add trips point Francesco Dolcini
2022-06-15 13:16   ` Rob Herring
2022-06-15  9:47 ` [PATCH v1 4/9] imx: thermal: Configure trip point from DT Francesco Dolcini
2022-06-15 10:39   ` Marco Felsch
2022-06-15 13:04     ` Francesco Dolcini
2022-06-15  9:48 ` [PATCH v1 5/9] ARM: dts: imx[67]: Add trips points Francesco Dolcini
2022-06-15  9:48 ` [PATCH v1 6/9] ARM: dts: imx6qdl-apalis: Set CPU critical trip point Francesco Dolcini
2022-06-15  9:48 ` [PATCH v1 7/9] ARM: dts: imx7-colibri: " Francesco Dolcini
2022-06-15  9:48 ` [PATCH v1 8/9] ARM: dts: imx6ull-colibri: " Francesco Dolcini
2022-06-15  9:48 ` [PATCH v1 9/9] ARM: dts: imx6qdl-colibri: " Francesco Dolcini
2022-06-15 10:42 ` [PATCH v1 0/9] imx: thermal: Allow trip point configuration from DT Marco Felsch

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