Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de0b632b authored by Josh Boyer's avatar Josh Boyer Committed by Benjamin Herrenschmidt
Browse files

powerpc: Fix G5 thermal shutdown



This changes the thresholds for the liquid cooled G5 thermal
shutdown mechanism to prevent an errant shutdown with some
models.

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent f09b7b2a
Loading
Loading
Loading
Loading
+24 −6
Original line number Original line Diff line number Diff line
@@ -948,10 +948,16 @@ static void do_monitor_cpu_combined(void)
		printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
		printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
		       temp_combi >> 16);
		       temp_combi >> 16);
		state0->overtemp += CPU_MAX_OVERTEMP / 4;
		state0->overtemp += CPU_MAX_OVERTEMP / 4;
	} else if (temp_combi > (state0->mpu.tmax << 16))
	} else if (temp_combi > (state0->mpu.tmax << 16)) {
		state0->overtemp++;
		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;
		state0->overtemp = 0;
	}
	if (state0->overtemp >= CPU_MAX_OVERTEMP)
	if (state0->overtemp >= CPU_MAX_OVERTEMP)
		critical_state = 1;
		critical_state = 1;
	if (state0->overtemp > 0) {
	if (state0->overtemp > 0) {
@@ -1023,10 +1029,16 @@ static void do_monitor_cpu_split(struct cpu_pid_state *state)
		       " (%d) !\n",
		       " (%d) !\n",
		       state->index, temp >> 16);
		       state->index, temp >> 16);
		state->overtemp += CPU_MAX_OVERTEMP / 4;
		state->overtemp += CPU_MAX_OVERTEMP / 4;
	} else if (temp > (state->mpu.tmax << 16))
	} else if (temp > (state->mpu.tmax << 16)) {
		state->overtemp++;
		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;
		state->overtemp = 0;
	}
	if (state->overtemp >= CPU_MAX_OVERTEMP)
	if (state->overtemp >= CPU_MAX_OVERTEMP)
		critical_state = 1;
		critical_state = 1;
	if (state->overtemp > 0) {
	if (state->overtemp > 0) {
@@ -1085,10 +1097,16 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
		       " (%d) !\n",
		       " (%d) !\n",
		       state->index, temp >> 16);
		       state->index, temp >> 16);
		state->overtemp = CPU_MAX_OVERTEMP / 4;
		state->overtemp = CPU_MAX_OVERTEMP / 4;
	} else if (temp > (state->mpu.tmax << 16))
	} else if (temp > (state->mpu.tmax << 16)) {
		state->overtemp++;
		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;
		state->overtemp = 0;
	}
	if (state->overtemp >= CPU_MAX_OVERTEMP)
	if (state->overtemp >= CPU_MAX_OVERTEMP)
		critical_state = 1;
		critical_state = 1;
	if (state->overtemp > 0) {
	if (state->overtemp > 0) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -269,7 +269,7 @@ struct slots_pid_state
#define CPU_TEMP_HISTORY_SIZE		2
#define CPU_TEMP_HISTORY_SIZE		2
#define CPU_POWER_HISTORY_SIZE		10
#define CPU_POWER_HISTORY_SIZE		10
#define CPU_PID_INTERVAL		1
#define CPU_PID_INTERVAL		1
#define CPU_MAX_OVERTEMP		30
#define CPU_MAX_OVERTEMP		90


#define CPUA_PUMP_RPM_INDEX		7
#define CPUA_PUMP_RPM_INDEX		7
#define CPUB_PUMP_RPM_INDEX		8
#define CPUB_PUMP_RPM_INDEX		8