aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/cpu-freq/core.txt2
-rw-r--r--Documentation/feature-removal-schedule.txt22
-rw-r--r--Documentation/kbuild/kconfig-language.txt8
-rw-r--r--MAINTAINERS8
-rw-r--r--Makefile4
-rw-r--r--arch/arm/mach-pxa/Kconfig16
-rw-r--r--arch/arm/plat-omap/Kconfig2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Kconfig6
-rw-r--r--arch/i386/kernel/cpu/cpufreq/Makefile2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c813
-rw-r--r--arch/i386/kernel/cpu/cpufreq/gx-suspmod.c4
-rw-r--r--arch/i386/kernel/cpu/cpufreq/longhaul.c8
-rw-r--r--arch/i386/kernel/cpu/cpufreq/p4-clockmod.c38
-rw-r--r--arch/i386/kernel/cpu/cpufreq/sc520_freq.c7
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c15
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-lib.c32
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-lib.h1
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-smi.c3
-rw-r--r--arch/powerpc/platforms/4xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig2
-rw-r--r--arch/ppc/Kconfig4
-rw-r--r--arch/ppc/platforms/4xx/Kconfig2
-rw-r--r--arch/um/drivers/net_kern.c3
-rw-r--r--arch/v850/Kconfig28
-rw-r--r--arch/x86_64/kernel/cpufreq/Kconfig6
-rw-r--r--arch/x86_64/kernel/cpufreq/Makefile2
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/watchdog/at91rm9200_wdt.c6
-rw-r--r--drivers/char/watchdog/mpcore_wdt.c2
-rw-r--r--drivers/char/watchdog/omap_wdt.c2
-rw-r--r--drivers/char/watchdog/pcwd_usb.c5
-rw-r--r--drivers/char/watchdog/rm9k_wdt.c44
-rw-r--r--drivers/cpufreq/cpufreq.c153
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c33
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c33
-rw-r--r--drivers/cpufreq/cpufreq_performance.c9
-rw-r--r--drivers/cpufreq/cpufreq_powersave.c9
-rw-r--r--drivers/cpufreq/cpufreq_stats.c11
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c11
-rw-r--r--drivers/cpufreq/freq_table.c28
-rw-r--r--drivers/ide/Kconfig2
-rw-r--r--drivers/leds/Kconfig22
-rw-r--r--drivers/media/video/ov7670.c2
-rw-r--r--drivers/net/e100.c3
-rw-r--r--drivers/serial/Kconfig4
-rw-r--r--drivers/serial/icom.c2
-rw-r--r--fs/Kconfig14
-rw-r--r--fs/binfmt_elf_fdpic.c3
-rw-r--r--include/asm-i386/msr.h5
-rw-r--r--include/asm-x86_64/msr.h4
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/linux/configfs.h25
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--init/Kconfig2
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--net/ipv4/ip_fragment.c2
-rw-r--r--sound/aoa/fabrics/Kconfig2
58 files changed, 927 insertions, 562 deletions
diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt
index 29b3f9ffc66c..ce0666e51036 100644
--- a/Documentation/cpu-freq/core.txt
+++ b/Documentation/cpu-freq/core.txt
@@ -24,7 +24,7 @@ Contents:
241. General Information 241. General Information
25======================= 25=======================
26 26
27The CPUFreq core code is located in linux/kernel/cpufreq.c. This 27The CPUFreq core code is located in drivers/cpufreq/cpufreq.c. This
28cpufreq code offers a standardized interface for the CPUFreq 28cpufreq code offers a standardized interface for the CPUFreq
29architecture drivers (those pieces of code that do actual 29architecture drivers (those pieces of code that do actual
30frequency transitions), as well as to "notifiers". These are device 30frequency transitions), as well as to "notifiers". These are device
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 031029e89fd9..64ce44da5936 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -259,3 +259,25 @@ Why: The new layer 3 independant connection tracking replaces the old
259Who: Patrick McHardy <kaber@trash.net> 259Who: Patrick McHardy <kaber@trash.net>
260 260
261--------------------------- 261---------------------------
262
263What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver
264When: December 2006
265Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are
266 functionally very much similar. They talk to ACPI in same way. Only
267 difference between them is the way they do frequency transitions.
268 One uses MSRs and the other one uses IO ports. Functionaliy of
269 speedstep_centrino with ACPI hooks is now merged into acpi-cpufreq.
270 That means one common driver will support all Intel Enhanced Speedstep
271 capable CPUs. That means less confusion over name of
272 speedstep-centrino driver (with that driver supposed to be used on
273 non-centrino platforms). That means less duplication of code and
274 less maintenance effort and no possibility of these two drivers
275 going out of sync.
276 Current users of speedstep_centrino with ACPI hooks are requested to
277 switch over to acpi-cpufreq driver. speedstep-centrino will continue
278 to work using older non-ACPI static table based scheme even after this
279 date.
280
281Who: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
282
283---------------------------
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index 125093c3ef76..536d5bfbdb8d 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -29,7 +29,7 @@ them. A single configuration option is defined like this:
29 29
30config MODVERSIONS 30config MODVERSIONS
31 bool "Set version information on all module symbols" 31 bool "Set version information on all module symbols"
32 depends MODULES 32 depends on MODULES
33 help 33 help
34 Usually, modules have to be recompiled whenever you switch to a new 34 Usually, modules have to be recompiled whenever you switch to a new
35 kernel. ... 35 kernel. ...
@@ -163,7 +163,7 @@ The position of a menu entry in the tree is determined in two ways. First
163it can be specified explicitly: 163it can be specified explicitly:
164 164
165menu "Network device support" 165menu "Network device support"
166 depends NET 166 depends on NET
167 167
168config NETDEVICES 168config NETDEVICES
169 ... 169 ...
@@ -188,10 +188,10 @@ config MODULES
188 188
189config MODVERSIONS 189config MODVERSIONS
190 bool "Set version information on all module symbols" 190 bool "Set version information on all module symbols"
191 depends MODULES 191 depends on MODULES
192 192
193comment "module support disabled" 193comment "module support disabled"
194 depends !MODULES 194 depends on !MODULES
195 195
196MODVERSIONS directly depends on MODULES, this means it's only visible if 196MODVERSIONS directly depends on MODULES, this means it's only visible if
197MODULES is different from 'n'. The comment on the other hand is always 197MODULES is different from 'n'. The comment on the other hand is always
diff --git a/MAINTAINERS b/MAINTAINERS
index b2024938adcf..8a0bfeca55c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -740,7 +740,7 @@ P: Dave Jones
740M: davej@codemonkey.org.uk 740M: davej@codemonkey.org.uk
741L: cpufreq@lists.linux.org.uk 741L: cpufreq@lists.linux.org.uk
742W: http://www.codemonkey.org.uk/projects/cpufreq/ 742W: http://www.codemonkey.org.uk/projects/cpufreq/
743T: git kernel.org/pub/scm/linux/kernel/davej/cpufreq.git 743T: git kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git
744S: Maintained 744S: Maintained
745 745
746CPUID/MSR DRIVER 746CPUID/MSR DRIVER
@@ -1504,8 +1504,10 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
1504S: Maintained 1504S: Maintained
1505 1505
1506INOTIFY 1506INOTIFY
1507P: John McCutchan and Robert Love 1507P: John McCutchan
1508M: ttb@tentacle.dhs.org and rml@novell.com 1508M: ttb@tentacle.dhs.org
1509P: Robert Love
1510M: rml@novell.com
1509L: linux-kernel@vger.kernel.org 1511L: linux-kernel@vger.kernel.org
1510S: Maintained 1512S: Maintained
1511 1513
diff --git a/Makefile b/Makefile
index 73e825b39a08..4eabaa8afbff 100644
--- a/Makefile
+++ b/Makefile
@@ -1100,9 +1100,9 @@ boards := $(notdir $(boards))
1100 1100
1101help: 1101help:
1102 @echo 'Cleaning targets:' 1102 @echo 'Cleaning targets:'
1103 @echo ' clean - remove most generated files but keep the config and' 1103 @echo ' clean - Remove most generated files but keep the config and'
1104 @echo ' enough build support to build external modules' 1104 @echo ' enough build support to build external modules'
1105 @echo ' mrproper - remove all generated files + config + various backup files' 1105 @echo ' mrproper - Remove all generated files + config + various backup files'
1106 @echo ' distclean - mrproper + remove editor backup and patch files' 1106 @echo ' distclean - mrproper + remove editor backup and patch files'
1107 @echo '' 1107 @echo ''
1108 @echo 'Configuration targets:' 1108 @echo 'Configuration targets:'
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 9e3d0bdcba07..5c0a10041cd1 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -75,28 +75,28 @@ endmenu
75 75
76config MACH_POODLE 76config MACH_POODLE
77 bool "Enable Sharp SL-5600 (Poodle) Support" 77 bool "Enable Sharp SL-5600 (Poodle) Support"
78 depends PXA_SHARPSL_25x 78 depends on PXA_SHARPSL_25x
79 select SHARP_LOCOMO 79 select SHARP_LOCOMO
80 select PXA_SSP 80 select PXA_SSP
81 81
82config MACH_CORGI 82config MACH_CORGI
83 bool "Enable Sharp SL-C700 (Corgi) Support" 83 bool "Enable Sharp SL-C700 (Corgi) Support"
84 depends PXA_SHARPSL_25x 84 depends on PXA_SHARPSL_25x
85 select PXA_SHARP_C7xx 85 select PXA_SHARP_C7xx
86 86
87config MACH_SHEPHERD 87config MACH_SHEPHERD
88 bool "Enable Sharp SL-C750 (Shepherd) Support" 88 bool "Enable Sharp SL-C750 (Shepherd) Support"
89 depends PXA_SHARPSL_25x 89 depends on PXA_SHARPSL_25x
90 select PXA_SHARP_C7xx 90 select PXA_SHARP_C7xx
91 91
92config MACH_HUSKY 92config MACH_HUSKY
93 bool "Enable Sharp SL-C760 (Husky) Support" 93 bool "Enable Sharp SL-C760 (Husky) Support"
94 depends PXA_SHARPSL_25x 94 depends on PXA_SHARPSL_25x
95 select PXA_SHARP_C7xx 95 select PXA_SHARP_C7xx
96 96
97config MACH_AKITA 97config MACH_AKITA
98 bool "Enable Sharp SL-1000 (Akita) Support" 98 bool "Enable Sharp SL-1000 (Akita) Support"
99 depends PXA_SHARPSL_27x 99 depends on PXA_SHARPSL_27x
100 select PXA_SHARP_Cxx00 100 select PXA_SHARP_Cxx00
101 select MACH_SPITZ 101 select MACH_SPITZ
102 select I2C 102 select I2C
@@ -104,17 +104,17 @@ config MACH_AKITA
104 104
105config MACH_SPITZ 105config MACH_SPITZ
106 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support" 106 bool "Enable Sharp Zaurus SL-3000 (Spitz) Support"
107 depends PXA_SHARPSL_27x 107 depends on PXA_SHARPSL_27x
108 select PXA_SHARP_Cxx00 108 select PXA_SHARP_Cxx00
109 109
110config MACH_BORZOI 110config MACH_BORZOI
111 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support" 111 bool "Enable Sharp Zaurus SL-3100 (Borzoi) Support"
112 depends PXA_SHARPSL_27x 112 depends on PXA_SHARPSL_27x
113 select PXA_SHARP_Cxx00 113 select PXA_SHARP_Cxx00
114 114
115config MACH_TOSA 115config MACH_TOSA
116 bool "Enable Sharp SL-6000x (Tosa) Support" 116 bool "Enable Sharp SL-6000x (Tosa) Support"
117 depends PXA_SHARPSL_25x 117 depends on PXA_SHARPSL_25x
118 118
119config PXA25x 119config PXA25x
120 bool 120 bool
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index ec752e16d618..f2dc363de66b 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -113,7 +113,7 @@ endchoice
113 113
114config OMAP_SERIAL_WAKE 114config OMAP_SERIAL_WAKE
115 bool "Enable wake-up events for serial ports" 115 bool "Enable wake-up events for serial ports"
116 depends OMAP_MUX 116 depends on OMAP_MUX
117 default y 117 default y
118 help 118 help
119 Select this option if you want to have your system wake up 119 Select this option if you want to have your system wake up
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
index ccc1edff5c97..5299c5bf4454 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig
@@ -17,6 +17,7 @@ config X86_ACPI_CPUFREQ
17 help 17 help
18 This driver adds a CPUFreq driver which utilizes the ACPI 18 This driver adds a CPUFreq driver which utilizes the ACPI
19 Processor Performance States. 19 Processor Performance States.
20 This driver also supports Intel Enhanced Speedstep.
20 21
21 For details, take a look at <file:Documentation/cpu-freq/>. 22 For details, take a look at <file:Documentation/cpu-freq/>.
22 23
@@ -121,11 +122,14 @@ config X86_SPEEDSTEP_CENTRINO
121 If in doubt, say N. 122 If in doubt, say N.
122 123
123config X86_SPEEDSTEP_CENTRINO_ACPI 124config X86_SPEEDSTEP_CENTRINO_ACPI
124 bool "Use ACPI tables to decode valid frequency/voltage pairs" 125 bool "Use ACPI tables to decode valid frequency/voltage (deprecated)"
125 depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR 126 depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR
126 depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m) 127 depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m)
127 default y 128 default y
128 help 129 help
130 This is deprecated and this functionality is now merged into
131 acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of
132 speedstep_centrino.
129 Use primarily the information provided in the BIOS ACPI tables 133 Use primarily the information provided in the BIOS ACPI tables
130 to determine valid CPU frequency and voltage pairings. It is 134 to determine valid CPU frequency and voltage pairings. It is
131 required for the driver to work on non-Banias CPUs. 135 required for the driver to work on non-Banias CPUs.
diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/i386/kernel/cpu/cpufreq/Makefile
index 2e894f1c8910..8de3abe322a9 100644
--- a/arch/i386/kernel/cpu/cpufreq/Makefile
+++ b/arch/i386/kernel/cpu/cpufreq/Makefile
@@ -7,9 +7,9 @@ obj-$(CONFIG_SC520_CPUFREQ) += sc520_freq.o
7obj-$(CONFIG_X86_LONGRUN) += longrun.o 7obj-$(CONFIG_X86_LONGRUN) += longrun.o
8obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o 8obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o
9obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o 9obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o
10obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
11obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o 10obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
12obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o 11obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o
13obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o 12obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
13obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
14obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o 14obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
15obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o 15obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 57c880bf0bd6..18f4715c655d 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -1,9 +1,10 @@
1/* 1/*
2 * acpi-cpufreq.c - ACPI Processor P-States Driver ($Revision: 1.3 $) 2 * acpi-cpufreq.c - ACPI Processor P-States Driver ($Revision: 1.4 $)
3 * 3 *
4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> 4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
6 * Copyright (C) 2002 - 2004 Dominik Brodowski <linux@brodo.de> 6 * Copyright (C) 2002 - 2004 Dominik Brodowski <linux@brodo.de>
7 * Copyright (C) 2006 Denis Sadykov <denis.m.sadykov@intel.com>
7 * 8 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * 10 *
@@ -27,202 +28,387 @@
27#include <linux/kernel.h> 28#include <linux/kernel.h>
28#include <linux/module.h> 29#include <linux/module.h>
29#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/smp.h>
32#include <linux/sched.h>
30#include <linux/cpufreq.h> 33#include <linux/cpufreq.h>
31#include <linux/proc_fs.h>
32#include <linux/seq_file.h>
33#include <linux/compiler.h> 34#include <linux/compiler.h>
34#include <linux/sched.h> /* current */
35#include <linux/dmi.h> 35#include <linux/dmi.h>
36#include <asm/io.h>
37#include <asm/delay.h>
38#include <asm/uaccess.h>
39 36
40#include <linux/acpi.h> 37#include <linux/acpi.h>
41#include <acpi/processor.h> 38#include <acpi/processor.h>
42 39
40#include <asm/io.h>
41#include <asm/msr.h>
42#include <asm/processor.h>
43#include <asm/cpufeature.h>
44#include <asm/delay.h>
45#include <asm/uaccess.h>
46
43#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg) 47#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
44 48
45MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); 49MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
46MODULE_DESCRIPTION("ACPI Processor P-States Driver"); 50MODULE_DESCRIPTION("ACPI Processor P-States Driver");
47MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
48 52
53enum {
54 UNDEFINED_CAPABLE = 0,
55 SYSTEM_INTEL_MSR_CAPABLE,
56 SYSTEM_IO_CAPABLE,
57};
58
59#define INTEL_MSR_RANGE (0xffff)
60#define CPUID_6_ECX_APERFMPERF_CAPABILITY (0x1)
49 61
50struct cpufreq_acpi_io { 62struct acpi_cpufreq_data {
51 struct acpi_processor_performance *acpi_data; 63 struct acpi_processor_performance *acpi_data;
52 struct cpufreq_frequency_table *freq_table; 64 struct cpufreq_frequency_table *freq_table;
53 unsigned int resume; 65 unsigned int max_freq;
66 unsigned int resume;
67 unsigned int cpu_feature;
54}; 68};
55 69
56static struct cpufreq_acpi_io *acpi_io_data[NR_CPUS]; 70static struct acpi_cpufreq_data *drv_data[NR_CPUS];
57static struct acpi_processor_performance *acpi_perf_data[NR_CPUS]; 71static struct acpi_processor_performance *acpi_perf_data[NR_CPUS];
58 72
59static struct cpufreq_driver acpi_cpufreq_driver; 73static struct cpufreq_driver acpi_cpufreq_driver;
60 74
61static unsigned int acpi_pstate_strict; 75static unsigned int acpi_pstate_strict;
62 76
63static int 77static int check_est_cpu(unsigned int cpuid)
64acpi_processor_write_port( 78{
65 u16 port, 79 struct cpuinfo_x86 *cpu = &cpu_data[cpuid];
66 u8 bit_width, 80
67 u32 value) 81 if (cpu->x86_vendor != X86_VENDOR_INTEL ||
82 !cpu_has(cpu, X86_FEATURE_EST))
83 return 0;
84
85 return 1;
86}
87
88static unsigned extract_io(u32 value, struct acpi_cpufreq_data *data)
89{
90 struct acpi_processor_performance *perf;
91 int i;
92
93 perf = data->acpi_data;
94
95 for (i=0; i<perf->state_count; i++) {
96 if (value == perf->states[i].status)
97 return data->freq_table[i].frequency;
98 }
99 return 0;
100}
101
102static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
68{ 103{
69 if (bit_width <= 8) { 104 int i;
105 struct acpi_processor_performance *perf;
106
107 msr &= INTEL_MSR_RANGE;
108 perf = data->acpi_data;
109
110 for (i=0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
111 if (msr == perf->states[data->freq_table[i].index].status)
112 return data->freq_table[i].frequency;
113 }
114 return data->freq_table[0].frequency;
115}
116
117static unsigned extract_freq(u32 val, struct acpi_cpufreq_data *data)
118{
119 switch (data->cpu_feature) {
120 case SYSTEM_INTEL_MSR_CAPABLE:
121 return extract_msr(val, data);
122 case SYSTEM_IO_CAPABLE:
123 return extract_io(val, data);
124 default:
125 return 0;
126 }
127}
128
129static void wrport(u16 port, u8 bit_width, u32 value)
130{
131 if (bit_width <= 8)
70 outb(value, port); 132 outb(value, port);
71 } else if (bit_width <= 16) { 133 else if (bit_width <= 16)
72 outw(value, port); 134 outw(value, port);
73 } else if (bit_width <= 32) { 135 else if (bit_width <= 32)
74 outl(value, port); 136 outl(value, port);
75 } else {
76 return -ENODEV;
77 }
78 return 0;
79} 137}
80 138
81static int 139static void rdport(u16 port, u8 bit_width, u32 * ret)
82acpi_processor_read_port(
83 u16 port,
84 u8 bit_width,
85 u32 *ret)
86{ 140{
87 *ret = 0; 141 *ret = 0;
88 if (bit_width <= 8) { 142 if (bit_width <= 8)
89 *ret = inb(port); 143 *ret = inb(port);
90 } else if (bit_width <= 16) { 144 else if (bit_width <= 16)
91 *ret = inw(port); 145 *ret = inw(port);
92 } else if (bit_width <= 32) { 146 else if (bit_width <= 32)
93 *ret = inl(port); 147 *ret = inl(port);
94 } else { 148}
95 return -ENODEV; 149
150struct msr_addr {
151 u32 reg;
152};
153
154struct io_addr {
155 u16 port;
156 u8 bit_width;
157};
158
159typedef union {
160 struct msr_addr msr;
161 struct io_addr io;
162} drv_addr_union;
163
164struct drv_cmd {
165 unsigned int type;
166 cpumask_t mask;
167 drv_addr_union addr;
168 u32 val;
169};
170
171static void do_drv_read(struct drv_cmd *cmd)
172{
173 u32 h;
174
175 switch (cmd->type) {
176 case SYSTEM_INTEL_MSR_CAPABLE:
177 rdmsr(cmd->addr.msr.reg, cmd->val, h);
178 break;
179 case SYSTEM_IO_CAPABLE:
180 rdport(cmd->addr.io.port, cmd->addr.io.bit_width, &cmd->val);
181 break;
182 default:
183 break;
96 } 184 }
97 return 0;
98} 185}
99 186
100static int 187static void do_drv_write(struct drv_cmd *cmd)
101acpi_processor_set_performance (
102 struct cpufreq_acpi_io *data,
103 unsigned int cpu,
104 int state)
105{ 188{
106 u16 port = 0; 189 u32 h = 0;
107 u8 bit_width = 0; 190
108 int i = 0; 191 switch (cmd->type) {
109 int ret = 0; 192 case SYSTEM_INTEL_MSR_CAPABLE:
110 u32 value = 0; 193 wrmsr(cmd->addr.msr.reg, cmd->val, h);
111 int retval; 194 break;
112 struct acpi_processor_performance *perf; 195 case SYSTEM_IO_CAPABLE:
113 196 wrport(cmd->addr.io.port, cmd->addr.io.bit_width, cmd->val);
114 dprintk("acpi_processor_set_performance\n"); 197 break;
115 198 default:
116 retval = 0; 199 break;
117 perf = data->acpi_data;
118 if (state == perf->state) {
119 if (unlikely(data->resume)) {
120 dprintk("Called after resume, resetting to P%d\n", state);
121 data->resume = 0;
122 } else {
123 dprintk("Already at target state (P%d)\n", state);
124 return (retval);
125 }
126 } 200 }
201}
127 202
128 dprintk("Transitioning from P%d to P%d\n", perf->state, state); 203static void drv_read(struct drv_cmd *cmd)
204{
205 cpumask_t saved_mask = current->cpus_allowed;
206 cmd->val = 0;
129 207
130 /* 208 set_cpus_allowed(current, cmd->mask);
131 * First we write the target state's 'control' value to the 209 do_drv_read(cmd);
132 * control_register. 210 set_cpus_allowed(current, saved_mask);
133 */ 211}
212
213static void drv_write(struct drv_cmd *cmd)
214{
215 cpumask_t saved_mask = current->cpus_allowed;
216 unsigned int i;
217
218 for_each_cpu_mask(i, cmd->mask) {
219 set_cpus_allowed(current, cpumask_of_cpu(i));
220 do_drv_write(cmd);
221 }
222
223 set_cpus_allowed(current, saved_mask);
224 return;
225}
226
227static u32 get_cur_val(cpumask_t mask)
228{
229 struct acpi_processor_performance *perf;
230 struct drv_cmd cmd;
231
232 if (unlikely(cpus_empty(mask)))
233 return 0;
234
235 switch (drv_data[first_cpu(mask)]->cpu_feature) {
236 case SYSTEM_INTEL_MSR_CAPABLE:
237 cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
238 cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
239 break;
240 case SYSTEM_IO_CAPABLE:
241 cmd.type = SYSTEM_IO_CAPABLE;
242 perf = drv_data[first_cpu(mask)]->acpi_data;
243 cmd.addr.io.port = perf->control_register.address;
244 cmd.addr.io.bit_width = perf->control_register.bit_width;
245 break;
246 default:
247 return 0;
248 }
249
250 cmd.mask = mask;
134 251
135 port = perf->control_register.address; 252 drv_read(&cmd);
136 bit_width = perf->control_register.bit_width;
137 value = (u32) perf->states[state].control;
138 253
139 dprintk("Writing 0x%08x to port 0x%04x\n", value, port); 254 dprintk("get_cur_val = %u\n", cmd.val);
140 255
141 ret = acpi_processor_write_port(port, bit_width, value); 256 return cmd.val;
142 if (ret) { 257}
143 dprintk("Invalid port width 0x%04x\n", bit_width); 258
144 return (ret); 259/*
260 * Return the measured active (C0) frequency on this CPU since last call
261 * to this function.
262 * Input: cpu number
263 * Return: Average CPU frequency in terms of max frequency (zero on error)
264 *
265 * We use IA32_MPERF and IA32_APERF MSRs to get the measured performance
266 * over a period of time, while CPU is in C0 state.
267 * IA32_MPERF counts at the rate of max advertised frequency
268 * IA32_APERF counts at the rate of actual CPU frequency
269 * Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
270 * no meaning should be associated with absolute values of these MSRs.
271 */
272static unsigned int get_measured_perf(unsigned int cpu)
273{
274 union {
275 struct {
276 u32 lo;
277 u32 hi;
278 } split;
279 u64 whole;
280 } aperf_cur, mperf_cur;
281
282 cpumask_t saved_mask;
283 unsigned int perf_percent;
284 unsigned int retval;
285
286 saved_mask = current->cpus_allowed;
287 set_cpus_allowed(current, cpumask_of_cpu(cpu));
288 if (get_cpu() != cpu) {
289 /* We were not able to run on requested processor */
290 put_cpu();
291 return 0;
145 } 292 }
146 293
294 rdmsr(MSR_IA32_APERF, aperf_cur.split.lo, aperf_cur.split.hi);
295 rdmsr(MSR_IA32_MPERF, mperf_cur.split.lo, mperf_cur.split.hi);
296
297 wrmsr(MSR_IA32_APERF, 0,0);
298 wrmsr(MSR_IA32_MPERF, 0,0);
299
300#ifdef __i386__
147 /* 301 /*
148 * Assume the write went through when acpi_pstate_strict is not used. 302 * We dont want to do 64 bit divide with 32 bit kernel
149 * As read status_register is an expensive operation and there 303 * Get an approximate value. Return failure in case we cannot get
150 * are no specific error cases where an IO port write will fail. 304 * an approximate value.
151 */ 305 */
152 if (acpi_pstate_strict) { 306 if (unlikely(aperf_cur.split.hi || mperf_cur.split.hi)) {
153 /* Then we read the 'status_register' and compare the value 307 int shift_count;
154 * with the target state's 'status' to make sure the 308 u32 h;
155 * transition was successful. 309
156 * Note that we'll poll for up to 1ms (100 cycles of 10us) 310 h = max_t(u32, aperf_cur.split.hi, mperf_cur.split.hi);
157 * before giving up. 311 shift_count = fls(h);
158 */ 312
159 313 aperf_cur.whole >>= shift_count;
160 port = perf->status_register.address; 314 mperf_cur.whole >>= shift_count;
161 bit_width = perf->status_register.bit_width; 315 }
162 316
163 dprintk("Looking for 0x%08x from port 0x%04x\n", 317 if (((unsigned long)(-1) / 100) < aperf_cur.split.lo) {
164 (u32) perf->states[state].status, port); 318 int shift_count = 7;
165 319 aperf_cur.split.lo >>= shift_count;
166 for (i = 0; i < 100; i++) { 320 mperf_cur.split.lo >>= shift_count;
167 ret = acpi_processor_read_port(port, bit_width, &value); 321 }
168 if (ret) { 322
169 dprintk("Invalid port width 0x%04x\n", bit_width); 323 if (aperf_cur.split.lo && mperf_cur.split.lo)
170 return (ret); 324 perf_percent = (aperf_cur.split.lo * 100) / mperf_cur.split.lo;
171 } 325 else
172 if (value == (u32) perf->states[state].status) 326 perf_percent = 0;
173 break; 327
174 udelay(10); 328#else
175 } 329 if (unlikely(((unsigned long)(-1) / 100) < aperf_cur.whole)) {
176 } else { 330 int shift_count = 7;
177 value = (u32) perf->states[state].status; 331 aperf_cur.whole >>= shift_count;
332 mperf_cur.whole >>= shift_count;
178 } 333 }
179 334
180 if (unlikely(value != (u32) perf->states[state].status)) { 335 if (aperf_cur.whole && mperf_cur.whole)
181 printk(KERN_WARNING "acpi-cpufreq: Transition failed\n"); 336 perf_percent = (aperf_cur.whole * 100) / mperf_cur.whole;
182 retval = -ENODEV; 337 else
183 return (retval); 338 perf_percent = 0;
339
340#endif
341
342 retval = drv_data[cpu]->max_freq * perf_percent / 100;
343
344 put_cpu();
345 set_cpus_allowed(current, saved_mask);
346
347 dprintk("cpu %d: performance percent %d\n", cpu, perf_percent);
348 return retval;
349}
350
351static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
352{
353 struct acpi_cpufreq_data *data = drv_data[cpu];
354 unsigned int freq;
355
356 dprintk("get_cur_freq_on_cpu (%d)\n", cpu);
357
358 if (unlikely(data == NULL ||
359 data->acpi_data == NULL || data->freq_table == NULL)) {
360 return 0;
184 } 361 }
185 362
186 dprintk("Transition successful after %d microseconds\n", i * 10); 363 freq = extract_freq(get_cur_val(cpumask_of_cpu(cpu)), data);
364 dprintk("cur freq = %u\n", freq);
187 365
188 perf->state = state; 366 return freq;
189 return (retval);
190} 367}
191 368
369static unsigned int check_freqs(cpumask_t mask, unsigned int freq,
370 struct acpi_cpufreq_data *data)
371{
372 unsigned int cur_freq;
373 unsigned int i;
374
375 for (i=0; i<100; i++) {
376 cur_freq = extract_freq(get_cur_val(mask), data);
377 if (cur_freq == freq)
378 return 1;
379 udelay(10);
380 }
381 return 0;
382}
192 383
193static int 384static int acpi_cpufreq_target(struct cpufreq_policy *policy,
194acpi_cpufreq_target ( 385 unsigned int target_freq, unsigned int relation)
195 struct cpufreq_policy *policy,
196 unsigned int target_freq,
197 unsigned int relation)
198{ 386{
199 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; 387 struct acpi_cpufreq_data *data = drv_data[policy->cpu];
200 struct acpi_processor_performance *perf; 388 struct acpi_processor_performance *perf;
201 struct cpufreq_freqs freqs; 389 struct cpufreq_freqs freqs;
202 cpumask_t online_policy_cpus; 390 cpumask_t online_policy_cpus;
203 cpumask_t saved_mask; 391 struct drv_cmd cmd;
204 cpumask_t set_mask; 392 unsigned int msr;
205 cpumask_t covered_cpus;
206 unsigned int cur_state = 0;
207 unsigned int next_state = 0; 393 unsigned int next_state = 0;
208 unsigned int result = 0; 394 unsigned int next_perf_state = 0;
209 unsigned int j; 395 unsigned int i;
210 unsigned int tmp; 396 int result = 0;
211 397
212 dprintk("acpi_cpufreq_setpolicy\n"); 398 dprintk("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu);
213 399
214 result = cpufreq_frequency_table_target(policy, 400 if (unlikely(data == NULL ||
215 data->freq_table, 401 data->acpi_data == NULL || data->freq_table == NULL)) {
216 target_freq, 402 return -ENODEV;
217 relation, 403 }
218 &next_state);
219 if (unlikely(result))
220 return (result);
221 404
222 perf = data->acpi_data; 405 perf = data->acpi_data;
223 cur_state = perf->state; 406 result = cpufreq_frequency_table_target(policy,
224 freqs.old = data->freq_table[cur_state].frequency; 407 data->freq_table,
225 freqs.new = data->freq_table[next_state].frequency; 408 target_freq,
409 relation, &next_state);
410 if (unlikely(result))
411 return -ENODEV;
226 412
227#ifdef CONFIG_HOTPLUG_CPU 413#ifdef CONFIG_HOTPLUG_CPU
228 /* cpufreq holds the hotplug lock, so we are safe from here on */ 414 /* cpufreq holds the hotplug lock, so we are safe from here on */
@@ -231,106 +417,84 @@ acpi_cpufreq_target (
231 online_policy_cpus = policy->cpus; 417 online_policy_cpus = policy->cpus;
232#endif 418#endif
233 419
234 for_each_cpu_mask(j, online_policy_cpus) { 420 next_perf_state = data->freq_table[next_state].index;
235 freqs.cpu = j; 421 if (perf->state == next_perf_state) {
236 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 422 if (unlikely(data->resume)) {
423 dprintk("Called after resume, resetting to P%d\n",
424 next_perf_state);
425 data->resume = 0;
426 } else {
427 dprintk("Already at target state (P%d)\n",
428 next_perf_state);
429 return 0;
430 }
237 } 431 }
238 432
239 /* 433 switch (data->cpu_feature) {
240 * We need to call driver->target() on all or any CPU in 434 case SYSTEM_INTEL_MSR_CAPABLE:
241 * policy->cpus, depending on policy->shared_type. 435 cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
242 */ 436 cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
243 saved_mask = current->cpus_allowed; 437 msr =
244 cpus_clear(covered_cpus); 438 (u32) perf->states[next_perf_state].
245 for_each_cpu_mask(j, online_policy_cpus) { 439 control & INTEL_MSR_RANGE;
246 /* 440 cmd.val = (cmd.val & ~INTEL_MSR_RANGE) | msr;
247 * Support for SMP systems. 441 break;
248 * Make sure we are running on CPU that wants to change freq 442 case SYSTEM_IO_CAPABLE:
249 */ 443 cmd.type = SYSTEM_IO_CAPABLE;
250 cpus_clear(set_mask); 444 cmd.addr.io.port = perf->control_register.address;
251 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) 445 cmd.addr.io.bit_width = perf->control_register.bit_width;
252 cpus_or(set_mask, set_mask, online_policy_cpus); 446 cmd.val = (u32) perf->states[next_perf_state].control;
253 else 447 break;
254 cpu_set(j, set_mask); 448 default:
255 449 return -ENODEV;
256 set_cpus_allowed(current, set_mask); 450 }
257 if (unlikely(!cpu_isset(smp_processor_id(), set_mask))) {
258 dprintk("couldn't limit to CPUs in this domain\n");
259 result = -EAGAIN;
260 break;
261 }
262 451
263 result = acpi_processor_set_performance (data, j, next_state); 452 cpus_clear(cmd.mask);
264 if (result) {
265 result = -EAGAIN;
266 break;
267 }
268 453
269 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) 454 if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY)
270 break; 455 cmd.mask = online_policy_cpus;
271 456 else
272 cpu_set(j, covered_cpus); 457 cpu_set(policy->cpu, cmd.mask);
273 }
274 458
275 for_each_cpu_mask(j, online_policy_cpus) { 459 freqs.old = data->freq_table[perf->state].frequency;
276 freqs.cpu = j; 460 freqs.new = data->freq_table[next_perf_state].frequency;
277 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 461 for_each_cpu_mask(i, cmd.mask) {
462 freqs.cpu = i;
463 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
278 } 464 }
279 465
280 if (unlikely(result)) { 466 drv_write(&cmd);
281 /*
282 * We have failed halfway through the frequency change.
283 * We have sent callbacks to online_policy_cpus and
284 * acpi_processor_set_performance() has been called on
285 * coverd_cpus. Best effort undo..
286 */
287
288 if (!cpus_empty(covered_cpus)) {
289 for_each_cpu_mask(j, covered_cpus) {
290 policy->cpu = j;
291 acpi_processor_set_performance (data,
292 j,
293 cur_state);
294 }
295 }
296 467
297 tmp = freqs.new; 468 if (acpi_pstate_strict) {
298 freqs.new = freqs.old; 469 if (!check_freqs(cmd.mask, freqs.new, data)) {
299 freqs.old = tmp; 470 dprintk("acpi_cpufreq_target failed (%d)\n",
300 for_each_cpu_mask(j, online_policy_cpus) { 471 policy->cpu);
301 freqs.cpu = j; 472 return -EAGAIN;
302 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
303 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
304 } 473 }
305 } 474 }
306 475
307 set_cpus_allowed(current, saved_mask); 476 for_each_cpu_mask(i, cmd.mask) {
308 return (result); 477 freqs.cpu = i;
309} 478 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
479 }
480 perf->state = next_perf_state;
310 481
482 return result;
483}
311 484
312static int 485static int acpi_cpufreq_verify(struct cpufreq_policy *policy)
313acpi_cpufreq_verify (
314 struct cpufreq_policy *policy)
315{ 486{
316 unsigned int result = 0; 487 struct acpi_cpufreq_data *data = drv_data[policy->cpu];
317 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
318 488
319 dprintk("acpi_cpufreq_verify\n"); 489 dprintk("acpi_cpufreq_verify\n");
320 490
321 result = cpufreq_frequency_table_verify(policy, 491 return cpufreq_frequency_table_verify(policy, data->freq_table);
322 data->freq_table);
323
324 return (result);
325} 492}
326 493
327
328static unsigned long 494static unsigned long
329acpi_cpufreq_guess_freq ( 495acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
330 struct cpufreq_acpi_io *data,
331 unsigned int cpu)
332{ 496{
333 struct acpi_processor_performance *perf = data->acpi_data; 497 struct acpi_processor_performance *perf = data->acpi_data;
334 498
335 if (cpu_khz) { 499 if (cpu_khz) {
336 /* search the closest match to cpu_khz */ 500 /* search the closest match to cpu_khz */
@@ -338,16 +502,16 @@ acpi_cpufreq_guess_freq (
338 unsigned long freq; 502 unsigned long freq;
339 unsigned long freqn = perf->states[0].core_frequency * 1000; 503 unsigned long freqn = perf->states[0].core_frequency * 1000;
340 504
341 for (i = 0; i < (perf->state_count - 1); i++) { 505 for (i=0; i<(perf->state_count-1); i++) {
342 freq = freqn; 506 freq = freqn;
343 freqn = perf->states[i+1].core_frequency * 1000; 507 freqn = perf->states[i+1].core_frequency * 1000;
344 if ((2 * cpu_khz) > (freqn + freq)) { 508 if ((2 * cpu_khz) > (freqn + freq)) {
345 perf->state = i; 509 perf->state = i;
346 return (freq); 510 return freq;
347 } 511 }
348 } 512 }
349 perf->state = perf->state_count - 1; 513 perf->state = perf->state_count-1;
350 return (freqn); 514 return freqn;
351 } else { 515 } else {
352 /* assume CPU is at P0... */ 516 /* assume CPU is at P0... */
353 perf->state = 0; 517 perf->state = 0;
@@ -355,7 +519,6 @@ acpi_cpufreq_guess_freq (
355 } 519 }
356} 520}
357 521
358
359/* 522/*
360 * acpi_cpufreq_early_init - initialize ACPI P-States library 523 * acpi_cpufreq_early_init - initialize ACPI P-States library
361 * 524 *
@@ -364,30 +527,34 @@ acpi_cpufreq_guess_freq (
364 * do _PDC and _PSD and find out the processor dependency for the 527 * do _PDC and _PSD and find out the processor dependency for the
365 * actual init that will happen later... 528 * actual init that will happen later...
366 */ 529 */
367static int acpi_cpufreq_early_init_acpi(void) 530static int acpi_cpufreq_early_init(void)
368{ 531{
369 struct acpi_processor_performance *data; 532 struct acpi_processor_performance *data;
370 unsigned int i, j; 533 cpumask_t covered;
534 unsigned int i, j;
371 535
372 dprintk("acpi_cpufreq_early_init\n"); 536 dprintk("acpi_cpufreq_early_init\n");
373 537
374 for_each_possible_cpu(i) { 538 for_each_possible_cpu(i) {
375 data = kzalloc(sizeof(struct acpi_processor_performance), 539 data = kzalloc(sizeof(struct acpi_processor_performance),
376 GFP_KERNEL); 540 GFP_KERNEL);
377 if (!data) { 541 if (!data) {
378 for_each_possible_cpu(j) { 542 for_each_cpu_mask(j, covered) {
379 kfree(acpi_perf_data[j]); 543 kfree(acpi_perf_data[j]);
380 acpi_perf_data[j] = NULL; 544 acpi_perf_data[j] = NULL;
381 } 545 }
382 return (-ENOMEM); 546 return -ENOMEM;
383 } 547 }
384 acpi_perf_data[i] = data; 548 acpi_perf_data[i] = data;
549 cpu_set(i, covered);
385 } 550 }
386 551
387 /* Do initialization in ACPI core */ 552 /* Do initialization in ACPI core */
388 return acpi_processor_preregister_performance(acpi_perf_data); 553 acpi_processor_preregister_performance(acpi_perf_data);
554 return 0;
389} 555}
390 556
557#ifdef CONFIG_SMP
391/* 558/*
392 * Some BIOSes do SW_ANY coordination internally, either set it up in hw 559 * Some BIOSes do SW_ANY coordination internally, either set it up in hw
393 * or do it in BIOS firmware and won't inform about it to OS. If not 560 * or do it in BIOS firmware and won't inform about it to OS. If not
@@ -414,39 +581,42 @@ static struct dmi_system_id sw_any_bug_dmi_table[] = {
414 }, 581 },
415 { } 582 { }
416}; 583};
584#endif
417 585
418static int 586static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
419acpi_cpufreq_cpu_init (
420 struct cpufreq_policy *policy)
421{ 587{
422 unsigned int i; 588 unsigned int i;
423 unsigned int cpu = policy->cpu; 589 unsigned int valid_states = 0;
424 struct cpufreq_acpi_io *data; 590 unsigned int cpu = policy->cpu;
425 unsigned int result = 0; 591 struct acpi_cpufreq_data *data;
592 unsigned int result = 0;
426 struct cpuinfo_x86 *c = &cpu_data[policy->cpu]; 593 struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
427 struct acpi_processor_performance *perf; 594 struct acpi_processor_performance *perf;
428 595
429 dprintk("acpi_cpufreq_cpu_init\n"); 596 dprintk("acpi_cpufreq_cpu_init\n");
430 597
431 if (!acpi_perf_data[cpu]) 598 if (!acpi_perf_data[cpu])
432 return (-ENODEV); 599 return -ENODEV;
433 600
434 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); 601 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL);
435 if (!data) 602 if (!data)
436 return (-ENOMEM); 603 return -ENOMEM;
437 604
438 data->acpi_data = acpi_perf_data[cpu]; 605 data->acpi_data = acpi_perf_data[cpu];
439 acpi_io_data[cpu] = data; 606 drv_data[cpu] = data;
440 607
441 result = acpi_processor_register_performance(data->acpi_data, cpu); 608 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC))
609 acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
442 610
611 result = acpi_processor_register_performance(data->acpi_data, cpu);
443 if (result) 612 if (result)
444 goto err_free; 613 goto err_free;
445 614
446 perf = data->acpi_data; 615 perf = data->acpi_data;
447 policy->shared_type = perf->shared_type; 616 policy->shared_type = perf->shared_type;
617
448 /* 618 /*
449 * Will let policy->cpus know about dependency only when software 619 * Will let policy->cpus know about dependency only when software
450 * coordination is required. 620 * coordination is required.
451 */ 621 */
452 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || 622 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
@@ -462,10 +632,6 @@ acpi_cpufreq_cpu_init (
462 } 632 }
463#endif 633#endif
464 634
465 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
466 acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
467 }
468
469 /* capability check */ 635 /* capability check */
470 if (perf->state_count <= 1) { 636 if (perf->state_count <= 1) {
471 dprintk("No P-States\n"); 637 dprintk("No P-States\n");
@@ -473,17 +639,33 @@ acpi_cpufreq_cpu_init (
473 goto err_unreg; 639 goto err_unreg;
474 } 640 }
475 641
476 if ((perf->control_register.space_id != ACPI_ADR_SPACE_SYSTEM_IO) || 642 if (perf->control_register.space_id != perf->status_register.space_id) {
477 (perf->status_register.space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { 643 result = -ENODEV;
478 dprintk("Unsupported address space [%d, %d]\n", 644 goto err_unreg;
479 (u32) (perf->control_register.space_id), 645 }
480 (u32) (perf->status_register.space_id)); 646
647 switch (perf->control_register.space_id) {
648 case ACPI_ADR_SPACE_SYSTEM_IO:
649 dprintk("SYSTEM IO addr space\n");
650 data->cpu_feature = SYSTEM_IO_CAPABLE;
651 break;
652 case ACPI_ADR_SPACE_FIXED_HARDWARE:
653 dprintk("HARDWARE addr space\n");
654 if (!check_est_cpu(cpu)) {
655 result = -ENODEV;
656 goto err_unreg;
657 }
658 data->cpu_feature = SYSTEM_INTEL_MSR_CAPABLE;
659 break;
660 default:
661 dprintk("Unknown addr space %d\n",
662 (u32) (perf->control_register.space_id));
481 result = -ENODEV; 663 result = -ENODEV;
482 goto err_unreg; 664 goto err_unreg;
483 } 665 }
484 666
485 /* alloc freq_table */ 667 data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) *
486 data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) * (perf->state_count + 1), GFP_KERNEL); 668 (perf->state_count+1), GFP_KERNEL);
487 if (!data->freq_table) { 669 if (!data->freq_table) {
488 result = -ENOMEM; 670 result = -ENOMEM;
489 goto err_unreg; 671 goto err_unreg;
@@ -492,129 +674,140 @@ acpi_cpufreq_cpu_init (
492 /* detect transition latency */ 674 /* detect transition latency */
493 policy->cpuinfo.transition_latency = 0; 675 policy->cpuinfo.transition_latency = 0;
494 for (i=0; i<perf->state_count; i++) { 676 for (i=0; i<perf->state_count; i++) {
495 if ((perf->states[i].transition_latency * 1000) > policy->cpuinfo.transition_latency) 677 if ((perf->states[i].transition_latency * 1000) >
496 policy->cpuinfo.transition_latency = perf->states[i].transition_latency * 1000; 678 policy->cpuinfo.transition_latency)
679 policy->cpuinfo.transition_latency =
680 perf->states[i].transition_latency * 1000;
497 } 681 }
498 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 682 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
499 683
500 /* The current speed is unknown and not detectable by ACPI... */ 684 data->max_freq = perf->states[0].core_frequency * 1000;
501 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
502
503 /* table init */ 685 /* table init */
504 for (i=0; i<=perf->state_count; i++) 686 for (i=0; i<perf->state_count; i++) {
505 { 687 if (i>0 && perf->states[i].core_frequency ==
506 data->freq_table[i].index = i; 688 perf->states[i-1].core_frequency)
507 if (i<perf->state_count) 689 continue;
508 data->freq_table[i].frequency = perf->states[i].core_frequency * 1000; 690
509 else 691 data->freq_table[valid_states].index = i;
510 data->freq_table[i].frequency = CPUFREQ_TABLE_END; 692 data->freq_table[valid_states].frequency =
693 perf->states[i].core_frequency * 1000;
694 valid_states++;
511 } 695 }
696 data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
512 697
513 result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table); 698 result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
514 if (result) { 699 if (result)
515 goto err_freqfree; 700 goto err_freqfree;
701
702 switch (data->cpu_feature) {
703 case ACPI_ADR_SPACE_SYSTEM_IO:
704 /* Current speed is unknown and not detectable by IO port */
705 policy->cur = acpi_cpufreq_guess_freq(data, policy->cpu);
706 break;
707 case ACPI_ADR_SPACE_FIXED_HARDWARE:
708 acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
709 get_cur_freq_on_cpu(cpu);
710 break;
711 default:
712 break;
516 } 713 }
517 714
518 /* notify BIOS that we exist */ 715 /* notify BIOS that we exist */
519 acpi_processor_notify_smm(THIS_MODULE); 716 acpi_processor_notify_smm(THIS_MODULE);
520 717
521 printk(KERN_INFO "acpi-cpufreq: CPU%u - ACPI performance management activated.\n", 718 /* Check for APERF/MPERF support in hardware */
522 cpu); 719 if (c->x86_vendor == X86_VENDOR_INTEL && c->cpuid_level >= 6) {
720 unsigned int ecx;
721 ecx = cpuid_ecx(6);
722 if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY)
723 acpi_cpufreq_driver.getavg = get_measured_perf;
724 }
725
726 dprintk("CPU%u - ACPI performance management activated.\n", cpu);
523 for (i = 0; i < perf->state_count; i++) 727 for (i = 0; i < perf->state_count; i++)
524 dprintk(" %cP%d: %d MHz, %d mW, %d uS\n", 728 dprintk(" %cP%d: %d MHz, %d mW, %d uS\n",
525 (i == perf->state?'*':' '), i, 729 (i == perf->state ? '*' : ' '), i,
526 (u32) perf->states[i].core_frequency, 730 (u32) perf->states[i].core_frequency,
527 (u32) perf->states[i].power, 731 (u32) perf->states[i].power,
528 (u32) perf->states[i].transition_latency); 732 (u32) perf->states[i].transition_latency);
529 733
530 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); 734 cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu);
531 735
532 /* 736 /*
533 * the first call to ->target() should result in us actually 737 * the first call to ->target() should result in us actually
534 * writing something to the appropriate registers. 738 * writing something to the appropriate registers.
535 */ 739 */
536 data->resume = 1; 740 data->resume = 1;
537
538 return (result);
539 741
540 err_freqfree: 742 return result;
743
744err_freqfree:
541 kfree(data->freq_table); 745 kfree(data->freq_table);
542 err_unreg: 746err_unreg:
543 acpi_processor_unregister_performance(perf, cpu); 747 acpi_processor_unregister_performance(perf, cpu);
544 err_free: 748err_free:
545 kfree(data); 749 kfree(data);
546 acpi_io_data[cpu] = NULL; 750 drv_data[cpu] = NULL;
547 751
548 return (result); 752 return result;
549} 753}
550 754
551 755static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
552static int
553acpi_cpufreq_cpu_exit (
554 struct cpufreq_policy *policy)
555{ 756{
556 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; 757 struct acpi_cpufreq_data *data = drv_data[policy->cpu];
557
558 758
559 dprintk("acpi_cpufreq_cpu_exit\n"); 759 dprintk("acpi_cpufreq_cpu_exit\n");
560 760
561 if (data) { 761 if (data) {
562 cpufreq_frequency_table_put_attr(policy->cpu); 762 cpufreq_frequency_table_put_attr(policy->cpu);
563 acpi_io_data[policy->cpu] = NULL; 763 drv_data[policy->cpu] = NULL;
564 acpi_processor_unregister_performance(data->acpi_data, policy->cpu); 764 acpi_processor_unregister_performance(data->acpi_data,
765 policy->cpu);
565 kfree(data); 766 kfree(data);
566 } 767 }
567 768
568 return (0); 769 return 0;
569} 770}
570 771
571static int 772static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
572acpi_cpufreq_resume (
573 struct cpufreq_policy *policy)
574{ 773{
575 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; 774 struct acpi_cpufreq_data *data = drv_data[policy->cpu];
576
577 775
578 dprintk("acpi_cpufreq_resume\n"); 776 dprintk("acpi_cpufreq_resume\n");
579 777
580 data->resume = 1; 778 data->resume = 1;
581 779
582 return (0); 780 return 0;
583} 781}
584 782
585 783static struct freq_attr *acpi_cpufreq_attr[] = {
586static struct freq_attr* acpi_cpufreq_attr[] = {
587 &cpufreq_freq_attr_scaling_available_freqs, 784 &cpufreq_freq_attr_scaling_available_freqs,
588 NULL, 785 NULL,
589}; 786};
590 787
591static struct cpufreq_driver acpi_cpufreq_driver = { 788static struct cpufreq_driver acpi_cpufreq_driver = {
592 .verify = acpi_cpufreq_verify, 789 .verify = acpi_cpufreq_verify,
593 .target = acpi_cpufreq_target, 790 .target = acpi_cpufreq_target,
594 .init = acpi_cpufreq_cpu_init, 791 .init = acpi_cpufreq_cpu_init,
595 .exit = acpi_cpufreq_cpu_exit, 792 .exit = acpi_cpufreq_cpu_exit,
596 .resume = acpi_cpufreq_resume, 793 .resume = acpi_cpufreq_resume,
597 .name = "acpi-cpufreq", 794 .name = "acpi-cpufreq",
598 .owner = THIS_MODULE, 795 .owner = THIS_MODULE,
599 .attr = acpi_cpufreq_attr, 796 .attr = acpi_cpufreq_attr,
600}; 797};
601 798
602 799static int __init acpi_cpufreq_init(void)
603static int __init
604acpi_cpufreq_init (void)
605{ 800{
606 dprintk("acpi_cpufreq_init\n"); 801 dprintk("acpi_cpufreq_init\n");
607 802
608 acpi_cpufreq_early_init_acpi(); 803 acpi_cpufreq_early_init();
609 804
610 return cpufreq_register_driver(&acpi_cpufreq_driver); 805 return cpufreq_register_driver(&acpi_cpufreq_driver);
611} 806}
612 807
613 808static void __exit acpi_cpufreq_exit(void)
614static void __exit
615acpi_cpufreq_exit (void)
616{ 809{
617 unsigned int i; 810 unsigned int i;
618 dprintk("acpi_cpufreq_exit\n"); 811 dprintk("acpi_cpufreq_exit\n");
619 812
620 cpufreq_unregister_driver(&acpi_cpufreq_driver); 813 cpufreq_unregister_driver(&acpi_cpufreq_driver);
@@ -627,7 +820,9 @@ acpi_cpufreq_exit (void)
627} 820}
628 821
629module_param(acpi_pstate_strict, uint, 0644); 822module_param(acpi_pstate_strict, uint, 0644);
630MODULE_PARM_DESC(acpi_pstate_strict, "value 0 or non-zero. non-zero -> strict ACPI checks are performed during frequency changes."); 823MODULE_PARM_DESC(acpi_pstate_strict,
824 "value 0 or non-zero. non-zero -> strict ACPI checks are "
825 "performed during frequency changes.");
631 826
632late_initcall(acpi_cpufreq_init); 827late_initcall(acpi_cpufreq_init);
633module_exit(acpi_cpufreq_exit); 828module_exit(acpi_cpufreq_exit);
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
index 92afa3bc84f1..6667e9cceb9f 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
@@ -447,7 +447,6 @@ static int __init cpufreq_gx_init(void)
447 int ret; 447 int ret;
448 struct gxfreq_params *params; 448 struct gxfreq_params *params;
449 struct pci_dev *gx_pci; 449 struct pci_dev *gx_pci;
450 u32 class_rev;
451 450
452 /* Test if we have the right hardware */ 451 /* Test if we have the right hardware */
453 if ((gx_pci = gx_detect_chipset()) == NULL) 452 if ((gx_pci = gx_detect_chipset()) == NULL)
@@ -472,8 +471,7 @@ static int __init cpufreq_gx_init(void)
472 pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2)); 471 pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2));
473 pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration)); 472 pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration));
474 pci_read_config_byte(params->cs55x0, PCI_MODOFF, &(params->off_duration)); 473 pci_read_config_byte(params->cs55x0, PCI_MODOFF, &(params->off_duration));
475 pci_read_config_dword(params->cs55x0, PCI_CLASS_REVISION, &class_rev); 474 pci_read_config_byte(params->cs55x0, PCI_REVISION_ID, &params->pci_rev);
476 params->pci_rev = class_rev && 0xff;
477 475
478 if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) { 476 if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) {
479 kfree(params); 477 kfree(params);
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c
index 7233abe5d695..c548daad3476 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c
@@ -410,7 +410,7 @@ static int __init longhaul_get_ranges(void)
410 maxmult=longhaul_get_cpu_mult(); 410 maxmult=longhaul_get_cpu_mult();
411 411
412 /* Starting with the 1.2GHz parts, theres a 200MHz bus. */ 412 /* Starting with the 1.2GHz parts, theres a 200MHz bus. */
413 if ((cpu_khz/1000) > 1200) 413 if ((cpu_khz/maxmult) > 13400)
414 fsb = 200; 414 fsb = 200;
415 else 415 else
416 fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB]; 416 fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];
@@ -583,6 +583,10 @@ static int enable_arbiter_disable(void)
583 if (dev == NULL) { 583 if (dev == NULL) {
584 reg = 0x76; 584 reg = 0x76;
585 dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL); 585 dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
586 /* Find CN400 V-Link host bridge */
587 if (dev == NULL)
588 dev = pci_find_device(PCI_VENDOR_ID_VIA, 0x7259, NULL);
589
586 } 590 }
587 if (dev != NULL) { 591 if (dev != NULL) {
588 /* Enable access to port 0x22 */ 592 /* Enable access to port 0x22 */
@@ -734,7 +738,7 @@ print_support_type:
734 return 0; 738 return 0;
735 739
736err_acpi: 740err_acpi:
737 printk(KERN_ERR PFX "No ACPI support. No VT8601 or VT8623 northbridge. Aborting.\n"); 741 printk(KERN_ERR PFX "No ACPI support. Unsupported northbridge. Aborting.\n");
738 return -ENODEV; 742 return -ENODEV;
739} 743}
740 744
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
index 304d2eaa4a1b..bec50170b75a 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
@@ -163,29 +163,27 @@ static int cpufreq_p4_verify(struct cpufreq_policy *policy)
163 163
164static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c) 164static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
165{ 165{
166 if ((c->x86 == 0x06) && (c->x86_model == 0x09)) { 166 if (c->x86 == 0x06) {
167 /* Pentium M (Banias) */ 167 if (cpu_has(c, X86_FEATURE_EST))
168 printk(KERN_WARNING PFX "Warning: Pentium M detected. " 168 printk(KERN_WARNING PFX "Warning: EST-capable CPU detected. "
169 "The speedstep_centrino module offers voltage scaling" 169 "The acpi-cpufreq module offers voltage scaling"
170 " in addition of frequency scaling. You should use " 170 " in addition of frequency scaling. You should use "
171 "that instead of p4-clockmod, if possible.\n"); 171 "that instead of p4-clockmod, if possible.\n");
172 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM); 172 switch (c->x86_model) {
173 } 173 case 0x0E: /* Core */
174 174 case 0x0F: /* Core Duo */
175 if ((c->x86 == 0x06) && (c->x86_model == 0x0D)) { 175 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
176 /* Pentium M (Dothan) */ 176 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PCORE);
177 printk(KERN_WARNING PFX "Warning: Pentium M detected. " 177 case 0x0D: /* Pentium M (Dothan) */
178 "The speedstep_centrino module offers voltage scaling" 178 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
179 " in addition of frequency scaling. You should use " 179 /* fall through */
180 "that instead of p4-clockmod, if possible.\n"); 180 case 0x09: /* Pentium M (Banias) */
181 /* on P-4s, the TSC runs with constant frequency independent whether 181 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);
182 * throttling is active or not. */ 182 }
183 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
184 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM);
185 } 183 }
186 184
187 if (c->x86 != 0xF) { 185 if (c->x86 != 0xF) {
188 printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. Please send an e-mail to <linux@brodo.de>\n"); 186 printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. Please send an e-mail to <cpufreq@lists.linux.org.uk>\n");
189 return 0; 187 return 0;
190 } 188 }
191 189
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
index ef457d50f4ac..b8fb4b521c62 100644
--- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
@@ -153,6 +153,7 @@ static struct cpufreq_driver sc520_freq_driver = {
153static int __init sc520_freq_init(void) 153static int __init sc520_freq_init(void)
154{ 154{
155 struct cpuinfo_x86 *c = cpu_data; 155 struct cpuinfo_x86 *c = cpu_data;
156 int err;
156 157
157 /* Test if we have the right hardware */ 158 /* Test if we have the right hardware */
158 if(c->x86_vendor != X86_VENDOR_AMD || 159 if(c->x86_vendor != X86_VENDOR_AMD ||
@@ -166,7 +167,11 @@ static int __init sc520_freq_init(void)
166 return -ENOMEM; 167 return -ENOMEM;
167 } 168 }
168 169
169 return cpufreq_register_driver(&sc520_freq_driver); 170 err = cpufreq_register_driver(&sc520_freq_driver);
171 if (err)
172 iounmap(cpuctl);
173
174 return err;
170} 175}
171 176
172 177
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index e8993baf3d14..5113e9231634 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -36,6 +36,7 @@
36 36
37#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg) 37#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg)
38 38
39#define INTEL_MSR_RANGE (0xffff)
39 40
40struct cpu_id 41struct cpu_id
41{ 42{
@@ -379,6 +380,7 @@ static int centrino_cpu_early_init_acpi(void)
379} 380}
380 381
381 382
383#ifdef CONFIG_SMP
382/* 384/*
383 * Some BIOSes do SW_ANY coordination internally, either set it up in hw 385 * Some BIOSes do SW_ANY coordination internally, either set it up in hw
384 * or do it in BIOS firmware and won't inform about it to OS. If not 386 * or do it in BIOS firmware and won't inform about it to OS. If not
@@ -392,7 +394,6 @@ static int sw_any_bug_found(struct dmi_system_id *d)
392 return 0; 394 return 0;
393} 395}
394 396
395
396static struct dmi_system_id sw_any_bug_dmi_table[] = { 397static struct dmi_system_id sw_any_bug_dmi_table[] = {
397 { 398 {
398 .callback = sw_any_bug_found, 399 .callback = sw_any_bug_found,
@@ -405,7 +406,7 @@ static struct dmi_system_id sw_any_bug_dmi_table[] = {
405 }, 406 },
406 { } 407 { }
407}; 408};
408 409#endif
409 410
410/* 411/*
411 * centrino_cpu_init_acpi - register with ACPI P-States library 412 * centrino_cpu_init_acpi - register with ACPI P-States library
@@ -463,8 +464,9 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
463 } 464 }
464 465
465 for (i=0; i<p->state_count; i++) { 466 for (i=0; i<p->state_count; i++) {
466 if (p->states[i].control != p->states[i].status) { 467 if ((p->states[i].control & INTEL_MSR_RANGE) !=
467 dprintk("Different control (%llu) and status values (%llu)\n", 468 (p->states[i].status & INTEL_MSR_RANGE)) {
469 dprintk("Different MSR bits in control (%llu) and status (%llu)\n",
468 p->states[i].control, p->states[i].status); 470 p->states[i].control, p->states[i].status);
469 result = -EINVAL; 471 result = -EINVAL;
470 goto err_unreg; 472 goto err_unreg;
@@ -500,7 +502,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
500 } 502 }
501 503
502 for (i=0; i<p->state_count; i++) { 504 for (i=0; i<p->state_count; i++) {
503 centrino_model[cpu]->op_points[i].index = p->states[i].control; 505 centrino_model[cpu]->op_points[i].index = p->states[i].control & INTEL_MSR_RANGE;
504 centrino_model[cpu]->op_points[i].frequency = p->states[i].core_frequency * 1000; 506 centrino_model[cpu]->op_points[i].frequency = p->states[i].core_frequency * 1000;
505 dprintk("adding state %i with frequency %u and control value %04x\n", 507 dprintk("adding state %i with frequency %u and control value %04x\n",
506 i, centrino_model[cpu]->op_points[i].frequency, centrino_model[cpu]->op_points[i].index); 508 i, centrino_model[cpu]->op_points[i].frequency, centrino_model[cpu]->op_points[i].index);
@@ -531,6 +533,9 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
531 533
532 /* notify BIOS that we exist */ 534 /* notify BIOS that we exist */
533 acpi_processor_notify_smm(THIS_MODULE); 535 acpi_processor_notify_smm(THIS_MODULE);
536 printk("speedstep-centrino with X86_SPEEDSTEP_CENTRINO_ACPI"
537 "config is deprecated.\n "
538 "Use X86_ACPI_CPUFREQ (acpi-cpufreq instead.\n" );
534 539
535 return 0; 540 return 0;
536 541
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
index 4f46cac155c4..d59277c00911 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
@@ -123,6 +123,36 @@ static unsigned int pentiumM_get_frequency(void)
123 return (msr_tmp * 100 * 1000); 123 return (msr_tmp * 100 * 1000);
124} 124}
125 125
126static unsigned int pentium_core_get_frequency(void)
127{
128 u32 fsb = 0;
129 u32 msr_lo, msr_tmp;
130
131 rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp);
132 /* see table B-2 of 25366920.pdf */
133 switch (msr_lo & 0x07) {
134 case 5:
135 fsb = 100000;
136 break;
137 case 1:
138 fsb = 133333;
139 break;
140 case 3:
141 fsb = 166667;
142 break;
143 default:
144 printk(KERN_ERR "PCORE - MSR_FSB_FREQ undefined value");
145 }
146
147 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
148 dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
149
150 msr_tmp = (msr_lo >> 22) & 0x1f;
151 dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * fsb));
152
153 return (msr_tmp * fsb);
154}
155
126 156
127static unsigned int pentium4_get_frequency(void) 157static unsigned int pentium4_get_frequency(void)
128{ 158{
@@ -174,6 +204,8 @@ static unsigned int pentium4_get_frequency(void)
174unsigned int speedstep_get_processor_frequency(unsigned int processor) 204unsigned int speedstep_get_processor_frequency(unsigned int processor)
175{ 205{
176 switch (processor) { 206 switch (processor) {
207 case SPEEDSTEP_PROCESSOR_PCORE:
208 return pentium_core_get_frequency();
177 case SPEEDSTEP_PROCESSOR_PM: 209 case SPEEDSTEP_PROCESSOR_PM:
178 return pentiumM_get_frequency(); 210 return pentiumM_get_frequency();
179 case SPEEDSTEP_PROCESSOR_P4D: 211 case SPEEDSTEP_PROCESSOR_P4D:
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
index b735429c50b4..b11bcc608cac 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
@@ -22,6 +22,7 @@
22 * the speedstep_get_processor_frequency() call. */ 22 * the speedstep_get_processor_frequency() call. */
23#define SPEEDSTEP_PROCESSOR_PM 0xFFFFFF03 /* Pentium M */ 23#define SPEEDSTEP_PROCESSOR_PM 0xFFFFFF03 /* Pentium M */
24#define SPEEDSTEP_PROCESSOR_P4D 0xFFFFFF04 /* desktop P4 */ 24#define SPEEDSTEP_PROCESSOR_P4D 0xFFFFFF04 /* desktop P4 */
25#define SPEEDSTEP_PROCESSOR_PCORE 0xFFFFFF05 /* Core */
25 26
26/* speedstep states -- only two of them */ 27/* speedstep states -- only two of them */
27 28
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
index c28333d53646..ff0d89806114 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
@@ -360,9 +360,6 @@ static int __init speedstep_init(void)
360 case SPEEDSTEP_PROCESSOR_PIII_C: 360 case SPEEDSTEP_PROCESSOR_PIII_C:
361 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY: 361 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:
362 break; 362 break;
363 case SPEEDSTEP_PROCESSOR_P4M:
364 printk(KERN_INFO "speedstep-smi: you're trying to use this cpufreq driver on a Pentium 4-based CPU. Most likely it will not work.\n");
365 break;
366 default: 363 default:
367 speedstep_processor = 0; 364 speedstep_processor = 0;
368 } 365 }
diff --git a/arch/powerpc/platforms/4xx/Kconfig b/arch/powerpc/platforms/4xx/Kconfig
index ed39d6a3d22a..2f2a13ed7667 100644
--- a/arch/powerpc/platforms/4xx/Kconfig
+++ b/arch/powerpc/platforms/4xx/Kconfig
@@ -179,7 +179,7 @@ config BIOS_FIXUP
179# OAK doesn't exist but wanted to keep this around for any future 403GCX boards 179# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
180config 403GCX 180config 403GCX
181 bool 181 bool
182 depends OAK 182 depends on OAK
183 default y 183 default y
184 184
185config 405EP 185config 405EP
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index ddbe398fbd48..b3c2ce4cb7a8 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -35,7 +35,7 @@ config HDPU
35 Select HDPU if configuring a Sky Computers Compute Blade. 35 Select HDPU if configuring a Sky Computers Compute Blade.
36 36
37config HDPU_FEATURES 37config HDPU_FEATURES
38 depends HDPU 38 depends on HDPU
39 tristate "HDPU-Features" 39 tristate "HDPU-Features"
40 help 40 help
41 Select to enable HDPU enhanced features. 41 Select to enable HDPU enhanced features.
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 692b5ba53209..8eb82efe05a1 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -624,7 +624,7 @@ config HDPU
624 Select HDPU if configuring a Sky Computers Compute Blade. 624 Select HDPU if configuring a Sky Computers Compute Blade.
625 625
626config HDPU_FEATURES 626config HDPU_FEATURES
627 depends HDPU 627 depends on HDPU
628 tristate "HDPU-Features" 628 tristate "HDPU-Features"
629 help 629 help
630 Select to enable HDPU enhanced features. 630 Select to enable HDPU enhanced features.
@@ -735,7 +735,7 @@ config LITE5200
735 735
736config LITE5200B 736config LITE5200B
737 bool "Freescale LITE5200B" 737 bool "Freescale LITE5200B"
738 depends LITE5200 738 depends on LITE5200
739 help 739 help
740 Support for the LITE5200B dev board for the MPC5200 from Freescale. 740 Support for the LITE5200B dev board for the MPC5200 from Freescale.
741 This is the new board with 2 PCI slots. 741 This is the new board with 2 PCI slots.
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index 293bd489e7d9..6980de420e92 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -189,7 +189,7 @@ config BIOS_FIXUP
189# OAK doesn't exist but wanted to keep this around for any future 403GCX boards 189# OAK doesn't exist but wanted to keep this around for any future 403GCX boards
190config 403GCX 190config 403GCX
191 bool 191 bool
192 depends OAK 192 depends on OAK
193 default y 193 default y
194 194
195config 405EP 195config 405EP
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 286bc0b3207f..b2e9762e13c5 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -334,13 +334,12 @@ static int eth_configure(int n, void *init, char *mac,
334 size = transport->private_size + sizeof(struct uml_net_private) + 334 size = transport->private_size + sizeof(struct uml_net_private) +
335 sizeof(((struct uml_net_private *) 0)->user); 335 sizeof(((struct uml_net_private *) 0)->user);
336 336
337 device = kmalloc(sizeof(*device), GFP_KERNEL); 337 device = kzalloc(sizeof(*device), GFP_KERNEL);
338 if (device == NULL) { 338 if (device == NULL) {
339 printk(KERN_ERR "eth_configure failed to allocate uml_net\n"); 339 printk(KERN_ERR "eth_configure failed to allocate uml_net\n");
340 return(1); 340 return(1);
341 } 341 }
342 342
343 memset(device, 0, sizeof(*device));
344 INIT_LIST_HEAD(&device->list); 343 INIT_LIST_HEAD(&device->list);
345 device->index = n; 344 device->index = n;
346 345
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index bcf825875d17..f0d4d72e560f 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -105,17 +105,17 @@ menu "Processor type and features"
105 # currently support 105 # currently support
106 config V850E_MA1 106 config V850E_MA1
107 bool 107 bool
108 depends RTE_CB_MA1 108 depends on RTE_CB_MA1
109 default y 109 default y
110 # Similarly for the RTE-V850E/NB85E-CB - V850E/TEG 110 # Similarly for the RTE-V850E/NB85E-CB - V850E/TEG
111 config V850E_TEG 111 config V850E_TEG
112 bool 112 bool
113 depends RTE_CB_NB85E 113 depends on RTE_CB_NB85E
114 default y 114 default y
115 # ... and the RTE-V850E/ME2-CB - V850E/ME2 115 # ... and the RTE-V850E/ME2-CB - V850E/ME2
116 config V850E_ME2 116 config V850E_ME2
117 bool 117 bool
118 depends RTE_CB_ME2 118 depends on RTE_CB_ME2
119 default y 119 default y
120 120
121 121
@@ -123,7 +123,7 @@ menu "Processor type and features"
123 123
124 config V850E2_SIM85E2 124 config V850E2_SIM85E2
125 bool 125 bool
126 depends V850E2_SIM85E2C || V850E2_SIM85E2S 126 depends on V850E2_SIM85E2C || V850E2_SIM85E2S
127 default y 127 default y
128 128
129 129
@@ -132,7 +132,7 @@ menu "Processor type and features"
132 # V850E2 processors 132 # V850E2 processors
133 config V850E2 133 config V850E2
134 bool 134 bool
135 depends V850E2_SIM85E2 || V850E2_FPGA85E2C || V850E2_ANNA 135 depends on V850E2_SIM85E2 || V850E2_FPGA85E2C || V850E2_ANNA
136 default y 136 default y
137 137
138 138
@@ -141,7 +141,7 @@ menu "Processor type and features"
141 # Boards in the RTE-x-CB series 141 # Boards in the RTE-x-CB series
142 config RTE_CB 142 config RTE_CB
143 bool 143 bool
144 depends RTE_CB_MA1 || RTE_CB_NB85E || RTE_CB_ME2 144 depends on RTE_CB_MA1 || RTE_CB_NB85E || RTE_CB_ME2
145 default y 145 default y
146 146
147 config RTE_CB_MULTI 147 config RTE_CB_MULTI
@@ -149,28 +149,28 @@ menu "Processor type and features"
149 # RTE_CB_NB85E can either have multi ROM support or not, but 149 # RTE_CB_NB85E can either have multi ROM support or not, but
150 # other platforms (currently only RTE_CB_MA1) require it. 150 # other platforms (currently only RTE_CB_MA1) require it.
151 prompt "Multi monitor ROM support" if RTE_CB_NB85E 151 prompt "Multi monitor ROM support" if RTE_CB_NB85E
152 depends RTE_CB_MA1 || RTE_CB_NB85E 152 depends on RTE_CB_MA1 || RTE_CB_NB85E
153 default y 153 default y
154 154
155 config RTE_CB_MULTI_DBTRAP 155 config RTE_CB_MULTI_DBTRAP
156 bool "Pass illegal insn trap / dbtrap to kernel" 156 bool "Pass illegal insn trap / dbtrap to kernel"
157 depends RTE_CB_MULTI 157 depends on RTE_CB_MULTI
158 default n 158 default n
159 159
160 config RTE_CB_MA1_KSRAM 160 config RTE_CB_MA1_KSRAM
161 bool "Kernel in SRAM (limits size of kernel)" 161 bool "Kernel in SRAM (limits size of kernel)"
162 depends RTE_CB_MA1 && RTE_CB_MULTI 162 depends on RTE_CB_MA1 && RTE_CB_MULTI
163 default n 163 default n
164 164
165 config RTE_MB_A_PCI 165 config RTE_MB_A_PCI
166 bool "Mother-A PCI support" 166 bool "Mother-A PCI support"
167 depends RTE_CB 167 depends on RTE_CB
168 default y 168 default y
169 169
170 # The GBUS is used to talk to the RTE-MOTHER-A board 170 # The GBUS is used to talk to the RTE-MOTHER-A board
171 config RTE_GBUS_INT 171 config RTE_GBUS_INT
172 bool 172 bool
173 depends RTE_MB_A_PCI 173 depends on RTE_MB_A_PCI
174 default y 174 default y
175 175
176 # The only PCI bus we support is on the RTE-MOTHER-A board 176 # The only PCI bus we support is on the RTE-MOTHER-A board
@@ -209,7 +209,7 @@ menu "Processor type and features"
209 209
210 config ROM_KERNEL 210 config ROM_KERNEL
211 bool "Kernel in ROM" 211 bool "Kernel in ROM"
212 depends V850E2_ANNA || V850E_AS85EP1 || RTE_CB_ME2 212 depends on V850E2_ANNA || V850E_AS85EP1 || RTE_CB_ME2
213 213
214 # Some platforms pre-zero memory, in which case the kernel doesn't need to 214 # Some platforms pre-zero memory, in which case the kernel doesn't need to
215 config ZERO_BSS 215 config ZERO_BSS
@@ -225,10 +225,10 @@ menu "Processor type and features"
225 225
226 config V850E_HIGHRES_TIMER 226 config V850E_HIGHRES_TIMER
227 bool "High resolution timer support" 227 bool "High resolution timer support"
228 depends V850E_TIMER_D 228 depends on V850E_TIMER_D
229 config TIME_BOOTUP 229 config TIME_BOOTUP
230 bool "Time bootup" 230 bool "Time bootup"
231 depends V850E_HIGHRES_TIMER 231 depends on V850E_HIGHRES_TIMER
232 232
233 config RESET_GUARD 233 config RESET_GUARD
234 bool "Reset Guard" 234 bool "Reset Guard"
diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig
index 81f1562e5393..3abcfa3e1ed7 100644
--- a/arch/x86_64/kernel/cpufreq/Kconfig
+++ b/arch/x86_64/kernel/cpufreq/Kconfig
@@ -27,10 +27,13 @@ config X86_POWERNOW_K8_ACPI
27 default y 27 default y
28 28
29config X86_SPEEDSTEP_CENTRINO 29config X86_SPEEDSTEP_CENTRINO
30 tristate "Intel Enhanced SpeedStep" 30 tristate "Intel Enhanced SpeedStep (deprecated)"
31 select CPU_FREQ_TABLE 31 select CPU_FREQ_TABLE
32 depends on ACPI_PROCESSOR 32 depends on ACPI_PROCESSOR
33 help 33 help
34 This is deprecated and this functionality is now merged into
35 acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of
36 speedstep_centrino.
34 This adds the CPUFreq driver for Enhanced SpeedStep enabled 37 This adds the CPUFreq driver for Enhanced SpeedStep enabled
35 mobile CPUs. This means Intel Pentium M (Centrino) CPUs 38 mobile CPUs. This means Intel Pentium M (Centrino) CPUs
36 or 64bit enabled Intel Xeons. 39 or 64bit enabled Intel Xeons.
@@ -50,6 +53,7 @@ config X86_ACPI_CPUFREQ
50 help 53 help
51 This driver adds a CPUFreq driver which utilizes the ACPI 54 This driver adds a CPUFreq driver which utilizes the ACPI
52 Processor Performance States. 55 Processor Performance States.
56 This driver also supports Intel Enhanced Speedstep.
53 57
54 For details, take a look at <file:Documentation/cpu-freq/>. 58 For details, take a look at <file:Documentation/cpu-freq/>.
55 59
diff --git a/arch/x86_64/kernel/cpufreq/Makefile b/arch/x86_64/kernel/cpufreq/Makefile
index d8b593879224..753ce1dd418e 100644
--- a/arch/x86_64/kernel/cpufreq/Makefile
+++ b/arch/x86_64/kernel/cpufreq/Makefile
@@ -5,8 +5,8 @@
5SRCDIR := ../../../i386/kernel/cpu/cpufreq 5SRCDIR := ../../../i386/kernel/cpu/cpufreq
6 6
7obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o 7obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
8obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
9obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o 8obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
9obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
10obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o 10obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
11obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o 11obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
12 12
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index b10f4d8fdc7f..0a3aee29e067 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -867,7 +867,7 @@ config SONYPI
867 867
868config TANBAC_TB0219 868config TANBAC_TB0219
869 tristate "TANBAC TB0219 base board support" 869 tristate "TANBAC TB0219 base board support"
870 depends TANBAC_TB022X 870 depends on TANBAC_TB022X
871 select GPIO_VR41XX 871 select GPIO_VR41XX
872 872
873source "drivers/char/agp/Kconfig" 873source "drivers/char/agp/Kconfig"
diff --git a/drivers/char/watchdog/at91rm9200_wdt.c b/drivers/char/watchdog/at91rm9200_wdt.c
index cb86967e2c5f..38bd37372599 100644
--- a/drivers/char/watchdog/at91rm9200_wdt.c
+++ b/drivers/char/watchdog/at91rm9200_wdt.c
@@ -203,9 +203,9 @@ static int __init at91wdt_probe(struct platform_device *pdev)
203{ 203{
204 int res; 204 int res;
205 205
206 if (at91wdt_miscdev.dev) 206 if (at91wdt_miscdev.parent)
207 return -EBUSY; 207 return -EBUSY;
208 at91wdt_miscdev.dev = &pdev->dev; 208 at91wdt_miscdev.parent = &pdev->dev;
209 209
210 res = misc_register(&at91wdt_miscdev); 210 res = misc_register(&at91wdt_miscdev);
211 if (res) 211 if (res)
@@ -221,7 +221,7 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
221 221
222 res = misc_deregister(&at91wdt_miscdev); 222 res = misc_deregister(&at91wdt_miscdev);
223 if (!res) 223 if (!res)
224 at91wdt_miscdev.dev = NULL; 224 at91wdt_miscdev.parent = NULL;
225 225
226 return res; 226 return res;
227} 227}
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c
index 3404a9c67f08..e88947f8fe53 100644
--- a/drivers/char/watchdog/mpcore_wdt.c
+++ b/drivers/char/watchdog/mpcore_wdt.c
@@ -347,7 +347,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
347 goto err_free; 347 goto err_free;
348 } 348 }
349 349
350 mpcore_wdt_miscdev.dev = &dev->dev; 350 mpcore_wdt_miscdev.parent = &dev->dev;
351 ret = misc_register(&mpcore_wdt_miscdev); 351 ret = misc_register(&mpcore_wdt_miscdev);
352 if (ret) { 352 if (ret) {
353 dev_printk(KERN_ERR, _dev, "cannot register miscdev on minor=%d (err=%d)\n", 353 dev_printk(KERN_ERR, _dev, "cannot register miscdev on minor=%d (err=%d)\n",
diff --git a/drivers/char/watchdog/omap_wdt.c b/drivers/char/watchdog/omap_wdt.c
index 5dbd7dc2936f..6c6f97332dbb 100644
--- a/drivers/char/watchdog/omap_wdt.c
+++ b/drivers/char/watchdog/omap_wdt.c
@@ -290,7 +290,7 @@ static int __init omap_wdt_probe(struct platform_device *pdev)
290 omap_wdt_disable(); 290 omap_wdt_disable();
291 omap_wdt_adjust_timeout(timer_margin); 291 omap_wdt_adjust_timeout(timer_margin);
292 292
293 omap_wdt_miscdev.dev = &pdev->dev; 293 omap_wdt_miscdev.parent = &pdev->dev;
294 ret = misc_register(&omap_wdt_miscdev); 294 ret = misc_register(&omap_wdt_miscdev);
295 if (ret) 295 if (ret)
296 goto fail; 296 goto fail;
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index 61138726b501..2da5ac99687c 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -42,6 +42,7 @@
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <linux/usb.h> 43#include <linux/usb.h>
44#include <linux/mutex.h> 44#include <linux/mutex.h>
45#include <linux/hid.h> /* For HID_REQ_SET_REPORT & HID_DT_REPORT */
45 46
46 47
47#ifdef CONFIG_USB_DEBUG 48#ifdef CONFIG_USB_DEBUG
@@ -109,10 +110,6 @@ MODULE_DEVICE_TABLE (usb, usb_pcwd_table);
109#define CMD_ENABLE_WATCHDOG 0x30 /* Enable / Disable Watchdog */ 110#define CMD_ENABLE_WATCHDOG 0x30 /* Enable / Disable Watchdog */
110#define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG 111#define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG
111 112
112/* Some defines that I like to be somewhere else like include/linux/usb_hid.h */
113#define HID_REQ_SET_REPORT 0x09
114#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
115
116/* We can only use 1 card due to the /dev/watchdog restriction */ 113/* We can only use 1 card due to the /dev/watchdog restriction */
117static int cards_found; 114static int cards_found;
118 115
diff --git a/drivers/char/watchdog/rm9k_wdt.c b/drivers/char/watchdog/rm9k_wdt.c
index ec3909371c21..7576a13e86bc 100644
--- a/drivers/char/watchdog/rm9k_wdt.c
+++ b/drivers/char/watchdog/rm9k_wdt.c
@@ -47,7 +47,7 @@
47 47
48 48
49/* Function prototypes */ 49/* Function prototypes */
50static irqreturn_t wdt_gpi_irqhdl(int, void *, struct pt_regs *); 50static irqreturn_t wdt_gpi_irqhdl(int, void *);
51static void wdt_gpi_start(void); 51static void wdt_gpi_start(void);
52static void wdt_gpi_stop(void); 52static void wdt_gpi_stop(void);
53static void wdt_gpi_set_timeout(unsigned int); 53static void wdt_gpi_set_timeout(unsigned int);
@@ -94,8 +94,28 @@ module_param(nowayout, bool, 0444);
94MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started"); 94MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started");
95 95
96 96
97/* Kernel interfaces */
98static struct file_operations fops = {
99 .owner = THIS_MODULE,
100 .open = wdt_gpi_open,
101 .release = wdt_gpi_release,
102 .write = wdt_gpi_write,
103 .unlocked_ioctl = wdt_gpi_ioctl,
104};
105
106static struct miscdevice miscdev = {
107 .minor = WATCHDOG_MINOR,
108 .name = wdt_gpi_name,
109 .fops = &fops,
110};
111
112static struct notifier_block wdt_gpi_shutdown = {
113 .notifier_call = wdt_gpi_notify,
114};
115
116
97/* Interrupt handler */ 117/* Interrupt handler */
98static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt, struct pt_regs *regs) 118static irqreturn_t wdt_gpi_irqhdl(int irq, void *ctxt)
99{ 119{
100 if (!unlikely(__raw_readl(wd_regs + 0x0008) & 0x1)) 120 if (!unlikely(__raw_readl(wd_regs + 0x0008) & 0x1))
101 return IRQ_NONE; 121 return IRQ_NONE;
@@ -312,26 +332,6 @@ wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused)
312} 332}
313 333
314 334
315/* Kernel interfaces */
316static struct file_operations fops = {
317 .owner = THIS_MODULE,
318 .open = wdt_gpi_open,
319 .release = wdt_gpi_release,
320 .write = wdt_gpi_write,
321 .unlocked_ioctl = wdt_gpi_ioctl,
322};
323
324static struct miscdevice miscdev = {
325 .minor = WATCHDOG_MINOR,
326 .name = wdt_gpi_name,
327 .fops = &fops,
328};
329
330static struct notifier_block wdt_gpi_shutdown = {
331 .notifier_call = wdt_gpi_notify,
332};
333
334
335/* Init & exit procedures */ 335/* Init & exit procedures */
336static const struct resource * 336static const struct resource *
337wdt_gpi_get_resource(struct platform_device *pdv, const char *name, 337wdt_gpi_get_resource(struct platform_device *pdv, const char *name,
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 47ab42db122a..9fb2edf36611 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -29,7 +29,8 @@
29#include <linux/completion.h> 29#include <linux/completion.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31 31
32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "cpufreq-core", msg) 32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
33 "cpufreq-core", msg)
33 34
34/** 35/**
35 * The "cpufreq driver" - the arch- or hardware-dependent low 36 * The "cpufreq driver" - the arch- or hardware-dependent low
@@ -151,7 +152,8 @@ static void cpufreq_debug_disable_ratelimit(void)
151 spin_unlock_irqrestore(&disable_ratelimit_lock, flags); 152 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
152} 153}
153 154
154void cpufreq_debug_printk(unsigned int type, const char *prefix, const char *fmt, ...) 155void cpufreq_debug_printk(unsigned int type, const char *prefix,
156 const char *fmt, ...)
155{ 157{
156 char s[256]; 158 char s[256];
157 va_list args; 159 va_list args;
@@ -161,7 +163,8 @@ void cpufreq_debug_printk(unsigned int type, const char *prefix, const char *fmt
161 WARN_ON(!prefix); 163 WARN_ON(!prefix);
162 if (type & debug) { 164 if (type & debug) {
163 spin_lock_irqsave(&disable_ratelimit_lock, flags); 165 spin_lock_irqsave(&disable_ratelimit_lock, flags);
164 if (!disable_ratelimit && debug_ratelimit && !printk_ratelimit()) { 166 if (!disable_ratelimit && debug_ratelimit
167 && !printk_ratelimit()) {
165 spin_unlock_irqrestore(&disable_ratelimit_lock, flags); 168 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
166 return; 169 return;
167 } 170 }
@@ -182,10 +185,12 @@ EXPORT_SYMBOL(cpufreq_debug_printk);
182 185
183 186
184module_param(debug, uint, 0644); 187module_param(debug, uint, 0644);
185MODULE_PARM_DESC(debug, "CPUfreq debugging: add 1 to debug core, 2 to debug drivers, and 4 to debug governors."); 188MODULE_PARM_DESC(debug, "CPUfreq debugging: add 1 to debug core,"
189 " 2 to debug drivers, and 4 to debug governors.");
186 190
187module_param(debug_ratelimit, uint, 0644); 191module_param(debug_ratelimit, uint, 0644);
188MODULE_PARM_DESC(debug_ratelimit, "CPUfreq debugging: set to 0 to disable ratelimiting."); 192MODULE_PARM_DESC(debug_ratelimit, "CPUfreq debugging:"
193 " set to 0 to disable ratelimiting.");
189 194
190#else /* !CONFIG_CPU_FREQ_DEBUG */ 195#else /* !CONFIG_CPU_FREQ_DEBUG */
191 196
@@ -219,17 +224,23 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
219 if (!l_p_j_ref_freq) { 224 if (!l_p_j_ref_freq) {
220 l_p_j_ref = loops_per_jiffy; 225 l_p_j_ref = loops_per_jiffy;
221 l_p_j_ref_freq = ci->old; 226 l_p_j_ref_freq = ci->old;
222 dprintk("saving %lu as reference value for loops_per_jiffy; freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq); 227 dprintk("saving %lu as reference value for loops_per_jiffy;"
228 "freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq);
223 } 229 }
224 if ((val == CPUFREQ_PRECHANGE && ci->old < ci->new) || 230 if ((val == CPUFREQ_PRECHANGE && ci->old < ci->new) ||
225 (val == CPUFREQ_POSTCHANGE && ci->old > ci->new) || 231 (val == CPUFREQ_POSTCHANGE && ci->old > ci->new) ||
226 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) { 232 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
227 loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq, ci->new); 233 loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq,
228 dprintk("scaling loops_per_jiffy to %lu for frequency %u kHz\n", loops_per_jiffy, ci->new); 234 ci->new);
235 dprintk("scaling loops_per_jiffy to %lu"
236 "for frequency %u kHz\n", loops_per_jiffy, ci->new);
229 } 237 }
230} 238}
231#else 239#else
232static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) { return; } 240static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
241{
242 return;
243}
233#endif 244#endif
234 245
235 246
@@ -316,7 +327,8 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
316 if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) { 327 if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
317 *policy = CPUFREQ_POLICY_PERFORMANCE; 328 *policy = CPUFREQ_POLICY_PERFORMANCE;
318 err = 0; 329 err = 0;
319 } else if (!strnicmp(str_governor, "powersave", CPUFREQ_NAME_LEN)) { 330 } else if (!strnicmp(str_governor, "powersave",
331 CPUFREQ_NAME_LEN)) {
320 *policy = CPUFREQ_POLICY_POWERSAVE; 332 *policy = CPUFREQ_POLICY_POWERSAVE;
321 err = 0; 333 err = 0;
322 } 334 }
@@ -328,7 +340,8 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
328 t = __find_governor(str_governor); 340 t = __find_governor(str_governor);
329 341
330 if (t == NULL) { 342 if (t == NULL) {
331 char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor); 343 char *name = kasprintf(GFP_KERNEL, "cpufreq_%s",
344 str_governor);
332 345
333 if (name) { 346 if (name) {
334 int ret; 347 int ret;
@@ -361,7 +374,8 @@ extern struct sysdev_class cpu_sysdev_class;
361 374
362 375
363/** 376/**
364 * cpufreq_per_cpu_attr_read() / show_##file_name() - print out cpufreq information 377 * cpufreq_per_cpu_attr_read() / show_##file_name() -
378 * print out cpufreq information
365 * 379 *
366 * Write out information from cpufreq_driver->policy[cpu]; object must be 380 * Write out information from cpufreq_driver->policy[cpu]; object must be
367 * "unsigned int". 381 * "unsigned int".
@@ -380,7 +394,8 @@ show_one(scaling_min_freq, min);
380show_one(scaling_max_freq, max); 394show_one(scaling_max_freq, max);
381show_one(scaling_cur_freq, cur); 395show_one(scaling_cur_freq, cur);
382 396
383static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy); 397static int __cpufreq_set_policy(struct cpufreq_policy *data,
398 struct cpufreq_policy *policy);
384 399
385/** 400/**
386 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access 401 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
@@ -416,7 +431,8 @@ store_one(scaling_max_freq,max);
416/** 431/**
417 * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware 432 * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware
418 */ 433 */
419static ssize_t show_cpuinfo_cur_freq (struct cpufreq_policy * policy, char *buf) 434static ssize_t show_cpuinfo_cur_freq (struct cpufreq_policy * policy,
435 char *buf)
420{ 436{
421 unsigned int cur_freq = cpufreq_get(policy->cpu); 437 unsigned int cur_freq = cpufreq_get(policy->cpu);
422 if (!cur_freq) 438 if (!cur_freq)
@@ -428,7 +444,8 @@ static ssize_t show_cpuinfo_cur_freq (struct cpufreq_policy * policy, char *buf)
428/** 444/**
429 * show_scaling_governor - show the current policy for the specified CPU 445 * show_scaling_governor - show the current policy for the specified CPU
430 */ 446 */
431static ssize_t show_scaling_governor (struct cpufreq_policy * policy, char *buf) 447static ssize_t show_scaling_governor (struct cpufreq_policy * policy,
448 char *buf)
432{ 449{
433 if(policy->policy == CPUFREQ_POLICY_POWERSAVE) 450 if(policy->policy == CPUFREQ_POLICY_POWERSAVE)
434 return sprintf(buf, "powersave\n"); 451 return sprintf(buf, "powersave\n");
@@ -458,7 +475,8 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
458 if (ret != 1) 475 if (ret != 1)
459 return -EINVAL; 476 return -EINVAL;
460 477
461 if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor)) 478 if (cpufreq_parse_governor(str_governor, &new_policy.policy,
479 &new_policy.governor))
462 return -EINVAL; 480 return -EINVAL;
463 481
464 lock_cpu_hotplug(); 482 lock_cpu_hotplug();
@@ -474,7 +492,10 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
474 492
475 unlock_cpu_hotplug(); 493 unlock_cpu_hotplug();
476 494
477 return ret ? ret : count; 495 if (ret)
496 return ret;
497 else
498 return count;
478} 499}
479 500
480/** 501/**
@@ -488,7 +509,7 @@ static ssize_t show_scaling_driver (struct cpufreq_policy * policy, char *buf)
488/** 509/**
489 * show_scaling_available_governors - show the available CPUfreq governors 510 * show_scaling_available_governors - show the available CPUfreq governors
490 */ 511 */
491static ssize_t show_scaling_available_governors (struct cpufreq_policy * policy, 512static ssize_t show_scaling_available_governors (struct cpufreq_policy *policy,
492 char *buf) 513 char *buf)
493{ 514{
494 ssize_t i = 0; 515 ssize_t i = 0;
@@ -574,7 +595,11 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
574 policy = cpufreq_cpu_get(policy->cpu); 595 policy = cpufreq_cpu_get(policy->cpu);
575 if (!policy) 596 if (!policy)
576 return -EINVAL; 597 return -EINVAL;
577 ret = fattr->show ? fattr->show(policy,buf) : -EIO; 598 if (fattr->show)
599 ret = fattr->show(policy, buf);
600 else
601 ret = -EIO;
602
578 cpufreq_cpu_put(policy); 603 cpufreq_cpu_put(policy);
579 return ret; 604 return ret;
580} 605}
@@ -588,7 +613,11 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
588 policy = cpufreq_cpu_get(policy->cpu); 613 policy = cpufreq_cpu_get(policy->cpu);
589 if (!policy) 614 if (!policy)
590 return -EINVAL; 615 return -EINVAL;
591 ret = fattr->store ? fattr->store(policy,buf,count) : -EIO; 616 if (fattr->store)
617 ret = fattr->store(policy, buf, count);
618 else
619 ret = -EIO;
620
592 cpufreq_cpu_put(policy); 621 cpufreq_cpu_put(policy);
593 return ret; 622 return ret;
594} 623}
@@ -913,7 +942,8 @@ static void handle_update(struct work_struct *work)
913 * We adjust to current frequency first, and need to clean up later. So either call 942 * We adjust to current frequency first, and need to clean up later. So either call
914 * to cpufreq_update_policy() or schedule handle_update()). 943 * to cpufreq_update_policy() or schedule handle_update()).
915 */ 944 */
916static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigned int new_freq) 945static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq,
946 unsigned int new_freq)
917{ 947{
918 struct cpufreq_freqs freqs; 948 struct cpufreq_freqs freqs;
919 949
@@ -938,16 +968,16 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigne
938unsigned int cpufreq_quick_get(unsigned int cpu) 968unsigned int cpufreq_quick_get(unsigned int cpu)
939{ 969{
940 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); 970 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
941 unsigned int ret = 0; 971 unsigned int ret_freq = 0;
942 972
943 if (policy) { 973 if (policy) {
944 mutex_lock(&policy->lock); 974 mutex_lock(&policy->lock);
945 ret = policy->cur; 975 ret_freq = policy->cur;
946 mutex_unlock(&policy->lock); 976 mutex_unlock(&policy->lock);
947 cpufreq_cpu_put(policy); 977 cpufreq_cpu_put(policy);
948 } 978 }
949 979
950 return (ret); 980 return (ret_freq);
951} 981}
952EXPORT_SYMBOL(cpufreq_quick_get); 982EXPORT_SYMBOL(cpufreq_quick_get);
953 983
@@ -961,7 +991,7 @@ EXPORT_SYMBOL(cpufreq_quick_get);
961unsigned int cpufreq_get(unsigned int cpu) 991unsigned int cpufreq_get(unsigned int cpu)
962{ 992{
963 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); 993 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
964 unsigned int ret = 0; 994 unsigned int ret_freq = 0;
965 995
966 if (!policy) 996 if (!policy)
967 return 0; 997 return 0;
@@ -971,12 +1001,14 @@ unsigned int cpufreq_get(unsigned int cpu)
971 1001
972 mutex_lock(&policy->lock); 1002 mutex_lock(&policy->lock);
973 1003
974 ret = cpufreq_driver->get(cpu); 1004 ret_freq = cpufreq_driver->get(cpu);
975 1005
976 if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) { 1006 if (ret_freq && policy->cur &&
977 /* verify no discrepancy between actual and saved value exists */ 1007 !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
978 if (unlikely(ret != policy->cur)) { 1008 /* verify no discrepancy between actual and
979 cpufreq_out_of_sync(cpu, policy->cur, ret); 1009 saved value exists */
1010 if (unlikely(ret_freq != policy->cur)) {
1011 cpufreq_out_of_sync(cpu, policy->cur, ret_freq);
980 schedule_work(&policy->update); 1012 schedule_work(&policy->update);
981 } 1013 }
982 } 1014 }
@@ -986,7 +1018,7 @@ unsigned int cpufreq_get(unsigned int cpu)
986out: 1018out:
987 cpufreq_cpu_put(policy); 1019 cpufreq_cpu_put(policy);
988 1020
989 return (ret); 1021 return (ret_freq);
990} 1022}
991EXPORT_SYMBOL(cpufreq_get); 1023EXPORT_SYMBOL(cpufreq_get);
992 1024
@@ -998,7 +1030,7 @@ EXPORT_SYMBOL(cpufreq_get);
998static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg) 1030static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
999{ 1031{
1000 int cpu = sysdev->id; 1032 int cpu = sysdev->id;
1001 unsigned int ret = 0; 1033 int ret = 0;
1002 unsigned int cur_freq = 0; 1034 unsigned int cur_freq = 0;
1003 struct cpufreq_policy *cpu_policy; 1035 struct cpufreq_policy *cpu_policy;
1004 1036
@@ -1080,7 +1112,7 @@ out:
1080static int cpufreq_resume(struct sys_device * sysdev) 1112static int cpufreq_resume(struct sys_device * sysdev)
1081{ 1113{
1082 int cpu = sysdev->id; 1114 int cpu = sysdev->id;
1083 unsigned int ret = 0; 1115 int ret = 0;
1084 struct cpufreq_policy *cpu_policy; 1116 struct cpufreq_policy *cpu_policy;
1085 1117
1086 dprintk("resuming cpu %u\n", cpu); 1118 dprintk("resuming cpu %u\n", cpu);
@@ -1276,22 +1308,45 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
1276} 1308}
1277EXPORT_SYMBOL_GPL(cpufreq_driver_target); 1309EXPORT_SYMBOL_GPL(cpufreq_driver_target);
1278 1310
1311int cpufreq_driver_getavg(struct cpufreq_policy *policy)
1312{
1313 int ret = 0;
1314
1315 policy = cpufreq_cpu_get(policy->cpu);
1316 if (!policy)
1317 return -EINVAL;
1318
1319 mutex_lock(&policy->lock);
1320
1321 if (cpu_online(policy->cpu) && cpufreq_driver->getavg)
1322 ret = cpufreq_driver->getavg(policy->cpu);
1323
1324 mutex_unlock(&policy->lock);
1325
1326 cpufreq_cpu_put(policy);
1327 return ret;
1328}
1329EXPORT_SYMBOL_GPL(cpufreq_driver_getavg);
1330
1279/* 1331/*
1280 * Locking: Must be called with the lock_cpu_hotplug() lock held 1332 * Locking: Must be called with the lock_cpu_hotplug() lock held
1281 * when "event" is CPUFREQ_GOV_LIMITS 1333 * when "event" is CPUFREQ_GOV_LIMITS
1282 */ 1334 */
1283 1335
1284static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event) 1336static int __cpufreq_governor(struct cpufreq_policy *policy,
1337 unsigned int event)
1285{ 1338{
1286 int ret; 1339 int ret;
1287 1340
1288 if (!try_module_get(policy->governor->owner)) 1341 if (!try_module_get(policy->governor->owner))
1289 return -EINVAL; 1342 return -EINVAL;
1290 1343
1291 dprintk("__cpufreq_governor for CPU %u, event %u\n", policy->cpu, event); 1344 dprintk("__cpufreq_governor for CPU %u, event %u\n",
1345 policy->cpu, event);
1292 ret = policy->governor->governor(policy, event); 1346 ret = policy->governor->governor(policy, event);
1293 1347
1294 /* we keep one module reference alive for each CPU governed by this CPU */ 1348 /* we keep one module reference alive for
1349 each CPU governed by this CPU */
1295 if ((event != CPUFREQ_GOV_START) || ret) 1350 if ((event != CPUFREQ_GOV_START) || ret)
1296 module_put(policy->governor->owner); 1351 module_put(policy->governor->owner);
1297 if ((event == CPUFREQ_GOV_STOP) && !ret) 1352 if ((event == CPUFREQ_GOV_STOP) && !ret)
@@ -1367,9 +1422,12 @@ EXPORT_SYMBOL(cpufreq_get_policy);
1367 1422
1368 1423
1369/* 1424/*
1425 * data : current policy.
1426 * policy : policy to be set.
1370 * Locking: Must be called with the lock_cpu_hotplug() lock held 1427 * Locking: Must be called with the lock_cpu_hotplug() lock held
1371 */ 1428 */
1372static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy) 1429static int __cpufreq_set_policy(struct cpufreq_policy *data,
1430 struct cpufreq_policy *policy)
1373{ 1431{
1374 int ret = 0; 1432 int ret = 0;
1375 1433
@@ -1377,7 +1435,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1377 dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu, 1435 dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu,
1378 policy->min, policy->max); 1436 policy->min, policy->max);
1379 1437
1380 memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo)); 1438 memcpy(&policy->cpuinfo, &data->cpuinfo,
1439 sizeof(struct cpufreq_cpuinfo));
1381 1440
1382 if (policy->min > data->min && policy->min > policy->max) { 1441 if (policy->min > data->min && policy->min > policy->max) {
1383 ret = -EINVAL; 1442 ret = -EINVAL;
@@ -1410,7 +1469,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1410 data->min = policy->min; 1469 data->min = policy->min;
1411 data->max = policy->max; 1470 data->max = policy->max;
1412 1471
1413 dprintk("new min and max freqs are %u - %u kHz\n", data->min, data->max); 1472 dprintk("new min and max freqs are %u - %u kHz\n",
1473 data->min, data->max);
1414 1474
1415 if (cpufreq_driver->setpolicy) { 1475 if (cpufreq_driver->setpolicy) {
1416 data->policy = policy->policy; 1476 data->policy = policy->policy;
@@ -1431,10 +1491,12 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1431 data->governor = policy->governor; 1491 data->governor = policy->governor;
1432 if (__cpufreq_governor(data, CPUFREQ_GOV_START)) { 1492 if (__cpufreq_governor(data, CPUFREQ_GOV_START)) {
1433 /* new governor failed, so re-start old one */ 1493 /* new governor failed, so re-start old one */
1434 dprintk("starting governor %s failed\n", data->governor->name); 1494 dprintk("starting governor %s failed\n",
1495 data->governor->name);
1435 if (old_gov) { 1496 if (old_gov) {
1436 data->governor = old_gov; 1497 data->governor = old_gov;
1437 __cpufreq_governor(data, CPUFREQ_GOV_START); 1498 __cpufreq_governor(data,
1499 CPUFREQ_GOV_START);
1438 } 1500 }
1439 ret = -EINVAL; 1501 ret = -EINVAL;
1440 goto error_out; 1502 goto error_out;
@@ -1524,7 +1586,8 @@ int cpufreq_update_policy(unsigned int cpu)
1524 data->cur = policy.cur; 1586 data->cur = policy.cur;
1525 } else { 1587 } else {
1526 if (data->cur != policy.cur) 1588 if (data->cur != policy.cur)
1527 cpufreq_out_of_sync(cpu, data->cur, policy.cur); 1589 cpufreq_out_of_sync(cpu, data->cur,
1590 policy.cur);
1528 } 1591 }
1529 } 1592 }
1530 1593
@@ -1626,8 +1689,10 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1626 1689
1627 /* if all ->init() calls failed, unregister */ 1690 /* if all ->init() calls failed, unregister */
1628 if (ret) { 1691 if (ret) {
1629 dprintk("no CPU initialized for driver %s\n", driver_data->name); 1692 dprintk("no CPU initialized for driver %s\n",
1630 sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver); 1693 driver_data->name);
1694 sysdev_driver_unregister(&cpu_sysdev_class,
1695 &cpufreq_sysdev_driver);
1631 1696
1632 spin_lock_irqsave(&cpufreq_driver_lock, flags); 1697 spin_lock_irqsave(&cpufreq_driver_lock, flags);
1633 cpufreq_driver = NULL; 1698 cpufreq_driver = NULL;
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index 5ef5ede5b884..eef0270c6f3d 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -44,15 +44,17 @@
44 * latency of the processor. The governor will work on any processor with 44 * latency of the processor. The governor will work on any processor with
45 * transition latency <= 10mS, using appropriate sampling 45 * transition latency <= 10mS, using appropriate sampling
46 * rate. 46 * rate.
47 * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL) 47 * For CPUs with transition latency > 10mS (mostly drivers
48 * this governor will not work. 48 * with CPUFREQ_ETERNAL), this governor will not work.
49 * All times here are in uS. 49 * All times here are in uS.
50 */ 50 */
51static unsigned int def_sampling_rate; 51static unsigned int def_sampling_rate;
52#define MIN_SAMPLING_RATE_RATIO (2) 52#define MIN_SAMPLING_RATE_RATIO (2)
53/* for correct statistics, we need at least 10 ticks between each measure */ 53/* for correct statistics, we need at least 10 ticks between each measure */
54#define MIN_STAT_SAMPLING_RATE (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10)) 54#define MIN_STAT_SAMPLING_RATE \
55#define MIN_SAMPLING_RATE (def_sampling_rate / MIN_SAMPLING_RATE_RATIO) 55 (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
56#define MIN_SAMPLING_RATE \
57 (def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
56#define MAX_SAMPLING_RATE (500 * def_sampling_rate) 58#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
57#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) 59#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
58#define DEF_SAMPLING_DOWN_FACTOR (1) 60#define DEF_SAMPLING_DOWN_FACTOR (1)
@@ -103,11 +105,16 @@ static struct dbs_tuners dbs_tuners_ins = {
103 105
104static inline unsigned int get_cpu_idle_time(unsigned int cpu) 106static inline unsigned int get_cpu_idle_time(unsigned int cpu)
105{ 107{
106 return kstat_cpu(cpu).cpustat.idle + 108 unsigned int add_nice = 0, ret;
109
110 if (dbs_tuners_ins.ignore_nice)
111 add_nice = kstat_cpu(cpu).cpustat.nice;
112
113 ret = kstat_cpu(cpu).cpustat.idle +
107 kstat_cpu(cpu).cpustat.iowait + 114 kstat_cpu(cpu).cpustat.iowait +
108 ( dbs_tuners_ins.ignore_nice ? 115 add_nice;
109 kstat_cpu(cpu).cpustat.nice : 116
110 0); 117 return ret;
111} 118}
112 119
113/************************** sysfs interface ************************/ 120/************************** sysfs interface ************************/
@@ -452,6 +459,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
452 unsigned int cpu = policy->cpu; 459 unsigned int cpu = policy->cpu;
453 struct cpu_dbs_info_s *this_dbs_info; 460 struct cpu_dbs_info_s *this_dbs_info;
454 unsigned int j; 461 unsigned int j;
462 int rc;
455 463
456 this_dbs_info = &per_cpu(cpu_dbs_info, cpu); 464 this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
457 465
@@ -468,6 +476,13 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
468 break; 476 break;
469 477
470 mutex_lock(&dbs_mutex); 478 mutex_lock(&dbs_mutex);
479
480 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group);
481 if (rc) {
482 mutex_unlock(&dbs_mutex);
483 return rc;
484 }
485
471 for_each_cpu_mask(j, policy->cpus) { 486 for_each_cpu_mask(j, policy->cpus) {
472 struct cpu_dbs_info_s *j_dbs_info; 487 struct cpu_dbs_info_s *j_dbs_info;
473 j_dbs_info = &per_cpu(cpu_dbs_info, j); 488 j_dbs_info = &per_cpu(cpu_dbs_info, j);
@@ -480,7 +495,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
480 this_dbs_info->enable = 1; 495 this_dbs_info->enable = 1;
481 this_dbs_info->down_skip = 0; 496 this_dbs_info->down_skip = 0;
482 this_dbs_info->requested_freq = policy->cur; 497 this_dbs_info->requested_freq = policy->cur;
483 sysfs_create_group(&policy->kobj, &dbs_attr_group); 498
484 dbs_enable++; 499 dbs_enable++;
485 /* 500 /*
486 * Start the timerschedule work, when this governor 501 * Start the timerschedule work, when this governor
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index e1cc5113c2ae..f697449327c6 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -41,8 +41,10 @@
41static unsigned int def_sampling_rate; 41static unsigned int def_sampling_rate;
42#define MIN_SAMPLING_RATE_RATIO (2) 42#define MIN_SAMPLING_RATE_RATIO (2)
43/* for correct statistics, we need at least 10 ticks between each measure */ 43/* for correct statistics, we need at least 10 ticks between each measure */
44#define MIN_STAT_SAMPLING_RATE (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10)) 44#define MIN_STAT_SAMPLING_RATE \
45#define MIN_SAMPLING_RATE (def_sampling_rate / MIN_SAMPLING_RATE_RATIO) 45 (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
46#define MIN_SAMPLING_RATE \
47 (def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
46#define MAX_SAMPLING_RATE (500 * def_sampling_rate) 48#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
47#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000) 49#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
48#define TRANSITION_LATENCY_LIMIT (10 * 1000) 50#define TRANSITION_LATENCY_LIMIT (10 * 1000)
@@ -206,7 +208,8 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused,
206 ret = sscanf(buf, "%u", &input); 208 ret = sscanf(buf, "%u", &input);
207 209
208 mutex_lock(&dbs_mutex); 210 mutex_lock(&dbs_mutex);
209 if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) { 211 if (ret != 1 || input > MAX_SAMPLING_RATE
212 || input < MIN_SAMPLING_RATE) {
210 mutex_unlock(&dbs_mutex); 213 mutex_unlock(&dbs_mutex);
211 return -EINVAL; 214 return -EINVAL;
212 } 215 }
@@ -397,8 +400,15 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
397 * policy. To be safe, we focus 10 points under the threshold. 400 * policy. To be safe, we focus 10 points under the threshold.
398 */ 401 */
399 if (load < (dbs_tuners_ins.up_threshold - 10)) { 402 if (load < (dbs_tuners_ins.up_threshold - 10)) {
400 unsigned int freq_next = (policy->cur * load) / 403 unsigned int freq_next, freq_cur;
404
405 freq_cur = cpufreq_driver_getavg(policy);
406 if (!freq_cur)
407 freq_cur = policy->cur;
408
409 freq_next = (freq_cur * load) /
401 (dbs_tuners_ins.up_threshold - 10); 410 (dbs_tuners_ins.up_threshold - 10);
411
402 if (!dbs_tuners_ins.powersave_bias) { 412 if (!dbs_tuners_ins.powersave_bias) {
403 __cpufreq_driver_target(policy, freq_next, 413 __cpufreq_driver_target(policy, freq_next,
404 CPUFREQ_RELATION_L); 414 CPUFREQ_RELATION_L);
@@ -472,6 +482,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
472 unsigned int cpu = policy->cpu; 482 unsigned int cpu = policy->cpu;
473 struct cpu_dbs_info_s *this_dbs_info; 483 struct cpu_dbs_info_s *this_dbs_info;
474 unsigned int j; 484 unsigned int j;
485 int rc;
475 486
476 this_dbs_info = &per_cpu(cpu_dbs_info, cpu); 487 this_dbs_info = &per_cpu(cpu_dbs_info, cpu);
477 488
@@ -494,12 +505,23 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
494 if (dbs_enable == 1) { 505 if (dbs_enable == 1) {
495 kondemand_wq = create_workqueue("kondemand"); 506 kondemand_wq = create_workqueue("kondemand");
496 if (!kondemand_wq) { 507 if (!kondemand_wq) {
497 printk(KERN_ERR "Creation of kondemand failed\n"); 508 printk(KERN_ERR
509 "Creation of kondemand failed\n");
498 dbs_enable--; 510 dbs_enable--;
499 mutex_unlock(&dbs_mutex); 511 mutex_unlock(&dbs_mutex);
500 return -ENOSPC; 512 return -ENOSPC;
501 } 513 }
502 } 514 }
515
516 rc = sysfs_create_group(&policy->kobj, &dbs_attr_group);
517 if (rc) {
518 if (dbs_enable == 1)
519 destroy_workqueue(kondemand_wq);
520 dbs_enable--;
521 mutex_unlock(&dbs_mutex);
522 return rc;
523 }
524
503 for_each_cpu_mask(j, policy->cpus) { 525 for_each_cpu_mask(j, policy->cpus) {
504 struct cpu_dbs_info_s *j_dbs_info; 526 struct cpu_dbs_info_s *j_dbs_info;
505 j_dbs_info = &per_cpu(cpu_dbs_info, j); 527 j_dbs_info = &per_cpu(cpu_dbs_info, j);
@@ -509,7 +531,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
509 j_dbs_info->prev_cpu_wall = get_jiffies_64(); 531 j_dbs_info->prev_cpu_wall = get_jiffies_64();
510 } 532 }
511 this_dbs_info->enable = 1; 533 this_dbs_info->enable = 1;
512 sysfs_create_group(&policy->kobj, &dbs_attr_group);
513 /* 534 /*
514 * Start the timerschedule work, when this governor 535 * Start the timerschedule work, when this governor
515 * is used for first time 536 * is used for first time
diff --git a/drivers/cpufreq/cpufreq_performance.c b/drivers/cpufreq/cpufreq_performance.c
index de91e3371ef8..e8e1451ef1c1 100644
--- a/drivers/cpufreq/cpufreq_performance.c
+++ b/drivers/cpufreq/cpufreq_performance.c
@@ -15,7 +15,8 @@
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg) 18#define dprintk(msg...) \
19 cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg)
19 20
20 21
21static int cpufreq_governor_performance(struct cpufreq_policy *policy, 22static int cpufreq_governor_performance(struct cpufreq_policy *policy,
@@ -24,8 +25,10 @@ static int cpufreq_governor_performance(struct cpufreq_policy *policy,
24 switch (event) { 25 switch (event) {
25 case CPUFREQ_GOV_START: 26 case CPUFREQ_GOV_START:
26 case CPUFREQ_GOV_LIMITS: 27 case CPUFREQ_GOV_LIMITS:
27 dprintk("setting to %u kHz because of event %u\n", policy->max, event); 28 dprintk("setting to %u kHz because of event %u\n",
28 __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H); 29 policy->max, event);
30 __cpufreq_driver_target(policy, policy->max,
31 CPUFREQ_RELATION_H);
29 break; 32 break;
30 default: 33 default:
31 break; 34 break;
diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c
index 0a2596044e65..13fe06b94b0a 100644
--- a/drivers/cpufreq/cpufreq_powersave.c
+++ b/drivers/cpufreq/cpufreq_powersave.c
@@ -15,7 +15,8 @@
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg) 18#define dprintk(msg...) \
19 cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg)
19 20
20static int cpufreq_governor_powersave(struct cpufreq_policy *policy, 21static int cpufreq_governor_powersave(struct cpufreq_policy *policy,
21 unsigned int event) 22 unsigned int event)
@@ -23,8 +24,10 @@ static int cpufreq_governor_powersave(struct cpufreq_policy *policy,
23 switch (event) { 24 switch (event) {
24 case CPUFREQ_GOV_START: 25 case CPUFREQ_GOV_START:
25 case CPUFREQ_GOV_LIMITS: 26 case CPUFREQ_GOV_LIMITS:
26 dprintk("setting to %u kHz because of event %u\n", policy->min, event); 27 dprintk("setting to %u kHz because of event %u\n",
27 __cpufreq_driver_target(policy, policy->min, CPUFREQ_RELATION_L); 28 policy->min, event);
29 __cpufreq_driver_target(policy, policy->min,
30 CPUFREQ_RELATION_L);
28 break; 31 break;
29 default: 32 default:
30 break; 33 break;
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index c2ecc599dc5f..6742b1adf2c8 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -351,8 +351,8 @@ __init cpufreq_stats_init(void)
351 351
352 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 352 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
353 for_each_online_cpu(cpu) { 353 for_each_online_cpu(cpu) {
354 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_ONLINE, 354 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier,
355 (void *)(long)cpu); 355 CPU_ONLINE, (void *)(long)cpu);
356 } 356 }
357 return 0; 357 return 0;
358} 358}
@@ -368,14 +368,15 @@ __exit cpufreq_stats_exit(void)
368 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 368 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
369 lock_cpu_hotplug(); 369 lock_cpu_hotplug();
370 for_each_online_cpu(cpu) { 370 for_each_online_cpu(cpu) {
371 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_DEAD, 371 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier,
372 (void *)(long)cpu); 372 CPU_DEAD, (void *)(long)cpu);
373 } 373 }
374 unlock_cpu_hotplug(); 374 unlock_cpu_hotplug();
375} 375}
376 376
377MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>"); 377MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>");
378MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats through sysfs filesystem"); 378MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats"
379 "through sysfs filesystem");
379MODULE_LICENSE ("GPL"); 380MODULE_LICENSE ("GPL");
380 381
381module_init(cpufreq_stats_init); 382module_init(cpufreq_stats_init);
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index a06c204589cd..2a4eb0bfaf30 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -131,19 +131,26 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
131 unsigned int event) 131 unsigned int event)
132{ 132{
133 unsigned int cpu = policy->cpu; 133 unsigned int cpu = policy->cpu;
134 int rc = 0;
135
134 switch (event) { 136 switch (event) {
135 case CPUFREQ_GOV_START: 137 case CPUFREQ_GOV_START:
136 if (!cpu_online(cpu)) 138 if (!cpu_online(cpu))
137 return -EINVAL; 139 return -EINVAL;
138 BUG_ON(!policy->cur); 140 BUG_ON(!policy->cur);
139 mutex_lock(&userspace_mutex); 141 mutex_lock(&userspace_mutex);
142 rc = sysfs_create_file (&policy->kobj,
143 &freq_attr_scaling_setspeed.attr);
144 if (rc)
145 goto start_out;
146
140 cpu_is_managed[cpu] = 1; 147 cpu_is_managed[cpu] = 1;
141 cpu_min_freq[cpu] = policy->min; 148 cpu_min_freq[cpu] = policy->min;
142 cpu_max_freq[cpu] = policy->max; 149 cpu_max_freq[cpu] = policy->max;
143 cpu_cur_freq[cpu] = policy->cur; 150 cpu_cur_freq[cpu] = policy->cur;
144 cpu_set_freq[cpu] = policy->cur; 151 cpu_set_freq[cpu] = policy->cur;
145 sysfs_create_file (&policy->kobj, &freq_attr_scaling_setspeed.attr);
146 dprintk("managing cpu %u started (%u - %u kHz, currently %u kHz)\n", cpu, cpu_min_freq[cpu], cpu_max_freq[cpu], cpu_cur_freq[cpu]); 152 dprintk("managing cpu %u started (%u - %u kHz, currently %u kHz)\n", cpu, cpu_min_freq[cpu], cpu_max_freq[cpu], cpu_cur_freq[cpu]);
153start_out:
147 mutex_unlock(&userspace_mutex); 154 mutex_unlock(&userspace_mutex);
148 break; 155 break;
149 case CPUFREQ_GOV_STOP: 156 case CPUFREQ_GOV_STOP:
@@ -180,7 +187,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
180 mutex_unlock(&userspace_mutex); 187 mutex_unlock(&userspace_mutex);
181 break; 188 break;
182 } 189 }
183 return 0; 190 return rc;
184} 191}
185 192
186 193
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index 551f4ccf87fd..e7490925fdcf 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -9,7 +9,8 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/cpufreq.h> 10#include <linux/cpufreq.h>
11 11
12#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg) 12#define dprintk(msg...) \
13 cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
13 14
14/********************************************************************* 15/*********************************************************************
15 * FREQUENCY TABLE HELPERS * 16 * FREQUENCY TABLE HELPERS *
@@ -29,7 +30,8 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
29 30
30 continue; 31 continue;
31 } 32 }
32 dprintk("table entry %u: %u kHz, %u index\n", i, freq, table[i].index); 33 dprintk("table entry %u: %u kHz, %u index\n",
34 i, freq, table[i].index);
33 if (freq < min_freq) 35 if (freq < min_freq)
34 min_freq = freq; 36 min_freq = freq;
35 if (freq > max_freq) 37 if (freq > max_freq)
@@ -54,13 +56,14 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
54 unsigned int i; 56 unsigned int i;
55 unsigned int count = 0; 57 unsigned int count = 0;
56 58
57 dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu); 59 dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n",
60 policy->min, policy->max, policy->cpu);
58 61
59 if (!cpu_online(policy->cpu)) 62 if (!cpu_online(policy->cpu))
60 return -EINVAL; 63 return -EINVAL;
61 64
62 cpufreq_verify_within_limits(policy, 65 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
63 policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); 66 policy->cpuinfo.max_freq);
64 67
65 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { 68 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
66 unsigned int freq = table[i].frequency; 69 unsigned int freq = table[i].frequency;
@@ -75,10 +78,11 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
75 if (!count) 78 if (!count)
76 policy->max = next_larger; 79 policy->max = next_larger;
77 80
78 cpufreq_verify_within_limits(policy, 81 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
79 policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); 82 policy->cpuinfo.max_freq);
80 83
81 dprintk("verification lead to (%u - %u kHz) for cpu %u\n", policy->min, policy->max, policy->cpu); 84 dprintk("verification lead to (%u - %u kHz) for cpu %u\n",
85 policy->min, policy->max, policy->cpu);
82 86
83 return 0; 87 return 0;
84} 88}
@@ -101,7 +105,8 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
101 }; 105 };
102 unsigned int i; 106 unsigned int i;
103 107
104 dprintk("request for target %u kHz (relation: %u) for cpu %u\n", target_freq, relation, policy->cpu); 108 dprintk("request for target %u kHz (relation: %u) for cpu %u\n",
109 target_freq, relation, policy->cpu);
105 110
106 switch (relation) { 111 switch (relation) {
107 case CPUFREQ_RELATION_H: 112 case CPUFREQ_RELATION_H:
@@ -192,7 +197,10 @@ static ssize_t show_available_freqs (struct cpufreq_policy *policy, char *buf)
192} 197}
193 198
194struct freq_attr cpufreq_freq_attr_scaling_available_freqs = { 199struct freq_attr cpufreq_freq_attr_scaling_available_freqs = {
195 .attr = { .name = "scaling_available_frequencies", .mode = 0444, .owner=THIS_MODULE }, 200 .attr = { .name = "scaling_available_frequencies",
201 .mode = 0444,
202 .owner=THIS_MODULE
203 },
196 .show = show_available_freqs, 204 .show = show_available_freqs,
197}; 205};
198EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); 206EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs);
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e23bc0d62159..3f828052f8d2 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -796,7 +796,7 @@ endchoice
796config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ 796config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
797 int "Maximum transfer size (KB) per request (up to 128)" 797 int "Maximum transfer size (KB) per request (up to 128)"
798 default "128" 798 default "128"
799 depends BLK_DEV_IDE_AU1XXX 799 depends on BLK_DEV_IDE_AU1XXX
800 800
801config IDE_ARM 801config IDE_ARM
802 def_bool ARM && (ARCH_A5K || ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK) 802 def_bool ARM && (ARCH_A5K || ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 176142c61492..7399ba791116 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -12,7 +12,7 @@ config NEW_LEDS
12 12
13config LEDS_CLASS 13config LEDS_CLASS
14 tristate "LED Class Support" 14 tristate "LED Class Support"
15 depends NEW_LEDS 15 depends on NEW_LEDS
16 help 16 help
17 This option enables the led sysfs class in /sys/class/leds. You'll 17 This option enables the led sysfs class in /sys/class/leds. You'll
18 need this to do anything useful with LEDs. If unsure, say N. 18 need this to do anything useful with LEDs. If unsure, say N.
@@ -21,28 +21,28 @@ comment "LED drivers"
21 21
22config LEDS_CORGI 22config LEDS_CORGI
23 tristate "LED Support for the Sharp SL-C7x0 series" 23 tristate "LED Support for the Sharp SL-C7x0 series"
24 depends LEDS_CLASS && PXA_SHARP_C7xx 24 depends on LEDS_CLASS && PXA_SHARP_C7xx
25 help 25 help
26 This option enables support for the LEDs on Sharp Zaurus 26 This option enables support for the LEDs on Sharp Zaurus
27 SL-C7x0 series (C700, C750, C760, C860). 27 SL-C7x0 series (C700, C750, C760, C860).
28 28
29config LEDS_LOCOMO 29config LEDS_LOCOMO
30 tristate "LED Support for Locomo device" 30 tristate "LED Support for Locomo device"
31 depends LEDS_CLASS && SHARP_LOCOMO 31 depends on LEDS_CLASS && SHARP_LOCOMO
32 help 32 help
33 This option enables support for the LEDs on Sharp Locomo. 33 This option enables support for the LEDs on Sharp Locomo.
34 Zaurus models SL-5500 and SL-5600. 34 Zaurus models SL-5500 and SL-5600.
35 35
36config LEDS_SPITZ 36config LEDS_SPITZ
37 tristate "LED Support for the Sharp SL-Cxx00 series" 37 tristate "LED Support for the Sharp SL-Cxx00 series"
38 depends LEDS_CLASS && PXA_SHARP_Cxx00 38 depends on LEDS_CLASS && PXA_SHARP_Cxx00
39 help 39 help
40 This option enables support for the LEDs on Sharp Zaurus 40 This option enables support for the LEDs on Sharp Zaurus
41 SL-Cxx00 series (C1000, C3000, C3100). 41 SL-Cxx00 series (C1000, C3000, C3100).
42 42
43config LEDS_IXP4XX 43config LEDS_IXP4XX
44 tristate "LED Support for GPIO connected LEDs on IXP4XX processors" 44 tristate "LED Support for GPIO connected LEDs on IXP4XX processors"
45 depends LEDS_CLASS && ARCH_IXP4XX 45 depends on LEDS_CLASS && ARCH_IXP4XX
46 help 46 help
47 This option enables support for the LEDs connected to GPIO 47 This option enables support for the LEDs connected to GPIO
48 outputs of the Intel IXP4XX processors. To be useful the 48 outputs of the Intel IXP4XX processors. To be useful the
@@ -51,7 +51,7 @@ config LEDS_IXP4XX
51 51
52config LEDS_TOSA 52config LEDS_TOSA
53 tristate "LED Support for the Sharp SL-6000 series" 53 tristate "LED Support for the Sharp SL-6000 series"
54 depends LEDS_CLASS && PXA_SHARPSL 54 depends on LEDS_CLASS && PXA_SHARPSL
55 help 55 help
56 This option enables support for the LEDs on Sharp Zaurus 56 This option enables support for the LEDs on Sharp Zaurus
57 SL-6000 series. 57 SL-6000 series.
@@ -65,7 +65,7 @@ config LEDS_S3C24XX
65 65
66config LEDS_AMS_DELTA 66config LEDS_AMS_DELTA
67 tristate "LED Support for the Amstrad Delta (E3)" 67 tristate "LED Support for the Amstrad Delta (E3)"
68 depends LEDS_CLASS && MACH_AMS_DELTA 68 depends on LEDS_CLASS && MACH_AMS_DELTA
69 help 69 help
70 This option enables support for the LEDs on Amstrad Delta (E3). 70 This option enables support for the LEDs on Amstrad Delta (E3).
71 71
@@ -86,7 +86,7 @@ comment "LED Triggers"
86 86
87config LEDS_TRIGGERS 87config LEDS_TRIGGERS
88 bool "LED Trigger support" 88 bool "LED Trigger support"
89 depends NEW_LEDS 89 depends on NEW_LEDS
90 help 90 help
91 This option enables trigger support for the leds class. 91 This option enables trigger support for the leds class.
92 These triggers allow kernel events to drive the LEDs and can 92 These triggers allow kernel events to drive the LEDs and can
@@ -94,21 +94,21 @@ config LEDS_TRIGGERS
94 94
95config LEDS_TRIGGER_TIMER 95config LEDS_TRIGGER_TIMER
96 tristate "LED Timer Trigger" 96 tristate "LED Timer Trigger"
97 depends LEDS_TRIGGERS 97 depends on LEDS_TRIGGERS
98 help 98 help
99 This allows LEDs to be controlled by a programmable timer 99 This allows LEDs to be controlled by a programmable timer
100 via sysfs. If unsure, say Y. 100 via sysfs. If unsure, say Y.
101 101
102config LEDS_TRIGGER_IDE_DISK 102config LEDS_TRIGGER_IDE_DISK
103 bool "LED IDE Disk Trigger" 103 bool "LED IDE Disk Trigger"
104 depends LEDS_TRIGGERS && BLK_DEV_IDEDISK 104 depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK
105 help 105 help
106 This allows LEDs to be controlled by IDE disk activity. 106 This allows LEDs to be controlled by IDE disk activity.
107 If unsure, say Y. 107 If unsure, say Y.
108 108
109config LEDS_TRIGGER_HEARTBEAT 109config LEDS_TRIGGER_HEARTBEAT
110 tristate "LED Heartbeat Trigger" 110 tristate "LED Heartbeat Trigger"
111 depends LEDS_TRIGGERS 111 depends on LEDS_TRIGGERS
112 help 112 help
113 This allows LEDs to be controlled by a CPU load average. 113 This allows LEDs to be controlled by a CPU load average.
114 The flash frequency is a hyperbolic function of the 1-minute 114 The flash frequency is a hyperbolic function of the 1-minute
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
index 89dd18c3c5cc..5ed0adc4ca26 100644
--- a/drivers/media/video/ov7670.c
+++ b/drivers/media/video/ov7670.c
@@ -18,7 +18,7 @@
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19 19
20 20
21MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net."); 21MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>");
22MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors"); 22MODULE_DESCRIPTION("A low-level driver for OmniVision ov7670 sensors");
23MODULE_LICENSE("GPL"); 23MODULE_LICENSE("GPL");
24 24
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 03bf164f9e8d..c2ae2a24629b 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic *nic)
1930 nic->rx_to_use = nic->rx_to_clean = NULL; 1930 nic->rx_to_use = nic->rx_to_clean = NULL;
1931 nic->ru_running = RU_UNINITIALIZED; 1931 nic->ru_running = RU_UNINITIALIZED;
1932 1932
1933 if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC))) 1933 if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
1934 return -ENOMEM; 1934 return -ENOMEM;
1935 memset(nic->rxs, 0, sizeof(struct rx) * count);
1936 1935
1937 for(rx = nic->rxs, i = 0; i < count; rx++, i++) { 1936 for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
1938 rx->next = (i + 1 < count) ? rx + 1 : nic->rxs; 1937 rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 0b36dd5cdac2..2978c09860ee 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -663,7 +663,7 @@ config V850E_UART
663 663
664config V850E_UARTB 664config V850E_UARTB
665 bool 665 bool
666 depends V850E_UART && V850E_ME2 666 depends on V850E_UART && V850E_ME2
667 default y 667 default y
668 668
669config V850E_UART_CONSOLE 669config V850E_UART_CONSOLE
@@ -909,7 +909,7 @@ config SERIAL_M32R_PLDSIO
909 909
910config SERIAL_TXX9 910config SERIAL_TXX9
911 bool "TMPTX39XX/49XX SIO support" 911 bool "TMPTX39XX/49XX SIO support"
912 depends HAS_TXX9_SERIAL 912 depends on HAS_TXX9_SERIAL
913 select SERIAL_CORE 913 select SERIAL_CORE
914 default y 914 default y
915 915
diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c
index 7d623003e65e..71e6a24d8c28 100644
--- a/drivers/serial/icom.c
+++ b/drivers/serial/icom.c
@@ -1510,7 +1510,7 @@ static int __devinit icom_probe(struct pci_dev *dev,
1510 } 1510 }
1511 1511
1512 if ( (retval = pci_request_regions(dev, "icom"))) { 1512 if ( (retval = pci_request_regions(dev, "icom"))) {
1513 dev_err(&dev->dev, "pci_request_region FAILED\n"); 1513 dev_err(&dev->dev, "pci_request_regions FAILED\n");
1514 pci_disable_device(dev); 1514 pci_disable_device(dev);
1515 return retval; 1515 return retval;
1516 } 1516 }
diff --git a/fs/Kconfig b/fs/Kconfig
index b3b5aa0edff9..276ff3baaafe 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -12,9 +12,7 @@ config EXT2_FS
12 Ext2 is a standard Linux file system for hard disks. 12 Ext2 is a standard Linux file system for hard disks.
13 13
14 To compile this file system support as a module, choose M here: the 14 To compile this file system support as a module, choose M here: the
15 module will be called ext2. Be aware however that the file system 15 module will be called ext2.
16 of your root partition (the one containing the directory /) cannot
17 be compiled as a module, and so this could be dangerous.
18 16
19 If unsure, say Y. 17 If unsure, say Y.
20 18
@@ -98,9 +96,7 @@ config EXT3_FS
98 (available at <http://sourceforge.net/projects/e2fsprogs/>). 96 (available at <http://sourceforge.net/projects/e2fsprogs/>).
99 97
100 To compile this file system support as a module, choose M here: the 98 To compile this file system support as a module, choose M here: the
101 module will be called ext3. Be aware however that the file system 99 module will be called ext3.
102 of your root partition (the one containing the directory /) cannot
103 be compiled as a module, and so this may be dangerous.
104 100
105config EXT3_FS_XATTR 101config EXT3_FS_XATTR
106 bool "Ext3 extended attributes" 102 bool "Ext3 extended attributes"
@@ -163,9 +159,7 @@ config EXT4DEV_FS
163 features will be added to ext4dev gradually. 159 features will be added to ext4dev gradually.
164 160
165 To compile this file system support as a module, choose M here. The 161 To compile this file system support as a module, choose M here. The
166 module will be called ext4dev. Be aware, however, that the filesystem 162 module will be called ext4dev.
167 of your root partition (the one containing the directory /) cannot
168 be compiled as a module, and so this could be dangerous.
169 163
170 If unsure, say N. 164 If unsure, say N.
171 165
@@ -1008,7 +1002,7 @@ config TMPFS_POSIX_ACL
1008 1002
1009config HUGETLBFS 1003config HUGETLBFS
1010 bool "HugeTLB file system support" 1004 bool "HugeTLB file system support"
1011 depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN 1005 depends on X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN
1012 help 1006 help
1013 hugetlbfs is a filesystem backing for HugeTLB pages, based on 1007 hugetlbfs is a filesystem backing for HugeTLB pages, based on
1014 ramfs. For architectures that support it, say Y here and read 1008 ramfs. For architectures that support it, say Y here and read
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 76f06f6bc2f6..6e6d4568d548 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -706,12 +706,11 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params,
706 return -ELIBBAD; 706 return -ELIBBAD;
707 707
708 size = sizeof(*loadmap) + nloads * sizeof(*seg); 708 size = sizeof(*loadmap) + nloads * sizeof(*seg);
709 loadmap = kmalloc(size, GFP_KERNEL); 709 loadmap = kzalloc(size, GFP_KERNEL);
710 if (!loadmap) 710 if (!loadmap)
711 return -ENOMEM; 711 return -ENOMEM;
712 712
713 params->loadmap = loadmap; 713 params->loadmap = loadmap;
714 memset(loadmap, 0, size);
715 714
716 loadmap->version = ELF32_FDPIC_LOADMAP_VERSION; 715 loadmap->version = ELF32_FDPIC_LOADMAP_VERSION;
717 loadmap->nsegs = nloads; 716 loadmap->nsegs = nloads;
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index 5679d4993072..609a3899475c 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -100,6 +100,8 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
100 100
101#define MSR_P6_PERFCTR0 0xc1 101#define MSR_P6_PERFCTR0 0xc1
102#define MSR_P6_PERFCTR1 0xc2 102#define MSR_P6_PERFCTR1 0xc2
103#define MSR_FSB_FREQ 0xcd
104
103 105
104#define MSR_IA32_BBL_CR_CTL 0x119 106#define MSR_IA32_BBL_CR_CTL 0x119
105 107
@@ -130,6 +132,9 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
130#define MSR_IA32_PERF_STATUS 0x198 132#define MSR_IA32_PERF_STATUS 0x198
131#define MSR_IA32_PERF_CTL 0x199 133#define MSR_IA32_PERF_CTL 0x199
132 134
135#define MSR_IA32_MPERF 0xE7
136#define MSR_IA32_APERF 0xE8
137
133#define MSR_IA32_THERM_CONTROL 0x19a 138#define MSR_IA32_THERM_CONTROL 0x19a
134#define MSR_IA32_THERM_INTERRUPT 0x19b 139#define MSR_IA32_THERM_INTERRUPT 0x19b
135#define MSR_IA32_THERM_STATUS 0x19c 140#define MSR_IA32_THERM_STATUS 0x19c
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index 952783d35c7b..3227bc93d69b 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -189,6 +189,7 @@ static inline unsigned int cpuid_edx(unsigned int op)
189 189
190#define MSR_IA32_PERFCTR0 0xc1 190#define MSR_IA32_PERFCTR0 0xc1
191#define MSR_IA32_PERFCTR1 0xc2 191#define MSR_IA32_PERFCTR1 0xc2
192#define MSR_FSB_FREQ 0xcd
192 193
193#define MSR_MTRRcap 0x0fe 194#define MSR_MTRRcap 0x0fe
194#define MSR_IA32_BBL_CR_CTL 0x119 195#define MSR_IA32_BBL_CR_CTL 0x119
@@ -311,6 +312,9 @@ static inline unsigned int cpuid_edx(unsigned int op)
311#define MSR_IA32_PERF_STATUS 0x198 312#define MSR_IA32_PERF_STATUS 0x198
312#define MSR_IA32_PERF_CTL 0x199 313#define MSR_IA32_PERF_CTL 0x199
313 314
315#define MSR_IA32_MPERF 0xE7
316#define MSR_IA32_APERF 0xE8
317
314#define MSR_IA32_THERM_CONTROL 0x19a 318#define MSR_IA32_THERM_CONTROL 0x19a
315#define MSR_IA32_THERM_INTERRUPT 0x19b 319#define MSR_IA32_THERM_INTERRUPT 0x19b
316#define MSR_IA32_THERM_STATUS 0x19c 320#define MSR_IA32_THERM_STATUS 0x19c
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 538423d4a865..aca66984aafd 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -40,7 +40,7 @@ extern void __chk_io_ptr(void __iomem *);
40#error no compiler-gcc.h file for this gcc version 40#error no compiler-gcc.h file for this gcc version
41#elif __GNUC__ == 4 41#elif __GNUC__ == 4
42# include <linux/compiler-gcc4.h> 42# include <linux/compiler-gcc4.h>
43#elif __GNUC__ == 3 43#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
44# include <linux/compiler-gcc3.h> 44# include <linux/compiler-gcc3.h>
45#else 45#else
46# error Sorry, your compiler is too old/not recognized. 46# error Sorry, your compiler is too old/not recognized.
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index a7f015027535..fef6f3d0a4a7 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -160,31 +160,6 @@ struct configfs_group_operations {
160 void (*drop_item)(struct config_group *group, struct config_item *item); 160 void (*drop_item)(struct config_group *group, struct config_item *item);
161}; 161};
162 162
163
164
165/**
166 * Use these macros to make defining attributes easier. See include/linux/device.h
167 * for examples..
168 */
169
170#if 0
171#define __ATTR(_name,_mode,_show,_store) { \
172 .attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
173 .show = _show, \
174 .store = _store, \
175}
176
177#define __ATTR_RO(_name) { \
178 .attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
179 .show = _name##_show, \
180}
181
182#define __ATTR_NULL { .attr = { .name = NULL } }
183
184#define attr_name(_attr) (_attr).attr.name
185#endif
186
187
188struct configfs_subsystem { 163struct configfs_subsystem {
189 struct config_group su_group; 164 struct config_group su_group;
190 struct semaphore su_sem; 165 struct semaphore su_sem;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4ea39fee99c7..7f008f6bfdc3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -172,6 +172,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 172 unsigned int relation);
173 173
174 174
175extern int cpufreq_driver_getavg(struct cpufreq_policy *policy);
176
175int cpufreq_register_governor(struct cpufreq_governor *governor); 177int cpufreq_register_governor(struct cpufreq_governor *governor);
176void cpufreq_unregister_governor(struct cpufreq_governor *governor); 178void cpufreq_unregister_governor(struct cpufreq_governor *governor);
177 179
@@ -204,6 +206,7 @@ struct cpufreq_driver {
204 unsigned int (*get) (unsigned int cpu); 206 unsigned int (*get) (unsigned int cpu);
205 207
206 /* optional */ 208 /* optional */
209 unsigned int (*getavg) (unsigned int cpu);
207 int (*exit) (struct cpufreq_policy *policy); 210 int (*exit) (struct cpufreq_policy *policy);
208 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 211 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
209 int (*resume) (struct cpufreq_policy *policy); 212 int (*resume) (struct cpufreq_policy *policy);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 6d8846e7be6d..81480e613467 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -11,7 +11,7 @@
11 ** the sysctl() binary interface. Do *NOT* change the 11 ** the sysctl() binary interface. Do *NOT* change the
12 ** numbering of any existing values here, and do not change 12 ** numbering of any existing values here, and do not change
13 ** any numbers within any one set of values. If you have to 13 ** any numbers within any one set of values. If you have to
14 ** have to redefine an existing interface, use a new number for it. 14 ** redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
diff --git a/init/Kconfig b/init/Kconfig
index 9edf103b3ec3..f000edb3bb7a 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -348,7 +348,7 @@ config SYSCTL_SYSCALL
348 If unsure say Y here. 348 If unsure say Y here.
349 349
350config KALLSYMS 350config KALLSYMS
351 bool "Load all symbols for debugging/kksymoops" if EMBEDDED 351 bool "Load all symbols for debugging/ksymoops" if EMBEDDED
352 default y 352 default y
353 help 353 help
354 Say Y here to let the kernel print out symbolic crash information and 354 Say Y here to let the kernel print out symbolic crash information and
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 0701ddda1df8..818e4589f718 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -437,7 +437,7 @@ config FAIL_PAGE_ALLOC
437 Provide fault-injection capability for alloc_pages(). 437 Provide fault-injection capability for alloc_pages().
438 438
439config FAIL_MAKE_REQUEST 439config FAIL_MAKE_REQUEST
440 bool "Fault-injection capabilitiy for disk IO" 440 bool "Fault-injection capability for disk IO"
441 depends on FAULT_INJECTION 441 depends on FAULT_INJECTION
442 help 442 help
443 Provide fault-injection capability for disk IO. 443 Provide fault-injection capability for disk IO.
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 74046efdf875..8ce00d3703da 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -565,7 +565,7 @@ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
565 } else { 565 } else {
566 struct sk_buff *free_it = next; 566 struct sk_buff *free_it = next;
567 567
568 /* Old fragmnet is completely overridden with 568 /* Old fragment is completely overridden with
569 * new one drop it. 569 * new one drop it.
570 */ 570 */
571 next = next->next; 571 next = next->next;
diff --git a/sound/aoa/fabrics/Kconfig b/sound/aoa/fabrics/Kconfig
index c3bc7705c86a..50d7021ff677 100644
--- a/sound/aoa/fabrics/Kconfig
+++ b/sound/aoa/fabrics/Kconfig
@@ -1,6 +1,6 @@
1config SND_AOA_FABRIC_LAYOUT 1config SND_AOA_FABRIC_LAYOUT
2 tristate "layout-id fabric" 2 tristate "layout-id fabric"
3 depends SND_AOA 3 depends on SND_AOA
4 select SND_AOA_SOUNDBUS 4 select SND_AOA_SOUNDBUS
5 select SND_AOA_SOUNDBUS_I2S 5 select SND_AOA_SOUNDBUS_I2S
6 ---help--- 6 ---help---