diff options
167 files changed, 2625 insertions, 572 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/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/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..6476125363e0 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 |
@@ -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 = -rc9 |
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/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/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-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/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/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/md/raid5.c b/drivers/md/raid5.c index 54c8ee28fcc4..3b27df52456b 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/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/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/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-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/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/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..f90fe0c7373f 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -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..13c12ed22252 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
@@ -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..ead4772f0f27 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -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..0f48f2d99226 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -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/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/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/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/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/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/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> |
@@ -1628,9 +1628,11 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1628 | void **object; | 1628 | void **object; |
1629 | struct kmem_cache_cpu *c; | 1629 | struct kmem_cache_cpu *c; |
1630 | unsigned long flags; | 1630 | unsigned long flags; |
1631 | unsigned int objsize; | ||
1631 | 1632 | ||
1632 | local_irq_save(flags); | 1633 | local_irq_save(flags); |
1633 | c = get_cpu_slab(s, smp_processor_id()); | 1634 | c = get_cpu_slab(s, smp_processor_id()); |
1635 | objsize = c->objsize; | ||
1634 | if (unlikely(!c->freelist || !node_match(c, node))) | 1636 | if (unlikely(!c->freelist || !node_match(c, node))) |
1635 | 1637 | ||
1636 | object = __slab_alloc(s, gfpflags, node, addr, c); | 1638 | object = __slab_alloc(s, gfpflags, node, addr, c); |
@@ -1643,7 +1645,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1643 | local_irq_restore(flags); | 1645 | local_irq_restore(flags); |
1644 | 1646 | ||
1645 | if (unlikely((gfpflags & __GFP_ZERO) && object)) | 1647 | if (unlikely((gfpflags & __GFP_ZERO) && object)) |
1646 | memset(object, 0, c->objsize); | 1648 | memset(object, 0, objsize); |
1647 | 1649 | ||
1648 | return object; | 1650 | return object; |
1649 | } | 1651 | } |
@@ -2995,8 +2997,6 @@ void __init kmem_cache_init(void) | |||
2995 | create_kmalloc_cache(&kmalloc_caches[1], | 2997 | create_kmalloc_cache(&kmalloc_caches[1], |
2996 | "kmalloc-96", 96, GFP_KERNEL); | 2998 | "kmalloc-96", 96, GFP_KERNEL); |
2997 | caches++; | 2999 | caches++; |
2998 | } | ||
2999 | if (KMALLOC_MIN_SIZE <= 128) { | ||
3000 | create_kmalloc_cache(&kmalloc_caches[2], | 3000 | create_kmalloc_cache(&kmalloc_caches[2], |
3001 | "kmalloc-192", 192, GFP_KERNEL); | 3001 | "kmalloc-192", 192, GFP_KERNEL); |
3002 | caches++; | 3002 | caches++; |
@@ -3026,6 +3026,16 @@ void __init kmem_cache_init(void) | |||
3026 | for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) | 3026 | for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) |
3027 | size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW; | 3027 | size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW; |
3028 | 3028 | ||
3029 | if (KMALLOC_MIN_SIZE == 128) { | ||
3030 | /* | ||
3031 | * The 192 byte sized cache is not used if the alignment | ||
3032 | * is 128 byte. Redirect kmalloc to use the 256 byte cache | ||
3033 | * instead. | ||
3034 | */ | ||
3035 | for (i = 128 + 8; i <= 192; i += 8) | ||
3036 | size_index[(i - 1) / 8] = 8; | ||
3037 | } | ||
3038 | |||
3029 | slab_state = UP; | 3039 | slab_state = UP; |
3030 | 3040 | ||
3031 | /* Provide the correct kmalloc names now that the caches are up */ | 3041 | /* 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/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/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..fd764a0858d0 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -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) |