Skip to contentSkip to conversation

Thermal: Allow first update of cooling device state

PATCH Applied Wei Ni 2 participants 3 messages Feb 17, 2014 – Feb 27, 2014 Thermal

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

PATCH 1/1 Thermal: Allow first update of cooling device state

In initialization, if the cooling device is initialized at max cooling state, and the thermal zone temperature is below the first trip point, then the cooling state can't be updated to the right state, untill the first trip point be triggered.

To fix this issue, allow first update of cooling device state during registration, initialized "updated" device field as "false" (instead of "true").

---
 drivers/thermal/thermal_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_core.c +1 -1
index 338a88b..02f57af 100644
@@ -1107,7 +1107,7 @@ __thermal_cooling_device_register(struct device_node *np,
 	INIT_LIST_HEAD(&cdev->thermal_instances);
 	cdev->np = np;
 	cdev->ops = ops;
-	cdev->updated = true;
+	cdev->updated = false;
 	cdev->device.class = &thermal_class;
 	cdev->devdata = devdata;
 	dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
Signature · 1 line
1.7.9.5
author
#1 lore raw

Hi, Rui
Do you have any comment for it ?

Thanks.
Wei.

Quoted 28 lines · Wei Ni

In initialization, if the cooling device is initialized at max cooling state, and the thermal zone temperature is below the first trip point, then the cooling state can't be updated to the right state, untill the first trip point be triggered.

To fix this issue, allow first update of cooling device state during registration, initialized "updated" device field as "false" (instead of "true").

---
 drivers/thermal/thermal_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_core.c +1 -1
index 338a88b..02f57af 100644
@@ -1107,7 +1107,7 @@ __thermal_cooling_device_register(struct device_node *np,
 	INIT_LIST_HEAD(&cdev->thermal_instances);
 	cdev->np = np;
 	cdev->ops = ops;
-	cdev->updated = true;
+	cdev->updated = false;
 	cdev->device.class = &thermal_class;
 	cdev->devdata = devdata;
 	dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
reviewer Applied
#2 lore raw
In reply to Wei Ni
Quoted 10 lines · Wei Ni

In initialization, if the cooling device is initialized at max cooling state, and the thermal zone temperature is below the first trip point, then the cooling state can't be updated to the right state, untill the first trip point be triggered.

To fix this issue, allow first update of cooling device state during registration, initialized "updated" device field as "false" (instead of "true").

applied.

thanks,
rui

Quoted 17 lines
---
 drivers/thermal/thermal_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_core.c +1 -1
index 338a88b..02f57af 100644
@@ -1107,7 +1107,7 @@ __thermal_cooling_device_register(struct device_node *np,
 	INIT_LIST_HEAD(&cdev->thermal_instances);
 	cdev->np = np;
 	cdev->ops = ops;
-	cdev->updated = true;
+	cdev->updated = false;
 	cdev->device.class = &thermal_class;
 	cdev->devdata = devdata;
 	dev_set_name(&cdev->device, "cooling_device%d", cdev->id);