diff options
243 files changed, 3236 insertions, 820 deletions
@@ -2611,8 +2611,9 @@ S: Perth, Western Australia | |||
2611 | S: Australia | 2611 | S: Australia |
2612 | 2612 | ||
2613 | N: Miguel Ojeda Sandonis | 2613 | N: Miguel Ojeda Sandonis |
2614 | E: maxextreme@gmail.com | 2614 | E: miguel.ojeda.sandonis@gmail.com |
2615 | W: http://maxextreme.googlepages.com/ | 2615 | W: http://miguelojeda.es |
2616 | W: http://jair.lab.fi.uva.es/~migojed/ | ||
2616 | D: Author of the ks0108, cfag12864b and cfag12864bfb auxiliary display drivers. | 2617 | D: Author of the ks0108, cfag12864b and cfag12864bfb auxiliary display drivers. |
2617 | D: Maintainer of the auxiliary display drivers tree (drivers/auxdisplay/*) | 2618 | D: Maintainer of the auxiliary display drivers tree (drivers/auxdisplay/*) |
2618 | S: C/ Mieses 20, 9-B | 2619 | S: C/ Mieses 20, 9-B |
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 0291ade44c17..619e8caf30db 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -377,7 +377,7 @@ Bug Reporting | |||
377 | bugzilla.kernel.org is where the Linux kernel developers track kernel | 377 | bugzilla.kernel.org is where the Linux kernel developers track kernel |
378 | bugs. Users are encouraged to report all bugs that they find in this | 378 | bugs. Users are encouraged to report all bugs that they find in this |
379 | tool. For details on how to use the kernel bugzilla, please see: | 379 | tool. For details on how to use the kernel bugzilla, please see: |
380 | http://test.kernel.org/bugzilla/faq.html | 380 | http://bugzilla.kernel.org/page.cgi?id=faq.html |
381 | 381 | ||
382 | The file REPORTING-BUGS in the main kernel source directory has a good | 382 | The file REPORTING-BUGS in the main kernel source directory has a good |
383 | template for how to report a possible kernel bug, and details what kind | 383 | template for how to report a possible kernel bug, and details what kind |
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt index 8aa7529f8258..cd784f46bf8a 100644 --- a/Documentation/accounting/taskstats-struct.txt +++ b/Documentation/accounting/taskstats-struct.txt | |||
@@ -24,6 +24,8 @@ There are three different groups of fields in the struct taskstats: | |||
24 | 24 | ||
25 | 4) Per-task and per-thread context switch count statistics | 25 | 4) Per-task and per-thread context switch count statistics |
26 | 26 | ||
27 | 5) Time accounting for SMT machines | ||
28 | |||
27 | Future extension should add fields to the end of the taskstats struct, and | 29 | Future extension should add fields to the end of the taskstats struct, and |
28 | should not change the relative position of each field within the struct. | 30 | should not change the relative position of each field within the struct. |
29 | 31 | ||
@@ -164,4 +166,8 @@ struct taskstats { | |||
164 | __u64 nvcsw; /* Context voluntary switch counter */ | 166 | __u64 nvcsw; /* Context voluntary switch counter */ |
165 | __u64 nivcsw; /* Context involuntary switch counter */ | 167 | __u64 nivcsw; /* Context involuntary switch counter */ |
166 | 168 | ||
169 | 5) Time accounting for SMT machines | ||
170 | __u64 ac_utimescaled; /* utime scaled on frequency etc */ | ||
171 | __u64 ac_stimescaled; /* stime scaled on frequency etc */ | ||
172 | __u64 cpu_scaled_run_real_total; /* scaled cpu_run_real_total */ | ||
167 | } | 173 | } |
diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b index b714183d4125..eb7be393a510 100644 --- a/Documentation/auxdisplay/cfag12864b +++ b/Documentation/auxdisplay/cfag12864b | |||
@@ -3,7 +3,7 @@ | |||
3 | =================================== | 3 | =================================== |
4 | 4 | ||
5 | License: GPLv2 | 5 | License: GPLv2 |
6 | Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> | 6 | Author & Maintainer: Miguel Ojeda Sandonis |
7 | Date: 2006-10-27 | 7 | Date: 2006-10-27 |
8 | 8 | ||
9 | 9 | ||
@@ -22,7 +22,7 @@ Date: 2006-10-27 | |||
22 | 1. DRIVER INFORMATION | 22 | 1. DRIVER INFORMATION |
23 | --------------------- | 23 | --------------------- |
24 | 24 | ||
25 | This driver support one cfag12864b display at time. | 25 | This driver supports a cfag12864b LCD. |
26 | 26 | ||
27 | 27 | ||
28 | --------------------- | 28 | --------------------- |
diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentation/auxdisplay/cfag12864b-example.c index 7bfac354d4c9..2caeea5e4993 100644 --- a/Documentation/auxdisplay/cfag12864b-example.c +++ b/Documentation/auxdisplay/cfag12864b-example.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Description: cfag12864b LCD userspace example program | 4 | * Description: cfag12864b LCD userspace example program |
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-31 | 8 | * Date: 2006-10-31 |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
diff --git a/Documentation/auxdisplay/ks0108 b/Documentation/auxdisplay/ks0108 index 92b03b60c613..8ddda0c8ceef 100644 --- a/Documentation/auxdisplay/ks0108 +++ b/Documentation/auxdisplay/ks0108 | |||
@@ -3,7 +3,7 @@ | |||
3 | ========================================== | 3 | ========================================== |
4 | 4 | ||
5 | License: GPLv2 | 5 | License: GPLv2 |
6 | Author & Maintainer: Miguel Ojeda Sandonis <maxextreme@gmail.com> | 6 | Author & Maintainer: Miguel Ojeda Sandonis |
7 | Date: 2006-10-27 | 7 | Date: 2006-10-27 |
8 | 8 | ||
9 | 9 | ||
@@ -21,7 +21,7 @@ Date: 2006-10-27 | |||
21 | 1. DRIVER INFORMATION | 21 | 1. DRIVER INFORMATION |
22 | --------------------- | 22 | --------------------- |
23 | 23 | ||
24 | This driver support the ks0108 LCD controller. | 24 | This driver supports the ks0108 LCD controller. |
25 | 25 | ||
26 | 26 | ||
27 | --------------------- | 27 | --------------------- |
diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt index 824fc0274471..d9014aa0eb68 100644 --- a/Documentation/cgroups.txt +++ b/Documentation/cgroups.txt | |||
@@ -390,6 +390,10 @@ If you have several tasks to attach, you have to do it one after another: | |||
390 | ... | 390 | ... |
391 | # /bin/echo PIDn > tasks | 391 | # /bin/echo PIDn > tasks |
392 | 392 | ||
393 | You can attach the current shell task by echoing 0: | ||
394 | |||
395 | # echo 0 > tasks | ||
396 | |||
393 | 3. Kernel API | 397 | 3. Kernel API |
394 | ============= | 398 | ============= |
395 | 399 | ||
diff --git a/Documentation/controllers/devices.txt b/Documentation/controllers/devices.txt index 4dcea42432c2..7cc6e6a60672 100644 --- a/Documentation/controllers/devices.txt +++ b/Documentation/controllers/devices.txt | |||
@@ -13,7 +13,7 @@ either an integer or * for all. Access is a composition of r | |||
13 | The root device cgroup starts with rwm to 'all'. A child device | 13 | The root device cgroup starts with rwm to 'all'. A child device |
14 | cgroup gets a copy of the parent. Administrators can then remove | 14 | cgroup gets a copy of the parent. Administrators can then remove |
15 | devices from the whitelist or add new entries. A child cgroup can | 15 | devices from the whitelist or add new entries. A child cgroup can |
16 | never receive a device access which is denied its parent. However | 16 | never receive a device access which is denied by its parent. However |
17 | when a device access is removed from a parent it will not also be | 17 | when a device access is removed from a parent it will not also be |
18 | removed from the child(ren). | 18 | removed from the child(ren). |
19 | 19 | ||
@@ -29,7 +29,11 @@ allows cgroup 1 to read and mknod the device usually known as | |||
29 | 29 | ||
30 | echo a > /cgroups/1/devices.deny | 30 | echo a > /cgroups/1/devices.deny |
31 | 31 | ||
32 | will remove the default 'a *:* mrw' entry. | 32 | will remove the default 'a *:* rwm' entry. Doing |
33 | |||
34 | echo a > /cgroups/1/devices.allow | ||
35 | |||
36 | will add the 'a *:* rwm' entry to the whitelist. | ||
33 | 37 | ||
34 | 3. Security | 38 | 3. Security |
35 | 39 | ||
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index 353504de3084..1f5a924d1e56 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt | |||
@@ -154,13 +154,15 @@ browsing and modifying the cpusets presently known to the kernel. No | |||
154 | new system calls are added for cpusets - all support for querying and | 154 | new system calls are added for cpusets - all support for querying and |
155 | modifying cpusets is via this cpuset file system. | 155 | modifying cpusets is via this cpuset file system. |
156 | 156 | ||
157 | The /proc/<pid>/status file for each task has two added lines, | 157 | The /proc/<pid>/status file for each task has four added lines, |
158 | displaying the tasks cpus_allowed (on which CPUs it may be scheduled) | 158 | displaying the tasks cpus_allowed (on which CPUs it may be scheduled) |
159 | and mems_allowed (on which Memory Nodes it may obtain memory), | 159 | and mems_allowed (on which Memory Nodes it may obtain memory), |
160 | in the format seen in the following example: | 160 | in the two formats seen in the following example: |
161 | 161 | ||
162 | Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff | 162 | Cpus_allowed: ffffffff,ffffffff,ffffffff,ffffffff |
163 | Cpus_allowed_list: 0-127 | ||
163 | Mems_allowed: ffffffff,ffffffff | 164 | Mems_allowed: ffffffff,ffffffff |
165 | Mems_allowed_list: 0-63 | ||
164 | 166 | ||
165 | Each cpuset is represented by a directory in the cgroup file system | 167 | Each cpuset is represented by a directory in the cgroup file system |
166 | containing (on top of the standard cgroup files) the following | 168 | containing (on top of the standard cgroup files) the following |
@@ -544,6 +546,9 @@ otherwise initial value -1 that indicates the cpuset has no request. | |||
544 | ( 4 : search nodes in a chunk of node [on NUMA system] ) | 546 | ( 4 : search nodes in a chunk of node [on NUMA system] ) |
545 | ( 5 : search system wide [on NUMA system] ) | 547 | ( 5 : search system wide [on NUMA system] ) |
546 | 548 | ||
549 | The system default is architecture dependent. The system default | ||
550 | can be changed using the relax_domain_level= boot parameter. | ||
551 | |||
547 | This file is per-cpuset and affect the sched domain where the cpuset | 552 | This file is per-cpuset and affect the sched domain where the cpuset |
548 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset | 553 | belongs to. Therefore if the flag 'sched_load_balance' of a cpuset |
549 | is disabled, then 'sched_relax_domain_level' have no effect since | 554 | is disabled, then 'sched_relax_domain_level' have no effect since |
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt new file mode 100644 index 000000000000..13e4bf054c38 --- /dev/null +++ b/Documentation/ftrace.txt | |||
@@ -0,0 +1,1353 @@ | |||
1 | ftrace - Function Tracer | ||
2 | ======================== | ||
3 | |||
4 | Copyright 2008 Red Hat Inc. | ||
5 | Author: Steven Rostedt <srostedt@redhat.com> | ||
6 | |||
7 | |||
8 | Introduction | ||
9 | ------------ | ||
10 | |||
11 | Ftrace is an internal tracer designed to help out developers and | ||
12 | designers of systems to find what is going on inside the kernel. | ||
13 | It can be used for debugging or analyzing latencies and performance | ||
14 | issues that take place outside of user-space. | ||
15 | |||
16 | Although ftrace is the function tracer, it also includes an | ||
17 | infrastructure that allows for other types of tracing. Some of the | ||
18 | tracers that are currently in ftrace is a tracer to trace | ||
19 | context switches, the time it takes for a high priority task to | ||
20 | run after it was woken up, the time interrupts are disabled, and | ||
21 | more. | ||
22 | |||
23 | |||
24 | The File System | ||
25 | --------------- | ||
26 | |||
27 | Ftrace uses the debugfs file system to hold the control files as well | ||
28 | as the files to display output. | ||
29 | |||
30 | To mount the debugfs system: | ||
31 | |||
32 | # mkdir /debug | ||
33 | # mount -t debugfs nodev /debug | ||
34 | |||
35 | |||
36 | That's it! (assuming that you have ftrace configured into your kernel) | ||
37 | |||
38 | After mounting the debugfs, you can see a directory called | ||
39 | "tracing". This directory contains the control and output files | ||
40 | of ftrace. Here is a list of some of the key files: | ||
41 | |||
42 | |||
43 | Note: all time values are in microseconds. | ||
44 | |||
45 | current_tracer : This is used to set or display the current tracer | ||
46 | that is configured. | ||
47 | |||
48 | available_tracers : This holds the different types of tracers that | ||
49 | has been compiled into the kernel. The tracers | ||
50 | listed here can be configured by echoing in their | ||
51 | name into current_tracer. | ||
52 | |||
53 | tracing_enabled : This sets or displays whether the current_tracer | ||
54 | is activated and tracing or not. Echo 0 into this | ||
55 | file to disable the tracer or 1 (or non-zero) to | ||
56 | enable it. | ||
57 | |||
58 | trace : This file holds the output of the trace in a human readable | ||
59 | format. | ||
60 | |||
61 | latency_trace : This file shows the same trace but the information | ||
62 | is organized more to display possible latencies | ||
63 | in the system. | ||
64 | |||
65 | trace_pipe : The output is the same as the "trace" file but this | ||
66 | file is meant to be streamed with live tracing. | ||
67 | Reads from this file will block until new data | ||
68 | is retrieved. Unlike the "trace" and "latency_trace" | ||
69 | files, this file is a consumer. This means reading | ||
70 | from this file causes sequential reads to display | ||
71 | more current data. Once data is read from this | ||
72 | file, it is consumed, and will not be read | ||
73 | again with a sequential read. The "trace" and | ||
74 | "latency_trace" files are static, and if the | ||
75 | tracer isn't adding more data, they will display | ||
76 | the same information every time they are read. | ||
77 | |||
78 | iter_ctrl : This file lets the user control the amount of data | ||
79 | that is displayed in one of the above output | ||
80 | files. | ||
81 | |||
82 | trace_max_latency : Some of the tracers record the max latency. | ||
83 | For example, the time interrupts are disabled. | ||
84 | This time is saved in this file. The max trace | ||
85 | will also be stored, and displayed by either | ||
86 | "trace" or "latency_trace". A new max trace will | ||
87 | only be recorded if the latency is greater than | ||
88 | the value in this file. (in microseconds) | ||
89 | |||
90 | trace_entries : This sets or displays the number of trace | ||
91 | entries each CPU buffer can hold. The tracer buffers | ||
92 | are the same size for each CPU, so care must be | ||
93 | taken when modifying the trace_entries. The number | ||
94 | of actually entries will be the number given | ||
95 | times the number of possible CPUS. The buffers | ||
96 | are saved as individual pages, and the actual entries | ||
97 | will always be rounded up to entries per page. | ||
98 | |||
99 | This can only be updated when the current_tracer | ||
100 | is set to "none". | ||
101 | |||
102 | NOTE: It is planned on changing the allocated buffers | ||
103 | from being the number of possible CPUS to | ||
104 | the number of online CPUS. | ||
105 | |||
106 | tracing_cpumask : This is a mask that lets the user only trace | ||
107 | on specified CPUS. The format is a hex string | ||
108 | representing the CPUS. | ||
109 | |||
110 | set_ftrace_filter : When dynamic ftrace is configured in, the | ||
111 | code is dynamically modified to disable calling | ||
112 | of the function profiler (mcount). This lets | ||
113 | tracing be configured in with practically no overhead | ||
114 | in performance. This also has a side effect of | ||
115 | enabling or disabling specific functions to be | ||
116 | traced. Echoing in names of functions into this | ||
117 | file will limit the trace to only those files. | ||
118 | |||
119 | set_ftrace_notrace: This has the opposite effect that | ||
120 | set_ftrace_filter has. Any function that is added | ||
121 | here will not be traced. If a function exists | ||
122 | in both set_ftrace_filter and set_ftrace_notrace | ||
123 | the function will _not_ bet traced. | ||
124 | |||
125 | available_filter_functions : When a function is encountered the first | ||
126 | time by the dynamic tracer, it is recorded and | ||
127 | later the call is converted into a nop. This file | ||
128 | lists the functions that have been recorded | ||
129 | by the dynamic tracer and these functions can | ||
130 | be used to set the ftrace filter by the above | ||
131 | "set_ftrace_filter" file. | ||
132 | |||
133 | |||
134 | The Tracers | ||
135 | ----------- | ||
136 | |||
137 | Here are the list of current tracers that can be configured. | ||
138 | |||
139 | ftrace - function tracer that uses mcount to trace all functions. | ||
140 | It is possible to filter out which functions that are | ||
141 | traced when dynamic ftrace is configured in. | ||
142 | |||
143 | sched_switch - traces the context switches between tasks. | ||
144 | |||
145 | irqsoff - traces the areas that disable interrupts and saves off | ||
146 | the trace with the longest max latency. | ||
147 | See tracing_max_latency. When a new max is recorded, | ||
148 | it replaces the old trace. It is best to view this | ||
149 | trace with the latency_trace file. | ||
150 | |||
151 | preemptoff - Similar to irqsoff but traces and records the time | ||
152 | preemption is disabled. | ||
153 | |||
154 | preemptirqsoff - Similar to irqsoff and preemptoff, but traces and | ||
155 | records the largest time irqs and/or preemption is | ||
156 | disabled. | ||
157 | |||
158 | wakeup - Traces and records the max latency that it takes for | ||
159 | the highest priority task to get scheduled after | ||
160 | it has been woken up. | ||
161 | |||
162 | none - This is not a tracer. To remove all tracers from tracing | ||
163 | simply echo "none" into current_tracer. | ||
164 | |||
165 | |||
166 | Examples of using the tracer | ||
167 | ---------------------------- | ||
168 | |||
169 | Here are typical examples of using the tracers with only controlling | ||
170 | them with the debugfs interface (without using any user-land utilities). | ||
171 | |||
172 | Output format: | ||
173 | -------------- | ||
174 | |||
175 | Here's an example of the output format of the file "trace" | ||
176 | |||
177 | -------- | ||
178 | # tracer: ftrace | ||
179 | # | ||
180 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
181 | # | | | | | | ||
182 | bash-4251 [01] 10152.583854: path_put <-path_walk | ||
183 | bash-4251 [01] 10152.583855: dput <-path_put | ||
184 | bash-4251 [01] 10152.583855: _atomic_dec_and_lock <-dput | ||
185 | -------- | ||
186 | |||
187 | A header is printed with the trace that is represented. In this case | ||
188 | the tracer is "ftrace". Then a header showing the format. Task name | ||
189 | "bash", the task PID "4251", the CPU that it was running on | ||
190 | "01", the timestamp in <secs>.<usecs> format, the function name that was | ||
191 | traced "path_put" and the parent function that called this function | ||
192 | "path_walk". | ||
193 | |||
194 | The sched_switch tracer also includes tracing of task wake ups and | ||
195 | context switches. | ||
196 | |||
197 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 2916:115:S | ||
198 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R + 10:115:S | ||
199 | ksoftirqd/1-7 [01] 1453.070013: 7:115:R ==> 10:115:R | ||
200 | events/1-10 [01] 1453.070013: 10:115:S ==> 2916:115:R | ||
201 | kondemand/1-2916 [01] 1453.070013: 2916:115:S ==> 7:115:R | ||
202 | ksoftirqd/1-7 [01] 1453.070013: 7:115:S ==> 0:140:R | ||
203 | |||
204 | Wake ups are represented by a "+" and the context switches show | ||
205 | "==>". The format is: | ||
206 | |||
207 | Context switches: | ||
208 | |||
209 | Previous task Next Task | ||
210 | |||
211 | <pid>:<prio>:<state> ==> <pid>:<prio>:<state> | ||
212 | |||
213 | Wake ups: | ||
214 | |||
215 | Current task Task waking up | ||
216 | |||
217 | <pid>:<prio>:<state> + <pid>:<prio>:<state> | ||
218 | |||
219 | The prio is the internal kernel priority, which is inverse to the | ||
220 | priority that is usually displayed by user-space tools. Zero represents | ||
221 | the highest priority (99). Prio 100 starts the "nice" priorities with | ||
222 | 100 being equal to nice -20 and 139 being nice 19. The prio "140" is | ||
223 | reserved for the idle task which is the lowest priority thread (pid 0). | ||
224 | |||
225 | |||
226 | Latency trace format | ||
227 | -------------------- | ||
228 | |||
229 | For traces that display latency times, the latency_trace file gives | ||
230 | a bit more information to see why a latency happened. Here's a typical | ||
231 | trace. | ||
232 | |||
233 | # tracer: irqsoff | ||
234 | # | ||
235 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
236 | -------------------------------------------------------------------- | ||
237 | latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
238 | ----------------- | ||
239 | | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0) | ||
240 | ----------------- | ||
241 | => started at: apic_timer_interrupt | ||
242 | => ended at: do_softirq | ||
243 | |||
244 | # _------=> CPU# | ||
245 | # / _-----=> irqs-off | ||
246 | # | / _----=> need-resched | ||
247 | # || / _---=> hardirq/softirq | ||
248 | # ||| / _--=> preempt-depth | ||
249 | # |||| / | ||
250 | # ||||| delay | ||
251 | # cmd pid ||||| time | caller | ||
252 | # \ / ||||| \ | / | ||
253 | <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt) | ||
254 | <idle>-0 0d.s. 97us : __do_softirq (do_softirq) | ||
255 | <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq) | ||
256 | |||
257 | |||
258 | vim:ft=help | ||
259 | |||
260 | |||
261 | This shows that the current tracer is "irqsoff" tracing the time | ||
262 | interrupts are disabled. It gives the trace version and the kernel | ||
263 | this was executed on (2.6.26-rc8). Then it displays the max latency | ||
264 | in microsecs (97 us). The number of trace entries displayed | ||
265 | by the total number recorded (both are three: #3/3). The type of | ||
266 | preemption that was used (PREEMPT). VP, KP, SP, and HP are always zero | ||
267 | and reserved for later use. #P is the number of online CPUS (#P:2). | ||
268 | |||
269 | The task is the process that was running when the latency happened. | ||
270 | (swapper pid: 0). | ||
271 | |||
272 | The start and stop that caused the latencies: | ||
273 | |||
274 | apic_timer_interrupt is where the interrupts were disabled. | ||
275 | do_softirq is where they were enabled again. | ||
276 | |||
277 | The next lines after the header are the trace itself. The header | ||
278 | explains which is which. | ||
279 | |||
280 | cmd: The name of the process in the trace. | ||
281 | |||
282 | pid: The PID of that process. | ||
283 | |||
284 | CPU#: The CPU that the process was running on. | ||
285 | |||
286 | irqs-off: 'd' interrupts are disabled. '.' otherwise. | ||
287 | |||
288 | need-resched: 'N' task need_resched is set, '.' otherwise. | ||
289 | |||
290 | hardirq/softirq: | ||
291 | 'H' - hard irq happened inside a softirq. | ||
292 | 'h' - hard irq is running | ||
293 | 's' - soft irq is running | ||
294 | '.' - normal context. | ||
295 | |||
296 | preempt-depth: The level of preempt_disabled | ||
297 | |||
298 | The above is mostly meaningful for kernel developers. | ||
299 | |||
300 | time: This differs from the trace output where as the trace output | ||
301 | contained a absolute timestamp. This timestamp is relative | ||
302 | to the start of the first entry in the the trace. | ||
303 | |||
304 | delay: This is just to help catch your eye a bit better. And | ||
305 | needs to be fixed to be only relative to the same CPU. | ||
306 | The marks is determined by the difference between this | ||
307 | current trace and the next trace. | ||
308 | '!' - greater than preempt_mark_thresh (default 100) | ||
309 | '+' - greater than 1 microsecond | ||
310 | ' ' - less than or equal to 1 microsecond. | ||
311 | |||
312 | The rest is the same as the 'trace' file. | ||
313 | |||
314 | |||
315 | iter_ctrl | ||
316 | --------- | ||
317 | |||
318 | The iter_ctrl file is used to control what gets printed in the trace | ||
319 | output. To see what is available, simply cat the file: | ||
320 | |||
321 | cat /debug/tracing/iter_ctrl | ||
322 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ | ||
323 | noblock nostacktrace nosched-tree | ||
324 | |||
325 | To disable one of the options, echo in the option appended with "no". | ||
326 | |||
327 | echo noprint-parent > /debug/tracing/iter_ctrl | ||
328 | |||
329 | To enable an option, leave off the "no". | ||
330 | |||
331 | echo sym-offest > /debug/tracing/iter_ctrl | ||
332 | |||
333 | Here are the available options: | ||
334 | |||
335 | print-parent - On function traces, display the calling function | ||
336 | as well as the function being traced. | ||
337 | |||
338 | print-parent: | ||
339 | bash-4000 [01] 1477.606694: simple_strtoul <-strict_strtoul | ||
340 | |||
341 | noprint-parent: | ||
342 | bash-4000 [01] 1477.606694: simple_strtoul | ||
343 | |||
344 | |||
345 | sym-offset - Display not only the function name, but also the offset | ||
346 | in the function. For example, instead of seeing just | ||
347 | "ktime_get" you will see "ktime_get+0xb/0x20" | ||
348 | |||
349 | sym-offset: | ||
350 | bash-4000 [01] 1477.606694: simple_strtoul+0x6/0xa0 | ||
351 | |||
352 | sym-addr - this will also display the function address as well as | ||
353 | the function name. | ||
354 | |||
355 | sym-addr: | ||
356 | bash-4000 [01] 1477.606694: simple_strtoul <c0339346> | ||
357 | |||
358 | verbose - This deals with the latency_trace file. | ||
359 | |||
360 | bash 4000 1 0 00000000 00010a95 [58127d26] 1720.415ms \ | ||
361 | (+0.000ms): simple_strtoul (strict_strtoul) | ||
362 | |||
363 | raw - This will display raw numbers. This option is best for use with | ||
364 | user applications that can translate the raw numbers better than | ||
365 | having it done in the kernel. | ||
366 | |||
367 | hex - similar to raw, but the numbers will be in a hexadecimal format. | ||
368 | |||
369 | bin - This will print out the formats in raw binary. | ||
370 | |||
371 | block - TBD (needs update) | ||
372 | |||
373 | stacktrace - This is one of the options that changes the trace itself. | ||
374 | When a trace is recorded, so is the stack of functions. | ||
375 | This allows for back traces of trace sites. | ||
376 | |||
377 | sched-tree - TBD (any users??) | ||
378 | |||
379 | |||
380 | sched_switch | ||
381 | ------------ | ||
382 | |||
383 | This tracer simply records schedule switches. Here's an example | ||
384 | on how to implement it. | ||
385 | |||
386 | # echo sched_switch > /debug/tracing/current_tracer | ||
387 | # echo 1 > /debug/tracing/tracing_enabled | ||
388 | # sleep 1 | ||
389 | # echo 0 > /debug/tracing/tracing_enabled | ||
390 | # cat /debug/tracing/trace | ||
391 | |||
392 | # tracer: sched_switch | ||
393 | # | ||
394 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
395 | # | | | | | | ||
396 | bash-3997 [01] 240.132281: 3997:120:R + 4055:120:R | ||
397 | bash-3997 [01] 240.132284: 3997:120:R ==> 4055:120:R | ||
398 | sleep-4055 [01] 240.132371: 4055:120:S ==> 3997:120:R | ||
399 | bash-3997 [01] 240.132454: 3997:120:R + 4055:120:S | ||
400 | bash-3997 [01] 240.132457: 3997:120:R ==> 4055:120:R | ||
401 | sleep-4055 [01] 240.132460: 4055:120:D ==> 3997:120:R | ||
402 | bash-3997 [01] 240.132463: 3997:120:R + 4055:120:D | ||
403 | bash-3997 [01] 240.132465: 3997:120:R ==> 4055:120:R | ||
404 | <idle>-0 [00] 240.132589: 0:140:R + 4:115:S | ||
405 | <idle>-0 [00] 240.132591: 0:140:R ==> 4:115:R | ||
406 | ksoftirqd/0-4 [00] 240.132595: 4:115:S ==> 0:140:R | ||
407 | <idle>-0 [00] 240.132598: 0:140:R + 4:115:S | ||
408 | <idle>-0 [00] 240.132599: 0:140:R ==> 4:115:R | ||
409 | ksoftirqd/0-4 [00] 240.132603: 4:115:S ==> 0:140:R | ||
410 | sleep-4055 [01] 240.133058: 4055:120:S ==> 3997:120:R | ||
411 | [...] | ||
412 | |||
413 | |||
414 | As we have discussed previously about this format, the header shows | ||
415 | the name of the trace and points to the options. The "FUNCTION" | ||
416 | is a misnomer since here it represents the wake ups and context | ||
417 | switches. | ||
418 | |||
419 | The sched_switch only lists the wake ups (represented with '+') | ||
420 | and context switches ('==>') with the previous task or current | ||
421 | first followed by the next task or task waking up. The format for both | ||
422 | of these is PID:KERNEL-PRIO:TASK-STATE. Remember that the KERNEL-PRIO | ||
423 | is the inverse of the actual priority with zero (0) being the highest | ||
424 | priority and the nice values starting at 100 (nice -20). Below is | ||
425 | a quick chart to map the kernel priority to user land priorities. | ||
426 | |||
427 | Kernel priority: 0 to 99 ==> user RT priority 99 to 0 | ||
428 | Kernel priority: 100 to 139 ==> user nice -20 to 19 | ||
429 | Kernel priority: 140 ==> idle task priority | ||
430 | |||
431 | The task states are: | ||
432 | |||
433 | R - running : wants to run, may not actually be running | ||
434 | S - sleep : process is waiting to be woken up (handles signals) | ||
435 | D - deep sleep : process must be woken up (ignores signals) | ||
436 | T - stopped : process suspended | ||
437 | t - traced : process is being traced (with something like gdb) | ||
438 | Z - zombie : process waiting to be cleaned up | ||
439 | X - unknown | ||
440 | |||
441 | |||
442 | ftrace_enabled | ||
443 | -------------- | ||
444 | |||
445 | The following tracers give different output depending on whether | ||
446 | or not the sysctl ftrace_enabled is set. To set ftrace_enabled, | ||
447 | one can either use the sysctl function or set it via the proc | ||
448 | file system interface. | ||
449 | |||
450 | sysctl kernel.ftrace_enabled=1 | ||
451 | |||
452 | or | ||
453 | |||
454 | echo 1 > /proc/sys/kernel/ftrace_enabled | ||
455 | |||
456 | To disable ftrace_enabled simply replace the '1' with '0' in | ||
457 | the above commands. | ||
458 | |||
459 | When ftrace_enabled is set the tracers will also record the functions | ||
460 | that are within the trace. The descriptions of the tracers | ||
461 | will also show an example with ftrace enabled. | ||
462 | |||
463 | |||
464 | irqsoff | ||
465 | ------- | ||
466 | |||
467 | When interrupts are disabled, the CPU can not react to any other | ||
468 | external event (besides NMIs and SMIs). This prevents the timer | ||
469 | interrupt from triggering or the mouse interrupt from letting the | ||
470 | kernel know of a new mouse event. The result is a latency with the | ||
471 | reaction time. | ||
472 | |||
473 | The irqsoff tracer tracks the time interrupts are disabled and when | ||
474 | they are re-enabled. When a new maximum latency is hit, it saves off | ||
475 | the trace so that it may be retrieved at a later time. Every time a | ||
476 | new maximum in reached, the old saved trace is discarded and the new | ||
477 | trace is saved. | ||
478 | |||
479 | To reset the maximum, echo 0 into tracing_max_latency. Here's an | ||
480 | example: | ||
481 | |||
482 | # echo irqsoff > /debug/tracing/current_tracer | ||
483 | # echo 0 > /debug/tracing/tracing_max_latency | ||
484 | # echo 1 > /debug/tracing/tracing_enabled | ||
485 | # ls -ltr | ||
486 | [...] | ||
487 | # echo 0 > /debug/tracing/tracing_enabled | ||
488 | # cat /debug/tracing/latency_trace | ||
489 | # tracer: irqsoff | ||
490 | # | ||
491 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
492 | -------------------------------------------------------------------- | ||
493 | latency: 6 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
494 | ----------------- | ||
495 | | task: bash-4269 (uid:0 nice:0 policy:0 rt_prio:0) | ||
496 | ----------------- | ||
497 | => started at: copy_page_range | ||
498 | => ended at: copy_page_range | ||
499 | |||
500 | # _------=> CPU# | ||
501 | # / _-----=> irqs-off | ||
502 | # | / _----=> need-resched | ||
503 | # || / _---=> hardirq/softirq | ||
504 | # ||| / _--=> preempt-depth | ||
505 | # |||| / | ||
506 | # ||||| delay | ||
507 | # cmd pid ||||| time | caller | ||
508 | # \ / ||||| \ | / | ||
509 | bash-4269 1...1 0us+: _spin_lock (copy_page_range) | ||
510 | bash-4269 1...1 7us : _spin_unlock (copy_page_range) | ||
511 | bash-4269 1...2 7us : trace_preempt_on (copy_page_range) | ||
512 | |||
513 | |||
514 | vim:ft=help | ||
515 | |||
516 | Here we see that that we had a latency of 6 microsecs (which is | ||
517 | very good). The spin_lock in copy_page_range disabled interrupts. | ||
518 | The difference between the 6 and the displayed timestamp 7us is | ||
519 | because the clock must have incremented between the time of recording | ||
520 | the max latency and recording the function that had that latency. | ||
521 | |||
522 | Note the above had ftrace_enabled not set. If we set the ftrace_enabled | ||
523 | we get a much larger output: | ||
524 | |||
525 | # tracer: irqsoff | ||
526 | # | ||
527 | irqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
528 | -------------------------------------------------------------------- | ||
529 | latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
530 | ----------------- | ||
531 | | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0) | ||
532 | ----------------- | ||
533 | => started at: __alloc_pages_internal | ||
534 | => ended at: __alloc_pages_internal | ||
535 | |||
536 | # _------=> CPU# | ||
537 | # / _-----=> irqs-off | ||
538 | # | / _----=> need-resched | ||
539 | # || / _---=> hardirq/softirq | ||
540 | # ||| / _--=> preempt-depth | ||
541 | # |||| / | ||
542 | # ||||| delay | ||
543 | # cmd pid ||||| time | caller | ||
544 | # \ / ||||| \ | / | ||
545 | ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal) | ||
546 | ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist) | ||
547 | ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk) | ||
548 | ls-4339 0d..1 4us : add_preempt_count (_spin_lock) | ||
549 | ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk) | ||
550 | ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue) | ||
551 | ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest) | ||
552 | ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk) | ||
553 | ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue) | ||
554 | ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest) | ||
555 | ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk) | ||
556 | ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue) | ||
557 | [...] | ||
558 | ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue) | ||
559 | ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest) | ||
560 | ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk) | ||
561 | ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue) | ||
562 | ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest) | ||
563 | ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk) | ||
564 | ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock) | ||
565 | ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal) | ||
566 | ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal) | ||
567 | |||
568 | |||
569 | vim:ft=help | ||
570 | |||
571 | |||
572 | Here we traced a 50 microsecond latency. But we also see all the | ||
573 | functions that were called during that time. Note that enabling | ||
574 | function tracing we endure an added overhead. This overhead may | ||
575 | extend the latency times. But never the less, this trace has provided | ||
576 | some very helpful debugging. | ||
577 | |||
578 | |||
579 | preemptoff | ||
580 | ---------- | ||
581 | |||
582 | When preemption is disabled we may be able to receive interrupts but | ||
583 | the task can not be preempted and a higher priority task must wait | ||
584 | for preemption to be enabled again before it can preempt a lower | ||
585 | priority task. | ||
586 | |||
587 | The preemptoff tracer traces the places that disables preemption. | ||
588 | Like the irqsoff, it records the maximum latency that preemption | ||
589 | was disabled. The control of preemptoff is much like the irqsoff. | ||
590 | |||
591 | # echo preemptoff > /debug/tracing/current_tracer | ||
592 | # echo 0 > /debug/tracing/tracing_max_latency | ||
593 | # echo 1 > /debug/tracing/tracing_enabled | ||
594 | # ls -ltr | ||
595 | [...] | ||
596 | # echo 0 > /debug/tracing/tracing_enabled | ||
597 | # cat /debug/tracing/latency_trace | ||
598 | # tracer: preemptoff | ||
599 | # | ||
600 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | ||
601 | -------------------------------------------------------------------- | ||
602 | latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
603 | ----------------- | ||
604 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
605 | ----------------- | ||
606 | => started at: do_IRQ | ||
607 | => ended at: __do_softirq | ||
608 | |||
609 | # _------=> CPU# | ||
610 | # / _-----=> irqs-off | ||
611 | # | / _----=> need-resched | ||
612 | # || / _---=> hardirq/softirq | ||
613 | # ||| / _--=> preempt-depth | ||
614 | # |||| / | ||
615 | # ||||| delay | ||
616 | # cmd pid ||||| time | caller | ||
617 | # \ / ||||| \ | / | ||
618 | sshd-4261 0d.h. 0us+: irq_enter (do_IRQ) | ||
619 | sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq) | ||
620 | sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq) | ||
621 | |||
622 | |||
623 | vim:ft=help | ||
624 | |||
625 | This has some more changes. Preemption was disabled when an interrupt | ||
626 | came in (notice the 'h'), and was enabled while doing a softirq. | ||
627 | (notice the 's'). But we also see that interrupts have been disabled | ||
628 | when entering the preempt off section and leaving it (the 'd'). | ||
629 | We do not know if interrupts were enabled in the mean time. | ||
630 | |||
631 | # tracer: preemptoff | ||
632 | # | ||
633 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | ||
634 | -------------------------------------------------------------------- | ||
635 | latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
636 | ----------------- | ||
637 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
638 | ----------------- | ||
639 | => started at: remove_wait_queue | ||
640 | => ended at: __do_softirq | ||
641 | |||
642 | # _------=> CPU# | ||
643 | # / _-----=> irqs-off | ||
644 | # | / _----=> need-resched | ||
645 | # || / _---=> hardirq/softirq | ||
646 | # ||| / _--=> preempt-depth | ||
647 | # |||| / | ||
648 | # ||||| delay | ||
649 | # cmd pid ||||| time | caller | ||
650 | # \ / ||||| \ | / | ||
651 | sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue) | ||
652 | sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue) | ||
653 | sshd-4261 0d..1 2us : do_IRQ (common_interrupt) | ||
654 | sshd-4261 0d..1 2us : irq_enter (do_IRQ) | ||
655 | sshd-4261 0d..1 2us : idle_cpu (irq_enter) | ||
656 | sshd-4261 0d..1 3us : add_preempt_count (irq_enter) | ||
657 | sshd-4261 0d.h1 3us : idle_cpu (irq_enter) | ||
658 | sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ) | ||
659 | [...] | ||
660 | sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock) | ||
661 | sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq) | ||
662 | sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq) | ||
663 | sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq) | ||
664 | sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock) | ||
665 | sshd-4261 0d.h1 14us : irq_exit (do_IRQ) | ||
666 | sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit) | ||
667 | sshd-4261 0d..2 15us : do_softirq (irq_exit) | ||
668 | sshd-4261 0d... 15us : __do_softirq (do_softirq) | ||
669 | sshd-4261 0d... 16us : __local_bh_disable (__do_softirq) | ||
670 | sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable) | ||
671 | sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable) | ||
672 | sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable) | ||
673 | sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable) | ||
674 | [...] | ||
675 | sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable) | ||
676 | sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable) | ||
677 | sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable) | ||
678 | sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable) | ||
679 | sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip) | ||
680 | sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip) | ||
681 | sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable) | ||
682 | sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable) | ||
683 | [...] | ||
684 | sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq) | ||
685 | sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq) | ||
686 | |||
687 | |||
688 | The above is an example of the preemptoff trace with ftrace_enabled | ||
689 | set. Here we see that interrupts were disabled the entire time. | ||
690 | The irq_enter code lets us know that we entered an interrupt 'h'. | ||
691 | Before that, the functions being traced still show that it is not | ||
692 | in an interrupt, but we can see by the functions themselves that | ||
693 | this is not the case. | ||
694 | |||
695 | Notice that the __do_softirq when called doesn't have a preempt_count. | ||
696 | It may seem that we missed a preempt enabled. What really happened | ||
697 | is that the preempt count is held on the threads stack and we | ||
698 | switched to the softirq stack (4K stacks in effect). The code | ||
699 | does not copy the preempt count, but because interrupts are disabled | ||
700 | we don't need to worry about it. Having a tracer like this is good | ||
701 | to let people know what really happens inside the kernel. | ||
702 | |||
703 | |||
704 | preemptirqsoff | ||
705 | -------------- | ||
706 | |||
707 | Knowing the locations that have interrupts disabled or preemption | ||
708 | disabled for the longest times is helpful. But sometimes we would | ||
709 | like to know when either preemption and/or interrupts are disabled. | ||
710 | |||
711 | The following code: | ||
712 | |||
713 | local_irq_disable(); | ||
714 | call_function_with_irqs_off(); | ||
715 | preempt_disable(); | ||
716 | call_function_with_irqs_and_preemption_off(); | ||
717 | local_irq_enable(); | ||
718 | call_function_with_preemption_off(); | ||
719 | preempt_enable(); | ||
720 | |||
721 | The irqsoff tracer will record the total length of | ||
722 | call_function_with_irqs_off() and | ||
723 | call_function_with_irqs_and_preemption_off(). | ||
724 | |||
725 | The preemptoff tracer will record the total length of | ||
726 | call_function_with_irqs_and_preemption_off() and | ||
727 | call_function_with_preemption_off(). | ||
728 | |||
729 | But neither will trace the time that interrupts and/or preemption | ||
730 | is disabled. This total time is the time that we can not schedule. | ||
731 | To record this time, use the preemptirqsoff tracer. | ||
732 | |||
733 | Again, using this trace is much like the irqsoff and preemptoff tracers. | ||
734 | |||
735 | # echo preemptoff > /debug/tracing/current_tracer | ||
736 | # echo 0 > /debug/tracing/tracing_max_latency | ||
737 | # echo 1 > /debug/tracing/tracing_enabled | ||
738 | # ls -ltr | ||
739 | [...] | ||
740 | # echo 0 > /debug/tracing/tracing_enabled | ||
741 | # cat /debug/tracing/latency_trace | ||
742 | # tracer: preemptirqsoff | ||
743 | # | ||
744 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
745 | -------------------------------------------------------------------- | ||
746 | latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
747 | ----------------- | ||
748 | | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0) | ||
749 | ----------------- | ||
750 | => started at: apic_timer_interrupt | ||
751 | => ended at: __do_softirq | ||
752 | |||
753 | # _------=> CPU# | ||
754 | # / _-----=> irqs-off | ||
755 | # | / _----=> need-resched | ||
756 | # || / _---=> hardirq/softirq | ||
757 | # ||| / _--=> preempt-depth | ||
758 | # |||| / | ||
759 | # ||||| delay | ||
760 | # cmd pid ||||| time | caller | ||
761 | # \ / ||||| \ | / | ||
762 | ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt) | ||
763 | ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq) | ||
764 | ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq) | ||
765 | |||
766 | |||
767 | vim:ft=help | ||
768 | |||
769 | |||
770 | The trace_hardirqs_off_thunk is called from assembly on x86 when | ||
771 | interrupts are disabled in the assembly code. Without the function | ||
772 | tracing, we don't know if interrupts were enabled within the preemption | ||
773 | points. We do see that it started with preemption enabled. | ||
774 | |||
775 | Here is a trace with ftrace_enabled set: | ||
776 | |||
777 | |||
778 | # tracer: preemptirqsoff | ||
779 | # | ||
780 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | ||
781 | -------------------------------------------------------------------- | ||
782 | latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
783 | ----------------- | ||
784 | | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0) | ||
785 | ----------------- | ||
786 | => started at: write_chan | ||
787 | => ended at: __do_softirq | ||
788 | |||
789 | # _------=> CPU# | ||
790 | # / _-----=> irqs-off | ||
791 | # | / _----=> need-resched | ||
792 | # || / _---=> hardirq/softirq | ||
793 | # ||| / _--=> preempt-depth | ||
794 | # |||| / | ||
795 | # ||||| delay | ||
796 | # cmd pid ||||| time | caller | ||
797 | # \ / ||||| \ | / | ||
798 | ls-4473 0.N.. 0us : preempt_schedule (write_chan) | ||
799 | ls-4473 0dN.1 1us : _spin_lock (schedule) | ||
800 | ls-4473 0dN.1 2us : add_preempt_count (_spin_lock) | ||
801 | ls-4473 0d..2 2us : put_prev_task_fair (schedule) | ||
802 | [...] | ||
803 | ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts) | ||
804 | ls-4473 0d..2 13us : __switch_to (schedule) | ||
805 | sshd-4261 0d..2 14us : finish_task_switch (schedule) | ||
806 | sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch) | ||
807 | sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave) | ||
808 | sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set) | ||
809 | sshd-4261 0d..2 16us : do_IRQ (common_interrupt) | ||
810 | sshd-4261 0d..2 17us : irq_enter (do_IRQ) | ||
811 | sshd-4261 0d..2 17us : idle_cpu (irq_enter) | ||
812 | sshd-4261 0d..2 18us : add_preempt_count (irq_enter) | ||
813 | sshd-4261 0d.h2 18us : idle_cpu (irq_enter) | ||
814 | sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ) | ||
815 | sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq) | ||
816 | sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock) | ||
817 | sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq) | ||
818 | sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock) | ||
819 | [...] | ||
820 | sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq) | ||
821 | sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock) | ||
822 | sshd-4261 0d.h2 29us : irq_exit (do_IRQ) | ||
823 | sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit) | ||
824 | sshd-4261 0d..3 30us : do_softirq (irq_exit) | ||
825 | sshd-4261 0d... 30us : __do_softirq (do_softirq) | ||
826 | sshd-4261 0d... 31us : __local_bh_disable (__do_softirq) | ||
827 | sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable) | ||
828 | sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable) | ||
829 | [...] | ||
830 | sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip) | ||
831 | sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip) | ||
832 | sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt) | ||
833 | sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt) | ||
834 | sshd-4261 0d.s3 45us : idle_cpu (irq_enter) | ||
835 | sshd-4261 0d.s3 46us : add_preempt_count (irq_enter) | ||
836 | sshd-4261 0d.H3 46us : idle_cpu (irq_enter) | ||
837 | sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt) | ||
838 | sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt) | ||
839 | [...] | ||
840 | sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt) | ||
841 | sshd-4261 0d.H3 82us : ktime_get (tick_program_event) | ||
842 | sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get) | ||
843 | sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts) | ||
844 | sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts) | ||
845 | sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event) | ||
846 | sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event) | ||
847 | sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt) | ||
848 | sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit) | ||
849 | sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit) | ||
850 | sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable) | ||
851 | [...] | ||
852 | sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action) | ||
853 | sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq) | ||
854 | sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq) | ||
855 | sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq) | ||
856 | sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable) | ||
857 | sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq) | ||
858 | sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq) | ||
859 | |||
860 | |||
861 | This is a very interesting trace. It started with the preemption of | ||
862 | the ls task. We see that the task had the "need_resched" bit set | ||
863 | with the 'N' in the trace. Interrupts are disabled in the spin_lock | ||
864 | and the trace started. We see that a schedule took place to run | ||
865 | sshd. When the interrupts were enabled we took an interrupt. | ||
866 | On return of the interrupt the softirq ran. We took another interrupt | ||
867 | while running the softirq as we see with the capital 'H'. | ||
868 | |||
869 | |||
870 | wakeup | ||
871 | ------ | ||
872 | |||
873 | In Real-Time environment it is very important to know the wakeup | ||
874 | time it takes for the highest priority task that wakes up to the | ||
875 | time it executes. This is also known as "schedule latency". | ||
876 | I stress the point that this is about RT tasks. It is also important | ||
877 | to know the scheduling latency of non-RT tasks, but the average | ||
878 | schedule latency is better for non-RT tasks. Tools like | ||
879 | LatencyTop is more appropriate for such measurements. | ||
880 | |||
881 | Real-Time environments is interested in the worst case latency. | ||
882 | That is the longest latency it takes for something to happen, and | ||
883 | not the average. We can have a very fast scheduler that may only | ||
884 | have a large latency once in a while, but that would not work well | ||
885 | with Real-Time tasks. The wakeup tracer was designed to record | ||
886 | the worst case wakeups of RT tasks. Non-RT tasks are not recorded | ||
887 | because the tracer only records one worst case and tracing non-RT | ||
888 | tasks that are unpredictable will overwrite the worst case latency | ||
889 | of RT tasks. | ||
890 | |||
891 | Since this tracer only deals with RT tasks, we will run this slightly | ||
892 | different than we did with the previous tracers. Instead of performing | ||
893 | an 'ls' we will run 'sleep 1' under 'chrt' which changes the | ||
894 | priority of the task. | ||
895 | |||
896 | # echo wakeup > /debug/tracing/current_tracer | ||
897 | # echo 0 > /debug/tracing/tracing_max_latency | ||
898 | # echo 1 > /debug/tracing/tracing_enabled | ||
899 | # chrt -f 5 sleep 1 | ||
900 | # echo 0 > /debug/tracing/tracing_enabled | ||
901 | # cat /debug/tracing/latency_trace | ||
902 | # tracer: wakeup | ||
903 | # | ||
904 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | ||
905 | -------------------------------------------------------------------- | ||
906 | latency: 4 us, #2/2, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
907 | ----------------- | ||
908 | | task: sleep-4901 (uid:0 nice:0 policy:1 rt_prio:5) | ||
909 | ----------------- | ||
910 | |||
911 | # _------=> CPU# | ||
912 | # / _-----=> irqs-off | ||
913 | # | / _----=> need-resched | ||
914 | # || / _---=> hardirq/softirq | ||
915 | # ||| / _--=> preempt-depth | ||
916 | # |||| / | ||
917 | # ||||| delay | ||
918 | # cmd pid ||||| time | caller | ||
919 | # \ / ||||| \ | / | ||
920 | <idle>-0 1d.h4 0us+: try_to_wake_up (wake_up_process) | ||
921 | <idle>-0 1d..4 4us : schedule (cpu_idle) | ||
922 | |||
923 | |||
924 | vim:ft=help | ||
925 | |||
926 | |||
927 | Running this on an idle system we see that it only took 4 microseconds | ||
928 | to perform the task switch. Note, since the trace marker in the | ||
929 | schedule is before the actual "switch" we stop the tracing when | ||
930 | the recorded task is about to schedule in. This may change if | ||
931 | we add a new marker at the end of the scheduler. | ||
932 | |||
933 | Notice that the recorded task is 'sleep' with the PID of 4901 and it | ||
934 | has an rt_prio of 5. This priority is user-space priority and not | ||
935 | the internal kernel priority. The policy is 1 for SCHED_FIFO and 2 | ||
936 | for SCHED_RR. | ||
937 | |||
938 | Doing the same with chrt -r 5 and ftrace_enabled set. | ||
939 | |||
940 | # tracer: wakeup | ||
941 | # | ||
942 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | ||
943 | -------------------------------------------------------------------- | ||
944 | latency: 50 us, #60/60, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2) | ||
945 | ----------------- | ||
946 | | task: sleep-4068 (uid:0 nice:0 policy:2 rt_prio:5) | ||
947 | ----------------- | ||
948 | |||
949 | # _------=> CPU# | ||
950 | # / _-----=> irqs-off | ||
951 | # | / _----=> need-resched | ||
952 | # || / _---=> hardirq/softirq | ||
953 | # ||| / _--=> preempt-depth | ||
954 | # |||| / | ||
955 | # ||||| delay | ||
956 | # cmd pid ||||| time | caller | ||
957 | # \ / ||||| \ | / | ||
958 | ksoftirq-7 1d.H3 0us : try_to_wake_up (wake_up_process) | ||
959 | ksoftirq-7 1d.H4 1us : sub_preempt_count (marker_probe_cb) | ||
960 | ksoftirq-7 1d.H3 2us : check_preempt_wakeup (try_to_wake_up) | ||
961 | ksoftirq-7 1d.H3 3us : update_curr (check_preempt_wakeup) | ||
962 | ksoftirq-7 1d.H3 4us : calc_delta_mine (update_curr) | ||
963 | ksoftirq-7 1d.H3 5us : __resched_task (check_preempt_wakeup) | ||
964 | ksoftirq-7 1d.H3 6us : task_wake_up_rt (try_to_wake_up) | ||
965 | ksoftirq-7 1d.H3 7us : _spin_unlock_irqrestore (try_to_wake_up) | ||
966 | [...] | ||
967 | ksoftirq-7 1d.H2 17us : irq_exit (smp_apic_timer_interrupt) | ||
968 | ksoftirq-7 1d.H2 18us : sub_preempt_count (irq_exit) | ||
969 | ksoftirq-7 1d.s3 19us : sub_preempt_count (irq_exit) | ||
970 | ksoftirq-7 1..s2 20us : rcu_process_callbacks (__do_softirq) | ||
971 | [...] | ||
972 | ksoftirq-7 1..s2 26us : __rcu_process_callbacks (rcu_process_callbacks) | ||
973 | ksoftirq-7 1d.s2 27us : _local_bh_enable (__do_softirq) | ||
974 | ksoftirq-7 1d.s2 28us : sub_preempt_count (_local_bh_enable) | ||
975 | ksoftirq-7 1.N.3 29us : sub_preempt_count (ksoftirqd) | ||
976 | ksoftirq-7 1.N.2 30us : _cond_resched (ksoftirqd) | ||
977 | ksoftirq-7 1.N.2 31us : __cond_resched (_cond_resched) | ||
978 | ksoftirq-7 1.N.2 32us : add_preempt_count (__cond_resched) | ||
979 | ksoftirq-7 1.N.2 33us : schedule (__cond_resched) | ||
980 | ksoftirq-7 1.N.2 33us : add_preempt_count (schedule) | ||
981 | ksoftirq-7 1.N.3 34us : hrtick_clear (schedule) | ||
982 | ksoftirq-7 1dN.3 35us : _spin_lock (schedule) | ||
983 | ksoftirq-7 1dN.3 36us : add_preempt_count (_spin_lock) | ||
984 | ksoftirq-7 1d..4 37us : put_prev_task_fair (schedule) | ||
985 | ksoftirq-7 1d..4 38us : update_curr (put_prev_task_fair) | ||
986 | [...] | ||
987 | ksoftirq-7 1d..5 47us : _spin_trylock (tracing_record_cmdline) | ||
988 | ksoftirq-7 1d..5 48us : add_preempt_count (_spin_trylock) | ||
989 | ksoftirq-7 1d..6 49us : _spin_unlock (tracing_record_cmdline) | ||
990 | ksoftirq-7 1d..6 49us : sub_preempt_count (_spin_unlock) | ||
991 | ksoftirq-7 1d..4 50us : schedule (__cond_resched) | ||
992 | |||
993 | The interrupt went off while running ksoftirqd. This task runs at | ||
994 | SCHED_OTHER. Why didn't we see the 'N' set early? This may be | ||
995 | a harmless bug with x86_32 and 4K stacks. The need_reched() function | ||
996 | that tests if we need to reschedule looks on the actual stack. | ||
997 | Where as the setting of the NEED_RESCHED bit happens on the | ||
998 | task's stack. But because we are in a hard interrupt, the test | ||
999 | is with the interrupts stack which has that to be false. We don't | ||
1000 | see the 'N' until we switch back to the task's stack. | ||
1001 | |||
1002 | ftrace | ||
1003 | ------ | ||
1004 | |||
1005 | ftrace is not only the name of the tracing infrastructure, but it | ||
1006 | is also a name of one of the tracers. The tracer is the function | ||
1007 | tracer. Enabling the function tracer can be done from the | ||
1008 | debug file system. Make sure the ftrace_enabled is set otherwise | ||
1009 | this tracer is a nop. | ||
1010 | |||
1011 | # sysctl kernel.ftrace_enabled=1 | ||
1012 | # echo ftrace > /debug/tracing/current_tracer | ||
1013 | # echo 1 > /debug/tracing/tracing_enabled | ||
1014 | # usleep 1 | ||
1015 | # echo 0 > /debug/tracing/tracing_enabled | ||
1016 | # cat /debug/tracing/trace | ||
1017 | # tracer: ftrace | ||
1018 | # | ||
1019 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1020 | # | | | | | | ||
1021 | bash-4003 [00] 123.638713: finish_task_switch <-schedule | ||
1022 | bash-4003 [00] 123.638714: _spin_unlock_irq <-finish_task_switch | ||
1023 | bash-4003 [00] 123.638714: sub_preempt_count <-_spin_unlock_irq | ||
1024 | bash-4003 [00] 123.638715: hrtick_set <-schedule | ||
1025 | bash-4003 [00] 123.638715: _spin_lock_irqsave <-hrtick_set | ||
1026 | bash-4003 [00] 123.638716: add_preempt_count <-_spin_lock_irqsave | ||
1027 | bash-4003 [00] 123.638716: _spin_unlock_irqrestore <-hrtick_set | ||
1028 | bash-4003 [00] 123.638717: sub_preempt_count <-_spin_unlock_irqrestore | ||
1029 | bash-4003 [00] 123.638717: hrtick_clear <-hrtick_set | ||
1030 | bash-4003 [00] 123.638718: sub_preempt_count <-schedule | ||
1031 | bash-4003 [00] 123.638718: sub_preempt_count <-preempt_schedule | ||
1032 | bash-4003 [00] 123.638719: wait_for_completion <-__stop_machine_run | ||
1033 | bash-4003 [00] 123.638719: wait_for_common <-wait_for_completion | ||
1034 | bash-4003 [00] 123.638720: _spin_lock_irq <-wait_for_common | ||
1035 | bash-4003 [00] 123.638720: add_preempt_count <-_spin_lock_irq | ||
1036 | [...] | ||
1037 | |||
1038 | |||
1039 | Note: It is sometimes better to enable or disable tracing directly from | ||
1040 | a program, because the buffer may be overflowed by the echo commands | ||
1041 | before you get to the point you want to trace. It is also easier to | ||
1042 | stop the tracing at the point that you hit the part that you are | ||
1043 | interested in. Since the ftrace buffer is a ring buffer with the | ||
1044 | oldest data being overwritten, usually it is sufficient to start the | ||
1045 | tracer with an echo command but have you code stop it. Something | ||
1046 | like the following is usually appropriate for this. | ||
1047 | |||
1048 | int trace_fd; | ||
1049 | [...] | ||
1050 | int main(int argc, char *argv[]) { | ||
1051 | [...] | ||
1052 | trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY); | ||
1053 | [...] | ||
1054 | if (condition_hit()) { | ||
1055 | write(trace_fd, "0", 1); | ||
1056 | } | ||
1057 | [...] | ||
1058 | } | ||
1059 | |||
1060 | |||
1061 | dynamic ftrace | ||
1062 | -------------- | ||
1063 | |||
1064 | If CONFIG_DYNAMIC_FTRACE is set, then the system will run with | ||
1065 | virtually no overhead when function tracing is disabled. The way | ||
1066 | this works is the mcount function call (placed at the start of | ||
1067 | every kernel function, produced by the -pg switch in gcc), starts | ||
1068 | of pointing to a simple return. | ||
1069 | |||
1070 | When dynamic ftrace is initialized, it calls kstop_machine to make it | ||
1071 | act like a uniprocessor so that it can freely modify code without | ||
1072 | worrying about other processors executing that same code. At | ||
1073 | initialization, the mcount calls are change to call a "record_ip" | ||
1074 | function. After this, the first time a kernel function is called, | ||
1075 | it has the calling address saved in a hash table. | ||
1076 | |||
1077 | Later on the ftraced kernel thread is awoken and will again call | ||
1078 | kstop_machine if new functions have been recorded. The ftraced thread | ||
1079 | will change all calls to mcount to "nop". Just calling mcount | ||
1080 | and having mcount return has shown a 10% overhead. By converting | ||
1081 | it to a nop, there is no recordable overhead to the system. | ||
1082 | |||
1083 | One special side-effect to the recording of the functions being | ||
1084 | traced, is that we can now selectively choose which functions we | ||
1085 | want to trace and which ones we want the mcount calls to remain as | ||
1086 | nops. | ||
1087 | |||
1088 | Two files that contain to the enabling and disabling of recorded | ||
1089 | functions are: | ||
1090 | |||
1091 | set_ftrace_filter | ||
1092 | |||
1093 | and | ||
1094 | |||
1095 | set_ftrace_notrace | ||
1096 | |||
1097 | A list of available functions that you can add to this files is listed | ||
1098 | in: | ||
1099 | |||
1100 | available_filter_functions | ||
1101 | |||
1102 | # cat /debug/tracing/available_filter_functions | ||
1103 | put_prev_task_idle | ||
1104 | kmem_cache_create | ||
1105 | pick_next_task_rt | ||
1106 | get_online_cpus | ||
1107 | pick_next_task_fair | ||
1108 | mutex_lock | ||
1109 | [...] | ||
1110 | |||
1111 | If I'm only interested in sys_nanosleep and hrtimer_interrupt: | ||
1112 | |||
1113 | # echo sys_nanosleep hrtimer_interrupt \ | ||
1114 | > /debug/tracing/set_ftrace_filter | ||
1115 | # echo ftrace > /debug/tracing/current_tracer | ||
1116 | # echo 1 > /debug/tracing/tracing_enabled | ||
1117 | # usleep 1 | ||
1118 | # echo 0 > /debug/tracing/tracing_enabled | ||
1119 | # cat /debug/tracing/trace | ||
1120 | # tracer: ftrace | ||
1121 | # | ||
1122 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1123 | # | | | | | | ||
1124 | usleep-4134 [00] 1317.070017: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
1125 | usleep-4134 [00] 1317.070111: sys_nanosleep <-syscall_call | ||
1126 | <idle>-0 [00] 1317.070115: hrtimer_interrupt <-smp_apic_timer_interrupt | ||
1127 | |||
1128 | To see what functions are being traced, you can cat the file: | ||
1129 | |||
1130 | # cat /debug/tracing/set_ftrace_filter | ||
1131 | hrtimer_interrupt | ||
1132 | sys_nanosleep | ||
1133 | |||
1134 | |||
1135 | Perhaps this isn't enough. The filters also allow simple wild cards. | ||
1136 | Only the following is currently available | ||
1137 | |||
1138 | <match>* - will match functions that begins with <match> | ||
1139 | *<match> - will match functions that end with <match> | ||
1140 | *<match>* - will match functions that have <match> in it | ||
1141 | |||
1142 | Thats all the wild cards that are allowed. | ||
1143 | |||
1144 | <match>*<match> will not work. | ||
1145 | |||
1146 | # echo hrtimer_* > /debug/tracing/set_ftrace_filter | ||
1147 | |||
1148 | Produces: | ||
1149 | |||
1150 | # tracer: ftrace | ||
1151 | # | ||
1152 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1153 | # | | | | | | ||
1154 | bash-4003 [00] 1480.611794: hrtimer_init <-copy_process | ||
1155 | bash-4003 [00] 1480.611941: hrtimer_start <-hrtick_set | ||
1156 | bash-4003 [00] 1480.611956: hrtimer_cancel <-hrtick_clear | ||
1157 | bash-4003 [00] 1480.611956: hrtimer_try_to_cancel <-hrtimer_cancel | ||
1158 | <idle>-0 [00] 1480.612019: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1159 | <idle>-0 [00] 1480.612025: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1160 | <idle>-0 [00] 1480.612032: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1161 | <idle>-0 [00] 1480.612037: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1162 | <idle>-0 [00] 1480.612382: hrtimer_get_next_event <-get_next_timer_interrupt | ||
1163 | |||
1164 | |||
1165 | Notice that we lost the sys_nanosleep. | ||
1166 | |||
1167 | # cat /debug/tracing/set_ftrace_filter | ||
1168 | hrtimer_run_queues | ||
1169 | hrtimer_run_pending | ||
1170 | hrtimer_init | ||
1171 | hrtimer_cancel | ||
1172 | hrtimer_try_to_cancel | ||
1173 | hrtimer_forward | ||
1174 | hrtimer_start | ||
1175 | hrtimer_reprogram | ||
1176 | hrtimer_force_reprogram | ||
1177 | hrtimer_get_next_event | ||
1178 | hrtimer_interrupt | ||
1179 | hrtimer_nanosleep | ||
1180 | hrtimer_wakeup | ||
1181 | hrtimer_get_remaining | ||
1182 | hrtimer_get_res | ||
1183 | hrtimer_init_sleeper | ||
1184 | |||
1185 | |||
1186 | This is because the '>' and '>>' act just like they do in bash. | ||
1187 | To rewrite the filters, use '>' | ||
1188 | To append to the filters, use '>>' | ||
1189 | |||
1190 | To clear out a filter so that all functions will be recorded again. | ||
1191 | |||
1192 | # echo > /debug/tracing/set_ftrace_filter | ||
1193 | # cat /debug/tracing/set_ftrace_filter | ||
1194 | # | ||
1195 | |||
1196 | Again, now we want to append. | ||
1197 | |||
1198 | # echo sys_nanosleep > /debug/tracing/set_ftrace_filter | ||
1199 | # cat /debug/tracing/set_ftrace_filter | ||
1200 | sys_nanosleep | ||
1201 | # echo hrtimer_* >> /debug/tracing/set_ftrace_filter | ||
1202 | # cat /debug/tracing/set_ftrace_filter | ||
1203 | hrtimer_run_queues | ||
1204 | hrtimer_run_pending | ||
1205 | hrtimer_init | ||
1206 | hrtimer_cancel | ||
1207 | hrtimer_try_to_cancel | ||
1208 | hrtimer_forward | ||
1209 | hrtimer_start | ||
1210 | hrtimer_reprogram | ||
1211 | hrtimer_force_reprogram | ||
1212 | hrtimer_get_next_event | ||
1213 | hrtimer_interrupt | ||
1214 | sys_nanosleep | ||
1215 | hrtimer_nanosleep | ||
1216 | hrtimer_wakeup | ||
1217 | hrtimer_get_remaining | ||
1218 | hrtimer_get_res | ||
1219 | hrtimer_init_sleeper | ||
1220 | |||
1221 | |||
1222 | The set_ftrace_notrace prevents those functions from being traced. | ||
1223 | |||
1224 | # echo '*preempt*' '*lock*' > /debug/tracing/set_ftrace_notrace | ||
1225 | |||
1226 | Produces: | ||
1227 | |||
1228 | # tracer: ftrace | ||
1229 | # | ||
1230 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1231 | # | | | | | | ||
1232 | bash-4043 [01] 115.281644: finish_task_switch <-schedule | ||
1233 | bash-4043 [01] 115.281645: hrtick_set <-schedule | ||
1234 | bash-4043 [01] 115.281645: hrtick_clear <-hrtick_set | ||
1235 | bash-4043 [01] 115.281646: wait_for_completion <-__stop_machine_run | ||
1236 | bash-4043 [01] 115.281647: wait_for_common <-wait_for_completion | ||
1237 | bash-4043 [01] 115.281647: kthread_stop <-stop_machine_run | ||
1238 | bash-4043 [01] 115.281648: init_waitqueue_head <-kthread_stop | ||
1239 | bash-4043 [01] 115.281648: wake_up_process <-kthread_stop | ||
1240 | bash-4043 [01] 115.281649: try_to_wake_up <-wake_up_process | ||
1241 | |||
1242 | We can see that there's no more lock or preempt tracing. | ||
1243 | |||
1244 | ftraced | ||
1245 | ------- | ||
1246 | |||
1247 | As mentioned above, when dynamic ftrace is configured in, a kernel | ||
1248 | thread wakes up once a second and checks to see if there are mcount | ||
1249 | calls that need to be converted into nops. If there is not, then | ||
1250 | it simply goes back to sleep. But if there is, it will call | ||
1251 | kstop_machine to convert the calls to nops. | ||
1252 | |||
1253 | There may be a case that you do not want this added latency. | ||
1254 | Perhaps you are doing some audio recording and this activity might | ||
1255 | cause skips in the playback. There is an interface to disable | ||
1256 | and enable the ftraced kernel thread. | ||
1257 | |||
1258 | # echo 0 > /debug/tracing/ftraced_enabled | ||
1259 | |||
1260 | This will disable the calling of the kstop_machine to update the | ||
1261 | mcount calls to nops. Remember that there's a large overhead | ||
1262 | to calling mcount. Without this kernel thread, that overhead will | ||
1263 | exist. | ||
1264 | |||
1265 | Any write to the ftraced_enabled file will cause the kstop_machine | ||
1266 | to run if there are recorded calls to mcount. This means that a | ||
1267 | user can manually perform the updates when they want to by simply | ||
1268 | echoing a '0' into the ftraced_enabled file. | ||
1269 | |||
1270 | The updates are also done at the beginning of enabling a tracer | ||
1271 | that uses ftrace function recording. | ||
1272 | |||
1273 | |||
1274 | trace_pipe | ||
1275 | ---------- | ||
1276 | |||
1277 | The trace_pipe outputs the same as trace, but the effect on the | ||
1278 | tracing is different. Every read from trace_pipe is consumed. | ||
1279 | This means that subsequent reads will be different. The trace | ||
1280 | is live. | ||
1281 | |||
1282 | # echo ftrace > /debug/tracing/current_tracer | ||
1283 | # cat /debug/tracing/trace_pipe > /tmp/trace.out & | ||
1284 | [1] 4153 | ||
1285 | # echo 1 > /debug/tracing/tracing_enabled | ||
1286 | # usleep 1 | ||
1287 | # echo 0 > /debug/tracing/tracing_enabled | ||
1288 | # cat /debug/tracing/trace | ||
1289 | # tracer: ftrace | ||
1290 | # | ||
1291 | # TASK-PID CPU# TIMESTAMP FUNCTION | ||
1292 | # | | | | | | ||
1293 | |||
1294 | # | ||
1295 | # cat /tmp/trace.out | ||
1296 | bash-4043 [00] 41.267106: finish_task_switch <-schedule | ||
1297 | bash-4043 [00] 41.267106: hrtick_set <-schedule | ||
1298 | bash-4043 [00] 41.267107: hrtick_clear <-hrtick_set | ||
1299 | bash-4043 [00] 41.267108: wait_for_completion <-__stop_machine_run | ||
1300 | bash-4043 [00] 41.267108: wait_for_common <-wait_for_completion | ||
1301 | bash-4043 [00] 41.267109: kthread_stop <-stop_machine_run | ||
1302 | bash-4043 [00] 41.267109: init_waitqueue_head <-kthread_stop | ||
1303 | bash-4043 [00] 41.267110: wake_up_process <-kthread_stop | ||
1304 | bash-4043 [00] 41.267110: try_to_wake_up <-wake_up_process | ||
1305 | bash-4043 [00] 41.267111: select_task_rq_rt <-try_to_wake_up | ||
1306 | |||
1307 | |||
1308 | Note, reading the trace_pipe will block until more input is added. | ||
1309 | By changing the tracer, trace_pipe will issue an EOF. We needed | ||
1310 | to set the ftrace tracer _before_ cating the trace_pipe file. | ||
1311 | |||
1312 | |||
1313 | trace entries | ||
1314 | ------------- | ||
1315 | |||
1316 | Having too much or not enough data can be troublesome in diagnosing | ||
1317 | some issue in the kernel. The file trace_entries is used to modify | ||
1318 | the size of the internal trace buffers. The numbers listed | ||
1319 | is the number of entries that can be recorded per CPU. To know | ||
1320 | the full size, multiply the number of possible CPUS with the | ||
1321 | number of entries. | ||
1322 | |||
1323 | # cat /debug/tracing/trace_entries | ||
1324 | 65620 | ||
1325 | |||
1326 | Note, to modify this you must have tracing fulling disabled. To do that, | ||
1327 | echo "none" into the current_tracer. | ||
1328 | |||
1329 | # echo none > /debug/tracing/current_tracer | ||
1330 | # echo 100000 > /debug/tracing/trace_entries | ||
1331 | # cat /debug/tracing/trace_entries | ||
1332 | 100045 | ||
1333 | |||
1334 | |||
1335 | Notice that we echoed in 100,000 but the size is 100,045. The entries | ||
1336 | are held by individual pages. It allocates the number of pages it takes | ||
1337 | to fulfill the request. If more entries may fit on the last page | ||
1338 | it will add them. | ||
1339 | |||
1340 | # echo 1 > /debug/tracing/trace_entries | ||
1341 | # cat /debug/tracing/trace_entries | ||
1342 | 85 | ||
1343 | |||
1344 | This shows us that 85 entries can fit on a single page. | ||
1345 | |||
1346 | The number of pages that will be allocated is a percentage of available | ||
1347 | memory. Allocating too much will produces an error. | ||
1348 | |||
1349 | # echo 1000000000000 > /debug/tracing/trace_entries | ||
1350 | -bash: echo: write error: Cannot allocate memory | ||
1351 | # cat /debug/tracing/trace_entries | ||
1352 | 85 | ||
1353 | |||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index e07c432c731f..b52f47d588b4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -295,7 +295,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
295 | when initialising the APIC and IO-APIC components. | 295 | when initialising the APIC and IO-APIC components. |
296 | 296 | ||
297 | apm= [APM] Advanced Power Management | 297 | apm= [APM] Advanced Power Management |
298 | See header of arch/i386/kernel/apm.c. | 298 | See header of arch/x86/kernel/apm_32.c. |
299 | 299 | ||
300 | arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards | 300 | arcrimi= [HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards |
301 | Format: <io>,<irq>,<nodeID> | 301 | Format: <io>,<irq>,<nodeID> |
@@ -638,7 +638,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
638 | 638 | ||
639 | elanfreq= [X86-32] | 639 | elanfreq= [X86-32] |
640 | See comment before function elanfreq_setup() in | 640 | See comment before function elanfreq_setup() in |
641 | arch/i386/kernel/cpu/cpufreq/elanfreq.c. | 641 | arch/x86/kernel/cpu/cpufreq/elanfreq.c. |
642 | 642 | ||
643 | elevator= [IOSCHED] | 643 | elevator= [IOSCHED] |
644 | Format: {"anticipatory" | "cfq" | "deadline" | "noop"} | 644 | Format: {"anticipatory" | "cfq" | "deadline" | "noop"} |
@@ -1679,6 +1679,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1679 | Format: <reboot_mode>[,<reboot_mode2>[,...]] | 1679 | Format: <reboot_mode>[,<reboot_mode2>[,...]] |
1680 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c | 1680 | See arch/*/kernel/reboot.c or arch/*/kernel/process.c |
1681 | 1681 | ||
1682 | relax_domain_level= | ||
1683 | [KNL, SMP] Set scheduler's default relax_domain_level. | ||
1684 | See Documentation/cpusets.txt. | ||
1685 | |||
1682 | reserve= [KNL,BUGS] Force the kernel to ignore some iomem area | 1686 | reserve= [KNL,BUGS] Force the kernel to ignore some iomem area |
1683 | 1687 | ||
1684 | reservetop= [X86-32] | 1688 | reservetop= [X86-32] |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 17f1f91af35c..946b66e1b652 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -148,9 +148,9 @@ tcp_available_congestion_control - STRING | |||
148 | but not loaded. | 148 | but not loaded. |
149 | 149 | ||
150 | tcp_base_mss - INTEGER | 150 | tcp_base_mss - INTEGER |
151 | The initial value of search_low to be used by Packetization Layer | 151 | The initial value of search_low to be used by the packetization layer |
152 | Path MTU Discovery (MTU probing). If MTU probing is enabled, | 152 | Path MTU discovery (MTU probing). If MTU probing is enabled, |
153 | this is the inital MSS used by the connection. | 153 | this is the initial MSS used by the connection. |
154 | 154 | ||
155 | tcp_congestion_control - STRING | 155 | tcp_congestion_control - STRING |
156 | Set the congestion control algorithm to be used for new | 156 | Set the congestion control algorithm to be used for new |
@@ -185,10 +185,9 @@ tcp_frto - INTEGER | |||
185 | timeouts. It is particularly beneficial in wireless environments | 185 | timeouts. It is particularly beneficial in wireless environments |
186 | where packet loss is typically due to random radio interference | 186 | where packet loss is typically due to random radio interference |
187 | rather than intermediate router congestion. F-RTO is sender-side | 187 | rather than intermediate router congestion. F-RTO is sender-side |
188 | only modification. Therefore it does not require any support from | 188 | only modification. Therefore it does not require any support from |
189 | the peer, but in a typical case, however, where wireless link is | 189 | the peer. |
190 | the local access link and most of the data flows downlink, the | 190 | |
191 | faraway servers should have F-RTO enabled to take advantage of it. | ||
192 | If set to 1, basic version is enabled. 2 enables SACK enhanced | 191 | If set to 1, basic version is enabled. 2 enables SACK enhanced |
193 | F-RTO if flow uses SACK. The basic version can be used also when | 192 | F-RTO if flow uses SACK. The basic version can be used also when |
194 | SACK is in use though scenario(s) with it exists where F-RTO | 193 | SACK is in use though scenario(s) with it exists where F-RTO |
@@ -276,7 +275,7 @@ tcp_mem - vector of 3 INTEGERs: min, pressure, max | |||
276 | memory. | 275 | memory. |
277 | 276 | ||
278 | tcp_moderate_rcvbuf - BOOLEAN | 277 | tcp_moderate_rcvbuf - BOOLEAN |
279 | If set, TCP performs receive buffer autotuning, attempting to | 278 | If set, TCP performs receive buffer auto-tuning, attempting to |
280 | automatically size the buffer (no greater than tcp_rmem[2]) to | 279 | automatically size the buffer (no greater than tcp_rmem[2]) to |
281 | match the size required by the path for full throughput. Enabled by | 280 | match the size required by the path for full throughput. Enabled by |
282 | default. | 281 | default. |
@@ -336,7 +335,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max | |||
336 | pressure. | 335 | pressure. |
337 | Default: 8K | 336 | Default: 8K |
338 | 337 | ||
339 | default: default size of receive buffer used by TCP sockets. | 338 | default: initial size of receive buffer used by TCP sockets. |
340 | This value overrides net.core.rmem_default used by other protocols. | 339 | This value overrides net.core.rmem_default used by other protocols. |
341 | Default: 87380 bytes. This value results in window of 65535 with | 340 | Default: 87380 bytes. This value results in window of 65535 with |
342 | default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit | 341 | default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit |
@@ -344,8 +343,10 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max | |||
344 | 343 | ||
345 | max: maximal size of receive buffer allowed for automatically | 344 | max: maximal size of receive buffer allowed for automatically |
346 | selected receiver buffers for TCP socket. This value does not override | 345 | selected receiver buffers for TCP socket. This value does not override |
347 | net.core.rmem_max, "static" selection via SO_RCVBUF does not use this. | 346 | net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables |
348 | Default: 87380*2 bytes. | 347 | automatic tuning of that socket's receive buffer size, in which |
348 | case this value is ignored. | ||
349 | Default: between 87380B and 4MB, depending on RAM size. | ||
349 | 350 | ||
350 | tcp_sack - BOOLEAN | 351 | tcp_sack - BOOLEAN |
351 | Enable select acknowledgments (SACKS). | 352 | Enable select acknowledgments (SACKS). |
@@ -358,7 +359,7 @@ tcp_slow_start_after_idle - BOOLEAN | |||
358 | Default: 1 | 359 | Default: 1 |
359 | 360 | ||
360 | tcp_stdurg - BOOLEAN | 361 | tcp_stdurg - BOOLEAN |
361 | Use the Host requirements interpretation of the TCP urg pointer field. | 362 | Use the Host requirements interpretation of the TCP urgent pointer field. |
362 | Most hosts use the older BSD interpretation, so if you turn this on | 363 | Most hosts use the older BSD interpretation, so if you turn this on |
363 | Linux might not communicate correctly with them. | 364 | Linux might not communicate correctly with them. |
364 | Default: FALSE | 365 | Default: FALSE |
@@ -371,12 +372,12 @@ tcp_synack_retries - INTEGER | |||
371 | tcp_syncookies - BOOLEAN | 372 | tcp_syncookies - BOOLEAN |
372 | Only valid when the kernel was compiled with CONFIG_SYNCOOKIES | 373 | Only valid when the kernel was compiled with CONFIG_SYNCOOKIES |
373 | Send out syncookies when the syn backlog queue of a socket | 374 | Send out syncookies when the syn backlog queue of a socket |
374 | overflows. This is to prevent against the common 'syn flood attack' | 375 | overflows. This is to prevent against the common 'SYN flood attack' |
375 | Default: FALSE | 376 | Default: FALSE |
376 | 377 | ||
377 | Note, that syncookies is fallback facility. | 378 | Note, that syncookies is fallback facility. |
378 | It MUST NOT be used to help highly loaded servers to stand | 379 | It MUST NOT be used to help highly loaded servers to stand |
379 | against legal connection rate. If you see synflood warnings | 380 | against legal connection rate. If you see SYN flood warnings |
380 | in your logs, but investigation shows that they occur | 381 | in your logs, but investigation shows that they occur |
381 | because of overload with legal connections, you should tune | 382 | because of overload with legal connections, you should tune |
382 | another parameters until this warning disappear. | 383 | another parameters until this warning disappear. |
@@ -386,7 +387,7 @@ tcp_syncookies - BOOLEAN | |||
386 | to use TCP extensions, can result in serious degradation | 387 | to use TCP extensions, can result in serious degradation |
387 | of some services (f.e. SMTP relaying), visible not by you, | 388 | of some services (f.e. SMTP relaying), visible not by you, |
388 | but your clients and relays, contacting you. While you see | 389 | but your clients and relays, contacting you. While you see |
389 | synflood warnings in logs not being really flooded, your server | 390 | SYN flood warnings in logs not being really flooded, your server |
390 | is seriously misconfigured. | 391 | is seriously misconfigured. |
391 | 392 | ||
392 | tcp_syn_retries - INTEGER | 393 | tcp_syn_retries - INTEGER |
@@ -419,19 +420,21 @@ tcp_window_scaling - BOOLEAN | |||
419 | Enable window scaling as defined in RFC1323. | 420 | Enable window scaling as defined in RFC1323. |
420 | 421 | ||
421 | tcp_wmem - vector of 3 INTEGERs: min, default, max | 422 | tcp_wmem - vector of 3 INTEGERs: min, default, max |
422 | min: Amount of memory reserved for send buffers for TCP socket. | 423 | min: Amount of memory reserved for send buffers for TCP sockets. |
423 | Each TCP socket has rights to use it due to fact of its birth. | 424 | Each TCP socket has rights to use it due to fact of its birth. |
424 | Default: 4K | 425 | Default: 4K |
425 | 426 | ||
426 | default: Amount of memory allowed for send buffers for TCP socket | 427 | default: initial size of send buffer used by TCP sockets. This |
427 | by default. This value overrides net.core.wmem_default used | 428 | value overrides net.core.wmem_default used by other protocols. |
428 | by other protocols, it is usually lower than net.core.wmem_default. | 429 | It is usually lower than net.core.wmem_default. |
429 | Default: 16K | 430 | Default: 16K |
430 | 431 | ||
431 | max: Maximal amount of memory allowed for automatically selected | 432 | max: Maximal amount of memory allowed for automatically tuned |
432 | send buffers for TCP socket. This value does not override | 433 | send buffers for TCP sockets. This value does not override |
433 | net.core.wmem_max, "static" selection via SO_SNDBUF does not use this. | 434 | net.core.wmem_max. Calling setsockopt() with SO_SNDBUF disables |
434 | Default: 128K | 435 | automatic tuning of that socket's send buffer size, in which case |
436 | this value is ignored. | ||
437 | Default: between 64K and 4MB, depending on RAM size. | ||
435 | 438 | ||
436 | tcp_workaround_signed_windows - BOOLEAN | 439 | tcp_workaround_signed_windows - BOOLEAN |
437 | If set, assume no receipt of a window scaling option means the | 440 | If set, assume no receipt of a window scaling option means the |
@@ -1060,24 +1063,193 @@ bridge-nf-filter-pppoe-tagged - BOOLEAN | |||
1060 | Default: 1 | 1063 | Default: 1 |
1061 | 1064 | ||
1062 | 1065 | ||
1063 | UNDOCUMENTED: | 1066 | proc/sys/net/sctp/* Variables: |
1067 | |||
1068 | addip_enable - BOOLEAN | ||
1069 | Enable or disable extension of Dynamic Address Reconfiguration | ||
1070 | (ADD-IP) functionality specified in RFC5061. This extension provides | ||
1071 | the ability to dynamically add and remove new addresses for the SCTP | ||
1072 | associations. | ||
1073 | |||
1074 | 1: Enable extension. | ||
1075 | |||
1076 | 0: Disable extension. | ||
1077 | |||
1078 | Default: 0 | ||
1079 | |||
1080 | addip_noauth_enable - BOOLEAN | ||
1081 | Dynamic Address Reconfiguration (ADD-IP) requires the use of | ||
1082 | authentication to protect the operations of adding or removing new | ||
1083 | addresses. This requirement is mandated so that unauthorized hosts | ||
1084 | would not be able to hijack associations. However, older | ||
1085 | implementations may not have implemented this requirement while | ||
1086 | allowing the ADD-IP extension. For reasons of interoperability, | ||
1087 | we provide this variable to control the enforcement of the | ||
1088 | authentication requirement. | ||
1089 | |||
1090 | 1: Allow ADD-IP extension to be used without authentication. This | ||
1091 | should only be set in a closed environment for interoperability | ||
1092 | with older implementations. | ||
1093 | |||
1094 | 0: Enforce the authentication requirement | ||
1095 | |||
1096 | Default: 0 | ||
1097 | |||
1098 | auth_enable - BOOLEAN | ||
1099 | Enable or disable Authenticated Chunks extension. This extension | ||
1100 | provides the ability to send and receive authenticated chunks and is | ||
1101 | required for secure operation of Dynamic Address Reconfiguration | ||
1102 | (ADD-IP) extension. | ||
1103 | |||
1104 | 1: Enable this extension. | ||
1105 | 0: Disable this extension. | ||
1106 | |||
1107 | Default: 0 | ||
1108 | |||
1109 | prsctp_enable - BOOLEAN | ||
1110 | Enable or disable the Partial Reliability extension (RFC3758) which | ||
1111 | is used to notify peers that a given DATA should no longer be expected. | ||
1112 | |||
1113 | 1: Enable extension | ||
1114 | 0: Disable | ||
1115 | |||
1116 | Default: 1 | ||
1117 | |||
1118 | max_burst - INTEGER | ||
1119 | The limit of the number of new packets that can be initially sent. It | ||
1120 | controls how bursty the generated traffic can be. | ||
1121 | |||
1122 | Default: 4 | ||
1123 | |||
1124 | association_max_retrans - INTEGER | ||
1125 | Set the maximum number for retransmissions that an association can | ||
1126 | attempt deciding that the remote end is unreachable. If this value | ||
1127 | is exceeded, the association is terminated. | ||
1128 | |||
1129 | Default: 10 | ||
1130 | |||
1131 | max_init_retransmits - INTEGER | ||
1132 | The maximum number of retransmissions of INIT and COOKIE-ECHO chunks | ||
1133 | that an association will attempt before declaring the destination | ||
1134 | unreachable and terminating. | ||
1135 | |||
1136 | Default: 8 | ||
1137 | |||
1138 | path_max_retrans - INTEGER | ||
1139 | The maximum number of retransmissions that will be attempted on a given | ||
1140 | path. Once this threshold is exceeded, the path is considered | ||
1141 | unreachable, and new traffic will use a different path when the | ||
1142 | association is multihomed. | ||
1143 | |||
1144 | Default: 5 | ||
1145 | |||
1146 | rto_initial - INTEGER | ||
1147 | The initial round trip timeout value in milliseconds that will be used | ||
1148 | in calculating round trip times. This is the initial time interval | ||
1149 | for retransmissions. | ||
1150 | |||
1151 | Default: 3000 | ||
1064 | 1152 | ||
1065 | dev_weight FIXME | 1153 | rto_max - INTEGER |
1066 | discovery_slots FIXME | 1154 | The maximum value (in milliseconds) of the round trip timeout. This |
1067 | discovery_timeout FIXME | 1155 | is the largest time interval that can elapse between retransmissions. |
1068 | fast_poll_increase FIXME | 1156 | |
1069 | ip6_queue_maxlen FIXME | 1157 | Default: 60000 |
1070 | lap_keepalive_time FIXME | 1158 | |
1071 | lo_cong FIXME | 1159 | rto_min - INTEGER |
1072 | max_baud_rate FIXME | 1160 | The minimum value (in milliseconds) of the round trip timeout. This |
1073 | max_dgram_qlen FIXME | 1161 | is the smallest time interval the can elapse between retransmissions. |
1074 | max_noreply_time FIXME | 1162 | |
1075 | max_tx_data_size FIXME | 1163 | Default: 1000 |
1076 | max_tx_window FIXME | 1164 | |
1077 | min_tx_turn_time FIXME | 1165 | hb_interval - INTEGER |
1078 | mod_cong FIXME | 1166 | The interval (in milliseconds) between HEARTBEAT chunks. These chunks |
1079 | no_cong FIXME | 1167 | are sent at the specified interval on idle paths to probe the state of |
1080 | no_cong_thresh FIXME | 1168 | a given path between 2 associations. |
1081 | slot_timeout FIXME | 1169 | |
1082 | warn_noreply_time FIXME | 1170 | Default: 30000 |
1171 | |||
1172 | sack_timeout - INTEGER | ||
1173 | The amount of time (in milliseconds) that the implementation will wait | ||
1174 | to send a SACK. | ||
1175 | |||
1176 | Default: 200 | ||
1177 | |||
1178 | valid_cookie_life - INTEGER | ||
1179 | The default lifetime of the SCTP cookie (in milliseconds). The cookie | ||
1180 | is used during association establishment. | ||
1181 | |||
1182 | Default: 60000 | ||
1183 | |||
1184 | cookie_preserve_enable - BOOLEAN | ||
1185 | Enable or disable the ability to extend the lifetime of the SCTP cookie | ||
1186 | that is used during the establishment phase of SCTP association | ||
1187 | |||
1188 | 1: Enable cookie lifetime extension. | ||
1189 | 0: Disable | ||
1190 | |||
1191 | Default: 1 | ||
1192 | |||
1193 | rcvbuf_policy - INTEGER | ||
1194 | Determines if the receive buffer is attributed to the socket or to | ||
1195 | association. SCTP supports the capability to create multiple | ||
1196 | associations on a single socket. When using this capability, it is | ||
1197 | possible that a single stalled association that's buffering a lot | ||
1198 | of data may block other associations from delivering their data by | ||
1199 | consuming all of the receive buffer space. To work around this, | ||
1200 | the rcvbuf_policy could be set to attribute the receiver buffer space | ||
1201 | to each association instead of the socket. This prevents the described | ||
1202 | blocking. | ||
1203 | |||
1204 | 1: rcvbuf space is per association | ||
1205 | 0: recbuf space is per socket | ||
1206 | |||
1207 | Default: 0 | ||
1208 | |||
1209 | sndbuf_policy - INTEGER | ||
1210 | Similar to rcvbuf_policy above, this applies to send buffer space. | ||
1211 | |||
1212 | 1: Send buffer is tracked per association | ||
1213 | 0: Send buffer is tracked per socket. | ||
1214 | |||
1215 | Default: 0 | ||
1216 | |||
1217 | sctp_mem - vector of 3 INTEGERs: min, pressure, max | ||
1218 | Number of pages allowed for queueing by all SCTP sockets. | ||
1219 | |||
1220 | min: Below this number of pages SCTP is not bothered about its | ||
1221 | memory appetite. When amount of memory allocated by SCTP exceeds | ||
1222 | this number, SCTP starts to moderate memory usage. | ||
1223 | |||
1224 | pressure: This value was introduced to follow format of tcp_mem. | ||
1225 | |||
1226 | max: Number of pages allowed for queueing by all SCTP sockets. | ||
1227 | |||
1228 | Default is calculated at boot time from amount of available memory. | ||
1229 | |||
1230 | sctp_rmem - vector of 3 INTEGERs: min, default, max | ||
1231 | See tcp_rmem for a description. | ||
1232 | |||
1233 | sctp_wmem - vector of 3 INTEGERs: min, default, max | ||
1234 | See tcp_wmem for a description. | ||
1235 | |||
1236 | UNDOCUMENTED: | ||
1083 | 1237 | ||
1238 | /proc/sys/net/core/* | ||
1239 | dev_weight FIXME | ||
1240 | |||
1241 | /proc/sys/net/unix/* | ||
1242 | max_dgram_qlen FIXME | ||
1243 | |||
1244 | /proc/sys/net/irda/* | ||
1245 | fast_poll_increase FIXME | ||
1246 | warn_noreply_time FIXME | ||
1247 | discovery_slots FIXME | ||
1248 | slot_timeout FIXME | ||
1249 | max_baud_rate FIXME | ||
1250 | discovery_timeout FIXME | ||
1251 | lap_keepalive_time FIXME | ||
1252 | max_noreply_time FIXME | ||
1253 | max_tx_data_size FIXME | ||
1254 | max_tx_window FIXME | ||
1255 | min_tx_turn_time FIXME | ||
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c index e4230ed16ee7..df3227605d59 100644 --- a/Documentation/vm/slabinfo.c +++ b/Documentation/vm/slabinfo.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Slabinfo: Tool to get reports about slabs | 2 | * Slabinfo: Tool to get reports about slabs |
3 | * | 3 | * |
4 | * (C) 2007 sgi, Christoph Lameter <clameter@sgi.com> | 4 | * (C) 2007 sgi, Christoph Lameter |
5 | * | 5 | * |
6 | * Compile by: | 6 | * Compile by: |
7 | * | 7 | * |
@@ -99,7 +99,7 @@ void fatal(const char *x, ...) | |||
99 | 99 | ||
100 | void usage(void) | 100 | void usage(void) |
101 | { | 101 | { |
102 | printf("slabinfo 5/7/2007. (c) 2007 sgi. clameter@sgi.com\n\n" | 102 | printf("slabinfo 5/7/2007. (c) 2007 sgi.\n\n" |
103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" | 103 | "slabinfo [-ahnpvtsz] [-d debugopts] [slab-regexp]\n" |
104 | "-a|--aliases Show aliases\n" | 104 | "-a|--aliases Show aliases\n" |
105 | "-A|--activity Most active slabs first\n" | 105 | "-A|--activity Most active slabs first\n" |
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt index 7c13f22a0c9e..bb1f5c6e28b3 100644 --- a/Documentation/vm/slub.txt +++ b/Documentation/vm/slub.txt | |||
@@ -266,4 +266,4 @@ of other objects. | |||
266 | 266 | ||
267 | slub_debug=FZ,dentry | 267 | slub_debug=FZ,dentry |
268 | 268 | ||
269 | Christoph Lameter, <clameter@sgi.com>, May 30, 2007 | 269 | Christoph Lameter, May 30, 2007 |
diff --git a/MAINTAINERS b/MAINTAINERS index e6c06fa3290e..56a2f678019e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -763,9 +763,10 @@ S: Maintained | |||
763 | 763 | ||
764 | AUXILIARY DISPLAY DRIVERS | 764 | AUXILIARY DISPLAY DRIVERS |
765 | P: Miguel Ojeda Sandonis | 765 | P: Miguel Ojeda Sandonis |
766 | M: maxextreme@gmail.com | 766 | M: miguel.ojeda.sandonis@gmail.com |
767 | L: linux-kernel@vger.kernel.org | 767 | L: linux-kernel@vger.kernel.org |
768 | W: http://auxdisplay.googlepages.com/ | 768 | W: http://miguelojeda.es/auxdisplay.htm |
769 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
769 | S: Maintained | 770 | S: Maintained |
770 | 771 | ||
771 | AVR32 ARCHITECTURE | 772 | AVR32 ARCHITECTURE |
@@ -1055,16 +1056,18 @@ S: Supported | |||
1055 | 1056 | ||
1056 | CFAG12864B LCD DRIVER | 1057 | CFAG12864B LCD DRIVER |
1057 | P: Miguel Ojeda Sandonis | 1058 | P: Miguel Ojeda Sandonis |
1058 | M: maxextreme@gmail.com | 1059 | M: miguel.ojeda.sandonis@gmail.com |
1059 | L: linux-kernel@vger.kernel.org | 1060 | L: linux-kernel@vger.kernel.org |
1060 | W: http://auxdisplay.googlepages.com/ | 1061 | W: http://miguelojeda.es/auxdisplay.htm |
1062 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
1061 | S: Maintained | 1063 | S: Maintained |
1062 | 1064 | ||
1063 | CFAG12864BFB LCD FRAMEBUFFER DRIVER | 1065 | CFAG12864BFB LCD FRAMEBUFFER DRIVER |
1064 | P: Miguel Ojeda Sandonis | 1066 | P: Miguel Ojeda Sandonis |
1065 | M: maxextreme@gmail.com | 1067 | M: miguel.ojeda.sandonis@gmail.com |
1066 | L: linux-kernel@vger.kernel.org | 1068 | L: linux-kernel@vger.kernel.org |
1067 | W: http://auxdisplay.googlepages.com/ | 1069 | W: http://miguelojeda.es/auxdisplay.htm |
1070 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
1068 | S: Maintained | 1071 | S: Maintained |
1069 | 1072 | ||
1070 | CFG80211 and NL80211 | 1073 | CFG80211 and NL80211 |
@@ -1420,6 +1423,14 @@ M: kristen.c.accardi@intel.com | |||
1420 | L: linux-acpi@vger.kernel.org | 1423 | L: linux-acpi@vger.kernel.org |
1421 | S: Supported | 1424 | S: Supported |
1422 | 1425 | ||
1426 | DOCUMENTATION (/Documentation directory) | ||
1427 | P: Michael Kerrisk | ||
1428 | M: mtk.manpages@gmail.com | ||
1429 | P: Randy Dunlap | ||
1430 | M: rdunlap@xenotime.net | ||
1431 | L: linux-doc@vger.kernel.org | ||
1432 | S: Maintained | ||
1433 | |||
1423 | DOUBLETALK DRIVER | 1434 | DOUBLETALK DRIVER |
1424 | P: James R. Van Zandt | 1435 | P: James R. Van Zandt |
1425 | M: jrv@vanzandt.mv.com | 1436 | M: jrv@vanzandt.mv.com |
@@ -1626,13 +1637,13 @@ S: Maintained | |||
1626 | 1637 | ||
1627 | EXT3 FILE SYSTEM | 1638 | EXT3 FILE SYSTEM |
1628 | P: Stephen Tweedie, Andrew Morton | 1639 | P: Stephen Tweedie, Andrew Morton |
1629 | M: sct@redhat.com, akpm@linux-foundation.org, adilger@clusterfs.com | 1640 | M: sct@redhat.com, akpm@linux-foundation.org, adilger@sun.com |
1630 | L: linux-ext4@vger.kernel.org | 1641 | L: linux-ext4@vger.kernel.org |
1631 | S: Maintained | 1642 | S: Maintained |
1632 | 1643 | ||
1633 | EXT4 FILE SYSTEM | 1644 | EXT4 FILE SYSTEM |
1634 | P: Stephen Tweedie, Andrew Morton | 1645 | P: Stephen Tweedie, Andrew Morton |
1635 | M: sct@redhat.com, akpm@linux-foundation.org, adilger@clusterfs.com | 1646 | M: sct@redhat.com, akpm@linux-foundation.org, adilger@sun.com |
1636 | L: linux-ext4@vger.kernel.org | 1647 | L: linux-ext4@vger.kernel.org |
1637 | S: Maintained | 1648 | S: Maintained |
1638 | 1649 | ||
@@ -2428,9 +2439,10 @@ S: Maintained | |||
2428 | 2439 | ||
2429 | KS0108 LCD CONTROLLER DRIVER | 2440 | KS0108 LCD CONTROLLER DRIVER |
2430 | P: Miguel Ojeda Sandonis | 2441 | P: Miguel Ojeda Sandonis |
2431 | M: maxextreme@gmail.com | 2442 | M: miguel.ojeda.sandonis@gmail.com |
2432 | L: linux-kernel@vger.kernel.org | 2443 | L: linux-kernel@vger.kernel.org |
2433 | W: http://auxdisplay.googlepages.com/ | 2444 | W: http://miguelojeda.es/auxdisplay.htm |
2445 | W: http://jair.lab.fi.uva.es/~migojed/auxdisplay.htm | ||
2434 | S: Maintained | 2446 | S: Maintained |
2435 | 2447 | ||
2436 | LAPB module | 2448 | LAPB module |
@@ -2474,9 +2486,11 @@ M: James.Bottomley@HansenPartnership.com | |||
2474 | W: http://www.hansenpartnership.com/voyager | 2486 | W: http://www.hansenpartnership.com/voyager |
2475 | S: Maintained | 2487 | S: Maintained |
2476 | 2488 | ||
2477 | LINUX FOR POWERPC | 2489 | LINUX FOR POWERPC (32-BIT AND 64-BIT) |
2478 | P: Paul Mackerras | 2490 | P: Paul Mackerras |
2479 | M: paulus@samba.org | 2491 | M: paulus@samba.org |
2492 | P: Benjamin Herrenschmidt | ||
2493 | M: benh@kernel.crashing.org | ||
2480 | W: http://www.penguinppc.org/ | 2494 | W: http://www.penguinppc.org/ |
2481 | L: linuxppc-dev@ozlabs.org | 2495 | L: linuxppc-dev@ozlabs.org |
2482 | T: git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git | 2496 | T: git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git |
@@ -2516,13 +2530,6 @@ W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex | |||
2516 | L: linuxppc-dev@ozlabs.org | 2530 | L: linuxppc-dev@ozlabs.org |
2517 | S: Maintained | 2531 | S: Maintained |
2518 | 2532 | ||
2519 | LINUX FOR POWERPC BOOT CODE | ||
2520 | P: Tom Rini | ||
2521 | M: trini@kernel.crashing.org | ||
2522 | W: http://www.penguinppc.org/ | ||
2523 | L: linuxppc-dev@ozlabs.org | ||
2524 | S: Maintained | ||
2525 | |||
2526 | LINUX FOR POWERPC EMBEDDED PPC8XX | 2533 | LINUX FOR POWERPC EMBEDDED PPC8XX |
2527 | P: Vitaly Bordug | 2534 | P: Vitaly Bordug |
2528 | M: vitb@kernel.crashing.org | 2535 | M: vitb@kernel.crashing.org |
@@ -2551,17 +2558,6 @@ P: Arnaldo Carvalho de Melo | |||
2551 | M: acme@ghostprotocols.net | 2558 | M: acme@ghostprotocols.net |
2552 | S: Maintained | 2559 | S: Maintained |
2553 | 2560 | ||
2554 | LINUX FOR 64BIT POWERPC | ||
2555 | P: Paul Mackerras | ||
2556 | M: paulus@samba.org | ||
2557 | M: paulus@au.ibm.com | ||
2558 | P: Anton Blanchard | ||
2559 | M: anton@samba.org | ||
2560 | M: anton@au.ibm.com | ||
2561 | W: http://www.penguinppc.org/ppc64/ | ||
2562 | L: linuxppc-dev@ozlabs.org | ||
2563 | S: Supported | ||
2564 | |||
2565 | LINUX SECURITY MODULE (LSM) FRAMEWORK | 2561 | LINUX SECURITY MODULE (LSM) FRAMEWORK |
2566 | P: Chris Wright | 2562 | P: Chris Wright |
2567 | M: chrisw@sous-sol.org | 2563 | M: chrisw@sous-sol.org |
@@ -2680,8 +2676,8 @@ S: Supported | |||
2680 | MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 | 2676 | MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 |
2681 | P: Michael Kerrisk | 2677 | P: Michael Kerrisk |
2682 | M: mtk.manpages@gmail.com | 2678 | M: mtk.manpages@gmail.com |
2683 | W: ftp://ftp.kernel.org/pub/linux/docs/manpages | 2679 | W: http://www.kernel.org/doc/man-pages |
2684 | S: Maintained | 2680 | S: Supported |
2685 | 2681 | ||
2686 | MARVELL LIBERTAS WIRELESS DRIVER | 2682 | MARVELL LIBERTAS WIRELESS DRIVER |
2687 | P: Dan Williams | 2683 | P: Dan Williams |
@@ -2814,6 +2810,12 @@ W: https://tango.0pointer.de/mailman/listinfo/s270-linux | |||
2814 | W: http://0pointer.de/lennart/tchibo.html | 2810 | W: http://0pointer.de/lennart/tchibo.html |
2815 | S: Maintained | 2811 | S: Maintained |
2816 | 2812 | ||
2813 | MULTIFUNCTION DEVICES (MFD) | ||
2814 | P: Samuel Ortiz | ||
2815 | M: sameo@openedhand.com | ||
2816 | L: linux-kernel@vger.kernel.org | ||
2817 | S: Supported | ||
2818 | |||
2817 | MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM | 2819 | MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM |
2818 | P: Pierre Ossman | 2820 | P: Pierre Ossman |
2819 | M: drzeus-mmc@drzeus.cx | 2821 | M: drzeus-mmc@drzeus.cx |
@@ -3080,8 +3082,8 @@ L: linux-scsi@vger.kernel.org | |||
3080 | S: Maintained | 3082 | S: Maintained |
3081 | 3083 | ||
3082 | OPROFILE | 3084 | OPROFILE |
3083 | P: Philippe Elie | 3085 | P: Robert Richter |
3084 | M: phil.el@wanadoo.fr | 3086 | M: robert.richter@amd.com |
3085 | L: oprofile-list@lists.sf.net | 3087 | L: oprofile-list@lists.sf.net |
3086 | S: Maintained | 3088 | S: Maintained |
3087 | 3089 | ||
@@ -3195,8 +3197,8 @@ L: netdev@vger.kernel.org | |||
3195 | S: Maintained | 3197 | S: Maintained |
3196 | 3198 | ||
3197 | PER-TASK DELAY ACCOUNTING | 3199 | PER-TASK DELAY ACCOUNTING |
3198 | P: Shailabh Nagar | 3200 | P: Balbir Singh |
3199 | M: nagar@watson.ibm.com | 3201 | M: balbir@linux.vnet.ibm.com |
3200 | L: linux-kernel@vger.kernel.org | 3202 | L: linux-kernel@vger.kernel.org |
3201 | S: Maintained | 3203 | S: Maintained |
3202 | 3204 | ||
@@ -3688,7 +3690,7 @@ S: Maintained | |||
3688 | 3690 | ||
3689 | SLAB ALLOCATOR | 3691 | SLAB ALLOCATOR |
3690 | P: Christoph Lameter | 3692 | P: Christoph Lameter |
3691 | M: clameter@sgi.com | 3693 | M: cl@linux-foundation.org |
3692 | P: Pekka Enberg | 3694 | P: Pekka Enberg |
3693 | M: penberg@cs.helsinki.fi | 3695 | M: penberg@cs.helsinki.fi |
3694 | P: Matt Mackall | 3696 | P: Matt Mackall |
@@ -3898,8 +3900,8 @@ M: hch@infradead.org | |||
3898 | S: Maintained | 3900 | S: Maintained |
3899 | 3901 | ||
3900 | TASKSTATS STATISTICS INTERFACE | 3902 | TASKSTATS STATISTICS INTERFACE |
3901 | P: Shailabh Nagar | 3903 | P: Balbir Singh |
3902 | M: nagar@watson.ibm.com | 3904 | M: balbir@linux.vnet.ibm.com |
3903 | L: linux-kernel@vger.kernel.org | 3905 | L: linux-kernel@vger.kernel.org |
3904 | S: Maintained | 3906 | S: Maintained |
3905 | 3907 | ||
@@ -3995,7 +3997,8 @@ W: http://www.buzzard.org.uk/toshiba/ | |||
3995 | S: Maintained | 3997 | S: Maintained |
3996 | 3998 | ||
3997 | TPM DEVICE DRIVER | 3999 | TPM DEVICE DRIVER |
3998 | P: Kylene Hall | 4000 | P: Debora Velarde |
4001 | P: Rajiv Andrade | ||
3999 | M: tpmdd-devel@lists.sourceforge.net | 4002 | M: tpmdd-devel@lists.sourceforge.net |
4000 | W: http://tpmdd.sourceforge.net | 4003 | W: http://tpmdd.sourceforge.net |
4001 | P: Marcel Selhorst | 4004 | P: Marcel Selhorst |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 26 | 3 | SUBLEVEL = 26 |
4 | EXTRAVERSION = -rc8 | 4 | EXTRAVERSION = |
5 | NAME = Rotary Wombat | 5 | NAME = Rotary Wombat |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index f13249be17c5..ef37fc1acaea 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S | |||
@@ -25,6 +25,13 @@ SECTIONS | |||
25 | } :kernel | 25 | } :kernel |
26 | _etext = .; /* End of text section */ | 26 | _etext = .; /* End of text section */ |
27 | 27 | ||
28 | NOTES :kernel :note | ||
29 | .dummy : { | ||
30 | *(.dummy) | ||
31 | } :kernel | ||
32 | |||
33 | RODATA | ||
34 | |||
28 | /* Exception table */ | 35 | /* Exception table */ |
29 | . = ALIGN(16); | 36 | . = ALIGN(16); |
30 | __ex_table : { | 37 | __ex_table : { |
@@ -33,13 +40,6 @@ SECTIONS | |||
33 | __stop___ex_table = .; | 40 | __stop___ex_table = .; |
34 | } | 41 | } |
35 | 42 | ||
36 | NOTES :kernel :note | ||
37 | .dummy : { | ||
38 | *(.dummy) | ||
39 | } :kernel | ||
40 | |||
41 | RODATA | ||
42 | |||
43 | /* Will be freed after init */ | 43 | /* Will be freed after init */ |
44 | . = ALIGN(PAGE_SIZE); | 44 | . = ALIGN(PAGE_SIZE); |
45 | /* Init code and data */ | 45 | /* Init code and data */ |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index e5a7c5d96364..24c5dee91768 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1006,7 +1006,7 @@ config BOOT_ELF32 | |||
1006 | config MIPS_L1_CACHE_SHIFT | 1006 | config MIPS_L1_CACHE_SHIFT |
1007 | int | 1007 | int |
1008 | default "4" if MACH_DECSTATION | 1008 | default "4" if MACH_DECSTATION |
1009 | default "7" if SGI_IP27 || SGI_IP28 || SNI_RM | 1009 | default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM |
1010 | default "4" if PMC_MSP4200_EVAL | 1010 | default "4" if PMC_MSP4200_EVAL |
1011 | default "5" | 1011 | default "5" |
1012 | 1012 | ||
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c index 795cb8fb0d74..b5fc4eb412d2 100644 --- a/arch/mips/kernel/cevt-txx9.c +++ b/arch/mips/kernel/cevt-txx9.c | |||
@@ -161,6 +161,9 @@ void __init txx9_tmr_init(unsigned long baseaddr) | |||
161 | struct txx9_tmr_reg __iomem *tmrptr; | 161 | struct txx9_tmr_reg __iomem *tmrptr; |
162 | 162 | ||
163 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); | 163 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); |
164 | /* Start once to make CounterResetEnable effective */ | ||
165 | __raw_writel(TXx9_TMTCR_CRE | TXx9_TMTCR_TCE, &tmrptr->tcr); | ||
166 | /* Stop and reset the counter */ | ||
164 | __raw_writel(TXx9_TMTCR_CRE, &tmrptr->tcr); | 167 | __raw_writel(TXx9_TMTCR_CRE, &tmrptr->tcr); |
165 | __raw_writel(0, &tmrptr->tisr); | 168 | __raw_writel(0, &tmrptr->tisr); |
166 | __raw_writel(0xffffffff, &tmrptr->cpra); | 169 | __raw_writel(0xffffffff, &tmrptr->cpra); |
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c index 76935e320214..27a5b466c85c 100644 --- a/arch/mips/mm/c-r3k.c +++ b/arch/mips/mm/c-r3k.c | |||
@@ -26,7 +26,7 @@ | |||
26 | static unsigned long icache_size, dcache_size; /* Size in bytes */ | 26 | static unsigned long icache_size, dcache_size; /* Size in bytes */ |
27 | static unsigned long icache_lsize, dcache_lsize; /* Size in bytes */ | 27 | static unsigned long icache_lsize, dcache_lsize; /* Size in bytes */ |
28 | 28 | ||
29 | unsigned long __init r3k_cache_size(unsigned long ca_flags) | 29 | unsigned long __cpuinit r3k_cache_size(unsigned long ca_flags) |
30 | { | 30 | { |
31 | unsigned long flags, status, dummy, size; | 31 | unsigned long flags, status, dummy, size; |
32 | volatile unsigned long *p; | 32 | volatile unsigned long *p; |
@@ -61,7 +61,7 @@ unsigned long __init r3k_cache_size(unsigned long ca_flags) | |||
61 | return size * sizeof(*p); | 61 | return size * sizeof(*p); |
62 | } | 62 | } |
63 | 63 | ||
64 | unsigned long __init r3k_cache_lsize(unsigned long ca_flags) | 64 | unsigned long __cpuinit r3k_cache_lsize(unsigned long ca_flags) |
65 | { | 65 | { |
66 | unsigned long flags, status, lsize, i; | 66 | unsigned long flags, status, lsize, i; |
67 | volatile unsigned long *p; | 67 | volatile unsigned long *p; |
@@ -90,7 +90,7 @@ unsigned long __init r3k_cache_lsize(unsigned long ca_flags) | |||
90 | return lsize * sizeof(*p); | 90 | return lsize * sizeof(*p); |
91 | } | 91 | } |
92 | 92 | ||
93 | static void __init r3k_probe_cache(void) | 93 | static void __cpuinit r3k_probe_cache(void) |
94 | { | 94 | { |
95 | dcache_size = r3k_cache_size(ST0_ISC); | 95 | dcache_size = r3k_cache_size(ST0_ISC); |
96 | if (dcache_size) | 96 | if (dcache_size) |
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index 1edf0cbbeede..1417c6494858 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c | |||
@@ -235,13 +235,12 @@ static void __cpuinit set_prefetch_parameters(void) | |||
235 | } | 235 | } |
236 | /* | 236 | /* |
237 | * Too much unrolling will overflow the available space in | 237 | * Too much unrolling will overflow the available space in |
238 | * clear_space_array / copy_page_array. 8 words sounds generous, | 238 | * clear_space_array / copy_page_array. |
239 | * but a R4000 with 128 byte L2 line length can exceed even that. | ||
240 | */ | 239 | */ |
241 | half_clear_loop_size = min(8 * clear_word_size, | 240 | half_clear_loop_size = min(16 * clear_word_size, |
242 | max(cache_line_size >> 1, | 241 | max(cache_line_size >> 1, |
243 | 4 * clear_word_size)); | 242 | 4 * clear_word_size)); |
244 | half_copy_loop_size = min(8 * copy_word_size, | 243 | half_copy_loop_size = min(16 * copy_word_size, |
245 | max(cache_line_size >> 1, | 244 | max(cache_line_size >> 1, |
246 | 4 * copy_word_size)); | 245 | 4 * copy_word_size)); |
247 | } | 246 | } |
@@ -263,21 +262,23 @@ static inline void __cpuinit build_clear_pref(u32 **buf, int off) | |||
263 | if (pref_bias_clear_store) { | 262 | if (pref_bias_clear_store) { |
264 | uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off, | 263 | uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off, |
265 | A0); | 264 | A0); |
266 | } else if (cpu_has_cache_cdex_s) { | 265 | } else if (cache_line_size == (half_clear_loop_size << 1)) { |
267 | uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); | 266 | if (cpu_has_cache_cdex_s) { |
268 | } else if (cpu_has_cache_cdex_p) { | 267 | uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); |
269 | if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { | 268 | } else if (cpu_has_cache_cdex_p) { |
270 | uasm_i_nop(buf); | 269 | if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { |
271 | uasm_i_nop(buf); | 270 | uasm_i_nop(buf); |
272 | uasm_i_nop(buf); | 271 | uasm_i_nop(buf); |
273 | uasm_i_nop(buf); | 272 | uasm_i_nop(buf); |
274 | } | 273 | uasm_i_nop(buf); |
274 | } | ||
275 | 275 | ||
276 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) | 276 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) |
277 | uasm_i_lw(buf, ZERO, ZERO, AT); | 277 | uasm_i_lw(buf, ZERO, ZERO, AT); |
278 | 278 | ||
279 | uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); | 279 | uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); |
280 | } | 280 | } |
281 | } | ||
281 | } | 282 | } |
282 | 283 | ||
283 | void __cpuinit build_clear_page(void) | 284 | void __cpuinit build_clear_page(void) |
@@ -403,20 +404,22 @@ static inline void build_copy_store_pref(u32 **buf, int off) | |||
403 | if (pref_bias_copy_store) { | 404 | if (pref_bias_copy_store) { |
404 | uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off, | 405 | uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off, |
405 | A0); | 406 | A0); |
406 | } else if (cpu_has_cache_cdex_s) { | 407 | } else if (cache_line_size == (half_copy_loop_size << 1)) { |
407 | uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); | 408 | if (cpu_has_cache_cdex_s) { |
408 | } else if (cpu_has_cache_cdex_p) { | 409 | uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); |
409 | if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { | 410 | } else if (cpu_has_cache_cdex_p) { |
410 | uasm_i_nop(buf); | 411 | if (R4600_V1_HIT_CACHEOP_WAR && cpu_is_r4600_v1_x()) { |
411 | uasm_i_nop(buf); | 412 | uasm_i_nop(buf); |
412 | uasm_i_nop(buf); | 413 | uasm_i_nop(buf); |
413 | uasm_i_nop(buf); | 414 | uasm_i_nop(buf); |
414 | } | 415 | uasm_i_nop(buf); |
416 | } | ||
415 | 417 | ||
416 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) | 418 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) |
417 | uasm_i_lw(buf, ZERO, ZERO, AT); | 419 | uasm_i_lw(buf, ZERO, ZERO, AT); |
418 | 420 | ||
419 | uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); | 421 | uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); |
422 | } | ||
420 | } | 423 | } |
421 | } | 424 | } |
422 | 425 | ||
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c index fc227f3b1199..e3abfb2d7e86 100644 --- a/arch/mips/mm/sc-rm7k.c +++ b/arch/mips/mm/sc-rm7k.c | |||
@@ -86,7 +86,7 @@ static void rm7k_sc_inv(unsigned long addr, unsigned long size) | |||
86 | /* | 86 | /* |
87 | * This function is executed in uncached address space. | 87 | * This function is executed in uncached address space. |
88 | */ | 88 | */ |
89 | static __init void __rm7k_sc_enable(void) | 89 | static __cpuinit void __rm7k_sc_enable(void) |
90 | { | 90 | { |
91 | int i; | 91 | int i; |
92 | 92 | ||
@@ -107,7 +107,7 @@ static __init void __rm7k_sc_enable(void) | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | static __init void rm7k_sc_enable(void) | 110 | static __cpuinit void rm7k_sc_enable(void) |
111 | { | 111 | { |
112 | if (read_c0_config() & RM7K_CONF_SE) | 112 | if (read_c0_config() & RM7K_CONF_SE) |
113 | return; | 113 | return; |
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c index b0ea0e43ba48..0d6b6663d5f6 100644 --- a/arch/mips/sgi-ip32/ip32-irq.c +++ b/arch/mips/sgi-ip32/ip32-irq.c | |||
@@ -425,6 +425,11 @@ static void ip32_irq0(void) | |||
425 | BUILD_BUG_ON(MACEISA_SERIAL2_RDMAOR_IRQ - MACEISA_AUDIO_SW_IRQ != 31); | 425 | BUILD_BUG_ON(MACEISA_SERIAL2_RDMAOR_IRQ - MACEISA_AUDIO_SW_IRQ != 31); |
426 | 426 | ||
427 | crime_int = crime->istat & crime_mask; | 427 | crime_int = crime->istat & crime_mask; |
428 | |||
429 | /* crime sometime delivers spurious interrupts, ignore them */ | ||
430 | if (unlikely(crime_int == 0)) | ||
431 | return; | ||
432 | |||
428 | irq = MACE_VID_IN1_IRQ + __ffs(crime_int); | 433 | irq = MACE_VID_IN1_IRQ + __ffs(crime_int); |
429 | 434 | ||
430 | if (crime_int & CRIME_MACEISA_INT_MASK) { | 435 | if (crime_int & CRIME_MACEISA_INT_MASK) { |
diff --git a/arch/mn10300/kernel/mn10300_ksyms.c b/arch/mn10300/kernel/mn10300_ksyms.c index 6d19628634e3..f9eb9753a404 100644 --- a/arch/mn10300/kernel/mn10300_ksyms.c +++ b/arch/mn10300/kernel/mn10300_ksyms.c | |||
@@ -10,8 +10,11 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | #include <asm/pgtable.h> | ||
13 | 14 | ||
14 | 15 | ||
16 | EXPORT_SYMBOL(empty_zero_page); | ||
17 | |||
15 | EXPORT_SYMBOL(change_bit); | 18 | EXPORT_SYMBOL(change_bit); |
16 | EXPORT_SYMBOL(test_and_change_bit); | 19 | EXPORT_SYMBOL(test_and_change_bit); |
17 | 20 | ||
@@ -31,7 +34,9 @@ extern u64 __ashrdi3(u64, unsigned); | |||
31 | extern u64 __ashldi3(u64, unsigned); | 34 | extern u64 __ashldi3(u64, unsigned); |
32 | extern u64 __lshrdi3(u64, unsigned); | 35 | extern u64 __lshrdi3(u64, unsigned); |
33 | extern s64 __negdi2(s64); | 36 | extern s64 __negdi2(s64); |
37 | extern int __ucmpdi2(u64, u64); | ||
34 | EXPORT_SYMBOL(__ashrdi3); | 38 | EXPORT_SYMBOL(__ashrdi3); |
35 | EXPORT_SYMBOL(__ashldi3); | 39 | EXPORT_SYMBOL(__ashldi3); |
36 | EXPORT_SYMBOL(__lshrdi3); | 40 | EXPORT_SYMBOL(__lshrdi3); |
37 | EXPORT_SYMBOL(__negdi2); | 41 | EXPORT_SYMBOL(__negdi2); |
42 | EXPORT_SYMBOL(__ucmpdi2); | ||
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 9c623c88387b..b28c9a60445b 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
@@ -153,6 +153,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | |||
153 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, | 153 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, |
154 | NULL, NULL); | 154 | NULL, NULL); |
155 | } | 155 | } |
156 | EXPORT_SYMBOL(kernel_thread); | ||
156 | 157 | ||
157 | /* | 158 | /* |
158 | * free current thread data structures etc.. | 159 | * free current thread data structures etc.. |
diff --git a/arch/mn10300/lib/Makefile b/arch/mn10300/lib/Makefile index fdfa9ec5b5bb..0cd2346f4c13 100644 --- a/arch/mn10300/lib/Makefile +++ b/arch/mn10300/lib/Makefile | |||
@@ -4,4 +4,4 @@ | |||
4 | 4 | ||
5 | lib-y = delay.o usercopy.o checksum.o bitops.o memcpy.o memmove.o memset.o | 5 | lib-y = delay.o usercopy.o checksum.o bitops.o memcpy.o memmove.o memset.o |
6 | lib-y += do_csum.o | 6 | lib-y += do_csum.o |
7 | lib-y += __ashldi3.o __ashrdi3.o __lshrdi3.o negdi2.o | 7 | lib-y += __ashldi3.o __ashrdi3.o __lshrdi3.o negdi2.o __ucmpdi2.o |
diff --git a/arch/mn10300/lib/__ucmpdi2.S b/arch/mn10300/lib/__ucmpdi2.S new file mode 100644 index 000000000000..60dcbdfe386c --- /dev/null +++ b/arch/mn10300/lib/__ucmpdi2.S | |||
@@ -0,0 +1,43 @@ | |||
1 | /* __ucmpdi2.S: 64-bit unsigned compare | ||
2 | * | ||
3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | |||
13 | .text | ||
14 | .p2align 4 | ||
15 | |||
16 | ############################################################################### | ||
17 | # | ||
18 | # int __ucmpdi2(unsigned long long a [D0:D1], | ||
19 | # unsigned long long b [(SP,12),(SP,16)]) | ||
20 | # | ||
21 | # - returns 0, 1, or 2 as a <, =, > b respectively. | ||
22 | # | ||
23 | ############################################################################### | ||
24 | .globl __ucmpdi2 | ||
25 | .type __ucmpdi2,@function | ||
26 | __ucmpdi2: | ||
27 | mov (12,sp),a0 # b.lsw | ||
28 | mov (16,sp),a1 # b.msw | ||
29 | |||
30 | sub a0,d0 | ||
31 | subc a1,d1 # may clear Z, never sets it | ||
32 | bne __ucmpdi2_differ # a.msw != b.msw | ||
33 | mov +1,d0 | ||
34 | rets | ||
35 | |||
36 | __ucmpdi2_differ: | ||
37 | # C flag is set if LE, clear if GE | ||
38 | subc d0,d0 # -1 if LE, 0 if GE | ||
39 | add +1,d0 # 0 if LE, 1 if GE | ||
40 | add d0,d0 # 0 if LE, 2 if GE | ||
41 | rets | ||
42 | |||
43 | .size __ucmpdi2, .-__ucmpdi2 | ||
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index cf37f5ca4b71..4d96e1db55ee 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -33,13 +33,14 @@ static struct legacy_serial_info { | |||
33 | phys_addr_t taddr; | 33 | phys_addr_t taddr; |
34 | } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; | 34 | } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; |
35 | 35 | ||
36 | static struct __initdata of_device_id parents[] = { | 36 | static struct __initdata of_device_id legacy_serial_parents[] = { |
37 | {.type = "soc",}, | 37 | {.type = "soc",}, |
38 | {.type = "tsi-bridge",}, | 38 | {.type = "tsi-bridge",}, |
39 | {.type = "opb", }, | 39 | {.type = "opb", }, |
40 | {.compatible = "ibm,opb",}, | 40 | {.compatible = "ibm,opb",}, |
41 | {.compatible = "simple-bus",}, | 41 | {.compatible = "simple-bus",}, |
42 | {.compatible = "wrs,epld-localbus",}, | 42 | {.compatible = "wrs,epld-localbus",}, |
43 | {}, | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | static unsigned int legacy_serial_count; | 46 | static unsigned int legacy_serial_count; |
@@ -327,7 +328,7 @@ void __init find_legacy_serial_ports(void) | |||
327 | struct device_node *parent = of_get_parent(np); | 328 | struct device_node *parent = of_get_parent(np); |
328 | if (!parent) | 329 | if (!parent) |
329 | continue; | 330 | continue; |
330 | if (of_match_node(parents, parent) != NULL) { | 331 | if (of_match_node(legacy_serial_parents, parent) != NULL) { |
331 | index = add_legacy_soc_port(np, np); | 332 | index = add_legacy_soc_port(np, np); |
332 | if (index >= 0 && np == stdout) | 333 | if (index >= 0 && np == stdout) |
333 | legacy_serial_console = index; | 334 | legacy_serial_console = index; |
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c index e79ad8afda07..3f37a6e62771 100644 --- a/arch/powerpc/kernel/of_platform.c +++ b/arch/powerpc/kernel/of_platform.c | |||
@@ -76,6 +76,8 @@ struct of_device* of_platform_device_create(struct device_node *np, | |||
76 | return NULL; | 76 | return NULL; |
77 | 77 | ||
78 | dev->dma_mask = 0xffffffffUL; | 78 | dev->dma_mask = 0xffffffffUL; |
79 | dev->dev.coherent_dma_mask = DMA_32BIT_MASK; | ||
80 | |||
79 | dev->dev.bus = &of_platform_bus_type; | 81 | dev->dev.bus = &of_platform_bus_type; |
80 | 82 | ||
81 | /* We do not fill the DMA ops for platform devices by default. | 83 | /* We do not fill the DMA ops for platform devices by default. |
diff --git a/arch/um/Makefile b/arch/um/Makefile index dbeab15e7bb7..ca40397017b9 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -77,7 +77,6 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | |||
77 | KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ | 77 | KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ |
78 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) | 78 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) |
79 | KBUILD_CFLAGS += $(KERNEL_DEFINES) | 79 | KBUILD_CFLAGS += $(KERNEL_DEFINES) |
80 | KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) | ||
81 | 80 | ||
82 | PHONY += linux | 81 | PHONY += linux |
83 | 82 | ||
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 561e373bd850..302cbe504543 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
@@ -32,4 +32,11 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | |||
32 | # an unresolved reference. | 32 | # an unresolved reference. |
33 | cflags-y += -ffreestanding | 33 | cflags-y += -ffreestanding |
34 | 34 | ||
35 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use | ||
36 | # a lot more stack due to the lack of sharing of stacklots. Also, gcc | ||
37 | # 4.3.0 needs -funit-at-a-time for extern inline functions. | ||
38 | KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \ | ||
39 | echo $(call cc-option,-fno-unit-at-a-time); \ | ||
40 | else echo $(call cc-option,-funit-at-a-time); fi ;) | ||
41 | |||
35 | KBUILD_CFLAGS += $(cflags-y) | 42 | KBUILD_CFLAGS += $(cflags-y) |
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 8ed362f93582..a9cd7e77a7ab 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 | |||
@@ -21,3 +21,6 @@ HEADER_ARCH := x86 | |||
21 | 21 | ||
22 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 | 22 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 |
23 | LINK-y += -m64 | 23 | LINK-y += -m64 |
24 | |||
25 | # Do unit-at-a-time unconditionally on x86_64, following the host | ||
26 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) | ||
diff --git a/arch/x86/kernel/.gitignore b/arch/x86/kernel/.gitignore index 4ea38a39aed4..08f4fd731469 100644 --- a/arch/x86/kernel/.gitignore +++ b/arch/x86/kernel/.gitignore | |||
@@ -1,2 +1,3 @@ | |||
1 | vsyscall.lds | 1 | vsyscall.lds |
2 | vsyscall_32.lds | 2 | vsyscall_32.lds |
3 | vmlinux.lds | ||
diff --git a/arch/x86/kernel/acpi/realmode/wakeup.S b/arch/x86/kernel/acpi/realmode/wakeup.S index f9b77fb37e5b..3355973b12ac 100644 --- a/arch/x86/kernel/acpi/realmode/wakeup.S +++ b/arch/x86/kernel/acpi/realmode/wakeup.S | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <asm/msr-index.h> | 5 | #include <asm/msr-index.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <asm/pgtable.h> | 7 | #include <asm/pgtable.h> |
8 | #include <asm/processor-flags.h> | ||
8 | 9 | ||
9 | .code16 | 10 | .code16 |
10 | .section ".header", "a" | 11 | .section ".header", "a" |
@@ -24,6 +25,11 @@ pmode_gdt: .quad 0 | |||
24 | realmode_flags: .long 0 | 25 | realmode_flags: .long 0 |
25 | real_magic: .long 0 | 26 | real_magic: .long 0 |
26 | trampoline_segment: .word 0 | 27 | trampoline_segment: .word 0 |
28 | _pad1: .byte 0 | ||
29 | wakeup_jmp: .byte 0xea /* ljmpw */ | ||
30 | wakeup_jmp_off: .word 3f | ||
31 | wakeup_jmp_seg: .word 0 | ||
32 | wakeup_gdt: .quad 0, 0, 0 | ||
27 | signature: .long 0x51ee1111 | 33 | signature: .long 0x51ee1111 |
28 | 34 | ||
29 | .text | 35 | .text |
@@ -34,11 +40,34 @@ _start: | |||
34 | cli | 40 | cli |
35 | cld | 41 | cld |
36 | 42 | ||
43 | /* Apparently some dimwit BIOS programmers don't know how to | ||
44 | program a PM to RM transition, and we might end up here with | ||
45 | junk in the data segment descriptor registers. The only way | ||
46 | to repair that is to go into PM and fix it ourselves... */ | ||
47 | movw $16, %cx | ||
48 | lgdtl %cs:wakeup_gdt | ||
49 | movl %cr0, %eax | ||
50 | orb $X86_CR0_PE, %al | ||
51 | movl %eax, %cr0 | ||
52 | jmp 1f | ||
53 | 1: ljmpw $8, $2f | ||
54 | 2: | ||
55 | movw %cx, %ds | ||
56 | movw %cx, %es | ||
57 | movw %cx, %ss | ||
58 | movw %cx, %fs | ||
59 | movw %cx, %gs | ||
60 | |||
61 | andb $~X86_CR0_PE, %al | ||
62 | movl %eax, %cr0 | ||
63 | jmp wakeup_jmp | ||
64 | 3: | ||
37 | /* Set up segments */ | 65 | /* Set up segments */ |
38 | movw %cs, %ax | 66 | movw %cs, %ax |
39 | movw %ax, %ds | 67 | movw %ax, %ds |
40 | movw %ax, %es | 68 | movw %ax, %es |
41 | movw %ax, %ss | 69 | movw %ax, %ss |
70 | lidtl wakeup_idt | ||
42 | 71 | ||
43 | movl $wakeup_stack_end, %esp | 72 | movl $wakeup_stack_end, %esp |
44 | 73 | ||
@@ -98,7 +127,14 @@ bogus_real_magic: | |||
98 | jmp 1b | 127 | jmp 1b |
99 | 128 | ||
100 | .data | 129 | .data |
101 | .balign 4 | 130 | .balign 8 |
131 | |||
132 | /* This is the standard real-mode IDT */ | ||
133 | wakeup_idt: | ||
134 | .word 0xffff /* limit */ | ||
135 | .long 0 /* address */ | ||
136 | .word 0 | ||
137 | |||
102 | .globl HEAP, heap_end | 138 | .globl HEAP, heap_end |
103 | HEAP: | 139 | HEAP: |
104 | .long wakeup_heap | 140 | .long wakeup_heap |
diff --git a/arch/x86/kernel/acpi/realmode/wakeup.h b/arch/x86/kernel/acpi/realmode/wakeup.h index ef8166fe8020..69d38d0b2b64 100644 --- a/arch/x86/kernel/acpi/realmode/wakeup.h +++ b/arch/x86/kernel/acpi/realmode/wakeup.h | |||
@@ -24,6 +24,11 @@ struct wakeup_header { | |||
24 | u32 realmode_flags; | 24 | u32 realmode_flags; |
25 | u32 real_magic; | 25 | u32 real_magic; |
26 | u16 trampoline_segment; /* segment with trampoline code, 64-bit only */ | 26 | u16 trampoline_segment; /* segment with trampoline code, 64-bit only */ |
27 | u8 _pad1; | ||
28 | u8 wakeup_jmp; | ||
29 | u16 wakeup_jmp_off; | ||
30 | u16 wakeup_jmp_seg; | ||
31 | u64 wakeup_gdt[3]; | ||
27 | u32 signature; /* To check we have correct structure */ | 32 | u32 signature; /* To check we have correct structure */ |
28 | } __attribute__((__packed__)); | 33 | } __attribute__((__packed__)); |
29 | 34 | ||
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index afc25ee9964b..36af01f029ed 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -50,6 +50,20 @@ int acpi_save_state_mem(void) | |||
50 | 50 | ||
51 | header->video_mode = saved_video_mode; | 51 | header->video_mode = saved_video_mode; |
52 | 52 | ||
53 | header->wakeup_jmp_seg = acpi_wakeup_address >> 4; | ||
54 | /* GDT[0]: GDT self-pointer */ | ||
55 | header->wakeup_gdt[0] = | ||
56 | (u64)(sizeof(header->wakeup_gdt) - 1) + | ||
57 | ((u64)(acpi_wakeup_address + | ||
58 | ((char *)&header->wakeup_gdt - (char *)acpi_realmode)) | ||
59 | << 16); | ||
60 | /* GDT[1]: real-mode-like code segment */ | ||
61 | header->wakeup_gdt[1] = (0x009bULL << 40) + | ||
62 | ((u64)acpi_wakeup_address << 16) + 0xffff; | ||
63 | /* GDT[2]: real-mode-like data segment */ | ||
64 | header->wakeup_gdt[2] = (0x0093ULL << 40) + | ||
65 | ((u64)acpi_wakeup_address << 16) + 0xffff; | ||
66 | |||
53 | #ifndef CONFIG_64BIT | 67 | #ifndef CONFIG_64BIT |
54 | store_gdt((struct desc_ptr *)&header->pmode_gdt); | 68 | store_gdt((struct desc_ptr *)&header->pmode_gdt); |
55 | 69 | ||
@@ -111,7 +125,7 @@ void __init acpi_reserve_bootmem(void) | |||
111 | return; | 125 | return; |
112 | } | 126 | } |
113 | 127 | ||
114 | acpi_wakeup_address = acpi_realmode; | 128 | acpi_wakeup_address = virt_to_phys((void *)acpi_realmode); |
115 | } | 129 | } |
116 | 130 | ||
117 | 131 | ||
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c index 5d23d85624d4..4b63c8e1f13b 100644 --- a/arch/x86/kernel/efi_32.c +++ b/arch/x86/kernel/efi_32.c | |||
@@ -49,13 +49,13 @@ void efi_call_phys_prelog(void) | |||
49 | local_irq_save(efi_rt_eflags); | 49 | local_irq_save(efi_rt_eflags); |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * If I don't have PSE, I should just duplicate two entries in page | 52 | * If I don't have PAE, I should just duplicate two entries in page |
53 | * directory. If I have PSE, I just need to duplicate one entry in | 53 | * directory. If I have PAE, I just need to duplicate one entry in |
54 | * page directory. | 54 | * page directory. |
55 | */ | 55 | */ |
56 | cr4 = read_cr4(); | 56 | cr4 = read_cr4(); |
57 | 57 | ||
58 | if (cr4 & X86_CR4_PSE) { | 58 | if (cr4 & X86_CR4_PAE) { |
59 | efi_bak_pg_dir_pointer[0].pgd = | 59 | efi_bak_pg_dir_pointer[0].pgd = |
60 | swapper_pg_dir[pgd_index(0)].pgd; | 60 | swapper_pg_dir[pgd_index(0)].pgd; |
61 | swapper_pg_dir[0].pgd = | 61 | swapper_pg_dir[0].pgd = |
@@ -93,7 +93,7 @@ void efi_call_phys_epilog(void) | |||
93 | 93 | ||
94 | cr4 = read_cr4(); | 94 | cr4 = read_cr4(); |
95 | 95 | ||
96 | if (cr4 & X86_CR4_PSE) { | 96 | if (cr4 & X86_CR4_PAE) { |
97 | swapper_pg_dir[pgd_index(0)].pgd = | 97 | swapper_pg_dir[pgd_index(0)].pgd = |
98 | efi_bak_pg_dir_pointer[0].pgd; | 98 | efi_bak_pg_dir_pointer[0].pgd; |
99 | } else { | 99 | } else { |
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 10a1955bb1d1..b817974ef942 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
@@ -128,7 +128,7 @@ ident_complete: | |||
128 | /* Fixup phys_base */ | 128 | /* Fixup phys_base */ |
129 | addq %rbp, phys_base(%rip) | 129 | addq %rbp, phys_base(%rip) |
130 | 130 | ||
131 | #ifdef CONFIG_SMP | 131 | #ifdef CONFIG_X86_TRAMPOLINE |
132 | addq %rbp, trampoline_level4_pgt + 0(%rip) | 132 | addq %rbp, trampoline_level4_pgt + 0(%rip) |
133 | addq %rbp, trampoline_level4_pgt + (511*8)(%rip) | 133 | addq %rbp, trampoline_level4_pgt + (511*8)(%rip) |
134 | #endif | 134 | #endif |
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index adff76ea97c4..f1a95d105953 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -104,30 +104,7 @@ int kstack_depth_to_print = 12; | |||
104 | 104 | ||
105 | void printk_address(unsigned long address, int reliable) | 105 | void printk_address(unsigned long address, int reliable) |
106 | { | 106 | { |
107 | #ifdef CONFIG_KALLSYMS | 107 | printk(" [<%016lx>] %s%pS\n", address, reliable ? "": "? ", (void *) address); |
108 | unsigned long offset = 0, symsize; | ||
109 | const char *symname; | ||
110 | char *modname; | ||
111 | char *delim = ":"; | ||
112 | char namebuf[KSYM_NAME_LEN]; | ||
113 | char reliab[4] = ""; | ||
114 | |||
115 | symname = kallsyms_lookup(address, &symsize, &offset, | ||
116 | &modname, namebuf); | ||
117 | if (!symname) { | ||
118 | printk(" [<%016lx>]\n", address); | ||
119 | return; | ||
120 | } | ||
121 | if (!reliable) | ||
122 | strcpy(reliab, "? "); | ||
123 | |||
124 | if (!modname) | ||
125 | modname = delim = ""; | ||
126 | printk(" [<%016lx>] %s%s%s%s%s+0x%lx/0x%lx\n", | ||
127 | address, reliab, delim, modname, delim, symname, offset, symsize); | ||
128 | #else | ||
129 | printk(" [<%016lx>]\n", address); | ||
130 | #endif | ||
131 | } | 108 | } |
132 | 109 | ||
133 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, | 110 | static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index f6d20be7a8f4..819dad973b13 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -506,7 +506,7 @@ early_param("memtest", parse_memtest); | |||
506 | 506 | ||
507 | static void __init early_memtest(unsigned long start, unsigned long end) | 507 | static void __init early_memtest(unsigned long start, unsigned long end) |
508 | { | 508 | { |
509 | unsigned long t_start, t_size; | 509 | u64 t_start, t_size; |
510 | unsigned pattern; | 510 | unsigned pattern; |
511 | 511 | ||
512 | if (!memtest_pattern) | 512 | if (!memtest_pattern) |
@@ -525,8 +525,9 @@ static void __init early_memtest(unsigned long start, unsigned long end) | |||
525 | if (t_start + t_size > end) | 525 | if (t_start + t_size > end) |
526 | t_size = end - t_start; | 526 | t_size = end - t_start; |
527 | 527 | ||
528 | printk(KERN_CONT "\n %016lx - %016lx pattern %d", | 528 | printk(KERN_CONT "\n %016llx - %016llx pattern %d", |
529 | t_start, t_start + t_size, pattern); | 529 | (unsigned long long)t_start, |
530 | (unsigned long long)t_start + t_size, pattern); | ||
530 | 531 | ||
531 | memtest(t_start, t_size, pattern); | 532 | memtest(t_start, t_size, pattern); |
532 | 533 | ||
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 2b2bb3f9b683..d1b867101e5f 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -300,6 +300,29 @@ void __iomem *ioremap_cache(resource_size_t phys_addr, unsigned long size) | |||
300 | } | 300 | } |
301 | EXPORT_SYMBOL(ioremap_cache); | 301 | EXPORT_SYMBOL(ioremap_cache); |
302 | 302 | ||
303 | static void __iomem *ioremap_default(resource_size_t phys_addr, | ||
304 | unsigned long size) | ||
305 | { | ||
306 | unsigned long flags; | ||
307 | void *ret; | ||
308 | int err; | ||
309 | |||
310 | /* | ||
311 | * - WB for WB-able memory and no other conflicting mappings | ||
312 | * - UC_MINUS for non-WB-able memory with no other conflicting mappings | ||
313 | * - Inherit from confliting mappings otherwise | ||
314 | */ | ||
315 | err = reserve_memtype(phys_addr, phys_addr + size, -1, &flags); | ||
316 | if (err < 0) | ||
317 | return NULL; | ||
318 | |||
319 | ret = (void *) __ioremap_caller(phys_addr, size, flags, | ||
320 | __builtin_return_address(0)); | ||
321 | |||
322 | free_memtype(phys_addr, phys_addr + size); | ||
323 | return (void __iomem *)ret; | ||
324 | } | ||
325 | |||
303 | /** | 326 | /** |
304 | * iounmap - Free a IO remapping | 327 | * iounmap - Free a IO remapping |
305 | * @addr: virtual address from ioremap_* | 328 | * @addr: virtual address from ioremap_* |
@@ -365,7 +388,7 @@ void *xlate_dev_mem_ptr(unsigned long phys) | |||
365 | if (page_is_ram(start >> PAGE_SHIFT)) | 388 | if (page_is_ram(start >> PAGE_SHIFT)) |
366 | return __va(phys); | 389 | return __va(phys); |
367 | 390 | ||
368 | addr = (void *)ioremap(start, PAGE_SIZE); | 391 | addr = (void *)ioremap_default(start, PAGE_SIZE); |
369 | if (addr) | 392 | if (addr) |
370 | addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK)); | 393 | addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK)); |
371 | 394 | ||
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 940185ecaeda..6e64aaf00d1d 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -328,18 +328,18 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = { | |||
328 | #endif | 328 | #endif |
329 | { | 329 | { |
330 | .callback = set_bf_sort, | 330 | .callback = set_bf_sort, |
331 | .ident = "HP ProLiant DL360", | 331 | .ident = "HP ProLiant DL385 G2", |
332 | .matches = { | 332 | .matches = { |
333 | DMI_MATCH(DMI_SYS_VENDOR, "HP"), | 333 | DMI_MATCH(DMI_SYS_VENDOR, "HP"), |
334 | DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"), | 334 | DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"), |
335 | }, | 335 | }, |
336 | }, | 336 | }, |
337 | { | 337 | { |
338 | .callback = set_bf_sort, | 338 | .callback = set_bf_sort, |
339 | .ident = "HP ProLiant DL380", | 339 | .ident = "HP ProLiant DL585 G2", |
340 | .matches = { | 340 | .matches = { |
341 | DMI_MATCH(DMI_SYS_VENDOR, "HP"), | 341 | DMI_MATCH(DMI_SYS_VENDOR, "HP"), |
342 | DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"), | 342 | DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"), |
343 | }, | 343 | }, |
344 | }, | 344 | }, |
345 | {} | 345 | {} |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index df40bf74ea75..4e527e7893a8 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -185,7 +185,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
185 | if (val & _PAGE_PRESENT) { | 185 | if (val & _PAGE_PRESENT) { |
186 | unsigned long mfn = (val & PTE_MASK) >> PAGE_SHIFT; | 186 | unsigned long mfn = (val & PTE_MASK) >> PAGE_SHIFT; |
187 | pteval_t flags = val & ~PTE_MASK; | 187 | pteval_t flags = val & ~PTE_MASK; |
188 | val = (mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; | 188 | val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; |
189 | } | 189 | } |
190 | 190 | ||
191 | return val; | 191 | return val; |
@@ -196,7 +196,7 @@ static pteval_t pte_pfn_to_mfn(pteval_t val) | |||
196 | if (val & _PAGE_PRESENT) { | 196 | if (val & _PAGE_PRESENT) { |
197 | unsigned long pfn = (val & PTE_MASK) >> PAGE_SHIFT; | 197 | unsigned long pfn = (val & PTE_MASK) >> PAGE_SHIFT; |
198 | pteval_t flags = val & ~PTE_MASK; | 198 | pteval_t flags = val & ~PTE_MASK; |
199 | val = (pfn_to_mfn(pfn) << PAGE_SHIFT) | flags; | 199 | val = ((pteval_t)pfn_to_mfn(pfn) << PAGE_SHIFT) | flags; |
200 | } | 200 | } |
201 | 201 | ||
202 | return val; | 202 | return val; |
diff --git a/block/bsg.c b/block/bsg.c index 439940c3a1ff..93e757d7174b 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -723,11 +723,12 @@ static void bsg_kref_release_function(struct kref *kref) | |||
723 | { | 723 | { |
724 | struct bsg_class_device *bcd = | 724 | struct bsg_class_device *bcd = |
725 | container_of(kref, struct bsg_class_device, ref); | 725 | container_of(kref, struct bsg_class_device, ref); |
726 | struct device *parent = bcd->parent; | ||
726 | 727 | ||
727 | if (bcd->release) | 728 | if (bcd->release) |
728 | bcd->release(bcd->parent); | 729 | bcd->release(bcd->parent); |
729 | 730 | ||
730 | put_device(bcd->parent); | 731 | put_device(parent); |
731 | } | 732 | } |
732 | 733 | ||
733 | static int bsg_put_device(struct bsg_device *bd) | 734 | static int bsg_put_device(struct bsg_device *bd) |
diff --git a/crypto/chainiv.c b/crypto/chainiv.c index 6da3f577e4db..9affadee3287 100644 --- a/crypto/chainiv.c +++ b/crypto/chainiv.c | |||
@@ -117,6 +117,7 @@ static int chainiv_init(struct crypto_tfm *tfm) | |||
117 | static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) | 117 | static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) |
118 | { | 118 | { |
119 | int queued; | 119 | int queued; |
120 | int err = ctx->err; | ||
120 | 121 | ||
121 | if (!ctx->queue.qlen) { | 122 | if (!ctx->queue.qlen) { |
122 | smp_mb__before_clear_bit(); | 123 | smp_mb__before_clear_bit(); |
@@ -131,7 +132,7 @@ static int async_chainiv_schedule_work(struct async_chainiv_ctx *ctx) | |||
131 | BUG_ON(!queued); | 132 | BUG_ON(!queued); |
132 | 133 | ||
133 | out: | 134 | out: |
134 | return ctx->err; | 135 | return err; |
135 | } | 136 | } |
136 | 137 | ||
137 | static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) | 138 | static int async_chainiv_postpone_request(struct skcipher_givcrypt_request *req) |
@@ -227,6 +228,7 @@ static void async_chainiv_do_postponed(struct work_struct *work) | |||
227 | postponed); | 228 | postponed); |
228 | struct skcipher_givcrypt_request *req; | 229 | struct skcipher_givcrypt_request *req; |
229 | struct ablkcipher_request *subreq; | 230 | struct ablkcipher_request *subreq; |
231 | int err; | ||
230 | 232 | ||
231 | /* Only handle one request at a time to avoid hogging keventd. */ | 233 | /* Only handle one request at a time to avoid hogging keventd. */ |
232 | spin_lock_bh(&ctx->lock); | 234 | spin_lock_bh(&ctx->lock); |
@@ -241,7 +243,11 @@ static void async_chainiv_do_postponed(struct work_struct *work) | |||
241 | subreq = skcipher_givcrypt_reqctx(req); | 243 | subreq = skcipher_givcrypt_reqctx(req); |
242 | subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; | 244 | subreq->base.flags |= CRYPTO_TFM_REQ_MAY_SLEEP; |
243 | 245 | ||
244 | async_chainiv_givencrypt_tail(req); | 246 | err = async_chainiv_givencrypt_tail(req); |
247 | |||
248 | local_bh_disable(); | ||
249 | skcipher_givcrypt_complete(req, err); | ||
250 | local_bh_enable(); | ||
245 | } | 251 | } |
246 | 252 | ||
247 | static int async_chainiv_init(struct crypto_tfm *tfm) | 253 | static int async_chainiv_init(struct crypto_tfm *tfm) |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 6beabc5abd07..e47f6e02133c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -586,12 +586,6 @@ static void test_cipher(char *algo, int enc, | |||
586 | j = 0; | 586 | j = 0; |
587 | for (i = 0; i < tcount; i++) { | 587 | for (i = 0; i < tcount; i++) { |
588 | 588 | ||
589 | data = kzalloc(template[i].ilen, GFP_KERNEL); | ||
590 | if (!data) | ||
591 | continue; | ||
592 | |||
593 | memcpy(data, template[i].input, template[i].ilen); | ||
594 | |||
595 | if (template[i].iv) | 589 | if (template[i].iv) |
596 | memcpy(iv, template[i].iv, MAX_IVLEN); | 590 | memcpy(iv, template[i].iv, MAX_IVLEN); |
597 | else | 591 | else |
@@ -613,10 +607,8 @@ static void test_cipher(char *algo, int enc, | |||
613 | printk("setkey() failed flags=%x\n", | 607 | printk("setkey() failed flags=%x\n", |
614 | crypto_ablkcipher_get_flags(tfm)); | 608 | crypto_ablkcipher_get_flags(tfm)); |
615 | 609 | ||
616 | if (!template[i].fail) { | 610 | if (!template[i].fail) |
617 | kfree(data); | ||
618 | goto out; | 611 | goto out; |
619 | } | ||
620 | } | 612 | } |
621 | 613 | ||
622 | temp = 0; | 614 | temp = 0; |
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index c3b0cd88d09f..495c63a3e0af 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -36,9 +36,8 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
36 | if (!acpi_wakeup_address) { | 36 | if (!acpi_wakeup_address) { |
37 | return -EFAULT; | 37 | return -EFAULT; |
38 | } | 38 | } |
39 | acpi_set_firmware_waking_vector((acpi_physical_address) | 39 | acpi_set_firmware_waking_vector( |
40 | virt_to_phys((void *) | 40 | (acpi_physical_address)acpi_wakeup_address); |
41 | acpi_wakeup_address)); | ||
42 | 41 | ||
43 | } | 42 | } |
44 | ACPI_FLUSH_CPU_CACHE(); | 43 | ACPI_FLUSH_CPU_CACHE(); |
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c index 224c57c03381..4ebbba2b6b19 100644 --- a/drivers/acpi/sleep/proc.c +++ b/drivers/acpi/sleep/proc.c | |||
@@ -315,8 +315,11 @@ acpi_system_write_alarm(struct file *file, | |||
315 | cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, rtc_control); | 315 | cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, rtc_control); |
316 | if (acpi_gbl_FADT.month_alarm) | 316 | if (acpi_gbl_FADT.month_alarm) |
317 | cmos_bcd_write(mo, acpi_gbl_FADT.month_alarm, rtc_control); | 317 | cmos_bcd_write(mo, acpi_gbl_FADT.month_alarm, rtc_control); |
318 | if (acpi_gbl_FADT.century) | 318 | if (acpi_gbl_FADT.century) { |
319 | if (adjust) | ||
320 | yr += cmos_bcd_read(acpi_gbl_FADT.century, rtc_control) * 100; | ||
319 | cmos_bcd_write(yr / 100, acpi_gbl_FADT.century, rtc_control); | 321 | cmos_bcd_write(yr / 100, acpi_gbl_FADT.century, rtc_control); |
322 | } | ||
320 | /* enable the rtc alarm interrupt */ | 323 | /* enable the rtc alarm interrupt */ |
321 | rtc_control |= RTC_AIE; | 324 | rtc_control |= RTC_AIE; |
322 | CMOS_WRITE(rtc_control, RTC_CONTROL); | 325 | CMOS_WRITE(rtc_control, RTC_CONTROL); |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 6a4a2a25d97a..5e6468a7ca4b 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -1777,7 +1777,7 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance) | |||
1777 | struct ahci_host_priv *hpriv; | 1777 | struct ahci_host_priv *hpriv; |
1778 | unsigned int i, handled = 0; | 1778 | unsigned int i, handled = 0; |
1779 | void __iomem *mmio; | 1779 | void __iomem *mmio; |
1780 | u32 irq_stat, irq_ack = 0; | 1780 | u32 irq_stat, irq_masked; |
1781 | 1781 | ||
1782 | VPRINTK("ENTER\n"); | 1782 | VPRINTK("ENTER\n"); |
1783 | 1783 | ||
@@ -1786,16 +1786,17 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance) | |||
1786 | 1786 | ||
1787 | /* sigh. 0xffffffff is a valid return from h/w */ | 1787 | /* sigh. 0xffffffff is a valid return from h/w */ |
1788 | irq_stat = readl(mmio + HOST_IRQ_STAT); | 1788 | irq_stat = readl(mmio + HOST_IRQ_STAT); |
1789 | irq_stat &= hpriv->port_map; | ||
1790 | if (!irq_stat) | 1789 | if (!irq_stat) |
1791 | return IRQ_NONE; | 1790 | return IRQ_NONE; |
1792 | 1791 | ||
1792 | irq_masked = irq_stat & hpriv->port_map; | ||
1793 | |||
1793 | spin_lock(&host->lock); | 1794 | spin_lock(&host->lock); |
1794 | 1795 | ||
1795 | for (i = 0; i < host->n_ports; i++) { | 1796 | for (i = 0; i < host->n_ports; i++) { |
1796 | struct ata_port *ap; | 1797 | struct ata_port *ap; |
1797 | 1798 | ||
1798 | if (!(irq_stat & (1 << i))) | 1799 | if (!(irq_masked & (1 << i))) |
1799 | continue; | 1800 | continue; |
1800 | 1801 | ||
1801 | ap = host->ports[i]; | 1802 | ap = host->ports[i]; |
@@ -1809,14 +1810,20 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance) | |||
1809 | "interrupt on disabled port %u\n", i); | 1810 | "interrupt on disabled port %u\n", i); |
1810 | } | 1811 | } |
1811 | 1812 | ||
1812 | irq_ack |= (1 << i); | ||
1813 | } | ||
1814 | |||
1815 | if (irq_ack) { | ||
1816 | writel(irq_ack, mmio + HOST_IRQ_STAT); | ||
1817 | handled = 1; | 1813 | handled = 1; |
1818 | } | 1814 | } |
1819 | 1815 | ||
1816 | /* HOST_IRQ_STAT behaves as level triggered latch meaning that | ||
1817 | * it should be cleared after all the port events are cleared; | ||
1818 | * otherwise, it will raise a spurious interrupt after each | ||
1819 | * valid one. Please read section 10.6.2 of ahci 1.1 for more | ||
1820 | * information. | ||
1821 | * | ||
1822 | * Also, use the unmasked value to clear interrupt as spurious | ||
1823 | * pending event on a dummy port might cause screaming IRQ. | ||
1824 | */ | ||
1825 | writel(irq_stat, mmio + HOST_IRQ_STAT); | ||
1826 | |||
1820 | spin_unlock(&host->lock); | 1827 | spin_unlock(&host->lock); |
1821 | 1828 | ||
1822 | VPRINTK("EXIT\n"); | 1829 | VPRINTK("EXIT\n"); |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 3ff8b14420d9..9330b7922f62 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -29,14 +29,16 @@ | |||
29 | enum { | 29 | enum { |
30 | ATA_ACPI_FILTER_SETXFER = 1 << 0, | 30 | ATA_ACPI_FILTER_SETXFER = 1 << 0, |
31 | ATA_ACPI_FILTER_LOCK = 1 << 1, | 31 | ATA_ACPI_FILTER_LOCK = 1 << 1, |
32 | ATA_ACPI_FILTER_DIPM = 1 << 2, | ||
32 | 33 | ||
33 | ATA_ACPI_FILTER_DEFAULT = ATA_ACPI_FILTER_SETXFER | | 34 | ATA_ACPI_FILTER_DEFAULT = ATA_ACPI_FILTER_SETXFER | |
34 | ATA_ACPI_FILTER_LOCK, | 35 | ATA_ACPI_FILTER_LOCK | |
36 | ATA_ACPI_FILTER_DIPM, | ||
35 | }; | 37 | }; |
36 | 38 | ||
37 | static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; | 39 | static unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT; |
38 | module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); | 40 | module_param_named(acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644); |
39 | MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock)"); | 41 | MODULE_PARM_DESC(acpi_gtf_filter, "filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM)"); |
40 | 42 | ||
41 | #define NO_PORT_MULT 0xffff | 43 | #define NO_PORT_MULT 0xffff |
42 | #define SATA_ADR(root, pmp) (((root) << 16) | (pmp)) | 44 | #define SATA_ADR(root, pmp) (((root) << 16) | (pmp)) |
@@ -195,6 +197,10 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, | |||
195 | /* This device does not support hotplug */ | 197 | /* This device does not support hotplug */ |
196 | return; | 198 | return; |
197 | 199 | ||
200 | if (event == ACPI_NOTIFY_BUS_CHECK || | ||
201 | event == ACPI_NOTIFY_DEVICE_CHECK) | ||
202 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); | ||
203 | |||
198 | spin_lock_irqsave(ap->lock, flags); | 204 | spin_lock_irqsave(ap->lock, flags); |
199 | 205 | ||
200 | switch (event) { | 206 | switch (event) { |
@@ -202,7 +208,6 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, | |||
202 | case ACPI_NOTIFY_DEVICE_CHECK: | 208 | case ACPI_NOTIFY_DEVICE_CHECK: |
203 | ata_ehi_push_desc(ehi, "ACPI event"); | 209 | ata_ehi_push_desc(ehi, "ACPI event"); |
204 | 210 | ||
205 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); | ||
206 | if (ACPI_FAILURE(status)) { | 211 | if (ACPI_FAILURE(status)) { |
207 | ata_port_printk(ap, KERN_ERR, | 212 | ata_port_printk(ap, KERN_ERR, |
208 | "acpi: failed to determine bay status (0x%x)\n", | 213 | "acpi: failed to determine bay status (0x%x)\n", |
@@ -690,6 +695,14 @@ static int ata_acpi_filter_tf(const struct ata_taskfile *tf, | |||
690 | return 1; | 695 | return 1; |
691 | } | 696 | } |
692 | 697 | ||
698 | if (ata_acpi_gtf_filter & ATA_ACPI_FILTER_DIPM) { | ||
699 | /* inhibit enabling DIPM */ | ||
700 | if (tf->command == ATA_CMD_SET_FEATURES && | ||
701 | tf->feature == SETFEATURES_SATA_ENABLE && | ||
702 | tf->nsect == SATA_DIPM) | ||
703 | return 1; | ||
704 | } | ||
705 | |||
693 | return 0; | 706 | return 0; |
694 | } | 707 | } |
695 | 708 | ||
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 215d18672a5a..c0908c225483 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1094,6 +1094,7 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) | |||
1094 | int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | 1094 | int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, |
1095 | u8 status, int in_wq) | 1095 | u8 status, int in_wq) |
1096 | { | 1096 | { |
1097 | struct ata_eh_info *ehi = &ap->link.eh_info; | ||
1097 | unsigned long flags = 0; | 1098 | unsigned long flags = 0; |
1098 | int poll_next; | 1099 | int poll_next; |
1099 | 1100 | ||
@@ -1125,9 +1126,12 @@ fsm_start: | |||
1125 | if (likely(status & (ATA_ERR | ATA_DF))) | 1126 | if (likely(status & (ATA_ERR | ATA_DF))) |
1126 | /* device stops HSM for abort/error */ | 1127 | /* device stops HSM for abort/error */ |
1127 | qc->err_mask |= AC_ERR_DEV; | 1128 | qc->err_mask |= AC_ERR_DEV; |
1128 | else | 1129 | else { |
1129 | /* HSM violation. Let EH handle this */ | 1130 | /* HSM violation. Let EH handle this */ |
1131 | ata_ehi_push_desc(ehi, | ||
1132 | "ST_FIRST: !(DRQ|ERR|DF)"); | ||
1130 | qc->err_mask |= AC_ERR_HSM; | 1133 | qc->err_mask |= AC_ERR_HSM; |
1134 | } | ||
1131 | 1135 | ||
1132 | ap->hsm_task_state = HSM_ST_ERR; | 1136 | ap->hsm_task_state = HSM_ST_ERR; |
1133 | goto fsm_start; | 1137 | goto fsm_start; |
@@ -1146,9 +1150,9 @@ fsm_start: | |||
1146 | * the CDB. | 1150 | * the CDB. |
1147 | */ | 1151 | */ |
1148 | if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) { | 1152 | if (!(qc->dev->horkage & ATA_HORKAGE_STUCK_ERR)) { |
1149 | ata_port_printk(ap, KERN_WARNING, | 1153 | ata_ehi_push_desc(ehi, "ST_FIRST: " |
1150 | "DRQ=1 with device error, " | 1154 | "DRQ=1 with device error, " |
1151 | "dev_stat 0x%X\n", status); | 1155 | "dev_stat 0x%X", status); |
1152 | qc->err_mask |= AC_ERR_HSM; | 1156 | qc->err_mask |= AC_ERR_HSM; |
1153 | ap->hsm_task_state = HSM_ST_ERR; | 1157 | ap->hsm_task_state = HSM_ST_ERR; |
1154 | goto fsm_start; | 1158 | goto fsm_start; |
@@ -1205,9 +1209,9 @@ fsm_start: | |||
1205 | * let the EH abort the command or reset the device. | 1209 | * let the EH abort the command or reset the device. |
1206 | */ | 1210 | */ |
1207 | if (unlikely(status & (ATA_ERR | ATA_DF))) { | 1211 | if (unlikely(status & (ATA_ERR | ATA_DF))) { |
1208 | ata_port_printk(ap, KERN_WARNING, "DRQ=1 with " | 1212 | ata_ehi_push_desc(ehi, "ST-ATAPI: " |
1209 | "device error, dev_stat 0x%X\n", | 1213 | "DRQ=1 with device error, " |
1210 | status); | 1214 | "dev_stat 0x%X", status); |
1211 | qc->err_mask |= AC_ERR_HSM; | 1215 | qc->err_mask |= AC_ERR_HSM; |
1212 | ap->hsm_task_state = HSM_ST_ERR; | 1216 | ap->hsm_task_state = HSM_ST_ERR; |
1213 | goto fsm_start; | 1217 | goto fsm_start; |
@@ -1226,13 +1230,17 @@ fsm_start: | |||
1226 | if (likely(status & (ATA_ERR | ATA_DF))) | 1230 | if (likely(status & (ATA_ERR | ATA_DF))) |
1227 | /* device stops HSM for abort/error */ | 1231 | /* device stops HSM for abort/error */ |
1228 | qc->err_mask |= AC_ERR_DEV; | 1232 | qc->err_mask |= AC_ERR_DEV; |
1229 | else | 1233 | else { |
1230 | /* HSM violation. Let EH handle this. | 1234 | /* HSM violation. Let EH handle this. |
1231 | * Phantom devices also trigger this | 1235 | * Phantom devices also trigger this |
1232 | * condition. Mark hint. | 1236 | * condition. Mark hint. |
1233 | */ | 1237 | */ |
1238 | ata_ehi_push_desc(ehi, "ST-ATA: " | ||
1239 | "DRQ=1 with device error, " | ||
1240 | "dev_stat 0x%X", status); | ||
1234 | qc->err_mask |= AC_ERR_HSM | | 1241 | qc->err_mask |= AC_ERR_HSM | |
1235 | AC_ERR_NODEV_HINT; | 1242 | AC_ERR_NODEV_HINT; |
1243 | } | ||
1236 | 1244 | ||
1237 | ap->hsm_task_state = HSM_ST_ERR; | 1245 | ap->hsm_task_state = HSM_ST_ERR; |
1238 | goto fsm_start; | 1246 | goto fsm_start; |
@@ -1257,8 +1265,12 @@ fsm_start: | |||
1257 | status = ata_wait_idle(ap); | 1265 | status = ata_wait_idle(ap); |
1258 | } | 1266 | } |
1259 | 1267 | ||
1260 | if (status & (ATA_BUSY | ATA_DRQ)) | 1268 | if (status & (ATA_BUSY | ATA_DRQ)) { |
1269 | ata_ehi_push_desc(ehi, "ST-ATA: " | ||
1270 | "BUSY|DRQ persists on ERR|DF, " | ||
1271 | "dev_stat 0x%X", status); | ||
1261 | qc->err_mask |= AC_ERR_HSM; | 1272 | qc->err_mask |= AC_ERR_HSM; |
1273 | } | ||
1262 | 1274 | ||
1263 | /* ata_pio_sectors() might change the | 1275 | /* ata_pio_sectors() might change the |
1264 | * state to HSM_ST_LAST. so, the state | 1276 | * state to HSM_ST_LAST. so, the state |
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index e82c66e8d31b..26345d7b531c 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -56,6 +56,7 @@ static const struct sis_laptop sis_laptop[] = { | |||
56 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ | 56 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ |
57 | { 0x5513, 0x1734, 0x105F }, /* FSC Amilo A1630 */ | 57 | { 0x5513, 0x1734, 0x105F }, /* FSC Amilo A1630 */ |
58 | { 0x5513, 0x1071, 0x8640 }, /* EasyNote K5305 */ | 58 | { 0x5513, 0x1071, 0x8640 }, /* EasyNote K5305 */ |
59 | { 0x5513, 0x1039, 0x5513 }, /* Targa Visionary 1000 */ | ||
59 | /* end marker */ | 60 | /* end marker */ |
60 | { 0, } | 61 | { 0, } |
61 | }; | 62 | }; |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 28092bc50146..ad169ffbc4cb 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1607,7 +1607,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) | |||
1607 | * Much of the time, this could just work regardless. | 1607 | * Much of the time, this could just work regardless. |
1608 | * So for now, just log the incident, and allow the attempt. | 1608 | * So for now, just log the incident, and allow the attempt. |
1609 | */ | 1609 | */ |
1610 | if (limit_warnings && (qc->nbytes / qc->sect_size) > 1) { | 1610 | if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) { |
1611 | --limit_warnings; | 1611 | --limit_warnings; |
1612 | ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME | 1612 | ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME |
1613 | ": attempting PIO w/multiple DRQ: " | 1613 | ": attempting PIO w/multiple DRQ: " |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 8ee6b5b4ede7..84ffcc26a74b 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -370,6 +370,7 @@ static const struct pci_device_id sil24_pci_tbl[] = { | |||
370 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, | 370 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, |
371 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, | 371 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, |
372 | { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 }, | 372 | { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 }, |
373 | { PCI_VDEVICE(CMD, 0x0244), BID_SIL3132 }, | ||
373 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, | 374 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, |
374 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, | 375 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, |
375 | 376 | ||
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c index f277cea904ce..db529b849948 100644 --- a/drivers/ata/sata_uli.c +++ b/drivers/ata/sata_uli.c | |||
@@ -83,6 +83,7 @@ static struct ata_port_operations uli_ops = { | |||
83 | .inherits = &ata_bmdma_port_ops, | 83 | .inherits = &ata_bmdma_port_ops, |
84 | .scr_read = uli_scr_read, | 84 | .scr_read = uli_scr_read, |
85 | .scr_write = uli_scr_write, | 85 | .scr_write = uli_scr_write, |
86 | .hardreset = ATA_OP_NULL, | ||
86 | }; | 87 | }; |
87 | 88 | ||
88 | static const struct ata_port_info uli_port_info = { | 89 | static const struct ata_port_info uli_port_info = { |
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 043353bd0600..14b9d5f4c203 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -64,7 +64,7 @@ config KS0108_DELAY | |||
64 | Amount of time the ks0108 should wait between each control write | 64 | Amount of time the ks0108 should wait between each control write |
65 | to the parallel port. | 65 | to the parallel port. |
66 | 66 | ||
67 | If your driver seems to miss random writings, increment this. | 67 | If your LCD seems to miss random writings, increment this. |
68 | 68 | ||
69 | If you don't know what I'm talking about, ignore it. | 69 | If you don't know what I'm talking about, ignore it. |
70 | 70 | ||
diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c index 80bb06105387..683509f013ab 100644 --- a/drivers/auxdisplay/cfag12864b.c +++ b/drivers/auxdisplay/cfag12864b.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * Depends: ks0108 | 6 | * Depends: ks0108 |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
@@ -398,5 +398,5 @@ module_init(cfag12864b_init); | |||
398 | module_exit(cfag12864b_exit); | 398 | module_exit(cfag12864b_exit); |
399 | 399 | ||
400 | MODULE_LICENSE("GPL v2"); | 400 | MODULE_LICENSE("GPL v2"); |
401 | MODULE_AUTHOR("Miguel Ojeda Sandonis <maxextreme@gmail.com>"); | 401 | MODULE_AUTHOR("Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>"); |
402 | MODULE_DESCRIPTION("cfag12864b LCD driver"); | 402 | MODULE_DESCRIPTION("cfag12864b LCD driver"); |
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c index 307c190699e0..fe3a865be4e5 100644 --- a/drivers/auxdisplay/cfag12864bfb.c +++ b/drivers/auxdisplay/cfag12864bfb.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * Depends: cfag12864b | 6 | * Depends: cfag12864b |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
@@ -186,5 +186,5 @@ module_init(cfag12864bfb_init); | |||
186 | module_exit(cfag12864bfb_exit); | 186 | module_exit(cfag12864bfb_exit); |
187 | 187 | ||
188 | MODULE_LICENSE("GPL v2"); | 188 | MODULE_LICENSE("GPL v2"); |
189 | MODULE_AUTHOR("Miguel Ojeda Sandonis <maxextreme@gmail.com>"); | 189 | MODULE_AUTHOR("Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>"); |
190 | MODULE_DESCRIPTION("cfag12864b LCD framebuffer driver"); | 190 | MODULE_DESCRIPTION("cfag12864b LCD framebuffer driver"); |
diff --git a/drivers/auxdisplay/ks0108.c b/drivers/auxdisplay/ks0108.c index e6c3646ef18c..5b93852392b8 100644 --- a/drivers/auxdisplay/ks0108.c +++ b/drivers/auxdisplay/ks0108.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * Depends: parport | 6 | * Depends: parport |
7 | * | 7 | * |
8 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 8 | * Author: Copyright (C) Miguel Ojeda Sandonis |
9 | * Date: 2006-10-31 | 9 | * Date: 2006-10-31 |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
@@ -173,6 +173,6 @@ module_init(ks0108_init); | |||
173 | module_exit(ks0108_exit); | 173 | module_exit(ks0108_exit); |
174 | 174 | ||
175 | MODULE_LICENSE("GPL v2"); | 175 | MODULE_LICENSE("GPL v2"); |
176 | MODULE_AUTHOR("Miguel Ojeda Sandonis <maxextreme@gmail.com>"); | 176 | MODULE_AUTHOR("Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>"); |
177 | MODULE_DESCRIPTION("ks0108 LCD Controller driver"); | 177 | MODULE_DESCRIPTION("ks0108 LCD Controller driver"); |
178 | 178 | ||
diff --git a/drivers/base/node.c b/drivers/base/node.c index 39f3d1b3a213..0f867a083338 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -84,8 +84,8 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf) | |||
84 | nid, K(i.totalram), | 84 | nid, K(i.totalram), |
85 | nid, K(i.freeram), | 85 | nid, K(i.freeram), |
86 | nid, K(i.totalram - i.freeram), | 86 | nid, K(i.totalram - i.freeram), |
87 | nid, node_page_state(nid, NR_ACTIVE), | 87 | nid, K(node_page_state(nid, NR_ACTIVE)), |
88 | nid, node_page_state(nid, NR_INACTIVE), | 88 | nid, K(node_page_state(nid, NR_INACTIVE)), |
89 | #ifdef CONFIG_HIGHMEM | 89 | #ifdef CONFIG_HIGHMEM |
90 | nid, K(i.totalhigh), | 90 | nid, K(i.totalhigh), |
91 | nid, K(i.freehigh), | 91 | nid, K(i.freehigh), |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 5f1e1cc6165a..d81632cd7d06 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -106,35 +106,34 @@ MODULE_DEVICE_TABLE(pci, cciss_pci_device_id); | |||
106 | /* board_id = Subsystem Device ID & Vendor ID | 106 | /* board_id = Subsystem Device ID & Vendor ID |
107 | * product = Marketing Name for the board | 107 | * product = Marketing Name for the board |
108 | * access = Address of the struct of function pointers | 108 | * access = Address of the struct of function pointers |
109 | * nr_cmds = Number of commands supported by controller | ||
110 | */ | 109 | */ |
111 | static struct board_type products[] = { | 110 | static struct board_type products[] = { |
112 | {0x40700E11, "Smart Array 5300", &SA5_access, 512}, | 111 | {0x40700E11, "Smart Array 5300", &SA5_access}, |
113 | {0x40800E11, "Smart Array 5i", &SA5B_access, 512}, | 112 | {0x40800E11, "Smart Array 5i", &SA5B_access}, |
114 | {0x40820E11, "Smart Array 532", &SA5B_access, 512}, | 113 | {0x40820E11, "Smart Array 532", &SA5B_access}, |
115 | {0x40830E11, "Smart Array 5312", &SA5B_access, 512}, | 114 | {0x40830E11, "Smart Array 5312", &SA5B_access}, |
116 | {0x409A0E11, "Smart Array 641", &SA5_access, 512}, | 115 | {0x409A0E11, "Smart Array 641", &SA5_access}, |
117 | {0x409B0E11, "Smart Array 642", &SA5_access, 512}, | 116 | {0x409B0E11, "Smart Array 642", &SA5_access}, |
118 | {0x409C0E11, "Smart Array 6400", &SA5_access, 512}, | 117 | {0x409C0E11, "Smart Array 6400", &SA5_access}, |
119 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access, 512}, | 118 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access}, |
120 | {0x40910E11, "Smart Array 6i", &SA5_access, 512}, | 119 | {0x40910E11, "Smart Array 6i", &SA5_access}, |
121 | {0x3225103C, "Smart Array P600", &SA5_access, 512}, | 120 | {0x3225103C, "Smart Array P600", &SA5_access}, |
122 | {0x3223103C, "Smart Array P800", &SA5_access, 512}, | 121 | {0x3223103C, "Smart Array P800", &SA5_access}, |
123 | {0x3234103C, "Smart Array P400", &SA5_access, 512}, | 122 | {0x3234103C, "Smart Array P400", &SA5_access}, |
124 | {0x3235103C, "Smart Array P400i", &SA5_access, 512}, | 123 | {0x3235103C, "Smart Array P400i", &SA5_access}, |
125 | {0x3211103C, "Smart Array E200i", &SA5_access, 120}, | 124 | {0x3211103C, "Smart Array E200i", &SA5_access}, |
126 | {0x3212103C, "Smart Array E200", &SA5_access, 120}, | 125 | {0x3212103C, "Smart Array E200", &SA5_access}, |
127 | {0x3213103C, "Smart Array E200i", &SA5_access, 120}, | 126 | {0x3213103C, "Smart Array E200i", &SA5_access}, |
128 | {0x3214103C, "Smart Array E200i", &SA5_access, 120}, | 127 | {0x3214103C, "Smart Array E200i", &SA5_access}, |
129 | {0x3215103C, "Smart Array E200i", &SA5_access, 120}, | 128 | {0x3215103C, "Smart Array E200i", &SA5_access}, |
130 | {0x3237103C, "Smart Array E500", &SA5_access, 512}, | 129 | {0x3237103C, "Smart Array E500", &SA5_access}, |
131 | {0x323D103C, "Smart Array P700m", &SA5_access, 512}, | 130 | {0x323D103C, "Smart Array P700m", &SA5_access}, |
132 | {0x3241103C, "Smart Array P212", &SA5_access, 384}, | 131 | {0x3241103C, "Smart Array P212", &SA5_access}, |
133 | {0x3243103C, "Smart Array P410", &SA5_access, 384}, | 132 | {0x3243103C, "Smart Array P410", &SA5_access}, |
134 | {0x3245103C, "Smart Array P410i", &SA5_access, 384}, | 133 | {0x3245103C, "Smart Array P410i", &SA5_access}, |
135 | {0x3247103C, "Smart Array P411", &SA5_access, 384}, | 134 | {0x3247103C, "Smart Array P411", &SA5_access}, |
136 | {0x3249103C, "Smart Array P812", &SA5_access, 384}, | 135 | {0x3249103C, "Smart Array P812", &SA5_access}, |
137 | {0xFFFF103C, "Unknown Smart Array", &SA5_access, 120}, | 136 | {0xFFFF103C, "Unknown Smart Array", &SA5_access}, |
138 | }; | 137 | }; |
139 | 138 | ||
140 | /* How long to wait (in milliseconds) for board to go into simple mode */ | 139 | /* How long to wait (in milliseconds) for board to go into simple mode */ |
@@ -3086,11 +3085,20 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3086 | print_cfg_table(c->cfgtable); | 3085 | print_cfg_table(c->cfgtable); |
3087 | #endif /* CCISS_DEBUG */ | 3086 | #endif /* CCISS_DEBUG */ |
3088 | 3087 | ||
3088 | /* Some controllers support Zero Memory Raid (ZMR). | ||
3089 | * When configured in ZMR mode the number of supported | ||
3090 | * commands drops to 64. So instead of just setting an | ||
3091 | * arbitrary value we make the driver a little smarter. | ||
3092 | * We read the config table to tell us how many commands | ||
3093 | * are supported on the controller then subtract 4 to | ||
3094 | * leave a little room for ioctl calls. | ||
3095 | */ | ||
3096 | c->max_commands = readl(&(c->cfgtable->CmdsOutMax)); | ||
3089 | for (i = 0; i < ARRAY_SIZE(products); i++) { | 3097 | for (i = 0; i < ARRAY_SIZE(products); i++) { |
3090 | if (board_id == products[i].board_id) { | 3098 | if (board_id == products[i].board_id) { |
3091 | c->product_name = products[i].product_name; | 3099 | c->product_name = products[i].product_name; |
3092 | c->access = *(products[i].access); | 3100 | c->access = *(products[i].access); |
3093 | c->nr_cmds = products[i].nr_cmds; | 3101 | c->nr_cmds = c->max_commands - 4; |
3094 | break; | 3102 | break; |
3095 | } | 3103 | } |
3096 | } | 3104 | } |
@@ -3110,7 +3118,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3110 | if (subsystem_vendor_id == PCI_VENDOR_ID_HP) { | 3118 | if (subsystem_vendor_id == PCI_VENDOR_ID_HP) { |
3111 | c->product_name = products[i-1].product_name; | 3119 | c->product_name = products[i-1].product_name; |
3112 | c->access = *(products[i-1].access); | 3120 | c->access = *(products[i-1].access); |
3113 | c->nr_cmds = products[i-1].nr_cmds; | 3121 | c->nr_cmds = c->max_commands - 4; |
3114 | printk(KERN_WARNING "cciss: This is an unknown " | 3122 | printk(KERN_WARNING "cciss: This is an unknown " |
3115 | "Smart Array controller.\n" | 3123 | "Smart Array controller.\n" |
3116 | "cciss: Please update to the latest driver " | 3124 | "cciss: Please update to the latest driver " |
@@ -3546,6 +3554,10 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3546 | for (j = 0; j <= hba[i]->highest_lun; j++) | 3554 | for (j = 0; j <= hba[i]->highest_lun; j++) |
3547 | add_disk(hba[i]->gendisk[j]); | 3555 | add_disk(hba[i]->gendisk[j]); |
3548 | 3556 | ||
3557 | /* we must register the controller even if no disks exist */ | ||
3558 | if (hba[i]->highest_lun == -1) | ||
3559 | add_disk(hba[i]->gendisk[0]); | ||
3560 | |||
3549 | return 1; | 3561 | return 1; |
3550 | 3562 | ||
3551 | clean4: | 3563 | clean4: |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 1b9a87047817..0e6df289cb46 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -755,9 +755,8 @@ static ssize_t ipmi_write(struct file *file, | |||
755 | rv = ipmi_heartbeat(); | 755 | rv = ipmi_heartbeat(); |
756 | if (rv) | 756 | if (rv) |
757 | return rv; | 757 | return rv; |
758 | return 1; | ||
759 | } | 758 | } |
760 | return 0; | 759 | return len; |
761 | } | 760 | } |
762 | 761 | ||
763 | static ssize_t ipmi_read(struct file *file, | 762 | static ssize_t ipmi_read(struct file *file, |
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c index ba6340ae98af..929101ecbae2 100644 --- a/drivers/char/pcmcia/ipwireless/hardware.c +++ b/drivers/char/pcmcia/ipwireless/hardware.c | |||
@@ -590,8 +590,10 @@ static struct ipw_rx_packet *pool_allocate(struct ipw_hardware *hw, | |||
590 | packet = kmalloc(sizeof(struct ipw_rx_packet) + | 590 | packet = kmalloc(sizeof(struct ipw_rx_packet) + |
591 | old_packet->length + minimum_free_space, | 591 | old_packet->length + minimum_free_space, |
592 | GFP_ATOMIC); | 592 | GFP_ATOMIC); |
593 | if (!packet) | 593 | if (!packet) { |
594 | kfree(old_packet); | ||
594 | return NULL; | 595 | return NULL; |
596 | } | ||
595 | memcpy(packet, old_packet, | 597 | memcpy(packet, old_packet, |
596 | sizeof(struct ipw_rx_packet) | 598 | sizeof(struct ipw_rx_packet) |
597 | + old_packet->length); | 599 | + old_packet->length); |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 5f80a9dff573..909cac93fa2a 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -678,12 +678,13 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) | |||
678 | if (arg != (1<<tmp)) | 678 | if (arg != (1<<tmp)) |
679 | return -EINVAL; | 679 | return -EINVAL; |
680 | 680 | ||
681 | rtc_freq = arg; | ||
682 | |||
681 | spin_lock_irqsave(&rtc_lock, flags); | 683 | spin_lock_irqsave(&rtc_lock, flags); |
682 | if (hpet_set_periodic_freq(arg)) { | 684 | if (hpet_set_periodic_freq(arg)) { |
683 | spin_unlock_irqrestore(&rtc_lock, flags); | 685 | spin_unlock_irqrestore(&rtc_lock, flags); |
684 | return 0; | 686 | return 0; |
685 | } | 687 | } |
686 | rtc_freq = arg; | ||
687 | 688 | ||
688 | val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; | 689 | val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; |
689 | val |= (16 - tmp); | 690 | val |= (16 - tmp); |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 13a4bdd4e4d6..c7a977bc03e8 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -623,6 +623,7 @@ static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { | |||
623 | {"IFX0102", 0}, /* Infineon */ | 623 | {"IFX0102", 0}, /* Infineon */ |
624 | {"BCM0101", 0}, /* Broadcom */ | 624 | {"BCM0101", 0}, /* Broadcom */ |
625 | {"NSC1200", 0}, /* National */ | 625 | {"NSC1200", 0}, /* National */ |
626 | {"ICO0102", 0}, /* Intel */ | ||
626 | /* Add new here */ | 627 | /* Add new here */ |
627 | {"", 0}, /* User Specified */ | 628 | {"", 0}, /* User Specified */ |
628 | {"", 0} /* Terminator */ | 629 | {"", 0} /* Terminator */ |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index bbd28342e771..008c38ba774f 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -28,12 +28,18 @@ config DEBUG_GPIO | |||
28 | comment "I2C GPIO expanders:" | 28 | comment "I2C GPIO expanders:" |
29 | 29 | ||
30 | config GPIO_PCA953X | 30 | config GPIO_PCA953X |
31 | tristate "PCA953x I/O ports" | 31 | tristate "PCA953x, PCA955x, and MAX7310 I/O ports" |
32 | depends on I2C | 32 | depends on I2C |
33 | help | 33 | help |
34 | Say yes here to support the PCA9534 (8-bit), PCA9535 (16-bit), | 34 | Say yes here to provide access to several register-oriented |
35 | PCA9536 (4-bit), PCA9537 (4-bit), PCA9538 (8-bit), and PCA9539 | 35 | SMBus I/O expanders, made mostly by NXP or TI. Compatible |
36 | (16-bit) I/O ports. These parts are made by NXP and TI. | 36 | models include: |
37 | |||
38 | 4 bits: pca9536, pca9537 | ||
39 | |||
40 | 8 bits: max7310, pca9534, pca9538, pca9554, pca9557 | ||
41 | |||
42 | 16 bits: pca9535, pca9539, pca9555 | ||
37 | 43 | ||
38 | This driver can also be built as a module. If so, the module | 44 | This driver can also be built as a module. If so, the module |
39 | will be called pca953x. | 45 | will be called pca953x. |
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 7e40e8a55edf..a380730b61ab 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
@@ -33,7 +33,7 @@ static const struct i2c_device_id pca953x_id[] = { | |||
33 | { "pca9554", 8, }, | 33 | { "pca9554", 8, }, |
34 | { "pca9555", 16, }, | 34 | { "pca9555", 16, }, |
35 | { "pca9557", 8, }, | 35 | { "pca9557", 8, }, |
36 | /* REVISIT several pca955x parts should work here too */ | 36 | { "max7310", 8, }, |
37 | { } | 37 | { } |
38 | }; | 38 | }; |
39 | MODULE_DEVICE_TABLE(i2c, pca953x_id); | 39 | MODULE_DEVICE_TABLE(i2c, pca953x_id); |
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 26df06f840eb..50f22690d611 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c | |||
@@ -516,17 +516,23 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = { | |||
516 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R51"), | 516 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R51"), |
517 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R52"), | 517 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R52"), |
518 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61i"), | 518 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61i"), |
519 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61"), | ||
519 | HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T41p"), | 520 | HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T41p"), |
520 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T41"), | 521 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T41"), |
521 | HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T42p"), | 522 | HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T42p"), |
522 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"), | 523 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T42"), |
523 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"), | 524 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T43"), |
524 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"), | 525 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T60"), |
526 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61p"), | ||
525 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"), | 527 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T61"), |
526 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"), | 528 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X40"), |
527 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"), | 529 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad X41"), |
528 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"), | 530 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60"), |
531 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61s"), | ||
532 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61"), | ||
529 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad Z60m"), | 533 | HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad Z60m"), |
534 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad Z61m"), | ||
535 | HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad Z61p"), | ||
530 | { .ident = NULL } | 536 | { .ident = NULL } |
531 | }; | 537 | }; |
532 | 538 | ||
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index cc24803fadff..2f2b4f4cf229 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -76,7 +76,7 @@ struct palm_bk3710_udmatiming { | |||
76 | 76 | ||
77 | #include "../ide-timing.h" | 77 | #include "../ide-timing.h" |
78 | 78 | ||
79 | static long ide_palm_clk; | 79 | static unsigned ideclk_period; /* in nanoseconds */ |
80 | 80 | ||
81 | static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = { | 81 | static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = { |
82 | {160, 240}, /* UDMA Mode 0 */ | 82 | {160, 240}, /* UDMA Mode 0 */ |
@@ -86,8 +86,6 @@ static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = { | |||
86 | {85, 60}, /* UDMA Mode 4 */ | 86 | {85, 60}, /* UDMA Mode 4 */ |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static struct clk *ideclkp; | ||
90 | |||
91 | static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev, | 89 | static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev, |
92 | unsigned int mode) | 90 | unsigned int mode) |
93 | { | 91 | { |
@@ -97,10 +95,10 @@ static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev, | |||
97 | 95 | ||
98 | /* DMA Data Setup */ | 96 | /* DMA Data Setup */ |
99 | t0 = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].cycletime, | 97 | t0 = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].cycletime, |
100 | ide_palm_clk) - 1; | 98 | ideclk_period) - 1; |
101 | tenv = DIV_ROUND_UP(20, ide_palm_clk) - 1; | 99 | tenv = DIV_ROUND_UP(20, ideclk_period) - 1; |
102 | trp = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].rptime, | 100 | trp = DIV_ROUND_UP(palm_bk3710_udmatimings[mode].rptime, |
103 | ide_palm_clk) - 1; | 101 | ideclk_period) - 1; |
104 | 102 | ||
105 | /* udmatim Register */ | 103 | /* udmatim Register */ |
106 | val16 = readw(base + BK3710_UDMATIM) & (dev ? 0xFF0F : 0xFFF0); | 104 | val16 = readw(base + BK3710_UDMATIM) & (dev ? 0xFF0F : 0xFFF0); |
@@ -141,8 +139,8 @@ static void palm_bk3710_setdmamode(void __iomem *base, unsigned int dev, | |||
141 | cycletime = max_t(int, t->cycle, min_cycle); | 139 | cycletime = max_t(int, t->cycle, min_cycle); |
142 | 140 | ||
143 | /* DMA Data Setup */ | 141 | /* DMA Data Setup */ |
144 | t0 = DIV_ROUND_UP(cycletime, ide_palm_clk); | 142 | t0 = DIV_ROUND_UP(cycletime, ideclk_period); |
145 | td = DIV_ROUND_UP(t->active, ide_palm_clk); | 143 | td = DIV_ROUND_UP(t->active, ideclk_period); |
146 | tkw = t0 - td - 1; | 144 | tkw = t0 - td - 1; |
147 | td -= 1; | 145 | td -= 1; |
148 | 146 | ||
@@ -168,9 +166,9 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate, | |||
168 | struct ide_timing *t; | 166 | struct ide_timing *t; |
169 | 167 | ||
170 | /* PIO Data Setup */ | 168 | /* PIO Data Setup */ |
171 | t0 = DIV_ROUND_UP(cycletime, ide_palm_clk); | 169 | t0 = DIV_ROUND_UP(cycletime, ideclk_period); |
172 | t2 = DIV_ROUND_UP(ide_timing_find_mode(XFER_PIO_0 + mode)->active, | 170 | t2 = DIV_ROUND_UP(ide_timing_find_mode(XFER_PIO_0 + mode)->active, |
173 | ide_palm_clk); | 171 | ideclk_period); |
174 | 172 | ||
175 | t2i = t0 - t2 - 1; | 173 | t2i = t0 - t2 - 1; |
176 | t2 -= 1; | 174 | t2 -= 1; |
@@ -192,8 +190,8 @@ static void palm_bk3710_setpiomode(void __iomem *base, ide_drive_t *mate, | |||
192 | 190 | ||
193 | /* TASKFILE Setup */ | 191 | /* TASKFILE Setup */ |
194 | t = ide_timing_find_mode(XFER_PIO_0 + mode); | 192 | t = ide_timing_find_mode(XFER_PIO_0 + mode); |
195 | t0 = DIV_ROUND_UP(t->cyc8b, ide_palm_clk); | 193 | t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period); |
196 | t2 = DIV_ROUND_UP(t->act8b, ide_palm_clk); | 194 | t2 = DIV_ROUND_UP(t->act8b, ideclk_period); |
197 | 195 | ||
198 | t2i = t0 - t2 - 1; | 196 | t2i = t0 - t2 - 1; |
199 | t2 -= 1; | 197 | t2 -= 1; |
@@ -350,22 +348,22 @@ static const struct ide_port_info __devinitdata palm_bk3710_port_info = { | |||
350 | 348 | ||
351 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) | 349 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) |
352 | { | 350 | { |
353 | struct clk *clkp; | 351 | struct clk *clk; |
354 | struct resource *mem, *irq; | 352 | struct resource *mem, *irq; |
355 | ide_hwif_t *hwif; | 353 | ide_hwif_t *hwif; |
356 | unsigned long base; | 354 | unsigned long base, rate; |
357 | int i; | 355 | int i; |
358 | hw_regs_t hw; | 356 | hw_regs_t hw; |
359 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 357 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
360 | 358 | ||
361 | clkp = clk_get(NULL, "IDECLK"); | 359 | clk = clk_get(NULL, "IDECLK"); |
362 | if (IS_ERR(clkp)) | 360 | if (IS_ERR(clk)) |
363 | return -ENODEV; | 361 | return -ENODEV; |
364 | 362 | ||
365 | ideclkp = clkp; | 363 | clk_enable(clk); |
366 | clk_enable(ideclkp); | 364 | rate = clk_get_rate(clk); |
367 | ide_palm_clk = clk_get_rate(ideclkp)/100000; | 365 | ideclk_period = 1000000000UL / rate; |
368 | ide_palm_clk = (10000/ide_palm_clk) + 1; | 366 | |
369 | /* Register the IDE interface with Linux ATA Interface */ | 367 | /* Register the IDE interface with Linux ATA Interface */ |
370 | memset(&hw, 0, sizeof(hw)); | 368 | memset(&hw, 0, sizeof(hw)); |
371 | 369 | ||
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 380fa0c8cc84..26e68b65b7cf 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -646,8 +646,6 @@ static int ide_register_port(ide_hwif_t *hwif) | |||
646 | goto out; | 646 | goto out; |
647 | } | 647 | } |
648 | 648 | ||
649 | get_device(&hwif->gendev); | ||
650 | |||
651 | hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev, | 649 | hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev, |
652 | MKDEV(0, 0), hwif, hwif->name); | 650 | MKDEV(0, 0), hwif, hwif->name); |
653 | if (IS_ERR(hwif->portdev)) { | 651 | if (IS_ERR(hwif->portdev)) { |
@@ -1220,16 +1218,12 @@ static void drive_release_dev (struct device *dev) | |||
1220 | complete(&drive->gendev_rel_comp); | 1218 | complete(&drive->gendev_rel_comp); |
1221 | } | 1219 | } |
1222 | 1220 | ||
1223 | #ifndef ide_default_irq | ||
1224 | #define ide_default_irq(irq) 0 | ||
1225 | #endif | ||
1226 | |||
1227 | static int hwif_init(ide_hwif_t *hwif) | 1221 | static int hwif_init(ide_hwif_t *hwif) |
1228 | { | 1222 | { |
1229 | int old_irq; | 1223 | int old_irq; |
1230 | 1224 | ||
1231 | if (!hwif->irq) { | 1225 | if (!hwif->irq) { |
1232 | hwif->irq = ide_default_irq(hwif->io_ports.data_addr); | 1226 | hwif->irq = __ide_default_irq(hwif->io_ports.data_addr); |
1233 | if (!hwif->irq) { | 1227 | if (!hwif->irq) { |
1234 | printk("%s: DISABLED, NO IRQ\n", hwif->name); | 1228 | printk("%s: DISABLED, NO IRQ\n", hwif->name); |
1235 | return 0; | 1229 | return 0; |
@@ -1259,7 +1253,7 @@ static int hwif_init(ide_hwif_t *hwif) | |||
1259 | * It failed to initialise. Find the default IRQ for | 1253 | * It failed to initialise. Find the default IRQ for |
1260 | * this port and try that. | 1254 | * this port and try that. |
1261 | */ | 1255 | */ |
1262 | hwif->irq = ide_default_irq(hwif->io_ports.data_addr); | 1256 | hwif->irq = __ide_default_irq(hwif->io_ports.data_addr); |
1263 | if (!hwif->irq) { | 1257 | if (!hwif->irq) { |
1264 | printk("%s: Disabled unable to get IRQ %d.\n", | 1258 | printk("%s: Disabled unable to get IRQ %d.\n", |
1265 | hwif->name, old_irq); | 1259 | hwif->name, old_irq); |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index c758dcb13b14..300431d080a9 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -315,13 +315,14 @@ void ide_unregister(ide_hwif_t *hwif) | |||
315 | 315 | ||
316 | BUG_ON(in_interrupt()); | 316 | BUG_ON(in_interrupt()); |
317 | BUG_ON(irqs_disabled()); | 317 | BUG_ON(irqs_disabled()); |
318 | |||
318 | mutex_lock(&ide_cfg_mtx); | 319 | mutex_lock(&ide_cfg_mtx); |
319 | spin_lock_irq(&ide_lock); | ||
320 | if (!hwif->present) | ||
321 | goto abort; | ||
322 | __ide_port_unregister_devices(hwif); | ||
323 | hwif->present = 0; | ||
324 | 320 | ||
321 | spin_lock_irq(&ide_lock); | ||
322 | if (hwif->present) { | ||
323 | __ide_port_unregister_devices(hwif); | ||
324 | hwif->present = 0; | ||
325 | } | ||
325 | spin_unlock_irq(&ide_lock); | 326 | spin_unlock_irq(&ide_lock); |
326 | 327 | ||
327 | ide_proc_unregister_port(hwif); | 328 | ide_proc_unregister_port(hwif); |
@@ -351,16 +352,15 @@ void ide_unregister(ide_hwif_t *hwif) | |||
351 | blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS); | 352 | blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS); |
352 | kfree(hwif->sg_table); | 353 | kfree(hwif->sg_table); |
353 | unregister_blkdev(hwif->major, hwif->name); | 354 | unregister_blkdev(hwif->major, hwif->name); |
354 | spin_lock_irq(&ide_lock); | ||
355 | 355 | ||
356 | if (hwif->dma_base) | 356 | if (hwif->dma_base) |
357 | ide_release_dma_engine(hwif); | 357 | ide_release_dma_engine(hwif); |
358 | 358 | ||
359 | spin_lock_irq(&ide_lock); | ||
359 | /* restore hwif data to pristine status */ | 360 | /* restore hwif data to pristine status */ |
360 | ide_init_port_data(hwif, hwif->index); | 361 | ide_init_port_data(hwif, hwif->index); |
361 | |||
362 | abort: | ||
363 | spin_unlock_irq(&ide_lock); | 362 | spin_unlock_irq(&ide_lock); |
363 | |||
364 | mutex_unlock(&ide_cfg_mtx); | 364 | mutex_unlock(&ide_cfg_mtx); |
365 | } | 365 | } |
366 | 366 | ||
@@ -1094,13 +1094,6 @@ struct bus_type ide_bus_type = { | |||
1094 | 1094 | ||
1095 | EXPORT_SYMBOL_GPL(ide_bus_type); | 1095 | EXPORT_SYMBOL_GPL(ide_bus_type); |
1096 | 1096 | ||
1097 | static void ide_port_class_release(struct device *portdev) | ||
1098 | { | ||
1099 | ide_hwif_t *hwif = dev_get_drvdata(portdev); | ||
1100 | |||
1101 | put_device(&hwif->gendev); | ||
1102 | } | ||
1103 | |||
1104 | int ide_vlb_clk; | 1097 | int ide_vlb_clk; |
1105 | EXPORT_SYMBOL_GPL(ide_vlb_clk); | 1098 | EXPORT_SYMBOL_GPL(ide_vlb_clk); |
1106 | 1099 | ||
@@ -1305,7 +1298,6 @@ static int __init ide_init(void) | |||
1305 | ret = PTR_ERR(ide_port_class); | 1298 | ret = PTR_ERR(ide_port_class); |
1306 | goto out_port_class; | 1299 | goto out_port_class; |
1307 | } | 1300 | } |
1308 | ide_port_class->dev_release = ide_port_class_release; | ||
1309 | 1301 | ||
1310 | init_ide_data(); | 1302 | init_ide_data(); |
1311 | 1303 | ||
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 9053c8771e6e..2b71bdf74e73 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c | |||
@@ -184,8 +184,7 @@ static const struct ide_port_info it8213_chipsets[] __devinitdata = { | |||
184 | 184 | ||
185 | static int __devinit it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 185 | static int __devinit it8213_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
186 | { | 186 | { |
187 | ide_setup_pci_device(dev, &it8213_chipsets[id->driver_data]); | 187 | return ide_setup_pci_device(dev, &it8213_chipsets[id->driver_data]); |
188 | return 0; | ||
189 | } | 188 | } |
190 | 189 | ||
191 | static const struct pci_device_id it8213_pci_tbl[] = { | 190 | static const struct pci_device_id it8213_pci_tbl[] = { |
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index fec4955f449b..a7a41bb82778 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -225,10 +225,6 @@ static int ns87415_dma_setup(ide_drive_t *drive) | |||
225 | return 1; | 225 | return 1; |
226 | } | 226 | } |
227 | 227 | ||
228 | #ifndef ide_default_irq | ||
229 | #define ide_default_irq(irq) 0 | ||
230 | #endif | ||
231 | |||
232 | static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | 228 | static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) |
233 | { | 229 | { |
234 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 230 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
@@ -288,7 +284,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
288 | } | 284 | } |
289 | 285 | ||
290 | if (!using_inta) | 286 | if (!using_inta) |
291 | hwif->irq = ide_default_irq(hwif->io_ports.data_addr); | 287 | hwif->irq = __ide_default_irq(hwif->io_ports.data_addr); |
292 | else if (!hwif->irq && hwif->mate && hwif->mate->irq) | 288 | else if (!hwif->irq && hwif->mate && hwif->mate->irq) |
293 | hwif->irq = hwif->mate->irq; /* share IRQ with mate */ | 289 | hwif->irq = hwif->mate->irq; /* share IRQ with mate */ |
294 | 290 | ||
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 8934178a23ee..95f82cfb6c54 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
@@ -1096,7 +1096,9 @@ static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, ch | |||
1096 | struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev; | 1096 | struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev; |
1097 | 1097 | ||
1098 | PDBG("%s dev 0x%p\n", __func__, dev); | 1098 | PDBG("%s dev 0x%p\n", __func__, dev); |
1099 | rtnl_lock(); | ||
1099 | lldev->ethtool_ops->get_drvinfo(lldev, &info); | 1100 | lldev->ethtool_ops->get_drvinfo(lldev, &info); |
1101 | rtnl_unlock(); | ||
1100 | return sprintf(buf, "%s\n", info.fw_version); | 1102 | return sprintf(buf, "%s\n", info.fw_version); |
1101 | } | 1103 | } |
1102 | 1104 | ||
@@ -1109,7 +1111,9 @@ static ssize_t show_hca(struct device *dev, struct device_attribute *attr, | |||
1109 | struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev; | 1111 | struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev; |
1110 | 1112 | ||
1111 | PDBG("%s dev 0x%p\n", __func__, dev); | 1113 | PDBG("%s dev 0x%p\n", __func__, dev); |
1114 | rtnl_lock(); | ||
1112 | lldev->ethtool_ops->get_drvinfo(lldev, &info); | 1115 | lldev->ethtool_ops->get_drvinfo(lldev, &info); |
1116 | rtnl_unlock(); | ||
1113 | return sprintf(buf, "%s\n", info.driver); | 1117 | return sprintf(buf, "%s\n", info.driver); |
1114 | } | 1118 | } |
1115 | 1119 | ||
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 0f3c66de69bc..8d8c6b736167 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -1977,8 +1977,10 @@ isdn_writebuf_stub(int drvidx, int chan, const u_char __user * buf, int len) | |||
1977 | if (!skb) | 1977 | if (!skb) |
1978 | return -ENOMEM; | 1978 | return -ENOMEM; |
1979 | skb_reserve(skb, hl); | 1979 | skb_reserve(skb, hl); |
1980 | if (copy_from_user(skb_put(skb, len), buf, len)) | 1980 | if (copy_from_user(skb_put(skb, len), buf, len)) { |
1981 | dev_kfree_skb(skb); | ||
1981 | return -EFAULT; | 1982 | return -EFAULT; |
1983 | } | ||
1982 | ret = dev->drv[drvidx]->interface->writebuf_skb(drvidx, chan, 1, skb); | 1984 | ret = dev->drv[drvidx]->interface->writebuf_skb(drvidx, chan, 1, skb); |
1983 | if (ret <= 0) | 1985 | if (ret <= 0) |
1984 | dev_kfree_skb(skb); | 1986 | dev_kfree_skb(skb); |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 9b00675dc64f..9ce7154845c6 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2017,12 +2017,7 @@ static int __handle_issuing_new_read_requests5(struct stripe_head *sh, | |||
2017 | */ | 2017 | */ |
2018 | s->uptodate++; | 2018 | s->uptodate++; |
2019 | return 0; /* uptodate + compute == disks */ | 2019 | return 0; /* uptodate + compute == disks */ |
2020 | } else if ((s->uptodate < disks - 1) && | 2020 | } else if (test_bit(R5_Insync, &dev->flags)) { |
2021 | test_bit(R5_Insync, &dev->flags)) { | ||
2022 | /* Note: we hold off compute operations while checks are | ||
2023 | * in flight, but we still prefer 'compute' over 'read' | ||
2024 | * hence we only read if (uptodate < * disks-1) | ||
2025 | */ | ||
2026 | set_bit(R5_LOCKED, &dev->flags); | 2021 | set_bit(R5_LOCKED, &dev->flags); |
2027 | set_bit(R5_Wantread, &dev->flags); | 2022 | set_bit(R5_Wantread, &dev->flags); |
2028 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) | 2023 | if (!test_and_set_bit(STRIPE_OP_IO, &sh->ops.pending)) |
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c index 2bc6bdc9c1f2..d7bfd30f74a9 100644 --- a/drivers/media/video/ov7670.c +++ b/drivers/media/video/ov7670.c | |||
@@ -406,8 +406,10 @@ static int ov7670_read(struct i2c_client *c, unsigned char reg, | |||
406 | int ret; | 406 | int ret; |
407 | 407 | ||
408 | ret = i2c_smbus_read_byte_data(c, reg); | 408 | ret = i2c_smbus_read_byte_data(c, reg); |
409 | if (ret >= 0) | 409 | if (ret >= 0) { |
410 | *value = (unsigned char) ret; | 410 | *value = (unsigned char) ret; |
411 | ret = 0; | ||
412 | } | ||
411 | return ret; | 413 | return ret; |
412 | } | 414 | } |
413 | 415 | ||
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index db3c892f87fb..d40d6d15ae20 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1686,9 +1686,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1686 | ioc->bus_type = SAS; | 1686 | ioc->bus_type = SAS; |
1687 | } | 1687 | } |
1688 | 1688 | ||
1689 | if (ioc->bus_type == SAS && mpt_msi_enable == -1) | 1689 | if (mpt_msi_enable == -1) { |
1690 | ioc->msi_enable = 1; | 1690 | /* Enable on SAS, disable on FC and SPI */ |
1691 | else | 1691 | if (ioc->bus_type == SAS) |
1692 | ioc->msi_enable = 1; | ||
1693 | else | ||
1694 | ioc->msi_enable = 0; | ||
1695 | } else | ||
1696 | /* follow flag: 0 - disable; 1 - enable */ | ||
1692 | ioc->msi_enable = mpt_msi_enable; | 1697 | ioc->msi_enable = mpt_msi_enable; |
1693 | 1698 | ||
1694 | if (ioc->errata_flag_1064) | 1699 | if (ioc->errata_flag_1064) |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 25bcfcf36f2e..1effca4e40e1 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -1266,13 +1266,18 @@ mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd) | |||
1266 | static int | 1266 | static int |
1267 | mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | 1267 | mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) |
1268 | { | 1268 | { |
1269 | struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | ||
1270 | int rc; | 1269 | int rc; |
1271 | 1270 | ||
1272 | rc = mptscsih_ioc_reset(ioc, reset_phase); | 1271 | rc = mptscsih_ioc_reset(ioc, reset_phase); |
1273 | 1272 | ||
1274 | if (reset_phase == MPT_IOC_POST_RESET) | 1273 | /* only try to do a renegotiation if we're properly set up |
1274 | * if we get an ioc fault on bringup, ioc->sh will be NULL */ | ||
1275 | if (reset_phase == MPT_IOC_POST_RESET && | ||
1276 | ioc->sh) { | ||
1277 | struct _MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | ||
1278 | |||
1275 | mptspi_dv_renegotiate(hd); | 1279 | mptspi_dv_renegotiate(hd); |
1280 | } | ||
1276 | 1281 | ||
1277 | return rc; | 1282 | return rc; |
1278 | } | 1283 | } |
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 65210fca37ed..d89475d36988 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
@@ -114,6 +114,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) | |||
114 | unsigned int nob = data->blocks; | 114 | unsigned int nob = data->blocks; |
115 | unsigned long long clks; | 115 | unsigned long long clks; |
116 | unsigned int timeout; | 116 | unsigned int timeout; |
117 | bool dalgn = 0; | ||
117 | u32 dcmd; | 118 | u32 dcmd; |
118 | int i; | 119 | int i; |
119 | 120 | ||
@@ -152,6 +153,9 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) | |||
152 | host->sg_cpu[i].dcmd = dcmd | length; | 153 | host->sg_cpu[i].dcmd = dcmd | length; |
153 | if (length & 31 && !(data->flags & MMC_DATA_READ)) | 154 | if (length & 31 && !(data->flags & MMC_DATA_READ)) |
154 | host->sg_cpu[i].dcmd |= DCMD_ENDIRQEN; | 155 | host->sg_cpu[i].dcmd |= DCMD_ENDIRQEN; |
156 | /* Not aligned to 8-byte boundary? */ | ||
157 | if (sg_dma_address(&data->sg[i]) & 0x7) | ||
158 | dalgn = 1; | ||
155 | if (data->flags & MMC_DATA_READ) { | 159 | if (data->flags & MMC_DATA_READ) { |
156 | host->sg_cpu[i].dsadr = host->res->start + MMC_RXFIFO; | 160 | host->sg_cpu[i].dsadr = host->res->start + MMC_RXFIFO; |
157 | host->sg_cpu[i].dtadr = sg_dma_address(&data->sg[i]); | 161 | host->sg_cpu[i].dtadr = sg_dma_address(&data->sg[i]); |
@@ -165,6 +169,15 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) | |||
165 | host->sg_cpu[host->dma_len - 1].ddadr = DDADR_STOP; | 169 | host->sg_cpu[host->dma_len - 1].ddadr = DDADR_STOP; |
166 | wmb(); | 170 | wmb(); |
167 | 171 | ||
172 | /* | ||
173 | * The PXA27x DMA controller encounters overhead when working with | ||
174 | * unaligned (to 8-byte boundaries) data, so switch on byte alignment | ||
175 | * mode only if we have unaligned data. | ||
176 | */ | ||
177 | if (dalgn) | ||
178 | DALGN |= (1 << host->dma); | ||
179 | else | ||
180 | DALGN &= (1 << host->dma); | ||
168 | DDADR(host->dma) = host->sg_dma; | 181 | DDADR(host->dma) = host->sg_dma; |
169 | DCSR(host->dma) = DCSR_RUN; | 182 | DCSR(host->dma) = DCSR_RUN; |
170 | } | 183 | } |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 07c2048b230b..b413aa6c246b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -55,6 +55,10 @@ static unsigned int debug_quirks = 0; | |||
55 | #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) | 55 | #define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<7) |
56 | /* Controller needs to be reset after each request to stay stable */ | 56 | /* Controller needs to be reset after each request to stay stable */ |
57 | #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) | 57 | #define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8) |
58 | /* Controller needs voltage and power writes to happen separately */ | ||
59 | #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) | ||
60 | /* Controller has an off-by-one issue with timeout value */ | ||
61 | #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<10) | ||
58 | 62 | ||
59 | static const struct pci_device_id pci_ids[] __devinitdata = { | 63 | static const struct pci_device_id pci_ids[] __devinitdata = { |
60 | { | 64 | { |
@@ -115,7 +119,8 @@ static const struct pci_device_id pci_ids[] __devinitdata = { | |||
115 | .subvendor = PCI_ANY_ID, | 119 | .subvendor = PCI_ANY_ID, |
116 | .subdevice = PCI_ANY_ID, | 120 | .subdevice = PCI_ANY_ID, |
117 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | 121 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | |
118 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | 122 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS | |
123 | SDHCI_QUIRK_BROKEN_DMA, | ||
119 | }, | 124 | }, |
120 | 125 | ||
121 | { | 126 | { |
@@ -124,7 +129,17 @@ static const struct pci_device_id pci_ids[] __devinitdata = { | |||
124 | .subvendor = PCI_ANY_ID, | 129 | .subvendor = PCI_ANY_ID, |
125 | .subdevice = PCI_ANY_ID, | 130 | .subdevice = PCI_ANY_ID, |
126 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | | 131 | .driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE | |
127 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS, | 132 | SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS | |
133 | SDHCI_QUIRK_BROKEN_DMA, | ||
134 | }, | ||
135 | |||
136 | { | ||
137 | .vendor = PCI_VENDOR_ID_MARVELL, | ||
138 | .device = PCI_DEVICE_ID_MARVELL_CAFE_SD, | ||
139 | .subvendor = PCI_ANY_ID, | ||
140 | .subdevice = PCI_ANY_ID, | ||
141 | .driver_data = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | | ||
142 | SDHCI_QUIRK_INCR_TIMEOUT_CONTROL, | ||
128 | }, | 143 | }, |
129 | 144 | ||
130 | { | 145 | { |
@@ -469,6 +484,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) | |||
469 | break; | 484 | break; |
470 | } | 485 | } |
471 | 486 | ||
487 | /* | ||
488 | * Compensate for an off-by-one error in the CaFe hardware; otherwise, | ||
489 | * a too-small count gives us interrupt timeouts. | ||
490 | */ | ||
491 | if ((host->chip->quirks & SDHCI_QUIRK_INCR_TIMEOUT_CONTROL)) | ||
492 | count++; | ||
493 | |||
472 | if (count >= 0xF) { | 494 | if (count >= 0xF) { |
473 | printk(KERN_WARNING "%s: Too large timeout requested!\n", | 495 | printk(KERN_WARNING "%s: Too large timeout requested!\n", |
474 | mmc_hostname(host->mmc)); | 496 | mmc_hostname(host->mmc)); |
@@ -774,6 +796,14 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) | |||
774 | BUG(); | 796 | BUG(); |
775 | } | 797 | } |
776 | 798 | ||
799 | /* | ||
800 | * At least the CaFe chip gets confused if we set the voltage | ||
801 | * and set turn on power at the same time, so set the voltage first. | ||
802 | */ | ||
803 | if ((host->chip->quirks & SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER)) | ||
804 | writeb(pwr & ~SDHCI_POWER_ON, | ||
805 | host->ioaddr + SDHCI_POWER_CONTROL); | ||
806 | |||
777 | writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); | 807 | writeb(pwr, host->ioaddr + SDHCI_POWER_CONTROL); |
778 | 808 | ||
779 | out: | 809 | out: |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index fe872fbd671e..e01926b7b5b7 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0091" | 43 | #define DRV_VERSION "EHEA_0092" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
@@ -452,7 +452,7 @@ struct ehea_bcmc_reg_entry { | |||
452 | struct ehea_bcmc_reg_array { | 452 | struct ehea_bcmc_reg_array { |
453 | struct ehea_bcmc_reg_entry *arr; | 453 | struct ehea_bcmc_reg_entry *arr; |
454 | int num_entries; | 454 | int num_entries; |
455 | struct mutex lock; | 455 | spinlock_t lock; |
456 | }; | 456 | }; |
457 | 457 | ||
458 | #define EHEA_PORT_UP 1 | 458 | #define EHEA_PORT_UP 1 |
@@ -478,6 +478,7 @@ struct ehea_port { | |||
478 | int num_add_tx_qps; | 478 | int num_add_tx_qps; |
479 | int num_mcs; | 479 | int num_mcs; |
480 | int resets; | 480 | int resets; |
481 | u64 flags; | ||
481 | u64 mac_addr; | 482 | u64 mac_addr; |
482 | u32 logical_port_id; | 483 | u32 logical_port_id; |
483 | u32 port_speed; | 484 | u32 port_speed; |
@@ -501,7 +502,8 @@ struct port_res_cfg { | |||
501 | }; | 502 | }; |
502 | 503 | ||
503 | enum ehea_flag_bits { | 504 | enum ehea_flag_bits { |
504 | __EHEA_STOP_XFER | 505 | __EHEA_STOP_XFER, |
506 | __EHEA_DISABLE_PORT_RESET | ||
505 | }; | 507 | }; |
506 | 508 | ||
507 | void ehea_set_ethtool_ops(struct net_device *netdev); | 509 | void ehea_set_ethtool_ops(struct net_device *netdev); |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 075fd547421e..0920b796bd78 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -118,6 +118,7 @@ static struct of_device_id ehea_device_table[] = { | |||
118 | }, | 118 | }, |
119 | {}, | 119 | {}, |
120 | }; | 120 | }; |
121 | MODULE_DEVICE_TABLE(of, ehea_device_table); | ||
121 | 122 | ||
122 | static struct of_platform_driver ehea_driver = { | 123 | static struct of_platform_driver ehea_driver = { |
123 | .name = "ehea", | 124 | .name = "ehea", |
@@ -137,6 +138,12 @@ void ehea_dump(void *adr, int len, char *msg) | |||
137 | } | 138 | } |
138 | } | 139 | } |
139 | 140 | ||
141 | void ehea_schedule_port_reset(struct ehea_port *port) | ||
142 | { | ||
143 | if (!test_bit(__EHEA_DISABLE_PORT_RESET, &port->flags)) | ||
144 | schedule_work(&port->reset_task); | ||
145 | } | ||
146 | |||
140 | static void ehea_update_firmware_handles(void) | 147 | static void ehea_update_firmware_handles(void) |
141 | { | 148 | { |
142 | struct ehea_fw_handle_entry *arr = NULL; | 149 | struct ehea_fw_handle_entry *arr = NULL; |
@@ -241,7 +248,7 @@ static void ehea_update_bcmc_registrations(void) | |||
241 | } | 248 | } |
242 | 249 | ||
243 | if (num_registrations) { | 250 | if (num_registrations) { |
244 | arr = kzalloc(num_registrations * sizeof(*arr), GFP_KERNEL); | 251 | arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC); |
245 | if (!arr) | 252 | if (!arr) |
246 | return; /* Keep the existing array */ | 253 | return; /* Keep the existing array */ |
247 | } else | 254 | } else |
@@ -301,7 +308,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
301 | 308 | ||
302 | memset(stats, 0, sizeof(*stats)); | 309 | memset(stats, 0, sizeof(*stats)); |
303 | 310 | ||
304 | cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL); | 311 | cb2 = kzalloc(PAGE_SIZE, GFP_ATOMIC); |
305 | if (!cb2) { | 312 | if (!cb2) { |
306 | ehea_error("no mem for cb2"); | 313 | ehea_error("no mem for cb2"); |
307 | goto out; | 314 | goto out; |
@@ -587,7 +594,7 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq, | |||
587 | "Resetting port.", pr->qp->init_attr.qp_nr); | 594 | "Resetting port.", pr->qp->init_attr.qp_nr); |
588 | ehea_dump(cqe, sizeof(*cqe), "CQE"); | 595 | ehea_dump(cqe, sizeof(*cqe), "CQE"); |
589 | } | 596 | } |
590 | schedule_work(&pr->port->reset_task); | 597 | ehea_schedule_port_reset(pr->port); |
591 | return 1; | 598 | return 1; |
592 | } | 599 | } |
593 | 600 | ||
@@ -616,7 +623,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr, | |||
616 | *tcph = tcp_hdr(skb); | 623 | *tcph = tcp_hdr(skb); |
617 | 624 | ||
618 | /* check if ip header and tcp header are complete */ | 625 | /* check if ip header and tcp header are complete */ |
619 | if (iph->tot_len < ip_len + tcp_hdrlen(skb)) | 626 | if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb)) |
620 | return -1; | 627 | return -1; |
621 | 628 | ||
622 | *hdr_flags = LRO_IPV4 | LRO_TCP; | 629 | *hdr_flags = LRO_IPV4 | LRO_TCP; |
@@ -765,7 +772,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota) | |||
765 | ehea_error("Send Completion Error: Resetting port"); | 772 | ehea_error("Send Completion Error: Resetting port"); |
766 | if (netif_msg_tx_err(pr->port)) | 773 | if (netif_msg_tx_err(pr->port)) |
767 | ehea_dump(cqe, sizeof(*cqe), "Send CQE"); | 774 | ehea_dump(cqe, sizeof(*cqe), "Send CQE"); |
768 | schedule_work(&pr->port->reset_task); | 775 | ehea_schedule_port_reset(pr->port); |
769 | break; | 776 | break; |
770 | } | 777 | } |
771 | 778 | ||
@@ -885,7 +892,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
885 | eqe = ehea_poll_eq(port->qp_eq); | 892 | eqe = ehea_poll_eq(port->qp_eq); |
886 | } | 893 | } |
887 | 894 | ||
888 | schedule_work(&port->reset_task); | 895 | ehea_schedule_port_reset(port); |
889 | 896 | ||
890 | return IRQ_HANDLED; | 897 | return IRQ_HANDLED; |
891 | } | 898 | } |
@@ -1763,7 +1770,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) | |||
1763 | 1770 | ||
1764 | memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len); | 1771 | memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len); |
1765 | 1772 | ||
1766 | mutex_lock(&ehea_bcmc_regs.lock); | 1773 | spin_lock(&ehea_bcmc_regs.lock); |
1767 | 1774 | ||
1768 | /* Deregister old MAC in pHYP */ | 1775 | /* Deregister old MAC in pHYP */ |
1769 | if (port->state == EHEA_PORT_UP) { | 1776 | if (port->state == EHEA_PORT_UP) { |
@@ -1785,7 +1792,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) | |||
1785 | 1792 | ||
1786 | out_upregs: | 1793 | out_upregs: |
1787 | ehea_update_bcmc_registrations(); | 1794 | ehea_update_bcmc_registrations(); |
1788 | mutex_unlock(&ehea_bcmc_regs.lock); | 1795 | spin_unlock(&ehea_bcmc_regs.lock); |
1789 | out_free: | 1796 | out_free: |
1790 | kfree(cb0); | 1797 | kfree(cb0); |
1791 | out: | 1798 | out: |
@@ -1947,7 +1954,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1947 | } | 1954 | } |
1948 | ehea_promiscuous(dev, 0); | 1955 | ehea_promiscuous(dev, 0); |
1949 | 1956 | ||
1950 | mutex_lock(&ehea_bcmc_regs.lock); | 1957 | spin_lock(&ehea_bcmc_regs.lock); |
1951 | 1958 | ||
1952 | if (dev->flags & IFF_ALLMULTI) { | 1959 | if (dev->flags & IFF_ALLMULTI) { |
1953 | ehea_allmulti(dev, 1); | 1960 | ehea_allmulti(dev, 1); |
@@ -1978,7 +1985,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1978 | } | 1985 | } |
1979 | out: | 1986 | out: |
1980 | ehea_update_bcmc_registrations(); | 1987 | ehea_update_bcmc_registrations(); |
1981 | mutex_unlock(&ehea_bcmc_regs.lock); | 1988 | spin_unlock(&ehea_bcmc_regs.lock); |
1982 | return; | 1989 | return; |
1983 | } | 1990 | } |
1984 | 1991 | ||
@@ -2497,7 +2504,7 @@ static int ehea_up(struct net_device *dev) | |||
2497 | } | 2504 | } |
2498 | } | 2505 | } |
2499 | 2506 | ||
2500 | mutex_lock(&ehea_bcmc_regs.lock); | 2507 | spin_lock(&ehea_bcmc_regs.lock); |
2501 | 2508 | ||
2502 | ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); | 2509 | ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); |
2503 | if (ret) { | 2510 | if (ret) { |
@@ -2520,7 +2527,7 @@ out: | |||
2520 | ehea_info("Failed starting %s. ret=%i", dev->name, ret); | 2527 | ehea_info("Failed starting %s. ret=%i", dev->name, ret); |
2521 | 2528 | ||
2522 | ehea_update_bcmc_registrations(); | 2529 | ehea_update_bcmc_registrations(); |
2523 | mutex_unlock(&ehea_bcmc_regs.lock); | 2530 | spin_unlock(&ehea_bcmc_regs.lock); |
2524 | 2531 | ||
2525 | ehea_update_firmware_handles(); | 2532 | ehea_update_firmware_handles(); |
2526 | mutex_unlock(&ehea_fw_handles.lock); | 2533 | mutex_unlock(&ehea_fw_handles.lock); |
@@ -2575,7 +2582,7 @@ static int ehea_down(struct net_device *dev) | |||
2575 | 2582 | ||
2576 | mutex_lock(&ehea_fw_handles.lock); | 2583 | mutex_lock(&ehea_fw_handles.lock); |
2577 | 2584 | ||
2578 | mutex_lock(&ehea_bcmc_regs.lock); | 2585 | spin_lock(&ehea_bcmc_regs.lock); |
2579 | ehea_drop_multicast_list(dev); | 2586 | ehea_drop_multicast_list(dev); |
2580 | ehea_broadcast_reg_helper(port, H_DEREG_BCMC); | 2587 | ehea_broadcast_reg_helper(port, H_DEREG_BCMC); |
2581 | 2588 | ||
@@ -2584,7 +2591,7 @@ static int ehea_down(struct net_device *dev) | |||
2584 | port->state = EHEA_PORT_DOWN; | 2591 | port->state = EHEA_PORT_DOWN; |
2585 | 2592 | ||
2586 | ehea_update_bcmc_registrations(); | 2593 | ehea_update_bcmc_registrations(); |
2587 | mutex_unlock(&ehea_bcmc_regs.lock); | 2594 | spin_unlock(&ehea_bcmc_regs.lock); |
2588 | 2595 | ||
2589 | ret = ehea_clean_all_portres(port); | 2596 | ret = ehea_clean_all_portres(port); |
2590 | if (ret) | 2597 | if (ret) |
@@ -2605,13 +2612,14 @@ static int ehea_stop(struct net_device *dev) | |||
2605 | if (netif_msg_ifdown(port)) | 2612 | if (netif_msg_ifdown(port)) |
2606 | ehea_info("disabling port %s", dev->name); | 2613 | ehea_info("disabling port %s", dev->name); |
2607 | 2614 | ||
2615 | set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags); | ||
2608 | cancel_work_sync(&port->reset_task); | 2616 | cancel_work_sync(&port->reset_task); |
2609 | |||
2610 | mutex_lock(&port->port_lock); | 2617 | mutex_lock(&port->port_lock); |
2611 | netif_stop_queue(dev); | 2618 | netif_stop_queue(dev); |
2612 | port_napi_disable(port); | 2619 | port_napi_disable(port); |
2613 | ret = ehea_down(dev); | 2620 | ret = ehea_down(dev); |
2614 | mutex_unlock(&port->port_lock); | 2621 | mutex_unlock(&port->port_lock); |
2622 | clear_bit(__EHEA_DISABLE_PORT_RESET, &port->flags); | ||
2615 | return ret; | 2623 | return ret; |
2616 | } | 2624 | } |
2617 | 2625 | ||
@@ -2941,7 +2949,7 @@ static void ehea_tx_watchdog(struct net_device *dev) | |||
2941 | 2949 | ||
2942 | if (netif_carrier_ok(dev) && | 2950 | if (netif_carrier_ok(dev) && |
2943 | !test_bit(__EHEA_STOP_XFER, &ehea_driver_flags)) | 2951 | !test_bit(__EHEA_STOP_XFER, &ehea_driver_flags)) |
2944 | schedule_work(&port->reset_task); | 2952 | ehea_schedule_port_reset(port); |
2945 | } | 2953 | } |
2946 | 2954 | ||
2947 | int ehea_sense_adapter_attr(struct ehea_adapter *adapter) | 2955 | int ehea_sense_adapter_attr(struct ehea_adapter *adapter) |
@@ -3590,7 +3598,7 @@ int __init ehea_module_init(void) | |||
3590 | memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); | 3598 | memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); |
3591 | 3599 | ||
3592 | mutex_init(&ehea_fw_handles.lock); | 3600 | mutex_init(&ehea_fw_handles.lock); |
3593 | mutex_init(&ehea_bcmc_regs.lock); | 3601 | spin_lock_init(&ehea_bcmc_regs.lock); |
3594 | 3602 | ||
3595 | ret = check_module_parm(); | 3603 | ret = check_module_parm(); |
3596 | if (ret) | 3604 | if (ret) |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 2cb244763292..20d4fe96a81c 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -4194,12 +4194,23 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
4194 | 4194 | ||
4195 | netif_carrier_off(dev); | 4195 | netif_carrier_off(dev); |
4196 | if (netif_running(dev)) { | 4196 | if (netif_running(dev)) { |
4197 | unsigned long flags; | ||
4198 | |||
4197 | nv_disable_irq(dev); | 4199 | nv_disable_irq(dev); |
4198 | netif_tx_lock_bh(dev); | 4200 | netif_tx_lock_bh(dev); |
4199 | spin_lock(&np->lock); | 4201 | /* with plain spinlock lockdep complains */ |
4202 | spin_lock_irqsave(&np->lock, flags); | ||
4200 | /* stop engines */ | 4203 | /* stop engines */ |
4204 | /* FIXME: | ||
4205 | * this can take some time, and interrupts are disabled | ||
4206 | * due to spin_lock_irqsave, but let's hope no daemon | ||
4207 | * is going to change the settings very often... | ||
4208 | * Worst case: | ||
4209 | * NV_RXSTOP_DELAY1MAX + NV_TXSTOP_DELAY1MAX | ||
4210 | * + some minor delays, which is up to a second approximately | ||
4211 | */ | ||
4201 | nv_stop_rxtx(dev); | 4212 | nv_stop_rxtx(dev); |
4202 | spin_unlock(&np->lock); | 4213 | spin_unlock_irqrestore(&np->lock, flags); |
4203 | netif_tx_unlock_bh(dev); | 4214 | netif_tx_unlock_bh(dev); |
4204 | } | 4215 | } |
4205 | 4216 | ||
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index e36321152d50..8268b3535b30 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -463,6 +463,9 @@ static void restart(struct net_device *dev) | |||
463 | else | 463 | else |
464 | C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB); | 464 | C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB); |
465 | 465 | ||
466 | /* Restore multicast and promiscuous settings */ | ||
467 | set_multicast_list(dev); | ||
468 | |||
466 | S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT); | 469 | S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT); |
467 | } | 470 | } |
468 | 471 | ||
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 5d2108c5ac7c..babc79ad490b 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1636,6 +1636,12 @@ static int emac_poll_rx(void *param, int budget) | |||
1636 | goto next; | 1636 | goto next; |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | if (len < ETH_HLEN) { | ||
1640 | ++dev->estats.rx_dropped_stack; | ||
1641 | emac_recycle_rx_skb(dev, slot, len); | ||
1642 | goto next; | ||
1643 | } | ||
1644 | |||
1639 | if (len && len < EMAC_RX_COPY_THRESH) { | 1645 | if (len && len < EMAC_RX_COPY_THRESH) { |
1640 | struct sk_buff *copy_skb = | 1646 | struct sk_buff *copy_skb = |
1641 | alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC); | 1647 | alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC); |
@@ -2719,6 +2725,8 @@ static int __devinit emac_probe(struct of_device *ofdev, | |||
2719 | /* Clean rings */ | 2725 | /* Clean rings */ |
2720 | memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor)); | 2726 | memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor)); |
2721 | memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor)); | 2727 | memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor)); |
2728 | memset(dev->tx_skb, 0, NUM_TX_BUFF * sizeof(struct sk_buff *)); | ||
2729 | memset(dev->rx_skb, 0, NUM_RX_BUFF * sizeof(struct sk_buff *)); | ||
2722 | 2730 | ||
2723 | /* Attach to ZMII, if needed */ | 2731 | /* Attach to ZMII, if needed */ |
2724 | if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) && | 2732 | if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) && |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index a7714da7c283..effc1ce8179a 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -152,6 +152,7 @@ static chipio_t pnp_info; | |||
152 | static const struct pnp_device_id nsc_ircc_pnp_table[] = { | 152 | static const struct pnp_device_id nsc_ircc_pnp_table[] = { |
153 | { .id = "NSC6001", .driver_data = 0 }, | 153 | { .id = "NSC6001", .driver_data = 0 }, |
154 | { .id = "IBM0071", .driver_data = 0 }, | 154 | { .id = "IBM0071", .driver_data = 0 }, |
155 | { .id = "HWPC224", .driver_data = 0 }, | ||
155 | { } | 156 | { } |
156 | }; | 157 | }; |
157 | 158 | ||
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 58e128784585..04ad3573b159 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev) | |||
1546 | IRDA_WARNING("%s, unable to allocate dma2=%d\n", | 1546 | IRDA_WARNING("%s, unable to allocate dma2=%d\n", |
1547 | driver_name, self->io.dma2); | 1547 | driver_name, self->io.dma2); |
1548 | free_irq(self->io.irq, self); | 1548 | free_irq(self->io.irq, self); |
1549 | free_dma(self->io.dma); | ||
1549 | return -EAGAIN; | 1550 | return -EAGAIN; |
1550 | } | 1551 | } |
1551 | } | 1552 | } |
@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev) | |||
1606 | EnAllInt(iobase, OFF); | 1607 | EnAllInt(iobase, OFF); |
1607 | free_irq(self->io.irq, dev); | 1608 | free_irq(self->io.irq, dev); |
1608 | free_dma(self->io.dma); | 1609 | free_dma(self->io.dma); |
1610 | if (self->io.dma2 != self->io.dma) | ||
1611 | free_dma(self->io.dma2); | ||
1609 | 1612 | ||
1610 | return 0; | 1613 | return 0; |
1611 | } | 1614 | } |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 3b2a6c598088..993d87c9296f 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -277,7 +277,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr, | |||
277 | *tcph = tcp_hdr(skb); | 277 | *tcph = tcp_hdr(skb); |
278 | 278 | ||
279 | /* check if ip header and tcp header are complete */ | 279 | /* check if ip header and tcp header are complete */ |
280 | if (iph->tot_len < ip_len + tcp_hdrlen(skb)) | 280 | if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb)) |
281 | return -1; | 281 | return -1; |
282 | 282 | ||
283 | *hdr_flags = LRO_IPV4 | LRO_TCP; | 283 | *hdr_flags = LRO_IPV4 | LRO_TCP; |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 7ab94c825b57..b9018bfa0a97 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -602,6 +602,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
602 | tun->attached = 1; | 602 | tun->attached = 1; |
603 | get_net(dev_net(tun->dev)); | 603 | get_net(dev_net(tun->dev)); |
604 | 604 | ||
605 | /* Make sure persistent devices do not get stuck in | ||
606 | * xoff state. | ||
607 | */ | ||
608 | if (netif_running(tun->dev)) | ||
609 | netif_wake_queue(tun->dev); | ||
610 | |||
605 | strcpy(ifr->ifr_name, tun->dev->name); | 611 | strcpy(ifr->ifr_name, tun->dev->name); |
606 | return 0; | 612 | return 0; |
607 | 613 | ||
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 520bb0b1a9a2..6d35155c7145 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -1008,6 +1008,7 @@ static int fr_rx(struct sk_buff *skb) | |||
1008 | stats->rx_bytes += skb->len; | 1008 | stats->rx_bytes += skb->len; |
1009 | if (pvc->state.becn) | 1009 | if (pvc->state.becn) |
1010 | stats->rx_compressed++; | 1010 | stats->rx_compressed++; |
1011 | skb->dev = dev; | ||
1011 | netif_rx(skb); | 1012 | netif_rx(skb); |
1012 | return NET_RX_SUCCESS; | 1013 | return NET_RX_SUCCESS; |
1013 | } else { | 1014 | } else { |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 80039a0ae027..3b4e55cf33cd 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -777,8 +777,10 @@ static int hostap_cs_suspend(struct pcmcia_device *link) | |||
777 | int dev_open = 0; | 777 | int dev_open = 0; |
778 | struct hostap_interface *iface = NULL; | 778 | struct hostap_interface *iface = NULL; |
779 | 779 | ||
780 | if (dev) | 780 | if (!dev) |
781 | iface = netdev_priv(dev); | 781 | return -ENODEV; |
782 | |||
783 | iface = netdev_priv(dev); | ||
782 | 784 | ||
783 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info); | 785 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info); |
784 | if (iface && iface->local) | 786 | if (iface && iface->local) |
@@ -798,8 +800,10 @@ static int hostap_cs_resume(struct pcmcia_device *link) | |||
798 | int dev_open = 0; | 800 | int dev_open = 0; |
799 | struct hostap_interface *iface = NULL; | 801 | struct hostap_interface *iface = NULL; |
800 | 802 | ||
801 | if (dev) | 803 | if (!dev) |
802 | iface = netdev_priv(dev); | 804 | return -ENODEV; |
805 | |||
806 | iface = netdev_priv(dev); | ||
803 | 807 | ||
804 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info); | 808 | PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info); |
805 | 809 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 62a3d8f8563e..55ac850744b3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -449,7 +449,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv, | |||
449 | 449 | ||
450 | if (print_summary) { | 450 | if (print_summary) { |
451 | char *title; | 451 | char *title; |
452 | u32 rate; | 452 | int rate; |
453 | 453 | ||
454 | if (hundred) | 454 | if (hundred) |
455 | title = "100Frames"; | 455 | title = "100Frames"; |
@@ -487,7 +487,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv, | |||
487 | * but you can hack it to show more, if you'd like to. */ | 487 | * but you can hack it to show more, if you'd like to. */ |
488 | if (dataframe) | 488 | if (dataframe) |
489 | IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " | 489 | IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " |
490 | "len=%u, rssi=%d, chnl=%d, rate=%u, \n", | 490 | "len=%u, rssi=%d, chnl=%d, rate=%d, \n", |
491 | title, fc, header->addr1[5], | 491 | title, fc, header->addr1[5], |
492 | length, rssi, channel, rate); | 492 | length, rssi, channel, rate); |
493 | else { | 493 | else { |
@@ -588,8 +588,12 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv, | |||
588 | 588 | ||
589 | if (rate == -1) | 589 | if (rate == -1) |
590 | iwl3945_rt->rt_rate = 0; | 590 | iwl3945_rt->rt_rate = 0; |
591 | else | 591 | else { |
592 | if (stats->band == IEEE80211_BAND_5GHZ) | ||
593 | rate += IWL_FIRST_OFDM_RATE; | ||
594 | |||
592 | iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee; | 595 | iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee; |
596 | } | ||
593 | 597 | ||
594 | /* antenna number */ | 598 | /* antenna number */ |
595 | antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK; | 599 | antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index bf19eb8aafd0..de330ae0ca95 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -3528,8 +3528,12 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv, | |||
3528 | 3528 | ||
3529 | if (rate == -1) | 3529 | if (rate == -1) |
3530 | iwl4965_rt->rt_rate = 0; | 3530 | iwl4965_rt->rt_rate = 0; |
3531 | else | 3531 | else { |
3532 | if (stats->band == IEEE80211_BAND_5GHZ) | ||
3533 | rate += IWL_FIRST_OFDM_RATE; | ||
3534 | |||
3532 | iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee; | 3535 | iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee; |
3536 | } | ||
3533 | 3537 | ||
3534 | /* | 3538 | /* |
3535 | * "antenna number" | 3539 | * "antenna number" |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index b1b3c523185d..6027e1119c3f 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6687,7 +6687,8 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
6687 | 6687 | ||
6688 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { | 6688 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { |
6689 | IWL_DEBUG_MAC80211("leave - monitor\n"); | 6689 | IWL_DEBUG_MAC80211("leave - monitor\n"); |
6690 | return -1; | 6690 | dev_kfree_skb_any(skb); |
6691 | return 0; | ||
6691 | } | 6692 | } |
6692 | 6693 | ||
6693 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 6694 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 5ed16ce78468..0bd55bb19739 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -6237,7 +6237,8 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
6237 | 6237 | ||
6238 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { | 6238 | if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { |
6239 | IWL_DEBUG_MAC80211("leave - monitor\n"); | 6239 | IWL_DEBUG_MAC80211("leave - monitor\n"); |
6240 | return -1; | 6240 | dev_kfree_skb_any(skb); |
6241 | return 0; | ||
6241 | } | 6242 | } |
6242 | 6243 | ||
6243 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, | 6244 | IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, |
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 8032df72aaab..36288b29abf7 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -925,6 +925,7 @@ static struct usb_driver if_usb_driver = { | |||
925 | .id_table = if_usb_table, | 925 | .id_table = if_usb_table, |
926 | .suspend = if_usb_suspend, | 926 | .suspend = if_usb_suspend, |
927 | .resume = if_usb_resume, | 927 | .resume = if_usb_resume, |
928 | .reset_resume = if_usb_resume, | ||
928 | }; | 929 | }; |
929 | 930 | ||
930 | static int __init if_usb_init_module(void) | 931 | static int __init if_usb_init_module(void) |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index d448c9702a0f..387d4878af2f 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -567,11 +567,11 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
567 | pos += 8; | 567 | pos += 8; |
568 | 568 | ||
569 | /* beacon interval is 2 bytes long */ | 569 | /* beacon interval is 2 bytes long */ |
570 | bss->beaconperiod = le16_to_cpup((void *) pos); | 570 | bss->beaconperiod = get_unaligned_le16(pos); |
571 | pos += 2; | 571 | pos += 2; |
572 | 572 | ||
573 | /* capability information is 2 bytes long */ | 573 | /* capability information is 2 bytes long */ |
574 | bss->capability = le16_to_cpup((void *) pos); | 574 | bss->capability = get_unaligned_le16(pos); |
575 | lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability); | 575 | lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability); |
576 | pos += 2; | 576 | pos += 2; |
577 | 577 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 560b9c73c0b9..b36ed1c6c746 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -731,6 +731,17 @@ static int rt2400pci_init_registers(struct rt2x00_dev *rt2x00dev) | |||
731 | (rt2x00dev->rx->data_size / 128)); | 731 | (rt2x00dev->rx->data_size / 128)); |
732 | rt2x00pci_register_write(rt2x00dev, CSR9, reg); | 732 | rt2x00pci_register_write(rt2x00dev, CSR9, reg); |
733 | 733 | ||
734 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | ||
735 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 0); | ||
736 | rt2x00_set_field32(®, CSR14_TSF_SYNC, 0); | ||
737 | rt2x00_set_field32(®, CSR14_TBCN, 0); | ||
738 | rt2x00_set_field32(®, CSR14_TCFP, 0); | ||
739 | rt2x00_set_field32(®, CSR14_TATIMW, 0); | ||
740 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | ||
741 | rt2x00_set_field32(®, CSR14_CFP_COUNT_PRELOAD, 0); | ||
742 | rt2x00_set_field32(®, CSR14_TBCM_PRELOAD, 0); | ||
743 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | ||
744 | |||
734 | rt2x00pci_register_write(rt2x00dev, CNT3, 0x3f080000); | 745 | rt2x00pci_register_write(rt2x00dev, CNT3, 0x3f080000); |
735 | 746 | ||
736 | rt2x00pci_register_read(rt2x00dev, ARCSR0, ®); | 747 | rt2x00pci_register_read(rt2x00dev, ARCSR0, ®); |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index a5ed54b69262..f7731fb82555 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -824,6 +824,17 @@ static int rt2500pci_init_registers(struct rt2x00_dev *rt2x00dev) | |||
824 | rt2x00_set_field32(®, CSR11_CW_SELECT, 0); | 824 | rt2x00_set_field32(®, CSR11_CW_SELECT, 0); |
825 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); | 825 | rt2x00pci_register_write(rt2x00dev, CSR11, reg); |
826 | 826 | ||
827 | rt2x00pci_register_read(rt2x00dev, CSR14, ®); | ||
828 | rt2x00_set_field32(®, CSR14_TSF_COUNT, 0); | ||
829 | rt2x00_set_field32(®, CSR14_TSF_SYNC, 0); | ||
830 | rt2x00_set_field32(®, CSR14_TBCN, 0); | ||
831 | rt2x00_set_field32(®, CSR14_TCFP, 0); | ||
832 | rt2x00_set_field32(®, CSR14_TATIMW, 0); | ||
833 | rt2x00_set_field32(®, CSR14_BEACON_GEN, 0); | ||
834 | rt2x00_set_field32(®, CSR14_CFP_COUNT_PRELOAD, 0); | ||
835 | rt2x00_set_field32(®, CSR14_TBCM_PRELOAD, 0); | ||
836 | rt2x00pci_register_write(rt2x00dev, CSR14, reg); | ||
837 | |||
827 | rt2x00pci_register_write(rt2x00dev, CNT3, 0); | 838 | rt2x00pci_register_write(rt2x00dev, CNT3, 0); |
828 | 839 | ||
829 | rt2x00pci_register_read(rt2x00dev, TXCSR8, ®); | 840 | rt2x00pci_register_read(rt2x00dev, TXCSR8, ®); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 61e59c17a60a..d90512f97b39 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -801,6 +801,13 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev) | |||
801 | rt2x00_set_field16(®, TXRX_CSR8_BBP_ID1_VALID, 0); | 801 | rt2x00_set_field16(®, TXRX_CSR8_BBP_ID1_VALID, 0); |
802 | rt2500usb_register_write(rt2x00dev, TXRX_CSR8, reg); | 802 | rt2500usb_register_write(rt2x00dev, TXRX_CSR8, reg); |
803 | 803 | ||
804 | rt2500usb_register_read(rt2x00dev, TXRX_CSR19, ®); | ||
805 | rt2x00_set_field16(®, TXRX_CSR19_TSF_COUNT, 0); | ||
806 | rt2x00_set_field16(®, TXRX_CSR19_TSF_SYNC, 0); | ||
807 | rt2x00_set_field16(®, TXRX_CSR19_TBCN, 0); | ||
808 | rt2x00_set_field16(®, TXRX_CSR19_BEACON_GEN, 0); | ||
809 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | ||
810 | |||
804 | rt2500usb_register_write(rt2x00dev, TXRX_CSR21, 0xe78f); | 811 | rt2500usb_register_write(rt2x00dev, TXRX_CSR21, 0xe78f); |
805 | rt2500usb_register_write(rt2x00dev, MAC_CSR9, 0xff1d); | 812 | rt2500usb_register_write(rt2x00dev, MAC_CSR9, 0xff1d); |
806 | 813 | ||
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 14bc7b281659..c3afb5cbe807 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1201,6 +1201,15 @@ static int rt61pci_init_registers(struct rt2x00_dev *rt2x00dev) | |||
1201 | rt2x00_set_field32(®, TXRX_CSR8_ACK_CTS_54MBS, 42); | 1201 | rt2x00_set_field32(®, TXRX_CSR8_ACK_CTS_54MBS, 42); |
1202 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR8, reg); | 1202 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR8, reg); |
1203 | 1203 | ||
1204 | rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
1205 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_INTERVAL, 0); | ||
1206 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 0); | ||
1207 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, 0); | ||
1208 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 0); | ||
1209 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
1210 | rt2x00_set_field32(®, TXRX_CSR9_TIMESTAMP_COMPENSATE, 0); | ||
1211 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1212 | |||
1204 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); | 1213 | rt2x00pci_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); |
1205 | 1214 | ||
1206 | rt2x00pci_register_write(rt2x00dev, MAC_CSR6, 0x00000fff); | 1215 | rt2x00pci_register_write(rt2x00dev, MAC_CSR6, 0x00000fff); |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 83cc0147f698..46e9e081fbf1 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1006,6 +1006,15 @@ static int rt73usb_init_registers(struct rt2x00_dev *rt2x00dev) | |||
1006 | rt2x00_set_field32(®, TXRX_CSR8_ACK_CTS_54MBS, 42); | 1006 | rt2x00_set_field32(®, TXRX_CSR8_ACK_CTS_54MBS, 42); |
1007 | rt73usb_register_write(rt2x00dev, TXRX_CSR8, reg); | 1007 | rt73usb_register_write(rt2x00dev, TXRX_CSR8, reg); |
1008 | 1008 | ||
1009 | rt73usb_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
1010 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_INTERVAL, 0); | ||
1011 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 0); | ||
1012 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, 0); | ||
1013 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 0); | ||
1014 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
1015 | rt2x00_set_field32(®, TXRX_CSR9_TIMESTAMP_COMPENSATE, 0); | ||
1016 | rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1017 | |||
1009 | rt73usb_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); | 1018 | rt73usb_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); |
1010 | 1019 | ||
1011 | rt73usb_register_read(rt2x00dev, MAC_CSR6, ®); | 1020 | rt73usb_register_read(rt2x00dev, MAC_CSR6, ®); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 418606ac1c3b..694e95d35fd4 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -765,6 +765,7 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw, | |||
765 | { | 765 | { |
766 | struct zd_mac *mac = zd_hw_mac(hw); | 766 | struct zd_mac *mac = zd_hw_mac(hw); |
767 | mac->type = IEEE80211_IF_TYPE_INVALID; | 767 | mac->type = IEEE80211_IF_TYPE_INVALID; |
768 | zd_set_beacon_interval(&mac->chip, 0); | ||
768 | zd_write_mac_addr(&mac->chip, NULL); | 769 | zd_write_mac_addr(&mac->chip, NULL); |
769 | } | 770 | } |
770 | 771 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 8941f5eb96c2..6cdad9764604 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -64,6 +64,7 @@ static struct usb_device_id usb_ids[] = { | |||
64 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, | 64 | { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, |
65 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, | 65 | { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, |
66 | { USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B }, | 66 | { USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B }, |
67 | { USB_DEVICE(0x083a, 0xe506), .driver_info = DEVICE_ZD1211B }, | ||
67 | { USB_DEVICE(0x083a, 0x4505), .driver_info = DEVICE_ZD1211B }, | 68 | { USB_DEVICE(0x083a, 0x4505), .driver_info = DEVICE_ZD1211B }, |
68 | { USB_DEVICE(0x0471, 0x1236), .driver_info = DEVICE_ZD1211B }, | 69 | { USB_DEVICE(0x0471, 0x1236), .driver_info = DEVICE_ZD1211B }, |
69 | { USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B }, | 70 | { USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B }, |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a3497dc6ebcf..338a3f94b4d4 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1727,6 +1727,7 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev) | |||
1727 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); | 1727 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi); |
1728 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); | 1728 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); |
1729 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); | 1729 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); |
1730 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3336, quirk_disable_all_msi); | ||
1730 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); | 1731 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); |
1731 | 1732 | ||
1732 | /* Disable MSI on chipsets that are known to not support it */ | 1733 | /* Disable MSI on chipsets that are known to not support it */ |
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c index 3ce9f3defc12..956d3e79f6aa 100644 --- a/drivers/rapidio/rio-driver.c +++ b/drivers/rapidio/rio-driver.c | |||
@@ -101,8 +101,8 @@ static int rio_device_probe(struct device *dev) | |||
101 | if (error >= 0) { | 101 | if (error >= 0) { |
102 | rdev->driver = rdrv; | 102 | rdev->driver = rdrv; |
103 | error = 0; | 103 | error = 0; |
104 | } else | ||
104 | rio_dev_put(rdev); | 105 | rio_dev_put(rdev); |
105 | } | ||
106 | } | 106 | } |
107 | return error; | 107 | return error; |
108 | } | 108 | } |
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 7e3ad4f3b343..58b7336640ff 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -126,12 +126,25 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
126 | int err; | 126 | int err; |
127 | struct rtc_time before, now; | 127 | struct rtc_time before, now; |
128 | int first_time = 1; | 128 | int first_time = 1; |
129 | unsigned long t_now, t_alm; | ||
130 | enum { none, day, month, year } missing = none; | ||
131 | unsigned days; | ||
129 | 132 | ||
130 | /* The lower level RTC driver may not be capable of filling | 133 | /* The lower level RTC driver may return -1 in some fields, |
131 | * in all fields of the rtc_time struct (eg. rtc-cmos), | 134 | * creating invalid alarm->time values, for reasons like: |
132 | * and so might instead return -1 in some fields. | 135 | * |
133 | * We deal with that here by grabbing a current RTC timestamp | 136 | * - The hardware may not be capable of filling them in; |
134 | * and using values from that for any missing (-1) values. | 137 | * many alarms match only on time-of-day fields, not |
138 | * day/month/year calendar data. | ||
139 | * | ||
140 | * - Some hardware uses illegal values as "wildcard" match | ||
141 | * values, which non-Linux firmware (like a BIOS) may try | ||
142 | * to set up as e.g. "alarm 15 minutes after each hour". | ||
143 | * Linux uses only oneshot alarms. | ||
144 | * | ||
145 | * When we see that here, we deal with it by using values from | ||
146 | * a current RTC timestamp for any missing (-1) values. The | ||
147 | * RTC driver prevents "periodic alarm" modes. | ||
135 | * | 148 | * |
136 | * But this can be racey, because some fields of the RTC timestamp | 149 | * But this can be racey, because some fields of the RTC timestamp |
137 | * may have wrapped in the interval since we read the RTC alarm, | 150 | * may have wrapped in the interval since we read the RTC alarm, |
@@ -174,6 +187,10 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
174 | if (!alarm->enabled) | 187 | if (!alarm->enabled) |
175 | return 0; | 188 | return 0; |
176 | 189 | ||
190 | /* full-function RTCs won't have such missing fields */ | ||
191 | if (rtc_valid_tm(&alarm->time) == 0) | ||
192 | return 0; | ||
193 | |||
177 | /* get the "after" timestamp, to detect wrapped fields */ | 194 | /* get the "after" timestamp, to detect wrapped fields */ |
178 | err = rtc_read_time(rtc, &now); | 195 | err = rtc_read_time(rtc, &now); |
179 | if (err < 0) | 196 | if (err < 0) |
@@ -183,22 +200,85 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
183 | } while ( before.tm_min != now.tm_min | 200 | } while ( before.tm_min != now.tm_min |
184 | || before.tm_hour != now.tm_hour | 201 | || before.tm_hour != now.tm_hour |
185 | || before.tm_mon != now.tm_mon | 202 | || before.tm_mon != now.tm_mon |
186 | || before.tm_year != now.tm_year | 203 | || before.tm_year != now.tm_year); |
187 | || before.tm_isdst != now.tm_isdst); | ||
188 | 204 | ||
189 | /* Fill in any missing alarm fields using the timestamp */ | 205 | /* Fill in the missing alarm fields using the timestamp; we |
206 | * know there's at least one since alarm->time is invalid. | ||
207 | */ | ||
190 | if (alarm->time.tm_sec == -1) | 208 | if (alarm->time.tm_sec == -1) |
191 | alarm->time.tm_sec = now.tm_sec; | 209 | alarm->time.tm_sec = now.tm_sec; |
192 | if (alarm->time.tm_min == -1) | 210 | if (alarm->time.tm_min == -1) |
193 | alarm->time.tm_min = now.tm_min; | 211 | alarm->time.tm_min = now.tm_min; |
194 | if (alarm->time.tm_hour == -1) | 212 | if (alarm->time.tm_hour == -1) |
195 | alarm->time.tm_hour = now.tm_hour; | 213 | alarm->time.tm_hour = now.tm_hour; |
196 | if (alarm->time.tm_mday == -1) | 214 | |
215 | /* For simplicity, only support date rollover for now */ | ||
216 | if (alarm->time.tm_mday == -1) { | ||
197 | alarm->time.tm_mday = now.tm_mday; | 217 | alarm->time.tm_mday = now.tm_mday; |
198 | if (alarm->time.tm_mon == -1) | 218 | missing = day; |
219 | } | ||
220 | if (alarm->time.tm_mon == -1) { | ||
199 | alarm->time.tm_mon = now.tm_mon; | 221 | alarm->time.tm_mon = now.tm_mon; |
200 | if (alarm->time.tm_year == -1) | 222 | if (missing == none) |
223 | missing = month; | ||
224 | } | ||
225 | if (alarm->time.tm_year == -1) { | ||
201 | alarm->time.tm_year = now.tm_year; | 226 | alarm->time.tm_year = now.tm_year; |
227 | if (missing == none) | ||
228 | missing = year; | ||
229 | } | ||
230 | |||
231 | /* with luck, no rollover is needed */ | ||
232 | rtc_tm_to_time(&now, &t_now); | ||
233 | rtc_tm_to_time(&alarm->time, &t_alm); | ||
234 | if (t_now < t_alm) | ||
235 | goto done; | ||
236 | |||
237 | switch (missing) { | ||
238 | |||
239 | /* 24 hour rollover ... if it's now 10am Monday, an alarm that | ||
240 | * that will trigger at 5am will do so at 5am Tuesday, which | ||
241 | * could also be in the next month or year. This is a common | ||
242 | * case, especially for PCs. | ||
243 | */ | ||
244 | case day: | ||
245 | dev_dbg(&rtc->dev, "alarm rollover: %s\n", "day"); | ||
246 | t_alm += 24 * 60 * 60; | ||
247 | rtc_time_to_tm(t_alm, &alarm->time); | ||
248 | break; | ||
249 | |||
250 | /* Month rollover ... if it's the 31th, an alarm on the 3rd will | ||
251 | * be next month. An alarm matching on the 30th, 29th, or 28th | ||
252 | * may end up in the month after that! Many newer PCs support | ||
253 | * this type of alarm. | ||
254 | */ | ||
255 | case month: | ||
256 | dev_dbg(&rtc->dev, "alarm rollover: %s\n", "month"); | ||
257 | do { | ||
258 | if (alarm->time.tm_mon < 11) | ||
259 | alarm->time.tm_mon++; | ||
260 | else { | ||
261 | alarm->time.tm_mon = 0; | ||
262 | alarm->time.tm_year++; | ||
263 | } | ||
264 | days = rtc_month_days(alarm->time.tm_mon, | ||
265 | alarm->time.tm_year); | ||
266 | } while (days < alarm->time.tm_mday); | ||
267 | break; | ||
268 | |||
269 | /* Year rollover ... easy except for leap years! */ | ||
270 | case year: | ||
271 | dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year"); | ||
272 | do { | ||
273 | alarm->time.tm_year++; | ||
274 | } while (!rtc_valid_tm(&alarm->time)); | ||
275 | break; | ||
276 | |||
277 | default: | ||
278 | dev_warn(&rtc->dev, "alarm rollover not handled\n"); | ||
279 | } | ||
280 | |||
281 | done: | ||
202 | return 0; | 282 | return 0; |
203 | } | 283 | } |
204 | EXPORT_SYMBOL_GPL(rtc_read_alarm); | 284 | EXPORT_SYMBOL_GPL(rtc_read_alarm); |
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c index 11644c8fca82..abfdfcbaa059 100644 --- a/drivers/rtc/rtc-fm3130.c +++ b/drivers/rtc/rtc-fm3130.c | |||
@@ -55,7 +55,7 @@ struct fm3130 { | |||
55 | int alarm; | 55 | int alarm; |
56 | }; | 56 | }; |
57 | static const struct i2c_device_id fm3130_id[] = { | 57 | static const struct i2c_device_id fm3130_id[] = { |
58 | { "fm3130-rtc", 0 }, | 58 | { "fm3130", 0 }, |
59 | { } | 59 | { } |
60 | }; | 60 | }; |
61 | MODULE_DEVICE_TABLE(i2c, fm3130_id); | 61 | MODULE_DEVICE_TABLE(i2c, fm3130_id); |
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 0fc4c3630780..748a502a6355 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c | |||
@@ -302,6 +302,7 @@ static int pcf8563_remove(struct i2c_client *client) | |||
302 | 302 | ||
303 | static const struct i2c_device_id pcf8563_id[] = { | 303 | static const struct i2c_device_id pcf8563_id[] = { |
304 | { "pcf8563", 0 }, | 304 | { "pcf8563", 0 }, |
305 | { "rtc8564", 0 }, | ||
305 | { } | 306 | { } |
306 | }; | 307 | }; |
307 | MODULE_DEVICE_TABLE(i2c, pcf8563_id); | 308 | MODULE_DEVICE_TABLE(i2c, pcf8563_id); |
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index eaf55945f21b..7dcfba1bbfe1 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #define X1205_SR_RTCF 0x01 /* Clock failure */ | 71 | #define X1205_SR_RTCF 0x01 /* Clock failure */ |
72 | #define X1205_SR_WEL 0x02 /* Write Enable Latch */ | 72 | #define X1205_SR_WEL 0x02 /* Write Enable Latch */ |
73 | #define X1205_SR_RWEL 0x04 /* Register Write Enable */ | 73 | #define X1205_SR_RWEL 0x04 /* Register Write Enable */ |
74 | #define X1205_SR_AL0 0x20 /* Alarm 0 match */ | ||
74 | 75 | ||
75 | #define X1205_DTR_DTR0 0x01 | 76 | #define X1205_DTR_DTR0 0x01 |
76 | #define X1205_DTR_DTR1 0x02 | 77 | #define X1205_DTR_DTR1 0x02 |
@@ -78,6 +79,8 @@ | |||
78 | 79 | ||
79 | #define X1205_HR_MIL 0x80 /* Set in ccr.hour for 24 hr mode */ | 80 | #define X1205_HR_MIL 0x80 /* Set in ccr.hour for 24 hr mode */ |
80 | 81 | ||
82 | #define X1205_INT_AL0E 0x20 /* Alarm 0 enable */ | ||
83 | |||
81 | static struct i2c_driver x1205_driver; | 84 | static struct i2c_driver x1205_driver; |
82 | 85 | ||
83 | /* | 86 | /* |
@@ -89,8 +92,8 @@ static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
89 | unsigned char reg_base) | 92 | unsigned char reg_base) |
90 | { | 93 | { |
91 | unsigned char dt_addr[2] = { 0, reg_base }; | 94 | unsigned char dt_addr[2] = { 0, reg_base }; |
92 | |||
93 | unsigned char buf[8]; | 95 | unsigned char buf[8]; |
96 | int i; | ||
94 | 97 | ||
95 | struct i2c_msg msgs[] = { | 98 | struct i2c_msg msgs[] = { |
96 | { client->addr, 0, 2, dt_addr }, /* setup read ptr */ | 99 | { client->addr, 0, 2, dt_addr }, /* setup read ptr */ |
@@ -98,7 +101,7 @@ static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
98 | }; | 101 | }; |
99 | 102 | ||
100 | /* read date registers */ | 103 | /* read date registers */ |
101 | if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { | 104 | if (i2c_transfer(client->adapter, &msgs[0], 2) != 2) { |
102 | dev_err(&client->dev, "%s: read error\n", __func__); | 105 | dev_err(&client->dev, "%s: read error\n", __func__); |
103 | return -EIO; | 106 | return -EIO; |
104 | } | 107 | } |
@@ -110,6 +113,11 @@ static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
110 | buf[0], buf[1], buf[2], buf[3], | 113 | buf[0], buf[1], buf[2], buf[3], |
111 | buf[4], buf[5], buf[6], buf[7]); | 114 | buf[4], buf[5], buf[6], buf[7]); |
112 | 115 | ||
116 | /* Mask out the enable bits if these are alarm registers */ | ||
117 | if (reg_base < X1205_CCR_BASE) | ||
118 | for (i = 0; i <= 4; i++) | ||
119 | buf[i] &= 0x7F; | ||
120 | |||
113 | tm->tm_sec = BCD2BIN(buf[CCR_SEC]); | 121 | tm->tm_sec = BCD2BIN(buf[CCR_SEC]); |
114 | tm->tm_min = BCD2BIN(buf[CCR_MIN]); | 122 | tm->tm_min = BCD2BIN(buf[CCR_MIN]); |
115 | tm->tm_hour = BCD2BIN(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ | 123 | tm->tm_hour = BCD2BIN(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ |
@@ -138,7 +146,7 @@ static int x1205_get_status(struct i2c_client *client, unsigned char *sr) | |||
138 | }; | 146 | }; |
139 | 147 | ||
140 | /* read status register */ | 148 | /* read status register */ |
141 | if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { | 149 | if (i2c_transfer(client->adapter, &msgs[0], 2) != 2) { |
142 | dev_err(&client->dev, "%s: read error\n", __func__); | 150 | dev_err(&client->dev, "%s: read error\n", __func__); |
143 | return -EIO; | 151 | return -EIO; |
144 | } | 152 | } |
@@ -147,10 +155,11 @@ static int x1205_get_status(struct i2c_client *client, unsigned char *sr) | |||
147 | } | 155 | } |
148 | 156 | ||
149 | static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, | 157 | static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, |
150 | int datetoo, u8 reg_base) | 158 | int datetoo, u8 reg_base, unsigned char alm_enable) |
151 | { | 159 | { |
152 | int i, xfer; | 160 | int i, xfer, nbytes; |
153 | unsigned char buf[8]; | 161 | unsigned char buf[8]; |
162 | unsigned char rdata[10] = { 0, reg_base }; | ||
154 | 163 | ||
155 | static const unsigned char wel[3] = { 0, X1205_REG_SR, | 164 | static const unsigned char wel[3] = { 0, X1205_REG_SR, |
156 | X1205_SR_WEL }; | 165 | X1205_SR_WEL }; |
@@ -189,6 +198,11 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
189 | buf[CCR_Y2K] = BIN2BCD(tm->tm_year / 100); | 198 | buf[CCR_Y2K] = BIN2BCD(tm->tm_year / 100); |
190 | } | 199 | } |
191 | 200 | ||
201 | /* If writing alarm registers, set compare bits on registers 0-4 */ | ||
202 | if (reg_base < X1205_CCR_BASE) | ||
203 | for (i = 0; i <= 4; i++) | ||
204 | buf[i] |= 0x80; | ||
205 | |||
192 | /* this sequence is required to unlock the chip */ | 206 | /* this sequence is required to unlock the chip */ |
193 | if ((xfer = i2c_master_send(client, wel, 3)) != 3) { | 207 | if ((xfer = i2c_master_send(client, wel, 3)) != 3) { |
194 | dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer); | 208 | dev_err(&client->dev, "%s: wel - %d\n", __func__, xfer); |
@@ -200,19 +214,57 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, | |||
200 | return -EIO; | 214 | return -EIO; |
201 | } | 215 | } |
202 | 216 | ||
217 | |||
203 | /* write register's data */ | 218 | /* write register's data */ |
204 | for (i = 0; i < (datetoo ? 8 : 3); i++) { | 219 | if (datetoo) |
205 | unsigned char rdata[3] = { 0, reg_base + i, buf[i] }; | 220 | nbytes = 8; |
221 | else | ||
222 | nbytes = 3; | ||
223 | for (i = 0; i < nbytes; i++) | ||
224 | rdata[2+i] = buf[i]; | ||
225 | |||
226 | xfer = i2c_master_send(client, rdata, nbytes+2); | ||
227 | if (xfer != nbytes+2) { | ||
228 | dev_err(&client->dev, | ||
229 | "%s: result=%d addr=%02x, data=%02x\n", | ||
230 | __func__, | ||
231 | xfer, rdata[1], rdata[2]); | ||
232 | return -EIO; | ||
233 | } | ||
234 | |||
235 | /* If we wrote to the nonvolatile region, wait 10msec for write cycle*/ | ||
236 | if (reg_base < X1205_CCR_BASE) { | ||
237 | unsigned char al0e[3] = { 0, X1205_REG_INT, 0 }; | ||
238 | |||
239 | msleep(10); | ||
206 | 240 | ||
207 | xfer = i2c_master_send(client, rdata, 3); | 241 | /* ...and set or clear the AL0E bit in the INT register */ |
242 | |||
243 | /* Need to set RWEL again as the write has cleared it */ | ||
244 | xfer = i2c_master_send(client, rwel, 3); | ||
208 | if (xfer != 3) { | 245 | if (xfer != 3) { |
209 | dev_err(&client->dev, | 246 | dev_err(&client->dev, |
210 | "%s: xfer=%d addr=%02x, data=%02x\n", | 247 | "%s: aloe rwel - %d\n", |
211 | __func__, | 248 | __func__, |
212 | xfer, rdata[1], rdata[2]); | 249 | xfer); |
250 | return -EIO; | ||
251 | } | ||
252 | |||
253 | if (alm_enable) | ||
254 | al0e[2] = X1205_INT_AL0E; | ||
255 | |||
256 | xfer = i2c_master_send(client, al0e, 3); | ||
257 | if (xfer != 3) { | ||
258 | dev_err(&client->dev, | ||
259 | "%s: al0e - %d\n", | ||
260 | __func__, | ||
261 | xfer); | ||
213 | return -EIO; | 262 | return -EIO; |
214 | } | 263 | } |
215 | }; | 264 | |
265 | /* and wait 10msec again for this write to complete */ | ||
266 | msleep(10); | ||
267 | } | ||
216 | 268 | ||
217 | /* disable further writes */ | 269 | /* disable further writes */ |
218 | if ((xfer = i2c_master_send(client, diswe, 3)) != 3) { | 270 | if ((xfer = i2c_master_send(client, diswe, 3)) != 3) { |
@@ -230,9 +282,9 @@ static int x1205_fix_osc(struct i2c_client *client) | |||
230 | 282 | ||
231 | tm.tm_hour = tm.tm_min = tm.tm_sec = 0; | 283 | tm.tm_hour = tm.tm_min = tm.tm_sec = 0; |
232 | 284 | ||
233 | if ((err = x1205_set_datetime(client, &tm, 0, X1205_CCR_BASE)) < 0) | 285 | err = x1205_set_datetime(client, &tm, 0, X1205_CCR_BASE, 0); |
234 | dev_err(&client->dev, | 286 | if (err < 0) |
235 | "unable to restart the oscillator\n"); | 287 | dev_err(&client->dev, "unable to restart the oscillator\n"); |
236 | 288 | ||
237 | return err; | 289 | return err; |
238 | } | 290 | } |
@@ -248,7 +300,7 @@ static int x1205_get_dtrim(struct i2c_client *client, int *trim) | |||
248 | }; | 300 | }; |
249 | 301 | ||
250 | /* read dtr register */ | 302 | /* read dtr register */ |
251 | if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { | 303 | if (i2c_transfer(client->adapter, &msgs[0], 2) != 2) { |
252 | dev_err(&client->dev, "%s: read error\n", __func__); | 304 | dev_err(&client->dev, "%s: read error\n", __func__); |
253 | return -EIO; | 305 | return -EIO; |
254 | } | 306 | } |
@@ -280,7 +332,7 @@ static int x1205_get_atrim(struct i2c_client *client, int *trim) | |||
280 | }; | 332 | }; |
281 | 333 | ||
282 | /* read atr register */ | 334 | /* read atr register */ |
283 | if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { | 335 | if (i2c_transfer(client->adapter, &msgs[0], 2) != 2) { |
284 | dev_err(&client->dev, "%s: read error\n", __func__); | 336 | dev_err(&client->dev, "%s: read error\n", __func__); |
285 | return -EIO; | 337 | return -EIO; |
286 | } | 338 | } |
@@ -403,14 +455,33 @@ static int x1205_validate_client(struct i2c_client *client) | |||
403 | 455 | ||
404 | static int x1205_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | 456 | static int x1205_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) |
405 | { | 457 | { |
406 | return x1205_get_datetime(to_i2c_client(dev), | 458 | int err; |
407 | &alrm->time, X1205_ALM0_BASE); | 459 | unsigned char intreg, status; |
460 | static unsigned char int_addr[2] = { 0, X1205_REG_INT }; | ||
461 | struct i2c_client *client = to_i2c_client(dev); | ||
462 | struct i2c_msg msgs[] = { | ||
463 | { client->addr, 0, 2, int_addr }, /* setup read ptr */ | ||
464 | { client->addr, I2C_M_RD, 1, &intreg }, /* read INT register */ | ||
465 | }; | ||
466 | |||
467 | /* read interrupt register and status register */ | ||
468 | if (i2c_transfer(client->adapter, &msgs[0], 2) != 2) { | ||
469 | dev_err(&client->dev, "%s: read error\n", __func__); | ||
470 | return -EIO; | ||
471 | } | ||
472 | err = x1205_get_status(client, &status); | ||
473 | if (err == 0) { | ||
474 | alrm->pending = (status & X1205_SR_AL0) ? 1 : 0; | ||
475 | alrm->enabled = (intreg & X1205_INT_AL0E) ? 1 : 0; | ||
476 | err = x1205_get_datetime(client, &alrm->time, X1205_ALM0_BASE); | ||
477 | } | ||
478 | return err; | ||
408 | } | 479 | } |
409 | 480 | ||
410 | static int x1205_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | 481 | static int x1205_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) |
411 | { | 482 | { |
412 | return x1205_set_datetime(to_i2c_client(dev), | 483 | return x1205_set_datetime(to_i2c_client(dev), |
413 | &alrm->time, 1, X1205_ALM0_BASE); | 484 | &alrm->time, 1, X1205_ALM0_BASE, alrm->enabled); |
414 | } | 485 | } |
415 | 486 | ||
416 | static int x1205_rtc_read_time(struct device *dev, struct rtc_time *tm) | 487 | static int x1205_rtc_read_time(struct device *dev, struct rtc_time *tm) |
@@ -422,7 +493,7 @@ static int x1205_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
422 | static int x1205_rtc_set_time(struct device *dev, struct rtc_time *tm) | 493 | static int x1205_rtc_set_time(struct device *dev, struct rtc_time *tm) |
423 | { | 494 | { |
424 | return x1205_set_datetime(to_i2c_client(dev), | 495 | return x1205_set_datetime(to_i2c_client(dev), |
425 | tm, 1, X1205_CCR_BASE); | 496 | tm, 1, X1205_CCR_BASE, 0); |
426 | } | 497 | } |
427 | 498 | ||
428 | static int x1205_rtc_proc(struct device *dev, struct seq_file *seq) | 499 | static int x1205_rtc_proc(struct device *dev, struct seq_file *seq) |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 999e91ea7451..e7a3a6554425 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include <linux/module.h> | 71 | #include <linux/module.h> |
72 | #include <linux/moduleparam.h> | 72 | #include <linux/moduleparam.h> |
73 | #include <linux/libata.h> | 73 | #include <linux/libata.h> |
74 | #include <linux/hdreg.h> | ||
74 | #include <asm/io.h> | 75 | #include <asm/io.h> |
75 | #include <asm/irq.h> | 76 | #include <asm/irq.h> |
76 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
@@ -4913,8 +4914,11 @@ static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
4913 | struct ipr_resource_entry *res; | 4914 | struct ipr_resource_entry *res; |
4914 | 4915 | ||
4915 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4916 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4916 | if (res && ipr_is_gata(res)) | 4917 | if (res && ipr_is_gata(res)) { |
4918 | if (cmd == HDIO_GET_IDENTITY) | ||
4919 | return -ENOTTY; | ||
4917 | return ata_scsi_ioctl(sdev, cmd, arg); | 4920 | return ata_scsi_ioctl(sdev, cmd, arg); |
4921 | } | ||
4918 | 4922 | ||
4919 | return -EINVAL; | 4923 | return -EINVAL; |
4920 | } | 4924 | } |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a82d2fe80fb5..cbf55d59a54c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -207,6 +207,15 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, | |||
207 | */ | 207 | */ |
208 | blk_execute_rq(req->q, NULL, req, 1); | 208 | blk_execute_rq(req->q, NULL, req, 1); |
209 | 209 | ||
210 | /* | ||
211 | * Some devices (USB mass-storage in particular) may transfer | ||
212 | * garbage data together with a residue indicating that the data | ||
213 | * is invalid. Prevent the garbage from being misinterpreted | ||
214 | * and prevent security leaks by zeroing out the excess data. | ||
215 | */ | ||
216 | if (unlikely(req->data_len > 0 && req->data_len <= bufflen)) | ||
217 | memset(buffer + (bufflen - req->data_len), 0, req->data_len); | ||
218 | |||
210 | ret = req->errors; | 219 | ret = req->errors; |
211 | out: | 220 | out: |
212 | blk_put_request(req); | 221 | blk_put_request(req); |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 1bc00b721e9d..be95e55b228b 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2623,6 +2623,9 @@ static struct console serial8250_console = { | |||
2623 | 2623 | ||
2624 | static int __init serial8250_console_init(void) | 2624 | static int __init serial8250_console_init(void) |
2625 | { | 2625 | { |
2626 | if (nr_uarts > UART_NR) | ||
2627 | nr_uarts = UART_NR; | ||
2628 | |||
2626 | serial8250_isa_init_ports(); | 2629 | serial8250_isa_init_ports(); |
2627 | register_console(&serial8250_console); | 2630 | register_console(&serial8250_console); |
2628 | return 0; | 2631 | return 0; |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index c9b64e73c987..42d2e108b679 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1991,7 +1991,9 @@ struct uart_match { | |||
1991 | static int serial_match_port(struct device *dev, void *data) | 1991 | static int serial_match_port(struct device *dev, void *data) |
1992 | { | 1992 | { |
1993 | struct uart_match *match = data; | 1993 | struct uart_match *match = data; |
1994 | dev_t devt = MKDEV(match->driver->major, match->driver->minor) + match->port->line; | 1994 | struct tty_driver *tty_drv = match->driver->tty_driver; |
1995 | dev_t devt = MKDEV(tty_drv->major, tty_drv->minor_start) + | ||
1996 | match->port->line; | ||
1995 | 1997 | ||
1996 | return dev->devt == devt; /* Actually, only one tty per port */ | 1998 | return dev->devt == devt; /* Actually, only one tty per port */ |
1997 | } | 1999 | } |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 799337f7fde1..f5b60c70389b 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -167,14 +167,14 @@ spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos) | |||
167 | 167 | ||
168 | mutex_lock(&spidev->buf_lock); | 168 | mutex_lock(&spidev->buf_lock); |
169 | status = spidev_sync_read(spidev, count); | 169 | status = spidev_sync_read(spidev, count); |
170 | if (status == 0) { | 170 | if (status > 0) { |
171 | unsigned long missing; | 171 | unsigned long missing; |
172 | 172 | ||
173 | missing = copy_to_user(buf, spidev->buffer, count); | 173 | missing = copy_to_user(buf, spidev->buffer, status); |
174 | if (count && missing == count) | 174 | if (missing == status) |
175 | status = -EFAULT; | 175 | status = -EFAULT; |
176 | else | 176 | else |
177 | status = count - missing; | 177 | status = status - missing; |
178 | } | 178 | } |
179 | mutex_unlock(&spidev->buf_lock); | 179 | mutex_unlock(&spidev->buf_lock); |
180 | 180 | ||
@@ -200,8 +200,6 @@ spidev_write(struct file *filp, const char __user *buf, | |||
200 | missing = copy_from_user(spidev->buffer, buf, count); | 200 | missing = copy_from_user(spidev->buffer, buf, count); |
201 | if (missing == 0) { | 201 | if (missing == 0) { |
202 | status = spidev_sync_write(spidev, count); | 202 | status = spidev_sync_write(spidev, count); |
203 | if (status == 0) | ||
204 | status = count; | ||
205 | } else | 203 | } else |
206 | status = -EFAULT; | 204 | status = -EFAULT; |
207 | mutex_unlock(&spidev->buf_lock); | 205 | mutex_unlock(&spidev->buf_lock); |
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c index d28c53868093..538c570df337 100644 --- a/drivers/ssb/driver_pcicore.c +++ b/drivers/ssb/driver_pcicore.c | |||
@@ -537,6 +537,13 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, | |||
537 | int err = 0; | 537 | int err = 0; |
538 | u32 tmp; | 538 | u32 tmp; |
539 | 539 | ||
540 | if (dev->bus->bustype != SSB_BUSTYPE_PCI) { | ||
541 | /* This SSB device is not on a PCI host-bus. So the IRQs are | ||
542 | * not routed through the PCI core. | ||
543 | * So we must not enable routing through the PCI core. */ | ||
544 | goto out; | ||
545 | } | ||
546 | |||
540 | if (!pdev) | 547 | if (!pdev) |
541 | goto out; | 548 | goto out; |
542 | bus = pdev->bus; | 549 | bus = pdev->bus; |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 63c34043b4d9..c3201affa0b6 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1125,9 +1125,6 @@ static void stop_data_traffic(struct acm *acm) | |||
1125 | for (i = 0; i < acm->rx_buflimit; i++) | 1125 | for (i = 0; i < acm->rx_buflimit; i++) |
1126 | usb_kill_urb(acm->ru[i].urb); | 1126 | usb_kill_urb(acm->ru[i].urb); |
1127 | 1127 | ||
1128 | INIT_LIST_HEAD(&acm->filled_read_bufs); | ||
1129 | INIT_LIST_HEAD(&acm->spare_read_bufs); | ||
1130 | |||
1131 | tasklet_enable(&acm->urb_task); | 1128 | tasklet_enable(&acm->urb_task); |
1132 | 1129 | ||
1133 | cancel_work_sync(&acm->work); | 1130 | cancel_work_sync(&acm->work); |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 09a53e7f3327..42a436478b78 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -924,6 +924,15 @@ static int register_root_hub(struct usb_hcd *hcd) | |||
924 | return retval; | 924 | return retval; |
925 | } | 925 | } |
926 | 926 | ||
927 | void usb_enable_root_hub_irq (struct usb_bus *bus) | ||
928 | { | ||
929 | struct usb_hcd *hcd; | ||
930 | |||
931 | hcd = container_of (bus, struct usb_hcd, self); | ||
932 | if (hcd->driver->hub_irq_enable && hcd->state != HC_STATE_HALT) | ||
933 | hcd->driver->hub_irq_enable (hcd); | ||
934 | } | ||
935 | |||
927 | 936 | ||
928 | /*-------------------------------------------------------------------------*/ | 937 | /*-------------------------------------------------------------------------*/ |
929 | 938 | ||
@@ -1684,19 +1693,30 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum); | |||
1684 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) | 1693 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) |
1685 | { | 1694 | { |
1686 | struct usb_hcd *hcd = __hcd; | 1695 | struct usb_hcd *hcd = __hcd; |
1687 | int start = hcd->state; | 1696 | unsigned long flags; |
1697 | irqreturn_t rc; | ||
1688 | 1698 | ||
1689 | if (unlikely(start == HC_STATE_HALT || | 1699 | /* IRQF_DISABLED doesn't work correctly with shared IRQs |
1690 | !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) | 1700 | * when the first handler doesn't use it. So let's just |
1691 | return IRQ_NONE; | 1701 | * assume it's never used. |
1692 | if (hcd->driver->irq (hcd) == IRQ_NONE) | 1702 | */ |
1693 | return IRQ_NONE; | 1703 | local_irq_save(flags); |
1694 | 1704 | ||
1695 | set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); | 1705 | if (unlikely(hcd->state == HC_STATE_HALT || |
1706 | !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { | ||
1707 | rc = IRQ_NONE; | ||
1708 | } else if (hcd->driver->irq(hcd) == IRQ_NONE) { | ||
1709 | rc = IRQ_NONE; | ||
1710 | } else { | ||
1711 | set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); | ||
1712 | |||
1713 | if (unlikely(hcd->state == HC_STATE_HALT)) | ||
1714 | usb_hc_died(hcd); | ||
1715 | rc = IRQ_HANDLED; | ||
1716 | } | ||
1696 | 1717 | ||
1697 | if (unlikely(hcd->state == HC_STATE_HALT)) | 1718 | local_irq_restore(flags); |
1698 | usb_hc_died (hcd); | 1719 | return rc; |
1699 | return IRQ_HANDLED; | ||
1700 | } | 1720 | } |
1701 | 1721 | ||
1702 | /*-------------------------------------------------------------------------*/ | 1722 | /*-------------------------------------------------------------------------*/ |
@@ -1860,6 +1880,13 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
1860 | 1880 | ||
1861 | /* enable irqs just before we start the controller */ | 1881 | /* enable irqs just before we start the controller */ |
1862 | if (hcd->driver->irq) { | 1882 | if (hcd->driver->irq) { |
1883 | |||
1884 | /* IRQF_DISABLED doesn't work as advertised when used together | ||
1885 | * with IRQF_SHARED. As usb_hcd_irq() will always disable | ||
1886 | * interrupts we can remove it here. | ||
1887 | */ | ||
1888 | irqflags &= ~IRQF_DISABLED; | ||
1889 | |||
1863 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", | 1890 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", |
1864 | hcd->driver->description, hcd->self.busnum); | 1891 | hcd->driver->description, hcd->self.busnum); |
1865 | if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags, | 1892 | if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags, |
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index a0bf5df6cb6f..b9de1569b39e 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -210,6 +210,8 @@ struct hc_driver { | |||
210 | int (*bus_suspend)(struct usb_hcd *); | 210 | int (*bus_suspend)(struct usb_hcd *); |
211 | int (*bus_resume)(struct usb_hcd *); | 211 | int (*bus_resume)(struct usb_hcd *); |
212 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); | 212 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); |
213 | void (*hub_irq_enable)(struct usb_hcd *); | ||
214 | /* Needed only if port-change IRQs are level-triggered */ | ||
213 | 215 | ||
214 | /* force handover of high-speed port to full-speed companion */ | 216 | /* force handover of high-speed port to full-speed companion */ |
215 | void (*relinquish_port)(struct usb_hcd *, int); | 217 | void (*relinquish_port)(struct usb_hcd *, int); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 94789be54ca3..4cfe32a16c37 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -713,18 +713,11 @@ static void hub_restart(struct usb_hub *hub, int type) | |||
713 | } | 713 | } |
714 | 714 | ||
715 | /* Was the power session lost while we were suspended? */ | 715 | /* Was the power session lost while we were suspended? */ |
716 | switch (type) { | 716 | status = hub_port_status(hub, port1, &portstatus, &portchange); |
717 | case HUB_RESET_RESUME: | ||
718 | portstatus = 0; | ||
719 | portchange = USB_PORT_STAT_C_CONNECTION; | ||
720 | break; | ||
721 | 717 | ||
722 | case HUB_RESET: | 718 | /* If the device is gone, khubd will handle it later */ |
723 | case HUB_RESUME: | 719 | if (status == 0 && !(portstatus & USB_PORT_STAT_CONNECTION)) |
724 | status = hub_port_status(hub, port1, | 720 | continue; |
725 | &portstatus, &portchange); | ||
726 | break; | ||
727 | } | ||
728 | 721 | ||
729 | /* For "USB_PERSIST"-enabled children we must | 722 | /* For "USB_PERSIST"-enabled children we must |
730 | * mark the child device for reset-resume and | 723 | * mark the child device for reset-resume and |
@@ -2080,6 +2073,8 @@ int usb_port_resume(struct usb_device *udev) | |||
2080 | } | 2073 | } |
2081 | 2074 | ||
2082 | clear_bit(port1, hub->busy_bits); | 2075 | clear_bit(port1, hub->busy_bits); |
2076 | if (!hub->hdev->parent && !hub->busy_bits[0]) | ||
2077 | usb_enable_root_hub_irq(hub->hdev->bus); | ||
2083 | 2078 | ||
2084 | if (status == 0) | 2079 | if (status == 0) |
2085 | status = finish_port_resume(udev); | 2080 | status = finish_port_resume(udev); |
@@ -3009,6 +3004,11 @@ static void hub_events(void) | |||
3009 | 3004 | ||
3010 | hub->activating = 0; | 3005 | hub->activating = 0; |
3011 | 3006 | ||
3007 | /* If this is a root hub, tell the HCD it's okay to | ||
3008 | * re-enable port-change interrupts now. */ | ||
3009 | if (!hdev->parent && !hub->busy_bits[0]) | ||
3010 | usb_enable_root_hub_irq(hdev->bus); | ||
3011 | |||
3012 | loop_autopm: | 3012 | loop_autopm: |
3013 | /* Allow autosuspend if we're not going to run again */ | 3013 | /* Allow autosuspend if we're not going to run again */ |
3014 | if (list_empty(&hub->event_list)) | 3014 | if (list_empty(&hub->event_list)) |
@@ -3234,6 +3234,8 @@ int usb_reset_device(struct usb_device *udev) | |||
3234 | break; | 3234 | break; |
3235 | } | 3235 | } |
3236 | clear_bit(port1, parent_hub->busy_bits); | 3236 | clear_bit(port1, parent_hub->busy_bits); |
3237 | if (!parent_hdev->parent && !parent_hub->busy_bits[0]) | ||
3238 | usb_enable_root_hub_irq(parent_hdev->bus); | ||
3237 | 3239 | ||
3238 | if (ret < 0) | 3240 | if (ret < 0) |
3239 | goto re_enumerate; | 3241 | goto re_enumerate; |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 35a03095757e..90245fd8bac4 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -177,6 +177,15 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
177 | static inline void | 177 | static inline void |
178 | timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | 178 | timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) |
179 | { | 179 | { |
180 | /* Don't override timeouts which shrink or (later) disable | ||
181 | * the async ring; just the I/O watchdog. Note that if a | ||
182 | * SHRINK were pending, OFF would never be requested. | ||
183 | */ | ||
184 | if (timer_pending(&ehci->watchdog) | ||
185 | && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF)) | ||
186 | & ehci->actions)) | ||
187 | return; | ||
188 | |||
180 | if (!test_and_set_bit (action, &ehci->actions)) { | 189 | if (!test_and_set_bit (action, &ehci->actions)) { |
181 | unsigned long t; | 190 | unsigned long t; |
182 | 191 | ||
@@ -192,15 +201,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
192 | t = EHCI_SHRINK_JIFFIES; | 201 | t = EHCI_SHRINK_JIFFIES; |
193 | break; | 202 | break; |
194 | } | 203 | } |
195 | t += jiffies; | 204 | mod_timer(&ehci->watchdog, t + jiffies); |
196 | // all timings except IAA watchdog can be overridden. | ||
197 | // async queue SHRINK often precedes IAA. while it's ready | ||
198 | // to go OFF neither can matter, and afterwards the IO | ||
199 | // watchdog stops unless there's still periodic traffic. | ||
200 | if (time_before_eq(t, ehci->watchdog.expires) | ||
201 | && timer_pending (&ehci->watchdog)) | ||
202 | return; | ||
203 | mod_timer (&ehci->watchdog, t); | ||
204 | } | 205 | } |
205 | } | 206 | } |
206 | 207 | ||
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index c96db1153dcf..e534f9de0f05 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -261,6 +261,7 @@ static const struct hc_driver ohci_at91_hc_driver = { | |||
261 | */ | 261 | */ |
262 | .hub_status_data = ohci_hub_status_data, | 262 | .hub_status_data = ohci_hub_status_data, |
263 | .hub_control = ohci_hub_control, | 263 | .hub_control = ohci_hub_control, |
264 | .hub_irq_enable = ohci_rhsc_enable, | ||
264 | #ifdef CONFIG_PM | 265 | #ifdef CONFIG_PM |
265 | .bus_suspend = ohci_bus_suspend, | 266 | .bus_suspend = ohci_bus_suspend, |
266 | .bus_resume = ohci_bus_resume, | 267 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index 1b9abdba920b..68c17f5ea8ea 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Bus Glue for AMD Alchemy Au1xxx | 8 | * Bus Glue for AMD Alchemy Au1xxx |
9 | * | 9 | * |
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | 10 | * Written by Christopher Hoover <ch@hpl.hp.com> |
11 | * Based on fragments of previous driver by Rusell King et al. | 11 | * Based on fragments of previous driver by Russell King et al. |
12 | * | 12 | * |
13 | * Modified for LH7A404 from ohci-sa1111.c | 13 | * Modified for LH7A404 from ohci-sa1111.c |
14 | * by Durgesh Pattamatta <pattamattad@sharpsec.com> | 14 | * by Durgesh Pattamatta <pattamattad@sharpsec.com> |
@@ -288,6 +288,7 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
288 | */ | 288 | */ |
289 | .hub_status_data = ohci_hub_status_data, | 289 | .hub_status_data = ohci_hub_status_data, |
290 | .hub_control = ohci_hub_control, | 290 | .hub_control = ohci_hub_control, |
291 | .hub_irq_enable = ohci_rhsc_enable, | ||
291 | #ifdef CONFIG_PM | 292 | #ifdef CONFIG_PM |
292 | .bus_suspend = ohci_bus_suspend, | 293 | .bus_suspend = ohci_bus_suspend, |
293 | .bus_resume = ohci_bus_resume, | 294 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index 06aadfb0ec29..5adaf36e47d0 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c | |||
@@ -135,6 +135,7 @@ static struct hc_driver ohci_ep93xx_hc_driver = { | |||
135 | .get_frame_number = ohci_get_frame, | 135 | .get_frame_number = ohci_get_frame, |
136 | .hub_status_data = ohci_hub_status_data, | 136 | .hub_status_data = ohci_hub_status_data, |
137 | .hub_control = ohci_hub_control, | 137 | .hub_control = ohci_hub_control, |
138 | .hub_irq_enable = ohci_rhsc_enable, | ||
138 | #ifdef CONFIG_PM | 139 | #ifdef CONFIG_PM |
139 | .bus_suspend = ohci_bus_suspend, | 140 | .bus_suspend = ohci_bus_suspend, |
140 | .bus_resume = ohci_bus_resume, | 141 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 33f1c1c32edf..a8160d65f32b 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -1054,7 +1054,7 @@ MODULE_LICENSE ("GPL"); | |||
1054 | 1054 | ||
1055 | #ifdef CONFIG_MFD_SM501 | 1055 | #ifdef CONFIG_MFD_SM501 |
1056 | #include "ohci-sm501.c" | 1056 | #include "ohci-sm501.c" |
1057 | #define PLATFORM_DRIVER ohci_hcd_sm501_driver | 1057 | #define SM501_OHCI_DRIVER ohci_hcd_sm501_driver |
1058 | #endif | 1058 | #endif |
1059 | 1059 | ||
1060 | #if !defined(PCI_DRIVER) && \ | 1060 | #if !defined(PCI_DRIVER) && \ |
@@ -1062,6 +1062,7 @@ MODULE_LICENSE ("GPL"); | |||
1062 | !defined(OF_PLATFORM_DRIVER) && \ | 1062 | !defined(OF_PLATFORM_DRIVER) && \ |
1063 | !defined(SA1111_DRIVER) && \ | 1063 | !defined(SA1111_DRIVER) && \ |
1064 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ | 1064 | !defined(PS3_SYSTEM_BUS_DRIVER) && \ |
1065 | !defined(SM501_OHCI_DRIVER) && \ | ||
1065 | !defined(SSB_OHCI_DRIVER) | 1066 | !defined(SSB_OHCI_DRIVER) |
1066 | #error "missing bus glue for ohci-hcd" | 1067 | #error "missing bus glue for ohci-hcd" |
1067 | #endif | 1068 | #endif |
@@ -1121,9 +1122,18 @@ static int __init ohci_hcd_mod_init(void) | |||
1121 | goto error_ssb; | 1122 | goto error_ssb; |
1122 | #endif | 1123 | #endif |
1123 | 1124 | ||
1125 | #ifdef SM501_OHCI_DRIVER | ||
1126 | retval = platform_driver_register(&SM501_OHCI_DRIVER); | ||
1127 | if (retval < 0) | ||
1128 | goto error_sm501; | ||
1129 | #endif | ||
1130 | |||
1124 | return retval; | 1131 | return retval; |
1125 | 1132 | ||
1126 | /* Error path */ | 1133 | /* Error path */ |
1134 | #ifdef SM501_OHCI_DRIVER | ||
1135 | error_sm501: | ||
1136 | #endif | ||
1127 | #ifdef SSB_OHCI_DRIVER | 1137 | #ifdef SSB_OHCI_DRIVER |
1128 | error_ssb: | 1138 | error_ssb: |
1129 | #endif | 1139 | #endif |
@@ -1159,6 +1169,9 @@ module_init(ohci_hcd_mod_init); | |||
1159 | 1169 | ||
1160 | static void __exit ohci_hcd_mod_exit(void) | 1170 | static void __exit ohci_hcd_mod_exit(void) |
1161 | { | 1171 | { |
1172 | #ifdef SM501_OHCI_DRIVER | ||
1173 | platform_driver_unregister(&SM501_OHCI_DRIVER); | ||
1174 | #endif | ||
1162 | #ifdef SSB_OHCI_DRIVER | 1175 | #ifdef SSB_OHCI_DRIVER |
1163 | ssb_driver_unregister(&SSB_OHCI_DRIVER); | 1176 | ssb_driver_unregister(&SSB_OHCI_DRIVER); |
1164 | #endif | 1177 | #endif |
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 79a78029f896..b56739221d11 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -36,6 +36,18 @@ | |||
36 | 36 | ||
37 | /*-------------------------------------------------------------------------*/ | 37 | /*-------------------------------------------------------------------------*/ |
38 | 38 | ||
39 | /* hcd->hub_irq_enable() */ | ||
40 | static void ohci_rhsc_enable (struct usb_hcd *hcd) | ||
41 | { | ||
42 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | ||
43 | |||
44 | spin_lock_irq(&ohci->lock); | ||
45 | if (!ohci->autostop) | ||
46 | del_timer(&hcd->rh_timer); /* Prevent next poll */ | ||
47 | ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable); | ||
48 | spin_unlock_irq(&ohci->lock); | ||
49 | } | ||
50 | |||
39 | #define OHCI_SCHED_ENABLES \ | 51 | #define OHCI_SCHED_ENABLES \ |
40 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) | 52 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) |
41 | 53 | ||
@@ -362,28 +374,18 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
362 | int any_connected) | 374 | int any_connected) |
363 | { | 375 | { |
364 | int poll_rh = 1; | 376 | int poll_rh = 1; |
365 | int rhsc; | ||
366 | 377 | ||
367 | rhsc = ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC; | ||
368 | switch (ohci->hc_control & OHCI_CTRL_HCFS) { | 378 | switch (ohci->hc_control & OHCI_CTRL_HCFS) { |
369 | 379 | ||
370 | case OHCI_USB_OPER: | 380 | case OHCI_USB_OPER: |
371 | /* If no status changes are pending, enable status-change | 381 | /* keep on polling until we know a device is connected |
372 | * interrupts. | 382 | * and RHSC is enabled */ |
373 | */ | ||
374 | if (!rhsc && !changed) { | ||
375 | rhsc = OHCI_INTR_RHSC; | ||
376 | ohci_writel(ohci, rhsc, &ohci->regs->intrenable); | ||
377 | } | ||
378 | |||
379 | /* Keep on polling until we know a device is connected | ||
380 | * and RHSC is enabled, or until we autostop. | ||
381 | */ | ||
382 | if (!ohci->autostop) { | 383 | if (!ohci->autostop) { |
383 | if (any_connected || | 384 | if (any_connected || |
384 | !device_may_wakeup(&ohci_to_hcd(ohci) | 385 | !device_may_wakeup(&ohci_to_hcd(ohci) |
385 | ->self.root_hub->dev)) { | 386 | ->self.root_hub->dev)) { |
386 | if (rhsc) | 387 | if (ohci_readl(ohci, &ohci->regs->intrenable) & |
388 | OHCI_INTR_RHSC) | ||
387 | poll_rh = 0; | 389 | poll_rh = 0; |
388 | } else { | 390 | } else { |
389 | ohci->autostop = 1; | 391 | ohci->autostop = 1; |
@@ -396,13 +398,12 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
396 | ohci->autostop = 0; | 398 | ohci->autostop = 0; |
397 | ohci->next_statechange = jiffies + | 399 | ohci->next_statechange = jiffies + |
398 | STATECHANGE_DELAY; | 400 | STATECHANGE_DELAY; |
399 | } else if (rhsc && time_after_eq(jiffies, | 401 | } else if (time_after_eq(jiffies, |
400 | ohci->next_statechange) | 402 | ohci->next_statechange) |
401 | && !ohci->ed_rm_list | 403 | && !ohci->ed_rm_list |
402 | && !(ohci->hc_control & | 404 | && !(ohci->hc_control & |
403 | OHCI_SCHED_ENABLES)) { | 405 | OHCI_SCHED_ENABLES)) { |
404 | ohci_rh_suspend(ohci, 1); | 406 | ohci_rh_suspend(ohci, 1); |
405 | poll_rh = 0; | ||
406 | } | 407 | } |
407 | } | 408 | } |
408 | break; | 409 | break; |
@@ -416,12 +417,6 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
416 | else | 417 | else |
417 | usb_hcd_resume_root_hub(ohci_to_hcd(ohci)); | 418 | usb_hcd_resume_root_hub(ohci_to_hcd(ohci)); |
418 | } else { | 419 | } else { |
419 | if (!rhsc && (ohci->autostop || | ||
420 | ohci_to_hcd(ohci)->self.root_hub-> | ||
421 | do_remote_wakeup)) | ||
422 | ohci_writel(ohci, OHCI_INTR_RHSC, | ||
423 | &ohci->regs->intrenable); | ||
424 | |||
425 | /* everything is idle, no need for polling */ | 420 | /* everything is idle, no need for polling */ |
426 | poll_rh = 0; | 421 | poll_rh = 0; |
427 | } | 422 | } |
@@ -443,16 +438,12 @@ static inline int ohci_rh_resume(struct ohci_hcd *ohci) | |||
443 | static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | 438 | static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, |
444 | int any_connected) | 439 | int any_connected) |
445 | { | 440 | { |
446 | /* If RHSC is enabled, don't poll */ | 441 | int poll_rh = 1; |
447 | if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC) | ||
448 | return 0; | ||
449 | 442 | ||
450 | /* If no status changes are pending, enable status-change interrupts */ | 443 | /* keep on polling until RHSC is enabled */ |
451 | if (!changed) { | 444 | if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC) |
452 | ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable); | 445 | poll_rh = 0; |
453 | return 0; | 446 | return poll_rh; |
454 | } | ||
455 | return 1; | ||
456 | } | 447 | } |
457 | 448 | ||
458 | #endif /* CONFIG_PM */ | 449 | #endif /* CONFIG_PM */ |
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 96d14fa1d833..1ef5d482c145 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Bus Glue for Sharp LH7A404 | 8 | * Bus Glue for Sharp LH7A404 |
9 | * | 9 | * |
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | 10 | * Written by Christopher Hoover <ch@hpl.hp.com> |
11 | * Based on fragments of previous driver by Rusell King et al. | 11 | * Based on fragments of previous driver by Russell King et al. |
12 | * | 12 | * |
13 | * Modified for LH7A404 from ohci-sa1111.c | 13 | * Modified for LH7A404 from ohci-sa1111.c |
14 | * by Durgesh Pattamatta <pattamattad@sharpsec.com> | 14 | * by Durgesh Pattamatta <pattamattad@sharpsec.com> |
@@ -193,6 +193,7 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { | |||
193 | */ | 193 | */ |
194 | .hub_status_data = ohci_hub_status_data, | 194 | .hub_status_data = ohci_hub_status_data, |
195 | .hub_control = ohci_hub_control, | 195 | .hub_control = ohci_hub_control, |
196 | .hub_irq_enable = ohci_rhsc_enable, | ||
196 | #ifdef CONFIG_PM | 197 | #ifdef CONFIG_PM |
197 | .bus_suspend = ohci_bus_suspend, | 198 | .bus_suspend = ohci_bus_suspend, |
198 | .bus_resume = ohci_bus_resume, | 199 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 6859fb5f1d6f..3a7c24c03671 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -466,6 +466,7 @@ static const struct hc_driver ohci_omap_hc_driver = { | |||
466 | */ | 466 | */ |
467 | .hub_status_data = ohci_hub_status_data, | 467 | .hub_status_data = ohci_hub_status_data, |
468 | .hub_control = ohci_hub_control, | 468 | .hub_control = ohci_hub_control, |
469 | .hub_irq_enable = ohci_rhsc_enable, | ||
469 | #ifdef CONFIG_PM | 470 | #ifdef CONFIG_PM |
470 | .bus_suspend = ohci_bus_suspend, | 471 | .bus_suspend = ohci_bus_suspend, |
471 | .bus_resume = ohci_bus_resume, | 472 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 3bf175d95a23..4696cc912e16 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -327,6 +327,7 @@ static const struct hc_driver ohci_pci_hc_driver = { | |||
327 | */ | 327 | */ |
328 | .hub_status_data = ohci_hub_status_data, | 328 | .hub_status_data = ohci_hub_status_data, |
329 | .hub_control = ohci_hub_control, | 329 | .hub_control = ohci_hub_control, |
330 | .hub_irq_enable = ohci_rhsc_enable, | ||
330 | #ifdef CONFIG_PM | 331 | #ifdef CONFIG_PM |
331 | .bus_suspend = ohci_bus_suspend, | 332 | .bus_suspend = ohci_bus_suspend, |
332 | .bus_resume = ohci_bus_resume, | 333 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c index 664f07ee8732..28b458f20cc3 100644 --- a/drivers/usb/host/ohci-pnx4008.c +++ b/drivers/usb/host/ohci-pnx4008.c | |||
@@ -280,6 +280,7 @@ static const struct hc_driver ohci_pnx4008_hc_driver = { | |||
280 | */ | 280 | */ |
281 | .hub_status_data = ohci_hub_status_data, | 281 | .hub_status_data = ohci_hub_status_data, |
282 | .hub_control = ohci_hub_control, | 282 | .hub_control = ohci_hub_control, |
283 | .hub_irq_enable = ohci_rhsc_enable, | ||
283 | #ifdef CONFIG_PM | 284 | #ifdef CONFIG_PM |
284 | .bus_suspend = ohci_bus_suspend, | 285 | .bus_suspend = ohci_bus_suspend, |
285 | .bus_resume = ohci_bus_resume, | 286 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pnx8550.c b/drivers/usb/host/ohci-pnx8550.c index 28467e288a93..605d59cba28e 100644 --- a/drivers/usb/host/ohci-pnx8550.c +++ b/drivers/usb/host/ohci-pnx8550.c | |||
@@ -201,6 +201,7 @@ static const struct hc_driver ohci_pnx8550_hc_driver = { | |||
201 | */ | 201 | */ |
202 | .hub_status_data = ohci_hub_status_data, | 202 | .hub_status_data = ohci_hub_status_data, |
203 | .hub_control = ohci_hub_control, | 203 | .hub_control = ohci_hub_control, |
204 | .hub_irq_enable = ohci_rhsc_enable, | ||
204 | #ifdef CONFIG_PM | 205 | #ifdef CONFIG_PM |
205 | .bus_suspend = ohci_bus_suspend, | 206 | .bus_suspend = ohci_bus_suspend, |
206 | .bus_resume = ohci_bus_resume, | 207 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c index 50e55db13636..a67252791223 100644 --- a/drivers/usb/host/ohci-ppc-of.c +++ b/drivers/usb/host/ohci-ppc-of.c | |||
@@ -72,6 +72,7 @@ static const struct hc_driver ohci_ppc_of_hc_driver = { | |||
72 | */ | 72 | */ |
73 | .hub_status_data = ohci_hub_status_data, | 73 | .hub_status_data = ohci_hub_status_data, |
74 | .hub_control = ohci_hub_control, | 74 | .hub_control = ohci_hub_control, |
75 | .hub_irq_enable = ohci_rhsc_enable, | ||
75 | #ifdef CONFIG_PM | 76 | #ifdef CONFIG_PM |
76 | .bus_suspend = ohci_bus_suspend, | 77 | .bus_suspend = ohci_bus_suspend, |
77 | .bus_resume = ohci_bus_resume, | 78 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index cd3398b675b2..523c30125577 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
@@ -172,6 +172,7 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
172 | */ | 172 | */ |
173 | .hub_status_data = ohci_hub_status_data, | 173 | .hub_status_data = ohci_hub_status_data, |
174 | .hub_control = ohci_hub_control, | 174 | .hub_control = ohci_hub_control, |
175 | .hub_irq_enable = ohci_rhsc_enable, | ||
175 | #ifdef CONFIG_PM | 176 | #ifdef CONFIG_PM |
176 | .bus_suspend = ohci_bus_suspend, | 177 | .bus_suspend = ohci_bus_suspend, |
177 | .bus_resume = ohci_bus_resume, | 178 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c index bfdeb0d22d05..c1935ae537f8 100644 --- a/drivers/usb/host/ohci-ps3.c +++ b/drivers/usb/host/ohci-ps3.c | |||
@@ -68,6 +68,7 @@ static const struct hc_driver ps3_ohci_hc_driver = { | |||
68 | .get_frame_number = ohci_get_frame, | 68 | .get_frame_number = ohci_get_frame, |
69 | .hub_status_data = ohci_hub_status_data, | 69 | .hub_status_data = ohci_hub_status_data, |
70 | .hub_control = ohci_hub_control, | 70 | .hub_control = ohci_hub_control, |
71 | .hub_irq_enable = ohci_rhsc_enable, | ||
71 | .start_port_reset = ohci_start_port_reset, | 72 | .start_port_reset = ohci_start_port_reset, |
72 | #if defined(CONFIG_PM) | 73 | #if defined(CONFIG_PM) |
73 | .bus_suspend = ohci_bus_suspend, | 74 | .bus_suspend = ohci_bus_suspend, |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 70b0d4b459e7..d4ee27d92be8 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -298,6 +298,7 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
298 | */ | 298 | */ |
299 | .hub_status_data = ohci_hub_status_data, | 299 | .hub_status_data = ohci_hub_status_data, |
300 | .hub_control = ohci_hub_control, | 300 | .hub_control = ohci_hub_control, |
301 | .hub_irq_enable = ohci_rhsc_enable, | ||
301 | #ifdef CONFIG_PM | 302 | #ifdef CONFIG_PM |
302 | .bus_suspend = ohci_bus_suspend, | 303 | .bus_suspend = ohci_bus_suspend, |
303 | .bus_resume = ohci_bus_resume, | 304 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index 9c9f3b59186f..9b547407c934 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -952,6 +952,7 @@ rescan_this: | |||
952 | struct urb *urb; | 952 | struct urb *urb; |
953 | urb_priv_t *urb_priv; | 953 | urb_priv_t *urb_priv; |
954 | __hc32 savebits; | 954 | __hc32 savebits; |
955 | u32 tdINFO; | ||
955 | 956 | ||
956 | td = list_entry (entry, struct td, td_list); | 957 | td = list_entry (entry, struct td, td_list); |
957 | urb = td->urb; | 958 | urb = td->urb; |
@@ -966,6 +967,17 @@ rescan_this: | |||
966 | savebits = *prev & ~cpu_to_hc32 (ohci, TD_MASK); | 967 | savebits = *prev & ~cpu_to_hc32 (ohci, TD_MASK); |
967 | *prev = td->hwNextTD | savebits; | 968 | *prev = td->hwNextTD | savebits; |
968 | 969 | ||
970 | /* If this was unlinked, the TD may not have been | ||
971 | * retired ... so manually save the data toggle. | ||
972 | * The controller ignores the value we save for | ||
973 | * control and ISO endpoints. | ||
974 | */ | ||
975 | tdINFO = hc32_to_cpup(ohci, &td->hwINFO); | ||
976 | if ((tdINFO & TD_T) == TD_T_DATA0) | ||
977 | ed->hwHeadP &= ~cpu_to_hc32(ohci, ED_C); | ||
978 | else if ((tdINFO & TD_T) == TD_T_DATA1) | ||
979 | ed->hwHeadP |= cpu_to_hc32(ohci, ED_C); | ||
980 | |||
969 | /* HC may have partly processed this TD */ | 981 | /* HC may have partly processed this TD */ |
970 | td_done (ohci, urb, td); | 982 | td_done (ohci, urb, td); |
971 | urb_priv->td_cnt++; | 983 | urb_priv->td_cnt++; |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index a73d2ff322e2..3c7a740cfe0c 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * USB Bus Glue for Samsung S3C2410 | 8 | * USB Bus Glue for Samsung S3C2410 |
9 | * | 9 | * |
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | 10 | * Written by Christopher Hoover <ch@hpl.hp.com> |
11 | * Based on fragments of previous driver by Rusell King et al. | 11 | * Based on fragments of previous driver by Russell King et al. |
12 | * | 12 | * |
13 | * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c | 13 | * Modified for S3C2410 from ohci-sa1111.c, ohci-omap.c and ohci-lh7a40.c |
14 | * by Ben Dooks, <ben@simtec.co.uk> | 14 | * by Ben Dooks, <ben@simtec.co.uk> |
@@ -466,6 +466,7 @@ static const struct hc_driver ohci_s3c2410_hc_driver = { | |||
466 | */ | 466 | */ |
467 | .hub_status_data = ohci_s3c2410_hub_status_data, | 467 | .hub_status_data = ohci_s3c2410_hub_status_data, |
468 | .hub_control = ohci_s3c2410_hub_control, | 468 | .hub_control = ohci_s3c2410_hub_control, |
469 | .hub_irq_enable = ohci_rhsc_enable, | ||
469 | #ifdef CONFIG_PM | 470 | #ifdef CONFIG_PM |
470 | .bus_suspend = ohci_bus_suspend, | 471 | .bus_suspend = ohci_bus_suspend, |
471 | .bus_resume = ohci_bus_resume, | 472 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 99438c65981b..2e9dceb9bb99 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * SA1111 Bus Glue | 8 | * SA1111 Bus Glue |
9 | * | 9 | * |
10 | * Written by Christopher Hoover <ch@hpl.hp.com> | 10 | * Written by Christopher Hoover <ch@hpl.hp.com> |
11 | * Based on fragments of previous driver by Rusell King et al. | 11 | * Based on fragments of previous driver by Russell King et al. |
12 | * | 12 | * |
13 | * This file is licenced under the GPL. | 13 | * This file is licenced under the GPL. |
14 | */ | 14 | */ |
@@ -231,6 +231,7 @@ static const struct hc_driver ohci_sa1111_hc_driver = { | |||
231 | */ | 231 | */ |
232 | .hub_status_data = ohci_hub_status_data, | 232 | .hub_status_data = ohci_hub_status_data, |
233 | .hub_control = ohci_hub_control, | 233 | .hub_control = ohci_hub_control, |
234 | .hub_irq_enable = ohci_rhsc_enable, | ||
234 | #ifdef CONFIG_PM | 235 | #ifdef CONFIG_PM |
235 | .bus_suspend = ohci_bus_suspend, | 236 | .bus_suspend = ohci_bus_suspend, |
236 | .bus_resume = ohci_bus_resume, | 237 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sh.c b/drivers/usb/host/ohci-sh.c index 60f03cc7ec4f..e7ee607278fe 100644 --- a/drivers/usb/host/ohci-sh.c +++ b/drivers/usb/host/ohci-sh.c | |||
@@ -68,6 +68,7 @@ static const struct hc_driver ohci_sh_hc_driver = { | |||
68 | */ | 68 | */ |
69 | .hub_status_data = ohci_hub_status_data, | 69 | .hub_status_data = ohci_hub_status_data, |
70 | .hub_control = ohci_hub_control, | 70 | .hub_control = ohci_hub_control, |
71 | .hub_irq_enable = ohci_rhsc_enable, | ||
71 | #ifdef CONFIG_PM | 72 | #ifdef CONFIG_PM |
72 | .bus_suspend = ohci_bus_suspend, | 73 | .bus_suspend = ohci_bus_suspend, |
73 | .bus_resume = ohci_bus_resume, | 74 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index e899a77dfb83..e610698c6b60 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c | |||
@@ -75,6 +75,7 @@ static const struct hc_driver ohci_sm501_hc_driver = { | |||
75 | */ | 75 | */ |
76 | .hub_status_data = ohci_hub_status_data, | 76 | .hub_status_data = ohci_hub_status_data, |
77 | .hub_control = ohci_hub_control, | 77 | .hub_control = ohci_hub_control, |
78 | .hub_irq_enable = ohci_rhsc_enable, | ||
78 | #ifdef CONFIG_PM | 79 | #ifdef CONFIG_PM |
79 | .bus_suspend = ohci_bus_suspend, | 80 | .bus_suspend = ohci_bus_suspend, |
80 | .bus_resume = ohci_bus_resume, | 81 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ssb.c b/drivers/usb/host/ohci-ssb.c index c4265caec780..7275186db315 100644 --- a/drivers/usb/host/ohci-ssb.c +++ b/drivers/usb/host/ohci-ssb.c | |||
@@ -81,6 +81,7 @@ static const struct hc_driver ssb_ohci_hc_driver = { | |||
81 | 81 | ||
82 | .hub_status_data = ohci_hub_status_data, | 82 | .hub_status_data = ohci_hub_status_data, |
83 | .hub_control = ohci_hub_control, | 83 | .hub_control = ohci_hub_control, |
84 | .hub_irq_enable = ohci_rhsc_enable, | ||
84 | #ifdef CONFIG_PM | 85 | #ifdef CONFIG_PM |
85 | .bus_suspend = ohci_bus_suspend, | 86 | .bus_suspend = ohci_bus_suspend, |
86 | .bus_resume = ohci_bus_resume, | 87 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index f29307405bb3..9b6323f768b2 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -2934,6 +2934,16 @@ static int u132_start_port_reset(struct usb_hcd *hcd, unsigned port_num) | |||
2934 | return 0; | 2934 | return 0; |
2935 | } | 2935 | } |
2936 | 2936 | ||
2937 | static void u132_hub_irq_enable(struct usb_hcd *hcd) | ||
2938 | { | ||
2939 | struct u132 *u132 = hcd_to_u132(hcd); | ||
2940 | if (u132->going > 1) { | ||
2941 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" | ||
2942 | , u132->going); | ||
2943 | } else if (u132->going > 0) | ||
2944 | dev_err(&u132->platform_dev->dev, "device is being removed\n"); | ||
2945 | } | ||
2946 | |||
2937 | 2947 | ||
2938 | #ifdef CONFIG_PM | 2948 | #ifdef CONFIG_PM |
2939 | static int u132_bus_suspend(struct usb_hcd *hcd) | 2949 | static int u132_bus_suspend(struct usb_hcd *hcd) |
@@ -2985,6 +2995,7 @@ static struct hc_driver u132_hc_driver = { | |||
2985 | .bus_suspend = u132_bus_suspend, | 2995 | .bus_suspend = u132_bus_suspend, |
2986 | .bus_resume = u132_bus_resume, | 2996 | .bus_resume = u132_bus_resume, |
2987 | .start_port_reset = u132_start_port_reset, | 2997 | .start_port_reset = u132_start_port_reset, |
2998 | .hub_irq_enable = u132_hub_irq_enable, | ||
2988 | }; | 2999 | }; |
2989 | 3000 | ||
2990 | /* | 3001 | /* |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index cb7fa0eaf3ae..33182f4c2267 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -3264,8 +3264,6 @@ static void sisusb_disconnect(struct usb_interface *intf) | |||
3264 | 3264 | ||
3265 | /* decrement our usage count */ | 3265 | /* decrement our usage count */ |
3266 | kref_put(&sisusb->kref, sisusb_delete); | 3266 | kref_put(&sisusb->kref, sisusb_delete); |
3267 | |||
3268 | dev_info(&sisusb->sisusb_dev->dev, "Disconnected\n"); | ||
3269 | } | 3267 | } |
3270 | 3268 | ||
3271 | static struct usb_device_id sisusb_table [] = { | 3269 | static struct usb_device_id sisusb_table [] = { |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 5234e7a3bd2c..0ff4a3971e45 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -637,6 +637,7 @@ static struct usb_device_id id_table_combined [] = { | |||
637 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), | 637 | { USB_DEVICE(FTDI_VID, FTDI_OOCDLINK_PID), |
638 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 638 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
639 | { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, | 639 | { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, |
640 | { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, | ||
640 | { }, /* Optional parameter entry */ | 641 | { }, /* Optional parameter entry */ |
641 | { } /* Terminating entry */ | 642 | { } /* Terminating entry */ |
642 | }; | 643 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 06e0ecabb3eb..8302eca893ea 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -828,6 +828,9 @@ | |||
828 | /* Propox devices */ | 828 | /* Propox devices */ |
829 | #define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 | 829 | #define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 |
830 | 830 | ||
831 | /* Rig Expert Ukraine devices */ | ||
832 | #define FTDI_REU_TINY_PID 0xED22 /* RigExpert Tiny */ | ||
833 | |||
831 | /* Commands */ | 834 | /* Commands */ |
832 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 835 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
833 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 836 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index ea924dc48496..d9fb3768a2d7 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -570,7 +570,12 @@ static struct usb_serial_driver ipaq_device = { | |||
570 | .description = "PocketPC PDA", | 570 | .description = "PocketPC PDA", |
571 | .usb_driver = &ipaq_driver, | 571 | .usb_driver = &ipaq_driver, |
572 | .id_table = ipaq_id_table, | 572 | .id_table = ipaq_id_table, |
573 | .num_ports = 2, | 573 | /* |
574 | * some devices have an extra endpoint, which | ||
575 | * must be ignored as it would make the core | ||
576 | * create a second port which oopses when used | ||
577 | */ | ||
578 | .num_ports = 1, | ||
574 | .open = ipaq_open, | 579 | .open = ipaq_open, |
575 | .close = ipaq_close, | 580 | .close = ipaq_close, |
576 | .attach = ipaq_startup, | 581 | .attach = ipaq_startup, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 43cfde83a93b..a73420dd052a 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -306,6 +306,7 @@ static struct usb_device_id option_ids[] = { | |||
306 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, | 306 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, |
307 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, | 307 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, |
308 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 308 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
309 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | ||
309 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 310 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
310 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 311 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
311 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, | 312 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 103195abd417..2a0dd1b50dc4 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -57,6 +57,7 @@ static struct usb_device_id id_table [] = { | |||
57 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, | 57 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, |
58 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, | 58 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) }, |
59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, | 59 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) }, |
60 | { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, | ||
60 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, | 61 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, |
61 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, | 62 | { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, |
62 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, | 63 | { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, |
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index cff160abb130..6ac3bbcf7a22 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 | 15 | #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 |
16 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 | 16 | #define PL2303_PRODUCT_ID_ALDIGA 0x0611 |
17 | #define PL2303_PRODUCT_ID_MMX 0x0612 | 17 | #define PL2303_PRODUCT_ID_MMX 0x0612 |
18 | #define PL2303_PRODUCT_ID_GPRS 0x0609 | ||
18 | 19 | ||
19 | #define ATEN_VENDOR_ID 0x0557 | 20 | #define ATEN_VENDOR_ID 0x0557 |
20 | #define ATEN_VENDOR_ID2 0x0547 | 21 | #define ATEN_VENDOR_ID2 0x0547 |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 45fe3663fa7f..39a7c11795c4 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -402,11 +402,19 @@ UNUSUAL_DEV( 0x04a5, 0x3010, 0x0100, 0x0100, | |||
402 | US_FL_IGNORE_RESIDUE ), | 402 | US_FL_IGNORE_RESIDUE ), |
403 | 403 | ||
404 | #ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB | 404 | #ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB |
405 | /* CY7C68300 : support atacb */ | ||
405 | UNUSUAL_DEV( 0x04b4, 0x6830, 0x0000, 0x9999, | 406 | UNUSUAL_DEV( 0x04b4, 0x6830, 0x0000, 0x9999, |
406 | "Cypress", | 407 | "Cypress", |
407 | "Cypress AT2LP", | 408 | "Cypress AT2LP", |
408 | US_SC_CYP_ATACB, US_PR_DEVICE, NULL, | 409 | US_SC_CYP_ATACB, US_PR_DEVICE, NULL, |
409 | 0), | 410 | 0), |
411 | |||
412 | /* CY7C68310 : support atacb and atacb2 */ | ||
413 | UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999, | ||
414 | "Cypress", | ||
415 | "Cypress ISD-300LP", | ||
416 | US_SC_CYP_ATACB, US_PR_DEVICE, NULL, | ||
417 | 0), | ||
410 | #endif | 418 | #endif |
411 | 419 | ||
412 | /* Reported by Simon Levitt <simon@whattf.com> | 420 | /* Reported by Simon Levitt <simon@whattf.com> |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 002b61b4f0f6..e0c5f96b273d 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1825,12 +1825,13 @@ config FB_FSL_DIU | |||
1825 | 1825 | ||
1826 | config FB_W100 | 1826 | config FB_W100 |
1827 | tristate "W100 frame buffer support" | 1827 | tristate "W100 frame buffer support" |
1828 | depends on FB && PXA_SHARPSL | 1828 | depends on FB && ARCH_PXA |
1829 | select FB_CFB_FILLRECT | 1829 | select FB_CFB_FILLRECT |
1830 | select FB_CFB_COPYAREA | 1830 | select FB_CFB_COPYAREA |
1831 | select FB_CFB_IMAGEBLIT | 1831 | select FB_CFB_IMAGEBLIT |
1832 | ---help--- | 1832 | ---help--- |
1833 | Frame buffer driver for the w100 as found on the Sharp SL-Cxx series. | 1833 | Frame buffer driver for the w100 as found on the Sharp SL-Cxx series. |
1834 | It can also drive the w3220 chip found on iPAQ hx4700. | ||
1834 | 1835 | ||
1835 | This driver is also available as a module ( = code which can be | 1836 | This driver is also available as a module ( = code which can be |
1836 | inserted and removed from the running kernel whenever you want). The | 1837 | inserted and removed from the running kernel whenever you want). The |
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 24843fdd5395..59df132cc375 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c | |||
@@ -74,6 +74,7 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma, | |||
74 | { | 74 | { |
75 | struct fb_info *info = vma->vm_private_data; | 75 | struct fb_info *info = vma->vm_private_data; |
76 | struct fb_deferred_io *fbdefio = info->fbdefio; | 76 | struct fb_deferred_io *fbdefio = info->fbdefio; |
77 | struct page *cur; | ||
77 | 78 | ||
78 | /* this is a callback we get when userspace first tries to | 79 | /* this is a callback we get when userspace first tries to |
79 | write to the page. we schedule a workqueue. that workqueue | 80 | write to the page. we schedule a workqueue. that workqueue |
@@ -83,7 +84,24 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma, | |||
83 | 84 | ||
84 | /* protect against the workqueue changing the page list */ | 85 | /* protect against the workqueue changing the page list */ |
85 | mutex_lock(&fbdefio->lock); | 86 | mutex_lock(&fbdefio->lock); |
86 | list_add(&page->lru, &fbdefio->pagelist); | 87 | |
88 | /* we loop through the pagelist before adding in order | ||
89 | to keep the pagelist sorted */ | ||
90 | list_for_each_entry(cur, &fbdefio->pagelist, lru) { | ||
91 | /* this check is to catch the case where a new | ||
92 | process could start writing to the same page | ||
93 | through a new pte. this new access can cause the | ||
94 | mkwrite even when the original ps's pte is marked | ||
95 | writable */ | ||
96 | if (unlikely(cur == page)) | ||
97 | goto page_already_added; | ||
98 | else if (cur->index > page->index) | ||
99 | break; | ||
100 | } | ||
101 | |||
102 | list_add_tail(&page->lru, &cur->lru); | ||
103 | |||
104 | page_already_added: | ||
87 | mutex_unlock(&fbdefio->lock); | 105 | mutex_unlock(&fbdefio->lock); |
88 | 106 | ||
89 | /* come back after delay to process the deferred IO */ | 107 | /* come back after delay to process the deferred IO */ |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 0a2785361ca3..09d7e22c6fef 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -286,7 +286,7 @@ static struct diu_pool pool; | |||
286 | * rheap and make the furture large allocation fail. | 286 | * rheap and make the furture large allocation fail. |
287 | */ | 287 | */ |
288 | 288 | ||
289 | void *fsl_diu_alloc(unsigned long size, phys_addr_t *phys) | 289 | static void *fsl_diu_alloc(unsigned long size, phys_addr_t *phys) |
290 | { | 290 | { |
291 | void *virt; | 291 | void *virt; |
292 | 292 | ||
@@ -311,12 +311,12 @@ void *fsl_diu_alloc(unsigned long size, phys_addr_t *phys) | |||
311 | memset(virt, 0, size); | 311 | memset(virt, 0, size); |
312 | } | 312 | } |
313 | 313 | ||
314 | pr_debug("rh virt=%p phys=%lx\n", virt, *phys); | 314 | pr_debug("rh virt=%p phys=%llx\n", virt, (unsigned long long)*phys); |
315 | 315 | ||
316 | return virt; | 316 | return virt; |
317 | } | 317 | } |
318 | 318 | ||
319 | void fsl_diu_free(void *p, unsigned long size) | 319 | static void fsl_diu_free(void *p, unsigned long size) |
320 | { | 320 | { |
321 | pr_debug("p=%p size=%lu\n", p, size); | 321 | pr_debug("p=%p size=%lu\n", p, size); |
322 | 322 | ||
@@ -770,7 +770,7 @@ static int map_video_memory(struct fb_info *info) | |||
770 | info->fix.smem_len = info->fix.line_length * info->var.yres_virtual; | 770 | info->fix.smem_len = info->fix.line_length * info->var.yres_virtual; |
771 | pr_debug("MAP_VIDEO_MEMORY: smem_len = %d\n", info->fix.smem_len); | 771 | pr_debug("MAP_VIDEO_MEMORY: smem_len = %d\n", info->fix.smem_len); |
772 | info->screen_base = fsl_diu_alloc(info->fix.smem_len, &phys); | 772 | info->screen_base = fsl_diu_alloc(info->fix.smem_len, &phys); |
773 | if (info->screen_base == 0) { | 773 | if (info->screen_base == NULL) { |
774 | printk(KERN_ERR "Unable to allocate fb memory\n"); | 774 | printk(KERN_ERR "Unable to allocate fb memory\n"); |
775 | return -ENOMEM; | 775 | return -ENOMEM; |
776 | } | 776 | } |
@@ -788,7 +788,7 @@ static int map_video_memory(struct fb_info *info) | |||
788 | static void unmap_video_memory(struct fb_info *info) | 788 | static void unmap_video_memory(struct fb_info *info) |
789 | { | 789 | { |
790 | fsl_diu_free(info->screen_base, info->fix.smem_len); | 790 | fsl_diu_free(info->screen_base, info->fix.smem_len); |
791 | info->screen_base = 0; | 791 | info->screen_base = NULL; |
792 | info->fix.smem_start = 0; | 792 | info->fix.smem_start = 0; |
793 | info->fix.smem_len = 0; | 793 | info->fix.smem_len = 0; |
794 | } | 794 | } |
@@ -1158,7 +1158,7 @@ static int init_fbinfo(struct fb_info *info) | |||
1158 | return 0; | 1158 | return 0; |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | static int install_fb(struct fb_info *info) | 1161 | static int __devinit install_fb(struct fb_info *info) |
1162 | { | 1162 | { |
1163 | int rc; | 1163 | int rc; |
1164 | struct mfb_info *mfbi = info->par; | 1164 | struct mfb_info *mfbi = info->par; |
@@ -1233,7 +1233,7 @@ static int install_fb(struct fb_info *info) | |||
1233 | return 0; | 1233 | return 0; |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | static void __exit uninstall_fb(struct fb_info *info) | 1236 | static void uninstall_fb(struct fb_info *info) |
1237 | { | 1237 | { |
1238 | struct mfb_info *mfbi = info->par; | 1238 | struct mfb_info *mfbi = info->par; |
1239 | 1239 | ||
@@ -1287,7 +1287,7 @@ static int request_irq_local(int irq) | |||
1287 | /* Read to clear the status */ | 1287 | /* Read to clear the status */ |
1288 | status = in_be32(&hw->int_status); | 1288 | status = in_be32(&hw->int_status); |
1289 | 1289 | ||
1290 | ret = request_irq(irq, fsl_diu_isr, 0, "diu", 0); | 1290 | ret = request_irq(irq, fsl_diu_isr, 0, "diu", NULL); |
1291 | if (ret) | 1291 | if (ret) |
1292 | pr_info("Request diu IRQ failed.\n"); | 1292 | pr_info("Request diu IRQ failed.\n"); |
1293 | else { | 1293 | else { |
@@ -1312,7 +1312,7 @@ static void free_irq_local(int irq) | |||
1312 | /* Disable all LCDC interrupt */ | 1312 | /* Disable all LCDC interrupt */ |
1313 | out_be32(&hw->int_mask, 0x1f); | 1313 | out_be32(&hw->int_mask, 0x1f); |
1314 | 1314 | ||
1315 | free_irq(irq, 0); | 1315 | free_irq(irq, NULL); |
1316 | } | 1316 | } |
1317 | 1317 | ||
1318 | #ifdef CONFIG_PM | 1318 | #ifdef CONFIG_PM |
@@ -1353,7 +1353,8 @@ static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align) | |||
1353 | dma_addr_t paddr = 0; | 1353 | dma_addr_t paddr = 0; |
1354 | 1354 | ||
1355 | ssize = size + bytes_align; | 1355 | ssize = size + bytes_align; |
1356 | buf->vaddr = dma_alloc_coherent(0, ssize, &paddr, GFP_DMA | __GFP_ZERO); | 1356 | buf->vaddr = dma_alloc_coherent(NULL, ssize, &paddr, GFP_DMA | |
1357 | __GFP_ZERO); | ||
1357 | if (!buf->vaddr) | 1358 | if (!buf->vaddr) |
1358 | return -ENOMEM; | 1359 | return -ENOMEM; |
1359 | 1360 | ||
@@ -1371,7 +1372,7 @@ static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align) | |||
1371 | 1372 | ||
1372 | static void free_buf(struct diu_addr *buf, u32 size, u32 bytes_align) | 1373 | static void free_buf(struct diu_addr *buf, u32 size, u32 bytes_align) |
1373 | { | 1374 | { |
1374 | dma_free_coherent(0, size + bytes_align, | 1375 | dma_free_coherent(NULL, size + bytes_align, |
1375 | buf->vaddr, (buf->paddr - buf->offset)); | 1376 | buf->vaddr, (buf->paddr - buf->offset)); |
1376 | return; | 1377 | return; |
1377 | } | 1378 | } |
@@ -1411,7 +1412,7 @@ static ssize_t show_monitor(struct device *device, | |||
1411 | return diu_ops.show_monitor_port(machine_data->monitor_port, buf); | 1412 | return diu_ops.show_monitor_port(machine_data->monitor_port, buf); |
1412 | } | 1413 | } |
1413 | 1414 | ||
1414 | static int fsl_diu_probe(struct of_device *ofdev, | 1415 | static int __devinit fsl_diu_probe(struct of_device *ofdev, |
1415 | const struct of_device_id *match) | 1416 | const struct of_device_id *match) |
1416 | { | 1417 | { |
1417 | struct device_node *np = ofdev->node; | 1418 | struct device_node *np = ofdev->node; |
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 30469bf906e5..d0674f1e3f10 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c | |||
@@ -1003,6 +1003,7 @@ static struct w100_pll_info xtal_14318000[] = { | |||
1003 | static struct w100_pll_info xtal_16000000[] = { | 1003 | static struct w100_pll_info xtal_16000000[] = { |
1004 | /*freq M N_int N_fac tfgoal lock_time */ | 1004 | /*freq M N_int N_fac tfgoal lock_time */ |
1005 | { 72, 1, 8, 0, 0xe0, 48}, /* tfgoal guessed */ | 1005 | { 72, 1, 8, 0, 0xe0, 48}, /* tfgoal guessed */ |
1006 | { 80, 1, 9, 0, 0xe0, 13}, /* tfgoal guessed */ | ||
1006 | { 95, 1, 10, 7, 0xe0, 38}, /* tfgoal guessed */ | 1007 | { 95, 1, 10, 7, 0xe0, 38}, /* tfgoal guessed */ |
1007 | { 96, 1, 11, 0, 0xe0, 36}, /* tfgoal guessed */ | 1008 | { 96, 1, 11, 0, 0xe0, 36}, /* tfgoal guessed */ |
1008 | { 0, 0, 0, 0, 0, 0}, | 1009 | { 0, 0, 0, 0, 0, 0}, |
diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index fd01d90cada5..57997fa14e69 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h | |||
@@ -51,4 +51,4 @@ int v9fs_dir_release(struct inode *inode, struct file *filp); | |||
51 | int v9fs_file_open(struct inode *inode, struct file *file); | 51 | int v9fs_file_open(struct inode *inode, struct file *file); |
52 | void v9fs_inode2stat(struct inode *inode, struct p9_stat *stat); | 52 | void v9fs_inode2stat(struct inode *inode, struct p9_stat *stat); |
53 | void v9fs_dentry_release(struct dentry *); | 53 | void v9fs_dentry_release(struct dentry *); |
54 | int v9fs_uflags2omode(int uflags); | 54 | int v9fs_uflags2omode(int uflags, int extended); |
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 0d55affe37d4..52944d2249a4 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -59,7 +59,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
59 | 59 | ||
60 | P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file); | 60 | P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p \n", inode, file); |
61 | v9ses = v9fs_inode2v9ses(inode); | 61 | v9ses = v9fs_inode2v9ses(inode); |
62 | omode = v9fs_uflags2omode(file->f_flags); | 62 | omode = v9fs_uflags2omode(file->f_flags, v9fs_extended(v9ses)); |
63 | fid = file->private_data; | 63 | fid = file->private_data; |
64 | if (!fid) { | 64 | if (!fid) { |
65 | fid = v9fs_fid_clone(file->f_path.dentry); | 65 | fid = v9fs_fid_clone(file->f_path.dentry); |
@@ -75,6 +75,8 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
75 | inode->i_size = 0; | 75 | inode->i_size = 0; |
76 | inode->i_blocks = 0; | 76 | inode->i_blocks = 0; |
77 | } | 77 | } |
78 | if ((file->f_flags & O_APPEND) && (!v9fs_extended(v9ses))) | ||
79 | generic_file_llseek(file, 0, SEEK_END); | ||
78 | } | 80 | } |
79 | 81 | ||
80 | file->private_data = fid; | 82 | file->private_data = fid; |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 40fa807bd929..c95295c65045 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -132,10 +132,10 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, int mode) | |||
132 | /** | 132 | /** |
133 | * v9fs_uflags2omode- convert posix open flags to plan 9 mode bits | 133 | * v9fs_uflags2omode- convert posix open flags to plan 9 mode bits |
134 | * @uflags: flags to convert | 134 | * @uflags: flags to convert |
135 | * | 135 | * @extended: if .u extensions are active |
136 | */ | 136 | */ |
137 | 137 | ||
138 | int v9fs_uflags2omode(int uflags) | 138 | int v9fs_uflags2omode(int uflags, int extended) |
139 | { | 139 | { |
140 | int ret; | 140 | int ret; |
141 | 141 | ||
@@ -155,14 +155,16 @@ int v9fs_uflags2omode(int uflags) | |||
155 | break; | 155 | break; |
156 | } | 156 | } |
157 | 157 | ||
158 | if (uflags & O_EXCL) | ||
159 | ret |= P9_OEXCL; | ||
160 | |||
161 | if (uflags & O_TRUNC) | 158 | if (uflags & O_TRUNC) |
162 | ret |= P9_OTRUNC; | 159 | ret |= P9_OTRUNC; |
163 | 160 | ||
164 | if (uflags & O_APPEND) | 161 | if (extended) { |
165 | ret |= P9_OAPPEND; | 162 | if (uflags & O_EXCL) |
163 | ret |= P9_OEXCL; | ||
164 | |||
165 | if (uflags & O_APPEND) | ||
166 | ret |= P9_OAPPEND; | ||
167 | } | ||
166 | 168 | ||
167 | return ret; | 169 | return ret; |
168 | } | 170 | } |
@@ -506,7 +508,7 @@ v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
506 | flags = O_RDWR; | 508 | flags = O_RDWR; |
507 | 509 | ||
508 | fid = v9fs_create(v9ses, dir, dentry, NULL, perm, | 510 | fid = v9fs_create(v9ses, dir, dentry, NULL, perm, |
509 | v9fs_uflags2omode(flags)); | 511 | v9fs_uflags2omode(flags, v9fs_extended(v9ses))); |
510 | if (IS_ERR(fid)) { | 512 | if (IS_ERR(fid)) { |
511 | err = PTR_ERR(fid); | 513 | err = PTR_ERR(fid); |
512 | fid = NULL; | 514 | fid = NULL; |
diff --git a/fs/Kconfig b/fs/Kconfig index cf12c403b8c7..2694648cbd1b 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -830,7 +830,7 @@ config NTFS_FS | |||
830 | from the project web site. | 830 | from the project web site. |
831 | 831 | ||
832 | For more information see <file:Documentation/filesystems/ntfs.txt> | 832 | For more information see <file:Documentation/filesystems/ntfs.txt> |
833 | and <http://linux-ntfs.sourceforge.net/>. | 833 | and <http://www.linux-ntfs.org/>. |
834 | 834 | ||
835 | To compile this file system support as a module, choose M here: the | 835 | To compile this file system support as a module, choose M here: the |
836 | module will be called ntfs. | 836 | module will be called ntfs. |
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 34902cff5400..0e9fc2ba90ee 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -34,11 +34,11 @@ | |||
34 | static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { | 34 | static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { |
35 | {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"}, | 35 | {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"}, |
36 | {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"}, | 36 | {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"}, |
37 | {{1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(11), 0, 0, 0, 0} }, "net-users"}, | 37 | {{1, 1, {0, 0, 0, 0, 0, 5}, {__constant_cpu_to_le32(11), 0, 0, 0, 0} }, "net-users"}, |
38 | {{1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(18), 0, 0, 0, 0} }, "sys"}, | 38 | {{1, 1, {0, 0, 0, 0, 0, 5}, {__constant_cpu_to_le32(18), 0, 0, 0, 0} }, "sys"}, |
39 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(544), 0, 0, 0} }, "root"}, | 39 | {{1, 2, {0, 0, 0, 0, 0, 5}, {__constant_cpu_to_le32(32), __constant_cpu_to_le32(544), 0, 0, 0} }, "root"}, |
40 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(545), 0, 0, 0} }, "users"}, | 40 | {{1, 2, {0, 0, 0, 0, 0, 5}, {__constant_cpu_to_le32(32), __constant_cpu_to_le32(545), 0, 0, 0} }, "users"}, |
41 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(546), 0, 0, 0} }, "guest"} } | 41 | {{1, 2, {0, 0, 0, 0, 0, 5}, {__constant_cpu_to_le32(32), __constant_cpu_to_le32(546), 0, 0, 0} }, "guest"} } |
42 | ; | 42 | ; |
43 | 43 | ||
44 | 44 | ||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 722be543ceec..2e904bd111c8 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -219,15 +219,15 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
219 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &find_data, | 219 | rc = CIFSSMBUnixQPathInfo(xid, pTcon, full_path, &find_data, |
220 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 220 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
221 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 221 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
222 | if (rc) { | 222 | if (rc == -EREMOTE && !is_dfs_referral) { |
223 | if (rc == -EREMOTE && !is_dfs_referral) { | 223 | is_dfs_referral = true; |
224 | is_dfs_referral = true; | 224 | cFYI(DBG2, ("DFS ref")); |
225 | cFYI(DBG2, ("DFS ref")); | 225 | /* for DFS, server does not give us real inode data */ |
226 | /* for DFS, server does not give us real inode data */ | 226 | fill_fake_finddataunix(&find_data, sb); |
227 | fill_fake_finddataunix(&find_data, sb); | 227 | rc = 0; |
228 | rc = 0; | 228 | } else if (rc) |
229 | } | 229 | goto cgiiu_exit; |
230 | } | 230 | |
231 | num_of_bytes = le64_to_cpu(find_data.NumOfBytes); | 231 | num_of_bytes = le64_to_cpu(find_data.NumOfBytes); |
232 | end_of_file = le64_to_cpu(find_data.EndOfFile); | 232 | end_of_file = le64_to_cpu(find_data.EndOfFile); |
233 | 233 | ||
@@ -236,7 +236,7 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
236 | *pinode = new_inode(sb); | 236 | *pinode = new_inode(sb); |
237 | if (*pinode == NULL) { | 237 | if (*pinode == NULL) { |
238 | rc = -ENOMEM; | 238 | rc = -ENOMEM; |
239 | goto cgiiu_exit; | 239 | goto cgiiu_exit; |
240 | } | 240 | } |
241 | /* Is an i_ino of zero legal? */ | 241 | /* Is an i_ino of zero legal? */ |
242 | /* note ino incremented to unique num in new_inode */ | 242 | /* note ino incremented to unique num in new_inode */ |
diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c index 50c994a249a5..09a4522f65e6 100644 --- a/fs/ecryptfs/miscdev.c +++ b/fs/ecryptfs/miscdev.c | |||
@@ -575,13 +575,11 @@ int ecryptfs_init_ecryptfs_miscdev(void) | |||
575 | int rc; | 575 | int rc; |
576 | 576 | ||
577 | atomic_set(&ecryptfs_num_miscdev_opens, 0); | 577 | atomic_set(&ecryptfs_num_miscdev_opens, 0); |
578 | mutex_lock(&ecryptfs_daemon_hash_mux); | ||
579 | rc = misc_register(&ecryptfs_miscdev); | 578 | rc = misc_register(&ecryptfs_miscdev); |
580 | if (rc) | 579 | if (rc) |
581 | printk(KERN_ERR "%s: Failed to register miscellaneous device " | 580 | printk(KERN_ERR "%s: Failed to register miscellaneous device " |
582 | "for communications with userspace daemons; rc = [%d]\n", | 581 | "for communications with userspace daemons; rc = [%d]\n", |
583 | __func__, rc); | 582 | __func__, rc); |
584 | mutex_unlock(&ecryptfs_daemon_hash_mux); | ||
585 | return rc; | 583 | return rc; |
586 | } | 584 | } |
587 | 585 | ||
@@ -610,7 +610,7 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
610 | bprm->exec -= stack_shift; | 610 | bprm->exec -= stack_shift; |
611 | 611 | ||
612 | down_write(&mm->mmap_sem); | 612 | down_write(&mm->mmap_sem); |
613 | vm_flags = vma->vm_flags; | 613 | vm_flags = VM_STACK_FLAGS; |
614 | 614 | ||
615 | /* | 615 | /* |
616 | * Adjust stack execute permissions; explicitly enable for | 616 | * Adjust stack execute permissions; explicitly enable for |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index fe3119a71ada..2845425077e8 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -2875,8 +2875,10 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type, | |||
2875 | blk++; | 2875 | blk++; |
2876 | } | 2876 | } |
2877 | out: | 2877 | out: |
2878 | if (len == towrite) | 2878 | if (len == towrite) { |
2879 | mutex_unlock(&inode->i_mutex); | ||
2879 | return err; | 2880 | return err; |
2881 | } | ||
2880 | if (inode->i_size < off+len-towrite) { | 2882 | if (inode->i_size < off+len-towrite) { |
2881 | i_size_write(inode, off+len-towrite); | 2883 | i_size_write(inode, off+len-towrite); |
2882 | EXT3_I(inode)->i_disksize = inode->i_size; | 2884 | EXT3_I(inode)->i_disksize = inode->i_size; |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cb96f127c366..02bf24343979 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3337,8 +3337,10 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
3337 | blk++; | 3337 | blk++; |
3338 | } | 3338 | } |
3339 | out: | 3339 | out: |
3340 | if (len == towrite) | 3340 | if (len == towrite) { |
3341 | mutex_unlock(&inode->i_mutex); | ||
3341 | return err; | 3342 | return err; |
3343 | } | ||
3342 | if (inode->i_size < off+len-towrite) { | 3344 | if (inode->i_size < off+len-towrite) { |
3343 | i_size_write(inode, off+len-towrite); | 3345 | i_size_write(inode, off+len-towrite); |
3344 | EXT4_I(inode)->i_disksize = inode->i_size; | 3346 | EXT4_I(inode)->i_disksize = inode->i_size; |
diff --git a/fs/libfs.c b/fs/libfs.c index 892d41cb3382..baeb71ee1cde 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -512,6 +512,20 @@ void simple_release_fs(struct vfsmount **mount, int *count) | |||
512 | mntput(mnt); | 512 | mntput(mnt); |
513 | } | 513 | } |
514 | 514 | ||
515 | /** | ||
516 | * simple_read_from_buffer - copy data from the buffer to user space | ||
517 | * @to: the user space buffer to read to | ||
518 | * @count: the maximum number of bytes to read | ||
519 | * @ppos: the current position in the buffer | ||
520 | * @from: the buffer to read from | ||
521 | * @available: the size of the buffer | ||
522 | * | ||
523 | * The simple_read_from_buffer() function reads up to @count bytes from the | ||
524 | * buffer @from at offset @ppos into the user space address starting at @to. | ||
525 | * | ||
526 | * On success, the number of bytes read is returned and the offset @ppos is | ||
527 | * advanced by this number, or negative value is returned on error. | ||
528 | **/ | ||
515 | ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos, | 529 | ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos, |
516 | const void *from, size_t available) | 530 | const void *from, size_t available) |
517 | { | 531 | { |
@@ -528,6 +542,20 @@ ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos, | |||
528 | return count; | 542 | return count; |
529 | } | 543 | } |
530 | 544 | ||
545 | /** | ||
546 | * memory_read_from_buffer - copy data from the buffer | ||
547 | * @to: the kernel space buffer to read to | ||
548 | * @count: the maximum number of bytes to read | ||
549 | * @ppos: the current position in the buffer | ||
550 | * @from: the buffer to read from | ||
551 | * @available: the size of the buffer | ||
552 | * | ||
553 | * The memory_read_from_buffer() function reads up to @count bytes from the | ||
554 | * buffer @from at offset @ppos into the kernel space address starting at @to. | ||
555 | * | ||
556 | * On success, the number of bytes read is returned and the offset @ppos is | ||
557 | * advanced by this number, or negative value is returned on error. | ||
558 | **/ | ||
531 | ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 559 | ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, |
532 | const void *from, size_t available) | 560 | const void *from, size_t available) |
533 | { | 561 | { |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 58d43daec084..982a2064fe4c 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -204,7 +204,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
204 | * Note: assumes we have exclusive access to this mapping either | 204 | * Note: assumes we have exclusive access to this mapping either |
205 | * through inode->i_mutex or some other mechanism. | 205 | * through inode->i_mutex or some other mechanism. |
206 | */ | 206 | */ |
207 | if (page->index == 0 && invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1) < 0) { | 207 | if (invalidate_inode_pages2_range(inode->i_mapping, page->index + 1, -1) < 0) { |
208 | /* Should never happen */ | 208 | /* Should never happen */ |
209 | nfs_zap_mapping(inode, inode->i_mapping); | 209 | nfs_zap_mapping(inode, inode->i_mapping); |
210 | } | 210 | } |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index efc015c6128a..44f87caf3683 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -606,7 +606,9 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm, | |||
606 | 606 | ||
607 | res->last_used = 0; | 607 | res->last_used = 0; |
608 | 608 | ||
609 | spin_lock(&dlm->spinlock); | ||
609 | list_add_tail(&res->tracking, &dlm->tracking_list); | 610 | list_add_tail(&res->tracking, &dlm->tracking_list); |
611 | spin_unlock(&dlm->spinlock); | ||
610 | 612 | ||
611 | memset(res->lvb, 0, DLM_LVB_LEN); | 613 | memset(res->lvb, 0, DLM_LVB_LEN); |
612 | memset(res->refmap, 0, sizeof(res->refmap)); | 614 | memset(res->refmap, 0, sizeof(res->refmap)); |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 394d25a131a5..80e20d9f2780 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -1554,8 +1554,8 @@ out: | |||
1554 | */ | 1554 | */ |
1555 | int ocfs2_file_lock(struct file *file, int ex, int trylock) | 1555 | int ocfs2_file_lock(struct file *file, int ex, int trylock) |
1556 | { | 1556 | { |
1557 | int ret, level = ex ? LKM_EXMODE : LKM_PRMODE; | 1557 | int ret, level = ex ? DLM_LOCK_EX : DLM_LOCK_PR; |
1558 | unsigned int lkm_flags = trylock ? LKM_NOQUEUE : 0; | 1558 | unsigned int lkm_flags = trylock ? DLM_LKF_NOQUEUE : 0; |
1559 | unsigned long flags; | 1559 | unsigned long flags; |
1560 | struct ocfs2_file_private *fp = file->private_data; | 1560 | struct ocfs2_file_private *fp = file->private_data; |
1561 | struct ocfs2_lock_res *lockres = &fp->fp_flock; | 1561 | struct ocfs2_lock_res *lockres = &fp->fp_flock; |
@@ -1582,7 +1582,7 @@ int ocfs2_file_lock(struct file *file, int ex, int trylock) | |||
1582 | * Get the lock at NLMODE to start - that way we | 1582 | * Get the lock at NLMODE to start - that way we |
1583 | * can cancel the upconvert request if need be. | 1583 | * can cancel the upconvert request if need be. |
1584 | */ | 1584 | */ |
1585 | ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0); | 1585 | ret = ocfs2_lock_create(osb, lockres, DLM_LOCK_NL, 0); |
1586 | if (ret < 0) { | 1586 | if (ret < 0) { |
1587 | mlog_errno(ret); | 1587 | mlog_errno(ret); |
1588 | goto out; | 1588 | goto out; |
@@ -1597,7 +1597,7 @@ int ocfs2_file_lock(struct file *file, int ex, int trylock) | |||
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | lockres->l_action = OCFS2_AST_CONVERT; | 1599 | lockres->l_action = OCFS2_AST_CONVERT; |
1600 | lkm_flags |= LKM_CONVERT; | 1600 | lkm_flags |= DLM_LKF_CONVERT; |
1601 | lockres->l_requested = level; | 1601 | lockres->l_requested = level; |
1602 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); | 1602 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); |
1603 | 1603 | ||
@@ -1664,7 +1664,7 @@ void ocfs2_file_unlock(struct file *file) | |||
1664 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) | 1664 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) |
1665 | return; | 1665 | return; |
1666 | 1666 | ||
1667 | if (lockres->l_level == LKM_NLMODE) | 1667 | if (lockres->l_level == DLM_LOCK_NL) |
1668 | return; | 1668 | return; |
1669 | 1669 | ||
1670 | mlog(0, "Unlock: \"%s\" flags: 0x%lx, level: %d, act: %d\n", | 1670 | mlog(0, "Unlock: \"%s\" flags: 0x%lx, level: %d, act: %d\n", |
@@ -1678,11 +1678,11 @@ void ocfs2_file_unlock(struct file *file) | |||
1678 | lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED); | 1678 | lockres_or_flags(lockres, OCFS2_LOCK_BLOCKED); |
1679 | lockres->l_blocking = DLM_LOCK_EX; | 1679 | lockres->l_blocking = DLM_LOCK_EX; |
1680 | 1680 | ||
1681 | gen = ocfs2_prepare_downconvert(lockres, LKM_NLMODE); | 1681 | gen = ocfs2_prepare_downconvert(lockres, DLM_LOCK_NL); |
1682 | lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); | 1682 | lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); |
1683 | spin_unlock_irqrestore(&lockres->l_lock, flags); | 1683 | spin_unlock_irqrestore(&lockres->l_lock, flags); |
1684 | 1684 | ||
1685 | ret = ocfs2_downconvert_lock(osb, lockres, LKM_NLMODE, 0, gen); | 1685 | ret = ocfs2_downconvert_lock(osb, lockres, DLM_LOCK_NL, 0, gen); |
1686 | if (ret) { | 1686 | if (ret) { |
1687 | mlog_errno(ret); | 1687 | mlog_errno(ret); |
1688 | return; | 1688 | return; |
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/namei.h> | 16 | #include <linux/namei.h> |
17 | #include <linux/backing-dev.h> | 17 | #include <linux/backing-dev.h> |
18 | #include <linux/capability.h> | 18 | #include <linux/capability.h> |
19 | #include <linux/securebits.h> | ||
19 | #include <linux/security.h> | 20 | #include <linux/security.h> |
20 | #include <linux/mount.h> | 21 | #include <linux/mount.h> |
21 | #include <linux/vfs.h> | 22 | #include <linux/vfs.h> |
@@ -425,7 +426,7 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) | |||
425 | { | 426 | { |
426 | struct nameidata nd; | 427 | struct nameidata nd; |
427 | int old_fsuid, old_fsgid; | 428 | int old_fsuid, old_fsgid; |
428 | kernel_cap_t old_cap; | 429 | kernel_cap_t uninitialized_var(old_cap); /* !SECURE_NO_SETUID_FIXUP */ |
429 | int res; | 430 | int res; |
430 | 431 | ||
431 | if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ | 432 | if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ |
@@ -433,23 +434,27 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode) | |||
433 | 434 | ||
434 | old_fsuid = current->fsuid; | 435 | old_fsuid = current->fsuid; |
435 | old_fsgid = current->fsgid; | 436 | old_fsgid = current->fsgid; |
436 | old_cap = current->cap_effective; | ||
437 | 437 | ||
438 | current->fsuid = current->uid; | 438 | current->fsuid = current->uid; |
439 | current->fsgid = current->gid; | 439 | current->fsgid = current->gid; |
440 | 440 | ||
441 | /* | 441 | if (!issecure(SECURE_NO_SETUID_FIXUP)) { |
442 | * Clear the capabilities if we switch to a non-root user | 442 | /* |
443 | * | 443 | * Clear the capabilities if we switch to a non-root user |
444 | * FIXME: There is a race here against sys_capset. The | 444 | */ |
445 | * capabilities can change yet we will restore the old | 445 | #ifndef CONFIG_SECURITY_FILE_CAPABILITIES |
446 | * value below. We should hold task_capabilities_lock, | 446 | /* |
447 | * but we cannot because user_path_walk can sleep. | 447 | * FIXME: There is a race here against sys_capset. The |
448 | */ | 448 | * capabilities can change yet we will restore the old |
449 | if (current->uid) | 449 | * value below. We should hold task_capabilities_lock, |
450 | cap_clear(current->cap_effective); | 450 | * but we cannot because user_path_walk can sleep. |
451 | else | 451 | */ |
452 | current->cap_effective = current->cap_permitted; | 452 | #endif /* ndef CONFIG_SECURITY_FILE_CAPABILITIES */ |
453 | if (current->uid) | ||
454 | old_cap = cap_set_effective(__cap_empty_set); | ||
455 | else | ||
456 | old_cap = cap_set_effective(current->cap_permitted); | ||
457 | } | ||
453 | 458 | ||
454 | res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd); | 459 | res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd); |
455 | if (res) | 460 | if (res) |
@@ -478,7 +483,9 @@ out_path_release: | |||
478 | out: | 483 | out: |
479 | current->fsuid = old_fsuid; | 484 | current->fsuid = old_fsuid; |
480 | current->fsgid = old_fsgid; | 485 | current->fsgid = old_fsgid; |
481 | current->cap_effective = old_cap; | 486 | |
487 | if (!issecure(SECURE_NO_SETUID_FIXUP)) | ||
488 | cap_set_effective(old_cap); | ||
482 | 489 | ||
483 | return res; | 490 | return res; |
484 | } | 491 | } |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index ab8ccc9d14ff..c492449f3b45 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -476,10 +476,10 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, | |||
476 | return -ESRCH; | 476 | return -ESRCH; |
477 | mm = get_task_mm(task); | 477 | mm = get_task_mm(task); |
478 | if (mm) { | 478 | if (mm) { |
479 | static struct mm_walk clear_refs_walk; | 479 | struct mm_walk clear_refs_walk = { |
480 | memset(&clear_refs_walk, 0, sizeof(clear_refs_walk)); | 480 | .pmd_entry = clear_refs_pte_range, |
481 | clear_refs_walk.pmd_entry = clear_refs_pte_range; | 481 | .mm = mm, |
482 | clear_refs_walk.mm = mm; | 482 | }; |
483 | down_read(&mm->mmap_sem); | 483 | down_read(&mm->mmap_sem); |
484 | for (vma = mm->mmap; vma; vma = vma->vm_next) { | 484 | for (vma = mm->mmap; vma; vma = vma->vm_next) { |
485 | clear_refs_walk.private = vma; | 485 | clear_refs_walk.private = vma; |
@@ -602,11 +602,6 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, | |||
602 | return err; | 602 | return err; |
603 | } | 603 | } |
604 | 604 | ||
605 | static struct mm_walk pagemap_walk = { | ||
606 | .pmd_entry = pagemap_pte_range, | ||
607 | .pte_hole = pagemap_pte_hole | ||
608 | }; | ||
609 | |||
610 | /* | 605 | /* |
611 | * /proc/pid/pagemap - an array mapping virtual pages to pfns | 606 | * /proc/pid/pagemap - an array mapping virtual pages to pfns |
612 | * | 607 | * |
@@ -641,6 +636,11 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
641 | struct pagemapread pm; | 636 | struct pagemapread pm; |
642 | int pagecount; | 637 | int pagecount; |
643 | int ret = -ESRCH; | 638 | int ret = -ESRCH; |
639 | struct mm_walk pagemap_walk; | ||
640 | unsigned long src; | ||
641 | unsigned long svpfn; | ||
642 | unsigned long start_vaddr; | ||
643 | unsigned long end_vaddr; | ||
644 | 644 | ||
645 | if (!task) | 645 | if (!task) |
646 | goto out; | 646 | goto out; |
@@ -659,11 +659,15 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
659 | if (!mm) | 659 | if (!mm) |
660 | goto out_task; | 660 | goto out_task; |
661 | 661 | ||
662 | ret = -ENOMEM; | 662 | |
663 | uaddr = (unsigned long)buf & PAGE_MASK; | 663 | uaddr = (unsigned long)buf & PAGE_MASK; |
664 | uend = (unsigned long)(buf + count); | 664 | uend = (unsigned long)(buf + count); |
665 | pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE; | 665 | pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE; |
666 | pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL); | 666 | ret = 0; |
667 | if (pagecount == 0) | ||
668 | goto out_mm; | ||
669 | pages = kcalloc(pagecount, sizeof(struct page *), GFP_KERNEL); | ||
670 | ret = -ENOMEM; | ||
667 | if (!pages) | 671 | if (!pages) |
668 | goto out_mm; | 672 | goto out_mm; |
669 | 673 | ||
@@ -684,33 +688,33 @@ static ssize_t pagemap_read(struct file *file, char __user *buf, | |||
684 | pm.out = (u64 *)buf; | 688 | pm.out = (u64 *)buf; |
685 | pm.end = (u64 *)(buf + count); | 689 | pm.end = (u64 *)(buf + count); |
686 | 690 | ||
687 | if (!ptrace_may_attach(task)) { | 691 | pagemap_walk.pmd_entry = pagemap_pte_range; |
688 | ret = -EIO; | 692 | pagemap_walk.pte_hole = pagemap_pte_hole; |
689 | } else { | 693 | pagemap_walk.mm = mm; |
690 | unsigned long src = *ppos; | 694 | pagemap_walk.private = ± |
691 | unsigned long svpfn = src / PM_ENTRY_BYTES; | 695 | |
692 | unsigned long start_vaddr = svpfn << PAGE_SHIFT; | 696 | src = *ppos; |
693 | unsigned long end_vaddr = TASK_SIZE_OF(task); | 697 | svpfn = src / PM_ENTRY_BYTES; |
694 | 698 | start_vaddr = svpfn << PAGE_SHIFT; | |
695 | /* watch out for wraparound */ | 699 | end_vaddr = TASK_SIZE_OF(task); |
696 | if (svpfn > TASK_SIZE_OF(task) >> PAGE_SHIFT) | 700 | |
697 | start_vaddr = end_vaddr; | 701 | /* watch out for wraparound */ |
698 | 702 | if (svpfn > TASK_SIZE_OF(task) >> PAGE_SHIFT) | |
699 | /* | 703 | start_vaddr = end_vaddr; |
700 | * The odds are that this will stop walking way | 704 | |
701 | * before end_vaddr, because the length of the | 705 | /* |
702 | * user buffer is tracked in "pm", and the walk | 706 | * The odds are that this will stop walking way |
703 | * will stop when we hit the end of the buffer. | 707 | * before end_vaddr, because the length of the |
704 | */ | 708 | * user buffer is tracked in "pm", and the walk |
705 | ret = walk_page_range(start_vaddr, end_vaddr, | 709 | * will stop when we hit the end of the buffer. |
706 | &pagemap_walk); | 710 | */ |
707 | if (ret == PM_END_OF_BUFFER) | 711 | ret = walk_page_range(start_vaddr, end_vaddr, &pagemap_walk); |
708 | ret = 0; | 712 | if (ret == PM_END_OF_BUFFER) |
709 | /* don't need mmap_sem for these, but this looks cleaner */ | 713 | ret = 0; |
710 | *ppos += (char *)pm.out - buf; | 714 | /* don't need mmap_sem for these, but this looks cleaner */ |
711 | if (!ret) | 715 | *ppos += (char *)pm.out - buf; |
712 | ret = (char *)pm.out - buf; | 716 | if (!ret) |
713 | } | 717 | ret = (char *)pm.out - buf; |
714 | 718 | ||
715 | out_pages: | 719 | out_pages: |
716 | for (; pagecount; pagecount--) { | 720 | for (; pagecount; pagecount--) { |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 57917932212e..192269698a8a 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -45,6 +45,8 @@ void reiserfs_delete_inode(struct inode *inode) | |||
45 | goto out; | 45 | goto out; |
46 | reiserfs_update_inode_transaction(inode); | 46 | reiserfs_update_inode_transaction(inode); |
47 | 47 | ||
48 | reiserfs_discard_prealloc(&th, inode); | ||
49 | |||
48 | err = reiserfs_delete_object(&th, inode); | 50 | err = reiserfs_delete_object(&th, inode); |
49 | 51 | ||
50 | /* Do quota update inside a transaction for journaled quotas. We must do that | 52 | /* Do quota update inside a transaction for journaled quotas. We must do that |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index ed424d708e69..1d40f2bd1970 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -2165,8 +2165,10 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, | |||
2165 | blk++; | 2165 | blk++; |
2166 | } | 2166 | } |
2167 | out: | 2167 | out: |
2168 | if (len == towrite) | 2168 | if (len == towrite) { |
2169 | mutex_unlock(&inode->i_mutex); | ||
2169 | return err; | 2170 | return err; |
2171 | } | ||
2170 | if (inode->i_size < off + len - towrite) | 2172 | if (inode->i_size < off + len - towrite) |
2171 | i_size_write(inode, off + len - towrite); | 2173 | i_size_write(inode, off + len - towrite); |
2172 | inode->i_version++; | 2174 | inode->i_version++; |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index afaee301b0ee..ad3d26ddfe31 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -2427,13 +2427,20 @@ restart: | |||
2427 | if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { | 2427 | if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { |
2428 | xlog_state_switch_iclogs(log, iclog, iclog->ic_size); | 2428 | xlog_state_switch_iclogs(log, iclog, iclog->ic_size); |
2429 | 2429 | ||
2430 | /* If I'm the only one writing to this iclog, sync it to disk */ | 2430 | /* |
2431 | if (atomic_read(&iclog->ic_refcnt) == 1) { | 2431 | * If I'm the only one writing to this iclog, sync it to disk. |
2432 | * We need to do an atomic compare and decrement here to avoid | ||
2433 | * racing with concurrent atomic_dec_and_lock() calls in | ||
2434 | * xlog_state_release_iclog() when there is more than one | ||
2435 | * reference to the iclog. | ||
2436 | */ | ||
2437 | if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { | ||
2438 | /* we are the only one */ | ||
2432 | spin_unlock(&log->l_icloglock); | 2439 | spin_unlock(&log->l_icloglock); |
2433 | if ((error = xlog_state_release_iclog(log, iclog))) | 2440 | error = xlog_state_release_iclog(log, iclog); |
2441 | if (error) | ||
2434 | return error; | 2442 | return error; |
2435 | } else { | 2443 | } else { |
2436 | atomic_dec(&iclog->ic_refcnt); | ||
2437 | spin_unlock(&log->l_icloglock); | 2444 | spin_unlock(&log->l_icloglock); |
2438 | } | 2445 | } |
2439 | goto restart; | 2446 | goto restart; |
diff --git a/include/asm-avr32/setup.h b/include/asm-avr32/setup.h index ea3070ff13a5..ff5b7cf6be4d 100644 --- a/include/asm-avr32/setup.h +++ b/include/asm-avr32/setup.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Copyright (C) 2004-2006 Atmel Corporation | 2 | * Copyright (C) 2004-2006 Atmel Corporation |
3 | * | 3 | * |
4 | * Based on linux/include/asm-arm/setup.h | 4 | * Based on linux/include/asm-arm/setup.h |
5 | * Copyright (C) 1997-1999 Russel King | 5 | * Copyright (C) 1997-1999 Russell King |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index d3a12a9079f7..7742ec000cc4 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -87,7 +87,7 @@ do { \ | |||
87 | } while(0) | 87 | } while(0) |
88 | 88 | ||
89 | #define irqs_disabled() \ | 89 | #define irqs_disabled() \ |
90 | ({unsigned long flags; local_save_flags(flags); flags; }) | 90 | ({unsigned long flags; local_save_flags(flags); !!flags; }) |
91 | 91 | ||
92 | #define local_irq_save(flags) \ | 92 | #define local_irq_save(flags) \ |
93 | do { \ | 93 | do { \ |
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 85fd0aa27a8c..4ec0a296bdec 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_GENERIC_ATOMIC_H | 2 | #define _ASM_GENERIC_ATOMIC_H |
3 | /* | 3 | /* |
4 | * Copyright (C) 2005 Silicon Graphics, Inc. | 4 | * Copyright (C) 2005 Silicon Graphics, Inc. |
5 | * Christoph Lameter <clameter@sgi.com> | 5 | * Christoph Lameter |
6 | * | 6 | * |
7 | * Allows to provide arch independent atomic definitions without the need to | 7 | * Allows to provide arch independent atomic definitions without the need to |
8 | * edit all arch specific atomic.h files. | 8 | * edit all arch specific atomic.h files. |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index a798d6299a79..1232be3885b0 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -283,10 +283,10 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
283 | " beqz %0, 2f \n" | 283 | " beqz %0, 2f \n" |
284 | " subu %0, %1, %3 \n" | 284 | " subu %0, %1, %3 \n" |
285 | " .set reorder \n" | 285 | " .set reorder \n" |
286 | "1: \n" | ||
287 | " .subsection 2 \n" | 286 | " .subsection 2 \n" |
288 | "2: b 1b \n" | 287 | "2: b 1b \n" |
289 | " .previous \n" | 288 | " .previous \n" |
289 | "1: \n" | ||
290 | " .set mips0 \n" | 290 | " .set mips0 \n" |
291 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 291 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
292 | : "Ir" (i), "m" (v->counter) | 292 | : "Ir" (i), "m" (v->counter) |
@@ -664,10 +664,10 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
664 | " beqz %0, 2f \n" | 664 | " beqz %0, 2f \n" |
665 | " dsubu %0, %1, %3 \n" | 665 | " dsubu %0, %1, %3 \n" |
666 | " .set reorder \n" | 666 | " .set reorder \n" |
667 | "1: \n" | ||
668 | " .subsection 2 \n" | 667 | " .subsection 2 \n" |
669 | "2: b 1b \n" | 668 | "2: b 1b \n" |
670 | " .previous \n" | 669 | " .previous \n" |
670 | "1: \n" | ||
671 | " .set mips0 \n" | 671 | " .set mips0 \n" |
672 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 672 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
673 | : "Ir" (i), "m" (v->counter) | 673 | : "Ir" (i), "m" (v->counter) |
diff --git a/include/asm-powerpc/hugetlb.h b/include/asm-powerpc/hugetlb.h index 649c6c3b87b3..be32ff02f4a0 100644 --- a/include/asm-powerpc/hugetlb.h +++ b/include/asm-powerpc/hugetlb.h | |||
@@ -49,12 +49,6 @@ static inline pte_t huge_pte_wrprotect(pte_t pte) | |||
49 | return pte_wrprotect(pte); | 49 | return pte_wrprotect(pte); |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
53 | unsigned long addr, pte_t *ptep) | ||
54 | { | ||
55 | ptep_set_wrprotect(mm, addr, ptep); | ||
56 | } | ||
57 | |||
58 | static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, | 52 | static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, |
59 | unsigned long addr, pte_t *ptep, | 53 | unsigned long addr, pte_t *ptep, |
60 | pte_t pte, int dirty) | 54 | pte_t pte, int dirty) |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index cc6a43ba41d0..7686569a0bef 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -314,6 +314,16 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
314 | old = pte_update(mm, addr, ptep, _PAGE_RW, 0); | 314 | old = pte_update(mm, addr, ptep, _PAGE_RW, 0); |
315 | } | 315 | } |
316 | 316 | ||
317 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
318 | unsigned long addr, pte_t *ptep) | ||
319 | { | ||
320 | unsigned long old; | ||
321 | |||
322 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | ||
323 | return; | ||
324 | old = pte_update(mm, addr, ptep, _PAGE_RW, 1); | ||
325 | } | ||
326 | |||
317 | /* | 327 | /* |
318 | * We currently remove entries from the hashtable regardless of whether | 328 | * We currently remove entries from the hashtable regardless of whether |
319 | * the entry was young or dirty. The generic routines only flush if the | 329 | * the entry was young or dirty. The generic routines only flush if the |
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index c7f4f8e3e297..bd0ea191dfa9 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h | |||
@@ -223,6 +223,9 @@ extern char empty_zero_page[PAGE_SIZE]; | |||
223 | #define _PAGE_SPECIAL 0x004 /* SW associated with special page */ | 223 | #define _PAGE_SPECIAL 0x004 /* SW associated with special page */ |
224 | #define __HAVE_ARCH_PTE_SPECIAL | 224 | #define __HAVE_ARCH_PTE_SPECIAL |
225 | 225 | ||
226 | /* Set of bits not changed in pte_modify */ | ||
227 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_SPECIAL) | ||
228 | |||
226 | /* Six different types of pages. */ | 229 | /* Six different types of pages. */ |
227 | #define _PAGE_TYPE_EMPTY 0x400 | 230 | #define _PAGE_TYPE_EMPTY 0x400 |
228 | #define _PAGE_TYPE_NONE 0x401 | 231 | #define _PAGE_TYPE_NONE 0x401 |
@@ -681,7 +684,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt | |||
681 | */ | 684 | */ |
682 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 685 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
683 | { | 686 | { |
684 | pte_val(pte) &= PAGE_MASK; | 687 | pte_val(pte) &= _PAGE_CHG_MASK; |
685 | pte_val(pte) |= pgprot_val(newprot); | 688 | pte_val(pte) |= pgprot_val(newprot); |
686 | return pte; | 689 | return pte; |
687 | } | 690 | } |
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index 268a012bcd79..28bddbcb38be 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h | |||
@@ -192,8 +192,8 @@ static inline void native_set_ldt(const void *addr, unsigned int entries) | |||
192 | unsigned cpu = smp_processor_id(); | 192 | unsigned cpu = smp_processor_id(); |
193 | ldt_desc ldt; | 193 | ldt_desc ldt; |
194 | 194 | ||
195 | set_tssldt_descriptor(&ldt, (unsigned long)addr, | 195 | set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT, |
196 | DESC_LDT, entries * sizeof(ldt) - 1); | 196 | entries * LDT_ENTRY_SIZE - 1); |
197 | write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_LDT, | 197 | write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_LDT, |
198 | &ldt, DESC_LDT); | 198 | &ldt, DESC_LDT); |
199 | asm volatile("lldt %w0"::"q" (GDT_ENTRY_LDT*8)); | 199 | asm volatile("lldt %w0"::"q" (GDT_ENTRY_LDT*8)); |
diff --git a/include/asm-x86/kvm_para.h b/include/asm-x86/kvm_para.h index bfd9900742bf..76f392146daa 100644 --- a/include/asm-x86/kvm_para.h +++ b/include/asm-x86/kvm_para.h | |||
@@ -71,7 +71,8 @@ static inline long kvm_hypercall0(unsigned int nr) | |||
71 | long ret; | 71 | long ret; |
72 | asm volatile(KVM_HYPERCALL | 72 | asm volatile(KVM_HYPERCALL |
73 | : "=a"(ret) | 73 | : "=a"(ret) |
74 | : "a"(nr)); | 74 | : "a"(nr) |
75 | : "memory"); | ||
75 | return ret; | 76 | return ret; |
76 | } | 77 | } |
77 | 78 | ||
@@ -80,7 +81,8 @@ static inline long kvm_hypercall1(unsigned int nr, unsigned long p1) | |||
80 | long ret; | 81 | long ret; |
81 | asm volatile(KVM_HYPERCALL | 82 | asm volatile(KVM_HYPERCALL |
82 | : "=a"(ret) | 83 | : "=a"(ret) |
83 | : "a"(nr), "b"(p1)); | 84 | : "a"(nr), "b"(p1) |
85 | : "memory"); | ||
84 | return ret; | 86 | return ret; |
85 | } | 87 | } |
86 | 88 | ||
@@ -90,7 +92,8 @@ static inline long kvm_hypercall2(unsigned int nr, unsigned long p1, | |||
90 | long ret; | 92 | long ret; |
91 | asm volatile(KVM_HYPERCALL | 93 | asm volatile(KVM_HYPERCALL |
92 | : "=a"(ret) | 94 | : "=a"(ret) |
93 | : "a"(nr), "b"(p1), "c"(p2)); | 95 | : "a"(nr), "b"(p1), "c"(p2) |
96 | : "memory"); | ||
94 | return ret; | 97 | return ret; |
95 | } | 98 | } |
96 | 99 | ||
@@ -100,7 +103,8 @@ static inline long kvm_hypercall3(unsigned int nr, unsigned long p1, | |||
100 | long ret; | 103 | long ret; |
101 | asm volatile(KVM_HYPERCALL | 104 | asm volatile(KVM_HYPERCALL |
102 | : "=a"(ret) | 105 | : "=a"(ret) |
103 | : "a"(nr), "b"(p1), "c"(p2), "d"(p3)); | 106 | : "a"(nr), "b"(p1), "c"(p2), "d"(p3) |
107 | : "memory"); | ||
104 | return ret; | 108 | return ret; |
105 | } | 109 | } |
106 | 110 | ||
@@ -111,7 +115,8 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1, | |||
111 | long ret; | 115 | long ret; |
112 | asm volatile(KVM_HYPERCALL | 116 | asm volatile(KVM_HYPERCALL |
113 | : "=a"(ret) | 117 | : "=a"(ret) |
114 | : "a"(nr), "b"(p1), "c"(p2), "d"(p3), "S"(p4)); | 118 | : "a"(nr), "b"(p1), "c"(p2), "d"(p3), "S"(p4) |
119 | : "memory"); | ||
115 | return ret; | 120 | return ret; |
116 | } | 121 | } |
117 | 122 | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index fa830f8de032..02673846d205 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -501,6 +501,8 @@ extern const kernel_cap_t __cap_empty_set; | |||
501 | extern const kernel_cap_t __cap_full_set; | 501 | extern const kernel_cap_t __cap_full_set; |
502 | extern const kernel_cap_t __cap_init_eff_set; | 502 | extern const kernel_cap_t __cap_init_eff_set; |
503 | 503 | ||
504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); | ||
505 | |||
504 | int capable(int cap); | 506 | int capable(int cap); |
505 | int __capable(struct task_struct *t, int cap); | 507 | int __capable(struct task_struct *t, int cap); |
506 | 508 | ||
diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h index 1605dd8aa646..6f9f19d66591 100644 --- a/include/linux/cfag12864b.h +++ b/include/linux/cfag12864b.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Description: cfag12864b LCD driver header | 4 | * Description: cfag12864b LCD driver header |
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-12 | 8 | * Date: 2006-10-12 |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 5df3db58fcc6..c24875bd9c5b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -353,6 +353,10 @@ static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | |||
353 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 353 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
354 | #endif /* NR_CPUS */ | 354 | #endif /* NR_CPUS */ |
355 | 355 | ||
356 | #define next_cpu_nr(n, src) next_cpu(n, src) | ||
357 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) | ||
358 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | ||
359 | |||
356 | /* | 360 | /* |
357 | * The following particular system cpumasks and operations manage | 361 | * The following particular system cpumasks and operations manage |
358 | * possible, present and online cpus. Each of them is a fixed size | 362 | * possible, present and online cpus. Each of them is a fixed size |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index f4a5871767f5..4aaa4afb1cb9 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_DEBUG_LOCKING_H | 1 | #ifndef __LINUX_DEBUG_LOCKING_H |
2 | #define __LINUX_DEBUG_LOCKING_H | 2 | #define __LINUX_DEBUG_LOCKING_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | ||
5 | |||
4 | struct task_struct; | 6 | struct task_struct; |
5 | 7 | ||
6 | extern int debug_locks; | 8 | extern int debug_locks; |
@@ -11,14 +13,6 @@ extern int debug_locks_silent; | |||
11 | */ | 13 | */ |
12 | extern int debug_locks_off(void); | 14 | extern int debug_locks_off(void); |
13 | 15 | ||
14 | /* | ||
15 | * In the debug case we carry the caller's instruction pointer into | ||
16 | * other functions, but we dont want the function argument overhead | ||
17 | * in the nondebug case - hence these macros: | ||
18 | */ | ||
19 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | ||
20 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | ||
21 | |||
22 | #define DEBUG_LOCKS_WARN_ON(c) \ | 16 | #define DEBUG_LOCKS_WARN_ON(c) \ |
23 | ({ \ | 17 | ({ \ |
24 | int __ret = 0; \ | 18 | int __ret = 0; \ |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 4d10c7328d2d..6c7eff2ebada 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -13,7 +13,7 @@ struct firmware { | |||
13 | 13 | ||
14 | struct device; | 14 | struct device; |
15 | 15 | ||
16 | #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) | 16 | #if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE)) |
17 | int request_firmware(const struct firmware **fw, const char *name, | 17 | int request_firmware(const struct firmware **fw, const char *name, |
18 | struct device *device); | 18 | struct device *device); |
19 | int request_firmware_nowait( | 19 | int request_firmware_nowait( |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9918772bf274..eddb6daadf4a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -189,6 +189,21 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
189 | hw->io_ports.ctl_addr = ctl_addr; | 189 | hw->io_ports.ctl_addr = ctl_addr; |
190 | } | 190 | } |
191 | 191 | ||
192 | /* for IDE PCI controllers in legacy mode, temporary */ | ||
193 | static inline int __ide_default_irq(unsigned long base) | ||
194 | { | ||
195 | switch (base) { | ||
196 | #ifdef CONFIG_IA64 | ||
197 | case 0x1f0: return isa_irq_to_vector(14); | ||
198 | case 0x170: return isa_irq_to_vector(15); | ||
199 | #else | ||
200 | case 0x1f0: return 14; | ||
201 | case 0x170: return 15; | ||
202 | #endif | ||
203 | } | ||
204 | return 0; | ||
205 | } | ||
206 | |||
192 | #include <asm/ide.h> | 207 | #include <asm/ide.h> |
193 | 208 | ||
194 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) | 209 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 792bf0aa779b..2e70006c7fa8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -46,6 +46,9 @@ extern const char linux_proc_banner[]; | |||
46 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 46 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
47 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 47 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
48 | 48 | ||
49 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | ||
50 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | ||
51 | |||
49 | #ifdef CONFIG_LBD | 52 | #ifdef CONFIG_LBD |
50 | # include <asm/div64.h> | 53 | # include <asm/div64.h> |
51 | # define sector_div(a, b) do_div(a, b) | 54 | # define sector_div(a, b) do_div(a, b) |
diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h index a2c54acceb4e..cb311798e0bc 100644 --- a/include/linux/ks0108.h +++ b/include/linux/ks0108.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Description: ks0108 LCD Controller driver header | 4 | * Description: ks0108 LCD Controller driver header |
5 | * License: GPLv2 | 5 | * License: GPLv2 |
6 | * | 6 | * |
7 | * Author: Copyright (C) Miguel Ojeda Sandonis <maxextreme@gmail.com> | 7 | * Author: Copyright (C) Miguel Ojeda Sandonis |
8 | * Date: 2006-10-31 | 8 | * Date: 2006-10-31 |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index eafc9d6d2b35..65953822c9cb 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1520,6 +1520,7 @@ | |||
1520 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1520 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
1521 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1521 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
1522 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 | 1522 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 |
1523 | #define PCI_DEVICE_ID_MARVELL_CAFE_SD 0x4101 | ||
1523 | 1524 | ||
1524 | #define PCI_VENDOR_ID_V3 0x11b0 | 1525 | #define PCI_VENDOR_ID_V3 0x11b0 |
1525 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1526 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h new file mode 100644 index 000000000000..bde4586f4382 --- /dev/null +++ b/include/linux/rculist.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _LINUX_RCULIST_H | ||
2 | #define _LINUX_RCULIST_H | ||
3 | |||
4 | #include <linux/list.h> | ||
5 | |||
6 | #endif /* _LINUX_RCULIST_H */ | ||
diff --git a/include/linux/securebits.h b/include/linux/securebits.h index c1f19dbceb05..92f09bdf1175 100644 --- a/include/linux/securebits.h +++ b/include/linux/securebits.h | |||
@@ -7,14 +7,15 @@ | |||
7 | inheritance of root-permissions and suid-root executable under | 7 | inheritance of root-permissions and suid-root executable under |
8 | compatibility mode. We raise the effective and inheritable bitmasks | 8 | compatibility mode. We raise the effective and inheritable bitmasks |
9 | *of the executable file* if the effective uid of the new process is | 9 | *of the executable file* if the effective uid of the new process is |
10 | 0. If the real uid is 0, we raise the inheritable bitmask of the | 10 | 0. If the real uid is 0, we raise the effective (legacy) bit of the |
11 | executable file. */ | 11 | executable file. */ |
12 | #define SECURE_NOROOT 0 | 12 | #define SECURE_NOROOT 0 |
13 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ | 13 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ |
14 | 14 | ||
15 | /* When set, setuid to/from uid 0 does not trigger capability-"fixes" | 15 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". |
16 | to be compatible with old programs relying on set*uid to loose | 16 | When unset, to provide compatiblility with old programs relying on |
17 | privileges. When unset, setuid doesn't change privileges. */ | 17 | set*uid to gain/lose privilege, transitions to/from uid 0 cause |
18 | capabilities to be gained/lost. */ | ||
18 | #define SECURE_NO_SETUID_FIXUP 2 | 19 | #define SECURE_NO_SETUID_FIXUP 2 |
19 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ | 20 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ |
20 | 21 | ||
@@ -26,10 +27,10 @@ | |||
26 | #define SECURE_KEEP_CAPS 4 | 27 | #define SECURE_KEEP_CAPS 4 |
27 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ | 28 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ |
28 | 29 | ||
29 | /* Each securesetting is implemented using two bits. One bit specify | 30 | /* Each securesetting is implemented using two bits. One bit specifies |
30 | whether the setting is on or off. The other bit specify whether the | 31 | whether the setting is on or off. The other bit specify whether the |
31 | setting is fixed or not. A setting which is fixed cannot be changed | 32 | setting is locked or not. A setting which is locked cannot be |
32 | from user-level. */ | 33 | changed from user-level. */ |
33 | #define issecure_mask(X) (1 << (X)) | 34 | #define issecure_mask(X) (1 << (X)) |
34 | #define issecure(X) (issecure_mask(X) & current->securebits) | 35 | #define issecure(X) (issecure_mask(X) & current->securebits) |
35 | 36 | ||
diff --git a/include/linux/slab.h b/include/linux/slab.h index c2ad35016599..9aa90a6f20e0 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk). | 2 | * Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk). |
3 | * | 3 | * |
4 | * (C) SGI 2006, Christoph Lameter <clameter@sgi.com> | 4 | * (C) SGI 2006, Christoph Lameter |
5 | * Cleaned up and restructured to ease the addition of alternative | 5 | * Cleaned up and restructured to ease the addition of alternative |
6 | * implementations of SLAB allocators. | 6 | * implementations of SLAB allocators. |
7 | */ | 7 | */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 71e43a12ebbb..d117ea2825a9 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -4,7 +4,7 @@ | |||
4 | /* | 4 | /* |
5 | * SLUB : A Slab allocator without object queues. | 5 | * SLUB : A Slab allocator without object queues. |
6 | * | 6 | * |
7 | * (C) 2007 SGI, Christoph Lameter <clameter@sgi.com> | 7 | * (C) 2007 SGI, Christoph Lameter |
8 | */ | 8 | */ |
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
@@ -137,10 +137,12 @@ static __always_inline int kmalloc_index(size_t size) | |||
137 | if (size <= KMALLOC_MIN_SIZE) | 137 | if (size <= KMALLOC_MIN_SIZE) |
138 | return KMALLOC_SHIFT_LOW; | 138 | return KMALLOC_SHIFT_LOW; |
139 | 139 | ||
140 | #if KMALLOC_MIN_SIZE <= 64 | ||
140 | if (size > 64 && size <= 96) | 141 | if (size > 64 && size <= 96) |
141 | return 1; | 142 | return 1; |
142 | if (size > 128 && size <= 192) | 143 | if (size > 128 && size <= 192) |
143 | return 2; | 144 | return 2; |
145 | #endif | ||
144 | if (size <= 8) return 3; | 146 | if (size <= 8) return 3; |
145 | if (size <= 16) return 4; | 147 | if (size <= 16) return 4; |
146 | if (size <= 32) return 5; | 148 | if (size <= 32) return 5; |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 2ca6bae88721..fb0c215a3051 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -339,6 +339,7 @@ struct xfrm_usersa_info { | |||
339 | #define XFRM_STATE_NOPMTUDISC 4 | 339 | #define XFRM_STATE_NOPMTUDISC 4 |
340 | #define XFRM_STATE_WILDRECV 8 | 340 | #define XFRM_STATE_WILDRECV 8 |
341 | #define XFRM_STATE_ICMP 16 | 341 | #define XFRM_STATE_ICMP 16 |
342 | #define XFRM_STATE_AF_UNSPEC 32 | ||
342 | }; | 343 | }; |
343 | 344 | ||
344 | struct xfrm_usersa_id { | 345 | struct xfrm_usersa_id { |
diff --git a/kernel/capability.c b/kernel/capability.c index cfbe44299488..901e0fdc3fff 100644 --- a/kernel/capability.c +++ b/kernel/capability.c | |||
@@ -121,6 +121,27 @@ static int cap_validate_magic(cap_user_header_t header, unsigned *tocopy) | |||
121 | * uninteresting and/or not to be changed. | 121 | * uninteresting and/or not to be changed. |
122 | */ | 122 | */ |
123 | 123 | ||
124 | /* | ||
125 | * Atomically modify the effective capabilities returning the original | ||
126 | * value. No permission check is performed here - it is assumed that the | ||
127 | * caller is permitted to set the desired effective capabilities. | ||
128 | */ | ||
129 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new) | ||
130 | { | ||
131 | kernel_cap_t pE_old; | ||
132 | |||
133 | spin_lock(&task_capability_lock); | ||
134 | |||
135 | pE_old = current->cap_effective; | ||
136 | current->cap_effective = pE_new; | ||
137 | |||
138 | spin_unlock(&task_capability_lock); | ||
139 | |||
140 | return pE_old; | ||
141 | } | ||
142 | |||
143 | EXPORT_SYMBOL(cap_set_effective); | ||
144 | |||
124 | /** | 145 | /** |
125 | * sys_capget - get the capabilities of a given process. | 146 | * sys_capget - get the capabilities of a given process. |
126 | * @header: pointer to struct that contains capability version and | 147 | * @header: pointer to struct that contains capability version and |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 9fceb97e989c..798b3ab054eb 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -1882,7 +1882,7 @@ static void scan_for_empty_cpusets(const struct cpuset *root) | |||
1882 | * in order to minimize text size. | 1882 | * in order to minimize text size. |
1883 | */ | 1883 | */ |
1884 | 1884 | ||
1885 | static void common_cpu_mem_hotplug_unplug(void) | 1885 | static void common_cpu_mem_hotplug_unplug(int rebuild_sd) |
1886 | { | 1886 | { |
1887 | cgroup_lock(); | 1887 | cgroup_lock(); |
1888 | 1888 | ||
@@ -1894,7 +1894,8 @@ static void common_cpu_mem_hotplug_unplug(void) | |||
1894 | * Scheduler destroys domains on hotplug events. | 1894 | * Scheduler destroys domains on hotplug events. |
1895 | * Rebuild them based on the current settings. | 1895 | * Rebuild them based on the current settings. |
1896 | */ | 1896 | */ |
1897 | rebuild_sched_domains(); | 1897 | if (rebuild_sd) |
1898 | rebuild_sched_domains(); | ||
1898 | 1899 | ||
1899 | cgroup_unlock(); | 1900 | cgroup_unlock(); |
1900 | } | 1901 | } |
@@ -1912,11 +1913,22 @@ static void common_cpu_mem_hotplug_unplug(void) | |||
1912 | static int cpuset_handle_cpuhp(struct notifier_block *unused_nb, | 1913 | static int cpuset_handle_cpuhp(struct notifier_block *unused_nb, |
1913 | unsigned long phase, void *unused_cpu) | 1914 | unsigned long phase, void *unused_cpu) |
1914 | { | 1915 | { |
1915 | if (phase == CPU_DYING || phase == CPU_DYING_FROZEN) | 1916 | switch (phase) { |
1917 | case CPU_UP_CANCELED: | ||
1918 | case CPU_UP_CANCELED_FROZEN: | ||
1919 | case CPU_DOWN_FAILED: | ||
1920 | case CPU_DOWN_FAILED_FROZEN: | ||
1921 | case CPU_ONLINE: | ||
1922 | case CPU_ONLINE_FROZEN: | ||
1923 | case CPU_DEAD: | ||
1924 | case CPU_DEAD_FROZEN: | ||
1925 | common_cpu_mem_hotplug_unplug(1); | ||
1926 | break; | ||
1927 | default: | ||
1916 | return NOTIFY_DONE; | 1928 | return NOTIFY_DONE; |
1929 | } | ||
1917 | 1930 | ||
1918 | common_cpu_mem_hotplug_unplug(); | 1931 | return NOTIFY_OK; |
1919 | return 0; | ||
1920 | } | 1932 | } |
1921 | 1933 | ||
1922 | #ifdef CONFIG_MEMORY_HOTPLUG | 1934 | #ifdef CONFIG_MEMORY_HOTPLUG |
@@ -1929,7 +1941,7 @@ static int cpuset_handle_cpuhp(struct notifier_block *unused_nb, | |||
1929 | 1941 | ||
1930 | void cpuset_track_online_nodes(void) | 1942 | void cpuset_track_online_nodes(void) |
1931 | { | 1943 | { |
1932 | common_cpu_mem_hotplug_unplug(); | 1944 | common_cpu_mem_hotplug_unplug(0); |
1933 | } | 1945 | } |
1934 | #endif | 1946 | #endif |
1935 | 1947 | ||
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 421be5fe5cc7..ab80515008f4 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -1003,10 +1003,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) | |||
1003 | */ | 1003 | */ |
1004 | raise = timer->state == HRTIMER_STATE_PENDING; | 1004 | raise = timer->state == HRTIMER_STATE_PENDING; |
1005 | 1005 | ||
1006 | /* | ||
1007 | * We use preempt_disable to prevent this task from migrating after | ||
1008 | * setting up the softirq and raising it. Otherwise, if me migrate | ||
1009 | * we will raise the softirq on the wrong CPU. | ||
1010 | */ | ||
1011 | preempt_disable(); | ||
1012 | |||
1006 | unlock_hrtimer_base(timer, &flags); | 1013 | unlock_hrtimer_base(timer, &flags); |
1007 | 1014 | ||
1008 | if (raise) | 1015 | if (raise) |
1009 | hrtimer_raise_softirq(); | 1016 | hrtimer_raise_softirq(); |
1017 | preempt_enable(); | ||
1010 | 1018 | ||
1011 | return ret; | 1019 | return ret; |
1012 | } | 1020 | } |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index d4998f81e229..1485ca8d0e00 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -79,7 +79,7 @@ static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL; | |||
79 | * | 79 | * |
80 | * For such cases, we now have a blacklist | 80 | * For such cases, we now have a blacklist |
81 | */ | 81 | */ |
82 | struct kprobe_blackpoint kprobe_blacklist[] = { | 82 | static struct kprobe_blackpoint kprobe_blacklist[] = { |
83 | {"preempt_schedule",}, | 83 | {"preempt_schedule",}, |
84 | {NULL} /* Terminator */ | 84 | {NULL} /* Terminator */ |
85 | }; | 85 | }; |
diff --git a/kernel/printk.c b/kernel/printk.c index 8fb01c32aa3b..e2129e83fd75 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -666,7 +666,7 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu) | |||
666 | return retval; | 666 | return retval; |
667 | } | 667 | } |
668 | 668 | ||
669 | const char printk_recursion_bug_msg [] = | 669 | static const char printk_recursion_bug_msg [] = |
670 | KERN_CRIT "BUG: recent printk recursion!\n"; | 670 | KERN_CRIT "BUG: recent printk recursion!\n"; |
671 | static int printk_recursion_bug; | 671 | static int printk_recursion_bug; |
672 | 672 | ||
diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c index 5e02b7740702..41d275a81df5 100644 --- a/kernel/rcupreempt.c +++ b/kernel/rcupreempt.c | |||
@@ -925,26 +925,22 @@ void rcu_offline_cpu(int cpu) | |||
925 | spin_unlock_irqrestore(&rdp->lock, flags); | 925 | spin_unlock_irqrestore(&rdp->lock, flags); |
926 | } | 926 | } |
927 | 927 | ||
928 | void __devinit rcu_online_cpu(int cpu) | ||
929 | { | ||
930 | unsigned long flags; | ||
931 | |||
932 | spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags); | ||
933 | cpu_set(cpu, rcu_cpu_online_map); | ||
934 | spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags); | ||
935 | } | ||
936 | |||
937 | #else /* #ifdef CONFIG_HOTPLUG_CPU */ | 928 | #else /* #ifdef CONFIG_HOTPLUG_CPU */ |
938 | 929 | ||
939 | void rcu_offline_cpu(int cpu) | 930 | void rcu_offline_cpu(int cpu) |
940 | { | 931 | { |
941 | } | 932 | } |
942 | 933 | ||
943 | void __devinit rcu_online_cpu(int cpu) | 934 | #endif /* #else #ifdef CONFIG_HOTPLUG_CPU */ |
935 | |||
936 | void __cpuinit rcu_online_cpu(int cpu) | ||
944 | { | 937 | { |
945 | } | 938 | unsigned long flags; |
946 | 939 | ||
947 | #endif /* #else #ifdef CONFIG_HOTPLUG_CPU */ | 940 | spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags); |
941 | cpu_set(cpu, rcu_cpu_online_map); | ||
942 | spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags); | ||
943 | } | ||
948 | 944 | ||
949 | static void rcu_process_callbacks(struct softirq_action *unused) | 945 | static void rcu_process_callbacks(struct softirq_action *unused) |
950 | { | 946 | { |
diff --git a/kernel/sched.c b/kernel/sched.c index 94ead43eda62..4e2f60335656 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -5622,10 +5622,10 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) | |||
5622 | double_rq_lock(rq_src, rq_dest); | 5622 | double_rq_lock(rq_src, rq_dest); |
5623 | /* Already moved. */ | 5623 | /* Already moved. */ |
5624 | if (task_cpu(p) != src_cpu) | 5624 | if (task_cpu(p) != src_cpu) |
5625 | goto out; | 5625 | goto done; |
5626 | /* Affinity changed (again). */ | 5626 | /* Affinity changed (again). */ |
5627 | if (!cpu_isset(dest_cpu, p->cpus_allowed)) | 5627 | if (!cpu_isset(dest_cpu, p->cpus_allowed)) |
5628 | goto out; | 5628 | goto fail; |
5629 | 5629 | ||
5630 | on_rq = p->se.on_rq; | 5630 | on_rq = p->se.on_rq; |
5631 | if (on_rq) | 5631 | if (on_rq) |
@@ -5636,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) | |||
5636 | activate_task(rq_dest, p, 0); | 5636 | activate_task(rq_dest, p, 0); |
5637 | check_preempt_curr(rq_dest, p); | 5637 | check_preempt_curr(rq_dest, p); |
5638 | } | 5638 | } |
5639 | done: | ||
5639 | ret = 1; | 5640 | ret = 1; |
5640 | out: | 5641 | fail: |
5641 | double_rq_unlock(rq_src, rq_dest); | 5642 | double_rq_unlock(rq_src, rq_dest); |
5642 | return ret; | 5643 | return ret; |
5643 | } | 5644 | } |
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index c828c2339cc9..a272d78185eb 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -120,6 +120,7 @@ void softlockup_tick(void) | |||
120 | printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n", | 120 | printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n", |
121 | this_cpu, now - touch_timestamp, | 121 | this_cpu, now - touch_timestamp, |
122 | current->comm, task_pid_nr(current)); | 122 | current->comm, task_pid_nr(current)); |
123 | print_modules(); | ||
123 | if (regs) | 124 | if (regs) |
124 | show_regs(regs); | 125 | show_regs(regs); |
125 | else | 126 | else |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 29fc39f1029c..ce7799540c91 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * Kai Petzke <wpp@marie.physik.tu-berlin.de> | 13 | * Kai Petzke <wpp@marie.physik.tu-berlin.de> |
14 | * Theodore Ts'o <tytso@mit.edu> | 14 | * Theodore Ts'o <tytso@mit.edu> |
15 | * | 15 | * |
16 | * Made to use alloc_percpu by Christoph Lameter <clameter@sgi.com>. | 16 | * Made to use alloc_percpu by Christoph Lameter. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
@@ -37,6 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #include <linux/list.h> | 38 | #include <linux/list.h> |
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/kernel.h> | ||
40 | #include <linux/bug.h> | 41 | #include <linux/bug.h> |
41 | #include <linux/sched.h> | 42 | #include <linux/sched.h> |
42 | 43 | ||
@@ -149,6 +150,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
149 | (void *)bugaddr); | 150 | (void *)bugaddr); |
150 | 151 | ||
151 | show_regs(regs); | 152 | show_regs(regs); |
153 | add_taint(TAINT_WARN); | ||
152 | return BUG_TRAP_TYPE_WARN; | 154 | return BUG_TRAP_TYPE_WARN; |
153 | } | 155 | } |
154 | 156 | ||
diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 169a2f8dabcc..56ec21a7f73d 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001 Momchil Velikov | 2 | * Copyright (C) 2001 Momchil Velikov |
3 | * Portions Copyright (C) 2001 Christoph Hellwig | 3 | * Portions Copyright (C) 2001 Christoph Hellwig |
4 | * Copyright (C) 2005 SGI, Christoph Lameter <clameter@sgi.com> | 4 | * Copyright (C) 2005 SGI, Christoph Lameter |
5 | * Copyright (C) 2006 Nick Piggin | 5 | * Copyright (C) 2006 Nick Piggin |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 6021757a4496..1dc2d1d18fa8 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
23 | #include <linux/ctype.h> | 23 | #include <linux/ctype.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/kallsyms.h> | ||
26 | #include <linux/uaccess.h> | ||
25 | 27 | ||
26 | #include <asm/page.h> /* for PAGE_SIZE */ | 28 | #include <asm/page.h> /* for PAGE_SIZE */ |
27 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
@@ -482,6 +484,89 @@ static char *number(char *buf, char *end, unsigned long long num, int base, int | |||
482 | return buf; | 484 | return buf; |
483 | } | 485 | } |
484 | 486 | ||
487 | static char *string(char *buf, char *end, char *s, int field_width, int precision, int flags) | ||
488 | { | ||
489 | int len, i; | ||
490 | |||
491 | if ((unsigned long)s < PAGE_SIZE) | ||
492 | s = "<NULL>"; | ||
493 | |||
494 | len = strnlen(s, precision); | ||
495 | |||
496 | if (!(flags & LEFT)) { | ||
497 | while (len < field_width--) { | ||
498 | if (buf < end) | ||
499 | *buf = ' '; | ||
500 | ++buf; | ||
501 | } | ||
502 | } | ||
503 | for (i = 0; i < len; ++i) { | ||
504 | if (buf < end) | ||
505 | *buf = *s; | ||
506 | ++buf; ++s; | ||
507 | } | ||
508 | while (len < field_width--) { | ||
509 | if (buf < end) | ||
510 | *buf = ' '; | ||
511 | ++buf; | ||
512 | } | ||
513 | return buf; | ||
514 | } | ||
515 | |||
516 | static inline void *dereference_function_descriptor(void *ptr) | ||
517 | { | ||
518 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | ||
519 | void *p; | ||
520 | if (!probe_kernel_address(ptr, p)) | ||
521 | ptr = p; | ||
522 | #endif | ||
523 | return ptr; | ||
524 | } | ||
525 | |||
526 | static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) | ||
527 | { | ||
528 | unsigned long value = (unsigned long) ptr; | ||
529 | #ifdef CONFIG_KALLSYMS | ||
530 | char sym[KSYM_SYMBOL_LEN]; | ||
531 | sprint_symbol(sym, value); | ||
532 | return string(buf, end, sym, field_width, precision, flags); | ||
533 | #else | ||
534 | field_width = 2*sizeof(void *); | ||
535 | flags |= SPECIAL | SMALL | ZEROPAD; | ||
536 | return number(buf, end, value, 16, field_width, precision, flags); | ||
537 | #endif | ||
538 | } | ||
539 | |||
540 | /* | ||
541 | * Show a '%p' thing. A kernel extension is that the '%p' is followed | ||
542 | * by an extra set of alphanumeric characters that are extended format | ||
543 | * specifiers. | ||
544 | * | ||
545 | * Right now we just handle 'F' (for symbolic Function descriptor pointers) | ||
546 | * and 'S' (for Symbolic direct pointers), but this can easily be | ||
547 | * extended in the future (network address types etc). | ||
548 | * | ||
549 | * The difference between 'S' and 'F' is that on ia64 and ppc64 function | ||
550 | * pointers are really function descriptors, which contain a pointer the | ||
551 | * real address. | ||
552 | */ | ||
553 | static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field_width, int precision, int flags) | ||
554 | { | ||
555 | switch (*fmt) { | ||
556 | case 'F': | ||
557 | ptr = dereference_function_descriptor(ptr); | ||
558 | /* Fallthrough */ | ||
559 | case 'S': | ||
560 | return symbol_string(buf, end, ptr, field_width, precision, flags); | ||
561 | } | ||
562 | flags |= SMALL; | ||
563 | if (field_width == -1) { | ||
564 | field_width = 2*sizeof(void *); | ||
565 | flags |= ZEROPAD; | ||
566 | } | ||
567 | return number(buf, end, (unsigned long) ptr, 16, field_width, precision, flags); | ||
568 | } | ||
569 | |||
485 | /** | 570 | /** |
486 | * vsnprintf - Format a string and place it in a buffer | 571 | * vsnprintf - Format a string and place it in a buffer |
487 | * @buf: The buffer to place the result into | 572 | * @buf: The buffer to place the result into |
@@ -502,11 +587,9 @@ static char *number(char *buf, char *end, unsigned long long num, int base, int | |||
502 | */ | 587 | */ |
503 | int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | 588 | int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) |
504 | { | 589 | { |
505 | int len; | ||
506 | unsigned long long num; | 590 | unsigned long long num; |
507 | int i, base; | 591 | int base; |
508 | char *str, *end, c; | 592 | char *str, *end, c; |
509 | const char *s; | ||
510 | 593 | ||
511 | int flags; /* flags to number() */ | 594 | int flags; /* flags to number() */ |
512 | 595 | ||
@@ -622,43 +705,18 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
622 | continue; | 705 | continue; |
623 | 706 | ||
624 | case 's': | 707 | case 's': |
625 | s = va_arg(args, char *); | 708 | str = string(str, end, va_arg(args, char *), field_width, precision, flags); |
626 | if ((unsigned long)s < PAGE_SIZE) | ||
627 | s = "<NULL>"; | ||
628 | |||
629 | len = strnlen(s, precision); | ||
630 | |||
631 | if (!(flags & LEFT)) { | ||
632 | while (len < field_width--) { | ||
633 | if (str < end) | ||
634 | *str = ' '; | ||
635 | ++str; | ||
636 | } | ||
637 | } | ||
638 | for (i = 0; i < len; ++i) { | ||
639 | if (str < end) | ||
640 | *str = *s; | ||
641 | ++str; ++s; | ||
642 | } | ||
643 | while (len < field_width--) { | ||
644 | if (str < end) | ||
645 | *str = ' '; | ||
646 | ++str; | ||
647 | } | ||
648 | continue; | 709 | continue; |
649 | 710 | ||
650 | case 'p': | 711 | case 'p': |
651 | flags |= SMALL; | 712 | str = pointer(fmt+1, str, end, |
652 | if (field_width == -1) { | 713 | va_arg(args, void *), |
653 | field_width = 2*sizeof(void *); | 714 | field_width, precision, flags); |
654 | flags |= ZEROPAD; | 715 | /* Skip all alphanumeric pointer suffixes */ |
655 | } | 716 | while (isalnum(fmt[1])) |
656 | str = number(str, end, | 717 | fmt++; |
657 | (unsigned long) va_arg(args, void *), | ||
658 | 16, field_width, precision, flags); | ||
659 | continue; | 718 | continue; |
660 | 719 | ||
661 | |||
662 | case 'n': | 720 | case 'n': |
663 | /* FIXME: | 721 | /* FIXME: |
664 | * What does C99 say about the overflow case here? */ | 722 | * What does C99 say about the overflow case here? */ |
diff --git a/mm/allocpercpu.c b/mm/allocpercpu.c index f4026bae6eed..05f2b4009ccc 100644 --- a/mm/allocpercpu.c +++ b/mm/allocpercpu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/mm/allocpercpu.c | 2 | * linux/mm/allocpercpu.c |
3 | * | 3 | * |
4 | * Separated from slab.c August 11, 2006 Christoph Lameter <clameter@sgi.com> | 4 | * Separated from slab.c August 11, 2006 Christoph Lameter |
5 | */ | 5 | */ |
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
diff --git a/mm/memory.c b/mm/memory.c index d14b251a25a6..2302d228fe04 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1151,7 +1151,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1151 | * be processed until returning to user space. | 1151 | * be processed until returning to user space. |
1152 | */ | 1152 | */ |
1153 | if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE))) | 1153 | if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE))) |
1154 | return -ENOMEM; | 1154 | return i ? i : -ENOMEM; |
1155 | 1155 | ||
1156 | if (write) | 1156 | if (write) |
1157 | foll_flags |= FOLL_WRITE; | 1157 | foll_flags |= FOLL_WRITE; |
@@ -1697,8 +1697,19 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1697 | struct page *dirty_page = NULL; | 1697 | struct page *dirty_page = NULL; |
1698 | 1698 | ||
1699 | old_page = vm_normal_page(vma, address, orig_pte); | 1699 | old_page = vm_normal_page(vma, address, orig_pte); |
1700 | if (!old_page) | 1700 | if (!old_page) { |
1701 | /* | ||
1702 | * VM_MIXEDMAP !pfn_valid() case | ||
1703 | * | ||
1704 | * We should not cow pages in a shared writeable mapping. | ||
1705 | * Just mark the pages writable as we can't do any dirty | ||
1706 | * accounting on raw pfn maps. | ||
1707 | */ | ||
1708 | if ((vma->vm_flags & (VM_WRITE|VM_SHARED)) == | ||
1709 | (VM_WRITE|VM_SHARED)) | ||
1710 | goto reuse; | ||
1701 | goto gotten; | 1711 | goto gotten; |
1712 | } | ||
1702 | 1713 | ||
1703 | /* | 1714 | /* |
1704 | * Take out anonymous pages first, anonymous shared vmas are | 1715 | * Take out anonymous pages first, anonymous shared vmas are |
@@ -1751,6 +1762,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1751 | } | 1762 | } |
1752 | 1763 | ||
1753 | if (reuse) { | 1764 | if (reuse) { |
1765 | reuse: | ||
1754 | flush_cache_page(vma, address, pte_pfn(orig_pte)); | 1766 | flush_cache_page(vma, address, pte_pfn(orig_pte)); |
1755 | entry = pte_mkyoung(orig_pte); | 1767 | entry = pte_mkyoung(orig_pte); |
1756 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); | 1768 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index a37a5034f63d..c94e58b192c3 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -729,7 +729,11 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, | |||
729 | } else { | 729 | } else { |
730 | *policy = pol == &default_policy ? MPOL_DEFAULT : | 730 | *policy = pol == &default_policy ? MPOL_DEFAULT : |
731 | pol->mode; | 731 | pol->mode; |
732 | *policy |= pol->flags; | 732 | /* |
733 | * Internal mempolicy flags must be masked off before exposing | ||
734 | * the policy to userspace. | ||
735 | */ | ||
736 | *policy |= (pol->flags & MPOL_MODE_FLAGS); | ||
733 | } | 737 | } |
734 | 738 | ||
735 | if (vma) { | 739 | if (vma) { |
diff --git a/mm/migrate.c b/mm/migrate.c index 112bcaeaa104..55bd355d170d 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * IWAMOTO Toshihiro <iwamoto@valinux.co.jp> | 9 | * IWAMOTO Toshihiro <iwamoto@valinux.co.jp> |
10 | * Hirokazu Takahashi <taka@valinux.co.jp> | 10 | * Hirokazu Takahashi <taka@valinux.co.jp> |
11 | * Dave Hansen <haveblue@us.ibm.com> | 11 | * Dave Hansen <haveblue@us.ibm.com> |
12 | * Christoph Lameter <clameter@sgi.com> | 12 | * Christoph Lameter |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/migrate.h> | 15 | #include <linux/migrate.h> |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2f552955a02f..f32fae3121f0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2328,7 +2328,6 @@ static void build_zonelists(pg_data_t *pgdat) | |||
2328 | static void build_zonelist_cache(pg_data_t *pgdat) | 2328 | static void build_zonelist_cache(pg_data_t *pgdat) |
2329 | { | 2329 | { |
2330 | pgdat->node_zonelists[0].zlcache_ptr = NULL; | 2330 | pgdat->node_zonelists[0].zlcache_ptr = NULL; |
2331 | pgdat->node_zonelists[1].zlcache_ptr = NULL; | ||
2332 | } | 2331 | } |
2333 | 2332 | ||
2334 | #endif /* CONFIG_NUMA */ | 2333 | #endif /* CONFIG_NUMA */ |
@@ -5,7 +5,7 @@ | |||
5 | * The allocator synchronizes using per slab locks and only | 5 | * The allocator synchronizes using per slab locks and only |
6 | * uses a centralized lock to manage a pool of partial slabs. | 6 | * uses a centralized lock to manage a pool of partial slabs. |
7 | * | 7 | * |
8 | * (C) 2007 SGI, Christoph Lameter <clameter@sgi.com> | 8 | * (C) 2007 SGI, Christoph Lameter |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
@@ -431,9 +431,8 @@ static void print_track(const char *s, struct track *t) | |||
431 | if (!t->addr) | 431 | if (!t->addr) |
432 | return; | 432 | return; |
433 | 433 | ||
434 | printk(KERN_ERR "INFO: %s in ", s); | 434 | printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n", |
435 | __print_symbol("%s", (unsigned long)t->addr); | 435 | s, t->addr, jiffies - t->when, t->cpu, t->pid); |
436 | printk(" age=%lu cpu=%u pid=%d\n", jiffies - t->when, t->cpu, t->pid); | ||
437 | } | 436 | } |
438 | 437 | ||
439 | static void print_tracking(struct kmem_cache *s, void *object) | 438 | static void print_tracking(struct kmem_cache *s, void *object) |
@@ -1628,9 +1627,11 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1628 | void **object; | 1627 | void **object; |
1629 | struct kmem_cache_cpu *c; | 1628 | struct kmem_cache_cpu *c; |
1630 | unsigned long flags; | 1629 | unsigned long flags; |
1630 | unsigned int objsize; | ||
1631 | 1631 | ||
1632 | local_irq_save(flags); | 1632 | local_irq_save(flags); |
1633 | c = get_cpu_slab(s, smp_processor_id()); | 1633 | c = get_cpu_slab(s, smp_processor_id()); |
1634 | objsize = c->objsize; | ||
1634 | if (unlikely(!c->freelist || !node_match(c, node))) | 1635 | if (unlikely(!c->freelist || !node_match(c, node))) |
1635 | 1636 | ||
1636 | object = __slab_alloc(s, gfpflags, node, addr, c); | 1637 | object = __slab_alloc(s, gfpflags, node, addr, c); |
@@ -1643,7 +1644,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1643 | local_irq_restore(flags); | 1644 | local_irq_restore(flags); |
1644 | 1645 | ||
1645 | if (unlikely((gfpflags & __GFP_ZERO) && object)) | 1646 | if (unlikely((gfpflags & __GFP_ZERO) && object)) |
1646 | memset(object, 0, c->objsize); | 1647 | memset(object, 0, objsize); |
1647 | 1648 | ||
1648 | return object; | 1649 | return object; |
1649 | } | 1650 | } |
@@ -2995,8 +2996,6 @@ void __init kmem_cache_init(void) | |||
2995 | create_kmalloc_cache(&kmalloc_caches[1], | 2996 | create_kmalloc_cache(&kmalloc_caches[1], |
2996 | "kmalloc-96", 96, GFP_KERNEL); | 2997 | "kmalloc-96", 96, GFP_KERNEL); |
2997 | caches++; | 2998 | caches++; |
2998 | } | ||
2999 | if (KMALLOC_MIN_SIZE <= 128) { | ||
3000 | create_kmalloc_cache(&kmalloc_caches[2], | 2999 | create_kmalloc_cache(&kmalloc_caches[2], |
3001 | "kmalloc-192", 192, GFP_KERNEL); | 3000 | "kmalloc-192", 192, GFP_KERNEL); |
3002 | caches++; | 3001 | caches++; |
@@ -3026,6 +3025,16 @@ void __init kmem_cache_init(void) | |||
3026 | for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) | 3025 | for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) |
3027 | size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW; | 3026 | size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW; |
3028 | 3027 | ||
3028 | if (KMALLOC_MIN_SIZE == 128) { | ||
3029 | /* | ||
3030 | * The 192 byte sized cache is not used if the alignment | ||
3031 | * is 128 byte. Redirect kmalloc to use the 256 byte cache | ||
3032 | * instead. | ||
3033 | */ | ||
3034 | for (i = 128 + 8; i <= 192; i += 8) | ||
3035 | size_index[(i - 1) / 8] = 8; | ||
3036 | } | ||
3037 | |||
3029 | slab_state = UP; | 3038 | slab_state = UP; |
3030 | 3039 | ||
3031 | /* Provide the correct kmalloc names now that the caches are up */ | 3040 | /* Provide the correct kmalloc names now that the caches are up */ |
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index 99c4f36eb8a3..a91b5f8fcaf6 100644 --- a/mm/sparse-vmemmap.c +++ b/mm/sparse-vmemmap.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Virtual Memory Map support | 2 | * Virtual Memory Map support |
3 | * | 3 | * |
4 | * (C) 2007 sgi. Christoph Lameter <clameter@sgi.com>. | 4 | * (C) 2007 sgi. Christoph Lameter. |
5 | * | 5 | * |
6 | * Virtual memory maps allow VM primitives pfn_to_page, page_to_pfn, | 6 | * Virtual memory maps allow VM primitives pfn_to_page, page_to_pfn, |
7 | * virt_to_page, page_address() to be implemented as a base offset | 7 | * virt_to_page, page_address() to be implemented as a base offset |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index c2397f503b0f..f38cc5317b88 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -442,12 +442,16 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) | |||
442 | 442 | ||
443 | void __exit br_cleanup_bridges(void) | 443 | void __exit br_cleanup_bridges(void) |
444 | { | 444 | { |
445 | struct net_device *dev, *nxt; | 445 | struct net_device *dev; |
446 | 446 | ||
447 | rtnl_lock(); | 447 | rtnl_lock(); |
448 | for_each_netdev_safe(&init_net, dev, nxt) | 448 | restart: |
449 | if (dev->priv_flags & IFF_EBRIDGE) | 449 | for_each_netdev(&init_net, dev) { |
450 | if (dev->priv_flags & IFF_EBRIDGE) { | ||
450 | del_br(dev->priv); | 451 | del_br(dev->priv); |
452 | goto restart; | ||
453 | } | ||
454 | } | ||
451 | rtnl_unlock(); | 455 | rtnl_unlock(); |
452 | 456 | ||
453 | } | 457 | } |
diff --git a/net/can/af_can.c b/net/can/af_can.c index 7e8ca2836452..484bbf6dd032 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -205,12 +205,19 @@ static int can_create(struct net *net, struct socket *sock, int protocol) | |||
205 | * -ENOBUFS on full driver queue (see net_xmit_errno()) | 205 | * -ENOBUFS on full driver queue (see net_xmit_errno()) |
206 | * -ENOMEM when local loopback failed at calling skb_clone() | 206 | * -ENOMEM when local loopback failed at calling skb_clone() |
207 | * -EPERM when trying to send on a non-CAN interface | 207 | * -EPERM when trying to send on a non-CAN interface |
208 | * -EINVAL when the skb->data does not contain a valid CAN frame | ||
208 | */ | 209 | */ |
209 | int can_send(struct sk_buff *skb, int loop) | 210 | int can_send(struct sk_buff *skb, int loop) |
210 | { | 211 | { |
211 | struct sk_buff *newskb = NULL; | 212 | struct sk_buff *newskb = NULL; |
213 | struct can_frame *cf = (struct can_frame *)skb->data; | ||
212 | int err; | 214 | int err; |
213 | 215 | ||
216 | if (skb->len != sizeof(struct can_frame) || cf->can_dlc > 8) { | ||
217 | kfree_skb(skb); | ||
218 | return -EINVAL; | ||
219 | } | ||
220 | |||
214 | if (skb->dev->type != ARPHRD_CAN) { | 221 | if (skb->dev->type != ARPHRD_CAN) { |
215 | kfree_skb(skb); | 222 | kfree_skb(skb); |
216 | return -EPERM; | 223 | return -EPERM; |
@@ -605,6 +612,7 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev, | |||
605 | struct packet_type *pt, struct net_device *orig_dev) | 612 | struct packet_type *pt, struct net_device *orig_dev) |
606 | { | 613 | { |
607 | struct dev_rcv_lists *d; | 614 | struct dev_rcv_lists *d; |
615 | struct can_frame *cf = (struct can_frame *)skb->data; | ||
608 | int matches; | 616 | int matches; |
609 | 617 | ||
610 | if (dev->type != ARPHRD_CAN || dev_net(dev) != &init_net) { | 618 | if (dev->type != ARPHRD_CAN || dev_net(dev) != &init_net) { |
@@ -612,6 +620,8 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev, | |||
612 | return 0; | 620 | return 0; |
613 | } | 621 | } |
614 | 622 | ||
623 | BUG_ON(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8); | ||
624 | |||
615 | /* update statistics */ | 625 | /* update statistics */ |
616 | can_stats.rx_frames++; | 626 | can_stats.rx_frames++; |
617 | can_stats.rx_frames_delta++; | 627 | can_stats.rx_frames_delta++; |
diff --git a/net/can/bcm.c b/net/can/bcm.c index d9a3a9d13bed..72c2ce904f83 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -298,7 +298,7 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, | |||
298 | 298 | ||
299 | if (head->nframes) { | 299 | if (head->nframes) { |
300 | /* can_frames starting here */ | 300 | /* can_frames starting here */ |
301 | firstframe = (struct can_frame *) skb_tail_pointer(skb); | 301 | firstframe = (struct can_frame *)skb_tail_pointer(skb); |
302 | 302 | ||
303 | memcpy(skb_put(skb, datalen), frames, datalen); | 303 | memcpy(skb_put(skb, datalen), frames, datalen); |
304 | 304 | ||
@@ -826,6 +826,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
826 | for (i = 0; i < msg_head->nframes; i++) { | 826 | for (i = 0; i < msg_head->nframes; i++) { |
827 | err = memcpy_fromiovec((u8 *)&op->frames[i], | 827 | err = memcpy_fromiovec((u8 *)&op->frames[i], |
828 | msg->msg_iov, CFSIZ); | 828 | msg->msg_iov, CFSIZ); |
829 | |||
830 | if (op->frames[i].can_dlc > 8) | ||
831 | err = -EINVAL; | ||
832 | |||
829 | if (err < 0) | 833 | if (err < 0) |
830 | return err; | 834 | return err; |
831 | 835 | ||
@@ -858,6 +862,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
858 | for (i = 0; i < msg_head->nframes; i++) { | 862 | for (i = 0; i < msg_head->nframes; i++) { |
859 | err = memcpy_fromiovec((u8 *)&op->frames[i], | 863 | err = memcpy_fromiovec((u8 *)&op->frames[i], |
860 | msg->msg_iov, CFSIZ); | 864 | msg->msg_iov, CFSIZ); |
865 | |||
866 | if (op->frames[i].can_dlc > 8) | ||
867 | err = -EINVAL; | ||
868 | |||
861 | if (err < 0) { | 869 | if (err < 0) { |
862 | if (op->frames != &op->sframe) | 870 | if (op->frames != &op->sframe) |
863 | kfree(op->frames); | 871 | kfree(op->frames); |
@@ -1164,9 +1172,12 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk) | |||
1164 | 1172 | ||
1165 | skb->dev = dev; | 1173 | skb->dev = dev; |
1166 | skb->sk = sk; | 1174 | skb->sk = sk; |
1167 | can_send(skb, 1); /* send with loopback */ | 1175 | err = can_send(skb, 1); /* send with loopback */ |
1168 | dev_put(dev); | 1176 | dev_put(dev); |
1169 | 1177 | ||
1178 | if (err) | ||
1179 | return err; | ||
1180 | |||
1170 | return CFSIZ + MHSIZ; | 1181 | return CFSIZ + MHSIZ; |
1171 | } | 1182 | } |
1172 | 1183 | ||
@@ -1185,6 +1196,10 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1185 | if (!bo->bound) | 1196 | if (!bo->bound) |
1186 | return -ENOTCONN; | 1197 | return -ENOTCONN; |
1187 | 1198 | ||
1199 | /* check for valid message length from userspace */ | ||
1200 | if (size < MHSIZ || (size - MHSIZ) % CFSIZ) | ||
1201 | return -EINVAL; | ||
1202 | |||
1188 | /* check for alternative ifindex for this bcm_op */ | 1203 | /* check for alternative ifindex for this bcm_op */ |
1189 | 1204 | ||
1190 | if (!ifindex && msg->msg_name) { | 1205 | if (!ifindex && msg->msg_name) { |
@@ -1259,8 +1274,8 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1259 | break; | 1274 | break; |
1260 | 1275 | ||
1261 | case TX_SEND: | 1276 | case TX_SEND: |
1262 | /* we need at least one can_frame */ | 1277 | /* we need exactly one can_frame behind the msg head */ |
1263 | if (msg_head.nframes < 1) | 1278 | if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ)) |
1264 | ret = -EINVAL; | 1279 | ret = -EINVAL; |
1265 | else | 1280 | else |
1266 | ret = bcm_tx_send(msg, ifindex, sk); | 1281 | ret = bcm_tx_send(msg, ifindex, sk); |
diff --git a/net/can/raw.c b/net/can/raw.c index 69877b8e7e9c..3e46ee36a1aa 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
632 | } else | 632 | } else |
633 | ifindex = ro->ifindex; | 633 | ifindex = ro->ifindex; |
634 | 634 | ||
635 | if (size != sizeof(struct can_frame)) | ||
636 | return -EINVAL; | ||
637 | |||
635 | dev = dev_get_by_index(&init_net, ifindex); | 638 | dev = dev_get_by_index(&init_net, ifindex); |
636 | if (!dev) | 639 | if (!dev) |
637 | return -ENXIO; | 640 | return -ENXIO; |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 4b02d14e7ab9..e1600ad8fb0e 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1359,17 +1359,17 @@ static int check_leaf(struct trie *t, struct leaf *l, | |||
1359 | t->stats.semantic_match_miss++; | 1359 | t->stats.semantic_match_miss++; |
1360 | #endif | 1360 | #endif |
1361 | if (err <= 0) | 1361 | if (err <= 0) |
1362 | return plen; | 1362 | return err; |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | return -1; | 1365 | return 1; |
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, | 1368 | static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, |
1369 | struct fib_result *res) | 1369 | struct fib_result *res) |
1370 | { | 1370 | { |
1371 | struct trie *t = (struct trie *) tb->tb_data; | 1371 | struct trie *t = (struct trie *) tb->tb_data; |
1372 | int plen, ret = 0; | 1372 | int ret; |
1373 | struct node *n; | 1373 | struct node *n; |
1374 | struct tnode *pn; | 1374 | struct tnode *pn; |
1375 | int pos, bits; | 1375 | int pos, bits; |
@@ -1393,10 +1393,7 @@ static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, | |||
1393 | 1393 | ||
1394 | /* Just a leaf? */ | 1394 | /* Just a leaf? */ |
1395 | if (IS_LEAF(n)) { | 1395 | if (IS_LEAF(n)) { |
1396 | plen = check_leaf(t, (struct leaf *)n, key, flp, res); | 1396 | ret = check_leaf(t, (struct leaf *)n, key, flp, res); |
1397 | if (plen < 0) | ||
1398 | goto failed; | ||
1399 | ret = 0; | ||
1400 | goto found; | 1397 | goto found; |
1401 | } | 1398 | } |
1402 | 1399 | ||
@@ -1421,11 +1418,9 @@ static int fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, | |||
1421 | } | 1418 | } |
1422 | 1419 | ||
1423 | if (IS_LEAF(n)) { | 1420 | if (IS_LEAF(n)) { |
1424 | plen = check_leaf(t, (struct leaf *)n, key, flp, res); | 1421 | ret = check_leaf(t, (struct leaf *)n, key, flp, res); |
1425 | if (plen < 0) | 1422 | if (ret > 0) |
1426 | goto backtrace; | 1423 | goto backtrace; |
1427 | |||
1428 | ret = 0; | ||
1429 | goto found; | 1424 | goto found; |
1430 | } | 1425 | } |
1431 | 1426 | ||
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index 7750c97fde7b..ffeaffc3fffe 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
@@ -439,8 +439,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx, | |||
439 | unsigned int *len) | 439 | unsigned int *len) |
440 | { | 440 | { |
441 | unsigned long subid; | 441 | unsigned long subid; |
442 | unsigned int size; | ||
443 | unsigned long *optr; | 442 | unsigned long *optr; |
443 | size_t size; | ||
444 | 444 | ||
445 | size = eoc - ctx->pointer + 1; | 445 | size = eoc - ctx->pointer + 1; |
446 | 446 | ||
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 850825dc86e6..1d723de18686 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -255,6 +255,7 @@ | |||
255 | #include <linux/init.h> | 255 | #include <linux/init.h> |
256 | #include <linux/fs.h> | 256 | #include <linux/fs.h> |
257 | #include <linux/skbuff.h> | 257 | #include <linux/skbuff.h> |
258 | #include <linux/scatterlist.h> | ||
258 | #include <linux/splice.h> | 259 | #include <linux/splice.h> |
259 | #include <linux/net.h> | 260 | #include <linux/net.h> |
260 | #include <linux/socket.h> | 261 | #include <linux/socket.h> |
@@ -1208,7 +1209,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
1208 | return -ENOTCONN; | 1209 | return -ENOTCONN; |
1209 | while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) { | 1210 | while ((skb = tcp_recv_skb(sk, seq, &offset)) != NULL) { |
1210 | if (offset < skb->len) { | 1211 | if (offset < skb->len) { |
1211 | size_t used, len; | 1212 | int used; |
1213 | size_t len; | ||
1212 | 1214 | ||
1213 | len = skb->len - offset; | 1215 | len = skb->len - offset; |
1214 | /* Stop reading if we hit a patch of urgent data */ | 1216 | /* Stop reading if we hit a patch of urgent data */ |
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 5ff0ce6e9d39..7ddc30f0744f 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c | |||
@@ -224,7 +224,7 @@ static __init int tcpprobe_init(void) | |||
224 | if (bufsize < 0) | 224 | if (bufsize < 0) |
225 | return -EINVAL; | 225 | return -EINVAL; |
226 | 226 | ||
227 | tcp_probe.log = kcalloc(sizeof(struct tcp_log), bufsize, GFP_KERNEL); | 227 | tcp_probe.log = kcalloc(bufsize, sizeof(struct tcp_log), GFP_KERNEL); |
228 | if (!tcp_probe.log) | 228 | if (!tcp_probe.log) |
229 | goto err0; | 229 | goto err0; |
230 | 230 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 147588f4c7c0..ff61a5cdb0b3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -749,12 +749,12 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) | |||
749 | } | 749 | } |
750 | write_unlock_bh(&idev->lock); | 750 | write_unlock_bh(&idev->lock); |
751 | 751 | ||
752 | addrconf_del_timer(ifp); | ||
753 | |||
752 | ipv6_ifa_notify(RTM_DELADDR, ifp); | 754 | ipv6_ifa_notify(RTM_DELADDR, ifp); |
753 | 755 | ||
754 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp); | 756 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp); |
755 | 757 | ||
756 | addrconf_del_timer(ifp); | ||
757 | |||
758 | /* | 758 | /* |
759 | * Purge or update corresponding prefix | 759 | * Purge or update corresponding prefix |
760 | * | 760 | * |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 3cd1c993d52b..dcf94fdfb863 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -445,7 +445,7 @@ looped_back: | |||
445 | kfree_skb(skb); | 445 | kfree_skb(skb); |
446 | return -1; | 446 | return -1; |
447 | } | 447 | } |
448 | if (!ipv6_chk_home_addr(&init_net, addr)) { | 448 | if (!ipv6_chk_home_addr(dev_net(skb->dst->dev), addr)) { |
449 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), | 449 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), |
450 | IPSTATS_MIB_INADDRERRORS); | 450 | IPSTATS_MIB_INADDRERRORS); |
451 | kfree_skb(skb); | 451 | kfree_skb(skb); |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index 9e1fb82e3220..2f05ec1037ab 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
@@ -101,8 +101,8 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info) | |||
101 | 101 | ||
102 | hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, | 102 | hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, |
103 | &irda_nl_family, 0, IRDA_NL_CMD_GET_MODE); | 103 | &irda_nl_family, 0, IRDA_NL_CMD_GET_MODE); |
104 | if (IS_ERR(hdr)) { | 104 | if (hdr == NULL) { |
105 | ret = PTR_ERR(hdr); | 105 | ret = -EMSGSIZE; |
106 | goto err_out; | 106 | goto err_out; |
107 | } | 107 | } |
108 | 108 | ||
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 98c0b5e56ecc..df0836ff1a20 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -530,8 +530,6 @@ static int ieee80211_stop(struct net_device *dev) | |||
530 | local->sta_hw_scanning = 0; | 530 | local->sta_hw_scanning = 0; |
531 | } | 531 | } |
532 | 532 | ||
533 | flush_workqueue(local->hw.workqueue); | ||
534 | |||
535 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; | 533 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; |
536 | kfree(sdata->u.sta.extra_ie); | 534 | kfree(sdata->u.sta.extra_ie); |
537 | sdata->u.sta.extra_ie = NULL; | 535 | sdata->u.sta.extra_ie = NULL; |
@@ -555,6 +553,8 @@ static int ieee80211_stop(struct net_device *dev) | |||
555 | 553 | ||
556 | ieee80211_led_radio(local, 0); | 554 | ieee80211_led_radio(local, 0); |
557 | 555 | ||
556 | flush_workqueue(local->hw.workqueue); | ||
557 | |||
558 | tasklet_disable(&local->tx_pending_tasklet); | 558 | tasklet_disable(&local->tx_pending_tasklet); |
559 | tasklet_disable(&local->tasklet); | 559 | tasklet_disable(&local->tasklet); |
560 | } | 560 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 4d2b582dd055..b404537c0bcd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -547,15 +547,14 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
547 | sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf; | 547 | sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf; |
548 | } | 548 | } |
549 | 549 | ||
550 | netif_carrier_on(dev); | ||
551 | ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET; | 550 | ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET; |
552 | memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN); | 551 | memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN); |
553 | memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN); | 552 | memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN); |
554 | ieee80211_sta_send_associnfo(dev, ifsta); | 553 | ieee80211_sta_send_associnfo(dev, ifsta); |
555 | } else { | 554 | } else { |
555 | netif_carrier_off(dev); | ||
556 | ieee80211_sta_tear_down_BA_sessions(dev, ifsta->bssid); | 556 | ieee80211_sta_tear_down_BA_sessions(dev, ifsta->bssid); |
557 | ifsta->flags &= ~IEEE80211_STA_ASSOCIATED; | 557 | ifsta->flags &= ~IEEE80211_STA_ASSOCIATED; |
558 | netif_carrier_off(dev); | ||
559 | ieee80211_reset_erp_info(dev); | 558 | ieee80211_reset_erp_info(dev); |
560 | 559 | ||
561 | sdata->bss_conf.assoc_ht = 0; | 560 | sdata->bss_conf.assoc_ht = 0; |
@@ -569,6 +568,10 @@ static void ieee80211_set_associated(struct net_device *dev, | |||
569 | 568 | ||
570 | sdata->bss_conf.assoc = assoc; | 569 | sdata->bss_conf.assoc = assoc; |
571 | ieee80211_bss_info_change_notify(sdata, changed); | 570 | ieee80211_bss_info_change_notify(sdata, changed); |
571 | |||
572 | if (assoc) | ||
573 | netif_carrier_on(dev); | ||
574 | |||
572 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 575 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
573 | wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); | 576 | wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL); |
574 | } | 577 | } |
@@ -3611,8 +3614,10 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, | |||
3611 | spin_unlock_bh(&local->sta_bss_lock); | 3614 | spin_unlock_bh(&local->sta_bss_lock); |
3612 | 3615 | ||
3613 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 3616 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
3614 | printk(KERN_DEBUG " sta_find_ibss: selected %s current " | 3617 | if (found) |
3615 | "%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid)); | 3618 | printk(KERN_DEBUG " sta_find_ibss: selected %s current " |
3619 | "%s\n", print_mac(mac, bssid), | ||
3620 | print_mac(mac2, ifsta->bssid)); | ||
3616 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 3621 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
3617 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && | 3622 | if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && |
3618 | (bss = ieee80211_rx_bss_get(dev, bssid, | 3623 | (bss = ieee80211_rx_bss_get(dev, bssid, |
diff --git a/net/mac80211/rc80211_pid.h b/net/mac80211/rc80211_pid.h index 04afc13ed825..4ea7b97d1af1 100644 --- a/net/mac80211/rc80211_pid.h +++ b/net/mac80211/rc80211_pid.h | |||
@@ -141,7 +141,6 @@ struct rc_pid_events_file_info { | |||
141 | * rate behaviour values (lower means we should trust more what we learnt | 141 | * rate behaviour values (lower means we should trust more what we learnt |
142 | * about behaviour of rates, higher means we should trust more the natural | 142 | * about behaviour of rates, higher means we should trust more the natural |
143 | * ordering of rates) | 143 | * ordering of rates) |
144 | * @fast_start: if Y, push high rates right after initialization | ||
145 | */ | 144 | */ |
146 | struct rc_pid_debugfs_entries { | 145 | struct rc_pid_debugfs_entries { |
147 | struct dentry *dir; | 146 | struct dentry *dir; |
@@ -154,7 +153,6 @@ struct rc_pid_debugfs_entries { | |||
154 | struct dentry *sharpen_factor; | 153 | struct dentry *sharpen_factor; |
155 | struct dentry *sharpen_duration; | 154 | struct dentry *sharpen_duration; |
156 | struct dentry *norm_offset; | 155 | struct dentry *norm_offset; |
157 | struct dentry *fast_start; | ||
158 | }; | 156 | }; |
159 | 157 | ||
160 | void rate_control_pid_event_tx_status(struct rc_pid_event_buffer *buf, | 158 | void rate_control_pid_event_tx_status(struct rc_pid_event_buffer *buf, |
@@ -267,9 +265,6 @@ struct rc_pid_info { | |||
267 | /* Normalization offset. */ | 265 | /* Normalization offset. */ |
268 | unsigned int norm_offset; | 266 | unsigned int norm_offset; |
269 | 267 | ||
270 | /* Fast starst parameter. */ | ||
271 | unsigned int fast_start; | ||
272 | |||
273 | /* Rates information. */ | 268 | /* Rates information. */ |
274 | struct rc_pid_rateinfo *rinfo; | 269 | struct rc_pid_rateinfo *rinfo; |
275 | 270 | ||
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index a849b745bdb5..bcd27c1d7594 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c | |||
@@ -398,13 +398,25 @@ static void *rate_control_pid_alloc(struct ieee80211_local *local) | |||
398 | return NULL; | 398 | return NULL; |
399 | } | 399 | } |
400 | 400 | ||
401 | pinfo->target = RC_PID_TARGET_PF; | ||
402 | pinfo->sampling_period = RC_PID_INTERVAL; | ||
403 | pinfo->coeff_p = RC_PID_COEFF_P; | ||
404 | pinfo->coeff_i = RC_PID_COEFF_I; | ||
405 | pinfo->coeff_d = RC_PID_COEFF_D; | ||
406 | pinfo->smoothing_shift = RC_PID_SMOOTHING_SHIFT; | ||
407 | pinfo->sharpen_factor = RC_PID_SHARPENING_FACTOR; | ||
408 | pinfo->sharpen_duration = RC_PID_SHARPENING_DURATION; | ||
409 | pinfo->norm_offset = RC_PID_NORM_OFFSET; | ||
410 | pinfo->rinfo = rinfo; | ||
411 | pinfo->oldrate = 0; | ||
412 | |||
401 | /* Sort the rates. This is optimized for the most common case (i.e. | 413 | /* Sort the rates. This is optimized for the most common case (i.e. |
402 | * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed | 414 | * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed |
403 | * mapping too. */ | 415 | * mapping too. */ |
404 | for (i = 0; i < sband->n_bitrates; i++) { | 416 | for (i = 0; i < sband->n_bitrates; i++) { |
405 | rinfo[i].index = i; | 417 | rinfo[i].index = i; |
406 | rinfo[i].rev_index = i; | 418 | rinfo[i].rev_index = i; |
407 | if (pinfo->fast_start) | 419 | if (RC_PID_FAST_START) |
408 | rinfo[i].diff = 0; | 420 | rinfo[i].diff = 0; |
409 | else | 421 | else |
410 | rinfo[i].diff = i * pinfo->norm_offset; | 422 | rinfo[i].diff = i * pinfo->norm_offset; |
@@ -425,19 +437,6 @@ static void *rate_control_pid_alloc(struct ieee80211_local *local) | |||
425 | break; | 437 | break; |
426 | } | 438 | } |
427 | 439 | ||
428 | pinfo->target = RC_PID_TARGET_PF; | ||
429 | pinfo->sampling_period = RC_PID_INTERVAL; | ||
430 | pinfo->coeff_p = RC_PID_COEFF_P; | ||
431 | pinfo->coeff_i = RC_PID_COEFF_I; | ||
432 | pinfo->coeff_d = RC_PID_COEFF_D; | ||
433 | pinfo->smoothing_shift = RC_PID_SMOOTHING_SHIFT; | ||
434 | pinfo->sharpen_factor = RC_PID_SHARPENING_FACTOR; | ||
435 | pinfo->sharpen_duration = RC_PID_SHARPENING_DURATION; | ||
436 | pinfo->norm_offset = RC_PID_NORM_OFFSET; | ||
437 | pinfo->fast_start = RC_PID_FAST_START; | ||
438 | pinfo->rinfo = rinfo; | ||
439 | pinfo->oldrate = 0; | ||
440 | |||
441 | #ifdef CONFIG_MAC80211_DEBUGFS | 440 | #ifdef CONFIG_MAC80211_DEBUGFS |
442 | de = &pinfo->dentries; | 441 | de = &pinfo->dentries; |
443 | de->dir = debugfs_create_dir("rc80211_pid", | 442 | de->dir = debugfs_create_dir("rc80211_pid", |
@@ -465,9 +464,6 @@ static void *rate_control_pid_alloc(struct ieee80211_local *local) | |||
465 | de->norm_offset = debugfs_create_u32("norm_offset", | 464 | de->norm_offset = debugfs_create_u32("norm_offset", |
466 | S_IRUSR | S_IWUSR, de->dir, | 465 | S_IRUSR | S_IWUSR, de->dir, |
467 | &pinfo->norm_offset); | 466 | &pinfo->norm_offset); |
468 | de->fast_start = debugfs_create_bool("fast_start", | ||
469 | S_IRUSR | S_IWUSR, de->dir, | ||
470 | &pinfo->fast_start); | ||
471 | #endif | 467 | #endif |
472 | 468 | ||
473 | return pinfo; | 469 | return pinfo; |
@@ -479,7 +475,6 @@ static void rate_control_pid_free(void *priv) | |||
479 | #ifdef CONFIG_MAC80211_DEBUGFS | 475 | #ifdef CONFIG_MAC80211_DEBUGFS |
480 | struct rc_pid_debugfs_entries *de = &pinfo->dentries; | 476 | struct rc_pid_debugfs_entries *de = &pinfo->dentries; |
481 | 477 | ||
482 | debugfs_remove(de->fast_start); | ||
483 | debugfs_remove(de->norm_offset); | 478 | debugfs_remove(de->norm_offset); |
484 | debugfs_remove(de->sharpen_duration); | 479 | debugfs_remove(de->sharpen_duration); |
485 | debugfs_remove(de->sharpen_factor); | 480 | debugfs_remove(de->sharpen_factor); |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 271cd01d57ae..dd28fb239a60 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -844,9 +844,15 @@ static int tcp_packet(struct nf_conn *ct, | |||
844 | /* Attempt to reopen a closed/aborted connection. | 844 | /* Attempt to reopen a closed/aborted connection. |
845 | * Delete this connection and look up again. */ | 845 | * Delete this connection and look up again. */ |
846 | write_unlock_bh(&tcp_lock); | 846 | write_unlock_bh(&tcp_lock); |
847 | if (del_timer(&ct->timeout)) | 847 | /* Only repeat if we can actually remove the timer. |
848 | * Destruction may already be in progress in process | ||
849 | * context and we must give it a chance to terminate. | ||
850 | */ | ||
851 | if (del_timer(&ct->timeout)) { | ||
848 | ct->timeout.function((unsigned long)ct); | 852 | ct->timeout.function((unsigned long)ct); |
849 | return -NF_REPEAT; | 853 | return -NF_REPEAT; |
854 | } | ||
855 | return -NF_DROP; | ||
850 | } | 856 | } |
851 | /* Fall through */ | 857 | /* Fall through */ |
852 | case TCP_CONNTRACK_IGNORE: | 858 | case TCP_CONNTRACK_IGNORE: |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index fdc14a0d21af..9080c61b71a5 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -584,12 +584,7 @@ list_start: | |||
584 | rcu_read_unlock(); | 584 | rcu_read_unlock(); |
585 | 585 | ||
586 | genlmsg_end(ans_skb, data); | 586 | genlmsg_end(ans_skb, data); |
587 | 587 | return genlmsg_reply(ans_skb, info); | |
588 | ret_val = genlmsg_reply(ans_skb, info); | ||
589 | if (ret_val != 0) | ||
590 | goto list_failure; | ||
591 | |||
592 | return 0; | ||
593 | 588 | ||
594 | list_retry: | 589 | list_retry: |
595 | /* XXX - this limit is a guesstimate */ | 590 | /* XXX - this limit is a guesstimate */ |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 22c191267808..44be5d5261f4 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -386,11 +386,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info) | |||
386 | rcu_read_unlock(); | 386 | rcu_read_unlock(); |
387 | 387 | ||
388 | genlmsg_end(ans_skb, data); | 388 | genlmsg_end(ans_skb, data); |
389 | 389 | return genlmsg_reply(ans_skb, info); | |
390 | ret_val = genlmsg_reply(ans_skb, info); | ||
391 | if (ret_val != 0) | ||
392 | goto listdef_failure; | ||
393 | return 0; | ||
394 | 390 | ||
395 | listdef_failure_lock: | 391 | listdef_failure_lock: |
396 | rcu_read_unlock(); | 392 | rcu_read_unlock(); |
@@ -501,11 +497,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info) | |||
501 | goto version_failure; | 497 | goto version_failure; |
502 | 498 | ||
503 | genlmsg_end(ans_skb, data); | 499 | genlmsg_end(ans_skb, data); |
504 | 500 | return genlmsg_reply(ans_skb, info); | |
505 | ret_val = genlmsg_reply(ans_skb, info); | ||
506 | if (ret_val != 0) | ||
507 | goto version_failure; | ||
508 | return 0; | ||
509 | 501 | ||
510 | version_failure: | 502 | version_failure: |
511 | kfree_skb(ans_skb); | 503 | kfree_skb(ans_skb); |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 52b2611a6eb6..56f80872924e 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -1107,11 +1107,7 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info) | |||
1107 | goto list_failure; | 1107 | goto list_failure; |
1108 | 1108 | ||
1109 | genlmsg_end(ans_skb, data); | 1109 | genlmsg_end(ans_skb, data); |
1110 | 1110 | return genlmsg_reply(ans_skb, info); | |
1111 | ret_val = genlmsg_reply(ans_skb, info); | ||
1112 | if (ret_val != 0) | ||
1113 | goto list_failure; | ||
1114 | return 0; | ||
1115 | 1111 | ||
1116 | list_failure: | 1112 | list_failure: |
1117 | kfree_skb(ans_skb); | 1113 | kfree_skb(ans_skb); |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 0c9d5a6950fe..fcdb45d1071b 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -5899,12 +5899,6 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
5899 | return SCTP_IERROR_NO_DATA; | 5899 | return SCTP_IERROR_NO_DATA; |
5900 | } | 5900 | } |
5901 | 5901 | ||
5902 | /* If definately accepting the DATA chunk, record its TSN, otherwise | ||
5903 | * wait for renege processing. | ||
5904 | */ | ||
5905 | if (SCTP_CMD_CHUNK_ULP == deliver) | ||
5906 | sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); | ||
5907 | |||
5908 | chunk->data_accepted = 1; | 5902 | chunk->data_accepted = 1; |
5909 | 5903 | ||
5910 | /* Note: Some chunks may get overcounted (if we drop) or overcounted | 5904 | /* Note: Some chunks may get overcounted (if we drop) or overcounted |
@@ -5924,6 +5918,9 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
5924 | * and discard the DATA chunk. | 5918 | * and discard the DATA chunk. |
5925 | */ | 5919 | */ |
5926 | if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) { | 5920 | if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) { |
5921 | /* Mark tsn as received even though we drop it */ | ||
5922 | sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn)); | ||
5923 | |||
5927 | err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, | 5924 | err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, |
5928 | &data_hdr->stream, | 5925 | &data_hdr->stream, |
5929 | sizeof(data_hdr->stream)); | 5926 | sizeof(data_hdr->stream)); |
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c index ce6cda6b6994..a1f654aea268 100644 --- a/net/sctp/ulpevent.c +++ b/net/sctp/ulpevent.c | |||
@@ -710,6 +710,11 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, | |||
710 | if (!skb) | 710 | if (!skb) |
711 | goto fail; | 711 | goto fail; |
712 | 712 | ||
713 | /* Now that all memory allocations for this chunk succeeded, we | ||
714 | * can mark it as received so the tsn_map is updated correctly. | ||
715 | */ | ||
716 | sctp_tsnmap_mark(&asoc->peer.tsn_map, ntohl(chunk->subh.data_hdr->tsn)); | ||
717 | |||
713 | /* First calculate the padding, so we don't inadvertently | 718 | /* First calculate the padding, so we don't inadvertently |
714 | * pass up the wrong length to the user. | 719 | * pass up the wrong length to the user. |
715 | * | 720 | * |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 5905d56737d6..81ae3d62a0cc 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -1144,20 +1144,20 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
1144 | case RPC_GSS_SVC_NONE: | 1144 | case RPC_GSS_SVC_NONE: |
1145 | break; | 1145 | break; |
1146 | case RPC_GSS_SVC_INTEGRITY: | 1146 | case RPC_GSS_SVC_INTEGRITY: |
1147 | /* placeholders for length and seq. number: */ | ||
1148 | svc_putnl(resv, 0); | ||
1149 | svc_putnl(resv, 0); | ||
1147 | if (unwrap_integ_data(&rqstp->rq_arg, | 1150 | if (unwrap_integ_data(&rqstp->rq_arg, |
1148 | gc->gc_seq, rsci->mechctx)) | 1151 | gc->gc_seq, rsci->mechctx)) |
1149 | goto garbage_args; | 1152 | goto garbage_args; |
1153 | break; | ||
1154 | case RPC_GSS_SVC_PRIVACY: | ||
1150 | /* placeholders for length and seq. number: */ | 1155 | /* placeholders for length and seq. number: */ |
1151 | svc_putnl(resv, 0); | 1156 | svc_putnl(resv, 0); |
1152 | svc_putnl(resv, 0); | 1157 | svc_putnl(resv, 0); |
1153 | break; | ||
1154 | case RPC_GSS_SVC_PRIVACY: | ||
1155 | if (unwrap_priv_data(rqstp, &rqstp->rq_arg, | 1158 | if (unwrap_priv_data(rqstp, &rqstp->rq_arg, |
1156 | gc->gc_seq, rsci->mechctx)) | 1159 | gc->gc_seq, rsci->mechctx)) |
1157 | goto garbage_args; | 1160 | goto garbage_args; |
1158 | /* placeholders for length and seq. number: */ | ||
1159 | svc_putnl(resv, 0); | ||
1160 | svc_putnl(resv, 0); | ||
1161 | break; | 1161 | break; |
1162 | default: | 1162 | default: |
1163 | goto auth_err; | 1163 | goto auth_err; |
@@ -1170,8 +1170,6 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) | |||
1170 | goto out; | 1170 | goto out; |
1171 | } | 1171 | } |
1172 | garbage_args: | 1172 | garbage_args: |
1173 | /* Restore write pointer to its original value: */ | ||
1174 | xdr_ressize_check(rqstp, reject_stat); | ||
1175 | ret = SVC_GARBAGE; | 1173 | ret = SVC_GARBAGE; |
1176 | goto out; | 1174 | goto out; |
1177 | auth_err: | 1175 | auth_err: |
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 0517967a68bf..e6fb21b19b86 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -243,10 +243,10 @@ int rpcb_getport_sync(struct sockaddr_in *sin, u32 prog, u32 vers, int prot) | |||
243 | } | 243 | } |
244 | EXPORT_SYMBOL_GPL(rpcb_getport_sync); | 244 | EXPORT_SYMBOL_GPL(rpcb_getport_sync); |
245 | 245 | ||
246 | static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbind_args *map, int version) | 246 | static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbind_args *map, struct rpc_procinfo *proc) |
247 | { | 247 | { |
248 | struct rpc_message msg = { | 248 | struct rpc_message msg = { |
249 | .rpc_proc = rpcb_next_version[version].rpc_proc, | 249 | .rpc_proc = proc, |
250 | .rpc_argp = map, | 250 | .rpc_argp = map, |
251 | .rpc_resp = &map->r_port, | 251 | .rpc_resp = &map->r_port, |
252 | }; | 252 | }; |
@@ -271,6 +271,7 @@ static struct rpc_task *rpcb_call_async(struct rpc_clnt *rpcb_clnt, struct rpcbi | |||
271 | void rpcb_getport_async(struct rpc_task *task) | 271 | void rpcb_getport_async(struct rpc_task *task) |
272 | { | 272 | { |
273 | struct rpc_clnt *clnt = task->tk_client; | 273 | struct rpc_clnt *clnt = task->tk_client; |
274 | struct rpc_procinfo *proc; | ||
274 | u32 bind_version; | 275 | u32 bind_version; |
275 | struct rpc_xprt *xprt = task->tk_xprt; | 276 | struct rpc_xprt *xprt = task->tk_xprt; |
276 | struct rpc_clnt *rpcb_clnt; | 277 | struct rpc_clnt *rpcb_clnt; |
@@ -280,7 +281,6 @@ void rpcb_getport_async(struct rpc_task *task) | |||
280 | struct sockaddr *sap = (struct sockaddr *)&addr; | 281 | struct sockaddr *sap = (struct sockaddr *)&addr; |
281 | size_t salen; | 282 | size_t salen; |
282 | int status; | 283 | int status; |
283 | struct rpcb_info *info; | ||
284 | 284 | ||
285 | dprintk("RPC: %5u %s(%s, %u, %u, %d)\n", | 285 | dprintk("RPC: %5u %s(%s, %u, %u, %d)\n", |
286 | task->tk_pid, __func__, | 286 | task->tk_pid, __func__, |
@@ -313,10 +313,12 @@ void rpcb_getport_async(struct rpc_task *task) | |||
313 | /* Don't ever use rpcbind v2 for AF_INET6 requests */ | 313 | /* Don't ever use rpcbind v2 for AF_INET6 requests */ |
314 | switch (sap->sa_family) { | 314 | switch (sap->sa_family) { |
315 | case AF_INET: | 315 | case AF_INET: |
316 | info = rpcb_next_version; | 316 | proc = rpcb_next_version[xprt->bind_index].rpc_proc; |
317 | bind_version = rpcb_next_version[xprt->bind_index].rpc_vers; | ||
317 | break; | 318 | break; |
318 | case AF_INET6: | 319 | case AF_INET6: |
319 | info = rpcb_next_version6; | 320 | proc = rpcb_next_version6[xprt->bind_index].rpc_proc; |
321 | bind_version = rpcb_next_version6[xprt->bind_index].rpc_vers; | ||
320 | break; | 322 | break; |
321 | default: | 323 | default: |
322 | status = -EAFNOSUPPORT; | 324 | status = -EAFNOSUPPORT; |
@@ -324,14 +326,13 @@ void rpcb_getport_async(struct rpc_task *task) | |||
324 | task->tk_pid, __func__); | 326 | task->tk_pid, __func__); |
325 | goto bailout_nofree; | 327 | goto bailout_nofree; |
326 | } | 328 | } |
327 | if (info[xprt->bind_index].rpc_proc == NULL) { | 329 | if (proc == NULL) { |
328 | xprt->bind_index = 0; | 330 | xprt->bind_index = 0; |
329 | status = -EPFNOSUPPORT; | 331 | status = -EPFNOSUPPORT; |
330 | dprintk("RPC: %5u %s: no more getport versions available\n", | 332 | dprintk("RPC: %5u %s: no more getport versions available\n", |
331 | task->tk_pid, __func__); | 333 | task->tk_pid, __func__); |
332 | goto bailout_nofree; | 334 | goto bailout_nofree; |
333 | } | 335 | } |
334 | bind_version = info[xprt->bind_index].rpc_vers; | ||
335 | 336 | ||
336 | dprintk("RPC: %5u %s: trying rpcbind version %u\n", | 337 | dprintk("RPC: %5u %s: trying rpcbind version %u\n", |
337 | task->tk_pid, __func__, bind_version); | 338 | task->tk_pid, __func__, bind_version); |
@@ -361,22 +362,20 @@ void rpcb_getport_async(struct rpc_task *task) | |||
361 | map->r_addr = rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR); | 362 | map->r_addr = rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR); |
362 | map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */ | 363 | map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */ |
363 | 364 | ||
364 | child = rpcb_call_async(rpcb_clnt, map, xprt->bind_index); | 365 | child = rpcb_call_async(rpcb_clnt, map, proc); |
365 | rpc_release_client(rpcb_clnt); | 366 | rpc_release_client(rpcb_clnt); |
366 | if (IS_ERR(child)) { | 367 | if (IS_ERR(child)) { |
367 | status = -EIO; | 368 | status = -EIO; |
369 | /* rpcb_map_release() has freed the arguments */ | ||
368 | dprintk("RPC: %5u %s: rpc_run_task failed\n", | 370 | dprintk("RPC: %5u %s: rpc_run_task failed\n", |
369 | task->tk_pid, __func__); | 371 | task->tk_pid, __func__); |
370 | goto bailout; | 372 | goto bailout_nofree; |
371 | } | 373 | } |
372 | rpc_put_task(child); | 374 | rpc_put_task(child); |
373 | 375 | ||
374 | task->tk_xprt->stat.bind_count++; | 376 | task->tk_xprt->stat.bind_count++; |
375 | return; | 377 | return; |
376 | 378 | ||
377 | bailout: | ||
378 | kfree(map); | ||
379 | xprt_put(xprt); | ||
380 | bailout_nofree: | 379 | bailout_nofree: |
381 | rpcb_wake_rpcbind_waiters(xprt, status); | 380 | rpcb_wake_rpcbind_waiters(xprt, status); |
382 | bailout_nowake: | 381 | bailout_nowake: |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index b976d9ed10e4..04c41504f84c 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -277,9 +277,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * | |||
277 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); | 277 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); |
278 | x->props.flags = p->flags; | 278 | x->props.flags = p->flags; |
279 | 279 | ||
280 | if (!x->sel.family) | 280 | if (!x->sel.family && !(p->flags & XFRM_STATE_AF_UNSPEC)) |
281 | x->sel.family = p->family; | 281 | x->sel.family = p->family; |
282 | |||
283 | } | 282 | } |
284 | 283 | ||
285 | /* | 284 | /* |
diff --git a/security/commoncap.c b/security/commoncap.c index 5edabc7542ae..33d343308413 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -103,10 +103,16 @@ static inline int cap_inh_is_capped(void) | |||
103 | return (cap_capable(current, CAP_SETPCAP) != 0); | 103 | return (cap_capable(current, CAP_SETPCAP) != 0); |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline int cap_limit_ptraced_target(void) { return 1; } | ||
107 | |||
106 | #else /* ie., ndef CONFIG_SECURITY_FILE_CAPABILITIES */ | 108 | #else /* ie., ndef CONFIG_SECURITY_FILE_CAPABILITIES */ |
107 | 109 | ||
108 | static inline int cap_block_setpcap(struct task_struct *t) { return 0; } | 110 | static inline int cap_block_setpcap(struct task_struct *t) { return 0; } |
109 | static inline int cap_inh_is_capped(void) { return 1; } | 111 | static inline int cap_inh_is_capped(void) { return 1; } |
112 | static inline int cap_limit_ptraced_target(void) | ||
113 | { | ||
114 | return !capable(CAP_SETPCAP); | ||
115 | } | ||
110 | 116 | ||
111 | #endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */ | 117 | #endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */ |
112 | 118 | ||
@@ -342,9 +348,10 @@ void cap_bprm_apply_creds (struct linux_binprm *bprm, int unsafe) | |||
342 | bprm->e_uid = current->uid; | 348 | bprm->e_uid = current->uid; |
343 | bprm->e_gid = current->gid; | 349 | bprm->e_gid = current->gid; |
344 | } | 350 | } |
345 | if (!capable (CAP_SETPCAP)) { | 351 | if (cap_limit_ptraced_target()) { |
346 | new_permitted = cap_intersect (new_permitted, | 352 | new_permitted = |
347 | current->cap_permitted); | 353 | cap_intersect(new_permitted, |
354 | current->cap_permitted); | ||
348 | } | 355 | } |
349 | } | 356 | } |
350 | } | 357 | } |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index baf348834b66..ddd92cec78ed 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -222,7 +222,7 @@ static void devcgroup_destroy(struct cgroup_subsys *ss, | |||
222 | #define DEVCG_DENY 2 | 222 | #define DEVCG_DENY 2 |
223 | #define DEVCG_LIST 3 | 223 | #define DEVCG_LIST 3 |
224 | 224 | ||
225 | #define MAJMINLEN 10 | 225 | #define MAJMINLEN 13 |
226 | #define ACCLEN 4 | 226 | #define ACCLEN 4 |
227 | 227 | ||
228 | static void set_access(char *acc, short access) | 228 | static void set_access(char *acc, short access) |
@@ -254,7 +254,7 @@ static void set_majmin(char *str, unsigned m) | |||
254 | if (m == ~0) | 254 | if (m == ~0) |
255 | sprintf(str, "*"); | 255 | sprintf(str, "*"); |
256 | else | 256 | else |
257 | snprintf(str, MAJMINLEN, "%d", m); | 257 | snprintf(str, MAJMINLEN, "%u", m); |
258 | } | 258 | } |
259 | 259 | ||
260 | static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft, | 260 | static int devcgroup_seq_read(struct cgroup *cgroup, struct cftype *cft, |
@@ -300,7 +300,7 @@ static int may_access_whitelist(struct dev_cgroup *c, | |||
300 | continue; | 300 | continue; |
301 | if (whitem->minor != ~0 && whitem->minor != refwh->minor) | 301 | if (whitem->minor != ~0 && whitem->minor != refwh->minor) |
302 | continue; | 302 | continue; |
303 | if (refwh->access & (~(whitem->access | ACC_MASK))) | 303 | if (refwh->access & (~whitem->access)) |
304 | continue; | 304 | continue; |
305 | return 1; | 305 | return 1; |
306 | } | 306 | } |
@@ -382,6 +382,8 @@ static ssize_t devcgroup_access_write(struct cgroup *cgroup, struct cftype *cft, | |||
382 | case 'a': | 382 | case 'a': |
383 | wh.type = DEV_ALL; | 383 | wh.type = DEV_ALL; |
384 | wh.access = ACC_MASK; | 384 | wh.access = ACC_MASK; |
385 | wh.major = ~0; | ||
386 | wh.minor = ~0; | ||
385 | goto handle; | 387 | goto handle; |
386 | case 'b': | 388 | case 'b': |
387 | wh.type = DEV_BLOCK; | 389 | wh.type = DEV_BLOCK; |
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 1dcf9f3d1107..44589088941f 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -278,7 +278,7 @@ static void __kvm_ioapic_update_eoi(struct kvm_ioapic *ioapic, int gsi) | |||
278 | 278 | ||
279 | ent->fields.remote_irr = 0; | 279 | ent->fields.remote_irr = 0; |
280 | if (!ent->fields.mask && (ioapic->irr & (1 << gsi))) | 280 | if (!ent->fields.mask && (ioapic->irr & (1 << gsi))) |
281 | ioapic_deliver(ioapic, gsi); | 281 | ioapic_service(ioapic, gsi); |
282 | } | 282 | } |
283 | 283 | ||
284 | void kvm_ioapic_update_eoi(struct kvm *kvm, int vector) | 284 | void kvm_ioapic_update_eoi(struct kvm *kvm, int vector) |