Commit 0d01f314 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Ingo Molnar

x86, mce: therm_throt - change when we print messages

My Latitude d630 seems to be handling thermal events in SMI by
lowering the max frequency of the CPU till it cools down but
still leaks the "everything is normal" events.

This spams the console and with high priority printks.

Adjust therm_throt driver to only print messages about the fact
that temperatire returned back to normal when leaving the
throttling state.

Also lower the severity of "back to normal" message from
KERN_CRIT to KERN_INFO.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
LKML-Reference: <20090810051513.0558F526EC9@mailhub.coreip.homeip.net>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3e03bbea
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES; static DEFINE_PER_CPU(__u64, next_check) = INITIAL_JIFFIES;
static DEFINE_PER_CPU(unsigned long, thermal_throttle_count); static DEFINE_PER_CPU(unsigned long, thermal_throttle_count);
static DEFINE_PER_CPU(bool, thermal_throttle_active);
static atomic_t therm_throt_en = ATOMIC_INIT(0); static atomic_t therm_throt_en = ATOMIC_INIT(0);
...@@ -96,24 +97,27 @@ static int therm_throt_process(int curr) ...@@ -96,24 +97,27 @@ static int therm_throt_process(int curr)
{ {
unsigned int cpu = smp_processor_id(); unsigned int cpu = smp_processor_id();
__u64 tmp_jiffs = get_jiffies_64(); __u64 tmp_jiffs = get_jiffies_64();
bool was_throttled = __get_cpu_var(thermal_throttle_active);
bool is_throttled = __get_cpu_var(thermal_throttle_active) = curr;
if (curr) if (is_throttled)
__get_cpu_var(thermal_throttle_count)++; __get_cpu_var(thermal_throttle_count)++;
if (time_before64(tmp_jiffs, __get_cpu_var(next_check))) if (!(was_throttled ^ is_throttled) &&
time_before64(tmp_jiffs, __get_cpu_var(next_check)))
return 0; return 0;
__get_cpu_var(next_check) = tmp_jiffs + CHECK_INTERVAL; __get_cpu_var(next_check) = tmp_jiffs + CHECK_INTERVAL;
/* if we just entered the thermal event */ /* if we just entered the thermal event */
if (curr) { if (is_throttled) {
printk(KERN_CRIT "CPU%d: Temperature above threshold, " printk(KERN_CRIT "CPU%d: Temperature above threshold, "
"cpu clock throttled (total events = %lu)\n", cpu, "cpu clock throttled (total events = %lu)\n",
__get_cpu_var(thermal_throttle_count)); cpu, __get_cpu_var(thermal_throttle_count));
add_taint(TAINT_MACHINE_CHECK); add_taint(TAINT_MACHINE_CHECK);
} else { } else if (was_throttled) {
printk(KERN_CRIT "CPU%d: Temperature/speed normal\n", cpu); printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
} }
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment