diff options
610 files changed, 11497 insertions, 5235 deletions
@@ -2380,8 +2380,8 @@ E: tmolina@cablespeed.com | |||
2380 | D: bug fixes, documentation, minor hackery | 2380 | D: bug fixes, documentation, minor hackery |
2381 | 2381 | ||
2382 | N: James Morris | 2382 | N: James Morris |
2383 | E: jmorris@redhat.com | 2383 | E: jmorris@namei.org |
2384 | W: http://www.intercode.com.au/jmorris/ | 2384 | W: http://namei.org/ |
2385 | D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec, | 2385 | D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec, |
2386 | D: Crypto API, general networking, miscellaneous. | 2386 | D: Crypto API, general networking, miscellaneous. |
2387 | S: PO Box 707 | 2387 | S: PO Box 707 |
@@ -2423,8 +2423,7 @@ S: Toronto, Ontario | |||
2423 | S: Canada | 2423 | S: Canada |
2424 | 2424 | ||
2425 | N: Zwane Mwaikambo | 2425 | N: Zwane Mwaikambo |
2426 | E: zwane@linuxpower.ca | 2426 | E: zwane@arm.linux.org.uk |
2427 | W: http://function.linuxpower.ca | ||
2428 | D: Various driver hacking | 2427 | D: Various driver hacking |
2429 | D: Lowlevel x86 kernel hacking | 2428 | D: Lowlevel x86 kernel hacking |
2430 | D: General debugging | 2429 | D: General debugging |
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index 6761a7b241a5..7f43b040311e 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches | |||
@@ -149,6 +149,11 @@ USB, framebuffer devices, the VFS, the SCSI subsystem, etc. See the | |||
149 | MAINTAINERS file for a mailing list that relates specifically to | 149 | MAINTAINERS file for a mailing list that relates specifically to |
150 | your change. | 150 | your change. |
151 | 151 | ||
152 | If changes affect userland-kernel interfaces, please send | ||
153 | the MAN-PAGES maintainer (as listed in the MAINTAINERS file) | ||
154 | a man-pages patch, or at least a notification of the change, | ||
155 | so that some information makes its way into the manual pages. | ||
156 | |||
152 | Even if the maintainer did not respond in step #4, make sure to ALWAYS | 157 | Even if the maintainer did not respond in step #4, make sure to ALWAYS |
153 | copy the maintainer when you change their code. | 158 | copy the maintainer when you change their code. |
154 | 159 | ||
diff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt index 4c115a7bb826..0acdc80c30c2 100644 --- a/Documentation/acpi-hotkey.txt +++ b/Documentation/acpi-hotkey.txt | |||
@@ -33,3 +33,6 @@ The result of the execution of this aml method is | |||
33 | attached to /proc/acpi/hotkey/poll_method, which is dnyamically | 33 | attached to /proc/acpi/hotkey/poll_method, which is dnyamically |
34 | created. Please use command "cat /proc/acpi/hotkey/polling_method" | 34 | created. Please use command "cat /proc/acpi/hotkey/polling_method" |
35 | to retrieve it. | 35 | to retrieve it. |
36 | |||
37 | Note: Use cmdline "acpi_generic_hotkey" to over-ride | ||
38 | loading any platform specific drivers. | ||
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt new file mode 100644 index 000000000000..b93b68e2b143 --- /dev/null +++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt | |||
@@ -0,0 +1,93 @@ | |||
1 | S3C24XX USB Host support | ||
2 | ======================== | ||
3 | |||
4 | |||
5 | |||
6 | Introduction | ||
7 | ------------ | ||
8 | |||
9 | This document details the S3C2410/S3C2440 in-built OHCI USB host support. | ||
10 | |||
11 | Configuration | ||
12 | ------------- | ||
13 | |||
14 | Enable at least the following kernel options: | ||
15 | |||
16 | menuconfig: | ||
17 | |||
18 | Device Drivers ---> | ||
19 | USB support ---> | ||
20 | <*> Support for Host-side USB | ||
21 | <*> OHCI HCD support | ||
22 | |||
23 | |||
24 | .config: | ||
25 | CONFIG_USB | ||
26 | CONFIG_USB_OHCI_HCD | ||
27 | |||
28 | |||
29 | Once these options are configured, the standard set of USB device | ||
30 | drivers can be configured and used. | ||
31 | |||
32 | |||
33 | Board Support | ||
34 | ------------- | ||
35 | |||
36 | The driver attaches to a platform device, which will need to be | ||
37 | added by the board specific support file in linux/arch/arm/mach-s3c2410, | ||
38 | such as mach-bast.c or mach-smdk2410.c | ||
39 | |||
40 | The platform device's platform_data field is only needed if the | ||
41 | board implements extra power control or over-current monitoring. | ||
42 | |||
43 | The OHCI driver does not ensure the state of the S3C2410's MISCCTRL | ||
44 | register, so if both ports are to be used for the host, then it is | ||
45 | the board support file's responsibility to ensure that the second | ||
46 | port is configured to be connected to the OHCI core. | ||
47 | |||
48 | |||
49 | Platform Data | ||
50 | ------------- | ||
51 | |||
52 | See linux/include/asm-arm/arch-s3c2410/usb-control.h for the | ||
53 | descriptions of the platform device data. An implementation | ||
54 | can be found in linux/arch/arm/mach-s3c2410/usb-simtec.c . | ||
55 | |||
56 | The `struct s3c2410_hcd_info` contains a pair of functions | ||
57 | that get called to enable over-current detection, and to | ||
58 | control the port power status. | ||
59 | |||
60 | The ports are numbered 0 and 1. | ||
61 | |||
62 | power_control: | ||
63 | |||
64 | Called to enable or disable the power on the port. | ||
65 | |||
66 | enable_oc: | ||
67 | |||
68 | Called to enable or disable the over-current monitoring. | ||
69 | This should claim or release the resources being used to | ||
70 | check the power condition on the port, such as an IRQ. | ||
71 | |||
72 | report_oc: | ||
73 | |||
74 | The OHCI driver fills this field in for the over-current code | ||
75 | to call when there is a change to the over-current state on | ||
76 | an port. The ports argument is a bitmask of 1 bit per port, | ||
77 | with bit X being 1 for an over-current on port X. | ||
78 | |||
79 | The function s3c2410_usb_report_oc() has been provided to | ||
80 | ensure this is called correctly. | ||
81 | |||
82 | port[x]: | ||
83 | |||
84 | This is struct describes each port, 0 or 1. The platform driver | ||
85 | should set the flags field of each port to S3C_HCDFLG_USED if | ||
86 | the port is enabled. | ||
87 | |||
88 | |||
89 | |||
90 | Document Author | ||
91 | --------------- | ||
92 | |||
93 | Ben Dooks, (c) 2005 Simtec Electronics | ||
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index b974cf595d01..96bea278bbf6 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -104,6 +104,7 @@ logo_*.c | |||
104 | logo_*_clut224.c | 104 | logo_*_clut224.c |
105 | logo_*_mono.c | 105 | logo_*_mono.c |
106 | lxdialog | 106 | lxdialog |
107 | mach-types | ||
107 | mach-types.h | 108 | mach-types.h |
108 | make_times_h | 109 | make_times_h |
109 | map | 110 | map |
diff --git a/Documentation/fb/vesafb.txt b/Documentation/fb/vesafb.txt index 814e2f56a6ad..62db6758d1c1 100644 --- a/Documentation/fb/vesafb.txt +++ b/Documentation/fb/vesafb.txt | |||
@@ -144,7 +144,21 @@ vgapal Use the standard vga registers for palette changes. | |||
144 | This is the default. | 144 | This is the default. |
145 | pmipal Use the protected mode interface for palette changes. | 145 | pmipal Use the protected mode interface for palette changes. |
146 | 146 | ||
147 | mtrr setup memory type range registers for the vesafb framebuffer. | 147 | mtrr:n setup memory type range registers for the vesafb framebuffer |
148 | where n: | ||
149 | 0 - disabled (equivalent to nomtrr) | ||
150 | 1 - uncachable | ||
151 | 2 - write-back | ||
152 | 3 - write-combining (default) | ||
153 | 4 - write-through | ||
154 | |||
155 | If you see the following in dmesg, choose the type that matches the | ||
156 | old one. In this example, use "mtrr:2". | ||
157 | ... | ||
158 | mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining | ||
159 | ... | ||
160 | |||
161 | nomtrr disable mtrr | ||
148 | 162 | ||
149 | vremap:n | 163 | vremap:n |
150 | remap 'n' MiB of video RAM. If 0 or not specified, remap memory | 164 | remap 'n' MiB of video RAM. If 0 or not specified, remap memory |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a998a8c2f95b..3d5cd7a09b2f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -159,6 +159,11 @@ running once the system is up. | |||
159 | 159 | ||
160 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT | 160 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT |
161 | 161 | ||
162 | acpi_generic_hotkey [HW,ACPI] | ||
163 | Allow consolidated generic hotkey driver to | ||
164 | over-ride platform specific driver. | ||
165 | See also Documentation/acpi-hotkey.txt. | ||
166 | |||
162 | ad1816= [HW,OSS] | 167 | ad1816= [HW,OSS] |
163 | Format: <io>,<irq>,<dma>,<dma2> | 168 | Format: <io>,<irq>,<dma>,<dma2> |
164 | See also Documentation/sound/oss/AD1816. | 169 | See also Documentation/sound/oss/AD1816. |
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt new file mode 100644 index 000000000000..0541fe1de704 --- /dev/null +++ b/Documentation/kprobes.txt | |||
@@ -0,0 +1,588 @@ | |||
1 | Title : Kernel Probes (Kprobes) | ||
2 | Authors : Jim Keniston <jkenisto@us.ibm.com> | ||
3 | : Prasanna S Panchamukhi <prasanna@in.ibm.com> | ||
4 | |||
5 | CONTENTS | ||
6 | |||
7 | 1. Concepts: Kprobes, Jprobes, Return Probes | ||
8 | 2. Architectures Supported | ||
9 | 3. Configuring Kprobes | ||
10 | 4. API Reference | ||
11 | 5. Kprobes Features and Limitations | ||
12 | 6. Probe Overhead | ||
13 | 7. TODO | ||
14 | 8. Kprobes Example | ||
15 | 9. Jprobes Example | ||
16 | 10. Kretprobes Example | ||
17 | |||
18 | 1. Concepts: Kprobes, Jprobes, Return Probes | ||
19 | |||
20 | Kprobes enables you to dynamically break into any kernel routine and | ||
21 | collect debugging and performance information non-disruptively. You | ||
22 | can trap at almost any kernel code address, specifying a handler | ||
23 | routine to be invoked when the breakpoint is hit. | ||
24 | |||
25 | There are currently three types of probes: kprobes, jprobes, and | ||
26 | kretprobes (also called return probes). A kprobe can be inserted | ||
27 | on virtually any instruction in the kernel. A jprobe is inserted at | ||
28 | the entry to a kernel function, and provides convenient access to the | ||
29 | function's arguments. A return probe fires when a specified function | ||
30 | returns. | ||
31 | |||
32 | In the typical case, Kprobes-based instrumentation is packaged as | ||
33 | a kernel module. The module's init function installs ("registers") | ||
34 | one or more probes, and the exit function unregisters them. A | ||
35 | registration function such as register_kprobe() specifies where | ||
36 | the probe is to be inserted and what handler is to be called when | ||
37 | the probe is hit. | ||
38 | |||
39 | The next three subsections explain how the different types of | ||
40 | probes work. They explain certain things that you'll need to | ||
41 | know in order to make the best use of Kprobes -- e.g., the | ||
42 | difference between a pre_handler and a post_handler, and how | ||
43 | to use the maxactive and nmissed fields of a kretprobe. But | ||
44 | if you're in a hurry to start using Kprobes, you can skip ahead | ||
45 | to section 2. | ||
46 | |||
47 | 1.1 How Does a Kprobe Work? | ||
48 | |||
49 | When a kprobe is registered, Kprobes makes a copy of the probed | ||
50 | instruction and replaces the first byte(s) of the probed instruction | ||
51 | with a breakpoint instruction (e.g., int3 on i386 and x86_64). | ||
52 | |||
53 | When a CPU hits the breakpoint instruction, a trap occurs, the CPU's | ||
54 | registers are saved, and control passes to Kprobes via the | ||
55 | notifier_call_chain mechanism. Kprobes executes the "pre_handler" | ||
56 | associated with the kprobe, passing the handler the addresses of the | ||
57 | kprobe struct and the saved registers. | ||
58 | |||
59 | Next, Kprobes single-steps its copy of the probed instruction. | ||
60 | (It would be simpler to single-step the actual instruction in place, | ||
61 | but then Kprobes would have to temporarily remove the breakpoint | ||
62 | instruction. This would open a small time window when another CPU | ||
63 | could sail right past the probepoint.) | ||
64 | |||
65 | After the instruction is single-stepped, Kprobes executes the | ||
66 | "post_handler," if any, that is associated with the kprobe. | ||
67 | Execution then continues with the instruction following the probepoint. | ||
68 | |||
69 | 1.2 How Does a Jprobe Work? | ||
70 | |||
71 | A jprobe is implemented using a kprobe that is placed on a function's | ||
72 | entry point. It employs a simple mirroring principle to allow | ||
73 | seamless access to the probed function's arguments. The jprobe | ||
74 | handler routine should have the same signature (arg list and return | ||
75 | type) as the function being probed, and must always end by calling | ||
76 | the Kprobes function jprobe_return(). | ||
77 | |||
78 | Here's how it works. When the probe is hit, Kprobes makes a copy of | ||
79 | the saved registers and a generous portion of the stack (see below). | ||
80 | Kprobes then points the saved instruction pointer at the jprobe's | ||
81 | handler routine, and returns from the trap. As a result, control | ||
82 | passes to the handler, which is presented with the same register and | ||
83 | stack contents as the probed function. When it is done, the handler | ||
84 | calls jprobe_return(), which traps again to restore the original stack | ||
85 | contents and processor state and switch to the probed function. | ||
86 | |||
87 | By convention, the callee owns its arguments, so gcc may produce code | ||
88 | that unexpectedly modifies that portion of the stack. This is why | ||
89 | Kprobes saves a copy of the stack and restores it after the jprobe | ||
90 | handler has run. Up to MAX_STACK_SIZE bytes are copied -- e.g., | ||
91 | 64 bytes on i386. | ||
92 | |||
93 | Note that the probed function's args may be passed on the stack | ||
94 | or in registers (e.g., for x86_64 or for an i386 fastcall function). | ||
95 | The jprobe will work in either case, so long as the handler's | ||
96 | prototype matches that of the probed function. | ||
97 | |||
98 | 1.3 How Does a Return Probe Work? | ||
99 | |||
100 | When you call register_kretprobe(), Kprobes establishes a kprobe at | ||
101 | the entry to the function. When the probed function is called and this | ||
102 | probe is hit, Kprobes saves a copy of the return address, and replaces | ||
103 | the return address with the address of a "trampoline." The trampoline | ||
104 | is an arbitrary piece of code -- typically just a nop instruction. | ||
105 | At boot time, Kprobes registers a kprobe at the trampoline. | ||
106 | |||
107 | When the probed function executes its return instruction, control | ||
108 | passes to the trampoline and that probe is hit. Kprobes' trampoline | ||
109 | handler calls the user-specified handler associated with the kretprobe, | ||
110 | then sets the saved instruction pointer to the saved return address, | ||
111 | and that's where execution resumes upon return from the trap. | ||
112 | |||
113 | While the probed function is executing, its return address is | ||
114 | stored in an object of type kretprobe_instance. Before calling | ||
115 | register_kretprobe(), the user sets the maxactive field of the | ||
116 | kretprobe struct to specify how many instances of the specified | ||
117 | function can be probed simultaneously. register_kretprobe() | ||
118 | pre-allocates the indicated number of kretprobe_instance objects. | ||
119 | |||
120 | For example, if the function is non-recursive and is called with a | ||
121 | spinlock held, maxactive = 1 should be enough. If the function is | ||
122 | non-recursive and can never relinquish the CPU (e.g., via a semaphore | ||
123 | or preemption), NR_CPUS should be enough. If maxactive <= 0, it is | ||
124 | set to a default value. If CONFIG_PREEMPT is enabled, the default | ||
125 | is max(10, 2*NR_CPUS). Otherwise, the default is NR_CPUS. | ||
126 | |||
127 | It's not a disaster if you set maxactive too low; you'll just miss | ||
128 | some probes. In the kretprobe struct, the nmissed field is set to | ||
129 | zero when the return probe is registered, and is incremented every | ||
130 | time the probed function is entered but there is no kretprobe_instance | ||
131 | object available for establishing the return probe. | ||
132 | |||
133 | 2. Architectures Supported | ||
134 | |||
135 | Kprobes, jprobes, and return probes are implemented on the following | ||
136 | architectures: | ||
137 | |||
138 | - i386 | ||
139 | - x86_64 (AMD-64, E64MT) | ||
140 | - ppc64 | ||
141 | - ia64 (Support for probes on certain instruction types is still in progress.) | ||
142 | - sparc64 (Return probes not yet implemented.) | ||
143 | |||
144 | 3. Configuring Kprobes | ||
145 | |||
146 | When configuring the kernel using make menuconfig/xconfig/oldconfig, | ||
147 | ensure that CONFIG_KPROBES is set to "y". Under "Kernel hacking", | ||
148 | look for "Kprobes". You may have to enable "Kernel debugging" | ||
149 | (CONFIG_DEBUG_KERNEL) before you can enable Kprobes. | ||
150 | |||
151 | You may also want to ensure that CONFIG_KALLSYMS and perhaps even | ||
152 | CONFIG_KALLSYMS_ALL are set to "y", since kallsyms_lookup_name() | ||
153 | is a handy, version-independent way to find a function's address. | ||
154 | |||
155 | If you need to insert a probe in the middle of a function, you may find | ||
156 | it useful to "Compile the kernel with debug info" (CONFIG_DEBUG_INFO), | ||
157 | so you can use "objdump -d -l vmlinux" to see the source-to-object | ||
158 | code mapping. | ||
159 | |||
160 | 4. API Reference | ||
161 | |||
162 | The Kprobes API includes a "register" function and an "unregister" | ||
163 | function for each type of probe. Here are terse, mini-man-page | ||
164 | specifications for these functions and the associated probe handlers | ||
165 | that you'll write. See the latter half of this document for examples. | ||
166 | |||
167 | 4.1 register_kprobe | ||
168 | |||
169 | #include <linux/kprobes.h> | ||
170 | int register_kprobe(struct kprobe *kp); | ||
171 | |||
172 | Sets a breakpoint at the address kp->addr. When the breakpoint is | ||
173 | hit, Kprobes calls kp->pre_handler. After the probed instruction | ||
174 | is single-stepped, Kprobe calls kp->post_handler. If a fault | ||
175 | occurs during execution of kp->pre_handler or kp->post_handler, | ||
176 | or during single-stepping of the probed instruction, Kprobes calls | ||
177 | kp->fault_handler. Any or all handlers can be NULL. | ||
178 | |||
179 | register_kprobe() returns 0 on success, or a negative errno otherwise. | ||
180 | |||
181 | User's pre-handler (kp->pre_handler): | ||
182 | #include <linux/kprobes.h> | ||
183 | #include <linux/ptrace.h> | ||
184 | int pre_handler(struct kprobe *p, struct pt_regs *regs); | ||
185 | |||
186 | Called with p pointing to the kprobe associated with the breakpoint, | ||
187 | and regs pointing to the struct containing the registers saved when | ||
188 | the breakpoint was hit. Return 0 here unless you're a Kprobes geek. | ||
189 | |||
190 | User's post-handler (kp->post_handler): | ||
191 | #include <linux/kprobes.h> | ||
192 | #include <linux/ptrace.h> | ||
193 | void post_handler(struct kprobe *p, struct pt_regs *regs, | ||
194 | unsigned long flags); | ||
195 | |||
196 | p and regs are as described for the pre_handler. flags always seems | ||
197 | to be zero. | ||
198 | |||
199 | User's fault-handler (kp->fault_handler): | ||
200 | #include <linux/kprobes.h> | ||
201 | #include <linux/ptrace.h> | ||
202 | int fault_handler(struct kprobe *p, struct pt_regs *regs, int trapnr); | ||
203 | |||
204 | p and regs are as described for the pre_handler. trapnr is the | ||
205 | architecture-specific trap number associated with the fault (e.g., | ||
206 | on i386, 13 for a general protection fault or 14 for a page fault). | ||
207 | Returns 1 if it successfully handled the exception. | ||
208 | |||
209 | 4.2 register_jprobe | ||
210 | |||
211 | #include <linux/kprobes.h> | ||
212 | int register_jprobe(struct jprobe *jp) | ||
213 | |||
214 | Sets a breakpoint at the address jp->kp.addr, which must be the address | ||
215 | of the first instruction of a function. When the breakpoint is hit, | ||
216 | Kprobes runs the handler whose address is jp->entry. | ||
217 | |||
218 | The handler should have the same arg list and return type as the probed | ||
219 | function; and just before it returns, it must call jprobe_return(). | ||
220 | (The handler never actually returns, since jprobe_return() returns | ||
221 | control to Kprobes.) If the probed function is declared asmlinkage, | ||
222 | fastcall, or anything else that affects how args are passed, the | ||
223 | handler's declaration must match. | ||
224 | |||
225 | register_jprobe() returns 0 on success, or a negative errno otherwise. | ||
226 | |||
227 | 4.3 register_kretprobe | ||
228 | |||
229 | #include <linux/kprobes.h> | ||
230 | int register_kretprobe(struct kretprobe *rp); | ||
231 | |||
232 | Establishes a return probe for the function whose address is | ||
233 | rp->kp.addr. When that function returns, Kprobes calls rp->handler. | ||
234 | You must set rp->maxactive appropriately before you call | ||
235 | register_kretprobe(); see "How Does a Return Probe Work?" for details. | ||
236 | |||
237 | register_kretprobe() returns 0 on success, or a negative errno | ||
238 | otherwise. | ||
239 | |||
240 | User's return-probe handler (rp->handler): | ||
241 | #include <linux/kprobes.h> | ||
242 | #include <linux/ptrace.h> | ||
243 | int kretprobe_handler(struct kretprobe_instance *ri, struct pt_regs *regs); | ||
244 | |||
245 | regs is as described for kprobe.pre_handler. ri points to the | ||
246 | kretprobe_instance object, of which the following fields may be | ||
247 | of interest: | ||
248 | - ret_addr: the return address | ||
249 | - rp: points to the corresponding kretprobe object | ||
250 | - task: points to the corresponding task struct | ||
251 | The handler's return value is currently ignored. | ||
252 | |||
253 | 4.4 unregister_*probe | ||
254 | |||
255 | #include <linux/kprobes.h> | ||
256 | void unregister_kprobe(struct kprobe *kp); | ||
257 | void unregister_jprobe(struct jprobe *jp); | ||
258 | void unregister_kretprobe(struct kretprobe *rp); | ||
259 | |||
260 | Removes the specified probe. The unregister function can be called | ||
261 | at any time after the probe has been registered. | ||
262 | |||
263 | 5. Kprobes Features and Limitations | ||
264 | |||
265 | As of Linux v2.6.12, Kprobes allows multiple probes at the same | ||
266 | address. Currently, however, there cannot be multiple jprobes on | ||
267 | the same function at the same time. | ||
268 | |||
269 | In general, you can install a probe anywhere in the kernel. | ||
270 | In particular, you can probe interrupt handlers. Known exceptions | ||
271 | are discussed in this section. | ||
272 | |||
273 | For obvious reasons, it's a bad idea to install a probe in | ||
274 | the code that implements Kprobes (mostly kernel/kprobes.c and | ||
275 | arch/*/kernel/kprobes.c). A patch in the v2.6.13 timeframe instructs | ||
276 | Kprobes to reject such requests. | ||
277 | |||
278 | If you install a probe in an inline-able function, Kprobes makes | ||
279 | no attempt to chase down all inline instances of the function and | ||
280 | install probes there. gcc may inline a function without being asked, | ||
281 | so keep this in mind if you're not seeing the probe hits you expect. | ||
282 | |||
283 | A probe handler can modify the environment of the probed function | ||
284 | -- e.g., by modifying kernel data structures, or by modifying the | ||
285 | contents of the pt_regs struct (which are restored to the registers | ||
286 | upon return from the breakpoint). So Kprobes can be used, for example, | ||
287 | to install a bug fix or to inject faults for testing. Kprobes, of | ||
288 | course, has no way to distinguish the deliberately injected faults | ||
289 | from the accidental ones. Don't drink and probe. | ||
290 | |||
291 | Kprobes makes no attempt to prevent probe handlers from stepping on | ||
292 | each other -- e.g., probing printk() and then calling printk() from a | ||
293 | probe handler. As of Linux v2.6.12, if a probe handler hits a probe, | ||
294 | that second probe's handlers won't be run in that instance. | ||
295 | |||
296 | In Linux v2.6.12 and previous versions, Kprobes' data structures are | ||
297 | protected by a single lock that is held during probe registration and | ||
298 | unregistration and while handlers are run. Thus, no two handlers | ||
299 | can run simultaneously. To improve scalability on SMP systems, | ||
300 | this restriction will probably be removed soon, in which case | ||
301 | multiple handlers (or multiple instances of the same handler) may | ||
302 | run concurrently on different CPUs. Code your handlers accordingly. | ||
303 | |||
304 | Kprobes does not use semaphores or allocate memory except during | ||
305 | registration and unregistration. | ||
306 | |||
307 | Probe handlers are run with preemption disabled. Depending on the | ||
308 | architecture, handlers may also run with interrupts disabled. In any | ||
309 | case, your handler should not yield the CPU (e.g., by attempting to | ||
310 | acquire a semaphore). | ||
311 | |||
312 | Since a return probe is implemented by replacing the return | ||
313 | address with the trampoline's address, stack backtraces and calls | ||
314 | to __builtin_return_address() will typically yield the trampoline's | ||
315 | address instead of the real return address for kretprobed functions. | ||
316 | (As far as we can tell, __builtin_return_address() is used only | ||
317 | for instrumentation and error reporting.) | ||
318 | |||
319 | If the number of times a function is called does not match the | ||
320 | number of times it returns, registering a return probe on that | ||
321 | function may produce undesirable results. We have the do_exit() | ||
322 | and do_execve() cases covered. do_fork() is not an issue. We're | ||
323 | unaware of other specific cases where this could be a problem. | ||
324 | |||
325 | 6. Probe Overhead | ||
326 | |||
327 | On a typical CPU in use in 2005, a kprobe hit takes 0.5 to 1.0 | ||
328 | microseconds to process. Specifically, a benchmark that hits the same | ||
329 | probepoint repeatedly, firing a simple handler each time, reports 1-2 | ||
330 | million hits per second, depending on the architecture. A jprobe or | ||
331 | return-probe hit typically takes 50-75% longer than a kprobe hit. | ||
332 | When you have a return probe set on a function, adding a kprobe at | ||
333 | the entry to that function adds essentially no overhead. | ||
334 | |||
335 | Here are sample overhead figures (in usec) for different architectures. | ||
336 | k = kprobe; j = jprobe; r = return probe; kr = kprobe + return probe | ||
337 | on same function; jr = jprobe + return probe on same function | ||
338 | |||
339 | i386: Intel Pentium M, 1495 MHz, 2957.31 bogomips | ||
340 | k = 0.57 usec; j = 1.00; r = 0.92; kr = 0.99; jr = 1.40 | ||
341 | |||
342 | x86_64: AMD Opteron 246, 1994 MHz, 3971.48 bogomips | ||
343 | k = 0.49 usec; j = 0.76; r = 0.80; kr = 0.82; jr = 1.07 | ||
344 | |||
345 | ppc64: POWER5 (gr), 1656 MHz (SMT disabled, 1 virtual CPU per physical CPU) | ||
346 | k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99 | ||
347 | |||
348 | 7. TODO | ||
349 | |||
350 | a. SystemTap (http://sourceware.org/systemtap): Work in progress | ||
351 | to provide a simplified programming interface for probe-based | ||
352 | instrumentation. | ||
353 | b. Improved SMP scalability: Currently, work is in progress to handle | ||
354 | multiple kprobes in parallel. | ||
355 | c. Kernel return probes for sparc64. | ||
356 | d. Support for other architectures. | ||
357 | e. User-space probes. | ||
358 | |||
359 | 8. Kprobes Example | ||
360 | |||
361 | Here's a sample kernel module showing the use of kprobes to dump a | ||
362 | stack trace and selected i386 registers when do_fork() is called. | ||
363 | ----- cut here ----- | ||
364 | /*kprobe_example.c*/ | ||
365 | #include <linux/kernel.h> | ||
366 | #include <linux/module.h> | ||
367 | #include <linux/kprobes.h> | ||
368 | #include <linux/kallsyms.h> | ||
369 | #include <linux/sched.h> | ||
370 | |||
371 | /*For each probe you need to allocate a kprobe structure*/ | ||
372 | static struct kprobe kp; | ||
373 | |||
374 | /*kprobe pre_handler: called just before the probed instruction is executed*/ | ||
375 | int handler_pre(struct kprobe *p, struct pt_regs *regs) | ||
376 | { | ||
377 | printk("pre_handler: p->addr=0x%p, eip=%lx, eflags=0x%lx\n", | ||
378 | p->addr, regs->eip, regs->eflags); | ||
379 | dump_stack(); | ||
380 | return 0; | ||
381 | } | ||
382 | |||
383 | /*kprobe post_handler: called after the probed instruction is executed*/ | ||
384 | void handler_post(struct kprobe *p, struct pt_regs *regs, unsigned long flags) | ||
385 | { | ||
386 | printk("post_handler: p->addr=0x%p, eflags=0x%lx\n", | ||
387 | p->addr, regs->eflags); | ||
388 | } | ||
389 | |||
390 | /* fault_handler: this is called if an exception is generated for any | ||
391 | * instruction within the pre- or post-handler, or when Kprobes | ||
392 | * single-steps the probed instruction. | ||
393 | */ | ||
394 | int handler_fault(struct kprobe *p, struct pt_regs *regs, int trapnr) | ||
395 | { | ||
396 | printk("fault_handler: p->addr=0x%p, trap #%dn", | ||
397 | p->addr, trapnr); | ||
398 | /* Return 0 because we don't handle the fault. */ | ||
399 | return 0; | ||
400 | } | ||
401 | |||
402 | int init_module(void) | ||
403 | { | ||
404 | int ret; | ||
405 | kp.pre_handler = handler_pre; | ||
406 | kp.post_handler = handler_post; | ||
407 | kp.fault_handler = handler_fault; | ||
408 | kp.addr = (kprobe_opcode_t*) kallsyms_lookup_name("do_fork"); | ||
409 | /* register the kprobe now */ | ||
410 | if (!kp.addr) { | ||
411 | printk("Couldn't find %s to plant kprobe\n", "do_fork"); | ||
412 | return -1; | ||
413 | } | ||
414 | if ((ret = register_kprobe(&kp) < 0)) { | ||
415 | printk("register_kprobe failed, returned %d\n", ret); | ||
416 | return -1; | ||
417 | } | ||
418 | printk("kprobe registered\n"); | ||
419 | return 0; | ||
420 | } | ||
421 | |||
422 | void cleanup_module(void) | ||
423 | { | ||
424 | unregister_kprobe(&kp); | ||
425 | printk("kprobe unregistered\n"); | ||
426 | } | ||
427 | |||
428 | MODULE_LICENSE("GPL"); | ||
429 | ----- cut here ----- | ||
430 | |||
431 | You can build the kernel module, kprobe-example.ko, using the following | ||
432 | Makefile: | ||
433 | ----- cut here ----- | ||
434 | obj-m := kprobe-example.o | ||
435 | KDIR := /lib/modules/$(shell uname -r)/build | ||
436 | PWD := $(shell pwd) | ||
437 | default: | ||
438 | $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules | ||
439 | clean: | ||
440 | rm -f *.mod.c *.ko *.o | ||
441 | ----- cut here ----- | ||
442 | |||
443 | $ make | ||
444 | $ su - | ||
445 | ... | ||
446 | # insmod kprobe-example.ko | ||
447 | |||
448 | You will see the trace data in /var/log/messages and on the console | ||
449 | whenever do_fork() is invoked to create a new process. | ||
450 | |||
451 | 9. Jprobes Example | ||
452 | |||
453 | Here's a sample kernel module showing the use of jprobes to dump | ||
454 | the arguments of do_fork(). | ||
455 | ----- cut here ----- | ||
456 | /*jprobe-example.c */ | ||
457 | #include <linux/kernel.h> | ||
458 | #include <linux/module.h> | ||
459 | #include <linux/fs.h> | ||
460 | #include <linux/uio.h> | ||
461 | #include <linux/kprobes.h> | ||
462 | #include <linux/kallsyms.h> | ||
463 | |||
464 | /* | ||
465 | * Jumper probe for do_fork. | ||
466 | * Mirror principle enables access to arguments of the probed routine | ||
467 | * from the probe handler. | ||
468 | */ | ||
469 | |||
470 | /* Proxy routine having the same arguments as actual do_fork() routine */ | ||
471 | long jdo_fork(unsigned long clone_flags, unsigned long stack_start, | ||
472 | struct pt_regs *regs, unsigned long stack_size, | ||
473 | int __user * parent_tidptr, int __user * child_tidptr) | ||
474 | { | ||
475 | printk("jprobe: clone_flags=0x%lx, stack_size=0x%lx, regs=0x%p\n", | ||
476 | clone_flags, stack_size, regs); | ||
477 | /* Always end with a call to jprobe_return(). */ | ||
478 | jprobe_return(); | ||
479 | /*NOTREACHED*/ | ||
480 | return 0; | ||
481 | } | ||
482 | |||
483 | static struct jprobe my_jprobe = { | ||
484 | .entry = (kprobe_opcode_t *) jdo_fork | ||
485 | }; | ||
486 | |||
487 | int init_module(void) | ||
488 | { | ||
489 | int ret; | ||
490 | my_jprobe.kp.addr = (kprobe_opcode_t *) kallsyms_lookup_name("do_fork"); | ||
491 | if (!my_jprobe.kp.addr) { | ||
492 | printk("Couldn't find %s to plant jprobe\n", "do_fork"); | ||
493 | return -1; | ||
494 | } | ||
495 | |||
496 | if ((ret = register_jprobe(&my_jprobe)) <0) { | ||
497 | printk("register_jprobe failed, returned %d\n", ret); | ||
498 | return -1; | ||
499 | } | ||
500 | printk("Planted jprobe at %p, handler addr %p\n", | ||
501 | my_jprobe.kp.addr, my_jprobe.entry); | ||
502 | return 0; | ||
503 | } | ||
504 | |||
505 | void cleanup_module(void) | ||
506 | { | ||
507 | unregister_jprobe(&my_jprobe); | ||
508 | printk("jprobe unregistered\n"); | ||
509 | } | ||
510 | |||
511 | MODULE_LICENSE("GPL"); | ||
512 | ----- cut here ----- | ||
513 | |||
514 | Build and insert the kernel module as shown in the above kprobe | ||
515 | example. You will see the trace data in /var/log/messages and on | ||
516 | the console whenever do_fork() is invoked to create a new process. | ||
517 | (Some messages may be suppressed if syslogd is configured to | ||
518 | eliminate duplicate messages.) | ||
519 | |||
520 | 10. Kretprobes Example | ||
521 | |||
522 | Here's a sample kernel module showing the use of return probes to | ||
523 | report failed calls to sys_open(). | ||
524 | ----- cut here ----- | ||
525 | /*kretprobe-example.c*/ | ||
526 | #include <linux/kernel.h> | ||
527 | #include <linux/module.h> | ||
528 | #include <linux/kprobes.h> | ||
529 | #include <linux/kallsyms.h> | ||
530 | |||
531 | static const char *probed_func = "sys_open"; | ||
532 | |||
533 | /* Return-probe handler: If the probed function fails, log the return value. */ | ||
534 | static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs) | ||
535 | { | ||
536 | // Substitute the appropriate register name for your architecture -- | ||
537 | // e.g., regs->rax for x86_64, regs->gpr[3] for ppc64. | ||
538 | int retval = (int) regs->eax; | ||
539 | if (retval < 0) { | ||
540 | printk("%s returns %d\n", probed_func, retval); | ||
541 | } | ||
542 | return 0; | ||
543 | } | ||
544 | |||
545 | static struct kretprobe my_kretprobe = { | ||
546 | .handler = ret_handler, | ||
547 | /* Probe up to 20 instances concurrently. */ | ||
548 | .maxactive = 20 | ||
549 | }; | ||
550 | |||
551 | int init_module(void) | ||
552 | { | ||
553 | int ret; | ||
554 | my_kretprobe.kp.addr = | ||
555 | (kprobe_opcode_t *) kallsyms_lookup_name(probed_func); | ||
556 | if (!my_kretprobe.kp.addr) { | ||
557 | printk("Couldn't find %s to plant return probe\n", probed_func); | ||
558 | return -1; | ||
559 | } | ||
560 | if ((ret = register_kretprobe(&my_kretprobe)) < 0) { | ||
561 | printk("register_kretprobe failed, returned %d\n", ret); | ||
562 | return -1; | ||
563 | } | ||
564 | printk("Planted return probe at %p\n", my_kretprobe.kp.addr); | ||
565 | return 0; | ||
566 | } | ||
567 | |||
568 | void cleanup_module(void) | ||
569 | { | ||
570 | unregister_kretprobe(&my_kretprobe); | ||
571 | printk("kretprobe unregistered\n"); | ||
572 | /* nmissed > 0 suggests that maxactive was set too low. */ | ||
573 | printk("Missed probing %d instances of %s\n", | ||
574 | my_kretprobe.nmissed, probed_func); | ||
575 | } | ||
576 | |||
577 | MODULE_LICENSE("GPL"); | ||
578 | ----- cut here ----- | ||
579 | |||
580 | Build and insert the kernel module as shown in the above kprobe | ||
581 | example. You will see the trace data in /var/log/messages and on the | ||
582 | console whenever sys_open() returns a negative value. (Some messages | ||
583 | may be suppressed if syslogd is configured to eliminate duplicate | ||
584 | messages.) | ||
585 | |||
586 | For additional information on Kprobes, refer to the following URLs: | ||
587 | http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe | ||
588 | http://www.redhat.com/magazine/005mar05/features/kprobes/ | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 0bc2ed136a38..24d029455baa 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -1,5 +1,7 @@ | |||
1 | 1 | ||
2 | Linux Ethernet Bonding Driver HOWTO | 2 | Linux Ethernet Bonding Driver HOWTO |
3 | |||
4 | Latest update: 21 June 2005 | ||
3 | 5 | ||
4 | Initial release : Thomas Davis <tadavis at lbl.gov> | 6 | Initial release : Thomas Davis <tadavis at lbl.gov> |
5 | Corrections, HA extensions : 2000/10/03-15 : | 7 | Corrections, HA extensions : 2000/10/03-15 : |
@@ -11,15 +13,22 @@ Corrections, HA extensions : 2000/10/03-15 : | |||
11 | 13 | ||
12 | Reorganized and updated Feb 2005 by Jay Vosburgh | 14 | Reorganized and updated Feb 2005 by Jay Vosburgh |
13 | 15 | ||
14 | Note : | 16 | Introduction |
15 | ------ | 17 | ============ |
18 | |||
19 | The Linux bonding driver provides a method for aggregating | ||
20 | multiple network interfaces into a single logical "bonded" interface. | ||
21 | The behavior of the bonded interfaces depends upon the mode; generally | ||
22 | speaking, modes provide either hot standby or load balancing services. | ||
23 | Additionally, link integrity monitoring may be performed. | ||
16 | 24 | ||
17 | The bonding driver originally came from Donald Becker's beowulf patches for | 25 | The bonding driver originally came from Donald Becker's |
18 | kernel 2.0. It has changed quite a bit since, and the original tools from | 26 | beowulf patches for kernel 2.0. It has changed quite a bit since, and |
19 | extreme-linux and beowulf sites will not work with this version of the driver. | 27 | the original tools from extreme-linux and beowulf sites will not work |
28 | with this version of the driver. | ||
20 | 29 | ||
21 | For new versions of the driver, patches for older kernels and the updated | 30 | For new versions of the driver, updated userspace tools, and |
22 | userspace tools, please follow the links at the end of this file. | 31 | who to ask for help, please follow the links at the end of this file. |
23 | 32 | ||
24 | Table of Contents | 33 | Table of Contents |
25 | ================= | 34 | ================= |
@@ -30,9 +39,13 @@ Table of Contents | |||
30 | 39 | ||
31 | 3. Configuring Bonding Devices | 40 | 3. Configuring Bonding Devices |
32 | 3.1 Configuration with sysconfig support | 41 | 3.1 Configuration with sysconfig support |
42 | 3.1.1 Using DHCP with sysconfig | ||
43 | 3.1.2 Configuring Multiple Bonds with sysconfig | ||
33 | 3.2 Configuration with initscripts support | 44 | 3.2 Configuration with initscripts support |
45 | 3.2.1 Using DHCP with initscripts | ||
46 | 3.2.2 Configuring Multiple Bonds with initscripts | ||
34 | 3.3 Configuring Bonding Manually | 47 | 3.3 Configuring Bonding Manually |
35 | 3.4 Configuring Multiple Bonds | 48 | 3.3.1 Configuring Multiple Bonds Manually |
36 | 49 | ||
37 | 5. Querying Bonding Configuration | 50 | 5. Querying Bonding Configuration |
38 | 5.1 Bonding Configuration | 51 | 5.1 Bonding Configuration |
@@ -56,21 +69,30 @@ Table of Contents | |||
56 | 69 | ||
57 | 11. Promiscuous mode | 70 | 11. Promiscuous mode |
58 | 71 | ||
59 | 12. High Availability Information | 72 | 12. Configuring Bonding for High Availability |
60 | 12.1 High Availability in a Single Switch Topology | 73 | 12.1 High Availability in a Single Switch Topology |
61 | 12.1.1 Bonding Mode Selection for Single Switch Topology | ||
62 | 12.1.2 Link Monitoring for Single Switch Topology | ||
63 | 12.2 High Availability in a Multiple Switch Topology | 74 | 12.2 High Availability in a Multiple Switch Topology |
64 | 12.2.1 Bonding Mode Selection for Multiple Switch Topology | 75 | 12.2.1 HA Bonding Mode Selection for Multiple Switch Topology |
65 | 12.2.2 Link Monitoring for Multiple Switch Topology | 76 | 12.2.2 HA Link Monitoring for Multiple Switch Topology |
66 | 12.3 Switch Behavior Issues for High Availability | 77 | |
78 | 13. Configuring Bonding for Maximum Throughput | ||
79 | 13.1 Maximum Throughput in a Single Switch Topology | ||
80 | 13.1.1 MT Bonding Mode Selection for Single Switch Topology | ||
81 | 13.1.2 MT Link Monitoring for Single Switch Topology | ||
82 | 13.2 Maximum Throughput in a Multiple Switch Topology | ||
83 | 13.2.1 MT Bonding Mode Selection for Multiple Switch Topology | ||
84 | 13.2.2 MT Link Monitoring for Multiple Switch Topology | ||
67 | 85 | ||
68 | 13. Hardware Specific Considerations | 86 | 14. Switch Behavior Issues |
69 | 13.1 IBM BladeCenter | 87 | 14.1 Link Establishment and Failover Delays |
88 | 14.2 Duplicated Incoming Packets | ||
70 | 89 | ||
71 | 14. Frequently Asked Questions | 90 | 15. Hardware Specific Considerations |
91 | 15.1 IBM BladeCenter | ||
72 | 92 | ||
73 | 15. Resources and Links | 93 | 16. Frequently Asked Questions |
94 | |||
95 | 17. Resources and Links | ||
74 | 96 | ||
75 | 97 | ||
76 | 1. Bonding Driver Installation | 98 | 1. Bonding Driver Installation |
@@ -86,16 +108,10 @@ the following steps: | |||
86 | 1.1 Configure and build the kernel with bonding | 108 | 1.1 Configure and build the kernel with bonding |
87 | ----------------------------------------------- | 109 | ----------------------------------------------- |
88 | 110 | ||
89 | The latest version of the bonding driver is available in the | 111 | The current version of the bonding driver is available in the |
90 | drivers/net/bonding subdirectory of the most recent kernel source | 112 | drivers/net/bonding subdirectory of the most recent kernel source |
91 | (which is available on http://kernel.org). | 113 | (which is available on http://kernel.org). Most users "rolling their |
92 | 114 | own" will want to use the most recent kernel from kernel.org. | |
93 | Prior to the 2.4.11 kernel, the bonding driver was maintained | ||
94 | largely outside the kernel tree; patches for some earlier kernels are | ||
95 | available on the bonding sourceforge site, although those patches are | ||
96 | still several years out of date. Most users will want to use either | ||
97 | the most recent kernel from kernel.org or whatever kernel came with | ||
98 | their distro. | ||
99 | 115 | ||
100 | Configure kernel with "make menuconfig" (or "make xconfig" or | 116 | Configure kernel with "make menuconfig" (or "make xconfig" or |
101 | "make config"), then select "Bonding driver support" in the "Network | 117 | "make config"), then select "Bonding driver support" in the "Network |
@@ -103,8 +119,8 @@ device support" section. It is recommended that you configure the | |||
103 | driver as module since it is currently the only way to pass parameters | 119 | driver as module since it is currently the only way to pass parameters |
104 | to the driver or configure more than one bonding device. | 120 | to the driver or configure more than one bonding device. |
105 | 121 | ||
106 | Build and install the new kernel and modules, then proceed to | 122 | Build and install the new kernel and modules, then continue |
107 | step 2. | 123 | below to install ifenslave. |
108 | 124 | ||
109 | 1.2 Install ifenslave Control Utility | 125 | 1.2 Install ifenslave Control Utility |
110 | ------------------------------------- | 126 | ------------------------------------- |
@@ -147,9 +163,9 @@ default kernel source include directory. | |||
147 | Options for the bonding driver are supplied as parameters to | 163 | Options for the bonding driver are supplied as parameters to |
148 | the bonding module at load time. They may be given as command line | 164 | the bonding module at load time. They may be given as command line |
149 | arguments to the insmod or modprobe command, but are usually specified | 165 | arguments to the insmod or modprobe command, but are usually specified |
150 | in either the /etc/modprobe.conf configuration file, or in a | 166 | in either the /etc/modules.conf or /etc/modprobe.conf configuration |
151 | distro-specific configuration file (some of which are detailed in the | 167 | file, or in a distro-specific configuration file (some of which are |
152 | next section). | 168 | detailed in the next section). |
153 | 169 | ||
154 | The available bonding driver parameters are listed below. If a | 170 | The available bonding driver parameters are listed below. If a |
155 | parameter is not specified the default value is used. When initially | 171 | parameter is not specified the default value is used. When initially |
@@ -162,34 +178,34 @@ degradation will occur during link failures. Very few devices do not | |||
162 | support at least miimon, so there is really no reason not to use it. | 178 | support at least miimon, so there is really no reason not to use it. |
163 | 179 | ||
164 | Options with textual values will accept either the text name | 180 | Options with textual values will accept either the text name |
165 | or, for backwards compatibility, the option value. E.g., | 181 | or, for backwards compatibility, the option value. E.g., |
166 | "mode=802.3ad" and "mode=4" set the same mode. | 182 | "mode=802.3ad" and "mode=4" set the same mode. |
167 | 183 | ||
168 | The parameters are as follows: | 184 | The parameters are as follows: |
169 | 185 | ||
170 | arp_interval | 186 | arp_interval |
171 | 187 | ||
172 | Specifies the ARP monitoring frequency in milli-seconds. If | 188 | Specifies the ARP link monitoring frequency in milliseconds. |
173 | ARP monitoring is used in a load-balancing mode (mode 0 or 2), | 189 | If ARP monitoring is used in an etherchannel compatible mode |
174 | the switch should be configured in a mode that evenly | 190 | (modes 0 and 2), the switch should be configured in a mode |
175 | distributes packets across all links - such as round-robin. If | 191 | that evenly distributes packets across all links. If the |
176 | the switch is configured to distribute the packets in an XOR | 192 | switch is configured to distribute the packets in an XOR |
177 | fashion, all replies from the ARP targets will be received on | 193 | fashion, all replies from the ARP targets will be received on |
178 | the same link which could cause the other team members to | 194 | the same link which could cause the other team members to |
179 | fail. ARP monitoring should not be used in conjunction with | 195 | fail. ARP monitoring should not be used in conjunction with |
180 | miimon. A value of 0 disables ARP monitoring. The default | 196 | miimon. A value of 0 disables ARP monitoring. The default |
181 | value is 0. | 197 | value is 0. |
182 | 198 | ||
183 | arp_ip_target | 199 | arp_ip_target |
184 | 200 | ||
185 | Specifies the ip addresses to use when arp_interval is > 0. | 201 | Specifies the IP addresses to use as ARP monitoring peers when |
186 | These are the targets of the ARP request sent to determine the | 202 | arp_interval is > 0. These are the targets of the ARP request |
187 | health of the link to the targets. Specify these values in | 203 | sent to determine the health of the link to the targets. |
188 | ddd.ddd.ddd.ddd format. Multiple ip adresses must be | 204 | Specify these values in ddd.ddd.ddd.ddd format. Multiple IP |
189 | seperated by a comma. At least one IP address must be given | 205 | addresses must be separated by a comma. At least one IP |
190 | for ARP monitoring to function. The maximum number of targets | 206 | address must be given for ARP monitoring to function. The |
191 | that can be specified is 16. The default value is no IP | 207 | maximum number of targets that can be specified is 16. The |
192 | addresses. | 208 | default value is no IP addresses. |
193 | 209 | ||
194 | downdelay | 210 | downdelay |
195 | 211 | ||
@@ -207,11 +223,13 @@ lacp_rate | |||
207 | are: | 223 | are: |
208 | 224 | ||
209 | slow or 0 | 225 | slow or 0 |
210 | Request partner to transmit LACPDUs every 30 seconds (default) | 226 | Request partner to transmit LACPDUs every 30 seconds |
211 | 227 | ||
212 | fast or 1 | 228 | fast or 1 |
213 | Request partner to transmit LACPDUs every 1 second | 229 | Request partner to transmit LACPDUs every 1 second |
214 | 230 | ||
231 | The default is slow. | ||
232 | |||
215 | max_bonds | 233 | max_bonds |
216 | 234 | ||
217 | Specifies the number of bonding devices to create for this | 235 | Specifies the number of bonding devices to create for this |
@@ -221,10 +239,11 @@ max_bonds | |||
221 | 239 | ||
222 | miimon | 240 | miimon |
223 | 241 | ||
224 | Specifies the frequency in milli-seconds that MII link | 242 | Specifies the MII link monitoring frequency in milliseconds. |
225 | monitoring will occur. A value of zero disables MII link | 243 | This determines how often the link state of each slave is |
226 | monitoring. A value of 100 is a good starting point. The | 244 | inspected for link failures. A value of zero disables MII |
227 | use_carrier option, below, affects how the link state is | 245 | link monitoring. A value of 100 is a good starting point. |
246 | The use_carrier option, below, affects how the link state is | ||
228 | determined. See the High Availability section for additional | 247 | determined. See the High Availability section for additional |
229 | information. The default value is 0. | 248 | information. The default value is 0. |
230 | 249 | ||
@@ -246,17 +265,31 @@ mode | |||
246 | active. A different slave becomes active if, and only | 265 | active. A different slave becomes active if, and only |
247 | if, the active slave fails. The bond's MAC address is | 266 | if, the active slave fails. The bond's MAC address is |
248 | externally visible on only one port (network adapter) | 267 | externally visible on only one port (network adapter) |
249 | to avoid confusing the switch. This mode provides | 268 | to avoid confusing the switch. |
250 | fault tolerance. The primary option affects the | 269 | |
251 | behavior of this mode. | 270 | In bonding version 2.6.2 or later, when a failover |
271 | occurs in active-backup mode, bonding will issue one | ||
272 | or more gratuitous ARPs on the newly active slave. | ||
273 | One gratutious ARP is issued for the bonding master | ||
274 | interface and each VLAN interfaces configured above | ||
275 | it, provided that the interface has at least one IP | ||
276 | address configured. Gratuitous ARPs issued for VLAN | ||
277 | interfaces are tagged with the appropriate VLAN id. | ||
278 | |||
279 | This mode provides fault tolerance. The primary | ||
280 | option, documented below, affects the behavior of this | ||
281 | mode. | ||
252 | 282 | ||
253 | balance-xor or 2 | 283 | balance-xor or 2 |
254 | 284 | ||
255 | XOR policy: Transmit based on [(source MAC address | 285 | XOR policy: Transmit based on the selected transmit |
256 | XOR'd with destination MAC address) modulo slave | 286 | hash policy. The default policy is a simple [(source |
257 | count]. This selects the same slave for each | 287 | MAC address XOR'd with destination MAC address) modulo |
258 | destination MAC address. This mode provides load | 288 | slave count]. Alternate transmit policies may be |
259 | balancing and fault tolerance. | 289 | selected via the xmit_hash_policy option, described |
290 | below. | ||
291 | |||
292 | This mode provides load balancing and fault tolerance. | ||
260 | 293 | ||
261 | broadcast or 3 | 294 | broadcast or 3 |
262 | 295 | ||
@@ -270,7 +303,17 @@ mode | |||
270 | duplex settings. Utilizes all slaves in the active | 303 | duplex settings. Utilizes all slaves in the active |
271 | aggregator according to the 802.3ad specification. | 304 | aggregator according to the 802.3ad specification. |
272 | 305 | ||
273 | Pre-requisites: | 306 | Slave selection for outgoing traffic is done according |
307 | to the transmit hash policy, which may be changed from | ||
308 | the default simple XOR policy via the xmit_hash_policy | ||
309 | option, documented below. Note that not all transmit | ||
310 | policies may be 802.3ad compliant, particularly in | ||
311 | regards to the packet mis-ordering requirements of | ||
312 | section 43.2.4 of the 802.3ad standard. Differing | ||
313 | peer implementations will have varying tolerances for | ||
314 | noncompliance. | ||
315 | |||
316 | Prerequisites: | ||
274 | 317 | ||
275 | 1. Ethtool support in the base drivers for retrieving | 318 | 1. Ethtool support in the base drivers for retrieving |
276 | the speed and duplex of each slave. | 319 | the speed and duplex of each slave. |
@@ -333,7 +376,7 @@ mode | |||
333 | 376 | ||
334 | When a link is reconnected or a new slave joins the | 377 | When a link is reconnected or a new slave joins the |
335 | bond the receive traffic is redistributed among all | 378 | bond the receive traffic is redistributed among all |
336 | active slaves in the bond by intiating ARP Replies | 379 | active slaves in the bond by initiating ARP Replies |
337 | with the selected mac address to each of the | 380 | with the selected mac address to each of the |
338 | clients. The updelay parameter (detailed below) must | 381 | clients. The updelay parameter (detailed below) must |
339 | be set to a value equal or greater than the switch's | 382 | be set to a value equal or greater than the switch's |
@@ -396,6 +439,60 @@ use_carrier | |||
396 | 0 will use the deprecated MII / ETHTOOL ioctls. The default | 439 | 0 will use the deprecated MII / ETHTOOL ioctls. The default |
397 | value is 1. | 440 | value is 1. |
398 | 441 | ||
442 | xmit_hash_policy | ||
443 | |||
444 | Selects the transmit hash policy to use for slave selection in | ||
445 | balance-xor and 802.3ad modes. Possible values are: | ||
446 | |||
447 | layer2 | ||
448 | |||
449 | Uses XOR of hardware MAC addresses to generate the | ||
450 | hash. The formula is | ||
451 | |||
452 | (source MAC XOR destination MAC) modulo slave count | ||
453 | |||
454 | This algorithm will place all traffic to a particular | ||
455 | network peer on the same slave. | ||
456 | |||
457 | This algorithm is 802.3ad compliant. | ||
458 | |||
459 | layer3+4 | ||
460 | |||
461 | This policy uses upper layer protocol information, | ||
462 | when available, to generate the hash. This allows for | ||
463 | traffic to a particular network peer to span multiple | ||
464 | slaves, although a single connection will not span | ||
465 | multiple slaves. | ||
466 | |||
467 | The formula for unfragmented TCP and UDP packets is | ||
468 | |||
469 | ((source port XOR dest port) XOR | ||
470 | ((source IP XOR dest IP) AND 0xffff) | ||
471 | modulo slave count | ||
472 | |||
473 | For fragmented TCP or UDP packets and all other IP | ||
474 | protocol traffic, the source and destination port | ||
475 | information is omitted. For non-IP traffic, the | ||
476 | formula is the same as for the layer2 transmit hash | ||
477 | policy. | ||
478 | |||
479 | This policy is intended to mimic the behavior of | ||
480 | certain switches, notably Cisco switches with PFC2 as | ||
481 | well as some Foundry and IBM products. | ||
482 | |||
483 | This algorithm is not fully 802.3ad compliant. A | ||
484 | single TCP or UDP conversation containing both | ||
485 | fragmented and unfragmented packets will see packets | ||
486 | striped across two interfaces. This may result in out | ||
487 | of order delivery. Most traffic types will not meet | ||
488 | this criteria, as TCP rarely fragments traffic, and | ||
489 | most UDP traffic is not involved in extended | ||
490 | conversations. Other implementations of 802.3ad may | ||
491 | or may not tolerate this noncompliance. | ||
492 | |||
493 | The default value is layer2. This option was added in bonding | ||
494 | version 2.6.3. In earlier versions of bonding, this parameter does | ||
495 | not exist, and the layer2 policy is the only policy. | ||
399 | 496 | ||
400 | 497 | ||
401 | 3. Configuring Bonding Devices | 498 | 3. Configuring Bonding Devices |
@@ -448,8 +545,9 @@ Bonding devices can be managed by hand, however, as follows. | |||
448 | slave devices. On SLES 9, this is most easily done by running the | 545 | slave devices. On SLES 9, this is most easily done by running the |
449 | yast2 sysconfig configuration utility. The goal is for to create an | 546 | yast2 sysconfig configuration utility. The goal is for to create an |
450 | ifcfg-id file for each slave device. The simplest way to accomplish | 547 | ifcfg-id file for each slave device. The simplest way to accomplish |
451 | this is to configure the devices for DHCP. The name of the | 548 | this is to configure the devices for DHCP (this is only to get the |
452 | configuration file for each device will be of the form: | 549 | file ifcfg-id file created; see below for some issues with DHCP). The |
550 | name of the configuration file for each device will be of the form: | ||
453 | 551 | ||
454 | ifcfg-id-xx:xx:xx:xx:xx:xx | 552 | ifcfg-id-xx:xx:xx:xx:xx:xx |
455 | 553 | ||
@@ -459,7 +557,7 @@ the device's permanent MAC address. | |||
459 | Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been | 557 | Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been |
460 | created, it is necessary to edit the configuration files for the slave | 558 | created, it is necessary to edit the configuration files for the slave |
461 | devices (the MAC addresses correspond to those of the slave devices). | 559 | devices (the MAC addresses correspond to those of the slave devices). |
462 | Before editing, the file will contain muliple lines, and will look | 560 | Before editing, the file will contain multiple lines, and will look |
463 | something like this: | 561 | something like this: |
464 | 562 | ||
465 | BOOTPROTO='dhcp' | 563 | BOOTPROTO='dhcp' |
@@ -496,16 +594,11 @@ STARTMODE="onboot" | |||
496 | BONDING_MASTER="yes" | 594 | BONDING_MASTER="yes" |
497 | BONDING_MODULE_OPTS="mode=active-backup miimon=100" | 595 | BONDING_MODULE_OPTS="mode=active-backup miimon=100" |
498 | BONDING_SLAVE0="eth0" | 596 | BONDING_SLAVE0="eth0" |
499 | BONDING_SLAVE1="eth1" | 597 | BONDING_SLAVE1="bus-pci-0000:06:08.1" |
500 | 598 | ||
501 | Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK | 599 | Replace the sample BROADCAST, IPADDR, NETMASK and NETWORK |
502 | values with the appropriate values for your network. | 600 | values with the appropriate values for your network. |
503 | 601 | ||
504 | Note that configuring the bonding device with BOOTPROTO='dhcp' | ||
505 | does not work; the scripts attempt to obtain the device address from | ||
506 | DHCP prior to adding any of the slave devices. Without active slaves, | ||
507 | the DHCP requests are not sent to the network. | ||
508 | |||
509 | The STARTMODE specifies when the device is brought online. | 602 | The STARTMODE specifies when the device is brought online. |
510 | The possible values are: | 603 | The possible values are: |
511 | 604 | ||
@@ -531,9 +624,17 @@ for the bonding mode, link monitoring, and so on here. Do not include | |||
531 | the max_bonds bonding parameter; this will confuse the configuration | 624 | the max_bonds bonding parameter; this will confuse the configuration |
532 | system if you have multiple bonding devices. | 625 | system if you have multiple bonding devices. |
533 | 626 | ||
534 | Finally, supply one BONDING_SLAVEn="ethX" for each slave, | 627 | Finally, supply one BONDING_SLAVEn="slave device" for each |
535 | where "n" is an increasing value, one for each slave, and "ethX" is | 628 | slave. where "n" is an increasing value, one for each slave. The |
536 | the name of the slave device (eth0, eth1, etc). | 629 | "slave device" is either an interface name, e.g., "eth0", or a device |
630 | specifier for the network device. The interface name is easier to | ||
631 | find, but the ethN names are subject to change at boot time if, e.g., | ||
632 | a device early in the sequence has failed. The device specifiers | ||
633 | (bus-pci-0000:06:08.1 in the example above) specify the physical | ||
634 | network device, and will not change unless the device's bus location | ||
635 | changes (for example, it is moved from one PCI slot to another). The | ||
636 | example above uses one of each type for demonstration purposes; most | ||
637 | configurations will choose one or the other for all slave devices. | ||
537 | 638 | ||
538 | When all configuration files have been modified or created, | 639 | When all configuration files have been modified or created, |
539 | networking must be restarted for the configuration changes to take | 640 | networking must be restarted for the configuration changes to take |
@@ -544,7 +645,7 @@ effect. This can be accomplished via the following: | |||
544 | Note that the network control script (/sbin/ifdown) will | 645 | Note that the network control script (/sbin/ifdown) will |
545 | remove the bonding module as part of the network shutdown processing, | 646 | remove the bonding module as part of the network shutdown processing, |
546 | so it is not necessary to remove the module by hand if, e.g., the | 647 | so it is not necessary to remove the module by hand if, e.g., the |
547 | module paramters have changed. | 648 | module parameters have changed. |
548 | 649 | ||
549 | Also, at this writing, YaST/YaST2 will not manage bonding | 650 | Also, at this writing, YaST/YaST2 will not manage bonding |
550 | devices (they do not show bonding interfaces on its list of network | 651 | devices (they do not show bonding interfaces on its list of network |
@@ -559,12 +660,37 @@ format can be found in an example ifcfg template file: | |||
559 | Note that the template does not document the various BONDING_ | 660 | Note that the template does not document the various BONDING_ |
560 | settings described above, but does describe many of the other options. | 661 | settings described above, but does describe many of the other options. |
561 | 662 | ||
663 | 3.1.1 Using DHCP with sysconfig | ||
664 | ------------------------------- | ||
665 | |||
666 | Under sysconfig, configuring a device with BOOTPROTO='dhcp' | ||
667 | will cause it to query DHCP for its IP address information. At this | ||
668 | writing, this does not function for bonding devices; the scripts | ||
669 | attempt to obtain the device address from DHCP prior to adding any of | ||
670 | the slave devices. Without active slaves, the DHCP requests are not | ||
671 | sent to the network. | ||
672 | |||
673 | 3.1.2 Configuring Multiple Bonds with sysconfig | ||
674 | ----------------------------------------------- | ||
675 | |||
676 | The sysconfig network initialization system is capable of | ||
677 | handling multiple bonding devices. All that is necessary is for each | ||
678 | bonding instance to have an appropriately configured ifcfg-bondX file | ||
679 | (as described above). Do not specify the "max_bonds" parameter to any | ||
680 | instance of bonding, as this will confuse sysconfig. If you require | ||
681 | multiple bonding devices with identical parameters, create multiple | ||
682 | ifcfg-bondX files. | ||
683 | |||
684 | Because the sysconfig scripts supply the bonding module | ||
685 | options in the ifcfg-bondX file, it is not necessary to add them to | ||
686 | the system /etc/modules.conf or /etc/modprobe.conf configuration file. | ||
687 | |||
562 | 3.2 Configuration with initscripts support | 688 | 3.2 Configuration with initscripts support |
563 | ------------------------------------------ | 689 | ------------------------------------------ |
564 | 690 | ||
565 | This section applies to distros using a version of initscripts | 691 | This section applies to distros using a version of initscripts |
566 | with bonding support, for example, Red Hat Linux 9 or Red Hat | 692 | with bonding support, for example, Red Hat Linux 9 or Red Hat |
567 | Enterprise Linux version 3. On these systems, the network | 693 | Enterprise Linux version 3 or 4. On these systems, the network |
568 | initialization scripts have some knowledge of bonding, and can be | 694 | initialization scripts have some knowledge of bonding, and can be |
569 | configured to control bonding devices. | 695 | configured to control bonding devices. |
570 | 696 | ||
@@ -614,10 +740,11 @@ USERCTL=no | |||
614 | Be sure to change the networking specific lines (IPADDR, | 740 | Be sure to change the networking specific lines (IPADDR, |
615 | NETMASK, NETWORK and BROADCAST) to match your network configuration. | 741 | NETMASK, NETWORK and BROADCAST) to match your network configuration. |
616 | 742 | ||
617 | Finally, it is necessary to edit /etc/modules.conf to load the | 743 | Finally, it is necessary to edit /etc/modules.conf (or |
618 | bonding module when the bond0 interface is brought up. The following | 744 | /etc/modprobe.conf, depending upon your distro) to load the bonding |
619 | sample lines in /etc/modules.conf will load the bonding module, and | 745 | module with your desired options when the bond0 interface is brought |
620 | select its options: | 746 | up. The following lines in /etc/modules.conf (or modprobe.conf) will |
747 | load the bonding module, and select its options: | ||
621 | 748 | ||
622 | alias bond0 bonding | 749 | alias bond0 bonding |
623 | options bond0 mode=balance-alb miimon=100 | 750 | options bond0 mode=balance-alb miimon=100 |
@@ -629,6 +756,33 @@ options for your configuration. | |||
629 | will restart the networking subsystem and your bond link should be now | 756 | will restart the networking subsystem and your bond link should be now |
630 | up and running. | 757 | up and running. |
631 | 758 | ||
759 | 3.2.1 Using DHCP with initscripts | ||
760 | --------------------------------- | ||
761 | |||
762 | Recent versions of initscripts (the version supplied with | ||
763 | Fedora Core 3 and Red Hat Enterprise Linux 4 is reported to work) do | ||
764 | have support for assigning IP information to bonding devices via DHCP. | ||
765 | |||
766 | To configure bonding for DHCP, configure it as described | ||
767 | above, except replace the line "BOOTPROTO=none" with "BOOTPROTO=dhcp" | ||
768 | and add a line consisting of "TYPE=Bonding". Note that the TYPE value | ||
769 | is case sensitive. | ||
770 | |||
771 | 3.2.2 Configuring Multiple Bonds with initscripts | ||
772 | ------------------------------------------------- | ||
773 | |||
774 | At this writing, the initscripts package does not directly | ||
775 | support loading the bonding driver multiple times, so the process for | ||
776 | doing so is the same as described in the "Configuring Multiple Bonds | ||
777 | Manually" section, below. | ||
778 | |||
779 | NOTE: It has been observed that some Red Hat supplied kernels | ||
780 | are apparently unable to rename modules at load time (the "-obonding1" | ||
781 | part). Attempts to pass that option to modprobe will produce an | ||
782 | "Operation not permitted" error. This has been reported on some | ||
783 | Fedora Core kernels, and has been seen on RHEL 4 as well. On kernels | ||
784 | exhibiting this problem, it will be impossible to configure multiple | ||
785 | bonds with differing parameters. | ||
632 | 786 | ||
633 | 3.3 Configuring Bonding Manually | 787 | 3.3 Configuring Bonding Manually |
634 | -------------------------------- | 788 | -------------------------------- |
@@ -638,10 +792,11 @@ scripts (the sysconfig or initscripts package) do not have specific | |||
638 | knowledge of bonding. One such distro is SuSE Linux Enterprise Server | 792 | knowledge of bonding. One such distro is SuSE Linux Enterprise Server |
639 | version 8. | 793 | version 8. |
640 | 794 | ||
641 | The general methodology for these systems is to place the | 795 | The general method for these systems is to place the bonding |
642 | bonding module parameters into /etc/modprobe.conf, then add modprobe | 796 | module parameters into /etc/modules.conf or /etc/modprobe.conf (as |
643 | and/or ifenslave commands to the system's global init script. The | 797 | appropriate for the installed distro), then add modprobe and/or |
644 | name of the global init script differs; for sysconfig, it is | 798 | ifenslave commands to the system's global init script. The name of |
799 | the global init script differs; for sysconfig, it is | ||
645 | /etc/init.d/boot.local and for initscripts it is /etc/rc.d/rc.local. | 800 | /etc/init.d/boot.local and for initscripts it is /etc/rc.d/rc.local. |
646 | 801 | ||
647 | For example, if you wanted to make a simple bond of two e100 | 802 | For example, if you wanted to make a simple bond of two e100 |
@@ -649,7 +804,7 @@ devices (presumed to be eth0 and eth1), and have it persist across | |||
649 | reboots, edit the appropriate file (/etc/init.d/boot.local or | 804 | reboots, edit the appropriate file (/etc/init.d/boot.local or |
650 | /etc/rc.d/rc.local), and add the following: | 805 | /etc/rc.d/rc.local), and add the following: |
651 | 806 | ||
652 | modprobe bonding -obond0 mode=balance-alb miimon=100 | 807 | modprobe bonding mode=balance-alb miimon=100 |
653 | modprobe e100 | 808 | modprobe e100 |
654 | ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up | 809 | ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up |
655 | ifenslave bond0 eth0 | 810 | ifenslave bond0 eth0 |
@@ -657,11 +812,7 @@ ifenslave bond0 eth1 | |||
657 | 812 | ||
658 | Replace the example bonding module parameters and bond0 | 813 | Replace the example bonding module parameters and bond0 |
659 | network configuration (IP address, netmask, etc) with the appropriate | 814 | network configuration (IP address, netmask, etc) with the appropriate |
660 | values for your configuration. The above example loads the bonding | 815 | values for your configuration. |
661 | module with the name "bond0," this simplifies the naming if multiple | ||
662 | bonding modules are loaded (each successive instance of the module is | ||
663 | given a different name, and the module instance names match the | ||
664 | bonding interface names). | ||
665 | 816 | ||
666 | Unfortunately, this method will not provide support for the | 817 | Unfortunately, this method will not provide support for the |
667 | ifup and ifdown scripts on the bond devices. To reload the bonding | 818 | ifup and ifdown scripts on the bond devices. To reload the bonding |
@@ -684,20 +835,23 @@ appropriate device driver modules. For our example above, you can do | |||
684 | the following: | 835 | the following: |
685 | 836 | ||
686 | # ifconfig bond0 down | 837 | # ifconfig bond0 down |
687 | # rmmod bond0 | 838 | # rmmod bonding |
688 | # rmmod e100 | 839 | # rmmod e100 |
689 | 840 | ||
690 | Again, for convenience, it may be desirable to create a script | 841 | Again, for convenience, it may be desirable to create a script |
691 | with these commands. | 842 | with these commands. |
692 | 843 | ||
693 | 844 | ||
694 | 3.4 Configuring Multiple Bonds | 845 | 3.3.1 Configuring Multiple Bonds Manually |
695 | ------------------------------ | 846 | ----------------------------------------- |
696 | 847 | ||
697 | This section contains information on configuring multiple | 848 | This section contains information on configuring multiple |
698 | bonding devices with differing options. If you require multiple | 849 | bonding devices with differing options for those systems whose network |
699 | bonding devices, but all with the same options, see the "max_bonds" | 850 | initialization scripts lack support for configuring multiple bonds. |
700 | module paramter, documented above. | 851 | |
852 | If you require multiple bonding devices, but all with the same | ||
853 | options, you may wish to use the "max_bonds" module parameter, | ||
854 | documented above. | ||
701 | 855 | ||
702 | To create multiple bonding devices with differing options, it | 856 | To create multiple bonding devices with differing options, it |
703 | is necessary to load the bonding driver multiple times. Note that | 857 | is necessary to load the bonding driver multiple times. Note that |
@@ -724,11 +878,16 @@ named "bond0" and creates the bond0 device in balance-rr mode with an | |||
724 | miimon of 100. The second instance is named "bond1" and creates the | 878 | miimon of 100. The second instance is named "bond1" and creates the |
725 | bond1 device in balance-alb mode with an miimon of 50. | 879 | bond1 device in balance-alb mode with an miimon of 50. |
726 | 880 | ||
881 | In some circumstances (typically with older distributions), | ||
882 | the above does not work, and the second bonding instance never sees | ||
883 | its options. In that case, the second options line can be substituted | ||
884 | as follows: | ||
885 | |||
886 | install bonding1 /sbin/modprobe bonding -obond1 mode=balance-alb miimon=50 | ||
887 | |||
727 | This may be repeated any number of times, specifying a new and | 888 | This may be repeated any number of times, specifying a new and |
728 | unique name in place of bond0 or bond1 for each instance. | 889 | unique name in place of bond1 for each subsequent instance. |
729 | 890 | ||
730 | When the appropriate module paramters are in place, then | ||
731 | configure bonding according to the instructions for your distro. | ||
732 | 891 | ||
733 | 5. Querying Bonding Configuration | 892 | 5. Querying Bonding Configuration |
734 | ================================= | 893 | ================================= |
@@ -846,8 +1005,8 @@ tagged internally by bonding itself. As a result, bonding must | |||
846 | self generated packets. | 1005 | self generated packets. |
847 | 1006 | ||
848 | For reasons of simplicity, and to support the use of adapters | 1007 | For reasons of simplicity, and to support the use of adapters |
849 | that can do VLAN hardware acceleration offloding, the bonding | 1008 | that can do VLAN hardware acceleration offloading, the bonding |
850 | interface declares itself as fully hardware offloaing capable, it gets | 1009 | interface declares itself as fully hardware offloading capable, it gets |
851 | the add_vid/kill_vid notifications to gather the necessary | 1010 | the add_vid/kill_vid notifications to gather the necessary |
852 | information, and it propagates those actions to the slaves. In case | 1011 | information, and it propagates those actions to the slaves. In case |
853 | of mixed adapter types, hardware accelerated tagged packets that | 1012 | of mixed adapter types, hardware accelerated tagged packets that |
@@ -880,7 +1039,7 @@ bond interface: | |||
880 | matches the hardware address of the VLAN interfaces. | 1039 | matches the hardware address of the VLAN interfaces. |
881 | 1040 | ||
882 | Note that changing a VLAN interface's HW address would set the | 1041 | Note that changing a VLAN interface's HW address would set the |
883 | underlying device -- i.e. the bonding interface -- to promiscouos | 1042 | underlying device -- i.e. the bonding interface -- to promiscuous |
884 | mode, which might not be what you want. | 1043 | mode, which might not be what you want. |
885 | 1044 | ||
886 | 1045 | ||
@@ -923,7 +1082,7 @@ down or have a problem making it unresponsive to ARP requests. Having | |||
923 | an additional target (or several) increases the reliability of the ARP | 1082 | an additional target (or several) increases the reliability of the ARP |
924 | monitoring. | 1083 | monitoring. |
925 | 1084 | ||
926 | Multiple ARP targets must be seperated by commas as follows: | 1085 | Multiple ARP targets must be separated by commas as follows: |
927 | 1086 | ||
928 | # example options for ARP monitoring with three targets | 1087 | # example options for ARP monitoring with three targets |
929 | alias bond0 bonding | 1088 | alias bond0 bonding |
@@ -1045,7 +1204,7 @@ install bonding /sbin/modprobe tg3; /sbin/modprobe e1000; | |||
1045 | This will, when loading the bonding module, rather than | 1204 | This will, when loading the bonding module, rather than |
1046 | performing the normal action, instead execute the provided command. | 1205 | performing the normal action, instead execute the provided command. |
1047 | This command loads the device drivers in the order needed, then calls | 1206 | This command loads the device drivers in the order needed, then calls |
1048 | modprobe with --ingore-install to cause the normal action to then take | 1207 | modprobe with --ignore-install to cause the normal action to then take |
1049 | place. Full documentation on this can be found in the modprobe.conf | 1208 | place. Full documentation on this can be found in the modprobe.conf |
1050 | and modprobe manual pages. | 1209 | and modprobe manual pages. |
1051 | 1210 | ||
@@ -1130,14 +1289,14 @@ association. | |||
1130 | common to enable promiscuous mode on the device, so that all traffic | 1289 | common to enable promiscuous mode on the device, so that all traffic |
1131 | is seen (instead of seeing only traffic destined for the local host). | 1290 | is seen (instead of seeing only traffic destined for the local host). |
1132 | The bonding driver handles promiscuous mode changes to the bonding | 1291 | The bonding driver handles promiscuous mode changes to the bonding |
1133 | master device (e.g., bond0), and propogates the setting to the slave | 1292 | master device (e.g., bond0), and propagates the setting to the slave |
1134 | devices. | 1293 | devices. |
1135 | 1294 | ||
1136 | For the balance-rr, balance-xor, broadcast, and 802.3ad modes, | 1295 | For the balance-rr, balance-xor, broadcast, and 802.3ad modes, |
1137 | the promiscuous mode setting is propogated to all slaves. | 1296 | the promiscuous mode setting is propagated to all slaves. |
1138 | 1297 | ||
1139 | For the active-backup, balance-tlb and balance-alb modes, the | 1298 | For the active-backup, balance-tlb and balance-alb modes, the |
1140 | promiscuous mode setting is propogated only to the active slave. | 1299 | promiscuous mode setting is propagated only to the active slave. |
1141 | 1300 | ||
1142 | For balance-tlb mode, the active slave is the slave currently | 1301 | For balance-tlb mode, the active slave is the slave currently |
1143 | receiving inbound traffic. | 1302 | receiving inbound traffic. |
@@ -1148,46 +1307,182 @@ sending to peers that are unassigned or if the load is unbalanced. | |||
1148 | 1307 | ||
1149 | For the active-backup, balance-tlb and balance-alb modes, when | 1308 | For the active-backup, balance-tlb and balance-alb modes, when |
1150 | the active slave changes (e.g., due to a link failure), the | 1309 | the active slave changes (e.g., due to a link failure), the |
1151 | promiscuous setting will be propogated to the new active slave. | 1310 | promiscuous setting will be propagated to the new active slave. |
1152 | 1311 | ||
1153 | 12. High Availability Information | 1312 | 12. Configuring Bonding for High Availability |
1154 | ================================= | 1313 | ============================================= |
1155 | 1314 | ||
1156 | High Availability refers to configurations that provide | 1315 | High Availability refers to configurations that provide |
1157 | maximum network availability by having redundant or backup devices, | 1316 | maximum network availability by having redundant or backup devices, |
1158 | links and switches between the host and the rest of the world. | 1317 | links or switches between the host and the rest of the world. The |
1159 | 1318 | goal is to provide the maximum availability of network connectivity | |
1160 | There are currently two basic methods for configuring to | 1319 | (i.e., the network always works), even though other configurations |
1161 | maximize availability. They are dependent on the network topology and | 1320 | could provide higher throughput. |
1162 | the primary goal of the configuration, but in general, a configuration | ||
1163 | can be optimized for maximum available bandwidth, or for maximum | ||
1164 | network availability. | ||
1165 | 1321 | ||
1166 | 12.1 High Availability in a Single Switch Topology | 1322 | 12.1 High Availability in a Single Switch Topology |
1167 | -------------------------------------------------- | 1323 | -------------------------------------------------- |
1168 | 1324 | ||
1169 | If two hosts (or a host and a switch) are directly connected | 1325 | If two hosts (or a host and a single switch) are directly |
1170 | via multiple physical links, then there is no network availability | 1326 | connected via multiple physical links, then there is no availability |
1171 | penalty for optimizing for maximum bandwidth: there is only one switch | 1327 | penalty to optimizing for maximum bandwidth. In this case, there is |
1172 | (or peer), so if it fails, you have no alternative access to fail over | 1328 | only one switch (or peer), so if it fails, there is no alternative |
1173 | to. | 1329 | access to fail over to. Additionally, the bonding load balance modes |
1330 | support link monitoring of their members, so if individual links fail, | ||
1331 | the load will be rebalanced across the remaining devices. | ||
1332 | |||
1333 | See Section 13, "Configuring Bonding for Maximum Throughput" | ||
1334 | for information on configuring bonding with one peer device. | ||
1335 | |||
1336 | 12.2 High Availability in a Multiple Switch Topology | ||
1337 | ---------------------------------------------------- | ||
1338 | |||
1339 | With multiple switches, the configuration of bonding and the | ||
1340 | network changes dramatically. In multiple switch topologies, there is | ||
1341 | a trade off between network availability and usable bandwidth. | ||
1342 | |||
1343 | Below is a sample network, configured to maximize the | ||
1344 | availability of the network: | ||
1174 | 1345 | ||
1175 | Example 1 : host to switch (or other host) | 1346 | | | |
1347 | |port3 port3| | ||
1348 | +-----+----+ +-----+----+ | ||
1349 | | |port2 ISL port2| | | ||
1350 | | switch A +--------------------------+ switch B | | ||
1351 | | | | | | ||
1352 | +-----+----+ +-----++---+ | ||
1353 | |port1 port1| | ||
1354 | | +-------+ | | ||
1355 | +-------------+ host1 +---------------+ | ||
1356 | eth0 +-------+ eth1 | ||
1176 | 1357 | ||
1177 | +----------+ +----------+ | 1358 | In this configuration, there is a link between the two |
1178 | | |eth0 eth0| switch | | 1359 | switches (ISL, or inter switch link), and multiple ports connecting to |
1179 | | Host A +--------------------------+ or | | 1360 | the outside world ("port3" on each switch). There is no technical |
1180 | | +--------------------------+ other | | 1361 | reason that this could not be extended to a third switch. |
1181 | | |eth1 eth1| host | | ||
1182 | +----------+ +----------+ | ||
1183 | 1362 | ||
1363 | 12.2.1 HA Bonding Mode Selection for Multiple Switch Topology | ||
1364 | ------------------------------------------------------------- | ||
1184 | 1365 | ||
1185 | 12.1.1 Bonding Mode Selection for single switch topology | 1366 | In a topology such as the example above, the active-backup and |
1186 | -------------------------------------------------------- | 1367 | broadcast modes are the only useful bonding modes when optimizing for |
1368 | availability; the other modes require all links to terminate on the | ||
1369 | same peer for them to behave rationally. | ||
1370 | |||
1371 | active-backup: This is generally the preferred mode, particularly if | ||
1372 | the switches have an ISL and play together well. If the | ||
1373 | network configuration is such that one switch is specifically | ||
1374 | a backup switch (e.g., has lower capacity, higher cost, etc), | ||
1375 | then the primary option can be used to insure that the | ||
1376 | preferred link is always used when it is available. | ||
1377 | |||
1378 | broadcast: This mode is really a special purpose mode, and is suitable | ||
1379 | only for very specific needs. For example, if the two | ||
1380 | switches are not connected (no ISL), and the networks beyond | ||
1381 | them are totally independent. In this case, if it is | ||
1382 | necessary for some specific one-way traffic to reach both | ||
1383 | independent networks, then the broadcast mode may be suitable. | ||
1384 | |||
1385 | 12.2.2 HA Link Monitoring Selection for Multiple Switch Topology | ||
1386 | ---------------------------------------------------------------- | ||
1387 | |||
1388 | The choice of link monitoring ultimately depends upon your | ||
1389 | switch. If the switch can reliably fail ports in response to other | ||
1390 | failures, then either the MII or ARP monitors should work. For | ||
1391 | example, in the above example, if the "port3" link fails at the remote | ||
1392 | end, the MII monitor has no direct means to detect this. The ARP | ||
1393 | monitor could be configured with a target at the remote end of port3, | ||
1394 | thus detecting that failure without switch support. | ||
1395 | |||
1396 | In general, however, in a multiple switch topology, the ARP | ||
1397 | monitor can provide a higher level of reliability in detecting end to | ||
1398 | end connectivity failures (which may be caused by the failure of any | ||
1399 | individual component to pass traffic for any reason). Additionally, | ||
1400 | the ARP monitor should be configured with multiple targets (at least | ||
1401 | one for each switch in the network). This will insure that, | ||
1402 | regardless of which switch is active, the ARP monitor has a suitable | ||
1403 | target to query. | ||
1404 | |||
1405 | |||
1406 | 13. Configuring Bonding for Maximum Throughput | ||
1407 | ============================================== | ||
1408 | |||
1409 | 13.1 Maximizing Throughput in a Single Switch Topology | ||
1410 | ------------------------------------------------------ | ||
1411 | |||
1412 | In a single switch configuration, the best method to maximize | ||
1413 | throughput depends upon the application and network environment. The | ||
1414 | various load balancing modes each have strengths and weaknesses in | ||
1415 | different environments, as detailed below. | ||
1416 | |||
1417 | For this discussion, we will break down the topologies into | ||
1418 | two categories. Depending upon the destination of most traffic, we | ||
1419 | categorize them into either "gatewayed" or "local" configurations. | ||
1420 | |||
1421 | In a gatewayed configuration, the "switch" is acting primarily | ||
1422 | as a router, and the majority of traffic passes through this router to | ||
1423 | other networks. An example would be the following: | ||
1424 | |||
1425 | |||
1426 | +----------+ +----------+ | ||
1427 | | |eth0 port1| | to other networks | ||
1428 | | Host A +---------------------+ router +-------------------> | ||
1429 | | +---------------------+ | Hosts B and C are out | ||
1430 | | |eth1 port2| | here somewhere | ||
1431 | +----------+ +----------+ | ||
1432 | |||
1433 | The router may be a dedicated router device, or another host | ||
1434 | acting as a gateway. For our discussion, the important point is that | ||
1435 | the majority of traffic from Host A will pass through the router to | ||
1436 | some other network before reaching its final destination. | ||
1437 | |||
1438 | In a gatewayed network configuration, although Host A may | ||
1439 | communicate with many other systems, all of its traffic will be sent | ||
1440 | and received via one other peer on the local network, the router. | ||
1441 | |||
1442 | Note that the case of two systems connected directly via | ||
1443 | multiple physical links is, for purposes of configuring bonding, the | ||
1444 | same as a gatewayed configuration. In that case, it happens that all | ||
1445 | traffic is destined for the "gateway" itself, not some other network | ||
1446 | beyond the gateway. | ||
1447 | |||
1448 | In a local configuration, the "switch" is acting primarily as | ||
1449 | a switch, and the majority of traffic passes through this switch to | ||
1450 | reach other stations on the same network. An example would be the | ||
1451 | following: | ||
1452 | |||
1453 | +----------+ +----------+ +--------+ | ||
1454 | | |eth0 port1| +-------+ Host B | | ||
1455 | | Host A +------------+ switch |port3 +--------+ | ||
1456 | | +------------+ | +--------+ | ||
1457 | | |eth1 port2| +------------------+ Host C | | ||
1458 | +----------+ +----------+port4 +--------+ | ||
1459 | |||
1460 | |||
1461 | Again, the switch may be a dedicated switch device, or another | ||
1462 | host acting as a gateway. For our discussion, the important point is | ||
1463 | that the majority of traffic from Host A is destined for other hosts | ||
1464 | on the same local network (Hosts B and C in the above example). | ||
1465 | |||
1466 | In summary, in a gatewayed configuration, traffic to and from | ||
1467 | the bonded device will be to the same MAC level peer on the network | ||
1468 | (the gateway itself, i.e., the router), regardless of its final | ||
1469 | destination. In a local configuration, traffic flows directly to and | ||
1470 | from the final destinations, thus, each destination (Host B, Host C) | ||
1471 | will be addressed directly by their individual MAC addresses. | ||
1472 | |||
1473 | This distinction between a gatewayed and a local network | ||
1474 | configuration is important because many of the load balancing modes | ||
1475 | available use the MAC addresses of the local network source and | ||
1476 | destination to make load balancing decisions. The behavior of each | ||
1477 | mode is described below. | ||
1478 | |||
1479 | |||
1480 | 13.1.1 MT Bonding Mode Selection for Single Switch Topology | ||
1481 | ----------------------------------------------------------- | ||
1187 | 1482 | ||
1188 | This configuration is the easiest to set up and to understand, | 1483 | This configuration is the easiest to set up and to understand, |
1189 | although you will have to decide which bonding mode best suits your | 1484 | although you will have to decide which bonding mode best suits your |
1190 | needs. The tradeoffs for each mode are detailed below: | 1485 | needs. The trade offs for each mode are detailed below: |
1191 | 1486 | ||
1192 | balance-rr: This mode is the only mode that will permit a single | 1487 | balance-rr: This mode is the only mode that will permit a single |
1193 | TCP/IP connection to stripe traffic across multiple | 1488 | TCP/IP connection to stripe traffic across multiple |
@@ -1206,6 +1501,23 @@ balance-rr: This mode is the only mode that will permit a single | |||
1206 | interface's worth of throughput, even after adjusting | 1501 | interface's worth of throughput, even after adjusting |
1207 | tcp_reordering. | 1502 | tcp_reordering. |
1208 | 1503 | ||
1504 | Note that this out of order delivery occurs when both the | ||
1505 | sending and receiving systems are utilizing a multiple | ||
1506 | interface bond. Consider a configuration in which a | ||
1507 | balance-rr bond feeds into a single higher capacity network | ||
1508 | channel (e.g., multiple 100Mb/sec ethernets feeding a single | ||
1509 | gigabit ethernet via an etherchannel capable switch). In this | ||
1510 | configuration, traffic sent from the multiple 100Mb devices to | ||
1511 | a destination connected to the gigabit device will not see | ||
1512 | packets out of order. However, traffic sent from the gigabit | ||
1513 | device to the multiple 100Mb devices may or may not see | ||
1514 | traffic out of order, depending upon the balance policy of the | ||
1515 | switch. Many switches do not support any modes that stripe | ||
1516 | traffic (instead choosing a port based upon IP or MAC level | ||
1517 | addresses); for those devices, traffic flowing from the | ||
1518 | gigabit device to the many 100Mb devices will only utilize one | ||
1519 | interface. | ||
1520 | |||
1209 | If you are utilizing protocols other than TCP/IP, UDP for | 1521 | If you are utilizing protocols other than TCP/IP, UDP for |
1210 | example, and your application can tolerate out of order | 1522 | example, and your application can tolerate out of order |
1211 | delivery, then this mode can allow for single stream datagram | 1523 | delivery, then this mode can allow for single stream datagram |
@@ -1220,16 +1532,21 @@ active-backup: There is not much advantage in this network topology to | |||
1220 | connected to the same peer as the primary. In this case, a | 1532 | connected to the same peer as the primary. In this case, a |
1221 | load balancing mode (with link monitoring) will provide the | 1533 | load balancing mode (with link monitoring) will provide the |
1222 | same level of network availability, but with increased | 1534 | same level of network availability, but with increased |
1223 | available bandwidth. On the plus side, it does not require | 1535 | available bandwidth. On the plus side, active-backup mode |
1224 | any configuration of the switch. | 1536 | does not require any configuration of the switch, so it may |
1537 | have value if the hardware available does not support any of | ||
1538 | the load balance modes. | ||
1225 | 1539 | ||
1226 | balance-xor: This mode will limit traffic such that packets destined | 1540 | balance-xor: This mode will limit traffic such that packets destined |
1227 | for specific peers will always be sent over the same | 1541 | for specific peers will always be sent over the same |
1228 | interface. Since the destination is determined by the MAC | 1542 | interface. Since the destination is determined by the MAC |
1229 | addresses involved, this may be desirable if you have a large | 1543 | addresses involved, this mode works best in a "local" network |
1230 | network with many hosts. It is likely to be suboptimal if all | 1544 | configuration (as described above), with destinations all on |
1231 | your traffic is passed through a single router, however. As | 1545 | the same local network. This mode is likely to be suboptimal |
1232 | with balance-rr, the switch ports need to be configured for | 1546 | if all your traffic is passed through a single router (i.e., a |
1547 | "gatewayed" network configuration, as described above). | ||
1548 | |||
1549 | As with balance-rr, the switch ports need to be configured for | ||
1233 | "etherchannel" or "trunking." | 1550 | "etherchannel" or "trunking." |
1234 | 1551 | ||
1235 | broadcast: Like active-backup, there is not much advantage to this | 1552 | broadcast: Like active-backup, there is not much advantage to this |
@@ -1241,122 +1558,131 @@ broadcast: Like active-backup, there is not much advantage to this | |||
1241 | protocol includes automatic configuration of the aggregates, | 1558 | protocol includes automatic configuration of the aggregates, |
1242 | so minimal manual configuration of the switch is needed | 1559 | so minimal manual configuration of the switch is needed |
1243 | (typically only to designate that some set of devices is | 1560 | (typically only to designate that some set of devices is |
1244 | usable for 802.3ad). The 802.3ad standard also mandates that | 1561 | available for 802.3ad). The 802.3ad standard also mandates |
1245 | frames be delivered in order (within certain limits), so in | 1562 | that frames be delivered in order (within certain limits), so |
1246 | general single connections will not see misordering of | 1563 | in general single connections will not see misordering of |
1247 | packets. The 802.3ad mode does have some drawbacks: the | 1564 | packets. The 802.3ad mode does have some drawbacks: the |
1248 | standard mandates that all devices in the aggregate operate at | 1565 | standard mandates that all devices in the aggregate operate at |
1249 | the same speed and duplex. Also, as with all bonding load | 1566 | the same speed and duplex. Also, as with all bonding load |
1250 | balance modes other than balance-rr, no single connection will | 1567 | balance modes other than balance-rr, no single connection will |
1251 | be able to utilize more than a single interface's worth of | 1568 | be able to utilize more than a single interface's worth of |
1252 | bandwidth. Additionally, the linux bonding 802.3ad | 1569 | bandwidth. |
1253 | implementation distributes traffic by peer (using an XOR of | 1570 | |
1254 | MAC addresses), so in general all traffic to a particular | 1571 | Additionally, the linux bonding 802.3ad implementation |
1255 | destination will use the same interface. Finally, the 802.3ad | 1572 | distributes traffic by peer (using an XOR of MAC addresses), |
1256 | mode mandates the use of the MII monitor, therefore, the ARP | 1573 | so in a "gatewayed" configuration, all outgoing traffic will |
1257 | monitor is not available in this mode. | 1574 | generally use the same device. Incoming traffic may also end |
1258 | 1575 | up on a single device, but that is dependent upon the | |
1259 | balance-tlb: This mode is also a good choice for this type of | 1576 | balancing policy of the peer's 8023.ad implementation. In a |
1260 | topology. It has no special switch configuration | 1577 | "local" configuration, traffic will be distributed across the |
1261 | requirements, and balances outgoing traffic by peer, in a | 1578 | devices in the bond. |
1262 | vaguely intelligent manner (not a simple XOR as in balance-xor | 1579 | |
1263 | or 802.3ad mode), so that unlucky MAC addresses will not all | 1580 | Finally, the 802.3ad mode mandates the use of the MII monitor, |
1264 | "bunch up" on a single interface. Interfaces may be of | 1581 | therefore, the ARP monitor is not available in this mode. |
1265 | differing speeds. On the down side, in this mode all incoming | 1582 | |
1266 | traffic arrives over a single interface, this mode requires | 1583 | balance-tlb: The balance-tlb mode balances outgoing traffic by peer. |
1267 | certain ethtool support in the network device driver of the | 1584 | Since the balancing is done according to MAC address, in a |
1268 | slave interfaces, and the ARP monitor is not available. | 1585 | "gatewayed" configuration (as described above), this mode will |
1269 | 1586 | send all traffic across a single device. However, in a | |
1270 | balance-alb: This mode is everything that balance-tlb is, and more. It | 1587 | "local" network configuration, this mode balances multiple |
1271 | has all of the features (and restrictions) of balance-tlb, and | 1588 | local network peers across devices in a vaguely intelligent |
1272 | will also balance incoming traffic from peers (as described in | 1589 | manner (not a simple XOR as in balance-xor or 802.3ad mode), |
1273 | the Bonding Module Options section, above). The only extra | 1590 | so that mathematically unlucky MAC addresses (i.e., ones that |
1274 | down side to this mode is that the network device driver must | 1591 | XOR to the same value) will not all "bunch up" on a single |
1275 | support changing the hardware address while the device is | 1592 | interface. |
1276 | open. | 1593 | |
1277 | 1594 | Unlike 802.3ad, interfaces may be of differing speeds, and no | |
1278 | 12.1.2 Link Monitoring for Single Switch Topology | 1595 | special switch configuration is required. On the down side, |
1279 | ------------------------------------------------- | 1596 | in this mode all incoming traffic arrives over a single |
1597 | interface, this mode requires certain ethtool support in the | ||
1598 | network device driver of the slave interfaces, and the ARP | ||
1599 | monitor is not available. | ||
1600 | |||
1601 | balance-alb: This mode is everything that balance-tlb is, and more. | ||
1602 | It has all of the features (and restrictions) of balance-tlb, | ||
1603 | and will also balance incoming traffic from local network | ||
1604 | peers (as described in the Bonding Module Options section, | ||
1605 | above). | ||
1606 | |||
1607 | The only additional down side to this mode is that the network | ||
1608 | device driver must support changing the hardware address while | ||
1609 | the device is open. | ||
1610 | |||
1611 | 13.1.2 MT Link Monitoring for Single Switch Topology | ||
1612 | ---------------------------------------------------- | ||
1280 | 1613 | ||
1281 | The choice of link monitoring may largely depend upon which | 1614 | The choice of link monitoring may largely depend upon which |
1282 | mode you choose to use. The more advanced load balancing modes do not | 1615 | mode you choose to use. The more advanced load balancing modes do not |
1283 | support the use of the ARP monitor, and are thus restricted to using | 1616 | support the use of the ARP monitor, and are thus restricted to using |
1284 | the MII monitor (which does not provide as high a level of assurance | 1617 | the MII monitor (which does not provide as high a level of end to end |
1285 | as the ARP monitor). | 1618 | assurance as the ARP monitor). |
1286 | 1619 | ||
1287 | 1620 | 13.2 Maximum Throughput in a Multiple Switch Topology | |
1288 | 12.2 High Availability in a Multiple Switch Topology | 1621 | ----------------------------------------------------- |
1289 | ---------------------------------------------------- | 1622 | |
1290 | 1623 | Multiple switches may be utilized to optimize for throughput | |
1291 | With multiple switches, the configuration of bonding and the | 1624 | when they are configured in parallel as part of an isolated network |
1292 | network changes dramatically. In multiple switch topologies, there is | 1625 | between two or more systems, for example: |
1293 | a tradeoff between network availability and usable bandwidth. | 1626 | |
1294 | 1627 | +-----------+ | |
1295 | Below is a sample network, configured to maximize the | 1628 | | Host A | |
1296 | availability of the network: | 1629 | +-+---+---+-+ |
1297 | 1630 | | | | | |
1298 | | | | 1631 | +--------+ | +---------+ |
1299 | |port3 port3| | 1632 | | | | |
1300 | +-----+----+ +-----+----+ | 1633 | +------+---+ +-----+----+ +-----+----+ |
1301 | | |port2 ISL port2| | | 1634 | | Switch A | | Switch B | | Switch C | |
1302 | | switch A +--------------------------+ switch B | | 1635 | +------+---+ +-----+----+ +-----+----+ |
1303 | | | | | | 1636 | | | | |
1304 | +-----+----+ +-----++---+ | 1637 | +--------+ | +---------+ |
1305 | |port1 port1| | 1638 | | | | |
1306 | | +-------+ | | 1639 | +-+---+---+-+ |
1307 | +-------------+ host1 +---------------+ | 1640 | | Host B | |
1308 | eth0 +-------+ eth1 | 1641 | +-----------+ |
1309 | 1642 | ||
1310 | In this configuration, there is a link between the two | 1643 | In this configuration, the switches are isolated from one |
1311 | switches (ISL, or inter switch link), and multiple ports connecting to | 1644 | another. One reason to employ a topology such as this is for an |
1312 | the outside world ("port3" on each switch). There is no technical | 1645 | isolated network with many hosts (a cluster configured for high |
1313 | reason that this could not be extended to a third switch. | 1646 | performance, for example), using multiple smaller switches can be more |
1314 | 1647 | cost effective than a single larger switch, e.g., on a network with 24 | |
1315 | 12.2.1 Bonding Mode Selection for Multiple Switch Topology | 1648 | hosts, three 24 port switches can be significantly less expensive than |
1316 | ---------------------------------------------------------- | 1649 | a single 72 port switch. |
1317 | 1650 | ||
1318 | In a topology such as this, the active-backup and broadcast | 1651 | If access beyond the network is required, an individual host |
1319 | modes are the only useful bonding modes; the other modes require all | 1652 | can be equipped with an additional network device connected to an |
1320 | links to terminate on the same peer for them to behave rationally. | 1653 | external network; this host then additionally acts as a gateway. |
1321 | 1654 | ||
1322 | active-backup: This is generally the preferred mode, particularly if | 1655 | 13.2.1 MT Bonding Mode Selection for Multiple Switch Topology |
1323 | the switches have an ISL and play together well. If the | ||
1324 | network configuration is such that one switch is specifically | ||
1325 | a backup switch (e.g., has lower capacity, higher cost, etc), | ||
1326 | then the primary option can be used to insure that the | ||
1327 | preferred link is always used when it is available. | ||
1328 | |||
1329 | broadcast: This mode is really a special purpose mode, and is suitable | ||
1330 | only for very specific needs. For example, if the two | ||
1331 | switches are not connected (no ISL), and the networks beyond | ||
1332 | them are totally independant. In this case, if it is | ||
1333 | necessary for some specific one-way traffic to reach both | ||
1334 | independent networks, then the broadcast mode may be suitable. | ||
1335 | |||
1336 | 12.2.2 Link Monitoring Selection for Multiple Switch Topology | ||
1337 | ------------------------------------------------------------- | 1656 | ------------------------------------------------------------- |
1338 | 1657 | ||
1339 | The choice of link monitoring ultimately depends upon your | 1658 | In actual practice, the bonding mode typically employed in |
1340 | switch. If the switch can reliably fail ports in response to other | 1659 | configurations of this type is balance-rr. Historically, in this |
1341 | failures, then either the MII or ARP monitors should work. For | 1660 | network configuration, the usual caveats about out of order packet |
1342 | example, in the above example, if the "port3" link fails at the remote | 1661 | delivery are mitigated by the use of network adapters that do not do |
1343 | end, the MII monitor has no direct means to detect this. The ARP | 1662 | any kind of packet coalescing (via the use of NAPI, or because the |
1344 | monitor could be configured with a target at the remote end of port3, | 1663 | device itself does not generate interrupts until some number of |
1345 | thus detecting that failure without switch support. | 1664 | packets has arrived). When employed in this fashion, the balance-rr |
1665 | mode allows individual connections between two hosts to effectively | ||
1666 | utilize greater than one interface's bandwidth. | ||
1346 | 1667 | ||
1347 | In general, however, in a multiple switch topology, the ARP | 1668 | 13.2.2 MT Link Monitoring for Multiple Switch Topology |
1348 | monitor can provide a higher level of reliability in detecting link | 1669 | ------------------------------------------------------ |
1349 | failures. Additionally, it should be configured with multiple targets | ||
1350 | (at least one for each switch in the network). This will insure that, | ||
1351 | regardless of which switch is active, the ARP monitor has a suitable | ||
1352 | target to query. | ||
1353 | 1670 | ||
1671 | Again, in actual practice, the MII monitor is most often used | ||
1672 | in this configuration, as performance is given preference over | ||
1673 | availability. The ARP monitor will function in this topology, but its | ||
1674 | advantages over the MII monitor are mitigated by the volume of probes | ||
1675 | needed as the number of systems involved grows (remember that each | ||
1676 | host in the network is configured with bonding). | ||
1354 | 1677 | ||
1355 | 12.3 Switch Behavior Issues for High Availability | 1678 | 14. Switch Behavior Issues |
1356 | ------------------------------------------------- | 1679 | ========================== |
1357 | 1680 | ||
1358 | You may encounter issues with the timing of link up and down | 1681 | 14.1 Link Establishment and Failover Delays |
1359 | reporting by the switch. | 1682 | ------------------------------------------- |
1683 | |||
1684 | Some switches exhibit undesirable behavior with regard to the | ||
1685 | timing of link up and down reporting by the switch. | ||
1360 | 1686 | ||
1361 | First, when a link comes up, some switches may indicate that | 1687 | First, when a link comes up, some switches may indicate that |
1362 | the link is up (carrier available), but not pass traffic over the | 1688 | the link is up (carrier available), but not pass traffic over the |
@@ -1370,30 +1696,70 @@ relevant interface(s). | |||
1370 | Second, some switches may "bounce" the link state one or more | 1696 | Second, some switches may "bounce" the link state one or more |
1371 | times while a link is changing state. This occurs most commonly while | 1697 | times while a link is changing state. This occurs most commonly while |
1372 | the switch is initializing. Again, an appropriate updelay value may | 1698 | the switch is initializing. Again, an appropriate updelay value may |
1373 | help, but note that if all links are down, then updelay is ignored | 1699 | help. |
1374 | when any link becomes active (the slave closest to completing its | ||
1375 | updelay is chosen). | ||
1376 | 1700 | ||
1377 | Note that when a bonding interface has no active links, the | 1701 | Note that when a bonding interface has no active links, the |
1378 | driver will immediately reuse the first link that goes up, even if | 1702 | driver will immediately reuse the first link that goes up, even if the |
1379 | updelay parameter was specified. If there are slave interfaces | 1703 | updelay parameter has been specified (the updelay is ignored in this |
1380 | waiting for the updelay timeout to expire, the interface that first | 1704 | case). If there are slave interfaces waiting for the updelay timeout |
1381 | went into that state will be immediately reused. This reduces down | 1705 | to expire, the interface that first went into that state will be |
1382 | time of the network if the value of updelay has been overestimated. | 1706 | immediately reused. This reduces down time of the network if the |
1707 | value of updelay has been overestimated, and since this occurs only in | ||
1708 | cases with no connectivity, there is no additional penalty for | ||
1709 | ignoring the updelay. | ||
1383 | 1710 | ||
1384 | In addition to the concerns about switch timings, if your | 1711 | In addition to the concerns about switch timings, if your |
1385 | switches take a long time to go into backup mode, it may be desirable | 1712 | switches take a long time to go into backup mode, it may be desirable |
1386 | to not activate a backup interface immediately after a link goes down. | 1713 | to not activate a backup interface immediately after a link goes down. |
1387 | Failover may be delayed via the downdelay bonding module option. | 1714 | Failover may be delayed via the downdelay bonding module option. |
1388 | 1715 | ||
1389 | 13. Hardware Specific Considerations | 1716 | 14.2 Duplicated Incoming Packets |
1717 | -------------------------------- | ||
1718 | |||
1719 | It is not uncommon to observe a short burst of duplicated | ||
1720 | traffic when the bonding device is first used, or after it has been | ||
1721 | idle for some period of time. This is most easily observed by issuing | ||
1722 | a "ping" to some other host on the network, and noticing that the | ||
1723 | output from ping flags duplicates (typically one per slave). | ||
1724 | |||
1725 | For example, on a bond in active-backup mode with five slaves | ||
1726 | all connected to one switch, the output may appear as follows: | ||
1727 | |||
1728 | # ping -n 10.0.4.2 | ||
1729 | PING 10.0.4.2 (10.0.4.2) from 10.0.3.10 : 56(84) bytes of data. | ||
1730 | 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.7 ms | ||
1731 | 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!) | ||
1732 | 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!) | ||
1733 | 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!) | ||
1734 | 64 bytes from 10.0.4.2: icmp_seq=1 ttl=64 time=13.8 ms (DUP!) | ||
1735 | 64 bytes from 10.0.4.2: icmp_seq=2 ttl=64 time=0.216 ms | ||
1736 | 64 bytes from 10.0.4.2: icmp_seq=3 ttl=64 time=0.267 ms | ||
1737 | 64 bytes from 10.0.4.2: icmp_seq=4 ttl=64 time=0.222 ms | ||
1738 | |||
1739 | This is not due to an error in the bonding driver, rather, it | ||
1740 | is a side effect of how many switches update their MAC forwarding | ||
1741 | tables. Initially, the switch does not associate the MAC address in | ||
1742 | the packet with a particular switch port, and so it may send the | ||
1743 | traffic to all ports until its MAC forwarding table is updated. Since | ||
1744 | the interfaces attached to the bond may occupy multiple ports on a | ||
1745 | single switch, when the switch (temporarily) floods the traffic to all | ||
1746 | ports, the bond device receives multiple copies of the same packet | ||
1747 | (one per slave device). | ||
1748 | |||
1749 | The duplicated packet behavior is switch dependent, some | ||
1750 | switches exhibit this, and some do not. On switches that display this | ||
1751 | behavior, it can be induced by clearing the MAC forwarding table (on | ||
1752 | most Cisco switches, the privileged command "clear mac address-table | ||
1753 | dynamic" will accomplish this). | ||
1754 | |||
1755 | 15. Hardware Specific Considerations | ||
1390 | ==================================== | 1756 | ==================================== |
1391 | 1757 | ||
1392 | This section contains additional information for configuring | 1758 | This section contains additional information for configuring |
1393 | bonding on specific hardware platforms, or for interfacing bonding | 1759 | bonding on specific hardware platforms, or for interfacing bonding |
1394 | with particular switches or other devices. | 1760 | with particular switches or other devices. |
1395 | 1761 | ||
1396 | 13.1 IBM BladeCenter | 1762 | 15.1 IBM BladeCenter |
1397 | -------------------- | 1763 | -------------------- |
1398 | 1764 | ||
1399 | This applies to the JS20 and similar systems. | 1765 | This applies to the JS20 and similar systems. |
@@ -1407,12 +1773,12 @@ JS20 network adapter information | |||
1407 | -------------------------------- | 1773 | -------------------------------- |
1408 | 1774 | ||
1409 | All JS20s come with two Broadcom Gigabit Ethernet ports | 1775 | All JS20s come with two Broadcom Gigabit Ethernet ports |
1410 | integrated on the planar. In the BladeCenter chassis, the eth0 port | 1776 | integrated on the planar (that's "motherboard" in IBM-speak). In the |
1411 | of all JS20 blades is hard wired to I/O Module #1; similarly, all eth1 | 1777 | BladeCenter chassis, the eth0 port of all JS20 blades is hard wired to |
1412 | ports are wired to I/O Module #2. An add-on Broadcom daughter card | 1778 | I/O Module #1; similarly, all eth1 ports are wired to I/O Module #2. |
1413 | can be installed on a JS20 to provide two more Gigabit Ethernet ports. | 1779 | An add-on Broadcom daughter card can be installed on a JS20 to provide |
1414 | These ports, eth2 and eth3, are wired to I/O Modules 3 and 4, | 1780 | two more Gigabit Ethernet ports. These ports, eth2 and eth3, are |
1415 | respectively. | 1781 | wired to I/O Modules 3 and 4, respectively. |
1416 | 1782 | ||
1417 | Each I/O Module may contain either a switch or a passthrough | 1783 | Each I/O Module may contain either a switch or a passthrough |
1418 | module (which allows ports to be directly connected to an external | 1784 | module (which allows ports to be directly connected to an external |
@@ -1432,29 +1798,30 @@ BladeCenter networking configuration | |||
1432 | of ways, this discussion will be confined to describing basic | 1798 | of ways, this discussion will be confined to describing basic |
1433 | configurations. | 1799 | configurations. |
1434 | 1800 | ||
1435 | Normally, Ethernet Switch Modules (ESM) are used in I/O | 1801 | Normally, Ethernet Switch Modules (ESMs) are used in I/O |
1436 | modules 1 and 2. In this configuration, the eth0 and eth1 ports of a | 1802 | modules 1 and 2. In this configuration, the eth0 and eth1 ports of a |
1437 | JS20 will be connected to different internal switches (in the | 1803 | JS20 will be connected to different internal switches (in the |
1438 | respective I/O modules). | 1804 | respective I/O modules). |
1439 | 1805 | ||
1440 | An optical passthru module (OPM) connects the I/O module | 1806 | A passthrough module (OPM or CPM, optical or copper, |
1441 | directly to an external switch. By using OPMs in I/O module #1 and | 1807 | passthrough module) connects the I/O module directly to an external |
1442 | #2, the eth0 and eth1 interfaces of a JS20 can be redirected to the | 1808 | switch. By using PMs in I/O module #1 and #2, the eth0 and eth1 |
1443 | outside world and connected to a common external switch. | 1809 | interfaces of a JS20 can be redirected to the outside world and |
1444 | 1810 | connected to a common external switch. | |
1445 | Depending upon the mix of ESM and OPM modules, the network | 1811 | |
1446 | will appear to bonding as either a single switch topology (all OPM | 1812 | Depending upon the mix of ESMs and PMs, the network will |
1447 | modules) or as a multiple switch topology (one or more ESM modules, | 1813 | appear to bonding as either a single switch topology (all PMs) or as a |
1448 | zero or more OPM modules). It is also possible to connect ESM modules | 1814 | multiple switch topology (one or more ESMs, zero or more PMs). It is |
1449 | together, resulting in a configuration much like the example in "High | 1815 | also possible to connect ESMs together, resulting in a configuration |
1450 | Availability in a multiple switch topology." | 1816 | much like the example in "High Availability in a Multiple Switch |
1451 | 1817 | Topology," above. | |
1452 | Requirements for specifc modes | 1818 | |
1453 | ------------------------------ | 1819 | Requirements for specific modes |
1454 | 1820 | ------------------------------- | |
1455 | The balance-rr mode requires the use of OPM modules for | 1821 | |
1456 | devices in the bond, all connected to an common external switch. That | 1822 | The balance-rr mode requires the use of passthrough modules |
1457 | switch must be configured for "etherchannel" or "trunking" on the | 1823 | for devices in the bond, all connected to an common external switch. |
1824 | That switch must be configured for "etherchannel" or "trunking" on the | ||
1458 | appropriate ports, as is usual for balance-rr. | 1825 | appropriate ports, as is usual for balance-rr. |
1459 | 1826 | ||
1460 | The balance-alb and balance-tlb modes will function with | 1827 | The balance-alb and balance-tlb modes will function with |
@@ -1484,17 +1851,18 @@ connected to the JS20 system. | |||
1484 | Other concerns | 1851 | Other concerns |
1485 | -------------- | 1852 | -------------- |
1486 | 1853 | ||
1487 | The Serial Over LAN link is established over the primary | 1854 | The Serial Over LAN (SoL) link is established over the primary |
1488 | ethernet (eth0) only, therefore, any loss of link to eth0 will result | 1855 | ethernet (eth0) only, therefore, any loss of link to eth0 will result |
1489 | in losing your SoL connection. It will not fail over with other | 1856 | in losing your SoL connection. It will not fail over with other |
1490 | network traffic. | 1857 | network traffic, as the SoL system is beyond the control of the |
1858 | bonding driver. | ||
1491 | 1859 | ||
1492 | It may be desirable to disable spanning tree on the switch | 1860 | It may be desirable to disable spanning tree on the switch |
1493 | (either the internal Ethernet Switch Module, or an external switch) to | 1861 | (either the internal Ethernet Switch Module, or an external switch) to |
1494 | avoid fail-over delays issues when using bonding. | 1862 | avoid fail-over delay issues when using bonding. |
1495 | 1863 | ||
1496 | 1864 | ||
1497 | 14. Frequently Asked Questions | 1865 | 16. Frequently Asked Questions |
1498 | ============================== | 1866 | ============================== |
1499 | 1867 | ||
1500 | 1. Is it SMP safe? | 1868 | 1. Is it SMP safe? |
@@ -1505,8 +1873,8 @@ The new driver was designed to be SMP safe from the start. | |||
1505 | 2. What type of cards will work with it? | 1873 | 2. What type of cards will work with it? |
1506 | 1874 | ||
1507 | Any Ethernet type cards (you can even mix cards - a Intel | 1875 | Any Ethernet type cards (you can even mix cards - a Intel |
1508 | EtherExpress PRO/100 and a 3com 3c905b, for example). They need not | 1876 | EtherExpress PRO/100 and a 3com 3c905b, for example). For most modes, |
1509 | be of the same speed. | 1877 | devices need not be of the same speed. |
1510 | 1878 | ||
1511 | 3. How many bonding devices can I have? | 1879 | 3. How many bonding devices can I have? |
1512 | 1880 | ||
@@ -1524,11 +1892,12 @@ system. | |||
1524 | disabled. The active-backup mode will fail over to a backup link, and | 1892 | disabled. The active-backup mode will fail over to a backup link, and |
1525 | other modes will ignore the failed link. The link will continue to be | 1893 | other modes will ignore the failed link. The link will continue to be |
1526 | monitored, and should it recover, it will rejoin the bond (in whatever | 1894 | monitored, and should it recover, it will rejoin the bond (in whatever |
1527 | manner is appropriate for the mode). See the section on High | 1895 | manner is appropriate for the mode). See the sections on High |
1528 | Availability for additional information. | 1896 | Availability and the documentation for each mode for additional |
1897 | information. | ||
1529 | 1898 | ||
1530 | Link monitoring can be enabled via either the miimon or | 1899 | Link monitoring can be enabled via either the miimon or |
1531 | arp_interval paramters (described in the module paramters section, | 1900 | arp_interval parameters (described in the module parameters section, |
1532 | above). In general, miimon monitors the carrier state as sensed by | 1901 | above). In general, miimon monitors the carrier state as sensed by |
1533 | the underlying network device, and the arp monitor (arp_interval) | 1902 | the underlying network device, and the arp monitor (arp_interval) |
1534 | monitors connectivity to another host on the local network. | 1903 | monitors connectivity to another host on the local network. |
@@ -1536,7 +1905,7 @@ monitors connectivity to another host on the local network. | |||
1536 | If no link monitoring is configured, the bonding driver will | 1905 | If no link monitoring is configured, the bonding driver will |
1537 | be unable to detect link failures, and will assume that all links are | 1906 | be unable to detect link failures, and will assume that all links are |
1538 | always available. This will likely result in lost packets, and a | 1907 | always available. This will likely result in lost packets, and a |
1539 | resulting degredation of performance. The precise performance loss | 1908 | resulting degradation of performance. The precise performance loss |
1540 | depends upon the bonding mode and network configuration. | 1909 | depends upon the bonding mode and network configuration. |
1541 | 1910 | ||
1542 | 6. Can bonding be used for High Availability? | 1911 | 6. Can bonding be used for High Availability? |
@@ -1550,12 +1919,12 @@ depends upon the bonding mode and network configuration. | |||
1550 | In the basic balance modes (balance-rr and balance-xor), it | 1919 | In the basic balance modes (balance-rr and balance-xor), it |
1551 | works with any system that supports etherchannel (also called | 1920 | works with any system that supports etherchannel (also called |
1552 | trunking). Most managed switches currently available have such | 1921 | trunking). Most managed switches currently available have such |
1553 | support, and many unmananged switches as well. | 1922 | support, and many unmanaged switches as well. |
1554 | 1923 | ||
1555 | The advanced balance modes (balance-tlb and balance-alb) do | 1924 | The advanced balance modes (balance-tlb and balance-alb) do |
1556 | not have special switch requirements, but do need device drivers that | 1925 | not have special switch requirements, but do need device drivers that |
1557 | support specific features (described in the appropriate section under | 1926 | support specific features (described in the appropriate section under |
1558 | module paramters, above). | 1927 | module parameters, above). |
1559 | 1928 | ||
1560 | In 802.3ad mode, it works with with systems that support IEEE | 1929 | In 802.3ad mode, it works with with systems that support IEEE |
1561 | 802.3ad Dynamic Link Aggregation. Most managed and many unmanaged | 1930 | 802.3ad Dynamic Link Aggregation. Most managed and many unmanaged |
@@ -1565,17 +1934,19 @@ switches currently available support 802.3ad. | |||
1565 | 1934 | ||
1566 | 8. Where does a bonding device get its MAC address from? | 1935 | 8. Where does a bonding device get its MAC address from? |
1567 | 1936 | ||
1568 | If not explicitly configured with ifconfig, the MAC address of | 1937 | If not explicitly configured (with ifconfig or ip link), the |
1569 | the bonding device is taken from its first slave device. This MAC | 1938 | MAC address of the bonding device is taken from its first slave |
1570 | address is then passed to all following slaves and remains persistent | 1939 | device. This MAC address is then passed to all following slaves and |
1571 | (even if the the first slave is removed) until the bonding device is | 1940 | remains persistent (even if the the first slave is removed) until the |
1572 | brought down or reconfigured. | 1941 | bonding device is brought down or reconfigured. |
1573 | 1942 | ||
1574 | If you wish to change the MAC address, you can set it with | 1943 | If you wish to change the MAC address, you can set it with |
1575 | ifconfig: | 1944 | ifconfig or ip link: |
1576 | 1945 | ||
1577 | # ifconfig bond0 hw ether 00:11:22:33:44:55 | 1946 | # ifconfig bond0 hw ether 00:11:22:33:44:55 |
1578 | 1947 | ||
1948 | # ip link set bond0 address 66:77:88:99:aa:bb | ||
1949 | |||
1579 | The MAC address can be also changed by bringing down/up the | 1950 | The MAC address can be also changed by bringing down/up the |
1580 | device and then changing its slaves (or their order): | 1951 | device and then changing its slaves (or their order): |
1581 | 1952 | ||
@@ -1591,23 +1962,28 @@ from the bond (`ifenslave -d bond0 eth0'). The bonding driver will | |||
1591 | then restore the MAC addresses that the slaves had before they were | 1962 | then restore the MAC addresses that the slaves had before they were |
1592 | enslaved. | 1963 | enslaved. |
1593 | 1964 | ||
1594 | 15. Resources and Links | 1965 | 16. Resources and Links |
1595 | ======================= | 1966 | ======================= |
1596 | 1967 | ||
1597 | The latest version of the bonding driver can be found in the latest | 1968 | The latest version of the bonding driver can be found in the latest |
1598 | version of the linux kernel, found on http://kernel.org | 1969 | version of the linux kernel, found on http://kernel.org |
1599 | 1970 | ||
1971 | The latest version of this document can be found in either the latest | ||
1972 | kernel source (named Documentation/networking/bonding.txt), or on the | ||
1973 | bonding sourceforge site: | ||
1974 | |||
1975 | http://www.sourceforge.net/projects/bonding | ||
1976 | |||
1600 | Discussions regarding the bonding driver take place primarily on the | 1977 | Discussions regarding the bonding driver take place primarily on the |
1601 | bonding-devel mailing list, hosted at sourceforge.net. If you have | 1978 | bonding-devel mailing list, hosted at sourceforge.net. If you have |
1602 | questions or problems, post them to the list. | 1979 | questions or problems, post them to the list. The list address is: |
1603 | 1980 | ||
1604 | bonding-devel@lists.sourceforge.net | 1981 | bonding-devel@lists.sourceforge.net |
1605 | 1982 | ||
1606 | https://lists.sourceforge.net/lists/listinfo/bonding-devel | 1983 | The administrative interface (to subscribe or unsubscribe) can |
1607 | 1984 | be found at: | |
1608 | There is also a project site on sourceforge. | ||
1609 | 1985 | ||
1610 | http://www.sourceforge.net/projects/bonding | 1986 | https://lists.sourceforge.net/lists/listinfo/bonding-devel |
1611 | 1987 | ||
1612 | Donald Becker's Ethernet Drivers and diag programs may be found at : | 1988 | Donald Becker's Ethernet Drivers and diag programs may be found at : |
1613 | - http://www.scyld.com/network/ | 1989 | - http://www.scyld.com/network/ |
diff --git a/Documentation/pci.txt b/Documentation/pci.txt index 62b1dc5d97e2..76d28d033657 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt | |||
@@ -266,20 +266,6 @@ port an old driver to the new PCI interface. They are no longer present | |||
266 | in the kernel as they aren't compatible with hotplug or PCI domains or | 266 | in the kernel as they aren't compatible with hotplug or PCI domains or |
267 | having sane locking. | 267 | having sane locking. |
268 | 268 | ||
269 | pcibios_present() and Since ages, you don't need to test presence | ||
270 | pci_present() of PCI subsystem when trying to talk to it. | ||
271 | If it's not there, the list of PCI devices | ||
272 | is empty and all functions for searching for | ||
273 | devices just return NULL. | ||
274 | pcibios_(read|write)_* Superseded by their pci_(read|write)_* | ||
275 | counterparts. | ||
276 | pcibios_find_* Superseded by their pci_get_* counterparts. | ||
277 | pci_for_each_dev() Superseded by pci_get_device() | ||
278 | pci_for_each_dev_reverse() Superseded by pci_find_device_reverse() | ||
279 | pci_for_each_bus() Superseded by pci_find_next_bus() | ||
280 | pci_find_device() Superseded by pci_get_device() | 269 | pci_find_device() Superseded by pci_get_device() |
281 | pci_find_subsys() Superseded by pci_get_subsys() | 270 | pci_find_subsys() Superseded by pci_get_subsys() |
282 | pci_find_slot() Superseded by pci_get_slot() | 271 | pci_find_slot() Superseded by pci_get_slot() |
283 | pcibios_find_class() Superseded by pci_get_class() | ||
284 | pci_find_class() Superseded by pci_get_class() | ||
285 | pci_(read|write)_*_nodev() Superseded by pci_bus_(read|write)_*() | ||
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index f1896ee3bb2a..63cb7edd177e 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -102,7 +102,7 @@ Here is the list of words, from left to right: | |||
102 | - URB Status. This field makes no sense for submissions, but is present | 102 | - URB Status. This field makes no sense for submissions, but is present |
103 | to help scripts with parsing. In error case, it contains the error code. | 103 | to help scripts with parsing. In error case, it contains the error code. |
104 | In case of a setup packet, it contains a Setup Tag. If scripts read a number | 104 | In case of a setup packet, it contains a Setup Tag. If scripts read a number |
105 | in this field, the proceed to read Data Length. Otherwise, they read | 105 | in this field, they proceed to read Data Length. Otherwise, they read |
106 | the setup packet before reading the Data Length. | 106 | the setup packet before reading the Data Length. |
107 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, | 107 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, |
108 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. | 108 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. |
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 6d44958289de..03deb0726aa4 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -29,3 +29,4 @@ card=27 - PixelView PlayTV Ultra Pro (Stereo) | |||
29 | card=28 - DViCO FusionHDTV 3 Gold-T | 29 | card=28 - DViCO FusionHDTV 3 Gold-T |
30 | card=29 - ADS Tech Instant TV DVB-T PCI | 30 | card=29 - ADS Tech Instant TV DVB-T PCI |
31 | card=30 - TerraTec Cinergy 1400 DVB-T | 31 | card=30 - TerraTec Cinergy 1400 DVB-T |
32 | card=31 - DViCO FusionHDTV 5 Gold | ||
diff --git a/Documentation/video4linux/CARDLIST.tuner b/Documentation/video4linux/CARDLIST.tuner index d1b9d21ffd89..f3302e1b1b9c 100644 --- a/Documentation/video4linux/CARDLIST.tuner +++ b/Documentation/video4linux/CARDLIST.tuner | |||
@@ -62,3 +62,5 @@ tuner=60 - Thomson DDT 7611 (ATSC/NTSC) | |||
62 | tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF | 62 | tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF |
63 | tuner=62 - Philips TEA5767HN FM Radio | 63 | tuner=62 - Philips TEA5767HN FM Radio |
64 | tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner | 64 | tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner |
65 | tuner=64 - LG TDVS-H062F/TUA6034 | ||
66 | tuner=65 - Ymec TVF66T5-B/DFF | ||
diff --git a/Documentation/video4linux/bttv/Insmod-options b/Documentation/video4linux/bttv/Insmod-options index 7bb5a50b0779..fc94ff235ffa 100644 --- a/Documentation/video4linux/bttv/Insmod-options +++ b/Documentation/video4linux/bttv/Insmod-options | |||
@@ -44,6 +44,9 @@ bttv.o | |||
44 | push used by bttv. bttv will disable overlay | 44 | push used by bttv. bttv will disable overlay |
45 | by default on this hardware to avoid crashes. | 45 | by default on this hardware to avoid crashes. |
46 | With this insmod option you can override this. | 46 | With this insmod option you can override this. |
47 | no_overlay=1 Disable overlay. It should be used by broken | ||
48 | hardware that doesn't support PCI2PCI direct | ||
49 | transfers. | ||
47 | automute=0/1 Automatically mutes the sound if there is | 50 | automute=0/1 Automatically mutes the sound if there is |
48 | no TV signal, on by default. You might try | 51 | no TV signal, on by default. You might try |
49 | to disable this if you have bad input signal | 52 | to disable this if you have bad input signal |
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 476c0c22fbb7..678e8f192db2 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -6,6 +6,11 @@ only the AMD64 specific ones are listed here. | |||
6 | Machine check | 6 | Machine check |
7 | 7 | ||
8 | mce=off disable machine check | 8 | mce=off disable machine check |
9 | mce=bootlog Enable logging of machine checks left over from booting. | ||
10 | Disabled by default because some BIOS leave bogus ones. | ||
11 | If your BIOS doesn't do that it's a good idea to enable though | ||
12 | to make sure you log even machine check events that result | ||
13 | in a reboot. | ||
9 | 14 | ||
10 | nomce (for compatibility with i386): same as mce=off | 15 | nomce (for compatibility with i386): same as mce=off |
11 | 16 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 562441d67b82..fb0da63621cd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -784,7 +784,7 @@ DVB SUBSYSTEM AND DRIVERS | |||
784 | P: LinuxTV.org Project | 784 | P: LinuxTV.org Project |
785 | M: linux-dvb-maintainer@linuxtv.org | 785 | M: linux-dvb-maintainer@linuxtv.org |
786 | L: linux-dvb@linuxtv.org (subscription required) | 786 | L: linux-dvb@linuxtv.org (subscription required) |
787 | W: http://linuxtv.org/developer/dvb.xml | 787 | W: http://linuxtv.org/ |
788 | S: Supported | 788 | S: Supported |
789 | 789 | ||
790 | EATA-DMA SCSI DRIVER | 790 | EATA-DMA SCSI DRIVER |
@@ -1528,6 +1528,12 @@ P: Zach Brown | |||
1528 | M: zab@zabbo.net | 1528 | M: zab@zabbo.net |
1529 | S: Odd Fixes | 1529 | S: Odd Fixes |
1530 | 1530 | ||
1531 | MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 | ||
1532 | P: Michael Kerrisk | ||
1533 | M: mtk-manpages@gmx.net | ||
1534 | W: ftp://ftp.kernel.org/pub/linux/docs/manpages | ||
1535 | S: Maintained | ||
1536 | |||
1531 | MARVELL MV64340 ETHERNET DRIVER | 1537 | MARVELL MV64340 ETHERNET DRIVER |
1532 | P: Manish Lachwani | 1538 | P: Manish Lachwani |
1533 | M: Manish_Lachwani@pmc-sierra.com | 1539 | M: Manish_Lachwani@pmc-sierra.com |
@@ -1659,7 +1665,7 @@ M: kuznet@ms2.inr.ac.ru | |||
1659 | P: Pekka Savola (ipv6) | 1665 | P: Pekka Savola (ipv6) |
1660 | M: pekkas@netcore.fi | 1666 | M: pekkas@netcore.fi |
1661 | P: James Morris | 1667 | P: James Morris |
1662 | M: jmorris@redhat.com | 1668 | M: jmorris@namei.org |
1663 | P: Hideaki YOSHIFUJI | 1669 | P: Hideaki YOSHIFUJI |
1664 | M: yoshfuji@linux-ipv6.org | 1670 | M: yoshfuji@linux-ipv6.org |
1665 | P: Patrick McHardy | 1671 | P: Patrick McHardy |
@@ -1740,7 +1746,7 @@ S: Maintained | |||
1740 | 1746 | ||
1741 | OPL3-SA2, SA3, and SAx DRIVER | 1747 | OPL3-SA2, SA3, and SAx DRIVER |
1742 | P: Zwane Mwaikambo | 1748 | P: Zwane Mwaikambo |
1743 | M: zwane@commfireservices.com | 1749 | M: zwane@arm.linux.org.uk |
1744 | L: linux-sound@vger.kernel.org | 1750 | L: linux-sound@vger.kernel.org |
1745 | S: Maintained | 1751 | S: Maintained |
1746 | 1752 | ||
@@ -1826,6 +1832,12 @@ P: Greg Kroah-Hartman | |||
1826 | M: greg@kroah.com | 1832 | M: greg@kroah.com |
1827 | S: Maintained | 1833 | S: Maintained |
1828 | 1834 | ||
1835 | PCIE HOTPLUG DRIVER | ||
1836 | P: Kristen Carlson Accardi | ||
1837 | M: kristen.c.accardi@intel.com | ||
1838 | L: pcihpd-discuss@lists.sourceforge.net | ||
1839 | S: Maintained | ||
1840 | |||
1829 | PCMCIA SUBSYSTEM | 1841 | PCMCIA SUBSYSTEM |
1830 | P: Linux PCMCIA Team | 1842 | P: Linux PCMCIA Team |
1831 | L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia | 1843 | L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia |
@@ -1990,7 +2002,7 @@ S: Maintained | |||
1990 | 2002 | ||
1991 | SC1200 WDT DRIVER | 2003 | SC1200 WDT DRIVER |
1992 | P: Zwane Mwaikambo | 2004 | P: Zwane Mwaikambo |
1993 | M: zwane@commfireservices.com | 2005 | M: zwane@arm.linux.org.uk |
1994 | S: Maintained | 2006 | S: Maintained |
1995 | 2007 | ||
1996 | SCHEDULER | 2008 | SCHEDULER |
@@ -2048,7 +2060,7 @@ SELINUX SECURITY MODULE | |||
2048 | P: Stephen Smalley | 2060 | P: Stephen Smalley |
2049 | M: sds@epoch.ncsc.mil | 2061 | M: sds@epoch.ncsc.mil |
2050 | P: James Morris | 2062 | P: James Morris |
2051 | M: jmorris@redhat.com | 2063 | M: jmorris@namei.org |
2052 | L: linux-kernel@vger.kernel.org (kernel issues) | 2064 | L: linux-kernel@vger.kernel.org (kernel issues) |
2053 | L: selinux@tycho.nsa.gov (general discussion) | 2065 | L: selinux@tycho.nsa.gov (general discussion) |
2054 | W: http://www.nsa.gov/selinux | 2066 | W: http://www.nsa.gov/selinux |
@@ -2202,6 +2214,12 @@ W: http://projects.buici.com/arm | |||
2202 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) | 2214 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) |
2203 | S: Maintained | 2215 | S: Maintained |
2204 | 2216 | ||
2217 | SHPC HOTPLUG DRIVER | ||
2218 | P: Kristen Carlson Accardi | ||
2219 | M: kristen.c.accardi@intel.com | ||
2220 | L: pcihpd-discuss@lists.sourceforge.net | ||
2221 | S: Maintained | ||
2222 | |||
2205 | SPARC (sparc32): | 2223 | SPARC (sparc32): |
2206 | P: William L. Irwin | 2224 | P: William L. Irwin |
2207 | M: wli@holomorphy.com | 2225 | M: wli@holomorphy.com |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 13 | 3 | SUBLEVEL = 13 |
4 | EXTRAVERSION =-rc4 | 4 | EXTRAVERSION =-rc7 |
5 | NAME=Woozy Numbat | 5 | NAME=Woozy Numbat |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/REPORTING-BUGS b/REPORTING-BUGS index 2045eaea2d9e..224c34741d32 100644 --- a/REPORTING-BUGS +++ b/REPORTING-BUGS | |||
@@ -41,18 +41,19 @@ summary from [1.]>" for easy identification by the developers | |||
41 | [2.] Full description of the problem/report: | 41 | [2.] Full description of the problem/report: |
42 | [3.] Keywords (i.e., modules, networking, kernel): | 42 | [3.] Keywords (i.e., modules, networking, kernel): |
43 | [4.] Kernel version (from /proc/version): | 43 | [4.] Kernel version (from /proc/version): |
44 | [5.] Output of Oops.. message (if applicable) with symbolic information | 44 | [5.] Most recent kernel version which did not have the bug: |
45 | [6.] Output of Oops.. message (if applicable) with symbolic information | ||
45 | resolved (see Documentation/oops-tracing.txt) | 46 | resolved (see Documentation/oops-tracing.txt) |
46 | [6.] A small shell script or example program which triggers the | 47 | [7.] A small shell script or example program which triggers the |
47 | problem (if possible) | 48 | problem (if possible) |
48 | [7.] Environment | 49 | [8.] Environment |
49 | [7.1.] Software (add the output of the ver_linux script here) | 50 | [8.1.] Software (add the output of the ver_linux script here) |
50 | [7.2.] Processor information (from /proc/cpuinfo): | 51 | [8.2.] Processor information (from /proc/cpuinfo): |
51 | [7.3.] Module information (from /proc/modules): | 52 | [8.3.] Module information (from /proc/modules): |
52 | [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) | 53 | [8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) |
53 | [7.5.] PCI information ('lspci -vvv' as root) | 54 | [8.5.] PCI information ('lspci -vvv' as root) |
54 | [7.6.] SCSI information (from /proc/scsi/scsi) | 55 | [8.6.] SCSI information (from /proc/scsi/scsi) |
55 | [7.7.] Other information that might be relevant to the problem | 56 | [8.7.] Other information that might be relevant to the problem |
56 | (please look in /proc and include all information that you | 57 | (please look in /proc and include all information that you |
57 | think to be relevant): | 58 | think to be relevant): |
58 | [X.] Other notes, patches, fixes, workarounds: | 59 | [X.] Other notes, patches, fixes, workarounds: |
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 083c5df42d35..189d5eababa8 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -522,7 +522,7 @@ source "mm/Kconfig" | |||
522 | 522 | ||
523 | config NUMA | 523 | config NUMA |
524 | bool "NUMA Support (EXPERIMENTAL)" | 524 | bool "NUMA Support (EXPERIMENTAL)" |
525 | depends on DISCONTIGMEM | 525 | depends on DISCONTIGMEM && BROKEN |
526 | help | 526 | help |
527 | Say Y to compile the kernel to support NUMA (Non-Uniform Memory | 527 | Say Y to compile the kernel to support NUMA (Non-Uniform Memory |
528 | Access). This option is for configuring high-end multiprocessor | 528 | Access). This option is for configuring high-end multiprocessor |
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 1f36bbd0ed5d..2a8b364c822e 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
350 | region->end = res->end - offset; | 350 | region->end = res->end - offset; |
351 | } | 351 | } |
352 | 352 | ||
353 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
354 | struct pci_bus_region *region) | ||
355 | { | ||
356 | struct pci_controller *hose = (struct pci_controller *)dev->sysdata; | ||
357 | unsigned long offset = 0; | ||
358 | |||
359 | if (res->flags & IORESOURCE_IO) | ||
360 | offset = hose->io_space->start; | ||
361 | else if (res->flags & IORESOURCE_MEM) | ||
362 | offset = hose->mem_space->start; | ||
363 | |||
364 | res->start = region->start + offset; | ||
365 | res->end = region->end + offset; | ||
366 | } | ||
367 | |||
353 | #ifdef CONFIG_HOTPLUG | 368 | #ifdef CONFIG_HOTPLUG |
354 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 369 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
370 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
355 | #endif | 371 | #endif |
356 | 372 | ||
357 | int | 373 | int |
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 8f1e78551b1e..e211aa7404e6 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -1036,7 +1036,7 @@ debug_spin_lock(spinlock_t * lock, const char *base_file, int line_no) | |||
1036 | " br 1b\n" | 1036 | " br 1b\n" |
1037 | ".previous" | 1037 | ".previous" |
1038 | : "=r" (tmp), "=m" (lock->lock), "=r" (stuck) | 1038 | : "=r" (tmp), "=m" (lock->lock), "=r" (stuck) |
1039 | : "1" (lock->lock), "2" (stuck) : "memory"); | 1039 | : "m" (lock->lock), "2" (stuck) : "memory"); |
1040 | 1040 | ||
1041 | if (stuck < 0) { | 1041 | if (stuck < 0) { |
1042 | printk(KERN_WARNING | 1042 | printk(KERN_WARNING |
@@ -1115,7 +1115,7 @@ void _raw_write_lock(rwlock_t * lock) | |||
1115 | ".previous" | 1115 | ".previous" |
1116 | : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy), | 1116 | : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy), |
1117 | "=&r" (stuck_lock), "=&r" (stuck_reader) | 1117 | "=&r" (stuck_lock), "=&r" (stuck_reader) |
1118 | : "0" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory"); | 1118 | : "m" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory"); |
1119 | 1119 | ||
1120 | if (stuck_lock < 0) { | 1120 | if (stuck_lock < 0) { |
1121 | printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc); | 1121 | printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc); |
@@ -1153,7 +1153,7 @@ void _raw_read_lock(rwlock_t * lock) | |||
1153 | " br 1b\n" | 1153 | " br 1b\n" |
1154 | ".previous" | 1154 | ".previous" |
1155 | : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock) | 1155 | : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock) |
1156 | : "0" (*(volatile int *)lock), "2" (stuck_lock) : "memory"); | 1156 | : "m" (*(volatile int *)lock), "2" (stuck_lock) : "memory"); |
1157 | 1157 | ||
1158 | if (stuck_lock < 0) { | 1158 | if (stuck_lock < 0) { |
1159 | printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc); | 1159 | printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc); |
diff --git a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c index 908eb4af8dec..ba788cfdc3c6 100644 --- a/arch/alpha/oprofile/common.c +++ b/arch/alpha/oprofile/common.c | |||
@@ -65,7 +65,7 @@ op_axp_setup(void) | |||
65 | model->reg_setup(®, ctr, &sys); | 65 | model->reg_setup(®, ctr, &sys); |
66 | 66 | ||
67 | /* Configure the registers on all cpus. */ | 67 | /* Configure the registers on all cpus. */ |
68 | smp_call_function(model->cpu_setup, ®, 0, 1); | 68 | (void)smp_call_function(model->cpu_setup, ®, 0, 1); |
69 | model->cpu_setup(®); | 69 | model->cpu_setup(®); |
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
@@ -86,7 +86,7 @@ op_axp_cpu_start(void *dummy) | |||
86 | static int | 86 | static int |
87 | op_axp_start(void) | 87 | op_axp_start(void) |
88 | { | 88 | { |
89 | smp_call_function(op_axp_cpu_start, NULL, 0, 1); | 89 | (void)smp_call_function(op_axp_cpu_start, NULL, 0, 1); |
90 | op_axp_cpu_start(NULL); | 90 | op_axp_cpu_start(NULL); |
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
@@ -101,7 +101,7 @@ op_axp_cpu_stop(void *dummy) | |||
101 | static void | 101 | static void |
102 | op_axp_stop(void) | 102 | op_axp_stop(void) |
103 | { | 103 | { |
104 | smp_call_function(op_axp_cpu_stop, NULL, 0, 1); | 104 | (void)smp_call_function(op_axp_cpu_stop, NULL, 0, 1); |
105 | op_axp_cpu_stop(NULL); | 105 | op_axp_cpu_stop(NULL); |
106 | } | 106 | } |
107 | 107 | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7bc4a583f4e1..c65c6eb9810d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -310,7 +310,7 @@ menu "Kernel Features" | |||
310 | 310 | ||
311 | config SMP | 311 | config SMP |
312 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" | 312 | bool "Symmetric Multi-Processing (EXPERIMENTAL)" |
313 | depends on EXPERIMENTAL #&& n | 313 | depends on EXPERIMENTAL && BROKEN #&& n |
314 | help | 314 | help |
315 | This enables support for systems with more than one CPU. If you have | 315 | This enables support for systems with more than one CPU. If you have |
316 | a system with only one CPU, like most personal computers, say N. If | 316 | a system with only one CPU, like most personal computers, say N. If |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index ad26e98f1e62..c4923fac8dff 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
447 | region->end = res->end - offset; | 447 | region->end = res->end - offset; |
448 | } | 448 | } |
449 | 449 | ||
450 | void __devinit | ||
451 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
452 | struct pci_bus_region *region) | ||
453 | { | ||
454 | struct pci_sys_data *root = dev->sysdata; | ||
455 | unsigned long offset = 0; | ||
456 | |||
457 | if (res->flags & IORESOURCE_IO) | ||
458 | offset = root->io_offset; | ||
459 | if (res->flags & IORESOURCE_MEM) | ||
460 | offset = root->mem_offset; | ||
461 | |||
462 | res->start = region->start + offset; | ||
463 | res->end = region->end + offset; | ||
464 | } | ||
465 | |||
450 | #ifdef CONFIG_HOTPLUG | 466 | #ifdef CONFIG_HOTPLUG |
451 | EXPORT_SYMBOL(pcibios_fixup_bus); | 467 | EXPORT_SYMBOL(pcibios_fixup_bus); |
452 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 468 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
469 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
453 | #endif | 470 | #endif |
454 | 471 | ||
455 | /* | 472 | /* |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index e5d370c235d7..2b6b4c786e65 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -327,6 +327,12 @@ __syscall_start: | |||
327 | /* 310 */ .long sys_request_key | 327 | /* 310 */ .long sys_request_key |
328 | .long sys_keyctl | 328 | .long sys_keyctl |
329 | .long sys_semtimedop | 329 | .long sys_semtimedop |
330 | /* vserver */ .long sys_ni_syscall | ||
331 | .long sys_ioprio_set | ||
332 | /* 315 */ .long sys_ioprio_get | ||
333 | .long sys_inotify_init | ||
334 | .long sys_inotify_add_watch | ||
335 | .long sys_inotify_rm_watch | ||
330 | __syscall_end: | 336 | __syscall_end: |
331 | 337 | ||
332 | .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 | 338 | .rept NR_syscalls - (__syscall_end - __syscall_start) / 4 |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 39a6c1b0b9a3..7152bfbee581 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -533,6 +533,13 @@ ENTRY(__switch_to) | |||
533 | ldr r3, [r2, #TI_TP_VALUE] | 533 | ldr r3, [r2, #TI_TP_VALUE] |
534 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack | 534 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack |
535 | ldr r6, [r2, #TI_CPU_DOMAIN]! | 535 | ldr r6, [r2, #TI_CPU_DOMAIN]! |
536 | #if __LINUX_ARM_ARCH__ >= 6 | ||
537 | #ifdef CONFIG_CPU_MPCORE | ||
538 | clrex | ||
539 | #else | ||
540 | strex r3, r4, [ip] @ Clear exclusive monitor | ||
541 | #endif | ||
542 | #endif | ||
536 | #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) | 543 | #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) |
537 | mra r4, r5, acc0 | 544 | mra r4, r5, acc0 |
538 | stmia ip, {r4, r5} | 545 | stmia ip, {r4, r5} |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index d571c37ac30c..4554c961251c 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -617,7 +617,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) | |||
617 | notify_die("unknown data abort code", regs, &info, instr, 0); | 617 | notify_die("unknown data abort code", regs, &info, instr, 0); |
618 | } | 618 | } |
619 | 619 | ||
620 | volatile void __bug(const char *file, int line, void *data) | 620 | void __attribute__((noreturn)) __bug(const char *file, int line, void *data) |
621 | { | 621 | { |
622 | printk(KERN_CRIT"kernel BUG at %s:%d!", file, line); | 622 | printk(KERN_CRIT"kernel BUG at %s:%d!", file, line); |
623 | if (data) | 623 | if (data) |
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 2036ff15bda9..64a988c1ad44 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #if __LINUX_ARM_ARCH__ >= 6 | 1 | #include <linux/config.h> |
2 | |||
3 | #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE) | ||
2 | .macro bitop, instr | 4 | .macro bitop, instr |
3 | mov r2, #1 | 5 | mov r2, #1 |
4 | and r3, r0, #7 @ Get bit offset | 6 | and r3, r0, #7 @ Get bit offset |
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c index 4ff4393ef0ea..411ea9996190 100644 --- a/arch/arm/mach-ixp4xx/coyote-setup.c +++ b/arch/arm/mach-ixp4xx/coyote-setup.c | |||
@@ -36,7 +36,7 @@ static struct flash_platform_data coyote_flash_data = { | |||
36 | 36 | ||
37 | static struct resource coyote_flash_resource = { | 37 | static struct resource coyote_flash_resource = { |
38 | .start = COYOTE_FLASH_BASE, | 38 | .start = COYOTE_FLASH_BASE, |
39 | .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE, | 39 | .end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1, |
40 | .flags = IORESOURCE_MEM, | 40 | .flags = IORESOURCE_MEM, |
41 | }; | 41 | }; |
42 | 42 | ||
@@ -61,7 +61,7 @@ static struct plat_serial8250_port coyote_uart_data[] = { | |||
61 | .mapbase = IXP4XX_UART2_BASE_PHYS, | 61 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
62 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | 62 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
63 | .irq = IRQ_IXP4XX_UART2, | 63 | .irq = IRQ_IXP4XX_UART2, |
64 | .flags = UPF_BOOT_AUTOCONF, | 64 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
65 | .iotype = UPIO_MEM, | 65 | .iotype = UPIO_MEM, |
66 | .regshift = 2, | 66 | .regshift = 2, |
67 | .uartclk = IXP4XX_UART_XTAL, | 67 | .uartclk = IXP4XX_UART_XTAL, |
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c index 8ba1cd9406e7..333459d6aa46 100644 --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c +++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c | |||
@@ -83,7 +83,7 @@ static struct plat_serial8250_port gtwx5715_uart_platform_data[] = { | |||
83 | .mapbase = IXP4XX_UART2_BASE_PHYS, | 83 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
84 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | 84 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
85 | .irq = IRQ_IXP4XX_UART2, | 85 | .irq = IRQ_IXP4XX_UART2, |
86 | .flags = UPF_BOOT_AUTOCONF, | 86 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
87 | .iotype = UPIO_MEM, | 87 | .iotype = UPIO_MEM, |
88 | .regshift = 2, | 88 | .regshift = 2, |
89 | .uartclk = IXP4XX_UART_XTAL, | 89 | .uartclk = IXP4XX_UART_XTAL, |
@@ -114,7 +114,7 @@ static struct flash_platform_data gtwx5715_flash_data = { | |||
114 | 114 | ||
115 | static struct resource gtwx5715_flash_resource = { | 115 | static struct resource gtwx5715_flash_resource = { |
116 | .start = GTWX5715_FLASH_BASE, | 116 | .start = GTWX5715_FLASH_BASE, |
117 | .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE, | 117 | .end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1, |
118 | .flags = IORESOURCE_MEM, | 118 | .flags = IORESOURCE_MEM, |
119 | }; | 119 | }; |
120 | 120 | ||
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index c2ba759e9946..fa0646c8693b 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -36,7 +36,7 @@ static struct flash_platform_data ixdp425_flash_data = { | |||
36 | 36 | ||
37 | static struct resource ixdp425_flash_resource = { | 37 | static struct resource ixdp425_flash_resource = { |
38 | .start = IXDP425_FLASH_BASE, | 38 | .start = IXDP425_FLASH_BASE, |
39 | .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE, | 39 | .end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1, |
40 | .flags = IORESOURCE_MEM, | 40 | .flags = IORESOURCE_MEM, |
41 | }; | 41 | }; |
42 | 42 | ||
@@ -82,7 +82,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = { | |||
82 | .mapbase = IXP4XX_UART1_BASE_PHYS, | 82 | .mapbase = IXP4XX_UART1_BASE_PHYS, |
83 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, | 83 | .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, |
84 | .irq = IRQ_IXP4XX_UART1, | 84 | .irq = IRQ_IXP4XX_UART1, |
85 | .flags = UPF_BOOT_AUTOCONF, | 85 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
86 | .iotype = UPIO_MEM, | 86 | .iotype = UPIO_MEM, |
87 | .regshift = 2, | 87 | .regshift = 2, |
88 | .uartclk = IXP4XX_UART_XTAL, | 88 | .uartclk = IXP4XX_UART_XTAL, |
@@ -91,7 +91,7 @@ static struct plat_serial8250_port ixdp425_uart_data[] = { | |||
91 | .mapbase = IXP4XX_UART2_BASE_PHYS, | 91 | .mapbase = IXP4XX_UART2_BASE_PHYS, |
92 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, | 92 | .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, |
93 | .irq = IRQ_IXP4XX_UART1, | 93 | .irq = IRQ_IXP4XX_UART1, |
94 | .flags = UPF_BOOT_AUTOCONF, | 94 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, |
95 | .iotype = UPIO_MEM, | 95 | .iotype = UPIO_MEM, |
96 | .regshift = 2, | 96 | .regshift = 2, |
97 | .uartclk = IXP4XX_UART_XTAL, | 97 | .uartclk = IXP4XX_UART_XTAL, |
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c index 1e7f343822d0..e9182242da95 100644 --- a/arch/arm/mach-s3c2410/mach-bast.c +++ b/arch/arm/mach-s3c2410/mach-bast.c | |||
@@ -30,6 +30,7 @@ | |||
30 | * 28-Jun-2005 BJD Moved pm functionality out to common code | 30 | * 28-Jun-2005 BJD Moved pm functionality out to common code |
31 | * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s | 31 | * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s |
32 | * 25-Jul-2005 BJD Removed ASIX static mappings | 32 | * 25-Jul-2005 BJD Removed ASIX static mappings |
33 | * 27-Jul-2005 BJD Ensure maximum frequency of i2c bus | ||
33 | */ | 34 | */ |
34 | 35 | ||
35 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
@@ -60,6 +61,7 @@ | |||
60 | #include <asm/arch/regs-mem.h> | 61 | #include <asm/arch/regs-mem.h> |
61 | #include <asm/arch/regs-lcd.h> | 62 | #include <asm/arch/regs-lcd.h> |
62 | #include <asm/arch/nand.h> | 63 | #include <asm/arch/nand.h> |
64 | #include <asm/arch/iic.h> | ||
63 | 65 | ||
64 | #include <linux/mtd/mtd.h> | 66 | #include <linux/mtd/mtd.h> |
65 | #include <linux/mtd/nand.h> | 67 | #include <linux/mtd/nand.h> |
@@ -304,7 +306,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot) | |||
304 | } | 306 | } |
305 | 307 | ||
306 | static struct s3c2410_platform_nand bast_nand_info = { | 308 | static struct s3c2410_platform_nand bast_nand_info = { |
307 | .tacls = 80, | 309 | .tacls = 40, |
308 | .twrph0 = 80, | 310 | .twrph0 = 80, |
309 | .twrph1 = 80, | 311 | .twrph1 = 80, |
310 | .nr_sets = ARRAY_SIZE(bast_nand_sets), | 312 | .nr_sets = ARRAY_SIZE(bast_nand_sets), |
@@ -385,6 +387,17 @@ static struct platform_device bast_sio = { | |||
385 | }, | 387 | }, |
386 | }; | 388 | }; |
387 | 389 | ||
390 | /* we have devices on the bus which cannot work much over the | ||
391 | * standard 100KHz i2c bus frequency | ||
392 | */ | ||
393 | |||
394 | static struct s3c2410_platform_i2c bast_i2c_info = { | ||
395 | .flags = 0, | ||
396 | .slave_addr = 0x10, | ||
397 | .bus_freq = 100*1000, | ||
398 | .max_freq = 130*1000, | ||
399 | }; | ||
400 | |||
388 | /* Standard BAST devices */ | 401 | /* Standard BAST devices */ |
389 | 402 | ||
390 | static struct platform_device *bast_devices[] __initdata = { | 403 | static struct platform_device *bast_devices[] __initdata = { |
@@ -431,6 +444,7 @@ void __init bast_map_io(void) | |||
431 | s3c24xx_uclk.parent = &s3c24xx_clkout1; | 444 | s3c24xx_uclk.parent = &s3c24xx_clkout1; |
432 | 445 | ||
433 | s3c_device_nand.dev.platform_data = &bast_nand_info; | 446 | s3c_device_nand.dev.platform_data = &bast_nand_info; |
447 | s3c_device_i2c.dev.platform_data = &bast_i2c_info; | ||
434 | 448 | ||
435 | s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); | 449 | s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); |
436 | s3c24xx_init_clocks(0); | 450 | s3c24xx_init_clocks(0); |
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index ff2f25409e44..0b88993dfd27 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c | |||
@@ -18,6 +18,7 @@ | |||
18 | * 28-Sep-2004 BJD Updates for new serial port bits | 18 | * 28-Sep-2004 BJD Updates for new serial port bits |
19 | * 04-Nov-2004 BJD Updated UART configuration process | 19 | * 04-Nov-2004 BJD Updated UART configuration process |
20 | * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate | 20 | * 10-Jan-2005 BJD Removed s3c2410_clock_tick_rate |
21 | * 13-Aug-2005 DA Removed UART from initial I/O mappings | ||
21 | */ | 22 | */ |
22 | 23 | ||
23 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
@@ -49,10 +50,9 @@ static struct map_desc s3c2410_iodesc[] __initdata = { | |||
49 | IODESC_ENT(USBHOST), | 50 | IODESC_ENT(USBHOST), |
50 | IODESC_ENT(CLKPWR), | 51 | IODESC_ENT(CLKPWR), |
51 | IODESC_ENT(LCD), | 52 | IODESC_ENT(LCD), |
52 | IODESC_ENT(UART), | ||
53 | IODESC_ENT(TIMER), | 53 | IODESC_ENT(TIMER), |
54 | IODESC_ENT(ADC), | 54 | IODESC_ENT(ADC), |
55 | IODESC_ENT(WATCHDOG) | 55 | IODESC_ENT(WATCHDOG), |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static struct resource s3c_uart0_resource[] = { | 58 | static struct resource s3c_uart0_resource[] = { |
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c index 7f2b61362976..f021fd82be52 100644 --- a/arch/arm/mach-s3c2410/usb-simtec.c +++ b/arch/arm/mach-s3c2410/usb-simtec.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/usb-simtec.c | 1 | /* linux/arch/arm/mach-s3c2410/usb-simtec.c |
2 | * | 2 | * |
3 | * Copyright (c) 2004 Simtec Electronics | 3 | * Copyright (c) 2004,2005 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * http://www.simtec.co.uk/products/EB2410ITX/ | 6 | * http://www.simtec.co.uk/products/EB2410ITX/ |
@@ -14,6 +14,8 @@ | |||
14 | * Modifications: | 14 | * Modifications: |
15 | * 14-Sep-2004 BJD Created | 15 | * 14-Sep-2004 BJD Created |
16 | * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared | 16 | * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared |
17 | * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc | ||
18 | * 09-Aug-2005 BJD Ports powered only if both are enabled | ||
17 | */ | 19 | */ |
18 | 20 | ||
19 | #define DEBUG | 21 | #define DEBUG |
@@ -47,13 +49,19 @@ | |||
47 | * designed boards. | 49 | * designed boards. |
48 | */ | 50 | */ |
49 | 51 | ||
52 | static unsigned int power_state[2]; | ||
53 | |||
50 | static void | 54 | static void |
51 | usb_simtec_powercontrol(int port, int to) | 55 | usb_simtec_powercontrol(int port, int to) |
52 | { | 56 | { |
53 | pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); | 57 | pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); |
54 | 58 | ||
55 | if (port == 1) | 59 | power_state[port] = to; |
56 | s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); | 60 | |
61 | if (power_state[0] && power_state[1]) | ||
62 | s3c2410_gpio_setpin(S3C2410_GPB4, 0); | ||
63 | else | ||
64 | s3c2410_gpio_setpin(S3C2410_GPB4, 1); | ||
57 | } | 65 | } |
58 | 66 | ||
59 | static irqreturn_t | 67 | static irqreturn_t |
@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs) | |||
63 | 71 | ||
64 | if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { | 72 | if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { |
65 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); | 73 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); |
66 | s3c2410_report_oc(info, 3); | 74 | s3c2410_usb_report_oc(info, 3); |
67 | } else { | 75 | } else { |
68 | pr_debug("usb_simtec: over-current irq (oc cleared)\n"); | 76 | pr_debug("usb_simtec: over-current irq (oc cleared)\n"); |
69 | s3c2410_report_oc(info, 0); | 77 | s3c2410_usb_report_oc(info, 0); |
70 | } | 78 | } |
71 | 79 | ||
72 | return IRQ_HANDLED; | 80 | return IRQ_HANDLED; |
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index eee3cbc5ec4f..2f497112c96a 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c | |||
@@ -97,6 +97,7 @@ static void __init jornada720_map_io(void) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | MACHINE_START(JORNADA720, "HP Jornada 720") | 99 | MACHINE_START(JORNADA720, "HP Jornada 720") |
100 | /* Maintainer: Michael Gernoth <michael@gernoth.net> */ | ||
100 | .phys_ram = 0xc0000000, | 101 | .phys_ram = 0xc0000000, |
101 | .phys_io = 0x80000000, | 102 | .phys_io = 0x80000000, |
102 | .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, | 103 | .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index afbbeb6f4658..db5e47dfc303 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -384,7 +384,7 @@ config CPU_DCACHE_DISABLE | |||
384 | 384 | ||
385 | config CPU_DCACHE_WRITETHROUGH | 385 | config CPU_DCACHE_WRITETHROUGH |
386 | bool "Force write through D-cache" | 386 | bool "Force write through D-cache" |
387 | depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DISABLE_DCACHE | 387 | depends on (CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020) && !CPU_DCACHE_DISABLE |
388 | default y if CPU_ARM925T | 388 | default y if CPU_ARM925T |
389 | help | 389 | help |
390 | Say Y here to use the data cache in writethrough mode. Unless you | 390 | Say Y here to use the data cache in writethrough mode. Unless you |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 65bfe84b6d67..0b6c4db44e08 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
@@ -238,9 +238,9 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
238 | up_read(&mm->mmap_sem); | 238 | up_read(&mm->mmap_sem); |
239 | 239 | ||
240 | /* | 240 | /* |
241 | * Handle the "normal" case first | 241 | * Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR |
242 | */ | 242 | */ |
243 | if (fault > 0) | 243 | if (fault >= VM_FAULT_MINOR) |
244 | return 0; | 244 | return 0; |
245 | 245 | ||
246 | /* | 246 | /* |
@@ -261,7 +261,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
261 | do_exit(SIGKILL); | 261 | do_exit(SIGKILL); |
262 | return 0; | 262 | return 0; |
263 | 263 | ||
264 | case 0: | 264 | case VM_FAULT_SIGBUS: |
265 | /* | 265 | /* |
266 | * We had some memory, but were unable to | 266 | * We had some memory, but were unable to |
267 | * successfully fix up this page fault. | 267 | * successfully fix up this page fault. |
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index e33fe4229d05..3c655c54e231 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c | |||
@@ -383,6 +383,7 @@ static void __init build_mem_type_table(void) | |||
383 | { | 383 | { |
384 | struct cachepolicy *cp; | 384 | struct cachepolicy *cp; |
385 | unsigned int cr = get_cr(); | 385 | unsigned int cr = get_cr(); |
386 | unsigned int user_pgprot; | ||
386 | int cpu_arch = cpu_architecture(); | 387 | int cpu_arch = cpu_architecture(); |
387 | int i; | 388 | int i; |
388 | 389 | ||
@@ -408,6 +409,9 @@ static void __init build_mem_type_table(void) | |||
408 | } | 409 | } |
409 | } | 410 | } |
410 | 411 | ||
412 | cp = &cache_policies[cachepolicy]; | ||
413 | user_pgprot = cp->pte; | ||
414 | |||
411 | /* | 415 | /* |
412 | * ARMv6 and above have extended page tables. | 416 | * ARMv6 and above have extended page tables. |
413 | */ | 417 | */ |
@@ -426,11 +430,18 @@ static void __init build_mem_type_table(void) | |||
426 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 430 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
427 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 431 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
428 | 432 | ||
433 | /* | ||
434 | * Mark the device area as "shared device" | ||
435 | */ | ||
429 | mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE; | 436 | mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE; |
430 | mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; | 437 | mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; |
431 | } | ||
432 | 438 | ||
433 | cp = &cache_policies[cachepolicy]; | 439 | /* |
440 | * User pages need to be mapped with the ASID | ||
441 | * (iow, non-global) | ||
442 | */ | ||
443 | user_pgprot |= L_PTE_ASID; | ||
444 | } | ||
434 | 445 | ||
435 | if (cpu_arch >= CPU_ARCH_ARMv5) { | 446 | if (cpu_arch >= CPU_ARCH_ARMv5) { |
436 | mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; | 447 | mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; |
@@ -448,7 +459,7 @@ static void __init build_mem_type_table(void) | |||
448 | 459 | ||
449 | for (i = 0; i < 16; i++) { | 460 | for (i = 0; i < 16; i++) { |
450 | unsigned long v = pgprot_val(protection_map[i]); | 461 | unsigned long v = pgprot_val(protection_map[i]); |
451 | v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | cp->pte; | 462 | v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot; |
452 | protection_map[i] = __pgprot(v); | 463 | protection_map[i] = __pgprot(v); |
453 | } | 464 | } |
454 | 465 | ||
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 352db98ee269..139a38670c5d 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -105,18 +105,12 @@ ENTRY(cpu_v6_dcache_clean_area) | |||
105 | ENTRY(cpu_v6_switch_mm) | 105 | ENTRY(cpu_v6_switch_mm) |
106 | mov r2, #0 | 106 | mov r2, #0 |
107 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id | 107 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id |
108 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB | 108 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB |
109 | mcr p15, 0, r2, c7, c10, 4 @ drain write buffer | 109 | mcr p15, 0, r2, c7, c10, 4 @ drain write buffer |
110 | mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 110 | mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
112 | mov pc, lr | 112 | mov pc, lr |
113 | 113 | ||
114 | #define nG (1 << 11) | ||
115 | #define APX (1 << 9) | ||
116 | #define AP1 (1 << 5) | ||
117 | #define AP0 (1 << 4) | ||
118 | #define XN (1 << 0) | ||
119 | |||
120 | /* | 114 | /* |
121 | * cpu_v6_set_pte(ptep, pte) | 115 | * cpu_v6_set_pte(ptep, pte) |
122 | * | 116 | * |
@@ -139,24 +133,24 @@ ENTRY(cpu_v6_switch_mm) | |||
139 | ENTRY(cpu_v6_set_pte) | 133 | ENTRY(cpu_v6_set_pte) |
140 | str r1, [r0], #-2048 @ linux version | 134 | str r1, [r0], #-2048 @ linux version |
141 | 135 | ||
142 | bic r2, r1, #0x00000ff0 | 136 | bic r2, r1, #0x000007f0 |
143 | bic r2, r2, #0x00000003 | 137 | bic r2, r2, #0x00000003 |
144 | orr r2, r2, #AP0 | 2 | 138 | orr r2, r2, #PTE_EXT_AP0 | 2 |
145 | 139 | ||
146 | tst r1, #L_PTE_WRITE | 140 | tst r1, #L_PTE_WRITE |
147 | tstne r1, #L_PTE_DIRTY | 141 | tstne r1, #L_PTE_DIRTY |
148 | orreq r2, r2, #APX | 142 | orreq r2, r2, #PTE_EXT_APX |
149 | 143 | ||
150 | tst r1, #L_PTE_USER | 144 | tst r1, #L_PTE_USER |
151 | orrne r2, r2, #AP1 | nG | 145 | orrne r2, r2, #PTE_EXT_AP1 |
152 | tstne r2, #APX | 146 | tstne r2, #PTE_EXT_APX |
153 | bicne r2, r2, #APX | AP0 | 147 | bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0 |
154 | 148 | ||
155 | tst r1, #L_PTE_YOUNG | 149 | tst r1, #L_PTE_YOUNG |
156 | biceq r2, r2, #APX | AP1 | AP0 | 150 | biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK |
157 | 151 | ||
158 | @ tst r1, #L_PTE_EXEC | 152 | @ tst r1, #L_PTE_EXEC |
159 | @ orreq r2, r2, #XN | 153 | @ orreq r2, r2, #PTE_EXT_XN |
160 | 154 | ||
161 | tst r1, #L_PTE_PRESENT | 155 | tst r1, #L_PTE_PRESENT |
162 | moveq r2, #0 | 156 | moveq r2, #0 |
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index 2d977b4eeeab..b88de2700146 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S | |||
@@ -370,142 +370,6 @@ ENTRY(cpu_xscale_dcache_clean_area) | |||
370 | bhi 1b | 370 | bhi 1b |
371 | mov pc, lr | 371 | mov pc, lr |
372 | 372 | ||
373 | /* ================================ CACHE LOCKING============================ | ||
374 | * | ||
375 | * The XScale MicroArchitecture implements support for locking entries into | ||
376 | * the data and instruction cache. The following functions implement the core | ||
377 | * low level instructions needed to accomplish the locking. The developer's | ||
378 | * manual states that the code that performs the locking must be in non-cached | ||
379 | * memory. To accomplish this, the code in xscale-cache-lock.c copies the | ||
380 | * following functions from the cache into a non-cached memory region that | ||
381 | * is allocated through consistent_alloc(). | ||
382 | * | ||
383 | */ | ||
384 | .align 5 | ||
385 | /* | ||
386 | * xscale_icache_lock | ||
387 | * | ||
388 | * r0: starting address to lock | ||
389 | * r1: end address to lock | ||
390 | */ | ||
391 | ENTRY(xscale_icache_lock) | ||
392 | |||
393 | iLockLoop: | ||
394 | bic r0, r0, #CACHELINESIZE - 1 | ||
395 | mcr p15, 0, r0, c9, c1, 0 @ lock into cache | ||
396 | cmp r0, r1 @ are we done? | ||
397 | add r0, r0, #CACHELINESIZE @ advance to next cache line | ||
398 | bls iLockLoop | ||
399 | mov pc, lr | ||
400 | |||
401 | /* | ||
402 | * xscale_icache_unlock | ||
403 | */ | ||
404 | ENTRY(xscale_icache_unlock) | ||
405 | mcr p15, 0, r0, c9, c1, 1 @ Unlock icache | ||
406 | mov pc, lr | ||
407 | |||
408 | /* | ||
409 | * xscale_dcache_lock | ||
410 | * | ||
411 | * r0: starting address to lock | ||
412 | * r1: end address to lock | ||
413 | */ | ||
414 | ENTRY(xscale_dcache_lock) | ||
415 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer | ||
416 | mov r2, #1 | ||
417 | mcr p15, 0, r2, c9, c2, 0 @ Put dcache in lock mode | ||
418 | cpwait ip @ Wait for completion | ||
419 | |||
420 | mrs r2, cpsr | ||
421 | orr r3, r2, #PSR_F_BIT | PSR_I_BIT | ||
422 | dLockLoop: | ||
423 | msr cpsr_c, r3 | ||
424 | mcr p15, 0, r0, c7, c10, 1 @ Write back line if it is dirty | ||
425 | mcr p15, 0, r0, c7, c6, 1 @ Flush/invalidate line | ||
426 | msr cpsr_c, r2 | ||
427 | ldr ip, [r0], #CACHELINESIZE @ Preload 32 bytes into cache from | ||
428 | @ location [r0]. Post-increment | ||
429 | @ r3 to next cache line | ||
430 | cmp r0, r1 @ Are we done? | ||
431 | bls dLockLoop | ||
432 | |||
433 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer | ||
434 | mov r2, #0 | ||
435 | mcr p15, 0, r2, c9, c2, 0 @ Get out of lock mode | ||
436 | cpwait_ret lr, ip | ||
437 | |||
438 | /* | ||
439 | * xscale_dcache_unlock | ||
440 | */ | ||
441 | ENTRY(xscale_dcache_unlock) | ||
442 | mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer | ||
443 | mcr p15, 0, ip, c9, c2, 1 @ Unlock cache | ||
444 | mov pc, lr | ||
445 | |||
446 | /* | ||
447 | * Needed to determine the length of the code that needs to be copied. | ||
448 | */ | ||
449 | .align 5 | ||
450 | ENTRY(xscale_cache_dummy) | ||
451 | mov pc, lr | ||
452 | |||
453 | /* ================================ TLB LOCKING============================== | ||
454 | * | ||
455 | * The XScale MicroArchitecture implements support for locking entries into | ||
456 | * the Instruction and Data TLBs. The following functions provide the | ||
457 | * low level support for supporting these under Linux. xscale-lock.c | ||
458 | * implements some higher level management code. Most of the following | ||
459 | * is taken straight out of the Developer's Manual. | ||
460 | */ | ||
461 | |||
462 | /* | ||
463 | * Lock I-TLB entry | ||
464 | * | ||
465 | * r0: Virtual address to translate and lock | ||
466 | */ | ||
467 | .align 5 | ||
468 | ENTRY(xscale_itlb_lock) | ||
469 | mrs r2, cpsr | ||
470 | orr r3, r2, #PSR_F_BIT | PSR_I_BIT | ||
471 | msr cpsr_c, r3 @ Disable interrupts | ||
472 | mcr p15, 0, r0, c8, c5, 1 @ Invalidate I-TLB entry | ||
473 | mcr p15, 0, r0, c10, c4, 0 @ Translate and lock | ||
474 | msr cpsr_c, r2 @ Restore interrupts | ||
475 | cpwait_ret lr, ip | ||
476 | |||
477 | /* | ||
478 | * Lock D-TLB entry | ||
479 | * | ||
480 | * r0: Virtual address to translate and lock | ||
481 | */ | ||
482 | .align 5 | ||
483 | ENTRY(xscale_dtlb_lock) | ||
484 | mrs r2, cpsr | ||
485 | orr r3, r2, #PSR_F_BIT | PSR_I_BIT | ||
486 | msr cpsr_c, r3 @ Disable interrupts | ||
487 | mcr p15, 0, r0, c8, c6, 1 @ Invalidate D-TLB entry | ||
488 | mcr p15, 0, r0, c10, c8, 0 @ Translate and lock | ||
489 | msr cpsr_c, r2 @ Restore interrupts | ||
490 | cpwait_ret lr, ip | ||
491 | |||
492 | /* | ||
493 | * Unlock all I-TLB entries | ||
494 | */ | ||
495 | .align 5 | ||
496 | ENTRY(xscale_itlb_unlock) | ||
497 | mcr p15, 0, ip, c10, c4, 1 @ Unlock I-TLB | ||
498 | mcr p15, 0, ip, c8, c5, 0 @ Invalidate I-TLB | ||
499 | cpwait_ret lr, ip | ||
500 | |||
501 | /* | ||
502 | * Unlock all D-TLB entries | ||
503 | */ | ||
504 | ENTRY(xscale_dtlb_unlock) | ||
505 | mcr p15, 0, ip, c10, c8, 1 @ Unlock D-TBL | ||
506 | mcr p15, 0, ip, c8, c6, 0 @ Invalidate D-TLB | ||
507 | cpwait_ret lr, ip | ||
508 | |||
509 | /* =============================== PageTable ============================== */ | 373 | /* =============================== PageTable ============================== */ |
510 | 374 | ||
511 | #define PTE_CACHE_WRITE_ALLOCATE 0 | 375 | #define PTE_CACHE_WRITE_ALLOCATE 0 |
diff --git a/arch/arm/nwfpe/double_cpdo.c b/arch/arm/nwfpe/double_cpdo.c index 7ffd8cb9bc96..c51d1386a97c 100644 --- a/arch/arm/nwfpe/double_cpdo.c +++ b/arch/arm/nwfpe/double_cpdo.c | |||
@@ -40,17 +40,17 @@ float64 float64_arccos(float64 rFm); | |||
40 | float64 float64_pow(float64 rFn, float64 rFm); | 40 | float64 float64_pow(float64 rFn, float64 rFm); |
41 | float64 float64_pol(float64 rFn, float64 rFm); | 41 | float64 float64_pol(float64 rFn, float64 rFm); |
42 | 42 | ||
43 | static float64 float64_rsf(float64 rFn, float64 rFm) | 43 | static float64 float64_rsf(struct roundingData *roundData, float64 rFn, float64 rFm) |
44 | { | 44 | { |
45 | return float64_sub(rFm, rFn); | 45 | return float64_sub(roundData, rFm, rFn); |
46 | } | 46 | } |
47 | 47 | ||
48 | static float64 float64_rdv(float64 rFn, float64 rFm) | 48 | static float64 float64_rdv(struct roundingData *roundData, float64 rFn, float64 rFm) |
49 | { | 49 | { |
50 | return float64_div(rFm, rFn); | 50 | return float64_div(roundData, rFm, rFn); |
51 | } | 51 | } |
52 | 52 | ||
53 | static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { | 53 | static float64 (*const dyadic_double[16])(struct roundingData*, float64 rFn, float64 rFm) = { |
54 | [ADF_CODE >> 20] = float64_add, | 54 | [ADF_CODE >> 20] = float64_add, |
55 | [MUF_CODE >> 20] = float64_mul, | 55 | [MUF_CODE >> 20] = float64_mul, |
56 | [SUF_CODE >> 20] = float64_sub, | 56 | [SUF_CODE >> 20] = float64_sub, |
@@ -65,12 +65,12 @@ static float64 (*const dyadic_double[16])(float64 rFn, float64 rFm) = { | |||
65 | [FRD_CODE >> 20] = float64_rdv, | 65 | [FRD_CODE >> 20] = float64_rdv, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static float64 float64_mvf(float64 rFm) | 68 | static float64 float64_mvf(struct roundingData *roundData,float64 rFm) |
69 | { | 69 | { |
70 | return rFm; | 70 | return rFm; |
71 | } | 71 | } |
72 | 72 | ||
73 | static float64 float64_mnf(float64 rFm) | 73 | static float64 float64_mnf(struct roundingData *roundData,float64 rFm) |
74 | { | 74 | { |
75 | union float64_components u; | 75 | union float64_components u; |
76 | 76 | ||
@@ -84,7 +84,7 @@ static float64 float64_mnf(float64 rFm) | |||
84 | return u.f64; | 84 | return u.f64; |
85 | } | 85 | } |
86 | 86 | ||
87 | static float64 float64_abs(float64 rFm) | 87 | static float64 float64_abs(struct roundingData *roundData,float64 rFm) |
88 | { | 88 | { |
89 | union float64_components u; | 89 | union float64_components u; |
90 | 90 | ||
@@ -98,7 +98,7 @@ static float64 float64_abs(float64 rFm) | |||
98 | return u.f64; | 98 | return u.f64; |
99 | } | 99 | } |
100 | 100 | ||
101 | static float64 (*const monadic_double[16])(float64 rFm) = { | 101 | static float64 (*const monadic_double[16])(struct roundingData *, float64 rFm) = { |
102 | [MVF_CODE >> 20] = float64_mvf, | 102 | [MVF_CODE >> 20] = float64_mvf, |
103 | [MNF_CODE >> 20] = float64_mnf, | 103 | [MNF_CODE >> 20] = float64_mnf, |
104 | [ABS_CODE >> 20] = float64_abs, | 104 | [ABS_CODE >> 20] = float64_abs, |
@@ -108,7 +108,7 @@ static float64 (*const monadic_double[16])(float64 rFm) = { | |||
108 | [NRM_CODE >> 20] = float64_mvf, | 108 | [NRM_CODE >> 20] = float64_mvf, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) | 111 | unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd) |
112 | { | 112 | { |
113 | FPA11 *fpa11 = GET_FPA11(); | 113 | FPA11 *fpa11 = GET_FPA11(); |
114 | float64 rFm; | 114 | float64 rFm; |
@@ -151,13 +151,13 @@ unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | if (dyadic_double[opc_mask_shift]) { | 153 | if (dyadic_double[opc_mask_shift]) { |
154 | rFd->fDouble = dyadic_double[opc_mask_shift](rFn, rFm); | 154 | rFd->fDouble = dyadic_double[opc_mask_shift](roundData, rFn, rFm); |
155 | } else { | 155 | } else { |
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | } else { | 158 | } else { |
159 | if (monadic_double[opc_mask_shift]) { | 159 | if (monadic_double[opc_mask_shift]) { |
160 | rFd->fDouble = monadic_double[opc_mask_shift](rFm); | 160 | rFd->fDouble = monadic_double[opc_mask_shift](roundData, rFm); |
161 | } else { | 161 | } else { |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
diff --git a/arch/arm/nwfpe/extended_cpdo.c b/arch/arm/nwfpe/extended_cpdo.c index c39f68a3449e..65a279ba927f 100644 --- a/arch/arm/nwfpe/extended_cpdo.c +++ b/arch/arm/nwfpe/extended_cpdo.c | |||
@@ -35,17 +35,17 @@ floatx80 floatx80_arccos(floatx80 rFm); | |||
35 | floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm); | 35 | floatx80 floatx80_pow(floatx80 rFn, floatx80 rFm); |
36 | floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm); | 36 | floatx80 floatx80_pol(floatx80 rFn, floatx80 rFm); |
37 | 37 | ||
38 | static floatx80 floatx80_rsf(floatx80 rFn, floatx80 rFm) | 38 | static floatx80 floatx80_rsf(struct roundingData *roundData, floatx80 rFn, floatx80 rFm) |
39 | { | 39 | { |
40 | return floatx80_sub(rFm, rFn); | 40 | return floatx80_sub(roundData, rFm, rFn); |
41 | } | 41 | } |
42 | 42 | ||
43 | static floatx80 floatx80_rdv(floatx80 rFn, floatx80 rFm) | 43 | static floatx80 floatx80_rdv(struct roundingData *roundData, floatx80 rFn, floatx80 rFm) |
44 | { | 44 | { |
45 | return floatx80_div(rFm, rFn); | 45 | return floatx80_div(roundData, rFm, rFn); |
46 | } | 46 | } |
47 | 47 | ||
48 | static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = { | 48 | static floatx80 (*const dyadic_extended[16])(struct roundingData*, floatx80 rFn, floatx80 rFm) = { |
49 | [ADF_CODE >> 20] = floatx80_add, | 49 | [ADF_CODE >> 20] = floatx80_add, |
50 | [MUF_CODE >> 20] = floatx80_mul, | 50 | [MUF_CODE >> 20] = floatx80_mul, |
51 | [SUF_CODE >> 20] = floatx80_sub, | 51 | [SUF_CODE >> 20] = floatx80_sub, |
@@ -60,24 +60,24 @@ static floatx80 (*const dyadic_extended[16])(floatx80 rFn, floatx80 rFm) = { | |||
60 | [FRD_CODE >> 20] = floatx80_rdv, | 60 | [FRD_CODE >> 20] = floatx80_rdv, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static floatx80 floatx80_mvf(floatx80 rFm) | 63 | static floatx80 floatx80_mvf(struct roundingData *roundData, floatx80 rFm) |
64 | { | 64 | { |
65 | return rFm; | 65 | return rFm; |
66 | } | 66 | } |
67 | 67 | ||
68 | static floatx80 floatx80_mnf(floatx80 rFm) | 68 | static floatx80 floatx80_mnf(struct roundingData *roundData, floatx80 rFm) |
69 | { | 69 | { |
70 | rFm.high ^= 0x8000; | 70 | rFm.high ^= 0x8000; |
71 | return rFm; | 71 | return rFm; |
72 | } | 72 | } |
73 | 73 | ||
74 | static floatx80 floatx80_abs(floatx80 rFm) | 74 | static floatx80 floatx80_abs(struct roundingData *roundData, floatx80 rFm) |
75 | { | 75 | { |
76 | rFm.high &= 0x7fff; | 76 | rFm.high &= 0x7fff; |
77 | return rFm; | 77 | return rFm; |
78 | } | 78 | } |
79 | 79 | ||
80 | static floatx80 (*const monadic_extended[16])(floatx80 rFm) = { | 80 | static floatx80 (*const monadic_extended[16])(struct roundingData*, floatx80 rFm) = { |
81 | [MVF_CODE >> 20] = floatx80_mvf, | 81 | [MVF_CODE >> 20] = floatx80_mvf, |
82 | [MNF_CODE >> 20] = floatx80_mnf, | 82 | [MNF_CODE >> 20] = floatx80_mnf, |
83 | [ABS_CODE >> 20] = floatx80_abs, | 83 | [ABS_CODE >> 20] = floatx80_abs, |
@@ -87,7 +87,7 @@ static floatx80 (*const monadic_extended[16])(floatx80 rFm) = { | |||
87 | [NRM_CODE >> 20] = floatx80_mvf, | 87 | [NRM_CODE >> 20] = floatx80_mvf, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd) | 90 | unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd) |
91 | { | 91 | { |
92 | FPA11 *fpa11 = GET_FPA11(); | 92 | FPA11 *fpa11 = GET_FPA11(); |
93 | floatx80 rFm; | 93 | floatx80 rFm; |
@@ -138,13 +138,13 @@ unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | if (dyadic_extended[opc_mask_shift]) { | 140 | if (dyadic_extended[opc_mask_shift]) { |
141 | rFd->fExtended = dyadic_extended[opc_mask_shift](rFn, rFm); | 141 | rFd->fExtended = dyadic_extended[opc_mask_shift](roundData, rFn, rFm); |
142 | } else { | 142 | } else { |
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | } else { | 145 | } else { |
146 | if (monadic_extended[opc_mask_shift]) { | 146 | if (monadic_extended[opc_mask_shift]) { |
147 | rFd->fExtended = monadic_extended[opc_mask_shift](rFm); | 147 | rFd->fExtended = monadic_extended[opc_mask_shift](roundData, rFm); |
148 | } else { | 148 | } else { |
149 | return 0; | 149 | return 0; |
150 | } | 150 | } |
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c index bf61696865ec..7690f731ee87 100644 --- a/arch/arm/nwfpe/fpa11.c +++ b/arch/arm/nwfpe/fpa11.c | |||
@@ -51,48 +51,42 @@ static void resetFPA11(void) | |||
51 | fpa11->fpsr = FP_EMULATOR | BIT_AC; | 51 | fpa11->fpsr = FP_EMULATOR | BIT_AC; |
52 | } | 52 | } |
53 | 53 | ||
54 | void SetRoundingMode(const unsigned int opcode) | 54 | int8 SetRoundingMode(const unsigned int opcode) |
55 | { | 55 | { |
56 | switch (opcode & MASK_ROUNDING_MODE) { | 56 | switch (opcode & MASK_ROUNDING_MODE) { |
57 | default: | 57 | default: |
58 | case ROUND_TO_NEAREST: | 58 | case ROUND_TO_NEAREST: |
59 | float_rounding_mode = float_round_nearest_even; | 59 | return float_round_nearest_even; |
60 | break; | ||
61 | 60 | ||
62 | case ROUND_TO_PLUS_INFINITY: | 61 | case ROUND_TO_PLUS_INFINITY: |
63 | float_rounding_mode = float_round_up; | 62 | return float_round_up; |
64 | break; | ||
65 | 63 | ||
66 | case ROUND_TO_MINUS_INFINITY: | 64 | case ROUND_TO_MINUS_INFINITY: |
67 | float_rounding_mode = float_round_down; | 65 | return float_round_down; |
68 | break; | ||
69 | 66 | ||
70 | case ROUND_TO_ZERO: | 67 | case ROUND_TO_ZERO: |
71 | float_rounding_mode = float_round_to_zero; | 68 | return float_round_to_zero; |
72 | break; | ||
73 | } | 69 | } |
74 | } | 70 | } |
75 | 71 | ||
76 | void SetRoundingPrecision(const unsigned int opcode) | 72 | int8 SetRoundingPrecision(const unsigned int opcode) |
77 | { | 73 | { |
78 | #ifdef CONFIG_FPE_NWFPE_XP | 74 | #ifdef CONFIG_FPE_NWFPE_XP |
79 | switch (opcode & MASK_ROUNDING_PRECISION) { | 75 | switch (opcode & MASK_ROUNDING_PRECISION) { |
80 | case ROUND_SINGLE: | 76 | case ROUND_SINGLE: |
81 | floatx80_rounding_precision = 32; | 77 | return 32; |
82 | break; | ||
83 | 78 | ||
84 | case ROUND_DOUBLE: | 79 | case ROUND_DOUBLE: |
85 | floatx80_rounding_precision = 64; | 80 | return 64; |
86 | break; | ||
87 | 81 | ||
88 | case ROUND_EXTENDED: | 82 | case ROUND_EXTENDED: |
89 | floatx80_rounding_precision = 80; | 83 | return 80; |
90 | break; | ||
91 | 84 | ||
92 | default: | 85 | default: |
93 | floatx80_rounding_precision = 80; | 86 | return 80; |
94 | } | 87 | } |
95 | #endif | 88 | #endif |
89 | return 80; | ||
96 | } | 90 | } |
97 | 91 | ||
98 | void nwfpe_init_fpa(union fp_state *fp) | 92 | void nwfpe_init_fpa(union fp_state *fp) |
@@ -103,8 +97,6 @@ void nwfpe_init_fpa(union fp_state *fp) | |||
103 | #endif | 97 | #endif |
104 | memset(fpa11, 0, sizeof(FPA11)); | 98 | memset(fpa11, 0, sizeof(FPA11)); |
105 | resetFPA11(); | 99 | resetFPA11(); |
106 | SetRoundingMode(ROUND_TO_NEAREST); | ||
107 | SetRoundingPrecision(ROUND_EXTENDED); | ||
108 | fpa11->initflag = 1; | 100 | fpa11->initflag = 1; |
109 | } | 101 | } |
110 | 102 | ||
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h index e4a61aea534b..93523ae4b7a1 100644 --- a/arch/arm/nwfpe/fpa11.h +++ b/arch/arm/nwfpe/fpa11.h | |||
@@ -37,6 +37,13 @@ | |||
37 | /* includes */ | 37 | /* includes */ |
38 | #include "fpsr.h" /* FP control and status register definitions */ | 38 | #include "fpsr.h" /* FP control and status register definitions */ |
39 | #include "milieu.h" | 39 | #include "milieu.h" |
40 | |||
41 | struct roundingData { | ||
42 | int8 mode; | ||
43 | int8 precision; | ||
44 | signed char exception; | ||
45 | }; | ||
46 | |||
40 | #include "softfloat.h" | 47 | #include "softfloat.h" |
41 | 48 | ||
42 | #define typeNone 0x00 | 49 | #define typeNone 0x00 |
@@ -84,8 +91,8 @@ typedef struct tagFPA11 { | |||
84 | initialised. */ | 91 | initialised. */ |
85 | } FPA11; | 92 | } FPA11; |
86 | 93 | ||
87 | extern void SetRoundingMode(const unsigned int); | 94 | extern int8 SetRoundingMode(const unsigned int); |
88 | extern void SetRoundingPrecision(const unsigned int); | 95 | extern int8 SetRoundingPrecision(const unsigned int); |
89 | extern void nwfpe_init_fpa(union fp_state *fp); | 96 | extern void nwfpe_init_fpa(union fp_state *fp); |
90 | 97 | ||
91 | #endif | 98 | #endif |
diff --git a/arch/arm/nwfpe/fpa11_cpdo.c b/arch/arm/nwfpe/fpa11_cpdo.c index 1bea67437b6f..4a31dfd94068 100644 --- a/arch/arm/nwfpe/fpa11_cpdo.c +++ b/arch/arm/nwfpe/fpa11_cpdo.c | |||
@@ -24,15 +24,16 @@ | |||
24 | #include "fpa11.h" | 24 | #include "fpa11.h" |
25 | #include "fpopcode.h" | 25 | #include "fpopcode.h" |
26 | 26 | ||
27 | unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd); | 27 | unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd); |
28 | unsigned int DoubleCPDO(const unsigned int opcode, FPREG * rFd); | 28 | unsigned int DoubleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd); |
29 | unsigned int ExtendedCPDO(const unsigned int opcode, FPREG * rFd); | 29 | unsigned int ExtendedCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd); |
30 | 30 | ||
31 | unsigned int EmulateCPDO(const unsigned int opcode) | 31 | unsigned int EmulateCPDO(const unsigned int opcode) |
32 | { | 32 | { |
33 | FPA11 *fpa11 = GET_FPA11(); | 33 | FPA11 *fpa11 = GET_FPA11(); |
34 | FPREG *rFd; | 34 | FPREG *rFd; |
35 | unsigned int nType, nDest, nRc; | 35 | unsigned int nType, nDest, nRc; |
36 | struct roundingData roundData; | ||
36 | 37 | ||
37 | /* Get the destination size. If not valid let Linux perform | 38 | /* Get the destination size. If not valid let Linux perform |
38 | an invalid instruction trap. */ | 39 | an invalid instruction trap. */ |
@@ -40,7 +41,9 @@ unsigned int EmulateCPDO(const unsigned int opcode) | |||
40 | if (typeNone == nDest) | 41 | if (typeNone == nDest) |
41 | return 0; | 42 | return 0; |
42 | 43 | ||
43 | SetRoundingMode(opcode); | 44 | roundData.mode = SetRoundingMode(opcode); |
45 | roundData.precision = SetRoundingPrecision(opcode); | ||
46 | roundData.exception = 0; | ||
44 | 47 | ||
45 | /* Compare the size of the operands in Fn and Fm. | 48 | /* Compare the size of the operands in Fn and Fm. |
46 | Choose the largest size and perform operations in that size, | 49 | Choose the largest size and perform operations in that size, |
@@ -63,14 +66,14 @@ unsigned int EmulateCPDO(const unsigned int opcode) | |||
63 | 66 | ||
64 | switch (nType) { | 67 | switch (nType) { |
65 | case typeSingle: | 68 | case typeSingle: |
66 | nRc = SingleCPDO(opcode, rFd); | 69 | nRc = SingleCPDO(&roundData, opcode, rFd); |
67 | break; | 70 | break; |
68 | case typeDouble: | 71 | case typeDouble: |
69 | nRc = DoubleCPDO(opcode, rFd); | 72 | nRc = DoubleCPDO(&roundData, opcode, rFd); |
70 | break; | 73 | break; |
71 | #ifdef CONFIG_FPE_NWFPE_XP | 74 | #ifdef CONFIG_FPE_NWFPE_XP |
72 | case typeExtended: | 75 | case typeExtended: |
73 | nRc = ExtendedCPDO(opcode, rFd); | 76 | nRc = ExtendedCPDO(&roundData, opcode, rFd); |
74 | break; | 77 | break; |
75 | #endif | 78 | #endif |
76 | default: | 79 | default: |
@@ -93,9 +96,9 @@ unsigned int EmulateCPDO(const unsigned int opcode) | |||
93 | case typeSingle: | 96 | case typeSingle: |
94 | { | 97 | { |
95 | if (typeDouble == nType) | 98 | if (typeDouble == nType) |
96 | rFd->fSingle = float64_to_float32(rFd->fDouble); | 99 | rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble); |
97 | else | 100 | else |
98 | rFd->fSingle = floatx80_to_float32(rFd->fExtended); | 101 | rFd->fSingle = floatx80_to_float32(&roundData, rFd->fExtended); |
99 | } | 102 | } |
100 | break; | 103 | break; |
101 | 104 | ||
@@ -104,7 +107,7 @@ unsigned int EmulateCPDO(const unsigned int opcode) | |||
104 | if (typeSingle == nType) | 107 | if (typeSingle == nType) |
105 | rFd->fDouble = float32_to_float64(rFd->fSingle); | 108 | rFd->fDouble = float32_to_float64(rFd->fSingle); |
106 | else | 109 | else |
107 | rFd->fDouble = floatx80_to_float64(rFd->fExtended); | 110 | rFd->fDouble = floatx80_to_float64(&roundData, rFd->fExtended); |
108 | } | 111 | } |
109 | break; | 112 | break; |
110 | 113 | ||
@@ -121,12 +124,15 @@ unsigned int EmulateCPDO(const unsigned int opcode) | |||
121 | #else | 124 | #else |
122 | if (nDest != nType) { | 125 | if (nDest != nType) { |
123 | if (nDest == typeSingle) | 126 | if (nDest == typeSingle) |
124 | rFd->fSingle = float64_to_float32(rFd->fDouble); | 127 | rFd->fSingle = float64_to_float32(&roundData, rFd->fDouble); |
125 | else | 128 | else |
126 | rFd->fDouble = float32_to_float64(rFd->fSingle); | 129 | rFd->fDouble = float32_to_float64(rFd->fSingle); |
127 | } | 130 | } |
128 | #endif | 131 | #endif |
129 | } | 132 | } |
130 | 133 | ||
134 | if (roundData.exception) | ||
135 | float_raise(roundData.exception); | ||
136 | |||
131 | return nRc; | 137 | return nRc; |
132 | } | 138 | } |
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c index 95fb63fa9d18..b0db5cbcc3b1 100644 --- a/arch/arm/nwfpe/fpa11_cpdt.c +++ b/arch/arm/nwfpe/fpa11_cpdt.c | |||
@@ -96,7 +96,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int __user | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) | 99 | static inline void storeSingle(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem) |
100 | { | 100 | { |
101 | FPA11 *fpa11 = GET_FPA11(); | 101 | FPA11 *fpa11 = GET_FPA11(); |
102 | union { | 102 | union { |
@@ -106,12 +106,12 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) | |||
106 | 106 | ||
107 | switch (fpa11->fType[Fn]) { | 107 | switch (fpa11->fType[Fn]) { |
108 | case typeDouble: | 108 | case typeDouble: |
109 | val.f = float64_to_float32(fpa11->fpreg[Fn].fDouble); | 109 | val.f = float64_to_float32(roundData, fpa11->fpreg[Fn].fDouble); |
110 | break; | 110 | break; |
111 | 111 | ||
112 | #ifdef CONFIG_FPE_NWFPE_XP | 112 | #ifdef CONFIG_FPE_NWFPE_XP |
113 | case typeExtended: | 113 | case typeExtended: |
114 | val.f = floatx80_to_float32(fpa11->fpreg[Fn].fExtended); | 114 | val.f = floatx80_to_float32(roundData, fpa11->fpreg[Fn].fExtended); |
115 | break; | 115 | break; |
116 | #endif | 116 | #endif |
117 | 117 | ||
@@ -122,7 +122,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem) | |||
122 | put_user(val.i[0], pMem); | 122 | put_user(val.i[0], pMem); |
123 | } | 123 | } |
124 | 124 | ||
125 | static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem) | 125 | static inline void storeDouble(struct roundingData *roundData, const unsigned int Fn, unsigned int __user *pMem) |
126 | { | 126 | { |
127 | FPA11 *fpa11 = GET_FPA11(); | 127 | FPA11 *fpa11 = GET_FPA11(); |
128 | union { | 128 | union { |
@@ -137,7 +137,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem) | |||
137 | 137 | ||
138 | #ifdef CONFIG_FPE_NWFPE_XP | 138 | #ifdef CONFIG_FPE_NWFPE_XP |
139 | case typeExtended: | 139 | case typeExtended: |
140 | val.f = floatx80_to_float64(fpa11->fpreg[Fn].fExtended); | 140 | val.f = floatx80_to_float64(roundData, fpa11->fpreg[Fn].fExtended); |
141 | break; | 141 | break; |
142 | #endif | 142 | #endif |
143 | 143 | ||
@@ -259,8 +259,11 @@ unsigned int PerformSTF(const unsigned int opcode) | |||
259 | { | 259 | { |
260 | unsigned int __user *pBase, *pAddress, *pFinal; | 260 | unsigned int __user *pBase, *pAddress, *pFinal; |
261 | unsigned int nRc = 1, write_back = WRITE_BACK(opcode); | 261 | unsigned int nRc = 1, write_back = WRITE_BACK(opcode); |
262 | struct roundingData roundData; | ||
262 | 263 | ||
263 | SetRoundingMode(ROUND_TO_NEAREST); | 264 | roundData.mode = SetRoundingMode(opcode); |
265 | roundData.precision = SetRoundingPrecision(opcode); | ||
266 | roundData.exception = 0; | ||
264 | 267 | ||
265 | pBase = (unsigned int __user *) readRegister(getRn(opcode)); | 268 | pBase = (unsigned int __user *) readRegister(getRn(opcode)); |
266 | if (REG_PC == getRn(opcode)) { | 269 | if (REG_PC == getRn(opcode)) { |
@@ -281,10 +284,10 @@ unsigned int PerformSTF(const unsigned int opcode) | |||
281 | 284 | ||
282 | switch (opcode & MASK_TRANSFER_LENGTH) { | 285 | switch (opcode & MASK_TRANSFER_LENGTH) { |
283 | case TRANSFER_SINGLE: | 286 | case TRANSFER_SINGLE: |
284 | storeSingle(getFd(opcode), pAddress); | 287 | storeSingle(&roundData, getFd(opcode), pAddress); |
285 | break; | 288 | break; |
286 | case TRANSFER_DOUBLE: | 289 | case TRANSFER_DOUBLE: |
287 | storeDouble(getFd(opcode), pAddress); | 290 | storeDouble(&roundData, getFd(opcode), pAddress); |
288 | break; | 291 | break; |
289 | #ifdef CONFIG_FPE_NWFPE_XP | 292 | #ifdef CONFIG_FPE_NWFPE_XP |
290 | case TRANSFER_EXTENDED: | 293 | case TRANSFER_EXTENDED: |
@@ -295,6 +298,9 @@ unsigned int PerformSTF(const unsigned int opcode) | |||
295 | nRc = 0; | 298 | nRc = 0; |
296 | } | 299 | } |
297 | 300 | ||
301 | if (roundData.exception) | ||
302 | float_raise(roundData.exception); | ||
303 | |||
298 | if (write_back) | 304 | if (write_back) |
299 | writeRegister(getRn(opcode), (unsigned long) pFinal); | 305 | writeRegister(getRn(opcode), (unsigned long) pFinal); |
300 | return nRc; | 306 | return nRc; |
diff --git a/arch/arm/nwfpe/fpa11_cprt.c b/arch/arm/nwfpe/fpa11_cprt.c index db01fbc97216..adf8d3000540 100644 --- a/arch/arm/nwfpe/fpa11_cprt.c +++ b/arch/arm/nwfpe/fpa11_cprt.c | |||
@@ -33,8 +33,6 @@ extern flag floatx80_is_nan(floatx80); | |||
33 | extern flag float64_is_nan(float64); | 33 | extern flag float64_is_nan(float64); |
34 | extern flag float32_is_nan(float32); | 34 | extern flag float32_is_nan(float32); |
35 | 35 | ||
36 | void SetRoundingMode(const unsigned int opcode); | ||
37 | |||
38 | unsigned int PerformFLT(const unsigned int opcode); | 36 | unsigned int PerformFLT(const unsigned int opcode); |
39 | unsigned int PerformFIX(const unsigned int opcode); | 37 | unsigned int PerformFIX(const unsigned int opcode); |
40 | 38 | ||
@@ -77,14 +75,17 @@ unsigned int EmulateCPRT(const unsigned int opcode) | |||
77 | unsigned int PerformFLT(const unsigned int opcode) | 75 | unsigned int PerformFLT(const unsigned int opcode) |
78 | { | 76 | { |
79 | FPA11 *fpa11 = GET_FPA11(); | 77 | FPA11 *fpa11 = GET_FPA11(); |
80 | SetRoundingMode(opcode); | 78 | struct roundingData roundData; |
81 | SetRoundingPrecision(opcode); | 79 | |
80 | roundData.mode = SetRoundingMode(opcode); | ||
81 | roundData.precision = SetRoundingPrecision(opcode); | ||
82 | roundData.exception = 0; | ||
82 | 83 | ||
83 | switch (opcode & MASK_ROUNDING_PRECISION) { | 84 | switch (opcode & MASK_ROUNDING_PRECISION) { |
84 | case ROUND_SINGLE: | 85 | case ROUND_SINGLE: |
85 | { | 86 | { |
86 | fpa11->fType[getFn(opcode)] = typeSingle; | 87 | fpa11->fType[getFn(opcode)] = typeSingle; |
87 | fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(readRegister(getRd(opcode))); | 88 | fpa11->fpreg[getFn(opcode)].fSingle = int32_to_float32(&roundData, readRegister(getRd(opcode))); |
88 | } | 89 | } |
89 | break; | 90 | break; |
90 | 91 | ||
@@ -108,6 +109,9 @@ unsigned int PerformFLT(const unsigned int opcode) | |||
108 | return 0; | 109 | return 0; |
109 | } | 110 | } |
110 | 111 | ||
112 | if (roundData.exception) | ||
113 | float_raise(roundData.exception); | ||
114 | |||
111 | return 1; | 115 | return 1; |
112 | } | 116 | } |
113 | 117 | ||
@@ -115,26 +119,29 @@ unsigned int PerformFIX(const unsigned int opcode) | |||
115 | { | 119 | { |
116 | FPA11 *fpa11 = GET_FPA11(); | 120 | FPA11 *fpa11 = GET_FPA11(); |
117 | unsigned int Fn = getFm(opcode); | 121 | unsigned int Fn = getFm(opcode); |
122 | struct roundingData roundData; | ||
118 | 123 | ||
119 | SetRoundingMode(opcode); | 124 | roundData.mode = SetRoundingMode(opcode); |
125 | roundData.precision = SetRoundingPrecision(opcode); | ||
126 | roundData.exception = 0; | ||
120 | 127 | ||
121 | switch (fpa11->fType[Fn]) { | 128 | switch (fpa11->fType[Fn]) { |
122 | case typeSingle: | 129 | case typeSingle: |
123 | { | 130 | { |
124 | writeRegister(getRd(opcode), float32_to_int32(fpa11->fpreg[Fn].fSingle)); | 131 | writeRegister(getRd(opcode), float32_to_int32(&roundData, fpa11->fpreg[Fn].fSingle)); |
125 | } | 132 | } |
126 | break; | 133 | break; |
127 | 134 | ||
128 | case typeDouble: | 135 | case typeDouble: |
129 | { | 136 | { |
130 | writeRegister(getRd(opcode), float64_to_int32(fpa11->fpreg[Fn].fDouble)); | 137 | writeRegister(getRd(opcode), float64_to_int32(&roundData, fpa11->fpreg[Fn].fDouble)); |
131 | } | 138 | } |
132 | break; | 139 | break; |
133 | 140 | ||
134 | #ifdef CONFIG_FPE_NWFPE_XP | 141 | #ifdef CONFIG_FPE_NWFPE_XP |
135 | case typeExtended: | 142 | case typeExtended: |
136 | { | 143 | { |
137 | writeRegister(getRd(opcode), floatx80_to_int32(fpa11->fpreg[Fn].fExtended)); | 144 | writeRegister(getRd(opcode), floatx80_to_int32(&roundData, fpa11->fpreg[Fn].fExtended)); |
138 | } | 145 | } |
139 | break; | 146 | break; |
140 | #endif | 147 | #endif |
@@ -143,6 +150,9 @@ unsigned int PerformFIX(const unsigned int opcode) | |||
143 | return 0; | 150 | return 0; |
144 | } | 151 | } |
145 | 152 | ||
153 | if (roundData.exception) | ||
154 | float_raise(roundData.exception); | ||
155 | |||
146 | return 1; | 156 | return 1; |
147 | } | 157 | } |
148 | 158 | ||
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 12885f31d347..2dfe1ac42ee8 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c | |||
@@ -116,8 +116,6 @@ fpmodule.c to integrate with the NetBSD kernel (I hope!). | |||
116 | code to access data in user space in some other source files at the | 116 | code to access data in user space in some other source files at the |
117 | moment (grep for get_user / put_user calls). --philb] | 117 | moment (grep for get_user / put_user calls). --philb] |
118 | 118 | ||
119 | float_exception_flags is a global variable in SoftFloat. | ||
120 | |||
121 | This function is called by the SoftFloat routines to raise a floating | 119 | This function is called by the SoftFloat routines to raise a floating |
122 | point exception. We check the trap enable byte in the FPSR, and raise | 120 | point exception. We check the trap enable byte in the FPSR, and raise |
123 | a SIGFPE exception if necessary. If not the relevant bits in the | 121 | a SIGFPE exception if necessary. If not the relevant bits in the |
@@ -129,15 +127,14 @@ void float_raise(signed char flags) | |||
129 | register unsigned int fpsr, cumulativeTraps; | 127 | register unsigned int fpsr, cumulativeTraps; |
130 | 128 | ||
131 | #ifdef CONFIG_DEBUG_USER | 129 | #ifdef CONFIG_DEBUG_USER |
132 | printk(KERN_DEBUG | 130 | /* Ignore inexact errors as there are far too many of them to log */ |
133 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", | 131 | if (flags & ~BIT_IXC) |
134 | current->comm, current->pid, flags, | 132 | printk(KERN_DEBUG |
135 | __builtin_return_address(0), GET_USERREG()->ARM_pc); | 133 | "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", |
134 | current->comm, current->pid, flags, | ||
135 | __builtin_return_address(0), GET_USERREG()->ARM_pc); | ||
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | /* Keep SoftFloat exception flags up to date. */ | ||
139 | float_exception_flags |= flags; | ||
140 | |||
141 | /* Read fpsr and initialize the cumulativeTraps. */ | 138 | /* Read fpsr and initialize the cumulativeTraps. */ |
142 | fpsr = readFPSR(); | 139 | fpsr = readFPSR(); |
143 | cumulativeTraps = 0; | 140 | cumulativeTraps = 0; |
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h index 8035f4faafbf..1777e92a88e6 100644 --- a/arch/arm/nwfpe/fpopcode.h +++ b/arch/arm/nwfpe/fpopcode.h | |||
@@ -370,20 +370,20 @@ TABLE 5 | |||
370 | #define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) | 370 | #define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) |
371 | 371 | ||
372 | #ifdef CONFIG_FPE_NWFPE_XP | 372 | #ifdef CONFIG_FPE_NWFPE_XP |
373 | static inline const floatx80 getExtendedConstant(const unsigned int nIndex) | 373 | static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex) |
374 | { | 374 | { |
375 | extern const floatx80 floatx80Constant[]; | 375 | extern const floatx80 floatx80Constant[]; |
376 | return floatx80Constant[nIndex]; | 376 | return floatx80Constant[nIndex]; |
377 | } | 377 | } |
378 | #endif | 378 | #endif |
379 | 379 | ||
380 | static inline const float64 getDoubleConstant(const unsigned int nIndex) | 380 | static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex) |
381 | { | 381 | { |
382 | extern const float64 float64Constant[]; | 382 | extern const float64 float64Constant[]; |
383 | return float64Constant[nIndex]; | 383 | return float64Constant[nIndex]; |
384 | } | 384 | } |
385 | 385 | ||
386 | static inline const float32 getSingleConstant(const unsigned int nIndex) | 386 | static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex) |
387 | { | 387 | { |
388 | extern const float32 float32Constant[]; | 388 | extern const float32 float32Constant[]; |
389 | return float32Constant[nIndex]; | 389 | return float32Constant[nIndex]; |
diff --git a/arch/arm/nwfpe/single_cpdo.c b/arch/arm/nwfpe/single_cpdo.c index 705808e88d9d..c66981d682cf 100644 --- a/arch/arm/nwfpe/single_cpdo.c +++ b/arch/arm/nwfpe/single_cpdo.c | |||
@@ -36,17 +36,17 @@ float32 float32_arccos(float32 rFm); | |||
36 | float32 float32_pow(float32 rFn, float32 rFm); | 36 | float32 float32_pow(float32 rFn, float32 rFm); |
37 | float32 float32_pol(float32 rFn, float32 rFm); | 37 | float32 float32_pol(float32 rFn, float32 rFm); |
38 | 38 | ||
39 | static float32 float32_rsf(float32 rFn, float32 rFm) | 39 | static float32 float32_rsf(struct roundingData *roundData, float32 rFn, float32 rFm) |
40 | { | 40 | { |
41 | return float32_sub(rFm, rFn); | 41 | return float32_sub(roundData, rFm, rFn); |
42 | } | 42 | } |
43 | 43 | ||
44 | static float32 float32_rdv(float32 rFn, float32 rFm) | 44 | static float32 float32_rdv(struct roundingData *roundData, float32 rFn, float32 rFm) |
45 | { | 45 | { |
46 | return float32_div(rFm, rFn); | 46 | return float32_div(roundData, rFm, rFn); |
47 | } | 47 | } |
48 | 48 | ||
49 | static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = { | 49 | static float32 (*const dyadic_single[16])(struct roundingData *, float32 rFn, float32 rFm) = { |
50 | [ADF_CODE >> 20] = float32_add, | 50 | [ADF_CODE >> 20] = float32_add, |
51 | [MUF_CODE >> 20] = float32_mul, | 51 | [MUF_CODE >> 20] = float32_mul, |
52 | [SUF_CODE >> 20] = float32_sub, | 52 | [SUF_CODE >> 20] = float32_sub, |
@@ -60,22 +60,22 @@ static float32 (*const dyadic_single[16])(float32 rFn, float32 rFm) = { | |||
60 | [FRD_CODE >> 20] = float32_rdv, | 60 | [FRD_CODE >> 20] = float32_rdv, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static float32 float32_mvf(float32 rFm) | 63 | static float32 float32_mvf(struct roundingData *roundData, float32 rFm) |
64 | { | 64 | { |
65 | return rFm; | 65 | return rFm; |
66 | } | 66 | } |
67 | 67 | ||
68 | static float32 float32_mnf(float32 rFm) | 68 | static float32 float32_mnf(struct roundingData *roundData, float32 rFm) |
69 | { | 69 | { |
70 | return rFm ^ 0x80000000; | 70 | return rFm ^ 0x80000000; |
71 | } | 71 | } |
72 | 72 | ||
73 | static float32 float32_abs(float32 rFm) | 73 | static float32 float32_abs(struct roundingData *roundData, float32 rFm) |
74 | { | 74 | { |
75 | return rFm & 0x7fffffff; | 75 | return rFm & 0x7fffffff; |
76 | } | 76 | } |
77 | 77 | ||
78 | static float32 (*const monadic_single[16])(float32 rFm) = { | 78 | static float32 (*const monadic_single[16])(struct roundingData*, float32 rFm) = { |
79 | [MVF_CODE >> 20] = float32_mvf, | 79 | [MVF_CODE >> 20] = float32_mvf, |
80 | [MNF_CODE >> 20] = float32_mnf, | 80 | [MNF_CODE >> 20] = float32_mnf, |
81 | [ABS_CODE >> 20] = float32_abs, | 81 | [ABS_CODE >> 20] = float32_abs, |
@@ -85,7 +85,7 @@ static float32 (*const monadic_single[16])(float32 rFm) = { | |||
85 | [NRM_CODE >> 20] = float32_mvf, | 85 | [NRM_CODE >> 20] = float32_mvf, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd) | 88 | unsigned int SingleCPDO(struct roundingData *roundData, const unsigned int opcode, FPREG * rFd) |
89 | { | 89 | { |
90 | FPA11 *fpa11 = GET_FPA11(); | 90 | FPA11 *fpa11 = GET_FPA11(); |
91 | float32 rFm; | 91 | float32 rFm; |
@@ -108,13 +108,13 @@ unsigned int SingleCPDO(const unsigned int opcode, FPREG * rFd) | |||
108 | if (fpa11->fType[Fn] == typeSingle && | 108 | if (fpa11->fType[Fn] == typeSingle && |
109 | dyadic_single[opc_mask_shift]) { | 109 | dyadic_single[opc_mask_shift]) { |
110 | rFn = fpa11->fpreg[Fn].fSingle; | 110 | rFn = fpa11->fpreg[Fn].fSingle; |
111 | rFd->fSingle = dyadic_single[opc_mask_shift](rFn, rFm); | 111 | rFd->fSingle = dyadic_single[opc_mask_shift](roundData, rFn, rFm); |
112 | } else { | 112 | } else { |
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
115 | } else { | 115 | } else { |
116 | if (monadic_single[opc_mask_shift]) { | 116 | if (monadic_single[opc_mask_shift]) { |
117 | rFd->fSingle = monadic_single[opc_mask_shift](rFm); | 117 | rFd->fSingle = monadic_single[opc_mask_shift](roundData, rFm); |
118 | } else { | 118 | } else { |
119 | return 0; | 119 | return 0; |
120 | } | 120 | } |
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c index e038dd3be9b3..f9f049132a17 100644 --- a/arch/arm/nwfpe/softfloat.c +++ b/arch/arm/nwfpe/softfloat.c | |||
@@ -36,16 +36,6 @@ this code that are retained. | |||
36 | 36 | ||
37 | /* | 37 | /* |
38 | ------------------------------------------------------------------------------- | 38 | ------------------------------------------------------------------------------- |
39 | Floating-point rounding mode, extended double-precision rounding precision, | ||
40 | and exception flags. | ||
41 | ------------------------------------------------------------------------------- | ||
42 | */ | ||
43 | int8 float_rounding_mode = float_round_nearest_even; | ||
44 | int8 floatx80_rounding_precision = 80; | ||
45 | int8 float_exception_flags; | ||
46 | |||
47 | /* | ||
48 | ------------------------------------------------------------------------------- | ||
49 | Primitive arithmetic functions, including multi-word arithmetic, and | 39 | Primitive arithmetic functions, including multi-word arithmetic, and |
50 | division and square root approximations. (Can be specialized to target if | 40 | division and square root approximations. (Can be specialized to target if |
51 | desired.) | 41 | desired.) |
@@ -77,14 +67,14 @@ input is too large, however, the invalid exception is raised and the largest | |||
77 | positive or negative integer is returned. | 67 | positive or negative integer is returned. |
78 | ------------------------------------------------------------------------------- | 68 | ------------------------------------------------------------------------------- |
79 | */ | 69 | */ |
80 | static int32 roundAndPackInt32( flag zSign, bits64 absZ ) | 70 | static int32 roundAndPackInt32( struct roundingData *roundData, flag zSign, bits64 absZ ) |
81 | { | 71 | { |
82 | int8 roundingMode; | 72 | int8 roundingMode; |
83 | flag roundNearestEven; | 73 | flag roundNearestEven; |
84 | int8 roundIncrement, roundBits; | 74 | int8 roundIncrement, roundBits; |
85 | int32 z; | 75 | int32 z; |
86 | 76 | ||
87 | roundingMode = float_rounding_mode; | 77 | roundingMode = roundData->mode; |
88 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | 78 | roundNearestEven = ( roundingMode == float_round_nearest_even ); |
89 | roundIncrement = 0x40; | 79 | roundIncrement = 0x40; |
90 | if ( ! roundNearestEven ) { | 80 | if ( ! roundNearestEven ) { |
@@ -107,10 +97,10 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ ) | |||
107 | z = absZ; | 97 | z = absZ; |
108 | if ( zSign ) z = - z; | 98 | if ( zSign ) z = - z; |
109 | if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { | 99 | if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { |
110 | float_exception_flags |= float_flag_invalid; | 100 | roundData->exception |= float_flag_invalid; |
111 | return zSign ? 0x80000000 : 0x7FFFFFFF; | 101 | return zSign ? 0x80000000 : 0x7FFFFFFF; |
112 | } | 102 | } |
113 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | 103 | if ( roundBits ) roundData->exception |= float_flag_inexact; |
114 | return z; | 104 | return z; |
115 | 105 | ||
116 | } | 106 | } |
@@ -224,14 +214,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for | |||
224 | Binary Floating-point Arithmetic. | 214 | Binary Floating-point Arithmetic. |
225 | ------------------------------------------------------------------------------- | 215 | ------------------------------------------------------------------------------- |
226 | */ | 216 | */ |
227 | static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | 217 | static float32 roundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig ) |
228 | { | 218 | { |
229 | int8 roundingMode; | 219 | int8 roundingMode; |
230 | flag roundNearestEven; | 220 | flag roundNearestEven; |
231 | int8 roundIncrement, roundBits; | 221 | int8 roundIncrement, roundBits; |
232 | flag isTiny; | 222 | flag isTiny; |
233 | 223 | ||
234 | roundingMode = float_rounding_mode; | 224 | roundingMode = roundData->mode; |
235 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | 225 | roundNearestEven = ( roundingMode == float_round_nearest_even ); |
236 | roundIncrement = 0x40; | 226 | roundIncrement = 0x40; |
237 | if ( ! roundNearestEven ) { | 227 | if ( ! roundNearestEven ) { |
@@ -254,7 +244,7 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | |||
254 | || ( ( zExp == 0xFD ) | 244 | || ( ( zExp == 0xFD ) |
255 | && ( (sbits32) ( zSig + roundIncrement ) < 0 ) ) | 245 | && ( (sbits32) ( zSig + roundIncrement ) < 0 ) ) |
256 | ) { | 246 | ) { |
257 | float_raise( float_flag_overflow | float_flag_inexact ); | 247 | roundData->exception |= float_flag_overflow | float_flag_inexact; |
258 | return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 ); | 248 | return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 ); |
259 | } | 249 | } |
260 | if ( zExp < 0 ) { | 250 | if ( zExp < 0 ) { |
@@ -265,10 +255,10 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | |||
265 | shift32RightJamming( zSig, - zExp, &zSig ); | 255 | shift32RightJamming( zSig, - zExp, &zSig ); |
266 | zExp = 0; | 256 | zExp = 0; |
267 | roundBits = zSig & 0x7F; | 257 | roundBits = zSig & 0x7F; |
268 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | 258 | if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow; |
269 | } | 259 | } |
270 | } | 260 | } |
271 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | 261 | if ( roundBits ) roundData->exception |= float_flag_inexact; |
272 | zSig = ( zSig + roundIncrement )>>7; | 262 | zSig = ( zSig + roundIncrement )>>7; |
273 | zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); | 263 | zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); |
274 | if ( zSig == 0 ) zExp = 0; | 264 | if ( zSig == 0 ) zExp = 0; |
@@ -287,12 +277,12 @@ point exponent. | |||
287 | ------------------------------------------------------------------------------- | 277 | ------------------------------------------------------------------------------- |
288 | */ | 278 | */ |
289 | static float32 | 279 | static float32 |
290 | normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig ) | 280 | normalizeRoundAndPackFloat32( struct roundingData *roundData, flag zSign, int16 zExp, bits32 zSig ) |
291 | { | 281 | { |
292 | int8 shiftCount; | 282 | int8 shiftCount; |
293 | 283 | ||
294 | shiftCount = countLeadingZeros32( zSig ) - 1; | 284 | shiftCount = countLeadingZeros32( zSig ) - 1; |
295 | return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount ); | 285 | return roundAndPackFloat32( roundData, zSign, zExp - shiftCount, zSig<<shiftCount ); |
296 | 286 | ||
297 | } | 287 | } |
298 | 288 | ||
@@ -395,14 +385,14 @@ The handling of underflow and overflow follows the IEC/IEEE Standard for | |||
395 | Binary Floating-point Arithmetic. | 385 | Binary Floating-point Arithmetic. |
396 | ------------------------------------------------------------------------------- | 386 | ------------------------------------------------------------------------------- |
397 | */ | 387 | */ |
398 | static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | 388 | static float64 roundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig ) |
399 | { | 389 | { |
400 | int8 roundingMode; | 390 | int8 roundingMode; |
401 | flag roundNearestEven; | 391 | flag roundNearestEven; |
402 | int16 roundIncrement, roundBits; | 392 | int16 roundIncrement, roundBits; |
403 | flag isTiny; | 393 | flag isTiny; |
404 | 394 | ||
405 | roundingMode = float_rounding_mode; | 395 | roundingMode = roundData->mode; |
406 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | 396 | roundNearestEven = ( roundingMode == float_round_nearest_even ); |
407 | roundIncrement = 0x200; | 397 | roundIncrement = 0x200; |
408 | if ( ! roundNearestEven ) { | 398 | if ( ! roundNearestEven ) { |
@@ -427,7 +417,7 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | |||
427 | ) { | 417 | ) { |
428 | //register int lr = __builtin_return_address(0); | 418 | //register int lr = __builtin_return_address(0); |
429 | //printk("roundAndPackFloat64 called from 0x%08x\n",lr); | 419 | //printk("roundAndPackFloat64 called from 0x%08x\n",lr); |
430 | float_raise( float_flag_overflow | float_flag_inexact ); | 420 | roundData->exception |= float_flag_overflow | float_flag_inexact; |
431 | return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 ); | 421 | return packFloat64( zSign, 0x7FF, 0 ) - ( roundIncrement == 0 ); |
432 | } | 422 | } |
433 | if ( zExp < 0 ) { | 423 | if ( zExp < 0 ) { |
@@ -438,10 +428,10 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | |||
438 | shift64RightJamming( zSig, - zExp, &zSig ); | 428 | shift64RightJamming( zSig, - zExp, &zSig ); |
439 | zExp = 0; | 429 | zExp = 0; |
440 | roundBits = zSig & 0x3FF; | 430 | roundBits = zSig & 0x3FF; |
441 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | 431 | if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow; |
442 | } | 432 | } |
443 | } | 433 | } |
444 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | 434 | if ( roundBits ) roundData->exception |= float_flag_inexact; |
445 | zSig = ( zSig + roundIncrement )>>10; | 435 | zSig = ( zSig + roundIncrement )>>10; |
446 | zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); | 436 | zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); |
447 | if ( zSig == 0 ) zExp = 0; | 437 | if ( zSig == 0 ) zExp = 0; |
@@ -460,12 +450,12 @@ point exponent. | |||
460 | ------------------------------------------------------------------------------- | 450 | ------------------------------------------------------------------------------- |
461 | */ | 451 | */ |
462 | static float64 | 452 | static float64 |
463 | normalizeRoundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig ) | 453 | normalizeRoundAndPackFloat64( struct roundingData *roundData, flag zSign, int16 zExp, bits64 zSig ) |
464 | { | 454 | { |
465 | int8 shiftCount; | 455 | int8 shiftCount; |
466 | 456 | ||
467 | shiftCount = countLeadingZeros64( zSig ) - 1; | 457 | shiftCount = countLeadingZeros64( zSig ) - 1; |
468 | return roundAndPackFloat64( zSign, zExp - shiftCount, zSig<<shiftCount ); | 458 | return roundAndPackFloat64( roundData, zSign, zExp - shiftCount, zSig<<shiftCount ); |
469 | 459 | ||
470 | } | 460 | } |
471 | 461 | ||
@@ -572,14 +562,15 @@ Floating-point Arithmetic. | |||
572 | */ | 562 | */ |
573 | static floatx80 | 563 | static floatx80 |
574 | roundAndPackFloatx80( | 564 | roundAndPackFloatx80( |
575 | int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 | 565 | struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 |
576 | ) | 566 | ) |
577 | { | 567 | { |
578 | int8 roundingMode; | 568 | int8 roundingMode, roundingPrecision; |
579 | flag roundNearestEven, increment, isTiny; | 569 | flag roundNearestEven, increment, isTiny; |
580 | int64 roundIncrement, roundMask, roundBits; | 570 | int64 roundIncrement, roundMask, roundBits; |
581 | 571 | ||
582 | roundingMode = float_rounding_mode; | 572 | roundingMode = roundData->mode; |
573 | roundingPrecision = roundData->precision; | ||
583 | roundNearestEven = ( roundingMode == float_round_nearest_even ); | 574 | roundNearestEven = ( roundingMode == float_round_nearest_even ); |
584 | if ( roundingPrecision == 80 ) goto precision80; | 575 | if ( roundingPrecision == 80 ) goto precision80; |
585 | if ( roundingPrecision == 64 ) { | 576 | if ( roundingPrecision == 64 ) { |
@@ -623,8 +614,8 @@ static floatx80 | |||
623 | shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); | 614 | shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); |
624 | zExp = 0; | 615 | zExp = 0; |
625 | roundBits = zSig0 & roundMask; | 616 | roundBits = zSig0 & roundMask; |
626 | if ( isTiny && roundBits ) float_raise( float_flag_underflow ); | 617 | if ( isTiny && roundBits ) roundData->exception |= float_flag_underflow; |
627 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | 618 | if ( roundBits ) roundData->exception |= float_flag_inexact; |
628 | zSig0 += roundIncrement; | 619 | zSig0 += roundIncrement; |
629 | if ( (sbits64) zSig0 < 0 ) zExp = 1; | 620 | if ( (sbits64) zSig0 < 0 ) zExp = 1; |
630 | roundIncrement = roundMask + 1; | 621 | roundIncrement = roundMask + 1; |
@@ -635,7 +626,7 @@ static floatx80 | |||
635 | return packFloatx80( zSign, zExp, zSig0 ); | 626 | return packFloatx80( zSign, zExp, zSig0 ); |
636 | } | 627 | } |
637 | } | 628 | } |
638 | if ( roundBits ) float_exception_flags |= float_flag_inexact; | 629 | if ( roundBits ) roundData->exception |= float_flag_inexact; |
639 | zSig0 += roundIncrement; | 630 | zSig0 += roundIncrement; |
640 | if ( zSig0 < roundIncrement ) { | 631 | if ( zSig0 < roundIncrement ) { |
641 | ++zExp; | 632 | ++zExp; |
@@ -672,7 +663,7 @@ static floatx80 | |||
672 | ) { | 663 | ) { |
673 | roundMask = 0; | 664 | roundMask = 0; |
674 | overflow: | 665 | overflow: |
675 | float_raise( float_flag_overflow | float_flag_inexact ); | 666 | roundData->exception |= float_flag_overflow | float_flag_inexact; |
676 | if ( ( roundingMode == float_round_to_zero ) | 667 | if ( ( roundingMode == float_round_to_zero ) |
677 | || ( zSign && ( roundingMode == float_round_up ) ) | 668 | || ( zSign && ( roundingMode == float_round_up ) ) |
678 | || ( ! zSign && ( roundingMode == float_round_down ) ) | 669 | || ( ! zSign && ( roundingMode == float_round_down ) ) |
@@ -689,8 +680,8 @@ static floatx80 | |||
689 | || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); | 680 | || ( zSig0 < LIT64( 0xFFFFFFFFFFFFFFFF ) ); |
690 | shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 ); | 681 | shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 ); |
691 | zExp = 0; | 682 | zExp = 0; |
692 | if ( isTiny && zSig1 ) float_raise( float_flag_underflow ); | 683 | if ( isTiny && zSig1 ) roundData->exception |= float_flag_underflow; |
693 | if ( zSig1 ) float_exception_flags |= float_flag_inexact; | 684 | if ( zSig1 ) roundData->exception |= float_flag_inexact; |
694 | if ( roundNearestEven ) { | 685 | if ( roundNearestEven ) { |
695 | increment = ( (sbits64) zSig1 < 0 ); | 686 | increment = ( (sbits64) zSig1 < 0 ); |
696 | } | 687 | } |
@@ -710,7 +701,7 @@ static floatx80 | |||
710 | return packFloatx80( zSign, zExp, zSig0 ); | 701 | return packFloatx80( zSign, zExp, zSig0 ); |
711 | } | 702 | } |
712 | } | 703 | } |
713 | if ( zSig1 ) float_exception_flags |= float_flag_inexact; | 704 | if ( zSig1 ) roundData->exception |= float_flag_inexact; |
714 | if ( increment ) { | 705 | if ( increment ) { |
715 | ++zSig0; | 706 | ++zSig0; |
716 | if ( zSig0 == 0 ) { | 707 | if ( zSig0 == 0 ) { |
@@ -740,7 +731,7 @@ normalized. | |||
740 | */ | 731 | */ |
741 | static floatx80 | 732 | static floatx80 |
742 | normalizeRoundAndPackFloatx80( | 733 | normalizeRoundAndPackFloatx80( |
743 | int8 roundingPrecision, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 | 734 | struct roundingData *roundData, flag zSign, int32 zExp, bits64 zSig0, bits64 zSig1 |
744 | ) | 735 | ) |
745 | { | 736 | { |
746 | int8 shiftCount; | 737 | int8 shiftCount; |
@@ -754,7 +745,7 @@ static floatx80 | |||
754 | shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); | 745 | shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 ); |
755 | zExp -= shiftCount; | 746 | zExp -= shiftCount; |
756 | return | 747 | return |
757 | roundAndPackFloatx80( roundingPrecision, zSign, zExp, zSig0, zSig1 ); | 748 | roundAndPackFloatx80( roundData, zSign, zExp, zSig0, zSig1 ); |
758 | 749 | ||
759 | } | 750 | } |
760 | 751 | ||
@@ -767,14 +758,14 @@ the single-precision floating-point format. The conversion is performed | |||
767 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 758 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
768 | ------------------------------------------------------------------------------- | 759 | ------------------------------------------------------------------------------- |
769 | */ | 760 | */ |
770 | float32 int32_to_float32( int32 a ) | 761 | float32 int32_to_float32(struct roundingData *roundData, int32 a) |
771 | { | 762 | { |
772 | flag zSign; | 763 | flag zSign; |
773 | 764 | ||
774 | if ( a == 0 ) return 0; | 765 | if ( a == 0 ) return 0; |
775 | if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 ); | 766 | if ( a == 0x80000000 ) return packFloat32( 1, 0x9E, 0 ); |
776 | zSign = ( a < 0 ); | 767 | zSign = ( a < 0 ); |
777 | return normalizeRoundAndPackFloat32( zSign, 0x9C, zSign ? - a : a ); | 768 | return normalizeRoundAndPackFloat32( roundData, zSign, 0x9C, zSign ? - a : a ); |
778 | 769 | ||
779 | } | 770 | } |
780 | 771 | ||
@@ -840,7 +831,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the | |||
840 | largest integer with the same sign as `a' is returned. | 831 | largest integer with the same sign as `a' is returned. |
841 | ------------------------------------------------------------------------------- | 832 | ------------------------------------------------------------------------------- |
842 | */ | 833 | */ |
843 | int32 float32_to_int32( float32 a ) | 834 | int32 float32_to_int32( struct roundingData *roundData, float32 a ) |
844 | { | 835 | { |
845 | flag aSign; | 836 | flag aSign; |
846 | int16 aExp, shiftCount; | 837 | int16 aExp, shiftCount; |
@@ -856,7 +847,7 @@ int32 float32_to_int32( float32 a ) | |||
856 | zSig = aSig; | 847 | zSig = aSig; |
857 | zSig <<= 32; | 848 | zSig <<= 32; |
858 | if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig ); | 849 | if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig ); |
859 | return roundAndPackInt32( aSign, zSig ); | 850 | return roundAndPackInt32( roundData, aSign, zSig ); |
860 | 851 | ||
861 | } | 852 | } |
862 | 853 | ||
@@ -889,13 +880,13 @@ int32 float32_to_int32_round_to_zero( float32 a ) | |||
889 | return 0x80000000; | 880 | return 0x80000000; |
890 | } | 881 | } |
891 | else if ( aExp <= 0x7E ) { | 882 | else if ( aExp <= 0x7E ) { |
892 | if ( aExp | aSig ) float_exception_flags |= float_flag_inexact; | 883 | if ( aExp | aSig ) float_raise( float_flag_inexact ); |
893 | return 0; | 884 | return 0; |
894 | } | 885 | } |
895 | aSig = ( aSig | 0x00800000 )<<8; | 886 | aSig = ( aSig | 0x00800000 )<<8; |
896 | z = aSig>>( - shiftCount ); | 887 | z = aSig>>( - shiftCount ); |
897 | if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) { | 888 | if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) { |
898 | float_exception_flags |= float_flag_inexact; | 889 | float_raise( float_flag_inexact ); |
899 | } | 890 | } |
900 | return aSign ? - z : z; | 891 | return aSign ? - z : z; |
901 | 892 | ||
@@ -973,7 +964,7 @@ operation is performed according to the IEC/IEEE Standard for Binary | |||
973 | Floating-point Arithmetic. | 964 | Floating-point Arithmetic. |
974 | ------------------------------------------------------------------------------- | 965 | ------------------------------------------------------------------------------- |
975 | */ | 966 | */ |
976 | float32 float32_round_to_int( float32 a ) | 967 | float32 float32_round_to_int( struct roundingData *roundData, float32 a ) |
977 | { | 968 | { |
978 | flag aSign; | 969 | flag aSign; |
979 | int16 aExp; | 970 | int16 aExp; |
@@ -988,11 +979,12 @@ float32 float32_round_to_int( float32 a ) | |||
988 | } | 979 | } |
989 | return a; | 980 | return a; |
990 | } | 981 | } |
982 | roundingMode = roundData->mode; | ||
991 | if ( aExp <= 0x7E ) { | 983 | if ( aExp <= 0x7E ) { |
992 | if ( (bits32) ( a<<1 ) == 0 ) return a; | 984 | if ( (bits32) ( a<<1 ) == 0 ) return a; |
993 | float_exception_flags |= float_flag_inexact; | 985 | roundData->exception |= float_flag_inexact; |
994 | aSign = extractFloat32Sign( a ); | 986 | aSign = extractFloat32Sign( a ); |
995 | switch ( float_rounding_mode ) { | 987 | switch ( roundingMode ) { |
996 | case float_round_nearest_even: | 988 | case float_round_nearest_even: |
997 | if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) { | 989 | if ( ( aExp == 0x7E ) && extractFloat32Frac( a ) ) { |
998 | return packFloat32( aSign, 0x7F, 0 ); | 990 | return packFloat32( aSign, 0x7F, 0 ); |
@@ -1009,7 +1001,6 @@ float32 float32_round_to_int( float32 a ) | |||
1009 | lastBitMask <<= 0x96 - aExp; | 1001 | lastBitMask <<= 0x96 - aExp; |
1010 | roundBitsMask = lastBitMask - 1; | 1002 | roundBitsMask = lastBitMask - 1; |
1011 | z = a; | 1003 | z = a; |
1012 | roundingMode = float_rounding_mode; | ||
1013 | if ( roundingMode == float_round_nearest_even ) { | 1004 | if ( roundingMode == float_round_nearest_even ) { |
1014 | z += lastBitMask>>1; | 1005 | z += lastBitMask>>1; |
1015 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; | 1006 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; |
@@ -1020,7 +1011,7 @@ float32 float32_round_to_int( float32 a ) | |||
1020 | } | 1011 | } |
1021 | } | 1012 | } |
1022 | z &= ~ roundBitsMask; | 1013 | z &= ~ roundBitsMask; |
1023 | if ( z != a ) float_exception_flags |= float_flag_inexact; | 1014 | if ( z != a ) roundData->exception |= float_flag_inexact; |
1024 | return z; | 1015 | return z; |
1025 | 1016 | ||
1026 | } | 1017 | } |
@@ -1034,7 +1025,7 @@ addition is performed according to the IEC/IEEE Standard for Binary | |||
1034 | Floating-point Arithmetic. | 1025 | Floating-point Arithmetic. |
1035 | ------------------------------------------------------------------------------- | 1026 | ------------------------------------------------------------------------------- |
1036 | */ | 1027 | */ |
1037 | static float32 addFloat32Sigs( float32 a, float32 b, flag zSign ) | 1028 | static float32 addFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign ) |
1038 | { | 1029 | { |
1039 | int16 aExp, bExp, zExp; | 1030 | int16 aExp, bExp, zExp; |
1040 | bits32 aSig, bSig, zSig; | 1031 | bits32 aSig, bSig, zSig; |
@@ -1093,7 +1084,7 @@ static float32 addFloat32Sigs( float32 a, float32 b, flag zSign ) | |||
1093 | ++zExp; | 1084 | ++zExp; |
1094 | } | 1085 | } |
1095 | roundAndPack: | 1086 | roundAndPack: |
1096 | return roundAndPackFloat32( zSign, zExp, zSig ); | 1087 | return roundAndPackFloat32( roundData, zSign, zExp, zSig ); |
1097 | 1088 | ||
1098 | } | 1089 | } |
1099 | 1090 | ||
@@ -1106,7 +1097,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE | |||
1106 | Standard for Binary Floating-point Arithmetic. | 1097 | Standard for Binary Floating-point Arithmetic. |
1107 | ------------------------------------------------------------------------------- | 1098 | ------------------------------------------------------------------------------- |
1108 | */ | 1099 | */ |
1109 | static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) | 1100 | static float32 subFloat32Sigs( struct roundingData *roundData, float32 a, float32 b, flag zSign ) |
1110 | { | 1101 | { |
1111 | int16 aExp, bExp, zExp; | 1102 | int16 aExp, bExp, zExp; |
1112 | bits32 aSig, bSig, zSig; | 1103 | bits32 aSig, bSig, zSig; |
@@ -1123,7 +1114,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) | |||
1123 | if ( expDiff < 0 ) goto bExpBigger; | 1114 | if ( expDiff < 0 ) goto bExpBigger; |
1124 | if ( aExp == 0xFF ) { | 1115 | if ( aExp == 0xFF ) { |
1125 | if ( aSig | bSig ) return propagateFloat32NaN( a, b ); | 1116 | if ( aSig | bSig ) return propagateFloat32NaN( a, b ); |
1126 | float_raise( float_flag_invalid ); | 1117 | roundData->exception |= float_flag_invalid; |
1127 | return float32_default_nan; | 1118 | return float32_default_nan; |
1128 | } | 1119 | } |
1129 | if ( aExp == 0 ) { | 1120 | if ( aExp == 0 ) { |
@@ -1132,7 +1123,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) | |||
1132 | } | 1123 | } |
1133 | if ( bSig < aSig ) goto aBigger; | 1124 | if ( bSig < aSig ) goto aBigger; |
1134 | if ( aSig < bSig ) goto bBigger; | 1125 | if ( aSig < bSig ) goto bBigger; |
1135 | return packFloat32( float_rounding_mode == float_round_down, 0, 0 ); | 1126 | return packFloat32( roundData->mode == float_round_down, 0, 0 ); |
1136 | bExpBigger: | 1127 | bExpBigger: |
1137 | if ( bExp == 0xFF ) { | 1128 | if ( bExp == 0xFF ) { |
1138 | if ( bSig ) return propagateFloat32NaN( a, b ); | 1129 | if ( bSig ) return propagateFloat32NaN( a, b ); |
@@ -1169,7 +1160,7 @@ static float32 subFloat32Sigs( float32 a, float32 b, flag zSign ) | |||
1169 | zExp = aExp; | 1160 | zExp = aExp; |
1170 | normalizeRoundAndPack: | 1161 | normalizeRoundAndPack: |
1171 | --zExp; | 1162 | --zExp; |
1172 | return normalizeRoundAndPackFloat32( zSign, zExp, zSig ); | 1163 | return normalizeRoundAndPackFloat32( roundData, zSign, zExp, zSig ); |
1173 | 1164 | ||
1174 | } | 1165 | } |
1175 | 1166 | ||
@@ -1180,17 +1171,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for | |||
1180 | Binary Floating-point Arithmetic. | 1171 | Binary Floating-point Arithmetic. |
1181 | ------------------------------------------------------------------------------- | 1172 | ------------------------------------------------------------------------------- |
1182 | */ | 1173 | */ |
1183 | float32 float32_add( float32 a, float32 b ) | 1174 | float32 float32_add( struct roundingData *roundData, float32 a, float32 b ) |
1184 | { | 1175 | { |
1185 | flag aSign, bSign; | 1176 | flag aSign, bSign; |
1186 | 1177 | ||
1187 | aSign = extractFloat32Sign( a ); | 1178 | aSign = extractFloat32Sign( a ); |
1188 | bSign = extractFloat32Sign( b ); | 1179 | bSign = extractFloat32Sign( b ); |
1189 | if ( aSign == bSign ) { | 1180 | if ( aSign == bSign ) { |
1190 | return addFloat32Sigs( a, b, aSign ); | 1181 | return addFloat32Sigs( roundData, a, b, aSign ); |
1191 | } | 1182 | } |
1192 | else { | 1183 | else { |
1193 | return subFloat32Sigs( a, b, aSign ); | 1184 | return subFloat32Sigs( roundData, a, b, aSign ); |
1194 | } | 1185 | } |
1195 | 1186 | ||
1196 | } | 1187 | } |
@@ -1202,17 +1193,17 @@ Returns the result of subtracting the single-precision floating-point values | |||
1202 | for Binary Floating-point Arithmetic. | 1193 | for Binary Floating-point Arithmetic. |
1203 | ------------------------------------------------------------------------------- | 1194 | ------------------------------------------------------------------------------- |
1204 | */ | 1195 | */ |
1205 | float32 float32_sub( float32 a, float32 b ) | 1196 | float32 float32_sub( struct roundingData *roundData, float32 a, float32 b ) |
1206 | { | 1197 | { |
1207 | flag aSign, bSign; | 1198 | flag aSign, bSign; |
1208 | 1199 | ||
1209 | aSign = extractFloat32Sign( a ); | 1200 | aSign = extractFloat32Sign( a ); |
1210 | bSign = extractFloat32Sign( b ); | 1201 | bSign = extractFloat32Sign( b ); |
1211 | if ( aSign == bSign ) { | 1202 | if ( aSign == bSign ) { |
1212 | return subFloat32Sigs( a, b, aSign ); | 1203 | return subFloat32Sigs( roundData, a, b, aSign ); |
1213 | } | 1204 | } |
1214 | else { | 1205 | else { |
1215 | return addFloat32Sigs( a, b, aSign ); | 1206 | return addFloat32Sigs( roundData, a, b, aSign ); |
1216 | } | 1207 | } |
1217 | 1208 | ||
1218 | } | 1209 | } |
@@ -1224,7 +1215,7 @@ Returns the result of multiplying the single-precision floating-point values | |||
1224 | for Binary Floating-point Arithmetic. | 1215 | for Binary Floating-point Arithmetic. |
1225 | ------------------------------------------------------------------------------- | 1216 | ------------------------------------------------------------------------------- |
1226 | */ | 1217 | */ |
1227 | float32 float32_mul( float32 a, float32 b ) | 1218 | float32 float32_mul( struct roundingData *roundData, float32 a, float32 b ) |
1228 | { | 1219 | { |
1229 | flag aSign, bSign, zSign; | 1220 | flag aSign, bSign, zSign; |
1230 | int16 aExp, bExp, zExp; | 1221 | int16 aExp, bExp, zExp; |
@@ -1244,7 +1235,7 @@ float32 float32_mul( float32 a, float32 b ) | |||
1244 | return propagateFloat32NaN( a, b ); | 1235 | return propagateFloat32NaN( a, b ); |
1245 | } | 1236 | } |
1246 | if ( ( bExp | bSig ) == 0 ) { | 1237 | if ( ( bExp | bSig ) == 0 ) { |
1247 | float_raise( float_flag_invalid ); | 1238 | roundData->exception |= float_flag_invalid; |
1248 | return float32_default_nan; | 1239 | return float32_default_nan; |
1249 | } | 1240 | } |
1250 | return packFloat32( zSign, 0xFF, 0 ); | 1241 | return packFloat32( zSign, 0xFF, 0 ); |
@@ -1252,7 +1243,7 @@ float32 float32_mul( float32 a, float32 b ) | |||
1252 | if ( bExp == 0xFF ) { | 1243 | if ( bExp == 0xFF ) { |
1253 | if ( bSig ) return propagateFloat32NaN( a, b ); | 1244 | if ( bSig ) return propagateFloat32NaN( a, b ); |
1254 | if ( ( aExp | aSig ) == 0 ) { | 1245 | if ( ( aExp | aSig ) == 0 ) { |
1255 | float_raise( float_flag_invalid ); | 1246 | roundData->exception |= float_flag_invalid; |
1256 | return float32_default_nan; | 1247 | return float32_default_nan; |
1257 | } | 1248 | } |
1258 | return packFloat32( zSign, 0xFF, 0 ); | 1249 | return packFloat32( zSign, 0xFF, 0 ); |
@@ -1274,7 +1265,7 @@ float32 float32_mul( float32 a, float32 b ) | |||
1274 | zSig <<= 1; | 1265 | zSig <<= 1; |
1275 | --zExp; | 1266 | --zExp; |
1276 | } | 1267 | } |
1277 | return roundAndPackFloat32( zSign, zExp, zSig ); | 1268 | return roundAndPackFloat32( roundData, zSign, zExp, zSig ); |
1278 | 1269 | ||
1279 | } | 1270 | } |
1280 | 1271 | ||
@@ -1285,7 +1276,7 @@ by the corresponding value `b'. The operation is performed according to the | |||
1285 | IEC/IEEE Standard for Binary Floating-point Arithmetic. | 1276 | IEC/IEEE Standard for Binary Floating-point Arithmetic. |
1286 | ------------------------------------------------------------------------------- | 1277 | ------------------------------------------------------------------------------- |
1287 | */ | 1278 | */ |
1288 | float32 float32_div( float32 a, float32 b ) | 1279 | float32 float32_div( struct roundingData *roundData, float32 a, float32 b ) |
1289 | { | 1280 | { |
1290 | flag aSign, bSign, zSign; | 1281 | flag aSign, bSign, zSign; |
1291 | int16 aExp, bExp, zExp; | 1282 | int16 aExp, bExp, zExp; |
@@ -1302,7 +1293,7 @@ float32 float32_div( float32 a, float32 b ) | |||
1302 | if ( aSig ) return propagateFloat32NaN( a, b ); | 1293 | if ( aSig ) return propagateFloat32NaN( a, b ); |
1303 | if ( bExp == 0xFF ) { | 1294 | if ( bExp == 0xFF ) { |
1304 | if ( bSig ) return propagateFloat32NaN( a, b ); | 1295 | if ( bSig ) return propagateFloat32NaN( a, b ); |
1305 | float_raise( float_flag_invalid ); | 1296 | roundData->exception |= float_flag_invalid; |
1306 | return float32_default_nan; | 1297 | return float32_default_nan; |
1307 | } | 1298 | } |
1308 | return packFloat32( zSign, 0xFF, 0 ); | 1299 | return packFloat32( zSign, 0xFF, 0 ); |
@@ -1314,10 +1305,10 @@ float32 float32_div( float32 a, float32 b ) | |||
1314 | if ( bExp == 0 ) { | 1305 | if ( bExp == 0 ) { |
1315 | if ( bSig == 0 ) { | 1306 | if ( bSig == 0 ) { |
1316 | if ( ( aExp | aSig ) == 0 ) { | 1307 | if ( ( aExp | aSig ) == 0 ) { |
1317 | float_raise( float_flag_invalid ); | 1308 | roundData->exception |= float_flag_invalid; |
1318 | return float32_default_nan; | 1309 | return float32_default_nan; |
1319 | } | 1310 | } |
1320 | float_raise( float_flag_divbyzero ); | 1311 | roundData->exception |= float_flag_divbyzero; |
1321 | return packFloat32( zSign, 0xFF, 0 ); | 1312 | return packFloat32( zSign, 0xFF, 0 ); |
1322 | } | 1313 | } |
1323 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); | 1314 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); |
@@ -1341,7 +1332,7 @@ float32 float32_div( float32 a, float32 b ) | |||
1341 | if ( ( zSig & 0x3F ) == 0 ) { | 1332 | if ( ( zSig & 0x3F ) == 0 ) { |
1342 | zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 ); | 1333 | zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 ); |
1343 | } | 1334 | } |
1344 | return roundAndPackFloat32( zSign, zExp, zSig ); | 1335 | return roundAndPackFloat32( roundData, zSign, zExp, zSig ); |
1345 | 1336 | ||
1346 | } | 1337 | } |
1347 | 1338 | ||
@@ -1352,7 +1343,7 @@ with respect to the corresponding value `b'. The operation is performed | |||
1352 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 1343 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
1353 | ------------------------------------------------------------------------------- | 1344 | ------------------------------------------------------------------------------- |
1354 | */ | 1345 | */ |
1355 | float32 float32_rem( float32 a, float32 b ) | 1346 | float32 float32_rem( struct roundingData *roundData, float32 a, float32 b ) |
1356 | { | 1347 | { |
1357 | flag aSign, bSign, zSign; | 1348 | flag aSign, bSign, zSign; |
1358 | int16 aExp, bExp, expDiff; | 1349 | int16 aExp, bExp, expDiff; |
@@ -1372,7 +1363,7 @@ float32 float32_rem( float32 a, float32 b ) | |||
1372 | if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { | 1363 | if ( aSig || ( ( bExp == 0xFF ) && bSig ) ) { |
1373 | return propagateFloat32NaN( a, b ); | 1364 | return propagateFloat32NaN( a, b ); |
1374 | } | 1365 | } |
1375 | float_raise( float_flag_invalid ); | 1366 | roundData->exception |= float_flag_invalid; |
1376 | return float32_default_nan; | 1367 | return float32_default_nan; |
1377 | } | 1368 | } |
1378 | if ( bExp == 0xFF ) { | 1369 | if ( bExp == 0xFF ) { |
@@ -1381,7 +1372,7 @@ float32 float32_rem( float32 a, float32 b ) | |||
1381 | } | 1372 | } |
1382 | if ( bExp == 0 ) { | 1373 | if ( bExp == 0 ) { |
1383 | if ( bSig == 0 ) { | 1374 | if ( bSig == 0 ) { |
1384 | float_raise( float_flag_invalid ); | 1375 | roundData->exception |= float_flag_invalid; |
1385 | return float32_default_nan; | 1376 | return float32_default_nan; |
1386 | } | 1377 | } |
1387 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); | 1378 | normalizeFloat32Subnormal( bSig, &bExp, &bSig ); |
@@ -1444,7 +1435,7 @@ float32 float32_rem( float32 a, float32 b ) | |||
1444 | } | 1435 | } |
1445 | zSign = ( (sbits32) aSig < 0 ); | 1436 | zSign = ( (sbits32) aSig < 0 ); |
1446 | if ( zSign ) aSig = - aSig; | 1437 | if ( zSign ) aSig = - aSig; |
1447 | return normalizeRoundAndPackFloat32( aSign ^ zSign, bExp, aSig ); | 1438 | return normalizeRoundAndPackFloat32( roundData, aSign ^ zSign, bExp, aSig ); |
1448 | 1439 | ||
1449 | } | 1440 | } |
1450 | 1441 | ||
@@ -1455,7 +1446,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary | |||
1455 | Floating-point Arithmetic. | 1446 | Floating-point Arithmetic. |
1456 | ------------------------------------------------------------------------------- | 1447 | ------------------------------------------------------------------------------- |
1457 | */ | 1448 | */ |
1458 | float32 float32_sqrt( float32 a ) | 1449 | float32 float32_sqrt( struct roundingData *roundData, float32 a ) |
1459 | { | 1450 | { |
1460 | flag aSign; | 1451 | flag aSign; |
1461 | int16 aExp, zExp; | 1452 | int16 aExp, zExp; |
@@ -1468,12 +1459,12 @@ float32 float32_sqrt( float32 a ) | |||
1468 | if ( aExp == 0xFF ) { | 1459 | if ( aExp == 0xFF ) { |
1469 | if ( aSig ) return propagateFloat32NaN( a, 0 ); | 1460 | if ( aSig ) return propagateFloat32NaN( a, 0 ); |
1470 | if ( ! aSign ) return a; | 1461 | if ( ! aSign ) return a; |
1471 | float_raise( float_flag_invalid ); | 1462 | roundData->exception |= float_flag_invalid; |
1472 | return float32_default_nan; | 1463 | return float32_default_nan; |
1473 | } | 1464 | } |
1474 | if ( aSign ) { | 1465 | if ( aSign ) { |
1475 | if ( ( aExp | aSig ) == 0 ) return a; | 1466 | if ( ( aExp | aSig ) == 0 ) return a; |
1476 | float_raise( float_flag_invalid ); | 1467 | roundData->exception |= float_flag_invalid; |
1477 | return float32_default_nan; | 1468 | return float32_default_nan; |
1478 | } | 1469 | } |
1479 | if ( aExp == 0 ) { | 1470 | if ( aExp == 0 ) { |
@@ -1499,7 +1490,7 @@ float32 float32_sqrt( float32 a ) | |||
1499 | } | 1490 | } |
1500 | } | 1491 | } |
1501 | shift32RightJamming( zSig, 1, &zSig ); | 1492 | shift32RightJamming( zSig, 1, &zSig ); |
1502 | return roundAndPackFloat32( 0, zExp, zSig ); | 1493 | return roundAndPackFloat32( roundData, 0, zExp, zSig ); |
1503 | 1494 | ||
1504 | } | 1495 | } |
1505 | 1496 | ||
@@ -1611,9 +1602,7 @@ flag float32_le_quiet( float32 a, float32 b ) | |||
1611 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | 1602 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
1612 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | 1603 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) |
1613 | ) { | 1604 | ) { |
1614 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | 1605 | /* Do nothing, even if NaN as we're quiet */ |
1615 | float_raise( float_flag_invalid ); | ||
1616 | } | ||
1617 | return 0; | 1606 | return 0; |
1618 | } | 1607 | } |
1619 | aSign = extractFloat32Sign( a ); | 1608 | aSign = extractFloat32Sign( a ); |
@@ -1638,9 +1627,7 @@ flag float32_lt_quiet( float32 a, float32 b ) | |||
1638 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | 1627 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
1639 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | 1628 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) |
1640 | ) { | 1629 | ) { |
1641 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | 1630 | /* Do nothing, even if NaN as we're quiet */ |
1642 | float_raise( float_flag_invalid ); | ||
1643 | } | ||
1644 | return 0; | 1631 | return 0; |
1645 | } | 1632 | } |
1646 | aSign = extractFloat32Sign( a ); | 1633 | aSign = extractFloat32Sign( a ); |
@@ -1661,7 +1648,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the | |||
1661 | largest integer with the same sign as `a' is returned. | 1648 | largest integer with the same sign as `a' is returned. |
1662 | ------------------------------------------------------------------------------- | 1649 | ------------------------------------------------------------------------------- |
1663 | */ | 1650 | */ |
1664 | int32 float64_to_int32( float64 a ) | 1651 | int32 float64_to_int32( struct roundingData *roundData, float64 a ) |
1665 | { | 1652 | { |
1666 | flag aSign; | 1653 | flag aSign; |
1667 | int16 aExp, shiftCount; | 1654 | int16 aExp, shiftCount; |
@@ -1674,7 +1661,7 @@ int32 float64_to_int32( float64 a ) | |||
1674 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); | 1661 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); |
1675 | shiftCount = 0x42C - aExp; | 1662 | shiftCount = 0x42C - aExp; |
1676 | if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); | 1663 | if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); |
1677 | return roundAndPackInt32( aSign, aSig ); | 1664 | return roundAndPackInt32( roundData, aSign, aSig ); |
1678 | 1665 | ||
1679 | } | 1666 | } |
1680 | 1667 | ||
@@ -1705,7 +1692,7 @@ int32 float64_to_int32_round_to_zero( float64 a ) | |||
1705 | goto invalid; | 1692 | goto invalid; |
1706 | } | 1693 | } |
1707 | else if ( 52 < shiftCount ) { | 1694 | else if ( 52 < shiftCount ) { |
1708 | if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; | 1695 | if ( aExp || aSig ) float_raise( float_flag_inexact ); |
1709 | return 0; | 1696 | return 0; |
1710 | } | 1697 | } |
1711 | aSig |= LIT64( 0x0010000000000000 ); | 1698 | aSig |= LIT64( 0x0010000000000000 ); |
@@ -1715,11 +1702,11 @@ int32 float64_to_int32_round_to_zero( float64 a ) | |||
1715 | if ( aSign ) z = - z; | 1702 | if ( aSign ) z = - z; |
1716 | if ( ( z < 0 ) ^ aSign ) { | 1703 | if ( ( z < 0 ) ^ aSign ) { |
1717 | invalid: | 1704 | invalid: |
1718 | float_exception_flags |= float_flag_invalid; | 1705 | float_raise( float_flag_invalid ); |
1719 | return aSign ? 0x80000000 : 0x7FFFFFFF; | 1706 | return aSign ? 0x80000000 : 0x7FFFFFFF; |
1720 | } | 1707 | } |
1721 | if ( ( aSig<<shiftCount ) != savedASig ) { | 1708 | if ( ( aSig<<shiftCount ) != savedASig ) { |
1722 | float_exception_flags |= float_flag_inexact; | 1709 | float_raise( float_flag_inexact ); |
1723 | } | 1710 | } |
1724 | return z; | 1711 | return z; |
1725 | 1712 | ||
@@ -1736,7 +1723,7 @@ positive integer is returned. Otherwise, if the conversion overflows, the | |||
1736 | largest positive integer is returned. | 1723 | largest positive integer is returned. |
1737 | ------------------------------------------------------------------------------- | 1724 | ------------------------------------------------------------------------------- |
1738 | */ | 1725 | */ |
1739 | int32 float64_to_uint32( float64 a ) | 1726 | int32 float64_to_uint32( struct roundingData *roundData, float64 a ) |
1740 | { | 1727 | { |
1741 | flag aSign; | 1728 | flag aSign; |
1742 | int16 aExp, shiftCount; | 1729 | int16 aExp, shiftCount; |
@@ -1749,7 +1736,7 @@ int32 float64_to_uint32( float64 a ) | |||
1749 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); | 1736 | if ( aExp ) aSig |= LIT64( 0x0010000000000000 ); |
1750 | shiftCount = 0x42C - aExp; | 1737 | shiftCount = 0x42C - aExp; |
1751 | if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); | 1738 | if ( 0 < shiftCount ) shift64RightJamming( aSig, shiftCount, &aSig ); |
1752 | return roundAndPackInt32( aSign, aSig ); | 1739 | return roundAndPackInt32( roundData, aSign, aSig ); |
1753 | } | 1740 | } |
1754 | 1741 | ||
1755 | /* | 1742 | /* |
@@ -1778,7 +1765,7 @@ int32 float64_to_uint32_round_to_zero( float64 a ) | |||
1778 | goto invalid; | 1765 | goto invalid; |
1779 | } | 1766 | } |
1780 | else if ( 52 < shiftCount ) { | 1767 | else if ( 52 < shiftCount ) { |
1781 | if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; | 1768 | if ( aExp || aSig ) float_raise( float_flag_inexact ); |
1782 | return 0; | 1769 | return 0; |
1783 | } | 1770 | } |
1784 | aSig |= LIT64( 0x0010000000000000 ); | 1771 | aSig |= LIT64( 0x0010000000000000 ); |
@@ -1788,11 +1775,11 @@ int32 float64_to_uint32_round_to_zero( float64 a ) | |||
1788 | if ( aSign ) z = - z; | 1775 | if ( aSign ) z = - z; |
1789 | if ( ( z < 0 ) ^ aSign ) { | 1776 | if ( ( z < 0 ) ^ aSign ) { |
1790 | invalid: | 1777 | invalid: |
1791 | float_exception_flags |= float_flag_invalid; | 1778 | float_raise( float_flag_invalid ); |
1792 | return aSign ? 0x80000000 : 0x7FFFFFFF; | 1779 | return aSign ? 0x80000000 : 0x7FFFFFFF; |
1793 | } | 1780 | } |
1794 | if ( ( aSig<<shiftCount ) != savedASig ) { | 1781 | if ( ( aSig<<shiftCount ) != savedASig ) { |
1795 | float_exception_flags |= float_flag_inexact; | 1782 | float_raise( float_flag_inexact ); |
1796 | } | 1783 | } |
1797 | return z; | 1784 | return z; |
1798 | } | 1785 | } |
@@ -1805,7 +1792,7 @@ performed according to the IEC/IEEE Standard for Binary Floating-point | |||
1805 | Arithmetic. | 1792 | Arithmetic. |
1806 | ------------------------------------------------------------------------------- | 1793 | ------------------------------------------------------------------------------- |
1807 | */ | 1794 | */ |
1808 | float32 float64_to_float32( float64 a ) | 1795 | float32 float64_to_float32( struct roundingData *roundData, float64 a ) |
1809 | { | 1796 | { |
1810 | flag aSign; | 1797 | flag aSign; |
1811 | int16 aExp; | 1798 | int16 aExp; |
@@ -1825,7 +1812,7 @@ float32 float64_to_float32( float64 a ) | |||
1825 | zSig |= 0x40000000; | 1812 | zSig |= 0x40000000; |
1826 | aExp -= 0x381; | 1813 | aExp -= 0x381; |
1827 | } | 1814 | } |
1828 | return roundAndPackFloat32( aSign, aExp, zSig ); | 1815 | return roundAndPackFloat32( roundData, aSign, aExp, zSig ); |
1829 | 1816 | ||
1830 | } | 1817 | } |
1831 | 1818 | ||
@@ -1872,7 +1859,7 @@ operation is performed according to the IEC/IEEE Standard for Binary | |||
1872 | Floating-point Arithmetic. | 1859 | Floating-point Arithmetic. |
1873 | ------------------------------------------------------------------------------- | 1860 | ------------------------------------------------------------------------------- |
1874 | */ | 1861 | */ |
1875 | float64 float64_round_to_int( float64 a ) | 1862 | float64 float64_round_to_int( struct roundingData *roundData, float64 a ) |
1876 | { | 1863 | { |
1877 | flag aSign; | 1864 | flag aSign; |
1878 | int16 aExp; | 1865 | int16 aExp; |
@@ -1889,9 +1876,9 @@ float64 float64_round_to_int( float64 a ) | |||
1889 | } | 1876 | } |
1890 | if ( aExp <= 0x3FE ) { | 1877 | if ( aExp <= 0x3FE ) { |
1891 | if ( (bits64) ( a<<1 ) == 0 ) return a; | 1878 | if ( (bits64) ( a<<1 ) == 0 ) return a; |
1892 | float_exception_flags |= float_flag_inexact; | 1879 | roundData->exception |= float_flag_inexact; |
1893 | aSign = extractFloat64Sign( a ); | 1880 | aSign = extractFloat64Sign( a ); |
1894 | switch ( float_rounding_mode ) { | 1881 | switch ( roundData->mode ) { |
1895 | case float_round_nearest_even: | 1882 | case float_round_nearest_even: |
1896 | if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) { | 1883 | if ( ( aExp == 0x3FE ) && extractFloat64Frac( a ) ) { |
1897 | return packFloat64( aSign, 0x3FF, 0 ); | 1884 | return packFloat64( aSign, 0x3FF, 0 ); |
@@ -1909,7 +1896,7 @@ float64 float64_round_to_int( float64 a ) | |||
1909 | lastBitMask <<= 0x433 - aExp; | 1896 | lastBitMask <<= 0x433 - aExp; |
1910 | roundBitsMask = lastBitMask - 1; | 1897 | roundBitsMask = lastBitMask - 1; |
1911 | z = a; | 1898 | z = a; |
1912 | roundingMode = float_rounding_mode; | 1899 | roundingMode = roundData->mode; |
1913 | if ( roundingMode == float_round_nearest_even ) { | 1900 | if ( roundingMode == float_round_nearest_even ) { |
1914 | z += lastBitMask>>1; | 1901 | z += lastBitMask>>1; |
1915 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; | 1902 | if ( ( z & roundBitsMask ) == 0 ) z &= ~ lastBitMask; |
@@ -1920,7 +1907,7 @@ float64 float64_round_to_int( float64 a ) | |||
1920 | } | 1907 | } |
1921 | } | 1908 | } |
1922 | z &= ~ roundBitsMask; | 1909 | z &= ~ roundBitsMask; |
1923 | if ( z != a ) float_exception_flags |= float_flag_inexact; | 1910 | if ( z != a ) roundData->exception |= float_flag_inexact; |
1924 | return z; | 1911 | return z; |
1925 | 1912 | ||
1926 | } | 1913 | } |
@@ -1934,7 +1921,7 @@ addition is performed according to the IEC/IEEE Standard for Binary | |||
1934 | Floating-point Arithmetic. | 1921 | Floating-point Arithmetic. |
1935 | ------------------------------------------------------------------------------- | 1922 | ------------------------------------------------------------------------------- |
1936 | */ | 1923 | */ |
1937 | static float64 addFloat64Sigs( float64 a, float64 b, flag zSign ) | 1924 | static float64 addFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign ) |
1938 | { | 1925 | { |
1939 | int16 aExp, bExp, zExp; | 1926 | int16 aExp, bExp, zExp; |
1940 | bits64 aSig, bSig, zSig; | 1927 | bits64 aSig, bSig, zSig; |
@@ -1993,7 +1980,7 @@ static float64 addFloat64Sigs( float64 a, float64 b, flag zSign ) | |||
1993 | ++zExp; | 1980 | ++zExp; |
1994 | } | 1981 | } |
1995 | roundAndPack: | 1982 | roundAndPack: |
1996 | return roundAndPackFloat64( zSign, zExp, zSig ); | 1983 | return roundAndPackFloat64( roundData, zSign, zExp, zSig ); |
1997 | 1984 | ||
1998 | } | 1985 | } |
1999 | 1986 | ||
@@ -2006,7 +1993,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE | |||
2006 | Standard for Binary Floating-point Arithmetic. | 1993 | Standard for Binary Floating-point Arithmetic. |
2007 | ------------------------------------------------------------------------------- | 1994 | ------------------------------------------------------------------------------- |
2008 | */ | 1995 | */ |
2009 | static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) | 1996 | static float64 subFloat64Sigs( struct roundingData *roundData, float64 a, float64 b, flag zSign ) |
2010 | { | 1997 | { |
2011 | int16 aExp, bExp, zExp; | 1998 | int16 aExp, bExp, zExp; |
2012 | bits64 aSig, bSig, zSig; | 1999 | bits64 aSig, bSig, zSig; |
@@ -2023,7 +2010,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) | |||
2023 | if ( expDiff < 0 ) goto bExpBigger; | 2010 | if ( expDiff < 0 ) goto bExpBigger; |
2024 | if ( aExp == 0x7FF ) { | 2011 | if ( aExp == 0x7FF ) { |
2025 | if ( aSig | bSig ) return propagateFloat64NaN( a, b ); | 2012 | if ( aSig | bSig ) return propagateFloat64NaN( a, b ); |
2026 | float_raise( float_flag_invalid ); | 2013 | roundData->exception |= float_flag_invalid; |
2027 | return float64_default_nan; | 2014 | return float64_default_nan; |
2028 | } | 2015 | } |
2029 | if ( aExp == 0 ) { | 2016 | if ( aExp == 0 ) { |
@@ -2032,7 +2019,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) | |||
2032 | } | 2019 | } |
2033 | if ( bSig < aSig ) goto aBigger; | 2020 | if ( bSig < aSig ) goto aBigger; |
2034 | if ( aSig < bSig ) goto bBigger; | 2021 | if ( aSig < bSig ) goto bBigger; |
2035 | return packFloat64( float_rounding_mode == float_round_down, 0, 0 ); | 2022 | return packFloat64( roundData->mode == float_round_down, 0, 0 ); |
2036 | bExpBigger: | 2023 | bExpBigger: |
2037 | if ( bExp == 0x7FF ) { | 2024 | if ( bExp == 0x7FF ) { |
2038 | if ( bSig ) return propagateFloat64NaN( a, b ); | 2025 | if ( bSig ) return propagateFloat64NaN( a, b ); |
@@ -2069,7 +2056,7 @@ static float64 subFloat64Sigs( float64 a, float64 b, flag zSign ) | |||
2069 | zExp = aExp; | 2056 | zExp = aExp; |
2070 | normalizeRoundAndPack: | 2057 | normalizeRoundAndPack: |
2071 | --zExp; | 2058 | --zExp; |
2072 | return normalizeRoundAndPackFloat64( zSign, zExp, zSig ); | 2059 | return normalizeRoundAndPackFloat64( roundData, zSign, zExp, zSig ); |
2073 | 2060 | ||
2074 | } | 2061 | } |
2075 | 2062 | ||
@@ -2080,17 +2067,17 @@ and `b'. The operation is performed according to the IEC/IEEE Standard for | |||
2080 | Binary Floating-point Arithmetic. | 2067 | Binary Floating-point Arithmetic. |
2081 | ------------------------------------------------------------------------------- | 2068 | ------------------------------------------------------------------------------- |
2082 | */ | 2069 | */ |
2083 | float64 float64_add( float64 a, float64 b ) | 2070 | float64 float64_add( struct roundingData *roundData, float64 a, float64 b ) |
2084 | { | 2071 | { |
2085 | flag aSign, bSign; | 2072 | flag aSign, bSign; |
2086 | 2073 | ||
2087 | aSign = extractFloat64Sign( a ); | 2074 | aSign = extractFloat64Sign( a ); |
2088 | bSign = extractFloat64Sign( b ); | 2075 | bSign = extractFloat64Sign( b ); |
2089 | if ( aSign == bSign ) { | 2076 | if ( aSign == bSign ) { |
2090 | return addFloat64Sigs( a, b, aSign ); | 2077 | return addFloat64Sigs( roundData, a, b, aSign ); |
2091 | } | 2078 | } |
2092 | else { | 2079 | else { |
2093 | return subFloat64Sigs( a, b, aSign ); | 2080 | return subFloat64Sigs( roundData, a, b, aSign ); |
2094 | } | 2081 | } |
2095 | 2082 | ||
2096 | } | 2083 | } |
@@ -2102,17 +2089,17 @@ Returns the result of subtracting the double-precision floating-point values | |||
2102 | for Binary Floating-point Arithmetic. | 2089 | for Binary Floating-point Arithmetic. |
2103 | ------------------------------------------------------------------------------- | 2090 | ------------------------------------------------------------------------------- |
2104 | */ | 2091 | */ |
2105 | float64 float64_sub( float64 a, float64 b ) | 2092 | float64 float64_sub( struct roundingData *roundData, float64 a, float64 b ) |
2106 | { | 2093 | { |
2107 | flag aSign, bSign; | 2094 | flag aSign, bSign; |
2108 | 2095 | ||
2109 | aSign = extractFloat64Sign( a ); | 2096 | aSign = extractFloat64Sign( a ); |
2110 | bSign = extractFloat64Sign( b ); | 2097 | bSign = extractFloat64Sign( b ); |
2111 | if ( aSign == bSign ) { | 2098 | if ( aSign == bSign ) { |
2112 | return subFloat64Sigs( a, b, aSign ); | 2099 | return subFloat64Sigs( roundData, a, b, aSign ); |
2113 | } | 2100 | } |
2114 | else { | 2101 | else { |
2115 | return addFloat64Sigs( a, b, aSign ); | 2102 | return addFloat64Sigs( roundData, a, b, aSign ); |
2116 | } | 2103 | } |
2117 | 2104 | ||
2118 | } | 2105 | } |
@@ -2124,7 +2111,7 @@ Returns the result of multiplying the double-precision floating-point values | |||
2124 | for Binary Floating-point Arithmetic. | 2111 | for Binary Floating-point Arithmetic. |
2125 | ------------------------------------------------------------------------------- | 2112 | ------------------------------------------------------------------------------- |
2126 | */ | 2113 | */ |
2127 | float64 float64_mul( float64 a, float64 b ) | 2114 | float64 float64_mul( struct roundingData *roundData, float64 a, float64 b ) |
2128 | { | 2115 | { |
2129 | flag aSign, bSign, zSign; | 2116 | flag aSign, bSign, zSign; |
2130 | int16 aExp, bExp, zExp; | 2117 | int16 aExp, bExp, zExp; |
@@ -2142,7 +2129,7 @@ float64 float64_mul( float64 a, float64 b ) | |||
2142 | return propagateFloat64NaN( a, b ); | 2129 | return propagateFloat64NaN( a, b ); |
2143 | } | 2130 | } |
2144 | if ( ( bExp | bSig ) == 0 ) { | 2131 | if ( ( bExp | bSig ) == 0 ) { |
2145 | float_raise( float_flag_invalid ); | 2132 | roundData->exception |= float_flag_invalid; |
2146 | return float64_default_nan; | 2133 | return float64_default_nan; |
2147 | } | 2134 | } |
2148 | return packFloat64( zSign, 0x7FF, 0 ); | 2135 | return packFloat64( zSign, 0x7FF, 0 ); |
@@ -2150,7 +2137,7 @@ float64 float64_mul( float64 a, float64 b ) | |||
2150 | if ( bExp == 0x7FF ) { | 2137 | if ( bExp == 0x7FF ) { |
2151 | if ( bSig ) return propagateFloat64NaN( a, b ); | 2138 | if ( bSig ) return propagateFloat64NaN( a, b ); |
2152 | if ( ( aExp | aSig ) == 0 ) { | 2139 | if ( ( aExp | aSig ) == 0 ) { |
2153 | float_raise( float_flag_invalid ); | 2140 | roundData->exception |= float_flag_invalid; |
2154 | return float64_default_nan; | 2141 | return float64_default_nan; |
2155 | } | 2142 | } |
2156 | return packFloat64( zSign, 0x7FF, 0 ); | 2143 | return packFloat64( zSign, 0x7FF, 0 ); |
@@ -2172,7 +2159,7 @@ float64 float64_mul( float64 a, float64 b ) | |||
2172 | zSig0 <<= 1; | 2159 | zSig0 <<= 1; |
2173 | --zExp; | 2160 | --zExp; |
2174 | } | 2161 | } |
2175 | return roundAndPackFloat64( zSign, zExp, zSig0 ); | 2162 | return roundAndPackFloat64( roundData, zSign, zExp, zSig0 ); |
2176 | 2163 | ||
2177 | } | 2164 | } |
2178 | 2165 | ||
@@ -2183,7 +2170,7 @@ by the corresponding value `b'. The operation is performed according to | |||
2183 | the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 2170 | the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
2184 | ------------------------------------------------------------------------------- | 2171 | ------------------------------------------------------------------------------- |
2185 | */ | 2172 | */ |
2186 | float64 float64_div( float64 a, float64 b ) | 2173 | float64 float64_div( struct roundingData *roundData, float64 a, float64 b ) |
2187 | { | 2174 | { |
2188 | flag aSign, bSign, zSign; | 2175 | flag aSign, bSign, zSign; |
2189 | int16 aExp, bExp, zExp; | 2176 | int16 aExp, bExp, zExp; |
@@ -2202,7 +2189,7 @@ float64 float64_div( float64 a, float64 b ) | |||
2202 | if ( aSig ) return propagateFloat64NaN( a, b ); | 2189 | if ( aSig ) return propagateFloat64NaN( a, b ); |
2203 | if ( bExp == 0x7FF ) { | 2190 | if ( bExp == 0x7FF ) { |
2204 | if ( bSig ) return propagateFloat64NaN( a, b ); | 2191 | if ( bSig ) return propagateFloat64NaN( a, b ); |
2205 | float_raise( float_flag_invalid ); | 2192 | roundData->exception |= float_flag_invalid; |
2206 | return float64_default_nan; | 2193 | return float64_default_nan; |
2207 | } | 2194 | } |
2208 | return packFloat64( zSign, 0x7FF, 0 ); | 2195 | return packFloat64( zSign, 0x7FF, 0 ); |
@@ -2214,10 +2201,10 @@ float64 float64_div( float64 a, float64 b ) | |||
2214 | if ( bExp == 0 ) { | 2201 | if ( bExp == 0 ) { |
2215 | if ( bSig == 0 ) { | 2202 | if ( bSig == 0 ) { |
2216 | if ( ( aExp | aSig ) == 0 ) { | 2203 | if ( ( aExp | aSig ) == 0 ) { |
2217 | float_raise( float_flag_invalid ); | 2204 | roundData->exception |= float_flag_invalid; |
2218 | return float64_default_nan; | 2205 | return float64_default_nan; |
2219 | } | 2206 | } |
2220 | float_raise( float_flag_divbyzero ); | 2207 | roundData->exception |= float_flag_divbyzero; |
2221 | return packFloat64( zSign, 0x7FF, 0 ); | 2208 | return packFloat64( zSign, 0x7FF, 0 ); |
2222 | } | 2209 | } |
2223 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); | 2210 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); |
@@ -2243,7 +2230,7 @@ float64 float64_div( float64 a, float64 b ) | |||
2243 | } | 2230 | } |
2244 | zSig |= ( rem1 != 0 ); | 2231 | zSig |= ( rem1 != 0 ); |
2245 | } | 2232 | } |
2246 | return roundAndPackFloat64( zSign, zExp, zSig ); | 2233 | return roundAndPackFloat64( roundData, zSign, zExp, zSig ); |
2247 | 2234 | ||
2248 | } | 2235 | } |
2249 | 2236 | ||
@@ -2254,7 +2241,7 @@ with respect to the corresponding value `b'. The operation is performed | |||
2254 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 2241 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
2255 | ------------------------------------------------------------------------------- | 2242 | ------------------------------------------------------------------------------- |
2256 | */ | 2243 | */ |
2257 | float64 float64_rem( float64 a, float64 b ) | 2244 | float64 float64_rem( struct roundingData *roundData, float64 a, float64 b ) |
2258 | { | 2245 | { |
2259 | flag aSign, bSign, zSign; | 2246 | flag aSign, bSign, zSign; |
2260 | int16 aExp, bExp, expDiff; | 2247 | int16 aExp, bExp, expDiff; |
@@ -2272,7 +2259,7 @@ float64 float64_rem( float64 a, float64 b ) | |||
2272 | if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { | 2259 | if ( aSig || ( ( bExp == 0x7FF ) && bSig ) ) { |
2273 | return propagateFloat64NaN( a, b ); | 2260 | return propagateFloat64NaN( a, b ); |
2274 | } | 2261 | } |
2275 | float_raise( float_flag_invalid ); | 2262 | roundData->exception |= float_flag_invalid; |
2276 | return float64_default_nan; | 2263 | return float64_default_nan; |
2277 | } | 2264 | } |
2278 | if ( bExp == 0x7FF ) { | 2265 | if ( bExp == 0x7FF ) { |
@@ -2281,7 +2268,7 @@ float64 float64_rem( float64 a, float64 b ) | |||
2281 | } | 2268 | } |
2282 | if ( bExp == 0 ) { | 2269 | if ( bExp == 0 ) { |
2283 | if ( bSig == 0 ) { | 2270 | if ( bSig == 0 ) { |
2284 | float_raise( float_flag_invalid ); | 2271 | roundData->exception |= float_flag_invalid; |
2285 | return float64_default_nan; | 2272 | return float64_default_nan; |
2286 | } | 2273 | } |
2287 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); | 2274 | normalizeFloat64Subnormal( bSig, &bExp, &bSig ); |
@@ -2329,7 +2316,7 @@ float64 float64_rem( float64 a, float64 b ) | |||
2329 | } | 2316 | } |
2330 | zSign = ( (sbits64) aSig < 0 ); | 2317 | zSign = ( (sbits64) aSig < 0 ); |
2331 | if ( zSign ) aSig = - aSig; | 2318 | if ( zSign ) aSig = - aSig; |
2332 | return normalizeRoundAndPackFloat64( aSign ^ zSign, bExp, aSig ); | 2319 | return normalizeRoundAndPackFloat64( roundData, aSign ^ zSign, bExp, aSig ); |
2333 | 2320 | ||
2334 | } | 2321 | } |
2335 | 2322 | ||
@@ -2340,7 +2327,7 @@ The operation is performed according to the IEC/IEEE Standard for Binary | |||
2340 | Floating-point Arithmetic. | 2327 | Floating-point Arithmetic. |
2341 | ------------------------------------------------------------------------------- | 2328 | ------------------------------------------------------------------------------- |
2342 | */ | 2329 | */ |
2343 | float64 float64_sqrt( float64 a ) | 2330 | float64 float64_sqrt( struct roundingData *roundData, float64 a ) |
2344 | { | 2331 | { |
2345 | flag aSign; | 2332 | flag aSign; |
2346 | int16 aExp, zExp; | 2333 | int16 aExp, zExp; |
@@ -2354,12 +2341,12 @@ float64 float64_sqrt( float64 a ) | |||
2354 | if ( aExp == 0x7FF ) { | 2341 | if ( aExp == 0x7FF ) { |
2355 | if ( aSig ) return propagateFloat64NaN( a, a ); | 2342 | if ( aSig ) return propagateFloat64NaN( a, a ); |
2356 | if ( ! aSign ) return a; | 2343 | if ( ! aSign ) return a; |
2357 | float_raise( float_flag_invalid ); | 2344 | roundData->exception |= float_flag_invalid; |
2358 | return float64_default_nan; | 2345 | return float64_default_nan; |
2359 | } | 2346 | } |
2360 | if ( aSign ) { | 2347 | if ( aSign ) { |
2361 | if ( ( aExp | aSig ) == 0 ) return a; | 2348 | if ( ( aExp | aSig ) == 0 ) return a; |
2362 | float_raise( float_flag_invalid ); | 2349 | roundData->exception |= float_flag_invalid; |
2363 | return float64_default_nan; | 2350 | return float64_default_nan; |
2364 | } | 2351 | } |
2365 | if ( aExp == 0 ) { | 2352 | if ( aExp == 0 ) { |
@@ -2390,7 +2377,7 @@ float64 float64_sqrt( float64 a ) | |||
2390 | } | 2377 | } |
2391 | } | 2378 | } |
2392 | shift64RightJamming( zSig, 1, &zSig ); | 2379 | shift64RightJamming( zSig, 1, &zSig ); |
2393 | return roundAndPackFloat64( 0, zExp, zSig ); | 2380 | return roundAndPackFloat64( roundData, 0, zExp, zSig ); |
2394 | 2381 | ||
2395 | } | 2382 | } |
2396 | 2383 | ||
@@ -2502,9 +2489,7 @@ flag float64_le_quiet( float64 a, float64 b ) | |||
2502 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | 2489 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
2503 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | 2490 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) |
2504 | ) { | 2491 | ) { |
2505 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | 2492 | /* Do nothing, even if NaN as we're quiet */ |
2506 | float_raise( float_flag_invalid ); | ||
2507 | } | ||
2508 | return 0; | 2493 | return 0; |
2509 | } | 2494 | } |
2510 | aSign = extractFloat64Sign( a ); | 2495 | aSign = extractFloat64Sign( a ); |
@@ -2529,9 +2514,7 @@ flag float64_lt_quiet( float64 a, float64 b ) | |||
2529 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | 2514 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
2530 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | 2515 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) |
2531 | ) { | 2516 | ) { |
2532 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | 2517 | /* Do nothing, even if NaN as we're quiet */ |
2533 | float_raise( float_flag_invalid ); | ||
2534 | } | ||
2535 | return 0; | 2518 | return 0; |
2536 | } | 2519 | } |
2537 | aSign = extractFloat64Sign( a ); | 2520 | aSign = extractFloat64Sign( a ); |
@@ -2554,7 +2537,7 @@ largest positive integer is returned. Otherwise, if the conversion | |||
2554 | overflows, the largest integer with the same sign as `a' is returned. | 2537 | overflows, the largest integer with the same sign as `a' is returned. |
2555 | ------------------------------------------------------------------------------- | 2538 | ------------------------------------------------------------------------------- |
2556 | */ | 2539 | */ |
2557 | int32 floatx80_to_int32( floatx80 a ) | 2540 | int32 floatx80_to_int32( struct roundingData *roundData, floatx80 a ) |
2558 | { | 2541 | { |
2559 | flag aSign; | 2542 | flag aSign; |
2560 | int32 aExp, shiftCount; | 2543 | int32 aExp, shiftCount; |
@@ -2567,7 +2550,7 @@ int32 floatx80_to_int32( floatx80 a ) | |||
2567 | shiftCount = 0x4037 - aExp; | 2550 | shiftCount = 0x4037 - aExp; |
2568 | if ( shiftCount <= 0 ) shiftCount = 1; | 2551 | if ( shiftCount <= 0 ) shiftCount = 1; |
2569 | shift64RightJamming( aSig, shiftCount, &aSig ); | 2552 | shift64RightJamming( aSig, shiftCount, &aSig ); |
2570 | return roundAndPackInt32( aSign, aSig ); | 2553 | return roundAndPackInt32( roundData, aSign, aSig ); |
2571 | 2554 | ||
2572 | } | 2555 | } |
2573 | 2556 | ||
@@ -2598,7 +2581,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a ) | |||
2598 | goto invalid; | 2581 | goto invalid; |
2599 | } | 2582 | } |
2600 | else if ( 63 < shiftCount ) { | 2583 | else if ( 63 < shiftCount ) { |
2601 | if ( aExp || aSig ) float_exception_flags |= float_flag_inexact; | 2584 | if ( aExp || aSig ) float_raise( float_flag_inexact ); |
2602 | return 0; | 2585 | return 0; |
2603 | } | 2586 | } |
2604 | savedASig = aSig; | 2587 | savedASig = aSig; |
@@ -2607,11 +2590,11 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a ) | |||
2607 | if ( aSign ) z = - z; | 2590 | if ( aSign ) z = - z; |
2608 | if ( ( z < 0 ) ^ aSign ) { | 2591 | if ( ( z < 0 ) ^ aSign ) { |
2609 | invalid: | 2592 | invalid: |
2610 | float_exception_flags |= float_flag_invalid; | 2593 | float_raise( float_flag_invalid ); |
2611 | return aSign ? 0x80000000 : 0x7FFFFFFF; | 2594 | return aSign ? 0x80000000 : 0x7FFFFFFF; |
2612 | } | 2595 | } |
2613 | if ( ( aSig<<shiftCount ) != savedASig ) { | 2596 | if ( ( aSig<<shiftCount ) != savedASig ) { |
2614 | float_exception_flags |= float_flag_inexact; | 2597 | float_raise( float_flag_inexact ); |
2615 | } | 2598 | } |
2616 | return z; | 2599 | return z; |
2617 | 2600 | ||
@@ -2625,7 +2608,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary | |||
2625 | Floating-point Arithmetic. | 2608 | Floating-point Arithmetic. |
2626 | ------------------------------------------------------------------------------- | 2609 | ------------------------------------------------------------------------------- |
2627 | */ | 2610 | */ |
2628 | float32 floatx80_to_float32( floatx80 a ) | 2611 | float32 floatx80_to_float32( struct roundingData *roundData, floatx80 a ) |
2629 | { | 2612 | { |
2630 | flag aSign; | 2613 | flag aSign; |
2631 | int32 aExp; | 2614 | int32 aExp; |
@@ -2642,7 +2625,7 @@ float32 floatx80_to_float32( floatx80 a ) | |||
2642 | } | 2625 | } |
2643 | shift64RightJamming( aSig, 33, &aSig ); | 2626 | shift64RightJamming( aSig, 33, &aSig ); |
2644 | if ( aExp || aSig ) aExp -= 0x3F81; | 2627 | if ( aExp || aSig ) aExp -= 0x3F81; |
2645 | return roundAndPackFloat32( aSign, aExp, aSig ); | 2628 | return roundAndPackFloat32( roundData, aSign, aExp, aSig ); |
2646 | 2629 | ||
2647 | } | 2630 | } |
2648 | 2631 | ||
@@ -2654,7 +2637,7 @@ conversion is performed according to the IEC/IEEE Standard for Binary | |||
2654 | Floating-point Arithmetic. | 2637 | Floating-point Arithmetic. |
2655 | ------------------------------------------------------------------------------- | 2638 | ------------------------------------------------------------------------------- |
2656 | */ | 2639 | */ |
2657 | float64 floatx80_to_float64( floatx80 a ) | 2640 | float64 floatx80_to_float64( struct roundingData *roundData, floatx80 a ) |
2658 | { | 2641 | { |
2659 | flag aSign; | 2642 | flag aSign; |
2660 | int32 aExp; | 2643 | int32 aExp; |
@@ -2671,7 +2654,7 @@ float64 floatx80_to_float64( floatx80 a ) | |||
2671 | } | 2654 | } |
2672 | shift64RightJamming( aSig, 1, &zSig ); | 2655 | shift64RightJamming( aSig, 1, &zSig ); |
2673 | if ( aExp || aSig ) aExp -= 0x3C01; | 2656 | if ( aExp || aSig ) aExp -= 0x3C01; |
2674 | return roundAndPackFloat64( aSign, aExp, zSig ); | 2657 | return roundAndPackFloat64( roundData, aSign, aExp, zSig ); |
2675 | 2658 | ||
2676 | } | 2659 | } |
2677 | 2660 | ||
@@ -2683,7 +2666,7 @@ value. The operation is performed according to the IEC/IEEE Standard for | |||
2683 | Binary Floating-point Arithmetic. | 2666 | Binary Floating-point Arithmetic. |
2684 | ------------------------------------------------------------------------------- | 2667 | ------------------------------------------------------------------------------- |
2685 | */ | 2668 | */ |
2686 | floatx80 floatx80_round_to_int( floatx80 a ) | 2669 | floatx80 floatx80_round_to_int( struct roundingData *roundData, floatx80 a ) |
2687 | { | 2670 | { |
2688 | flag aSign; | 2671 | flag aSign; |
2689 | int32 aExp; | 2672 | int32 aExp; |
@@ -2703,9 +2686,9 @@ floatx80 floatx80_round_to_int( floatx80 a ) | |||
2703 | && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) { | 2686 | && ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) { |
2704 | return a; | 2687 | return a; |
2705 | } | 2688 | } |
2706 | float_exception_flags |= float_flag_inexact; | 2689 | roundData->exception |= float_flag_inexact; |
2707 | aSign = extractFloatx80Sign( a ); | 2690 | aSign = extractFloatx80Sign( a ); |
2708 | switch ( float_rounding_mode ) { | 2691 | switch ( roundData->mode ) { |
2709 | case float_round_nearest_even: | 2692 | case float_round_nearest_even: |
2710 | if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 ) | 2693 | if ( ( aExp == 0x3FFE ) && (bits64) ( extractFloatx80Frac( a )<<1 ) |
2711 | ) { | 2694 | ) { |
@@ -2729,7 +2712,7 @@ floatx80 floatx80_round_to_int( floatx80 a ) | |||
2729 | lastBitMask <<= 0x403E - aExp; | 2712 | lastBitMask <<= 0x403E - aExp; |
2730 | roundBitsMask = lastBitMask - 1; | 2713 | roundBitsMask = lastBitMask - 1; |
2731 | z = a; | 2714 | z = a; |
2732 | roundingMode = float_rounding_mode; | 2715 | roundingMode = roundData->mode; |
2733 | if ( roundingMode == float_round_nearest_even ) { | 2716 | if ( roundingMode == float_round_nearest_even ) { |
2734 | z.low += lastBitMask>>1; | 2717 | z.low += lastBitMask>>1; |
2735 | if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; | 2718 | if ( ( z.low & roundBitsMask ) == 0 ) z.low &= ~ lastBitMask; |
@@ -2744,7 +2727,7 @@ floatx80 floatx80_round_to_int( floatx80 a ) | |||
2744 | ++z.high; | 2727 | ++z.high; |
2745 | z.low = LIT64( 0x8000000000000000 ); | 2728 | z.low = LIT64( 0x8000000000000000 ); |
2746 | } | 2729 | } |
2747 | if ( z.low != a.low ) float_exception_flags |= float_flag_inexact; | 2730 | if ( z.low != a.low ) roundData->exception |= float_flag_inexact; |
2748 | return z; | 2731 | return z; |
2749 | 2732 | ||
2750 | } | 2733 | } |
@@ -2758,7 +2741,7 @@ The addition is performed according to the IEC/IEEE Standard for Binary | |||
2758 | Floating-point Arithmetic. | 2741 | Floating-point Arithmetic. |
2759 | ------------------------------------------------------------------------------- | 2742 | ------------------------------------------------------------------------------- |
2760 | */ | 2743 | */ |
2761 | static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | 2744 | static floatx80 addFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign ) |
2762 | { | 2745 | { |
2763 | int32 aExp, bExp, zExp; | 2746 | int32 aExp, bExp, zExp; |
2764 | bits64 aSig, bSig, zSig0, zSig1; | 2747 | bits64 aSig, bSig, zSig0, zSig1; |
@@ -2814,7 +2797,7 @@ static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |||
2814 | roundAndPack: | 2797 | roundAndPack: |
2815 | return | 2798 | return |
2816 | roundAndPackFloatx80( | 2799 | roundAndPackFloatx80( |
2817 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | 2800 | roundData, zSign, zExp, zSig0, zSig1 ); |
2818 | 2801 | ||
2819 | } | 2802 | } |
2820 | 2803 | ||
@@ -2827,7 +2810,7 @@ result is a NaN. The subtraction is performed according to the IEC/IEEE | |||
2827 | Standard for Binary Floating-point Arithmetic. | 2810 | Standard for Binary Floating-point Arithmetic. |
2828 | ------------------------------------------------------------------------------- | 2811 | ------------------------------------------------------------------------------- |
2829 | */ | 2812 | */ |
2830 | static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | 2813 | static floatx80 subFloatx80Sigs( struct roundingData *roundData, floatx80 a, floatx80 b, flag zSign ) |
2831 | { | 2814 | { |
2832 | int32 aExp, bExp, zExp; | 2815 | int32 aExp, bExp, zExp; |
2833 | bits64 aSig, bSig, zSig0, zSig1; | 2816 | bits64 aSig, bSig, zSig0, zSig1; |
@@ -2845,7 +2828,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |||
2845 | if ( (bits64) ( ( aSig | bSig )<<1 ) ) { | 2828 | if ( (bits64) ( ( aSig | bSig )<<1 ) ) { |
2846 | return propagateFloatx80NaN( a, b ); | 2829 | return propagateFloatx80NaN( a, b ); |
2847 | } | 2830 | } |
2848 | float_raise( float_flag_invalid ); | 2831 | roundData->exception |= float_flag_invalid; |
2849 | z.low = floatx80_default_nan_low; | 2832 | z.low = floatx80_default_nan_low; |
2850 | z.high = floatx80_default_nan_high; | 2833 | z.high = floatx80_default_nan_high; |
2851 | return z; | 2834 | return z; |
@@ -2857,7 +2840,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |||
2857 | zSig1 = 0; | 2840 | zSig1 = 0; |
2858 | if ( bSig < aSig ) goto aBigger; | 2841 | if ( bSig < aSig ) goto aBigger; |
2859 | if ( aSig < bSig ) goto bBigger; | 2842 | if ( aSig < bSig ) goto bBigger; |
2860 | return packFloatx80( float_rounding_mode == float_round_down, 0, 0 ); | 2843 | return packFloatx80( roundData->mode == float_round_down, 0, 0 ); |
2861 | bExpBigger: | 2844 | bExpBigger: |
2862 | if ( bExp == 0x7FFF ) { | 2845 | if ( bExp == 0x7FFF ) { |
2863 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | 2846 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); |
@@ -2883,7 +2866,7 @@ static floatx80 subFloatx80Sigs( floatx80 a, floatx80 b, flag zSign ) | |||
2883 | normalizeRoundAndPack: | 2866 | normalizeRoundAndPack: |
2884 | return | 2867 | return |
2885 | normalizeRoundAndPackFloatx80( | 2868 | normalizeRoundAndPackFloatx80( |
2886 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | 2869 | roundData, zSign, zExp, zSig0, zSig1 ); |
2887 | 2870 | ||
2888 | } | 2871 | } |
2889 | 2872 | ||
@@ -2894,17 +2877,17 @@ values `a' and `b'. The operation is performed according to the IEC/IEEE | |||
2894 | Standard for Binary Floating-point Arithmetic. | 2877 | Standard for Binary Floating-point Arithmetic. |
2895 | ------------------------------------------------------------------------------- | 2878 | ------------------------------------------------------------------------------- |
2896 | */ | 2879 | */ |
2897 | floatx80 floatx80_add( floatx80 a, floatx80 b ) | 2880 | floatx80 floatx80_add( struct roundingData *roundData, floatx80 a, floatx80 b ) |
2898 | { | 2881 | { |
2899 | flag aSign, bSign; | 2882 | flag aSign, bSign; |
2900 | 2883 | ||
2901 | aSign = extractFloatx80Sign( a ); | 2884 | aSign = extractFloatx80Sign( a ); |
2902 | bSign = extractFloatx80Sign( b ); | 2885 | bSign = extractFloatx80Sign( b ); |
2903 | if ( aSign == bSign ) { | 2886 | if ( aSign == bSign ) { |
2904 | return addFloatx80Sigs( a, b, aSign ); | 2887 | return addFloatx80Sigs( roundData, a, b, aSign ); |
2905 | } | 2888 | } |
2906 | else { | 2889 | else { |
2907 | return subFloatx80Sigs( a, b, aSign ); | 2890 | return subFloatx80Sigs( roundData, a, b, aSign ); |
2908 | } | 2891 | } |
2909 | 2892 | ||
2910 | } | 2893 | } |
@@ -2916,17 +2899,17 @@ point values `a' and `b'. The operation is performed according to the | |||
2916 | IEC/IEEE Standard for Binary Floating-point Arithmetic. | 2899 | IEC/IEEE Standard for Binary Floating-point Arithmetic. |
2917 | ------------------------------------------------------------------------------- | 2900 | ------------------------------------------------------------------------------- |
2918 | */ | 2901 | */ |
2919 | floatx80 floatx80_sub( floatx80 a, floatx80 b ) | 2902 | floatx80 floatx80_sub( struct roundingData *roundData, floatx80 a, floatx80 b ) |
2920 | { | 2903 | { |
2921 | flag aSign, bSign; | 2904 | flag aSign, bSign; |
2922 | 2905 | ||
2923 | aSign = extractFloatx80Sign( a ); | 2906 | aSign = extractFloatx80Sign( a ); |
2924 | bSign = extractFloatx80Sign( b ); | 2907 | bSign = extractFloatx80Sign( b ); |
2925 | if ( aSign == bSign ) { | 2908 | if ( aSign == bSign ) { |
2926 | return subFloatx80Sigs( a, b, aSign ); | 2909 | return subFloatx80Sigs( roundData, a, b, aSign ); |
2927 | } | 2910 | } |
2928 | else { | 2911 | else { |
2929 | return addFloatx80Sigs( a, b, aSign ); | 2912 | return addFloatx80Sigs( roundData, a, b, aSign ); |
2930 | } | 2913 | } |
2931 | 2914 | ||
2932 | } | 2915 | } |
@@ -2938,7 +2921,7 @@ point values `a' and `b'. The operation is performed according to the | |||
2938 | IEC/IEEE Standard for Binary Floating-point Arithmetic. | 2921 | IEC/IEEE Standard for Binary Floating-point Arithmetic. |
2939 | ------------------------------------------------------------------------------- | 2922 | ------------------------------------------------------------------------------- |
2940 | */ | 2923 | */ |
2941 | floatx80 floatx80_mul( floatx80 a, floatx80 b ) | 2924 | floatx80 floatx80_mul( struct roundingData *roundData, floatx80 a, floatx80 b ) |
2942 | { | 2925 | { |
2943 | flag aSign, bSign, zSign; | 2926 | flag aSign, bSign, zSign; |
2944 | int32 aExp, bExp, zExp; | 2927 | int32 aExp, bExp, zExp; |
@@ -2964,7 +2947,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b ) | |||
2964 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); | 2947 | if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b ); |
2965 | if ( ( aExp | aSig ) == 0 ) { | 2948 | if ( ( aExp | aSig ) == 0 ) { |
2966 | invalid: | 2949 | invalid: |
2967 | float_raise( float_flag_invalid ); | 2950 | roundData->exception |= float_flag_invalid; |
2968 | z.low = floatx80_default_nan_low; | 2951 | z.low = floatx80_default_nan_low; |
2969 | z.high = floatx80_default_nan_high; | 2952 | z.high = floatx80_default_nan_high; |
2970 | return z; | 2953 | return z; |
@@ -2987,7 +2970,7 @@ floatx80 floatx80_mul( floatx80 a, floatx80 b ) | |||
2987 | } | 2970 | } |
2988 | return | 2971 | return |
2989 | roundAndPackFloatx80( | 2972 | roundAndPackFloatx80( |
2990 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | 2973 | roundData, zSign, zExp, zSig0, zSig1 ); |
2991 | 2974 | ||
2992 | } | 2975 | } |
2993 | 2976 | ||
@@ -2998,7 +2981,7 @@ value `a' by the corresponding value `b'. The operation is performed | |||
2998 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 2981 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
2999 | ------------------------------------------------------------------------------- | 2982 | ------------------------------------------------------------------------------- |
3000 | */ | 2983 | */ |
3001 | floatx80 floatx80_div( floatx80 a, floatx80 b ) | 2984 | floatx80 floatx80_div( struct roundingData *roundData, floatx80 a, floatx80 b ) |
3002 | { | 2985 | { |
3003 | flag aSign, bSign, zSign; | 2986 | flag aSign, bSign, zSign; |
3004 | int32 aExp, bExp, zExp; | 2987 | int32 aExp, bExp, zExp; |
@@ -3029,12 +3012,12 @@ floatx80 floatx80_div( floatx80 a, floatx80 b ) | |||
3029 | if ( bSig == 0 ) { | 3012 | if ( bSig == 0 ) { |
3030 | if ( ( aExp | aSig ) == 0 ) { | 3013 | if ( ( aExp | aSig ) == 0 ) { |
3031 | invalid: | 3014 | invalid: |
3032 | float_raise( float_flag_invalid ); | 3015 | roundData->exception |= float_flag_invalid; |
3033 | z.low = floatx80_default_nan_low; | 3016 | z.low = floatx80_default_nan_low; |
3034 | z.high = floatx80_default_nan_high; | 3017 | z.high = floatx80_default_nan_high; |
3035 | return z; | 3018 | return z; |
3036 | } | 3019 | } |
3037 | float_raise( float_flag_divbyzero ); | 3020 | roundData->exception |= float_flag_divbyzero; |
3038 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); | 3021 | return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) ); |
3039 | } | 3022 | } |
3040 | normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); | 3023 | normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); |
@@ -3068,7 +3051,7 @@ floatx80 floatx80_div( floatx80 a, floatx80 b ) | |||
3068 | } | 3051 | } |
3069 | return | 3052 | return |
3070 | roundAndPackFloatx80( | 3053 | roundAndPackFloatx80( |
3071 | floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 ); | 3054 | roundData, zSign, zExp, zSig0, zSig1 ); |
3072 | 3055 | ||
3073 | } | 3056 | } |
3074 | 3057 | ||
@@ -3079,7 +3062,7 @@ Returns the remainder of the extended double-precision floating-point value | |||
3079 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. | 3062 | according to the IEC/IEEE Standard for Binary Floating-point Arithmetic. |
3080 | ------------------------------------------------------------------------------- | 3063 | ------------------------------------------------------------------------------- |
3081 | */ | 3064 | */ |
3082 | floatx80 floatx80_rem( floatx80 a, floatx80 b ) | 3065 | floatx80 floatx80_rem( struct roundingData *roundData, floatx80 a, floatx80 b ) |
3083 | { | 3066 | { |
3084 | flag aSign, bSign, zSign; | 3067 | flag aSign, bSign, zSign; |
3085 | int32 aExp, bExp, expDiff; | 3068 | int32 aExp, bExp, expDiff; |
@@ -3107,7 +3090,7 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b ) | |||
3107 | if ( bExp == 0 ) { | 3090 | if ( bExp == 0 ) { |
3108 | if ( bSig == 0 ) { | 3091 | if ( bSig == 0 ) { |
3109 | invalid: | 3092 | invalid: |
3110 | float_raise( float_flag_invalid ); | 3093 | roundData->exception |= float_flag_invalid; |
3111 | z.low = floatx80_default_nan_low; | 3094 | z.low = floatx80_default_nan_low; |
3112 | z.high = floatx80_default_nan_high; | 3095 | z.high = floatx80_default_nan_high; |
3113 | return z; | 3096 | return z; |
@@ -3164,9 +3147,10 @@ floatx80 floatx80_rem( floatx80 a, floatx80 b ) | |||
3164 | aSig1 = alternateASig1; | 3147 | aSig1 = alternateASig1; |
3165 | zSign = ! zSign; | 3148 | zSign = ! zSign; |
3166 | } | 3149 | } |
3150 | |||
3167 | return | 3151 | return |
3168 | normalizeRoundAndPackFloatx80( | 3152 | normalizeRoundAndPackFloatx80( |
3169 | 80, zSign, bExp + expDiff, aSig0, aSig1 ); | 3153 | roundData, zSign, bExp + expDiff, aSig0, aSig1 ); |
3170 | 3154 | ||
3171 | } | 3155 | } |
3172 | 3156 | ||
@@ -3177,7 +3161,7 @@ value `a'. The operation is performed according to the IEC/IEEE Standard | |||
3177 | for Binary Floating-point Arithmetic. | 3161 | for Binary Floating-point Arithmetic. |
3178 | ------------------------------------------------------------------------------- | 3162 | ------------------------------------------------------------------------------- |
3179 | */ | 3163 | */ |
3180 | floatx80 floatx80_sqrt( floatx80 a ) | 3164 | floatx80 floatx80_sqrt( struct roundingData *roundData, floatx80 a ) |
3181 | { | 3165 | { |
3182 | flag aSign; | 3166 | flag aSign; |
3183 | int32 aExp, zExp; | 3167 | int32 aExp, zExp; |
@@ -3197,7 +3181,7 @@ floatx80 floatx80_sqrt( floatx80 a ) | |||
3197 | if ( aSign ) { | 3181 | if ( aSign ) { |
3198 | if ( ( aExp | aSig0 ) == 0 ) return a; | 3182 | if ( ( aExp | aSig0 ) == 0 ) return a; |
3199 | invalid: | 3183 | invalid: |
3200 | float_raise( float_flag_invalid ); | 3184 | roundData->exception |= float_flag_invalid; |
3201 | z.low = floatx80_default_nan_low; | 3185 | z.low = floatx80_default_nan_low; |
3202 | z.high = floatx80_default_nan_high; | 3186 | z.high = floatx80_default_nan_high; |
3203 | return z; | 3187 | return z; |
@@ -3242,7 +3226,7 @@ floatx80 floatx80_sqrt( floatx80 a ) | |||
3242 | } | 3226 | } |
3243 | return | 3227 | return |
3244 | roundAndPackFloatx80( | 3228 | roundAndPackFloatx80( |
3245 | floatx80_rounding_precision, 0, zExp, zSig0, zSig1 ); | 3229 | roundData, 0, zExp, zSig0, zSig1 ); |
3246 | 3230 | ||
3247 | } | 3231 | } |
3248 | 3232 | ||
@@ -3390,10 +3374,7 @@ flag floatx80_le_quiet( floatx80 a, floatx80 b ) | |||
3390 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3374 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3391 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3375 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3392 | ) { | 3376 | ) { |
3393 | if ( floatx80_is_signaling_nan( a ) | 3377 | /* Do nothing, even if NaN as we're quiet */ |
3394 | || floatx80_is_signaling_nan( b ) ) { | ||
3395 | float_raise( float_flag_invalid ); | ||
3396 | } | ||
3397 | return 0; | 3378 | return 0; |
3398 | } | 3379 | } |
3399 | aSign = extractFloatx80Sign( a ); | 3380 | aSign = extractFloatx80Sign( a ); |
@@ -3427,10 +3408,7 @@ flag floatx80_lt_quiet( floatx80 a, floatx80 b ) | |||
3427 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3408 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3428 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3409 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3429 | ) { | 3410 | ) { |
3430 | if ( floatx80_is_signaling_nan( a ) | 3411 | /* Do nothing, even if NaN as we're quiet */ |
3431 | || floatx80_is_signaling_nan( b ) ) { | ||
3432 | float_raise( float_flag_invalid ); | ||
3433 | } | ||
3434 | return 0; | 3412 | return 0; |
3435 | } | 3413 | } |
3436 | aSign = extractFloatx80Sign( a ); | 3414 | aSign = extractFloatx80Sign( a ); |
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h index 1e1743173899..1c8799b9ee4d 100644 --- a/arch/arm/nwfpe/softfloat.h +++ b/arch/arm/nwfpe/softfloat.h | |||
@@ -74,7 +74,7 @@ enum { | |||
74 | Software IEC/IEEE floating-point rounding mode. | 74 | Software IEC/IEEE floating-point rounding mode. |
75 | ------------------------------------------------------------------------------- | 75 | ------------------------------------------------------------------------------- |
76 | */ | 76 | */ |
77 | extern signed char float_rounding_mode; | 77 | //extern int8 float_rounding_mode; |
78 | enum { | 78 | enum { |
79 | float_round_nearest_even = 0, | 79 | float_round_nearest_even = 0, |
80 | float_round_to_zero = 1, | 80 | float_round_to_zero = 1, |
@@ -86,7 +86,6 @@ enum { | |||
86 | ------------------------------------------------------------------------------- | 86 | ------------------------------------------------------------------------------- |
87 | Software IEC/IEEE floating-point exception flags. | 87 | Software IEC/IEEE floating-point exception flags. |
88 | ------------------------------------------------------------------------------- | 88 | ------------------------------------------------------------------------------- |
89 | extern signed char float_exception_flags; | ||
90 | enum { | 89 | enum { |
91 | float_flag_inexact = 1, | 90 | float_flag_inexact = 1, |
92 | float_flag_underflow = 2, | 91 | float_flag_underflow = 2, |
@@ -99,7 +98,6 @@ ScottB: November 4, 1998 | |||
99 | Changed the enumeration to match the bit order in the FPA11. | 98 | Changed the enumeration to match the bit order in the FPA11. |
100 | */ | 99 | */ |
101 | 100 | ||
102 | extern signed char float_exception_flags; | ||
103 | enum { | 101 | enum { |
104 | float_flag_invalid = 1, | 102 | float_flag_invalid = 1, |
105 | float_flag_divbyzero = 2, | 103 | float_flag_divbyzero = 2, |
@@ -121,7 +119,7 @@ void float_raise( signed char ); | |||
121 | Software IEC/IEEE integer-to-floating-point conversion routines. | 119 | Software IEC/IEEE integer-to-floating-point conversion routines. |
122 | ------------------------------------------------------------------------------- | 120 | ------------------------------------------------------------------------------- |
123 | */ | 121 | */ |
124 | float32 int32_to_float32( signed int ); | 122 | float32 int32_to_float32( struct roundingData *, signed int ); |
125 | float64 int32_to_float64( signed int ); | 123 | float64 int32_to_float64( signed int ); |
126 | #ifdef FLOATX80 | 124 | #ifdef FLOATX80 |
127 | floatx80 int32_to_floatx80( signed int ); | 125 | floatx80 int32_to_floatx80( signed int ); |
@@ -132,7 +130,7 @@ floatx80 int32_to_floatx80( signed int ); | |||
132 | Software IEC/IEEE single-precision conversion routines. | 130 | Software IEC/IEEE single-precision conversion routines. |
133 | ------------------------------------------------------------------------------- | 131 | ------------------------------------------------------------------------------- |
134 | */ | 132 | */ |
135 | signed int float32_to_int32( float32 ); | 133 | signed int float32_to_int32( struct roundingData *, float32 ); |
136 | signed int float32_to_int32_round_to_zero( float32 ); | 134 | signed int float32_to_int32_round_to_zero( float32 ); |
137 | float64 float32_to_float64( float32 ); | 135 | float64 float32_to_float64( float32 ); |
138 | #ifdef FLOATX80 | 136 | #ifdef FLOATX80 |
@@ -144,13 +142,13 @@ floatx80 float32_to_floatx80( float32 ); | |||
144 | Software IEC/IEEE single-precision operations. | 142 | Software IEC/IEEE single-precision operations. |
145 | ------------------------------------------------------------------------------- | 143 | ------------------------------------------------------------------------------- |
146 | */ | 144 | */ |
147 | float32 float32_round_to_int( float32 ); | 145 | float32 float32_round_to_int( struct roundingData*, float32 ); |
148 | float32 float32_add( float32, float32 ); | 146 | float32 float32_add( struct roundingData *, float32, float32 ); |
149 | float32 float32_sub( float32, float32 ); | 147 | float32 float32_sub( struct roundingData *, float32, float32 ); |
150 | float32 float32_mul( float32, float32 ); | 148 | float32 float32_mul( struct roundingData *, float32, float32 ); |
151 | float32 float32_div( float32, float32 ); | 149 | float32 float32_div( struct roundingData *, float32, float32 ); |
152 | float32 float32_rem( float32, float32 ); | 150 | float32 float32_rem( struct roundingData *, float32, float32 ); |
153 | float32 float32_sqrt( float32 ); | 151 | float32 float32_sqrt( struct roundingData*, float32 ); |
154 | char float32_eq( float32, float32 ); | 152 | char float32_eq( float32, float32 ); |
155 | char float32_le( float32, float32 ); | 153 | char float32_le( float32, float32 ); |
156 | char float32_lt( float32, float32 ); | 154 | char float32_lt( float32, float32 ); |
@@ -164,9 +162,9 @@ char float32_is_signaling_nan( float32 ); | |||
164 | Software IEC/IEEE double-precision conversion routines. | 162 | Software IEC/IEEE double-precision conversion routines. |
165 | ------------------------------------------------------------------------------- | 163 | ------------------------------------------------------------------------------- |
166 | */ | 164 | */ |
167 | signed int float64_to_int32( float64 ); | 165 | signed int float64_to_int32( struct roundingData *, float64 ); |
168 | signed int float64_to_int32_round_to_zero( float64 ); | 166 | signed int float64_to_int32_round_to_zero( float64 ); |
169 | float32 float64_to_float32( float64 ); | 167 | float32 float64_to_float32( struct roundingData *, float64 ); |
170 | #ifdef FLOATX80 | 168 | #ifdef FLOATX80 |
171 | floatx80 float64_to_floatx80( float64 ); | 169 | floatx80 float64_to_floatx80( float64 ); |
172 | #endif | 170 | #endif |
@@ -176,13 +174,13 @@ floatx80 float64_to_floatx80( float64 ); | |||
176 | Software IEC/IEEE double-precision operations. | 174 | Software IEC/IEEE double-precision operations. |
177 | ------------------------------------------------------------------------------- | 175 | ------------------------------------------------------------------------------- |
178 | */ | 176 | */ |
179 | float64 float64_round_to_int( float64 ); | 177 | float64 float64_round_to_int( struct roundingData *, float64 ); |
180 | float64 float64_add( float64, float64 ); | 178 | float64 float64_add( struct roundingData *, float64, float64 ); |
181 | float64 float64_sub( float64, float64 ); | 179 | float64 float64_sub( struct roundingData *, float64, float64 ); |
182 | float64 float64_mul( float64, float64 ); | 180 | float64 float64_mul( struct roundingData *, float64, float64 ); |
183 | float64 float64_div( float64, float64 ); | 181 | float64 float64_div( struct roundingData *, float64, float64 ); |
184 | float64 float64_rem( float64, float64 ); | 182 | float64 float64_rem( struct roundingData *, float64, float64 ); |
185 | float64 float64_sqrt( float64 ); | 183 | float64 float64_sqrt( struct roundingData *, float64 ); |
186 | char float64_eq( float64, float64 ); | 184 | char float64_eq( float64, float64 ); |
187 | char float64_le( float64, float64 ); | 185 | char float64_le( float64, float64 ); |
188 | char float64_lt( float64, float64 ); | 186 | char float64_lt( float64, float64 ); |
@@ -198,31 +196,23 @@ char float64_is_signaling_nan( float64 ); | |||
198 | Software IEC/IEEE extended double-precision conversion routines. | 196 | Software IEC/IEEE extended double-precision conversion routines. |
199 | ------------------------------------------------------------------------------- | 197 | ------------------------------------------------------------------------------- |
200 | */ | 198 | */ |
201 | signed int floatx80_to_int32( floatx80 ); | 199 | signed int floatx80_to_int32( struct roundingData *, floatx80 ); |
202 | signed int floatx80_to_int32_round_to_zero( floatx80 ); | 200 | signed int floatx80_to_int32_round_to_zero( floatx80 ); |
203 | float32 floatx80_to_float32( floatx80 ); | 201 | float32 floatx80_to_float32( struct roundingData *, floatx80 ); |
204 | float64 floatx80_to_float64( floatx80 ); | 202 | float64 floatx80_to_float64( struct roundingData *, floatx80 ); |
205 | |||
206 | /* | ||
207 | ------------------------------------------------------------------------------- | ||
208 | Software IEC/IEEE extended double-precision rounding precision. Valid | ||
209 | values are 32, 64, and 80. | ||
210 | ------------------------------------------------------------------------------- | ||
211 | */ | ||
212 | extern signed char floatx80_rounding_precision; | ||
213 | 203 | ||
214 | /* | 204 | /* |
215 | ------------------------------------------------------------------------------- | 205 | ------------------------------------------------------------------------------- |
216 | Software IEC/IEEE extended double-precision operations. | 206 | Software IEC/IEEE extended double-precision operations. |
217 | ------------------------------------------------------------------------------- | 207 | ------------------------------------------------------------------------------- |
218 | */ | 208 | */ |
219 | floatx80 floatx80_round_to_int( floatx80 ); | 209 | floatx80 floatx80_round_to_int( struct roundingData *, floatx80 ); |
220 | floatx80 floatx80_add( floatx80, floatx80 ); | 210 | floatx80 floatx80_add( struct roundingData *, floatx80, floatx80 ); |
221 | floatx80 floatx80_sub( floatx80, floatx80 ); | 211 | floatx80 floatx80_sub( struct roundingData *, floatx80, floatx80 ); |
222 | floatx80 floatx80_mul( floatx80, floatx80 ); | 212 | floatx80 floatx80_mul( struct roundingData *, floatx80, floatx80 ); |
223 | floatx80 floatx80_div( floatx80, floatx80 ); | 213 | floatx80 floatx80_div( struct roundingData *, floatx80, floatx80 ); |
224 | floatx80 floatx80_rem( floatx80, floatx80 ); | 214 | floatx80 floatx80_rem( struct roundingData *, floatx80, floatx80 ); |
225 | floatx80 floatx80_sqrt( floatx80 ); | 215 | floatx80 floatx80_sqrt( struct roundingData *, floatx80 ); |
226 | char floatx80_eq( floatx80, floatx80 ); | 216 | char floatx80_eq( floatx80, floatx80 ); |
227 | char floatx80_le( floatx80, floatx80 ); | 217 | char floatx80_le( floatx80, floatx80 ); |
228 | char floatx80_lt( floatx80, floatx80 ); | 218 | char floatx80_lt( floatx80, floatx80 ); |
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c index ec58d3e2eb8b..df35c452a8bf 100644 --- a/arch/arm/oprofile/backtrace.c +++ b/arch/arm/oprofile/backtrace.c | |||
@@ -115,7 +115,7 @@ static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs) | |||
115 | return (tailaddr > stack) && (tailaddr < stack_base); | 115 | return (tailaddr > stack) && (tailaddr < stack_base); |
116 | } | 116 | } |
117 | 117 | ||
118 | void arm_backtrace(struct pt_regs const *regs, unsigned int depth) | 118 | void arm_backtrace(struct pt_regs * const regs, unsigned int depth) |
119 | { | 119 | { |
120 | struct frame_tail *tail; | 120 | struct frame_tail *tail; |
121 | unsigned long last_address = 0; | 121 | unsigned long last_address = 0; |
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c index b801cd66b6ea..9b367a65cb4d 100644 --- a/arch/arm/vfp/vfpdouble.c +++ b/arch/arm/vfp/vfpdouble.c | |||
@@ -770,6 +770,9 @@ vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn, | |||
770 | if ((s64)m_sig < 0) { | 770 | if ((s64)m_sig < 0) { |
771 | vdd->sign = vfp_sign_negate(vdd->sign); | 771 | vdd->sign = vfp_sign_negate(vdd->sign); |
772 | m_sig = -m_sig; | 772 | m_sig = -m_sig; |
773 | } else if (m_sig == 0) { | ||
774 | vdd->sign = (fpscr & FPSCR_RMODE_MASK) == | ||
775 | FPSCR_ROUND_MINUSINF ? 0x8000 : 0; | ||
773 | } | 776 | } |
774 | } else { | 777 | } else { |
775 | m_sig += vdn->significand; | 778 | m_sig += vdn->significand; |
diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c index dacca8bb7744..bd6f2db608b7 100644 --- a/arch/arm26/mm/fault.c +++ b/arch/arm26/mm/fault.c | |||
@@ -176,12 +176,12 @@ survive: | |||
176 | * Handle the "normal" cases first - successful and sigbus | 176 | * Handle the "normal" cases first - successful and sigbus |
177 | */ | 177 | */ |
178 | switch (fault) { | 178 | switch (fault) { |
179 | case 2: | 179 | case VM_FAULT_MAJOR: |
180 | tsk->maj_flt++; | 180 | tsk->maj_flt++; |
181 | return fault; | 181 | return fault; |
182 | case 1: | 182 | case VM_FAULT_MINOR: |
183 | tsk->min_flt++; | 183 | tsk->min_flt++; |
184 | case 0: | 184 | case VM_FAULT_SIGBUS: |
185 | return fault; | 185 | return fault; |
186 | } | 186 | } |
187 | 187 | ||
@@ -226,14 +226,11 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
226 | /* | 226 | /* |
227 | * Handle the "normal" case first | 227 | * Handle the "normal" case first |
228 | */ | 228 | */ |
229 | if (fault > 0) | 229 | switch (fault) { |
230 | case VM_FAULT_MINOR: | ||
231 | case VM_FAULT_MAJOR: | ||
230 | return 0; | 232 | return 0; |
231 | 233 | case VM_FAULT_SIGBUS: | |
232 | /* | ||
233 | * We had some memory, but were unable to | ||
234 | * successfully fix up this page fault. | ||
235 | */ | ||
236 | if (fault == 0){ | ||
237 | goto do_sigbus; | 234 | goto do_sigbus; |
238 | } | 235 | } |
239 | 236 | ||
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c index fe1cc36b5aca..934c51078cce 100644 --- a/arch/cris/mm/fault.c +++ b/arch/cris/mm/fault.c | |||
@@ -284,13 +284,13 @@ do_page_fault(unsigned long address, struct pt_regs *regs, | |||
284 | */ | 284 | */ |
285 | 285 | ||
286 | switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) { | 286 | switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) { |
287 | case 1: | 287 | case VM_FAULT_MINOR: |
288 | tsk->min_flt++; | 288 | tsk->min_flt++; |
289 | break; | 289 | break; |
290 | case 2: | 290 | case VM_FAULT_MAJOR: |
291 | tsk->maj_flt++; | 291 | tsk->maj_flt++; |
292 | break; | 292 | break; |
293 | case 0: | 293 | case VM_FAULT_SIGBUS: |
294 | goto do_sigbus; | 294 | goto do_sigbus; |
295 | default: | 295 | default: |
296 | goto out_of_memory; | 296 | goto out_of_memory; |
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c index 41d02ac48233..8b3eb50c5105 100644 --- a/arch/frv/mm/fault.c +++ b/arch/frv/mm/fault.c | |||
@@ -163,13 +163,13 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear | |||
163 | * the fault. | 163 | * the fault. |
164 | */ | 164 | */ |
165 | switch (handle_mm_fault(mm, vma, ear0, write)) { | 165 | switch (handle_mm_fault(mm, vma, ear0, write)) { |
166 | case 1: | 166 | case VM_FAULT_MINOR: |
167 | current->min_flt++; | 167 | current->min_flt++; |
168 | break; | 168 | break; |
169 | case 2: | 169 | case VM_FAULT_MAJOR: |
170 | current->maj_flt++; | 170 | current->maj_flt++; |
171 | break; | 171 | break; |
172 | case 0: | 172 | case VM_FAULT_SIGBUS: |
173 | goto do_sigbus; | 173 | goto do_sigbus; |
174 | default: | 174 | default: |
175 | goto out_of_memory; | 175 | goto out_of_memory; |
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index a801d9d48606..619d843ba231 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -454,8 +454,9 @@ config HPET_TIMER | |||
454 | Choose N to continue using the legacy 8254 timer. | 454 | Choose N to continue using the legacy 8254 timer. |
455 | 455 | ||
456 | config HPET_EMULATE_RTC | 456 | config HPET_EMULATE_RTC |
457 | bool "Provide RTC interrupt" | 457 | bool |
458 | depends on HPET_TIMER && RTC=y | 458 | depends on HPET_TIMER && RTC=y |
459 | default y | ||
459 | 460 | ||
460 | config SMP | 461 | config SMP |
461 | bool "Symmetric multi-processing support" | 462 | bool "Symmetric multi-processing support" |
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index bd1dbf3bd223..a22a866de8f9 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -726,15 +726,11 @@ __setup("apic=", apic_set_verbosity); | |||
726 | static int __init detect_init_APIC (void) | 726 | static int __init detect_init_APIC (void) |
727 | { | 727 | { |
728 | u32 h, l, features; | 728 | u32 h, l, features; |
729 | extern void get_cpu_vendor(struct cpuinfo_x86*); | ||
730 | 729 | ||
731 | /* Disabled by kernel option? */ | 730 | /* Disabled by kernel option? */ |
732 | if (enable_local_apic < 0) | 731 | if (enable_local_apic < 0) |
733 | return -1; | 732 | return -1; |
734 | 733 | ||
735 | /* Workaround for us being called before identify_cpu(). */ | ||
736 | get_cpu_vendor(&boot_cpu_data); | ||
737 | |||
738 | switch (boot_cpu_data.x86_vendor) { | 734 | switch (boot_cpu_data.x86_vendor) { |
739 | case X86_VENDOR_AMD: | 735 | case X86_VENDOR_AMD: |
740 | if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) || | 736 | if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) || |
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index 963e17aa205d..60a9e54dd20e 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -442,6 +442,13 @@ acpi_cpufreq_cpu_init ( | |||
442 | (u32) data->acpi_data.states[i].transition_latency); | 442 | (u32) data->acpi_data.states[i].transition_latency); |
443 | 443 | ||
444 | cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); | 444 | cpufreq_frequency_table_get_attr(data->freq_table, policy->cpu); |
445 | |||
446 | /* | ||
447 | * the first call to ->target() should result in us actually | ||
448 | * writing something to the appropriate registers. | ||
449 | */ | ||
450 | data->resume = 1; | ||
451 | |||
445 | return (result); | 452 | return (result); |
446 | 453 | ||
447 | err_freqfree: | 454 | err_freqfree: |
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/i386/kernel/cpu/transmeta.c index f57e5ee94943..fc426380366b 100644 --- a/arch/i386/kernel/cpu/transmeta.c +++ b/arch/i386/kernel/cpu/transmeta.c | |||
@@ -76,6 +76,12 @@ static void __init init_transmeta(struct cpuinfo_x86 *c) | |||
76 | #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV) | 76 | #define USER686 (X86_FEATURE_TSC|X86_FEATURE_CX8|X86_FEATURE_CMOV) |
77 | if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 ) | 77 | if ( c->x86 == 5 && (c->x86_capability[0] & USER686) == USER686 ) |
78 | c->x86 = 6; | 78 | c->x86 = 6; |
79 | |||
80 | #ifdef CONFIG_SYSCTL | ||
81 | /* randomize_va_space slows us down enormously; | ||
82 | it probably triggers retranslation of x86->native bytecode */ | ||
83 | randomize_va_space = 0; | ||
84 | #endif | ||
79 | } | 85 | } |
80 | 86 | ||
81 | static void transmeta_identify(struct cpuinfo_x86 * c) | 87 | static void transmeta_identify(struct cpuinfo_x86 * c) |
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index da6c46d667cb..8c242bb1ef45 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -195,7 +195,7 @@ static void disable_lapic_nmi_watchdog(void) | |||
195 | wrmsr(MSR_P6_EVNTSEL0, 0, 0); | 195 | wrmsr(MSR_P6_EVNTSEL0, 0, 0); |
196 | break; | 196 | break; |
197 | case 15: | 197 | case 15: |
198 | if (boot_cpu_data.x86_model > 0x3) | 198 | if (boot_cpu_data.x86_model > 0x4) |
199 | break; | 199 | break; |
200 | 200 | ||
201 | wrmsr(MSR_P4_IQ_CCCR0, 0, 0); | 201 | wrmsr(MSR_P4_IQ_CCCR0, 0, 0); |
@@ -432,7 +432,7 @@ void setup_apic_nmi_watchdog (void) | |||
432 | setup_p6_watchdog(); | 432 | setup_p6_watchdog(); |
433 | break; | 433 | break; |
434 | case 15: | 434 | case 15: |
435 | if (boot_cpu_data.x86_model > 0x3) | 435 | if (boot_cpu_data.x86_model > 0x4) |
436 | return; | 436 | return; |
437 | 437 | ||
438 | if (!setup_p4_watchdog()) | 438 | if (!setup_p4_watchdog()) |
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index 468500a7e894..9b21a31d4f4e 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S | |||
@@ -251,7 +251,7 @@ ENTRY(sys_call_table) | |||
251 | .long sys_io_submit | 251 | .long sys_io_submit |
252 | .long sys_io_cancel | 252 | .long sys_io_cancel |
253 | .long sys_fadvise64 /* 250 */ | 253 | .long sys_fadvise64 /* 250 */ |
254 | .long sys_set_zone_reclaim | 254 | .long sys_ni_syscall |
255 | .long sys_exit_group | 255 | .long sys_exit_group |
256 | .long sys_lookup_dcookie | 256 | .long sys_lookup_dcookie |
257 | .long sys_epoll_create | 257 | .long sys_epoll_create |
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index a61f33d06ea3..cd2d5d5514fe 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -803,15 +803,17 @@ void math_error(void __user *eip) | |||
803 | */ | 803 | */ |
804 | cwd = get_fpu_cwd(task); | 804 | cwd = get_fpu_cwd(task); |
805 | swd = get_fpu_swd(task); | 805 | swd = get_fpu_swd(task); |
806 | switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) { | 806 | switch (swd & ~cwd & 0x3f) { |
807 | case 0x000: | 807 | case 0x000: |
808 | default: | 808 | default: |
809 | break; | 809 | break; |
810 | case 0x001: /* Invalid Op */ | 810 | case 0x001: /* Invalid Op */ |
811 | case 0x041: /* Stack Fault */ | 811 | /* |
812 | case 0x241: /* Stack Fault | Direction */ | 812 | * swd & 0x240 == 0x040: Stack Underflow |
813 | * swd & 0x240 == 0x240: Stack Overflow | ||
814 | * User must clear the SF bit (0x40) if set | ||
815 | */ | ||
813 | info.si_code = FPE_FLTINV; | 816 | info.si_code = FPE_FLTINV; |
814 | /* Should we clear the SF or let user space do it ???? */ | ||
815 | break; | 817 | break; |
816 | case 0x002: /* Denormalize */ | 818 | case 0x002: /* Denormalize */ |
817 | case 0x010: /* Underflow */ | 819 | case 0x010: /* Underflow */ |
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c index 9e9296676f93..5d73e042ed0a 100644 --- a/arch/i386/mach-visws/reboot.c +++ b/arch/i386/mach-visws/reboot.c | |||
@@ -9,12 +9,15 @@ | |||
9 | void (*pm_power_off)(void); | 9 | void (*pm_power_off)(void); |
10 | EXPORT_SYMBOL(pm_power_off); | 10 | EXPORT_SYMBOL(pm_power_off); |
11 | 11 | ||
12 | void machine_restart(char * __unused) | 12 | void machine_shutdown(void) |
13 | { | 13 | { |
14 | #ifdef CONFIG_SMP | 14 | #ifdef CONFIG_SMP |
15 | smp_send_stop(); | 15 | smp_send_stop(); |
16 | #endif | 16 | #endif |
17 | } | ||
17 | 18 | ||
19 | void machine_emergency_restart(void) | ||
20 | { | ||
18 | /* | 21 | /* |
19 | * Visual Workstations restart after this | 22 | * Visual Workstations restart after this |
20 | * register is poked on the PIIX4 | 23 | * register is poked on the PIIX4 |
@@ -22,6 +25,12 @@ void machine_restart(char * __unused) | |||
22 | outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); | 25 | outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); |
23 | } | 26 | } |
24 | 27 | ||
28 | void machine_restart(char * __unused) | ||
29 | { | ||
30 | machine_shutdown(); | ||
31 | machine_emergency_restart(); | ||
32 | } | ||
33 | |||
25 | void machine_power_off(void) | 34 | void machine_power_off(void) |
26 | { | 35 | { |
27 | unsigned short pm_status; | 36 | unsigned short pm_status; |
diff --git a/arch/i386/mach-visws/setup.c b/arch/i386/mach-visws/setup.c index 9f6d2d9b1be7..26ada6fc0d77 100644 --- a/arch/i386/mach-visws/setup.c +++ b/arch/i386/mach-visws/setup.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include "cobalt.h" | 14 | #include "cobalt.h" |
15 | #include "piix4.h" | 15 | #include "piix4.h" |
16 | 16 | ||
17 | int no_broadcast; | ||
18 | |||
17 | char visws_board_type = -1; | 19 | char visws_board_type = -1; |
18 | char visws_board_rev = -1; | 20 | char visws_board_rev = -1; |
19 | 21 | ||
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c index b3eda46e0fe9..c6384061328a 100644 --- a/arch/i386/mach-voyager/voyager_basic.c +++ b/arch/i386/mach-voyager/voyager_basic.c | |||
@@ -252,6 +252,12 @@ kb_wait(void) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | void | 254 | void |
255 | machine_shutdown(void) | ||
256 | { | ||
257 | /* Architecture specific shutdown needed before a kexec */ | ||
258 | } | ||
259 | |||
260 | void | ||
255 | machine_restart(char *cmd) | 261 | machine_restart(char *cmd) |
256 | { | 262 | { |
257 | printk("Voyager Warm Restart\n"); | 263 | printk("Voyager Warm Restart\n"); |
@@ -279,6 +285,13 @@ machine_restart(char *cmd) | |||
279 | } | 285 | } |
280 | 286 | ||
281 | void | 287 | void |
288 | machine_emergency_restart(void) | ||
289 | { | ||
290 | /*for now, just hook this to a warm restart */ | ||
291 | machine_restart(NULL); | ||
292 | } | ||
293 | |||
294 | void | ||
282 | mca_nmi_hook(void) | 295 | mca_nmi_hook(void) |
283 | { | 296 | { |
284 | __u8 dumpval __attribute__((unused)) = inb(0xf823); | 297 | __u8 dumpval __attribute__((unused)) = inb(0xf823); |
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index c369a8bf7cbe..6711ce3f6916 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void) | |||
243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ | 243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ |
244 | size = size * PTRS_PER_PTE; | 244 | size = size * PTRS_PER_PTE; |
245 | 245 | ||
246 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
247 | /* | ||
248 | * Adjust size if node_end_pfn is not on a proper | ||
249 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
250 | */ | ||
251 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
252 | } | ||
253 | |||
254 | /* | 246 | /* |
255 | * Validate the region we are allocating only contains valid | 247 | * Validate the region we are allocating only contains valid |
256 | * pages. | 248 | * pages. |
@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void) | |||
270 | reserve_pages += size; | 262 | reserve_pages += size; |
271 | printk("Shrinking node %d from %ld pages to %ld pages\n", | 263 | printk("Shrinking node %d from %ld pages to %ld pages\n", |
272 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); | 264 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); |
265 | |||
266 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
267 | /* | ||
268 | * Align node_end_pfn[] and node_remap_start_pfn[] to | ||
269 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
270 | */ | ||
271 | printk("Shrinking node %d further by %ld pages for proper alignment\n", | ||
272 | nid, node_end_pfn[nid] & (PTRS_PER_PTE-1)); | ||
273 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
274 | } | ||
275 | |||
273 | node_end_pfn[nid] -= size; | 276 | node_end_pfn[nid] -= size; |
274 | node_remap_start_pfn[nid] = node_end_pfn[nid]; | 277 | node_remap_start_pfn[nid] = node_end_pfn[nid]; |
275 | } | 278 | } |
diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c index 2db65ec45dc3..42913f43feb0 100644 --- a/arch/i386/pci/acpi.c +++ b/arch/i386/pci/acpi.c | |||
@@ -30,6 +30,7 @@ static int __init pci_acpi_init(void) | |||
30 | acpi_irq_penalty_init(); | 30 | acpi_irq_penalty_init(); |
31 | pcibios_scanned++; | 31 | pcibios_scanned++; |
32 | pcibios_enable_irq = acpi_pci_irq_enable; | 32 | pcibios_enable_irq = acpi_pci_irq_enable; |
33 | pcibios_disable_irq = acpi_pci_irq_disable; | ||
33 | 34 | ||
34 | if (pci_routeirq) { | 35 | if (pci_routeirq) { |
35 | /* | 36 | /* |
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 70bcd53451f6..ade5bc57c34c 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -254,3 +254,9 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
254 | 254 | ||
255 | return pcibios_enable_irq(dev); | 255 | return pcibios_enable_irq(dev); |
256 | } | 256 | } |
257 | |||
258 | void pcibios_disable_device (struct pci_dev *dev) | ||
259 | { | ||
260 | if (pcibios_disable_irq) | ||
261 | pcibios_disable_irq(dev); | ||
262 | } | ||
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index d291fb7f1357..86348b68fda1 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -56,6 +56,7 @@ struct irq_router_handler { | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL; | 58 | int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL; |
59 | void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * Check passed address for the PCI IRQ Routing Table signature | 62 | * Check passed address for the PCI IRQ Routing Table signature |
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index a80f0f55ff51..127d53ad16be 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
@@ -73,3 +73,4 @@ extern int pcibios_scanned; | |||
73 | extern spinlock_t pci_config_lock; | 73 | extern spinlock_t pci_config_lock; |
74 | 74 | ||
75 | extern int (*pcibios_enable_irq)(struct pci_dev *dev); | 75 | extern int (*pcibios_enable_irq)(struct pci_dev *dev); |
76 | extern void (*pcibios_disable_irq)(struct pci_dev *dev); | ||
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c index 314c933b6b8e..6c17433fdf7d 100644 --- a/arch/i386/pci/visws.c +++ b/arch/i386/pci/visws.c | |||
@@ -18,8 +18,10 @@ | |||
18 | extern struct pci_raw_ops pci_direct_conf1; | 18 | extern struct pci_raw_ops pci_direct_conf1; |
19 | 19 | ||
20 | static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } | 20 | static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } |
21 | static void pci_visws_disable_irq(struct pci_dev *dev) { } | ||
21 | 22 | ||
22 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; | 23 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; |
24 | void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; | ||
23 | 25 | ||
24 | void __init pcibios_penalize_isa_irq(int irq, int active) {} | 26 | void __init pcibios_penalize_isa_irq(int irq, int active) {} |
25 | 27 | ||
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index cbb3e0cef93a..80988136f26d 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -392,15 +392,8 @@ menu "Bus options (PCI, PCMCIA)" | |||
392 | config PCI | 392 | config PCI |
393 | bool "PCI support" | 393 | bool "PCI support" |
394 | help | 394 | help |
395 | Find out whether you have a PCI motherboard. PCI is the name of a | 395 | Real IA-64 machines all have PCI/PCI-X/PCI Express busses. Say Y |
396 | bus system, i.e. the way the CPU talks to the other stuff inside | 396 | here unless you are using a simulator without PCI support. |
397 | your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or | ||
398 | VESA. If you have PCI, say Y, otherwise N. | ||
399 | |||
400 | The PCI-HOWTO, available from | ||
401 | <http://www.tldp.org/docs.html#howto>, contains valuable | ||
402 | information about which PCI hardware does work under Linux and which | ||
403 | doesn't. | ||
404 | 397 | ||
405 | config PCI_DOMAINS | 398 | config PCI_DOMAINS |
406 | bool | 399 | bool |
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig index 04d0b00a2b8c..dccf35c60b94 100644 --- a/arch/ia64/configs/sn2_defconfig +++ b/arch/ia64/configs/sn2_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.10 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Mon Jan 10 13:57:35 2005 | 4 | # Tue Aug 16 14:40:41 2005 |
5 | # | 5 | # |
6 | 6 | ||
7 | # | 7 | # |
@@ -10,6 +10,7 @@ | |||
10 | CONFIG_EXPERIMENTAL=y | 10 | CONFIG_EXPERIMENTAL=y |
11 | CONFIG_CLEAN_COMPILE=y | 11 | CONFIG_CLEAN_COMPILE=y |
12 | CONFIG_LOCK_KERNEL=y | 12 | CONFIG_LOCK_KERNEL=y |
13 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
13 | 14 | ||
14 | # | 15 | # |
15 | # General setup | 16 | # General setup |
@@ -21,24 +22,26 @@ CONFIG_POSIX_MQUEUE=y | |||
21 | # CONFIG_BSD_PROCESS_ACCT is not set | 22 | # CONFIG_BSD_PROCESS_ACCT is not set |
22 | CONFIG_SYSCTL=y | 23 | CONFIG_SYSCTL=y |
23 | # CONFIG_AUDIT is not set | 24 | # CONFIG_AUDIT is not set |
24 | CONFIG_LOG_BUF_SHIFT=20 | ||
25 | CONFIG_HOTPLUG=y | 25 | CONFIG_HOTPLUG=y |
26 | CONFIG_KOBJECT_UEVENT=y | 26 | CONFIG_KOBJECT_UEVENT=y |
27 | # CONFIG_IKCONFIG is not set | 27 | # CONFIG_IKCONFIG is not set |
28 | CONFIG_CPUSETS=y | ||
28 | # CONFIG_EMBEDDED is not set | 29 | # CONFIG_EMBEDDED is not set |
29 | CONFIG_KALLSYMS=y | 30 | CONFIG_KALLSYMS=y |
30 | CONFIG_KALLSYMS_ALL=y | 31 | CONFIG_KALLSYMS_ALL=y |
31 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 32 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
33 | CONFIG_PRINTK=y | ||
34 | CONFIG_BUG=y | ||
35 | CONFIG_BASE_FULL=y | ||
32 | CONFIG_FUTEX=y | 36 | CONFIG_FUTEX=y |
33 | CONFIG_EPOLL=y | 37 | CONFIG_EPOLL=y |
34 | CONFIG_CPUSETS=y | ||
35 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
36 | CONFIG_SHMEM=y | 38 | CONFIG_SHMEM=y |
37 | CONFIG_CC_ALIGN_FUNCTIONS=0 | 39 | CONFIG_CC_ALIGN_FUNCTIONS=0 |
38 | CONFIG_CC_ALIGN_LABELS=0 | 40 | CONFIG_CC_ALIGN_LABELS=0 |
39 | CONFIG_CC_ALIGN_LOOPS=0 | 41 | CONFIG_CC_ALIGN_LOOPS=0 |
40 | CONFIG_CC_ALIGN_JUMPS=0 | 42 | CONFIG_CC_ALIGN_JUMPS=0 |
41 | # CONFIG_TINY_SHMEM is not set | 43 | # CONFIG_TINY_SHMEM is not set |
44 | CONFIG_BASE_SMALL=0 | ||
42 | 45 | ||
43 | # | 46 | # |
44 | # Loadable module support | 47 | # Loadable module support |
@@ -63,9 +66,12 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y | |||
63 | CONFIG_TIME_INTERPOLATION=y | 66 | CONFIG_TIME_INTERPOLATION=y |
64 | CONFIG_EFI=y | 67 | CONFIG_EFI=y |
65 | CONFIG_GENERIC_IOMAP=y | 68 | CONFIG_GENERIC_IOMAP=y |
69 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | ||
70 | CONFIG_IA64_UNCACHED_ALLOCATOR=y | ||
66 | # CONFIG_IA64_GENERIC is not set | 71 | # CONFIG_IA64_GENERIC is not set |
67 | # CONFIG_IA64_DIG is not set | 72 | # CONFIG_IA64_DIG is not set |
68 | # CONFIG_IA64_HP_ZX1 is not set | 73 | # CONFIG_IA64_HP_ZX1 is not set |
74 | # CONFIG_IA64_HP_ZX1_SWIOTLB is not set | ||
69 | CONFIG_IA64_SGI_SN2=y | 75 | CONFIG_IA64_SGI_SN2=y |
70 | # CONFIG_IA64_HP_SIM is not set | 76 | # CONFIG_IA64_HP_SIM is not set |
71 | # CONFIG_ITANIUM is not set | 77 | # CONFIG_ITANIUM is not set |
@@ -74,6 +80,10 @@ CONFIG_MCKINLEY=y | |||
74 | # CONFIG_IA64_PAGE_SIZE_8KB is not set | 80 | # CONFIG_IA64_PAGE_SIZE_8KB is not set |
75 | CONFIG_IA64_PAGE_SIZE_16KB=y | 81 | CONFIG_IA64_PAGE_SIZE_16KB=y |
76 | # CONFIG_IA64_PAGE_SIZE_64KB is not set | 82 | # CONFIG_IA64_PAGE_SIZE_64KB is not set |
83 | # CONFIG_HZ_100 is not set | ||
84 | CONFIG_HZ_250=y | ||
85 | # CONFIG_HZ_1000 is not set | ||
86 | CONFIG_HZ=250 | ||
77 | CONFIG_IA64_L1_CACHE_SHIFT=7 | 87 | CONFIG_IA64_L1_CACHE_SHIFT=7 |
78 | CONFIG_NUMA=y | 88 | CONFIG_NUMA=y |
79 | CONFIG_VIRTUAL_MEM_MAP=y | 89 | CONFIG_VIRTUAL_MEM_MAP=y |
@@ -81,11 +91,20 @@ CONFIG_HOLES_IN_ZONE=y | |||
81 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y | 91 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y |
82 | # CONFIG_IA64_CYCLONE is not set | 92 | # CONFIG_IA64_CYCLONE is not set |
83 | CONFIG_IOSAPIC=y | 93 | CONFIG_IOSAPIC=y |
94 | CONFIG_IA64_SGI_SN_XP=m | ||
84 | CONFIG_FORCE_MAX_ZONEORDER=18 | 95 | CONFIG_FORCE_MAX_ZONEORDER=18 |
85 | CONFIG_SMP=y | 96 | CONFIG_SMP=y |
86 | CONFIG_NR_CPUS=512 | 97 | CONFIG_NR_CPUS=512 |
87 | # CONFIG_HOTPLUG_CPU is not set | 98 | # CONFIG_HOTPLUG_CPU is not set |
99 | CONFIG_SCHED_SMT=y | ||
88 | CONFIG_PREEMPT=y | 100 | CONFIG_PREEMPT=y |
101 | CONFIG_SELECT_MEMORY_MODEL=y | ||
102 | # CONFIG_FLATMEM_MANUAL is not set | ||
103 | CONFIG_DISCONTIGMEM_MANUAL=y | ||
104 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
105 | CONFIG_DISCONTIGMEM=y | ||
106 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
107 | CONFIG_NEED_MULTIPLE_NODES=y | ||
89 | CONFIG_HAVE_DEC_LOCK=y | 108 | CONFIG_HAVE_DEC_LOCK=y |
90 | CONFIG_IA32_SUPPORT=y | 109 | CONFIG_IA32_SUPPORT=y |
91 | CONFIG_COMPAT=y | 110 | CONFIG_COMPAT=y |
@@ -105,6 +124,7 @@ CONFIG_BINFMT_ELF=y | |||
105 | # | 124 | # |
106 | # Power management and ACPI | 125 | # Power management and ACPI |
107 | # | 126 | # |
127 | CONFIG_PM=y | ||
108 | CONFIG_ACPI=y | 128 | CONFIG_ACPI=y |
109 | 129 | ||
110 | # | 130 | # |
@@ -114,6 +134,7 @@ CONFIG_ACPI_BOOT=y | |||
114 | CONFIG_ACPI_INTERPRETER=y | 134 | CONFIG_ACPI_INTERPRETER=y |
115 | # CONFIG_ACPI_BUTTON is not set | 135 | # CONFIG_ACPI_BUTTON is not set |
116 | CONFIG_ACPI_VIDEO=m | 136 | CONFIG_ACPI_VIDEO=m |
137 | CONFIG_ACPI_HOTKEY=m | ||
117 | # CONFIG_ACPI_FAN is not set | 138 | # CONFIG_ACPI_FAN is not set |
118 | # CONFIG_ACPI_PROCESSOR is not set | 139 | # CONFIG_ACPI_PROCESSOR is not set |
119 | CONFIG_ACPI_NUMA=y | 140 | CONFIG_ACPI_NUMA=y |
@@ -133,6 +154,7 @@ CONFIG_PCI_DOMAINS=y | |||
133 | # CONFIG_PCI_MSI is not set | 154 | # CONFIG_PCI_MSI is not set |
134 | CONFIG_PCI_LEGACY_PROC=y | 155 | CONFIG_PCI_LEGACY_PROC=y |
135 | CONFIG_PCI_NAMES=y | 156 | CONFIG_PCI_NAMES=y |
157 | # CONFIG_PCI_DEBUG is not set | ||
136 | 158 | ||
137 | # | 159 | # |
138 | # PCI Hotplug Support | 160 | # PCI Hotplug Support |
@@ -141,7 +163,6 @@ CONFIG_HOTPLUG_PCI=y | |||
141 | # CONFIG_HOTPLUG_PCI_FAKE is not set | 163 | # CONFIG_HOTPLUG_PCI_FAKE is not set |
142 | # CONFIG_HOTPLUG_PCI_ACPI is not set | 164 | # CONFIG_HOTPLUG_PCI_ACPI is not set |
143 | # CONFIG_HOTPLUG_PCI_CPCI is not set | 165 | # CONFIG_HOTPLUG_PCI_CPCI is not set |
144 | # CONFIG_HOTPLUG_PCI_PCIE is not set | ||
145 | # CONFIG_HOTPLUG_PCI_SHPC is not set | 166 | # CONFIG_HOTPLUG_PCI_SHPC is not set |
146 | CONFIG_HOTPLUG_PCI_SGI=y | 167 | CONFIG_HOTPLUG_PCI_SGI=y |
147 | 168 | ||
@@ -151,8 +172,70 @@ CONFIG_HOTPLUG_PCI_SGI=y | |||
151 | # CONFIG_PCCARD is not set | 172 | # CONFIG_PCCARD is not set |
152 | 173 | ||
153 | # | 174 | # |
154 | # PC-card bridges | 175 | # Networking |
176 | # | ||
177 | CONFIG_NET=y | ||
178 | |||
179 | # | ||
180 | # Networking options | ||
181 | # | ||
182 | CONFIG_PACKET=y | ||
183 | CONFIG_PACKET_MMAP=y | ||
184 | CONFIG_UNIX=y | ||
185 | # CONFIG_NET_KEY is not set | ||
186 | CONFIG_INET=y | ||
187 | CONFIG_IP_MULTICAST=y | ||
188 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
189 | CONFIG_IP_FIB_HASH=y | ||
190 | # CONFIG_IP_PNP is not set | ||
191 | # CONFIG_NET_IPIP is not set | ||
192 | # CONFIG_NET_IPGRE is not set | ||
193 | # CONFIG_IP_MROUTE is not set | ||
194 | # CONFIG_ARPD is not set | ||
195 | CONFIG_SYN_COOKIES=y | ||
196 | # CONFIG_INET_AH is not set | ||
197 | # CONFIG_INET_ESP is not set | ||
198 | # CONFIG_INET_IPCOMP is not set | ||
199 | # CONFIG_INET_TUNNEL is not set | ||
200 | CONFIG_IP_TCPDIAG=y | ||
201 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
202 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
203 | CONFIG_TCP_CONG_BIC=y | ||
204 | CONFIG_IPV6=m | ||
205 | # CONFIG_IPV6_PRIVACY is not set | ||
206 | # CONFIG_INET6_AH is not set | ||
207 | # CONFIG_INET6_ESP is not set | ||
208 | # CONFIG_INET6_IPCOMP is not set | ||
209 | # CONFIG_INET6_TUNNEL is not set | ||
210 | # CONFIG_IPV6_TUNNEL is not set | ||
211 | # CONFIG_NETFILTER is not set | ||
212 | |||
213 | # | ||
214 | # SCTP Configuration (EXPERIMENTAL) | ||
215 | # | ||
216 | # CONFIG_IP_SCTP is not set | ||
217 | # CONFIG_ATM is not set | ||
218 | # CONFIG_BRIDGE is not set | ||
219 | # CONFIG_VLAN_8021Q is not set | ||
220 | # CONFIG_DECNET is not set | ||
221 | # CONFIG_LLC2 is not set | ||
222 | # CONFIG_IPX is not set | ||
223 | # CONFIG_ATALK is not set | ||
224 | # CONFIG_X25 is not set | ||
225 | # CONFIG_LAPB is not set | ||
226 | # CONFIG_NET_DIVERT is not set | ||
227 | # CONFIG_ECONET is not set | ||
228 | # CONFIG_WAN_ROUTER is not set | ||
229 | # CONFIG_NET_SCHED is not set | ||
230 | # CONFIG_NET_CLS_ROUTE is not set | ||
231 | |||
232 | # | ||
233 | # Network testing | ||
155 | # | 234 | # |
235 | # CONFIG_NET_PKTGEN is not set | ||
236 | # CONFIG_HAMRADIO is not set | ||
237 | # CONFIG_IRDA is not set | ||
238 | # CONFIG_BT is not set | ||
156 | 239 | ||
157 | # | 240 | # |
158 | # Device Drivers | 241 | # Device Drivers |
@@ -163,7 +246,7 @@ CONFIG_HOTPLUG_PCI_SGI=y | |||
163 | # | 246 | # |
164 | CONFIG_STANDALONE=y | 247 | CONFIG_STANDALONE=y |
165 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 248 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
166 | CONFIG_FW_LOADER=m | 249 | CONFIG_FW_LOADER=y |
167 | # CONFIG_DEBUG_DRIVER is not set | 250 | # CONFIG_DEBUG_DRIVER is not set |
168 | 251 | ||
169 | # | 252 | # |
@@ -188,6 +271,7 @@ CONFIG_FW_LOADER=m | |||
188 | # CONFIG_BLK_CPQ_CISS_DA is not set | 271 | # CONFIG_BLK_CPQ_CISS_DA is not set |
189 | # CONFIG_BLK_DEV_DAC960 is not set | 272 | # CONFIG_BLK_DEV_DAC960 is not set |
190 | # CONFIG_BLK_DEV_UMEM is not set | 273 | # CONFIG_BLK_DEV_UMEM is not set |
274 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
191 | CONFIG_BLK_DEV_LOOP=y | 275 | CONFIG_BLK_DEV_LOOP=y |
192 | CONFIG_BLK_DEV_CRYPTOLOOP=m | 276 | CONFIG_BLK_DEV_CRYPTOLOOP=m |
193 | CONFIG_BLK_DEV_NBD=m | 277 | CONFIG_BLK_DEV_NBD=m |
@@ -252,6 +336,7 @@ CONFIG_IDEDMA_PCI_AUTO=y | |||
252 | # CONFIG_BLK_DEV_HPT366 is not set | 336 | # CONFIG_BLK_DEV_HPT366 is not set |
253 | # CONFIG_BLK_DEV_SC1200 is not set | 337 | # CONFIG_BLK_DEV_SC1200 is not set |
254 | # CONFIG_BLK_DEV_PIIX is not set | 338 | # CONFIG_BLK_DEV_PIIX is not set |
339 | # CONFIG_BLK_DEV_IT821X is not set | ||
255 | # CONFIG_BLK_DEV_NS87415 is not set | 340 | # CONFIG_BLK_DEV_NS87415 is not set |
256 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | 341 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set |
257 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | 342 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set |
@@ -282,6 +367,7 @@ CONFIG_CHR_DEV_ST=m | |||
282 | CONFIG_BLK_DEV_SR=m | 367 | CONFIG_BLK_DEV_SR=m |
283 | # CONFIG_BLK_DEV_SR_VENDOR is not set | 368 | # CONFIG_BLK_DEV_SR_VENDOR is not set |
284 | CONFIG_CHR_DEV_SG=m | 369 | CONFIG_CHR_DEV_SG=m |
370 | CONFIG_CHR_DEV_SCH=m | ||
285 | 371 | ||
286 | # | 372 | # |
287 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | 373 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs |
@@ -315,24 +401,20 @@ CONFIG_SCSI_SATA=y | |||
315 | # CONFIG_SCSI_ATA_PIIX is not set | 401 | # CONFIG_SCSI_ATA_PIIX is not set |
316 | # CONFIG_SCSI_SATA_NV is not set | 402 | # CONFIG_SCSI_SATA_NV is not set |
317 | # CONFIG_SCSI_SATA_PROMISE is not set | 403 | # CONFIG_SCSI_SATA_PROMISE is not set |
404 | # CONFIG_SCSI_SATA_QSTOR is not set | ||
318 | # CONFIG_SCSI_SATA_SX4 is not set | 405 | # CONFIG_SCSI_SATA_SX4 is not set |
319 | # CONFIG_SCSI_SATA_SIL is not set | 406 | # CONFIG_SCSI_SATA_SIL is not set |
320 | # CONFIG_SCSI_SATA_SIS is not set | 407 | # CONFIG_SCSI_SATA_SIS is not set |
321 | # CONFIG_SCSI_SATA_ULI is not set | 408 | # CONFIG_SCSI_SATA_ULI is not set |
322 | # CONFIG_SCSI_SATA_VIA is not set | 409 | # CONFIG_SCSI_SATA_VIA is not set |
323 | CONFIG_SCSI_SATA_VITESSE=y | 410 | CONFIG_SCSI_SATA_VITESSE=y |
324 | # CONFIG_SCSI_BUSLOGIC is not set | ||
325 | # CONFIG_SCSI_DMX3191D is not set | 411 | # CONFIG_SCSI_DMX3191D is not set |
326 | # CONFIG_SCSI_EATA is not set | ||
327 | # CONFIG_SCSI_EATA_PIO is not set | ||
328 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | 412 | # CONFIG_SCSI_FUTURE_DOMAIN is not set |
329 | # CONFIG_SCSI_GDTH is not set | ||
330 | # CONFIG_SCSI_IPS is not set | 413 | # CONFIG_SCSI_IPS is not set |
331 | # CONFIG_SCSI_INITIO is not set | 414 | # CONFIG_SCSI_INITIO is not set |
332 | # CONFIG_SCSI_INIA100 is not set | 415 | # CONFIG_SCSI_INIA100 is not set |
333 | # CONFIG_SCSI_SYM53C8XX_2 is not set | 416 | # CONFIG_SCSI_SYM53C8XX_2 is not set |
334 | # CONFIG_SCSI_IPR is not set | 417 | # CONFIG_SCSI_IPR is not set |
335 | # CONFIG_SCSI_QLOGIC_ISP is not set | ||
336 | # CONFIG_SCSI_QLOGIC_FC is not set | 418 | # CONFIG_SCSI_QLOGIC_FC is not set |
337 | CONFIG_SCSI_QLOGIC_1280=y | 419 | CONFIG_SCSI_QLOGIC_1280=y |
338 | # CONFIG_SCSI_QLOGIC_1280_1040 is not set | 420 | # CONFIG_SCSI_QLOGIC_1280_1040 is not set |
@@ -342,6 +424,8 @@ CONFIG_SCSI_QLA22XX=y | |||
342 | CONFIG_SCSI_QLA2300=y | 424 | CONFIG_SCSI_QLA2300=y |
343 | CONFIG_SCSI_QLA2322=y | 425 | CONFIG_SCSI_QLA2322=y |
344 | # CONFIG_SCSI_QLA6312 is not set | 426 | # CONFIG_SCSI_QLA6312 is not set |
427 | # CONFIG_SCSI_QLA24XX is not set | ||
428 | # CONFIG_SCSI_LPFC is not set | ||
345 | # CONFIG_SCSI_DC395x is not set | 429 | # CONFIG_SCSI_DC395x is not set |
346 | # CONFIG_SCSI_DC390T is not set | 430 | # CONFIG_SCSI_DC390T is not set |
347 | # CONFIG_SCSI_DEBUG is not set | 431 | # CONFIG_SCSI_DEBUG is not set |
@@ -364,11 +448,15 @@ CONFIG_DM_CRYPT=m | |||
364 | CONFIG_DM_SNAPSHOT=m | 448 | CONFIG_DM_SNAPSHOT=m |
365 | CONFIG_DM_MIRROR=m | 449 | CONFIG_DM_MIRROR=m |
366 | CONFIG_DM_ZERO=m | 450 | CONFIG_DM_ZERO=m |
451 | CONFIG_DM_MULTIPATH=m | ||
452 | CONFIG_DM_MULTIPATH_EMC=m | ||
367 | 453 | ||
368 | # | 454 | # |
369 | # Fusion MPT device support | 455 | # Fusion MPT device support |
370 | # | 456 | # |
371 | CONFIG_FUSION=y | 457 | CONFIG_FUSION=y |
458 | CONFIG_FUSION_SPI=y | ||
459 | CONFIG_FUSION_FC=y | ||
372 | CONFIG_FUSION_MAX_SGE=128 | 460 | CONFIG_FUSION_MAX_SGE=128 |
373 | CONFIG_FUSION_CTL=m | 461 | CONFIG_FUSION_CTL=m |
374 | 462 | ||
@@ -383,82 +471,13 @@ CONFIG_FUSION_CTL=m | |||
383 | # CONFIG_I2O is not set | 471 | # CONFIG_I2O is not set |
384 | 472 | ||
385 | # | 473 | # |
386 | # Networking support | 474 | # Network device support |
387 | # | ||
388 | CONFIG_NET=y | ||
389 | |||
390 | # | ||
391 | # Networking options | ||
392 | # | ||
393 | CONFIG_PACKET=y | ||
394 | CONFIG_PACKET_MMAP=y | ||
395 | CONFIG_NETLINK_DEV=y | ||
396 | CONFIG_UNIX=y | ||
397 | # CONFIG_NET_KEY is not set | ||
398 | CONFIG_INET=y | ||
399 | CONFIG_IP_MULTICAST=y | ||
400 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
401 | # CONFIG_IP_PNP is not set | ||
402 | # CONFIG_NET_IPIP is not set | ||
403 | # CONFIG_NET_IPGRE is not set | ||
404 | # CONFIG_IP_MROUTE is not set | ||
405 | # CONFIG_ARPD is not set | ||
406 | CONFIG_SYN_COOKIES=y | ||
407 | # CONFIG_INET_AH is not set | ||
408 | # CONFIG_INET_ESP is not set | ||
409 | # CONFIG_INET_IPCOMP is not set | ||
410 | # CONFIG_INET_TUNNEL is not set | ||
411 | CONFIG_IP_TCPDIAG=y | ||
412 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
413 | CONFIG_IPV6=m | ||
414 | # CONFIG_IPV6_PRIVACY is not set | ||
415 | # CONFIG_INET6_AH is not set | ||
416 | # CONFIG_INET6_ESP is not set | ||
417 | # CONFIG_INET6_IPCOMP is not set | ||
418 | # CONFIG_INET6_TUNNEL is not set | ||
419 | # CONFIG_IPV6_TUNNEL is not set | ||
420 | # CONFIG_NETFILTER is not set | ||
421 | |||
422 | # | ||
423 | # SCTP Configuration (EXPERIMENTAL) | ||
424 | # | ||
425 | # CONFIG_IP_SCTP is not set | ||
426 | # CONFIG_ATM is not set | ||
427 | # CONFIG_BRIDGE is not set | ||
428 | # CONFIG_VLAN_8021Q is not set | ||
429 | # CONFIG_DECNET is not set | ||
430 | # CONFIG_LLC2 is not set | ||
431 | # CONFIG_IPX is not set | ||
432 | # CONFIG_ATALK is not set | ||
433 | # CONFIG_X25 is not set | ||
434 | # CONFIG_LAPB is not set | ||
435 | # CONFIG_NET_DIVERT is not set | ||
436 | # CONFIG_ECONET is not set | ||
437 | # CONFIG_WAN_ROUTER is not set | ||
438 | |||
439 | # | ||
440 | # QoS and/or fair queueing | ||
441 | # | ||
442 | # CONFIG_NET_SCHED is not set | ||
443 | # CONFIG_NET_CLS_ROUTE is not set | ||
444 | |||
445 | # | ||
446 | # Network testing | ||
447 | # | 475 | # |
448 | # CONFIG_NET_PKTGEN is not set | ||
449 | CONFIG_NETPOLL=y | ||
450 | # CONFIG_NETPOLL_RX is not set | ||
451 | # CONFIG_NETPOLL_TRAP is not set | ||
452 | CONFIG_NET_POLL_CONTROLLER=y | ||
453 | # CONFIG_HAMRADIO is not set | ||
454 | # CONFIG_IRDA is not set | ||
455 | # CONFIG_BT is not set | ||
456 | CONFIG_NETDEVICES=y | 476 | CONFIG_NETDEVICES=y |
457 | # CONFIG_DUMMY is not set | 477 | # CONFIG_DUMMY is not set |
458 | # CONFIG_BONDING is not set | 478 | # CONFIG_BONDING is not set |
459 | # CONFIG_EQUALIZER is not set | 479 | # CONFIG_EQUALIZER is not set |
460 | # CONFIG_TUN is not set | 480 | # CONFIG_TUN is not set |
461 | # CONFIG_ETHERTAP is not set | ||
462 | 481 | ||
463 | # | 482 | # |
464 | # ARCnet devices | 483 | # ARCnet devices |
@@ -480,8 +499,10 @@ CONFIG_NETDEVICES=y | |||
480 | # CONFIG_HAMACHI is not set | 499 | # CONFIG_HAMACHI is not set |
481 | # CONFIG_YELLOWFIN is not set | 500 | # CONFIG_YELLOWFIN is not set |
482 | # CONFIG_R8169 is not set | 501 | # CONFIG_R8169 is not set |
502 | # CONFIG_SKGE is not set | ||
483 | # CONFIG_SK98LIN is not set | 503 | # CONFIG_SK98LIN is not set |
484 | CONFIG_TIGON3=y | 504 | CONFIG_TIGON3=y |
505 | # CONFIG_BNX2 is not set | ||
485 | 506 | ||
486 | # | 507 | # |
487 | # Ethernet (10000 Mbit) | 508 | # Ethernet (10000 Mbit) |
@@ -512,6 +533,10 @@ CONFIG_S2IO=m | |||
512 | # CONFIG_NET_FC is not set | 533 | # CONFIG_NET_FC is not set |
513 | # CONFIG_SHAPER is not set | 534 | # CONFIG_SHAPER is not set |
514 | CONFIG_NETCONSOLE=y | 535 | CONFIG_NETCONSOLE=y |
536 | CONFIG_NETPOLL=y | ||
537 | # CONFIG_NETPOLL_RX is not set | ||
538 | # CONFIG_NETPOLL_TRAP is not set | ||
539 | CONFIG_NET_POLL_CONTROLLER=y | ||
515 | 540 | ||
516 | # | 541 | # |
517 | # ISDN subsystem | 542 | # ISDN subsystem |
@@ -541,14 +566,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | |||
541 | # CONFIG_INPUT_EVBUG is not set | 566 | # CONFIG_INPUT_EVBUG is not set |
542 | 567 | ||
543 | # | 568 | # |
544 | # Input I/O drivers | ||
545 | # | ||
546 | # CONFIG_GAMEPORT is not set | ||
547 | CONFIG_SOUND_GAMEPORT=y | ||
548 | # CONFIG_SERIO is not set | ||
549 | # CONFIG_SERIO_I8042 is not set | ||
550 | |||
551 | # | ||
552 | # Input Device Drivers | 569 | # Input Device Drivers |
553 | # | 570 | # |
554 | # CONFIG_INPUT_KEYBOARD is not set | 571 | # CONFIG_INPUT_KEYBOARD is not set |
@@ -558,6 +575,12 @@ CONFIG_SOUND_GAMEPORT=y | |||
558 | # CONFIG_INPUT_MISC is not set | 575 | # CONFIG_INPUT_MISC is not set |
559 | 576 | ||
560 | # | 577 | # |
578 | # Hardware I/O ports | ||
579 | # | ||
580 | # CONFIG_SERIO is not set | ||
581 | # CONFIG_GAMEPORT is not set | ||
582 | |||
583 | # | ||
561 | # Character devices | 584 | # Character devices |
562 | # | 585 | # |
563 | CONFIG_VT=y | 586 | CONFIG_VT=y |
@@ -568,9 +591,10 @@ CONFIG_SERIAL_NONSTANDARD=y | |||
568 | # CONFIG_CYCLADES is not set | 591 | # CONFIG_CYCLADES is not set |
569 | # CONFIG_MOXA_SMARTIO is not set | 592 | # CONFIG_MOXA_SMARTIO is not set |
570 | # CONFIG_ISI is not set | 593 | # CONFIG_ISI is not set |
571 | # CONFIG_SYNCLINK is not set | ||
572 | # CONFIG_SYNCLINKMP is not set | 594 | # CONFIG_SYNCLINKMP is not set |
573 | # CONFIG_N_HDLC is not set | 595 | # CONFIG_N_HDLC is not set |
596 | # CONFIG_SPECIALIX is not set | ||
597 | # CONFIG_SX is not set | ||
574 | # CONFIG_STALDRV is not set | 598 | # CONFIG_STALDRV is not set |
575 | CONFIG_SGI_SNSC=y | 599 | CONFIG_SGI_SNSC=y |
576 | CONFIG_SGI_TIOCX=y | 600 | CONFIG_SGI_TIOCX=y |
@@ -587,6 +611,7 @@ CONFIG_SGI_MBCS=m | |||
587 | CONFIG_SERIAL_CORE=y | 611 | CONFIG_SERIAL_CORE=y |
588 | CONFIG_SERIAL_CORE_CONSOLE=y | 612 | CONFIG_SERIAL_CORE_CONSOLE=y |
589 | CONFIG_SERIAL_SGI_L1_CONSOLE=y | 613 | CONFIG_SERIAL_SGI_L1_CONSOLE=y |
614 | # CONFIG_SERIAL_JSM is not set | ||
590 | CONFIG_SERIAL_SGI_IOC4=y | 615 | CONFIG_SERIAL_SGI_IOC4=y |
591 | CONFIG_UNIX98_PTYS=y | 616 | CONFIG_UNIX98_PTYS=y |
592 | CONFIG_LEGACY_PTYS=y | 617 | CONFIG_LEGACY_PTYS=y |
@@ -615,12 +640,19 @@ CONFIG_EFI_RTC=y | |||
615 | CONFIG_RAW_DRIVER=m | 640 | CONFIG_RAW_DRIVER=m |
616 | # CONFIG_HPET is not set | 641 | # CONFIG_HPET is not set |
617 | CONFIG_MAX_RAW_DEVS=256 | 642 | CONFIG_MAX_RAW_DEVS=256 |
643 | # CONFIG_HANGCHECK_TIMER is not set | ||
618 | CONFIG_MMTIMER=y | 644 | CONFIG_MMTIMER=y |
619 | 645 | ||
620 | # | 646 | # |
647 | # TPM devices | ||
648 | # | ||
649 | # CONFIG_TCG_TPM is not set | ||
650 | |||
651 | # | ||
621 | # I2C support | 652 | # I2C support |
622 | # | 653 | # |
623 | # CONFIG_I2C is not set | 654 | # CONFIG_I2C is not set |
655 | # CONFIG_I2C_SENSOR is not set | ||
624 | 656 | ||
625 | # | 657 | # |
626 | # Dallas's 1-wire bus | 658 | # Dallas's 1-wire bus |
@@ -628,6 +660,11 @@ CONFIG_MMTIMER=y | |||
628 | # CONFIG_W1 is not set | 660 | # CONFIG_W1 is not set |
629 | 661 | ||
630 | # | 662 | # |
663 | # Hardware Monitoring support | ||
664 | # | ||
665 | # CONFIG_HWMON is not set | ||
666 | |||
667 | # | ||
631 | # Misc devices | 668 | # Misc devices |
632 | # | 669 | # |
633 | 670 | ||
@@ -660,6 +697,8 @@ CONFIG_DUMMY_CONSOLE=y | |||
660 | # | 697 | # |
661 | # USB support | 698 | # USB support |
662 | # | 699 | # |
700 | CONFIG_USB_ARCH_HAS_HCD=y | ||
701 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
663 | CONFIG_USB=m | 702 | CONFIG_USB=m |
664 | # CONFIG_USB_DEBUG is not set | 703 | # CONFIG_USB_DEBUG is not set |
665 | 704 | ||
@@ -669,9 +708,8 @@ CONFIG_USB=m | |||
669 | # CONFIG_USB_DEVICEFS is not set | 708 | # CONFIG_USB_DEVICEFS is not set |
670 | # CONFIG_USB_BANDWIDTH is not set | 709 | # CONFIG_USB_BANDWIDTH is not set |
671 | # CONFIG_USB_DYNAMIC_MINORS is not set | 710 | # CONFIG_USB_DYNAMIC_MINORS is not set |
711 | # CONFIG_USB_SUSPEND is not set | ||
672 | # CONFIG_USB_OTG is not set | 712 | # CONFIG_USB_OTG is not set |
673 | CONFIG_USB_ARCH_HAS_HCD=y | ||
674 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
675 | 713 | ||
676 | # | 714 | # |
677 | # USB Host Controller Drivers | 715 | # USB Host Controller Drivers |
@@ -679,7 +717,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y | |||
679 | CONFIG_USB_EHCI_HCD=m | 717 | CONFIG_USB_EHCI_HCD=m |
680 | # CONFIG_USB_EHCI_SPLIT_ISO is not set | 718 | # CONFIG_USB_EHCI_SPLIT_ISO is not set |
681 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set | 719 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set |
720 | # CONFIG_USB_ISP116X_HCD is not set | ||
682 | CONFIG_USB_OHCI_HCD=m | 721 | CONFIG_USB_OHCI_HCD=m |
722 | # CONFIG_USB_OHCI_BIG_ENDIAN is not set | ||
723 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y | ||
683 | CONFIG_USB_UHCI_HCD=m | 724 | CONFIG_USB_UHCI_HCD=m |
684 | # CONFIG_USB_SL811_HCD is not set | 725 | # CONFIG_USB_SL811_HCD is not set |
685 | 726 | ||
@@ -710,12 +751,15 @@ CONFIG_USB_HIDINPUT=y | |||
710 | # CONFIG_USB_MOUSE is not set | 751 | # CONFIG_USB_MOUSE is not set |
711 | # CONFIG_USB_AIPTEK is not set | 752 | # CONFIG_USB_AIPTEK is not set |
712 | # CONFIG_USB_WACOM is not set | 753 | # CONFIG_USB_WACOM is not set |
754 | # CONFIG_USB_ACECAD is not set | ||
713 | # CONFIG_USB_KBTAB is not set | 755 | # CONFIG_USB_KBTAB is not set |
714 | # CONFIG_USB_POWERMATE is not set | 756 | # CONFIG_USB_POWERMATE is not set |
715 | # CONFIG_USB_MTOUCH is not set | 757 | # CONFIG_USB_MTOUCH is not set |
758 | # CONFIG_USB_ITMTOUCH is not set | ||
716 | # CONFIG_USB_EGALAX is not set | 759 | # CONFIG_USB_EGALAX is not set |
717 | # CONFIG_USB_XPAD is not set | 760 | # CONFIG_USB_XPAD is not set |
718 | # CONFIG_USB_ATI_REMOTE is not set | 761 | # CONFIG_USB_ATI_REMOTE is not set |
762 | # CONFIG_USB_KEYSPAN_REMOTE is not set | ||
719 | 763 | ||
720 | # | 764 | # |
721 | # USB Imaging devices | 765 | # USB Imaging devices |
@@ -740,6 +784,7 @@ CONFIG_USB_HIDINPUT=y | |||
740 | # CONFIG_USB_PEGASUS is not set | 784 | # CONFIG_USB_PEGASUS is not set |
741 | # CONFIG_USB_RTL8150 is not set | 785 | # CONFIG_USB_RTL8150 is not set |
742 | # CONFIG_USB_USBNET is not set | 786 | # CONFIG_USB_USBNET is not set |
787 | CONFIG_USB_MON=y | ||
743 | 788 | ||
744 | # | 789 | # |
745 | # USB port drivers | 790 | # USB port drivers |
@@ -763,9 +808,12 @@ CONFIG_USB_HIDINPUT=y | |||
763 | # CONFIG_USB_CYTHERM is not set | 808 | # CONFIG_USB_CYTHERM is not set |
764 | # CONFIG_USB_PHIDGETKIT is not set | 809 | # CONFIG_USB_PHIDGETKIT is not set |
765 | # CONFIG_USB_PHIDGETSERVO is not set | 810 | # CONFIG_USB_PHIDGETSERVO is not set |
811 | # CONFIG_USB_IDMOUSE is not set | ||
812 | # CONFIG_USB_SISUSBVGA is not set | ||
813 | # CONFIG_USB_LD is not set | ||
766 | 814 | ||
767 | # | 815 | # |
768 | # USB ATM/DSL drivers | 816 | # USB DSL modem support |
769 | # | 817 | # |
770 | 818 | ||
771 | # | 819 | # |
@@ -782,6 +830,7 @@ CONFIG_USB_HIDINPUT=y | |||
782 | # InfiniBand support | 830 | # InfiniBand support |
783 | # | 831 | # |
784 | CONFIG_INFINIBAND=m | 832 | CONFIG_INFINIBAND=m |
833 | CONFIG_INFINIBAND_USER_VERBS=m | ||
785 | CONFIG_INFINIBAND_MTHCA=m | 834 | CONFIG_INFINIBAND_MTHCA=m |
786 | # CONFIG_INFINIBAND_MTHCA_DEBUG is not set | 835 | # CONFIG_INFINIBAND_MTHCA_DEBUG is not set |
787 | CONFIG_INFINIBAND_IPOIB=m | 836 | CONFIG_INFINIBAND_IPOIB=m |
@@ -799,6 +848,7 @@ CONFIG_EXT2_FS=y | |||
799 | CONFIG_EXT2_FS_XATTR=y | 848 | CONFIG_EXT2_FS_XATTR=y |
800 | CONFIG_EXT2_FS_POSIX_ACL=y | 849 | CONFIG_EXT2_FS_POSIX_ACL=y |
801 | CONFIG_EXT2_FS_SECURITY=y | 850 | CONFIG_EXT2_FS_SECURITY=y |
851 | # CONFIG_EXT2_FS_XIP is not set | ||
802 | CONFIG_EXT3_FS=y | 852 | CONFIG_EXT3_FS=y |
803 | CONFIG_EXT3_FS_XATTR=y | 853 | CONFIG_EXT3_FS_XATTR=y |
804 | CONFIG_EXT3_FS_POSIX_ACL=y | 854 | CONFIG_EXT3_FS_POSIX_ACL=y |
@@ -814,13 +864,19 @@ CONFIG_REISERFS_FS_POSIX_ACL=y | |||
814 | CONFIG_REISERFS_FS_SECURITY=y | 864 | CONFIG_REISERFS_FS_SECURITY=y |
815 | # CONFIG_JFS_FS is not set | 865 | # CONFIG_JFS_FS is not set |
816 | CONFIG_FS_POSIX_ACL=y | 866 | CONFIG_FS_POSIX_ACL=y |
867 | |||
868 | # | ||
869 | # XFS support | ||
870 | # | ||
817 | CONFIG_XFS_FS=y | 871 | CONFIG_XFS_FS=y |
872 | CONFIG_XFS_EXPORT=y | ||
818 | CONFIG_XFS_RT=y | 873 | CONFIG_XFS_RT=y |
819 | CONFIG_XFS_QUOTA=y | 874 | CONFIG_XFS_QUOTA=y |
820 | # CONFIG_XFS_SECURITY is not set | 875 | # CONFIG_XFS_SECURITY is not set |
821 | CONFIG_XFS_POSIX_ACL=y | 876 | CONFIG_XFS_POSIX_ACL=y |
822 | # CONFIG_MINIX_FS is not set | 877 | # CONFIG_MINIX_FS is not set |
823 | # CONFIG_ROMFS_FS is not set | 878 | # CONFIG_ROMFS_FS is not set |
879 | CONFIG_INOTIFY=y | ||
824 | CONFIG_QUOTA=y | 880 | CONFIG_QUOTA=y |
825 | # CONFIG_QFMT_V1 is not set | 881 | # CONFIG_QFMT_V1 is not set |
826 | # CONFIG_QFMT_V2 is not set | 882 | # CONFIG_QFMT_V2 is not set |
@@ -854,7 +910,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | |||
854 | CONFIG_PROC_FS=y | 910 | CONFIG_PROC_FS=y |
855 | CONFIG_PROC_KCORE=y | 911 | CONFIG_PROC_KCORE=y |
856 | CONFIG_SYSFS=y | 912 | CONFIG_SYSFS=y |
857 | # CONFIG_DEVFS_FS is not set | ||
858 | # CONFIG_DEVPTS_FS_XATTR is not set | 913 | # CONFIG_DEVPTS_FS_XATTR is not set |
859 | CONFIG_TMPFS=y | 914 | CONFIG_TMPFS=y |
860 | CONFIG_TMPFS_XATTR=y | 915 | CONFIG_TMPFS_XATTR=y |
@@ -885,15 +940,18 @@ CONFIG_RAMFS=y | |||
885 | # | 940 | # |
886 | CONFIG_NFS_FS=m | 941 | CONFIG_NFS_FS=m |
887 | CONFIG_NFS_V3=y | 942 | CONFIG_NFS_V3=y |
943 | # CONFIG_NFS_V3_ACL is not set | ||
888 | CONFIG_NFS_V4=y | 944 | CONFIG_NFS_V4=y |
889 | CONFIG_NFS_DIRECTIO=y | 945 | CONFIG_NFS_DIRECTIO=y |
890 | CONFIG_NFSD=m | 946 | CONFIG_NFSD=m |
891 | CONFIG_NFSD_V3=y | 947 | CONFIG_NFSD_V3=y |
948 | # CONFIG_NFSD_V3_ACL is not set | ||
892 | CONFIG_NFSD_V4=y | 949 | CONFIG_NFSD_V4=y |
893 | CONFIG_NFSD_TCP=y | 950 | CONFIG_NFSD_TCP=y |
894 | CONFIG_LOCKD=m | 951 | CONFIG_LOCKD=m |
895 | CONFIG_LOCKD_V4=y | 952 | CONFIG_LOCKD_V4=y |
896 | CONFIG_EXPORTFS=m | 953 | CONFIG_EXPORTFS=y |
954 | CONFIG_NFS_COMMON=y | ||
897 | CONFIG_SUNRPC=m | 955 | CONFIG_SUNRPC=m |
898 | CONFIG_SUNRPC_GSS=m | 956 | CONFIG_SUNRPC_GSS=m |
899 | CONFIG_RPCSEC_GSS_KRB5=m | 957 | CONFIG_RPCSEC_GSS_KRB5=m |
@@ -980,6 +1038,9 @@ CONFIG_CRC32=y | |||
980 | # CONFIG_LIBCRC32C is not set | 1038 | # CONFIG_LIBCRC32C is not set |
981 | CONFIG_ZLIB_INFLATE=m | 1039 | CONFIG_ZLIB_INFLATE=m |
982 | CONFIG_ZLIB_DEFLATE=m | 1040 | CONFIG_ZLIB_DEFLATE=m |
1041 | CONFIG_GENERIC_ALLOCATOR=y | ||
1042 | CONFIG_GENERIC_HARDIRQS=y | ||
1043 | CONFIG_GENERIC_IRQ_PROBE=y | ||
983 | 1044 | ||
984 | # | 1045 | # |
985 | # Profiling support | 1046 | # Profiling support |
@@ -989,15 +1050,19 @@ CONFIG_ZLIB_DEFLATE=m | |||
989 | # | 1050 | # |
990 | # Kernel hacking | 1051 | # Kernel hacking |
991 | # | 1052 | # |
1053 | # CONFIG_PRINTK_TIME is not set | ||
992 | CONFIG_DEBUG_KERNEL=y | 1054 | CONFIG_DEBUG_KERNEL=y |
993 | CONFIG_MAGIC_SYSRQ=y | 1055 | CONFIG_MAGIC_SYSRQ=y |
1056 | CONFIG_LOG_BUF_SHIFT=20 | ||
994 | # CONFIG_SCHEDSTATS is not set | 1057 | # CONFIG_SCHEDSTATS is not set |
995 | # CONFIG_DEBUG_SLAB is not set | 1058 | # CONFIG_DEBUG_SLAB is not set |
1059 | CONFIG_DEBUG_PREEMPT=y | ||
996 | # CONFIG_DEBUG_SPINLOCK is not set | 1060 | # CONFIG_DEBUG_SPINLOCK is not set |
997 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1061 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
998 | # CONFIG_DEBUG_KOBJECT is not set | 1062 | # CONFIG_DEBUG_KOBJECT is not set |
999 | CONFIG_DEBUG_INFO=y | 1063 | CONFIG_DEBUG_INFO=y |
1000 | # CONFIG_DEBUG_FS is not set | 1064 | # CONFIG_DEBUG_FS is not set |
1065 | # CONFIG_KPROBES is not set | ||
1001 | CONFIG_IA64_GRANULE_16MB=y | 1066 | CONFIG_IA64_GRANULE_16MB=y |
1002 | # CONFIG_IA64_GRANULE_64MB is not set | 1067 | # CONFIG_IA64_GRANULE_64MB is not set |
1003 | # CONFIG_IA64_PRINT_HAZARDS is not set | 1068 | # CONFIG_IA64_PRINT_HAZARDS is not set |
@@ -1019,11 +1084,12 @@ CONFIG_CRYPTO=y | |||
1019 | CONFIG_CRYPTO_HMAC=y | 1084 | CONFIG_CRYPTO_HMAC=y |
1020 | # CONFIG_CRYPTO_NULL is not set | 1085 | # CONFIG_CRYPTO_NULL is not set |
1021 | # CONFIG_CRYPTO_MD4 is not set | 1086 | # CONFIG_CRYPTO_MD4 is not set |
1022 | CONFIG_CRYPTO_MD5=m | 1087 | CONFIG_CRYPTO_MD5=y |
1023 | CONFIG_CRYPTO_SHA1=m | 1088 | CONFIG_CRYPTO_SHA1=m |
1024 | # CONFIG_CRYPTO_SHA256 is not set | 1089 | # CONFIG_CRYPTO_SHA256 is not set |
1025 | # CONFIG_CRYPTO_SHA512 is not set | 1090 | # CONFIG_CRYPTO_SHA512 is not set |
1026 | # CONFIG_CRYPTO_WP512 is not set | 1091 | # CONFIG_CRYPTO_WP512 is not set |
1092 | # CONFIG_CRYPTO_TGR192 is not set | ||
1027 | CONFIG_CRYPTO_DES=m | 1093 | CONFIG_CRYPTO_DES=m |
1028 | # CONFIG_CRYPTO_BLOWFISH is not set | 1094 | # CONFIG_CRYPTO_BLOWFISH is not set |
1029 | # CONFIG_CRYPTO_TWOFISH is not set | 1095 | # CONFIG_CRYPTO_TWOFISH is not set |
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig index 73454eee26f1..c853cfcd2d11 100644 --- a/arch/ia64/configs/tiger_defconfig +++ b/arch/ia64/configs/tiger_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc1-20050629 | 3 | # Linux kernel version: 2.6.13-rc6-tiger-smp |
4 | # Wed Jun 29 15:28:12 2005 | 4 | # Wed Aug 17 10:19:51 2005 |
5 | # | 5 | # |
6 | 6 | ||
7 | # | 7 | # |
@@ -132,6 +132,7 @@ CONFIG_ACPI_BOOT=y | |||
132 | CONFIG_ACPI_INTERPRETER=y | 132 | CONFIG_ACPI_INTERPRETER=y |
133 | CONFIG_ACPI_BUTTON=m | 133 | CONFIG_ACPI_BUTTON=m |
134 | # CONFIG_ACPI_VIDEO is not set | 134 | # CONFIG_ACPI_VIDEO is not set |
135 | # CONFIG_ACPI_HOTKEY is not set | ||
135 | CONFIG_ACPI_FAN=m | 136 | CONFIG_ACPI_FAN=m |
136 | CONFIG_ACPI_PROCESSOR=m | 137 | CONFIG_ACPI_PROCESSOR=m |
137 | # CONFIG_ACPI_HOTPLUG_CPU is not set | 138 | # CONFIG_ACPI_HOTPLUG_CPU is not set |
@@ -170,6 +171,66 @@ CONFIG_HOTPLUG_PCI_ACPI=m | |||
170 | # CONFIG_PCCARD is not set | 171 | # CONFIG_PCCARD is not set |
171 | 172 | ||
172 | # | 173 | # |
174 | # Networking | ||
175 | # | ||
176 | CONFIG_NET=y | ||
177 | |||
178 | # | ||
179 | # Networking options | ||
180 | # | ||
181 | CONFIG_PACKET=y | ||
182 | # CONFIG_PACKET_MMAP is not set | ||
183 | CONFIG_UNIX=y | ||
184 | # CONFIG_NET_KEY is not set | ||
185 | CONFIG_INET=y | ||
186 | CONFIG_IP_MULTICAST=y | ||
187 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
188 | CONFIG_IP_FIB_HASH=y | ||
189 | # CONFIG_IP_PNP is not set | ||
190 | # CONFIG_NET_IPIP is not set | ||
191 | # CONFIG_NET_IPGRE is not set | ||
192 | # CONFIG_IP_MROUTE is not set | ||
193 | CONFIG_ARPD=y | ||
194 | CONFIG_SYN_COOKIES=y | ||
195 | # CONFIG_INET_AH is not set | ||
196 | # CONFIG_INET_ESP is not set | ||
197 | # CONFIG_INET_IPCOMP is not set | ||
198 | # CONFIG_INET_TUNNEL is not set | ||
199 | CONFIG_IP_TCPDIAG=y | ||
200 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
201 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
202 | CONFIG_TCP_CONG_BIC=y | ||
203 | # CONFIG_IPV6 is not set | ||
204 | # CONFIG_NETFILTER is not set | ||
205 | |||
206 | # | ||
207 | # SCTP Configuration (EXPERIMENTAL) | ||
208 | # | ||
209 | # CONFIG_IP_SCTP is not set | ||
210 | # CONFIG_ATM is not set | ||
211 | # CONFIG_BRIDGE is not set | ||
212 | # CONFIG_VLAN_8021Q is not set | ||
213 | # CONFIG_DECNET is not set | ||
214 | # CONFIG_LLC2 is not set | ||
215 | # CONFIG_IPX is not set | ||
216 | # CONFIG_ATALK is not set | ||
217 | # CONFIG_X25 is not set | ||
218 | # CONFIG_LAPB is not set | ||
219 | # CONFIG_NET_DIVERT is not set | ||
220 | # CONFIG_ECONET is not set | ||
221 | # CONFIG_WAN_ROUTER is not set | ||
222 | # CONFIG_NET_SCHED is not set | ||
223 | # CONFIG_NET_CLS_ROUTE is not set | ||
224 | |||
225 | # | ||
226 | # Network testing | ||
227 | # | ||
228 | # CONFIG_NET_PKTGEN is not set | ||
229 | # CONFIG_HAMRADIO is not set | ||
230 | # CONFIG_IRDA is not set | ||
231 | # CONFIG_BT is not set | ||
232 | |||
233 | # | ||
173 | # Device Drivers | 234 | # Device Drivers |
174 | # | 235 | # |
175 | 236 | ||
@@ -178,7 +239,7 @@ CONFIG_HOTPLUG_PCI_ACPI=m | |||
178 | # | 239 | # |
179 | CONFIG_STANDALONE=y | 240 | CONFIG_STANDALONE=y |
180 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 241 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
181 | # CONFIG_FW_LOADER is not set | 242 | CONFIG_FW_LOADER=m |
182 | # CONFIG_DEBUG_DRIVER is not set | 243 | # CONFIG_DEBUG_DRIVER is not set |
183 | 244 | ||
184 | # | 245 | # |
@@ -348,6 +409,7 @@ CONFIG_SCSI_QLA22XX=m | |||
348 | CONFIG_SCSI_QLA2300=m | 409 | CONFIG_SCSI_QLA2300=m |
349 | CONFIG_SCSI_QLA2322=m | 410 | CONFIG_SCSI_QLA2322=m |
350 | # CONFIG_SCSI_QLA6312 is not set | 411 | # CONFIG_SCSI_QLA6312 is not set |
412 | # CONFIG_SCSI_QLA24XX is not set | ||
351 | # CONFIG_SCSI_LPFC is not set | 413 | # CONFIG_SCSI_LPFC is not set |
352 | # CONFIG_SCSI_DC395x is not set | 414 | # CONFIG_SCSI_DC395x is not set |
353 | # CONFIG_SCSI_DC390T is not set | 415 | # CONFIG_SCSI_DC390T is not set |
@@ -393,72 +455,8 @@ CONFIG_FUSION_CTL=y | |||
393 | # CONFIG_I2O is not set | 455 | # CONFIG_I2O is not set |
394 | 456 | ||
395 | # | 457 | # |
396 | # Networking support | 458 | # Network device support |
397 | # | ||
398 | CONFIG_NET=y | ||
399 | |||
400 | # | ||
401 | # Networking options | ||
402 | # | 459 | # |
403 | CONFIG_PACKET=y | ||
404 | # CONFIG_PACKET_MMAP is not set | ||
405 | CONFIG_UNIX=y | ||
406 | # CONFIG_NET_KEY is not set | ||
407 | CONFIG_INET=y | ||
408 | CONFIG_IP_MULTICAST=y | ||
409 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
410 | CONFIG_IP_FIB_HASH=y | ||
411 | # CONFIG_IP_PNP is not set | ||
412 | # CONFIG_NET_IPIP is not set | ||
413 | # CONFIG_NET_IPGRE is not set | ||
414 | # CONFIG_IP_MROUTE is not set | ||
415 | CONFIG_ARPD=y | ||
416 | CONFIG_SYN_COOKIES=y | ||
417 | # CONFIG_INET_AH is not set | ||
418 | # CONFIG_INET_ESP is not set | ||
419 | # CONFIG_INET_IPCOMP is not set | ||
420 | # CONFIG_INET_TUNNEL is not set | ||
421 | CONFIG_IP_TCPDIAG=y | ||
422 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
423 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
424 | CONFIG_TCP_CONG_BIC=y | ||
425 | # CONFIG_IPV6 is not set | ||
426 | # CONFIG_NETFILTER is not set | ||
427 | |||
428 | # | ||
429 | # SCTP Configuration (EXPERIMENTAL) | ||
430 | # | ||
431 | # CONFIG_IP_SCTP is not set | ||
432 | # CONFIG_ATM is not set | ||
433 | # CONFIG_BRIDGE is not set | ||
434 | # CONFIG_VLAN_8021Q is not set | ||
435 | # CONFIG_DECNET is not set | ||
436 | # CONFIG_LLC2 is not set | ||
437 | # CONFIG_IPX is not set | ||
438 | # CONFIG_ATALK is not set | ||
439 | # CONFIG_X25 is not set | ||
440 | # CONFIG_LAPB is not set | ||
441 | # CONFIG_NET_DIVERT is not set | ||
442 | # CONFIG_ECONET is not set | ||
443 | # CONFIG_WAN_ROUTER is not set | ||
444 | |||
445 | # | ||
446 | # QoS and/or fair queueing | ||
447 | # | ||
448 | # CONFIG_NET_SCHED is not set | ||
449 | # CONFIG_NET_CLS_ROUTE is not set | ||
450 | |||
451 | # | ||
452 | # Network testing | ||
453 | # | ||
454 | # CONFIG_NET_PKTGEN is not set | ||
455 | CONFIG_NETPOLL=y | ||
456 | # CONFIG_NETPOLL_RX is not set | ||
457 | # CONFIG_NETPOLL_TRAP is not set | ||
458 | CONFIG_NET_POLL_CONTROLLER=y | ||
459 | # CONFIG_HAMRADIO is not set | ||
460 | # CONFIG_IRDA is not set | ||
461 | # CONFIG_BT is not set | ||
462 | CONFIG_NETDEVICES=y | 460 | CONFIG_NETDEVICES=y |
463 | CONFIG_DUMMY=m | 461 | CONFIG_DUMMY=m |
464 | # CONFIG_BONDING is not set | 462 | # CONFIG_BONDING is not set |
@@ -555,6 +553,10 @@ CONFIG_TIGON3=y | |||
555 | # CONFIG_NET_FC is not set | 553 | # CONFIG_NET_FC is not set |
556 | # CONFIG_SHAPER is not set | 554 | # CONFIG_SHAPER is not set |
557 | CONFIG_NETCONSOLE=y | 555 | CONFIG_NETCONSOLE=y |
556 | CONFIG_NETPOLL=y | ||
557 | # CONFIG_NETPOLL_RX is not set | ||
558 | # CONFIG_NETPOLL_TRAP is not set | ||
559 | CONFIG_NET_POLL_CONTROLLER=y | ||
558 | 560 | ||
559 | # | 561 | # |
560 | # ISDN subsystem | 562 | # ISDN subsystem |
@@ -680,6 +682,7 @@ CONFIG_DRM_R128=m | |||
680 | CONFIG_DRM_RADEON=m | 682 | CONFIG_DRM_RADEON=m |
681 | CONFIG_DRM_MGA=m | 683 | CONFIG_DRM_MGA=m |
682 | CONFIG_DRM_SIS=m | 684 | CONFIG_DRM_SIS=m |
685 | # CONFIG_DRM_VIA is not set | ||
683 | CONFIG_RAW_DRIVER=m | 686 | CONFIG_RAW_DRIVER=m |
684 | CONFIG_HPET=y | 687 | CONFIG_HPET=y |
685 | # CONFIG_HPET_RTC_IRQ is not set | 688 | # CONFIG_HPET_RTC_IRQ is not set |
@@ -696,6 +699,7 @@ CONFIG_MAX_RAW_DEVS=256 | |||
696 | # I2C support | 699 | # I2C support |
697 | # | 700 | # |
698 | # CONFIG_I2C is not set | 701 | # CONFIG_I2C is not set |
702 | # CONFIG_I2C_SENSOR is not set | ||
699 | 703 | ||
700 | # | 704 | # |
701 | # Dallas's 1-wire bus | 705 | # Dallas's 1-wire bus |
@@ -703,6 +707,12 @@ CONFIG_MAX_RAW_DEVS=256 | |||
703 | # CONFIG_W1 is not set | 707 | # CONFIG_W1 is not set |
704 | 708 | ||
705 | # | 709 | # |
710 | # Hardware Monitoring support | ||
711 | # | ||
712 | CONFIG_HWMON=y | ||
713 | # CONFIG_HWMON_DEBUG_CHIP is not set | ||
714 | |||
715 | # | ||
706 | # Misc devices | 716 | # Misc devices |
707 | # | 717 | # |
708 | 718 | ||
@@ -800,6 +810,7 @@ CONFIG_USB_HIDINPUT=y | |||
800 | # CONFIG_USB_EGALAX is not set | 810 | # CONFIG_USB_EGALAX is not set |
801 | # CONFIG_USB_XPAD is not set | 811 | # CONFIG_USB_XPAD is not set |
802 | # CONFIG_USB_ATI_REMOTE is not set | 812 | # CONFIG_USB_ATI_REMOTE is not set |
813 | # CONFIG_USB_KEYSPAN_REMOTE is not set | ||
803 | 814 | ||
804 | # | 815 | # |
805 | # USB Imaging devices | 816 | # USB Imaging devices |
@@ -850,6 +861,7 @@ CONFIG_USB_HIDINPUT=y | |||
850 | # CONFIG_USB_PHIDGETSERVO is not set | 861 | # CONFIG_USB_PHIDGETSERVO is not set |
851 | # CONFIG_USB_IDMOUSE is not set | 862 | # CONFIG_USB_IDMOUSE is not set |
852 | # CONFIG_USB_SISUSBVGA is not set | 863 | # CONFIG_USB_SISUSBVGA is not set |
864 | # CONFIG_USB_LD is not set | ||
853 | # CONFIG_USB_TEST is not set | 865 | # CONFIG_USB_TEST is not set |
854 | 866 | ||
855 | # | 867 | # |
@@ -910,6 +922,7 @@ CONFIG_XFS_EXPORT=y | |||
910 | # CONFIG_XFS_POSIX_ACL is not set | 922 | # CONFIG_XFS_POSIX_ACL is not set |
911 | # CONFIG_MINIX_FS is not set | 923 | # CONFIG_MINIX_FS is not set |
912 | # CONFIG_ROMFS_FS is not set | 924 | # CONFIG_ROMFS_FS is not set |
925 | CONFIG_INOTIFY=y | ||
913 | # CONFIG_QUOTA is not set | 926 | # CONFIG_QUOTA is not set |
914 | CONFIG_DNOTIFY=y | 927 | CONFIG_DNOTIFY=y |
915 | CONFIG_AUTOFS_FS=y | 928 | CONFIG_AUTOFS_FS=y |
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig index b7755e4436d2..88e8867fa8e8 100644 --- a/arch/ia64/configs/zx1_defconfig +++ b/arch/ia64/configs/zx1_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc1-20050629 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jun 29 15:31:11 2005 | 4 | # Wed Aug 17 10:02:43 2005 |
5 | # | 5 | # |
6 | 6 | ||
7 | # | 7 | # |
@@ -132,6 +132,7 @@ CONFIG_ACPI_BOOT=y | |||
132 | CONFIG_ACPI_INTERPRETER=y | 132 | CONFIG_ACPI_INTERPRETER=y |
133 | CONFIG_ACPI_BUTTON=y | 133 | CONFIG_ACPI_BUTTON=y |
134 | CONFIG_ACPI_VIDEO=m | 134 | CONFIG_ACPI_VIDEO=m |
135 | CONFIG_ACPI_HOTKEY=m | ||
135 | CONFIG_ACPI_FAN=y | 136 | CONFIG_ACPI_FAN=y |
136 | CONFIG_ACPI_PROCESSOR=y | 137 | CONFIG_ACPI_PROCESSOR=y |
137 | CONFIG_ACPI_THERMAL=y | 138 | CONFIG_ACPI_THERMAL=y |
@@ -169,6 +170,83 @@ CONFIG_HOTPLUG_PCI_ACPI=y | |||
169 | # CONFIG_PCCARD is not set | 170 | # CONFIG_PCCARD is not set |
170 | 171 | ||
171 | # | 172 | # |
173 | # Networking | ||
174 | # | ||
175 | CONFIG_NET=y | ||
176 | |||
177 | # | ||
178 | # Networking options | ||
179 | # | ||
180 | CONFIG_PACKET=y | ||
181 | # CONFIG_PACKET_MMAP is not set | ||
182 | CONFIG_UNIX=y | ||
183 | # CONFIG_NET_KEY is not set | ||
184 | CONFIG_INET=y | ||
185 | CONFIG_IP_MULTICAST=y | ||
186 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
187 | CONFIG_IP_FIB_HASH=y | ||
188 | # CONFIG_IP_PNP is not set | ||
189 | # CONFIG_NET_IPIP is not set | ||
190 | # CONFIG_NET_IPGRE is not set | ||
191 | # CONFIG_IP_MROUTE is not set | ||
192 | # CONFIG_ARPD is not set | ||
193 | # CONFIG_SYN_COOKIES is not set | ||
194 | # CONFIG_INET_AH is not set | ||
195 | # CONFIG_INET_ESP is not set | ||
196 | # CONFIG_INET_IPCOMP is not set | ||
197 | # CONFIG_INET_TUNNEL is not set | ||
198 | # CONFIG_IP_TCPDIAG is not set | ||
199 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
200 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
201 | CONFIG_TCP_CONG_BIC=y | ||
202 | |||
203 | # | ||
204 | # IP: Virtual Server Configuration | ||
205 | # | ||
206 | # CONFIG_IP_VS is not set | ||
207 | # CONFIG_IPV6 is not set | ||
208 | CONFIG_NETFILTER=y | ||
209 | # CONFIG_NETFILTER_DEBUG is not set | ||
210 | |||
211 | # | ||
212 | # IP: Netfilter Configuration | ||
213 | # | ||
214 | # CONFIG_IP_NF_CONNTRACK is not set | ||
215 | # CONFIG_IP_NF_CONNTRACK_MARK is not set | ||
216 | # CONFIG_IP_NF_QUEUE is not set | ||
217 | # CONFIG_IP_NF_IPTABLES is not set | ||
218 | CONFIG_IP_NF_ARPTABLES=y | ||
219 | # CONFIG_IP_NF_ARPFILTER is not set | ||
220 | # CONFIG_IP_NF_ARP_MANGLE is not set | ||
221 | |||
222 | # | ||
223 | # SCTP Configuration (EXPERIMENTAL) | ||
224 | # | ||
225 | # CONFIG_IP_SCTP is not set | ||
226 | # CONFIG_ATM is not set | ||
227 | # CONFIG_BRIDGE is not set | ||
228 | # CONFIG_VLAN_8021Q is not set | ||
229 | # CONFIG_DECNET is not set | ||
230 | # CONFIG_LLC2 is not set | ||
231 | # CONFIG_IPX is not set | ||
232 | # CONFIG_ATALK is not set | ||
233 | # CONFIG_X25 is not set | ||
234 | # CONFIG_LAPB is not set | ||
235 | # CONFIG_NET_DIVERT is not set | ||
236 | # CONFIG_ECONET is not set | ||
237 | # CONFIG_WAN_ROUTER is not set | ||
238 | # CONFIG_NET_SCHED is not set | ||
239 | # CONFIG_NET_CLS_ROUTE is not set | ||
240 | |||
241 | # | ||
242 | # Network testing | ||
243 | # | ||
244 | # CONFIG_NET_PKTGEN is not set | ||
245 | # CONFIG_HAMRADIO is not set | ||
246 | # CONFIG_IRDA is not set | ||
247 | # CONFIG_BT is not set | ||
248 | |||
249 | # | ||
172 | # Device Drivers | 250 | # Device Drivers |
173 | # | 251 | # |
174 | 252 | ||
@@ -349,6 +427,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
349 | # CONFIG_SCSI_QLA2300 is not set | 427 | # CONFIG_SCSI_QLA2300 is not set |
350 | # CONFIG_SCSI_QLA2322 is not set | 428 | # CONFIG_SCSI_QLA2322 is not set |
351 | # CONFIG_SCSI_QLA6312 is not set | 429 | # CONFIG_SCSI_QLA6312 is not set |
430 | # CONFIG_SCSI_QLA24XX is not set | ||
352 | # CONFIG_SCSI_LPFC is not set | 431 | # CONFIG_SCSI_LPFC is not set |
353 | # CONFIG_SCSI_DC395x is not set | 432 | # CONFIG_SCSI_DC395x is not set |
354 | # CONFIG_SCSI_DC390T is not set | 433 | # CONFIG_SCSI_DC390T is not set |
@@ -362,9 +441,11 @@ CONFIG_SCSI_QLA2XXX=y | |||
362 | # | 441 | # |
363 | # Fusion MPT device support | 442 | # Fusion MPT device support |
364 | # | 443 | # |
365 | # CONFIG_FUSION is not set | 444 | CONFIG_FUSION=y |
366 | # CONFIG_FUSION_SPI is not set | 445 | CONFIG_FUSION_SPI=y |
367 | # CONFIG_FUSION_FC is not set | 446 | CONFIG_FUSION_FC=y |
447 | CONFIG_FUSION_MAX_SGE=128 | ||
448 | CONFIG_FUSION_CTL=m | ||
368 | 449 | ||
369 | # | 450 | # |
370 | # IEEE 1394 (FireWire) support | 451 | # IEEE 1394 (FireWire) support |
@@ -377,87 +458,8 @@ CONFIG_SCSI_QLA2XXX=y | |||
377 | # CONFIG_I2O is not set | 458 | # CONFIG_I2O is not set |
378 | 459 | ||
379 | # | 460 | # |
380 | # Networking support | 461 | # Network device support |
381 | # | ||
382 | CONFIG_NET=y | ||
383 | |||
384 | # | ||
385 | # Networking options | ||
386 | # | ||
387 | CONFIG_PACKET=y | ||
388 | # CONFIG_PACKET_MMAP is not set | ||
389 | CONFIG_UNIX=y | ||
390 | # CONFIG_NET_KEY is not set | ||
391 | CONFIG_INET=y | ||
392 | CONFIG_IP_MULTICAST=y | ||
393 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
394 | CONFIG_IP_FIB_HASH=y | ||
395 | # CONFIG_IP_PNP is not set | ||
396 | # CONFIG_NET_IPIP is not set | ||
397 | # CONFIG_NET_IPGRE is not set | ||
398 | # CONFIG_IP_MROUTE is not set | ||
399 | # CONFIG_ARPD is not set | ||
400 | # CONFIG_SYN_COOKIES is not set | ||
401 | # CONFIG_INET_AH is not set | ||
402 | # CONFIG_INET_ESP is not set | ||
403 | # CONFIG_INET_IPCOMP is not set | ||
404 | # CONFIG_INET_TUNNEL is not set | ||
405 | # CONFIG_IP_TCPDIAG is not set | ||
406 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
407 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
408 | CONFIG_TCP_CONG_BIC=y | ||
409 | |||
410 | # | ||
411 | # IP: Virtual Server Configuration | ||
412 | # | ||
413 | # CONFIG_IP_VS is not set | ||
414 | # CONFIG_IPV6 is not set | ||
415 | CONFIG_NETFILTER=y | ||
416 | # CONFIG_NETFILTER_DEBUG is not set | ||
417 | |||
418 | # | ||
419 | # IP: Netfilter Configuration | ||
420 | # | 462 | # |
421 | # CONFIG_IP_NF_CONNTRACK is not set | ||
422 | # CONFIG_IP_NF_CONNTRACK_MARK is not set | ||
423 | # CONFIG_IP_NF_QUEUE is not set | ||
424 | # CONFIG_IP_NF_IPTABLES is not set | ||
425 | CONFIG_IP_NF_ARPTABLES=y | ||
426 | # CONFIG_IP_NF_ARPFILTER is not set | ||
427 | # CONFIG_IP_NF_ARP_MANGLE is not set | ||
428 | |||
429 | # | ||
430 | # SCTP Configuration (EXPERIMENTAL) | ||
431 | # | ||
432 | # CONFIG_IP_SCTP is not set | ||
433 | # CONFIG_ATM is not set | ||
434 | # CONFIG_BRIDGE is not set | ||
435 | # CONFIG_VLAN_8021Q is not set | ||
436 | # CONFIG_DECNET is not set | ||
437 | # CONFIG_LLC2 is not set | ||
438 | # CONFIG_IPX is not set | ||
439 | # CONFIG_ATALK is not set | ||
440 | # CONFIG_X25 is not set | ||
441 | # CONFIG_LAPB is not set | ||
442 | # CONFIG_NET_DIVERT is not set | ||
443 | # CONFIG_ECONET is not set | ||
444 | # CONFIG_WAN_ROUTER is not set | ||
445 | |||
446 | # | ||
447 | # QoS and/or fair queueing | ||
448 | # | ||
449 | # CONFIG_NET_SCHED is not set | ||
450 | # CONFIG_NET_CLS_ROUTE is not set | ||
451 | |||
452 | # | ||
453 | # Network testing | ||
454 | # | ||
455 | # CONFIG_NET_PKTGEN is not set | ||
456 | # CONFIG_NETPOLL is not set | ||
457 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
458 | # CONFIG_HAMRADIO is not set | ||
459 | # CONFIG_IRDA is not set | ||
460 | # CONFIG_BT is not set | ||
461 | CONFIG_NETDEVICES=y | 463 | CONFIG_NETDEVICES=y |
462 | CONFIG_DUMMY=y | 464 | CONFIG_DUMMY=y |
463 | # CONFIG_BONDING is not set | 465 | # CONFIG_BONDING is not set |
@@ -555,6 +557,8 @@ CONFIG_TIGON3=y | |||
555 | # CONFIG_NET_FC is not set | 557 | # CONFIG_NET_FC is not set |
556 | # CONFIG_SHAPER is not set | 558 | # CONFIG_SHAPER is not set |
557 | # CONFIG_NETCONSOLE is not set | 559 | # CONFIG_NETCONSOLE is not set |
560 | # CONFIG_NETPOLL is not set | ||
561 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
558 | 562 | ||
559 | # | 563 | # |
560 | # ISDN subsystem | 564 | # ISDN subsystem |
@@ -659,6 +663,7 @@ CONFIG_DRM=y | |||
659 | CONFIG_DRM_RADEON=y | 663 | CONFIG_DRM_RADEON=y |
660 | # CONFIG_DRM_MGA is not set | 664 | # CONFIG_DRM_MGA is not set |
661 | # CONFIG_DRM_SIS is not set | 665 | # CONFIG_DRM_SIS is not set |
666 | # CONFIG_DRM_VIA is not set | ||
662 | # CONFIG_RAW_DRIVER is not set | 667 | # CONFIG_RAW_DRIVER is not set |
663 | # CONFIG_HPET is not set | 668 | # CONFIG_HPET is not set |
664 | # CONFIG_HANGCHECK_TIMER is not set | 669 | # CONFIG_HANGCHECK_TIMER is not set |
@@ -706,47 +711,10 @@ CONFIG_I2C_ALGOPCF=y | |||
706 | # CONFIG_I2C_VIAPRO is not set | 711 | # CONFIG_I2C_VIAPRO is not set |
707 | # CONFIG_I2C_VOODOO3 is not set | 712 | # CONFIG_I2C_VOODOO3 is not set |
708 | # CONFIG_I2C_PCA_ISA is not set | 713 | # CONFIG_I2C_PCA_ISA is not set |
714 | # CONFIG_I2C_SENSOR is not set | ||
709 | 715 | ||
710 | # | 716 | # |
711 | # Hardware Sensors Chip support | 717 | # Miscellaneous I2C Chip support |
712 | # | ||
713 | # CONFIG_I2C_SENSOR is not set | ||
714 | # CONFIG_SENSORS_ADM1021 is not set | ||
715 | # CONFIG_SENSORS_ADM1025 is not set | ||
716 | # CONFIG_SENSORS_ADM1026 is not set | ||
717 | # CONFIG_SENSORS_ADM1031 is not set | ||
718 | # CONFIG_SENSORS_ADM9240 is not set | ||
719 | # CONFIG_SENSORS_ASB100 is not set | ||
720 | # CONFIG_SENSORS_ATXP1 is not set | ||
721 | # CONFIG_SENSORS_DS1621 is not set | ||
722 | # CONFIG_SENSORS_FSCHER is not set | ||
723 | # CONFIG_SENSORS_FSCPOS is not set | ||
724 | # CONFIG_SENSORS_GL518SM is not set | ||
725 | # CONFIG_SENSORS_GL520SM is not set | ||
726 | # CONFIG_SENSORS_IT87 is not set | ||
727 | # CONFIG_SENSORS_LM63 is not set | ||
728 | # CONFIG_SENSORS_LM75 is not set | ||
729 | # CONFIG_SENSORS_LM77 is not set | ||
730 | # CONFIG_SENSORS_LM78 is not set | ||
731 | # CONFIG_SENSORS_LM80 is not set | ||
732 | # CONFIG_SENSORS_LM83 is not set | ||
733 | # CONFIG_SENSORS_LM85 is not set | ||
734 | # CONFIG_SENSORS_LM87 is not set | ||
735 | # CONFIG_SENSORS_LM90 is not set | ||
736 | # CONFIG_SENSORS_LM92 is not set | ||
737 | # CONFIG_SENSORS_MAX1619 is not set | ||
738 | # CONFIG_SENSORS_PC87360 is not set | ||
739 | # CONFIG_SENSORS_SMSC47B397 is not set | ||
740 | # CONFIG_SENSORS_SIS5595 is not set | ||
741 | # CONFIG_SENSORS_SMSC47M1 is not set | ||
742 | # CONFIG_SENSORS_VIA686A is not set | ||
743 | # CONFIG_SENSORS_W83781D is not set | ||
744 | # CONFIG_SENSORS_W83L785TS is not set | ||
745 | # CONFIG_SENSORS_W83627HF is not set | ||
746 | # CONFIG_SENSORS_W83627EHF is not set | ||
747 | |||
748 | # | ||
749 | # Other I2C Chip support | ||
750 | # | 718 | # |
751 | # CONFIG_SENSORS_DS1337 is not set | 719 | # CONFIG_SENSORS_DS1337 is not set |
752 | # CONFIG_SENSORS_DS1374 is not set | 720 | # CONFIG_SENSORS_DS1374 is not set |
@@ -767,6 +735,11 @@ CONFIG_I2C_ALGOPCF=y | |||
767 | # CONFIG_W1 is not set | 735 | # CONFIG_W1 is not set |
768 | 736 | ||
769 | # | 737 | # |
738 | # Hardware Monitoring support | ||
739 | # | ||
740 | # CONFIG_HWMON is not set | ||
741 | |||
742 | # | ||
770 | # Misc devices | 743 | # Misc devices |
771 | # | 744 | # |
772 | 745 | ||
@@ -782,7 +755,6 @@ CONFIG_VIDEO_DEV=y | |||
782 | # | 755 | # |
783 | # Video Adapters | 756 | # Video Adapters |
784 | # | 757 | # |
785 | # CONFIG_TUNER_MULTI_I2C is not set | ||
786 | # CONFIG_VIDEO_BT848 is not set | 758 | # CONFIG_VIDEO_BT848 is not set |
787 | # CONFIG_VIDEO_CPIA is not set | 759 | # CONFIG_VIDEO_CPIA is not set |
788 | # CONFIG_VIDEO_SAA5246A is not set | 760 | # CONFIG_VIDEO_SAA5246A is not set |
@@ -1025,6 +997,7 @@ CONFIG_USB_HIDDEV=y | |||
1025 | # CONFIG_USB_EGALAX is not set | 997 | # CONFIG_USB_EGALAX is not set |
1026 | # CONFIG_USB_XPAD is not set | 998 | # CONFIG_USB_XPAD is not set |
1027 | # CONFIG_USB_ATI_REMOTE is not set | 999 | # CONFIG_USB_ATI_REMOTE is not set |
1000 | # CONFIG_USB_KEYSPAN_REMOTE is not set | ||
1028 | 1001 | ||
1029 | # | 1002 | # |
1030 | # USB Imaging devices | 1003 | # USB Imaging devices |
@@ -1080,6 +1053,7 @@ CONFIG_USB_MON=y | |||
1080 | # CONFIG_USB_PHIDGETSERVO is not set | 1053 | # CONFIG_USB_PHIDGETSERVO is not set |
1081 | # CONFIG_USB_IDMOUSE is not set | 1054 | # CONFIG_USB_IDMOUSE is not set |
1082 | # CONFIG_USB_SISUSBVGA is not set | 1055 | # CONFIG_USB_SISUSBVGA is not set |
1056 | # CONFIG_USB_LD is not set | ||
1083 | 1057 | ||
1084 | # | 1058 | # |
1085 | # USB DSL modem support | 1059 | # USB DSL modem support |
@@ -1121,6 +1095,7 @@ CONFIG_JBD=y | |||
1121 | CONFIG_FS_MBCACHE=y | 1095 | CONFIG_FS_MBCACHE=y |
1122 | # CONFIG_REISERFS_FS is not set | 1096 | # CONFIG_REISERFS_FS is not set |
1123 | # CONFIG_JFS_FS is not set | 1097 | # CONFIG_JFS_FS is not set |
1098 | # CONFIG_FS_POSIX_ACL is not set | ||
1124 | 1099 | ||
1125 | # | 1100 | # |
1126 | # XFS support | 1101 | # XFS support |
@@ -1128,6 +1103,7 @@ CONFIG_FS_MBCACHE=y | |||
1128 | # CONFIG_XFS_FS is not set | 1103 | # CONFIG_XFS_FS is not set |
1129 | # CONFIG_MINIX_FS is not set | 1104 | # CONFIG_MINIX_FS is not set |
1130 | # CONFIG_ROMFS_FS is not set | 1105 | # CONFIG_ROMFS_FS is not set |
1106 | # CONFIG_INOTIFY is not set | ||
1131 | # CONFIG_QUOTA is not set | 1107 | # CONFIG_QUOTA is not set |
1132 | CONFIG_DNOTIFY=y | 1108 | CONFIG_DNOTIFY=y |
1133 | CONFIG_AUTOFS_FS=y | 1109 | CONFIG_AUTOFS_FS=y |
diff --git a/arch/ia64/hp/sim/boot/boot_head.S b/arch/ia64/hp/sim/boot/boot_head.S index 9364199e5632..1c8c7e6a9a5e 100644 --- a/arch/ia64/hp/sim/boot/boot_head.S +++ b/arch/ia64/hp/sim/boot/boot_head.S | |||
@@ -22,7 +22,7 @@ GLOBAL_ENTRY(_start) | |||
22 | .save rp, r0 | 22 | .save rp, r0 |
23 | .body | 23 | .body |
24 | movl gp = __gp | 24 | movl gp = __gp |
25 | movl sp = stack_mem | 25 | movl sp = stack_mem+16384-16 |
26 | bsw.1 | 26 | bsw.1 |
27 | br.call.sptk.many rp=start_bootloader | 27 | br.call.sptk.many rp=start_bootloader |
28 | END(_start) | 28 | END(_start) |
diff --git a/arch/ia64/kernel/domain.c b/arch/ia64/kernel/domain.c index d65e87b6394f..bbb8efe126b7 100644 --- a/arch/ia64/kernel/domain.c +++ b/arch/ia64/kernel/domain.c | |||
@@ -341,7 +341,7 @@ next_sg: | |||
341 | #endif | 341 | #endif |
342 | 342 | ||
343 | /* Attach the domains */ | 343 | /* Attach the domains */ |
344 | for_each_online_cpu(i) { | 344 | for_each_cpu_mask(i, *cpu_map) { |
345 | struct sched_domain *sd; | 345 | struct sched_domain *sd; |
346 | #ifdef CONFIG_SCHED_SMT | 346 | #ifdef CONFIG_SCHED_SMT |
347 | sd = &per_cpu(cpu_domains, i); | 347 | sd = &per_cpu(cpu_domains, i); |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 66946f3fdac7..9be53e1ea404 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1573,7 +1573,7 @@ sys_call_table: | |||
1573 | data8 sys_keyctl | 1573 | data8 sys_keyctl |
1574 | data8 sys_ioprio_set | 1574 | data8 sys_ioprio_set |
1575 | data8 sys_ioprio_get // 1275 | 1575 | data8 sys_ioprio_get // 1275 |
1576 | data8 sys_set_zone_reclaim | 1576 | data8 sys_ni_syscall |
1577 | data8 sys_inotify_init | 1577 | data8 sys_inotify_init |
1578 | data8 sys_inotify_add_watch | 1578 | data8 sys_inotify_add_watch |
1579 | data8 sys_inotify_rm_watch | 1579 | data8 sys_inotify_rm_watch |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index b8ebb8e427ef..f1201ac8a116 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -4312,6 +4312,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) | |||
4312 | DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n", | 4312 | DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n", |
4313 | thread->pfm_context, ctx)); | 4313 | thread->pfm_context, ctx)); |
4314 | 4314 | ||
4315 | ret = -EBUSY; | ||
4315 | old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *)); | 4316 | old = ia64_cmpxchg(acq, &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *)); |
4316 | if (old != NULL) { | 4317 | if (old != NULL) { |
4317 | DPRINT(("load_pid [%d] already has a context\n", req->load_pid)); | 4318 | DPRINT(("load_pid [%d] already has a context\n", req->load_pid)); |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 66e840609808..051e050359e4 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1; | |||
179 | 179 | ||
180 | static int __init nohalt_setup(char * str) | 180 | static int __init nohalt_setup(char * str) |
181 | { | 181 | { |
182 | pal_halt = 0; | 182 | pal_halt = can_do_pal_halt = 0; |
183 | return 1; | 183 | return 1; |
184 | } | 184 | } |
185 | __setup("nohalt", nohalt_setup); | 185 | __setup("nohalt", nohalt_setup); |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index d227fabecd02..6f0cc7a6634e 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -143,7 +143,8 @@ struct salinfo_data { | |||
143 | 143 | ||
144 | static struct salinfo_data salinfo_data[ARRAY_SIZE(salinfo_log_name)]; | 144 | static struct salinfo_data salinfo_data[ARRAY_SIZE(salinfo_log_name)]; |
145 | 145 | ||
146 | static spinlock_t data_lock, data_saved_lock; | 146 | static DEFINE_SPINLOCK(data_lock); |
147 | static DEFINE_SPINLOCK(data_saved_lock); | ||
147 | 148 | ||
148 | /** salinfo_platform_oemdata - optional callback to decode oemdata from an error | 149 | /** salinfo_platform_oemdata - optional callback to decode oemdata from an error |
149 | * record. | 150 | * record. |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 54d9ed444e4a..f9472c50ab42 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -380,6 +380,7 @@ void pcibios_bus_to_resource(struct pci_dev *dev, | |||
380 | res->start = region->start + offset; | 380 | res->start = region->start + offset; |
381 | res->end = region->end + offset; | 381 | res->end = region->end + offset; |
382 | } | 382 | } |
383 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
383 | 384 | ||
384 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) | 385 | static int __devinit is_valid_resource(struct pci_dev *dev, int idx) |
385 | { | 386 | { |
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index a6649baf629a..414cdf2e3c96 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -203,6 +203,7 @@ static void sn_fixup_ionodes(void) | |||
203 | continue; | 203 | continue; |
204 | } | 204 | } |
205 | 205 | ||
206 | spin_lock_init(&sn_flush_device_list->sfdl_flush_lock); | ||
206 | hubdev->hdi_flush_nasid_list.widget_p[widget] = | 207 | hubdev->hdi_flush_nasid_list.widget_p[widget] = |
207 | sn_flush_device_list; | 208 | sn_flush_device_list; |
208 | } | 209 | } |
@@ -322,7 +323,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
322 | struct pci_controller *controller; | 323 | struct pci_controller *controller; |
323 | struct pcibus_bussoft *prom_bussoft_ptr; | 324 | struct pcibus_bussoft *prom_bussoft_ptr; |
324 | struct hubdev_info *hubdev_info; | 325 | struct hubdev_info *hubdev_info; |
325 | void *provider_soft; | 326 | void *provider_soft = NULL; |
326 | struct sn_pcibus_provider *provider; | 327 | struct sn_pcibus_provider *provider; |
327 | 328 | ||
328 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, | 329 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, |
@@ -338,7 +339,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
338 | if (bus == NULL) { | 339 | if (bus == NULL) { |
339 | bus = pci_scan_bus(busnum, &pci_root_ops, controller); | 340 | bus = pci_scan_bus(busnum, &pci_root_ops, controller); |
340 | if (bus == NULL) | 341 | if (bus == NULL) |
341 | return; /* error, or bus already scanned */ | 342 | goto error_return; /* error, or bus already scanned */ |
342 | bus->sysdata = NULL; | 343 | bus->sysdata = NULL; |
343 | } | 344 | } |
344 | 345 | ||
@@ -351,28 +352,30 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
351 | */ | 352 | */ |
352 | 353 | ||
353 | if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) | 354 | if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) |
354 | return; /* unsupported asic type */ | 355 | goto error_return; /* unsupported asic type */ |
355 | 356 | ||
356 | if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB) | 357 | if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB) |
357 | goto error_return; /* no further fixup necessary */ | 358 | goto error_return; /* no further fixup necessary */ |
358 | 359 | ||
359 | provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; | 360 | provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; |
360 | if (provider == NULL) | 361 | if (provider == NULL) |
361 | return; /* no provider registerd for this asic */ | 362 | goto error_return; /* no provider registerd for this asic */ |
362 | 363 | ||
363 | provider_soft = NULL; | 364 | bus->sysdata = controller; |
364 | if (provider->bus_fixup) | 365 | if (provider->bus_fixup) |
365 | provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller); | 366 | provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller); |
366 | 367 | ||
367 | if (provider_soft == NULL) | 368 | if (provider_soft == NULL) { |
368 | return; /* fixup failed or not applicable */ | 369 | /* fixup failed or not applicable */ |
370 | bus->sysdata = NULL; | ||
371 | goto error_return; | ||
372 | } | ||
369 | 373 | ||
370 | /* | 374 | /* |
371 | * Generic bus fixup goes here. Don't reference prom_bussoft_ptr | 375 | * Generic bus fixup goes here. Don't reference prom_bussoft_ptr |
372 | * after this point. | 376 | * after this point. |
373 | */ | 377 | */ |
374 | 378 | ||
375 | bus->sysdata = controller; | ||
376 | PCI_CONTROLLER(bus)->platform_data = provider_soft; | 379 | PCI_CONTROLLER(bus)->platform_data = provider_soft; |
377 | nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); | 380 | nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); |
378 | cnode = nasid_to_cnodeid(nasid); | 381 | cnode = nasid_to_cnodeid(nasid); |
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 7772951df313..7622d4ec5f08 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -269,7 +269,7 @@ config NR_CPUS | |||
269 | # Common NUMA Features | 269 | # Common NUMA Features |
270 | config NUMA | 270 | config NUMA |
271 | bool "Numa Memory Allocation Support" | 271 | bool "Numa Memory Allocation Support" |
272 | depends on SMP | 272 | depends on SMP && BROKEN |
273 | default n | 273 | default n |
274 | 274 | ||
275 | # turning this on wastes a bunch of space. | 275 | # turning this on wastes a bunch of space. |
@@ -286,6 +286,7 @@ menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)" | |||
286 | 286 | ||
287 | config PCI | 287 | config PCI |
288 | bool "PCI support" | 288 | bool "PCI support" |
289 | depends on BROKEN | ||
289 | default n | 290 | default n |
290 | help | 291 | help |
291 | Find out whether you have a PCI motherboard. PCI is the name of a | 292 | Find out whether you have a PCI motherboard. PCI is the name of a |
diff --git a/arch/m32r/Kconfig.debug b/arch/m32r/Kconfig.debug index 31039723804f..bbf711bab69e 100644 --- a/arch/m32r/Kconfig.debug +++ b/arch/m32r/Kconfig.debug | |||
@@ -20,7 +20,7 @@ config DEBUG_STACK_USAGE | |||
20 | 20 | ||
21 | config DEBUG_PAGEALLOC | 21 | config DEBUG_PAGEALLOC |
22 | bool "Page alloc debugging" | 22 | bool "Page alloc debugging" |
23 | depends on DEBUG_KERNEL | 23 | depends on DEBUG_KERNEL && BROKEN |
24 | help | 24 | help |
25 | Unmap pages from the kernel linear mapping after free_pages(). | 25 | Unmap pages from the kernel linear mapping after free_pages(). |
26 | This results in a large slowdown, but helps to find certain types | 26 | This results in a large slowdown, but helps to find certain types |
diff --git a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c index a146b24a556b..708634b685e4 100644 --- a/arch/m32r/kernel/setup_m32700ut.c +++ b/arch/m32r/kernel/setup_m32700ut.c | |||
@@ -30,9 +30,11 @@ | |||
30 | typedef struct { | 30 | typedef struct { |
31 | unsigned long icucr; /* ICU Control Register */ | 31 | unsigned long icucr; /* ICU Control Register */ |
32 | } icu_data_t; | 32 | } icu_data_t; |
33 | static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; | ||
34 | #else | ||
35 | icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; | ||
33 | #endif /* CONFIG_SMP */ | 36 | #endif /* CONFIG_SMP */ |
34 | 37 | ||
35 | static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; | ||
36 | 38 | ||
37 | static void disable_m32700ut_irq(unsigned int irq) | 39 | static void disable_m32700ut_irq(unsigned int irq) |
38 | { | 40 | { |
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c index f0301f58bcce..d7b7ec6d30f8 100644 --- a/arch/m32r/kernel/setup_opsput.c +++ b/arch/m32r/kernel/setup_opsput.c | |||
@@ -31,9 +31,11 @@ | |||
31 | typedef struct { | 31 | typedef struct { |
32 | unsigned long icucr; /* ICU Control Register */ | 32 | unsigned long icucr; /* ICU Control Register */ |
33 | } icu_data_t; | 33 | } icu_data_t; |
34 | static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; | ||
35 | #else | ||
36 | icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; | ||
34 | #endif /* CONFIG_SMP */ | 37 | #endif /* CONFIG_SMP */ |
35 | 38 | ||
36 | static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; | ||
37 | 39 | ||
38 | static void disable_opsput_irq(unsigned int irq) | 40 | static void disable_opsput_irq(unsigned int irq) |
39 | { | 41 | { |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index f9a0e723478d..640d592ea072 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -91,6 +91,7 @@ extern struct { | |||
91 | 91 | ||
92 | /* which physical physical ID maps to which logical CPU number */ | 92 | /* which physical physical ID maps to which logical CPU number */ |
93 | static volatile int physid_2_cpu[NR_CPUS]; | 93 | static volatile int physid_2_cpu[NR_CPUS]; |
94 | #define physid_to_cpu(physid) physid_2_cpu[physid] | ||
94 | 95 | ||
95 | /* which logical CPU number maps to which physical ID */ | 96 | /* which logical CPU number maps to which physical ID */ |
96 | volatile int cpu_2_physid[NR_CPUS]; | 97 | volatile int cpu_2_physid[NR_CPUS]; |
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index 3c4707280a52..8a2b77bc5749 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c | |||
@@ -205,8 +205,7 @@ static long last_rtc_update = 0; | |||
205 | * timer_interrupt() needs to keep up the real-time clock, | 205 | * timer_interrupt() needs to keep up the real-time clock, |
206 | * as well as call the "do_timer()" routine every clocktick | 206 | * as well as call the "do_timer()" routine every clocktick |
207 | */ | 207 | */ |
208 | static inline void | 208 | irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) |
209 | do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | ||
210 | { | 209 | { |
211 | #ifndef CONFIG_SMP | 210 | #ifndef CONFIG_SMP |
212 | profile_tick(CPU_PROFILING, regs); | 211 | profile_tick(CPU_PROFILING, regs); |
@@ -221,6 +220,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
221 | * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be | 220 | * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be |
222 | * called as close as possible to 500 ms before the new second starts. | 221 | * called as close as possible to 500 ms before the new second starts. |
223 | */ | 222 | */ |
223 | write_seqlock(&xtime_lock); | ||
224 | if ((time_status & STA_UNSYNC) == 0 | 224 | if ((time_status & STA_UNSYNC) == 0 |
225 | && xtime.tv_sec > last_rtc_update + 660 | 225 | && xtime.tv_sec > last_rtc_update + 660 |
226 | && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2 | 226 | && (xtime.tv_nsec / 1000) >= 500000 - ((unsigned)TICK_SIZE) / 2 |
@@ -231,6 +231,7 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
231 | else /* do it again in 60 s */ | 231 | else /* do it again in 60 s */ |
232 | last_rtc_update = xtime.tv_sec - 600; | 232 | last_rtc_update = xtime.tv_sec - 600; |
233 | } | 233 | } |
234 | write_sequnlock(&xtime_lock); | ||
234 | /* As we return to user mode fire off the other CPU schedulers.. | 235 | /* As we return to user mode fire off the other CPU schedulers.. |
235 | this is basically because we don't yet share IRQ's around. | 236 | this is basically because we don't yet share IRQ's around. |
236 | This message is rigged to be safe on the 386 - basically it's | 237 | This message is rigged to be safe on the 386 - basically it's |
@@ -238,14 +239,8 @@ do_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
238 | 239 | ||
239 | #ifdef CONFIG_SMP | 240 | #ifdef CONFIG_SMP |
240 | smp_local_timer_interrupt(regs); | 241 | smp_local_timer_interrupt(regs); |
242 | smp_send_timer(); | ||
241 | #endif | 243 | #endif |
242 | } | ||
243 | |||
244 | irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | ||
245 | { | ||
246 | write_seqlock(&xtime_lock); | ||
247 | do_timer_interrupt(irq, NULL, regs); | ||
248 | write_sequnlock(&xtime_lock); | ||
249 | 244 | ||
250 | return IRQ_HANDLED; | 245 | return IRQ_HANDLED; |
251 | } | 246 | } |
diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c index c871b4606b07..ddb16a83a8ce 100644 --- a/arch/m32r/lib/csum_partial_copy.c +++ b/arch/m32r/lib/csum_partial_copy.c | |||
@@ -58,3 +58,4 @@ csum_partial_copy_from_user (const unsigned char __user *src, | |||
58 | return csum_partial(dst, len-missing, sum); | 58 | return csum_partial(dst, len-missing, sum); |
59 | } | 59 | } |
60 | EXPORT_SYMBOL(csum_partial_copy_from_user); | 60 | EXPORT_SYMBOL(csum_partial_copy_from_user); |
61 | EXPORT_SYMBOL(csum_partial); | ||
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c index 1d1a01e54b3f..08e727955555 100644 --- a/arch/m32r/mm/discontig.c +++ b/arch/m32r/mm/discontig.c | |||
@@ -12,12 +12,14 @@ | |||
12 | #include <linux/mmzone.h> | 12 | #include <linux/mmzone.h> |
13 | #include <linux/initrd.h> | 13 | #include <linux/initrd.h> |
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/module.h> | ||
15 | 16 | ||
16 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
17 | 18 | ||
18 | extern char _end[]; | 19 | extern char _end[]; |
19 | 20 | ||
20 | struct pglist_data *node_data[MAX_NUMNODES]; | 21 | struct pglist_data *node_data[MAX_NUMNODES]; |
22 | EXPORT_SYMBOL(node_data); | ||
21 | static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata; | 23 | static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata; |
22 | 24 | ||
23 | pg_data_t m32r_node_data[MAX_NUMNODES]; | 25 | pg_data_t m32r_node_data[MAX_NUMNODES]; |
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index ac48b6d2aff6..aec15270d334 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c | |||
@@ -160,13 +160,13 @@ good_area: | |||
160 | printk("handle_mm_fault returns %d\n",fault); | 160 | printk("handle_mm_fault returns %d\n",fault); |
161 | #endif | 161 | #endif |
162 | switch (fault) { | 162 | switch (fault) { |
163 | case 1: | 163 | case VM_FAULT_MINOR: |
164 | current->min_flt++; | 164 | current->min_flt++; |
165 | break; | 165 | break; |
166 | case 2: | 166 | case VM_FAULT_MAJOR: |
167 | current->maj_flt++; | 167 | current->maj_flt++; |
168 | break; | 168 | break; |
169 | case 0: | 169 | case VM_FAULT_SIGBUS: |
170 | goto bus_err; | 170 | goto bus_err; |
171 | default: | 171 | default: |
172 | goto out_of_memory; | 172 | goto out_of_memory; |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index eaa701479f5f..0ad945d4c0a4 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -178,17 +178,17 @@ good_area: | |||
178 | */ | 178 | */ |
179 | 179 | ||
180 | switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { | 180 | switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { |
181 | case 1: | 181 | case VM_FAULT_MINOR: |
182 | ++current->min_flt; | 182 | ++current->min_flt; |
183 | break; | 183 | break; |
184 | case 2: | 184 | case VM_FAULT_MAJOR: |
185 | ++current->maj_flt; | 185 | ++current->maj_flt; |
186 | break; | 186 | break; |
187 | case 0: | 187 | case VM_FAULT_SIGBUS: |
188 | /* | 188 | /* |
189 | * We ran out of memory, or some other thing happened | 189 | * We hit a hared mapping outside of the file, or some |
190 | * to us that made us unable to handle the page fault | 190 | * other thing happened to us that made us unable to |
191 | * gracefully. | 191 | * handle the page fault gracefully. |
192 | */ | 192 | */ |
193 | goto bad_area; | 193 | goto bad_area; |
194 | default: | 194 | default: |
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig index 9e2227ec3b34..57dacf978532 100644 --- a/arch/ppc/8xx_io/Kconfig +++ b/arch/ppc/8xx_io/Kconfig | |||
@@ -69,9 +69,9 @@ config FEC_QS6612 | |||
69 | 69 | ||
70 | config ENET_BIG_BUFFERS | 70 | config ENET_BIG_BUFFERS |
71 | bool "Use Big CPM Ethernet Buffers" | 71 | bool "Use Big CPM Ethernet Buffers" |
72 | depends on NET_ETHERNET | 72 | depends on SCC_ENET || FEC_ENET |
73 | help | 73 | help |
74 | Allocate large buffers for MPC8xx Etherenet. Increases throughput | 74 | Allocate large buffers for MPC8xx Ethernet. Increases throughput |
75 | and decreases the likelihood of dropped packets, but costs memory. | 75 | and decreases the likelihood of dropped packets, but costs memory. |
76 | 76 | ||
77 | config HTDMSOUND | 77 | config HTDMSOUND |
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 0cc2e7a9cb11..11726e2a4ec8 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c | |||
@@ -39,8 +39,6 @@ | |||
39 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
40 | #include <asm/rheap.h> | 40 | #include <asm/rheap.h> |
41 | 41 | ||
42 | extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); | ||
43 | |||
44 | static void m8xx_cpm_dpinit(void); | 42 | static void m8xx_cpm_dpinit(void); |
45 | static uint host_buffer; /* One page of host buffer */ | 43 | static uint host_buffer; /* One page of host buffer */ |
46 | static uint host_end; /* end + 1 */ | 44 | static uint host_end; /* end + 1 */ |
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = { | |||
108 | .end = cpm_eoi, | 106 | .end = cpm_eoi, |
109 | }; | 107 | }; |
110 | 108 | ||
111 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); | ||
112 | |||
113 | void | 109 | void |
114 | m8xx_cpm_reset(uint bootpage) | 110 | m8xx_cpm_reset(void) |
115 | { | 111 | { |
116 | volatile immap_t *imp; | 112 | volatile immap_t *imp; |
117 | volatile cpm8xx_t *commproc; | 113 | volatile cpm8xx_t *commproc; |
118 | pte_t *pte; | ||
119 | 114 | ||
120 | imp = (immap_t *)IMAP_ADDR; | 115 | imp = (immap_t *)IMAP_ADDR; |
121 | commproc = (cpm8xx_t *)&imp->im_cpm; | 116 | commproc = (cpm8xx_t *)&imp->im_cpm; |
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage) | |||
143 | /* Reclaim the DP memory for our use. */ | 138 | /* Reclaim the DP memory for our use. */ |
144 | m8xx_cpm_dpinit(); | 139 | m8xx_cpm_dpinit(); |
145 | 140 | ||
146 | /* get the PTE for the bootpage */ | ||
147 | if (!get_pteptr(&init_mm, bootpage, &pte)) | ||
148 | panic("get_pteptr failed\n"); | ||
149 | |||
150 | /* and make it uncachable */ | ||
151 | pte_val(*pte) |= _PAGE_NO_CACHE; | ||
152 | _tlbie(bootpage); | ||
153 | |||
154 | host_buffer = bootpage; | ||
155 | host_end = host_buffer + PAGE_SIZE; | ||
156 | |||
157 | /* Tell everyone where the comm processor resides. | 141 | /* Tell everyone where the comm processor resides. |
158 | */ | 142 | */ |
159 | cpmp = (cpm8xx_t *)commproc; | 143 | cpmp = (cpm8xx_t *)commproc; |
@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info; | |||
384 | 368 | ||
385 | void m8xx_cpm_dpinit(void) | 369 | void m8xx_cpm_dpinit(void) |
386 | { | 370 | { |
387 | cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm; | ||
388 | |||
389 | spin_lock_init(&cpm_dpmem_lock); | 371 | spin_lock_init(&cpm_dpmem_lock); |
390 | 372 | ||
391 | /* Initialize the info header */ | 373 | /* Initialize the info header */ |
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 0730392dcc20..62f68d6181c6 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c | |||
@@ -173,7 +173,7 @@ struct fec_enet_private { | |||
173 | uint phy_status; | 173 | uint phy_status; |
174 | uint phy_speed; | 174 | uint phy_speed; |
175 | phy_info_t *phy; | 175 | phy_info_t *phy; |
176 | struct tq_struct phy_task; | 176 | struct work_struct phy_task; |
177 | 177 | ||
178 | uint sequence_done; | 178 | uint sequence_done; |
179 | 179 | ||
@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
199 | #ifdef CONFIG_USE_MDIO | 199 | #ifdef CONFIG_USE_MDIO |
200 | static void fec_enet_mii(struct net_device *dev); | 200 | static void fec_enet_mii(struct net_device *dev); |
201 | #endif /* CONFIG_USE_MDIO */ | 201 | #endif /* CONFIG_USE_MDIO */ |
202 | static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); | 202 | static irqreturn_t fec_enet_interrupt(int irq, void * dev_id, |
203 | struct pt_regs * regs); | ||
203 | #ifdef CONFIG_FEC_PACKETHOOK | 204 | #ifdef CONFIG_FEC_PACKETHOOK |
204 | static void fec_enet_tx(struct net_device *dev, __u32 regval); | 205 | static void fec_enet_tx(struct net_device *dev, __u32 regval); |
205 | static void fec_enet_rx(struct net_device *dev, __u32 regval); | 206 | static void fec_enet_rx(struct net_device *dev, __u32 regval); |
@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev) | |||
471 | /* The interrupt handler. | 472 | /* The interrupt handler. |
472 | * This is called from the MPC core interrupt. | 473 | * This is called from the MPC core interrupt. |
473 | */ | 474 | */ |
474 | static void | 475 | static irqreturn_t |
475 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 476 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
476 | { | 477 | { |
477 | struct net_device *dev = dev_id; | 478 | struct net_device *dev = dev_id; |
@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO | |||
525 | } | 526 | } |
526 | 527 | ||
527 | } | 528 | } |
529 | return IRQ_RETVAL(IRQ_HANDLED); | ||
528 | } | 530 | } |
529 | 531 | ||
530 | 532 | ||
@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev) | |||
1263 | printk(".\n"); | 1265 | printk(".\n"); |
1264 | } | 1266 | } |
1265 | 1267 | ||
1266 | static void mii_display_config(struct net_device *dev) | 1268 | static void mii_display_config(void *priv) |
1267 | { | 1269 | { |
1270 | struct net_device *dev = (struct net_device *)priv; | ||
1268 | struct fec_enet_private *fep = dev->priv; | 1271 | struct fec_enet_private *fep = dev->priv; |
1269 | volatile uint *s = &(fep->phy_status); | 1272 | volatile uint *s = &(fep->phy_status); |
1270 | 1273 | ||
@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev) | |||
1294 | fep->sequence_done = 1; | 1297 | fep->sequence_done = 1; |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | static void mii_relink(struct net_device *dev) | 1300 | static void mii_relink(void *priv) |
1298 | { | 1301 | { |
1302 | struct net_device *dev = (struct net_device *)priv; | ||
1299 | struct fec_enet_private *fep = dev->priv; | 1303 | struct fec_enet_private *fep = dev->priv; |
1300 | int duplex; | 1304 | int duplex; |
1301 | 1305 | ||
@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) | |||
1323 | { | 1327 | { |
1324 | struct fec_enet_private *fep = dev->priv; | 1328 | struct fec_enet_private *fep = dev->priv; |
1325 | 1329 | ||
1326 | fep->phy_task.routine = (void *)mii_relink; | 1330 | INIT_WORK(&fep->phy_task, mii_relink, (void *)dev); |
1327 | fep->phy_task.data = dev; | 1331 | schedule_work(&fep->phy_task); |
1328 | schedule_task(&fep->phy_task); | ||
1329 | } | 1332 | } |
1330 | 1333 | ||
1331 | static void mii_queue_config(uint mii_reg, struct net_device *dev) | 1334 | static void mii_queue_config(uint mii_reg, struct net_device *dev) |
1332 | { | 1335 | { |
1333 | struct fec_enet_private *fep = dev->priv; | 1336 | struct fec_enet_private *fep = dev->priv; |
1334 | 1337 | ||
1335 | fep->phy_task.routine = (void *)mii_display_config; | 1338 | INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev); |
1336 | fep->phy_task.data = dev; | 1339 | schedule_work(&fep->phy_task); |
1337 | schedule_task(&fep->phy_task); | ||
1338 | } | 1340 | } |
1339 | 1341 | ||
1340 | 1342 | ||
@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
1403 | 1405 | ||
1404 | /* This interrupt occurs when the PHY detects a link change. | 1406 | /* This interrupt occurs when the PHY detects a link change. |
1405 | */ | 1407 | */ |
1406 | static void | 1408 | static |
1407 | #ifdef CONFIG_RPXCLASSIC | 1409 | #ifdef CONFIG_RPXCLASSIC |
1408 | mii_link_interrupt(void *dev_id) | 1410 | void mii_link_interrupt(void *dev_id) |
1409 | #else | 1411 | #else |
1410 | mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 1412 | irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
1411 | #endif | 1413 | #endif |
1412 | { | 1414 | { |
1413 | #ifdef CONFIG_USE_MDIO | 1415 | #ifdef CONFIG_USE_MDIO |
@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | |||
1440 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); | 1442 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); |
1441 | #endif /* CONFIG_USE_MDIO */ | 1443 | #endif /* CONFIG_USE_MDIO */ |
1442 | 1444 | ||
1445 | #ifndef CONFIG_RPXCLASSIC | ||
1446 | return IRQ_RETVAL(IRQ_HANDLED); | ||
1447 | #endif /* CONFIG_RPXCLASSIC */ | ||
1443 | } | 1448 | } |
1444 | 1449 | ||
1445 | static int | 1450 | static int |
@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void) | |||
1575 | struct fec_enet_private *fep; | 1580 | struct fec_enet_private *fep; |
1576 | int i, j, k, err; | 1581 | int i, j, k, err; |
1577 | unsigned char *eap, *iap, *ba; | 1582 | unsigned char *eap, *iap, *ba; |
1578 | unsigned long mem_addr; | 1583 | dma_addr_t mem_addr; |
1579 | volatile cbd_t *bdp; | 1584 | volatile cbd_t *bdp; |
1580 | cbd_t *cbd_base; | 1585 | cbd_t *cbd_base; |
1581 | volatile immap_t *immap; | 1586 | volatile immap_t *immap; |
@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void) | |||
1640 | printk("FEC initialization failed.\n"); | 1645 | printk("FEC initialization failed.\n"); |
1641 | return 1; | 1646 | return 1; |
1642 | } | 1647 | } |
1643 | cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1648 | cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE, |
1649 | &mem_addr, GFP_KERNEL); | ||
1644 | 1650 | ||
1645 | /* Set receive and transmit descriptor base. | 1651 | /* Set receive and transmit descriptor base. |
1646 | */ | 1652 | */ |
@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void) | |||
1657 | 1663 | ||
1658 | /* Allocate a page. | 1664 | /* Allocate a page. |
1659 | */ | 1665 | */ |
1660 | ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1666 | ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev, |
1667 | PAGE_SIZE, | ||
1668 | &mem_addr, | ||
1669 | GFP_KERNEL); | ||
1661 | /* BUG: no check for failure */ | 1670 | /* BUG: no check for failure */ |
1662 | 1671 | ||
1663 | /* Initialize the BD for every fragment in the page. | 1672 | /* Initialize the BD for every fragment in the page. |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 2c2da9b43b7a..e6fa1d1cc03a 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -558,6 +558,7 @@ config PPC_MULTIPLATFORM | |||
558 | 558 | ||
559 | config APUS | 559 | config APUS |
560 | bool "Amiga-APUS" | 560 | bool "Amiga-APUS" |
561 | depends on BROKEN | ||
561 | help | 562 | help |
562 | Select APUS if configuring for a PowerUP Amiga. | 563 | Select APUS if configuring for a PowerUP Amiga. |
563 | More information is available at: | 564 | More information is available at: |
@@ -647,6 +648,7 @@ config PAL4 | |||
647 | 648 | ||
648 | config GEMINI | 649 | config GEMINI |
649 | bool "Synergy-Gemini" | 650 | bool "Synergy-Gemini" |
651 | depends on BROKEN | ||
650 | help | 652 | help |
651 | Select Gemini if configuring for a Synergy Microsystems' Gemini | 653 | Select Gemini if configuring for a Synergy Microsystems' Gemini |
652 | series Single Board Computer. More information is available at: | 654 | series Single Board Computer. More information is available at: |
@@ -909,6 +911,7 @@ config PPCBUG_NVRAM | |||
909 | default y if PPC_PREP | 911 | default y if PPC_PREP |
910 | 912 | ||
911 | config SMP | 913 | config SMP |
914 | depends on PPC_STD_MMU | ||
912 | bool "Symmetric multi-processing support" | 915 | bool "Symmetric multi-processing support" |
913 | ---help--- | 916 | ---help--- |
914 | This enables support for systems with more than one CPU. If you have | 917 | This enables support for systems with more than one CPU. If you have |
@@ -928,7 +931,7 @@ config SMP | |||
928 | 931 | ||
929 | config IRQ_ALL_CPUS | 932 | config IRQ_ALL_CPUS |
930 | bool "Distribute interrupts on all CPUs by default" | 933 | bool "Distribute interrupts on all CPUs by default" |
931 | depends on SMP | 934 | depends on SMP && !MV64360 |
932 | help | 935 | help |
933 | This option gives the kernel permission to distribute IRQs across | 936 | This option gives the kernel permission to distribute IRQs across |
934 | multiple CPUs. Saying N here will route all IRQs to the first | 937 | multiple CPUs. Saying N here will route all IRQs to the first |
@@ -1119,7 +1122,9 @@ config PROC_HARDWARE | |||
1119 | 1122 | ||
1120 | source "drivers/zorro/Kconfig" | 1123 | source "drivers/zorro/Kconfig" |
1121 | 1124 | ||
1125 | if !44x || BROKEN | ||
1122 | source kernel/power/Kconfig | 1126 | source kernel/power/Kconfig |
1127 | endif | ||
1123 | 1128 | ||
1124 | config SECCOMP | 1129 | config SECCOMP |
1125 | bool "Enable seccomp to safely compute untrusted bytecode" | 1130 | bool "Enable seccomp to safely compute untrusted bytecode" |
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index 991b4cbb83c8..d4dc4fa79647 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile | |||
@@ -61,6 +61,12 @@ zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE | |||
61 | end-$(CONFIG_EMBEDDEDBOOT) := embedded | 61 | end-$(CONFIG_EMBEDDEDBOOT) := embedded |
62 | misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o | 62 | misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o |
63 | 63 | ||
64 | zimage-$(CONFIG_BAMBOO) := zImage-TREE | ||
65 | zimageinitrd-$(CONFIG_BAMBOO) := zImage.initrd-TREE | ||
66 | end-$(CONFIG_BAMBOO) := bamboo | ||
67 | entrypoint-$(CONFIG_BAMBOO) := 0x01000000 | ||
68 | extra.o-$(CONFIG_BAMBOO) := pibs.o | ||
69 | |||
64 | zimage-$(CONFIG_EBONY) := zImage-TREE | 70 | zimage-$(CONFIG_EBONY) := zImage-TREE |
65 | zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE | 71 | zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE |
66 | end-$(CONFIG_EBONY) := ebony | 72 | end-$(CONFIG_EBONY) := ebony |
diff --git a/arch/ppc/boot/simple/pibs.c b/arch/ppc/boot/simple/pibs.c index 1348740e503f..67222d57c345 100644 --- a/arch/ppc/boot/simple/pibs.c +++ b/arch/ppc/boot/simple/pibs.c | |||
@@ -91,9 +91,11 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, | |||
91 | 91 | ||
92 | mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); | 92 | mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); |
93 | memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); | 93 | memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); |
94 | #ifdef CONFIG_440GX | 94 | #if defined(CONFIG_440GX) || defined(CONFIG_440EP) |
95 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); | 95 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); |
96 | memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); | 96 | memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); |
97 | #endif | ||
98 | #ifdef CONFIG_440GX | ||
97 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); | 99 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); |
98 | memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); | 100 | memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); |
99 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); | 101 | mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); |
diff --git a/arch/ppc/configs/bamboo_defconfig b/arch/ppc/configs/bamboo_defconfig new file mode 100644 index 000000000000..0ba4e70d50b6 --- /dev/null +++ b/arch/ppc/configs/bamboo_defconfig | |||
@@ -0,0 +1,943 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.12 | ||
4 | # Tue Jun 28 15:24:25 2005 | ||
5 | # | ||
6 | CONFIG_MMU=y | ||
7 | CONFIG_GENERIC_HARDIRQS=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
10 | CONFIG_HAVE_DEC_LOCK=y | ||
11 | CONFIG_PPC=y | ||
12 | CONFIG_PPC32=y | ||
13 | CONFIG_GENERIC_NVRAM=y | ||
14 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | ||
15 | |||
16 | # | ||
17 | # Code maturity level options | ||
18 | # | ||
19 | CONFIG_EXPERIMENTAL=y | ||
20 | CONFIG_CLEAN_COMPILE=y | ||
21 | CONFIG_BROKEN_ON_SMP=y | ||
22 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
23 | |||
24 | # | ||
25 | # General setup | ||
26 | # | ||
27 | CONFIG_LOCALVERSION="" | ||
28 | CONFIG_SWAP=y | ||
29 | CONFIG_SYSVIPC=y | ||
30 | # CONFIG_POSIX_MQUEUE is not set | ||
31 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
32 | CONFIG_SYSCTL=y | ||
33 | # CONFIG_AUDIT is not set | ||
34 | # CONFIG_HOTPLUG is not set | ||
35 | CONFIG_KOBJECT_UEVENT=y | ||
36 | # CONFIG_IKCONFIG is not set | ||
37 | CONFIG_EMBEDDED=y | ||
38 | CONFIG_KALLSYMS=y | ||
39 | # CONFIG_KALLSYMS_ALL is not set | ||
40 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
41 | CONFIG_PRINTK=y | ||
42 | CONFIG_BUG=y | ||
43 | CONFIG_BASE_FULL=y | ||
44 | CONFIG_FUTEX=y | ||
45 | CONFIG_EPOLL=y | ||
46 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
47 | CONFIG_SHMEM=y | ||
48 | CONFIG_CC_ALIGN_FUNCTIONS=0 | ||
49 | CONFIG_CC_ALIGN_LABELS=0 | ||
50 | CONFIG_CC_ALIGN_LOOPS=0 | ||
51 | CONFIG_CC_ALIGN_JUMPS=0 | ||
52 | # CONFIG_TINY_SHMEM is not set | ||
53 | CONFIG_BASE_SMALL=0 | ||
54 | |||
55 | # | ||
56 | # Loadable module support | ||
57 | # | ||
58 | CONFIG_MODULES=y | ||
59 | CONFIG_MODULE_UNLOAD=y | ||
60 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
61 | CONFIG_OBSOLETE_MODPARM=y | ||
62 | # CONFIG_MODVERSIONS is not set | ||
63 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
64 | CONFIG_KMOD=y | ||
65 | |||
66 | # | ||
67 | # Processor | ||
68 | # | ||
69 | # CONFIG_6xx is not set | ||
70 | # CONFIG_40x is not set | ||
71 | CONFIG_44x=y | ||
72 | # CONFIG_POWER3 is not set | ||
73 | # CONFIG_POWER4 is not set | ||
74 | # CONFIG_8xx is not set | ||
75 | # CONFIG_E200 is not set | ||
76 | # CONFIG_E500 is not set | ||
77 | CONFIG_PPC_FPU=y | ||
78 | CONFIG_BOOKE=y | ||
79 | CONFIG_PTE_64BIT=y | ||
80 | CONFIG_PHYS_64BIT=y | ||
81 | # CONFIG_MATH_EMULATION is not set | ||
82 | # CONFIG_KEXEC is not set | ||
83 | # CONFIG_CPU_FREQ is not set | ||
84 | CONFIG_4xx=y | ||
85 | |||
86 | # | ||
87 | # IBM 4xx options | ||
88 | # | ||
89 | CONFIG_BAMBOO=y | ||
90 | # CONFIG_EBONY is not set | ||
91 | # CONFIG_LUAN is not set | ||
92 | # CONFIG_OCOTEA is not set | ||
93 | CONFIG_440EP=y | ||
94 | CONFIG_440=y | ||
95 | CONFIG_IBM440EP_ERR42=y | ||
96 | CONFIG_IBM_OCP=y | ||
97 | # CONFIG_PPC4xx_DMA is not set | ||
98 | CONFIG_PPC_GEN550=y | ||
99 | # CONFIG_PM is not set | ||
100 | CONFIG_NOT_COHERENT_CACHE=y | ||
101 | |||
102 | # | ||
103 | # Platform options | ||
104 | # | ||
105 | # CONFIG_PC_KEYBOARD is not set | ||
106 | # CONFIG_SMP is not set | ||
107 | # CONFIG_PREEMPT is not set | ||
108 | # CONFIG_HIGHMEM is not set | ||
109 | CONFIG_SELECT_MEMORY_MODEL=y | ||
110 | CONFIG_FLATMEM_MANUAL=y | ||
111 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
112 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
113 | CONFIG_FLATMEM=y | ||
114 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
115 | CONFIG_BINFMT_ELF=y | ||
116 | # CONFIG_BINFMT_MISC is not set | ||
117 | CONFIG_CMDLINE_BOOL=y | ||
118 | CONFIG_CMDLINE="ip=on" | ||
119 | CONFIG_SECCOMP=y | ||
120 | CONFIG_ISA_DMA_API=y | ||
121 | |||
122 | # | ||
123 | # Bus options | ||
124 | # | ||
125 | CONFIG_PCI=y | ||
126 | CONFIG_PCI_DOMAINS=y | ||
127 | # CONFIG_PCI_LEGACY_PROC is not set | ||
128 | # CONFIG_PCI_NAMES is not set | ||
129 | # CONFIG_PCI_DEBUG is not set | ||
130 | |||
131 | # | ||
132 | # PCCARD (PCMCIA/CardBus) support | ||
133 | # | ||
134 | # CONFIG_PCCARD is not set | ||
135 | |||
136 | # | ||
137 | # Advanced setup | ||
138 | # | ||
139 | # CONFIG_ADVANCED_OPTIONS is not set | ||
140 | |||
141 | # | ||
142 | # Default settings for advanced configuration options are used | ||
143 | # | ||
144 | CONFIG_HIGHMEM_START=0xfe000000 | ||
145 | CONFIG_LOWMEM_SIZE=0x30000000 | ||
146 | CONFIG_KERNEL_START=0xc0000000 | ||
147 | CONFIG_TASK_SIZE=0x80000000 | ||
148 | CONFIG_CONSISTENT_START=0xff100000 | ||
149 | CONFIG_CONSISTENT_SIZE=0x00200000 | ||
150 | CONFIG_BOOT_LOAD=0x01000000 | ||
151 | |||
152 | # | ||
153 | # Device Drivers | ||
154 | # | ||
155 | |||
156 | # | ||
157 | # Generic Driver Options | ||
158 | # | ||
159 | # CONFIG_STANDALONE is not set | ||
160 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
161 | # CONFIG_FW_LOADER is not set | ||
162 | # CONFIG_DEBUG_DRIVER is not set | ||
163 | |||
164 | # | ||
165 | # Memory Technology Devices (MTD) | ||
166 | # | ||
167 | # CONFIG_MTD is not set | ||
168 | |||
169 | # | ||
170 | # Parallel port support | ||
171 | # | ||
172 | # CONFIG_PARPORT is not set | ||
173 | |||
174 | # | ||
175 | # Plug and Play support | ||
176 | # | ||
177 | |||
178 | # | ||
179 | # Block devices | ||
180 | # | ||
181 | # CONFIG_BLK_DEV_FD is not set | ||
182 | # CONFIG_BLK_CPQ_DA is not set | ||
183 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
184 | # CONFIG_BLK_DEV_DAC960 is not set | ||
185 | # CONFIG_BLK_DEV_UMEM is not set | ||
186 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
187 | # CONFIG_BLK_DEV_LOOP is not set | ||
188 | # CONFIG_BLK_DEV_NBD is not set | ||
189 | # CONFIG_BLK_DEV_SX8 is not set | ||
190 | # CONFIG_BLK_DEV_UB is not set | ||
191 | # CONFIG_BLK_DEV_RAM is not set | ||
192 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
193 | CONFIG_INITRAMFS_SOURCE="" | ||
194 | # CONFIG_LBD is not set | ||
195 | # CONFIG_CDROM_PKTCDVD is not set | ||
196 | |||
197 | # | ||
198 | # IO Schedulers | ||
199 | # | ||
200 | CONFIG_IOSCHED_NOOP=y | ||
201 | CONFIG_IOSCHED_AS=y | ||
202 | CONFIG_IOSCHED_DEADLINE=y | ||
203 | CONFIG_IOSCHED_CFQ=y | ||
204 | # CONFIG_ATA_OVER_ETH is not set | ||
205 | |||
206 | # | ||
207 | # ATA/ATAPI/MFM/RLL support | ||
208 | # | ||
209 | CONFIG_IDE=y | ||
210 | CONFIG_BLK_DEV_IDE=y | ||
211 | |||
212 | # | ||
213 | # Please see Documentation/ide.txt for help/info on IDE drives | ||
214 | # | ||
215 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
216 | CONFIG_BLK_DEV_IDEDISK=y | ||
217 | # CONFIG_IDEDISK_MULTI_MODE is not set | ||
218 | # CONFIG_BLK_DEV_IDECD is not set | ||
219 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
220 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
221 | # CONFIG_BLK_DEV_IDESCSI is not set | ||
222 | # CONFIG_IDE_TASK_IOCTL is not set | ||
223 | |||
224 | # | ||
225 | # IDE chipset support/bugfixes | ||
226 | # | ||
227 | CONFIG_IDE_GENERIC=y | ||
228 | CONFIG_BLK_DEV_IDEPCI=y | ||
229 | # CONFIG_IDEPCI_SHARE_IRQ is not set | ||
230 | # CONFIG_BLK_DEV_OFFBOARD is not set | ||
231 | # CONFIG_BLK_DEV_GENERIC is not set | ||
232 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
233 | # CONFIG_BLK_DEV_SL82C105 is not set | ||
234 | CONFIG_BLK_DEV_IDEDMA_PCI=y | ||
235 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | ||
236 | # CONFIG_IDEDMA_PCI_AUTO is not set | ||
237 | # CONFIG_BLK_DEV_AEC62XX is not set | ||
238 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
239 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
240 | CONFIG_BLK_DEV_CMD64X=y | ||
241 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
242 | # CONFIG_BLK_DEV_CY82C693 is not set | ||
243 | # CONFIG_BLK_DEV_CS5520 is not set | ||
244 | # CONFIG_BLK_DEV_CS5530 is not set | ||
245 | # CONFIG_BLK_DEV_HPT34X is not set | ||
246 | # CONFIG_BLK_DEV_HPT366 is not set | ||
247 | # CONFIG_BLK_DEV_SC1200 is not set | ||
248 | # CONFIG_BLK_DEV_PIIX is not set | ||
249 | # CONFIG_BLK_DEV_IT821X is not set | ||
250 | # CONFIG_BLK_DEV_NS87415 is not set | ||
251 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
252 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
253 | # CONFIG_BLK_DEV_SVWKS is not set | ||
254 | # CONFIG_BLK_DEV_SIIMAGE is not set | ||
255 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
256 | # CONFIG_BLK_DEV_TRM290 is not set | ||
257 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
258 | # CONFIG_IDE_ARM is not set | ||
259 | CONFIG_BLK_DEV_IDEDMA=y | ||
260 | # CONFIG_IDEDMA_IVB is not set | ||
261 | # CONFIG_IDEDMA_AUTO is not set | ||
262 | # CONFIG_BLK_DEV_HD is not set | ||
263 | |||
264 | # | ||
265 | # SCSI device support | ||
266 | # | ||
267 | CONFIG_SCSI=y | ||
268 | CONFIG_SCSI_PROC_FS=y | ||
269 | |||
270 | # | ||
271 | # SCSI support type (disk, tape, CD-ROM) | ||
272 | # | ||
273 | # CONFIG_BLK_DEV_SD is not set | ||
274 | CONFIG_CHR_DEV_ST=y | ||
275 | # CONFIG_CHR_DEV_OSST is not set | ||
276 | # CONFIG_BLK_DEV_SR is not set | ||
277 | # CONFIG_CHR_DEV_SG is not set | ||
278 | # CONFIG_CHR_DEV_SCH is not set | ||
279 | |||
280 | # | ||
281 | # Some SCSI devices (e.g. CD jukebox) support multiple LUNs | ||
282 | # | ||
283 | # CONFIG_SCSI_MULTI_LUN is not set | ||
284 | # CONFIG_SCSI_CONSTANTS is not set | ||
285 | # CONFIG_SCSI_LOGGING is not set | ||
286 | |||
287 | # | ||
288 | # SCSI Transport Attributes | ||
289 | # | ||
290 | CONFIG_SCSI_SPI_ATTRS=y | ||
291 | # CONFIG_SCSI_FC_ATTRS is not set | ||
292 | # CONFIG_SCSI_ISCSI_ATTRS is not set | ||
293 | |||
294 | # | ||
295 | # SCSI low-level drivers | ||
296 | # | ||
297 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | ||
298 | # CONFIG_SCSI_3W_9XXX is not set | ||
299 | # CONFIG_SCSI_ACARD is not set | ||
300 | # CONFIG_SCSI_AACRAID is not set | ||
301 | # CONFIG_SCSI_AIC7XXX is not set | ||
302 | # CONFIG_SCSI_AIC7XXX_OLD is not set | ||
303 | # CONFIG_SCSI_AIC79XX is not set | ||
304 | # CONFIG_SCSI_DPT_I2O is not set | ||
305 | # CONFIG_MEGARAID_NEWGEN is not set | ||
306 | # CONFIG_MEGARAID_LEGACY is not set | ||
307 | # CONFIG_SCSI_SATA is not set | ||
308 | # CONFIG_SCSI_BUSLOGIC is not set | ||
309 | # CONFIG_SCSI_DMX3191D is not set | ||
310 | # CONFIG_SCSI_EATA is not set | ||
311 | # CONFIG_SCSI_FUTURE_DOMAIN is not set | ||
312 | # CONFIG_SCSI_GDTH is not set | ||
313 | # CONFIG_SCSI_IPS is not set | ||
314 | # CONFIG_SCSI_INITIO is not set | ||
315 | # CONFIG_SCSI_INIA100 is not set | ||
316 | CONFIG_SCSI_SYM53C8XX_2=y | ||
317 | CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 | ||
318 | CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 | ||
319 | CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 | ||
320 | # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set | ||
321 | # CONFIG_SCSI_IPR is not set | ||
322 | # CONFIG_SCSI_QLOGIC_FC is not set | ||
323 | # CONFIG_SCSI_QLOGIC_1280 is not set | ||
324 | CONFIG_SCSI_QLA2XXX=y | ||
325 | # CONFIG_SCSI_QLA21XX is not set | ||
326 | # CONFIG_SCSI_QLA22XX is not set | ||
327 | # CONFIG_SCSI_QLA2300 is not set | ||
328 | # CONFIG_SCSI_QLA2322 is not set | ||
329 | # CONFIG_SCSI_QLA6312 is not set | ||
330 | # CONFIG_SCSI_LPFC is not set | ||
331 | # CONFIG_SCSI_DC395x is not set | ||
332 | # CONFIG_SCSI_DC390T is not set | ||
333 | # CONFIG_SCSI_NSP32 is not set | ||
334 | # CONFIG_SCSI_DEBUG is not set | ||
335 | |||
336 | # | ||
337 | # Multi-device support (RAID and LVM) | ||
338 | # | ||
339 | # CONFIG_MD is not set | ||
340 | |||
341 | # | ||
342 | # Fusion MPT device support | ||
343 | # | ||
344 | # CONFIG_FUSION is not set | ||
345 | # CONFIG_FUSION_SPI is not set | ||
346 | # CONFIG_FUSION_FC is not set | ||
347 | |||
348 | # | ||
349 | # IEEE 1394 (FireWire) support | ||
350 | # | ||
351 | # CONFIG_IEEE1394 is not set | ||
352 | |||
353 | # | ||
354 | # I2O device support | ||
355 | # | ||
356 | # CONFIG_I2O is not set | ||
357 | |||
358 | # | ||
359 | # Macintosh device drivers | ||
360 | # | ||
361 | |||
362 | # | ||
363 | # Networking support | ||
364 | # | ||
365 | CONFIG_NET=y | ||
366 | |||
367 | # | ||
368 | # Networking options | ||
369 | # | ||
370 | CONFIG_PACKET=y | ||
371 | # CONFIG_PACKET_MMAP is not set | ||
372 | CONFIG_UNIX=y | ||
373 | # CONFIG_NET_KEY is not set | ||
374 | CONFIG_INET=y | ||
375 | # CONFIG_IP_MULTICAST is not set | ||
376 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
377 | CONFIG_IP_FIB_HASH=y | ||
378 | CONFIG_IP_PNP=y | ||
379 | # CONFIG_IP_PNP_DHCP is not set | ||
380 | CONFIG_IP_PNP_BOOTP=y | ||
381 | # CONFIG_IP_PNP_RARP is not set | ||
382 | # CONFIG_NET_IPIP is not set | ||
383 | # CONFIG_NET_IPGRE is not set | ||
384 | # CONFIG_ARPD is not set | ||
385 | # CONFIG_SYN_COOKIES is not set | ||
386 | # CONFIG_INET_AH is not set | ||
387 | # CONFIG_INET_ESP is not set | ||
388 | # CONFIG_INET_IPCOMP is not set | ||
389 | # CONFIG_INET_TUNNEL is not set | ||
390 | CONFIG_IP_TCPDIAG=y | ||
391 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
392 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
393 | CONFIG_TCP_CONG_BIC=y | ||
394 | |||
395 | # | ||
396 | # IP: Virtual Server Configuration | ||
397 | # | ||
398 | # CONFIG_IP_VS is not set | ||
399 | # CONFIG_IPV6 is not set | ||
400 | CONFIG_NETFILTER=y | ||
401 | # CONFIG_NETFILTER_DEBUG is not set | ||
402 | |||
403 | # | ||
404 | # IP: Netfilter Configuration | ||
405 | # | ||
406 | # CONFIG_IP_NF_CONNTRACK is not set | ||
407 | # CONFIG_IP_NF_CONNTRACK_MARK is not set | ||
408 | # CONFIG_IP_NF_QUEUE is not set | ||
409 | # CONFIG_IP_NF_IPTABLES is not set | ||
410 | # CONFIG_IP_NF_ARPTABLES is not set | ||
411 | |||
412 | # | ||
413 | # SCTP Configuration (EXPERIMENTAL) | ||
414 | # | ||
415 | # CONFIG_IP_SCTP is not set | ||
416 | # CONFIG_ATM is not set | ||
417 | # CONFIG_BRIDGE is not set | ||
418 | # CONFIG_VLAN_8021Q is not set | ||
419 | # CONFIG_DECNET is not set | ||
420 | # CONFIG_LLC2 is not set | ||
421 | # CONFIG_IPX is not set | ||
422 | # CONFIG_ATALK is not set | ||
423 | # CONFIG_X25 is not set | ||
424 | # CONFIG_LAPB is not set | ||
425 | # CONFIG_NET_DIVERT is not set | ||
426 | # CONFIG_ECONET is not set | ||
427 | # CONFIG_WAN_ROUTER is not set | ||
428 | |||
429 | # | ||
430 | # QoS and/or fair queueing | ||
431 | # | ||
432 | # CONFIG_NET_SCHED is not set | ||
433 | # CONFIG_NET_CLS_ROUTE is not set | ||
434 | |||
435 | # | ||
436 | # Network testing | ||
437 | # | ||
438 | # CONFIG_NET_PKTGEN is not set | ||
439 | # CONFIG_NETPOLL is not set | ||
440 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
441 | # CONFIG_HAMRADIO is not set | ||
442 | # CONFIG_IRDA is not set | ||
443 | # CONFIG_BT is not set | ||
444 | CONFIG_NETDEVICES=y | ||
445 | # CONFIG_DUMMY is not set | ||
446 | # CONFIG_BONDING is not set | ||
447 | # CONFIG_EQUALIZER is not set | ||
448 | # CONFIG_TUN is not set | ||
449 | |||
450 | # | ||
451 | # ARCnet devices | ||
452 | # | ||
453 | # CONFIG_ARCNET is not set | ||
454 | |||
455 | # | ||
456 | # Ethernet (10 or 100Mbit) | ||
457 | # | ||
458 | CONFIG_NET_ETHERNET=y | ||
459 | CONFIG_MII=y | ||
460 | # CONFIG_HAPPYMEAL is not set | ||
461 | # CONFIG_SUNGEM is not set | ||
462 | # CONFIG_NET_VENDOR_3COM is not set | ||
463 | |||
464 | # | ||
465 | # Tulip family network device support | ||
466 | # | ||
467 | # CONFIG_NET_TULIP is not set | ||
468 | # CONFIG_HP100 is not set | ||
469 | CONFIG_IBM_EMAC=y | ||
470 | # CONFIG_IBM_EMAC_ERRMSG is not set | ||
471 | CONFIG_IBM_EMAC_RXB=64 | ||
472 | CONFIG_IBM_EMAC_TXB=8 | ||
473 | CONFIG_IBM_EMAC_FGAP=8 | ||
474 | CONFIG_IBM_EMAC_SKBRES=0 | ||
475 | CONFIG_NET_PCI=y | ||
476 | # CONFIG_PCNET32 is not set | ||
477 | # CONFIG_AMD8111_ETH is not set | ||
478 | # CONFIG_ADAPTEC_STARFIRE is not set | ||
479 | # CONFIG_B44 is not set | ||
480 | # CONFIG_FORCEDETH is not set | ||
481 | # CONFIG_DGRS is not set | ||
482 | CONFIG_EEPRO100=y | ||
483 | # CONFIG_E100 is not set | ||
484 | # CONFIG_FEALNX is not set | ||
485 | CONFIG_NATSEMI=y | ||
486 | # CONFIG_NE2K_PCI is not set | ||
487 | # CONFIG_8139CP is not set | ||
488 | # CONFIG_8139TOO is not set | ||
489 | # CONFIG_SIS900 is not set | ||
490 | # CONFIG_EPIC100 is not set | ||
491 | # CONFIG_SUNDANCE is not set | ||
492 | # CONFIG_TLAN is not set | ||
493 | # CONFIG_VIA_RHINE is not set | ||
494 | |||
495 | # | ||
496 | # Ethernet (1000 Mbit) | ||
497 | # | ||
498 | # CONFIG_ACENIC is not set | ||
499 | # CONFIG_DL2K is not set | ||
500 | CONFIG_E1000=y | ||
501 | # CONFIG_E1000_NAPI is not set | ||
502 | # CONFIG_NS83820 is not set | ||
503 | # CONFIG_HAMACHI is not set | ||
504 | # CONFIG_YELLOWFIN is not set | ||
505 | # CONFIG_R8169 is not set | ||
506 | # CONFIG_SKGE is not set | ||
507 | # CONFIG_SK98LIN is not set | ||
508 | # CONFIG_VIA_VELOCITY is not set | ||
509 | # CONFIG_TIGON3 is not set | ||
510 | # CONFIG_BNX2 is not set | ||
511 | |||
512 | # | ||
513 | # Ethernet (10000 Mbit) | ||
514 | # | ||
515 | # CONFIG_IXGB is not set | ||
516 | # CONFIG_S2IO is not set | ||
517 | |||
518 | # | ||
519 | # Token Ring devices | ||
520 | # | ||
521 | # CONFIG_TR is not set | ||
522 | |||
523 | # | ||
524 | # Wireless LAN (non-hamradio) | ||
525 | # | ||
526 | # CONFIG_NET_RADIO is not set | ||
527 | |||
528 | # | ||
529 | # Wan interfaces | ||
530 | # | ||
531 | # CONFIG_WAN is not set | ||
532 | # CONFIG_FDDI is not set | ||
533 | # CONFIG_HIPPI is not set | ||
534 | # CONFIG_PPP is not set | ||
535 | # CONFIG_SLIP is not set | ||
536 | # CONFIG_NET_FC is not set | ||
537 | # CONFIG_SHAPER is not set | ||
538 | # CONFIG_NETCONSOLE is not set | ||
539 | |||
540 | # | ||
541 | # ISDN subsystem | ||
542 | # | ||
543 | # CONFIG_ISDN is not set | ||
544 | |||
545 | # | ||
546 | # Telephony Support | ||
547 | # | ||
548 | # CONFIG_PHONE is not set | ||
549 | |||
550 | # | ||
551 | # Input device support | ||
552 | # | ||
553 | CONFIG_INPUT=y | ||
554 | |||
555 | # | ||
556 | # Userland interfaces | ||
557 | # | ||
558 | CONFIG_INPUT_MOUSEDEV=y | ||
559 | CONFIG_INPUT_MOUSEDEV_PSAUX=y | ||
560 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
561 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
562 | # CONFIG_INPUT_JOYDEV is not set | ||
563 | # CONFIG_INPUT_TSDEV is not set | ||
564 | # CONFIG_INPUT_EVDEV is not set | ||
565 | # CONFIG_INPUT_EVBUG is not set | ||
566 | |||
567 | # | ||
568 | # Input Device Drivers | ||
569 | # | ||
570 | # CONFIG_INPUT_KEYBOARD is not set | ||
571 | # CONFIG_INPUT_MOUSE is not set | ||
572 | # CONFIG_INPUT_JOYSTICK is not set | ||
573 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
574 | # CONFIG_INPUT_MISC is not set | ||
575 | |||
576 | # | ||
577 | # Hardware I/O ports | ||
578 | # | ||
579 | CONFIG_SERIO=y | ||
580 | # CONFIG_SERIO_I8042 is not set | ||
581 | # CONFIG_SERIO_SERPORT is not set | ||
582 | # CONFIG_SERIO_PCIPS2 is not set | ||
583 | # CONFIG_SERIO_LIBPS2 is not set | ||
584 | # CONFIG_SERIO_RAW is not set | ||
585 | # CONFIG_GAMEPORT is not set | ||
586 | |||
587 | # | ||
588 | # Character devices | ||
589 | # | ||
590 | # CONFIG_VT is not set | ||
591 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
592 | |||
593 | # | ||
594 | # Serial drivers | ||
595 | # | ||
596 | CONFIG_SERIAL_8250=y | ||
597 | CONFIG_SERIAL_8250_CONSOLE=y | ||
598 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
599 | CONFIG_SERIAL_8250_EXTENDED=y | ||
600 | # CONFIG_SERIAL_8250_MANY_PORTS is not set | ||
601 | CONFIG_SERIAL_8250_SHARE_IRQ=y | ||
602 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set | ||
603 | # CONFIG_SERIAL_8250_RSA is not set | ||
604 | |||
605 | # | ||
606 | # Non-8250 serial port support | ||
607 | # | ||
608 | CONFIG_SERIAL_CORE=y | ||
609 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
610 | # CONFIG_SERIAL_JSM is not set | ||
611 | CONFIG_UNIX98_PTYS=y | ||
612 | CONFIG_LEGACY_PTYS=y | ||
613 | CONFIG_LEGACY_PTY_COUNT=256 | ||
614 | |||
615 | # | ||
616 | # IPMI | ||
617 | # | ||
618 | # CONFIG_IPMI_HANDLER is not set | ||
619 | |||
620 | # | ||
621 | # Watchdog Cards | ||
622 | # | ||
623 | # CONFIG_WATCHDOG is not set | ||
624 | # CONFIG_NVRAM is not set | ||
625 | # CONFIG_GEN_RTC is not set | ||
626 | # CONFIG_DTLK is not set | ||
627 | # CONFIG_R3964 is not set | ||
628 | # CONFIG_APPLICOM is not set | ||
629 | |||
630 | # | ||
631 | # Ftape, the floppy tape device driver | ||
632 | # | ||
633 | # CONFIG_AGP is not set | ||
634 | # CONFIG_DRM is not set | ||
635 | # CONFIG_RAW_DRIVER is not set | ||
636 | |||
637 | # | ||
638 | # TPM devices | ||
639 | # | ||
640 | # CONFIG_TCG_TPM is not set | ||
641 | |||
642 | # | ||
643 | # I2C support | ||
644 | # | ||
645 | # CONFIG_I2C is not set | ||
646 | |||
647 | # | ||
648 | # Dallas's 1-wire bus | ||
649 | # | ||
650 | # CONFIG_W1 is not set | ||
651 | |||
652 | # | ||
653 | # Misc devices | ||
654 | # | ||
655 | |||
656 | # | ||
657 | # Multimedia devices | ||
658 | # | ||
659 | # CONFIG_VIDEO_DEV is not set | ||
660 | |||
661 | # | ||
662 | # Digital Video Broadcasting Devices | ||
663 | # | ||
664 | # CONFIG_DVB is not set | ||
665 | |||
666 | # | ||
667 | # Graphics support | ||
668 | # | ||
669 | # CONFIG_FB is not set | ||
670 | |||
671 | # | ||
672 | # Sound | ||
673 | # | ||
674 | # CONFIG_SOUND is not set | ||
675 | |||
676 | # | ||
677 | # USB support | ||
678 | # | ||
679 | CONFIG_USB_ARCH_HAS_HCD=y | ||
680 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
681 | CONFIG_USB=y | ||
682 | CONFIG_USB_DEBUG=y | ||
683 | |||
684 | # | ||
685 | # Miscellaneous USB options | ||
686 | # | ||
687 | # CONFIG_USB_DEVICEFS is not set | ||
688 | # CONFIG_USB_BANDWIDTH is not set | ||
689 | # CONFIG_USB_DYNAMIC_MINORS is not set | ||
690 | # CONFIG_USB_OTG is not set | ||
691 | |||
692 | # | ||
693 | # USB Host Controller Drivers | ||
694 | # | ||
695 | # CONFIG_USB_EHCI_HCD is not set | ||
696 | # CONFIG_USB_ISP116X_HCD is not set | ||
697 | # CONFIG_USB_OHCI_HCD is not set | ||
698 | # CONFIG_USB_UHCI_HCD is not set | ||
699 | # CONFIG_USB_SL811_HCD is not set | ||
700 | |||
701 | # | ||
702 | # USB Device Class drivers | ||
703 | # | ||
704 | # CONFIG_USB_BLUETOOTH_TTY is not set | ||
705 | # CONFIG_USB_ACM is not set | ||
706 | # CONFIG_USB_PRINTER is not set | ||
707 | |||
708 | # | ||
709 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information | ||
710 | # | ||
711 | # CONFIG_USB_STORAGE is not set | ||
712 | |||
713 | # | ||
714 | # USB Input Devices | ||
715 | # | ||
716 | # CONFIG_USB_HID is not set | ||
717 | |||
718 | # | ||
719 | # USB HID Boot Protocol drivers | ||
720 | # | ||
721 | # CONFIG_USB_KBD is not set | ||
722 | # CONFIG_USB_MOUSE is not set | ||
723 | # CONFIG_USB_AIPTEK is not set | ||
724 | # CONFIG_USB_WACOM is not set | ||
725 | # CONFIG_USB_ACECAD is not set | ||
726 | # CONFIG_USB_KBTAB is not set | ||
727 | # CONFIG_USB_POWERMATE is not set | ||
728 | # CONFIG_USB_MTOUCH is not set | ||
729 | # CONFIG_USB_ITMTOUCH is not set | ||
730 | # CONFIG_USB_EGALAX is not set | ||
731 | # CONFIG_USB_XPAD is not set | ||
732 | # CONFIG_USB_ATI_REMOTE is not set | ||
733 | |||
734 | # | ||
735 | # USB Imaging devices | ||
736 | # | ||
737 | # CONFIG_USB_MDC800 is not set | ||
738 | # CONFIG_USB_MICROTEK is not set | ||
739 | |||
740 | # | ||
741 | # USB Multimedia devices | ||
742 | # | ||
743 | # CONFIG_USB_DABUSB is not set | ||
744 | |||
745 | # | ||
746 | # Video4Linux support is needed for USB Multimedia device support | ||
747 | # | ||
748 | |||
749 | # | ||
750 | # USB Network Adapters | ||
751 | # | ||
752 | # CONFIG_USB_CATC is not set | ||
753 | # CONFIG_USB_KAWETH is not set | ||
754 | CONFIG_USB_PEGASUS=y | ||
755 | # CONFIG_USB_RTL8150 is not set | ||
756 | # CONFIG_USB_USBNET is not set | ||
757 | CONFIG_USB_MON=y | ||
758 | |||
759 | # | ||
760 | # USB port drivers | ||
761 | # | ||
762 | |||
763 | # | ||
764 | # USB Serial Converter support | ||
765 | # | ||
766 | # CONFIG_USB_SERIAL is not set | ||
767 | |||
768 | # | ||
769 | # USB Miscellaneous drivers | ||
770 | # | ||
771 | # CONFIG_USB_EMI62 is not set | ||
772 | # CONFIG_USB_EMI26 is not set | ||
773 | # CONFIG_USB_AUERSWALD is not set | ||
774 | # CONFIG_USB_RIO500 is not set | ||
775 | # CONFIG_USB_LEGOTOWER is not set | ||
776 | # CONFIG_USB_LCD is not set | ||
777 | # CONFIG_USB_LED is not set | ||
778 | # CONFIG_USB_CYTHERM is not set | ||
779 | # CONFIG_USB_PHIDGETKIT is not set | ||
780 | # CONFIG_USB_PHIDGETSERVO is not set | ||
781 | # CONFIG_USB_IDMOUSE is not set | ||
782 | |||
783 | # | ||
784 | # USB DSL modem support | ||
785 | # | ||
786 | |||
787 | # | ||
788 | # USB Gadget Support | ||
789 | # | ||
790 | # CONFIG_USB_GADGET is not set | ||
791 | |||
792 | # | ||
793 | # MMC/SD Card support | ||
794 | # | ||
795 | # CONFIG_MMC is not set | ||
796 | |||
797 | # | ||
798 | # InfiniBand support | ||
799 | # | ||
800 | # CONFIG_INFINIBAND is not set | ||
801 | |||
802 | # | ||
803 | # SN Devices | ||
804 | # | ||
805 | |||
806 | # | ||
807 | # File systems | ||
808 | # | ||
809 | # CONFIG_EXT2_FS is not set | ||
810 | # CONFIG_EXT3_FS is not set | ||
811 | # CONFIG_JBD is not set | ||
812 | # CONFIG_REISERFS_FS is not set | ||
813 | # CONFIG_JFS_FS is not set | ||
814 | |||
815 | # | ||
816 | # XFS support | ||
817 | # | ||
818 | # CONFIG_XFS_FS is not set | ||
819 | # CONFIG_MINIX_FS is not set | ||
820 | # CONFIG_ROMFS_FS is not set | ||
821 | # CONFIG_QUOTA is not set | ||
822 | CONFIG_DNOTIFY=y | ||
823 | # CONFIG_AUTOFS_FS is not set | ||
824 | # CONFIG_AUTOFS4_FS is not set | ||
825 | |||
826 | # | ||
827 | # CD-ROM/DVD Filesystems | ||
828 | # | ||
829 | # CONFIG_ISO9660_FS is not set | ||
830 | # CONFIG_UDF_FS is not set | ||
831 | |||
832 | # | ||
833 | # DOS/FAT/NT Filesystems | ||
834 | # | ||
835 | # CONFIG_MSDOS_FS is not set | ||
836 | # CONFIG_VFAT_FS is not set | ||
837 | # CONFIG_NTFS_FS is not set | ||
838 | |||
839 | # | ||
840 | # Pseudo filesystems | ||
841 | # | ||
842 | CONFIG_PROC_FS=y | ||
843 | CONFIG_PROC_KCORE=y | ||
844 | CONFIG_SYSFS=y | ||
845 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
846 | # CONFIG_TMPFS is not set | ||
847 | # CONFIG_HUGETLB_PAGE is not set | ||
848 | CONFIG_RAMFS=y | ||
849 | |||
850 | # | ||
851 | # Miscellaneous filesystems | ||
852 | # | ||
853 | # CONFIG_ADFS_FS is not set | ||
854 | # CONFIG_AFFS_FS is not set | ||
855 | # CONFIG_HFS_FS is not set | ||
856 | # CONFIG_HFSPLUS_FS is not set | ||
857 | # CONFIG_BEFS_FS is not set | ||
858 | # CONFIG_BFS_FS is not set | ||
859 | # CONFIG_EFS_FS is not set | ||
860 | # CONFIG_CRAMFS is not set | ||
861 | # CONFIG_VXFS_FS is not set | ||
862 | # CONFIG_HPFS_FS is not set | ||
863 | # CONFIG_QNX4FS_FS is not set | ||
864 | # CONFIG_SYSV_FS is not set | ||
865 | # CONFIG_UFS_FS is not set | ||
866 | |||
867 | # | ||
868 | # Network File Systems | ||
869 | # | ||
870 | CONFIG_NFS_FS=y | ||
871 | # CONFIG_NFS_V3 is not set | ||
872 | # CONFIG_NFS_V4 is not set | ||
873 | # CONFIG_NFS_DIRECTIO is not set | ||
874 | # CONFIG_NFSD is not set | ||
875 | CONFIG_ROOT_NFS=y | ||
876 | CONFIG_LOCKD=y | ||
877 | CONFIG_NFS_COMMON=y | ||
878 | CONFIG_SUNRPC=y | ||
879 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
880 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
881 | # CONFIG_SMB_FS is not set | ||
882 | # CONFIG_CIFS is not set | ||
883 | # CONFIG_NCP_FS is not set | ||
884 | # CONFIG_CODA_FS is not set | ||
885 | # CONFIG_AFS_FS is not set | ||
886 | |||
887 | # | ||
888 | # Partition Types | ||
889 | # | ||
890 | # CONFIG_PARTITION_ADVANCED is not set | ||
891 | CONFIG_MSDOS_PARTITION=y | ||
892 | |||
893 | # | ||
894 | # Native Language Support | ||
895 | # | ||
896 | # CONFIG_NLS is not set | ||
897 | |||
898 | # | ||
899 | # Library routines | ||
900 | # | ||
901 | # CONFIG_CRC_CCITT is not set | ||
902 | CONFIG_CRC32=y | ||
903 | # CONFIG_LIBCRC32C is not set | ||
904 | |||
905 | # | ||
906 | # Profiling support | ||
907 | # | ||
908 | # CONFIG_PROFILING is not set | ||
909 | |||
910 | # | ||
911 | # Kernel hacking | ||
912 | # | ||
913 | # CONFIG_PRINTK_TIME is not set | ||
914 | CONFIG_DEBUG_KERNEL=y | ||
915 | CONFIG_MAGIC_SYSRQ=y | ||
916 | CONFIG_LOG_BUF_SHIFT=14 | ||
917 | # CONFIG_SCHEDSTATS is not set | ||
918 | # CONFIG_DEBUG_SLAB is not set | ||
919 | # CONFIG_DEBUG_SPINLOCK is not set | ||
920 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | ||
921 | # CONFIG_DEBUG_KOBJECT is not set | ||
922 | CONFIG_DEBUG_INFO=y | ||
923 | # CONFIG_DEBUG_FS is not set | ||
924 | # CONFIG_KGDB is not set | ||
925 | # CONFIG_XMON is not set | ||
926 | CONFIG_BDI_SWITCH=y | ||
927 | # CONFIG_SERIAL_TEXT_DEBUG is not set | ||
928 | CONFIG_PPC_OCP=y | ||
929 | |||
930 | # | ||
931 | # Security options | ||
932 | # | ||
933 | # CONFIG_KEYS is not set | ||
934 | # CONFIG_SECURITY is not set | ||
935 | |||
936 | # | ||
937 | # Cryptographic options | ||
938 | # | ||
939 | # CONFIG_CRYPTO is not set | ||
940 | |||
941 | # | ||
942 | # Hardware crypto devices | ||
943 | # | ||
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c index 50936cda0af9..8a3d74f2531e 100644 --- a/arch/ppc/kernel/cputable.c +++ b/arch/ppc/kernel/cputable.c | |||
@@ -852,6 +852,26 @@ struct cpu_spec cpu_specs[] = { | |||
852 | 852 | ||
853 | #endif /* CONFIG_40x */ | 853 | #endif /* CONFIG_40x */ |
854 | #ifdef CONFIG_44x | 854 | #ifdef CONFIG_44x |
855 | { | ||
856 | .pvr_mask = 0xf0000fff, | ||
857 | .pvr_value = 0x40000850, | ||
858 | .cpu_name = "440EP Rev. A", | ||
859 | .cpu_features = CPU_FTR_SPLIT_ID_CACHE | | ||
860 | CPU_FTR_USE_TB, | ||
861 | .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */ | ||
862 | .icache_bsize = 32, | ||
863 | .dcache_bsize = 32, | ||
864 | }, | ||
865 | { | ||
866 | .pvr_mask = 0xf0000fff, | ||
867 | .pvr_value = 0x400008d3, | ||
868 | .cpu_name = "440EP Rev. B", | ||
869 | .cpu_features = CPU_FTR_SPLIT_ID_CACHE | | ||
870 | CPU_FTR_USE_TB, | ||
871 | .cpu_user_features = COMMON_PPC, /* 440EP has an FPU */ | ||
872 | .icache_bsize = 32, | ||
873 | .dcache_bsize = 32, | ||
874 | }, | ||
855 | { /* 440GP Rev. B */ | 875 | { /* 440GP Rev. B */ |
856 | .pvr_mask = 0xf0000fff, | 876 | .pvr_mask = 0xf0000fff, |
857 | .pvr_value = 0x40000440, | 877 | .pvr_value = 0x40000440, |
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S index d4df68629cc6..cb83045e2edf 100644 --- a/arch/ppc/kernel/entry.S +++ b/arch/ppc/kernel/entry.S | |||
@@ -215,6 +215,7 @@ syscall_dotrace_cont: | |||
215 | lwzx r10,r10,r0 /* Fetch system call handler [ptr] */ | 215 | lwzx r10,r10,r0 /* Fetch system call handler [ptr] */ |
216 | mtlr r10 | 216 | mtlr r10 |
217 | addi r9,r1,STACK_FRAME_OVERHEAD | 217 | addi r9,r1,STACK_FRAME_OVERHEAD |
218 | PPC440EP_ERR42 | ||
218 | blrl /* Call handler */ | 219 | blrl /* Call handler */ |
219 | .globl ret_from_syscall | 220 | .globl ret_from_syscall |
220 | ret_from_syscall: | 221 | ret_from_syscall: |
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S index 6c7ae6052464..69ff3a9961e8 100644 --- a/arch/ppc/kernel/head_44x.S +++ b/arch/ppc/kernel/head_44x.S | |||
@@ -179,24 +179,26 @@ skpinv: addi r4,r4,1 /* Increment */ | |||
179 | 4: | 179 | 4: |
180 | #ifdef CONFIG_SERIAL_TEXT_DEBUG | 180 | #ifdef CONFIG_SERIAL_TEXT_DEBUG |
181 | /* | 181 | /* |
182 | * Add temporary UART mapping for early debug. This | 182 | * Add temporary UART mapping for early debug. |
183 | * mapping must be identical to that used by the early | 183 | * We can map UART registers wherever we want as long as they don't |
184 | * bootloader code since the same asm/serial.h parameters | 184 | * interfere with other system mappings (e.g. with pinned entries). |
185 | * are used for polled operation. | 185 | * For an example of how we handle this - see ocotea.h. --ebs |
186 | */ | 186 | */ |
187 | /* pageid fields */ | 187 | /* pageid fields */ |
188 | lis r3,UART0_IO_BASE@h | 188 | lis r3,UART0_IO_BASE@h |
189 | ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_256M | 189 | ori r3,r3,PPC44x_TLB_VALID | PPC44x_TLB_4K |
190 | 190 | ||
191 | /* xlat fields */ | 191 | /* xlat fields */ |
192 | lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ | 192 | lis r4,UART0_PHYS_IO_BASE@h /* RPN depends on SoC */ |
193 | #ifndef CONFIG_440EP | ||
193 | ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ | 194 | ori r4,r4,0x0001 /* ERPN is 1 for second 4GB page */ |
195 | #endif | ||
194 | 196 | ||
195 | /* attrib fields */ | 197 | /* attrib fields */ |
196 | li r5,0 | 198 | li r5,0 |
197 | ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) | 199 | ori r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G) |
198 | 200 | ||
199 | li r0,1 /* TLB slot 1 */ | 201 | li r0,0 /* TLB slot 0 */ |
200 | 202 | ||
201 | tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ | 203 | tlbwe r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */ |
202 | tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ | 204 | tlbwe r4,r0,PPC44x_TLB_XLAT /* Load the translation fields */ |
@@ -228,6 +230,16 @@ skpinv: addi r4,r4,1 /* Increment */ | |||
228 | lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ | 230 | lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ |
229 | mtspr SPRN_IVPR,r4 | 231 | mtspr SPRN_IVPR,r4 |
230 | 232 | ||
233 | #ifdef CONFIG_440EP | ||
234 | /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */ | ||
235 | mfspr r2,SPRN_CCR0 | ||
236 | lis r3,0xffef | ||
237 | ori r3,r3,0xffff | ||
238 | and r2,r2,r3 | ||
239 | mtspr SPRN_CCR0,r2 | ||
240 | isync | ||
241 | #endif | ||
242 | |||
231 | /* | 243 | /* |
232 | * This is where the main kernel code starts. | 244 | * This is where the main kernel code starts. |
233 | */ | 245 | */ |
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index 191a8def3bdb..ce71b4a01585 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S | |||
@@ -1145,6 +1145,7 @@ _GLOBAL(kernel_thread) | |||
1145 | stwu r0,-16(r1) | 1145 | stwu r0,-16(r1) |
1146 | mtlr r30 /* fn addr in lr */ | 1146 | mtlr r30 /* fn addr in lr */ |
1147 | mr r3,r31 /* load arg and call fn */ | 1147 | mr r3,r31 /* load arg and call fn */ |
1148 | PPC440EP_ERR42 | ||
1148 | blrl | 1149 | blrl |
1149 | li r0,__NR_exit /* exit if function returns */ | 1150 | li r0,__NR_exit /* exit if function returns */ |
1150 | li r3,0 | 1151 | li r3,0 |
@@ -1451,3 +1452,6 @@ _GLOBAL(sys_call_table) | |||
1451 | .long sys_waitid | 1452 | .long sys_waitid |
1452 | .long sys_ioprio_set | 1453 | .long sys_ioprio_set |
1453 | .long sys_ioprio_get | 1454 | .long sys_ioprio_get |
1455 | .long sys_inotify_init /* 275 */ | ||
1456 | .long sys_inotify_add_watch | ||
1457 | .long sys_inotify_rm_watch | ||
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 70cfb6ffd877..7b3586a3bf30 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
160 | } | 160 | } |
161 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 161 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
162 | 162 | ||
163 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
164 | struct pci_bus_region *region) | ||
165 | { | ||
166 | unsigned long offset = 0; | ||
167 | struct pci_controller *hose = dev->sysdata; | ||
168 | |||
169 | if (hose && res->flags & IORESOURCE_IO) | ||
170 | offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
171 | else if (hose && res->flags & IORESOURCE_MEM) | ||
172 | offset = hose->pci_mem_offset; | ||
173 | res->start = region->start + offset; | ||
174 | res->end = region->end + offset; | ||
175 | } | ||
176 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
177 | |||
163 | /* | 178 | /* |
164 | * We need to avoid collisions with `mirrored' VGA ports | 179 | * We need to avoid collisions with `mirrored' VGA ports |
165 | * and other strange ISA hardware, so we always want the | 180 | * and other strange ISA hardware, so we always want the |
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index d59ad07de8e7..e7d40cc6c1b6 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c | |||
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res); | |||
324 | 324 | ||
325 | EXPORT_SYMBOL(next_mmu_context); | 325 | EXPORT_SYMBOL(next_mmu_context); |
326 | EXPORT_SYMBOL(set_context); | 326 | EXPORT_SYMBOL(set_context); |
327 | EXPORT_SYMBOL(handle_mm_fault); /* For MOL */ | 327 | EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */ |
328 | EXPORT_SYMBOL(disarm_decr); | 328 | EXPORT_SYMBOL(disarm_decr); |
329 | #ifdef CONFIG_PPC_STD_MMU | 329 | #ifdef CONFIG_PPC_STD_MMU |
330 | extern long mol_trampoline; | 330 | extern long mol_trampoline; |
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig index a0612a86455a..805dd98908a3 100644 --- a/arch/ppc/platforms/4xx/Kconfig +++ b/arch/ppc/platforms/4xx/Kconfig | |||
@@ -3,6 +3,11 @@ config 4xx | |||
3 | depends on 40x || 44x | 3 | depends on 40x || 44x |
4 | default y | 4 | default y |
5 | 5 | ||
6 | config WANT_EARLY_SERIAL | ||
7 | bool | ||
8 | select SERIAL_8250 | ||
9 | default n | ||
10 | |||
6 | menu "IBM 4xx options" | 11 | menu "IBM 4xx options" |
7 | depends on 4xx | 12 | depends on 4xx |
8 | 13 | ||
@@ -18,6 +23,7 @@ config ASH | |||
18 | 23 | ||
19 | config BUBINGA | 24 | config BUBINGA |
20 | bool "Bubinga" | 25 | bool "Bubinga" |
26 | select WANT_EARLY_SERIAL | ||
21 | help | 27 | help |
22 | This option enables support for the IBM 405EP evaluation board. | 28 | This option enables support for the IBM 405EP evaluation board. |
23 | 29 | ||
@@ -68,18 +74,27 @@ choice | |||
68 | depends on 44x | 74 | depends on 44x |
69 | default EBONY | 75 | default EBONY |
70 | 76 | ||
77 | config BAMBOO | ||
78 | bool "Bamboo" | ||
79 | select WANT_EARLY_SERIAL | ||
80 | help | ||
81 | This option enables support for the IBM PPC440EP evaluation board. | ||
82 | |||
71 | config EBONY | 83 | config EBONY |
72 | bool "Ebony" | 84 | bool "Ebony" |
85 | select WANT_EARLY_SERIAL | ||
73 | help | 86 | help |
74 | This option enables support for the IBM PPC440GP evaluation board. | 87 | This option enables support for the IBM PPC440GP evaluation board. |
75 | 88 | ||
76 | config LUAN | 89 | config LUAN |
77 | bool "Luan" | 90 | bool "Luan" |
91 | select WANT_EARLY_SERIAL | ||
78 | help | 92 | help |
79 | This option enables support for the IBM PPC440SP evaluation board. | 93 | This option enables support for the IBM PPC440SP evaluation board. |
80 | 94 | ||
81 | config OCOTEA | 95 | config OCOTEA |
82 | bool "Ocotea" | 96 | bool "Ocotea" |
97 | select WANT_EARLY_SERIAL | ||
83 | help | 98 | help |
84 | This option enables support for the IBM PPC440GX evaluation board. | 99 | This option enables support for the IBM PPC440GX evaluation board. |
85 | 100 | ||
@@ -98,6 +113,12 @@ config NP405H | |||
98 | depends on ASH | 113 | depends on ASH |
99 | default y | 114 | default y |
100 | 115 | ||
116 | config 440EP | ||
117 | bool | ||
118 | depends on BAMBOO | ||
119 | select PPC_FPU | ||
120 | default y | ||
121 | |||
101 | config 440GP | 122 | config 440GP |
102 | bool | 123 | bool |
103 | depends on EBONY | 124 | depends on EBONY |
@@ -115,7 +136,7 @@ config 440SP | |||
115 | 136 | ||
116 | config 440 | 137 | config 440 |
117 | bool | 138 | bool |
118 | depends on 440GP || 440SP | 139 | depends on 440GP || 440SP || 440EP |
119 | default y | 140 | default y |
120 | 141 | ||
121 | config 440A | 142 | config 440A |
@@ -123,6 +144,11 @@ config 440A | |||
123 | depends on 440GX | 144 | depends on 440GX |
124 | default y | 145 | default y |
125 | 146 | ||
147 | config IBM440EP_ERR42 | ||
148 | bool | ||
149 | depends on 440EP | ||
150 | default y | ||
151 | |||
126 | # All 405-based cores up until the 405GPR and 405EP have this errata. | 152 | # All 405-based cores up until the 405GPR and 405EP have this errata. |
127 | config IBM405_ERR77 | 153 | config IBM405_ERR77 |
128 | bool | 154 | bool |
@@ -142,7 +168,7 @@ config BOOKE | |||
142 | 168 | ||
143 | config IBM_OCP | 169 | config IBM_OCP |
144 | bool | 170 | bool |
145 | depends on ASH || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT | 171 | depends on ASH || BAMBOO || BUBINGA || CPCI405 || EBONY || EP405 || LUAN || OCOTEA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT |
146 | default y | 172 | default y |
147 | 173 | ||
148 | config XILINX_OCP | 174 | config XILINX_OCP |
@@ -214,10 +240,6 @@ config PPC_GEN550 | |||
214 | depends on 4xx | 240 | depends on 4xx |
215 | default y | 241 | default y |
216 | 242 | ||
217 | config PM | ||
218 | bool "Power Management support (EXPERIMENTAL)" | ||
219 | depends on 4xx && EXPERIMENTAL | ||
220 | |||
221 | choice | 243 | choice |
222 | prompt "TTYS0 device and default console" | 244 | prompt "TTYS0 device and default console" |
223 | depends on 40x | 245 | depends on 40x |
diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile index ea470c6adbb6..844c3b5066e8 100644 --- a/arch/ppc/platforms/4xx/Makefile +++ b/arch/ppc/platforms/4xx/Makefile | |||
@@ -2,6 +2,7 @@ | |||
2 | # Makefile for the PowerPC 4xx linux kernel. | 2 | # Makefile for the PowerPC 4xx linux kernel. |
3 | 3 | ||
4 | obj-$(CONFIG_ASH) += ash.o | 4 | obj-$(CONFIG_ASH) += ash.o |
5 | obj-$(CONFIG_BAMBOO) += bamboo.o | ||
5 | obj-$(CONFIG_CPCI405) += cpci405.o | 6 | obj-$(CONFIG_CPCI405) += cpci405.o |
6 | obj-$(CONFIG_EBONY) += ebony.o | 7 | obj-$(CONFIG_EBONY) += ebony.o |
7 | obj-$(CONFIG_EP405) += ep405.o | 8 | obj-$(CONFIG_EP405) += ep405.o |
@@ -19,6 +20,7 @@ obj-$(CONFIG_405GP) += ibm405gp.o | |||
19 | obj-$(CONFIG_REDWOOD_5) += ibmstb4.o | 20 | obj-$(CONFIG_REDWOOD_5) += ibmstb4.o |
20 | obj-$(CONFIG_NP405H) += ibmnp405h.o | 21 | obj-$(CONFIG_NP405H) += ibmnp405h.o |
21 | obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o | 22 | obj-$(CONFIG_REDWOOD_6) += ibmstbx25.o |
23 | obj-$(CONFIG_440EP) += ibm440ep.o | ||
22 | obj-$(CONFIG_440GP) += ibm440gp.o | 24 | obj-$(CONFIG_440GP) += ibm440gp.o |
23 | obj-$(CONFIG_440GX) += ibm440gx.o | 25 | obj-$(CONFIG_440GX) += ibm440gx.o |
24 | obj-$(CONFIG_440SP) += ibm440sp.o | 26 | obj-$(CONFIG_440SP) += ibm440sp.o |
diff --git a/arch/ppc/platforms/4xx/bamboo.c b/arch/ppc/platforms/4xx/bamboo.c new file mode 100644 index 000000000000..f116787b0b76 --- /dev/null +++ b/arch/ppc/platforms/4xx/bamboo.c | |||
@@ -0,0 +1,427 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/4xx/bamboo.c | ||
3 | * | ||
4 | * Bamboo board specific routines | ||
5 | * | ||
6 | * Wade Farnsworth <wfarnsworth@mvista.com> | ||
7 | * Copyright 2004 MontaVista Software Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | */ | ||
14 | |||
15 | #include <linux/config.h> | ||
16 | #include <linux/stddef.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/errno.h> | ||
20 | #include <linux/reboot.h> | ||
21 | #include <linux/pci.h> | ||
22 | #include <linux/kdev_t.h> | ||
23 | #include <linux/types.h> | ||
24 | #include <linux/major.h> | ||
25 | #include <linux/blkdev.h> | ||
26 | #include <linux/console.h> | ||
27 | #include <linux/delay.h> | ||
28 | #include <linux/ide.h> | ||
29 | #include <linux/initrd.h> | ||
30 | #include <linux/irq.h> | ||
31 | #include <linux/seq_file.h> | ||
32 | #include <linux/root_dev.h> | ||
33 | #include <linux/tty.h> | ||
34 | #include <linux/serial.h> | ||
35 | #include <linux/serial_core.h> | ||
36 | #include <linux/ethtool.h> | ||
37 | |||
38 | #include <asm/system.h> | ||
39 | #include <asm/pgtable.h> | ||
40 | #include <asm/page.h> | ||
41 | #include <asm/dma.h> | ||
42 | #include <asm/io.h> | ||
43 | #include <asm/machdep.h> | ||
44 | #include <asm/ocp.h> | ||
45 | #include <asm/pci-bridge.h> | ||
46 | #include <asm/time.h> | ||
47 | #include <asm/todc.h> | ||
48 | #include <asm/bootinfo.h> | ||
49 | #include <asm/ppc4xx_pic.h> | ||
50 | #include <asm/ppcboot.h> | ||
51 | |||
52 | #include <syslib/gen550.h> | ||
53 | #include <syslib/ibm440gx_common.h> | ||
54 | |||
55 | /* | ||
56 | * This is a horrible kludge, we eventually need to abstract this | ||
57 | * generic PHY stuff, so the standard phy mode defines can be | ||
58 | * easily used from arch code. | ||
59 | */ | ||
60 | #include "../../../../drivers/net/ibm_emac/ibm_emac_phy.h" | ||
61 | |||
62 | bd_t __res; | ||
63 | |||
64 | static struct ibm44x_clocks clocks __initdata; | ||
65 | |||
66 | /* | ||
67 | * Bamboo external IRQ triggering/polarity settings | ||
68 | */ | ||
69 | unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { | ||
70 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ0: Ethernet transceiver */ | ||
71 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* IRQ1: Expansion connector */ | ||
72 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ2: PCI slot 0 */ | ||
73 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ3: PCI slot 1 */ | ||
74 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ4: PCI slot 2 */ | ||
75 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ5: PCI slot 3 */ | ||
76 | (IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* IRQ6: SMI pushbutton */ | ||
77 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ7: EXT */ | ||
78 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ8: EXT */ | ||
79 | (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* IRQ9: EXT */ | ||
80 | }; | ||
81 | |||
82 | static void __init | ||
83 | bamboo_calibrate_decr(void) | ||
84 | { | ||
85 | unsigned int freq; | ||
86 | |||
87 | if (mfspr(SPRN_CCR1) & CCR1_TCS) | ||
88 | freq = BAMBOO_TMRCLK; | ||
89 | else | ||
90 | freq = clocks.cpu; | ||
91 | |||
92 | ibm44x_calibrate_decr(freq); | ||
93 | |||
94 | } | ||
95 | |||
96 | static int | ||
97 | bamboo_show_cpuinfo(struct seq_file *m) | ||
98 | { | ||
99 | seq_printf(m, "vendor\t\t: IBM\n"); | ||
100 | seq_printf(m, "machine\t\t: PPC440EP EVB (Bamboo)\n"); | ||
101 | |||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | static inline int | ||
106 | bamboo_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | ||
107 | { | ||
108 | static char pci_irq_table[][4] = | ||
109 | /* | ||
110 | * PCI IDSEL/INTPIN->INTLINE | ||
111 | * A B C D | ||
112 | */ | ||
113 | { | ||
114 | { 28, 28, 28, 28 }, /* IDSEL 1 - PCI Slot 0 */ | ||
115 | { 27, 27, 27, 27 }, /* IDSEL 2 - PCI Slot 1 */ | ||
116 | { 26, 26, 26, 26 }, /* IDSEL 3 - PCI Slot 2 */ | ||
117 | { 25, 25, 25, 25 }, /* IDSEL 4 - PCI Slot 3 */ | ||
118 | }; | ||
119 | |||
120 | const long min_idsel = 1, max_idsel = 4, irqs_per_slot = 4; | ||
121 | return PCI_IRQ_TABLE_LOOKUP; | ||
122 | } | ||
123 | |||
124 | static void __init bamboo_set_emacdata(void) | ||
125 | { | ||
126 | unsigned char * selection1_base; | ||
127 | struct ocp_def *def; | ||
128 | struct ocp_func_emac_data *emacdata; | ||
129 | u8 selection1_val; | ||
130 | int mode; | ||
131 | |||
132 | selection1_base = ioremap64(BAMBOO_FPGA_SELECTION1_REG_ADDR, 16); | ||
133 | selection1_val = readb(selection1_base); | ||
134 | iounmap((void *) selection1_base); | ||
135 | if (BAMBOO_SEL_MII(selection1_val)) | ||
136 | mode = PHY_MODE_MII; | ||
137 | else if (BAMBOO_SEL_RMII(selection1_val)) | ||
138 | mode = PHY_MODE_RMII; | ||
139 | else | ||
140 | mode = PHY_MODE_SMII; | ||
141 | |||
142 | /* Set mac_addr and phy mode for each EMAC */ | ||
143 | |||
144 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0); | ||
145 | emacdata = def->additions; | ||
146 | memcpy(emacdata->mac_addr, __res.bi_enetaddr, 6); | ||
147 | emacdata->phy_mode = mode; | ||
148 | |||
149 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 1); | ||
150 | emacdata = def->additions; | ||
151 | memcpy(emacdata->mac_addr, __res.bi_enet1addr, 6); | ||
152 | emacdata->phy_mode = mode; | ||
153 | } | ||
154 | |||
155 | static int | ||
156 | bamboo_exclude_device(unsigned char bus, unsigned char devfn) | ||
157 | { | ||
158 | return (bus == 0 && devfn == 0); | ||
159 | } | ||
160 | |||
161 | #define PCI_READW(offset) \ | ||
162 | (readw((void *)((u32)pci_reg_base+offset))) | ||
163 | |||
164 | #define PCI_WRITEW(value, offset) \ | ||
165 | (writew(value, (void *)((u32)pci_reg_base+offset))) | ||
166 | |||
167 | #define PCI_WRITEL(value, offset) \ | ||
168 | (writel(value, (void *)((u32)pci_reg_base+offset))) | ||
169 | |||
170 | static void __init | ||
171 | bamboo_setup_pci(void) | ||
172 | { | ||
173 | void *pci_reg_base; | ||
174 | unsigned long memory_size; | ||
175 | memory_size = ppc_md.find_end_of_memory(); | ||
176 | |||
177 | pci_reg_base = ioremap64(BAMBOO_PCIL0_BASE, BAMBOO_PCIL0_SIZE); | ||
178 | |||
179 | /* Enable PCI I/O, Mem, and Busmaster cycles */ | ||
180 | PCI_WRITEW(PCI_READW(PCI_COMMAND) | | ||
181 | PCI_COMMAND_MEMORY | | ||
182 | PCI_COMMAND_MASTER, PCI_COMMAND); | ||
183 | |||
184 | /* Disable region first */ | ||
185 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM0MA); | ||
186 | |||
187 | /* PLB starting addr: 0x00000000A0000000 */ | ||
188 | PCI_WRITEL(BAMBOO_PCI_PHY_MEM_BASE, BAMBOO_PCIL0_PMM0LA); | ||
189 | |||
190 | /* PCI start addr, 0xA0000000 (PCI Address) */ | ||
191 | PCI_WRITEL(BAMBOO_PCI_MEM_BASE, BAMBOO_PCIL0_PMM0PCILA); | ||
192 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM0PCIHA); | ||
193 | |||
194 | /* Enable no pre-fetch, enable region */ | ||
195 | PCI_WRITEL(((0xffffffff - | ||
196 | (BAMBOO_PCI_UPPER_MEM - BAMBOO_PCI_MEM_BASE)) | 0x01), | ||
197 | BAMBOO_PCIL0_PMM0MA); | ||
198 | |||
199 | /* Disable region one */ | ||
200 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA); | ||
201 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM1LA); | ||
202 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCILA); | ||
203 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM1PCIHA); | ||
204 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM1MA); | ||
205 | |||
206 | /* Disable region two */ | ||
207 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA); | ||
208 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM2LA); | ||
209 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCILA); | ||
210 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM2PCIHA); | ||
211 | PCI_WRITEL(0, BAMBOO_PCIL0_PMM2MA); | ||
212 | |||
213 | /* Now configure the PCI->PLB windows, we only use PTM1 | ||
214 | * | ||
215 | * For Inbound flow, set the window size to all available memory | ||
216 | * This is required because if size is smaller, | ||
217 | * then Eth/PCI DD would fail as PCI card not able to access | ||
218 | * the memory allocated by DD. | ||
219 | */ | ||
220 | |||
221 | PCI_WRITEL(0, BAMBOO_PCIL0_PTM1MS); /* disabled region 1 */ | ||
222 | PCI_WRITEL(0, BAMBOO_PCIL0_PTM1LA); /* begin of address map */ | ||
223 | |||
224 | memory_size = 1 << fls(memory_size - 1); | ||
225 | |||
226 | /* Size low + Enabled */ | ||
227 | PCI_WRITEL((0xffffffff - (memory_size - 1)) | 0x1, BAMBOO_PCIL0_PTM1MS); | ||
228 | |||
229 | eieio(); | ||
230 | iounmap(pci_reg_base); | ||
231 | } | ||
232 | |||
233 | static void __init | ||
234 | bamboo_setup_hose(void) | ||
235 | { | ||
236 | unsigned int bar_response, bar; | ||
237 | struct pci_controller *hose; | ||
238 | |||
239 | bamboo_setup_pci(); | ||
240 | |||
241 | hose = pcibios_alloc_controller(); | ||
242 | |||
243 | if (!hose) | ||
244 | return; | ||
245 | |||
246 | hose->first_busno = 0; | ||
247 | hose->last_busno = 0xff; | ||
248 | |||
249 | hose->pci_mem_offset = BAMBOO_PCI_MEM_OFFSET; | ||
250 | |||
251 | pci_init_resource(&hose->io_resource, | ||
252 | BAMBOO_PCI_LOWER_IO, | ||
253 | BAMBOO_PCI_UPPER_IO, | ||
254 | IORESOURCE_IO, | ||
255 | "PCI host bridge"); | ||
256 | |||
257 | pci_init_resource(&hose->mem_resources[0], | ||
258 | BAMBOO_PCI_LOWER_MEM, | ||
259 | BAMBOO_PCI_UPPER_MEM, | ||
260 | IORESOURCE_MEM, | ||
261 | "PCI host bridge"); | ||
262 | |||
263 | ppc_md.pci_exclude_device = bamboo_exclude_device; | ||
264 | |||
265 | hose->io_space.start = BAMBOO_PCI_LOWER_IO; | ||
266 | hose->io_space.end = BAMBOO_PCI_UPPER_IO; | ||
267 | hose->mem_space.start = BAMBOO_PCI_LOWER_MEM; | ||
268 | hose->mem_space.end = BAMBOO_PCI_UPPER_MEM; | ||
269 | isa_io_base = | ||
270 | (unsigned long)ioremap64(BAMBOO_PCI_IO_BASE, BAMBOO_PCI_IO_SIZE); | ||
271 | hose->io_base_virt = (void *)isa_io_base; | ||
272 | |||
273 | setup_indirect_pci(hose, | ||
274 | BAMBOO_PCI_CFGA_PLB32, | ||
275 | BAMBOO_PCI_CFGD_PLB32); | ||
276 | hose->set_cfg_type = 1; | ||
277 | |||
278 | /* Zero config bars */ | ||
279 | for (bar = PCI_BASE_ADDRESS_1; bar <= PCI_BASE_ADDRESS_2; bar += 4) { | ||
280 | early_write_config_dword(hose, hose->first_busno, | ||
281 | PCI_FUNC(hose->first_busno), bar, | ||
282 | 0x00000000); | ||
283 | early_read_config_dword(hose, hose->first_busno, | ||
284 | PCI_FUNC(hose->first_busno), bar, | ||
285 | &bar_response); | ||
286 | } | ||
287 | |||
288 | hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); | ||
289 | |||
290 | ppc_md.pci_swizzle = common_swizzle; | ||
291 | ppc_md.pci_map_irq = bamboo_map_irq; | ||
292 | } | ||
293 | |||
294 | TODC_ALLOC(); | ||
295 | |||
296 | static void __init | ||
297 | bamboo_early_serial_map(void) | ||
298 | { | ||
299 | struct uart_port port; | ||
300 | |||
301 | /* Setup ioremapped serial port access */ | ||
302 | memset(&port, 0, sizeof(port)); | ||
303 | port.membase = ioremap64(PPC440EP_UART0_ADDR, 8); | ||
304 | port.irq = 0; | ||
305 | port.uartclk = clocks.uart0; | ||
306 | port.regshift = 0; | ||
307 | port.iotype = SERIAL_IO_MEM; | ||
308 | port.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST; | ||
309 | port.line = 0; | ||
310 | |||
311 | if (early_serial_setup(&port) != 0) { | ||
312 | printk("Early serial init of port 0 failed\n"); | ||
313 | } | ||
314 | |||
315 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | ||
316 | /* Configure debug serial access */ | ||
317 | gen550_init(0, &port); | ||
318 | #endif | ||
319 | |||
320 | port.membase = ioremap64(PPC440EP_UART1_ADDR, 8); | ||
321 | port.irq = 1; | ||
322 | port.uartclk = clocks.uart1; | ||
323 | port.line = 1; | ||
324 | |||
325 | if (early_serial_setup(&port) != 0) { | ||
326 | printk("Early serial init of port 1 failed\n"); | ||
327 | } | ||
328 | |||
329 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | ||
330 | /* Configure debug serial access */ | ||
331 | gen550_init(1, &port); | ||
332 | #endif | ||
333 | |||
334 | port.membase = ioremap64(PPC440EP_UART2_ADDR, 8); | ||
335 | port.irq = 3; | ||
336 | port.uartclk = clocks.uart2; | ||
337 | port.line = 2; | ||
338 | |||
339 | if (early_serial_setup(&port) != 0) { | ||
340 | printk("Early serial init of port 2 failed\n"); | ||
341 | } | ||
342 | |||
343 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | ||
344 | /* Configure debug serial access */ | ||
345 | gen550_init(2, &port); | ||
346 | #endif | ||
347 | |||
348 | port.membase = ioremap64(PPC440EP_UART3_ADDR, 8); | ||
349 | port.irq = 4; | ||
350 | port.uartclk = clocks.uart3; | ||
351 | port.line = 3; | ||
352 | |||
353 | if (early_serial_setup(&port) != 0) { | ||
354 | printk("Early serial init of port 3 failed\n"); | ||
355 | } | ||
356 | } | ||
357 | |||
358 | static void __init | ||
359 | bamboo_setup_arch(void) | ||
360 | { | ||
361 | |||
362 | bamboo_set_emacdata(); | ||
363 | |||
364 | ibm440gx_get_clocks(&clocks, 33333333, 6 * 1843200); | ||
365 | ocp_sys_info.opb_bus_freq = clocks.opb; | ||
366 | |||
367 | /* Setup TODC access */ | ||
368 | TODC_INIT(TODC_TYPE_DS1743, | ||
369 | 0, | ||
370 | 0, | ||
371 | ioremap64(BAMBOO_RTC_ADDR, BAMBOO_RTC_SIZE), | ||
372 | 8); | ||
373 | |||
374 | /* init to some ~sane value until calibrate_delay() runs */ | ||
375 | loops_per_jiffy = 50000000/HZ; | ||
376 | |||
377 | /* Setup PCI host bridge */ | ||
378 | bamboo_setup_hose(); | ||
379 | |||
380 | #ifdef CONFIG_BLK_DEV_INITRD | ||
381 | if (initrd_start) | ||
382 | ROOT_DEV = Root_RAM0; | ||
383 | else | ||
384 | #endif | ||
385 | #ifdef CONFIG_ROOT_NFS | ||
386 | ROOT_DEV = Root_NFS; | ||
387 | #else | ||
388 | ROOT_DEV = Root_HDA1; | ||
389 | #endif | ||
390 | |||
391 | bamboo_early_serial_map(); | ||
392 | |||
393 | /* Identify the system */ | ||
394 | printk("IBM Bamboo port (MontaVista Software, Inc. (source@mvista.com))\n"); | ||
395 | } | ||
396 | |||
397 | void __init platform_init(unsigned long r3, unsigned long r4, | ||
398 | unsigned long r5, unsigned long r6, unsigned long r7) | ||
399 | { | ||
400 | parse_bootinfo(find_bootinfo()); | ||
401 | |||
402 | /* | ||
403 | * If we were passed in a board information, copy it into the | ||
404 | * residual data area. | ||
405 | */ | ||
406 | if (r3) | ||
407 | __res = *(bd_t *)(r3 + KERNELBASE); | ||
408 | |||
409 | |||
410 | ibm44x_platform_init(); | ||
411 | |||
412 | ppc_md.setup_arch = bamboo_setup_arch; | ||
413 | ppc_md.show_cpuinfo = bamboo_show_cpuinfo; | ||
414 | ppc_md.get_irq = NULL; /* Set in ppc4xx_pic_init() */ | ||
415 | |||
416 | ppc_md.calibrate_decr = bamboo_calibrate_decr; | ||
417 | ppc_md.time_init = todc_time_init; | ||
418 | ppc_md.set_rtc_time = todc_set_rtc_time; | ||
419 | ppc_md.get_rtc_time = todc_get_rtc_time; | ||
420 | |||
421 | ppc_md.nvram_read_val = todc_direct_read_val; | ||
422 | ppc_md.nvram_write_val = todc_direct_write_val; | ||
423 | #ifdef CONFIG_KGDB | ||
424 | ppc_md.early_serial_map = bamboo_early_serial_map; | ||
425 | #endif | ||
426 | } | ||
427 | |||
diff --git a/arch/ppc/platforms/4xx/bamboo.h b/arch/ppc/platforms/4xx/bamboo.h new file mode 100644 index 000000000000..63d714504148 --- /dev/null +++ b/arch/ppc/platforms/4xx/bamboo.h | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/bamboo.h | ||
3 | * | ||
4 | * Bamboo board definitions | ||
5 | * | ||
6 | * Wade Farnsworth <wfarnsworth@mvista.com> | ||
7 | * | ||
8 | * Copyright 2004 MontaVista Software Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | #ifndef __ASM_BAMBOO_H__ | ||
18 | #define __ASM_BAMBOO_H__ | ||
19 | |||
20 | #include <linux/config.h> | ||
21 | #include <platforms/4xx/ibm440ep.h> | ||
22 | |||
23 | /* F/W TLB mapping used in bootloader glue to reset EMAC */ | ||
24 | #define PPC44x_EMAC0_MR0 0x0EF600E00 | ||
25 | |||
26 | /* Location of MAC addresses in PIBS image */ | ||
27 | #define PIBS_FLASH_BASE 0xfff00000 | ||
28 | #define PIBS_MAC_BASE (PIBS_FLASH_BASE+0xc0400) | ||
29 | #define PIBS_MAC_SIZE 0x200 | ||
30 | #define PIBS_MAC_OFFSET 0x100 | ||
31 | |||
32 | /* Default clock rate */ | ||
33 | #define BAMBOO_TMRCLK 25000000 | ||
34 | |||
35 | /* RTC/NVRAM location */ | ||
36 | #define BAMBOO_RTC_ADDR 0x080000000ULL | ||
37 | #define BAMBOO_RTC_SIZE 0x2000 | ||
38 | |||
39 | /* FPGA Registers */ | ||
40 | #define BAMBOO_FPGA_ADDR 0x080002000ULL | ||
41 | |||
42 | #define BAMBOO_FPGA_CONFIG2_REG_ADDR (BAMBOO_FPGA_ADDR + 0x1) | ||
43 | #define BAMBOO_FULL_DUPLEX_EN(x) (x & 0x08) | ||
44 | #define BAMBOO_FORCE_100Mbps(x) (x & 0x04) | ||
45 | #define BAMBOO_AUTONEGOTIATE(x) (x & 0x02) | ||
46 | |||
47 | #define BAMBOO_FPGA_SETTING_REG_ADDR (BAMBOO_FPGA_ADDR + 0x3) | ||
48 | #define BAMBOO_BOOT_SMALL_FLASH(x) (!(x & 0x80)) | ||
49 | #define BAMBOO_LARGE_FLASH_EN(x) (!(x & 0x40)) | ||
50 | #define BAMBOO_BOOT_NAND_FLASH(x) (!(x & 0x20)) | ||
51 | |||
52 | #define BAMBOO_FPGA_SELECTION1_REG_ADDR (BAMBOO_FPGA_ADDR + 0x4) | ||
53 | #define BAMBOO_SEL_MII(x) (x & 0x80) | ||
54 | #define BAMBOO_SEL_RMII(x) (x & 0x40) | ||
55 | #define BAMBOO_SEL_SMII(x) (x & 0x20) | ||
56 | |||
57 | /* Flash */ | ||
58 | #define BAMBOO_SMALL_FLASH_LOW 0x087f00000ULL | ||
59 | #define BAMBOO_SMALL_FLASH_HIGH 0x0fff00000ULL | ||
60 | #define BAMBOO_SMALL_FLASH_SIZE 0x100000 | ||
61 | #define BAMBOO_LARGE_FLASH_LOW 0x087800000ULL | ||
62 | #define BAMBOO_LARGE_FLASH_HIGH1 0x0ff800000ULL | ||
63 | #define BAMBOO_LARGE_FLASH_HIGH2 0x0ffc00000ULL | ||
64 | #define BAMBOO_LARGE_FLASH_SIZE 0x400000 | ||
65 | #define BAMBOO_SRAM_LOW 0x087f00000ULL | ||
66 | #define BAMBOO_SRAM_HIGH1 0x0fff00000ULL | ||
67 | #define BAMBOO_SRAM_HIGH2 0x0ff800000ULL | ||
68 | #define BAMBOO_SRAM_SIZE 0x100000 | ||
69 | #define BAMBOO_NAND_FLASH_REG_ADDR 0x090000000ULL | ||
70 | #define BAMBOO_NAND_FLASH_REG_SIZE 0x2000 | ||
71 | |||
72 | /* | ||
73 | * Serial port defines | ||
74 | */ | ||
75 | #define RS_TABLE_SIZE 4 | ||
76 | |||
77 | #define UART0_IO_BASE 0xEF600300 | ||
78 | #define UART1_IO_BASE 0xEF600400 | ||
79 | #define UART2_IO_BASE 0xEF600500 | ||
80 | #define UART3_IO_BASE 0xEF600600 | ||
81 | |||
82 | #define BASE_BAUD 33177600/3/16 | ||
83 | #define UART0_INT 0 | ||
84 | #define UART1_INT 1 | ||
85 | #define UART2_INT 3 | ||
86 | #define UART3_INT 4 | ||
87 | |||
88 | #define STD_UART_OP(num) \ | ||
89 | { 0, BASE_BAUD, 0, UART##num##_INT, \ | ||
90 | (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | ||
91 | iomem_base: UART##num##_IO_BASE, \ | ||
92 | io_type: SERIAL_IO_MEM}, | ||
93 | |||
94 | #define SERIAL_PORT_DFNS \ | ||
95 | STD_UART_OP(0) \ | ||
96 | STD_UART_OP(1) \ | ||
97 | STD_UART_OP(2) \ | ||
98 | STD_UART_OP(3) | ||
99 | |||
100 | /* PCI support */ | ||
101 | #define BAMBOO_PCI_CFGA_PLB32 0xeec00000 | ||
102 | #define BAMBOO_PCI_CFGD_PLB32 0xeec00004 | ||
103 | |||
104 | #define BAMBOO_PCI_IO_BASE 0x00000000e8000000ULL | ||
105 | #define BAMBOO_PCI_IO_SIZE 0x00010000 | ||
106 | #define BAMBOO_PCI_MEM_OFFSET 0x00000000 | ||
107 | #define BAMBOO_PCI_PHY_MEM_BASE 0x00000000a0000000ULL | ||
108 | |||
109 | #define BAMBOO_PCI_LOWER_IO 0x00000000 | ||
110 | #define BAMBOO_PCI_UPPER_IO 0x0000ffff | ||
111 | #define BAMBOO_PCI_LOWER_MEM 0xa0000000 | ||
112 | #define BAMBOO_PCI_UPPER_MEM 0xafffffff | ||
113 | #define BAMBOO_PCI_MEM_BASE 0xa0000000 | ||
114 | |||
115 | #define BAMBOO_PCIL0_BASE 0x00000000ef400000ULL | ||
116 | #define BAMBOO_PCIL0_SIZE 0x40 | ||
117 | |||
118 | #define BAMBOO_PCIL0_PMM0LA 0x000 | ||
119 | #define BAMBOO_PCIL0_PMM0MA 0x004 | ||
120 | #define BAMBOO_PCIL0_PMM0PCILA 0x008 | ||
121 | #define BAMBOO_PCIL0_PMM0PCIHA 0x00C | ||
122 | #define BAMBOO_PCIL0_PMM1LA 0x010 | ||
123 | #define BAMBOO_PCIL0_PMM1MA 0x014 | ||
124 | #define BAMBOO_PCIL0_PMM1PCILA 0x018 | ||
125 | #define BAMBOO_PCIL0_PMM1PCIHA 0x01C | ||
126 | #define BAMBOO_PCIL0_PMM2LA 0x020 | ||
127 | #define BAMBOO_PCIL0_PMM2MA 0x024 | ||
128 | #define BAMBOO_PCIL0_PMM2PCILA 0x028 | ||
129 | #define BAMBOO_PCIL0_PMM2PCIHA 0x02C | ||
130 | #define BAMBOO_PCIL0_PTM1MS 0x030 | ||
131 | #define BAMBOO_PCIL0_PTM1LA 0x034 | ||
132 | #define BAMBOO_PCIL0_PTM2MS 0x038 | ||
133 | #define BAMBOO_PCIL0_PTM2LA 0x03C | ||
134 | |||
135 | #endif /* __ASM_BAMBOO_H__ */ | ||
136 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index cd11734ef7c5..509e69a095f0 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright 2002-2005 MontaVista Software Inc. | 7 | * Copyright 2002-2005 MontaVista Software Inc. |
8 | * | 8 | * |
9 | * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> | 9 | * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> |
10 | * Copyright (c) 2003, 2004 Zultys Technologies | 10 | * Copyright (c) 2003-2005 Zultys Technologies |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |
@@ -50,6 +50,7 @@ | |||
50 | #include <asm/bootinfo.h> | 50 | #include <asm/bootinfo.h> |
51 | #include <asm/ppc4xx_pic.h> | 51 | #include <asm/ppc4xx_pic.h> |
52 | #include <asm/ppcboot.h> | 52 | #include <asm/ppcboot.h> |
53 | #include <asm/tlbflush.h> | ||
53 | 54 | ||
54 | #include <syslib/gen550.h> | 55 | #include <syslib/gen550.h> |
55 | #include <syslib/ibm440gp_common.h> | 56 | #include <syslib/ibm440gp_common.h> |
@@ -248,6 +249,9 @@ ebony_early_serial_map(void) | |||
248 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | 249 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) |
249 | /* Configure debug serial access */ | 250 | /* Configure debug serial access */ |
250 | gen550_init(0, &port); | 251 | gen550_init(0, &port); |
252 | |||
253 | /* Purge TLB entry added in head_44x.S for early serial access */ | ||
254 | _tlbie(UART0_IO_BASE); | ||
251 | #endif | 255 | #endif |
252 | 256 | ||
253 | port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); | 257 | port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); |
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h index 47c391c9174d..d08faa46a0ae 100644 --- a/arch/ppc/platforms/4xx/ebony.h +++ b/arch/ppc/platforms/4xx/ebony.h | |||
@@ -56,9 +56,18 @@ | |||
56 | * Serial port defines | 56 | * Serial port defines |
57 | */ | 57 | */ |
58 | 58 | ||
59 | /* OpenBIOS defined UART mappings, used before early_serial_setup */ | 59 | #if defined(__BOOTER__) |
60 | /* OpenBIOS defined UART mappings, used by bootloader shim */ | ||
60 | #define UART0_IO_BASE 0xE0000200 | 61 | #define UART0_IO_BASE 0xE0000200 |
61 | #define UART1_IO_BASE 0xE0000300 | 62 | #define UART1_IO_BASE 0xE0000300 |
63 | #else | ||
64 | /* head_44x.S created UART mapping, used before early_serial_setup. | ||
65 | * We cannot use default OpenBIOS UART mappings because they | ||
66 | * don't work for configurations with more than 512M RAM. --ebs | ||
67 | */ | ||
68 | #define UART0_IO_BASE 0xF0000200 | ||
69 | #define UART1_IO_BASE 0xF0000300 | ||
70 | #endif | ||
62 | 71 | ||
63 | /* external Epson SG-615P */ | 72 | /* external Epson SG-615P */ |
64 | #define BASE_BAUD 691200 | 73 | #define BASE_BAUD 691200 |
@@ -66,7 +75,7 @@ | |||
66 | #define STD_UART_OP(num) \ | 75 | #define STD_UART_OP(num) \ |
67 | { 0, BASE_BAUD, 0, UART##num##_INT, \ | 76 | { 0, BASE_BAUD, 0, UART##num##_INT, \ |
68 | (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | 77 | (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ |
69 | iomem_base: UART##num##_IO_BASE, \ | 78 | iomem_base: (void*)UART##num##_IO_BASE, \ |
70 | io_type: SERIAL_IO_MEM}, | 79 | io_type: SERIAL_IO_MEM}, |
71 | 80 | ||
72 | #define SERIAL_PORT_DFNS \ | 81 | #define SERIAL_PORT_DFNS \ |
diff --git a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c new file mode 100644 index 000000000000..284da01f1ffd --- /dev/null +++ b/arch/ppc/platforms/4xx/ibm440ep.c | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/4xx/ibm440ep.c | ||
3 | * | ||
4 | * PPC440EP I/O descriptions | ||
5 | * | ||
6 | * Wade Farnsworth <wfarnsworth@mvista.com> | ||
7 | * Copyright 2004 MontaVista Software Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <platforms/4xx/ibm440ep.h> | ||
18 | #include <asm/ocp.h> | ||
19 | #include <asm/ppc4xx_pic.h> | ||
20 | |||
21 | static struct ocp_func_emac_data ibm440ep_emac0_def = { | ||
22 | .rgmii_idx = -1, /* No RGMII */ | ||
23 | .rgmii_mux = -1, /* No RGMII */ | ||
24 | .zmii_idx = 0, /* ZMII device index */ | ||
25 | .zmii_mux = 0, /* ZMII input of this EMAC */ | ||
26 | .mal_idx = 0, /* MAL device index */ | ||
27 | .mal_rx_chan = 0, /* MAL rx channel number */ | ||
28 | .mal_tx_chan = 0, /* MAL tx channel number */ | ||
29 | .wol_irq = 61, /* WOL interrupt number */ | ||
30 | .mdio_idx = -1, /* No shared MDIO */ | ||
31 | .tah_idx = -1, /* No TAH */ | ||
32 | }; | ||
33 | |||
34 | static struct ocp_func_emac_data ibm440ep_emac1_def = { | ||
35 | .rgmii_idx = -1, /* No RGMII */ | ||
36 | .rgmii_mux = -1, /* No RGMII */ | ||
37 | .zmii_idx = 0, /* ZMII device index */ | ||
38 | .zmii_mux = 1, /* ZMII input of this EMAC */ | ||
39 | .mal_idx = 0, /* MAL device index */ | ||
40 | .mal_rx_chan = 1, /* MAL rx channel number */ | ||
41 | .mal_tx_chan = 2, /* MAL tx channel number */ | ||
42 | .wol_irq = 63, /* WOL interrupt number */ | ||
43 | .mdio_idx = -1, /* No shared MDIO */ | ||
44 | .tah_idx = -1, /* No TAH */ | ||
45 | }; | ||
46 | OCP_SYSFS_EMAC_DATA() | ||
47 | |||
48 | static struct ocp_func_mal_data ibm440ep_mal0_def = { | ||
49 | .num_tx_chans = 4, /* Number of TX channels */ | ||
50 | .num_rx_chans = 2, /* Number of RX channels */ | ||
51 | .txeob_irq = 10, /* TX End Of Buffer IRQ */ | ||
52 | .rxeob_irq = 11, /* RX End Of Buffer IRQ */ | ||
53 | .txde_irq = 33, /* TX Descriptor Error IRQ */ | ||
54 | .rxde_irq = 34, /* RX Descriptor Error IRQ */ | ||
55 | .serr_irq = 32, /* MAL System Error IRQ */ | ||
56 | }; | ||
57 | OCP_SYSFS_MAL_DATA() | ||
58 | |||
59 | static struct ocp_func_iic_data ibm440ep_iic0_def = { | ||
60 | .fast_mode = 0, /* Use standad mode (100Khz) */ | ||
61 | }; | ||
62 | |||
63 | static struct ocp_func_iic_data ibm440ep_iic1_def = { | ||
64 | .fast_mode = 0, /* Use standad mode (100Khz) */ | ||
65 | }; | ||
66 | OCP_SYSFS_IIC_DATA() | ||
67 | |||
68 | struct ocp_def core_ocp[] = { | ||
69 | { .vendor = OCP_VENDOR_IBM, | ||
70 | .function = OCP_FUNC_OPB, | ||
71 | .index = 0, | ||
72 | .paddr = 0x0EF600000ULL, | ||
73 | .irq = OCP_IRQ_NA, | ||
74 | .pm = OCP_CPM_NA, | ||
75 | }, | ||
76 | { .vendor = OCP_VENDOR_IBM, | ||
77 | .function = OCP_FUNC_16550, | ||
78 | .index = 0, | ||
79 | .paddr = PPC440EP_UART0_ADDR, | ||
80 | .irq = UART0_INT, | ||
81 | .pm = IBM_CPM_UART0, | ||
82 | }, | ||
83 | { .vendor = OCP_VENDOR_IBM, | ||
84 | .function = OCP_FUNC_16550, | ||
85 | .index = 1, | ||
86 | .paddr = PPC440EP_UART1_ADDR, | ||
87 | .irq = UART1_INT, | ||
88 | .pm = IBM_CPM_UART1, | ||
89 | }, | ||
90 | { .vendor = OCP_VENDOR_IBM, | ||
91 | .function = OCP_FUNC_16550, | ||
92 | .index = 2, | ||
93 | .paddr = PPC440EP_UART2_ADDR, | ||
94 | .irq = UART2_INT, | ||
95 | .pm = IBM_CPM_UART2, | ||
96 | }, | ||
97 | { .vendor = OCP_VENDOR_IBM, | ||
98 | .function = OCP_FUNC_16550, | ||
99 | .index = 3, | ||
100 | .paddr = PPC440EP_UART3_ADDR, | ||
101 | .irq = UART3_INT, | ||
102 | .pm = IBM_CPM_UART3, | ||
103 | }, | ||
104 | { .vendor = OCP_VENDOR_IBM, | ||
105 | .function = OCP_FUNC_IIC, | ||
106 | .index = 0, | ||
107 | .paddr = 0x0EF600700ULL, | ||
108 | .irq = 2, | ||
109 | .pm = IBM_CPM_IIC0, | ||
110 | .additions = &ibm440ep_iic0_def, | ||
111 | .show = &ocp_show_iic_data | ||
112 | }, | ||
113 | { .vendor = OCP_VENDOR_IBM, | ||
114 | .function = OCP_FUNC_IIC, | ||
115 | .index = 1, | ||
116 | .paddr = 0x0EF600800ULL, | ||
117 | .irq = 7, | ||
118 | .pm = IBM_CPM_IIC1, | ||
119 | .additions = &ibm440ep_iic1_def, | ||
120 | .show = &ocp_show_iic_data | ||
121 | }, | ||
122 | { .vendor = OCP_VENDOR_IBM, | ||
123 | .function = OCP_FUNC_GPIO, | ||
124 | .index = 0, | ||
125 | .paddr = 0x0EF600B00ULL, | ||
126 | .irq = OCP_IRQ_NA, | ||
127 | .pm = IBM_CPM_GPIO0, | ||
128 | }, | ||
129 | { .vendor = OCP_VENDOR_IBM, | ||
130 | .function = OCP_FUNC_GPIO, | ||
131 | .index = 1, | ||
132 | .paddr = 0x0EF600C00ULL, | ||
133 | .irq = OCP_IRQ_NA, | ||
134 | .pm = OCP_CPM_NA, | ||
135 | }, | ||
136 | { .vendor = OCP_VENDOR_IBM, | ||
137 | .function = OCP_FUNC_MAL, | ||
138 | .paddr = OCP_PADDR_NA, | ||
139 | .irq = OCP_IRQ_NA, | ||
140 | .pm = OCP_CPM_NA, | ||
141 | .additions = &ibm440ep_mal0_def, | ||
142 | .show = &ocp_show_mal_data, | ||
143 | }, | ||
144 | { .vendor = OCP_VENDOR_IBM, | ||
145 | .function = OCP_FUNC_EMAC, | ||
146 | .index = 0, | ||
147 | .paddr = 0x0EF600E00ULL, | ||
148 | .irq = 60, | ||
149 | .pm = OCP_CPM_NA, | ||
150 | .additions = &ibm440ep_emac0_def, | ||
151 | .show = &ocp_show_emac_data, | ||
152 | }, | ||
153 | { .vendor = OCP_VENDOR_IBM, | ||
154 | .function = OCP_FUNC_EMAC, | ||
155 | .index = 1, | ||
156 | .paddr = 0x0EF600F00ULL, | ||
157 | .irq = 62, | ||
158 | .pm = OCP_CPM_NA, | ||
159 | .additions = &ibm440ep_emac1_def, | ||
160 | .show = &ocp_show_emac_data, | ||
161 | }, | ||
162 | { .vendor = OCP_VENDOR_IBM, | ||
163 | .function = OCP_FUNC_ZMII, | ||
164 | .paddr = 0x0EF600D00ULL, | ||
165 | .irq = OCP_IRQ_NA, | ||
166 | .pm = OCP_CPM_NA, | ||
167 | }, | ||
168 | { .vendor = OCP_VENDOR_INVALID | ||
169 | } | ||
170 | }; | ||
171 | |||
172 | /* Polarity and triggering settings for internal interrupt sources */ | ||
173 | struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { | ||
174 | { .polarity = 0xffbffe03, | ||
175 | .triggering = 0xfffffe00, | ||
176 | .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */ | ||
177 | }, | ||
178 | { .polarity = 0xffffc6ef, | ||
179 | .triggering = 0xffffc7ff, | ||
180 | .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */ | ||
181 | }, | ||
182 | }; | ||
183 | |||
184 | static struct resource usb_gadget_resources[] = { | ||
185 | [0] = { | ||
186 | .start = 0x050000100ULL, | ||
187 | .end = 0x05000017FULL, | ||
188 | .flags = IORESOURCE_MEM, | ||
189 | }, | ||
190 | [1] = { | ||
191 | .start = 55, | ||
192 | .end = 55, | ||
193 | .flags = IORESOURCE_IRQ, | ||
194 | }, | ||
195 | }; | ||
196 | |||
197 | static u64 dma_mask = 0xffffffffULL; | ||
198 | |||
199 | static struct platform_device usb_gadget_device = { | ||
200 | .name = "musbhsfc", | ||
201 | .id = 0, | ||
202 | .num_resources = ARRAY_SIZE(usb_gadget_resources), | ||
203 | .resource = usb_gadget_resources, | ||
204 | .dev = { | ||
205 | .dma_mask = &dma_mask, | ||
206 | .coherent_dma_mask = 0xffffffffULL, | ||
207 | } | ||
208 | }; | ||
209 | |||
210 | static struct platform_device *ibm440ep_devs[] __initdata = { | ||
211 | &usb_gadget_device, | ||
212 | }; | ||
213 | |||
214 | static int __init | ||
215 | ibm440ep_platform_add_devices(void) | ||
216 | { | ||
217 | return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs)); | ||
218 | } | ||
219 | arch_initcall(ibm440ep_platform_add_devices); | ||
220 | |||
diff --git a/arch/ppc/platforms/4xx/ibm440ep.h b/arch/ppc/platforms/4xx/ibm440ep.h new file mode 100644 index 000000000000..97c80b8e3e10 --- /dev/null +++ b/arch/ppc/platforms/4xx/ibm440ep.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/4xx/ibm440ep.h | ||
3 | * | ||
4 | * PPC440EP definitions | ||
5 | * | ||
6 | * Wade Farnsworth <wfarnsworth@mvista.com> | ||
7 | * | ||
8 | * Copyright 2002 Roland Dreier | ||
9 | * Copyright 2004 MontaVista Software, Inc. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifdef __KERNEL__ | ||
19 | #ifndef __PPC_PLATFORMS_IBM440EP_H | ||
20 | #define __PPC_PLATFORMS_IBM440EP_H | ||
21 | |||
22 | #include <linux/config.h> | ||
23 | #include <asm/ibm44x.h> | ||
24 | |||
25 | /* UART */ | ||
26 | #define PPC440EP_UART0_ADDR 0x0EF600300 | ||
27 | #define PPC440EP_UART1_ADDR 0x0EF600400 | ||
28 | #define PPC440EP_UART2_ADDR 0x0EF600500 | ||
29 | #define PPC440EP_UART3_ADDR 0x0EF600600 | ||
30 | #define UART0_INT 0 | ||
31 | #define UART1_INT 1 | ||
32 | #define UART2_INT 3 | ||
33 | #define UART3_INT 4 | ||
34 | |||
35 | /* Clock and Power Management */ | ||
36 | #define IBM_CPM_IIC0 0x80000000 /* IIC interface */ | ||
37 | #define IBM_CPM_IIC1 0x40000000 /* IIC interface */ | ||
38 | #define IBM_CPM_PCI 0x20000000 /* PCI bridge */ | ||
39 | #define IBM_CPM_USB1H 0x08000000 /* USB 1.1 Host */ | ||
40 | #define IBM_CPM_FPU 0x04000000 /* floating point unit */ | ||
41 | #define IBM_CPM_CPU 0x02000000 /* processor core */ | ||
42 | #define IBM_CPM_DMA 0x01000000 /* DMA controller */ | ||
43 | #define IBM_CPM_BGO 0x00800000 /* PLB to OPB bus arbiter */ | ||
44 | #define IBM_CPM_BGI 0x00400000 /* OPB to PLB bridge */ | ||
45 | #define IBM_CPM_EBC 0x00200000 /* External Bus Controller */ | ||
46 | #define IBM_CPM_EBM 0x00100000 /* Ext Bus Master Interface */ | ||
47 | #define IBM_CPM_DMC 0x00080000 /* SDRAM peripheral controller */ | ||
48 | #define IBM_CPM_PLB4 0x00040000 /* PLB4 bus arbiter */ | ||
49 | #define IBM_CPM_PLB4x3 0x00020000 /* PLB4 to PLB3 bridge controller */ | ||
50 | #define IBM_CPM_PLB3x4 0x00010000 /* PLB3 to PLB4 bridge controller */ | ||
51 | #define IBM_CPM_PLB3 0x00008000 /* PLB3 bus arbiter */ | ||
52 | #define IBM_CPM_PPM 0x00002000 /* PLB Performance Monitor */ | ||
53 | #define IBM_CPM_UIC1 0x00001000 /* Universal Interrupt Controller */ | ||
54 | #define IBM_CPM_GPIO0 0x00000800 /* General Purpose IO (??) */ | ||
55 | #define IBM_CPM_GPT 0x00000400 /* General Purpose Timers */ | ||
56 | #define IBM_CPM_UART0 0x00000200 /* serial port 0 */ | ||
57 | #define IBM_CPM_UART1 0x00000100 /* serial port 1 */ | ||
58 | #define IBM_CPM_UIC0 0x00000080 /* Universal Interrupt Controller */ | ||
59 | #define IBM_CPM_TMRCLK 0x00000040 /* CPU timers */ | ||
60 | #define IBM_CPM_EMAC0 0x00000020 /* ethernet port 0 */ | ||
61 | #define IBM_CPM_EMAC1 0x00000010 /* ethernet port 1 */ | ||
62 | #define IBM_CPM_UART2 0x00000008 /* serial port 2 */ | ||
63 | #define IBM_CPM_UART3 0x00000004 /* serial port 3 */ | ||
64 | #define IBM_CPM_USB2D 0x00000002 /* USB 2.0 Device */ | ||
65 | #define IBM_CPM_USB2H 0x00000001 /* USB 2.0 Host */ | ||
66 | |||
67 | #define DFLT_IBM4xx_PM ~(IBM_CPM_UIC0 | IBM_CPM_UIC1 | IBM_CPM_CPU \ | ||
68 | | IBM_CPM_EBC | IBM_CPM_BGO | IBM_CPM_FPU \ | ||
69 | | IBM_CPM_EBM | IBM_CPM_PLB4 | IBM_CPM_3x4 \ | ||
70 | | IBM_CPM_PLB3 | IBM_CPM_PLB4x3 \ | ||
71 | | IBM_CPM_EMAC0 | IBM_CPM_TMRCLK \ | ||
72 | | IBM_CPM_DMA | IBM_CPM_PCI | IBM_CPM_EMAC1) | ||
73 | |||
74 | |||
75 | #endif /* __PPC_PLATFORMS_IBM440EP_H */ | ||
76 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c index 5f82a6bc7046..8fc34a344769 100644 --- a/arch/ppc/platforms/4xx/ocotea.c +++ b/arch/ppc/platforms/4xx/ocotea.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <asm/bootinfo.h> | 48 | #include <asm/bootinfo.h> |
49 | #include <asm/ppc4xx_pic.h> | 49 | #include <asm/ppc4xx_pic.h> |
50 | #include <asm/ppcboot.h> | 50 | #include <asm/ppcboot.h> |
51 | #include <asm/tlbflush.h> | ||
51 | 52 | ||
52 | #include <syslib/gen550.h> | 53 | #include <syslib/gen550.h> |
53 | #include <syslib/ibm440gx_common.h> | 54 | #include <syslib/ibm440gx_common.h> |
@@ -266,6 +267,9 @@ ocotea_early_serial_map(void) | |||
266 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) | 267 | #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) |
267 | /* Configure debug serial access */ | 268 | /* Configure debug serial access */ |
268 | gen550_init(0, &port); | 269 | gen550_init(0, &port); |
270 | |||
271 | /* Purge TLB entry added in head_44x.S for early serial access */ | ||
272 | _tlbie(UART0_IO_BASE); | ||
269 | #endif | 273 | #endif |
270 | 274 | ||
271 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); | 275 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); |
diff --git a/arch/ppc/platforms/4xx/ocotea.h b/arch/ppc/platforms/4xx/ocotea.h index 202dc8251190..33251153ac5f 100644 --- a/arch/ppc/platforms/4xx/ocotea.h +++ b/arch/ppc/platforms/4xx/ocotea.h | |||
@@ -55,15 +55,24 @@ | |||
55 | */ | 55 | */ |
56 | #define RS_TABLE_SIZE 2 | 56 | #define RS_TABLE_SIZE 2 |
57 | 57 | ||
58 | /* OpenBIOS defined UART mappings, used before early_serial_setup */ | 58 | #if defined(__BOOTER__) |
59 | /* OpenBIOS defined UART mappings, used by bootloader shim */ | ||
59 | #define UART0_IO_BASE 0xE0000200 | 60 | #define UART0_IO_BASE 0xE0000200 |
60 | #define UART1_IO_BASE 0xE0000300 | 61 | #define UART1_IO_BASE 0xE0000300 |
62 | #else | ||
63 | /* head_44x.S created UART mapping, used before early_serial_setup. | ||
64 | * We cannot use default OpenBIOS UART mappings because they | ||
65 | * don't work for configurations with more than 512M RAM. --ebs | ||
66 | */ | ||
67 | #define UART0_IO_BASE 0xF0000200 | ||
68 | #define UART1_IO_BASE 0xF0000300 | ||
69 | #endif | ||
61 | 70 | ||
62 | #define BASE_BAUD 11059200/16 | 71 | #define BASE_BAUD 11059200/16 |
63 | #define STD_UART_OP(num) \ | 72 | #define STD_UART_OP(num) \ |
64 | { 0, BASE_BAUD, 0, UART##num##_INT, \ | 73 | { 0, BASE_BAUD, 0, UART##num##_INT, \ |
65 | (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | 74 | (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ |
66 | iomem_base: UART##num##_IO_BASE, \ | 75 | iomem_base: (void*)UART##num##_IO_BASE, \ |
67 | io_type: SERIAL_IO_MEM}, | 76 | io_type: SERIAL_IO_MEM}, |
68 | 77 | ||
69 | #define SERIAL_PORT_DFNS \ | 78 | #define SERIAL_PORT_DFNS \ |
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile index dec5bf4f6879..220a65ab0a51 100644 --- a/arch/ppc/syslib/Makefile +++ b/arch/ppc/syslib/Makefile | |||
@@ -11,6 +11,7 @@ obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o | |||
11 | obj-$(CONFIG_PPC_OCP) += ocp.o | 11 | obj-$(CONFIG_PPC_OCP) += ocp.o |
12 | obj-$(CONFIG_IBM_OCP) += ibm_ocp.o | 12 | obj-$(CONFIG_IBM_OCP) += ibm_ocp.o |
13 | obj-$(CONFIG_44x) += ibm44x_common.o | 13 | obj-$(CONFIG_44x) += ibm44x_common.o |
14 | obj-$(CONFIG_440EP) += ibm440gx_common.o | ||
14 | obj-$(CONFIG_440GP) += ibm440gp_common.o | 15 | obj-$(CONFIG_440GP) += ibm440gp_common.o |
15 | obj-$(CONFIG_440GX) += ibm440gx_common.o | 16 | obj-$(CONFIG_440GX) += ibm440gx_common.o |
16 | obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o | 17 | obj-$(CONFIG_440SP) += ibm440gx_common.o ibm440sp_common.o |
@@ -44,6 +45,7 @@ obj-$(CONFIG_PPC_CHRP) += open_pic.o indirect_pci.o i8259.o | |||
44 | obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o | 45 | obj-$(CONFIG_PPC_PREP) += open_pic.o indirect_pci.o i8259.o todc_time.o |
45 | obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ | 46 | obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \ |
46 | todc_time.o | 47 | todc_time.o |
48 | obj-$(CONFIG_BAMBOO) += indirect_pci.o pci_auto.o todc_time.o | ||
47 | obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o | 49 | obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o |
48 | obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o | 50 | obj-$(CONFIG_EBONY) += indirect_pci.o pci_auto.o todc_time.o |
49 | obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o | 51 | obj-$(CONFIG_EV64260) += todc_time.o pci_auto.o |
diff --git a/arch/ppc/syslib/ibm440gx_common.c b/arch/ppc/syslib/ibm440gx_common.c index 4ad85e0e0234..d4776af6a3ca 100644 --- a/arch/ppc/syslib/ibm440gx_common.c +++ b/arch/ppc/syslib/ibm440gx_common.c | |||
@@ -34,6 +34,10 @@ void __init ibm440gx_get_clocks(struct ibm44x_clocks* p, unsigned int sys_clk, | |||
34 | u32 plld = CPR_READ(DCRN_CPR_PLLD); | 34 | u32 plld = CPR_READ(DCRN_CPR_PLLD); |
35 | u32 uart0 = SDR_READ(DCRN_SDR_UART0); | 35 | u32 uart0 = SDR_READ(DCRN_SDR_UART0); |
36 | u32 uart1 = SDR_READ(DCRN_SDR_UART1); | 36 | u32 uart1 = SDR_READ(DCRN_SDR_UART1); |
37 | #ifdef CONFIG_440EP | ||
38 | u32 uart2 = SDR_READ(DCRN_SDR_UART2); | ||
39 | u32 uart3 = SDR_READ(DCRN_SDR_UART3); | ||
40 | #endif | ||
37 | 41 | ||
38 | /* Dividers */ | 42 | /* Dividers */ |
39 | u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32); | 43 | u32 fbdv = __fix_zero((plld >> 24) & 0x1f, 32); |
@@ -96,6 +100,17 @@ bypass: | |||
96 | p->uart1 = ser_clk; | 100 | p->uart1 = ser_clk; |
97 | else | 101 | else |
98 | p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256); | 102 | p->uart1 = p->plb / __fix_zero(uart1 & 0xff, 256); |
103 | #ifdef CONFIG_440EP | ||
104 | if (uart2 & 0x00800000) | ||
105 | p->uart2 = ser_clk; | ||
106 | else | ||
107 | p->uart2 = p->plb / __fix_zero(uart2 & 0xff, 256); | ||
108 | |||
109 | if (uart3 & 0x00800000) | ||
110 | p->uart3 = ser_clk; | ||
111 | else | ||
112 | p->uart3 = p->plb / __fix_zero(uart3 & 0xff, 256); | ||
113 | #endif | ||
99 | } | 114 | } |
100 | 115 | ||
101 | /* Issue L2C diagnostic command */ | 116 | /* Issue L2C diagnostic command */ |
diff --git a/arch/ppc/syslib/ibm44x_common.h b/arch/ppc/syslib/ibm44x_common.h index b14eb603ce01..c16b6a5ac6ab 100644 --- a/arch/ppc/syslib/ibm44x_common.h +++ b/arch/ppc/syslib/ibm44x_common.h | |||
@@ -29,6 +29,10 @@ struct ibm44x_clocks { | |||
29 | unsigned int ebc; /* PerClk */ | 29 | unsigned int ebc; /* PerClk */ |
30 | unsigned int uart0; | 30 | unsigned int uart0; |
31 | unsigned int uart1; | 31 | unsigned int uart1; |
32 | #ifdef CONFIG_440EP | ||
33 | unsigned int uart2; | ||
34 | unsigned int uart3; | ||
35 | #endif | ||
32 | }; | 36 | }; |
33 | 37 | ||
34 | /* common 44x platform init */ | 38 | /* common 44x platform init */ |
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index c1db2ab1d154..a3702cfe8f7c 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c | |||
@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)]; | |||
57 | extern void m8xx_ide_init(void); | 57 | extern void m8xx_ide_init(void); |
58 | 58 | ||
59 | extern unsigned long find_available_memory(void); | 59 | extern unsigned long find_available_memory(void); |
60 | extern void m8xx_cpm_reset(uint cpm_page); | 60 | extern void m8xx_cpm_reset(); |
61 | extern void m8xx_wdt_handler_install(bd_t *bp); | 61 | extern void m8xx_wdt_handler_install(bd_t *bp); |
62 | extern void rpxfb_alloc_pages(void); | 62 | extern void rpxfb_alloc_pages(void); |
63 | extern void cpm_interrupt_init(void); | 63 | extern void cpm_interrupt_init(void); |
@@ -70,13 +70,9 @@ board_init(void) | |||
70 | void __init | 70 | void __init |
71 | m8xx_setup_arch(void) | 71 | m8xx_setup_arch(void) |
72 | { | 72 | { |
73 | int cpm_page; | ||
74 | |||
75 | cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE); | ||
76 | |||
77 | /* Reset the Communication Processor Module. | 73 | /* Reset the Communication Processor Module. |
78 | */ | 74 | */ |
79 | m8xx_cpm_reset(cpm_page); | 75 | m8xx_cpm_reset(); |
80 | 76 | ||
81 | #ifdef CONFIG_FB_RPX | 77 | #ifdef CONFIG_FB_RPX |
82 | rpxfb_alloc_pages(); | 78 | rpxfb_alloc_pages(); |
@@ -427,7 +423,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | |||
427 | ppc_md.find_end_of_memory = m8xx_find_end_of_memory; | 423 | ppc_md.find_end_of_memory = m8xx_find_end_of_memory; |
428 | ppc_md.setup_io_mappings = m8xx_map_io; | 424 | ppc_md.setup_io_mappings = m8xx_map_io; |
429 | 425 | ||
430 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) | 426 | #if defined(CONFIG_BLK_DEV_MPC8xx_IDE) |
431 | m8xx_ide_init(); | 427 | m8xx_ide_init(); |
432 | #endif | 428 | #endif |
433 | } | 429 | } |
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c index 75c8e9834ae7..5aaf0e58e1f9 100644 --- a/arch/ppc/syslib/mpc83xx_devices.c +++ b/arch/ppc/syslib/mpc83xx_devices.c | |||
@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
191 | .num_resources = 2, | 191 | .num_resources = 2, |
192 | .resource = (struct resource[]) { | 192 | .resource = (struct resource[]) { |
193 | { | 193 | { |
194 | .start = 0x22000, | 194 | .start = 0x23000, |
195 | .end = 0x22fff, | 195 | .end = 0x23fff, |
196 | .flags = IORESOURCE_MEM, | 196 | .flags = IORESOURCE_MEM, |
197 | }, | 197 | }, |
198 | { | 198 | { |
@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
208 | .num_resources = 2, | 208 | .num_resources = 2, |
209 | .resource = (struct resource[]) { | 209 | .resource = (struct resource[]) { |
210 | { | 210 | { |
211 | .start = 0x23000, | 211 | .start = 0x22000, |
212 | .end = 0x23fff, | 212 | .end = 0x22fff, |
213 | .flags = IORESOURCE_MEM, | 213 | .flags = IORESOURCE_MEM, |
214 | }, | 214 | }, |
215 | { | 215 | { |
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c index 5015ab99afd2..f15e64285f96 100644 --- a/arch/ppc/syslib/ppc4xx_dma.c +++ b/arch/ppc/syslib/ppc4xx_dma.c | |||
@@ -620,6 +620,7 @@ ppc4xx_clr_dma_status(unsigned int dmanr) | |||
620 | return DMA_STATUS_GOOD; | 620 | return DMA_STATUS_GOOD; |
621 | } | 621 | } |
622 | 622 | ||
623 | #ifdef CONFIG_PPC4xx_EDMA | ||
623 | /* | 624 | /* |
624 | * Enables the burst on the channel (BTEN bit in the control/count register) | 625 | * Enables the burst on the channel (BTEN bit in the control/count register) |
625 | * Note: | 626 | * Note: |
@@ -685,6 +686,11 @@ ppc4xx_set_burst_size(unsigned int dmanr, unsigned int bsize) | |||
685 | return DMA_STATUS_GOOD; | 686 | return DMA_STATUS_GOOD; |
686 | } | 687 | } |
687 | 688 | ||
689 | EXPORT_SYMBOL(ppc4xx_enable_burst); | ||
690 | EXPORT_SYMBOL(ppc4xx_disable_burst); | ||
691 | EXPORT_SYMBOL(ppc4xx_set_burst_size); | ||
692 | #endif /* CONFIG_PPC4xx_EDMA */ | ||
693 | |||
688 | EXPORT_SYMBOL(ppc4xx_init_dma_channel); | 694 | EXPORT_SYMBOL(ppc4xx_init_dma_channel); |
689 | EXPORT_SYMBOL(ppc4xx_get_channel_config); | 695 | EXPORT_SYMBOL(ppc4xx_get_channel_config); |
690 | EXPORT_SYMBOL(ppc4xx_set_channel_priority); | 696 | EXPORT_SYMBOL(ppc4xx_set_channel_priority); |
@@ -703,6 +709,4 @@ EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt); | |||
703 | EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); | 709 | EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt); |
704 | EXPORT_SYMBOL(ppc4xx_get_dma_status); | 710 | EXPORT_SYMBOL(ppc4xx_get_dma_status); |
705 | EXPORT_SYMBOL(ppc4xx_clr_dma_status); | 711 | EXPORT_SYMBOL(ppc4xx_clr_dma_status); |
706 | EXPORT_SYMBOL(ppc4xx_enable_burst); | 712 | |
707 | EXPORT_SYMBOL(ppc4xx_disable_burst); | ||
708 | EXPORT_SYMBOL(ppc4xx_set_burst_size); | ||
diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c index 9d5e4e9832d2..78837e884b8b 100644 --- a/arch/ppc64/boot/zlib.c +++ b/arch/ppc64/boot/zlib.c | |||
@@ -1307,7 +1307,7 @@ local int huft_build( | |||
1307 | { | 1307 | { |
1308 | *t = (inflate_huft *)Z_NULL; | 1308 | *t = (inflate_huft *)Z_NULL; |
1309 | *m = 0; | 1309 | *m = 0; |
1310 | return Z_OK; | 1310 | return Z_DATA_ERROR; |
1311 | } | 1311 | } |
1312 | 1312 | ||
1313 | 1313 | ||
@@ -1351,6 +1351,7 @@ local int huft_build( | |||
1351 | if ((j = *p++) != 0) | 1351 | if ((j = *p++) != 0) |
1352 | v[x[j]++] = i; | 1352 | v[x[j]++] = i; |
1353 | } while (++i < n); | 1353 | } while (++i < n); |
1354 | n = x[g]; /* set n to length of v */ | ||
1354 | 1355 | ||
1355 | 1356 | ||
1356 | /* Generate the Huffman codes and for each, make the table entries */ | 1357 | /* Generate the Huffman codes and for each, make the table entries */ |
diff --git a/arch/ppc64/configs/bpa_defconfig b/arch/ppc64/configs/bpa_defconfig new file mode 100644 index 000000000000..46c5da41c3ae --- /dev/null +++ b/arch/ppc64/configs/bpa_defconfig | |||
@@ -0,0 +1,987 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.13-rc6 | ||
4 | # Mon Aug 8 14:12:19 2005 | ||
5 | # | ||
6 | CONFIG_64BIT=y | ||
7 | CONFIG_MMU=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
10 | CONFIG_GENERIC_ISA_DMA=y | ||
11 | CONFIG_HAVE_DEC_LOCK=y | ||
12 | CONFIG_EARLY_PRINTK=y | ||
13 | CONFIG_COMPAT=y | ||
14 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | ||
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
16 | |||
17 | # | ||
18 | # Code maturity level options | ||
19 | # | ||
20 | CONFIG_EXPERIMENTAL=y | ||
21 | CONFIG_CLEAN_COMPILE=y | ||
22 | CONFIG_LOCK_KERNEL=y | ||
23 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
24 | |||
25 | # | ||
26 | # General setup | ||
27 | # | ||
28 | CONFIG_LOCALVERSION="" | ||
29 | CONFIG_SWAP=y | ||
30 | CONFIG_SYSVIPC=y | ||
31 | # CONFIG_POSIX_MQUEUE is not set | ||
32 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
33 | CONFIG_SYSCTL=y | ||
34 | # CONFIG_AUDIT is not set | ||
35 | CONFIG_HOTPLUG=y | ||
36 | CONFIG_KOBJECT_UEVENT=y | ||
37 | # CONFIG_IKCONFIG is not set | ||
38 | # CONFIG_CPUSETS is not set | ||
39 | # CONFIG_EMBEDDED is not set | ||
40 | CONFIG_KALLSYMS=y | ||
41 | # CONFIG_KALLSYMS_ALL is not set | ||
42 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
43 | CONFIG_PRINTK=y | ||
44 | CONFIG_BUG=y | ||
45 | CONFIG_BASE_FULL=y | ||
46 | CONFIG_FUTEX=y | ||
47 | CONFIG_EPOLL=y | ||
48 | CONFIG_SHMEM=y | ||
49 | CONFIG_CC_ALIGN_FUNCTIONS=0 | ||
50 | CONFIG_CC_ALIGN_LABELS=0 | ||
51 | CONFIG_CC_ALIGN_LOOPS=0 | ||
52 | CONFIG_CC_ALIGN_JUMPS=0 | ||
53 | # CONFIG_TINY_SHMEM is not set | ||
54 | CONFIG_BASE_SMALL=0 | ||
55 | |||
56 | # | ||
57 | # Loadable module support | ||
58 | # | ||
59 | CONFIG_MODULES=y | ||
60 | CONFIG_MODULE_UNLOAD=y | ||
61 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
62 | CONFIG_OBSOLETE_MODPARM=y | ||
63 | # CONFIG_MODVERSIONS is not set | ||
64 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
65 | # CONFIG_KMOD is not set | ||
66 | CONFIG_STOP_MACHINE=y | ||
67 | CONFIG_SYSVIPC_COMPAT=y | ||
68 | |||
69 | # | ||
70 | # Platform support | ||
71 | # | ||
72 | # CONFIG_PPC_ISERIES is not set | ||
73 | CONFIG_PPC_MULTIPLATFORM=y | ||
74 | # CONFIG_PPC_PSERIES is not set | ||
75 | CONFIG_PPC_BPA=y | ||
76 | # CONFIG_PPC_PMAC is not set | ||
77 | # CONFIG_PPC_MAPLE is not set | ||
78 | CONFIG_PPC=y | ||
79 | CONFIG_PPC64=y | ||
80 | CONFIG_PPC_OF=y | ||
81 | CONFIG_BPA_IIC=y | ||
82 | CONFIG_ALTIVEC=y | ||
83 | CONFIG_KEXEC=y | ||
84 | # CONFIG_U3_DART is not set | ||
85 | # CONFIG_BOOTX_TEXT is not set | ||
86 | # CONFIG_POWER4_ONLY is not set | ||
87 | # CONFIG_IOMMU_VMERGE is not set | ||
88 | CONFIG_SMP=y | ||
89 | CONFIG_NR_CPUS=4 | ||
90 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
91 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
92 | CONFIG_SELECT_MEMORY_MODEL=y | ||
93 | CONFIG_FLATMEM_MANUAL=y | ||
94 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
95 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
96 | CONFIG_FLATMEM=y | ||
97 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
98 | # CONFIG_NUMA is not set | ||
99 | CONFIG_SCHED_SMT=y | ||
100 | CONFIG_PREEMPT_NONE=y | ||
101 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
102 | # CONFIG_PREEMPT is not set | ||
103 | CONFIG_PREEMPT_BKL=y | ||
104 | # CONFIG_HZ_100 is not set | ||
105 | CONFIG_HZ_250=y | ||
106 | # CONFIG_HZ_1000 is not set | ||
107 | CONFIG_HZ=250 | ||
108 | CONFIG_GENERIC_HARDIRQS=y | ||
109 | CONFIG_PPC_RTAS=y | ||
110 | CONFIG_RTAS_PROC=y | ||
111 | CONFIG_RTAS_FLASH=y | ||
112 | CONFIG_SECCOMP=y | ||
113 | CONFIG_ISA_DMA_API=y | ||
114 | |||
115 | # | ||
116 | # General setup | ||
117 | # | ||
118 | CONFIG_PCI=y | ||
119 | CONFIG_PCI_DOMAINS=y | ||
120 | CONFIG_BINFMT_ELF=y | ||
121 | # CONFIG_BINFMT_MISC is not set | ||
122 | CONFIG_PCI_LEGACY_PROC=y | ||
123 | CONFIG_PCI_NAMES=y | ||
124 | # CONFIG_PCI_DEBUG is not set | ||
125 | |||
126 | # | ||
127 | # PCCARD (PCMCIA/CardBus) support | ||
128 | # | ||
129 | # CONFIG_PCCARD is not set | ||
130 | |||
131 | # | ||
132 | # PCI Hotplug Support | ||
133 | # | ||
134 | # CONFIG_HOTPLUG_PCI is not set | ||
135 | CONFIG_PROC_DEVICETREE=y | ||
136 | # CONFIG_CMDLINE_BOOL is not set | ||
137 | |||
138 | # | ||
139 | # Networking | ||
140 | # | ||
141 | CONFIG_NET=y | ||
142 | |||
143 | # | ||
144 | # Networking options | ||
145 | # | ||
146 | CONFIG_PACKET=y | ||
147 | # CONFIG_PACKET_MMAP is not set | ||
148 | CONFIG_UNIX=y | ||
149 | CONFIG_XFRM=y | ||
150 | # CONFIG_XFRM_USER is not set | ||
151 | # CONFIG_NET_KEY is not set | ||
152 | CONFIG_INET=y | ||
153 | CONFIG_IP_MULTICAST=y | ||
154 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
155 | CONFIG_IP_FIB_HASH=y | ||
156 | # CONFIG_IP_PNP is not set | ||
157 | CONFIG_NET_IPIP=y | ||
158 | # CONFIG_NET_IPGRE is not set | ||
159 | # CONFIG_IP_MROUTE is not set | ||
160 | # CONFIG_ARPD is not set | ||
161 | CONFIG_SYN_COOKIES=y | ||
162 | # CONFIG_INET_AH is not set | ||
163 | # CONFIG_INET_ESP is not set | ||
164 | # CONFIG_INET_IPCOMP is not set | ||
165 | CONFIG_INET_TUNNEL=y | ||
166 | CONFIG_IP_TCPDIAG=y | ||
167 | CONFIG_IP_TCPDIAG_IPV6=y | ||
168 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
169 | CONFIG_TCP_CONG_BIC=y | ||
170 | |||
171 | # | ||
172 | # IP: Virtual Server Configuration | ||
173 | # | ||
174 | # CONFIG_IP_VS is not set | ||
175 | CONFIG_IPV6=y | ||
176 | # CONFIG_IPV6_PRIVACY is not set | ||
177 | CONFIG_INET6_AH=m | ||
178 | CONFIG_INET6_ESP=m | ||
179 | CONFIG_INET6_IPCOMP=m | ||
180 | CONFIG_INET6_TUNNEL=m | ||
181 | CONFIG_IPV6_TUNNEL=m | ||
182 | CONFIG_NETFILTER=y | ||
183 | # CONFIG_NETFILTER_DEBUG is not set | ||
184 | |||
185 | # | ||
186 | # IP: Netfilter Configuration | ||
187 | # | ||
188 | CONFIG_IP_NF_CONNTRACK=y | ||
189 | # CONFIG_IP_NF_CT_ACCT is not set | ||
190 | # CONFIG_IP_NF_CONNTRACK_MARK is not set | ||
191 | CONFIG_IP_NF_CT_PROTO_SCTP=y | ||
192 | CONFIG_IP_NF_FTP=m | ||
193 | CONFIG_IP_NF_IRC=m | ||
194 | CONFIG_IP_NF_TFTP=m | ||
195 | CONFIG_IP_NF_AMANDA=m | ||
196 | CONFIG_IP_NF_QUEUE=m | ||
197 | CONFIG_IP_NF_IPTABLES=m | ||
198 | CONFIG_IP_NF_MATCH_LIMIT=m | ||
199 | CONFIG_IP_NF_MATCH_IPRANGE=m | ||
200 | CONFIG_IP_NF_MATCH_MAC=m | ||
201 | CONFIG_IP_NF_MATCH_PKTTYPE=m | ||
202 | CONFIG_IP_NF_MATCH_MARK=m | ||
203 | CONFIG_IP_NF_MATCH_MULTIPORT=m | ||
204 | CONFIG_IP_NF_MATCH_TOS=m | ||
205 | CONFIG_IP_NF_MATCH_RECENT=m | ||
206 | CONFIG_IP_NF_MATCH_ECN=m | ||
207 | CONFIG_IP_NF_MATCH_DSCP=m | ||
208 | CONFIG_IP_NF_MATCH_AH_ESP=m | ||
209 | CONFIG_IP_NF_MATCH_LENGTH=m | ||
210 | CONFIG_IP_NF_MATCH_TTL=m | ||
211 | CONFIG_IP_NF_MATCH_TCPMSS=m | ||
212 | CONFIG_IP_NF_MATCH_HELPER=m | ||
213 | CONFIG_IP_NF_MATCH_STATE=m | ||
214 | CONFIG_IP_NF_MATCH_CONNTRACK=m | ||
215 | CONFIG_IP_NF_MATCH_OWNER=m | ||
216 | CONFIG_IP_NF_MATCH_ADDRTYPE=m | ||
217 | CONFIG_IP_NF_MATCH_REALM=m | ||
218 | CONFIG_IP_NF_MATCH_SCTP=m | ||
219 | CONFIG_IP_NF_MATCH_COMMENT=m | ||
220 | CONFIG_IP_NF_MATCH_HASHLIMIT=m | ||
221 | CONFIG_IP_NF_FILTER=m | ||
222 | CONFIG_IP_NF_TARGET_REJECT=m | ||
223 | CONFIG_IP_NF_TARGET_LOG=m | ||
224 | CONFIG_IP_NF_TARGET_ULOG=m | ||
225 | CONFIG_IP_NF_TARGET_TCPMSS=m | ||
226 | CONFIG_IP_NF_NAT=m | ||
227 | CONFIG_IP_NF_NAT_NEEDED=y | ||
228 | CONFIG_IP_NF_TARGET_MASQUERADE=m | ||
229 | CONFIG_IP_NF_TARGET_REDIRECT=m | ||
230 | CONFIG_IP_NF_TARGET_NETMAP=m | ||
231 | CONFIG_IP_NF_TARGET_SAME=m | ||
232 | CONFIG_IP_NF_NAT_SNMP_BASIC=m | ||
233 | CONFIG_IP_NF_NAT_IRC=m | ||
234 | CONFIG_IP_NF_NAT_FTP=m | ||
235 | CONFIG_IP_NF_NAT_TFTP=m | ||
236 | CONFIG_IP_NF_NAT_AMANDA=m | ||
237 | CONFIG_IP_NF_MANGLE=m | ||
238 | CONFIG_IP_NF_TARGET_TOS=m | ||
239 | CONFIG_IP_NF_TARGET_ECN=m | ||
240 | CONFIG_IP_NF_TARGET_DSCP=m | ||
241 | CONFIG_IP_NF_TARGET_MARK=m | ||
242 | CONFIG_IP_NF_TARGET_CLASSIFY=m | ||
243 | CONFIG_IP_NF_RAW=m | ||
244 | CONFIG_IP_NF_TARGET_NOTRACK=m | ||
245 | CONFIG_IP_NF_ARPTABLES=m | ||
246 | CONFIG_IP_NF_ARPFILTER=m | ||
247 | CONFIG_IP_NF_ARP_MANGLE=m | ||
248 | |||
249 | # | ||
250 | # IPv6: Netfilter Configuration (EXPERIMENTAL) | ||
251 | # | ||
252 | # CONFIG_IP6_NF_QUEUE is not set | ||
253 | # CONFIG_IP6_NF_IPTABLES is not set | ||
254 | |||
255 | # | ||
256 | # SCTP Configuration (EXPERIMENTAL) | ||
257 | # | ||
258 | # CONFIG_IP_SCTP is not set | ||
259 | # CONFIG_ATM is not set | ||
260 | # CONFIG_BRIDGE is not set | ||
261 | # CONFIG_VLAN_8021Q is not set | ||
262 | # CONFIG_DECNET is not set | ||
263 | # CONFIG_LLC2 is not set | ||
264 | # CONFIG_IPX is not set | ||
265 | # CONFIG_ATALK is not set | ||
266 | # CONFIG_X25 is not set | ||
267 | # CONFIG_LAPB is not set | ||
268 | # CONFIG_NET_DIVERT is not set | ||
269 | # CONFIG_ECONET is not set | ||
270 | # CONFIG_WAN_ROUTER is not set | ||
271 | # CONFIG_NET_SCHED is not set | ||
272 | CONFIG_NET_CLS_ROUTE=y | ||
273 | |||
274 | # | ||
275 | # Network testing | ||
276 | # | ||
277 | # CONFIG_NET_PKTGEN is not set | ||
278 | # CONFIG_HAMRADIO is not set | ||
279 | # CONFIG_IRDA is not set | ||
280 | # CONFIG_BT is not set | ||
281 | |||
282 | # | ||
283 | # Device Drivers | ||
284 | # | ||
285 | |||
286 | # | ||
287 | # Generic Driver Options | ||
288 | # | ||
289 | CONFIG_STANDALONE=y | ||
290 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
291 | CONFIG_FW_LOADER=y | ||
292 | # CONFIG_DEBUG_DRIVER is not set | ||
293 | |||
294 | # | ||
295 | # Memory Technology Devices (MTD) | ||
296 | # | ||
297 | # CONFIG_MTD is not set | ||
298 | |||
299 | # | ||
300 | # Parallel port support | ||
301 | # | ||
302 | # CONFIG_PARPORT is not set | ||
303 | |||
304 | # | ||
305 | # Plug and Play support | ||
306 | # | ||
307 | |||
308 | # | ||
309 | # Block devices | ||
310 | # | ||
311 | # CONFIG_BLK_DEV_FD is not set | ||
312 | # CONFIG_BLK_CPQ_DA is not set | ||
313 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
314 | # CONFIG_BLK_DEV_DAC960 is not set | ||
315 | # CONFIG_BLK_DEV_UMEM is not set | ||
316 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
317 | CONFIG_BLK_DEV_LOOP=y | ||
318 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
319 | CONFIG_BLK_DEV_NBD=y | ||
320 | # CONFIG_BLK_DEV_SX8 is not set | ||
321 | CONFIG_BLK_DEV_RAM=y | ||
322 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
323 | CONFIG_BLK_DEV_RAM_SIZE=131072 | ||
324 | CONFIG_BLK_DEV_INITRD=y | ||
325 | CONFIG_INITRAMFS_SOURCE="" | ||
326 | # CONFIG_CDROM_PKTCDVD is not set | ||
327 | |||
328 | # | ||
329 | # IO Schedulers | ||
330 | # | ||
331 | CONFIG_IOSCHED_NOOP=y | ||
332 | CONFIG_IOSCHED_AS=y | ||
333 | CONFIG_IOSCHED_DEADLINE=y | ||
334 | CONFIG_IOSCHED_CFQ=y | ||
335 | # CONFIG_ATA_OVER_ETH is not set | ||
336 | |||
337 | # | ||
338 | # ATA/ATAPI/MFM/RLL support | ||
339 | # | ||
340 | CONFIG_IDE=y | ||
341 | CONFIG_BLK_DEV_IDE=y | ||
342 | |||
343 | # | ||
344 | # Please see Documentation/ide.txt for help/info on IDE drives | ||
345 | # | ||
346 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
347 | CONFIG_BLK_DEV_IDEDISK=y | ||
348 | CONFIG_IDEDISK_MULTI_MODE=y | ||
349 | # CONFIG_BLK_DEV_IDECD is not set | ||
350 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
351 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
352 | # CONFIG_IDE_TASK_IOCTL is not set | ||
353 | |||
354 | # | ||
355 | # IDE chipset support/bugfixes | ||
356 | # | ||
357 | CONFIG_IDE_GENERIC=y | ||
358 | CONFIG_BLK_DEV_IDEPCI=y | ||
359 | CONFIG_IDEPCI_SHARE_IRQ=y | ||
360 | # CONFIG_BLK_DEV_OFFBOARD is not set | ||
361 | CONFIG_BLK_DEV_GENERIC=y | ||
362 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
363 | # CONFIG_BLK_DEV_SL82C105 is not set | ||
364 | CONFIG_BLK_DEV_IDEDMA_PCI=y | ||
365 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | ||
366 | CONFIG_IDEDMA_PCI_AUTO=y | ||
367 | # CONFIG_IDEDMA_ONLYDISK is not set | ||
368 | CONFIG_BLK_DEV_AEC62XX=y | ||
369 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
370 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
371 | # CONFIG_BLK_DEV_CMD64X is not set | ||
372 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
373 | # CONFIG_BLK_DEV_CY82C693 is not set | ||
374 | # CONFIG_BLK_DEV_CS5520 is not set | ||
375 | # CONFIG_BLK_DEV_CS5530 is not set | ||
376 | # CONFIG_BLK_DEV_HPT34X is not set | ||
377 | # CONFIG_BLK_DEV_HPT366 is not set | ||
378 | # CONFIG_BLK_DEV_SC1200 is not set | ||
379 | # CONFIG_BLK_DEV_PIIX is not set | ||
380 | # CONFIG_BLK_DEV_IT821X is not set | ||
381 | # CONFIG_BLK_DEV_NS87415 is not set | ||
382 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
383 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
384 | # CONFIG_BLK_DEV_SVWKS is not set | ||
385 | CONFIG_BLK_DEV_SIIMAGE=y | ||
386 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
387 | # CONFIG_BLK_DEV_TRM290 is not set | ||
388 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
389 | # CONFIG_IDE_ARM is not set | ||
390 | CONFIG_BLK_DEV_IDEDMA=y | ||
391 | # CONFIG_IDEDMA_IVB is not set | ||
392 | CONFIG_IDEDMA_AUTO=y | ||
393 | # CONFIG_BLK_DEV_HD is not set | ||
394 | |||
395 | # | ||
396 | # SCSI device support | ||
397 | # | ||
398 | # CONFIG_SCSI is not set | ||
399 | |||
400 | # | ||
401 | # Multi-device support (RAID and LVM) | ||
402 | # | ||
403 | # CONFIG_MD is not set | ||
404 | |||
405 | # | ||
406 | # Fusion MPT device support | ||
407 | # | ||
408 | # CONFIG_FUSION is not set | ||
409 | |||
410 | # | ||
411 | # IEEE 1394 (FireWire) support | ||
412 | # | ||
413 | # CONFIG_IEEE1394 is not set | ||
414 | |||
415 | # | ||
416 | # I2O device support | ||
417 | # | ||
418 | # CONFIG_I2O is not set | ||
419 | |||
420 | # | ||
421 | # Macintosh device drivers | ||
422 | # | ||
423 | |||
424 | # | ||
425 | # Network device support | ||
426 | # | ||
427 | CONFIG_NETDEVICES=y | ||
428 | # CONFIG_DUMMY is not set | ||
429 | # CONFIG_BONDING is not set | ||
430 | # CONFIG_EQUALIZER is not set | ||
431 | # CONFIG_TUN is not set | ||
432 | |||
433 | # | ||
434 | # ARCnet devices | ||
435 | # | ||
436 | # CONFIG_ARCNET is not set | ||
437 | |||
438 | # | ||
439 | # Ethernet (10 or 100Mbit) | ||
440 | # | ||
441 | CONFIG_NET_ETHERNET=y | ||
442 | CONFIG_MII=y | ||
443 | # CONFIG_HAPPYMEAL is not set | ||
444 | # CONFIG_SUNGEM is not set | ||
445 | # CONFIG_NET_VENDOR_3COM is not set | ||
446 | |||
447 | # | ||
448 | # Tulip family network device support | ||
449 | # | ||
450 | # CONFIG_NET_TULIP is not set | ||
451 | # CONFIG_HP100 is not set | ||
452 | # CONFIG_NET_PCI is not set | ||
453 | |||
454 | # | ||
455 | # Ethernet (1000 Mbit) | ||
456 | # | ||
457 | # CONFIG_ACENIC is not set | ||
458 | # CONFIG_DL2K is not set | ||
459 | CONFIG_E1000=m | ||
460 | # CONFIG_E1000_NAPI is not set | ||
461 | # CONFIG_NS83820 is not set | ||
462 | # CONFIG_HAMACHI is not set | ||
463 | # CONFIG_YELLOWFIN is not set | ||
464 | # CONFIG_R8169 is not set | ||
465 | CONFIG_SKGE=m | ||
466 | # CONFIG_SK98LIN is not set | ||
467 | # CONFIG_TIGON3 is not set | ||
468 | # CONFIG_BNX2 is not set | ||
469 | # CONFIG_MV643XX_ETH is not set | ||
470 | |||
471 | # | ||
472 | # Ethernet (10000 Mbit) | ||
473 | # | ||
474 | # CONFIG_IXGB is not set | ||
475 | # CONFIG_S2IO is not set | ||
476 | |||
477 | # | ||
478 | # Token Ring devices | ||
479 | # | ||
480 | # CONFIG_TR is not set | ||
481 | |||
482 | # | ||
483 | # Wireless LAN (non-hamradio) | ||
484 | # | ||
485 | # CONFIG_NET_RADIO is not set | ||
486 | |||
487 | # | ||
488 | # Wan interfaces | ||
489 | # | ||
490 | # CONFIG_WAN is not set | ||
491 | # CONFIG_FDDI is not set | ||
492 | # CONFIG_HIPPI is not set | ||
493 | # CONFIG_PPP is not set | ||
494 | # CONFIG_SLIP is not set | ||
495 | # CONFIG_SHAPER is not set | ||
496 | # CONFIG_NETCONSOLE is not set | ||
497 | # CONFIG_NETPOLL is not set | ||
498 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
499 | |||
500 | # | ||
501 | # ISDN subsystem | ||
502 | # | ||
503 | # CONFIG_ISDN is not set | ||
504 | |||
505 | # | ||
506 | # Telephony Support | ||
507 | # | ||
508 | # CONFIG_PHONE is not set | ||
509 | |||
510 | # | ||
511 | # Input device support | ||
512 | # | ||
513 | CONFIG_INPUT=y | ||
514 | |||
515 | # | ||
516 | # Userland interfaces | ||
517 | # | ||
518 | CONFIG_INPUT_MOUSEDEV=y | ||
519 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
520 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
521 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
522 | # CONFIG_INPUT_JOYDEV is not set | ||
523 | # CONFIG_INPUT_TSDEV is not set | ||
524 | # CONFIG_INPUT_EVDEV is not set | ||
525 | # CONFIG_INPUT_EVBUG is not set | ||
526 | |||
527 | # | ||
528 | # Input Device Drivers | ||
529 | # | ||
530 | # CONFIG_INPUT_KEYBOARD is not set | ||
531 | # CONFIG_INPUT_MOUSE is not set | ||
532 | # CONFIG_INPUT_JOYSTICK is not set | ||
533 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
534 | # CONFIG_INPUT_MISC is not set | ||
535 | |||
536 | # | ||
537 | # Hardware I/O ports | ||
538 | # | ||
539 | CONFIG_SERIO=y | ||
540 | # CONFIG_SERIO_I8042 is not set | ||
541 | CONFIG_SERIO_SERPORT=y | ||
542 | # CONFIG_SERIO_PCIPS2 is not set | ||
543 | # CONFIG_SERIO_RAW is not set | ||
544 | # CONFIG_GAMEPORT is not set | ||
545 | |||
546 | # | ||
547 | # Character devices | ||
548 | # | ||
549 | CONFIG_VT=y | ||
550 | CONFIG_VT_CONSOLE=y | ||
551 | CONFIG_HW_CONSOLE=y | ||
552 | CONFIG_SERIAL_NONSTANDARD=y | ||
553 | # CONFIG_ROCKETPORT is not set | ||
554 | # CONFIG_CYCLADES is not set | ||
555 | # CONFIG_MOXA_SMARTIO is not set | ||
556 | # CONFIG_ISI is not set | ||
557 | # CONFIG_SYNCLINK is not set | ||
558 | # CONFIG_SYNCLINKMP is not set | ||
559 | # CONFIG_N_HDLC is not set | ||
560 | # CONFIG_SPECIALIX is not set | ||
561 | # CONFIG_SX is not set | ||
562 | # CONFIG_STALDRV is not set | ||
563 | |||
564 | # | ||
565 | # Serial drivers | ||
566 | # | ||
567 | CONFIG_SERIAL_8250=y | ||
568 | CONFIG_SERIAL_8250_CONSOLE=y | ||
569 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
570 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
571 | |||
572 | # | ||
573 | # Non-8250 serial port support | ||
574 | # | ||
575 | CONFIG_SERIAL_CORE=y | ||
576 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
577 | # CONFIG_SERIAL_JSM is not set | ||
578 | CONFIG_UNIX98_PTYS=y | ||
579 | # CONFIG_LEGACY_PTYS is not set | ||
580 | |||
581 | # | ||
582 | # IPMI | ||
583 | # | ||
584 | # CONFIG_IPMI_HANDLER is not set | ||
585 | |||
586 | # | ||
587 | # Watchdog Cards | ||
588 | # | ||
589 | CONFIG_WATCHDOG=y | ||
590 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
591 | |||
592 | # | ||
593 | # Watchdog Device Drivers | ||
594 | # | ||
595 | # CONFIG_SOFT_WATCHDOG is not set | ||
596 | CONFIG_WATCHDOG_RTAS=y | ||
597 | |||
598 | # | ||
599 | # PCI-based Watchdog Cards | ||
600 | # | ||
601 | # CONFIG_PCIPCWATCHDOG is not set | ||
602 | # CONFIG_WDTPCI is not set | ||
603 | # CONFIG_RTC is not set | ||
604 | # CONFIG_DTLK is not set | ||
605 | # CONFIG_R3964 is not set | ||
606 | # CONFIG_APPLICOM is not set | ||
607 | |||
608 | # | ||
609 | # Ftape, the floppy tape device driver | ||
610 | # | ||
611 | # CONFIG_AGP is not set | ||
612 | # CONFIG_DRM is not set | ||
613 | # CONFIG_RAW_DRIVER is not set | ||
614 | # CONFIG_HANGCHECK_TIMER is not set | ||
615 | |||
616 | # | ||
617 | # TPM devices | ||
618 | # | ||
619 | # CONFIG_TCG_TPM is not set | ||
620 | |||
621 | # | ||
622 | # I2C support | ||
623 | # | ||
624 | CONFIG_I2C=y | ||
625 | # CONFIG_I2C_CHARDEV is not set | ||
626 | |||
627 | # | ||
628 | # I2C Algorithms | ||
629 | # | ||
630 | CONFIG_I2C_ALGOBIT=y | ||
631 | # CONFIG_I2C_ALGOPCF is not set | ||
632 | # CONFIG_I2C_ALGOPCA is not set | ||
633 | |||
634 | # | ||
635 | # I2C Hardware Bus support | ||
636 | # | ||
637 | # CONFIG_I2C_ALI1535 is not set | ||
638 | # CONFIG_I2C_ALI1563 is not set | ||
639 | # CONFIG_I2C_ALI15X3 is not set | ||
640 | # CONFIG_I2C_AMD756 is not set | ||
641 | # CONFIG_I2C_AMD8111 is not set | ||
642 | # CONFIG_I2C_I801 is not set | ||
643 | # CONFIG_I2C_I810 is not set | ||
644 | # CONFIG_I2C_PIIX4 is not set | ||
645 | # CONFIG_I2C_ISA is not set | ||
646 | # CONFIG_I2C_NFORCE2 is not set | ||
647 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
648 | # CONFIG_I2C_PROSAVAGE is not set | ||
649 | # CONFIG_I2C_SAVAGE4 is not set | ||
650 | # CONFIG_SCx200_ACB is not set | ||
651 | # CONFIG_I2C_SIS5595 is not set | ||
652 | # CONFIG_I2C_SIS630 is not set | ||
653 | # CONFIG_I2C_SIS96X is not set | ||
654 | # CONFIG_I2C_STUB is not set | ||
655 | # CONFIG_I2C_VIA is not set | ||
656 | # CONFIG_I2C_VIAPRO is not set | ||
657 | # CONFIG_I2C_VOODOO3 is not set | ||
658 | # CONFIG_I2C_PCA_ISA is not set | ||
659 | # CONFIG_I2C_SENSOR is not set | ||
660 | |||
661 | # | ||
662 | # Miscellaneous I2C Chip support | ||
663 | # | ||
664 | # CONFIG_SENSORS_DS1337 is not set | ||
665 | # CONFIG_SENSORS_DS1374 is not set | ||
666 | # CONFIG_SENSORS_EEPROM is not set | ||
667 | # CONFIG_SENSORS_PCF8574 is not set | ||
668 | # CONFIG_SENSORS_PCA9539 is not set | ||
669 | # CONFIG_SENSORS_PCF8591 is not set | ||
670 | # CONFIG_SENSORS_RTC8564 is not set | ||
671 | # CONFIG_SENSORS_MAX6875 is not set | ||
672 | # CONFIG_I2C_DEBUG_CORE is not set | ||
673 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
674 | # CONFIG_I2C_DEBUG_BUS is not set | ||
675 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
676 | |||
677 | # | ||
678 | # Dallas's 1-wire bus | ||
679 | # | ||
680 | # CONFIG_W1 is not set | ||
681 | |||
682 | # | ||
683 | # Hardware Monitoring support | ||
684 | # | ||
685 | # CONFIG_HWMON is not set | ||
686 | |||
687 | # | ||
688 | # Misc devices | ||
689 | # | ||
690 | |||
691 | # | ||
692 | # Multimedia devices | ||
693 | # | ||
694 | # CONFIG_VIDEO_DEV is not set | ||
695 | |||
696 | # | ||
697 | # Digital Video Broadcasting Devices | ||
698 | # | ||
699 | # CONFIG_DVB is not set | ||
700 | |||
701 | # | ||
702 | # Graphics support | ||
703 | # | ||
704 | # CONFIG_FB is not set | ||
705 | |||
706 | # | ||
707 | # Console display driver support | ||
708 | # | ||
709 | # CONFIG_VGA_CONSOLE is not set | ||
710 | CONFIG_DUMMY_CONSOLE=y | ||
711 | |||
712 | # | ||
713 | # Sound | ||
714 | # | ||
715 | # CONFIG_SOUND is not set | ||
716 | |||
717 | # | ||
718 | # USB support | ||
719 | # | ||
720 | CONFIG_USB_ARCH_HAS_HCD=y | ||
721 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
722 | # CONFIG_USB is not set | ||
723 | |||
724 | # | ||
725 | # USB Gadget Support | ||
726 | # | ||
727 | # CONFIG_USB_GADGET is not set | ||
728 | |||
729 | # | ||
730 | # MMC/SD Card support | ||
731 | # | ||
732 | # CONFIG_MMC is not set | ||
733 | |||
734 | # | ||
735 | # InfiniBand support | ||
736 | # | ||
737 | # CONFIG_INFINIBAND is not set | ||
738 | |||
739 | # | ||
740 | # SN Devices | ||
741 | # | ||
742 | |||
743 | # | ||
744 | # File systems | ||
745 | # | ||
746 | CONFIG_EXT2_FS=y | ||
747 | # CONFIG_EXT2_FS_XATTR is not set | ||
748 | # CONFIG_EXT2_FS_XIP is not set | ||
749 | CONFIG_EXT3_FS=y | ||
750 | CONFIG_EXT3_FS_XATTR=y | ||
751 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
752 | # CONFIG_EXT3_FS_SECURITY is not set | ||
753 | CONFIG_JBD=y | ||
754 | # CONFIG_JBD_DEBUG is not set | ||
755 | CONFIG_FS_MBCACHE=y | ||
756 | # CONFIG_REISERFS_FS is not set | ||
757 | # CONFIG_JFS_FS is not set | ||
758 | CONFIG_FS_POSIX_ACL=y | ||
759 | |||
760 | # | ||
761 | # XFS support | ||
762 | # | ||
763 | # CONFIG_XFS_FS is not set | ||
764 | # CONFIG_MINIX_FS is not set | ||
765 | # CONFIG_ROMFS_FS is not set | ||
766 | CONFIG_INOTIFY=y | ||
767 | # CONFIG_QUOTA is not set | ||
768 | CONFIG_DNOTIFY=y | ||
769 | # CONFIG_AUTOFS_FS is not set | ||
770 | # CONFIG_AUTOFS4_FS is not set | ||
771 | |||
772 | # | ||
773 | # CD-ROM/DVD Filesystems | ||
774 | # | ||
775 | CONFIG_ISO9660_FS=m | ||
776 | CONFIG_JOLIET=y | ||
777 | # CONFIG_ZISOFS is not set | ||
778 | CONFIG_UDF_FS=m | ||
779 | CONFIG_UDF_NLS=y | ||
780 | |||
781 | # | ||
782 | # DOS/FAT/NT Filesystems | ||
783 | # | ||
784 | CONFIG_FAT_FS=m | ||
785 | CONFIG_MSDOS_FS=m | ||
786 | CONFIG_VFAT_FS=m | ||
787 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
788 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
789 | # CONFIG_NTFS_FS is not set | ||
790 | |||
791 | # | ||
792 | # Pseudo filesystems | ||
793 | # | ||
794 | CONFIG_PROC_FS=y | ||
795 | CONFIG_PROC_KCORE=y | ||
796 | CONFIG_SYSFS=y | ||
797 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
798 | CONFIG_TMPFS=y | ||
799 | CONFIG_TMPFS_XATTR=y | ||
800 | # CONFIG_TMPFS_SECURITY is not set | ||
801 | CONFIG_HUGETLBFS=y | ||
802 | CONFIG_HUGETLB_PAGE=y | ||
803 | CONFIG_RAMFS=y | ||
804 | |||
805 | # | ||
806 | # Miscellaneous filesystems | ||
807 | # | ||
808 | # CONFIG_ADFS_FS is not set | ||
809 | # CONFIG_AFFS_FS is not set | ||
810 | # CONFIG_HFS_FS is not set | ||
811 | # CONFIG_HFSPLUS_FS is not set | ||
812 | # CONFIG_BEFS_FS is not set | ||
813 | # CONFIG_BFS_FS is not set | ||
814 | # CONFIG_EFS_FS is not set | ||
815 | # CONFIG_CRAMFS is not set | ||
816 | # CONFIG_VXFS_FS is not set | ||
817 | # CONFIG_HPFS_FS is not set | ||
818 | # CONFIG_QNX4FS_FS is not set | ||
819 | # CONFIG_SYSV_FS is not set | ||
820 | # CONFIG_UFS_FS is not set | ||
821 | |||
822 | # | ||
823 | # Network File Systems | ||
824 | # | ||
825 | CONFIG_NFS_FS=m | ||
826 | CONFIG_NFS_V3=y | ||
827 | CONFIG_NFS_V3_ACL=y | ||
828 | # CONFIG_NFS_V4 is not set | ||
829 | # CONFIG_NFS_DIRECTIO is not set | ||
830 | CONFIG_NFSD=m | ||
831 | CONFIG_NFSD_V2_ACL=y | ||
832 | CONFIG_NFSD_V3=y | ||
833 | CONFIG_NFSD_V3_ACL=y | ||
834 | # CONFIG_NFSD_V4 is not set | ||
835 | CONFIG_NFSD_TCP=y | ||
836 | CONFIG_LOCKD=m | ||
837 | CONFIG_LOCKD_V4=y | ||
838 | CONFIG_EXPORTFS=m | ||
839 | CONFIG_NFS_ACL_SUPPORT=m | ||
840 | CONFIG_NFS_COMMON=y | ||
841 | CONFIG_SUNRPC=m | ||
842 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
843 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
844 | # CONFIG_SMB_FS is not set | ||
845 | # CONFIG_CIFS is not set | ||
846 | # CONFIG_NCP_FS is not set | ||
847 | # CONFIG_CODA_FS is not set | ||
848 | # CONFIG_AFS_FS is not set | ||
849 | |||
850 | # | ||
851 | # Partition Types | ||
852 | # | ||
853 | CONFIG_PARTITION_ADVANCED=y | ||
854 | # CONFIG_ACORN_PARTITION is not set | ||
855 | # CONFIG_OSF_PARTITION is not set | ||
856 | # CONFIG_AMIGA_PARTITION is not set | ||
857 | # CONFIG_ATARI_PARTITION is not set | ||
858 | # CONFIG_MAC_PARTITION is not set | ||
859 | CONFIG_MSDOS_PARTITION=y | ||
860 | # CONFIG_BSD_DISKLABEL is not set | ||
861 | # CONFIG_MINIX_SUBPARTITION is not set | ||
862 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
863 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
864 | # CONFIG_LDM_PARTITION is not set | ||
865 | # CONFIG_SGI_PARTITION is not set | ||
866 | # CONFIG_ULTRIX_PARTITION is not set | ||
867 | # CONFIG_SUN_PARTITION is not set | ||
868 | CONFIG_EFI_PARTITION=y | ||
869 | |||
870 | # | ||
871 | # Native Language Support | ||
872 | # | ||
873 | CONFIG_NLS=m | ||
874 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
875 | # CONFIG_NLS_CODEPAGE_437 is not set | ||
876 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
877 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
878 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
879 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
880 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
881 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
882 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
883 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
884 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
885 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
886 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
887 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
888 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
889 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
890 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
891 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
892 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
893 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
894 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
895 | # CONFIG_NLS_ISO8859_8 is not set | ||
896 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
897 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
898 | # CONFIG_NLS_ASCII is not set | ||
899 | CONFIG_NLS_ISO8859_1=m | ||
900 | CONFIG_NLS_ISO8859_2=m | ||
901 | CONFIG_NLS_ISO8859_3=m | ||
902 | CONFIG_NLS_ISO8859_4=m | ||
903 | CONFIG_NLS_ISO8859_5=m | ||
904 | CONFIG_NLS_ISO8859_6=m | ||
905 | CONFIG_NLS_ISO8859_7=m | ||
906 | CONFIG_NLS_ISO8859_9=m | ||
907 | CONFIG_NLS_ISO8859_13=m | ||
908 | CONFIG_NLS_ISO8859_14=m | ||
909 | CONFIG_NLS_ISO8859_15=m | ||
910 | # CONFIG_NLS_KOI8_R is not set | ||
911 | # CONFIG_NLS_KOI8_U is not set | ||
912 | # CONFIG_NLS_UTF8 is not set | ||
913 | |||
914 | # | ||
915 | # Profiling support | ||
916 | # | ||
917 | # CONFIG_PROFILING is not set | ||
918 | |||
919 | # | ||
920 | # Kernel hacking | ||
921 | # | ||
922 | # CONFIG_PRINTK_TIME is not set | ||
923 | CONFIG_DEBUG_KERNEL=y | ||
924 | CONFIG_MAGIC_SYSRQ=y | ||
925 | CONFIG_LOG_BUF_SHIFT=15 | ||
926 | # CONFIG_SCHEDSTATS is not set | ||
927 | # CONFIG_DEBUG_SLAB is not set | ||
928 | # CONFIG_DEBUG_SPINLOCK is not set | ||
929 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
930 | # CONFIG_DEBUG_KOBJECT is not set | ||
931 | # CONFIG_DEBUG_INFO is not set | ||
932 | CONFIG_DEBUG_FS=y | ||
933 | # CONFIG_DEBUG_STACKOVERFLOW is not set | ||
934 | # CONFIG_KPROBES is not set | ||
935 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
936 | CONFIG_DEBUGGER=y | ||
937 | # CONFIG_XMON is not set | ||
938 | # CONFIG_PPCDBG is not set | ||
939 | CONFIG_IRQSTACKS=y | ||
940 | |||
941 | # | ||
942 | # Security options | ||
943 | # | ||
944 | # CONFIG_KEYS is not set | ||
945 | # CONFIG_SECURITY is not set | ||
946 | |||
947 | # | ||
948 | # Cryptographic options | ||
949 | # | ||
950 | CONFIG_CRYPTO=y | ||
951 | CONFIG_CRYPTO_HMAC=y | ||
952 | # CONFIG_CRYPTO_NULL is not set | ||
953 | # CONFIG_CRYPTO_MD4 is not set | ||
954 | CONFIG_CRYPTO_MD5=m | ||
955 | CONFIG_CRYPTO_SHA1=m | ||
956 | # CONFIG_CRYPTO_SHA256 is not set | ||
957 | # CONFIG_CRYPTO_SHA512 is not set | ||
958 | # CONFIG_CRYPTO_WP512 is not set | ||
959 | # CONFIG_CRYPTO_TGR192 is not set | ||
960 | CONFIG_CRYPTO_DES=m | ||
961 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
962 | # CONFIG_CRYPTO_TWOFISH is not set | ||
963 | # CONFIG_CRYPTO_SERPENT is not set | ||
964 | # CONFIG_CRYPTO_AES is not set | ||
965 | # CONFIG_CRYPTO_CAST5 is not set | ||
966 | # CONFIG_CRYPTO_CAST6 is not set | ||
967 | # CONFIG_CRYPTO_TEA is not set | ||
968 | # CONFIG_CRYPTO_ARC4 is not set | ||
969 | # CONFIG_CRYPTO_KHAZAD is not set | ||
970 | # CONFIG_CRYPTO_ANUBIS is not set | ||
971 | CONFIG_CRYPTO_DEFLATE=m | ||
972 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
973 | # CONFIG_CRYPTO_CRC32C is not set | ||
974 | # CONFIG_CRYPTO_TEST is not set | ||
975 | |||
976 | # | ||
977 | # Hardware crypto devices | ||
978 | # | ||
979 | |||
980 | # | ||
981 | # Library routines | ||
982 | # | ||
983 | # CONFIG_CRC_CCITT is not set | ||
984 | CONFIG_CRC32=y | ||
985 | # CONFIG_LIBCRC32C is not set | ||
986 | CONFIG_ZLIB_INFLATE=m | ||
987 | CONFIG_ZLIB_DEFLATE=m | ||
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig index 9e0abe8392fc..ab567741e80e 100644 --- a/arch/ppc64/configs/g5_defconfig +++ b/arch/ppc64/configs/g5_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:40:34 2005 | 4 | # Mon Aug 8 14:16:59 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -267,8 +267,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
267 | # Network testing | 267 | # Network testing |
268 | # | 268 | # |
269 | # CONFIG_NET_PKTGEN is not set | 269 | # CONFIG_NET_PKTGEN is not set |
270 | # CONFIG_NETPOLL is not set | ||
271 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
272 | # CONFIG_HAMRADIO is not set | 270 | # CONFIG_HAMRADIO is not set |
273 | # CONFIG_IRDA is not set | 271 | # CONFIG_IRDA is not set |
274 | # CONFIG_BT is not set | 272 | # CONFIG_BT is not set |
@@ -468,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
468 | # CONFIG_SCSI_QLA2300 is not set | 466 | # CONFIG_SCSI_QLA2300 is not set |
469 | # CONFIG_SCSI_QLA2322 is not set | 467 | # CONFIG_SCSI_QLA2322 is not set |
470 | # CONFIG_SCSI_QLA6312 is not set | 468 | # CONFIG_SCSI_QLA6312 is not set |
469 | # CONFIG_SCSI_QLA24XX is not set | ||
471 | # CONFIG_SCSI_LPFC is not set | 470 | # CONFIG_SCSI_LPFC is not set |
472 | # CONFIG_SCSI_DC395x is not set | 471 | # CONFIG_SCSI_DC395x is not set |
473 | # CONFIG_SCSI_DC390T is not set | 472 | # CONFIG_SCSI_DC390T is not set |
@@ -539,11 +538,9 @@ CONFIG_IEEE1394_RAWIO=y | |||
539 | # | 538 | # |
540 | # Macintosh device drivers | 539 | # Macintosh device drivers |
541 | # | 540 | # |
542 | CONFIG_ADB=y | ||
543 | CONFIG_ADB_PMU=y | 541 | CONFIG_ADB_PMU=y |
544 | CONFIG_PMAC_SMU=y | 542 | CONFIG_PMAC_SMU=y |
545 | # CONFIG_PMAC_BACKLIGHT is not set | 543 | # CONFIG_PMAC_BACKLIGHT is not set |
546 | # CONFIG_INPUT_ADBHID is not set | ||
547 | CONFIG_THERM_PM72=y | 544 | CONFIG_THERM_PM72=y |
548 | 545 | ||
549 | # | 546 | # |
@@ -631,6 +628,8 @@ CONFIG_PPPOE=m | |||
631 | # CONFIG_NET_FC is not set | 628 | # CONFIG_NET_FC is not set |
632 | # CONFIG_SHAPER is not set | 629 | # CONFIG_SHAPER is not set |
633 | # CONFIG_NETCONSOLE is not set | 630 | # CONFIG_NETCONSOLE is not set |
631 | # CONFIG_NETPOLL is not set | ||
632 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
634 | 633 | ||
635 | # | 634 | # |
636 | # ISDN subsystem | 635 | # ISDN subsystem |
@@ -718,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
718 | # | 717 | # |
719 | # CONFIG_WATCHDOG is not set | 718 | # CONFIG_WATCHDOG is not set |
720 | # CONFIG_RTC is not set | 719 | # CONFIG_RTC is not set |
721 | # CONFIG_GEN_RTC is not set | ||
722 | # CONFIG_DTLK is not set | 720 | # CONFIG_DTLK is not set |
723 | # CONFIG_R3964 is not set | 721 | # CONFIG_R3964 is not set |
724 | # CONFIG_APPLICOM is not set | 722 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig index dbd54d188c2b..394ba18b58c7 100644 --- a/arch/ppc64/configs/iSeries_defconfig +++ b/arch/ppc64/configs/iSeries_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:43:39 2005 | 4 | # Mon Aug 8 14:17:02 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -257,10 +257,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
257 | # Network testing | 257 | # Network testing |
258 | # | 258 | # |
259 | # CONFIG_NET_PKTGEN is not set | 259 | # CONFIG_NET_PKTGEN is not set |
260 | CONFIG_NETPOLL=y | ||
261 | CONFIG_NETPOLL_RX=y | ||
262 | CONFIG_NETPOLL_TRAP=y | ||
263 | CONFIG_NET_POLL_CONTROLLER=y | ||
264 | # CONFIG_HAMRADIO is not set | 260 | # CONFIG_HAMRADIO is not set |
265 | # CONFIG_IRDA is not set | 261 | # CONFIG_IRDA is not set |
266 | # CONFIG_BT is not set | 262 | # CONFIG_BT is not set |
@@ -388,6 +384,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
388 | # CONFIG_SCSI_QLA2300 is not set | 384 | # CONFIG_SCSI_QLA2300 is not set |
389 | # CONFIG_SCSI_QLA2322 is not set | 385 | # CONFIG_SCSI_QLA2322 is not set |
390 | # CONFIG_SCSI_QLA6312 is not set | 386 | # CONFIG_SCSI_QLA6312 is not set |
387 | # CONFIG_SCSI_QLA24XX is not set | ||
391 | # CONFIG_SCSI_LPFC is not set | 388 | # CONFIG_SCSI_LPFC is not set |
392 | # CONFIG_SCSI_DC395x is not set | 389 | # CONFIG_SCSI_DC395x is not set |
393 | # CONFIG_SCSI_DC390T is not set | 390 | # CONFIG_SCSI_DC390T is not set |
@@ -537,6 +534,10 @@ CONFIG_PPPOE=m | |||
537 | # CONFIG_NET_FC is not set | 534 | # CONFIG_NET_FC is not set |
538 | # CONFIG_SHAPER is not set | 535 | # CONFIG_SHAPER is not set |
539 | CONFIG_NETCONSOLE=y | 536 | CONFIG_NETCONSOLE=y |
537 | CONFIG_NETPOLL=y | ||
538 | CONFIG_NETPOLL_RX=y | ||
539 | CONFIG_NETPOLL_TRAP=y | ||
540 | CONFIG_NET_POLL_CONTROLLER=y | ||
540 | 541 | ||
541 | # | 542 | # |
542 | # ISDN subsystem | 543 | # ISDN subsystem |
@@ -610,7 +611,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
610 | # | 611 | # |
611 | # CONFIG_WATCHDOG is not set | 612 | # CONFIG_WATCHDOG is not set |
612 | # CONFIG_RTC is not set | 613 | # CONFIG_RTC is not set |
613 | # CONFIG_GEN_RTC is not set | ||
614 | # CONFIG_DTLK is not set | 614 | # CONFIG_DTLK is not set |
615 | # CONFIG_R3964 is not set | 615 | # CONFIG_R3964 is not set |
616 | # CONFIG_APPLICOM is not set | 616 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig index cda8e8cb6d1d..2033fe663dbe 100644 --- a/arch/ppc64/configs/maple_defconfig +++ b/arch/ppc64/configs/maple_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:46:18 2005 | 4 | # Mon Aug 8 14:17:04 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -193,8 +193,6 @@ CONFIG_TCP_CONG_BIC=y | |||
193 | # Network testing | 193 | # Network testing |
194 | # | 194 | # |
195 | # CONFIG_NET_PKTGEN is not set | 195 | # CONFIG_NET_PKTGEN is not set |
196 | # CONFIG_NETPOLL is not set | ||
197 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
198 | # CONFIG_HAMRADIO is not set | 196 | # CONFIG_HAMRADIO is not set |
199 | # CONFIG_IRDA is not set | 197 | # CONFIG_IRDA is not set |
200 | # CONFIG_BT is not set | 198 | # CONFIG_BT is not set |
@@ -433,6 +431,8 @@ CONFIG_E1000=y | |||
433 | # CONFIG_SLIP is not set | 431 | # CONFIG_SLIP is not set |
434 | # CONFIG_SHAPER is not set | 432 | # CONFIG_SHAPER is not set |
435 | # CONFIG_NETCONSOLE is not set | 433 | # CONFIG_NETCONSOLE is not set |
434 | # CONFIG_NETPOLL is not set | ||
435 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
436 | 436 | ||
437 | # | 437 | # |
438 | # ISDN subsystem | 438 | # ISDN subsystem |
@@ -512,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
512 | # | 512 | # |
513 | # CONFIG_WATCHDOG is not set | 513 | # CONFIG_WATCHDOG is not set |
514 | # CONFIG_RTC is not set | 514 | # CONFIG_RTC is not set |
515 | # CONFIG_GEN_RTC is not set | ||
516 | # CONFIG_DTLK is not set | 515 | # CONFIG_DTLK is not set |
517 | # CONFIG_R3964 is not set | 516 | # CONFIG_R3964 is not set |
518 | # CONFIG_APPLICOM is not set | 517 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig index 5112edf18181..297fd5229487 100644 --- a/arch/ppc64/configs/pSeries_defconfig +++ b/arch/ppc64/configs/pSeries_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:47:54 2005 | 4 | # Mon Aug 8 14:17:07 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -287,10 +287,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
287 | # Network testing | 287 | # Network testing |
288 | # | 288 | # |
289 | # CONFIG_NET_PKTGEN is not set | 289 | # CONFIG_NET_PKTGEN is not set |
290 | CONFIG_NETPOLL=y | ||
291 | CONFIG_NETPOLL_RX=y | ||
292 | CONFIG_NETPOLL_TRAP=y | ||
293 | CONFIG_NET_POLL_CONTROLLER=y | ||
294 | # CONFIG_HAMRADIO is not set | 290 | # CONFIG_HAMRADIO is not set |
295 | # CONFIG_IRDA is not set | 291 | # CONFIG_IRDA is not set |
296 | # CONFIG_BT is not set | 292 | # CONFIG_BT is not set |
@@ -488,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m | |||
488 | CONFIG_SCSI_QLA2300=m | 484 | CONFIG_SCSI_QLA2300=m |
489 | CONFIG_SCSI_QLA2322=m | 485 | CONFIG_SCSI_QLA2322=m |
490 | CONFIG_SCSI_QLA6312=m | 486 | CONFIG_SCSI_QLA6312=m |
487 | CONFIG_SCSI_QLA24XX=m | ||
491 | CONFIG_SCSI_LPFC=m | 488 | CONFIG_SCSI_LPFC=m |
492 | # CONFIG_SCSI_DC395x is not set | 489 | # CONFIG_SCSI_DC395x is not set |
493 | # CONFIG_SCSI_DC390T is not set | 490 | # CONFIG_SCSI_DC390T is not set |
@@ -645,6 +642,10 @@ CONFIG_PPPOE=m | |||
645 | # CONFIG_NET_FC is not set | 642 | # CONFIG_NET_FC is not set |
646 | # CONFIG_SHAPER is not set | 643 | # CONFIG_SHAPER is not set |
647 | CONFIG_NETCONSOLE=y | 644 | CONFIG_NETCONSOLE=y |
645 | CONFIG_NETPOLL=y | ||
646 | CONFIG_NETPOLL_RX=y | ||
647 | CONFIG_NETPOLL_TRAP=y | ||
648 | CONFIG_NET_POLL_CONTROLLER=y | ||
648 | 649 | ||
649 | # | 650 | # |
650 | # ISDN subsystem | 651 | # ISDN subsystem |
@@ -746,7 +747,6 @@ CONFIG_HVCS=m | |||
746 | # | 747 | # |
747 | # CONFIG_WATCHDOG is not set | 748 | # CONFIG_WATCHDOG is not set |
748 | # CONFIG_RTC is not set | 749 | # CONFIG_RTC is not set |
749 | # CONFIG_GEN_RTC is not set | ||
750 | # CONFIG_DTLK is not set | 750 | # CONFIG_DTLK is not set |
751 | # CONFIG_R3964 is not set | 751 | # CONFIG_R3964 is not set |
752 | # CONFIG_APPLICOM is not set | 752 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig index fbf1f427ad35..c361e7727b7a 100644 --- a/arch/ppc64/defconfig +++ b/arch/ppc64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:37:07 2005 | 4 | # Mon Aug 8 14:16:54 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -289,10 +289,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
289 | # Network testing | 289 | # Network testing |
290 | # | 290 | # |
291 | # CONFIG_NET_PKTGEN is not set | 291 | # CONFIG_NET_PKTGEN is not set |
292 | CONFIG_NETPOLL=y | ||
293 | CONFIG_NETPOLL_RX=y | ||
294 | CONFIG_NETPOLL_TRAP=y | ||
295 | CONFIG_NET_POLL_CONTROLLER=y | ||
296 | # CONFIG_HAMRADIO is not set | 292 | # CONFIG_HAMRADIO is not set |
297 | # CONFIG_IRDA is not set | 293 | # CONFIG_IRDA is not set |
298 | # CONFIG_BT is not set | 294 | # CONFIG_BT is not set |
@@ -506,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m | |||
506 | CONFIG_SCSI_QLA2300=m | 502 | CONFIG_SCSI_QLA2300=m |
507 | CONFIG_SCSI_QLA2322=m | 503 | CONFIG_SCSI_QLA2322=m |
508 | CONFIG_SCSI_QLA6312=m | 504 | CONFIG_SCSI_QLA6312=m |
505 | CONFIG_SCSI_QLA24XX=m | ||
509 | CONFIG_SCSI_LPFC=m | 506 | CONFIG_SCSI_LPFC=m |
510 | # CONFIG_SCSI_DC395x is not set | 507 | # CONFIG_SCSI_DC395x is not set |
511 | # CONFIG_SCSI_DC390T is not set | 508 | # CONFIG_SCSI_DC390T is not set |
@@ -579,11 +576,9 @@ CONFIG_IEEE1394_AMDTP=m | |||
579 | # | 576 | # |
580 | # Macintosh device drivers | 577 | # Macintosh device drivers |
581 | # | 578 | # |
582 | CONFIG_ADB=y | ||
583 | CONFIG_ADB_PMU=y | 579 | CONFIG_ADB_PMU=y |
584 | CONFIG_PMAC_SMU=y | 580 | CONFIG_PMAC_SMU=y |
585 | # CONFIG_PMAC_BACKLIGHT is not set | 581 | # CONFIG_PMAC_BACKLIGHT is not set |
586 | # CONFIG_INPUT_ADBHID is not set | ||
587 | CONFIG_THERM_PM72=y | 582 | CONFIG_THERM_PM72=y |
588 | 583 | ||
589 | # | 584 | # |
@@ -694,6 +689,10 @@ CONFIG_PPPOE=m | |||
694 | # CONFIG_NET_FC is not set | 689 | # CONFIG_NET_FC is not set |
695 | # CONFIG_SHAPER is not set | 690 | # CONFIG_SHAPER is not set |
696 | CONFIG_NETCONSOLE=y | 691 | CONFIG_NETCONSOLE=y |
692 | CONFIG_NETPOLL=y | ||
693 | CONFIG_NETPOLL_RX=y | ||
694 | CONFIG_NETPOLL_TRAP=y | ||
695 | CONFIG_NET_POLL_CONTROLLER=y | ||
697 | 696 | ||
698 | # | 697 | # |
699 | # ISDN subsystem | 698 | # ISDN subsystem |
@@ -797,7 +796,6 @@ CONFIG_HVCS=m | |||
797 | # | 796 | # |
798 | # CONFIG_WATCHDOG is not set | 797 | # CONFIG_WATCHDOG is not set |
799 | # CONFIG_RTC is not set | 798 | # CONFIG_RTC is not set |
800 | # CONFIG_GEN_RTC is not set | ||
801 | # CONFIG_DTLK is not set | 799 | # CONFIG_DTLK is not set |
802 | # CONFIG_R3964 is not set | 800 | # CONFIG_R3964 is not set |
803 | # CONFIG_APPLICOM is not set | 801 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c index 76cfd1449d52..1c11031c838e 100644 --- a/arch/ppc64/kernel/LparData.c +++ b/arch/ppc64/kernel/LparData.c | |||
@@ -32,32 +32,12 @@ | |||
32 | /* The HvReleaseData is the root of the information shared between | 32 | /* The HvReleaseData is the root of the information shared between |
33 | * the hypervisor and Linux. | 33 | * the hypervisor and Linux. |
34 | */ | 34 | */ |
35 | |||
36 | /* | ||
37 | * WARNING - magic here | ||
38 | * | ||
39 | * Ok, this is a horrid hack below, but marginally better than the | ||
40 | * alternatives. What we really want is just to initialize | ||
41 | * hvReleaseData in C as in the #if 0 section here. However, gcc | ||
42 | * refuses to believe that (u32)&x is a constant expression, so will | ||
43 | * not allow the xMsNucDataOffset field to be properly initialized. | ||
44 | * So, we declare hvReleaseData in inline asm instead. We use inline | ||
45 | * asm, rather than a .S file, because the assembler won't generate | ||
46 | * the necessary relocation for the LparMap either, unless that symbol | ||
47 | * is declared in the same source file. Finally, we put the asm in a | ||
48 | * dummy, attribute-used function, instead of at file scope, because | ||
49 | * file scope asms don't allow contraints. We want to use the "i" | ||
50 | * constraints to put sizeof() and offsetof() expressions in there, | ||
51 | * because including asm/offsets.h in C code then stringifying causes | ||
52 | * all manner of warnings. | ||
53 | */ | ||
54 | #if 0 | ||
55 | struct HvReleaseData hvReleaseData = { | 35 | struct HvReleaseData hvReleaseData = { |
56 | .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ | 36 | .xDesc = 0xc8a5d9c4, /* "HvRD" ebcdic */ |
57 | .xSize = sizeof(struct HvReleaseData), | 37 | .xSize = sizeof(struct HvReleaseData), |
58 | .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas), | 38 | .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas), |
59 | .xSlicNacaAddr = &naca, /* 64-bit Naca address */ | 39 | .xSlicNacaAddr = &naca, /* 64-bit Naca address */ |
60 | .xMsNucDataOffset = (u32)((unsigned long)&xLparMap - KERNELBASE), | 40 | .xMsNucDataOffset = LPARMAP_PHYS, |
61 | .xFlags = HVREL_TAGSINACTIVE /* tags inactive */ | 41 | .xFlags = HVREL_TAGSINACTIVE /* tags inactive */ |
62 | /* 64 bit */ | 42 | /* 64 bit */ |
63 | /* shared processors */ | 43 | /* shared processors */ |
@@ -70,63 +50,6 @@ struct HvReleaseData hvReleaseData = { | |||
70 | 0xa7, 0x40, 0xf2, 0x4b, | 50 | 0xa7, 0x40, 0xf2, 0x4b, |
71 | 0xf4, 0x4b, 0xf6, 0xf4 }, | 51 | 0xf4, 0x4b, 0xf6, 0xf4 }, |
72 | }; | 52 | }; |
73 | #endif | ||
74 | |||
75 | |||
76 | extern struct HvReleaseData hvReleaseData; | ||
77 | |||
78 | static void __attribute_used__ hvReleaseData_wrapper(void) | ||
79 | { | ||
80 | /* This doesn't appear to need any alignment (even 4 byte) */ | ||
81 | asm volatile ( | ||
82 | " lparMapPhys = xLparMap - %3\n" | ||
83 | " .data\n" | ||
84 | " .globl hvReleaseData\n" | ||
85 | "hvReleaseData:\n" | ||
86 | " .long 0xc8a5d9c4\n" /* xDesc */ | ||
87 | /* "HvRD" in ebcdic */ | ||
88 | " .short %0\n" /* xSize */ | ||
89 | " .short %1\n" /* xVpdAreasPtrOffset */ | ||
90 | " .llong naca\n" /* xSlicNacaAddr */ | ||
91 | " .long lparMapPhys\n" /* xMsNucDataOffset */ | ||
92 | " .long 0\n" /* xRsvd1 */ | ||
93 | " .short %2\n" /* xFlags */ | ||
94 | " .short 4\n" /* xVrmIndex - v5r2m0 */ | ||
95 | " .short 3\n" /* xMinSupportedPlicVrmIndex - v5r1m0 */ | ||
96 | " .short 3\n" /* xMinCompatablePlicVrmIndex - v5r1m0 */ | ||
97 | " .long 0xd38995a4\n" /* xVrmName */ | ||
98 | " .long 0xa740f24b\n" /* "Linux 2.4.64" ebcdic */ | ||
99 | " .long 0xf44bf6f4\n" | ||
100 | " . = hvReleaseData + %0\n" | ||
101 | " .previous\n" | ||
102 | : : "i"(sizeof(hvReleaseData)), | ||
103 | "i"(offsetof(struct naca_struct, xItVpdAreas)), | ||
104 | "i"(HVREL_TAGSINACTIVE /* tags inactive, 64 bit, */ | ||
105 | /* shared processors, HMT allowed */ | ||
106 | | 6), /* TEMP: This allows non-GA drivers */ | ||
107 | "i"(KERNELBASE) | ||
108 | ); | ||
109 | } | ||
110 | |||
111 | struct LparMap __attribute__((aligned (16))) xLparMap = { | ||
112 | .xNumberEsids = HvEsidsToMap, | ||
113 | .xNumberRanges = HvRangesToMap, | ||
114 | .xSegmentTableOffs = STAB0_PAGE, | ||
115 | |||
116 | .xEsids = { | ||
117 | { .xKernelEsid = GET_ESID(KERNELBASE), | ||
118 | .xKernelVsid = KERNEL_VSID(KERNELBASE), }, | ||
119 | { .xKernelEsid = GET_ESID(VMALLOCBASE), | ||
120 | .xKernelVsid = KERNEL_VSID(VMALLOCBASE), }, | ||
121 | }, | ||
122 | |||
123 | .xRanges = { | ||
124 | { .xPages = HvPagesToMap, | ||
125 | .xOffset = 0, | ||
126 | .xVPN = KERNEL_VSID(KERNELBASE) << (SID_SHIFT - PAGE_SHIFT), | ||
127 | }, | ||
128 | }, | ||
129 | }; | ||
130 | 53 | ||
131 | extern void system_reset_iSeries(void); | 54 | extern void system_reset_iSeries(void); |
132 | extern void machine_check_iSeries(void); | 55 | extern void machine_check_iSeries(void); |
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index d9b2660ef221..2ecccb6b4f8c 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -73,3 +73,8 @@ obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o | |||
73 | obj-$(CONFIG_KPROBES) += kprobes.o | 73 | obj-$(CONFIG_KPROBES) += kprobes.o |
74 | 74 | ||
75 | CFLAGS_ioctl32.o += -Ifs/ | 75 | CFLAGS_ioctl32.o += -Ifs/ |
76 | |||
77 | ifeq ($(CONFIG_PPC_ISERIES),y) | ||
78 | arch/ppc64/kernel/head.o: arch/ppc64/kernel/lparmap.s | ||
79 | AFLAGS_head.o += -Iarch/ppc64/kernel | ||
80 | endif | ||
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 74fc3bc68604..accaa052d31f 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <asm/cputable.h> | 38 | #include <asm/cputable.h> |
39 | #include <asm/setup.h> | 39 | #include <asm/setup.h> |
40 | #include <asm/hvcall.h> | 40 | #include <asm/hvcall.h> |
41 | #include <asm/iSeries/LparMap.h> | ||
41 | 42 | ||
42 | #ifdef CONFIG_PPC_ISERIES | 43 | #ifdef CONFIG_PPC_ISERIES |
43 | #define DO_SOFT_DISABLE | 44 | #define DO_SOFT_DISABLE |
@@ -679,6 +680,11 @@ hardware_interrupt_iSeries_masked: | |||
679 | .globl fwnmi_data_area | 680 | .globl fwnmi_data_area |
680 | fwnmi_data_area: | 681 | fwnmi_data_area: |
681 | 682 | ||
683 | #ifdef CONFIG_PPC_ISERIES | ||
684 | . = LPARMAP_PHYS | ||
685 | #include "lparmap.s" | ||
686 | #endif /* CONFIG_PPC_ISERIES */ | ||
687 | |||
682 | /* | 688 | /* |
683 | * Vectors for the FWNMI option. Share common code. | 689 | * Vectors for the FWNMI option. Share common code. |
684 | */ | 690 | */ |
@@ -2071,7 +2077,7 @@ _GLOBAL(hmt_start_secondary) | |||
2071 | blr | 2077 | blr |
2072 | #endif | 2078 | #endif |
2073 | 2079 | ||
2074 | #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES) | 2080 | #if defined(CONFIG_KEXEC) || (defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)) |
2075 | _GLOBAL(smp_release_cpus) | 2081 | _GLOBAL(smp_release_cpus) |
2076 | /* All secondary cpus are spinning on a common | 2082 | /* All secondary cpus are spinning on a common |
2077 | * spinloop, release them all now so they can start | 2083 | * spinloop, release them all now so they can start |
diff --git a/arch/ppc64/kernel/iommu.c b/arch/ppc64/kernel/iommu.c index 8316426ccaf6..845eebd1e28d 100644 --- a/arch/ppc64/kernel/iommu.c +++ b/arch/ppc64/kernel/iommu.c | |||
@@ -242,7 +242,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
242 | dma_addr_t dma_next = 0, dma_addr; | 242 | dma_addr_t dma_next = 0, dma_addr; |
243 | unsigned long flags; | 243 | unsigned long flags; |
244 | struct scatterlist *s, *outs, *segstart; | 244 | struct scatterlist *s, *outs, *segstart; |
245 | int outcount; | 245 | int outcount, incount; |
246 | unsigned long handle; | 246 | unsigned long handle; |
247 | 247 | ||
248 | BUG_ON(direction == DMA_NONE); | 248 | BUG_ON(direction == DMA_NONE); |
@@ -252,6 +252,7 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
252 | 252 | ||
253 | outs = s = segstart = &sglist[0]; | 253 | outs = s = segstart = &sglist[0]; |
254 | outcount = 1; | 254 | outcount = 1; |
255 | incount = nelems; | ||
255 | handle = 0; | 256 | handle = 0; |
256 | 257 | ||
257 | /* Init first segment length for backout at failure */ | 258 | /* Init first segment length for backout at failure */ |
@@ -338,10 +339,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | |||
338 | 339 | ||
339 | DBG("mapped %d elements:\n", outcount); | 340 | DBG("mapped %d elements:\n", outcount); |
340 | 341 | ||
341 | /* For the sake of iommu_free_sg, we clear out the length in the | 342 | /* For the sake of iommu_unmap_sg, we clear out the length in the |
342 | * next entry of the sglist if we didn't fill the list completely | 343 | * next entry of the sglist if we didn't fill the list completely |
343 | */ | 344 | */ |
344 | if (outcount < nelems) { | 345 | if (outcount < incount) { |
345 | outs++; | 346 | outs++; |
346 | outs->dma_address = DMA_ERROR_CODE; | 347 | outs->dma_address = DMA_ERROR_CODE; |
347 | outs->dma_length = 0; | 348 | outs->dma_length = 0; |
diff --git a/arch/ppc64/kernel/lparmap.c b/arch/ppc64/kernel/lparmap.c new file mode 100644 index 000000000000..b81de286df5e --- /dev/null +++ b/arch/ppc64/kernel/lparmap.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Rothwell IBM Corp. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #include <asm/mmu.h> | ||
10 | #include <asm/page.h> | ||
11 | #include <asm/iSeries/LparMap.h> | ||
12 | |||
13 | const struct LparMap __attribute__((__section__(".text"))) xLparMap = { | ||
14 | .xNumberEsids = HvEsidsToMap, | ||
15 | .xNumberRanges = HvRangesToMap, | ||
16 | .xSegmentTableOffs = STAB0_PAGE, | ||
17 | |||
18 | .xEsids = { | ||
19 | { .xKernelEsid = GET_ESID(KERNELBASE), | ||
20 | .xKernelVsid = KERNEL_VSID(KERNELBASE), }, | ||
21 | { .xKernelEsid = GET_ESID(VMALLOCBASE), | ||
22 | .xKernelVsid = KERNEL_VSID(VMALLOCBASE), }, | ||
23 | }, | ||
24 | |||
25 | .xRanges = { | ||
26 | { .xPages = HvPagesToMap, | ||
27 | .xOffset = 0, | ||
28 | .xVPN = KERNEL_VSID(KERNELBASE) << (SID_SHIFT - PAGE_SHIFT), | ||
29 | }, | ||
30 | }, | ||
31 | }; | ||
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c index fdb2fc649d72..4775f12a013c 100644 --- a/arch/ppc64/kernel/machine_kexec.c +++ b/arch/ppc64/kernel/machine_kexec.c | |||
@@ -185,7 +185,7 @@ void kexec_copy_flush(struct kimage *image) | |||
185 | void kexec_smp_down(void *arg) | 185 | void kexec_smp_down(void *arg) |
186 | { | 186 | { |
187 | if (ppc_md.cpu_irq_down) | 187 | if (ppc_md.cpu_irq_down) |
188 | ppc_md.cpu_irq_down(); | 188 | ppc_md.cpu_irq_down(1); |
189 | 189 | ||
190 | local_irq_disable(); | 190 | local_irq_disable(); |
191 | kexec_smp_wait(); | 191 | kexec_smp_wait(); |
@@ -232,7 +232,7 @@ static void kexec_prepare_cpus(void) | |||
232 | 232 | ||
233 | /* after we tell the others to go down */ | 233 | /* after we tell the others to go down */ |
234 | if (ppc_md.cpu_irq_down) | 234 | if (ppc_md.cpu_irq_down) |
235 | ppc_md.cpu_irq_down(); | 235 | ppc_md.cpu_irq_down(0); |
236 | 236 | ||
237 | put_cpu(); | 237 | put_cpu(); |
238 | 238 | ||
@@ -243,15 +243,19 @@ static void kexec_prepare_cpus(void) | |||
243 | 243 | ||
244 | static void kexec_prepare_cpus(void) | 244 | static void kexec_prepare_cpus(void) |
245 | { | 245 | { |
246 | extern void smp_release_cpus(void); | ||
246 | /* | 247 | /* |
247 | * move the secondarys to us so that we can copy | 248 | * move the secondarys to us so that we can copy |
248 | * the new kernel 0-0x100 safely | 249 | * the new kernel 0-0x100 safely |
249 | * | 250 | * |
250 | * do this if kexec in setup.c ? | 251 | * do this if kexec in setup.c ? |
252 | * | ||
253 | * We need to release the cpus if we are ever going from an | ||
254 | * UP to an SMP kernel. | ||
251 | */ | 255 | */ |
252 | smp_relase_cpus(); | 256 | smp_release_cpus(); |
253 | if (ppc_md.cpu_irq_down) | 257 | if (ppc_md.cpu_irq_down) |
254 | ppc_md.cpu_irq_down(); | 258 | ppc_md.cpu_irq_down(0); |
255 | local_irq_disable(); | 259 | local_irq_disable(); |
256 | } | 260 | } |
257 | 261 | ||
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 59f4f9973818..a05b50b738e9 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S | |||
@@ -1129,6 +1129,9 @@ _GLOBAL(sys_call_table32) | |||
1129 | .llong .compat_sys_waitid | 1129 | .llong .compat_sys_waitid |
1130 | .llong .sys32_ioprio_set | 1130 | .llong .sys32_ioprio_set |
1131 | .llong .sys32_ioprio_get | 1131 | .llong .sys32_ioprio_get |
1132 | .llong .sys_inotify_init /* 275 */ | ||
1133 | .llong .sys_inotify_add_watch | ||
1134 | .llong .sys_inotify_rm_watch | ||
1132 | 1135 | ||
1133 | .balign 8 | 1136 | .balign 8 |
1134 | _GLOBAL(sys_call_table) | 1137 | _GLOBAL(sys_call_table) |
@@ -1407,3 +1410,6 @@ _GLOBAL(sys_call_table) | |||
1407 | .llong .sys_waitid | 1410 | .llong .sys_waitid |
1408 | .llong .sys_ioprio_set | 1411 | .llong .sys_ioprio_set |
1409 | .llong .sys_ioprio_get | 1412 | .llong .sys_ioprio_get |
1413 | .llong .sys_inotify_init /* 275 */ | ||
1414 | .llong .sys_inotify_add_watch | ||
1415 | .llong .sys_inotify_rm_watch | ||
diff --git a/arch/ppc64/kernel/mpic.c b/arch/ppc64/kernel/mpic.c index e8fbab1df37f..cc262a05ddb4 100644 --- a/arch/ppc64/kernel/mpic.c +++ b/arch/ppc64/kernel/mpic.c | |||
@@ -794,10 +794,10 @@ void mpic_setup_this_cpu(void) | |||
794 | 794 | ||
795 | /* | 795 | /* |
796 | * XXX: someone who knows mpic should check this. | 796 | * XXX: someone who knows mpic should check this. |
797 | * do we need to eoi the ipi here (see xics comments)? | 797 | * do we need to eoi the ipi including for kexec cpu here (see xics comments)? |
798 | * or can we reset the mpic in the new kernel? | 798 | * or can we reset the mpic in the new kernel? |
799 | */ | 799 | */ |
800 | void mpic_teardown_this_cpu(void) | 800 | void mpic_teardown_this_cpu(int secondary) |
801 | { | 801 | { |
802 | struct mpic *mpic = mpic_primary; | 802 | struct mpic *mpic = mpic_primary; |
803 | unsigned long flags; | 803 | unsigned long flags; |
diff --git a/arch/ppc64/kernel/mpic.h b/arch/ppc64/kernel/mpic.h index 99fbbc9a084c..ca78a7f10528 100644 --- a/arch/ppc64/kernel/mpic.h +++ b/arch/ppc64/kernel/mpic.h | |||
@@ -256,7 +256,7 @@ extern unsigned int mpic_irq_get_priority(unsigned int irq); | |||
256 | extern void mpic_setup_this_cpu(void); | 256 | extern void mpic_setup_this_cpu(void); |
257 | 257 | ||
258 | /* Clean up for kexec (or cpu offline or ...) */ | 258 | /* Clean up for kexec (or cpu offline or ...) */ |
259 | extern void mpic_teardown_this_cpu(void); | 259 | extern void mpic_teardown_this_cpu(int secondary); |
260 | 260 | ||
261 | /* Request IPIs on primary mpic */ | 261 | /* Request IPIs on primary mpic */ |
262 | extern void mpic_request_ipis(void); | 262 | extern void mpic_request_ipis(void); |
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index ae6f579d3fa0..d0d55c7908ef 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c | |||
@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region | |||
108 | region->end = res->end - offset; | 108 | region->end = res->end - offset; |
109 | } | 109 | } |
110 | 110 | ||
111 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
112 | struct pci_bus_region *region) | ||
113 | { | ||
114 | unsigned long offset = 0; | ||
115 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | ||
116 | |||
117 | if (!hose) | ||
118 | return; | ||
119 | |||
120 | if (res->flags & IORESOURCE_IO) | ||
121 | offset = (unsigned long)hose->io_base_virt - pci_io_base; | ||
122 | |||
123 | if (res->flags & IORESOURCE_MEM) | ||
124 | offset = hose->pci_mem_offset; | ||
125 | |||
126 | res->start = region->start + offset; | ||
127 | res->end = region->end + offset; | ||
128 | } | ||
129 | |||
111 | #ifdef CONFIG_HOTPLUG | 130 | #ifdef CONFIG_HOTPLUG |
112 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 131 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
132 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
113 | #endif | 133 | #endif |
114 | 134 | ||
115 | /* | 135 | /* |
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index 47727a6f7346..5aca01ddd81f 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c | |||
@@ -916,6 +916,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
916 | } | 916 | } |
917 | } | 917 | } |
918 | 918 | ||
919 | #ifdef CONFIG_ALTIVEC | ||
919 | /* Check if we have a VMX and eventually update CPU features */ | 920 | /* Check if we have a VMX and eventually update CPU features */ |
920 | prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL); | 921 | prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL); |
921 | if (prop && (*prop) > 0) { | 922 | if (prop && (*prop) > 0) { |
@@ -929,6 +930,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
929 | cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; | 930 | cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC; |
930 | cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; | 931 | cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC; |
931 | } | 932 | } |
933 | #endif /* CONFIG_ALTIVEC */ | ||
932 | 934 | ||
933 | /* | 935 | /* |
934 | * Check for an SMT capable CPU and set the CPU feature. We do | 936 | * Check for an SMT capable CPU and set the CPU feature. We do |
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index e248a7950aeb..dbbe6c79d8da 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c | |||
@@ -1803,7 +1803,7 @@ static void __init fixup_device_tree(void) | |||
1803 | if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) | 1803 | if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) |
1804 | == PROM_ERROR) | 1804 | == PROM_ERROR) |
1805 | return; | 1805 | return; |
1806 | if (u3_rev != 0x35) | 1806 | if (u3_rev != 0x35 && u3_rev != 0x37) |
1807 | return; | 1807 | return; |
1808 | /* does it need fixup ? */ | 1808 | /* does it need fixup ? */ |
1809 | if (prom_getproplen(i2c, "interrupts") > 0) | 1809 | if (prom_getproplen(i2c, "interrupts") > 0) |
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 687e85595208..e9c24d2dbd91 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c | |||
@@ -706,6 +706,8 @@ void machine_power_off(void) | |||
706 | local_irq_disable(); | 706 | local_irq_disable(); |
707 | while (1) ; | 707 | while (1) ; |
708 | } | 708 | } |
709 | /* Used by the G5 thermal driver */ | ||
710 | EXPORT_SYMBOL_GPL(machine_power_off); | ||
709 | 711 | ||
710 | void machine_halt(void) | 712 | void machine_halt(void) |
711 | { | 713 | { |
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index 677c4450984a..d9dc6f28d050 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c | |||
@@ -647,29 +647,30 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) | |||
647 | } | 647 | } |
648 | } | 648 | } |
649 | 649 | ||
650 | void xics_teardown_cpu(void) | 650 | void xics_teardown_cpu(int secondary) |
651 | { | 651 | { |
652 | int cpu = smp_processor_id(); | 652 | int cpu = smp_processor_id(); |
653 | int status; | ||
654 | 653 | ||
655 | ops->cppr_info(cpu, 0x00); | 654 | ops->cppr_info(cpu, 0x00); |
656 | iosync(); | 655 | iosync(); |
657 | 656 | ||
658 | /* | 657 | /* |
659 | * we need to EOI the IPI if we got here from kexec down IPI | 658 | * Some machines need to have at least one cpu in the GIQ, |
660 | * | 659 | * so leave the master cpu in the group. |
661 | * xics doesn't care if we duplicate an EOI as long as we | ||
662 | * don't EOI and raise priority. | ||
663 | * | ||
664 | * probably need to check all the other interrupts too | ||
665 | * should we be flagging idle loop instead? | ||
666 | * or creating some task to be scheduled? | ||
667 | */ | 660 | */ |
668 | ops->xirr_info_set(cpu, XICS_IPI); | 661 | if (secondary) { |
669 | 662 | /* | |
670 | status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, | 663 | * we need to EOI the IPI if we got here from kexec down IPI |
671 | (1UL << interrupt_server_size) - 1 - default_distrib_server, 0); | 664 | * |
672 | WARN_ON(status != 0); | 665 | * probably need to check all the other interrupts too |
666 | * should we be flagging idle loop instead? | ||
667 | * or creating some task to be scheduled? | ||
668 | */ | ||
669 | ops->xirr_info_set(cpu, XICS_IPI); | ||
670 | rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, | ||
671 | (1UL << interrupt_server_size) - 1 - | ||
672 | default_distrib_server, 0); | ||
673 | } | ||
673 | } | 674 | } |
674 | 675 | ||
675 | #ifdef CONFIG_HOTPLUG_CPU | 676 | #ifdef CONFIG_HOTPLUG_CPU |
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c index cafd91aef289..0b191f2de016 100644 --- a/arch/ppc64/mm/numa.c +++ b/arch/ppc64/mm/numa.c | |||
@@ -647,7 +647,12 @@ void __init do_init_bootmem(void) | |||
647 | new_range: | 647 | new_range: |
648 | mem_start = read_n_cells(addr_cells, &memcell_buf); | 648 | mem_start = read_n_cells(addr_cells, &memcell_buf); |
649 | mem_size = read_n_cells(size_cells, &memcell_buf); | 649 | mem_size = read_n_cells(size_cells, &memcell_buf); |
650 | numa_domain = numa_enabled ? of_node_numa_domain(memory) : 0; | 650 | if (numa_enabled) { |
651 | numa_domain = of_node_numa_domain(memory); | ||
652 | if (numa_domain >= MAX_NUMNODES) | ||
653 | numa_domain = 0; | ||
654 | } else | ||
655 | numa_domain = 0; | ||
651 | 656 | ||
652 | if (numa_domain != nid) | 657 | if (numa_domain != nid) |
653 | continue; | 658 | continue; |
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c index 7f6e13a4b71e..05539439e6bc 100644 --- a/arch/ppc64/xmon/xmon.c +++ b/arch/ppc64/xmon/xmon.c | |||
@@ -329,13 +329,16 @@ int xmon_core(struct pt_regs *regs, int fromipi) | |||
329 | printf("cpu 0x%x: Exception %lx %s in xmon, " | 329 | printf("cpu 0x%x: Exception %lx %s in xmon, " |
330 | "returning to main loop\n", | 330 | "returning to main loop\n", |
331 | cpu, regs->trap, getvecname(TRAP(regs))); | 331 | cpu, regs->trap, getvecname(TRAP(regs))); |
332 | release_output_lock(); | ||
332 | longjmp(xmon_fault_jmp[cpu], 1); | 333 | longjmp(xmon_fault_jmp[cpu], 1); |
333 | } | 334 | } |
334 | 335 | ||
335 | if (setjmp(recurse_jmp) != 0) { | 336 | if (setjmp(recurse_jmp) != 0) { |
336 | if (!in_xmon || !xmon_gate) { | 337 | if (!in_xmon || !xmon_gate) { |
338 | get_output_lock(); | ||
337 | printf("xmon: WARNING: bad recursive fault " | 339 | printf("xmon: WARNING: bad recursive fault " |
338 | "on cpu 0x%x\n", cpu); | 340 | "on cpu 0x%x\n", cpu); |
341 | release_output_lock(); | ||
339 | goto waiting; | 342 | goto waiting; |
340 | } | 343 | } |
341 | secondary = !(xmon_taken && cpu == xmon_owner); | 344 | secondary = !(xmon_taken && cpu == xmon_owner); |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 799a98eac92d..23fe94e58688 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1449,3 +1449,29 @@ compat_sys_kexec_load_wrapper: | |||
1449 | llgtr %r4,%r4 # struct kexec_segment * | 1449 | llgtr %r4,%r4 # struct kexec_segment * |
1450 | llgfr %r5,%r5 # unsigned long | 1450 | llgfr %r5,%r5 # unsigned long |
1451 | jg compat_sys_kexec_load | 1451 | jg compat_sys_kexec_load |
1452 | |||
1453 | .globl sys_ioprio_set_wrapper | ||
1454 | sys_ioprio_set_wrapper: | ||
1455 | lgfr %r2,%r2 # int | ||
1456 | lgfr %r3,%r3 # int | ||
1457 | lgfr %r4,%r4 # int | ||
1458 | jg sys_ioprio_set | ||
1459 | |||
1460 | .globl sys_ioprio_get_wrapper | ||
1461 | sys_ioprio_get_wrapper: | ||
1462 | lgfr %r2,%r2 # int | ||
1463 | lgfr %r3,%r3 # int | ||
1464 | jg sys_ioprio_get | ||
1465 | |||
1466 | .globl sys_inotify_add_watch_wrapper | ||
1467 | sys_inotify_add_watch_wrapper: | ||
1468 | lgfr %r2,%r2 # int | ||
1469 | llgtr %r3,%r3 # const char * | ||
1470 | llgfr %r4,%r4 # u32 | ||
1471 | jg sys_inotify_add_watch | ||
1472 | |||
1473 | .globl sys_inotify_rm_watch_wrapper | ||
1474 | sys_inotify_rm_watch_wrapper: | ||
1475 | lgfr %r2,%r2 # int | ||
1476 | llgfr %r3,%r3 # u32 | ||
1477 | jg sys_inotify_rm_watch | ||
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c index 20062145e84e..d47fecb42cc5 100644 --- a/arch/s390/kernel/cpcmd.c +++ b/arch/s390/kernel/cpcmd.c | |||
@@ -46,9 +46,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code) | |||
46 | "lra 3,0(%4)\n" | 46 | "lra 3,0(%4)\n" |
47 | "lr 5,%5\n" | 47 | "lr 5,%5\n" |
48 | "diag 2,4,0x8\n" | 48 | "diag 2,4,0x8\n" |
49 | "brc 8, .Litfits\n" | 49 | "brc 8, 1f\n" |
50 | "ar 5, %5\n" | 50 | "ar 5, %5\n" |
51 | ".Litfits: \n" | 51 | "1: \n" |
52 | "lr %0,4\n" | 52 | "lr %0,4\n" |
53 | "lr %1,5\n" | 53 | "lr %1,5\n" |
54 | : "=d" (return_code), "=d" (return_len) | 54 | : "=d" (return_code), "=d" (return_len) |
@@ -64,9 +64,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code) | |||
64 | "sam31\n" | 64 | "sam31\n" |
65 | "diag 2,4,0x8\n" | 65 | "diag 2,4,0x8\n" |
66 | "sam64\n" | 66 | "sam64\n" |
67 | "brc 8, .Litfits\n" | 67 | "brc 8, 1f\n" |
68 | "agr 5, %5\n" | 68 | "agr 5, %5\n" |
69 | ".Litfits: \n" | 69 | "1: \n" |
70 | "lgr %0,4\n" | 70 | "lgr %0,4\n" |
71 | "lgr %1,5\n" | 71 | "lgr %1,5\n" |
72 | : "=d" (return_code), "=d" (return_len) | 72 | : "=d" (return_code), "=d" (return_len) |
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index 2721c3a32b84..5aa71b05b8ae 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c | |||
@@ -70,6 +70,8 @@ machine_kexec(struct kimage *image) | |||
70 | for (;;); | 70 | for (;;); |
71 | } | 71 | } |
72 | 72 | ||
73 | extern void pfault_fini(void); | ||
74 | |||
73 | static void | 75 | static void |
74 | kexec_halt_all_cpus(void *kernel_image) | 76 | kexec_halt_all_cpus(void *kernel_image) |
75 | { | 77 | { |
@@ -78,6 +80,11 @@ kexec_halt_all_cpus(void *kernel_image) | |||
78 | struct kimage *image; | 80 | struct kimage *image; |
79 | relocate_kernel_t data_mover; | 81 | relocate_kernel_t data_mover; |
80 | 82 | ||
83 | #ifdef CONFIG_PFAULT | ||
84 | if (MACHINE_IS_VM) | ||
85 | pfault_fini(); | ||
86 | #endif | ||
87 | |||
81 | if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid)) | 88 | if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid)) |
82 | signal_processor(smp_processor_id(), sigp_stop); | 89 | signal_processor(smp_processor_id(), sigp_stop); |
83 | 90 | ||
diff --git a/arch/s390/kernel/relocate_kernel.S b/arch/s390/kernel/relocate_kernel.S index d5e4a62fbb79..2a25ec7147ff 100644 --- a/arch/s390/kernel/relocate_kernel.S +++ b/arch/s390/kernel/relocate_kernel.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * (C) Copyright IBM Corp. 2005 | 4 | * (C) Copyright IBM Corp. 2005 |
5 | * | 5 | * |
6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> | 6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> |
7 | * Heiko Carstens <heiko.carstens@de.ibm.com> | ||
7 | * | 8 | * |
8 | */ | 9 | */ |
9 | 10 | ||
@@ -25,8 +26,31 @@ | |||
25 | relocate_kernel: | 26 | relocate_kernel: |
26 | basr %r13,0 #base address | 27 | basr %r13,0 #base address |
27 | .base: | 28 | .base: |
28 | spx zero64-.base(%r13) #absolute addressing mode | ||
29 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) | 29 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) |
30 | spx zero64-.base(%r13) #absolute addressing mode | ||
31 | stctl %c0,%c15,ctlregs-.base(%r13) | ||
32 | stm %r0,%r15,gprregs-.base(%r13) | ||
33 | la %r1,load_psw-.base(%r13) | ||
34 | mvc 0(8,%r0),0(%r1) | ||
35 | la %r0,.back-.base(%r13) | ||
36 | st %r0,4(%r0) | ||
37 | oi 4(%r0),0x80 | ||
38 | mvc 0x68(8,%r0),0(%r1) | ||
39 | la %r0,.back_pgm-.base(%r13) | ||
40 | st %r0,0x6c(%r0) | ||
41 | oi 0x6c(%r0),0x80 | ||
42 | lhi %r0,0 | ||
43 | diag %r0,%r0,0x308 | ||
44 | .back: | ||
45 | basr %r13,0 | ||
46 | .back_base: | ||
47 | oi have_diag308-.back_base(%r13),0x01 | ||
48 | lctl %c0,%c15,ctlregs-.back_base(%r13) | ||
49 | lm %r0,%r15,gprregs-.back_base(%r13) | ||
50 | j .start_reloc | ||
51 | .back_pgm: | ||
52 | lm %r0,%r15,gprregs-.base(%r13) | ||
53 | .start_reloc: | ||
30 | lhi %r10,-1 #preparing the mask | 54 | lhi %r10,-1 #preparing the mask |
31 | sll %r10,12 #shift it such that it becomes 0xf000 | 55 | sll %r10,12 #shift it such that it becomes 0xf000 |
32 | .top: | 56 | .top: |
@@ -63,6 +87,10 @@ | |||
63 | o %r3,4(%r4) #or load address into psw | 87 | o %r3,4(%r4) #or load address into psw |
64 | st %r3,4(%r4) | 88 | st %r3,4(%r4) |
65 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 | 89 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 |
90 | tm have_diag308-.base(%r13),0x01 | ||
91 | jno .no_diag308 | ||
92 | diag %r0,%r0,0x308 | ||
93 | .no_diag308: | ||
66 | sr %r1,%r1 #clear %r1 | 94 | sr %r1,%r1 #clear %r1 |
67 | sr %r2,%r2 #clear %r2 | 95 | sr %r2,%r2 #clear %r2 |
68 | sigp %r1,%r2,0x12 #set cpuid to zero | 96 | sigp %r1,%r2,0x12 #set cpuid to zero |
@@ -75,6 +103,17 @@ | |||
75 | .long 0x00080000,0x80000000 | 103 | .long 0x00080000,0x80000000 |
76 | sys_msk: | 104 | sys_msk: |
77 | .quad 0 | 105 | .quad 0 |
106 | ctlregs: | ||
107 | .rept 16 | ||
108 | .long 0 | ||
109 | .endr | ||
110 | gprregs: | ||
111 | .rept 16 | ||
112 | .long 0 | ||
113 | .endr | ||
114 | have_diag308: | ||
115 | .byte 0 | ||
116 | .align 8 | ||
78 | relocate_kernel_end: | 117 | relocate_kernel_end: |
79 | .globl relocate_kernel_len | 118 | .globl relocate_kernel_len |
80 | relocate_kernel_len: | 119 | relocate_kernel_len: |
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S index 96290cc4eb3c..8cdb86e8911f 100644 --- a/arch/s390/kernel/relocate_kernel64.S +++ b/arch/s390/kernel/relocate_kernel64.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * (C) Copyright IBM Corp. 2005 | 4 | * (C) Copyright IBM Corp. 2005 |
5 | * | 5 | * |
6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> | 6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> |
7 | * Heiko Carstens <heiko.carstens@de.ibm.com> | ||
7 | * | 8 | * |
8 | */ | 9 | */ |
9 | 10 | ||
@@ -26,8 +27,34 @@ | |||
26 | relocate_kernel: | 27 | relocate_kernel: |
27 | basr %r13,0 #base address | 28 | basr %r13,0 #base address |
28 | .base: | 29 | .base: |
30 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQs | ||
29 | spx zero64-.base(%r13) #absolute addressing mode | 31 | spx zero64-.base(%r13) #absolute addressing mode |
30 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) | 32 | stctg %c0,%c15,ctlregs-.base(%r13) |
33 | stmg %r0,%r15,gprregs-.base(%r13) | ||
34 | lghi %r0,3 | ||
35 | sllg %r0,%r0,31 | ||
36 | stg %r0,0x1d0(%r0) | ||
37 | la %r0,.back_pgm-.base(%r13) | ||
38 | stg %r0,0x1d8(%r0) | ||
39 | la %r1,load_psw-.base(%r13) | ||
40 | mvc 0(8,%r0),0(%r1) | ||
41 | la %r0,.back-.base(%r13) | ||
42 | st %r0,4(%r0) | ||
43 | oi 4(%r0),0x80 | ||
44 | lghi %r0,0 | ||
45 | diag %r0,%r0,0x308 | ||
46 | .back: | ||
47 | lhi %r1,1 #mode 1 = esame | ||
48 | sigp %r1,%r0,0x12 #switch to esame mode | ||
49 | sam64 #switch to 64 bit addressing mode | ||
50 | basr %r13,0 | ||
51 | .back_base: | ||
52 | oi have_diag308-.back_base(%r13),0x01 | ||
53 | lctlg %c0,%c15,ctlregs-.back_base(%r13) | ||
54 | lmg %r0,%r15,gprregs-.back_base(%r13) | ||
55 | j .top | ||
56 | .back_pgm: | ||
57 | lmg %r0,%r15,gprregs-.base(%r13) | ||
31 | .top: | 58 | .top: |
32 | lghi %r7,4096 #load PAGE_SIZE in r7 | 59 | lghi %r7,4096 #load PAGE_SIZE in r7 |
33 | lghi %r9,4096 #load PAGE_SIZE in r9 | 60 | lghi %r9,4096 #load PAGE_SIZE in r9 |
@@ -62,6 +89,10 @@ | |||
62 | o %r3,4(%r4) #or load address into psw | 89 | o %r3,4(%r4) #or load address into psw |
63 | st %r3,4(%r4) | 90 | st %r3,4(%r4) |
64 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 | 91 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 |
92 | tm have_diag308-.base(%r13),0x01 | ||
93 | jno .no_diag308 | ||
94 | diag %r0,%r0,0x308 | ||
95 | .no_diag308: | ||
65 | sam31 #31 bit mode | 96 | sam31 #31 bit mode |
66 | sr %r1,%r1 #erase register r1 | 97 | sr %r1,%r1 #erase register r1 |
67 | sr %r2,%r2 #erase register r2 | 98 | sr %r2,%r2 #erase register r2 |
@@ -75,8 +106,18 @@ | |||
75 | .long 0x00080000,0x80000000 | 106 | .long 0x00080000,0x80000000 |
76 | sys_msk: | 107 | sys_msk: |
77 | .quad 0 | 108 | .quad 0 |
109 | ctlregs: | ||
110 | .rept 16 | ||
111 | .quad 0 | ||
112 | .endr | ||
113 | gprregs: | ||
114 | .rept 16 | ||
115 | .quad 0 | ||
116 | .endr | ||
117 | have_diag308: | ||
118 | .byte 0 | ||
119 | .align 8 | ||
78 | relocate_kernel_end: | 120 | relocate_kernel_end: |
79 | .globl relocate_kernel_len | 121 | .globl relocate_kernel_len |
80 | relocate_kernel_len: | 122 | relocate_kernel_len: |
81 | .quad relocate_kernel_end - relocate_kernel | 123 | .quad relocate_kernel_end - relocate_kernel |
82 | |||
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index da77f001af8d..85222fee4361 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -537,7 +537,8 @@ int __devinit start_secondary(void *cpuvoid) | |||
537 | #endif | 537 | #endif |
538 | #ifdef CONFIG_PFAULT | 538 | #ifdef CONFIG_PFAULT |
539 | /* Enable pfault pseudo page faults on this cpu. */ | 539 | /* Enable pfault pseudo page faults on this cpu. */ |
540 | pfault_init(); | 540 | if (MACHINE_IS_VM) |
541 | pfault_init(); | ||
541 | #endif | 542 | #endif |
542 | /* Mark this cpu as online */ | 543 | /* Mark this cpu as online */ |
543 | cpu_set(smp_processor_id(), cpu_online_map); | 544 | cpu_set(smp_processor_id(), cpu_online_map); |
@@ -690,7 +691,8 @@ __cpu_disable(void) | |||
690 | 691 | ||
691 | #ifdef CONFIG_PFAULT | 692 | #ifdef CONFIG_PFAULT |
692 | /* Disable pfault pseudo page faults on this cpu. */ | 693 | /* Disable pfault pseudo page faults on this cpu. */ |
693 | pfault_fini(); | 694 | if (MACHINE_IS_VM) |
695 | pfault_fini(); | ||
694 | #endif | 696 | #endif |
695 | 697 | ||
696 | /* disable all external interrupts */ | 698 | /* disable all external interrupts */ |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index a8668afb5f87..426d7cafdab3 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -290,3 +290,8 @@ SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper) | |||
290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) | 290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) |
291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */ | 291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */ |
292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper) | 292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid_wrapper) |
293 | SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper) | ||
294 | SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper) | ||
295 | SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init) | ||
296 | SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper) | ||
297 | SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper) | ||
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index bc7b7be7acbe..6b8703ec2ae6 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/kallsyms.h> | 31 | #include <linux/kallsyms.h> |
32 | #include <linux/reboot.h> | ||
32 | 33 | ||
33 | #include <asm/system.h> | 34 | #include <asm/system.h> |
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
@@ -675,6 +676,19 @@ asmlinkage void kernel_stack_overflow(struct pt_regs * regs) | |||
675 | panic("Corrupt kernel stack, can't continue."); | 676 | panic("Corrupt kernel stack, can't continue."); |
676 | } | 677 | } |
677 | 678 | ||
679 | #ifndef CONFIG_ARCH_S390X | ||
680 | static int | ||
681 | pagex_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) | ||
682 | { | ||
683 | if (MACHINE_IS_VM) | ||
684 | cpcmd("SET PAGEX OFF", NULL, 0, NULL); | ||
685 | return NOTIFY_DONE; | ||
686 | } | ||
687 | |||
688 | static struct notifier_block pagex_reboot_notifier = { | ||
689 | .notifier_call = &pagex_reboot_event, | ||
690 | }; | ||
691 | #endif | ||
678 | 692 | ||
679 | /* init is done in lowcore.S and head.S */ | 693 | /* init is done in lowcore.S and head.S */ |
680 | 694 | ||
@@ -735,6 +749,7 @@ void __init trap_init(void) | |||
735 | &ext_int_pfault); | 749 | &ext_int_pfault); |
736 | #endif | 750 | #endif |
737 | #ifndef CONFIG_ARCH_S390X | 751 | #ifndef CONFIG_ARCH_S390X |
752 | register_reboot_notifier(&pagex_reboot_notifier); | ||
738 | cpcmd("SET PAGEX ON", NULL, 0, NULL); | 753 | cpcmd("SET PAGEX ON", NULL, 0, NULL); |
739 | #endif | 754 | #endif |
740 | } | 755 | } |
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S index 6615e4838ee4..fb6368159dd0 100644 --- a/arch/sh/kernel/entry.S +++ b/arch/sh/kernel/entry.S | |||
@@ -1145,5 +1145,10 @@ ENTRY(sys_call_table) | |||
1145 | .long sys_add_key /* 285 */ | 1145 | .long sys_add_key /* 285 */ |
1146 | .long sys_request_key | 1146 | .long sys_request_key |
1147 | .long sys_keyctl | 1147 | .long sys_keyctl |
1148 | .long sys_ioprio_set | ||
1149 | .long sys_ioprio_get | ||
1150 | .long sys_inotify_init /* 290 */ | ||
1151 | .long sys_inotify_add_watch | ||
1152 | .long sys_inotify_rm_watch | ||
1148 | 1153 | ||
1149 | /* End of entry.S */ | 1154 | /* End of entry.S */ |
diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S index 6aabc63e4518..a3d037805f1c 100644 --- a/arch/sh64/kernel/syscalls.S +++ b/arch/sh64/kernel/syscalls.S | |||
@@ -342,4 +342,9 @@ sys_call_table: | |||
342 | .long sys_add_key | 342 | .long sys_add_key |
343 | .long sys_request_key | 343 | .long sys_request_key |
344 | .long sys_keyctl /* 315 */ | 344 | .long sys_keyctl /* 315 */ |
345 | .long sys_ioprio_set | ||
346 | .long sys_ioprio_get | ||
347 | .long sys_inotify_init | ||
348 | .long sys_inotify_add_watch | ||
349 | .long sys_inotify_rm_watch /* 320 */ | ||
345 | 350 | ||
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c index a24932881dbb..f08d0eaf6497 100644 --- a/arch/sh64/mm/fault.c +++ b/arch/sh64/mm/fault.c | |||
@@ -223,13 +223,13 @@ good_area: | |||
223 | */ | 223 | */ |
224 | survive: | 224 | survive: |
225 | switch (handle_mm_fault(mm, vma, address, writeaccess)) { | 225 | switch (handle_mm_fault(mm, vma, address, writeaccess)) { |
226 | case 1: | 226 | case VM_FAULT_MINOR: |
227 | tsk->min_flt++; | 227 | tsk->min_flt++; |
228 | break; | 228 | break; |
229 | case 2: | 229 | case VM_FAULT_MAJOR: |
230 | tsk->maj_flt++; | 230 | tsk->maj_flt++; |
231 | break; | 231 | break; |
232 | case 0: | 232 | case VM_FAULT_SIGBUS: |
233 | goto do_sigbus; | 233 | goto do_sigbus; |
234 | default: | 234 | default: |
235 | goto out_of_memory; | 235 | goto out_of_memory; |
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index 1bd430d0ca06..8faa8dc4de43 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -98,8 +98,9 @@ extern void ___rw_write_enter(void); | |||
98 | * The module references will be fixed up by module_frob_arch_sections. | 98 | * The module references will be fixed up by module_frob_arch_sections. |
99 | */ | 99 | */ |
100 | #define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ | 100 | #define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ |
101 | extern __ret __x(__arg1, __arg2) \ | 101 | extern __ret __x(__arg1, __arg2); \ |
102 | __attribute__((weak, alias("." # __x))); | 102 | asm(".weak " #__x);\ |
103 | asm(#__x "=." #__x); | ||
103 | 104 | ||
104 | DOT_ALIAS2(int, div, int, int) | 105 | DOT_ALIAS2(int, div, int, int) |
105 | DOT_ALIAS2(int, mul, int, int) | 106 | DOT_ALIAS2(int, mul, int, int) |
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile index 093281bdf85f..6f00ab8b9d23 100644 --- a/arch/sparc64/kernel/Makefile +++ b/arch/sparc64/kernel/Makefile | |||
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror | |||
8 | extra-y := head.o init_task.o vmlinux.lds | 8 | extra-y := head.o init_task.o vmlinux.lds |
9 | 9 | ||
10 | obj-y := process.o setup.o cpu.o idprom.o \ | 10 | obj-y := process.o setup.o cpu.o idprom.o \ |
11 | traps.o devices.o auxio.o \ | 11 | traps.o devices.o auxio.o una_asm.o \ |
12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ | 12 | irq.o ptrace.o time.o sys_sparc.o signal.o \ |
13 | unaligned.o central.o pci.o starfire.o semaphore.o \ | 13 | unaligned.o central.o pci.o starfire.o semaphore.o \ |
14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o | 14 | power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o |
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index bba140d98b1b..f21c993f8856 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -540,6 +540,7 @@ void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res, | |||
540 | 540 | ||
541 | pbm->parent->resource_adjust(pdev, res, root); | 541 | pbm->parent->resource_adjust(pdev, res, root); |
542 | } | 542 | } |
543 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
543 | 544 | ||
544 | char * __init pcibios_setup(char *str) | 545 | char * __init pcibios_setup(char *str) |
545 | { | 546 | { |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 100b0107c4be..0c9e54b2f0c8 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2127,6 +2127,9 @@ void __init trap_init(void) | |||
2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || | 2127 | TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || |
2128 | TI_NEW_CHILD != offsetof(struct thread_info, new_child) || | 2128 | TI_NEW_CHILD != offsetof(struct thread_info, new_child) || |
2129 | TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || | 2129 | TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || |
2130 | TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || | ||
2131 | TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || | ||
2132 | TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || | ||
2130 | TI_FPREGS != offsetof(struct thread_info, fpregs) || | 2133 | TI_FPREGS != offsetof(struct thread_info, fpregs) || |
2131 | (TI_FPREGS & (64 - 1))) | 2134 | (TI_FPREGS & (64 - 1))) |
2132 | thread_info_offsets_are_bolixed_dave(); | 2135 | thread_info_offsets_are_bolixed_dave(); |
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S new file mode 100644 index 000000000000..cbb40585253c --- /dev/null +++ b/arch/sparc64/kernel/una_asm.S | |||
@@ -0,0 +1,153 @@ | |||
1 | /* una_asm.S: Kernel unaligned trap assembler helpers. | ||
2 | * | ||
3 | * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net) | ||
4 | * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
5 | */ | ||
6 | |||
7 | .text | ||
8 | |||
9 | kernel_unaligned_trap_fault: | ||
10 | call kernel_mna_trap_fault | ||
11 | nop | ||
12 | retl | ||
13 | nop | ||
14 | .size kern_unaligned_trap_fault, .-kern_unaligned_trap_fault | ||
15 | |||
16 | .globl __do_int_store | ||
17 | __do_int_store: | ||
18 | rd %asi, %o4 | ||
19 | wr %o3, 0, %asi | ||
20 | ldx [%o2], %g3 | ||
21 | cmp %o1, 2 | ||
22 | be,pn %icc, 2f | ||
23 | cmp %o1, 4 | ||
24 | be,pt %icc, 1f | ||
25 | srlx %g3, 24, %g2 | ||
26 | srlx %g3, 56, %g1 | ||
27 | srlx %g3, 48, %g7 | ||
28 | 4: stba %g1, [%o0] %asi | ||
29 | srlx %g3, 40, %g1 | ||
30 | 5: stba %g7, [%o0 + 1] %asi | ||
31 | srlx %g3, 32, %g7 | ||
32 | 6: stba %g1, [%o0 + 2] %asi | ||
33 | 7: stba %g7, [%o0 + 3] %asi | ||
34 | srlx %g3, 16, %g1 | ||
35 | 8: stba %g2, [%o0 + 4] %asi | ||
36 | srlx %g3, 8, %g7 | ||
37 | 9: stba %g1, [%o0 + 5] %asi | ||
38 | 10: stba %g7, [%o0 + 6] %asi | ||
39 | ba,pt %xcc, 0f | ||
40 | 11: stba %g3, [%o0 + 7] %asi | ||
41 | 1: srl %g3, 16, %g7 | ||
42 | 12: stba %g2, [%o0] %asi | ||
43 | srl %g3, 8, %g2 | ||
44 | 13: stba %g7, [%o0 + 1] %asi | ||
45 | 14: stba %g2, [%o0 + 2] %asi | ||
46 | ba,pt %xcc, 0f | ||
47 | 15: stba %g3, [%o0 + 3] %asi | ||
48 | 2: srl %g3, 8, %g2 | ||
49 | 16: stba %g2, [%o0] %asi | ||
50 | 17: stba %g3, [%o0 + 1] %asi | ||
51 | 0: | ||
52 | wr %o4, 0x0, %asi | ||
53 | retl | ||
54 | nop | ||
55 | .size __do_int_store, .-__do_int_store | ||
56 | |||
57 | .section __ex_table | ||
58 | .word 4b, kernel_unaligned_trap_fault | ||
59 | .word 5b, kernel_unaligned_trap_fault | ||
60 | .word 6b, kernel_unaligned_trap_fault | ||
61 | .word 7b, kernel_unaligned_trap_fault | ||
62 | .word 8b, kernel_unaligned_trap_fault | ||
63 | .word 9b, kernel_unaligned_trap_fault | ||
64 | .word 10b, kernel_unaligned_trap_fault | ||
65 | .word 11b, kernel_unaligned_trap_fault | ||
66 | .word 12b, kernel_unaligned_trap_fault | ||
67 | .word 13b, kernel_unaligned_trap_fault | ||
68 | .word 14b, kernel_unaligned_trap_fault | ||
69 | .word 15b, kernel_unaligned_trap_fault | ||
70 | .word 16b, kernel_unaligned_trap_fault | ||
71 | .word 17b, kernel_unaligned_trap_fault | ||
72 | .previous | ||
73 | |||
74 | .globl do_int_load | ||
75 | do_int_load: | ||
76 | rd %asi, %o5 | ||
77 | wr %o4, 0, %asi | ||
78 | cmp %o1, 8 | ||
79 | bge,pn %icc, 9f | ||
80 | cmp %o1, 4 | ||
81 | be,pt %icc, 6f | ||
82 | 4: lduba [%o2] %asi, %g2 | ||
83 | 5: lduba [%o2 + 1] %asi, %g3 | ||
84 | sll %g2, 8, %g2 | ||
85 | brz,pt %o3, 3f | ||
86 | add %g2, %g3, %g2 | ||
87 | sllx %g2, 48, %g2 | ||
88 | srax %g2, 48, %g2 | ||
89 | 3: ba,pt %xcc, 0f | ||
90 | stx %g2, [%o0] | ||
91 | 6: lduba [%o2 + 1] %asi, %g3 | ||
92 | sll %g2, 24, %g2 | ||
93 | 7: lduba [%o2 + 2] %asi, %g7 | ||
94 | sll %g3, 16, %g3 | ||
95 | 8: lduba [%o2 + 3] %asi, %g1 | ||
96 | sll %g7, 8, %g7 | ||
97 | or %g2, %g3, %g2 | ||
98 | or %g7, %g1, %g7 | ||
99 | or %g2, %g7, %g2 | ||
100 | brnz,a,pt %o3, 3f | ||
101 | sra %g2, 0, %g2 | ||
102 | 3: ba,pt %xcc, 0f | ||
103 | stx %g2, [%o0] | ||
104 | 9: lduba [%o2] %asi, %g2 | ||
105 | 10: lduba [%o2 + 1] %asi, %g3 | ||
106 | sllx %g2, 56, %g2 | ||
107 | 11: lduba [%o2 + 2] %asi, %g7 | ||
108 | sllx %g3, 48, %g3 | ||
109 | 12: lduba [%o2 + 3] %asi, %g1 | ||
110 | sllx %g7, 40, %g7 | ||
111 | sllx %g1, 32, %g1 | ||
112 | or %g2, %g3, %g2 | ||
113 | or %g7, %g1, %g7 | ||
114 | 13: lduba [%o2 + 4] %asi, %g3 | ||
115 | or %g2, %g7, %g7 | ||
116 | 14: lduba [%o2 + 5] %asi, %g1 | ||
117 | sllx %g3, 24, %g3 | ||
118 | 15: lduba [%o2 + 6] %asi, %g2 | ||
119 | sllx %g1, 16, %g1 | ||
120 | or %g7, %g3, %g7 | ||
121 | 16: lduba [%o2 + 7] %asi, %g3 | ||
122 | sllx %g2, 8, %g2 | ||
123 | or %g7, %g1, %g7 | ||
124 | or %g2, %g3, %g2 | ||
125 | or %g7, %g2, %g7 | ||
126 | cmp %o1, 8 | ||
127 | be,a,pt %icc, 0f | ||
128 | stx %g7, [%o0] | ||
129 | srlx %g7, 32, %g2 | ||
130 | sra %g7, 0, %g7 | ||
131 | stx %g2, [%o0] | ||
132 | stx %g7, [%o0 + 8] | ||
133 | 0: | ||
134 | wr %o5, 0x0, %asi | ||
135 | retl | ||
136 | nop | ||
137 | .size __do_int_load, .-__do_int_load | ||
138 | |||
139 | .section __ex_table | ||
140 | .word 4b, kernel_unaligned_trap_fault | ||
141 | .word 5b, kernel_unaligned_trap_fault | ||
142 | .word 6b, kernel_unaligned_trap_fault | ||
143 | .word 7b, kernel_unaligned_trap_fault | ||
144 | .word 8b, kernel_unaligned_trap_fault | ||
145 | .word 9b, kernel_unaligned_trap_fault | ||
146 | .word 10b, kernel_unaligned_trap_fault | ||
147 | .word 11b, kernel_unaligned_trap_fault | ||
148 | .word 12b, kernel_unaligned_trap_fault | ||
149 | .word 13b, kernel_unaligned_trap_fault | ||
150 | .word 14b, kernel_unaligned_trap_fault | ||
151 | .word 15b, kernel_unaligned_trap_fault | ||
152 | .word 16b, kernel_unaligned_trap_fault | ||
153 | .previous | ||
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 4372bf32ecf6..11c3e88732e4 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c | |||
@@ -180,169 +180,28 @@ static void __attribute_used__ unaligned_panic(char *str, struct pt_regs *regs) | |||
180 | die_if_kernel(str, regs); | 180 | die_if_kernel(str, regs); |
181 | } | 181 | } |
182 | 182 | ||
183 | #define do_integer_load(dest_reg, size, saddr, is_signed, asi, errh) ({ \ | 183 | extern void do_int_load(unsigned long *dest_reg, int size, |
184 | __asm__ __volatile__ ( \ | 184 | unsigned long *saddr, int is_signed, int asi); |
185 | "wr %4, 0, %%asi\n\t" \ | ||
186 | "cmp %1, 8\n\t" \ | ||
187 | "bge,pn %%icc, 9f\n\t" \ | ||
188 | " cmp %1, 4\n\t" \ | ||
189 | "be,pt %%icc, 6f\n" \ | ||
190 | "4:\t" " lduba [%2] %%asi, %%l1\n" \ | ||
191 | "5:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
192 | "sll %%l1, 8, %%l1\n\t" \ | ||
193 | "brz,pt %3, 3f\n\t" \ | ||
194 | " add %%l1, %%l2, %%l1\n\t" \ | ||
195 | "sllx %%l1, 48, %%l1\n\t" \ | ||
196 | "srax %%l1, 48, %%l1\n" \ | ||
197 | "3:\t" "ba,pt %%xcc, 0f\n\t" \ | ||
198 | " stx %%l1, [%0]\n" \ | ||
199 | "6:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
200 | "sll %%l1, 24, %%l1\n" \ | ||
201 | "7:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \ | ||
202 | "sll %%l2, 16, %%l2\n" \ | ||
203 | "8:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \ | ||
204 | "sll %%g7, 8, %%g7\n\t" \ | ||
205 | "or %%l1, %%l2, %%l1\n\t" \ | ||
206 | "or %%g7, %%g1, %%g7\n\t" \ | ||
207 | "or %%l1, %%g7, %%l1\n\t" \ | ||
208 | "brnz,a,pt %3, 3f\n\t" \ | ||
209 | " sra %%l1, 0, %%l1\n" \ | ||
210 | "3:\t" "ba,pt %%xcc, 0f\n\t" \ | ||
211 | " stx %%l1, [%0]\n" \ | ||
212 | "9:\t" "lduba [%2] %%asi, %%l1\n" \ | ||
213 | "10:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \ | ||
214 | "sllx %%l1, 56, %%l1\n" \ | ||
215 | "11:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \ | ||
216 | "sllx %%l2, 48, %%l2\n" \ | ||
217 | "12:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \ | ||
218 | "sllx %%g7, 40, %%g7\n\t" \ | ||
219 | "sllx %%g1, 32, %%g1\n\t" \ | ||
220 | "or %%l1, %%l2, %%l1\n\t" \ | ||
221 | "or %%g7, %%g1, %%g7\n" \ | ||
222 | "13:\t" "lduba [%2 + 4] %%asi, %%l2\n\t" \ | ||
223 | "or %%l1, %%g7, %%g7\n" \ | ||
224 | "14:\t" "lduba [%2 + 5] %%asi, %%g1\n\t" \ | ||
225 | "sllx %%l2, 24, %%l2\n" \ | ||
226 | "15:\t" "lduba [%2 + 6] %%asi, %%l1\n\t" \ | ||
227 | "sllx %%g1, 16, %%g1\n\t" \ | ||
228 | "or %%g7, %%l2, %%g7\n" \ | ||
229 | "16:\t" "lduba [%2 + 7] %%asi, %%l2\n\t" \ | ||
230 | "sllx %%l1, 8, %%l1\n\t" \ | ||
231 | "or %%g7, %%g1, %%g7\n\t" \ | ||
232 | "or %%l1, %%l2, %%l1\n\t" \ | ||
233 | "or %%g7, %%l1, %%g7\n\t" \ | ||
234 | "cmp %1, 8\n\t" \ | ||
235 | "be,a,pt %%icc, 0f\n\t" \ | ||
236 | " stx %%g7, [%0]\n\t" \ | ||
237 | "srlx %%g7, 32, %%l1\n\t" \ | ||
238 | "sra %%g7, 0, %%g7\n\t" \ | ||
239 | "stx %%l1, [%0]\n\t" \ | ||
240 | "stx %%g7, [%0 + 8]\n" \ | ||
241 | "0:\n\t" \ | ||
242 | "wr %%g0, %5, %%asi\n\n\t" \ | ||
243 | ".section __ex_table\n\t" \ | ||
244 | ".word 4b, " #errh "\n\t" \ | ||
245 | ".word 5b, " #errh "\n\t" \ | ||
246 | ".word 6b, " #errh "\n\t" \ | ||
247 | ".word 7b, " #errh "\n\t" \ | ||
248 | ".word 8b, " #errh "\n\t" \ | ||
249 | ".word 9b, " #errh "\n\t" \ | ||
250 | ".word 10b, " #errh "\n\t" \ | ||
251 | ".word 11b, " #errh "\n\t" \ | ||
252 | ".word 12b, " #errh "\n\t" \ | ||
253 | ".word 13b, " #errh "\n\t" \ | ||
254 | ".word 14b, " #errh "\n\t" \ | ||
255 | ".word 15b, " #errh "\n\t" \ | ||
256 | ".word 16b, " #errh "\n\n\t" \ | ||
257 | ".previous\n\t" \ | ||
258 | : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed), \ | ||
259 | "r" (asi), "i" (ASI_AIUS) \ | ||
260 | : "l1", "l2", "g7", "g1", "cc"); \ | ||
261 | }) | ||
262 | 185 | ||
263 | #define store_common(dst_addr, size, src_val, asi, errh) ({ \ | 186 | extern void __do_int_store(unsigned long *dst_addr, int size, |
264 | __asm__ __volatile__ ( \ | 187 | unsigned long *src_val, int asi); |
265 | "wr %3, 0, %%asi\n\t" \ | 188 | |
266 | "ldx [%2], %%l1\n" \ | 189 | static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr, |
267 | "cmp %1, 2\n\t" \ | 190 | struct pt_regs *regs, int asi) |
268 | "be,pn %%icc, 2f\n\t" \ | 191 | { |
269 | " cmp %1, 4\n\t" \ | 192 | unsigned long zero = 0; |
270 | "be,pt %%icc, 1f\n\t" \ | 193 | unsigned long *src_val = &zero; |
271 | " srlx %%l1, 24, %%l2\n\t" \ | 194 | |
272 | "srlx %%l1, 56, %%g1\n\t" \ | 195 | if (size == 16) { |
273 | "srlx %%l1, 48, %%g7\n" \ | 196 | size = 8; |
274 | "4:\t" "stba %%g1, [%0] %%asi\n\t" \ | 197 | zero = (((long)(reg_num ? |
275 | "srlx %%l1, 40, %%g1\n" \ | 198 | (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | |
276 | "5:\t" "stba %%g7, [%0 + 1] %%asi\n\t" \ | 199 | (unsigned)fetch_reg(reg_num + 1, regs); |
277 | "srlx %%l1, 32, %%g7\n" \ | 200 | } else if (reg_num) { |
278 | "6:\t" "stba %%g1, [%0 + 2] %%asi\n" \ | 201 | src_val = fetch_reg_addr(reg_num, regs); |
279 | "7:\t" "stba %%g7, [%0 + 3] %%asi\n\t" \ | 202 | } |
280 | "srlx %%l1, 16, %%g1\n" \ | 203 | __do_int_store(dst_addr, size, src_val, asi); |
281 | "8:\t" "stba %%l2, [%0 + 4] %%asi\n\t" \ | 204 | } |
282 | "srlx %%l1, 8, %%g7\n" \ | ||
283 | "9:\t" "stba %%g1, [%0 + 5] %%asi\n" \ | ||
284 | "10:\t" "stba %%g7, [%0 + 6] %%asi\n\t" \ | ||
285 | "ba,pt %%xcc, 0f\n" \ | ||
286 | "11:\t" " stba %%l1, [%0 + 7] %%asi\n" \ | ||
287 | "1:\t" "srl %%l1, 16, %%g7\n" \ | ||
288 | "12:\t" "stba %%l2, [%0] %%asi\n\t" \ | ||
289 | "srl %%l1, 8, %%l2\n" \ | ||
290 | "13:\t" "stba %%g7, [%0 + 1] %%asi\n" \ | ||
291 | "14:\t" "stba %%l2, [%0 + 2] %%asi\n\t" \ | ||
292 | "ba,pt %%xcc, 0f\n" \ | ||
293 | "15:\t" " stba %%l1, [%0 + 3] %%asi\n" \ | ||
294 | "2:\t" "srl %%l1, 8, %%l2\n" \ | ||
295 | "16:\t" "stba %%l2, [%0] %%asi\n" \ | ||
296 | "17:\t" "stba %%l1, [%0 + 1] %%asi\n" \ | ||
297 | "0:\n\t" \ | ||
298 | "wr %%g0, %4, %%asi\n\n\t" \ | ||
299 | ".section __ex_table\n\t" \ | ||
300 | ".word 4b, " #errh "\n\t" \ | ||
301 | ".word 5b, " #errh "\n\t" \ | ||
302 | ".word 6b, " #errh "\n\t" \ | ||
303 | ".word 7b, " #errh "\n\t" \ | ||
304 | ".word 8b, " #errh "\n\t" \ | ||
305 | ".word 9b, " #errh "\n\t" \ | ||
306 | ".word 10b, " #errh "\n\t" \ | ||
307 | ".word 11b, " #errh "\n\t" \ | ||
308 | ".word 12b, " #errh "\n\t" \ | ||
309 | ".word 13b, " #errh "\n\t" \ | ||
310 | ".word 14b, " #errh "\n\t" \ | ||
311 | ".word 15b, " #errh "\n\t" \ | ||
312 | ".word 16b, " #errh "\n\t" \ | ||
313 | ".word 17b, " #errh "\n\n\t" \ | ||
314 | ".previous\n\t" \ | ||
315 | : : "r" (dst_addr), "r" (size), "r" (src_val), "r" (asi), "i" (ASI_AIUS)\ | ||
316 | : "l1", "l2", "g7", "g1", "cc"); \ | ||
317 | }) | ||
318 | |||
319 | #define do_integer_store(reg_num, size, dst_addr, regs, asi, errh) ({ \ | ||
320 | unsigned long zero = 0; \ | ||
321 | unsigned long *src_val = &zero; \ | ||
322 | \ | ||
323 | if (size == 16) { \ | ||
324 | size = 8; \ | ||
325 | zero = (((long)(reg_num ? \ | ||
326 | (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | \ | ||
327 | (unsigned)fetch_reg(reg_num + 1, regs); \ | ||
328 | } else if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \ | ||
329 | store_common(dst_addr, size, src_val, asi, errh); \ | ||
330 | }) | ||
331 | |||
332 | extern void smp_capture(void); | ||
333 | extern void smp_release(void); | ||
334 | |||
335 | #define do_atomic(srcdest_reg, mem, errh) ({ \ | ||
336 | unsigned long flags, tmp; \ | ||
337 | \ | ||
338 | smp_capture(); \ | ||
339 | local_irq_save(flags); \ | ||
340 | tmp = *srcdest_reg; \ | ||
341 | do_integer_load(srcdest_reg, 4, mem, 0, errh); \ | ||
342 | store_common(mem, 4, &tmp, errh); \ | ||
343 | local_irq_restore(flags); \ | ||
344 | smp_release(); \ | ||
345 | }) | ||
346 | 205 | ||
347 | static inline void advance(struct pt_regs *regs) | 206 | static inline void advance(struct pt_regs *regs) |
348 | { | 207 | { |
@@ -364,24 +223,29 @@ static inline int ok_for_kernel(unsigned int insn) | |||
364 | return !floating_point_load_or_store_p(insn); | 223 | return !floating_point_load_or_store_p(insn); |
365 | } | 224 | } |
366 | 225 | ||
367 | void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault"); | 226 | void kernel_mna_trap_fault(void) |
368 | |||
369 | void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) | ||
370 | { | 227 | { |
371 | unsigned long g2 = regs->u_regs [UREG_G2]; | 228 | struct pt_regs *regs = current_thread_info()->kern_una_regs; |
229 | unsigned int insn = current_thread_info()->kern_una_insn; | ||
230 | unsigned long g2 = regs->u_regs[UREG_G2]; | ||
372 | unsigned long fixup = search_extables_range(regs->tpc, &g2); | 231 | unsigned long fixup = search_extables_range(regs->tpc, &g2); |
373 | 232 | ||
374 | if (!fixup) { | 233 | if (!fixup) { |
375 | unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); | 234 | unsigned long address; |
235 | |||
236 | address = compute_effective_address(regs, insn, | ||
237 | ((insn >> 25) & 0x1f)); | ||
376 | if (address < PAGE_SIZE) { | 238 | if (address < PAGE_SIZE) { |
377 | printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); | 239 | printk(KERN_ALERT "Unable to handle kernel NULL " |
240 | "pointer dereference in mna handler"); | ||
378 | } else | 241 | } else |
379 | printk(KERN_ALERT "Unable to handle kernel paging request in mna handler"); | 242 | printk(KERN_ALERT "Unable to handle kernel paging " |
243 | "request in mna handler"); | ||
380 | printk(KERN_ALERT " at virtual address %016lx\n",address); | 244 | printk(KERN_ALERT " at virtual address %016lx\n",address); |
381 | printk(KERN_ALERT "current->{mm,active_mm}->context = %016lx\n", | 245 | printk(KERN_ALERT "current->{active_,}mm->context = %016lx\n", |
382 | (current->mm ? CTX_HWBITS(current->mm->context) : | 246 | (current->mm ? CTX_HWBITS(current->mm->context) : |
383 | CTX_HWBITS(current->active_mm->context))); | 247 | CTX_HWBITS(current->active_mm->context))); |
384 | printk(KERN_ALERT "current->{mm,active_mm}->pgd = %016lx\n", | 248 | printk(KERN_ALERT "current->{active_,}mm->pgd = %016lx\n", |
385 | (current->mm ? (unsigned long) current->mm->pgd : | 249 | (current->mm ? (unsigned long) current->mm->pgd : |
386 | (unsigned long) current->active_mm->pgd)); | 250 | (unsigned long) current->active_mm->pgd)); |
387 | die_if_kernel("Oops", regs); | 251 | die_if_kernel("Oops", regs); |
@@ -400,48 +264,41 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u | |||
400 | enum direction dir = decode_direction(insn); | 264 | enum direction dir = decode_direction(insn); |
401 | int size = decode_access_size(insn); | 265 | int size = decode_access_size(insn); |
402 | 266 | ||
267 | current_thread_info()->kern_una_regs = regs; | ||
268 | current_thread_info()->kern_una_insn = insn; | ||
269 | |||
403 | if (!ok_for_kernel(insn) || dir == both) { | 270 | if (!ok_for_kernel(insn) || dir == both) { |
404 | printk("Unsupported unaligned load/store trap for kernel at <%016lx>.\n", | 271 | printk("Unsupported unaligned load/store trap for kernel " |
405 | regs->tpc); | 272 | "at <%016lx>.\n", regs->tpc); |
406 | unaligned_panic("Kernel does fpu/atomic unaligned load/store.", regs); | 273 | unaligned_panic("Kernel does fpu/atomic " |
407 | 274 | "unaligned load/store.", regs); | |
408 | __asm__ __volatile__ ("\n" | 275 | |
409 | "kernel_unaligned_trap_fault:\n\t" | 276 | kernel_mna_trap_fault(); |
410 | "mov %0, %%o0\n\t" | ||
411 | "call kernel_mna_trap_fault\n\t" | ||
412 | " mov %1, %%o1\n\t" | ||
413 | : | ||
414 | : "r" (regs), "r" (insn) | ||
415 | : "o0", "o1", "o2", "o3", "o4", "o5", "o7", | ||
416 | "g1", "g2", "g3", "g4", "g7", "cc"); | ||
417 | } else { | 277 | } else { |
418 | unsigned long addr = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); | 278 | unsigned long addr; |
419 | 279 | ||
280 | addr = compute_effective_address(regs, insn, | ||
281 | ((insn >> 25) & 0x1f)); | ||
420 | #ifdef DEBUG_MNA | 282 | #ifdef DEBUG_MNA |
421 | printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] retpc[%016lx]\n", | 283 | printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] " |
422 | regs->tpc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]); | 284 | "retpc[%016lx]\n", |
285 | regs->tpc, dirstrings[dir], addr, size, | ||
286 | regs->u_regs[UREG_RETPC]); | ||
423 | #endif | 287 | #endif |
424 | switch (dir) { | 288 | switch (dir) { |
425 | case load: | 289 | case load: |
426 | do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs), | 290 | do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs), |
427 | size, (unsigned long *) addr, | 291 | size, (unsigned long *) addr, |
428 | decode_signedness(insn), decode_asi(insn, regs), | 292 | decode_signedness(insn), |
429 | kernel_unaligned_trap_fault); | 293 | decode_asi(insn, regs)); |
430 | break; | 294 | break; |
431 | 295 | ||
432 | case store: | 296 | case store: |
433 | do_integer_store(((insn>>25)&0x1f), size, | 297 | do_int_store(((insn>>25)&0x1f), size, |
434 | (unsigned long *) addr, regs, | 298 | (unsigned long *) addr, regs, |
435 | decode_asi(insn, regs), | 299 | decode_asi(insn, regs)); |
436 | kernel_unaligned_trap_fault); | ||
437 | break; | ||
438 | #if 0 /* unsupported */ | ||
439 | case both: | ||
440 | do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs), | ||
441 | (unsigned long *) addr, | ||
442 | kernel_unaligned_trap_fault); | ||
443 | break; | 300 | break; |
444 | #endif | 301 | |
445 | default: | 302 | default: |
446 | panic("Impossible kernel unaligned trap."); | 303 | panic("Impossible kernel unaligned trap."); |
447 | /* Not reached... */ | 304 | /* Not reached... */ |
diff --git a/arch/sparc64/kernel/us2e_cpufreq.c b/arch/sparc64/kernel/us2e_cpufreq.c index 7aae0a18aabe..686e526bec04 100644 --- a/arch/sparc64/kernel/us2e_cpufreq.c +++ b/arch/sparc64/kernel/us2e_cpufreq.c | |||
@@ -88,7 +88,6 @@ static void frob_mem_refresh(int cpu_slowing_down, | |||
88 | { | 88 | { |
89 | unsigned long old_refr_count, refr_count, mctrl; | 89 | unsigned long old_refr_count, refr_count, mctrl; |
90 | 90 | ||
91 | |||
92 | refr_count = (clock_tick * MCTRL0_REFR_INTERVAL); | 91 | refr_count = (clock_tick * MCTRL0_REFR_INTERVAL); |
93 | refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); | 92 | refr_count /= (MCTRL0_REFR_CLKS_P_CNT * divisor * 1000000000UL); |
94 | 93 | ||
@@ -230,6 +229,25 @@ static unsigned long estar_to_divisor(unsigned long estar) | |||
230 | return ret; | 229 | return ret; |
231 | } | 230 | } |
232 | 231 | ||
232 | static unsigned int us2e_freq_get(unsigned int cpu) | ||
233 | { | ||
234 | cpumask_t cpus_allowed; | ||
235 | unsigned long clock_tick, estar; | ||
236 | |||
237 | if (!cpu_online(cpu)) | ||
238 | return 0; | ||
239 | |||
240 | cpus_allowed = current->cpus_allowed; | ||
241 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | ||
242 | |||
243 | clock_tick = sparc64_get_clock_tick(cpu) / 1000; | ||
244 | estar = read_hbreg(HBIRD_ESTAR_MODE_ADDR); | ||
245 | |||
246 | set_cpus_allowed(current, cpus_allowed); | ||
247 | |||
248 | return clock_tick / estar_to_divisor(estar); | ||
249 | } | ||
250 | |||
233 | static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 251 | static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) |
234 | { | 252 | { |
235 | unsigned long new_bits, new_freq; | 253 | unsigned long new_bits, new_freq; |
@@ -243,7 +261,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
243 | cpus_allowed = current->cpus_allowed; | 261 | cpus_allowed = current->cpus_allowed; |
244 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 262 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
245 | 263 | ||
246 | new_freq = clock_tick = sparc64_get_clock_tick(cpu); | 264 | new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
247 | new_bits = index_to_estar_mode(index); | 265 | new_bits = index_to_estar_mode(index); |
248 | divisor = index_to_divisor(index); | 266 | divisor = index_to_divisor(index); |
249 | new_freq /= divisor; | 267 | new_freq /= divisor; |
@@ -258,7 +276,8 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
258 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | 276 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); |
259 | 277 | ||
260 | if (old_divisor != divisor) | 278 | if (old_divisor != divisor) |
261 | us2e_transition(estar, new_bits, clock_tick, old_divisor, divisor); | 279 | us2e_transition(estar, new_bits, clock_tick * 1000, |
280 | old_divisor, divisor); | ||
262 | 281 | ||
263 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 282 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
264 | 283 | ||
@@ -272,10 +291,8 @@ static int us2e_freq_target(struct cpufreq_policy *policy, | |||
272 | unsigned int new_index = 0; | 291 | unsigned int new_index = 0; |
273 | 292 | ||
274 | if (cpufreq_frequency_table_target(policy, | 293 | if (cpufreq_frequency_table_target(policy, |
275 | &us2e_freq_table[policy->cpu].table[0], | 294 | &us2e_freq_table[policy->cpu].table[0], |
276 | target_freq, | 295 | target_freq, relation, &new_index)) |
277 | relation, | ||
278 | &new_index)) | ||
279 | return -EINVAL; | 296 | return -EINVAL; |
280 | 297 | ||
281 | us2e_set_cpu_divider_index(policy->cpu, new_index); | 298 | us2e_set_cpu_divider_index(policy->cpu, new_index); |
@@ -292,7 +309,7 @@ static int us2e_freq_verify(struct cpufreq_policy *policy) | |||
292 | static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) | 309 | static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) |
293 | { | 310 | { |
294 | unsigned int cpu = policy->cpu; | 311 | unsigned int cpu = policy->cpu; |
295 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 312 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
296 | struct cpufreq_frequency_table *table = | 313 | struct cpufreq_frequency_table *table = |
297 | &us2e_freq_table[cpu].table[0]; | 314 | &us2e_freq_table[cpu].table[0]; |
298 | 315 | ||
@@ -351,9 +368,10 @@ static int __init us2e_freq_init(void) | |||
351 | memset(us2e_freq_table, 0, | 368 | memset(us2e_freq_table, 0, |
352 | (NR_CPUS * sizeof(struct us2e_freq_percpu_info))); | 369 | (NR_CPUS * sizeof(struct us2e_freq_percpu_info))); |
353 | 370 | ||
371 | driver->init = us2e_freq_cpu_init; | ||
354 | driver->verify = us2e_freq_verify; | 372 | driver->verify = us2e_freq_verify; |
355 | driver->target = us2e_freq_target; | 373 | driver->target = us2e_freq_target; |
356 | driver->init = us2e_freq_cpu_init; | 374 | driver->get = us2e_freq_get; |
357 | driver->exit = us2e_freq_cpu_exit; | 375 | driver->exit = us2e_freq_cpu_exit; |
358 | driver->owner = THIS_MODULE, | 376 | driver->owner = THIS_MODULE, |
359 | strcpy(driver->name, "UltraSPARC-IIe"); | 377 | strcpy(driver->name, "UltraSPARC-IIe"); |
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c index 18fe54b8aa55..9080e7cd4bb0 100644 --- a/arch/sparc64/kernel/us3_cpufreq.c +++ b/arch/sparc64/kernel/us3_cpufreq.c | |||
@@ -56,7 +56,7 @@ static void write_safari_cfg(unsigned long val) | |||
56 | 56 | ||
57 | static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg) | 57 | static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg) |
58 | { | 58 | { |
59 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 59 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
60 | unsigned long ret; | 60 | unsigned long ret; |
61 | 61 | ||
62 | switch (safari_cfg & SAFARI_CFG_DIV_MASK) { | 62 | switch (safari_cfg & SAFARI_CFG_DIV_MASK) { |
@@ -76,6 +76,26 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg | |||
76 | return ret; | 76 | return ret; |
77 | } | 77 | } |
78 | 78 | ||
79 | static unsigned int us3_freq_get(unsigned int cpu) | ||
80 | { | ||
81 | cpumask_t cpus_allowed; | ||
82 | unsigned long reg; | ||
83 | unsigned int ret; | ||
84 | |||
85 | if (!cpu_online(cpu)) | ||
86 | return 0; | ||
87 | |||
88 | cpus_allowed = current->cpus_allowed; | ||
89 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | ||
90 | |||
91 | reg = read_safari_cfg(); | ||
92 | ret = get_current_freq(cpu, reg); | ||
93 | |||
94 | set_cpus_allowed(current, cpus_allowed); | ||
95 | |||
96 | return ret; | ||
97 | } | ||
98 | |||
79 | static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | 99 | static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) |
80 | { | 100 | { |
81 | unsigned long new_bits, new_freq, reg; | 101 | unsigned long new_bits, new_freq, reg; |
@@ -88,7 +108,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) | |||
88 | cpus_allowed = current->cpus_allowed; | 108 | cpus_allowed = current->cpus_allowed; |
89 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | 109 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); |
90 | 110 | ||
91 | new_freq = sparc64_get_clock_tick(cpu); | 111 | new_freq = sparc64_get_clock_tick(cpu) / 1000; |
92 | switch (index) { | 112 | switch (index) { |
93 | case 0: | 113 | case 0: |
94 | new_bits = SAFARI_CFG_DIV_1; | 114 | new_bits = SAFARI_CFG_DIV_1; |
@@ -150,7 +170,7 @@ static int us3_freq_verify(struct cpufreq_policy *policy) | |||
150 | static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) | 170 | static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) |
151 | { | 171 | { |
152 | unsigned int cpu = policy->cpu; | 172 | unsigned int cpu = policy->cpu; |
153 | unsigned long clock_tick = sparc64_get_clock_tick(cpu); | 173 | unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; |
154 | struct cpufreq_frequency_table *table = | 174 | struct cpufreq_frequency_table *table = |
155 | &us3_freq_table[cpu].table[0]; | 175 | &us3_freq_table[cpu].table[0]; |
156 | 176 | ||
@@ -206,9 +226,10 @@ static int __init us3_freq_init(void) | |||
206 | memset(us3_freq_table, 0, | 226 | memset(us3_freq_table, 0, |
207 | (NR_CPUS * sizeof(struct us3_freq_percpu_info))); | 227 | (NR_CPUS * sizeof(struct us3_freq_percpu_info))); |
208 | 228 | ||
229 | driver->init = us3_freq_cpu_init; | ||
209 | driver->verify = us3_freq_verify; | 230 | driver->verify = us3_freq_verify; |
210 | driver->target = us3_freq_target; | 231 | driver->target = us3_freq_target; |
211 | driver->init = us3_freq_cpu_init; | 232 | driver->get = us3_freq_get; |
212 | driver->exit = us3_freq_cpu_exit; | 233 | driver->exit = us3_freq_cpu_exit; |
213 | driver->owner = THIS_MODULE, | 234 | driver->owner = THIS_MODULE, |
214 | strcpy(driver->name, "UltraSPARC-III"); | 235 | strcpy(driver->name, "UltraSPARC-III"); |
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c index 06740582717e..d3a66ea74a7f 100644 --- a/arch/sparc64/solaris/socket.c +++ b/arch/sparc64/solaris/socket.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/net.h> | 16 | #include <linux/net.h> |
17 | #include <linux/compat.h> | 17 | #include <linux/compat.h> |
18 | #include <net/compat.h> | 18 | #include <net/compat.h> |
19 | #include <net/sock.h> | ||
19 | 20 | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/string.h> | 22 | #include <asm/string.h> |
@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi | |||
297 | { | 298 | { |
298 | struct socket *sock; | 299 | struct socket *sock; |
299 | char address[MAX_SOCK_ADDR]; | 300 | char address[MAX_SOCK_ADDR]; |
300 | struct iovec iov[UIO_FASTIOV]; | 301 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; |
301 | unsigned char ctl[sizeof(struct cmsghdr) + 20]; | 302 | unsigned char ctl[sizeof(struct cmsghdr) + 20]; |
302 | unsigned char *ctl_buf = ctl; | 303 | unsigned char *ctl_buf = ctl; |
303 | struct msghdr kern_msg; | 304 | struct msghdr msg_sys; |
304 | int err, total_len; | 305 | int err, ctl_len, iov_size, total_len; |
305 | 306 | ||
306 | if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) | 307 | err = -EFAULT; |
307 | return -EFAULT; | 308 | if (msghdr_from_user32_to_kern(&msg_sys, user_msg)) |
308 | if(kern_msg.msg_iovlen > UIO_MAXIOV) | 309 | goto out; |
309 | return -EINVAL; | 310 | |
310 | err = verify_compat_iovec(&kern_msg, iov, address, VERIFY_READ); | 311 | sock = sockfd_lookup(fd, &err); |
311 | if (err < 0) | 312 | if (!sock) |
312 | goto out; | 313 | goto out; |
314 | |||
315 | /* do not move before msg_sys is valid */ | ||
316 | err = -EMSGSIZE; | ||
317 | if (msg_sys.msg_iovlen > UIO_MAXIOV) | ||
318 | goto out_put; | ||
319 | |||
320 | /* Check whether to allocate the iovec area*/ | ||
321 | err = -ENOMEM; | ||
322 | iov_size = msg_sys.msg_iovlen * sizeof(struct iovec); | ||
323 | if (msg_sys.msg_iovlen > UIO_FASTIOV) { | ||
324 | iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL); | ||
325 | if (!iov) | ||
326 | goto out_put; | ||
327 | } | ||
328 | |||
329 | err = verify_compat_iovec(&msg_sys, iov, address, VERIFY_READ); | ||
330 | if (err < 0) | ||
331 | goto out_freeiov; | ||
313 | total_len = err; | 332 | total_len = err; |
314 | 333 | ||
315 | if(kern_msg.msg_controllen) { | 334 | err = -ENOBUFS; |
316 | struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control; | 335 | if (msg_sys.msg_controllen > INT_MAX) |
336 | goto out_freeiov; | ||
337 | |||
338 | ctl_len = msg_sys.msg_controllen; | ||
339 | if (ctl_len) { | ||
340 | struct sol_cmsghdr __user *ucmsg = msg_sys.msg_control; | ||
317 | unsigned long *kcmsg; | 341 | unsigned long *kcmsg; |
318 | compat_size_t cmlen; | 342 | compat_size_t cmlen; |
319 | 343 | ||
320 | if (kern_msg.msg_controllen <= sizeof(compat_size_t)) | 344 | err = -EINVAL; |
321 | return -EINVAL; | 345 | if (ctl_len <= sizeof(compat_size_t)) |
346 | goto out_freeiov; | ||
322 | 347 | ||
323 | if(kern_msg.msg_controllen > sizeof(ctl)) { | 348 | if (ctl_len > sizeof(ctl)) { |
324 | err = -ENOBUFS; | 349 | err = -ENOBUFS; |
325 | ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); | 350 | ctl_buf = kmalloc(ctl_len, GFP_KERNEL); |
326 | if(!ctl_buf) | 351 | if (!ctl_buf) |
327 | goto out_freeiov; | 352 | goto out_freeiov; |
328 | } | 353 | } |
329 | __get_user(cmlen, &ucmsg->cmsg_len); | 354 | __get_user(cmlen, &ucmsg->cmsg_len); |
330 | kcmsg = (unsigned long *) ctl_buf; | 355 | kcmsg = (unsigned long *) ctl_buf; |
331 | *kcmsg++ = (unsigned long)cmlen; | 356 | *kcmsg++ = (unsigned long)cmlen; |
332 | err = -EFAULT; | 357 | err = -EFAULT; |
333 | if(copy_from_user(kcmsg, &ucmsg->cmsg_level, | 358 | if (copy_from_user(kcmsg, &ucmsg->cmsg_level, |
334 | kern_msg.msg_controllen - sizeof(compat_size_t))) | 359 | ctl_len - sizeof(compat_size_t))) |
335 | goto out_freectl; | 360 | goto out_freectl; |
336 | kern_msg.msg_control = ctl_buf; | 361 | msg_sys.msg_control = ctl_buf; |
337 | } | 362 | } |
338 | kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags); | 363 | msg_sys.msg_flags = solaris_to_linux_msgflags(user_flags); |
339 | 364 | ||
340 | lock_kernel(); | 365 | if (sock->file->f_flags & O_NONBLOCK) |
341 | sock = sockfd_lookup(fd, &err); | 366 | msg_sys.msg_flags |= MSG_DONTWAIT; |
342 | if (sock != NULL) { | 367 | err = sock_sendmsg(sock, &msg_sys, total_len); |
343 | if (sock->file->f_flags & O_NONBLOCK) | ||
344 | kern_msg.msg_flags |= MSG_DONTWAIT; | ||
345 | err = sock_sendmsg(sock, &kern_msg, total_len); | ||
346 | sockfd_put(sock); | ||
347 | } | ||
348 | unlock_kernel(); | ||
349 | 368 | ||
350 | out_freectl: | 369 | out_freectl: |
351 | /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ | 370 | if (ctl_buf != ctl) |
352 | if(ctl_buf != ctl) | 371 | sock_kfree_s(sock->sk, ctl_buf, ctl_len); |
353 | kfree(ctl_buf); | ||
354 | out_freeiov: | 372 | out_freeiov: |
355 | if(kern_msg.msg_iov != iov) | 373 | if (iov != iovstack) |
356 | kfree(kern_msg.msg_iov); | 374 | sock_kfree_s(sock->sk, iov, iov_size); |
357 | out: | 375 | out_put: |
376 | sockfd_put(sock); | ||
377 | out: | ||
358 | return err; | 378 | return err; |
359 | } | 379 | } |
360 | 380 | ||
361 | asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) | 381 | asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) |
362 | { | 382 | { |
363 | struct iovec iovstack[UIO_FASTIOV]; | ||
364 | struct msghdr kern_msg; | ||
365 | char addr[MAX_SOCK_ADDR]; | ||
366 | struct socket *sock; | 383 | struct socket *sock; |
384 | struct iovec iovstack[UIO_FASTIOV]; | ||
367 | struct iovec *iov = iovstack; | 385 | struct iovec *iov = iovstack; |
386 | struct msghdr msg_sys; | ||
387 | unsigned long cmsg_ptr; | ||
388 | int err, iov_size, total_len, len; | ||
389 | |||
390 | /* kernel mode address */ | ||
391 | char addr[MAX_SOCK_ADDR]; | ||
392 | |||
393 | /* user mode address pointers */ | ||
368 | struct sockaddr __user *uaddr; | 394 | struct sockaddr __user *uaddr; |
369 | int __user *uaddr_len; | 395 | int __user *uaddr_len; |
370 | unsigned long cmsg_ptr; | ||
371 | int err, total_len, len = 0; | ||
372 | 396 | ||
373 | if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) | 397 | if (msghdr_from_user32_to_kern(&msg_sys, user_msg)) |
374 | return -EFAULT; | 398 | return -EFAULT; |
375 | if(kern_msg.msg_iovlen > UIO_MAXIOV) | ||
376 | return -EINVAL; | ||
377 | 399 | ||
378 | uaddr = kern_msg.msg_name; | 400 | sock = sockfd_lookup(fd, &err); |
401 | if (!sock) | ||
402 | goto out; | ||
403 | |||
404 | err = -EMSGSIZE; | ||
405 | if (msg_sys.msg_iovlen > UIO_MAXIOV) | ||
406 | goto out_put; | ||
407 | |||
408 | /* Check whether to allocate the iovec area*/ | ||
409 | err = -ENOMEM; | ||
410 | iov_size = msg_sys.msg_iovlen * sizeof(struct iovec); | ||
411 | if (msg_sys.msg_iovlen > UIO_FASTIOV) { | ||
412 | iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL); | ||
413 | if (!iov) | ||
414 | goto out_put; | ||
415 | } | ||
416 | |||
417 | /* | ||
418 | * Save the user-mode address (verify_iovec will change the | ||
419 | * kernel msghdr to use the kernel address space) | ||
420 | */ | ||
421 | |||
422 | uaddr = (void __user *) msg_sys.msg_name; | ||
379 | uaddr_len = &user_msg->msg_namelen; | 423 | uaddr_len = &user_msg->msg_namelen; |
380 | err = verify_compat_iovec(&kern_msg, iov, addr, VERIFY_WRITE); | 424 | err = verify_compat_iovec(&msg_sys, iov, addr, VERIFY_WRITE); |
381 | if (err < 0) | 425 | if (err < 0) |
382 | goto out; | 426 | goto out_freeiov; |
383 | total_len = err; | 427 | total_len = err; |
384 | 428 | ||
385 | cmsg_ptr = (unsigned long) kern_msg.msg_control; | 429 | cmsg_ptr = (unsigned long) msg_sys.msg_control; |
386 | kern_msg.msg_flags = 0; | 430 | msg_sys.msg_flags = MSG_CMSG_COMPAT; |
387 | 431 | ||
388 | lock_kernel(); | 432 | if (sock->file->f_flags & O_NONBLOCK) |
389 | sock = sockfd_lookup(fd, &err); | 433 | user_flags |= MSG_DONTWAIT; |
390 | if (sock != NULL) { | 434 | |
391 | if (sock->file->f_flags & O_NONBLOCK) | 435 | err = sock_recvmsg(sock, &msg_sys, total_len, user_flags); |
392 | user_flags |= MSG_DONTWAIT; | 436 | if(err < 0) |
393 | err = sock_recvmsg(sock, &kern_msg, total_len, user_flags); | 437 | goto out_freeiov; |
394 | if(err >= 0) | 438 | |
395 | len = err; | 439 | len = err; |
396 | sockfd_put(sock); | 440 | |
397 | } | 441 | if (uaddr != NULL) { |
398 | unlock_kernel(); | 442 | err = move_addr_to_user(addr, msg_sys.msg_namelen, uaddr, uaddr_len); |
399 | 443 | if (err < 0) | |
400 | if(uaddr != NULL && err >= 0) | 444 | goto out_freeiov; |
401 | err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len); | ||
402 | if(err >= 0) { | ||
403 | err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags); | ||
404 | if(!err) { | ||
405 | /* XXX Convert cmsg back into userspace 32-bit format... */ | ||
406 | err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr, | ||
407 | &user_msg->msg_controllen); | ||
408 | } | ||
409 | } | 445 | } |
446 | err = __put_user(linux_to_solaris_msgflags(msg_sys.msg_flags), &user_msg->msg_flags); | ||
447 | if (err) | ||
448 | goto out_freeiov; | ||
449 | err = __put_user((unsigned long)msg_sys.msg_control - cmsg_ptr, | ||
450 | &user_msg->msg_controllen); | ||
451 | if (err) | ||
452 | goto out_freeiov; | ||
453 | err = len; | ||
410 | 454 | ||
411 | if(kern_msg.msg_iov != iov) | 455 | out_freeiov: |
412 | kfree(kern_msg.msg_iov); | 456 | if (iov != iovstack) |
457 | sock_kfree_s(sock->sk, iov, iov_size); | ||
458 | out_put: | ||
459 | sockfd_put(sock); | ||
413 | out: | 460 | out: |
414 | if(err < 0) | 461 | return err; |
415 | return err; | ||
416 | return len; | ||
417 | } | 462 | } |
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index a37a5ac13c22..022f67bb6873 100644 --- a/arch/um/drivers/mmapper_kern.c +++ b/arch/um/drivers/mmapper_kern.c | |||
@@ -9,19 +9,11 @@ | |||
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kdev_t.h> | ||
14 | #include <linux/time.h> | ||
15 | #include <linux/devfs_fs_kernel.h> | ||
16 | #include <linux/module.h> | 13 | #include <linux/module.h> |
17 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
18 | #include <linux/slab.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/smp_lock.h> | ||
21 | #include <linux/miscdevice.h> | 15 | #include <linux/miscdevice.h> |
22 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
23 | #include <asm/irq.h> | ||
24 | #include <asm/pgtable.h> | ||
25 | #include "mem_user.h" | 17 | #include "mem_user.h" |
26 | #include "user_util.h" | 18 | #include "user_util.h" |
27 | 19 | ||
@@ -31,35 +23,22 @@ static unsigned long p_buf = 0; | |||
31 | static char *v_buf = NULL; | 23 | static char *v_buf = NULL; |
32 | 24 | ||
33 | static ssize_t | 25 | static ssize_t |
34 | mmapper_read(struct file *file, char *buf, size_t count, loff_t *ppos) | 26 | mmapper_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) |
35 | { | 27 | { |
36 | if(*ppos > mmapper_size) | 28 | return simple_read_from_buffer(buf, count, ppos, v_buf, mmapper_size); |
37 | return -EINVAL; | ||
38 | |||
39 | if(count + *ppos > mmapper_size) | ||
40 | count = count + *ppos - mmapper_size; | ||
41 | |||
42 | if(count < 0) | ||
43 | return -EINVAL; | ||
44 | |||
45 | copy_to_user(buf,&v_buf[*ppos],count); | ||
46 | |||
47 | return count; | ||
48 | } | 29 | } |
49 | 30 | ||
50 | static ssize_t | 31 | static ssize_t |
51 | mmapper_write(struct file *file, const char *buf, size_t count, loff_t *ppos) | 32 | mmapper_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) |
52 | { | 33 | { |
53 | if(*ppos > mmapper_size) | 34 | if (*ppos > mmapper_size) |
54 | return -EINVAL; | 35 | return -EINVAL; |
55 | 36 | ||
56 | if(count + *ppos > mmapper_size) | 37 | if (count > mmapper_size - *ppos) |
57 | count = count + *ppos - mmapper_size; | 38 | count = mmapper_size - *ppos; |
58 | |||
59 | if(count < 0) | ||
60 | return -EINVAL; | ||
61 | 39 | ||
62 | copy_from_user(&v_buf[*ppos],buf,count); | 40 | if (copy_from_user(&v_buf[*ppos], buf, count)) |
41 | return -EFAULT; | ||
63 | 42 | ||
64 | return count; | 43 | return count; |
65 | } | 44 | } |
@@ -77,7 +56,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma) | |||
77 | int ret = -EINVAL; | 56 | int ret = -EINVAL; |
78 | int size; | 57 | int size; |
79 | 58 | ||
80 | lock_kernel(); | ||
81 | if (vma->vm_pgoff != 0) | 59 | if (vma->vm_pgoff != 0) |
82 | goto out; | 60 | goto out; |
83 | 61 | ||
@@ -92,7 +70,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma) | |||
92 | goto out; | 70 | goto out; |
93 | ret = 0; | 71 | ret = 0; |
94 | out: | 72 | out: |
95 | unlock_kernel(); | ||
96 | return ret; | 73 | return ret; |
97 | } | 74 | } |
98 | 75 | ||
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 6dd9e5bf18ed..f228f8b54194 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -61,7 +61,11 @@ void wait_stub_done(int pid, int sig, char * fname) | |||
61 | 61 | ||
62 | CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); | 62 | CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); |
63 | } while((n >= 0) && WIFSTOPPED(status) && | 63 | } while((n >= 0) && WIFSTOPPED(status) && |
64 | (WSTOPSIG(status) == SIGVTALRM)); | 64 | ((WSTOPSIG(status) == SIGVTALRM) || |
65 | /* running UML inside a detached screen can cause | ||
66 | * SIGWINCHes | ||
67 | */ | ||
68 | (WSTOPSIG(status) == SIGWINCH))); | ||
65 | 69 | ||
66 | if((n < 0) || !WIFSTOPPED(status) || | 70 | if((n < 0) || !WIFSTOPPED(status) || |
67 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ | 71 | (WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){ |
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index 9416e1c29926..4cca3e9c23fe 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include <elf.h> | 10 | #include <elf.h> |
11 | #include <stddef.h> | 11 | #include <stddef.h> |
12 | #include <asm/elf.h> | ||
13 | #include "init.h" | 12 | #include "init.h" |
14 | #include "elf_user.h" | 13 | #include "elf_user.h" |
15 | #include "mem_user.h" | 14 | #include "mem_user.h" |
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c index 2b5c4010ce38..acfdaa28791e 100644 --- a/arch/x86_64/crypto/aes.c +++ b/arch/x86_64/crypto/aes.c | |||
@@ -322,3 +322,4 @@ module_exit(aes_fini); | |||
322 | 322 | ||
323 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 323 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
324 | MODULE_LICENSE("GPL"); | 324 | MODULE_LICENSE("GPL"); |
325 | MODULE_ALIAS("aes"); | ||
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index 776f3c866b70..b97a61e1c71c 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6-git3 |
4 | # Fri Jul 22 16:47:31 2005 | 4 | # Fri Aug 12 16:40:34 2005 |
5 | # | 5 | # |
6 | CONFIG_X86_64=y | 6 | CONFIG_X86_64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
@@ -284,10 +284,6 @@ CONFIG_IPV6=y | |||
284 | # Network testing | 284 | # Network testing |
285 | # | 285 | # |
286 | # CONFIG_NET_PKTGEN is not set | 286 | # CONFIG_NET_PKTGEN is not set |
287 | CONFIG_NETPOLL=y | ||
288 | # CONFIG_NETPOLL_RX is not set | ||
289 | # CONFIG_NETPOLL_TRAP is not set | ||
290 | CONFIG_NET_POLL_CONTROLLER=y | ||
291 | # CONFIG_HAMRADIO is not set | 287 | # CONFIG_HAMRADIO is not set |
292 | # CONFIG_IRDA is not set | 288 | # CONFIG_IRDA is not set |
293 | # CONFIG_BT is not set | 289 | # CONFIG_BT is not set |
@@ -463,6 +459,7 @@ CONFIG_AIC79XX_DEBUG_MASK=0 | |||
463 | # CONFIG_MEGARAID_NEWGEN is not set | 459 | # CONFIG_MEGARAID_NEWGEN is not set |
464 | # CONFIG_MEGARAID_LEGACY is not set | 460 | # CONFIG_MEGARAID_LEGACY is not set |
465 | CONFIG_SCSI_SATA=y | 461 | CONFIG_SCSI_SATA=y |
462 | # CONFIG_SCSI_SATA_AHCI is not set | ||
466 | # CONFIG_SCSI_SATA_SVW is not set | 463 | # CONFIG_SCSI_SATA_SVW is not set |
467 | CONFIG_SCSI_ATA_PIIX=y | 464 | CONFIG_SCSI_ATA_PIIX=y |
468 | # CONFIG_SCSI_SATA_NV is not set | 465 | # CONFIG_SCSI_SATA_NV is not set |
@@ -492,6 +489,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
492 | # CONFIG_SCSI_QLA2300 is not set | 489 | # CONFIG_SCSI_QLA2300 is not set |
493 | # CONFIG_SCSI_QLA2322 is not set | 490 | # CONFIG_SCSI_QLA2322 is not set |
494 | # CONFIG_SCSI_QLA6312 is not set | 491 | # CONFIG_SCSI_QLA6312 is not set |
492 | # CONFIG_SCSI_QLA24XX is not set | ||
495 | # CONFIG_SCSI_LPFC is not set | 493 | # CONFIG_SCSI_LPFC is not set |
496 | # CONFIG_SCSI_DC395x is not set | 494 | # CONFIG_SCSI_DC395x is not set |
497 | # CONFIG_SCSI_DC390T is not set | 495 | # CONFIG_SCSI_DC390T is not set |
@@ -512,9 +510,11 @@ CONFIG_BLK_DEV_DM=y | |||
512 | # | 510 | # |
513 | # Fusion MPT device support | 511 | # Fusion MPT device support |
514 | # | 512 | # |
515 | # CONFIG_FUSION is not set | 513 | CONFIG_FUSION=y |
516 | # CONFIG_FUSION_SPI is not set | 514 | CONFIG_FUSION_SPI=y |
517 | # CONFIG_FUSION_FC is not set | 515 | # CONFIG_FUSION_FC is not set |
516 | CONFIG_FUSION_MAX_SGE=128 | ||
517 | # CONFIG_FUSION_CTL is not set | ||
518 | 518 | ||
519 | # | 519 | # |
520 | # IEEE 1394 (FireWire) support | 520 | # IEEE 1394 (FireWire) support |
@@ -585,6 +585,7 @@ CONFIG_8139TOO=y | |||
585 | # CONFIG_ACENIC is not set | 585 | # CONFIG_ACENIC is not set |
586 | # CONFIG_DL2K is not set | 586 | # CONFIG_DL2K is not set |
587 | CONFIG_E1000=y | 587 | CONFIG_E1000=y |
588 | # CONFIG_E1000_NAPI is not set | ||
588 | # CONFIG_NS83820 is not set | 589 | # CONFIG_NS83820 is not set |
589 | # CONFIG_HAMACHI is not set | 590 | # CONFIG_HAMACHI is not set |
590 | # CONFIG_YELLOWFIN is not set | 591 | # CONFIG_YELLOWFIN is not set |
@@ -624,6 +625,10 @@ CONFIG_S2IO=m | |||
624 | # CONFIG_NET_FC is not set | 625 | # CONFIG_NET_FC is not set |
625 | # CONFIG_SHAPER is not set | 626 | # CONFIG_SHAPER is not set |
626 | CONFIG_NETCONSOLE=y | 627 | CONFIG_NETCONSOLE=y |
628 | CONFIG_NETPOLL=y | ||
629 | # CONFIG_NETPOLL_RX is not set | ||
630 | # CONFIG_NETPOLL_TRAP is not set | ||
631 | CONFIG_NET_POLL_CONTROLLER=y | ||
627 | 632 | ||
628 | # | 633 | # |
629 | # ISDN subsystem | 634 | # ISDN subsystem |
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index b98b6d2462f6..2a925e2af390 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c | |||
@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) | |||
43 | switch (regno) { | 43 | switch (regno) { |
44 | case offsetof(struct user32, regs.fs): | 44 | case offsetof(struct user32, regs.fs): |
45 | if (val && (val & 3) != 3) return -EIO; | 45 | if (val && (val & 3) != 3) return -EIO; |
46 | child->thread.fs = val & 0xffff; | 46 | child->thread.fsindex = val & 0xffff; |
47 | break; | 47 | break; |
48 | case offsetof(struct user32, regs.gs): | 48 | case offsetof(struct user32, regs.gs): |
49 | if (val && (val & 3) != 3) return -EIO; | 49 | if (val && (val & 3) != 3) return -EIO; |
50 | child->thread.gs = val & 0xffff; | 50 | child->thread.gsindex = val & 0xffff; |
51 | break; | 51 | break; |
52 | case offsetof(struct user32, regs.ds): | 52 | case offsetof(struct user32, regs.ds): |
53 | if (val && (val & 3) != 3) return -EIO; | 53 | if (val && (val & 3) != 3) return -EIO; |
@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) | |||
138 | 138 | ||
139 | switch (regno) { | 139 | switch (regno) { |
140 | case offsetof(struct user32, regs.fs): | 140 | case offsetof(struct user32, regs.fs): |
141 | *val = child->thread.fs; | 141 | *val = child->thread.fsindex; |
142 | break; | 142 | break; |
143 | case offsetof(struct user32, regs.gs): | 143 | case offsetof(struct user32, regs.gs): |
144 | *val = child->thread.gs; | 144 | *val = child->thread.gsindex; |
145 | break; | 145 | break; |
146 | case offsetof(struct user32, regs.ds): | 146 | case offsetof(struct user32, regs.ds): |
147 | *val = child->thread.ds; | 147 | *val = child->thread.ds; |
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 6ded3a50dfe6..b548dea4e5b9 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -185,6 +185,40 @@ unsigned long __init e820_end_of_ram(void) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /* | 187 | /* |
188 | * Compute how much memory is missing in a range. | ||
189 | * Unlike the other functions in this file the arguments are in page numbers. | ||
190 | */ | ||
191 | unsigned long __init | ||
192 | e820_hole_size(unsigned long start_pfn, unsigned long end_pfn) | ||
193 | { | ||
194 | unsigned long ram = 0; | ||
195 | unsigned long start = start_pfn << PAGE_SHIFT; | ||
196 | unsigned long end = end_pfn << PAGE_SHIFT; | ||
197 | int i; | ||
198 | for (i = 0; i < e820.nr_map; i++) { | ||
199 | struct e820entry *ei = &e820.map[i]; | ||
200 | unsigned long last, addr; | ||
201 | |||
202 | if (ei->type != E820_RAM || | ||
203 | ei->addr+ei->size <= start || | ||
204 | ei->addr >= end) | ||
205 | continue; | ||
206 | |||
207 | addr = round_up(ei->addr, PAGE_SIZE); | ||
208 | if (addr < start) | ||
209 | addr = start; | ||
210 | |||
211 | last = round_down(ei->addr + ei->size, PAGE_SIZE); | ||
212 | if (last >= end) | ||
213 | last = end; | ||
214 | |||
215 | if (last > addr) | ||
216 | ram += last - addr; | ||
217 | } | ||
218 | return ((end - start) - ram) >> PAGE_SHIFT; | ||
219 | } | ||
220 | |||
221 | /* | ||
188 | * Mark e820 reserved areas as busy for the resource manager. | 222 | * Mark e820 reserved areas as busy for the resource manager. |
189 | */ | 223 | */ |
190 | void __init e820_reserve_resources(void) | 224 | void __init e820_reserve_resources(void) |
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index 3b267c91bb0c..8aa56736cde3 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -36,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL }; | |||
36 | static unsigned long console_logged; | 36 | static unsigned long console_logged; |
37 | static int notify_user; | 37 | static int notify_user; |
38 | static int rip_msr; | 38 | static int rip_msr; |
39 | static int mce_bootlog; | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * Lockless MCE logging infrastructure. | 42 | * Lockless MCE logging infrastructure. |
@@ -197,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code) | |||
197 | rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); | 198 | rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); |
198 | 199 | ||
199 | mce_get_rip(&m, regs); | 200 | mce_get_rip(&m, regs); |
200 | if (error_code != -1) | 201 | if (error_code >= 0) |
201 | rdtscll(m.tsc); | 202 | rdtscll(m.tsc); |
202 | wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); | 203 | wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); |
203 | mce_log(&m); | 204 | if (error_code != -2) |
205 | mce_log(&m); | ||
204 | 206 | ||
205 | /* Did this bank cause the exception? */ | 207 | /* Did this bank cause the exception? */ |
206 | /* Assume that the bank with uncorrectable errors did it, | 208 | /* Assume that the bank with uncorrectable errors did it, |
@@ -315,7 +317,7 @@ static void mce_init(void *dummy) | |||
315 | 317 | ||
316 | /* Log the machine checks left over from the previous reset. | 318 | /* Log the machine checks left over from the previous reset. |
317 | This also clears all registers */ | 319 | This also clears all registers */ |
318 | do_machine_check(NULL, -1); | 320 | do_machine_check(NULL, mce_bootlog ? -1 : -2); |
319 | 321 | ||
320 | set_in_cr4(X86_CR4_MCE); | 322 | set_in_cr4(X86_CR4_MCE); |
321 | 323 | ||
@@ -476,11 +478,17 @@ static int __init mcheck_disable(char *str) | |||
476 | } | 478 | } |
477 | 479 | ||
478 | /* mce=off disables machine check. Note you can reenable it later | 480 | /* mce=off disables machine check. Note you can reenable it later |
479 | using sysfs */ | 481 | using sysfs. |
482 | mce=bootlog Log MCEs from before booting. Disabled by default to work | ||
483 | around buggy BIOS that leave bogus MCEs. */ | ||
480 | static int __init mcheck_enable(char *str) | 484 | static int __init mcheck_enable(char *str) |
481 | { | 485 | { |
486 | if (*str == '=') | ||
487 | str++; | ||
482 | if (!strcmp(str, "off")) | 488 | if (!strcmp(str, "off")) |
483 | mce_dont_init = 1; | 489 | mce_dont_init = 1; |
490 | else if (!strcmp(str, "bootlog")) | ||
491 | mce_bootlog = 1; | ||
484 | else | 492 | else |
485 | printk("mce= argument %s ignored. Please use /sys", str); | 493 | printk("mce= argument %s ignored. Please use /sys", str); |
486 | return 0; | 494 | return 0; |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 08abf9f5b159..79c362d03e2e 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -970,8 +970,21 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low) | |||
970 | * due to unused I/O APIC pins. | 970 | * due to unused I/O APIC pins. |
971 | */ | 971 | */ |
972 | int irq = gsi; | 972 | int irq = gsi; |
973 | gsi = pci_irq++; | 973 | if (gsi < MAX_GSI_NUM) { |
974 | gsi_to_irq[irq] = gsi; | 974 | if (gsi > 15) |
975 | gsi = pci_irq++; | ||
976 | #ifdef CONFIG_ACPI_BUS | ||
977 | /* | ||
978 | * Don't assign IRQ used by ACPI SCI | ||
979 | */ | ||
980 | if (gsi == acpi_fadt.sci_int) | ||
981 | gsi = pci_irq++; | ||
982 | #endif | ||
983 | gsi_to_irq[irq] = gsi; | ||
984 | } else { | ||
985 | printk(KERN_ERR "GSI %u is too high\n", gsi); | ||
986 | return gsi; | ||
987 | } | ||
975 | } | 988 | } |
976 | 989 | ||
977 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, | 990 | io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 0aa526298e92..116a491e2961 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p) | |||
645 | } | 645 | } |
646 | } | 646 | } |
647 | #endif | 647 | #endif |
648 | |||
649 | sparse_init(); | ||
650 | |||
651 | #ifdef CONFIG_KEXEC | 648 | #ifdef CONFIG_KEXEC |
652 | if (crashk_res.start != crashk_res.end) { | 649 | if (crashk_res.start != crashk_res.end) { |
653 | reserve_bootmem(crashk_res.start, | 650 | reserve_bootmem(crashk_res.start, |
654 | crashk_res.end - crashk_res.start + 1); | 651 | crashk_res.end - crashk_res.start + 1); |
655 | } | 652 | } |
656 | #endif | 653 | #endif |
654 | |||
655 | sparse_init(); | ||
656 | |||
657 | paging_init(); | 657 | paging_init(); |
658 | 658 | ||
659 | check_ioapic(); | 659 | check_ioapic(); |
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 6e4807d64d46..fa25e39fe54d 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -334,7 +334,7 @@ static void __cpuinit tsc_sync_wait(void) | |||
334 | { | 334 | { |
335 | if (notscsync || !cpu_has_tsc) | 335 | if (notscsync || !cpu_has_tsc) |
336 | return; | 336 | return; |
337 | sync_tsc(boot_cpu_id); | 337 | sync_tsc(0); |
338 | } | 338 | } |
339 | 339 | ||
340 | static __init int notscsync_setup(char *s) | 340 | static __init int notscsync_setup(char *s) |
@@ -492,6 +492,14 @@ void __cpuinit start_secondary(void) | |||
492 | */ | 492 | */ |
493 | set_cpu_sibling_map(smp_processor_id()); | 493 | set_cpu_sibling_map(smp_processor_id()); |
494 | 494 | ||
495 | /* | ||
496 | * Wait for TSC sync to not schedule things before. | ||
497 | * We still process interrupts, which could see an inconsistent | ||
498 | * time in that window unfortunately. | ||
499 | * Do this here because TSC sync has global unprotected state. | ||
500 | */ | ||
501 | tsc_sync_wait(); | ||
502 | |||
495 | /* | 503 | /* |
496 | * We need to hold call_lock, so there is no inconsistency | 504 | * We need to hold call_lock, so there is no inconsistency |
497 | * between the time smp_call_function() determines number of | 505 | * between the time smp_call_function() determines number of |
@@ -509,13 +517,6 @@ void __cpuinit start_secondary(void) | |||
509 | per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; | 517 | per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; |
510 | unlock_ipi_call_lock(); | 518 | unlock_ipi_call_lock(); |
511 | 519 | ||
512 | mb(); | ||
513 | |||
514 | /* Wait for TSC sync to not schedule things before. | ||
515 | We still process interrupts, which could see an inconsistent | ||
516 | time in that window unfortunately. */ | ||
517 | tsc_sync_wait(); | ||
518 | |||
519 | cpu_idle(); | 520 | cpu_idle(); |
520 | } | 521 | } |
521 | 522 | ||
diff --git a/arch/x86_64/lib/csum-copy.S b/arch/x86_64/lib/csum-copy.S index 01808ec37836..72fd55ee896e 100644 --- a/arch/x86_64/lib/csum-copy.S +++ b/arch/x86_64/lib/csum-copy.S | |||
@@ -188,8 +188,8 @@ csum_partial_copy_generic: | |||
188 | source | 188 | source |
189 | movw (%rdi),%bx | 189 | movw (%rdi),%bx |
190 | adcl %ebx,%eax | 190 | adcl %ebx,%eax |
191 | dest | ||
192 | decl %ecx | 191 | decl %ecx |
192 | dest | ||
193 | movw %bx,(%rsi) | 193 | movw %bx,(%rsi) |
194 | leaq 2(%rdi),%rdi | 194 | leaq 2(%rdi),%rdi |
195 | leaq 2(%rsi),%rsi | 195 | leaq 2(%rsi),%rsi |
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index 13792721037e..ca914c3bd49c 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c | |||
@@ -211,9 +211,7 @@ int unhandled_signal(struct task_struct *tsk, int sig) | |||
211 | { | 211 | { |
212 | if (tsk->pid == 1) | 212 | if (tsk->pid == 1) |
213 | return 1; | 213 | return 1; |
214 | /* Warn for strace, but not for gdb */ | 214 | if (tsk->ptrace & PT_PTRACED) |
215 | if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) && | ||
216 | (tsk->ptrace & PT_PTRACED)) | ||
217 | return 0; | 215 | return 0; |
218 | return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || | 216 | return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || |
219 | (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); | 217 | (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); |
@@ -439,13 +437,13 @@ good_area: | |||
439 | * the fault. | 437 | * the fault. |
440 | */ | 438 | */ |
441 | switch (handle_mm_fault(mm, vma, address, write)) { | 439 | switch (handle_mm_fault(mm, vma, address, write)) { |
442 | case 1: | 440 | case VM_FAULT_MINOR: |
443 | tsk->min_flt++; | 441 | tsk->min_flt++; |
444 | break; | 442 | break; |
445 | case 2: | 443 | case VM_FAULT_MAJOR: |
446 | tsk->maj_flt++; | 444 | tsk->maj_flt++; |
447 | break; | 445 | break; |
448 | case 0: | 446 | case VM_FAULT_SIGBUS: |
449 | goto do_sigbus; | 447 | goto do_sigbus; |
450 | default: | 448 | default: |
451 | goto out_of_memory; | 449 | goto out_of_memory; |
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 72e4b364ed73..aa4a5189ecee 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -322,18 +322,26 @@ void zap_low_mappings(void) | |||
322 | void __init paging_init(void) | 322 | void __init paging_init(void) |
323 | { | 323 | { |
324 | { | 324 | { |
325 | unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; | 325 | unsigned long zones_size[MAX_NR_ZONES]; |
326 | unsigned long holes[MAX_NR_ZONES]; | ||
326 | unsigned int max_dma; | 327 | unsigned int max_dma; |
327 | 328 | ||
329 | memset(zones_size, 0, sizeof(zones_size)); | ||
330 | memset(holes, 0, sizeof(holes)); | ||
331 | |||
328 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 332 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
329 | 333 | ||
330 | if (end_pfn < max_dma) | 334 | if (end_pfn < max_dma) { |
331 | zones_size[ZONE_DMA] = end_pfn; | 335 | zones_size[ZONE_DMA] = end_pfn; |
332 | else { | 336 | holes[ZONE_DMA] = e820_hole_size(0, end_pfn); |
337 | } else { | ||
333 | zones_size[ZONE_DMA] = max_dma; | 338 | zones_size[ZONE_DMA] = max_dma; |
339 | holes[ZONE_DMA] = e820_hole_size(0, max_dma); | ||
334 | zones_size[ZONE_NORMAL] = end_pfn - max_dma; | 340 | zones_size[ZONE_NORMAL] = end_pfn - max_dma; |
341 | holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn); | ||
335 | } | 342 | } |
336 | free_area_init(zones_size); | 343 | free_area_init_node(0, NODE_DATA(0), zones_size, |
344 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, holes); | ||
337 | } | 345 | } |
338 | return; | 346 | return; |
339 | } | 347 | } |
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c index 70cb2904a90f..6a156f5692ae 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c | |||
@@ -126,9 +126,11 @@ void __init setup_node_zones(int nodeid) | |||
126 | { | 126 | { |
127 | unsigned long start_pfn, end_pfn; | 127 | unsigned long start_pfn, end_pfn; |
128 | unsigned long zones[MAX_NR_ZONES]; | 128 | unsigned long zones[MAX_NR_ZONES]; |
129 | unsigned long holes[MAX_NR_ZONES]; | ||
129 | unsigned long dma_end_pfn; | 130 | unsigned long dma_end_pfn; |
130 | 131 | ||
131 | memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); | 132 | memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); |
133 | memset(holes, 0, sizeof(unsigned long) * MAX_NR_ZONES); | ||
132 | 134 | ||
133 | start_pfn = node_start_pfn(nodeid); | 135 | start_pfn = node_start_pfn(nodeid); |
134 | end_pfn = node_end_pfn(nodeid); | 136 | end_pfn = node_end_pfn(nodeid); |
@@ -139,13 +141,17 @@ void __init setup_node_zones(int nodeid) | |||
139 | dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 141 | dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
140 | if (start_pfn < dma_end_pfn) { | 142 | if (start_pfn < dma_end_pfn) { |
141 | zones[ZONE_DMA] = dma_end_pfn - start_pfn; | 143 | zones[ZONE_DMA] = dma_end_pfn - start_pfn; |
144 | holes[ZONE_DMA] = e820_hole_size(start_pfn, dma_end_pfn); | ||
142 | zones[ZONE_NORMAL] = end_pfn - dma_end_pfn; | 145 | zones[ZONE_NORMAL] = end_pfn - dma_end_pfn; |
146 | holes[ZONE_NORMAL] = e820_hole_size(dma_end_pfn, end_pfn); | ||
147 | |||
143 | } else { | 148 | } else { |
144 | zones[ZONE_NORMAL] = end_pfn - start_pfn; | 149 | zones[ZONE_NORMAL] = end_pfn - start_pfn; |
150 | holes[ZONE_NORMAL] = e820_hole_size(start_pfn, end_pfn); | ||
145 | } | 151 | } |
146 | 152 | ||
147 | free_area_init_node(nodeid, NODE_DATA(nodeid), zones, | 153 | free_area_init_node(nodeid, NODE_DATA(nodeid), zones, |
148 | start_pfn, NULL); | 154 | start_pfn, holes); |
149 | } | 155 | } |
150 | 156 | ||
151 | void __init numa_init_array(void) | 157 | void __init numa_init_array(void) |
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c index c2c38b579939..d80c323669e0 100644 --- a/arch/x86_64/pci/k8-bus.c +++ b/arch/x86_64/pci/k8-bus.c | |||
@@ -47,13 +47,22 @@ fill_mp_bus_to_cpumask(void) | |||
47 | * if there are no busses hanging off of the current | 47 | * if there are no busses hanging off of the current |
48 | * ldt link then both the secondary and subordinate | 48 | * ldt link then both the secondary and subordinate |
49 | * bus number fields are set to 0. | 49 | * bus number fields are set to 0. |
50 | * | ||
51 | * RED-PEN | ||
52 | * This is slightly broken because it assumes | ||
53 | * HT node IDs == Linux node ids, which is not always | ||
54 | * true. However it is probably mostly true. | ||
50 | */ | 55 | */ |
51 | if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 | 56 | if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 |
52 | && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { | 57 | && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { |
53 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); | 58 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); |
54 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); | 59 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); |
55 | j++) | 60 | j++) { |
56 | pci_bus_to_node[j] = NODE_ID(nid); | 61 | int node = NODE_ID(nid); |
62 | if (!node_online(node)) | ||
63 | node = 0; | ||
64 | pci_bus_to_node[j] = node; | ||
65 | } | ||
57 | } | 66 | } |
58 | } | 67 | } |
59 | } | 68 | } |
diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index 3cd2e968e96c..c0a37d98b4f3 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c | |||
@@ -1283,8 +1283,7 @@ static void do_fd_request(request_queue_t* q) | |||
1283 | if (fdc_busy) return; | 1283 | if (fdc_busy) return; |
1284 | save_flags(flags); | 1284 | save_flags(flags); |
1285 | cli(); | 1285 | cli(); |
1286 | while (fdc_busy) | 1286 | wait_event(fdc_wait, !fdc_busy); |
1287 | sleep_on(&fdc_wait); | ||
1288 | fdc_busy = 1; | 1287 | fdc_busy = 1; |
1289 | ENABLE_IRQ(); | 1288 | ENABLE_IRQ(); |
1290 | restore_flags(flags); | 1289 | restore_flags(flags); |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 986410e7b483..ba13896cae40 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -133,9 +133,10 @@ config ACPI_HOTKEY | |||
133 | depends on ACPI_INTERPRETER | 133 | depends on ACPI_INTERPRETER |
134 | depends on EXPERIMENTAL | 134 | depends on EXPERIMENTAL |
135 | depends on !IA64_SGI_SN | 135 | depends on !IA64_SGI_SN |
136 | default m | 136 | default n |
137 | help | 137 | help |
138 | ACPI generic hotkey | 138 | Experimental consolidated hotkey driver. |
139 | If you are unsure, say N. | ||
139 | 140 | ||
140 | config ACPI_FAN | 141 | config ACPI_FAN |
141 | tristate "Fan" | 142 | tristate "Fan" |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 0f45d45f05a0..8162fd0c21a7 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/types.h> | ||
30 | #include <linux/proc_fs.h> | ||
31 | #include <linux/seq_file.h> | ||
29 | #include <acpi/acpi_bus.h> | 32 | #include <acpi/acpi_bus.h> |
30 | #include <acpi/acpi_drivers.h> | 33 | #include <acpi/acpi_drivers.h> |
31 | 34 | ||
@@ -33,6 +36,9 @@ | |||
33 | #define ACPI_BUTTON_COMPONENT 0x00080000 | 36 | #define ACPI_BUTTON_COMPONENT 0x00080000 |
34 | #define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver" | 37 | #define ACPI_BUTTON_DRIVER_NAME "ACPI Button Driver" |
35 | #define ACPI_BUTTON_CLASS "button" | 38 | #define ACPI_BUTTON_CLASS "button" |
39 | #define ACPI_BUTTON_FILE_INFO "info" | ||
40 | #define ACPI_BUTTON_FILE_STATE "state" | ||
41 | #define ACPI_BUTTON_TYPE_UNKNOWN 0x00 | ||
36 | #define ACPI_BUTTON_NOTIFY_STATUS 0x80 | 42 | #define ACPI_BUTTON_NOTIFY_STATUS 0x80 |
37 | 43 | ||
38 | #define ACPI_BUTTON_SUBCLASS_POWER "power" | 44 | #define ACPI_BUTTON_SUBCLASS_POWER "power" |
@@ -64,6 +70,8 @@ MODULE_LICENSE("GPL"); | |||
64 | 70 | ||
65 | static int acpi_button_add (struct acpi_device *device); | 71 | static int acpi_button_add (struct acpi_device *device); |
66 | static int acpi_button_remove (struct acpi_device *device, int type); | 72 | static int acpi_button_remove (struct acpi_device *device, int type); |
73 | static int acpi_button_info_open_fs(struct inode *inode, struct file *file); | ||
74 | static int acpi_button_state_open_fs(struct inode *inode, struct file *file); | ||
67 | 75 | ||
68 | static struct acpi_driver acpi_button_driver = { | 76 | static struct acpi_driver acpi_button_driver = { |
69 | .name = ACPI_BUTTON_DRIVER_NAME, | 77 | .name = ACPI_BUTTON_DRIVER_NAME, |
@@ -82,6 +90,179 @@ struct acpi_button { | |||
82 | unsigned long pushed; | 90 | unsigned long pushed; |
83 | }; | 91 | }; |
84 | 92 | ||
93 | static struct file_operations acpi_button_info_fops = { | ||
94 | .open = acpi_button_info_open_fs, | ||
95 | .read = seq_read, | ||
96 | .llseek = seq_lseek, | ||
97 | .release = single_release, | ||
98 | }; | ||
99 | |||
100 | static struct file_operations acpi_button_state_fops = { | ||
101 | .open = acpi_button_state_open_fs, | ||
102 | .read = seq_read, | ||
103 | .llseek = seq_lseek, | ||
104 | .release = single_release, | ||
105 | }; | ||
106 | /* -------------------------------------------------------------------------- | ||
107 | FS Interface (/proc) | ||
108 | -------------------------------------------------------------------------- */ | ||
109 | |||
110 | static struct proc_dir_entry *acpi_button_dir; | ||
111 | |||
112 | static int acpi_button_info_seq_show(struct seq_file *seq, void *offset) | ||
113 | { | ||
114 | struct acpi_button *button = (struct acpi_button *) seq->private; | ||
115 | |||
116 | ACPI_FUNCTION_TRACE("acpi_button_info_seq_show"); | ||
117 | |||
118 | if (!button || !button->device) | ||
119 | return_VALUE(0); | ||
120 | |||
121 | seq_printf(seq, "type: %s\n", | ||
122 | acpi_device_name(button->device)); | ||
123 | |||
124 | return_VALUE(0); | ||
125 | } | ||
126 | |||
127 | static int acpi_button_info_open_fs(struct inode *inode, struct file *file) | ||
128 | { | ||
129 | return single_open(file, acpi_button_info_seq_show, PDE(inode)->data); | ||
130 | } | ||
131 | |||
132 | static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) | ||
133 | { | ||
134 | struct acpi_button *button = (struct acpi_button *) seq->private; | ||
135 | acpi_status status; | ||
136 | unsigned long state; | ||
137 | |||
138 | ACPI_FUNCTION_TRACE("acpi_button_state_seq_show"); | ||
139 | |||
140 | if (!button || !button->device) | ||
141 | return_VALUE(0); | ||
142 | |||
143 | status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state); | ||
144 | if (ACPI_FAILURE(status)) { | ||
145 | seq_printf(seq, "state: unsupported\n"); | ||
146 | } | ||
147 | else{ | ||
148 | seq_printf(seq, "state: %s\n", (state ? "open" : "closed")); | ||
149 | } | ||
150 | |||
151 | return_VALUE(0); | ||
152 | } | ||
153 | |||
154 | static int acpi_button_state_open_fs(struct inode *inode, struct file *file) | ||
155 | { | ||
156 | return single_open(file, acpi_button_state_seq_show, PDE(inode)->data); | ||
157 | } | ||
158 | |||
159 | static struct proc_dir_entry *acpi_power_dir; | ||
160 | static struct proc_dir_entry *acpi_sleep_dir; | ||
161 | static struct proc_dir_entry *acpi_lid_dir; | ||
162 | |||
163 | static int | ||
164 | acpi_button_add_fs ( | ||
165 | struct acpi_device *device) | ||
166 | { | ||
167 | struct proc_dir_entry *entry = NULL; | ||
168 | struct acpi_button *button = NULL; | ||
169 | |||
170 | ACPI_FUNCTION_TRACE("acpi_button_add_fs"); | ||
171 | |||
172 | if (!device || !acpi_driver_data(device)) | ||
173 | return_VALUE(-EINVAL); | ||
174 | |||
175 | button = acpi_driver_data(device); | ||
176 | |||
177 | switch (button->type) { | ||
178 | case ACPI_BUTTON_TYPE_POWER: | ||
179 | case ACPI_BUTTON_TYPE_POWERF: | ||
180 | if (!acpi_power_dir) | ||
181 | acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, | ||
182 | acpi_button_dir); | ||
183 | entry = acpi_power_dir; | ||
184 | break; | ||
185 | case ACPI_BUTTON_TYPE_SLEEP: | ||
186 | case ACPI_BUTTON_TYPE_SLEEPF: | ||
187 | if (!acpi_sleep_dir) | ||
188 | acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, | ||
189 | acpi_button_dir); | ||
190 | entry = acpi_sleep_dir; | ||
191 | break; | ||
192 | case ACPI_BUTTON_TYPE_LID: | ||
193 | if (!acpi_lid_dir) | ||
194 | acpi_lid_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID, | ||
195 | acpi_button_dir); | ||
196 | entry = acpi_lid_dir; | ||
197 | break; | ||
198 | } | ||
199 | |||
200 | if (!entry) | ||
201 | return_VALUE(-ENODEV); | ||
202 | entry->owner = THIS_MODULE; | ||
203 | |||
204 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), entry); | ||
205 | if (!acpi_device_dir(device)) | ||
206 | return_VALUE(-ENODEV); | ||
207 | acpi_device_dir(device)->owner = THIS_MODULE; | ||
208 | |||
209 | /* 'info' [R] */ | ||
210 | entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, | ||
211 | S_IRUGO, acpi_device_dir(device)); | ||
212 | if (!entry) | ||
213 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | ||
214 | "Unable to create '%s' fs entry\n", | ||
215 | ACPI_BUTTON_FILE_INFO)); | ||
216 | else { | ||
217 | entry->proc_fops = &acpi_button_info_fops; | ||
218 | entry->data = acpi_driver_data(device); | ||
219 | entry->owner = THIS_MODULE; | ||
220 | } | ||
221 | |||
222 | /* show lid state [R] */ | ||
223 | if (button->type == ACPI_BUTTON_TYPE_LID) { | ||
224 | entry = create_proc_entry(ACPI_BUTTON_FILE_STATE, | ||
225 | S_IRUGO, acpi_device_dir(device)); | ||
226 | if (!entry) | ||
227 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | ||
228 | "Unable to create '%s' fs entry\n", | ||
229 | ACPI_BUTTON_FILE_INFO)); | ||
230 | else { | ||
231 | entry->proc_fops = &acpi_button_state_fops; | ||
232 | entry->data = acpi_driver_data(device); | ||
233 | entry->owner = THIS_MODULE; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | return_VALUE(0); | ||
238 | } | ||
239 | |||
240 | |||
241 | static int | ||
242 | acpi_button_remove_fs ( | ||
243 | struct acpi_device *device) | ||
244 | { | ||
245 | struct acpi_button *button = NULL; | ||
246 | |||
247 | ACPI_FUNCTION_TRACE("acpi_button_remove_fs"); | ||
248 | |||
249 | button = acpi_driver_data(device); | ||
250 | if (acpi_device_dir(device)) { | ||
251 | if (button->type == ACPI_BUTTON_TYPE_LID) | ||
252 | remove_proc_entry(ACPI_BUTTON_FILE_STATE, | ||
253 | acpi_device_dir(device)); | ||
254 | remove_proc_entry(ACPI_BUTTON_FILE_INFO, | ||
255 | acpi_device_dir(device)); | ||
256 | |||
257 | remove_proc_entry(acpi_device_bid(device), | ||
258 | acpi_device_dir(device)->parent); | ||
259 | acpi_device_dir(device) = NULL; | ||
260 | } | ||
261 | |||
262 | return_VALUE(0); | ||
263 | } | ||
264 | |||
265 | |||
85 | /* -------------------------------------------------------------------------- | 266 | /* -------------------------------------------------------------------------- |
86 | Driver Interface | 267 | Driver Interface |
87 | -------------------------------------------------------------------------- */ | 268 | -------------------------------------------------------------------------- */ |
@@ -121,7 +302,8 @@ acpi_button_notify_fixed ( | |||
121 | 302 | ||
122 | ACPI_FUNCTION_TRACE("acpi_button_notify_fixed"); | 303 | ACPI_FUNCTION_TRACE("acpi_button_notify_fixed"); |
123 | 304 | ||
124 | BUG_ON(!button); | 305 | if (!button) |
306 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
125 | 307 | ||
126 | acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); | 308 | acpi_button_notify(button->handle, ACPI_BUTTON_NOTIFY_STATUS, button); |
127 | 309 | ||
@@ -197,6 +379,10 @@ acpi_button_add ( | |||
197 | goto end; | 379 | goto end; |
198 | } | 380 | } |
199 | 381 | ||
382 | result = acpi_button_add_fs(device); | ||
383 | if (result) | ||
384 | goto end; | ||
385 | |||
200 | switch (button->type) { | 386 | switch (button->type) { |
201 | case ACPI_BUTTON_TYPE_POWERF: | 387 | case ACPI_BUTTON_TYPE_POWERF: |
202 | status = acpi_install_fixed_event_handler ( | 388 | status = acpi_install_fixed_event_handler ( |
@@ -240,6 +426,7 @@ acpi_button_add ( | |||
240 | 426 | ||
241 | end: | 427 | end: |
242 | if (result) { | 428 | if (result) { |
429 | acpi_button_remove_fs(device); | ||
243 | kfree(button); | 430 | kfree(button); |
244 | } | 431 | } |
245 | 432 | ||
@@ -280,6 +467,8 @@ acpi_button_remove (struct acpi_device *device, int type) | |||
280 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 467 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
281 | "Error removing notify handler\n")); | 468 | "Error removing notify handler\n")); |
282 | 469 | ||
470 | acpi_button_remove_fs(device); | ||
471 | |||
283 | kfree(button); | 472 | kfree(button); |
284 | 473 | ||
285 | return_VALUE(0); | 474 | return_VALUE(0); |
@@ -293,14 +482,20 @@ acpi_button_init (void) | |||
293 | 482 | ||
294 | ACPI_FUNCTION_TRACE("acpi_button_init"); | 483 | ACPI_FUNCTION_TRACE("acpi_button_init"); |
295 | 484 | ||
485 | acpi_button_dir = proc_mkdir(ACPI_BUTTON_CLASS, acpi_root_dir); | ||
486 | if (!acpi_button_dir) | ||
487 | return_VALUE(-ENODEV); | ||
488 | acpi_button_dir->owner = THIS_MODULE; | ||
296 | result = acpi_bus_register_driver(&acpi_button_driver); | 489 | result = acpi_bus_register_driver(&acpi_button_driver); |
297 | if (result < 0) { | 490 | if (result < 0) { |
491 | remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); | ||
298 | return_VALUE(-ENODEV); | 492 | return_VALUE(-ENODEV); |
299 | } | 493 | } |
300 | 494 | ||
301 | return_VALUE(0); | 495 | return_VALUE(0); |
302 | } | 496 | } |
303 | 497 | ||
498 | |||
304 | static void __exit | 499 | static void __exit |
305 | acpi_button_exit (void) | 500 | acpi_button_exit (void) |
306 | { | 501 | { |
@@ -308,8 +503,17 @@ acpi_button_exit (void) | |||
308 | 503 | ||
309 | acpi_bus_unregister_driver(&acpi_button_driver); | 504 | acpi_bus_unregister_driver(&acpi_button_driver); |
310 | 505 | ||
506 | if (acpi_power_dir) | ||
507 | remove_proc_entry(ACPI_BUTTON_SUBCLASS_POWER, acpi_button_dir); | ||
508 | if (acpi_sleep_dir) | ||
509 | remove_proc_entry(ACPI_BUTTON_SUBCLASS_SLEEP, acpi_button_dir); | ||
510 | if (acpi_lid_dir) | ||
511 | remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir); | ||
512 | remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); | ||
513 | |||
311 | return_VOID; | 514 | return_VOID; |
312 | } | 515 | } |
313 | 516 | ||
517 | |||
314 | module_init(acpi_button_init); | 518 | module_init(acpi_button_init); |
315 | module_exit(acpi_button_exit); | 519 | module_exit(acpi_button_exit); |
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c index 1ac197ccfc80..d11620018421 100644 --- a/drivers/acpi/dispatcher/dswload.c +++ b/drivers/acpi/dispatcher/dswload.c | |||
@@ -491,12 +491,6 @@ acpi_ds_load2_begin_op ( | |||
491 | if ((!(walk_state->op_info->flags & AML_NSOPCODE) && | 491 | if ((!(walk_state->op_info->flags & AML_NSOPCODE) && |
492 | (walk_state->opcode != AML_INT_NAMEPATH_OP)) || | 492 | (walk_state->opcode != AML_INT_NAMEPATH_OP)) || |
493 | (!(walk_state->op_info->flags & AML_NAMED))) { | 493 | (!(walk_state->op_info->flags & AML_NAMED))) { |
494 | if ((walk_state->op_info->class == AML_CLASS_EXECUTE) || | ||
495 | (walk_state->op_info->class == AML_CLASS_CONTROL)) { | ||
496 | ACPI_REPORT_WARNING (( | ||
497 | "Encountered executable code at module level, [%s]\n", | ||
498 | acpi_ps_get_opcode_name (walk_state->opcode))); | ||
499 | } | ||
500 | return_ACPI_STATUS (AE_OK); | 494 | return_ACPI_STATUS (AE_OK); |
501 | } | 495 | } |
502 | 496 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index fca4140a50a9..1ac5731d45e5 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -59,76 +59,186 @@ ACPI_MODULE_NAME ("acpi_ec") | |||
59 | #define ACPI_EC_DELAY 50 /* Wait 50ms max. during EC ops */ | 59 | #define ACPI_EC_DELAY 50 /* Wait 50ms max. during EC ops */ |
60 | #define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ | 60 | #define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ |
61 | 61 | ||
62 | #define ACPI_EC_UDELAY 100 /* Poll @ 100us increments */ | ||
63 | #define ACPI_EC_UDELAY_COUNT 1000 /* Wait 10ms max. during EC ops */ | ||
64 | |||
62 | #define ACPI_EC_COMMAND_READ 0x80 | 65 | #define ACPI_EC_COMMAND_READ 0x80 |
63 | #define ACPI_EC_COMMAND_WRITE 0x81 | 66 | #define ACPI_EC_COMMAND_WRITE 0x81 |
64 | #define ACPI_EC_BURST_ENABLE 0x82 | 67 | #define ACPI_EC_BURST_ENABLE 0x82 |
65 | #define ACPI_EC_BURST_DISABLE 0x83 | 68 | #define ACPI_EC_BURST_DISABLE 0x83 |
66 | #define ACPI_EC_COMMAND_QUERY 0x84 | 69 | #define ACPI_EC_COMMAND_QUERY 0x84 |
67 | 70 | ||
68 | static int acpi_ec_add (struct acpi_device *device); | 71 | #define EC_POLLING 0xFF |
72 | #define EC_BURST 0x00 | ||
73 | |||
74 | |||
69 | static int acpi_ec_remove (struct acpi_device *device, int type); | 75 | static int acpi_ec_remove (struct acpi_device *device, int type); |
70 | static int acpi_ec_start (struct acpi_device *device); | 76 | static int acpi_ec_start (struct acpi_device *device); |
71 | static int acpi_ec_stop (struct acpi_device *device, int type); | 77 | static int acpi_ec_stop (struct acpi_device *device, int type); |
78 | static int acpi_ec_burst_add ( struct acpi_device *device); | ||
79 | static int acpi_ec_polling_add ( struct acpi_device *device); | ||
72 | 80 | ||
73 | static struct acpi_driver acpi_ec_driver = { | 81 | static struct acpi_driver acpi_ec_driver = { |
74 | .name = ACPI_EC_DRIVER_NAME, | 82 | .name = ACPI_EC_DRIVER_NAME, |
75 | .class = ACPI_EC_CLASS, | 83 | .class = ACPI_EC_CLASS, |
76 | .ids = ACPI_EC_HID, | 84 | .ids = ACPI_EC_HID, |
77 | .ops = { | 85 | .ops = { |
78 | .add = acpi_ec_add, | 86 | .add = acpi_ec_polling_add, |
79 | .remove = acpi_ec_remove, | 87 | .remove = acpi_ec_remove, |
80 | .start = acpi_ec_start, | 88 | .start = acpi_ec_start, |
81 | .stop = acpi_ec_stop, | 89 | .stop = acpi_ec_stop, |
82 | }, | 90 | }, |
83 | }; | 91 | }; |
84 | 92 | union acpi_ec { | |
85 | struct acpi_ec { | 93 | struct { |
86 | acpi_handle handle; | 94 | u32 mode; |
87 | unsigned long uid; | 95 | acpi_handle handle; |
88 | unsigned long gpe_bit; | 96 | unsigned long uid; |
89 | struct acpi_generic_address status_addr; | 97 | unsigned long gpe_bit; |
90 | struct acpi_generic_address command_addr; | 98 | struct acpi_generic_address status_addr; |
91 | struct acpi_generic_address data_addr; | 99 | struct acpi_generic_address command_addr; |
92 | unsigned long global_lock; | 100 | struct acpi_generic_address data_addr; |
93 | unsigned int expect_event; | 101 | unsigned long global_lock; |
94 | atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort*/ | 102 | } common; |
95 | atomic_t pending_gpe; | 103 | |
96 | struct semaphore sem; | 104 | struct { |
97 | wait_queue_head_t wait; | 105 | u32 mode; |
106 | acpi_handle handle; | ||
107 | unsigned long uid; | ||
108 | unsigned long gpe_bit; | ||
109 | struct acpi_generic_address status_addr; | ||
110 | struct acpi_generic_address command_addr; | ||
111 | struct acpi_generic_address data_addr; | ||
112 | unsigned long global_lock; | ||
113 | unsigned int expect_event; | ||
114 | atomic_t leaving_burst; /* 0 : No, 1 : Yes, 2: abort*/ | ||
115 | atomic_t pending_gpe; | ||
116 | struct semaphore sem; | ||
117 | wait_queue_head_t wait; | ||
118 | }burst; | ||
119 | |||
120 | struct { | ||
121 | u32 mode; | ||
122 | acpi_handle handle; | ||
123 | unsigned long uid; | ||
124 | unsigned long gpe_bit; | ||
125 | struct acpi_generic_address status_addr; | ||
126 | struct acpi_generic_address command_addr; | ||
127 | struct acpi_generic_address data_addr; | ||
128 | unsigned long global_lock; | ||
129 | spinlock_t lock; | ||
130 | }polling; | ||
98 | }; | 131 | }; |
99 | 132 | ||
133 | static int acpi_ec_polling_wait ( union acpi_ec *ec, u8 event); | ||
134 | static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event); | ||
135 | static int acpi_ec_polling_read ( union acpi_ec *ec, u8 address, u32 *data); | ||
136 | static int acpi_ec_burst_read( union acpi_ec *ec, u8 address, u32 *data); | ||
137 | static int acpi_ec_polling_write ( union acpi_ec *ec, u8 address, u8 data); | ||
138 | static int acpi_ec_burst_write ( union acpi_ec *ec, u8 address, u8 data); | ||
139 | static int acpi_ec_polling_query ( union acpi_ec *ec, u32 *data); | ||
140 | static int acpi_ec_burst_query ( union acpi_ec *ec, u32 *data); | ||
141 | static void acpi_ec_gpe_polling_query ( void *ec_cxt); | ||
142 | static void acpi_ec_gpe_burst_query ( void *ec_cxt); | ||
143 | static u32 acpi_ec_gpe_polling_handler ( void *data); | ||
144 | static u32 acpi_ec_gpe_burst_handler ( void *data); | ||
145 | static acpi_status __init | ||
146 | acpi_fake_ecdt_polling_callback ( | ||
147 | acpi_handle handle, | ||
148 | u32 Level, | ||
149 | void *context, | ||
150 | void **retval); | ||
151 | |||
152 | static acpi_status __init | ||
153 | acpi_fake_ecdt_burst_callback ( | ||
154 | acpi_handle handle, | ||
155 | u32 Level, | ||
156 | void *context, | ||
157 | void **retval); | ||
158 | |||
159 | static int __init | ||
160 | acpi_ec_polling_get_real_ecdt(void); | ||
161 | static int __init | ||
162 | acpi_ec_burst_get_real_ecdt(void); | ||
100 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ | 163 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ |
101 | static struct acpi_ec *ec_ecdt; | 164 | static union acpi_ec *ec_ecdt; |
102 | 165 | ||
103 | /* External interfaces use first EC only, so remember */ | 166 | /* External interfaces use first EC only, so remember */ |
104 | static struct acpi_device *first_ec; | 167 | static struct acpi_device *first_ec; |
168 | static int acpi_ec_polling_mode = EC_POLLING; | ||
105 | 169 | ||
106 | /* -------------------------------------------------------------------------- | 170 | /* -------------------------------------------------------------------------- |
107 | Transaction Management | 171 | Transaction Management |
108 | -------------------------------------------------------------------------- */ | 172 | -------------------------------------------------------------------------- */ |
109 | 173 | ||
110 | static inline u32 acpi_ec_read_status(struct acpi_ec *ec) | 174 | static inline u32 acpi_ec_read_status(union acpi_ec *ec) |
111 | { | 175 | { |
112 | u32 status = 0; | 176 | u32 status = 0; |
113 | 177 | ||
114 | acpi_hw_low_level_read(8, &status, &ec->status_addr); | 178 | acpi_hw_low_level_read(8, &status, &ec->common.status_addr); |
115 | return status; | 179 | return status; |
116 | } | 180 | } |
117 | 181 | ||
118 | static int acpi_ec_wait(struct acpi_ec *ec, unsigned int event) | 182 | static int |
183 | acpi_ec_wait ( | ||
184 | union acpi_ec *ec, | ||
185 | u8 event) | ||
186 | { | ||
187 | if (acpi_ec_polling_mode) | ||
188 | return acpi_ec_polling_wait (ec, event); | ||
189 | else | ||
190 | return acpi_ec_burst_wait (ec, event); | ||
191 | } | ||
192 | |||
193 | static int | ||
194 | acpi_ec_polling_wait ( | ||
195 | union acpi_ec *ec, | ||
196 | u8 event) | ||
197 | { | ||
198 | u32 acpi_ec_status = 0; | ||
199 | u32 i = ACPI_EC_UDELAY_COUNT; | ||
200 | |||
201 | if (!ec) | ||
202 | return -EINVAL; | ||
203 | |||
204 | /* Poll the EC status register waiting for the event to occur. */ | ||
205 | switch (event) { | ||
206 | case ACPI_EC_EVENT_OBF: | ||
207 | do { | ||
208 | acpi_hw_low_level_read(8, &acpi_ec_status, &ec->common.status_addr); | ||
209 | if (acpi_ec_status & ACPI_EC_FLAG_OBF) | ||
210 | return 0; | ||
211 | udelay(ACPI_EC_UDELAY); | ||
212 | } while (--i>0); | ||
213 | break; | ||
214 | case ACPI_EC_EVENT_IBE: | ||
215 | do { | ||
216 | acpi_hw_low_level_read(8, &acpi_ec_status, &ec->common.status_addr); | ||
217 | if (!(acpi_ec_status & ACPI_EC_FLAG_IBF)) | ||
218 | return 0; | ||
219 | udelay(ACPI_EC_UDELAY); | ||
220 | } while (--i>0); | ||
221 | break; | ||
222 | default: | ||
223 | return -EINVAL; | ||
224 | } | ||
225 | |||
226 | return -ETIME; | ||
227 | } | ||
228 | static int acpi_ec_burst_wait(union acpi_ec *ec, unsigned int event) | ||
119 | { | 229 | { |
120 | int result = 0; | 230 | int result = 0; |
121 | 231 | ||
122 | ACPI_FUNCTION_TRACE("acpi_ec_wait"); | 232 | ACPI_FUNCTION_TRACE("acpi_ec_wait"); |
123 | 233 | ||
124 | ec->expect_event = event; | 234 | ec->burst.expect_event = event; |
125 | smp_mb(); | 235 | smp_mb(); |
126 | 236 | ||
127 | result = wait_event_interruptible_timeout(ec->wait, | 237 | result = wait_event_interruptible_timeout(ec->burst.wait, |
128 | !ec->expect_event, | 238 | !ec->burst.expect_event, |
129 | msecs_to_jiffies(ACPI_EC_DELAY)); | 239 | msecs_to_jiffies(ACPI_EC_DELAY)); |
130 | 240 | ||
131 | ec->expect_event = 0; | 241 | ec->burst.expect_event = 0; |
132 | smp_mb(); | 242 | smp_mb(); |
133 | 243 | ||
134 | if (result < 0){ | 244 | if (result < 0){ |
@@ -160,7 +270,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, unsigned int event) | |||
160 | 270 | ||
161 | static int | 271 | static int |
162 | acpi_ec_enter_burst_mode ( | 272 | acpi_ec_enter_burst_mode ( |
163 | struct acpi_ec *ec) | 273 | union acpi_ec *ec) |
164 | { | 274 | { |
165 | u32 tmp = 0; | 275 | u32 tmp = 0; |
166 | int status = 0; | 276 | int status = 0; |
@@ -170,43 +280,43 @@ acpi_ec_enter_burst_mode ( | |||
170 | status = acpi_ec_read_status(ec); | 280 | status = acpi_ec_read_status(ec); |
171 | if (status != -EINVAL && | 281 | if (status != -EINVAL && |
172 | !(status & ACPI_EC_FLAG_BURST)){ | 282 | !(status & ACPI_EC_FLAG_BURST)){ |
173 | acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE, &ec->command_addr); | 283 | acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE, &ec->common.command_addr); |
174 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | 284 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); |
175 | if (status){ | 285 | if (status){ |
176 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 286 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
177 | return_VALUE(-EINVAL); | 287 | return_VALUE(-EINVAL); |
178 | } | 288 | } |
179 | acpi_hw_low_level_read(8, &tmp, &ec->data_addr); | 289 | acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr); |
180 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 290 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
181 | if(tmp != 0x90 ) {/* Burst ACK byte*/ | 291 | if(tmp != 0x90 ) {/* Burst ACK byte*/ |
182 | return_VALUE(-EINVAL); | 292 | return_VALUE(-EINVAL); |
183 | } | 293 | } |
184 | } | 294 | } |
185 | 295 | ||
186 | atomic_set(&ec->leaving_burst , 0); | 296 | atomic_set(&ec->burst.leaving_burst , 0); |
187 | return_VALUE(0); | 297 | return_VALUE(0); |
188 | } | 298 | } |
189 | 299 | ||
190 | static int | 300 | static int |
191 | acpi_ec_leave_burst_mode ( | 301 | acpi_ec_leave_burst_mode ( |
192 | struct acpi_ec *ec) | 302 | union acpi_ec *ec) |
193 | { | 303 | { |
194 | int status =0; | 304 | int status =0; |
195 | 305 | ||
196 | ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode"); | 306 | ACPI_FUNCTION_TRACE("acpi_ec_leave_burst_mode"); |
197 | 307 | ||
198 | atomic_set(&ec->leaving_burst , 1); | 308 | atomic_set(&ec->burst.leaving_burst , 1); |
199 | status = acpi_ec_read_status(ec); | 309 | status = acpi_ec_read_status(ec); |
200 | if (status != -EINVAL && | 310 | if (status != -EINVAL && |
201 | (status & ACPI_EC_FLAG_BURST)){ | 311 | (status & ACPI_EC_FLAG_BURST)){ |
202 | acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->command_addr); | 312 | acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->common.command_addr); |
203 | status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF); | 313 | status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF); |
204 | if (status){ | 314 | if (status){ |
205 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 315 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
206 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"------->wait fail\n")); | 316 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"------->wait fail\n")); |
207 | return_VALUE(-EINVAL); | 317 | return_VALUE(-EINVAL); |
208 | } | 318 | } |
209 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 319 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
210 | status = acpi_ec_read_status(ec); | 320 | status = acpi_ec_read_status(ec); |
211 | } | 321 | } |
212 | 322 | ||
@@ -215,7 +325,131 @@ acpi_ec_leave_burst_mode ( | |||
215 | 325 | ||
216 | static int | 326 | static int |
217 | acpi_ec_read ( | 327 | acpi_ec_read ( |
218 | struct acpi_ec *ec, | 328 | union acpi_ec *ec, |
329 | u8 address, | ||
330 | u32 *data) | ||
331 | { | ||
332 | if (acpi_ec_polling_mode) | ||
333 | return acpi_ec_polling_read(ec, address, data); | ||
334 | else | ||
335 | return acpi_ec_burst_read(ec, address, data); | ||
336 | } | ||
337 | static int | ||
338 | acpi_ec_write ( | ||
339 | union acpi_ec *ec, | ||
340 | u8 address, | ||
341 | u8 data) | ||
342 | { | ||
343 | if (acpi_ec_polling_mode) | ||
344 | return acpi_ec_polling_write(ec, address, data); | ||
345 | else | ||
346 | return acpi_ec_burst_write(ec, address, data); | ||
347 | } | ||
348 | static int | ||
349 | acpi_ec_polling_read ( | ||
350 | union acpi_ec *ec, | ||
351 | u8 address, | ||
352 | u32 *data) | ||
353 | { | ||
354 | acpi_status status = AE_OK; | ||
355 | int result = 0; | ||
356 | unsigned long flags = 0; | ||
357 | u32 glk = 0; | ||
358 | |||
359 | ACPI_FUNCTION_TRACE("acpi_ec_read"); | ||
360 | |||
361 | if (!ec || !data) | ||
362 | return_VALUE(-EINVAL); | ||
363 | |||
364 | *data = 0; | ||
365 | |||
366 | if (ec->common.global_lock) { | ||
367 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | ||
368 | if (ACPI_FAILURE(status)) | ||
369 | return_VALUE(-ENODEV); | ||
370 | } | ||
371 | |||
372 | spin_lock_irqsave(&ec->polling.lock, flags); | ||
373 | |||
374 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ, &ec->common.command_addr); | ||
375 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | ||
376 | if (result) | ||
377 | goto end; | ||
378 | |||
379 | acpi_hw_low_level_write(8, address, &ec->common.data_addr); | ||
380 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | ||
381 | if (result) | ||
382 | goto end; | ||
383 | |||
384 | acpi_hw_low_level_read(8, data, &ec->common.data_addr); | ||
385 | |||
386 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n", | ||
387 | *data, address)); | ||
388 | |||
389 | end: | ||
390 | spin_unlock_irqrestore(&ec->polling.lock, flags); | ||
391 | |||
392 | if (ec->common.global_lock) | ||
393 | acpi_release_global_lock(glk); | ||
394 | |||
395 | return_VALUE(result); | ||
396 | } | ||
397 | |||
398 | |||
399 | static int | ||
400 | acpi_ec_polling_write ( | ||
401 | union acpi_ec *ec, | ||
402 | u8 address, | ||
403 | u8 data) | ||
404 | { | ||
405 | int result = 0; | ||
406 | acpi_status status = AE_OK; | ||
407 | unsigned long flags = 0; | ||
408 | u32 glk = 0; | ||
409 | |||
410 | ACPI_FUNCTION_TRACE("acpi_ec_write"); | ||
411 | |||
412 | if (!ec) | ||
413 | return_VALUE(-EINVAL); | ||
414 | |||
415 | if (ec->common.global_lock) { | ||
416 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | ||
417 | if (ACPI_FAILURE(status)) | ||
418 | return_VALUE(-ENODEV); | ||
419 | } | ||
420 | |||
421 | spin_lock_irqsave(&ec->polling.lock, flags); | ||
422 | |||
423 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE, &ec->common.command_addr); | ||
424 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | ||
425 | if (result) | ||
426 | goto end; | ||
427 | |||
428 | acpi_hw_low_level_write(8, address, &ec->common.data_addr); | ||
429 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | ||
430 | if (result) | ||
431 | goto end; | ||
432 | |||
433 | acpi_hw_low_level_write(8, data, &ec->common.data_addr); | ||
434 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | ||
435 | if (result) | ||
436 | goto end; | ||
437 | |||
438 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n", | ||
439 | data, address)); | ||
440 | |||
441 | end: | ||
442 | spin_unlock_irqrestore(&ec->polling.lock, flags); | ||
443 | |||
444 | if (ec->common.global_lock) | ||
445 | acpi_release_global_lock(glk); | ||
446 | |||
447 | return_VALUE(result); | ||
448 | } | ||
449 | |||
450 | static int | ||
451 | acpi_ec_burst_read ( | ||
452 | union acpi_ec *ec, | ||
219 | u8 address, | 453 | u8 address, |
220 | u32 *data) | 454 | u32 *data) |
221 | { | 455 | { |
@@ -230,51 +464,51 @@ acpi_ec_read ( | |||
230 | retry: | 464 | retry: |
231 | *data = 0; | 465 | *data = 0; |
232 | 466 | ||
233 | if (ec->global_lock) { | 467 | if (ec->common.global_lock) { |
234 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | 468 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); |
235 | if (ACPI_FAILURE(status)) | 469 | if (ACPI_FAILURE(status)) |
236 | return_VALUE(-ENODEV); | 470 | return_VALUE(-ENODEV); |
237 | } | 471 | } |
238 | 472 | ||
239 | WARN_ON(in_interrupt()); | 473 | WARN_ON(in_interrupt()); |
240 | down(&ec->sem); | 474 | down(&ec->burst.sem); |
241 | 475 | ||
242 | if(acpi_ec_enter_burst_mode(ec)) | 476 | if(acpi_ec_enter_burst_mode(ec)) |
243 | goto end; | 477 | goto end; |
244 | 478 | ||
245 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ, &ec->command_addr); | 479 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_READ, &ec->common.command_addr); |
246 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | 480 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); |
247 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 481 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
248 | if (status) { | 482 | if (status) { |
249 | goto end; | 483 | goto end; |
250 | } | 484 | } |
251 | 485 | ||
252 | acpi_hw_low_level_write(8, address, &ec->data_addr); | 486 | acpi_hw_low_level_write(8, address, &ec->common.data_addr); |
253 | status= acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | 487 | status= acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); |
254 | if (status){ | 488 | if (status){ |
255 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 489 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
256 | goto end; | 490 | goto end; |
257 | } | 491 | } |
258 | 492 | ||
259 | acpi_hw_low_level_read(8, data, &ec->data_addr); | 493 | acpi_hw_low_level_read(8, data, &ec->common.data_addr); |
260 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 494 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
261 | 495 | ||
262 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n", | 496 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Read [%02x] from address [%02x]\n", |
263 | *data, address)); | 497 | *data, address)); |
264 | 498 | ||
265 | end: | 499 | end: |
266 | acpi_ec_leave_burst_mode(ec); | 500 | acpi_ec_leave_burst_mode(ec); |
267 | up(&ec->sem); | 501 | up(&ec->burst.sem); |
268 | 502 | ||
269 | if (ec->global_lock) | 503 | if (ec->common.global_lock) |
270 | acpi_release_global_lock(glk); | 504 | acpi_release_global_lock(glk); |
271 | 505 | ||
272 | if(atomic_read(&ec->leaving_burst) == 2){ | 506 | if(atomic_read(&ec->burst.leaving_burst) == 2){ |
273 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); | 507 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); |
274 | while(atomic_read(&ec->pending_gpe)){ | 508 | while(atomic_read(&ec->burst.pending_gpe)){ |
275 | msleep(1); | 509 | msleep(1); |
276 | } | 510 | } |
277 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 511 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
278 | goto retry; | 512 | goto retry; |
279 | } | 513 | } |
280 | 514 | ||
@@ -283,8 +517,8 @@ end: | |||
283 | 517 | ||
284 | 518 | ||
285 | static int | 519 | static int |
286 | acpi_ec_write ( | 520 | acpi_ec_burst_write ( |
287 | struct acpi_ec *ec, | 521 | union acpi_ec *ec, |
288 | u8 address, | 522 | u8 address, |
289 | u8 data) | 523 | u8 data) |
290 | { | 524 | { |
@@ -297,14 +531,14 @@ acpi_ec_write ( | |||
297 | if (!ec) | 531 | if (!ec) |
298 | return_VALUE(-EINVAL); | 532 | return_VALUE(-EINVAL); |
299 | retry: | 533 | retry: |
300 | if (ec->global_lock) { | 534 | if (ec->common.global_lock) { |
301 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | 535 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); |
302 | if (ACPI_FAILURE(status)) | 536 | if (ACPI_FAILURE(status)) |
303 | return_VALUE(-ENODEV); | 537 | return_VALUE(-ENODEV); |
304 | } | 538 | } |
305 | 539 | ||
306 | WARN_ON(in_interrupt()); | 540 | WARN_ON(in_interrupt()); |
307 | down(&ec->sem); | 541 | down(&ec->burst.sem); |
308 | 542 | ||
309 | if(acpi_ec_enter_burst_mode(ec)) | 543 | if(acpi_ec_enter_burst_mode(ec)) |
310 | goto end; | 544 | goto end; |
@@ -312,33 +546,33 @@ retry: | |||
312 | status = acpi_ec_read_status(ec); | 546 | status = acpi_ec_read_status(ec); |
313 | if (status != -EINVAL && | 547 | if (status != -EINVAL && |
314 | !(status & ACPI_EC_FLAG_BURST)){ | 548 | !(status & ACPI_EC_FLAG_BURST)){ |
315 | acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE, &ec->command_addr); | 549 | acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE, &ec->common.command_addr); |
316 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | 550 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); |
317 | if (status) | 551 | if (status) |
318 | goto end; | 552 | goto end; |
319 | acpi_hw_low_level_read(8, &tmp, &ec->data_addr); | 553 | acpi_hw_low_level_read(8, &tmp, &ec->common.data_addr); |
320 | if(tmp != 0x90 ) /* Burst ACK byte*/ | 554 | if(tmp != 0x90 ) /* Burst ACK byte*/ |
321 | goto end; | 555 | goto end; |
322 | } | 556 | } |
323 | /*Now we are in burst mode*/ | 557 | /*Now we are in burst mode*/ |
324 | 558 | ||
325 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE, &ec->command_addr); | 559 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE, &ec->common.command_addr); |
326 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | 560 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); |
327 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 561 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
328 | if (status){ | 562 | if (status){ |
329 | goto end; | 563 | goto end; |
330 | } | 564 | } |
331 | 565 | ||
332 | acpi_hw_low_level_write(8, address, &ec->data_addr); | 566 | acpi_hw_low_level_write(8, address, &ec->common.data_addr); |
333 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | 567 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); |
334 | if (status){ | 568 | if (status){ |
335 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 569 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
336 | goto end; | 570 | goto end; |
337 | } | 571 | } |
338 | 572 | ||
339 | acpi_hw_low_level_write(8, data, &ec->data_addr); | 573 | acpi_hw_low_level_write(8, data, &ec->common.data_addr); |
340 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); | 574 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE); |
341 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 575 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
342 | if (status) | 576 | if (status) |
343 | goto end; | 577 | goto end; |
344 | 578 | ||
@@ -347,17 +581,17 @@ retry: | |||
347 | 581 | ||
348 | end: | 582 | end: |
349 | acpi_ec_leave_burst_mode(ec); | 583 | acpi_ec_leave_burst_mode(ec); |
350 | up(&ec->sem); | 584 | up(&ec->burst.sem); |
351 | 585 | ||
352 | if (ec->global_lock) | 586 | if (ec->common.global_lock) |
353 | acpi_release_global_lock(glk); | 587 | acpi_release_global_lock(glk); |
354 | 588 | ||
355 | if(atomic_read(&ec->leaving_burst) == 2){ | 589 | if(atomic_read(&ec->burst.leaving_burst) == 2){ |
356 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); | 590 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); |
357 | while(atomic_read(&ec->pending_gpe)){ | 591 | while(atomic_read(&ec->burst.pending_gpe)){ |
358 | msleep(1); | 592 | msleep(1); |
359 | } | 593 | } |
360 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 594 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
361 | goto retry; | 595 | goto retry; |
362 | } | 596 | } |
363 | 597 | ||
@@ -370,7 +604,7 @@ end: | |||
370 | int | 604 | int |
371 | ec_read(u8 addr, u8 *val) | 605 | ec_read(u8 addr, u8 *val) |
372 | { | 606 | { |
373 | struct acpi_ec *ec; | 607 | union acpi_ec *ec; |
374 | int err; | 608 | int err; |
375 | u32 temp_data; | 609 | u32 temp_data; |
376 | 610 | ||
@@ -393,7 +627,7 @@ EXPORT_SYMBOL(ec_read); | |||
393 | int | 627 | int |
394 | ec_write(u8 addr, u8 val) | 628 | ec_write(u8 addr, u8 val) |
395 | { | 629 | { |
396 | struct acpi_ec *ec; | 630 | union acpi_ec *ec; |
397 | int err; | 631 | int err; |
398 | 632 | ||
399 | if (!first_ec) | 633 | if (!first_ec) |
@@ -407,10 +641,66 @@ ec_write(u8 addr, u8 val) | |||
407 | } | 641 | } |
408 | EXPORT_SYMBOL(ec_write); | 642 | EXPORT_SYMBOL(ec_write); |
409 | 643 | ||
410 | |||
411 | static int | 644 | static int |
412 | acpi_ec_query ( | 645 | acpi_ec_query ( |
413 | struct acpi_ec *ec, | 646 | union acpi_ec *ec, |
647 | u32 *data) | ||
648 | { | ||
649 | if (acpi_ec_polling_mode) | ||
650 | return acpi_ec_polling_query(ec, data); | ||
651 | else | ||
652 | return acpi_ec_burst_query(ec, data); | ||
653 | } | ||
654 | static int | ||
655 | acpi_ec_polling_query ( | ||
656 | union acpi_ec *ec, | ||
657 | u32 *data) | ||
658 | { | ||
659 | int result = 0; | ||
660 | acpi_status status = AE_OK; | ||
661 | unsigned long flags = 0; | ||
662 | u32 glk = 0; | ||
663 | |||
664 | ACPI_FUNCTION_TRACE("acpi_ec_query"); | ||
665 | |||
666 | if (!ec || !data) | ||
667 | return_VALUE(-EINVAL); | ||
668 | |||
669 | *data = 0; | ||
670 | |||
671 | if (ec->common.global_lock) { | ||
672 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | ||
673 | if (ACPI_FAILURE(status)) | ||
674 | return_VALUE(-ENODEV); | ||
675 | } | ||
676 | |||
677 | /* | ||
678 | * Query the EC to find out which _Qxx method we need to evaluate. | ||
679 | * Note that successful completion of the query causes the ACPI_EC_SCI | ||
680 | * bit to be cleared (and thus clearing the interrupt source). | ||
681 | */ | ||
682 | spin_lock_irqsave(&ec->polling.lock, flags); | ||
683 | |||
684 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY, &ec->common.command_addr); | ||
685 | result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | ||
686 | if (result) | ||
687 | goto end; | ||
688 | |||
689 | acpi_hw_low_level_read(8, data, &ec->common.data_addr); | ||
690 | if (!*data) | ||
691 | result = -ENODATA; | ||
692 | |||
693 | end: | ||
694 | spin_unlock_irqrestore(&ec->polling.lock, flags); | ||
695 | |||
696 | if (ec->common.global_lock) | ||
697 | acpi_release_global_lock(glk); | ||
698 | |||
699 | return_VALUE(result); | ||
700 | } | ||
701 | static int | ||
702 | acpi_ec_burst_query ( | ||
703 | union acpi_ec *ec, | ||
414 | u32 *data) | 704 | u32 *data) |
415 | { | 705 | { |
416 | int status = 0; | 706 | int status = 0; |
@@ -422,13 +712,13 @@ acpi_ec_query ( | |||
422 | return_VALUE(-EINVAL); | 712 | return_VALUE(-EINVAL); |
423 | *data = 0; | 713 | *data = 0; |
424 | 714 | ||
425 | if (ec->global_lock) { | 715 | if (ec->common.global_lock) { |
426 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | 716 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); |
427 | if (ACPI_FAILURE(status)) | 717 | if (ACPI_FAILURE(status)) |
428 | return_VALUE(-ENODEV); | 718 | return_VALUE(-ENODEV); |
429 | } | 719 | } |
430 | 720 | ||
431 | down(&ec->sem); | 721 | down(&ec->burst.sem); |
432 | if(acpi_ec_enter_burst_mode(ec)) | 722 | if(acpi_ec_enter_burst_mode(ec)) |
433 | goto end; | 723 | goto end; |
434 | /* | 724 | /* |
@@ -436,28 +726,28 @@ acpi_ec_query ( | |||
436 | * Note that successful completion of the query causes the ACPI_EC_SCI | 726 | * Note that successful completion of the query causes the ACPI_EC_SCI |
437 | * bit to be cleared (and thus clearing the interrupt source). | 727 | * bit to be cleared (and thus clearing the interrupt source). |
438 | */ | 728 | */ |
439 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY, &ec->command_addr); | 729 | acpi_hw_low_level_write(8, ACPI_EC_COMMAND_QUERY, &ec->common.command_addr); |
440 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); | 730 | status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF); |
441 | if (status){ | 731 | if (status){ |
442 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 732 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
443 | goto end; | 733 | goto end; |
444 | } | 734 | } |
445 | 735 | ||
446 | acpi_hw_low_level_read(8, data, &ec->data_addr); | 736 | acpi_hw_low_level_read(8, data, &ec->common.data_addr); |
447 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 737 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
448 | if (!*data) | 738 | if (!*data) |
449 | status = -ENODATA; | 739 | status = -ENODATA; |
450 | 740 | ||
451 | end: | 741 | end: |
452 | acpi_ec_leave_burst_mode(ec); | 742 | acpi_ec_leave_burst_mode(ec); |
453 | up(&ec->sem); | 743 | up(&ec->burst.sem); |
454 | 744 | ||
455 | if (ec->global_lock) | 745 | if (ec->common.global_lock) |
456 | acpi_release_global_lock(glk); | 746 | acpi_release_global_lock(glk); |
457 | 747 | ||
458 | if(atomic_read(&ec->leaving_burst) == 2){ | 748 | if(atomic_read(&ec->burst.leaving_burst) == 2){ |
459 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); | 749 | ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); |
460 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 750 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
461 | status = -ENODATA; | 751 | status = -ENODATA; |
462 | } | 752 | } |
463 | return_VALUE(status); | 753 | return_VALUE(status); |
@@ -468,7 +758,7 @@ end: | |||
468 | Event Management | 758 | Event Management |
469 | -------------------------------------------------------------------------- */ | 759 | -------------------------------------------------------------------------- */ |
470 | 760 | ||
471 | struct acpi_ec_query_data { | 761 | union acpi_ec_query_data { |
472 | acpi_handle handle; | 762 | acpi_handle handle; |
473 | u8 data; | 763 | u8 data; |
474 | }; | 764 | }; |
@@ -477,7 +767,59 @@ static void | |||
477 | acpi_ec_gpe_query ( | 767 | acpi_ec_gpe_query ( |
478 | void *ec_cxt) | 768 | void *ec_cxt) |
479 | { | 769 | { |
480 | struct acpi_ec *ec = (struct acpi_ec *) ec_cxt; | 770 | if (acpi_ec_polling_mode) |
771 | acpi_ec_gpe_polling_query(ec_cxt); | ||
772 | else | ||
773 | acpi_ec_gpe_burst_query(ec_cxt); | ||
774 | } | ||
775 | |||
776 | static void | ||
777 | acpi_ec_gpe_polling_query ( | ||
778 | void *ec_cxt) | ||
779 | { | ||
780 | union acpi_ec *ec = (union acpi_ec *) ec_cxt; | ||
781 | u32 value = 0; | ||
782 | unsigned long flags = 0; | ||
783 | static char object_name[5] = {'_','Q','0','0','\0'}; | ||
784 | const char hex[] = {'0','1','2','3','4','5','6','7', | ||
785 | '8','9','A','B','C','D','E','F'}; | ||
786 | |||
787 | ACPI_FUNCTION_TRACE("acpi_ec_gpe_query"); | ||
788 | |||
789 | if (!ec_cxt) | ||
790 | goto end; | ||
791 | |||
792 | spin_lock_irqsave(&ec->polling.lock, flags); | ||
793 | acpi_hw_low_level_read(8, &value, &ec->common.command_addr); | ||
794 | spin_unlock_irqrestore(&ec->polling.lock, flags); | ||
795 | |||
796 | /* TBD: Implement asynch events! | ||
797 | * NOTE: All we care about are EC-SCI's. Other EC events are | ||
798 | * handled via polling (yuck!). This is because some systems | ||
799 | * treat EC-SCIs as level (versus EDGE!) triggered, preventing | ||
800 | * a purely interrupt-driven approach (grumble, grumble). | ||
801 | */ | ||
802 | if (!(value & ACPI_EC_FLAG_SCI)) | ||
803 | goto end; | ||
804 | |||
805 | if (acpi_ec_query(ec, &value)) | ||
806 | goto end; | ||
807 | |||
808 | object_name[2] = hex[((value >> 4) & 0x0F)]; | ||
809 | object_name[3] = hex[(value & 0x0F)]; | ||
810 | |||
811 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); | ||
812 | |||
813 | acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL); | ||
814 | |||
815 | end: | ||
816 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); | ||
817 | } | ||
818 | static void | ||
819 | acpi_ec_gpe_burst_query ( | ||
820 | void *ec_cxt) | ||
821 | { | ||
822 | union acpi_ec *ec = (union acpi_ec *) ec_cxt; | ||
481 | u32 value; | 823 | u32 value; |
482 | int result = -ENODATA; | 824 | int result = -ENODATA; |
483 | static char object_name[5] = {'_','Q','0','0','\0'}; | 825 | static char object_name[5] = {'_','Q','0','0','\0'}; |
@@ -497,9 +839,9 @@ acpi_ec_gpe_query ( | |||
497 | 839 | ||
498 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); | 840 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); |
499 | 841 | ||
500 | acpi_evaluate_object(ec->handle, object_name, NULL, NULL); | 842 | acpi_evaluate_object(ec->common.handle, object_name, NULL, NULL); |
501 | end: | 843 | end: |
502 | atomic_dec(&ec->pending_gpe); | 844 | atomic_dec(&ec->burst.pending_gpe); |
503 | return; | 845 | return; |
504 | } | 846 | } |
505 | 847 | ||
@@ -507,48 +849,77 @@ static u32 | |||
507 | acpi_ec_gpe_handler ( | 849 | acpi_ec_gpe_handler ( |
508 | void *data) | 850 | void *data) |
509 | { | 851 | { |
852 | if (acpi_ec_polling_mode) | ||
853 | return acpi_ec_gpe_polling_handler(data); | ||
854 | else | ||
855 | return acpi_ec_gpe_burst_handler(data); | ||
856 | } | ||
857 | static u32 | ||
858 | acpi_ec_gpe_polling_handler ( | ||
859 | void *data) | ||
860 | { | ||
861 | acpi_status status = AE_OK; | ||
862 | union acpi_ec *ec = (union acpi_ec *) data; | ||
863 | |||
864 | if (!ec) | ||
865 | return ACPI_INTERRUPT_NOT_HANDLED; | ||
866 | |||
867 | acpi_disable_gpe(NULL, ec->common.gpe_bit, ACPI_ISR); | ||
868 | |||
869 | status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, | ||
870 | acpi_ec_gpe_query, ec); | ||
871 | |||
872 | if (status == AE_OK) | ||
873 | return ACPI_INTERRUPT_HANDLED; | ||
874 | else | ||
875 | return ACPI_INTERRUPT_NOT_HANDLED; | ||
876 | } | ||
877 | static u32 | ||
878 | acpi_ec_gpe_burst_handler ( | ||
879 | void *data) | ||
880 | { | ||
510 | acpi_status status = AE_OK; | 881 | acpi_status status = AE_OK; |
511 | u32 value; | 882 | u32 value; |
512 | struct acpi_ec *ec = (struct acpi_ec *) data; | 883 | union acpi_ec *ec = (union acpi_ec *) data; |
513 | 884 | ||
514 | if (!ec) | 885 | if (!ec) |
515 | return ACPI_INTERRUPT_NOT_HANDLED; | 886 | return ACPI_INTERRUPT_NOT_HANDLED; |
516 | 887 | ||
517 | acpi_disable_gpe(NULL, ec->gpe_bit, ACPI_ISR); | 888 | acpi_disable_gpe(NULL, ec->common.gpe_bit, ACPI_ISR); |
518 | 889 | ||
519 | value = acpi_ec_read_status(ec); | 890 | value = acpi_ec_read_status(ec); |
520 | 891 | ||
521 | if((value & ACPI_EC_FLAG_IBF) && | 892 | if((value & ACPI_EC_FLAG_IBF) && |
522 | !(value & ACPI_EC_FLAG_BURST) && | 893 | !(value & ACPI_EC_FLAG_BURST) && |
523 | (atomic_read(&ec->leaving_burst) == 0)) { | 894 | (atomic_read(&ec->burst.leaving_burst) == 0)) { |
524 | /* | 895 | /* |
525 | * the embedded controller disables | 896 | * the embedded controller disables |
526 | * burst mode for any reason other | 897 | * burst mode for any reason other |
527 | * than the burst disable command | 898 | * than the burst disable command |
528 | * to process critical event. | 899 | * to process critical event. |
529 | */ | 900 | */ |
530 | atomic_set(&ec->leaving_burst , 2); /* block current pending transaction | 901 | atomic_set(&ec->burst.leaving_burst , 2); /* block current pending transaction |
531 | and retry */ | 902 | and retry */ |
532 | wake_up(&ec->wait); | 903 | wake_up(&ec->burst.wait); |
533 | }else { | 904 | }else { |
534 | if ((ec->expect_event == ACPI_EC_EVENT_OBF && | 905 | if ((ec->burst.expect_event == ACPI_EC_EVENT_OBF && |
535 | (value & ACPI_EC_FLAG_OBF)) || | 906 | (value & ACPI_EC_FLAG_OBF)) || |
536 | (ec->expect_event == ACPI_EC_EVENT_IBE && | 907 | (ec->burst.expect_event == ACPI_EC_EVENT_IBE && |
537 | !(value & ACPI_EC_FLAG_IBF))) { | 908 | !(value & ACPI_EC_FLAG_IBF))) { |
538 | ec->expect_event = 0; | 909 | ec->burst.expect_event = 0; |
539 | wake_up(&ec->wait); | 910 | wake_up(&ec->burst.wait); |
540 | return ACPI_INTERRUPT_HANDLED; | 911 | return ACPI_INTERRUPT_HANDLED; |
541 | } | 912 | } |
542 | } | 913 | } |
543 | 914 | ||
544 | if (value & ACPI_EC_FLAG_SCI){ | 915 | if (value & ACPI_EC_FLAG_SCI){ |
545 | atomic_add(1, &ec->pending_gpe) ; | 916 | atomic_add(1, &ec->burst.pending_gpe) ; |
546 | status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, | 917 | status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, |
547 | acpi_ec_gpe_query, ec); | 918 | acpi_ec_gpe_query, ec); |
548 | return status == AE_OK ? | 919 | return status == AE_OK ? |
549 | ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED; | 920 | ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED; |
550 | } | 921 | } |
551 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_ISR); | 922 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_ISR); |
552 | return status == AE_OK ? | 923 | return status == AE_OK ? |
553 | ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED; | 924 | ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED; |
554 | } | 925 | } |
@@ -585,7 +956,7 @@ acpi_ec_space_handler ( | |||
585 | void *region_context) | 956 | void *region_context) |
586 | { | 957 | { |
587 | int result = 0; | 958 | int result = 0; |
588 | struct acpi_ec *ec = NULL; | 959 | union acpi_ec *ec = NULL; |
589 | u64 temp = *value; | 960 | u64 temp = *value; |
590 | acpi_integer f_v = 0; | 961 | acpi_integer f_v = 0; |
591 | int i = 0; | 962 | int i = 0; |
@@ -600,7 +971,7 @@ acpi_ec_space_handler ( | |||
600 | return_VALUE(AE_BAD_PARAMETER); | 971 | return_VALUE(AE_BAD_PARAMETER); |
601 | } | 972 | } |
602 | 973 | ||
603 | ec = (struct acpi_ec *) handler_context; | 974 | ec = (union acpi_ec *) handler_context; |
604 | 975 | ||
605 | next_byte: | 976 | next_byte: |
606 | switch (function) { | 977 | switch (function) { |
@@ -661,7 +1032,7 @@ static struct proc_dir_entry *acpi_ec_dir; | |||
661 | static int | 1032 | static int |
662 | acpi_ec_read_info (struct seq_file *seq, void *offset) | 1033 | acpi_ec_read_info (struct seq_file *seq, void *offset) |
663 | { | 1034 | { |
664 | struct acpi_ec *ec = (struct acpi_ec *) seq->private; | 1035 | union acpi_ec *ec = (union acpi_ec *) seq->private; |
665 | 1036 | ||
666 | ACPI_FUNCTION_TRACE("acpi_ec_read_info"); | 1037 | ACPI_FUNCTION_TRACE("acpi_ec_read_info"); |
667 | 1038 | ||
@@ -669,12 +1040,12 @@ acpi_ec_read_info (struct seq_file *seq, void *offset) | |||
669 | goto end; | 1040 | goto end; |
670 | 1041 | ||
671 | seq_printf(seq, "gpe bit: 0x%02x\n", | 1042 | seq_printf(seq, "gpe bit: 0x%02x\n", |
672 | (u32) ec->gpe_bit); | 1043 | (u32) ec->common.gpe_bit); |
673 | seq_printf(seq, "ports: 0x%02x, 0x%02x\n", | 1044 | seq_printf(seq, "ports: 0x%02x, 0x%02x\n", |
674 | (u32) ec->status_addr.address, (u32) ec->data_addr.address); | 1045 | (u32) ec->common.status_addr.address, (u32) ec->common.data_addr.address); |
675 | seq_printf(seq, "use global lock: %s\n", | 1046 | seq_printf(seq, "use global lock: %s\n", |
676 | ec->global_lock?"yes":"no"); | 1047 | ec->common.global_lock?"yes":"no"); |
677 | acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); | 1048 | acpi_enable_gpe(NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
678 | 1049 | ||
679 | end: | 1050 | end: |
680 | return_VALUE(0); | 1051 | return_VALUE(0); |
@@ -697,7 +1068,7 @@ static int | |||
697 | acpi_ec_add_fs ( | 1068 | acpi_ec_add_fs ( |
698 | struct acpi_device *device) | 1069 | struct acpi_device *device) |
699 | { | 1070 | { |
700 | struct proc_dir_entry *entry; | 1071 | struct proc_dir_entry *entry = NULL; |
701 | 1072 | ||
702 | ACPI_FUNCTION_TRACE("acpi_ec_add_fs"); | 1073 | ACPI_FUNCTION_TRACE("acpi_ec_add_fs"); |
703 | 1074 | ||
@@ -744,13 +1115,14 @@ acpi_ec_remove_fs ( | |||
744 | Driver Interface | 1115 | Driver Interface |
745 | -------------------------------------------------------------------------- */ | 1116 | -------------------------------------------------------------------------- */ |
746 | 1117 | ||
1118 | |||
747 | static int | 1119 | static int |
748 | acpi_ec_add ( | 1120 | acpi_ec_polling_add ( |
749 | struct acpi_device *device) | 1121 | struct acpi_device *device) |
750 | { | 1122 | { |
751 | int result; | 1123 | int result = 0; |
752 | acpi_status status; | 1124 | acpi_status status = AE_OK; |
753 | struct acpi_ec *ec; | 1125 | union acpi_ec *ec = NULL; |
754 | unsigned long uid; | 1126 | unsigned long uid; |
755 | 1127 | ||
756 | ACPI_FUNCTION_TRACE("acpi_ec_add"); | 1128 | ACPI_FUNCTION_TRACE("acpi_ec_add"); |
@@ -758,39 +1130,107 @@ acpi_ec_add ( | |||
758 | if (!device) | 1130 | if (!device) |
759 | return_VALUE(-EINVAL); | 1131 | return_VALUE(-EINVAL); |
760 | 1132 | ||
761 | ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); | 1133 | ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); |
762 | if (!ec) | 1134 | if (!ec) |
763 | return_VALUE(-ENOMEM); | 1135 | return_VALUE(-ENOMEM); |
764 | memset(ec, 0, sizeof(struct acpi_ec)); | 1136 | memset(ec, 0, sizeof(union acpi_ec)); |
765 | 1137 | ||
766 | ec->handle = device->handle; | 1138 | ec->common.handle = device->handle; |
767 | ec->uid = -1; | 1139 | ec->common.uid = -1; |
768 | atomic_set(&ec->pending_gpe, 0); | 1140 | spin_lock_init(&ec->polling.lock); |
769 | atomic_set(&ec->leaving_burst , 1); | ||
770 | init_MUTEX(&ec->sem); | ||
771 | init_waitqueue_head(&ec->wait); | ||
772 | strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); | 1141 | strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); |
773 | strcpy(acpi_device_class(device), ACPI_EC_CLASS); | 1142 | strcpy(acpi_device_class(device), ACPI_EC_CLASS); |
774 | acpi_driver_data(device) = ec; | 1143 | acpi_driver_data(device) = ec; |
775 | 1144 | ||
776 | /* Use the global lock for all EC transactions? */ | 1145 | /* Use the global lock for all EC transactions? */ |
777 | acpi_evaluate_integer(ec->handle, "_GLK", NULL, &ec->global_lock); | 1146 | acpi_evaluate_integer(ec->common.handle, "_GLK", NULL, &ec->common.global_lock); |
778 | 1147 | ||
779 | /* If our UID matches the UID for the ECDT-enumerated EC, | 1148 | /* If our UID matches the UID for the ECDT-enumerated EC, |
780 | we now have the *real* EC info, so kill the makeshift one.*/ | 1149 | we now have the *real* EC info, so kill the makeshift one.*/ |
781 | acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid); | 1150 | acpi_evaluate_integer(ec->common.handle, "_UID", NULL, &uid); |
782 | if (ec_ecdt && ec_ecdt->uid == uid) { | 1151 | if (ec_ecdt && ec_ecdt->common.uid == uid) { |
783 | acpi_remove_address_space_handler(ACPI_ROOT_OBJECT, | 1152 | acpi_remove_address_space_handler(ACPI_ROOT_OBJECT, |
784 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); | 1153 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); |
1154 | |||
1155 | acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit, &acpi_ec_gpe_handler); | ||
1156 | |||
1157 | kfree(ec_ecdt); | ||
1158 | } | ||
1159 | |||
1160 | /* Get GPE bit assignment (EC events). */ | ||
1161 | /* TODO: Add support for _GPE returning a package */ | ||
1162 | status = acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, &ec->common.gpe_bit); | ||
1163 | if (ACPI_FAILURE(status)) { | ||
1164 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | ||
1165 | "Error obtaining GPE bit assignment\n")); | ||
1166 | result = -ENODEV; | ||
1167 | goto end; | ||
1168 | } | ||
785 | 1169 | ||
786 | acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit, &acpi_ec_gpe_handler); | 1170 | result = acpi_ec_add_fs(device); |
1171 | if (result) | ||
1172 | goto end; | ||
1173 | |||
1174 | printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n", | ||
1175 | acpi_device_name(device), acpi_device_bid(device), | ||
1176 | (u32) ec->common.gpe_bit); | ||
1177 | |||
1178 | if (!first_ec) | ||
1179 | first_ec = device; | ||
1180 | |||
1181 | end: | ||
1182 | if (result) | ||
1183 | kfree(ec); | ||
1184 | |||
1185 | return_VALUE(result); | ||
1186 | } | ||
1187 | static int | ||
1188 | acpi_ec_burst_add ( | ||
1189 | struct acpi_device *device) | ||
1190 | { | ||
1191 | int result = 0; | ||
1192 | acpi_status status = AE_OK; | ||
1193 | union acpi_ec *ec = NULL; | ||
1194 | unsigned long uid; | ||
1195 | |||
1196 | ACPI_FUNCTION_TRACE("acpi_ec_add"); | ||
1197 | |||
1198 | if (!device) | ||
1199 | return_VALUE(-EINVAL); | ||
1200 | |||
1201 | ec = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); | ||
1202 | if (!ec) | ||
1203 | return_VALUE(-ENOMEM); | ||
1204 | memset(ec, 0, sizeof(union acpi_ec)); | ||
1205 | |||
1206 | ec->common.handle = device->handle; | ||
1207 | ec->common.uid = -1; | ||
1208 | atomic_set(&ec->burst.pending_gpe, 0); | ||
1209 | atomic_set(&ec->burst.leaving_burst , 1); | ||
1210 | init_MUTEX(&ec->burst.sem); | ||
1211 | init_waitqueue_head(&ec->burst.wait); | ||
1212 | strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); | ||
1213 | strcpy(acpi_device_class(device), ACPI_EC_CLASS); | ||
1214 | acpi_driver_data(device) = ec; | ||
1215 | |||
1216 | /* Use the global lock for all EC transactions? */ | ||
1217 | acpi_evaluate_integer(ec->common.handle, "_GLK", NULL, &ec->common.global_lock); | ||
1218 | |||
1219 | /* If our UID matches the UID for the ECDT-enumerated EC, | ||
1220 | we now have the *real* EC info, so kill the makeshift one.*/ | ||
1221 | acpi_evaluate_integer(ec->common.handle, "_UID", NULL, &uid); | ||
1222 | if (ec_ecdt && ec_ecdt->common.uid == uid) { | ||
1223 | acpi_remove_address_space_handler(ACPI_ROOT_OBJECT, | ||
1224 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); | ||
1225 | |||
1226 | acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit, &acpi_ec_gpe_handler); | ||
787 | 1227 | ||
788 | kfree(ec_ecdt); | 1228 | kfree(ec_ecdt); |
789 | } | 1229 | } |
790 | 1230 | ||
791 | /* Get GPE bit assignment (EC events). */ | 1231 | /* Get GPE bit assignment (EC events). */ |
792 | /* TODO: Add support for _GPE returning a package */ | 1232 | /* TODO: Add support for _GPE returning a package */ |
793 | status = acpi_evaluate_integer(ec->handle, "_GPE", NULL, &ec->gpe_bit); | 1233 | status = acpi_evaluate_integer(ec->common.handle, "_GPE", NULL, &ec->common.gpe_bit); |
794 | if (ACPI_FAILURE(status)) { | 1234 | if (ACPI_FAILURE(status)) { |
795 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 1235 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
796 | "Error obtaining GPE bit assignment\n")); | 1236 | "Error obtaining GPE bit assignment\n")); |
@@ -804,7 +1244,7 @@ acpi_ec_add ( | |||
804 | 1244 | ||
805 | printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n", | 1245 | printk(KERN_INFO PREFIX "%s [%s] (gpe %d)\n", |
806 | acpi_device_name(device), acpi_device_bid(device), | 1246 | acpi_device_name(device), acpi_device_bid(device), |
807 | (u32) ec->gpe_bit); | 1247 | (u32) ec->common.gpe_bit); |
808 | 1248 | ||
809 | if (!first_ec) | 1249 | if (!first_ec) |
810 | first_ec = device; | 1250 | first_ec = device; |
@@ -822,7 +1262,7 @@ acpi_ec_remove ( | |||
822 | struct acpi_device *device, | 1262 | struct acpi_device *device, |
823 | int type) | 1263 | int type) |
824 | { | 1264 | { |
825 | struct acpi_ec *ec; | 1265 | union acpi_ec *ec = NULL; |
826 | 1266 | ||
827 | ACPI_FUNCTION_TRACE("acpi_ec_remove"); | 1267 | ACPI_FUNCTION_TRACE("acpi_ec_remove"); |
828 | 1268 | ||
@@ -844,7 +1284,7 @@ acpi_ec_io_ports ( | |||
844 | struct acpi_resource *resource, | 1284 | struct acpi_resource *resource, |
845 | void *context) | 1285 | void *context) |
846 | { | 1286 | { |
847 | struct acpi_ec *ec = (struct acpi_ec *) context; | 1287 | union acpi_ec *ec = (union acpi_ec *) context; |
848 | struct acpi_generic_address *addr; | 1288 | struct acpi_generic_address *addr; |
849 | 1289 | ||
850 | if (resource->id != ACPI_RSTYPE_IO) { | 1290 | if (resource->id != ACPI_RSTYPE_IO) { |
@@ -856,10 +1296,10 @@ acpi_ec_io_ports ( | |||
856 | * the second address region returned is the status/command | 1296 | * the second address region returned is the status/command |
857 | * port. | 1297 | * port. |
858 | */ | 1298 | */ |
859 | if (ec->data_addr.register_bit_width == 0) { | 1299 | if (ec->common.data_addr.register_bit_width == 0) { |
860 | addr = &ec->data_addr; | 1300 | addr = &ec->common.data_addr; |
861 | } else if (ec->command_addr.register_bit_width == 0) { | 1301 | } else if (ec->common.command_addr.register_bit_width == 0) { |
862 | addr = &ec->command_addr; | 1302 | addr = &ec->common.command_addr; |
863 | } else { | 1303 | } else { |
864 | return AE_CTRL_TERMINATE; | 1304 | return AE_CTRL_TERMINATE; |
865 | } | 1305 | } |
@@ -877,8 +1317,8 @@ static int | |||
877 | acpi_ec_start ( | 1317 | acpi_ec_start ( |
878 | struct acpi_device *device) | 1318 | struct acpi_device *device) |
879 | { | 1319 | { |
880 | acpi_status status; | 1320 | acpi_status status = AE_OK; |
881 | struct acpi_ec *ec; | 1321 | union acpi_ec *ec = NULL; |
882 | 1322 | ||
883 | ACPI_FUNCTION_TRACE("acpi_ec_start"); | 1323 | ACPI_FUNCTION_TRACE("acpi_ec_start"); |
884 | 1324 | ||
@@ -893,35 +1333,36 @@ acpi_ec_start ( | |||
893 | /* | 1333 | /* |
894 | * Get I/O port addresses. Convert to GAS format. | 1334 | * Get I/O port addresses. Convert to GAS format. |
895 | */ | 1335 | */ |
896 | status = acpi_walk_resources(ec->handle, METHOD_NAME__CRS, | 1336 | status = acpi_walk_resources(ec->common.handle, METHOD_NAME__CRS, |
897 | acpi_ec_io_ports, ec); | 1337 | acpi_ec_io_ports, ec); |
898 | if (ACPI_FAILURE(status) || ec->command_addr.register_bit_width == 0) { | 1338 | if (ACPI_FAILURE(status) || ec->common.command_addr.register_bit_width == 0) { |
899 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error getting I/O port addresses")); | 1339 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error getting I/O port addresses")); |
900 | return_VALUE(-ENODEV); | 1340 | return_VALUE(-ENODEV); |
901 | } | 1341 | } |
902 | 1342 | ||
903 | ec->status_addr = ec->command_addr; | 1343 | ec->common.status_addr = ec->common.command_addr; |
904 | 1344 | ||
905 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02x, ports=0x%2x,0x%2x\n", | 1345 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02x, ports=0x%2x,0x%2x\n", |
906 | (u32) ec->gpe_bit, (u32) ec->command_addr.address, | 1346 | (u32) ec->common.gpe_bit, (u32) ec->common.command_addr.address, |
907 | (u32) ec->data_addr.address)); | 1347 | (u32) ec->common.data_addr.address)); |
1348 | |||
908 | 1349 | ||
909 | /* | 1350 | /* |
910 | * Install GPE handler | 1351 | * Install GPE handler |
911 | */ | 1352 | */ |
912 | status = acpi_install_gpe_handler(NULL, ec->gpe_bit, | 1353 | status = acpi_install_gpe_handler(NULL, ec->common.gpe_bit, |
913 | ACPI_GPE_EDGE_TRIGGERED, &acpi_ec_gpe_handler, ec); | 1354 | ACPI_GPE_EDGE_TRIGGERED, &acpi_ec_gpe_handler, ec); |
914 | if (ACPI_FAILURE(status)) { | 1355 | if (ACPI_FAILURE(status)) { |
915 | return_VALUE(-ENODEV); | 1356 | return_VALUE(-ENODEV); |
916 | } | 1357 | } |
917 | acpi_set_gpe_type (NULL, ec->gpe_bit, ACPI_GPE_TYPE_RUNTIME); | 1358 | acpi_set_gpe_type (NULL, ec->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME); |
918 | acpi_enable_gpe (NULL, ec->gpe_bit, ACPI_NOT_ISR); | 1359 | acpi_enable_gpe (NULL, ec->common.gpe_bit, ACPI_NOT_ISR); |
919 | 1360 | ||
920 | status = acpi_install_address_space_handler (ec->handle, | 1361 | status = acpi_install_address_space_handler (ec->common.handle, |
921 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, | 1362 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, |
922 | &acpi_ec_space_setup, ec); | 1363 | &acpi_ec_space_setup, ec); |
923 | if (ACPI_FAILURE(status)) { | 1364 | if (ACPI_FAILURE(status)) { |
924 | acpi_remove_gpe_handler(NULL, ec->gpe_bit, &acpi_ec_gpe_handler); | 1365 | acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, &acpi_ec_gpe_handler); |
925 | return_VALUE(-ENODEV); | 1366 | return_VALUE(-ENODEV); |
926 | } | 1367 | } |
927 | 1368 | ||
@@ -934,8 +1375,8 @@ acpi_ec_stop ( | |||
934 | struct acpi_device *device, | 1375 | struct acpi_device *device, |
935 | int type) | 1376 | int type) |
936 | { | 1377 | { |
937 | acpi_status status; | 1378 | acpi_status status = AE_OK; |
938 | struct acpi_ec *ec; | 1379 | union acpi_ec *ec = NULL; |
939 | 1380 | ||
940 | ACPI_FUNCTION_TRACE("acpi_ec_stop"); | 1381 | ACPI_FUNCTION_TRACE("acpi_ec_stop"); |
941 | 1382 | ||
@@ -944,12 +1385,12 @@ acpi_ec_stop ( | |||
944 | 1385 | ||
945 | ec = acpi_driver_data(device); | 1386 | ec = acpi_driver_data(device); |
946 | 1387 | ||
947 | status = acpi_remove_address_space_handler(ec->handle, | 1388 | status = acpi_remove_address_space_handler(ec->common.handle, |
948 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); | 1389 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler); |
949 | if (ACPI_FAILURE(status)) | 1390 | if (ACPI_FAILURE(status)) |
950 | return_VALUE(-ENODEV); | 1391 | return_VALUE(-ENODEV); |
951 | 1392 | ||
952 | status = acpi_remove_gpe_handler(NULL, ec->gpe_bit, &acpi_ec_gpe_handler); | 1393 | status = acpi_remove_gpe_handler(NULL, ec->common.gpe_bit, &acpi_ec_gpe_handler); |
953 | if (ACPI_FAILURE(status)) | 1394 | if (ACPI_FAILURE(status)) |
954 | return_VALUE(-ENODEV); | 1395 | return_VALUE(-ENODEV); |
955 | 1396 | ||
@@ -963,26 +1404,76 @@ acpi_fake_ecdt_callback ( | |||
963 | void *context, | 1404 | void *context, |
964 | void **retval) | 1405 | void **retval) |
965 | { | 1406 | { |
1407 | |||
1408 | if (acpi_ec_polling_mode) | ||
1409 | return acpi_fake_ecdt_polling_callback(handle, | ||
1410 | Level, context, retval); | ||
1411 | else | ||
1412 | return acpi_fake_ecdt_burst_callback(handle, | ||
1413 | Level, context, retval); | ||
1414 | } | ||
1415 | |||
1416 | static acpi_status __init | ||
1417 | acpi_fake_ecdt_polling_callback ( | ||
1418 | acpi_handle handle, | ||
1419 | u32 Level, | ||
1420 | void *context, | ||
1421 | void **retval) | ||
1422 | { | ||
966 | acpi_status status; | 1423 | acpi_status status; |
967 | 1424 | ||
968 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | 1425 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, |
969 | acpi_ec_io_ports, ec_ecdt); | 1426 | acpi_ec_io_ports, ec_ecdt); |
970 | if (ACPI_FAILURE(status)) | 1427 | if (ACPI_FAILURE(status)) |
971 | return status; | 1428 | return status; |
972 | ec_ecdt->status_addr = ec_ecdt->command_addr; | 1429 | ec_ecdt->common.status_addr = ec_ecdt->common.command_addr; |
973 | 1430 | ||
974 | ec_ecdt->uid = -1; | 1431 | ec_ecdt->common.uid = -1; |
975 | acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->uid); | 1432 | acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->common.uid); |
976 | 1433 | ||
977 | status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->gpe_bit); | 1434 | status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->common.gpe_bit); |
978 | if (ACPI_FAILURE(status)) | 1435 | if (ACPI_FAILURE(status)) |
979 | return status; | 1436 | return status; |
980 | ec_ecdt->global_lock = TRUE; | 1437 | spin_lock_init(&ec_ecdt->polling.lock); |
981 | ec_ecdt->handle = handle; | 1438 | ec_ecdt->common.global_lock = TRUE; |
1439 | ec_ecdt->common.handle = handle; | ||
982 | 1440 | ||
983 | printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n", | 1441 | printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n", |
984 | (u32) ec_ecdt->gpe_bit, (u32) ec_ecdt->command_addr.address, | 1442 | (u32) ec_ecdt->common.gpe_bit, (u32) ec_ecdt->common.command_addr.address, |
985 | (u32) ec_ecdt->data_addr.address); | 1443 | (u32) ec_ecdt->common.data_addr.address); |
1444 | |||
1445 | return AE_CTRL_TERMINATE; | ||
1446 | } | ||
1447 | |||
1448 | static acpi_status __init | ||
1449 | acpi_fake_ecdt_burst_callback ( | ||
1450 | acpi_handle handle, | ||
1451 | u32 Level, | ||
1452 | void *context, | ||
1453 | void **retval) | ||
1454 | { | ||
1455 | acpi_status status; | ||
1456 | |||
1457 | init_MUTEX(&ec_ecdt->burst.sem); | ||
1458 | init_waitqueue_head(&ec_ecdt->burst.wait); | ||
1459 | status = acpi_walk_resources(handle, METHOD_NAME__CRS, | ||
1460 | acpi_ec_io_ports, ec_ecdt); | ||
1461 | if (ACPI_FAILURE(status)) | ||
1462 | return status; | ||
1463 | ec_ecdt->common.status_addr = ec_ecdt->common.command_addr; | ||
1464 | |||
1465 | ec_ecdt->common.uid = -1; | ||
1466 | acpi_evaluate_integer(handle, "_UID", NULL, &ec_ecdt->common.uid); | ||
1467 | |||
1468 | status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec_ecdt->common.gpe_bit); | ||
1469 | if (ACPI_FAILURE(status)) | ||
1470 | return status; | ||
1471 | ec_ecdt->common.global_lock = TRUE; | ||
1472 | ec_ecdt->common.handle = handle; | ||
1473 | |||
1474 | printk(KERN_INFO PREFIX "GPE=0x%02x, ports=0x%2x, 0x%2x\n", | ||
1475 | (u32) ec_ecdt->common.gpe_bit, (u32) ec_ecdt->common.command_addr.address, | ||
1476 | (u32) ec_ecdt->common.data_addr.address); | ||
986 | 1477 | ||
987 | return AE_CTRL_TERMINATE; | 1478 | return AE_CTRL_TERMINATE; |
988 | } | 1479 | } |
@@ -1005,12 +1496,12 @@ acpi_ec_fake_ecdt(void) | |||
1005 | 1496 | ||
1006 | printk(KERN_INFO PREFIX "Try to make an fake ECDT\n"); | 1497 | printk(KERN_INFO PREFIX "Try to make an fake ECDT\n"); |
1007 | 1498 | ||
1008 | ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); | 1499 | ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); |
1009 | if (!ec_ecdt) { | 1500 | if (!ec_ecdt) { |
1010 | ret = -ENOMEM; | 1501 | ret = -ENOMEM; |
1011 | goto error; | 1502 | goto error; |
1012 | } | 1503 | } |
1013 | memset(ec_ecdt, 0, sizeof(struct acpi_ec)); | 1504 | memset(ec_ecdt, 0, sizeof(union acpi_ec)); |
1014 | 1505 | ||
1015 | status = acpi_get_devices (ACPI_EC_HID, | 1506 | status = acpi_get_devices (ACPI_EC_HID, |
1016 | acpi_fake_ecdt_callback, | 1507 | acpi_fake_ecdt_callback, |
@@ -1031,6 +1522,60 @@ error: | |||
1031 | static int __init | 1522 | static int __init |
1032 | acpi_ec_get_real_ecdt(void) | 1523 | acpi_ec_get_real_ecdt(void) |
1033 | { | 1524 | { |
1525 | if (acpi_ec_polling_mode) | ||
1526 | return acpi_ec_polling_get_real_ecdt(); | ||
1527 | else | ||
1528 | return acpi_ec_burst_get_real_ecdt(); | ||
1529 | } | ||
1530 | |||
1531 | static int __init | ||
1532 | acpi_ec_polling_get_real_ecdt(void) | ||
1533 | { | ||
1534 | acpi_status status; | ||
1535 | struct acpi_table_ecdt *ecdt_ptr; | ||
1536 | |||
1537 | status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING, | ||
1538 | (struct acpi_table_header **) &ecdt_ptr); | ||
1539 | if (ACPI_FAILURE(status)) | ||
1540 | return -ENODEV; | ||
1541 | |||
1542 | printk(KERN_INFO PREFIX "Found ECDT\n"); | ||
1543 | |||
1544 | /* | ||
1545 | * Generate a temporary ec context to use until the namespace is scanned | ||
1546 | */ | ||
1547 | ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); | ||
1548 | if (!ec_ecdt) | ||
1549 | return -ENOMEM; | ||
1550 | memset(ec_ecdt, 0, sizeof(union acpi_ec)); | ||
1551 | |||
1552 | ec_ecdt->common.command_addr = ecdt_ptr->ec_control; | ||
1553 | ec_ecdt->common.status_addr = ecdt_ptr->ec_control; | ||
1554 | ec_ecdt->common.data_addr = ecdt_ptr->ec_data; | ||
1555 | ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit; | ||
1556 | spin_lock_init(&ec_ecdt->polling.lock); | ||
1557 | /* use the GL just to be safe */ | ||
1558 | ec_ecdt->common.global_lock = TRUE; | ||
1559 | ec_ecdt->common.uid = ecdt_ptr->uid; | ||
1560 | |||
1561 | status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->common.handle); | ||
1562 | if (ACPI_FAILURE(status)) { | ||
1563 | goto error; | ||
1564 | } | ||
1565 | |||
1566 | return 0; | ||
1567 | error: | ||
1568 | printk(KERN_ERR PREFIX "Could not use ECDT\n"); | ||
1569 | kfree(ec_ecdt); | ||
1570 | ec_ecdt = NULL; | ||
1571 | |||
1572 | return -ENODEV; | ||
1573 | } | ||
1574 | |||
1575 | |||
1576 | static int __init | ||
1577 | acpi_ec_burst_get_real_ecdt(void) | ||
1578 | { | ||
1034 | acpi_status status; | 1579 | acpi_status status; |
1035 | struct acpi_table_ecdt *ecdt_ptr; | 1580 | struct acpi_table_ecdt *ecdt_ptr; |
1036 | 1581 | ||
@@ -1044,22 +1589,22 @@ acpi_ec_get_real_ecdt(void) | |||
1044 | /* | 1589 | /* |
1045 | * Generate a temporary ec context to use until the namespace is scanned | 1590 | * Generate a temporary ec context to use until the namespace is scanned |
1046 | */ | 1591 | */ |
1047 | ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); | 1592 | ec_ecdt = kmalloc(sizeof(union acpi_ec), GFP_KERNEL); |
1048 | if (!ec_ecdt) | 1593 | if (!ec_ecdt) |
1049 | return -ENOMEM; | 1594 | return -ENOMEM; |
1050 | memset(ec_ecdt, 0, sizeof(struct acpi_ec)); | 1595 | memset(ec_ecdt, 0, sizeof(union acpi_ec)); |
1051 | 1596 | ||
1052 | init_MUTEX(&ec_ecdt->sem); | 1597 | init_MUTEX(&ec_ecdt->burst.sem); |
1053 | init_waitqueue_head(&ec_ecdt->wait); | 1598 | init_waitqueue_head(&ec_ecdt->burst.wait); |
1054 | ec_ecdt->command_addr = ecdt_ptr->ec_control; | 1599 | ec_ecdt->common.command_addr = ecdt_ptr->ec_control; |
1055 | ec_ecdt->status_addr = ecdt_ptr->ec_control; | 1600 | ec_ecdt->common.status_addr = ecdt_ptr->ec_control; |
1056 | ec_ecdt->data_addr = ecdt_ptr->ec_data; | 1601 | ec_ecdt->common.data_addr = ecdt_ptr->ec_data; |
1057 | ec_ecdt->gpe_bit = ecdt_ptr->gpe_bit; | 1602 | ec_ecdt->common.gpe_bit = ecdt_ptr->gpe_bit; |
1058 | /* use the GL just to be safe */ | 1603 | /* use the GL just to be safe */ |
1059 | ec_ecdt->global_lock = TRUE; | 1604 | ec_ecdt->common.global_lock = TRUE; |
1060 | ec_ecdt->uid = ecdt_ptr->uid; | 1605 | ec_ecdt->common.uid = ecdt_ptr->uid; |
1061 | 1606 | ||
1062 | status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle); | 1607 | status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->common.handle); |
1063 | if (ACPI_FAILURE(status)) { | 1608 | if (ACPI_FAILURE(status)) { |
1064 | goto error; | 1609 | goto error; |
1065 | } | 1610 | } |
@@ -1092,20 +1637,20 @@ acpi_ec_ecdt_probe (void) | |||
1092 | /* | 1637 | /* |
1093 | * Install GPE handler | 1638 | * Install GPE handler |
1094 | */ | 1639 | */ |
1095 | status = acpi_install_gpe_handler(NULL, ec_ecdt->gpe_bit, | 1640 | status = acpi_install_gpe_handler(NULL, ec_ecdt->common.gpe_bit, |
1096 | ACPI_GPE_EDGE_TRIGGERED, &acpi_ec_gpe_handler, | 1641 | ACPI_GPE_EDGE_TRIGGERED, &acpi_ec_gpe_handler, |
1097 | ec_ecdt); | 1642 | ec_ecdt); |
1098 | if (ACPI_FAILURE(status)) { | 1643 | if (ACPI_FAILURE(status)) { |
1099 | goto error; | 1644 | goto error; |
1100 | } | 1645 | } |
1101 | acpi_set_gpe_type (NULL, ec_ecdt->gpe_bit, ACPI_GPE_TYPE_RUNTIME); | 1646 | acpi_set_gpe_type (NULL, ec_ecdt->common.gpe_bit, ACPI_GPE_TYPE_RUNTIME); |
1102 | acpi_enable_gpe (NULL, ec_ecdt->gpe_bit, ACPI_NOT_ISR); | 1647 | acpi_enable_gpe (NULL, ec_ecdt->common.gpe_bit, ACPI_NOT_ISR); |
1103 | 1648 | ||
1104 | status = acpi_install_address_space_handler (ACPI_ROOT_OBJECT, | 1649 | status = acpi_install_address_space_handler (ACPI_ROOT_OBJECT, |
1105 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, | 1650 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler, |
1106 | &acpi_ec_space_setup, ec_ecdt); | 1651 | &acpi_ec_space_setup, ec_ecdt); |
1107 | if (ACPI_FAILURE(status)) { | 1652 | if (ACPI_FAILURE(status)) { |
1108 | acpi_remove_gpe_handler(NULL, ec_ecdt->gpe_bit, | 1653 | acpi_remove_gpe_handler(NULL, ec_ecdt->common.gpe_bit, |
1109 | &acpi_ec_gpe_handler); | 1654 | &acpi_ec_gpe_handler); |
1110 | goto error; | 1655 | goto error; |
1111 | } | 1656 | } |
@@ -1123,7 +1668,7 @@ error: | |||
1123 | 1668 | ||
1124 | static int __init acpi_ec_init (void) | 1669 | static int __init acpi_ec_init (void) |
1125 | { | 1670 | { |
1126 | int result; | 1671 | int result = 0; |
1127 | 1672 | ||
1128 | ACPI_FUNCTION_TRACE("acpi_ec_init"); | 1673 | ACPI_FUNCTION_TRACE("acpi_ec_init"); |
1129 | 1674 | ||
@@ -1166,4 +1711,24 @@ static int __init acpi_fake_ecdt_setup(char *str) | |||
1166 | acpi_fake_ecdt_enabled = 1; | 1711 | acpi_fake_ecdt_enabled = 1; |
1167 | return 0; | 1712 | return 0; |
1168 | } | 1713 | } |
1714 | |||
1169 | __setup("acpi_fake_ecdt", acpi_fake_ecdt_setup); | 1715 | __setup("acpi_fake_ecdt", acpi_fake_ecdt_setup); |
1716 | static int __init acpi_ec_set_polling_mode(char *str) | ||
1717 | { | ||
1718 | int burst; | ||
1719 | |||
1720 | if (!get_option(&str, &burst)) | ||
1721 | return 0; | ||
1722 | |||
1723 | if (burst) { | ||
1724 | acpi_ec_polling_mode = EC_BURST; | ||
1725 | acpi_ec_driver.ops.add = acpi_ec_burst_add; | ||
1726 | } else { | ||
1727 | acpi_ec_polling_mode = EC_POLLING; | ||
1728 | acpi_ec_driver.ops.add = acpi_ec_polling_add; | ||
1729 | } | ||
1730 | printk(KERN_INFO PREFIX "EC %s mode.\n", | ||
1731 | burst ? "burst": "polling"); | ||
1732 | return 0; | ||
1733 | } | ||
1734 | __setup("ec_burst=", acpi_ec_set_polling_mode); | ||
diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c index babdf762eadb..1f76a40badec 100644 --- a/drivers/acpi/hotkey.c +++ b/drivers/acpi/hotkey.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * hotkey.c - ACPI Hotkey Driver ($Revision:$) | 2 | * hotkey.c - ACPI Hotkey Driver ($Revision: 0.2 $) |
3 | * | 3 | * |
4 | * Copyright (C) 2004 Luming Yu <luming.yu@intel.com> | 4 | * Copyright (C) 2004 Luming Yu <luming.yu@intel.com> |
5 | * | 5 | * |
@@ -51,17 +51,18 @@ | |||
51 | #define ACPI_HOTKEY_POLLING 0x2 | 51 | #define ACPI_HOTKEY_POLLING 0x2 |
52 | #define ACPI_UNDEFINED_EVENT 0xf | 52 | #define ACPI_UNDEFINED_EVENT 0xf |
53 | 53 | ||
54 | #define MAX_CONFIG_RECORD_LEN 80 | 54 | #define RESULT_STR_LEN 80 |
55 | #define MAX_NAME_PATH_LEN 80 | ||
56 | #define MAX_CALL_PARM 80 | ||
57 | 55 | ||
58 | #define IS_EVENT(e) 0xff /* ((e) & 0x40000000) */ | 56 | #define ACTION_METHOD 0 |
59 | #define IS_POLL(e) 0xff /* (~((e) & 0x40000000)) */ | 57 | #define POLL_METHOD 1 |
60 | 58 | ||
59 | #define IS_EVENT(e) ((e) <= 10000 && (e) >0) | ||
60 | #define IS_POLL(e) ((e) > 10000) | ||
61 | #define IS_OTHERS(e) ((e)<=0 || (e)>=20000) | ||
61 | #define _COMPONENT ACPI_HOTKEY_COMPONENT | 62 | #define _COMPONENT ACPI_HOTKEY_COMPONENT |
62 | ACPI_MODULE_NAME("acpi_hotkey") | 63 | ACPI_MODULE_NAME("acpi_hotkey") |
63 | 64 | ||
64 | MODULE_AUTHOR("luming.yu@intel.com"); | 65 | MODULE_AUTHOR("luming.yu@intel.com"); |
65 | MODULE_DESCRIPTION(ACPI_HOTK_NAME); | 66 | MODULE_DESCRIPTION(ACPI_HOTK_NAME); |
66 | MODULE_LICENSE("GPL"); | 67 | MODULE_LICENSE("GPL"); |
67 | 68 | ||
@@ -114,7 +115,7 @@ struct acpi_event_hotkey { | |||
114 | char *action_method; /* action method */ | 115 | char *action_method; /* action method */ |
115 | }; | 116 | }; |
116 | 117 | ||
117 | /* | 118 | /* |
118 | * There are two ways to poll status | 119 | * There are two ways to poll status |
119 | * 1. directy call read_xxx method, without any arguments passed in | 120 | * 1. directy call read_xxx method, without any arguments passed in |
120 | * 2. call write_xxx method, with arguments passed in, you need | 121 | * 2. call write_xxx method, with arguments passed in, you need |
@@ -131,7 +132,7 @@ struct acpi_polling_hotkey { | |||
131 | char *poll_method; /* poll method */ | 132 | char *poll_method; /* poll method */ |
132 | acpi_handle action_handle; /* acpi handle attached action method */ | 133 | acpi_handle action_handle; /* acpi handle attached action method */ |
133 | char *action_method; /* action method */ | 134 | char *action_method; /* action method */ |
134 | void *poll_result; /* polling_result */ | 135 | union acpi_object *poll_result; /* polling_result */ |
135 | struct proc_dir_entry *proc; | 136 | struct proc_dir_entry *proc; |
136 | }; | 137 | }; |
137 | 138 | ||
@@ -162,20 +163,25 @@ static struct acpi_driver hotkey_driver = { | |||
162 | }, | 163 | }, |
163 | }; | 164 | }; |
164 | 165 | ||
166 | static void free_hotkey_device(union acpi_hotkey *key); | ||
167 | static void free_hotkey_buffer(union acpi_hotkey *key); | ||
168 | static void free_poll_hotkey_buffer(union acpi_hotkey *key); | ||
165 | static int hotkey_open_config(struct inode *inode, struct file *file); | 169 | static int hotkey_open_config(struct inode *inode, struct file *file); |
170 | static int hotkey_poll_open_config(struct inode *inode, struct file *file); | ||
166 | static ssize_t hotkey_write_config(struct file *file, | 171 | static ssize_t hotkey_write_config(struct file *file, |
167 | const char __user * buffer, | 172 | const char __user * buffer, |
168 | size_t count, loff_t * data); | 173 | size_t count, loff_t * data); |
169 | static ssize_t hotkey_write_poll_config(struct file *file, | ||
170 | const char __user * buffer, | ||
171 | size_t count, loff_t * data); | ||
172 | static int hotkey_info_open_fs(struct inode *inode, struct file *file); | 174 | static int hotkey_info_open_fs(struct inode *inode, struct file *file); |
173 | static int hotkey_action_open_fs(struct inode *inode, struct file *file); | 175 | static int hotkey_action_open_fs(struct inode *inode, struct file *file); |
174 | static ssize_t hotkey_execute_aml_method(struct file *file, | 176 | static ssize_t hotkey_execute_aml_method(struct file *file, |
175 | const char __user * buffer, | 177 | const char __user * buffer, |
176 | size_t count, loff_t * data); | 178 | size_t count, loff_t * data); |
177 | static int hotkey_config_seq_show(struct seq_file *seq, void *offset); | 179 | static int hotkey_config_seq_show(struct seq_file *seq, void *offset); |
180 | static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset); | ||
178 | static int hotkey_polling_open_fs(struct inode *inode, struct file *file); | 181 | static int hotkey_polling_open_fs(struct inode *inode, struct file *file); |
182 | static union acpi_hotkey *get_hotkey_by_event(struct | ||
183 | acpi_hotkey_list | ||
184 | *hotkey_list, int event); | ||
179 | 185 | ||
180 | /* event based config */ | 186 | /* event based config */ |
181 | static struct file_operations hotkey_config_fops = { | 187 | static struct file_operations hotkey_config_fops = { |
@@ -188,9 +194,9 @@ static struct file_operations hotkey_config_fops = { | |||
188 | 194 | ||
189 | /* polling based config */ | 195 | /* polling based config */ |
190 | static struct file_operations hotkey_poll_config_fops = { | 196 | static struct file_operations hotkey_poll_config_fops = { |
191 | .open = hotkey_open_config, | 197 | .open = hotkey_poll_open_config, |
192 | .read = seq_read, | 198 | .read = seq_read, |
193 | .write = hotkey_write_poll_config, | 199 | .write = hotkey_write_config, |
194 | .llseek = seq_lseek, | 200 | .llseek = seq_lseek, |
195 | .release = single_release, | 201 | .release = single_release, |
196 | }; | 202 | }; |
@@ -227,7 +233,7 @@ static int hotkey_info_seq_show(struct seq_file *seq, void *offset) | |||
227 | { | 233 | { |
228 | ACPI_FUNCTION_TRACE("hotkey_info_seq_show"); | 234 | ACPI_FUNCTION_TRACE("hotkey_info_seq_show"); |
229 | 235 | ||
230 | seq_printf(seq, "Hotkey generic driver ver: %s", HOTKEY_ACPI_VERSION); | 236 | seq_printf(seq, "Hotkey generic driver ver: %s\n", HOTKEY_ACPI_VERSION); |
231 | 237 | ||
232 | return_VALUE(0); | 238 | return_VALUE(0); |
233 | } | 239 | } |
@@ -239,27 +245,35 @@ static int hotkey_info_open_fs(struct inode *inode, struct file *file) | |||
239 | 245 | ||
240 | static char *format_result(union acpi_object *object) | 246 | static char *format_result(union acpi_object *object) |
241 | { | 247 | { |
242 | char *buf = (char *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); | 248 | char *buf = NULL; |
243 | 249 | ||
244 | memset(buf, 0, sizeof(union acpi_object)); | 250 | buf = (char *)kmalloc(RESULT_STR_LEN, GFP_KERNEL); |
251 | if (buf) | ||
252 | memset(buf, 0, RESULT_STR_LEN); | ||
253 | else | ||
254 | goto do_fail; | ||
245 | 255 | ||
246 | /* Now, just support integer type */ | 256 | /* Now, just support integer type */ |
247 | if (object->type == ACPI_TYPE_INTEGER) | 257 | if (object->type == ACPI_TYPE_INTEGER) |
248 | sprintf(buf, "%d", (u32) object->integer.value); | 258 | sprintf(buf, "%d\n", (u32) object->integer.value); |
249 | 259 | do_fail: | |
250 | return buf; | 260 | return (buf); |
251 | } | 261 | } |
252 | 262 | ||
253 | static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) | 263 | static int hotkey_polling_seq_show(struct seq_file *seq, void *offset) |
254 | { | 264 | { |
255 | struct acpi_polling_hotkey *poll_hotkey = | 265 | struct acpi_polling_hotkey *poll_hotkey = |
256 | (struct acpi_polling_hotkey *)seq->private; | 266 | (struct acpi_polling_hotkey *)seq->private; |
267 | char *buf; | ||
257 | 268 | ||
258 | ACPI_FUNCTION_TRACE("hotkey_polling_seq_show"); | 269 | ACPI_FUNCTION_TRACE("hotkey_polling_seq_show"); |
259 | 270 | ||
260 | if (poll_hotkey->poll_result) | 271 | if (poll_hotkey->poll_result){ |
261 | seq_printf(seq, "%s", format_result(poll_hotkey->poll_result)); | 272 | buf = format_result(poll_hotkey->poll_result); |
262 | 273 | if(buf) | |
274 | seq_printf(seq, "%s", buf); | ||
275 | kfree(buf); | ||
276 | } | ||
263 | return_VALUE(0); | 277 | return_VALUE(0); |
264 | } | 278 | } |
265 | 279 | ||
@@ -276,19 +290,19 @@ static int hotkey_action_open_fs(struct inode *inode, struct file *file) | |||
276 | /* Mapping external hotkey number to standardized hotkey event num */ | 290 | /* Mapping external hotkey number to standardized hotkey event num */ |
277 | static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list) | 291 | static int hotkey_get_internal_event(int event, struct acpi_hotkey_list *list) |
278 | { | 292 | { |
279 | struct list_head *entries, *next; | 293 | struct list_head *entries; |
280 | int val = 0; | 294 | int val = -1; |
281 | 295 | ||
282 | ACPI_FUNCTION_TRACE("hotkey_get_internal_event"); | 296 | ACPI_FUNCTION_TRACE("hotkey_get_internal_event"); |
283 | 297 | ||
284 | list_for_each_safe(entries, next, list->entries) { | 298 | list_for_each(entries, list->entries) { |
285 | union acpi_hotkey *key = | 299 | union acpi_hotkey *key = |
286 | container_of(entries, union acpi_hotkey, entries); | 300 | container_of(entries, union acpi_hotkey, entries); |
287 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT | 301 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT |
288 | && key->event_hotkey.external_hotkey_num == event) | 302 | && key->event_hotkey.external_hotkey_num == event){ |
289 | val = key->link.hotkey_standard_num; | 303 | val = key->link.hotkey_standard_num; |
290 | else | 304 | break; |
291 | val = -1; | 305 | } |
292 | } | 306 | } |
293 | 307 | ||
294 | return_VALUE(val); | 308 | return_VALUE(val); |
@@ -306,7 +320,7 @@ acpi_hotkey_notify_handler(acpi_handle handle, u32 event, void *data) | |||
306 | return_VOID; | 320 | return_VOID; |
307 | 321 | ||
308 | internal_event = hotkey_get_internal_event(event, &global_hotkey_list); | 322 | internal_event = hotkey_get_internal_event(event, &global_hotkey_list); |
309 | acpi_bus_generate_event(device, event, 0); | 323 | acpi_bus_generate_event(device, internal_event, 0); |
310 | 324 | ||
311 | return_VOID; | 325 | return_VOID; |
312 | } | 326 | } |
@@ -329,13 +343,17 @@ static int auto_hotkey_remove(struct acpi_device *device, int type) | |||
329 | static int create_polling_proc(union acpi_hotkey *device) | 343 | static int create_polling_proc(union acpi_hotkey *device) |
330 | { | 344 | { |
331 | struct proc_dir_entry *proc; | 345 | struct proc_dir_entry *proc; |
346 | char proc_name[80]; | ||
332 | mode_t mode; | 347 | mode_t mode; |
333 | 348 | ||
334 | ACPI_FUNCTION_TRACE("create_polling_proc"); | 349 | ACPI_FUNCTION_TRACE("create_polling_proc"); |
335 | mode = S_IFREG | S_IRUGO | S_IWUGO; | 350 | mode = S_IFREG | S_IRUGO | S_IWUGO; |
336 | 351 | ||
337 | proc = create_proc_entry(device->poll_hotkey.action_method, | 352 | sprintf(proc_name, "%d", device->link.hotkey_standard_num); |
338 | mode, hotkey_proc_dir); | 353 | /* |
354 | strcat(proc_name, device->poll_hotkey.poll_method); | ||
355 | */ | ||
356 | proc = create_proc_entry(proc_name, mode, hotkey_proc_dir); | ||
339 | 357 | ||
340 | if (!proc) { | 358 | if (!proc) { |
341 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 359 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
@@ -353,23 +371,6 @@ static int create_polling_proc(union acpi_hotkey *device) | |||
353 | return_VALUE(0); | 371 | return_VALUE(0); |
354 | } | 372 | } |
355 | 373 | ||
356 | static int is_valid_acpi_path(const char *pathname) | ||
357 | { | ||
358 | acpi_handle handle; | ||
359 | acpi_status status; | ||
360 | ACPI_FUNCTION_TRACE("is_valid_acpi_path"); | ||
361 | |||
362 | status = acpi_get_handle(NULL, (char *)pathname, &handle); | ||
363 | return_VALUE(!ACPI_FAILURE(status)); | ||
364 | } | ||
365 | |||
366 | static int is_valid_hotkey(union acpi_hotkey *device) | ||
367 | { | ||
368 | ACPI_FUNCTION_TRACE("is_valid_hotkey"); | ||
369 | /* Implement valid check */ | ||
370 | return_VALUE(1); | ||
371 | } | ||
372 | |||
373 | static int hotkey_add(union acpi_hotkey *device) | 374 | static int hotkey_add(union acpi_hotkey *device) |
374 | { | 375 | { |
375 | int status = 0; | 376 | int status = 0; |
@@ -378,15 +379,11 @@ static int hotkey_add(union acpi_hotkey *device) | |||
378 | ACPI_FUNCTION_TRACE("hotkey_add"); | 379 | ACPI_FUNCTION_TRACE("hotkey_add"); |
379 | 380 | ||
380 | if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) { | 381 | if (device->link.hotkey_type == ACPI_HOTKEY_EVENT) { |
381 | status = | 382 | acpi_bus_get_device(device->event_hotkey.bus_handle, &dev); |
382 | acpi_bus_get_device(device->event_hotkey.bus_handle, &dev); | ||
383 | if (status) | ||
384 | return_VALUE(status); | ||
385 | |||
386 | status = acpi_install_notify_handler(dev->handle, | 383 | status = acpi_install_notify_handler(dev->handle, |
387 | ACPI_SYSTEM_NOTIFY, | 384 | ACPI_DEVICE_NOTIFY, |
388 | acpi_hotkey_notify_handler, | 385 | acpi_hotkey_notify_handler, |
389 | device); | 386 | dev); |
390 | } else /* Add polling hotkey */ | 387 | } else /* Add polling hotkey */ |
391 | create_polling_proc(device); | 388 | create_polling_proc(device); |
392 | 389 | ||
@@ -409,84 +406,143 @@ static int hotkey_remove(union acpi_hotkey *device) | |||
409 | if (key->link.hotkey_standard_num == | 406 | if (key->link.hotkey_standard_num == |
410 | device->link.hotkey_standard_num) { | 407 | device->link.hotkey_standard_num) { |
411 | list_del(&key->link.entries); | 408 | list_del(&key->link.entries); |
412 | remove_proc_entry(key->poll_hotkey.action_method, | 409 | free_hotkey_device(key); |
413 | hotkey_proc_dir); | ||
414 | global_hotkey_list.count--; | 410 | global_hotkey_list.count--; |
415 | break; | 411 | break; |
416 | } | 412 | } |
417 | } | 413 | } |
414 | kfree(device); | ||
418 | return_VALUE(0); | 415 | return_VALUE(0); |
419 | } | 416 | } |
420 | 417 | ||
421 | static void hotkey_update(union acpi_hotkey *key) | 418 | static int hotkey_update(union acpi_hotkey *key) |
422 | { | 419 | { |
423 | struct list_head *entries, *next; | 420 | struct list_head *entries; |
424 | 421 | ||
425 | ACPI_FUNCTION_TRACE("hotkey_update"); | 422 | ACPI_FUNCTION_TRACE("hotkey_update"); |
426 | 423 | ||
427 | list_for_each_safe(entries, next, global_hotkey_list.entries) { | 424 | list_for_each(entries, global_hotkey_list.entries) { |
428 | union acpi_hotkey *key = | 425 | union acpi_hotkey *tmp= |
429 | container_of(entries, union acpi_hotkey, entries); | 426 | container_of(entries, union acpi_hotkey, entries); |
430 | if (key->link.hotkey_standard_num == | 427 | if (tmp->link.hotkey_standard_num == |
431 | key->link.hotkey_standard_num) { | 428 | key->link.hotkey_standard_num) { |
432 | key->event_hotkey.bus_handle = | 429 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { |
433 | key->event_hotkey.bus_handle; | 430 | free_hotkey_buffer(tmp); |
434 | key->event_hotkey.external_hotkey_num = | 431 | tmp->event_hotkey.bus_handle = |
435 | key->event_hotkey.external_hotkey_num; | 432 | key->event_hotkey.bus_handle; |
436 | key->event_hotkey.action_handle = | 433 | tmp->event_hotkey.external_hotkey_num = |
437 | key->event_hotkey.action_handle; | 434 | key->event_hotkey.external_hotkey_num; |
438 | key->event_hotkey.action_method = | 435 | tmp->event_hotkey.action_handle = |
439 | key->event_hotkey.action_method; | 436 | key->event_hotkey.action_handle; |
437 | tmp->event_hotkey.action_method = | ||
438 | key->event_hotkey.action_method; | ||
439 | kfree(key); | ||
440 | } else { | ||
441 | /* | ||
442 | char proc_name[80]; | ||
443 | |||
444 | sprintf(proc_name, "%d", tmp->link.hotkey_standard_num); | ||
445 | strcat(proc_name, tmp->poll_hotkey.poll_method); | ||
446 | remove_proc_entry(proc_name,hotkey_proc_dir); | ||
447 | */ | ||
448 | free_poll_hotkey_buffer(tmp); | ||
449 | tmp->poll_hotkey.poll_handle = | ||
450 | key->poll_hotkey.poll_handle; | ||
451 | tmp->poll_hotkey.poll_method = | ||
452 | key->poll_hotkey.poll_method; | ||
453 | tmp->poll_hotkey.action_handle = | ||
454 | key->poll_hotkey.action_handle; | ||
455 | tmp->poll_hotkey.action_method = | ||
456 | key->poll_hotkey.action_method; | ||
457 | tmp->poll_hotkey.poll_result = | ||
458 | key->poll_hotkey.poll_result; | ||
459 | /* | ||
460 | create_polling_proc(tmp); | ||
461 | */ | ||
462 | kfree(key); | ||
463 | } | ||
464 | return_VALUE(0); | ||
440 | break; | 465 | break; |
441 | } | 466 | } |
442 | } | 467 | } |
443 | 468 | ||
444 | return_VOID; | 469 | return_VALUE(-ENODEV); |
445 | } | 470 | } |
446 | 471 | ||
447 | static void free_hotkey_device(union acpi_hotkey *key) | 472 | static void free_hotkey_device(union acpi_hotkey *key) |
448 | { | 473 | { |
449 | struct acpi_device *dev; | 474 | struct acpi_device *dev; |
450 | int status; | ||
451 | 475 | ||
452 | ACPI_FUNCTION_TRACE("free_hotkey_device"); | 476 | ACPI_FUNCTION_TRACE("free_hotkey_device"); |
453 | 477 | ||
454 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { | 478 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { |
455 | status = | 479 | acpi_bus_get_device(key->event_hotkey.bus_handle, &dev); |
456 | acpi_bus_get_device(key->event_hotkey.bus_handle, &dev); | ||
457 | if (dev->handle) | 480 | if (dev->handle) |
458 | acpi_remove_notify_handler(dev->handle, | 481 | acpi_remove_notify_handler(dev->handle, |
459 | ACPI_SYSTEM_NOTIFY, | 482 | ACPI_DEVICE_NOTIFY, |
460 | acpi_hotkey_notify_handler); | 483 | acpi_hotkey_notify_handler); |
461 | } else | 484 | free_hotkey_buffer(key); |
462 | remove_proc_entry(key->poll_hotkey.action_method, | 485 | } else { |
463 | hotkey_proc_dir); | 486 | char proc_name[80]; |
487 | |||
488 | sprintf(proc_name, "%d", key->link.hotkey_standard_num); | ||
489 | /* | ||
490 | strcat(proc_name, key->poll_hotkey.poll_method); | ||
491 | */ | ||
492 | remove_proc_entry(proc_name,hotkey_proc_dir); | ||
493 | free_poll_hotkey_buffer(key); | ||
494 | } | ||
464 | kfree(key); | 495 | kfree(key); |
465 | return_VOID; | 496 | return_VOID; |
466 | } | 497 | } |
467 | 498 | ||
499 | static void | ||
500 | free_hotkey_buffer(union acpi_hotkey *key) | ||
501 | { | ||
502 | kfree(key->event_hotkey.action_method); | ||
503 | } | ||
504 | |||
505 | static void | ||
506 | free_poll_hotkey_buffer(union acpi_hotkey *key) | ||
507 | { | ||
508 | kfree(key->poll_hotkey.action_method); | ||
509 | kfree(key->poll_hotkey.poll_method); | ||
510 | kfree(key->poll_hotkey.poll_result); | ||
511 | } | ||
468 | static int | 512 | static int |
469 | init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str, | 513 | init_hotkey_device(union acpi_hotkey *key, char *bus_str, char *action_str, |
470 | char *method, int std_num, int external_num) | 514 | char *method, int std_num, int external_num) |
471 | { | 515 | { |
516 | acpi_handle tmp_handle; | ||
517 | acpi_status status = AE_OK; | ||
518 | |||
472 | ACPI_FUNCTION_TRACE("init_hotkey_device"); | 519 | ACPI_FUNCTION_TRACE("init_hotkey_device"); |
473 | 520 | ||
521 | if(std_num < 0 || IS_POLL(std_num) || !key ) | ||
522 | goto do_fail; | ||
523 | |||
524 | if(!bus_str || !action_str || !method) | ||
525 | goto do_fail; | ||
526 | |||
474 | key->link.hotkey_type = ACPI_HOTKEY_EVENT; | 527 | key->link.hotkey_type = ACPI_HOTKEY_EVENT; |
475 | key->link.hotkey_standard_num = std_num; | 528 | key->link.hotkey_standard_num = std_num; |
476 | key->event_hotkey.flag = 0; | 529 | key->event_hotkey.flag = 0; |
477 | if (is_valid_acpi_path(bus_str)) | 530 | key->event_hotkey.action_method = method; |
478 | acpi_get_handle((acpi_handle) 0, | ||
479 | bus_str, &(key->event_hotkey.bus_handle)); | ||
480 | else | ||
481 | return_VALUE(-ENODEV); | ||
482 | key->event_hotkey.external_hotkey_num = external_num; | ||
483 | if (is_valid_acpi_path(action_str)) | ||
484 | acpi_get_handle((acpi_handle) 0, | ||
485 | action_str, &(key->event_hotkey.action_handle)); | ||
486 | key->event_hotkey.action_method = kmalloc(sizeof(method), GFP_KERNEL); | ||
487 | strcpy(key->event_hotkey.action_method, method); | ||
488 | 531 | ||
489 | return_VALUE(!is_valid_hotkey(key)); | 532 | status = acpi_get_handle(NULL,bus_str, &(key->event_hotkey.bus_handle)); |
533 | if(ACPI_FAILURE(status)) | ||
534 | goto do_fail; | ||
535 | key->event_hotkey.external_hotkey_num = external_num; | ||
536 | status = acpi_get_handle(NULL,action_str, &(key->event_hotkey.action_handle)); | ||
537 | if(ACPI_FAILURE(status)) | ||
538 | goto do_fail; | ||
539 | status = acpi_get_handle(key->event_hotkey.action_handle, | ||
540 | method, &tmp_handle); | ||
541 | if (ACPI_FAILURE(status)) | ||
542 | goto do_fail; | ||
543 | return_VALUE(AE_OK); | ||
544 | do_fail: | ||
545 | return_VALUE(-ENODEV); | ||
490 | } | 546 | } |
491 | 547 | ||
492 | static int | 548 | static int |
@@ -495,34 +551,46 @@ init_poll_hotkey_device(union acpi_hotkey *key, | |||
495 | char *poll_method, | 551 | char *poll_method, |
496 | char *action_str, char *action_method, int std_num) | 552 | char *action_str, char *action_method, int std_num) |
497 | { | 553 | { |
554 | acpi_status status = AE_OK; | ||
555 | acpi_handle tmp_handle; | ||
556 | |||
498 | ACPI_FUNCTION_TRACE("init_poll_hotkey_device"); | 557 | ACPI_FUNCTION_TRACE("init_poll_hotkey_device"); |
499 | 558 | ||
559 | if(std_num < 0 || IS_EVENT(std_num) || !key) | ||
560 | goto do_fail; | ||
561 | |||
562 | if(!poll_str || !poll_method || !action_str || !action_method) | ||
563 | goto do_fail; | ||
564 | |||
500 | key->link.hotkey_type = ACPI_HOTKEY_POLLING; | 565 | key->link.hotkey_type = ACPI_HOTKEY_POLLING; |
501 | key->link.hotkey_standard_num = std_num; | 566 | key->link.hotkey_standard_num = std_num; |
502 | key->poll_hotkey.flag = 0; | 567 | key->poll_hotkey.flag = 0; |
503 | if (is_valid_acpi_path(poll_str)) | ||
504 | acpi_get_handle((acpi_handle) 0, | ||
505 | poll_str, &(key->poll_hotkey.poll_handle)); | ||
506 | else | ||
507 | return_VALUE(-ENODEV); | ||
508 | key->poll_hotkey.poll_method = poll_method; | 568 | key->poll_hotkey.poll_method = poll_method; |
509 | if (is_valid_acpi_path(action_str)) | 569 | key->poll_hotkey.action_method = action_method; |
510 | acpi_get_handle((acpi_handle) 0, | 570 | |
511 | action_str, &(key->poll_hotkey.action_handle)); | 571 | status = acpi_get_handle(NULL,poll_str, &(key->poll_hotkey.poll_handle)); |
512 | key->poll_hotkey.action_method = | 572 | if(ACPI_FAILURE(status)) |
513 | kmalloc(sizeof(action_method), GFP_KERNEL); | 573 | goto do_fail; |
514 | strcpy(key->poll_hotkey.action_method, action_method); | 574 | status = acpi_get_handle(key->poll_hotkey.poll_handle, |
575 | poll_method, &tmp_handle); | ||
576 | if (ACPI_FAILURE(status)) | ||
577 | goto do_fail; | ||
578 | status = acpi_get_handle(NULL,action_str, &(key->poll_hotkey.action_handle)); | ||
579 | if (ACPI_FAILURE(status)) | ||
580 | goto do_fail; | ||
581 | status = acpi_get_handle(key->poll_hotkey.action_handle, | ||
582 | action_method, &tmp_handle); | ||
583 | if (ACPI_FAILURE(status)) | ||
584 | goto do_fail; | ||
515 | key->poll_hotkey.poll_result = | 585 | key->poll_hotkey.poll_result = |
516 | (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); | 586 | (union acpi_object *)kmalloc(sizeof(union acpi_object), GFP_KERNEL); |
517 | return_VALUE(is_valid_hotkey(key)); | 587 | if(!key->poll_hotkey.poll_result) |
588 | goto do_fail; | ||
589 | return_VALUE(AE_OK); | ||
590 | do_fail: | ||
591 | return_VALUE(-ENODEV); | ||
518 | } | 592 | } |
519 | 593 | ||
520 | static int check_hotkey_valid(union acpi_hotkey *key, | ||
521 | struct acpi_hotkey_list *list) | ||
522 | { | ||
523 | ACPI_FUNCTION_TRACE("check_hotkey_valid"); | ||
524 | return_VALUE(0); | ||
525 | } | ||
526 | 594 | ||
527 | static int hotkey_open_config(struct inode *inode, struct file *file) | 595 | static int hotkey_open_config(struct inode *inode, struct file *file) |
528 | { | 596 | { |
@@ -531,10 +599,17 @@ static int hotkey_open_config(struct inode *inode, struct file *file) | |||
531 | (file, hotkey_config_seq_show, PDE(inode)->data)); | 599 | (file, hotkey_config_seq_show, PDE(inode)->data)); |
532 | } | 600 | } |
533 | 601 | ||
602 | static int hotkey_poll_open_config(struct inode *inode, struct file *file) | ||
603 | { | ||
604 | ACPI_FUNCTION_TRACE("hotkey_poll_open_config"); | ||
605 | return_VALUE(single_open | ||
606 | (file, hotkey_poll_config_seq_show, PDE(inode)->data)); | ||
607 | } | ||
608 | |||
534 | static int hotkey_config_seq_show(struct seq_file *seq, void *offset) | 609 | static int hotkey_config_seq_show(struct seq_file *seq, void *offset) |
535 | { | 610 | { |
536 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; | 611 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; |
537 | struct list_head *entries, *next; | 612 | struct list_head *entries; |
538 | char bus_name[ACPI_PATHNAME_MAX] = { 0 }; | 613 | char bus_name[ACPI_PATHNAME_MAX] = { 0 }; |
539 | char action_name[ACPI_PATHNAME_MAX] = { 0 }; | 614 | char action_name[ACPI_PATHNAME_MAX] = { 0 }; |
540 | struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; | 615 | struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; |
@@ -542,10 +617,7 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset) | |||
542 | 617 | ||
543 | ACPI_FUNCTION_TRACE(("hotkey_config_seq_show")); | 618 | ACPI_FUNCTION_TRACE(("hotkey_config_seq_show")); |
544 | 619 | ||
545 | if (!hotkey_list) | 620 | list_for_each(entries, hotkey_list->entries) { |
546 | goto end; | ||
547 | |||
548 | list_for_each_safe(entries, next, hotkey_list->entries) { | ||
549 | union acpi_hotkey *key = | 621 | union acpi_hotkey *key = |
550 | container_of(entries, union acpi_hotkey, entries); | 622 | container_of(entries, union acpi_hotkey, entries); |
551 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { | 623 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT) { |
@@ -553,18 +625,37 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset) | |||
553 | ACPI_NAME_TYPE_MAX, &bus); | 625 | ACPI_NAME_TYPE_MAX, &bus); |
554 | acpi_get_name(key->event_hotkey.action_handle, | 626 | acpi_get_name(key->event_hotkey.action_handle, |
555 | ACPI_NAME_TYPE_MAX, &act); | 627 | ACPI_NAME_TYPE_MAX, &act); |
556 | seq_printf(seq, "%s:%s:%s:%d:%d", bus_name, | 628 | seq_printf(seq, "%s:%s:%s:%d:%d\n", bus_name, |
557 | action_name, | 629 | action_name, |
558 | key->event_hotkey.action_method, | 630 | key->event_hotkey.action_method, |
559 | key->link.hotkey_standard_num, | 631 | key->link.hotkey_standard_num, |
560 | key->event_hotkey.external_hotkey_num); | 632 | key->event_hotkey.external_hotkey_num); |
561 | } /* ACPI_HOTKEY_POLLING */ | 633 | } |
562 | else { | 634 | } |
635 | seq_puts(seq, "\n"); | ||
636 | return_VALUE(0); | ||
637 | } | ||
638 | |||
639 | static int hotkey_poll_config_seq_show(struct seq_file *seq, void *offset) | ||
640 | { | ||
641 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; | ||
642 | struct list_head *entries; | ||
643 | char bus_name[ACPI_PATHNAME_MAX] = { 0 }; | ||
644 | char action_name[ACPI_PATHNAME_MAX] = { 0 }; | ||
645 | struct acpi_buffer bus = { ACPI_PATHNAME_MAX, bus_name }; | ||
646 | struct acpi_buffer act = { ACPI_PATHNAME_MAX, action_name }; | ||
647 | |||
648 | ACPI_FUNCTION_TRACE(("hotkey_config_seq_show")); | ||
649 | |||
650 | list_for_each(entries, hotkey_list->entries) { | ||
651 | union acpi_hotkey *key = | ||
652 | container_of(entries, union acpi_hotkey, entries); | ||
653 | if (key->link.hotkey_type == ACPI_HOTKEY_POLLING) { | ||
563 | acpi_get_name(key->poll_hotkey.poll_handle, | 654 | acpi_get_name(key->poll_hotkey.poll_handle, |
564 | ACPI_NAME_TYPE_MAX, &bus); | 655 | ACPI_NAME_TYPE_MAX, &bus); |
565 | acpi_get_name(key->poll_hotkey.action_handle, | 656 | acpi_get_name(key->poll_hotkey.action_handle, |
566 | ACPI_NAME_TYPE_MAX, &act); | 657 | ACPI_NAME_TYPE_MAX, &act); |
567 | seq_printf(seq, "%s:%s:%s:%s:%d", bus_name, | 658 | seq_printf(seq, "%s:%s:%s:%s:%d\n", bus_name, |
568 | key->poll_hotkey.poll_method, | 659 | key->poll_hotkey.poll_method, |
569 | action_name, | 660 | action_name, |
570 | key->poll_hotkey.action_method, | 661 | key->poll_hotkey.action_method, |
@@ -572,49 +663,83 @@ static int hotkey_config_seq_show(struct seq_file *seq, void *offset) | |||
572 | } | 663 | } |
573 | } | 664 | } |
574 | seq_puts(seq, "\n"); | 665 | seq_puts(seq, "\n"); |
575 | end: | ||
576 | return_VALUE(0); | 666 | return_VALUE(0); |
577 | } | 667 | } |
578 | 668 | ||
579 | static int | 669 | static int |
580 | get_parms(char *config_record, | 670 | get_parms(char *config_record, |
581 | int *cmd, | 671 | int *cmd, |
582 | char *bus_handle, | 672 | char **bus_handle, |
583 | char *bus_method, | 673 | char **bus_method, |
584 | char *action_handle, | 674 | char **action_handle, |
585 | char *method, int *internal_event_num, int *external_event_num) | 675 | char **method, int *internal_event_num, int *external_event_num) |
586 | { | 676 | { |
587 | char *tmp, *tmp1; | 677 | char *tmp, *tmp1, count; |
588 | ACPI_FUNCTION_TRACE(("get_parms")); | 678 | ACPI_FUNCTION_TRACE(("get_parms")); |
589 | 679 | ||
590 | sscanf(config_record, "%d", cmd); | 680 | sscanf(config_record, "%d", cmd); |
591 | 681 | ||
682 | if(*cmd == 1){ | ||
683 | if(sscanf(config_record, "%d:%d", cmd, internal_event_num)!=2) | ||
684 | goto do_fail; | ||
685 | else | ||
686 | return (6); | ||
687 | } | ||
592 | tmp = strchr(config_record, ':'); | 688 | tmp = strchr(config_record, ':'); |
689 | if (!tmp) | ||
690 | goto do_fail; | ||
593 | tmp++; | 691 | tmp++; |
594 | tmp1 = strchr(tmp, ':'); | 692 | tmp1 = strchr(tmp, ':'); |
595 | strncpy(bus_handle, tmp, tmp1 - tmp); | 693 | if (!tmp1) |
596 | bus_handle[tmp1 - tmp] = 0; | 694 | goto do_fail; |
695 | |||
696 | count = tmp1 - tmp; | ||
697 | *bus_handle = (char *) kmalloc(count+1, GFP_KERNEL); | ||
698 | if(!*bus_handle) | ||
699 | goto do_fail; | ||
700 | strncpy(*bus_handle, tmp, count); | ||
701 | *(*bus_handle + count) = 0; | ||
597 | 702 | ||
598 | tmp = tmp1; | 703 | tmp = tmp1; |
599 | tmp++; | 704 | tmp++; |
600 | tmp1 = strchr(tmp, ':'); | 705 | tmp1 = strchr(tmp, ':'); |
601 | strncpy(bus_method, tmp, tmp1 - tmp); | 706 | if (!tmp1) |
602 | bus_method[tmp1 - tmp] = 0; | 707 | goto do_fail; |
708 | count = tmp1 - tmp; | ||
709 | *bus_method = (char *) kmalloc(count+1, GFP_KERNEL); | ||
710 | if(!*bus_method) | ||
711 | goto do_fail; | ||
712 | strncpy(*bus_method, tmp, count); | ||
713 | *(*bus_method + count) = 0; | ||
603 | 714 | ||
604 | tmp = tmp1; | 715 | tmp = tmp1; |
605 | tmp++; | 716 | tmp++; |
606 | tmp1 = strchr(tmp, ':'); | 717 | tmp1 = strchr(tmp, ':'); |
607 | strncpy(action_handle, tmp, tmp1 - tmp); | 718 | if (!tmp1) |
608 | action_handle[tmp1 - tmp] = 0; | 719 | goto do_fail; |
720 | count = tmp1 - tmp; | ||
721 | *action_handle = (char *) kmalloc(count+1, GFP_KERNEL); | ||
722 | strncpy(*action_handle, tmp, count); | ||
723 | *(*action_handle + count) = 0; | ||
609 | 724 | ||
610 | tmp = tmp1; | 725 | tmp = tmp1; |
611 | tmp++; | 726 | tmp++; |
612 | tmp1 = strchr(tmp, ':'); | 727 | tmp1 = strchr(tmp, ':'); |
613 | strncpy(method, tmp, tmp1 - tmp); | 728 | if (!tmp1) |
614 | method[tmp1 - tmp] = 0; | 729 | goto do_fail; |
730 | count = tmp1 - tmp; | ||
731 | *method = (char *) kmalloc(count+1, GFP_KERNEL); | ||
732 | if(!*method) | ||
733 | goto do_fail; | ||
734 | strncpy(*method, tmp, count); | ||
735 | *(*method + count) = 0; | ||
736 | |||
737 | if(sscanf(tmp1 + 1, "%d:%d", internal_event_num, external_event_num)<=0) | ||
738 | goto do_fail; | ||
615 | 739 | ||
616 | sscanf(tmp1 + 1, "%d:%d", internal_event_num, external_event_num); | ||
617 | return_VALUE(6); | 740 | return_VALUE(6); |
741 | do_fail: | ||
742 | return_VALUE(-1); | ||
618 | } | 743 | } |
619 | 744 | ||
620 | /* count is length for one input record */ | 745 | /* count is length for one input record */ |
@@ -622,135 +747,117 @@ static ssize_t hotkey_write_config(struct file *file, | |||
622 | const char __user * buffer, | 747 | const char __user * buffer, |
623 | size_t count, loff_t * data) | 748 | size_t count, loff_t * data) |
624 | { | 749 | { |
625 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; | 750 | char *config_record = NULL; |
626 | char config_record[MAX_CONFIG_RECORD_LEN]; | 751 | char *bus_handle = NULL; |
627 | char bus_handle[MAX_NAME_PATH_LEN]; | 752 | char *bus_method = NULL; |
628 | char bus_method[MAX_NAME_PATH_LEN]; | 753 | char *action_handle = NULL; |
629 | char action_handle[MAX_NAME_PATH_LEN]; | 754 | char *method = NULL; |
630 | char method[20]; | ||
631 | int cmd, internal_event_num, external_event_num; | 755 | int cmd, internal_event_num, external_event_num; |
632 | int ret = 0; | 756 | int ret = 0; |
633 | union acpi_hotkey *key = NULL; | 757 | union acpi_hotkey *key = NULL; |
634 | 758 | ||
635 | ACPI_FUNCTION_TRACE(("hotkey_write_config")); | 759 | ACPI_FUNCTION_TRACE(("hotkey_write_config")); |
636 | 760 | ||
637 | if (!hotkey_list || count > MAX_CONFIG_RECORD_LEN) { | 761 | config_record = (char *) kmalloc(count+1, GFP_KERNEL); |
638 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid arguments\n")); | 762 | if(!config_record) |
639 | return_VALUE(-EINVAL); | 763 | return_VALUE(-ENOMEM); |
640 | } | ||
641 | 764 | ||
642 | if (copy_from_user(config_record, buffer, count)) { | 765 | if (copy_from_user(config_record, buffer, count)) { |
766 | kfree(config_record); | ||
643 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n")); | 767 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n")); |
644 | return_VALUE(-EINVAL); | 768 | return_VALUE(-EINVAL); |
645 | } | 769 | } |
646 | config_record[count] = '\0'; | 770 | config_record[count] = 0; |
647 | 771 | ||
648 | ret = get_parms(config_record, | 772 | ret = get_parms(config_record, |
649 | &cmd, | 773 | &cmd, |
650 | bus_handle, | 774 | &bus_handle, |
651 | bus_method, | 775 | &bus_method, |
652 | action_handle, | 776 | &action_handle, |
653 | method, &internal_event_num, &external_event_num); | 777 | &method, &internal_event_num, &external_event_num); |
778 | |||
779 | kfree(config_record); | ||
780 | if(IS_OTHERS(internal_event_num)) | ||
781 | goto do_fail; | ||
654 | if (ret != 6) { | 782 | if (ret != 6) { |
783 | do_fail: | ||
784 | kfree(bus_handle); | ||
785 | kfree(bus_method); | ||
786 | kfree(action_handle); | ||
787 | kfree(method); | ||
655 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 788 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
656 | "Invalid data format ret=%d\n", ret)); | 789 | "Invalid data format ret=%d\n", ret)); |
657 | return_VALUE(-EINVAL); | 790 | return_VALUE(-EINVAL); |
658 | } | 791 | } |
659 | 792 | ||
660 | key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL); | 793 | key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL); |
661 | ret = init_hotkey_device(key, bus_handle, action_handle, method, | 794 | if(!key) |
795 | goto do_fail; | ||
796 | memset(key, 0, sizeof(union acpi_hotkey)); | ||
797 | if(cmd == 1) { | ||
798 | union acpi_hotkey *tmp = NULL; | ||
799 | tmp = get_hotkey_by_event(&global_hotkey_list, | ||
800 | internal_event_num); | ||
801 | if(!tmp) | ||
802 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid key")); | ||
803 | else | ||
804 | memcpy(key, tmp, sizeof(union acpi_hotkey)); | ||
805 | goto cont_cmd; | ||
806 | } | ||
807 | if (IS_EVENT(internal_event_num)) { | ||
808 | kfree(bus_method); | ||
809 | ret = init_hotkey_device(key, bus_handle, action_handle, method, | ||
662 | internal_event_num, external_event_num); | 810 | internal_event_num, external_event_num); |
663 | 811 | } else | |
664 | if (ret || check_hotkey_valid(key, hotkey_list)) { | 812 | ret = init_poll_hotkey_device(key, bus_handle, bus_method, |
813 | action_handle, method, | ||
814 | internal_event_num); | ||
815 | if (ret) { | ||
816 | kfree(bus_handle); | ||
817 | kfree(action_handle); | ||
818 | if(IS_EVENT(internal_event_num)) | ||
819 | free_hotkey_buffer(key); | ||
820 | else | ||
821 | free_poll_hotkey_buffer(key); | ||
665 | kfree(key); | 822 | kfree(key); |
666 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n")); | 823 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n")); |
667 | return_VALUE(-EINVAL); | 824 | return_VALUE(-EINVAL); |
668 | } | 825 | } |
669 | switch (cmd) { | ||
670 | case 0: | ||
671 | hotkey_add(key); | ||
672 | break; | ||
673 | case 1: | ||
674 | hotkey_remove(key); | ||
675 | free_hotkey_device(key); | ||
676 | break; | ||
677 | case 2: | ||
678 | hotkey_update(key); | ||
679 | break; | ||
680 | default: | ||
681 | break; | ||
682 | } | ||
683 | return_VALUE(count); | ||
684 | } | ||
685 | |||
686 | /* count is length for one input record */ | ||
687 | static ssize_t hotkey_write_poll_config(struct file *file, | ||
688 | const char __user * buffer, | ||
689 | size_t count, loff_t * data) | ||
690 | { | ||
691 | struct seq_file *m = (struct seq_file *)file->private_data; | ||
692 | struct acpi_hotkey_list *hotkey_list = | ||
693 | (struct acpi_hotkey_list *)m->private; | ||
694 | |||
695 | char config_record[MAX_CONFIG_RECORD_LEN]; | ||
696 | char polling_handle[MAX_NAME_PATH_LEN]; | ||
697 | char action_handle[MAX_NAME_PATH_LEN]; | ||
698 | char poll_method[20], action_method[20]; | ||
699 | int ret, internal_event_num, cmd, external_event_num; | ||
700 | union acpi_hotkey *key = NULL; | ||
701 | |||
702 | ACPI_FUNCTION_TRACE("hotkey_write_poll_config"); | ||
703 | |||
704 | if (!hotkey_list || count > MAX_CONFIG_RECORD_LEN) { | ||
705 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid arguments\n")); | ||
706 | return_VALUE(-EINVAL); | ||
707 | } | ||
708 | |||
709 | if (copy_from_user(config_record, buffer, count)) { | ||
710 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data \n")); | ||
711 | return_VALUE(-EINVAL); | ||
712 | } | ||
713 | config_record[count] = '\0'; | ||
714 | 826 | ||
715 | ret = get_parms(config_record, | 827 | cont_cmd: |
716 | &cmd, | 828 | kfree(bus_handle); |
717 | polling_handle, | 829 | kfree(action_handle); |
718 | poll_method, | ||
719 | action_handle, | ||
720 | action_method, | ||
721 | &internal_event_num, &external_event_num); | ||
722 | |||
723 | if (ret != 6) { | ||
724 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid data format\n")); | ||
725 | return_VALUE(-EINVAL); | ||
726 | } | ||
727 | 830 | ||
728 | key = kmalloc(sizeof(union acpi_hotkey), GFP_KERNEL); | ||
729 | ret = init_poll_hotkey_device(key, polling_handle, poll_method, | ||
730 | action_handle, action_method, | ||
731 | internal_event_num); | ||
732 | if (ret || check_hotkey_valid(key, hotkey_list)) { | ||
733 | kfree(key); | ||
734 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid hotkey \n")); | ||
735 | return_VALUE(-EINVAL); | ||
736 | } | ||
737 | switch (cmd) { | 831 | switch (cmd) { |
738 | case 0: | 832 | case 0: |
739 | hotkey_add(key); | 833 | if(get_hotkey_by_event(&global_hotkey_list,key->link.hotkey_standard_num)) |
834 | goto fail_out; | ||
835 | else | ||
836 | hotkey_add(key); | ||
740 | break; | 837 | break; |
741 | case 1: | 838 | case 1: |
742 | hotkey_remove(key); | 839 | hotkey_remove(key); |
743 | break; | 840 | break; |
744 | case 2: | 841 | case 2: |
745 | hotkey_update(key); | 842 | if(hotkey_update(key)) |
843 | goto fail_out; | ||
746 | break; | 844 | break; |
747 | default: | 845 | default: |
846 | goto fail_out; | ||
748 | break; | 847 | break; |
749 | } | 848 | } |
750 | return_VALUE(count); | 849 | return_VALUE(count); |
850 | fail_out: | ||
851 | if(IS_EVENT(internal_event_num)) | ||
852 | free_hotkey_buffer(key); | ||
853 | else | ||
854 | free_poll_hotkey_buffer(key); | ||
855 | kfree(key); | ||
856 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "invalid key\n")); | ||
857 | return_VALUE(-EINVAL); | ||
751 | } | 858 | } |
752 | 859 | ||
753 | /* | 860 | /* |
754 | * This function evaluates an ACPI method, given an int as parameter, the | 861 | * This function evaluates an ACPI method, given an int as parameter, the |
755 | * method is searched within the scope of the handle, can be NULL. The output | 862 | * method is searched within the scope of the handle, can be NULL. The output |
756 | * of the method is written is output, which can also be NULL | 863 | * of the method is written is output, which can also be NULL |
@@ -775,7 +882,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val, | |||
775 | return_VALUE(status == AE_OK); | 882 | return_VALUE(status == AE_OK); |
776 | } | 883 | } |
777 | 884 | ||
778 | static int read_acpi_int(acpi_handle handle, const char *method, int *val) | 885 | static int read_acpi_int(acpi_handle handle, const char *method, union acpi_object *val) |
779 | { | 886 | { |
780 | struct acpi_buffer output; | 887 | struct acpi_buffer output; |
781 | union acpi_object out_obj; | 888 | union acpi_object out_obj; |
@@ -786,62 +893,32 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val) | |||
786 | output.pointer = &out_obj; | 893 | output.pointer = &out_obj; |
787 | 894 | ||
788 | status = acpi_evaluate_object(handle, (char *)method, NULL, &output); | 895 | status = acpi_evaluate_object(handle, (char *)method, NULL, &output); |
789 | *val = out_obj.integer.value; | 896 | if(val){ |
897 | val->integer.value = out_obj.integer.value; | ||
898 | val->type = out_obj.type; | ||
899 | } else | ||
900 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "null val pointer")); | ||
790 | return_VALUE((status == AE_OK) | 901 | return_VALUE((status == AE_OK) |
791 | && (out_obj.type == ACPI_TYPE_INTEGER)); | 902 | && (out_obj.type == ACPI_TYPE_INTEGER)); |
792 | } | 903 | } |
793 | 904 | ||
794 | static acpi_handle | 905 | static union acpi_hotkey *get_hotkey_by_event(struct |
795 | get_handle_from_hotkeylist(struct acpi_hotkey_list *hotkey_list, int event_num) | 906 | acpi_hotkey_list |
907 | *hotkey_list, int event) | ||
796 | { | 908 | { |
797 | struct list_head *entries, *next; | 909 | struct list_head *entries; |
798 | |||
799 | list_for_each_safe(entries, next, hotkey_list->entries) { | ||
800 | union acpi_hotkey *key = | ||
801 | container_of(entries, union acpi_hotkey, entries); | ||
802 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT | ||
803 | && key->link.hotkey_standard_num == event_num) { | ||
804 | return (key->event_hotkey.action_handle); | ||
805 | } | ||
806 | } | ||
807 | return (NULL); | ||
808 | } | ||
809 | |||
810 | static | ||
811 | char *get_method_from_hotkeylist(struct acpi_hotkey_list *hotkey_list, | ||
812 | int event_num) | ||
813 | { | ||
814 | struct list_head *entries, *next; | ||
815 | |||
816 | list_for_each_safe(entries, next, hotkey_list->entries) { | ||
817 | union acpi_hotkey *key = | ||
818 | container_of(entries, union acpi_hotkey, entries); | ||
819 | |||
820 | if (key->link.hotkey_type == ACPI_HOTKEY_EVENT && | ||
821 | key->link.hotkey_standard_num == event_num) | ||
822 | return (key->event_hotkey.action_method); | ||
823 | } | ||
824 | return (NULL); | ||
825 | } | ||
826 | |||
827 | static struct acpi_polling_hotkey *get_hotkey_by_event(struct | ||
828 | acpi_hotkey_list | ||
829 | *hotkey_list, int event) | ||
830 | { | ||
831 | struct list_head *entries, *next; | ||
832 | 910 | ||
833 | list_for_each_safe(entries, next, hotkey_list->entries) { | 911 | list_for_each(entries, hotkey_list->entries) { |
834 | union acpi_hotkey *key = | 912 | union acpi_hotkey *key = |
835 | container_of(entries, union acpi_hotkey, entries); | 913 | container_of(entries, union acpi_hotkey, entries); |
836 | if (key->link.hotkey_type == ACPI_HOTKEY_POLLING | 914 | if (key->link.hotkey_standard_num == event) { |
837 | && key->link.hotkey_standard_num == event) { | 915 | return(key); |
838 | return (&key->poll_hotkey); | ||
839 | } | 916 | } |
840 | } | 917 | } |
841 | return (NULL); | 918 | return(NULL); |
842 | } | 919 | } |
843 | 920 | ||
844 | /* | 921 | /* |
845 | * user call AML method interface: | 922 | * user call AML method interface: |
846 | * Call convention: | 923 | * Call convention: |
847 | * echo "event_num: arg type : value" | 924 | * echo "event_num: arg type : value" |
@@ -854,48 +931,56 @@ static ssize_t hotkey_execute_aml_method(struct file *file, | |||
854 | size_t count, loff_t * data) | 931 | size_t count, loff_t * data) |
855 | { | 932 | { |
856 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; | 933 | struct acpi_hotkey_list *hotkey_list = &global_hotkey_list; |
857 | char arg[MAX_CALL_PARM]; | 934 | char *arg; |
858 | int event, type, value; | 935 | int event,method_type,type, value; |
859 | 936 | union acpi_hotkey *key; | |
860 | char *method; | ||
861 | acpi_handle handle; | ||
862 | 937 | ||
863 | ACPI_FUNCTION_TRACE("hotkey_execte_aml_method"); | 938 | ACPI_FUNCTION_TRACE("hotkey_execte_aml_method"); |
864 | 939 | ||
865 | if (!hotkey_list || count > MAX_CALL_PARM) { | 940 | arg = (char *) kmalloc(count+1, GFP_KERNEL); |
866 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 1")); | 941 | if(!arg) |
867 | return_VALUE(-EINVAL); | 942 | return_VALUE(-ENOMEM); |
868 | } | 943 | arg[count]=0; |
869 | 944 | ||
870 | if (copy_from_user(arg, buffer, count)) { | 945 | if (copy_from_user(arg, buffer, count)) { |
946 | kfree(arg); | ||
871 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2")); | 947 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 2")); |
872 | return_VALUE(-EINVAL); | 948 | return_VALUE(-EINVAL); |
873 | } | 949 | } |
874 | 950 | ||
875 | arg[count] = '\0'; | 951 | if (sscanf(arg, "%d:%d:%d:%d", &event, &method_type, &type, &value) != 4) { |
876 | 952 | kfree(arg); | |
877 | if (sscanf(arg, "%d:%d:%d", &event, &type, &value) != 3) { | ||
878 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3")); | 953 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument 3")); |
879 | return_VALUE(-EINVAL); | 954 | return_VALUE(-EINVAL); |
880 | } | 955 | } |
881 | 956 | kfree(arg); | |
882 | if (type == ACPI_TYPE_INTEGER) { | 957 | if (type == ACPI_TYPE_INTEGER) { |
883 | handle = get_handle_from_hotkeylist(hotkey_list, event); | 958 | key = get_hotkey_by_event(hotkey_list, event); |
884 | method = (char *)get_method_from_hotkeylist(hotkey_list, event); | 959 | if(!key) |
960 | goto do_fail; | ||
885 | if (IS_EVENT(event)) | 961 | if (IS_EVENT(event)) |
886 | write_acpi_int(handle, method, value, NULL); | 962 | write_acpi_int(key->event_hotkey.action_handle, |
963 | key->event_hotkey.action_method, value, NULL); | ||
887 | else if (IS_POLL(event)) { | 964 | else if (IS_POLL(event)) { |
888 | struct acpi_polling_hotkey *key; | 965 | if ( method_type == POLL_METHOD ) |
889 | key = (struct acpi_polling_hotkey *) | 966 | read_acpi_int(key->poll_hotkey.poll_handle, |
890 | get_hotkey_by_event(hotkey_list, event); | 967 | key->poll_hotkey.poll_method, |
891 | read_acpi_int(handle, method, key->poll_result); | 968 | key->poll_hotkey.poll_result); |
969 | else if ( method_type == ACTION_METHOD ) | ||
970 | write_acpi_int(key->poll_hotkey.action_handle, | ||
971 | key->poll_hotkey.action_method, value, NULL); | ||
972 | else | ||
973 | goto do_fail; | ||
974 | |||
892 | } | 975 | } |
893 | } else { | 976 | } else { |
894 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported")); | 977 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Not supported")); |
895 | return_VALUE(-EINVAL); | 978 | return_VALUE(-EINVAL); |
896 | } | 979 | } |
897 | |||
898 | return_VALUE(count); | 980 | return_VALUE(count); |
981 | do_fail: | ||
982 | return_VALUE(-EINVAL); | ||
983 | |||
899 | } | 984 | } |
900 | 985 | ||
901 | static int __init hotkey_init(void) | 986 | static int __init hotkey_init(void) |
@@ -928,7 +1013,7 @@ static int __init hotkey_init(void) | |||
928 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 1013 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
929 | "Hotkey: Unable to create %s entry\n", | 1014 | "Hotkey: Unable to create %s entry\n", |
930 | HOTKEY_EV_CONFIG)); | 1015 | HOTKEY_EV_CONFIG)); |
931 | return (-ENODEV); | 1016 | goto do_fail1; |
932 | } else { | 1017 | } else { |
933 | hotkey_config->proc_fops = &hotkey_config_fops; | 1018 | hotkey_config->proc_fops = &hotkey_config_fops; |
934 | hotkey_config->data = &global_hotkey_list; | 1019 | hotkey_config->data = &global_hotkey_list; |
@@ -943,7 +1028,8 @@ static int __init hotkey_init(void) | |||
943 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 1028 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
944 | "Hotkey: Unable to create %s entry\n", | 1029 | "Hotkey: Unable to create %s entry\n", |
945 | HOTKEY_EV_CONFIG)); | 1030 | HOTKEY_EV_CONFIG)); |
946 | return (-ENODEV); | 1031 | |
1032 | goto do_fail2; | ||
947 | } else { | 1033 | } else { |
948 | hotkey_poll_config->proc_fops = &hotkey_poll_config_fops; | 1034 | hotkey_poll_config->proc_fops = &hotkey_poll_config_fops; |
949 | hotkey_poll_config->data = &global_hotkey_list; | 1035 | hotkey_poll_config->data = &global_hotkey_list; |
@@ -957,7 +1043,7 @@ static int __init hotkey_init(void) | |||
957 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 1043 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
958 | "Hotkey: Unable to create %s entry\n", | 1044 | "Hotkey: Unable to create %s entry\n", |
959 | HOTKEY_ACTION)); | 1045 | HOTKEY_ACTION)); |
960 | return (-ENODEV); | 1046 | goto do_fail3; |
961 | } else { | 1047 | } else { |
962 | hotkey_action->proc_fops = &hotkey_action_fops; | 1048 | hotkey_action->proc_fops = &hotkey_action_fops; |
963 | hotkey_action->owner = THIS_MODULE; | 1049 | hotkey_action->owner = THIS_MODULE; |
@@ -970,7 +1056,7 @@ static int __init hotkey_init(void) | |||
970 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 1056 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
971 | "Hotkey: Unable to create %s entry\n", | 1057 | "Hotkey: Unable to create %s entry\n", |
972 | HOTKEY_INFO)); | 1058 | HOTKEY_INFO)); |
973 | return (-ENODEV); | 1059 | goto do_fail4; |
974 | } else { | 1060 | } else { |
975 | hotkey_info->proc_fops = &hotkey_info_fops; | 1061 | hotkey_info->proc_fops = &hotkey_info_fops; |
976 | hotkey_info->owner = THIS_MODULE; | 1062 | hotkey_info->owner = THIS_MODULE; |
@@ -979,23 +1065,33 @@ static int __init hotkey_init(void) | |||
979 | } | 1065 | } |
980 | 1066 | ||
981 | result = acpi_bus_register_driver(&hotkey_driver); | 1067 | result = acpi_bus_register_driver(&hotkey_driver); |
982 | if (result < 0) { | 1068 | if (result < 0) |
983 | remove_proc_entry(HOTKEY_PROC, acpi_root_dir); | 1069 | goto do_fail5; |
984 | return (-ENODEV); | ||
985 | } | ||
986 | global_hotkey_list.count = 0; | 1070 | global_hotkey_list.count = 0; |
987 | global_hotkey_list.entries = &hotkey_entries; | 1071 | global_hotkey_list.entries = &hotkey_entries; |
988 | 1072 | ||
989 | INIT_LIST_HEAD(&hotkey_entries); | 1073 | INIT_LIST_HEAD(&hotkey_entries); |
990 | 1074 | ||
991 | return (0); | 1075 | return (0); |
1076 | |||
1077 | do_fail5: | ||
1078 | remove_proc_entry(HOTKEY_INFO, hotkey_proc_dir); | ||
1079 | do_fail4: | ||
1080 | remove_proc_entry(HOTKEY_ACTION, hotkey_proc_dir); | ||
1081 | do_fail3: | ||
1082 | remove_proc_entry(HOTKEY_PL_CONFIG, hotkey_proc_dir); | ||
1083 | do_fail2: | ||
1084 | remove_proc_entry(HOTKEY_EV_CONFIG, hotkey_proc_dir); | ||
1085 | do_fail1: | ||
1086 | remove_proc_entry(HOTKEY_PROC, acpi_root_dir); | ||
1087 | return (-ENODEV); | ||
992 | } | 1088 | } |
993 | 1089 | ||
994 | static void __exit hotkey_exit(void) | 1090 | static void __exit hotkey_exit(void) |
995 | { | 1091 | { |
996 | struct list_head *entries, *next; | 1092 | struct list_head *entries, *next; |
997 | 1093 | ||
998 | ACPI_FUNCTION_TRACE("hotkey_remove"); | 1094 | ACPI_FUNCTION_TRACE("hotkey_exit"); |
999 | 1095 | ||
1000 | list_for_each_safe(entries, next, global_hotkey_list.entries) { | 1096 | list_for_each_safe(entries, next, global_hotkey_list.entries) { |
1001 | union acpi_hotkey *key = | 1097 | union acpi_hotkey *key = |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index bdd9f37f8101..0d11d6e6abd6 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(acpi_in_debugger); | |||
71 | extern char line_buf[80]; | 71 | extern char line_buf[80]; |
72 | #endif /*ENABLE_DEBUGGER*/ | 72 | #endif /*ENABLE_DEBUGGER*/ |
73 | 73 | ||
74 | int acpi_specific_hotkey_enabled; | 74 | int acpi_specific_hotkey_enabled = TRUE; |
75 | EXPORT_SYMBOL(acpi_specific_hotkey_enabled); | 75 | EXPORT_SYMBOL(acpi_specific_hotkey_enabled); |
76 | 76 | ||
77 | static unsigned int acpi_irq_irq; | 77 | static unsigned int acpi_irq_irq; |
@@ -145,10 +145,14 @@ acpi_os_vprintf(const char *fmt, va_list args) | |||
145 | #endif | 145 | #endif |
146 | } | 146 | } |
147 | 147 | ||
148 | extern int acpi_in_resume; | ||
148 | void * | 149 | void * |
149 | acpi_os_allocate(acpi_size size) | 150 | acpi_os_allocate(acpi_size size) |
150 | { | 151 | { |
151 | return kmalloc(size, GFP_KERNEL); | 152 | if (acpi_in_resume) |
153 | return kmalloc(size, GFP_ATOMIC); | ||
154 | else | ||
155 | return kmalloc(size, GFP_KERNEL); | ||
152 | } | 156 | } |
153 | 157 | ||
154 | void | 158 | void |
@@ -1158,11 +1162,11 @@ __setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup); | |||
1158 | int __init | 1162 | int __init |
1159 | acpi_hotkey_setup(char *str) | 1163 | acpi_hotkey_setup(char *str) |
1160 | { | 1164 | { |
1161 | acpi_specific_hotkey_enabled = TRUE; | 1165 | acpi_specific_hotkey_enabled = FALSE; |
1162 | return 1; | 1166 | return 1; |
1163 | } | 1167 | } |
1164 | 1168 | ||
1165 | __setup("acpi_specific_hotkey", acpi_hotkey_setup); | 1169 | __setup("acpi_generic_hotkey", acpi_hotkey_setup); |
1166 | 1170 | ||
1167 | /* | 1171 | /* |
1168 | * max_cstate is defined in the base kernel so modules can | 1172 | * max_cstate is defined in the base kernel so modules can |
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index d1f42b972821..bb973d2109a1 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -269,7 +269,51 @@ acpi_pci_irq_del_prt (int segment, int bus) | |||
269 | /* -------------------------------------------------------------------------- | 269 | /* -------------------------------------------------------------------------- |
270 | PCI Interrupt Routing Support | 270 | PCI Interrupt Routing Support |
271 | -------------------------------------------------------------------------- */ | 271 | -------------------------------------------------------------------------- */ |
272 | typedef int (*irq_lookup_func)(struct acpi_prt_entry *, int *, int *, char **); | ||
272 | 273 | ||
274 | static int | ||
275 | acpi_pci_allocate_irq(struct acpi_prt_entry *entry, | ||
276 | int *edge_level, | ||
277 | int *active_high_low, | ||
278 | char **link) | ||
279 | { | ||
280 | int irq; | ||
281 | |||
282 | ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq"); | ||
283 | |||
284 | if (entry->link.handle) { | ||
285 | irq = acpi_pci_link_allocate_irq(entry->link.handle, | ||
286 | entry->link.index, edge_level, active_high_low, link); | ||
287 | if (irq < 0) { | ||
288 | ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n")); | ||
289 | return_VALUE(-1); | ||
290 | } | ||
291 | } else { | ||
292 | irq = entry->link.index; | ||
293 | *edge_level = ACPI_LEVEL_SENSITIVE; | ||
294 | *active_high_low = ACPI_ACTIVE_LOW; | ||
295 | } | ||
296 | |||
297 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); | ||
298 | return_VALUE(irq); | ||
299 | } | ||
300 | |||
301 | static int | ||
302 | acpi_pci_free_irq(struct acpi_prt_entry *entry, | ||
303 | int *edge_level, | ||
304 | int *active_high_low, | ||
305 | char **link) | ||
306 | { | ||
307 | int irq; | ||
308 | |||
309 | ACPI_FUNCTION_TRACE("acpi_pci_free_irq"); | ||
310 | if (entry->link.handle) { | ||
311 | irq = acpi_pci_link_free_irq(entry->link.handle); | ||
312 | } else { | ||
313 | irq = entry->link.index; | ||
314 | } | ||
315 | return_VALUE(irq); | ||
316 | } | ||
273 | /* | 317 | /* |
274 | * acpi_pci_irq_lookup | 318 | * acpi_pci_irq_lookup |
275 | * success: return IRQ >= 0 | 319 | * success: return IRQ >= 0 |
@@ -282,12 +326,13 @@ acpi_pci_irq_lookup ( | |||
282 | int pin, | 326 | int pin, |
283 | int *edge_level, | 327 | int *edge_level, |
284 | int *active_high_low, | 328 | int *active_high_low, |
285 | char **link) | 329 | char **link, |
330 | irq_lookup_func func) | ||
286 | { | 331 | { |
287 | struct acpi_prt_entry *entry = NULL; | 332 | struct acpi_prt_entry *entry = NULL; |
288 | int segment = pci_domain_nr(bus); | 333 | int segment = pci_domain_nr(bus); |
289 | int bus_nr = bus->number; | 334 | int bus_nr = bus->number; |
290 | int irq; | 335 | int ret; |
291 | 336 | ||
292 | ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup"); | 337 | ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup"); |
293 | 338 | ||
@@ -301,22 +346,8 @@ acpi_pci_irq_lookup ( | |||
301 | return_VALUE(-1); | 346 | return_VALUE(-1); |
302 | } | 347 | } |
303 | 348 | ||
304 | if (entry->link.handle) { | 349 | ret = func(entry, edge_level, active_high_low, link); |
305 | irq = acpi_pci_link_get_irq(entry->link.handle, | 350 | return_VALUE(ret); |
306 | entry->link.index, edge_level, active_high_low, link); | ||
307 | if (irq < 0) { | ||
308 | ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n")); | ||
309 | return_VALUE(-1); | ||
310 | } | ||
311 | } else { | ||
312 | irq = entry->link.index; | ||
313 | *edge_level = ACPI_LEVEL_SENSITIVE; | ||
314 | *active_high_low = ACPI_ACTIVE_LOW; | ||
315 | } | ||
316 | |||
317 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq)); | ||
318 | |||
319 | return_VALUE(irq); | ||
320 | } | 351 | } |
321 | 352 | ||
322 | /* | 353 | /* |
@@ -330,7 +361,8 @@ acpi_pci_irq_derive ( | |||
330 | int pin, | 361 | int pin, |
331 | int *edge_level, | 362 | int *edge_level, |
332 | int *active_high_low, | 363 | int *active_high_low, |
333 | char **link) | 364 | char **link, |
365 | irq_lookup_func func) | ||
334 | { | 366 | { |
335 | struct pci_dev *bridge = dev; | 367 | struct pci_dev *bridge = dev; |
336 | int irq = -1; | 368 | int irq = -1; |
@@ -363,7 +395,7 @@ acpi_pci_irq_derive ( | |||
363 | } | 395 | } |
364 | 396 | ||
365 | irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn), | 397 | irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn), |
366 | pin, edge_level, active_high_low, link); | 398 | pin, edge_level, active_high_low, link, func); |
367 | } | 399 | } |
368 | 400 | ||
369 | if (irq < 0) { | 401 | if (irq < 0) { |
@@ -415,7 +447,7 @@ acpi_pci_irq_enable ( | |||
415 | * values override any BIOS-assigned IRQs set during boot. | 447 | * values override any BIOS-assigned IRQs set during boot. |
416 | */ | 448 | */ |
417 | irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, | 449 | irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, |
418 | &edge_level, &active_high_low, &link); | 450 | &edge_level, &active_high_low, &link, acpi_pci_allocate_irq); |
419 | 451 | ||
420 | /* | 452 | /* |
421 | * If no PRT entry was found, we'll try to derive an IRQ from the | 453 | * If no PRT entry was found, we'll try to derive an IRQ from the |
@@ -423,7 +455,7 @@ acpi_pci_irq_enable ( | |||
423 | */ | 455 | */ |
424 | if (irq < 0) | 456 | if (irq < 0) |
425 | irq = acpi_pci_irq_derive(dev, pin, &edge_level, | 457 | irq = acpi_pci_irq_derive(dev, pin, &edge_level, |
426 | &active_high_low, &link); | 458 | &active_high_low, &link, acpi_pci_allocate_irq); |
427 | 459 | ||
428 | /* | 460 | /* |
429 | * No IRQ known to the ACPI subsystem - maybe the BIOS / | 461 | * No IRQ known to the ACPI subsystem - maybe the BIOS / |
@@ -462,7 +494,9 @@ acpi_pci_irq_enable ( | |||
462 | EXPORT_SYMBOL(acpi_pci_irq_enable); | 494 | EXPORT_SYMBOL(acpi_pci_irq_enable); |
463 | 495 | ||
464 | 496 | ||
465 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ | 497 | /* FIXME: implement x86/x86_64 version */ |
498 | void __attribute__((weak)) acpi_unregister_gsi(u32 i) {} | ||
499 | |||
466 | void | 500 | void |
467 | acpi_pci_irq_disable ( | 501 | acpi_pci_irq_disable ( |
468 | struct pci_dev *dev) | 502 | struct pci_dev *dev) |
@@ -489,14 +523,14 @@ acpi_pci_irq_disable ( | |||
489 | * First we check the PCI IRQ routing table (PRT) for an IRQ. | 523 | * First we check the PCI IRQ routing table (PRT) for an IRQ. |
490 | */ | 524 | */ |
491 | gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, | 525 | gsi = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, |
492 | &edge_level, &active_high_low, NULL); | 526 | &edge_level, &active_high_low, NULL, acpi_pci_free_irq); |
493 | /* | 527 | /* |
494 | * If no PRT entry was found, we'll try to derive an IRQ from the | 528 | * If no PRT entry was found, we'll try to derive an IRQ from the |
495 | * device's parent bridge. | 529 | * device's parent bridge. |
496 | */ | 530 | */ |
497 | if (gsi < 0) | 531 | if (gsi < 0) |
498 | gsi = acpi_pci_irq_derive(dev, pin, | 532 | gsi = acpi_pci_irq_derive(dev, pin, |
499 | &edge_level, &active_high_low, NULL); | 533 | &edge_level, &active_high_low, NULL, acpi_pci_free_irq); |
500 | if (gsi < 0) | 534 | if (gsi < 0) |
501 | return_VOID; | 535 | return_VOID; |
502 | 536 | ||
@@ -512,4 +546,3 @@ acpi_pci_irq_disable ( | |||
512 | 546 | ||
513 | return_VOID; | 547 | return_VOID; |
514 | } | 548 | } |
515 | #endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ | ||
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 6ad0e77df9b3..834c2ceff1aa 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -68,6 +68,10 @@ static struct acpi_driver acpi_pci_link_driver = { | |||
68 | }, | 68 | }, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | /* | ||
72 | * If a link is initialized, we never change its active and initialized | ||
73 | * later even the link is disable. Instead, we just repick the active irq | ||
74 | */ | ||
71 | struct acpi_pci_link_irq { | 75 | struct acpi_pci_link_irq { |
72 | u8 active; /* Current IRQ */ | 76 | u8 active; /* Current IRQ */ |
73 | u8 edge_level; /* All IRQs */ | 77 | u8 edge_level; /* All IRQs */ |
@@ -76,8 +80,7 @@ struct acpi_pci_link_irq { | |||
76 | u8 possible_count; | 80 | u8 possible_count; |
77 | u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; | 81 | u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; |
78 | u8 initialized:1; | 82 | u8 initialized:1; |
79 | u8 suspend_resume:1; | 83 | u8 reserved:7; |
80 | u8 reserved:6; | ||
81 | }; | 84 | }; |
82 | 85 | ||
83 | struct acpi_pci_link { | 86 | struct acpi_pci_link { |
@@ -85,12 +88,14 @@ struct acpi_pci_link { | |||
85 | struct acpi_device *device; | 88 | struct acpi_device *device; |
86 | acpi_handle handle; | 89 | acpi_handle handle; |
87 | struct acpi_pci_link_irq irq; | 90 | struct acpi_pci_link_irq irq; |
91 | int refcnt; | ||
88 | }; | 92 | }; |
89 | 93 | ||
90 | static struct { | 94 | static struct { |
91 | int count; | 95 | int count; |
92 | struct list_head entries; | 96 | struct list_head entries; |
93 | } acpi_link; | 97 | } acpi_link; |
98 | DECLARE_MUTEX(acpi_link_lock); | ||
94 | 99 | ||
95 | 100 | ||
96 | /* -------------------------------------------------------------------------- | 101 | /* -------------------------------------------------------------------------- |
@@ -532,12 +537,12 @@ static int acpi_pci_link_allocate( | |||
532 | 537 | ||
533 | ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); | 538 | ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); |
534 | 539 | ||
535 | if (link->irq.suspend_resume) { | 540 | if (link->irq.initialized) { |
536 | acpi_pci_link_set(link, link->irq.active); | 541 | if (link->refcnt == 0) |
537 | link->irq.suspend_resume = 0; | 542 | /* This means the link is disabled but initialized */ |
538 | } | 543 | acpi_pci_link_set(link, link->irq.active); |
539 | if (link->irq.initialized) | ||
540 | return_VALUE(0); | 544 | return_VALUE(0); |
545 | } | ||
541 | 546 | ||
542 | /* | 547 | /* |
543 | * search for active IRQ in list of possible IRQs. | 548 | * search for active IRQ in list of possible IRQs. |
@@ -596,13 +601,13 @@ static int acpi_pci_link_allocate( | |||
596 | } | 601 | } |
597 | 602 | ||
598 | /* | 603 | /* |
599 | * acpi_pci_link_get_irq | 604 | * acpi_pci_link_allocate_irq |
600 | * success: return IRQ >= 0 | 605 | * success: return IRQ >= 0 |
601 | * failure: return -1 | 606 | * failure: return -1 |
602 | */ | 607 | */ |
603 | 608 | ||
604 | int | 609 | int |
605 | acpi_pci_link_get_irq ( | 610 | acpi_pci_link_allocate_irq ( |
606 | acpi_handle handle, | 611 | acpi_handle handle, |
607 | int index, | 612 | int index, |
608 | int *edge_level, | 613 | int *edge_level, |
@@ -613,7 +618,7 @@ acpi_pci_link_get_irq ( | |||
613 | struct acpi_device *device = NULL; | 618 | struct acpi_device *device = NULL; |
614 | struct acpi_pci_link *link = NULL; | 619 | struct acpi_pci_link *link = NULL; |
615 | 620 | ||
616 | ACPI_FUNCTION_TRACE("acpi_pci_link_get_irq"); | 621 | ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq"); |
617 | 622 | ||
618 | result = acpi_bus_get_device(handle, &device); | 623 | result = acpi_bus_get_device(handle, &device); |
619 | if (result) { | 624 | if (result) { |
@@ -633,21 +638,81 @@ acpi_pci_link_get_irq ( | |||
633 | return_VALUE(-1); | 638 | return_VALUE(-1); |
634 | } | 639 | } |
635 | 640 | ||
636 | if (acpi_pci_link_allocate(link)) | 641 | down(&acpi_link_lock); |
642 | if (acpi_pci_link_allocate(link)) { | ||
643 | up(&acpi_link_lock); | ||
637 | return_VALUE(-1); | 644 | return_VALUE(-1); |
645 | } | ||
638 | 646 | ||
639 | if (!link->irq.active) { | 647 | if (!link->irq.active) { |
648 | up(&acpi_link_lock); | ||
640 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); | 649 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link active IRQ is 0!\n")); |
641 | return_VALUE(-1); | 650 | return_VALUE(-1); |
642 | } | 651 | } |
652 | link->refcnt ++; | ||
653 | up(&acpi_link_lock); | ||
643 | 654 | ||
644 | if (edge_level) *edge_level = link->irq.edge_level; | 655 | if (edge_level) *edge_level = link->irq.edge_level; |
645 | if (active_high_low) *active_high_low = link->irq.active_high_low; | 656 | if (active_high_low) *active_high_low = link->irq.active_high_low; |
646 | if (name) *name = acpi_device_bid(link->device); | 657 | if (name) *name = acpi_device_bid(link->device); |
658 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
659 | "Link %s is referenced\n", acpi_device_bid(link->device))); | ||
647 | return_VALUE(link->irq.active); | 660 | return_VALUE(link->irq.active); |
648 | } | 661 | } |
649 | 662 | ||
663 | /* | ||
664 | * We don't change link's irq information here. After it is reenabled, we | ||
665 | * continue use the info | ||
666 | */ | ||
667 | int | ||
668 | acpi_pci_link_free_irq(acpi_handle handle) | ||
669 | { | ||
670 | struct acpi_device *device = NULL; | ||
671 | struct acpi_pci_link *link = NULL; | ||
672 | acpi_status result; | ||
673 | |||
674 | ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq"); | ||
675 | |||
676 | result = acpi_bus_get_device(handle, &device); | ||
677 | if (result) { | ||
678 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link device\n")); | ||
679 | return_VALUE(-1); | ||
680 | } | ||
681 | |||
682 | link = (struct acpi_pci_link *) acpi_driver_data(device); | ||
683 | if (!link) { | ||
684 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); | ||
685 | return_VALUE(-1); | ||
686 | } | ||
687 | |||
688 | down(&acpi_link_lock); | ||
689 | if (!link->irq.initialized) { | ||
690 | up(&acpi_link_lock); | ||
691 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link isn't initialized\n")); | ||
692 | return_VALUE(-1); | ||
693 | } | ||
650 | 694 | ||
695 | #ifdef FUTURE_USE | ||
696 | /* | ||
697 | * The Link reference count allows us to _DISable an unused link | ||
698 | * and suspend time, and set it again on resume. | ||
699 | * However, 2.6.12 still has irq_router.resume | ||
700 | * which blindly restores the link state. | ||
701 | * So we disable the reference count method | ||
702 | * to prevent duplicate acpi_pci_link_set() | ||
703 | * which would harm some systems | ||
704 | */ | ||
705 | link->refcnt --; | ||
706 | #endif | ||
707 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | ||
708 | "Link %s is dereferenced\n", acpi_device_bid(link->device))); | ||
709 | |||
710 | if (link->refcnt == 0) { | ||
711 | acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); | ||
712 | } | ||
713 | up(&acpi_link_lock); | ||
714 | return_VALUE(link->irq.active); | ||
715 | } | ||
651 | /* -------------------------------------------------------------------------- | 716 | /* -------------------------------------------------------------------------- |
652 | Driver Interface | 717 | Driver Interface |
653 | -------------------------------------------------------------------------- */ | 718 | -------------------------------------------------------------------------- */ |
@@ -677,6 +742,7 @@ acpi_pci_link_add ( | |||
677 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); | 742 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); |
678 | acpi_driver_data(device) = link; | 743 | acpi_driver_data(device) = link; |
679 | 744 | ||
745 | down(&acpi_link_lock); | ||
680 | result = acpi_pci_link_get_possible(link); | 746 | result = acpi_pci_link_get_possible(link); |
681 | if (result) | 747 | if (result) |
682 | goto end; | 748 | goto end; |
@@ -712,6 +778,7 @@ acpi_pci_link_add ( | |||
712 | end: | 778 | end: |
713 | /* disable all links -- to be activated on use */ | 779 | /* disable all links -- to be activated on use */ |
714 | acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); | 780 | acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); |
781 | up(&acpi_link_lock); | ||
715 | 782 | ||
716 | if (result) | 783 | if (result) |
717 | kfree(link); | 784 | kfree(link); |
@@ -720,24 +787,42 @@ end: | |||
720 | } | 787 | } |
721 | 788 | ||
722 | static int | 789 | static int |
723 | irqrouter_suspend( | 790 | acpi_pci_link_resume( |
724 | struct sys_device *dev, | 791 | struct acpi_pci_link *link) |
725 | u32 state) | 792 | { |
793 | ACPI_FUNCTION_TRACE("acpi_pci_link_resume"); | ||
794 | |||
795 | if (link->refcnt && link->irq.active && link->irq.initialized) | ||
796 | return_VALUE(acpi_pci_link_set(link, link->irq.active)); | ||
797 | else | ||
798 | return_VALUE(0); | ||
799 | } | ||
800 | |||
801 | /* | ||
802 | * FIXME: this is a workaround to avoid nasty warning. It will be removed | ||
803 | * after every device calls pci_disable_device in .resume. | ||
804 | */ | ||
805 | int acpi_in_resume; | ||
806 | static int | ||
807 | irqrouter_resume( | ||
808 | struct sys_device *dev) | ||
726 | { | 809 | { |
727 | struct list_head *node = NULL; | 810 | struct list_head *node = NULL; |
728 | struct acpi_pci_link *link = NULL; | 811 | struct acpi_pci_link *link = NULL; |
729 | 812 | ||
730 | ACPI_FUNCTION_TRACE("irqrouter_suspend"); | 813 | ACPI_FUNCTION_TRACE("irqrouter_resume"); |
731 | 814 | ||
815 | acpi_in_resume = 1; | ||
732 | list_for_each(node, &acpi_link.entries) { | 816 | list_for_each(node, &acpi_link.entries) { |
733 | link = list_entry(node, struct acpi_pci_link, node); | 817 | link = list_entry(node, struct acpi_pci_link, node); |
734 | if (!link) { | 818 | if (!link) { |
735 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); | 819 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
820 | "Invalid link context\n")); | ||
736 | continue; | 821 | continue; |
737 | } | 822 | } |
738 | if (link->irq.active && link->irq.initialized) | 823 | acpi_pci_link_resume(link); |
739 | link->irq.suspend_resume = 1; | ||
740 | } | 824 | } |
825 | acpi_in_resume = 0; | ||
741 | return_VALUE(0); | 826 | return_VALUE(0); |
742 | } | 827 | } |
743 | 828 | ||
@@ -756,8 +841,9 @@ acpi_pci_link_remove ( | |||
756 | 841 | ||
757 | link = (struct acpi_pci_link *) acpi_driver_data(device); | 842 | link = (struct acpi_pci_link *) acpi_driver_data(device); |
758 | 843 | ||
759 | /* TBD: Acquire/release lock */ | 844 | down(&acpi_link_lock); |
760 | list_del(&link->node); | 845 | list_del(&link->node); |
846 | up(&acpi_link_lock); | ||
761 | 847 | ||
762 | kfree(link); | 848 | kfree(link); |
763 | 849 | ||
@@ -849,9 +935,10 @@ int __init acpi_irq_balance_set(char *str) | |||
849 | __setup("acpi_irq_balance", acpi_irq_balance_set); | 935 | __setup("acpi_irq_balance", acpi_irq_balance_set); |
850 | 936 | ||
851 | 937 | ||
938 | /* FIXME: we will remove this interface after all drivers call pci_disable_device */ | ||
852 | static struct sysdev_class irqrouter_sysdev_class = { | 939 | static struct sysdev_class irqrouter_sysdev_class = { |
853 | set_kset_name("irqrouter"), | 940 | set_kset_name("irqrouter"), |
854 | .suspend = irqrouter_suspend, | 941 | .resume = irqrouter_resume, |
855 | }; | 942 | }; |
856 | 943 | ||
857 | 944 | ||
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 893b074e3d1a..2c04740c6543 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -81,30 +81,32 @@ module_param(bm_history, uint, 0644); | |||
81 | * | 81 | * |
82 | * To skip this limit, boot/load with a large max_cstate limit. | 82 | * To skip this limit, boot/load with a large max_cstate limit. |
83 | */ | 83 | */ |
84 | static int no_c2c3(struct dmi_system_id *id) | 84 | static int set_max_cstate(struct dmi_system_id *id) |
85 | { | 85 | { |
86 | if (max_cstate > ACPI_PROCESSOR_MAX_POWER) | 86 | if (max_cstate > ACPI_PROCESSOR_MAX_POWER) |
87 | return 0; | 87 | return 0; |
88 | 88 | ||
89 | printk(KERN_NOTICE PREFIX "%s detected - C2,C3 disabled." | 89 | printk(KERN_NOTICE PREFIX "%s detected - limiting to C%ld max_cstate." |
90 | " Override with \"processor.max_cstate=%d\"\n", id->ident, | 90 | " Override with \"processor.max_cstate=%d\"\n", id->ident, |
91 | ACPI_PROCESSOR_MAX_POWER + 1); | 91 | (long)id->driver_data, ACPI_PROCESSOR_MAX_POWER + 1); |
92 | 92 | ||
93 | max_cstate = 1; | 93 | max_cstate = (long)id->driver_data; |
94 | 94 | ||
95 | return 0; | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | |||
100 | |||
101 | static struct dmi_system_id __initdata processor_power_dmi_table[] = { | 99 | static struct dmi_system_id __initdata processor_power_dmi_table[] = { |
102 | { no_c2c3, "IBM ThinkPad R40e", { | 100 | { set_max_cstate, "IBM ThinkPad R40e", { |
103 | DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), | 101 | DMI_MATCH(DMI_BIOS_VENDOR,"IBM"), |
104 | DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }}, | 102 | DMI_MATCH(DMI_BIOS_VERSION,"1SET60WW") }, (void*)1}, |
105 | { no_c2c3, "Medion 41700", { | 103 | { set_max_cstate, "Medion 41700", { |
104 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), | ||
105 | DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J") }, (void*)1}, | ||
106 | { set_max_cstate, "Clevo 5600D", { | ||
106 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), | 107 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), |
107 | DMI_MATCH(DMI_BIOS_VERSION,"R01-A1J") }}, | 108 | DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307") }, |
109 | (void*)2}, | ||
108 | {}, | 110 | {}, |
109 | }; | 111 | }; |
110 | 112 | ||
@@ -549,7 +551,8 @@ static int acpi_processor_get_power_info_default_c1 (struct acpi_processor *pr) | |||
549 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); | 551 | ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1"); |
550 | 552 | ||
551 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) | 553 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) |
552 | memset(pr->power.states, 0, sizeof(struct acpi_processor_cx)); | 554 | memset(&(pr->power.states[i]), 0, |
555 | sizeof(struct acpi_processor_cx)); | ||
553 | 556 | ||
554 | /* if info is obtained from pblk/fadt, type equals state */ | 557 | /* if info is obtained from pblk/fadt, type equals state */ |
555 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; | 558 | pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1; |
@@ -580,7 +583,8 @@ static int acpi_processor_get_power_info_cst (struct acpi_processor *pr) | |||
580 | 583 | ||
581 | pr->power.count = 0; | 584 | pr->power.count = 0; |
582 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) | 585 | for (i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++) |
583 | memset(pr->power.states, 0, sizeof(struct acpi_processor_cx)); | 586 | memset(&(pr->power.states[i]), 0, |
587 | sizeof(struct acpi_processor_cx)); | ||
584 | 588 | ||
585 | status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer); | 589 | status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer); |
586 | if (ACPI_FAILURE(status)) { | 590 | if (ACPI_FAILURE(status)) { |
@@ -763,7 +767,6 @@ static void acpi_processor_power_verify_c3( | |||
763 | } | 767 | } |
764 | 768 | ||
765 | if (pr->flags.bm_check) { | 769 | if (pr->flags.bm_check) { |
766 | printk("Disabling BM access before entering C3\n"); | ||
767 | /* bus mastering control is necessary */ | 770 | /* bus mastering control is necessary */ |
768 | if (!pr->flags.bm_control) { | 771 | if (!pr->flags.bm_control) { |
769 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 772 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
@@ -771,7 +774,6 @@ static void acpi_processor_power_verify_c3( | |||
771 | return_VOID; | 774 | return_VOID; |
772 | } | 775 | } |
773 | } else { | 776 | } else { |
774 | printk("Invalidating cache before entering C3\n"); | ||
775 | /* | 777 | /* |
776 | * WBINVD should be set in fadt, for C3 state to be | 778 | * WBINVD should be set in fadt, for C3 state to be |
777 | * supported on when bm_check is not required. | 779 | * supported on when bm_check is not required. |
@@ -842,7 +844,7 @@ static int acpi_processor_get_power_info ( | |||
842 | result = acpi_processor_get_power_info_cst(pr); | 844 | result = acpi_processor_get_power_info_cst(pr); |
843 | if ((result) || (acpi_processor_power_verify(pr) < 2)) { | 845 | if ((result) || (acpi_processor_power_verify(pr) < 2)) { |
844 | result = acpi_processor_get_power_info_fadt(pr); | 846 | result = acpi_processor_get_power_info_fadt(pr); |
845 | if (result) | 847 | if ((result) || (acpi_processor_power_verify(pr) < 2)) |
846 | result = acpi_processor_get_power_info_default_c1(pr); | 848 | result = acpi_processor_get_power_info_default_c1(pr); |
847 | } | 849 | } |
848 | 850 | ||
diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c index 186b182c5825..f93d2ee54800 100644 --- a/drivers/acpi/sleep/poweroff.c +++ b/drivers/acpi/sleep/poweroff.c | |||
@@ -55,7 +55,11 @@ void acpi_power_off(void) | |||
55 | 55 | ||
56 | static int acpi_shutdown(struct sys_device *x) | 56 | static int acpi_shutdown(struct sys_device *x) |
57 | { | 57 | { |
58 | return acpi_sleep_prepare(ACPI_STATE_S5); | 58 | if (system_state == SYSTEM_POWER_OFF) { |
59 | /* Prepare if we are going to power off the system */ | ||
60 | return acpi_sleep_prepare(ACPI_STATE_S5); | ||
61 | } | ||
62 | return 0; | ||
59 | } | 63 | } |
60 | 64 | ||
61 | static struct sysdev_class acpi_sysclass = { | 65 | static struct sysdev_class acpi_sysclass = { |
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 96fe2f956754..ab53832d57e5 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -180,7 +180,9 @@ static ssize_t driver_bind(struct device_driver *drv, | |||
180 | up(&dev->sem); | 180 | up(&dev->sem); |
181 | put_device(dev); | 181 | put_device(dev); |
182 | } | 182 | } |
183 | return err; | 183 | if (err) |
184 | return err; | ||
185 | return count; | ||
184 | } | 186 | } |
185 | static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); | 187 | static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); |
186 | 188 | ||
diff --git a/drivers/base/class.c b/drivers/base/class.c index 479c12570881..0154a1623b21 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -299,6 +299,11 @@ static void class_dev_release(struct kobject * kobj) | |||
299 | 299 | ||
300 | pr_debug("device class '%s': release.\n", cd->class_id); | 300 | pr_debug("device class '%s': release.\n", cd->class_id); |
301 | 301 | ||
302 | if (cd->devt_attr) { | ||
303 | kfree(cd->devt_attr); | ||
304 | cd->devt_attr = NULL; | ||
305 | } | ||
306 | |||
302 | if (cls->release) | 307 | if (cls->release) |
303 | cls->release(cd); | 308 | cls->release(cd); |
304 | else { | 309 | else { |
@@ -591,11 +596,8 @@ void class_device_del(struct class_device *class_dev) | |||
591 | 596 | ||
592 | if (class_dev->dev) | 597 | if (class_dev->dev) |
593 | sysfs_remove_link(&class_dev->kobj, "device"); | 598 | sysfs_remove_link(&class_dev->kobj, "device"); |
594 | if (class_dev->devt_attr) { | 599 | if (class_dev->devt_attr) |
595 | class_device_remove_file(class_dev, class_dev->devt_attr); | 600 | class_device_remove_file(class_dev, class_dev->devt_attr); |
596 | kfree(class_dev->devt_attr); | ||
597 | class_dev->devt_attr = NULL; | ||
598 | } | ||
599 | class_device_remove_attrs(class_dev); | 601 | class_device_remove_attrs(class_dev); |
600 | 602 | ||
601 | kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); | 603 | kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); |
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c index de5746e38af9..cd056e7e64ec 100644 --- a/drivers/block/cfq-iosched.c +++ b/drivers/block/cfq-iosched.c | |||
@@ -47,7 +47,7 @@ static int cfq_slice_idle = HZ / 100; | |||
47 | /* | 47 | /* |
48 | * disable queueing at the driver/hardware level | 48 | * disable queueing at the driver/hardware level |
49 | */ | 49 | */ |
50 | static int cfq_max_depth = 1; | 50 | static int cfq_max_depth = 2; |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * for the hash of cfqq inside the cfqd | 53 | * for the hash of cfqq inside the cfqd |
@@ -385,9 +385,15 @@ cfq_choose_req(struct cfq_data *cfqd, struct cfq_rq *crq1, struct cfq_rq *crq2) | |||
385 | return crq2; | 385 | return crq2; |
386 | if (crq2 == NULL) | 386 | if (crq2 == NULL) |
387 | return crq1; | 387 | return crq1; |
388 | if (cfq_crq_requeued(crq1)) | 388 | |
389 | if (cfq_crq_requeued(crq1) && !cfq_crq_requeued(crq2)) | ||
389 | return crq1; | 390 | return crq1; |
390 | if (cfq_crq_requeued(crq2)) | 391 | else if (cfq_crq_requeued(crq2) && !cfq_crq_requeued(crq1)) |
392 | return crq2; | ||
393 | |||
394 | if (cfq_crq_is_sync(crq1) && !cfq_crq_is_sync(crq2)) | ||
395 | return crq1; | ||
396 | else if (cfq_crq_is_sync(crq2) && !cfq_crq_is_sync(crq1)) | ||
391 | return crq2; | 397 | return crq2; |
392 | 398 | ||
393 | s1 = crq1->request->sector; | 399 | s1 = crq1->request->sector; |
@@ -1281,6 +1287,7 @@ dispatch: | |||
1281 | */ | 1287 | */ |
1282 | if (!cfq_crq_in_driver(crq) && | 1288 | if (!cfq_crq_in_driver(crq) && |
1283 | !cfq_cfqq_idle_window(cfqq) && | 1289 | !cfq_cfqq_idle_window(cfqq) && |
1290 | !blk_barrier_rq(rq) && | ||
1284 | cfqd->rq_in_driver >= cfqd->cfq_max_depth) | 1291 | cfqd->rq_in_driver >= cfqd->cfq_max_depth) |
1285 | return NULL; | 1292 | return NULL; |
1286 | 1293 | ||
@@ -1768,18 +1775,23 @@ static void | |||
1768 | cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, | 1775 | cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, |
1769 | struct cfq_rq *crq) | 1776 | struct cfq_rq *crq) |
1770 | { | 1777 | { |
1771 | const int sync = cfq_crq_is_sync(crq); | 1778 | struct cfq_io_context *cic; |
1772 | 1779 | ||
1773 | cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); | 1780 | cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); |
1774 | 1781 | ||
1775 | if (sync) { | 1782 | /* |
1776 | struct cfq_io_context *cic = crq->io_context; | 1783 | * we never wait for an async request and we don't allow preemption |
1784 | * of an async request. so just return early | ||
1785 | */ | ||
1786 | if (!cfq_crq_is_sync(crq)) | ||
1787 | return; | ||
1777 | 1788 | ||
1778 | cfq_update_io_thinktime(cfqd, cic); | 1789 | cic = crq->io_context; |
1779 | cfq_update_idle_window(cfqd, cfqq, cic); | ||
1780 | 1790 | ||
1781 | cic->last_queue = jiffies; | 1791 | cfq_update_io_thinktime(cfqd, cic); |
1782 | } | 1792 | cfq_update_idle_window(cfqd, cfqq, cic); |
1793 | |||
1794 | cic->last_queue = jiffies; | ||
1783 | 1795 | ||
1784 | if (cfqq == cfqd->active_queue) { | 1796 | if (cfqq == cfqd->active_queue) { |
1785 | /* | 1797 | /* |
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 692a5fced76e..0c7599563b65 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c | |||
@@ -284,6 +284,7 @@ static inline void rq_init(request_queue_t *q, struct request *rq) | |||
284 | rq->special = NULL; | 284 | rq->special = NULL; |
285 | rq->data_len = 0; | 285 | rq->data_len = 0; |
286 | rq->data = NULL; | 286 | rq->data = NULL; |
287 | rq->nr_phys_segments = 0; | ||
287 | rq->sense = NULL; | 288 | rq->sense = NULL; |
288 | rq->end_io = NULL; | 289 | rq->end_io = NULL; |
289 | rq->end_io_data = NULL; | 290 | rq->end_io_data = NULL; |
@@ -719,7 +720,7 @@ struct request *blk_queue_find_tag(request_queue_t *q, int tag) | |||
719 | { | 720 | { |
720 | struct blk_queue_tag *bqt = q->queue_tags; | 721 | struct blk_queue_tag *bqt = q->queue_tags; |
721 | 722 | ||
722 | if (unlikely(bqt == NULL || tag >= bqt->max_depth)) | 723 | if (unlikely(bqt == NULL || tag >= bqt->real_max_depth)) |
723 | return NULL; | 724 | return NULL; |
724 | 725 | ||
725 | return bqt->tag_index[tag]; | 726 | return bqt->tag_index[tag]; |
@@ -798,6 +799,7 @@ init_tag_map(request_queue_t *q, struct blk_queue_tag *tags, int depth) | |||
798 | 799 | ||
799 | memset(tag_index, 0, depth * sizeof(struct request *)); | 800 | memset(tag_index, 0, depth * sizeof(struct request *)); |
800 | memset(tag_map, 0, nr_ulongs * sizeof(unsigned long)); | 801 | memset(tag_map, 0, nr_ulongs * sizeof(unsigned long)); |
802 | tags->real_max_depth = depth; | ||
801 | tags->max_depth = depth; | 803 | tags->max_depth = depth; |
802 | tags->tag_index = tag_index; | 804 | tags->tag_index = tag_index; |
803 | tags->tag_map = tag_map; | 805 | tags->tag_map = tag_map; |
@@ -872,11 +874,22 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth) | |||
872 | return -ENXIO; | 874 | return -ENXIO; |
873 | 875 | ||
874 | /* | 876 | /* |
877 | * if we already have large enough real_max_depth. just | ||
878 | * adjust max_depth. *NOTE* as requests with tag value | ||
879 | * between new_depth and real_max_depth can be in-flight, tag | ||
880 | * map can not be shrunk blindly here. | ||
881 | */ | ||
882 | if (new_depth <= bqt->real_max_depth) { | ||
883 | bqt->max_depth = new_depth; | ||
884 | return 0; | ||
885 | } | ||
886 | |||
887 | /* | ||
875 | * save the old state info, so we can copy it back | 888 | * save the old state info, so we can copy it back |
876 | */ | 889 | */ |
877 | tag_index = bqt->tag_index; | 890 | tag_index = bqt->tag_index; |
878 | tag_map = bqt->tag_map; | 891 | tag_map = bqt->tag_map; |
879 | max_depth = bqt->max_depth; | 892 | max_depth = bqt->real_max_depth; |
880 | 893 | ||
881 | if (init_tag_map(q, bqt, new_depth)) | 894 | if (init_tag_map(q, bqt, new_depth)) |
882 | return -ENOMEM; | 895 | return -ENOMEM; |
@@ -913,7 +926,7 @@ void blk_queue_end_tag(request_queue_t *q, struct request *rq) | |||
913 | 926 | ||
914 | BUG_ON(tag == -1); | 927 | BUG_ON(tag == -1); |
915 | 928 | ||
916 | if (unlikely(tag >= bqt->max_depth)) | 929 | if (unlikely(tag >= bqt->real_max_depth)) |
917 | /* | 930 | /* |
918 | * This can happen after tag depth has been reduced. | 931 | * This can happen after tag depth has been reduced. |
919 | * FIXME: how about a warning or info message here? | 932 | * FIXME: how about a warning or info message here? |
@@ -2103,7 +2116,7 @@ EXPORT_SYMBOL(blk_insert_request); | |||
2103 | /** | 2116 | /** |
2104 | * blk_rq_map_user - map user data to a request, for REQ_BLOCK_PC usage | 2117 | * blk_rq_map_user - map user data to a request, for REQ_BLOCK_PC usage |
2105 | * @q: request queue where request should be inserted | 2118 | * @q: request queue where request should be inserted |
2106 | * @rw: READ or WRITE data | 2119 | * @rq: request structure to fill |
2107 | * @ubuf: the user buffer | 2120 | * @ubuf: the user buffer |
2108 | * @len: length of user data | 2121 | * @len: length of user data |
2109 | * | 2122 | * |
@@ -2120,21 +2133,19 @@ EXPORT_SYMBOL(blk_insert_request); | |||
2120 | * original bio must be passed back in to blk_rq_unmap_user() for proper | 2133 | * original bio must be passed back in to blk_rq_unmap_user() for proper |
2121 | * unmapping. | 2134 | * unmapping. |
2122 | */ | 2135 | */ |
2123 | struct request *blk_rq_map_user(request_queue_t *q, int rw, void __user *ubuf, | 2136 | int blk_rq_map_user(request_queue_t *q, struct request *rq, void __user *ubuf, |
2124 | unsigned int len) | 2137 | unsigned int len) |
2125 | { | 2138 | { |
2126 | unsigned long uaddr; | 2139 | unsigned long uaddr; |
2127 | struct request *rq; | ||
2128 | struct bio *bio; | 2140 | struct bio *bio; |
2141 | int reading; | ||
2129 | 2142 | ||
2130 | if (len > (q->max_sectors << 9)) | 2143 | if (len > (q->max_sectors << 9)) |
2131 | return ERR_PTR(-EINVAL); | 2144 | return -EINVAL; |
2132 | if ((!len && ubuf) || (len && !ubuf)) | 2145 | if (!len || !ubuf) |
2133 | return ERR_PTR(-EINVAL); | 2146 | return -EINVAL; |
2134 | 2147 | ||
2135 | rq = blk_get_request(q, rw, __GFP_WAIT); | 2148 | reading = rq_data_dir(rq) == READ; |
2136 | if (!rq) | ||
2137 | return ERR_PTR(-ENOMEM); | ||
2138 | 2149 | ||
2139 | /* | 2150 | /* |
2140 | * if alignment requirement is satisfied, map in user pages for | 2151 | * if alignment requirement is satisfied, map in user pages for |
@@ -2142,9 +2153,9 @@ struct request *blk_rq_map_user(request_queue_t *q, int rw, void __user *ubuf, | |||
2142 | */ | 2153 | */ |
2143 | uaddr = (unsigned long) ubuf; | 2154 | uaddr = (unsigned long) ubuf; |
2144 | if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q))) | 2155 | if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q))) |
2145 | bio = bio_map_user(q, NULL, uaddr, len, rw == READ); | 2156 | bio = bio_map_user(q, NULL, uaddr, len, reading); |
2146 | else | 2157 | else |
2147 | bio = bio_copy_user(q, uaddr, len, rw == READ); | 2158 | bio = bio_copy_user(q, uaddr, len, reading); |
2148 | 2159 | ||
2149 | if (!IS_ERR(bio)) { | 2160 | if (!IS_ERR(bio)) { |
2150 | rq->bio = rq->biotail = bio; | 2161 | rq->bio = rq->biotail = bio; |
@@ -2152,28 +2163,70 @@ struct request *blk_rq_map_user(request_queue_t *q, int rw, void __user *ubuf, | |||
2152 | 2163 | ||
2153 | rq->buffer = rq->data = NULL; | 2164 | rq->buffer = rq->data = NULL; |
2154 | rq->data_len = len; | 2165 | rq->data_len = len; |
2155 | return rq; | 2166 | return 0; |
2156 | } | 2167 | } |
2157 | 2168 | ||
2158 | /* | 2169 | /* |
2159 | * bio is the err-ptr | 2170 | * bio is the err-ptr |
2160 | */ | 2171 | */ |
2161 | blk_put_request(rq); | 2172 | return PTR_ERR(bio); |
2162 | return (struct request *) bio; | ||
2163 | } | 2173 | } |
2164 | 2174 | ||
2165 | EXPORT_SYMBOL(blk_rq_map_user); | 2175 | EXPORT_SYMBOL(blk_rq_map_user); |
2166 | 2176 | ||
2167 | /** | 2177 | /** |
2178 | * blk_rq_map_user_iov - map user data to a request, for REQ_BLOCK_PC usage | ||
2179 | * @q: request queue where request should be inserted | ||
2180 | * @rq: request to map data to | ||
2181 | * @iov: pointer to the iovec | ||
2182 | * @iov_count: number of elements in the iovec | ||
2183 | * | ||
2184 | * Description: | ||
2185 | * Data will be mapped directly for zero copy io, if possible. Otherwise | ||
2186 | * a kernel bounce buffer is used. | ||
2187 | * | ||
2188 | * A matching blk_rq_unmap_user() must be issued at the end of io, while | ||
2189 | * still in process context. | ||
2190 | * | ||
2191 | * Note: The mapped bio may need to be bounced through blk_queue_bounce() | ||
2192 | * before being submitted to the device, as pages mapped may be out of | ||
2193 | * reach. It's the callers responsibility to make sure this happens. The | ||
2194 | * original bio must be passed back in to blk_rq_unmap_user() for proper | ||
2195 | * unmapping. | ||
2196 | */ | ||
2197 | int blk_rq_map_user_iov(request_queue_t *q, struct request *rq, | ||
2198 | struct sg_iovec *iov, int iov_count) | ||
2199 | { | ||
2200 | struct bio *bio; | ||
2201 | |||
2202 | if (!iov || iov_count <= 0) | ||
2203 | return -EINVAL; | ||
2204 | |||
2205 | /* we don't allow misaligned data like bio_map_user() does. If the | ||
2206 | * user is using sg, they're expected to know the alignment constraints | ||
2207 | * and respect them accordingly */ | ||
2208 | bio = bio_map_user_iov(q, NULL, iov, iov_count, rq_data_dir(rq)== READ); | ||
2209 | if (IS_ERR(bio)) | ||
2210 | return PTR_ERR(bio); | ||
2211 | |||
2212 | rq->bio = rq->biotail = bio; | ||
2213 | blk_rq_bio_prep(q, rq, bio); | ||
2214 | rq->buffer = rq->data = NULL; | ||
2215 | rq->data_len = bio->bi_size; | ||
2216 | return 0; | ||
2217 | } | ||
2218 | |||
2219 | EXPORT_SYMBOL(blk_rq_map_user_iov); | ||
2220 | |||
2221 | /** | ||
2168 | * blk_rq_unmap_user - unmap a request with user data | 2222 | * blk_rq_unmap_user - unmap a request with user data |
2169 | * @rq: request to be unmapped | 2223 | * @bio: bio to be unmapped |
2170 | * @bio: bio for the request | ||
2171 | * @ulen: length of user buffer | 2224 | * @ulen: length of user buffer |
2172 | * | 2225 | * |
2173 | * Description: | 2226 | * Description: |
2174 | * Unmap a request previously mapped by blk_rq_map_user(). | 2227 | * Unmap a bio previously mapped by blk_rq_map_user(). |
2175 | */ | 2228 | */ |
2176 | int blk_rq_unmap_user(struct request *rq, struct bio *bio, unsigned int ulen) | 2229 | int blk_rq_unmap_user(struct bio *bio, unsigned int ulen) |
2177 | { | 2230 | { |
2178 | int ret = 0; | 2231 | int ret = 0; |
2179 | 2232 | ||
@@ -2184,31 +2237,89 @@ int blk_rq_unmap_user(struct request *rq, struct bio *bio, unsigned int ulen) | |||
2184 | ret = bio_uncopy_user(bio); | 2237 | ret = bio_uncopy_user(bio); |
2185 | } | 2238 | } |
2186 | 2239 | ||
2187 | blk_put_request(rq); | 2240 | return 0; |
2188 | return ret; | ||
2189 | } | 2241 | } |
2190 | 2242 | ||
2191 | EXPORT_SYMBOL(blk_rq_unmap_user); | 2243 | EXPORT_SYMBOL(blk_rq_unmap_user); |
2192 | 2244 | ||
2193 | /** | 2245 | /** |
2246 | * blk_rq_map_kern - map kernel data to a request, for REQ_BLOCK_PC usage | ||
2247 | * @q: request queue where request should be inserted | ||
2248 | * @rq: request to fill | ||
2249 | * @kbuf: the kernel buffer | ||
2250 | * @len: length of user data | ||
2251 | * @gfp_mask: memory allocation flags | ||
2252 | */ | ||
2253 | int blk_rq_map_kern(request_queue_t *q, struct request *rq, void *kbuf, | ||
2254 | unsigned int len, unsigned int gfp_mask) | ||
2255 | { | ||
2256 | struct bio *bio; | ||
2257 | |||
2258 | if (len > (q->max_sectors << 9)) | ||
2259 | return -EINVAL; | ||
2260 | if (!len || !kbuf) | ||
2261 | return -EINVAL; | ||
2262 | |||
2263 | bio = bio_map_kern(q, kbuf, len, gfp_mask); | ||
2264 | if (IS_ERR(bio)) | ||
2265 | return PTR_ERR(bio); | ||
2266 | |||
2267 | if (rq_data_dir(rq) == WRITE) | ||
2268 | bio->bi_rw |= (1 << BIO_RW); | ||
2269 | |||
2270 | rq->bio = rq->biotail = bio; | ||
2271 | blk_rq_bio_prep(q, rq, bio); | ||
2272 | |||
2273 | rq->buffer = rq->data = NULL; | ||
2274 | rq->data_len = len; | ||
2275 | return 0; | ||
2276 | } | ||
2277 | |||
2278 | EXPORT_SYMBOL(blk_rq_map_kern); | ||
2279 | |||
2280 | /** | ||
2281 | * blk_execute_rq_nowait - insert a request into queue for execution | ||
2282 | * @q: queue to insert the request in | ||
2283 | * @bd_disk: matching gendisk | ||
2284 | * @rq: request to insert | ||
2285 | * @at_head: insert request at head or tail of queue | ||
2286 | * @done: I/O completion handler | ||
2287 | * | ||
2288 | * Description: | ||
2289 | * Insert a fully prepared request at the back of the io scheduler queue | ||
2290 | * for execution. Don't wait for completion. | ||
2291 | */ | ||
2292 | void blk_execute_rq_nowait(request_queue_t *q, struct gendisk *bd_disk, | ||
2293 | struct request *rq, int at_head, | ||
2294 | void (*done)(struct request *)) | ||
2295 | { | ||
2296 | int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; | ||
2297 | |||
2298 | rq->rq_disk = bd_disk; | ||
2299 | rq->flags |= REQ_NOMERGE; | ||
2300 | rq->end_io = done; | ||
2301 | elv_add_request(q, rq, where, 1); | ||
2302 | generic_unplug_device(q); | ||
2303 | } | ||
2304 | |||
2305 | /** | ||
2194 | * blk_execute_rq - insert a request into queue for execution | 2306 | * blk_execute_rq - insert a request into queue for execution |
2195 | * @q: queue to insert the request in | 2307 | * @q: queue to insert the request in |
2196 | * @bd_disk: matching gendisk | 2308 | * @bd_disk: matching gendisk |
2197 | * @rq: request to insert | 2309 | * @rq: request to insert |
2310 | * @at_head: insert request at head or tail of queue | ||
2198 | * | 2311 | * |
2199 | * Description: | 2312 | * Description: |
2200 | * Insert a fully prepared request at the back of the io scheduler queue | 2313 | * Insert a fully prepared request at the back of the io scheduler queue |
2201 | * for execution. | 2314 | * for execution and wait for completion. |
2202 | */ | 2315 | */ |
2203 | int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk, | 2316 | int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk, |
2204 | struct request *rq) | 2317 | struct request *rq, int at_head) |
2205 | { | 2318 | { |
2206 | DECLARE_COMPLETION(wait); | 2319 | DECLARE_COMPLETION(wait); |
2207 | char sense[SCSI_SENSE_BUFFERSIZE]; | 2320 | char sense[SCSI_SENSE_BUFFERSIZE]; |
2208 | int err = 0; | 2321 | int err = 0; |
2209 | 2322 | ||
2210 | rq->rq_disk = bd_disk; | ||
2211 | |||
2212 | /* | 2323 | /* |
2213 | * we need an extra reference to the request, so we can look at | 2324 | * we need an extra reference to the request, so we can look at |
2214 | * it after io completion | 2325 | * it after io completion |
@@ -2221,11 +2332,8 @@ int blk_execute_rq(request_queue_t *q, struct gendisk *bd_disk, | |||
2221 | rq->sense_len = 0; | 2332 | rq->sense_len = 0; |
2222 | } | 2333 | } |
2223 | 2334 | ||
2224 | rq->flags |= REQ_NOMERGE; | ||
2225 | rq->waiting = &wait; | 2335 | rq->waiting = &wait; |
2226 | rq->end_io = blk_end_sync_rq; | 2336 | blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq); |
2227 | elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); | ||
2228 | generic_unplug_device(q); | ||
2229 | wait_for_completion(&wait); | 2337 | wait_for_completion(&wait); |
2230 | rq->waiting = NULL; | 2338 | rq->waiting = NULL; |
2231 | 2339 | ||
@@ -2265,6 +2373,44 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector) | |||
2265 | 2373 | ||
2266 | EXPORT_SYMBOL(blkdev_issue_flush); | 2374 | EXPORT_SYMBOL(blkdev_issue_flush); |
2267 | 2375 | ||
2376 | /** | ||
2377 | * blkdev_scsi_issue_flush_fn - issue flush for SCSI devices | ||
2378 | * @q: device queue | ||
2379 | * @disk: gendisk | ||
2380 | * @error_sector: error offset | ||
2381 | * | ||
2382 | * Description: | ||
2383 | * Devices understanding the SCSI command set, can use this function as | ||
2384 | * a helper for issuing a cache flush. Note: driver is required to store | ||
2385 | * the error offset (in case of error flushing) in ->sector of struct | ||
2386 | * request. | ||
2387 | */ | ||
2388 | int blkdev_scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk, | ||
2389 | sector_t *error_sector) | ||
2390 | { | ||
2391 | struct request *rq = blk_get_request(q, WRITE, __GFP_WAIT); | ||
2392 | int ret; | ||
2393 | |||
2394 | rq->flags |= REQ_BLOCK_PC | REQ_SOFTBARRIER; | ||
2395 | rq->sector = 0; | ||
2396 | memset(rq->cmd, 0, sizeof(rq->cmd)); | ||
2397 | rq->cmd[0] = 0x35; | ||
2398 | rq->cmd_len = 12; | ||
2399 | rq->data = NULL; | ||
2400 | rq->data_len = 0; | ||
2401 | rq->timeout = 60 * HZ; | ||
2402 | |||
2403 | ret = blk_execute_rq(q, disk, rq, 0); | ||
2404 | |||
2405 | if (ret && error_sector) | ||
2406 | *error_sector = rq->sector; | ||
2407 | |||
2408 | blk_put_request(rq); | ||
2409 | return ret; | ||
2410 | } | ||
2411 | |||
2412 | EXPORT_SYMBOL(blkdev_scsi_issue_flush_fn); | ||
2413 | |||
2268 | static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io) | 2414 | static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io) |
2269 | { | 2415 | { |
2270 | int rw = rq_data_dir(rq); | 2416 | int rw = rq_data_dir(rq); |
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index 681871ca5d60..abb2df249fd3 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c | |||
@@ -216,7 +216,7 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
216 | struct gendisk *bd_disk, struct sg_io_hdr *hdr) | 216 | struct gendisk *bd_disk, struct sg_io_hdr *hdr) |
217 | { | 217 | { |
218 | unsigned long start_time; | 218 | unsigned long start_time; |
219 | int reading, writing; | 219 | int writing = 0, ret = 0; |
220 | struct request *rq; | 220 | struct request *rq; |
221 | struct bio *bio; | 221 | struct bio *bio; |
222 | char sense[SCSI_SENSE_BUFFERSIZE]; | 222 | char sense[SCSI_SENSE_BUFFERSIZE]; |
@@ -231,38 +231,48 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
231 | if (verify_command(file, cmd)) | 231 | if (verify_command(file, cmd)) |
232 | return -EPERM; | 232 | return -EPERM; |
233 | 233 | ||
234 | /* | ||
235 | * we'll do that later | ||
236 | */ | ||
237 | if (hdr->iovec_count) | ||
238 | return -EOPNOTSUPP; | ||
239 | |||
240 | if (hdr->dxfer_len > (q->max_sectors << 9)) | 234 | if (hdr->dxfer_len > (q->max_sectors << 9)) |
241 | return -EIO; | 235 | return -EIO; |
242 | 236 | ||
243 | reading = writing = 0; | 237 | if (hdr->dxfer_len) |
244 | if (hdr->dxfer_len) { | ||
245 | switch (hdr->dxfer_direction) { | 238 | switch (hdr->dxfer_direction) { |
246 | default: | 239 | default: |
247 | return -EINVAL; | 240 | return -EINVAL; |
248 | case SG_DXFER_TO_FROM_DEV: | 241 | case SG_DXFER_TO_FROM_DEV: |
249 | reading = 1; | ||
250 | /* fall through */ | ||
251 | case SG_DXFER_TO_DEV: | 242 | case SG_DXFER_TO_DEV: |
252 | writing = 1; | 243 | writing = 1; |
253 | break; | 244 | break; |
254 | case SG_DXFER_FROM_DEV: | 245 | case SG_DXFER_FROM_DEV: |
255 | reading = 1; | ||
256 | break; | 246 | break; |
257 | } | 247 | } |
258 | 248 | ||
259 | rq = blk_rq_map_user(q, writing ? WRITE : READ, hdr->dxferp, | 249 | rq = blk_get_request(q, writing ? WRITE : READ, GFP_KERNEL); |
260 | hdr->dxfer_len); | 250 | if (!rq) |
251 | return -ENOMEM; | ||
252 | |||
253 | if (hdr->iovec_count) { | ||
254 | const int size = sizeof(struct sg_iovec) * hdr->iovec_count; | ||
255 | struct sg_iovec *iov; | ||
256 | |||
257 | iov = kmalloc(size, GFP_KERNEL); | ||
258 | if (!iov) { | ||
259 | ret = -ENOMEM; | ||
260 | goto out; | ||
261 | } | ||
262 | |||
263 | if (copy_from_user(iov, hdr->dxferp, size)) { | ||
264 | kfree(iov); | ||
265 | ret = -EFAULT; | ||
266 | goto out; | ||
267 | } | ||
268 | |||
269 | ret = blk_rq_map_user_iov(q, rq, iov, hdr->iovec_count); | ||
270 | kfree(iov); | ||
271 | } else if (hdr->dxfer_len) | ||
272 | ret = blk_rq_map_user(q, rq, hdr->dxferp, hdr->dxfer_len); | ||
261 | 273 | ||
262 | if (IS_ERR(rq)) | 274 | if (ret) |
263 | return PTR_ERR(rq); | 275 | goto out; |
264 | } else | ||
265 | rq = blk_get_request(q, READ, __GFP_WAIT); | ||
266 | 276 | ||
267 | /* | 277 | /* |
268 | * fill in request structure | 278 | * fill in request structure |
@@ -298,7 +308,7 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
298 | * (if he doesn't check that is his problem). | 308 | * (if he doesn't check that is his problem). |
299 | * N.B. a non-zero SCSI status is _not_ necessarily an error. | 309 | * N.B. a non-zero SCSI status is _not_ necessarily an error. |
300 | */ | 310 | */ |
301 | blk_execute_rq(q, bd_disk, rq); | 311 | blk_execute_rq(q, bd_disk, rq, 0); |
302 | 312 | ||
303 | /* write to all output members */ | 313 | /* write to all output members */ |
304 | hdr->status = 0xff & rq->errors; | 314 | hdr->status = 0xff & rq->errors; |
@@ -320,12 +330,14 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
320 | hdr->sb_len_wr = len; | 330 | hdr->sb_len_wr = len; |
321 | } | 331 | } |
322 | 332 | ||
323 | if (blk_rq_unmap_user(rq, bio, hdr->dxfer_len)) | 333 | if (blk_rq_unmap_user(bio, hdr->dxfer_len)) |
324 | return -EFAULT; | 334 | ret = -EFAULT; |
325 | 335 | ||
326 | /* may not have succeeded, but output values written to control | 336 | /* may not have succeeded, but output values written to control |
327 | * structure (struct sg_io_hdr). */ | 337 | * structure (struct sg_io_hdr). */ |
328 | return 0; | 338 | out: |
339 | blk_put_request(rq); | ||
340 | return ret; | ||
329 | } | 341 | } |
330 | 342 | ||
331 | #define OMAX_SB_LEN 16 /* For backward compatibility */ | 343 | #define OMAX_SB_LEN 16 /* For backward compatibility */ |
@@ -408,7 +420,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, | |||
408 | rq->data_len = bytes; | 420 | rq->data_len = bytes; |
409 | rq->flags |= REQ_BLOCK_PC; | 421 | rq->flags |= REQ_BLOCK_PC; |
410 | 422 | ||
411 | blk_execute_rq(q, bd_disk, rq); | 423 | blk_execute_rq(q, bd_disk, rq, 0); |
412 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ | 424 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ |
413 | if (err) { | 425 | if (err) { |
414 | if (rq->sense_len && rq->sense) { | 426 | if (rq->sense_len && rq->sense) { |
@@ -561,7 +573,7 @@ int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, | |||
561 | rq->cmd[0] = GPCMD_START_STOP_UNIT; | 573 | rq->cmd[0] = GPCMD_START_STOP_UNIT; |
562 | rq->cmd[4] = 0x02 + (close != 0); | 574 | rq->cmd[4] = 0x02 + (close != 0); |
563 | rq->cmd_len = 6; | 575 | rq->cmd_len = 6; |
564 | err = blk_execute_rq(q, bd_disk, rq); | 576 | err = blk_execute_rq(q, bd_disk, rq, 0); |
565 | blk_put_request(rq); | 577 | blk_put_request(rq); |
566 | break; | 578 | break; |
567 | default: | 579 | default: |
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 2771c861f185..f696da6f417b 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struct urb *urb) | |||
367 | if (!urb) | 367 | if (!urb) |
368 | return; | 368 | return; |
369 | 369 | ||
370 | if (urb->setup_packet) | 370 | kfree(urb->setup_packet); |
371 | kfree(urb->setup_packet); | 371 | kfree(urb->transfer_buffer); |
372 | |||
373 | if (urb->transfer_buffer) | ||
374 | kfree(urb->transfer_buffer); | ||
375 | 372 | ||
376 | usb_free_urb(urb); | 373 | usb_free_urb(urb); |
377 | } | 374 | } |
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index c0ed213fc857..858fddb046de 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c | |||
@@ -58,8 +58,6 @@ | |||
58 | #ifndef CONFIG_BT_HCIUART_DEBUG | 58 | #ifndef CONFIG_BT_HCIUART_DEBUG |
59 | #undef BT_DBG | 59 | #undef BT_DBG |
60 | #define BT_DBG( A... ) | 60 | #define BT_DBG( A... ) |
61 | #undef BT_DMP | ||
62 | #define BT_DMP( A... ) | ||
63 | #endif | 61 | #endif |
64 | 62 | ||
65 | static int hciextn = 1; | 63 | static int hciextn = 1; |
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index ade94a57bb11..533323b60e63 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUART_DEBUG | 57 | #ifndef CONFIG_BT_HCIUART_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG( A... ) | 59 | #define BT_DBG( A... ) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP( A... ) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | /* Initialize protocol */ | 62 | /* Initialize protocol */ |
@@ -125,7 +123,6 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len) | |||
125 | 123 | ||
126 | BT_DBG("len %d room %d", len, room); | 124 | BT_DBG("len %d room %d", len, room); |
127 | if (!len) { | 125 | if (!len) { |
128 | BT_DMP(h4->rx_skb->data, h4->rx_skb->len); | ||
129 | hci_recv_frame(h4->rx_skb); | 126 | hci_recv_frame(h4->rx_skb); |
130 | } else if (len > room) { | 127 | } else if (len > room) { |
131 | BT_ERR("Data length is too large"); | 128 | BT_ERR("Data length is too large"); |
@@ -169,8 +166,6 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) | |||
169 | case H4_W4_DATA: | 166 | case H4_W4_DATA: |
170 | BT_DBG("Complete data"); | 167 | BT_DBG("Complete data"); |
171 | 168 | ||
172 | BT_DMP(h4->rx_skb->data, h4->rx_skb->len); | ||
173 | |||
174 | hci_recv_frame(h4->rx_skb); | 169 | hci_recv_frame(h4->rx_skb); |
175 | 170 | ||
176 | h4->rx_state = H4_W4_PACKET_TYPE; | 171 | h4->rx_state = H4_W4_PACKET_TYPE; |
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index f766bc22c6bb..90be2eae52e0 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUART_DEBUG | 57 | #ifndef CONFIG_BT_HCIUART_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG( A... ) | 59 | #define BT_DBG( A... ) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP( A... ) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | static int reset = 0; | 62 | static int reset = 0; |
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index b120ecf7b8c9..657719b8254f 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUSB_DEBUG | 57 | #ifndef CONFIG_BT_HCIUSB_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG(D...) | 59 | #define BT_DBG(D...) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP(D...) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET | 62 | #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET |
@@ -110,6 +108,9 @@ static struct usb_device_id blacklist_ids[] = { | |||
110 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ | 108 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ |
111 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, | 109 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, |
112 | 110 | ||
111 | /* Kensington Bluetooth USB adapter */ | ||
112 | { USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET }, | ||
113 | |||
113 | /* ISSC Bluetooth Adapter v3.1 */ | 114 | /* ISSC Bluetooth Adapter v3.1 */ |
114 | { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, | 115 | { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, |
115 | 116 | ||
@@ -387,10 +388,8 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb) | |||
387 | urb = &_urb->urb; | 388 | urb = &_urb->urb; |
388 | BT_DBG("%s freeing _urb %p type %d urb %p", | 389 | BT_DBG("%s freeing _urb %p type %d urb %p", |
389 | husb->hdev->name, _urb, _urb->type, urb); | 390 | husb->hdev->name, _urb, _urb->type, urb); |
390 | if (urb->setup_packet) | 391 | kfree(urb->setup_packet); |
391 | kfree(urb->setup_packet); | 392 | kfree(urb->transfer_buffer); |
392 | if (urb->transfer_buffer) | ||
393 | kfree(urb->transfer_buffer); | ||
394 | _urb_free(_urb); | 393 | _urb_free(_urb); |
395 | } | 394 | } |
396 | 395 | ||
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index beaa561f2ed8..153960348414 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -2097,6 +2097,10 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2097 | if (!q) | 2097 | if (!q) |
2098 | return -ENXIO; | 2098 | return -ENXIO; |
2099 | 2099 | ||
2100 | rq = blk_get_request(q, READ, GFP_KERNEL); | ||
2101 | if (!rq) | ||
2102 | return -ENOMEM; | ||
2103 | |||
2100 | cdi->last_sense = 0; | 2104 | cdi->last_sense = 0; |
2101 | 2105 | ||
2102 | while (nframes) { | 2106 | while (nframes) { |
@@ -2108,9 +2112,9 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2108 | 2112 | ||
2109 | len = nr * CD_FRAMESIZE_RAW; | 2113 | len = nr * CD_FRAMESIZE_RAW; |
2110 | 2114 | ||
2111 | rq = blk_rq_map_user(q, READ, ubuf, len); | 2115 | ret = blk_rq_map_user(q, rq, ubuf, len); |
2112 | if (IS_ERR(rq)) | 2116 | if (ret) |
2113 | return PTR_ERR(rq); | 2117 | break; |
2114 | 2118 | ||
2115 | memset(rq->cmd, 0, sizeof(rq->cmd)); | 2119 | memset(rq->cmd, 0, sizeof(rq->cmd)); |
2116 | rq->cmd[0] = GPCMD_READ_CD; | 2120 | rq->cmd[0] = GPCMD_READ_CD; |
@@ -2132,13 +2136,13 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2132 | if (rq->bio) | 2136 | if (rq->bio) |
2133 | blk_queue_bounce(q, &rq->bio); | 2137 | blk_queue_bounce(q, &rq->bio); |
2134 | 2138 | ||
2135 | if (blk_execute_rq(q, cdi->disk, rq)) { | 2139 | if (blk_execute_rq(q, cdi->disk, rq, 0)) { |
2136 | struct request_sense *s = rq->sense; | 2140 | struct request_sense *s = rq->sense; |
2137 | ret = -EIO; | 2141 | ret = -EIO; |
2138 | cdi->last_sense = s->sense_key; | 2142 | cdi->last_sense = s->sense_key; |
2139 | } | 2143 | } |
2140 | 2144 | ||
2141 | if (blk_rq_unmap_user(rq, bio, len)) | 2145 | if (blk_rq_unmap_user(bio, len)) |
2142 | ret = -EFAULT; | 2146 | ret = -EFAULT; |
2143 | 2147 | ||
2144 | if (ret) | 2148 | if (ret) |
@@ -2149,6 +2153,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2149 | ubuf += len; | 2153 | ubuf += len; |
2150 | } | 2154 | } |
2151 | 2155 | ||
2156 | blk_put_request(rq); | ||
2152 | return ret; | 2157 | return ret; |
2153 | } | 2158 | } |
2154 | 2159 | ||
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 4f27e5519296..7333b41d4224 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -80,7 +80,7 @@ config SERIAL_NONSTANDARD | |||
80 | 80 | ||
81 | config COMPUTONE | 81 | config COMPUTONE |
82 | tristate "Computone IntelliPort Plus serial support" | 82 | tristate "Computone IntelliPort Plus serial support" |
83 | depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | 83 | depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP && (BROKEN || !SPARC32) |
84 | ---help--- | 84 | ---help--- |
85 | This driver supports the entire family of Intelliport II/Plus | 85 | This driver supports the entire family of Intelliport II/Plus |
86 | controllers with the exception of the MicroChannel controllers and | 86 | controllers with the exception of the MicroChannel controllers and |
@@ -138,7 +138,7 @@ config CYZ_INTR | |||
138 | 138 | ||
139 | config DIGIEPCA | 139 | config DIGIEPCA |
140 | tristate "Digiboard Intelligent Async Support" | 140 | tristate "Digiboard Intelligent Async Support" |
141 | depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP | 141 | depends on SERIAL_NONSTANDARD && BROKEN_ON_SMP && (!64BIT || BROKEN) |
142 | ---help--- | 142 | ---help--- |
143 | This is a driver for Digi International's Xx, Xeve, and Xem series | 143 | This is a driver for Digi International's Xx, Xeve, and Xem series |
144 | of cards which provide multiple serial ports. You would need | 144 | of cards which provide multiple serial ports. You would need |
@@ -208,7 +208,7 @@ config SYNCLINK | |||
208 | 208 | ||
209 | config SYNCLINKMP | 209 | config SYNCLINKMP |
210 | tristate "SyncLink Multiport support" | 210 | tristate "SyncLink Multiport support" |
211 | depends on SERIAL_NONSTANDARD | 211 | depends on SERIAL_NONSTANDARD && (BROKEN || !SPARC32) |
212 | help | 212 | help |
213 | Enable support for the SyncLink Multiport (2 or 4 ports) | 213 | Enable support for the SyncLink Multiport (2 or 4 ports) |
214 | serial adapter, running asynchronous and HDLC communications up | 214 | serial adapter, running asynchronous and HDLC communications up |
@@ -735,7 +735,7 @@ config SGI_IP27_RTC | |||
735 | 735 | ||
736 | config GEN_RTC | 736 | config GEN_RTC |
737 | tristate "Generic /dev/rtc emulation" | 737 | tristate "Generic /dev/rtc emulation" |
738 | depends on RTC!=y && !IA64 && !ARM && !PPC64 | 738 | depends on RTC!=y && !IA64 && !ARM && !PPC64 && !M32R && !SPARC32 |
739 | ---help--- | 739 | ---help--- |
740 | If you say Y here and create a character special file /dev/rtc with | 740 | If you say Y here and create a character special file /dev/rtc with |
741 | major number 10 and minor number 135 using mknod ("man mknod"), you | 741 | major number 10 and minor number 135 using mknod ("man mknod"), you |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 42187381506b..850a78c9c4bc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -261,7 +261,11 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma) | |||
261 | 261 | ||
262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | 262 | static int mmap_kmem(struct file * file, struct vm_area_struct * vma) |
263 | { | 263 | { |
264 | unsigned long long val; | 264 | unsigned long pfn; |
265 | |||
266 | /* Turn a kernel-virtual address into a physical page frame */ | ||
267 | pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; | ||
268 | |||
265 | /* | 269 | /* |
266 | * RED-PEN: on some architectures there is more mapped memory | 270 | * RED-PEN: on some architectures there is more mapped memory |
267 | * than available in mem_map which pfn_valid checks | 271 | * than available in mem_map which pfn_valid checks |
@@ -269,10 +273,10 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma) | |||
269 | * | 273 | * |
270 | * RED-PEN: vmalloc is not supported right now. | 274 | * RED-PEN: vmalloc is not supported right now. |
271 | */ | 275 | */ |
272 | if (!pfn_valid(vma->vm_pgoff)) | 276 | if (!pfn_valid(pfn)) |
273 | return -EIO; | 277 | return -EIO; |
274 | val = (u64)vma->vm_pgoff << PAGE_SHIFT; | 278 | |
275 | vma->vm_pgoff = __pa(val) >> PAGE_SHIFT; | 279 | vma->vm_pgoff = pfn; |
276 | return mmap_mem(file, vma); | 280 | return mmap_mem(file, vma); |
277 | } | 281 | } |
278 | 282 | ||
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index d8f9e94ae475..cd4fe8b1709f 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) | |||
1209 | 1209 | ||
1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) | 1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) |
1211 | { | 1211 | { |
1212 | unsigned long uip_watchdog = jiffies; | ||
1212 | unsigned char ctrl; | 1213 | unsigned char ctrl; |
1213 | #ifdef CONFIG_MACH_DECSTATION | 1214 | #ifdef CONFIG_MACH_DECSTATION |
1214 | unsigned int real_year; | 1215 | unsigned int real_year; |
@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |||
1224 | * Once the read clears, read the RTC time (again via ioctl). Easy. | 1225 | * Once the read clears, read the RTC time (again via ioctl). Easy. |
1225 | */ | 1226 | */ |
1226 | 1227 | ||
1227 | if (rtc_is_updating() != 0) | 1228 | while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) { |
1228 | msleep(20); | 1229 | barrier(); |
1230 | cpu_relax(); | ||
1231 | } | ||
1229 | 1232 | ||
1230 | /* | 1233 | /* |
1231 | * Only the values that we read from the RTC are set. We leave | 1234 | * Only the values that we read from the RTC are set. We leave |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 94a3b3e20bf9..79e9832ef1f3 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -17,6 +17,8 @@ config TCG_TPM | |||
17 | obtained at: <http://sourceforge.net/projects/trousers>. To | 17 | obtained at: <http://sourceforge.net/projects/trousers>. To |
18 | compile this driver as a module, choose M here; the module | 18 | compile this driver as a module, choose M here; the module |
19 | will be called tpm. If unsure, say N. | 19 | will be called tpm. If unsure, say N. |
20 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI_BUS | ||
21 | and CONFIG_PNPACPI. | ||
20 | 22 | ||
21 | config TCG_NSC | 23 | config TCG_NSC |
22 | tristate "National Semiconductor TPM Interface" | 24 | tristate "National Semiconductor TPM Interface" |
@@ -36,12 +38,13 @@ config TCG_ATMEL | |||
36 | as a module, choose M here; the module will be called tpm_atmel. | 38 | as a module, choose M here; the module will be called tpm_atmel. |
37 | 39 | ||
38 | config TCG_INFINEON | 40 | config TCG_INFINEON |
39 | tristate "Infineon Technologies SLD 9630 TPM Interface" | 41 | tristate "Infineon Technologies TPM Interface" |
40 | depends on TCG_TPM | 42 | depends on TCG_TPM && PNPACPI |
41 | ---help--- | 43 | ---help--- |
42 | If you have a TPM security chip from Infineon Technologies | 44 | If you have a TPM security chip from Infineon Technologies |
43 | say Yes and it will be accessible from within Linux. To | 45 | (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it |
44 | compile this driver as a module, choose M here; the module | 46 | will be accessible from within Linux. |
47 | To compile this driver as a module, choose M here; the module | ||
45 | will be called tpm_infineon. | 48 | will be called tpm_infineon. |
46 | Further information on this driver and the supported hardware | 49 | Further information on this driver and the supported hardware |
47 | can be found at http://www.prosec.rub.de/tpm | 50 | can be found at http://www.prosec.rub.de/tpm |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c index 0e3241645c19..dc8c540391fd 100644 --- a/drivers/char/tpm/tpm_infineon.c +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Description: | 2 | * Description: |
3 | * Device Driver for the Infineon Technologies | 3 | * Device Driver for the Infineon Technologies |
4 | * SLD 9630 TT Trusted Platform Module | 4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module |
5 | * Specifications at www.trustedcomputinggroup.org | 5 | * Specifications at www.trustedcomputinggroup.org |
6 | * | 6 | * |
7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> | 7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> |
@@ -12,9 +12,10 @@ | |||
12 | * modify it under the terms of the GNU General Public License as | 12 | * modify it under the terms of the GNU General Public License as |
13 | * published by the Free Software Foundation, version 2 of the | 13 | * published by the Free Software Foundation, version 2 of the |
14 | * License. | 14 | * License. |
15 | * | ||
16 | */ | 15 | */ |
17 | 16 | ||
17 | #include <acpi/acpi_bus.h> | ||
18 | #include <linux/pnp.h> | ||
18 | #include "tpm.h" | 19 | #include "tpm.h" |
19 | 20 | ||
20 | /* Infineon specific definitions */ | 21 | /* Infineon specific definitions */ |
@@ -26,8 +27,11 @@ | |||
26 | #define TPM_MSLEEP_TIME 3 | 27 | #define TPM_MSLEEP_TIME 3 |
27 | /* gives number of max. msleep()-calls before throwing timeout */ | 28 | /* gives number of max. msleep()-calls before throwing timeout */ |
28 | #define TPM_MAX_TRIES 5000 | 29 | #define TPM_MAX_TRIES 5000 |
29 | #define TCPA_INFINEON_DEV_VEN_VALUE 0x15D1 | 30 | #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1 |
30 | #define TPM_DATA (TPM_ADDR + 1) & 0xff | 31 | |
32 | /* These values will be filled after ACPI-call */ | ||
33 | static int TPM_INF_DATA = 0; | ||
34 | static int TPM_INF_ADDR = 0; | ||
31 | 35 | ||
32 | /* TPM header definitions */ | 36 | /* TPM header definitions */ |
33 | enum infineon_tpm_header { | 37 | enum infineon_tpm_header { |
@@ -305,9 +309,10 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count) | |||
305 | 309 | ||
306 | static void tpm_inf_cancel(struct tpm_chip *chip) | 310 | static void tpm_inf_cancel(struct tpm_chip *chip) |
307 | { | 311 | { |
308 | /* Nothing yet! | 312 | /* |
309 | This has something to do with the internal functions | 313 | Since we are using the legacy mode to communicate |
310 | of the TPM. Abort isn't really necessary... | 314 | with the TPM, we have no cancel functions, but have |
315 | a workaround for interrupting the TPM through WTX. | ||
311 | */ | 316 | */ |
312 | } | 317 | } |
313 | 318 | ||
@@ -345,6 +350,32 @@ static struct tpm_vendor_specific tpm_inf = { | |||
345 | .miscdev = {.fops = &inf_ops,}, | 350 | .miscdev = {.fops = &inf_ops,}, |
346 | }; | 351 | }; |
347 | 352 | ||
353 | static const struct pnp_device_id tpm_pnp_tbl[] = { | ||
354 | /* Infineon TPMs */ | ||
355 | {"IFX0101", 0}, | ||
356 | {"IFX0102", 0}, | ||
357 | {"", 0} | ||
358 | }; | ||
359 | |||
360 | static int __devinit tpm_inf_acpi_probe(struct pnp_dev *dev, | ||
361 | const struct pnp_device_id *dev_id) | ||
362 | { | ||
363 | TPM_INF_ADDR = (pnp_port_start(dev, 0) & 0xff); | ||
364 | TPM_INF_DATA = ((TPM_INF_ADDR + 1) & 0xff); | ||
365 | tpm_inf.base = pnp_port_start(dev, 1); | ||
366 | dev_info(&dev->dev, "Found %s with ID %s\n", | ||
367 | dev->name, dev_id->id); | ||
368 | if (!((tpm_inf.base >> 8) & 0xff)) | ||
369 | tpm_inf.base = 0; | ||
370 | return 0; | ||
371 | } | ||
372 | |||
373 | static struct pnp_driver tpm_inf_pnp = { | ||
374 | .name = "tpm_inf_pnp", | ||
375 | .id_table = tpm_pnp_tbl, | ||
376 | .probe = tpm_inf_acpi_probe, | ||
377 | }; | ||
378 | |||
348 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | 379 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, |
349 | const struct pci_device_id *pci_id) | 380 | const struct pci_device_id *pci_id) |
350 | { | 381 | { |
@@ -353,64 +384,99 @@ static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | |||
353 | int vendorid[2]; | 384 | int vendorid[2]; |
354 | int version[2]; | 385 | int version[2]; |
355 | int productid[2]; | 386 | int productid[2]; |
387 | char chipname[20]; | ||
356 | 388 | ||
357 | if (pci_enable_device(pci_dev)) | 389 | if (pci_enable_device(pci_dev)) |
358 | return -EIO; | 390 | return -EIO; |
359 | 391 | ||
360 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); | 392 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); |
361 | 393 | ||
394 | /* read IO-ports from ACPI */ | ||
395 | pnp_register_driver(&tpm_inf_pnp); | ||
396 | pnp_unregister_driver(&tpm_inf_pnp); | ||
397 | |||
398 | /* Make sure, we have received valid config ports */ | ||
399 | if (!TPM_INF_ADDR) { | ||
400 | pci_disable_device(pci_dev); | ||
401 | return -EIO; | ||
402 | } | ||
403 | |||
362 | /* query chip for its vendor, its version number a.s.o. */ | 404 | /* query chip for its vendor, its version number a.s.o. */ |
363 | outb(ENABLE_REGISTER_PAIR, TPM_ADDR); | 405 | outb(ENABLE_REGISTER_PAIR, TPM_INF_ADDR); |
364 | outb(IDVENL, TPM_ADDR); | 406 | outb(IDVENL, TPM_INF_ADDR); |
365 | vendorid[1] = inb(TPM_DATA); | 407 | vendorid[1] = inb(TPM_INF_DATA); |
366 | outb(IDVENH, TPM_ADDR); | 408 | outb(IDVENH, TPM_INF_ADDR); |
367 | vendorid[0] = inb(TPM_DATA); | 409 | vendorid[0] = inb(TPM_INF_DATA); |
368 | outb(IDPDL, TPM_ADDR); | 410 | outb(IDPDL, TPM_INF_ADDR); |
369 | productid[1] = inb(TPM_DATA); | 411 | productid[1] = inb(TPM_INF_DATA); |
370 | outb(IDPDH, TPM_ADDR); | 412 | outb(IDPDH, TPM_INF_ADDR); |
371 | productid[0] = inb(TPM_DATA); | 413 | productid[0] = inb(TPM_INF_DATA); |
372 | outb(CHIP_ID1, TPM_ADDR); | 414 | outb(CHIP_ID1, TPM_INF_ADDR); |
373 | version[1] = inb(TPM_DATA); | 415 | version[1] = inb(TPM_INF_DATA); |
374 | outb(CHIP_ID2, TPM_ADDR); | 416 | outb(CHIP_ID2, TPM_INF_ADDR); |
375 | version[0] = inb(TPM_DATA); | 417 | version[0] = inb(TPM_INF_DATA); |
376 | 418 | ||
377 | if ((vendorid[0] << 8 | vendorid[1]) == (TCPA_INFINEON_DEV_VEN_VALUE)) { | 419 | switch ((productid[0] << 8) | productid[1]) { |
378 | 420 | case 6: | |
379 | /* read IO-ports from TPM */ | 421 | sprintf(chipname, " (SLD 9630 TT 1.1)"); |
380 | outb(IOLIMH, TPM_ADDR); | 422 | break; |
381 | ioh = inb(TPM_DATA); | 423 | case 11: |
382 | outb(IOLIML, TPM_ADDR); | 424 | sprintf(chipname, " (SLB 9635 TT 1.2)"); |
383 | iol = inb(TPM_DATA); | 425 | break; |
384 | tpm_inf.base = (ioh << 8) | iol; | 426 | default: |
427 | sprintf(chipname, " (unknown chip)"); | ||
428 | break; | ||
429 | } | ||
430 | chipname[19] = 0; | ||
431 | |||
432 | if ((vendorid[0] << 8 | vendorid[1]) == (TPM_INFINEON_DEV_VEN_VALUE)) { | ||
385 | 433 | ||
386 | if (tpm_inf.base == 0) { | 434 | if (tpm_inf.base == 0) { |
387 | dev_err(&pci_dev->dev, "No IO-ports set!\n"); | 435 | dev_err(&pci_dev->dev, "No IO-ports found!\n"); |
388 | pci_disable_device(pci_dev); | 436 | pci_disable_device(pci_dev); |
389 | return -ENODEV; | 437 | return -EIO; |
438 | } | ||
439 | /* configure TPM with IO-ports */ | ||
440 | outb(IOLIMH, TPM_INF_ADDR); | ||
441 | outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); | ||
442 | outb(IOLIML, TPM_INF_ADDR); | ||
443 | outb((tpm_inf.base & 0xff), TPM_INF_DATA); | ||
444 | |||
445 | /* control if IO-ports are set correctly */ | ||
446 | outb(IOLIMH, TPM_INF_ADDR); | ||
447 | ioh = inb(TPM_INF_DATA); | ||
448 | outb(IOLIML, TPM_INF_ADDR); | ||
449 | iol = inb(TPM_INF_DATA); | ||
450 | |||
451 | if ((ioh << 8 | iol) != tpm_inf.base) { | ||
452 | dev_err(&pci_dev->dev, | ||
453 | "Could not set IO-ports to %04x\n", | ||
454 | tpm_inf.base); | ||
455 | pci_disable_device(pci_dev); | ||
456 | return -EIO; | ||
390 | } | 457 | } |
391 | 458 | ||
392 | /* activate register */ | 459 | /* activate register */ |
393 | outb(TPM_DAR, TPM_ADDR); | 460 | outb(TPM_DAR, TPM_INF_ADDR); |
394 | outb(0x01, TPM_DATA); | 461 | outb(0x01, TPM_INF_DATA); |
395 | outb(DISABLE_REGISTER_PAIR, TPM_ADDR); | 462 | outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); |
396 | 463 | ||
397 | /* disable RESET, LP and IRQC */ | 464 | /* disable RESET, LP and IRQC */ |
398 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); | 465 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); |
399 | 466 | ||
400 | /* Finally, we're done, print some infos */ | 467 | /* Finally, we're done, print some infos */ |
401 | dev_info(&pci_dev->dev, "TPM found: " | 468 | dev_info(&pci_dev->dev, "TPM found: " |
469 | "config base 0x%x, " | ||
402 | "io base 0x%x, " | 470 | "io base 0x%x, " |
403 | "chip version %02x%02x, " | 471 | "chip version %02x%02x, " |
404 | "vendor id %x%x (Infineon), " | 472 | "vendor id %x%x (Infineon), " |
405 | "product id %02x%02x" | 473 | "product id %02x%02x" |
406 | "%s\n", | 474 | "%s\n", |
475 | TPM_INF_ADDR, | ||
407 | tpm_inf.base, | 476 | tpm_inf.base, |
408 | version[0], version[1], | 477 | version[0], version[1], |
409 | vendorid[0], vendorid[1], | 478 | vendorid[0], vendorid[1], |
410 | productid[0], productid[1], ((productid[0] == 0) | 479 | productid[0], productid[1], chipname); |
411 | && (productid[1] == | ||
412 | 6)) ? | ||
413 | " (SLD 9630 TT 1.1)" : ""); | ||
414 | 480 | ||
415 | rc = tpm_register_hardware(pci_dev, &tpm_inf); | 481 | rc = tpm_register_hardware(pci_dev, &tpm_inf); |
416 | if (rc < 0) { | 482 | if (rc < 0) { |
@@ -462,6 +528,6 @@ module_init(init_inf); | |||
462 | module_exit(cleanup_inf); | 528 | module_exit(cleanup_inf); |
463 | 529 | ||
464 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); | 530 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); |
465 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT"); | 531 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); |
466 | MODULE_VERSION("1.4"); | 532 | MODULE_VERSION("1.5"); |
467 | MODULE_LICENSE("GPL"); | 533 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 30d96739fb23..665103ccaee8 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2433,7 +2433,7 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
2433 | int ret = 0; | 2433 | int ret = 0; |
2434 | 2434 | ||
2435 | acquire_console_sem(); | 2435 | acquire_console_sem(); |
2436 | if (tty->count == 1) { | 2436 | if (tty->driver_data == NULL) { |
2437 | ret = vc_allocate(currcons); | 2437 | ret = vc_allocate(currcons); |
2438 | if (ret == 0) { | 2438 | if (ret == 0) { |
2439 | struct vc_data *vc = vc_cons[currcons].d; | 2439 | struct vc_data *vc = vc_cons[currcons].d; |
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index f975dab1ddf9..a13395e2c372 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * i8xx_tco 0.07: TCO timer driver for i8xx chipsets | 2 | * i8xx_tco: TCO timer driver for i8xx chipsets |
3 | * | 3 | * |
4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. | 4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. |
5 | * http://www.kernelconcepts.de | 5 | * http://www.kernelconcepts.de |
@@ -63,6 +63,9 @@ | |||
63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> | 63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> |
64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW | 64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW |
65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. | 65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. |
66 | * 20050807 Wim Van Sebroeck <wim@iguana.be> | ||
67 | * 0.08 Make sure that the watchdog is only "armed" when started. | ||
68 | * (Kernel Bug 4251) | ||
66 | */ | 69 | */ |
67 | 70 | ||
68 | /* | 71 | /* |
@@ -87,7 +90,7 @@ | |||
87 | #include "i8xx_tco.h" | 90 | #include "i8xx_tco.h" |
88 | 91 | ||
89 | /* Module and version information */ | 92 | /* Module and version information */ |
90 | #define TCO_VERSION "0.07" | 93 | #define TCO_VERSION "0.08" |
91 | #define TCO_MODULE_NAME "i8xx TCO timer" | 94 | #define TCO_MODULE_NAME "i8xx TCO timer" |
92 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 95 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
93 | #define PFX TCO_MODULE_NAME ": " | 96 | #define PFX TCO_MODULE_NAME ": " |
@@ -125,10 +128,18 @@ static int tco_timer_start (void) | |||
125 | unsigned char val; | 128 | unsigned char val; |
126 | 129 | ||
127 | spin_lock(&tco_lock); | 130 | spin_lock(&tco_lock); |
131 | |||
132 | /* disable chipset's NO_REBOOT bit */ | ||
133 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
134 | val &= 0xfd; | ||
135 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
136 | |||
137 | /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */ | ||
128 | val = inb (TCO1_CNT + 1); | 138 | val = inb (TCO1_CNT + 1); |
129 | val &= 0xf7; | 139 | val &= 0xf7; |
130 | outb (val, TCO1_CNT + 1); | 140 | outb (val, TCO1_CNT + 1); |
131 | val = inb (TCO1_CNT + 1); | 141 | val = inb (TCO1_CNT + 1); |
142 | |||
132 | spin_unlock(&tco_lock); | 143 | spin_unlock(&tco_lock); |
133 | 144 | ||
134 | if (val & 0x08) | 145 | if (val & 0x08) |
@@ -138,13 +149,20 @@ static int tco_timer_start (void) | |||
138 | 149 | ||
139 | static int tco_timer_stop (void) | 150 | static int tco_timer_stop (void) |
140 | { | 151 | { |
141 | unsigned char val; | 152 | unsigned char val, val1; |
142 | 153 | ||
143 | spin_lock(&tco_lock); | 154 | spin_lock(&tco_lock); |
155 | /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */ | ||
144 | val = inb (TCO1_CNT + 1); | 156 | val = inb (TCO1_CNT + 1); |
145 | val |= 0x08; | 157 | val |= 0x08; |
146 | outb (val, TCO1_CNT + 1); | 158 | outb (val, TCO1_CNT + 1); |
147 | val = inb (TCO1_CNT + 1); | 159 | val = inb (TCO1_CNT + 1); |
160 | |||
161 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
162 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | ||
163 | val1 |= 0x02; | ||
164 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
165 | |||
148 | spin_unlock(&tco_lock); | 166 | spin_unlock(&tco_lock); |
149 | 167 | ||
150 | if ((val & 0x08) == 0) | 168 | if ((val & 0x08) == 0) |
@@ -155,6 +173,7 @@ static int tco_timer_stop (void) | |||
155 | static int tco_timer_keepalive (void) | 173 | static int tco_timer_keepalive (void) |
156 | { | 174 | { |
157 | spin_lock(&tco_lock); | 175 | spin_lock(&tco_lock); |
176 | /* Reload the timer by writing to the TCO Timer Reload register */ | ||
158 | outb (0x01, TCO1_RLD); | 177 | outb (0x01, TCO1_RLD); |
159 | spin_unlock(&tco_lock); | 178 | spin_unlock(&tco_lock); |
160 | return 0; | 179 | return 0; |
@@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
417 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); | 436 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); |
418 | return 0; | 437 | return 0; |
419 | } | 438 | } |
420 | /* | 439 | |
421 | * Check chipset's NO_REBOOT bit | 440 | /* Check chipset's NO_REBOOT bit */ |
422 | */ | ||
423 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | 441 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); |
424 | if (val1 & 0x02) { | 442 | if (val1 & 0x02) { |
425 | val1 &= 0xfd; | 443 | val1 &= 0xfd; |
@@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
430 | return 0; /* Cannot reset NO_REBOOT bit */ | 448 | return 0; /* Cannot reset NO_REBOOT bit */ |
431 | } | 449 | } |
432 | } | 450 | } |
451 | /* Disable reboots untill the watchdog starts */ | ||
452 | val1 |= 0x02; | ||
453 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
454 | |||
433 | /* Set the TCO_EN bit in SMI_EN register */ | 455 | /* Set the TCO_EN bit in SMI_EN register */ |
434 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { | 456 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { |
435 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | 457 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", |
@@ -505,17 +527,10 @@ out: | |||
505 | 527 | ||
506 | static void __exit watchdog_cleanup (void) | 528 | static void __exit watchdog_cleanup (void) |
507 | { | 529 | { |
508 | u8 val; | ||
509 | |||
510 | /* Stop the timer before we leave */ | 530 | /* Stop the timer before we leave */ |
511 | if (!nowayout) | 531 | if (!nowayout) |
512 | tco_timer_stop (); | 532 | tco_timer_stop (); |
513 | 533 | ||
514 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
515 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
516 | val |= 0x02; | ||
517 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
518 | |||
519 | /* Deregister */ | 534 | /* Deregister */ |
520 | misc_deregister (&i8xx_tco_miscdev); | 535 | misc_deregister (&i8xx_tco_miscdev); |
521 | unregister_reboot_notifier(&i8xx_tco_notifier); | 536 | unregister_reboot_notifier(&i8xx_tco_notifier); |
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c index 1b2132617dc3..fb88b4041dca 100644 --- a/drivers/char/watchdog/sa1100_wdt.c +++ b/drivers/char/watchdog/sa1100_wdt.c | |||
@@ -36,13 +36,10 @@ | |||
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | 37 | ||
38 | #define OSCR_FREQ CLOCK_TICK_RATE | 38 | #define OSCR_FREQ CLOCK_TICK_RATE |
39 | #define SA1100_CLOSE_MAGIC (0x5afc4453) | ||
40 | 39 | ||
41 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
42 | static int expect_close; | ||
43 | static int pre_margin; | 41 | static int pre_margin; |
44 | static int boot_status; | 42 | static int boot_status; |
45 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
46 | 43 | ||
47 | /* | 44 | /* |
48 | * Allow only one person to hold it open | 45 | * Allow only one person to hold it open |
@@ -62,55 +59,33 @@ static int sa1100dog_open(struct inode *inode, struct file *file) | |||
62 | } | 59 | } |
63 | 60 | ||
64 | /* | 61 | /* |
65 | * Shut off the timer. | 62 | * The watchdog cannot be disabled. |
66 | * Lock it in if it's a module and we defined ...NOWAYOUT | 63 | * |
67 | * Oddly, the watchdog can only be enabled, but we can turn off | 64 | * Previous comments suggested that turning off the interrupt by |
68 | * the interrupt, which appears to prevent the watchdog timing out. | 65 | * clearing OIER[E3] would prevent the watchdog timing out but this |
66 | * does not appear to be true (at least on the PXA255). | ||
69 | */ | 67 | */ |
70 | static int sa1100dog_release(struct inode *inode, struct file *file) | 68 | static int sa1100dog_release(struct inode *inode, struct file *file) |
71 | { | 69 | { |
72 | OSMR3 = OSCR + pre_margin; | 70 | printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); |
73 | |||
74 | if (expect_close == SA1100_CLOSE_MAGIC) { | ||
75 | OIER &= ~OIER_E3; | ||
76 | } else { | ||
77 | printk(KERN_CRIT "WATCHDOG: WDT device closed unexpectedly. WDT will not stop!\n"); | ||
78 | } | ||
79 | 71 | ||
80 | clear_bit(1, &sa1100wdt_users); | 72 | clear_bit(1, &sa1100wdt_users); |
81 | expect_close = 0; | ||
82 | 73 | ||
83 | return 0; | 74 | return 0; |
84 | } | 75 | } |
85 | 76 | ||
86 | static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos) | 77 | static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos) |
87 | { | 78 | { |
88 | if (len) { | 79 | if (len) |
89 | if (!nowayout) { | ||
90 | size_t i; | ||
91 | |||
92 | expect_close = 0; | ||
93 | |||
94 | for (i = 0; i != len; i++) { | ||
95 | char c; | ||
96 | |||
97 | if (get_user(c, data + i)) | ||
98 | return -EFAULT; | ||
99 | if (c == 'V') | ||
100 | expect_close = SA1100_CLOSE_MAGIC; | ||
101 | } | ||
102 | } | ||
103 | /* Refresh OSMR3 timer. */ | 80 | /* Refresh OSMR3 timer. */ |
104 | OSMR3 = OSCR + pre_margin; | 81 | OSMR3 = OSCR + pre_margin; |
105 | } | ||
106 | 82 | ||
107 | return len; | 83 | return len; |
108 | } | 84 | } |
109 | 85 | ||
110 | static struct watchdog_info ident = { | 86 | static struct watchdog_info ident = { |
111 | .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | | 87 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, |
112 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, | 88 | .identity = "SA1100/PXA255 Watchdog", |
113 | .identity = "SA1100 Watchdog", | ||
114 | }; | 89 | }; |
115 | 90 | ||
116 | static int sa1100dog_ioctl(struct inode *inode, struct file *file, | 91 | static int sa1100dog_ioctl(struct inode *inode, struct file *file, |
@@ -172,7 +147,7 @@ static struct file_operations sa1100dog_fops = | |||
172 | static struct miscdevice sa1100dog_miscdev = | 147 | static struct miscdevice sa1100dog_miscdev = |
173 | { | 148 | { |
174 | .minor = WATCHDOG_MINOR, | 149 | .minor = WATCHDOG_MINOR, |
175 | .name = "SA1100/PXA2xx watchdog", | 150 | .name = "watchdog", |
176 | .fops = &sa1100dog_fops, | 151 | .fops = &sa1100dog_fops, |
177 | }; | 152 | }; |
178 | 153 | ||
@@ -194,7 +169,6 @@ static int __init sa1100dog_init(void) | |||
194 | if (ret == 0) | 169 | if (ret == 0) |
195 | printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", | 170 | printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", |
196 | margin); | 171 | margin); |
197 | |||
198 | return ret; | 172 | return ret; |
199 | } | 173 | } |
200 | 174 | ||
@@ -212,8 +186,5 @@ MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog"); | |||
212 | module_param(margin, int, 0); | 186 | module_param(margin, int, 0); |
213 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); | 187 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); |
214 | 188 | ||
215 | module_param(nowayout, int, 0); | ||
216 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | ||
217 | |||
218 | MODULE_LICENSE("GPL"); | 189 | MODULE_LICENSE("GPL"); |
219 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 190 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index 5d961f5e0ca0..e4710d1d1f9d 100644 --- a/drivers/fc4/fc.c +++ b/drivers/fc4/fc.c | |||
@@ -1004,8 +1004,8 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) | |||
1004 | return FAILED; | 1004 | return FAILED; |
1005 | } | 1005 | } |
1006 | fc->rst_pkt->eh_state = SCSI_STATE_UNUSED; | 1006 | fc->rst_pkt->eh_state = SCSI_STATE_UNUSED; |
1007 | return SUCCESS; | ||
1008 | #endif | 1007 | #endif |
1008 | return SUCCESS; | ||
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) | 1011 | static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) |
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 4fa17c76eea2..c8a7f47911f9 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
@@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter) | |||
325 | int adm1026_detach_client(struct i2c_client *client) | 325 | int adm1026_detach_client(struct i2c_client *client) |
326 | { | 326 | { |
327 | i2c_detach_client(client); | 327 | i2c_detach_client(client); |
328 | kfree(client); | 328 | kfree(i2c_get_clientdata(client)); |
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
@@ -1691,7 +1691,7 @@ int adm1026_detect(struct i2c_adapter *adapter, int address, | |||
1691 | 1691 | ||
1692 | /* Error out and cleanup code */ | 1692 | /* Error out and cleanup code */ |
1693 | exitfree: | 1693 | exitfree: |
1694 | kfree(new_client); | 1694 | kfree(data); |
1695 | exit: | 1695 | exit: |
1696 | return err; | 1696 | return err; |
1697 | } | 1697 | } |
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 9168e983ca1d..936250957270 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c | |||
@@ -834,7 +834,7 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind) | |||
834 | return 0; | 834 | return 0; |
835 | 835 | ||
836 | exit_free: | 836 | exit_free: |
837 | kfree(new_client); | 837 | kfree(data); |
838 | exit: | 838 | exit: |
839 | return err; | 839 | return err; |
840 | } | 840 | } |
@@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client) | |||
845 | if ((ret = i2c_detach_client(client)) != 0) { | 845 | if ((ret = i2c_detach_client(client)) != 0) { |
846 | return ret; | 846 | return ret; |
847 | } | 847 | } |
848 | kfree(client); | 848 | kfree(i2c_get_clientdata(client)); |
849 | return 0; | 849 | return 0; |
850 | } | 850 | } |
851 | 851 | ||
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c index 5c68e9c311aa..ce2a6eb93f6e 100644 --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c | |||
@@ -616,7 +616,7 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind) | |||
616 | 616 | ||
617 | return 0; | 617 | return 0; |
618 | exit_free: | 618 | exit_free: |
619 | kfree(new_client); | 619 | kfree(data); |
620 | exit: | 620 | exit: |
621 | return err; | 621 | return err; |
622 | } | 622 | } |
diff --git a/drivers/hwmon/fscpos.c b/drivers/hwmon/fscpos.c index 270015b626ad..301ae98bd0ad 100644 --- a/drivers/hwmon/fscpos.c +++ b/drivers/hwmon/fscpos.c | |||
@@ -167,7 +167,7 @@ static ssize_t set_temp_reset(struct i2c_client *client, struct fscpos_data | |||
167 | "experience to the module author.\n"); | 167 | "experience to the module author.\n"); |
168 | 168 | ||
169 | /* Supported value: 2 (clears the status) */ | 169 | /* Supported value: 2 (clears the status) */ |
170 | fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr], 2); | 170 | fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr - 1], 2); |
171 | return count; | 171 | return count; |
172 | } | 172 | } |
173 | 173 | ||
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c index 251ac2659554..fdeeb3ab6f2f 100644 --- a/drivers/hwmon/smsc47b397.c +++ b/drivers/hwmon/smsc47b397.c | |||
@@ -298,7 +298,7 @@ static int smsc47b397_detect(struct i2c_adapter *adapter, int addr, int kind) | |||
298 | return 0; | 298 | return 0; |
299 | 299 | ||
300 | error_free: | 300 | error_free: |
301 | kfree(new_client); | 301 | kfree(data); |
302 | error_release: | 302 | error_release: |
303 | release_region(addr, SMSC_EXTENT); | 303 | release_region(addr, SMSC_EXTENT); |
304 | return err; | 304 | return err; |
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index 897117a7213f..7166ad0b2fda 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -495,7 +495,7 @@ static int smsc47m1_detect(struct i2c_adapter *adapter, int address, int kind) | |||
495 | return 0; | 495 | return 0; |
496 | 496 | ||
497 | error_free: | 497 | error_free: |
498 | kfree(new_client); | 498 | kfree(data); |
499 | error_release: | 499 | error_release: |
500 | release_region(address, SMSC_EXTENT); | 500 | release_region(address, SMSC_EXTENT); |
501 | return err; | 501 | return err; |
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 04adde62a003..9ad3e9262e8a 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -382,100 +382,6 @@ static void __exit fsl_i2c_exit(void) | |||
382 | module_init(fsl_i2c_init); | 382 | module_init(fsl_i2c_init); |
383 | module_exit(fsl_i2c_exit); | 383 | module_exit(fsl_i2c_exit); |
384 | 384 | ||
385 | static int fsl_i2c_probe(struct device *device) | ||
386 | { | ||
387 | int result = 0; | ||
388 | struct mpc_i2c *i2c; | ||
389 | struct platform_device *pdev = to_platform_device(device); | ||
390 | struct fsl_i2c_platform_data *pdata; | ||
391 | struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
392 | |||
393 | pdata = (struct fsl_i2c_platform_data *) pdev->dev.platform_data; | ||
394 | |||
395 | if (!(i2c = kmalloc(sizeof(*i2c), GFP_KERNEL))) { | ||
396 | return -ENOMEM; | ||
397 | } | ||
398 | memset(i2c, 0, sizeof(*i2c)); | ||
399 | |||
400 | i2c->irq = platform_get_irq(pdev, 0); | ||
401 | i2c->flags = pdata->device_flags; | ||
402 | init_waitqueue_head(&i2c->queue); | ||
403 | |||
404 | i2c->base = ioremap((phys_addr_t)r->start, MPC_I2C_REGION); | ||
405 | |||
406 | if (!i2c->base) { | ||
407 | printk(KERN_ERR "i2c-mpc - failed to map controller\n"); | ||
408 | result = -ENOMEM; | ||
409 | goto fail_map; | ||
410 | } | ||
411 | |||
412 | if (i2c->irq != 0) | ||
413 | if ((result = request_irq(i2c->irq, mpc_i2c_isr, | ||
414 | SA_SHIRQ, "i2c-mpc", i2c)) < 0) { | ||
415 | printk(KERN_ERR | ||
416 | "i2c-mpc - failed to attach interrupt\n"); | ||
417 | goto fail_irq; | ||
418 | } | ||
419 | |||
420 | mpc_i2c_setclock(i2c); | ||
421 | dev_set_drvdata(device, i2c); | ||
422 | |||
423 | i2c->adap = mpc_ops; | ||
424 | i2c_set_adapdata(&i2c->adap, i2c); | ||
425 | i2c->adap.dev.parent = &pdev->dev; | ||
426 | if ((result = i2c_add_adapter(&i2c->adap)) < 0) { | ||
427 | printk(KERN_ERR "i2c-mpc - failed to add adapter\n"); | ||
428 | goto fail_add; | ||
429 | } | ||
430 | |||
431 | return result; | ||
432 | |||
433 | fail_add: | ||
434 | if (i2c->irq != 0) | ||
435 | free_irq(i2c->irq, NULL); | ||
436 | fail_irq: | ||
437 | iounmap(i2c->base); | ||
438 | fail_map: | ||
439 | kfree(i2c); | ||
440 | return result; | ||
441 | }; | ||
442 | |||
443 | static int fsl_i2c_remove(struct device *device) | ||
444 | { | ||
445 | struct mpc_i2c *i2c = dev_get_drvdata(device); | ||
446 | |||
447 | i2c_del_adapter(&i2c->adap); | ||
448 | dev_set_drvdata(device, NULL); | ||
449 | |||
450 | if (i2c->irq != 0) | ||
451 | free_irq(i2c->irq, i2c); | ||
452 | |||
453 | iounmap(i2c->base); | ||
454 | kfree(i2c); | ||
455 | return 0; | ||
456 | }; | ||
457 | |||
458 | /* Structure for a device driver */ | ||
459 | static struct device_driver fsl_i2c_driver = { | ||
460 | .name = "fsl-i2c", | ||
461 | .bus = &platform_bus_type, | ||
462 | .probe = fsl_i2c_probe, | ||
463 | .remove = fsl_i2c_remove, | ||
464 | }; | ||
465 | |||
466 | static int __init fsl_i2c_init(void) | ||
467 | { | ||
468 | return driver_register(&fsl_i2c_driver); | ||
469 | } | ||
470 | |||
471 | static void __exit fsl_i2c_exit(void) | ||
472 | { | ||
473 | driver_unregister(&fsl_i2c_driver); | ||
474 | } | ||
475 | |||
476 | module_init(fsl_i2c_init); | ||
477 | module_exit(fsl_i2c_exit); | ||
478 | |||
479 | MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); | 385 | MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); |
480 | MODULE_DESCRIPTION | 386 | MODULE_DESCRIPTION |
481 | ("I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx processors"); | 387 | ("I2C-Bus adapter for MPC107 bridge and MPC824x/85xx/52xx processors"); |
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 1c99536b673b..fa503ed9f86d 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <asm/sibyte/sb1250_smbus.h> | 23 | #include <asm/sibyte/sb1250_smbus.h> |
24 | 24 | ||
25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { | 25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { |
26 | { NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) }, | 26 | { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) }, |
27 | { NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) } | 27 | { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) } |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static struct i2c_adapter sibyte_board_adapter[2] = { | 30 | static struct i2c_adapter sibyte_board_adapter[2] = { |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 5f33df47aa74..1cadd2c3cadd 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -764,6 +764,7 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST | |||
764 | config BLK_DEV_IDEDMA_PMAC | 764 | config BLK_DEV_IDEDMA_PMAC |
765 | bool "PowerMac IDE DMA support" | 765 | bool "PowerMac IDE DMA support" |
766 | depends on BLK_DEV_IDE_PMAC | 766 | depends on BLK_DEV_IDE_PMAC |
767 | select BLK_DEV_IDEDMA_PCI | ||
767 | help | 768 | help |
768 | This option allows the driver for the built-in IDE controller on | 769 | This option allows the driver for the built-in IDE controller on |
769 | Power Macintoshes and PowerBooks to use DMA (direct memory access) | 770 | Power Macintoshes and PowerBooks to use DMA (direct memory access) |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index f9c1acb4ed6a..234f5de3e929 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -754,7 +754,7 @@ static int idedisk_issue_flush(request_queue_t *q, struct gendisk *disk, | |||
754 | 754 | ||
755 | idedisk_prepare_flush(q, rq); | 755 | idedisk_prepare_flush(q, rq); |
756 | 756 | ||
757 | ret = blk_execute_rq(q, disk, rq); | 757 | ret = blk_execute_rq(q, disk, rq, 0); |
758 | 758 | ||
759 | /* | 759 | /* |
760 | * if we failed and caller wants error offset, get it | 760 | * if we failed and caller wants error offset, get it |
@@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device *dev) | |||
1220 | goto failed; | 1220 | goto failed; |
1221 | 1221 | ||
1222 | g = alloc_disk_node(1 << PARTN_BITS, | 1222 | g = alloc_disk_node(1 << PARTN_BITS, |
1223 | pcibus_to_node(drive->hwif->pci_dev->bus)); | 1223 | hwif_to_node(drive->hwif)); |
1224 | if (!g) | 1224 | if (!g) |
1225 | goto out_free_idkp; | 1225 | goto out_free_idkp; |
1226 | 1226 | ||
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 9eab6426148e..29c22fc278c6 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -317,7 +317,7 @@ typedef struct ide_floppy_obj { | |||
317 | unsigned long flags; | 317 | unsigned long flags; |
318 | } idefloppy_floppy_t; | 318 | } idefloppy_floppy_t; |
319 | 319 | ||
320 | #define IDEFLOPPY_TICKS_DELAY 3 /* default delay for ZIP 100 */ | 320 | #define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ |
321 | 321 | ||
322 | /* | 322 | /* |
323 | * Floppy flag bits values. | 323 | * Floppy flag bits values. |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 7df85af75371..c1128ae5cd2f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -978,8 +978,7 @@ static int ide_init_queue(ide_drive_t *drive) | |||
978 | * do not. | 978 | * do not. |
979 | */ | 979 | */ |
980 | 980 | ||
981 | q = blk_init_queue_node(do_ide_request, &ide_lock, | 981 | q = blk_init_queue_node(do_ide_request, &ide_lock, hwif_to_node(hwif)); |
982 | pcibus_to_node(drive->hwif->pci_dev->bus)); | ||
983 | if (!q) | 982 | if (!q) |
984 | return 1; | 983 | return 1; |
985 | 984 | ||
@@ -1048,6 +1047,8 @@ static int init_irq (ide_hwif_t *hwif) | |||
1048 | 1047 | ||
1049 | BUG_ON(in_interrupt()); | 1048 | BUG_ON(in_interrupt()); |
1050 | BUG_ON(irqs_disabled()); | 1049 | BUG_ON(irqs_disabled()); |
1050 | BUG_ON(hwif == NULL); | ||
1051 | |||
1051 | down(&ide_cfg_sem); | 1052 | down(&ide_cfg_sem); |
1052 | hwif->hwgroup = NULL; | 1053 | hwif->hwgroup = NULL; |
1053 | #if MAX_HWIFS > 1 | 1054 | #if MAX_HWIFS > 1 |
@@ -1097,7 +1098,7 @@ static int init_irq (ide_hwif_t *hwif) | |||
1097 | spin_unlock_irq(&ide_lock); | 1098 | spin_unlock_irq(&ide_lock); |
1098 | } else { | 1099 | } else { |
1099 | hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, | 1100 | hwgroup = kmalloc_node(sizeof(ide_hwgroup_t), GFP_KERNEL, |
1100 | pcibus_to_node(hwif->drives[0].hwif->pci_dev->bus)); | 1101 | hwif_to_node(hwif->drives[0].hwif)); |
1101 | if (!hwgroup) | 1102 | if (!hwgroup) |
1102 | goto out_up; | 1103 | goto out_up; |
1103 | 1104 | ||
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 03747439ac9c..f1d1ec4e9677 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -508,5 +508,5 @@ static void __exit exit_ide_cs(void) | |||
508 | BUG_ON(dev_list != NULL); | 508 | BUG_ON(dev_list != NULL); |
509 | } | 509 | } |
510 | 510 | ||
511 | module_init(init_ide_cs); | 511 | late_initcall(init_ide_cs); |
512 | module_exit(exit_ide_cs); | 512 | module_exit(exit_ide_cs); |
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index da46577380f3..6e3ab0c38c4d 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -173,6 +173,12 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { | |||
173 | .channels = 2, | 173 | .channels = 2, |
174 | .autodma = NOAUTODMA, | 174 | .autodma = NOAUTODMA, |
175 | .bootable = ON_BOARD, | 175 | .bootable = ON_BOARD, |
176 | },{ /* 14 */ | ||
177 | .name = "Revolution", | ||
178 | .init_hwif = init_hwif_generic, | ||
179 | .channels = 2, | ||
180 | .autodma = AUTODMA, | ||
181 | .bootable = OFF_BOARD, | ||
176 | } | 182 | } |
177 | }; | 183 | }; |
178 | 184 | ||
@@ -231,6 +237,7 @@ static struct pci_device_id generic_pci_tbl[] = { | |||
231 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, | 237 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11}, |
232 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, | 238 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, |
233 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, | 239 | { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, |
240 | { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, | ||
234 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ | 241 | /* Must come last. If you add entries adjust this table appropriately and the init_one code */ |
235 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, | 242 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, |
236 | { 0, }, | 243 | { 0, }, |
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index c6f5fa4b4ca6..ff2e217a8c84 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -21,6 +21,9 @@ | |||
21 | * | 21 | * |
22 | * CSB6: `Champion South Bridge' IDE Interface (optional: third channel) | 22 | * CSB6: `Champion South Bridge' IDE Interface (optional: third channel) |
23 | * | 23 | * |
24 | * HT1000: AKA BCM5785 - Hypertransport Southbridge for Opteron systems. IDE | ||
25 | * controller same as the CSB6. Single channel ATA100 only. | ||
26 | * | ||
24 | * Documentation: | 27 | * Documentation: |
25 | * Available under NDA only. Errata info very hard to get. | 28 | * Available under NDA only. Errata info very hard to get. |
26 | * | 29 | * |
@@ -71,6 +74,8 @@ static u8 svwks_ratemask (ide_drive_t *drive) | |||
71 | if (!svwks_revision) | 74 | if (!svwks_revision) |
72 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); | 75 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); |
73 | 76 | ||
77 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) | ||
78 | return 2; | ||
74 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { | 79 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { |
75 | u32 reg = 0; | 80 | u32 reg = 0; |
76 | if (isa_dev) | 81 | if (isa_dev) |
@@ -109,6 +114,7 @@ static u8 svwks_csb_check (struct pci_dev *dev) | |||
109 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: | 114 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: |
110 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: | 115 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: |
111 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: | 116 | case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: |
117 | case PCI_DEVICE_ID_SERVERWORKS_HT1000IDE: | ||
112 | return 1; | 118 | return 1; |
113 | default: | 119 | default: |
114 | break; | 120 | break; |
@@ -438,6 +444,13 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
438 | btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; | 444 | btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; |
439 | pci_write_config_byte(dev, 0x5A, btr); | 445 | pci_write_config_byte(dev, 0x5A, btr); |
440 | } | 446 | } |
447 | /* Setup HT1000 SouthBridge Controller - Single Channel Only */ | ||
448 | else if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) { | ||
449 | pci_read_config_byte(dev, 0x5A, &btr); | ||
450 | btr &= ~0x40; | ||
451 | btr |= 0x3; | ||
452 | pci_write_config_byte(dev, 0x5A, btr); | ||
453 | } | ||
441 | 454 | ||
442 | return (dev->irq) ? dev->irq : 0; | 455 | return (dev->irq) ? dev->irq : 0; |
443 | } | 456 | } |
@@ -629,6 +642,15 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = { | |||
629 | .channels = 1, /* 2 */ | 642 | .channels = 1, /* 2 */ |
630 | .autodma = AUTODMA, | 643 | .autodma = AUTODMA, |
631 | .bootable = ON_BOARD, | 644 | .bootable = ON_BOARD, |
645 | },{ /* 4 */ | ||
646 | .name = "SvrWks HT1000", | ||
647 | .init_setup = init_setup_svwks, | ||
648 | .init_chipset = init_chipset_svwks, | ||
649 | .init_hwif = init_hwif_svwks, | ||
650 | .init_dma = init_dma_svwks, | ||
651 | .channels = 1, /* 2 */ | ||
652 | .autodma = AUTODMA, | ||
653 | .bootable = ON_BOARD, | ||
632 | } | 654 | } |
633 | }; | 655 | }; |
634 | 656 | ||
@@ -653,6 +675,7 @@ static struct pci_device_id svwks_pci_tbl[] = { | |||
653 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | 675 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, |
654 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, | 676 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, |
655 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, | 677 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, |
678 | { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, | ||
656 | { 0, }, | 679 | { 0, }, |
657 | }; | 680 | }; |
658 | MODULE_DEVICE_TABLE(pci, svwks_pci_tbl); | 681 | MODULE_DEVICE_TABLE(pci, svwks_pci_tbl); |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index be0fcc8f4b15..ea65b070a367 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -1664,7 +1664,7 @@ static struct macio_driver pmac_ide_macio_driver = | |||
1664 | }; | 1664 | }; |
1665 | 1665 | ||
1666 | static struct pci_device_id pmac_ide_pci_match[] = { | 1666 | static struct pci_device_id pmac_ide_pci_match[] = { |
1667 | { PCI_VENDOR_ID_APPLE, PCI_DEVIEC_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1667 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1668 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1668 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1669 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 1669 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
1670 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, | 1670 | { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA, |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 77da827b2898..18ed7765417c 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -229,6 +229,7 @@ second_chance_to_dma: | |||
229 | case PCI_DEVICE_ID_AMD_VIPER_7409: | 229 | case PCI_DEVICE_ID_AMD_VIPER_7409: |
230 | case PCI_DEVICE_ID_CMD_643: | 230 | case PCI_DEVICE_ID_CMD_643: |
231 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: | 231 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: |
232 | case PCI_DEVICE_ID_REVOLUTION: | ||
232 | simplex_stat = hwif->INB(dma_base + 2); | 233 | simplex_stat = hwif->INB(dma_base + 2); |
233 | hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); | 234 | hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); |
234 | simplex_stat = hwif->INB(dma_base + 2); | 235 | simplex_stat = hwif->INB(dma_base + 2); |
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index b12a970cc9a3..27018c8efc24 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
@@ -478,7 +478,6 @@ static void ohci_initialize(struct ti_ohci *ohci) | |||
478 | int num_ports, i; | 478 | int num_ports, i; |
479 | 479 | ||
480 | spin_lock_init(&ohci->phy_reg_lock); | 480 | spin_lock_init(&ohci->phy_reg_lock); |
481 | spin_lock_init(&ohci->event_lock); | ||
482 | 481 | ||
483 | /* Put some defaults to these undefined bus options */ | 482 | /* Put some defaults to these undefined bus options */ |
484 | buf = reg_read(ohci, OHCI1394_BusOptions); | 483 | buf = reg_read(ohci, OHCI1394_BusOptions); |
@@ -3402,7 +3401,14 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev, | |||
3402 | /* We hopefully don't have to pre-allocate IT DMA like we did | 3401 | /* We hopefully don't have to pre-allocate IT DMA like we did |
3403 | * for IR DMA above. Allocate it on-demand and mark inactive. */ | 3402 | * for IR DMA above. Allocate it on-demand and mark inactive. */ |
3404 | ohci->it_legacy_context.ohci = NULL; | 3403 | ohci->it_legacy_context.ohci = NULL; |
3404 | spin_lock_init(&ohci->event_lock); | ||
3405 | 3405 | ||
3406 | /* | ||
3407 | * interrupts are disabled, all right, but... due to SA_SHIRQ we | ||
3408 | * might get called anyway. We'll see no event, of course, but | ||
3409 | * we need to get to that "no event", so enough should be initialized | ||
3410 | * by that point. | ||
3411 | */ | ||
3406 | if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ, | 3412 | if (request_irq(dev->irq, ohci_irq_handler, SA_SHIRQ, |
3407 | OHCI1394_DRIVER_NAME, ohci)) | 3413 | OHCI1394_DRIVER_NAME, ohci)) |
3408 | FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq); | 3414 | FAIL(-ENOMEM, "Failed to allocate shared interrupt %d", dev->irq); |
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index 79c8e2dd9c33..32cdfb30e9b4 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | menu "InfiniBand support" | 1 | menu "InfiniBand support" |
2 | 2 | ||
3 | config INFINIBAND | 3 | config INFINIBAND |
4 | depends on PCI || BROKEN | ||
4 | tristate "InfiniBand support" | 5 | tristate "InfiniBand support" |
5 | ---help--- | 6 | ---help--- |
6 | Core support for InfiniBand (IB). Make sure to also select | 7 | Core support for InfiniBand (IB). Make sure to also select |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index eb99e693dec2..5f6e9ea29cd7 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -130,13 +130,14 @@ static int ib_dealloc_ucontext(struct ib_ucontext *context) | |||
130 | 130 | ||
131 | list_for_each_entry_safe(uobj, tmp, &context->mr_list, list) { | 131 | list_for_each_entry_safe(uobj, tmp, &context->mr_list, list) { |
132 | struct ib_mr *mr = idr_find(&ib_uverbs_mr_idr, uobj->id); | 132 | struct ib_mr *mr = idr_find(&ib_uverbs_mr_idr, uobj->id); |
133 | struct ib_device *mrdev = mr->device; | ||
133 | struct ib_umem_object *memobj; | 134 | struct ib_umem_object *memobj; |
134 | 135 | ||
135 | idr_remove(&ib_uverbs_mr_idr, uobj->id); | 136 | idr_remove(&ib_uverbs_mr_idr, uobj->id); |
136 | ib_dereg_mr(mr); | 137 | ib_dereg_mr(mr); |
137 | 138 | ||
138 | memobj = container_of(uobj, struct ib_umem_object, uobject); | 139 | memobj = container_of(uobj, struct ib_umem_object, uobject); |
139 | ib_umem_release_on_close(mr->device, &memobj->umem); | 140 | ib_umem_release_on_close(mrdev, &memobj->umem); |
140 | 141 | ||
141 | list_del(&uobj->list); | 142 | list_del(&uobj->list); |
142 | kfree(memobj); | 143 | kfree(memobj); |
diff --git a/drivers/infiniband/include/ib_cm.h b/drivers/infiniband/include/ib_cm.h index e5d74a730a70..da650115e79a 100644 --- a/drivers/infiniband/include/ib_cm.h +++ b/drivers/infiniband/include/ib_cm.h | |||
@@ -169,7 +169,8 @@ enum ib_cm_rej_reason { | |||
169 | IB_CM_REJ_INVALID_ALT_TRAFFIC_CLASS = __constant_htons(21), | 169 | IB_CM_REJ_INVALID_ALT_TRAFFIC_CLASS = __constant_htons(21), |
170 | IB_CM_REJ_INVALID_ALT_HOP_LIMIT = __constant_htons(22), | 170 | IB_CM_REJ_INVALID_ALT_HOP_LIMIT = __constant_htons(22), |
171 | IB_CM_REJ_INVALID_ALT_PACKET_RATE = __constant_htons(23), | 171 | IB_CM_REJ_INVALID_ALT_PACKET_RATE = __constant_htons(23), |
172 | IB_CM_REJ_PORT_REDIRECT = __constant_htons(24), | 172 | IB_CM_REJ_PORT_CM_REDIRECT = __constant_htons(24), |
173 | IB_CM_REJ_PORT_REDIRECT = __constant_htons(25), | ||
173 | IB_CM_REJ_INVALID_MTU = __constant_htons(26), | 174 | IB_CM_REJ_INVALID_MTU = __constant_htons(26), |
174 | IB_CM_REJ_INSUFFICIENT_RESP_RESOURCES = __constant_htons(27), | 175 | IB_CM_REJ_INSUFFICIENT_RESP_RESOURCES = __constant_htons(27), |
175 | IB_CM_REJ_CONSUMER_DEFINED = __constant_htons(28), | 176 | IB_CM_REJ_CONSUMER_DEFINED = __constant_htons(28), |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 6f60abbaebd5..fa00816a3cf7 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -600,9 +600,10 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
600 | 600 | ||
601 | ipoib_mcast_send(dev, (union ib_gid *) (phdr->hwaddr + 4), skb); | 601 | ipoib_mcast_send(dev, (union ib_gid *) (phdr->hwaddr + 4), skb); |
602 | } else { | 602 | } else { |
603 | /* unicast GID -- should be ARP reply */ | 603 | /* unicast GID -- should be ARP or RARP reply */ |
604 | 604 | ||
605 | if (be16_to_cpup((u16 *) skb->data) != ETH_P_ARP) { | 605 | if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) && |
606 | (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) { | ||
606 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x " | 607 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x " |
607 | IPOIB_GID_FMT "\n", | 608 | IPOIB_GID_FMT "\n", |
608 | skb->dst ? "neigh" : "dst", | 609 | skb->dst ? "neigh" : "dst", |
diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c index 1ab5f2dc8a2a..70f051894a3c 100644 --- a/drivers/input/gameport/ns558.c +++ b/drivers/input/gameport/ns558.c | |||
@@ -275,9 +275,9 @@ static int __init ns558_init(void) | |||
275 | 275 | ||
276 | static void __exit ns558_exit(void) | 276 | static void __exit ns558_exit(void) |
277 | { | 277 | { |
278 | struct ns558 *ns558; | 278 | struct ns558 *ns558, *safe; |
279 | 279 | ||
280 | list_for_each_entry(ns558, &ns558_list, node) { | 280 | list_for_each_entry_safe(ns558, safe, &ns558_list, node) { |
281 | gameport_unregister_port(ns558->gameport); | 281 | gameport_unregister_port(ns558->gameport); |
282 | release_region(ns558->io & ~(ns558->size - 1), ns558->size); | 282 | release_region(ns558->io & ~(ns558->size - 1), ns558->size); |
283 | kfree(ns558); | 283 | kfree(ns558); |
diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index f8570fd9d2ab..3abd7fc6e5ef 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c | |||
@@ -191,8 +191,10 @@ static int __init capifs_init(void) | |||
191 | err = register_filesystem(&capifs_fs_type); | 191 | err = register_filesystem(&capifs_fs_type); |
192 | if (!err) { | 192 | if (!err) { |
193 | capifs_mnt = kern_mount(&capifs_fs_type); | 193 | capifs_mnt = kern_mount(&capifs_fs_type); |
194 | if (IS_ERR(capifs_mnt)) | 194 | if (IS_ERR(capifs_mnt)) { |
195 | err = PTR_ERR(capifs_mnt); | 195 | err = PTR_ERR(capifs_mnt); |
196 | unregister_filesystem(&capifs_fs_type); | ||
197 | } | ||
196 | } | 198 | } |
197 | if (!err) | 199 | if (!err) |
198 | printk(KERN_NOTICE "capifs: Rev %s\n", rev); | 200 | printk(KERN_NOTICE "capifs: Rev %s\n", rev); |
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig index 6c7b8bffc6fd..801c98f30e5c 100644 --- a/drivers/isdn/hisax/Kconfig +++ b/drivers/isdn/hisax/Kconfig | |||
@@ -134,6 +134,7 @@ config HISAX_AVM_A1 | |||
134 | 134 | ||
135 | config HISAX_FRITZPCI | 135 | config HISAX_FRITZPCI |
136 | bool "AVM PnP/PCI (Fritz!PnP/PCI)" | 136 | bool "AVM PnP/PCI (Fritz!PnP/PCI)" |
137 | depends on BROKEN || !PPC64 | ||
137 | help | 138 | help |
138 | This enables HiSax support for the AVM "Fritz!PnP" and "Fritz!PCI". | 139 | This enables HiSax support for the AVM "Fritz!PnP" and "Fritz!PCI". |
139 | See <file:Documentation/isdn/README.HiSax> on how to configure it. | 140 | See <file:Documentation/isdn/README.HiSax> on how to configure it. |
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index e0d1b01cc74c..386df71eee74 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c | |||
@@ -1650,7 +1650,7 @@ static void __exit icn_exit(void) | |||
1650 | { | 1650 | { |
1651 | isdn_ctrl cmd; | 1651 | isdn_ctrl cmd; |
1652 | icn_card *card = cards; | 1652 | icn_card *card = cards; |
1653 | icn_card *last; | 1653 | icn_card *last, *tmpcard; |
1654 | int i; | 1654 | int i; |
1655 | unsigned long flags; | 1655 | unsigned long flags; |
1656 | 1656 | ||
@@ -1670,8 +1670,9 @@ static void __exit icn_exit(void) | |||
1670 | for (i = 0; i < ICN_BCH; i++) | 1670 | for (i = 0; i < ICN_BCH; i++) |
1671 | icn_free_queue(card, i); | 1671 | icn_free_queue(card, i); |
1672 | } | 1672 | } |
1673 | card = card->next; | 1673 | tmpcard = card->next; |
1674 | spin_unlock_irqrestore(&card->lock, flags); | 1674 | spin_unlock_irqrestore(&card->lock, flags); |
1675 | card = tmpcard; | ||
1675 | } | 1676 | } |
1676 | card = cards; | 1677 | card = cards; |
1677 | cards = NULL; | 1678 | cards = NULL; |
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index 65ab64c43b3e..bc3e096d84f7 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
@@ -103,7 +103,7 @@ config PMAC_MEDIABAY | |||
103 | # on non-powerbook machines (but only on PMU based ones AFAIK) | 103 | # on non-powerbook machines (but only on PMU based ones AFAIK) |
104 | config PMAC_BACKLIGHT | 104 | config PMAC_BACKLIGHT |
105 | bool "Backlight control for LCD screens" | 105 | bool "Backlight control for LCD screens" |
106 | depends on ADB_PMU | 106 | depends on ADB_PMU && (BROKEN || !PPC64) |
107 | help | 107 | help |
108 | Say Y here to build in code to manage the LCD backlight on a | 108 | Say Y here to build in code to manage the LCD backlight on a |
109 | Macintosh PowerBook. With this code, the backlight will be turned | 109 | Macintosh PowerBook. With this code, the backlight will be turned |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 70bca955e0de..41df4cda66e2 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -818,8 +818,7 @@ int bitmap_unplug(struct bitmap *bitmap) | |||
818 | return 0; | 818 | return 0; |
819 | } | 819 | } |
820 | 820 | ||
821 | static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, | 821 | static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset); |
822 | unsigned long sectors, int in_sync); | ||
823 | /* * bitmap_init_from_disk -- called at bitmap_create time to initialize | 822 | /* * bitmap_init_from_disk -- called at bitmap_create time to initialize |
824 | * the in-memory bitmap from the on-disk bitmap -- also, sets up the | 823 | * the in-memory bitmap from the on-disk bitmap -- also, sets up the |
825 | * memory mapping of the bitmap file | 824 | * memory mapping of the bitmap file |
@@ -828,7 +827,7 @@ static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, | |||
828 | * previously kicked from the array, we mark all the bits as | 827 | * previously kicked from the array, we mark all the bits as |
829 | * 1's in order to cause a full resync. | 828 | * 1's in order to cause a full resync. |
830 | */ | 829 | */ |
831 | static int bitmap_init_from_disk(struct bitmap *bitmap, int in_sync) | 830 | static int bitmap_init_from_disk(struct bitmap *bitmap) |
832 | { | 831 | { |
833 | unsigned long i, chunks, index, oldindex, bit; | 832 | unsigned long i, chunks, index, oldindex, bit; |
834 | struct page *page = NULL, *oldpage = NULL; | 833 | struct page *page = NULL, *oldpage = NULL; |
@@ -929,8 +928,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, int in_sync) | |||
929 | } | 928 | } |
930 | if (test_bit(bit, page_address(page))) { | 929 | if (test_bit(bit, page_address(page))) { |
931 | /* if the disk bit is set, set the memory bit */ | 930 | /* if the disk bit is set, set the memory bit */ |
932 | bitmap_set_memory_bits(bitmap, | 931 | bitmap_set_memory_bits(bitmap, i << CHUNK_BLOCK_SHIFT(bitmap)); |
933 | i << CHUNK_BLOCK_SHIFT(bitmap), 1, in_sync); | ||
934 | bit_cnt++; | 932 | bit_cnt++; |
935 | } | 933 | } |
936 | } | 934 | } |
@@ -1426,35 +1424,53 @@ void bitmap_close_sync(struct bitmap *bitmap) | |||
1426 | } | 1424 | } |
1427 | } | 1425 | } |
1428 | 1426 | ||
1429 | static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, | 1427 | static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset) |
1430 | unsigned long sectors, int in_sync) | ||
1431 | { | 1428 | { |
1432 | /* For each chunk covered by any of these sectors, set the | 1429 | /* For each chunk covered by any of these sectors, set the |
1433 | * counter to 1 and set resync_needed unless in_sync. They should all | 1430 | * counter to 1 and set resync_needed. They should all |
1434 | * be 0 at this point | 1431 | * be 0 at this point |
1435 | */ | 1432 | */ |
1436 | while (sectors) { | 1433 | |
1437 | int secs; | 1434 | int secs; |
1438 | bitmap_counter_t *bmc; | 1435 | bitmap_counter_t *bmc; |
1439 | spin_lock_irq(&bitmap->lock); | 1436 | spin_lock_irq(&bitmap->lock); |
1440 | bmc = bitmap_get_counter(bitmap, offset, &secs, 1); | 1437 | bmc = bitmap_get_counter(bitmap, offset, &secs, 1); |
1441 | if (!bmc) { | 1438 | if (!bmc) { |
1442 | spin_unlock_irq(&bitmap->lock); | ||
1443 | return; | ||
1444 | } | ||
1445 | if (! *bmc) { | ||
1446 | struct page *page; | ||
1447 | *bmc = 1 | (in_sync? 0 : NEEDED_MASK); | ||
1448 | bitmap_count_page(bitmap, offset, 1); | ||
1449 | page = filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap)); | ||
1450 | set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN); | ||
1451 | } | ||
1452 | spin_unlock_irq(&bitmap->lock); | 1439 | spin_unlock_irq(&bitmap->lock); |
1453 | if (sectors > secs) | 1440 | return; |
1454 | sectors -= secs; | 1441 | } |
1455 | else | 1442 | if (! *bmc) { |
1456 | sectors = 0; | 1443 | struct page *page; |
1444 | *bmc = 1 | NEEDED_MASK; | ||
1445 | bitmap_count_page(bitmap, offset, 1); | ||
1446 | page = filemap_get_page(bitmap, offset >> CHUNK_BLOCK_SHIFT(bitmap)); | ||
1447 | set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN); | ||
1457 | } | 1448 | } |
1449 | spin_unlock_irq(&bitmap->lock); | ||
1450 | |||
1451 | } | ||
1452 | |||
1453 | /* | ||
1454 | * flush out any pending updates | ||
1455 | */ | ||
1456 | void bitmap_flush(mddev_t *mddev) | ||
1457 | { | ||
1458 | struct bitmap *bitmap = mddev->bitmap; | ||
1459 | int sleep; | ||
1460 | |||
1461 | if (!bitmap) /* there was no bitmap */ | ||
1462 | return; | ||
1463 | |||
1464 | /* run the daemon_work three time to ensure everything is flushed | ||
1465 | * that can be | ||
1466 | */ | ||
1467 | sleep = bitmap->daemon_sleep; | ||
1468 | bitmap->daemon_sleep = 0; | ||
1469 | bitmap_daemon_work(bitmap); | ||
1470 | bitmap_daemon_work(bitmap); | ||
1471 | bitmap_daemon_work(bitmap); | ||
1472 | bitmap->daemon_sleep = sleep; | ||
1473 | bitmap_update_sb(bitmap); | ||
1458 | } | 1474 | } |
1459 | 1475 | ||
1460 | /* | 1476 | /* |
@@ -1565,7 +1581,8 @@ int bitmap_create(mddev_t *mddev) | |||
1565 | 1581 | ||
1566 | /* now that we have some pages available, initialize the in-memory | 1582 | /* now that we have some pages available, initialize the in-memory |
1567 | * bitmap from the on-disk bitmap */ | 1583 | * bitmap from the on-disk bitmap */ |
1568 | err = bitmap_init_from_disk(bitmap, mddev->recovery_cp == MaxSector); | 1584 | err = bitmap_init_from_disk(bitmap); |
1585 | |||
1569 | if (err) | 1586 | if (err) |
1570 | return err; | 1587 | return err; |
1571 | 1588 | ||
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 12031c9d3f1e..b08df8b9b2ca 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -1230,7 +1230,7 @@ static int __init dm_mirror_init(void) | |||
1230 | if (r) | 1230 | if (r) |
1231 | return r; | 1231 | return r; |
1232 | 1232 | ||
1233 | _kmirrord_wq = create_workqueue("kmirrord"); | 1233 | _kmirrord_wq = create_singlethread_workqueue("kmirrord"); |
1234 | if (!_kmirrord_wq) { | 1234 | if (!_kmirrord_wq) { |
1235 | DMERR("couldn't start kmirrord"); | 1235 | DMERR("couldn't start kmirrord"); |
1236 | dm_dirty_log_exit(); | 1236 | dm_dirty_log_exit(); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 6580e0fa4a47..20ca80b7dc20 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -256,8 +256,7 @@ static inline void mddev_unlock(mddev_t * mddev) | |||
256 | { | 256 | { |
257 | up(&mddev->reconfig_sem); | 257 | up(&mddev->reconfig_sem); |
258 | 258 | ||
259 | if (mddev->thread) | 259 | md_wakeup_thread(mddev->thread); |
260 | md_wakeup_thread(mddev->thread); | ||
261 | } | 260 | } |
262 | 261 | ||
263 | mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr) | 262 | mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr) |
@@ -623,6 +622,7 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
623 | mddev->raid_disks = sb->raid_disks; | 622 | mddev->raid_disks = sb->raid_disks; |
624 | mddev->size = sb->size; | 623 | mddev->size = sb->size; |
625 | mddev->events = md_event(sb); | 624 | mddev->events = md_event(sb); |
625 | mddev->bitmap_offset = 0; | ||
626 | 626 | ||
627 | if (sb->state & (1<<MD_SB_CLEAN)) | 627 | if (sb->state & (1<<MD_SB_CLEAN)) |
628 | mddev->recovery_cp = MaxSector; | 628 | mddev->recovery_cp = MaxSector; |
@@ -938,6 +938,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
938 | mddev->raid_disks = le32_to_cpu(sb->raid_disks); | 938 | mddev->raid_disks = le32_to_cpu(sb->raid_disks); |
939 | mddev->size = le64_to_cpu(sb->size)/2; | 939 | mddev->size = le64_to_cpu(sb->size)/2; |
940 | mddev->events = le64_to_cpu(sb->events); | 940 | mddev->events = le64_to_cpu(sb->events); |
941 | mddev->bitmap_offset = 0; | ||
941 | 942 | ||
942 | mddev->recovery_cp = le64_to_cpu(sb->resync_offset); | 943 | mddev->recovery_cp = le64_to_cpu(sb->resync_offset); |
943 | memcpy(mddev->uuid, sb->set_uuid, 16); | 944 | memcpy(mddev->uuid, sb->set_uuid, 16); |
@@ -1688,6 +1689,7 @@ static int do_md_run(mddev_t * mddev) | |||
1688 | mddev->pers = pers[pnum]; | 1689 | mddev->pers = pers[pnum]; |
1689 | spin_unlock(&pers_lock); | 1690 | spin_unlock(&pers_lock); |
1690 | 1691 | ||
1692 | mddev->recovery = 0; | ||
1691 | mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */ | 1693 | mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */ |
1692 | 1694 | ||
1693 | /* before we start the array running, initialise the bitmap */ | 1695 | /* before we start the array running, initialise the bitmap */ |
@@ -1712,6 +1714,7 @@ static int do_md_run(mddev_t * mddev) | |||
1712 | mddev->in_sync = 1; | 1714 | mddev->in_sync = 1; |
1713 | 1715 | ||
1714 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 1716 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
1717 | md_wakeup_thread(mddev->thread); | ||
1715 | 1718 | ||
1716 | if (mddev->sb_dirty) | 1719 | if (mddev->sb_dirty) |
1717 | md_update_sb(mddev); | 1720 | md_update_sb(mddev); |
@@ -1798,6 +1801,8 @@ static int do_md_stop(mddev_t * mddev, int ro) | |||
1798 | goto out; | 1801 | goto out; |
1799 | mddev->ro = 1; | 1802 | mddev->ro = 1; |
1800 | } else { | 1803 | } else { |
1804 | bitmap_flush(mddev); | ||
1805 | wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0); | ||
1801 | if (mddev->ro) | 1806 | if (mddev->ro) |
1802 | set_disk_ro(disk, 0); | 1807 | set_disk_ro(disk, 0); |
1803 | blk_queue_make_request(mddev->queue, md_fail_request); | 1808 | blk_queue_make_request(mddev->queue, md_fail_request); |
@@ -1822,6 +1827,7 @@ static int do_md_stop(mddev_t * mddev, int ro) | |||
1822 | fput(mddev->bitmap_file); | 1827 | fput(mddev->bitmap_file); |
1823 | mddev->bitmap_file = NULL; | 1828 | mddev->bitmap_file = NULL; |
1824 | } | 1829 | } |
1830 | mddev->bitmap_offset = 0; | ||
1825 | 1831 | ||
1826 | /* | 1832 | /* |
1827 | * Free resources if final stop | 1833 | * Free resources if final stop |
@@ -2231,8 +2237,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
2231 | export_rdev(rdev); | 2237 | export_rdev(rdev); |
2232 | 2238 | ||
2233 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 2239 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
2234 | if (mddev->thread) | 2240 | md_wakeup_thread(mddev->thread); |
2235 | md_wakeup_thread(mddev->thread); | ||
2236 | return err; | 2241 | return err; |
2237 | } | 2242 | } |
2238 | 2243 | ||
@@ -3484,7 +3489,6 @@ static void md_do_sync(mddev_t *mddev) | |||
3484 | goto skip; | 3489 | goto skip; |
3485 | } | 3490 | } |
3486 | ITERATE_MDDEV(mddev2,tmp) { | 3491 | ITERATE_MDDEV(mddev2,tmp) { |
3487 | printk("."); | ||
3488 | if (mddev2 == mddev) | 3492 | if (mddev2 == mddev) |
3489 | continue; | 3493 | continue; |
3490 | if (mddev2->curr_resync && | 3494 | if (mddev2->curr_resync && |
@@ -4007,3 +4011,5 @@ EXPORT_SYMBOL(md_wakeup_thread); | |||
4007 | EXPORT_SYMBOL(md_print_devices); | 4011 | EXPORT_SYMBOL(md_print_devices); |
4008 | EXPORT_SYMBOL(md_check_recovery); | 4012 | EXPORT_SYMBOL(md_check_recovery); |
4009 | MODULE_LICENSE("GPL"); | 4013 | MODULE_LICENSE("GPL"); |
4014 | MODULE_ALIAS("md"); | ||
4015 | MODULE_ALIAS_BLOCKDEV_MAJOR(MD_MAJOR); | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d3a64a04a6d8..51d9645ed09c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -893,7 +893,6 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error) | |||
893 | if (!uptodate) { | 893 | if (!uptodate) { |
894 | md_error(r1_bio->mddev, | 894 | md_error(r1_bio->mddev, |
895 | conf->mirrors[r1_bio->read_disk].rdev); | 895 | conf->mirrors[r1_bio->read_disk].rdev); |
896 | set_bit(R1BIO_Degraded, &r1_bio->state); | ||
897 | } else | 896 | } else |
898 | set_bit(R1BIO_Uptodate, &r1_bio->state); | 897 | set_bit(R1BIO_Uptodate, &r1_bio->state); |
899 | rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev); | 898 | rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev); |
@@ -918,10 +917,9 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error) | |||
918 | mirror = i; | 917 | mirror = i; |
919 | break; | 918 | break; |
920 | } | 919 | } |
921 | if (!uptodate) { | 920 | if (!uptodate) |
922 | md_error(mddev, conf->mirrors[mirror].rdev); | 921 | md_error(mddev, conf->mirrors[mirror].rdev); |
923 | set_bit(R1BIO_Degraded, &r1_bio->state); | 922 | |
924 | } | ||
925 | update_head_pos(mirror, r1_bio); | 923 | update_head_pos(mirror, r1_bio); |
926 | 924 | ||
927 | if (atomic_dec_and_test(&r1_bio->remaining)) { | 925 | if (atomic_dec_and_test(&r1_bio->remaining)) { |
@@ -1109,6 +1107,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1109 | int i; | 1107 | int i; |
1110 | int write_targets = 0; | 1108 | int write_targets = 0; |
1111 | int sync_blocks; | 1109 | int sync_blocks; |
1110 | int still_degraded = 0; | ||
1112 | 1111 | ||
1113 | if (!conf->r1buf_pool) | 1112 | if (!conf->r1buf_pool) |
1114 | { | 1113 | { |
@@ -1137,7 +1136,10 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1137 | return 0; | 1136 | return 0; |
1138 | } | 1137 | } |
1139 | 1138 | ||
1140 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, mddev->degraded) && | 1139 | /* before building a request, check if we can skip these blocks.. |
1140 | * This call the bitmap_start_sync doesn't actually record anything | ||
1141 | */ | ||
1142 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && | ||
1141 | !conf->fullsync) { | 1143 | !conf->fullsync) { |
1142 | /* We can skip this block, and probably several more */ | 1144 | /* We can skip this block, and probably several more */ |
1143 | *skipped = 1; | 1145 | *skipped = 1; |
@@ -1203,24 +1205,23 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1203 | if (i == disk) { | 1205 | if (i == disk) { |
1204 | bio->bi_rw = READ; | 1206 | bio->bi_rw = READ; |
1205 | bio->bi_end_io = end_sync_read; | 1207 | bio->bi_end_io = end_sync_read; |
1206 | } else if (conf->mirrors[i].rdev && | 1208 | } else if (conf->mirrors[i].rdev == NULL || |
1207 | !conf->mirrors[i].rdev->faulty && | 1209 | conf->mirrors[i].rdev->faulty) { |
1208 | (!conf->mirrors[i].rdev->in_sync || | 1210 | still_degraded = 1; |
1209 | sector_nr + RESYNC_SECTORS > mddev->recovery_cp)) { | 1211 | continue; |
1212 | } else if (!conf->mirrors[i].rdev->in_sync || | ||
1213 | sector_nr + RESYNC_SECTORS > mddev->recovery_cp) { | ||
1210 | bio->bi_rw = WRITE; | 1214 | bio->bi_rw = WRITE; |
1211 | bio->bi_end_io = end_sync_write; | 1215 | bio->bi_end_io = end_sync_write; |
1212 | write_targets ++; | 1216 | write_targets ++; |
1213 | } else | 1217 | } else |
1218 | /* no need to read or write here */ | ||
1214 | continue; | 1219 | continue; |
1215 | bio->bi_sector = sector_nr + conf->mirrors[i].rdev->data_offset; | 1220 | bio->bi_sector = sector_nr + conf->mirrors[i].rdev->data_offset; |
1216 | bio->bi_bdev = conf->mirrors[i].rdev->bdev; | 1221 | bio->bi_bdev = conf->mirrors[i].rdev->bdev; |
1217 | bio->bi_private = r1_bio; | 1222 | bio->bi_private = r1_bio; |
1218 | } | 1223 | } |
1219 | 1224 | ||
1220 | if (write_targets + 1 < conf->raid_disks) | ||
1221 | /* array degraded, can't clear bitmap */ | ||
1222 | set_bit(R1BIO_Degraded, &r1_bio->state); | ||
1223 | |||
1224 | if (write_targets == 0) { | 1225 | if (write_targets == 0) { |
1225 | /* There is nowhere to write, so all non-sync | 1226 | /* There is nowhere to write, so all non-sync |
1226 | * drives must be failed - so we are finished | 1227 | * drives must be failed - so we are finished |
@@ -1243,7 +1244,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i | |||
1243 | break; | 1244 | break; |
1244 | if (sync_blocks == 0) { | 1245 | if (sync_blocks == 0) { |
1245 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, | 1246 | if (!bitmap_start_sync(mddev->bitmap, sector_nr, |
1246 | &sync_blocks, mddev->degraded) && | 1247 | &sync_blocks, still_degraded) && |
1247 | !conf->fullsync) | 1248 | !conf->fullsync) |
1248 | break; | 1249 | break; |
1249 | if (sync_blocks < (PAGE_SIZE>>9)) | 1250 | if (sync_blocks < (PAGE_SIZE>>9)) |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4698d5f79575..43f231a467d5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1653,6 +1653,7 @@ static int run (mddev_t *mddev) | |||
1653 | 1653 | ||
1654 | /* device size must be a multiple of chunk size */ | 1654 | /* device size must be a multiple of chunk size */ |
1655 | mddev->size &= ~(mddev->chunk_size/1024 -1); | 1655 | mddev->size &= ~(mddev->chunk_size/1024 -1); |
1656 | mddev->resync_max_sectors = mddev->size << 1; | ||
1656 | 1657 | ||
1657 | if (!conf->chunk_size || conf->chunk_size % 4) { | 1658 | if (!conf->chunk_size || conf->chunk_size % 4) { |
1658 | printk(KERN_ERR "raid5: invalid chunk size %d for %s\n", | 1659 | printk(KERN_ERR "raid5: invalid chunk size %d for %s\n", |
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index f5ee16805111..495dee1d1e83 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -1813,6 +1813,7 @@ static int run (mddev_t *mddev) | |||
1813 | 1813 | ||
1814 | /* device size must be a multiple of chunk size */ | 1814 | /* device size must be a multiple of chunk size */ |
1815 | mddev->size &= ~(mddev->chunk_size/1024 -1); | 1815 | mddev->size &= ~(mddev->chunk_size/1024 -1); |
1816 | mddev->resync_max_sectors = mddev->size << 1; | ||
1816 | 1817 | ||
1817 | if (conf->raid_disks < 4) { | 1818 | if (conf->raid_disks < 4) { |
1818 | printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n", | 1819 | printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n", |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 63b626f70c81..9b9d6f8ee74e 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -70,13 +70,22 @@ EXPORT_SYMBOL(dibusb_power_ctrl); | |||
70 | 70 | ||
71 | int dibusb2_0_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 71 | int dibusb2_0_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
72 | { | 72 | { |
73 | u8 b[2]; | 73 | u8 b[3] = { 0 }; |
74 | b[0] = DIBUSB_REQ_SET_IOCTL; | 74 | int ret; |
75 | b[1] = onoff ? DIBUSB_IOCTL_CMD_ENABLE_STREAM : DIBUSB_IOCTL_CMD_DISABLE_STREAM; | 75 | |
76 | if ((ret = dibusb_streaming_ctrl(d,onoff)) < 0) | ||
77 | return ret; | ||
76 | 78 | ||
77 | dvb_usb_generic_write(d,b,3); | 79 | if (onoff) { |
80 | b[0] = DIBUSB_REQ_SET_STREAMING_MODE; | ||
81 | b[1] = 0x00; | ||
82 | if ((ret = dvb_usb_generic_write(d,b,2)) < 0) | ||
83 | return ret; | ||
84 | } | ||
78 | 85 | ||
79 | return dibusb_streaming_ctrl(d,onoff); | 86 | b[0] = DIBUSB_REQ_SET_IOCTL; |
87 | b[1] = onoff ? DIBUSB_IOCTL_CMD_ENABLE_STREAM : DIBUSB_IOCTL_CMD_DISABLE_STREAM; | ||
88 | return dvb_usb_generic_write(d,b,3); | ||
80 | } | 89 | } |
81 | EXPORT_SYMBOL(dibusb2_0_streaming_ctrl); | 90 | EXPORT_SYMBOL(dibusb2_0_streaming_ctrl); |
82 | 91 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index 3491ff40885c..6fa92100248b 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | |||
@@ -23,12 +23,12 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
23 | */ | 23 | */ |
24 | if (newfeedcount == 0) { | 24 | if (newfeedcount == 0) { |
25 | deb_ts("stop feeding\n"); | 25 | deb_ts("stop feeding\n"); |
26 | dvb_usb_urb_kill(d); | ||
26 | 27 | ||
27 | if (d->props.streaming_ctrl != NULL) | 28 | if (d->props.streaming_ctrl != NULL) |
28 | if ((ret = d->props.streaming_ctrl(d,0))) | 29 | if ((ret = d->props.streaming_ctrl(d,0))) |
29 | err("error while stopping stream."); | 30 | err("error while stopping stream."); |
30 | 31 | ||
31 | dvb_usb_urb_kill(d); | ||
32 | } | 32 | } |
33 | 33 | ||
34 | d->feedcount = newfeedcount; | 34 | d->feedcount = newfeedcount; |
@@ -44,6 +44,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
44 | * for reception. | 44 | * for reception. |
45 | */ | 45 | */ |
46 | if (d->feedcount == onoff && d->feedcount > 0) { | 46 | if (d->feedcount == onoff && d->feedcount > 0) { |
47 | deb_ts("submitting all URBs\n"); | ||
48 | dvb_usb_urb_submit(d); | ||
47 | 49 | ||
48 | deb_ts("controlling pid parser\n"); | 50 | deb_ts("controlling pid parser\n"); |
49 | if (d->props.caps & DVB_USB_HAS_PID_FILTER && | 51 | if (d->props.caps & DVB_USB_HAS_PID_FILTER && |
@@ -59,7 +61,6 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
59 | return -ENODEV; | 61 | return -ENODEV; |
60 | } | 62 | } |
61 | 63 | ||
62 | dvb_usb_urb_submit(d); | ||
63 | } | 64 | } |
64 | return 0; | 65 | return 0; |
65 | } | 66 | } |
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index e83256d0fd14..a50a41f6f79d 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
@@ -188,7 +188,7 @@ config DVB_BCM3510 | |||
188 | support this frontend. | 188 | support this frontend. |
189 | 189 | ||
190 | config DVB_LGDT330X | 190 | config DVB_LGDT330X |
191 | tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)" | 191 | tristate "LG Electronics LGDT3302/LGDT3303 based" |
192 | depends on DVB_CORE | 192 | depends on DVB_CORE |
193 | help | 193 | help |
194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want | 194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 5264310c070e..536c35d969b7 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -225,6 +225,22 @@ struct dvb_pll_desc dvb_pll_tua6034 = { | |||
225 | }; | 225 | }; |
226 | EXPORT_SYMBOL(dvb_pll_tua6034); | 226 | EXPORT_SYMBOL(dvb_pll_tua6034); |
227 | 227 | ||
228 | /* Infineon TUA6034 | ||
229 | * used in LG Innotek TDVS-H062F | ||
230 | */ | ||
231 | struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { | ||
232 | .name = "LG/Infineon TUA6034", | ||
233 | .min = 54000000, | ||
234 | .max = 863000000, | ||
235 | .count = 3, | ||
236 | .entries = { | ||
237 | { 160000000, 44000000, 62500, 0xce, 0x01 }, | ||
238 | { 455000000, 44000000, 62500, 0xce, 0x02 }, | ||
239 | { 999999999, 44000000, 62500, 0xce, 0x04 }, | ||
240 | }, | ||
241 | }; | ||
242 | EXPORT_SYMBOL(dvb_pll_tdvs_tua6034); | ||
243 | |||
228 | /* Philips FMD1216ME | 244 | /* Philips FMD1216ME |
229 | * used in Medion Hybrid PCMCIA card and USB Box | 245 | * used in Medion Hybrid PCMCIA card and USB Box |
230 | */ | 246 | */ |
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h index cb794759d89e..205b2d1a8852 100644 --- a/drivers/media/dvb/frontends/dvb-pll.h +++ b/drivers/media/dvb/frontends/dvb-pll.h | |||
@@ -31,6 +31,7 @@ extern struct dvb_pll_desc dvb_pll_unknown_1; | |||
31 | extern struct dvb_pll_desc dvb_pll_tua6010xs; | 31 | extern struct dvb_pll_desc dvb_pll_tua6010xs; |
32 | extern struct dvb_pll_desc dvb_pll_env57h1xd5; | 32 | extern struct dvb_pll_desc dvb_pll_env57h1xd5; |
33 | extern struct dvb_pll_desc dvb_pll_tua6034; | 33 | extern struct dvb_pll_desc dvb_pll_tua6034; |
34 | extern struct dvb_pll_desc dvb_pll_tdvs_tua6034; | ||
34 | extern struct dvb_pll_desc dvb_pll_tda665x; | 35 | extern struct dvb_pll_desc dvb_pll_tda665x; |
35 | extern struct dvb_pll_desc dvb_pll_fmd1216me; | 36 | extern struct dvb_pll_desc dvb_pll_fmd1216me; |
36 | extern struct dvb_pll_desc dvb_pll_tded4; | 37 | extern struct dvb_pll_desc dvb_pll_tded4; |
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index e94dee50eecd..1f1cd7a8d500 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c | |||
@@ -1,11 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FusionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
6 | * Based on code from Kirk Lapray <kirk_lapray@bigfoot.com> | ||
7 | * Copyright (C) 2005 | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
@@ -25,11 +22,13 @@ | |||
25 | /* | 22 | /* |
26 | * NOTES ABOUT THIS DRIVER | 23 | * NOTES ABOUT THIS DRIVER |
27 | * | 24 | * |
28 | * This driver supports DViCO FusionHDTV Gold under Linux. | 25 | * This Linux driver supports: |
26 | * DViCO FusionHDTV 3 Gold-Q | ||
27 | * DViCO FusionHDTV 3 Gold-T | ||
28 | * DViCO FusionHDTV 5 Gold | ||
29 | * | 29 | * |
30 | * TODO: | 30 | * TODO: |
31 | * BER and signal strength always return 0. | 31 | * signal strength always returns 0. |
32 | * Include support for LGDT3303 | ||
33 | * | 32 | * |
34 | */ | 33 | */ |
35 | 34 | ||
@@ -41,7 +40,6 @@ | |||
41 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
42 | 41 | ||
43 | #include "dvb_frontend.h" | 42 | #include "dvb_frontend.h" |
44 | #include "dvb-pll.h" | ||
45 | #include "lgdt330x_priv.h" | 43 | #include "lgdt330x_priv.h" |
46 | #include "lgdt330x.h" | 44 | #include "lgdt330x.h" |
47 | 45 | ||
@@ -70,55 +68,37 @@ struct lgdt330x_state | |||
70 | u32 current_frequency; | 68 | u32 current_frequency; |
71 | }; | 69 | }; |
72 | 70 | ||
73 | static int i2c_writebytes (struct lgdt330x_state* state, | 71 | static int i2c_write_demod_bytes (struct lgdt330x_state* state, |
74 | u8 addr, /* demod_address or pll_address */ | ||
75 | u8 *buf, /* data bytes to send */ | 72 | u8 *buf, /* data bytes to send */ |
76 | int len /* number of bytes to send */ ) | 73 | int len /* number of bytes to send */ ) |
77 | { | 74 | { |
78 | u8 tmp[] = { buf[0], buf[1] }; | ||
79 | struct i2c_msg msg = | 75 | struct i2c_msg msg = |
80 | { .addr = addr, .flags = 0, .buf = tmp, .len = 2 }; | 76 | { .addr = state->config->demod_address, |
81 | int err; | 77 | .flags = 0, |
78 | .buf = buf, | ||
79 | .len = 2 }; | ||
82 | int i; | 80 | int i; |
81 | int err; | ||
83 | 82 | ||
84 | for (i=1; i<len; i++) { | 83 | for (i=0; i<len-1; i+=2){ |
85 | tmp[1] = buf[i]; | ||
86 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 84 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
87 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err); | 85 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, msg.buf[0], msg.buf[1], err); |
88 | if (err < 0) | 86 | if (err < 0) |
89 | return err; | 87 | return err; |
90 | else | 88 | else |
91 | return -EREMOTEIO; | 89 | return -EREMOTEIO; |
92 | } | 90 | } |
93 | tmp[0]++; | 91 | msg.buf += 2; |
94 | } | 92 | } |
95 | return 0; | 93 | return 0; |
96 | } | 94 | } |
97 | 95 | ||
98 | #if 0 | ||
99 | static int i2c_readbytes (struct lgdt330x_state* state, | ||
100 | u8 addr, /* demod_address or pll_address */ | ||
101 | u8 *buf, /* holds data bytes read */ | ||
102 | int len /* number of bytes to read */ ) | ||
103 | { | ||
104 | struct i2c_msg msg = | ||
105 | { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len }; | ||
106 | int err; | ||
107 | |||
108 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | ||
109 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x, err == %i)\n", __FUNCTION__, addr, err); | ||
110 | return -EREMOTEIO; | ||
111 | } | ||
112 | return 0; | ||
113 | } | ||
114 | #endif | ||
115 | |||
116 | /* | 96 | /* |
117 | * This routine writes the register (reg) to the demod bus | 97 | * This routine writes the register (reg) to the demod bus |
118 | * then reads the data returned for (len) bytes. | 98 | * then reads the data returned for (len) bytes. |
119 | */ | 99 | */ |
120 | 100 | ||
121 | static u8 i2c_selectreadbytes (struct lgdt330x_state* state, | 101 | static u8 i2c_read_demod_bytes (struct lgdt330x_state* state, |
122 | enum I2C_REG reg, u8* buf, int len) | 102 | enum I2C_REG reg, u8* buf, int len) |
123 | { | 103 | { |
124 | u8 wr [] = { reg }; | 104 | u8 wr [] = { reg }; |
@@ -139,7 +119,7 @@ static u8 i2c_selectreadbytes (struct lgdt330x_state* state, | |||
139 | } | 119 | } |
140 | 120 | ||
141 | /* Software reset */ | 121 | /* Software reset */ |
142 | int lgdt330x_SwReset(struct lgdt330x_state* state) | 122 | static int lgdt3302_SwReset(struct lgdt330x_state* state) |
143 | { | 123 | { |
144 | u8 ret; | 124 | u8 ret; |
145 | u8 reset[] = { | 125 | u8 reset[] = { |
@@ -148,23 +128,51 @@ int lgdt330x_SwReset(struct lgdt330x_state* state) | |||
148 | * bits 5-0 are 1 to mask interrupts */ | 128 | * bits 5-0 are 1 to mask interrupts */ |
149 | }; | 129 | }; |
150 | 130 | ||
151 | ret = i2c_writebytes(state, | 131 | ret = i2c_write_demod_bytes(state, |
152 | state->config->demod_address, | 132 | reset, sizeof(reset)); |
133 | if (ret == 0) { | ||
134 | |||
135 | /* force reset high (inactive) and unmask interrupts */ | ||
136 | reset[1] = 0x7f; | ||
137 | ret = i2c_write_demod_bytes(state, | ||
138 | reset, sizeof(reset)); | ||
139 | } | ||
140 | return ret; | ||
141 | } | ||
142 | |||
143 | static int lgdt3303_SwReset(struct lgdt330x_state* state) | ||
144 | { | ||
145 | u8 ret; | ||
146 | u8 reset[] = { | ||
147 | 0x02, | ||
148 | 0x00 /* bit 0 is active low software reset */ | ||
149 | }; | ||
150 | |||
151 | ret = i2c_write_demod_bytes(state, | ||
153 | reset, sizeof(reset)); | 152 | reset, sizeof(reset)); |
154 | if (ret == 0) { | 153 | if (ret == 0) { |
155 | /* spec says reset takes 100 ns why wait */ | 154 | |
156 | /* mdelay(100); */ /* keep low for 100mS */ | 155 | /* force reset high (inactive) */ |
157 | reset[1] = 0x7f; /* force reset high (inactive) | 156 | reset[1] = 0x01; |
158 | * and unmask interrupts */ | 157 | ret = i2c_write_demod_bytes(state, |
159 | ret = i2c_writebytes(state, | ||
160 | state->config->demod_address, | ||
161 | reset, sizeof(reset)); | 158 | reset, sizeof(reset)); |
162 | } | 159 | } |
163 | /* Spec does not indicate a need for this either */ | ||
164 | /*mdelay(5); */ /* wait 5 msec before doing more */ | ||
165 | return ret; | 160 | return ret; |
166 | } | 161 | } |
167 | 162 | ||
163 | static int lgdt330x_SwReset(struct lgdt330x_state* state) | ||
164 | { | ||
165 | switch (state->config->demod_chip) { | ||
166 | case LGDT3302: | ||
167 | return lgdt3302_SwReset(state); | ||
168 | case LGDT3303: | ||
169 | return lgdt3303_SwReset(state); | ||
170 | default: | ||
171 | return -ENODEV; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | |||
168 | static int lgdt330x_init(struct dvb_frontend* fe) | 176 | static int lgdt330x_init(struct dvb_frontend* fe) |
169 | { | 177 | { |
170 | /* Hardware reset is done using gpio[0] of cx23880x chip. | 178 | /* Hardware reset is done using gpio[0] of cx23880x chip. |
@@ -173,22 +181,98 @@ static int lgdt330x_init(struct dvb_frontend* fe) | |||
173 | * Maybe there needs to be a callable function in cx88-core or | 181 | * Maybe there needs to be a callable function in cx88-core or |
174 | * the caller of this function needs to do it. */ | 182 | * the caller of this function needs to do it. */ |
175 | 183 | ||
176 | dprintk("%s entered\n", __FUNCTION__); | 184 | /* |
177 | return lgdt330x_SwReset((struct lgdt330x_state*) fe->demodulator_priv); | 185 | * Array of byte pairs <address, value> |
186 | * to initialize each different chip | ||
187 | */ | ||
188 | static u8 lgdt3302_init_data[] = { | ||
189 | /* Use 50MHz parameter values from spec sheet since xtal is 50 */ | ||
190 | /* Change the value of NCOCTFV[25:0] of carrier | ||
191 | recovery center frequency register */ | ||
192 | VSB_CARRIER_FREQ0, 0x00, | ||
193 | VSB_CARRIER_FREQ1, 0x87, | ||
194 | VSB_CARRIER_FREQ2, 0x8e, | ||
195 | VSB_CARRIER_FREQ3, 0x01, | ||
196 | /* Change the TPCLK pin polarity | ||
197 | data is valid on falling clock */ | ||
198 | DEMUX_CONTROL, 0xfb, | ||
199 | /* Change the value of IFBW[11:0] of | ||
200 | AGC IF/RF loop filter bandwidth register */ | ||
201 | AGC_RF_BANDWIDTH0, 0x40, | ||
202 | AGC_RF_BANDWIDTH1, 0x93, | ||
203 | AGC_RF_BANDWIDTH2, 0x00, | ||
204 | /* Change the value of bit 6, 'nINAGCBY' and | ||
205 | 'NSSEL[1:0] of ACG function control register 2 */ | ||
206 | AGC_FUNC_CTRL2, 0xc6, | ||
207 | /* Change the value of bit 6 'RFFIX' | ||
208 | of AGC function control register 3 */ | ||
209 | AGC_FUNC_CTRL3, 0x40, | ||
210 | /* Set the value of 'INLVTHD' register 0x2a/0x2c | ||
211 | to 0x7fe */ | ||
212 | AGC_DELAY0, 0x07, | ||
213 | AGC_DELAY2, 0xfe, | ||
214 | /* Change the value of IAGCBW[15:8] | ||
215 | of inner AGC loop filter bandwith */ | ||
216 | AGC_LOOP_BANDWIDTH0, 0x08, | ||
217 | AGC_LOOP_BANDWIDTH1, 0x9a | ||
218 | }; | ||
219 | |||
220 | static u8 lgdt3303_init_data[] = { | ||
221 | 0x4c, 0x14 | ||
222 | }; | ||
223 | |||
224 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
225 | char *chip_name; | ||
226 | int err; | ||
227 | |||
228 | switch (state->config->demod_chip) { | ||
229 | case LGDT3302: | ||
230 | chip_name = "LGDT3302"; | ||
231 | err = i2c_write_demod_bytes(state, lgdt3302_init_data, | ||
232 | sizeof(lgdt3302_init_data)); | ||
233 | break; | ||
234 | case LGDT3303: | ||
235 | chip_name = "LGDT3303"; | ||
236 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, | ||
237 | sizeof(lgdt3303_init_data)); | ||
238 | break; | ||
239 | default: | ||
240 | chip_name = "undefined"; | ||
241 | printk (KERN_WARNING "Only LGDT3302 and LGDT3303 are supported chips.\n"); | ||
242 | err = -ENODEV; | ||
243 | } | ||
244 | dprintk("%s entered as %s\n", __FUNCTION__, chip_name); | ||
245 | if (err < 0) | ||
246 | return err; | ||
247 | return lgdt330x_SwReset(state); | ||
178 | } | 248 | } |
179 | 249 | ||
180 | static int lgdt330x_read_ber(struct dvb_frontend* fe, u32* ber) | 250 | static int lgdt330x_read_ber(struct dvb_frontend* fe, u32* ber) |
181 | { | 251 | { |
182 | *ber = 0; /* Dummy out for now */ | 252 | *ber = 0; /* Not supplied by the demod chips */ |
183 | return 0; | 253 | return 0; |
184 | } | 254 | } |
185 | 255 | ||
186 | static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 256 | static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
187 | { | 257 | { |
188 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 258 | struct lgdt330x_state* state = fe->demodulator_priv; |
259 | int err; | ||
189 | u8 buf[2]; | 260 | u8 buf[2]; |
190 | 261 | ||
191 | i2c_selectreadbytes(state, PACKET_ERR_COUNTER1, buf, sizeof(buf)); | 262 | switch (state->config->demod_chip) { |
263 | case LGDT3302: | ||
264 | err = i2c_read_demod_bytes(state, LGDT3302_PACKET_ERR_COUNTER1, | ||
265 | buf, sizeof(buf)); | ||
266 | break; | ||
267 | case LGDT3303: | ||
268 | err = i2c_read_demod_bytes(state, LGDT3303_PACKET_ERR_COUNTER1, | ||
269 | buf, sizeof(buf)); | ||
270 | break; | ||
271 | default: | ||
272 | printk(KERN_WARNING | ||
273 | "Only LGDT3302 and LGDT3303 are supported chips.\n"); | ||
274 | err = -ENODEV; | ||
275 | } | ||
192 | 276 | ||
193 | *ucblocks = (buf[0] << 8) | buf[1]; | 277 | *ucblocks = (buf[0] << 8) | buf[1]; |
194 | return 0; | 278 | return 0; |
@@ -197,123 +281,113 @@ static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
197 | static int lgdt330x_set_parameters(struct dvb_frontend* fe, | 281 | static int lgdt330x_set_parameters(struct dvb_frontend* fe, |
198 | struct dvb_frontend_parameters *param) | 282 | struct dvb_frontend_parameters *param) |
199 | { | 283 | { |
200 | struct lgdt330x_state* state = | 284 | /* |
201 | (struct lgdt330x_state*) fe->demodulator_priv; | 285 | * Array of byte pairs <address, value> |
286 | * to initialize 8VSB for lgdt3303 chip 50 MHz IF | ||
287 | */ | ||
288 | static u8 lgdt3303_8vsb_44_data[] = { | ||
289 | 0x04, 0x00, | ||
290 | 0x0d, 0x40, | ||
291 | 0x0e, 0x87, | ||
292 | 0x0f, 0x8e, | ||
293 | 0x10, 0x01, | ||
294 | 0x47, 0x8b }; | ||
295 | |||
296 | /* | ||
297 | * Array of byte pairs <address, value> | ||
298 | * to initialize QAM for lgdt3303 chip | ||
299 | */ | ||
300 | static u8 lgdt3303_qam_data[] = { | ||
301 | 0x04, 0x00, | ||
302 | 0x0d, 0x00, | ||
303 | 0x0e, 0x00, | ||
304 | 0x0f, 0x00, | ||
305 | 0x10, 0x00, | ||
306 | 0x51, 0x63, | ||
307 | 0x47, 0x66, | ||
308 | 0x48, 0x66, | ||
309 | 0x4d, 0x1a, | ||
310 | 0x49, 0x08, | ||
311 | 0x4a, 0x9b }; | ||
312 | |||
313 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
202 | 314 | ||
203 | /* Use 50MHz parameter values from spec sheet since xtal is 50 */ | ||
204 | static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 }; | 315 | static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 }; |
205 | static u8 vsb_freq_cfg[] = { VSB_CARRIER_FREQ0, 0x00, 0x87, 0x8e, 0x01 }; | ||
206 | static u8 demux_ctrl_cfg[] = { DEMUX_CONTROL, 0xfb }; | ||
207 | static u8 agc_rf_cfg[] = { AGC_RF_BANDWIDTH0, 0x40, 0x93, 0x00 }; | ||
208 | static u8 agc_ctrl_cfg[] = { AGC_FUNC_CTRL2, 0xc6, 0x40 }; | ||
209 | static u8 agc_delay_cfg[] = { AGC_DELAY0, 0x07, 0x00, 0xfe }; | ||
210 | static u8 agc_loop_cfg[] = { AGC_LOOP_BANDWIDTH0, 0x08, 0x9a }; | ||
211 | 316 | ||
317 | int err; | ||
212 | /* Change only if we are actually changing the modulation */ | 318 | /* Change only if we are actually changing the modulation */ |
213 | if (state->current_modulation != param->u.vsb.modulation) { | 319 | if (state->current_modulation != param->u.vsb.modulation) { |
214 | switch(param->u.vsb.modulation) { | 320 | switch(param->u.vsb.modulation) { |
215 | case VSB_8: | 321 | case VSB_8: |
216 | dprintk("%s: VSB_8 MODE\n", __FUNCTION__); | 322 | dprintk("%s: VSB_8 MODE\n", __FUNCTION__); |
217 | 323 | ||
218 | /* Select VSB mode and serial MPEG interface */ | 324 | /* Select VSB mode */ |
219 | top_ctrl_cfg[1] = 0x07; | 325 | top_ctrl_cfg[1] = 0x03; |
220 | 326 | ||
221 | /* Select ANT connector if supported by card */ | 327 | /* Select ANT connector if supported by card */ |
222 | if (state->config->pll_rf_set) | 328 | if (state->config->pll_rf_set) |
223 | state->config->pll_rf_set(fe, 1); | 329 | state->config->pll_rf_set(fe, 1); |
330 | |||
331 | if (state->config->demod_chip == LGDT3303) { | ||
332 | err = i2c_write_demod_bytes(state, lgdt3303_8vsb_44_data, | ||
333 | sizeof(lgdt3303_8vsb_44_data)); | ||
334 | } | ||
224 | break; | 335 | break; |
225 | 336 | ||
226 | case QAM_64: | 337 | case QAM_64: |
227 | dprintk("%s: QAM_64 MODE\n", __FUNCTION__); | 338 | dprintk("%s: QAM_64 MODE\n", __FUNCTION__); |
228 | 339 | ||
229 | /* Select QAM_64 mode and serial MPEG interface */ | 340 | /* Select QAM_64 mode */ |
230 | top_ctrl_cfg[1] = 0x04; | 341 | top_ctrl_cfg[1] = 0x00; |
231 | 342 | ||
232 | /* Select CABLE connector if supported by card */ | 343 | /* Select CABLE connector if supported by card */ |
233 | if (state->config->pll_rf_set) | 344 | if (state->config->pll_rf_set) |
234 | state->config->pll_rf_set(fe, 0); | 345 | state->config->pll_rf_set(fe, 0); |
346 | |||
347 | if (state->config->demod_chip == LGDT3303) { | ||
348 | err = i2c_write_demod_bytes(state, lgdt3303_qam_data, | ||
349 | sizeof(lgdt3303_qam_data)); | ||
350 | } | ||
235 | break; | 351 | break; |
236 | 352 | ||
237 | case QAM_256: | 353 | case QAM_256: |
238 | dprintk("%s: QAM_256 MODE\n", __FUNCTION__); | 354 | dprintk("%s: QAM_256 MODE\n", __FUNCTION__); |
239 | 355 | ||
240 | /* Select QAM_256 mode and serial MPEG interface */ | 356 | /* Select QAM_256 mode */ |
241 | top_ctrl_cfg[1] = 0x05; | 357 | top_ctrl_cfg[1] = 0x01; |
242 | 358 | ||
243 | /* Select CABLE connector if supported by card */ | 359 | /* Select CABLE connector if supported by card */ |
244 | if (state->config->pll_rf_set) | 360 | if (state->config->pll_rf_set) |
245 | state->config->pll_rf_set(fe, 0); | 361 | state->config->pll_rf_set(fe, 0); |
362 | |||
363 | if (state->config->demod_chip == LGDT3303) { | ||
364 | err = i2c_write_demod_bytes(state, lgdt3303_qam_data, | ||
365 | sizeof(lgdt3303_qam_data)); | ||
366 | } | ||
246 | break; | 367 | break; |
247 | default: | 368 | default: |
248 | printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation); | 369 | printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation); |
249 | return -1; | 370 | return -1; |
250 | } | 371 | } |
251 | /* Initializations common to all modes */ | 372 | /* |
373 | * select serial or parallel MPEG harware interface | ||
374 | * Serial: 0x04 for LGDT3302 or 0x40 for LGDT3303 | ||
375 | * Parallel: 0x00 | ||
376 | */ | ||
377 | top_ctrl_cfg[1] |= state->config->serial_mpeg; | ||
252 | 378 | ||
253 | /* Select the requested mode */ | 379 | /* Select the requested mode */ |
254 | i2c_writebytes(state, state->config->demod_address, | 380 | i2c_write_demod_bytes(state, top_ctrl_cfg, |
255 | top_ctrl_cfg, sizeof(top_ctrl_cfg)); | 381 | sizeof(top_ctrl_cfg)); |
256 | |||
257 | /* Change the value of IFBW[11:0] | ||
258 | of AGC IF/RF loop filter bandwidth register */ | ||
259 | i2c_writebytes(state, state->config->demod_address, | ||
260 | agc_rf_cfg, sizeof(agc_rf_cfg)); | ||
261 | |||
262 | /* Change the value of bit 6, 'nINAGCBY' and | ||
263 | 'NSSEL[1:0] of ACG function control register 2 */ | ||
264 | /* Change the value of bit 6 'RFFIX' | ||
265 | of AGC function control register 3 */ | ||
266 | i2c_writebytes(state, state->config->demod_address, | ||
267 | agc_ctrl_cfg, sizeof(agc_ctrl_cfg)); | ||
268 | |||
269 | /* Change the TPCLK pin polarity | ||
270 | data is valid on falling clock */ | ||
271 | i2c_writebytes(state, state->config->demod_address, | ||
272 | demux_ctrl_cfg, sizeof(demux_ctrl_cfg)); | ||
273 | |||
274 | /* Change the value of NCOCTFV[25:0] of carrier | ||
275 | recovery center frequency register */ | ||
276 | i2c_writebytes(state, state->config->demod_address, | ||
277 | vsb_freq_cfg, sizeof(vsb_freq_cfg)); | ||
278 | |||
279 | /* Set the value of 'INLVTHD' register 0x2a/0x2c to 0x7fe */ | ||
280 | i2c_writebytes(state, state->config->demod_address, | ||
281 | agc_delay_cfg, sizeof(agc_delay_cfg)); | ||
282 | |||
283 | /* Change the value of IAGCBW[15:8] | ||
284 | of inner AGC loop filter bandwith */ | ||
285 | i2c_writebytes(state, state->config->demod_address, | ||
286 | agc_loop_cfg, sizeof(agc_loop_cfg)); | ||
287 | |||
288 | state->config->set_ts_params(fe, 0); | 382 | state->config->set_ts_params(fe, 0); |
289 | state->current_modulation = param->u.vsb.modulation; | 383 | state->current_modulation = param->u.vsb.modulation; |
290 | } | 384 | } |
291 | 385 | ||
292 | /* Change only if we are actually changing the channel */ | 386 | /* Change only if we are actually changing the channel */ |
293 | if (state->current_frequency != param->frequency) { | 387 | if (state->current_frequency != param->frequency) { |
294 | u8 buf[5]; | 388 | /* Tune to the new frequency */ |
295 | struct i2c_msg msg = { .flags = 0, .buf = &buf[1], .len = 4 }; | 389 | state->config->pll_set(fe, param); |
296 | int err; | 390 | /* Keep track of the new frequency */ |
297 | |||
298 | state->config->pll_set(fe, param, buf); | ||
299 | msg.addr = buf[0]; | ||
300 | |||
301 | dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x " | ||
302 | "0x%02x 0x%02x\n", __FUNCTION__, | ||
303 | buf[0],buf[1],buf[2],buf[3],buf[4]); | ||
304 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | ||
305 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, buf[0], buf[1], err); | ||
306 | if (err < 0) | ||
307 | return err; | ||
308 | else | ||
309 | return -EREMOTEIO; | ||
310 | } | ||
311 | #if 0 | ||
312 | /* Check the status of the tuner pll */ | ||
313 | i2c_readbytes(state, buf[0], &buf[1], 1); | ||
314 | dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[1]); | ||
315 | #endif | ||
316 | /* Update current frequency */ | ||
317 | state->current_frequency = param->frequency; | 391 | state->current_frequency = param->frequency; |
318 | } | 392 | } |
319 | lgdt330x_SwReset(state); | 393 | lgdt330x_SwReset(state); |
@@ -328,21 +402,15 @@ static int lgdt330x_get_frontend(struct dvb_frontend* fe, | |||
328 | return 0; | 402 | return 0; |
329 | } | 403 | } |
330 | 404 | ||
331 | static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | 405 | static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status) |
332 | { | 406 | { |
333 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 407 | struct lgdt330x_state* state = fe->demodulator_priv; |
334 | u8 buf[3]; | 408 | u8 buf[3]; |
335 | 409 | ||
336 | *status = 0; /* Reset status result */ | 410 | *status = 0; /* Reset status result */ |
337 | 411 | ||
338 | /* | ||
339 | * You must set the Mask bits to 1 in the IRQ_MASK in order | ||
340 | * to see that status bit in the IRQ_STATUS register. | ||
341 | * This is done in SwReset(); | ||
342 | */ | ||
343 | |||
344 | /* AGC status register */ | 412 | /* AGC status register */ |
345 | i2c_selectreadbytes(state, AGC_STATUS, buf, 1); | 413 | i2c_read_demod_bytes(state, AGC_STATUS, buf, 1); |
346 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); | 414 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); |
347 | if ((buf[0] & 0x0c) == 0x8){ | 415 | if ((buf[0] & 0x0c) == 0x8){ |
348 | /* Test signal does not exist flag */ | 416 | /* Test signal does not exist flag */ |
@@ -353,16 +421,15 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
353 | return 0; | 421 | return 0; |
354 | } | 422 | } |
355 | 423 | ||
424 | /* | ||
425 | * You must set the Mask bits to 1 in the IRQ_MASK in order | ||
426 | * to see that status bit in the IRQ_STATUS register. | ||
427 | * This is done in SwReset(); | ||
428 | */ | ||
356 | /* signal status */ | 429 | /* signal status */ |
357 | i2c_selectreadbytes(state, TOP_CONTROL, buf, sizeof(buf)); | 430 | i2c_read_demod_bytes(state, TOP_CONTROL, buf, sizeof(buf)); |
358 | dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]); | 431 | dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]); |
359 | 432 | ||
360 | #if 0 | ||
361 | /* Alternative method to check for a signal */ | ||
362 | /* using the SNR good/bad interrupts. */ | ||
363 | if ((buf[2] & 0x30) == 0x10) | ||
364 | *status |= FE_HAS_SIGNAL; | ||
365 | #endif | ||
366 | 433 | ||
367 | /* sync status */ | 434 | /* sync status */ |
368 | if ((buf[2] & 0x03) == 0x01) { | 435 | if ((buf[2] & 0x03) == 0x01) { |
@@ -376,7 +443,7 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
376 | } | 443 | } |
377 | 444 | ||
378 | /* Carrier Recovery Lock Status Register */ | 445 | /* Carrier Recovery Lock Status Register */ |
379 | i2c_selectreadbytes(state, CARRIER_LOCK, buf, 1); | 446 | i2c_read_demod_bytes(state, CARRIER_LOCK, buf, 1); |
380 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); | 447 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); |
381 | switch (state->current_modulation) { | 448 | switch (state->current_modulation) { |
382 | case QAM_256: | 449 | case QAM_256: |
@@ -396,13 +463,75 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
396 | return 0; | 463 | return 0; |
397 | } | 464 | } |
398 | 465 | ||
466 | static int lgdt3303_read_status(struct dvb_frontend* fe, fe_status_t* status) | ||
467 | { | ||
468 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
469 | int err; | ||
470 | u8 buf[3]; | ||
471 | |||
472 | *status = 0; /* Reset status result */ | ||
473 | |||
474 | /* lgdt3303 AGC status register */ | ||
475 | err = i2c_read_demod_bytes(state, 0x58, buf, 1); | ||
476 | if (err < 0) | ||
477 | return err; | ||
478 | |||
479 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); | ||
480 | if ((buf[0] & 0x21) == 0x01){ | ||
481 | /* Test input signal does not exist flag */ | ||
482 | /* as well as the AGC lock flag. */ | ||
483 | *status |= FE_HAS_SIGNAL; | ||
484 | } else { | ||
485 | /* Without a signal all other status bits are meaningless */ | ||
486 | return 0; | ||
487 | } | ||
488 | |||
489 | /* Carrier Recovery Lock Status Register */ | ||
490 | i2c_read_demod_bytes(state, CARRIER_LOCK, buf, 1); | ||
491 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); | ||
492 | switch (state->current_modulation) { | ||
493 | case QAM_256: | ||
494 | case QAM_64: | ||
495 | /* Need to undestand why there are 3 lock levels here */ | ||
496 | if ((buf[0] & 0x07) == 0x07) | ||
497 | *status |= FE_HAS_CARRIER; | ||
498 | else | ||
499 | break; | ||
500 | i2c_read_demod_bytes(state, 0x8a, buf, 1); | ||
501 | if ((buf[0] & 0x04) == 0x04) | ||
502 | *status |= FE_HAS_SYNC; | ||
503 | if ((buf[0] & 0x01) == 0x01) | ||
504 | *status |= FE_HAS_LOCK; | ||
505 | if ((buf[0] & 0x08) == 0x08) | ||
506 | *status |= FE_HAS_VITERBI; | ||
507 | break; | ||
508 | case VSB_8: | ||
509 | if ((buf[0] & 0x80) == 0x80) | ||
510 | *status |= FE_HAS_CARRIER; | ||
511 | else | ||
512 | break; | ||
513 | i2c_read_demod_bytes(state, 0x38, buf, 1); | ||
514 | if ((buf[0] & 0x02) == 0x00) | ||
515 | *status |= FE_HAS_SYNC; | ||
516 | if ((buf[0] & 0x01) == 0x01) { | ||
517 | *status |= FE_HAS_LOCK; | ||
518 | *status |= FE_HAS_VITERBI; | ||
519 | } | ||
520 | break; | ||
521 | default: | ||
522 | printk("KERN_WARNING lgdt330x: %s: Modulation set to unsupported value\n", __FUNCTION__); | ||
523 | } | ||
524 | return 0; | ||
525 | } | ||
526 | |||
399 | static int lgdt330x_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 527 | static int lgdt330x_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
400 | { | 528 | { |
401 | /* not directly available. */ | 529 | /* not directly available. */ |
530 | *strength = 0; | ||
402 | return 0; | 531 | return 0; |
403 | } | 532 | } |
404 | 533 | ||
405 | static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | 534 | static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr) |
406 | { | 535 | { |
407 | #ifdef SNR_IN_DB | 536 | #ifdef SNR_IN_DB |
408 | /* | 537 | /* |
@@ -451,7 +580,7 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
451 | 91, 115, 144, 182, 229, 288, 362, 456, 574, 722, | 580 | 91, 115, 144, 182, 229, 288, 362, 456, 574, 722, |
452 | 909, 1144, 1440, 1813, 2282, 2873, 3617, 4553, 5732, 7216, | 581 | 909, 1144, 1440, 1813, 2282, 2873, 3617, 4553, 5732, 7216, |
453 | 9084, 11436, 14396, 18124, 22817, 28724, 36161, 45524, 57312, 72151, | 582 | 9084, 11436, 14396, 18124, 22817, 28724, 36161, 45524, 57312, 72151, |
454 | 90833, 114351, 143960, 181235, 228161, 0x040000 | 583 | 90833, 114351, 143960, 181235, 228161, 0x080000 |
455 | }; | 584 | }; |
456 | 585 | ||
457 | static u8 buf[5];/* read data buffer */ | 586 | static u8 buf[5];/* read data buffer */ |
@@ -459,8 +588,8 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
459 | static u32 snr_db; /* index into SNR_EQ[] */ | 588 | static u32 snr_db; /* index into SNR_EQ[] */ |
460 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 589 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; |
461 | 590 | ||
462 | /* read both equalizer and pase tracker noise data */ | 591 | /* read both equalizer and phase tracker noise data */ |
463 | i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); | 592 | i2c_read_demod_bytes(state, EQPH_ERR0, buf, sizeof(buf)); |
464 | 593 | ||
465 | if (state->current_modulation == VSB_8) { | 594 | if (state->current_modulation == VSB_8) { |
466 | /* Equalizer Mean-Square Error Register for VSB */ | 595 | /* Equalizer Mean-Square Error Register for VSB */ |
@@ -496,19 +625,20 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
496 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 625 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; |
497 | 626 | ||
498 | /* read both equalizer and pase tracker noise data */ | 627 | /* read both equalizer and pase tracker noise data */ |
499 | i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); | 628 | i2c_read_demod_bytes(state, EQPH_ERR0, buf, sizeof(buf)); |
500 | 629 | ||
501 | if (state->current_modulation == VSB_8) { | 630 | if (state->current_modulation == VSB_8) { |
502 | /* Equalizer Mean-Square Error Register for VSB */ | 631 | /* Phase Tracker Mean-Square Error Register for VSB */ |
503 | noise = ((buf[0] & 7) << 16) | (buf[1] << 8) | buf[2]; | ||
504 | } else { | ||
505 | /* Phase Tracker Mean-Square Error Register for QAM */ | ||
506 | noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4]; | 632 | noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4]; |
633 | } else { | ||
634 | |||
635 | /* Carrier Recovery Mean-Square Error for QAM */ | ||
636 | i2c_read_demod_bytes(state, 0x1a, buf, 2); | ||
637 | noise = ((buf[0] & 3) << 8) | buf[1]; | ||
507 | } | 638 | } |
508 | 639 | ||
509 | /* Small values for noise mean signal is better so invert noise */ | 640 | /* Small values for noise mean signal is better so invert noise */ |
510 | /* Noise is 19 bit value so discard 3 LSB*/ | 641 | *snr = ~noise; |
511 | *snr = ~noise>>3; | ||
512 | #endif | 642 | #endif |
513 | 643 | ||
514 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); | 644 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); |
@@ -516,6 +646,32 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
516 | return 0; | 646 | return 0; |
517 | } | 647 | } |
518 | 648 | ||
649 | static int lgdt3303_read_snr(struct dvb_frontend* fe, u16* snr) | ||
650 | { | ||
651 | /* Return the raw noise value */ | ||
652 | static u8 buf[5];/* read data buffer */ | ||
653 | static u32 noise; /* noise value */ | ||
654 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | ||
655 | |||
656 | if (state->current_modulation == VSB_8) { | ||
657 | |||
658 | /* Phase Tracker Mean-Square Error Register for VSB */ | ||
659 | noise = ((buf[0] & 7) << 16) | (buf[3] << 8) | buf[4]; | ||
660 | } else { | ||
661 | |||
662 | /* Carrier Recovery Mean-Square Error for QAM */ | ||
663 | i2c_read_demod_bytes(state, 0x1a, buf, 2); | ||
664 | noise = (buf[0] << 8) | buf[1]; | ||
665 | } | ||
666 | |||
667 | /* Small values for noise mean signal is better so invert noise */ | ||
668 | *snr = ~noise; | ||
669 | |||
670 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); | ||
671 | |||
672 | return 0; | ||
673 | } | ||
674 | |||
519 | static int lgdt330x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings) | 675 | static int lgdt330x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings) |
520 | { | 676 | { |
521 | /* I have no idea about this - it may not be needed */ | 677 | /* I have no idea about this - it may not be needed */ |
@@ -531,7 +687,8 @@ static void lgdt330x_release(struct dvb_frontend* fe) | |||
531 | kfree(state); | 687 | kfree(state); |
532 | } | 688 | } |
533 | 689 | ||
534 | static struct dvb_frontend_ops lgdt330x_ops; | 690 | static struct dvb_frontend_ops lgdt3302_ops; |
691 | static struct dvb_frontend_ops lgdt3303_ops; | ||
535 | 692 | ||
536 | struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | 693 | struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, |
537 | struct i2c_adapter* i2c) | 694 | struct i2c_adapter* i2c) |
@@ -548,9 +705,19 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | |||
548 | /* Setup the state */ | 705 | /* Setup the state */ |
549 | state->config = config; | 706 | state->config = config; |
550 | state->i2c = i2c; | 707 | state->i2c = i2c; |
551 | memcpy(&state->ops, &lgdt330x_ops, sizeof(struct dvb_frontend_ops)); | 708 | switch (config->demod_chip) { |
709 | case LGDT3302: | ||
710 | memcpy(&state->ops, &lgdt3302_ops, sizeof(struct dvb_frontend_ops)); | ||
711 | break; | ||
712 | case LGDT3303: | ||
713 | memcpy(&state->ops, &lgdt3303_ops, sizeof(struct dvb_frontend_ops)); | ||
714 | break; | ||
715 | default: | ||
716 | goto error; | ||
717 | } | ||
718 | |||
552 | /* Verify communication with demod chip */ | 719 | /* Verify communication with demod chip */ |
553 | if (i2c_selectreadbytes(state, 2, buf, 1)) | 720 | if (i2c_read_demod_bytes(state, 2, buf, 1)) |
554 | goto error; | 721 | goto error; |
555 | 722 | ||
556 | state->current_frequency = -1; | 723 | state->current_frequency = -1; |
@@ -568,9 +735,33 @@ error: | |||
568 | return NULL; | 735 | return NULL; |
569 | } | 736 | } |
570 | 737 | ||
571 | static struct dvb_frontend_ops lgdt330x_ops = { | 738 | static struct dvb_frontend_ops lgdt3302_ops = { |
739 | .info = { | ||
740 | .name= "LG Electronics LGDT3302 VSB/QAM Frontend", | ||
741 | .type = FE_ATSC, | ||
742 | .frequency_min= 54000000, | ||
743 | .frequency_max= 858000000, | ||
744 | .frequency_stepsize= 62500, | ||
745 | /* Symbol rate is for all VSB modes need to check QAM */ | ||
746 | .symbol_rate_min = 10762000, | ||
747 | .symbol_rate_max = 10762000, | ||
748 | .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB | ||
749 | }, | ||
750 | .init = lgdt330x_init, | ||
751 | .set_frontend = lgdt330x_set_parameters, | ||
752 | .get_frontend = lgdt330x_get_frontend, | ||
753 | .get_tune_settings = lgdt330x_get_tune_settings, | ||
754 | .read_status = lgdt3302_read_status, | ||
755 | .read_ber = lgdt330x_read_ber, | ||
756 | .read_signal_strength = lgdt330x_read_signal_strength, | ||
757 | .read_snr = lgdt3302_read_snr, | ||
758 | .read_ucblocks = lgdt330x_read_ucblocks, | ||
759 | .release = lgdt330x_release, | ||
760 | }; | ||
761 | |||
762 | static struct dvb_frontend_ops lgdt3303_ops = { | ||
572 | .info = { | 763 | .info = { |
573 | .name= "LG Electronics lgdt330x VSB/QAM Frontend", | 764 | .name= "LG Electronics LGDT3303 VSB/QAM Frontend", |
574 | .type = FE_ATSC, | 765 | .type = FE_ATSC, |
575 | .frequency_min= 54000000, | 766 | .frequency_min= 54000000, |
576 | .frequency_max= 858000000, | 767 | .frequency_max= 858000000, |
@@ -584,15 +775,15 @@ static struct dvb_frontend_ops lgdt330x_ops = { | |||
584 | .set_frontend = lgdt330x_set_parameters, | 775 | .set_frontend = lgdt330x_set_parameters, |
585 | .get_frontend = lgdt330x_get_frontend, | 776 | .get_frontend = lgdt330x_get_frontend, |
586 | .get_tune_settings = lgdt330x_get_tune_settings, | 777 | .get_tune_settings = lgdt330x_get_tune_settings, |
587 | .read_status = lgdt330x_read_status, | 778 | .read_status = lgdt3303_read_status, |
588 | .read_ber = lgdt330x_read_ber, | 779 | .read_ber = lgdt330x_read_ber, |
589 | .read_signal_strength = lgdt330x_read_signal_strength, | 780 | .read_signal_strength = lgdt330x_read_signal_strength, |
590 | .read_snr = lgdt330x_read_snr, | 781 | .read_snr = lgdt3303_read_snr, |
591 | .read_ucblocks = lgdt330x_read_ucblocks, | 782 | .read_ucblocks = lgdt330x_read_ucblocks, |
592 | .release = lgdt330x_release, | 783 | .release = lgdt330x_release, |
593 | }; | 784 | }; |
594 | 785 | ||
595 | MODULE_DESCRIPTION("lgdt330x [DViCO FusionHDTV 3 Gold] (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); | 786 | MODULE_DESCRIPTION("LGDT330X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); |
596 | MODULE_AUTHOR("Wilson Michaels"); | 787 | MODULE_AUTHOR("Wilson Michaels"); |
597 | MODULE_LICENSE("GPL"); | 788 | MODULE_LICENSE("GPL"); |
598 | 789 | ||
@@ -601,6 +792,5 @@ EXPORT_SYMBOL(lgdt330x_attach); | |||
601 | /* | 792 | /* |
602 | * Local variables: | 793 | * Local variables: |
603 | * c-basic-offset: 8 | 794 | * c-basic-offset: 8 |
604 | * compile-command: "make DVB=1" | ||
605 | * End: | 795 | * End: |
606 | */ | 796 | */ |
diff --git a/drivers/media/dvb/frontends/lgdt330x.h b/drivers/media/dvb/frontends/lgdt330x.h index 04986f8e7565..e209ba1e47c5 100644 --- a/drivers/media/dvb/frontends/lgdt330x.h +++ b/drivers/media/dvb/frontends/lgdt330x.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
@@ -24,14 +24,26 @@ | |||
24 | 24 | ||
25 | #include <linux/dvb/frontend.h> | 25 | #include <linux/dvb/frontend.h> |
26 | 26 | ||
27 | typedef enum lg_chip_t { | ||
28 | UNDEFINED, | ||
29 | LGDT3302, | ||
30 | LGDT3303 | ||
31 | }lg_chip_type; | ||
32 | |||
27 | struct lgdt330x_config | 33 | struct lgdt330x_config |
28 | { | 34 | { |
29 | /* The demodulator's i2c address */ | 35 | /* The demodulator's i2c address */ |
30 | u8 demod_address; | 36 | u8 demod_address; |
31 | 37 | ||
38 | /* LG demodulator chip LGDT3302 or LGDT3303 */ | ||
39 | lg_chip_type demod_chip; | ||
40 | |||
41 | /* MPEG hardware interface - 0:parallel 1:serial */ | ||
42 | int serial_mpeg; | ||
43 | |||
32 | /* PLL interface */ | 44 | /* PLL interface */ |
33 | int (*pll_rf_set) (struct dvb_frontend* fe, int index); | 45 | int (*pll_rf_set) (struct dvb_frontend* fe, int index); |
34 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pll_address); | 46 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); |
35 | 47 | ||
36 | /* Need to set device param for start_dma */ | 48 | /* Need to set device param for start_dma */ |
37 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); | 49 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); |
diff --git a/drivers/media/dvb/frontends/lgdt330x_priv.h b/drivers/media/dvb/frontends/lgdt330x_priv.h index 4143ce8f1a95..59b7c5b9012d 100644 --- a/drivers/media/dvb/frontends/lgdt330x_priv.h +++ b/drivers/media/dvb/frontends/lgdt330x_priv.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
@@ -57,8 +57,10 @@ enum I2C_REG { | |||
57 | PH_ERR1= 0x4a, | 57 | PH_ERR1= 0x4a, |
58 | PH_ERR2= 0x4b, | 58 | PH_ERR2= 0x4b, |
59 | DEMUX_CONTROL= 0x66, | 59 | DEMUX_CONTROL= 0x66, |
60 | PACKET_ERR_COUNTER1= 0x6a, | 60 | LGDT3302_PACKET_ERR_COUNTER1= 0x6a, |
61 | PACKET_ERR_COUNTER2= 0x6b, | 61 | LGDT3302_PACKET_ERR_COUNTER2= 0x6b, |
62 | LGDT3303_PACKET_ERR_COUNTER1= 0x8b, | ||
63 | LGDT3303_PACKET_ERR_COUNTER2= 0x8c, | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | #endif /* _LGDT330X_PRIV_ */ | 66 | #endif /* _LGDT330X_PRIV_ */ |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ac81e5e01a9a..3f5742396096 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -356,7 +356,7 @@ config VIDEO_M32R_AR | |||
356 | 356 | ||
357 | config VIDEO_M32R_AR_M64278 | 357 | config VIDEO_M32R_AR_M64278 |
358 | tristate "Use Colour AR module M64278(VGA)" | 358 | tristate "Use Colour AR module M64278(VGA)" |
359 | depends on VIDEO_M32R_AR | 359 | depends on VIDEO_M32R_AR && PLAT_M32700UT |
360 | ---help--- | 360 | ---help--- |
361 | Say Y here to use the Renesas M64278E-800 camera module, | 361 | Say Y here to use the Renesas M64278E-800 camera module, |
362 | which supports VGA(640x480 pixcels) size of images. | 362 | which supports VGA(640x480 pixcels) size of images. |
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c index 6c52fd0bb7df..a97b9b958ed6 100644 --- a/drivers/media/video/bttv-cards.c +++ b/drivers/media/video/bttv-cards.c | |||
@@ -95,7 +95,7 @@ static int __devinit pvr_boot(struct bttv *btv); | |||
95 | static unsigned int triton1=0; | 95 | static unsigned int triton1=0; |
96 | static unsigned int vsfx=0; | 96 | static unsigned int vsfx=0; |
97 | static unsigned int latency = UNSET; | 97 | static unsigned int latency = UNSET; |
98 | static unsigned int no_overlay=-1; | 98 | int no_overlay=-1; |
99 | 99 | ||
100 | static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; | 100 | static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; |
101 | static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; | 101 | static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; |
@@ -4296,9 +4296,11 @@ void __devinit bttv_check_chipset(void) | |||
4296 | printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n"); | 4296 | printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n"); |
4297 | if (pcipci_fail) { | 4297 | if (pcipci_fail) { |
4298 | printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n"); | 4298 | printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n"); |
4299 | if (UNSET == no_overlay) { | 4299 | if (!no_overlay) { |
4300 | printk(KERN_WARNING "bttv: going to disable overlay.\n"); | 4300 | printk(KERN_WARNING "bttv: overlay will be disabled.\n"); |
4301 | no_overlay = 1; | 4301 | no_overlay = 1; |
4302 | } else { | ||
4303 | printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n"); | ||
4302 | } | 4304 | } |
4303 | } | 4305 | } |
4304 | if (UNSET != latency) | 4306 | if (UNSET != latency) |
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c index 51a0f6d68e73..eee9322ce21b 100644 --- a/drivers/media/video/bttv-driver.c +++ b/drivers/media/video/bttv-driver.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | $Id: bttv-driver.c,v 1.42 2005/07/05 17:37:35 nsh Exp $ | 2 | $Id: bttv-driver.c,v 1.52 2005/08/04 00:55:16 mchehab Exp $ |
3 | 3 | ||
4 | bttv - Bt848 frame grabber driver | 4 | bttv - Bt848 frame grabber driver |
5 | 5 | ||
@@ -80,6 +80,7 @@ static unsigned int irq_iswitch = 0; | |||
80 | static unsigned int uv_ratio = 50; | 80 | static unsigned int uv_ratio = 50; |
81 | static unsigned int full_luma_range = 0; | 81 | static unsigned int full_luma_range = 0; |
82 | static unsigned int coring = 0; | 82 | static unsigned int coring = 0; |
83 | extern int no_overlay; | ||
83 | 84 | ||
84 | /* API features (turn on/off stuff for testing) */ | 85 | /* API features (turn on/off stuff for testing) */ |
85 | static unsigned int v4l2 = 1; | 86 | static unsigned int v4l2 = 1; |
@@ -2151,6 +2152,10 @@ static int bttv_s_fmt(struct bttv_fh *fh, struct bttv *btv, | |||
2151 | return 0; | 2152 | return 0; |
2152 | } | 2153 | } |
2153 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: | 2154 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: |
2155 | if (no_overlay > 0) { | ||
2156 | printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n"); | ||
2157 | return -EINVAL; | ||
2158 | } | ||
2154 | return setup_window(fh, btv, &f->fmt.win, 1); | 2159 | return setup_window(fh, btv, &f->fmt.win, 1); |
2155 | case V4L2_BUF_TYPE_VBI_CAPTURE: | 2160 | case V4L2_BUF_TYPE_VBI_CAPTURE: |
2156 | retval = bttv_switch_type(fh,f->type); | 2161 | retval = bttv_switch_type(fh,f->type); |
@@ -2224,9 +2229,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2224 | /* others */ | 2229 | /* others */ |
2225 | cap->type = VID_TYPE_CAPTURE| | 2230 | cap->type = VID_TYPE_CAPTURE| |
2226 | VID_TYPE_TUNER| | 2231 | VID_TYPE_TUNER| |
2227 | VID_TYPE_OVERLAY| | ||
2228 | VID_TYPE_CLIPPING| | 2232 | VID_TYPE_CLIPPING| |
2229 | VID_TYPE_SCALES; | 2233 | VID_TYPE_SCALES; |
2234 | if (no_overlay <= 0) | ||
2235 | cap->type |= VID_TYPE_OVERLAY; | ||
2236 | |||
2230 | cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth; | 2237 | cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth; |
2231 | cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight; | 2238 | cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight; |
2232 | cap->minwidth = 48; | 2239 | cap->minwidth = 48; |
@@ -2302,6 +2309,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2302 | struct video_window *win = arg; | 2309 | struct video_window *win = arg; |
2303 | struct v4l2_window w2; | 2310 | struct v4l2_window w2; |
2304 | 2311 | ||
2312 | if (no_overlay > 0) { | ||
2313 | printk ("VIDIOCSWIN: no_overlay\n"); | ||
2314 | return -EINVAL; | ||
2315 | } | ||
2316 | |||
2305 | w2.field = V4L2_FIELD_ANY; | 2317 | w2.field = V4L2_FIELD_ANY; |
2306 | w2.w.left = win->x; | 2318 | w2.w.left = win->x; |
2307 | w2.w.top = win->y; | 2319 | w2.w.top = win->y; |
@@ -2577,10 +2589,12 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, | |||
2577 | cap->version = BTTV_VERSION_CODE; | 2589 | cap->version = BTTV_VERSION_CODE; |
2578 | cap->capabilities = | 2590 | cap->capabilities = |
2579 | V4L2_CAP_VIDEO_CAPTURE | | 2591 | V4L2_CAP_VIDEO_CAPTURE | |
2580 | V4L2_CAP_VIDEO_OVERLAY | | ||
2581 | V4L2_CAP_VBI_CAPTURE | | 2592 | V4L2_CAP_VBI_CAPTURE | |
2582 | V4L2_CAP_READWRITE | | 2593 | V4L2_CAP_READWRITE | |
2583 | V4L2_CAP_STREAMING; | 2594 | V4L2_CAP_STREAMING; |
2595 | if (no_overlay <= 0) | ||
2596 | cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY; | ||
2597 | |||
2584 | if (bttv_tvcards[btv->c.type].tuner != UNSET && | 2598 | if (bttv_tvcards[btv->c.type].tuner != UNSET && |
2585 | bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) | 2599 | bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) |
2586 | cap->capabilities |= V4L2_CAP_TUNER; | 2600 | cap->capabilities |= V4L2_CAP_TUNER; |
@@ -3076,7 +3090,7 @@ static struct file_operations bttv_fops = | |||
3076 | static struct video_device bttv_video_template = | 3090 | static struct video_device bttv_video_template = |
3077 | { | 3091 | { |
3078 | .name = "UNSET", | 3092 | .name = "UNSET", |
3079 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY| | 3093 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER| |
3080 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, | 3094 | VID_TYPE_CLIPPING|VID_TYPE_SCALES, |
3081 | .hardware = VID_HARDWARE_BT848, | 3095 | .hardware = VID_HARDWARE_BT848, |
3082 | .fops = &bttv_fops, | 3096 | .fops = &bttv_fops, |
@@ -3756,6 +3770,12 @@ static void bttv_unregister_video(struct bttv *btv) | |||
3756 | /* register video4linux devices */ | 3770 | /* register video4linux devices */ |
3757 | static int __devinit bttv_register_video(struct bttv *btv) | 3771 | static int __devinit bttv_register_video(struct bttv *btv) |
3758 | { | 3772 | { |
3773 | if (no_overlay <= 0) { | ||
3774 | bttv_video_template.type |= VID_TYPE_OVERLAY; | ||
3775 | } else { | ||
3776 | printk("bttv: Overlay support disabled.\n"); | ||
3777 | } | ||
3778 | |||
3759 | /* video */ | 3779 | /* video */ |
3760 | btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); | 3780 | btv->video_dev = vdev_init(btv, &bttv_video_template, "video"); |
3761 | if (NULL == btv->video_dev) | 3781 | if (NULL == btv->video_dev) |
@@ -3869,11 +3889,6 @@ static int __devinit bttv_probe(struct pci_dev *dev, | |||
3869 | pci_set_master(dev); | 3889 | pci_set_master(dev); |
3870 | pci_set_command(dev); | 3890 | pci_set_command(dev); |
3871 | pci_set_drvdata(dev,btv); | 3891 | pci_set_drvdata(dev,btv); |
3872 | if (!pci_dma_supported(dev,0xffffffff)) { | ||
3873 | printk("bttv%d: Oops: no 32bit PCI DMA ???\n", btv->c.nr); | ||
3874 | result = -EIO; | ||
3875 | goto fail1; | ||
3876 | } | ||
3877 | 3892 | ||
3878 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); | 3893 | pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision); |
3879 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); | 3894 | pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat); |
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h index 191eaf1714ba..f2af9e1454f0 100644 --- a/drivers/media/video/bttv.h +++ b/drivers/media/video/bttv.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: bttv.h,v 1.18 2005/05/24 23:41:42 nsh Exp $ | 2 | * $Id: bttv.h,v 1.22 2005/07/28 18:41:21 mchehab Exp $ |
3 | * | 3 | * |
4 | * bttv - Bt848 frame grabber driver | 4 | * bttv - Bt848 frame grabber driver |
5 | * | 5 | * |
@@ -135,7 +135,9 @@ | |||
135 | #define BTTV_DVICO_DVBT_LITE 0x80 | 135 | #define BTTV_DVICO_DVBT_LITE 0x80 |
136 | #define BTTV_TIBET_CS16 0x83 | 136 | #define BTTV_TIBET_CS16 0x83 |
137 | #define BTTV_KODICOM_4400R 0x84 | 137 | #define BTTV_KODICOM_4400R 0x84 |
138 | #define BTTV_ADLINK_RTV24 0x85 | 138 | #define BTTV_ADLINK_RTV24 0x86 |
139 | #define BTTV_DVICO_FUSIONHDTV_5_LITE 0x87 | ||
140 | #define BTTV_ACORP_Y878F 0x88 | ||
139 | 141 | ||
140 | /* i2c address list */ | 142 | /* i2c address list */ |
141 | #define I2C_TSA5522 0xc2 | 143 | #define I2C_TSA5522 0xc2 |
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h index f3293e4a15ad..aab094bc243d 100644 --- a/drivers/media/video/bttvp.h +++ b/drivers/media/video/bttvp.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | $Id: bttvp.h,v 1.19 2005/06/16 21:38:45 nsh Exp $ | 2 | $Id: bttvp.h,v 1.21 2005/07/15 21:44:14 mchehab Exp $ |
3 | 3 | ||
4 | bttv - Bt848 frame grabber driver | 4 | bttv - Bt848 frame grabber driver |
5 | 5 | ||
@@ -27,7 +27,7 @@ | |||
27 | #define _BTTVP_H_ | 27 | #define _BTTVP_H_ |
28 | 28 | ||
29 | #include <linux/version.h> | 29 | #include <linux/version.h> |
30 | #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,15) | 30 | #define BTTV_VERSION_CODE KERNEL_VERSION(0,9,16) |
31 | 31 | ||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <linux/wait.h> | 33 | #include <linux/wait.h> |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 3d0c784b376f..ebf02a7f81e8 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-cards.c,v 1.86 2005/07/14 03:06:43 mchehab Exp $ | 2 | * $Id: cx88-cards.c,v 1.90 2005/07/28 02:47:42 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * card-specific stuff. | 5 | * card-specific stuff. |
@@ -90,6 +90,9 @@ struct cx88_board cx88_boards[] = { | |||
90 | .input = {{ | 90 | .input = {{ |
91 | .type = CX88_VMUX_TELEVISION, | 91 | .type = CX88_VMUX_TELEVISION, |
92 | .vmux = 0, | 92 | .vmux = 0, |
93 | },{ | ||
94 | .type = CX88_VMUX_SVIDEO, | ||
95 | .vmux = 2, | ||
93 | }}, | 96 | }}, |
94 | }, | 97 | }, |
95 | [CX88_BOARD_PIXELVIEW] = { | 98 | [CX88_BOARD_PIXELVIEW] = { |
@@ -496,6 +499,9 @@ struct cx88_board cx88_boards[] = { | |||
496 | .input = {{ | 499 | .input = {{ |
497 | .type = CX88_VMUX_DVB, | 500 | .type = CX88_VMUX_DVB, |
498 | .vmux = 0, | 501 | .vmux = 0, |
502 | },{ | ||
503 | .type = CX88_VMUX_SVIDEO, | ||
504 | .vmux = 2, | ||
499 | }}, | 505 | }}, |
500 | .dvb = 1, | 506 | .dvb = 1, |
501 | }, | 507 | }, |
@@ -753,6 +759,27 @@ struct cx88_board cx88_boards[] = { | |||
753 | }}, | 759 | }}, |
754 | .dvb = 1, | 760 | .dvb = 1, |
755 | }, | 761 | }, |
762 | [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = { | ||
763 | .name = "DViCO FusionHDTV 5 Gold", | ||
764 | .tuner_type = TUNER_LG_TDVS_H062F, | ||
765 | .radio_type = UNSET, | ||
766 | .tuner_addr = ADDR_UNSET, | ||
767 | .radio_addr = ADDR_UNSET, | ||
768 | /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */ | ||
769 | .input = {{ | ||
770 | .type = CX88_VMUX_TELEVISION, | ||
771 | .vmux = 0, | ||
772 | .gpio0 = 0x0f0d, | ||
773 | },{ | ||
774 | .type = CX88_VMUX_COMPOSITE1, | ||
775 | .vmux = 1, | ||
776 | .gpio0 = 0x0f00, | ||
777 | },{ | ||
778 | .type = CX88_VMUX_SVIDEO, | ||
779 | .vmux = 2, | ||
780 | .gpio0 = 0x0f00, | ||
781 | }}, | ||
782 | }, | ||
756 | }; | 783 | }; |
757 | const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); | 784 | const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); |
758 | 785 | ||
@@ -880,6 +907,10 @@ struct cx88_subid cx88_subids[] = { | |||
880 | .subvendor = 0x153b, | 907 | .subvendor = 0x153b, |
881 | .subdevice = 0x1166, | 908 | .subdevice = 0x1166, |
882 | .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, | 909 | .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, |
910 | },{ | ||
911 | .subvendor = 0x18ac, | ||
912 | .subdevice = 0xd500, | ||
913 | .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD, | ||
883 | }, | 914 | }, |
884 | }; | 915 | }; |
885 | const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); | 916 | const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index ef0e9a85c359..78d223257a68 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-dvb.c,v 1.54 2005/07/25 05:13:50 mkrufky Exp $ | 2 | * $Id: cx88-dvb.c,v 1.58 2005/08/07 09:24:08 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * MPEG Transport Stream (DVB) routines | 5 | * MPEG Transport Stream (DVB) routines |
@@ -208,14 +208,26 @@ static struct or51132_config pchdtv_hd3000 = { | |||
208 | 208 | ||
209 | #ifdef HAVE_LGDT330X | 209 | #ifdef HAVE_LGDT330X |
210 | static int lgdt330x_pll_set(struct dvb_frontend* fe, | 210 | static int lgdt330x_pll_set(struct dvb_frontend* fe, |
211 | struct dvb_frontend_parameters* params, | 211 | struct dvb_frontend_parameters* params) |
212 | u8* pllbuf) | ||
213 | { | 212 | { |
214 | struct cx8802_dev *dev= fe->dvb->priv; | 213 | struct cx8802_dev *dev= fe->dvb->priv; |
214 | u8 buf[4]; | ||
215 | struct i2c_msg msg = | ||
216 | { .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 }; | ||
217 | int err; | ||
215 | 218 | ||
216 | pllbuf[0] = dev->core->pll_addr; | 219 | dvb_pll_configure(dev->core->pll_desc, buf, params->frequency, 0); |
217 | dvb_pll_configure(dev->core->pll_desc, &pllbuf[1], | 220 | dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", |
218 | params->frequency, 0); | 221 | __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); |
222 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { | ||
223 | printk(KERN_WARNING "cx88-dvb: %s error " | ||
224 | "(addr %02x <- %02x, err = %i)\n", | ||
225 | __FUNCTION__, buf[0], buf[1], err); | ||
226 | if (err < 0) | ||
227 | return err; | ||
228 | else | ||
229 | return -EREMOTEIO; | ||
230 | } | ||
219 | return 0; | 231 | return 0; |
220 | } | 232 | } |
221 | 233 | ||
@@ -244,6 +256,8 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) | |||
244 | 256 | ||
245 | static struct lgdt330x_config fusionhdtv_3_gold = { | 257 | static struct lgdt330x_config fusionhdtv_3_gold = { |
246 | .demod_address = 0x0e, | 258 | .demod_address = 0x0e, |
259 | .demod_chip = LGDT3302, | ||
260 | .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ | ||
247 | .pll_set = lgdt330x_pll_set, | 261 | .pll_set = lgdt330x_pll_set, |
248 | .set_ts_params = lgdt330x_set_ts_param, | 262 | .set_ts_params = lgdt330x_set_ts_param, |
249 | }; | 263 | }; |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 5588a3aeecb4..5f58c103198a 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-video.c,v 1.80 2005/07/13 08:49:08 mchehab Exp $ | 2 | * $Id: cx88-video.c,v 1.82 2005/07/22 05:13:34 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * video4linux video interface | 5 | * video4linux video interface |
@@ -758,10 +758,10 @@ static int video_open(struct inode *inode, struct file *file) | |||
758 | struct cx88_core *core = dev->core; | 758 | struct cx88_core *core = dev->core; |
759 | int board = core->board; | 759 | int board = core->board; |
760 | dprintk(1,"video_open: setting radio device\n"); | 760 | dprintk(1,"video_open: setting radio device\n"); |
761 | cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); | ||
761 | cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); | 762 | cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); |
762 | cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); | 763 | cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); |
763 | cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); | 764 | cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); |
764 | cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3); | ||
765 | dev->core->tvaudio = WW_FM; | 765 | dev->core->tvaudio = WW_FM; |
766 | cx88_set_tvaudio(core); | 766 | cx88_set_tvaudio(core); |
767 | cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); | 767 | cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index b008f7db6dfd..da65dc92787c 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88.h,v 1.69 2005/07/13 17:25:25 mchehab Exp $ | 2 | * $Id: cx88.h,v 1.70 2005/07/24 17:44:09 mkrufky Exp $ |
3 | * | 3 | * |
4 | * v4l2 device driver for cx2388x based TV cards | 4 | * v4l2 device driver for cx2388x based TV cards |
5 | * | 5 | * |
@@ -171,6 +171,7 @@ extern struct sram_channel cx88_sram_channels[]; | |||
171 | #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 | 171 | #define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 |
172 | #define CX88_BOARD_ADSTECH_DVB_T_PCI 29 | 172 | #define CX88_BOARD_ADSTECH_DVB_T_PCI 29 |
173 | #define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30 | 173 | #define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30 |
174 | #define CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD 31 | ||
174 | 175 | ||
175 | enum cx88_itype { | 176 | enum cx88_itype { |
176 | CX88_VMUX_COMPOSITE1 = 1, | 177 | CX88_VMUX_COMPOSITE1 = 1, |
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 6239254db27e..62f1b8ddb98b 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -741,11 +741,9 @@ static int msp34xx_sleep(struct msp3400c *msp, int timeout) | |||
741 | schedule_timeout(msecs_to_jiffies(timeout)); | 741 | schedule_timeout(msecs_to_jiffies(timeout)); |
742 | } | 742 | } |
743 | } | 743 | } |
744 | if (current->flags & PF_FREEZE) { | ||
745 | refrigerator (); | ||
746 | } | ||
747 | 744 | ||
748 | remove_wait_queue(&msp->wq, &wait); | 745 | remove_wait_queue(&msp->wq, &wait); |
746 | try_to_freeze(); | ||
749 | return msp->restart; | 747 | return msp->restart; |
750 | } | 748 | } |
751 | 749 | ||
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index 93dd61978541..1203b93a572c 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: saa7134-i2c.c,v 1.19 2005/07/07 01:49:30 mkrufky Exp $ | 2 | * $Id: saa7134-i2c.c,v 1.22 2005/07/22 04:09:41 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for philips saa7134 based TV cards | 4 | * device driver for philips saa7134 based TV cards |
5 | * i2c interface support | 5 | * i2c interface support |
@@ -300,6 +300,8 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
300 | status = i2c_get_status(dev); | 300 | status = i2c_get_status(dev); |
301 | if (i2c_is_error(status)) | 301 | if (i2c_is_error(status)) |
302 | goto err; | 302 | goto err; |
303 | /* ensure that the bus is idle for at least one bit slot */ | ||
304 | msleep(1); | ||
303 | 305 | ||
304 | d1printk("\n"); | 306 | d1printk("\n"); |
305 | return num; | 307 | return num; |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 6836c07794fc..2af0cb2a731b 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: saa7134.h,v 1.48 2005/07/01 08:22:24 nsh Exp $ | 2 | * $Id: saa7134.h,v 1.49 2005/07/13 17:25:25 mchehab Exp $ |
3 | * | 3 | * |
4 | * v4l2 device driver for philips saa7134 based TV cards | 4 | * v4l2 device driver for philips saa7134 based TV cards |
5 | * | 5 | * |
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/version.h> | 23 | #include <linux/version.h> |
24 | #define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,13) | 24 | #define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,14) |
25 | 25 | ||
26 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index 4d27ac1b7fb8..cebcc1fa68d1 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
3 | * I2C address is allways 0xC0. | 3 | * I2C address is allways 0xC0. |
4 | * | 4 | * |
5 | * $Id: tea5767.c,v 1.21 2005/07/14 03:06:43 mchehab Exp $ | 5 | * $Id: tea5767.c,v 1.27 2005/07/31 12:10:56 mchehab Exp $ |
6 | * | 6 | * |
7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) | 7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) |
8 | * This code is placed under the terms of the GNU General Public License | 8 | * This code is placed under the terms of the GNU General Public License |
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/videodev.h> | 15 | #include <linux/videodev.h> |
16 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
17 | #include <media/tuner.h> | 17 | #include <media/tuner.h> |
18 | #include <media/tuner.h> | ||
19 | 18 | ||
20 | #define PREFIX "TEA5767 " | 19 | #define PREFIX "TEA5767 " |
21 | 20 | ||
@@ -293,16 +292,16 @@ static int tea5767_stereo(struct i2c_client *c) | |||
293 | 292 | ||
294 | int tea5767_autodetection(struct i2c_client *c) | 293 | int tea5767_autodetection(struct i2c_client *c) |
295 | { | 294 | { |
296 | unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; | 295 | unsigned char buffer[7] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
297 | int rc; | 296 | int rc; |
298 | struct tuner *t = i2c_get_clientdata(c); | 297 | struct tuner *t = i2c_get_clientdata(c); |
299 | 298 | ||
300 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { | 299 | if (7 != (rc = i2c_master_recv(c, buffer, 7))) { |
301 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); | 300 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); |
302 | return EINVAL; | 301 | return EINVAL; |
303 | } | 302 | } |
304 | 303 | ||
305 | /* If all bytes are the same then it's a TV tuner and not a tea5767 chip. */ | 304 | /* If all bytes are the same then it's a TV tuner and not a tea5767 */ |
306 | if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && | 305 | if (buffer[0] == buffer[1] && buffer[0] == buffer[2] && |
307 | buffer[0] == buffer[3] && buffer[0] == buffer[4]) { | 306 | buffer[0] == buffer[3] && buffer[0] == buffer[4]) { |
308 | tuner_warn("All bytes are equal. It is not a TEA5767\n"); | 307 | tuner_warn("All bytes are equal. It is not a TEA5767\n"); |
@@ -318,6 +317,17 @@ int tea5767_autodetection(struct i2c_client *c) | |||
318 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); | 317 | tuner_warn("Chip ID is not zero. It is not a TEA5767\n"); |
319 | return EINVAL; | 318 | return EINVAL; |
320 | } | 319 | } |
320 | /* It seems that tea5767 returns 0xff after the 5th byte */ | ||
321 | if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { | ||
322 | tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); | ||
323 | return EINVAL; | ||
324 | } | ||
325 | |||
326 | /* It seems that tea5767 returns 0xff after the 5th byte */ | ||
327 | if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { | ||
328 | tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); | ||
329 | return EINVAL; | ||
330 | } | ||
321 | 331 | ||
322 | tuner_warn("TEA5767 detected.\n"); | 332 | tuner_warn("TEA5767 detected.\n"); |
323 | return 0; | 333 | return 0; |
@@ -327,10 +337,8 @@ int tea5767_tuner_init(struct i2c_client *c) | |||
327 | { | 337 | { |
328 | struct tuner *t = i2c_get_clientdata(c); | 338 | struct tuner *t = i2c_get_clientdata(c); |
329 | 339 | ||
330 | if (tea5767_autodetection(c) == EINVAL) | 340 | tuner_info("type set to %d (%s)\n", t->type, |
331 | return EINVAL; | 341 | "Philips TEA5767HN FM Radio"); |
332 | |||
333 | tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); | ||
334 | strlcpy(c->name, "tea5767", sizeof(c->name)); | 342 | strlcpy(c->name, "tea5767", sizeof(c->name)); |
335 | 343 | ||
336 | t->tv_freq = set_tv_freq; | 344 | t->tv_freq = set_tv_freq; |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index b25a9c08ac02..f0a579827a24 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: tuner-core.c,v 1.58 2005/07/14 03:06:43 mchehab Exp $ | 2 | * $Id: tuner-core.c,v 1.63 2005/07/28 18:19:55 mchehab Exp $ |
3 | * | 3 | * |
4 | * i2c tv tuner chip device driver | 4 | * i2c tv tuner chip device driver |
5 | * core core, i.e. kernel interfaces, registering and so on | 5 | * core core, i.e. kernel interfaces, registering and so on |
@@ -23,6 +23,8 @@ | |||
23 | #include <media/tuner.h> | 23 | #include <media/tuner.h> |
24 | #include <media/audiochip.h> | 24 | #include <media/audiochip.h> |
25 | 25 | ||
26 | #include "msp3400.h" | ||
27 | |||
26 | #define UNSET (-1U) | 28 | #define UNSET (-1U) |
27 | 29 | ||
28 | /* standard i2c insmod options */ | 30 | /* standard i2c insmod options */ |
@@ -42,6 +44,9 @@ module_param(addr, int, 0444); | |||
42 | static unsigned int no_autodetect = 0; | 44 | static unsigned int no_autodetect = 0; |
43 | module_param(no_autodetect, int, 0444); | 45 | module_param(no_autodetect, int, 0444); |
44 | 46 | ||
47 | static unsigned int show_i2c = 0; | ||
48 | module_param(show_i2c, int, 0444); | ||
49 | |||
45 | /* insmod options used at runtime => read/write */ | 50 | /* insmod options used at runtime => read/write */ |
46 | unsigned int tuner_debug = 0; | 51 | unsigned int tuner_debug = 0; |
47 | module_param(tuner_debug, int, 0644); | 52 | module_param(tuner_debug, int, 0644); |
@@ -320,6 +325,17 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
320 | 325 | ||
321 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); | 326 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); |
322 | 327 | ||
328 | if (show_i2c) { | ||
329 | unsigned char buffer[16]; | ||
330 | int i,rc; | ||
331 | |||
332 | memset(buffer, 0, sizeof(buffer)); | ||
333 | rc = i2c_master_recv(&t->i2c, buffer, sizeof(buffer)); | ||
334 | printk("tuner-%04x I2C RECV = ",addr); | ||
335 | for (i=0;i<rc;i++) | ||
336 | printk("%02x ",buffer[i]); | ||
337 | printk("\n"); | ||
338 | } | ||
323 | /* TEA5767 autodetection code - only for addr = 0xc0 */ | 339 | /* TEA5767 autodetection code - only for addr = 0xc0 */ |
324 | if (!no_autodetect) { | 340 | if (!no_autodetect) { |
325 | if (addr == 0x60) { | 341 | if (addr == 0x60) { |
@@ -451,6 +467,17 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
451 | break; | 467 | break; |
452 | } | 468 | } |
453 | break; | 469 | break; |
470 | case VIDIOCSAUDIO: | ||
471 | if (check_mode(t, "VIDIOCSAUDIO") == EINVAL) | ||
472 | return 0; | ||
473 | if (check_v4l2(t) == EINVAL) | ||
474 | return 0; | ||
475 | |||
476 | /* Should be implemented, since bttv calls it */ | ||
477 | tuner_dbg("VIDIOCSAUDIO not implemented.\n"); | ||
478 | |||
479 | break; | ||
480 | case MSP_SET_MATRIX: | ||
454 | case TDA9887_SET_CONFIG: | 481 | case TDA9887_SET_CONFIG: |
455 | break; | 482 | break; |
456 | /* --- v4l ioctls --- */ | 483 | /* --- v4l ioctls --- */ |
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index a3f8e83f5314..de0c93aeb75d 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: tuner-simple.c,v 1.39 2005/07/07 01:49:30 mkrufky Exp $ | 2 | * $Id: tuner-simple.c,v 1.43 2005/07/28 18:41:21 mchehab Exp $ |
3 | * | 3 | * |
4 | * i2c tv tuner chip device driver | 4 | * i2c tv tuner chip device driver |
5 | * controls all those simple 4-control-bytes style tuners. | 5 | * controls all those simple 4-control-bytes style tuners. |
@@ -245,6 +245,12 @@ static struct tunertype tuners[] = { | |||
245 | /* see tea5767.c for details */}, | 245 | /* see tea5767.c for details */}, |
246 | { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, | 246 | { "Philips FMD1216ME MK3 Hybrid Tuner", Philips, PAL, |
247 | 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, | 247 | 16*160.00,16*442.00,0x51,0x52,0x54,0x86,623 }, |
248 | |||
249 | { "LG TDVS-H062F/TUA6034", LGINNOTEK, NTSC, | ||
250 | 16*160.00,16*455.00,0x01,0x02,0x04,0x8e,732}, | ||
251 | |||
252 | { "Ymec TVF66T5-B/DFF", Philips, PAL, | ||
253 | 16*160.25,16*464.25,0x01,0x02,0x08,0x8e,623}, | ||
248 | }; | 254 | }; |
249 | 255 | ||
250 | unsigned const int tuner_count = ARRAY_SIZE(tuners); | 256 | unsigned const int tuner_count = ARRAY_SIZE(tuners); |
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 62b03ef091e0..127ec38ebd60 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -189,7 +189,7 @@ hauppauge_tuner[] = | |||
189 | { TUNER_ABSENT, "Philips FQ1236 MK3"}, | 189 | { TUNER_ABSENT, "Philips FQ1236 MK3"}, |
190 | { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, | 190 | { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, |
191 | { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, | 191 | { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, |
192 | { TUNER_ABSENT, "TCL MFPE05 2"}, | 192 | { TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"}, |
193 | /* 90-99 */ | 193 | /* 90-99 */ |
194 | { TUNER_ABSENT, "LG TALN H202T"}, | 194 | { TUNER_ABSENT, "LG TALN H202T"}, |
195 | { TUNER_PHILIPS_FQ1216AME_MK4, "Philips FQ1216AME MK4"}, | 195 | { TUNER_PHILIPS_FQ1216AME_MK4, "Philips FQ1216AME MK4"}, |
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 06e8eb19a05c..43a942a29c2e 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
@@ -53,6 +53,9 @@ config I2O_CONFIG | |||
53 | To compile this support as a module, choose M here: the | 53 | To compile this support as a module, choose M here: the |
54 | module will be called i2o_config. | 54 | module will be called i2o_config. |
55 | 55 | ||
56 | Note: If you want to use the new API you have to download the | ||
57 | i2o_config patch from http://i2o.shadowconnect.com/ | ||
58 | |||
56 | config I2O_CONFIG_OLD_IOCTL | 59 | config I2O_CONFIG_OLD_IOCTL |
57 | bool "Enable ioctls (OBSOLETE)" | 60 | bool "Enable ioctls (OBSOLETE)" |
58 | depends on I2O_CONFIG | 61 | depends on I2O_CONFIG |
diff --git a/drivers/message/i2o/config-osm.c b/drivers/message/i2o/config-osm.c index fe2e7afc9eae..af32ab4e90cd 100644 --- a/drivers/message/i2o/config-osm.c +++ b/drivers/message/i2o/config-osm.c | |||
@@ -30,503 +30,9 @@ | |||
30 | 30 | ||
31 | static struct i2o_driver i2o_config_driver; | 31 | static struct i2o_driver i2o_config_driver; |
32 | 32 | ||
33 | /* Special file operations for sysfs */ | ||
34 | struct fops_attribute { | ||
35 | struct bin_attribute bin; | ||
36 | struct file_operations fops; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * sysfs_read_dummy | ||
41 | */ | ||
42 | static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
43 | size_t count) | ||
44 | { | ||
45 | return 0; | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * sysfs_write_dummy | ||
50 | */ | ||
51 | static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
52 | size_t count) | ||
53 | { | ||
54 | return 0; | ||
55 | }; | ||
56 | |||
57 | /** | ||
58 | * sysfs_create_fops_file - Creates attribute with special file operations | ||
59 | * @kobj: kobject which should contains the attribute | ||
60 | * @attr: attributes which should be used to create file | ||
61 | * | ||
62 | * First creates attribute @attr in kobject @kobj. If it is the first time | ||
63 | * this function is called, merge old fops from sysfs with new one and | ||
64 | * write it back. Afterwords the new fops will be set for the created | ||
65 | * attribute. | ||
66 | * | ||
67 | * Returns 0 on success or negative error code on failure. | ||
68 | */ | ||
69 | static int sysfs_create_fops_file(struct kobject *kobj, | ||
70 | struct fops_attribute *attr) | ||
71 | { | ||
72 | struct file_operations tmp, *fops; | ||
73 | struct dentry *d; | ||
74 | struct qstr qstr; | ||
75 | int rc; | ||
76 | |||
77 | fops = &attr->fops; | ||
78 | |||
79 | if (fops->read) | ||
80 | attr->bin.read = sysfs_read_dummy; | ||
81 | |||
82 | if (fops->write) | ||
83 | attr->bin.write = sysfs_write_dummy; | ||
84 | |||
85 | if ((rc = sysfs_create_bin_file(kobj, &attr->bin))) | ||
86 | return rc; | ||
87 | |||
88 | qstr.name = attr->bin.attr.name; | ||
89 | qstr.len = strlen(qstr.name); | ||
90 | qstr.hash = full_name_hash(qstr.name, qstr.len); | ||
91 | |||
92 | if ((d = lookup_hash(&qstr, kobj->dentry))) { | ||
93 | if (!fops->owner) { | ||
94 | memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp)); | ||
95 | if (fops->read) | ||
96 | tmp.read = fops->read; | ||
97 | if (fops->write) | ||
98 | tmp.write = fops->write; | ||
99 | memcpy(fops, &tmp, sizeof(tmp)); | ||
100 | } | ||
101 | |||
102 | d->d_inode->i_fop = fops; | ||
103 | } else | ||
104 | sysfs_remove_bin_file(kobj, &attr->bin); | ||
105 | |||
106 | return -ENOENT; | ||
107 | }; | ||
108 | |||
109 | /** | ||
110 | * sysfs_remove_fops_file - Remove attribute with special file operations | ||
111 | * @kobj: kobject which contains the attribute | ||
112 | * @attr: attributes which are used to create file | ||
113 | * | ||
114 | * Only wrapper arround sysfs_remove_bin_file() | ||
115 | * | ||
116 | * Returns 0 on success or negative error code on failure. | ||
117 | */ | ||
118 | static inline int sysfs_remove_fops_file(struct kobject *kobj, | ||
119 | struct fops_attribute *attr) | ||
120 | { | ||
121 | return sysfs_remove_bin_file(kobj, &attr->bin); | ||
122 | }; | ||
123 | |||
124 | /** | ||
125 | * i2o_config_read_hrt - Returns the HRT of the controller | ||
126 | * @kob: kernel object handle | ||
127 | * @buf: buffer into which the HRT should be copied | ||
128 | * @off: file offset | ||
129 | * @count: number of bytes to read | ||
130 | * | ||
131 | * Put @count bytes starting at @off into @buf from the HRT of the I2O | ||
132 | * controller corresponding to @kobj. | ||
133 | * | ||
134 | * Returns number of bytes copied into buffer. | ||
135 | */ | ||
136 | static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf, | ||
137 | loff_t offset, size_t count) | ||
138 | { | ||
139 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
140 | i2o_hrt *hrt = c->hrt.virt; | ||
141 | |||
142 | u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4; | ||
143 | |||
144 | if (offset > size) | ||
145 | return 0; | ||
146 | |||
147 | if (offset + count > size) | ||
148 | count = size - offset; | ||
149 | |||
150 | memcpy(buf, (u8 *) hrt + offset, count); | ||
151 | |||
152 | return count; | ||
153 | }; | ||
154 | |||
155 | /** | ||
156 | * i2o_config_read_lct - Returns the LCT of the controller | ||
157 | * @kob: kernel object handle | ||
158 | * @buf: buffer into which the LCT should be copied | ||
159 | * @off: file offset | ||
160 | * @count: number of bytes to read | ||
161 | * | ||
162 | * Put @count bytes starting at @off into @buf from the LCT of the I2O | ||
163 | * controller corresponding to @kobj. | ||
164 | * | ||
165 | * Returns number of bytes copied into buffer. | ||
166 | */ | ||
167 | static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf, | ||
168 | loff_t offset, size_t count) | ||
169 | { | ||
170 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
171 | u32 size = c->lct->table_size * 4; | ||
172 | |||
173 | if (offset > size) | ||
174 | return 0; | ||
175 | |||
176 | if (offset + count > size) | ||
177 | count = size - offset; | ||
178 | |||
179 | memcpy(buf, (u8 *) c->lct + offset, count); | ||
180 | |||
181 | return count; | ||
182 | }; | ||
183 | |||
184 | #define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \ | ||
185 | static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \ | ||
186 | return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \ | ||
187 | };\ | ||
188 | \ | ||
189 | static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \ | ||
190 | return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \ | ||
191 | }; \ | ||
192 | \ | ||
193 | static struct fops_attribute i2o_config_attr_##_name = { \ | ||
194 | .bin = { .attr = { .name = __stringify(_name), .mode = _mode, \ | ||
195 | .owner = THIS_MODULE }, \ | ||
196 | .size = 0, }, \ | ||
197 | .fops = { .write = i2o_config_##_name##_write, \ | ||
198 | .read = i2o_config_##_name##_read} \ | ||
199 | }; | ||
200 | |||
201 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
202 | |||
203 | /** | ||
204 | * i2o_config_dpt_reagion - Converts type and id to flash region | ||
205 | * @swtype: type of software module reading | ||
206 | * @swid: id of software which should be read | ||
207 | * | ||
208 | * Converts type and id from I2O spec to the matching region for DPT / | ||
209 | * Adaptec controllers. | ||
210 | * | ||
211 | * Returns region which match type and id or -1 on error. | ||
212 | */ | ||
213 | static u32 i2o_config_dpt_region(u8 swtype, u8 swid) | ||
214 | { | ||
215 | switch (swtype) { | ||
216 | case I2O_SOFTWARE_MODULE_IRTOS: | ||
217 | /* | ||
218 | * content: operation firmware | ||
219 | * region size: | ||
220 | * 0xbc000 for 2554, 3754, 2564, 3757 | ||
221 | * 0x170000 for 2865 | ||
222 | * 0x17c000 for 3966 | ||
223 | */ | ||
224 | if (!swid) | ||
225 | return 0; | ||
226 | |||
227 | break; | ||
228 | |||
229 | case I2O_SOFTWARE_MODULE_IOP_PRIVATE: | ||
230 | /* | ||
231 | * content: BIOS and SMOR | ||
232 | * BIOS size: first 0x8000 bytes | ||
233 | * region size: | ||
234 | * 0x40000 for 2554, 3754, 2564, 3757 | ||
235 | * 0x80000 for 2865, 3966 | ||
236 | */ | ||
237 | if (!swid) | ||
238 | return 1; | ||
239 | |||
240 | break; | ||
241 | |||
242 | case I2O_SOFTWARE_MODULE_IOP_CONFIG: | ||
243 | switch (swid) { | ||
244 | case 0: | ||
245 | /* | ||
246 | * content: NVRAM defaults | ||
247 | * region size: 0x2000 bytes | ||
248 | */ | ||
249 | return 2; | ||
250 | case 1: | ||
251 | /* | ||
252 | * content: serial number | ||
253 | * region size: 0x2000 bytes | ||
254 | */ | ||
255 | return 3; | ||
256 | } | ||
257 | break; | ||
258 | } | ||
259 | |||
260 | return -1; | ||
261 | }; | ||
262 | |||
263 | #endif | ||
264 | |||
265 | /** | ||
266 | * i2o_config_sw_read - Read a software module from controller | ||
267 | * @file: file pointer | ||
268 | * @buf: buffer into which the data should be copied | ||
269 | * @count: number of bytes to read | ||
270 | * @off: file offset | ||
271 | * @swtype: type of software module reading | ||
272 | * @swid: id of software which should be read | ||
273 | * | ||
274 | * Transfers @count bytes at offset @offset from IOP into buffer using | ||
275 | * type @swtype and id @swid as described in I2O spec. | ||
276 | * | ||
277 | * Returns number of bytes copied into buffer or error code on failure. | ||
278 | */ | ||
279 | static ssize_t i2o_config_sw_read(struct file *file, char __user * buf, | ||
280 | size_t count, loff_t * offset, u8 swtype, | ||
281 | u32 swid) | ||
282 | { | ||
283 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
284 | struct kobject *kobj = sd->s_element; | ||
285 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
286 | u32 m, function = I2O_CMD_SW_UPLOAD; | ||
287 | struct i2o_dma buffer; | ||
288 | struct i2o_message __iomem *msg; | ||
289 | u32 __iomem *mptr; | ||
290 | int rc, status; | ||
291 | |||
292 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
293 | if (m == I2O_QUEUE_EMPTY) | ||
294 | return -EBUSY; | ||
295 | |||
296 | mptr = &msg->body[3]; | ||
297 | |||
298 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) { | ||
299 | i2o_msg_nop(c, m); | ||
300 | return rc; | ||
301 | } | ||
302 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
303 | if (c->adaptec) { | ||
304 | mptr = &msg->body[4]; | ||
305 | function = I2O_CMD_PRIVATE; | ||
306 | |||
307 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
308 | |||
309 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ, | ||
310 | &msg->body[0]); | ||
311 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
312 | writel(*offset, &msg->body[2]); | ||
313 | writel(count, &msg->body[3]); | ||
314 | } else | ||
315 | #endif | ||
316 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
317 | |||
318 | writel(0xD0000000 | count, mptr++); | ||
319 | writel(buffer.phys, mptr); | ||
320 | |||
321 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
322 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
323 | writel(0, &msg->u.head[3]); | ||
324 | |||
325 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
326 | if (!c->adaptec) | ||
327 | #endif | ||
328 | { | ||
329 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
330 | writel(0, &msg->body[1]); | ||
331 | writel(swid, &msg->body[2]); | ||
332 | } | ||
333 | |||
334 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
335 | |||
336 | if (status == I2O_POST_WAIT_OK) { | ||
337 | if (!(rc = copy_to_user(buf, buffer.virt, count))) { | ||
338 | rc = count; | ||
339 | *offset += count; | ||
340 | } | ||
341 | } else | ||
342 | rc = -EIO; | ||
343 | |||
344 | if (status != -ETIMEDOUT) | ||
345 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
346 | |||
347 | return rc; | ||
348 | }; | ||
349 | |||
350 | /** | ||
351 | * i2o_config_sw_write - Write a software module to controller | ||
352 | * @file: file pointer | ||
353 | * @buf: buffer into which the data should be copied | ||
354 | * @count: number of bytes to read | ||
355 | * @off: file offset | ||
356 | * @swtype: type of software module writing | ||
357 | * @swid: id of software which should be written | ||
358 | * | ||
359 | * Transfers @count bytes at offset @offset from buffer to IOP using | ||
360 | * type @swtype and id @swid as described in I2O spec. | ||
361 | * | ||
362 | * Returns number of bytes copied from buffer or error code on failure. | ||
363 | */ | ||
364 | static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf, | ||
365 | size_t count, loff_t * offset, u8 swtype, | ||
366 | u32 swid) | ||
367 | { | ||
368 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
369 | struct kobject *kobj = sd->s_element; | ||
370 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
371 | u32 m, function = I2O_CMD_SW_DOWNLOAD; | ||
372 | struct i2o_dma buffer; | ||
373 | struct i2o_message __iomem *msg; | ||
374 | u32 __iomem *mptr; | ||
375 | int rc, status; | ||
376 | |||
377 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
378 | if (m == I2O_QUEUE_EMPTY) | ||
379 | return -EBUSY; | ||
380 | |||
381 | mptr = &msg->body[3]; | ||
382 | |||
383 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) | ||
384 | goto nop_msg; | ||
385 | |||
386 | if ((rc = copy_from_user(buffer.virt, buf, count))) | ||
387 | goto free_buffer; | ||
388 | |||
389 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
390 | if (c->adaptec) { | ||
391 | mptr = &msg->body[4]; | ||
392 | function = I2O_CMD_PRIVATE; | ||
393 | |||
394 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
395 | |||
396 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE, | ||
397 | &msg->body[0]); | ||
398 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
399 | writel(*offset, &msg->body[2]); | ||
400 | writel(count, &msg->body[3]); | ||
401 | } else | ||
402 | #endif | ||
403 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
404 | |||
405 | writel(0xD4000000 | count, mptr++); | ||
406 | writel(buffer.phys, mptr); | ||
407 | |||
408 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
409 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
410 | writel(0, &msg->u.head[3]); | ||
411 | |||
412 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
413 | if (!c->adaptec) | ||
414 | #endif | ||
415 | { | ||
416 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
417 | writel(0, &msg->body[1]); | ||
418 | writel(swid, &msg->body[2]); | ||
419 | } | ||
420 | |||
421 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
422 | |||
423 | if (status != -ETIMEDOUT) | ||
424 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
425 | |||
426 | if (status != I2O_POST_WAIT_OK) | ||
427 | return -EIO; | ||
428 | |||
429 | *offset += count; | ||
430 | |||
431 | return count; | ||
432 | |||
433 | free_buffer: | ||
434 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
435 | |||
436 | nop_msg: | ||
437 | i2o_msg_nop(c, m); | ||
438 | |||
439 | return rc; | ||
440 | }; | ||
441 | |||
442 | /* attribute for HRT in sysfs */ | ||
443 | static struct bin_attribute i2o_config_hrt_attr = { | ||
444 | .attr = { | ||
445 | .name = "hrt", | ||
446 | .mode = S_IRUGO, | ||
447 | .owner = THIS_MODULE}, | ||
448 | .size = 0, | ||
449 | .read = i2o_config_read_hrt | ||
450 | }; | ||
451 | |||
452 | /* attribute for LCT in sysfs */ | ||
453 | static struct bin_attribute i2o_config_lct_attr = { | ||
454 | .attr = { | ||
455 | .name = "lct", | ||
456 | .mode = S_IRUGO, | ||
457 | .owner = THIS_MODULE}, | ||
458 | .size = 0, | ||
459 | .read = i2o_config_read_lct | ||
460 | }; | ||
461 | |||
462 | /* IRTOS firmware access */ | ||
463 | I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0); | ||
464 | |||
465 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
466 | |||
467 | /* | ||
468 | * attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec | ||
469 | * controllers | ||
470 | */ | ||
471 | I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0); | ||
472 | I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0); | ||
473 | I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1); | ||
474 | |||
475 | #endif | ||
476 | |||
477 | /** | ||
478 | * i2o_config_notify_controller_add - Notify of added controller | ||
479 | * @c: the controller which was added | ||
480 | * | ||
481 | * If a I2O controller is added, we catch the notification to add sysfs | ||
482 | * entries. | ||
483 | */ | ||
484 | static void i2o_config_notify_controller_add(struct i2o_controller *c) | ||
485 | { | ||
486 | struct kobject *kobj = &c->exec->device.kobj; | ||
487 | |||
488 | sysfs_create_bin_file(kobj, &i2o_config_hrt_attr); | ||
489 | sysfs_create_bin_file(kobj, &i2o_config_lct_attr); | ||
490 | |||
491 | sysfs_create_fops_file(kobj, &i2o_config_attr_irtos); | ||
492 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
493 | if (c->adaptec) { | ||
494 | sysfs_create_fops_file(kobj, &i2o_config_attr_bios); | ||
495 | sysfs_create_fops_file(kobj, &i2o_config_attr_nvram); | ||
496 | sysfs_create_fops_file(kobj, &i2o_config_attr_serial); | ||
497 | } | ||
498 | #endif | ||
499 | }; | ||
500 | |||
501 | /** | ||
502 | * i2o_config_notify_controller_remove - Notify of removed controller | ||
503 | * @c: the controller which was removed | ||
504 | * | ||
505 | * If a I2O controller is removed, we catch the notification to remove the | ||
506 | * sysfs entries. | ||
507 | */ | ||
508 | static void i2o_config_notify_controller_remove(struct i2o_controller *c) | ||
509 | { | ||
510 | struct kobject *kobj = &c->exec->device.kobj; | ||
511 | |||
512 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
513 | if (c->adaptec) { | ||
514 | sysfs_remove_fops_file(kobj, &i2o_config_attr_serial); | ||
515 | sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram); | ||
516 | sysfs_remove_fops_file(kobj, &i2o_config_attr_bios); | ||
517 | } | ||
518 | #endif | ||
519 | sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos); | ||
520 | |||
521 | sysfs_remove_bin_file(kobj, &i2o_config_lct_attr); | ||
522 | sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr); | ||
523 | }; | ||
524 | |||
525 | /* Config OSM driver struct */ | 33 | /* Config OSM driver struct */ |
526 | static struct i2o_driver i2o_config_driver = { | 34 | static struct i2o_driver i2o_config_driver = { |
527 | .name = OSM_NAME, | 35 | .name = OSM_NAME, |
528 | .notify_controller_add = i2o_config_notify_controller_add, | ||
529 | .notify_controller_remove = i2o_config_notify_controller_remove | ||
530 | }; | 36 | }; |
531 | 37 | ||
532 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | 38 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL |
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index 7a60fd7be8ad..66c03e882570 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/i2o.h> | 32 | #include <linux/i2o.h> |
33 | #include "core.h" | 33 | #include "core.h" |
34 | 34 | ||
35 | #define OSM_DESCRIPTION "I2O-subsystem" | ||
36 | |||
35 | /* PCI device id table for all I2O controllers */ | 37 | /* PCI device id table for all I2O controllers */ |
36 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { | 38 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { |
37 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, | 39 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, |
@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c) | |||
66 | 68 | ||
67 | if (c->base.virt) | 69 | if (c->base.virt) |
68 | iounmap(c->base.virt); | 70 | iounmap(c->base.virt); |
71 | |||
72 | pci_release_regions(c->pdev); | ||
69 | } | 73 | } |
70 | 74 | ||
71 | /** | 75 | /** |
@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
84 | struct device *dev = &pdev->dev; | 88 | struct device *dev = &pdev->dev; |
85 | int i; | 89 | int i; |
86 | 90 | ||
91 | if (pci_request_regions(pdev, OSM_DESCRIPTION)) { | ||
92 | printk(KERN_ERR "%s: device already claimed\n", c->name); | ||
93 | return -ENODEV; | ||
94 | } | ||
95 | |||
87 | for (i = 0; i < 6; i++) { | 96 | for (i = 0; i < 6; i++) { |
88 | /* Skip I/O spaces */ | 97 | /* Skip I/O spaces */ |
89 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { | 98 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { |
@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
138 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); | 147 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); |
139 | if (!c->base.virt) { | 148 | if (!c->base.virt) { |
140 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); | 149 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); |
150 | i2o_pci_free(c); | ||
141 | return -ENOMEM; | 151 | return -ENOMEM; |
142 | } | 152 | } |
143 | 153 | ||
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 8b487ed1069c..974f2f36bdbe 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "wbsd.h" | 42 | #include "wbsd.h" |
43 | 43 | ||
44 | #define DRIVER_NAME "wbsd" | 44 | #define DRIVER_NAME "wbsd" |
45 | #define DRIVER_VERSION "1.2" | 45 | #define DRIVER_VERSION "1.3" |
46 | 46 | ||
47 | #ifdef CONFIG_MMC_DEBUG | 47 | #ifdef CONFIG_MMC_DEBUG |
48 | #define DBG(x...) \ | 48 | #define DBG(x...) \ |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 7b293f01c9ed..34b80de34fae 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1897,6 +1897,7 @@ static int cp_resume (struct pci_dev *pdev) | |||
1897 | { | 1897 | { |
1898 | struct net_device *dev; | 1898 | struct net_device *dev; |
1899 | struct cp_private *cp; | 1899 | struct cp_private *cp; |
1900 | unsigned long flags; | ||
1900 | 1901 | ||
1901 | dev = pci_get_drvdata (pdev); | 1902 | dev = pci_get_drvdata (pdev); |
1902 | cp = netdev_priv(dev); | 1903 | cp = netdev_priv(dev); |
@@ -1910,6 +1911,12 @@ static int cp_resume (struct pci_dev *pdev) | |||
1910 | 1911 | ||
1911 | cp_init_hw (cp); | 1912 | cp_init_hw (cp); |
1912 | netif_start_queue (dev); | 1913 | netif_start_queue (dev); |
1914 | |||
1915 | spin_lock_irqsave (&cp->lock, flags); | ||
1916 | |||
1917 | mii_check_media(&cp->mii_if, netif_msg_link(cp), FALSE); | ||
1918 | |||
1919 | spin_unlock_irqrestore (&cp->lock, flags); | ||
1913 | 1920 | ||
1914 | return 0; | 1921 | return 0; |
1915 | } | 1922 | } |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 8a835eb58808..8edb6936fb9b 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1145,7 +1145,7 @@ config IBMVETH | |||
1145 | be called ibmveth. | 1145 | be called ibmveth. |
1146 | 1146 | ||
1147 | config IBM_EMAC | 1147 | config IBM_EMAC |
1148 | tristate "IBM PPC4xx EMAC driver support" | 1148 | bool "IBM PPC4xx EMAC driver support" |
1149 | depends on 4xx | 1149 | depends on 4xx |
1150 | select CRC32 | 1150 | select CRC32 |
1151 | ---help--- | 1151 | ---help--- |
@@ -1154,7 +1154,7 @@ config IBM_EMAC | |||
1154 | 1154 | ||
1155 | config IBM_EMAC_ERRMSG | 1155 | config IBM_EMAC_ERRMSG |
1156 | bool "Verbose error messages" | 1156 | bool "Verbose error messages" |
1157 | depends on IBM_EMAC | 1157 | depends on IBM_EMAC && BROKEN |
1158 | 1158 | ||
1159 | config IBM_EMAC_RXB | 1159 | config IBM_EMAC_RXB |
1160 | int "Number of receive buffers" | 1160 | int "Number of receive buffers" |
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index 2c6dc24c3728..b780307093eb 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -417,6 +417,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
417 | struct net_local *lp = netdev_priv(dev); | 417 | struct net_local *lp = netdev_priv(dev); |
418 | static unsigned version_printed; | 418 | static unsigned version_printed; |
419 | int i; | 419 | int i; |
420 | int tmp; | ||
420 | unsigned rev_type = 0; | 421 | unsigned rev_type = 0; |
421 | int eeprom_buff[CHKSUM_LEN]; | 422 | int eeprom_buff[CHKSUM_LEN]; |
422 | int retval; | 423 | int retval; |
@@ -492,14 +493,17 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular) | |||
492 | goto out2; | 493 | goto out2; |
493 | } | 494 | } |
494 | } | 495 | } |
495 | printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT)); | 496 | printk(KERN_DEBUG "PP_addr at %x: 0x%x\n", |
497 | ioaddr + ADD_PORT, inw(ioaddr + ADD_PORT)); | ||
496 | 498 | ||
497 | ioaddr &= ~3; | 499 | ioaddr &= ~3; |
498 | outw(PP_ChipID, ioaddr + ADD_PORT); | 500 | outw(PP_ChipID, ioaddr + ADD_PORT); |
499 | 501 | ||
500 | if (inw(ioaddr + DATA_PORT) != CHIP_EISA_ID_SIG) { | 502 | tmp = inw(ioaddr + DATA_PORT); |
501 | printk(KERN_ERR "%s: incorrect signature 0x%x\n", | 503 | if (tmp != CHIP_EISA_ID_SIG) { |
502 | dev->name, inw(ioaddr + DATA_PORT)); | 504 | printk(KERN_DEBUG "%s: incorrect signature at %x: 0x%x!=" |
505 | CHIP_EISA_ID_SIG_STR "\n", | ||
506 | dev->name, ioaddr + DATA_PORT, tmp); | ||
503 | retval = -ENODEV; | 507 | retval = -ENODEV; |
504 | goto out2; | 508 | goto out2; |
505 | } | 509 | } |
diff --git a/drivers/net/cs89x0.h b/drivers/net/cs89x0.h index bd3ad8e6cce9..decea264f121 100644 --- a/drivers/net/cs89x0.h +++ b/drivers/net/cs89x0.h | |||
@@ -93,6 +93,7 @@ | |||
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | #define CHIP_EISA_ID_SIG 0x630E /* Product ID Code for Crystal Chip (CS8900 spec 4.3) */ | 95 | #define CHIP_EISA_ID_SIG 0x630E /* Product ID Code for Crystal Chip (CS8900 spec 4.3) */ |
96 | #define CHIP_EISA_ID_SIG_STR "0x630E" | ||
96 | 97 | ||
97 | #ifdef IBMEIPKT | 98 | #ifdef IBMEIPKT |
98 | #define EISA_ID_SIG 0x4D24 /* IBM */ | 99 | #define EISA_ID_SIG 0x4D24 /* IBM */ |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 5fddc0ff8878..6440a892bb81 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -48,6 +48,10 @@ | |||
48 | * net_device_stats | 48 | * net_device_stats |
49 | * * introduced tx_timeout function | 49 | * * introduced tx_timeout function |
50 | * * reworked locking | 50 | * * reworked locking |
51 | * | ||
52 | * 01-Jul-2005 Ben Dooks <ben@simtec.co.uk> | ||
53 | * * fixed spinlock call without pointer | ||
54 | * * ensure spinlock is initialised | ||
51 | */ | 55 | */ |
52 | 56 | ||
53 | #include <linux/module.h> | 57 | #include <linux/module.h> |
@@ -148,7 +152,6 @@ static int dm9000_probe(struct device *); | |||
148 | static int dm9000_open(struct net_device *); | 152 | static int dm9000_open(struct net_device *); |
149 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); | 153 | static int dm9000_start_xmit(struct sk_buff *, struct net_device *); |
150 | static int dm9000_stop(struct net_device *); | 154 | static int dm9000_stop(struct net_device *); |
151 | static int dm9000_do_ioctl(struct net_device *, struct ifreq *, int); | ||
152 | 155 | ||
153 | 156 | ||
154 | static void dm9000_timer(unsigned long); | 157 | static void dm9000_timer(unsigned long); |
@@ -322,7 +325,7 @@ static void dm9000_timeout(struct net_device *dev) | |||
322 | 325 | ||
323 | /* Save previous register address */ | 326 | /* Save previous register address */ |
324 | reg_save = readb(db->io_addr); | 327 | reg_save = readb(db->io_addr); |
325 | spin_lock_irqsave(db->lock,flags); | 328 | spin_lock_irqsave(&db->lock,flags); |
326 | 329 | ||
327 | netif_stop_queue(dev); | 330 | netif_stop_queue(dev); |
328 | dm9000_reset(db); | 331 | dm9000_reset(db); |
@@ -333,7 +336,7 @@ static void dm9000_timeout(struct net_device *dev) | |||
333 | 336 | ||
334 | /* Restore previous register address */ | 337 | /* Restore previous register address */ |
335 | writeb(reg_save, db->io_addr); | 338 | writeb(reg_save, db->io_addr); |
336 | spin_unlock_irqrestore(db->lock,flags); | 339 | spin_unlock_irqrestore(&db->lock,flags); |
337 | } | 340 | } |
338 | 341 | ||
339 | 342 | ||
@@ -387,8 +390,6 @@ dm9000_probe(struct device *dev) | |||
387 | int i; | 390 | int i; |
388 | u32 id_val; | 391 | u32 id_val; |
389 | 392 | ||
390 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); | ||
391 | |||
392 | /* Init network device */ | 393 | /* Init network device */ |
393 | ndev = alloc_etherdev(sizeof (struct board_info)); | 394 | ndev = alloc_etherdev(sizeof (struct board_info)); |
394 | if (!ndev) { | 395 | if (!ndev) { |
@@ -405,6 +406,8 @@ dm9000_probe(struct device *dev) | |||
405 | db = (struct board_info *) ndev->priv; | 406 | db = (struct board_info *) ndev->priv; |
406 | memset(db, 0, sizeof (*db)); | 407 | memset(db, 0, sizeof (*db)); |
407 | 408 | ||
409 | spin_lock_init(&db->lock); | ||
410 | |||
408 | if (pdev->num_resources < 2) { | 411 | if (pdev->num_resources < 2) { |
409 | ret = -ENODEV; | 412 | ret = -ENODEV; |
410 | goto out; | 413 | goto out; |
@@ -541,7 +544,6 @@ dm9000_probe(struct device *dev) | |||
541 | ndev->stop = &dm9000_stop; | 544 | ndev->stop = &dm9000_stop; |
542 | ndev->get_stats = &dm9000_get_stats; | 545 | ndev->get_stats = &dm9000_get_stats; |
543 | ndev->set_multicast_list = &dm9000_hash_table; | 546 | ndev->set_multicast_list = &dm9000_hash_table; |
544 | ndev->do_ioctl = &dm9000_do_ioctl; | ||
545 | 547 | ||
546 | #ifdef DM9000_PROGRAM_EEPROM | 548 | #ifdef DM9000_PROGRAM_EEPROM |
547 | program_eeprom(db); | 549 | program_eeprom(db); |
@@ -612,7 +614,7 @@ dm9000_open(struct net_device *dev) | |||
612 | 614 | ||
613 | /* set and active a timer process */ | 615 | /* set and active a timer process */ |
614 | init_timer(&db->timer); | 616 | init_timer(&db->timer); |
615 | db->timer.expires = DM9000_TIMER_WUT * 2; | 617 | db->timer.expires = DM9000_TIMER_WUT; |
616 | db->timer.data = (unsigned long) dev; | 618 | db->timer.data = (unsigned long) dev; |
617 | db->timer.function = &dm9000_timer; | 619 | db->timer.function = &dm9000_timer; |
618 | add_timer(&db->timer); | 620 | add_timer(&db->timer); |
@@ -845,15 +847,6 @@ dm9000_get_stats(struct net_device *dev) | |||
845 | return &db->stats; | 847 | return &db->stats; |
846 | } | 848 | } |
847 | 849 | ||
848 | /* | ||
849 | * Process the upper socket ioctl command | ||
850 | */ | ||
851 | static int | ||
852 | dm9000_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | ||
853 | { | ||
854 | PRINTK1("entering %s\n",__FUNCTION__); | ||
855 | return 0; | ||
856 | } | ||
857 | 850 | ||
858 | /* | 851 | /* |
859 | * A periodic timer routine | 852 | * A periodic timer routine |
@@ -864,21 +857,11 @@ dm9000_timer(unsigned long data) | |||
864 | { | 857 | { |
865 | struct net_device *dev = (struct net_device *) data; | 858 | struct net_device *dev = (struct net_device *) data; |
866 | board_info_t *db = (board_info_t *) dev->priv; | 859 | board_info_t *db = (board_info_t *) dev->priv; |
867 | u8 reg_save; | ||
868 | unsigned long flags; | ||
869 | 860 | ||
870 | PRINTK3("dm9000_timer()\n"); | 861 | PRINTK3("dm9000_timer()\n"); |
871 | 862 | ||
872 | spin_lock_irqsave(db->lock,flags); | ||
873 | /* Save previous register address */ | ||
874 | reg_save = readb(db->io_addr); | ||
875 | |||
876 | mii_check_media(&db->mii, netif_msg_link(db), 0); | 863 | mii_check_media(&db->mii, netif_msg_link(db), 0); |
877 | 864 | ||
878 | /* Restore previous register address */ | ||
879 | writeb(reg_save, db->io_addr); | ||
880 | spin_unlock_irqrestore(db->lock,flags); | ||
881 | |||
882 | /* Set timer again */ | 865 | /* Set timer again */ |
883 | db->timer.expires = DM9000_TIMER_WUT; | 866 | db->timer.expires = DM9000_TIMER_WUT; |
884 | add_timer(&db->timer); | 867 | add_timer(&db->timer); |
@@ -1098,9 +1081,14 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) | |||
1098 | { | 1081 | { |
1099 | board_info_t *db = (board_info_t *) dev->priv; | 1082 | board_info_t *db = (board_info_t *) dev->priv; |
1100 | unsigned long flags; | 1083 | unsigned long flags; |
1084 | unsigned int reg_save; | ||
1101 | int ret; | 1085 | int ret; |
1102 | 1086 | ||
1103 | spin_lock_irqsave(&db->lock,flags); | 1087 | spin_lock_irqsave(&db->lock,flags); |
1088 | |||
1089 | /* Save previous register address */ | ||
1090 | reg_save = readb(db->io_addr); | ||
1091 | |||
1104 | /* Fill the phyxcer register into REG_0C */ | 1092 | /* Fill the phyxcer register into REG_0C */ |
1105 | iow(db, DM9000_EPAR, DM9000_PHY | reg); | 1093 | iow(db, DM9000_EPAR, DM9000_PHY | reg); |
1106 | 1094 | ||
@@ -1111,6 +1099,9 @@ dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg) | |||
1111 | /* The read data keeps on REG_0D & REG_0E */ | 1099 | /* The read data keeps on REG_0D & REG_0E */ |
1112 | ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); | 1100 | ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); |
1113 | 1101 | ||
1102 | /* restore the previous address */ | ||
1103 | writeb(reg_save, db->io_addr); | ||
1104 | |||
1114 | spin_unlock_irqrestore(&db->lock,flags); | 1105 | spin_unlock_irqrestore(&db->lock,flags); |
1115 | 1106 | ||
1116 | return ret; | 1107 | return ret; |
@@ -1124,9 +1115,13 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1124 | { | 1115 | { |
1125 | board_info_t *db = (board_info_t *) dev->priv; | 1116 | board_info_t *db = (board_info_t *) dev->priv; |
1126 | unsigned long flags; | 1117 | unsigned long flags; |
1118 | unsigned long reg_save; | ||
1127 | 1119 | ||
1128 | spin_lock_irqsave(&db->lock,flags); | 1120 | spin_lock_irqsave(&db->lock,flags); |
1129 | 1121 | ||
1122 | /* Save previous register address */ | ||
1123 | reg_save = readb(db->io_addr); | ||
1124 | |||
1130 | /* Fill the phyxcer register into REG_0C */ | 1125 | /* Fill the phyxcer register into REG_0C */ |
1131 | iow(db, DM9000_EPAR, DM9000_PHY | reg); | 1126 | iow(db, DM9000_EPAR, DM9000_PHY | reg); |
1132 | 1127 | ||
@@ -1138,6 +1133,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value) | |||
1138 | udelay(500); /* Wait write complete */ | 1133 | udelay(500); /* Wait write complete */ |
1139 | iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ | 1134 | iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ |
1140 | 1135 | ||
1136 | /* restore the previous address */ | ||
1137 | writeb(reg_save, db->io_addr); | ||
1138 | |||
1141 | spin_unlock_irqrestore(&db->lock,flags); | 1139 | spin_unlock_irqrestore(&db->lock,flags); |
1142 | } | 1140 | } |
1143 | 1141 | ||
@@ -1202,6 +1200,8 @@ static struct device_driver dm9000_driver = { | |||
1202 | static int __init | 1200 | static int __init |
1203 | dm9000_init(void) | 1201 | dm9000_init(void) |
1204 | { | 1202 | { |
1203 | printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); | ||
1204 | |||
1205 | return driver_register(&dm9000_driver); /* search board and register */ | 1205 | return driver_register(&dm9000_driver); /* search board and register */ |
1206 | } | 1206 | } |
1207 | 1207 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5e5d2c3c7ce4..b82fd15d0891 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3789,6 +3789,7 @@ e1000_netpoll(struct net_device *netdev) | |||
3789 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3789 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3790 | disable_irq(adapter->pdev->irq); | 3790 | disable_irq(adapter->pdev->irq); |
3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); | 3791 | e1000_intr(adapter->pdev->irq, netdev, NULL); |
3792 | e1000_clean_tx_irq(adapter); | ||
3792 | enable_irq(adapter->pdev->irq); | 3793 | enable_irq(adapter->pdev->irq); |
3793 | } | 3794 | } |
3794 | #endif | 3795 | #endif |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index e44f8e9055ef..0b230222bfea 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -130,12 +130,11 @@ struct sixpack { | |||
130 | 130 | ||
131 | #define AX25_6PACK_HEADER_LEN 0 | 131 | #define AX25_6PACK_HEADER_LEN 0 |
132 | 132 | ||
133 | static void sp_start_tx_timer(struct sixpack *); | ||
134 | static void sixpack_decode(struct sixpack *, unsigned char[], int); | 133 | static void sixpack_decode(struct sixpack *, unsigned char[], int); |
135 | static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); | 134 | static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); |
136 | 135 | ||
137 | /* | 136 | /* |
138 | * perform the persistence/slottime algorithm for CSMA access. If the | 137 | * Perform the persistence/slottime algorithm for CSMA access. If the |
139 | * persistence check was successful, write the data to the serial driver. | 138 | * persistence check was successful, write the data to the serial driver. |
140 | * Note that in case of DAMA operation, the data is not sent here. | 139 | * Note that in case of DAMA operation, the data is not sent here. |
141 | */ | 140 | */ |
@@ -143,7 +142,7 @@ static int encode_sixpack(unsigned char *, unsigned char *, int, unsigned char); | |||
143 | static void sp_xmit_on_air(unsigned long channel) | 142 | static void sp_xmit_on_air(unsigned long channel) |
144 | { | 143 | { |
145 | struct sixpack *sp = (struct sixpack *) channel; | 144 | struct sixpack *sp = (struct sixpack *) channel; |
146 | int actual; | 145 | int actual, when = sp->slottime; |
147 | static unsigned char random; | 146 | static unsigned char random; |
148 | 147 | ||
149 | random = random * 17 + 41; | 148 | random = random * 17 + 41; |
@@ -159,20 +158,10 @@ static void sp_xmit_on_air(unsigned long channel) | |||
159 | sp->tty->driver->write(sp->tty, &sp->led_state, 1); | 158 | sp->tty->driver->write(sp->tty, &sp->led_state, 1); |
160 | sp->status2 = 0; | 159 | sp->status2 = 0; |
161 | } else | 160 | } else |
162 | sp_start_tx_timer(sp); | 161 | mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100); |
163 | } | 162 | } |
164 | 163 | ||
165 | /* ----> 6pack timer interrupt handler and friends. <---- */ | 164 | /* ----> 6pack timer interrupt handler and friends. <---- */ |
166 | static void sp_start_tx_timer(struct sixpack *sp) | ||
167 | { | ||
168 | int when = sp->slottime; | ||
169 | |||
170 | del_timer(&sp->tx_t); | ||
171 | sp->tx_t.data = (unsigned long) sp; | ||
172 | sp->tx_t.function = sp_xmit_on_air; | ||
173 | sp->tx_t.expires = jiffies + ((when + 1) * HZ) / 100; | ||
174 | add_timer(&sp->tx_t); | ||
175 | } | ||
176 | 165 | ||
177 | /* Encapsulate one AX.25 frame and stuff into a TTY queue. */ | 166 | /* Encapsulate one AX.25 frame and stuff into a TTY queue. */ |
178 | static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) | 167 | static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) |
@@ -243,8 +232,7 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) | |||
243 | sp->xleft = count; | 232 | sp->xleft = count; |
244 | sp->xhead = sp->xbuff; | 233 | sp->xhead = sp->xbuff; |
245 | sp->status2 = count; | 234 | sp->status2 = count; |
246 | if (sp->duplex == 0) | 235 | sp_xmit_on_air((unsigned long)sp); |
247 | sp_start_tx_timer(sp); | ||
248 | } | 236 | } |
249 | 237 | ||
250 | return; | 238 | return; |
@@ -320,12 +308,6 @@ static int sp_set_mac_address(struct net_device *dev, void *addr) | |||
320 | { | 308 | { |
321 | struct sockaddr_ax25 *sa = addr; | 309 | struct sockaddr_ax25 *sa = addr; |
322 | 310 | ||
323 | if (sa->sax25_family != AF_AX25) | ||
324 | return -EINVAL; | ||
325 | |||
326 | if (!sa->sax25_ndigis) | ||
327 | return -EINVAL; | ||
328 | |||
329 | spin_lock_irq(&dev->xmit_lock); | 311 | spin_lock_irq(&dev->xmit_lock); |
330 | memcpy(dev->dev_addr, &sa->sax25_call, AX25_ADDR_LEN); | 312 | memcpy(dev->dev_addr, &sa->sax25_call, AX25_ADDR_LEN); |
331 | spin_unlock_irq(&dev->xmit_lock); | 313 | spin_unlock_irq(&dev->xmit_lock); |
@@ -680,6 +662,9 @@ static int sixpack_open(struct tty_struct *tty) | |||
680 | netif_start_queue(dev); | 662 | netif_start_queue(dev); |
681 | 663 | ||
682 | init_timer(&sp->tx_t); | 664 | init_timer(&sp->tx_t); |
665 | sp->tx_t.function = sp_xmit_on_air; | ||
666 | sp->tx_t.data = (unsigned long) sp; | ||
667 | |||
683 | init_timer(&sp->resync_t); | 668 | init_timer(&sp->resync_t); |
684 | 669 | ||
685 | spin_unlock_bh(&sp->lock); | 670 | spin_unlock_bh(&sp->lock); |
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig index 7cdebe1a0b61..0cd54306e636 100644 --- a/drivers/net/hamradio/Kconfig +++ b/drivers/net/hamradio/Kconfig | |||
@@ -17,7 +17,7 @@ config MKISS | |||
17 | 17 | ||
18 | config 6PACK | 18 | config 6PACK |
19 | tristate "Serial port 6PACK driver" | 19 | tristate "Serial port 6PACK driver" |
20 | depends on AX25 && BROKEN_ON_SMP | 20 | depends on AX25 |
21 | ---help--- | 21 | ---help--- |
22 | 6pack is a transmission protocol for the data exchange between your | 22 | 6pack is a transmission protocol for the data exchange between your |
23 | PC and your TNC (the Terminal Node Controller acts as a kind of | 23 | PC and your TNC (the Terminal Node Controller acts as a kind of |
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 6482d994d489..0de3bb906174 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c | |||
@@ -1253,7 +1253,7 @@ static int emac_init_tah(struct ocp_enet_private *fep) | |||
1253 | TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | | 1253 | TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | |
1254 | TAH_MR_DIG); | 1254 | TAH_MR_DIG); |
1255 | 1255 | ||
1256 | iounmap(&tahp); | 1256 | iounmap(tahp); |
1257 | 1257 | ||
1258 | return 0; | 1258 | return 0; |
1259 | } | 1259 | } |
@@ -1712,11 +1712,10 @@ struct mal_commac_ops emac_commac_ops = { | |||
1712 | }; | 1712 | }; |
1713 | 1713 | ||
1714 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1714 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1715 | static int emac_netpoll(struct net_device *ndev) | 1715 | static void emac_netpoll(struct net_device *ndev) |
1716 | { | 1716 | { |
1717 | emac_rxeob_dev((void *)ndev, 0); | 1717 | emac_rxeob_dev((void *)ndev, 0); |
1718 | emac_txeob_dev((void *)ndev, 0); | 1718 | emac_txeob_dev((void *)ndev, 0); |
1719 | return 0; | ||
1720 | } | 1719 | } |
1721 | #endif | 1720 | #endif |
1722 | 1721 | ||
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index d520b5920d6c..49e5467bdd73 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c | |||
@@ -499,7 +499,7 @@ static int ioc3_mdio_read(struct net_device *dev, int phy, int reg) | |||
499 | ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); | 499 | ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); |
500 | while (ioc3_r_micr() & MICR_BUSY); | 500 | while (ioc3_r_micr() & MICR_BUSY); |
501 | 501 | ||
502 | return ioc3_r_micr() & MIDR_DATA_MASK; | 502 | return ioc3_r_midr_r() & MIDR_DATA_MASK; |
503 | } | 503 | } |
504 | 504 | ||
505 | static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) | 505 | static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) |
@@ -1291,7 +1291,6 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1291 | dev->features = NETIF_F_IP_CSUM; | 1291 | dev->features = NETIF_F_IP_CSUM; |
1292 | #endif | 1292 | #endif |
1293 | 1293 | ||
1294 | ioc3_setup_duplex(ip); | ||
1295 | sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); | 1294 | sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); |
1296 | sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); | 1295 | sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); |
1297 | 1296 | ||
@@ -1300,6 +1299,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1300 | goto out_stop; | 1299 | goto out_stop; |
1301 | 1300 | ||
1302 | mii_check_media(&ip->mii, 1, 1); | 1301 | mii_check_media(&ip->mii, 1, 1); |
1302 | ioc3_setup_duplex(ip); | ||
1303 | 1303 | ||
1304 | vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); | 1304 | vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); |
1305 | model = (sw_physid2 >> 4) & 0x3f; | 1305 | model = (sw_physid2 >> 4) & 0x3f; |
@@ -1524,7 +1524,7 @@ static void ioc3_get_drvinfo (struct net_device *dev, | |||
1524 | struct ethtool_drvinfo *info) | 1524 | struct ethtool_drvinfo *info) |
1525 | { | 1525 | { |
1526 | struct ioc3_private *ip = netdev_priv(dev); | 1526 | struct ioc3_private *ip = netdev_priv(dev); |
1527 | 1527 | ||
1528 | strcpy (info->driver, IOC3_NAME); | 1528 | strcpy (info->driver, IOC3_NAME); |
1529 | strcpy (info->version, IOC3_VERSION); | 1529 | strcpy (info->version, IOC3_VERSION); |
1530 | strcpy (info->bus_info, pci_name(ip->pdev)); | 1530 | strcpy (info->bus_info, pci_name(ip->pdev)); |
@@ -1550,7 +1550,7 @@ static int ioc3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1550 | spin_lock_irq(&ip->ioc3_lock); | 1550 | spin_lock_irq(&ip->ioc3_lock); |
1551 | rc = mii_ethtool_sset(&ip->mii, cmd); | 1551 | rc = mii_ethtool_sset(&ip->mii, cmd); |
1552 | spin_unlock_irq(&ip->ioc3_lock); | 1552 | spin_unlock_irq(&ip->ioc3_lock); |
1553 | 1553 | ||
1554 | return rc; | 1554 | return rc; |
1555 | } | 1555 | } |
1556 | 1556 | ||
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index b33111e21313..1f61f0cc95d8 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -214,7 +214,7 @@ struct net_device loopback_dev = { | |||
214 | .ethtool_ops = &loopback_ethtool_ops, | 214 | .ethtool_ops = &loopback_ethtool_ops, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | /* Setup and register the of the LOOPBACK device. */ | 217 | /* Setup and register the loopback device. */ |
218 | int __init loopback_init(void) | 218 | int __init loopback_init(void) |
219 | { | 219 | { |
220 | struct net_device_stats *stats; | 220 | struct net_device_stats *stats; |
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 82570ec44d8e..6ee4771addf1 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -5133,6 +5133,84 @@ static void __devexit skge_remove_one(struct pci_dev *pdev) | |||
5133 | kfree(pAC); | 5133 | kfree(pAC); |
5134 | } | 5134 | } |
5135 | 5135 | ||
5136 | #ifdef CONFIG_PM | ||
5137 | static int skge_suspend(struct pci_dev *pdev, pm_message_t state) | ||
5138 | { | ||
5139 | struct net_device *dev = pci_get_drvdata(pdev); | ||
5140 | DEV_NET *pNet = netdev_priv(dev); | ||
5141 | SK_AC *pAC = pNet->pAC; | ||
5142 | struct net_device *otherdev = pAC->dev[1]; | ||
5143 | |||
5144 | if (netif_running(dev)) { | ||
5145 | netif_carrier_off(dev); | ||
5146 | DoPrintInterfaceChange = SK_FALSE; | ||
5147 | SkDrvDeInitAdapter(pAC, 0); /* performs SkGeClose */ | ||
5148 | netif_device_detach(dev); | ||
5149 | } | ||
5150 | if (otherdev != dev) { | ||
5151 | if (netif_running(otherdev)) { | ||
5152 | netif_carrier_off(otherdev); | ||
5153 | DoPrintInterfaceChange = SK_FALSE; | ||
5154 | SkDrvDeInitAdapter(pAC, 1); /* performs SkGeClose */ | ||
5155 | netif_device_detach(otherdev); | ||
5156 | } | ||
5157 | } | ||
5158 | |||
5159 | pci_save_state(pdev); | ||
5160 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | ||
5161 | if (pAC->AllocFlag & SK_ALLOC_IRQ) { | ||
5162 | free_irq(dev->irq, dev); | ||
5163 | } | ||
5164 | pci_disable_device(pdev); | ||
5165 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | ||
5166 | |||
5167 | return 0; | ||
5168 | } | ||
5169 | |||
5170 | static int skge_resume(struct pci_dev *pdev) | ||
5171 | { | ||
5172 | struct net_device *dev = pci_get_drvdata(pdev); | ||
5173 | DEV_NET *pNet = netdev_priv(dev); | ||
5174 | SK_AC *pAC = pNet->pAC; | ||
5175 | struct net_device *otherdev = pAC->dev[1]; | ||
5176 | int ret; | ||
5177 | |||
5178 | pci_set_power_state(pdev, PCI_D0); | ||
5179 | pci_restore_state(pdev); | ||
5180 | pci_enable_device(pdev); | ||
5181 | pci_set_master(pdev); | ||
5182 | if (pAC->GIni.GIMacsFound == 2) | ||
5183 | ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); | ||
5184 | else | ||
5185 | ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev); | ||
5186 | if (ret) { | ||
5187 | printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq); | ||
5188 | pAC->AllocFlag &= ~SK_ALLOC_IRQ; | ||
5189 | dev->irq = 0; | ||
5190 | pci_disable_device(pdev); | ||
5191 | return -EBUSY; | ||
5192 | } | ||
5193 | |||
5194 | netif_device_attach(dev); | ||
5195 | if (netif_running(dev)) { | ||
5196 | DoPrintInterfaceChange = SK_FALSE; | ||
5197 | SkDrvInitAdapter(pAC, 0); /* first device */ | ||
5198 | } | ||
5199 | if (otherdev != dev) { | ||
5200 | netif_device_attach(otherdev); | ||
5201 | if (netif_running(otherdev)) { | ||
5202 | DoPrintInterfaceChange = SK_FALSE; | ||
5203 | SkDrvInitAdapter(pAC, 1); /* second device */ | ||
5204 | } | ||
5205 | } | ||
5206 | |||
5207 | return 0; | ||
5208 | } | ||
5209 | #else | ||
5210 | #define skge_suspend NULL | ||
5211 | #define skge_resume NULL | ||
5212 | #endif | ||
5213 | |||
5136 | static struct pci_device_id skge_pci_tbl[] = { | 5214 | static struct pci_device_id skge_pci_tbl[] = { |
5137 | { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 5215 | { PCI_VENDOR_ID_3COM, 0x1700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
5138 | { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 5216 | { PCI_VENDOR_ID_3COM, 0x80eb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
@@ -5158,6 +5236,8 @@ static struct pci_driver skge_driver = { | |||
5158 | .id_table = skge_pci_tbl, | 5236 | .id_table = skge_pci_tbl, |
5159 | .probe = skge_probe_one, | 5237 | .probe = skge_probe_one, |
5160 | .remove = __devexit_p(skge_remove_one), | 5238 | .remove = __devexit_p(skge_remove_one), |
5239 | .suspend = skge_suspend, | ||
5240 | .resume = skge_resume, | ||
5161 | }; | 5241 | }; |
5162 | 5242 | ||
5163 | static int __init skge_init(void) | 5243 | static int __init skge_init(void) |
diff --git a/drivers/net/sk98lin/skgeinit.c b/drivers/net/sk98lin/skgeinit.c index df4483429a77..6cb49dd02251 100644 --- a/drivers/net/sk98lin/skgeinit.c +++ b/drivers/net/sk98lin/skgeinit.c | |||
@@ -2016,7 +2016,7 @@ SK_IOC IoC) /* IO context */ | |||
2016 | * we set the PHY to coma mode and switch to D3 power state. | 2016 | * we set the PHY to coma mode and switch to D3 power state. |
2017 | */ | 2017 | */ |
2018 | if (pAC->GIni.GIYukonLite && | 2018 | if (pAC->GIni.GIYukonLite && |
2019 | pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) { | 2019 | pAC->GIni.GIChipRev >= CHIP_REV_YU_LITE_A3) { |
2020 | 2020 | ||
2021 | /* for all ports switch PHY to coma mode */ | 2021 | /* for all ports switch PHY to coma mode */ |
2022 | for (i = 0; i < pAC->GIni.GIMacsFound; i++) { | 2022 | for (i = 0; i < pAC->GIni.GIMacsFound; i++) { |
diff --git a/drivers/net/sk98lin/skxmac2.c b/drivers/net/sk98lin/skxmac2.c index 94a09deecb32..42d2d963150a 100644 --- a/drivers/net/sk98lin/skxmac2.c +++ b/drivers/net/sk98lin/skxmac2.c | |||
@@ -1065,7 +1065,7 @@ int Port) /* Port Index (MAC_1 + n) */ | |||
1065 | 1065 | ||
1066 | /* WA code for COMA mode */ | 1066 | /* WA code for COMA mode */ |
1067 | if (pAC->GIni.GIYukonLite && | 1067 | if (pAC->GIni.GIYukonLite && |
1068 | pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) { | 1068 | pAC->GIni.GIChipRev >= CHIP_REV_YU_LITE_A3) { |
1069 | 1069 | ||
1070 | SK_IN32(IoC, B2_GP_IO, &DWord); | 1070 | SK_IN32(IoC, B2_GP_IO, &DWord); |
1071 | 1071 | ||
@@ -1110,7 +1110,7 @@ int Port) /* Port Index (MAC_1 + n) */ | |||
1110 | 1110 | ||
1111 | /* WA code for COMA mode */ | 1111 | /* WA code for COMA mode */ |
1112 | if (pAC->GIni.GIYukonLite && | 1112 | if (pAC->GIni.GIYukonLite && |
1113 | pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) { | 1113 | pAC->GIni.GIChipRev >= CHIP_REV_YU_LITE_A3) { |
1114 | 1114 | ||
1115 | SK_IN32(IoC, B2_GP_IO, &DWord); | 1115 | SK_IN32(IoC, B2_GP_IO, &DWord); |
1116 | 1116 | ||
@@ -2126,7 +2126,7 @@ SK_U8 Mode) /* low power mode */ | |||
2126 | int Ret = 0; | 2126 | int Ret = 0; |
2127 | 2127 | ||
2128 | if (pAC->GIni.GIYukonLite && | 2128 | if (pAC->GIni.GIYukonLite && |
2129 | pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) { | 2129 | pAC->GIni.GIChipRev >= CHIP_REV_YU_LITE_A3) { |
2130 | 2130 | ||
2131 | /* save current power mode */ | 2131 | /* save current power mode */ |
2132 | LastMode = pAC->GIni.GP[Port].PPhyPowerState; | 2132 | LastMode = pAC->GIni.GP[Port].PPhyPowerState; |
@@ -2253,7 +2253,7 @@ int Port) /* Port Index (e.g. MAC_1) */ | |||
2253 | int Ret = 0; | 2253 | int Ret = 0; |
2254 | 2254 | ||
2255 | if (pAC->GIni.GIYukonLite && | 2255 | if (pAC->GIni.GIYukonLite && |
2256 | pAC->GIni.GIChipRev == CHIP_REV_YU_LITE_A3) { | 2256 | pAC->GIni.GIChipRev >= CHIP_REV_YU_LITE_A3) { |
2257 | 2257 | ||
2258 | /* save current power mode */ | 2258 | /* save current power mode */ |
2259 | LastMode = pAC->GIni.GP[Port].PPhyPowerState; | 2259 | LastMode = pAC->GIni.GP[Port].PPhyPowerState; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 5cacc7ad9e79..f15739481d62 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include "skge.h" | 42 | #include "skge.h" |
43 | 43 | ||
44 | #define DRV_NAME "skge" | 44 | #define DRV_NAME "skge" |
45 | #define DRV_VERSION "0.7" | 45 | #define DRV_VERSION "0.8" |
46 | #define PFX DRV_NAME " " | 46 | #define PFX DRV_NAME " " |
47 | 47 | ||
48 | #define DEFAULT_TX_RING_SIZE 128 | 48 | #define DEFAULT_TX_RING_SIZE 128 |
@@ -55,7 +55,7 @@ | |||
55 | #define ETH_JUMBO_MTU 9000 | 55 | #define ETH_JUMBO_MTU 9000 |
56 | #define TX_WATCHDOG (5 * HZ) | 56 | #define TX_WATCHDOG (5 * HZ) |
57 | #define NAPI_WEIGHT 64 | 57 | #define NAPI_WEIGHT 64 |
58 | #define BLINK_HZ (HZ/4) | 58 | #define BLINK_MS 250 |
59 | 59 | ||
60 | MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); | 60 | MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); |
61 | MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); | 61 | MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); |
@@ -75,7 +75,6 @@ static const struct pci_device_id skge_id_table[] = { | |||
75 | { PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B) }, | 75 | { PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B) }, |
76 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) }, | 76 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) }, |
77 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) }, | 77 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) }, |
78 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */ | ||
79 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), }, | 78 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), }, |
80 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, | 79 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, |
81 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */ | 80 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */ |
@@ -249,7 +248,7 @@ static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
249 | } else { | 248 | } else { |
250 | u32 setting; | 249 | u32 setting; |
251 | 250 | ||
252 | switch(ecmd->speed) { | 251 | switch (ecmd->speed) { |
253 | case SPEED_1000: | 252 | case SPEED_1000: |
254 | if (ecmd->duplex == DUPLEX_FULL) | 253 | if (ecmd->duplex == DUPLEX_FULL) |
255 | setting = SUPPORTED_1000baseT_Full; | 254 | setting = SUPPORTED_1000baseT_Full; |
@@ -620,84 +619,98 @@ static int skge_set_coalesce(struct net_device *dev, | |||
620 | return 0; | 619 | return 0; |
621 | } | 620 | } |
622 | 621 | ||
623 | static void skge_led_on(struct skge_hw *hw, int port) | 622 | enum led_mode { LED_MODE_OFF, LED_MODE_ON, LED_MODE_TST }; |
623 | static void skge_led(struct skge_port *skge, enum led_mode mode) | ||
624 | { | 624 | { |
625 | struct skge_hw *hw = skge->hw; | ||
626 | int port = skge->port; | ||
627 | |||
628 | spin_lock_bh(&hw->phy_lock); | ||
625 | if (hw->chip_id == CHIP_ID_GENESIS) { | 629 | if (hw->chip_id == CHIP_ID_GENESIS) { |
626 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_ON); | 630 | switch (mode) { |
627 | skge_write8(hw, B0_LED, LED_STAT_ON); | 631 | case LED_MODE_OFF: |
632 | xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, PHY_B_PEC_LED_OFF); | ||
633 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); | ||
634 | skge_write32(hw, SK_REG(port, RX_LED_VAL), 0); | ||
635 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_T_OFF); | ||
636 | break; | ||
628 | 637 | ||
629 | skge_write8(hw, SK_REG(port, RX_LED_TST), LED_T_ON); | 638 | case LED_MODE_ON: |
630 | skge_write32(hw, SK_REG(port, RX_LED_VAL), 100); | 639 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_ON); |
631 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_START); | 640 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); |
632 | 641 | ||
633 | /* For Broadcom Phy only */ | 642 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_START); |
634 | xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, PHY_B_PEC_LED_ON); | 643 | skge_write8(hw, SK_REG(port, TX_LED_CTRL), LED_START); |
635 | } else { | ||
636 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); | ||
637 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, | ||
638 | PHY_M_LED_MO_DUP(MO_LED_ON) | | ||
639 | PHY_M_LED_MO_10(MO_LED_ON) | | ||
640 | PHY_M_LED_MO_100(MO_LED_ON) | | ||
641 | PHY_M_LED_MO_1000(MO_LED_ON) | | ||
642 | PHY_M_LED_MO_RX(MO_LED_ON)); | ||
643 | } | ||
644 | } | ||
645 | 644 | ||
646 | static void skge_led_off(struct skge_hw *hw, int port) | 645 | break; |
647 | { | ||
648 | if (hw->chip_id == CHIP_ID_GENESIS) { | ||
649 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); | ||
650 | skge_write8(hw, B0_LED, LED_STAT_OFF); | ||
651 | 646 | ||
652 | skge_write32(hw, SK_REG(port, RX_LED_VAL), 0); | 647 | case LED_MODE_TST: |
653 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_T_OFF); | 648 | skge_write8(hw, SK_REG(port, RX_LED_TST), LED_T_ON); |
649 | skge_write32(hw, SK_REG(port, RX_LED_VAL), 100); | ||
650 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_START); | ||
654 | 651 | ||
655 | /* Broadcom only */ | 652 | xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, PHY_B_PEC_LED_ON); |
656 | xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, PHY_B_PEC_LED_OFF); | 653 | break; |
654 | } | ||
657 | } else { | 655 | } else { |
658 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); | 656 | switch (mode) { |
659 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, | 657 | case LED_MODE_OFF: |
660 | PHY_M_LED_MO_DUP(MO_LED_OFF) | | 658 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); |
661 | PHY_M_LED_MO_10(MO_LED_OFF) | | 659 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, |
662 | PHY_M_LED_MO_100(MO_LED_OFF) | | 660 | PHY_M_LED_MO_DUP(MO_LED_OFF) | |
663 | PHY_M_LED_MO_1000(MO_LED_OFF) | | 661 | PHY_M_LED_MO_10(MO_LED_OFF) | |
664 | PHY_M_LED_MO_RX(MO_LED_OFF)); | 662 | PHY_M_LED_MO_100(MO_LED_OFF) | |
663 | PHY_M_LED_MO_1000(MO_LED_OFF) | | ||
664 | PHY_M_LED_MO_RX(MO_LED_OFF)); | ||
665 | break; | ||
666 | case LED_MODE_ON: | ||
667 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, | ||
668 | PHY_M_LED_PULS_DUR(PULS_170MS) | | ||
669 | PHY_M_LED_BLINK_RT(BLINK_84MS) | | ||
670 | PHY_M_LEDC_TX_CTRL | | ||
671 | PHY_M_LEDC_DP_CTRL); | ||
672 | |||
673 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, | ||
674 | PHY_M_LED_MO_RX(MO_LED_OFF) | | ||
675 | (skge->speed == SPEED_100 ? | ||
676 | PHY_M_LED_MO_100(MO_LED_ON) : 0)); | ||
677 | break; | ||
678 | case LED_MODE_TST: | ||
679 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); | ||
680 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, | ||
681 | PHY_M_LED_MO_DUP(MO_LED_ON) | | ||
682 | PHY_M_LED_MO_10(MO_LED_ON) | | ||
683 | PHY_M_LED_MO_100(MO_LED_ON) | | ||
684 | PHY_M_LED_MO_1000(MO_LED_ON) | | ||
685 | PHY_M_LED_MO_RX(MO_LED_ON)); | ||
686 | } | ||
665 | } | 687 | } |
666 | } | 688 | spin_unlock_bh(&hw->phy_lock); |
667 | |||
668 | static void skge_blink_timer(unsigned long data) | ||
669 | { | ||
670 | struct skge_port *skge = (struct skge_port *) data; | ||
671 | struct skge_hw *hw = skge->hw; | ||
672 | unsigned long flags; | ||
673 | |||
674 | spin_lock_irqsave(&hw->phy_lock, flags); | ||
675 | if (skge->blink_on) | ||
676 | skge_led_on(hw, skge->port); | ||
677 | else | ||
678 | skge_led_off(hw, skge->port); | ||
679 | spin_unlock_irqrestore(&hw->phy_lock, flags); | ||
680 | |||
681 | skge->blink_on = !skge->blink_on; | ||
682 | mod_timer(&skge->led_blink, jiffies + BLINK_HZ); | ||
683 | } | 689 | } |
684 | 690 | ||
685 | /* blink LED's for finding board */ | 691 | /* blink LED's for finding board */ |
686 | static int skge_phys_id(struct net_device *dev, u32 data) | 692 | static int skge_phys_id(struct net_device *dev, u32 data) |
687 | { | 693 | { |
688 | struct skge_port *skge = netdev_priv(dev); | 694 | struct skge_port *skge = netdev_priv(dev); |
695 | unsigned long ms; | ||
696 | enum led_mode mode = LED_MODE_TST; | ||
689 | 697 | ||
690 | if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) | 698 | if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) |
691 | data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); | 699 | ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000; |
700 | else | ||
701 | ms = data * 1000; | ||
692 | 702 | ||
693 | /* start blinking */ | 703 | while (ms > 0) { |
694 | skge->blink_on = 1; | 704 | skge_led(skge, mode); |
695 | mod_timer(&skge->led_blink, jiffies+1); | 705 | mode ^= LED_MODE_TST; |
696 | 706 | ||
697 | msleep_interruptible(data * 1000); | 707 | if (msleep_interruptible(BLINK_MS)) |
698 | del_timer_sync(&skge->led_blink); | 708 | break; |
709 | ms -= BLINK_MS; | ||
710 | } | ||
699 | 711 | ||
700 | skge_led_off(skge->hw, skge->port); | 712 | /* back to regular LED state */ |
713 | skge_led(skge, netif_running(dev) ? LED_MODE_ON : LED_MODE_OFF); | ||
701 | 714 | ||
702 | return 0; | 715 | return 0; |
703 | } | 716 | } |
@@ -1028,7 +1041,7 @@ static void bcom_check_link(struct skge_hw *hw, int port) | |||
1028 | } | 1041 | } |
1029 | 1042 | ||
1030 | /* Check Duplex mismatch */ | 1043 | /* Check Duplex mismatch */ |
1031 | switch(aux & PHY_B_AS_AN_RES_MSK) { | 1044 | switch (aux & PHY_B_AS_AN_RES_MSK) { |
1032 | case PHY_B_RES_1000FD: | 1045 | case PHY_B_RES_1000FD: |
1033 | skge->duplex = DUPLEX_FULL; | 1046 | skge->duplex = DUPLEX_FULL; |
1034 | break; | 1047 | break; |
@@ -1099,7 +1112,7 @@ static void bcom_phy_init(struct skge_port *skge, int jumbo) | |||
1099 | r |= XM_MMU_NO_PRE; | 1112 | r |= XM_MMU_NO_PRE; |
1100 | xm_write16(hw, port, XM_MMU_CMD,r); | 1113 | xm_write16(hw, port, XM_MMU_CMD,r); |
1101 | 1114 | ||
1102 | switch(id1) { | 1115 | switch (id1) { |
1103 | case PHY_BCOM_ID1_C0: | 1116 | case PHY_BCOM_ID1_C0: |
1104 | /* | 1117 | /* |
1105 | * Workaround BCOM Errata for the C0 type. | 1118 | * Workaround BCOM Errata for the C0 type. |
@@ -1194,13 +1207,6 @@ static void genesis_mac_init(struct skge_hw *hw, int port) | |||
1194 | xm_write16(hw, port, XM_STAT_CMD, | 1207 | xm_write16(hw, port, XM_STAT_CMD, |
1195 | XM_SC_CLR_RXC | XM_SC_CLR_TXC); | 1208 | XM_SC_CLR_RXC | XM_SC_CLR_TXC); |
1196 | 1209 | ||
1197 | /* initialize Rx, Tx and Link LED */ | ||
1198 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_ON); | ||
1199 | skge_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); | ||
1200 | |||
1201 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_START); | ||
1202 | skge_write8(hw, SK_REG(port, TX_LED_CTRL), LED_START); | ||
1203 | |||
1204 | /* Unreset the XMAC. */ | 1210 | /* Unreset the XMAC. */ |
1205 | skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); | 1211 | skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); |
1206 | 1212 | ||
@@ -1209,7 +1215,6 @@ static void genesis_mac_init(struct skge_hw *hw, int port) | |||
1209 | * namely for the 1000baseTX cards that use the XMAC's | 1215 | * namely for the 1000baseTX cards that use the XMAC's |
1210 | * GMII mode. | 1216 | * GMII mode. |
1211 | */ | 1217 | */ |
1212 | spin_lock_bh(&hw->phy_lock); | ||
1213 | /* Take external Phy out of reset */ | 1218 | /* Take external Phy out of reset */ |
1214 | r = skge_read32(hw, B2_GP_IO); | 1219 | r = skge_read32(hw, B2_GP_IO); |
1215 | if (port == 0) | 1220 | if (port == 0) |
@@ -1219,7 +1224,6 @@ static void genesis_mac_init(struct skge_hw *hw, int port) | |||
1219 | 1224 | ||
1220 | skge_write32(hw, B2_GP_IO, r); | 1225 | skge_write32(hw, B2_GP_IO, r); |
1221 | skge_read32(hw, B2_GP_IO); | 1226 | skge_read32(hw, B2_GP_IO); |
1222 | spin_unlock_bh(&hw->phy_lock); | ||
1223 | 1227 | ||
1224 | /* Enable GMII interfac */ | 1228 | /* Enable GMII interfac */ |
1225 | xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); | 1229 | xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); |
@@ -1569,7 +1573,6 @@ static void yukon_init(struct skge_hw *hw, int port) | |||
1569 | { | 1573 | { |
1570 | struct skge_port *skge = netdev_priv(hw->dev[port]); | 1574 | struct skge_port *skge = netdev_priv(hw->dev[port]); |
1571 | u16 ctrl, ct1000, adv; | 1575 | u16 ctrl, ct1000, adv; |
1572 | u16 ledctrl, ledover; | ||
1573 | 1576 | ||
1574 | pr_debug("yukon_init\n"); | 1577 | pr_debug("yukon_init\n"); |
1575 | if (skge->autoneg == AUTONEG_ENABLE) { | 1578 | if (skge->autoneg == AUTONEG_ENABLE) { |
@@ -1641,32 +1644,11 @@ static void yukon_init(struct skge_hw *hw, int port) | |||
1641 | gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); | 1644 | gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); |
1642 | gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); | 1645 | gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); |
1643 | 1646 | ||
1644 | /* Setup Phy LED's */ | ||
1645 | ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); | ||
1646 | ledover = 0; | ||
1647 | |||
1648 | ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; | ||
1649 | |||
1650 | /* turn off the Rx LED (LED_RX) */ | ||
1651 | ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); | ||
1652 | |||
1653 | /* disable blink mode (LED_DUPLEX) on collisions */ | ||
1654 | ctrl |= PHY_M_LEDC_DP_CTRL; | ||
1655 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); | ||
1656 | |||
1657 | if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { | ||
1658 | /* turn on 100 Mbps LED (LED_LINK100) */ | ||
1659 | ledover |= PHY_M_LED_MO_100(MO_LED_ON); | ||
1660 | } | ||
1661 | |||
1662 | if (ledover) | ||
1663 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); | ||
1664 | |||
1665 | /* Enable phy interrupt on autonegotiation complete (or link up) */ | 1647 | /* Enable phy interrupt on autonegotiation complete (or link up) */ |
1666 | if (skge->autoneg == AUTONEG_ENABLE) | 1648 | if (skge->autoneg == AUTONEG_ENABLE) |
1667 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); | 1649 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_MSK); |
1668 | else | 1650 | else |
1669 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); | 1651 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_DEF_MSK); |
1670 | } | 1652 | } |
1671 | 1653 | ||
1672 | static void yukon_reset(struct skge_hw *hw, int port) | 1654 | static void yukon_reset(struct skge_hw *hw, int port) |
@@ -1691,7 +1673,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port) | |||
1691 | 1673 | ||
1692 | /* WA code for COMA mode -- set PHY reset */ | 1674 | /* WA code for COMA mode -- set PHY reset */ |
1693 | if (hw->chip_id == CHIP_ID_YUKON_LITE && | 1675 | if (hw->chip_id == CHIP_ID_YUKON_LITE && |
1694 | hw->chip_rev == CHIP_REV_YU_LITE_A3) | 1676 | hw->chip_rev >= CHIP_REV_YU_LITE_A3) |
1695 | skge_write32(hw, B2_GP_IO, | 1677 | skge_write32(hw, B2_GP_IO, |
1696 | (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); | 1678 | (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); |
1697 | 1679 | ||
@@ -1701,7 +1683,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port) | |||
1701 | 1683 | ||
1702 | /* WA code for COMA mode -- clear PHY reset */ | 1684 | /* WA code for COMA mode -- clear PHY reset */ |
1703 | if (hw->chip_id == CHIP_ID_YUKON_LITE && | 1685 | if (hw->chip_id == CHIP_ID_YUKON_LITE && |
1704 | hw->chip_rev == CHIP_REV_YU_LITE_A3) | 1686 | hw->chip_rev >= CHIP_REV_YU_LITE_A3) |
1705 | skge_write32(hw, B2_GP_IO, | 1687 | skge_write32(hw, B2_GP_IO, |
1706 | (skge_read32(hw, B2_GP_IO) | GP_DIR_9) | 1688 | (skge_read32(hw, B2_GP_IO) | GP_DIR_9) |
1707 | & ~GP_IO_9); | 1689 | & ~GP_IO_9); |
@@ -1745,9 +1727,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port) | |||
1745 | gma_write16(hw, port, GM_GP_CTRL, reg); | 1727 | gma_write16(hw, port, GM_GP_CTRL, reg); |
1746 | skge_read16(hw, GMAC_IRQ_SRC); | 1728 | skge_read16(hw, GMAC_IRQ_SRC); |
1747 | 1729 | ||
1748 | spin_lock_bh(&hw->phy_lock); | ||
1749 | yukon_init(hw, port); | 1730 | yukon_init(hw, port); |
1750 | spin_unlock_bh(&hw->phy_lock); | ||
1751 | 1731 | ||
1752 | /* MIB clear */ | 1732 | /* MIB clear */ |
1753 | reg = gma_read16(hw, port, GM_PHY_ADDR); | 1733 | reg = gma_read16(hw, port, GM_PHY_ADDR); |
@@ -1796,7 +1776,7 @@ static void yukon_mac_init(struct skge_hw *hw, int port) | |||
1796 | skge_write16(hw, SK_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); | 1776 | skge_write16(hw, SK_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); |
1797 | reg = GMF_OPER_ON | GMF_RX_F_FL_ON; | 1777 | reg = GMF_OPER_ON | GMF_RX_F_FL_ON; |
1798 | if (hw->chip_id == CHIP_ID_YUKON_LITE && | 1778 | if (hw->chip_id == CHIP_ID_YUKON_LITE && |
1799 | hw->chip_rev == CHIP_REV_YU_LITE_A3) | 1779 | hw->chip_rev >= CHIP_REV_YU_LITE_A3) |
1800 | reg &= ~GMF_RX_F_FL_ON; | 1780 | reg &= ~GMF_RX_F_FL_ON; |
1801 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); | 1781 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); |
1802 | skge_write16(hw, SK_REG(port, RX_GMF_CTRL_T), reg); | 1782 | skge_write16(hw, SK_REG(port, RX_GMF_CTRL_T), reg); |
@@ -1813,19 +1793,19 @@ static void yukon_stop(struct skge_port *skge) | |||
1813 | int port = skge->port; | 1793 | int port = skge->port; |
1814 | 1794 | ||
1815 | if (hw->chip_id == CHIP_ID_YUKON_LITE && | 1795 | if (hw->chip_id == CHIP_ID_YUKON_LITE && |
1816 | hw->chip_rev == CHIP_REV_YU_LITE_A3) { | 1796 | hw->chip_rev >= CHIP_REV_YU_LITE_A3) { |
1817 | skge_write32(hw, B2_GP_IO, | 1797 | skge_write32(hw, B2_GP_IO, |
1818 | skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); | 1798 | skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); |
1819 | } | 1799 | } |
1820 | 1800 | ||
1821 | gma_write16(hw, port, GM_GP_CTRL, | 1801 | gma_write16(hw, port, GM_GP_CTRL, |
1822 | gma_read16(hw, port, GM_GP_CTRL) | 1802 | gma_read16(hw, port, GM_GP_CTRL) |
1823 | & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); | 1803 | & ~(GM_GPCR_TX_ENA|GM_GPCR_RX_ENA)); |
1824 | gma_read16(hw, port, GM_GP_CTRL); | 1804 | gma_read16(hw, port, GM_GP_CTRL); |
1825 | 1805 | ||
1826 | /* set GPHY Control reset */ | 1806 | /* set GPHY Control reset */ |
1827 | gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); | 1807 | skge_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); |
1828 | gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); | 1808 | skge_write32(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); |
1829 | } | 1809 | } |
1830 | 1810 | ||
1831 | static void yukon_get_stats(struct skge_port *skge, u64 *data) | 1811 | static void yukon_get_stats(struct skge_port *skge, u64 *data) |
@@ -1856,11 +1836,12 @@ static void yukon_mac_intr(struct skge_hw *hw, int port) | |||
1856 | 1836 | ||
1857 | if (status & GM_IS_RX_FF_OR) { | 1837 | if (status & GM_IS_RX_FF_OR) { |
1858 | ++skge->net_stats.rx_fifo_errors; | 1838 | ++skge->net_stats.rx_fifo_errors; |
1859 | gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); | 1839 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); |
1860 | } | 1840 | } |
1841 | |||
1861 | if (status & GM_IS_TX_FF_UR) { | 1842 | if (status & GM_IS_TX_FF_UR) { |
1862 | ++skge->net_stats.tx_fifo_errors; | 1843 | ++skge->net_stats.tx_fifo_errors; |
1863 | gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); | 1844 | skge_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU); |
1864 | } | 1845 | } |
1865 | 1846 | ||
1866 | } | 1847 | } |
@@ -1896,7 +1877,7 @@ static void yukon_link_up(struct skge_port *skge) | |||
1896 | reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; | 1877 | reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; |
1897 | gma_write16(hw, port, GM_GP_CTRL, reg); | 1878 | gma_write16(hw, port, GM_GP_CTRL, reg); |
1898 | 1879 | ||
1899 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); | 1880 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_DEF_MSK); |
1900 | skge_link_up(skge); | 1881 | skge_link_up(skge); |
1901 | } | 1882 | } |
1902 | 1883 | ||
@@ -1904,12 +1885,14 @@ static void yukon_link_down(struct skge_port *skge) | |||
1904 | { | 1885 | { |
1905 | struct skge_hw *hw = skge->hw; | 1886 | struct skge_hw *hw = skge->hw; |
1906 | int port = skge->port; | 1887 | int port = skge->port; |
1888 | u16 ctrl; | ||
1907 | 1889 | ||
1908 | pr_debug("yukon_link_down\n"); | 1890 | pr_debug("yukon_link_down\n"); |
1909 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); | 1891 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); |
1910 | gm_phy_write(hw, port, GM_GP_CTRL, | 1892 | |
1911 | gm_phy_read(hw, port, GM_GP_CTRL) | 1893 | ctrl = gma_read16(hw, port, GM_GP_CTRL); |
1912 | & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); | 1894 | ctrl &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); |
1895 | gma_write16(hw, port, GM_GP_CTRL, ctrl); | ||
1913 | 1896 | ||
1914 | if (skge->flow_control == FLOW_MODE_REM_SEND) { | 1897 | if (skge->flow_control == FLOW_MODE_REM_SEND) { |
1915 | /* restore Asymmetric Pause bit */ | 1898 | /* restore Asymmetric Pause bit */ |
@@ -2097,10 +2080,12 @@ static int skge_up(struct net_device *dev) | |||
2097 | skge_write32(hw, B0_IMSK, hw->intr_mask); | 2080 | skge_write32(hw, B0_IMSK, hw->intr_mask); |
2098 | 2081 | ||
2099 | /* Initialze MAC */ | 2082 | /* Initialze MAC */ |
2083 | spin_lock_bh(&hw->phy_lock); | ||
2100 | if (hw->chip_id == CHIP_ID_GENESIS) | 2084 | if (hw->chip_id == CHIP_ID_GENESIS) |
2101 | genesis_mac_init(hw, port); | 2085 | genesis_mac_init(hw, port); |
2102 | else | 2086 | else |
2103 | yukon_mac_init(hw, port); | 2087 | yukon_mac_init(hw, port); |
2088 | spin_unlock_bh(&hw->phy_lock); | ||
2104 | 2089 | ||
2105 | /* Configure RAMbuffers */ | 2090 | /* Configure RAMbuffers */ |
2106 | chunk = hw->ram_size / ((hw->ports + 1)*2); | 2091 | chunk = hw->ram_size / ((hw->ports + 1)*2); |
@@ -2116,6 +2101,7 @@ static int skge_up(struct net_device *dev) | |||
2116 | /* Start receiver BMU */ | 2101 | /* Start receiver BMU */ |
2117 | wmb(); | 2102 | wmb(); |
2118 | skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); | 2103 | skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); |
2104 | skge_led(skge, LED_MODE_ON); | ||
2119 | 2105 | ||
2120 | pr_debug("skge_up completed\n"); | 2106 | pr_debug("skge_up completed\n"); |
2121 | return 0; | 2107 | return 0; |
@@ -2140,8 +2126,6 @@ static int skge_down(struct net_device *dev) | |||
2140 | 2126 | ||
2141 | netif_stop_queue(dev); | 2127 | netif_stop_queue(dev); |
2142 | 2128 | ||
2143 | del_timer_sync(&skge->led_blink); | ||
2144 | |||
2145 | /* Stop transmitter */ | 2129 | /* Stop transmitter */ |
2146 | skge_write8(hw, Q_ADDR(txqaddr[port], Q_CSR), CSR_STOP); | 2130 | skge_write8(hw, Q_ADDR(txqaddr[port], Q_CSR), CSR_STOP); |
2147 | skge_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), | 2131 | skge_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), |
@@ -2175,15 +2159,12 @@ static int skge_down(struct net_device *dev) | |||
2175 | if (hw->chip_id == CHIP_ID_GENESIS) { | 2159 | if (hw->chip_id == CHIP_ID_GENESIS) { |
2176 | skge_write8(hw, SK_REG(port, TX_MFF_CTRL2), MFF_RST_SET); | 2160 | skge_write8(hw, SK_REG(port, TX_MFF_CTRL2), MFF_RST_SET); |
2177 | skge_write8(hw, SK_REG(port, RX_MFF_CTRL2), MFF_RST_SET); | 2161 | skge_write8(hw, SK_REG(port, RX_MFF_CTRL2), MFF_RST_SET); |
2178 | skge_write8(hw, SK_REG(port, TX_LED_CTRL), LED_STOP); | ||
2179 | skge_write8(hw, SK_REG(port, RX_LED_CTRL), LED_STOP); | ||
2180 | } else { | 2162 | } else { |
2181 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); | 2163 | skge_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); |
2182 | skge_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); | 2164 | skge_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); |
2183 | } | 2165 | } |
2184 | 2166 | ||
2185 | /* turn off led's */ | 2167 | skge_led(skge, LED_MODE_OFF); |
2186 | skge_write16(hw, B0_LED, LED_STAT_OFF); | ||
2187 | 2168 | ||
2188 | skge_tx_clean(skge); | 2169 | skge_tx_clean(skge); |
2189 | skge_rx_clean(skge); | 2170 | skge_rx_clean(skge); |
@@ -2633,11 +2614,17 @@ static inline void skge_tx_intr(struct net_device *dev) | |||
2633 | spin_unlock(&skge->tx_lock); | 2614 | spin_unlock(&skge->tx_lock); |
2634 | } | 2615 | } |
2635 | 2616 | ||
2617 | /* Parity errors seem to happen when Genesis is connected to a switch | ||
2618 | * with no other ports present. Heartbeat error?? | ||
2619 | */ | ||
2636 | static void skge_mac_parity(struct skge_hw *hw, int port) | 2620 | static void skge_mac_parity(struct skge_hw *hw, int port) |
2637 | { | 2621 | { |
2638 | printk(KERN_ERR PFX "%s: mac data parity error\n", | 2622 | struct net_device *dev = hw->dev[port]; |
2639 | hw->dev[port] ? hw->dev[port]->name | 2623 | |
2640 | : (port == 0 ? "(port A)": "(port B")); | 2624 | if (dev) { |
2625 | struct skge_port *skge = netdev_priv(dev); | ||
2626 | ++skge->net_stats.tx_heartbeat_errors; | ||
2627 | } | ||
2641 | 2628 | ||
2642 | if (hw->chip_id == CHIP_ID_GENESIS) | 2629 | if (hw->chip_id == CHIP_ID_GENESIS) |
2643 | skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), | 2630 | skge_write16(hw, SK_REG(port, TX_MFF_CTRL1), |
@@ -3083,10 +3070,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3083 | 3070 | ||
3084 | spin_lock_init(&skge->tx_lock); | 3071 | spin_lock_init(&skge->tx_lock); |
3085 | 3072 | ||
3086 | init_timer(&skge->led_blink); | ||
3087 | skge->led_blink.function = skge_blink_timer; | ||
3088 | skge->led_blink.data = (unsigned long) skge; | ||
3089 | |||
3090 | if (hw->chip_id != CHIP_ID_GENESIS) { | 3073 | if (hw->chip_id != CHIP_ID_GENESIS) { |
3091 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 3074 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
3092 | skge->rx_csum = 1; | 3075 | skge->rx_csum = 1; |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index fced3d2bc072..b432f1bb8168 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -1449,10 +1449,12 @@ enum { | |||
1449 | PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ | 1449 | PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ |
1450 | PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ | 1450 | PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ |
1451 | PHY_M_IS_JABBER = 1<<0, /* Jabber */ | 1451 | PHY_M_IS_JABBER = 1<<0, /* Jabber */ |
1452 | }; | ||
1453 | 1452 | ||
1454 | #define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \ | 1453 | PHY_M_IS_DEF_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | |
1455 | PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR) | 1454 | PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR, |
1455 | |||
1456 | PHY_M_IS_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL, | ||
1457 | }; | ||
1456 | 1458 | ||
1457 | /***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ | 1459 | /***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ |
1458 | enum { | 1460 | enum { |
@@ -1509,7 +1511,7 @@ enum { | |||
1509 | PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ | 1511 | PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ |
1510 | }; | 1512 | }; |
1511 | 1513 | ||
1512 | #define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK) | 1514 | #define PHY_M_LED_PULS_DUR(x) (((x)<<12) & PHY_M_LEDC_PULS_MSK) |
1513 | 1515 | ||
1514 | enum { | 1516 | enum { |
1515 | PULS_NO_STR = 0,/* no pulse stretching */ | 1517 | PULS_NO_STR = 0,/* no pulse stretching */ |
@@ -1522,7 +1524,7 @@ enum { | |||
1522 | PULS_1300MS = 7,/* 1.3 s to 2.7 s */ | 1524 | PULS_1300MS = 7,/* 1.3 s to 2.7 s */ |
1523 | }; | 1525 | }; |
1524 | 1526 | ||
1525 | #define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK) | 1527 | #define PHY_M_LED_BLINK_RT(x) (((x)<<8) & PHY_M_LEDC_BL_R_MSK) |
1526 | 1528 | ||
1527 | enum { | 1529 | enum { |
1528 | BLINK_42MS = 0,/* 42 ms */ | 1530 | BLINK_42MS = 0,/* 42 ms */ |
@@ -1602,9 +1604,9 @@ enum { | |||
1602 | PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ | 1604 | PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ |
1603 | }; | 1605 | }; |
1604 | 1606 | ||
1605 | #define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK) | 1607 | #define PHY_M_FELP_LED2_CTRL(x) (((x)<<8) & PHY_M_FELP_LED2_MSK) |
1606 | #define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK) | 1608 | #define PHY_M_FELP_LED1_CTRL(x) (((x)<<4) & PHY_M_FELP_LED1_MSK) |
1607 | #define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK) | 1609 | #define PHY_M_FELP_LED0_CTRL(x) (((x)<<0) & PHY_M_FELP_LED0_MSK) |
1608 | 1610 | ||
1609 | enum { | 1611 | enum { |
1610 | LED_PAR_CTRL_COLX = 0x00, | 1612 | LED_PAR_CTRL_COLX = 0x00, |
@@ -1640,7 +1642,7 @@ enum { | |||
1640 | PHY_M_MAC_MD_COPPER = 5,/* Copper only */ | 1642 | PHY_M_MAC_MD_COPPER = 5,/* Copper only */ |
1641 | PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ | 1643 | PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ |
1642 | }; | 1644 | }; |
1643 | #define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK) | 1645 | #define PHY_M_MAC_MODE_SEL(x) (((x)<<7) & PHY_M_MAC_MD_MSK) |
1644 | 1646 | ||
1645 | /***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ | 1647 | /***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ |
1646 | enum { | 1648 | enum { |
@@ -1650,10 +1652,10 @@ enum { | |||
1650 | PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ | 1652 | PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ |
1651 | }; | 1653 | }; |
1652 | 1654 | ||
1653 | #define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK) | 1655 | #define PHY_M_LEDC_LOS_CTRL(x) (((x)<<12) & PHY_M_LEDC_LOS_MSK) |
1654 | #define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK) | 1656 | #define PHY_M_LEDC_INIT_CTRL(x) (((x)<<8) & PHY_M_LEDC_INIT_MSK) |
1655 | #define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK) | 1657 | #define PHY_M_LEDC_STA1_CTRL(x) (((x)<<4) & PHY_M_LEDC_STA1_MSK) |
1656 | #define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK) | 1658 | #define PHY_M_LEDC_STA0_CTRL(x) (((x)<<0) & PHY_M_LEDC_STA0_MSK) |
1657 | 1659 | ||
1658 | /* GMAC registers */ | 1660 | /* GMAC registers */ |
1659 | /* Port Registers */ | 1661 | /* Port Registers */ |
@@ -2505,8 +2507,6 @@ struct skge_port { | |||
2505 | dma_addr_t dma; | 2507 | dma_addr_t dma; |
2506 | unsigned long mem_size; | 2508 | unsigned long mem_size; |
2507 | unsigned int rx_buf_size; | 2509 | unsigned int rx_buf_size; |
2508 | |||
2509 | struct timer_list led_blink; | ||
2510 | }; | 2510 | }; |
2511 | 2511 | ||
2512 | 2512 | ||
@@ -2606,17 +2606,6 @@ static inline void gma_write16(const struct skge_hw *hw, int port, int r, u16 v) | |||
2606 | skge_write16(hw, SK_GMAC_REG(port,r), v); | 2606 | skge_write16(hw, SK_GMAC_REG(port,r), v); |
2607 | } | 2607 | } |
2608 | 2608 | ||
2609 | static inline void gma_write32(const struct skge_hw *hw, int port, int r, u32 v) | ||
2610 | { | ||
2611 | skge_write16(hw, SK_GMAC_REG(port, r), (u16) v); | ||
2612 | skge_write32(hw, SK_GMAC_REG(port, r+4), (u16)(v >> 16)); | ||
2613 | } | ||
2614 | |||
2615 | static inline void gma_write8(const struct skge_hw *hw, int port, int r, u8 v) | ||
2616 | { | ||
2617 | skge_write8(hw, SK_GMAC_REG(port,r), v); | ||
2618 | } | ||
2619 | |||
2620 | static inline void gma_set_addr(struct skge_hw *hw, int port, int reg, | 2609 | static inline void gma_set_addr(struct skge_hw *hw, int port, int reg, |
2621 | const u8 *addr) | 2610 | const u8 *addr) |
2622 | { | 2611 | { |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 7089d86e857a..a9b06b8d8e3f 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -188,7 +188,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
188 | #define SMC_IRQ_TRIGGER_TYPE (( \ | 188 | #define SMC_IRQ_TRIGGER_TYPE (( \ |
189 | machine_is_omap_h2() \ | 189 | machine_is_omap_h2() \ |
190 | || machine_is_omap_h3() \ | 190 | || machine_is_omap_h3() \ |
191 | || (machine_is_omap_innovator() && !cpu_is_omap150()) \ | 191 | || (machine_is_omap_innovator() && !cpu_is_omap1510()) \ |
192 | ) ? IRQT_FALLING : IRQT_RISING) | 192 | ) ? IRQT_FALLING : IRQT_RISING) |
193 | 193 | ||
194 | 194 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 201a550f0bcc..6d4ab1e333b5 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -66,8 +66,8 @@ | |||
66 | 66 | ||
67 | #define DRV_MODULE_NAME "tg3" | 67 | #define DRV_MODULE_NAME "tg3" |
68 | #define PFX DRV_MODULE_NAME ": " | 68 | #define PFX DRV_MODULE_NAME ": " |
69 | #define DRV_MODULE_VERSION "3.34" | 69 | #define DRV_MODULE_VERSION "3.37" |
70 | #define DRV_MODULE_RELDATE "July 25, 2005" | 70 | #define DRV_MODULE_RELDATE "August 25, 2005" |
71 | 71 | ||
72 | #define TG3_DEF_MAC_MODE 0 | 72 | #define TG3_DEF_MAC_MODE 0 |
73 | #define TG3_DEF_RX_MODE 0 | 73 | #define TG3_DEF_RX_MODE 0 |
@@ -7865,8 +7865,6 @@ static int tg3_test_loopback(struct tg3 *tp) | |||
7865 | 7865 | ||
7866 | err = -EIO; | 7866 | err = -EIO; |
7867 | 7867 | ||
7868 | tg3_abort_hw(tp, 1); | ||
7869 | |||
7870 | tg3_reset_hw(tp); | 7868 | tg3_reset_hw(tp); |
7871 | 7869 | ||
7872 | mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) | | 7870 | mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) | |
@@ -8970,6 +8968,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) | |||
8970 | tp->phy_id = hw_phy_id; | 8968 | tp->phy_id = hw_phy_id; |
8971 | if (hw_phy_id_masked == PHY_ID_BCM8002) | 8969 | if (hw_phy_id_masked == PHY_ID_BCM8002) |
8972 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 8970 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
8971 | else | ||
8972 | tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES; | ||
8973 | } else { | 8973 | } else { |
8974 | if (tp->phy_id != PHY_ID_INVALID) { | 8974 | if (tp->phy_id != PHY_ID_INVALID) { |
8975 | /* Do nothing, phy ID already set up in | 8975 | /* Do nothing, phy ID already set up in |
@@ -10421,6 +10421,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10421 | 10421 | ||
10422 | tg3_init_coal(tp); | 10422 | tg3_init_coal(tp); |
10423 | 10423 | ||
10424 | /* Now that we have fully setup the chip, save away a snapshot | ||
10425 | * of the PCI config space. We need to restore this after | ||
10426 | * GRC_MISC_CFG core clock resets and some resume events. | ||
10427 | */ | ||
10428 | pci_save_state(tp->pdev); | ||
10429 | |||
10424 | err = register_netdev(dev); | 10430 | err = register_netdev(dev); |
10425 | if (err) { | 10431 | if (err) { |
10426 | printk(KERN_ERR PFX "Cannot register net device, " | 10432 | printk(KERN_ERR PFX "Cannot register net device, " |
@@ -10430,12 +10436,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10430 | 10436 | ||
10431 | pci_set_drvdata(pdev, dev); | 10437 | pci_set_drvdata(pdev, dev); |
10432 | 10438 | ||
10433 | /* Now that we have fully setup the chip, save away a snapshot | ||
10434 | * of the PCI config space. We need to restore this after | ||
10435 | * GRC_MISC_CFG core clock resets and some resume events. | ||
10436 | */ | ||
10437 | pci_save_state(tp->pdev); | ||
10438 | |||
10439 | printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", | 10439 | printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", |
10440 | dev->name, | 10440 | dev->name, |
10441 | tp->board_part_number, | 10441 | tp->board_part_number, |
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig index 23d0fa4bbceb..7e99e9f8045e 100644 --- a/drivers/net/tokenring/Kconfig +++ b/drivers/net/tokenring/Kconfig | |||
@@ -84,7 +84,7 @@ config 3C359 | |||
84 | 84 | ||
85 | config TMS380TR | 85 | config TMS380TR |
86 | tristate "Generic TMS380 Token Ring ISA/PCI adapter support" | 86 | tristate "Generic TMS380 Token Ring ISA/PCI adapter support" |
87 | depends on TR && (PCI || ISA) | 87 | depends on TR && (PCI || ISA && ISA_DMA_API) |
88 | select FW_LOADER | 88 | select FW_LOADER |
89 | ---help--- | 89 | ---help--- |
90 | This driver provides generic support for token ring adapters | 90 | This driver provides generic support for token ring adapters |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index 1d3231cc471a..ec3f75a030d2 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -270,7 +270,7 @@ config PCMCIA_HERMES | |||
270 | 270 | ||
271 | config AIRO_CS | 271 | config AIRO_CS |
272 | tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards" | 272 | tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards" |
273 | depends on NET_RADIO && PCMCIA | 273 | depends on NET_RADIO && PCMCIA && (BROKEN || !M32R) |
274 | ---help--- | 274 | ---help--- |
275 | This is the standard Linux driver to support Cisco/Aironet PCMCIA | 275 | This is the standard Linux driver to support Cisco/Aironet PCMCIA |
276 | 802.11 wireless cards. This driver is the same as the Aironet | 276 | 802.11 wireless cards. This driver is the same as the Aironet |
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig index 16a2e6ae37f4..725a14119f2a 100644 --- a/drivers/parport/Kconfig +++ b/drivers/parport/Kconfig | |||
@@ -34,7 +34,7 @@ config PARPORT | |||
34 | 34 | ||
35 | config PARPORT_PC | 35 | config PARPORT_PC |
36 | tristate "PC-style hardware" | 36 | tristate "PC-style hardware" |
37 | depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 | 37 | depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 && !M32R |
38 | ---help--- | 38 | ---help--- |
39 | You should say Y here if you have a PC-style parallel port. All | 39 | You should say Y here if you have a PC-style parallel port. All |
40 | IBM PC compatible computers and some Alphas have PC-style | 40 | IBM PC compatible computers and some Alphas have PC-style |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index fedae89d8f7d..fb9a11243d2a 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -60,7 +60,9 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
60 | continue; | 60 | continue; |
61 | 61 | ||
62 | /* Ok, try it out.. */ | 62 | /* Ok, try it out.. */ |
63 | ret = allocate_resource(r, res, size, min, -1, align, | 63 | ret = allocate_resource(r, res, size, |
64 | r->start ? : min, | ||
65 | -1, align, | ||
64 | alignf, alignf_data); | 66 | alignf, alignf_data); |
65 | if (ret == 0) | 67 | if (ret == 0) |
66 | break; | 68 | break; |
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 46b294a12418..2b92b9e8c910 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | #ifndef _PCIEHP_H | 29 | #ifndef _PCIEHP_H |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index df4915dbc321..cafc7eadcf80 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 0dbcf04aa35e..0e0947601526 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1cda30bd6e47..7a0e27f0e063 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 723b12c0bb7c..33b539b34f7e 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm.h b/drivers/pci/hotplug/pciehprm.h index 966775ffb0ff..05f20fbc5f50 100644 --- a/drivers/pci/hotplug/pciehprm.h +++ b/drivers/pci/hotplug/pciehprm.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c index 57f4e6d1b27c..305b47ec2f2c 100644 --- a/drivers/pci/hotplug/pciehprm_acpi.c +++ b/drivers/pci/hotplug/pciehprm_acpi.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | * | 22 | * |
23 | * Send feedback to <dely.l.sy@intel.com> | 23 | * Send feedback to <kristen.c.accardi@intel.com> |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c index 79a0aa6238ef..3622965f8961 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.c +++ b/drivers/pci/hotplug/pciehprm_nonacpi.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.h b/drivers/pci/hotplug/pciehprm_nonacpi.h index 87c90e85ede9..b10603b0e958 100644 --- a/drivers/pci/hotplug/pciehprm_nonacpi.h +++ b/drivers/pci/hotplug/pciehprm_nonacpi.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index 67b6a3370ceb..fe4d653da188 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | #ifndef _SHPCHP_H | 29 | #ifndef _SHPCHP_H |
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index a70a5c5705f2..6f7d8a29957a 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 490a9553a062..783b5abb0717 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 38c5d9066697..8d98410bf1c0 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c index 90113e9cd69b..d867099114ec 100644 --- a/drivers/pci/hotplug/shpchp_pci.c +++ b/drivers/pci/hotplug/shpchp_pci.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm.h b/drivers/pci/hotplug/shpchprm.h index 88aeb978c911..057b192ce589 100644 --- a/drivers/pci/hotplug/shpchprm.h +++ b/drivers/pci/hotplug/shpchprm.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c index 7957cdc72cd0..d37b31658edf 100644 --- a/drivers/pci/hotplug/shpchprm_acpi.c +++ b/drivers/pci/hotplug/shpchprm_acpi.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * along with this program; if not, write to the Free Software | 20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | * | 22 | * |
23 | * Send feedback to <dely.l.sy@intel.com> | 23 | * Send feedback to <kristen.c.accardi@intel.com> |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
diff --git a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c index 37fa77a98289..ba6c549c9b9d 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.c +++ b/drivers/pci/hotplug/shpchprm_legacy.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>,<dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>,<kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_legacy.h b/drivers/pci/hotplug/shpchprm_legacy.h index 29ccea5e57e5..21bda74ddfa5 100644 --- a/drivers/pci/hotplug/shpchprm_legacy.h +++ b/drivers/pci/hotplug/shpchprm_legacy.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c index 88f4d9f41886..5f75ef7f3df2 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.c +++ b/drivers/pci/hotplug/shpchprm_nonacpi.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.h b/drivers/pci/hotplug/shpchprm_nonacpi.h index 6bc8668023c3..cddaaa5ee1b3 100644 --- a/drivers/pci/hotplug/shpchprm_nonacpi.h +++ b/drivers/pci/hotplug/shpchprm_nonacpi.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * along with this program; if not, write to the Free Software | 23 | * along with this program; if not, write to the Free Software |
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | * | 25 | * |
26 | * Send feedback to <greg@kroah.com>, <dely.l.sy@intel.com> | 26 | * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> |
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index b5ab9aa6ff7c..2b85aa39f954 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -453,7 +453,7 @@ static void enable_msi_mode(struct pci_dev *dev, int pos, int type) | |||
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
456 | static void disable_msi_mode(struct pci_dev *dev, int pos, int type) | 456 | void disable_msi_mode(struct pci_dev *dev, int pos, int type) |
457 | { | 457 | { |
458 | u16 control; | 458 | u16 control; |
459 | 459 | ||
@@ -699,6 +699,9 @@ int pci_enable_msi(struct pci_dev* dev) | |||
699 | if (!pci_msi_enable || !dev) | 699 | if (!pci_msi_enable || !dev) |
700 | return status; | 700 | return status; |
701 | 701 | ||
702 | if (dev->no_msi) | ||
703 | return status; | ||
704 | |||
702 | temp = dev->irq; | 705 | temp = dev->irq; |
703 | 706 | ||
704 | if ((status = msi_init()) < 0) | 707 | if ((status = msi_init()) < 0) |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index d94d7af4f7a0..d00168b1f662 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -47,6 +47,12 @@ extern int pci_msi_quirk; | |||
47 | #define pci_msi_quirk 0 | 47 | #define pci_msi_quirk 0 |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | #ifdef CONFIG_PCI_MSI | ||
51 | void disable_msi_mode(struct pci_dev *dev, int pos, int type); | ||
52 | #else | ||
53 | static inline void disable_msi_mode(struct pci_dev *dev, int pos, int type) { } | ||
54 | #endif | ||
55 | |||
50 | extern int pcie_mch_quirk; | 56 | extern int pcie_mch_quirk; |
51 | extern struct device_attribute pci_dev_attrs[]; | 57 | extern struct device_attribute pci_dev_attrs[]; |
52 | extern struct class_device_attribute class_device_attr_cpuaffinity; | 58 | extern struct class_device_attribute class_device_attr_cpuaffinity; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 8d0968bd527e..bb36bb69803f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -373,6 +373,25 @@ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev) | |||
373 | } | 373 | } |
374 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi ); | 374 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi ); |
375 | 375 | ||
376 | /* | ||
377 | * VIA VT8235 ISA Bridge: Two IO regions pointed to by words at | ||
378 | * 0x88 (128 bytes of power management registers) | ||
379 | * 0xd0 (16 bytes of SMB registers) | ||
380 | */ | ||
381 | static void __devinit quirk_vt8235_acpi(struct pci_dev *dev) | ||
382 | { | ||
383 | u16 pm, smb; | ||
384 | |||
385 | pci_read_config_word(dev, 0x88, &pm); | ||
386 | pm &= PCI_BASE_ADDRESS_IO_MASK; | ||
387 | quirk_io_region(dev, pm, 128, PCI_BRIDGE_RESOURCES); | ||
388 | |||
389 | pci_read_config_word(dev, 0xd0, &smb); | ||
390 | smb &= PCI_BASE_ADDRESS_IO_MASK; | ||
391 | quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 1); | ||
392 | } | ||
393 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); | ||
394 | |||
376 | 395 | ||
377 | #ifdef CONFIG_X86_IO_APIC | 396 | #ifdef CONFIG_X86_IO_APIC |
378 | 397 | ||
@@ -1272,6 +1291,27 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quir | |||
1272 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch ); | 1291 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_pcie_mch ); |
1273 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch ); | 1292 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_pcie_mch ); |
1274 | 1293 | ||
1294 | |||
1295 | /* | ||
1296 | * It's possible for the MSI to get corrupted if shpc and acpi | ||
1297 | * are used together on certain PXH-based systems. | ||
1298 | */ | ||
1299 | static void __devinit quirk_pcie_pxh(struct pci_dev *dev) | ||
1300 | { | ||
1301 | disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI), | ||
1302 | PCI_CAP_ID_MSI); | ||
1303 | dev->no_msi = 1; | ||
1304 | |||
1305 | printk(KERN_WARNING "PCI: PXH quirk detected, " | ||
1306 | "disabling MSI for SHPC device\n"); | ||
1307 | } | ||
1308 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_0, quirk_pcie_pxh); | ||
1309 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHD_1, quirk_pcie_pxh); | ||
1310 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0, quirk_pcie_pxh); | ||
1311 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1, quirk_pcie_pxh); | ||
1312 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXHV, quirk_pcie_pxh); | ||
1313 | |||
1314 | |||
1275 | static void __devinit quirk_netmos(struct pci_dev *dev) | 1315 | static void __devinit quirk_netmos(struct pci_dev *dev) |
1276 | { | 1316 | { |
1277 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; | 1317 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index a2eebc6eaacc..6d864c502a1f 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -40,7 +40,7 @@ | |||
40 | * FIXME: IO should be max 256 bytes. However, since we may | 40 | * FIXME: IO should be max 256 bytes. However, since we may |
41 | * have a P2P bridge below a cardbus bridge, we need 4K. | 41 | * have a P2P bridge below a cardbus bridge, we need 4K. |
42 | */ | 42 | */ |
43 | #define CARDBUS_IO_SIZE (4096) | 43 | #define CARDBUS_IO_SIZE (256) |
44 | #define CARDBUS_MEM_SIZE (32*1024*1024) | 44 | #define CARDBUS_MEM_SIZE (32*1024*1024) |
45 | 45 | ||
46 | static void __devinit | 46 | static void __devinit |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1ca21d2ba11c..5598b4714f77 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -33,6 +33,11 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
33 | u32 new, check, mask; | 33 | u32 new, check, mask; |
34 | int reg; | 34 | int reg; |
35 | 35 | ||
36 | /* Ignore resources for unimplemented BARs and unused resource slots | ||
37 | for 64 bit BARs. */ | ||
38 | if (!res->flags) | ||
39 | return; | ||
40 | |||
36 | pcibios_resource_to_bus(dev, ®ion, res); | 41 | pcibios_resource_to_bus(dev, ®ion, res); |
37 | 42 | ||
38 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " | 43 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " |
@@ -48,7 +53,9 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
48 | if (resno < 6) { | 53 | if (resno < 6) { |
49 | reg = PCI_BASE_ADDRESS_0 + 4 * resno; | 54 | reg = PCI_BASE_ADDRESS_0 + 4 * resno; |
50 | } else if (resno == PCI_ROM_RESOURCE) { | 55 | } else if (resno == PCI_ROM_RESOURCE) { |
51 | new |= res->flags & IORESOURCE_ROM_ENABLE; | 56 | if (!(res->flags & IORESOURCE_ROM_ENABLE)) |
57 | return; | ||
58 | new |= PCI_ROM_ADDRESS_ENABLE; | ||
52 | reg = dev->rom_base_reg; | 59 | reg = dev->rom_base_reg; |
53 | } else { | 60 | } else { |
54 | /* Hmm, non-standard resource. */ | 61 | /* Hmm, non-standard resource. */ |
@@ -67,7 +74,7 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
67 | 74 | ||
68 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == | 75 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == |
69 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { | 76 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { |
70 | new = 0; /* currently everyone zeros the high address */ | 77 | new = region.start >> 16 >> 16; |
71 | pci_write_config_dword(dev, reg + 4, new); | 78 | pci_write_config_dword(dev, reg + 4, new); |
72 | pci_read_config_dword(dev, reg + 4, &check); | 79 | pci_read_config_dword(dev, reg + 4, &check); |
73 | if (check != new) { | 80 | if (check != new) { |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index d63f22a5bf7e..43da2e92d50f 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -589,8 +589,8 @@ static void pcmcia_delayed_add_pseudo_device(void *data) | |||
589 | static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s) | 589 | static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s) |
590 | { | 590 | { |
591 | if (!s->pcmcia_state.device_add_pending) { | 591 | if (!s->pcmcia_state.device_add_pending) { |
592 | schedule_work(&s->device_add); | ||
593 | s->pcmcia_state.device_add_pending = 1; | 592 | s->pcmcia_state.device_add_pending = 1; |
593 | schedule_work(&s->device_add); | ||
594 | } | 594 | } |
595 | return; | 595 | return; |
596 | } | 596 | } |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 6f9fdb276402..599b116d9747 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -41,6 +41,7 @@ module_param(io_speed, int, 0444); | |||
41 | 41 | ||
42 | 42 | ||
43 | #ifdef CONFIG_PCMCIA_PROBE | 43 | #ifdef CONFIG_PCMCIA_PROBE |
44 | #include <asm/irq.h> | ||
44 | /* mask of IRQs already reserved by other cards, we should avoid using them */ | 45 | /* mask of IRQs already reserved by other cards, we should avoid using them */ |
45 | static u8 pcmcia_used_irq[NR_IRQS]; | 46 | static u8 pcmcia_used_irq[NR_IRQS]; |
46 | #endif | 47 | #endif |
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 744e469a9eda..62fd705203fb 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, | |||
605 | 605 | ||
606 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) | 606 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) |
607 | { | 607 | { |
608 | struct pci_bus *bus; | ||
609 | struct resource *root, *res; | 608 | struct resource *root, *res; |
610 | u32 start, end; | 609 | struct pci_bus_region region; |
611 | unsigned mask; | 610 | unsigned mask; |
612 | 611 | ||
613 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; | 612 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; |
@@ -620,15 +619,13 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
620 | if (type & IORESOURCE_IO) | 619 | if (type & IORESOURCE_IO) |
621 | mask = ~3; | 620 | mask = ~3; |
622 | 621 | ||
623 | bus = socket->dev->subordinate; | 622 | res->name = socket->dev->subordinate->name; |
624 | res->name = bus->name; | ||
625 | res->flags = type; | 623 | res->flags = type; |
626 | 624 | ||
627 | start = config_readl(socket, addr_start) & mask; | 625 | region.start = config_readl(socket, addr_start) & mask; |
628 | end = config_readl(socket, addr_end) | ~mask; | 626 | region.end = config_readl(socket, addr_end) | ~mask; |
629 | if (start && end > start && !override_bios) { | 627 | if (region.start && region.end > region.start && !override_bios) { |
630 | res->start = start; | 628 | pcibios_bus_to_resource(socket->dev, res, ®ion); |
631 | res->end = end; | ||
632 | root = pci_find_parent_resource(socket->dev, res); | 629 | root = pci_find_parent_resource(socket->dev, res); |
633 | if (root && (request_resource(root, res) == 0)) | 630 | if (root && (request_resource(root, res) == 0)) |
634 | return; | 631 | return; |
@@ -642,6 +639,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
642 | (yenta_search_res(socket, res, BRIDGE_IO_MIN))) { | 639 | (yenta_search_res(socket, res, BRIDGE_IO_MIN))) { |
643 | config_writel(socket, addr_start, res->start); | 640 | config_writel(socket, addr_start, res->start); |
644 | config_writel(socket, addr_end, res->end); | 641 | config_writel(socket, addr_end, res->end); |
642 | return; | ||
645 | } | 643 | } |
646 | } else { | 644 | } else { |
647 | if (type & IORESOURCE_PREFETCH) { | 645 | if (type & IORESOURCE_PREFETCH) { |
@@ -650,6 +648,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
650 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { | 648 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { |
651 | config_writel(socket, addr_start, res->start); | 649 | config_writel(socket, addr_start, res->start); |
652 | config_writel(socket, addr_end, res->end); | 650 | config_writel(socket, addr_end, res->end); |
651 | return; | ||
653 | } | 652 | } |
654 | /* Approximating prefetchable by non-prefetchable */ | 653 | /* Approximating prefetchable by non-prefetchable */ |
655 | res->flags = IORESOURCE_MEM; | 654 | res->flags = IORESOURCE_MEM; |
@@ -659,6 +658,7 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
659 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { | 658 | (yenta_search_res(socket, res, BRIDGE_MEM_MIN))) { |
660 | config_writel(socket, addr_start, res->start); | 659 | config_writel(socket, addr_start, res->start); |
661 | config_writel(socket, addr_end, res->end); | 660 | config_writel(socket, addr_end, res->end); |
661 | return; | ||
662 | } | 662 | } |
663 | } | 663 | } |
664 | 664 | ||
@@ -1107,8 +1107,6 @@ static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state) | |||
1107 | pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); | 1107 | pci_read_config_dword(dev, 17*4, &socket->saved_state[1]); |
1108 | pci_disable_device(dev); | 1108 | pci_disable_device(dev); |
1109 | 1109 | ||
1110 | free_irq(dev->irq, socket); | ||
1111 | |||
1112 | /* | 1110 | /* |
1113 | * Some laptops (IBM T22) do not like us putting the Cardbus | 1111 | * Some laptops (IBM T22) do not like us putting the Cardbus |
1114 | * bridge into D3. At a guess, some other laptop will | 1112 | * bridge into D3. At a guess, some other laptop will |
@@ -1134,13 +1132,6 @@ static int yenta_dev_resume (struct pci_dev *dev) | |||
1134 | pci_enable_device(dev); | 1132 | pci_enable_device(dev); |
1135 | pci_set_master(dev); | 1133 | pci_set_master(dev); |
1136 | 1134 | ||
1137 | if (socket->cb_irq) | ||
1138 | if (request_irq(socket->cb_irq, yenta_interrupt, | ||
1139 | SA_SHIRQ, "yenta", socket)) { | ||
1140 | printk(KERN_WARNING "Yenta: request_irq() failed on resume!\n"); | ||
1141 | socket->cb_irq = 0; | ||
1142 | } | ||
1143 | |||
1144 | if (socket->type && socket->type->restore_state) | 1135 | if (socket->type && socket->type->restore_state) |
1145 | socket->type->restore_state(socket); | 1136 | socket->type->restore_state(socket); |
1146 | } | 1137 | } |
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index add12f7c489a..6e5229e92fbc 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c | |||
@@ -312,6 +312,8 @@ found: | |||
312 | if (drv->link.driver.probe) { | 312 | if (drv->link.driver.probe) { |
313 | if (drv->link.driver.probe(&dev->dev)) { | 313 | if (drv->link.driver.probe(&dev->dev)) { |
314 | dev->dev.driver = NULL; | 314 | dev->dev.driver = NULL; |
315 | dev->card_link = NULL; | ||
316 | up_write(&dev->dev.bus->subsys.rwsem); | ||
315 | return NULL; | 317 | return NULL; |
316 | } | 318 | } |
317 | } | 319 | } |
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index d36258d6665f..381f339e3200 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -112,7 +112,7 @@ qdio_min(int a,int b) | |||
112 | 112 | ||
113 | /***************** SCRUBBER HELPER ROUTINES **********************/ | 113 | /***************** SCRUBBER HELPER ROUTINES **********************/ |
114 | 114 | ||
115 | static inline volatile __u64 | 115 | static inline __u64 |
116 | qdio_get_micros(void) | 116 | qdio_get_micros(void) |
117 | { | 117 | { |
118 | return (get_clock() >> 10); /* time>>12 is microseconds */ | 118 | return (get_clock() >> 10); /* time>>12 is microseconds */ |
@@ -230,7 +230,7 @@ qdio_siga_input(struct qdio_q *q) | |||
230 | } | 230 | } |
231 | 231 | ||
232 | /* locked by the locks in qdio_activate and qdio_cleanup */ | 232 | /* locked by the locks in qdio_activate and qdio_cleanup */ |
233 | static __u32 * volatile | 233 | static __u32 volatile * |
234 | qdio_get_indicator(void) | 234 | qdio_get_indicator(void) |
235 | { | 235 | { |
236 | int i; | 236 | int i; |
diff --git a/drivers/s390/crypto/z90crypt.h b/drivers/s390/crypto/z90crypt.h index 82a1d97001d7..0a3bb5a10dd4 100644 --- a/drivers/s390/crypto/z90crypt.h +++ b/drivers/s390/crypto/z90crypt.h | |||
@@ -36,15 +36,6 @@ | |||
36 | #define z90crypt_VARIANT 2 // 2 = added PCIXCC MCL3 and CEX2C support | 36 | #define z90crypt_VARIANT 2 // 2 = added PCIXCC MCL3 and CEX2C support |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * If we are not using the sparse checker, __user has no use. | ||
40 | */ | ||
41 | #ifdef __CHECKER__ | ||
42 | # define __user __attribute__((noderef, address_space(1))) | ||
43 | #else | ||
44 | # define __user | ||
45 | #endif | ||
46 | |||
47 | /** | ||
48 | * struct ica_rsa_modexpo | 39 | * struct ica_rsa_modexpo |
49 | * | 40 | * |
50 | * Requirements: | 41 | * Requirements: |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 8f4d2999af8e..79c74f3a11f5 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = { | |||
8120 | #endif | 8120 | #endif |
8121 | 8121 | ||
8122 | static int | 8122 | static int |
8123 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) | 8123 | __qeth_reboot_event_card(struct device *dev, void *data) |
8124 | { | 8124 | { |
8125 | |||
8126 | struct device *entry; | ||
8127 | struct qeth_card *card; | 8125 | struct qeth_card *card; |
8128 | 8126 | ||
8129 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8127 | card = (struct qeth_card *) dev->driver_data; |
8130 | list_for_each_entry(entry, &qeth_ccwgroup_driver.driver.devices, | 8128 | qeth_clear_ip_list(card, 0, 0); |
8131 | driver_list) { | 8129 | qeth_qdio_clear_card(card, 0); |
8132 | card = (struct qeth_card *) entry->driver_data; | 8130 | return 0; |
8133 | qeth_clear_ip_list(card, 0, 0); | 8131 | } |
8134 | qeth_qdio_clear_card(card, 0); | 8132 | |
8135 | } | 8133 | static int |
8136 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8134 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) |
8135 | { | ||
8136 | |||
8137 | driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
8138 | __qeth_reboot_event_card); | ||
8137 | return NOTIFY_DONE; | 8139 | return NOTIFY_DONE; |
8138 | } | 8140 | } |
8139 | 8141 | ||
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 04719196fd20..f2ccfea8fdb8 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c | |||
@@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; | |||
27 | #define QETH_PROCFILE_NAME "qeth" | 27 | #define QETH_PROCFILE_NAME "qeth" |
28 | static struct proc_dir_entry *qeth_procfile; | 28 | static struct proc_dir_entry *qeth_procfile; |
29 | 29 | ||
30 | static int | ||
31 | qeth_procfile_seq_match(struct device *dev, void *data) | ||
32 | { | ||
33 | return 1; | ||
34 | } | ||
35 | |||
30 | static void * | 36 | static void * |
31 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) | 37 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) |
32 | { | 38 | { |
33 | struct list_head *next_card = NULL; | 39 | struct device *dev; |
34 | int i = 0; | 40 | loff_t nr; |
35 | 41 | ||
36 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 42 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
37 | 43 | ||
38 | if (*offset == 0) | 44 | nr = *offset; |
45 | if (nr == 0) | ||
39 | return SEQ_START_TOKEN; | 46 | return SEQ_START_TOKEN; |
40 | 47 | ||
41 | /* get card at pos *offset */ | 48 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, |
42 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices) | 49 | NULL, qeth_procfile_seq_match); |
43 | if (++i == *offset) | ||
44 | return next_card; | ||
45 | 50 | ||
46 | return NULL; | 51 | /* get card at pos *offset */ |
52 | nr = *offset; | ||
53 | while (nr-- > 1 && dev) | ||
54 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
55 | NULL, qeth_procfile_seq_match); | ||
56 | return (void *) dev; | ||
47 | } | 57 | } |
48 | 58 | ||
49 | static void | 59 | static void |
@@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it) | |||
55 | static void * | 65 | static void * |
56 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 66 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
57 | { | 67 | { |
58 | struct list_head *next_card = NULL; | 68 | struct device *prev, *next; |
59 | struct list_head *current_card; | ||
60 | 69 | ||
61 | if (it == SEQ_START_TOKEN) { | 70 | if (it == SEQ_START_TOKEN) { |
62 | next_card = qeth_ccwgroup_driver.driver.devices.next; | 71 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
63 | if (next_card->next == next_card) /* list empty */ | 72 | NULL, NULL, qeth_procfile_seq_match); |
64 | return NULL; | 73 | if (next) |
65 | (*offset)++; | 74 | (*offset)++; |
66 | } else { | 75 | return (void *) next; |
67 | current_card = (struct list_head *)it; | ||
68 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
69 | return NULL; /* end of list reached */ | ||
70 | next_card = current_card->next; | ||
71 | (*offset)++; | ||
72 | } | 76 | } |
73 | 77 | prev = (struct device *) it; | |
74 | return next_card; | 78 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
79 | prev, NULL, qeth_procfile_seq_match); | ||
80 | if (next) | ||
81 | (*offset)++; | ||
82 | return (void *) next; | ||
75 | } | 83 | } |
76 | 84 | ||
77 | static inline const char * | 85 | static inline const char * |
@@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) | |||
126 | "-------------- ---- ------ ---------- ---- " | 134 | "-------------- ---- ------ ---------- ---- " |
127 | "---- ----- -----\n"); | 135 | "---- ----- -----\n"); |
128 | } else { | 136 | } else { |
129 | device = list_entry(it, struct device, driver_list); | 137 | device = (struct device *) it; |
130 | card = device->driver_data; | 138 | card = device->driver_data; |
131 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", | 139 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", |
132 | CARD_RDEV_ID(card), | 140 | CARD_RDEV_ID(card), |
@@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile; | |||
180 | static void * | 188 | static void * |
181 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) | 189 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) |
182 | { | 190 | { |
183 | struct list_head *next_card = NULL; | 191 | struct device *dev = NULL; |
184 | int i = 0; | 192 | int nr; |
185 | 193 | ||
186 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 194 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
187 | /* get card at pos *offset */ | 195 | /* get card at pos *offset */ |
188 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 196 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, |
189 | if (i == *offset) | 197 | qeth_procfile_seq_match); |
190 | return next_card; | 198 | |
191 | i++; | 199 | /* get card at pos *offset */ |
192 | } | 200 | nr = *offset; |
193 | return NULL; | 201 | while (nr-- > 1 && dev) |
202 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
203 | NULL, qeth_procfile_seq_match); | ||
204 | return (void *) dev; | ||
194 | } | 205 | } |
195 | 206 | ||
196 | static void | 207 | static void |
@@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) | |||
202 | static void * | 213 | static void * |
203 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 214 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
204 | { | 215 | { |
205 | struct list_head *current_card = (struct list_head *)it; | 216 | struct device *prev, *next; |
206 | 217 | ||
207 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | 218 | prev = (struct device *) it; |
208 | return NULL; /* end of list reached */ | 219 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
209 | (*offset)++; | 220 | NULL, qeth_procfile_seq_match); |
210 | return current_card->next; | 221 | if (next) |
222 | (*offset)++; | ||
223 | return (void *) next; | ||
211 | } | 224 | } |
212 | 225 | ||
213 | static int | 226 | static int |
@@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | |||
216 | struct device *device; | 229 | struct device *device; |
217 | struct qeth_card *card; | 230 | struct qeth_card *card; |
218 | 231 | ||
219 | device = list_entry(it, struct device, driver_list); | 232 | device = (struct device *) it; |
220 | card = device->driver_data; | 233 | card = device->driver_data; |
221 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", | 234 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", |
222 | CARD_RDEV_ID(card), | 235 | CARD_RDEV_ID(card), |
@@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile; | |||
318 | static void * | 331 | static void * |
319 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | 332 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) |
320 | { | 333 | { |
321 | struct list_head *next_card = NULL; | 334 | struct device *dev; |
322 | int i = 0; | 335 | loff_t nr; |
323 | 336 | ||
324 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 337 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
325 | /* TODO: finish this */ | 338 | /* TODO: finish this */ |
@@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | |||
328 | * output driver settings then; | 341 | * output driver settings then; |
329 | * else output setting for respective card | 342 | * else output setting for respective card |
330 | */ | 343 | */ |
344 | |||
345 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
346 | qeth_procfile_seq_match); | ||
347 | |||
331 | /* get card at pos *offset */ | 348 | /* get card at pos *offset */ |
332 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 349 | nr = *offset; |
333 | if (i == *offset) | 350 | while (nr-- > 1 && dev) |
334 | return next_card; | 351 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, |
335 | i++; | 352 | NULL, qeth_procfile_seq_match); |
336 | } | 353 | return (void *) dev; |
337 | return NULL; | ||
338 | } | 354 | } |
339 | 355 | ||
340 | static void | 356 | static void |
@@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) | |||
346 | static void * | 362 | static void * |
347 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 363 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
348 | { | 364 | { |
349 | struct list_head *current_card = (struct list_head *)it; | 365 | struct device *prev, *next; |
350 | 366 | ||
351 | /* TODO: finish this */ | 367 | prev = (struct device *) it; |
352 | /* | 368 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
353 | * maybe SEQ_SATRT_TOKEN can be returned for offset 0 | 369 | NULL, qeth_procfile_seq_match); |
354 | * output driver settings then; | 370 | if (next) |
355 | * else output setting for respective card | 371 | (*offset)++; |
356 | */ | 372 | return (void *) next; |
357 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
358 | return NULL; /* end of list reached */ | ||
359 | (*offset)++; | ||
360 | return current_card->next; | ||
361 | } | 373 | } |
362 | 374 | ||
363 | static int | 375 | static int |
@@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) | |||
372 | * output driver settings then; | 384 | * output driver settings then; |
373 | * else output setting for respective card | 385 | * else output setting for respective card |
374 | */ | 386 | */ |
375 | device = list_entry(it, struct device, driver_list); | 387 | device = (struct device *) it; |
376 | card = device->driver_data; | 388 | card = device->driver_data; |
377 | 389 | ||
378 | return 0; | 390 | return 0; |
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index e17b4d58a9f6..6fed4a532ca3 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -1299,13 +1299,10 @@ struct zfcp_port * | |||
1299 | zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, | 1299 | zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, |
1300 | u32 d_id) | 1300 | u32 d_id) |
1301 | { | 1301 | { |
1302 | struct zfcp_port *port, *tmp_port; | 1302 | struct zfcp_port *port; |
1303 | int check_wwpn; | 1303 | int check_wwpn; |
1304 | scsi_id_t scsi_id; | ||
1305 | int found; | ||
1306 | 1304 | ||
1307 | check_wwpn = !(status & ZFCP_STATUS_PORT_NO_WWPN); | 1305 | check_wwpn = !(status & ZFCP_STATUS_PORT_NO_WWPN); |
1308 | |||
1309 | /* | 1306 | /* |
1310 | * check that there is no port with this WWPN already in list | 1307 | * check that there is no port with this WWPN already in list |
1311 | */ | 1308 | */ |
@@ -1368,7 +1365,7 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, | |||
1368 | } else { | 1365 | } else { |
1369 | snprintf(port->sysfs_device.bus_id, | 1366 | snprintf(port->sysfs_device.bus_id, |
1370 | BUS_ID_SIZE, "0x%016llx", wwpn); | 1367 | BUS_ID_SIZE, "0x%016llx", wwpn); |
1371 | port->sysfs_device.parent = &adapter->ccw_device->dev; | 1368 | port->sysfs_device.parent = &adapter->ccw_device->dev; |
1372 | } | 1369 | } |
1373 | port->sysfs_device.release = zfcp_sysfs_port_release; | 1370 | port->sysfs_device.release = zfcp_sysfs_port_release; |
1374 | dev_set_drvdata(&port->sysfs_device, port); | 1371 | dev_set_drvdata(&port->sysfs_device, port); |
@@ -1388,24 +1385,8 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, | |||
1388 | 1385 | ||
1389 | zfcp_port_get(port); | 1386 | zfcp_port_get(port); |
1390 | 1387 | ||
1391 | scsi_id = 1; | ||
1392 | found = 0; | ||
1393 | write_lock_irq(&zfcp_data.config_lock); | 1388 | write_lock_irq(&zfcp_data.config_lock); |
1394 | list_for_each_entry(tmp_port, &adapter->port_list_head, list) { | 1389 | list_add_tail(&port->list, &adapter->port_list_head); |
1395 | if (atomic_test_mask(ZFCP_STATUS_PORT_NO_SCSI_ID, | ||
1396 | &tmp_port->status)) | ||
1397 | continue; | ||
1398 | if (tmp_port->scsi_id != scsi_id) { | ||
1399 | found = 1; | ||
1400 | break; | ||
1401 | } | ||
1402 | scsi_id++; | ||
1403 | } | ||
1404 | port->scsi_id = scsi_id; | ||
1405 | if (found) | ||
1406 | list_add_tail(&port->list, &tmp_port->list); | ||
1407 | else | ||
1408 | list_add_tail(&port->list, &adapter->port_list_head); | ||
1409 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); | 1390 | atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); |
1410 | atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); | 1391 | atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); |
1411 | if (d_id == ZFCP_DID_DIRECTORY_SERVICE) | 1392 | if (d_id == ZFCP_DID_DIRECTORY_SERVICE) |
@@ -1422,11 +1403,15 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, | |||
1422 | void | 1403 | void |
1423 | zfcp_port_dequeue(struct zfcp_port *port) | 1404 | zfcp_port_dequeue(struct zfcp_port *port) |
1424 | { | 1405 | { |
1406 | struct fc_port *rport; | ||
1407 | |||
1425 | zfcp_port_wait(port); | 1408 | zfcp_port_wait(port); |
1426 | write_lock_irq(&zfcp_data.config_lock); | 1409 | write_lock_irq(&zfcp_data.config_lock); |
1427 | list_del(&port->list); | 1410 | list_del(&port->list); |
1428 | port->adapter->ports--; | 1411 | port->adapter->ports--; |
1429 | write_unlock_irq(&zfcp_data.config_lock); | 1412 | write_unlock_irq(&zfcp_data.config_lock); |
1413 | if (port->rport) | ||
1414 | fc_remote_port_delete(rport); | ||
1430 | zfcp_adapter_put(port->adapter); | 1415 | zfcp_adapter_put(port->adapter); |
1431 | zfcp_sysfs_port_remove_files(&port->sysfs_device, | 1416 | zfcp_sysfs_port_remove_files(&port->sysfs_device, |
1432 | atomic_read(&port->status)); | 1417 | atomic_read(&port->status)); |
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 0fc46381fc22..3c65aedaa97f 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -202,9 +202,19 @@ static int | |||
202 | zfcp_ccw_set_offline(struct ccw_device *ccw_device) | 202 | zfcp_ccw_set_offline(struct ccw_device *ccw_device) |
203 | { | 203 | { |
204 | struct zfcp_adapter *adapter; | 204 | struct zfcp_adapter *adapter; |
205 | struct zfcp_port *port; | ||
206 | struct fc_port *rport; | ||
205 | 207 | ||
206 | down(&zfcp_data.config_sema); | 208 | down(&zfcp_data.config_sema); |
207 | adapter = dev_get_drvdata(&ccw_device->dev); | 209 | adapter = dev_get_drvdata(&ccw_device->dev); |
210 | /* might be racy, but we cannot take config_lock due to the fact that | ||
211 | fc_remote_port_delete might sleep */ | ||
212 | list_for_each_entry(port, &adapter->port_list_head, list) | ||
213 | if (port->rport) { | ||
214 | rport = port->rport; | ||
215 | port->rport = NULL; | ||
216 | fc_remote_port_delete(rport); | ||
217 | } | ||
208 | zfcp_erp_adapter_shutdown(adapter, 0); | 218 | zfcp_erp_adapter_shutdown(adapter, 0); |
209 | zfcp_erp_wait(adapter); | 219 | zfcp_erp_wait(adapter); |
210 | zfcp_adapter_scsi_unregister(adapter); | 220 | zfcp_adapter_scsi_unregister(adapter); |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 4103b5be7683..455e902533a9 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -906,6 +906,7 @@ struct zfcp_adapter { | |||
906 | */ | 906 | */ |
907 | struct zfcp_port { | 907 | struct zfcp_port { |
908 | struct device sysfs_device; /* sysfs device */ | 908 | struct device sysfs_device; /* sysfs device */ |
909 | struct fc_rport *rport; /* rport of fc transport class */ | ||
909 | struct list_head list; /* list of remote ports */ | 910 | struct list_head list; /* list of remote ports */ |
910 | atomic_t refcount; /* reference count */ | 911 | atomic_t refcount; /* reference count */ |
911 | wait_queue_head_t remove_wq; /* can be used to wait for | 912 | wait_queue_head_t remove_wq; /* can be used to wait for |
@@ -916,7 +917,6 @@ struct zfcp_port { | |||
916 | list */ | 917 | list */ |
917 | u32 units; /* # of logical units in list */ | 918 | u32 units; /* # of logical units in list */ |
918 | atomic_t status; /* status of this remote port */ | 919 | atomic_t status; /* status of this remote port */ |
919 | scsi_id_t scsi_id; /* own SCSI ID */ | ||
920 | wwn_t wwnn; /* WWNN if known */ | 920 | wwn_t wwnn; /* WWNN if known */ |
921 | wwn_t wwpn; /* WWPN */ | 921 | wwn_t wwpn; /* WWPN */ |
922 | fc_id_t d_id; /* D_ID */ | 922 | fc_id_t d_id; /* D_ID */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 0cf31f7d1c0f..cb4f612550ba 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -3360,13 +3360,32 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, | |||
3360 | if ((result == ZFCP_ERP_SUCCEEDED) | 3360 | if ((result == ZFCP_ERP_SUCCEEDED) |
3361 | && (!atomic_test_mask(ZFCP_STATUS_UNIT_TEMPORARY, | 3361 | && (!atomic_test_mask(ZFCP_STATUS_UNIT_TEMPORARY, |
3362 | &unit->status)) | 3362 | &unit->status)) |
3363 | && (!unit->device)) | 3363 | && !unit->device |
3364 | scsi_add_device(unit->port->adapter->scsi_host, 0, | 3364 | && port->rport) |
3365 | unit->port->scsi_id, unit->scsi_lun); | 3365 | scsi_add_device(port->adapter->scsi_host, 0, |
3366 | port->rport->scsi_target_id, | ||
3367 | unit->scsi_lun); | ||
3366 | zfcp_unit_put(unit); | 3368 | zfcp_unit_put(unit); |
3367 | break; | 3369 | break; |
3368 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 3370 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
3369 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 3371 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
3372 | if ((result == ZFCP_ERP_SUCCEEDED) | ||
3373 | && !atomic_test_mask(ZFCP_STATUS_PORT_NO_WWPN, | ||
3374 | &port->status) | ||
3375 | && !port->rport) { | ||
3376 | struct fc_rport_identifiers ids; | ||
3377 | ids.node_name = port->wwnn; | ||
3378 | ids.port_name = port->wwpn; | ||
3379 | ids.port_id = port->d_id; | ||
3380 | ids.roles = FC_RPORT_ROLE_FCP_TARGET; | ||
3381 | port->rport = | ||
3382 | fc_remote_port_add(adapter->scsi_host, 0, &ids); | ||
3383 | if (!port->rport) | ||
3384 | ZFCP_LOG_NORMAL("failed registration of rport" | ||
3385 | "(adapter %s, wwpn=0x%016Lx)\n", | ||
3386 | zfcp_get_busid_by_port(port), | ||
3387 | port->wwpn); | ||
3388 | } | ||
3370 | zfcp_port_put(port); | 3389 | zfcp_port_put(port); |
3371 | break; | 3390 | break; |
3372 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 3391 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 42df7e57eeae..cd98a2de9f8f 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -143,6 +143,8 @@ extern int zfcp_scsi_command_async(struct zfcp_adapter *,struct zfcp_unit *, | |||
143 | struct scsi_cmnd *, struct timer_list *); | 143 | struct scsi_cmnd *, struct timer_list *); |
144 | extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, | 144 | extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, |
145 | struct timer_list *); | 145 | struct timer_list *); |
146 | extern void zfcp_set_fc_host_attrs(struct zfcp_adapter *); | ||
147 | extern void zfcp_set_fc_rport_attrs(struct zfcp_port *); | ||
146 | extern struct scsi_transport_template *zfcp_transport_template; | 148 | extern struct scsi_transport_template *zfcp_transport_template; |
147 | extern struct fc_function_template zfcp_transport_functions; | 149 | extern struct fc_function_template zfcp_transport_functions; |
148 | 150 | ||
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 0d9f20edc490..c007b6424e74 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2062,6 +2062,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | |||
2062 | zfcp_erp_adapter_shutdown(adapter, 0); | 2062 | zfcp_erp_adapter_shutdown(adapter, 0); |
2063 | return -EIO; | 2063 | return -EIO; |
2064 | } | 2064 | } |
2065 | zfcp_set_fc_host_attrs(adapter); | ||
2065 | return 0; | 2066 | return 0; |
2066 | } | 2067 | } |
2067 | 2068 | ||
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index b61d309352c3..31a76065cf28 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -389,7 +389,7 @@ zfcp_unit_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id, | |||
389 | struct zfcp_unit *unit, *retval = NULL; | 389 | struct zfcp_unit *unit, *retval = NULL; |
390 | 390 | ||
391 | list_for_each_entry(port, &adapter->port_list_head, list) { | 391 | list_for_each_entry(port, &adapter->port_list_head, list) { |
392 | if (id != port->scsi_id) | 392 | if (!port->rport || (id != port->rport->scsi_target_id)) |
393 | continue; | 393 | continue; |
394 | list_for_each_entry(unit, &port->unit_list_head, list) { | 394 | list_for_each_entry(unit, &port->unit_list_head, list) { |
395 | if (lun == unit->scsi_lun) { | 395 | if (lun == unit->scsi_lun) { |
@@ -408,7 +408,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id) | |||
408 | struct zfcp_port *port; | 408 | struct zfcp_port *port; |
409 | 409 | ||
410 | list_for_each_entry(port, &adapter->port_list_head, list) { | 410 | list_for_each_entry(port, &adapter->port_list_head, list) { |
411 | if (id == port->scsi_id) | 411 | if (port->rport && (id == port->rport->scsi_target_id)) |
412 | return port; | 412 | return port; |
413 | } | 413 | } |
414 | return (struct zfcp_port *) NULL; | 414 | return (struct zfcp_port *) NULL; |
@@ -634,7 +634,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) | |||
634 | { | 634 | { |
635 | int retval; | 635 | int retval; |
636 | struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; | 636 | struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; |
637 | struct Scsi_Host *scsi_host = scpnt->device->host; | ||
638 | 637 | ||
639 | if (!unit) { | 638 | if (!unit) { |
640 | ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); | 639 | ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); |
@@ -729,7 +728,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt) | |||
729 | { | 728 | { |
730 | int retval = 0; | 729 | int retval = 0; |
731 | struct zfcp_unit *unit; | 730 | struct zfcp_unit *unit; |
732 | struct Scsi_Host *scsi_host = scpnt->device->host; | ||
733 | 731 | ||
734 | unit = (struct zfcp_unit *) scpnt->device->hostdata; | 732 | unit = (struct zfcp_unit *) scpnt->device->hostdata; |
735 | ZFCP_LOG_NORMAL("bus reset because of problems with " | 733 | ZFCP_LOG_NORMAL("bus reset because of problems with " |
@@ -753,7 +751,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) | |||
753 | { | 751 | { |
754 | int retval = 0; | 752 | int retval = 0; |
755 | struct zfcp_unit *unit; | 753 | struct zfcp_unit *unit; |
756 | struct Scsi_Host *scsi_host = scpnt->device->host; | ||
757 | 754 | ||
758 | unit = (struct zfcp_unit *) scpnt->device->hostdata; | 755 | unit = (struct zfcp_unit *) scpnt->device->hostdata; |
759 | ZFCP_LOG_NORMAL("host reset because of problems with " | 756 | ZFCP_LOG_NORMAL("host reset because of problems with " |
@@ -833,6 +830,7 @@ zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter) | |||
833 | shost = adapter->scsi_host; | 830 | shost = adapter->scsi_host; |
834 | if (!shost) | 831 | if (!shost) |
835 | return; | 832 | return; |
833 | fc_remove_host(shost); | ||
836 | scsi_remove_host(shost); | 834 | scsi_remove_host(shost); |
837 | scsi_host_put(shost); | 835 | scsi_host_put(shost); |
838 | adapter->scsi_host = NULL; | 836 | adapter->scsi_host = NULL; |
@@ -906,6 +904,18 @@ zfcp_get_node_name(struct scsi_target *starget) | |||
906 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 904 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
907 | } | 905 | } |
908 | 906 | ||
907 | void | ||
908 | zfcp_set_fc_host_attrs(struct zfcp_adapter *adapter) | ||
909 | { | ||
910 | struct Scsi_Host *shost = adapter->scsi_host; | ||
911 | |||
912 | fc_host_node_name(shost) = adapter->wwnn; | ||
913 | fc_host_port_name(shost) = adapter->wwpn; | ||
914 | strncpy(fc_host_serial_number(shost), adapter->serial_number, | ||
915 | min(FC_SERIAL_NUMBER_SIZE, 32)); | ||
916 | fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; | ||
917 | } | ||
918 | |||
909 | struct fc_function_template zfcp_transport_functions = { | 919 | struct fc_function_template zfcp_transport_functions = { |
910 | .get_starget_port_id = zfcp_get_port_id, | 920 | .get_starget_port_id = zfcp_get_port_id, |
911 | .get_starget_port_name = zfcp_get_port_name, | 921 | .get_starget_port_name = zfcp_get_port_name, |
@@ -913,6 +923,11 @@ struct fc_function_template zfcp_transport_functions = { | |||
913 | .show_starget_port_id = 1, | 923 | .show_starget_port_id = 1, |
914 | .show_starget_port_name = 1, | 924 | .show_starget_port_name = 1, |
915 | .show_starget_node_name = 1, | 925 | .show_starget_node_name = 1, |
926 | .show_rport_supported_classes = 1, | ||
927 | .show_host_node_name = 1, | ||
928 | .show_host_port_name = 1, | ||
929 | .show_host_supported_classes = 1, | ||
930 | .show_host_serial_number = 1, | ||
916 | }; | 931 | }; |
917 | 932 | ||
918 | /** | 933 | /** |
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index b8a2c7353b0a..d44205d52bf3 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #define __KERNEL_SYSCALLS__ | 7 | #define __KERNEL_SYSCALLS__ |
8 | 8 | ||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/kthread.h> | ||
10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
11 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
12 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task; | |||
459 | 460 | ||
460 | static int kenvctrld(void *__unused) | 461 | static int kenvctrld(void *__unused) |
461 | { | 462 | { |
462 | daemonize("kenvctrld"); | ||
463 | allow_signal(SIGKILL); | ||
464 | kenvctrld_task = current; | ||
465 | |||
466 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); | 463 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); |
467 | last_warning_jiffies = jiffies - WARN_INTERVAL; | 464 | last_warning_jiffies = jiffies - WARN_INTERVAL; |
468 | for (;;) { | 465 | for (;;) { |
@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused) | |||
470 | struct bbc_fan_control *fp; | 467 | struct bbc_fan_control *fp; |
471 | 468 | ||
472 | msleep_interruptible(POLL_INTERVAL); | 469 | msleep_interruptible(POLL_INTERVAL); |
473 | if (signal_pending(current)) | 470 | if (kthread_should_stop()) |
474 | break; | 471 | break; |
475 | 472 | ||
476 | for (tp = all_bbc_temps; tp; tp = tp->next) { | 473 | for (tp = all_bbc_temps; tp; tp = tp->next) { |
@@ -577,7 +574,6 @@ int bbc_envctrl_init(void) | |||
577 | int temp_index = 0; | 574 | int temp_index = 0; |
578 | int fan_index = 0; | 575 | int fan_index = 0; |
579 | int devidx = 0; | 576 | int devidx = 0; |
580 | int err = 0; | ||
581 | 577 | ||
582 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { | 578 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { |
583 | if (!strcmp(echild->prom_name, "temperature")) | 579 | if (!strcmp(echild->prom_name, "temperature")) |
@@ -585,9 +581,13 @@ int bbc_envctrl_init(void) | |||
585 | if (!strcmp(echild->prom_name, "fan-control")) | 581 | if (!strcmp(echild->prom_name, "fan-control")) |
586 | attach_one_fan(echild, fan_index++); | 582 | attach_one_fan(echild, fan_index++); |
587 | } | 583 | } |
588 | if (temp_index != 0 && fan_index != 0) | 584 | if (temp_index != 0 && fan_index != 0) { |
589 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 585 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
590 | return err; | 586 | if (IS_ERR(kenvctrld_task)) |
587 | return PTR_ERR(kenvctrld_task); | ||
588 | } | ||
589 | |||
590 | return 0; | ||
591 | } | 591 | } |
592 | 592 | ||
593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) | 593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) |
@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void) | |||
607 | struct bbc_cpu_temperature *tp; | 607 | struct bbc_cpu_temperature *tp; |
608 | struct bbc_fan_control *fp; | 608 | struct bbc_fan_control *fp; |
609 | 609 | ||
610 | if (kenvctrld_task != NULL) { | 610 | kthread_stop(kenvctrld_task); |
611 | force_sig(SIGKILL, kenvctrld_task); | ||
612 | for (;;) { | ||
613 | struct task_struct *p; | ||
614 | int found = 0; | ||
615 | |||
616 | read_lock(&tasklist_lock); | ||
617 | for_each_process(p) { | ||
618 | if (p == kenvctrld_task) { | ||
619 | found = 1; | ||
620 | break; | ||
621 | } | ||
622 | } | ||
623 | read_unlock(&tasklist_lock); | ||
624 | if (!found) | ||
625 | break; | ||
626 | msleep(1000); | ||
627 | } | ||
628 | kenvctrld_task = NULL; | ||
629 | } | ||
630 | 611 | ||
631 | tp = all_bbc_temps; | 612 | tp = all_bbc_temps; |
632 | while (tp != NULL) { | 613 | while (tp != NULL) { |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 9a8c572554f5..d765cc1bf060 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/config.h> | 24 | #include <linux/config.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/kthread.h> | ||
27 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused) | |||
1010 | 1011 | ||
1011 | poll_interval = 5000; /* TODO env_mon_interval */ | 1012 | poll_interval = 5000; /* TODO env_mon_interval */ |
1012 | 1013 | ||
1013 | daemonize("kenvctrld"); | ||
1014 | allow_signal(SIGKILL); | ||
1015 | |||
1016 | kenvctrld_task = current; | ||
1017 | |||
1018 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); | 1014 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); |
1019 | for (;;) { | 1015 | for (;;) { |
1020 | if(msleep_interruptible(poll_interval)) | 1016 | msleep_interruptible(poll_interval); |
1021 | break; | ||
1022 | 1017 | ||
1018 | if (kthread_should_stop()) | ||
1019 | break; | ||
1020 | |||
1023 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { | 1021 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { |
1024 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, | 1022 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, |
1025 | ENVCTRL_CPUTEMP_MON, | 1023 | ENVCTRL_CPUTEMP_MON, |
@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused) | |||
1041 | 1039 | ||
1042 | static int __init envctrl_init(void) | 1040 | static int __init envctrl_init(void) |
1043 | { | 1041 | { |
1044 | #ifdef CONFIG_PCI | ||
1045 | struct linux_ebus *ebus = NULL; | 1042 | struct linux_ebus *ebus = NULL; |
1046 | struct linux_ebus_device *edev = NULL; | 1043 | struct linux_ebus_device *edev = NULL; |
1047 | struct linux_ebus_child *edev_child = NULL; | 1044 | struct linux_ebus_child *edev_child = NULL; |
@@ -1118,9 +1115,11 @@ done: | |||
1118 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); | 1115 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); |
1119 | } | 1116 | } |
1120 | 1117 | ||
1121 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 1118 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
1122 | if (err < 0) | 1119 | if (IS_ERR(kenvctrld_task)) { |
1120 | err = PTR_ERR(kenvctrld_task); | ||
1123 | goto out_deregister; | 1121 | goto out_deregister; |
1122 | } | ||
1124 | 1123 | ||
1125 | return 0; | 1124 | return 0; |
1126 | 1125 | ||
@@ -1133,37 +1132,13 @@ out_iounmap: | |||
1133 | kfree(i2c_childlist[i].tables); | 1132 | kfree(i2c_childlist[i].tables); |
1134 | } | 1133 | } |
1135 | return err; | 1134 | return err; |
1136 | #else | ||
1137 | return -ENODEV; | ||
1138 | #endif | ||
1139 | } | 1135 | } |
1140 | 1136 | ||
1141 | static void __exit envctrl_cleanup(void) | 1137 | static void __exit envctrl_cleanup(void) |
1142 | { | 1138 | { |
1143 | int i; | 1139 | int i; |
1144 | 1140 | ||
1145 | if (NULL != kenvctrld_task) { | 1141 | kthread_stop(kenvctrld_task); |
1146 | force_sig(SIGKILL, kenvctrld_task); | ||
1147 | for (;;) { | ||
1148 | struct task_struct *p; | ||
1149 | int found = 0; | ||
1150 | |||
1151 | read_lock(&tasklist_lock); | ||
1152 | for_each_process(p) { | ||
1153 | if (p == kenvctrld_task) { | ||
1154 | found = 1; | ||
1155 | break; | ||
1156 | } | ||
1157 | } | ||
1158 | read_unlock(&tasklist_lock); | ||
1159 | |||
1160 | if (!found) | ||
1161 | break; | ||
1162 | |||
1163 | msleep(1000); | ||
1164 | } | ||
1165 | kenvctrld_task = NULL; | ||
1166 | } | ||
1167 | 1142 | ||
1168 | iounmap(i2c); | 1143 | iounmap(i2c); |
1169 | misc_deregister(&envctrl_dev); | 1144 | misc_deregister(&envctrl_dev); |
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h index e56a43af0f62..a7782e7da42e 100644 --- a/drivers/sbus/char/vfc.h +++ b/drivers/sbus/char/vfc.h | |||
@@ -129,8 +129,6 @@ struct vfc_dev { | |||
129 | struct vfc_regs *phys_regs; | 129 | struct vfc_regs *phys_regs; |
130 | unsigned int control_reg; | 130 | unsigned int control_reg; |
131 | struct semaphore device_lock_sem; | 131 | struct semaphore device_lock_sem; |
132 | struct timer_list poll_timer; | ||
133 | wait_queue_head_t poll_wait; | ||
134 | int instance; | 132 | int instance; |
135 | int busy; | 133 | int busy; |
136 | unsigned long which_io; | 134 | unsigned long which_io; |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 86ce54130954..7a103698fa3c 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) | |||
137 | dev->instance=instance; | 137 | dev->instance=instance; |
138 | init_MUTEX(&dev->device_lock_sem); | 138 | init_MUTEX(&dev->device_lock_sem); |
139 | dev->control_reg=0; | 139 | dev->control_reg=0; |
140 | init_waitqueue_head(&dev->poll_wait); | ||
141 | dev->busy=0; | 140 | dev->busy=0; |
142 | return 0; | 141 | return 0; |
143 | } | 142 | } |
diff --git a/drivers/sbus/char/vfc_i2c.c b/drivers/sbus/char/vfc_i2c.c index 1faf1e75f71f..739cad9b19a1 100644 --- a/drivers/sbus/char/vfc_i2c.c +++ b/drivers/sbus/char/vfc_i2c.c | |||
@@ -79,25 +79,10 @@ int vfc_pcf8584_init(struct vfc_dev *dev) | |||
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | void vfc_i2c_delay_wakeup(struct vfc_dev *dev) | ||
83 | { | ||
84 | /* Used to profile code and eliminate too many delays */ | ||
85 | VFC_I2C_DEBUG_PRINTK(("vfc%d: Delaying\n", dev->instance)); | ||
86 | wake_up(&dev->poll_wait); | ||
87 | } | ||
88 | |||
89 | void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) | 82 | void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) |
90 | { | 83 | { |
91 | DEFINE_WAIT(wait); | 84 | set_current_state(TASK_UNINTERRUPTIBLE); |
92 | init_timer(&dev->poll_timer); | 85 | schedule_timeout(usecs_to_jiffies(usecs)); |
93 | dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs); | ||
94 | dev->poll_timer.data=(unsigned long)dev; | ||
95 | dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup; | ||
96 | add_timer(&dev->poll_timer); | ||
97 | prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE); | ||
98 | schedule(); | ||
99 | del_timer(&dev->poll_timer); | ||
100 | finish_wait(&dev->poll_wait, &wait); | ||
101 | } | 86 | } |
102 | 87 | ||
103 | void inline vfc_i2c_delay(struct vfc_dev *dev) | 88 | void inline vfc_i2c_delay(struct vfc_dev *dev) |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 96df148ed969..12c208fb18c5 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -424,7 +424,7 @@ config SCSI_IN2000 | |||
424 | source "drivers/scsi/megaraid/Kconfig.megaraid" | 424 | source "drivers/scsi/megaraid/Kconfig.megaraid" |
425 | 425 | ||
426 | config SCSI_SATA | 426 | config SCSI_SATA |
427 | bool "Serial ATA (SATA) support" | 427 | tristate "Serial ATA (SATA) support" |
428 | depends on SCSI | 428 | depends on SCSI |
429 | help | 429 | help |
430 | This driver family supports Serial ATA host controllers | 430 | This driver family supports Serial ATA host controllers |
@@ -1696,7 +1696,7 @@ config TT_DMA_EMUL | |||
1696 | 1696 | ||
1697 | config MAC_SCSI | 1697 | config MAC_SCSI |
1698 | bool "Macintosh NCR5380 SCSI" | 1698 | bool "Macintosh NCR5380 SCSI" |
1699 | depends on MAC && SCSI | 1699 | depends on MAC && SCSI=y |
1700 | help | 1700 | help |
1701 | This is the NCR 5380 SCSI controller included on most of the 68030 | 1701 | This is the NCR 5380 SCSI controller included on most of the 68030 |
1702 | based Macintoshes. If you have one of these say Y and read the | 1702 | based Macintoshes. If you have one of these say Y and read the |
@@ -1717,7 +1717,7 @@ config SCSI_MAC_ESP | |||
1717 | 1717 | ||
1718 | config MVME147_SCSI | 1718 | config MVME147_SCSI |
1719 | bool "WD33C93 SCSI driver for MVME147" | 1719 | bool "WD33C93 SCSI driver for MVME147" |
1720 | depends on MVME147 && SCSI | 1720 | depends on MVME147 && SCSI=y |
1721 | help | 1721 | help |
1722 | Support for the on-board SCSI controller on the Motorola MVME147 | 1722 | Support for the on-board SCSI controller on the Motorola MVME147 |
1723 | single-board computer. | 1723 | single-board computer. |
@@ -1758,7 +1758,7 @@ config SUN3_SCSI | |||
1758 | 1758 | ||
1759 | config SUN3X_ESP | 1759 | config SUN3X_ESP |
1760 | bool "Sun3x ESP SCSI" | 1760 | bool "Sun3x ESP SCSI" |
1761 | depends on SUN3X && SCSI | 1761 | depends on SUN3X && SCSI=y |
1762 | help | 1762 | help |
1763 | The ESP was an on-board SCSI controller used on Sun 3/80 | 1763 | The ESP was an on-board SCSI controller used on Sun 3/80 |
1764 | machines. Say Y here to compile in support for it. | 1764 | machines. Say Y here to compile in support for it. |
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index bc91e7ce5e59..e40528185d48 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h | |||
@@ -15,11 +15,7 @@ | |||
15 | #define AAC_MAX_LUN (8) | 15 | #define AAC_MAX_LUN (8) |
16 | 16 | ||
17 | #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff) | 17 | #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff) |
18 | /* | 18 | #define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)512) |
19 | * max_sectors is an unsigned short, otherwise limit is 0x100000000 / 512 | ||
20 | * Linux has starvation problems if we permit larger than 4MB I/O ... | ||
21 | */ | ||
22 | #define AAC_MAX_32BIT_SGBCOUNT ((unsigned short)8192) | ||
23 | 19 | ||
24 | /* | 20 | /* |
25 | * These macros convert from physical channels to virtual channels | 21 | * These macros convert from physical channels to virtual channels |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 2bd594267881..4ff29d7f5825 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -391,7 +391,8 @@ static int aac_slave_configure(struct scsi_device *sdev) | |||
391 | else | 391 | else |
392 | scsi_adjust_queue_depth(sdev, 0, 1); | 392 | scsi_adjust_queue_depth(sdev, 0, 1); |
393 | 393 | ||
394 | if (host->max_sectors < AAC_MAX_32BIT_SGBCOUNT) | 394 | if (!(((struct aac_dev *)host->hostdata)->adapter_info.options |
395 | & AAC_OPT_NEW_COMM)) | ||
395 | blk_queue_max_segment_size(sdev->request_queue, 65536); | 396 | blk_queue_max_segment_size(sdev->request_queue, 65536); |
396 | 397 | ||
397 | return 0; | 398 | return 0; |
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index c5623694d10f..e3b9692b9688 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -1105,6 +1105,7 @@ MODULE_AUTHOR("Jeff Garzik"); | |||
1105 | MODULE_DESCRIPTION("AHCI SATA low-level driver"); | 1105 | MODULE_DESCRIPTION("AHCI SATA low-level driver"); |
1106 | MODULE_LICENSE("GPL"); | 1106 | MODULE_LICENSE("GPL"); |
1107 | MODULE_DEVICE_TABLE(pci, ahci_pci_tbl); | 1107 | MODULE_DEVICE_TABLE(pci, ahci_pci_tbl); |
1108 | MODULE_VERSION(DRV_VERSION); | ||
1108 | 1109 | ||
1109 | module_init(ahci_init); | 1110 | module_init(ahci_init); |
1110 | module_exit(ahci_exit); | 1111 | module_exit(ahci_exit); |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 22434849de48..54173887e160 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -1266,14 +1266,12 @@ ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
1266 | } | 1266 | } |
1267 | switch ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED))) { | 1267 | switch ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED))) { |
1268 | case AHC_DEV_Q_BASIC: | 1268 | case AHC_DEV_Q_BASIC: |
1269 | scsi_adjust_queue_depth(sdev, | 1269 | scsi_set_tag_type(sdev, MSG_SIMPLE_TAG); |
1270 | MSG_SIMPLE_TASK, | 1270 | scsi_activate_tcq(sdev, dev->openings + dev->active); |
1271 | dev->openings + dev->active); | ||
1272 | break; | 1271 | break; |
1273 | case AHC_DEV_Q_TAGGED: | 1272 | case AHC_DEV_Q_TAGGED: |
1274 | scsi_adjust_queue_depth(sdev, | 1273 | scsi_set_tag_type(sdev, MSG_ORDERED_TAG); |
1275 | MSG_ORDERED_TASK, | 1274 | scsi_activate_tcq(sdev, dev->openings + dev->active); |
1276 | dev->openings + dev->active); | ||
1277 | break; | 1275 | break; |
1278 | default: | 1276 | default: |
1279 | /* | 1277 | /* |
@@ -1282,9 +1280,7 @@ ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
1282 | * serially on the controller/device. This should | 1280 | * serially on the controller/device. This should |
1283 | * remove some latency. | 1281 | * remove some latency. |
1284 | */ | 1282 | */ |
1285 | scsi_adjust_queue_depth(sdev, | 1283 | scsi_deactivate_tcq(sdev, 2); |
1286 | /*NON-TAGGED*/0, | ||
1287 | /*queue depth*/2); | ||
1288 | break; | 1284 | break; |
1289 | } | 1285 | } |
1290 | } | 1286 | } |
@@ -1637,9 +1633,9 @@ ahc_send_async(struct ahc_softc *ahc, char channel, | |||
1637 | spi_period(starget) = tinfo->curr.period; | 1633 | spi_period(starget) = tinfo->curr.period; |
1638 | spi_width(starget) = tinfo->curr.width; | 1634 | spi_width(starget) = tinfo->curr.width; |
1639 | spi_offset(starget) = tinfo->curr.offset; | 1635 | spi_offset(starget) = tinfo->curr.offset; |
1640 | spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ; | 1636 | spi_dt(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_DT_REQ ? 1 : 0; |
1641 | spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ; | 1637 | spi_qas(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_QAS_REQ ? 1 : 0; |
1642 | spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ; | 1638 | spi_iu(starget) = tinfo->curr.ppr_options & MSG_EXT_PPR_IU_REQ ? 1 : 0; |
1643 | spi_display_xfer_agreement(starget); | 1639 | spi_display_xfer_agreement(starget); |
1644 | break; | 1640 | break; |
1645 | } | 1641 | } |
@@ -2429,12 +2425,14 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt) | |||
2429 | unsigned int ppr_options = tinfo->goal.ppr_options | 2425 | unsigned int ppr_options = tinfo->goal.ppr_options |
2430 | & ~MSG_EXT_PPR_DT_REQ; | 2426 | & ~MSG_EXT_PPR_DT_REQ; |
2431 | unsigned int period = tinfo->goal.period; | 2427 | unsigned int period = tinfo->goal.period; |
2428 | unsigned int width = tinfo->goal.width; | ||
2432 | unsigned long flags; | 2429 | unsigned long flags; |
2433 | struct ahc_syncrate *syncrate; | 2430 | struct ahc_syncrate *syncrate; |
2434 | 2431 | ||
2435 | if (dt) { | 2432 | if (dt) { |
2436 | period = 9; /* 12.5ns is the only period valid for DT */ | ||
2437 | ppr_options |= MSG_EXT_PPR_DT_REQ; | 2433 | ppr_options |= MSG_EXT_PPR_DT_REQ; |
2434 | if (!width) | ||
2435 | ahc_linux_set_width(starget, 1); | ||
2438 | } else if (period == 9) | 2436 | } else if (period == 9) |
2439 | period = 10; /* if resetting DT, period must be >= 25ns */ | 2437 | period = 10; /* if resetting DT, period must be >= 25ns */ |
2440 | 2438 | ||
diff --git a/drivers/scsi/arm/Kconfig b/drivers/scsi/arm/Kconfig index 54b32868aaf7..13f23043c8a3 100644 --- a/drivers/scsi/arm/Kconfig +++ b/drivers/scsi/arm/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | config SCSI_ACORNSCSI_3 | 4 | config SCSI_ACORNSCSI_3 |
5 | tristate "Acorn SCSI card (aka30) support" | 5 | tristate "Acorn SCSI card (aka30) support" |
6 | depends on ARCH_ACORN && SCSI | 6 | depends on ARCH_ACORN && SCSI && BROKEN |
7 | help | 7 | help |
8 | This enables support for the Acorn SCSI card (aka30). If you have an | 8 | This enables support for the Acorn SCSI card (aka30). If you have an |
9 | Acorn system with one of these, say Y. If unsure, say N. | 9 | Acorn system with one of these, say Y. If unsure, say N. |
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c index a2cfade2c1c6..d96ebf9d2228 100644 --- a/drivers/scsi/ata_piix.c +++ b/drivers/scsi/ata_piix.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/libata.h> | 32 | #include <linux/libata.h> |
33 | 33 | ||
34 | #define DRV_NAME "ata_piix" | 34 | #define DRV_NAME "ata_piix" |
35 | #define DRV_VERSION "1.03" | 35 | #define DRV_VERSION "1.04" |
36 | 36 | ||
37 | enum { | 37 | enum { |
38 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ | 38 | PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ |
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 929170dcd3cb..600ba1202864 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -183,7 +183,7 @@ | |||
183 | * cross a page boundy. | 183 | * cross a page boundy. |
184 | */ | 184 | */ |
185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) | 185 | #define SEGMENTX_LEN (sizeof(struct SGentry)*DC395x_MAX_SG_LISTENTRY) |
186 | #define VIRTX_LEN (sizeof(void *) * DC395x_MAX_SG_LISTENTRY) | 186 | |
187 | 187 | ||
188 | struct SGentry { | 188 | struct SGentry { |
189 | u32 address; /* bus! address */ | 189 | u32 address; /* bus! address */ |
@@ -235,7 +235,6 @@ struct ScsiReqBlk { | |||
235 | u8 sg_count; /* No of HW sg entries for this request */ | 235 | u8 sg_count; /* No of HW sg entries for this request */ |
236 | u8 sg_index; /* Index of HW sg entry for this request */ | 236 | u8 sg_index; /* Index of HW sg entry for this request */ |
237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ | 237 | u32 total_xfer_length; /* Total number of bytes remaining to be transfered */ |
238 | void **virt_map; | ||
239 | unsigned char *virt_addr; /* Virtual address of current transfer position */ | 238 | unsigned char *virt_addr; /* Virtual address of current transfer position */ |
240 | 239 | ||
241 | /* | 240 | /* |
@@ -1022,14 +1021,14 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, | |||
1022 | reqlen, cmd->request_buffer, cmd->use_sg, | 1021 | reqlen, cmd->request_buffer, cmd->use_sg, |
1023 | srb->sg_count); | 1022 | srb->sg_count); |
1024 | 1023 | ||
1024 | srb->virt_addr = page_address(sl->page); | ||
1025 | for (i = 0; i < srb->sg_count; i++) { | 1025 | for (i = 0; i < srb->sg_count; i++) { |
1026 | u32 seglen = (u32)sg_dma_len(sl + i); | 1026 | u32 busaddr = (u32)sg_dma_address(&sl[i]); |
1027 | sgp[i].address = (u32)sg_dma_address(sl + i); | 1027 | u32 seglen = (u32)sl[i].length; |
1028 | sgp[i].address = busaddr; | ||
1028 | sgp[i].length = seglen; | 1029 | sgp[i].length = seglen; |
1029 | srb->total_xfer_length += seglen; | 1030 | srb->total_xfer_length += seglen; |
1030 | srb->virt_map[i] = kmap(sl[i].page); | ||
1031 | } | 1031 | } |
1032 | srb->virt_addr = srb->virt_map[0]; | ||
1033 | sgp += srb->sg_count - 1; | 1032 | sgp += srb->sg_count - 1; |
1034 | 1033 | ||
1035 | /* | 1034 | /* |
@@ -1976,7 +1975,6 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
1976 | int segment = cmd->use_sg; | 1975 | int segment = cmd->use_sg; |
1977 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ | 1976 | u32 xferred = srb->total_xfer_length - left; /* bytes transfered */ |
1978 | struct SGentry *psge = srb->segment_x + srb->sg_index; | 1977 | struct SGentry *psge = srb->segment_x + srb->sg_index; |
1979 | void **virt = srb->virt_map; | ||
1980 | 1978 | ||
1981 | dprintkdbg(DBG_0, | 1979 | dprintkdbg(DBG_0, |
1982 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", | 1980 | "sg_update_list: Transfered %i of %i bytes, %i remain\n", |
@@ -2016,16 +2014,16 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left) | |||
2016 | 2014 | ||
2017 | /* We have to walk the scatterlist to find it */ | 2015 | /* We have to walk the scatterlist to find it */ |
2018 | sg = (struct scatterlist *)cmd->request_buffer; | 2016 | sg = (struct scatterlist *)cmd->request_buffer; |
2019 | idx = 0; | ||
2020 | while (segment--) { | 2017 | while (segment--) { |
2021 | unsigned long mask = | 2018 | unsigned long mask = |
2022 | ~((unsigned long)sg->length - 1) & PAGE_MASK; | 2019 | ~((unsigned long)sg->length - 1) & PAGE_MASK; |
2023 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { | 2020 | if ((sg_dma_address(sg) & mask) == (psge->address & mask)) { |
2024 | srb->virt_addr = virt[idx] + (psge->address & ~PAGE_MASK); | 2021 | srb->virt_addr = (page_address(sg->page) |
2022 | + psge->address - | ||
2023 | (psge->address & PAGE_MASK)); | ||
2025 | return; | 2024 | return; |
2026 | } | 2025 | } |
2027 | ++sg; | 2026 | ++sg; |
2028 | ++idx; | ||
2029 | } | 2027 | } |
2030 | 2028 | ||
2031 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); | 2029 | dprintkl(KERN_ERR, "sg_update_list: sg_to_virt failed\n"); |
@@ -2151,7 +2149,7 @@ static void data_out_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb, | |||
2151 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); | 2149 | DC395x_read32(acb, TRM_S1040_DMA_CXCNT)); |
2152 | } | 2150 | } |
2153 | /* | 2151 | /* |
2154 | * calculate all the residue data that not yet transfered | 2152 | * calculate all the residue data that not yet tranfered |
2155 | * SCSI transfer counter + left in SCSI FIFO data | 2153 | * SCSI transfer counter + left in SCSI FIFO data |
2156 | * | 2154 | * |
2157 | * .....TRM_S1040_SCSI_COUNTER (24bits) | 2155 | * .....TRM_S1040_SCSI_COUNTER (24bits) |
@@ -3269,7 +3267,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3269 | struct scsi_cmnd *cmd = srb->cmd; | 3267 | struct scsi_cmnd *cmd = srb->cmd; |
3270 | enum dma_data_direction dir = cmd->sc_data_direction; | 3268 | enum dma_data_direction dir = cmd->sc_data_direction; |
3271 | if (cmd->use_sg && dir != PCI_DMA_NONE) { | 3269 | if (cmd->use_sg && dir != PCI_DMA_NONE) { |
3272 | int i; | ||
3273 | /* unmap DC395x SG list */ | 3270 | /* unmap DC395x SG list */ |
3274 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", | 3271 | dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n", |
3275 | srb->sg_bus_addr, SEGMENTX_LEN); | 3272 | srb->sg_bus_addr, SEGMENTX_LEN); |
@@ -3279,8 +3276,6 @@ static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb) | |||
3279 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", | 3276 | dprintkdbg(DBG_SG, "pci_unmap_srb: segs=%i buffer=%p\n", |
3280 | cmd->use_sg, cmd->request_buffer); | 3277 | cmd->use_sg, cmd->request_buffer); |
3281 | /* unmap the sg segments */ | 3278 | /* unmap the sg segments */ |
3282 | for (i = 0; i < srb->sg_count; i++) | ||
3283 | kunmap(virt_to_page(srb->virt_map[i])); | ||
3284 | pci_unmap_sg(acb->dev, | 3279 | pci_unmap_sg(acb->dev, |
3285 | (struct scatterlist *)cmd->request_buffer, | 3280 | (struct scatterlist *)cmd->request_buffer, |
3286 | cmd->use_sg, dir); | 3281 | cmd->use_sg, dir); |
@@ -3327,7 +3322,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, | |||
3327 | 3322 | ||
3328 | if (cmd->use_sg) { | 3323 | if (cmd->use_sg) { |
3329 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; | 3324 | struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; |
3330 | ptr = (struct ScsiInqData *)(srb->virt_map[0] + sg->offset); | 3325 | ptr = (struct ScsiInqData *)(page_address(sg->page) + sg->offset); |
3331 | } else { | 3326 | } else { |
3332 | ptr = (struct ScsiInqData *)(cmd->request_buffer); | 3327 | ptr = (struct ScsiInqData *)(cmd->request_buffer); |
3333 | } | 3328 | } |
@@ -4262,9 +4257,8 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb) | |||
4262 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; | 4257 | const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN; |
4263 | 4258 | ||
4264 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) | 4259 | for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page) |
4265 | kfree(acb->srb_array[i].segment_x); | 4260 | if (acb->srb_array[i].segment_x) |
4266 | 4261 | kfree(acb->srb_array[i].segment_x); | |
4267 | vfree(acb->srb_array[0].virt_map); | ||
4268 | } | 4262 | } |
4269 | 4263 | ||
4270 | 4264 | ||
@@ -4280,12 +4274,9 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4280 | int srb_idx = 0; | 4274 | int srb_idx = 0; |
4281 | unsigned i = 0; | 4275 | unsigned i = 0; |
4282 | struct SGentry *ptr; | 4276 | struct SGentry *ptr; |
4283 | void **virt_array; | ||
4284 | 4277 | ||
4285 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) { | 4278 | for (i = 0; i < DC395x_MAX_SRB_CNT; i++) |
4286 | acb->srb_array[i].segment_x = NULL; | 4279 | acb->srb_array[i].segment_x = NULL; |
4287 | acb->srb_array[i].virt_map = NULL; | ||
4288 | } | ||
4289 | 4280 | ||
4290 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); | 4281 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); |
4291 | while (pages--) { | 4282 | while (pages--) { |
@@ -4306,19 +4297,6 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4306 | ptr + (i * DC395x_MAX_SG_LISTENTRY); | 4297 | ptr + (i * DC395x_MAX_SG_LISTENTRY); |
4307 | else | 4298 | else |
4308 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); | 4299 | dprintkl(KERN_DEBUG, "No space for tmsrb SG table reserved?!\n"); |
4309 | |||
4310 | virt_array = vmalloc((DC395x_MAX_SRB_CNT + 1) * DC395x_MAX_SG_LISTENTRY * sizeof(void*)); | ||
4311 | |||
4312 | if (!virt_array) { | ||
4313 | adapter_sg_tables_free(acb); | ||
4314 | return 1; | ||
4315 | } | ||
4316 | |||
4317 | for (i = 0; i < DC395x_MAX_SRB_CNT + 1; i++) { | ||
4318 | acb->srb_array[i].virt_map = virt_array; | ||
4319 | virt_array += DC395x_MAX_SG_LISTENTRY; | ||
4320 | } | ||
4321 | |||
4322 | return 0; | 4300 | return 0; |
4323 | } | 4301 | } |
4324 | 4302 | ||
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index e2370529c632..7235f94f1191 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
907 | raptorFlag = TRUE; | 907 | raptorFlag = TRUE; |
908 | } | 908 | } |
909 | 909 | ||
910 | 910 | if (pci_request_regions(pDev, "dpt_i2o")) { | |
911 | PERROR("dpti: adpt_config_hba: pci request region failed\n"); | ||
912 | return -EINVAL; | ||
913 | } | ||
911 | base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); | 914 | base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); |
912 | if (!base_addr_virt) { | 915 | if (!base_addr_virt) { |
916 | pci_release_regions(pDev); | ||
913 | PERROR("dpti: adpt_config_hba: io remap failed\n"); | 917 | PERROR("dpti: adpt_config_hba: io remap failed\n"); |
914 | return -EINVAL; | 918 | return -EINVAL; |
915 | } | 919 | } |
@@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
919 | if (!msg_addr_virt) { | 923 | if (!msg_addr_virt) { |
920 | PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); | 924 | PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); |
921 | iounmap(base_addr_virt); | 925 | iounmap(base_addr_virt); |
926 | pci_release_regions(pDev); | ||
922 | return -EINVAL; | 927 | return -EINVAL; |
923 | } | 928 | } |
924 | } else { | 929 | } else { |
@@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev | |||
932 | iounmap(msg_addr_virt); | 937 | iounmap(msg_addr_virt); |
933 | } | 938 | } |
934 | iounmap(base_addr_virt); | 939 | iounmap(base_addr_virt); |
940 | pci_release_regions(pDev); | ||
935 | return -ENOMEM; | 941 | return -ENOMEM; |
936 | } | 942 | } |
937 | memset(pHba, 0, sizeof(adpt_hba)); | 943 | memset(pHba, 0, sizeof(adpt_hba)); |
@@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1027 | up(&adpt_configuration_lock); | 1033 | up(&adpt_configuration_lock); |
1028 | 1034 | ||
1029 | iounmap(pHba->base_addr_virt); | 1035 | iounmap(pHba->base_addr_virt); |
1036 | pci_release_regions(pHba->pDev); | ||
1030 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ | 1037 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ |
1031 | iounmap(pHba->msg_addr_virt); | 1038 | iounmap(pHba->msg_addr_virt); |
1032 | } | 1039 | } |
diff --git a/drivers/scsi/ibmvscsi/srp.h b/drivers/scsi/ibmvscsi/srp.h index 2ae5154fd89c..7d8e4c4accb9 100644 --- a/drivers/scsi/ibmvscsi/srp.h +++ b/drivers/scsi/ibmvscsi/srp.h | |||
@@ -35,7 +35,7 @@ | |||
35 | enum srp_types { | 35 | enum srp_types { |
36 | SRP_LOGIN_REQ_TYPE = 0x00, | 36 | SRP_LOGIN_REQ_TYPE = 0x00, |
37 | SRP_LOGIN_RSP_TYPE = 0xC0, | 37 | SRP_LOGIN_RSP_TYPE = 0xC0, |
38 | SRP_LOGIN_REJ_TYPE = 0x80, | 38 | SRP_LOGIN_REJ_TYPE = 0xC2, |
39 | SRP_I_LOGOUT_TYPE = 0x03, | 39 | SRP_I_LOGOUT_TYPE = 0x03, |
40 | SRP_T_LOGOUT_TYPE = 0x80, | 40 | SRP_T_LOGOUT_TYPE = 0x80, |
41 | SRP_TSK_MGMT_TYPE = 0x01, | 41 | SRP_TSK_MGMT_TYPE = 0x01, |
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 6dfcb4fbccdd..4cdd891781b1 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -133,10 +133,12 @@ | |||
133 | /* 6.10.00 - Remove 1G Addressing Limitations */ | 133 | /* 6.10.00 - Remove 1G Addressing Limitations */ |
134 | /* 6.11.xx - Get VersionInfo buffer off the stack ! DDTS 60401 */ | 134 | /* 6.11.xx - Get VersionInfo buffer off the stack ! DDTS 60401 */ |
135 | /* 6.11.xx - Make Logical Drive Info structure safe for DMA DDTS 60639 */ | 135 | /* 6.11.xx - Make Logical Drive Info structure safe for DMA DDTS 60639 */ |
136 | /* 7.10.xx - Add highmem_io flag in SCSI Templete for 2.4 kernels */ | 136 | /* 7.10.18 - Add highmem_io flag in SCSI Templete for 2.4 kernels */ |
137 | /* - Fix path/name for scsi_hosts.h include for 2.6 kernels */ | 137 | /* - Fix path/name for scsi_hosts.h include for 2.6 kernels */ |
138 | /* - Fix sort order of 7k */ | 138 | /* - Fix sort order of 7k */ |
139 | /* - Remove 3 unused "inline" functions */ | 139 | /* - Remove 3 unused "inline" functions */ |
140 | /* 7.12.xx - Use STATIC functions whereever possible */ | ||
141 | /* - Clean up deprecated MODULE_PARM calls */ | ||
140 | /*****************************************************************************/ | 142 | /*****************************************************************************/ |
141 | 143 | ||
142 | /* | 144 | /* |
@@ -207,8 +209,8 @@ module_param(ips, charp, 0); | |||
207 | /* | 209 | /* |
208 | * DRIVER_VER | 210 | * DRIVER_VER |
209 | */ | 211 | */ |
210 | #define IPS_VERSION_HIGH "7.10" | 212 | #define IPS_VERSION_HIGH "7.12" |
211 | #define IPS_VERSION_LOW ".18 " | 213 | #define IPS_VERSION_LOW ".02 " |
212 | 214 | ||
213 | #if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) | 215 | #if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) |
214 | #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" | 216 | #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" |
diff --git a/drivers/scsi/ips.h b/drivers/scsi/ips.h index 480e06f4d6ae..505e967013de 100644 --- a/drivers/scsi/ips.h +++ b/drivers/scsi/ips.h | |||
@@ -87,15 +87,14 @@ | |||
87 | #define scsi_set_pci_device(sh,dev) (0) | 87 | #define scsi_set_pci_device(sh,dev) (0) |
88 | #endif | 88 | #endif |
89 | 89 | ||
90 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | 90 | #ifndef IRQ_NONE |
91 | 91 | typedef void irqreturn_t; | |
92 | #ifndef irqreturn_t | ||
93 | typedef void irqreturn_t; | ||
94 | #endif | ||
95 | |||
96 | #define IRQ_NONE | 92 | #define IRQ_NONE |
97 | #define IRQ_HANDLED | 93 | #define IRQ_HANDLED |
98 | #define IRQ_RETVAL(x) | 94 | #define IRQ_RETVAL(x) |
95 | #endif | ||
96 | |||
97 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) | ||
99 | #define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT) | 98 | #define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT) |
100 | #define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT) | 99 | #define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT) |
101 | #define IPS_ADD_HOST(shost,device) | 100 | #define IPS_ADD_HOST(shost,device) |
@@ -123,6 +122,10 @@ | |||
123 | #ifndef min | 122 | #ifndef min |
124 | #define min(x,y) ((x) < (y) ? x : y) | 123 | #define min(x,y) ((x) < (y) ? x : y) |
125 | #endif | 124 | #endif |
125 | |||
126 | #ifndef __iomem /* For clean compiles in earlier kernels without __iomem annotations */ | ||
127 | #define __iomem | ||
128 | #endif | ||
126 | 129 | ||
127 | #define pci_dma_hi32(a) ((a >> 16) >> 16) | 130 | #define pci_dma_hi32(a) ((a >> 16) >> 16) |
128 | #define pci_dma_lo32(a) (a & 0xffffffff) | 131 | #define pci_dma_lo32(a) (a & 0xffffffff) |
@@ -1206,13 +1209,13 @@ typedef struct { | |||
1206 | 1209 | ||
1207 | #define IPS_VER_MAJOR 7 | 1210 | #define IPS_VER_MAJOR 7 |
1208 | #define IPS_VER_MAJOR_STRING "7" | 1211 | #define IPS_VER_MAJOR_STRING "7" |
1209 | #define IPS_VER_MINOR 10 | 1212 | #define IPS_VER_MINOR 12 |
1210 | #define IPS_VER_MINOR_STRING "10" | 1213 | #define IPS_VER_MINOR_STRING "12" |
1211 | #define IPS_VER_BUILD 18 | 1214 | #define IPS_VER_BUILD 02 |
1212 | #define IPS_VER_BUILD_STRING "18" | 1215 | #define IPS_VER_BUILD_STRING "02" |
1213 | #define IPS_VER_STRING "7.10.18" | 1216 | #define IPS_VER_STRING "7.12.02" |
1214 | #define IPS_RELEASE_ID 0x00020000 | 1217 | #define IPS_RELEASE_ID 0x00020000 |
1215 | #define IPS_BUILD_IDENT 731 | 1218 | #define IPS_BUILD_IDENT 761 |
1216 | #define IPS_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2002. All Rights Reserved." | 1219 | #define IPS_LEGALCOPYRIGHT_STRING "(C) Copyright IBM Corp. 1994, 2002. All Rights Reserved." |
1217 | #define IPS_ADAPTECCOPYRIGHT_STRING "(c) Copyright Adaptec, Inc. 2002 to 2004. All Rights Reserved." | 1220 | #define IPS_ADAPTECCOPYRIGHT_STRING "(c) Copyright Adaptec, Inc. 2002 to 2004. All Rights Reserved." |
1218 | #define IPS_DELLCOPYRIGHT_STRING "(c) Copyright Dell 2004. All Rights Reserved." | 1221 | #define IPS_DELLCOPYRIGHT_STRING "(c) Copyright Dell 2004. All Rights Reserved." |
@@ -1223,12 +1226,12 @@ typedef struct { | |||
1223 | #define IPS_VER_SERVERAID2 "2.88.13" | 1226 | #define IPS_VER_SERVERAID2 "2.88.13" |
1224 | #define IPS_VER_NAVAJO "2.88.13" | 1227 | #define IPS_VER_NAVAJO "2.88.13" |
1225 | #define IPS_VER_SERVERAID3 "6.10.24" | 1228 | #define IPS_VER_SERVERAID3 "6.10.24" |
1226 | #define IPS_VER_SERVERAID4H "7.10.11" | 1229 | #define IPS_VER_SERVERAID4H "7.12.02" |
1227 | #define IPS_VER_SERVERAID4MLx "7.10.18" | 1230 | #define IPS_VER_SERVERAID4MLx "7.12.02" |
1228 | #define IPS_VER_SARASOTA "7.10.18" | 1231 | #define IPS_VER_SARASOTA "7.12.02" |
1229 | #define IPS_VER_MARCO "7.10.18" | 1232 | #define IPS_VER_MARCO "7.12.02" |
1230 | #define IPS_VER_SEBRING "7.10.18" | 1233 | #define IPS_VER_SEBRING "7.12.02" |
1231 | #define IPS_VER_KEYWEST "7.10.18" | 1234 | #define IPS_VER_KEYWEST "7.12.02" |
1232 | 1235 | ||
1233 | /* Compatability IDs for various adapters */ | 1236 | /* Compatability IDs for various adapters */ |
1234 | #define IPS_COMPAT_UNKNOWN "" | 1237 | #define IPS_COMPAT_UNKNOWN "" |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 73b1f72b7e43..f4e7dcb6492b 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2268,19 +2268,6 @@ void ata_qc_prep(struct ata_queued_cmd *qc) | |||
2268 | * spin_lock_irqsave(host_set lock) | 2268 | * spin_lock_irqsave(host_set lock) |
2269 | */ | 2269 | */ |
2270 | 2270 | ||
2271 | |||
2272 | |||
2273 | /** | ||
2274 | * ata_sg_init_one - Prepare a one-entry scatter-gather list. | ||
2275 | * @qc: Queued command | ||
2276 | * @buf: transfer buffer | ||
2277 | * @buflen: length of buf | ||
2278 | * | ||
2279 | * Builds a single-entry scatter-gather list to initiate a | ||
2280 | * transfer utilizing the specified buffer. | ||
2281 | * | ||
2282 | * LOCKING: | ||
2283 | */ | ||
2284 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) | 2271 | void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) |
2285 | { | 2272 | { |
2286 | struct scatterlist *sg; | 2273 | struct scatterlist *sg; |
@@ -2312,18 +2299,6 @@ void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen) | |||
2312 | * spin_lock_irqsave(host_set lock) | 2299 | * spin_lock_irqsave(host_set lock) |
2313 | */ | 2300 | */ |
2314 | 2301 | ||
2315 | |||
2316 | /** | ||
2317 | * ata_sg_init - Assign a scatter gather list to a queued command | ||
2318 | * @qc: Queued command | ||
2319 | * @sg: Scatter-gather list | ||
2320 | * @n_elem: length of sg list | ||
2321 | * | ||
2322 | * Attaches a scatter-gather list to a queued command. | ||
2323 | * | ||
2324 | * LOCKING: | ||
2325 | */ | ||
2326 | |||
2327 | void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 2302 | void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
2328 | unsigned int n_elem) | 2303 | unsigned int n_elem) |
2329 | { | 2304 | { |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 794fb559efb0..6a75ec2187fd 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -385,6 +385,7 @@ int ata_scsi_error(struct Scsi_Host *host) | |||
385 | * appropriate place | 385 | * appropriate place |
386 | */ | 386 | */ |
387 | host->host_failed--; | 387 | host->host_failed--; |
388 | INIT_LIST_HEAD(&host->eh_cmd_q); | ||
388 | 389 | ||
389 | DPRINTK("EXIT\n"); | 390 | DPRINTK("EXIT\n"); |
390 | return 0; | 391 | return 0; |
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h index d90430bbb0de..3e7f4843020f 100644 --- a/drivers/scsi/libata.h +++ b/drivers/scsi/libata.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define __LIBATA_H__ | 26 | #define __LIBATA_H__ |
27 | 27 | ||
28 | #define DRV_NAME "libata" | 28 | #define DRV_NAME "libata" |
29 | #define DRV_VERSION "1.11" /* must be exactly four chars */ | 29 | #define DRV_VERSION "1.12" /* must be exactly four chars */ |
30 | 30 | ||
31 | struct ata_scsi_args { | 31 | struct ata_scsi_args { |
32 | u16 *id; | 32 | u16 *id; |
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c index 5c1d4411457a..919fb314ad10 100644 --- a/drivers/scsi/sata_promise.c +++ b/drivers/scsi/sata_promise.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include "sata_promise.h" | 40 | #include "sata_promise.h" |
41 | 41 | ||
42 | #define DRV_NAME "sata_promise" | 42 | #define DRV_NAME "sata_promise" |
43 | #define DRV_VERSION "1.01" | 43 | #define DRV_VERSION "1.02" |
44 | 44 | ||
45 | 45 | ||
46 | enum { | 46 | enum { |
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index 140cea05de3f..efd7d7a61135 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -468,7 +468,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
468 | for (i = 0; i < last; i++) { | 468 | for (i = 0; i < last; i++) { |
469 | buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); | 469 | buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); |
470 | buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); | 470 | buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); |
471 | total_len += sg[i].length; | 471 | total_len += sg_dma_len(&sg[i]); |
472 | } | 472 | } |
473 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); | 473 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); |
474 | sgt_len = idx * 4; | 474 | sgt_len = idx * 4; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 060010bccabc..278e0c99b2ae 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -232,23 +232,6 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd, | |||
232 | } | 232 | } |
233 | EXPORT_SYMBOL(scsi_do_req); | 233 | EXPORT_SYMBOL(scsi_do_req); |
234 | 234 | ||
235 | static void scsi_wait_done(struct scsi_cmnd *cmd) | ||
236 | { | ||
237 | struct request *req = cmd->request; | ||
238 | struct request_queue *q = cmd->device->request_queue; | ||
239 | unsigned long flags; | ||
240 | |||
241 | req->rq_status = RQ_SCSI_DONE; /* Busy, but indicate request done */ | ||
242 | |||
243 | spin_lock_irqsave(q->queue_lock, flags); | ||
244 | if (blk_rq_tagged(req)) | ||
245 | blk_queue_end_tag(q, req); | ||
246 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
247 | |||
248 | if (req->waiting) | ||
249 | complete(req->waiting); | ||
250 | } | ||
251 | |||
252 | /* This is the end routine we get to if a command was never attached | 235 | /* This is the end routine we get to if a command was never attached |
253 | * to the request. Simply complete the request without changing | 236 | * to the request. Simply complete the request without changing |
254 | * rq_status; this will cause a DRIVER_ERROR. */ | 237 | * rq_status; this will cause a DRIVER_ERROR. */ |
@@ -263,21 +246,90 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer, | |||
263 | unsigned bufflen, int timeout, int retries) | 246 | unsigned bufflen, int timeout, int retries) |
264 | { | 247 | { |
265 | DECLARE_COMPLETION(wait); | 248 | DECLARE_COMPLETION(wait); |
266 | 249 | int write = (sreq->sr_data_direction == DMA_TO_DEVICE); | |
267 | sreq->sr_request->waiting = &wait; | 250 | struct request *req; |
268 | sreq->sr_request->rq_status = RQ_SCSI_BUSY; | 251 | |
269 | sreq->sr_request->end_io = scsi_wait_req_end_io; | 252 | req = blk_get_request(sreq->sr_device->request_queue, write, |
270 | scsi_do_req(sreq, cmnd, buffer, bufflen, scsi_wait_done, | 253 | __GFP_WAIT); |
271 | timeout, retries); | 254 | if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req, |
255 | buffer, bufflen, __GFP_WAIT)) { | ||
256 | sreq->sr_result = DRIVER_ERROR << 24; | ||
257 | blk_put_request(req); | ||
258 | return; | ||
259 | } | ||
260 | |||
261 | req->flags |= REQ_NOMERGE; | ||
262 | req->waiting = &wait; | ||
263 | req->end_io = scsi_wait_req_end_io; | ||
264 | req->cmd_len = COMMAND_SIZE(((u8 *)cmnd)[0]); | ||
265 | req->sense = sreq->sr_sense_buffer; | ||
266 | req->sense_len = 0; | ||
267 | memcpy(req->cmd, cmnd, req->cmd_len); | ||
268 | req->timeout = timeout; | ||
269 | req->flags |= REQ_BLOCK_PC; | ||
270 | req->rq_disk = NULL; | ||
271 | blk_insert_request(sreq->sr_device->request_queue, req, | ||
272 | sreq->sr_data_direction == DMA_TO_DEVICE, NULL); | ||
272 | wait_for_completion(&wait); | 273 | wait_for_completion(&wait); |
273 | sreq->sr_request->waiting = NULL; | 274 | sreq->sr_request->waiting = NULL; |
274 | if (sreq->sr_request->rq_status != RQ_SCSI_DONE) | 275 | sreq->sr_result = req->errors; |
276 | if (req->errors) | ||
275 | sreq->sr_result |= (DRIVER_ERROR << 24); | 277 | sreq->sr_result |= (DRIVER_ERROR << 24); |
276 | 278 | ||
277 | __scsi_release_request(sreq); | 279 | blk_put_request(req); |
278 | } | 280 | } |
281 | |||
279 | EXPORT_SYMBOL(scsi_wait_req); | 282 | EXPORT_SYMBOL(scsi_wait_req); |
280 | 283 | ||
284 | /** | ||
285 | * scsi_execute_req - insert request and wait for the result | ||
286 | * @sdev: scsi device | ||
287 | * @cmd: scsi command | ||
288 | * @data_direction: data direction | ||
289 | * @buffer: data buffer | ||
290 | * @bufflen: len of buffer | ||
291 | * @sense: optional sense buffer | ||
292 | * @timeout: request timeout in seconds | ||
293 | * @retries: number of times to retry request | ||
294 | * | ||
295 | * scsi_execute_req returns the req->errors value which is the | ||
296 | * the scsi_cmnd result field. | ||
297 | **/ | ||
298 | int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, | ||
299 | int data_direction, void *buffer, unsigned bufflen, | ||
300 | unsigned char *sense, int timeout, int retries) | ||
301 | { | ||
302 | struct request *req; | ||
303 | int write = (data_direction == DMA_TO_DEVICE); | ||
304 | int ret = DRIVER_ERROR << 24; | ||
305 | |||
306 | req = blk_get_request(sdev->request_queue, write, __GFP_WAIT); | ||
307 | |||
308 | if (bufflen && blk_rq_map_kern(sdev->request_queue, req, | ||
309 | buffer, bufflen, __GFP_WAIT)) | ||
310 | goto out; | ||
311 | |||
312 | req->cmd_len = COMMAND_SIZE(cmd[0]); | ||
313 | memcpy(req->cmd, cmd, req->cmd_len); | ||
314 | req->sense = sense; | ||
315 | req->sense_len = 0; | ||
316 | req->timeout = timeout; | ||
317 | req->flags |= REQ_BLOCK_PC | REQ_SPECIAL; | ||
318 | |||
319 | /* | ||
320 | * head injection *required* here otherwise quiesce won't work | ||
321 | */ | ||
322 | blk_execute_rq(req->q, NULL, req, 1); | ||
323 | |||
324 | ret = req->errors; | ||
325 | out: | ||
326 | blk_put_request(req); | ||
327 | |||
328 | return ret; | ||
329 | } | ||
330 | |||
331 | EXPORT_SYMBOL(scsi_execute_req); | ||
332 | |||
281 | /* | 333 | /* |
282 | * Function: scsi_init_cmd_errh() | 334 | * Function: scsi_init_cmd_errh() |
283 | * | 335 | * |
@@ -878,11 +930,12 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
878 | return; | 930 | return; |
879 | } | 931 | } |
880 | if (result) { | 932 | if (result) { |
881 | printk(KERN_INFO "SCSI error : <%d %d %d %d> return code " | 933 | if (!(req->flags & REQ_SPECIAL)) |
882 | "= 0x%x\n", cmd->device->host->host_no, | 934 | printk(KERN_INFO "SCSI error : <%d %d %d %d> return code " |
883 | cmd->device->channel, | 935 | "= 0x%x\n", cmd->device->host->host_no, |
884 | cmd->device->id, | 936 | cmd->device->channel, |
885 | cmd->device->lun, result); | 937 | cmd->device->id, |
938 | cmd->device->lun, result); | ||
886 | 939 | ||
887 | if (driver_byte(result) & DRIVER_SENSE) | 940 | if (driver_byte(result) & DRIVER_SENSE) |
888 | scsi_print_sense("", cmd); | 941 | scsi_print_sense("", cmd); |
@@ -1020,6 +1073,12 @@ static int scsi_issue_flush_fn(request_queue_t *q, struct gendisk *disk, | |||
1020 | return -EOPNOTSUPP; | 1073 | return -EOPNOTSUPP; |
1021 | } | 1074 | } |
1022 | 1075 | ||
1076 | static void scsi_generic_done(struct scsi_cmnd *cmd) | ||
1077 | { | ||
1078 | BUG_ON(!blk_pc_request(cmd->request)); | ||
1079 | scsi_io_completion(cmd, cmd->result == 0 ? cmd->bufflen : 0, 0); | ||
1080 | } | ||
1081 | |||
1023 | static int scsi_prep_fn(struct request_queue *q, struct request *req) | 1082 | static int scsi_prep_fn(struct request_queue *q, struct request *req) |
1024 | { | 1083 | { |
1025 | struct scsi_device *sdev = q->queuedata; | 1084 | struct scsi_device *sdev = q->queuedata; |
@@ -1061,7 +1120,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1061 | * these two cases differently. We differentiate by looking | 1120 | * these two cases differently. We differentiate by looking |
1062 | * at request->cmd, as this tells us the real story. | 1121 | * at request->cmd, as this tells us the real story. |
1063 | */ | 1122 | */ |
1064 | if (req->flags & REQ_SPECIAL) { | 1123 | if (req->flags & REQ_SPECIAL && req->special) { |
1065 | struct scsi_request *sreq = req->special; | 1124 | struct scsi_request *sreq = req->special; |
1066 | 1125 | ||
1067 | if (sreq->sr_magic == SCSI_REQ_MAGIC) { | 1126 | if (sreq->sr_magic == SCSI_REQ_MAGIC) { |
@@ -1073,7 +1132,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1073 | cmd = req->special; | 1132 | cmd = req->special; |
1074 | } else if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { | 1133 | } else if (req->flags & (REQ_CMD | REQ_BLOCK_PC)) { |
1075 | 1134 | ||
1076 | if(unlikely(specials_only)) { | 1135 | if(unlikely(specials_only) && !(req->flags & REQ_SPECIAL)) { |
1077 | if(specials_only == SDEV_QUIESCE || | 1136 | if(specials_only == SDEV_QUIESCE || |
1078 | specials_only == SDEV_BLOCK) | 1137 | specials_only == SDEV_BLOCK) |
1079 | return BLKPREP_DEFER; | 1138 | return BLKPREP_DEFER; |
@@ -1142,11 +1201,26 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) | |||
1142 | /* | 1201 | /* |
1143 | * Initialize the actual SCSI command for this request. | 1202 | * Initialize the actual SCSI command for this request. |
1144 | */ | 1203 | */ |
1145 | drv = *(struct scsi_driver **)req->rq_disk->private_data; | 1204 | if (req->rq_disk) { |
1146 | if (unlikely(!drv->init_command(cmd))) { | 1205 | drv = *(struct scsi_driver **)req->rq_disk->private_data; |
1147 | scsi_release_buffers(cmd); | 1206 | if (unlikely(!drv->init_command(cmd))) { |
1148 | scsi_put_command(cmd); | 1207 | scsi_release_buffers(cmd); |
1149 | return BLKPREP_KILL; | 1208 | scsi_put_command(cmd); |
1209 | return BLKPREP_KILL; | ||
1210 | } | ||
1211 | } else { | ||
1212 | memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd)); | ||
1213 | if (rq_data_dir(req) == WRITE) | ||
1214 | cmd->sc_data_direction = DMA_TO_DEVICE; | ||
1215 | else if (req->data_len) | ||
1216 | cmd->sc_data_direction = DMA_FROM_DEVICE; | ||
1217 | else | ||
1218 | cmd->sc_data_direction = DMA_NONE; | ||
1219 | |||
1220 | cmd->transfersize = req->data_len; | ||
1221 | cmd->allowed = 3; | ||
1222 | cmd->timeout_per_command = req->timeout; | ||
1223 | cmd->done = scsi_generic_done; | ||
1150 | } | 1224 | } |
1151 | } | 1225 | } |
1152 | 1226 | ||
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 076cbe3b5a05..0048beaffc9f 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -111,15 +111,14 @@ MODULE_PARM_DESC(inq_timeout, | |||
111 | 111 | ||
112 | /** | 112 | /** |
113 | * scsi_unlock_floptical - unlock device via a special MODE SENSE command | 113 | * scsi_unlock_floptical - unlock device via a special MODE SENSE command |
114 | * @sreq: used to send the command | 114 | * @sdev: scsi device to send command to |
115 | * @result: area to store the result of the MODE SENSE | 115 | * @result: area to store the result of the MODE SENSE |
116 | * | 116 | * |
117 | * Description: | 117 | * Description: |
118 | * Send a vendor specific MODE SENSE (not a MODE SELECT) command using | 118 | * Send a vendor specific MODE SENSE (not a MODE SELECT) command. |
119 | * @sreq to unlock a device, storing the (unused) results into result. | ||
120 | * Called for BLIST_KEY devices. | 119 | * Called for BLIST_KEY devices. |
121 | **/ | 120 | **/ |
122 | static void scsi_unlock_floptical(struct scsi_request *sreq, | 121 | static void scsi_unlock_floptical(struct scsi_device *sdev, |
123 | unsigned char *result) | 122 | unsigned char *result) |
124 | { | 123 | { |
125 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; | 124 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; |
@@ -129,11 +128,10 @@ static void scsi_unlock_floptical(struct scsi_request *sreq, | |||
129 | scsi_cmd[1] = 0; | 128 | scsi_cmd[1] = 0; |
130 | scsi_cmd[2] = 0x2e; | 129 | scsi_cmd[2] = 0x2e; |
131 | scsi_cmd[3] = 0; | 130 | scsi_cmd[3] = 0; |
132 | scsi_cmd[4] = 0x2a; /* size */ | 131 | scsi_cmd[4] = 0x2a; /* size */ |
133 | scsi_cmd[5] = 0; | 132 | scsi_cmd[5] = 0; |
134 | sreq->sr_cmd_len = 0; | 133 | scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL, |
135 | sreq->sr_data_direction = DMA_FROM_DEVICE; | 134 | SCSI_TIMEOUT, 3); |
136 | scsi_wait_req(sreq, scsi_cmd, result, 0x2a /* size */, SCSI_TIMEOUT, 3); | ||
137 | } | 135 | } |
138 | 136 | ||
139 | /** | 137 | /** |
@@ -336,9 +334,23 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
336 | unsigned long flags; | 334 | unsigned long flags; |
337 | const int size = sizeof(struct scsi_target) | 335 | const int size = sizeof(struct scsi_target) |
338 | + shost->transportt->target_size; | 336 | + shost->transportt->target_size; |
339 | struct scsi_target *starget = kmalloc(size, GFP_ATOMIC); | 337 | struct scsi_target *starget; |
340 | struct scsi_target *found_target; | 338 | struct scsi_target *found_target; |
341 | 339 | ||
340 | /* | ||
341 | * Obtain the real parent from the transport. The transport | ||
342 | * is allowed to fail (no error) if there is nothing at that | ||
343 | * target id. | ||
344 | */ | ||
345 | if (shost->transportt->target_parent) { | ||
346 | spin_lock_irqsave(shost->host_lock, flags); | ||
347 | parent = shost->transportt->target_parent(shost, channel, id); | ||
348 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
349 | if (!parent) | ||
350 | return NULL; | ||
351 | } | ||
352 | |||
353 | starget = kmalloc(size, GFP_KERNEL); | ||
342 | if (!starget) { | 354 | if (!starget) { |
343 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); | 355 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); |
344 | return NULL; | 356 | return NULL; |
@@ -419,26 +431,26 @@ void scsi_target_reap(struct scsi_target *starget) | |||
419 | 431 | ||
420 | /** | 432 | /** |
421 | * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY | 433 | * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY |
422 | * @sreq: used to send the INQUIRY | 434 | * @sdev: scsi_device to probe |
423 | * @inq_result: area to store the INQUIRY result | 435 | * @inq_result: area to store the INQUIRY result |
436 | * @result_len: len of inq_result | ||
424 | * @bflags: store any bflags found here | 437 | * @bflags: store any bflags found here |
425 | * | 438 | * |
426 | * Description: | 439 | * Description: |
427 | * Probe the lun associated with @sreq using a standard SCSI INQUIRY; | 440 | * Probe the lun associated with @req using a standard SCSI INQUIRY; |
428 | * | 441 | * |
429 | * If the INQUIRY is successful, sreq->sr_result is zero and: the | 442 | * If the INQUIRY is successful, zero is returned and the |
430 | * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length | 443 | * INQUIRY data is in @inq_result; the scsi_level and INQUIRY length |
431 | * are copied to the Scsi_Device at @sreq->sr_device (sdev); | 444 | * are copied to the Scsi_Device any flags value is stored in *@bflags. |
432 | * any flags value is stored in *@bflags. | ||
433 | **/ | 445 | **/ |
434 | static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, | 446 | static int scsi_probe_lun(struct scsi_device *sdev, char *inq_result, |
435 | int *bflags) | 447 | int result_len, int *bflags) |
436 | { | 448 | { |
437 | struct scsi_device *sdev = sreq->sr_device; /* a bit ugly */ | 449 | char sense[SCSI_SENSE_BUFFERSIZE]; |
438 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; | 450 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; |
439 | int first_inquiry_len, try_inquiry_len, next_inquiry_len; | 451 | int first_inquiry_len, try_inquiry_len, next_inquiry_len; |
440 | int response_len = 0; | 452 | int response_len = 0; |
441 | int pass, count; | 453 | int pass, count, result; |
442 | struct scsi_sense_hdr sshdr; | 454 | struct scsi_sense_hdr sshdr; |
443 | 455 | ||
444 | *bflags = 0; | 456 | *bflags = 0; |
@@ -461,28 +473,28 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, | |||
461 | memset(scsi_cmd, 0, 6); | 473 | memset(scsi_cmd, 0, 6); |
462 | scsi_cmd[0] = INQUIRY; | 474 | scsi_cmd[0] = INQUIRY; |
463 | scsi_cmd[4] = (unsigned char) try_inquiry_len; | 475 | scsi_cmd[4] = (unsigned char) try_inquiry_len; |
464 | sreq->sr_cmd_len = 0; | ||
465 | sreq->sr_data_direction = DMA_FROM_DEVICE; | ||
466 | 476 | ||
477 | memset(sense, 0, sizeof(sense)); | ||
467 | memset(inq_result, 0, try_inquiry_len); | 478 | memset(inq_result, 0, try_inquiry_len); |
468 | scsi_wait_req(sreq, (void *) scsi_cmd, (void *) inq_result, | 479 | |
469 | try_inquiry_len, | 480 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, |
470 | HZ/2 + HZ*scsi_inq_timeout, 3); | 481 | inq_result, try_inquiry_len, sense, |
482 | HZ / 2 + HZ * scsi_inq_timeout, 3); | ||
471 | 483 | ||
472 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY %s " | 484 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY %s " |
473 | "with code 0x%x\n", | 485 | "with code 0x%x\n", |
474 | sreq->sr_result ? "failed" : "successful", | 486 | result ? "failed" : "successful", result)); |
475 | sreq->sr_result)); | ||
476 | 487 | ||
477 | if (sreq->sr_result) { | 488 | if (result) { |
478 | /* | 489 | /* |
479 | * not-ready to ready transition [asc/ascq=0x28/0x0] | 490 | * not-ready to ready transition [asc/ascq=0x28/0x0] |
480 | * or power-on, reset [asc/ascq=0x29/0x0], continue. | 491 | * or power-on, reset [asc/ascq=0x29/0x0], continue. |
481 | * INQUIRY should not yield UNIT_ATTENTION | 492 | * INQUIRY should not yield UNIT_ATTENTION |
482 | * but many buggy devices do so anyway. | 493 | * but many buggy devices do so anyway. |
483 | */ | 494 | */ |
484 | if ((driver_byte(sreq->sr_result) & DRIVER_SENSE) && | 495 | if ((driver_byte(result) & DRIVER_SENSE) && |
485 | scsi_request_normalize_sense(sreq, &sshdr)) { | 496 | scsi_normalize_sense(sense, sizeof(sense), |
497 | &sshdr)) { | ||
486 | if ((sshdr.sense_key == UNIT_ATTENTION) && | 498 | if ((sshdr.sense_key == UNIT_ATTENTION) && |
487 | ((sshdr.asc == 0x28) || | 499 | ((sshdr.asc == 0x28) || |
488 | (sshdr.asc == 0x29)) && | 500 | (sshdr.asc == 0x29)) && |
@@ -493,7 +505,7 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, | |||
493 | break; | 505 | break; |
494 | } | 506 | } |
495 | 507 | ||
496 | if (sreq->sr_result == 0) { | 508 | if (result == 0) { |
497 | response_len = (unsigned char) inq_result[4] + 5; | 509 | response_len = (unsigned char) inq_result[4] + 5; |
498 | if (response_len > 255) | 510 | if (response_len > 255) |
499 | response_len = first_inquiry_len; /* sanity */ | 511 | response_len = first_inquiry_len; /* sanity */ |
@@ -542,8 +554,8 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, | |||
542 | 554 | ||
543 | /* If the last transfer attempt got an error, assume the | 555 | /* If the last transfer attempt got an error, assume the |
544 | * peripheral doesn't exist or is dead. */ | 556 | * peripheral doesn't exist or is dead. */ |
545 | if (sreq->sr_result) | 557 | if (result) |
546 | return; | 558 | return -EIO; |
547 | 559 | ||
548 | /* Don't report any more data than the device says is valid */ | 560 | /* Don't report any more data than the device says is valid */ |
549 | sdev->inquiry_len = min(try_inquiry_len, response_len); | 561 | sdev->inquiry_len = min(try_inquiry_len, response_len); |
@@ -579,7 +591,7 @@ static void scsi_probe_lun(struct scsi_request *sreq, char *inq_result, | |||
579 | (sdev->scsi_level == 1 && (inq_result[3] & 0x0f) == 1)) | 591 | (sdev->scsi_level == 1 && (inq_result[3] & 0x0f) == 1)) |
580 | sdev->scsi_level++; | 592 | sdev->scsi_level++; |
581 | 593 | ||
582 | return; | 594 | return 0; |
583 | } | 595 | } |
584 | 596 | ||
585 | /** | 597 | /** |
@@ -786,9 +798,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
786 | void *hostdata) | 798 | void *hostdata) |
787 | { | 799 | { |
788 | struct scsi_device *sdev; | 800 | struct scsi_device *sdev; |
789 | struct scsi_request *sreq; | ||
790 | unsigned char *result; | 801 | unsigned char *result; |
791 | int bflags, res = SCSI_SCAN_NO_RESPONSE; | 802 | int bflags, res = SCSI_SCAN_NO_RESPONSE, result_len = 256; |
792 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 803 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); |
793 | 804 | ||
794 | /* | 805 | /* |
@@ -817,16 +828,13 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
817 | sdev = scsi_alloc_sdev(starget, lun, hostdata); | 828 | sdev = scsi_alloc_sdev(starget, lun, hostdata); |
818 | if (!sdev) | 829 | if (!sdev) |
819 | goto out; | 830 | goto out; |
820 | sreq = scsi_allocate_request(sdev, GFP_ATOMIC); | 831 | |
821 | if (!sreq) | 832 | result = kmalloc(result_len, GFP_ATOMIC | |
822 | goto out_free_sdev; | ||
823 | result = kmalloc(256, GFP_ATOMIC | | ||
824 | ((shost->unchecked_isa_dma) ? __GFP_DMA : 0)); | 833 | ((shost->unchecked_isa_dma) ? __GFP_DMA : 0)); |
825 | if (!result) | 834 | if (!result) |
826 | goto out_free_sreq; | 835 | goto out_free_sdev; |
827 | 836 | ||
828 | scsi_probe_lun(sreq, result, &bflags); | 837 | if (scsi_probe_lun(sdev, result, result_len, &bflags)) |
829 | if (sreq->sr_result) | ||
830 | goto out_free_result; | 838 | goto out_free_result; |
831 | 839 | ||
832 | /* | 840 | /* |
@@ -854,7 +862,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
854 | if (res == SCSI_SCAN_LUN_PRESENT) { | 862 | if (res == SCSI_SCAN_LUN_PRESENT) { |
855 | if (bflags & BLIST_KEY) { | 863 | if (bflags & BLIST_KEY) { |
856 | sdev->lockable = 0; | 864 | sdev->lockable = 0; |
857 | scsi_unlock_floptical(sreq, result); | 865 | scsi_unlock_floptical(sdev, result); |
858 | } | 866 | } |
859 | if (bflagsp) | 867 | if (bflagsp) |
860 | *bflagsp = bflags; | 868 | *bflagsp = bflags; |
@@ -862,8 +870,6 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
862 | 870 | ||
863 | out_free_result: | 871 | out_free_result: |
864 | kfree(result); | 872 | kfree(result); |
865 | out_free_sreq: | ||
866 | scsi_release_request(sreq); | ||
867 | out_free_sdev: | 873 | out_free_sdev: |
868 | if (res == SCSI_SCAN_LUN_PRESENT) { | 874 | if (res == SCSI_SCAN_LUN_PRESENT) { |
869 | if (sdevp) { | 875 | if (sdevp) { |
@@ -1051,13 +1057,14 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1051 | int rescan) | 1057 | int rescan) |
1052 | { | 1058 | { |
1053 | char devname[64]; | 1059 | char devname[64]; |
1060 | char sense[SCSI_SENSE_BUFFERSIZE]; | ||
1054 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; | 1061 | unsigned char scsi_cmd[MAX_COMMAND_SIZE]; |
1055 | unsigned int length; | 1062 | unsigned int length; |
1056 | unsigned int lun; | 1063 | unsigned int lun; |
1057 | unsigned int num_luns; | 1064 | unsigned int num_luns; |
1058 | unsigned int retries; | 1065 | unsigned int retries; |
1066 | int result; | ||
1059 | struct scsi_lun *lunp, *lun_data; | 1067 | struct scsi_lun *lunp, *lun_data; |
1060 | struct scsi_request *sreq; | ||
1061 | u8 *data; | 1068 | u8 *data; |
1062 | struct scsi_sense_hdr sshdr; | 1069 | struct scsi_sense_hdr sshdr; |
1063 | struct scsi_target *starget = scsi_target(sdev); | 1070 | struct scsi_target *starget = scsi_target(sdev); |
@@ -1075,10 +1082,6 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1075 | if (bflags & BLIST_NOLUN) | 1082 | if (bflags & BLIST_NOLUN) |
1076 | return 0; | 1083 | return 0; |
1077 | 1084 | ||
1078 | sreq = scsi_allocate_request(sdev, GFP_ATOMIC); | ||
1079 | if (!sreq) | ||
1080 | goto out; | ||
1081 | |||
1082 | sprintf(devname, "host %d channel %d id %d", | 1085 | sprintf(devname, "host %d channel %d id %d", |
1083 | sdev->host->host_no, sdev->channel, sdev->id); | 1086 | sdev->host->host_no, sdev->channel, sdev->id); |
1084 | 1087 | ||
@@ -1096,7 +1099,7 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1096 | lun_data = kmalloc(length, GFP_ATOMIC | | 1099 | lun_data = kmalloc(length, GFP_ATOMIC | |
1097 | (sdev->host->unchecked_isa_dma ? __GFP_DMA : 0)); | 1100 | (sdev->host->unchecked_isa_dma ? __GFP_DMA : 0)); |
1098 | if (!lun_data) | 1101 | if (!lun_data) |
1099 | goto out_release_request; | 1102 | goto out; |
1100 | 1103 | ||
1101 | scsi_cmd[0] = REPORT_LUNS; | 1104 | scsi_cmd[0] = REPORT_LUNS; |
1102 | 1105 | ||
@@ -1115,8 +1118,6 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1115 | 1118 | ||
1116 | scsi_cmd[10] = 0; /* reserved */ | 1119 | scsi_cmd[10] = 0; /* reserved */ |
1117 | scsi_cmd[11] = 0; /* control */ | 1120 | scsi_cmd[11] = 0; /* control */ |
1118 | sreq->sr_cmd_len = 0; | ||
1119 | sreq->sr_data_direction = DMA_FROM_DEVICE; | ||
1120 | 1121 | ||
1121 | /* | 1122 | /* |
1122 | * We can get a UNIT ATTENTION, for example a power on/reset, so | 1123 | * We can get a UNIT ATTENTION, for example a power on/reset, so |
@@ -1132,29 +1133,30 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1132 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: Sending" | 1133 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: Sending" |
1133 | " REPORT LUNS to %s (try %d)\n", devname, | 1134 | " REPORT LUNS to %s (try %d)\n", devname, |
1134 | retries)); | 1135 | retries)); |
1135 | scsi_wait_req(sreq, scsi_cmd, lun_data, length, | 1136 | |
1136 | SCSI_TIMEOUT + 4*HZ, 3); | 1137 | memset(sense, 0, sizeof(sense)); |
1138 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, | ||
1139 | lun_data, length, sense, | ||
1140 | SCSI_TIMEOUT + 4 * HZ, 3); | ||
1141 | |||
1137 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUNS" | 1142 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUNS" |
1138 | " %s (try %d) result 0x%x\n", sreq->sr_result | 1143 | " %s (try %d) result 0x%x\n", result |
1139 | ? "failed" : "successful", retries, | 1144 | ? "failed" : "successful", retries, result)); |
1140 | sreq->sr_result)); | 1145 | if (result == 0) |
1141 | if (sreq->sr_result == 0) | ||
1142 | break; | 1146 | break; |
1143 | else if (scsi_request_normalize_sense(sreq, &sshdr)) { | 1147 | else if (scsi_normalize_sense(sense, sizeof(sense), &sshdr)) { |
1144 | if (sshdr.sense_key != UNIT_ATTENTION) | 1148 | if (sshdr.sense_key != UNIT_ATTENTION) |
1145 | break; | 1149 | break; |
1146 | } | 1150 | } |
1147 | } | 1151 | } |
1148 | 1152 | ||
1149 | if (sreq->sr_result) { | 1153 | if (result) { |
1150 | /* | 1154 | /* |
1151 | * The device probably does not support a REPORT LUN command | 1155 | * The device probably does not support a REPORT LUN command |
1152 | */ | 1156 | */ |
1153 | kfree(lun_data); | 1157 | kfree(lun_data); |
1154 | scsi_release_request(sreq); | ||
1155 | return 1; | 1158 | return 1; |
1156 | } | 1159 | } |
1157 | scsi_release_request(sreq); | ||
1158 | 1160 | ||
1159 | /* | 1161 | /* |
1160 | * Get the length from the first four bytes of lun_data. | 1162 | * Get the length from the first four bytes of lun_data. |
@@ -1228,8 +1230,6 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags, | |||
1228 | kfree(lun_data); | 1230 | kfree(lun_data); |
1229 | return 0; | 1231 | return 0; |
1230 | 1232 | ||
1231 | out_release_request: | ||
1232 | scsi_release_request(sreq); | ||
1233 | out: | 1233 | out: |
1234 | /* | 1234 | /* |
1235 | * We are out of memory, don't try scanning any further. | 1235 | * We are out of memory, don't try scanning any further. |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 96243c7fe110..2cab556b6e82 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -1024,6 +1024,23 @@ static int fc_rport_match(struct attribute_container *cont, | |||
1024 | return &i->rport_attr_cont.ac == cont; | 1024 | return &i->rport_attr_cont.ac == cont; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | |||
1028 | /* | ||
1029 | * Must be called with shost->host_lock held | ||
1030 | */ | ||
1031 | static struct device *fc_target_parent(struct Scsi_Host *shost, | ||
1032 | int channel, uint id) | ||
1033 | { | ||
1034 | struct fc_rport *rport; | ||
1035 | |||
1036 | list_for_each_entry(rport, &fc_host_rports(shost), peers) | ||
1037 | if ((rport->channel == channel) && | ||
1038 | (rport->scsi_target_id == id)) | ||
1039 | return &rport->dev; | ||
1040 | |||
1041 | return NULL; | ||
1042 | } | ||
1043 | |||
1027 | struct scsi_transport_template * | 1044 | struct scsi_transport_template * |
1028 | fc_attach_transport(struct fc_function_template *ft) | 1045 | fc_attach_transport(struct fc_function_template *ft) |
1029 | { | 1046 | { |
@@ -1059,6 +1076,8 @@ fc_attach_transport(struct fc_function_template *ft) | |||
1059 | 1076 | ||
1060 | /* Transport uses the shost workq for scsi scanning */ | 1077 | /* Transport uses the shost workq for scsi scanning */ |
1061 | i->t.create_work_queue = 1; | 1078 | i->t.create_work_queue = 1; |
1079 | |||
1080 | i->t.target_parent = fc_target_parent; | ||
1062 | 1081 | ||
1063 | /* | 1082 | /* |
1064 | * Setup SCSI Target Attributes. | 1083 | * Setup SCSI Target Attributes. |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 14fb179b3842..052d55c167d4 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -2970,23 +2970,22 @@ static void * dev_seq_start(struct seq_file *s, loff_t *pos) | |||
2970 | { | 2970 | { |
2971 | struct sg_proc_deviter * it = kmalloc(sizeof(*it), GFP_KERNEL); | 2971 | struct sg_proc_deviter * it = kmalloc(sizeof(*it), GFP_KERNEL); |
2972 | 2972 | ||
2973 | s->private = it; | ||
2973 | if (! it) | 2974 | if (! it) |
2974 | return NULL; | 2975 | return NULL; |
2976 | |||
2975 | if (NULL == sg_dev_arr) | 2977 | if (NULL == sg_dev_arr) |
2976 | goto err1; | 2978 | return NULL; |
2977 | it->index = *pos; | 2979 | it->index = *pos; |
2978 | it->max = sg_last_dev(); | 2980 | it->max = sg_last_dev(); |
2979 | if (it->index >= it->max) | 2981 | if (it->index >= it->max) |
2980 | goto err1; | 2982 | return NULL; |
2981 | return it; | 2983 | return it; |
2982 | err1: | ||
2983 | kfree(it); | ||
2984 | return NULL; | ||
2985 | } | 2984 | } |
2986 | 2985 | ||
2987 | static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos) | 2986 | static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos) |
2988 | { | 2987 | { |
2989 | struct sg_proc_deviter * it = (struct sg_proc_deviter *) v; | 2988 | struct sg_proc_deviter * it = s->private; |
2990 | 2989 | ||
2991 | *pos = ++it->index; | 2990 | *pos = ++it->index; |
2992 | return (it->index < it->max) ? it : NULL; | 2991 | return (it->index < it->max) ? it : NULL; |
@@ -2994,7 +2993,7 @@ static void * dev_seq_next(struct seq_file *s, void *v, loff_t *pos) | |||
2994 | 2993 | ||
2995 | static void dev_seq_stop(struct seq_file *s, void *v) | 2994 | static void dev_seq_stop(struct seq_file *s, void *v) |
2996 | { | 2995 | { |
2997 | kfree (v); | 2996 | kfree(s->private); |
2998 | } | 2997 | } |
2999 | 2998 | ||
3000 | static int sg_proc_open_dev(struct inode *inode, struct file *file) | 2999 | static int sg_proc_open_dev(struct inode *inode, struct file *file) |
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 47a5698a712a..9aadf2fcad6a 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -4241,12 +4241,10 @@ static int __init init_st(void) | |||
4241 | do_create_driverfs_files(); | 4241 | do_create_driverfs_files(); |
4242 | return 0; | 4242 | return 0; |
4243 | } | 4243 | } |
4244 | if (st_sysfs_class) | ||
4245 | class_destroy(st_sysfs_class); | ||
4246 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), | 4244 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), |
4247 | |||
4248 | ST_MAX_TAPE_ENTRIES); | 4245 | ST_MAX_TAPE_ENTRIES); |
4249 | } | 4246 | } |
4247 | class_destroy(st_sysfs_class); | ||
4250 | 4248 | ||
4251 | printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", SCSI_TAPE_MAJOR); | 4249 | printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", SCSI_TAPE_MAJOR); |
4252 | return 1; | 4250 | return 1; |
@@ -4254,13 +4252,11 @@ static int __init init_st(void) | |||
4254 | 4252 | ||
4255 | static void __exit exit_st(void) | 4253 | static void __exit exit_st(void) |
4256 | { | 4254 | { |
4257 | if (st_sysfs_class) | ||
4258 | class_destroy(st_sysfs_class); | ||
4259 | st_sysfs_class = NULL; | ||
4260 | do_remove_driverfs_files(); | 4255 | do_remove_driverfs_files(); |
4261 | scsi_unregister_driver(&st_template.gendrv); | 4256 | scsi_unregister_driver(&st_template.gendrv); |
4262 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), | 4257 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), |
4263 | ST_MAX_TAPE_ENTRIES); | 4258 | ST_MAX_TAPE_ENTRIES); |
4259 | class_destroy(st_sysfs_class); | ||
4264 | kfree(scsi_tapes); | 4260 | kfree(scsi_tapes); |
4265 | printk(KERN_INFO "st: Unloaded.\n"); | 4261 | printk(KERN_INFO "st: Unloaded.\n"); |
4266 | } | 4262 | } |
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 97034d3937fd..d5797618a3b9 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -211,7 +211,7 @@ comment "Non-8250 serial port support" | |||
211 | 211 | ||
212 | config SERIAL_AMBA_PL010 | 212 | config SERIAL_AMBA_PL010 |
213 | tristate "ARM AMBA PL010 serial port support" | 213 | tristate "ARM AMBA PL010 serial port support" |
214 | depends on ARM_AMBA | 214 | depends on ARM_AMBA && (BROKEN || !ARCH_VERSATILE) |
215 | select SERIAL_CORE | 215 | select SERIAL_CORE |
216 | help | 216 | help |
217 | This selects the ARM(R) AMBA(R) PrimeCell PL010 UART. If you have | 217 | This selects the ARM(R) AMBA(R) PrimeCell PL010 UART. If you have |
@@ -819,7 +819,7 @@ config SERIAL_M32R_SIO_CONSOLE | |||
819 | 819 | ||
820 | config SERIAL_M32R_PLDSIO | 820 | config SERIAL_M32R_PLDSIO |
821 | bool "M32R SIO I/F on a PLD" | 821 | bool "M32R SIO I/F on a PLD" |
822 | depends on SERIAL_M32R_SIO=y | 822 | depends on SERIAL_M32R_SIO=y && (PLAT_OPSPUT || PALT_USRV || PLAT_M32700UT) |
823 | default n | 823 | default n |
824 | help | 824 | help |
825 | Say Y here if you want to use the M32R serial controller | 825 | Say Y here if you want to use the M32R serial controller |
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h index 5f6187baad86..73c8a088c160 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h | |||
@@ -40,13 +40,15 @@ | |||
40 | #define TX_NUM_FIFO 4 | 40 | #define TX_NUM_FIFO 4 |
41 | #define TX_BUF_SIZE 32 | 41 | #define TX_BUF_SIZE 32 |
42 | 42 | ||
43 | #define SCC_WAIT_CLOSING 100 | ||
44 | |||
43 | struct uart_cpm_port { | 45 | struct uart_cpm_port { |
44 | struct uart_port port; | 46 | struct uart_port port; |
45 | u16 rx_nrfifos; | 47 | u16 rx_nrfifos; |
46 | u16 rx_fifosize; | 48 | u16 rx_fifosize; |
47 | u16 tx_nrfifos; | 49 | u16 tx_nrfifos; |
48 | u16 tx_fifosize; | 50 | u16 tx_fifosize; |
49 | smc_t *smcp; | 51 | smc_t *smcp; |
50 | smc_uart_t *smcup; | 52 | smc_uart_t *smcup; |
51 | scc_t *sccp; | 53 | scc_t *sccp; |
52 | scc_uart_t *sccup; | 54 | scc_uart_t *sccup; |
@@ -67,6 +69,8 @@ struct uart_cpm_port { | |||
67 | int bits; | 69 | int bits; |
68 | /* Keep track of 'odd' SMC2 wirings */ | 70 | /* Keep track of 'odd' SMC2 wirings */ |
69 | int is_portb; | 71 | int is_portb; |
72 | /* wait on close if needed */ | ||
73 | int wait_closing; | ||
70 | }; | 74 | }; |
71 | 75 | ||
72 | extern int cpm_uart_port_map[UART_NR]; | 76 | extern int cpm_uart_port_map[UART_NR]; |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 29db677d4284..d639ac92a117 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -9,9 +9,10 @@ | |||
9 | * | 9 | * |
10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
12 | * | 12 | * |
13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
14 | * (C) 2004 Intracom, S.A. | 14 | * (C) 2004 Intracom, S.A. |
15 | * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> | ||
15 | * | 16 | * |
16 | * This program is free software; you can redistribute it and/or modify | 17 | * This program is free software; you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License as published by | 18 | * it under the terms of the GNU General Public License as published by |
@@ -70,8 +71,22 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo); | |||
70 | 71 | ||
71 | /**************************************************************/ | 72 | /**************************************************************/ |
72 | 73 | ||
74 | static inline unsigned long cpu2cpm_addr(void *addr) | ||
75 | { | ||
76 | if ((unsigned long)addr >= CPM_ADDR) | ||
77 | return (unsigned long)addr; | ||
78 | return virt_to_bus(addr); | ||
79 | } | ||
80 | |||
81 | static inline void *cpm2cpu_addr(unsigned long addr) | ||
82 | { | ||
83 | if (addr >= CPM_ADDR) | ||
84 | return (void *)addr; | ||
85 | return bus_to_virt(addr); | ||
86 | } | ||
87 | |||
73 | /* | 88 | /* |
74 | * Check, if transmit buffers are processed | 89 | * Check, if transmit buffers are processed |
75 | */ | 90 | */ |
76 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) | 91 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) |
77 | { | 92 | { |
@@ -143,15 +158,18 @@ static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start) | |||
143 | } | 158 | } |
144 | 159 | ||
145 | if (cpm_uart_tx_pump(port) != 0) { | 160 | if (cpm_uart_tx_pump(port) != 0) { |
146 | if (IS_SMC(pinfo)) | 161 | if (IS_SMC(pinfo)) { |
147 | smcp->smc_smcm |= SMCM_TX; | 162 | smcp->smc_smcm |= SMCM_TX; |
148 | else | 163 | smcp->smc_smcmr |= SMCMR_TEN; |
164 | } else { | ||
149 | sccp->scc_sccm |= UART_SCCM_TX; | 165 | sccp->scc_sccm |= UART_SCCM_TX; |
166 | pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT; | ||
167 | } | ||
150 | } | 168 | } |
151 | } | 169 | } |
152 | 170 | ||
153 | /* | 171 | /* |
154 | * Stop receiver | 172 | * Stop receiver |
155 | */ | 173 | */ |
156 | static void cpm_uart_stop_rx(struct uart_port *port) | 174 | static void cpm_uart_stop_rx(struct uart_port *port) |
157 | { | 175 | { |
@@ -176,7 +194,7 @@ static void cpm_uart_enable_ms(struct uart_port *port) | |||
176 | } | 194 | } |
177 | 195 | ||
178 | /* | 196 | /* |
179 | * Generate a break. | 197 | * Generate a break. |
180 | */ | 198 | */ |
181 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) | 199 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) |
182 | { | 200 | { |
@@ -231,7 +249,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
231 | /* get number of characters, and check spce in flip-buffer */ | 249 | /* get number of characters, and check spce in flip-buffer */ |
232 | i = bdp->cbd_datlen; | 250 | i = bdp->cbd_datlen; |
233 | 251 | ||
234 | /* If we have not enough room in tty flip buffer, then we try | 252 | /* If we have not enough room in tty flip buffer, then we try |
235 | * later, which will be the next rx-interrupt or a timeout | 253 | * later, which will be the next rx-interrupt or a timeout |
236 | */ | 254 | */ |
237 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { | 255 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { |
@@ -243,7 +261,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
243 | } | 261 | } |
244 | 262 | ||
245 | /* get pointer */ | 263 | /* get pointer */ |
246 | cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr); | 264 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
247 | 265 | ||
248 | /* loop through the buffer */ | 266 | /* loop through the buffer */ |
249 | while (i-- > 0) { | 267 | while (i-- > 0) { |
@@ -265,13 +283,14 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
265 | } /* End while (i--) */ | 283 | } /* End while (i--) */ |
266 | 284 | ||
267 | /* This BD is ready to be used again. Clear status. get next */ | 285 | /* This BD is ready to be used again. Clear status. get next */ |
268 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); | 286 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); |
269 | bdp->cbd_sc |= BD_SC_EMPTY; | 287 | bdp->cbd_sc |= BD_SC_EMPTY; |
270 | 288 | ||
271 | if (bdp->cbd_sc & BD_SC_WRAP) | 289 | if (bdp->cbd_sc & BD_SC_WRAP) |
272 | bdp = pinfo->rx_bd_base; | 290 | bdp = pinfo->rx_bd_base; |
273 | else | 291 | else |
274 | bdp++; | 292 | bdp++; |
293 | |||
275 | } /* End for (;;) */ | 294 | } /* End for (;;) */ |
276 | 295 | ||
277 | /* Write back buffer pointer */ | 296 | /* Write back buffer pointer */ |
@@ -336,22 +355,22 @@ static irqreturn_t cpm_uart_int(int irq, void *data, struct pt_regs *regs) | |||
336 | 355 | ||
337 | if (IS_SMC(pinfo)) { | 356 | if (IS_SMC(pinfo)) { |
338 | events = smcp->smc_smce; | 357 | events = smcp->smc_smce; |
358 | smcp->smc_smce = events; | ||
339 | if (events & SMCM_BRKE) | 359 | if (events & SMCM_BRKE) |
340 | uart_handle_break(port); | 360 | uart_handle_break(port); |
341 | if (events & SMCM_RX) | 361 | if (events & SMCM_RX) |
342 | cpm_uart_int_rx(port, regs); | 362 | cpm_uart_int_rx(port, regs); |
343 | if (events & SMCM_TX) | 363 | if (events & SMCM_TX) |
344 | cpm_uart_int_tx(port, regs); | 364 | cpm_uart_int_tx(port, regs); |
345 | smcp->smc_smce = events; | ||
346 | } else { | 365 | } else { |
347 | events = sccp->scc_scce; | 366 | events = sccp->scc_scce; |
367 | sccp->scc_scce = events; | ||
348 | if (events & UART_SCCM_BRKE) | 368 | if (events & UART_SCCM_BRKE) |
349 | uart_handle_break(port); | 369 | uart_handle_break(port); |
350 | if (events & UART_SCCM_RX) | 370 | if (events & UART_SCCM_RX) |
351 | cpm_uart_int_rx(port, regs); | 371 | cpm_uart_int_rx(port, regs); |
352 | if (events & UART_SCCM_TX) | 372 | if (events & UART_SCCM_TX) |
353 | cpm_uart_int_tx(port, regs); | 373 | cpm_uart_int_tx(port, regs); |
354 | sccp->scc_scce = events; | ||
355 | } | 374 | } |
356 | return (events) ? IRQ_HANDLED : IRQ_NONE; | 375 | return (events) ? IRQ_HANDLED : IRQ_NONE; |
357 | } | 376 | } |
@@ -360,6 +379,7 @@ static int cpm_uart_startup(struct uart_port *port) | |||
360 | { | 379 | { |
361 | int retval; | 380 | int retval; |
362 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; | 381 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; |
382 | int line = pinfo - cpm_uart_ports; | ||
363 | 383 | ||
364 | pr_debug("CPM uart[%d]:startup\n", port->line); | 384 | pr_debug("CPM uart[%d]:startup\n", port->line); |
365 | 385 | ||
@@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_port *port) | |||
376 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; | 396 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; |
377 | } | 397 | } |
378 | 398 | ||
399 | if (!(pinfo->flags & FLAG_CONSOLE)) | ||
400 | cpm_line_cr_cmd(line,CPM_CR_INIT_TRX); | ||
379 | return 0; | 401 | return 0; |
380 | } | 402 | } |
381 | 403 | ||
404 | inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) | ||
405 | { | ||
406 | unsigned long target_jiffies = jiffies + pinfo->wait_closing; | ||
407 | |||
408 | while (!time_after(jiffies, target_jiffies)) | ||
409 | schedule(); | ||
410 | } | ||
411 | |||
382 | /* | 412 | /* |
383 | * Shutdown the uart | 413 | * Shutdown the uart |
384 | */ | 414 | */ |
@@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uart_port *port) | |||
394 | 424 | ||
395 | /* If the port is not the console, disable Rx and Tx. */ | 425 | /* If the port is not the console, disable Rx and Tx. */ |
396 | if (!(pinfo->flags & FLAG_CONSOLE)) { | 426 | if (!(pinfo->flags & FLAG_CONSOLE)) { |
427 | /* Wait for all the BDs marked sent */ | ||
428 | while(!cpm_uart_tx_empty(port)) | ||
429 | schedule_timeout(2); | ||
430 | if(pinfo->wait_closing) | ||
431 | cpm_uart_wait_until_send(pinfo); | ||
432 | |||
397 | /* Stop uarts */ | 433 | /* Stop uarts */ |
398 | if (IS_SMC(pinfo)) { | 434 | if (IS_SMC(pinfo)) { |
399 | volatile smc_t *smcp = pinfo->smcp; | 435 | volatile smc_t *smcp = pinfo->smcp; |
@@ -502,7 +538,7 @@ static void cpm_uart_set_termios(struct uart_port *port, | |||
502 | */ | 538 | */ |
503 | if ((termios->c_cflag & CREAD) == 0) | 539 | if ((termios->c_cflag & CREAD) == 0) |
504 | port->read_status_mask &= ~BD_SC_EMPTY; | 540 | port->read_status_mask &= ~BD_SC_EMPTY; |
505 | 541 | ||
506 | spin_lock_irqsave(&port->lock, flags); | 542 | spin_lock_irqsave(&port->lock, flags); |
507 | 543 | ||
508 | /* Start bit has not been added (so don't, because we would just | 544 | /* Start bit has not been added (so don't, because we would just |
@@ -569,7 +605,8 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
569 | /* Pick next descriptor and fill from buffer */ | 605 | /* Pick next descriptor and fill from buffer */ |
570 | bdp = pinfo->tx_cur; | 606 | bdp = pinfo->tx_cur; |
571 | 607 | ||
572 | p = bus_to_virt(bdp->cbd_bufaddr); | 608 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
609 | |||
573 | *p++ = xmit->buf[xmit->tail]; | 610 | *p++ = xmit->buf[xmit->tail]; |
574 | bdp->cbd_datlen = 1; | 611 | bdp->cbd_datlen = 1; |
575 | bdp->cbd_sc |= BD_SC_READY; | 612 | bdp->cbd_sc |= BD_SC_READY; |
@@ -595,7 +632,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
595 | 632 | ||
596 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { | 633 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { |
597 | count = 0; | 634 | count = 0; |
598 | p = bus_to_virt(bdp->cbd_bufaddr); | 635 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
599 | while (count < pinfo->tx_fifosize) { | 636 | while (count < pinfo->tx_fifosize) { |
600 | *p++ = xmit->buf[xmit->tail]; | 637 | *p++ = xmit->buf[xmit->tail]; |
601 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 638 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
@@ -606,6 +643,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
606 | } | 643 | } |
607 | bdp->cbd_datlen = count; | 644 | bdp->cbd_datlen = count; |
608 | bdp->cbd_sc |= BD_SC_READY; | 645 | bdp->cbd_sc |= BD_SC_READY; |
646 | __asm__("eieio"); | ||
609 | /* Get next BD. */ | 647 | /* Get next BD. */ |
610 | if (bdp->cbd_sc & BD_SC_WRAP) | 648 | if (bdp->cbd_sc & BD_SC_WRAP) |
611 | bdp = pinfo->tx_bd_base; | 649 | bdp = pinfo->tx_bd_base; |
@@ -643,12 +681,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
643 | mem_addr = pinfo->mem_addr; | 681 | mem_addr = pinfo->mem_addr; |
644 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; | 682 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; |
645 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { | 683 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { |
646 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 684 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
647 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; | 685 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; |
648 | mem_addr += pinfo->rx_fifosize; | 686 | mem_addr += pinfo->rx_fifosize; |
649 | } | 687 | } |
650 | 688 | ||
651 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 689 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
652 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; | 690 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; |
653 | 691 | ||
654 | /* Set the physical address of the host memory | 692 | /* Set the physical address of the host memory |
@@ -658,12 +696,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
658 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); | 696 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); |
659 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; | 697 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; |
660 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { | 698 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { |
661 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 699 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
662 | bdp->cbd_sc = BD_SC_INTRPT; | 700 | bdp->cbd_sc = BD_SC_INTRPT; |
663 | mem_addr += pinfo->tx_fifosize; | 701 | mem_addr += pinfo->tx_fifosize; |
664 | } | 702 | } |
665 | 703 | ||
666 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 704 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
667 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; | 705 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; |
668 | } | 706 | } |
669 | 707 | ||
@@ -763,6 +801,8 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) | |||
763 | /* Using idle charater time requires some additional tuning. */ | 801 | /* Using idle charater time requires some additional tuning. */ |
764 | up->smc_mrblr = pinfo->rx_fifosize; | 802 | up->smc_mrblr = pinfo->rx_fifosize; |
765 | up->smc_maxidl = pinfo->rx_fifosize; | 803 | up->smc_maxidl = pinfo->rx_fifosize; |
804 | up->smc_brklen = 0; | ||
805 | up->smc_brkec = 0; | ||
766 | up->smc_brkcr = 1; | 806 | up->smc_brkcr = 1; |
767 | 807 | ||
768 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); | 808 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); |
@@ -796,7 +836,7 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
796 | /* | 836 | /* |
797 | * Setup any port IO, connect any baud rate generators, | 837 | * Setup any port IO, connect any baud rate generators, |
798 | * etc. This is expected to be handled by board | 838 | * etc. This is expected to be handled by board |
799 | * dependant code | 839 | * dependant code |
800 | */ | 840 | */ |
801 | if (pinfo->set_lineif) | 841 | if (pinfo->set_lineif) |
802 | pinfo->set_lineif(pinfo); | 842 | pinfo->set_lineif(pinfo); |
@@ -815,6 +855,10 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
815 | return ret; | 855 | return ret; |
816 | 856 | ||
817 | cpm_uart_initbd(pinfo); | 857 | cpm_uart_initbd(pinfo); |
858 | if (IS_SMC(pinfo)) | ||
859 | cpm_uart_init_smc(pinfo); | ||
860 | else | ||
861 | cpm_uart_init_scc(pinfo); | ||
818 | 862 | ||
819 | return 0; | 863 | return 0; |
820 | } | 864 | } |
@@ -869,7 +913,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
869 | .flags = FLAG_SMC, | 913 | .flags = FLAG_SMC, |
870 | .tx_nrfifos = TX_NUM_FIFO, | 914 | .tx_nrfifos = TX_NUM_FIFO, |
871 | .tx_fifosize = TX_BUF_SIZE, | 915 | .tx_fifosize = TX_BUF_SIZE, |
872 | .rx_nrfifos = RX_NUM_FIFO, | 916 | .rx_nrfifos = RX_NUM_FIFO, |
873 | .rx_fifosize = RX_BUF_SIZE, | 917 | .rx_fifosize = RX_BUF_SIZE, |
874 | .set_lineif = smc1_lineif, | 918 | .set_lineif = smc1_lineif, |
875 | }, | 919 | }, |
@@ -883,7 +927,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
883 | .flags = FLAG_SMC, | 927 | .flags = FLAG_SMC, |
884 | .tx_nrfifos = TX_NUM_FIFO, | 928 | .tx_nrfifos = TX_NUM_FIFO, |
885 | .tx_fifosize = TX_BUF_SIZE, | 929 | .tx_fifosize = TX_BUF_SIZE, |
886 | .rx_nrfifos = RX_NUM_FIFO, | 930 | .rx_nrfifos = RX_NUM_FIFO, |
887 | .rx_fifosize = RX_BUF_SIZE, | 931 | .rx_fifosize = RX_BUF_SIZE, |
888 | .set_lineif = smc2_lineif, | 932 | .set_lineif = smc2_lineif, |
889 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 | 933 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 |
@@ -899,9 +943,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
899 | }, | 943 | }, |
900 | .tx_nrfifos = TX_NUM_FIFO, | 944 | .tx_nrfifos = TX_NUM_FIFO, |
901 | .tx_fifosize = TX_BUF_SIZE, | 945 | .tx_fifosize = TX_BUF_SIZE, |
902 | .rx_nrfifos = RX_NUM_FIFO, | 946 | .rx_nrfifos = RX_NUM_FIFO, |
903 | .rx_fifosize = RX_BUF_SIZE, | 947 | .rx_fifosize = RX_BUF_SIZE, |
904 | .set_lineif = scc1_lineif, | 948 | .set_lineif = scc1_lineif, |
949 | .wait_closing = SCC_WAIT_CLOSING, | ||
905 | }, | 950 | }, |
906 | [UART_SCC2] = { | 951 | [UART_SCC2] = { |
907 | .port = { | 952 | .port = { |
@@ -912,9 +957,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
912 | }, | 957 | }, |
913 | .tx_nrfifos = TX_NUM_FIFO, | 958 | .tx_nrfifos = TX_NUM_FIFO, |
914 | .tx_fifosize = TX_BUF_SIZE, | 959 | .tx_fifosize = TX_BUF_SIZE, |
915 | .rx_nrfifos = RX_NUM_FIFO, | 960 | .rx_nrfifos = RX_NUM_FIFO, |
916 | .rx_fifosize = RX_BUF_SIZE, | 961 | .rx_fifosize = RX_BUF_SIZE, |
917 | .set_lineif = scc2_lineif, | 962 | .set_lineif = scc2_lineif, |
963 | .wait_closing = SCC_WAIT_CLOSING, | ||
918 | }, | 964 | }, |
919 | [UART_SCC3] = { | 965 | [UART_SCC3] = { |
920 | .port = { | 966 | .port = { |
@@ -925,9 +971,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
925 | }, | 971 | }, |
926 | .tx_nrfifos = TX_NUM_FIFO, | 972 | .tx_nrfifos = TX_NUM_FIFO, |
927 | .tx_fifosize = TX_BUF_SIZE, | 973 | .tx_fifosize = TX_BUF_SIZE, |
928 | .rx_nrfifos = RX_NUM_FIFO, | 974 | .rx_nrfifos = RX_NUM_FIFO, |
929 | .rx_fifosize = RX_BUF_SIZE, | 975 | .rx_fifosize = RX_BUF_SIZE, |
930 | .set_lineif = scc3_lineif, | 976 | .set_lineif = scc3_lineif, |
977 | .wait_closing = SCC_WAIT_CLOSING, | ||
931 | }, | 978 | }, |
932 | [UART_SCC4] = { | 979 | [UART_SCC4] = { |
933 | .port = { | 980 | .port = { |
@@ -938,9 +985,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
938 | }, | 985 | }, |
939 | .tx_nrfifos = TX_NUM_FIFO, | 986 | .tx_nrfifos = TX_NUM_FIFO, |
940 | .tx_fifosize = TX_BUF_SIZE, | 987 | .tx_fifosize = TX_BUF_SIZE, |
941 | .rx_nrfifos = RX_NUM_FIFO, | 988 | .rx_nrfifos = RX_NUM_FIFO, |
942 | .rx_fifosize = RX_BUF_SIZE, | 989 | .rx_fifosize = RX_BUF_SIZE, |
943 | .set_lineif = scc4_lineif, | 990 | .set_lineif = scc4_lineif, |
991 | .wait_closing = SCC_WAIT_CLOSING, | ||
944 | }, | 992 | }, |
945 | }; | 993 | }; |
946 | 994 | ||
@@ -983,11 +1031,8 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
983 | * If the buffer address is in the CPM DPRAM, don't | 1031 | * If the buffer address is in the CPM DPRAM, don't |
984 | * convert it. | 1032 | * convert it. |
985 | */ | 1033 | */ |
986 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1034 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
987 | cp = (unsigned char *) (bdp->cbd_bufaddr); | 1035 | |
988 | else | ||
989 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
990 | |||
991 | *cp = *s; | 1036 | *cp = *s; |
992 | 1037 | ||
993 | bdp->cbd_datlen = 1; | 1038 | bdp->cbd_datlen = 1; |
@@ -1003,10 +1048,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1003 | while ((bdp->cbd_sc & BD_SC_READY) != 0) | 1048 | while ((bdp->cbd_sc & BD_SC_READY) != 0) |
1004 | ; | 1049 | ; |
1005 | 1050 | ||
1006 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1051 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
1007 | cp = (unsigned char *) (bdp->cbd_bufaddr); | ||
1008 | else | ||
1009 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
1010 | 1052 | ||
1011 | *cp = 13; | 1053 | *cp = 13; |
1012 | bdp->cbd_datlen = 1; | 1054 | bdp->cbd_datlen = 1; |
@@ -1045,7 +1087,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1045 | port = | 1087 | port = |
1046 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | 1088 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; |
1047 | pinfo = (struct uart_cpm_port *)port; | 1089 | pinfo = (struct uart_cpm_port *)port; |
1048 | 1090 | ||
1049 | pinfo->flags |= FLAG_CONSOLE; | 1091 | pinfo->flags |= FLAG_CONSOLE; |
1050 | 1092 | ||
1051 | if (options) { | 1093 | if (options) { |
@@ -1062,7 +1104,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1062 | /* | 1104 | /* |
1063 | * Setup any port IO, connect any baud rate generators, | 1105 | * Setup any port IO, connect any baud rate generators, |
1064 | * etc. This is expected to be handled by board | 1106 | * etc. This is expected to be handled by board |
1065 | * dependant code | 1107 | * dependant code |
1066 | */ | 1108 | */ |
1067 | if (pinfo->set_lineif) | 1109 | if (pinfo->set_lineif) |
1068 | pinfo->set_lineif(pinfo); | 1110 | pinfo->set_lineif(pinfo); |
@@ -1092,14 +1134,14 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1092 | return 0; | 1134 | return 0; |
1093 | } | 1135 | } |
1094 | 1136 | ||
1095 | extern struct uart_driver cpm_reg; | 1137 | static struct uart_driver cpm_reg; |
1096 | static struct console cpm_scc_uart_console = { | 1138 | static struct console cpm_scc_uart_console = { |
1097 | .name "ttyCPM", | 1139 | .name = "ttyCPM", |
1098 | .write cpm_uart_console_write, | 1140 | .write = cpm_uart_console_write, |
1099 | .device uart_console_device, | 1141 | .device = uart_console_device, |
1100 | .setup cpm_uart_console_setup, | 1142 | .setup = cpm_uart_console_setup, |
1101 | .flags CON_PRINTBUFFER, | 1143 | .flags = CON_PRINTBUFFER, |
1102 | .index -1, | 1144 | .index = -1, |
1103 | .data = &cpm_reg, | 1145 | .data = &cpm_reg, |
1104 | }; | 1146 | }; |
1105 | 1147 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 8efbd6d1d6a4..4b0786e7eb7f 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
8 | * | 8 | * |
9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
10 | * (C) 2004 Intracom, S.A. | 10 | * (C) 2004 Intracom, S.A. |
11 | * | 11 | * |
@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) | |||
82 | void smc1_lineif(struct uart_cpm_port *pinfo) | 82 | void smc1_lineif(struct uart_cpm_port *pinfo) |
83 | { | 83 | { |
84 | volatile cpm8xx_t *cp = cpmp; | 84 | volatile cpm8xx_t *cp = cpmp; |
85 | |||
86 | (void)cp; /* fix warning */ | ||
87 | #if defined (CONFIG_MPC885ADS) | ||
88 | /* Enable SMC1 transceivers */ | ||
89 | { | ||
90 | cp->cp_pepar |= 0x000000c0; | ||
91 | cp->cp_pedir &= ~0x000000c0; | ||
92 | cp->cp_peso &= ~0x00000040; | ||
93 | cp->cp_peso |= 0x00000080; | ||
94 | } | ||
95 | #elif defined (CONFIG_MPC86XADS) | ||
85 | unsigned int iobits = 0x000000c0; | 96 | unsigned int iobits = 0x000000c0; |
86 | 97 | ||
87 | if (!pinfo->is_portb) { | 98 | if (!pinfo->is_portb) { |
@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) | |||
93 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | 104 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; |
94 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | 105 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; |
95 | } | 106 | } |
96 | |||
97 | #ifdef CONFIG_MPC885ADS | ||
98 | /* Enable SMC1 transceivers */ | ||
99 | { | ||
100 | volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4); | ||
101 | uint tmp; | ||
102 | |||
103 | tmp = in_be32(bcsr1); | ||
104 | tmp &= ~BCSR1_RS232EN_1; | ||
105 | out_be32(bcsr1, tmp); | ||
106 | iounmap(bcsr1); | ||
107 | } | ||
108 | #endif | 107 | #endif |
109 | |||
110 | pinfo->brg = 1; | 108 | pinfo->brg = 1; |
111 | } | 109 | } |
112 | 110 | ||
113 | void smc2_lineif(struct uart_cpm_port *pinfo) | 111 | void smc2_lineif(struct uart_cpm_port *pinfo) |
114 | { | 112 | { |
115 | #ifdef CONFIG_MPC885ADS | ||
116 | volatile cpm8xx_t *cp = cpmp; | 113 | volatile cpm8xx_t *cp = cpmp; |
117 | volatile uint __iomem *bcsr1; | ||
118 | uint tmp; | ||
119 | 114 | ||
115 | (void)cp; /* fix warning */ | ||
116 | #if defined (CONFIG_MPC885ADS) | ||
120 | cp->cp_pepar |= 0x00000c00; | 117 | cp->cp_pepar |= 0x00000c00; |
121 | cp->cp_pedir &= ~0x00000c00; | 118 | cp->cp_pedir &= ~0x00000c00; |
122 | cp->cp_peso &= ~0x00000400; | 119 | cp->cp_peso &= ~0x00000400; |
123 | cp->cp_peso |= 0x00000800; | 120 | cp->cp_peso |= 0x00000800; |
121 | #elif defined (CONFIG_MPC86XADS) | ||
122 | unsigned int iobits = 0x00000c00; | ||
123 | |||
124 | if (!pinfo->is_portb) { | ||
125 | cp->cp_pbpar |= iobits; | ||
126 | cp->cp_pbdir &= ~iobits; | ||
127 | cp->cp_pbodr &= ~iobits; | ||
128 | } else { | ||
129 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; | ||
130 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | ||
131 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | ||
132 | } | ||
124 | 133 | ||
125 | /* Enable SMC2 transceivers */ | ||
126 | bcsr1 = ioremap(BCSR1, 4); | ||
127 | tmp = in_be32(bcsr1); | ||
128 | tmp &= ~BCSR1_RS232EN_2; | ||
129 | out_be32(bcsr1, tmp); | ||
130 | iounmap(bcsr1); | ||
131 | #endif | 134 | #endif |
132 | 135 | ||
133 | pinfo->brg = 2; | 136 | pinfo->brg = 2; |
@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) | |||
158 | } | 161 | } |
159 | 162 | ||
160 | /* | 163 | /* |
161 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and | 164 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and |
162 | * receive buffer descriptors from dual port ram, and a character | 165 | * receive buffer descriptors from dual port ram, and a character |
163 | * buffer area from host mem. If we are allocating for the console we need | 166 | * buffer area from host mem. If we are allocating for the console we need |
164 | * to do it from bootmem | 167 | * to do it from bootmem |
@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
185 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + | 188 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + |
186 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); | 189 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); |
187 | if (is_con) { | 190 | if (is_con) { |
191 | /* was hostalloc but changed cause it blows away the */ | ||
192 | /* large tlb mapping when pinning the kernel area */ | ||
188 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); | 193 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); |
189 | dma_addr = 0; | 194 | dma_addr = 0; |
190 | } else | 195 | } else |
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index 0301feacbde4..9b50560b9d16 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c | |||
@@ -1123,7 +1123,7 @@ static int __init m32r_sio_console_setup(struct console *co, char *options) | |||
1123 | return uart_set_options(port, co, baud, parity, bits, flow); | 1123 | return uart_set_options(port, co, baud, parity, bits, flow); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | extern struct uart_driver m32r_sio_reg; | 1126 | static struct uart_driver m32r_sio_reg; |
1127 | static struct console m32r_sio_console = { | 1127 | static struct console m32r_sio_console = { |
1128 | .name = "ttyS", | 1128 | .name = "ttyS", |
1129 | .write = m32r_sio_console_write, | 1129 | .write = m32r_sio_console_write, |
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 840815fde49b..12d1f14e78ce 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
@@ -1093,6 +1093,7 @@ int __init sn_serial_console_early_setup(void) | |||
1093 | return -1; | 1093 | return -1; |
1094 | 1094 | ||
1095 | sal_console_port.sc_ops = &poll_ops; | 1095 | sal_console_port.sc_ops = &poll_ops; |
1096 | spin_lock_init(&sal_console_port.sc_port.lock); | ||
1096 | early_sn_setup(); /* Find SAL entry points */ | 1097 | early_sn_setup(); /* Find SAL entry points */ |
1097 | register_console(&sal_console_early); | 1098 | register_console(&sal_console_early); |
1098 | 1099 | ||
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 50cb01831075..b01efb6b36f6 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -527,7 +527,7 @@ show_periodic (struct class_device *class_dev, char *buf) | |||
527 | p.qh->period, | 527 | p.qh->period, |
528 | le32_to_cpup (&p.qh->hw_info2) | 528 | le32_to_cpup (&p.qh->hw_info2) |
529 | /* uframe masks */ | 529 | /* uframe masks */ |
530 | & 0xffff, | 530 | & (QH_CMASK | QH_SMASK), |
531 | p.qh); | 531 | p.qh); |
532 | size -= temp; | 532 | size -= temp; |
533 | next += temp; | 533 | next += temp; |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 4f97a4ad1ed3..20df01a79b2e 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -222,7 +222,7 @@ __acquires(ehci->lock) | |||
222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; | 222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; |
223 | 223 | ||
224 | /* S-mask in a QH means it's an interrupt urb */ | 224 | /* S-mask in a QH means it's an interrupt urb */ |
225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (0x00ff)) != 0) { | 225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (QH_SMASK)) != 0) { |
226 | 226 | ||
227 | /* ... update hc-wide periodic stats (for usbfs) */ | 227 | /* ... update hc-wide periodic stats (for usbfs) */ |
228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; | 228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; |
@@ -428,7 +428,8 @@ halt: | |||
428 | /* should be rare for periodic transfers, | 428 | /* should be rare for periodic transfers, |
429 | * except maybe high bandwidth ... | 429 | * except maybe high bandwidth ... |
430 | */ | 430 | */ |
431 | if (qh->period) { | 431 | if ((__constant_cpu_to_le32 (QH_SMASK) |
432 | & qh->hw_info2) != 0) { | ||
432 | intr_deschedule (ehci, qh); | 433 | intr_deschedule (ehci, qh); |
433 | (void) qh_schedule (ehci, qh); | 434 | (void) qh_schedule (ehci, qh); |
434 | } else | 435 | } else |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 9af4f64532a9..b56f25864ed6 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -301,7 +301,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
301 | 301 | ||
302 | dev_dbg (&qh->dev->dev, | 302 | dev_dbg (&qh->dev->dev, |
303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", | 303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", |
304 | period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 304 | period, le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), |
305 | qh, qh->start, qh->usecs, qh->c_usecs); | 305 | qh, qh->start, qh->usecs, qh->c_usecs); |
306 | 306 | ||
307 | /* high bandwidth, or otherwise every microframe */ | 307 | /* high bandwidth, or otherwise every microframe */ |
@@ -385,7 +385,8 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
385 | 385 | ||
386 | dev_dbg (&qh->dev->dev, | 386 | dev_dbg (&qh->dev->dev, |
387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", | 387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", |
388 | qh->period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 388 | qh->period, |
389 | le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), | ||
389 | qh, qh->start, qh->usecs, qh->c_usecs); | 390 | qh, qh->start, qh->usecs, qh->c_usecs); |
390 | 391 | ||
391 | /* qh->qh_next still "live" to HC */ | 392 | /* qh->qh_next still "live" to HC */ |
@@ -411,7 +412,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
411 | * active high speed queues may need bigger delays... | 412 | * active high speed queues may need bigger delays... |
412 | */ | 413 | */ |
413 | if (list_empty (&qh->qtd_list) | 414 | if (list_empty (&qh->qtd_list) |
414 | || (__constant_cpu_to_le32 (0x0ff << 8) | 415 | || (__constant_cpu_to_le32 (QH_CMASK) |
415 | & qh->hw_info2) != 0) | 416 | & qh->hw_info2) != 0) |
416 | wait = 2; | 417 | wait = 2; |
417 | else | 418 | else |
@@ -533,7 +534,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
533 | 534 | ||
534 | /* reuse the previous schedule slots, if we can */ | 535 | /* reuse the previous schedule slots, if we can */ |
535 | if (frame < qh->period) { | 536 | if (frame < qh->period) { |
536 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & 0x00ff); | 537 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & QH_SMASK); |
537 | status = check_intr_schedule (ehci, frame, --uframe, | 538 | status = check_intr_schedule (ehci, frame, --uframe, |
538 | qh, &c_mask); | 539 | qh, &c_mask); |
539 | } else { | 540 | } else { |
@@ -569,10 +570,10 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
569 | qh->start = frame; | 570 | qh->start = frame; |
570 | 571 | ||
571 | /* reset S-frame and (maybe) C-frame masks */ | 572 | /* reset S-frame and (maybe) C-frame masks */ |
572 | qh->hw_info2 &= __constant_cpu_to_le32 (~0xffff); | 573 | qh->hw_info2 &= __constant_cpu_to_le32(~(QH_CMASK | QH_SMASK)); |
573 | qh->hw_info2 |= qh->period | 574 | qh->hw_info2 |= qh->period |
574 | ? cpu_to_le32 (1 << uframe) | 575 | ? cpu_to_le32 (1 << uframe) |
575 | : __constant_cpu_to_le32 (0xff); | 576 | : __constant_cpu_to_le32 (QH_SMASK); |
576 | qh->hw_info2 |= c_mask; | 577 | qh->hw_info2 |= c_mask; |
577 | } else | 578 | } else |
578 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); | 579 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 4df498231752..a7542157534c 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -385,6 +385,11 @@ struct ehci_qh { | |||
385 | __le32 hw_info1; /* see EHCI 3.6.2 */ | 385 | __le32 hw_info1; /* see EHCI 3.6.2 */ |
386 | #define QH_HEAD 0x00008000 | 386 | #define QH_HEAD 0x00008000 |
387 | __le32 hw_info2; /* see EHCI 3.6.2 */ | 387 | __le32 hw_info2; /* see EHCI 3.6.2 */ |
388 | #define QH_SMASK 0x000000ff | ||
389 | #define QH_CMASK 0x0000ff00 | ||
390 | #define QH_HUBADDR 0x007f0000 | ||
391 | #define QH_HUBPORT 0x3f800000 | ||
392 | #define QH_MULT 0xc0000000 | ||
388 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ | 393 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ |
389 | 394 | ||
390 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ | 395 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 50b1970fe6b6..76cb496c5836 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -229,9 +229,11 @@ static void preproc_atl_queue(struct isp116x *isp116x) | |||
229 | struct isp116x_ep *ep; | 229 | struct isp116x_ep *ep; |
230 | struct urb *urb; | 230 | struct urb *urb; |
231 | struct ptd *ptd; | 231 | struct ptd *ptd; |
232 | u16 toggle = 0, dir = PTD_DIR_SETUP, len; | 232 | u16 len; |
233 | 233 | ||
234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { | 234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { |
235 | u16 toggle = 0, dir = PTD_DIR_SETUP; | ||
236 | |||
235 | BUG_ON(list_empty(&ep->hep->urb_list)); | 237 | BUG_ON(list_empty(&ep->hep->urb_list)); |
236 | urb = container_of(ep->hep->urb_list.next, | 238 | urb = container_of(ep->hep->urb_list.next, |
237 | struct urb, urb_list); | 239 | struct urb, urb_list); |
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index 02412e31a46b..3b266af3048a 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
342 | goto exit; | 342 | goto exit; |
343 | } | 343 | } |
344 | 344 | ||
345 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
346 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
347 | |||
348 | input_regs(dev, regs); | 345 | input_regs(dev, regs); |
349 | 346 | ||
350 | if (data[1] & 0x10) { /* in prox */ | 347 | if (data[1] & 0x10) { /* in prox */ |
@@ -373,15 +370,17 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
373 | } | 370 | } |
374 | } | 371 | } |
375 | 372 | ||
376 | if (data[1] & 0x80) { | 373 | if (data[1] & 0x90) { |
374 | x = le16_to_cpu(*(__le16 *) &data[2]); | ||
375 | y = le16_to_cpu(*(__le16 *) &data[4]); | ||
377 | input_report_abs(dev, ABS_X, x); | 376 | input_report_abs(dev, ABS_X, x); |
378 | input_report_abs(dev, ABS_Y, y); | 377 | input_report_abs(dev, ABS_Y, y); |
379 | } | 378 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
380 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { | 379 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
381 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); | 380 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
382 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); | 381 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); |
383 | input_report_key(dev, BTN_STYLUS, data[1] & 0x02); | 382 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); |
384 | input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); | 383 | } |
385 | } | 384 | } |
386 | 385 | ||
387 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); | 386 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); |
@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
568 | 567 | ||
569 | /* Cintiq doesn't send data when RDY bit isn't set */ | 568 | /* Cintiq doesn't send data when RDY bit isn't set */ |
570 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) | 569 | if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) |
571 | return; | 570 | goto exit; |
572 | 571 | ||
573 | if (wacom->features->type >= INTUOS3) { | 572 | if (wacom->features->type >= INTUOS3) { |
574 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); | 573 | input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |
diff --git a/drivers/usb/mon/Kconfig b/drivers/usb/mon/Kconfig index 777642e26b9a..deb9ddffa402 100644 --- a/drivers/usb/mon/Kconfig +++ b/drivers/usb/mon/Kconfig | |||
@@ -9,9 +9,8 @@ config USB_MON | |||
9 | help | 9 | help |
10 | If you say Y here, a component which captures the USB traffic | 10 | If you say Y here, a component which captures the USB traffic |
11 | between peripheral-specific drivers and HC drivers will be built. | 11 | between peripheral-specific drivers and HC drivers will be built. |
12 | The USB_MON is similar in spirit and may be compatible with Dave | 12 | For more information, see <file:Documentation/usb/usbmon.txt>. |
13 | Harding's USBMon. | ||
14 | 13 | ||
15 | This is somewhat experimental at this time, but it should be safe, | 14 | This is somewhat experimental at this time, but it should be safe. |
16 | as long as you aren't using modular USB and try to remove this | 15 | |
17 | module. | 16 | If unsure, say Y. |
diff --git a/drivers/usb/mon/Makefile b/drivers/usb/mon/Makefile index f18d10ce91f9..b0015b8a1d1f 100644 --- a/drivers/usb/mon/Makefile +++ b/drivers/usb/mon/Makefile | |||
@@ -4,4 +4,5 @@ | |||
4 | 4 | ||
5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o | 5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o |
6 | 6 | ||
7 | # This does not use CONFIG_USB_MON because we want this to use a tristate. | ||
7 | obj-$(CONFIG_USB) += usbmon.o | 8 | obj-$(CONFIG_USB) += usbmon.o |
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c index aa9d00808e4e..508a21028db4 100644 --- a/drivers/usb/mon/mon_main.c +++ b/drivers/usb/mon/mon_main.c | |||
@@ -2,6 +2,8 @@ | |||
2 | * The USB Monitor, inspired by Dave Harding's USBMon. | 2 | * The USB Monitor, inspired by Dave Harding's USBMon. |
3 | * | 3 | * |
4 | * mon_main.c: Main file, module initiation and exit, registrations, etc. | 4 | * mon_main.c: Main file, module initiation and exit, registrations, etc. |
5 | * | ||
6 | * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) | ||
5 | */ | 7 | */ |
6 | 8 | ||
7 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
@@ -311,7 +313,7 @@ static int __init mon_init(void) | |||
311 | 313 | ||
312 | mondir = debugfs_create_dir("usbmon", NULL); | 314 | mondir = debugfs_create_dir("usbmon", NULL); |
313 | if (IS_ERR(mondir)) { | 315 | if (IS_ERR(mondir)) { |
314 | printk(KERN_NOTICE TAG ": debugs is not available\n"); | 316 | printk(KERN_NOTICE TAG ": debugfs is not available\n"); |
315 | return -ENODEV; | 317 | return -ENODEV; |
316 | } | 318 | } |
317 | if (mondir == NULL) { | 319 | if (mondir == NULL) { |
diff --git a/drivers/usb/mon/usb_mon.h b/drivers/usb/mon/usb_mon.h index ed35c18a5c44..9b06784d2c48 100644 --- a/drivers/usb/mon/usb_mon.h +++ b/drivers/usb/mon/usb_mon.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * The USB Monitor, inspired by Dave Harding's USBMon. | 2 | * The USB Monitor, inspired by Dave Harding's USBMon. |
3 | * | ||
4 | * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) | ||
3 | */ | 5 | */ |
4 | 6 | ||
5 | #ifndef __USB_MON_H | 7 | #ifndef __USB_MON_H |
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 576f3b852fce..4528a00c45b0 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c | |||
@@ -1922,7 +1922,7 @@ static int genelink_rx_fixup (struct usbnet *dev, struct sk_buff *skb) | |||
1922 | 1922 | ||
1923 | // copy the packet data to the new skb | 1923 | // copy the packet data to the new skb |
1924 | memcpy(skb_put(gl_skb, size), packet->packet_data, size); | 1924 | memcpy(skb_put(gl_skb, size), packet->packet_data, size); |
1925 | skb_return (dev, skb); | 1925 | skb_return (dev, gl_skb); |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | // advance to the next packet | 1928 | // advance to the next packet |
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c index 29cd801eb958..e32a80b39182 100644 --- a/drivers/usb/net/zd1201.c +++ b/drivers/usb/net/zd1201.c | |||
@@ -346,8 +346,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) | |||
346 | if (datalen<14) | 346 | if (datalen<14) |
347 | goto resubmit; | 347 | goto resubmit; |
348 | if ((seq & IEEE802_11_SCTL_FRAG) == 0) { | 348 | if ((seq & IEEE802_11_SCTL_FRAG) == 0) { |
349 | frag = kmalloc(sizeof(struct zd1201_frag*), | 349 | frag = kmalloc(sizeof(*frag), GFP_ATOMIC); |
350 | GFP_ATOMIC); | ||
351 | if (!frag) | 350 | if (!frag) |
352 | goto resubmit; | 351 | goto resubmit; |
353 | skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2); | 352 | skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2); |
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index cbff98337aa6..5fe182d6e4ab 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig | |||
@@ -6,7 +6,7 @@ menu "Console display driver support" | |||
6 | 6 | ||
7 | config VGA_CONSOLE | 7 | config VGA_CONSOLE |
8 | bool "VGA text console" if EMBEDDED || !X86 | 8 | bool "VGA text console" if EMBEDDED || !X86 |
9 | depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC | 9 | depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC32 && !SPARC64 && !M68K && !PARISC && !ARCH_VERSATILE |
10 | default y | 10 | default y |
11 | help | 11 | help |
12 | Saying Y here will allow you to use Linux in text mode through a | 12 | Saying Y here will allow you to use Linux in text mode through a |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d2e19f6dd72c..4ff853fbe0be 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -628,7 +628,7 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) | |||
628 | int | 628 | int |
629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | 629 | fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) |
630 | { | 630 | { |
631 | int err; | 631 | int err, flags = info->flags; |
632 | 632 | ||
633 | if (var->activate & FB_ACTIVATE_INV_MODE) { | 633 | if (var->activate & FB_ACTIVATE_INV_MODE) { |
634 | struct fb_videomode mode1, mode2; | 634 | struct fb_videomode mode1, mode2; |
@@ -682,7 +682,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
682 | !list_empty(&info->modelist)) | 682 | !list_empty(&info->modelist)) |
683 | err = fb_add_videomode(&mode, &info->modelist); | 683 | err = fb_add_videomode(&mode, &info->modelist); |
684 | 684 | ||
685 | if (!err && info->flags & FBINFO_MISC_USEREVENT) { | 685 | if (!err && (flags & FBINFO_MISC_USEREVENT)) { |
686 | struct fb_event event; | 686 | struct fb_event event; |
687 | 687 | ||
688 | info->flags &= ~FBINFO_MISC_USEREVENT; | 688 | info->flags &= ~FBINFO_MISC_USEREVENT; |
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index ed1d4d1ac4f7..1147b899f007 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
@@ -414,6 +414,13 @@ static ssize_t show_pan(struct class_device *class_device, char *buf) | |||
414 | fb_info->var.xoffset); | 414 | fb_info->var.xoffset); |
415 | } | 415 | } |
416 | 416 | ||
417 | static ssize_t show_name(struct class_device *class_device, char *buf) | ||
418 | { | ||
419 | struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); | ||
420 | |||
421 | return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); | ||
422 | } | ||
423 | |||
417 | static struct class_device_attribute class_device_attrs[] = { | 424 | static struct class_device_attribute class_device_attrs[] = { |
418 | __ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp), | 425 | __ATTR(bits_per_pixel, S_IRUGO|S_IWUSR, show_bpp, store_bpp), |
419 | __ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank), | 426 | __ATTR(blank, S_IRUGO|S_IWUSR, show_blank, store_blank), |
@@ -424,6 +431,7 @@ static struct class_device_attribute class_device_attrs[] = { | |||
424 | __ATTR(modes, S_IRUGO|S_IWUSR, show_modes, store_modes), | 431 | __ATTR(modes, S_IRUGO|S_IWUSR, show_modes, store_modes), |
425 | __ATTR(pan, S_IRUGO|S_IWUSR, show_pan, store_pan), | 432 | __ATTR(pan, S_IRUGO|S_IWUSR, show_pan, store_pan), |
426 | __ATTR(virtual_size, S_IRUGO|S_IWUSR, show_virtual, store_virtual), | 433 | __ATTR(virtual_size, S_IRUGO|S_IWUSR, show_virtual, store_virtual), |
434 | __ATTR(name, S_IRUGO, show_name, NULL), | ||
427 | }; | 435 | }; |
428 | 436 | ||
429 | int fb_init_class_device(struct fb_info *fb_info) | 437 | int fb_init_class_device(struct fb_info *fb_info) |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 298bc9cd99e7..a112a1786855 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -583,23 +583,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | /* Map the fb and MMIO regions */ | ||
587 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
588 | (dinfo->aperture.physical, dinfo->aperture.size); | ||
589 | if (!dinfo->aperture.virtual) { | ||
590 | ERR_MSG("Cannot remap FB region.\n"); | ||
591 | cleanup(dinfo); | ||
592 | return -ENODEV; | ||
593 | } | ||
594 | dinfo->mmio_base = | ||
595 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
596 | INTEL_REG_SIZE); | ||
597 | if (!dinfo->mmio_base) { | ||
598 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
599 | cleanup(dinfo); | ||
600 | return -ENODEV; | ||
601 | } | ||
602 | |||
603 | /* Get the chipset info. */ | 586 | /* Get the chipset info. */ |
604 | dinfo->pci_chipset = pdev->device; | 587 | dinfo->pci_chipset = pdev->device; |
605 | 588 | ||
@@ -630,9 +613,15 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
630 | dinfo->accel = 0; | 613 | dinfo->accel = 0; |
631 | } | 614 | } |
632 | 615 | ||
616 | if (MB(voffset) < stolen_size) | ||
617 | offset = (stolen_size >> 12); | ||
618 | else | ||
619 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
620 | |||
633 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ | 621 | /* Framebuffer parameters - Use all the stolen memory if >= vram */ |
634 | if (ROUND_UP_TO_PAGE(stolen_size) >= MB(vram)) { | 622 | if (ROUND_UP_TO_PAGE(stolen_size) >= ((offset << 12) + MB(vram))) { |
635 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); | 623 | dinfo->fb.size = ROUND_UP_TO_PAGE(stolen_size); |
624 | dinfo->fb.offset = 0; | ||
636 | dinfo->fbmem_gart = 0; | 625 | dinfo->fbmem_gart = 0; |
637 | } else { | 626 | } else { |
638 | dinfo->fb.size = MB(vram); | 627 | dinfo->fb.size = MB(vram); |
@@ -663,11 +652,6 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
663 | return -ENODEV; | 652 | return -ENODEV; |
664 | } | 653 | } |
665 | 654 | ||
666 | if (MB(voffset) < stolen_size) | ||
667 | offset = (stolen_size >> 12); | ||
668 | else | ||
669 | offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE; | ||
670 | |||
671 | /* set the mem offsets - set them after the already used pages */ | 655 | /* set the mem offsets - set them after the already used pages */ |
672 | if (dinfo->accel) { | 656 | if (dinfo->accel) { |
673 | dinfo->ring.offset = offset + gtt_info.current_memory; | 657 | dinfo->ring.offset = offset + gtt_info.current_memory; |
@@ -682,6 +666,26 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
682 | + (dinfo->cursor.size >> 12); | 666 | + (dinfo->cursor.size >> 12); |
683 | } | 667 | } |
684 | 668 | ||
669 | /* Map the fb and MMIO regions */ | ||
670 | /* ioremap only up to the end of used aperture */ | ||
671 | dinfo->aperture.virtual = (u8 __iomem *)ioremap_nocache | ||
672 | (dinfo->aperture.physical, (dinfo->fb.offset << 12) | ||
673 | + dinfo->fb.size); | ||
674 | if (!dinfo->aperture.virtual) { | ||
675 | ERR_MSG("Cannot remap FB region.\n"); | ||
676 | cleanup(dinfo); | ||
677 | return -ENODEV; | ||
678 | } | ||
679 | |||
680 | dinfo->mmio_base = | ||
681 | (u8 __iomem *)ioremap_nocache(dinfo->mmio_base_phys, | ||
682 | INTEL_REG_SIZE); | ||
683 | if (!dinfo->mmio_base) { | ||
684 | ERR_MSG("Cannot remap MMIO region.\n"); | ||
685 | cleanup(dinfo); | ||
686 | return -ENODEV; | ||
687 | } | ||
688 | |||
685 | /* Allocate memories (which aren't stolen) */ | 689 | /* Allocate memories (which aren't stolen) */ |
686 | if (dinfo->accel) { | 690 | if (dinfo->accel) { |
687 | if (!(dinfo->gtt_ring_mem = | 691 | if (!(dinfo->gtt_ring_mem = |
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index fbf659b6dab0..3edc9f49344b 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -246,6 +246,11 @@ static const struct fb_videomode modedb[] = { | |||
246 | /* 480x300 @ 72 Hz, 48.0 kHz hsync */ | 246 | /* 480x300 @ 72 Hz, 48.0 kHz hsync */ |
247 | NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, | 247 | NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, |
248 | 0, FB_VMODE_DOUBLE | 248 | 0, FB_VMODE_DOUBLE |
249 | }, { | ||
250 | /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */ | ||
251 | NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3, | ||
252 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
253 | FB_VMODE_NONINTERLACED | ||
249 | }, | 254 | }, |
250 | }; | 255 | }; |
251 | 256 | ||
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index b2e6b2407869..52b16850a54e 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -1324,6 +1324,13 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info) | |||
1324 | 1324 | ||
1325 | fb_videomode_to_var(&nvidiafb_default_var, &modedb); | 1325 | fb_videomode_to_var(&nvidiafb_default_var, &modedb); |
1326 | nvidiafb_default_var.bits_per_pixel = 8; | 1326 | nvidiafb_default_var.bits_per_pixel = 8; |
1327 | } else if (par->fpWidth && par->fpHeight) { | ||
1328 | char buf[16]; | ||
1329 | |||
1330 | memset(buf, 0, 16); | ||
1331 | snprintf(buf, 15, "%dx%d", par->fpWidth, par->fpHeight); | ||
1332 | fb_find_mode(&nvidiafb_default_var, info, buf, specs->modedb, | ||
1333 | specs->modedb_len, &modedb, 8); | ||
1327 | } | 1334 | } |
1328 | 1335 | ||
1329 | if (mode_option) | 1336 | if (mode_option) |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 16e37a535d85..30112816420c 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -717,6 +717,9 @@ static void pxafb_enable_controller(struct pxafb_info *fbi) | |||
717 | DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); | 717 | DPRINTK("reg_lccr2 0x%08x\n", (unsigned int) fbi->reg_lccr2); |
718 | DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); | 718 | DPRINTK("reg_lccr3 0x%08x\n", (unsigned int) fbi->reg_lccr3); |
719 | 719 | ||
720 | /* enable LCD controller clock */ | ||
721 | pxa_set_cken(CKEN16_LCD, 1); | ||
722 | |||
720 | /* Sequence from 11.7.10 */ | 723 | /* Sequence from 11.7.10 */ |
721 | LCCR3 = fbi->reg_lccr3; | 724 | LCCR3 = fbi->reg_lccr3; |
722 | LCCR2 = fbi->reg_lccr2; | 725 | LCCR2 = fbi->reg_lccr2; |
@@ -750,6 +753,9 @@ static void pxafb_disable_controller(struct pxafb_info *fbi) | |||
750 | 753 | ||
751 | schedule_timeout(20 * HZ / 1000); | 754 | schedule_timeout(20 * HZ / 1000); |
752 | remove_wait_queue(&fbi->ctrlr_wait, &wait); | 755 | remove_wait_queue(&fbi->ctrlr_wait, &wait); |
756 | |||
757 | /* disable LCD controller clock */ | ||
758 | pxa_set_cken(CKEN16_LCD, 0); | ||
753 | } | 759 | } |
754 | 760 | ||
755 | /* | 761 | /* |
@@ -1299,8 +1305,6 @@ int __init pxafb_probe(struct device *dev) | |||
1299 | ret = -ENOMEM; | 1305 | ret = -ENOMEM; |
1300 | goto failed; | 1306 | goto failed; |
1301 | } | 1307 | } |
1302 | /* enable LCD controller clock */ | ||
1303 | pxa_set_cken(CKEN16_LCD, 1); | ||
1304 | 1308 | ||
1305 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); | 1309 | ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi); |
1306 | if (ret) { | 1310 | if (ret) { |
diff --git a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c index c46387024b1d..a78b9bd8f897 100644 --- a/drivers/video/radeonfb.c +++ b/drivers/video/radeonfb.c | |||
@@ -80,7 +80,7 @@ | |||
80 | #include <video/radeon.h> | 80 | #include <video/radeon.h> |
81 | #include <linux/radeonfb.h> | 81 | #include <linux/radeonfb.h> |
82 | 82 | ||
83 | #define DEBUG 1 | 83 | #define DEBUG 0 |
84 | 84 | ||
85 | #if DEBUG | 85 | #if DEBUG |
86 | #define RTRACE printk | 86 | #define RTRACE printk |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 2d29db7ef800..beeec7b51425 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -598,7 +598,7 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
598 | * requests for the LCD controller. If we hit this, it means we're | 598 | * requests for the LCD controller. If we hit this, it means we're |
599 | * doing nothing but LCD DMA. | 599 | * doing nothing but LCD DMA. |
600 | */ | 600 | */ |
601 | static unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) | 601 | static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) |
602 | { | 602 | { |
603 | /* | 603 | /* |
604 | * Period = pixclock * bits_per_byte * bytes_per_transfer | 604 | * Period = pixclock * bits_per_byte * bytes_per_transfer |
diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c index da8004e5d03d..698ca9232e73 100644 --- a/drivers/video/tridentfb.c +++ b/drivers/video/tridentfb.c | |||
@@ -454,13 +454,16 @@ static struct accel_switch accel_image = { | |||
454 | static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect *fr) | 454 | static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect *fr) |
455 | { | 455 | { |
456 | int bpp = info->var.bits_per_pixel; | 456 | int bpp = info->var.bits_per_pixel; |
457 | int col; | 457 | int col = 0; |
458 | 458 | ||
459 | switch (bpp) { | 459 | switch (bpp) { |
460 | default: | 460 | default: |
461 | case 8: col = fr->color; | 461 | case 8: col |= fr->color; |
462 | col |= col << 8; | ||
463 | col |= col << 16; | ||
462 | break; | 464 | break; |
463 | case 16: col = ((u32 *)(info->pseudo_palette))[fr->color]; | 465 | case 16: col = ((u32 *)(info->pseudo_palette))[fr->color]; |
466 | |||
464 | break; | 467 | break; |
465 | case 32: col = ((u32 *)(info->pseudo_palette))[fr->color]; | 468 | case 32: col = ((u32 *)(info->pseudo_palette))[fr->color]; |
466 | break; | 469 | break; |
@@ -882,8 +885,9 @@ static int tridentfb_set_par(struct fb_info *info) | |||
882 | 885 | ||
883 | write3X4(GraphEngReg, 0x80); //enable GE for text acceleration | 886 | write3X4(GraphEngReg, 0x80); //enable GE for text acceleration |
884 | 887 | ||
885 | // if (info->var.accel_flags & FB_ACCELF_TEXT) | 888 | #ifdef CONFIG_FB_TRIDENT_ACCEL |
886 | //FIXME acc->init_accel(info->var.xres,bpp); | 889 | acc->init_accel(info->var.xres,bpp); |
890 | #endif | ||
887 | 891 | ||
888 | switch (bpp) { | 892 | switch (bpp) { |
889 | case 8: tmp = 0x00; break; | 893 | case 8: tmp = 0x00; break; |
@@ -900,7 +904,7 @@ static int tridentfb_set_par(struct fb_info *info) | |||
900 | write3X4(DRAMControl, tmp); //both IO,linear enable | 904 | write3X4(DRAMControl, tmp); //both IO,linear enable |
901 | 905 | ||
902 | write3X4(InterfaceSel, read3X4(InterfaceSel) | 0x40); | 906 | write3X4(InterfaceSel, read3X4(InterfaceSel) | 0x40); |
903 | write3X4(Performance,0x20); | 907 | write3X4(Performance,0x92); |
904 | write3X4(PCIReg,0x07); //MMIO & PCI read and write burst enable | 908 | write3X4(PCIReg,0x07); //MMIO & PCI read and write burst enable |
905 | 909 | ||
906 | /* convert from picoseconds to MHz */ | 910 | /* convert from picoseconds to MHz */ |
@@ -981,12 +985,14 @@ static int tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
981 | t_outb(green>>10,0x3C9); | 985 | t_outb(green>>10,0x3C9); |
982 | t_outb(blue>>10,0x3C9); | 986 | t_outb(blue>>10,0x3C9); |
983 | 987 | ||
984 | } else | 988 | } else if (bpp == 16) { /* RGB 565 */ |
985 | if (bpp == 16) /* RGB 565 */ | 989 | u32 col; |
986 | ((u32*)info->pseudo_palette)[regno] = (red & 0xF800) | | 990 | |
987 | ((green & 0xFC00) >> 5) | ((blue & 0xF800) >> 11); | 991 | col = (red & 0xF800) | ((green & 0xFC00) >> 5) | |
988 | else | 992 | ((blue & 0xF800) >> 11); |
989 | if (bpp == 32) /* ARGB 8888 */ | 993 | col |= col << 16; |
994 | ((u32 *)(info->pseudo_palette))[regno] = col; | ||
995 | } else if (bpp == 32) /* ARGB 8888 */ | ||
990 | ((u32*)info->pseudo_palette)[regno] = | 996 | ((u32*)info->pseudo_palette)[regno] = |
991 | ((transp & 0xFF00) <<16) | | 997 | ((transp & 0xFF00) <<16) | |
992 | ((red & 0xFF00) << 8) | | 998 | ((red & 0xFF00) << 8) | |
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 8a9c42822502..0bbf029b1ef1 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -593,7 +593,7 @@ void w1_search(struct w1_master *dev, w1_slave_found_callback cb) | |||
593 | * Return 0 - device(s) present, 1 - no devices present. | 593 | * Return 0 - device(s) present, 1 - no devices present. |
594 | */ | 594 | */ |
595 | if (w1_reset_bus(dev)) { | 595 | if (w1_reset_bus(dev)) { |
596 | dev_info(&dev->dev, "No devices present on the wire.\n"); | 596 | dev_dbg(&dev->dev, "No devices present on the wire.\n"); |
597 | break; | 597 | break; |
598 | } | 598 | } |
599 | 599 | ||
diff --git a/fs/Kconfig b/fs/Kconfig index 5d0c4be43dba..e54be7058359 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -363,12 +363,15 @@ config INOTIFY | |||
363 | bool "Inotify file change notification support" | 363 | bool "Inotify file change notification support" |
364 | default y | 364 | default y |
365 | ---help--- | 365 | ---help--- |
366 | Say Y here to enable inotify support and the /dev/inotify character | 366 | Say Y here to enable inotify support and the associated system |
367 | device. Inotify is a file change notification system and a | 367 | calls. Inotify is a file change notification system and a |
368 | replacement for dnotify. Inotify fixes numerous shortcomings in | 368 | replacement for dnotify. Inotify fixes numerous shortcomings in |
369 | dnotify and introduces several new features. It allows monitoring | 369 | dnotify and introduces several new features. It allows monitoring |
370 | of both files and directories via a single open fd. Multiple file | 370 | of both files and directories via a single open fd. Other features |
371 | events are supported. | 371 | include multiple file events, one-shot support, and unmount |
372 | notification. | ||
373 | |||
374 | For more information, see Documentation/filesystems/inotify.txt | ||
372 | 375 | ||
373 | If unsure, say Y. | 376 | If unsure, say Y. |
374 | 377 | ||
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index bfc28abe1cb1..31ee06590de5 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
@@ -30,7 +30,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir, | |||
30 | struct dentry *dentry, | 30 | struct dentry *dentry, |
31 | struct nameidata *nd); | 31 | struct nameidata *nd); |
32 | static int afs_mntpt_open(struct inode *inode, struct file *file); | 32 | static int afs_mntpt_open(struct inode *inode, struct file *file); |
33 | static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); | 33 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd); |
34 | 34 | ||
35 | struct file_operations afs_mntpt_file_operations = { | 35 | struct file_operations afs_mntpt_file_operations = { |
36 | .open = afs_mntpt_open, | 36 | .open = afs_mntpt_open, |
@@ -233,7 +233,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt) | |||
233 | /* | 233 | /* |
234 | * follow a link from a mountpoint directory, thus causing it to be mounted | 234 | * follow a link from a mountpoint directory, thus causing it to be mounted |
235 | */ | 235 | */ |
236 | static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | 236 | static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) |
237 | { | 237 | { |
238 | struct vfsmount *newmnt; | 238 | struct vfsmount *newmnt; |
239 | struct dentry *old_dentry; | 239 | struct dentry *old_dentry; |
@@ -249,7 +249,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
249 | newmnt = afs_mntpt_do_automount(dentry); | 249 | newmnt = afs_mntpt_do_automount(dentry); |
250 | if (IS_ERR(newmnt)) { | 250 | if (IS_ERR(newmnt)) { |
251 | path_release(nd); | 251 | path_release(nd); |
252 | return PTR_ERR(newmnt); | 252 | return (void *)newmnt; |
253 | } | 253 | } |
254 | 254 | ||
255 | old_dentry = nd->dentry; | 255 | old_dentry = nd->dentry; |
@@ -267,7 +267,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | kleave(" = %d", err); | 269 | kleave(" = %d", err); |
270 | return err; | 270 | return ERR_PTR(err); |
271 | } /* end afs_mntpt_follow_link() */ | 271 | } /* end afs_mntpt_follow_link() */ |
272 | 272 | ||
273 | /*****************************************************************************/ | 273 | /*****************************************************************************/ |
diff --git a/fs/autofs/symlink.c b/fs/autofs/symlink.c index f028396f1383..52e8772b066e 100644 --- a/fs/autofs/symlink.c +++ b/fs/autofs/symlink.c | |||
@@ -12,11 +12,12 @@ | |||
12 | 12 | ||
13 | #include "autofs_i.h" | 13 | #include "autofs_i.h" |
14 | 14 | ||
15 | static int autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | 15 | /* Nothing to release.. */ |
16 | static void *autofs_follow_link(struct dentry *dentry, struct nameidata *nd) | ||
16 | { | 17 | { |
17 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; | 18 | char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data; |
18 | nd_set_link(nd, s); | 19 | nd_set_link(nd, s); |
19 | return 0; | 20 | return NULL; |
20 | } | 21 | } |
21 | 22 | ||
22 | struct inode_operations autofs_symlink_inode_operations = { | 23 | struct inode_operations autofs_symlink_inode_operations = { |
diff --git a/fs/autofs4/symlink.c b/fs/autofs4/symlink.c index c265a66edf0f..2ea2c98fd84b 100644 --- a/fs/autofs4/symlink.c +++ b/fs/autofs4/symlink.c | |||
@@ -12,11 +12,11 @@ | |||
12 | 12 | ||
13 | #include "autofs_i.h" | 13 | #include "autofs_i.h" |
14 | 14 | ||
15 | static int autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | 15 | static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) |
16 | { | 16 | { |
17 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | 17 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
18 | nd_set_link(nd, (char *)ino->u.symlink); | 18 | nd_set_link(nd, (char *)ino->u.symlink); |
19 | return 0; | 19 | return NULL; |
20 | } | 20 | } |
21 | 21 | ||
22 | struct inode_operations autofs4_symlink_inode_operations = { | 22 | struct inode_operations autofs4_symlink_inode_operations = { |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index de5bb280a828..e0a6025f1d06 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -41,8 +41,8 @@ static struct inode *befs_alloc_inode(struct super_block *sb); | |||
41 | static void befs_destroy_inode(struct inode *inode); | 41 | static void befs_destroy_inode(struct inode *inode); |
42 | static int befs_init_inodecache(void); | 42 | static int befs_init_inodecache(void); |
43 | static void befs_destroy_inodecache(void); | 43 | static void befs_destroy_inodecache(void); |
44 | static int befs_follow_link(struct dentry *, struct nameidata *); | 44 | static void *befs_follow_link(struct dentry *, struct nameidata *); |
45 | static void befs_put_link(struct dentry *, struct nameidata *); | 45 | static void befs_put_link(struct dentry *, struct nameidata *, void *); |
46 | static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, | 46 | static int befs_utf2nls(struct super_block *sb, const char *in, int in_len, |
47 | char **out, int *out_len); | 47 | char **out, int *out_len); |
48 | static int befs_nls2utf(struct super_block *sb, const char *in, int in_len, | 48 | static int befs_nls2utf(struct super_block *sb, const char *in, int in_len, |
@@ -461,7 +461,7 @@ befs_destroy_inodecache(void) | |||
461 | * The data stream become link name. Unless the LONG_SYMLINK | 461 | * The data stream become link name. Unless the LONG_SYMLINK |
462 | * flag is set. | 462 | * flag is set. |
463 | */ | 463 | */ |
464 | static int | 464 | static void * |
465 | befs_follow_link(struct dentry *dentry, struct nameidata *nd) | 465 | befs_follow_link(struct dentry *dentry, struct nameidata *nd) |
466 | { | 466 | { |
467 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); | 467 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); |
@@ -487,10 +487,10 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
487 | } | 487 | } |
488 | 488 | ||
489 | nd_set_link(nd, link); | 489 | nd_set_link(nd, link); |
490 | return 0; | 490 | return NULL; |
491 | } | 491 | } |
492 | 492 | ||
493 | static void befs_put_link(struct dentry *dentry, struct nameidata *nd) | 493 | static void befs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
494 | { | 494 | { |
495 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); | 495 | befs_inode_info *befs_ino = BEFS_I(dentry->d_inode); |
496 | if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { | 496 | if (befs_ino->i_flags & BEFS_LONG_SYMLINK) { |
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/mempool.h> | 26 | #include <linux/mempool.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <scsi/sg.h> /* for struct sg_iovec */ | ||
28 | 29 | ||
29 | #define BIO_POOL_SIZE 256 | 30 | #define BIO_POOL_SIZE 256 |
30 | 31 | ||
@@ -248,17 +249,13 @@ inline void __bio_clone(struct bio *bio, struct bio *bio_src) | |||
248 | { | 249 | { |
249 | request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); | 250 | request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); |
250 | 251 | ||
251 | memcpy(bio->bi_io_vec, bio_src->bi_io_vec, bio_src->bi_max_vecs * sizeof(struct bio_vec)); | 252 | memcpy(bio->bi_io_vec, bio_src->bi_io_vec, |
253 | bio_src->bi_max_vecs * sizeof(struct bio_vec)); | ||
252 | 254 | ||
253 | bio->bi_sector = bio_src->bi_sector; | 255 | bio->bi_sector = bio_src->bi_sector; |
254 | bio->bi_bdev = bio_src->bi_bdev; | 256 | bio->bi_bdev = bio_src->bi_bdev; |
255 | bio->bi_flags |= 1 << BIO_CLONED; | 257 | bio->bi_flags |= 1 << BIO_CLONED; |
256 | bio->bi_rw = bio_src->bi_rw; | 258 | bio->bi_rw = bio_src->bi_rw; |
257 | |||
258 | /* | ||
259 | * notes -- maybe just leave bi_idx alone. assume identical mapping | ||
260 | * for the clone | ||
261 | */ | ||
262 | bio->bi_vcnt = bio_src->bi_vcnt; | 259 | bio->bi_vcnt = bio_src->bi_vcnt; |
263 | bio->bi_size = bio_src->bi_size; | 260 | bio->bi_size = bio_src->bi_size; |
264 | bio->bi_idx = bio_src->bi_idx; | 261 | bio->bi_idx = bio_src->bi_idx; |
@@ -550,22 +547,34 @@ out_bmd: | |||
550 | return ERR_PTR(ret); | 547 | return ERR_PTR(ret); |
551 | } | 548 | } |
552 | 549 | ||
553 | static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev, | 550 | static struct bio *__bio_map_user_iov(request_queue_t *q, |
554 | unsigned long uaddr, unsigned int len, | 551 | struct block_device *bdev, |
555 | int write_to_vm) | 552 | struct sg_iovec *iov, int iov_count, |
553 | int write_to_vm) | ||
556 | { | 554 | { |
557 | unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; | 555 | int i, j; |
558 | unsigned long start = uaddr >> PAGE_SHIFT; | 556 | int nr_pages = 0; |
559 | const int nr_pages = end - start; | ||
560 | int ret, offset, i; | ||
561 | struct page **pages; | 557 | struct page **pages; |
562 | struct bio *bio; | 558 | struct bio *bio; |
559 | int cur_page = 0; | ||
560 | int ret, offset; | ||
563 | 561 | ||
564 | /* | 562 | for (i = 0; i < iov_count; i++) { |
565 | * transfer and buffer must be aligned to at least hardsector | 563 | unsigned long uaddr = (unsigned long)iov[i].iov_base; |
566 | * size for now, in the future we can relax this restriction | 564 | unsigned long len = iov[i].iov_len; |
567 | */ | 565 | unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; |
568 | if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q))) | 566 | unsigned long start = uaddr >> PAGE_SHIFT; |
567 | |||
568 | nr_pages += end - start; | ||
569 | /* | ||
570 | * transfer and buffer must be aligned to at least hardsector | ||
571 | * size for now, in the future we can relax this restriction | ||
572 | */ | ||
573 | if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q))) | ||
574 | return ERR_PTR(-EINVAL); | ||
575 | } | ||
576 | |||
577 | if (!nr_pages) | ||
569 | return ERR_PTR(-EINVAL); | 578 | return ERR_PTR(-EINVAL); |
570 | 579 | ||
571 | bio = bio_alloc(GFP_KERNEL, nr_pages); | 580 | bio = bio_alloc(GFP_KERNEL, nr_pages); |
@@ -577,42 +586,54 @@ static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev, | |||
577 | if (!pages) | 586 | if (!pages) |
578 | goto out; | 587 | goto out; |
579 | 588 | ||
580 | down_read(¤t->mm->mmap_sem); | 589 | memset(pages, 0, nr_pages * sizeof(struct page *)); |
581 | ret = get_user_pages(current, current->mm, uaddr, nr_pages, | 590 | |
582 | write_to_vm, 0, pages, NULL); | 591 | for (i = 0; i < iov_count; i++) { |
583 | up_read(¤t->mm->mmap_sem); | 592 | unsigned long uaddr = (unsigned long)iov[i].iov_base; |
584 | 593 | unsigned long len = iov[i].iov_len; | |
585 | if (ret < nr_pages) | 594 | unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; |
586 | goto out; | 595 | unsigned long start = uaddr >> PAGE_SHIFT; |
587 | 596 | const int local_nr_pages = end - start; | |
588 | bio->bi_bdev = bdev; | 597 | const int page_limit = cur_page + local_nr_pages; |
589 | 598 | ||
590 | offset = uaddr & ~PAGE_MASK; | 599 | down_read(¤t->mm->mmap_sem); |
591 | for (i = 0; i < nr_pages; i++) { | 600 | ret = get_user_pages(current, current->mm, uaddr, |
592 | unsigned int bytes = PAGE_SIZE - offset; | 601 | local_nr_pages, |
593 | 602 | write_to_vm, 0, &pages[cur_page], NULL); | |
594 | if (len <= 0) | 603 | up_read(¤t->mm->mmap_sem); |
595 | break; | 604 | |
596 | 605 | if (ret < local_nr_pages) | |
597 | if (bytes > len) | 606 | goto out_unmap; |
598 | bytes = len; | 607 | |
608 | |||
609 | offset = uaddr & ~PAGE_MASK; | ||
610 | for (j = cur_page; j < page_limit; j++) { | ||
611 | unsigned int bytes = PAGE_SIZE - offset; | ||
612 | |||
613 | if (len <= 0) | ||
614 | break; | ||
615 | |||
616 | if (bytes > len) | ||
617 | bytes = len; | ||
618 | |||
619 | /* | ||
620 | * sorry... | ||
621 | */ | ||
622 | if (__bio_add_page(q, bio, pages[j], bytes, offset) < bytes) | ||
623 | break; | ||
624 | |||
625 | len -= bytes; | ||
626 | offset = 0; | ||
627 | } | ||
599 | 628 | ||
629 | cur_page = j; | ||
600 | /* | 630 | /* |
601 | * sorry... | 631 | * release the pages we didn't map into the bio, if any |
602 | */ | 632 | */ |
603 | if (__bio_add_page(q, bio, pages[i], bytes, offset) < bytes) | 633 | while (j < page_limit) |
604 | break; | 634 | page_cache_release(pages[j++]); |
605 | |||
606 | len -= bytes; | ||
607 | offset = 0; | ||
608 | } | 635 | } |
609 | 636 | ||
610 | /* | ||
611 | * release the pages we didn't map into the bio, if any | ||
612 | */ | ||
613 | while (i < nr_pages) | ||
614 | page_cache_release(pages[i++]); | ||
615 | |||
616 | kfree(pages); | 637 | kfree(pages); |
617 | 638 | ||
618 | /* | 639 | /* |
@@ -621,9 +642,17 @@ static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev, | |||
621 | if (!write_to_vm) | 642 | if (!write_to_vm) |
622 | bio->bi_rw |= (1 << BIO_RW); | 643 | bio->bi_rw |= (1 << BIO_RW); |
623 | 644 | ||
645 | bio->bi_bdev = bdev; | ||
624 | bio->bi_flags |= (1 << BIO_USER_MAPPED); | 646 | bio->bi_flags |= (1 << BIO_USER_MAPPED); |
625 | return bio; | 647 | return bio; |
626 | out: | 648 | |
649 | out_unmap: | ||
650 | for (i = 0; i < nr_pages; i++) { | ||
651 | if(!pages[i]) | ||
652 | break; | ||
653 | page_cache_release(pages[i]); | ||
654 | } | ||
655 | out: | ||
627 | kfree(pages); | 656 | kfree(pages); |
628 | bio_put(bio); | 657 | bio_put(bio); |
629 | return ERR_PTR(ret); | 658 | return ERR_PTR(ret); |
@@ -643,9 +672,33 @@ out: | |||
643 | struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev, | 672 | struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev, |
644 | unsigned long uaddr, unsigned int len, int write_to_vm) | 673 | unsigned long uaddr, unsigned int len, int write_to_vm) |
645 | { | 674 | { |
675 | struct sg_iovec iov; | ||
676 | |||
677 | iov.iov_base = (__user void *)uaddr; | ||
678 | iov.iov_len = len; | ||
679 | |||
680 | return bio_map_user_iov(q, bdev, &iov, 1, write_to_vm); | ||
681 | } | ||
682 | |||
683 | /** | ||
684 | * bio_map_user_iov - map user sg_iovec table into bio | ||
685 | * @q: the request_queue_t for the bio | ||
686 | * @bdev: destination block device | ||
687 | * @iov: the iovec. | ||
688 | * @iov_count: number of elements in the iovec | ||
689 | * @write_to_vm: bool indicating writing to pages or not | ||
690 | * | ||
691 | * Map the user space address into a bio suitable for io to a block | ||
692 | * device. Returns an error pointer in case of error. | ||
693 | */ | ||
694 | struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev, | ||
695 | struct sg_iovec *iov, int iov_count, | ||
696 | int write_to_vm) | ||
697 | { | ||
646 | struct bio *bio; | 698 | struct bio *bio; |
699 | int len = 0, i; | ||
647 | 700 | ||
648 | bio = __bio_map_user(q, bdev, uaddr, len, write_to_vm); | 701 | bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm); |
649 | 702 | ||
650 | if (IS_ERR(bio)) | 703 | if (IS_ERR(bio)) |
651 | return bio; | 704 | return bio; |
@@ -658,6 +711,9 @@ struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev, | |||
658 | */ | 711 | */ |
659 | bio_get(bio); | 712 | bio_get(bio); |
660 | 713 | ||
714 | for (i = 0; i < iov_count; i++) | ||
715 | len += iov[i].iov_len; | ||
716 | |||
661 | if (bio->bi_size == len) | 717 | if (bio->bi_size == len) |
662 | return bio; | 718 | return bio; |
663 | 719 | ||
@@ -702,6 +758,82 @@ void bio_unmap_user(struct bio *bio) | |||
702 | bio_put(bio); | 758 | bio_put(bio); |
703 | } | 759 | } |
704 | 760 | ||
761 | static int bio_map_kern_endio(struct bio *bio, unsigned int bytes_done, int err) | ||
762 | { | ||
763 | if (bio->bi_size) | ||
764 | return 1; | ||
765 | |||
766 | bio_put(bio); | ||
767 | return 0; | ||
768 | } | ||
769 | |||
770 | |||
771 | static struct bio *__bio_map_kern(request_queue_t *q, void *data, | ||
772 | unsigned int len, unsigned int gfp_mask) | ||
773 | { | ||
774 | unsigned long kaddr = (unsigned long)data; | ||
775 | unsigned long end = (kaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
776 | unsigned long start = kaddr >> PAGE_SHIFT; | ||
777 | const int nr_pages = end - start; | ||
778 | int offset, i; | ||
779 | struct bio *bio; | ||
780 | |||
781 | bio = bio_alloc(gfp_mask, nr_pages); | ||
782 | if (!bio) | ||
783 | return ERR_PTR(-ENOMEM); | ||
784 | |||
785 | offset = offset_in_page(kaddr); | ||
786 | for (i = 0; i < nr_pages; i++) { | ||
787 | unsigned int bytes = PAGE_SIZE - offset; | ||
788 | |||
789 | if (len <= 0) | ||
790 | break; | ||
791 | |||
792 | if (bytes > len) | ||
793 | bytes = len; | ||
794 | |||
795 | if (__bio_add_page(q, bio, virt_to_page(data), bytes, | ||
796 | offset) < bytes) | ||
797 | break; | ||
798 | |||
799 | data += bytes; | ||
800 | len -= bytes; | ||
801 | offset = 0; | ||
802 | } | ||
803 | |||
804 | bio->bi_end_io = bio_map_kern_endio; | ||
805 | return bio; | ||
806 | } | ||
807 | |||
808 | /** | ||
809 | * bio_map_kern - map kernel address into bio | ||
810 | * @q: the request_queue_t for the bio | ||
811 | * @data: pointer to buffer to map | ||
812 | * @len: length in bytes | ||
813 | * @gfp_mask: allocation flags for bio allocation | ||
814 | * | ||
815 | * Map the kernel address into a bio suitable for io to a block | ||
816 | * device. Returns an error pointer in case of error. | ||
817 | */ | ||
818 | struct bio *bio_map_kern(request_queue_t *q, void *data, unsigned int len, | ||
819 | unsigned int gfp_mask) | ||
820 | { | ||
821 | struct bio *bio; | ||
822 | |||
823 | bio = __bio_map_kern(q, data, len, gfp_mask); | ||
824 | if (IS_ERR(bio)) | ||
825 | return bio; | ||
826 | |||
827 | if (bio->bi_size == len) | ||
828 | return bio; | ||
829 | |||
830 | /* | ||
831 | * Don't support partial mappings. | ||
832 | */ | ||
833 | bio_put(bio); | ||
834 | return ERR_PTR(-EINVAL); | ||
835 | } | ||
836 | |||
705 | /* | 837 | /* |
706 | * bio_set_pages_dirty() and bio_check_pages_dirty() are support functions | 838 | * bio_set_pages_dirty() and bio_check_pages_dirty() are support functions |
707 | * for performing direct-IO in BIOs. | 839 | * for performing direct-IO in BIOs. |
@@ -1089,6 +1221,7 @@ EXPORT_SYMBOL(bio_add_page); | |||
1089 | EXPORT_SYMBOL(bio_get_nr_vecs); | 1221 | EXPORT_SYMBOL(bio_get_nr_vecs); |
1090 | EXPORT_SYMBOL(bio_map_user); | 1222 | EXPORT_SYMBOL(bio_map_user); |
1091 | EXPORT_SYMBOL(bio_unmap_user); | 1223 | EXPORT_SYMBOL(bio_unmap_user); |
1224 | EXPORT_SYMBOL(bio_map_kern); | ||
1092 | EXPORT_SYMBOL(bio_pair_release); | 1225 | EXPORT_SYMBOL(bio_pair_release); |
1093 | EXPORT_SYMBOL(bio_split); | 1226 | EXPORT_SYMBOL(bio_split); |
1094 | EXPORT_SYMBOL(bio_split_pool); | 1227 | EXPORT_SYMBOL(bio_split_pool); |
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index dab4774ee7bb..3196d4c4eed3 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -1,3 +1,9 @@ | |||
1 | Version 1.35 | ||
2 | ------------ | ||
3 | Add writepage performance improvements. Fix path name conversions | ||
4 | for long filenames on mounts which were done with "mapchars" mount option | ||
5 | specified. | ||
6 | |||
1 | Version 1.34 | 7 | Version 1.34 |
2 | ------------ | 8 | ------------ |
3 | Fix error mapping of the TOO_MANY_LINKS (hardlinks) case. | 9 | Fix error mapping of the TOO_MANY_LINKS (hardlinks) case. |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 78af5850c558..1fd21f66f243 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -83,8 +83,8 @@ extern int cifs_dir_notify(struct file *, unsigned long arg); | |||
83 | extern struct dentry_operations cifs_dentry_ops; | 83 | extern struct dentry_operations cifs_dentry_ops; |
84 | 84 | ||
85 | /* Functions related to symlinks */ | 85 | /* Functions related to symlinks */ |
86 | extern int cifs_follow_link(struct dentry *direntry, struct nameidata *nd); | 86 | extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd); |
87 | extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd); | 87 | extern void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *); |
88 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, | 88 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, |
89 | int buflen); | 89 | int buflen); |
90 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, | 90 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 3c628bf667a5..0db0b313d715 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -2602,6 +2602,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
2602 | if(name_len < PATH_MAX) { | 2602 | if(name_len < PATH_MAX) { |
2603 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); | 2603 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); |
2604 | byte_count += name_len; | 2604 | byte_count += name_len; |
2605 | /* 14 byte parm len above enough for 2 byte null terminator */ | ||
2606 | pSMB->ResumeFileName[name_len] = 0; | ||
2607 | pSMB->ResumeFileName[name_len+1] = 0; | ||
2605 | } else { | 2608 | } else { |
2606 | rc = -EINVAL; | 2609 | rc = -EINVAL; |
2607 | goto FNext2_err_exit; | 2610 | goto FNext2_err_exit; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 30ab70ce5547..3497125189df 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -643,7 +643,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) | |||
643 | netfid, length, | 643 | netfid, length, |
644 | pfLock->fl_start, numUnlock, numLock, lockType, | 644 | pfLock->fl_start, numUnlock, numLock, lockType, |
645 | wait_flag); | 645 | wait_flag); |
646 | if (rc == 0 && (pfLock->fl_flags & FL_POSIX)) | 646 | if (pfLock->fl_flags & FL_POSIX) |
647 | posix_lock_file_wait(file, pfLock); | 647 | posix_lock_file_wait(file, pfLock); |
648 | FreeXid(xid); | 648 | FreeXid(xid); |
649 | return rc; | 649 | return rc; |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index bde0fabfece0..ab925ef4f863 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -92,7 +92,7 @@ cifs_hl_exit: | |||
92 | return rc; | 92 | return rc; |
93 | } | 93 | } |
94 | 94 | ||
95 | int | 95 | void * |
96 | cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | 96 | cifs_follow_link(struct dentry *direntry, struct nameidata *nd) |
97 | { | 97 | { |
98 | struct inode *inode = direntry->d_inode; | 98 | struct inode *inode = direntry->d_inode; |
@@ -148,7 +148,7 @@ out: | |||
148 | out_no_free: | 148 | out_no_free: |
149 | FreeXid(xid); | 149 | FreeXid(xid); |
150 | nd_set_link(nd, target_path); | 150 | nd_set_link(nd, target_path); |
151 | return 0; | 151 | return NULL; /* No cookie */ |
152 | } | 152 | } |
153 | 153 | ||
154 | int | 154 | int |
@@ -330,7 +330,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) | |||
330 | return rc; | 330 | return rc; |
331 | } | 331 | } |
332 | 332 | ||
333 | void cifs_put_link(struct dentry *direntry, struct nameidata *nd) | 333 | void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie) |
334 | { | 334 | { |
335 | char *p = nd_get_link(nd); | 335 | char *p = nd_get_link(nd); |
336 | if (!IS_ERR(p)) | 336 | if (!IS_ERR(p)) |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 072b4ee8c53e..20ae4153f791 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -611,6 +611,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen, | |||
611 | src_char = source[i]; | 611 | src_char = source[i]; |
612 | switch (src_char) { | 612 | switch (src_char) { |
613 | case 0: | 613 | case 0: |
614 | target[j] = 0; | ||
614 | goto ctoUCS_out; | 615 | goto ctoUCS_out; |
615 | case ':': | 616 | case ':': |
616 | target[j] = cpu_to_le16(UNI_COLON); | 617 | target[j] = cpu_to_le16(UNI_COLON); |
diff --git a/fs/dcache.c b/fs/dcache.c index 3aa8a7e980d8..a15a2e1f5520 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/fsnotify.h> | ||
22 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
23 | #include <linux/init.h> | 24 | #include <linux/init.h> |
24 | #include <linux/smp_lock.h> | 25 | #include <linux/smp_lock.h> |
@@ -101,6 +102,7 @@ static inline void dentry_iput(struct dentry * dentry) | |||
101 | list_del_init(&dentry->d_alias); | 102 | list_del_init(&dentry->d_alias); |
102 | spin_unlock(&dentry->d_lock); | 103 | spin_unlock(&dentry->d_lock); |
103 | spin_unlock(&dcache_lock); | 104 | spin_unlock(&dcache_lock); |
105 | fsnotify_inoderemove(inode); | ||
104 | if (dentry->d_op && dentry->d_op->d_iput) | 106 | if (dentry->d_op && dentry->d_op->d_iput) |
105 | dentry->d_op->d_iput(dentry, inode); | 107 | dentry->d_op->d_iput(dentry, inode); |
106 | else | 108 | else |
@@ -1165,13 +1167,16 @@ out: | |||
1165 | 1167 | ||
1166 | void d_delete(struct dentry * dentry) | 1168 | void d_delete(struct dentry * dentry) |
1167 | { | 1169 | { |
1170 | int isdir = 0; | ||
1168 | /* | 1171 | /* |
1169 | * Are we the only user? | 1172 | * Are we the only user? |
1170 | */ | 1173 | */ |
1171 | spin_lock(&dcache_lock); | 1174 | spin_lock(&dcache_lock); |
1172 | spin_lock(&dentry->d_lock); | 1175 | spin_lock(&dentry->d_lock); |
1176 | isdir = S_ISDIR(dentry->d_inode->i_mode); | ||
1173 | if (atomic_read(&dentry->d_count) == 1) { | 1177 | if (atomic_read(&dentry->d_count) == 1) { |
1174 | dentry_iput(dentry); | 1178 | dentry_iput(dentry); |
1179 | fsnotify_nameremove(dentry, isdir); | ||
1175 | return; | 1180 | return; |
1176 | } | 1181 | } |
1177 | 1182 | ||
@@ -1180,6 +1185,8 @@ void d_delete(struct dentry * dentry) | |||
1180 | 1185 | ||
1181 | spin_unlock(&dentry->d_lock); | 1186 | spin_unlock(&dentry->d_lock); |
1182 | spin_unlock(&dcache_lock); | 1187 | spin_unlock(&dcache_lock); |
1188 | |||
1189 | fsnotify_nameremove(dentry, isdir); | ||
1183 | } | 1190 | } |
1184 | 1191 | ||
1185 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) | 1192 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) |
diff --git a/fs/devfs/base.c b/fs/devfs/base.c index 1ecfe1f184d4..8b679b67e5e0 100644 --- a/fs/devfs/base.c +++ b/fs/devfs/base.c | |||
@@ -2491,11 +2491,11 @@ static int devfs_mknod(struct inode *dir, struct dentry *dentry, int mode, | |||
2491 | return 0; | 2491 | return 0; |
2492 | } /* End Function devfs_mknod */ | 2492 | } /* End Function devfs_mknod */ |
2493 | 2493 | ||
2494 | static int devfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 2494 | static void *devfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
2495 | { | 2495 | { |
2496 | struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode); | 2496 | struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode); |
2497 | nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV)); | 2497 | nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV)); |
2498 | return 0; | 2498 | return NULL; |
2499 | } /* End Function devfs_follow_link */ | 2499 | } /* End Function devfs_follow_link */ |
2500 | 2500 | ||
2501 | static struct inode_operations devfs_iops = { | 2501 | static struct inode_operations devfs_iops = { |
diff --git a/fs/ext2/symlink.c b/fs/ext2/symlink.c index 9f7bac01d557..1e67d87cfa91 100644 --- a/fs/ext2/symlink.c +++ b/fs/ext2/symlink.c | |||
@@ -21,11 +21,11 @@ | |||
21 | #include "xattr.h" | 21 | #include "xattr.h" |
22 | #include <linux/namei.h> | 22 | #include <linux/namei.h> |
23 | 23 | ||
24 | static int ext2_follow_link(struct dentry *dentry, struct nameidata *nd) | 24 | static void *ext2_follow_link(struct dentry *dentry, struct nameidata *nd) |
25 | { | 25 | { |
26 | struct ext2_inode_info *ei = EXT2_I(dentry->d_inode); | 26 | struct ext2_inode_info *ei = EXT2_I(dentry->d_inode); |
27 | nd_set_link(nd, (char *)ei->i_data); | 27 | nd_set_link(nd, (char *)ei->i_data); |
28 | return 0; | 28 | return NULL; |
29 | } | 29 | } |
30 | 30 | ||
31 | struct inode_operations ext2_symlink_inode_operations = { | 31 | struct inode_operations ext2_symlink_inode_operations = { |
diff --git a/fs/ext3/symlink.c b/fs/ext3/symlink.c index 8c3e72818fb0..4f79122cde67 100644 --- a/fs/ext3/symlink.c +++ b/fs/ext3/symlink.c | |||
@@ -23,11 +23,11 @@ | |||
23 | #include <linux/namei.h> | 23 | #include <linux/namei.h> |
24 | #include "xattr.h" | 24 | #include "xattr.h" |
25 | 25 | ||
26 | static int ext3_follow_link(struct dentry *dentry, struct nameidata *nd) | 26 | static void * ext3_follow_link(struct dentry *dentry, struct nameidata *nd) |
27 | { | 27 | { |
28 | struct ext3_inode_info *ei = EXT3_I(dentry->d_inode); | 28 | struct ext3_inode_info *ei = EXT3_I(dentry->d_inode); |
29 | nd_set_link(nd, (char*)ei->i_data); | 29 | nd_set_link(nd, (char*)ei->i_data); |
30 | return 0; | 30 | return NULL; |
31 | } | 31 | } |
32 | 32 | ||
33 | struct inode_operations ext3_symlink_inode_operations = { | 33 | struct inode_operations ext3_symlink_inode_operations = { |
diff --git a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c index ac677ab262b2..d0401dc68d41 100644 --- a/fs/freevxfs/vxfs_immed.c +++ b/fs/freevxfs/vxfs_immed.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "vxfs_inode.h" | 38 | #include "vxfs_inode.h" |
39 | 39 | ||
40 | 40 | ||
41 | static int vxfs_immed_follow_link(struct dentry *, struct nameidata *); | 41 | static void * vxfs_immed_follow_link(struct dentry *, struct nameidata *); |
42 | 42 | ||
43 | static int vxfs_immed_readpage(struct file *, struct page *); | 43 | static int vxfs_immed_readpage(struct file *, struct page *); |
44 | 44 | ||
@@ -72,12 +72,12 @@ struct address_space_operations vxfs_immed_aops = { | |||
72 | * Returns: | 72 | * Returns: |
73 | * Zero on success, else a negative error code. | 73 | * Zero on success, else a negative error code. |
74 | */ | 74 | */ |
75 | static int | 75 | static void * |
76 | vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np) | 76 | vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np) |
77 | { | 77 | { |
78 | struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); | 78 | struct vxfs_inode_info *vip = VXFS_INO(dp->d_inode); |
79 | nd_set_link(np, vip->vii_immed.vi_immed); | 79 | nd_set_link(np, vip->vii_immed.vi_immed); |
80 | return 0; | 80 | return NULL; |
81 | } | 81 | } |
82 | 82 | ||
83 | /** | 83 | /** |
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index 6ad1211f84ed..a096c5a56664 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c | |||
@@ -480,6 +480,8 @@ void hfs_bnode_put(struct hfs_bnode *node) | |||
480 | return; | 480 | return; |
481 | } | 481 | } |
482 | for (i = 0; i < tree->pages_per_bnode; i++) { | 482 | for (i = 0; i < tree->pages_per_bnode; i++) { |
483 | if (!node->page[i]) | ||
484 | continue; | ||
483 | mark_page_accessed(node->page[i]); | 485 | mark_page_accessed(node->page[i]); |
484 | #if REF_PAGES | 486 | #if REF_PAGES |
485 | put_page(node->page[i]); | 487 | put_page(node->page[i]); |
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c index cbc8510ad222..5ea6b3d45eaa 100644 --- a/fs/hfs/extent.c +++ b/fs/hfs/extent.c | |||
@@ -482,7 +482,8 @@ void hfs_file_truncate(struct inode *inode) | |||
482 | page_cache_release(page); | 482 | page_cache_release(page); |
483 | mark_inode_dirty(inode); | 483 | mark_inode_dirty(inode); |
484 | return; | 484 | return; |
485 | } | 485 | } else if (inode->i_size == HFS_I(inode)->phys_size) |
486 | return; | ||
486 | size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1; | 487 | size = inode->i_size + HFS_SB(sb)->alloc_blksz - 1; |
487 | blk_cnt = size / HFS_SB(sb)->alloc_blksz; | 488 | blk_cnt = size / HFS_SB(sb)->alloc_blksz; |
488 | alloc_cnt = HFS_I(inode)->alloc_blocks; | 489 | alloc_cnt = HFS_I(inode)->alloc_blocks; |
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index 267872e84d71..8868d3b766fd 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c | |||
@@ -643,6 +643,8 @@ void hfs_bnode_put(struct hfs_bnode *node) | |||
643 | return; | 643 | return; |
644 | } | 644 | } |
645 | for (i = 0; i < tree->pages_per_bnode; i++) { | 645 | for (i = 0; i < tree->pages_per_bnode; i++) { |
646 | if (!node->page[i]) | ||
647 | continue; | ||
646 | mark_page_accessed(node->page[i]); | 648 | mark_page_accessed(node->page[i]); |
647 | #if REF_PAGES | 649 | #if REF_PAGES |
648 | put_page(node->page[i]); | 650 | put_page(node->page[i]); |
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index 376498cc64fd..e7235ca79a95 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c | |||
@@ -461,7 +461,9 @@ void hfsplus_file_truncate(struct inode *inode) | |||
461 | page_cache_release(page); | 461 | page_cache_release(page); |
462 | mark_inode_dirty(inode); | 462 | mark_inode_dirty(inode); |
463 | return; | 463 | return; |
464 | } | 464 | } else if (inode->i_size == HFSPLUS_I(inode).phys_size) |
465 | return; | ||
466 | |||
465 | blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >> HFSPLUS_SB(sb).alloc_blksz_shift; | 467 | blk_cnt = (inode->i_size + HFSPLUS_SB(sb).alloc_blksz - 1) >> HFSPLUS_SB(sb).alloc_blksz_shift; |
466 | alloc_cnt = HFSPLUS_I(inode).alloc_blocks; | 468 | alloc_cnt = HFSPLUS_I(inode).alloc_blocks; |
467 | if (blk_cnt == alloc_cnt) | 469 | if (blk_cnt == alloc_cnt) |
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c index ff150fedb981..52930915bad8 100644 --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c | |||
@@ -38,7 +38,7 @@ struct hppfs_inode_info { | |||
38 | 38 | ||
39 | static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) | 39 | static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) |
40 | { | 40 | { |
41 | return(list_entry(inode, struct hppfs_inode_info, vfs_inode)); | 41 | return container_of(inode, struct hppfs_inode_info, vfs_inode); |
42 | } | 42 | } |
43 | 43 | ||
44 | #define HPPFS_SUPER_MAGIC 0xb00000ee | 44 | #define HPPFS_SUPER_MAGIC 0xb00000ee |
@@ -662,42 +662,36 @@ static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen) | |||
662 | { | 662 | { |
663 | struct file *proc_file; | 663 | struct file *proc_file; |
664 | struct dentry *proc_dentry; | 664 | struct dentry *proc_dentry; |
665 | int (*readlink)(struct dentry *, char *, int); | 665 | int ret; |
666 | int err, n; | ||
667 | 666 | ||
668 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; | 667 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; |
669 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); | 668 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); |
670 | err = PTR_ERR(proc_dentry); | 669 | if (IS_ERR(proc_file)) |
671 | if(IS_ERR(proc_dentry)) | 670 | return PTR_ERR(proc_file); |
672 | return(err); | ||
673 | 671 | ||
674 | readlink = proc_dentry->d_inode->i_op->readlink; | 672 | ret = proc_dentry->d_inode->i_op->readlink(proc_dentry, buffer, buflen); |
675 | n = (*readlink)(proc_dentry, buffer, buflen); | ||
676 | 673 | ||
677 | fput(proc_file); | 674 | fput(proc_file); |
678 | 675 | ||
679 | return(n); | 676 | return ret; |
680 | } | 677 | } |
681 | 678 | ||
682 | static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 679 | static void* hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
683 | { | 680 | { |
684 | struct file *proc_file; | 681 | struct file *proc_file; |
685 | struct dentry *proc_dentry; | 682 | struct dentry *proc_dentry; |
686 | int (*follow_link)(struct dentry *, struct nameidata *); | 683 | void *ret; |
687 | int err, n; | ||
688 | 684 | ||
689 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; | 685 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; |
690 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); | 686 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); |
691 | err = PTR_ERR(proc_dentry); | 687 | if (IS_ERR(proc_file)) |
692 | if(IS_ERR(proc_dentry)) | 688 | return proc_file; |
693 | return(err); | ||
694 | 689 | ||
695 | follow_link = proc_dentry->d_inode->i_op->follow_link; | 690 | ret = proc_dentry->d_inode->i_op->follow_link(proc_dentry, nd); |
696 | n = (*follow_link)(proc_dentry, nd); | ||
697 | 691 | ||
698 | fput(proc_file); | 692 | fput(proc_file); |
699 | 693 | ||
700 | return(n); | 694 | return ret; |
701 | } | 695 | } |
702 | 696 | ||
703 | static struct inode_operations hppfs_dir_iops = { | 697 | static struct inode_operations hppfs_dir_iops = { |
diff --git a/fs/inotify.c b/fs/inotify.c index a8a714e48140..2e4e2a57708c 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -90,6 +90,7 @@ struct inotify_device { | |||
90 | unsigned int queue_size; /* size of the queue (bytes) */ | 90 | unsigned int queue_size; /* size of the queue (bytes) */ |
91 | unsigned int event_count; /* number of pending events */ | 91 | unsigned int event_count; /* number of pending events */ |
92 | unsigned int max_events; /* maximum number of events */ | 92 | unsigned int max_events; /* maximum number of events */ |
93 | u32 last_wd; /* the last wd allocated */ | ||
93 | }; | 94 | }; |
94 | 95 | ||
95 | /* | 96 | /* |
@@ -352,7 +353,7 @@ static int inotify_dev_get_wd(struct inotify_device *dev, | |||
352 | do { | 353 | do { |
353 | if (unlikely(!idr_pre_get(&dev->idr, GFP_KERNEL))) | 354 | if (unlikely(!idr_pre_get(&dev->idr, GFP_KERNEL))) |
354 | return -ENOSPC; | 355 | return -ENOSPC; |
355 | ret = idr_get_new(&dev->idr, watch, &watch->wd); | 356 | ret = idr_get_new_above(&dev->idr, watch, dev->last_wd+1, &watch->wd); |
356 | } while (ret == -EAGAIN); | 357 | } while (ret == -EAGAIN); |
357 | 358 | ||
358 | return ret; | 359 | return ret; |
@@ -401,6 +402,7 @@ static struct inotify_watch *create_watch(struct inotify_device *dev, | |||
401 | return ERR_PTR(ret); | 402 | return ERR_PTR(ret); |
402 | } | 403 | } |
403 | 404 | ||
405 | dev->last_wd = watch->wd; | ||
404 | watch->mask = mask; | 406 | watch->mask = mask; |
405 | atomic_set(&watch->count, 0); | 407 | atomic_set(&watch->count, 0); |
406 | INIT_LIST_HEAD(&watch->d_list); | 408 | INIT_LIST_HEAD(&watch->d_list); |
@@ -899,6 +901,7 @@ asmlinkage long sys_inotify_init(void) | |||
899 | dev->queue_size = 0; | 901 | dev->queue_size = 0; |
900 | dev->max_events = inotify_max_queued_events; | 902 | dev->max_events = inotify_max_queued_events; |
901 | dev->user = user; | 903 | dev->user = user; |
904 | dev->last_wd = 0; | ||
902 | atomic_set(&dev->count, 0); | 905 | atomic_set(&dev->count, 0); |
903 | 906 | ||
904 | get_inotify_dev(dev); | 907 | get_inotify_dev(dev); |
diff --git a/fs/ioprio.c b/fs/ioprio.c index 97e1f088ba00..d1c1f2b2c9da 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -62,6 +62,8 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) | |||
62 | 62 | ||
63 | break; | 63 | break; |
64 | case IOPRIO_CLASS_IDLE: | 64 | case IOPRIO_CLASS_IDLE: |
65 | if (!capable(CAP_SYS_ADMIN)) | ||
66 | return -EPERM; | ||
65 | break; | 67 | break; |
66 | default: | 68 | default: |
67 | return -EINVAL; | 69 | return -EINVAL; |
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 34a44e451689..4917315db732 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c | |||
@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *file, struct page *page) | |||
129 | cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); | 129 | cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); |
130 | brelse(bh); | 130 | brelse(bh); |
131 | 131 | ||
132 | if (cstart > cend) | ||
133 | goto eio; | ||
134 | |||
132 | csize = cend-cstart; | 135 | csize = cend-cstart; |
133 | 136 | ||
137 | if (csize > deflateBound(1UL << zisofs_block_shift)) | ||
138 | goto eio; | ||
139 | |||
134 | /* Now page[] contains an array of pages, any of which can be NULL, | 140 | /* Now page[] contains an array of pages, any of which can be NULL, |
135 | and the locks on which we hold. We should now read the data and | 141 | and the locks on which we hold. We should now read the data and |
136 | release the pages. If the pages are NULL the decompressed data | 142 | release the pages. If the pages are NULL the decompressed data |
diff --git a/fs/jffs2/symlink.c b/fs/jffs2/symlink.c index 65ab6b001dca..82ef484f5e12 100644 --- a/fs/jffs2/symlink.c +++ b/fs/jffs2/symlink.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/namei.h> | 18 | #include <linux/namei.h> |
19 | #include "nodelist.h" | 19 | #include "nodelist.h" |
20 | 20 | ||
21 | static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); | 21 | static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd); |
22 | 22 | ||
23 | struct inode_operations jffs2_symlink_inode_operations = | 23 | struct inode_operations jffs2_symlink_inode_operations = |
24 | { | 24 | { |
@@ -27,9 +27,10 @@ struct inode_operations jffs2_symlink_inode_operations = | |||
27 | .setattr = jffs2_setattr | 27 | .setattr = jffs2_setattr |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) | 30 | static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) |
31 | { | 31 | { |
32 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode); | 32 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode); |
33 | char *p = (char *)f->dents; | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * We don't acquire the f->sem mutex here since the only data we | 36 | * We don't acquire the f->sem mutex here since the only data we |
@@ -45,19 +46,20 @@ static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
45 | * nd_set_link() call. | 46 | * nd_set_link() call. |
46 | */ | 47 | */ |
47 | 48 | ||
48 | if (!f->dents) { | 49 | if (!p) { |
49 | printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n"); | 50 | printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n"); |
50 | return -EIO; | 51 | p = ERR_PTR(-EIO); |
52 | } else { | ||
53 | D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents)); | ||
51 | } | 54 | } |
52 | D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents)); | ||
53 | 55 | ||
54 | nd_set_link(nd, (char *)f->dents); | 56 | nd_set_link(nd, p); |
55 | 57 | ||
56 | /* | 58 | /* |
57 | * We unlock the f->sem mutex but VFS will use the f->dents string. This is safe | 59 | * We unlock the f->sem mutex but VFS will use the f->dents string. This is safe |
58 | * since the only way that may cause f->dents to be changed is iput() operation. | 60 | * since the only way that may cause f->dents to be changed is iput() operation. |
59 | * But VFS will not use f->dents after iput() has been called. | 61 | * But VFS will not use f->dents after iput() has been called. |
60 | */ | 62 | */ |
61 | return 0; | 63 | return NULL; |
62 | } | 64 | } |
63 | 65 | ||
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 2137138c59b0..767c7ecb429e 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -128,6 +128,10 @@ void jfs_delete_inode(struct inode *inode) | |||
128 | { | 128 | { |
129 | jfs_info("In jfs_delete_inode, inode = 0x%p", inode); | 129 | jfs_info("In jfs_delete_inode, inode = 0x%p", inode); |
130 | 130 | ||
131 | if (is_bad_inode(inode) || | ||
132 | (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I))) | ||
133 | return; | ||
134 | |||
131 | if (test_cflag(COMMIT_Freewmap, inode)) | 135 | if (test_cflag(COMMIT_Freewmap, inode)) |
132 | jfs_free_zero_link(inode); | 136 | jfs_free_zero_link(inode); |
133 | 137 | ||
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 22815e88e7cc..d27bac6acaa3 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c | |||
@@ -191,7 +191,7 @@ static int lbmIOWait(struct lbuf * bp, int flag); | |||
191 | static bio_end_io_t lbmIODone; | 191 | static bio_end_io_t lbmIODone; |
192 | static void lbmStartIO(struct lbuf * bp); | 192 | static void lbmStartIO(struct lbuf * bp); |
193 | static void lmGCwrite(struct jfs_log * log, int cant_block); | 193 | static void lmGCwrite(struct jfs_log * log, int cant_block); |
194 | static int lmLogSync(struct jfs_log * log, int nosyncwait); | 194 | static int lmLogSync(struct jfs_log * log, int hard_sync); |
195 | 195 | ||
196 | 196 | ||
197 | 197 | ||
@@ -915,19 +915,17 @@ static void lmPostGC(struct lbuf * bp) | |||
915 | * if new sync address is available | 915 | * if new sync address is available |
916 | * (normally the case if sync() is executed by back-ground | 916 | * (normally the case if sync() is executed by back-ground |
917 | * process). | 917 | * process). |
918 | * if not, explicitly run jfs_blogsync() to initiate | ||
919 | * getting of new sync address. | ||
920 | * calculate new value of i_nextsync which determines when | 918 | * calculate new value of i_nextsync which determines when |
921 | * this code is called again. | 919 | * this code is called again. |
922 | * | 920 | * |
923 | * PARAMETERS: log - log structure | 921 | * PARAMETERS: log - log structure |
924 | * nosyncwait - 1 if called asynchronously | 922 | * hard_sync - 1 to force all metadata to be written |
925 | * | 923 | * |
926 | * RETURN: 0 | 924 | * RETURN: 0 |
927 | * | 925 | * |
928 | * serialization: LOG_LOCK() held on entry/exit | 926 | * serialization: LOG_LOCK() held on entry/exit |
929 | */ | 927 | */ |
930 | static int lmLogSync(struct jfs_log * log, int nosyncwait) | 928 | static int lmLogSync(struct jfs_log * log, int hard_sync) |
931 | { | 929 | { |
932 | int logsize; | 930 | int logsize; |
933 | int written; /* written since last syncpt */ | 931 | int written; /* written since last syncpt */ |
@@ -941,11 +939,18 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
941 | unsigned long flags; | 939 | unsigned long flags; |
942 | 940 | ||
943 | /* push dirty metapages out to disk */ | 941 | /* push dirty metapages out to disk */ |
944 | list_for_each_entry(sbi, &log->sb_list, log_list) { | 942 | if (hard_sync) |
945 | filemap_flush(sbi->ipbmap->i_mapping); | 943 | list_for_each_entry(sbi, &log->sb_list, log_list) { |
946 | filemap_flush(sbi->ipimap->i_mapping); | 944 | filemap_fdatawrite(sbi->ipbmap->i_mapping); |
947 | filemap_flush(sbi->direct_inode->i_mapping); | 945 | filemap_fdatawrite(sbi->ipimap->i_mapping); |
948 | } | 946 | filemap_fdatawrite(sbi->direct_inode->i_mapping); |
947 | } | ||
948 | else | ||
949 | list_for_each_entry(sbi, &log->sb_list, log_list) { | ||
950 | filemap_flush(sbi->ipbmap->i_mapping); | ||
951 | filemap_flush(sbi->ipimap->i_mapping); | ||
952 | filemap_flush(sbi->direct_inode->i_mapping); | ||
953 | } | ||
949 | 954 | ||
950 | /* | 955 | /* |
951 | * forward syncpt | 956 | * forward syncpt |
@@ -1021,10 +1026,6 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
1021 | /* next syncpt trigger = written + more */ | 1026 | /* next syncpt trigger = written + more */ |
1022 | log->nextsync = written + more; | 1027 | log->nextsync = written + more; |
1023 | 1028 | ||
1024 | /* return if lmLogSync() from outside of transaction, e.g., sync() */ | ||
1025 | if (nosyncwait) | ||
1026 | return lsn; | ||
1027 | |||
1028 | /* if number of bytes written from last sync point is more | 1029 | /* if number of bytes written from last sync point is more |
1029 | * than 1/4 of the log size, stop new transactions from | 1030 | * than 1/4 of the log size, stop new transactions from |
1030 | * starting until all current transactions are completed | 1031 | * starting until all current transactions are completed |
@@ -1049,11 +1050,12 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
1049 | * | 1050 | * |
1050 | * FUNCTION: write log SYNCPT record for specified log | 1051 | * FUNCTION: write log SYNCPT record for specified log |
1051 | * | 1052 | * |
1052 | * PARAMETERS: log - log structure | 1053 | * PARAMETERS: log - log structure |
1054 | * hard_sync - set to 1 to force metadata to be written | ||
1053 | */ | 1055 | */ |
1054 | void jfs_syncpt(struct jfs_log *log) | 1056 | void jfs_syncpt(struct jfs_log *log, int hard_sync) |
1055 | { LOG_LOCK(log); | 1057 | { LOG_LOCK(log); |
1056 | lmLogSync(log, 1); | 1058 | lmLogSync(log, hard_sync); |
1057 | LOG_UNLOCK(log); | 1059 | LOG_UNLOCK(log); |
1058 | } | 1060 | } |
1059 | 1061 | ||
diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h index 747114cd38b8..e4978b5b65ee 100644 --- a/fs/jfs/jfs_logmgr.h +++ b/fs/jfs/jfs_logmgr.h | |||
@@ -510,6 +510,6 @@ extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize); | |||
510 | extern int lmGroupCommit(struct jfs_log *, struct tblock *); | 510 | extern int lmGroupCommit(struct jfs_log *, struct tblock *); |
511 | extern int jfsIOWait(void *); | 511 | extern int jfsIOWait(void *); |
512 | extern void jfs_flush_journal(struct jfs_log * log, int wait); | 512 | extern void jfs_flush_journal(struct jfs_log * log, int wait); |
513 | extern void jfs_syncpt(struct jfs_log *log); | 513 | extern void jfs_syncpt(struct jfs_log *log, int hard_sync); |
514 | 514 | ||
515 | #endif /* _H_JFS_LOGMGR */ | 515 | #endif /* _H_JFS_LOGMGR */ |
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index 121c981ff453..c7a92f9deb2b 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c | |||
@@ -552,6 +552,11 @@ void txEnd(tid_t tid) | |||
552 | * synchronize with logsync barrier | 552 | * synchronize with logsync barrier |
553 | */ | 553 | */ |
554 | if (test_bit(log_SYNCBARRIER, &log->flag)) { | 554 | if (test_bit(log_SYNCBARRIER, &log->flag)) { |
555 | TXN_UNLOCK(); | ||
556 | |||
557 | /* write dirty metadata & forward log syncpt */ | ||
558 | jfs_syncpt(log, 1); | ||
559 | |||
555 | jfs_info("log barrier off: 0x%x", log->lsn); | 560 | jfs_info("log barrier off: 0x%x", log->lsn); |
556 | 561 | ||
557 | /* enable new transactions start */ | 562 | /* enable new transactions start */ |
@@ -560,11 +565,6 @@ void txEnd(tid_t tid) | |||
560 | /* wakeup all waitors for logsync barrier */ | 565 | /* wakeup all waitors for logsync barrier */ |
561 | TXN_WAKEUP(&log->syncwait); | 566 | TXN_WAKEUP(&log->syncwait); |
562 | 567 | ||
563 | TXN_UNLOCK(); | ||
564 | |||
565 | /* forward log syncpt */ | ||
566 | jfs_syncpt(log); | ||
567 | |||
568 | goto wakeup; | 568 | goto wakeup; |
569 | } | 569 | } |
570 | } | 570 | } |
@@ -657,7 +657,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, | |||
657 | /* only anonymous txn. | 657 | /* only anonymous txn. |
658 | * Remove from anon_list | 658 | * Remove from anon_list |
659 | */ | 659 | */ |
660 | TXN_LOCK(); | ||
660 | list_del_init(&jfs_ip->anon_inode_list); | 661 | list_del_init(&jfs_ip->anon_inode_list); |
662 | TXN_UNLOCK(); | ||
661 | } | 663 | } |
662 | jfs_ip->atlhead = tlck->next; | 664 | jfs_ip->atlhead = tlck->next; |
663 | } else { | 665 | } else { |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index ee32211288ce..9ff89720f93b 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -114,6 +114,8 @@ static void jfs_destroy_inode(struct inode *inode) | |||
114 | { | 114 | { |
115 | struct jfs_inode_info *ji = JFS_IP(inode); | 115 | struct jfs_inode_info *ji = JFS_IP(inode); |
116 | 116 | ||
117 | BUG_ON(!list_empty(&ji->anon_inode_list)); | ||
118 | |||
117 | spin_lock_irq(&ji->ag_lock); | 119 | spin_lock_irq(&ji->ag_lock); |
118 | if (ji->active_ag != -1) { | 120 | if (ji->active_ag != -1) { |
119 | struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; | 121 | struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; |
@@ -531,7 +533,7 @@ static int jfs_sync_fs(struct super_block *sb, int wait) | |||
531 | /* log == NULL indicates read-only mount */ | 533 | /* log == NULL indicates read-only mount */ |
532 | if (log) { | 534 | if (log) { |
533 | jfs_flush_journal(log, wait); | 535 | jfs_flush_journal(log, wait); |
534 | jfs_syncpt(log); | 536 | jfs_syncpt(log, 0); |
535 | } | 537 | } |
536 | 538 | ||
537 | return 0; | 539 | return 0; |
diff --git a/fs/jfs/symlink.c b/fs/jfs/symlink.c index 287d8d6c3cfd..16477b3835e1 100644 --- a/fs/jfs/symlink.c +++ b/fs/jfs/symlink.c | |||
@@ -22,11 +22,11 @@ | |||
22 | #include "jfs_inode.h" | 22 | #include "jfs_inode.h" |
23 | #include "jfs_xattr.h" | 23 | #include "jfs_xattr.h" |
24 | 24 | ||
25 | static int jfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 25 | static void *jfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
26 | { | 26 | { |
27 | char *s = JFS_IP(dentry->d_inode)->i_inline; | 27 | char *s = JFS_IP(dentry->d_inode)->i_inline; |
28 | nd_set_link(nd, s); | 28 | nd_set_link(nd, s); |
29 | return 0; | 29 | return NULL; |
30 | } | 30 | } |
31 | 31 | ||
32 | struct inode_operations jfs_symlink_inode_operations = { | 32 | struct inode_operations jfs_symlink_inode_operations = { |
diff --git a/fs/namei.c b/fs/namei.c index 02a824cd3c5c..6ec1f0fefc5b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -501,6 +501,7 @@ struct path { | |||
501 | static inline int __do_follow_link(struct path *path, struct nameidata *nd) | 501 | static inline int __do_follow_link(struct path *path, struct nameidata *nd) |
502 | { | 502 | { |
503 | int error; | 503 | int error; |
504 | void *cookie; | ||
504 | struct dentry *dentry = path->dentry; | 505 | struct dentry *dentry = path->dentry; |
505 | 506 | ||
506 | touch_atime(path->mnt, dentry); | 507 | touch_atime(path->mnt, dentry); |
@@ -508,13 +509,15 @@ static inline int __do_follow_link(struct path *path, struct nameidata *nd) | |||
508 | 509 | ||
509 | if (path->mnt == nd->mnt) | 510 | if (path->mnt == nd->mnt) |
510 | mntget(path->mnt); | 511 | mntget(path->mnt); |
511 | error = dentry->d_inode->i_op->follow_link(dentry, nd); | 512 | cookie = dentry->d_inode->i_op->follow_link(dentry, nd); |
512 | if (!error) { | 513 | error = PTR_ERR(cookie); |
514 | if (!IS_ERR(cookie)) { | ||
513 | char *s = nd_get_link(nd); | 515 | char *s = nd_get_link(nd); |
516 | error = 0; | ||
514 | if (s) | 517 | if (s) |
515 | error = __vfs_follow_link(nd, s); | 518 | error = __vfs_follow_link(nd, s); |
516 | if (dentry->d_inode->i_op->put_link) | 519 | if (dentry->d_inode->i_op->put_link) |
517 | dentry->d_inode->i_op->put_link(dentry, nd); | 520 | dentry->d_inode->i_op->put_link(dentry, nd, cookie); |
518 | } | 521 | } |
519 | dput(dentry); | 522 | dput(dentry); |
520 | mntput(path->mnt); | 523 | mntput(path->mnt); |
@@ -1801,7 +1804,6 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
1801 | } | 1804 | } |
1802 | up(&dentry->d_inode->i_sem); | 1805 | up(&dentry->d_inode->i_sem); |
1803 | if (!error) { | 1806 | if (!error) { |
1804 | fsnotify_rmdir(dentry, dentry->d_inode, dir); | ||
1805 | d_delete(dentry); | 1807 | d_delete(dentry); |
1806 | } | 1808 | } |
1807 | dput(dentry); | 1809 | dput(dentry); |
@@ -1874,7 +1876,6 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1874 | 1876 | ||
1875 | /* We don't d_delete() NFS sillyrenamed files--they still exist. */ | 1877 | /* We don't d_delete() NFS sillyrenamed files--they still exist. */ |
1876 | if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { | 1878 | if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { |
1877 | fsnotify_unlink(dentry, dir); | ||
1878 | d_delete(dentry); | 1879 | d_delete(dentry); |
1879 | } | 1880 | } |
1880 | 1881 | ||
@@ -2218,7 +2219,8 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2218 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); | 2219 | error = vfs_rename_other(old_dir,old_dentry,new_dir,new_dentry); |
2219 | if (!error) { | 2220 | if (!error) { |
2220 | const char *new_name = old_dentry->d_name.name; | 2221 | const char *new_name = old_dentry->d_name.name; |
2221 | fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir); | 2222 | fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir, |
2223 | new_dentry->d_inode, old_dentry->d_inode); | ||
2222 | } | 2224 | } |
2223 | fsnotify_oldname_free(old_name); | 2225 | fsnotify_oldname_free(old_name); |
2224 | 2226 | ||
@@ -2345,15 +2347,17 @@ out: | |||
2345 | int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | 2347 | int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) |
2346 | { | 2348 | { |
2347 | struct nameidata nd; | 2349 | struct nameidata nd; |
2348 | int res; | 2350 | void *cookie; |
2351 | |||
2349 | nd.depth = 0; | 2352 | nd.depth = 0; |
2350 | res = dentry->d_inode->i_op->follow_link(dentry, &nd); | 2353 | cookie = dentry->d_inode->i_op->follow_link(dentry, &nd); |
2351 | if (!res) { | 2354 | if (!IS_ERR(cookie)) { |
2352 | res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd)); | 2355 | int res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd)); |
2353 | if (dentry->d_inode->i_op->put_link) | 2356 | if (dentry->d_inode->i_op->put_link) |
2354 | dentry->d_inode->i_op->put_link(dentry, &nd); | 2357 | dentry->d_inode->i_op->put_link(dentry, &nd, cookie); |
2358 | cookie = ERR_PTR(res); | ||
2355 | } | 2359 | } |
2356 | return res; | 2360 | return PTR_ERR(cookie); |
2357 | } | 2361 | } |
2358 | 2362 | ||
2359 | int vfs_follow_link(struct nameidata *nd, const char *link) | 2363 | int vfs_follow_link(struct nameidata *nd, const char *link) |
@@ -2396,23 +2400,20 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) | |||
2396 | return res; | 2400 | return res; |
2397 | } | 2401 | } |
2398 | 2402 | ||
2399 | int page_follow_link_light(struct dentry *dentry, struct nameidata *nd) | 2403 | void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd) |
2400 | { | 2404 | { |
2401 | struct page *page; | 2405 | struct page *page = NULL; |
2402 | nd_set_link(nd, page_getlink(dentry, &page)); | 2406 | nd_set_link(nd, page_getlink(dentry, &page)); |
2403 | return 0; | 2407 | return page; |
2404 | } | 2408 | } |
2405 | 2409 | ||
2406 | void page_put_link(struct dentry *dentry, struct nameidata *nd) | 2410 | void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
2407 | { | 2411 | { |
2408 | if (!IS_ERR(nd_get_link(nd))) { | 2412 | struct page *page = cookie; |
2409 | struct page *page; | 2413 | |
2410 | page = find_get_page(dentry->d_inode->i_mapping, 0); | 2414 | if (page) { |
2411 | if (!page) | ||
2412 | BUG(); | ||
2413 | kunmap(page); | 2415 | kunmap(page); |
2414 | page_cache_release(page); | 2416 | page_cache_release(page); |
2415 | page_cache_release(page); | ||
2416 | } | 2417 | } |
2417 | } | 2418 | } |
2418 | 2419 | ||
diff --git a/fs/namespace.c b/fs/namespace.c index 587eb0d707ee..79bd8a46e1e7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -160,7 +160,7 @@ clone_mnt(struct vfsmount *old, struct dentry *root) | |||
160 | mnt->mnt_root = dget(root); | 160 | mnt->mnt_root = dget(root); |
161 | mnt->mnt_mountpoint = mnt->mnt_root; | 161 | mnt->mnt_mountpoint = mnt->mnt_root; |
162 | mnt->mnt_parent = mnt; | 162 | mnt->mnt_parent = mnt; |
163 | mnt->mnt_namespace = old->mnt_namespace; | 163 | mnt->mnt_namespace = current->namespace; |
164 | 164 | ||
165 | /* stick the duplicate mount on the same expiry list | 165 | /* stick the duplicate mount on the same expiry list |
166 | * as the original if that was on one */ | 166 | * as the original if that was on one */ |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b38a57e78a63..2df639f143e8 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -182,14 +182,16 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
182 | /* We requested READDIRPLUS, but the server doesn't grok it */ | 182 | /* We requested READDIRPLUS, but the server doesn't grok it */ |
183 | if (error == -ENOTSUPP && desc->plus) { | 183 | if (error == -ENOTSUPP && desc->plus) { |
184 | NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS; | 184 | NFS_SERVER(inode)->caps &= ~NFS_CAP_READDIRPLUS; |
185 | NFS_FLAGS(inode) &= ~NFS_INO_ADVISE_RDPLUS; | 185 | clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
186 | desc->plus = 0; | 186 | desc->plus = 0; |
187 | goto again; | 187 | goto again; |
188 | } | 188 | } |
189 | goto error; | 189 | goto error; |
190 | } | 190 | } |
191 | SetPageUptodate(page); | 191 | SetPageUptodate(page); |
192 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 192 | spin_lock(&inode->i_lock); |
193 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
194 | spin_unlock(&inode->i_lock); | ||
193 | /* Ensure consistent page alignment of the data. | 195 | /* Ensure consistent page alignment of the data. |
194 | * Note: assumes we have exclusive access to this mapping either | 196 | * Note: assumes we have exclusive access to this mapping either |
195 | * through inode->i_sem or some other mechanism. | 197 | * through inode->i_sem or some other mechanism. |
@@ -462,7 +464,9 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
462 | page, | 464 | page, |
463 | NFS_SERVER(inode)->dtsize, | 465 | NFS_SERVER(inode)->dtsize, |
464 | desc->plus); | 466 | desc->plus); |
465 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 467 | spin_lock(&inode->i_lock); |
468 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
469 | spin_unlock(&inode->i_lock); | ||
466 | desc->page = page; | 470 | desc->page = page; |
467 | desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */ | 471 | desc->ptr = kmap(page); /* matching kunmap in nfs_do_filldir */ |
468 | if (desc->error >= 0) { | 472 | if (desc->error >= 0) { |
@@ -545,7 +549,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
545 | break; | 549 | break; |
546 | } | 550 | } |
547 | if (res == -ETOOSMALL && desc->plus) { | 551 | if (res == -ETOOSMALL && desc->plus) { |
548 | NFS_FLAGS(inode) &= ~NFS_INO_ADVISE_RDPLUS; | 552 | clear_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
549 | nfs_zap_caches(inode); | 553 | nfs_zap_caches(inode); |
550 | desc->plus = 0; | 554 | desc->plus = 0; |
551 | desc->entry->eof = 0; | 555 | desc->entry->eof = 0; |
@@ -608,7 +612,7 @@ static inline int nfs_check_verifier(struct inode *dir, struct dentry *dentry) | |||
608 | { | 612 | { |
609 | if (IS_ROOT(dentry)) | 613 | if (IS_ROOT(dentry)) |
610 | return 1; | 614 | return 1; |
611 | if ((NFS_FLAGS(dir) & NFS_INO_INVALID_ATTR) != 0 | 615 | if ((NFS_I(dir)->cache_validity & NFS_INO_INVALID_ATTR) != 0 |
612 | || nfs_attribute_timeout(dir)) | 616 | || nfs_attribute_timeout(dir)) |
613 | return 0; | 617 | return 0; |
614 | return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); | 618 | return nfs_verify_change_attribute(dir, (unsigned long)dentry->d_fsdata); |
@@ -935,6 +939,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
935 | error = nfs_revalidate_inode(NFS_SERVER(dir), dir); | 939 | error = nfs_revalidate_inode(NFS_SERVER(dir), dir); |
936 | if (error < 0) { | 940 | if (error < 0) { |
937 | res = ERR_PTR(error); | 941 | res = ERR_PTR(error); |
942 | unlock_kernel(); | ||
938 | goto out; | 943 | goto out; |
939 | } | 944 | } |
940 | 945 | ||
@@ -1575,11 +1580,12 @@ out: | |||
1575 | 1580 | ||
1576 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) | 1581 | int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs_access_entry *res) |
1577 | { | 1582 | { |
1578 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1583 | struct nfs_inode *nfsi = NFS_I(inode); |
1584 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1579 | 1585 | ||
1580 | if (cache->cred != cred | 1586 | if (cache->cred != cred |
1581 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) | 1587 | || time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)) |
1582 | || (NFS_FLAGS(inode) & NFS_INO_INVALID_ACCESS)) | 1588 | || (nfsi->cache_validity & NFS_INO_INVALID_ACCESS)) |
1583 | return -ENOENT; | 1589 | return -ENOENT; |
1584 | memcpy(res, cache, sizeof(*res)); | 1590 | memcpy(res, cache, sizeof(*res)); |
1585 | return 0; | 1591 | return 0; |
@@ -1587,14 +1593,18 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs | |||
1587 | 1593 | ||
1588 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) | 1594 | void nfs_access_add_cache(struct inode *inode, struct nfs_access_entry *set) |
1589 | { | 1595 | { |
1590 | struct nfs_access_entry *cache = &NFS_I(inode)->cache_access; | 1596 | struct nfs_inode *nfsi = NFS_I(inode); |
1597 | struct nfs_access_entry *cache = &nfsi->cache_access; | ||
1591 | 1598 | ||
1592 | if (cache->cred != set->cred) { | 1599 | if (cache->cred != set->cred) { |
1593 | if (cache->cred) | 1600 | if (cache->cred) |
1594 | put_rpccred(cache->cred); | 1601 | put_rpccred(cache->cred); |
1595 | cache->cred = get_rpccred(set->cred); | 1602 | cache->cred = get_rpccred(set->cred); |
1596 | } | 1603 | } |
1597 | NFS_FLAGS(inode) &= ~NFS_INO_INVALID_ACCESS; | 1604 | /* FIXME: replace current access_cache BKL reliance with inode->i_lock */ |
1605 | spin_lock(&inode->i_lock); | ||
1606 | nfsi->cache_validity &= ~NFS_INO_INVALID_ACCESS; | ||
1607 | spin_unlock(&inode->i_lock); | ||
1598 | cache->jiffies = set->jiffies; | 1608 | cache->jiffies = set->jiffies; |
1599 | cache->mask = set->mask; | 1609 | cache->mask = set->mask; |
1600 | } | 1610 | } |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 5621ba9885f4..f6b9eda925c5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -134,9 +134,10 @@ nfs_file_release(struct inode *inode, struct file *filp) | |||
134 | */ | 134 | */ |
135 | static int nfs_revalidate_file(struct inode *inode, struct file *filp) | 135 | static int nfs_revalidate_file(struct inode *inode, struct file *filp) |
136 | { | 136 | { |
137 | struct nfs_inode *nfsi = NFS_I(inode); | ||
137 | int retval = 0; | 138 | int retval = 0; |
138 | 139 | ||
139 | if ((NFS_FLAGS(inode) & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) | 140 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) || nfs_attribute_timeout(inode)) |
140 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 141 | retval = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
141 | nfs_revalidate_mapping(inode, filp->f_mapping); | 142 | nfs_revalidate_mapping(inode, filp->f_mapping); |
142 | return 0; | 143 | return 0; |
@@ -164,7 +165,7 @@ static int nfs_revalidate_file_size(struct inode *inode, struct file *filp) | |||
164 | goto force_reval; | 165 | goto force_reval; |
165 | if (nfsi->npages != 0) | 166 | if (nfsi->npages != 0) |
166 | return 0; | 167 | return 0; |
167 | if (!(NFS_FLAGS(inode) & NFS_INO_REVAL_PAGECACHE) && !nfs_attribute_timeout(inode)) | 168 | if (!(nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) && !nfs_attribute_timeout(inode)) |
168 | return 0; | 169 | return 0; |
169 | force_reval: | 170 | force_reval: |
170 | return __nfs_revalidate_inode(server, inode); | 171 | return __nfs_revalidate_inode(server, inode); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 4845911f1c63..541b418327c8 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -615,14 +615,18 @@ nfs_zap_caches(struct inode *inode) | |||
615 | struct nfs_inode *nfsi = NFS_I(inode); | 615 | struct nfs_inode *nfsi = NFS_I(inode); |
616 | int mode = inode->i_mode; | 616 | int mode = inode->i_mode; |
617 | 617 | ||
618 | spin_lock(&inode->i_lock); | ||
619 | |||
618 | NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); | 620 | NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode); |
619 | NFS_ATTRTIMEO_UPDATE(inode) = jiffies; | 621 | NFS_ATTRTIMEO_UPDATE(inode) = jiffies; |
620 | 622 | ||
621 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); | 623 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); |
622 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) | 624 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) |
623 | nfsi->flags |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 625 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
624 | else | 626 | else |
625 | nfsi->flags |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 627 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
628 | |||
629 | spin_unlock(&inode->i_lock); | ||
626 | } | 630 | } |
627 | 631 | ||
628 | static void nfs_zap_acl_cache(struct inode *inode) | 632 | static void nfs_zap_acl_cache(struct inode *inode) |
@@ -632,7 +636,9 @@ static void nfs_zap_acl_cache(struct inode *inode) | |||
632 | clear_acl_cache = NFS_PROTO(inode)->clear_acl_cache; | 636 | clear_acl_cache = NFS_PROTO(inode)->clear_acl_cache; |
633 | if (clear_acl_cache != NULL) | 637 | if (clear_acl_cache != NULL) |
634 | clear_acl_cache(inode); | 638 | clear_acl_cache(inode); |
635 | NFS_I(inode)->flags &= ~NFS_INO_INVALID_ACL; | 639 | spin_lock(&inode->i_lock); |
640 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; | ||
641 | spin_unlock(&inode->i_lock); | ||
636 | } | 642 | } |
637 | 643 | ||
638 | /* | 644 | /* |
@@ -739,7 +745,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
739 | inode->i_fop = &nfs_dir_operations; | 745 | inode->i_fop = &nfs_dir_operations; |
740 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) | 746 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) |
741 | && fattr->size <= NFS_LIMIT_READDIRPLUS) | 747 | && fattr->size <= NFS_LIMIT_READDIRPLUS) |
742 | NFS_FLAGS(inode) |= NFS_INO_ADVISE_RDPLUS; | 748 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
743 | } else if (S_ISLNK(inode->i_mode)) | 749 | } else if (S_ISLNK(inode->i_mode)) |
744 | inode->i_op = &nfs_symlink_inode_operations; | 750 | inode->i_op = &nfs_symlink_inode_operations; |
745 | else | 751 | else |
@@ -814,55 +820,84 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
814 | nfs_wb_all(inode); | 820 | nfs_wb_all(inode); |
815 | } | 821 | } |
816 | error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr); | 822 | error = NFS_PROTO(inode)->setattr(dentry, &fattr, attr); |
817 | if (error == 0) { | 823 | if (error == 0) |
818 | nfs_refresh_inode(inode, &fattr); | 824 | nfs_refresh_inode(inode, &fattr); |
825 | nfs_end_data_update(inode); | ||
826 | unlock_kernel(); | ||
827 | return error; | ||
828 | } | ||
829 | |||
830 | /** | ||
831 | * nfs_setattr_update_inode - Update inode metadata after a setattr call. | ||
832 | * @inode: pointer to struct inode | ||
833 | * @attr: pointer to struct iattr | ||
834 | * | ||
835 | * Note: we do this in the *proc.c in order to ensure that | ||
836 | * it works for things like exclusive creates too. | ||
837 | */ | ||
838 | void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr) | ||
839 | { | ||
840 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) { | ||
819 | if ((attr->ia_valid & ATTR_MODE) != 0) { | 841 | if ((attr->ia_valid & ATTR_MODE) != 0) { |
820 | int mode; | 842 | int mode = attr->ia_mode & S_IALLUGO; |
821 | mode = inode->i_mode & ~S_IALLUGO; | 843 | mode |= inode->i_mode & ~S_IALLUGO; |
822 | mode |= attr->ia_mode & S_IALLUGO; | ||
823 | inode->i_mode = mode; | 844 | inode->i_mode = mode; |
824 | } | 845 | } |
825 | if ((attr->ia_valid & ATTR_UID) != 0) | 846 | if ((attr->ia_valid & ATTR_UID) != 0) |
826 | inode->i_uid = attr->ia_uid; | 847 | inode->i_uid = attr->ia_uid; |
827 | if ((attr->ia_valid & ATTR_GID) != 0) | 848 | if ((attr->ia_valid & ATTR_GID) != 0) |
828 | inode->i_gid = attr->ia_gid; | 849 | inode->i_gid = attr->ia_gid; |
829 | if ((attr->ia_valid & ATTR_SIZE) != 0) { | 850 | spin_lock(&inode->i_lock); |
830 | inode->i_size = attr->ia_size; | 851 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; |
831 | vmtruncate(inode, attr->ia_size); | 852 | spin_unlock(&inode->i_lock); |
832 | } | ||
833 | } | 853 | } |
834 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) | 854 | if ((attr->ia_valid & ATTR_SIZE) != 0) { |
835 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL; | 855 | inode->i_size = attr->ia_size; |
836 | nfs_end_data_update(inode); | 856 | vmtruncate(inode, attr->ia_size); |
837 | unlock_kernel(); | 857 | } |
838 | return error; | 858 | } |
859 | |||
860 | static int nfs_wait_schedule(void *word) | ||
861 | { | ||
862 | if (signal_pending(current)) | ||
863 | return -ERESTARTSYS; | ||
864 | schedule(); | ||
865 | return 0; | ||
839 | } | 866 | } |
840 | 867 | ||
841 | /* | 868 | /* |
842 | * Wait for the inode to get unlocked. | 869 | * Wait for the inode to get unlocked. |
843 | * (Used for NFS_INO_LOCKED and NFS_INO_REVALIDATING). | ||
844 | */ | 870 | */ |
845 | static int | 871 | static int nfs_wait_on_inode(struct inode *inode) |
846 | nfs_wait_on_inode(struct inode *inode, int flag) | ||
847 | { | 872 | { |
848 | struct rpc_clnt *clnt = NFS_CLIENT(inode); | 873 | struct rpc_clnt *clnt = NFS_CLIENT(inode); |
849 | struct nfs_inode *nfsi = NFS_I(inode); | 874 | struct nfs_inode *nfsi = NFS_I(inode); |
850 | 875 | sigset_t oldmask; | |
851 | int error; | 876 | int error; |
852 | if (!(NFS_FLAGS(inode) & flag)) | 877 | |
853 | return 0; | ||
854 | atomic_inc(&inode->i_count); | 878 | atomic_inc(&inode->i_count); |
855 | error = nfs_wait_event(clnt, nfsi->nfs_i_wait, | 879 | rpc_clnt_sigmask(clnt, &oldmask); |
856 | !(NFS_FLAGS(inode) & flag)); | 880 | error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING, |
881 | nfs_wait_schedule, TASK_INTERRUPTIBLE); | ||
882 | rpc_clnt_sigunmask(clnt, &oldmask); | ||
857 | iput(inode); | 883 | iput(inode); |
884 | |||
858 | return error; | 885 | return error; |
859 | } | 886 | } |
860 | 887 | ||
888 | static void nfs_wake_up_inode(struct inode *inode) | ||
889 | { | ||
890 | struct nfs_inode *nfsi = NFS_I(inode); | ||
891 | |||
892 | clear_bit(NFS_INO_REVALIDATING, &nfsi->flags); | ||
893 | smp_mb__after_clear_bit(); | ||
894 | wake_up_bit(&nfsi->flags, NFS_INO_REVALIDATING); | ||
895 | } | ||
896 | |||
861 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 897 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
862 | { | 898 | { |
863 | struct inode *inode = dentry->d_inode; | 899 | struct inode *inode = dentry->d_inode; |
864 | struct nfs_inode *nfsi = NFS_I(inode); | 900 | int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME; |
865 | int need_atime = nfsi->flags & NFS_INO_INVALID_ATIME; | ||
866 | int err; | 901 | int err; |
867 | 902 | ||
868 | if (__IS_FLG(inode, MS_NOATIME)) | 903 | if (__IS_FLG(inode, MS_NOATIME)) |
@@ -1008,7 +1043,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1008 | struct nfs_fattr fattr; | 1043 | struct nfs_fattr fattr; |
1009 | struct nfs_inode *nfsi = NFS_I(inode); | 1044 | struct nfs_inode *nfsi = NFS_I(inode); |
1010 | unsigned long verifier; | 1045 | unsigned long verifier; |
1011 | unsigned int flags; | 1046 | unsigned long cache_validity; |
1012 | 1047 | ||
1013 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", | 1048 | dfprintk(PAGECACHE, "NFS: revalidating (%s/%Ld)\n", |
1014 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); | 1049 | inode->i_sb->s_id, (long long)NFS_FILEID(inode)); |
@@ -1019,18 +1054,19 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1019 | if (NFS_STALE(inode)) | 1054 | if (NFS_STALE(inode)) |
1020 | goto out_nowait; | 1055 | goto out_nowait; |
1021 | 1056 | ||
1022 | while (NFS_REVALIDATING(inode)) { | 1057 | status = nfs_wait_on_inode(inode); |
1023 | status = nfs_wait_on_inode(inode, NFS_INO_REVALIDATING); | 1058 | if (status < 0) |
1024 | if (status < 0) | 1059 | goto out; |
1025 | goto out_nowait; | 1060 | if (NFS_STALE(inode)) { |
1026 | if (NFS_ATTRTIMEO(inode) == 0) | 1061 | status = -ESTALE; |
1027 | continue; | 1062 | /* Do we trust the cached ESTALE? */ |
1028 | if (NFS_FLAGS(inode) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ATIME)) | 1063 | if (NFS_ATTRTIMEO(inode) != 0) { |
1029 | continue; | 1064 | if (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ATIME)) { |
1030 | status = NFS_STALE(inode) ? -ESTALE : 0; | 1065 | /* no */ |
1031 | goto out_nowait; | 1066 | } else |
1067 | goto out; | ||
1068 | } | ||
1032 | } | 1069 | } |
1033 | NFS_FLAGS(inode) |= NFS_INO_REVALIDATING; | ||
1034 | 1070 | ||
1035 | /* Protect against RPC races by saving the change attribute */ | 1071 | /* Protect against RPC races by saving the change attribute */ |
1036 | verifier = nfs_save_change_attribute(inode); | 1072 | verifier = nfs_save_change_attribute(inode); |
@@ -1042,7 +1078,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1042 | if (status == -ESTALE) { | 1078 | if (status == -ESTALE) { |
1043 | nfs_zap_caches(inode); | 1079 | nfs_zap_caches(inode); |
1044 | if (!S_ISDIR(inode->i_mode)) | 1080 | if (!S_ISDIR(inode->i_mode)) |
1045 | NFS_FLAGS(inode) |= NFS_INO_STALE; | 1081 | set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); |
1046 | } | 1082 | } |
1047 | goto out; | 1083 | goto out; |
1048 | } | 1084 | } |
@@ -1054,25 +1090,30 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
1054 | (long long)NFS_FILEID(inode), status); | 1090 | (long long)NFS_FILEID(inode), status); |
1055 | goto out; | 1091 | goto out; |
1056 | } | 1092 | } |
1057 | flags = nfsi->flags; | 1093 | spin_lock(&inode->i_lock); |
1058 | nfsi->flags &= ~NFS_INO_REVAL_PAGECACHE; | 1094 | cache_validity = nfsi->cache_validity; |
1095 | nfsi->cache_validity &= ~NFS_INO_REVAL_PAGECACHE; | ||
1096 | |||
1059 | /* | 1097 | /* |
1060 | * We may need to keep the attributes marked as invalid if | 1098 | * We may need to keep the attributes marked as invalid if |
1061 | * we raced with nfs_end_attr_update(). | 1099 | * we raced with nfs_end_attr_update(). |
1062 | */ | 1100 | */ |
1063 | if (verifier == nfsi->cache_change_attribute) | 1101 | if (verifier == nfsi->cache_change_attribute) |
1064 | nfsi->flags &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); | 1102 | nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); |
1065 | /* Do the page cache invalidation */ | 1103 | spin_unlock(&inode->i_lock); |
1104 | |||
1066 | nfs_revalidate_mapping(inode, inode->i_mapping); | 1105 | nfs_revalidate_mapping(inode, inode->i_mapping); |
1067 | if (flags & NFS_INO_INVALID_ACL) | 1106 | |
1107 | if (cache_validity & NFS_INO_INVALID_ACL) | ||
1068 | nfs_zap_acl_cache(inode); | 1108 | nfs_zap_acl_cache(inode); |
1109 | |||
1069 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n", | 1110 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) revalidation complete\n", |
1070 | inode->i_sb->s_id, | 1111 | inode->i_sb->s_id, |
1071 | (long long)NFS_FILEID(inode)); | 1112 | (long long)NFS_FILEID(inode)); |
1072 | 1113 | ||
1073 | out: | 1114 | out: |
1074 | NFS_FLAGS(inode) &= ~NFS_INO_REVALIDATING; | 1115 | nfs_wake_up_inode(inode); |
1075 | wake_up(&nfsi->nfs_i_wait); | 1116 | |
1076 | out_nowait: | 1117 | out_nowait: |
1077 | unlock_kernel(); | 1118 | unlock_kernel(); |
1078 | return status; | 1119 | return status; |
@@ -1096,7 +1137,7 @@ int nfs_attribute_timeout(struct inode *inode) | |||
1096 | */ | 1137 | */ |
1097 | int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | 1138 | int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) |
1098 | { | 1139 | { |
1099 | if (!(NFS_FLAGS(inode) & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA)) | 1140 | if (!(NFS_I(inode)->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA)) |
1100 | && !nfs_attribute_timeout(inode)) | 1141 | && !nfs_attribute_timeout(inode)) |
1101 | return NFS_STALE(inode) ? -ESTALE : 0; | 1142 | return NFS_STALE(inode) ? -ESTALE : 0; |
1102 | return __nfs_revalidate_inode(server, inode); | 1143 | return __nfs_revalidate_inode(server, inode); |
@@ -1111,19 +1152,23 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
1111 | { | 1152 | { |
1112 | struct nfs_inode *nfsi = NFS_I(inode); | 1153 | struct nfs_inode *nfsi = NFS_I(inode); |
1113 | 1154 | ||
1114 | if (nfsi->flags & NFS_INO_INVALID_DATA) { | 1155 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { |
1115 | if (S_ISREG(inode->i_mode)) { | 1156 | if (S_ISREG(inode->i_mode)) { |
1116 | if (filemap_fdatawrite(mapping) == 0) | 1157 | if (filemap_fdatawrite(mapping) == 0) |
1117 | filemap_fdatawait(mapping); | 1158 | filemap_fdatawait(mapping); |
1118 | nfs_wb_all(inode); | 1159 | nfs_wb_all(inode); |
1119 | } | 1160 | } |
1120 | invalidate_inode_pages2(mapping); | 1161 | invalidate_inode_pages2(mapping); |
1121 | nfsi->flags &= ~NFS_INO_INVALID_DATA; | 1162 | |
1163 | spin_lock(&inode->i_lock); | ||
1164 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; | ||
1122 | if (S_ISDIR(inode->i_mode)) { | 1165 | if (S_ISDIR(inode->i_mode)) { |
1123 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); | 1166 | memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); |
1124 | /* This ensures we revalidate child dentries */ | 1167 | /* This ensures we revalidate child dentries */ |
1125 | nfsi->cache_change_attribute++; | 1168 | nfsi->cache_change_attribute++; |
1126 | } | 1169 | } |
1170 | spin_unlock(&inode->i_lock); | ||
1171 | |||
1127 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", | 1172 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", |
1128 | inode->i_sb->s_id, | 1173 | inode->i_sb->s_id, |
1129 | (long long)NFS_FILEID(inode)); | 1174 | (long long)NFS_FILEID(inode)); |
@@ -1153,10 +1198,12 @@ void nfs_end_data_update(struct inode *inode) | |||
1153 | 1198 | ||
1154 | if (!nfs_have_delegation(inode, FMODE_READ)) { | 1199 | if (!nfs_have_delegation(inode, FMODE_READ)) { |
1155 | /* Mark the attribute cache for revalidation */ | 1200 | /* Mark the attribute cache for revalidation */ |
1156 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1201 | spin_lock(&inode->i_lock); |
1202 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; | ||
1157 | /* Directories and symlinks: invalidate page cache too */ | 1203 | /* Directories and symlinks: invalidate page cache too */ |
1158 | if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) | 1204 | if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) |
1159 | nfsi->flags |= NFS_INO_INVALID_DATA; | 1205 | nfsi->cache_validity |= NFS_INO_INVALID_DATA; |
1206 | spin_unlock(&inode->i_lock); | ||
1160 | } | 1207 | } |
1161 | nfsi->cache_change_attribute ++; | 1208 | nfsi->cache_change_attribute ++; |
1162 | atomic_dec(&nfsi->data_updates); | 1209 | atomic_dec(&nfsi->data_updates); |
@@ -1181,6 +1228,8 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1181 | if (nfs_have_delegation(inode, FMODE_READ)) | 1228 | if (nfs_have_delegation(inode, FMODE_READ)) |
1182 | return 0; | 1229 | return 0; |
1183 | 1230 | ||
1231 | spin_lock(&inode->i_lock); | ||
1232 | |||
1184 | /* Are we in the process of updating data on the server? */ | 1233 | /* Are we in the process of updating data on the server? */ |
1185 | data_unstable = nfs_caches_unstable(inode); | 1234 | data_unstable = nfs_caches_unstable(inode); |
1186 | 1235 | ||
@@ -1189,19 +1238,23 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1189 | && nfsi->change_attr == fattr->pre_change_attr) | 1238 | && nfsi->change_attr == fattr->pre_change_attr) |
1190 | nfsi->change_attr = fattr->change_attr; | 1239 | nfsi->change_attr = fattr->change_attr; |
1191 | if (nfsi->change_attr != fattr->change_attr) { | 1240 | if (nfsi->change_attr != fattr->change_attr) { |
1192 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1241 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1193 | if (!data_unstable) | 1242 | if (!data_unstable) |
1194 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1243 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1195 | } | 1244 | } |
1196 | } | 1245 | } |
1197 | 1246 | ||
1198 | if ((fattr->valid & NFS_ATTR_FATTR) == 0) | 1247 | if ((fattr->valid & NFS_ATTR_FATTR) == 0) { |
1248 | spin_unlock(&inode->i_lock); | ||
1199 | return 0; | 1249 | return 0; |
1250 | } | ||
1200 | 1251 | ||
1201 | /* Has the inode gone and changed behind our back? */ | 1252 | /* Has the inode gone and changed behind our back? */ |
1202 | if (nfsi->fileid != fattr->fileid | 1253 | if (nfsi->fileid != fattr->fileid |
1203 | || (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1254 | || (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1255 | spin_unlock(&inode->i_lock); | ||
1204 | return -EIO; | 1256 | return -EIO; |
1257 | } | ||
1205 | 1258 | ||
1206 | cur_size = i_size_read(inode); | 1259 | cur_size = i_size_read(inode); |
1207 | new_isize = nfs_size_to_loff_t(fattr->size); | 1260 | new_isize = nfs_size_to_loff_t(fattr->size); |
@@ -1216,30 +1269,31 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1216 | 1269 | ||
1217 | /* Verify a few of the more important attributes */ | 1270 | /* Verify a few of the more important attributes */ |
1218 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { | 1271 | if (!timespec_equal(&inode->i_mtime, &fattr->mtime)) { |
1219 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1272 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1220 | if (!data_unstable) | 1273 | if (!data_unstable) |
1221 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1274 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1222 | } | 1275 | } |
1223 | if (cur_size != new_isize) { | 1276 | if (cur_size != new_isize) { |
1224 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1277 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1225 | if (nfsi->npages == 0) | 1278 | if (nfsi->npages == 0) |
1226 | nfsi->flags |= NFS_INO_REVAL_PAGECACHE; | 1279 | nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE; |
1227 | } | 1280 | } |
1228 | 1281 | ||
1229 | /* Have any file permissions changed? */ | 1282 | /* Have any file permissions changed? */ |
1230 | if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) | 1283 | if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) |
1231 | || inode->i_uid != fattr->uid | 1284 | || inode->i_uid != fattr->uid |
1232 | || inode->i_gid != fattr->gid) | 1285 | || inode->i_gid != fattr->gid) |
1233 | nfsi->flags |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL; | 1286 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL; |
1234 | 1287 | ||
1235 | /* Has the link count changed? */ | 1288 | /* Has the link count changed? */ |
1236 | if (inode->i_nlink != fattr->nlink) | 1289 | if (inode->i_nlink != fattr->nlink) |
1237 | nfsi->flags |= NFS_INO_INVALID_ATTR; | 1290 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR; |
1238 | 1291 | ||
1239 | if (!timespec_equal(&inode->i_atime, &fattr->atime)) | 1292 | if (!timespec_equal(&inode->i_atime, &fattr->atime)) |
1240 | nfsi->flags |= NFS_INO_INVALID_ATIME; | 1293 | nfsi->cache_validity |= NFS_INO_INVALID_ATIME; |
1241 | 1294 | ||
1242 | nfsi->read_cache_jiffies = fattr->timestamp; | 1295 | nfsi->read_cache_jiffies = fattr->timestamp; |
1296 | spin_unlock(&inode->i_lock); | ||
1243 | return 0; | 1297 | return 0; |
1244 | } | 1298 | } |
1245 | 1299 | ||
@@ -1278,11 +1332,15 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1278 | goto out_err; | 1332 | goto out_err; |
1279 | } | 1333 | } |
1280 | 1334 | ||
1335 | spin_lock(&inode->i_lock); | ||
1336 | |||
1281 | /* | 1337 | /* |
1282 | * Make sure the inode's type hasn't changed. | 1338 | * Make sure the inode's type hasn't changed. |
1283 | */ | 1339 | */ |
1284 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1340 | if ((inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1341 | spin_unlock(&inode->i_lock); | ||
1285 | goto out_changed; | 1342 | goto out_changed; |
1343 | } | ||
1286 | 1344 | ||
1287 | /* | 1345 | /* |
1288 | * Update the read time so we don't revalidate too often. | 1346 | * Update the read time so we don't revalidate too often. |
@@ -1373,8 +1431,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1373 | || S_ISLNK(inode->i_mode))) | 1431 | || S_ISLNK(inode->i_mode))) |
1374 | invalid &= ~NFS_INO_INVALID_DATA; | 1432 | invalid &= ~NFS_INO_INVALID_DATA; |
1375 | if (!nfs_have_delegation(inode, FMODE_READ)) | 1433 | if (!nfs_have_delegation(inode, FMODE_READ)) |
1376 | nfsi->flags |= invalid; | 1434 | nfsi->cache_validity |= invalid; |
1377 | 1435 | ||
1436 | spin_unlock(&inode->i_lock); | ||
1378 | return 0; | 1437 | return 0; |
1379 | out_changed: | 1438 | out_changed: |
1380 | /* | 1439 | /* |
@@ -1391,7 +1450,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign | |||
1391 | */ | 1450 | */ |
1392 | nfs_invalidate_inode(inode); | 1451 | nfs_invalidate_inode(inode); |
1393 | out_err: | 1452 | out_err: |
1394 | NFS_FLAGS(inode) |= NFS_INO_STALE; | 1453 | set_bit(NFS_INO_STALE, &NFS_FLAGS(inode)); |
1395 | return -ESTALE; | 1454 | return -ESTALE; |
1396 | } | 1455 | } |
1397 | 1456 | ||
@@ -1950,7 +2009,8 @@ static struct inode *nfs_alloc_inode(struct super_block *sb) | |||
1950 | nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, SLAB_KERNEL); | 2009 | nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, SLAB_KERNEL); |
1951 | if (!nfsi) | 2010 | if (!nfsi) |
1952 | return NULL; | 2011 | return NULL; |
1953 | nfsi->flags = 0; | 2012 | nfsi->flags = 0UL; |
2013 | nfsi->cache_validity = 0UL; | ||
1954 | #ifdef CONFIG_NFS_V3_ACL | 2014 | #ifdef CONFIG_NFS_V3_ACL |
1955 | nfsi->acl_access = ERR_PTR(-EAGAIN); | 2015 | nfsi->acl_access = ERR_PTR(-EAGAIN); |
1956 | nfsi->acl_default = ERR_PTR(-EAGAIN); | 2016 | nfsi->acl_default = ERR_PTR(-EAGAIN); |
@@ -1982,7 +2042,6 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) | |||
1982 | nfsi->ndirty = 0; | 2042 | nfsi->ndirty = 0; |
1983 | nfsi->ncommit = 0; | 2043 | nfsi->ncommit = 0; |
1984 | nfsi->npages = 0; | 2044 | nfsi->npages = 0; |
1985 | init_waitqueue_head(&nfsi->nfs_i_wait); | ||
1986 | nfs4_init_once(nfsi); | 2045 | nfs4_init_once(nfsi); |
1987 | } | 2046 | } |
1988 | } | 2047 | } |
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 1b7a3ef2f813..6a5bbc0ae941 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -308,7 +308,9 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | |||
308 | nfs_begin_data_update(inode); | 308 | nfs_begin_data_update(inode); |
309 | status = rpc_call(server->client_acl, ACLPROC3_SETACL, | 309 | status = rpc_call(server->client_acl, ACLPROC3_SETACL, |
310 | &args, &fattr, 0); | 310 | &args, &fattr, 0); |
311 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ACCESS; | 311 | spin_lock(&inode->i_lock); |
312 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS; | ||
313 | spin_unlock(&inode->i_lock); | ||
312 | nfs_end_data_update(inode); | 314 | nfs_end_data_update(inode); |
313 | dprintk("NFS reply setacl: %d\n", status); | 315 | dprintk("NFS reply setacl: %d\n", status); |
314 | 316 | ||
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 7851569b31c6..2681485cf2d0 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -120,6 +120,8 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
120 | dprintk("NFS call setattr\n"); | 120 | dprintk("NFS call setattr\n"); |
121 | fattr->valid = 0; | 121 | fattr->valid = 0; |
122 | status = rpc_call(NFS_CLIENT(inode), NFS3PROC_SETATTR, &arg, fattr, 0); | 122 | status = rpc_call(NFS_CLIENT(inode), NFS3PROC_SETATTR, &arg, fattr, 0); |
123 | if (status == 0) | ||
124 | nfs_setattr_update_inode(inode, sattr); | ||
123 | dprintk("NFS reply setattr: %d\n", status); | 125 | dprintk("NFS reply setattr: %d\n", status); |
124 | return status; | 126 | return status; |
125 | } | 127 | } |
@@ -370,6 +372,8 @@ again: | |||
370 | * not sure this buys us anything (and I'd have | 372 | * not sure this buys us anything (and I'd have |
371 | * to revamp the NFSv3 XDR code) */ | 373 | * to revamp the NFSv3 XDR code) */ |
372 | status = nfs3_proc_setattr(dentry, &fattr, sattr); | 374 | status = nfs3_proc_setattr(dentry, &fattr, sattr); |
375 | if (status == 0) | ||
376 | nfs_setattr_update_inode(dentry->d_inode, sattr); | ||
373 | nfs_refresh_inode(dentry->d_inode, &fattr); | 377 | nfs_refresh_inode(dentry->d_inode, &fattr); |
374 | dprintk("NFS reply setattr (post-create): %d\n", status); | 378 | dprintk("NFS reply setattr (post-create): %d\n", status); |
375 | } | 379 | } |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1b76f80aedb9..0c5a308e4963 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -753,6 +753,7 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | |||
753 | .rpc_argp = &arg, | 753 | .rpc_argp = &arg, |
754 | .rpc_resp = &res, | 754 | .rpc_resp = &res, |
755 | }; | 755 | }; |
756 | int status; | ||
756 | 757 | ||
757 | fattr->valid = 0; | 758 | fattr->valid = 0; |
758 | 759 | ||
@@ -762,7 +763,8 @@ static int _nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | |||
762 | } else | 763 | } else |
763 | memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); | 764 | memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid)); |
764 | 765 | ||
765 | return rpc_call_sync(server->client, &msg, 0); | 766 | status = rpc_call_sync(server->client, &msg, 0); |
767 | return status; | ||
766 | } | 768 | } |
767 | 769 | ||
768 | static int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, | 770 | static int nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr, |
@@ -1145,6 +1147,8 @@ nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
1145 | 1147 | ||
1146 | status = nfs4_do_setattr(NFS_SERVER(inode), fattr, | 1148 | status = nfs4_do_setattr(NFS_SERVER(inode), fattr, |
1147 | NFS_FH(inode), sattr, state); | 1149 | NFS_FH(inode), sattr, state); |
1150 | if (status == 0) | ||
1151 | nfs_setattr_update_inode(inode, sattr); | ||
1148 | if (state != NULL) | 1152 | if (state != NULL) |
1149 | nfs4_close_state(state, FMODE_WRITE); | 1153 | nfs4_close_state(state, FMODE_WRITE); |
1150 | put_rpccred(cred); | 1154 | put_rpccred(cred); |
@@ -1449,8 +1453,10 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
1449 | struct nfs_fattr fattr; | 1453 | struct nfs_fattr fattr; |
1450 | status = nfs4_do_setattr(NFS_SERVER(dir), &fattr, | 1454 | status = nfs4_do_setattr(NFS_SERVER(dir), &fattr, |
1451 | NFS_FH(state->inode), sattr, state); | 1455 | NFS_FH(state->inode), sattr, state); |
1452 | if (status == 0) | 1456 | if (status == 0) { |
1457 | nfs_setattr_update_inode(state->inode, sattr); | ||
1453 | goto out; | 1458 | goto out; |
1459 | } | ||
1454 | } else if (flags != 0) | 1460 | } else if (flags != 0) |
1455 | goto out; | 1461 | goto out; |
1456 | nfs4_close_state(state, flags); | 1462 | nfs4_close_state(state, flags); |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index cedf636bcf3c..be23c3fb9260 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -114,6 +114,8 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, | |||
114 | dprintk("NFS call setattr\n"); | 114 | dprintk("NFS call setattr\n"); |
115 | fattr->valid = 0; | 115 | fattr->valid = 0; |
116 | status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0); | 116 | status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0); |
117 | if (status == 0) | ||
118 | nfs_setattr_update_inode(inode, sattr); | ||
117 | dprintk("NFS reply setattr: %d\n", status); | 119 | dprintk("NFS reply setattr: %d\n", status); |
118 | return status; | 120 | return status; |
119 | } | 121 | } |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 6f866b8aa2d5..6ceb1d471f20 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -140,7 +140,9 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, | |||
140 | if (rdata->res.eof != 0 || result == 0) | 140 | if (rdata->res.eof != 0 || result == 0) |
141 | break; | 141 | break; |
142 | } while (count); | 142 | } while (count); |
143 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATIME; | 143 | spin_lock(&inode->i_lock); |
144 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
145 | spin_unlock(&inode->i_lock); | ||
144 | 146 | ||
145 | if (count) | 147 | if (count) |
146 | memclear_highpage_flush(page, rdata->args.pgbase, count); | 148 | memclear_highpage_flush(page, rdata->args.pgbase, count); |
@@ -473,7 +475,9 @@ void nfs_readpage_result(struct rpc_task *task) | |||
473 | } | 475 | } |
474 | task->tk_status = -EIO; | 476 | task->tk_status = -EIO; |
475 | } | 477 | } |
476 | NFS_FLAGS(data->inode) |= NFS_INO_INVALID_ATIME; | 478 | spin_lock(&data->inode->i_lock); |
479 | NFS_I(data->inode)->cache_validity |= NFS_INO_INVALID_ATIME; | ||
480 | spin_unlock(&data->inode->i_lock); | ||
477 | data->complete(data, status); | 481 | data->complete(data, status); |
478 | } | 482 | } |
479 | 483 | ||
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c index 35f106599144..18dc95b0b646 100644 --- a/fs/nfs/symlink.c +++ b/fs/nfs/symlink.c | |||
@@ -27,26 +27,14 @@ | |||
27 | 27 | ||
28 | /* Symlink caching in the page cache is even more simplistic | 28 | /* Symlink caching in the page cache is even more simplistic |
29 | * and straight-forward than readdir caching. | 29 | * and straight-forward than readdir caching. |
30 | * | ||
31 | * At the beginning of the page we store pointer to struct page in question, | ||
32 | * simplifying nfs_put_link() (if inode got invalidated we can't find the page | ||
33 | * to be freed via pagecache lookup). | ||
34 | * The NUL-terminated string follows immediately thereafter. | ||
35 | */ | 30 | */ |
36 | 31 | ||
37 | struct nfs_symlink { | ||
38 | struct page *page; | ||
39 | char body[0]; | ||
40 | }; | ||
41 | |||
42 | static int nfs_symlink_filler(struct inode *inode, struct page *page) | 32 | static int nfs_symlink_filler(struct inode *inode, struct page *page) |
43 | { | 33 | { |
44 | const unsigned int pgbase = offsetof(struct nfs_symlink, body); | ||
45 | const unsigned int pglen = PAGE_SIZE - pgbase; | ||
46 | int error; | 34 | int error; |
47 | 35 | ||
48 | lock_kernel(); | 36 | lock_kernel(); |
49 | error = NFS_PROTO(inode)->readlink(inode, page, pgbase, pglen); | 37 | error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE); |
50 | unlock_kernel(); | 38 | unlock_kernel(); |
51 | if (error < 0) | 39 | if (error < 0) |
52 | goto error; | 40 | goto error; |
@@ -60,11 +48,10 @@ error: | |||
60 | return -EIO; | 48 | return -EIO; |
61 | } | 49 | } |
62 | 50 | ||
63 | static int nfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 51 | static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
64 | { | 52 | { |
65 | struct inode *inode = dentry->d_inode; | 53 | struct inode *inode = dentry->d_inode; |
66 | struct page *page; | 54 | struct page *page; |
67 | struct nfs_symlink *p; | ||
68 | void *err = ERR_PTR(nfs_revalidate_inode(NFS_SERVER(inode), inode)); | 55 | void *err = ERR_PTR(nfs_revalidate_inode(NFS_SERVER(inode), inode)); |
69 | if (err) | 56 | if (err) |
70 | goto read_failed; | 57 | goto read_failed; |
@@ -78,28 +65,20 @@ static int nfs_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
78 | err = ERR_PTR(-EIO); | 65 | err = ERR_PTR(-EIO); |
79 | goto getlink_read_error; | 66 | goto getlink_read_error; |
80 | } | 67 | } |
81 | p = kmap(page); | 68 | nd_set_link(nd, kmap(page)); |
82 | p->page = page; | 69 | return page; |
83 | nd_set_link(nd, p->body); | ||
84 | return 0; | ||
85 | 70 | ||
86 | getlink_read_error: | 71 | getlink_read_error: |
87 | page_cache_release(page); | 72 | page_cache_release(page); |
88 | read_failed: | 73 | read_failed: |
89 | nd_set_link(nd, err); | 74 | nd_set_link(nd, err); |
90 | return 0; | 75 | return NULL; |
91 | } | 76 | } |
92 | 77 | ||
93 | static void nfs_put_link(struct dentry *dentry, struct nameidata *nd) | 78 | static void nfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
94 | { | 79 | { |
95 | char *s = nd_get_link(nd); | 80 | if (cookie) { |
96 | if (!IS_ERR(s)) { | 81 | struct page *page = cookie; |
97 | struct nfs_symlink *p; | ||
98 | struct page *page; | ||
99 | |||
100 | p = container_of(s, struct nfs_symlink, body[0]); | ||
101 | page = p->page; | ||
102 | |||
103 | kunmap(page); | 82 | kunmap(page); |
104 | page_cache_release(page); | 83 | page_cache_release(page); |
105 | } | 84 | } |
diff --git a/fs/nfs_common/nfsacl.c b/fs/nfs_common/nfsacl.c index 18c58c32e326..251e5a1bb1c4 100644 --- a/fs/nfs_common/nfsacl.c +++ b/fs/nfs_common/nfsacl.c | |||
@@ -239,6 +239,7 @@ nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt, | |||
239 | if (xdr_decode_word(buf, base, &entries) || | 239 | if (xdr_decode_word(buf, base, &entries) || |
240 | entries > NFS_ACL_MAX_ENTRIES) | 240 | entries > NFS_ACL_MAX_ENTRIES) |
241 | return -EINVAL; | 241 | return -EINVAL; |
242 | nfsacl_desc.desc.array_maxlen = entries; | ||
242 | err = xdr_decode_array2(buf, base + 4, &nfsacl_desc.desc); | 243 | err = xdr_decode_array2(buf, base + 4, &nfsacl_desc.desc); |
243 | if (err) | 244 | if (err) |
244 | return err; | 245 | return err; |
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 07b9a065e9da..1697539a7171 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
@@ -287,6 +287,7 @@ out: | |||
287 | svc_exit_thread(rqstp); | 287 | svc_exit_thread(rqstp); |
288 | 288 | ||
289 | /* Release module */ | 289 | /* Release module */ |
290 | unlock_kernel(); | ||
290 | module_put_and_exit(0); | 291 | module_put_and_exit(0); |
291 | } | 292 | } |
292 | 293 | ||
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 9709fac6531d..9eecc9939dfe 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -174,6 +174,9 @@ ToDo/Notes: | |||
174 | fact that the vfs and ntfs inodes are one struct in memory to find | 174 | fact that the vfs and ntfs inodes are one struct in memory to find |
175 | the ntfs inode in memory if present. Also, the ntfs inode has its | 175 | the ntfs inode in memory if present. Also, the ntfs inode has its |
176 | own locking so it does not matter if the vfs inode is locked. | 176 | own locking so it does not matter if the vfs inode is locked. |
177 | - Fix bug in mft record writing where we forgot to set the device in | ||
178 | the buffers when mapping them after the VM had discarded them. | ||
179 | Thanks to Martin MOKREJÅ for the bug report. | ||
177 | 180 | ||
178 | 2.1.22 - Many bug and race fixes and error handling improvements. | 181 | 2.1.22 - Many bug and race fixes and error handling improvements. |
179 | 182 | ||
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 3f43bfe6184e..78adad7a988d 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -924,6 +924,7 @@ static int ntfs_write_mst_block(struct page *page, | |||
924 | LCN lcn; | 924 | LCN lcn; |
925 | unsigned int vcn_ofs; | 925 | unsigned int vcn_ofs; |
926 | 926 | ||
927 | bh->b_bdev = vol->sb->s_bdev; | ||
927 | /* Obtain the vcn and offset of the current block. */ | 928 | /* Obtain the vcn and offset of the current block. */ |
928 | vcn = (VCN)block << bh_size_bits; | 929 | vcn = (VCN)block << bh_size_bits; |
929 | vcn_ofs = vcn & vol->cluster_size_mask; | 930 | vcn_ofs = vcn & vol->cluster_size_mask; |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index ac9ff39aa834..317f7c679fd3 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -533,6 +533,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, | |||
533 | LCN lcn; | 533 | LCN lcn; |
534 | unsigned int vcn_ofs; | 534 | unsigned int vcn_ofs; |
535 | 535 | ||
536 | bh->b_bdev = vol->sb->s_bdev; | ||
536 | /* Obtain the vcn and offset of the current block. */ | 537 | /* Obtain the vcn and offset of the current block. */ |
537 | vcn = ((VCN)mft_no << vol->mft_record_size_bits) + | 538 | vcn = ((VCN)mft_no << vol->mft_record_size_bits) + |
538 | (block_start - m_start); | 539 | (block_start - m_start); |
@@ -725,6 +726,7 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync) | |||
725 | LCN lcn; | 726 | LCN lcn; |
726 | unsigned int vcn_ofs; | 727 | unsigned int vcn_ofs; |
727 | 728 | ||
729 | bh->b_bdev = vol->sb->s_bdev; | ||
728 | /* Obtain the vcn and offset of the current block. */ | 730 | /* Obtain the vcn and offset of the current block. */ |
729 | vcn = ((VCN)ni->mft_no << vol->mft_record_size_bits) + | 731 | vcn = ((VCN)ni->mft_no << vol->mft_record_size_bits) + |
730 | (block_start - m_start); | 732 | (block_start - m_start); |
diff --git a/fs/proc/base.c b/fs/proc/base.c index ace151fa4878..491f2d9f89ac 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -890,7 +890,7 @@ static struct file_operations proc_seccomp_operations = { | |||
890 | }; | 890 | }; |
891 | #endif /* CONFIG_SECCOMP */ | 891 | #endif /* CONFIG_SECCOMP */ |
892 | 892 | ||
893 | static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) | 893 | static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) |
894 | { | 894 | { |
895 | struct inode *inode = dentry->d_inode; | 895 | struct inode *inode = dentry->d_inode; |
896 | int error = -EACCES; | 896 | int error = -EACCES; |
@@ -907,7 +907,7 @@ static int proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
907 | error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); | 907 | error = PROC_I(inode)->op.proc_get_link(inode, &nd->dentry, &nd->mnt); |
908 | nd->last_type = LAST_BIND; | 908 | nd->last_type = LAST_BIND; |
909 | out: | 909 | out: |
910 | return error; | 910 | return ERR_PTR(error); |
911 | } | 911 | } |
912 | 912 | ||
913 | static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, | 913 | static int do_proc_readlink(struct dentry *dentry, struct vfsmount *mnt, |
@@ -1692,11 +1692,11 @@ static int proc_self_readlink(struct dentry *dentry, char __user *buffer, | |||
1692 | return vfs_readlink(dentry,buffer,buflen,tmp); | 1692 | return vfs_readlink(dentry,buffer,buflen,tmp); |
1693 | } | 1693 | } |
1694 | 1694 | ||
1695 | static int proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | 1695 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) |
1696 | { | 1696 | { |
1697 | char tmp[30]; | 1697 | char tmp[30]; |
1698 | sprintf(tmp, "%d", current->tgid); | 1698 | sprintf(tmp, "%d", current->tgid); |
1699 | return vfs_follow_link(nd,tmp); | 1699 | return ERR_PTR(vfs_follow_link(nd,tmp)); |
1700 | } | 1700 | } |
1701 | 1701 | ||
1702 | static struct inode_operations proc_self_inode_operations = { | 1702 | static struct inode_operations proc_self_inode_operations = { |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 6c6315d04028..abe8920313fb 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -329,10 +329,10 @@ static void release_inode_number(unsigned int inum) | |||
329 | spin_unlock(&proc_inum_lock); | 329 | spin_unlock(&proc_inum_lock); |
330 | } | 330 | } |
331 | 331 | ||
332 | static int proc_follow_link(struct dentry *dentry, struct nameidata *nd) | 332 | static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) |
333 | { | 333 | { |
334 | nd_set_link(nd, PDE(dentry->d_inode)->data); | 334 | nd_set_link(nd, PDE(dentry->d_inode)->data); |
335 | return 0; | 335 | return NULL; |
336 | } | 336 | } |
337 | 337 | ||
338 | static struct inode_operations proc_link_inode_operations = { | 338 | static struct inode_operations proc_link_inode_operations = { |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index d9f614a57731..ff291c973a56 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1985,7 +1985,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1985 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking | 1985 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking |
1986 | * code really needs to be reworked, but this will take care of it | 1986 | * code really needs to be reworked, but this will take care of it |
1987 | * for now. -jeffm */ | 1987 | * for now. -jeffm */ |
1988 | if (REISERFS_I(dir)->i_acl_default) { | 1988 | if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { |
1989 | reiserfs_write_unlock_xattrs(dir->i_sb); | 1989 | reiserfs_write_unlock_xattrs(dir->i_sb); |
1990 | iput(inode); | 1990 | iput(inode); |
1991 | reiserfs_write_lock_xattrs(dir->i_sb); | 1991 | reiserfs_write_lock_xattrs(dir->i_sb); |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index a20bbc1642dc..3549067c42d9 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -593,6 +593,9 @@ static int new_inode_init(struct inode *inode, struct inode *dir, int mode) | |||
593 | */ | 593 | */ |
594 | inode->i_uid = current->fsuid; | 594 | inode->i_uid = current->fsuid; |
595 | inode->i_mode = mode; | 595 | inode->i_mode = mode; |
596 | /* Make inode invalid - just in case we are going to drop it before | ||
597 | * the initialization happens */ | ||
598 | INODE_PKEY(inode)->k_objectid = 0; | ||
596 | 599 | ||
597 | if (dir->i_mode & S_ISGID) { | 600 | if (dir->i_mode & S_ISGID) { |
598 | inode->i_gid = dir->i_gid; | 601 | inode->i_gid = dir->i_gid; |
diff --git a/fs/smbfs/symlink.c b/fs/smbfs/symlink.c index 8b069e06433d..0c64bc3a0127 100644 --- a/fs/smbfs/symlink.c +++ b/fs/smbfs/symlink.c | |||
@@ -34,7 +34,7 @@ int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname) | |||
34 | return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname); | 34 | return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname); |
35 | } | 35 | } |
36 | 36 | ||
37 | static int smb_follow_link(struct dentry *dentry, struct nameidata *nd) | 37 | static void *smb_follow_link(struct dentry *dentry, struct nameidata *nd) |
38 | { | 38 | { |
39 | char *link = __getname(); | 39 | char *link = __getname(); |
40 | DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry)); | 40 | DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry)); |
@@ -52,10 +52,10 @@ static int smb_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
52 | } | 52 | } |
53 | } | 53 | } |
54 | nd_set_link(nd, link); | 54 | nd_set_link(nd, link); |
55 | return 0; | 55 | return NULL; |
56 | } | 56 | } |
57 | 57 | ||
58 | static void smb_put_link(struct dentry *dentry, struct nameidata *nd) | 58 | static void smb_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
59 | { | 59 | { |
60 | char *s = nd_get_link(nd); | 60 | char *s = nd_get_link(nd); |
61 | if (!IS_ERR(s)) | 61 | if (!IS_ERR(s)) |
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index d727dc960634..970a33f03299 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -228,6 +228,10 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name) | |||
228 | struct sysfs_dirent * sd; | 228 | struct sysfs_dirent * sd; |
229 | struct sysfs_dirent * parent_sd = dir->d_fsdata; | 229 | struct sysfs_dirent * parent_sd = dir->d_fsdata; |
230 | 230 | ||
231 | if (dir->d_inode == NULL) | ||
232 | /* no inode means this hasn't been made visible yet */ | ||
233 | return; | ||
234 | |||
231 | down(&dir->d_inode->i_sem); | 235 | down(&dir->d_inode->i_sem); |
232 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { | 236 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { |
233 | if (!sd->s_element) | 237 | if (!sd->s_element) |
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index fae57c83a722..de402fa915f2 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -151,17 +151,17 @@ static int sysfs_getlink(struct dentry *dentry, char * path) | |||
151 | 151 | ||
152 | } | 152 | } |
153 | 153 | ||
154 | static int sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 154 | static void *sysfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
155 | { | 155 | { |
156 | int error = -ENOMEM; | 156 | int error = -ENOMEM; |
157 | unsigned long page = get_zeroed_page(GFP_KERNEL); | 157 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
158 | if (page) | 158 | if (page) |
159 | error = sysfs_getlink(dentry, (char *) page); | 159 | error = sysfs_getlink(dentry, (char *) page); |
160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); | 160 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); |
161 | return 0; | 161 | return NULL; |
162 | } | 162 | } |
163 | 163 | ||
164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd) | 164 | static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
165 | { | 165 | { |
166 | char *page = nd_get_link(nd); | 166 | char *page = nd_get_link(nd); |
167 | if (!IS_ERR(page)) | 167 | if (!IS_ERR(page)) |
diff --git a/fs/sysv/symlink.c b/fs/sysv/symlink.c index ed637db2dcb1..b85ce61d635c 100644 --- a/fs/sysv/symlink.c +++ b/fs/sysv/symlink.c | |||
@@ -8,10 +8,10 @@ | |||
8 | #include "sysv.h" | 8 | #include "sysv.h" |
9 | #include <linux/namei.h> | 9 | #include <linux/namei.h> |
10 | 10 | ||
11 | static int sysv_follow_link(struct dentry *dentry, struct nameidata *nd) | 11 | static void *sysv_follow_link(struct dentry *dentry, struct nameidata *nd) |
12 | { | 12 | { |
13 | nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data); | 13 | nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data); |
14 | return 0; | 14 | return NULL; |
15 | } | 15 | } |
16 | 16 | ||
17 | struct inode_operations sysv_fast_symlink_inode_operations = { | 17 | struct inode_operations sysv_fast_symlink_inode_operations = { |
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c index a0e49149098f..337512ed5781 100644 --- a/fs/ufs/symlink.c +++ b/fs/ufs/symlink.c | |||
@@ -29,11 +29,11 @@ | |||
29 | #include <linux/namei.h> | 29 | #include <linux/namei.h> |
30 | #include <linux/ufs_fs.h> | 30 | #include <linux/ufs_fs.h> |
31 | 31 | ||
32 | static int ufs_follow_link(struct dentry *dentry, struct nameidata *nd) | 32 | static void *ufs_follow_link(struct dentry *dentry, struct nameidata *nd) |
33 | { | 33 | { |
34 | struct ufs_inode_info *p = UFS_I(dentry->d_inode); | 34 | struct ufs_inode_info *p = UFS_I(dentry->d_inode); |
35 | nd_set_link(nd, (char*)p->i_u1.i_symlink); | 35 | nd_set_link(nd, (char*)p->i_u1.i_symlink); |
36 | return 0; | 36 | return NULL; |
37 | } | 37 | } |
38 | 38 | ||
39 | struct inode_operations ufs_fast_symlink_inode_operations = { | 39 | struct inode_operations ufs_fast_symlink_inode_operations = { |
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 407e99359391..f252605514eb 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -374,7 +374,7 @@ linvfs_rename( | |||
374 | * we need to be very careful about how much stack we use. | 374 | * we need to be very careful about how much stack we use. |
375 | * uio is kmalloced for this reason... | 375 | * uio is kmalloced for this reason... |
376 | */ | 376 | */ |
377 | STATIC int | 377 | STATIC void * |
378 | linvfs_follow_link( | 378 | linvfs_follow_link( |
379 | struct dentry *dentry, | 379 | struct dentry *dentry, |
380 | struct nameidata *nd) | 380 | struct nameidata *nd) |
@@ -391,14 +391,14 @@ linvfs_follow_link( | |||
391 | link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL); | 391 | link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL); |
392 | if (!link) { | 392 | if (!link) { |
393 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | 393 | nd_set_link(nd, ERR_PTR(-ENOMEM)); |
394 | return 0; | 394 | return NULL; |
395 | } | 395 | } |
396 | 396 | ||
397 | uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); | 397 | uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL); |
398 | if (!uio) { | 398 | if (!uio) { |
399 | kfree(link); | 399 | kfree(link); |
400 | nd_set_link(nd, ERR_PTR(-ENOMEM)); | 400 | nd_set_link(nd, ERR_PTR(-ENOMEM)); |
401 | return 0; | 401 | return NULL; |
402 | } | 402 | } |
403 | 403 | ||
404 | vp = LINVFS_GET_VP(dentry->d_inode); | 404 | vp = LINVFS_GET_VP(dentry->d_inode); |
@@ -422,10 +422,10 @@ linvfs_follow_link( | |||
422 | kfree(uio); | 422 | kfree(uio); |
423 | 423 | ||
424 | nd_set_link(nd, link); | 424 | nd_set_link(nd, link); |
425 | return 0; | 425 | return NULL; |
426 | } | 426 | } |
427 | 427 | ||
428 | static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd) | 428 | static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p) |
429 | { | 429 | { |
430 | char *s = nd_get_link(nd); | 430 | char *s = nd_get_link(nd); |
431 | if (!IS_ERR(s)) | 431 | if (!IS_ERR(s)) |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index caeaa71a5663..579fe191b7e7 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -56,8 +56,9 @@ | |||
56 | /* ACPI PCI Interrupt Link (pci_link.c) */ | 56 | /* ACPI PCI Interrupt Link (pci_link.c) */ |
57 | 57 | ||
58 | int acpi_irq_penalty_init (void); | 58 | int acpi_irq_penalty_init (void); |
59 | int acpi_pci_link_get_irq (acpi_handle handle, int index, int *edge_level, | 59 | int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level, |
60 | int *active_high_low, char **name); | 60 | int *active_high_low, char **name); |
61 | int acpi_pci_link_free_irq(acpi_handle handle); | ||
61 | 62 | ||
62 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | 63 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ |
63 | 64 | ||
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 28957697e59c..f681e675b823 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h | |||
@@ -251,6 +251,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
251 | extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, | 251 | extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, |
252 | struct resource *); | 252 | struct resource *); |
253 | 253 | ||
254 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
255 | struct pci_bus_region *region); | ||
256 | |||
254 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | 257 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index |
255 | 258 | ||
256 | static inline int pci_proc_domain(struct pci_bus *bus) | 259 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index c08ce970ff8c..bdb4d66418f1 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val) | |||
443 | if something tries to do an invalid xchg(). */ | 443 | if something tries to do an invalid xchg(). */ |
444 | extern void __xchg_called_with_bad_pointer(void); | 444 | extern void __xchg_called_with_bad_pointer(void); |
445 | 445 | ||
446 | static inline unsigned long | 446 | #define __xchg(ptr, x, size) \ |
447 | __xchg(volatile void *ptr, unsigned long x, int size) | 447 | ({ \ |
448 | { | 448 | unsigned long __xchg__res; \ |
449 | switch (size) { | 449 | volatile void *__xchg__ptr = (ptr); \ |
450 | case 1: | 450 | switch (size) { \ |
451 | return __xchg_u8(ptr, x); | 451 | case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \ |
452 | case 2: | 452 | case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \ |
453 | return __xchg_u16(ptr, x); | 453 | case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \ |
454 | case 4: | 454 | case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \ |
455 | return __xchg_u32(ptr, x); | 455 | default: __xchg_called_with_bad_pointer(); __xchg__res = x; \ |
456 | case 8: | 456 | } \ |
457 | return __xchg_u64(ptr, x); | 457 | __xchg__res; \ |
458 | } | 458 | }) |
459 | __xchg_called_with_bad_pointer(); | ||
460 | return x; | ||
461 | } | ||
462 | 459 | ||
463 | #define xchg(ptr,x) \ | 460 | #define xchg(ptr,x) \ |
464 | ({ \ | 461 | ({ \ |
diff --git a/include/asm-arm/arch-ixp4xx/timex.h b/include/asm-arm/arch-ixp4xx/timex.h index 38c9d77d3727..3745e35cc030 100644 --- a/include/asm-arm/arch-ixp4xx/timex.h +++ b/include/asm-arm/arch-ixp4xx/timex.h | |||
@@ -7,7 +7,9 @@ | |||
7 | 7 | ||
8 | /* | 8 | /* |
9 | * We use IXP425 General purpose timer for our timer needs, it runs at | 9 | * We use IXP425 General purpose timer for our timer needs, it runs at |
10 | * 66.66... MHz | 10 | * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the |
11 | * timer register ignores the bottom 2 bits of the LATCH value. | ||
11 | */ | 12 | */ |
12 | #define CLOCK_TICK_RATE (66666666) | 13 | #define FREQ 66666666 |
14 | #define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) | ||
13 | 15 | ||
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h index 1cc85a096b23..bd43b566db3e 100644 --- a/include/asm-arm/arch-s3c2410/usb-control.h +++ b/include/asm-arm/arch-s3c2410/usb-control.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * Changelog: | 12 | * Changelog: |
13 | * 11-Sep-2004 BJD Created file | 13 | * 11-Sep-2004 BJD Created file |
14 | * 21-Sep-2004 BJD Updated port info | 14 | * 21-Sep-2004 BJD Updated port info |
15 | * 09-Aug-2005 BJD Renamed s3c2410_report_oc s3c2410_usb_report_oc | ||
15 | */ | 16 | */ |
16 | 17 | ||
17 | #ifndef __ASM_ARCH_USBCONTROL_H | 18 | #ifndef __ASM_ARCH_USBCONTROL_H |
@@ -35,7 +36,7 @@ struct s3c2410_hcd_info { | |||
35 | void (*report_oc)(struct s3c2410_hcd_info *, int ports); | 36 | void (*report_oc)(struct s3c2410_hcd_info *, int ports); |
36 | }; | 37 | }; |
37 | 38 | ||
38 | static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports) | 39 | static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports) |
39 | { | 40 | { |
40 | if (info->report_oc != NULL) { | 41 | if (info->report_oc != NULL) { |
41 | (info->report_oc)(info, ports); | 42 | (info->report_oc)(info, ports); |
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h index 24d11672eb60..7fb02138f585 100644 --- a/include/asm-arm/bug.h +++ b/include/asm-arm/bug.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 7 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
8 | extern volatile void __bug(const char *file, int line, void *data); | 8 | extern void __bug(const char *file, int line, void *data) __attribute__((noreturn)); |
9 | 9 | ||
10 | /* give file/line information */ | 10 | /* give file/line information */ |
11 | #define BUG() __bug(__FILE__, __LINE__, NULL) | 11 | #define BUG() __bug(__FILE__, __LINE__, NULL) |
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h index ff48022e4720..4679f63688e9 100644 --- a/include/asm-arm/cpu-multi32.h +++ b/include/asm-arm/cpu-multi32.h | |||
@@ -31,7 +31,7 @@ extern struct processor { | |||
31 | /* | 31 | /* |
32 | * Special stuff for a reset | 32 | * Special stuff for a reset |
33 | */ | 33 | */ |
34 | volatile void (*reset)(unsigned long addr); | 34 | void (*reset)(unsigned long addr) __attribute__((noreturn)); |
35 | /* | 35 | /* |
36 | * Idle the processor | 36 | * Idle the processor |
37 | */ | 37 | */ |
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h index b5ec5d54665d..6723e67244fa 100644 --- a/include/asm-arm/cpu-single.h +++ b/include/asm-arm/cpu-single.h | |||
@@ -41,4 +41,4 @@ extern int cpu_do_idle(void); | |||
41 | extern void cpu_dcache_clean_area(void *, int); | 41 | extern void cpu_dcache_clean_area(void *, int); |
42 | extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); | 42 | extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); |
43 | extern void cpu_set_pte(pte_t *ptep, pte_t pte); | 43 | extern void cpu_set_pte(pte_t *ptep, pte_t pte); |
44 | extern volatile void cpu_reset(unsigned long addr); | 44 | extern void cpu_reset(unsigned long addr) __attribute__((noreturn)); |
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index b28f1c95dd62..38ea5899a580 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h | |||
@@ -60,6 +60,10 @@ extern void | |||
60 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 60 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
61 | struct resource *res); | 61 | struct resource *res); |
62 | 62 | ||
63 | extern void | ||
64 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
65 | struct pci_bus_region *region); | ||
66 | |||
63 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 67 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
64 | { | 68 | { |
65 | } | 69 | } |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index a9892eb42a23..478c49b56e18 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -188,12 +188,18 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
188 | /* | 188 | /* |
189 | * - extended small page/tiny page | 189 | * - extended small page/tiny page |
190 | */ | 190 | */ |
191 | #define PTE_EXT_XN (1 << 0) /* v6 */ | ||
191 | #define PTE_EXT_AP_MASK (3 << 4) | 192 | #define PTE_EXT_AP_MASK (3 << 4) |
193 | #define PTE_EXT_AP0 (1 << 4) | ||
194 | #define PTE_EXT_AP1 (2 << 4) | ||
192 | #define PTE_EXT_AP_UNO_SRO (0 << 4) | 195 | #define PTE_EXT_AP_UNO_SRO (0 << 4) |
193 | #define PTE_EXT_AP_UNO_SRW (1 << 4) | 196 | #define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0) |
194 | #define PTE_EXT_AP_URO_SRW (2 << 4) | 197 | #define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1) |
195 | #define PTE_EXT_AP_URW_SRW (3 << 4) | 198 | #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) |
196 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ | 199 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ |
200 | #define PTE_EXT_APX (1 << 9) /* v6 */ | ||
201 | #define PTE_EXT_SHARED (1 << 10) /* v6 */ | ||
202 | #define PTE_EXT_NG (1 << 11) /* v6 */ | ||
197 | 203 | ||
198 | /* | 204 | /* |
199 | * - small page | 205 | * - small page |
@@ -224,6 +230,8 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
224 | #define L_PTE_WRITE (1 << 5) | 230 | #define L_PTE_WRITE (1 << 5) |
225 | #define L_PTE_EXEC (1 << 6) | 231 | #define L_PTE_EXEC (1 << 6) |
226 | #define L_PTE_DIRTY (1 << 7) | 232 | #define L_PTE_DIRTY (1 << 7) |
233 | #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ | ||
234 | #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ | ||
227 | 235 | ||
228 | #ifndef __ASSEMBLY__ | 236 | #ifndef __ASSEMBLY__ |
229 | 237 | ||
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index ace27480886e..abb36e54c966 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -350,6 +350,11 @@ | |||
350 | #endif | 350 | #endif |
351 | 351 | ||
352 | #define __NR_vserver (__NR_SYSCALL_BASE+313) | 352 | #define __NR_vserver (__NR_SYSCALL_BASE+313) |
353 | #define __NR_ioprio_set (__NR_SYSCALL_BASE+314) | ||
354 | #define __NR_ioprio_get (__NR_SYSCALL_BASE+315) | ||
355 | #define __NR_inotify_init (__NR_SYSCALL_BASE+316) | ||
356 | #define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317) | ||
357 | #define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318) | ||
353 | 358 | ||
354 | /* | 359 | /* |
355 | * The following SWIs are ARM private. | 360 | * The following SWIs are ARM private. |
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index 9d4cc47bde39..ee1d8b5d8168 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h | |||
@@ -22,6 +22,14 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
22 | region->end = res->end; | 22 | region->end = res->end; |
23 | } | 23 | } |
24 | 24 | ||
25 | static inline void | ||
26 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
27 | struct pci_bus_region *region) | ||
28 | { | ||
29 | res->start = region->start; | ||
30 | res->end = region->end; | ||
31 | } | ||
32 | |||
25 | #define pcibios_scan_all_fns(a, b) 0 | 33 | #define pcibios_scan_all_fns(a, b) 0 |
26 | 34 | ||
27 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ | 35 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ |
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h index 33acd50fd9a8..92d638fc8b11 100644 --- a/include/asm-i386/mach-visws/do_timer.h +++ b/include/asm-i386/mach-visws/do_timer.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* defines for inline arch setup functions */ | 1 | /* defines for inline arch setup functions */ |
2 | 2 | ||
3 | #include <asm/fixmap.h> | 3 | #include <asm/fixmap.h> |
4 | #include <asm/i8259.h> | ||
4 | #include "cobalt.h" | 5 | #include "cobalt.h" |
5 | 6 | ||
6 | static inline void do_timer_interrupt_hook(struct pt_regs *regs) | 7 | static inline void do_timer_interrupt_hook(struct pt_regs *regs) |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 5d06e6bd6ba0..d0d8b0160090 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -29,7 +29,7 @@ struct desc_struct { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | #define desc_empty(desc) \ | 31 | #define desc_empty(desc) \ |
32 | (!((desc)->a + (desc)->b)) | 32 | (!((desc)->a | (desc)->b)) |
33 | 33 | ||
34 | #define desc_equal(desc1, desc2) \ | 34 | #define desc_equal(desc1, desc2) \ |
35 | (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) | 35 | (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) |
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 491e9d1fc538..54e7637a326c 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h | |||
@@ -120,14 +120,6 @@ static inline void ___ia64_mmiowb(void) | |||
120 | ia64_mfa(); | 120 | ia64_mfa(); |
121 | } | 121 | } |
122 | 122 | ||
123 | static inline const unsigned long | ||
124 | __ia64_get_io_port_base (void) | ||
125 | { | ||
126 | extern unsigned long ia64_iobase; | ||
127 | |||
128 | return ia64_iobase; | ||
129 | } | ||
130 | |||
131 | static inline void* | 123 | static inline void* |
132 | __ia64_mk_io_addr (unsigned long port) | 124 | __ia64_mk_io_addr (unsigned long port) |
133 | { | 125 | { |
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index 1093f35b3b90..a429fe225b07 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h | |||
@@ -75,6 +75,8 @@ extern int __devinit iosapic_init (unsigned long address, | |||
75 | unsigned int gsi_base); | 75 | unsigned int gsi_base); |
76 | #ifdef CONFIG_HOTPLUG | 76 | #ifdef CONFIG_HOTPLUG |
77 | extern int iosapic_remove (unsigned int gsi_base); | 77 | extern int iosapic_remove (unsigned int gsi_base); |
78 | #else | ||
79 | #define iosapic_remove(gsi_base) (-EINVAL) | ||
78 | #endif /* CONFIG_HOTPLUG */ | 80 | #endif /* CONFIG_HOTPLUG */ |
79 | extern int gsi_to_vector (unsigned int gsi); | 81 | extern int gsi_to_vector (unsigned int gsi); |
80 | extern int gsi_to_irq (unsigned int gsi); | 82 | extern int gsi_to_irq (unsigned int gsi); |
@@ -102,9 +104,7 @@ extern void __devinit map_iosapic_to_node (unsigned int, int); | |||
102 | #else | 104 | #else |
103 | #define iosapic_system_init(pcat_compat) do { } while (0) | 105 | #define iosapic_system_init(pcat_compat) do { } while (0) |
104 | #define iosapic_init(address,gsi_base) (-EINVAL) | 106 | #define iosapic_init(address,gsi_base) (-EINVAL) |
105 | #ifdef CONFIG_HOTPLUG | ||
106 | #define iosapic_remove(gsi_base) (-ENODEV) | 107 | #define iosapic_remove(gsi_base) (-ENODEV) |
107 | #endif /* CONFIG_HOTPLUG */ | ||
108 | #define iosapic_register_intr(gsi,polarity,trigger) (gsi) | 108 | #define iosapic_register_intr(gsi,polarity,trigger) (gsi) |
109 | #define iosapic_unregister_intr(irq) do { } while (0) | 109 | #define iosapic_unregister_intr(irq) do { } while (0) |
110 | #define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0) | 110 | #define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0) |
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index b9a20cdad65f..7885b7df84a2 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -61,9 +61,7 @@ extern physid_mask_t phys_cpu_present_map; | |||
61 | * Some lowlevel functions might want to know about | 61 | * Some lowlevel functions might want to know about |
62 | * the real CPU ID <-> CPU # mapping. | 62 | * the real CPU ID <-> CPU # mapping. |
63 | */ | 63 | */ |
64 | extern volatile int physid_2_cpu[NR_CPUS]; | ||
65 | extern volatile int cpu_2_physid[NR_CPUS]; | 64 | extern volatile int cpu_2_physid[NR_CPUS]; |
66 | #define physid_to_cpu(physid) physid_2_cpu[physid] | ||
67 | #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] | 65 | #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] |
68 | 66 | ||
69 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 67 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 99a516709210..206313e2a817 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h | |||
@@ -138,13 +138,13 @@ extern unsigned long m68k_memoffset; | |||
138 | #define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) | 138 | #define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) |
139 | #define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) | 139 | #define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) |
140 | #else | 140 | #else |
141 | #define __pa(vaddr) virt_to_phys((void *)vaddr) | 141 | #define __pa(vaddr) virt_to_phys((void *)(vaddr)) |
142 | #define __va(paddr) phys_to_virt((unsigned long)paddr) | 142 | #define __va(paddr) phys_to_virt((unsigned long)(paddr)) |
143 | #endif | 143 | #endif |
144 | 144 | ||
145 | #else /* !CONFIG_SUN3 */ | 145 | #else /* !CONFIG_SUN3 */ |
146 | /* This #define is a horrible hack to suppress lots of warnings. --m */ | 146 | /* This #define is a horrible hack to suppress lots of warnings. --m */ |
147 | #define __pa(x) ___pa((unsigned long)x) | 147 | #define __pa(x) ___pa((unsigned long)(x)) |
148 | static inline unsigned long ___pa(unsigned long x) | 148 | static inline unsigned long ___pa(unsigned long x) |
149 | { | 149 | { |
150 | if(x == 0) | 150 | if(x == 0) |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index ee741c150176..98d79a3d54fa 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -253,6 +253,10 @@ extern void | |||
253 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 253 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
254 | struct resource *res); | 254 | struct resource *res); |
255 | 255 | ||
256 | extern void | ||
257 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
258 | struct pci_bus_region *region); | ||
259 | |||
256 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 260 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
257 | { | 261 | { |
258 | } | 262 | } |
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h index 87f051138b9d..e5374be86aef 100644 --- a/include/asm-ppc/ibm44x.h +++ b/include/asm-ppc/ibm44x.h | |||
@@ -35,8 +35,10 @@ | |||
35 | #define PPC44x_LOW_SLOT 63 | 35 | #define PPC44x_LOW_SLOT 63 |
36 | 36 | ||
37 | /* LS 32-bits of UART0 physical address location for early serial text debug */ | 37 | /* LS 32-bits of UART0 physical address location for early serial text debug */ |
38 | #ifdef CONFIG_440SP | 38 | #if defined(CONFIG_440SP) |
39 | #define UART0_PHYS_IO_BASE 0xf0000200 | 39 | #define UART0_PHYS_IO_BASE 0xf0000200 |
40 | #elif defined(CONFIG_440EP) | ||
41 | #define UART0_PHYS_IO_BASE 0xe0000000 | ||
40 | #else | 42 | #else |
41 | #define UART0_PHYS_IO_BASE 0x40000200 | 43 | #define UART0_PHYS_IO_BASE 0x40000200 |
42 | #endif | 44 | #endif |
@@ -49,11 +51,16 @@ | |||
49 | /* | 51 | /* |
50 | * Standard 4GB "page" definitions | 52 | * Standard 4GB "page" definitions |
51 | */ | 53 | */ |
52 | #ifdef CONFIG_440SP | 54 | #if defined(CONFIG_440SP) |
53 | #define PPC44x_IO_PAGE 0x0000000100000000ULL | 55 | #define PPC44x_IO_PAGE 0x0000000100000000ULL |
54 | #define PPC44x_PCICFG_PAGE 0x0000000900000000ULL | 56 | #define PPC44x_PCICFG_PAGE 0x0000000900000000ULL |
55 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE | 57 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE |
56 | #define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL | 58 | #define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL |
59 | #elif defined(CONFIG_440EP) | ||
60 | #define PPC44x_IO_PAGE 0x0000000000000000ULL | ||
61 | #define PPC44x_PCICFG_PAGE 0x0000000000000000ULL | ||
62 | #define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE | ||
63 | #define PPC44x_PCIMEM_PAGE 0x0000000000000000ULL | ||
57 | #else | 64 | #else |
58 | #define PPC44x_IO_PAGE 0x0000000100000000ULL | 65 | #define PPC44x_IO_PAGE 0x0000000100000000ULL |
59 | #define PPC44x_PCICFG_PAGE 0x0000000200000000ULL | 66 | #define PPC44x_PCICFG_PAGE 0x0000000200000000ULL |
@@ -64,7 +71,7 @@ | |||
64 | /* | 71 | /* |
65 | * 36-bit trap ranges | 72 | * 36-bit trap ranges |
66 | */ | 73 | */ |
67 | #ifdef CONFIG_440SP | 74 | #if defined(CONFIG_440SP) |
68 | #define PPC44x_IO_LO 0xf0000000UL | 75 | #define PPC44x_IO_LO 0xf0000000UL |
69 | #define PPC44x_IO_HI 0xf0000fffUL | 76 | #define PPC44x_IO_HI 0xf0000fffUL |
70 | #define PPC44x_PCI0CFG_LO 0x0ec00000UL | 77 | #define PPC44x_PCI0CFG_LO 0x0ec00000UL |
@@ -75,6 +82,13 @@ | |||
75 | #define PPC44x_PCI2CFG_HI 0x2ec00007UL | 82 | #define PPC44x_PCI2CFG_HI 0x2ec00007UL |
76 | #define PPC44x_PCIMEM_LO 0x80000000UL | 83 | #define PPC44x_PCIMEM_LO 0x80000000UL |
77 | #define PPC44x_PCIMEM_HI 0xdfffffffUL | 84 | #define PPC44x_PCIMEM_HI 0xdfffffffUL |
85 | #elif defined(CONFIG_440EP) | ||
86 | #define PPC44x_IO_LO 0xef500000UL | ||
87 | #define PPC44x_IO_HI 0xefffffffUL | ||
88 | #define PPC44x_PCI0CFG_LO 0xeec00000UL | ||
89 | #define PPC44x_PCI0CFG_HI 0xeecfffffUL | ||
90 | #define PPC44x_PCIMEM_LO 0xa0000000UL | ||
91 | #define PPC44x_PCIMEM_HI 0xdfffffffUL | ||
78 | #else | 92 | #else |
79 | #define PPC44x_IO_LO 0x40000000UL | 93 | #define PPC44x_IO_LO 0x40000000UL |
80 | #define PPC44x_IO_HI 0x40000fffUL | 94 | #define PPC44x_IO_HI 0x40000fffUL |
@@ -152,6 +166,12 @@ | |||
152 | #define DCRN_SDR_UART0 0x0120 | 166 | #define DCRN_SDR_UART0 0x0120 |
153 | #define DCRN_SDR_UART1 0x0121 | 167 | #define DCRN_SDR_UART1 0x0121 |
154 | 168 | ||
169 | #ifdef CONFIG_440EP | ||
170 | #define DCRN_SDR_UART2 0x0122 | ||
171 | #define DCRN_SDR_UART3 0x0123 | ||
172 | #define DCRN_SDR_CUST0 0x4000 | ||
173 | #endif | ||
174 | |||
155 | /* SDR read/write helper macros */ | 175 | /* SDR read/write helper macros */ |
156 | #define SDR_READ(offset) ({\ | 176 | #define SDR_READ(offset) ({\ |
157 | mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ | 177 | mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ |
@@ -169,6 +189,14 @@ | |||
169 | #define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */ | 189 | #define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */ |
170 | #define DCRN_MAL_BASE 0x180 | 190 | #define DCRN_MAL_BASE 0x180 |
171 | 191 | ||
192 | #ifdef CONFIG_440EP | ||
193 | #define DCRN_DMA2P40_BASE 0x300 | ||
194 | #define DCRN_DMA2P41_BASE 0x308 | ||
195 | #define DCRN_DMA2P42_BASE 0x310 | ||
196 | #define DCRN_DMA2P43_BASE 0x318 | ||
197 | #define DCRN_DMA2P4SR_BASE 0x320 | ||
198 | #endif | ||
199 | |||
172 | /* UIC */ | 200 | /* UIC */ |
173 | #define DCRN_UIC0_BASE 0xc0 | 201 | #define DCRN_UIC0_BASE 0xc0 |
174 | #define DCRN_UIC1_BASE 0xd0 | 202 | #define DCRN_UIC1_BASE 0xd0 |
@@ -395,11 +423,7 @@ | |||
395 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 | 423 | #define MQ0_CONFIG_SIZE_2G 0x0000c000 |
396 | 424 | ||
397 | /* Internal SRAM Controller 440GX/440SP */ | 425 | /* Internal SRAM Controller 440GX/440SP */ |
398 | #ifdef CONFIG_440SP | ||
399 | #define DCRN_SRAM0_BASE 0x100 | ||
400 | #else /* 440GX */ | ||
401 | #define DCRN_SRAM0_BASE 0x000 | 426 | #define DCRN_SRAM0_BASE 0x000 |
402 | #endif | ||
403 | 427 | ||
404 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) | 428 | #define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) |
405 | #define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) | 429 | #define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) |
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index 35260afa33a9..e807be96e981 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h | |||
@@ -97,6 +97,10 @@ void ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5, | |||
97 | 97 | ||
98 | #elif CONFIG_44x | 98 | #elif CONFIG_44x |
99 | 99 | ||
100 | #if defined(CONFIG_BAMBOO) | ||
101 | #include <platforms/4xx/bamboo.h> | ||
102 | #endif | ||
103 | |||
100 | #if defined(CONFIG_EBONY) | 104 | #if defined(CONFIG_EBONY) |
101 | #include <platforms/4xx/ebony.h> | 105 | #include <platforms/4xx/ebony.h> |
102 | #endif | 106 | #endif |
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index 8c61d93043af..3f7b5669e6d5 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h | |||
@@ -71,6 +71,8 @@ struct ocp_func_emac_data { | |||
71 | 71 | ||
72 | /* Sysfs support */ | 72 | /* Sysfs support */ |
73 | #define OCP_SYSFS_EMAC_DATA() \ | 73 | #define OCP_SYSFS_EMAC_DATA() \ |
74 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, rgmii_idx) \ | ||
75 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, rgmii_mux) \ | ||
74 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_idx) \ | 76 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_idx) \ |
75 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_mux) \ | 77 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_mux) \ |
76 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_idx) \ | 78 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_idx) \ |
@@ -78,9 +80,14 @@ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_rx_chan) \ | |||
78 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_tx_chan) \ | 80 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_tx_chan) \ |
79 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, wol_irq) \ | 81 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, wol_irq) \ |
80 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \ | 82 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \ |
83 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \ | ||
84 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \ | ||
85 | OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \ | ||
81 | \ | 86 | \ |
82 | void ocp_show_emac_data(struct device *dev) \ | 87 | void ocp_show_emac_data(struct device *dev) \ |
83 | { \ | 88 | { \ |
89 | device_create_file(dev, &dev_attr_emac_rgmii_idx); \ | ||
90 | device_create_file(dev, &dev_attr_emac_rgmii_mux); \ | ||
84 | device_create_file(dev, &dev_attr_emac_zmii_idx); \ | 91 | device_create_file(dev, &dev_attr_emac_zmii_idx); \ |
85 | device_create_file(dev, &dev_attr_emac_zmii_mux); \ | 92 | device_create_file(dev, &dev_attr_emac_zmii_mux); \ |
86 | device_create_file(dev, &dev_attr_emac_mal_idx); \ | 93 | device_create_file(dev, &dev_attr_emac_mal_idx); \ |
@@ -88,6 +95,9 @@ void ocp_show_emac_data(struct device *dev) \ | |||
88 | device_create_file(dev, &dev_attr_emac_mal_tx_chan); \ | 95 | device_create_file(dev, &dev_attr_emac_mal_tx_chan); \ |
89 | device_create_file(dev, &dev_attr_emac_wol_irq); \ | 96 | device_create_file(dev, &dev_attr_emac_wol_irq); \ |
90 | device_create_file(dev, &dev_attr_emac_mdio_idx); \ | 97 | device_create_file(dev, &dev_attr_emac_mdio_idx); \ |
98 | device_create_file(dev, &dev_attr_emac_tah_idx); \ | ||
99 | device_create_file(dev, &dev_attr_emac_phy_mode); \ | ||
100 | device_create_file(dev, &dev_attr_emac_phy_map); \ | ||
91 | } | 101 | } |
92 | 102 | ||
93 | #ifdef CONFIG_40x | 103 | #ifdef CONFIG_40x |
@@ -157,7 +167,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_iic_data, "%d\n", iic, fast_mode) \ | |||
157 | \ | 167 | \ |
158 | void ocp_show_iic_data(struct device *dev) \ | 168 | void ocp_show_iic_data(struct device *dev) \ |
159 | { \ | 169 | { \ |
160 | device_create_file(dev, &dev_attr_iic_fast_mode); \ | 170 | device_create_file(dev, &dev_attr_iic_fast_mode); \ |
161 | } | 171 | } |
162 | #endif /* __IBM_OCP_H__ */ | 172 | #endif /* __IBM_OCP_H__ */ |
163 | #endif /* __KERNEL__ */ | 173 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index a13d55870e62..a811e440c978 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h | |||
@@ -105,6 +105,10 @@ extern void | |||
105 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 105 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
106 | struct resource *res); | 106 | struct resource *res); |
107 | 107 | ||
108 | extern void | ||
109 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
110 | struct pci_bus_region *region); | ||
111 | |||
108 | extern void pcibios_add_platform_entries(struct pci_dev *dev); | 112 | extern void pcibios_add_platform_entries(struct pci_dev *dev); |
109 | 113 | ||
110 | struct file; | 114 | struct file; |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 4d4b20c9de78..92f30b28b252 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -202,18 +202,64 @@ extern unsigned long ioremap_bot, ioremap_base; | |||
202 | * | 202 | * |
203 | * Note that these bits preclude future use of a page size | 203 | * Note that these bits preclude future use of a page size |
204 | * less than 4KB. | 204 | * less than 4KB. |
205 | * | ||
206 | * | ||
207 | * PPC 440 core has following TLB attribute fields; | ||
208 | * | ||
209 | * TLB1: | ||
210 | * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ||
211 | * RPN................................. - - - - - - ERPN....... | ||
212 | * | ||
213 | * TLB2: | ||
214 | * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ||
215 | * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR | ||
216 | * | ||
217 | * There are some constrains and options, to decide mapping software bits | ||
218 | * into TLB entry. | ||
219 | * | ||
220 | * - PRESENT *must* be in the bottom three bits because swap cache | ||
221 | * entries use the top 29 bits for TLB2. | ||
222 | * | ||
223 | * - FILE *must* be in the bottom three bits because swap cache | ||
224 | * entries use the top 29 bits for TLB2. | ||
225 | * | ||
226 | * - CACHE COHERENT bit (M) has no effect on PPC440 core, because it | ||
227 | * doesn't support SMP. So we can use this as software bit, like | ||
228 | * DIRTY. | ||
229 | * | ||
230 | * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used | ||
231 | * for memory protection related functions (see PTE structure in | ||
232 | * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the | ||
233 | * above bits. Note that the bit values are CPU specific, not architecture | ||
234 | * specific. | ||
235 | * | ||
236 | * The kernel PTE entry holds an arch-dependent swp_entry structure under | ||
237 | * certain situations. In other words, in such situations some portion of | ||
238 | * the PTE bits are used as a swp_entry. In the PPC implementation, the | ||
239 | * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still | ||
240 | * hold protection values. That means the three protection bits are | ||
241 | * reserved for both PTE and SWAP entry at the most significant three | ||
242 | * LSBs. | ||
243 | * | ||
244 | * There are three protection bits available for SWAP entry: | ||
245 | * _PAGE_PRESENT | ||
246 | * _PAGE_FILE | ||
247 | * _PAGE_HASHPTE (if HW has) | ||
248 | * | ||
249 | * So those three bits have to be inside of 0-2nd LSB of PTE. | ||
250 | * | ||
205 | */ | 251 | */ |
252 | |||
206 | #define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ | 253 | #define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ |
207 | #define _PAGE_RW 0x00000002 /* S: Write permission */ | 254 | #define _PAGE_RW 0x00000002 /* S: Write permission */ |
208 | #define _PAGE_DIRTY 0x00000004 /* S: Page dirty */ | 255 | #define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */ |
209 | #define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ | 256 | #define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ |
210 | #define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */ | 257 | #define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */ |
211 | #define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */ | 258 | #define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */ |
212 | #define _PAGE_USER 0x00000040 /* S: User page */ | 259 | #define _PAGE_USER 0x00000040 /* S: User page */ |
213 | #define _PAGE_ENDIAN 0x00000080 /* H: E bit */ | 260 | #define _PAGE_ENDIAN 0x00000080 /* H: E bit */ |
214 | #define _PAGE_GUARDED 0x00000100 /* H: G bit */ | 261 | #define _PAGE_GUARDED 0x00000100 /* H: G bit */ |
215 | #define _PAGE_COHERENT 0x00000200 /* H: M bit */ | 262 | #define _PAGE_DIRTY 0x00000200 /* S: Page dirty */ |
216 | #define _PAGE_FILE 0x00000400 /* S: nonlinear file mapping */ | ||
217 | #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ | 263 | #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ |
218 | #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ | 264 | #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ |
219 | 265 | ||
diff --git a/include/asm-ppc/ppc4xx_dma.h b/include/asm-ppc/ppc4xx_dma.h index 8636cdbf6f8f..a415001165fa 100644 --- a/include/asm-ppc/ppc4xx_dma.h +++ b/include/asm-ppc/ppc4xx_dma.h | |||
@@ -285,7 +285,7 @@ typedef uint32_t sgl_handle_t; | |||
285 | 285 | ||
286 | #define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan)) | 286 | #define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan)) |
287 | 287 | ||
288 | #elif defined(CONFIG_STBXXX_DMA) /* stb03xxx */ | 288 | #elif defined(CONFIG_STB03xxx) /* stb03xxx */ |
289 | 289 | ||
290 | #define DMA_PPC4xx_SIZE 4096 | 290 | #define DMA_PPC4xx_SIZE 4096 |
291 | 291 | ||
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h index f76221def484..bb53e2def363 100644 --- a/include/asm-ppc/ppc_asm.h +++ b/include/asm-ppc/ppc_asm.h | |||
@@ -186,6 +186,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
186 | #define PPC405_ERR77_SYNC | 186 | #define PPC405_ERR77_SYNC |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | #ifdef CONFIG_IBM440EP_ERR42 | ||
190 | #define PPC440EP_ERR42 isync | ||
191 | #else | ||
192 | #define PPC440EP_ERR42 | ||
193 | #endif | ||
194 | |||
189 | /* The boring bits... */ | 195 | /* The boring bits... */ |
190 | 196 | ||
191 | /* Condition Register Bit Fields */ | 197 | /* Condition Register Bit Fields */ |
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h index ce09b47fa819..321fb75b5f22 100644 --- a/include/asm-ppc/time.h +++ b/include/asm-ppc/time.h | |||
@@ -58,7 +58,7 @@ static __inline__ void set_dec(unsigned int val) | |||
58 | /* Accessor functions for the timebase (RTC on 601) registers. */ | 58 | /* Accessor functions for the timebase (RTC on 601) registers. */ |
59 | /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ | 59 | /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ |
60 | #ifdef CONFIG_6xx | 60 | #ifdef CONFIG_6xx |
61 | extern __inline__ int const __USE_RTC(void) { | 61 | extern __inline__ int __attribute_pure__ __USE_RTC(void) { |
62 | return (mfspr(SPRN_PVR)>>16) == 1; | 62 | return (mfspr(SPRN_PVR)>>16) == 1; |
63 | } | 63 | } |
64 | #else | 64 | #else |
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h index a7894e0fbbb1..3173ab3d2eb9 100644 --- a/include/asm-ppc/unistd.h +++ b/include/asm-ppc/unistd.h | |||
@@ -279,8 +279,11 @@ | |||
279 | #define __NR_waitid 272 | 279 | #define __NR_waitid 272 |
280 | #define __NR_ioprio_set 273 | 280 | #define __NR_ioprio_set 273 |
281 | #define __NR_ioprio_get 274 | 281 | #define __NR_ioprio_get 274 |
282 | #define __NR_inotify_init 275 | ||
283 | #define __NR_inotify_add_watch 276 | ||
284 | #define __NR_inotify_rm_watch 277 | ||
282 | 285 | ||
283 | #define __NR_syscalls 275 | 286 | #define __NR_syscalls 278 |
284 | 287 | ||
285 | #define __NR(n) #n | 288 | #define __NR(n) #n |
286 | 289 | ||
diff --git a/include/asm-ppc64/bug.h b/include/asm-ppc64/bug.h index 169868fa307d..160178278861 100644 --- a/include/asm-ppc64/bug.h +++ b/include/asm-ppc64/bug.h | |||
@@ -43,8 +43,8 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
43 | ".section __bug_table,\"a\"\n\t" \ | 43 | ".section __bug_table,\"a\"\n\t" \ |
44 | " .llong 1b,%1,%2,%3\n" \ | 44 | " .llong 1b,%1,%2,%3\n" \ |
45 | ".previous" \ | 45 | ".previous" \ |
46 | : : "r" (x), "i" (__LINE__), "i" (__FILE__), \ | 46 | : : "r" ((long long)(x)), "i" (__LINE__), \ |
47 | "i" (__FUNCTION__)); \ | 47 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
48 | } while (0) | 48 | } while (0) |
49 | 49 | ||
50 | #define WARN_ON(x) do { \ | 50 | #define WARN_ON(x) do { \ |
@@ -53,7 +53,8 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
53 | ".section __bug_table,\"a\"\n\t" \ | 53 | ".section __bug_table,\"a\"\n\t" \ |
54 | " .llong 1b,%1,%2,%3\n" \ | 54 | " .llong 1b,%1,%2,%3\n" \ |
55 | ".previous" \ | 55 | ".previous" \ |
56 | : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \ | 56 | : : "r" ((long long)(x)), \ |
57 | "i" (__LINE__ + BUG_WARNING_TRAP), \ | ||
57 | "i" (__FILE__), "i" (__FUNCTION__)); \ | 58 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
58 | } while (0) | 59 | } while (0) |
59 | 60 | ||
diff --git a/include/asm-ppc64/iSeries/LparMap.h b/include/asm-ppc64/iSeries/LparMap.h index 5c32e38c1c01..a6840b186d03 100644 --- a/include/asm-ppc64/iSeries/LparMap.h +++ b/include/asm-ppc64/iSeries/LparMap.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef _LPARMAP_H | 19 | #ifndef _LPARMAP_H |
20 | #define _LPARMAP_H | 20 | #define _LPARMAP_H |
21 | 21 | ||
22 | #ifndef __ASSEMBLY__ | ||
23 | |||
22 | #include <asm/types.h> | 24 | #include <asm/types.h> |
23 | 25 | ||
24 | /* | 26 | /* |
@@ -71,6 +73,11 @@ struct LparMap { | |||
71 | } xRanges[HvRangesToMap]; | 73 | } xRanges[HvRangesToMap]; |
72 | }; | 74 | }; |
73 | 75 | ||
74 | extern struct LparMap xLparMap; | 76 | extern const struct LparMap xLparMap; |
77 | |||
78 | #endif /* __ASSEMBLY__ */ | ||
79 | |||
80 | /* the fixed address where the LparMap exists */ | ||
81 | #define LPARMAP_PHYS 0x7000 | ||
75 | 82 | ||
76 | #endif /* _LPARMAP_H */ | 83 | #endif /* _LPARMAP_H */ |
diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h index f0c1d2d92672..f0ef06375947 100644 --- a/include/asm-ppc64/machdep.h +++ b/include/asm-ppc64/machdep.h | |||
@@ -84,7 +84,7 @@ struct machdep_calls { | |||
84 | 84 | ||
85 | void (*init_IRQ)(void); | 85 | void (*init_IRQ)(void); |
86 | int (*get_irq)(struct pt_regs *); | 86 | int (*get_irq)(struct pt_regs *); |
87 | void (*cpu_irq_down)(void); | 87 | void (*cpu_irq_down)(int secondary); |
88 | 88 | ||
89 | /* PCI stuff */ | 89 | /* PCI stuff */ |
90 | void (*pcibios_fixup)(void); | 90 | void (*pcibios_fixup)(void); |
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index faa772223075..4d057452f59b 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h | |||
@@ -134,6 +134,10 @@ extern void | |||
134 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 134 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
135 | struct resource *res); | 135 | struct resource *res); |
136 | 136 | ||
137 | extern void | ||
138 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
139 | struct pci_bus_region *region); | ||
140 | |||
137 | extern int | 141 | extern int |
138 | unmap_bus_range(struct pci_bus *bus); | 142 | unmap_bus_range(struct pci_bus *bus); |
139 | 143 | ||
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h index fcdcfd26a26b..1e9b19073230 100644 --- a/include/asm-ppc64/topology.h +++ b/include/asm-ppc64/topology.h | |||
@@ -33,6 +33,7 @@ static inline int node_to_first_cpu(int node) | |||
33 | return first_cpu(tmp); | 33 | return first_cpu(tmp); |
34 | } | 34 | } |
35 | 35 | ||
36 | #define pcibus_to_node(node) (-1) | ||
36 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 37 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
37 | 38 | ||
38 | #define nr_cpus_node(node) (nr_cpus_in_node[node]) | 39 | #define nr_cpus_node(node) (nr_cpus_in_node[node]) |
@@ -59,8 +60,10 @@ static inline int node_to_first_cpu(int node) | |||
59 | .nr_balance_failed = 0, \ | 60 | .nr_balance_failed = 0, \ |
60 | } | 61 | } |
61 | 62 | ||
62 | #endif /* CONFIG_NUMA */ | 63 | #else |
63 | 64 | ||
64 | #include <asm-generic/topology.h> | 65 | #include <asm-generic/topology.h> |
65 | 66 | ||
67 | #endif /* CONFIG_NUMA */ | ||
68 | |||
66 | #endif /* _ASM_PPC64_TOPOLOGY_H */ | 69 | #endif /* _ASM_PPC64_TOPOLOGY_H */ |
diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h index 4a94acf6bfed..977bc980c1af 100644 --- a/include/asm-ppc64/unistd.h +++ b/include/asm-ppc64/unistd.h | |||
@@ -285,8 +285,11 @@ | |||
285 | #define __NR_waitid 272 | 285 | #define __NR_waitid 272 |
286 | #define __NR_ioprio_set 273 | 286 | #define __NR_ioprio_set 273 |
287 | #define __NR_ioprio_get 274 | 287 | #define __NR_ioprio_get 274 |
288 | #define __NR_inotify_init 275 | ||
289 | #define __NR_inotify_add_watch 276 | ||
290 | #define __NR_inotify_rm_watch 277 | ||
288 | 291 | ||
289 | #define __NR_syscalls 275 | 292 | #define __NR_syscalls 278 |
290 | #ifdef __KERNEL__ | 293 | #ifdef __KERNEL__ |
291 | #define NR_syscalls __NR_syscalls | 294 | #define NR_syscalls __NR_syscalls |
292 | #endif | 295 | #endif |
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h index 0c45e14e26ca..1092af55d707 100644 --- a/include/asm-ppc64/xics.h +++ b/include/asm-ppc64/xics.h | |||
@@ -17,7 +17,7 @@ | |||
17 | void xics_init_IRQ(void); | 17 | void xics_init_IRQ(void); |
18 | int xics_get_irq(struct pt_regs *); | 18 | int xics_get_irq(struct pt_regs *); |
19 | void xics_setup_cpu(void); | 19 | void xics_setup_cpu(void); |
20 | void xics_teardown_cpu(void); | 20 | void xics_teardown_cpu(int secondary); |
21 | void xics_cause_IPI(int cpu); | 21 | void xics_cause_IPI(int cpu); |
22 | void xics_request_IPIs(void); | 22 | void xics_request_IPIs(void); |
23 | void xics_migrate_irqs_away(void); | 23 | void xics_migrate_irqs_away(void); |
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index a7f43a251f81..3e3bfe6a8fa8 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
@@ -149,11 +149,11 @@ struct exception_table_entry | |||
149 | }) | 149 | }) |
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #ifndef __CHECKER__ | ||
153 | #define __put_user(x, ptr) \ | 152 | #define __put_user(x, ptr) \ |
154 | ({ \ | 153 | ({ \ |
155 | __typeof__(*(ptr)) __x = (x); \ | 154 | __typeof__(*(ptr)) __x = (x); \ |
156 | int __pu_err; \ | 155 | int __pu_err; \ |
156 | __chk_user_ptr(ptr); \ | ||
157 | switch (sizeof (*(ptr))) { \ | 157 | switch (sizeof (*(ptr))) { \ |
158 | case 1: \ | 158 | case 1: \ |
159 | case 2: \ | 159 | case 2: \ |
@@ -167,14 +167,6 @@ struct exception_table_entry | |||
167 | } \ | 167 | } \ |
168 | __pu_err; \ | 168 | __pu_err; \ |
169 | }) | 169 | }) |
170 | #else | ||
171 | #define __put_user(x, ptr) \ | ||
172 | ({ \ | ||
173 | void __user *p; \ | ||
174 | p = (ptr); \ | ||
175 | 0; \ | ||
176 | }) | ||
177 | #endif | ||
178 | 170 | ||
179 | #define put_user(x, ptr) \ | 171 | #define put_user(x, ptr) \ |
180 | ({ \ | 172 | ({ \ |
@@ -213,11 +205,11 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
213 | }) | 205 | }) |
214 | #endif | 206 | #endif |
215 | 207 | ||
216 | #ifndef __CHECKER__ | ||
217 | #define __get_user(x, ptr) \ | 208 | #define __get_user(x, ptr) \ |
218 | ({ \ | 209 | ({ \ |
219 | __typeof__(*(ptr)) __x; \ | 210 | __typeof__(*(ptr)) __x; \ |
220 | int __gu_err; \ | 211 | int __gu_err; \ |
212 | __chk_user_ptr(ptr); \ | ||
221 | switch (sizeof(*(ptr))) { \ | 213 | switch (sizeof(*(ptr))) { \ |
222 | case 1: \ | 214 | case 1: \ |
223 | case 2: \ | 215 | case 2: \ |
@@ -232,15 +224,6 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
232 | (x) = __x; \ | 224 | (x) = __x; \ |
233 | __gu_err; \ | 225 | __gu_err; \ |
234 | }) | 226 | }) |
235 | #else | ||
236 | #define __get_user(x, ptr) \ | ||
237 | ({ \ | ||
238 | void __user *p; \ | ||
239 | p = (ptr); \ | ||
240 | 0; \ | ||
241 | }) | ||
242 | #endif | ||
243 | |||
244 | 227 | ||
245 | #define get_user(x, ptr) \ | 228 | #define get_user(x, ptr) \ |
246 | ({ \ | 229 | ({ \ |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 363db45f8d07..221e965da924 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -274,8 +274,13 @@ | |||
274 | #define __NR_request_key 279 | 274 | #define __NR_request_key 279 |
275 | #define __NR_keyctl 280 | 275 | #define __NR_keyctl 280 |
276 | #define __NR_waitid 281 | 276 | #define __NR_waitid 281 |
277 | #define __NR_ioprio_set 282 | ||
278 | #define __NR_ioprio_get 283 | ||
279 | #define __NR_inotify_init 284 | ||
280 | #define __NR_inotify_add_watch 285 | ||
281 | #define __NR_inotify_rm_watch 286 | ||
277 | 282 | ||
278 | #define NR_syscalls 282 | 283 | #define NR_syscalls 287 |
279 | 284 | ||
280 | /* | 285 | /* |
281 | * There are some system calls that are not present on 64 bit, some | 286 | * There are some system calls that are not present on 64 bit, some |
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index 245447081f0d..ea89e8f223ea 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -295,8 +295,14 @@ | |||
295 | #define __NR_add_key 285 | 295 | #define __NR_add_key 285 |
296 | #define __NR_request_key 286 | 296 | #define __NR_request_key 286 |
297 | #define __NR_keyctl 287 | 297 | #define __NR_keyctl 287 |
298 | #define __NR_ioprio_set 288 | ||
299 | #define __NR_ioprio_get 289 | ||
300 | #define __NR_inotify_init 290 | ||
301 | #define __NR_inotify_add_watch 291 | ||
302 | #define __NR_inotify_rm_watch 292 | ||
298 | 303 | ||
299 | #define NR_syscalls 288 | 304 | |
305 | #define NR_syscalls 293 | ||
300 | 306 | ||
301 | /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ | 307 | /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ |
302 | 308 | ||
@@ -406,7 +412,7 @@ register long __sc6 __asm__ ("r6") = (long) arg3; \ | |||
406 | register long __sc7 __asm__ ("r7") = (long) arg4; \ | 412 | register long __sc7 __asm__ ("r7") = (long) arg4; \ |
407 | register long __sc0 __asm__ ("r0") = (long) arg5; \ | 413 | register long __sc0 __asm__ ("r0") = (long) arg5; \ |
408 | register long __sc1 __asm__ ("r1") = (long) arg6; \ | 414 | register long __sc1 __asm__ ("r1") = (long) arg6; \ |
409 | __asm__ __volatile__ ("trapa #0x15" \ | 415 | __asm__ __volatile__ ("trapa #0x16" \ |
410 | : "=z" (__sc0) \ | 416 | : "=z" (__sc0) \ |
411 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ | 417 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ |
412 | "r" (__sc3), "r" (__sc1) \ | 418 | "r" (__sc3), "r" (__sc1) \ |
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 95f0b130405c..2a1cfa404ea4 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -338,8 +338,13 @@ | |||
338 | #define __NR_add_key 313 | 338 | #define __NR_add_key 313 |
339 | #define __NR_request_key 314 | 339 | #define __NR_request_key 314 |
340 | #define __NR_keyctl 315 | 340 | #define __NR_keyctl 315 |
341 | #define __NR_ioprio_set 316 | ||
342 | #define __NR_ioprio_get 317 | ||
343 | #define __NR_inotify_init 318 | ||
344 | #define __NR_inotify_add_watch 319 | ||
345 | #define __NR_inotify_rm_watch 320 | ||
341 | 346 | ||
342 | #define NR_syscalls 316 | 347 | #define NR_syscalls 321 |
343 | 348 | ||
344 | /* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ | 349 | /* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ |
345 | 350 | ||
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h index 352d9943661a..c94d8b3991bd 100644 --- a/include/asm-sparc64/thread_info.h +++ b/include/asm-sparc64/thread_info.h | |||
@@ -68,6 +68,9 @@ struct thread_info { | |||
68 | 68 | ||
69 | struct restart_block restart_block; | 69 | struct restart_block restart_block; |
70 | 70 | ||
71 | struct pt_regs *kern_una_regs; | ||
72 | unsigned int kern_una_insn; | ||
73 | |||
71 | unsigned long fpregs[0] __attribute__ ((aligned(64))); | 74 | unsigned long fpregs[0] __attribute__ ((aligned(64))); |
72 | }; | 75 | }; |
73 | 76 | ||
@@ -103,6 +106,8 @@ struct thread_info { | |||
103 | #define TI_PCR 0x00000490 | 106 | #define TI_PCR 0x00000490 |
104 | #define TI_CEE_STUFF 0x00000498 | 107 | #define TI_CEE_STUFF 0x00000498 |
105 | #define TI_RESTART_BLOCK 0x000004a0 | 108 | #define TI_RESTART_BLOCK 0x000004a0 |
109 | #define TI_KUNA_REGS 0x000004c8 | ||
110 | #define TI_KUNA_INSN 0x000004d0 | ||
106 | #define TI_FPREGS 0x00000500 | 111 | #define TI_FPREGS 0x00000500 |
107 | 112 | ||
108 | /* We embed this in the uppermost byte of thread_info->flags */ | 113 | /* We embed this in the uppermost byte of thread_info->flags */ |
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 5afee8a8cdf3..f58aedadeb4e 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -104,8 +104,8 @@ extern void *to_virt(unsigned long phys); | |||
104 | * casting is the right thing, but 32-bit UML can't have 64-bit virtual | 104 | * casting is the right thing, but 32-bit UML can't have 64-bit virtual |
105 | * addresses | 105 | * addresses |
106 | */ | 106 | */ |
107 | #define __pa(virt) to_phys((void *) (unsigned long) virt) | 107 | #define __pa(virt) to_phys((void *) (unsigned long) (virt)) |
108 | #define __va(phys) to_virt((unsigned long) phys) | 108 | #define __va(phys) to_virt((unsigned long) (phys)) |
109 | 109 | ||
110 | #define page_to_pfn(page) ((page) - mem_map) | 110 | #define page_to_pfn(page) ((page) - mem_map) |
111 | #define pfn_to_page(pfn) (mem_map + (pfn)) | 111 | #define pfn_to_page(pfn) (mem_map + (pfn)) |
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index 8e94edf0b984..e682edc24a68 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h | |||
@@ -51,6 +51,8 @@ extern int e820_mapped(unsigned long start, unsigned long end, unsigned type); | |||
51 | 51 | ||
52 | extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); | 52 | extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); |
53 | extern void e820_setup_gap(void); | 53 | extern void e820_setup_gap(void); |
54 | extern unsigned long e820_hole_size(unsigned long start_pfn, | ||
55 | unsigned long end_pfn); | ||
54 | 56 | ||
55 | extern void __init parse_memopt(char *p, char **end); | 57 | extern void __init parse_memopt(char *p, char **end); |
56 | 58 | ||
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 106f666517bb..85549e656eeb 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #define ID_MASK 0x00200000 | 32 | #define ID_MASK 0x00200000 |
33 | 33 | ||
34 | #define desc_empty(desc) \ | 34 | #define desc_empty(desc) \ |
35 | (!((desc)->a + (desc)->b)) | 35 | (!((desc)->a | (desc)->b)) |
36 | 36 | ||
37 | #define desc_equal(desc1, desc2) \ | 37 | #define desc_equal(desc1, desc2) \ |
38 | (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) | 38 | (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index f85cbe919e13..b46a5205ee7b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -453,9 +453,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | |||
453 | * If this matches the last registration, any IRQ resources for gsi | 453 | * If this matches the last registration, any IRQ resources for gsi |
454 | * are freed. | 454 | * are freed. |
455 | */ | 455 | */ |
456 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ | ||
457 | void acpi_unregister_gsi (u32 gsi); | 456 | void acpi_unregister_gsi (u32 gsi); |
458 | #endif | ||
459 | 457 | ||
460 | #ifdef CONFIG_ACPI_PCI | 458 | #ifdef CONFIG_ACPI_PCI |
461 | 459 | ||
@@ -480,9 +478,7 @@ struct pci_dev; | |||
480 | int acpi_pci_irq_enable (struct pci_dev *dev); | 478 | int acpi_pci_irq_enable (struct pci_dev *dev); |
481 | void acpi_penalize_isa_irq(int irq, int active); | 479 | void acpi_penalize_isa_irq(int irq, int active); |
482 | 480 | ||
483 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ | ||
484 | void acpi_pci_irq_disable (struct pci_dev *dev); | 481 | void acpi_pci_irq_disable (struct pci_dev *dev); |
485 | #endif | ||
486 | 482 | ||
487 | struct acpi_pci_driver { | 483 | struct acpi_pci_driver { |
488 | struct acpi_pci_driver *next; | 484 | struct acpi_pci_driver *next; |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 36ef29fa0d8b..4fda06da56c1 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -295,7 +295,13 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); | |||
295 | extern int bio_get_nr_vecs(struct block_device *); | 295 | extern int bio_get_nr_vecs(struct block_device *); |
296 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, | 296 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, |
297 | unsigned long, unsigned int, int); | 297 | unsigned long, unsigned int, int); |
298 | struct sg_iovec; | ||
299 | extern struct bio *bio_map_user_iov(struct request_queue *, | ||
300 | struct block_device *, | ||
301 | struct sg_iovec *, int, int); | ||
298 | extern void bio_unmap_user(struct bio *); | 302 | extern void bio_unmap_user(struct bio *); |
303 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | ||
304 | unsigned int); | ||
299 | extern void bio_set_pages_dirty(struct bio *bio); | 305 | extern void bio_set_pages_dirty(struct bio *bio); |
300 | extern void bio_check_pages_dirty(struct bio *bio); | 306 | extern void bio_check_pages_dirty(struct bio *bio); |
301 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 307 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0881b5cdee3d..aefa26fbae8a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -301,6 +301,7 @@ struct blk_queue_tag { | |||
301 | struct list_head busy_list; /* fifo list of busy tags */ | 301 | struct list_head busy_list; /* fifo list of busy tags */ |
302 | int busy; /* current depth */ | 302 | int busy; /* current depth */ |
303 | int max_depth; /* what we will send to device */ | 303 | int max_depth; /* what we will send to device */ |
304 | int real_max_depth; /* what the array can hold */ | ||
304 | atomic_t refcnt; /* map can be shared */ | 305 | atomic_t refcnt; /* map can be shared */ |
305 | }; | 306 | }; |
306 | 307 | ||
@@ -562,10 +563,12 @@ extern void blk_sync_queue(struct request_queue *q); | |||
562 | extern void __blk_stop_queue(request_queue_t *q); | 563 | extern void __blk_stop_queue(request_queue_t *q); |
563 | extern void blk_run_queue(request_queue_t *); | 564 | extern void blk_run_queue(request_queue_t *); |
564 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 565 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
565 | extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int); | 566 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
566 | extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int); | 567 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
567 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); | 568 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); |
568 | 569 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); | |
570 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, | ||
571 | struct request *, int); | ||
569 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) | 572 | static inline request_queue_t *bdev_get_queue(struct block_device *bdev) |
570 | { | 573 | { |
571 | return bdev->bd_disk->queue; | 574 | return bdev->bd_disk->queue; |
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h index c28050136164..1d68428c925d 100644 --- a/include/linux/dcookies.h +++ b/include/linux/dcookies.h | |||
@@ -48,12 +48,12 @@ int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt, | |||
48 | 48 | ||
49 | #else | 49 | #else |
50 | 50 | ||
51 | struct dcookie_user * dcookie_register(void) | 51 | static inline struct dcookie_user * dcookie_register(void) |
52 | { | 52 | { |
53 | return NULL; | 53 | return NULL; |
54 | } | 54 | } |
55 | 55 | ||
56 | void dcookie_unregister(struct dcookie_user * user) | 56 | static inline void dcookie_unregister(struct dcookie_user * user) |
57 | { | 57 | { |
58 | return; | 58 | return; |
59 | } | 59 | } |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f9adf75fd9b4..67e6732d4fdc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -993,8 +993,8 @@ struct inode_operations { | |||
993 | int (*rename) (struct inode *, struct dentry *, | 993 | int (*rename) (struct inode *, struct dentry *, |
994 | struct inode *, struct dentry *); | 994 | struct inode *, struct dentry *); |
995 | int (*readlink) (struct dentry *, char __user *,int); | 995 | int (*readlink) (struct dentry *, char __user *,int); |
996 | int (*follow_link) (struct dentry *, struct nameidata *); | 996 | void * (*follow_link) (struct dentry *, struct nameidata *); |
997 | void (*put_link) (struct dentry *, struct nameidata *); | 997 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
998 | void (*truncate) (struct inode *); | 998 | void (*truncate) (struct inode *); |
999 | int (*permission) (struct inode *, int, struct nameidata *); | 999 | int (*permission) (struct inode *, int, struct nameidata *); |
1000 | int (*setattr) (struct dentry *, struct iattr *); | 1000 | int (*setattr) (struct dentry *, struct iattr *); |
@@ -1602,8 +1602,8 @@ extern struct file_operations generic_ro_fops; | |||
1602 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); | 1602 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); |
1603 | extern int vfs_follow_link(struct nameidata *, const char *); | 1603 | extern int vfs_follow_link(struct nameidata *, const char *); |
1604 | extern int page_readlink(struct dentry *, char __user *, int); | 1604 | extern int page_readlink(struct dentry *, char __user *, int); |
1605 | extern int page_follow_link_light(struct dentry *, struct nameidata *); | 1605 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
1606 | extern void page_put_link(struct dentry *, struct nameidata *); | 1606 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |
1607 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 1607 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
1608 | extern struct inode_operations page_symlink_inode_operations; | 1608 | extern struct inode_operations page_symlink_inode_operations; |
1609 | extern int generic_readlink(struct dentry *, char __user *, int); | 1609 | extern int generic_readlink(struct dentry *, char __user *, int); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index d07a92c94776..03b8e7932b83 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 22 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
23 | const char *old_name, const char *new_name, | 23 | const char *old_name, const char *new_name, |
24 | int isdir) | 24 | int isdir, struct inode *target, struct inode *source) |
25 | { | 25 | { |
26 | u32 cookie = inotify_get_cookie(); | 26 | u32 cookie = inotify_get_cookie(); |
27 | 27 | ||
@@ -36,31 +36,34 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
36 | isdir = IN_ISDIR; | 36 | isdir = IN_ISDIR; |
37 | inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); | 37 | inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name); |
38 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); | 38 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name); |
39 | |||
40 | if (target) { | ||
41 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL); | ||
42 | inotify_inode_is_dead(target); | ||
43 | } | ||
44 | |||
45 | if (source) { | ||
46 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); | ||
47 | } | ||
39 | } | 48 | } |
40 | 49 | ||
41 | /* | 50 | /* |
42 | * fsnotify_unlink - file was unlinked | 51 | * fsnotify_nameremove - a filename was removed from a directory |
43 | */ | 52 | */ |
44 | static inline void fsnotify_unlink(struct dentry *dentry, struct inode *dir) | 53 | static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) |
45 | { | 54 | { |
46 | struct inode *inode = dentry->d_inode; | 55 | if (isdir) |
47 | 56 | isdir = IN_ISDIR; | |
48 | inode_dir_notify(dir, DN_DELETE); | 57 | dnotify_parent(dentry, DN_DELETE); |
49 | inotify_inode_queue_event(dir, IN_DELETE, 0, dentry->d_name.name); | 58 | inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name); |
50 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); | ||
51 | |||
52 | inotify_inode_is_dead(inode); | ||
53 | } | 59 | } |
54 | 60 | ||
55 | /* | 61 | /* |
56 | * fsnotify_rmdir - directory was removed | 62 | * fsnotify_inoderemove - an inode is going away |
57 | */ | 63 | */ |
58 | static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode, | 64 | static inline void fsnotify_inoderemove(struct inode *inode) |
59 | struct inode *dir) | ||
60 | { | 65 | { |
61 | inode_dir_notify(dir, DN_DELETE); | 66 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); |
62 | inotify_inode_queue_event(dir,IN_DELETE|IN_ISDIR,0,dentry->d_name.name); | ||
63 | inotify_inode_queue_event(inode, IN_DELETE_SELF | IN_ISDIR, 0, NULL); | ||
64 | inotify_inode_is_dead(inode); | 67 | inotify_inode_is_dead(inode); |
65 | } | 68 | } |
66 | 69 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 92129078d4f3..a6dbb51ecd7b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1501,4 +1501,10 @@ extern struct bus_type ide_bus_type; | |||
1501 | #define ide_id_has_flush_cache_ext(id) \ | 1501 | #define ide_id_has_flush_cache_ext(id) \ |
1502 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) | 1502 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) |
1503 | 1503 | ||
1504 | static inline int hwif_to_node(ide_hwif_t *hwif) | ||
1505 | { | ||
1506 | struct pci_dev *dev = hwif->pci_dev; | ||
1507 | return dev ? pcibus_to_node(dev->bus) : -1; | ||
1508 | } | ||
1509 | |||
1504 | #endif /* _IDE_H */ | 1510 | #endif /* _IDE_H */ |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index a40c2bf0408e..93bb3afe646b 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -35,6 +35,7 @@ struct inotify_event { | |||
35 | #define IN_CREATE 0x00000100 /* Subfile was created */ | 35 | #define IN_CREATE 0x00000100 /* Subfile was created */ |
36 | #define IN_DELETE 0x00000200 /* Subfile was deleted */ | 36 | #define IN_DELETE 0x00000200 /* Subfile was deleted */ |
37 | #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ | 37 | #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ |
38 | #define IN_MOVE_SELF 0x00000800 /* Self was moved */ | ||
38 | 39 | ||
39 | /* the following are legal events. they are sent as needed to any watch */ | 40 | /* the following are legal events. they are sent as needed to any watch */ |
40 | #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ | 41 | #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ |
@@ -56,7 +57,8 @@ struct inotify_event { | |||
56 | */ | 57 | */ |
57 | #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ | 58 | #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ |
58 | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ | 59 | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ |
59 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF) | 60 | IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \ |
61 | IN_MOVE_SELF) | ||
60 | 62 | ||
61 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
62 | 64 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6eb7f48317f8..82d7024f0765 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -625,10 +625,16 @@ static inline int page_mapped(struct page *page) | |||
625 | * Used to decide whether a process gets delivered SIGBUS or | 625 | * Used to decide whether a process gets delivered SIGBUS or |
626 | * just gets major/minor fault counters bumped up. | 626 | * just gets major/minor fault counters bumped up. |
627 | */ | 627 | */ |
628 | #define VM_FAULT_OOM (-1) | 628 | #define VM_FAULT_OOM 0x00 |
629 | #define VM_FAULT_SIGBUS 0 | 629 | #define VM_FAULT_SIGBUS 0x01 |
630 | #define VM_FAULT_MINOR 1 | 630 | #define VM_FAULT_MINOR 0x02 |
631 | #define VM_FAULT_MAJOR 2 | 631 | #define VM_FAULT_MAJOR 0x03 |
632 | |||
633 | /* | ||
634 | * Special case for get_user_pages. | ||
635 | * Must be in a distinct bit from the above VM_FAULT_ flags. | ||
636 | */ | ||
637 | #define VM_FAULT_WRITE 0x10 | ||
632 | 638 | ||
633 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 639 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
634 | 640 | ||
@@ -704,7 +710,13 @@ extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsign | |||
704 | extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); | 710 | extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); |
705 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); | 711 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); |
706 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); | 712 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); |
707 | extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); | 713 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); |
714 | |||
715 | static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) | ||
716 | { | ||
717 | return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE); | ||
718 | } | ||
719 | |||
708 | extern int make_pages_present(unsigned long addr, unsigned long end); | 720 | extern int make_pages_present(unsigned long addr, unsigned long end); |
709 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 721 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
710 | void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); | 722 | void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 70c2a9dc4b2b..6552b71bfa73 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -12,15 +12,13 @@ | |||
12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ | 12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ |
13 | #define NETLINK_XFRM 6 /* ipsec */ | 13 | #define NETLINK_XFRM 6 /* ipsec */ |
14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ | 14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ |
15 | #define NETLINK_ARPD 8 | 15 | #define NETLINK_ISCSI 8 /* Open-iSCSI */ |
16 | #define NETLINK_AUDIT 9 /* auditing */ | 16 | #define NETLINK_AUDIT 9 /* auditing */ |
17 | #define NETLINK_FIB_LOOKUP 10 | 17 | #define NETLINK_FIB_LOOKUP 10 |
18 | #define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ | ||
19 | #define NETLINK_NETFILTER 12 /* netfilter subsystem */ | 18 | #define NETLINK_NETFILTER 12 /* netfilter subsystem */ |
20 | #define NETLINK_IP6_FW 13 | 19 | #define NETLINK_IP6_FW 13 |
21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 20 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 21 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
23 | #define NETLINK_TAPBASE 16 /* 16 to 31 are ethertap */ | ||
24 | 22 | ||
25 | #define MAX_LINKS 32 | 23 | #define MAX_LINKS 32 |
26 | 24 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index bcd0ac33f592..5ade54a78dbb 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/netdevice.h> | 10 | #include <linux/netdevice.h> |
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/rcupdate.h> | ||
12 | #include <linux/list.h> | 13 | #include <linux/list.h> |
13 | 14 | ||
14 | struct netpoll; | 15 | struct netpoll; |
@@ -26,6 +27,7 @@ struct netpoll { | |||
26 | struct netpoll_info { | 27 | struct netpoll_info { |
27 | spinlock_t poll_lock; | 28 | spinlock_t poll_lock; |
28 | int poll_owner; | 29 | int poll_owner; |
30 | int tries; | ||
29 | int rx_flags; | 31 | int rx_flags; |
30 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
31 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ |
@@ -60,25 +62,31 @@ static inline int netpoll_rx(struct sk_buff *skb) | |||
60 | return ret; | 62 | return ret; |
61 | } | 63 | } |
62 | 64 | ||
63 | static inline void netpoll_poll_lock(struct net_device *dev) | 65 | static inline void *netpoll_poll_lock(struct net_device *dev) |
64 | { | 66 | { |
67 | rcu_read_lock(); /* deal with race on ->npinfo */ | ||
65 | if (dev->npinfo) { | 68 | if (dev->npinfo) { |
66 | spin_lock(&dev->npinfo->poll_lock); | 69 | spin_lock(&dev->npinfo->poll_lock); |
67 | dev->npinfo->poll_owner = smp_processor_id(); | 70 | dev->npinfo->poll_owner = smp_processor_id(); |
71 | return dev->npinfo; | ||
68 | } | 72 | } |
73 | return NULL; | ||
69 | } | 74 | } |
70 | 75 | ||
71 | static inline void netpoll_poll_unlock(struct net_device *dev) | 76 | static inline void netpoll_poll_unlock(void *have) |
72 | { | 77 | { |
73 | if (dev->npinfo) { | 78 | struct netpoll_info *npi = have; |
74 | dev->npinfo->poll_owner = -1; | 79 | |
75 | spin_unlock(&dev->npinfo->poll_lock); | 80 | if (npi) { |
81 | npi->poll_owner = -1; | ||
82 | spin_unlock(&npi->poll_lock); | ||
76 | } | 83 | } |
84 | rcu_read_unlock(); | ||
77 | } | 85 | } |
78 | 86 | ||
79 | #else | 87 | #else |
80 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
81 | #define netpoll_poll_lock(a) | 89 | #define netpoll_poll_lock(a) 0 |
82 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
83 | #endif | 91 | #endif |
84 | 92 | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 8ea249110fb0..9a6047ff1b25 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -112,7 +112,8 @@ struct nfs_inode { | |||
112 | /* | 112 | /* |
113 | * Various flags | 113 | * Various flags |
114 | */ | 114 | */ |
115 | unsigned int flags; | 115 | unsigned long flags; /* atomic bit ops */ |
116 | unsigned long cache_validity; /* bit mask */ | ||
116 | 117 | ||
117 | /* | 118 | /* |
118 | * read_cache_jiffies is when we started read-caching this inode, | 119 | * read_cache_jiffies is when we started read-caching this inode, |
@@ -174,8 +175,6 @@ struct nfs_inode { | |||
174 | /* Open contexts for shared mmap writes */ | 175 | /* Open contexts for shared mmap writes */ |
175 | struct list_head open_files; | 176 | struct list_head open_files; |
176 | 177 | ||
177 | wait_queue_head_t nfs_i_wait; | ||
178 | |||
179 | #ifdef CONFIG_NFS_V4 | 178 | #ifdef CONFIG_NFS_V4 |
180 | struct nfs4_cached_acl *nfs4_acl; | 179 | struct nfs4_cached_acl *nfs4_acl; |
181 | /* NFSv4 state */ | 180 | /* NFSv4 state */ |
@@ -188,17 +187,21 @@ struct nfs_inode { | |||
188 | }; | 187 | }; |
189 | 188 | ||
190 | /* | 189 | /* |
191 | * Legal inode flag values | 190 | * Cache validity bit flags |
192 | */ | 191 | */ |
193 | #define NFS_INO_STALE 0x0001 /* possible stale inode */ | 192 | #define NFS_INO_INVALID_ATTR 0x0001 /* cached attrs are invalid */ |
194 | #define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */ | 193 | #define NFS_INO_INVALID_DATA 0x0002 /* cached data is invalid */ |
195 | #define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */ | 194 | #define NFS_INO_INVALID_ATIME 0x0004 /* cached atime is invalid */ |
196 | #define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */ | 195 | #define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ |
197 | #define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */ | 196 | #define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ |
198 | #define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */ | 197 | #define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ |
199 | #define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */ | 198 | |
200 | #define NFS_INO_INVALID_ACL 0x0080 /* cached acls are invalid */ | 199 | /* |
201 | #define NFS_INO_REVAL_PAGECACHE 0x1000 /* must revalidate pagecache */ | 200 | * Bit offsets in flags field |
201 | */ | ||
202 | #define NFS_INO_REVALIDATING (0) /* revalidating attrs */ | ||
203 | #define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ | ||
204 | #define NFS_INO_STALE (2) /* possible stale inode */ | ||
202 | 205 | ||
203 | static inline struct nfs_inode *NFS_I(struct inode *inode) | 206 | static inline struct nfs_inode *NFS_I(struct inode *inode) |
204 | { | 207 | { |
@@ -224,8 +227,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode) | |||
224 | #define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) | 227 | #define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) |
225 | 228 | ||
226 | #define NFS_FLAGS(inode) (NFS_I(inode)->flags) | 229 | #define NFS_FLAGS(inode) (NFS_I(inode)->flags) |
227 | #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING) | 230 | #define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode))) |
228 | #define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE) | ||
229 | 231 | ||
230 | #define NFS_FILEID(inode) (NFS_I(inode)->fileid) | 232 | #define NFS_FILEID(inode) (NFS_I(inode)->fileid) |
231 | 233 | ||
@@ -236,8 +238,11 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
236 | 238 | ||
237 | static inline void NFS_CACHEINV(struct inode *inode) | 239 | static inline void NFS_CACHEINV(struct inode *inode) |
238 | { | 240 | { |
239 | if (!nfs_caches_unstable(inode)) | 241 | if (!nfs_caches_unstable(inode)) { |
240 | NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | 242 | spin_lock(&inode->i_lock); |
243 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
244 | spin_unlock(&inode->i_lock); | ||
245 | } | ||
241 | } | 246 | } |
242 | 247 | ||
243 | static inline int nfs_server_capable(struct inode *inode, int cap) | 248 | static inline int nfs_server_capable(struct inode *inode, int cap) |
@@ -247,7 +252,7 @@ static inline int nfs_server_capable(struct inode *inode, int cap) | |||
247 | 252 | ||
248 | static inline int NFS_USE_READDIRPLUS(struct inode *inode) | 253 | static inline int NFS_USE_READDIRPLUS(struct inode *inode) |
249 | { | 254 | { |
250 | return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS; | 255 | return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); |
251 | } | 256 | } |
252 | 257 | ||
253 | /** | 258 | /** |
@@ -292,6 +297,7 @@ extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); | |||
292 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); | 297 | extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); |
293 | extern void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); | 298 | extern void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); |
294 | extern int nfs_setattr(struct dentry *, struct iattr *); | 299 | extern int nfs_setattr(struct dentry *, struct iattr *); |
300 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | ||
295 | extern void nfs_begin_attr_update(struct inode *); | 301 | extern void nfs_begin_attr_update(struct inode *); |
296 | extern void nfs_end_attr_update(struct inode *); | 302 | extern void nfs_end_attr_update(struct inode *); |
297 | extern void nfs_begin_data_update(struct inode *); | 303 | extern void nfs_begin_data_update(struct inode *); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8621cf42b46f..bc4c40000c0d 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -556,7 +556,8 @@ struct pci_dev { | |||
556 | /* keep track of device state */ | 556 | /* keep track of device state */ |
557 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | 557 | unsigned int is_enabled:1; /* pci_enable_device has been called */ |
558 | unsigned int is_busmaster:1; /* device is busmaster */ | 558 | unsigned int is_busmaster:1; /* device is busmaster */ |
559 | 559 | unsigned int no_msi:1; /* device may not use msi */ | |
560 | |||
560 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 561 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
561 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 562 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
562 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ | 563 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index bc4cc10fabe9..927ed487630d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -881,7 +881,7 @@ | |||
881 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e | 881 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e |
882 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 | 882 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 |
883 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 | 883 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 |
884 | #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 | 884 | #define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 |
885 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 | 885 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 |
886 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b | 886 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b |
887 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e | 887 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e |
@@ -1580,6 +1580,7 @@ | |||
1580 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 | 1580 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 |
1581 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 | 1581 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 |
1582 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1582 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
1583 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 | ||
1583 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 | 1584 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 |
1584 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 | 1585 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 |
1585 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB | 1586 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB |
@@ -2184,6 +2185,9 @@ | |||
2184 | #define PCI_VENDOR_ID_SIBYTE 0x166d | 2185 | #define PCI_VENDOR_ID_SIBYTE 0x166d |
2185 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 | 2186 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 |
2186 | 2187 | ||
2188 | #define PCI_VENDOR_ID_NETCELL 0x169c | ||
2189 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | ||
2190 | |||
2187 | #define PCI_VENDOR_ID_LINKSYS 0x1737 | 2191 | #define PCI_VENDOR_ID_LINKSYS 0x1737 |
2188 | #define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 | 2192 | #define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 |
2189 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 | 2193 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 |
@@ -2281,6 +2285,11 @@ | |||
2281 | #define PCI_VENDOR_ID_INTEL 0x8086 | 2285 | #define PCI_VENDOR_ID_INTEL 0x8086 |
2282 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 | 2286 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 |
2283 | #define PCI_DEVICE_ID_INTEL_21145 0x0039 | 2287 | #define PCI_DEVICE_ID_INTEL_21145 0x0039 |
2288 | #define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 | ||
2289 | #define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 | ||
2290 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 | ||
2291 | #define PCI_DEVICE_ID_INTEL_PXH_1 0x032A | ||
2292 | #define PCI_DEVICE_ID_INTEL_PXHV 0x032C | ||
2284 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 | 2293 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 |
2285 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 | 2294 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 |
2286 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 | 2295 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 6213e976eade..4bf1659f8aa8 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -248,6 +248,7 @@ struct bitmap { | |||
248 | 248 | ||
249 | /* these are used only by md/bitmap */ | 249 | /* these are used only by md/bitmap */ |
250 | int bitmap_create(mddev_t *mddev); | 250 | int bitmap_create(mddev_t *mddev); |
251 | void bitmap_flush(mddev_t *mddev); | ||
251 | void bitmap_destroy(mddev_t *mddev); | 252 | void bitmap_destroy(mddev_t *mddev); |
252 | int bitmap_active(struct bitmap *bitmap); | 253 | int bitmap_active(struct bitmap *bitmap); |
253 | 254 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0061c9470482..948527e42a60 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -255,7 +255,7 @@ struct sk_buff { | |||
255 | nohdr:1; | 255 | nohdr:1; |
256 | /* 3 bits spare */ | 256 | /* 3 bits spare */ |
257 | __u8 pkt_type; | 257 | __u8 pkt_type; |
258 | __u16 protocol; | 258 | __be16 protocol; |
259 | 259 | ||
260 | void (*destructor)(struct sk_buff *skb); | 260 | void (*destructor)(struct sk_buff *skb); |
261 | #ifdef CONFIG_NETFILTER | 261 | #ifdef CONFIG_NETFILTER |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 34ec3e8d99b3..23448d0fb5bc 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -177,6 +177,7 @@ typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem); | |||
177 | struct xdr_array2_desc { | 177 | struct xdr_array2_desc { |
178 | unsigned int elem_size; | 178 | unsigned int elem_size; |
179 | unsigned int array_len; | 179 | unsigned int array_len; |
180 | unsigned int array_maxlen; | ||
180 | xdr_xcode_elem_t xcode; | 181 | xdr_xcode_elem_t xcode; |
181 | }; | 182 | }; |
182 | 183 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 239f520cc49e..bfe3e763ccf2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/pagemap.h> | ||
11 | 10 | ||
12 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
13 | #include <asm/page.h> | 12 | #include <asm/page.h> |
@@ -255,6 +254,8 @@ static inline void put_swap_token(struct mm_struct *mm) | |||
255 | 254 | ||
256 | #define si_swapinfo(val) \ | 255 | #define si_swapinfo(val) \ |
257 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) | 256 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) |
257 | /* only sparc can not include linux/pagemap.h in this file | ||
258 | * so leave page_cache_release and release_pages undeclared... */ | ||
258 | #define free_page_and_swap_cache(page) \ | 259 | #define free_page_and_swap_cache(page) \ |
259 | page_cache_release(page) | 260 | page_cache_release(page) |
260 | #define free_pages_and_swap_cache(pages, nr) \ | 261 | #define free_pages_and_swap_cache(pages, nr) \ |
diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 850076ea14d3..74f7b78c22d2 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h | |||
@@ -506,6 +506,11 @@ extern int zlib_deflateReset (z_streamp strm); | |||
506 | stream state was inconsistent (such as zalloc or state being NULL). | 506 | stream state was inconsistent (such as zalloc or state being NULL). |
507 | */ | 507 | */ |
508 | 508 | ||
509 | static inline unsigned long deflateBound(unsigned long s) | ||
510 | { | ||
511 | return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; | ||
512 | } | ||
513 | |||
509 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); | 514 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); |
510 | /* | 515 | /* |
511 | Dynamically update the compression level and compression strategy. The | 516 | Dynamically update the compression level and compression strategy. The |
diff --git a/include/media/tuner.h b/include/media/tuner.h index d8c0a5563289..eeaa15ddee85 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | /* $Id: tuner.h,v 1.42 2005/07/06 09:42:19 mchehab Exp $ | 2 | /* $Id: tuner.h,v 1.45 2005/07/28 18:41:21 mchehab Exp $ |
3 | * | 3 | * |
4 | tuner.h - definition for different tuners | 4 | tuner.h - definition for different tuners |
5 | 5 | ||
@@ -108,6 +108,8 @@ | |||
108 | 108 | ||
109 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ | 109 | #define TUNER_TEA5767 62 /* Only FM Radio Tuner */ |
110 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 | 110 | #define TUNER_PHILIPS_FMD1216ME_MK3 63 |
111 | #define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ | ||
112 | #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ | ||
111 | 113 | ||
112 | #define NOTUNER 0 | 114 | #define NOTUNER 0 |
113 | #define PAL 1 /* PAL_BG */ | 115 | #define PAL 1 /* PAL_BG */ |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 828a3a93dda1..3696f988a9f1 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -139,11 +139,25 @@ enum { | |||
139 | #define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ | 139 | #define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ |
140 | 140 | ||
141 | typedef struct ax25_uid_assoc { | 141 | typedef struct ax25_uid_assoc { |
142 | struct ax25_uid_assoc *next; | 142 | struct hlist_node uid_node; |
143 | atomic_t refcount; | ||
143 | uid_t uid; | 144 | uid_t uid; |
144 | ax25_address call; | 145 | ax25_address call; |
145 | } ax25_uid_assoc; | 146 | } ax25_uid_assoc; |
146 | 147 | ||
148 | #define ax25_uid_for_each(__ax25, node, list) \ | ||
149 | hlist_for_each_entry(__ax25, node, list, uid_node) | ||
150 | |||
151 | #define ax25_uid_hold(ax25) \ | ||
152 | atomic_inc(&((ax25)->refcount)) | ||
153 | |||
154 | static inline void ax25_uid_put(ax25_uid_assoc *assoc) | ||
155 | { | ||
156 | if (atomic_dec_and_test(&assoc->refcount)) { | ||
157 | kfree(assoc); | ||
158 | } | ||
159 | } | ||
160 | |||
147 | typedef struct { | 161 | typedef struct { |
148 | ax25_address calls[AX25_MAX_DIGIS]; | 162 | ax25_address calls[AX25_MAX_DIGIS]; |
149 | unsigned char repeated[AX25_MAX_DIGIS]; | 163 | unsigned char repeated[AX25_MAX_DIGIS]; |
@@ -376,7 +390,7 @@ extern unsigned long ax25_display_timer(struct timer_list *); | |||
376 | 390 | ||
377 | /* ax25_uid.c */ | 391 | /* ax25_uid.c */ |
378 | extern int ax25_uid_policy; | 392 | extern int ax25_uid_policy; |
379 | extern ax25_address *ax25_findbyuid(uid_t); | 393 | extern ax25_uid_assoc *ax25_findbyuid(uid_t); |
380 | extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *); | 394 | extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *); |
381 | extern struct file_operations ax25_uid_fops; | 395 | extern struct file_operations ax25_uid_fops; |
382 | extern void ax25_uid_free(void); | 396 | extern void ax25_uid_free(void); |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 42a84c53678b..06b24f637026 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -57,12 +57,6 @@ | |||
57 | #define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) | 57 | #define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) |
58 | #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) | 58 | #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) |
59 | 59 | ||
60 | #ifdef HCI_DATA_DUMP | ||
61 | #define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len) | ||
62 | #else | ||
63 | #define BT_DMP(D...) | ||
64 | #endif | ||
65 | |||
66 | extern struct proc_dir_entry *proc_bt; | 60 | extern struct proc_dir_entry *proc_bt; |
67 | 61 | ||
68 | /* Connection and socket states */ | 62 | /* Connection and socket states */ |
@@ -174,8 +168,6 @@ static inline int skb_frags_no(struct sk_buff *skb) | |||
174 | return n; | 168 | return n; |
175 | } | 169 | } |
176 | 170 | ||
177 | void bt_dump(char *pref, __u8 *buf, int count); | ||
178 | |||
179 | int bt_err(__u16 code); | 171 | int bt_err(__u16 code); |
180 | 172 | ||
181 | #endif /* __BLUETOOTH_H */ | 173 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/sock.h b/include/net/sock.h index a1042d08becd..e9b1dbab90d0 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -384,6 +384,11 @@ enum sock_flags { | |||
384 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 384 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | ||
388 | { | ||
389 | nsk->sk_flags = osk->sk_flags; | ||
390 | } | ||
391 | |||
387 | static inline void sock_set_flag(struct sock *sk, enum sock_flags flag) | 392 | static inline void sock_set_flag(struct sock *sk, enum sock_flags flag) |
388 | { | 393 | { |
389 | __set_bit(flag, &sk->sk_flags); | 394 | __set_bit(flag, &sk->sk_flags); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index f4f9aba07ac2..5010f0c5a56e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1236,7 +1236,7 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp) | |||
1236 | tp->left_out = tp->sacked_out + tp->lost_out; | 1236 | tp->left_out = tp->sacked_out + tp->lost_out; |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | /* Set slow start threshould and cwnd not falling to slow start */ | 1239 | /* Set slow start threshold and cwnd not falling to slow start */ |
1240 | static inline void __tcp_enter_cwr(struct tcp_sock *tp) | 1240 | static inline void __tcp_enter_cwr(struct tcp_sock *tp) |
1241 | { | 1241 | { |
1242 | tp->undo_marker = 0; | 1242 | tp->undo_marker = 0; |
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index 98719407d554..d64903a617c3 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h | |||
@@ -54,6 +54,9 @@ extern void scsi_do_req(struct scsi_request *, const void *cmnd, | |||
54 | void *buffer, unsigned bufflen, | 54 | void *buffer, unsigned bufflen, |
55 | void (*done) (struct scsi_cmnd *), | 55 | void (*done) (struct scsi_cmnd *), |
56 | int timeout, int retries); | 56 | int timeout, int retries); |
57 | extern int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, | ||
58 | int data_direction, void *buffer, unsigned bufflen, | ||
59 | unsigned char *sense, int timeout, int retries); | ||
57 | 60 | ||
58 | struct scsi_mode_data { | 61 | struct scsi_mode_data { |
59 | __u32 length; | 62 | __u32 length; |
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index a4f1837a33b1..f6e0bb484c63 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -29,6 +29,14 @@ struct scsi_transport_template { | |||
29 | struct transport_container target_attrs; | 29 | struct transport_container target_attrs; |
30 | struct transport_container device_attrs; | 30 | struct transport_container device_attrs; |
31 | 31 | ||
32 | /* | ||
33 | * If set, call target_parent prior to allocating a scsi_target, | ||
34 | * so we get the appropriate parent for the target. This function | ||
35 | * is required for transports like FC and iSCSI that do not put the | ||
36 | * scsi_target under scsi_host. | ||
37 | */ | ||
38 | struct device *(*target_parent)(struct Scsi_Host *, int, uint); | ||
39 | |||
32 | /* The size of the specific transport attribute structure (a | 40 | /* The size of the specific transport attribute structure (a |
33 | * space of this size will be left at the end of the | 41 | * space of this size will be left at the end of the |
34 | * scsi_* structure */ | 42 | * scsi_* structure */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 38b357fc8958..f72b3ef515e2 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -360,11 +360,13 @@ int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd); | |||
360 | 360 | ||
361 | /* isadma.c */ | 361 | /* isadma.c */ |
362 | 362 | ||
363 | #ifdef CONFIG_ISA_DMA_API | ||
363 | #define DMA_MODE_NO_ENABLE 0x0100 | 364 | #define DMA_MODE_NO_ENABLE 0x0100 |
364 | 365 | ||
365 | void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode); | 366 | void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode); |
366 | void snd_dma_disable(unsigned long dma); | 367 | void snd_dma_disable(unsigned long dma); |
367 | unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | 368 | unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); |
369 | #endif | ||
368 | 370 | ||
369 | /* misc.c */ | 371 | /* misc.c */ |
370 | 372 | ||
@@ -895,7 +895,7 @@ static inline void lock_semundo(void) | |||
895 | struct sem_undo_list *undo_list; | 895 | struct sem_undo_list *undo_list; |
896 | 896 | ||
897 | undo_list = current->sysvsem.undo_list; | 897 | undo_list = current->sysvsem.undo_list; |
898 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 898 | if (undo_list) |
899 | spin_lock(&undo_list->lock); | 899 | spin_lock(&undo_list->lock); |
900 | } | 900 | } |
901 | 901 | ||
@@ -915,7 +915,7 @@ static inline void unlock_semundo(void) | |||
915 | struct sem_undo_list *undo_list; | 915 | struct sem_undo_list *undo_list; |
916 | 916 | ||
917 | undo_list = current->sysvsem.undo_list; | 917 | undo_list = current->sysvsem.undo_list; |
918 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 918 | if (undo_list) |
919 | spin_unlock(&undo_list->lock); | 919 | spin_unlock(&undo_list->lock); |
920 | } | 920 | } |
921 | 921 | ||
@@ -943,9 +943,7 @@ static inline int get_undo_list(struct sem_undo_list **undo_listp) | |||
943 | if (undo_list == NULL) | 943 | if (undo_list == NULL) |
944 | return -ENOMEM; | 944 | return -ENOMEM; |
945 | memset(undo_list, 0, size); | 945 | memset(undo_list, 0, size); |
946 | /* don't initialize unodhd->lock here. It's done | 946 | spin_lock_init(&undo_list->lock); |
947 | * in copy_semundo() instead. | ||
948 | */ | ||
949 | atomic_set(&undo_list->refcnt, 1); | 947 | atomic_set(&undo_list->refcnt, 1); |
950 | current->sysvsem.undo_list = undo_list; | 948 | current->sysvsem.undo_list = undo_list; |
951 | } | 949 | } |
@@ -1231,8 +1229,6 @@ int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | |||
1231 | error = get_undo_list(&undo_list); | 1229 | error = get_undo_list(&undo_list); |
1232 | if (error) | 1230 | if (error) |
1233 | return error; | 1231 | return error; |
1234 | if (atomic_read(&undo_list->refcnt) == 1) | ||
1235 | spin_lock_init(&undo_list->lock); | ||
1236 | atomic_inc(&undo_list->refcnt); | 1232 | atomic_inc(&undo_list->refcnt); |
1237 | tsk->sysvsem.undo_list = undo_list; | 1233 | tsk->sysvsem.undo_list = undo_list; |
1238 | } else | 1234 | } else |
@@ -170,7 +170,7 @@ static struct vm_operations_struct shm_vm_ops = { | |||
170 | .open = shm_open, /* callback for a new vm-area open */ | 170 | .open = shm_open, /* callback for a new vm-area open */ |
171 | .close = shm_close, /* callback for when the vm-area is released */ | 171 | .close = shm_close, /* callback for when the vm-area is released */ |
172 | .nopage = shmem_nopage, | 172 | .nopage = shmem_nopage, |
173 | #ifdef CONFIG_NUMA | 173 | #if defined(CONFIG_NUMA) && defined(CONFIG_SHMEM) |
174 | .set_policy = shmem_set_policy, | 174 | .set_policy = shmem_set_policy, |
175 | .get_policy = shmem_get_policy, | 175 | .get_policy = shmem_get_policy, |
176 | #endif | 176 | #endif |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 805fb9097318..8ab1b4e518b8 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -398,21 +398,31 @@ static int cpuset_path(const struct cpuset *cs, char *buf, int buflen) | |||
398 | * to continue to serve a useful existence. Next time it's released, | 398 | * to continue to serve a useful existence. Next time it's released, |
399 | * we will get notified again, if it still has 'notify_on_release' set. | 399 | * we will get notified again, if it still has 'notify_on_release' set. |
400 | * | 400 | * |
401 | * Note final arg to call_usermodehelper() is 0 - that means | 401 | * The final arg to call_usermodehelper() is 0, which means don't |
402 | * don't wait. Since we are holding the global cpuset_sem here, | 402 | * wait. The separate /sbin/cpuset_release_agent task is forked by |
403 | * and we are asking another thread (started from keventd) to rmdir a | 403 | * call_usermodehelper(), then control in this thread returns here, |
404 | * cpuset, we can't wait - or we'd deadlock with the removing thread | 404 | * without waiting for the release agent task. We don't bother to |
405 | * on cpuset_sem. | 405 | * wait because the caller of this routine has no use for the exit |
406 | * status of the /sbin/cpuset_release_agent task, so no sense holding | ||
407 | * our caller up for that. | ||
408 | * | ||
409 | * The simple act of forking that task might require more memory, | ||
410 | * which might need cpuset_sem. So this routine must be called while | ||
411 | * cpuset_sem is not held, to avoid a possible deadlock. See also | ||
412 | * comments for check_for_release(), below. | ||
406 | */ | 413 | */ |
407 | 414 | ||
408 | static int cpuset_release_agent(char *cpuset_str) | 415 | static void cpuset_release_agent(const char *pathbuf) |
409 | { | 416 | { |
410 | char *argv[3], *envp[3]; | 417 | char *argv[3], *envp[3]; |
411 | int i; | 418 | int i; |
412 | 419 | ||
420 | if (!pathbuf) | ||
421 | return; | ||
422 | |||
413 | i = 0; | 423 | i = 0; |
414 | argv[i++] = "/sbin/cpuset_release_agent"; | 424 | argv[i++] = "/sbin/cpuset_release_agent"; |
415 | argv[i++] = cpuset_str; | 425 | argv[i++] = (char *)pathbuf; |
416 | argv[i] = NULL; | 426 | argv[i] = NULL; |
417 | 427 | ||
418 | i = 0; | 428 | i = 0; |
@@ -421,17 +431,29 @@ static int cpuset_release_agent(char *cpuset_str) | |||
421 | envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; | 431 | envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; |
422 | envp[i] = NULL; | 432 | envp[i] = NULL; |
423 | 433 | ||
424 | return call_usermodehelper(argv[0], argv, envp, 0); | 434 | call_usermodehelper(argv[0], argv, envp, 0); |
435 | kfree(pathbuf); | ||
425 | } | 436 | } |
426 | 437 | ||
427 | /* | 438 | /* |
428 | * Either cs->count of using tasks transitioned to zero, or the | 439 | * Either cs->count of using tasks transitioned to zero, or the |
429 | * cs->children list of child cpusets just became empty. If this | 440 | * cs->children list of child cpusets just became empty. If this |
430 | * cs is notify_on_release() and now both the user count is zero and | 441 | * cs is notify_on_release() and now both the user count is zero and |
431 | * the list of children is empty, send notice to user land. | 442 | * the list of children is empty, prepare cpuset path in a kmalloc'd |
443 | * buffer, to be returned via ppathbuf, so that the caller can invoke | ||
444 | * cpuset_release_agent() with it later on, once cpuset_sem is dropped. | ||
445 | * Call here with cpuset_sem held. | ||
446 | * | ||
447 | * This check_for_release() routine is responsible for kmalloc'ing | ||
448 | * pathbuf. The above cpuset_release_agent() is responsible for | ||
449 | * kfree'ing pathbuf. The caller of these routines is responsible | ||
450 | * for providing a pathbuf pointer, initialized to NULL, then | ||
451 | * calling check_for_release() with cpuset_sem held and the address | ||
452 | * of the pathbuf pointer, then dropping cpuset_sem, then calling | ||
453 | * cpuset_release_agent() with pathbuf, as set by check_for_release(). | ||
432 | */ | 454 | */ |
433 | 455 | ||
434 | static void check_for_release(struct cpuset *cs) | 456 | static void check_for_release(struct cpuset *cs, char **ppathbuf) |
435 | { | 457 | { |
436 | if (notify_on_release(cs) && atomic_read(&cs->count) == 0 && | 458 | if (notify_on_release(cs) && atomic_read(&cs->count) == 0 && |
437 | list_empty(&cs->children)) { | 459 | list_empty(&cs->children)) { |
@@ -441,10 +463,9 @@ static void check_for_release(struct cpuset *cs) | |||
441 | if (!buf) | 463 | if (!buf) |
442 | return; | 464 | return; |
443 | if (cpuset_path(cs, buf, PAGE_SIZE) < 0) | 465 | if (cpuset_path(cs, buf, PAGE_SIZE) < 0) |
444 | goto out; | 466 | kfree(buf); |
445 | cpuset_release_agent(buf); | 467 | else |
446 | out: | 468 | *ppathbuf = buf; |
447 | kfree(buf); | ||
448 | } | 469 | } |
449 | } | 470 | } |
450 | 471 | ||
@@ -606,6 +627,14 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial) | |||
606 | * Call with cpuset_sem held. May nest a call to the | 627 | * Call with cpuset_sem held. May nest a call to the |
607 | * lock_cpu_hotplug()/unlock_cpu_hotplug() pair. | 628 | * lock_cpu_hotplug()/unlock_cpu_hotplug() pair. |
608 | */ | 629 | */ |
630 | |||
631 | /* | ||
632 | * Hack to avoid 2.6.13 partial node dynamic sched domain bug. | ||
633 | * Disable letting 'cpu_exclusive' cpusets define dynamic sched | ||
634 | * domains, until the sched domain can handle partial nodes. | ||
635 | * Remove this #if hackery when sched domains fixed. | ||
636 | */ | ||
637 | #if 0 | ||
609 | static void update_cpu_domains(struct cpuset *cur) | 638 | static void update_cpu_domains(struct cpuset *cur) |
610 | { | 639 | { |
611 | struct cpuset *c, *par = cur->parent; | 640 | struct cpuset *c, *par = cur->parent; |
@@ -646,6 +675,11 @@ static void update_cpu_domains(struct cpuset *cur) | |||
646 | partition_sched_domains(&pspan, &cspan); | 675 | partition_sched_domains(&pspan, &cspan); |
647 | unlock_cpu_hotplug(); | 676 | unlock_cpu_hotplug(); |
648 | } | 677 | } |
678 | #else | ||
679 | static void update_cpu_domains(struct cpuset *cur) | ||
680 | { | ||
681 | } | ||
682 | #endif | ||
649 | 683 | ||
650 | static int update_cpumask(struct cpuset *cs, char *buf) | 684 | static int update_cpumask(struct cpuset *cs, char *buf) |
651 | { | 685 | { |
@@ -727,14 +761,14 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, char *buf) | |||
727 | return 0; | 761 | return 0; |
728 | } | 762 | } |
729 | 763 | ||
730 | static int attach_task(struct cpuset *cs, char *buf) | 764 | static int attach_task(struct cpuset *cs, char *pidbuf, char **ppathbuf) |
731 | { | 765 | { |
732 | pid_t pid; | 766 | pid_t pid; |
733 | struct task_struct *tsk; | 767 | struct task_struct *tsk; |
734 | struct cpuset *oldcs; | 768 | struct cpuset *oldcs; |
735 | cpumask_t cpus; | 769 | cpumask_t cpus; |
736 | 770 | ||
737 | if (sscanf(buf, "%d", &pid) != 1) | 771 | if (sscanf(pidbuf, "%d", &pid) != 1) |
738 | return -EIO; | 772 | return -EIO; |
739 | if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) | 773 | if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) |
740 | return -ENOSPC; | 774 | return -ENOSPC; |
@@ -777,7 +811,7 @@ static int attach_task(struct cpuset *cs, char *buf) | |||
777 | 811 | ||
778 | put_task_struct(tsk); | 812 | put_task_struct(tsk); |
779 | if (atomic_dec_and_test(&oldcs->count)) | 813 | if (atomic_dec_and_test(&oldcs->count)) |
780 | check_for_release(oldcs); | 814 | check_for_release(oldcs, ppathbuf); |
781 | return 0; | 815 | return 0; |
782 | } | 816 | } |
783 | 817 | ||
@@ -801,6 +835,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
801 | struct cftype *cft = __d_cft(file->f_dentry); | 835 | struct cftype *cft = __d_cft(file->f_dentry); |
802 | cpuset_filetype_t type = cft->private; | 836 | cpuset_filetype_t type = cft->private; |
803 | char *buffer; | 837 | char *buffer; |
838 | char *pathbuf = NULL; | ||
804 | int retval = 0; | 839 | int retval = 0; |
805 | 840 | ||
806 | /* Crude upper limit on largest legitimate cpulist user might write. */ | 841 | /* Crude upper limit on largest legitimate cpulist user might write. */ |
@@ -841,7 +876,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
841 | retval = update_flag(CS_NOTIFY_ON_RELEASE, cs, buffer); | 876 | retval = update_flag(CS_NOTIFY_ON_RELEASE, cs, buffer); |
842 | break; | 877 | break; |
843 | case FILE_TASKLIST: | 878 | case FILE_TASKLIST: |
844 | retval = attach_task(cs, buffer); | 879 | retval = attach_task(cs, buffer, &pathbuf); |
845 | break; | 880 | break; |
846 | default: | 881 | default: |
847 | retval = -EINVAL; | 882 | retval = -EINVAL; |
@@ -852,6 +887,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
852 | retval = nbytes; | 887 | retval = nbytes; |
853 | out2: | 888 | out2: |
854 | up(&cpuset_sem); | 889 | up(&cpuset_sem); |
890 | cpuset_release_agent(pathbuf); | ||
855 | out1: | 891 | out1: |
856 | kfree(buffer); | 892 | kfree(buffer); |
857 | return retval; | 893 | return retval; |
@@ -1357,6 +1393,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1357 | struct cpuset *cs = dentry->d_fsdata; | 1393 | struct cpuset *cs = dentry->d_fsdata; |
1358 | struct dentry *d; | 1394 | struct dentry *d; |
1359 | struct cpuset *parent; | 1395 | struct cpuset *parent; |
1396 | char *pathbuf = NULL; | ||
1360 | 1397 | ||
1361 | /* the vfs holds both inode->i_sem already */ | 1398 | /* the vfs holds both inode->i_sem already */ |
1362 | 1399 | ||
@@ -1376,7 +1413,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1376 | update_cpu_domains(cs); | 1413 | update_cpu_domains(cs); |
1377 | list_del(&cs->sibling); /* delete my sibling from parent->children */ | 1414 | list_del(&cs->sibling); /* delete my sibling from parent->children */ |
1378 | if (list_empty(&parent->children)) | 1415 | if (list_empty(&parent->children)) |
1379 | check_for_release(parent); | 1416 | check_for_release(parent, &pathbuf); |
1380 | spin_lock(&cs->dentry->d_lock); | 1417 | spin_lock(&cs->dentry->d_lock); |
1381 | d = dget(cs->dentry); | 1418 | d = dget(cs->dentry); |
1382 | cs->dentry = NULL; | 1419 | cs->dentry = NULL; |
@@ -1384,6 +1421,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1384 | cpuset_d_remove_dir(d); | 1421 | cpuset_d_remove_dir(d); |
1385 | dput(d); | 1422 | dput(d); |
1386 | up(&cpuset_sem); | 1423 | up(&cpuset_sem); |
1424 | cpuset_release_agent(pathbuf); | ||
1387 | return 0; | 1425 | return 0; |
1388 | } | 1426 | } |
1389 | 1427 | ||
@@ -1483,10 +1521,13 @@ void cpuset_exit(struct task_struct *tsk) | |||
1483 | task_unlock(tsk); | 1521 | task_unlock(tsk); |
1484 | 1522 | ||
1485 | if (notify_on_release(cs)) { | 1523 | if (notify_on_release(cs)) { |
1524 | char *pathbuf = NULL; | ||
1525 | |||
1486 | down(&cpuset_sem); | 1526 | down(&cpuset_sem); |
1487 | if (atomic_dec_and_test(&cs->count)) | 1527 | if (atomic_dec_and_test(&cs->count)) |
1488 | check_for_release(cs); | 1528 | check_for_release(cs, &pathbuf); |
1489 | up(&cpuset_sem); | 1529 | up(&cpuset_sem); |
1530 | cpuset_release_agent(pathbuf); | ||
1490 | } else { | 1531 | } else { |
1491 | atomic_dec(&cs->count); | 1532 | atomic_dec(&cs->count); |
1492 | } | 1533 | } |
diff --git a/kernel/exit.c b/kernel/exit.c index 9d1b10ed0135..5b0fb9f09f21 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -829,8 +829,10 @@ fastcall NORET_TYPE void do_exit(long code) | |||
829 | acct_update_integrals(tsk); | 829 | acct_update_integrals(tsk); |
830 | update_mem_hiwater(tsk); | 830 | update_mem_hiwater(tsk); |
831 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 831 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
832 | if (group_dead) | 832 | if (group_dead) { |
833 | del_timer_sync(&tsk->signal->real_timer); | ||
833 | acct_process(code); | 834 | acct_process(code); |
835 | } | ||
834 | exit_mm(tsk); | 836 | exit_mm(tsk); |
835 | 837 | ||
836 | exit_sem(tsk); | 838 | exit_sem(tsk); |
diff --git a/kernel/module.c b/kernel/module.c index 068e271ab3a5..c32995fbd8fd 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -250,13 +250,18 @@ static inline unsigned int block_size(int val) | |||
250 | /* Created by linker magic */ | 250 | /* Created by linker magic */ |
251 | extern char __per_cpu_start[], __per_cpu_end[]; | 251 | extern char __per_cpu_start[], __per_cpu_end[]; |
252 | 252 | ||
253 | static void *percpu_modalloc(unsigned long size, unsigned long align) | 253 | static void *percpu_modalloc(unsigned long size, unsigned long align, |
254 | const char *name) | ||
254 | { | 255 | { |
255 | unsigned long extra; | 256 | unsigned long extra; |
256 | unsigned int i; | 257 | unsigned int i; |
257 | void *ptr; | 258 | void *ptr; |
258 | 259 | ||
259 | BUG_ON(align > SMP_CACHE_BYTES); | 260 | if (align > SMP_CACHE_BYTES) { |
261 | printk(KERN_WARNING "%s: per-cpu alignment %li > %i\n", | ||
262 | name, align, SMP_CACHE_BYTES); | ||
263 | align = SMP_CACHE_BYTES; | ||
264 | } | ||
260 | 265 | ||
261 | ptr = __per_cpu_start; | 266 | ptr = __per_cpu_start; |
262 | for (i = 0; i < pcpu_num_used; ptr += block_size(pcpu_size[i]), i++) { | 267 | for (i = 0; i < pcpu_num_used; ptr += block_size(pcpu_size[i]), i++) { |
@@ -348,7 +353,8 @@ static int percpu_modinit(void) | |||
348 | } | 353 | } |
349 | __initcall(percpu_modinit); | 354 | __initcall(percpu_modinit); |
350 | #else /* ... !CONFIG_SMP */ | 355 | #else /* ... !CONFIG_SMP */ |
351 | static inline void *percpu_modalloc(unsigned long size, unsigned long align) | 356 | static inline void *percpu_modalloc(unsigned long size, unsigned long align, |
357 | const char *name) | ||
352 | { | 358 | { |
353 | return NULL; | 359 | return NULL; |
354 | } | 360 | } |
@@ -1644,7 +1650,8 @@ static struct module *load_module(void __user *umod, | |||
1644 | if (pcpuindex) { | 1650 | if (pcpuindex) { |
1645 | /* We have a special allocation for this section. */ | 1651 | /* We have a special allocation for this section. */ |
1646 | percpu = percpu_modalloc(sechdrs[pcpuindex].sh_size, | 1652 | percpu = percpu_modalloc(sechdrs[pcpuindex].sh_size, |
1647 | sechdrs[pcpuindex].sh_addralign); | 1653 | sechdrs[pcpuindex].sh_addralign, |
1654 | mod->name); | ||
1648 | if (!percpu) { | 1655 | if (!percpu) { |
1649 | err = -ENOMEM; | 1656 | err = -ENOMEM; |
1650 | goto free_mod; | 1657 | goto free_mod; |
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 10b2ad749d14..38798a2ff994 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -1166,7 +1166,6 @@ void exit_itimers(struct signal_struct *sig) | |||
1166 | tmr = list_entry(sig->posix_timers.next, struct k_itimer, list); | 1166 | tmr = list_entry(sig->posix_timers.next, struct k_itimer, list); |
1167 | itimer_delete(tmr); | 1167 | itimer_delete(tmr); |
1168 | } | 1168 | } |
1169 | del_timer_sync(&sig->real_timer); | ||
1170 | } | 1169 | } |
1171 | 1170 | ||
1172 | /* | 1171 | /* |
diff --git a/kernel/sched.c b/kernel/sched.c index a646e4f36c41..5f889d0cbfcc 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3378,8 +3378,8 @@ EXPORT_SYMBOL(set_user_nice); | |||
3378 | */ | 3378 | */ |
3379 | int can_nice(const task_t *p, const int nice) | 3379 | int can_nice(const task_t *p, const int nice) |
3380 | { | 3380 | { |
3381 | /* convert nice value [19,-20] to rlimit style value [0,39] */ | 3381 | /* convert nice value [19,-20] to rlimit style value [1,40] */ |
3382 | int nice_rlim = 19 - nice; | 3382 | int nice_rlim = 20 - nice; |
3383 | return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || | 3383 | return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || |
3384 | capable(CAP_SYS_NICE)); | 3384 | capable(CAP_SYS_NICE)); |
3385 | } | 3385 | } |
diff --git a/kernel/signal.c b/kernel/signal.c index ca1186eef938..d282fea81138 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -692,7 +692,7 @@ static void handle_stop_signal(int sig, struct task_struct *p) | |||
692 | { | 692 | { |
693 | struct task_struct *t; | 693 | struct task_struct *t; |
694 | 694 | ||
695 | if (p->flags & SIGNAL_GROUP_EXIT) | 695 | if (p->signal->flags & SIGNAL_GROUP_EXIT) |
696 | /* | 696 | /* |
697 | * The process is in the middle of dying already. | 697 | * The process is in the middle of dying already. |
698 | */ | 698 | */ |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 31007d6542cc..b4ab6af1dea8 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -86,7 +86,7 @@ restart: | |||
86 | /* Reset the pending bitmask before enabling irqs */ | 86 | /* Reset the pending bitmask before enabling irqs */ |
87 | local_softirq_pending() = 0; | 87 | local_softirq_pending() = 0; |
88 | 88 | ||
89 | //local_irq_enable(); | 89 | local_irq_enable(); |
90 | 90 | ||
91 | h = softirq_vec; | 91 | h = softirq_vec; |
92 | 92 | ||
@@ -99,7 +99,7 @@ restart: | |||
99 | pending >>= 1; | 99 | pending >>= 1; |
100 | } while (pending); | 100 | } while (pending); |
101 | 101 | ||
102 | //local_irq_disable(); | 102 | local_irq_disable(); |
103 | 103 | ||
104 | pending = local_softirq_pending(); | 104 | pending = local_softirq_pending(); |
105 | if (pending && --max_restart) | 105 | if (pending && --max_restart) |
diff --git a/kernel/sys.c b/kernel/sys.c index 000e81ad2c1d..0bcaed6560ac 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -404,7 +404,6 @@ void kernel_halt(void) | |||
404 | { | 404 | { |
405 | notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL); | 405 | notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL); |
406 | system_state = SYSTEM_HALT; | 406 | system_state = SYSTEM_HALT; |
407 | device_suspend(PMSG_SUSPEND); | ||
408 | device_shutdown(); | 407 | device_shutdown(); |
409 | printk(KERN_EMERG "System halted.\n"); | 408 | printk(KERN_EMERG "System halted.\n"); |
410 | machine_halt(); | 409 | machine_halt(); |
@@ -415,7 +414,6 @@ void kernel_power_off(void) | |||
415 | { | 414 | { |
416 | notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL); | 415 | notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL); |
417 | system_state = SYSTEM_POWER_OFF; | 416 | system_state = SYSTEM_POWER_OFF; |
418 | device_suspend(PMSG_SUSPEND); | ||
419 | device_shutdown(); | 417 | device_shutdown(); |
420 | printk(KERN_EMERG "Power down.\n"); | 418 | printk(KERN_EMERG "Power down.\n"); |
421 | machine_power_off(); | 419 | machine_power_off(); |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 42b40ae5eada..1ab2370e2efa 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -79,7 +79,6 @@ cond_syscall(sys_request_key); | |||
79 | cond_syscall(sys_keyctl); | 79 | cond_syscall(sys_keyctl); |
80 | cond_syscall(compat_sys_keyctl); | 80 | cond_syscall(compat_sys_keyctl); |
81 | cond_syscall(compat_sys_socketcall); | 81 | cond_syscall(compat_sys_socketcall); |
82 | cond_syscall(sys_set_zone_reclaim); | ||
83 | cond_syscall(sys_inotify_init); | 82 | cond_syscall(sys_inotify_init); |
84 | cond_syscall(sys_inotify_add_watch); | 83 | cond_syscall(sys_inotify_add_watch); |
85 | cond_syscall(sys_inotify_rm_watch); | 84 | cond_syscall(sys_inotify_rm_watch); |
diff --git a/kernel/timer.c b/kernel/timer.c index f2a11887a726..5377f40723ff 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1023,7 +1023,7 @@ asmlinkage long sys_getppid(void) | |||
1023 | parent = me->group_leader->real_parent; | 1023 | parent = me->group_leader->real_parent; |
1024 | for (;;) { | 1024 | for (;;) { |
1025 | pid = parent->tgid; | 1025 | pid = parent->tgid; |
1026 | #ifdef CONFIG_SMP | 1026 | #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) |
1027 | { | 1027 | { |
1028 | struct task_struct *old = parent; | 1028 | struct task_struct *old = parent; |
1029 | 1029 | ||
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 259cf55da3c9..c7e36d4a70ca 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -308,8 +308,6 @@ struct workqueue_struct *__create_workqueue(const char *name, | |||
308 | struct workqueue_struct *wq; | 308 | struct workqueue_struct *wq; |
309 | struct task_struct *p; | 309 | struct task_struct *p; |
310 | 310 | ||
311 | BUG_ON(strlen(name) > 10); | ||
312 | |||
313 | wq = kmalloc(sizeof(*wq), GFP_KERNEL); | 311 | wq = kmalloc(sizeof(*wq), GFP_KERNEL); |
314 | if (!wq) | 312 | if (!wq) |
315 | return NULL; | 313 | return NULL; |
diff --git a/lib/crc32.c b/lib/crc32.c index 58b222783f9c..065198f98b3f 100644 --- a/lib/crc32.c +++ b/lib/crc32.c | |||
@@ -473,7 +473,7 @@ static u32 test_step(u32 init, unsigned char *buf, size_t len) | |||
473 | init = bitreverse(init); | 473 | init = bitreverse(init); |
474 | crc2 = bitreverse(crc1); | 474 | crc2 = bitreverse(crc1); |
475 | if (crc1 != bitreverse(crc2)) | 475 | if (crc1 != bitreverse(crc2)) |
476 | printf("\nBit reversal fail: 0x%08x -> %0x08x -> 0x%08x\n", | 476 | printf("\nBit reversal fail: 0x%08x -> 0x%08x -> 0x%08x\n", |
477 | crc1, crc2, bitreverse(crc2)); | 477 | crc1, crc2, bitreverse(crc2)); |
478 | crc1 = crc32_le(init, buf, len); | 478 | crc1 = crc32_le(init, buf, len); |
479 | if (crc1 != crc2) | 479 | if (crc1 != crc2) |
@@ -207,7 +207,7 @@ build_up: | |||
207 | } | 207 | } |
208 | 208 | ||
209 | /** | 209 | /** |
210 | * idr_get_new_above - allocate new idr entry above a start id | 210 | * idr_get_new_above - allocate new idr entry above or equal to a start id |
211 | * @idp: idr handle | 211 | * @idp: idr handle |
212 | * @ptr: pointer you want associated with the ide | 212 | * @ptr: pointer you want associated with the ide |
213 | * @start_id: id to start search at | 213 | * @start_id: id to start search at |
diff --git a/lib/inflate.c b/lib/inflate.c index 75e7d303c72e..6db6e98d1637 100644 --- a/lib/inflate.c +++ b/lib/inflate.c | |||
@@ -326,7 +326,7 @@ DEBG("huft1 "); | |||
326 | { | 326 | { |
327 | *t = (struct huft *)NULL; | 327 | *t = (struct huft *)NULL; |
328 | *m = 0; | 328 | *m = 0; |
329 | return 0; | 329 | return 2; |
330 | } | 330 | } |
331 | 331 | ||
332 | DEBG("huft2 "); | 332 | DEBG("huft2 "); |
@@ -374,6 +374,7 @@ DEBG("huft5 "); | |||
374 | if ((j = *p++) != 0) | 374 | if ((j = *p++) != 0) |
375 | v[x[j]++] = i; | 375 | v[x[j]++] = i; |
376 | } while (++i < n); | 376 | } while (++i < n); |
377 | n = x[g]; /* set n to length of v */ | ||
377 | 378 | ||
378 | DEBG("h6 "); | 379 | DEBG("h6 "); |
379 | 380 | ||
@@ -410,12 +411,13 @@ DEBG1("1 "); | |||
410 | DEBG1("2 "); | 411 | DEBG1("2 "); |
411 | f -= a + 1; /* deduct codes from patterns left */ | 412 | f -= a + 1; /* deduct codes from patterns left */ |
412 | xp = c + k; | 413 | xp = c + k; |
413 | while (++j < z) /* try smaller tables up to z bits */ | 414 | if (j < z) |
414 | { | 415 | while (++j < z) /* try smaller tables up to z bits */ |
415 | if ((f <<= 1) <= *++xp) | 416 | { |
416 | break; /* enough codes to use up j bits */ | 417 | if ((f <<= 1) <= *++xp) |
417 | f -= *xp; /* else deduct codes from patterns */ | 418 | break; /* enough codes to use up j bits */ |
418 | } | 419 | f -= *xp; /* else deduct codes from patterns */ |
420 | } | ||
419 | } | 421 | } |
420 | DEBG1("3 "); | 422 | DEBG1("3 "); |
421 | z = 1 << j; /* table entries for j-bit table */ | 423 | z = 1 << j; /* table entries for j-bit table */ |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index a9bda0a361f3..e4e9031dd9c3 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -269,6 +269,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
269 | int qualifier; /* 'h', 'l', or 'L' for integer fields */ | 269 | int qualifier; /* 'h', 'l', or 'L' for integer fields */ |
270 | /* 'z' support added 23/7/1999 S.H. */ | 270 | /* 'z' support added 23/7/1999 S.H. */ |
271 | /* 'z' changed to 'Z' --davidm 1/25/99 */ | 271 | /* 'z' changed to 'Z' --davidm 1/25/99 */ |
272 | /* 't' added for ptrdiff_t */ | ||
272 | 273 | ||
273 | /* Reject out-of-range values early */ | 274 | /* Reject out-of-range values early */ |
274 | if (unlikely((int) size < 0)) { | 275 | if (unlikely((int) size < 0)) { |
@@ -339,7 +340,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
339 | /* get the conversion qualifier */ | 340 | /* get the conversion qualifier */ |
340 | qualifier = -1; | 341 | qualifier = -1; |
341 | if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || | 342 | if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || |
342 | *fmt =='Z' || *fmt == 'z') { | 343 | *fmt =='Z' || *fmt == 'z' || *fmt == 't') { |
343 | qualifier = *fmt; | 344 | qualifier = *fmt; |
344 | ++fmt; | 345 | ++fmt; |
345 | if (qualifier == 'l' && *fmt == 'l') { | 346 | if (qualifier == 'l' && *fmt == 'l') { |
@@ -467,6 +468,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
467 | num = (signed long) num; | 468 | num = (signed long) num; |
468 | } else if (qualifier == 'Z' || qualifier == 'z') { | 469 | } else if (qualifier == 'Z' || qualifier == 'z') { |
469 | num = va_arg(args, size_t); | 470 | num = va_arg(args, size_t); |
471 | } else if (qualifier == 't') { | ||
472 | num = va_arg(args, ptrdiff_t); | ||
470 | } else if (qualifier == 'h') { | 473 | } else if (qualifier == 'h') { |
471 | num = (unsigned short) va_arg(args, int); | 474 | num = (unsigned short) va_arg(args, int); |
472 | if (flags & SIGN) | 475 | if (flags & SIGN) |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index fbd1111ea119..6bf720bc662c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -301,6 +301,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, | |||
301 | { | 301 | { |
302 | struct mm_struct *mm = vma->vm_mm; | 302 | struct mm_struct *mm = vma->vm_mm; |
303 | unsigned long address; | 303 | unsigned long address; |
304 | pte_t *ptep; | ||
304 | pte_t pte; | 305 | pte_t pte; |
305 | struct page *page; | 306 | struct page *page; |
306 | 307 | ||
@@ -309,9 +310,17 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, | |||
309 | BUG_ON(end & ~HPAGE_MASK); | 310 | BUG_ON(end & ~HPAGE_MASK); |
310 | 311 | ||
311 | for (address = start; address < end; address += HPAGE_SIZE) { | 312 | for (address = start; address < end; address += HPAGE_SIZE) { |
312 | pte = huge_ptep_get_and_clear(mm, address, huge_pte_offset(mm, address)); | 313 | ptep = huge_pte_offset(mm, address); |
314 | if (! ptep) | ||
315 | /* This can happen on truncate, or if an | ||
316 | * mmap() is aborted due to an error before | ||
317 | * the prefault */ | ||
318 | continue; | ||
319 | |||
320 | pte = huge_ptep_get_and_clear(mm, address, ptep); | ||
313 | if (pte_none(pte)) | 321 | if (pte_none(pte)) |
314 | continue; | 322 | continue; |
323 | |||
315 | page = pte_page(pte); | 324 | page = pte_page(pte); |
316 | put_page(page); | 325 | put_page(page); |
317 | } | 326 | } |
diff --git a/mm/memory.c b/mm/memory.c index 6fe77acbc1cd..e046b7e4b530 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -913,9 +913,13 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
913 | pud = pud_offset(pgd, pg); | 913 | pud = pud_offset(pgd, pg); |
914 | BUG_ON(pud_none(*pud)); | 914 | BUG_ON(pud_none(*pud)); |
915 | pmd = pmd_offset(pud, pg); | 915 | pmd = pmd_offset(pud, pg); |
916 | BUG_ON(pmd_none(*pmd)); | 916 | if (pmd_none(*pmd)) |
917 | return i ? : -EFAULT; | ||
917 | pte = pte_offset_map(pmd, pg); | 918 | pte = pte_offset_map(pmd, pg); |
918 | BUG_ON(pte_none(*pte)); | 919 | if (pte_none(*pte)) { |
920 | pte_unmap(pte); | ||
921 | return i ? : -EFAULT; | ||
922 | } | ||
919 | if (pages) { | 923 | if (pages) { |
920 | pages[i] = pte_page(*pte); | 924 | pages[i] = pte_page(*pte); |
921 | get_page(pages[i]); | 925 | get_page(pages[i]); |
@@ -940,11 +944,13 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
940 | } | 944 | } |
941 | spin_lock(&mm->page_table_lock); | 945 | spin_lock(&mm->page_table_lock); |
942 | do { | 946 | do { |
947 | int write_access = write; | ||
943 | struct page *page; | 948 | struct page *page; |
944 | int lookup_write = write; | ||
945 | 949 | ||
946 | cond_resched_lock(&mm->page_table_lock); | 950 | cond_resched_lock(&mm->page_table_lock); |
947 | while (!(page = follow_page(mm, start, lookup_write))) { | 951 | while (!(page = follow_page(mm, start, write_access))) { |
952 | int ret; | ||
953 | |||
948 | /* | 954 | /* |
949 | * Shortcut for anonymous pages. We don't want | 955 | * Shortcut for anonymous pages. We don't want |
950 | * to force the creation of pages tables for | 956 | * to force the creation of pages tables for |
@@ -952,13 +958,23 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
952 | * nobody touched so far. This is important | 958 | * nobody touched so far. This is important |
953 | * for doing a core dump for these mappings. | 959 | * for doing a core dump for these mappings. |
954 | */ | 960 | */ |
955 | if (!lookup_write && | 961 | if (!write && untouched_anonymous_page(mm,vma,start)) { |
956 | untouched_anonymous_page(mm,vma,start)) { | ||
957 | page = ZERO_PAGE(start); | 962 | page = ZERO_PAGE(start); |
958 | break; | 963 | break; |
959 | } | 964 | } |
960 | spin_unlock(&mm->page_table_lock); | 965 | spin_unlock(&mm->page_table_lock); |
961 | switch (handle_mm_fault(mm,vma,start,write)) { | 966 | ret = __handle_mm_fault(mm, vma, start, write_access); |
967 | |||
968 | /* | ||
969 | * The VM_FAULT_WRITE bit tells us that do_wp_page has | ||
970 | * broken COW when necessary, even if maybe_mkwrite | ||
971 | * decided not to set pte_write. We can thus safely do | ||
972 | * subsequent page lookups as if they were reads. | ||
973 | */ | ||
974 | if (ret & VM_FAULT_WRITE) | ||
975 | write_access = 0; | ||
976 | |||
977 | switch (ret & ~VM_FAULT_WRITE) { | ||
962 | case VM_FAULT_MINOR: | 978 | case VM_FAULT_MINOR: |
963 | tsk->min_flt++; | 979 | tsk->min_flt++; |
964 | break; | 980 | break; |
@@ -972,14 +988,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
972 | default: | 988 | default: |
973 | BUG(); | 989 | BUG(); |
974 | } | 990 | } |
975 | /* | ||
976 | * Now that we have performed a write fault | ||
977 | * and surely no longer have a shared page we | ||
978 | * shouldn't write, we shouldn't ignore an | ||
979 | * unwritable page in the page table if | ||
980 | * we are forcing write access. | ||
981 | */ | ||
982 | lookup_write = write && !force; | ||
983 | spin_lock(&mm->page_table_lock); | 991 | spin_lock(&mm->page_table_lock); |
984 | } | 992 | } |
985 | if (pages) { | 993 | if (pages) { |
@@ -1229,6 +1237,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, | |||
1229 | struct page *old_page, *new_page; | 1237 | struct page *old_page, *new_page; |
1230 | unsigned long pfn = pte_pfn(pte); | 1238 | unsigned long pfn = pte_pfn(pte); |
1231 | pte_t entry; | 1239 | pte_t entry; |
1240 | int ret; | ||
1232 | 1241 | ||
1233 | if (unlikely(!pfn_valid(pfn))) { | 1242 | if (unlikely(!pfn_valid(pfn))) { |
1234 | /* | 1243 | /* |
@@ -1256,7 +1265,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, | |||
1256 | lazy_mmu_prot_update(entry); | 1265 | lazy_mmu_prot_update(entry); |
1257 | pte_unmap(page_table); | 1266 | pte_unmap(page_table); |
1258 | spin_unlock(&mm->page_table_lock); | 1267 | spin_unlock(&mm->page_table_lock); |
1259 | return VM_FAULT_MINOR; | 1268 | return VM_FAULT_MINOR|VM_FAULT_WRITE; |
1260 | } | 1269 | } |
1261 | } | 1270 | } |
1262 | pte_unmap(page_table); | 1271 | pte_unmap(page_table); |
@@ -1283,6 +1292,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, | |||
1283 | /* | 1292 | /* |
1284 | * Re-check the pte - we dropped the lock | 1293 | * Re-check the pte - we dropped the lock |
1285 | */ | 1294 | */ |
1295 | ret = VM_FAULT_MINOR; | ||
1286 | spin_lock(&mm->page_table_lock); | 1296 | spin_lock(&mm->page_table_lock); |
1287 | page_table = pte_offset_map(pmd, address); | 1297 | page_table = pte_offset_map(pmd, address); |
1288 | if (likely(pte_same(*page_table, pte))) { | 1298 | if (likely(pte_same(*page_table, pte))) { |
@@ -1299,12 +1309,13 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma, | |||
1299 | 1309 | ||
1300 | /* Free the old page.. */ | 1310 | /* Free the old page.. */ |
1301 | new_page = old_page; | 1311 | new_page = old_page; |
1312 | ret |= VM_FAULT_WRITE; | ||
1302 | } | 1313 | } |
1303 | pte_unmap(page_table); | 1314 | pte_unmap(page_table); |
1304 | page_cache_release(new_page); | 1315 | page_cache_release(new_page); |
1305 | page_cache_release(old_page); | 1316 | page_cache_release(old_page); |
1306 | spin_unlock(&mm->page_table_lock); | 1317 | spin_unlock(&mm->page_table_lock); |
1307 | return VM_FAULT_MINOR; | 1318 | return ret; |
1308 | 1319 | ||
1309 | no_new_page: | 1320 | no_new_page: |
1310 | page_cache_release(old_page); | 1321 | page_cache_release(old_page); |
@@ -1996,7 +2007,6 @@ static inline int handle_pte_fault(struct mm_struct *mm, | |||
1996 | if (write_access) { | 2007 | if (write_access) { |
1997 | if (!pte_write(entry)) | 2008 | if (!pte_write(entry)) |
1998 | return do_wp_page(mm, vma, address, pte, pmd, entry); | 2009 | return do_wp_page(mm, vma, address, pte, pmd, entry); |
1999 | |||
2000 | entry = pte_mkdirty(entry); | 2010 | entry = pte_mkdirty(entry); |
2001 | } | 2011 | } |
2002 | entry = pte_mkyoung(entry); | 2012 | entry = pte_mkyoung(entry); |
@@ -2011,7 +2021,7 @@ static inline int handle_pte_fault(struct mm_struct *mm, | |||
2011 | /* | 2021 | /* |
2012 | * By the time we get here, we already hold the mm semaphore | 2022 | * By the time we get here, we already hold the mm semaphore |
2013 | */ | 2023 | */ |
2014 | int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma, | 2024 | int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma, |
2015 | unsigned long address, int write_access) | 2025 | unsigned long address, int write_access) |
2016 | { | 2026 | { |
2017 | pgd_t *pgd; | 2027 | pgd_t *pgd; |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 1694845526be..b4eababc8198 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -443,7 +443,7 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | |||
443 | struct mempolicy *new; | 443 | struct mempolicy *new; |
444 | DECLARE_BITMAP(nodes, MAX_NUMNODES); | 444 | DECLARE_BITMAP(nodes, MAX_NUMNODES); |
445 | 445 | ||
446 | if (mode > MPOL_MAX) | 446 | if (mode < 0 || mode > MPOL_MAX) |
447 | return -EINVAL; | 447 | return -EINVAL; |
448 | err = get_nodes(nodes, nmask, maxnode, mode); | 448 | err = get_nodes(nodes, nmask, maxnode, mode); |
449 | if (err) | 449 | if (err) |
@@ -143,7 +143,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
143 | leave 3% of the size of this process for other processes */ | 143 | leave 3% of the size of this process for other processes */ |
144 | allowed -= current->mm->total_vm / 32; | 144 | allowed -= current->mm->total_vm / 32; |
145 | 145 | ||
146 | if (atomic_read(&vm_committed_space) < allowed) | 146 | /* |
147 | * cast `allowed' as a signed long because vm_committed_space | ||
148 | * sometimes has a negative value | ||
149 | */ | ||
150 | if (atomic_read(&vm_committed_space) < (long)allowed) | ||
147 | return 0; | 151 | return 0; |
148 | 152 | ||
149 | vm_unacct_memory(pages); | 153 | vm_unacct_memory(pages); |
diff --git a/mm/mremap.c b/mm/mremap.c index ec7238a78f36..fc45dc9a617b 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -229,6 +229,7 @@ static unsigned long move_vma(struct vm_area_struct *vma, | |||
229 | * since do_munmap() will decrement it by old_len == new_len | 229 | * since do_munmap() will decrement it by old_len == new_len |
230 | */ | 230 | */ |
231 | mm->total_vm += new_len >> PAGE_SHIFT; | 231 | mm->total_vm += new_len >> PAGE_SHIFT; |
232 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); | ||
232 | 233 | ||
233 | if (do_munmap(mm, old_addr, old_len) < 0) { | 234 | if (do_munmap(mm, old_addr, old_len) < 0) { |
234 | /* OOM: unable to split vma, just get accounts right */ | 235 | /* OOM: unable to split vma, just get accounts right */ |
@@ -243,7 +244,6 @@ static unsigned long move_vma(struct vm_area_struct *vma, | |||
243 | vma->vm_next->vm_flags |= VM_ACCOUNT; | 244 | vma->vm_next->vm_flags |= VM_ACCOUNT; |
244 | } | 245 | } |
245 | 246 | ||
246 | __vm_stat_account(mm, vma->vm_flags, vma->vm_file, new_len>>PAGE_SHIFT); | ||
247 | if (vm_flags & VM_LOCKED) { | 247 | if (vm_flags & VM_LOCKED) { |
248 | mm->locked_vm += new_len >> PAGE_SHIFT; | 248 | mm->locked_vm += new_len >> PAGE_SHIFT; |
249 | if (new_len > old_len) | 249 | if (new_len > old_len) |
diff --git a/mm/nommu.c b/mm/nommu.c index ce74452c02d9..fd4e8df0f02d 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1167,7 +1167,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
1167 | leave 3% of the size of this process for other processes */ | 1167 | leave 3% of the size of this process for other processes */ |
1168 | allowed -= current->mm->total_vm / 32; | 1168 | allowed -= current->mm->total_vm / 32; |
1169 | 1169 | ||
1170 | if (atomic_read(&vm_committed_space) < allowed) | 1170 | /* |
1171 | * cast `allowed' as a signed long because vm_committed_space | ||
1172 | * sometimes has a negative value | ||
1173 | */ | ||
1174 | if (atomic_read(&vm_committed_space) < (long)allowed) | ||
1171 | return 0; | 1175 | return 0; |
1172 | 1176 | ||
1173 | vm_unacct_memory(pages); | 1177 | vm_unacct_memory(pages); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 42bccfb8464d..8d088371196a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1061,20 +1061,19 @@ unsigned int nr_free_pages_pgdat(pg_data_t *pgdat) | |||
1061 | 1061 | ||
1062 | static unsigned int nr_free_zone_pages(int offset) | 1062 | static unsigned int nr_free_zone_pages(int offset) |
1063 | { | 1063 | { |
1064 | pg_data_t *pgdat; | 1064 | /* Just pick one node, since fallback list is circular */ |
1065 | pg_data_t *pgdat = NODE_DATA(numa_node_id()); | ||
1065 | unsigned int sum = 0; | 1066 | unsigned int sum = 0; |
1066 | 1067 | ||
1067 | for_each_pgdat(pgdat) { | 1068 | struct zonelist *zonelist = pgdat->node_zonelists + offset; |
1068 | struct zonelist *zonelist = pgdat->node_zonelists + offset; | 1069 | struct zone **zonep = zonelist->zones; |
1069 | struct zone **zonep = zonelist->zones; | 1070 | struct zone *zone; |
1070 | struct zone *zone; | ||
1071 | 1071 | ||
1072 | for (zone = *zonep++; zone; zone = *zonep++) { | 1072 | for (zone = *zonep++; zone; zone = *zonep++) { |
1073 | unsigned long size = zone->present_pages; | 1073 | unsigned long size = zone->present_pages; |
1074 | unsigned long high = zone->pages_high; | 1074 | unsigned long high = zone->pages_high; |
1075 | if (size > high) | 1075 | if (size > high) |
1076 | sum += size - high; | 1076 | sum += size - high; |
1077 | } | ||
1078 | } | 1077 | } |
1079 | 1078 | ||
1080 | return sum; | 1079 | return sum; |
diff --git a/mm/shmem.c b/mm/shmem.c index e64fa726a790..5a81b1ee4f7a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -1773,32 +1773,27 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s | |||
1773 | return 0; | 1773 | return 0; |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | static int shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) | 1776 | static void *shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd) |
1777 | { | 1777 | { |
1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); | 1778 | nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode)); |
1779 | return 0; | 1779 | return NULL; |
1780 | } | 1780 | } |
1781 | 1781 | ||
1782 | static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd) | 1782 | static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd) |
1783 | { | 1783 | { |
1784 | struct page *page = NULL; | 1784 | struct page *page = NULL; |
1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); | 1785 | int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL); |
1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); | 1786 | nd_set_link(nd, res ? ERR_PTR(res) : kmap(page)); |
1787 | return 0; | 1787 | return page; |
1788 | } | 1788 | } |
1789 | 1789 | ||
1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd) | 1790 | static void shmem_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
1791 | { | 1791 | { |
1792 | if (!IS_ERR(nd_get_link(nd))) { | 1792 | if (!IS_ERR(nd_get_link(nd))) { |
1793 | struct page *page; | 1793 | struct page *page = cookie; |
1794 | |||
1795 | page = find_get_page(dentry->d_inode->i_mapping, 0); | ||
1796 | if (!page) | ||
1797 | BUG(); | ||
1798 | kunmap(page); | 1794 | kunmap(page); |
1799 | mark_page_accessed(page); | 1795 | mark_page_accessed(page); |
1800 | page_cache_release(page); | 1796 | page_cache_release(page); |
1801 | page_cache_release(page); | ||
1802 | } | 1797 | } |
1803 | } | 1798 | } |
1804 | 1799 | ||
diff --git a/net/802/tr.c b/net/802/tr.c index a755e880f4ba..1bb7dc1b85cd 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -251,10 +251,11 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device * | |||
251 | unsigned int hash; | 251 | unsigned int hash; |
252 | struct rif_cache *entry; | 252 | struct rif_cache *entry; |
253 | unsigned char *olddata; | 253 | unsigned char *olddata; |
254 | unsigned long flags; | ||
254 | static const unsigned char mcast_func_addr[] | 255 | static const unsigned char mcast_func_addr[] |
255 | = {0xC0,0x00,0x00,0x04,0x00,0x00}; | 256 | = {0xC0,0x00,0x00,0x04,0x00,0x00}; |
256 | 257 | ||
257 | spin_lock_bh(&rif_lock); | 258 | spin_lock_irqsave(&rif_lock, flags); |
258 | 259 | ||
259 | /* | 260 | /* |
260 | * Broadcasts are single route as stated in RFC 1042 | 261 | * Broadcasts are single route as stated in RFC 1042 |
@@ -323,7 +324,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], | |||
323 | else | 324 | else |
324 | slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8); | 325 | slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8); |
325 | olddata = skb->data; | 326 | olddata = skb->data; |
326 | spin_unlock_bh(&rif_lock); | 327 | spin_unlock_irqrestore(&rif_lock, flags); |
327 | 328 | ||
328 | skb_pull(skb, slack); | 329 | skb_pull(skb, slack); |
329 | memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack); | 330 | memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack); |
@@ -337,10 +338,11 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], | |||
337 | static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev) | 338 | static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev) |
338 | { | 339 | { |
339 | unsigned int hash, rii_p = 0; | 340 | unsigned int hash, rii_p = 0; |
341 | unsigned long flags; | ||
340 | struct rif_cache *entry; | 342 | struct rif_cache *entry; |
341 | 343 | ||
342 | 344 | ||
343 | spin_lock_bh(&rif_lock); | 345 | spin_lock_irqsave(&rif_lock, flags); |
344 | 346 | ||
345 | /* | 347 | /* |
346 | * Firstly see if the entry exists | 348 | * Firstly see if the entry exists |
@@ -378,7 +380,7 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
378 | if(!entry) | 380 | if(!entry) |
379 | { | 381 | { |
380 | printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n"); | 382 | printk(KERN_DEBUG "tr.c: Couldn't malloc rif cache entry !\n"); |
381 | spin_unlock_bh(&rif_lock); | 383 | spin_unlock_irqrestore(&rif_lock, flags); |
382 | return; | 384 | return; |
383 | } | 385 | } |
384 | 386 | ||
@@ -420,7 +422,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
420 | } | 422 | } |
421 | entry->last_used=jiffies; | 423 | entry->last_used=jiffies; |
422 | } | 424 | } |
423 | spin_unlock_bh(&rif_lock); | 425 | spin_unlock_irqrestore(&rif_lock, flags); |
424 | } | 426 | } |
425 | 427 | ||
426 | /* | 428 | /* |
@@ -430,9 +432,9 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
430 | static void rif_check_expire(unsigned long dummy) | 432 | static void rif_check_expire(unsigned long dummy) |
431 | { | 433 | { |
432 | int i; | 434 | int i; |
433 | unsigned long next_interval = jiffies + sysctl_tr_rif_timeout/2; | 435 | unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2; |
434 | 436 | ||
435 | spin_lock_bh(&rif_lock); | 437 | spin_lock_irqsave(&rif_lock, flags); |
436 | 438 | ||
437 | for(i =0; i < RIF_TABLE_SIZE; i++) { | 439 | for(i =0; i < RIF_TABLE_SIZE; i++) { |
438 | struct rif_cache *entry, **pentry; | 440 | struct rif_cache *entry, **pentry; |
@@ -454,7 +456,7 @@ static void rif_check_expire(unsigned long dummy) | |||
454 | } | 456 | } |
455 | } | 457 | } |
456 | 458 | ||
457 | spin_unlock_bh(&rif_lock); | 459 | spin_unlock_irqrestore(&rif_lock, flags); |
458 | 460 | ||
459 | mod_timer(&rif_timer, next_interval); | 461 | mod_timer(&rif_timer, next_interval); |
460 | 462 | ||
@@ -485,7 +487,7 @@ static struct rif_cache *rif_get_idx(loff_t pos) | |||
485 | 487 | ||
486 | static void *rif_seq_start(struct seq_file *seq, loff_t *pos) | 488 | static void *rif_seq_start(struct seq_file *seq, loff_t *pos) |
487 | { | 489 | { |
488 | spin_lock_bh(&rif_lock); | 490 | spin_lock_irq(&rif_lock); |
489 | 491 | ||
490 | return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN; | 492 | return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN; |
491 | } | 493 | } |
@@ -516,7 +518,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
516 | 518 | ||
517 | static void rif_seq_stop(struct seq_file *seq, void *v) | 519 | static void rif_seq_stop(struct seq_file *seq, void *v) |
518 | { | 520 | { |
519 | spin_unlock_bh(&rif_lock); | 521 | spin_unlock_irq(&rif_lock); |
520 | } | 522 | } |
521 | 523 | ||
522 | static int rif_seq_show(struct seq_file *seq, void *v) | 524 | static int rif_seq_show(struct seq_file *seq, void *v) |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 707097deac3d..a5c94f11547c 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -875,12 +875,7 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) | |||
875 | sk->sk_sndbuf = osk->sk_sndbuf; | 875 | sk->sk_sndbuf = osk->sk_sndbuf; |
876 | sk->sk_state = TCP_ESTABLISHED; | 876 | sk->sk_state = TCP_ESTABLISHED; |
877 | sk->sk_sleep = osk->sk_sleep; | 877 | sk->sk_sleep = osk->sk_sleep; |
878 | 878 | sock_copy_flags(sk, osk); | |
879 | if (sock_flag(osk, SOCK_DBG)) | ||
880 | sock_set_flag(sk, SOCK_DBG); | ||
881 | |||
882 | if (sock_flag(osk, SOCK_ZAPPED)) | ||
883 | sock_set_flag(sk, SOCK_ZAPPED); | ||
884 | 879 | ||
885 | oax25 = ax25_sk(osk); | 880 | oax25 = ax25_sk(osk); |
886 | 881 | ||
@@ -1007,7 +1002,8 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
1007 | struct sock *sk = sock->sk; | 1002 | struct sock *sk = sock->sk; |
1008 | struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr; | 1003 | struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr; |
1009 | ax25_dev *ax25_dev = NULL; | 1004 | ax25_dev *ax25_dev = NULL; |
1010 | ax25_address *call; | 1005 | ax25_uid_assoc *user; |
1006 | ax25_address call; | ||
1011 | ax25_cb *ax25; | 1007 | ax25_cb *ax25; |
1012 | int err = 0; | 1008 | int err = 0; |
1013 | 1009 | ||
@@ -1026,9 +1022,15 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
1026 | if (addr->fsa_ax25.sax25_family != AF_AX25) | 1022 | if (addr->fsa_ax25.sax25_family != AF_AX25) |
1027 | return -EINVAL; | 1023 | return -EINVAL; |
1028 | 1024 | ||
1029 | call = ax25_findbyuid(current->euid); | 1025 | user = ax25_findbyuid(current->euid); |
1030 | if (call == NULL && ax25_uid_policy && !capable(CAP_NET_ADMIN)) { | 1026 | if (user) { |
1031 | return -EACCES; | 1027 | call = user->call; |
1028 | ax25_uid_put(user); | ||
1029 | } else { | ||
1030 | if (ax25_uid_policy && !capable(CAP_NET_ADMIN)) | ||
1031 | return -EACCES; | ||
1032 | |||
1033 | call = addr->fsa_ax25.sax25_call; | ||
1032 | } | 1034 | } |
1033 | 1035 | ||
1034 | lock_sock(sk); | 1036 | lock_sock(sk); |
@@ -1039,10 +1041,7 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
1039 | goto out; | 1041 | goto out; |
1040 | } | 1042 | } |
1041 | 1043 | ||
1042 | if (call == NULL) | 1044 | ax25->source_addr = call; |
1043 | ax25->source_addr = addr->fsa_ax25.sax25_call; | ||
1044 | else | ||
1045 | ax25->source_addr = *call; | ||
1046 | 1045 | ||
1047 | /* | 1046 | /* |
1048 | * User already set interface with SO_BINDTODEVICE | 1047 | * User already set interface with SO_BINDTODEVICE |
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 44b99b1ff9f8..c288526da4ce 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c | |||
@@ -422,8 +422,8 @@ static inline void ax25_adjust_path(ax25_address *addr, ax25_digi *digipeat) | |||
422 | */ | 422 | */ |
423 | int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) | 423 | int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) |
424 | { | 424 | { |
425 | ax25_uid_assoc *user; | ||
425 | ax25_route *ax25_rt; | 426 | ax25_route *ax25_rt; |
426 | ax25_address *call; | ||
427 | int err; | 427 | int err; |
428 | 428 | ||
429 | if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) | 429 | if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) |
@@ -434,16 +434,18 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25_address *addr) | |||
434 | goto put; | 434 | goto put; |
435 | } | 435 | } |
436 | 436 | ||
437 | if ((call = ax25_findbyuid(current->euid)) == NULL) { | 437 | user = ax25_findbyuid(current->euid); |
438 | if (user) { | ||
439 | ax25->source_addr = user->call; | ||
440 | ax25_uid_put(user); | ||
441 | } else { | ||
438 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { | 442 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { |
439 | err = -EPERM; | 443 | err = -EPERM; |
440 | goto put; | 444 | goto put; |
441 | } | 445 | } |
442 | call = (ax25_address *)ax25->ax25_dev->dev->dev_addr; | 446 | ax25->source_addr = *(ax25_address *)ax25->ax25_dev->dev->dev_addr; |
443 | } | 447 | } |
444 | 448 | ||
445 | ax25->source_addr = *call; | ||
446 | |||
447 | if (ax25_rt->digipeat != NULL) { | 449 | if (ax25_rt->digipeat != NULL) { |
448 | if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { | 450 | if ((ax25->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) { |
449 | err = -ENOMEM; | 451 | err = -ENOMEM; |
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index cea6b7d19729..a8b3822f3ee4 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/fcntl.h> | 28 | #include <linux/fcntl.h> |
29 | #include <linux/mm.h> | 29 | #include <linux/mm.h> |
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/list.h> | ||
31 | #include <linux/notifier.h> | 32 | #include <linux/notifier.h> |
32 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
33 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
@@ -41,38 +42,41 @@ | |||
41 | * Callsign/UID mapper. This is in kernel space for security on multi-amateur machines. | 42 | * Callsign/UID mapper. This is in kernel space for security on multi-amateur machines. |
42 | */ | 43 | */ |
43 | 44 | ||
44 | static ax25_uid_assoc *ax25_uid_list; | 45 | HLIST_HEAD(ax25_uid_list); |
45 | static DEFINE_RWLOCK(ax25_uid_lock); | 46 | static DEFINE_RWLOCK(ax25_uid_lock); |
46 | 47 | ||
47 | int ax25_uid_policy = 0; | 48 | int ax25_uid_policy = 0; |
48 | 49 | ||
49 | ax25_address *ax25_findbyuid(uid_t uid) | 50 | ax25_uid_assoc *ax25_findbyuid(uid_t uid) |
50 | { | 51 | { |
51 | ax25_uid_assoc *ax25_uid; | 52 | ax25_uid_assoc *ax25_uid, *res = NULL; |
52 | ax25_address *res = NULL; | 53 | struct hlist_node *node; |
53 | 54 | ||
54 | read_lock(&ax25_uid_lock); | 55 | read_lock(&ax25_uid_lock); |
55 | for (ax25_uid = ax25_uid_list; ax25_uid != NULL; ax25_uid = ax25_uid->next) { | 56 | ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) { |
56 | if (ax25_uid->uid == uid) { | 57 | if (ax25_uid->uid == uid) { |
57 | res = &ax25_uid->call; | 58 | ax25_uid_hold(ax25_uid); |
59 | res = ax25_uid; | ||
58 | break; | 60 | break; |
59 | } | 61 | } |
60 | } | 62 | } |
61 | read_unlock(&ax25_uid_lock); | 63 | read_unlock(&ax25_uid_lock); |
62 | 64 | ||
63 | return NULL; | 65 | return res; |
64 | } | 66 | } |
65 | 67 | ||
66 | int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) | 68 | int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) |
67 | { | 69 | { |
68 | ax25_uid_assoc *s, *ax25_uid; | 70 | ax25_uid_assoc *ax25_uid; |
71 | struct hlist_node *node; | ||
72 | ax25_uid_assoc *user; | ||
69 | unsigned long res; | 73 | unsigned long res; |
70 | 74 | ||
71 | switch (cmd) { | 75 | switch (cmd) { |
72 | case SIOCAX25GETUID: | 76 | case SIOCAX25GETUID: |
73 | res = -ENOENT; | 77 | res = -ENOENT; |
74 | read_lock(&ax25_uid_lock); | 78 | read_lock(&ax25_uid_lock); |
75 | for (ax25_uid = ax25_uid_list; ax25_uid != NULL; ax25_uid = ax25_uid->next) { | 79 | ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) { |
76 | if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) { | 80 | if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) { |
77 | res = ax25_uid->uid; | 81 | res = ax25_uid->uid; |
78 | break; | 82 | break; |
@@ -85,19 +89,22 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) | |||
85 | case SIOCAX25ADDUID: | 89 | case SIOCAX25ADDUID: |
86 | if (!capable(CAP_NET_ADMIN)) | 90 | if (!capable(CAP_NET_ADMIN)) |
87 | return -EPERM; | 91 | return -EPERM; |
88 | if (ax25_findbyuid(sax->sax25_uid)) | 92 | user = ax25_findbyuid(sax->sax25_uid); |
93 | if (user) { | ||
94 | ax25_uid_put(user); | ||
89 | return -EEXIST; | 95 | return -EEXIST; |
96 | } | ||
90 | if (sax->sax25_uid == 0) | 97 | if (sax->sax25_uid == 0) |
91 | return -EINVAL; | 98 | return -EINVAL; |
92 | if ((ax25_uid = kmalloc(sizeof(*ax25_uid), GFP_KERNEL)) == NULL) | 99 | if ((ax25_uid = kmalloc(sizeof(*ax25_uid), GFP_KERNEL)) == NULL) |
93 | return -ENOMEM; | 100 | return -ENOMEM; |
94 | 101 | ||
102 | atomic_set(&ax25_uid->refcount, 1); | ||
95 | ax25_uid->uid = sax->sax25_uid; | 103 | ax25_uid->uid = sax->sax25_uid; |
96 | ax25_uid->call = sax->sax25_call; | 104 | ax25_uid->call = sax->sax25_call; |
97 | 105 | ||
98 | write_lock(&ax25_uid_lock); | 106 | write_lock(&ax25_uid_lock); |
99 | ax25_uid->next = ax25_uid_list; | 107 | hlist_add_head(&ax25_uid->uid_node, &ax25_uid_list); |
100 | ax25_uid_list = ax25_uid; | ||
101 | write_unlock(&ax25_uid_lock); | 108 | write_unlock(&ax25_uid_lock); |
102 | 109 | ||
103 | return 0; | 110 | return 0; |
@@ -106,34 +113,21 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) | |||
106 | if (!capable(CAP_NET_ADMIN)) | 113 | if (!capable(CAP_NET_ADMIN)) |
107 | return -EPERM; | 114 | return -EPERM; |
108 | 115 | ||
116 | ax25_uid = NULL; | ||
109 | write_lock(&ax25_uid_lock); | 117 | write_lock(&ax25_uid_lock); |
110 | for (ax25_uid = ax25_uid_list; ax25_uid != NULL; ax25_uid = ax25_uid->next) { | 118 | ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) { |
111 | if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) { | 119 | if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) |
112 | break; | 120 | break; |
113 | } | ||
114 | } | 121 | } |
115 | if (ax25_uid == NULL) { | 122 | if (ax25_uid == NULL) { |
116 | write_unlock(&ax25_uid_lock); | 123 | write_unlock(&ax25_uid_lock); |
117 | return -ENOENT; | 124 | return -ENOENT; |
118 | } | 125 | } |
119 | if ((s = ax25_uid_list) == ax25_uid) { | 126 | hlist_del_init(&ax25_uid->uid_node); |
120 | ax25_uid_list = s->next; | 127 | ax25_uid_put(ax25_uid); |
121 | write_unlock(&ax25_uid_lock); | ||
122 | kfree(ax25_uid); | ||
123 | return 0; | ||
124 | } | ||
125 | while (s != NULL && s->next != NULL) { | ||
126 | if (s->next == ax25_uid) { | ||
127 | s->next = ax25_uid->next; | ||
128 | write_unlock(&ax25_uid_lock); | ||
129 | kfree(ax25_uid); | ||
130 | return 0; | ||
131 | } | ||
132 | s = s->next; | ||
133 | } | ||
134 | write_unlock(&ax25_uid_lock); | 128 | write_unlock(&ax25_uid_lock); |
135 | 129 | ||
136 | return -ENOENT; | 130 | return 0; |
137 | 131 | ||
138 | default: | 132 | default: |
139 | return -EINVAL; | 133 | return -EINVAL; |
@@ -147,13 +141,11 @@ int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) | |||
147 | static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | 141 | static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) |
148 | { | 142 | { |
149 | struct ax25_uid_assoc *pt; | 143 | struct ax25_uid_assoc *pt; |
150 | int i = 1; | 144 | struct hlist_node *node; |
145 | int i = 0; | ||
151 | 146 | ||
152 | read_lock(&ax25_uid_lock); | 147 | read_lock(&ax25_uid_lock); |
153 | if (*pos == 0) | 148 | ax25_uid_for_each(pt, node, &ax25_uid_list) { |
154 | return SEQ_START_TOKEN; | ||
155 | |||
156 | for (pt = ax25_uid_list; pt != NULL; pt = pt->next) { | ||
157 | if (i == *pos) | 149 | if (i == *pos) |
158 | return pt; | 150 | return pt; |
159 | ++i; | 151 | ++i; |
@@ -164,8 +156,9 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | |||
164 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 156 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
165 | { | 157 | { |
166 | ++*pos; | 158 | ++*pos; |
167 | return (v == SEQ_START_TOKEN) ? ax25_uid_list : | 159 | |
168 | ((struct ax25_uid_assoc *) v)->next; | 160 | return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, |
161 | ax25_uid_assoc, uid_node); | ||
169 | } | 162 | } |
170 | 163 | ||
171 | static void ax25_uid_seq_stop(struct seq_file *seq, void *v) | 164 | static void ax25_uid_seq_stop(struct seq_file *seq, void *v) |
@@ -179,7 +172,6 @@ static int ax25_uid_seq_show(struct seq_file *seq, void *v) | |||
179 | seq_printf(seq, "Policy: %d\n", ax25_uid_policy); | 172 | seq_printf(seq, "Policy: %d\n", ax25_uid_policy); |
180 | else { | 173 | else { |
181 | struct ax25_uid_assoc *pt = v; | 174 | struct ax25_uid_assoc *pt = v; |
182 | |||
183 | 175 | ||
184 | seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(&pt->call)); | 176 | seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(&pt->call)); |
185 | } | 177 | } |
@@ -213,16 +205,13 @@ struct file_operations ax25_uid_fops = { | |||
213 | */ | 205 | */ |
214 | void __exit ax25_uid_free(void) | 206 | void __exit ax25_uid_free(void) |
215 | { | 207 | { |
216 | ax25_uid_assoc *s, *ax25_uid; | 208 | ax25_uid_assoc *ax25_uid; |
209 | struct hlist_node *node; | ||
217 | 210 | ||
218 | write_lock(&ax25_uid_lock); | 211 | write_lock(&ax25_uid_lock); |
219 | ax25_uid = ax25_uid_list; | 212 | ax25_uid_for_each(ax25_uid, node, &ax25_uid_list) { |
220 | while (ax25_uid != NULL) { | 213 | hlist_del_init(&ax25_uid->uid_node); |
221 | s = ax25_uid; | 214 | ax25_uid_put(ax25_uid); |
222 | ax25_uid = ax25_uid->next; | ||
223 | |||
224 | kfree(s); | ||
225 | } | 215 | } |
226 | ax25_uid_list = NULL; | ||
227 | write_unlock(&ax25_uid_lock); | 216 | write_unlock(&ax25_uid_lock); |
228 | } | 217 | } |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index fb5524365bc2..ffa26c10bfe8 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -299,7 +299,6 @@ struct hci_dev *hci_dev_get(int index) | |||
299 | read_unlock(&hci_dev_list_lock); | 299 | read_unlock(&hci_dev_list_lock); |
300 | return hdev; | 300 | return hdev; |
301 | } | 301 | } |
302 | EXPORT_SYMBOL(hci_dev_get); | ||
303 | 302 | ||
304 | /* ---- Inquiry support ---- */ | 303 | /* ---- Inquiry support ---- */ |
305 | static void inquiry_cache_flush(struct hci_dev *hdev) | 304 | static void inquiry_cache_flush(struct hci_dev *hdev) |
@@ -1042,7 +1041,6 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p | |||
1042 | 1041 | ||
1043 | return 0; | 1042 | return 0; |
1044 | } | 1043 | } |
1045 | EXPORT_SYMBOL(hci_send_cmd); | ||
1046 | 1044 | ||
1047 | /* Get data from the previously sent command */ | 1045 | /* Get data from the previously sent command */ |
1048 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf) | 1046 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c4b592b4ef10..46367bd129c3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1035,9 +1035,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) | |||
1035 | ev->type = type; | 1035 | ev->type = type; |
1036 | memcpy(ev->data, data, dlen); | 1036 | memcpy(ev->data, data, dlen); |
1037 | 1037 | ||
1038 | bt_cb(skb)->incoming = 1; | ||
1039 | do_gettimeofday(&skb->stamp); | ||
1040 | |||
1038 | skb->pkt_type = HCI_EVENT_PKT; | 1041 | skb->pkt_type = HCI_EVENT_PKT; |
1039 | skb->dev = (void *) hdev; | 1042 | skb->dev = (void *) hdev; |
1040 | hci_send_to_sock(hdev, skb); | 1043 | hci_send_to_sock(hdev, skb); |
1041 | kfree_skb(skb); | 1044 | kfree_skb(skb); |
1042 | } | 1045 | } |
1043 | EXPORT_SYMBOL(hci_si_event); | ||
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c index 9efb0a093612..ee6a66979913 100644 --- a/net/bluetooth/lib.c +++ b/net/bluetooth/lib.c | |||
@@ -34,31 +34,6 @@ | |||
34 | 34 | ||
35 | #include <net/bluetooth/bluetooth.h> | 35 | #include <net/bluetooth/bluetooth.h> |
36 | 36 | ||
37 | void bt_dump(char *pref, __u8 *buf, int count) | ||
38 | { | ||
39 | char *ptr; | ||
40 | char line[100]; | ||
41 | unsigned int i; | ||
42 | |||
43 | printk(KERN_INFO "%s: dump, len %d\n", pref, count); | ||
44 | |||
45 | ptr = line; | ||
46 | *ptr = 0; | ||
47 | for (i = 0; i < count; i++) { | ||
48 | ptr += sprintf(ptr, " %2.2X", buf[i]); | ||
49 | |||
50 | if (i && !((i + 1) % 20)) { | ||
51 | printk(KERN_INFO "%s:%s\n", pref, line); | ||
52 | ptr = line; | ||
53 | *ptr = 0; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | if (line[0]) | ||
58 | printk(KERN_INFO "%s:%s\n", pref, line); | ||
59 | } | ||
60 | EXPORT_SYMBOL(bt_dump); | ||
61 | |||
62 | void baswap(bdaddr_t *dst, bdaddr_t *src) | 37 | void baswap(bdaddr_t *dst, bdaddr_t *src) |
63 | { | 38 | { |
64 | unsigned char *d = (unsigned char *) dst; | 39 | unsigned char *d = (unsigned char *) dst; |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index e9e6fda66f1a..27bf5047cd33 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -389,8 +389,6 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
389 | rfcomm_dlc_unlock(d); | 389 | rfcomm_dlc_unlock(d); |
390 | 390 | ||
391 | skb_queue_purge(&d->tx_queue); | 391 | skb_queue_purge(&d->tx_queue); |
392 | rfcomm_session_put(s); | ||
393 | |||
394 | rfcomm_dlc_unlink(d); | 392 | rfcomm_dlc_unlink(d); |
395 | } | 393 | } |
396 | 394 | ||
@@ -600,8 +598,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst | |||
600 | goto failed; | 598 | goto failed; |
601 | } | 599 | } |
602 | 600 | ||
603 | rfcomm_session_hold(s); | ||
604 | |||
605 | s->initiator = 1; | 601 | s->initiator = 1; |
606 | 602 | ||
607 | bacpy(&addr.l2_bdaddr, dst); | 603 | bacpy(&addr.l2_bdaddr, dst); |
diff --git a/net/compat.c b/net/compat.c index be5d936dc423..d99ab9695893 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -91,20 +91,11 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, | |||
91 | } else | 91 | } else |
92 | kern_msg->msg_name = NULL; | 92 | kern_msg->msg_name = NULL; |
93 | 93 | ||
94 | if(kern_msg->msg_iovlen > UIO_FASTIOV) { | ||
95 | kern_iov = kmalloc(kern_msg->msg_iovlen * sizeof(struct iovec), | ||
96 | GFP_KERNEL); | ||
97 | if(!kern_iov) | ||
98 | return -ENOMEM; | ||
99 | } | ||
100 | |||
101 | tot_len = iov_from_user_compat_to_kern(kern_iov, | 94 | tot_len = iov_from_user_compat_to_kern(kern_iov, |
102 | (struct compat_iovec __user *)kern_msg->msg_iov, | 95 | (struct compat_iovec __user *)kern_msg->msg_iov, |
103 | kern_msg->msg_iovlen); | 96 | kern_msg->msg_iovlen); |
104 | if(tot_len >= 0) | 97 | if(tot_len >= 0) |
105 | kern_msg->msg_iov = kern_iov; | 98 | kern_msg->msg_iov = kern_iov; |
106 | else if(kern_msg->msg_iovlen > UIO_FASTIOV) | ||
107 | kfree(kern_iov); | ||
108 | 99 | ||
109 | return tot_len; | 100 | return tot_len; |
110 | } | 101 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 52a3bf7ae177..faf59b02c4bf 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1696,7 +1696,8 @@ static void net_rx_action(struct softirq_action *h) | |||
1696 | struct softnet_data *queue = &__get_cpu_var(softnet_data); | 1696 | struct softnet_data *queue = &__get_cpu_var(softnet_data); |
1697 | unsigned long start_time = jiffies; | 1697 | unsigned long start_time = jiffies; |
1698 | int budget = netdev_budget; | 1698 | int budget = netdev_budget; |
1699 | 1699 | void *have; | |
1700 | |||
1700 | local_irq_disable(); | 1701 | local_irq_disable(); |
1701 | 1702 | ||
1702 | while (!list_empty(&queue->poll_list)) { | 1703 | while (!list_empty(&queue->poll_list)) { |
@@ -1709,10 +1710,10 @@ static void net_rx_action(struct softirq_action *h) | |||
1709 | 1710 | ||
1710 | dev = list_entry(queue->poll_list.next, | 1711 | dev = list_entry(queue->poll_list.next, |
1711 | struct net_device, poll_list); | 1712 | struct net_device, poll_list); |
1712 | netpoll_poll_lock(dev); | 1713 | have = netpoll_poll_lock(dev); |
1713 | 1714 | ||
1714 | if (dev->quota <= 0 || dev->poll(dev, &budget)) { | 1715 | if (dev->quota <= 0 || dev->poll(dev, &budget)) { |
1715 | netpoll_poll_unlock(dev); | 1716 | netpoll_poll_unlock(have); |
1716 | local_irq_disable(); | 1717 | local_irq_disable(); |
1717 | list_del(&dev->poll_list); | 1718 | list_del(&dev->poll_list); |
1718 | list_add_tail(&dev->poll_list, &queue->poll_list); | 1719 | list_add_tail(&dev->poll_list, &queue->poll_list); |
@@ -1721,7 +1722,7 @@ static void net_rx_action(struct softirq_action *h) | |||
1721 | else | 1722 | else |
1722 | dev->quota = dev->weight; | 1723 | dev->quota = dev->weight; |
1723 | } else { | 1724 | } else { |
1724 | netpoll_poll_unlock(dev); | 1725 | netpoll_poll_unlock(have); |
1725 | dev_put(dev); | 1726 | dev_put(dev); |
1726 | local_irq_disable(); | 1727 | local_irq_disable(); |
1727 | } | 1728 | } |
diff --git a/net/core/dst.c b/net/core/dst.c index fc434ade5270..334790da9f16 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -45,6 +45,7 @@ static struct timer_list dst_gc_timer = | |||
45 | static void dst_run_gc(unsigned long dummy) | 45 | static void dst_run_gc(unsigned long dummy) |
46 | { | 46 | { |
47 | int delayed = 0; | 47 | int delayed = 0; |
48 | int work_performed; | ||
48 | struct dst_entry * dst, **dstp; | 49 | struct dst_entry * dst, **dstp; |
49 | 50 | ||
50 | if (!spin_trylock(&dst_lock)) { | 51 | if (!spin_trylock(&dst_lock)) { |
@@ -52,9 +53,9 @@ static void dst_run_gc(unsigned long dummy) | |||
52 | return; | 53 | return; |
53 | } | 54 | } |
54 | 55 | ||
55 | |||
56 | del_timer(&dst_gc_timer); | 56 | del_timer(&dst_gc_timer); |
57 | dstp = &dst_garbage_list; | 57 | dstp = &dst_garbage_list; |
58 | work_performed = 0; | ||
58 | while ((dst = *dstp) != NULL) { | 59 | while ((dst = *dstp) != NULL) { |
59 | if (atomic_read(&dst->__refcnt)) { | 60 | if (atomic_read(&dst->__refcnt)) { |
60 | dstp = &dst->next; | 61 | dstp = &dst->next; |
@@ -62,6 +63,7 @@ static void dst_run_gc(unsigned long dummy) | |||
62 | continue; | 63 | continue; |
63 | } | 64 | } |
64 | *dstp = dst->next; | 65 | *dstp = dst->next; |
66 | work_performed = 1; | ||
65 | 67 | ||
66 | dst = dst_destroy(dst); | 68 | dst = dst_destroy(dst); |
67 | if (dst) { | 69 | if (dst) { |
@@ -86,9 +88,14 @@ static void dst_run_gc(unsigned long dummy) | |||
86 | dst_gc_timer_inc = DST_GC_MAX; | 88 | dst_gc_timer_inc = DST_GC_MAX; |
87 | goto out; | 89 | goto out; |
88 | } | 90 | } |
89 | if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) | 91 | if (!work_performed) { |
90 | dst_gc_timer_expires = DST_GC_MAX; | 92 | if ((dst_gc_timer_expires += dst_gc_timer_inc) > DST_GC_MAX) |
91 | dst_gc_timer_inc += DST_GC_INC; | 93 | dst_gc_timer_expires = DST_GC_MAX; |
94 | dst_gc_timer_inc += DST_GC_INC; | ||
95 | } else { | ||
96 | dst_gc_timer_inc = DST_GC_INC; | ||
97 | dst_gc_timer_expires = DST_GC_MIN; | ||
98 | } | ||
92 | dst_gc_timer.expires = jiffies + dst_gc_timer_expires; | 99 | dst_gc_timer.expires = jiffies + dst_gc_timer_expires; |
93 | #if RT_CACHE_DEBUG >= 2 | 100 | #if RT_CACHE_DEBUG >= 2 |
94 | printk("dst_total: %d/%d %ld\n", | 101 | printk("dst_total: %d/%d %ld\n", |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index c327c9edadc5..a1a9a7abff50 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #define MAX_UDP_CHUNK 1460 | 33 | #define MAX_UDP_CHUNK 1460 |
34 | #define MAX_SKBS 32 | 34 | #define MAX_SKBS 32 |
35 | #define MAX_QUEUE_DEPTH (MAX_SKBS / 2) | 35 | #define MAX_QUEUE_DEPTH (MAX_SKBS / 2) |
36 | #define MAX_RETRIES 20000 | ||
36 | 37 | ||
37 | static DEFINE_SPINLOCK(skb_list_lock); | 38 | static DEFINE_SPINLOCK(skb_list_lock); |
38 | static int nr_skbs; | 39 | static int nr_skbs; |
@@ -248,14 +249,14 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
248 | int status; | 249 | int status; |
249 | struct netpoll_info *npinfo; | 250 | struct netpoll_info *npinfo; |
250 | 251 | ||
251 | repeat: | 252 | if (!np || !np->dev || !netif_running(np->dev)) { |
252 | if(!np || !np->dev || !netif_running(np->dev)) { | ||
253 | __kfree_skb(skb); | 253 | __kfree_skb(skb); |
254 | return; | 254 | return; |
255 | } | 255 | } |
256 | 256 | ||
257 | /* avoid recursion */ | ||
258 | npinfo = np->dev->npinfo; | 257 | npinfo = np->dev->npinfo; |
258 | |||
259 | /* avoid recursion */ | ||
259 | if (npinfo->poll_owner == smp_processor_id() || | 260 | if (npinfo->poll_owner == smp_processor_id() || |
260 | np->dev->xmit_lock_owner == smp_processor_id()) { | 261 | np->dev->xmit_lock_owner == smp_processor_id()) { |
261 | if (np->drop) | 262 | if (np->drop) |
@@ -265,30 +266,37 @@ repeat: | |||
265 | return; | 266 | return; |
266 | } | 267 | } |
267 | 268 | ||
268 | spin_lock(&np->dev->xmit_lock); | 269 | do { |
269 | np->dev->xmit_lock_owner = smp_processor_id(); | 270 | npinfo->tries--; |
271 | spin_lock(&np->dev->xmit_lock); | ||
272 | np->dev->xmit_lock_owner = smp_processor_id(); | ||
270 | 273 | ||
271 | /* | 274 | /* |
272 | * network drivers do not expect to be called if the queue is | 275 | * network drivers do not expect to be called if the queue is |
273 | * stopped. | 276 | * stopped. |
274 | */ | 277 | */ |
275 | if (netif_queue_stopped(np->dev)) { | 278 | if (netif_queue_stopped(np->dev)) { |
279 | np->dev->xmit_lock_owner = -1; | ||
280 | spin_unlock(&np->dev->xmit_lock); | ||
281 | netpoll_poll(np); | ||
282 | udelay(50); | ||
283 | continue; | ||
284 | } | ||
285 | |||
286 | status = np->dev->hard_start_xmit(skb, np->dev); | ||
276 | np->dev->xmit_lock_owner = -1; | 287 | np->dev->xmit_lock_owner = -1; |
277 | spin_unlock(&np->dev->xmit_lock); | 288 | spin_unlock(&np->dev->xmit_lock); |
278 | 289 | ||
279 | netpoll_poll(np); | 290 | /* success */ |
280 | goto repeat; | 291 | if(!status) { |
281 | } | 292 | npinfo->tries = MAX_RETRIES; /* reset */ |
282 | 293 | return; | |
283 | status = np->dev->hard_start_xmit(skb, np->dev); | 294 | } |
284 | np->dev->xmit_lock_owner = -1; | ||
285 | spin_unlock(&np->dev->xmit_lock); | ||
286 | 295 | ||
287 | /* transmit busy */ | 296 | /* transmit busy */ |
288 | if(status) { | ||
289 | netpoll_poll(np); | 297 | netpoll_poll(np); |
290 | goto repeat; | 298 | udelay(50); |
291 | } | 299 | } while (npinfo->tries > 0); |
292 | } | 300 | } |
293 | 301 | ||
294 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | 302 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len) |
@@ -349,15 +357,11 @@ static void arp_reply(struct sk_buff *skb) | |||
349 | unsigned char *arp_ptr; | 357 | unsigned char *arp_ptr; |
350 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; | 358 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; |
351 | u32 sip, tip; | 359 | u32 sip, tip; |
352 | unsigned long flags; | ||
353 | struct sk_buff *send_skb; | 360 | struct sk_buff *send_skb; |
354 | struct netpoll *np = NULL; | 361 | struct netpoll *np = NULL; |
355 | 362 | ||
356 | spin_lock_irqsave(&npinfo->rx_lock, flags); | ||
357 | if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev) | 363 | if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev) |
358 | np = npinfo->rx_np; | 364 | np = npinfo->rx_np; |
359 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | ||
360 | |||
361 | if (!np) | 365 | if (!np) |
362 | return; | 366 | return; |
363 | 367 | ||
@@ -639,9 +643,11 @@ int netpoll_setup(struct netpoll *np) | |||
639 | if (!npinfo) | 643 | if (!npinfo) |
640 | goto release; | 644 | goto release; |
641 | 645 | ||
646 | npinfo->rx_flags = 0; | ||
642 | npinfo->rx_np = NULL; | 647 | npinfo->rx_np = NULL; |
643 | npinfo->poll_lock = SPIN_LOCK_UNLOCKED; | 648 | npinfo->poll_lock = SPIN_LOCK_UNLOCKED; |
644 | npinfo->poll_owner = -1; | 649 | npinfo->poll_owner = -1; |
650 | npinfo->tries = MAX_RETRIES; | ||
645 | npinfo->rx_lock = SPIN_LOCK_UNLOCKED; | 651 | npinfo->rx_lock = SPIN_LOCK_UNLOCKED; |
646 | } else | 652 | } else |
647 | npinfo = ndev->npinfo; | 653 | npinfo = ndev->npinfo; |
@@ -718,9 +724,16 @@ int netpoll_setup(struct netpoll *np) | |||
718 | npinfo->rx_np = np; | 724 | npinfo->rx_np = np; |
719 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); | 725 | spin_unlock_irqrestore(&npinfo->rx_lock, flags); |
720 | } | 726 | } |
727 | |||
728 | /* fill up the skb queue */ | ||
729 | refill_skbs(); | ||
730 | |||
721 | /* last thing to do is link it to the net device structure */ | 731 | /* last thing to do is link it to the net device structure */ |
722 | ndev->npinfo = npinfo; | 732 | ndev->npinfo = npinfo; |
723 | 733 | ||
734 | /* avoid racing with NAPI reading npinfo */ | ||
735 | synchronize_rcu(); | ||
736 | |||
724 | return 0; | 737 | return 0; |
725 | 738 | ||
726 | release: | 739 | release: |
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 96a02800cd28..acdd18e6adb2 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
@@ -1876,15 +1876,6 @@ static inline unsigned int dn_current_mss(struct sock *sk, int flags) | |||
1876 | return mss_now; | 1876 | return mss_now; |
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | static int dn_error(struct sock *sk, int flags, int err) | ||
1880 | { | ||
1881 | if (err == -EPIPE) | ||
1882 | err = sock_error(sk) ? : -EPIPE; | ||
1883 | if (err == -EPIPE && !(flags & MSG_NOSIGNAL)) | ||
1884 | send_sig(SIGPIPE, current, 0); | ||
1885 | return err; | ||
1886 | } | ||
1887 | |||
1888 | static int dn_sendmsg(struct kiocb *iocb, struct socket *sock, | 1879 | static int dn_sendmsg(struct kiocb *iocb, struct socket *sock, |
1889 | struct msghdr *msg, size_t size) | 1880 | struct msghdr *msg, size_t size) |
1890 | { | 1881 | { |
@@ -2045,7 +2036,7 @@ out: | |||
2045 | return sent ? sent : err; | 2036 | return sent ? sent : err; |
2046 | 2037 | ||
2047 | out_err: | 2038 | out_err: |
2048 | err = dn_error(sk, flags, err); | 2039 | err = sk_stream_error(sk, flags, err); |
2049 | release_sock(sk); | 2040 | release_sock(sk); |
2050 | return err; | 2041 | return err; |
2051 | } | 2042 | } |
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c index f32dba9e26fe..8d0cc3cf3e49 100644 --- a/net/decnet/dn_neigh.c +++ b/net/decnet/dn_neigh.c | |||
@@ -148,12 +148,12 @@ static int dn_neigh_construct(struct neighbour *neigh) | |||
148 | 148 | ||
149 | __neigh_parms_put(neigh->parms); | 149 | __neigh_parms_put(neigh->parms); |
150 | neigh->parms = neigh_parms_clone(parms); | 150 | neigh->parms = neigh_parms_clone(parms); |
151 | rcu_read_unlock(); | ||
152 | 151 | ||
153 | if (dn_db->use_long) | 152 | if (dn_db->use_long) |
154 | neigh->ops = &dn_long_ops; | 153 | neigh->ops = &dn_long_ops; |
155 | else | 154 | else |
156 | neigh->ops = &dn_short_ops; | 155 | neigh->ops = &dn_short_ops; |
156 | rcu_read_unlock(); | ||
157 | 157 | ||
158 | if (dn->flags & DN_NDFLAG_P3) | 158 | if (dn->flags & DN_NDFLAG_P3) |
159 | neigh->ops = &dn_phase3_ops; | 159 | neigh->ops = &dn_phase3_ops; |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index c886b28ba9f5..e278cb9d0075 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -593,10 +593,13 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
593 | struct hlist_head *new_laddrhash, | 593 | struct hlist_head *new_laddrhash, |
594 | unsigned int new_size) | 594 | unsigned int new_size) |
595 | { | 595 | { |
596 | struct hlist_head *old_info_hash, *old_laddrhash; | ||
596 | unsigned int old_size = fib_hash_size; | 597 | unsigned int old_size = fib_hash_size; |
597 | unsigned int i; | 598 | unsigned int i, bytes; |
598 | 599 | ||
599 | write_lock(&fib_info_lock); | 600 | write_lock(&fib_info_lock); |
601 | old_info_hash = fib_info_hash; | ||
602 | old_laddrhash = fib_info_laddrhash; | ||
600 | fib_hash_size = new_size; | 603 | fib_hash_size = new_size; |
601 | 604 | ||
602 | for (i = 0; i < old_size; i++) { | 605 | for (i = 0; i < old_size; i++) { |
@@ -636,6 +639,10 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
636 | fib_info_laddrhash = new_laddrhash; | 639 | fib_info_laddrhash = new_laddrhash; |
637 | 640 | ||
638 | write_unlock(&fib_info_lock); | 641 | write_unlock(&fib_info_lock); |
642 | |||
643 | bytes = old_size * sizeof(struct hlist_head *); | ||
644 | fib_hash_free(old_info_hash, bytes); | ||
645 | fib_hash_free(old_laddrhash, bytes); | ||
639 | } | 646 | } |
640 | 647 | ||
641 | struct fib_info * | 648 | struct fib_info * |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index a701405fab0b..45efd5f4741b 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1333,9 +1333,9 @@ err:; | |||
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | static inline int check_leaf(struct trie *t, struct leaf *l, t_key key, int *plen, const struct flowi *flp, | 1335 | static inline int check_leaf(struct trie *t, struct leaf *l, t_key key, int *plen, const struct flowi *flp, |
1336 | struct fib_result *res, int *err) | 1336 | struct fib_result *res) |
1337 | { | 1337 | { |
1338 | int i; | 1338 | int err, i; |
1339 | t_key mask; | 1339 | t_key mask; |
1340 | struct leaf_info *li; | 1340 | struct leaf_info *li; |
1341 | struct hlist_head *hhead = &l->list; | 1341 | struct hlist_head *hhead = &l->list; |
@@ -1348,18 +1348,18 @@ static inline int check_leaf(struct trie *t, struct leaf *l, t_key key, int *pl | |||
1348 | if (l->key != (key & mask)) | 1348 | if (l->key != (key & mask)) |
1349 | continue; | 1349 | continue; |
1350 | 1350 | ||
1351 | if (((*err) = fib_semantic_match(&li->falh, flp, res, l->key, mask, i)) == 0) { | 1351 | if ((err = fib_semantic_match(&li->falh, flp, res, l->key, mask, i)) <= 0) { |
1352 | *plen = i; | 1352 | *plen = i; |
1353 | #ifdef CONFIG_IP_FIB_TRIE_STATS | 1353 | #ifdef CONFIG_IP_FIB_TRIE_STATS |
1354 | t->stats.semantic_match_passed++; | 1354 | t->stats.semantic_match_passed++; |
1355 | #endif | 1355 | #endif |
1356 | return 1; | 1356 | return err; |
1357 | } | 1357 | } |
1358 | #ifdef CONFIG_IP_FIB_TRIE_STATS | 1358 | #ifdef CONFIG_IP_FIB_TRIE_STATS |
1359 | t->stats.semantic_match_miss++; | 1359 | t->stats.semantic_match_miss++; |
1360 | #endif | 1360 | #endif |
1361 | } | 1361 | } |
1362 | return 0; | 1362 | return 1; |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | static int | 1365 | static int |
@@ -1386,7 +1386,7 @@ fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result | |||
1386 | 1386 | ||
1387 | /* Just a leaf? */ | 1387 | /* Just a leaf? */ |
1388 | if (IS_LEAF(n)) { | 1388 | if (IS_LEAF(n)) { |
1389 | if (check_leaf(t, (struct leaf *)n, key, &plen, flp, res, &ret)) | 1389 | if ((ret = check_leaf(t, (struct leaf *)n, key, &plen, flp, res)) <= 0) |
1390 | goto found; | 1390 | goto found; |
1391 | goto failed; | 1391 | goto failed; |
1392 | } | 1392 | } |
@@ -1508,7 +1508,7 @@ fn_trie_lookup(struct fib_table *tb, const struct flowi *flp, struct fib_result | |||
1508 | continue; | 1508 | continue; |
1509 | } | 1509 | } |
1510 | if (IS_LEAF(n)) { | 1510 | if (IS_LEAF(n)) { |
1511 | if (check_leaf(t, (struct leaf *)n, key, &plen, flp, res, &ret)) | 1511 | if ((ret = check_leaf(t, (struct leaf *)n, key, &plen, flp, res)) <= 0) |
1512 | goto found; | 1512 | goto found; |
1513 | } | 1513 | } |
1514 | backtrace: | 1514 | backtrace: |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 279f57abfecb..badfc5849973 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -349,12 +349,12 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param, | |||
349 | { | 349 | { |
350 | struct sk_buff *skb; | 350 | struct sk_buff *skb; |
351 | 351 | ||
352 | ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, | 352 | if (ip_append_data(icmp_socket->sk, icmp_glue_bits, icmp_param, |
353 | icmp_param->data_len+icmp_param->head_len, | 353 | icmp_param->data_len+icmp_param->head_len, |
354 | icmp_param->head_len, | 354 | icmp_param->head_len, |
355 | ipc, rt, MSG_DONTWAIT); | 355 | ipc, rt, MSG_DONTWAIT) < 0) |
356 | 356 | ip_flush_pending_frames(icmp_socket->sk); | |
357 | if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { | 357 | else if ((skb = skb_peek(&icmp_socket->sk->sk_write_queue)) != NULL) { |
358 | struct icmphdr *icmph = skb->h.icmph; | 358 | struct icmphdr *icmph = skb->h.icmph; |
359 | unsigned int csum = 0; | 359 | unsigned int csum = 0; |
360 | struct sk_buff *skb1; | 360 | struct sk_buff *skb1; |
@@ -936,8 +936,7 @@ int icmp_rcv(struct sk_buff *skb) | |||
936 | case CHECKSUM_HW: | 936 | case CHECKSUM_HW: |
937 | if (!(u16)csum_fold(skb->csum)) | 937 | if (!(u16)csum_fold(skb->csum)) |
938 | break; | 938 | break; |
939 | NETDEBUG(if (net_ratelimit()) | 939 | LIMIT_NETDEBUG(printk(KERN_DEBUG "icmp v4 hw csum failure\n")); |
940 | printk(KERN_DEBUG "icmp v4 hw csum failure\n")); | ||
941 | case CHECKSUM_NONE: | 940 | case CHECKSUM_NONE: |
942 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) | 941 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) |
943 | goto error; | 942 | goto error; |
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index 95473953c406..ab18a853d7ce 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
@@ -450,10 +450,13 @@ static void peer_check_expire(unsigned long dummy) | |||
450 | /* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime | 450 | /* Trigger the timer after inet_peer_gc_mintime .. inet_peer_gc_maxtime |
451 | * interval depending on the total number of entries (more entries, | 451 | * interval depending on the total number of entries (more entries, |
452 | * less interval). */ | 452 | * less interval). */ |
453 | peer_periodic_timer.expires = jiffies | 453 | if (peer_total >= inet_peer_threshold) |
454 | + inet_peer_gc_maxtime | 454 | peer_periodic_timer.expires = jiffies + inet_peer_gc_mintime; |
455 | - (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ * | 455 | else |
456 | peer_total / inet_peer_threshold * HZ; | 456 | peer_periodic_timer.expires = jiffies |
457 | + inet_peer_gc_maxtime | ||
458 | - (inet_peer_gc_maxtime - inet_peer_gc_mintime) / HZ * | ||
459 | peer_total / inet_peer_threshold * HZ; | ||
457 | add_timer(&peer_periodic_timer); | 460 | add_timer(&peer_periodic_timer); |
458 | } | 461 | } |
459 | 462 | ||
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 7f68e27eb4ea..eb377ae15305 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -377,7 +377,7 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) | |||
377 | return ip_frag_intern(hash, qp); | 377 | return ip_frag_intern(hash, qp); |
378 | 378 | ||
379 | out_nomem: | 379 | out_nomem: |
380 | NETDEBUG(if (net_ratelimit()) printk(KERN_ERR "ip_frag_create: no memory left !\n")); | 380 | LIMIT_NETDEBUG(printk(KERN_ERR "ip_frag_create: no memory left !\n")); |
381 | return NULL; | 381 | return NULL; |
382 | } | 382 | } |
383 | 383 | ||
@@ -625,10 +625,8 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev) | |||
625 | return head; | 625 | return head; |
626 | 626 | ||
627 | out_nomem: | 627 | out_nomem: |
628 | NETDEBUG(if (net_ratelimit()) | 628 | LIMIT_NETDEBUG(printk(KERN_ERR "IP: queue_glue: no memory for gluing " |
629 | printk(KERN_ERR | 629 | "queue %p\n", qp)); |
630 | "IP: queue_glue: no memory for gluing queue %p\n", | ||
631 | qp)); | ||
632 | goto out_fail; | 630 | goto out_fail; |
633 | out_oversize: | 631 | out_oversize: |
634 | if (net_ratelimit()) | 632 | if (net_ratelimit()) |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 884835522224..f0d5740d7e22 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -290,7 +290,6 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int | |||
290 | 290 | ||
291 | dev_hold(dev); | 291 | dev_hold(dev); |
292 | ipgre_tunnel_link(nt); | 292 | ipgre_tunnel_link(nt); |
293 | /* Do not decrement MOD_USE_COUNT here. */ | ||
294 | return nt; | 293 | return nt; |
295 | 294 | ||
296 | failed: | 295 | failed: |
@@ -1277,12 +1276,28 @@ err1: | |||
1277 | goto out; | 1276 | goto out; |
1278 | } | 1277 | } |
1279 | 1278 | ||
1280 | static void ipgre_fini(void) | 1279 | static void __exit ipgre_destroy_tunnels(void) |
1280 | { | ||
1281 | int prio; | ||
1282 | |||
1283 | for (prio = 0; prio < 4; prio++) { | ||
1284 | int h; | ||
1285 | for (h = 0; h < HASH_SIZE; h++) { | ||
1286 | struct ip_tunnel *t; | ||
1287 | while ((t = tunnels[prio][h]) != NULL) | ||
1288 | unregister_netdevice(t->dev); | ||
1289 | } | ||
1290 | } | ||
1291 | } | ||
1292 | |||
1293 | static void __exit ipgre_fini(void) | ||
1281 | { | 1294 | { |
1282 | if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) | 1295 | if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) |
1283 | printk(KERN_INFO "ipgre close: can't remove protocol\n"); | 1296 | printk(KERN_INFO "ipgre close: can't remove protocol\n"); |
1284 | 1297 | ||
1285 | unregister_netdev(ipgre_fb_tunnel_dev); | 1298 | rtnl_lock(); |
1299 | ipgre_destroy_tunnels(); | ||
1300 | rtnl_unlock(); | ||
1286 | } | 1301 | } |
1287 | 1302 | ||
1288 | module_init(ipgre_init); | 1303 | module_init(ipgre_init); |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index fc7c481d0d79..ff4bd067b397 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -848,6 +848,9 @@ mc_msf_out: | |||
848 | 848 | ||
849 | case IP_IPSEC_POLICY: | 849 | case IP_IPSEC_POLICY: |
850 | case IP_XFRM_POLICY: | 850 | case IP_XFRM_POLICY: |
851 | err = -EPERM; | ||
852 | if (!capable(CAP_NET_ADMIN)) | ||
853 | break; | ||
851 | err = xfrm_user_policy(sk, optname, optval, optlen); | 854 | err = xfrm_user_policy(sk, optname, optval, optlen); |
852 | break; | 855 | break; |
853 | 856 | ||
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 2065944fd9e5..7ded6e60f43a 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -358,7 +358,7 @@ static struct crypto_tfm **ipcomp_alloc_tfms(const char *alg_name) | |||
358 | int cpu; | 358 | int cpu; |
359 | 359 | ||
360 | /* This can be any valid CPU ID so we don't need locking. */ | 360 | /* This can be any valid CPU ID so we don't need locking. */ |
361 | cpu = smp_processor_id(); | 361 | cpu = raw_smp_processor_id(); |
362 | 362 | ||
363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { | 363 | list_for_each_entry(pos, &ipcomp_tfms_list, list) { |
364 | struct crypto_tfm *tfm; | 364 | struct crypto_tfm *tfm; |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index c3947cd566b7..c05c1df0bb04 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -255,7 +255,6 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c | |||
255 | 255 | ||
256 | dev_hold(dev); | 256 | dev_hold(dev); |
257 | ipip_tunnel_link(nt); | 257 | ipip_tunnel_link(nt); |
258 | /* Do not decrement MOD_USE_COUNT here. */ | ||
259 | return nt; | 258 | return nt; |
260 | 259 | ||
261 | failed: | 260 | failed: |
@@ -920,12 +919,29 @@ static int __init ipip_init(void) | |||
920 | goto out; | 919 | goto out; |
921 | } | 920 | } |
922 | 921 | ||
922 | static void __exit ipip_destroy_tunnels(void) | ||
923 | { | ||
924 | int prio; | ||
925 | |||
926 | for (prio = 1; prio < 4; prio++) { | ||
927 | int h; | ||
928 | for (h = 0; h < HASH_SIZE; h++) { | ||
929 | struct ip_tunnel *t; | ||
930 | while ((t = tunnels[prio][h]) != NULL) | ||
931 | unregister_netdevice(t->dev); | ||
932 | } | ||
933 | } | ||
934 | } | ||
935 | |||
923 | static void __exit ipip_fini(void) | 936 | static void __exit ipip_fini(void) |
924 | { | 937 | { |
925 | if (ipip_unregister() < 0) | 938 | if (ipip_unregister() < 0) |
926 | printk(KERN_INFO "ipip close: can't deregister tunnel\n"); | 939 | printk(KERN_INFO "ipip close: can't deregister tunnel\n"); |
927 | 940 | ||
928 | unregister_netdev(ipip_fb_tunnel_dev); | 941 | rtnl_lock(); |
942 | ipip_destroy_tunnels(); | ||
943 | unregister_netdevice(ipip_fb_tunnel_dev); | ||
944 | rtnl_unlock(); | ||
929 | } | 945 | } |
930 | 946 | ||
931 | module_init(ipip_init); | 947 | module_init(ipip_init); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 7833d920bdba..dc806b578427 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -362,7 +362,7 @@ out: | |||
362 | 362 | ||
363 | /* Fill oifs list. It is called under write locked mrt_lock. */ | 363 | /* Fill oifs list. It is called under write locked mrt_lock. */ |
364 | 364 | ||
365 | static void ipmr_update_threshoulds(struct mfc_cache *cache, unsigned char *ttls) | 365 | static void ipmr_update_thresholds(struct mfc_cache *cache, unsigned char *ttls) |
366 | { | 366 | { |
367 | int vifi; | 367 | int vifi; |
368 | 368 | ||
@@ -727,7 +727,7 @@ static int ipmr_mfc_add(struct mfcctl *mfc, int mrtsock) | |||
727 | if (c != NULL) { | 727 | if (c != NULL) { |
728 | write_lock_bh(&mrt_lock); | 728 | write_lock_bh(&mrt_lock); |
729 | c->mfc_parent = mfc->mfcc_parent; | 729 | c->mfc_parent = mfc->mfcc_parent; |
730 | ipmr_update_threshoulds(c, mfc->mfcc_ttls); | 730 | ipmr_update_thresholds(c, mfc->mfcc_ttls); |
731 | if (!mrtsock) | 731 | if (!mrtsock) |
732 | c->mfc_flags |= MFC_STATIC; | 732 | c->mfc_flags |= MFC_STATIC; |
733 | write_unlock_bh(&mrt_lock); | 733 | write_unlock_bh(&mrt_lock); |
@@ -744,7 +744,7 @@ static int ipmr_mfc_add(struct mfcctl *mfc, int mrtsock) | |||
744 | c->mfc_origin=mfc->mfcc_origin.s_addr; | 744 | c->mfc_origin=mfc->mfcc_origin.s_addr; |
745 | c->mfc_mcastgrp=mfc->mfcc_mcastgrp.s_addr; | 745 | c->mfc_mcastgrp=mfc->mfcc_mcastgrp.s_addr; |
746 | c->mfc_parent=mfc->mfcc_parent; | 746 | c->mfc_parent=mfc->mfcc_parent; |
747 | ipmr_update_threshoulds(c, mfc->mfcc_ttls); | 747 | ipmr_update_thresholds(c, mfc->mfcc_ttls); |
748 | if (!mrtsock) | 748 | if (!mrtsock) |
749 | c->mfc_flags |= MFC_STATIC; | 749 | c->mfc_flags |= MFC_STATIC; |
750 | 750 | ||
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index 86f04e41dd8e..a7f0c821a9b2 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c | |||
@@ -513,6 +513,11 @@ init_conntrack(const struct ip_conntrack_tuple *tuple, | |||
513 | #ifdef CONFIG_IP_NF_CONNTRACK_MARK | 513 | #ifdef CONFIG_IP_NF_CONNTRACK_MARK |
514 | conntrack->mark = exp->master->mark; | 514 | conntrack->mark = exp->master->mark; |
515 | #endif | 515 | #endif |
516 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ | ||
517 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) | ||
518 | /* this is ugly, but there is no other place where to put it */ | ||
519 | conntrack->nat.masq_index = exp->master->nat.masq_index; | ||
520 | #endif | ||
516 | nf_conntrack_get(&conntrack->master->ct_general); | 521 | nf_conntrack_get(&conntrack->master->ct_general); |
517 | CONNTRACK_STAT_INC(expect_new); | 522 | CONNTRACK_STAT_INC(expect_new); |
518 | } else { | 523 | } else { |
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c index bc59d0d6e89e..91d5ea1dbbc9 100644 --- a/net/ipv4/netfilter/ip_nat_standalone.c +++ b/net/ipv4/netfilter/ip_nat_standalone.c | |||
@@ -102,6 +102,10 @@ ip_nat_fn(unsigned int hooknum, | |||
102 | return NF_ACCEPT; | 102 | return NF_ACCEPT; |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Don't try to NAT if this packet is not conntracked */ | ||
106 | if (ct == &ip_conntrack_untracked) | ||
107 | return NF_ACCEPT; | ||
108 | |||
105 | switch (ctinfo) { | 109 | switch (ctinfo) { |
106 | case IP_CT_RELATED: | 110 | case IP_CT_RELATED: |
107 | case IP_CT_RELATED+IP_CT_IS_REPLY: | 111 | case IP_CT_RELATED+IP_CT_IS_REPLY: |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index eda1fba431a4..c6baa8174389 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -214,6 +214,12 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp) | |||
214 | break; | 214 | break; |
215 | 215 | ||
216 | case IPQ_COPY_PACKET: | 216 | case IPQ_COPY_PACKET: |
217 | if (entry->skb->ip_summed == CHECKSUM_HW && | ||
218 | (*errp = skb_checksum_help(entry->skb, | ||
219 | entry->info->outdev == NULL))) { | ||
220 | read_unlock_bh(&queue_lock); | ||
221 | return NULL; | ||
222 | } | ||
217 | if (copy_range == 0 || copy_range > entry->skb->len) | 223 | if (copy_range == 0 || copy_range > entry->skb->len) |
218 | data_len = entry->skb->len; | 224 | data_len = entry->skb->len; |
219 | else | 225 | else |
@@ -385,6 +391,7 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e) | |||
385 | if (!skb_ip_make_writable(&e->skb, v->data_len)) | 391 | if (!skb_ip_make_writable(&e->skb, v->data_len)) |
386 | return -ENOMEM; | 392 | return -ENOMEM; |
387 | memcpy(e->skb->data, v->payload, v->data_len); | 393 | memcpy(e->skb->data, v->payload, v->data_len); |
394 | e->skb->ip_summed = CHECKSUM_NONE; | ||
388 | e->skb->nfcache |= NFC_ALTERED; | 395 | e->skb->nfcache |= NFC_ALTERED; |
389 | 396 | ||
390 | /* | 397 | /* |
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index ada9911118e9..94a0ce1c1c9d 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c | |||
@@ -61,16 +61,20 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
61 | if (!tcph) | 61 | if (!tcph) |
62 | return 0; | 62 | return 0; |
63 | 63 | ||
64 | if (!(einfo->operation & IPT_ECN_OP_SET_ECE | 64 | if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) || |
65 | || tcph->ece == einfo->proto.tcp.ece) | 65 | tcph->ece == einfo->proto.tcp.ece) && |
66 | && (!(einfo->operation & IPT_ECN_OP_SET_CWR | 66 | ((!(einfo->operation & IPT_ECN_OP_SET_CWR) || |
67 | || tcph->cwr == einfo->proto.tcp.cwr))) | 67 | tcph->cwr == einfo->proto.tcp.cwr))) |
68 | return 1; | 68 | return 1; |
69 | 69 | ||
70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) | 70 | if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph))) |
71 | return 0; | 71 | return 0; |
72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; | 72 | tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4; |
73 | 73 | ||
74 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
75 | skb_checksum_help(*pskb, inward)) | ||
76 | return 0; | ||
77 | |||
74 | diffs[0] = ((u_int16_t *)tcph)[6]; | 78 | diffs[0] = ((u_int16_t *)tcph)[6]; |
75 | if (einfo->operation & IPT_ECN_OP_SET_ECE) | 79 | if (einfo->operation & IPT_ECN_OP_SET_ECE) |
76 | tcph->ece = einfo->proto.tcp.ece; | 80 | tcph->ece = einfo->proto.tcp.ece; |
@@ -79,13 +83,10 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
79 | diffs[1] = ((u_int16_t *)tcph)[6]; | 83 | diffs[1] = ((u_int16_t *)tcph)[6]; |
80 | diffs[0] = diffs[0] ^ 0xFFFF; | 84 | diffs[0] = diffs[0] ^ 0xFFFF; |
81 | 85 | ||
82 | if ((*pskb)->ip_summed != CHECKSUM_HW) | 86 | if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY) |
83 | tcph->check = csum_fold(csum_partial((char *)diffs, | 87 | tcph->check = csum_fold(csum_partial((char *)diffs, |
84 | sizeof(diffs), | 88 | sizeof(diffs), |
85 | tcph->check^0xFFFF)); | 89 | tcph->check^0xFFFF)); |
86 | else | ||
87 | if (skb_checksum_help(*pskb, inward)) | ||
88 | return 0; | ||
89 | (*pskb)->nfcache |= NFC_ALTERED; | 90 | (*pskb)->nfcache |= NFC_ALTERED; |
90 | return 1; | 91 | return 1; |
91 | } | 92 | } |
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c index 1049050b2bfb..7b84a254440e 100644 --- a/net/ipv4/netfilter/ipt_TCPMSS.c +++ b/net/ipv4/netfilter/ipt_TCPMSS.c | |||
@@ -61,6 +61,10 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) | 61 | if (!skb_ip_make_writable(pskb, (*pskb)->len)) |
62 | return NF_DROP; | 62 | return NF_DROP; |
63 | 63 | ||
64 | if ((*pskb)->ip_summed == CHECKSUM_HW && | ||
65 | skb_checksum_help(*pskb, out == NULL)) | ||
66 | return NF_DROP; | ||
67 | |||
64 | iph = (*pskb)->nh.iph; | 68 | iph = (*pskb)->nh.iph; |
65 | tcplen = (*pskb)->len - iph->ihl*4; | 69 | tcplen = (*pskb)->len - iph->ihl*4; |
66 | 70 | ||
@@ -186,9 +190,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
186 | newmss); | 190 | newmss); |
187 | 191 | ||
188 | retmodified: | 192 | retmodified: |
189 | /* We never hw checksum SYN packets. */ | ||
190 | BUG_ON((*pskb)->ip_summed == CHECKSUM_HW); | ||
191 | |||
192 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; | 193 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; |
193 | return IPT_CONTINUE; | 194 | return IPT_CONTINUE; |
194 | } | 195 | } |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index ddb6ce4ecff2..69b1fcf70077 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -584,7 +584,7 @@ static inline void skb_entail(struct sock *sk, struct tcp_sock *tp, | |||
584 | sk_charge_skb(sk, skb); | 584 | sk_charge_skb(sk, skb); |
585 | if (!sk->sk_send_head) | 585 | if (!sk->sk_send_head) |
586 | sk->sk_send_head = skb; | 586 | sk->sk_send_head = skb; |
587 | else if (tp->nonagle&TCP_NAGLE_PUSH) | 587 | if (tp->nonagle & TCP_NAGLE_PUSH) |
588 | tp->nonagle &= ~TCP_NAGLE_PUSH; | 588 | tp->nonagle &= ~TCP_NAGLE_PUSH; |
589 | } | 589 | } |
590 | 590 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 62f62bb05c2a..67c670886c1f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -242,9 +242,14 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum) | |||
242 | tcp_port_rover = rover; | 242 | tcp_port_rover = rover; |
243 | spin_unlock(&tcp_portalloc_lock); | 243 | spin_unlock(&tcp_portalloc_lock); |
244 | 244 | ||
245 | /* Exhausted local port range during search? */ | 245 | /* Exhausted local port range during search? It is not |
246 | * possible for us to be holding one of the bind hash | ||
247 | * locks if this test triggers, because if 'remaining' | ||
248 | * drops to zero, we broke out of the do/while loop at | ||
249 | * the top level, not from the 'break;' statement. | ||
250 | */ | ||
246 | ret = 1; | 251 | ret = 1; |
247 | if (remaining <= 0) | 252 | if (unlikely(remaining <= 0)) |
248 | goto fail; | 253 | goto fail; |
249 | 254 | ||
250 | /* OK, here is the one we will use. HEAD is | 255 | /* OK, here is the one we will use. HEAD is |
@@ -1494,12 +1499,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1494 | * to destinations, already remembered | 1499 | * to destinations, already remembered |
1495 | * to the moment of synflood. | 1500 | * to the moment of synflood. |
1496 | */ | 1501 | */ |
1497 | NETDEBUG(if (net_ratelimit()) \ | 1502 | LIMIT_NETDEBUG(printk(KERN_DEBUG "TCP: drop open " |
1498 | printk(KERN_DEBUG "TCP: drop open " | 1503 | "request from %u.%u." |
1499 | "request from %u.%u." | 1504 | "%u.%u/%u\n", |
1500 | "%u.%u/%u\n", \ | 1505 | NIPQUAD(saddr), |
1501 | NIPQUAD(saddr), | 1506 | ntohs(skb->h.th->source))); |
1502 | ntohs(skb->h.th->source))); | ||
1503 | dst_release(dst); | 1507 | dst_release(dst); |
1504 | goto drop_and_free; | 1508 | goto drop_and_free; |
1505 | } | 1509 | } |
@@ -1627,8 +1631,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb) | |||
1627 | skb->nh.iph->daddr, skb->csum)) | 1631 | skb->nh.iph->daddr, skb->csum)) |
1628 | return 0; | 1632 | return 0; |
1629 | 1633 | ||
1630 | NETDEBUG(if (net_ratelimit()) | 1634 | LIMIT_NETDEBUG(printk(KERN_DEBUG "hw tcp v4 csum failed\n")); |
1631 | printk(KERN_DEBUG "hw tcp v4 csum failed\n")); | ||
1632 | skb->ip_summed = CHECKSUM_NONE; | 1635 | skb->ip_summed = CHECKSUM_NONE; |
1633 | } | 1636 | } |
1634 | if (skb->len <= 76) { | 1637 | if (skb->len <= 76) { |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e3f8ea1bfa9c..dd30dd137b74 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -403,11 +403,9 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
403 | sk->sk_send_head = skb; | 403 | sk->sk_send_head = skb; |
404 | } | 404 | } |
405 | 405 | ||
406 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | 406 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
407 | { | 407 | { |
408 | struct tcp_sock *tp = tcp_sk(sk); | 408 | if (skb->len <= mss_now || |
409 | |||
410 | if (skb->len <= tp->mss_cache || | ||
411 | !(sk->sk_route_caps & NETIF_F_TSO)) { | 409 | !(sk->sk_route_caps & NETIF_F_TSO)) { |
412 | /* Avoid the costly divide in the normal | 410 | /* Avoid the costly divide in the normal |
413 | * non-TSO case. | 411 | * non-TSO case. |
@@ -417,10 +415,10 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | |||
417 | } else { | 415 | } else { |
418 | unsigned int factor; | 416 | unsigned int factor; |
419 | 417 | ||
420 | factor = skb->len + (tp->mss_cache - 1); | 418 | factor = skb->len + (mss_now - 1); |
421 | factor /= tp->mss_cache; | 419 | factor /= mss_now; |
422 | skb_shinfo(skb)->tso_segs = factor; | 420 | skb_shinfo(skb)->tso_segs = factor; |
423 | skb_shinfo(skb)->tso_size = tp->mss_cache; | 421 | skb_shinfo(skb)->tso_size = mss_now; |
424 | } | 422 | } |
425 | } | 423 | } |
426 | 424 | ||
@@ -429,7 +427,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | |||
429 | * packet to the list. This won't be called frequently, I hope. | 427 | * packet to the list. This won't be called frequently, I hope. |
430 | * Remember, these are still headerless SKBs at this point. | 428 | * Remember, these are still headerless SKBs at this point. |
431 | */ | 429 | */ |
432 | static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) | 430 | static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss_now) |
433 | { | 431 | { |
434 | struct tcp_sock *tp = tcp_sk(sk); | 432 | struct tcp_sock *tp = tcp_sk(sk); |
435 | struct sk_buff *buff; | 433 | struct sk_buff *buff; |
@@ -492,8 +490,8 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) | |||
492 | } | 490 | } |
493 | 491 | ||
494 | /* Fix up tso_factor for both original and new SKB. */ | 492 | /* Fix up tso_factor for both original and new SKB. */ |
495 | tcp_set_skb_tso_segs(sk, skb); | 493 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
496 | tcp_set_skb_tso_segs(sk, buff); | 494 | tcp_set_skb_tso_segs(sk, buff, mss_now); |
497 | 495 | ||
498 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { | 496 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { |
499 | tp->lost_out += tcp_skb_pcount(skb); | 497 | tp->lost_out += tcp_skb_pcount(skb); |
@@ -569,7 +567,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | |||
569 | * factor and mss. | 567 | * factor and mss. |
570 | */ | 568 | */ |
571 | if (tcp_skb_pcount(skb) > 1) | 569 | if (tcp_skb_pcount(skb) > 1) |
572 | tcp_set_skb_tso_segs(sk, skb); | 570 | tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk, 1)); |
573 | 571 | ||
574 | return 0; | 572 | return 0; |
575 | } | 573 | } |
@@ -734,12 +732,14 @@ static inline unsigned int tcp_cwnd_test(struct tcp_sock *tp, struct sk_buff *sk | |||
734 | /* This must be invoked the first time we consider transmitting | 732 | /* This must be invoked the first time we consider transmitting |
735 | * SKB onto the wire. | 733 | * SKB onto the wire. |
736 | */ | 734 | */ |
737 | static inline int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb) | 735 | static inline int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
738 | { | 736 | { |
739 | int tso_segs = tcp_skb_pcount(skb); | 737 | int tso_segs = tcp_skb_pcount(skb); |
740 | 738 | ||
741 | if (!tso_segs) { | 739 | if (!tso_segs || |
742 | tcp_set_skb_tso_segs(sk, skb); | 740 | (tso_segs > 1 && |
741 | skb_shinfo(skb)->tso_size != mss_now)) { | ||
742 | tcp_set_skb_tso_segs(sk, skb, mss_now); | ||
743 | tso_segs = tcp_skb_pcount(skb); | 743 | tso_segs = tcp_skb_pcount(skb); |
744 | } | 744 | } |
745 | return tso_segs; | 745 | return tso_segs; |
@@ -817,7 +817,7 @@ static unsigned int tcp_snd_test(struct sock *sk, struct sk_buff *skb, | |||
817 | struct tcp_sock *tp = tcp_sk(sk); | 817 | struct tcp_sock *tp = tcp_sk(sk); |
818 | unsigned int cwnd_quota; | 818 | unsigned int cwnd_quota; |
819 | 819 | ||
820 | tcp_init_tso_segs(sk, skb); | 820 | tcp_init_tso_segs(sk, skb, cur_mss); |
821 | 821 | ||
822 | if (!tcp_nagle_test(tp, skb, cur_mss, nonagle)) | 822 | if (!tcp_nagle_test(tp, skb, cur_mss, nonagle)) |
823 | return 0; | 823 | return 0; |
@@ -854,14 +854,15 @@ int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp) | |||
854 | * know that all the data is in scatter-gather pages, and that the | 854 | * know that all the data is in scatter-gather pages, and that the |
855 | * packet has never been sent out before (and thus is not cloned). | 855 | * packet has never been sent out before (and thus is not cloned). |
856 | */ | 856 | */ |
857 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len) | 857 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, unsigned int mss_now) |
858 | { | 858 | { |
859 | struct sk_buff *buff; | 859 | struct sk_buff *buff; |
860 | int nlen = skb->len - len; | 860 | int nlen = skb->len - len; |
861 | u16 flags; | 861 | u16 flags; |
862 | 862 | ||
863 | /* All of a TSO frame must be composed of paged data. */ | 863 | /* All of a TSO frame must be composed of paged data. */ |
864 | BUG_ON(skb->len != skb->data_len); | 864 | if (skb->len != skb->data_len) |
865 | return tcp_fragment(sk, skb, len, mss_now); | ||
865 | 866 | ||
866 | buff = sk_stream_alloc_pskb(sk, 0, 0, GFP_ATOMIC); | 867 | buff = sk_stream_alloc_pskb(sk, 0, 0, GFP_ATOMIC); |
867 | if (unlikely(buff == NULL)) | 868 | if (unlikely(buff == NULL)) |
@@ -887,8 +888,8 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len) | |||
887 | skb_split(skb, buff, len); | 888 | skb_split(skb, buff, len); |
888 | 889 | ||
889 | /* Fix up tso_factor for both original and new SKB. */ | 890 | /* Fix up tso_factor for both original and new SKB. */ |
890 | tcp_set_skb_tso_segs(sk, skb); | 891 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
891 | tcp_set_skb_tso_segs(sk, buff); | 892 | tcp_set_skb_tso_segs(sk, buff, mss_now); |
892 | 893 | ||
893 | /* Link BUFF into the send queue. */ | 894 | /* Link BUFF into the send queue. */ |
894 | skb_header_release(buff); | 895 | skb_header_release(buff); |
@@ -924,10 +925,6 @@ static int tcp_tso_should_defer(struct sock *sk, struct tcp_sock *tp, struct sk_ | |||
924 | 925 | ||
925 | limit = min(send_win, cong_win); | 926 | limit = min(send_win, cong_win); |
926 | 927 | ||
927 | /* If sk_send_head can be sent fully now, just do it. */ | ||
928 | if (skb->len <= limit) | ||
929 | return 0; | ||
930 | |||
931 | if (sysctl_tcp_tso_win_divisor) { | 928 | if (sysctl_tcp_tso_win_divisor) { |
932 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 929 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
933 | 930 | ||
@@ -972,19 +969,20 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
972 | if (unlikely(sk->sk_state == TCP_CLOSE)) | 969 | if (unlikely(sk->sk_state == TCP_CLOSE)) |
973 | return 0; | 970 | return 0; |
974 | 971 | ||
975 | skb = sk->sk_send_head; | ||
976 | if (unlikely(!skb)) | ||
977 | return 0; | ||
978 | |||
979 | tso_segs = tcp_init_tso_segs(sk, skb); | ||
980 | cwnd_quota = tcp_cwnd_test(tp, skb); | ||
981 | if (unlikely(!cwnd_quota)) | ||
982 | goto out; | ||
983 | |||
984 | sent_pkts = 0; | 972 | sent_pkts = 0; |
985 | while (likely(tcp_snd_wnd_test(tp, skb, mss_now))) { | 973 | while ((skb = sk->sk_send_head)) { |
974 | unsigned int limit; | ||
975 | |||
976 | tso_segs = tcp_init_tso_segs(sk, skb, mss_now); | ||
986 | BUG_ON(!tso_segs); | 977 | BUG_ON(!tso_segs); |
987 | 978 | ||
979 | cwnd_quota = tcp_cwnd_test(tp, skb); | ||
980 | if (!cwnd_quota) | ||
981 | break; | ||
982 | |||
983 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) | ||
984 | break; | ||
985 | |||
988 | if (tso_segs == 1) { | 986 | if (tso_segs == 1) { |
989 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, | 987 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, |
990 | (tcp_skb_is_last(sk, skb) ? | 988 | (tcp_skb_is_last(sk, skb) ? |
@@ -995,9 +993,10 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
995 | break; | 993 | break; |
996 | } | 994 | } |
997 | 995 | ||
996 | limit = mss_now; | ||
998 | if (tso_segs > 1) { | 997 | if (tso_segs > 1) { |
999 | u32 limit = tcp_window_allows(tp, skb, | 998 | limit = tcp_window_allows(tp, skb, |
1000 | mss_now, cwnd_quota); | 999 | mss_now, cwnd_quota); |
1001 | 1000 | ||
1002 | if (skb->len < limit) { | 1001 | if (skb->len < limit) { |
1003 | unsigned int trim = skb->len % mss_now; | 1002 | unsigned int trim = skb->len % mss_now; |
@@ -1005,15 +1004,12 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
1005 | if (trim) | 1004 | if (trim) |
1006 | limit = skb->len - trim; | 1005 | limit = skb->len - trim; |
1007 | } | 1006 | } |
1008 | if (skb->len > limit) { | ||
1009 | if (tso_fragment(sk, skb, limit)) | ||
1010 | break; | ||
1011 | } | ||
1012 | } else if (unlikely(skb->len > mss_now)) { | ||
1013 | if (unlikely(tcp_fragment(sk, skb, mss_now))) | ||
1014 | break; | ||
1015 | } | 1007 | } |
1016 | 1008 | ||
1009 | if (skb->len > limit && | ||
1010 | unlikely(tso_fragment(sk, skb, limit, mss_now))) | ||
1011 | break; | ||
1012 | |||
1017 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 1013 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
1018 | 1014 | ||
1019 | if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)))) | 1015 | if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)))) |
@@ -1026,27 +1022,12 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
1026 | 1022 | ||
1027 | tcp_minshall_update(tp, mss_now, skb); | 1023 | tcp_minshall_update(tp, mss_now, skb); |
1028 | sent_pkts++; | 1024 | sent_pkts++; |
1029 | |||
1030 | /* Do not optimize this to use tso_segs. If we chopped up | ||
1031 | * the packet above, tso_segs will no longer be valid. | ||
1032 | */ | ||
1033 | cwnd_quota -= tcp_skb_pcount(skb); | ||
1034 | |||
1035 | BUG_ON(cwnd_quota < 0); | ||
1036 | if (!cwnd_quota) | ||
1037 | break; | ||
1038 | |||
1039 | skb = sk->sk_send_head; | ||
1040 | if (!skb) | ||
1041 | break; | ||
1042 | tso_segs = tcp_init_tso_segs(sk, skb); | ||
1043 | } | 1025 | } |
1044 | 1026 | ||
1045 | if (likely(sent_pkts)) { | 1027 | if (likely(sent_pkts)) { |
1046 | tcp_cwnd_validate(sk, tp); | 1028 | tcp_cwnd_validate(sk, tp); |
1047 | return 0; | 1029 | return 0; |
1048 | } | 1030 | } |
1049 | out: | ||
1050 | return !tp->packets_out && sk->sk_send_head; | 1031 | return !tp->packets_out && sk->sk_send_head; |
1051 | } | 1032 | } |
1052 | 1033 | ||
@@ -1076,15 +1057,18 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) | |||
1076 | 1057 | ||
1077 | BUG_ON(!skb || skb->len < mss_now); | 1058 | BUG_ON(!skb || skb->len < mss_now); |
1078 | 1059 | ||
1079 | tso_segs = tcp_init_tso_segs(sk, skb); | 1060 | tso_segs = tcp_init_tso_segs(sk, skb, mss_now); |
1080 | cwnd_quota = tcp_snd_test(sk, skb, mss_now, TCP_NAGLE_PUSH); | 1061 | cwnd_quota = tcp_snd_test(sk, skb, mss_now, TCP_NAGLE_PUSH); |
1081 | 1062 | ||
1082 | if (likely(cwnd_quota)) { | 1063 | if (likely(cwnd_quota)) { |
1064 | unsigned int limit; | ||
1065 | |||
1083 | BUG_ON(!tso_segs); | 1066 | BUG_ON(!tso_segs); |
1084 | 1067 | ||
1068 | limit = mss_now; | ||
1085 | if (tso_segs > 1) { | 1069 | if (tso_segs > 1) { |
1086 | u32 limit = tcp_window_allows(tp, skb, | 1070 | limit = tcp_window_allows(tp, skb, |
1087 | mss_now, cwnd_quota); | 1071 | mss_now, cwnd_quota); |
1088 | 1072 | ||
1089 | if (skb->len < limit) { | 1073 | if (skb->len < limit) { |
1090 | unsigned int trim = skb->len % mss_now; | 1074 | unsigned int trim = skb->len % mss_now; |
@@ -1092,15 +1076,12 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) | |||
1092 | if (trim) | 1076 | if (trim) |
1093 | limit = skb->len - trim; | 1077 | limit = skb->len - trim; |
1094 | } | 1078 | } |
1095 | if (skb->len > limit) { | ||
1096 | if (unlikely(tso_fragment(sk, skb, limit))) | ||
1097 | return; | ||
1098 | } | ||
1099 | } else if (unlikely(skb->len > mss_now)) { | ||
1100 | if (unlikely(tcp_fragment(sk, skb, mss_now))) | ||
1101 | return; | ||
1102 | } | 1079 | } |
1103 | 1080 | ||
1081 | if (skb->len > limit && | ||
1082 | unlikely(tso_fragment(sk, skb, limit, mss_now))) | ||
1083 | return; | ||
1084 | |||
1104 | /* Send it out now. */ | 1085 | /* Send it out now. */ |
1105 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 1086 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
1106 | 1087 | ||
@@ -1386,15 +1367,21 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
1386 | 1367 | ||
1387 | if (skb->len > cur_mss) { | 1368 | if (skb->len > cur_mss) { |
1388 | int old_factor = tcp_skb_pcount(skb); | 1369 | int old_factor = tcp_skb_pcount(skb); |
1389 | int new_factor; | 1370 | int diff; |
1390 | 1371 | ||
1391 | if (tcp_fragment(sk, skb, cur_mss)) | 1372 | if (tcp_fragment(sk, skb, cur_mss, cur_mss)) |
1392 | return -ENOMEM; /* We'll try again later. */ | 1373 | return -ENOMEM; /* We'll try again later. */ |
1393 | 1374 | ||
1394 | /* New SKB created, account for it. */ | 1375 | /* New SKB created, account for it. */ |
1395 | new_factor = tcp_skb_pcount(skb); | 1376 | diff = old_factor - tcp_skb_pcount(skb) - |
1396 | tp->packets_out -= old_factor - new_factor; | 1377 | tcp_skb_pcount(skb->next); |
1397 | tp->packets_out += tcp_skb_pcount(skb->next); | 1378 | tp->packets_out -= diff; |
1379 | |||
1380 | if (diff > 0) { | ||
1381 | tp->fackets_out -= diff; | ||
1382 | if ((int)tp->fackets_out < 0) | ||
1383 | tp->fackets_out = 0; | ||
1384 | } | ||
1398 | } | 1385 | } |
1399 | 1386 | ||
1400 | /* Collapse two adjacent packets if worthwhile and we can. */ | 1387 | /* Collapse two adjacent packets if worthwhile and we can. */ |
@@ -1991,7 +1978,7 @@ int tcp_write_wakeup(struct sock *sk) | |||
1991 | skb->len > mss) { | 1978 | skb->len > mss) { |
1992 | seg_size = min(seg_size, mss); | 1979 | seg_size = min(seg_size, mss); |
1993 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 1980 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; |
1994 | if (tcp_fragment(sk, skb, seg_size)) | 1981 | if (tcp_fragment(sk, skb, seg_size, mss)) |
1995 | return -1; | 1982 | return -1; |
1996 | /* SWS override triggered forced fragmentation. | 1983 | /* SWS override triggered forced fragmentation. |
1997 | * Disable TSO, the connection is too sick. */ | 1984 | * Disable TSO, the connection is too sick. */ |
@@ -2000,7 +1987,7 @@ int tcp_write_wakeup(struct sock *sk) | |||
2000 | sk->sk_route_caps &= ~NETIF_F_TSO; | 1987 | sk->sk_route_caps &= ~NETIF_F_TSO; |
2001 | } | 1988 | } |
2002 | } else if (!tcp_skb_pcount(skb)) | 1989 | } else if (!tcp_skb_pcount(skb)) |
2003 | tcp_set_skb_tso_segs(sk, skb); | 1990 | tcp_set_skb_tso_segs(sk, skb, mss); |
2004 | 1991 | ||
2005 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 1992 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; |
2006 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 1993 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 7c24e64b443f..dc4d07357e3a 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -628,7 +628,7 @@ back_from_confirm: | |||
628 | /* ... which is an evident application bug. --ANK */ | 628 | /* ... which is an evident application bug. --ANK */ |
629 | release_sock(sk); | 629 | release_sock(sk); |
630 | 630 | ||
631 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 2\n")); | 631 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 2\n")); |
632 | err = -EINVAL; | 632 | err = -EINVAL; |
633 | goto out; | 633 | goto out; |
634 | } | 634 | } |
@@ -693,7 +693,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
693 | if (unlikely(!up->pending)) { | 693 | if (unlikely(!up->pending)) { |
694 | release_sock(sk); | 694 | release_sock(sk); |
695 | 695 | ||
696 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 3\n")); | 696 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 3\n")); |
697 | return -EINVAL; | 697 | return -EINVAL; |
698 | } | 698 | } |
699 | 699 | ||
@@ -1102,7 +1102,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, | |||
1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) | 1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) |
1104 | return 0; | 1104 | return 0; |
1105 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp v4 hw csum failure.\n")); | 1105 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp v4 hw csum failure.\n")); |
1106 | skb->ip_summed = CHECKSUM_NONE; | 1106 | skb->ip_summed = CHECKSUM_NONE; |
1107 | } | 1107 | } |
1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) | 1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) |
@@ -1181,14 +1181,13 @@ int udp_rcv(struct sk_buff *skb) | |||
1181 | return(0); | 1181 | return(0); |
1182 | 1182 | ||
1183 | short_packet: | 1183 | short_packet: |
1184 | NETDEBUG(if (net_ratelimit()) | 1184 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", |
1185 | printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", | 1185 | NIPQUAD(saddr), |
1186 | NIPQUAD(saddr), | 1186 | ntohs(uh->source), |
1187 | ntohs(uh->source), | 1187 | ulen, |
1188 | ulen, | 1188 | len, |
1189 | len, | 1189 | NIPQUAD(daddr), |
1190 | NIPQUAD(daddr), | 1190 | ntohs(uh->dest))); |
1191 | ntohs(uh->dest))); | ||
1192 | no_header: | 1191 | no_header: |
1193 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1192 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1194 | kfree_skb(skb); | 1193 | kfree_skb(skb); |
@@ -1199,13 +1198,12 @@ csum_error: | |||
1199 | * RFC1122: OK. Discards the bad packet silently (as far as | 1198 | * RFC1122: OK. Discards the bad packet silently (as far as |
1200 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1199 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1201 | */ | 1200 | */ |
1202 | NETDEBUG(if (net_ratelimit()) | 1201 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", |
1203 | printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", | 1202 | NIPQUAD(saddr), |
1204 | NIPQUAD(saddr), | 1203 | ntohs(uh->source), |
1205 | ntohs(uh->source), | 1204 | NIPQUAD(daddr), |
1206 | NIPQUAD(daddr), | 1205 | ntohs(uh->dest), |
1207 | ntohs(uh->dest), | 1206 | ulen)); |
1208 | ulen)); | ||
1209 | drop: | 1207 | drop: |
1210 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1208 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1211 | kfree_skb(skb); | 1209 | kfree_skb(skb); |
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 866f10726c58..10fbb50daea4 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -198,12 +198,13 @@ resubmit: | |||
198 | if (!raw_sk) { | 198 | if (!raw_sk) { |
199 | if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 199 | if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
200 | IP6_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS); | 200 | IP6_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS); |
201 | icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff); | 201 | icmpv6_send(skb, ICMPV6_PARAMPROB, |
202 | ICMPV6_UNK_NEXTHDR, nhoff, | ||
203 | skb->dev); | ||
202 | } | 204 | } |
203 | } else { | 205 | } else |
204 | IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); | 206 | IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); |
205 | kfree_skb(skb); | 207 | kfree_skb(skb); |
206 | } | ||
207 | } | 208 | } |
208 | rcu_read_unlock(); | 209 | rcu_read_unlock(); |
209 | return 0; | 210 | return 0; |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 423feb46ccc0..135383ef538f 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -354,7 +354,7 @@ static struct crypto_tfm **ipcomp6_alloc_tfms(const char *alg_name) | |||
354 | int cpu; | 354 | int cpu; |
355 | 355 | ||
356 | /* This can be any valid CPU ID so we don't need locking. */ | 356 | /* This can be any valid CPU ID so we don't need locking. */ |
357 | cpu = smp_processor_id(); | 357 | cpu = raw_smp_processor_id(); |
358 | 358 | ||
359 | list_for_each_entry(pos, &ipcomp6_tfms_list, list) { | 359 | list_for_each_entry(pos, &ipcomp6_tfms_list, list) { |
360 | struct crypto_tfm *tfm; | 360 | struct crypto_tfm *tfm; |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index f3ef4c38d315..3bc144a79fa5 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -504,6 +504,9 @@ done: | |||
504 | break; | 504 | break; |
505 | case IPV6_IPSEC_POLICY: | 505 | case IPV6_IPSEC_POLICY: |
506 | case IPV6_XFRM_POLICY: | 506 | case IPV6_XFRM_POLICY: |
507 | retv = -EPERM; | ||
508 | if (!capable(CAP_NET_ADMIN)) | ||
509 | break; | ||
507 | retv = xfrm_user_policy(sk, optname, optval, optlen); | 510 | retv = xfrm_user_policy(sk, optname, optval, optlen); |
508 | break; | 511 | break; |
509 | 512 | ||
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 5493180f0d44..a16df5b27c84 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -211,6 +211,12 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp) | |||
211 | break; | 211 | break; |
212 | 212 | ||
213 | case IPQ_COPY_PACKET: | 213 | case IPQ_COPY_PACKET: |
214 | if (entry->skb->ip_summed == CHECKSUM_HW && | ||
215 | (*errp = skb_checksum_help(entry->skb, | ||
216 | entry->info->outdev == NULL))) { | ||
217 | read_unlock_bh(&queue_lock); | ||
218 | return NULL; | ||
219 | } | ||
214 | if (copy_range == 0 || copy_range > entry->skb->len) | 220 | if (copy_range == 0 || copy_range > entry->skb->len) |
215 | data_len = entry->skb->len; | 221 | data_len = entry->skb->len; |
216 | else | 222 | else |
@@ -381,6 +387,7 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e) | |||
381 | if (!skb_ip_make_writable(&e->skb, v->data_len)) | 387 | if (!skb_ip_make_writable(&e->skb, v->data_len)) |
382 | return -ENOMEM; | 388 | return -ENOMEM; |
383 | memcpy(e->skb->data, v->payload, v->data_len); | 389 | memcpy(e->skb->data, v->payload, v->data_len); |
390 | e->skb->ip_summed = CHECKSUM_NONE; | ||
384 | e->skb->nfcache |= NFC_ALTERED; | 391 | e->skb->nfcache |= NFC_ALTERED; |
385 | 392 | ||
386 | /* | 393 | /* |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index e2b848ec9851..1d4d75b34d32 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -328,6 +328,8 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) | |||
328 | 328 | ||
329 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) { | 329 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) { |
330 | if (skb->ip_summed == CHECKSUM_HW) { | 330 | if (skb->ip_summed == CHECKSUM_HW) { |
331 | skb_postpull_rcsum(skb, skb->nh.raw, | ||
332 | skb->h.raw - skb->nh.raw); | ||
331 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 333 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
332 | if (csum_ipv6_magic(&skb->nh.ipv6h->saddr, | 334 | if (csum_ipv6_magic(&skb->nh.ipv6h->saddr, |
333 | &skb->nh.ipv6h->daddr, | 335 | &skb->nh.ipv6h->daddr, |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b788f55e139b..e553e5b80d6e 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -195,7 +195,6 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int | |||
195 | dev_hold(dev); | 195 | dev_hold(dev); |
196 | 196 | ||
197 | ipip6_tunnel_link(nt); | 197 | ipip6_tunnel_link(nt); |
198 | /* Do not decrement MOD_USE_COUNT here. */ | ||
199 | return nt; | 198 | return nt; |
200 | 199 | ||
201 | failed: | 200 | failed: |
@@ -794,10 +793,28 @@ static struct net_protocol sit_protocol = { | |||
794 | .err_handler = ipip6_err, | 793 | .err_handler = ipip6_err, |
795 | }; | 794 | }; |
796 | 795 | ||
796 | static void __exit sit_destroy_tunnels(void) | ||
797 | { | ||
798 | int prio; | ||
799 | |||
800 | for (prio = 1; prio < 4; prio++) { | ||
801 | int h; | ||
802 | for (h = 0; h < HASH_SIZE; h++) { | ||
803 | struct ip_tunnel *t; | ||
804 | while ((t = tunnels[prio][h]) != NULL) | ||
805 | unregister_netdevice(t->dev); | ||
806 | } | ||
807 | } | ||
808 | } | ||
809 | |||
797 | void __exit sit_cleanup(void) | 810 | void __exit sit_cleanup(void) |
798 | { | 811 | { |
799 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); | 812 | inet_del_protocol(&sit_protocol, IPPROTO_IPV6); |
800 | unregister_netdev(ipip6_fb_tunnel_dev); | 813 | |
814 | rtnl_lock(); | ||
815 | sit_destroy_tunnels(); | ||
816 | unregister_netdevice(ipip6_fb_tunnel_dev); | ||
817 | rtnl_unlock(); | ||
801 | } | 818 | } |
802 | 819 | ||
803 | int __init sit_init(void) | 820 | int __init sit_init(void) |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index f6e288dc116e..ef29cfd936d3 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -158,9 +158,14 @@ static int tcp_v6_get_port(struct sock *sk, unsigned short snum) | |||
158 | tcp_port_rover = rover; | 158 | tcp_port_rover = rover; |
159 | spin_unlock(&tcp_portalloc_lock); | 159 | spin_unlock(&tcp_portalloc_lock); |
160 | 160 | ||
161 | /* Exhausted local port range during search? */ | 161 | /* Exhausted local port range during search? It is not |
162 | * possible for us to be holding one of the bind hash | ||
163 | * locks if this test triggers, because if 'remaining' | ||
164 | * drops to zero, we broke out of the do/while loop at | ||
165 | * the top level, not from the 'break;' statement. | ||
166 | */ | ||
162 | ret = 1; | 167 | ret = 1; |
163 | if (remaining <= 0) | 168 | if (unlikely(remaining <= 0)) |
164 | goto fail; | 169 | goto fail; |
165 | 170 | ||
166 | /* OK, here is the one we will use. */ | 171 | /* OK, here is the one we will use. */ |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 31ed4a9a1d06..162a85fed150 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -459,12 +459,7 @@ static struct sock *nr_make_new(struct sock *osk) | |||
459 | sk->sk_sndbuf = osk->sk_sndbuf; | 459 | sk->sk_sndbuf = osk->sk_sndbuf; |
460 | sk->sk_state = TCP_ESTABLISHED; | 460 | sk->sk_state = TCP_ESTABLISHED; |
461 | sk->sk_sleep = osk->sk_sleep; | 461 | sk->sk_sleep = osk->sk_sleep; |
462 | 462 | sock_copy_flags(sk, osk); | |
463 | if (sock_flag(osk, SOCK_ZAPPED)) | ||
464 | sock_set_flag(sk, SOCK_ZAPPED); | ||
465 | |||
466 | if (sock_flag(osk, SOCK_DBG)) | ||
467 | sock_set_flag(sk, SOCK_DBG); | ||
468 | 463 | ||
469 | skb_queue_head_init(&nr->ack_queue); | 464 | skb_queue_head_init(&nr->ack_queue); |
470 | skb_queue_head_init(&nr->reseq_queue); | 465 | skb_queue_head_init(&nr->reseq_queue); |
@@ -541,7 +536,8 @@ static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
541 | struct nr_sock *nr = nr_sk(sk); | 536 | struct nr_sock *nr = nr_sk(sk); |
542 | struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr; | 537 | struct full_sockaddr_ax25 *addr = (struct full_sockaddr_ax25 *)uaddr; |
543 | struct net_device *dev; | 538 | struct net_device *dev; |
544 | ax25_address *user, *source; | 539 | ax25_uid_assoc *user; |
540 | ax25_address *source; | ||
545 | 541 | ||
546 | lock_sock(sk); | 542 | lock_sock(sk); |
547 | if (!sock_flag(sk, SOCK_ZAPPED)) { | 543 | if (!sock_flag(sk, SOCK_ZAPPED)) { |
@@ -580,16 +576,19 @@ static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
580 | } else { | 576 | } else { |
581 | source = &addr->fsa_ax25.sax25_call; | 577 | source = &addr->fsa_ax25.sax25_call; |
582 | 578 | ||
583 | if ((user = ax25_findbyuid(current->euid)) == NULL) { | 579 | user = ax25_findbyuid(current->euid); |
580 | if (user) { | ||
581 | nr->user_addr = user->call; | ||
582 | ax25_uid_put(user); | ||
583 | } else { | ||
584 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { | 584 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) { |
585 | release_sock(sk); | 585 | release_sock(sk); |
586 | dev_put(dev); | 586 | dev_put(dev); |
587 | return -EPERM; | 587 | return -EPERM; |
588 | } | 588 | } |
589 | user = source; | 589 | nr->user_addr = *source; |
590 | } | 590 | } |
591 | 591 | ||
592 | nr->user_addr = *user; | ||
593 | nr->source_addr = *source; | 592 | nr->source_addr = *source; |
594 | } | 593 | } |
595 | 594 | ||
@@ -609,7 +608,8 @@ static int nr_connect(struct socket *sock, struct sockaddr *uaddr, | |||
609 | struct sock *sk = sock->sk; | 608 | struct sock *sk = sock->sk; |
610 | struct nr_sock *nr = nr_sk(sk); | 609 | struct nr_sock *nr = nr_sk(sk); |
611 | struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr; | 610 | struct sockaddr_ax25 *addr = (struct sockaddr_ax25 *)uaddr; |
612 | ax25_address *user, *source = NULL; | 611 | ax25_address *source = NULL; |
612 | ax25_uid_assoc *user; | ||
613 | struct net_device *dev; | 613 | struct net_device *dev; |
614 | 614 | ||
615 | lock_sock(sk); | 615 | lock_sock(sk); |
@@ -650,16 +650,19 @@ static int nr_connect(struct socket *sock, struct sockaddr *uaddr, | |||
650 | } | 650 | } |
651 | source = (ax25_address *)dev->dev_addr; | 651 | source = (ax25_address *)dev->dev_addr; |
652 | 652 | ||
653 | if ((user = ax25_findbyuid(current->euid)) == NULL) { | 653 | user = ax25_findbyuid(current->euid); |
654 | if (user) { | ||
655 | nr->user_addr = user->call; | ||
656 | ax25_uid_put(user); | ||
657 | } else { | ||
654 | if (ax25_uid_policy && !capable(CAP_NET_ADMIN)) { | 658 | if (ax25_uid_policy && !capable(CAP_NET_ADMIN)) { |
655 | dev_put(dev); | 659 | dev_put(dev); |
656 | release_sock(sk); | 660 | release_sock(sk); |
657 | return -EPERM; | 661 | return -EPERM; |
658 | } | 662 | } |
659 | user = source; | 663 | nr->user_addr = *source; |
660 | } | 664 | } |
661 | 665 | ||
662 | nr->user_addr = *user; | ||
663 | nr->source_addr = *source; | 666 | nr->source_addr = *source; |
664 | nr->device = dev; | 667 | nr->device = dev; |
665 | 668 | ||
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 7eb6a5bf93ea..5480caf8ccc2 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -556,12 +556,7 @@ static struct sock *rose_make_new(struct sock *osk) | |||
556 | sk->sk_sndbuf = osk->sk_sndbuf; | 556 | sk->sk_sndbuf = osk->sk_sndbuf; |
557 | sk->sk_state = TCP_ESTABLISHED; | 557 | sk->sk_state = TCP_ESTABLISHED; |
558 | sk->sk_sleep = osk->sk_sleep; | 558 | sk->sk_sleep = osk->sk_sleep; |
559 | 559 | sock_copy_flags(sk, osk); | |
560 | if (sock_flag(osk, SOCK_ZAPPED)) | ||
561 | sock_set_flag(sk, SOCK_ZAPPED); | ||
562 | |||
563 | if (sock_flag(osk, SOCK_DBG)) | ||
564 | sock_set_flag(sk, SOCK_DBG); | ||
565 | 560 | ||
566 | init_timer(&rose->timer); | 561 | init_timer(&rose->timer); |
567 | init_timer(&rose->idletimer); | 562 | init_timer(&rose->idletimer); |
@@ -631,7 +626,8 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
631 | struct rose_sock *rose = rose_sk(sk); | 626 | struct rose_sock *rose = rose_sk(sk); |
632 | struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr; | 627 | struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr; |
633 | struct net_device *dev; | 628 | struct net_device *dev; |
634 | ax25_address *user, *source; | 629 | ax25_address *source; |
630 | ax25_uid_assoc *user; | ||
635 | int n; | 631 | int n; |
636 | 632 | ||
637 | if (!sock_flag(sk, SOCK_ZAPPED)) | 633 | if (!sock_flag(sk, SOCK_ZAPPED)) |
@@ -656,14 +652,17 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
656 | 652 | ||
657 | source = &addr->srose_call; | 653 | source = &addr->srose_call; |
658 | 654 | ||
659 | if ((user = ax25_findbyuid(current->euid)) == NULL) { | 655 | user = ax25_findbyuid(current->euid); |
656 | if (user) { | ||
657 | rose->source_call = user->call; | ||
658 | ax25_uid_put(user); | ||
659 | } else { | ||
660 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) | 660 | if (ax25_uid_policy && !capable(CAP_NET_BIND_SERVICE)) |
661 | return -EACCES; | 661 | return -EACCES; |
662 | user = source; | 662 | rose->source_call = *source; |
663 | } | 663 | } |
664 | 664 | ||
665 | rose->source_addr = addr->srose_addr; | 665 | rose->source_addr = addr->srose_addr; |
666 | rose->source_call = *user; | ||
667 | rose->device = dev; | 666 | rose->device = dev; |
668 | rose->source_ndigis = addr->srose_ndigis; | 667 | rose->source_ndigis = addr->srose_ndigis; |
669 | 668 | ||
@@ -690,8 +689,8 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
690 | struct rose_sock *rose = rose_sk(sk); | 689 | struct rose_sock *rose = rose_sk(sk); |
691 | struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr; | 690 | struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr; |
692 | unsigned char cause, diagnostic; | 691 | unsigned char cause, diagnostic; |
693 | ax25_address *user; | ||
694 | struct net_device *dev; | 692 | struct net_device *dev; |
693 | ax25_uid_assoc *user; | ||
695 | int n; | 694 | int n; |
696 | 695 | ||
697 | if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { | 696 | if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { |
@@ -741,12 +740,14 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
741 | if ((dev = rose_dev_first()) == NULL) | 740 | if ((dev = rose_dev_first()) == NULL) |
742 | return -ENETUNREACH; | 741 | return -ENETUNREACH; |
743 | 742 | ||
744 | if ((user = ax25_findbyuid(current->euid)) == NULL) | 743 | user = ax25_findbyuid(current->euid); |
744 | if (!user) | ||
745 | return -EINVAL; | 745 | return -EINVAL; |
746 | 746 | ||
747 | memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); | 747 | memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); |
748 | rose->source_call = *user; | 748 | rose->source_call = user->call; |
749 | rose->device = dev; | 749 | rose->device = dev; |
750 | ax25_uid_put(user); | ||
750 | 751 | ||
751 | rose_insert_socket(sk); /* Finish the bind */ | 752 | rose_insert_socket(sk); /* Finish the bind */ |
752 | } | 753 | } |
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index ff73ebb912b8..25da6f699fd0 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c | |||
@@ -994,8 +994,10 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25) | |||
994 | * 1. The frame isn't for us, | 994 | * 1. The frame isn't for us, |
995 | * 2. It isn't "owned" by any existing route. | 995 | * 2. It isn't "owned" by any existing route. |
996 | */ | 996 | */ |
997 | if (frametype != ROSE_CALL_REQUEST) /* XXX */ | 997 | if (frametype != ROSE_CALL_REQUEST) { /* XXX */ |
998 | return 0; | 998 | res = 0; |
999 | goto out; | ||
1000 | } | ||
999 | 1001 | ||
1000 | len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2; | 1002 | len = (((skb->data[3] >> 4) & 0x0F) + 1) / 2; |
1001 | len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2; | 1003 | len += (((skb->data[3] >> 0) & 0x0F) + 1) / 2; |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 8edefd5d095d..0d066c965342 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -438,6 +438,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops) | |||
438 | if (!ops->init || ops->init(sch, NULL) == 0) | 438 | if (!ops->init || ops->init(sch, NULL) == 0) |
439 | return sch; | 439 | return sch; |
440 | 440 | ||
441 | qdisc_destroy(sch); | ||
441 | errout: | 442 | errout: |
442 | return NULL; | 443 | return NULL; |
443 | } | 444 | } |
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 98d49ec9b74b..b74f7772b576 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -57,6 +57,7 @@ static struct snmp_mib sctp_snmp_list[] = { | |||
57 | SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS), | 57 | SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS), |
58 | SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS), | 58 | SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS), |
59 | SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS), | 59 | SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS), |
60 | SNMP_MIB_SENTINEL | ||
60 | }; | 61 | }; |
61 | 62 | ||
62 | /* Return the current value of a particular entry in the mib by adding its | 63 | /* Return the current value of a particular entry in the mib by adding its |
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index 24c21f2a33a7..5a7265aeaf83 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
@@ -185,9 +185,7 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | |||
185 | sg->page = body->pages[i]; | 185 | sg->page = body->pages[i]; |
186 | sg->offset = offset; | 186 | sg->offset = offset; |
187 | sg->length = thislen; | 187 | sg->length = thislen; |
188 | kmap(sg->page); /* XXX kmap_atomic? */ | ||
189 | crypto_digest_update(tfm, sg, 1); | 188 | crypto_digest_update(tfm, sg, 1); |
190 | kunmap(sg->page); | ||
191 | len -= thislen; | 189 | len -= thislen; |
192 | i++; | 190 | i++; |
193 | offset = 0; | 191 | offset = 0; |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 56db8f13e6cb..d0c3120d0233 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -586,7 +586,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) | |||
586 | } | 586 | } |
587 | if (skb->stamp.tv_sec == 0) { | 587 | if (skb->stamp.tv_sec == 0) { |
588 | skb->stamp.tv_sec = xtime.tv_sec; | 588 | skb->stamp.tv_sec = xtime.tv_sec; |
589 | skb->stamp.tv_usec = xtime.tv_nsec * 1000; | 589 | skb->stamp.tv_usec = xtime.tv_nsec / NSEC_PER_USEC; |
590 | /* Don't enable netstamp, sunrpc doesn't | 590 | /* Don't enable netstamp, sunrpc doesn't |
591 | need that much accuracy */ | 591 | need that much accuracy */ |
592 | } | 592 | } |
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index 8a4d9c106af1..fde16f40a581 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -993,6 +993,7 @@ xdr_xcode_array2(struct xdr_buf *buf, unsigned int base, | |||
993 | return -EINVAL; | 993 | return -EINVAL; |
994 | } else { | 994 | } else { |
995 | if (xdr_decode_word(buf, base, &desc->array_len) != 0 || | 995 | if (xdr_decode_word(buf, base, &desc->array_len) != 0 || |
996 | desc->array_len > desc->array_maxlen || | ||
996 | (unsigned long) base + 4 + desc->array_len * | 997 | (unsigned long) base + 4 + desc->array_len * |
997 | desc->elem_size > buf->len) | 998 | desc->elem_size > buf->len) |
998 | return -EINVAL; | 999 | return -EINVAL; |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 9b9f94c915d2..09ffca54b373 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -359,11 +359,16 @@ handle_modversions(struct module *mod, struct elf_info *info, | |||
359 | /* ignore __this_module, it will be resolved shortly */ | 359 | /* ignore __this_module, it will be resolved shortly */ |
360 | if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0) | 360 | if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0) |
361 | break; | 361 | break; |
362 | #ifdef STT_REGISTER | 362 | /* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */ |
363 | #if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER) | ||
364 | /* add compatibility with older glibc */ | ||
365 | #ifndef STT_SPARC_REGISTER | ||
366 | #define STT_SPARC_REGISTER STT_REGISTER | ||
367 | #endif | ||
363 | if (info->hdr->e_machine == EM_SPARC || | 368 | if (info->hdr->e_machine == EM_SPARC || |
364 | info->hdr->e_machine == EM_SPARCV9) { | 369 | info->hdr->e_machine == EM_SPARCV9) { |
365 | /* Ignore register directives. */ | 370 | /* Ignore register directives. */ |
366 | if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER) | 371 | if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) |
367 | break; | 372 | break; |
368 | } | 373 | } |
369 | #endif | 374 | #endif |
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index fea262860ea0..a6516a64b297 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -49,9 +49,6 @@ asmlinkage long sys_add_key(const char __user *_type, | |||
49 | goto error; | 49 | goto error; |
50 | type[31] = '\0'; | 50 | type[31] = '\0'; |
51 | 51 | ||
52 | if (!type[0]) | ||
53 | goto error; | ||
54 | |||
55 | ret = -EPERM; | 52 | ret = -EPERM; |
56 | if (type[0] == '.') | 53 | if (type[0] == '.') |
57 | goto error; | 54 | goto error; |
@@ -144,6 +141,10 @@ asmlinkage long sys_request_key(const char __user *_type, | |||
144 | goto error; | 141 | goto error; |
145 | type[31] = '\0'; | 142 | type[31] = '\0'; |
146 | 143 | ||
144 | ret = -EPERM; | ||
145 | if (type[0] == '.') | ||
146 | goto error; | ||
147 | |||
147 | /* pull the description into kernel space */ | 148 | /* pull the description into kernel space */ |
148 | ret = -EFAULT; | 149 | ret = -EFAULT; |
149 | dlen = strnlen_user(_description, PAGE_SIZE - 1); | 150 | dlen = strnlen_user(_description, PAGE_SIZE - 1); |
@@ -362,7 +363,7 @@ long keyctl_revoke_key(key_serial_t id) | |||
362 | 363 | ||
363 | key_put(key); | 364 | key_put(key); |
364 | error: | 365 | error: |
365 | return 0; | 366 | return ret; |
366 | 367 | ||
367 | } /* end keyctl_revoke_key() */ | 368 | } /* end keyctl_revoke_key() */ |
368 | 369 | ||
@@ -685,6 +686,8 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) | |||
685 | goto can_read_key2; | 686 | goto can_read_key2; |
686 | 687 | ||
687 | ret = PTR_ERR(skey); | 688 | ret = PTR_ERR(skey); |
689 | if (ret == -EAGAIN) | ||
690 | ret = -EACCES; | ||
688 | goto error2; | 691 | goto error2; |
689 | } | 692 | } |
690 | 693 | ||
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index a1f6bac647a1..9c208c756df8 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -201,7 +201,11 @@ static void keyring_destroy(struct key *keyring) | |||
201 | 201 | ||
202 | if (keyring->description) { | 202 | if (keyring->description) { |
203 | write_lock(&keyring_name_lock); | 203 | write_lock(&keyring_name_lock); |
204 | list_del(&keyring->type_data.link); | 204 | |
205 | if (keyring->type_data.link.next != NULL && | ||
206 | !list_empty(&keyring->type_data.link)) | ||
207 | list_del(&keyring->type_data.link); | ||
208 | |||
205 | write_unlock(&keyring_name_lock); | 209 | write_unlock(&keyring_name_lock); |
206 | } | 210 | } |
207 | 211 | ||
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c index 9b0369c5a223..c089f78fb94e 100644 --- a/security/keys/process_keys.c +++ b/security/keys/process_keys.c | |||
@@ -678,7 +678,7 @@ long join_session_keyring(const char *name) | |||
678 | keyring = keyring_alloc(name, tsk->uid, tsk->gid, 0, NULL); | 678 | keyring = keyring_alloc(name, tsk->uid, tsk->gid, 0, NULL); |
679 | if (IS_ERR(keyring)) { | 679 | if (IS_ERR(keyring)) { |
680 | ret = PTR_ERR(keyring); | 680 | ret = PTR_ERR(keyring); |
681 | goto error; | 681 | goto error2; |
682 | } | 682 | } |
683 | } | 683 | } |
684 | else if (IS_ERR(keyring)) { | 684 | else if (IS_ERR(keyring)) { |
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index dfcd983af1fd..90c1506d007c 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
@@ -405,7 +405,7 @@ struct key *request_key_and_link(struct key_type *type, | |||
405 | key_user_put(user); | 405 | key_user_put(user); |
406 | 406 | ||
407 | /* link the new key into the appropriate keyring */ | 407 | /* link the new key into the appropriate keyring */ |
408 | if (!PTR_ERR(key)) | 408 | if (!IS_ERR(key)) |
409 | request_key_link(key, dest_keyring); | 409 | request_key_link(key, dest_keyring); |
410 | } | 410 | } |
411 | 411 | ||
diff --git a/sound/Kconfig b/sound/Kconfig index ee794ae06040..b65ee4701f98 100644 --- a/sound/Kconfig +++ b/sound/Kconfig | |||
@@ -77,7 +77,7 @@ source "sound/parisc/Kconfig" | |||
77 | endmenu | 77 | endmenu |
78 | 78 | ||
79 | menu "Open Sound System" | 79 | menu "Open Sound System" |
80 | depends on SOUND!=n && (BROKEN || (!SPARC32 && !SPARC64)) | 80 | depends on SOUND!=n |
81 | 81 | ||
82 | config SOUND_PRIME | 82 | config SOUND_PRIME |
83 | tristate "Open Sound System (DEPRECATED)" | 83 | tristate "Open Sound System (DEPRECATED)" |
diff --git a/sound/core/Makefile b/sound/core/Makefile index 764ac184b223..969d75528bde 100644 --- a/sound/core/Makefile +++ b/sound/core/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | snd-objs := sound.o init.o memory.o info.o control.o misc.o \ | 6 | snd-objs := sound.o init.o memory.o info.o control.o misc.o \ |
7 | device.o wrappers.o | 7 | device.o wrappers.o |
8 | ifeq ($(CONFIG_ISA),y) | 8 | ifeq ($(CONFIG_ISA_DMA_API),y) |
9 | snd-objs += isadma.o | 9 | snd-objs += isadma.o |
10 | endif | 10 | endif |
11 | ifeq ($(CONFIG_SND_OSSEMUL),y) | 11 | ifeq ($(CONFIG_SND_OSSEMUL),y) |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 7612884f530b..3271e9245490 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -432,7 +432,7 @@ EXPORT_SYMBOL(snd_device_new); | |||
432 | EXPORT_SYMBOL(snd_device_register); | 432 | EXPORT_SYMBOL(snd_device_register); |
433 | EXPORT_SYMBOL(snd_device_free); | 433 | EXPORT_SYMBOL(snd_device_free); |
434 | /* isadma.c */ | 434 | /* isadma.c */ |
435 | #ifdef CONFIG_ISA | 435 | #ifdef CONFIG_ISA_DMA_API |
436 | EXPORT_SYMBOL(snd_dma_program); | 436 | EXPORT_SYMBOL(snd_dma_program); |
437 | EXPORT_SYMBOL(snd_dma_disable); | 437 | EXPORT_SYMBOL(snd_dma_disable); |
438 | EXPORT_SYMBOL(snd_dma_pointer); | 438 | EXPORT_SYMBOL(snd_dma_pointer); |
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index 148a856a43ad..be4ea60a3679 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # ALSA ISA drivers | 1 | # ALSA ISA drivers |
2 | 2 | ||
3 | menu "ISA devices" | 3 | menu "ISA devices" |
4 | depends on SND!=n && ISA | 4 | depends on SND!=n && ISA && ISA_DMA_API |
5 | 5 | ||
6 | config SND_AD1848_LIB | 6 | config SND_AD1848_LIB |
7 | tristate | 7 | tristate |
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index 7bd95ceab7cc..953e5f3ea03d 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig | |||
@@ -6,7 +6,7 @@ | |||
6 | # Prompt user for primary drivers. | 6 | # Prompt user for primary drivers. |
7 | config SOUND_BT878 | 7 | config SOUND_BT878 |
8 | tristate "BT878 audio dma" | 8 | tristate "BT878 audio dma" |
9 | depends on SOUND_PRIME | 9 | depends on SOUND_PRIME && PCI |
10 | ---help--- | 10 | ---help--- |
11 | Audio DMA support for bt878 based grabber boards. As you might have | 11 | Audio DMA support for bt878 based grabber boards. As you might have |
12 | already noticed, bt878 is listed with two functions in /proc/pci. | 12 | already noticed, bt878 is listed with two functions in /proc/pci. |
@@ -80,14 +80,14 @@ config SOUND_EMU10K1 | |||
80 | 80 | ||
81 | config MIDI_EMU10K1 | 81 | config MIDI_EMU10K1 |
82 | bool "Creative SBLive! MIDI (EXPERIMENTAL)" | 82 | bool "Creative SBLive! MIDI (EXPERIMENTAL)" |
83 | depends on SOUND_EMU10K1 && EXPERIMENTAL | 83 | depends on SOUND_EMU10K1 && EXPERIMENTAL && ISA_DMA_API |
84 | help | 84 | help |
85 | Say Y if you want to be able to use the OSS /dev/sequencer | 85 | Say Y if you want to be able to use the OSS /dev/sequencer |
86 | interface. This code is still experimental. | 86 | interface. This code is still experimental. |
87 | 87 | ||
88 | config SOUND_FUSION | 88 | config SOUND_FUSION |
89 | tristate "Crystal SoundFusion (CS4280/461x)" | 89 | tristate "Crystal SoundFusion (CS4280/461x)" |
90 | depends on SOUND_PRIME | 90 | depends on SOUND_PRIME && PCI |
91 | help | 91 | help |
92 | This module drives the Crystal SoundFusion devices (CS4280/46xx | 92 | This module drives the Crystal SoundFusion devices (CS4280/46xx |
93 | series) when wired as native sound drivers with AC97 codecs. If | 93 | series) when wired as native sound drivers with AC97 codecs. If |
@@ -95,7 +95,7 @@ config SOUND_FUSION | |||
95 | 95 | ||
96 | config SOUND_CS4281 | 96 | config SOUND_CS4281 |
97 | tristate "Crystal Sound CS4281" | 97 | tristate "Crystal Sound CS4281" |
98 | depends on SOUND_PRIME | 98 | depends on SOUND_PRIME && PCI |
99 | help | 99 | help |
100 | Picture and feature list at | 100 | Picture and feature list at |
101 | <http://www.pcbroker.com/crystal4281.html>. | 101 | <http://www.pcbroker.com/crystal4281.html>. |
@@ -179,7 +179,7 @@ config SOUND_HARMONY | |||
179 | 179 | ||
180 | config SOUND_SONICVIBES | 180 | config SOUND_SONICVIBES |
181 | tristate "S3 SonicVibes" | 181 | tristate "S3 SonicVibes" |
182 | depends on SOUND_PRIME | 182 | depends on SOUND_PRIME && PCI |
183 | help | 183 | help |
184 | Say Y or M if you have a PCI sound card utilizing the S3 | 184 | Say Y or M if you have a PCI sound card utilizing the S3 |
185 | SonicVibes chipset. To find out if your sound card uses a | 185 | SonicVibes chipset. To find out if your sound card uses a |
@@ -226,7 +226,7 @@ config SOUND_AU1550_AC97 | |||
226 | 226 | ||
227 | config SOUND_TRIDENT | 227 | config SOUND_TRIDENT |
228 | tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core" | 228 | tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core" |
229 | depends on SOUND_PRIME | 229 | depends on SOUND_PRIME && PCI |
230 | ---help--- | 230 | ---help--- |
231 | Say Y or M if you have a PCI sound card utilizing the Trident | 231 | Say Y or M if you have a PCI sound card utilizing the Trident |
232 | 4DWave-DX/NX chipset or your mother board chipset has SiS 7018 | 232 | 4DWave-DX/NX chipset or your mother board chipset has SiS 7018 |
@@ -503,7 +503,7 @@ config SOUND_VIA82CXXX | |||
503 | 503 | ||
504 | config MIDI_VIA82CXXX | 504 | config MIDI_VIA82CXXX |
505 | bool "VIA 82C686 MIDI" | 505 | bool "VIA 82C686 MIDI" |
506 | depends on SOUND_VIA82CXXX | 506 | depends on SOUND_VIA82CXXX && ISA_DMA_API |
507 | help | 507 | help |
508 | Answer Y to use the MIDI interface of the Via686. You may need to | 508 | Answer Y to use the MIDI interface of the Via686. You may need to |
509 | enable this in the BIOS before it will work. This is for connection | 509 | enable this in the BIOS before it will work. This is for connection |
@@ -512,7 +512,7 @@ config MIDI_VIA82CXXX | |||
512 | 512 | ||
513 | config SOUND_OSS | 513 | config SOUND_OSS |
514 | tristate "OSS sound modules" | 514 | tristate "OSS sound modules" |
515 | depends on SOUND_PRIME | 515 | depends on SOUND_PRIME && ISA_DMA_API |
516 | help | 516 | help |
517 | OSS is the Open Sound System suite of sound card drivers. They make | 517 | OSS is the Open Sound System suite of sound card drivers. They make |
518 | sound programming easier since they provide a common API. Say Y or | 518 | sound programming easier since they provide a common API. Say Y or |
diff --git a/sound/oss/Makefile b/sound/oss/Makefile index db9afb61d6ff..9bf3ee544d86 100644 --- a/sound/oss/Makefile +++ b/sound/oss/Makefile | |||
@@ -80,7 +80,7 @@ obj-$(CONFIG_SOUND_ALI5455) += ali5455.o ac97_codec.o | |||
80 | obj-$(CONFIG_SOUND_IT8172) += ite8172.o ac97_codec.o | 80 | obj-$(CONFIG_SOUND_IT8172) += ite8172.o ac97_codec.o |
81 | obj-$(CONFIG_SOUND_FORTE) += forte.o ac97_codec.o | 81 | obj-$(CONFIG_SOUND_FORTE) += forte.o ac97_codec.o |
82 | 82 | ||
83 | obj-$(CONFIG_SOUND_AD1980) += ac97_plugin_ad1980.o | 83 | obj-$(CONFIG_SOUND_AD1980) += ac97_plugin_ad1980.o ac97_codec.o |
84 | obj-$(CONFIG_SOUND_WM97XX) += ac97_plugin_wm97xx.o | 84 | obj-$(CONFIG_SOUND_WM97XX) += ac97_plugin_wm97xx.o |
85 | 85 | ||
86 | ifeq ($(CONFIG_MIDI_EMU10K1),y) | 86 | ifeq ($(CONFIG_MIDI_EMU10K1),y) |
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c index 7e9f667cf7a7..b9a640fe48b1 100644 --- a/sound/oss/i810_audio.c +++ b/sound/oss/i810_audio.c | |||
@@ -3430,9 +3430,9 @@ out_iospace: | |||
3430 | release_mem_region(card->iobase_mmio_phys, 256); | 3430 | release_mem_region(card->iobase_mmio_phys, 256); |
3431 | } | 3431 | } |
3432 | out_pio: | 3432 | out_pio: |
3433 | release_region(card->iobase, 64); | ||
3434 | out_region2: | ||
3435 | release_region(card->ac97base, 256); | 3433 | release_region(card->ac97base, 256); |
3434 | out_region2: | ||
3435 | release_region(card->iobase, 64); | ||
3436 | out_region1: | 3436 | out_region1: |
3437 | pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH, | 3437 | pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH, |
3438 | card->channel, card->chandma); | 3438 | card->channel, card->chandma); |
diff --git a/sound/oss/vidc.h b/sound/oss/vidc.h index bab7044572d3..d5b8064dc565 100644 --- a/sound/oss/vidc.h +++ b/sound/oss/vidc.h | |||
@@ -10,10 +10,6 @@ | |||
10 | * VIDC sound function prototypes | 10 | * VIDC sound function prototypes |
11 | */ | 11 | */ |
12 | 12 | ||
13 | /* vidc.c */ | ||
14 | |||
15 | extern int vidc_busy; | ||
16 | |||
17 | /* vidc_fill.S */ | 13 | /* vidc_fill.S */ |
18 | 14 | ||
19 | /* | 15 | /* |
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index 6d7a00f34d82..26b42bb20a0a 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig | |||
@@ -314,7 +314,7 @@ config SND_YMFPCI | |||
314 | 314 | ||
315 | config SND_ALS4000 | 315 | config SND_ALS4000 |
316 | tristate "Avance Logic ALS4000" | 316 | tristate "Avance Logic ALS4000" |
317 | depends on SND | 317 | depends on SND && ISA_DMA_API |
318 | select SND_OPL3_LIB | 318 | select SND_OPL3_LIB |
319 | select SND_MPU401_UART | 319 | select SND_MPU401_UART |
320 | select SND_PCM | 320 | select SND_PCM |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 7c806bd9cc90..d7af3e474432 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -2376,6 +2376,9 @@ static int intel8x0_suspend(snd_card_t *card, pm_message_t state) | |||
2376 | snd_ac97_suspend(chip->ac97[i]); | 2376 | snd_ac97_suspend(chip->ac97[i]); |
2377 | if (chip->device_type == DEVICE_INTEL_ICH4) | 2377 | if (chip->device_type == DEVICE_INTEL_ICH4) |
2378 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); | 2378 | chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); |
2379 | |||
2380 | if (chip->irq >= 0) | ||
2381 | free_irq(chip->irq, (void *)chip); | ||
2379 | pci_disable_device(chip->pci); | 2382 | pci_disable_device(chip->pci); |
2380 | return 0; | 2383 | return 0; |
2381 | } | 2384 | } |
@@ -2387,7 +2390,9 @@ static int intel8x0_resume(snd_card_t *card) | |||
2387 | 2390 | ||
2388 | pci_enable_device(chip->pci); | 2391 | pci_enable_device(chip->pci); |
2389 | pci_set_master(chip->pci); | 2392 | pci_set_master(chip->pci); |
2390 | snd_intel8x0_chip_init(chip, 0); | 2393 | request_irq(chip->irq, snd_intel8x0_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, (void *)chip); |
2394 | synchronize_irq(chip->irq); | ||
2395 | snd_intel8x0_chip_init(chip, 1); | ||
2391 | 2396 | ||
2392 | /* re-initialize mixer stuff */ | 2397 | /* re-initialize mixer stuff */ |
2393 | if (chip->device_type == DEVICE_INTEL_ICH4) { | 2398 | if (chip->device_type == DEVICE_INTEL_ICH4) { |
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 844d76152ea2..c89e82eb06a6 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c | |||
@@ -765,7 +765,8 @@ snd_pmac_ctrl_intr(int irq, void *devid, struct pt_regs *regs) | |||
765 | */ | 765 | */ |
766 | static void snd_pmac_sound_feature(pmac_t *chip, int enable) | 766 | static void snd_pmac_sound_feature(pmac_t *chip, int enable) |
767 | { | 767 | { |
768 | ppc_md.feature_call(PMAC_FTR_SOUND_CHIP_ENABLE, chip->node, 0, enable); | 768 | if (ppc_md.feature_call) |
769 | ppc_md.feature_call(PMAC_FTR_SOUND_CHIP_ENABLE, chip->node, 0, enable); | ||
769 | } | 770 | } |
770 | 771 | ||
771 | /* | 772 | /* |