diff options
92 files changed, 1024 insertions, 419 deletions
diff --git a/Documentation/fb/pvr2fb.txt b/Documentation/fb/pvr2fb.txt index 2bf6c2321c2d..36bdeff585e2 100644 --- a/Documentation/fb/pvr2fb.txt +++ b/Documentation/fb/pvr2fb.txt | |||
@@ -9,14 +9,13 @@ one found in the Dreamcast. | |||
9 | Advantages: | 9 | Advantages: |
10 | 10 | ||
11 | * It provides a nice large console (128 cols + 48 lines with 1024x768) | 11 | * It provides a nice large console (128 cols + 48 lines with 1024x768) |
12 | without using tiny, unreadable fonts. | 12 | without using tiny, unreadable fonts (NOT on the Dreamcast) |
13 | * You can run XF86_FBDev on top of /dev/fb0 | 13 | * You can run XF86_FBDev on top of /dev/fb0 |
14 | * Most important: boot logo :-) | 14 | * Most important: boot logo :-) |
15 | 15 | ||
16 | Disadvantages: | 16 | Disadvantages: |
17 | 17 | ||
18 | * Driver is currently limited to the Dreamcast PowerVR 2 implementation | 18 | * Driver is largely untested on non-Dreamcast systems. |
19 | at the time of this writing. | ||
20 | 19 | ||
21 | Configuration | 20 | Configuration |
22 | ============= | 21 | ============= |
@@ -29,11 +28,16 @@ Accepted options: | |||
29 | font:X - default font to use. All fonts are supported, including the | 28 | font:X - default font to use. All fonts are supported, including the |
30 | SUN12x22 font which is very nice at high resolutions. | 29 | SUN12x22 font which is very nice at high resolutions. |
31 | 30 | ||
32 | mode:X - default video mode. The following video modes are supported: | ||
33 | 640x240-60, 640x480-60. | ||
34 | 31 | ||
32 | mode:X - default video mode with format [xres]x[yres]-<bpp>@<refresh rate> | ||
33 | The following video modes are supported: | ||
34 | 640x640-16@60, 640x480-24@60, 640x480-32@60. The Dreamcast | ||
35 | defaults to 640x480-16@60. At the time of writing the | ||
36 | 24bpp and 32bpp modes function poorly. Work to fix that is | ||
37 | ongoing | ||
38 | |||
35 | Note: the 640x240 mode is currently broken, and should not be | 39 | Note: the 640x240 mode is currently broken, and should not be |
36 | used for any reason. It is only mentioned as a reference. | 40 | used for any reason. It is only mentioned here as a reference. |
37 | 41 | ||
38 | inverse - invert colors on screen (for LCD displays) | 42 | inverse - invert colors on screen (for LCD displays) |
39 | 43 | ||
@@ -52,10 +56,10 @@ output:X - output type. This can be any of the following: pal, ntsc, and | |||
52 | X11 | 56 | X11 |
53 | === | 57 | === |
54 | 58 | ||
55 | XF86_FBDev should work, in theory. At the time of this writing it is | 59 | XF86_FBDev has been shown to work on the Dreamcast in the past - though not yet |
56 | totally untested and may or may not even portray the beginnings of | 60 | on any 2.6 series kernel. |
57 | working. If you end up testing this, please let me know! | ||
58 | 61 | ||
59 | -- | 62 | -- |
60 | Paul Mundt <lethal@linuxdc.org> | 63 | Paul Mundt <lethal@linuxdc.org> |
64 | Updated by Adrian McMenamin <adrian@mcmen.demon.co.uk> | ||
61 | 65 | ||
diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt index 75b3680c41eb..6c0817c45683 100644 --- a/Documentation/i386/zero-page.txt +++ b/Documentation/i386/zero-page.txt | |||
@@ -1,3 +1,13 @@ | |||
1 | --------------------------------------------------------------------------- | ||
2 | !!!!!!!!!!!!!!!WARNING!!!!!!!! | ||
3 | The zero page is a kernel internal data structure, not a stable ABI. It might change | ||
4 | without warning and the kernel has no way to detect old version of it. | ||
5 | If you're writing some external code like a boot loader you should only use | ||
6 | the stable versioned real mode boot protocol described in boot.txt. Otherwise the kernel | ||
7 | might break you at any time. | ||
8 | !!!!!!!!!!!!!WARNING!!!!!!!!!!! | ||
9 | ---------------------------------------------------------------------------- | ||
10 | |||
1 | Summary of boot_params layout (kernel point of view) | 11 | Summary of boot_params layout (kernel point of view) |
2 | ( collected by Hans Lermen and Martin Mares ) | 12 | ( collected by Hans Lermen and Martin Mares ) |
3 | 13 | ||
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt index 536d5bfbdb8d..fe8b0c4892cf 100644 --- a/Documentation/kbuild/kconfig-language.txt +++ b/Documentation/kbuild/kconfig-language.txt | |||
@@ -98,6 +98,15 @@ applicable everywhere (see syntax). | |||
98 | times, the limit is set to the largest selection. | 98 | times, the limit is set to the largest selection. |
99 | Reverse dependencies can only be used with boolean or tristate | 99 | Reverse dependencies can only be used with boolean or tristate |
100 | symbols. | 100 | symbols. |
101 | Note: | ||
102 | select is evil.... select will by brute force set a symbol | ||
103 | equal to 'y' without visiting the dependencies. So abusing | ||
104 | select you are able to select a symbol FOO even if FOO depends | ||
105 | on BAR that is not set. In general use select only for | ||
106 | non-visible symbols (no promts anywhere) and for symbols with | ||
107 | no dependencies. That will limit the usefulness but on the | ||
108 | other hand avoid the illegal configurations all over. kconfig | ||
109 | should one day warn about such things. | ||
101 | 110 | ||
102 | - numerical ranges: "range" <symbol> <symbol> ["if" <expr>] | 111 | - numerical ranges: "range" <symbol> <symbol> ["if" <expr>] |
103 | This allows to limit the range of possible input values for int | 112 | This allows to limit the range of possible input values for int |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index efdb42fd3fb8..a326487a3ab5 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1922,7 +1922,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1922 | See header of drivers/scsi/wd7000.c. | 1922 | See header of drivers/scsi/wd7000.c. |
1923 | 1923 | ||
1924 | wdt= [WDT] Watchdog | 1924 | wdt= [WDT] Watchdog |
1925 | See Documentation/watchdog/watchdog.txt. | 1925 | See Documentation/watchdog/wdt.txt. |
1926 | 1926 | ||
1927 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. | 1927 | xd= [HW,XT] Original XT pre-IDE (RLL encoded) disks. |
1928 | xd_geo= See header of drivers/block/xd.c. | 1928 | xd_geo= See header of drivers/block/xd.c. |
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt new file mode 100644 index 000000000000..5fbcc22c98e9 --- /dev/null +++ b/Documentation/memory-hotplug.txt | |||
@@ -0,0 +1,322 @@ | |||
1 | ============== | ||
2 | Memory Hotplug | ||
3 | ============== | ||
4 | |||
5 | Last Updated: Jul 28 2007 | ||
6 | |||
7 | This document is about memory hotplug including how-to-use and current status. | ||
8 | Because Memory Hotplug is still under development, contents of this text will | ||
9 | be changed often. | ||
10 | |||
11 | 1. Introduction | ||
12 | 1.1 purpose of memory hotplug | ||
13 | 1.2. Phases of memory hotplug | ||
14 | 1.3. Unit of Memory online/offline operation | ||
15 | 2. Kernel Configuration | ||
16 | 3. sysfs files for memory hotplug | ||
17 | 4. Physical memory hot-add phase | ||
18 | 4.1 Hardware(Firmware) Support | ||
19 | 4.2 Notify memory hot-add event by hand | ||
20 | 5. Logical Memory hot-add phase | ||
21 | 5.1. State of memory | ||
22 | 5.2. How to online memory | ||
23 | 6. Logical memory remove | ||
24 | 6.1 Memory offline and ZONE_MOVABLE | ||
25 | 6.2. How to offline memory | ||
26 | 7. Physical memory remove | ||
27 | 8. Future Work List | ||
28 | |||
29 | Note(1): x86_64's has special implementation for memory hotplug. | ||
30 | This text does not describe it. | ||
31 | Note(2): This text assumes that sysfs is mounted at /sys. | ||
32 | |||
33 | |||
34 | --------------- | ||
35 | 1. Introduction | ||
36 | --------------- | ||
37 | |||
38 | 1.1 purpose of memory hotplug | ||
39 | ------------ | ||
40 | Memory Hotplug allows users to increase/decrease the amount of memory. | ||
41 | Generally, there are two purposes. | ||
42 | |||
43 | (A) For changing the amount of memory. | ||
44 | This is to allow a feature like capacity on demand. | ||
45 | (B) For installing/removing DIMMs or NUMA-nodes physically. | ||
46 | This is to exchange DIMMs/NUMA-nodes, reduce power consumption, etc. | ||
47 | |||
48 | (A) is required by highly virtualized environments and (B) is required by | ||
49 | hardware which supports memory power management. | ||
50 | |||
51 | Linux memory hotplug is designed for both purpose. | ||
52 | |||
53 | |||
54 | 1.2. Phases of memory hotplug | ||
55 | --------------- | ||
56 | There are 2 phases in Memory Hotplug. | ||
57 | 1) Physical Memory Hotplug phase | ||
58 | 2) Logical Memory Hotplug phase. | ||
59 | |||
60 | The First phase is to communicate hardware/firmware and make/erase | ||
61 | environment for hotplugged memory. Basically, this phase is necessary | ||
62 | for the purpose (B), but this is good phase for communication between | ||
63 | highly virtualized environments too. | ||
64 | |||
65 | When memory is hotplugged, the kernel recognizes new memory, makes new memory | ||
66 | management tables, and makes sysfs files for new memory's operation. | ||
67 | |||
68 | If firmware supports notification of connection of new memory to OS, | ||
69 | this phase is triggered automatically. ACPI can notify this event. If not, | ||
70 | "probe" operation by system administration is used instead. | ||
71 | (see Section 4.). | ||
72 | |||
73 | Logical Memory Hotplug phase is to change memory state into | ||
74 | avaiable/unavailable for users. Amount of memory from user's view is | ||
75 | changed by this phase. The kernel makes all memory in it as free pages | ||
76 | when a memory range is available. | ||
77 | |||
78 | In this document, this phase is described as online/offline. | ||
79 | |||
80 | Logical Memory Hotplug phase is triggred by write of sysfs file by system | ||
81 | administrator. For the hot-add case, it must be executed after Physical Hotplug | ||
82 | phase by hand. | ||
83 | (However, if you writes udev's hotplug scripts for memory hotplug, these | ||
84 | phases can be execute in seamless way.) | ||
85 | |||
86 | |||
87 | 1.3. Unit of Memory online/offline operation | ||
88 | ------------ | ||
89 | Memory hotplug uses SPARSEMEM memory model. SPARSEMEM divides the whole memory | ||
90 | into chunks of the same size. The chunk is called a "section". The size of | ||
91 | a section is architecture dependent. For example, power uses 16MiB, ia64 uses | ||
92 | 1GiB. The unit of online/offline operation is "one section". (see Section 3.) | ||
93 | |||
94 | To determine the size of sections, please read this file: | ||
95 | |||
96 | /sys/devices/system/memory/block_size_bytes | ||
97 | |||
98 | This file shows the size of sections in byte. | ||
99 | |||
100 | ----------------------- | ||
101 | 2. Kernel Configuration | ||
102 | ----------------------- | ||
103 | To use memory hotplug feature, kernel must be compiled with following | ||
104 | config options. | ||
105 | |||
106 | - For all memory hotplug | ||
107 | Memory model -> Sparse Memory (CONFIG_SPARSEMEM) | ||
108 | Allow for memory hot-add (CONFIG_MEMORY_HOTPLUG) | ||
109 | |||
110 | - To enable memory removal, the followings are also necessary | ||
111 | Allow for memory hot remove (CONFIG_MEMORY_HOTREMOVE) | ||
112 | Page Migration (CONFIG_MIGRATION) | ||
113 | |||
114 | - For ACPI memory hotplug, the followings are also necessary | ||
115 | Memory hotplug (under ACPI Support menu) (CONFIG_ACPI_HOTPLUG_MEMORY) | ||
116 | This option can be kernel module. | ||
117 | |||
118 | - As a related configuration, if your box has a feature of NUMA-node hotplug | ||
119 | via ACPI, then this option is necessary too. | ||
120 | ACPI0004,PNP0A05 and PNP0A06 Container Driver (under ACPI Support menu) | ||
121 | (CONFIG_ACPI_CONTAINER). | ||
122 | This option can be kernel module too. | ||
123 | |||
124 | -------------------------------- | ||
125 | 3 sysfs files for memory hotplug | ||
126 | -------------------------------- | ||
127 | All sections have their device information under /sys/devices/system/memory as | ||
128 | |||
129 | /sys/devices/system/memory/memoryXXX | ||
130 | (XXX is section id.) | ||
131 | |||
132 | Now, XXX is defined as start_address_of_section / section_size. | ||
133 | |||
134 | For example, assume 1GiB section size. A device for a memory starting at | ||
135 | 0x100000000 is /sys/device/system/memory/memory4 | ||
136 | (0x100000000 / 1Gib = 4) | ||
137 | This device covers address range [0x100000000 ... 0x140000000) | ||
138 | |||
139 | Under each section, you can see 3 files. | ||
140 | |||
141 | /sys/devices/system/memory/memoryXXX/phys_index | ||
142 | /sys/devices/system/memory/memoryXXX/phys_device | ||
143 | /sys/devices/system/memory/memoryXXX/state | ||
144 | |||
145 | 'phys_index' : read-only and contains section id, same as XXX. | ||
146 | 'state' : read-write | ||
147 | at read: contains online/offline state of memory. | ||
148 | at write: user can specify "online", "offline" command | ||
149 | 'phys_device': read-only: designed to show the name of physical memory device. | ||
150 | This is not well implemented now. | ||
151 | |||
152 | NOTE: | ||
153 | These directories/files appear after physical memory hotplug phase. | ||
154 | |||
155 | |||
156 | -------------------------------- | ||
157 | 4. Physical memory hot-add phase | ||
158 | -------------------------------- | ||
159 | |||
160 | 4.1 Hardware(Firmware) Support | ||
161 | ------------ | ||
162 | On x86_64/ia64 platform, memory hotplug by ACPI is supported. | ||
163 | |||
164 | In general, the firmware (ACPI) which supports memory hotplug defines | ||
165 | memory class object of _HID "PNP0C80". When a notify is asserted to PNP0C80, | ||
166 | Linux's ACPI handler does hot-add memory to the system and calls a hotplug udev | ||
167 | script. This will be done automatically. | ||
168 | |||
169 | But scripts for memory hotplug are not contained in generic udev package(now). | ||
170 | You may have to write it by yourself or online/offline memory by hand. | ||
171 | Please see "How to online memory", "How to offline memory" in this text. | ||
172 | |||
173 | If firmware supports NUMA-node hotplug, and defines an object _HID "ACPI0004", | ||
174 | "PNP0A05", or "PNP0A06", notification is asserted to it, and ACPI handler | ||
175 | calls hotplug code for all of objects which are defined in it. | ||
176 | If memory device is found, memory hotplug code will be called. | ||
177 | |||
178 | |||
179 | 4.2 Notify memory hot-add event by hand | ||
180 | ------------ | ||
181 | In some environments, especially virtualized environment, firmware will not | ||
182 | notify memory hotplug event to the kernel. For such environment, "probe" | ||
183 | interface is supported. This interface depends on CONFIG_ARCH_MEMORY_PROBE. | ||
184 | |||
185 | Now, CONFIG_ARCH_MEMORY_PROBE is supported only by powerpc but it does not | ||
186 | contain highly architecture codes. Please add config if you need "probe" | ||
187 | interface. | ||
188 | |||
189 | Probe interface is located at | ||
190 | /sys/devices/system/memory/probe | ||
191 | |||
192 | You can tell the physical address of new memory to the kernel by | ||
193 | |||
194 | % echo start_address_of_new_memory > /sys/devices/system/memory/probe | ||
195 | |||
196 | Then, [start_address_of_new_memory, start_address_of_new_memory + section_size) | ||
197 | memory range is hot-added. In this case, hotplug script is not called (in | ||
198 | current implementation). You'll have to online memory by yourself. | ||
199 | Please see "How to online memory" in this text. | ||
200 | |||
201 | |||
202 | |||
203 | ------------------------------ | ||
204 | 5. Logical Memory hot-add phase | ||
205 | ------------------------------ | ||
206 | |||
207 | 5.1. State of memory | ||
208 | ------------ | ||
209 | To see (online/offline) state of memory section, read 'state' file. | ||
210 | |||
211 | % cat /sys/device/system/memory/memoryXXX/state | ||
212 | |||
213 | |||
214 | If the memory section is online, you'll read "online". | ||
215 | If the memory section is offline, you'll read "offline". | ||
216 | |||
217 | |||
218 | 5.2. How to online memory | ||
219 | ------------ | ||
220 | Even if the memory is hot-added, it is not at ready-to-use state. | ||
221 | For using newly added memory, you have to "online" the memory section. | ||
222 | |||
223 | For onlining, you have to write "online" to the section's state file as: | ||
224 | |||
225 | % echo online > /sys/devices/system/memory/memoryXXX/state | ||
226 | |||
227 | After this, section memoryXXX's state will be 'online' and the amount of | ||
228 | available memory will be increased. | ||
229 | |||
230 | Currently, newly added memory is added as ZONE_NORMAL (for powerpc, ZONE_DMA). | ||
231 | This may be changed in future. | ||
232 | |||
233 | |||
234 | |||
235 | ------------------------ | ||
236 | 6. Logical memory remove | ||
237 | ------------------------ | ||
238 | |||
239 | 6.1 Memory offline and ZONE_MOVABLE | ||
240 | ------------ | ||
241 | Memory offlining is more complicated than memory online. Because memory offline | ||
242 | has to make the whole memory section be unused, memory offline can fail if | ||
243 | the section includes memory which cannot be freed. | ||
244 | |||
245 | In general, memory offline can use 2 techniques. | ||
246 | |||
247 | (1) reclaim and free all memory in the section. | ||
248 | (2) migrate all pages in the section. | ||
249 | |||
250 | In the current implementation, Linux's memory offline uses method (2), freeing | ||
251 | all pages in the section by page migration. But not all pages are | ||
252 | migratable. Under current Linux, migratable pages are anonymous pages and | ||
253 | page caches. For offlining a section by migration, the kernel has to guarantee | ||
254 | that the section contains only migratable pages. | ||
255 | |||
256 | Now, a boot option for making a section which consists of migratable pages is | ||
257 | supported. By specifying "kernelcore=" or "movablecore=" boot option, you can | ||
258 | create ZONE_MOVABLE...a zone which is just used for movable pages. | ||
259 | (See also Documentation/kernel-parameters.txt) | ||
260 | |||
261 | Assume the system has "TOTAL" amount of memory at boot time, this boot option | ||
262 | creates ZONE_MOVABLE as following. | ||
263 | |||
264 | 1) When kernelcore=YYYY boot option is used, | ||
265 | Size of memory not for movable pages (not for offline) is YYYY. | ||
266 | Size of memory for movable pages (for offline) is TOTAL-YYYY. | ||
267 | |||
268 | 2) When movablecore=ZZZZ boot option is used, | ||
269 | Size of memory not for movable pages (not for offline) is TOTAL - ZZZZ. | ||
270 | Size of memory for movable pages (for offline) is ZZZZ. | ||
271 | |||
272 | |||
273 | Note) Unfortunately, there is no information to show which section belongs | ||
274 | to ZONE_MOVABLE. This is TBD. | ||
275 | |||
276 | |||
277 | 6.2. How to offline memory | ||
278 | ------------ | ||
279 | You can offline a section by using the same sysfs interface that was used in | ||
280 | memory onlining. | ||
281 | |||
282 | % echo offline > /sys/devices/system/memory/memoryXXX/state | ||
283 | |||
284 | If offline succeeds, the state of the memory section is changed to be "offline". | ||
285 | If it fails, some error core (like -EBUSY) will be returned by the kernel. | ||
286 | Even if a section does not belong to ZONE_MOVABLE, you can try to offline it. | ||
287 | If it doesn't contain 'unmovable' memory, you'll get success. | ||
288 | |||
289 | A section under ZONE_MOVABLE is considered to be able to be offlined easily. | ||
290 | But under some busy state, it may return -EBUSY. Even if a memory section | ||
291 | cannot be offlined due to -EBUSY, you can retry offlining it and may be able to | ||
292 | offline it (or not). | ||
293 | (For example, a page is referred to by some kernel internal call and released | ||
294 | soon.) | ||
295 | |||
296 | Consideration: | ||
297 | Memory hotplug's design direction is to make the possibility of memory offlining | ||
298 | higher and to guarantee unplugging memory under any situation. But it needs | ||
299 | more work. Returning -EBUSY under some situation may be good because the user | ||
300 | can decide to retry more or not by himself. Currently, memory offlining code | ||
301 | does some amount of retry with 120 seconds timeout. | ||
302 | |||
303 | ------------------------- | ||
304 | 7. Physical memory remove | ||
305 | ------------------------- | ||
306 | Need more implementation yet.... | ||
307 | - Notification completion of remove works by OS to firmware. | ||
308 | - Guard from remove if not yet. | ||
309 | |||
310 | -------------- | ||
311 | 8. Future Work | ||
312 | -------------- | ||
313 | - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like | ||
314 | sysctl or new control file. | ||
315 | - showing memory section and physical device relationship. | ||
316 | - showing memory section and node relationship (maybe good for NUMA) | ||
317 | - showing memory section is under ZONE_MOVABLE or not | ||
318 | - test and make it better memory offlining. | ||
319 | - support HugeTLB page migration and offlining. | ||
320 | - memmap removing at memory offline. | ||
321 | - physical remove memory. | ||
322 | |||
diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index ba328f255417..ef19142896ca 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Linux Magic System Request Key Hacks | 1 | Linux Magic System Request Key Hacks |
2 | Documentation for sysrq.c | 2 | Documentation for sysrq.c |
3 | Last update: 2007-MAR-14 | 3 | Last update: 2007-AUG-04 |
4 | 4 | ||
5 | * What is the magic SysRq key? | 5 | * What is the magic SysRq key? |
6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -78,7 +78,7 @@ On all - write a character to /proc/sysrq-trigger. e.g.: | |||
78 | 'g' - Used by kgdb on ppc and sh platforms. | 78 | 'g' - Used by kgdb on ppc and sh platforms. |
79 | 79 | ||
80 | 'h' - Will display help (actually any other key than those listed | 80 | 'h' - Will display help (actually any other key than those listed |
81 | above will display help. but 'h' is easy to remember :-) | 81 | here will display help. but 'h' is easy to remember :-) |
82 | 82 | ||
83 | 'i' - Send a SIGKILL to all processes, except for init. | 83 | 'i' - Send a SIGKILL to all processes, except for init. |
84 | 84 | ||
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c index d4f21ffd1404..1af7bd5a2183 100644 --- a/Documentation/vm/slabinfo.c +++ b/Documentation/vm/slabinfo.c | |||
@@ -396,7 +396,7 @@ void report(struct slabinfo *s) | |||
396 | if (strcmp(s->name, "*") == 0) | 396 | if (strcmp(s->name, "*") == 0) |
397 | return; | 397 | return; |
398 | 398 | ||
399 | printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %d\n", | 399 | printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %lu\n", |
400 | s->name, s->aliases, s->order, s->objects); | 400 | s->name, s->aliases, s->order, s->objects); |
401 | if (s->hwcache_align) | 401 | if (s->hwcache_align) |
402 | printf("** Hardware cacheline aligned\n"); | 402 | printf("** Hardware cacheline aligned\n"); |
diff --git a/MAINTAINERS b/MAINTAINERS index e65e96a14bec..ab483778a7fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -664,7 +664,7 @@ S: Maintained | |||
664 | AUDIT SUBSYSTEM | 664 | AUDIT SUBSYSTEM |
665 | P: David Woodhouse | 665 | P: David Woodhouse |
666 | M: dwmw2@infradead.org | 666 | M: dwmw2@infradead.org |
667 | L: linux-audit@redhat.com | 667 | L: linux-audit@redhat.com (subscribers-only) |
668 | W: http://people.redhat.com/sgrubb/audit/ | 668 | W: http://people.redhat.com/sgrubb/audit/ |
669 | T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git | 669 | T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git |
670 | S: Maintained | 670 | S: Maintained |
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 1d3c1398c428..52c91ccc1648 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c | |||
@@ -271,6 +271,19 @@ titan_dispatch_irqs(u64 mask) | |||
271 | * Titan Family | 271 | * Titan Family |
272 | */ | 272 | */ |
273 | static void __init | 273 | static void __init |
274 | titan_request_irq(unsigned int irq, irq_handler_t handler, | ||
275 | unsigned long irqflags, const char *devname, | ||
276 | void *dev_id) | ||
277 | { | ||
278 | int err; | ||
279 | err = request_irq(irq, handler, irqflags, devname, dev_id); | ||
280 | if (err) { | ||
281 | printk("titan_request_irq for IRQ %d returned %d; ignoring\n", | ||
282 | irq, err); | ||
283 | } | ||
284 | } | ||
285 | |||
286 | static void __init | ||
274 | titan_late_init(void) | 287 | titan_late_init(void) |
275 | { | 288 | { |
276 | /* | 289 | /* |
@@ -278,15 +291,15 @@ titan_late_init(void) | |||
278 | * all reported to the kernel as machine checks, so the handler | 291 | * all reported to the kernel as machine checks, so the handler |
279 | * is a nop so it can be called to count the individual events. | 292 | * is a nop so it can be called to count the individual events. |
280 | */ | 293 | */ |
281 | request_irq(63+16, titan_intr_nop, IRQF_DISABLED, | 294 | titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED, |
282 | "CChip Error", NULL); | 295 | "CChip Error", NULL); |
283 | request_irq(62+16, titan_intr_nop, IRQF_DISABLED, | 296 | titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED, |
284 | "PChip 0 H_Error", NULL); | 297 | "PChip 0 H_Error", NULL); |
285 | request_irq(61+16, titan_intr_nop, IRQF_DISABLED, | 298 | titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED, |
286 | "PChip 1 H_Error", NULL); | 299 | "PChip 1 H_Error", NULL); |
287 | request_irq(60+16, titan_intr_nop, IRQF_DISABLED, | 300 | titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED, |
288 | "PChip 0 C_Error", NULL); | 301 | "PChip 0 C_Error", NULL); |
289 | request_irq(59+16, titan_intr_nop, IRQF_DISABLED, | 302 | titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED, |
290 | "PChip 1 C_Error", NULL); | 303 | "PChip 1 C_Error", NULL); |
291 | 304 | ||
292 | /* | 305 | /* |
@@ -345,9 +358,9 @@ privateer_init_pci(void) | |||
345 | * Hook a couple of extra err interrupts that the | 358 | * Hook a couple of extra err interrupts that the |
346 | * common titan code won't. | 359 | * common titan code won't. |
347 | */ | 360 | */ |
348 | request_irq(53+16, titan_intr_nop, IRQF_DISABLED, | 361 | titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED, |
349 | "NMI", NULL); | 362 | "NMI", NULL); |
350 | request_irq(50+16, titan_intr_nop, IRQF_DISABLED, | 363 | titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED, |
351 | "Temperature Warning", NULL); | 364 | "Temperature Warning", NULL); |
352 | 365 | ||
353 | /* | 366 | /* |
diff --git a/arch/blackfin/kernel/init_task.c b/arch/blackfin/kernel/init_task.c index b45188f8512e..673c860ffc23 100644 --- a/arch/blackfin/kernel/init_task.c +++ b/arch/blackfin/kernel/init_task.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/init_task.h> | 32 | #include <linux/init_task.h> |
33 | #include <linux/mqueue.h> | 33 | #include <linux/mqueue.h> |
34 | #include <linux/fs.h> | ||
34 | 35 | ||
35 | static struct fs_struct init_fs = INIT_FS; | 36 | static struct fs_struct init_fs = INIT_FS; |
36 | static struct files_struct init_files = INIT_FILES; | 37 | static struct files_struct init_files = INIT_FILES; |
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 5a51dd6ab280..6a7aefe48346 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <linux/user.h> | 33 | #include <linux/user.h> |
34 | #include <linux/a.out.h> | 34 | #include <linux/a.out.h> |
35 | #include <linux/uaccess.h> | 35 | #include <linux/uaccess.h> |
36 | #include <linux/fs.h> | ||
37 | #include <linux/err.h> | ||
36 | 38 | ||
37 | #include <asm/blackfin.h> | 39 | #include <asm/blackfin.h> |
38 | #include <asm/fixed_code.h> | 40 | #include <asm/fixed_code.h> |
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c index f5e1ae3d1705..abcd14817d0e 100644 --- a/arch/blackfin/kernel/sys_bfin.c +++ b/arch/blackfin/kernel/sys_bfin.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/syscalls.h> | 37 | #include <linux/syscalls.h> |
38 | #include <linux/mman.h> | 38 | #include <linux/mman.h> |
39 | #include <linux/file.h> | 39 | #include <linux/file.h> |
40 | #include <linux/fs.h> | ||
40 | #include <linux/uaccess.h> | 41 | #include <linux/uaccess.h> |
41 | #include <linux/ipc.h> | 42 | #include <linux/ipc.h> |
42 | #include <linux/unistd.h> | 43 | #include <linux/unistd.h> |
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 8766bd612b47..792a8416fe10 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/kallsyms.h> | 33 | #include <linux/kallsyms.h> |
34 | #include <linux/fs.h> | ||
34 | #include <asm/traps.h> | 35 | #include <asm/traps.h> |
35 | #include <asm/cacheflush.h> | 36 | #include <asm/cacheflush.h> |
36 | #include <asm/blackfin.h> | 37 | #include <asm/blackfin.h> |
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 4b41248b61ad..6b4d026a00a1 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -180,8 +180,6 @@ source "drivers/isdn/Kconfig" | |||
180 | 180 | ||
181 | source "drivers/telephony/Kconfig" | 181 | source "drivers/telephony/Kconfig" |
182 | 182 | ||
183 | source "drivers/cdrom/Kconfig" | ||
184 | |||
185 | # | 183 | # |
186 | # input before char - char/joystick depends on it. As does USB. | 184 | # input before char - char/joystick depends on it. As does USB. |
187 | # | 185 | # |
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index 275673c192aa..1e74f3c5cee2 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -1496,6 +1496,7 @@ sys_call_table: | |||
1496 | .long sys_signalfd | 1496 | .long sys_signalfd |
1497 | .long sys_timerfd | 1497 | .long sys_timerfd |
1498 | .long sys_eventfd | 1498 | .long sys_eventfd |
1499 | .long sys_fallocate | ||
1499 | 1500 | ||
1500 | 1501 | ||
1501 | syscall_table_size = (. - sys_call_table) | 1502 | syscall_table_size = (. - sys_call_table) |
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c index c85598acb8fd..1b66d5c70eaf 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/i386/kernel/alternative.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <asm/mce.h> | 11 | #include <asm/mce.h> |
12 | #include <asm/nmi.h> | 12 | #include <asm/nmi.h> |
13 | 13 | ||
14 | #define MAX_PATCH_LEN (255-1) | ||
15 | |||
14 | #ifdef CONFIG_HOTPLUG_CPU | 16 | #ifdef CONFIG_HOTPLUG_CPU |
15 | static int smp_alt_once; | 17 | static int smp_alt_once; |
16 | 18 | ||
@@ -148,7 +150,8 @@ static unsigned char** find_nop_table(void) | |||
148 | 150 | ||
149 | #endif /* CONFIG_X86_64 */ | 151 | #endif /* CONFIG_X86_64 */ |
150 | 152 | ||
151 | static void nop_out(void *insns, unsigned int len) | 153 | /* Use this to add nops to a buffer, then text_poke the whole buffer. */ |
154 | static void add_nops(void *insns, unsigned int len) | ||
152 | { | 155 | { |
153 | unsigned char **noptable = find_nop_table(); | 156 | unsigned char **noptable = find_nop_table(); |
154 | 157 | ||
@@ -156,7 +159,7 @@ static void nop_out(void *insns, unsigned int len) | |||
156 | unsigned int noplen = len; | 159 | unsigned int noplen = len; |
157 | if (noplen > ASM_NOP_MAX) | 160 | if (noplen > ASM_NOP_MAX) |
158 | noplen = ASM_NOP_MAX; | 161 | noplen = ASM_NOP_MAX; |
159 | text_poke(insns, noptable[noplen], noplen); | 162 | memcpy(insns, noptable[noplen], noplen); |
160 | insns += noplen; | 163 | insns += noplen; |
161 | len -= noplen; | 164 | len -= noplen; |
162 | } | 165 | } |
@@ -174,15 +177,15 @@ extern u8 *__smp_locks[], *__smp_locks_end[]; | |||
174 | void apply_alternatives(struct alt_instr *start, struct alt_instr *end) | 177 | void apply_alternatives(struct alt_instr *start, struct alt_instr *end) |
175 | { | 178 | { |
176 | struct alt_instr *a; | 179 | struct alt_instr *a; |
177 | u8 *instr; | 180 | char insnbuf[MAX_PATCH_LEN]; |
178 | int diff; | ||
179 | 181 | ||
180 | DPRINTK("%s: alt table %p -> %p\n", __FUNCTION__, start, end); | 182 | DPRINTK("%s: alt table %p -> %p\n", __FUNCTION__, start, end); |
181 | for (a = start; a < end; a++) { | 183 | for (a = start; a < end; a++) { |
184 | u8 *instr = a->instr; | ||
182 | BUG_ON(a->replacementlen > a->instrlen); | 185 | BUG_ON(a->replacementlen > a->instrlen); |
186 | BUG_ON(a->instrlen > sizeof(insnbuf)); | ||
183 | if (!boot_cpu_has(a->cpuid)) | 187 | if (!boot_cpu_has(a->cpuid)) |
184 | continue; | 188 | continue; |
185 | instr = a->instr; | ||
186 | #ifdef CONFIG_X86_64 | 189 | #ifdef CONFIG_X86_64 |
187 | /* vsyscall code is not mapped yet. resolve it manually. */ | 190 | /* vsyscall code is not mapped yet. resolve it manually. */ |
188 | if (instr >= (u8 *)VSYSCALL_START && instr < (u8*)VSYSCALL_END) { | 191 | if (instr >= (u8 *)VSYSCALL_START && instr < (u8*)VSYSCALL_END) { |
@@ -191,9 +194,10 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end) | |||
191 | __FUNCTION__, a->instr, instr); | 194 | __FUNCTION__, a->instr, instr); |
192 | } | 195 | } |
193 | #endif | 196 | #endif |
194 | memcpy(instr, a->replacement, a->replacementlen); | 197 | memcpy(insnbuf, a->replacement, a->replacementlen); |
195 | diff = a->instrlen - a->replacementlen; | 198 | add_nops(insnbuf + a->replacementlen, |
196 | nop_out(instr + a->replacementlen, diff); | 199 | a->instrlen - a->replacementlen); |
200 | text_poke(instr, insnbuf, a->instrlen); | ||
197 | } | 201 | } |
198 | } | 202 | } |
199 | 203 | ||
@@ -215,16 +219,18 @@ static void alternatives_smp_lock(u8 **start, u8 **end, u8 *text, u8 *text_end) | |||
215 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) | 219 | static void alternatives_smp_unlock(u8 **start, u8 **end, u8 *text, u8 *text_end) |
216 | { | 220 | { |
217 | u8 **ptr; | 221 | u8 **ptr; |
222 | char insn[1]; | ||
218 | 223 | ||
219 | if (noreplace_smp) | 224 | if (noreplace_smp) |
220 | return; | 225 | return; |
221 | 226 | ||
227 | add_nops(insn, 1); | ||
222 | for (ptr = start; ptr < end; ptr++) { | 228 | for (ptr = start; ptr < end; ptr++) { |
223 | if (*ptr < text) | 229 | if (*ptr < text) |
224 | continue; | 230 | continue; |
225 | if (*ptr > text_end) | 231 | if (*ptr > text_end) |
226 | continue; | 232 | continue; |
227 | nop_out(*ptr, 1); | 233 | text_poke(*ptr, insn, 1); |
228 | }; | 234 | }; |
229 | } | 235 | } |
230 | 236 | ||
@@ -351,6 +357,7 @@ void apply_paravirt(struct paravirt_patch_site *start, | |||
351 | struct paravirt_patch_site *end) | 357 | struct paravirt_patch_site *end) |
352 | { | 358 | { |
353 | struct paravirt_patch_site *p; | 359 | struct paravirt_patch_site *p; |
360 | char insnbuf[MAX_PATCH_LEN]; | ||
354 | 361 | ||
355 | if (noreplace_paravirt) | 362 | if (noreplace_paravirt) |
356 | return; | 363 | return; |
@@ -358,13 +365,15 @@ void apply_paravirt(struct paravirt_patch_site *start, | |||
358 | for (p = start; p < end; p++) { | 365 | for (p = start; p < end; p++) { |
359 | unsigned int used; | 366 | unsigned int used; |
360 | 367 | ||
361 | used = paravirt_ops.patch(p->instrtype, p->clobbers, p->instr, | 368 | BUG_ON(p->len > MAX_PATCH_LEN); |
362 | p->len); | 369 | used = paravirt_ops.patch(p->instrtype, p->clobbers, insnbuf, |
370 | (unsigned long)p->instr, p->len); | ||
363 | 371 | ||
364 | BUG_ON(used > p->len); | 372 | BUG_ON(used > p->len); |
365 | 373 | ||
366 | /* Pad the rest with nops */ | 374 | /* Pad the rest with nops */ |
367 | nop_out(p->instr + used, p->len - used); | 375 | add_nops(insnbuf + used, p->len - used); |
376 | text_poke(p->instr, insnbuf, p->len); | ||
368 | } | 377 | } |
369 | } | 378 | } |
370 | extern struct paravirt_patch_site __start_parainstructions[], | 379 | extern struct paravirt_patch_site __start_parainstructions[], |
@@ -379,7 +388,7 @@ void __init alternative_instructions(void) | |||
379 | that might execute the to be patched code. | 388 | that might execute the to be patched code. |
380 | Other CPUs are not running. */ | 389 | Other CPUs are not running. */ |
381 | stop_nmi(); | 390 | stop_nmi(); |
382 | #ifdef CONFIG_MCE | 391 | #ifdef CONFIG_X86_MCE |
383 | stop_mce(); | 392 | stop_mce(); |
384 | #endif | 393 | #endif |
385 | 394 | ||
@@ -417,7 +426,7 @@ void __init alternative_instructions(void) | |||
417 | local_irq_restore(flags); | 426 | local_irq_restore(flags); |
418 | 427 | ||
419 | restart_nmi(); | 428 | restart_nmi(); |
420 | #ifdef CONFIG_MCE | 429 | #ifdef CONFIG_X86_MCE |
421 | restart_mce(); | 430 | restart_mce(); |
422 | #endif | 431 | #endif |
423 | } | 432 | } |
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index bfc6cb7df7e7..f9fff29e01a9 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -61,8 +61,9 @@ static int enable_local_apic __initdata = 0; | |||
61 | 61 | ||
62 | /* Local APIC timer verification ok */ | 62 | /* Local APIC timer verification ok */ |
63 | static int local_apic_timer_verify_ok; | 63 | static int local_apic_timer_verify_ok; |
64 | /* Disable local APIC timer from the kernel commandline or via dmi quirk */ | 64 | /* Disable local APIC timer from the kernel commandline or via dmi quirk |
65 | static int local_apic_timer_disabled; | 65 | or using CPU MSR check */ |
66 | int local_apic_timer_disabled; | ||
66 | /* Local APIC timer works in C2 */ | 67 | /* Local APIC timer works in C2 */ |
67 | int local_apic_timer_c2_ok; | 68 | int local_apic_timer_c2_ok; |
68 | EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok); | 69 | EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok); |
@@ -370,12 +371,9 @@ void __init setup_boot_APIC_clock(void) | |||
370 | long delta, deltapm; | 371 | long delta, deltapm; |
371 | int pm_referenced = 0; | 372 | int pm_referenced = 0; |
372 | 373 | ||
373 | if (boot_cpu_has(X86_FEATURE_LAPIC_TIMER_BROKEN)) | ||
374 | local_apic_timer_disabled = 1; | ||
375 | |||
376 | /* | 374 | /* |
377 | * The local apic timer can be disabled via the kernel | 375 | * The local apic timer can be disabled via the kernel |
378 | * commandline or from the test above. Register the lapic | 376 | * commandline or from the CPU detection code. Register the lapic |
379 | * timer as a dummy clock event source on SMP systems, so the | 377 | * timer as a dummy clock event source on SMP systems, so the |
380 | * broadcast mechanism is used. On UP systems simply ignore it. | 378 | * broadcast mechanism is used. On UP systems simply ignore it. |
381 | */ | 379 | */ |
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index c7ba455d5ac7..dcf6bbb1c7c0 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/mm.h> | 3 | #include <linux/mm.h> |
4 | #include <asm/io.h> | 4 | #include <asm/io.h> |
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/apic.h> | ||
6 | 7 | ||
7 | #include "cpu.h" | 8 | #include "cpu.h" |
8 | 9 | ||
@@ -22,6 +23,7 @@ | |||
22 | extern void vide(void); | 23 | extern void vide(void); |
23 | __asm__(".align 4\nvide: ret"); | 24 | __asm__(".align 4\nvide: ret"); |
24 | 25 | ||
26 | #ifdef CONFIG_X86_LOCAL_APIC | ||
25 | #define ENABLE_C1E_MASK 0x18000000 | 27 | #define ENABLE_C1E_MASK 0x18000000 |
26 | #define CPUID_PROCESSOR_SIGNATURE 1 | 28 | #define CPUID_PROCESSOR_SIGNATURE 1 |
27 | #define CPUID_XFAM 0x0ff00000 | 29 | #define CPUID_XFAM 0x0ff00000 |
@@ -52,6 +54,7 @@ static __cpuinit int amd_apic_timer_broken(void) | |||
52 | } | 54 | } |
53 | return 0; | 55 | return 0; |
54 | } | 56 | } |
57 | #endif | ||
55 | 58 | ||
56 | int force_mwait __cpuinitdata; | 59 | int force_mwait __cpuinitdata; |
57 | 60 | ||
@@ -282,8 +285,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
282 | num_cache_leaves = 3; | 285 | num_cache_leaves = 3; |
283 | } | 286 | } |
284 | 287 | ||
288 | #ifdef CONFIG_X86_LOCAL_APIC | ||
285 | if (amd_apic_timer_broken()) | 289 | if (amd_apic_timer_broken()) |
286 | set_bit(X86_FEATURE_LAPIC_TIMER_BROKEN, c->x86_capability); | 290 | local_apic_timer_disabled = 1; |
291 | #endif | ||
287 | 292 | ||
288 | if (c->x86 == 0x10 && !force_mwait) | 293 | if (c->x86 == 0x10 && !force_mwait) |
289 | clear_bit(X86_FEATURE_MWAIT, c->x86_capability); | 294 | clear_bit(X86_FEATURE_MWAIT, c->x86_capability); |
diff --git a/arch/i386/kernel/doublefault.c b/arch/i386/kernel/doublefault.c index 265c5597efb0..40978af630e7 100644 --- a/arch/i386/kernel/doublefault.c +++ b/arch/i386/kernel/doublefault.c | |||
@@ -13,7 +13,7 @@ | |||
13 | static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE]; | 13 | static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE]; |
14 | #define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE) | 14 | #define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE) |
15 | 15 | ||
16 | #define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + 0x1000000) | 16 | #define ptr_ok(x) ((x) > PAGE_OFFSET && (x) < PAGE_OFFSET + MAXMEM) |
17 | 17 | ||
18 | static void doublefault_fn(void) | 18 | static void doublefault_fn(void) |
19 | { | 19 | { |
@@ -23,23 +23,23 @@ static void doublefault_fn(void) | |||
23 | store_gdt(&gdt_desc); | 23 | store_gdt(&gdt_desc); |
24 | gdt = gdt_desc.address; | 24 | gdt = gdt_desc.address; |
25 | 25 | ||
26 | printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size); | 26 | printk(KERN_EMERG "PANIC: double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size); |
27 | 27 | ||
28 | if (ptr_ok(gdt)) { | 28 | if (ptr_ok(gdt)) { |
29 | gdt += GDT_ENTRY_TSS << 3; | 29 | gdt += GDT_ENTRY_TSS << 3; |
30 | tss = *(u16 *)(gdt+2); | 30 | tss = *(u16 *)(gdt+2); |
31 | tss += *(u8 *)(gdt+4) << 16; | 31 | tss += *(u8 *)(gdt+4) << 16; |
32 | tss += *(u8 *)(gdt+7) << 24; | 32 | tss += *(u8 *)(gdt+7) << 24; |
33 | printk("double fault, tss at %08lx\n", tss); | 33 | printk(KERN_EMERG "double fault, tss at %08lx\n", tss); |
34 | 34 | ||
35 | if (ptr_ok(tss)) { | 35 | if (ptr_ok(tss)) { |
36 | struct i386_hw_tss *t = (struct i386_hw_tss *)tss; | 36 | struct i386_hw_tss *t = (struct i386_hw_tss *)tss; |
37 | 37 | ||
38 | printk("eip = %08lx, esp = %08lx\n", t->eip, t->esp); | 38 | printk(KERN_EMERG "eip = %08lx, esp = %08lx\n", t->eip, t->esp); |
39 | 39 | ||
40 | printk("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n", | 40 | printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n", |
41 | t->eax, t->ebx, t->ecx, t->edx); | 41 | t->eax, t->ebx, t->ecx, t->edx); |
42 | printk("esi = %08lx, edi = %08lx\n", | 42 | printk(KERN_EMERG "esi = %08lx, edi = %08lx\n", |
43 | t->esi, t->edi); | 43 | t->esi, t->edi); |
44 | } | 44 | } |
45 | } | 45 | } |
@@ -63,6 +63,7 @@ struct tss_struct doublefault_tss __cacheline_aligned = { | |||
63 | .cs = __KERNEL_CS, | 63 | .cs = __KERNEL_CS, |
64 | .ss = __KERNEL_DS, | 64 | .ss = __KERNEL_DS, |
65 | .ds = __USER_DS, | 65 | .ds = __USER_DS, |
66 | .fs = __KERNEL_PERCPU, | ||
66 | 67 | ||
67 | .__cr3 = __pa(swapper_pg_dir) | 68 | .__cr3 = __pa(swapper_pg_dir) |
68 | } | 69 | } |
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index 7c52b222207e..8f0382161c91 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S | |||
@@ -162,9 +162,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20); | |||
162 | * which will be freed later | 162 | * which will be freed later |
163 | */ | 163 | */ |
164 | 164 | ||
165 | #ifdef CONFIG_HOTPLUG_CPU | 165 | #ifndef CONFIG_HOTPLUG_CPU |
166 | .section .text,"ax",@progbits | ||
167 | #else | ||
168 | .section .init.text,"ax",@progbits | 166 | .section .init.text,"ax",@progbits |
169 | #endif | 167 | #endif |
170 | 168 | ||
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c index ea962c0667d5..739cfb207dd7 100644 --- a/arch/i386/kernel/paravirt.c +++ b/arch/i386/kernel/paravirt.c | |||
@@ -69,7 +69,8 @@ DEF_NATIVE(read_tsc, "rdtsc"); | |||
69 | 69 | ||
70 | DEF_NATIVE(ud2a, "ud2a"); | 70 | DEF_NATIVE(ud2a, "ud2a"); |
71 | 71 | ||
72 | static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len) | 72 | static unsigned native_patch(u8 type, u16 clobbers, void *ibuf, |
73 | unsigned long addr, unsigned len) | ||
73 | { | 74 | { |
74 | const unsigned char *start, *end; | 75 | const unsigned char *start, *end; |
75 | unsigned ret; | 76 | unsigned ret; |
@@ -90,7 +91,7 @@ static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len) | |||
90 | #undef SITE | 91 | #undef SITE |
91 | 92 | ||
92 | patch_site: | 93 | patch_site: |
93 | ret = paravirt_patch_insns(insns, len, start, end); | 94 | ret = paravirt_patch_insns(ibuf, len, start, end); |
94 | break; | 95 | break; |
95 | 96 | ||
96 | case PARAVIRT_PATCH(make_pgd): | 97 | case PARAVIRT_PATCH(make_pgd): |
@@ -107,7 +108,7 @@ static unsigned native_patch(u8 type, u16 clobbers, void *insns, unsigned len) | |||
107 | break; | 108 | break; |
108 | 109 | ||
109 | default: | 110 | default: |
110 | ret = paravirt_patch_default(type, clobbers, insns, len); | 111 | ret = paravirt_patch_default(type, clobbers, ibuf, addr, len); |
111 | break; | 112 | break; |
112 | } | 113 | } |
113 | 114 | ||
@@ -129,68 +130,67 @@ struct branch { | |||
129 | u32 delta; | 130 | u32 delta; |
130 | } __attribute__((packed)); | 131 | } __attribute__((packed)); |
131 | 132 | ||
132 | unsigned paravirt_patch_call(void *target, u16 tgt_clobbers, | 133 | unsigned paravirt_patch_call(void *insnbuf, |
133 | void *site, u16 site_clobbers, | 134 | const void *target, u16 tgt_clobbers, |
135 | unsigned long addr, u16 site_clobbers, | ||
134 | unsigned len) | 136 | unsigned len) |
135 | { | 137 | { |
136 | unsigned char *call = site; | 138 | struct branch *b = insnbuf; |
137 | unsigned long delta = (unsigned long)target - (unsigned long)(call+5); | 139 | unsigned long delta = (unsigned long)target - (addr+5); |
138 | struct branch b; | ||
139 | 140 | ||
140 | if (tgt_clobbers & ~site_clobbers) | 141 | if (tgt_clobbers & ~site_clobbers) |
141 | return len; /* target would clobber too much for this site */ | 142 | return len; /* target would clobber too much for this site */ |
142 | if (len < 5) | 143 | if (len < 5) |
143 | return len; /* call too long for patch site */ | 144 | return len; /* call too long for patch site */ |
144 | 145 | ||
145 | b.opcode = 0xe8; /* call */ | 146 | b->opcode = 0xe8; /* call */ |
146 | b.delta = delta; | 147 | b->delta = delta; |
147 | BUILD_BUG_ON(sizeof(b) != 5); | 148 | BUILD_BUG_ON(sizeof(*b) != 5); |
148 | text_poke(call, (unsigned char *)&b, 5); | ||
149 | 149 | ||
150 | return 5; | 150 | return 5; |
151 | } | 151 | } |
152 | 152 | ||
153 | unsigned paravirt_patch_jmp(void *target, void *site, unsigned len) | 153 | unsigned paravirt_patch_jmp(const void *target, void *insnbuf, |
154 | unsigned long addr, unsigned len) | ||
154 | { | 155 | { |
155 | unsigned char *jmp = site; | 156 | struct branch *b = insnbuf; |
156 | unsigned long delta = (unsigned long)target - (unsigned long)(jmp+5); | 157 | unsigned long delta = (unsigned long)target - (addr+5); |
157 | struct branch b; | ||
158 | 158 | ||
159 | if (len < 5) | 159 | if (len < 5) |
160 | return len; /* call too long for patch site */ | 160 | return len; /* call too long for patch site */ |
161 | 161 | ||
162 | b.opcode = 0xe9; /* jmp */ | 162 | b->opcode = 0xe9; /* jmp */ |
163 | b.delta = delta; | 163 | b->delta = delta; |
164 | text_poke(jmp, (unsigned char *)&b, 5); | ||
165 | 164 | ||
166 | return 5; | 165 | return 5; |
167 | } | 166 | } |
168 | 167 | ||
169 | unsigned paravirt_patch_default(u8 type, u16 clobbers, void *site, unsigned len) | 168 | unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf, |
169 | unsigned long addr, unsigned len) | ||
170 | { | 170 | { |
171 | void *opfunc = *((void **)¶virt_ops + type); | 171 | void *opfunc = *((void **)¶virt_ops + type); |
172 | unsigned ret; | 172 | unsigned ret; |
173 | 173 | ||
174 | if (opfunc == NULL) | 174 | if (opfunc == NULL) |
175 | /* If there's no function, patch it with a ud2a (BUG) */ | 175 | /* If there's no function, patch it with a ud2a (BUG) */ |
176 | ret = paravirt_patch_insns(site, len, start_ud2a, end_ud2a); | 176 | ret = paravirt_patch_insns(insnbuf, len, start_ud2a, end_ud2a); |
177 | else if (opfunc == paravirt_nop) | 177 | else if (opfunc == paravirt_nop) |
178 | /* If the operation is a nop, then nop the callsite */ | 178 | /* If the operation is a nop, then nop the callsite */ |
179 | ret = paravirt_patch_nop(); | 179 | ret = paravirt_patch_nop(); |
180 | else if (type == PARAVIRT_PATCH(iret) || | 180 | else if (type == PARAVIRT_PATCH(iret) || |
181 | type == PARAVIRT_PATCH(irq_enable_sysexit)) | 181 | type == PARAVIRT_PATCH(irq_enable_sysexit)) |
182 | /* If operation requires a jmp, then jmp */ | 182 | /* If operation requires a jmp, then jmp */ |
183 | ret = paravirt_patch_jmp(opfunc, site, len); | 183 | ret = paravirt_patch_jmp(opfunc, insnbuf, addr, len); |
184 | else | 184 | else |
185 | /* Otherwise call the function; assume target could | 185 | /* Otherwise call the function; assume target could |
186 | clobber any caller-save reg */ | 186 | clobber any caller-save reg */ |
187 | ret = paravirt_patch_call(opfunc, CLBR_ANY, | 187 | ret = paravirt_patch_call(insnbuf, opfunc, CLBR_ANY, |
188 | site, clobbers, len); | 188 | addr, clobbers, len); |
189 | 189 | ||
190 | return ret; | 190 | return ret; |
191 | } | 191 | } |
192 | 192 | ||
193 | unsigned paravirt_patch_insns(void *site, unsigned len, | 193 | unsigned paravirt_patch_insns(void *insnbuf, unsigned len, |
194 | const char *start, const char *end) | 194 | const char *start, const char *end) |
195 | { | 195 | { |
196 | unsigned insn_len = end - start; | 196 | unsigned insn_len = end - start; |
@@ -198,7 +198,7 @@ unsigned paravirt_patch_insns(void *site, unsigned len, | |||
198 | if (insn_len > len || start == NULL) | 198 | if (insn_len > len || start == NULL) |
199 | insn_len = len; | 199 | insn_len = len; |
200 | else | 200 | else |
201 | memcpy(site, start, insn_len); | 201 | memcpy(insnbuf, start, insn_len); |
202 | 202 | ||
203 | return insn_len; | 203 | return insn_len; |
204 | } | 204 | } |
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c index 72042bb7ec94..18673e0f193b 100644 --- a/arch/i386/kernel/vmi.c +++ b/arch/i386/kernel/vmi.c | |||
@@ -87,12 +87,14 @@ struct vmi_timer_ops vmi_timer_ops; | |||
87 | #define IRQ_PATCH_INT_MASK 0 | 87 | #define IRQ_PATCH_INT_MASK 0 |
88 | #define IRQ_PATCH_DISABLE 5 | 88 | #define IRQ_PATCH_DISABLE 5 |
89 | 89 | ||
90 | static inline void patch_offset(unsigned char *eip, unsigned char *dest) | 90 | static inline void patch_offset(void *insnbuf, |
91 | unsigned long eip, unsigned long dest) | ||
91 | { | 92 | { |
92 | *(unsigned long *)(eip+1) = dest-eip-5; | 93 | *(unsigned long *)(insnbuf+1) = dest-eip-5; |
93 | } | 94 | } |
94 | 95 | ||
95 | static unsigned patch_internal(int call, unsigned len, void *insns) | 96 | static unsigned patch_internal(int call, unsigned len, void *insnbuf, |
97 | unsigned long eip) | ||
96 | { | 98 | { |
97 | u64 reloc; | 99 | u64 reloc; |
98 | struct vmi_relocation_info *const rel = (struct vmi_relocation_info *)&reloc; | 100 | struct vmi_relocation_info *const rel = (struct vmi_relocation_info *)&reloc; |
@@ -100,14 +102,14 @@ static unsigned patch_internal(int call, unsigned len, void *insns) | |||
100 | switch(rel->type) { | 102 | switch(rel->type) { |
101 | case VMI_RELOCATION_CALL_REL: | 103 | case VMI_RELOCATION_CALL_REL: |
102 | BUG_ON(len < 5); | 104 | BUG_ON(len < 5); |
103 | *(char *)insns = MNEM_CALL; | 105 | *(char *)insnbuf = MNEM_CALL; |
104 | patch_offset(insns, rel->eip); | 106 | patch_offset(insnbuf, eip, (unsigned long)rel->eip); |
105 | return 5; | 107 | return 5; |
106 | 108 | ||
107 | case VMI_RELOCATION_JUMP_REL: | 109 | case VMI_RELOCATION_JUMP_REL: |
108 | BUG_ON(len < 5); | 110 | BUG_ON(len < 5); |
109 | *(char *)insns = MNEM_JMP; | 111 | *(char *)insnbuf = MNEM_JMP; |
110 | patch_offset(insns, rel->eip); | 112 | patch_offset(insnbuf, eip, (unsigned long)rel->eip); |
111 | return 5; | 113 | return 5; |
112 | 114 | ||
113 | case VMI_RELOCATION_NOP: | 115 | case VMI_RELOCATION_NOP: |
@@ -128,21 +130,26 @@ static unsigned patch_internal(int call, unsigned len, void *insns) | |||
128 | * Apply patch if appropriate, return length of new instruction | 130 | * Apply patch if appropriate, return length of new instruction |
129 | * sequence. The callee does nop padding for us. | 131 | * sequence. The callee does nop padding for us. |
130 | */ | 132 | */ |
131 | static unsigned vmi_patch(u8 type, u16 clobbers, void *insns, unsigned len) | 133 | static unsigned vmi_patch(u8 type, u16 clobbers, void *insns, |
134 | unsigned long eip, unsigned len) | ||
132 | { | 135 | { |
133 | switch (type) { | 136 | switch (type) { |
134 | case PARAVIRT_PATCH(irq_disable): | 137 | case PARAVIRT_PATCH(irq_disable): |
135 | return patch_internal(VMI_CALL_DisableInterrupts, len, insns); | 138 | return patch_internal(VMI_CALL_DisableInterrupts, len, |
139 | insns, eip); | ||
136 | case PARAVIRT_PATCH(irq_enable): | 140 | case PARAVIRT_PATCH(irq_enable): |
137 | return patch_internal(VMI_CALL_EnableInterrupts, len, insns); | 141 | return patch_internal(VMI_CALL_EnableInterrupts, len, |
142 | insns, eip); | ||
138 | case PARAVIRT_PATCH(restore_fl): | 143 | case PARAVIRT_PATCH(restore_fl): |
139 | return patch_internal(VMI_CALL_SetInterruptMask, len, insns); | 144 | return patch_internal(VMI_CALL_SetInterruptMask, len, |
145 | insns, eip); | ||
140 | case PARAVIRT_PATCH(save_fl): | 146 | case PARAVIRT_PATCH(save_fl): |
141 | return patch_internal(VMI_CALL_GetInterruptMask, len, insns); | 147 | return patch_internal(VMI_CALL_GetInterruptMask, len, |
148 | insns, eip); | ||
142 | case PARAVIRT_PATCH(iret): | 149 | case PARAVIRT_PATCH(iret): |
143 | return patch_internal(VMI_CALL_IRET, len, insns); | 150 | return patch_internal(VMI_CALL_IRET, len, insns, eip); |
144 | case PARAVIRT_PATCH(irq_enable_sysexit): | 151 | case PARAVIRT_PATCH(irq_enable_sysexit): |
145 | return patch_internal(VMI_CALL_SYSEXIT, len, insns); | 152 | return patch_internal(VMI_CALL_SYSEXIT, len, insns, eip); |
146 | default: | 153 | default: |
147 | break; | 154 | break; |
148 | } | 155 | } |
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c index 8927222b3ab2..4241a74d16c8 100644 --- a/arch/i386/mm/pageattr.c +++ b/arch/i386/mm/pageattr.c | |||
@@ -82,7 +82,7 @@ static void flush_kernel_map(void *arg) | |||
82 | struct page *p; | 82 | struct page *p; |
83 | 83 | ||
84 | /* High level code is not ready for clflush yet */ | 84 | /* High level code is not ready for clflush yet */ |
85 | if (cpu_has_clflush) { | 85 | if (0 && cpu_has_clflush) { |
86 | list_for_each_entry (p, lh, lru) | 86 | list_for_each_entry (p, lh, lru) |
87 | cache_flush_page(p); | 87 | cache_flush_page(p); |
88 | } else if (boot_cpu_data.x86_model >= 4) | 88 | } else if (boot_cpu_data.x86_model >= 4) |
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 85503deeda46..ebc6f3c66340 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -455,3 +455,26 @@ void pcibios_disable_device (struct pci_dev *dev) | |||
455 | if (!dev->msi_enabled && pcibios_disable_irq) | 455 | if (!dev->msi_enabled && pcibios_disable_irq) |
456 | pcibios_disable_irq(dev); | 456 | pcibios_disable_irq(dev); |
457 | } | 457 | } |
458 | |||
459 | struct pci_bus *pci_scan_bus_with_sysdata(int busno) | ||
460 | { | ||
461 | struct pci_bus *bus = NULL; | ||
462 | struct pci_sysdata *sd; | ||
463 | |||
464 | /* | ||
465 | * Allocate per-root-bus (not per bus) arch-specific data. | ||
466 | * TODO: leak; this memory is never freed. | ||
467 | * It's arguable whether it's worth the trouble to care. | ||
468 | */ | ||
469 | sd = kzalloc(sizeof(*sd), GFP_KERNEL); | ||
470 | if (!sd) { | ||
471 | printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno); | ||
472 | return NULL; | ||
473 | } | ||
474 | sd->node = -1; | ||
475 | bus = pci_scan_bus(busno, &pci_root_ops, sd); | ||
476 | if (!bus) | ||
477 | kfree(sd); | ||
478 | |||
479 | return bus; | ||
480 | } | ||
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index e7306dbf6c42..c82cbf4c7226 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -25,9 +25,9 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
25 | pci_read_config_byte(d, reg++, &subb); | 25 | pci_read_config_byte(d, reg++, &subb); |
26 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 26 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); |
27 | if (busno) | 27 | if (busno) |
28 | pci_scan_bus(busno, &pci_root_ops, NULL); /* Bus A */ | 28 | pci_scan_bus_with_sysdata(busno); /* Bus A */ |
29 | if (suba < subb) | 29 | if (suba < subb) |
30 | pci_scan_bus(suba+1, &pci_root_ops, NULL); /* Bus B */ | 30 | pci_scan_bus_with_sysdata(suba+1); /* Bus B */ |
31 | } | 31 | } |
32 | pcibios_last_bus = -1; | 32 | pcibios_last_bus = -1; |
33 | } | 33 | } |
@@ -42,7 +42,7 @@ static void __devinit pci_fixup_i450gx(struct pci_dev *d) | |||
42 | u8 busno; | 42 | u8 busno; |
43 | pci_read_config_byte(d, 0x4a, &busno); | 43 | pci_read_config_byte(d, 0x4a, &busno); |
44 | printk(KERN_INFO "PCI: i440KX/GX host bridge %s: secondary bus %02x\n", pci_name(d), busno); | 44 | printk(KERN_INFO "PCI: i440KX/GX host bridge %s: secondary bus %02x\n", pci_name(d), busno); |
45 | pci_scan_bus(busno, &pci_root_ops, NULL); | 45 | pci_scan_bus_with_sysdata(busno); |
46 | pcibios_last_bus = -1; | 46 | pcibios_last_bus = -1; |
47 | } | 47 | } |
48 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); | 48 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); |
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index f2cb942f8281..665db063a40a 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -138,8 +138,9 @@ static void __init pirq_peer_trick(void) | |||
138 | for(i = 1; i < 256; i++) { | 138 | for(i = 1; i < 256; i++) { |
139 | if (!busmap[i] || pci_find_bus(0, i)) | 139 | if (!busmap[i] || pci_find_bus(0, i)) |
140 | continue; | 140 | continue; |
141 | if (pci_scan_bus(i, &pci_root_ops, NULL)) | 141 | if (pci_scan_bus_with_sysdata(i)) |
142 | printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i); | 142 | printk(KERN_INFO "PCI: Discovered primary peer " |
143 | "bus %02x [IRQ]\n", i); | ||
143 | } | 144 | } |
144 | pcibios_last_bus = -1; | 145 | pcibios_last_bus = -1; |
145 | } | 146 | } |
diff --git a/arch/i386/pci/legacy.c b/arch/i386/pci/legacy.c index 149a9588c256..5565d7016b75 100644 --- a/arch/i386/pci/legacy.c +++ b/arch/i386/pci/legacy.c | |||
@@ -26,7 +26,7 @@ static void __devinit pcibios_fixup_peer_bridges(void) | |||
26 | l != 0x0000 && l != 0xffff) { | 26 | l != 0x0000 && l != 0xffff) { |
27 | DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l); | 27 | DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l); |
28 | printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n); | 28 | printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n); |
29 | pci_scan_bus(n, &pci_root_ops, NULL); | 29 | pci_scan_bus_with_sysdata(n); |
30 | break; | 30 | break; |
31 | } | 31 | } |
32 | } | 32 | } |
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index bb1afd9e589d..0d46b7a88b3b 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
@@ -82,16 +82,15 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, | |||
82 | 82 | ||
83 | switch (len) { | 83 | switch (len) { |
84 | case 1: | 84 | case 1: |
85 | *value = readb(mmcfg_virt_addr + reg); | 85 | *value = mmio_config_readb(mmcfg_virt_addr + reg); |
86 | break; | 86 | break; |
87 | case 2: | 87 | case 2: |
88 | *value = readw(mmcfg_virt_addr + reg); | 88 | *value = mmio_config_readw(mmcfg_virt_addr + reg); |
89 | break; | 89 | break; |
90 | case 4: | 90 | case 4: |
91 | *value = readl(mmcfg_virt_addr + reg); | 91 | *value = mmio_config_readl(mmcfg_virt_addr + reg); |
92 | break; | 92 | break; |
93 | } | 93 | } |
94 | |||
95 | spin_unlock_irqrestore(&pci_config_lock, flags); | 94 | spin_unlock_irqrestore(&pci_config_lock, flags); |
96 | 95 | ||
97 | return 0; | 96 | return 0; |
@@ -116,16 +115,15 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, | |||
116 | 115 | ||
117 | switch (len) { | 116 | switch (len) { |
118 | case 1: | 117 | case 1: |
119 | writeb(value, mmcfg_virt_addr + reg); | 118 | mmio_config_writeb(mmcfg_virt_addr, value); |
120 | break; | 119 | break; |
121 | case 2: | 120 | case 2: |
122 | writew(value, mmcfg_virt_addr + reg); | 121 | mmio_config_writew(mmcfg_virt_addr, value); |
123 | break; | 122 | break; |
124 | case 4: | 123 | case 4: |
125 | writel(value, mmcfg_virt_addr + reg); | 124 | mmio_config_writel(mmcfg_virt_addr, value); |
126 | break; | 125 | break; |
127 | } | 126 | } |
128 | |||
129 | spin_unlock_irqrestore(&pci_config_lock, flags); | 127 | spin_unlock_irqrestore(&pci_config_lock, flags); |
130 | 128 | ||
131 | return 0; | 129 | return 0; |
diff --git a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c index adbe17a38f6f..f5f165f69e0c 100644 --- a/arch/i386/pci/numa.c +++ b/arch/i386/pci/numa.c | |||
@@ -96,10 +96,14 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
96 | pci_read_config_byte(d, reg++, &suba); | 96 | pci_read_config_byte(d, reg++, &suba); |
97 | pci_read_config_byte(d, reg++, &subb); | 97 | pci_read_config_byte(d, reg++, &subb); |
98 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 98 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); |
99 | if (busno) | 99 | if (busno) { |
100 | pci_scan_bus(QUADLOCAL2BUS(quad,busno), &pci_root_ops, NULL); /* Bus A */ | 100 | /* Bus A */ |
101 | if (suba < subb) | 101 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno)); |
102 | pci_scan_bus(QUADLOCAL2BUS(quad,suba+1), &pci_root_ops, NULL); /* Bus B */ | 102 | } |
103 | if (suba < subb) { | ||
104 | /* Bus B */ | ||
105 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, suba+1)); | ||
106 | } | ||
103 | } | 107 | } |
104 | pcibios_last_bus = -1; | 108 | pcibios_last_bus = -1; |
105 | } | 109 | } |
@@ -123,8 +127,7 @@ static int __init pci_numa_init(void) | |||
123 | continue; | 127 | continue; |
124 | printk("Scanning PCI bus %d for quad %d\n", | 128 | printk("Scanning PCI bus %d for quad %d\n", |
125 | QUADLOCAL2BUS(quad,0), quad); | 129 | QUADLOCAL2BUS(quad,0), quad); |
126 | pci_scan_bus(QUADLOCAL2BUS(quad,0), | 130 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, 0)); |
127 | &pci_root_ops, NULL); | ||
128 | } | 131 | } |
129 | return 0; | 132 | return 0; |
130 | } | 133 | } |
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index e58bae2076ad..8c66f275756f 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
@@ -104,3 +104,46 @@ extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS); | |||
104 | extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, | 104 | extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, |
105 | unsigned int devfn); | 105 | unsigned int devfn); |
106 | extern int __init pci_mmcfg_arch_init(void); | 106 | extern int __init pci_mmcfg_arch_init(void); |
107 | |||
108 | /* | ||
109 | * AMD Fam10h CPUs are buggy, and cannot access MMIO config space | ||
110 | * on their northbrige except through the * %eax register. As such, you MUST | ||
111 | * NOT use normal IOMEM accesses, you need to only use the magic mmio-config | ||
112 | * accessor functions. | ||
113 | * In fact just use pci_config_*, nothing else please. | ||
114 | */ | ||
115 | static inline unsigned char mmio_config_readb(void __iomem *pos) | ||
116 | { | ||
117 | u8 val; | ||
118 | asm volatile("movb (%1),%%al" : "=a" (val) : "r" (pos)); | ||
119 | return val; | ||
120 | } | ||
121 | |||
122 | static inline unsigned short mmio_config_readw(void __iomem *pos) | ||
123 | { | ||
124 | u16 val; | ||
125 | asm volatile("movw (%1),%%ax" : "=a" (val) : "r" (pos)); | ||
126 | return val; | ||
127 | } | ||
128 | |||
129 | static inline unsigned int mmio_config_readl(void __iomem *pos) | ||
130 | { | ||
131 | u32 val; | ||
132 | asm volatile("movl (%1),%%eax" : "=a" (val) : "r" (pos)); | ||
133 | return val; | ||
134 | } | ||
135 | |||
136 | static inline void mmio_config_writeb(void __iomem *pos, u8 val) | ||
137 | { | ||
138 | asm volatile("movb %%al,(%1)" :: "a" (val), "r" (pos) : "memory"); | ||
139 | } | ||
140 | |||
141 | static inline void mmio_config_writew(void __iomem *pos, u16 val) | ||
142 | { | ||
143 | asm volatile("movw %%ax,(%1)" :: "a" (val), "r" (pos) : "memory"); | ||
144 | } | ||
145 | |||
146 | static inline void mmio_config_writel(void __iomem *pos, u32 val) | ||
147 | { | ||
148 | asm volatile("movl %%eax,(%1)" :: "a" (val), "r" (pos) : "memory"); | ||
149 | } | ||
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c index f1b486d4190b..8ecb1c722594 100644 --- a/arch/i386/pci/visws.c +++ b/arch/i386/pci/visws.c | |||
@@ -101,8 +101,8 @@ static int __init pcibios_init(void) | |||
101 | "bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0); | 101 | "bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0); |
102 | 102 | ||
103 | raw_pci_ops = &pci_direct_conf1; | 103 | raw_pci_ops = &pci_direct_conf1; |
104 | pci_scan_bus(pci_bus0, &pci_root_ops, NULL); | 104 | pci_scan_bus_with_sysdata(pci_bus0); |
105 | pci_scan_bus(pci_bus1, &pci_root_ops, NULL); | 105 | pci_scan_bus_with_sysdata(pci_bus1); |
106 | pci_fixup_irqs(visws_swizzle, visws_map_irq); | 106 | pci_fixup_irqs(visws_swizzle, visws_map_irq); |
107 | pcibios_resource_survey(); | 107 | pcibios_resource_survey(); |
108 | return 0; | 108 | return 0; |
diff --git a/arch/i386/xen/enlighten.c b/arch/i386/xen/enlighten.c index 9a8c1181c001..f0c37511d8da 100644 --- a/arch/i386/xen/enlighten.c +++ b/arch/i386/xen/enlighten.c | |||
@@ -842,7 +842,8 @@ void __init xen_setup_vcpu_info_placement(void) | |||
842 | } | 842 | } |
843 | } | 843 | } |
844 | 844 | ||
845 | static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len) | 845 | static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf, |
846 | unsigned long addr, unsigned len) | ||
846 | { | 847 | { |
847 | char *start, *end, *reloc; | 848 | char *start, *end, *reloc; |
848 | unsigned ret; | 849 | unsigned ret; |
@@ -869,7 +870,7 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len) | |||
869 | if (start == NULL || (end-start) > len) | 870 | if (start == NULL || (end-start) > len) |
870 | goto default_patch; | 871 | goto default_patch; |
871 | 872 | ||
872 | ret = paravirt_patch_insns(insns, len, start, end); | 873 | ret = paravirt_patch_insns(insnbuf, len, start, end); |
873 | 874 | ||
874 | /* Note: because reloc is assigned from something that | 875 | /* Note: because reloc is assigned from something that |
875 | appears to be an array, gcc assumes it's non-null, | 876 | appears to be an array, gcc assumes it's non-null, |
@@ -877,8 +878,8 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len) | |||
877 | end. */ | 878 | end. */ |
878 | if (reloc > start && reloc < end) { | 879 | if (reloc > start && reloc < end) { |
879 | int reloc_off = reloc - start; | 880 | int reloc_off = reloc - start; |
880 | long *relocp = (long *)(insns + reloc_off); | 881 | long *relocp = (long *)(insnbuf + reloc_off); |
881 | long delta = start - (char *)insns; | 882 | long delta = start - (char *)addr; |
882 | 883 | ||
883 | *relocp += delta; | 884 | *relocp += delta; |
884 | } | 885 | } |
@@ -886,7 +887,8 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insns, unsigned len) | |||
886 | 887 | ||
887 | default_patch: | 888 | default_patch: |
888 | default: | 889 | default: |
889 | ret = paravirt_patch_default(type, clobbers, insns, len); | 890 | ret = paravirt_patch_default(type, clobbers, insnbuf, |
891 | addr, len); | ||
890 | break; | 892 | break; |
891 | } | 893 | } |
892 | 894 | ||
diff --git a/arch/x86_64/boot/compressed/head.S b/arch/x86_64/boot/compressed/head.S index 1312bfaff306..9fd8030cc54f 100644 --- a/arch/x86_64/boot/compressed/head.S +++ b/arch/x86_64/boot/compressed/head.S | |||
@@ -195,6 +195,11 @@ ENTRY(startup_64) | |||
195 | movl %eax, %ds | 195 | movl %eax, %ds |
196 | movl %eax, %es | 196 | movl %eax, %es |
197 | movl %eax, %ss | 197 | movl %eax, %ss |
198 | movl %eax, %fs | ||
199 | movl %eax, %gs | ||
200 | lldt %ax | ||
201 | movl $0x20, %eax | ||
202 | ltr %ax | ||
198 | 203 | ||
199 | /* Compute the decompressed kernel start address. It is where | 204 | /* Compute the decompressed kernel start address. It is where |
200 | * we were loaded at aligned to a 2M boundary. %rbp contains the | 205 | * we were loaded at aligned to a 2M boundary. %rbp contains the |
@@ -295,6 +300,8 @@ gdt: | |||
295 | .quad 0x0000000000000000 /* NULL descriptor */ | 300 | .quad 0x0000000000000000 /* NULL descriptor */ |
296 | .quad 0x00af9a000000ffff /* __KERNEL_CS */ | 301 | .quad 0x00af9a000000ffff /* __KERNEL_CS */ |
297 | .quad 0x00cf92000000ffff /* __KERNEL_DS */ | 302 | .quad 0x00cf92000000ffff /* __KERNEL_DS */ |
303 | .quad 0x0080890000000000 /* TS descriptor */ | ||
304 | .quad 0x0000000000000000 /* TS continued */ | ||
298 | gdt_end: | 305 | gdt_end: |
299 | .bss | 306 | .bss |
300 | /* Stack for uncompression */ | 307 | /* Stack for uncompression */ |
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c index 900ff38d68de..925758dbca0c 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86_64/kernel/apic.c | |||
@@ -791,10 +791,8 @@ static void setup_APIC_timer(unsigned int clocks) | |||
791 | 791 | ||
792 | /* wait for irq slice */ | 792 | /* wait for irq slice */ |
793 | if (hpet_address && hpet_use_timer) { | 793 | if (hpet_address && hpet_use_timer) { |
794 | int trigger = hpet_readl(HPET_T0_CMP); | 794 | u32 trigger = hpet_readl(HPET_T0_CMP); |
795 | while (hpet_readl(HPET_COUNTER) >= trigger) | 795 | while (hpet_readl(HPET_T0_CMP) == trigger) |
796 | /* do nothing */ ; | ||
797 | while (hpet_readl(HPET_COUNTER) < trigger) | ||
798 | /* do nothing */ ; | 796 | /* do nothing */ ; |
799 | } else { | 797 | } else { |
800 | int c1, c2; | 798 | int c1, c2; |
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c index ba16c968ca3f..71da01e73f03 100644 --- a/arch/x86_64/kernel/pci-calgary.c +++ b/arch/x86_64/kernel/pci-calgary.c | |||
@@ -367,16 +367,15 @@ static inline struct iommu_table *find_iommu_table(struct device *dev) | |||
367 | 367 | ||
368 | pdev = to_pci_dev(dev); | 368 | pdev = to_pci_dev(dev); |
369 | 369 | ||
370 | /* is the device behind a bridge? */ | 370 | pbus = pdev->bus; |
371 | if (unlikely(pdev->bus->parent)) | 371 | |
372 | pbus = pdev->bus->parent; | 372 | /* is the device behind a bridge? Look for the root bus */ |
373 | else | 373 | while (pbus->parent) |
374 | pbus = pdev->bus; | 374 | pbus = pbus->parent; |
375 | 375 | ||
376 | tbl = pci_iommu(pbus); | 376 | tbl = pci_iommu(pbus); |
377 | 377 | ||
378 | BUG_ON(pdev->bus->parent && | 378 | BUG_ON(tbl && (tbl->it_busno != pbus->number)); |
379 | (tbl->it_busno != pdev->bus->parent->number)); | ||
380 | 379 | ||
381 | return tbl; | 380 | return tbl; |
382 | } | 381 | } |
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c index 7e161c698af4..10b9809ce821 100644 --- a/arch/x86_64/mm/pageattr.c +++ b/arch/x86_64/mm/pageattr.c | |||
@@ -75,7 +75,8 @@ static void flush_kernel_map(void *arg) | |||
75 | 75 | ||
76 | /* When clflush is available always use it because it is | 76 | /* When clflush is available always use it because it is |
77 | much cheaper than WBINVD. */ | 77 | much cheaper than WBINVD. */ |
78 | if (!cpu_has_clflush) | 78 | /* clflush is still broken. Disable for now. */ |
79 | if (1 || !cpu_has_clflush) | ||
79 | asm volatile("wbinvd" ::: "memory"); | 80 | asm volatile("wbinvd" ::: "memory"); |
80 | else list_for_each_entry(pg, l, lru) { | 81 | else list_for_each_entry(pg, l, lru) { |
81 | void *adr = page_address(pg); | 82 | void *adr = page_address(pg); |
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index 65d82736987e..4095e4d66a1d 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c | |||
@@ -66,13 +66,13 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, | |||
66 | 66 | ||
67 | switch (len) { | 67 | switch (len) { |
68 | case 1: | 68 | case 1: |
69 | *value = readb(addr + reg); | 69 | *value = mmio_config_readb(addr + reg); |
70 | break; | 70 | break; |
71 | case 2: | 71 | case 2: |
72 | *value = readw(addr + reg); | 72 | *value = mmio_config_readw(addr + reg); |
73 | break; | 73 | break; |
74 | case 4: | 74 | case 4: |
75 | *value = readl(addr + reg); | 75 | *value = mmio_config_readl(addr + reg); |
76 | break; | 76 | break; |
77 | } | 77 | } |
78 | 78 | ||
@@ -94,13 +94,13 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, | |||
94 | 94 | ||
95 | switch (len) { | 95 | switch (len) { |
96 | case 1: | 96 | case 1: |
97 | writeb(value, addr + reg); | 97 | mmio_config_writeb(addr + reg, value); |
98 | break; | 98 | break; |
99 | case 2: | 99 | case 2: |
100 | writew(value, addr + reg); | 100 | mmio_config_writew(addr + reg, value); |
101 | break; | 101 | break; |
102 | case 4: | 102 | case 4: |
103 | writel(value, addr + reg); | 103 | mmio_config_writel(addr + reg, value); |
104 | break; | 104 | break; |
105 | } | 105 | } |
106 | 106 | ||
diff --git a/arch/x86_64/vdso/.gitignore b/arch/x86_64/vdso/.gitignore new file mode 100644 index 000000000000..f8b69d84238e --- /dev/null +++ b/arch/x86_64/vdso/.gitignore | |||
@@ -0,0 +1 @@ | |||
vdso.lds | |||
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 8c2caff87cc3..a15845c164f2 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -3047,6 +3047,10 @@ static inline void blk_partition_remap(struct bio *bio) | |||
3047 | 3047 | ||
3048 | bio->bi_sector += p->start_sect; | 3048 | bio->bi_sector += p->start_sect; |
3049 | bio->bi_bdev = bdev->bd_contains; | 3049 | bio->bi_bdev = bdev->bd_contains; |
3050 | |||
3051 | blk_add_trace_remap(bdev_get_queue(bio->bi_bdev), bio, | ||
3052 | bdev->bd_dev, bio->bi_sector, | ||
3053 | bio->bi_sector - p->start_sect); | ||
3050 | } | 3054 | } |
3051 | } | 3055 | } |
3052 | 3056 | ||
diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c index f63813a358c5..4c3fd4cdaf73 100644 --- a/drivers/acpi/resources/rsxface.c +++ b/drivers/acpi/resources/rsxface.c | |||
@@ -474,8 +474,6 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) | |||
474 | return (AE_CTRL_TERMINATE); | 474 | return (AE_CTRL_TERMINATE); |
475 | } | 475 | } |
476 | 476 | ||
477 | ACPI_EXPORT_SYMBOL(acpi_rs_match_vendor_resource) | ||
478 | |||
479 | /******************************************************************************* | 477 | /******************************************************************************* |
480 | * | 478 | * |
481 | * FUNCTION: acpi_walk_resources | 479 | * FUNCTION: acpi_walk_resources |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index a11b2bd54bbe..084358a828e9 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1977 | { | 1977 | { |
1978 | ReadCapdata_struct *buf; | 1978 | ReadCapdata_struct *buf; |
1979 | int return_code; | 1979 | int return_code; |
1980 | buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL); | 1980 | |
1981 | if (buf == NULL) { | 1981 | buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL); |
1982 | if (!buf) { | ||
1982 | printk(KERN_WARNING "cciss: out of memory\n"); | 1983 | printk(KERN_WARNING "cciss: out of memory\n"); |
1983 | return; | 1984 | return; |
1984 | } | 1985 | } |
1985 | memset(buf, 0, sizeof(ReadCapdata_struct)); | 1986 | |
1986 | if (withirq) | 1987 | if (withirq) |
1987 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY, | 1988 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY, |
1988 | ctlr, buf, sizeof(ReadCapdata_struct), | 1989 | ctlr, buf, sizeof(ReadCapdata_struct), |
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2003 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2004 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2004 | (unsigned long long)*total_size+1, *block_size); | 2005 | (unsigned long long)*total_size+1, *block_size); |
2005 | kfree(buf); | 2006 | kfree(buf); |
2006 | return; | ||
2007 | } | 2007 | } |
2008 | 2008 | ||
2009 | static void | 2009 | static void |
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2011 | { | 2011 | { |
2012 | ReadCapdata_struct_16 *buf; | 2012 | ReadCapdata_struct_16 *buf; |
2013 | int return_code; | 2013 | int return_code; |
2014 | buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL); | 2014 | |
2015 | if (buf == NULL) { | 2015 | buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL); |
2016 | if (!buf) { | ||
2016 | printk(KERN_WARNING "cciss: out of memory\n"); | 2017 | printk(KERN_WARNING "cciss: out of memory\n"); |
2017 | return; | 2018 | return; |
2018 | } | 2019 | } |
2019 | memset(buf, 0, sizeof(ReadCapdata_struct_16)); | 2020 | |
2020 | if (withirq) { | 2021 | if (withirq) { |
2021 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16, | 2022 | return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16, |
2022 | ctlr, buf, sizeof(ReadCapdata_struct_16), | 2023 | ctlr, buf, sizeof(ReadCapdata_struct_16), |
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2038 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2039 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2039 | (unsigned long long)*total_size+1, *block_size); | 2040 | (unsigned long long)*total_size+1, *block_size); |
2040 | kfree(buf); | 2041 | kfree(buf); |
2041 | return; | ||
2042 | } | 2042 | } |
2043 | 2043 | ||
2044 | static int cciss_revalidate(struct gendisk *disk) | 2044 | static int cciss_revalidate(struct gendisk *disk) |
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index be4e3477d83b..eb9799acf65b 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -420,18 +420,17 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev) | |||
420 | goto Enomem2; | 420 | goto Enomem2; |
421 | } | 421 | } |
422 | 422 | ||
423 | hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent( | 423 | hba[i]->cmd_pool = pci_alloc_consistent( |
424 | hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t), | 424 | hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t), |
425 | &(hba[i]->cmd_pool_dhandle)); | 425 | &(hba[i]->cmd_pool_dhandle)); |
426 | hba[i]->cmd_pool_bits = kmalloc( | 426 | hba[i]->cmd_pool_bits = kcalloc( |
427 | ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long), | 427 | (NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG, sizeof(unsigned long), |
428 | GFP_KERNEL); | 428 | GFP_KERNEL); |
429 | 429 | ||
430 | if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool) | 430 | if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool) |
431 | goto Enomem1; | 431 | goto Enomem1; |
432 | 432 | ||
433 | memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t)); | 433 | memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t)); |
434 | memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long)); | ||
435 | printk(KERN_INFO "cpqarray: Finding drives on %s", | 434 | printk(KERN_INFO "cpqarray: Finding drives on %s", |
436 | hba[i]->devname); | 435 | hba[i]->devname); |
437 | 436 | ||
@@ -1660,45 +1659,30 @@ static void getgeometry(int ctlr) | |||
1660 | 1659 | ||
1661 | info_p->log_drv_map = 0; | 1660 | info_p->log_drv_map = 0; |
1662 | 1661 | ||
1663 | id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL); | 1662 | id_ldrive = kzalloc(sizeof(id_log_drv_t), GFP_KERNEL); |
1664 | if(id_ldrive == NULL) | 1663 | if (!id_ldrive) { |
1665 | { | ||
1666 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1664 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1667 | return; | 1665 | goto err_0; |
1668 | } | 1666 | } |
1669 | 1667 | ||
1670 | id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); | 1668 | id_ctlr_buf = kzalloc(sizeof(id_ctlr_t), GFP_KERNEL); |
1671 | if(id_ctlr_buf == NULL) | 1669 | if (!id_ctlr_buf) { |
1672 | { | ||
1673 | kfree(id_ldrive); | ||
1674 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1670 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1675 | return; | 1671 | goto err_1; |
1676 | } | 1672 | } |
1677 | 1673 | ||
1678 | id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); | 1674 | id_lstatus_buf = kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); |
1679 | if(id_lstatus_buf == NULL) | 1675 | if (!id_lstatus_buf) { |
1680 | { | ||
1681 | kfree(id_ctlr_buf); | ||
1682 | kfree(id_ldrive); | ||
1683 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1676 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1684 | return; | 1677 | goto err_2; |
1685 | } | 1678 | } |
1686 | 1679 | ||
1687 | sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL); | 1680 | sense_config_buf = kzalloc(sizeof(config_t), GFP_KERNEL); |
1688 | if(sense_config_buf == NULL) | 1681 | if (!sense_config_buf) { |
1689 | { | ||
1690 | kfree(id_lstatus_buf); | ||
1691 | kfree(id_ctlr_buf); | ||
1692 | kfree(id_ldrive); | ||
1693 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1682 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1694 | return; | 1683 | goto err_3; |
1695 | } | 1684 | } |
1696 | 1685 | ||
1697 | memset(id_ldrive, 0, sizeof(id_log_drv_t)); | ||
1698 | memset(id_ctlr_buf, 0, sizeof(id_ctlr_t)); | ||
1699 | memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t)); | ||
1700 | memset(sense_config_buf, 0, sizeof(config_t)); | ||
1701 | |||
1702 | info_p->phys_drives = 0; | 1686 | info_p->phys_drives = 0; |
1703 | info_p->log_drv_map = 0; | 1687 | info_p->log_drv_map = 0; |
1704 | info_p->drv_assign_map = 0; | 1688 | info_p->drv_assign_map = 0; |
@@ -1712,13 +1696,8 @@ static void getgeometry(int ctlr) | |||
1712 | * so the idastubopen will fail on all logical drives | 1696 | * so the idastubopen will fail on all logical drives |
1713 | * on the controller. | 1697 | * on the controller. |
1714 | */ | 1698 | */ |
1715 | /* Free all the buffers and return */ | ||
1716 | printk(KERN_ERR "cpqarray: error sending ID controller\n"); | 1699 | printk(KERN_ERR "cpqarray: error sending ID controller\n"); |
1717 | kfree(sense_config_buf); | 1700 | goto err_4; |
1718 | kfree(id_lstatus_buf); | ||
1719 | kfree(id_ctlr_buf); | ||
1720 | kfree(id_ldrive); | ||
1721 | return; | ||
1722 | } | 1701 | } |
1723 | 1702 | ||
1724 | info_p->log_drives = id_ctlr_buf->nr_drvs; | 1703 | info_p->log_drives = id_ctlr_buf->nr_drvs; |
@@ -1764,12 +1743,7 @@ static void getgeometry(int ctlr) | |||
1764 | " failed to report status of logical drive %d\n" | 1743 | " failed to report status of logical drive %d\n" |
1765 | "Access to this controller has been disabled\n", | 1744 | "Access to this controller has been disabled\n", |
1766 | ctlr, log_unit); | 1745 | ctlr, log_unit); |
1767 | /* Free all the buffers and return */ | 1746 | goto err_4; |
1768 | kfree(sense_config_buf); | ||
1769 | kfree(id_lstatus_buf); | ||
1770 | kfree(id_ctlr_buf); | ||
1771 | kfree(id_ldrive); | ||
1772 | return; | ||
1773 | } | 1747 | } |
1774 | /* | 1748 | /* |
1775 | Make sure the logical drive is configured | 1749 | Make sure the logical drive is configured |
@@ -1798,14 +1772,8 @@ static void getgeometry(int ctlr) | |||
1798 | sizeof(config_t), 0, 0, log_unit); | 1772 | sizeof(config_t), 0, 0, log_unit); |
1799 | if (ret_code == IO_ERROR) { | 1773 | if (ret_code == IO_ERROR) { |
1800 | info_p->log_drv_map = 0; | 1774 | info_p->log_drv_map = 0; |
1801 | /* Free all the buffers and return */ | ||
1802 | printk(KERN_ERR "cpqarray: error sending sense config\n"); | 1775 | printk(KERN_ERR "cpqarray: error sending sense config\n"); |
1803 | kfree(sense_config_buf); | 1776 | goto err_4; |
1804 | kfree(id_lstatus_buf); | ||
1805 | kfree(id_ctlr_buf); | ||
1806 | kfree(id_ldrive); | ||
1807 | return; | ||
1808 | |||
1809 | } | 1777 | } |
1810 | 1778 | ||
1811 | info_p->phys_drives = | 1779 | info_p->phys_drives = |
@@ -1820,12 +1788,18 @@ static void getgeometry(int ctlr) | |||
1820 | log_index = log_index + 1; | 1788 | log_index = log_index + 1; |
1821 | } /* end of if logical drive configured */ | 1789 | } /* end of if logical drive configured */ |
1822 | } /* end of for log_unit */ | 1790 | } /* end of for log_unit */ |
1791 | |||
1792 | /* Free all the buffers and return */ | ||
1793 | err_4: | ||
1823 | kfree(sense_config_buf); | 1794 | kfree(sense_config_buf); |
1824 | kfree(id_ldrive); | 1795 | err_3: |
1825 | kfree(id_lstatus_buf); | 1796 | kfree(id_lstatus_buf); |
1797 | err_2: | ||
1826 | kfree(id_ctlr_buf); | 1798 | kfree(id_ctlr_buf); |
1799 | err_1: | ||
1800 | kfree(id_ldrive); | ||
1801 | err_0: | ||
1827 | return; | 1802 | return; |
1828 | |||
1829 | } | 1803 | } |
1830 | 1804 | ||
1831 | static void __exit cpqarray_exit(void) | 1805 | static void __exit cpqarray_exit(void) |
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 85916e2665d4..af3969a9c963 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/dma-mapping.h> | 41 | #include <linux/dma-mapping.h> |
42 | #include <linux/completion.h> | 42 | #include <linux/completion.h> |
43 | #include <linux/device.h> | 43 | #include <linux/device.h> |
44 | #include <linux/kernel.h> | ||
45 | 44 | ||
46 | #include <asm/uaccess.h> | 45 | #include <asm/uaccess.h> |
47 | #include <asm/vio.h> | 46 | #include <asm/vio.h> |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index cb27e8863d7c..3ede0b63da13 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -902,26 +902,17 @@ static int ace_release(struct inode *inode, struct file *filp) | |||
902 | return 0; | 902 | return 0; |
903 | } | 903 | } |
904 | 904 | ||
905 | static int ace_ioctl(struct inode *inode, struct file *filp, | 905 | static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) |
906 | unsigned int cmd, unsigned long arg) | ||
907 | { | 906 | { |
908 | struct ace_device *ace = inode->i_bdev->bd_disk->private_data; | 907 | struct ace_device *ace = bdev->bd_disk->private_data; |
909 | struct hd_geometry __user *geo = (struct hd_geometry __user *)arg; | ||
910 | struct hd_geometry g; | ||
911 | dev_dbg(ace->dev, "ace_ioctl()\n"); | ||
912 | |||
913 | switch (cmd) { | ||
914 | case HDIO_GETGEO: | ||
915 | g.heads = ace->cf_id.heads; | ||
916 | g.sectors = ace->cf_id.sectors; | ||
917 | g.cylinders = ace->cf_id.cyls; | ||
918 | g.start = 0; | ||
919 | return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0; | ||
920 | 908 | ||
921 | default: | 909 | dev_dbg(ace->dev, "ace_getgeo()\n"); |
922 | return -ENOTTY; | 910 | |
923 | } | 911 | geo->heads = ace->cf_id.heads; |
924 | return -ENOTTY; | 912 | geo->sectors = ace->cf_id.sectors; |
913 | geo->cylinders = ace->cf_id.cyls; | ||
914 | |||
915 | return 0; | ||
925 | } | 916 | } |
926 | 917 | ||
927 | static struct block_device_operations ace_fops = { | 918 | static struct block_device_operations ace_fops = { |
@@ -930,7 +921,7 @@ static struct block_device_operations ace_fops = { | |||
930 | .release = ace_release, | 921 | .release = ace_release, |
931 | .media_changed = ace_media_changed, | 922 | .media_changed = ace_media_changed, |
932 | .revalidate_disk = ace_revalidate_disk, | 923 | .revalidate_disk = ace_revalidate_disk, |
933 | .ioctl = ace_ioctl, | 924 | .getgeo = ace_getgeo, |
934 | }; | 925 | }; |
935 | 926 | ||
936 | /* -------------------------------------------------------------------- | 927 | /* -------------------------------------------------------------------- |
diff --git a/drivers/char/hvc_lguest.c b/drivers/char/hvc_lguest.c index feeccbaec438..3d6bd0baa56d 100644 --- a/drivers/char/hvc_lguest.c +++ b/drivers/char/hvc_lguest.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/init.h> | 36 | #include <linux/init.h> |
37 | #include <linux/lguest_bus.h> | 37 | #include <linux/lguest_bus.h> |
38 | #include <asm/paravirt.h> | ||
38 | #include "hvc_console.h" | 39 | #include "hvc_console.h" |
39 | 40 | ||
40 | /*D:340 This is our single console input buffer, with associated "struct | 41 | /*D:340 This is our single console input buffer, with associated "struct |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index fee58e03dbe2..4177f6db83e9 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1629,7 +1629,7 @@ static int cmm_open(struct inode *inode, struct file *filp) | |||
1629 | { | 1629 | { |
1630 | struct cm4000_dev *dev; | 1630 | struct cm4000_dev *dev; |
1631 | struct pcmcia_device *link; | 1631 | struct pcmcia_device *link; |
1632 | int rc, minor = iminor(inode); | 1632 | int minor = iminor(inode); |
1633 | 1633 | ||
1634 | if (minor >= CM4000_MAX_DEV) | 1634 | if (minor >= CM4000_MAX_DEV) |
1635 | return -ENODEV; | 1635 | return -ENODEV; |
@@ -1668,7 +1668,6 @@ static int cmm_open(struct inode *inode, struct file *filp) | |||
1668 | start_monitor(dev); | 1668 | start_monitor(dev); |
1669 | 1669 | ||
1670 | link->open = 1; /* only one open per device */ | 1670 | link->open = 1; /* only one open per device */ |
1671 | rc = 0; | ||
1672 | 1671 | ||
1673 | DEBUGP(2, dev, "<- cmm_open\n"); | 1672 | DEBUGP(2, dev, "<- cmm_open\n"); |
1674 | return nonseekable_open(inode, filp); | 1673 | return nonseekable_open(inode, filp); |
@@ -1824,7 +1823,7 @@ static int cm4000_resume(struct pcmcia_device *link) | |||
1824 | 1823 | ||
1825 | static void cm4000_release(struct pcmcia_device *link) | 1824 | static void cm4000_release(struct pcmcia_device *link) |
1826 | { | 1825 | { |
1827 | cmm_cm4000_release(link->priv); /* delay release until device closed */ | 1826 | cmm_cm4000_release(link); /* delay release until device closed */ |
1828 | pcmcia_disable_device(link); | 1827 | pcmcia_disable_device(link); |
1829 | } | 1828 | } |
1830 | 1829 | ||
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index af88181a17f4..b24a3e7bbb9f 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -599,7 +599,7 @@ cs_release: | |||
599 | 599 | ||
600 | static void reader_release(struct pcmcia_device *link) | 600 | static void reader_release(struct pcmcia_device *link) |
601 | { | 601 | { |
602 | cm4040_reader_release(link->priv); | 602 | cm4040_reader_release(link); |
603 | pcmcia_disable_device(link); | 603 | pcmcia_disable_device(link); |
604 | } | 604 | } |
605 | 605 | ||
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index de37ebc3a4cf..51ea93cab6c4 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -369,25 +369,54 @@ static void tty_buffer_free(struct tty_struct *tty, struct tty_buffer *b) | |||
369 | } | 369 | } |
370 | 370 | ||
371 | /** | 371 | /** |
372 | * tty_buffer_flush - flush full tty buffers | 372 | * __tty_buffer_flush - flush full tty buffers |
373 | * @tty: tty to flush | 373 | * @tty: tty to flush |
374 | * | 374 | * |
375 | * flush all the buffers containing receive data | 375 | * flush all the buffers containing receive data. Caller must |
376 | * hold the buffer lock and must have ensured no parallel flush to | ||
377 | * ldisc is running. | ||
376 | * | 378 | * |
377 | * Locking: none | 379 | * Locking: Caller must hold tty->buf.lock |
378 | */ | 380 | */ |
379 | 381 | ||
380 | static void tty_buffer_flush(struct tty_struct *tty) | 382 | static void __tty_buffer_flush(struct tty_struct *tty) |
381 | { | 383 | { |
382 | struct tty_buffer *thead; | 384 | struct tty_buffer *thead; |
383 | unsigned long flags; | ||
384 | 385 | ||
385 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
386 | while((thead = tty->buf.head) != NULL) { | 386 | while((thead = tty->buf.head) != NULL) { |
387 | tty->buf.head = thead->next; | 387 | tty->buf.head = thead->next; |
388 | tty_buffer_free(tty, thead); | 388 | tty_buffer_free(tty, thead); |
389 | } | 389 | } |
390 | tty->buf.tail = NULL; | 390 | tty->buf.tail = NULL; |
391 | } | ||
392 | |||
393 | /** | ||
394 | * tty_buffer_flush - flush full tty buffers | ||
395 | * @tty: tty to flush | ||
396 | * | ||
397 | * flush all the buffers containing receive data. If the buffer is | ||
398 | * being processed by flush_to_ldisc then we defer the processing | ||
399 | * to that function | ||
400 | * | ||
401 | * Locking: none | ||
402 | */ | ||
403 | |||
404 | static void tty_buffer_flush(struct tty_struct *tty) | ||
405 | { | ||
406 | unsigned long flags; | ||
407 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
408 | |||
409 | /* If the data is being pushed to the tty layer then we can't | ||
410 | process it here. Instead set a flag and the flush_to_ldisc | ||
411 | path will process the flush request before it exits */ | ||
412 | if (test_bit(TTY_FLUSHING, &tty->flags)) { | ||
413 | set_bit(TTY_FLUSHPENDING, &tty->flags); | ||
414 | spin_unlock_irqrestore(&tty->buf.lock, flags); | ||
415 | wait_event(tty->read_wait, | ||
416 | test_bit(TTY_FLUSHPENDING, &tty->flags) == 0); | ||
417 | return; | ||
418 | } else | ||
419 | __tty_buffer_flush(tty); | ||
391 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 420 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
392 | } | 421 | } |
393 | 422 | ||
@@ -3594,6 +3623,7 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3594 | return; | 3623 | return; |
3595 | 3624 | ||
3596 | spin_lock_irqsave(&tty->buf.lock, flags); | 3625 | spin_lock_irqsave(&tty->buf.lock, flags); |
3626 | set_bit(TTY_FLUSHING, &tty->flags); /* So we know a flush is running */ | ||
3597 | head = tty->buf.head; | 3627 | head = tty->buf.head; |
3598 | if (head != NULL) { | 3628 | if (head != NULL) { |
3599 | tty->buf.head = NULL; | 3629 | tty->buf.head = NULL; |
@@ -3607,6 +3637,11 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3607 | tty_buffer_free(tty, tbuf); | 3637 | tty_buffer_free(tty, tbuf); |
3608 | continue; | 3638 | continue; |
3609 | } | 3639 | } |
3640 | /* Ldisc or user is trying to flush the buffers | ||
3641 | we are feeding to the ldisc, stop feeding the | ||
3642 | line discipline as we want to empty the queue */ | ||
3643 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) | ||
3644 | break; | ||
3610 | if (!tty->receive_room) { | 3645 | if (!tty->receive_room) { |
3611 | schedule_delayed_work(&tty->buf.work, 1); | 3646 | schedule_delayed_work(&tty->buf.work, 1); |
3612 | break; | 3647 | break; |
@@ -3620,8 +3655,17 @@ static void flush_to_ldisc(struct work_struct *work) | |||
3620 | disc->receive_buf(tty, char_buf, flag_buf, count); | 3655 | disc->receive_buf(tty, char_buf, flag_buf, count); |
3621 | spin_lock_irqsave(&tty->buf.lock, flags); | 3656 | spin_lock_irqsave(&tty->buf.lock, flags); |
3622 | } | 3657 | } |
3658 | /* Restore the queue head */ | ||
3623 | tty->buf.head = head; | 3659 | tty->buf.head = head; |
3624 | } | 3660 | } |
3661 | /* We may have a deferred request to flush the input buffer, | ||
3662 | if so pull the chain under the lock and empty the queue */ | ||
3663 | if (test_bit(TTY_FLUSHPENDING, &tty->flags)) { | ||
3664 | __tty_buffer_flush(tty); | ||
3665 | clear_bit(TTY_FLUSHPENDING, &tty->flags); | ||
3666 | wake_up(&tty->read_wait); | ||
3667 | } | ||
3668 | clear_bit(TTY_FLUSHING, &tty->flags); | ||
3625 | spin_unlock_irqrestore(&tty->buf.lock, flags); | 3669 | spin_unlock_irqrestore(&tty->buf.lock, flags); |
3626 | 3670 | ||
3627 | tty_ldisc_deref(disc); | 3671 | tty_ldisc_deref(disc); |
diff --git a/drivers/lguest/lguest.c b/drivers/lguest/lguest.c index 524beea7fb19..6e135ac0834f 100644 --- a/drivers/lguest/lguest.c +++ b/drivers/lguest/lguest.c | |||
@@ -936,23 +936,24 @@ static const struct lguest_insns | |||
936 | /* Now our patch routine is fairly simple (based on the native one in | 936 | /* Now our patch routine is fairly simple (based on the native one in |
937 | * paravirt.c). If we have a replacement, we copy it in and return how much of | 937 | * paravirt.c). If we have a replacement, we copy it in and return how much of |
938 | * the available space we used. */ | 938 | * the available space we used. */ |
939 | static unsigned lguest_patch(u8 type, u16 clobber, void *insns, unsigned len) | 939 | static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, |
940 | unsigned long addr, unsigned len) | ||
940 | { | 941 | { |
941 | unsigned int insn_len; | 942 | unsigned int insn_len; |
942 | 943 | ||
943 | /* Don't do anything special if we don't have a replacement */ | 944 | /* Don't do anything special if we don't have a replacement */ |
944 | if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start) | 945 | if (type >= ARRAY_SIZE(lguest_insns) || !lguest_insns[type].start) |
945 | return paravirt_patch_default(type, clobber, insns, len); | 946 | return paravirt_patch_default(type, clobber, ibuf, addr, len); |
946 | 947 | ||
947 | insn_len = lguest_insns[type].end - lguest_insns[type].start; | 948 | insn_len = lguest_insns[type].end - lguest_insns[type].start; |
948 | 949 | ||
949 | /* Similarly if we can't fit replacement (shouldn't happen, but let's | 950 | /* Similarly if we can't fit replacement (shouldn't happen, but let's |
950 | * be thorough). */ | 951 | * be thorough). */ |
951 | if (len < insn_len) | 952 | if (len < insn_len) |
952 | return paravirt_patch_default(type, clobber, insns, len); | 953 | return paravirt_patch_default(type, clobber, ibuf, addr, len); |
953 | 954 | ||
954 | /* Copy in our instructions. */ | 955 | /* Copy in our instructions. */ |
955 | memcpy(insns, lguest_insns[type].start, insn_len); | 956 | memcpy(ibuf, lguest_insns[type].start, insn_len); |
956 | return insn_len; | 957 | return insn_len; |
957 | } | 958 | } |
958 | 959 | ||
diff --git a/drivers/lguest/lguest_bus.c b/drivers/lguest/lguest_bus.c index 55a7940ca732..9e7752cc8002 100644 --- a/drivers/lguest/lguest_bus.c +++ b/drivers/lguest/lguest_bus.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/bootmem.h> | 5 | #include <linux/bootmem.h> |
6 | #include <linux/lguest_bus.h> | 6 | #include <linux/lguest_bus.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | #include <asm/paravirt.h> | ||
8 | 9 | ||
9 | static ssize_t type_show(struct device *_dev, | 10 | static ssize_t type_show(struct device *_dev, |
10 | struct device_attribute *attr, char *buf) | 11 | struct device_attribute *attr, char *buf) |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 141ff9fa296e..2120155929a6 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, | |||
580 | /* the bio has been remapped so dispatch it */ | 580 | /* the bio has been remapped so dispatch it */ |
581 | 581 | ||
582 | blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, | 582 | blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, |
583 | tio->io->bio->bi_bdev->bd_dev, sector, | 583 | tio->io->bio->bi_bdev->bd_dev, |
584 | clone->bi_sector); | 584 | clone->bi_sector, sector); |
585 | 585 | ||
586 | generic_make_request(clone); | 586 | generic_make_request(clone); |
587 | } else if (r < 0 || r == DM_MAPIO_REQUEUE) { | 587 | } else if (r < 0 || r == DM_MAPIO_REQUEUE) { |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 8c86b802f212..d091b2430b48 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/fs.h> | 9 | #include <linux/fs.h> |
10 | #include <linux/mm.h> | ||
10 | #include <linux/err.h> | 11 | #include <linux/err.h> |
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 0c16a2b39b41..2adf856e44c2 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -86,7 +86,7 @@ struct mpc83xx_spi { | |||
86 | 86 | ||
87 | unsigned nsecs; /* (clock cycle time)/2 */ | 87 | unsigned nsecs; /* (clock cycle time)/2 */ |
88 | 88 | ||
89 | u32 sysclk; | 89 | u32 spibrg; /* SPIBRG input clock */ |
90 | u32 rx_shift; /* RX data reg shift when in qe mode */ | 90 | u32 rx_shift; /* RX data reg shift when in qe mode */ |
91 | u32 tx_shift; /* TX data reg shift when in qe mode */ | 91 | u32 tx_shift; /* TX data reg shift when in qe mode */ |
92 | 92 | ||
@@ -148,6 +148,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
148 | if (value == BITBANG_CS_ACTIVE) { | 148 | if (value == BITBANG_CS_ACTIVE) { |
149 | u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); | 149 | u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); |
150 | u32 len = spi->bits_per_word; | 150 | u32 len = spi->bits_per_word; |
151 | u8 pm; | ||
152 | |||
151 | if (len == 32) | 153 | if (len == 32) |
152 | len = 0; | 154 | len = 0; |
153 | else | 155 | else |
@@ -169,17 +171,20 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
169 | 171 | ||
170 | regval |= SPMODE_LEN(len); | 172 | regval |= SPMODE_LEN(len); |
171 | 173 | ||
172 | if ((mpc83xx_spi->sysclk / spi->max_speed_hz) >= 64) { | 174 | if ((mpc83xx_spi->spibrg / spi->max_speed_hz) >= 64) { |
173 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 64); | 175 | pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 64) - 1; |
174 | if (pm > 0x0f) { | 176 | if (pm > 0x0f) { |
175 | printk(KERN_WARNING "MPC83xx SPI: SPICLK can't be less then a SYSCLK/1024!\n" | 177 | dev_err(&spi->dev, "Requested speed is too " |
176 | "Requested SPICLK is %d Hz. Will use %d Hz instead.\n", | 178 | "low: %d Hz. Will use %d Hz instead.\n", |
177 | spi->max_speed_hz, mpc83xx_spi->sysclk / 1024); | 179 | spi->max_speed_hz, |
180 | mpc83xx_spi->spibrg / 1024); | ||
178 | pm = 0x0f; | 181 | pm = 0x0f; |
179 | } | 182 | } |
180 | regval |= SPMODE_PM(pm) | SPMODE_DIV16; | 183 | regval |= SPMODE_PM(pm) | SPMODE_DIV16; |
181 | } else { | 184 | } else { |
182 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 4); | 185 | pm = mpc83xx_spi->spibrg / (spi->max_speed_hz * 4); |
186 | if (pm) | ||
187 | pm--; | ||
183 | regval |= SPMODE_PM(pm); | 188 | regval |= SPMODE_PM(pm); |
184 | } | 189 | } |
185 | 190 | ||
@@ -429,13 +434,17 @@ static int __init mpc83xx_spi_probe(struct platform_device *dev) | |||
429 | mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect; | 434 | mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect; |
430 | mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer; | 435 | mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer; |
431 | mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs; | 436 | mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs; |
432 | mpc83xx_spi->sysclk = pdata->sysclk; | ||
433 | mpc83xx_spi->activate_cs = pdata->activate_cs; | 437 | mpc83xx_spi->activate_cs = pdata->activate_cs; |
434 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; | 438 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; |
435 | mpc83xx_spi->qe_mode = pdata->qe_mode; | 439 | mpc83xx_spi->qe_mode = pdata->qe_mode; |
436 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; | 440 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; |
437 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; | 441 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; |
438 | 442 | ||
443 | if (mpc83xx_spi->qe_mode) | ||
444 | mpc83xx_spi->spibrg = pdata->sysclk / 2; | ||
445 | else | ||
446 | mpc83xx_spi->spibrg = pdata->sysclk; | ||
447 | |||
439 | mpc83xx_spi->rx_shift = 0; | 448 | mpc83xx_spi->rx_shift = 0; |
440 | mpc83xx_spi->tx_shift = 0; | 449 | mpc83xx_spi->tx_shift = 0; |
441 | if (mpc83xx_spi->qe_mode) { | 450 | if (mpc83xx_spi->qe_mode) { |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 630f781aeb19..c55459c592b8 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -183,7 +183,9 @@ static int spidev_message(struct spidev_data *spidev, | |||
183 | 183 | ||
184 | if (u_tmp->rx_buf) { | 184 | if (u_tmp->rx_buf) { |
185 | k_tmp->rx_buf = buf; | 185 | k_tmp->rx_buf = buf; |
186 | if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len)) | 186 | if (!access_ok(VERIFY_WRITE, (u8 __user *) |
187 | (ptrdiff_t) u_tmp->rx_buf, | ||
188 | u_tmp->len)) | ||
187 | goto done; | 189 | goto done; |
188 | } | 190 | } |
189 | if (u_tmp->tx_buf) { | 191 | if (u_tmp->tx_buf) { |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index decfdc8eb9cc..e58c87b3e3a0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -127,8 +127,20 @@ static int last_fb_vc = MAX_NR_CONSOLES - 1; | |||
127 | static int fbcon_is_default = 1; | 127 | static int fbcon_is_default = 1; |
128 | static int fbcon_has_exited; | 128 | static int fbcon_has_exited; |
129 | static int primary_device = -1; | 129 | static int primary_device = -1; |
130 | |||
131 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY | ||
130 | static int map_override; | 132 | static int map_override; |
131 | 133 | ||
134 | static inline void fbcon_map_override(void) | ||
135 | { | ||
136 | map_override = 1; | ||
137 | } | ||
138 | #else | ||
139 | static inline void fbcon_map_override(void) | ||
140 | { | ||
141 | } | ||
142 | #endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */ | ||
143 | |||
132 | /* font data */ | 144 | /* font data */ |
133 | static char fontname[40]; | 145 | static char fontname[40]; |
134 | 146 | ||
@@ -506,7 +518,7 @@ static int __init fb_console_setup(char *this_opt) | |||
506 | (options[j++]-'0') % FB_MAX; | 518 | (options[j++]-'0') % FB_MAX; |
507 | } | 519 | } |
508 | 520 | ||
509 | map_override = 1; | 521 | fbcon_map_override(); |
510 | } | 522 | } |
511 | 523 | ||
512 | return 1; | 524 | return 1; |
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c index 7c76e079ca7d..d42346e7fdda 100644 --- a/drivers/video/matrox/g450_pll.c +++ b/drivers/video/matrox/g450_pll.c | |||
@@ -331,16 +331,19 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll, | |||
331 | tmp |= M1064_XPIXCLKCTRL_PLL_UP; | 331 | tmp |= M1064_XPIXCLKCTRL_PLL_UP; |
332 | } | 332 | } |
333 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); | 333 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); |
334 | #ifdef __powerpc__ | 334 | /* DVI PLL preferred for frequencies up to |
335 | /* This is necessary to avoid jitter on PowerPC | 335 | panel link max, standard PLL otherwise */ |
336 | * (OpenFirmware) systems, but apparently | 336 | if (fout >= MINFO->max_pixel_clock_panellink) |
337 | * introduces jitter, at least on a x86-64 | 337 | tmp = 0; |
338 | * using DVI. | 338 | else tmp = |
339 | * A simple workaround is disable for non-PPC. | 339 | M1064_XDVICLKCTRL_DVIDATAPATHSEL | |
340 | */ | 340 | M1064_XDVICLKCTRL_C1DVICLKSEL | |
341 | matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0); | 341 | M1064_XDVICLKCTRL_C1DVICLKEN | |
342 | #endif /* __powerpc__ */ | 342 | M1064_XDVICLKCTRL_DVILOOPCTL | |
343 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl); | 343 | M1064_XDVICLKCTRL_P1LOOPBWDTCTL; |
344 | matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL,tmp); | ||
345 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, | ||
346 | xpwrctrl); | ||
344 | 347 | ||
345 | matroxfb_DAC_unlock_irqrestore(flags); | 348 | matroxfb_DAC_unlock_irqrestore(flags); |
346 | } | 349 | } |
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h index df39c3193735..7a98ce8043d7 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.h +++ b/drivers/video/matrox/matroxfb_DAC1064.h | |||
@@ -33,6 +33,21 @@ void DAC1064_global_restore(WPMINFO2); | |||
33 | #define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */ | 33 | #define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */ |
34 | #define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */ | 34 | #define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */ |
35 | #define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */ | 35 | #define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */ |
36 | /* drive DVI by standard(0)/DVI(1) PLL */ | ||
37 | /* if set(1), C?DVICLKEN and C?DVICLKSEL must be set(1) */ | ||
38 | #define M1064_XDVICLKCTRL_DVIDATAPATHSEL 0x01 | ||
39 | /* drive CRTC1 by standard(0)/DVI(1) PLL */ | ||
40 | #define M1064_XDVICLKCTRL_C1DVICLKSEL 0x02 | ||
41 | /* drive CRTC2 by standard(0)/DVI(1) PLL */ | ||
42 | #define M1064_XDVICLKCTRL_C2DVICLKSEL 0x04 | ||
43 | /* pixel clock allowed to(0)/blocked from(1) driving CRTC1 */ | ||
44 | #define M1064_XDVICLKCTRL_C1DVICLKEN 0x08 | ||
45 | /* DVI PLL loop filter bandwidth selection bits */ | ||
46 | #define M1064_XDVICLKCTRL_DVILOOPCTL 0x30 | ||
47 | /* CRTC2 pixel clock allowed to(0)/blocked from(1) driving CRTC2 */ | ||
48 | #define M1064_XDVICLKCTRL_C2DVICLKEN 0x40 | ||
49 | /* P1PLL loop filter bandwith selection */ | ||
50 | #define M1064_XDVICLKCTRL_P1LOOPBWDTCTL 0x80 | ||
36 | #define M1064_XCURCOL0RED 0x08 | 51 | #define M1064_XCURCOL0RED 0x08 |
37 | #define M1064_XCURCOL0GREEN 0x09 | 52 | #define M1064_XCURCOL0GREEN 0x09 |
38 | #define M1064_XCURCOL0BLUE 0x0A | 53 | #define M1064_XCURCOL0BLUE 0x0A |
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index d59577c8de86..f3107ad7e545 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h | |||
@@ -424,6 +424,7 @@ struct matrox_fb_info { | |||
424 | } mmio; | 424 | } mmio; |
425 | 425 | ||
426 | unsigned int max_pixel_clock; | 426 | unsigned int max_pixel_clock; |
427 | unsigned int max_pixel_clock_panellink; | ||
427 | 428 | ||
428 | struct matrox_switch* hw_switch; | 429 | struct matrox_switch* hw_switch; |
429 | 430 | ||
diff --git a/drivers/video/matrox/matroxfb_misc.c b/drivers/video/matrox/matroxfb_misc.c index 5948e54b9ef9..ab7fb50bc1de 100644 --- a/drivers/video/matrox/matroxfb_misc.c +++ b/drivers/video/matrox/matroxfb_misc.c | |||
@@ -658,6 +658,7 @@ static int parse_pins5(WPMINFO const struct matrox_bios* bd) { | |||
658 | MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) | | 658 | MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) | |
659 | wtst_xlat[MINFO->values.reg.mctlwtst & 7]; | 659 | wtst_xlat[MINFO->values.reg.mctlwtst & 7]; |
660 | } | 660 | } |
661 | MINFO->max_pixel_clock_panellink = bd->pins[47] * 4000; | ||
661 | return 0; | 662 | return 0; |
662 | } | 663 | } |
663 | 664 | ||
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c index f9300266044d..7d6c29800d14 100644 --- a/drivers/video/pvr2fb.c +++ b/drivers/video/pvr2fb.c | |||
@@ -94,6 +94,7 @@ | |||
94 | #define DISP_DIWCONF (DISP_BASE + 0xe8) | 94 | #define DISP_DIWCONF (DISP_BASE + 0xe8) |
95 | #define DISP_DIWHSTRT (DISP_BASE + 0xec) | 95 | #define DISP_DIWHSTRT (DISP_BASE + 0xec) |
96 | #define DISP_DIWVSTRT (DISP_BASE + 0xf0) | 96 | #define DISP_DIWVSTRT (DISP_BASE + 0xf0) |
97 | #define DISP_PIXDEPTH (DISP_BASE + 0x108) | ||
97 | 98 | ||
98 | /* Pixel clocks, one for TV output, doubled for VGA output */ | 99 | /* Pixel clocks, one for TV output, doubled for VGA output */ |
99 | #define TV_CLK 74239 | 100 | #define TV_CLK 74239 |
@@ -143,6 +144,7 @@ static struct pvr2fb_par { | |||
143 | unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */ | 144 | unsigned char is_lowres; /* Is horizontal pixel-doubling enabled? */ |
144 | 145 | ||
145 | unsigned long mmio_base; /* MMIO base */ | 146 | unsigned long mmio_base; /* MMIO base */ |
147 | u32 palette[16]; | ||
146 | } *currentpar; | 148 | } *currentpar; |
147 | 149 | ||
148 | static struct fb_info *fb_info; | 150 | static struct fb_info *fb_info; |
@@ -599,6 +601,7 @@ static void pvr2_init_display(struct fb_info *info) | |||
599 | 601 | ||
600 | /* bits per pixel */ | 602 | /* bits per pixel */ |
601 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); | 603 | fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE); |
604 | fb_writel(bytesperpixel << 2, DISP_PIXDEPTH); | ||
602 | 605 | ||
603 | /* video enable, color sync, interlace, | 606 | /* video enable, color sync, interlace, |
604 | * hsync and vsync polarity (currently unused) */ | 607 | * hsync and vsync polarity (currently unused) */ |
@@ -790,7 +793,7 @@ static int __devinit pvr2fb_common_init(void) | |||
790 | fb_info->fbops = &pvr2fb_ops; | 793 | fb_info->fbops = &pvr2fb_ops; |
791 | fb_info->fix = pvr2_fix; | 794 | fb_info->fix = pvr2_fix; |
792 | fb_info->par = currentpar; | 795 | fb_info->par = currentpar; |
793 | fb_info->pseudo_palette = (void *)(fb_info->par + 1); | 796 | fb_info->pseudo_palette = currentpar->palette; |
794 | fb_info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; | 797 | fb_info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; |
795 | 798 | ||
796 | if (video_output == VO_VGA) | 799 | if (video_output == VO_VGA) |
@@ -807,6 +810,8 @@ static int __devinit pvr2fb_common_init(void) | |||
807 | 810 | ||
808 | if (register_framebuffer(fb_info) < 0) | 811 | if (register_framebuffer(fb_info) < 0) |
809 | goto out_err; | 812 | goto out_err; |
813 | /*Must write PIXDEPTH to register before anything is displayed - so force init */ | ||
814 | pvr2_init_display(fb_info); | ||
810 | 815 | ||
811 | modememused = get_line_length(fb_info->var.xres_virtual, | 816 | modememused = get_line_length(fb_info->var.xres_virtual, |
812 | fb_info->var.bits_per_pixel); | 817 | fb_info->var.bits_per_pixel); |
@@ -1082,14 +1087,15 @@ static int __init pvr2fb_init(void) | |||
1082 | #endif | 1087 | #endif |
1083 | size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32); | 1088 | size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32); |
1084 | 1089 | ||
1085 | fb_info = kzalloc(size, GFP_KERNEL); | 1090 | fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL); |
1091 | |||
1086 | if (!fb_info) { | 1092 | if (!fb_info) { |
1087 | printk(KERN_ERR "Failed to allocate memory for fb_info\n"); | 1093 | printk(KERN_ERR "Failed to allocate memory for fb_info\n"); |
1088 | return -ENOMEM; | 1094 | return -ENOMEM; |
1089 | } | 1095 | } |
1090 | 1096 | ||
1091 | 1097 | ||
1092 | currentpar = (struct pvr2fb_par *)(fb_info + 1); | 1098 | currentpar = fb_info->par; |
1093 | 1099 | ||
1094 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { | 1100 | for (i = 0; i < ARRAY_SIZE(board_driver); i++) { |
1095 | struct pvr2_board *pvr_board = board_driver + i; | 1101 | struct pvr2_board *pvr_board = board_driver + i; |
@@ -1102,7 +1108,7 @@ static int __init pvr2fb_init(void) | |||
1102 | if (ret != 0) { | 1108 | if (ret != 0) { |
1103 | printk(KERN_ERR "pvr2fb: Failed init of %s device\n", | 1109 | printk(KERN_ERR "pvr2fb: Failed init of %s device\n", |
1104 | pvr_board->name); | 1110 | pvr_board->name); |
1105 | kfree(fb_info); | 1111 | framebuffer_release(fb_info); |
1106 | break; | 1112 | break; |
1107 | } | 1113 | } |
1108 | } | 1114 | } |
@@ -1126,7 +1132,7 @@ static void __exit pvr2fb_exit(void) | |||
1126 | #endif | 1132 | #endif |
1127 | 1133 | ||
1128 | unregister_framebuffer(fb_info); | 1134 | unregister_framebuffer(fb_info); |
1129 | kfree(fb_info); | 1135 | framebuffer_release(fb_info); |
1130 | } | 1136 | } |
1131 | 1137 | ||
1132 | module_init(pvr2fb_init); | 1138 | module_init(pvr2fb_init); |
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c index c97709ecbad0..e7c8db2eb49b 100644 --- a/drivers/video/stifb.c +++ b/drivers/video/stifb.c | |||
@@ -1100,13 +1100,18 @@ stifb_init_fb(struct sti_struct *sti, int bpp_pref) | |||
1100 | /* only supported cards are allowed */ | 1100 | /* only supported cards are allowed */ |
1101 | switch (fb->id) { | 1101 | switch (fb->id) { |
1102 | case CRT_ID_VISUALIZE_EG: | 1102 | case CRT_ID_VISUALIZE_EG: |
1103 | /* look for a double buffering device like e.g. the | 1103 | /* Visualize cards can run either in "double buffer" or |
1104 | "INTERNAL_EG_DX1024" in the RDI precisionbook laptop | 1104 | "standard" mode. Depending on the mode, the card reports |
1105 | which won't work. The same device in non-double | 1105 | a different device name, e.g. "INTERNAL_EG_DX1024" in double |
1106 | buffering mode returns "INTERNAL_EG_X1024". */ | 1106 | buffer mode and "INTERNAL_EG_X1024" in standard mode. |
1107 | if (strstr(sti->outptr.dev_name, "EG_DX")) { | 1107 | Since this driver only supports standard mode, we check |
1108 | printk(KERN_WARNING | 1108 | if the device name contains the string "DX" and tell the |
1109 | "stifb: ignoring '%s'. Disable double buffering in IPL menu.\n", | 1109 | user how to reconfigure the card. */ |
1110 | if (strstr(sti->outptr.dev_name, "DX")) { | ||
1111 | printk(KERN_WARNING "WARNING: stifb framebuffer driver does not " | ||
1112 | "support '%s' in double-buffer mode.\n" | ||
1113 | KERN_WARNING "WARNING: Please disable the double-buffer mode " | ||
1114 | "in IPL menu (the PARISC-BIOS).\n", | ||
1110 | sti->outptr.dev_name); | 1115 | sti->outptr.dev_name); |
1111 | goto out_err0; | 1116 | goto out_err0; |
1112 | } | 1117 | } |
diff --git a/fs/direct-io.c b/fs/direct-io.c index 52bb2638f7ab..6874785bb65a 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -974,6 +974,7 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, | |||
974 | dio->get_block = get_block; | 974 | dio->get_block = get_block; |
975 | dio->end_io = end_io; | 975 | dio->end_io = end_io; |
976 | dio->map_bh.b_private = NULL; | 976 | dio->map_bh.b_private = NULL; |
977 | dio->map_bh.b_state = 0; | ||
977 | dio->final_block_in_bio = -1; | 978 | dio->final_block_in_bio = -1; |
978 | dio->next_block_for_io = -1; | 979 | dio->next_block_for_io = -1; |
979 | 980 | ||
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 0a50942b4378..131954b3fb98 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -353,6 +353,10 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry, | |||
353 | ecryptfs_printk(KERN_DEBUG, "Is a symlink; returning\n"); | 353 | ecryptfs_printk(KERN_DEBUG, "Is a symlink; returning\n"); |
354 | goto out; | 354 | goto out; |
355 | } | 355 | } |
356 | if (special_file(lower_inode->i_mode)) { | ||
357 | ecryptfs_printk(KERN_DEBUG, "Is a special file; returning\n"); | ||
358 | goto out; | ||
359 | } | ||
356 | if (!nd) { | 360 | if (!nd) { |
357 | ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave" | 361 | ecryptfs_printk(KERN_DEBUG, "We have a NULL nd, just leave" |
358 | "as we *think* we are about to unlink\n"); | 362 | "as we *think* we are about to unlink\n"); |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index e557a6766927..a98497264fe8 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -813,6 +813,15 @@ out: | |||
813 | return rc; | 813 | return rc; |
814 | } | 814 | } |
815 | 815 | ||
816 | static void do_sysfs_unregistration(void) | ||
817 | { | ||
818 | sysfs_remove_file(&ecryptfs_subsys.kobj, | ||
819 | &sysfs_attr_version.attr); | ||
820 | sysfs_remove_file(&ecryptfs_subsys.kobj, | ||
821 | &sysfs_attr_version_str.attr); | ||
822 | subsystem_unregister(&ecryptfs_subsys); | ||
823 | } | ||
824 | |||
816 | static int __init ecryptfs_init(void) | 825 | static int __init ecryptfs_init(void) |
817 | { | 826 | { |
818 | int rc; | 827 | int rc; |
@@ -851,6 +860,9 @@ static int __init ecryptfs_init(void) | |||
851 | if (rc) { | 860 | if (rc) { |
852 | ecryptfs_printk(KERN_ERR, "Failure occured while attempting to " | 861 | ecryptfs_printk(KERN_ERR, "Failure occured while attempting to " |
853 | "initialize the eCryptfs netlink socket\n"); | 862 | "initialize the eCryptfs netlink socket\n"); |
863 | do_sysfs_unregistration(); | ||
864 | unregister_filesystem(&ecryptfs_fs_type); | ||
865 | ecryptfs_free_kmem_caches(); | ||
854 | } | 866 | } |
855 | out: | 867 | out: |
856 | return rc; | 868 | return rc; |
@@ -858,11 +870,7 @@ out: | |||
858 | 870 | ||
859 | static void __exit ecryptfs_exit(void) | 871 | static void __exit ecryptfs_exit(void) |
860 | { | 872 | { |
861 | sysfs_remove_file(&ecryptfs_subsys.kobj, | 873 | do_sysfs_unregistration(); |
862 | &sysfs_attr_version.attr); | ||
863 | sysfs_remove_file(&ecryptfs_subsys.kobj, | ||
864 | &sysfs_attr_version_str.attr); | ||
865 | subsystem_unregister(&ecryptfs_subsys); | ||
866 | ecryptfs_release_messaging(ecryptfs_transport); | 874 | ecryptfs_release_messaging(ecryptfs_transport); |
867 | unregister_filesystem(&ecryptfs_fs_type); | 875 | unregister_filesystem(&ecryptfs_fs_type); |
868 | ecryptfs_free_kmem_caches(); | 876 | ecryptfs_free_kmem_caches(); |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index 7306c71a8926..cd84f1771e34 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -330,10 +330,11 @@ | |||
330 | #define __NR_signalfd 321 | 330 | #define __NR_signalfd 321 |
331 | #define __NR_timerfd 322 | 331 | #define __NR_timerfd 322 |
332 | #define __NR_eventfd 323 | 332 | #define __NR_eventfd 323 |
333 | #define __NR_fallocate 324 | ||
333 | 334 | ||
334 | #ifdef __KERNEL__ | 335 | #ifdef __KERNEL__ |
335 | 336 | ||
336 | #define NR_syscalls 324 | 337 | #define NR_syscalls 325 |
337 | 338 | ||
338 | #define __ARCH_WANT_IPC_PARSE_VERSION | 339 | #define __ARCH_WANT_IPC_PARSE_VERSION |
339 | /* #define __ARCH_WANT_OLD_READDIR */ | 340 | /* #define __ARCH_WANT_OLD_READDIR */ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f605e8d0eed3..5f0d797d33fd 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_GENERIC_PGTABLE_H | 2 | #define _ASM_GENERIC_PGTABLE_H |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
5 | #ifdef CONFIG_MMU | ||
5 | 6 | ||
6 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
7 | /* | 8 | /* |
@@ -133,41 +134,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
133 | #endif | 134 | #endif |
134 | 135 | ||
135 | /* | 136 | /* |
136 | * A facility to provide lazy MMU batching. This allows PTE updates and | ||
137 | * page invalidations to be delayed until a call to leave lazy MMU mode | ||
138 | * is issued. Some architectures may benefit from doing this, and it is | ||
139 | * beneficial for both shadow and direct mode hypervisors, which may batch | ||
140 | * the PTE updates which happen during this window. Note that using this | ||
141 | * interface requires that read hazards be removed from the code. A read | ||
142 | * hazard could result in the direct mode hypervisor case, since the actual | ||
143 | * write to the page tables may not yet have taken place, so reads though | ||
144 | * a raw PTE pointer after it has been modified are not guaranteed to be | ||
145 | * up to date. This mode can only be entered and left under the protection of | ||
146 | * the page table locks for all page tables which may be modified. In the UP | ||
147 | * case, this is required so that preemption is disabled, and in the SMP case, | ||
148 | * it must synchronize the delayed page table writes properly on other CPUs. | ||
149 | */ | ||
150 | #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE | ||
151 | #define arch_enter_lazy_mmu_mode() do {} while (0) | ||
152 | #define arch_leave_lazy_mmu_mode() do {} while (0) | ||
153 | #define arch_flush_lazy_mmu_mode() do {} while (0) | ||
154 | #endif | ||
155 | |||
156 | /* | ||
157 | * A facility to provide batching of the reload of page tables with the | ||
158 | * actual context switch code for paravirtualized guests. By convention, | ||
159 | * only one of the lazy modes (CPU, MMU) should be active at any given | ||
160 | * time, entry should never be nested, and entry and exits should always | ||
161 | * be paired. This is for sanity of maintaining and reasoning about the | ||
162 | * kernel code. | ||
163 | */ | ||
164 | #ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE | ||
165 | #define arch_enter_lazy_cpu_mode() do {} while (0) | ||
166 | #define arch_leave_lazy_cpu_mode() do {} while (0) | ||
167 | #define arch_flush_lazy_cpu_mode() do {} while (0) | ||
168 | #endif | ||
169 | |||
170 | /* | ||
171 | * When walking page tables, get the address of the next boundary, | 137 | * When walking page tables, get the address of the next boundary, |
172 | * or the end address of the range if that comes earlier. Although no | 138 | * or the end address of the range if that comes earlier. Although no |
173 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. | 139 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. |
@@ -233,6 +199,43 @@ static inline int pmd_none_or_clear_bad(pmd_t *pmd) | |||
233 | } | 199 | } |
234 | return 0; | 200 | return 0; |
235 | } | 201 | } |
202 | #endif /* CONFIG_MMU */ | ||
203 | |||
204 | /* | ||
205 | * A facility to provide lazy MMU batching. This allows PTE updates and | ||
206 | * page invalidations to be delayed until a call to leave lazy MMU mode | ||
207 | * is issued. Some architectures may benefit from doing this, and it is | ||
208 | * beneficial for both shadow and direct mode hypervisors, which may batch | ||
209 | * the PTE updates which happen during this window. Note that using this | ||
210 | * interface requires that read hazards be removed from the code. A read | ||
211 | * hazard could result in the direct mode hypervisor case, since the actual | ||
212 | * write to the page tables may not yet have taken place, so reads though | ||
213 | * a raw PTE pointer after it has been modified are not guaranteed to be | ||
214 | * up to date. This mode can only be entered and left under the protection of | ||
215 | * the page table locks for all page tables which may be modified. In the UP | ||
216 | * case, this is required so that preemption is disabled, and in the SMP case, | ||
217 | * it must synchronize the delayed page table writes properly on other CPUs. | ||
218 | */ | ||
219 | #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE | ||
220 | #define arch_enter_lazy_mmu_mode() do {} while (0) | ||
221 | #define arch_leave_lazy_mmu_mode() do {} while (0) | ||
222 | #define arch_flush_lazy_mmu_mode() do {} while (0) | ||
223 | #endif | ||
224 | |||
225 | /* | ||
226 | * A facility to provide batching of the reload of page tables with the | ||
227 | * actual context switch code for paravirtualized guests. By convention, | ||
228 | * only one of the lazy modes (CPU, MMU) should be active at any given | ||
229 | * time, entry should never be nested, and entry and exits should always | ||
230 | * be paired. This is for sanity of maintaining and reasoning about the | ||
231 | * kernel code. | ||
232 | */ | ||
233 | #ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE | ||
234 | #define arch_enter_lazy_cpu_mode() do {} while (0) | ||
235 | #define arch_leave_lazy_cpu_mode() do {} while (0) | ||
236 | #define arch_flush_lazy_cpu_mode() do {} while (0) | ||
237 | #endif | ||
238 | |||
236 | #endif /* !__ASSEMBLY__ */ | 239 | #endif /* !__ASSEMBLY__ */ |
237 | 240 | ||
238 | #endif /* _ASM_GENERIC_PGTABLE_H */ | 241 | #endif /* _ASM_GENERIC_PGTABLE_H */ |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 1e8f6f252dd3..4091b33dcb10 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -116,6 +116,8 @@ extern void enable_NMI_through_LVT0 (void * dummy); | |||
116 | extern int timer_over_8254; | 116 | extern int timer_over_8254; |
117 | extern int local_apic_timer_c2_ok; | 117 | extern int local_apic_timer_c2_ok; |
118 | 118 | ||
119 | extern int local_apic_timer_disabled; | ||
120 | |||
119 | #else /* !CONFIG_X86_LOCAL_APIC */ | 121 | #else /* !CONFIG_X86_LOCAL_APIC */ |
120 | static inline void lapic_shutdown(void) { } | 122 | static inline void lapic_shutdown(void) { } |
121 | 123 | ||
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index c961c03cf1e2..7b3aa28ebc6e 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -79,7 +79,7 @@ | |||
79 | #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ | 79 | #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ |
80 | #define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ | 80 | #define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ |
81 | #define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ | 81 | #define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ |
82 | #define X86_FEATURE_LAPIC_TIMER_BROKEN (3*32+ 14) /* lapic timer broken in C1 */ | 82 | /* 14 free */ |
83 | #define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ | 83 | #define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ |
84 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ | 84 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ |
85 | 85 | ||
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index 7df88be2dd9e..9fa3fa9e62d1 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -47,7 +47,8 @@ struct paravirt_ops | |||
47 | * The patch function should return the number of bytes of code | 47 | * The patch function should return the number of bytes of code |
48 | * generated, as we nop pad the rest in generic code. | 48 | * generated, as we nop pad the rest in generic code. |
49 | */ | 49 | */ |
50 | unsigned (*patch)(u8 type, u16 clobber, void *firstinsn, unsigned len); | 50 | unsigned (*patch)(u8 type, u16 clobber, void *insnbuf, |
51 | unsigned long addr, unsigned len); | ||
51 | 52 | ||
52 | /* Basic arch-specific setup */ | 53 | /* Basic arch-specific setup */ |
53 | void (*arch_setup)(void); | 54 | void (*arch_setup)(void); |
@@ -253,13 +254,16 @@ extern struct paravirt_ops paravirt_ops; | |||
253 | 254 | ||
254 | unsigned paravirt_patch_nop(void); | 255 | unsigned paravirt_patch_nop(void); |
255 | unsigned paravirt_patch_ignore(unsigned len); | 256 | unsigned paravirt_patch_ignore(unsigned len); |
256 | unsigned paravirt_patch_call(void *target, u16 tgt_clobbers, | 257 | unsigned paravirt_patch_call(void *insnbuf, |
257 | void *site, u16 site_clobbers, | 258 | const void *target, u16 tgt_clobbers, |
259 | unsigned long addr, u16 site_clobbers, | ||
258 | unsigned len); | 260 | unsigned len); |
259 | unsigned paravirt_patch_jmp(void *target, void *site, unsigned len); | 261 | unsigned paravirt_patch_jmp(const void *target, void *insnbuf, |
260 | unsigned paravirt_patch_default(u8 type, u16 clobbers, void *site, unsigned len); | 262 | unsigned long addr, unsigned len); |
263 | unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf, | ||
264 | unsigned long addr, unsigned len); | ||
261 | 265 | ||
262 | unsigned paravirt_patch_insns(void *site, unsigned len, | 266 | unsigned paravirt_patch_insns(void *insnbuf, unsigned len, |
263 | const char *start, const char *end); | 267 | const char *start, const char *end); |
264 | 268 | ||
265 | int paravirt_disable_iospace(void); | 269 | int paravirt_disable_iospace(void); |
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index d790343e9982..4fcacc711385 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h | |||
@@ -8,6 +8,9 @@ struct pci_sysdata { | |||
8 | int node; /* NUMA node */ | 8 | int node; /* NUMA node */ |
9 | }; | 9 | }; |
10 | 10 | ||
11 | /* scan a bus after allocating a pci_sysdata for it */ | ||
12 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | ||
13 | |||
11 | #include <linux/mm.h> /* for struct page */ | 14 | #include <linux/mm.h> /* for struct page */ |
12 | 15 | ||
13 | /* Can be used to override the logic in pci_scan_bus for skipping | 16 | /* Can be used to override the logic in pci_scan_bus for skipping |
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 88926eb44f5c..5da8cb0c0599 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h | |||
@@ -10,6 +10,8 @@ struct pci_sysdata { | |||
10 | void* iommu; /* IOMMU private data */ | 10 | void* iommu; /* IOMMU private data */ |
11 | }; | 11 | }; |
12 | 12 | ||
13 | extern struct pci_bus *pci_scan_bus_with_sysdata(int busno); | ||
14 | |||
13 | #ifdef CONFIG_CALGARY_IOMMU | 15 | #ifdef CONFIG_CALGARY_IOMMU |
14 | static inline void* pci_iommu(struct pci_bus *bus) | 16 | static inline void* pci_iommu(struct pci_bus *bus) |
15 | { | 17 | { |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 4d85262b4fa4..1ddef34f43c3 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/mempool.h> | 24 | #include <linux/mempool.h> |
25 | #include <linux/ioprio.h> | 25 | #include <linux/ioprio.h> |
26 | 26 | ||
27 | #ifdef CONFIG_BLOCK | ||
28 | |||
27 | /* Platforms may set this to teach the BIO layer about IOMMU hardware. */ | 29 | /* Platforms may set this to teach the BIO layer about IOMMU hardware. */ |
28 | #include <asm/io.h> | 30 | #include <asm/io.h> |
29 | 31 | ||
@@ -361,4 +363,5 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | |||
361 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) | 363 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) |
362 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) | 364 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) |
363 | 365 | ||
366 | #endif /* CONFIG_BLOCK */ | ||
364 | #endif /* __LINUX_BIO_H */ | 367 | #endif /* __LINUX_BIO_H */ |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 90874a5d7d78..7b5d56b82b59 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -105,7 +105,7 @@ struct blk_io_trace { | |||
105 | */ | 105 | */ |
106 | struct blk_io_trace_remap { | 106 | struct blk_io_trace_remap { |
107 | __be32 device; | 107 | __be32 device; |
108 | u32 __pad; | 108 | __be32 device_from; |
109 | __be64 sector; | 109 | __be64 sector; |
110 | }; | 110 | }; |
111 | 111 | ||
@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
272 | return; | 272 | return; |
273 | 273 | ||
274 | r.device = cpu_to_be32(dev); | 274 | r.device = cpu_to_be32(dev); |
275 | r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev); | ||
275 | r.sector = cpu_to_be64(to); | 276 | r.sector = cpu_to_be64(to); |
276 | 277 | ||
277 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | 278 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index e0bd46eb2414..def5a659b8a5 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -123,7 +123,6 @@ extern void clockevents_exchange_device(struct clock_event_device *old, | |||
123 | extern void clockevents_set_mode(struct clock_event_device *dev, | 123 | extern void clockevents_set_mode(struct clock_event_device *dev, |
124 | enum clock_event_mode mode); | 124 | enum clock_event_mode mode); |
125 | extern int clockevents_register_notifier(struct notifier_block *nb); | 125 | extern int clockevents_register_notifier(struct notifier_block *nb); |
126 | extern void clockevents_unregister_notifier(struct notifier_block *nb); | ||
127 | extern int clockevents_program_event(struct clock_event_device *dev, | 126 | extern int clockevents_program_event(struct clock_event_device *dev, |
128 | ktime_t expires, ktime_t now); | 127 | ktime_t expires, ktime_t now); |
129 | 128 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6bf139562947..16421f662a7a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1659,7 +1659,6 @@ extern int sb_min_blocksize(struct super_block *, int); | |||
1659 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | 1659 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); |
1660 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 1660 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
1661 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1661 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
1662 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | ||
1663 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 1662 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
1664 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1663 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1665 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1664 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
diff --git a/include/linux/init.h b/include/linux/init.h index 1a4a283d19a9..74b1f43bf982 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -43,7 +43,7 @@ | |||
43 | #define __init __attribute__ ((__section__ (".init.text"))) __cold | 43 | #define __init __attribute__ ((__section__ (".init.text"))) __cold |
44 | #define __initdata __attribute__ ((__section__ (".init.data"))) | 44 | #define __initdata __attribute__ ((__section__ (".init.data"))) |
45 | #define __exitdata __attribute__ ((__section__(".exit.data"))) | 45 | #define __exitdata __attribute__ ((__section__(".exit.data"))) |
46 | #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) __cold | 46 | #define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) |
47 | 47 | ||
48 | /* modpost check for section mismatches during the kernel build. | 48 | /* modpost check for section mismatches during the kernel build. |
49 | * A section mismatch happens when there are references from a | 49 | * A section mismatch happens when there are references from a |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b4f5b81b4257..f592df74b3cf 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -226,7 +226,7 @@ extern void print_hex_dump(const char *level, const char *prefix_str, | |||
226 | int prefix_type, int rowsize, int groupsize, | 226 | int prefix_type, int rowsize, int groupsize, |
227 | const void *buf, size_t len, bool ascii); | 227 | const void *buf, size_t len, bool ascii); |
228 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | 228 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
229 | void *buf, size_t len); | 229 | const void *buf, size_t len); |
230 | #define hex_asc(x) "0123456789abcdef"[x] | 230 | #define hex_asc(x) "0123456789abcdef"[x] |
231 | 231 | ||
232 | #ifdef DEBUG | 232 | #ifdef DEBUG |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 28e3664fdf1b..cd13a78c5db8 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -75,7 +75,6 @@ struct proc_dir_entry { | |||
75 | write_proc_t *write_proc; | 75 | write_proc_t *write_proc; |
76 | atomic_t count; /* use count */ | 76 | atomic_t count; /* use count */ |
77 | int deleted; /* delete flag */ | 77 | int deleted; /* delete flag */ |
78 | void *set; | ||
79 | int pde_users; /* number of callers into module in progress */ | 78 | int pde_users; /* number of callers into module in progress */ |
80 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | 79 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ |
81 | struct completion *pde_unload_completion; | 80 | struct completion *pde_unload_completion; |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c6b7485eac7c..fe17d7d750c2 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -281,7 +281,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head, | |||
281 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, | 281 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, |
282 | void (*func)(struct rcu_head *head))); | 282 | void (*func)(struct rcu_head *head))); |
283 | extern void synchronize_rcu(void); | 283 | extern void synchronize_rcu(void); |
284 | void synchronize_idle(void); | ||
285 | extern void rcu_barrier(void); | 284 | extern void rcu_barrier(void); |
286 | 285 | ||
287 | #endif /* __KERNEL__ */ | 286 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 691a1748d9d2..6570719eafdf 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -274,6 +274,8 @@ struct tty_struct { | |||
274 | #define TTY_PTY_LOCK 16 /* pty private */ | 274 | #define TTY_PTY_LOCK 16 /* pty private */ |
275 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 275 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
276 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 276 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
277 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | ||
278 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ | ||
277 | 279 | ||
278 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 280 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
279 | 281 | ||
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 3e9f513a728d..4b8a4493c541 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -1063,6 +1063,11 @@ EXPORT_SYMBOL_GPL(register_kprobe); | |||
1063 | EXPORT_SYMBOL_GPL(unregister_kprobe); | 1063 | EXPORT_SYMBOL_GPL(unregister_kprobe); |
1064 | EXPORT_SYMBOL_GPL(register_jprobe); | 1064 | EXPORT_SYMBOL_GPL(register_jprobe); |
1065 | EXPORT_SYMBOL_GPL(unregister_jprobe); | 1065 | EXPORT_SYMBOL_GPL(unregister_jprobe); |
1066 | #ifdef CONFIG_KPROBES | ||
1066 | EXPORT_SYMBOL_GPL(jprobe_return); | 1067 | EXPORT_SYMBOL_GPL(jprobe_return); |
1068 | #endif | ||
1069 | |||
1070 | #ifdef CONFIG_KPROBES | ||
1067 | EXPORT_SYMBOL_GPL(register_kretprobe); | 1071 | EXPORT_SYMBOL_GPL(register_kretprobe); |
1068 | EXPORT_SYMBOL_GPL(unregister_kretprobe); | 1072 | EXPORT_SYMBOL_GPL(unregister_kretprobe); |
1073 | #endif | ||
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index a3b7854b8f7c..a686590d88c1 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -709,7 +709,8 @@ static void mark_nosave_pages(struct memory_bitmap *bm) | |||
709 | region->end_pfn << PAGE_SHIFT); | 709 | region->end_pfn << PAGE_SHIFT); |
710 | 710 | ||
711 | for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) | 711 | for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) |
712 | memory_bm_set_bit(bm, pfn); | 712 | if (pfn_valid(pfn)) |
713 | memory_bm_set_bit(bm, pfn); | ||
713 | } | 714 | } |
714 | } | 715 | } |
715 | 716 | ||
diff --git a/kernel/profile.c b/kernel/profile.c index 5b20fe977bed..cb1e37d2dac3 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -199,11 +199,11 @@ EXPORT_SYMBOL_GPL(register_timer_hook); | |||
199 | EXPORT_SYMBOL_GPL(unregister_timer_hook); | 199 | EXPORT_SYMBOL_GPL(unregister_timer_hook); |
200 | EXPORT_SYMBOL_GPL(task_handoff_register); | 200 | EXPORT_SYMBOL_GPL(task_handoff_register); |
201 | EXPORT_SYMBOL_GPL(task_handoff_unregister); | 201 | EXPORT_SYMBOL_GPL(task_handoff_unregister); |
202 | EXPORT_SYMBOL_GPL(profile_event_register); | ||
203 | EXPORT_SYMBOL_GPL(profile_event_unregister); | ||
202 | 204 | ||
203 | #endif /* CONFIG_PROFILING */ | 205 | #endif /* CONFIG_PROFILING */ |
204 | 206 | ||
205 | EXPORT_SYMBOL_GPL(profile_event_register); | ||
206 | EXPORT_SYMBOL_GPL(profile_event_unregister); | ||
207 | 207 | ||
208 | #ifdef CONFIG_SMP | 208 | #ifdef CONFIG_SMP |
209 | /* | 209 | /* |
diff --git a/kernel/sched.c b/kernel/sched.c index b0afd8db1396..6247e4a8350f 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -263,6 +263,7 @@ struct rq { | |||
263 | 263 | ||
264 | unsigned int clock_warps, clock_overflows; | 264 | unsigned int clock_warps, clock_overflows; |
265 | unsigned int clock_unstable_events; | 265 | unsigned int clock_unstable_events; |
266 | u64 tick_timestamp; | ||
266 | 267 | ||
267 | atomic_t nr_iowait; | 268 | atomic_t nr_iowait; |
268 | 269 | ||
@@ -341,8 +342,11 @@ static void __update_rq_clock(struct rq *rq) | |||
341 | /* | 342 | /* |
342 | * Catch too large forward jumps too: | 343 | * Catch too large forward jumps too: |
343 | */ | 344 | */ |
344 | if (unlikely(delta > 2*TICK_NSEC)) { | 345 | if (unlikely(clock + delta > rq->tick_timestamp + TICK_NSEC)) { |
345 | clock++; | 346 | if (clock < rq->tick_timestamp + TICK_NSEC) |
347 | clock = rq->tick_timestamp + TICK_NSEC; | ||
348 | else | ||
349 | clock++; | ||
346 | rq->clock_overflows++; | 350 | rq->clock_overflows++; |
347 | } else { | 351 | } else { |
348 | if (unlikely(delta > rq->clock_max_delta)) | 352 | if (unlikely(delta > rq->clock_max_delta)) |
@@ -3308,9 +3312,16 @@ void scheduler_tick(void) | |||
3308 | int cpu = smp_processor_id(); | 3312 | int cpu = smp_processor_id(); |
3309 | struct rq *rq = cpu_rq(cpu); | 3313 | struct rq *rq = cpu_rq(cpu); |
3310 | struct task_struct *curr = rq->curr; | 3314 | struct task_struct *curr = rq->curr; |
3315 | u64 next_tick = rq->tick_timestamp + TICK_NSEC; | ||
3311 | 3316 | ||
3312 | spin_lock(&rq->lock); | 3317 | spin_lock(&rq->lock); |
3313 | __update_rq_clock(rq); | 3318 | __update_rq_clock(rq); |
3319 | /* | ||
3320 | * Let rq->clock advance by at least TICK_NSEC: | ||
3321 | */ | ||
3322 | if (unlikely(rq->clock < next_tick)) | ||
3323 | rq->clock = next_tick; | ||
3324 | rq->tick_timestamp = rq->clock; | ||
3314 | update_cpu_load(rq); | 3325 | update_cpu_load(rq); |
3315 | if (curr != rq->idle) /* FIXME: needed? */ | 3326 | if (curr != rq->idle) /* FIXME: needed? */ |
3316 | curr->sched_class->task_tick(rq, curr); | 3327 | curr->sched_class->task_tick(rq, curr); |
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 3da32156394e..87e524762b85 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
@@ -108,7 +108,7 @@ print_cfs_rq_runtime_sum(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
108 | 108 | ||
109 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | 109 | void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) |
110 | { | 110 | { |
111 | SEQ_printf(m, "\ncfs_rq %p\n", cfs_rq); | 111 | SEQ_printf(m, "\ncfs_rq\n"); |
112 | 112 | ||
113 | #define P(x) \ | 113 | #define P(x) \ |
114 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(cfs_rq->x)) | 114 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(cfs_rq->x)) |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index e91db32cadfd..c5af38948a1e 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -959,13 +959,12 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
959 | for_each_leaf_cfs_rq(busiest, busy_cfs_rq) { | 959 | for_each_leaf_cfs_rq(busiest, busy_cfs_rq) { |
960 | #ifdef CONFIG_FAIR_GROUP_SCHED | 960 | #ifdef CONFIG_FAIR_GROUP_SCHED |
961 | struct cfs_rq *this_cfs_rq; | 961 | struct cfs_rq *this_cfs_rq; |
962 | long imbalances; | 962 | long imbalance; |
963 | unsigned long maxload; | 963 | unsigned long maxload; |
964 | 964 | ||
965 | this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu); | 965 | this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu); |
966 | 966 | ||
967 | imbalance = busy_cfs_rq->load.weight - | 967 | imbalance = busy_cfs_rq->load.weight - this_cfs_rq->load.weight; |
968 | this_cfs_rq->load.weight; | ||
969 | /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */ | 968 | /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */ |
970 | if (imbalance <= 0) | 969 | if (imbalance <= 0) |
971 | continue; | 970 | continue; |
@@ -976,7 +975,7 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
976 | 975 | ||
977 | *this_best_prio = cfs_rq_best_prio(this_cfs_rq); | 976 | *this_best_prio = cfs_rq_best_prio(this_cfs_rq); |
978 | #else | 977 | #else |
979 | #define maxload rem_load_move | 978 | # define maxload rem_load_move |
980 | #endif | 979 | #endif |
981 | /* pass busy_cfs_rq argument into | 980 | /* pass busy_cfs_rq argument into |
982 | * load_balance_[start|next]_fair iterators | 981 | * load_balance_[start|next]_fair iterators |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 79c891e6266c..8bdb8c07e04f 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1023,6 +1023,7 @@ static ctl_table vm_table[] = { | |||
1023 | .mode = 0644, | 1023 | .mode = 0644, |
1024 | .proc_handler = &proc_doulongvec_minmax, | 1024 | .proc_handler = &proc_doulongvec_minmax, |
1025 | }, | 1025 | }, |
1026 | #endif | ||
1026 | #ifdef CONFIG_NUMA | 1027 | #ifdef CONFIG_NUMA |
1027 | { | 1028 | { |
1028 | .ctl_name = CTL_UNNUMBERED, | 1029 | .ctl_name = CTL_UNNUMBERED, |
@@ -1034,7 +1035,6 @@ static ctl_table vm_table[] = { | |||
1034 | .strategy = &sysctl_string, | 1035 | .strategy = &sysctl_string, |
1035 | }, | 1036 | }, |
1036 | #endif | 1037 | #endif |
1037 | #endif | ||
1038 | #if defined(CONFIG_X86_32) || \ | 1038 | #if defined(CONFIG_X86_32) || \ |
1039 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | 1039 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) |
1040 | { | 1040 | { |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 2ad1c37b8dfe..41dd3105ce7f 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -113,16 +113,6 @@ int clockevents_register_notifier(struct notifier_block *nb) | |||
113 | return ret; | 113 | return ret; |
114 | } | 114 | } |
115 | 115 | ||
116 | /** | ||
117 | * clockevents_unregister_notifier - unregister a clock events change listener | ||
118 | */ | ||
119 | void clockevents_unregister_notifier(struct notifier_block *nb) | ||
120 | { | ||
121 | spin_lock(&clockevents_lock); | ||
122 | raw_notifier_chain_unregister(&clockevents_chain, nb); | ||
123 | spin_unlock(&clockevents_lock); | ||
124 | } | ||
125 | |||
126 | /* | 116 | /* |
127 | * Notify about a clock event change. Called with clockevents_lock | 117 | * Notify about a clock event change. Called with clockevents_lock |
128 | * held. | 118 | * held. |
diff --git a/lib/hexdump.c b/lib/hexdump.c index 16f2e2935e87..bd5edaeaa80b 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c | |||
@@ -189,7 +189,7 @@ EXPORT_SYMBOL(print_hex_dump); | |||
189 | * rowsize of 16, groupsize of 1, and ASCII output included. | 189 | * rowsize of 16, groupsize of 1, and ASCII output included. |
190 | */ | 190 | */ |
191 | void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | 191 | void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
192 | void *buf, size_t len) | 192 | const void *buf, size_t len) |
193 | { | 193 | { |
194 | print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, 16, 1, | 194 | print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, 16, 1, |
195 | buf, len, 1); | 195 | buf, len, 1); |
diff --git a/mm/filemap.c b/mm/filemap.c index 6cf700d41844..90b657b50f81 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -843,7 +843,7 @@ static void shrink_readahead_size_eio(struct file *filp, | |||
843 | /** | 843 | /** |
844 | * do_generic_mapping_read - generic file read routine | 844 | * do_generic_mapping_read - generic file read routine |
845 | * @mapping: address_space to be read | 845 | * @mapping: address_space to be read |
846 | * @ra: file's readahead state | 846 | * @_ra: file's readahead state |
847 | * @filp: the file to read | 847 | * @filp: the file to read |
848 | * @ppos: current file position | 848 | * @ppos: current file position |
849 | * @desc: read_descriptor | 849 | * @desc: read_descriptor |
@@ -1218,26 +1218,6 @@ out: | |||
1218 | } | 1218 | } |
1219 | EXPORT_SYMBOL(generic_file_aio_read); | 1219 | EXPORT_SYMBOL(generic_file_aio_read); |
1220 | 1220 | ||
1221 | int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size) | ||
1222 | { | ||
1223 | ssize_t written; | ||
1224 | unsigned long count = desc->count; | ||
1225 | struct file *file = desc->arg.data; | ||
1226 | |||
1227 | if (size > count) | ||
1228 | size = count; | ||
1229 | |||
1230 | written = file->f_op->sendpage(file, page, offset, | ||
1231 | size, &file->f_pos, size<count); | ||
1232 | if (written < 0) { | ||
1233 | desc->error = written; | ||
1234 | written = 0; | ||
1235 | } | ||
1236 | desc->count = count - written; | ||
1237 | desc->written += written; | ||
1238 | return written; | ||
1239 | } | ||
1240 | |||
1241 | static ssize_t | 1221 | static ssize_t |
1242 | do_readahead(struct address_space *mapping, struct file *filp, | 1222 | do_readahead(struct address_space *mapping, struct file *filp, |
1243 | unsigned long index, unsigned long nr) | 1223 | unsigned long index, unsigned long nr) |
@@ -211,7 +211,8 @@ static inline void ClearSlabDebug(struct page *page) | |||
211 | #define MAX_OBJECTS_PER_SLAB 65535 | 211 | #define MAX_OBJECTS_PER_SLAB 65535 |
212 | 212 | ||
213 | /* Internal SLUB flags */ | 213 | /* Internal SLUB flags */ |
214 | #define __OBJECT_POISON 0x80000000 /* Poison object */ | 214 | #define __OBJECT_POISON 0x80000000 /* Poison object */ |
215 | #define __SYSFS_ADD_DEFERRED 0x40000000 /* Not yet visible via sysfs */ | ||
215 | 216 | ||
216 | /* Not all arches define cache_line_size */ | 217 | /* Not all arches define cache_line_size */ |
217 | #ifndef cache_line_size | 218 | #ifndef cache_line_size |
@@ -2277,10 +2278,26 @@ panic: | |||
2277 | } | 2278 | } |
2278 | 2279 | ||
2279 | #ifdef CONFIG_ZONE_DMA | 2280 | #ifdef CONFIG_ZONE_DMA |
2281 | |||
2282 | static void sysfs_add_func(struct work_struct *w) | ||
2283 | { | ||
2284 | struct kmem_cache *s; | ||
2285 | |||
2286 | down_write(&slub_lock); | ||
2287 | list_for_each_entry(s, &slab_caches, list) { | ||
2288 | if (s->flags & __SYSFS_ADD_DEFERRED) { | ||
2289 | s->flags &= ~__SYSFS_ADD_DEFERRED; | ||
2290 | sysfs_slab_add(s); | ||
2291 | } | ||
2292 | } | ||
2293 | up_write(&slub_lock); | ||
2294 | } | ||
2295 | |||
2296 | static DECLARE_WORK(sysfs_add_work, sysfs_add_func); | ||
2297 | |||
2280 | static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) | 2298 | static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) |
2281 | { | 2299 | { |
2282 | struct kmem_cache *s; | 2300 | struct kmem_cache *s; |
2283 | struct kmem_cache *x; | ||
2284 | char *text; | 2301 | char *text; |
2285 | size_t realsize; | 2302 | size_t realsize; |
2286 | 2303 | ||
@@ -2289,22 +2306,36 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags) | |||
2289 | return s; | 2306 | return s; |
2290 | 2307 | ||
2291 | /* Dynamically create dma cache */ | 2308 | /* Dynamically create dma cache */ |
2292 | x = kmalloc(kmem_size, flags & ~SLUB_DMA); | 2309 | if (flags & __GFP_WAIT) |
2293 | if (!x) | 2310 | down_write(&slub_lock); |
2294 | panic("Unable to allocate memory for dma cache\n"); | 2311 | else { |
2312 | if (!down_write_trylock(&slub_lock)) | ||
2313 | goto out; | ||
2314 | } | ||
2315 | |||
2316 | if (kmalloc_caches_dma[index]) | ||
2317 | goto unlock_out; | ||
2295 | 2318 | ||
2296 | realsize = kmalloc_caches[index].objsize; | 2319 | realsize = kmalloc_caches[index].objsize; |
2297 | text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d", | 2320 | text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d", (unsigned int)realsize), |
2298 | (unsigned int)realsize); | 2321 | s = kmalloc(kmem_size, flags & ~SLUB_DMA); |
2299 | s = create_kmalloc_cache(x, text, realsize, flags); | 2322 | |
2300 | down_write(&slub_lock); | 2323 | if (!s || !text || !kmem_cache_open(s, flags, text, |
2301 | if (!kmalloc_caches_dma[index]) { | 2324 | realsize, ARCH_KMALLOC_MINALIGN, |
2302 | kmalloc_caches_dma[index] = s; | 2325 | SLAB_CACHE_DMA|__SYSFS_ADD_DEFERRED, NULL)) { |
2303 | up_write(&slub_lock); | 2326 | kfree(s); |
2304 | return s; | 2327 | kfree(text); |
2328 | goto unlock_out; | ||
2305 | } | 2329 | } |
2330 | |||
2331 | list_add(&s->list, &slab_caches); | ||
2332 | kmalloc_caches_dma[index] = s; | ||
2333 | |||
2334 | schedule_work(&sysfs_add_work); | ||
2335 | |||
2336 | unlock_out: | ||
2306 | up_write(&slub_lock); | 2337 | up_write(&slub_lock); |
2307 | kmem_cache_destroy(s); | 2338 | out: |
2308 | return kmalloc_caches_dma[index]; | 2339 | return kmalloc_caches_dma[index]; |
2309 | } | 2340 | } |
2310 | #endif | 2341 | #endif |
@@ -2500,15 +2531,11 @@ int kmem_cache_shrink(struct kmem_cache *s) | |||
2500 | slab_unlock(page); | 2531 | slab_unlock(page); |
2501 | discard_slab(s, page); | 2532 | discard_slab(s, page); |
2502 | } else { | 2533 | } else { |
2503 | if (n->nr_partial > MAX_PARTIAL) | 2534 | list_move(&page->lru, |
2504 | list_move(&page->lru, | 2535 | slabs_by_inuse + page->inuse); |
2505 | slabs_by_inuse + page->inuse); | ||
2506 | } | 2536 | } |
2507 | } | 2537 | } |
2508 | 2538 | ||
2509 | if (n->nr_partial <= MAX_PARTIAL) | ||
2510 | goto out; | ||
2511 | |||
2512 | /* | 2539 | /* |
2513 | * Rebuild the partial list with the slabs filled up most | 2540 | * Rebuild the partial list with the slabs filled up most |
2514 | * first and the least used slabs at the end. | 2541 | * first and the least used slabs at the end. |
@@ -2516,7 +2543,6 @@ int kmem_cache_shrink(struct kmem_cache *s) | |||
2516 | for (i = s->objects - 1; i >= 0; i--) | 2543 | for (i = s->objects - 1; i >= 0; i--) |
2517 | list_splice(slabs_by_inuse + i, n->partial.prev); | 2544 | list_splice(slabs_by_inuse + i, n->partial.prev); |
2518 | 2545 | ||
2519 | out: | ||
2520 | spin_unlock_irqrestore(&n->list_lock, flags); | 2546 | spin_unlock_irqrestore(&n->list_lock, flags); |
2521 | } | 2547 | } |
2522 | 2548 | ||
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 73751ab6ec0c..dae7d30dca0f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -9,7 +9,7 @@ use strict; | |||
9 | my $P = $0; | 9 | my $P = $0; |
10 | $P =~ s@.*/@@g; | 10 | $P =~ s@.*/@@g; |
11 | 11 | ||
12 | my $V = '0.08'; | 12 | my $V = '0.09'; |
13 | 13 | ||
14 | use Getopt::Long qw(:config no_auto_abbrev); | 14 | use Getopt::Long qw(:config no_auto_abbrev); |
15 | 15 | ||
@@ -311,7 +311,7 @@ sub process { | |||
311 | 311 | ||
312 | my $Ident = qr{[A-Za-z\d_]+}; | 312 | my $Ident = qr{[A-Za-z\d_]+}; |
313 | my $Storage = qr{extern|static}; | 313 | my $Storage = qr{extern|static}; |
314 | my $Sparse = qr{__user|__kernel|__force|__iomem}; | 314 | my $Sparse = qr{__user|__kernel|__force|__iomem|__must_check|__init_refok}; |
315 | my $NonptrType = qr{ | 315 | my $NonptrType = qr{ |
316 | \b | 316 | \b |
317 | (?:const\s+)? | 317 | (?:const\s+)? |
@@ -325,6 +325,7 @@ sub process { | |||
325 | unsigned| | 325 | unsigned| |
326 | float| | 326 | float| |
327 | double| | 327 | double| |
328 | bool| | ||
328 | long\s+int| | 329 | long\s+int| |
329 | long\s+long| | 330 | long\s+long| |
330 | long\s+long\s+int| | 331 | long\s+long\s+int| |
@@ -340,7 +341,8 @@ sub process { | |||
340 | }x; | 341 | }x; |
341 | my $Type = qr{ | 342 | my $Type = qr{ |
342 | \b$NonptrType\b | 343 | \b$NonptrType\b |
343 | (?:\s*\*+\s*const|\s*\*+)? | 344 | (?:\s*\*+\s*const|\s*\*+|(?:\s*\[\s*\])+)? |
345 | (?:\s+$Sparse)* | ||
344 | }x; | 346 | }x; |
345 | my $Declare = qr{(?:$Storage\s+)?$Type}; | 347 | my $Declare = qr{(?:$Storage\s+)?$Type}; |
346 | my $Attribute = qr{const|__read_mostly|__init|__initdata|__meminit}; | 348 | my $Attribute = qr{const|__read_mostly|__init|__initdata|__meminit}; |
@@ -494,16 +496,15 @@ sub process { | |||
494 | ERROR("use tabs not spaces\n" . $herevet); | 496 | ERROR("use tabs not spaces\n" . $herevet); |
495 | } | 497 | } |
496 | 498 | ||
497 | # | ||
498 | # The rest of our checks refer specifically to C style | ||
499 | # only apply those _outside_ comments. | ||
500 | # | ||
501 | next if ($in_comment); | ||
502 | |||
503 | # Remove comments from the line before processing. | 499 | # Remove comments from the line before processing. |
504 | $line =~ s@/\*.*\*/@@g; | 500 | my $comment_edge = ($line =~ s@/\*.*\*/@@g) + |
505 | $line =~ s@/\*.*@@; | 501 | ($line =~ s@/\*.*@@) + |
506 | $line =~ s@.*\*/@@; | 502 | ($line =~ s@^(.).*\*/@$1@); |
503 | |||
504 | # The rest of our checks refer specifically to C style | ||
505 | # only apply those _outside_ comments. Only skip | ||
506 | # lines in the middle of comments. | ||
507 | next if (!$comment_edge && $in_comment); | ||
507 | 508 | ||
508 | # Standardise the strings and chars within the input to simplify matching. | 509 | # Standardise the strings and chars within the input to simplify matching. |
509 | $line = sanitise_line($line); | 510 | $line = sanitise_line($line); |
@@ -599,7 +600,7 @@ sub process { | |||
599 | if (($prevline !~ /^}/) && | 600 | if (($prevline !~ /^}/) && |
600 | ($prevline !~ /^\+}/) && | 601 | ($prevline !~ /^\+}/) && |
601 | ($prevline !~ /^ }/) && | 602 | ($prevline !~ /^ }/) && |
602 | ($prevline !~ /\s$name(?:\s+$Attribute)?\s*(?:;|=)/)) { | 603 | ($prevline !~ /\b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=)/)) { |
603 | WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); | 604 | WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); |
604 | } | 605 | } |
605 | } | 606 | } |
@@ -680,9 +681,9 @@ sub process { | |||
680 | 681 | ||
681 | # check for spaces between functions and their parentheses. | 682 | # check for spaces between functions and their parentheses. |
682 | if ($line =~ /($Ident)\s+\(/ && | 683 | if ($line =~ /($Ident)\s+\(/ && |
683 | $1 !~ /^(?:if|for|while|switch|return|volatile)$/ && | 684 | $1 !~ /^(?:if|for|while|switch|return|volatile|__volatile__|__attribute__|format|__extension__|Copyright)$/ && |
684 | $line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) { | 685 | $line !~ /$Type\s+\(/ && $line !~ /^.\#\s*define\b/) { |
685 | ERROR("no space between function name and open parenthesis '('\n" . $herecurr); | 686 | WARN("no space between function name and open parenthesis '('\n" . $herecurr); |
686 | } | 687 | } |
687 | # Check operator spacing. | 688 | # Check operator spacing. |
688 | # Note we expand the line with the leading + as the real | 689 | # Note we expand the line with the leading + as the real |
@@ -712,6 +713,7 @@ sub process { | |||
712 | $c = 'W' if ($elements[$n + 2] =~ /^\s/); | 713 | $c = 'W' if ($elements[$n + 2] =~ /^\s/); |
713 | $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); | 714 | $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); |
714 | $c = 'O' if ($elements[$n + 2] eq ''); | 715 | $c = 'O' if ($elements[$n + 2] eq ''); |
716 | $c = 'E' if ($elements[$n + 2] =~ /\s*\\$/); | ||
715 | } else { | 717 | } else { |
716 | $c = 'E'; | 718 | $c = 'E'; |
717 | } | 719 | } |
@@ -812,7 +814,11 @@ sub process { | |||
812 | 814 | ||
813 | # All the others need spaces both sides. | 815 | # All the others need spaces both sides. |
814 | } elsif ($ctx !~ /[EW]x[WE]/) { | 816 | } elsif ($ctx !~ /[EW]x[WE]/) { |
815 | ERROR("need spaces around that '$op' $at\n" . $hereptr); | 817 | # Ignore email addresses <foo@bar> |
818 | if (!($op eq '<' && $cb =~ /$;\S+\@\S+>/) && | ||
819 | !($op eq '>' && $cb =~ /<\S+\@\S+$;/)) { | ||
820 | ERROR("need spaces around that '$op' $at\n" . $hereptr); | ||
821 | } | ||
816 | } | 822 | } |
817 | $off += length($elements[$n + 1]); | 823 | $off += length($elements[$n + 1]); |
818 | } | 824 | } |
@@ -823,15 +829,24 @@ sub process { | |||
823 | WARN("multiple assignments should be avoided\n" . $herecurr); | 829 | WARN("multiple assignments should be avoided\n" . $herecurr); |
824 | } | 830 | } |
825 | 831 | ||
826 | # check for multiple declarations, allowing for a function declaration | 832 | ## # check for multiple declarations, allowing for a function declaration |
827 | # continuation. | 833 | ## # continuation. |
828 | if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && | 834 | ## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && |
829 | $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { | 835 | ## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { |
830 | WARN("declaring multiple variables together should be avoided\n" . $herecurr); | 836 | ## |
831 | } | 837 | ## # Remove any bracketed sections to ensure we do not |
838 | ## # falsly report the parameters of functions. | ||
839 | ## my $ln = $line; | ||
840 | ## while ($ln =~ s/\([^\(\)]*\)//g) { | ||
841 | ## } | ||
842 | ## if ($ln =~ /,/) { | ||
843 | ## WARN("declaring multiple variables together should be avoided\n" . $herecurr); | ||
844 | ## } | ||
845 | ## } | ||
832 | 846 | ||
833 | #need space before brace following if, while, etc | 847 | #need space before brace following if, while, etc |
834 | if ($line =~ /\(.*\){/ || $line =~ /do{/) { | 848 | if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) || |
849 | $line =~ /do{/) { | ||
835 | ERROR("need a space before the open brace '{'\n" . $herecurr); | 850 | ERROR("need a space before the open brace '{'\n" . $herecurr); |
836 | } | 851 | } |
837 | 852 | ||
@@ -841,6 +856,22 @@ sub process { | |||
841 | ERROR("need a space after that close brace '}'\n" . $herecurr); | 856 | ERROR("need a space after that close brace '}'\n" . $herecurr); |
842 | } | 857 | } |
843 | 858 | ||
859 | # check spacing on square brackets | ||
860 | if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { | ||
861 | ERROR("no space after that open square bracket '['\n" . $herecurr); | ||
862 | } | ||
863 | if ($line =~ /\s\]/) { | ||
864 | ERROR("no space before that close square bracket ']'\n" . $herecurr); | ||
865 | } | ||
866 | |||
867 | # check spacing on paretheses | ||
868 | if ($line =~ /\(\s/ && $line !~ /\(\s*$/) { | ||
869 | ERROR("no space after that open parenthesis '('\n" . $herecurr); | ||
870 | } | ||
871 | if ($line =~ /\s\)/) { | ||
872 | ERROR("no space before that close parenthesis ')'\n" . $herecurr); | ||
873 | } | ||
874 | |||
844 | #goto labels aren't indented, allow a single space however | 875 | #goto labels aren't indented, allow a single space however |
845 | if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and | 876 | if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and |
846 | !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { | 877 | !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { |
@@ -910,7 +941,7 @@ sub process { | |||
910 | # grabbing the statement after the identifier | 941 | # grabbing the statement after the identifier |
911 | $prevline =~ m{^(.#\s*define\s*$Ident(?:\([^\)]*\))?\s*)(.*)\\\s*$}; | 942 | $prevline =~ m{^(.#\s*define\s*$Ident(?:\([^\)]*\))?\s*)(.*)\\\s*$}; |
912 | ##print "1<$1> 2<$2>\n"; | 943 | ##print "1<$1> 2<$2>\n"; |
913 | if ($2 ne '') { | 944 | if (defined $2 && $2 ne '') { |
914 | $off = length($1); | 945 | $off = length($1); |
915 | $ln--; | 946 | $ln--; |
916 | $cnt++; | 947 | $cnt++; |
@@ -950,8 +981,10 @@ sub process { | |||
950 | my ($lvl, @block) = ctx_block_level($nr, $cnt); | 981 | my ($lvl, @block) = ctx_block_level($nr, $cnt); |
951 | 982 | ||
952 | my $stmt = join(' ', @block); | 983 | my $stmt = join(' ', @block); |
953 | $stmt =~ s/^[^{]*{//; | 984 | $stmt =~ s/(^[^{]*){//; |
954 | $stmt =~ s/}[^}]*$//; | 985 | my $before = $1; |
986 | $stmt =~ s/}([^}]*$)//; | ||
987 | my $after = $1; | ||
955 | 988 | ||
956 | #print "block<" . join(' ', @block) . "><" . scalar(@block) . ">\n"; | 989 | #print "block<" . join(' ', @block) . "><" . scalar(@block) . ">\n"; |
957 | #print "stmt<$stmt>\n\n"; | 990 | #print "stmt<$stmt>\n\n"; |
@@ -963,12 +996,14 @@ sub process { | |||
963 | # Also nested if's often require braces to | 996 | # Also nested if's often require braces to |
964 | # disambiguate the else binding so shhh there. | 997 | # disambiguate the else binding so shhh there. |
965 | my @semi = ($stmt =~ /;/g); | 998 | my @semi = ($stmt =~ /;/g); |
999 | push(@semi, "/**/") if ($stmt =~ m@/\*@); | ||
966 | ##print "semi<" . scalar(@semi) . ">\n"; | 1000 | ##print "semi<" . scalar(@semi) . ">\n"; |
967 | if ($lvl == 0 && scalar(@semi) < 2 && | 1001 | if ($lvl == 0 && scalar(@semi) < 2 && |
968 | $stmt !~ /{/ && $stmt !~ /\bif\b/) { | 1002 | $stmt !~ /{/ && $stmt !~ /\bif\b/ && |
1003 | $before !~ /}/ && $after !~ /{/) { | ||
969 | my $herectx = "$here\n" . join("\n", @control, @block[1 .. $#block]) . "\n"; | 1004 | my $herectx = "$here\n" . join("\n", @control, @block[1 .. $#block]) . "\n"; |
970 | shift(@block); | 1005 | shift(@block); |
971 | ERROR("braces {} are not necessary for single statement blocks\n" . $herectx); | 1006 | WARN("braces {} are not necessary for single statement blocks\n" . $herectx); |
972 | } | 1007 | } |
973 | } | 1008 | } |
974 | } | 1009 | } |
@@ -1013,6 +1048,11 @@ sub process { | |||
1013 | # $clean = 0; | 1048 | # $clean = 0; |
1014 | # } | 1049 | # } |
1015 | 1050 | ||
1051 | # warn about spacing in #ifdefs | ||
1052 | if ($line =~ /^.#\s*(ifdef|ifndef|elif)\s\s+/) { | ||
1053 | ERROR("exactly one space required after that #$1\n" . $herecurr); | ||
1054 | } | ||
1055 | |||
1016 | # check for spinlock_t definitions without a comment. | 1056 | # check for spinlock_t definitions without a comment. |
1017 | if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/) { | 1057 | if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/) { |
1018 | my $which = $1; | 1058 | my $which = $1; |
@@ -1027,14 +1067,14 @@ sub process { | |||
1027 | } | 1067 | } |
1028 | } | 1068 | } |
1029 | # check of hardware specific defines | 1069 | # check of hardware specific defines |
1030 | if ($line =~ m@^.#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@) { | 1070 | if ($line =~ m@^.#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { |
1031 | CHK("architecture specific defines should be avoided\n" . $herecurr); | 1071 | CHK("architecture specific defines should be avoided\n" . $herecurr); |
1032 | } | 1072 | } |
1033 | 1073 | ||
1034 | # check the location of the inline attribute, that it is between | 1074 | # check the location of the inline attribute, that it is between |
1035 | # storage class and type. | 1075 | # storage class and type. |
1036 | if ($line =~ /$Type\s+(?:inline|__always_inline)\b/ || | 1076 | if ($line =~ /$Type\s+(?:inline|__always_inline|noinline)\b/ || |
1037 | $line =~ /\b(?:inline|always_inline)\s+$Storage/) { | 1077 | $line =~ /\b(?:inline|__always_inline|noinline)\s+$Storage/) { |
1038 | ERROR("inline keyword should sit between storage class and type\n" . $herecurr); | 1078 | ERROR("inline keyword should sit between storage class and type\n" . $herecurr); |
1039 | } | 1079 | } |
1040 | 1080 | ||