diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 14:17:50 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 14:17:50 -0800 |
commit | 6f8c480f998a619082f18407f8d7f4c29e94dc6e (patch) | |
tree | 5047fe0d685fe9eab64c506fa1001e7df5e65faa /arch | |
parent | 038c068f63a950c3a6ccfa814831ccac0ad48fb1 (diff) | |
parent | bd5ab26a7d0cc834d846fe5dd7291f0aed3be72b (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] constify some data tables.
[CPUFREQ] constify cpufreq_driver where possible.
{rd,wr}msr_on_cpu SMP=n optimization
[CPUFREQ] cpufreq_ondemand.c: don't use _WORK_NAR
rdmsr_on_cpu, wrmsr_on_cpu
[CPUFREQ] Revert default on deprecated config X86_SPEEDSTEP_CENTRINO_ACPI
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/Kconfig | 1 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/e_powersaver.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/elanfreq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 6 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.h | 26 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longrun.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k6.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 6 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/sc520_freq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | 2 | ||||
-rw-r--r-- | arch/i386/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/i386/lib/msr-on-cpu.c | 58 | ||||
-rw-r--r-- | arch/x86_64/kernel/cpufreq/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86_64/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/x86_64/lib/msr-on-cpu.c | 1 |
19 files changed, 92 insertions, 32 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig index 6c52182ca32..e912aae9473 100644 --- a/arch/i386/kernel/cpu/cpufreq/Kconfig +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig @@ -125,7 +125,6 @@ config X86_SPEEDSTEP_CENTRINO_ACPI bool "Use ACPI tables to decode valid frequency/voltage (deprecated)" depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m) - default y help This is deprecated and this functionality is now merged into 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 0d49d73d1b7..280b3177edb 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) return 0; } -static struct cpufreq_driver nforce2_driver = { +static const struct cpufreq_driver nforce2_driver = { .name = "nforce2", .verify = nforce2_verify, .target = nforce2_target, diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c index f43d98e11cc..8bedaad1193 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[] = { NULL, }; -static struct cpufreq_driver eps_driver = { +static const struct cpufreq_driver eps_driver = { .verify = eps_verify, .target = eps_target, .init = eps_cpu_init, diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c index f317276afa7..6905de3a11e 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[] = { }; -static struct cpufreq_driver elanfreq_driver = { +static const struct cpufreq_driver elanfreq_driver = { .get = elanfreq_get_cpu_frequency, .verify = elanfreq_verify, .target = elanfreq_target, diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 6667e9cceb9..9a66cab7fe1 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) * cpufreq_gx_init: * MediaGX/Geode GX initialize cpufreq driver */ -static struct cpufreq_driver gx_suspmod_driver = { +static const struct cpufreq_driver gx_suspmod_driver = { .get = gx_get_cpuspeed, .verify = cpufreq_gx_verify, .target = cpufreq_gx_target, diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index b59878a0d9b..8cc6952d777 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; static unsigned int numscales=16; static unsigned int fsb; -static struct mV_pos *vrm_mV_table; -static unsigned char *mV_vrm_table; +static const struct mV_pos *vrm_mV_table; +static const unsigned char *mV_vrm_table; struct f_msr { u8 vrm; u8 pos; @@ -821,7 +821,7 @@ static struct freq_attr* longhaul_attr[] = { NULL, }; -static struct cpufreq_driver longhaul_driver = { +static const struct cpufreq_driver longhaul_driver = { .verify = longhaul_verify, .target = longhaul_target, .get = longhaul_get, diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/i386/kernel/cpu/cpufreq/longhaul.h index bb0a04b1d1a..102548f1284 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.h +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.h @@ -56,7 +56,7 @@ union msr_longhaul { /* * VIA C3 Samuel 1 & Samuel 2 (stepping 0) */ -static int __initdata samuel1_clock_ratio[16] = { +static const int __initdata samuel1_clock_ratio[16] = { -1, /* 0000 -> RESERVED */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -75,7 +75,7 @@ static int __initdata samuel1_clock_ratio[16] = { -1, /* 1111 -> RESERVED */ }; -static int __initdata samuel1_eblcr[16] = { +static const int __initdata samuel1_eblcr[16] = { 50, /* 0000 -> RESERVED */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -97,7 +97,7 @@ static int __initdata samuel1_eblcr[16] = { /* * VIA C3 Samuel2 Stepping 1->15 */ -static int __initdata samuel2_eblcr[16] = { +static const int __initdata samuel2_eblcr[16] = { 50, /* 0000 -> 5.0x */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -119,7 +119,7 @@ static int __initdata samuel2_eblcr[16] = { /* * VIA C3 Ezra */ -static int __initdata ezra_clock_ratio[16] = { +static const int __initdata ezra_clock_ratio[16] = { 100, /* 0000 -> 10.0x */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -138,7 +138,7 @@ static int __initdata ezra_clock_ratio[16] = { 120, /* 1111 -> 12.0x */ }; -static int __initdata ezra_eblcr[16] = { +static const int __initdata ezra_eblcr[16] = { 50, /* 0000 -> 5.0x */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -160,7 +160,7 @@ static int __initdata ezra_eblcr[16] = { /* * VIA C3 (Ezra-T) [C5M]. */ -static int __initdata ezrat_clock_ratio[32] = { +static const int __initdata ezrat_clock_ratio[32] = { 100, /* 0000 -> 10.0x */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -196,7 +196,7 @@ static int __initdata ezrat_clock_ratio[32] = { -1, /* 1111 -> RESERVED (12.0x) */ }; -static int __initdata ezrat_eblcr[32] = { +static const int __initdata ezrat_eblcr[32] = { 50, /* 0000 -> 5.0x */ 30, /* 0001 -> 3.0x */ 40, /* 0010 -> 4.0x */ @@ -235,7 +235,7 @@ static int __initdata ezrat_eblcr[32] = { /* * VIA C3 Nehemiah */ -static int __initdata nehemiah_clock_ratio[32] = { +static const int __initdata nehemiah_clock_ratio[32] = { 100, /* 0000 -> 10.0x */ 160, /* 0001 -> 16.0x */ 40, /* 0010 -> 4.0x */ @@ -270,7 +270,7 @@ static int __initdata nehemiah_clock_ratio[32] = { 120, /* 1111 -> 12.0x */ }; -static int __initdata nehemiah_eblcr[32] = { +static const int __initdata nehemiah_eblcr[32] = { 50, /* 0000 -> 5.0x */ 160, /* 0001 -> 16.0x */ 40, /* 0010 -> 4.0x */ @@ -315,7 +315,7 @@ struct mV_pos { unsigned short pos; }; -static struct mV_pos __initdata vrm85_mV[32] = { +static const struct mV_pos __initdata vrm85_mV[32] = { {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, @@ -326,14 +326,14 @@ static struct mV_pos __initdata vrm85_mV[32] = { {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} }; -static unsigned char __initdata mV_vrm85[32] = { +static const unsigned char __initdata mV_vrm85[32] = { 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 }; -static struct mV_pos __initdata mobilevrm_mV[32] = { +static const struct mV_pos __initdata mobilevrm_mV[32] = { {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, @@ -344,7 +344,7 @@ static struct mV_pos __initdata mobilevrm_mV[32] = { {675, 3}, {650, 2}, {625, 1}, {600, 0} }; -static unsigned char __initdata mV_mobilevrm[32] = { +static const unsigned char __initdata mV_mobilevrm[32] = { 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 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 b2689514295..e11fd86ce8f 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c @@ -18,7 +18,7 @@ #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) -static struct cpufreq_driver longrun_driver; +static const struct cpufreq_driver longrun_driver; /** * 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) } -static struct cpufreq_driver longrun_driver = { +static const struct cpufreq_driver longrun_driver = { .flags = CPUFREQ_CONST_LOOPS, .verify = longrun_verify_policy, .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 f89524051e4..2a0d89cb0b4 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[] = { NULL, }; -static struct cpufreq_driver powernow_k6_driver = { +static const struct cpufreq_driver powernow_k6_driver = { .verify = powernow_k6_verify, .target = powernow_k6_target, .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 54382760983..d98529c93a1 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 { #ifdef CONFIG_CPU_FREQ_DEBUG /* divide by 1000 to get VCore voltage in V. */ -static int mobile_vid_table[32] = { +static const int mobile_vid_table[32] = { 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, @@ -77,7 +77,7 @@ static int mobile_vid_table[32] = { #endif /* divide by 10 to get FID. */ -static int fid_codes[32] = { +static const int fid_codes[32] = { 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 30, 190, 40, 200, 130, 135, 140, 210, @@ -647,7 +647,7 @@ static struct freq_attr* powernow_table_attr[] = { NULL, }; -static struct cpufreq_driver powernow_driver = { +static const struct cpufreq_driver powernow_driver = { .verify = powernow_verify, .target = powernow_target, .get = powernow_get, diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index fe3b67005eb..8ed7b3af055 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[] = { NULL, }; -static struct cpufreq_driver cpufreq_amd64_driver = { +static const struct cpufreq_driver cpufreq_amd64_driver = { .verify = powernowk8_verify, .target = powernowk8_target, .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 b8fb4b521c6..eddbe04a084 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[] = { }; -static struct cpufreq_driver sc520_freq_driver = { +static const struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, .verify = sc520_freq_verify, .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 b425cd3d183..b94e347f08d 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[] = { }; -static struct cpufreq_driver speedstep_driver = { +static const struct cpufreq_driver speedstep_driver = { .name = "speedstep-ich", .verify = speedstep_verify, .target = speedstep_target, diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index ff0d8980611..d4b7404bf31 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[] = { NULL, }; -static struct cpufreq_driver speedstep_driver = { +static const struct cpufreq_driver speedstep_driver = { .name = "speedstep-smi", .verify = speedstep_verify, .target = speedstep_target, diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile index d86a548b8d5..22d8ac5815f 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 \ bitops.o semaphore.o lib-$(CONFIG_X86_USE_3DNOW) += mmx.o + +obj-$(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 00000000000..1c46bda409f --- /dev/null +++ b/arch/i386/lib/msr-on-cpu.c @@ -0,0 +1,58 @@ +#include <linux/module.h> +#include <linux/preempt.h> +#include <linux/smp.h> +#include <asm/msr.h> + +struct msr_info { + u32 msr_no; + u32 l, h; +}; + +static void __rdmsr_on_cpu(void *info) +{ + struct msr_info *rv = info; + + rdmsr(rv->msr_no, rv->l, rv->h); +} + +void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) +{ + preempt_disable(); + if (smp_processor_id() == cpu) + rdmsr(msr_no, *l, *h); + else { + struct msr_info rv; + + rv.msr_no = msr_no; + smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1); + *l = rv.l; + *h = rv.h; + } + preempt_enable(); +} + +static void __wrmsr_on_cpu(void *info) +{ + struct msr_info *rv = info; + + wrmsr(rv->msr_no, rv->l, rv->h); +} + +void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) +{ + preempt_disable(); + if (smp_processor_id() == cpu) + wrmsr(msr_no, l, h); + else { + struct msr_info rv; + + rv.msr_no = msr_no; + rv.l = l; + rv.h = h; + smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1); + } + preempt_enable(); +} + +EXPORT_SYMBOL(rdmsr_on_cpu); +EXPORT_SYMBOL(wrmsr_on_cpu); diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig index 45a6a1fd14a..ced15d06f0f 100644 --- a/arch/x86_64/kernel/cpufreq/Kconfig +++ b/arch/x86_64/kernel/cpufreq/Kconfig @@ -45,7 +45,6 @@ config X86_SPEEDSTEP_CENTRINO config X86_SPEEDSTEP_CENTRINO_ACPI bool depends on X86_SPEEDSTEP_CENTRINO - default y config X86_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile index 8d5f835af48..c9432717839 100644 --- a/arch/x86_64/lib/Makefile +++ b/arch/x86_64/lib/Makefile @@ -5,6 +5,7 @@ CFLAGS_csum-partial.o := -funroll-loops obj-y := io.o iomap_copy.o +obj-$(CONFIG_SMP) += msr-on-cpu.o lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ 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 00000000000..47e0ec47c37 --- /dev/null +++ b/arch/x86_64/lib/msr-on-cpu.c @@ -0,0 +1 @@ +#include "../../i386/lib/msr-on-cpu.c" |