linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: Fix binding problem when there is thermal zone params
@ 2013-10-18 10:03 Wei Ni
  2013-11-06  5:29 ` Zhang Rui
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Ni @ 2013-10-18 10:03 UTC (permalink / raw)
  To: rui.zhang-ral2JQCrhuEAvxtiuMwx3w,
	durgadoss.r-ral2JQCrhuEAvxtiuMwx3w
  Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Wei Ni, Jinyoung Park

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.

Signed-off-by: Wei Ni <wni-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jinyoung Park <jinyoungp-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/thermal/thermal_core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4962a6a..2ea41d3 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -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)
-- 
1.7.9.5

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

* Re: [PATCH] thermal: Fix binding problem when there is thermal zone params
  2013-10-18 10:03 [PATCH] thermal: Fix binding problem when there is thermal zone params Wei Ni
@ 2013-11-06  5:29 ` Zhang Rui
  2013-11-06  6:04   ` Wei Ni
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Rui @ 2013-11-06  5:29 UTC (permalink / raw)
  To: Wei Ni; +Cc: durgadoss.r, linux-pm, linux-kernel, linux-tegra, Jinyoung Park

On Fri, 2013-10-18 at 18:03 +0800, Wei Ni wrote:
> 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.
> 
> Signed-off-by: Wei Ni <wni@nvidia.com>
> Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
> ---
>  drivers/thermal/thermal_core.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 4962a6a..2ea41d3 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -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
> @@ -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)



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

* Re: [PATCH] thermal: Fix binding problem when there is thermal zone params
  2013-11-06  5:29 ` Zhang Rui
@ 2013-11-06  6:04   ` Wei Ni
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Ni @ 2013-11-06  6:04 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin
  Cc: durgadoss.r-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jinyoung Park

On 11/06/2013 01:29 PM, Zhang Rui wrote:
> On Fri, 2013-10-18 at 18:03 +0800, Wei Ni wrote:
>> @@ -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?

Oh, yes, you are right. I will add it.

> 
> thanks,
> rui
>> @@ -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)
> 
> 

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

end of thread, other threads:[~2013-11-06  6:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 10:03 [PATCH] thermal: Fix binding problem when there is thermal zone params Wei Ni
2013-11-06  5:29 ` Zhang Rui
2013-11-06  6:04   ` Wei Ni

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