diff options
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index db80b577f601..b3a1dba75330 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -42,6 +42,7 @@ struct thermal_state { | |||
42 | 42 | ||
43 | u64 next_check; | 43 | u64 next_check; |
44 | unsigned long throttle_count; | 44 | unsigned long throttle_count; |
45 | unsigned long last_throttle_count; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | static DEFINE_PER_CPU(struct thermal_state, thermal_state); | 48 | static DEFINE_PER_CPU(struct thermal_state, thermal_state); |
@@ -120,11 +121,12 @@ static int therm_throt_process(bool is_throttled) | |||
120 | if (is_throttled) | 121 | if (is_throttled) |
121 | state->throttle_count++; | 122 | state->throttle_count++; |
122 | 123 | ||
123 | if (!(was_throttled ^ is_throttled) && | 124 | if (time_before64(now, state->next_check) && |
124 | time_before64(now, state->next_check)) | 125 | state->throttle_count != state->last_throttle_count) |
125 | return 0; | 126 | return 0; |
126 | 127 | ||
127 | state->next_check = now + CHECK_INTERVAL; | 128 | state->next_check = now + CHECK_INTERVAL; |
129 | state->last_throttle_count = state->throttle_count; | ||
128 | 130 | ||
129 | /* if we just entered the thermal event */ | 131 | /* if we just entered the thermal event */ |
130 | if (is_throttled) { | 132 | if (is_throttled) { |