thermal: Fix binding problem when there is thermal zone params
Subsystems (2)
PATCH 1/1 thermal: Fix binding problem when there is thermal zone params
The thermal zone params can be used to set governor to specific thermal governor for thermal zone device. But if the thermal zone params has only governor name without thermal bind params, then the thermal zone device will not be binding to cooling device. Because tz->ops->bind operator is not invoked in bind_tz() and bind_cdev() when there is thermal zone params.
--- drivers/thermal/thermal_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/thermal/thermal_core.c +3 -3
@@ -247,7 +247,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)if (!pos->tzp && !pos->ops->bind)continue ; -if (!pos->tzp && pos->ops->bind) { +if (pos->ops->bind) { ret = pos->ops->bind (pos, cdev);if (ret)print_bind_err_msg (pos, cdev, ret);
@@ -282,8 +282,8 @@ static void bind_tz(struct thermal_zone_device *tz)mutex_lock (&thermal_list_lock); -/* If there is no platform data, try to use ops->bind */ -if (!tzp && tz->ops->bind) { +/* If there is ops->bind, try to use ops->bind */ +if (tz->ops->bind) {list_for_each_entry (pos, &thermal_cdev_list, node) { ret = tz->ops->bind (tz, pos);if (ret)
Signature · 1 line
1.7.9.5
Zhang Rui
reviewerQuoted 19 lines · Wei Ni
The thermal zone params can be used to set governor to specific thermal governor for thermal zone device. But if the thermal zone params has only governor name without thermal bind params, then the thermal zone device will not be binding to cooling device. Because
tz->ops->bindoperator is not invoked inbind_tz()andbind_cdev()when there is thermal zone params.Signed-off-by Wei Ni <[email protected]>Signed-off-by Jinyoung Park <[email protected]>--- drivers/thermal/thermal_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/thermal/thermal_core.c +0
-0
drivers/thermal/thermal_core.c static void bind_cdev(struct thermal_cooling_device *cdev) · line 253
Quoted 8 lines
drivers/thermal/thermal_core.c +1
-1@@ -247,7 +247,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)if (!pos->tzp && !pos->ops->bind)continue ; -if (!pos->tzp && pos->ops->bind) { +if (pos->ops->bind) { ret = pos->ops->bind (pos, cdev);if (ret)print_bind_err_msg (pos, cdev, ret);
IMO, we should also add
+ continue;
after binding with pos->ops->bind(), to void binding via pos->tzp->tbp again, no?
thanks,
rui
Quoted 11 lines
drivers/thermal/thermal_core.c +2
-2@@ -282,8 +282,8 @@ static void bind_tz(struct thermal_zone_device *tz)mutex_lock (&thermal_list_lock); -/* If there is no platform data, try to use ops->bind */ -if (!tzp && tz->ops->bind) { +/* If there is ops->bind, try to use ops->bind */ +if (tz->ops->bind) {list_for_each_entry (pos, &thermal_cdev_list, node) { ret = tz->ops->bind (tz, pos);if (ret)
Quoted 12 lines · Zhang Rui
drivers/thermal/thermal_core.c static void bind_cdev(struct thermal_cooling_device *cdev) · line 253
Quoted 9 lines · Wei Ni
drivers/thermal/thermal_core.c +1
-1@@ -247,7 +247,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)if (!pos->tzp && !pos->ops->bind)continue ; -if (!pos->tzp && pos->ops->bind) { +if (pos->ops->bind) { ret = pos->ops->bind (pos, cdev);if (ret)print_bind_err_msg (pos, cdev, ret);IMO, we should also add
(quoted diff) +1
-0+ continue;
Quoted 2 lines
after binding with
pos->ops->bind(), to void binding viapos->tzp->tbpagain, no?
Oh, yes, you are right. I will add it.
Quoted 16 lines
thanks,
ruiQuoted 11 lines
drivers/thermal/thermal_core.c +2
-2@@ -282,8 +282,8 @@ static void bind_tz(struct thermal_zone_device *tz)mutex_lock (&thermal_list_lock); -/* If there is no platform data, try to use ops->bind */ -if (!tzp && tz->ops->bind) { +/* If there is ops->bind, try to use ops->bind */ +if (tz->ops->bind) {list_for_each_entry (pos, &thermal_cdev_list, node) { ret = tz->ops->bind (tz, pos);if (ret)