All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] staging: ti-soc-thermal: remove external heat while extrapolating hotspot
Date: Mon, 25 Mar 2013 07:18:36 -0400	[thread overview]
Message-ID: <5150328C.80303@ti.com> (raw)
In-Reply-To: <1364192605.2465.18.camel@rzhang1-mobl4>

On 25-03-2013 02:23, Zhang Rui wrote:
> On Fri, 2013-03-22 at 17:13 -0400, Eduardo Valentin wrote:
>> For boards that provide a PCB sensor close to SoC junction
>> temperature, it is possible to remove the cumulative heat
>> reported by the SoC temperature sensor.
>>
>> This patch changes the extrapolation computation to consider
>> an external sensor in the extrapolation equations.
>>
>> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
>> ---
>>   drivers/staging/ti-soc-thermal/ti-thermal-common.c |    5 ++---
>>   1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/ti-soc-thermal/ti-thermal-common.c b/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> index 231c549..52d3c1b 100644
>> --- a/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> +++ b/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> @@ -92,10 +92,9 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
>>   	if (ret)
>>   		return ret;
>>
>> -	pcb_temp = 0;
>> -	/* TODO: Introduce pcb temperature lookup */
>> +	ret = thermal_zone_lookup_temperature("pcb", &pcb_temp);
>>   	/* In case pcb zone is available, use the extrapolation rule with it */
>> -	if (pcb_temp) {
>> +	if (!ret) {
>>   		tmp -= pcb_temp;
>>   		slope = s->slope_pcb;
>>   		constant = s->constant_pcb;
>
> I can not see this piece of code.
> But I assume that the thermal_zone_device is registered in another
> driver, right?

It is because I made this patch based on staging-next. But you will find 
the same under drivers/stating/omap-thermal/omap-bandgap.c


Yes. The sensor managed by another driver. And the temperature lookup is 
assumed to be done by the fw.

> or else you can use the thermal_zone_device pointer directly instead.
>

I'd not recommend this because of the above statements

> thanks,
> rui
>
>
>

WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Zhang Rui <rui.zhang@intel.com>
Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: ti-soc-thermal: remove external heat while extrapolating hotspot
Date: Mon, 25 Mar 2013 07:18:36 -0400	[thread overview]
Message-ID: <5150328C.80303@ti.com> (raw)
In-Reply-To: <1364192605.2465.18.camel@rzhang1-mobl4>

On 25-03-2013 02:23, Zhang Rui wrote:
> On Fri, 2013-03-22 at 17:13 -0400, Eduardo Valentin wrote:
>> For boards that provide a PCB sensor close to SoC junction
>> temperature, it is possible to remove the cumulative heat
>> reported by the SoC temperature sensor.
>>
>> This patch changes the extrapolation computation to consider
>> an external sensor in the extrapolation equations.
>>
>> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
>> ---
>>   drivers/staging/ti-soc-thermal/ti-thermal-common.c |    5 ++---
>>   1 files changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/ti-soc-thermal/ti-thermal-common.c b/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> index 231c549..52d3c1b 100644
>> --- a/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> +++ b/drivers/staging/ti-soc-thermal/ti-thermal-common.c
>> @@ -92,10 +92,9 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
>>   	if (ret)
>>   		return ret;
>>
>> -	pcb_temp = 0;
>> -	/* TODO: Introduce pcb temperature lookup */
>> +	ret = thermal_zone_lookup_temperature("pcb", &pcb_temp);
>>   	/* In case pcb zone is available, use the extrapolation rule with it */
>> -	if (pcb_temp) {
>> +	if (!ret) {
>>   		tmp -= pcb_temp;
>>   		slope = s->slope_pcb;
>>   		constant = s->constant_pcb;
>
> I can not see this piece of code.
> But I assume that the thermal_zone_device is registered in another
> driver, right?

It is because I made this patch based on staging-next. But you will find 
the same under drivers/stating/omap-thermal/omap-bandgap.c


Yes. The sensor managed by another driver. And the temperature lookup is 
assumed to be done by the fw.

> or else you can use the thermal_zone_device pointer directly instead.
>

I'd not recommend this because of the above statements

> thanks,
> rui
>
>
>


  reply	other threads:[~2013-03-25 11:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 21:13 [PATCH 0/2] thermal: lookup temperature Eduardo Valentin
2013-03-22 21:13 ` Eduardo Valentin
2013-03-22 21:13 ` [PATCH 1/2] thermal: introduce thermal_zone_lookup_temperature helper function Eduardo Valentin
2013-03-22 21:13   ` Eduardo Valentin
2013-03-25  6:10   ` Zhang Rui
2013-03-25  6:20     ` R, Durgadoss
2013-03-25  6:20       ` R, Durgadoss
2013-03-25  6:26       ` Zhang Rui
2013-03-25 11:25         ` Eduardo Valentin
2013-03-22 21:13 ` [PATCH 2/2] staging: ti-soc-thermal: remove external heat while extrapolating hotspot Eduardo Valentin
2013-03-22 21:13   ` Eduardo Valentin
2013-03-25  6:23   ` Zhang Rui
2013-03-25 11:18     ` Eduardo Valentin [this message]
2013-03-25 11:18       ` Eduardo Valentin
  -- strict thread matches above, loose matches on Subject: below --
2013-04-24 18:16 [PATCH 0/2] staging: ti-soc-thermal: couple of fixes Eduardo Valentin
2013-04-24 18:16 ` [PATCH 2/2] staging: ti-soc-thermal: remove external heat while extrapolating hotspot Eduardo Valentin
2013-04-24 18:16   ` Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5150328C.80303@ti.com \
    --to=eduardo.valentin@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.