aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Kconfig1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/e_powersaver.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/elanfreq.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/gx-suspmod.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c6
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.h26
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longrun.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k6.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c6
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/sc520_freq.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-ich.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-smi.c2
-rw-r--r--arch/i386/lib/Makefile2
-rw-r--r--arch/i386/lib/msr-on-cpu.c58
-rw-r--r--arch/x86_64/kernel/cpufreq/Kconfig1
-rw-r--r--arch/x86_64/lib/Makefile1
-rw-r--r--arch/x86_64/lib/msr-on-cpu.c1
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c5
-rw-r--r--include/asm-i386/msr.h14
-rw-r--r--include/asm-x86_64/msr.h13
-rw-r--r--include/linux/cpufreq.h4
24 files changed, 124 insertions, 40 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
index 6c52182ca323..e912aae9473c 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -125,7 +125,6 @@ config X86_SPEEDSTEP_CENTRINO_ACPI
125 bool "Use ACPI tables to decode valid frequency/voltage (deprecated)" 125 bool "Use ACPI tables to decode valid frequency/voltage (deprecated)"
126 depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR 126 depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR
127 depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m) 127 depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m)
128 default y
129 help 128 help
130 This is deprecated and this functionality is now merged into 129 This is deprecated and this functionality is now merged into
131 acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of 130 acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 0d49d73d1b71..280b3177edbd 100644
--- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
@@ -373,7 +373,7 @@ static int nforce2_cpu_exit(struct cpufreq_policy *policy)
373 return 0; 373 return 0;
374} 374}
375 375
376static struct cpufreq_driver nforce2_driver = { 376static const struct cpufreq_driver nforce2_driver = {
377 .name = "nforce2", 377 .name = "nforce2",
378 .verify = nforce2_verify, 378 .verify = nforce2_verify,
379 .target = nforce2_target, 379 .target = nforce2_target,
diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c
index f43d98e11cc7..8bedaad1193b 100644
--- a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c
+++ b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c
@@ -293,7 +293,7 @@ static struct freq_attr* eps_attr[] = {
293 NULL, 293 NULL,
294}; 294};
295 295
296static struct cpufreq_driver eps_driver = { 296static const struct cpufreq_driver eps_driver = {
297 .verify = eps_verify, 297 .verify = eps_verify,
298 .target = eps_target, 298 .target = eps_target,
299 .init = eps_cpu_init, 299 .init = eps_cpu_init,
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
index f317276afa7a..6905de3a11e8 100644
--- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c
@@ -267,7 +267,7 @@ static struct freq_attr* elanfreq_attr[] = {
267}; 267};
268 268
269 269
270static struct cpufreq_driver elanfreq_driver = { 270static const struct cpufreq_driver elanfreq_driver = {
271 .get = elanfreq_get_cpu_frequency, 271 .get = elanfreq_get_cpu_frequency,
272 .verify = elanfreq_verify, 272 .verify = elanfreq_verify,
273 .target = elanfreq_target, 273 .target = elanfreq_target,
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
index 6667e9cceb9f..9a66cab7fe14 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
@@ -433,7 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
433 * cpufreq_gx_init: 433 * cpufreq_gx_init:
434 * MediaGX/Geode GX initialize cpufreq driver 434 * MediaGX/Geode GX initialize cpufreq driver
435 */ 435 */
436static struct cpufreq_driver gx_suspmod_driver = { 436static const struct cpufreq_driver gx_suspmod_driver = {
437 .get = gx_get_cpuspeed, 437 .get = gx_get_cpuspeed,
438 .verify = cpufreq_gx_verify, 438 .verify = cpufreq_gx_verify,
439 .target = cpufreq_gx_target, 439 .target = cpufreq_gx_target,
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index b59878a0d9b3..8cc6952d7772 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -61,8 +61,8 @@ static int cpu_model;
61static unsigned int numscales=16; 61static unsigned int numscales=16;
62static unsigned int fsb; 62static unsigned int fsb;
63 63
64static struct mV_pos *vrm_mV_table; 64static const struct mV_pos *vrm_mV_table;
65static unsigned char *mV_vrm_table; 65static const unsigned char *mV_vrm_table;
66struct f_msr { 66struct f_msr {
67 u8 vrm; 67 u8 vrm;
68 u8 pos; 68 u8 pos;
@@ -821,7 +821,7 @@ static struct freq_attr* longhaul_attr[] = {
821 NULL, 821 NULL,
822}; 822};
823 823
824static struct cpufreq_driver longhaul_driver = { 824static const struct cpufreq_driver longhaul_driver = {
825 .verify = longhaul_verify, 825 .verify = longhaul_verify,
826 .target = longhaul_target, 826 .target = longhaul_target,
827 .get = longhaul_get, 827 .get = longhaul_get,
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/i386/kernel/cpu/cpufreq/longhaul.h
index bb0a04b1d1ab..102548f12842 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.h
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.h
@@ -56,7 +56,7 @@ union msr_longhaul {
56/* 56/*
57 * VIA C3 Samuel 1 & Samuel 2 (stepping 0) 57 * VIA C3 Samuel 1 & Samuel 2 (stepping 0)
58 */ 58 */
59static int __initdata samuel1_clock_ratio[16] = { 59static const int __initdata samuel1_clock_ratio[16] = {
60 -1, /* 0000 -> RESERVED */ 60 -1, /* 0000 -> RESERVED */
61 30, /* 0001 -> 3.0x */ 61 30, /* 0001 -> 3.0x */
62 40, /* 0010 -> 4.0x */ 62 40, /* 0010 -> 4.0x */
@@ -75,7 +75,7 @@ static int __initdata samuel1_clock_ratio[16] = {
75 -1, /* 1111 -> RESERVED */ 75 -1, /* 1111 -> RESERVED */
76}; 76};
77 77
78static int __initdata samuel1_eblcr[16] = { 78static const int __initdata samuel1_eblcr[16] = {
79 50, /* 0000 -> RESERVED */ 79 50, /* 0000 -> RESERVED */
80 30, /* 0001 -> 3.0x */ 80 30, /* 0001 -> 3.0x */
81 40, /* 0010 -> 4.0x */ 81 40, /* 0010 -> 4.0x */
@@ -97,7 +97,7 @@ static int __initdata samuel1_eblcr[16] = {
97/* 97/*
98 * VIA C3 Samuel2 Stepping 1->15 98 * VIA C3 Samuel2 Stepping 1->15
99 */ 99 */
100static int __initdata samuel2_eblcr[16] = { 100static const int __initdata samuel2_eblcr[16] = {
101 50, /* 0000 -> 5.0x */ 101 50, /* 0000 -> 5.0x */
102 30, /* 0001 -> 3.0x */ 102 30, /* 0001 -> 3.0x */
103 40, /* 0010 -> 4.0x */ 103 40, /* 0010 -> 4.0x */
@@ -119,7 +119,7 @@ static int __initdata samuel2_eblcr[16] = {
119/* 119/*
120 * VIA C3 Ezra 120 * VIA C3 Ezra
121 */ 121 */
122static int __initdata ezra_clock_ratio[16] = { 122static const int __initdata ezra_clock_ratio[16] = {
123 100, /* 0000 -> 10.0x */ 123 100, /* 0000 -> 10.0x */
124 30, /* 0001 -> 3.0x */ 124 30, /* 0001 -> 3.0x */
125 40, /* 0010 -> 4.0x */ 125 40, /* 0010 -> 4.0x */
@@ -138,7 +138,7 @@ static int __initdata ezra_clock_ratio[16] = {
138 120, /* 1111 -> 12.0x */ 138 120, /* 1111 -> 12.0x */
139}; 139};
140 140
141static int __initdata ezra_eblcr[16] = { 141static const int __initdata ezra_eblcr[16] = {
142 50, /* 0000 -> 5.0x */ 142 50, /* 0000 -> 5.0x */
143 30, /* 0001 -> 3.0x */ 143 30, /* 0001 -> 3.0x */
144 40, /* 0010 -> 4.0x */ 144 40, /* 0010 -> 4.0x */
@@ -160,7 +160,7 @@ static int __initdata ezra_eblcr[16] = {
160/* 160/*
161 * VIA C3 (Ezra-T) [C5M]. 161 * VIA C3 (Ezra-T) [C5M].
162 */ 162 */
163static int __initdata ezrat_clock_ratio[32] = { 163static const int __initdata ezrat_clock_ratio[32] = {
164 100, /* 0000 -> 10.0x */ 164 100, /* 0000 -> 10.0x */
165 30, /* 0001 -> 3.0x */ 165 30, /* 0001 -> 3.0x */
166 40, /* 0010 -> 4.0x */ 166 40, /* 0010 -> 4.0x */
@@ -196,7 +196,7 @@ static int __initdata ezrat_clock_ratio[32] = {
196 -1, /* 1111 -> RESERVED (12.0x) */ 196 -1, /* 1111 -> RESERVED (12.0x) */
197}; 197};
198 198
199static int __initdata ezrat_eblcr[32] = { 199static const int __initdata ezrat_eblcr[32] = {
200 50, /* 0000 -> 5.0x */ 200 50, /* 0000 -> 5.0x */
201 30, /* 0001 -> 3.0x */ 201 30, /* 0001 -> 3.0x */
202 40, /* 0010 -> 4.0x */ 202 40, /* 0010 -> 4.0x */
@@ -235,7 +235,7 @@ static int __initdata ezrat_eblcr[32] = {
235/* 235/*
236 * VIA C3 Nehemiah */ 236 * VIA C3 Nehemiah */
237 237
238static int __initdata nehemiah_clock_ratio[32] = { 238static const int __initdata nehemiah_clock_ratio[32] = {
239 100, /* 0000 -> 10.0x */ 239 100, /* 0000 -> 10.0x */
240 160, /* 0001 -> 16.0x */ 240 160, /* 0001 -> 16.0x */
241 40, /* 0010 -> 4.0x */ 241 40, /* 0010 -> 4.0x */
@@ -270,7 +270,7 @@ static int __initdata nehemiah_clock_ratio[32] = {
270 120, /* 1111 -> 12.0x */ 270 120, /* 1111 -> 12.0x */
271}; 271};
272 272
273static int __initdata nehemiah_eblcr[32] = { 273static const int __initdata nehemiah_eblcr[32] = {
274 50, /* 0000 -> 5.0x */ 274 50, /* 0000 -> 5.0x */
275 160, /* 0001 -> 16.0x */ 275 160, /* 0001 -> 16.0x */
276 40, /* 0010 -> 4.0x */ 276 40, /* 0010 -> 4.0x */
@@ -315,7 +315,7 @@ struct mV_pos {
315 unsigned short pos; 315 unsigned short pos;
316}; 316};
317 317
318static struct mV_pos __initdata vrm85_mV[32] = { 318static const struct mV_pos __initdata vrm85_mV[32] = {
319 {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, 319 {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2},
320 {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, 320 {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26},
321 {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, 321 {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18},
@@ -326,14 +326,14 @@ static struct mV_pos __initdata vrm85_mV[32] = {
326 {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} 326 {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11}
327}; 327};
328 328
329static unsigned char __initdata mV_vrm85[32] = { 329static const unsigned char __initdata mV_vrm85[32] = {
330 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, 330 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11,
331 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, 331 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d,
332 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, 332 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19,
333 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 333 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15
334}; 334};
335 335
336static struct mV_pos __initdata mobilevrm_mV[32] = { 336static const struct mV_pos __initdata mobilevrm_mV[32] = {
337 {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, 337 {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28},
338 {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, 338 {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24},
339 {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, 339 {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20},
@@ -344,7 +344,7 @@ static struct mV_pos __initdata mobilevrm_mV[32] = {
344 {675, 3}, {650, 2}, {625, 1}, {600, 0} 344 {675, 3}, {650, 2}, {625, 1}, {600, 0}
345}; 345};
346 346
347static unsigned char __initdata mV_mobilevrm[32] = { 347static const unsigned char __initdata mV_mobilevrm[32] = {
348 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 348 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18,
349 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 349 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,
350 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 350 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c
index b2689514295a..e11fd86ce8fb 100644
--- a/arch/i386/kernel/cpu/cpufreq/longrun.c
+++ b/arch/i386/kernel/cpu/cpufreq/longrun.c
@@ -18,7 +18,7 @@
18 18
19#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) 19#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg)
20 20
21static struct cpufreq_driver longrun_driver; 21static const struct cpufreq_driver longrun_driver;
22 22
23/** 23/**
24 * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz 24 * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz
@@ -280,7 +280,7 @@ static int __init longrun_cpu_init(struct cpufreq_policy *policy)
280} 280}
281 281
282 282
283static struct cpufreq_driver longrun_driver = { 283static const struct cpufreq_driver longrun_driver = {
284 .flags = CPUFREQ_CONST_LOOPS, 284 .flags = CPUFREQ_CONST_LOOPS,
285 .verify = longrun_verify_policy, 285 .verify = longrun_verify_policy,
286 .setpolicy = longrun_set_policy, 286 .setpolicy = longrun_set_policy,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
index f89524051e4a..2a0d89cb0b4b 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
@@ -195,7 +195,7 @@ static struct freq_attr* powernow_k6_attr[] = {
195 NULL, 195 NULL,
196}; 196};
197 197
198static struct cpufreq_driver powernow_k6_driver = { 198static const struct cpufreq_driver powernow_k6_driver = {
199 .verify = powernow_k6_verify, 199 .verify = powernow_k6_verify,
200 .target = powernow_k6_target, 200 .target = powernow_k6_target,
201 .init = powernow_k6_cpu_init, 201 .init = powernow_k6_cpu_init,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 54382760983a..d98529c93a1c 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -68,7 +68,7 @@ union powernow_acpi_control_t {
68 68
69#ifdef CONFIG_CPU_FREQ_DEBUG 69#ifdef CONFIG_CPU_FREQ_DEBUG
70/* divide by 1000 to get VCore voltage in V. */ 70/* divide by 1000 to get VCore voltage in V. */
71static int mobile_vid_table[32] = { 71static const int mobile_vid_table[32] = {
72 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, 72 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
73 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, 73 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0,
74 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, 74 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
@@ -77,7 +77,7 @@ static int mobile_vid_table[32] = {
77#endif 77#endif
78 78
79/* divide by 10 to get FID. */ 79/* divide by 10 to get FID. */
80static int fid_codes[32] = { 80static const int fid_codes[32] = {
81 110, 115, 120, 125, 50, 55, 60, 65, 81 110, 115, 120, 125, 50, 55, 60, 65,
82 70, 75, 80, 85, 90, 95, 100, 105, 82 70, 75, 80, 85, 90, 95, 100, 105,
83 30, 190, 40, 200, 130, 135, 140, 210, 83 30, 190, 40, 200, 130, 135, 140, 210,
@@ -647,7 +647,7 @@ static struct freq_attr* powernow_table_attr[] = {
647 NULL, 647 NULL,
648}; 648};
649 649
650static struct cpufreq_driver powernow_driver = { 650static const struct cpufreq_driver powernow_driver = {
651 .verify = powernow_verify, 651 .verify = powernow_verify,
652 .target = powernow_target, 652 .target = powernow_target,
653 .get = powernow_get, 653 .get = powernow_get,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index fe3b67005ebb..8ed7b3af0553 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -1305,7 +1305,7 @@ static struct freq_attr* powernow_k8_attr[] = {
1305 NULL, 1305 NULL,
1306}; 1306};
1307 1307
1308static struct cpufreq_driver cpufreq_amd64_driver = { 1308static const struct cpufreq_driver cpufreq_amd64_driver = {
1309 .verify = powernowk8_verify, 1309 .verify = powernowk8_verify,
1310 .target = powernowk8_target, 1310 .target = powernowk8_target,
1311 .init = powernowk8_cpu_init, 1311 .init = powernowk8_cpu_init,
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
index b8fb4b521c62..eddbe04a0841 100644
--- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
@@ -138,7 +138,7 @@ static struct freq_attr* sc520_freq_attr[] = {
138}; 138};
139 139
140 140
141static struct cpufreq_driver sc520_freq_driver = { 141static const struct cpufreq_driver sc520_freq_driver = {
142 .get = sc520_freq_get_cpu_frequency, 142 .get = sc520_freq_get_cpu_frequency,
143 .verify = sc520_freq_verify, 143 .verify = sc520_freq_verify,
144 .target = sc520_freq_target, 144 .target = sc520_freq_target,
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
index b425cd3d1838..b94e347f08d3 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
@@ -374,7 +374,7 @@ static struct freq_attr* speedstep_attr[] = {
374}; 374};
375 375
376 376
377static struct cpufreq_driver speedstep_driver = { 377static const struct cpufreq_driver speedstep_driver = {
378 .name = "speedstep-ich", 378 .name = "speedstep-ich",
379 .verify = speedstep_verify, 379 .verify = speedstep_verify,
380 .target = speedstep_target, 380 .target = speedstep_target,
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index ff0d89806114..d4b7404bf315 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -332,7 +332,7 @@ static struct freq_attr* speedstep_attr[] = {
332 NULL, 332 NULL,
333}; 333};
334 334
335static struct cpufreq_driver speedstep_driver = { 335static const struct cpufreq_driver speedstep_driver = {
336 .name = "speedstep-smi", 336 .name = "speedstep-smi",
337 .verify = speedstep_verify, 337 .verify = speedstep_verify,
338 .target = speedstep_target, 338 .target = speedstep_target,
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
index d86a548b8d54..22d8ac5815f0 100644
--- a/arch/i386/lib/Makefile
+++ b/arch/i386/lib/Makefile
@@ -7,3 +7,5 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
7 bitops.o semaphore.o 7 bitops.o semaphore.o
8 8
9lib-$(CONFIG_X86_USE_3DNOW) += mmx.o 9lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
10
11obj-$(CONFIG_SMP) += msr-on-cpu.o
diff --git a/arch/i386/lib/msr-on-cpu.c b/arch/i386/lib/msr-on-cpu.c
new file mode 100644
index 000000000000..1c46bda409ff
--- /dev/null
+++ b/arch/i386/lib/msr-on-cpu.c
@@ -0,0 +1,58 @@
1#include <linux/module.h>
2#include <linux/preempt.h>
3#include <linux/smp.h>
4#include <asm/msr.h>
5
6struct msr_info {
7 u32 msr_no;
8 u32 l, h;
9};
10
11static void __rdmsr_on_cpu(void *info)
12{
13 struct msr_info *rv = info;
14
15 rdmsr(rv->msr_no, rv->l, rv->h);
16}
17
18void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
19{
20 preempt_disable();
21 if (smp_processor_id() == cpu)
22 rdmsr(msr_no, *l, *h);
23 else {
24 struct msr_info rv;
25
26 rv.msr_no = msr_no;
27 smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1);
28 *l = rv.l;
29 *h = rv.h;
30 }
31 preempt_enable();
32}
33
34static void __wrmsr_on_cpu(void *info)
35{
36 struct msr_info *rv = info;
37
38 wrmsr(rv->msr_no, rv->l, rv->h);
39}
40
41void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
42{
43 preempt_disable();
44 if (smp_processor_id() == cpu)
45 wrmsr(msr_no, l, h);
46 else {
47 struct msr_info rv;
48
49 rv.msr_no = msr_no;
50 rv.l = l;
51 rv.h = h;
52 smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1);
53 }
54 preempt_enable();
55}
56
57EXPORT_SYMBOL(rdmsr_on_cpu);
58EXPORT_SYMBOL(wrmsr_on_cpu);
diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig
index 45a6a1fd14ac..ced15d06f0f3 100644
--- a/arch/x86_64/kernel/cpufreq/Kconfig
+++ b/arch/x86_64/kernel/cpufreq/Kconfig
@@ -45,7 +45,6 @@ config X86_SPEEDSTEP_CENTRINO
45config X86_SPEEDSTEP_CENTRINO_ACPI 45config X86_SPEEDSTEP_CENTRINO_ACPI
46 bool 46 bool
47 depends on X86_SPEEDSTEP_CENTRINO 47 depends on X86_SPEEDSTEP_CENTRINO
48 default y
49 48
50config X86_ACPI_CPUFREQ 49config X86_ACPI_CPUFREQ
51 tristate "ACPI Processor P-States driver" 50 tristate "ACPI Processor P-States driver"
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile
index 8d5f835af481..c94327178398 100644
--- a/arch/x86_64/lib/Makefile
+++ b/arch/x86_64/lib/Makefile
@@ -5,6 +5,7 @@
5CFLAGS_csum-partial.o := -funroll-loops 5CFLAGS_csum-partial.o := -funroll-loops
6 6
7obj-y := io.o iomap_copy.o 7obj-y := io.o iomap_copy.o
8obj-$(CONFIG_SMP) += msr-on-cpu.o
8 9
9lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ 10lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
10 usercopy.o getuser.o putuser.o \ 11 usercopy.o getuser.o putuser.o \
diff --git a/arch/x86_64/lib/msr-on-cpu.c b/arch/x86_64/lib/msr-on-cpu.c
new file mode 100644
index 000000000000..47e0ec47c376
--- /dev/null
+++ b/arch/x86_64/lib/msr-on-cpu.c
@@ -0,0 +1 @@
#include "../../i386/lib/msr-on-cpu.c"
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index f52facc570f5..a12d6a236df1 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1752,7 +1752,7 @@ static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
1752 * (and isn't unregistered in the meantime). 1752 * (and isn't unregistered in the meantime).
1753 * 1753 *
1754 */ 1754 */
1755int cpufreq_register_driver(struct cpufreq_driver *driver_data) 1755int cpufreq_register_driver(const struct cpufreq_driver *driver_data)
1756{ 1756{
1757 unsigned long flags; 1757 unsigned long flags;
1758 int ret; 1758 int ret;
@@ -1817,7 +1817,7 @@ EXPORT_SYMBOL_GPL(cpufreq_register_driver);
1817 * Returns zero if successful, and -EINVAL if the cpufreq_driver is 1817 * Returns zero if successful, and -EINVAL if the cpufreq_driver is
1818 * currently not initialised. 1818 * currently not initialised.
1819 */ 1819 */
1820int cpufreq_unregister_driver(struct cpufreq_driver *driver) 1820int cpufreq_unregister_driver(const struct cpufreq_driver *driver)
1821{ 1821{
1822 unsigned long flags; 1822 unsigned long flags;
1823 1823
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index d60bcb9d14cc..8d053f500fc2 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -432,9 +432,6 @@ static void do_dbs_timer(struct work_struct *work)
432 /* We want all CPUs to do sampling nearly on same jiffy */ 432 /* We want all CPUs to do sampling nearly on same jiffy */
433 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 433 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
434 434
435 /* Permit rescheduling of this work item */
436 work_release(work);
437
438 delay -= jiffies % delay; 435 delay -= jiffies % delay;
439 436
440 if (lock_policy_rwsem_write(cpu) < 0) 437 if (lock_policy_rwsem_write(cpu) < 0)
@@ -473,7 +470,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
473 dbs_info->enable = 1; 470 dbs_info->enable = 1;
474 ondemand_powersave_bias_init(); 471 ondemand_powersave_bias_init();
475 dbs_info->sample_type = DBS_NORMAL_SAMPLE; 472 dbs_info->sample_type = DBS_NORMAL_SAMPLE;
476 INIT_DELAYED_WORK_NAR(&dbs_info->work, do_dbs_timer); 473 INIT_DELAYED_WORK(&dbs_info->work, do_dbs_timer);
477 queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work, 474 queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work,
478 delay); 475 delay);
479} 476}
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index 6db40d0583f1..ec3b6803fd36 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -83,6 +83,20 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
83 : "c" (counter)) 83 : "c" (counter))
84#endif /* !CONFIG_PARAVIRT */ 84#endif /* !CONFIG_PARAVIRT */
85 85
86#ifdef CONFIG_SMP
87void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
88void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
89#else /* CONFIG_SMP */
90static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
91{
92 rdmsr(msr_no, *l, *h);
93}
94static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
95{
96 wrmsr(msr_no, l, h);
97}
98#endif /* CONFIG_SMP */
99
86/* symbolic names for some interesting MSRs */ 100/* symbolic names for some interesting MSRs */
87/* Intel defined MSRs. */ 101/* Intel defined MSRs. */
88#define MSR_IA32_P5_MC_ADDR 0 102#define MSR_IA32_P5_MC_ADDR 0
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index 3227bc93d69b..902f9a58617e 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -160,6 +160,19 @@ static inline unsigned int cpuid_edx(unsigned int op)
160#define MSR_IA32_UCODE_WRITE 0x79 160#define MSR_IA32_UCODE_WRITE 0x79
161#define MSR_IA32_UCODE_REV 0x8b 161#define MSR_IA32_UCODE_REV 0x8b
162 162
163#ifdef CONFIG_SMP
164void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
165void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
166#else /* CONFIG_SMP */
167static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
168{
169 rdmsr(msr_no, *l, *h);
170}
171static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
172{
173 wrmsr(msr_no, l, h);
174}
175#endif /* CONFIG_SMP */
163 176
164#endif 177#endif
165 178
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 0899e2cdcdd1..3a25235d79da 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -225,8 +225,8 @@ struct cpufreq_driver {
225#define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed 225#define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed
226 * mismatches */ 226 * mismatches */
227 227
228int cpufreq_register_driver(struct cpufreq_driver *driver_data); 228int cpufreq_register_driver(const struct cpufreq_driver *driver_data);
229int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 229int cpufreq_unregister_driver(const struct cpufreq_driver *driver_data);
230 230
231 231
232void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); 232void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state);