diff options
| -rw-r--r-- | arch/x86/kernel/cpu/intel_epb.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/intel_epb.c b/arch/x86/kernel/cpu/intel_epb.c index f4dd73396f28..ebb14a26f117 100644 --- a/arch/x86/kernel/cpu/intel_epb.c +++ b/arch/x86/kernel/cpu/intel_epb.c | |||
| @@ -97,6 +97,7 @@ static void intel_epb_restore(void) | |||
| 97 | wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, (epb & ~EPB_MASK) | val); | 97 | wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, (epb & ~EPB_MASK) | val); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | #ifdef CONFIG_PM | ||
| 100 | static struct syscore_ops intel_epb_syscore_ops = { | 101 | static struct syscore_ops intel_epb_syscore_ops = { |
| 101 | .suspend = intel_epb_save, | 102 | .suspend = intel_epb_save, |
| 102 | .resume = intel_epb_restore, | 103 | .resume = intel_epb_restore, |
| @@ -193,6 +194,25 @@ static int intel_epb_offline(unsigned int cpu) | |||
| 193 | return 0; | 194 | return 0; |
| 194 | } | 195 | } |
| 195 | 196 | ||
| 197 | static inline void register_intel_ebp_syscore_ops(void) | ||
| 198 | { | ||
| 199 | register_syscore_ops(&intel_epb_syscore_ops); | ||
| 200 | } | ||
| 201 | #else /* !CONFIG_PM */ | ||
| 202 | static int intel_epb_online(unsigned int cpu) | ||
| 203 | { | ||
| 204 | intel_epb_restore(); | ||
| 205 | return 0; | ||
| 206 | } | ||
| 207 | |||
| 208 | static int intel_epb_offline(unsigned int cpu) | ||
| 209 | { | ||
| 210 | return intel_epb_save(); | ||
| 211 | } | ||
| 212 | |||
| 213 | static inline void register_intel_ebp_syscore_ops(void) {} | ||
| 214 | #endif | ||
| 215 | |||
| 196 | static __init int intel_epb_init(void) | 216 | static __init int intel_epb_init(void) |
| 197 | { | 217 | { |
| 198 | int ret; | 218 | int ret; |
| @@ -206,7 +226,7 @@ static __init int intel_epb_init(void) | |||
| 206 | if (ret < 0) | 226 | if (ret < 0) |
| 207 | goto err_out_online; | 227 | goto err_out_online; |
| 208 | 228 | ||
| 209 | register_syscore_ops(&intel_epb_syscore_ops); | 229 | register_intel_ebp_syscore_ops(); |
| 210 | return 0; | 230 | return 0; |
| 211 | 231 | ||
| 212 | err_out_online: | 232 | err_out_online: |
