Skip to contentSkip to conversation

Revert "thermal/core: Deprecate changing cooling device state from userspace"

PATCH In review Daniel Lezcano 2 participants 3 messages Apr 22, 2022 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "thermal/core: Deprecate changing cooling device state from userspace"

This reverts commit a67a46af4ad6342378e332b7420c1d1a2818c53f.

It has been reported the warning is annoying as the cooling device state is still needed on some production system.

Meanwhile we provide a way to consolidate the thermal framework to prevent multiple actors acting on the cooling devices with conflicting decisions, let's revert this warning.

---
 drivers/thermal/thermal_sysfs.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/thermal/thermal_sysfs.c +0 -3
index f154bada2906..1c4aac8464a7 100644
@@ -610,9 +610,6 @@ cur_state_store(struct device *dev, struct device_attribute *attr,
 	unsigned long state;
 	int result;
 
-	dev_warn_once(&cdev->device,
-		      "Setting cooling device state is deprecated\n");
-	
 	if (sscanf(buf, "%ld\n", &state) != 1)
 		return -EINVAL;
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 thermal/governor: Remove deprecated information

The userspace governor is still on different production system and the deprecating warning is scary.

Even if we want to get rid of the userspace governor, it is too soon yet as the alternatives are not yet adopted.

Change the deprecated warning by an information message suggesting to switch to the netlink thermal events.

---
 drivers/thermal/Kconfig          | 6 ++++--
 drivers/thermal/gov_user_space.c | 3 +--
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/thermal/Kconfig +4 -2
index e37691e0bf20..0e5cc948373c 100644
@@ -113,8 +113,10 @@ config THERMAL_DEFAULT_GOV_USER_SPACE
 	bool "user_space"
 	select THERMAL_GOV_USER_SPACE
 	help
-	  Select this if you want to let the user space manage the
-	  platform thermals.
+	  The Userspace governor allows to get trip point crossed
+	  notification from the kernel via uevents. It is recommended
+	  to use the netlink interface instead which gives richer
+	  information about the thermal framework events.
 
 config THERMAL_DEFAULT_GOV_POWER_ALLOCATOR
 	bool "power_allocator"
drivers/thermal/gov_user_space.c +1 -2
index 64a18e354a20..72c90486b46d 100644
@@ -17,8 +17,7 @@
 
 static int user_space_bind(struct thermal_zone_device *tz)
 {
-	pr_warn_once("Userspace governor deprecated: use thermal netlink " \
-		     "notification instead\n");
+	pr_info_once("Consider using the netlink events interface\n");
 
 	return 0;
 }
Signature · 1 line
2.25.1
#2 lore raw
In reply to Daniel Lezcano
Quoted 20 lines · Daniel Lezcano

This reverts commit a67a46af4ad6342378e332b7420c1d1a2818c53f.

It has been reported the warning is annoying as the cooling device state is still needed on some production system.

Meanwhile we provide a way to consolidate the thermal framework to prevent multiple actors acting on the cooling devices with conflicting decisions, let's revert this warning.

---
 drivers/thermal/thermal_sysfs.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/thermal/thermal_sysfs.c +0 -0
index f154bada2906..1c4aac8464a7 100644

drivers/thermal/thermal_sysfs.c cur_state_store(struct device *dev, struct device_attribute *attr,

Quoted 10 lines
drivers/thermal/thermal_sysfs.c +0 -4
@@ -610,9 +610,6 @@ cur_state_store(struct device *dev, struct device_attribute *attr,
        unsigned long state;
        int result;
 
-       dev_warn_once(&cdev->device,
-                     "Setting cooling device state is deprecated\n");
-
        if (sscanf(buf, "%ld\n", &state) != 1)
                return -EINVAL;
 
--

Applied along with the [2/2] as 5.18-rc material, thanks!