diff mbox

[2/4] Fix G5 thermal shutdown

Message ID 20100205135216.GH12001@hansolo.jdub.homelinux.org (mailing list archive)
State Accepted, archived
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Josh Boyer Feb. 5, 2010, 1:52 p.m. UTC
This changes the thresholds for the liquid cooled G5 thermal
shutdown mechanism to prevent an errant shutdown.

This has been carried since about Fedora Core 5.  I have no idea
if it's really needed or not.

---

Comments

Benjamin Herrenschmidt Feb. 9, 2010, 12:55 a.m. UTC | #1
On Fri, 2010-02-05 at 08:52 -0500, Josh Boyer wrote:
> This changes the thresholds for the liquid cooled G5 thermal
> shutdown mechanism to prevent an errant shutdown.
> 
> This has been carried since about Fedora Core 5.  I have no idea
> if it's really needed or not.

Can we have a SoB ?

Cheers,
Ben.

> ---
> 
> --- linux-2.6.15/drivers/macintosh/therm_pm72.c.orig	2006-04-02 21:34:48.000000000 +0100
> +++ linux-2.6.15/drivers/macintosh/therm_pm72.c	2006-04-02 22:33:27.000000000 +0100
> @@ -924,10 +925,16 @@ static void do_monitor_cpu_combined(void
>  		printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
>  		       temp_combi >> 16);
>  		state0->overtemp += CPU_MAX_OVERTEMP / 4;
> -	} else if (temp_combi > (state0->mpu.tmax << 16))
> +	} else if (temp_combi > (state0->mpu.tmax << 16)) {
>  		state0->overtemp++;
> -	else
> +		printk(KERN_WARNING "Temperature %d above max %d. overtemp %d\n",
> +		       temp_combi >> 16, state0->mpu.tmax, state0->overtemp);
> +	} else {
> +		if (state0->overtemp)
> +			printk(KERN_WARNING "Temperature back down to %d\n",
> +			       temp_combi >> 16);
>  		state0->overtemp = 0;
> +	}
>  	if (state0->overtemp >= CPU_MAX_OVERTEMP)
>  		critical_state = 1;
>  	if (state0->overtemp > 0) {
> @@ -999,10 +1015,16 @@ static void do_monitor_cpu_split(struct 
>  		       " (%d) !\n",
>  		       state->index, temp >> 16);
>  		state->overtemp += CPU_MAX_OVERTEMP / 4;
> -	} else if (temp > (state->mpu.tmax << 16))
> +	} else if (temp > (state->mpu.tmax << 16)) {
>  		state->overtemp++;
> -	else
> +		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
> +		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
> +	} else {
> +		if (state->overtemp)
> +			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
> +			       state->index, temp >> 16);
>  		state->overtemp = 0;
> +	}
>  	if (state->overtemp >= CPU_MAX_OVERTEMP)
>  		critical_state = 1;
>  	if (state->overtemp > 0) {
> @@ -1061,10 +1097,16 @@ static void do_monitor_cpu_rack(struct c
>  		       " (%d) !\n",
>  		       state->index, temp >> 16);
>  		state->overtemp = CPU_MAX_OVERTEMP / 4;
> -	} else if (temp > (state->mpu.tmax << 16))
> +	} else if (temp > (state->mpu.tmax << 16)) {
>  		state->overtemp++;
> -	else
> +		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
> +		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
> +	} else {
> +		if (state->overtemp)
> +			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
> +			       state->index, temp >> 16);
>  		state->overtemp = 0;
> +	}
>  	if (state->overtemp >= CPU_MAX_OVERTEMP)
>  		critical_state = 1;
>  	if (state->overtemp > 0) {
> --- linux-2.6.15/drivers/macintosh/therm_pm72.h~	2006-01-03 03:21:10.000000000 +0000
> +++ linux-2.6.15/drivers/macintosh/therm_pm72.h	2006-04-02 22:25:58.000000000 +0100
> @@ -243,7 +243,7 @@ struct dimm_pid_state
>  #define CPU_TEMP_HISTORY_SIZE		2
>  #define CPU_POWER_HISTORY_SIZE		10
>  #define CPU_PID_INTERVAL		1
> -#define CPU_MAX_OVERTEMP		30
> +#define CPU_MAX_OVERTEMP		90
>  
>  #define CPUA_PUMP_RPM_INDEX		7
>  #define CPUB_PUMP_RPM_INDEX		8
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
Josh Boyer Feb. 9, 2010, 2:06 a.m. UTC | #2
On Tue, Feb 09, 2010 at 11:55:05AM +1100, Benjamin Herrenschmidt wrote:
>On Fri, 2010-02-05 at 08:52 -0500, Josh Boyer wrote:
>> This changes the thresholds for the liquid cooled G5 thermal
>> shutdown mechanism to prevent an errant shutdown.
>> 
>> This has been carried since about Fedora Core 5.  I have no idea
>> if it's really needed or not.
>
>Can we have a SoB ?

David?

josh

>
>Cheers,
>Ben.
>
>> ---
>> 
>> --- linux-2.6.15/drivers/macintosh/therm_pm72.c.orig	2006-04-02 21:34:48.000000000 +0100
>> +++ linux-2.6.15/drivers/macintosh/therm_pm72.c	2006-04-02 22:33:27.000000000 +0100
>> @@ -924,10 +925,16 @@ static void do_monitor_cpu_combined(void
>>  		printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
>>  		       temp_combi >> 16);
>>  		state0->overtemp += CPU_MAX_OVERTEMP / 4;
>> -	} else if (temp_combi > (state0->mpu.tmax << 16))
>> +	} else if (temp_combi > (state0->mpu.tmax << 16)) {
>>  		state0->overtemp++;
>> -	else
>> +		printk(KERN_WARNING "Temperature %d above max %d. overtemp %d\n",
>> +		       temp_combi >> 16, state0->mpu.tmax, state0->overtemp);
>> +	} else {
>> +		if (state0->overtemp)
>> +			printk(KERN_WARNING "Temperature back down to %d\n",
>> +			       temp_combi >> 16);
>>  		state0->overtemp = 0;
>> +	}
>>  	if (state0->overtemp >= CPU_MAX_OVERTEMP)
>>  		critical_state = 1;
>>  	if (state0->overtemp > 0) {
>> @@ -999,10 +1015,16 @@ static void do_monitor_cpu_split(struct 
>>  		       " (%d) !\n",
>>  		       state->index, temp >> 16);
>>  		state->overtemp += CPU_MAX_OVERTEMP / 4;
>> -	} else if (temp > (state->mpu.tmax << 16))
>> +	} else if (temp > (state->mpu.tmax << 16)) {
>>  		state->overtemp++;
>> -	else
>> +		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
>> +		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
>> +	} else {
>> +		if (state->overtemp)
>> +			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
>> +			       state->index, temp >> 16);
>>  		state->overtemp = 0;
>> +	}
>>  	if (state->overtemp >= CPU_MAX_OVERTEMP)
>>  		critical_state = 1;
>>  	if (state->overtemp > 0) {
>> @@ -1061,10 +1097,16 @@ static void do_monitor_cpu_rack(struct c
>>  		       " (%d) !\n",
>>  		       state->index, temp >> 16);
>>  		state->overtemp = CPU_MAX_OVERTEMP / 4;
>> -	} else if (temp > (state->mpu.tmax << 16))
>> +	} else if (temp > (state->mpu.tmax << 16)) {
>>  		state->overtemp++;
>> -	else
>> +		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
>> +		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
>> +	} else {
>> +		if (state->overtemp)
>> +			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
>> +			       state->index, temp >> 16);
>>  		state->overtemp = 0;
>> +	}
>>  	if (state->overtemp >= CPU_MAX_OVERTEMP)
>>  		critical_state = 1;
>>  	if (state->overtemp > 0) {
>> --- linux-2.6.15/drivers/macintosh/therm_pm72.h~	2006-01-03 03:21:10.000000000 +0000
>> +++ linux-2.6.15/drivers/macintosh/therm_pm72.h	2006-04-02 22:25:58.000000000 +0100
>> @@ -243,7 +243,7 @@ struct dimm_pid_state
>>  #define CPU_TEMP_HISTORY_SIZE		2
>>  #define CPU_POWER_HISTORY_SIZE		10
>>  #define CPU_PID_INTERVAL		1
>> -#define CPU_MAX_OVERTEMP		30
>> +#define CPU_MAX_OVERTEMP		90
>>  
>>  #define CPUA_PUMP_RPM_INDEX		7
>>  #define CPUB_PUMP_RPM_INDEX		8
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
David Woodhouse Feb. 23, 2010, 12:48 p.m. UTC | #3
On Tue, 2010-02-09 at 11:55 +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2010-02-05 at 08:52 -0500, Josh Boyer wrote:
> > This changes the thresholds for the liquid cooled G5 thermal
> > shutdown mechanism to prevent an errant shutdown.
> > 
> > This has been carried since about Fedora Core 5.  I have no idea
> > if it's really needed or not.

It's kind of a dirty hack, but it was sufficient to stop my machine
constantly powering itself off.

> Can we have a SoB ?

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Benjamin Herrenschmidt Feb. 24, 2010, 2:54 a.m. UTC | #4
On Tue, 2010-02-23 at 12:48 +0000, David Woodhouse wrote:
> On Tue, 2010-02-09 at 11:55 +1100, Benjamin Herrenschmidt wrote:
> > On Fri, 2010-02-05 at 08:52 -0500, Josh Boyer wrote:
> > > This changes the thresholds for the liquid cooled G5 thermal
> > > shutdown mechanism to prevent an errant shutdown.
> > > 
> > > This has been carried since about Fedora Core 5.  I have no idea
> > > if it's really needed or not.
> 
> It's kind of a dirty hack, but it was sufficient to stop my machine
> constantly powering itself off.
> 
> > Can we have a SoB ?
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Well, I think you've been testing it long enough now :-)

Cheers,
Ben.
diff mbox

Patch

--- linux-2.6.15/drivers/macintosh/therm_pm72.c.orig	2006-04-02 21:34:48.000000000 +0100
+++ linux-2.6.15/drivers/macintosh/therm_pm72.c	2006-04-02 22:33:27.000000000 +0100
@@ -924,10 +925,16 @@  static void do_monitor_cpu_combined(void
 		printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
 		       temp_combi >> 16);
 		state0->overtemp += CPU_MAX_OVERTEMP / 4;
-	} else if (temp_combi > (state0->mpu.tmax << 16))
+	} else if (temp_combi > (state0->mpu.tmax << 16)) {
 		state0->overtemp++;
-	else
+		printk(KERN_WARNING "Temperature %d above max %d. overtemp %d\n",
+		       temp_combi >> 16, state0->mpu.tmax, state0->overtemp);
+	} else {
+		if (state0->overtemp)
+			printk(KERN_WARNING "Temperature back down to %d\n",
+			       temp_combi >> 16);
 		state0->overtemp = 0;
+	}
 	if (state0->overtemp >= CPU_MAX_OVERTEMP)
 		critical_state = 1;
 	if (state0->overtemp > 0) {
@@ -999,10 +1015,16 @@  static void do_monitor_cpu_split(struct 
 		       " (%d) !\n",
 		       state->index, temp >> 16);
 		state->overtemp += CPU_MAX_OVERTEMP / 4;
-	} else if (temp > (state->mpu.tmax << 16))
+	} else if (temp > (state->mpu.tmax << 16)) {
 		state->overtemp++;
-	else
+		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
+		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
+	} else {
+		if (state->overtemp)
+			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
+			       state->index, temp >> 16);
 		state->overtemp = 0;
+	}
 	if (state->overtemp >= CPU_MAX_OVERTEMP)
 		critical_state = 1;
 	if (state->overtemp > 0) {
@@ -1061,10 +1097,16 @@  static void do_monitor_cpu_rack(struct c
 		       " (%d) !\n",
 		       state->index, temp >> 16);
 		state->overtemp = CPU_MAX_OVERTEMP / 4;
-	} else if (temp > (state->mpu.tmax << 16))
+	} else if (temp > (state->mpu.tmax << 16)) {
 		state->overtemp++;
-	else
+		printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
+		       state->index, temp >> 16, state->mpu.tmax, state->overtemp);
+	} else {
+		if (state->overtemp)
+			printk(KERN_WARNING "CPU %d temperature back down to %d\n",
+			       state->index, temp >> 16);
 		state->overtemp = 0;
+	}
 	if (state->overtemp >= CPU_MAX_OVERTEMP)
 		critical_state = 1;
 	if (state->overtemp > 0) {
--- linux-2.6.15/drivers/macintosh/therm_pm72.h~	2006-01-03 03:21:10.000000000 +0000
+++ linux-2.6.15/drivers/macintosh/therm_pm72.h	2006-04-02 22:25:58.000000000 +0100
@@ -243,7 +243,7 @@  struct dimm_pid_state
 #define CPU_TEMP_HISTORY_SIZE		2
 #define CPU_POWER_HISTORY_SIZE		10
 #define CPU_PID_INTERVAL		1
-#define CPU_MAX_OVERTEMP		30
+#define CPU_MAX_OVERTEMP		90
 
 #define CPUA_PUMP_RPM_INDEX		7
 #define CPUB_PUMP_RPM_INDEX		8