linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: Switch mode to enabled once the cooling device is bound
@ 2015-06-25 12:50 Keerthy
  2015-06-25 17:35 ` Nishanth Menon
  2015-06-26 11:17 ` Javi Merino
  0 siblings, 2 replies; 4+ messages in thread
From: Keerthy @ 2015-06-25 12:50 UTC (permalink / raw)
  To: edubezval; +Cc: linux-omap, rui.zhang, t-kristo, j-keerthy, linux-pm

Currently mode is still disabled even after the cooling device is bound
to the appropriate device. Hence changing the mode to enabled as soon as
the cooling device is registered successfully.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 drivers/thermal/of-thermal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 04b1be7..bc84485 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -163,6 +163,9 @@ static int of_thermal_bind(struct thermal_zone_device *thermal,
 		}
 	}
 
+	/* Now that cooling device is bound enable the thermal device*/
+	data->mode = THERMAL_DEVICE_ENABLED;
+
 	return 0;
 }
 
-- 
1.9.1


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

* Re: [PATCH] thermal: Switch mode to enabled once the cooling device is bound
  2015-06-25 12:50 [PATCH] thermal: Switch mode to enabled once the cooling device is bound Keerthy
@ 2015-06-25 17:35 ` Nishanth Menon
  2015-06-26 11:17 ` Javi Merino
  1 sibling, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2015-06-25 17:35 UTC (permalink / raw)
  To: Keerthy, edubezval
  Cc: linux-omap, rui.zhang, t-kristo, linux-pm, Ravikumar Kattekola

On 06/25/2015 07:50 AM, Keerthy wrote:
> Currently mode is still disabled even after the cooling device is bound
> to the appropriate device. Hence changing the mode to enabled as soon as
> the cooling device is registered successfully.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  drivers/thermal/of-thermal.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 04b1be7..bc84485 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -163,6 +163,9 @@ static int of_thermal_bind(struct thermal_zone_device *thermal,
>  		}
>  	}
>  
> +	/* Now that cooling device is bound enable the thermal device*/
> +	data->mode = THERMAL_DEVICE_ENABLED;
> +
>  	return 0;
>  }
>  
> 
This makes sense to me rather than waiting for userspace to enable the
zone -(by which time we might have hit catastrophic thermal events
which may have been prevented if we had the zones enabled and cooling
devices functional.

-- 
Regards,
Nishanth Menon

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

* Re: [PATCH] thermal: Switch mode to enabled once the cooling device is bound
  2015-06-25 12:50 [PATCH] thermal: Switch mode to enabled once the cooling device is bound Keerthy
  2015-06-25 17:35 ` Nishanth Menon
@ 2015-06-26 11:17 ` Javi Merino
  2015-06-26 11:49   ` Keerthy
  1 sibling, 1 reply; 4+ messages in thread
From: Javi Merino @ 2015-06-26 11:17 UTC (permalink / raw)
  To: Keerthy
  Cc: edubezval@gmail.com, linux-omap@vger.kernel.org,
	rui.zhang@intel.com, t-kristo@ti.com, linux-pm@vger.kernel.org,
	Lukasz Majewski

On Thu, Jun 25, 2015 at 01:50:35PM +0100, Keerthy wrote:
> Currently mode is still disabled even after the cooling device is bound
> to the appropriate device. Hence changing the mode to enabled as soon as
> the cooling device is registered successfully.

This should have been fixed by 528012c1f437 ("thermal: of: Enable
thermal_zoneX when sensor is correctly added"), which was merged in
4.0.  With this, the thermal zone is enabled when it is registered.
Can you elaborate on why is this needed?

Cheers,
Javi

> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  drivers/thermal/of-thermal.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 04b1be7..bc84485 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -163,6 +163,9 @@ static int of_thermal_bind(struct thermal_zone_device *thermal,
>  		}
>  	}
>  
> +	/* Now that cooling device is bound enable the thermal device*/
> +	data->mode = THERMAL_DEVICE_ENABLED;
> +
>  	return 0;
>  }
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH] thermal: Switch mode to enabled once the cooling device is bound
  2015-06-26 11:17 ` Javi Merino
@ 2015-06-26 11:49   ` Keerthy
  0 siblings, 0 replies; 4+ messages in thread
From: Keerthy @ 2015-06-26 11:49 UTC (permalink / raw)
  To: Javi Merino, Keerthy
  Cc: edubezval@gmail.com, linux-omap@vger.kernel.org,
	rui.zhang@intel.com, t-kristo@ti.com, linux-pm@vger.kernel.org,
	Lukasz Majewski



On Friday 26 June 2015 04:47 PM, Javi Merino wrote:
> On Thu, Jun 25, 2015 at 01:50:35PM +0100, Keerthy wrote:
>> Currently mode is still disabled even after the cooling device is bound
>> to the appropriate device. Hence changing the mode to enabled as soon as
>> the cooling device is registered successfully.
>
> This should have been fixed by 528012c1f437 ("thermal: of: Enable
> thermal_zoneX when sensor is correctly added"), which was merged in
> 4.0.  With this, the thermal zone is enabled when it is registered.
> Can you elaborate on why is this needed?

Thanks for pointing out. This takes care of enabling by default.

Cheers,
Keerthy
>
> Cheers,
> Javi
>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>   drivers/thermal/of-thermal.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
>> index 04b1be7..bc84485 100644
>> --- a/drivers/thermal/of-thermal.c
>> +++ b/drivers/thermal/of-thermal.c
>> @@ -163,6 +163,9 @@ static int of_thermal_bind(struct thermal_zone_device *thermal,
>>   		}
>>   	}
>>
>> +	/* Now that cooling device is bound enable the thermal device*/
>> +	data->mode = THERMAL_DEVICE_ENABLED;
>> +
>>   	return 0;
>>   }
>>
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

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

end of thread, other threads:[~2015-06-26 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 12:50 [PATCH] thermal: Switch mode to enabled once the cooling device is bound Keerthy
2015-06-25 17:35 ` Nishanth Menon
2015-06-26 11:17 ` Javi Merino
2015-06-26 11:49   ` Keerthy

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