aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-02-14 22:36:31 -0500
committerSteve French <sfrench@us.ibm.com>2006-02-14 22:36:31 -0500
commit0ed3f64ec3a7ad29e83e03607115eeffa32f553c (patch)
tree528681b043e947cfc51527d56098f586b6dfa217
parent5815449d1bfcb22f74b0e36a8b0631d6584cb7fc (diff)
parent10ee39fe3ff618d274e1cd0f6abbc2917b736bfd (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--Documentation/fujitsu/frv/kernel-ABI.txt234
-rw-r--r--Documentation/hwmon/w83627hf4
-rw-r--r--Documentation/kprobes.txt81
-rw-r--r--Documentation/mips/AU1xxx_IDE.README6
-rw-r--r--Documentation/powerpc/booting-without-of.txt60
-rw-r--r--MAINTAINERS18
-rw-r--r--Makefile2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c29
-rw-r--r--arch/arm/mach-s3c2410/s3c2400.h31
-rw-r--r--arch/frv/Kconfig4
-rw-r--r--arch/frv/Makefile2
-rw-r--r--arch/frv/kernel/break.S77
-rw-r--r--arch/frv/kernel/entry-table.S39
-rw-r--r--arch/frv/kernel/entry.S91
-rw-r--r--arch/frv/kernel/head.S3
-rw-r--r--arch/frv/kernel/irq.c41
-rw-r--r--arch/frv/mm/kmap.c9
-rw-r--r--arch/h8300/Kconfig4
-rw-r--r--arch/h8300/Kconfig.cpu2
-rw-r--r--arch/i386/boot/.gitignore3
-rw-r--r--arch/i386/boot/tools/.gitignore1
-rw-r--r--arch/i386/kernel/.gitignore1
-rw-r--r--arch/i386/kernel/head.S4
-rw-r--r--arch/i386/kernel/syscall_table.S2
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c5
-rw-r--r--arch/i386/kernel/vsyscall-sysenter.S15
-rw-r--r--arch/i386/oprofile/backtrace.c19
-rw-r--r--arch/m68k/Kconfig4
-rw-r--r--arch/m68k/fpsp040/bindec.S5
-rw-r--r--arch/m68k/fpsp040/binstr.S5
-rw-r--r--arch/m68k/fpsp040/bugfix.S5
-rw-r--r--arch/m68k/fpsp040/decbin.S5
-rw-r--r--arch/m68k/fpsp040/do_func.S5
-rw-r--r--arch/m68k/fpsp040/fpsp.h5
-rw-r--r--arch/m68k/fpsp040/gen_except.S5
-rw-r--r--arch/m68k/fpsp040/get_op.S5
-rw-r--r--arch/m68k/fpsp040/kernel_ex.S5
-rw-r--r--arch/m68k/fpsp040/res_func.S5
-rw-r--r--arch/m68k/fpsp040/round.S5
-rw-r--r--arch/m68k/fpsp040/sacos.S5
-rw-r--r--arch/m68k/fpsp040/sasin.S5
-rw-r--r--arch/m68k/fpsp040/satan.S5
-rw-r--r--arch/m68k/fpsp040/satanh.S5
-rw-r--r--arch/m68k/fpsp040/scale.S5
-rw-r--r--arch/m68k/fpsp040/scosh.S5
-rw-r--r--arch/m68k/fpsp040/setox.S5
-rw-r--r--arch/m68k/fpsp040/sgetem.S5
-rw-r--r--arch/m68k/fpsp040/sint.S5
-rw-r--r--arch/m68k/fpsp040/skeleton.S5
-rw-r--r--arch/m68k/fpsp040/slog2.S5
-rw-r--r--arch/m68k/fpsp040/slogn.S5
-rw-r--r--arch/m68k/fpsp040/smovecr.S5
-rw-r--r--arch/m68k/fpsp040/srem_mod.S5
-rw-r--r--arch/m68k/fpsp040/ssin.S5
-rw-r--r--arch/m68k/fpsp040/ssinh.S5
-rw-r--r--arch/m68k/fpsp040/stan.S5
-rw-r--r--arch/m68k/fpsp040/stanh.S5
-rw-r--r--arch/m68k/fpsp040/sto_res.S5
-rw-r--r--arch/m68k/fpsp040/stwotox.S5
-rw-r--r--arch/m68k/fpsp040/tbldo.S5
-rw-r--r--arch/m68k/fpsp040/util.S5
-rw-r--r--arch/m68k/fpsp040/x_bsun.S5
-rw-r--r--arch/m68k/fpsp040/x_fline.S5
-rw-r--r--arch/m68k/fpsp040/x_operr.S5
-rw-r--r--arch/m68k/fpsp040/x_ovfl.S5
-rw-r--r--arch/m68k/fpsp040/x_snan.S5
-rw-r--r--arch/m68k/fpsp040/x_store.S5
-rw-r--r--arch/m68k/fpsp040/x_unfl.S5
-rw-r--r--arch/m68k/fpsp040/x_unimp.S5
-rw-r--r--arch/m68k/fpsp040/x_unsupp.S5
-rw-r--r--arch/m68knommu/Kconfig4
-rw-r--r--arch/mips/Makefile1
-rw-r--r--arch/mips/kernel/process.c158
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mips/kernel/signal-common.h2
-rw-r--r--arch/mips/kernel/signal32.c2
-rw-r--r--arch/mips/kernel/signal_n32.c2
-rw-r--r--arch/mips/kernel/smp_mt.c34
-rw-r--r--arch/mips/mm/c-r4k.c104
-rw-r--r--arch/mips/mm/c-tx39.c70
-rw-r--r--arch/parisc/Kconfig5
-rw-r--r--arch/parisc/kernel/syscall_table.S6
-rw-r--r--arch/powerpc/Kconfig6
-rw-r--r--arch/powerpc/Makefile1
-rw-r--r--arch/powerpc/kernel/Makefile6
-rw-r--r--arch/powerpc/kernel/systbl.S3
-rw-r--r--arch/ppc/kernel/misc.S283
-rw-r--r--arch/s390/defconfig9
-rw-r--r--arch/s390/kernel/compat_linux.c20
-rw-r--r--arch/s390/kernel/compat_signal.c3
-rw-r--r--arch/s390/kernel/compat_wrapper.S13
-rw-r--r--arch/s390/kernel/machine_kexec.c5
-rw-r--r--arch/s390/kernel/smp.c6
-rw-r--r--arch/s390/kernel/syscalls.S3
-rw-r--r--arch/s390/lib/delay.c2
-rw-r--r--arch/sparc/kernel/systbls.S2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c21
-rw-r--r--arch/sparc64/kernel/systbls.S4
-rw-r--r--arch/v850/Kconfig4
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--arch/x86_64/ia32/sys_ia32.c22
-rw-r--r--arch/x86_64/kernel/apic.c2
-rw-r--r--arch/x86_64/kernel/pci-gart.c6
-rw-r--r--arch/x86_64/kernel/time.c12
-rw-r--r--arch/x86_64/kernel/traps.c18
-rw-r--r--drivers/block/pktcdvd.c59
-rw-r--r--drivers/bluetooth/bt3c_cs.c17
-rw-r--r--drivers/char/drm/drm_pciids.h1
-rw-r--r--drivers/char/esp.c22
-rw-r--r--drivers/char/hpet.c22
-rw-r--r--drivers/char/tipar.c15
-rw-r--r--drivers/char/tty_io.c7
-rw-r--r--drivers/char/watchdog/pcwd.c450
-rw-r--r--drivers/char/watchdog/sa1100_wdt.c12
-rw-r--r--drivers/cpufreq/cpufreq.c110
-rw-r--r--drivers/hwmon/it87.c3
-rw-r--r--drivers/hwmon/vt8231.c8
-rw-r--r--drivers/hwmon/w83781d.c43
-rw-r--r--drivers/i2c/busses/i2c-isa.c12
-rw-r--r--drivers/infiniband/core/mad.c10
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c38
-rw-r--r--drivers/infiniband/hw/mthca/mthca_dev.h4
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c28
-rw-r--r--drivers/isdn/i4l/isdn_tty.c4
-rw-r--r--drivers/net/appletalk/cops.h2
-rw-r--r--drivers/net/wireless/orinoco_cs.c1
-rw-r--r--drivers/parisc/ccio-dma.c160
-rw-r--r--drivers/parisc/sba_iommu.c125
-rw-r--r--drivers/s390/char/sclp.c13
-rw-r--r--drivers/s390/cio/chsc.c10
-rw-r--r--drivers/serial/ioc4_serial.c14
-rw-r--r--drivers/usb/host/pci-quirks.c16
-rw-r--r--drivers/usb/host/sl811_cs.c4
-rw-r--r--drivers/usb/input/hid-core.c50
-rw-r--r--drivers/usb/misc/Kconfig2
-rw-r--r--drivers/usb/misc/ldusb.c57
-rw-r--r--drivers/usb/serial/pl2303.c5
-rw-r--r--drivers/usb/serial/pl2303.h4
-rw-r--r--drivers/usb/storage/unusual_devs.h52
-rw-r--r--drivers/video/Kconfig5
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/neofb.c8
-rw-r--r--drivers/video/nvidia/nvidia.c2
-rw-r--r--fs/compat.c37
-rw-r--r--fs/jbd/checkpoint.c418
-rw-r--r--fs/jbd/commit.c3
-rw-r--r--fs/lockd/clntlock.c27
-rw-r--r--fs/lockd/svc4proc.c2
-rw-r--r--fs/lockd/svcproc.c2
-rw-r--r--fs/reiserfs/super.c2
-rw-r--r--fs/reiserfs/xattr_acl.c3
-rw-r--r--fs/select.c32
-rw-r--r--fs/stat.c22
-rw-r--r--include/asm-alpha/mman.h2
-rw-r--r--include/asm-arm/arch-s3c2410/h1940-latch.h64
-rw-r--r--include/asm-arm/mman.h2
-rw-r--r--include/asm-arm26/mman.h2
-rw-r--r--include/asm-cris/mman.h2
-rw-r--r--include/asm-frv/atomic.h6
-rw-r--r--include/asm-frv/cacheflush.h12
-rw-r--r--include/asm-frv/io.h1
-rw-r--r--include/asm-frv/mman.h2
-rw-r--r--include/asm-frv/spr-regs.h1
-rw-r--r--include/asm-frv/system.h88
-rw-r--r--include/asm-frv/uaccess.h3
-rw-r--r--include/asm-frv/unistd.h28
-rw-r--r--include/asm-h8300/mman.h2
-rw-r--r--include/asm-i386/mman.h2
-rw-r--r--include/asm-i386/topology.h2
-rw-r--r--include/asm-i386/unistd.h2
-rw-r--r--include/asm-ia64/mman.h2
-rw-r--r--include/asm-m32r/mman.h2
-rw-r--r--include/asm-m68k/mman.h2
-rw-r--r--include/asm-mips/cpu.h6
-rw-r--r--include/asm-mips/gcc/sgidefs.h17
-rw-r--r--include/asm-mips/mach-generic/timex.h11
-rw-r--r--include/asm-mips/mach-rm200/timex.h13
-rw-r--r--include/asm-mips/mman.h2
-rw-r--r--include/asm-mips/r4kcache.h74
-rw-r--r--include/asm-mips/uaccess.h5
-rw-r--r--include/asm-mips/unistd.h4
-rw-r--r--include/asm-parisc/mman.h2
-rw-r--r--include/asm-powerpc/mman.h2
-rw-r--r--include/asm-powerpc/unistd.h3
-rw-r--r--include/asm-s390/bitops.h4
-rw-r--r--include/asm-s390/mman.h2
-rw-r--r--include/asm-s390/setup.h10
-rw-r--r--include/asm-s390/smp.h1
-rw-r--r--include/asm-s390/unistd.h7
-rw-r--r--include/asm-sh/mman.h2
-rw-r--r--include/asm-sparc/mman.h2
-rw-r--r--include/asm-sparc/unistd.h2
-rw-r--r--include/asm-sparc64/mman.h2
-rw-r--r--include/asm-sparc64/unistd.h2
-rw-r--r--include/asm-v850/mman.h2
-rw-r--r--include/asm-x86_64/hpet.h2
-rw-r--r--include/asm-x86_64/ia32_unistd.h2
-rw-r--r--include/asm-x86_64/mman.h2
-rw-r--r--include/asm-xtensa/mman.h2
-rw-r--r--include/linux/compat.h20
-rw-r--r--include/linux/jbd.h8
-rw-r--r--include/linux/lockd/lockd.h6
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/sched.h5
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/time.h25
-rw-r--r--include/net/bluetooth/rfcomm.h2
-rw-r--r--include/net/irda/irda.h6
-rw-r--r--kernel/hrtimer.c13
-rw-r--r--kernel/ptrace.c3
-rw-r--r--kernel/sched.c10
-rw-r--r--mm/hugetlb.c4
-rw-r--r--mm/madvise.c21
-rw-r--r--mm/page_alloc.c22
-rw-r--r--mm/swap.c2
-rw-r--r--mm/vmscan.c81
-rw-r--r--net/802/p8023.c2
-rw-r--r--net/atm/signaling.c3
-rw-r--r--net/bluetooth/hci_sock.c10
-rw-r--r--net/bluetooth/rfcomm/core.c13
-rw-r--r--net/bridge/br_netfilter.c4
-rw-r--r--net/core/datagram.c81
-rw-r--r--net/ipv4/icmp.c2
-rw-r--r--net/ipv6/raw.c5
-rw-r--r--net/netfilter/Kconfig4
-rw-r--r--net/netlink/genetlink.c11
-rw-r--r--net/xfrm/xfrm_policy.c4
228 files changed, 2563 insertions, 2007 deletions
diff --git a/Documentation/fujitsu/frv/kernel-ABI.txt b/Documentation/fujitsu/frv/kernel-ABI.txt
new file mode 100644
index 000000000000..0ed9b0a779bc
--- /dev/null
+++ b/Documentation/fujitsu/frv/kernel-ABI.txt
@@ -0,0 +1,234 @@
1 =================================
2 INTERNAL KERNEL ABI FOR FR-V ARCH
3 =================================
4
5The internal FRV kernel ABI is not quite the same as the userspace ABI. A number of the registers
6are used for special purposed, and the ABI is not consistent between modules vs core, and MMU vs
7no-MMU.
8
9This partly stems from the fact that FRV CPUs do not have a separate supervisor stack pointer, and
10most of them do not have any scratch registers, thus requiring at least one general purpose
11register to be clobbered in such an event. Also, within the kernel core, it is possible to simply
12jump or call directly between functions using a relative offset. This cannot be extended to modules
13for the displacement is likely to be too far. Thus in modules the address of a function to call
14must be calculated in a register and then used, requiring two extra instructions.
15
16This document has the following sections:
17
18 (*) System call register ABI
19 (*) CPU operating modes
20 (*) Internal kernel-mode register ABI
21 (*) Internal debug-mode register ABI
22 (*) Virtual interrupt handling
23
24
25========================
26SYSTEM CALL REGISTER ABI
27========================
28
29When a system call is made, the following registers are effective:
30
31 REGISTERS CALL RETURN
32 =============== ======================= =======================
33 GR7 System call number Preserved
34 GR8 Syscall arg #1 Return value
35 GR9-GR13 Syscall arg #2-6 Preserved
36
37
38===================
39CPU OPERATING MODES
40===================
41
42The FR-V CPU has three basic operating modes. In order of increasing capability:
43
44 (1) User mode.
45
46 Basic userspace running mode.
47
48 (2) Kernel mode.
49
50 Normal kernel mode. There are many additional control registers available that may be
51 accessed in this mode, in addition to all the stuff available to user mode. This has two
52 submodes:
53
54 (a) Exceptions enabled (PSR.T == 1).
55
56 Exceptions will invoke the appropriate normal kernel mode handler. On entry to the
57 handler, the PSR.T bit will be cleared.
58
59 (b) Exceptions disabled (PSR.T == 0).
60
61 No exceptions or interrupts may happen. Any mandatory exceptions will cause the CPU to
62 halt unless the CPU is told to jump into debug mode instead.
63
64 (3) Debug mode.
65
66 No exceptions may happen in this mode. Memory protection and management exceptions will be
67 flagged for later consideration, but the exception handler won't be invoked. Debugging traps
68 such as hardware breakpoints and watchpoints will be ignored. This mode is entered only by
69 debugging events obtained from the other two modes.
70
71 All kernel mode registers may be accessed, plus a few extra debugging specific registers.
72
73
74=================================
75INTERNAL KERNEL-MODE REGISTER ABI
76=================================
77
78There are a number of permanent register assignments that are set up by entry.S in the exception
79prologue. Note that there is a complete set of exception prologues for each of user->kernel
80transition and kernel->kernel transition. There are also user->debug and kernel->debug mode
81transition prologues.
82
83
84 REGISTER FLAVOUR USE
85 =============== ======= ====================================================
86 GR1 Supervisor stack pointer
87 GR15 Current thread info pointer
88 GR16 GP-Rel base register for small data
89 GR28 Current exception frame pointer (__frame)
90 GR29 Current task pointer (current)
91 GR30 Destroyed by kernel mode entry
92 GR31 NOMMU Destroyed by debug mode entry
93 GR31 MMU Destroyed by TLB miss kernel mode entry
94 CCR.ICC2 Virtual interrupt disablement tracking
95 CCCR.CC3 Cleared by exception prologue (atomic op emulation)
96 SCR0 MMU See mmu-layout.txt.
97 SCR1 MMU See mmu-layout.txt.
98 SCR2 MMU Save for EAR0 (destroyed by icache insns in debug mode)
99 SCR3 MMU Save for GR31 during debug exceptions
100 DAMR/IAMR NOMMU Fixed memory protection layout.
101 DAMR/IAMR MMU See mmu-layout.txt.
102
103
104Certain registers are also used or modified across function calls:
105
106 REGISTER CALL RETURN
107 =============== =============================== ===============================
108 GR0 Fixed Zero -
109 GR2 Function call frame pointer
110 GR3 Special Preserved
111 GR3-GR7 - Clobbered
112 GR8 Function call arg #1 Return value (or clobbered)
113 GR9 Function call arg #2 Return value MSW (or clobbered)
114 GR10-GR13 Function call arg #3-#6 Clobbered
115 GR14 - Clobbered
116 GR15-GR16 Special Preserved
117 GR17-GR27 - Preserved
118 GR28-GR31 Special Only accessed explicitly
119 LR Return address after CALL Clobbered
120 CCR/CCCR - Mostly Clobbered
121
122
123================================
124INTERNAL DEBUG-MODE REGISTER ABI
125================================
126
127This is the same as the kernel-mode register ABI for functions calls. The difference is that in
128debug-mode there's a different stack and a different exception frame. Almost all the global
129registers from kernel-mode (including the stack pointer) may be changed.
130
131 REGISTER FLAVOUR USE
132 =============== ======= ====================================================
133 GR1 Debug stack pointer
134 GR16 GP-Rel base register for small data
135 GR31 Current debug exception frame pointer (__debug_frame)
136 SCR3 MMU Saved value of GR31
137
138
139Note that debug mode is able to interfere with the kernel's emulated atomic ops, so it must be
140exceedingly careful not to do any that would interact with the main kernel in this regard. Hence
141the debug mode code (gdbstub) is almost completely self-contained. The only external code used is
142the sprintf family of functions.
143
144Futhermore, break.S is so complicated because single-step mode does not switch off on entry to an
145exception. That means unless manually disabled, single-stepping will blithely go on stepping into
146things like interrupts. See gdbstub.txt for more information.
147
148
149==========================
150VIRTUAL INTERRUPT HANDLING
151==========================
152
153Because accesses to the PSR is so slow, and to disable interrupts we have to access it twice (once
154to read and once to write), we don't actually disable interrupts at all if we don't have to. What
155we do instead is use the ICC2 condition code flags to note virtual disablement, such that if we
156then do take an interrupt, we note the flag, really disable interrupts, set another flag and resume
157execution at the point the interrupt happened. Setting condition flags as a side effect of an
158arithmetic or logical instruction is really fast. This use of the ICC2 only occurs within the
159kernel - it does not affect userspace.
160
161The flags we use are:
162
163 (*) CCR.ICC2.Z [Zero flag]
164
165 Set to virtually disable interrupts, clear when interrupts are virtually enabled. Can be
166 modified by logical instructions without affecting the Carry flag.
167
168 (*) CCR.ICC2.C [Carry flag]
169
170 Clear to indicate hardware interrupts are really disabled, set otherwise.
171
172
173What happens is this:
174
175 (1) Normal kernel-mode operation.
176
177 ICC2.Z is 0, ICC2.C is 1.
178
179 (2) An interrupt occurs. The exception prologue examines ICC2.Z and determines that nothing needs
180 doing. This is done simply with an unlikely BEQ instruction.
181
182 (3) The interrupts are disabled (local_irq_disable)
183
184 ICC2.Z is set to 1.
185
186 (4) If interrupts were then re-enabled (local_irq_enable):
187
188 ICC2.Z would be set to 0.
189
190 A TIHI #2 instruction (trap #2 if condition HI - Z==0 && C==0) would be used to trap if
191 interrupts were now virtually enabled, but physically disabled - which they're not, so the
192 trap isn't taken. The kernel would then be back to state (1).
193
194 (5) An interrupt occurs. The exception prologue examines ICC2.Z and determines that the interrupt
195 shouldn't actually have happened. It jumps aside, and there disabled interrupts by setting
196 PSR.PIL to 14 and then it clears ICC2.C.
197
198 (6) If interrupts were then saved and disabled again (local_irq_save):
199
200 ICC2.Z would be shifted into the save variable and masked off (giving a 1).
201
202 ICC2.Z would then be set to 1 (thus unchanged), and ICC2.C would be unaffected (ie: 0).
203
204 (7) If interrupts were then restored from state (6) (local_irq_restore):
205
206 ICC2.Z would be set to indicate the result of XOR'ing the saved value (ie: 1) with 1, which
207 gives a result of 0 - thus leaving ICC2.Z set.
208
209 ICC2.C would remain unaffected (ie: 0).
210
211 A TIHI #2 instruction would be used to again assay the current state, but this would do
212 nothing as Z==1.
213
214 (8) If interrupts were then enabled (local_irq_enable):
215
216 ICC2.Z would be cleared. ICC2.C would be left unaffected. Both flags would now be 0.
217
218 A TIHI #2 instruction again issued to assay the current state would then trap as both Z==0
219 [interrupts virtually enabled] and C==0 [interrupts really disabled] would then be true.
220
221 (9) The trap #2 handler would simply enable hardware interrupts (set PSR.PIL to 0), set ICC2.C to
222 1 and return.
223
224(10) Immediately upon returning, the pending interrupt would be taken.
225
226(11) The interrupt handler would take the path of actually processing the interrupt (ICC2.Z is
227 clear, BEQ fails as per step (2)).
228
229(12) The interrupt handler would then set ICC2.C to 1 since hardware interrupts are definitely
230 enabled - or else the kernel wouldn't be here.
231
232(13) On return from the interrupt handler, things would be back to state (1).
233
234This trap (#2) is only available in kernel mode. In user mode it will result in SIGILL.
diff --git a/Documentation/hwmon/w83627hf b/Documentation/hwmon/w83627hf
index 5d23776e9907..bbeaba680443 100644
--- a/Documentation/hwmon/w83627hf
+++ b/Documentation/hwmon/w83627hf
@@ -36,6 +36,10 @@ Module Parameters
36 (default is 1) 36 (default is 1)
37 Use 'init=0' to bypass initializing the chip. 37 Use 'init=0' to bypass initializing the chip.
38 Try this if your computer crashes when you load the module. 38 Try this if your computer crashes when you load the module.
39* reset: int
40 (default is 0)
41 The driver used to reset the chip on load, but does no more. Use
42 'reset=1' to restore the old behavior. Report if you need to do this.
39 43
40Description 44Description
41----------- 45-----------
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt
index 0ea5a0c6e827..2c3b1eae4280 100644
--- a/Documentation/kprobes.txt
+++ b/Documentation/kprobes.txt
@@ -136,17 +136,20 @@ Kprobes, jprobes, and return probes are implemented on the following
136architectures: 136architectures:
137 137
138- i386 138- i386
139- x86_64 (AMD-64, E64MT) 139- x86_64 (AMD-64, EM64T)
140- ppc64 140- ppc64
141- ia64 (Support for probes on certain instruction types is still in progress.) 141- ia64 (Does not support probes on instruction slot1.)
142- sparc64 (Return probes not yet implemented.) 142- sparc64 (Return probes not yet implemented.)
143 143
1443. Configuring Kprobes 1443. Configuring Kprobes
145 145
146When configuring the kernel using make menuconfig/xconfig/oldconfig, 146When configuring the kernel using make menuconfig/xconfig/oldconfig,
147ensure that CONFIG_KPROBES is set to "y". Under "Kernel hacking", 147ensure that CONFIG_KPROBES is set to "y". Under "Instrumentation
148look for "Kprobes". You may have to enable "Kernel debugging" 148Support", look for "Kprobes".
149(CONFIG_DEBUG_KERNEL) before you can enable Kprobes. 149
150So that you can load and unload Kprobes-based instrumentation modules,
151make sure "Loadable module support" (CONFIG_MODULES) and "Module
152unloading" (CONFIG_MODULE_UNLOAD) are set to "y".
150 153
151You may also want to ensure that CONFIG_KALLSYMS and perhaps even 154You may also want to ensure that CONFIG_KALLSYMS and perhaps even
152CONFIG_KALLSYMS_ALL are set to "y", since kallsyms_lookup_name() 155CONFIG_KALLSYMS_ALL are set to "y", since kallsyms_lookup_name()
@@ -262,18 +265,18 @@ at any time after the probe has been registered.
262 265
2635. Kprobes Features and Limitations 2665. Kprobes Features and Limitations
264 267
265As of Linux v2.6.12, Kprobes allows multiple probes at the same 268Kprobes allows multiple probes at the same address. Currently,
266address. Currently, however, there cannot be multiple jprobes on 269however, there cannot be multiple jprobes on the same function at
267the same function at the same time. 270the same time.
268 271
269In general, you can install a probe anywhere in the kernel. 272In general, you can install a probe anywhere in the kernel.
270In particular, you can probe interrupt handlers. Known exceptions 273In particular, you can probe interrupt handlers. Known exceptions
271are discussed in this section. 274are discussed in this section.
272 275
273For obvious reasons, it's a bad idea to install a probe in 276The register_*probe functions will return -EINVAL if you attempt
274the code that implements Kprobes (mostly kernel/kprobes.c and 277to install a probe in the code that implements Kprobes (mostly
275arch/*/kernel/kprobes.c). A patch in the v2.6.13 timeframe instructs 278kernel/kprobes.c and arch/*/kernel/kprobes.c, but also functions such
276Kprobes to reject such requests. 279as do_page_fault and notifier_call_chain).
277 280
278If you install a probe in an inline-able function, Kprobes makes 281If you install a probe in an inline-able function, Kprobes makes
279no attempt to chase down all inline instances of the function and 282no attempt to chase down all inline instances of the function and
@@ -290,18 +293,14 @@ from the accidental ones. Don't drink and probe.
290 293
291Kprobes makes no attempt to prevent probe handlers from stepping on 294Kprobes makes no attempt to prevent probe handlers from stepping on
292each other -- e.g., probing printk() and then calling printk() from a 295each other -- e.g., probing printk() and then calling printk() from a
293probe handler. As of Linux v2.6.12, if a probe handler hits a probe, 296probe handler. If a probe handler hits a probe, that second probe's
294that second probe's handlers won't be run in that instance. 297handlers won't be run in that instance, and the kprobe.nmissed member
295 298of the second probe will be incremented.
296In Linux v2.6.12 and previous versions, Kprobes' data structures are 299
297protected by a single lock that is held during probe registration and 300As of Linux v2.6.15-rc1, multiple handlers (or multiple instances of
298unregistration and while handlers are run. Thus, no two handlers 301the same handler) may run concurrently on different CPUs.
299can run simultaneously. To improve scalability on SMP systems, 302
300this restriction will probably be removed soon, in which case 303Kprobes does not use mutexes or allocate memory except during
301multiple handlers (or multiple instances of the same handler) may
302run concurrently on different CPUs. Code your handlers accordingly.
303
304Kprobes does not use semaphores or allocate memory except during
305registration and unregistration. 304registration and unregistration.
306 305
307Probe handlers are run with preemption disabled. Depending on the 306Probe handlers are run with preemption disabled. Depending on the
@@ -316,11 +315,18 @@ address instead of the real return address for kretprobed functions.
316(As far as we can tell, __builtin_return_address() is used only 315(As far as we can tell, __builtin_return_address() is used only
317for instrumentation and error reporting.) 316for instrumentation and error reporting.)
318 317
319If the number of times a function is called does not match the 318If the number of times a function is called does not match the number
320number of times it returns, registering a return probe on that 319of times it returns, registering a return probe on that function may
321function may produce undesirable results. We have the do_exit() 320produce undesirable results. We have the do_exit() case covered.
322and do_execve() cases covered. do_fork() is not an issue. We're 321do_execve() and do_fork() are not an issue. We're unaware of other
323unaware of other specific cases where this could be a problem. 322specific cases where this could be a problem.
323
324If, upon entry to or exit from a function, the CPU is running on
325a stack other than that of the current task, registering a return
326probe on that function may produce undesirable results. For this
327reason, Kprobes doesn't support return probes (or kprobes or jprobes)
328on the x86_64 version of __switch_to(); the registration functions
329return -EINVAL.
324 330
3256. Probe Overhead 3316. Probe Overhead
326 332
@@ -347,14 +353,12 @@ k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99
347 353
3487. TODO 3547. TODO
349 355
350a. SystemTap (http://sourceware.org/systemtap): Work in progress 356a. SystemTap (http://sourceware.org/systemtap): Provides a simplified
351to provide a simplified programming interface for probe-based 357programming interface for probe-based instrumentation. Try it out.
352instrumentation. 358b. Kernel return probes for sparc64.
353b. Improved SMP scalability: Currently, work is in progress to handle 359c. Support for other architectures.
354multiple kprobes in parallel. 360d. User-space probes.
355c. Kernel return probes for sparc64. 361e. Watchpoint probes (which fire on data references).
356d. Support for other architectures.
357e. User-space probes.
358 362
3598. Kprobes Example 3638. Kprobes Example
360 364
@@ -411,8 +415,7 @@ int init_module(void)
411 printk("Couldn't find %s to plant kprobe\n", "do_fork"); 415 printk("Couldn't find %s to plant kprobe\n", "do_fork");
412 return -1; 416 return -1;
413 } 417 }
414 ret = register_kprobe(&kp); 418 if ((ret = register_kprobe(&kp) < 0)) {
415 if (ret < 0) {
416 printk("register_kprobe failed, returned %d\n", ret); 419 printk("register_kprobe failed, returned %d\n", ret);
417 return -1; 420 return -1;
418 } 421 }
diff --git a/Documentation/mips/AU1xxx_IDE.README b/Documentation/mips/AU1xxx_IDE.README
index a7e4c4ea3560..afb31c141d9d 100644
--- a/Documentation/mips/AU1xxx_IDE.README
+++ b/Documentation/mips/AU1xxx_IDE.README
@@ -95,11 +95,13 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
95CONFIG_IDEDMA_PCI_AUTO=y 95CONFIG_IDEDMA_PCI_AUTO=y
96CONFIG_BLK_DEV_IDE_AU1XXX=y 96CONFIG_BLK_DEV_IDE_AU1XXX=y
97CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y 97CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
98CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON=y
99CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128 98CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
100CONFIG_BLK_DEV_IDEDMA=y 99CONFIG_BLK_DEV_IDEDMA=y
101CONFIG_IDEDMA_AUTO=y 100CONFIG_IDEDMA_AUTO=y
102 101
102Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable
103the burst support on DBDMA controller.
104
103If the used system need the USB support enable the following kernel configs for 105If the used system need the USB support enable the following kernel configs for
104high IDE to USB throughput. 106high IDE to USB throughput.
105 107
@@ -115,6 +117,8 @@ CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
115CONFIG_BLK_DEV_IDEDMA=y 117CONFIG_BLK_DEV_IDEDMA=y
116CONFIG_IDEDMA_AUTO=y 118CONFIG_IDEDMA_AUTO=y
117 119
120Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to
121disable the burst support on DBDMA controller.
118 122
119ADD NEW HARD DISC TO WHITE OR BLACK LIST 123ADD NEW HARD DISC TO WHITE OR BLACK LIST
120---------------------------------------- 124----------------------------------------
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 54e5f9b1536d..d02c64953dcd 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -44,7 +44,6 @@
44 compiler and the textural representation of 44 compiler and the textural representation of
45 the tree that can be "compiled" by dtc. 45 the tree that can be "compiled" by dtc.
46 46
47
48 November 21, 2005: Rev 0.5 47 November 21, 2005: Rev 0.5
49 - Additions/generalizations for 32-bit 48 - Additions/generalizations for 32-bit
50 - Changed to reflect the new arch/powerpc 49 - Changed to reflect the new arch/powerpc
@@ -1307,6 +1306,65 @@ platforms are moved over to use the flattened-device-tree model.
1307 }; 1306 };
1308 1307
1309 1308
1309 f) Freescale SOC USB controllers
1310
1311 The device node for a USB controller that is part of a Freescale
1312 SOC is as described in the document "Open Firmware Recommended
1313 Practice : Universal Serial Bus" with the following modifications
1314 and additions :
1315
1316 Required properties :
1317 - compatible : Should be "fsl-usb2-mph" for multi port host usb
1318 controllers, or "fsl-usb2-dr" for dual role usb controllers
1319 - phy_type : For multi port host usb controllers, should be one of
1320 "ulpi", or "serial". For dual role usb controllers, should be
1321 one of "ulpi", "utmi", "utmi_wide", or "serial".
1322 - reg : Offset and length of the register set for the device
1323 - port0 : boolean; if defined, indicates port0 is connected for
1324 fsl-usb2-mph compatible controllers. Either this property or
1325 "port1" (or both) must be defined for "fsl-usb2-mph" compatible
1326 controllers.
1327 - port1 : boolean; if defined, indicates port1 is connected for
1328 fsl-usb2-mph compatible controllers. Either this property or
1329 "port0" (or both) must be defined for "fsl-usb2-mph" compatible
1330 controllers.
1331
1332 Recommended properties :
1333 - interrupts : <a b> where a is the interrupt number and b is a
1334 field that represents an encoding of the sense and level
1335 information for the interrupt. This should be encoded based on
1336 the information in section 2) depending on the type of interrupt
1337 controller you have.
1338 - interrupt-parent : the phandle for the interrupt controller that
1339 services interrupts for this device.
1340
1341 Example multi port host usb controller device node :
1342 usb@22000 {
1343 device_type = "usb";
1344 compatible = "fsl-usb2-mph";
1345 reg = <22000 1000>;
1346 #address-cells = <1>;
1347 #size-cells = <0>;
1348 interrupt-parent = <700>;
1349 interrupts = <27 1>;
1350 phy_type = "ulpi";
1351 port0;
1352 port1;
1353 };
1354
1355 Example dual role usb controller device node :
1356 usb@23000 {
1357 device_type = "usb";
1358 compatible = "fsl-usb2-dr";
1359 reg = <23000 1000>;
1360 #address-cells = <1>;
1361 #size-cells = <0>;
1362 interrupt-parent = <700>;
1363 interrupts = <26 1>;
1364 phy = "ulpi";
1365 };
1366
1367
1310 More devices will be defined as this spec matures. 1368 More devices will be defined as this spec matures.
1311 1369
1312 1370
diff --git a/MAINTAINERS b/MAINTAINERS
index b22db521cec1..9c592aa0280c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2232,7 +2232,23 @@ P: Martin Schwidefsky
2232M: schwidefsky@de.ibm.com 2232M: schwidefsky@de.ibm.com
2233M: linux390@de.ibm.com 2233M: linux390@de.ibm.com
2234L: linux-390@vm.marist.edu 2234L: linux-390@vm.marist.edu
2235W: http://oss.software.ibm.com/developerworks/opensource/linux390 2235W: http://www.ibm.com/developerworks/linux/linux390/
2236S: Supported
2237
2238S390 NETWORK DRIVERS
2239P: Frank Pavlic
2240M: fpavlic@de.ibm.com
2241M: linux390@de.ibm.com
2242L: linux-390@vm.marist.edu
2243W: http://www.ibm.com/developerworks/linux/linux390/
2244S: Supported
2245
2246S390 ZFCP DRIVER
2247P: Andreas Herrmann
2248M: aherrman@de.ibm.com
2249M: linux390@de.ibm.com
2250L: linux-390@vm.marist.edu
2251W: http://www.ibm.com/developerworks/linux/linux390/
2236S: Supported 2252S: Supported
2237 2253
2238SAA7146 VIDEO4LINUX-2 DRIVER 2254SAA7146 VIDEO4LINUX-2 DRIVER
diff --git a/Makefile b/Makefile
index a1158d1c051e..74d67b2c35d9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 16 3SUBLEVEL = 16
4EXTRAVERSION =-rc2 4EXTRAVERSION =-rc3
5NAME=Sliding Snow Leopard 5NAME=Sliding Snow Leopard
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 1c316f14ed94..646a3a5d33a5 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -46,10 +46,11 @@
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/mach-types.h> 47#include <asm/mach-types.h>
48 48
49//#include <asm/debug-ll.h> 49
50#include <asm/arch/regs-serial.h> 50#include <asm/arch/regs-serial.h>
51#include <asm/arch/regs-lcd.h> 51#include <asm/arch/regs-lcd.h>
52 52
53#include <asm/arch/h1940-latch.h>
53#include <asm/arch/fb.h> 54#include <asm/arch/fb.h>
54 55
55#include <linux/serial_core.h> 56#include <linux/serial_core.h>
@@ -59,7 +60,12 @@
59#include "cpu.h" 60#include "cpu.h"
60 61
61static struct map_desc h1940_iodesc[] __initdata = { 62static struct map_desc h1940_iodesc[] __initdata = {
62 /* nothing here yet */ 63 [0] = {
64 .virtual = (unsigned long)H1940_LATCH,
65 .pfn = __phys_to_pfn(H1940_PA_LATCH),
66 .length = SZ_16K,
67 .type = MT_DEVICE
68 },
63}; 69};
64 70
65#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 71#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
@@ -92,6 +98,25 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
92 } 98 }
93}; 99};
94 100
101/* Board control latch control */
102
103static unsigned int latch_state = H1940_LATCH_DEFAULT;
104
105void h1940_latch_control(unsigned int clear, unsigned int set)
106{
107 unsigned long flags;
108
109 local_irq_save(flags);
110
111 latch_state &= ~clear;
112 latch_state |= set;
113
114 __raw_writel(latch_state, H1940_LATCH);
115
116 local_irq_restore(flags);
117}
118
119EXPORT_SYMBOL_GPL(h1940_latch_control);
95 120
96 121
97/** 122/**
diff --git a/arch/arm/mach-s3c2410/s3c2400.h b/arch/arm/mach-s3c2410/s3c2400.h
new file mode 100644
index 000000000000..8b2394e1ed40
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2400.h
@@ -0,0 +1,31 @@
1/* arch/arm/mach-s3c2410/s3c2400.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C2400 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13 * 09-Fev-2006 LCVR First version, based on s3c2410.h
14*/
15
16#ifdef CONFIG_CPU_S3C2400
17
18extern int s3c2400_init(void);
19
20extern void s3c2400_map_io(struct map_desc *mach_desc, int size);
21
22extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no);
23
24extern void s3c2400_init_clocks(int xtal);
25
26#else
27#define s3c2400_init_clocks NULL
28#define s3c2400_init_uarts NULL
29#define s3c2400_map_io NULL
30#define s3c2400_init NULL
31#endif
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 60a617aff8ba..e08383712370 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -25,6 +25,10 @@ config GENERIC_HARDIRQS
25 bool 25 bool
26 default n 26 default n
27 27
28config TIME_LOW_RES
29 bool
30 default y
31
28mainmenu "Fujitsu FR-V Kernel Configuration" 32mainmenu "Fujitsu FR-V Kernel Configuration"
29 33
30source "init/Kconfig" 34source "init/Kconfig"
diff --git a/arch/frv/Makefile b/arch/frv/Makefile
index 90c0fb8d9dc3..d163747d17c0 100644
--- a/arch/frv/Makefile
+++ b/arch/frv/Makefile
@@ -81,7 +81,7 @@ endif
81# - reserve CC3 for use with atomic ops 81# - reserve CC3 for use with atomic ops
82# - all the extra registers are dealt with only at context switch time 82# - all the extra registers are dealt with only at context switch time
83CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media 83CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
84CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 84CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
85AFLAGS += -mno-fdpic 85AFLAGS += -mno-fdpic
86ASFLAGS += -mno-fdpic 86ASFLAGS += -mno-fdpic
87 87
diff --git a/arch/frv/kernel/break.S b/arch/frv/kernel/break.S
index 33233dc23e29..687c48d62dde 100644
--- a/arch/frv/kernel/break.S
+++ b/arch/frv/kernel/break.S
@@ -200,12 +200,20 @@ __break_step:
200 movsg bpcsr,gr2 200 movsg bpcsr,gr2
201 sethi.p %hi(__entry_kernel_external_interrupt),gr3 201 sethi.p %hi(__entry_kernel_external_interrupt),gr3
202 setlo %lo(__entry_kernel_external_interrupt),gr3 202 setlo %lo(__entry_kernel_external_interrupt),gr3
203 subcc gr2,gr3,gr0,icc0 203 subcc.p gr2,gr3,gr0,icc0
204 sethi %hi(__entry_uspace_external_interrupt),gr3
205 setlo.p %lo(__entry_uspace_external_interrupt),gr3
204 beq icc0,#2,__break_step_kernel_external_interrupt 206 beq icc0,#2,__break_step_kernel_external_interrupt
205 sethi.p %hi(__entry_uspace_external_interrupt),gr3 207 subcc.p gr2,gr3,gr0,icc0
206 setlo %lo(__entry_uspace_external_interrupt),gr3 208 sethi %hi(__entry_kernel_external_interrupt_virtually_disabled),gr3
207 subcc gr2,gr3,gr0,icc0 209 setlo.p %lo(__entry_kernel_external_interrupt_virtually_disabled),gr3
208 beq icc0,#2,__break_step_uspace_external_interrupt 210 beq icc0,#2,__break_step_uspace_external_interrupt
211 subcc.p gr2,gr3,gr0,icc0
212 sethi %hi(__entry_kernel_external_interrupt_virtual_reenable),gr3
213 setlo.p %lo(__entry_kernel_external_interrupt_virtual_reenable),gr3
214 beq icc0,#2,__break_step_kernel_external_interrupt_virtually_disabled
215 subcc gr2,gr3,gr0,icc0
216 beq icc0,#2,__break_step_kernel_external_interrupt_virtual_reenable
209 217
210 LEDS 0x2007,gr2 218 LEDS 0x2007,gr2
211 219
@@ -254,6 +262,9 @@ __break_step_kernel_softprog_interrupt:
254# step through an external interrupt from kernel mode 262# step through an external interrupt from kernel mode
255 .globl __break_step_kernel_external_interrupt 263 .globl __break_step_kernel_external_interrupt
256__break_step_kernel_external_interrupt: 264__break_step_kernel_external_interrupt:
265 # deal with virtual interrupt disablement
266 beq icc2,#0,__break_step_kernel_external_interrupt_virtually_disabled
267
257 sethi.p %hi(__entry_kernel_external_interrupt_reentry),gr3 268 sethi.p %hi(__entry_kernel_external_interrupt_reentry),gr3
258 setlo %lo(__entry_kernel_external_interrupt_reentry),gr3 269 setlo %lo(__entry_kernel_external_interrupt_reentry),gr3
259 270
@@ -294,6 +305,64 @@ __break_return_as_kernel_prologue:
294#endif 305#endif
295 rett #1 306 rett #1
296 307
308# we single-stepped into an interrupt handler whilst interrupts were merely virtually disabled
309# need to really disable interrupts, set flag, fix up and return
310__break_step_kernel_external_interrupt_virtually_disabled:
311 movsg psr,gr2
312 andi gr2,#~PSR_PIL,gr2
313 ori gr2,#PSR_PIL_14,gr2 /* debugging interrupts only */
314 movgs gr2,psr
315
316 ldi @(gr31,#REG_CCR),gr3
317 movgs gr3,ccr
318 subcc.p gr0,gr0,gr0,icc2 /* leave Z set, clear C */
319
320 # exceptions must've been enabled and we must've been in supervisor mode
321 setlos BPSR_BET|BPSR_BS,gr3
322 movgs gr3,bpsr
323
324 # return to where the interrupt happened
325 movsg pcsr,gr2
326 movgs gr2,bpcsr
327
328 lddi.p @(gr31,#REG_GR(2)),gr2
329
330 xor gr31,gr31,gr31
331 movgs gr0,brr
332#ifdef CONFIG_MMU
333 movsg scr3,gr31
334#endif
335 rett #1
336
337# we stepped through into the virtual interrupt reenablement trap
338#
339# we also want to single step anyway, but after fixing up so that we get an event on the
340# instruction after the broken-into exception returns
341 .globl __break_step_kernel_external_interrupt_virtual_reenable
342__break_step_kernel_external_interrupt_virtual_reenable:
343 movsg psr,gr2
344 andi gr2,#~PSR_PIL,gr2
345 movgs gr2,psr
346
347 ldi @(gr31,#REG_CCR),gr3
348 movgs gr3,ccr
349 subicc gr0,#1,gr0,icc2 /* clear Z, set C */
350
351 # save the adjusted ICC2
352 movsg ccr,gr3
353 sti gr3,@(gr31,#REG_CCR)
354
355 # exceptions must've been enabled and we must've been in supervisor mode
356 setlos BPSR_BET|BPSR_BS,gr3
357 movgs gr3,bpsr
358
359 # return to where the trap happened
360 movsg pcsr,gr2
361 movgs gr2,bpcsr
362
363 # and then process the single step
364 bra __break_continue
365
297# step through an internal exception from uspace mode 366# step through an internal exception from uspace mode
298 .globl __break_step_uspace_softprog_interrupt 367 .globl __break_step_uspace_softprog_interrupt
299__break_step_uspace_softprog_interrupt: 368__break_step_uspace_softprog_interrupt:
diff --git a/arch/frv/kernel/entry-table.S b/arch/frv/kernel/entry-table.S
index 9b9243e2103c..81568acea9cd 100644
--- a/arch/frv/kernel/entry-table.S
+++ b/arch/frv/kernel/entry-table.S
@@ -116,6 +116,8 @@ __break_kerneltrap_fixup_table:
116 .long __break_step_uspace_external_interrupt 116 .long __break_step_uspace_external_interrupt
117 .section .trap.kernel 117 .section .trap.kernel
118 .org \tbr_tt 118 .org \tbr_tt
119 # deal with virtual interrupt disablement
120 beq icc2,#0,__entry_kernel_external_interrupt_virtually_disabled
119 bra __entry_kernel_external_interrupt 121 bra __entry_kernel_external_interrupt
120 .section .trap.fixup.kernel 122 .section .trap.fixup.kernel
121 .org \tbr_tt >> 2 123 .org \tbr_tt >> 2
@@ -259,25 +261,52 @@ __trap_fixup_kernel_data_tlb_miss:
259 .org TBR_TT_TRAP0 261 .org TBR_TT_TRAP0
260 .rept 127 262 .rept 127
261 bra __entry_uspace_softprog_interrupt 263 bra __entry_uspace_softprog_interrupt
262 bra __break_step_uspace_softprog_interrupt 264 .long 0,0,0
263 .long 0,0
264 .endr 265 .endr
265 .org TBR_TT_BREAK 266 .org TBR_TT_BREAK
266 bra __entry_break 267 bra __entry_break
267 .long 0,0,0 268 .long 0,0,0
268 269
270 .section .trap.fixup.user
271 .org TBR_TT_TRAP0 >> 2
272 .rept 127
273 .long __break_step_uspace_softprog_interrupt
274 .endr
275 .org TBR_TT_BREAK >> 2
276 .long 0
277
269 # miscellaneous kernel mode entry points 278 # miscellaneous kernel mode entry points
270 .section .trap.kernel 279 .section .trap.kernel
271 .org TBR_TT_TRAP0 280 .org TBR_TT_TRAP0
272 .rept 127
273 bra __entry_kernel_softprog_interrupt 281 bra __entry_kernel_softprog_interrupt
274 bra __break_step_kernel_softprog_interrupt 282 .org TBR_TT_TRAP1
275 .long 0,0 283 bra __entry_kernel_softprog_interrupt
284
285 # trap #2 in kernel - reenable interrupts
286 .org TBR_TT_TRAP2
287 bra __entry_kernel_external_interrupt_virtual_reenable
288
289 # miscellaneous kernel traps
290 .org TBR_TT_TRAP3
291 .rept 124
292 bra __entry_kernel_softprog_interrupt
293 .long 0,0,0
276 .endr 294 .endr
277 .org TBR_TT_BREAK 295 .org TBR_TT_BREAK
278 bra __entry_break 296 bra __entry_break
279 .long 0,0,0 297 .long 0,0,0
280 298
299 .section .trap.fixup.kernel
300 .org TBR_TT_TRAP0 >> 2
301 .long __break_step_kernel_softprog_interrupt
302 .long __break_step_kernel_softprog_interrupt
303 .long __break_step_kernel_external_interrupt_virtual_reenable
304 .rept 124
305 .long __break_step_kernel_softprog_interrupt
306 .endr
307 .org TBR_TT_BREAK >> 2
308 .long 0
309
281 # miscellaneous debug mode entry points 310 # miscellaneous debug mode entry points
282 .section .trap.break 311 .section .trap.break
283 .org TBR_TT_BREAK 312 .org TBR_TT_BREAK
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 5f6548388b74..1d21c8d34d8a 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -141,7 +141,10 @@ __entry_uspace_external_interrupt_reentry:
141 141
142 movsg gner0,gr4 142 movsg gner0,gr4
143 movsg gner1,gr5 143 movsg gner1,gr5
144 stdi gr4,@(gr28,#REG_GNER0) 144 stdi.p gr4,@(gr28,#REG_GNER0)
145
146 # interrupts start off fully disabled in the interrupt handler
147 subcc gr0,gr0,gr0,icc2 /* set Z and clear C */
145 148
146 # set up kernel global registers 149 # set up kernel global registers
147 sethi.p %hi(__kernel_current_task),gr5 150 sethi.p %hi(__kernel_current_task),gr5
@@ -193,9 +196,8 @@ __entry_uspace_external_interrupt_reentry:
193 .type __entry_kernel_external_interrupt,@function 196 .type __entry_kernel_external_interrupt,@function
194__entry_kernel_external_interrupt: 197__entry_kernel_external_interrupt:
195 LEDS 0x6210 198 LEDS 0x6210
196 199// sub sp,gr15,gr31
197 sub sp,gr15,gr31 200// LEDS32
198 LEDS32
199 201
200 # set up the stack pointer 202 # set up the stack pointer
201 or.p sp,gr0,gr30 203 or.p sp,gr0,gr30
@@ -231,7 +233,10 @@ __entry_kernel_external_interrupt_reentry:
231 stdi gr24,@(gr28,#REG_GR(24)) 233 stdi gr24,@(gr28,#REG_GR(24))
232 stdi gr26,@(gr28,#REG_GR(26)) 234 stdi gr26,@(gr28,#REG_GR(26))
233 sti gr29,@(gr28,#REG_GR(29)) 235 sti gr29,@(gr28,#REG_GR(29))
234 stdi gr30,@(gr28,#REG_GR(30)) 236 stdi.p gr30,@(gr28,#REG_GR(30))
237
238 # note virtual interrupts will be fully enabled upon return
239 subicc gr0,#1,gr0,icc2 /* clear Z, set C */
235 240
236 movsg tbr ,gr20 241 movsg tbr ,gr20
237 movsg psr ,gr22 242 movsg psr ,gr22
@@ -267,7 +272,10 @@ __entry_kernel_external_interrupt_reentry:
267 272
268 movsg gner0,gr4 273 movsg gner0,gr4
269 movsg gner1,gr5 274 movsg gner1,gr5
270 stdi gr4,@(gr28,#REG_GNER0) 275 stdi.p gr4,@(gr28,#REG_GNER0)
276
277 # interrupts start off fully disabled in the interrupt handler
278 subcc gr0,gr0,gr0,icc2 /* set Z and clear C */
271 279
272 # set the return address 280 # set the return address
273 sethi.p %hi(__entry_return_from_kernel_interrupt),gr4 281 sethi.p %hi(__entry_return_from_kernel_interrupt),gr4
@@ -291,6 +299,45 @@ __entry_kernel_external_interrupt_reentry:
291 299
292 .size __entry_kernel_external_interrupt,.-__entry_kernel_external_interrupt 300 .size __entry_kernel_external_interrupt,.-__entry_kernel_external_interrupt
293 301
302###############################################################################
303#
304# deal with interrupts that were actually virtually disabled
305# - we need to really disable them, flag the fact and return immediately
306# - if you change this, you must alter break.S also
307#
308###############################################################################
309 .balign L1_CACHE_BYTES
310 .globl __entry_kernel_external_interrupt_virtually_disabled
311 .type __entry_kernel_external_interrupt_virtually_disabled,@function
312__entry_kernel_external_interrupt_virtually_disabled:
313 movsg psr,gr30
314 andi gr30,#~PSR_PIL,gr30
315 ori gr30,#PSR_PIL_14,gr30 ; debugging interrupts only
316 movgs gr30,psr
317 subcc gr0,gr0,gr0,icc2 ; leave Z set, clear C
318 rett #0
319
320 .size __entry_kernel_external_interrupt_virtually_disabled,.-__entry_kernel_external_interrupt_virtually_disabled
321
322###############################################################################
323#
324# deal with re-enablement of interrupts that were pending when virtually re-enabled
325# - set ICC2.C, re-enable the real interrupts and return
326# - we can clear ICC2.Z because we shouldn't be here if it's not 0 [due to TIHI]
327# - if you change this, you must alter break.S also
328#
329###############################################################################
330 .balign L1_CACHE_BYTES
331 .globl __entry_kernel_external_interrupt_virtual_reenable
332 .type __entry_kernel_external_interrupt_virtual_reenable,@function
333__entry_kernel_external_interrupt_virtual_reenable:
334 movsg psr,gr30
335 andi gr30,#~PSR_PIL,gr30 ; re-enable interrupts
336 movgs gr30,psr
337 subicc gr0,#1,gr0,icc2 ; clear Z, set C
338 rett #0
339
340 .size __entry_kernel_external_interrupt_virtual_reenable,.-__entry_kernel_external_interrupt_virtual_reenable
294 341
295############################################################################### 342###############################################################################
296# 343#
@@ -335,6 +382,7 @@ __entry_uspace_softprog_interrupt_reentry:
335 382
336 sethi.p %hi(__entry_return_from_user_exception),gr23 383 sethi.p %hi(__entry_return_from_user_exception),gr23
337 setlo %lo(__entry_return_from_user_exception),gr23 384 setlo %lo(__entry_return_from_user_exception),gr23
385
338 bra __entry_common 386 bra __entry_common
339 387
340 .size __entry_uspace_softprog_interrupt,.-__entry_uspace_softprog_interrupt 388 .size __entry_uspace_softprog_interrupt,.-__entry_uspace_softprog_interrupt
@@ -495,7 +543,10 @@ __entry_common:
495 543
496 movsg gner0,gr4 544 movsg gner0,gr4
497 movsg gner1,gr5 545 movsg gner1,gr5
498 stdi gr4,@(gr28,#REG_GNER0) 546 stdi.p gr4,@(gr28,#REG_GNER0)
547
548 # set up virtual interrupt disablement
549 subicc gr0,#1,gr0,icc2 /* clear Z flag, set C flag */
499 550
500 # set up kernel global registers 551 # set up kernel global registers
501 sethi.p %hi(__kernel_current_task),gr5 552 sethi.p %hi(__kernel_current_task),gr5
@@ -1418,11 +1469,27 @@ sys_call_table:
1418 .long sys_add_key 1469 .long sys_add_key
1419 .long sys_request_key 1470 .long sys_request_key
1420 .long sys_keyctl 1471 .long sys_keyctl
1421 .long sys_ni_syscall // sys_vperfctr_open 1472 .long sys_ioprio_set
1422 .long sys_ni_syscall // sys_vperfctr_control /* 290 */ 1473 .long sys_ioprio_get /* 290 */
1423 .long sys_ni_syscall // sys_vperfctr_unlink 1474 .long sys_inotify_init
1424 .long sys_ni_syscall // sys_vperfctr_iresume 1475 .long sys_inotify_add_watch
1425 .long sys_ni_syscall // sys_vperfctr_read 1476 .long sys_inotify_rm_watch
1477 .long sys_migrate_pages
1478 .long sys_openat /* 295 */
1479 .long sys_mkdirat
1480 .long sys_mknodat
1481 .long sys_fchownat
1482 .long sys_futimesat
1483 .long sys_newfstatat /* 300 */
1484 .long sys_unlinkat
1485 .long sys_renameat
1486 .long sys_linkat
1487 .long sys_symlinkat
1488 .long sys_readlinkat /* 305 */
1489 .long sys_fchmodat
1490 .long sys_faccessat
1491 .long sys_pselect6
1492 .long sys_ppoll
1426 1493
1427 1494
1428syscall_table_size = (. - sys_call_table) 1495syscall_table_size = (. - sys_call_table)
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index c73b4fe9f6ca..29a5265489b7 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -513,6 +513,9 @@ __head_mmu_enabled:
513 movgs gr0,ccr 513 movgs gr0,ccr
514 movgs gr0,cccr 514 movgs gr0,cccr
515 515
516 # initialise the virtual interrupt handling
517 subcc gr0,gr0,gr0,icc2 /* set Z, clear C */
518
516#ifdef CONFIG_MMU 519#ifdef CONFIG_MMU
517 movgs gr3,scr2 520 movgs gr3,scr2
518 movgs gr3,scr3 521 movgs gr3,scr3
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c
index 59580c59c62c..27ab4c30aac6 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -287,18 +287,11 @@ asmlinkage void do_IRQ(void)
287 struct irq_source *source; 287 struct irq_source *source;
288 int level, cpu; 288 int level, cpu;
289 289
290 irq_enter();
291
290 level = (__frame->tbr >> 4) & 0xf; 292 level = (__frame->tbr >> 4) & 0xf;
291 cpu = smp_processor_id(); 293 cpu = smp_processor_id();
292 294
293#if 0
294 {
295 static u32 irqcount;
296 *(volatile u32 *) 0xe1200004 = ~((irqcount++ << 8) | level);
297 *(volatile u16 *) 0xffc00100 = (u16) ~0x9999;
298 mb();
299 }
300#endif
301
302 if ((unsigned long) __frame - (unsigned long) (current + 1) < 512) 295 if ((unsigned long) __frame - (unsigned long) (current + 1) < 512)
303 BUG(); 296 BUG();
304 297
@@ -308,40 +301,12 @@ asmlinkage void do_IRQ(void)
308 301
309 kstat_this_cpu.irqs[level]++; 302 kstat_this_cpu.irqs[level]++;
310 303
311 irq_enter();
312
313 for (source = frv_irq_levels[level].sources; source; source = source->next) 304 for (source = frv_irq_levels[level].sources; source; source = source->next)
314 source->doirq(source); 305 source->doirq(source);
315 306
316 irq_exit();
317
318 __clr_MASK(level); 307 __clr_MASK(level);
319 308
320 /* only process softirqs if we didn't interrupt another interrupt handler */ 309 irq_exit();
321 if ((__frame->psr & PSR_PIL) == PSR_PIL_0)
322 if (local_softirq_pending())
323 do_softirq();
324
325#ifdef CONFIG_PREEMPT
326 local_irq_disable();
327 while (--current->preempt_count == 0) {
328 if (!(__frame->psr & PSR_S) ||
329 current->need_resched == 0 ||
330 in_interrupt())
331 break;
332 current->preempt_count++;
333 local_irq_enable();
334 preempt_schedule();
335 local_irq_disable();
336 }
337#endif
338
339#if 0
340 {
341 *(volatile u16 *) 0xffc00100 = (u16) ~0x6666;
342 mb();
343 }
344#endif
345 310
346} /* end do_IRQ() */ 311} /* end do_IRQ() */
347 312
diff --git a/arch/frv/mm/kmap.c b/arch/frv/mm/kmap.c
index 539f45e6d15e..c54f18e65ea6 100644
--- a/arch/frv/mm/kmap.c
+++ b/arch/frv/mm/kmap.c
@@ -44,15 +44,6 @@ void iounmap(void *addr)
44} 44}
45 45
46/* 46/*
47 * __iounmap unmaps nearly everything, so be careful
48 * it doesn't free currently pointer/page tables anymore but it
49 * wans't used anyway and might be added later.
50 */
51void __iounmap(void *addr, unsigned long size)
52{
53}
54
55/*
56 * Set new cache mode for some kernel address space. 47 * Set new cache mode for some kernel address space.
57 * The caller must push data for that range itself, if such data may already 48 * The caller must push data for that range itself, if such data may already
58 * be in the cache. 49 * be in the cache.
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 80940d712acf..98308b018a35 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -33,6 +33,10 @@ config GENERIC_CALIBRATE_DELAY
33 bool 33 bool
34 default y 34 default y
35 35
36config TIME_LOW_RES
37 bool
38 default y
39
36config ISA 40config ISA
37 bool 41 bool
38 default y 42 default y
diff --git a/arch/h8300/Kconfig.cpu b/arch/h8300/Kconfig.cpu
index a380167a13cf..582797db9603 100644
--- a/arch/h8300/Kconfig.cpu
+++ b/arch/h8300/Kconfig.cpu
@@ -169,7 +169,7 @@ endif
169 169
170config CPU_H8300H 170config CPU_H8300H
171 bool 171 bool
172 depends on (H8002 || H83007 || H83048 || H83068) 172 depends on (H83002 || H83007 || H83048 || H83068)
173 default y 173 default y
174 174
175config CPU_H8S 175config CPU_H8S
diff --git a/arch/i386/boot/.gitignore b/arch/i386/boot/.gitignore
new file mode 100644
index 000000000000..495f20c085de
--- /dev/null
+++ b/arch/i386/boot/.gitignore
@@ -0,0 +1,3 @@
1bootsect
2bzImage
3setup
diff --git a/arch/i386/boot/tools/.gitignore b/arch/i386/boot/tools/.gitignore
new file mode 100644
index 000000000000..378eac25d311
--- /dev/null
+++ b/arch/i386/boot/tools/.gitignore
@@ -0,0 +1 @@
build
diff --git a/arch/i386/kernel/.gitignore b/arch/i386/kernel/.gitignore
new file mode 100644
index 000000000000..40836ad9079c
--- /dev/null
+++ b/arch/i386/kernel/.gitignore
@@ -0,0 +1 @@
vsyscall.lds
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 5884469f6bfe..2bee6499edd9 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -398,7 +398,11 @@ ignore_int:
398 pushl 32(%esp) 398 pushl 32(%esp)
399 pushl 40(%esp) 399 pushl 40(%esp)
400 pushl $int_msg 400 pushl $int_msg
401#ifdef CONFIG_EARLY_PRINTK
402 call early_printk
403#else
401 call printk 404 call printk
405#endif
402 addl $(5*4),%esp 406 addl $(5*4),%esp
403 popl %ds 407 popl %ds
404 popl %es 408 popl %es
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index 5a8b3fb6d27b..ac687d00a1ce 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -299,7 +299,7 @@ ENTRY(sys_call_table)
299 .long sys_mknodat 299 .long sys_mknodat
300 .long sys_fchownat 300 .long sys_fchownat
301 .long sys_futimesat 301 .long sys_futimesat
302 .long sys_newfstatat /* 300 */ 302 .long sys_fstatat64 /* 300 */
303 .long sys_unlinkat 303 .long sys_unlinkat
304 .long sys_renameat 304 .long sys_renameat
305 .long sys_linkat 305 .long sys_linkat
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index 7c86e3c5f1c1..a7f5a2aceba2 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -282,6 +282,10 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
282 if (val != CPUFREQ_RESUMECHANGE) 282 if (val != CPUFREQ_RESUMECHANGE)
283 write_seqlock_irq(&xtime_lock); 283 write_seqlock_irq(&xtime_lock);
284 if (!ref_freq) { 284 if (!ref_freq) {
285 if (!freq->old){
286 ref_freq = freq->new;
287 goto end;
288 }
285 ref_freq = freq->old; 289 ref_freq = freq->old;
286 loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; 290 loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
287#ifndef CONFIG_SMP 291#ifndef CONFIG_SMP
@@ -307,6 +311,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
307#endif 311#endif
308 } 312 }
309 313
314end:
310 if (val != CPUFREQ_RESUMECHANGE) 315 if (val != CPUFREQ_RESUMECHANGE)
311 write_sequnlock_irq(&xtime_lock); 316 write_sequnlock_irq(&xtime_lock);
312 317
diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/i386/kernel/vsyscall-sysenter.S
index 4daefb2ec1b2..76b728159403 100644
--- a/arch/i386/kernel/vsyscall-sysenter.S
+++ b/arch/i386/kernel/vsyscall-sysenter.S
@@ -7,6 +7,21 @@
7 * for details. 7 * for details.
8 */ 8 */
9 9
10/*
11 * The caller puts arg2 in %ecx, which gets pushed. The kernel will use
12 * %ecx itself for arg2. The pushing is because the sysexit instruction
13 * (found in entry.S) requires that we clobber %ecx with the desired %esp.
14 * User code might expect that %ecx is unclobbered though, as it would be
15 * for returning via the iret instruction, so we must push and pop.
16 *
17 * The caller puts arg3 in %edx, which the sysexit instruction requires
18 * for %eip. Thus, exactly as for arg2, we must push and pop.
19 *
20 * Arg6 is different. The caller puts arg6 in %ebp. Since the sysenter
21 * instruction clobbers %esp, the user's %esp won't even survive entry
22 * into the kernel. We store %esp in %ebp. Code in entry.S must fetch
23 * arg6 from the stack.
24 */
10 .text 25 .text
11 .globl __kernel_vsyscall 26 .globl __kernel_vsyscall
12 .type __kernel_vsyscall,@function 27 .type __kernel_vsyscall,@function
diff --git a/arch/i386/oprofile/backtrace.c b/arch/i386/oprofile/backtrace.c
index acc18138fb22..c049ce414f01 100644
--- a/arch/i386/oprofile/backtrace.c
+++ b/arch/i386/oprofile/backtrace.c
@@ -20,7 +20,20 @@ struct frame_head {
20} __attribute__((packed)); 20} __attribute__((packed));
21 21
22static struct frame_head * 22static struct frame_head *
23dump_backtrace(struct frame_head * head) 23dump_kernel_backtrace(struct frame_head * head)
24{
25 oprofile_add_trace(head->ret);
26
27 /* frame pointers should strictly progress back up the stack
28 * (towards higher addresses) */
29 if (head >= head->ebp)
30 return NULL;
31
32 return head->ebp;
33}
34
35static struct frame_head *
36dump_user_backtrace(struct frame_head * head)
24{ 37{
25 struct frame_head bufhead[2]; 38 struct frame_head bufhead[2];
26 39
@@ -105,10 +118,10 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
105 118
106 if (!user_mode_vm(regs)) { 119 if (!user_mode_vm(regs)) {
107 while (depth-- && valid_kernel_stack(head, regs)) 120 while (depth-- && valid_kernel_stack(head, regs))
108 head = dump_backtrace(head); 121 head = dump_kernel_backtrace(head);
109 return; 122 return;
110 } 123 }
111 124
112 while (depth-- && head) 125 while (depth-- && head)
113 head = dump_backtrace(head); 126 head = dump_user_backtrace(head);
114} 127}
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 96b919828053..8849439e88dd 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -21,6 +21,10 @@ config GENERIC_CALIBRATE_DELAY
21 bool 21 bool
22 default y 22 default y
23 23
24config TIME_LOW_RES
25 bool
26 default y
27
24config ARCH_MAY_HAVE_PC_FDC 28config ARCH_MAY_HAVE_PC_FDC
25 bool 29 bool
26 depends on Q40 || (BROKEN && SUN3X) 30 depends on Q40 || (BROKEN && SUN3X)
diff --git a/arch/m68k/fpsp040/bindec.S b/arch/m68k/fpsp040/bindec.S
index 3ba446a99a12..72f1159cb804 100644
--- a/arch/m68k/fpsp040/bindec.S
+++ b/arch/m68k/fpsp040/bindec.S
@@ -131,9 +131,8 @@
131| Copyright (C) Motorola, Inc. 1990 131| Copyright (C) Motorola, Inc. 1990
132| All Rights Reserved 132| All Rights Reserved
133| 133|
134| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 134| For details on the license for this file, please see the
135| The copyright notice above does not evidence any 135| file, README, in this same directory.
136| actual or intended publication of such source code.
137 136
138|BINDEC idnt 2,1 | Motorola 040 Floating Point Software Package 137|BINDEC idnt 2,1 | Motorola 040 Floating Point Software Package
139 138
diff --git a/arch/m68k/fpsp040/binstr.S b/arch/m68k/fpsp040/binstr.S
index d53555c0a2b6..8a05ba92a8a0 100644
--- a/arch/m68k/fpsp040/binstr.S
+++ b/arch/m68k/fpsp040/binstr.S
@@ -60,9 +60,8 @@
60| Copyright (C) Motorola, Inc. 1990 60| Copyright (C) Motorola, Inc. 1990
61| All Rights Reserved 61| All Rights Reserved
62| 62|
63| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 63| For details on the license for this file, please see the
64| The copyright notice above does not evidence any 64| file, README, in this same directory.
65| actual or intended publication of such source code.
66 65
67|BINSTR idnt 2,1 | Motorola 040 Floating Point Software Package 66|BINSTR idnt 2,1 | Motorola 040 Floating Point Software Package
68 67
diff --git a/arch/m68k/fpsp040/bugfix.S b/arch/m68k/fpsp040/bugfix.S
index 942c4f6f4fd1..3bb9c84bb058 100644
--- a/arch/m68k/fpsp040/bugfix.S
+++ b/arch/m68k/fpsp040/bugfix.S
@@ -152,9 +152,8 @@
152| Copyright (C) Motorola, Inc. 1990 152| Copyright (C) Motorola, Inc. 1990
153| All Rights Reserved 153| All Rights Reserved
154| 154|
155| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 155| For details on the license for this file, please see the
156| The copyright notice above does not evidence any 156| file, README, in this same directory.
157| actual or intended publication of such source code.
158 157
159|BUGFIX idnt 2,1 | Motorola 040 Floating Point Software Package 158|BUGFIX idnt 2,1 | Motorola 040 Floating Point Software Package
160 159
diff --git a/arch/m68k/fpsp040/decbin.S b/arch/m68k/fpsp040/decbin.S
index 2160609e328d..16ed796bad87 100644
--- a/arch/m68k/fpsp040/decbin.S
+++ b/arch/m68k/fpsp040/decbin.S
@@ -69,9 +69,8 @@
69| Copyright (C) Motorola, Inc. 1990 69| Copyright (C) Motorola, Inc. 1990
70| All Rights Reserved 70| All Rights Reserved
71| 71|
72| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 72| For details on the license for this file, please see the
73| The copyright notice above does not evidence any 73| file, README, in this same directory.
74| actual or intended publication of such source code.
75 74
76|DECBIN idnt 2,1 | Motorola 040 Floating Point Software Package 75|DECBIN idnt 2,1 | Motorola 040 Floating Point Software Package
77 76
diff --git a/arch/m68k/fpsp040/do_func.S b/arch/m68k/fpsp040/do_func.S
index 81f6a9856dce..3eff99a80413 100644
--- a/arch/m68k/fpsp040/do_func.S
+++ b/arch/m68k/fpsp040/do_func.S
@@ -22,9 +22,8 @@
22| Copyright (C) Motorola, Inc. 1990 22| Copyright (C) Motorola, Inc. 1990
23| All Rights Reserved 23| All Rights Reserved
24| 24|
25| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 25| For details on the license for this file, please see the
26| The copyright notice above does not evidence any 26| file, README, in this same directory.
27| actual or intended publication of such source code.
28 27
29DO_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package 28DO_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package
30 29
diff --git a/arch/m68k/fpsp040/fpsp.h b/arch/m68k/fpsp040/fpsp.h
index 984a4eb8010a..5df4cd772934 100644
--- a/arch/m68k/fpsp040/fpsp.h
+++ b/arch/m68k/fpsp040/fpsp.h
@@ -5,9 +5,8 @@
5| Copyright (C) Motorola, Inc. 1990 5| Copyright (C) Motorola, Inc. 1990
6| All Rights Reserved 6| All Rights Reserved
7| 7|
8| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 8| For details on the license for this file, please see the
9| The copyright notice above does not evidence any 9| file, README, in this same directory.
10| actual or intended publication of such source code.
11 10
12| fpsp.h --- stack frame offsets during FPSP exception handling 11| fpsp.h --- stack frame offsets during FPSP exception handling
13| 12|
diff --git a/arch/m68k/fpsp040/gen_except.S b/arch/m68k/fpsp040/gen_except.S
index 401d06f39f73..3642cb7e3641 100644
--- a/arch/m68k/fpsp040/gen_except.S
+++ b/arch/m68k/fpsp040/gen_except.S
@@ -29,9 +29,8 @@
29| Copyright (C) Motorola, Inc. 1990 29| Copyright (C) Motorola, Inc. 1990
30| All Rights Reserved 30| All Rights Reserved
31| 31|
32| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 32| For details on the license for this file, please see the
33| The copyright notice above does not evidence any 33| file, README, in this same directory.
34| actual or intended publication of such source code.
35 34
36GEN_EXCEPT: |idnt 2,1 | Motorola 040 Floating Point Software Package 35GEN_EXCEPT: |idnt 2,1 | Motorola 040 Floating Point Software Package
37 36
diff --git a/arch/m68k/fpsp040/get_op.S b/arch/m68k/fpsp040/get_op.S
index c7c2f3727425..64c36d79ef83 100644
--- a/arch/m68k/fpsp040/get_op.S
+++ b/arch/m68k/fpsp040/get_op.S
@@ -54,9 +54,8 @@
54| Copyright (C) Motorola, Inc. 1990 54| Copyright (C) Motorola, Inc. 1990
55| All Rights Reserved 55| All Rights Reserved
56| 56|
57| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 57| For details on the license for this file, please see the
58| The copyright notice above does not evidence any 58| file, README, in this same directory.
59| actual or intended publication of such source code.
60 59
61GET_OP: |idnt 2,1 | Motorola 040 Floating Point Software Package 60GET_OP: |idnt 2,1 | Motorola 040 Floating Point Software Package
62 61
diff --git a/arch/m68k/fpsp040/kernel_ex.S b/arch/m68k/fpsp040/kernel_ex.S
index 476b711967ce..45bcf3455d34 100644
--- a/arch/m68k/fpsp040/kernel_ex.S
+++ b/arch/m68k/fpsp040/kernel_ex.S
@@ -12,9 +12,8 @@
12| Copyright (C) Motorola, Inc. 1990 12| Copyright (C) Motorola, Inc. 1990
13| All Rights Reserved 13| All Rights Reserved
14| 14|
15| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 15| For details on the license for this file, please see the
16| The copyright notice above does not evidence any 16| file, README, in this same directory.
17| actual or intended publication of such source code.
18 17
19KERNEL_EX: |idnt 2,1 | Motorola 040 Floating Point Software Package 18KERNEL_EX: |idnt 2,1 | Motorola 040 Floating Point Software Package
20 19
diff --git a/arch/m68k/fpsp040/res_func.S b/arch/m68k/fpsp040/res_func.S
index 8f6b95217865..d9cdf4383545 100644
--- a/arch/m68k/fpsp040/res_func.S
+++ b/arch/m68k/fpsp040/res_func.S
@@ -16,9 +16,8 @@
16| Copyright (C) Motorola, Inc. 1990 16| Copyright (C) Motorola, Inc. 1990
17| All Rights Reserved 17| All Rights Reserved
18| 18|
19| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 19| For details on the license for this file, please see the
20| The copyright notice above does not evidence any 20| file, README, in this same directory.
21| actual or intended publication of such source code.
22 21
23RES_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package 22RES_FUNC: |idnt 2,1 | Motorola 040 Floating Point Software Package
24 23
diff --git a/arch/m68k/fpsp040/round.S b/arch/m68k/fpsp040/round.S
index 00f98068783f..f84ae0dd4358 100644
--- a/arch/m68k/fpsp040/round.S
+++ b/arch/m68k/fpsp040/round.S
@@ -8,9 +8,8 @@
8| Copyright (C) Motorola, Inc. 1990 8| Copyright (C) Motorola, Inc. 1990
9| All Rights Reserved 9| All Rights Reserved
10| 10|
11| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 11| For details on the license for this file, please see the
12| The copyright notice above does not evidence any 12| file, README, in this same directory.
13| actual or intended publication of such source code.
14 13
15|ROUND idnt 2,1 | Motorola 040 Floating Point Software Package 14|ROUND idnt 2,1 | Motorola 040 Floating Point Software Package
16 15
diff --git a/arch/m68k/fpsp040/sacos.S b/arch/m68k/fpsp040/sacos.S
index 83b00ab1c48f..513c7cca7318 100644
--- a/arch/m68k/fpsp040/sacos.S
+++ b/arch/m68k/fpsp040/sacos.S
@@ -38,9 +38,8 @@
38| Copyright (C) Motorola, Inc. 1990 38| Copyright (C) Motorola, Inc. 1990
39| All Rights Reserved 39| All Rights Reserved
40| 40|
41| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 41| For details on the license for this file, please see the
42| The copyright notice above does not evidence any 42| file, README, in this same directory.
43| actual or intended publication of such source code.
44 43
45|SACOS idnt 2,1 | Motorola 040 Floating Point Software Package 44|SACOS idnt 2,1 | Motorola 040 Floating Point Software Package
46 45
diff --git a/arch/m68k/fpsp040/sasin.S b/arch/m68k/fpsp040/sasin.S
index 5647a6043903..2a269a58ceaa 100644
--- a/arch/m68k/fpsp040/sasin.S
+++ b/arch/m68k/fpsp040/sasin.S
@@ -38,9 +38,8 @@
38| Copyright (C) Motorola, Inc. 1990 38| Copyright (C) Motorola, Inc. 1990
39| All Rights Reserved 39| All Rights Reserved
40| 40|
41| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 41| For details on the license for this file, please see the
42| The copyright notice above does not evidence any 42| file, README, in this same directory.
43| actual or intended publication of such source code.
44 43
45|SASIN idnt 2,1 | Motorola 040 Floating Point Software Package 44|SASIN idnt 2,1 | Motorola 040 Floating Point Software Package
46 45
diff --git a/arch/m68k/fpsp040/satan.S b/arch/m68k/fpsp040/satan.S
index 20dae222d51e..c8a664998f92 100644
--- a/arch/m68k/fpsp040/satan.S
+++ b/arch/m68k/fpsp040/satan.S
@@ -43,9 +43,8 @@
43| Copyright (C) Motorola, Inc. 1990 43| Copyright (C) Motorola, Inc. 1990
44| All Rights Reserved 44| All Rights Reserved
45| 45|
46| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 46| For details on the license for this file, please see the
47| The copyright notice above does not evidence any 47| file, README, in this same directory.
48| actual or intended publication of such source code.
49 48
50|satan idnt 2,1 | Motorola 040 Floating Point Software Package 49|satan idnt 2,1 | Motorola 040 Floating Point Software Package
51 50
diff --git a/arch/m68k/fpsp040/satanh.S b/arch/m68k/fpsp040/satanh.S
index 20f07810bcda..ba91f77a7571 100644
--- a/arch/m68k/fpsp040/satanh.S
+++ b/arch/m68k/fpsp040/satanh.S
@@ -45,9 +45,8 @@
45| Copyright (C) Motorola, Inc. 1990 45| Copyright (C) Motorola, Inc. 1990
46| All Rights Reserved 46| All Rights Reserved
47| 47|
48| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 48| For details on the license for this file, please see the
49| The copyright notice above does not evidence any 49| file, README, in this same directory.
50| actual or intended publication of such source code.
51 50
52|satanh idnt 2,1 | Motorola 040 Floating Point Software Package 51|satanh idnt 2,1 | Motorola 040 Floating Point Software Package
53 52
diff --git a/arch/m68k/fpsp040/scale.S b/arch/m68k/fpsp040/scale.S
index 5c9b805265f2..04829dd4f1f4 100644
--- a/arch/m68k/fpsp040/scale.S
+++ b/arch/m68k/fpsp040/scale.S
@@ -21,9 +21,8 @@
21| Copyright (C) Motorola, Inc. 1990 21| Copyright (C) Motorola, Inc. 1990
22| All Rights Reserved 22| All Rights Reserved
23| 23|
24| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 24| For details on the license for this file, please see the
25| The copyright notice above does not evidence any 25| file, README, in this same directory.
26| actual or intended publication of such source code.
27 26
28|SCALE idnt 2,1 | Motorola 040 Floating Point Software Package 27|SCALE idnt 2,1 | Motorola 040 Floating Point Software Package
29 28
diff --git a/arch/m68k/fpsp040/scosh.S b/arch/m68k/fpsp040/scosh.S
index e81edbb87642..07d3a4d7c86d 100644
--- a/arch/m68k/fpsp040/scosh.S
+++ b/arch/m68k/fpsp040/scosh.S
@@ -49,9 +49,8 @@
49| Copyright (C) Motorola, Inc. 1990 49| Copyright (C) Motorola, Inc. 1990
50| All Rights Reserved 50| All Rights Reserved
51| 51|
52| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 52| For details on the license for this file, please see the
53| The copyright notice above does not evidence any 53| file, README, in this same directory.
54| actual or intended publication of such source code.
55 54
56|SCOSH idnt 2,1 | Motorola 040 Floating Point Software Package 55|SCOSH idnt 2,1 | Motorola 040 Floating Point Software Package
57 56
diff --git a/arch/m68k/fpsp040/setox.S b/arch/m68k/fpsp040/setox.S
index 0aa75f9bf7d1..145af5447581 100644
--- a/arch/m68k/fpsp040/setox.S
+++ b/arch/m68k/fpsp040/setox.S
@@ -331,9 +331,8 @@
331| Copyright (C) Motorola, Inc. 1990 331| Copyright (C) Motorola, Inc. 1990
332| All Rights Reserved 332| All Rights Reserved
333| 333|
334| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 334| For details on the license for this file, please see the
335| The copyright notice above does not evidence any 335| file, README, in this same directory.
336| actual or intended publication of such source code.
337 336
338|setox idnt 2,1 | Motorola 040 Floating Point Software Package 337|setox idnt 2,1 | Motorola 040 Floating Point Software Package
339 338
diff --git a/arch/m68k/fpsp040/sgetem.S b/arch/m68k/fpsp040/sgetem.S
index 0fcbd045ba75..d9234f4aed57 100644
--- a/arch/m68k/fpsp040/sgetem.S
+++ b/arch/m68k/fpsp040/sgetem.S
@@ -24,9 +24,8 @@
24| Copyright (C) Motorola, Inc. 1990 24| Copyright (C) Motorola, Inc. 1990
25| All Rights Reserved 25| All Rights Reserved
26| 26|
27| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 27| For details on the license for this file, please see the
28| The copyright notice above does not evidence any 28| file, README, in this same directory.
29| actual or intended publication of such source code.
30 29
31|SGETEM idnt 2,1 | Motorola 040 Floating Point Software Package 30|SGETEM idnt 2,1 | Motorola 040 Floating Point Software Package
32 31
diff --git a/arch/m68k/fpsp040/sint.S b/arch/m68k/fpsp040/sint.S
index 0f9bd28e55a0..0e92d4e5d231 100644
--- a/arch/m68k/fpsp040/sint.S
+++ b/arch/m68k/fpsp040/sint.S
@@ -51,9 +51,8 @@
51| Copyright (C) Motorola, Inc. 1990 51| Copyright (C) Motorola, Inc. 1990
52| All Rights Reserved 52| All Rights Reserved
53| 53|
54| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 54| For details on the license for this file, please see the
55| The copyright notice above does not evidence any 55| file, README, in this same directory.
56| actual or intended publication of such source code.
57 56
58|SINT idnt 2,1 | Motorola 040 Floating Point Software Package 57|SINT idnt 2,1 | Motorola 040 Floating Point Software Package
59 58
diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S
index a1629194e3fd..a8f41615d94a 100644
--- a/arch/m68k/fpsp040/skeleton.S
+++ b/arch/m68k/fpsp040/skeleton.S
@@ -30,9 +30,8 @@
30| Copyright (C) Motorola, Inc. 1990 30| Copyright (C) Motorola, Inc. 1990
31| All Rights Reserved 31| All Rights Reserved
32| 32|
33| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 33| For details on the license for this file, please see the
34| The copyright notice above does not evidence any 34| file, README, in this same directory.
35| actual or intended publication of such source code.
36 35
37| 36|
38| Modified for Linux-1.3.x by Jes Sorensen (jds@kom.auc.dk) 37| Modified for Linux-1.3.x by Jes Sorensen (jds@kom.auc.dk)
diff --git a/arch/m68k/fpsp040/slog2.S b/arch/m68k/fpsp040/slog2.S
index 517fa4563246..fac2c738382e 100644
--- a/arch/m68k/fpsp040/slog2.S
+++ b/arch/m68k/fpsp040/slog2.S
@@ -96,9 +96,8 @@
96| Copyright (C) Motorola, Inc. 1990 96| Copyright (C) Motorola, Inc. 1990
97| All Rights Reserved 97| All Rights Reserved
98| 98|
99| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 99| For details on the license for this file, please see the
100| The copyright notice above does not evidence any 100| file, README, in this same directory.
101| actual or intended publication of such source code.
102 101
103|SLOG2 idnt 2,1 | Motorola 040 Floating Point Software Package 102|SLOG2 idnt 2,1 | Motorola 040 Floating Point Software Package
104 103
diff --git a/arch/m68k/fpsp040/slogn.S b/arch/m68k/fpsp040/slogn.S
index 2aaa0725c035..d98eaf641ec4 100644
--- a/arch/m68k/fpsp040/slogn.S
+++ b/arch/m68k/fpsp040/slogn.S
@@ -63,9 +63,8 @@
63| Copyright (C) Motorola, Inc. 1990 63| Copyright (C) Motorola, Inc. 1990
64| All Rights Reserved 64| All Rights Reserved
65| 65|
66| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 66| For details on the license for this file, please see the
67| The copyright notice above does not evidence any 67| file, README, in this same directory.
68| actual or intended publication of such source code.
69 68
70|slogn idnt 2,1 | Motorola 040 Floating Point Software Package 69|slogn idnt 2,1 | Motorola 040 Floating Point Software Package
71 70
diff --git a/arch/m68k/fpsp040/smovecr.S b/arch/m68k/fpsp040/smovecr.S
index a0127fa55e9c..73c36512081b 100644
--- a/arch/m68k/fpsp040/smovecr.S
+++ b/arch/m68k/fpsp040/smovecr.S
@@ -15,9 +15,8 @@
15| Copyright (C) Motorola, Inc. 1990 15| Copyright (C) Motorola, Inc. 1990
16| All Rights Reserved 16| All Rights Reserved
17| 17|
18| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 18| For details on the license for this file, please see the
19| The copyright notice above does not evidence any 19| file, README, in this same directory.
20| actual or intended publication of such source code.
21 20
22|SMOVECR idnt 2,1 | Motorola 040 Floating Point Software Package 21|SMOVECR idnt 2,1 | Motorola 040 Floating Point Software Package
23 22
diff --git a/arch/m68k/fpsp040/srem_mod.S b/arch/m68k/fpsp040/srem_mod.S
index 8c8d7f50cc68..a27e70c9a0eb 100644
--- a/arch/m68k/fpsp040/srem_mod.S
+++ b/arch/m68k/fpsp040/srem_mod.S
@@ -66,9 +66,8 @@
66| Copyright (C) Motorola, Inc. 1990 66| Copyright (C) Motorola, Inc. 1990
67| All Rights Reserved 67| All Rights Reserved
68| 68|
69| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 69| For details on the license for this file, please see the
70| The copyright notice above does not evidence any 70| file, README, in this same directory.
71| actual or intended publication of such source code.
72 71
73SREM_MOD: |idnt 2,1 | Motorola 040 Floating Point Software Package 72SREM_MOD: |idnt 2,1 | Motorola 040 Floating Point Software Package
74 73
diff --git a/arch/m68k/fpsp040/ssin.S b/arch/m68k/fpsp040/ssin.S
index 043c91cdd657..a1ef8e01bf06 100644
--- a/arch/m68k/fpsp040/ssin.S
+++ b/arch/m68k/fpsp040/ssin.S
@@ -83,9 +83,8 @@
83| Copyright (C) Motorola, Inc. 1990 83| Copyright (C) Motorola, Inc. 1990
84| All Rights Reserved 84| All Rights Reserved
85| 85|
86| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 86| For details on the license for this file, please see the
87| The copyright notice above does not evidence any 87| file, README, in this same directory.
88| actual or intended publication of such source code.
89 88
90|SSIN idnt 2,1 | Motorola 040 Floating Point Software Package 89|SSIN idnt 2,1 | Motorola 040 Floating Point Software Package
91 90
diff --git a/arch/m68k/fpsp040/ssinh.S b/arch/m68k/fpsp040/ssinh.S
index c8b3308bb143..8a560edc7653 100644
--- a/arch/m68k/fpsp040/ssinh.S
+++ b/arch/m68k/fpsp040/ssinh.S
@@ -49,9 +49,8 @@
49| Copyright (C) Motorola, Inc. 1990 49| Copyright (C) Motorola, Inc. 1990
50| All Rights Reserved 50| All Rights Reserved
51| 51|
52| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 52| For details on the license for this file, please see the
53| The copyright notice above does not evidence any 53| file, README, in this same directory.
54| actual or intended publication of such source code.
55 54
56|SSINH idnt 2,1 | Motorola 040 Floating Point Software Package 55|SSINH idnt 2,1 | Motorola 040 Floating Point Software Package
57 56
diff --git a/arch/m68k/fpsp040/stan.S b/arch/m68k/fpsp040/stan.S
index b5c2a196e617..f8553aaececb 100644
--- a/arch/m68k/fpsp040/stan.S
+++ b/arch/m68k/fpsp040/stan.S
@@ -50,9 +50,8 @@
50| Copyright (C) Motorola, Inc. 1990 50| Copyright (C) Motorola, Inc. 1990
51| All Rights Reserved 51| All Rights Reserved
52| 52|
53| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 53| For details on the license for this file, please see the
54| The copyright notice above does not evidence any 54| file, README, in this same directory.
55| actual or intended publication of such source code.
56 55
57|STAN idnt 2,1 | Motorola 040 Floating Point Software Package 56|STAN idnt 2,1 | Motorola 040 Floating Point Software Package
58 57
diff --git a/arch/m68k/fpsp040/stanh.S b/arch/m68k/fpsp040/stanh.S
index 33b009802243..7e12e59ee8c7 100644
--- a/arch/m68k/fpsp040/stanh.S
+++ b/arch/m68k/fpsp040/stanh.S
@@ -49,9 +49,8 @@
49| Copyright (C) Motorola, Inc. 1990 49| Copyright (C) Motorola, Inc. 1990
50| All Rights Reserved 50| All Rights Reserved
51| 51|
52| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 52| For details on the license for this file, please see the
53| The copyright notice above does not evidence any 53| file, README, in this same directory.
54| actual or intended publication of such source code.
55 54
56|STANH idnt 2,1 | Motorola 040 Floating Point Software Package 55|STANH idnt 2,1 | Motorola 040 Floating Point Software Package
57 56
diff --git a/arch/m68k/fpsp040/sto_res.S b/arch/m68k/fpsp040/sto_res.S
index 0cdca3b060ad..484b47d4eaad 100644
--- a/arch/m68k/fpsp040/sto_res.S
+++ b/arch/m68k/fpsp040/sto_res.S
@@ -19,9 +19,8 @@
19| Copyright (C) Motorola, Inc. 1990 19| Copyright (C) Motorola, Inc. 1990
20| All Rights Reserved 20| All Rights Reserved
21| 21|
22| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 22| For details on the license for this file, please see the
23| The copyright notice above does not evidence any 23| file, README, in this same directory.
24| actual or intended publication of such source code.
25 24
26STO_RES: |idnt 2,1 | Motorola 040 Floating Point Software Package 25STO_RES: |idnt 2,1 | Motorola 040 Floating Point Software Package
27 26
diff --git a/arch/m68k/fpsp040/stwotox.S b/arch/m68k/fpsp040/stwotox.S
index 4e3c1407d3df..0d5e6a1436a6 100644
--- a/arch/m68k/fpsp040/stwotox.S
+++ b/arch/m68k/fpsp040/stwotox.S
@@ -76,9 +76,8 @@
76| Copyright (C) Motorola, Inc. 1990 76| Copyright (C) Motorola, Inc. 1990
77| All Rights Reserved 77| All Rights Reserved
78| 78|
79| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 79| For details on the license for this file, please see the
80| The copyright notice above does not evidence any 80| file, README, in this same directory.
81| actual or intended publication of such source code.
82 81
83|STWOTOX idnt 2,1 | Motorola 040 Floating Point Software Package 82|STWOTOX idnt 2,1 | Motorola 040 Floating Point Software Package
84 83
diff --git a/arch/m68k/fpsp040/tbldo.S b/arch/m68k/fpsp040/tbldo.S
index fe60cf4d20d7..fd5c37a5a2b9 100644
--- a/arch/m68k/fpsp040/tbldo.S
+++ b/arch/m68k/fpsp040/tbldo.S
@@ -17,9 +17,8 @@
17| Copyright (C) Motorola, Inc. 1990 17| Copyright (C) Motorola, Inc. 1990
18| All Rights Reserved 18| All Rights Reserved
19| 19|
20| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 20| For details on the license for this file, please see the
21| The copyright notice above does not evidence any 21| file, README, in this same directory.
22| actual or intended publication of such source code.
23 22
24|TBLDO idnt 2,1 | Motorola 040 Floating Point Software Package 23|TBLDO idnt 2,1 | Motorola 040 Floating Point Software Package
25 24
diff --git a/arch/m68k/fpsp040/util.S b/arch/m68k/fpsp040/util.S
index 452f3d65857b..65b26fa88c60 100644
--- a/arch/m68k/fpsp040/util.S
+++ b/arch/m68k/fpsp040/util.S
@@ -16,9 +16,8 @@
16| Copyright (C) Motorola, Inc. 1990 16| Copyright (C) Motorola, Inc. 1990
17| All Rights Reserved 17| All Rights Reserved
18| 18|
19| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 19| For details on the license for this file, please see the
20| The copyright notice above does not evidence any 20| file, README, in this same directory.
21| actual or intended publication of such source code.
22 21
23|UTIL idnt 2,1 | Motorola 040 Floating Point Software Package 22|UTIL idnt 2,1 | Motorola 040 Floating Point Software Package
24 23
diff --git a/arch/m68k/fpsp040/x_bsun.S b/arch/m68k/fpsp040/x_bsun.S
index 039247b09c8b..d5a576bfac79 100644
--- a/arch/m68k/fpsp040/x_bsun.S
+++ b/arch/m68k/fpsp040/x_bsun.S
@@ -13,9 +13,8 @@
13| Copyright (C) Motorola, Inc. 1990 13| Copyright (C) Motorola, Inc. 1990
14| All Rights Reserved 14| All Rights Reserved
15| 15|
16| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 16| For details on the license for this file, please see the
17| The copyright notice above does not evidence any 17| file, README, in this same directory.
18| actual or intended publication of such source code.
19 18
20X_BSUN: |idnt 2,1 | Motorola 040 Floating Point Software Package 19X_BSUN: |idnt 2,1 | Motorola 040 Floating Point Software Package
21 20
diff --git a/arch/m68k/fpsp040/x_fline.S b/arch/m68k/fpsp040/x_fline.S
index 3917710b0fde..264e126d1db7 100644
--- a/arch/m68k/fpsp040/x_fline.S
+++ b/arch/m68k/fpsp040/x_fline.S
@@ -13,9 +13,8 @@
13| Copyright (C) Motorola, Inc. 1990 13| Copyright (C) Motorola, Inc. 1990
14| All Rights Reserved 14| All Rights Reserved
15| 15|
16| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 16| For details on the license for this file, please see the
17| The copyright notice above does not evidence any 17| file, README, in this same directory.
18| actual or intended publication of such source code.
19 18
20X_FLINE: |idnt 2,1 | Motorola 040 Floating Point Software Package 19X_FLINE: |idnt 2,1 | Motorola 040 Floating Point Software Package
21 20
diff --git a/arch/m68k/fpsp040/x_operr.S b/arch/m68k/fpsp040/x_operr.S
index b0f54bcb49a7..e2c371c3a45d 100644
--- a/arch/m68k/fpsp040/x_operr.S
+++ b/arch/m68k/fpsp040/x_operr.S
@@ -43,9 +43,8 @@
43| Copyright (C) Motorola, Inc. 1990 43| Copyright (C) Motorola, Inc. 1990
44| All Rights Reserved 44| All Rights Reserved
45| 45|
46| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 46| For details on the license for this file, please see the
47| The copyright notice above does not evidence any 47| file, README, in this same directory.
48| actual or intended publication of such source code.
49 48
50X_OPERR: |idnt 2,1 | Motorola 040 Floating Point Software Package 49X_OPERR: |idnt 2,1 | Motorola 040 Floating Point Software Package
51 50
diff --git a/arch/m68k/fpsp040/x_ovfl.S b/arch/m68k/fpsp040/x_ovfl.S
index 22cb8b42c7b6..6fe4989ee31f 100644
--- a/arch/m68k/fpsp040/x_ovfl.S
+++ b/arch/m68k/fpsp040/x_ovfl.S
@@ -35,9 +35,8 @@
35| Copyright (C) Motorola, Inc. 1990 35| Copyright (C) Motorola, Inc. 1990
36| All Rights Reserved 36| All Rights Reserved
37| 37|
38| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 38| For details on the license for this file, please see the
39| The copyright notice above does not evidence any 39| file, README, in this same directory.
40| actual or intended publication of such source code.
41 40
42X_OVFL: |idnt 2,1 | Motorola 040 Floating Point Software Package 41X_OVFL: |idnt 2,1 | Motorola 040 Floating Point Software Package
43 42
diff --git a/arch/m68k/fpsp040/x_snan.S b/arch/m68k/fpsp040/x_snan.S
index 039af573312e..4ed766416378 100644
--- a/arch/m68k/fpsp040/x_snan.S
+++ b/arch/m68k/fpsp040/x_snan.S
@@ -22,9 +22,8 @@
22| Copyright (C) Motorola, Inc. 1990 22| Copyright (C) Motorola, Inc. 1990
23| All Rights Reserved 23| All Rights Reserved
24| 24|
25| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 25| For details on the license for this file, please see the
26| The copyright notice above does not evidence any 26| file, README, in this same directory.
27| actual or intended publication of such source code.
28 27
29X_SNAN: |idnt 2,1 | Motorola 040 Floating Point Software Package 28X_SNAN: |idnt 2,1 | Motorola 040 Floating Point Software Package
30 29
diff --git a/arch/m68k/fpsp040/x_store.S b/arch/m68k/fpsp040/x_store.S
index 4282fa67d449..402dc0c0ebc0 100644
--- a/arch/m68k/fpsp040/x_store.S
+++ b/arch/m68k/fpsp040/x_store.S
@@ -11,9 +11,8 @@
11| Copyright (C) Motorola, Inc. 1990 11| Copyright (C) Motorola, Inc. 1990
12| All Rights Reserved 12| All Rights Reserved
13| 13|
14| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 14| For details on the license for this file, please see the
15| The copyright notice above does not evidence any 15| file, README, in this same directory.
16| actual or intended publication of such source code.
17 16
18X_STORE: |idnt 2,1 | Motorola 040 Floating Point Software Package 17X_STORE: |idnt 2,1 | Motorola 040 Floating Point Software Package
19 18
diff --git a/arch/m68k/fpsp040/x_unfl.S b/arch/m68k/fpsp040/x_unfl.S
index 077fcc230fcc..eb772ff3b812 100644
--- a/arch/m68k/fpsp040/x_unfl.S
+++ b/arch/m68k/fpsp040/x_unfl.S
@@ -21,9 +21,8 @@
21| Copyright (C) Motorola, Inc. 1990 21| Copyright (C) Motorola, Inc. 1990
22| All Rights Reserved 22| All Rights Reserved
23| 23|
24| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 24| For details on the license for this file, please see the
25| The copyright notice above does not evidence any 25| file, README, in this same directory.
26| actual or intended publication of such source code.
27 26
28X_UNFL: |idnt 2,1 | Motorola 040 Floating Point Software Package 27X_UNFL: |idnt 2,1 | Motorola 040 Floating Point Software Package
29 28
diff --git a/arch/m68k/fpsp040/x_unimp.S b/arch/m68k/fpsp040/x_unimp.S
index 920cb9410e9e..6f382b21228b 100644
--- a/arch/m68k/fpsp040/x_unimp.S
+++ b/arch/m68k/fpsp040/x_unimp.S
@@ -22,9 +22,8 @@
22| Copyright (C) Motorola, Inc. 1990 22| Copyright (C) Motorola, Inc. 1990
23| All Rights Reserved 23| All Rights Reserved
24| 24|
25| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 25| For details on the license for this file, please see the
26| The copyright notice above does not evidence any 26| file, README, in this same directory.
27| actual or intended publication of such source code.
28 27
29X_UNIMP: |idnt 2,1 | Motorola 040 Floating Point Software Package 28X_UNIMP: |idnt 2,1 | Motorola 040 Floating Point Software Package
30 29
diff --git a/arch/m68k/fpsp040/x_unsupp.S b/arch/m68k/fpsp040/x_unsupp.S
index 4ec57285b683..d7cf46208c62 100644
--- a/arch/m68k/fpsp040/x_unsupp.S
+++ b/arch/m68k/fpsp040/x_unsupp.S
@@ -23,9 +23,8 @@
23| Copyright (C) Motorola, Inc. 1990 23| Copyright (C) Motorola, Inc. 1990
24| All Rights Reserved 24| All Rights Reserved
25| 25|
26| THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA 26| For details on the license for this file, please see the
27| The copyright notice above does not evidence any 27| file, README, in this same directory.
28| actual or intended publication of such source code.
29 28
30X_UNSUPP: |idnt 2,1 | Motorola 040 Floating Point Software Package 29X_UNSUPP: |idnt 2,1 | Motorola 040 Floating Point Software Package
31 30
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index e2a6e8648960..e50858dbc237 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -29,6 +29,10 @@ config GENERIC_CALIBRATE_DELAY
29 bool 29 bool
30 default y 30 default y
31 31
32config TIME_LOW_RES
33 bool
34 default y
35
32source "init/Kconfig" 36source "init/Kconfig"
33 37
34menu "Processor type and features" 38menu "Processor type and features"
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 6a57407df1bc..38c0f3360d51 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -94,7 +94,6 @@ endif
94# machines may also. Since BFD is incredibly buggy with respect to 94# machines may also. Since BFD is incredibly buggy with respect to
95# crossformat linking we rely on the elf2ecoff tool for format conversion. 95# crossformat linking we rely on the elf2ecoff tool for format conversion.
96# 96#
97cflags-y += -I $(TOPDIR)/include/asm/gcc
98cflags-y += -G 0 -mno-abicalls -fno-pic -pipe 97cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
99LDFLAGS_vmlinux += -G 0 -static -n -nostdlib 98LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
100MODFLAGS += -mlong-calls 99MODFLAGS += -mlong-calls
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 5232fc752935..092679c2dca9 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -25,6 +25,7 @@
25#include <linux/a.out.h> 25#include <linux/a.out.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/completion.h> 27#include <linux/completion.h>
28#include <linux/kallsyms.h>
28 29
29#include <asm/abi.h> 30#include <asm/abi.h>
30#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
@@ -272,46 +273,19 @@ long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
272 273
273static struct mips_frame_info { 274static struct mips_frame_info {
274 void *func; 275 void *func;
275 int omit_fp; /* compiled without fno-omit-frame-pointer */ 276 unsigned long func_size;
276 int frame_offset; 277 int frame_size;
277 int pc_offset; 278 int pc_offset;
278} schedule_frame, mfinfo[] = { 279} *schedule_frame, mfinfo[64];
279 { schedule, 0 }, /* must be first */ 280static int mfinfo_num;
280 /* arch/mips/kernel/semaphore.c */
281 { __down, 1 },
282 { __down_interruptible, 1 },
283 /* kernel/sched.c */
284#ifdef CONFIG_PREEMPT
285 { preempt_schedule, 0 },
286#endif
287 { wait_for_completion, 0 },
288 { interruptible_sleep_on, 0 },
289 { interruptible_sleep_on_timeout, 0 },
290 { sleep_on, 0 },
291 { sleep_on_timeout, 0 },
292 { yield, 0 },
293 { io_schedule, 0 },
294 { io_schedule_timeout, 0 },
295#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)
296 { __preempt_spin_lock, 0 },
297 { __preempt_write_lock, 0 },
298#endif
299 /* kernel/timer.c */
300 { schedule_timeout, 1 },
301/* { nanosleep_restart, 1 }, */
302 /* lib/rwsem-spinlock.c */
303 { __down_read, 1 },
304 { __down_write, 1 },
305};
306 281
307static int mips_frame_info_initialized;
308static int __init get_frame_info(struct mips_frame_info *info) 282static int __init get_frame_info(struct mips_frame_info *info)
309{ 283{
310 int i; 284 int i;
311 void *func = info->func; 285 void *func = info->func;
312 union mips_instruction *ip = (union mips_instruction *)func; 286 union mips_instruction *ip = (union mips_instruction *)func;
313 info->pc_offset = -1; 287 info->pc_offset = -1;
314 info->frame_offset = info->omit_fp ? 0 : -1; 288 info->frame_size = 0;
315 for (i = 0; i < 128; i++, ip++) { 289 for (i = 0; i < 128; i++, ip++) {
316 /* if jal, jalr, jr, stop. */ 290 /* if jal, jalr, jr, stop. */
317 if (ip->j_format.opcode == jal_op || 291 if (ip->j_format.opcode == jal_op ||
@@ -320,6 +294,23 @@ static int __init get_frame_info(struct mips_frame_info *info)
320 ip->r_format.func == jr_op))) 294 ip->r_format.func == jr_op)))
321 break; 295 break;
322 296
297 if (info->func_size && i >= info->func_size / 4)
298 break;
299 if (
300#ifdef CONFIG_32BIT
301 ip->i_format.opcode == addiu_op &&
302#endif
303#ifdef CONFIG_64BIT
304 ip->i_format.opcode == daddiu_op &&
305#endif
306 ip->i_format.rs == 29 &&
307 ip->i_format.rt == 29) {
308 /* addiu/daddiu sp,sp,-imm */
309 if (info->frame_size)
310 continue;
311 info->frame_size = - ip->i_format.simmediate;
312 }
313
323 if ( 314 if (
324#ifdef CONFIG_32BIT 315#ifdef CONFIG_32BIT
325 ip->i_format.opcode == sw_op && 316 ip->i_format.opcode == sw_op &&
@@ -327,31 +318,20 @@ static int __init get_frame_info(struct mips_frame_info *info)
327#ifdef CONFIG_64BIT 318#ifdef CONFIG_64BIT
328 ip->i_format.opcode == sd_op && 319 ip->i_format.opcode == sd_op &&
329#endif 320#endif
330 ip->i_format.rs == 29) 321 ip->i_format.rs == 29 &&
331 { 322 ip->i_format.rt == 31) {
332 /* sw / sd $ra, offset($sp) */ 323 /* sw / sd $ra, offset($sp) */
333 if (ip->i_format.rt == 31) { 324 if (info->pc_offset != -1)
334 if (info->pc_offset != -1) 325 continue;
335 continue; 326 info->pc_offset =
336 info->pc_offset = 327 ip->i_format.simmediate / sizeof(long);
337 ip->i_format.simmediate / sizeof(long);
338 }
339 /* sw / sd $s8, offset($sp) */
340 if (ip->i_format.rt == 30) {
341//#if 0 /* gcc 3.4 does aggressive optimization... */
342 if (info->frame_offset != -1)
343 continue;
344//#endif
345 info->frame_offset =
346 ip->i_format.simmediate / sizeof(long);
347 }
348 } 328 }
349 } 329 }
350 if (info->pc_offset == -1 || info->frame_offset == -1) { 330 if (info->pc_offset == -1 || info->frame_size == 0) {
351 printk("Can't analyze prologue code at %p\n", func); 331 if (func == schedule)
332 printk("Can't analyze prologue code at %p\n", func);
352 info->pc_offset = -1; 333 info->pc_offset = -1;
353 info->frame_offset = -1; 334 info->frame_size = 0;
354 return -1;
355 } 335 }
356 336
357 return 0; 337 return 0;
@@ -359,25 +339,36 @@ static int __init get_frame_info(struct mips_frame_info *info)
359 339
360static int __init frame_info_init(void) 340static int __init frame_info_init(void)
361{ 341{
362 int i, found; 342 int i;
363 for (i = 0; i < ARRAY_SIZE(mfinfo); i++) 343#ifdef CONFIG_KALLSYMS
364 if (get_frame_info(&mfinfo[i])) 344 char *modname;
365 return -1; 345 char namebuf[KSYM_NAME_LEN + 1];
366 schedule_frame = mfinfo[0]; 346 unsigned long start, size, ofs;
367 /* bubble sort */ 347 extern char __sched_text_start[], __sched_text_end[];
368 do { 348 extern char __lock_text_start[], __lock_text_end[];
369 struct mips_frame_info tmp; 349
370 found = 0; 350 start = (unsigned long)__sched_text_start;
371 for (i = 1; i < ARRAY_SIZE(mfinfo); i++) { 351 for (i = 0; i < ARRAY_SIZE(mfinfo); i++) {
372 if (mfinfo[i-1].func > mfinfo[i].func) { 352 if (start == (unsigned long)schedule)
373 tmp = mfinfo[i]; 353 schedule_frame = &mfinfo[i];
374 mfinfo[i] = mfinfo[i-1]; 354 if (!kallsyms_lookup(start, &size, &ofs, &modname, namebuf))
375 mfinfo[i-1] = tmp; 355 break;
376 found = 1; 356 mfinfo[i].func = (void *)(start + ofs);
377 } 357 mfinfo[i].func_size = size;
378 } 358 start += size - ofs;
379 } while (found); 359 if (start >= (unsigned long)__lock_text_end)
380 mips_frame_info_initialized = 1; 360 break;
361 if (start == (unsigned long)__sched_text_end)
362 start = (unsigned long)__lock_text_start;
363 }
364#else
365 mfinfo[0].func = schedule;
366 schedule_frame = &mfinfo[0];
367#endif
368 for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
369 get_frame_info(&mfinfo[i]);
370
371 mfinfo_num = i;
381 return 0; 372 return 0;
382} 373}
383 374
@@ -394,47 +385,52 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
394 if (t->reg31 == (unsigned long) ret_from_fork) 385 if (t->reg31 == (unsigned long) ret_from_fork)
395 return t->reg31; 386 return t->reg31;
396 387
397 if (schedule_frame.pc_offset < 0) 388 if (!schedule_frame || schedule_frame->pc_offset < 0)
398 return 0; 389 return 0;
399 return ((unsigned long *)t->reg29)[schedule_frame.pc_offset]; 390 return ((unsigned long *)t->reg29)[schedule_frame->pc_offset];
400} 391}
401 392
402/* get_wchan - a maintenance nightmare^W^Wpain in the ass ... */ 393/* get_wchan - a maintenance nightmare^W^Wpain in the ass ... */
403unsigned long get_wchan(struct task_struct *p) 394unsigned long get_wchan(struct task_struct *p)
404{ 395{
405 unsigned long stack_page; 396 unsigned long stack_page;
406 unsigned long frame, pc; 397 unsigned long pc;
398#ifdef CONFIG_KALLSYMS
399 unsigned long frame;
400#endif
407 401
408 if (!p || p == current || p->state == TASK_RUNNING) 402 if (!p || p == current || p->state == TASK_RUNNING)
409 return 0; 403 return 0;
410 404
411 stack_page = (unsigned long)task_stack_page(p); 405 stack_page = (unsigned long)task_stack_page(p);
412 if (!stack_page || !mips_frame_info_initialized) 406 if (!stack_page || !mfinfo_num)
413 return 0; 407 return 0;
414 408
415 pc = thread_saved_pc(p); 409 pc = thread_saved_pc(p);
410#ifdef CONFIG_KALLSYMS
416 if (!in_sched_functions(pc)) 411 if (!in_sched_functions(pc))
417 return pc; 412 return pc;
418 413
419 frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset]; 414 frame = p->thread.reg29 + schedule_frame->frame_size;
420 do { 415 do {
421 int i; 416 int i;
422 417
423 if (frame < stack_page || frame > stack_page + THREAD_SIZE - 32) 418 if (frame < stack_page || frame > stack_page + THREAD_SIZE - 32)
424 return 0; 419 return 0;
425 420
426 for (i = ARRAY_SIZE(mfinfo) - 1; i >= 0; i--) { 421 for (i = mfinfo_num - 1; i >= 0; i--) {
427 if (pc >= (unsigned long) mfinfo[i].func) 422 if (pc >= (unsigned long) mfinfo[i].func)
428 break; 423 break;
429 } 424 }
430 if (i < 0) 425 if (i < 0)
431 break; 426 break;
432 427
433 if (mfinfo[i].omit_fp)
434 break;
435 pc = ((unsigned long *)frame)[mfinfo[i].pc_offset]; 428 pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
436 frame = ((unsigned long *)frame)[mfinfo[i].frame_offset]; 429 if (!mfinfo[i].frame_size)
430 break;
431 frame += mfinfo[i].frame_size;
437 } while (in_sched_functions(pc)); 432 } while (in_sched_functions(pc));
433#endif
438 434
439 return pc; 435 return pc;
440} 436}
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index d7c4a38ed5ae..d83e033dbc87 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -623,7 +623,7 @@ einval: li v0, -EINVAL
623 sys sys_mknodat 4 /* 4290 */ 623 sys sys_mknodat 4 /* 4290 */
624 sys sys_fchownat 5 624 sys sys_fchownat 5
625 sys sys_futimesat 3 625 sys sys_futimesat 3
626 sys sys_newfstatat 4 626 sys sys_fstatat64 4
627 sys sys_unlinkat 3 627 sys sys_unlinkat 3
628 sys sys_renameat 4 /* 4295 */ 628 sys sys_renameat 4 /* 4295 */
629 sys sys_linkat 4 629 sys sys_linkat 4
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h
index 0fbc492d24b4..36bfc2588aa3 100644
--- a/arch/mips/kernel/signal-common.h
+++ b/arch/mips/kernel/signal-common.h
@@ -176,7 +176,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
176 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0)) 176 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
177 sp = current->sas_ss_sp + current->sas_ss_size; 177 sp = current->sas_ss_sp + current->sas_ss_size;
178 178
179 return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? 32 : ALMASK)); 179 return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? ~(cpu_icache_line_size()-1) : ALMASK));
180} 180}
181 181
182static inline int install_sigtramp(unsigned int __user *tramp, 182static inline int install_sigtramp(unsigned int __user *tramp,
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index da3271e1fdac..8a8b8dd90417 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -537,7 +537,7 @@ _sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
537 /* The ucontext contains a stack32_t, so we must convert! */ 537 /* The ucontext contains a stack32_t, so we must convert! */
538 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) 538 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
539 goto badframe; 539 goto badframe;
540 st.ss_size = (long) sp; 540 st.ss_sp = (void *)(long) sp;
541 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) 541 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
542 goto badframe; 542 goto badframe;
543 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) 543 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index 384fc4a639a4..5a3776096f07 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -108,7 +108,7 @@ _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
108 /* The ucontext contains a stack32_t, so we must convert! */ 108 /* The ucontext contains a stack32_t, so we must convert! */
109 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) 109 if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
110 goto badframe; 110 goto badframe;
111 st.ss_size = (long) sp; 111 st.ss_sp = (void *)(long) sp;
112 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) 112 if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
113 goto badframe; 113 goto badframe;
114 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) 114 if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
diff --git a/arch/mips/kernel/smp_mt.c b/arch/mips/kernel/smp_mt.c
index 794a1c3de2a4..c930364830d0 100644
--- a/arch/mips/kernel/smp_mt.c
+++ b/arch/mips/kernel/smp_mt.c
@@ -68,6 +68,8 @@ void __init sanitize_tlb_entries(void)
68 68
69 set_c0_mvpcontrol(MVPCONTROL_VPC); 69 set_c0_mvpcontrol(MVPCONTROL_VPC);
70 70
71 back_to_back_c0_hazard();
72
71 /* Disable TLB sharing */ 73 /* Disable TLB sharing */
72 clear_c0_mvpcontrol(MVPCONTROL_STLB); 74 clear_c0_mvpcontrol(MVPCONTROL_STLB);
73 75
@@ -102,35 +104,6 @@ void __init sanitize_tlb_entries(void)
102 clear_c0_mvpcontrol(MVPCONTROL_VPC); 104 clear_c0_mvpcontrol(MVPCONTROL_VPC);
103} 105}
104 106
105#if 0
106/*
107 * Use c0_MVPConf0 to find out how many CPUs are available, setting up
108 * phys_cpu_present_map and the logical/physical mappings.
109 */
110void __init prom_build_cpu_map(void)
111{
112 int i, num, ncpus;
113
114 cpus_clear(phys_cpu_present_map);
115
116 /* assume we boot on cpu 0.... */
117 cpu_set(0, phys_cpu_present_map);
118 __cpu_number_map[0] = 0;
119 __cpu_logical_map[0] = 0;
120
121 if (cpu_has_mipsmt) {
122 ncpus = ((read_c0_mvpconf0() & (MVPCONF0_PVPE)) >> MVPCONF0_PVPE_SHIFT) + 1;
123 for (i=1, num=0; i< NR_CPUS && i<ncpus; i++) {
124 cpu_set(i, phys_cpu_present_map);
125 __cpu_number_map[i] = ++num;
126 __cpu_logical_map[num] = i;
127 }
128
129 printk(KERN_INFO "%i available secondary CPU(s)\n", num);
130 }
131}
132#endif
133
134static void ipi_resched_dispatch (struct pt_regs *regs) 107static void ipi_resched_dispatch (struct pt_regs *regs)
135{ 108{
136 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ, regs); 109 do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ, regs);
@@ -222,6 +195,9 @@ void prom_prepare_cpus(unsigned int max_cpus)
222 195
223 /* set config to be the same as vpe0, particularly kseg0 coherency alg */ 196 /* set config to be the same as vpe0, particularly kseg0 coherency alg */
224 write_vpe_c0_config( read_c0_config()); 197 write_vpe_c0_config( read_c0_config());
198
199 /* Propagate Config7 */
200 write_vpe_c0_config7(read_c0_config7());
225 } 201 }
226 202
227 } 203 }
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index e51c38cef88e..1b71d91e8268 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -471,61 +471,29 @@ struct flush_icache_range_args {
471static inline void local_r4k_flush_icache_range(void *args) 471static inline void local_r4k_flush_icache_range(void *args)
472{ 472{
473 struct flush_icache_range_args *fir_args = args; 473 struct flush_icache_range_args *fir_args = args;
474 unsigned long dc_lsize = cpu_dcache_line_size();
475 unsigned long ic_lsize = cpu_icache_line_size();
476 unsigned long sc_lsize = cpu_scache_line_size();
477 unsigned long start = fir_args->start; 474 unsigned long start = fir_args->start;
478 unsigned long end = fir_args->end; 475 unsigned long end = fir_args->end;
479 unsigned long addr, aend;
480 476
481 if (!cpu_has_ic_fills_f_dc) { 477 if (!cpu_has_ic_fills_f_dc) {
482 if (end - start > dcache_size) { 478 if (end - start > dcache_size) {
483 r4k_blast_dcache(); 479 r4k_blast_dcache();
484 } else { 480 } else {
485 R4600_HIT_CACHEOP_WAR_IMPL; 481 R4600_HIT_CACHEOP_WAR_IMPL;
486 addr = start & ~(dc_lsize - 1); 482 protected_blast_dcache_range(start, end);
487 aend = (end - 1) & ~(dc_lsize - 1);
488
489 while (1) {
490 /* Hit_Writeback_Inv_D */
491 protected_writeback_dcache_line(addr);
492 if (addr == aend)
493 break;
494 addr += dc_lsize;
495 }
496 } 483 }
497 484
498 if (!cpu_icache_snoops_remote_store) { 485 if (!cpu_icache_snoops_remote_store) {
499 if (end - start > scache_size) { 486 if (end - start > scache_size)
500 r4k_blast_scache(); 487 r4k_blast_scache();
501 } else { 488 else
502 addr = start & ~(sc_lsize - 1); 489 protected_blast_scache_range(start, end);
503 aend = (end - 1) & ~(sc_lsize - 1);
504
505 while (1) {
506 /* Hit_Writeback_Inv_SD */
507 protected_writeback_scache_line(addr);
508 if (addr == aend)
509 break;
510 addr += sc_lsize;
511 }
512 }
513 } 490 }
514 } 491 }
515 492
516 if (end - start > icache_size) 493 if (end - start > icache_size)
517 r4k_blast_icache(); 494 r4k_blast_icache();
518 else { 495 else
519 addr = start & ~(ic_lsize - 1); 496 protected_blast_icache_range(start, end);
520 aend = (end - 1) & ~(ic_lsize - 1);
521 while (1) {
522 /* Hit_Invalidate_I */
523 protected_flush_icache_line(addr);
524 if (addr == aend)
525 break;
526 addr += ic_lsize;
527 }
528 }
529} 497}
530 498
531static void r4k_flush_icache_range(unsigned long start, unsigned long end) 499static void r4k_flush_icache_range(unsigned long start, unsigned long end)
@@ -619,27 +587,14 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma,
619 587
620static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) 588static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
621{ 589{
622 unsigned long end, a;
623
624 /* Catch bad driver code */ 590 /* Catch bad driver code */
625 BUG_ON(size == 0); 591 BUG_ON(size == 0);
626 592
627 if (cpu_has_subset_pcaches) { 593 if (cpu_has_subset_pcaches) {
628 unsigned long sc_lsize = cpu_scache_line_size(); 594 if (size >= scache_size)
629
630 if (size >= scache_size) {
631 r4k_blast_scache(); 595 r4k_blast_scache();
632 return; 596 else
633 } 597 blast_scache_range(addr, addr + size);
634
635 a = addr & ~(sc_lsize - 1);
636 end = (addr + size - 1) & ~(sc_lsize - 1);
637 while (1) {
638 flush_scache_line(a); /* Hit_Writeback_Inv_SD */
639 if (a == end)
640 break;
641 a += sc_lsize;
642 }
643 return; 598 return;
644 } 599 }
645 600
@@ -651,17 +606,8 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
651 if (size >= dcache_size) { 606 if (size >= dcache_size) {
652 r4k_blast_dcache(); 607 r4k_blast_dcache();
653 } else { 608 } else {
654 unsigned long dc_lsize = cpu_dcache_line_size();
655
656 R4600_HIT_CACHEOP_WAR_IMPL; 609 R4600_HIT_CACHEOP_WAR_IMPL;
657 a = addr & ~(dc_lsize - 1); 610 blast_dcache_range(addr, addr + size);
658 end = (addr + size - 1) & ~(dc_lsize - 1);
659 while (1) {
660 flush_dcache_line(a); /* Hit_Writeback_Inv_D */
661 if (a == end)
662 break;
663 a += dc_lsize;
664 }
665 } 611 }
666 612
667 bc_wback_inv(addr, size); 613 bc_wback_inv(addr, size);
@@ -669,44 +615,22 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
669 615
670static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) 616static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
671{ 617{
672 unsigned long end, a;
673
674 /* Catch bad driver code */ 618 /* Catch bad driver code */
675 BUG_ON(size == 0); 619 BUG_ON(size == 0);
676 620
677 if (cpu_has_subset_pcaches) { 621 if (cpu_has_subset_pcaches) {
678 unsigned long sc_lsize = cpu_scache_line_size(); 622 if (size >= scache_size)
679
680 if (size >= scache_size) {
681 r4k_blast_scache(); 623 r4k_blast_scache();
682 return; 624 else
683 } 625 blast_scache_range(addr, addr + size);
684
685 a = addr & ~(sc_lsize - 1);
686 end = (addr + size - 1) & ~(sc_lsize - 1);
687 while (1) {
688 flush_scache_line(a); /* Hit_Writeback_Inv_SD */
689 if (a == end)
690 break;
691 a += sc_lsize;
692 }
693 return; 626 return;
694 } 627 }
695 628
696 if (size >= dcache_size) { 629 if (size >= dcache_size) {
697 r4k_blast_dcache(); 630 r4k_blast_dcache();
698 } else { 631 } else {
699 unsigned long dc_lsize = cpu_dcache_line_size();
700
701 R4600_HIT_CACHEOP_WAR_IMPL; 632 R4600_HIT_CACHEOP_WAR_IMPL;
702 a = addr & ~(dc_lsize - 1); 633 blast_dcache_range(addr, addr + size);
703 end = (addr + size - 1) & ~(dc_lsize - 1);
704 while (1) {
705 flush_dcache_line(a); /* Hit_Writeback_Inv_D */
706 if (a == end)
707 break;
708 a += dc_lsize;
709 }
710 } 634 }
711 635
712 bc_inv(addr, size); 636 bc_inv(addr, size);
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index 0a97a9434eba..7c572bea4a98 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -44,8 +44,6 @@ __asm__ __volatile__( \
44/* TX39H-style cache flush routines. */ 44/* TX39H-style cache flush routines. */
45static void tx39h_flush_icache_all(void) 45static void tx39h_flush_icache_all(void)
46{ 46{
47 unsigned long start = KSEG0;
48 unsigned long end = (start + icache_size);
49 unsigned long flags, config; 47 unsigned long flags, config;
50 48
51 /* disable icache (set ICE#) */ 49 /* disable icache (set ICE#) */
@@ -53,33 +51,18 @@ static void tx39h_flush_icache_all(void)
53 config = read_c0_conf(); 51 config = read_c0_conf();
54 write_c0_conf(config & ~TX39_CONF_ICE); 52 write_c0_conf(config & ~TX39_CONF_ICE);
55 TX39_STOP_STREAMING(); 53 TX39_STOP_STREAMING();
56 54 blast_icache16();
57 /* invalidate icache */
58 while (start < end) {
59 cache16_unroll32(start, Index_Invalidate_I);
60 start += 0x200;
61 }
62
63 write_c0_conf(config); 55 write_c0_conf(config);
64 local_irq_restore(flags); 56 local_irq_restore(flags);
65} 57}
66 58
67static void tx39h_dma_cache_wback_inv(unsigned long addr, unsigned long size) 59static void tx39h_dma_cache_wback_inv(unsigned long addr, unsigned long size)
68{ 60{
69 unsigned long end, a;
70 unsigned long dc_lsize = current_cpu_data.dcache.linesz;
71
72 /* Catch bad driver code */ 61 /* Catch bad driver code */
73 BUG_ON(size == 0); 62 BUG_ON(size == 0);
74 63
75 iob(); 64 iob();
76 a = addr & ~(dc_lsize - 1); 65 blast_inv_dcache_range(addr, addr + size);
77 end = (addr + size - 1) & ~(dc_lsize - 1);
78 while (1) {
79 invalidate_dcache_line(a); /* Hit_Invalidate_D */
80 if (a == end) break;
81 a += dc_lsize;
82 }
83} 66}
84 67
85 68
@@ -241,42 +224,21 @@ static void tx39_flush_data_cache_page(unsigned long addr)
241 224
242static void tx39_flush_icache_range(unsigned long start, unsigned long end) 225static void tx39_flush_icache_range(unsigned long start, unsigned long end)
243{ 226{
244 unsigned long dc_lsize = current_cpu_data.dcache.linesz;
245 unsigned long addr, aend;
246
247 if (end - start > dcache_size) 227 if (end - start > dcache_size)
248 tx39_blast_dcache(); 228 tx39_blast_dcache();
249 else { 229 else
250 addr = start & ~(dc_lsize - 1); 230 protected_blast_dcache_range(start, end);
251 aend = (end - 1) & ~(dc_lsize - 1);
252
253 while (1) {
254 /* Hit_Writeback_Inv_D */
255 protected_writeback_dcache_line(addr);
256 if (addr == aend)
257 break;
258 addr += dc_lsize;
259 }
260 }
261 231
262 if (end - start > icache_size) 232 if (end - start > icache_size)
263 tx39_blast_icache(); 233 tx39_blast_icache();
264 else { 234 else {
265 unsigned long flags, config; 235 unsigned long flags, config;
266 addr = start & ~(dc_lsize - 1);
267 aend = (end - 1) & ~(dc_lsize - 1);
268 /* disable icache (set ICE#) */ 236 /* disable icache (set ICE#) */
269 local_irq_save(flags); 237 local_irq_save(flags);
270 config = read_c0_conf(); 238 config = read_c0_conf();
271 write_c0_conf(config & ~TX39_CONF_ICE); 239 write_c0_conf(config & ~TX39_CONF_ICE);
272 TX39_STOP_STREAMING(); 240 TX39_STOP_STREAMING();
273 while (1) { 241 protected_blast_icache_range(start, end);
274 /* Hit_Invalidate_I */
275 protected_flush_icache_line(addr);
276 if (addr == aend)
277 break;
278 addr += dc_lsize;
279 }
280 write_c0_conf(config); 242 write_c0_conf(config);
281 local_irq_restore(flags); 243 local_irq_restore(flags);
282 } 244 }
@@ -311,7 +273,7 @@ static void tx39_flush_icache_page(struct vm_area_struct *vma, struct page *page
311 273
312static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size) 274static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size)
313{ 275{
314 unsigned long end, a; 276 unsigned long end;
315 277
316 if (((size | addr) & (PAGE_SIZE - 1)) == 0) { 278 if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
317 end = addr + size; 279 end = addr + size;
@@ -322,20 +284,13 @@ static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size)
322 } else if (size > dcache_size) { 284 } else if (size > dcache_size) {
323 tx39_blast_dcache(); 285 tx39_blast_dcache();
324 } else { 286 } else {
325 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 287 blast_dcache_range(addr, addr + size);
326 a = addr & ~(dc_lsize - 1);
327 end = (addr + size - 1) & ~(dc_lsize - 1);
328 while (1) {
329 flush_dcache_line(a); /* Hit_Writeback_Inv_D */
330 if (a == end) break;
331 a += dc_lsize;
332 }
333 } 288 }
334} 289}
335 290
336static void tx39_dma_cache_inv(unsigned long addr, unsigned long size) 291static void tx39_dma_cache_inv(unsigned long addr, unsigned long size)
337{ 292{
338 unsigned long end, a; 293 unsigned long end;
339 294
340 if (((size | addr) & (PAGE_SIZE - 1)) == 0) { 295 if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
341 end = addr + size; 296 end = addr + size;
@@ -346,14 +301,7 @@ static void tx39_dma_cache_inv(unsigned long addr, unsigned long size)
346 } else if (size > dcache_size) { 301 } else if (size > dcache_size) {
347 tx39_blast_dcache(); 302 tx39_blast_dcache();
348 } else { 303 } else {
349 unsigned long dc_lsize = current_cpu_data.dcache.linesz; 304 blast_inv_dcache_range(addr, addr + size);
350 a = addr & ~(dc_lsize - 1);
351 end = (addr + size - 1) & ~(dc_lsize - 1);
352 while (1) {
353 invalidate_dcache_line(a); /* Hit_Invalidate_D */
354 if (a == end) break;
355 a += dc_lsize;
356 }
357 } 305 }
358} 306}
359 307
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 7c914a4c67c3..eca33cfa8a4c 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -29,6 +29,11 @@ config GENERIC_CALIBRATE_DELAY
29 bool 29 bool
30 default y 30 default y
31 31
32config TIME_LOW_RES
33 bool
34 depends on SMP
35 default y
36
32config GENERIC_ISA_DMA 37config GENERIC_ISA_DMA
33 bool 38 bool
34 39
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 51d2480627d1..71011eadb872 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -377,15 +377,15 @@
377 ENTRY_SAME(inotify_init) 377 ENTRY_SAME(inotify_init)
378 ENTRY_SAME(inotify_add_watch) /* 270 */ 378 ENTRY_SAME(inotify_add_watch) /* 270 */
379 ENTRY_SAME(inotify_rm_watch) 379 ENTRY_SAME(inotify_rm_watch)
380 ENTRY_COMP(pselect6) 380 ENTRY_SAME(ni_syscall) /* 271 ENTRY_COMP(pselect6) */
381 ENTRY_COMP(ppoll) 381 ENTRY_SAME(ni_syscall) /* 272 ENTRY_COMP(ppoll) */
382 ENTRY_SAME(migrate_pages) 382 ENTRY_SAME(migrate_pages)
383 ENTRY_COMP(openat) /* 275 */ 383 ENTRY_COMP(openat) /* 275 */
384 ENTRY_SAME(mkdirat) 384 ENTRY_SAME(mkdirat)
385 ENTRY_SAME(mknodat) 385 ENTRY_SAME(mknodat)
386 ENTRY_SAME(fchownat) 386 ENTRY_SAME(fchownat)
387 ENTRY_COMP(futimesat) 387 ENTRY_COMP(futimesat)
388 ENTRY_COMP(newfstatat) /* 280 */ 388 ENTRY_SAME(fstatat64) /* 280 */
389 ENTRY_SAME(unlinkat) 389 ENTRY_SAME(unlinkat)
390 ENTRY_SAME(renameat) 390 ENTRY_SAME(renameat)
391 ENTRY_SAME(linkat) 391 ENTRY_SAME(linkat)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index df338c5cc910..80d114a3a837 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -83,6 +83,12 @@ config GENERIC_TBSYNC
83 default y if PPC32 && SMP 83 default y if PPC32 && SMP
84 default n 84 default n
85 85
86config DEFAULT_UIMAGE
87 bool
88 help
89 Used to allow a board to specify it wants a uImage built by default
90 default n
91
86menu "Processor support" 92menu "Processor support"
87choice 93choice
88 prompt "Processor Type" 94 prompt "Processor Type"
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index efcad7601a7a..5500ab55d042 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -142,6 +142,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
142# Default to zImage, override when needed 142# Default to zImage, override when needed
143defaultimage-y := zImage 143defaultimage-y := zImage
144defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux 144defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
145defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage
145KBUILD_IMAGE := $(defaultimage-y) 146KBUILD_IMAGE := $(defaultimage-y)
146all: $(KBUILD_IMAGE) 147all: $(KBUILD_IMAGE)
147 148
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index c287980b7e65..80e9fe2632b8 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -12,10 +12,10 @@ endif
12 12
13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ 13obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
14 irq.o align.o signal_32.o pmc.o vdso.o \ 14 irq.o align.o signal_32.o pmc.o vdso.o \
15 init_task.o process.o 15 init_task.o process.o systbl.o
16obj-y += vdso32/ 16obj-y += vdso32/
17obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ 17obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \
18 signal_64.o ptrace32.o systbl.o \ 18 signal_64.o ptrace32.o \
19 paca.o cpu_setup_power4.o \ 19 paca.o cpu_setup_power4.o \
20 firmware.o sysfs.o idle_64.o 20 firmware.o sysfs.o idle_64.o
21obj-$(CONFIG_PPC64) += vdso64/ 21obj-$(CONFIG_PPC64) += vdso64/
@@ -46,7 +46,7 @@ extra-$(CONFIG_8xx) := head_8xx.o
46extra-y += vmlinux.lds 46extra-y += vmlinux.lds
47 47
48obj-y += time.o prom.o traps.o setup-common.o udbg.o 48obj-y += time.o prom.o traps.o setup-common.o udbg.o
49obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o 49obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o
50obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o 50obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o
51obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 51obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
52obj-$(CONFIG_MODULES) += ppc_ksyms.o 52obj-$(CONFIG_MODULES) += ppc_ksyms.o
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index 007b15ee36d2..8a9f994ed917 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -36,8 +36,6 @@
36#ifdef CONFIG_PPC64 36#ifdef CONFIG_PPC64
37#define sys_sigpending sys_ni_syscall 37#define sys_sigpending sys_ni_syscall
38#define sys_old_getrlimit sys_ni_syscall 38#define sys_old_getrlimit sys_ni_syscall
39#else
40#define ppc_rtas sys_ni_syscall
41#endif 39#endif
42 40
43_GLOBAL(sys_call_table) 41_GLOBAL(sys_call_table)
@@ -323,3 +321,4 @@ SYSCALL(spu_run)
323SYSCALL(spu_create) 321SYSCALL(spu_create)
324COMPAT_SYS(pselect6) 322COMPAT_SYS(pselect6)
325COMPAT_SYS(ppoll) 323COMPAT_SYS(ppoll)
324SYSCALL(unshare)
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index c3427eed8345..5a936566fd61 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -1048,286 +1048,3 @@ _GLOBAL(name) \
1048 blr 1048 blr
1049 1049
1050SYSCALL(execve) 1050SYSCALL(execve)
1051
1052/* Why isn't this a) automatic, b) written in 'C'? */
1053 .data
1054 .align 4
1055_GLOBAL(sys_call_table)
1056 .long sys_restart_syscall /* 0 */
1057 .long sys_exit
1058 .long ppc_fork
1059 .long sys_read
1060 .long sys_write
1061 .long sys_open /* 5 */
1062 .long sys_close
1063 .long sys_waitpid
1064 .long sys_creat
1065 .long sys_link
1066 .long sys_unlink /* 10 */
1067 .long sys_execve
1068 .long sys_chdir
1069 .long sys_time
1070 .long sys_mknod
1071 .long sys_chmod /* 15 */
1072 .long sys_lchown
1073 .long sys_ni_syscall /* old break syscall holder */
1074 .long sys_stat
1075 .long sys_lseek
1076 .long sys_getpid /* 20 */
1077 .long sys_mount
1078 .long sys_oldumount
1079 .long sys_setuid
1080 .long sys_getuid
1081 .long sys_stime /* 25 */
1082 .long sys_ptrace
1083 .long sys_alarm
1084 .long sys_fstat
1085 .long sys_pause
1086 .long sys_utime /* 30 */
1087 .long sys_ni_syscall /* old stty syscall holder */
1088 .long sys_ni_syscall /* old gtty syscall holder */
1089 .long sys_access
1090 .long sys_nice
1091 .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */
1092 .long sys_sync
1093 .long sys_kill
1094 .long sys_rename
1095 .long sys_mkdir
1096 .long sys_rmdir /* 40 */
1097 .long sys_dup
1098 .long sys_pipe
1099 .long sys_times
1100 .long sys_ni_syscall /* old prof syscall holder */
1101 .long sys_brk /* 45 */
1102 .long sys_setgid
1103 .long sys_getgid
1104 .long sys_signal
1105 .long sys_geteuid
1106 .long sys_getegid /* 50 */
1107 .long sys_acct
1108 .long sys_umount /* recycled never used phys() */
1109 .long sys_ni_syscall /* old lock syscall holder */
1110 .long sys_ioctl
1111 .long sys_fcntl /* 55 */
1112 .long sys_ni_syscall /* old mpx syscall holder */
1113 .long sys_setpgid
1114 .long sys_ni_syscall /* old ulimit syscall holder */
1115 .long sys_olduname
1116 .long sys_umask /* 60 */
1117 .long sys_chroot
1118 .long sys_ustat
1119 .long sys_dup2
1120 .long sys_getppid
1121 .long sys_getpgrp /* 65 */
1122 .long sys_setsid
1123 .long sys_sigaction
1124 .long sys_sgetmask
1125 .long sys_ssetmask
1126 .long sys_setreuid /* 70 */
1127 .long sys_setregid
1128 .long sys_sigsuspend
1129 .long sys_sigpending
1130 .long sys_sethostname
1131 .long sys_setrlimit /* 75 */
1132 .long sys_old_getrlimit
1133 .long sys_getrusage
1134 .long sys_gettimeofday
1135 .long sys_settimeofday
1136 .long sys_getgroups /* 80 */
1137 .long sys_setgroups
1138 .long ppc_select
1139 .long sys_symlink
1140 .long sys_lstat
1141 .long sys_readlink /* 85 */
1142 .long sys_uselib
1143 .long sys_swapon
1144 .long sys_reboot
1145 .long old_readdir
1146 .long sys_mmap /* 90 */
1147 .long sys_munmap
1148 .long sys_truncate
1149 .long sys_ftruncate
1150 .long sys_fchmod
1151 .long sys_fchown /* 95 */
1152 .long sys_getpriority
1153 .long sys_setpriority
1154 .long sys_ni_syscall /* old profil syscall holder */
1155 .long sys_statfs
1156 .long sys_fstatfs /* 100 */
1157 .long sys_ni_syscall
1158 .long sys_socketcall
1159 .long sys_syslog
1160 .long sys_setitimer
1161 .long sys_getitimer /* 105 */
1162 .long sys_newstat
1163 .long sys_newlstat
1164 .long sys_newfstat
1165 .long sys_uname
1166 .long sys_ni_syscall /* 110 */
1167 .long sys_vhangup
1168 .long sys_ni_syscall /* old 'idle' syscall */
1169 .long sys_ni_syscall
1170 .long sys_wait4
1171 .long sys_swapoff /* 115 */
1172 .long sys_sysinfo
1173 .long sys_ipc
1174 .long sys_fsync
1175 .long sys_sigreturn
1176 .long ppc_clone /* 120 */
1177 .long sys_setdomainname
1178 .long sys_newuname
1179 .long sys_ni_syscall
1180 .long sys_adjtimex
1181 .long sys_mprotect /* 125 */
1182 .long sys_sigprocmask
1183 .long sys_ni_syscall /* old sys_create_module */
1184 .long sys_init_module
1185 .long sys_delete_module
1186 .long sys_ni_syscall /* old sys_get_kernel_syms */ /* 130 */
1187 .long sys_quotactl
1188 .long sys_getpgid
1189 .long sys_fchdir
1190 .long sys_bdflush
1191 .long sys_sysfs /* 135 */
1192 .long sys_personality
1193 .long sys_ni_syscall /* for afs_syscall */
1194 .long sys_setfsuid
1195 .long sys_setfsgid
1196 .long sys_llseek /* 140 */
1197 .long sys_getdents
1198 .long ppc_select
1199 .long sys_flock
1200 .long sys_msync
1201 .long sys_readv /* 145 */
1202 .long sys_writev
1203 .long sys_getsid
1204 .long sys_fdatasync
1205 .long sys_sysctl
1206 .long sys_mlock /* 150 */
1207 .long sys_munlock
1208 .long sys_mlockall
1209 .long sys_munlockall
1210 .long sys_sched_setparam
1211 .long sys_sched_getparam /* 155 */
1212 .long sys_sched_setscheduler
1213 .long sys_sched_getscheduler
1214 .long sys_sched_yield
1215 .long sys_sched_get_priority_max
1216 .long sys_sched_get_priority_min /* 160 */
1217 .long sys_sched_rr_get_interval
1218 .long sys_nanosleep
1219 .long sys_mremap
1220 .long sys_setresuid
1221 .long sys_getresuid /* 165 */
1222 .long sys_ni_syscall /* old sys_query_module */
1223 .long sys_poll
1224 .long sys_nfsservctl
1225 .long sys_setresgid
1226 .long sys_getresgid /* 170 */
1227 .long sys_prctl
1228 .long sys_rt_sigreturn
1229 .long sys_rt_sigaction
1230 .long sys_rt_sigprocmask
1231 .long sys_rt_sigpending /* 175 */
1232 .long sys_rt_sigtimedwait
1233 .long sys_rt_sigqueueinfo
1234 .long sys_rt_sigsuspend
1235 .long sys_pread64
1236 .long sys_pwrite64 /* 180 */
1237 .long sys_chown
1238 .long sys_getcwd
1239 .long sys_capget
1240 .long sys_capset
1241 .long sys_sigaltstack /* 185 */
1242 .long sys_sendfile
1243 .long sys_ni_syscall /* streams1 */
1244 .long sys_ni_syscall /* streams2 */
1245 .long ppc_vfork
1246 .long sys_getrlimit /* 190 */
1247 .long sys_readahead
1248 .long sys_mmap2
1249 .long sys_truncate64
1250 .long sys_ftruncate64
1251 .long sys_stat64 /* 195 */
1252 .long sys_lstat64
1253 .long sys_fstat64
1254 .long sys_pciconfig_read
1255 .long sys_pciconfig_write
1256 .long sys_pciconfig_iobase /* 200 */
1257 .long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */
1258 .long sys_getdents64
1259 .long sys_pivot_root
1260 .long sys_fcntl64
1261 .long sys_madvise /* 205 */
1262 .long sys_mincore
1263 .long sys_gettid
1264 .long sys_tkill
1265 .long sys_setxattr
1266 .long sys_lsetxattr /* 210 */
1267 .long sys_fsetxattr
1268 .long sys_getxattr
1269 .long sys_lgetxattr
1270 .long sys_fgetxattr
1271 .long sys_listxattr /* 215 */
1272 .long sys_llistxattr
1273 .long sys_flistxattr
1274 .long sys_removexattr
1275 .long sys_lremovexattr
1276 .long sys_fremovexattr /* 220 */
1277 .long sys_futex
1278 .long sys_sched_setaffinity
1279 .long sys_sched_getaffinity
1280 .long sys_ni_syscall
1281 .long sys_ni_syscall /* 225 - reserved for Tux */
1282 .long sys_sendfile64
1283 .long sys_io_setup
1284 .long sys_io_destroy
1285 .long sys_io_getevents
1286 .long sys_io_submit /* 230 */
1287 .long sys_io_cancel
1288 .long sys_set_tid_address
1289 .long sys_fadvise64
1290 .long sys_exit_group
1291 .long sys_lookup_dcookie /* 235 */
1292 .long sys_epoll_create
1293 .long sys_epoll_ctl
1294 .long sys_epoll_wait
1295 .long sys_remap_file_pages
1296 .long sys_timer_create /* 240 */
1297 .long sys_timer_settime
1298 .long sys_timer_gettime
1299 .long sys_timer_getoverrun
1300 .long sys_timer_delete
1301 .long sys_clock_settime /* 245 */
1302 .long sys_clock_gettime
1303 .long sys_clock_getres
1304 .long sys_clock_nanosleep
1305 .long sys_swapcontext
1306 .long sys_tgkill /* 250 */
1307 .long sys_utimes
1308 .long sys_statfs64
1309 .long sys_fstatfs64
1310 .long ppc_fadvise64_64
1311 .long sys_ni_syscall /* 255 - rtas (used on ppc64) */
1312 .long sys_debug_setcontext
1313 .long sys_ni_syscall /* 257 reserved for vserver */
1314 .long sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */
1315 .long sys_ni_syscall /* 259 reserved for new sys_mbind */
1316 .long sys_ni_syscall /* 260 reserved for new sys_get_mempolicy */
1317 .long sys_ni_syscall /* 261 reserved for new sys_set_mempolicy */
1318 .long sys_mq_open
1319 .long sys_mq_unlink
1320 .long sys_mq_timedsend
1321 .long sys_mq_timedreceive /* 265 */
1322 .long sys_mq_notify
1323 .long sys_mq_getsetattr
1324 .long sys_kexec_load
1325 .long sys_add_key
1326 .long sys_request_key /* 270 */
1327 .long sys_keyctl
1328 .long sys_waitid
1329 .long sys_ioprio_set
1330 .long sys_ioprio_get
1331 .long sys_inotify_init /* 275 */
1332 .long sys_inotify_add_watch
1333 .long sys_inotify_rm_watch
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 3525c91204d4..f8d0cd540a06 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/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.16-rc1 3# Linux kernel version: 2.6.16-rc2
4# Thu Jan 19 10:58:53 2006 4# Wed Feb 8 10:44:39 2006
5# 5#
6CONFIG_MMU=y 6CONFIG_MMU=y
7CONFIG_RWSEM_XCHGADD_ALGORITHM=y 7CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -12,7 +12,6 @@ CONFIG_S390=y
12# Code maturity level options 12# Code maturity level options
13# 13#
14CONFIG_EXPERIMENTAL=y 14CONFIG_EXPERIMENTAL=y
15CONFIG_CLEAN_COMPILE=y
16CONFIG_LOCK_KERNEL=y 15CONFIG_LOCK_KERNEL=y
17CONFIG_INIT_ENV_ARG_LIMIT=32 16CONFIG_INIT_ENV_ARG_LIMIT=32
18 17
@@ -154,6 +153,7 @@ CONFIG_NET=y
154# 153#
155# Networking options 154# Networking options
156# 155#
156# CONFIG_NETDEBUG is not set
157CONFIG_PACKET=y 157CONFIG_PACKET=y
158# CONFIG_PACKET_MMAP is not set 158# CONFIG_PACKET_MMAP is not set
159CONFIG_UNIX=y 159CONFIG_UNIX=y
@@ -607,6 +607,7 @@ CONFIG_MSDOS_PARTITION=y
607# Instrumentation Support 607# Instrumentation Support
608# 608#
609# CONFIG_PROFILING is not set 609# CONFIG_PROFILING is not set
610# CONFIG_STATISTICS is not set
610 611
611# 612#
612# Kernel hacking 613# Kernel hacking
@@ -624,7 +625,7 @@ CONFIG_DEBUG_MUTEXES=y
624# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 625# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
625# CONFIG_DEBUG_KOBJECT is not set 626# CONFIG_DEBUG_KOBJECT is not set
626# CONFIG_DEBUG_INFO is not set 627# CONFIG_DEBUG_INFO is not set
627# CONFIG_DEBUG_FS is not set 628CONFIG_DEBUG_FS=y
628# CONFIG_DEBUG_VM is not set 629# CONFIG_DEBUG_VM is not set
629CONFIG_FORCED_INLINING=y 630CONFIG_FORCED_INLINING=y
630# CONFIG_RCU_TORTURE_TEST is not set 631# CONFIG_RCU_TORTURE_TEST is not set
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index cc20f0e3a7d3..2d021626c1a6 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -905,6 +905,26 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
905 return ret; 905 return ret;
906} 906}
907 907
908asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
909 struct stat64_emu31 __user* statbuf, int flag)
910{
911 struct kstat stat;
912 int error = -EINVAL;
913
914 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
915 goto out;
916
917 if (flag & AT_SYMLINK_NOFOLLOW)
918 error = vfs_lstat_fd(dfd, filename, &stat);
919 else
920 error = vfs_stat_fd(dfd, filename, &stat);
921
922 if (!error)
923 error = cp_stat64(statbuf, &stat);
924out:
925 return error;
926}
927
908/* 928/*
909 * Linux/i386 didn't use to be able to handle more than 929 * Linux/i386 didn't use to be able to handle more than
910 * 4 system call parameters, so these system calls used a memory 930 * 4 system call parameters, so these system calls used a memory
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index ef706694a0c1..5291b5f8788d 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -195,9 +195,6 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
195 return ret; 195 return ret;
196} 196}
197 197
198int
199do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact);
200
201asmlinkage long 198asmlinkage long
202sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, 199sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
203 struct sigaction32 __user *oact, size_t sigsetsize) 200 struct sigaction32 __user *oact, size_t sigsetsize)
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 83b33fe1923c..dd2d6c3e8df8 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
1523 llgtr %r4,%r4 # struct timeval * 1523 llgtr %r4,%r4 # struct timeval *
1524 jg compat_sys_futimesat 1524 jg compat_sys_futimesat
1525 1525
1526 .globl compat_sys_newfstatat_wrapper 1526 .globl sys32_fstatat_wrapper
1527compat_sys_newfstatat_wrapper: 1527sys32_fstatat_wrapper:
1528 llgfr %r2,%r2 # unsigned int 1528 llgfr %r2,%r2 # unsigned int
1529 llgtr %r3,%r3 # char * 1529 llgtr %r3,%r3 # char *
1530 llgtr %r4,%r4 # struct stat * 1530 llgtr %r4,%r4 # struct stat64 *
1531 lgfr %r5,%r5 # int 1531 lgfr %r5,%r5 # int
1532 jg compat_sys_newfstatat 1532 jg sys32_fstatat
1533 1533
1534 .globl sys_unlinkat_wrapper 1534 .globl sys_unlinkat_wrapper
1535sys_unlinkat_wrapper: 1535sys_unlinkat_wrapper:
@@ -1602,3 +1602,8 @@ compat_sys_ppoll_wrapper:
1602 llgtr %r5,%r5 # const sigset_t * 1602 llgtr %r5,%r5 # const sigset_t *
1603 llgfr %r6,%r6 # size_t 1603 llgfr %r6,%r6 # size_t
1604 jg compat_sys_ppoll 1604 jg compat_sys_ppoll
1605
1606 .globl sys_unshare_wrapper
1607sys_unshare_wrapper:
1608 llgfr %r2,%r2 # unsigned long
1609 jg sys_unshare
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index f0ed5c642c74..bad81b5832db 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -12,15 +12,16 @@
12 * on the S390 architecture. 12 * on the S390 architecture.
13 */ 13 */
14 14
15#include <asm/cio.h>
16#include <asm/setup.h>
17#include <linux/device.h> 15#include <linux/device.h>
18#include <linux/mm.h> 16#include <linux/mm.h>
19#include <linux/kexec.h> 17#include <linux/kexec.h>
20#include <linux/delay.h> 18#include <linux/delay.h>
19#include <asm/cio.h>
20#include <asm/setup.h>
21#include <asm/pgtable.h> 21#include <asm/pgtable.h>
22#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
23#include <asm/system.h> 23#include <asm/system.h>
24#include <asm/smp.h>
24 25
25static void kexec_halt_all_cpus(void *); 26static void kexec_halt_all_cpus(void *);
26 27
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index cbfcfd02a43a..0d1ad5dbe2b1 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -52,7 +52,7 @@ extern volatile int __cpu_logical_map[];
52struct _lowcore *lowcore_ptr[NR_CPUS]; 52struct _lowcore *lowcore_ptr[NR_CPUS];
53 53
54cpumask_t cpu_online_map; 54cpumask_t cpu_online_map;
55cpumask_t cpu_possible_map; 55cpumask_t cpu_possible_map = CPU_MASK_ALL;
56 56
57static struct task_struct *current_set[NR_CPUS]; 57static struct task_struct *current_set[NR_CPUS];
58 58
@@ -514,9 +514,6 @@ __init smp_check_cpus(unsigned int max_cpus)
514 num_cpus++; 514 num_cpus++;
515 } 515 }
516 516
517 for (cpu = 1; cpu < max_cpus; cpu++)
518 cpu_set(cpu, cpu_possible_map);
519
520 printk("Detected %d CPU's\n",(int) num_cpus); 517 printk("Detected %d CPU's\n",(int) num_cpus);
521 printk("Boot cpu address %2X\n", boot_cpu_addr); 518 printk("Boot cpu address %2X\n", boot_cpu_addr);
522} 519}
@@ -810,7 +807,6 @@ void __devinit smp_prepare_boot_cpu(void)
810 807
811 cpu_set(0, cpu_online_map); 808 cpu_set(0, cpu_online_map);
812 cpu_set(0, cpu_present_map); 809 cpu_set(0, cpu_present_map);
813 cpu_set(0, cpu_possible_map);
814 S390_lowcore.percpu_offset = __per_cpu_offset[0]; 810 S390_lowcore.percpu_offset = __per_cpu_offset[0];
815 current_set[0] = current; 811 current_set[0] = current;
816} 812}
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 3280345efacd..84921fe8d266 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
301SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ 301SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */
302SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) 302SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
303SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper) 303SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
304SYSCALL(sys_newfstatat,sys_newfstatat,compat_sys_newfstatat_wrapper) 304SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
305SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper) 305SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
306SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */ 306SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */
307SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper) 307SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
@@ -311,3 +311,4 @@ SYSCALL(sys_fchmodat,sys_fchmodat,sys_fchmodat_wrapper)
311SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */ 311SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */
312SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper) 312SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper)
313SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper) 313SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper)
314SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper)
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c
index e96c35bddac7..71f0a2fb3078 100644
--- a/arch/s390/lib/delay.c
+++ b/arch/s390/lib/delay.c
@@ -30,7 +30,7 @@ void __delay(unsigned long loops)
30 */ 30 */
31 __asm__ __volatile__( 31 __asm__ __volatile__(
32 "0: brct %0,0b" 32 "0: brct %0,0b"
33 : /* no outputs */ : "r" (loops/2) ); 33 : /* no outputs */ : "r" ((loops/2) + 1));
34} 34}
35 35
36/* 36/*
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index c0314705d73a..768de64b371f 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -76,7 +76,7 @@ sys_call_table:
76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 76/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 77/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
78/*280*/ .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 78/*280*/ .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat
79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_newfstatat 79/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 80/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 81/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
82 82
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 9264ccbaaafa..417727bd87ba 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -428,6 +428,27 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
428 return error; 428 return error;
429} 429}
430 430
431asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename,
432 struct compat_stat64 __user * statbuf, int flag)
433{
434 struct kstat stat;
435 int error = -EINVAL;
436
437 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
438 goto out;
439
440 if (flag & AT_SYMLINK_NOFOLLOW)
441 error = vfs_lstat_fd(dfd, filename, &stat);
442 else
443 error = vfs_stat_fd(dfd, filename, &stat);
444
445 if (!error)
446 error = cp_compat_stat64(&stat, statbuf);
447
448out:
449 return error;
450}
451
431asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2) 452asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2)
432{ 453{
433 return sys_sysfs(option, arg1, arg2); 454 return sys_sysfs(option, arg1, arg2);
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index a19168510be2..c3adb7ac167d 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -77,7 +77,7 @@ sys_call_table32:
77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink 77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid 78 .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
79/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat 79/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat
80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_newfstatat 80 .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
81/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 81/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare 82 .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
83 83
@@ -146,7 +146,7 @@ sys_call_table:
146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink 146/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
147 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid 147 .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
148/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat 148/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat
149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_newfstatat 149 .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
150/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat 150/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare 151 .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
152 152
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index 04494638b963..e7fc3e500342 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -28,6 +28,10 @@ config GENERIC_IRQ_PROBE
28 bool 28 bool
29 default y 29 default y
30 30
31config TIME_LOW_RES
32 bool
33 default y
34
31# Turn off some random 386 crap that can affect device config 35# Turn off some random 386 crap that can affect device config
32config ISA 36config ISA
33 bool 37 bool
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index ada4535d0161..00dee176c08e 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -677,7 +677,7 @@ ia32_sys_call_table:
677 .quad sys_mknodat 677 .quad sys_mknodat
678 .quad sys_fchownat 678 .quad sys_fchownat
679 .quad compat_sys_futimesat 679 .quad compat_sys_futimesat
680 .quad compat_sys_newfstatat /* 300 */ 680 .quad sys32_fstatat /* 300 */
681 .quad sys_unlinkat 681 .quad sys_unlinkat
682 .quad sys_renameat 682 .quad sys_renameat
683 .quad sys_linkat 683 .quad sys_linkat
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 54481af5344a..2bc55af95419 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -180,6 +180,28 @@ sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
180 return ret; 180 return ret;
181} 181}
182 182
183asmlinkage long
184sys32_fstatat(unsigned int dfd, char __user *filename,
185 struct stat64 __user* statbuf, int flag)
186{
187 struct kstat stat;
188 int error = -EINVAL;
189
190 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
191 goto out;
192
193 if (flag & AT_SYMLINK_NOFOLLOW)
194 error = vfs_lstat_fd(dfd, filename, &stat);
195 else
196 error = vfs_stat_fd(dfd, filename, &stat);
197
198 if (!error)
199 error = cp_stat64(statbuf, &stat);
200
201out:
202 return error;
203}
204
183/* 205/*
184 * Linux/i386 didn't use to be able to handle more than 206 * Linux/i386 didn't use to be able to handle more than
185 * 4 system call parameters, so these system calls used a memory 207 * 4 system call parameters, so these system calls used a memory
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 6147770b4347..7a0a3e8d5d72 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -708,7 +708,7 @@ static void setup_APIC_timer(unsigned int clocks)
708 local_irq_save(flags); 708 local_irq_save(flags);
709 709
710 /* wait for irq slice */ 710 /* wait for irq slice */
711 if (vxtime.hpet_address) { 711 if (vxtime.hpet_address && hpet_use_timer) {
712 int trigger = hpet_readl(HPET_T0_CMP); 712 int trigger = hpet_readl(HPET_T0_CMP);
713 while (hpet_readl(HPET_COUNTER) >= trigger) 713 while (hpet_readl(HPET_COUNTER) >= trigger)
714 /* do nothing */ ; 714 /* do nothing */ ;
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 2fe23a6c361b..dd0718dc178b 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -310,7 +310,7 @@ void gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, int di
310 310
311 for (i = 0; i < nents; i++) { 311 for (i = 0; i < nents; i++) {
312 struct scatterlist *s = &sg[i]; 312 struct scatterlist *s = &sg[i];
313 if (!s->dma_length || !s->length) 313 if (!s->dma_length)
314 break; 314 break;
315 dma_unmap_single(dev, s->dma_address, s->dma_length, dir); 315 dma_unmap_single(dev, s->dma_address, s->dma_length, dir);
316 } 316 }
@@ -364,7 +364,6 @@ static int __dma_map_cont(struct scatterlist *sg, int start, int stopat,
364 364
365 BUG_ON(i > start && s->offset); 365 BUG_ON(i > start && s->offset);
366 if (i == start) { 366 if (i == start) {
367 *sout = *s;
368 sout->dma_address = iommu_bus_base; 367 sout->dma_address = iommu_bus_base;
369 sout->dma_address += iommu_page*PAGE_SIZE + s->offset; 368 sout->dma_address += iommu_page*PAGE_SIZE + s->offset;
370 sout->dma_length = s->length; 369 sout->dma_length = s->length;
@@ -379,7 +378,7 @@ static int __dma_map_cont(struct scatterlist *sg, int start, int stopat,
379 SET_LEAK(iommu_page); 378 SET_LEAK(iommu_page);
380 addr += PAGE_SIZE; 379 addr += PAGE_SIZE;
381 iommu_page++; 380 iommu_page++;
382 } 381 }
383 } 382 }
384 BUG_ON(iommu_page - iommu_start != pages); 383 BUG_ON(iommu_page - iommu_start != pages);
385 return 0; 384 return 0;
@@ -391,7 +390,6 @@ static inline int dma_map_cont(struct scatterlist *sg, int start, int stopat,
391{ 390{
392 if (!need) { 391 if (!need) {
393 BUG_ON(stopat - start != 1); 392 BUG_ON(stopat - start != 1);
394 *sout = sg[start];
395 sout->dma_length = sg[start].length; 393 sout->dma_length = sg[start].length;
396 return 0; 394 return 0;
397 } 395 }
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index dba7237be5c1..3c58c30506a1 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -59,7 +59,7 @@ static int notsc __initdata = 0;
59unsigned int cpu_khz; /* TSC clocks / usec, not used here */ 59unsigned int cpu_khz; /* TSC clocks / usec, not used here */
60static unsigned long hpet_period; /* fsecs / HPET clock */ 60static unsigned long hpet_period; /* fsecs / HPET clock */
61unsigned long hpet_tick; /* HPET clocks / interrupt */ 61unsigned long hpet_tick; /* HPET clocks / interrupt */
62static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ 62int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */
63unsigned long vxtime_hz = PIT_TICK_RATE; 63unsigned long vxtime_hz = PIT_TICK_RATE;
64int report_lost_ticks; /* command line option */ 64int report_lost_ticks; /* command line option */
65unsigned long long monotonic_base; 65unsigned long long monotonic_base;
@@ -326,7 +326,10 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs)
326 print_symbol("rip %s\n", regs->rip); 326 print_symbol("rip %s\n", regs->rip);
327 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { 327 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
328 printk(KERN_WARNING "Falling back to HPET\n"); 328 printk(KERN_WARNING "Falling back to HPET\n");
329 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 329 if (hpet_use_timer)
330 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
331 else
332 vxtime.last = hpet_readl(HPET_COUNTER);
330 vxtime.mode = VXTIME_HPET; 333 vxtime.mode = VXTIME_HPET;
331 do_gettimeoffset = do_gettimeoffset_hpet; 334 do_gettimeoffset = do_gettimeoffset_hpet;
332 } 335 }
@@ -988,7 +991,10 @@ void __init time_init_gtod(void)
988 notsc = 1; 991 notsc = 1;
989 if (vxtime.hpet_address && notsc) { 992 if (vxtime.hpet_address && notsc) {
990 timetype = hpet_use_timer ? "HPET" : "PIT/HPET"; 993 timetype = hpet_use_timer ? "HPET" : "PIT/HPET";
991 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 994 if (hpet_use_timer)
995 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
996 else
997 vxtime.last = hpet_readl(HPET_COUNTER);
992 vxtime.mode = VXTIME_HPET; 998 vxtime.mode = VXTIME_HPET;
993 do_gettimeoffset = do_gettimeoffset_hpet; 999 do_gettimeoffset = do_gettimeoffset_hpet;
994#ifdef CONFIG_X86_PM_TIMER 1000#ifdef CONFIG_X86_PM_TIMER
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index ee1b2da9e5e7..28d50dc540e8 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -90,6 +90,20 @@ static inline void conditional_sti(struct pt_regs *regs)
90 local_irq_enable(); 90 local_irq_enable();
91} 91}
92 92
93static inline void preempt_conditional_sti(struct pt_regs *regs)
94{
95 preempt_disable();
96 if (regs->eflags & X86_EFLAGS_IF)
97 local_irq_enable();
98}
99
100static inline void preempt_conditional_cli(struct pt_regs *regs)
101{
102 if (regs->eflags & X86_EFLAGS_IF)
103 local_irq_disable();
104 preempt_enable_no_resched();
105}
106
93static int kstack_depth_to_print = 10; 107static int kstack_depth_to_print = 10;
94 108
95#ifdef CONFIG_KALLSYMS 109#ifdef CONFIG_KALLSYMS
@@ -693,7 +707,7 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
693 SIGTRAP) == NOTIFY_STOP) 707 SIGTRAP) == NOTIFY_STOP)
694 return; 708 return;
695 709
696 conditional_sti(regs); 710 preempt_conditional_sti(regs);
697 711
698 /* Mask out spurious debug traps due to lazy DR7 setting */ 712 /* Mask out spurious debug traps due to lazy DR7 setting */
699 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { 713 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
@@ -738,11 +752,13 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
738 752
739clear_dr7: 753clear_dr7:
740 set_debugreg(0UL, 7); 754 set_debugreg(0UL, 7);
755 preempt_conditional_cli(regs);
741 return; 756 return;
742 757
743clear_TF_reenable: 758clear_TF_reenable:
744 set_tsk_thread_flag(tsk, TIF_SINGLESTEP); 759 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
745 regs->eflags &= ~TF_MASK; 760 regs->eflags &= ~TF_MASK;
761 preempt_conditional_cli(regs);
746} 762}
747 763
748static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr) 764static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 4e7dbcc425ff..93e44d0292ab 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -645,7 +645,7 @@ static void pkt_copy_bio_data(struct bio *src_bio, int seg, int offs, struct pag
645 * b) The data can be used as cache to avoid read requests if we receive a 645 * b) The data can be used as cache to avoid read requests if we receive a
646 * new write request for the same zone. 646 * new write request for the same zone.
647 */ 647 */
648static void pkt_make_local_copy(struct packet_data *pkt, struct page **pages, int *offsets) 648static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec)
649{ 649{
650 int f, p, offs; 650 int f, p, offs;
651 651
@@ -653,15 +653,15 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct page **pages, in
653 p = 0; 653 p = 0;
654 offs = 0; 654 offs = 0;
655 for (f = 0; f < pkt->frames; f++) { 655 for (f = 0; f < pkt->frames; f++) {
656 if (pages[f] != pkt->pages[p]) { 656 if (bvec[f].bv_page != pkt->pages[p]) {
657 void *vfrom = kmap_atomic(pages[f], KM_USER0) + offsets[f]; 657 void *vfrom = kmap_atomic(bvec[f].bv_page, KM_USER0) + bvec[f].bv_offset;
658 void *vto = page_address(pkt->pages[p]) + offs; 658 void *vto = page_address(pkt->pages[p]) + offs;
659 memcpy(vto, vfrom, CD_FRAMESIZE); 659 memcpy(vto, vfrom, CD_FRAMESIZE);
660 kunmap_atomic(vfrom, KM_USER0); 660 kunmap_atomic(vfrom, KM_USER0);
661 pages[f] = pkt->pages[p]; 661 bvec[f].bv_page = pkt->pages[p];
662 offsets[f] = offs; 662 bvec[f].bv_offset = offs;
663 } else { 663 } else {
664 BUG_ON(offsets[f] != offs); 664 BUG_ON(bvec[f].bv_offset != offs);
665 } 665 }
666 offs += CD_FRAMESIZE; 666 offs += CD_FRAMESIZE;
667 if (offs >= PAGE_SIZE) { 667 if (offs >= PAGE_SIZE) {
@@ -991,18 +991,17 @@ try_next_bio:
991static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) 991static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
992{ 992{
993 struct bio *bio; 993 struct bio *bio;
994 struct page *pages[PACKET_MAX_SIZE];
995 int offsets[PACKET_MAX_SIZE];
996 int f; 994 int f;
997 int frames_write; 995 int frames_write;
996 struct bio_vec *bvec = pkt->w_bio->bi_io_vec;
998 997
999 for (f = 0; f < pkt->frames; f++) { 998 for (f = 0; f < pkt->frames; f++) {
1000 pages[f] = pkt->pages[(f * CD_FRAMESIZE) / PAGE_SIZE]; 999 bvec[f].bv_page = pkt->pages[(f * CD_FRAMESIZE) / PAGE_SIZE];
1001 offsets[f] = (f * CD_FRAMESIZE) % PAGE_SIZE; 1000 bvec[f].bv_offset = (f * CD_FRAMESIZE) % PAGE_SIZE;
1002 } 1001 }
1003 1002
1004 /* 1003 /*
1005 * Fill-in pages[] and offsets[] with data from orig_bios. 1004 * Fill-in bvec with data from orig_bios.
1006 */ 1005 */
1007 frames_write = 0; 1006 frames_write = 0;
1008 spin_lock(&pkt->lock); 1007 spin_lock(&pkt->lock);
@@ -1024,11 +1023,11 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
1024 } 1023 }
1025 1024
1026 if (src_bvl->bv_len - src_offs >= CD_FRAMESIZE) { 1025 if (src_bvl->bv_len - src_offs >= CD_FRAMESIZE) {
1027 pages[f] = src_bvl->bv_page; 1026 bvec[f].bv_page = src_bvl->bv_page;
1028 offsets[f] = src_bvl->bv_offset + src_offs; 1027 bvec[f].bv_offset = src_bvl->bv_offset + src_offs;
1029 } else { 1028 } else {
1030 pkt_copy_bio_data(bio, segment, src_offs, 1029 pkt_copy_bio_data(bio, segment, src_offs,
1031 pages[f], offsets[f]); 1030 bvec[f].bv_page, bvec[f].bv_offset);
1032 } 1031 }
1033 src_offs += CD_FRAMESIZE; 1032 src_offs += CD_FRAMESIZE;
1034 frames_write++; 1033 frames_write++;
@@ -1042,7 +1041,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
1042 BUG_ON(frames_write != pkt->write_size); 1041 BUG_ON(frames_write != pkt->write_size);
1043 1042
1044 if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) { 1043 if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) {
1045 pkt_make_local_copy(pkt, pages, offsets); 1044 pkt_make_local_copy(pkt, bvec);
1046 pkt->cache_valid = 1; 1045 pkt->cache_valid = 1;
1047 } else { 1046 } else {
1048 pkt->cache_valid = 0; 1047 pkt->cache_valid = 0;
@@ -1055,17 +1054,9 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
1055 pkt->w_bio->bi_bdev = pd->bdev; 1054 pkt->w_bio->bi_bdev = pd->bdev;
1056 pkt->w_bio->bi_end_io = pkt_end_io_packet_write; 1055 pkt->w_bio->bi_end_io = pkt_end_io_packet_write;
1057 pkt->w_bio->bi_private = pkt; 1056 pkt->w_bio->bi_private = pkt;
1058 for (f = 0; f < pkt->frames; f++) { 1057 for (f = 0; f < pkt->frames; f++)
1059 if ((f + 1 < pkt->frames) && (pages[f + 1] == pages[f]) && 1058 if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset))
1060 (offsets[f + 1] = offsets[f] + CD_FRAMESIZE)) { 1059 BUG();
1061 if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE * 2, offsets[f]))
1062 BUG();
1063 f++;
1064 } else {
1065 if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE, offsets[f]))
1066 BUG();
1067 }
1068 }
1069 VPRINTK("pktcdvd: vcnt=%d\n", pkt->w_bio->bi_vcnt); 1060 VPRINTK("pktcdvd: vcnt=%d\n", pkt->w_bio->bi_vcnt);
1070 1061
1071 atomic_set(&pkt->io_wait, 1); 1062 atomic_set(&pkt->io_wait, 1);
@@ -1548,7 +1539,7 @@ static int pkt_good_disc(struct pktcdvd_device *pd, disc_information *di)
1548 case 0x12: /* DVD-RAM */ 1539 case 0x12: /* DVD-RAM */
1549 return 0; 1540 return 0;
1550 default: 1541 default:
1551 printk("pktcdvd: Wrong disc profile (%x)\n", pd->mmc3_profile); 1542 VPRINTK("pktcdvd: Wrong disc profile (%x)\n", pd->mmc3_profile);
1552 return 1; 1543 return 1;
1553 } 1544 }
1554 1545
@@ -1894,8 +1885,8 @@ static int pkt_open_write(struct pktcdvd_device *pd)
1894 unsigned int write_speed, media_write_speed, read_speed; 1885 unsigned int write_speed, media_write_speed, read_speed;
1895 1886
1896 if ((ret = pkt_probe_settings(pd))) { 1887 if ((ret = pkt_probe_settings(pd))) {
1897 DPRINTK("pktcdvd: %s failed probe\n", pd->name); 1888 VPRINTK("pktcdvd: %s failed probe\n", pd->name);
1898 return -EIO; 1889 return -EROFS;
1899 } 1890 }
1900 1891
1901 if ((ret = pkt_set_write_settings(pd))) { 1892 if ((ret = pkt_set_write_settings(pd))) {
@@ -2053,10 +2044,9 @@ static int pkt_open(struct inode *inode, struct file *file)
2053 goto out_dec; 2044 goto out_dec;
2054 } 2045 }
2055 } else { 2046 } else {
2056 if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) { 2047 ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE);
2057 ret = -EIO; 2048 if (ret)
2058 goto out_dec; 2049 goto out_dec;
2059 }
2060 /* 2050 /*
2061 * needed here as well, since ext2 (among others) may change 2051 * needed here as well, since ext2 (among others) may change
2062 * the blocksize at mount time 2052 * the blocksize at mount time
@@ -2436,11 +2426,12 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
2436 * The door gets locked when the device is opened, so we 2426 * The door gets locked when the device is opened, so we
2437 * have to unlock it or else the eject command fails. 2427 * have to unlock it or else the eject command fails.
2438 */ 2428 */
2439 pkt_lock_door(pd, 0); 2429 if (pd->refcnt == 1)
2430 pkt_lock_door(pd, 0);
2440 return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg); 2431 return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
2441 2432
2442 default: 2433 default:
2443 printk("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd); 2434 VPRINTK("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd);
2444 return -ENOTTY; 2435 return -ENOTTY;
2445 } 2436 }
2446 2437
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index e522d19ad886..7e21b1ff27c4 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -474,18 +474,6 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
474/* ======================== Card services HCI interaction ======================== */ 474/* ======================== Card services HCI interaction ======================== */
475 475
476 476
477static struct device *bt3c_device(void)
478{
479 static struct device dev = {
480 .bus_id = "pcmcia",
481 };
482 kobject_set_name(&dev.kobj, "bt3c");
483 kobject_init(&dev.kobj);
484
485 return &dev;
486}
487
488
489static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count) 477static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count)
490{ 478{
491 char *ptr = (char *) firmware; 479 char *ptr = (char *) firmware;
@@ -574,6 +562,7 @@ static int bt3c_open(bt3c_info_t *info)
574{ 562{
575 const struct firmware *firmware; 563 const struct firmware *firmware;
576 struct hci_dev *hdev; 564 struct hci_dev *hdev;
565 client_handle_t handle;
577 int err; 566 int err;
578 567
579 spin_lock_init(&(info->lock)); 568 spin_lock_init(&(info->lock));
@@ -605,8 +594,10 @@ static int bt3c_open(bt3c_info_t *info)
605 594
606 hdev->owner = THIS_MODULE; 595 hdev->owner = THIS_MODULE;
607 596
597 handle = info->link.handle;
598
608 /* Load firmware */ 599 /* Load firmware */
609 err = request_firmware(&firmware, "BT3CPCC.bin", bt3c_device()); 600 err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle));
610 if (err < 0) { 601 if (err < 0) {
611 BT_ERR("Firmware request failed"); 602 BT_ERR("Firmware request failed");
612 goto error; 603 goto error;
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 8fd6357a48da..2c17e88a8847 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -85,7 +85,6 @@
85 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 85 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
86 {0x1002, 0x596A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 86 {0x1002, 0x596A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
87 {0x1002, 0x596B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 87 {0x1002, 0x596B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
88 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \
89 {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \ 88 {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \
90 {0x1002, 0x5c62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 89 {0x1002, 0x5c62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
91 {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \ 90 {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index 57539d8f9f7c..09dc4b01232c 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -150,17 +150,6 @@ static void rs_wait_until_sent(struct tty_struct *, int);
150/* Standard COM flags (except for COM4, because of the 8514 problem) */ 150/* Standard COM flags (except for COM4, because of the 8514 problem) */
151#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) 151#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
152 152
153/*
154 * tmp_buf is used as a temporary buffer by serial_write. We need to
155 * lock it in case the memcpy_fromfs blocks while swapping in a page,
156 * and some other program tries to do a serial write at the same time.
157 * Since the lock will only come under contention when the system is
158 * swapping and available memory is low, it makes sense to share one
159 * buffer across all the serial ports, since it significantly saves
160 * memory if large numbers of serial ports are open.
161 */
162static unsigned char *tmp_buf;
163
164static inline int serial_paranoia_check(struct esp_struct *info, 153static inline int serial_paranoia_check(struct esp_struct *info,
165 char *name, const char *routine) 154 char *name, const char *routine)
166{ 155{
@@ -1267,7 +1256,7 @@ static int rs_write(struct tty_struct * tty,
1267 if (serial_paranoia_check(info, tty->name, "rs_write")) 1256 if (serial_paranoia_check(info, tty->name, "rs_write"))
1268 return 0; 1257 return 0;
1269 1258
1270 if (!tty || !info->xmit_buf || !tmp_buf) 1259 if (!tty || !info->xmit_buf)
1271 return 0; 1260 return 0;
1272 1261
1273 while (1) { 1262 while (1) {
@@ -2291,11 +2280,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp)
2291 tty->driver_data = info; 2280 tty->driver_data = info;
2292 info->tty = tty; 2281 info->tty = tty;
2293 2282
2294 if (!tmp_buf) { 2283 spin_unlock_irqrestore(&info->lock, flags);
2295 tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL);
2296 if (!tmp_buf)
2297 return -ENOMEM;
2298 }
2299 2284
2300 /* 2285 /*
2301 * Start up serial port 2286 * Start up serial port
@@ -2602,9 +2587,6 @@ static void __exit espserial_exit(void)
2602 free_pages((unsigned long)dma_buffer, 2587 free_pages((unsigned long)dma_buffer,
2603 get_order(DMA_BUFFER_SZ)); 2588 get_order(DMA_BUFFER_SZ));
2604 2589
2605 if (tmp_buf)
2606 free_page((unsigned long)tmp_buf);
2607
2608 while (free_pio_buf) { 2590 while (free_pio_buf) {
2609 pio_buf = free_pio_buf->next; 2591 pio_buf = free_pio_buf->next;
2610 kfree(free_pio_buf); 2592 kfree(free_pio_buf);
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 66a2fee06eb9..ef140ebde117 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -956,22 +956,18 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
956 } 956 }
957 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) { 957 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
958 struct acpi_resource_extended_irq *irqp; 958 struct acpi_resource_extended_irq *irqp;
959 int i; 959 int i, irq;
960 960
961 irqp = &res->data.extended_irq; 961 irqp = &res->data.extended_irq;
962 962
963 if (irqp->interrupt_count > 0) { 963 for (i = 0; i < irqp->interrupt_count; i++) {
964 hdp->hd_nirqs = irqp->interrupt_count; 964 irq = acpi_register_gsi(irqp->interrupts[i],
965 965 irqp->triggering, irqp->polarity);
966 for (i = 0; i < hdp->hd_nirqs; i++) { 966 if (irq < 0)
967 int rc = 967 return AE_ERROR;
968 acpi_register_gsi(irqp->interrupts[i], 968
969 irqp->triggering, 969 hdp->hd_irq[hdp->hd_nirqs] = irq;
970 irqp->polarity); 970 hdp->hd_nirqs++;
971 if (rc < 0)
972 return AE_ERROR;
973 hdp->hd_irq[i] = rc;
974 }
975 } 971 }
976 } 972 }
977 973
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 41a94bc79f67..eb2eb3e12d6a 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -250,12 +250,17 @@ tipar_open(struct inode *inode, struct file *file)
250{ 250{
251 unsigned int minor = iminor(inode) - TIPAR_MINOR; 251 unsigned int minor = iminor(inode) - TIPAR_MINOR;
252 252
253 if (minor > tp_count - 1) 253 if (tp_count == 0 || minor > tp_count - 1)
254 return -ENXIO; 254 return -ENXIO;
255 255
256 if (test_and_set_bit(minor, &opened)) 256 if (test_and_set_bit(minor, &opened))
257 return -EBUSY; 257 return -EBUSY;
258 258
259 if (!table[minor].dev) {
260 printk(KERN_ERR "%s: NULL device for minor %u\n",
261 __FUNCTION__, minor);
262 return -ENXIO;
263 }
259 parport_claim_or_block(table[minor].dev); 264 parport_claim_or_block(table[minor].dev);
260 init_ti_parallel(minor); 265 init_ti_parallel(minor);
261 parport_release(table[minor].dev); 266 parport_release(table[minor].dev);
@@ -510,16 +515,20 @@ tipar_init_module(void)
510 err = PTR_ERR(tipar_class); 515 err = PTR_ERR(tipar_class);
511 goto out_chrdev; 516 goto out_chrdev;
512 } 517 }
513 if (parport_register_driver(&tipar_driver)) { 518 if (parport_register_driver(&tipar_driver) || tp_count == 0) {
514 printk(KERN_ERR "tipar: unable to register with parport\n"); 519 printk(KERN_ERR "tipar: unable to register with parport\n");
515 err = -EIO; 520 err = -EIO;
516 goto out; 521 goto out_class;
517 } 522 }
518 523
519 err = 0; 524 err = 0;
520 goto out; 525 goto out;
521 526
527out_class:
528 class_destroy(tipar_class);
529
522out_chrdev: 530out_chrdev:
531 devfs_remove("ticables/par");
523 unregister_chrdev(TIPAR_MAJOR, "tipar"); 532 unregister_chrdev(TIPAR_MAJOR, "tipar");
524out: 533out:
525 return err; 534 return err;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index a23816d3e9a1..e9bba94fc898 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1841,7 +1841,6 @@ static void release_dev(struct file * filp)
1841 tty_closing = tty->count <= 1; 1841 tty_closing = tty->count <= 1;
1842 o_tty_closing = o_tty && 1842 o_tty_closing = o_tty &&
1843 (o_tty->count <= (pty_master ? 1 : 0)); 1843 (o_tty->count <= (pty_master ? 1 : 0));
1844 up(&tty_sem);
1845 do_sleep = 0; 1844 do_sleep = 0;
1846 1845
1847 if (tty_closing) { 1846 if (tty_closing) {
@@ -1869,6 +1868,7 @@ static void release_dev(struct file * filp)
1869 1868
1870 printk(KERN_WARNING "release_dev: %s: read/write wait queue " 1869 printk(KERN_WARNING "release_dev: %s: read/write wait queue "
1871 "active!\n", tty_name(tty, buf)); 1870 "active!\n", tty_name(tty, buf));
1871 up(&tty_sem);
1872 schedule(); 1872 schedule();
1873 } 1873 }
1874 1874
@@ -1877,8 +1877,6 @@ static void release_dev(struct file * filp)
1877 * both sides, and we've completed the last operation that could 1877 * both sides, and we've completed the last operation that could
1878 * block, so it's safe to proceed with closing. 1878 * block, so it's safe to proceed with closing.
1879 */ 1879 */
1880
1881 down(&tty_sem);
1882 if (pty_master) { 1880 if (pty_master) {
1883 if (--o_tty->count < 0) { 1881 if (--o_tty->count < 0) {
1884 printk(KERN_WARNING "release_dev: bad pty slave count " 1882 printk(KERN_WARNING "release_dev: bad pty slave count "
@@ -1892,7 +1890,6 @@ static void release_dev(struct file * filp)
1892 tty->count, tty_name(tty, buf)); 1890 tty->count, tty_name(tty, buf));
1893 tty->count = 0; 1891 tty->count = 0;
1894 } 1892 }
1895 up(&tty_sem);
1896 1893
1897 /* 1894 /*
1898 * We've decremented tty->count, so we need to remove this file 1895 * We've decremented tty->count, so we need to remove this file
@@ -1937,6 +1934,8 @@ static void release_dev(struct file * filp)
1937 read_unlock(&tasklist_lock); 1934 read_unlock(&tasklist_lock);
1938 } 1935 }
1939 1936
1937 up(&tty_sem);
1938
1940 /* check whether both sides are closing ... */ 1939 /* check whether both sides are closing ... */
1941 if (!tty_closing || (o_tty && !o_tty_closing)) 1940 if (!tty_closing || (o_tty && !o_tty_closing))
1942 return; 1941 return;
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
index 37c9e13ad3ac..8d6b249ad66b 100644
--- a/drivers/char/watchdog/pcwd.c
+++ b/drivers/char/watchdog/pcwd.c
@@ -49,29 +49,37 @@
49 * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/ 49 * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
50 */ 50 */
51 51
52#include <linux/module.h> 52#include <linux/config.h> /* For CONFIG_WATCHDOG_NOWAYOUT/... */
53#include <linux/moduleparam.h> 53#include <linux/module.h> /* For module specific items */
54#include <linux/types.h> 54#include <linux/moduleparam.h> /* For new moduleparam's */
55#include <linux/timer.h> 55#include <linux/types.h> /* For standard types (like size_t) */
56#include <linux/jiffies.h> 56#include <linux/errno.h> /* For the -ENODEV/... values */
57#include <linux/config.h> 57#include <linux/kernel.h> /* For printk/panic/... */
58#include <linux/wait.h> 58#include <linux/delay.h> /* For mdelay function */
59#include <linux/slab.h> 59#include <linux/timer.h> /* For timer related operations */
60#include <linux/ioport.h> 60#include <linux/jiffies.h> /* For jiffies stuff */
61#include <linux/delay.h> 61#include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
62#include <linux/fs.h> 62#include <linux/watchdog.h> /* For the watchdog specific items */
63#include <linux/miscdevice.h> 63#include <linux/notifier.h> /* For notifier support */
64#include <linux/watchdog.h> 64#include <linux/reboot.h> /* For reboot_notifier stuff */
65#include <linux/notifier.h> 65#include <linux/init.h> /* For __init/__exit/... */
66#include <linux/init.h> 66#include <linux/fs.h> /* For file operations */
67#include <linux/spinlock.h> 67#include <linux/ioport.h> /* For io-port access */
68#include <linux/reboot.h> 68#include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */
69#include <linux/sched.h> /* TASK_INTERRUPTIBLE, set_current_state() and friends */ 69#include <linux/sched.h> /* TASK_INTERRUPTIBLE, set_current_state() and friends */
70#include <asm/uaccess.h> 70#include <linux/slab.h> /* For kmalloc */
71#include <asm/io.h>
72 71
73#define WD_VER "1.16 (06/12/2004)" 72#include <asm/uaccess.h> /* For copy_to_user/put_user/... */
74#define PFX "pcwd: " 73#include <asm/io.h> /* For inb/outb/... */
74
75/* Module and version information */
76#define WATCHDOG_VERSION "1.16"
77#define WATCHDOG_DATE "03 Jan 2006"
78#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
79#define WATCHDOG_NAME "pcwd"
80#define PFX WATCHDOG_NAME ": "
81#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
82#define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")"
75 83
76/* 84/*
77 * It should be noted that PCWD_REVISION_B was removed because A and B 85 * It should be noted that PCWD_REVISION_B was removed because A and B
@@ -85,36 +93,38 @@
85 93
86/* 94/*
87 * These are the defines that describe the control status bits for the 95 * These are the defines that describe the control status bits for the
88 * PC Watchdog card, revision A. 96 * PCI-PC Watchdog card.
89 */ 97*/
98/* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */
90#define WD_WDRST 0x01 /* Previously reset state */ 99#define WD_WDRST 0x01 /* Previously reset state */
91#define WD_T110 0x02 /* Temperature overheat sense */ 100#define WD_T110 0x02 /* Temperature overheat sense */
92#define WD_HRTBT 0x04 /* Heartbeat sense */ 101#define WD_HRTBT 0x04 /* Heartbeat sense */
93#define WD_RLY2 0x08 /* External relay triggered */ 102#define WD_RLY2 0x08 /* External relay triggered */
94#define WD_SRLY2 0x80 /* Software external relay triggered */ 103#define WD_SRLY2 0x80 /* Software external relay triggered */
95 104/* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */
96/*
97 * These are the defines that describe the control status bits for the
98 * PC Watchdog card, revision C.
99 */
100#define WD_REVC_WTRP 0x01 /* Watchdog Trip status */ 105#define WD_REVC_WTRP 0x01 /* Watchdog Trip status */
101#define WD_REVC_HRBT 0x02 /* Watchdog Heartbeat */ 106#define WD_REVC_HRBT 0x02 /* Watchdog Heartbeat */
102#define WD_REVC_TTRP 0x04 /* Temperature Trip status */ 107#define WD_REVC_TTRP 0x04 /* Temperature Trip status */
108/* Port 2 : Control Status #2 */
109#define WD_WDIS 0x10 /* Watchdog Disabled */
110#define WD_ENTP 0x20 /* Watchdog Enable Temperature Trip */
111#define WD_SSEL 0x40 /* Watchdog Switch Select (1:SW1 <-> 0:SW2) */
112#define WD_WCMD 0x80 /* Watchdog Command Mode */
103 113
104/* max. time we give an ISA watchdog card to process a command */ 114/* max. time we give an ISA watchdog card to process a command */
105/* 500ms for each 4 bit response (according to spec.) */ 115/* 500ms for each 4 bit response (according to spec.) */
106#define ISA_COMMAND_TIMEOUT 1000 116#define ISA_COMMAND_TIMEOUT 1000
107 117
108/* Watchdog's internal commands */ 118/* Watchdog's internal commands */
109#define CMD_ISA_IDLE 0x00 119#define CMD_ISA_IDLE 0x00
110#define CMD_ISA_VERSION_INTEGER 0x01 120#define CMD_ISA_VERSION_INTEGER 0x01
111#define CMD_ISA_VERSION_TENTH 0x02 121#define CMD_ISA_VERSION_TENTH 0x02
112#define CMD_ISA_VERSION_HUNDRETH 0x03 122#define CMD_ISA_VERSION_HUNDRETH 0x03
113#define CMD_ISA_VERSION_MINOR 0x04 123#define CMD_ISA_VERSION_MINOR 0x04
114#define CMD_ISA_SWITCH_SETTINGS 0x05 124#define CMD_ISA_SWITCH_SETTINGS 0x05
115#define CMD_ISA_DELAY_TIME_2SECS 0x0A 125#define CMD_ISA_DELAY_TIME_2SECS 0x0A
116#define CMD_ISA_DELAY_TIME_4SECS 0x0B 126#define CMD_ISA_DELAY_TIME_4SECS 0x0B
117#define CMD_ISA_DELAY_TIME_8SECS 0x0C 127#define CMD_ISA_DELAY_TIME_8SECS 0x0C
118 128
119/* 129/*
120 * We are using an kernel timer to do the pinging of the watchdog 130 * We are using an kernel timer to do the pinging of the watchdog
@@ -130,15 +140,17 @@ static int cards_found;
130/* internal variables */ 140/* internal variables */
131static atomic_t open_allowed = ATOMIC_INIT(1); 141static atomic_t open_allowed = ATOMIC_INIT(1);
132static char expect_close; 142static char expect_close;
133static struct timer_list timer;
134static unsigned long next_heartbeat;
135static int temp_panic; 143static int temp_panic;
136static int revision; /* The card's revision */ 144static struct { /* this is private data for each ISA-PC watchdog card */
137static int supports_temp; /* Wether or not the card has a temperature device */ 145 int revision; /* The card's revision */
138static int command_mode; /* Wether or not the card is in command mode */ 146 int supports_temp; /* Wether or not the card has a temperature device */
139static int initial_status; /* The card's boot status */ 147 int command_mode; /* Wether or not the card is in command mode */
140static int current_readport; /* The cards I/O address */ 148 int boot_status; /* The card's boot status */
141static spinlock_t io_lock; 149 int io_addr; /* The cards I/O address */
150 spinlock_t io_lock; /* the lock for io operations */
151 struct timer_list timer; /* The timer that pings the watchdog */
152 unsigned long next_heartbeat; /* the next_heartbeat for the timer */
153} pcwd_private;
142 154
143/* module parameters */ 155/* module parameters */
144#define WATCHDOG_HEARTBEAT 60 /* 60 sec default heartbeat */ 156#define WATCHDOG_HEARTBEAT 60 /* 60 sec default heartbeat */
@@ -161,14 +173,14 @@ static int send_isa_command(int cmd)
161 int port0, last_port0; /* Double read for stabilising */ 173 int port0, last_port0; /* Double read for stabilising */
162 174
163 /* The WCMD bit must be 1 and the command is only 4 bits in size */ 175 /* The WCMD bit must be 1 and the command is only 4 bits in size */
164 control_status = (cmd & 0x0F) | 0x80; 176 control_status = (cmd & 0x0F) | WD_WCMD;
165 outb_p(control_status, current_readport + 2); 177 outb_p(control_status, pcwd_private.io_addr + 2);
166 udelay(ISA_COMMAND_TIMEOUT); 178 udelay(ISA_COMMAND_TIMEOUT);
167 179
168 port0 = inb_p(current_readport); 180 port0 = inb_p(pcwd_private.io_addr);
169 for (i = 0; i < 25; ++i) { 181 for (i = 0; i < 25; ++i) {
170 last_port0 = port0; 182 last_port0 = port0;
171 port0 = inb_p(current_readport); 183 port0 = inb_p(pcwd_private.io_addr);
172 184
173 if (port0 == last_port0) 185 if (port0 == last_port0)
174 break; /* Data is stable */ 186 break; /* Data is stable */
@@ -184,7 +196,7 @@ static int set_command_mode(void)
184 int i, found=0, count=0; 196 int i, found=0, count=0;
185 197
186 /* Set the card into command mode */ 198 /* Set the card into command mode */
187 spin_lock(&io_lock); 199 spin_lock(&pcwd_private.io_lock);
188 while ((!found) && (count < 3)) { 200 while ((!found) && (count < 3)) {
189 i = send_isa_command(CMD_ISA_IDLE); 201 i = send_isa_command(CMD_ISA_IDLE);
190 202
@@ -192,15 +204,15 @@ static int set_command_mode(void)
192 found = 1; 204 found = 1;
193 else if (i == 0xF3) { 205 else if (i == 0xF3) {
194 /* Card does not like what we've done to it */ 206 /* Card does not like what we've done to it */
195 outb_p(0x00, current_readport + 2); 207 outb_p(0x00, pcwd_private.io_addr + 2);
196 udelay(1200); /* Spec says wait 1ms */ 208 udelay(1200); /* Spec says wait 1ms */
197 outb_p(0x00, current_readport + 2); 209 outb_p(0x00, pcwd_private.io_addr + 2);
198 udelay(ISA_COMMAND_TIMEOUT); 210 udelay(ISA_COMMAND_TIMEOUT);
199 } 211 }
200 count++; 212 count++;
201 } 213 }
202 spin_unlock(&io_lock); 214 spin_unlock(&pcwd_private.io_lock);
203 command_mode = found; 215 pcwd_private.command_mode = found;
204 216
205 return(found); 217 return(found);
206} 218}
@@ -208,12 +220,95 @@ static int set_command_mode(void)
208static void unset_command_mode(void) 220static void unset_command_mode(void)
209{ 221{
210 /* Set the card into normal mode */ 222 /* Set the card into normal mode */
211 spin_lock(&io_lock); 223 spin_lock(&pcwd_private.io_lock);
212 outb_p(0x00, current_readport + 2); 224 outb_p(0x00, pcwd_private.io_addr + 2);
213 udelay(ISA_COMMAND_TIMEOUT); 225 udelay(ISA_COMMAND_TIMEOUT);
214 spin_unlock(&io_lock); 226 spin_unlock(&pcwd_private.io_lock);
227
228 pcwd_private.command_mode = 0;
229}
230
231static inline void pcwd_check_temperature_support(void)
232{
233 if (inb(pcwd_private.io_addr) != 0xF0)
234 pcwd_private.supports_temp = 1;
235}
236
237static inline char *get_firmware(void)
238{
239 int one, ten, hund, minor;
240 char *ret;
241
242 ret = kmalloc(6, GFP_KERNEL);
243 if(ret == NULL)
244 return NULL;
245
246 if (set_command_mode()) {
247 one = send_isa_command(CMD_ISA_VERSION_INTEGER);
248 ten = send_isa_command(CMD_ISA_VERSION_TENTH);
249 hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
250 minor = send_isa_command(CMD_ISA_VERSION_MINOR);
251 sprintf(ret, "%c.%c%c%c", one, ten, hund, minor);
252 }
253 else
254 sprintf(ret, "ERROR");
255
256 unset_command_mode();
257 return(ret);
258}
259
260static inline int pcwd_get_option_switches(void)
261{
262 int option_switches=0;
263
264 if (set_command_mode()) {
265 /* Get switch settings */
266 option_switches = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
267 }
268
269 unset_command_mode();
270 return(option_switches);
271}
272
273static void pcwd_show_card_info(void)
274{
275 char *firmware;
276 int option_switches;
277
278 /* Get some extra info from the hardware (in command/debug/diag mode) */
279 if (pcwd_private.revision == PCWD_REVISION_A)
280 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", pcwd_private.io_addr);
281 else if (pcwd_private.revision == PCWD_REVISION_C) {
282 firmware = get_firmware();
283 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
284 pcwd_private.io_addr, firmware);
285 kfree(firmware);
286 option_switches = pcwd_get_option_switches();
287 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
288 option_switches,
289 ((option_switches & 0x10) ? "ON" : "OFF"),
290 ((option_switches & 0x08) ? "ON" : "OFF"));
291
292 /* Reprogram internal heartbeat to 2 seconds */
293 if (set_command_mode()) {
294 send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
295 unset_command_mode();
296 }
297 }
298
299 if (pcwd_private.supports_temp)
300 printk(KERN_INFO PFX "Temperature Option Detected\n");
301
302 if (pcwd_private.boot_status & WDIOF_CARDRESET)
303 printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
304
305 if (pcwd_private.boot_status & WDIOF_OVERHEAT) {
306 printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
307 printk(KERN_EMERG PFX "CPU Overheat\n");
308 }
215 309
216 command_mode = 0; 310 if (pcwd_private.boot_status == 0)
311 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
217} 312}
218 313
219static void pcwd_timer_ping(unsigned long data) 314static void pcwd_timer_ping(unsigned long data)
@@ -222,25 +317,25 @@ static void pcwd_timer_ping(unsigned long data)
222 317
223 /* If we got a heartbeat pulse within the WDT_INTERVAL 318 /* If we got a heartbeat pulse within the WDT_INTERVAL
224 * we agree to ping the WDT */ 319 * we agree to ping the WDT */
225 if(time_before(jiffies, next_heartbeat)) { 320 if(time_before(jiffies, pcwd_private.next_heartbeat)) {
226 /* Ping the watchdog */ 321 /* Ping the watchdog */
227 spin_lock(&io_lock); 322 spin_lock(&pcwd_private.io_lock);
228 if (revision == PCWD_REVISION_A) { 323 if (pcwd_private.revision == PCWD_REVISION_A) {
229 /* Rev A cards are reset by setting the WD_WDRST bit in register 1 */ 324 /* Rev A cards are reset by setting the WD_WDRST bit in register 1 */
230 wdrst_stat = inb_p(current_readport); 325 wdrst_stat = inb_p(pcwd_private.io_addr);
231 wdrst_stat &= 0x0F; 326 wdrst_stat &= 0x0F;
232 wdrst_stat |= WD_WDRST; 327 wdrst_stat |= WD_WDRST;
233 328
234 outb_p(wdrst_stat, current_readport + 1); 329 outb_p(wdrst_stat, pcwd_private.io_addr + 1);
235 } else { 330 } else {
236 /* Re-trigger watchdog by writing to port 0 */ 331 /* Re-trigger watchdog by writing to port 0 */
237 outb_p(0x00, current_readport); 332 outb_p(0x00, pcwd_private.io_addr);
238 } 333 }
239 334
240 /* Re-set the timer interval */ 335 /* Re-set the timer interval */
241 mod_timer(&timer, jiffies + WDT_INTERVAL); 336 mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
242 337
243 spin_unlock(&io_lock); 338 spin_unlock(&pcwd_private.io_lock);
244 } else { 339 } else {
245 printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); 340 printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
246 } 341 }
@@ -250,19 +345,19 @@ static int pcwd_start(void)
250{ 345{
251 int stat_reg; 346 int stat_reg;
252 347
253 next_heartbeat = jiffies + (heartbeat * HZ); 348 pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
254 349
255 /* Start the timer */ 350 /* Start the timer */
256 mod_timer(&timer, jiffies + WDT_INTERVAL); 351 mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
257 352
258 /* Enable the port */ 353 /* Enable the port */
259 if (revision == PCWD_REVISION_C) { 354 if (pcwd_private.revision == PCWD_REVISION_C) {
260 spin_lock(&io_lock); 355 spin_lock(&pcwd_private.io_lock);
261 outb_p(0x00, current_readport + 3); 356 outb_p(0x00, pcwd_private.io_addr + 3);
262 udelay(ISA_COMMAND_TIMEOUT); 357 udelay(ISA_COMMAND_TIMEOUT);
263 stat_reg = inb_p(current_readport + 2); 358 stat_reg = inb_p(pcwd_private.io_addr + 2);
264 spin_unlock(&io_lock); 359 spin_unlock(&pcwd_private.io_lock);
265 if (stat_reg & 0x10) { 360 if (stat_reg & WD_WDIS) {
266 printk(KERN_INFO PFX "Could not start watchdog\n"); 361 printk(KERN_INFO PFX "Could not start watchdog\n");
267 return -EIO; 362 return -EIO;
268 } 363 }
@@ -275,18 +370,18 @@ static int pcwd_stop(void)
275 int stat_reg; 370 int stat_reg;
276 371
277 /* Stop the timer */ 372 /* Stop the timer */
278 del_timer(&timer); 373 del_timer(&pcwd_private.timer);
279 374
280 /* Disable the board */ 375 /* Disable the board */
281 if (revision == PCWD_REVISION_C) { 376 if (pcwd_private.revision == PCWD_REVISION_C) {
282 spin_lock(&io_lock); 377 spin_lock(&pcwd_private.io_lock);
283 outb_p(0xA5, current_readport + 3); 378 outb_p(0xA5, pcwd_private.io_addr + 3);
284 udelay(ISA_COMMAND_TIMEOUT); 379 udelay(ISA_COMMAND_TIMEOUT);
285 outb_p(0xA5, current_readport + 3); 380 outb_p(0xA5, pcwd_private.io_addr + 3);
286 udelay(ISA_COMMAND_TIMEOUT); 381 udelay(ISA_COMMAND_TIMEOUT);
287 stat_reg = inb_p(current_readport + 2); 382 stat_reg = inb_p(pcwd_private.io_addr + 2);
288 spin_unlock(&io_lock); 383 spin_unlock(&pcwd_private.io_lock);
289 if ((stat_reg & 0x10) == 0) { 384 if ((stat_reg & WD_WDIS) == 0) {
290 printk(KERN_INFO PFX "Could not stop watchdog\n"); 385 printk(KERN_INFO PFX "Could not stop watchdog\n");
291 return -EIO; 386 return -EIO;
292 } 387 }
@@ -297,7 +392,7 @@ static int pcwd_stop(void)
297static int pcwd_keepalive(void) 392static int pcwd_keepalive(void)
298{ 393{
299 /* user land ping */ 394 /* user land ping */
300 next_heartbeat = jiffies + (heartbeat * HZ); 395 pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
301 return 0; 396 return 0;
302} 397}
303 398
@@ -315,23 +410,23 @@ static int pcwd_get_status(int *status)
315 int card_status; 410 int card_status;
316 411
317 *status=0; 412 *status=0;
318 spin_lock(&io_lock); 413 spin_lock(&pcwd_private.io_lock);
319 if (revision == PCWD_REVISION_A) 414 if (pcwd_private.revision == PCWD_REVISION_A)
320 /* Rev A cards return status information from 415 /* Rev A cards return status information from
321 * the base register, which is used for the 416 * the base register, which is used for the
322 * temperature in other cards. */ 417 * temperature in other cards. */
323 card_status = inb(current_readport); 418 card_status = inb(pcwd_private.io_addr);
324 else { 419 else {
325 /* Rev C cards return card status in the base 420 /* Rev C cards return card status in the base
326 * address + 1 register. And use different bits 421 * address + 1 register. And use different bits
327 * to indicate a card initiated reset, and an 422 * to indicate a card initiated reset, and an
328 * over-temperature condition. And the reboot 423 * over-temperature condition. And the reboot
329 * status can be reset. */ 424 * status can be reset. */
330 card_status = inb(current_readport + 1); 425 card_status = inb(pcwd_private.io_addr + 1);
331 } 426 }
332 spin_unlock(&io_lock); 427 spin_unlock(&pcwd_private.io_lock);
333 428
334 if (revision == PCWD_REVISION_A) { 429 if (pcwd_private.revision == PCWD_REVISION_A) {
335 if (card_status & WD_WDRST) 430 if (card_status & WD_WDRST)
336 *status |= WDIOF_CARDRESET; 431 *status |= WDIOF_CARDRESET;
337 432
@@ -360,10 +455,10 @@ static int pcwd_get_status(int *status)
360 455
361static int pcwd_clear_status(void) 456static int pcwd_clear_status(void)
362{ 457{
363 if (revision == PCWD_REVISION_C) { 458 if (pcwd_private.revision == PCWD_REVISION_C) {
364 spin_lock(&io_lock); 459 spin_lock(&pcwd_private.io_lock);
365 outb_p(0x00, current_readport + 1); /* clear reset status */ 460 outb_p(0x00, pcwd_private.io_addr + 1); /* clear reset status */
366 spin_unlock(&io_lock); 461 spin_unlock(&pcwd_private.io_lock);
367 } 462 }
368 return 0; 463 return 0;
369} 464}
@@ -371,20 +466,20 @@ static int pcwd_clear_status(void)
371static int pcwd_get_temperature(int *temperature) 466static int pcwd_get_temperature(int *temperature)
372{ 467{
373 /* check that port 0 gives temperature info and no command results */ 468 /* check that port 0 gives temperature info and no command results */
374 if (command_mode) 469 if (pcwd_private.command_mode)
375 return -1; 470 return -1;
376 471
377 *temperature = 0; 472 *temperature = 0;
378 if (!supports_temp) 473 if (!pcwd_private.supports_temp)
379 return -ENODEV; 474 return -ENODEV;
380 475
381 /* 476 /*
382 * Convert celsius to fahrenheit, since this was 477 * Convert celsius to fahrenheit, since this was
383 * the decided 'standard' for this return value. 478 * the decided 'standard' for this return value.
384 */ 479 */
385 spin_lock(&io_lock); 480 spin_lock(&pcwd_private.io_lock);
386 *temperature = ((inb(current_readport)) * 9 / 5) + 32; 481 *temperature = ((inb(pcwd_private.io_addr)) * 9 / 5) + 32;
387 spin_unlock(&io_lock); 482 spin_unlock(&pcwd_private.io_lock);
388 483
389 return 0; 484 return 0;
390} 485}
@@ -425,7 +520,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
425 return put_user(status, argp); 520 return put_user(status, argp);
426 521
427 case WDIOC_GETBOOTSTATUS: 522 case WDIOC_GETBOOTSTATUS:
428 return put_user(initial_status, argp); 523 return put_user(pcwd_private.boot_status, argp);
429 524
430 case WDIOC_GETTEMP: 525 case WDIOC_GETTEMP:
431 if (pcwd_get_temperature(&temperature)) 526 if (pcwd_get_temperature(&temperature))
@@ -434,7 +529,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
434 return put_user(temperature, argp); 529 return put_user(temperature, argp);
435 530
436 case WDIOC_SETOPTIONS: 531 case WDIOC_SETOPTIONS:
437 if (revision == PCWD_REVISION_C) 532 if (pcwd_private.revision == PCWD_REVISION_C)
438 { 533 {
439 if(copy_from_user(&rv, argp, sizeof(int))) 534 if(copy_from_user(&rv, argp, sizeof(int)))
440 return -EFAULT; 535 return -EFAULT;
@@ -550,7 +645,7 @@ static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
550 645
551static int pcwd_temp_open(struct inode *inode, struct file *file) 646static int pcwd_temp_open(struct inode *inode, struct file *file)
552{ 647{
553 if (!supports_temp) 648 if (!pcwd_private.supports_temp)
554 return -ENODEV; 649 return -ENODEV;
555 650
556 return nonseekable_open(inode, file); 651 return nonseekable_open(inode, file);
@@ -616,68 +711,24 @@ static struct notifier_block pcwd_notifier = {
616 * Init & exit routines 711 * Init & exit routines
617 */ 712 */
618 713
619static inline void get_support(void)
620{
621 if (inb(current_readport) != 0xF0)
622 supports_temp = 1;
623}
624
625static inline int get_revision(void) 714static inline int get_revision(void)
626{ 715{
627 int r = PCWD_REVISION_C; 716 int r = PCWD_REVISION_C;
628 717
629 spin_lock(&io_lock); 718 spin_lock(&pcwd_private.io_lock);
630 /* REV A cards use only 2 io ports; test 719 /* REV A cards use only 2 io ports; test
631 * presumes a floating bus reads as 0xff. */ 720 * presumes a floating bus reads as 0xff. */
632 if ((inb(current_readport + 2) == 0xFF) || 721 if ((inb(pcwd_private.io_addr + 2) == 0xFF) ||
633 (inb(current_readport + 3) == 0xFF)) 722 (inb(pcwd_private.io_addr + 3) == 0xFF))
634 r=PCWD_REVISION_A; 723 r=PCWD_REVISION_A;
635 spin_unlock(&io_lock); 724 spin_unlock(&pcwd_private.io_lock);
636 725
637 return r; 726 return r;
638} 727}
639 728
640static inline char *get_firmware(void)
641{
642 int one, ten, hund, minor;
643 char *ret;
644
645 ret = kmalloc(6, GFP_KERNEL);
646 if(ret == NULL)
647 return NULL;
648
649 if (set_command_mode()) {
650 one = send_isa_command(CMD_ISA_VERSION_INTEGER);
651 ten = send_isa_command(CMD_ISA_VERSION_TENTH);
652 hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
653 minor = send_isa_command(CMD_ISA_VERSION_MINOR);
654 sprintf(ret, "%c.%c%c%c", one, ten, hund, minor);
655 }
656 else
657 sprintf(ret, "ERROR");
658
659 unset_command_mode();
660 return(ret);
661}
662
663static inline int get_option_switches(void)
664{
665 int rv=0;
666
667 if (set_command_mode()) {
668 /* Get switch settings */
669 rv = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
670 }
671
672 unset_command_mode();
673 return(rv);
674}
675
676static int __devinit pcwatchdog_init(int base_addr) 729static int __devinit pcwatchdog_init(int base_addr)
677{ 730{
678 int ret; 731 int ret;
679 char *firmware;
680 int option_switches;
681 732
682 cards_found++; 733 cards_found++;
683 if (cards_found == 1) 734 if (cards_found == 1)
@@ -692,104 +743,66 @@ static int __devinit pcwatchdog_init(int base_addr)
692 printk(KERN_ERR PFX "No I/O-Address for card detected\n"); 743 printk(KERN_ERR PFX "No I/O-Address for card detected\n");
693 return -ENODEV; 744 return -ENODEV;
694 } 745 }
695 current_readport = base_addr; 746 pcwd_private.io_addr = base_addr;
696 747
697 /* Check card's revision */ 748 /* Check card's revision */
698 revision = get_revision(); 749 pcwd_private.revision = get_revision();
699 750
700 if (!request_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { 751 if (!request_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) {
701 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 752 printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
702 current_readport); 753 pcwd_private.io_addr);
703 current_readport = 0x0000; 754 pcwd_private.io_addr = 0x0000;
704 return -EIO; 755 return -EIO;
705 } 756 }
706 757
707 /* Initial variables */ 758 /* Initial variables */
708 supports_temp = 0; 759 pcwd_private.supports_temp = 0;
709 temp_panic = 0; 760 temp_panic = 0;
710 initial_status = 0x0000; 761 pcwd_private.boot_status = 0x0000;
711 762
712 /* get the boot_status */ 763 /* get the boot_status */
713 pcwd_get_status(&initial_status); 764 pcwd_get_status(&pcwd_private.boot_status);
714 765
715 /* clear the "card caused reboot" flag */ 766 /* clear the "card caused reboot" flag */
716 pcwd_clear_status(); 767 pcwd_clear_status();
717 768
718 init_timer(&timer); 769 init_timer(&pcwd_private.timer);
719 timer.function = pcwd_timer_ping; 770 pcwd_private.timer.function = pcwd_timer_ping;
720 timer.data = 0; 771 pcwd_private.timer.data = 0;
721 772
722 /* Disable the board */ 773 /* Disable the board */
723 pcwd_stop(); 774 pcwd_stop();
724 775
725 /* Check whether or not the card supports the temperature device */ 776 /* Check whether or not the card supports the temperature device */
726 get_support(); 777 pcwd_check_temperature_support();
727
728 /* Get some extra info from the hardware (in command/debug/diag mode) */
729 if (revision == PCWD_REVISION_A)
730 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", current_readport);
731 else if (revision == PCWD_REVISION_C) {
732 firmware = get_firmware();
733 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
734 current_readport, firmware);
735 kfree(firmware);
736 option_switches = get_option_switches();
737 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
738 option_switches,
739 ((option_switches & 0x10) ? "ON" : "OFF"),
740 ((option_switches & 0x08) ? "ON" : "OFF"));
741
742 /* Reprogram internal heartbeat to 2 seconds */
743 if (set_command_mode()) {
744 send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
745 unset_command_mode();
746 }
747 } else {
748 /* Should NEVER happen, unless get_revision() fails. */
749 printk(KERN_INFO PFX "Unable to get revision\n");
750 release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
751 current_readport = 0x0000;
752 return -1;
753 }
754 778
755 if (supports_temp) 779 /* Show info about the card itself */
756 printk(KERN_INFO PFX "Temperature Option Detected\n"); 780 pcwd_show_card_info();
757
758 if (initial_status & WDIOF_CARDRESET)
759 printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
760
761 if (initial_status & WDIOF_OVERHEAT) {
762 printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
763 printk(KERN_EMERG PFX "CPU Overheat\n");
764 }
765
766 if (initial_status == 0)
767 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
768 781
769 /* Check that the heartbeat value is within it's range ; if not reset to the default */ 782 /* Check that the heartbeat value is within it's range ; if not reset to the default */
770 if (pcwd_set_heartbeat(heartbeat)) { 783 if (pcwd_set_heartbeat(heartbeat)) {
771 pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); 784 pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
772 printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n", 785 printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",
773 WATCHDOG_HEARTBEAT); 786 WATCHDOG_HEARTBEAT);
774 } 787 }
775 788
776 ret = register_reboot_notifier(&pcwd_notifier); 789 ret = register_reboot_notifier(&pcwd_notifier);
777 if (ret) { 790 if (ret) {
778 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", 791 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
779 ret); 792 ret);
780 release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); 793 release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
781 current_readport = 0x0000; 794 pcwd_private.io_addr = 0x0000;
782 return ret; 795 return ret;
783 } 796 }
784 797
785 if (supports_temp) { 798 if (pcwd_private.supports_temp) {
786 ret = misc_register(&temp_miscdev); 799 ret = misc_register(&temp_miscdev);
787 if (ret) { 800 if (ret) {
788 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 801 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
789 TEMP_MINOR, ret); 802 TEMP_MINOR, ret);
790 unregister_reboot_notifier(&pcwd_notifier); 803 unregister_reboot_notifier(&pcwd_notifier);
791 release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); 804 release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
792 current_readport = 0x0000; 805 pcwd_private.io_addr = 0x0000;
793 return ret; 806 return ret;
794 } 807 }
795 } 808 }
@@ -798,11 +811,11 @@ static int __devinit pcwatchdog_init(int base_addr)
798 if (ret) { 811 if (ret) {
799 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 812 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
800 WATCHDOG_MINOR, ret); 813 WATCHDOG_MINOR, ret);
801 if (supports_temp) 814 if (pcwd_private.supports_temp)
802 misc_deregister(&temp_miscdev); 815 misc_deregister(&temp_miscdev);
803 unregister_reboot_notifier(&pcwd_notifier); 816 unregister_reboot_notifier(&pcwd_notifier);
804 release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); 817 release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
805 current_readport = 0x0000; 818 pcwd_private.io_addr = 0x0000;
806 return ret; 819 return ret;
807 } 820 }
808 821
@@ -820,11 +833,12 @@ static void __devexit pcwatchdog_exit(void)
820 833
821 /* Deregister */ 834 /* Deregister */
822 misc_deregister(&pcwd_miscdev); 835 misc_deregister(&pcwd_miscdev);
823 if (supports_temp) 836 if (pcwd_private.supports_temp)
824 misc_deregister(&temp_miscdev); 837 misc_deregister(&temp_miscdev);
825 unregister_reboot_notifier(&pcwd_notifier); 838 unregister_reboot_notifier(&pcwd_notifier);
826 release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4); 839 release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
827 current_readport = 0x0000; 840 pcwd_private.io_addr = 0x0000;
841 cards_found--;
828} 842}
829 843
830/* 844/*
@@ -887,7 +901,7 @@ static int __init pcwd_init_module(void)
887{ 901{
888 int i, found = 0; 902 int i, found = 0;
889 903
890 spin_lock_init(&io_lock); 904 spin_lock_init(&pcwd_private.io_lock);
891 905
892 for (i = 0; pcwd_ioports[i] != 0; i++) { 906 for (i = 0; pcwd_ioports[i] != 0; i++) {
893 if (pcwd_checkcard(pcwd_ioports[i])) { 907 if (pcwd_checkcard(pcwd_ioports[i])) {
@@ -906,7 +920,7 @@ static int __init pcwd_init_module(void)
906 920
907static void __exit pcwd_cleanup_module(void) 921static void __exit pcwd_cleanup_module(void)
908{ 922{
909 if (current_readport) 923 if (pcwd_private.io_addr)
910 pcwatchdog_exit(); 924 pcwatchdog_exit();
911 return; 925 return;
912} 926}
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
index b474ea52d6e8..522a9370db94 100644
--- a/drivers/char/watchdog/sa1100_wdt.c
+++ b/drivers/char/watchdog/sa1100_wdt.c
@@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
93{ 93{
94 int ret = -ENOIOCTLCMD; 94 int ret = -ENOIOCTLCMD;
95 int time; 95 int time;
96 void __user *argp = (void __user *)arg;
97 int __user *p = argp;
96 98
97 switch (cmd) { 99 switch (cmd) {
98 case WDIOC_GETSUPPORT: 100 case WDIOC_GETSUPPORT:
99 ret = copy_to_user((struct watchdog_info __user *)arg, &ident, 101 ret = copy_to_user(argp, &ident,
100 sizeof(ident)) ? -EFAULT : 0; 102 sizeof(ident)) ? -EFAULT : 0;
101 break; 103 break;
102 104
103 case WDIOC_GETSTATUS: 105 case WDIOC_GETSTATUS:
104 ret = put_user(0, (int __user *)arg); 106 ret = put_user(0, p);
105 break; 107 break;
106 108
107 case WDIOC_GETBOOTSTATUS: 109 case WDIOC_GETBOOTSTATUS:
108 ret = put_user(boot_status, (int __user *)arg); 110 ret = put_user(boot_status, p);
109 break; 111 break;
110 112
111 case WDIOC_SETTIMEOUT: 113 case WDIOC_SETTIMEOUT:
112 ret = get_user(time, (int __user *)arg); 114 ret = get_user(time, p);
113 if (ret) 115 if (ret)
114 break; 116 break;
115 117
@@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
123 /*fall through*/ 125 /*fall through*/
124 126
125 case WDIOC_GETTIMEOUT: 127 case WDIOC_GETTIMEOUT:
126 ret = put_user(pre_margin / OSCR_FREQ, (int __user *)arg); 128 ret = put_user(pre_margin / OSCR_FREQ, p);
127 break; 129 break;
128 130
129 case WDIOC_KEEPALIVE: 131 case WDIOC_KEEPALIVE:
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7a511479ae29..9582de1c9cad 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -35,8 +35,8 @@
35 * level driver of CPUFreq support, and its spinlock. This lock 35 * level driver of CPUFreq support, and its spinlock. This lock
36 * also protects the cpufreq_cpu_data array. 36 * also protects the cpufreq_cpu_data array.
37 */ 37 */
38static struct cpufreq_driver *cpufreq_driver; 38static struct cpufreq_driver *cpufreq_driver;
39static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS]; 39static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
40static DEFINE_SPINLOCK(cpufreq_driver_lock); 40static DEFINE_SPINLOCK(cpufreq_driver_lock);
41 41
42/* internal prototypes */ 42/* internal prototypes */
@@ -50,15 +50,15 @@ static void handle_update(void *data);
50 * changes to devices when the CPU clock speed changes. 50 * changes to devices when the CPU clock speed changes.
51 * The mutex locks both lists. 51 * The mutex locks both lists.
52 */ 52 */
53static struct notifier_block *cpufreq_policy_notifier_list; 53static struct notifier_block *cpufreq_policy_notifier_list;
54static struct notifier_block *cpufreq_transition_notifier_list; 54static struct notifier_block *cpufreq_transition_notifier_list;
55static DECLARE_RWSEM (cpufreq_notifier_rwsem); 55static DECLARE_RWSEM (cpufreq_notifier_rwsem);
56 56
57 57
58static LIST_HEAD(cpufreq_governor_list); 58static LIST_HEAD(cpufreq_governor_list);
59static DEFINE_MUTEX (cpufreq_governor_mutex); 59static DEFINE_MUTEX (cpufreq_governor_mutex);
60 60
61struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu) 61struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
62{ 62{
63 struct cpufreq_policy *data; 63 struct cpufreq_policy *data;
64 unsigned long flags; 64 unsigned long flags;
@@ -85,20 +85,19 @@ struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu)
85 if (!kobject_get(&data->kobj)) 85 if (!kobject_get(&data->kobj))
86 goto err_out_put_module; 86 goto err_out_put_module;
87 87
88
89 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 88 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
90
91 return data; 89 return data;
92 90
93 err_out_put_module: 91err_out_put_module:
94 module_put(cpufreq_driver->owner); 92 module_put(cpufreq_driver->owner);
95 err_out_unlock: 93err_out_unlock:
96 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 94 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
97 err_out: 95err_out:
98 return NULL; 96 return NULL;
99} 97}
100EXPORT_SYMBOL_GPL(cpufreq_cpu_get); 98EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
101 99
100
102void cpufreq_cpu_put(struct cpufreq_policy *data) 101void cpufreq_cpu_put(struct cpufreq_policy *data)
103{ 102{
104 kobject_put(&data->kobj); 103 kobject_put(&data->kobj);
@@ -229,44 +228,53 @@ static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) {
229 228
230 229
231/** 230/**
232 * cpufreq_notify_transition - call notifier chain and adjust_jiffies on frequency transition 231 * cpufreq_notify_transition - call notifier chain and adjust_jiffies
232 * on frequency transition.
233 * 233 *
234 * This function calls the transition notifiers and the "adjust_jiffies" function. It is called 234 * This function calls the transition notifiers and the "adjust_jiffies"
235 * twice on all CPU frequency changes that have external effects. 235 * function. It is called twice on all CPU frequency changes that have
236 * external effects.
236 */ 237 */
237void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) 238void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
238{ 239{
240 struct cpufreq_policy *policy;
241
239 BUG_ON(irqs_disabled()); 242 BUG_ON(irqs_disabled());
240 243
241 freqs->flags = cpufreq_driver->flags; 244 freqs->flags = cpufreq_driver->flags;
242 dprintk("notification %u of frequency transition to %u kHz\n", state, freqs->new); 245 dprintk("notification %u of frequency transition to %u kHz\n",
246 state, freqs->new);
243 247
244 down_read(&cpufreq_notifier_rwsem); 248 down_read(&cpufreq_notifier_rwsem);
249
250 policy = cpufreq_cpu_data[freqs->cpu];
245 switch (state) { 251 switch (state) {
252
246 case CPUFREQ_PRECHANGE: 253 case CPUFREQ_PRECHANGE:
247 /* detect if the driver reported a value as "old frequency" which 254 /* detect if the driver reported a value as "old frequency"
248 * is not equal to what the cpufreq core thinks is "old frequency". 255 * which is not equal to what the cpufreq core thinks is
256 * "old frequency".
249 */ 257 */
250 if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) { 258 if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
251 if ((likely(cpufreq_cpu_data[freqs->cpu])) && 259 if ((policy) && (policy->cpu == freqs->cpu) &&
252 (likely(cpufreq_cpu_data[freqs->cpu]->cpu == freqs->cpu)) && 260 (policy->cur) && (policy->cur != freqs->old)) {
253 (likely(cpufreq_cpu_data[freqs->cpu]->cur)) && 261 dprintk(KERN_WARNING "Warning: CPU frequency is"
254 (unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur))) 262 " %u, cpufreq assumed %u kHz.\n",
255 { 263 freqs->old, policy->cur);
256 dprintk(KERN_WARNING "Warning: CPU frequency is %u, " 264 freqs->old = policy->cur;
257 "cpufreq assumed %u kHz.\n", freqs->old, cpufreq_cpu_data[freqs->cpu]->cur);
258 freqs->old = cpufreq_cpu_data[freqs->cpu]->cur;
259 } 265 }
260 } 266 }
261 notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_PRECHANGE, freqs); 267 notifier_call_chain(&cpufreq_transition_notifier_list,
268 CPUFREQ_PRECHANGE, freqs);
262 adjust_jiffies(CPUFREQ_PRECHANGE, freqs); 269 adjust_jiffies(CPUFREQ_PRECHANGE, freqs);
263 break; 270 break;
271
264 case CPUFREQ_POSTCHANGE: 272 case CPUFREQ_POSTCHANGE:
265 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); 273 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
266 notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs); 274 notifier_call_chain(&cpufreq_transition_notifier_list,
267 if ((likely(cpufreq_cpu_data[freqs->cpu])) && 275 CPUFREQ_POSTCHANGE, freqs);
268 (likely(cpufreq_cpu_data[freqs->cpu]->cpu == freqs->cpu))) 276 if (likely(policy) && likely(policy->cpu == freqs->cpu))
269 cpufreq_cpu_data[freqs->cpu]->cur = freqs->new; 277 policy->cur = freqs->new;
270 break; 278 break;
271 } 279 }
272 up_read(&cpufreq_notifier_rwsem); 280 up_read(&cpufreq_notifier_rwsem);
@@ -308,7 +316,7 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
308 return 0; 316 return 0;
309 } 317 }
310 } 318 }
311 out: 319out:
312 mutex_unlock(&cpufreq_governor_mutex); 320 mutex_unlock(&cpufreq_governor_mutex);
313 } 321 }
314 return -EINVAL; 322 return -EINVAL;
@@ -415,7 +423,6 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
415 return -EINVAL; 423 return -EINVAL;
416 424
417 ret = cpufreq_set_policy(&new_policy); 425 ret = cpufreq_set_policy(&new_policy);
418
419 return ret ? ret : count; 426 return ret ? ret : count;
420} 427}
421 428
@@ -446,7 +453,7 @@ static ssize_t show_scaling_available_governors (struct cpufreq_policy * policy,
446 goto out; 453 goto out;
447 i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name); 454 i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name);
448 } 455 }
449 out: 456out:
450 i += sprintf(&buf[i], "\n"); 457 i += sprintf(&buf[i], "\n");
451 return i; 458 return i;
452} 459}
@@ -789,7 +796,6 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
789 kfree(data); 796 kfree(data);
790 797
791 cpufreq_debug_enable_ratelimit(); 798 cpufreq_debug_enable_ratelimit();
792
793 return 0; 799 return 0;
794} 800}
795 801
@@ -870,8 +876,7 @@ unsigned int cpufreq_get(unsigned int cpu)
870 876
871 ret = cpufreq_driver->get(cpu); 877 ret = cpufreq_driver->get(cpu);
872 878
873 if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) 879 if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
874 {
875 /* verify no discrepancy between actual and saved value exists */ 880 /* verify no discrepancy between actual and saved value exists */
876 if (unlikely(ret != policy->cur)) { 881 if (unlikely(ret != policy->cur)) {
877 cpufreq_out_of_sync(cpu, policy->cur, ret); 882 cpufreq_out_of_sync(cpu, policy->cur, ret);
@@ -881,7 +886,7 @@ unsigned int cpufreq_get(unsigned int cpu)
881 886
882 mutex_unlock(&policy->lock); 887 mutex_unlock(&policy->lock);
883 888
884 out: 889out:
885 cpufreq_cpu_put(policy); 890 cpufreq_cpu_put(policy);
886 891
887 return (ret); 892 return (ret);
@@ -962,7 +967,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
962 cpu_policy->cur = cur_freq; 967 cpu_policy->cur = cur_freq;
963 } 968 }
964 969
965 out: 970out:
966 cpufreq_cpu_put(cpu_policy); 971 cpufreq_cpu_put(cpu_policy);
967 return 0; 972 return 0;
968} 973}
@@ -1169,7 +1174,6 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
1169 mutex_unlock(&policy->lock); 1174 mutex_unlock(&policy->lock);
1170 1175
1171 cpufreq_cpu_put(policy); 1176 cpufreq_cpu_put(policy);
1172
1173 return ret; 1177 return ret;
1174} 1178}
1175EXPORT_SYMBOL_GPL(cpufreq_driver_target); 1179EXPORT_SYMBOL_GPL(cpufreq_driver_target);
@@ -1208,7 +1212,6 @@ int cpufreq_governor(unsigned int cpu, unsigned int event)
1208 mutex_unlock(&policy->lock); 1212 mutex_unlock(&policy->lock);
1209 1213
1210 cpufreq_cpu_put(policy); 1214 cpufreq_cpu_put(policy);
1211
1212 return ret; 1215 return ret;
1213} 1216}
1214EXPORT_SYMBOL_GPL(cpufreq_governor); 1217EXPORT_SYMBOL_GPL(cpufreq_governor);
@@ -1232,7 +1235,6 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
1232 list_add(&governor->governor_list, &cpufreq_governor_list); 1235 list_add(&governor->governor_list, &cpufreq_governor_list);
1233 1236
1234 mutex_unlock(&cpufreq_governor_mutex); 1237 mutex_unlock(&cpufreq_governor_mutex);
1235
1236 return 0; 1238 return 0;
1237} 1239}
1238EXPORT_SYMBOL_GPL(cpufreq_register_governor); 1240EXPORT_SYMBOL_GPL(cpufreq_register_governor);
@@ -1277,7 +1279,6 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
1277 mutex_unlock(&cpu_policy->lock); 1279 mutex_unlock(&cpu_policy->lock);
1278 1280
1279 cpufreq_cpu_put(cpu_policy); 1281 cpufreq_cpu_put(cpu_policy);
1280
1281 return 0; 1282 return 0;
1282} 1283}
1283EXPORT_SYMBOL(cpufreq_get_policy); 1284EXPORT_SYMBOL(cpufreq_get_policy);
@@ -1291,9 +1292,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1291 dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu, 1292 dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu,
1292 policy->min, policy->max); 1293 policy->min, policy->max);
1293 1294
1294 memcpy(&policy->cpuinfo, 1295 memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
1295 &data->cpuinfo,
1296 sizeof(struct cpufreq_cpuinfo));
1297 1296
1298 /* verify the cpu speed can be set within this limit */ 1297 /* verify the cpu speed can be set within this limit */
1299 ret = cpufreq_driver->verify(policy); 1298 ret = cpufreq_driver->verify(policy);
@@ -1324,8 +1323,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1324 1323
1325 up_read(&cpufreq_notifier_rwsem); 1324 up_read(&cpufreq_notifier_rwsem);
1326 1325
1327 data->min = policy->min; 1326 data->min = policy->min;
1328 data->max = policy->max; 1327 data->max = policy->max;
1329 1328
1330 dprintk("new min and max freqs are %u - %u kHz\n", data->min, data->max); 1329 dprintk("new min and max freqs are %u - %u kHz\n", data->min, data->max);
1331 1330
@@ -1362,7 +1361,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
1362 __cpufreq_governor(data, CPUFREQ_GOV_LIMITS); 1361 __cpufreq_governor(data, CPUFREQ_GOV_LIMITS);
1363 } 1362 }
1364 1363
1365 error_out: 1364error_out:
1366 cpufreq_debug_enable_ratelimit(); 1365 cpufreq_debug_enable_ratelimit();
1367 return ret; 1366 return ret;
1368} 1367}
@@ -1421,9 +1420,7 @@ int cpufreq_update_policy(unsigned int cpu)
1421 mutex_lock(&data->lock); 1420 mutex_lock(&data->lock);
1422 1421
1423 dprintk("updating policy for CPU %u\n", cpu); 1422 dprintk("updating policy for CPU %u\n", cpu);
1424 memcpy(&policy, 1423 memcpy(&policy, data, sizeof(struct cpufreq_policy));
1425 data,
1426 sizeof(struct cpufreq_policy));
1427 policy.min = data->user_policy.min; 1424 policy.min = data->user_policy.min;
1428 policy.max = data->user_policy.max; 1425 policy.max = data->user_policy.max;
1429 policy.policy = data->user_policy.policy; 1426 policy.policy = data->user_policy.policy;
@@ -1433,8 +1430,13 @@ int cpufreq_update_policy(unsigned int cpu)
1433 -> ask driver for current freq and notify governors about a change */ 1430 -> ask driver for current freq and notify governors about a change */
1434 if (cpufreq_driver->get) { 1431 if (cpufreq_driver->get) {
1435 policy.cur = cpufreq_driver->get(cpu); 1432 policy.cur = cpufreq_driver->get(cpu);
1436 if (data->cur != policy.cur) 1433 if (!data->cur) {
1437 cpufreq_out_of_sync(cpu, data->cur, policy.cur); 1434 dprintk("Driver did not initialize current freq");
1435 data->cur = policy.cur;
1436 } else {
1437 if (data->cur != policy.cur)
1438 cpufreq_out_of_sync(cpu, data->cur, policy.cur);
1439 }
1438 } 1440 }
1439 1441
1440 ret = __cpufreq_set_policy(data, &policy); 1442 ret = __cpufreq_set_policy(data, &policy);
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index e87d52c59940..d7a9401600bb 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1186,7 +1186,8 @@ static int __init sm_it87_init(void)
1186 1186
1187static void __exit sm_it87_exit(void) 1187static void __exit sm_it87_exit(void)
1188{ 1188{
1189 i2c_isa_del_driver(&it87_isa_driver); 1189 if (isa_address)
1190 i2c_isa_del_driver(&it87_isa_driver);
1190 i2c_del_driver(&it87_driver); 1191 i2c_del_driver(&it87_driver);
1191} 1192}
1192 1193
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
index 3eb08f004c0f..271e9cb9532c 100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@ -437,12 +437,12 @@ static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
437 show_temp, NULL, offset - 1); \ 437 show_temp, NULL, offset - 1); \
438static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ 438static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
439 show_temp_max, set_temp_max, offset - 1); \ 439 show_temp_max, set_temp_max, offset - 1); \
440static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \ 440static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
441 show_temp_min, set_temp_min, offset - 1) 441 show_temp_min, set_temp_min, offset - 1)
442 442
443static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL); 443static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL);
444static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max); 444static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max);
445static DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min); 445static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
446 446
447define_temperature_sysfs(2); 447define_temperature_sysfs(2);
448define_temperature_sysfs(3); 448define_temperature_sysfs(3);
@@ -451,7 +451,7 @@ define_temperature_sysfs(5);
451define_temperature_sysfs(6); 451define_temperature_sysfs(6);
452 452
453#define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \ 453#define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \
454 &sensor_dev_attr_temp##id##_min.dev_attr, \ 454 &sensor_dev_attr_temp##id##_max_hyst.dev_attr, \
455 &sensor_dev_attr_temp##id##_max.dev_attr } 455 &sensor_dev_attr_temp##id##_max.dev_attr }
456#define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \ 456#define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \
457 &sensor_dev_attr_in##id##_min.dev_attr, \ 457 &sensor_dev_attr_in##id##_min.dev_attr, \
@@ -464,7 +464,7 @@ struct str_device_attr_table {
464}; 464};
465 465
466static struct str_device_attr_table cfg_info_temp[] = { 466static struct str_device_attr_table cfg_info_temp[] = {
467 { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max }, 467 { &dev_attr_temp1_input, &dev_attr_temp1_max_hyst, &dev_attr_temp1_max },
468 CFG_INFO_TEMP(2), 468 CFG_INFO_TEMP(2),
469 CFG_INFO_TEMP(3), 469 CFG_INFO_TEMP(3),
470 CFG_INFO_TEMP(4), 470 CFG_INFO_TEMP(4),
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 557114872f3c..64c1f8af5bb2 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -95,11 +95,16 @@ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
95 (0x39))) 95 (0x39)))
96 96
97#define W83781D_REG_CONFIG 0x40 97#define W83781D_REG_CONFIG 0x40
98
99/* Interrupt status (W83781D, AS99127F) */
98#define W83781D_REG_ALARM1 0x41 100#define W83781D_REG_ALARM1 0x41
99#define W83781D_REG_ALARM2 0x42 101#define W83781D_REG_ALARM2 0x42
100#define W83781D_REG_ALARM3 0x450 /* not on W83781D */
101 102
102#define W83781D_REG_IRQ 0x4C 103/* Real-time status (W83782D, W83783S, W83627HF) */
104#define W83782D_REG_ALARM1 0x459
105#define W83782D_REG_ALARM2 0x45A
106#define W83782D_REG_ALARM3 0x45B
107
103#define W83781D_REG_BEEP_CONFIG 0x4D 108#define W83781D_REG_BEEP_CONFIG 0x4D
104#define W83781D_REG_BEEP_INTS1 0x56 109#define W83781D_REG_BEEP_INTS1 0x56
105#define W83781D_REG_BEEP_INTS2 0x57 110#define W83781D_REG_BEEP_INTS2 0x57
@@ -1513,15 +1518,6 @@ w83781d_init_client(struct i2c_client *client)
1513 W83781D_REG_TEMP3_CONFIG, tmp & 0xfe); 1518 W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
1514 } 1519 }
1515 } 1520 }
1516
1517 if (type != w83781d) {
1518 /* enable comparator mode for temp2 and temp3 so
1519 alarm indication will work correctly */
1520 i = w83781d_read_value(client, W83781D_REG_IRQ);
1521 if (!(i & 0x40))
1522 w83781d_write_value(client, W83781D_REG_IRQ,
1523 i | 0x40);
1524 }
1525 } 1521 }
1526 1522
1527 /* Start monitoring */ 1523 /* Start monitoring */
@@ -1612,14 +1608,25 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
1612 data->fan_div[1] |= (i >> 4) & 0x04; 1608 data->fan_div[1] |= (i >> 4) & 0x04;
1613 data->fan_div[2] |= (i >> 5) & 0x04; 1609 data->fan_div[2] |= (i >> 5) & 0x04;
1614 } 1610 }
1615 data->alarms =
1616 w83781d_read_value(client,
1617 W83781D_REG_ALARM1) +
1618 (w83781d_read_value(client, W83781D_REG_ALARM2) << 8);
1619 if ((data->type == w83782d) || (data->type == w83627hf)) { 1611 if ((data->type == w83782d) || (data->type == w83627hf)) {
1620 data->alarms |= 1612 data->alarms = w83781d_read_value(client,
1621 w83781d_read_value(client, 1613 W83782D_REG_ALARM1)
1622 W83781D_REG_ALARM3) << 16; 1614 | (w83781d_read_value(client,
1615 W83782D_REG_ALARM2) << 8)
1616 | (w83781d_read_value(client,
1617 W83782D_REG_ALARM3) << 16);
1618 } else if (data->type == w83783s) {
1619 data->alarms = w83781d_read_value(client,
1620 W83782D_REG_ALARM1)
1621 | (w83781d_read_value(client,
1622 W83782D_REG_ALARM2) << 8);
1623 } else {
1624 /* No real-time status registers, fall back to
1625 interrupt status registers */
1626 data->alarms = w83781d_read_value(client,
1627 W83781D_REG_ALARM1)
1628 | (w83781d_read_value(client,
1629 W83781D_REG_ALARM2) << 8);
1623 } 1630 }
1624 i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2); 1631 i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2);
1625 data->beep_enable = i >> 7; 1632 data->beep_enable = i >> 7;
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
index 9f2ffef4d812..4344ae6b1fcb 100644
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -72,16 +72,6 @@ static ssize_t show_adapter_name(struct device *dev,
72} 72}
73static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL); 73static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
74 74
75static int i2c_isa_device_probe(struct device *dev)
76{
77 return -ENODEV;
78}
79
80static int i2c_isa_device_remove(struct device *dev)
81{
82 return 0;
83}
84
85 75
86/* We implement an interface which resembles i2c_{add,del}_driver, 76/* We implement an interface which resembles i2c_{add,del}_driver,
87 but for i2c-isa drivers. We don't have to remember and handle lists 77 but for i2c-isa drivers. We don't have to remember and handle lists
@@ -93,8 +83,6 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
93 83
94 /* Add the driver to the list of i2c drivers in the driver core */ 84 /* Add the driver to the list of i2c drivers in the driver core */
95 driver->driver.bus = &i2c_bus_type; 85 driver->driver.bus = &i2c_bus_type;
96 driver->driver.probe = i2c_isa_device_probe;
97 driver->driver.remove = i2c_isa_device_remove;
98 res = driver_register(&driver->driver); 86 res = driver_register(&driver->driver);
99 if (res) 87 if (res)
100 return res; 88 return res;
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index d393b504bf26..c82f47a66e48 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
665 struct ib_wc mad_wc; 665 struct ib_wc mad_wc;
666 struct ib_send_wr *send_wr = &mad_send_wr->send_wr; 666 struct ib_send_wr *send_wr = &mad_send_wr->send_wr;
667 667
668 if (!smi_handle_dr_smp_send(smp, device->node_type, port_num)) { 668 /*
669 * Directed route handling starts if the initial LID routed part of
670 * a request or the ending LID routed part of a response is empty.
671 * If we are at the start of the LID routed part, don't update the
672 * hop_ptr or hop_cnt. See section 14.2.2, Vol 1 IB spec.
673 */
674 if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
675 IB_LID_PERMISSIVE &&
676 !smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
669 ret = -EINVAL; 677 ret = -EINVAL;
670 printk(KERN_ERR PFX "Invalid directed route\n"); 678 printk(KERN_ERR PFX "Invalid directed route\n");
671 goto out; 679 goto out;
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index f9b9b93dc501..2825615ce81c 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -1029,25 +1029,6 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
1029 MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET); 1029 MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET);
1030 dev_lim->uar_scratch_entry_sz = size; 1030 dev_lim->uar_scratch_entry_sz = size;
1031 1031
1032 mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
1033 dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
1034 mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
1035 dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
1036 mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
1037 dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
1038 mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
1039 dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
1040 mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
1041 dev_lim->reserved_mrws, dev_lim->reserved_mtts);
1042 mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
1043 dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
1044 mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
1045 dev_lim->max_pds, dev_lim->reserved_mgms);
1046 mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
1047 dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
1048
1049 mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
1050
1051 if (mthca_is_memfree(dev)) { 1032 if (mthca_is_memfree(dev)) {
1052 MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET); 1033 MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET);
1053 dev_lim->max_srq_sz = 1 << field; 1034 dev_lim->max_srq_sz = 1 << field;
@@ -1093,6 +1074,25 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
1093 dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE; 1074 dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE;
1094 } 1075 }
1095 1076
1077 mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
1078 dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
1079 mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
1080 dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
1081 mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
1082 dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
1083 mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
1084 dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
1085 mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
1086 dev_lim->reserved_mrws, dev_lim->reserved_mtts);
1087 mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
1088 dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
1089 mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
1090 dev_lim->max_pds, dev_lim->reserved_mgms);
1091 mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
1092 dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
1093
1094 mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
1095
1096out: 1096out:
1097 mthca_free_mailbox(dev, mailbox); 1097 mthca_free_mailbox(dev, mailbox);
1098 return err; 1098 return err;
diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h
index 2a165fd06e57..e481037288d6 100644
--- a/drivers/infiniband/hw/mthca/mthca_dev.h
+++ b/drivers/infiniband/hw/mthca/mthca_dev.h
@@ -53,8 +53,8 @@
53 53
54#define DRV_NAME "ib_mthca" 54#define DRV_NAME "ib_mthca"
55#define PFX DRV_NAME ": " 55#define PFX DRV_NAME ": "
56#define DRV_VERSION "0.06" 56#define DRV_VERSION "0.07"
57#define DRV_RELDATE "June 23, 2005" 57#define DRV_RELDATE "February 13, 2006"
58 58
59enum { 59enum {
60 MTHCA_FLAG_DDR_HIDDEN = 1 << 1, 60 MTHCA_FLAG_DDR_HIDDEN = 1 << 1,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index e0a5412b7e68..2f85a9a831b1 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -78,6 +78,7 @@ enum {
78 IPOIB_FLAG_SUBINTERFACE = 4, 78 IPOIB_FLAG_SUBINTERFACE = 4,
79 IPOIB_MCAST_RUN = 5, 79 IPOIB_MCAST_RUN = 5,
80 IPOIB_STOP_REAPER = 6, 80 IPOIB_STOP_REAPER = 6,
81 IPOIB_MCAST_STARTED = 7,
81 82
82 IPOIB_MAX_BACKOFF_SECONDS = 16, 83 IPOIB_MAX_BACKOFF_SECONDS = 16,
83 84
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index ccaa0c387076..a2408d7ec598 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -533,8 +533,10 @@ void ipoib_mcast_join_task(void *dev_ptr)
533 } 533 }
534 534
535 if (!priv->broadcast) { 535 if (!priv->broadcast) {
536 priv->broadcast = ipoib_mcast_alloc(dev, 1); 536 struct ipoib_mcast *broadcast;
537 if (!priv->broadcast) { 537
538 broadcast = ipoib_mcast_alloc(dev, 1);
539 if (!broadcast) {
538 ipoib_warn(priv, "failed to allocate broadcast group\n"); 540 ipoib_warn(priv, "failed to allocate broadcast group\n");
539 mutex_lock(&mcast_mutex); 541 mutex_lock(&mcast_mutex);
540 if (test_bit(IPOIB_MCAST_RUN, &priv->flags)) 542 if (test_bit(IPOIB_MCAST_RUN, &priv->flags))
@@ -544,10 +546,11 @@ void ipoib_mcast_join_task(void *dev_ptr)
544 return; 546 return;
545 } 547 }
546 548
547 memcpy(priv->broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4, 549 spin_lock_irq(&priv->lock);
550 memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
548 sizeof (union ib_gid)); 551 sizeof (union ib_gid));
552 priv->broadcast = broadcast;
549 553
550 spin_lock_irq(&priv->lock);
551 __ipoib_mcast_add(dev, priv->broadcast); 554 __ipoib_mcast_add(dev, priv->broadcast);
552 spin_unlock_irq(&priv->lock); 555 spin_unlock_irq(&priv->lock);
553 } 556 }
@@ -601,6 +604,10 @@ int ipoib_mcast_start_thread(struct net_device *dev)
601 queue_work(ipoib_workqueue, &priv->mcast_task); 604 queue_work(ipoib_workqueue, &priv->mcast_task);
602 mutex_unlock(&mcast_mutex); 605 mutex_unlock(&mcast_mutex);
603 606
607 spin_lock_irq(&priv->lock);
608 set_bit(IPOIB_MCAST_STARTED, &priv->flags);
609 spin_unlock_irq(&priv->lock);
610
604 return 0; 611 return 0;
605} 612}
606 613
@@ -611,6 +618,10 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
611 618
612 ipoib_dbg_mcast(priv, "stopping multicast thread\n"); 619 ipoib_dbg_mcast(priv, "stopping multicast thread\n");
613 620
621 spin_lock_irq(&priv->lock);
622 clear_bit(IPOIB_MCAST_STARTED, &priv->flags);
623 spin_unlock_irq(&priv->lock);
624
614 mutex_lock(&mcast_mutex); 625 mutex_lock(&mcast_mutex);
615 clear_bit(IPOIB_MCAST_RUN, &priv->flags); 626 clear_bit(IPOIB_MCAST_RUN, &priv->flags);
616 cancel_delayed_work(&priv->mcast_task); 627 cancel_delayed_work(&priv->mcast_task);
@@ -693,6 +704,14 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
693 */ 704 */
694 spin_lock(&priv->lock); 705 spin_lock(&priv->lock);
695 706
707 if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags) ||
708 !priv->broadcast ||
709 !test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) {
710 ++priv->stats.tx_dropped;
711 dev_kfree_skb_any(skb);
712 goto unlock;
713 }
714
696 mcast = __ipoib_mcast_find(dev, mgid); 715 mcast = __ipoib_mcast_find(dev, mgid);
697 if (!mcast) { 716 if (!mcast) {
698 /* Let's create a new send only group now */ 717 /* Let's create a new send only group now */
@@ -754,6 +773,7 @@ out:
754 ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); 773 ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
755 } 774 }
756 775
776unlock:
757 spin_unlock(&priv->lock); 777 spin_unlock(&priv->lock);
758} 778}
759 779
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index f190a99604f0..393633681f49 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2359,8 +2359,8 @@ isdn_tty_at_cout(char *msg, modem_info * info)
2359 2359
2360 /* use queue instead of direct, if online and */ 2360 /* use queue instead of direct, if online and */
2361 /* data is in queue or buffer is full */ 2361 /* data is in queue or buffer is full */
2362 if ((info->online && tty_buffer_request_room(tty, l) < l) || 2362 if (info->online && ((tty_buffer_request_room(tty, l) < l) ||
2363 (!skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) { 2363 !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) {
2364 skb = alloc_skb(l, GFP_ATOMIC); 2364 skb = alloc_skb(l, GFP_ATOMIC);
2365 if (!skb) { 2365 if (!skb) {
2366 spin_unlock_irqrestore(&info->readlock, flags); 2366 spin_unlock_irqrestore(&info->readlock, flags);
diff --git a/drivers/net/appletalk/cops.h b/drivers/net/appletalk/cops.h
index c68ba9c2ef46..fd2750b269c8 100644
--- a/drivers/net/appletalk/cops.h
+++ b/drivers/net/appletalk/cops.h
@@ -51,7 +51,7 @@
51struct ltfirmware 51struct ltfirmware
52{ 52{
53 unsigned int length; 53 unsigned int length;
54 unsigned char * data; 54 const unsigned char *data;
55}; 55};
56 56
57#define DAYNA 1 57#define DAYNA 1
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index 3c128b692bce..ec6f2a48895b 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -590,6 +590,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = {
590 PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9), 590 PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9),
591 PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26), 591 PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26),
592 PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b), 592 PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b),
593 PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757),
593 PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a), 594 PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a),
594 PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e), 595 PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e),
595 PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39), 596 PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39),
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index f46e8438e0d2..93f8a8fa8890 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -40,6 +40,8 @@
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/pci.h> 41#include <linux/pci.h>
42#include <linux/reboot.h> 42#include <linux/reboot.h>
43#include <linux/proc_fs.h>
44#include <linux/seq_file.h>
43 45
44#include <asm/byteorder.h> 46#include <asm/byteorder.h>
45#include <asm/cache.h> /* for L1_CACHE_BYTES */ 47#include <asm/cache.h> /* for L1_CACHE_BYTES */
@@ -1019,62 +1021,33 @@ static struct hppa_dma_ops ccio_ops = {
1019}; 1021};
1020 1022
1021#ifdef CONFIG_PROC_FS 1023#ifdef CONFIG_PROC_FS
1022static int proc_append(char *src, int len, char **dst, off_t *offset, int *max) 1024static int ccio_proc_info(struct seq_file *m, void *p)
1023{
1024 if (len < *offset) {
1025 *offset -= len;
1026 return 0;
1027 }
1028 if (*offset > 0) {
1029 src += *offset;
1030 len -= *offset;
1031 *offset = 0;
1032 }
1033 if (len > *max) {
1034 len = *max;
1035 }
1036 memcpy(*dst, src, len);
1037 *dst += len;
1038 *max -= len;
1039 return (*max == 0);
1040}
1041
1042static int ccio_proc_info(char *buf, char **start, off_t offset, int count,
1043 int *eof, void *data)
1044{ 1025{
1045 int max = count; 1026 int len = 0;
1046 char tmp[80]; /* width of an ANSI-standard terminal */
1047 struct ioc *ioc = ioc_list; 1027 struct ioc *ioc = ioc_list;
1048 1028
1049 while (ioc != NULL) { 1029 while (ioc != NULL) {
1050 unsigned int total_pages = ioc->res_size << 3; 1030 unsigned int total_pages = ioc->res_size << 3;
1051 unsigned long avg = 0, min, max; 1031 unsigned long avg = 0, min, max;
1052 int j, len; 1032 int j;
1053 1033
1054 len = sprintf(tmp, "%s\n", ioc->name); 1034 len += seq_printf(m, "%s\n", ioc->name);
1055 if (proc_append(tmp, len, &buf, &offset, &count))
1056 break;
1057 1035
1058 len = sprintf(tmp, "Cujo 2.0 bug : %s\n", 1036 len += seq_printf(m, "Cujo 2.0 bug : %s\n",
1059 (ioc->cujo20_bug ? "yes" : "no")); 1037 (ioc->cujo20_bug ? "yes" : "no"));
1060 if (proc_append(tmp, len, &buf, &offset, &count))
1061 break;
1062 1038
1063 len = sprintf(tmp, "IO PDIR size : %d bytes (%d entries)\n", 1039 len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1064 total_pages * 8, total_pages); 1040 total_pages * 8, total_pages);
1065 if (proc_append(tmp, len, &buf, &offset, &count)) 1041
1066 break;
1067#ifdef CCIO_MAP_STATS 1042#ifdef CCIO_MAP_STATS
1068 len = sprintf(tmp, "IO PDIR entries : %ld free %ld used (%d%%)\n", 1043 len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1069 total_pages - ioc->used_pages, ioc->used_pages, 1044 total_pages - ioc->used_pages, ioc->used_pages,
1070 (int)(ioc->used_pages * 100 / total_pages)); 1045 (int)(ioc->used_pages * 100 / total_pages));
1071 if (proc_append(tmp, len, &buf, &offset, &count))
1072 break;
1073#endif 1046#endif
1074 len = sprintf(tmp, "Resource bitmap : %d bytes (%d pages)\n", 1047
1075 ioc->res_size, total_pages); 1048 len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1076 if (proc_append(tmp, len, &buf, &offset, &count)) 1049 ioc->res_size, total_pages);
1077 break; 1050
1078#ifdef CCIO_SEARCH_TIME 1051#ifdef CCIO_SEARCH_TIME
1079 min = max = ioc->avg_search[0]; 1052 min = max = ioc->avg_search[0];
1080 for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) { 1053 for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) {
@@ -1085,70 +1058,83 @@ static int ccio_proc_info(char *buf, char **start, off_t offset, int count,
1085 min = ioc->avg_search[j]; 1058 min = ioc->avg_search[j];
1086 } 1059 }
1087 avg /= CCIO_SEARCH_SAMPLE; 1060 avg /= CCIO_SEARCH_SAMPLE;
1088 len = sprintf(tmp, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", 1061 len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1089 min, avg, max); 1062 min, avg, max);
1090 if (proc_append(tmp, len, &buf, &offset, &count))
1091 break;
1092#endif 1063#endif
1093#ifdef CCIO_MAP_STATS 1064#ifdef CCIO_MAP_STATS
1094 len = sprintf(tmp, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n", 1065 len += seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n",
1095 ioc->msingle_calls, ioc->msingle_pages, 1066 ioc->msingle_calls, ioc->msingle_pages,
1096 (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls)); 1067 (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
1097 if (proc_append(tmp, len, &buf, &offset, &count))
1098 break;
1099
1100 1068
1101 /* KLUGE - unmap_sg calls unmap_single for each mapped page */ 1069 /* KLUGE - unmap_sg calls unmap_single for each mapped page */
1102 min = ioc->usingle_calls - ioc->usg_calls; 1070 min = ioc->usingle_calls - ioc->usg_calls;
1103 max = ioc->usingle_pages - ioc->usg_pages; 1071 max = ioc->usingle_pages - ioc->usg_pages;
1104 len = sprintf(tmp, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n", 1072 len += seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n",
1105 min, max, (int)((max * 1000)/min)); 1073 min, max, (int)((max * 1000)/min));
1106 if (proc_append(tmp, len, &buf, &offset, &count))
1107 break;
1108 1074
1109 len = sprintf(tmp, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n", 1075 len += seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n",
1110 ioc->msg_calls, ioc->msg_pages, 1076 ioc->msg_calls, ioc->msg_pages,
1111 (int)((ioc->msg_pages * 1000)/ioc->msg_calls)); 1077 (int)((ioc->msg_pages * 1000)/ioc->msg_calls));
1112 if (proc_append(tmp, len, &buf, &offset, &count)) 1078
1113 break; 1079 len += seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n",
1114 len = sprintf(tmp, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n", 1080 ioc->usg_calls, ioc->usg_pages,
1115 ioc->usg_calls, ioc->usg_pages, 1081 (int)((ioc->usg_pages * 1000)/ioc->usg_calls));
1116 (int)((ioc->usg_pages * 1000)/ioc->usg_calls));
1117 if (proc_append(tmp, len, &buf, &offset, &count))
1118 break;
1119#endif /* CCIO_MAP_STATS */ 1082#endif /* CCIO_MAP_STATS */
1083
1120 ioc = ioc->next; 1084 ioc = ioc->next;
1121 } 1085 }
1122 1086
1123 if (count == 0) { 1087 return 0;
1124 *eof = 1; 1088}
1125 } 1089
1126 return (max - count); 1090static int ccio_proc_info_open(struct inode *inode, struct file *file)
1091{
1092 return single_open(file, &ccio_proc_info, NULL);
1127} 1093}
1128 1094
1129static int ccio_resource_map(char *buf, char **start, off_t offset, int len, 1095static struct file_operations ccio_proc_info_fops = {
1130 int *eof, void *data) 1096 .owner = THIS_MODULE,
1097 .open = ccio_proc_info_open,
1098 .read = seq_read,
1099 .llseek = seq_lseek,
1100 .release = single_release,
1101};
1102
1103static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
1131{ 1104{
1105 int len = 0;
1132 struct ioc *ioc = ioc_list; 1106 struct ioc *ioc = ioc_list;
1133 1107
1134 buf[0] = '\0';
1135 while (ioc != NULL) { 1108 while (ioc != NULL) {
1136 u32 *res_ptr = (u32 *)ioc->res_map; 1109 u32 *res_ptr = (u32 *)ioc->res_map;
1137 int j; 1110 int j;
1138 1111
1139 for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) { 1112 for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {
1140 if ((j & 7) == 0) 1113 if ((j & 7) == 0)
1141 strcat(buf,"\n "); 1114 len += seq_puts(m, "\n ");
1142 sprintf(buf, "%s %08x", buf, *res_ptr); 1115 len += seq_printf(m, "%08x", *res_ptr);
1143 res_ptr++; 1116 res_ptr++;
1144 } 1117 }
1145 strcat(buf, "\n\n"); 1118 len += seq_puts(m, "\n\n");
1146 ioc = ioc->next; 1119 ioc = ioc->next;
1147 break; /* XXX - remove me */ 1120 break; /* XXX - remove me */
1148 } 1121 }
1149 1122
1150 return strlen(buf); 1123 return 0;
1151} 1124}
1125
1126static int ccio_proc_bitmap_open(struct inode *inode, struct file *file)
1127{
1128 return single_open(file, &ccio_proc_bitmap_info, NULL);
1129}
1130
1131static struct file_operations ccio_proc_bitmap_fops = {
1132 .owner = THIS_MODULE,
1133 .open = ccio_proc_bitmap_open,
1134 .read = seq_read,
1135 .llseek = seq_lseek,
1136 .release = single_release,
1137};
1152#endif 1138#endif
1153 1139
1154/** 1140/**
@@ -1556,6 +1542,7 @@ static int ccio_probe(struct parisc_device *dev)
1556{ 1542{
1557 int i; 1543 int i;
1558 struct ioc *ioc, **ioc_p = &ioc_list; 1544 struct ioc *ioc, **ioc_p = &ioc_list;
1545 struct proc_dir_entry *info_entry, *bitmap_entry;
1559 1546
1560 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); 1547 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
1561 if (ioc == NULL) { 1548 if (ioc == NULL) {
@@ -1583,13 +1570,14 @@ static int ccio_probe(struct parisc_device *dev)
1583 BUG_ON(dev->dev.platform_data == NULL); 1570 BUG_ON(dev->dev.platform_data == NULL);
1584 HBA_DATA(dev->dev.platform_data)->iommu = ioc; 1571 HBA_DATA(dev->dev.platform_data)->iommu = ioc;
1585 1572
1586
1587 if (ioc_count == 0) { 1573 if (ioc_count == 0) {
1588 /* FIXME: Create separate entries for each ioc */ 1574 info_entry = create_proc_entry(MODULE_NAME, 0, proc_runway_root);
1589 create_proc_read_entry(MODULE_NAME, S_IRWXU, proc_runway_root, 1575 if (info_entry)
1590 ccio_proc_info, NULL); 1576 info_entry->proc_fops = &ccio_proc_info_fops;
1591 create_proc_read_entry(MODULE_NAME"-bitmap", S_IRWXU, 1577
1592 proc_runway_root, ccio_resource_map, NULL); 1578 bitmap_entry = create_proc_entry(MODULE_NAME"-bitmap", 0, proc_runway_root);
1579 if (bitmap_entry)
1580 bitmap_entry->proc_fops = &ccio_proc_bitmap_fops;
1593 } 1581 }
1594 1582
1595 ioc_count++; 1583 ioc_count++;
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 52f265e97729..5d47c5965c51 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -37,6 +37,8 @@
37#include <asm/hardware.h> /* for register_parisc_driver() stuff */ 37#include <asm/hardware.h> /* for register_parisc_driver() stuff */
38 38
39#include <linux/proc_fs.h> 39#include <linux/proc_fs.h>
40#include <linux/seq_file.h>
41
40#include <asm/runway.h> /* for proc_runway_root */ 42#include <asm/runway.h> /* for proc_runway_root */
41#include <asm/pdc.h> /* for PDC_MODEL_* */ 43#include <asm/pdc.h> /* for PDC_MODEL_* */
42#include <asm/pdcpat.h> /* for is_pdc_pat() */ 44#include <asm/pdcpat.h> /* for is_pdc_pat() */
@@ -1892,46 +1894,43 @@ sba_common_init(struct sba_device *sba_dev)
1892} 1894}
1893 1895
1894#ifdef CONFIG_PROC_FS 1896#ifdef CONFIG_PROC_FS
1895static int sba_proc_info(char *buf, char **start, off_t offset, int len) 1897static int sba_proc_info(struct seq_file *m, void *p)
1896{ 1898{
1897 struct sba_device *sba_dev = sba_list; 1899 struct sba_device *sba_dev = sba_list;
1898 struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */ 1900 struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */
1899 int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */ 1901 int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */
1900 unsigned long i;
1901#ifdef SBA_COLLECT_STATS 1902#ifdef SBA_COLLECT_STATS
1902 unsigned long avg = 0, min, max; 1903 unsigned long avg = 0, min, max;
1903#endif 1904#endif
1905 int i, len = 0;
1904 1906
1905 sprintf(buf, "%s rev %d.%d\n", 1907 len += seq_printf(m, "%s rev %d.%d\n",
1906 sba_dev->name, 1908 sba_dev->name,
1907 (sba_dev->hw_rev & 0x7) + 1, 1909 (sba_dev->hw_rev & 0x7) + 1,
1908 (sba_dev->hw_rev & 0x18) >> 3 1910 (sba_dev->hw_rev & 0x18) >> 3
1909 ); 1911 );
1910 sprintf(buf, "%sIO PDIR size : %d bytes (%d entries)\n", 1912 len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1911 buf,
1912 (int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */ 1913 (int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
1913 total_pages); 1914 total_pages);
1914 1915
1915 sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 1916 len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1916 buf, ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */ 1917 ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */
1917 1918
1918 sprintf(buf, "%sLMMIO_BASE/MASK/ROUTE %08x %08x %08x\n", 1919 len += seq_printf(m, "LMMIO_BASE/MASK/ROUTE %08x %08x %08x\n",
1919 buf,
1920 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE), 1920 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE),
1921 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK), 1921 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK),
1922 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE) 1922 READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE)
1923 ); 1923 );
1924 1924
1925 for (i=0; i<4; i++) 1925 for (i=0; i<4; i++)
1926 sprintf(buf, "%sDIR%ld_BASE/MASK/ROUTE %08x %08x %08x\n", 1926 len += seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n", i,
1927 buf, i,
1928 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18), 1927 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18),
1929 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18), 1928 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18),
1930 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18) 1929 READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18)
1931 ); 1930 );
1932 1931
1933#ifdef SBA_COLLECT_STATS 1932#ifdef SBA_COLLECT_STATS
1934 sprintf(buf, "%sIO PDIR entries : %ld free %ld used (%d%%)\n", buf, 1933 len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1935 total_pages - ioc->used_pages, ioc->used_pages, 1934 total_pages - ioc->used_pages, ioc->used_pages,
1936 (int) (ioc->used_pages * 100 / total_pages)); 1935 (int) (ioc->used_pages * 100 / total_pages));
1937 1936
@@ -1942,53 +1941,76 @@ static int sba_proc_info(char *buf, char **start, off_t offset, int len)
1942 if (ioc->avg_search[i] < min) min = ioc->avg_search[i]; 1941 if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
1943 } 1942 }
1944 avg /= SBA_SEARCH_SAMPLE; 1943 avg /= SBA_SEARCH_SAMPLE;
1945 sprintf(buf, "%s Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", 1944 len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1946 buf, min, avg, max); 1945 min, avg, max);
1947 1946
1948 sprintf(buf, "%spci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n", 1947 len += seq_printf(m, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n",
1949 buf, ioc->msingle_calls, ioc->msingle_pages, 1948 ioc->msingle_calls, ioc->msingle_pages,
1950 (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls)); 1949 (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls));
1951 1950
1952 /* KLUGE - unmap_sg calls unmap_single for each mapped page */ 1951 /* KLUGE - unmap_sg calls unmap_single for each mapped page */
1953 min = ioc->usingle_calls; 1952 min = ioc->usingle_calls;
1954 max = ioc->usingle_pages - ioc->usg_pages; 1953 max = ioc->usingle_pages - ioc->usg_pages;
1955 sprintf(buf, "%spci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n", 1954 len += seq_printf(m, "pci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n",
1956 buf, min, max, 1955 min, max, (int) ((max * 1000)/min));
1957 (int) ((max * 1000)/min));
1958 1956
1959 sprintf(buf, "%spci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n", 1957 len += seq_printf(m, "pci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1960 buf, ioc->msg_calls, ioc->msg_pages, 1958 ioc->msg_calls, ioc->msg_pages,
1961 (int) ((ioc->msg_pages * 1000)/ioc->msg_calls)); 1959 (int) ((ioc->msg_pages * 1000)/ioc->msg_calls));
1962 1960
1963 sprintf(buf, "%spci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n", 1961 len += seq_printf(m, "pci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1964 buf, ioc->usg_calls, ioc->usg_pages, 1962 ioc->usg_calls, ioc->usg_pages,
1965 (int) ((ioc->usg_pages * 1000)/ioc->usg_calls)); 1963 (int) ((ioc->usg_pages * 1000)/ioc->usg_calls));
1966#endif 1964#endif
1967 1965
1968 return strlen(buf); 1966 return 0;
1969} 1967}
1970 1968
1971#if 0
1972/* XXX too much output - exceeds 4k limit and needs to be re-written */
1973static int 1969static int
1974sba_resource_map(char *buf, char **start, off_t offset, int len) 1970sba_proc_open(struct inode *i, struct file *f)
1971{
1972 return single_open(f, &sba_proc_info, NULL);
1973}
1974
1975static struct file_operations sba_proc_fops = {
1976 .owner = THIS_MODULE,
1977 .open = sba_proc_open,
1978 .read = seq_read,
1979 .llseek = seq_lseek,
1980 .release = single_release,
1981};
1982
1983static int
1984sba_proc_bitmap_info(struct seq_file *m, void *p)
1975{ 1985{
1976 struct sba_device *sba_dev = sba_list; 1986 struct sba_device *sba_dev = sba_list;
1977 struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Mutli-IOC suppoer! */ 1987 struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */
1978 unsigned int *res_ptr = (unsigned int *)ioc->res_map; 1988 unsigned int *res_ptr = (unsigned int *)ioc->res_map;
1979 int i; 1989 int i, len = 0;
1980 1990
1981 buf[0] = '\0'; 1991 for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
1982 for(i = 0; i < (ioc->res_size / sizeof(unsigned int)); ++i, ++res_ptr) {
1983 if ((i & 7) == 0) 1992 if ((i & 7) == 0)
1984 strcat(buf,"\n "); 1993 len += seq_printf(m, "\n ");
1985 sprintf(buf, "%s %08x", buf, *res_ptr); 1994 len += seq_printf(m, " %08x", *res_ptr);
1986 } 1995 }
1987 strcat(buf, "\n"); 1996 len += seq_printf(m, "\n");
1988 1997
1989 return strlen(buf); 1998 return 0;
1990} 1999}
1991#endif /* 0 */ 2000
2001static int
2002sba_proc_bitmap_open(struct inode *i, struct file *f)
2003{
2004 return single_open(f, &sba_proc_bitmap_info, NULL);
2005}
2006
2007static struct file_operations sba_proc_bitmap_fops = {
2008 .owner = THIS_MODULE,
2009 .open = sba_proc_bitmap_open,
2010 .read = seq_read,
2011 .llseek = seq_lseek,
2012 .release = single_release,
2013};
1992#endif /* CONFIG_PROC_FS */ 2014#endif /* CONFIG_PROC_FS */
1993 2015
1994static struct parisc_device_id sba_tbl[] = { 2016static struct parisc_device_id sba_tbl[] = {
@@ -2021,6 +2043,7 @@ sba_driver_callback(struct parisc_device *dev)
2021 int i; 2043 int i;
2022 char *version; 2044 char *version;
2023 void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE); 2045 void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE);
2046 struct proc_dir_entry *info_entry, *bitmap_entry, *root;
2024 2047
2025 sba_dump_ranges(sba_addr); 2048 sba_dump_ranges(sba_addr);
2026 2049
@@ -2088,19 +2111,27 @@ sba_driver_callback(struct parisc_device *dev)
2088 hppa_dma_ops = &sba_ops; 2111 hppa_dma_ops = &sba_ops;
2089 2112
2090#ifdef CONFIG_PROC_FS 2113#ifdef CONFIG_PROC_FS
2091 if (IS_ASTRO(&dev->id)) { 2114 switch (dev->id.hversion) {
2092 create_proc_info_entry("Astro", 0, proc_runway_root, sba_proc_info); 2115 case PLUTO_MCKINLEY_PORT:
2093 } else if (IS_IKE(&dev->id)) { 2116 root = proc_mckinley_root;
2094 create_proc_info_entry("Ike", 0, proc_runway_root, sba_proc_info); 2117 break;
2095 } else if (IS_PLUTO(&dev->id)) { 2118 case ASTRO_RUNWAY_PORT:
2096 create_proc_info_entry("Pluto", 0, proc_mckinley_root, sba_proc_info); 2119 case IKE_MERCED_PORT:
2097 } else { 2120 default:
2098 create_proc_info_entry("Reo", 0, proc_runway_root, sba_proc_info); 2121 root = proc_runway_root;
2122 break;
2099 } 2123 }
2100#if 0 2124
2101 create_proc_info_entry("bitmap", 0, proc_runway_root, sba_resource_map); 2125 info_entry = create_proc_entry("sba_iommu", 0, root);
2102#endif 2126 bitmap_entry = create_proc_entry("sba_iommu-bitmap", 0, root);
2127
2128 if (info_entry)
2129 info_entry->proc_fops = &sba_proc_fops;
2130
2131 if (bitmap_entry)
2132 bitmap_entry->proc_fops = &sba_proc_bitmap_fops;
2103#endif 2133#endif
2134
2104 parisc_vmerge_boundary = IOVP_SIZE; 2135 parisc_vmerge_boundary = IOVP_SIZE;
2105 parisc_vmerge_max_size = IOVP_SIZE * BITS_PER_LONG; 2136 parisc_vmerge_max_size = IOVP_SIZE * BITS_PER_LONG;
2106 parisc_has_iommu(); 2137 parisc_has_iommu();
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index ceb0e474fde4..4138564402b8 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -85,11 +85,10 @@ static volatile enum sclp_mask_state_t {
85/* Maximum retry counts */ 85/* Maximum retry counts */
86#define SCLP_INIT_RETRY 3 86#define SCLP_INIT_RETRY 3
87#define SCLP_MASK_RETRY 3 87#define SCLP_MASK_RETRY 3
88#define SCLP_REQUEST_RETRY 3
89 88
90/* Timeout intervals in seconds.*/ 89/* Timeout intervals in seconds.*/
91#define SCLP_BUSY_INTERVAL 2 90#define SCLP_BUSY_INTERVAL 10
92#define SCLP_RETRY_INTERVAL 5 91#define SCLP_RETRY_INTERVAL 15
93 92
94static void sclp_process_queue(void); 93static void sclp_process_queue(void);
95static int sclp_init_mask(int calculate); 94static int sclp_init_mask(int calculate);
@@ -153,11 +152,9 @@ __sclp_start_request(struct sclp_req *req)
153 if (sclp_running_state != sclp_running_state_idle) 152 if (sclp_running_state != sclp_running_state_idle)
154 return 0; 153 return 0;
155 del_timer(&sclp_request_timer); 154 del_timer(&sclp_request_timer);
156 if (req->start_count <= SCLP_REQUEST_RETRY) { 155 rc = service_call(req->command, req->sccb);
157 rc = service_call(req->command, req->sccb); 156 req->start_count++;
158 req->start_count++; 157
159 } else
160 rc = -EIO;
161 if (rc == 0) { 158 if (rc == 0) {
162 /* Sucessfully started request */ 159 /* Sucessfully started request */
163 req->status = SCLP_REQ_RUNNING; 160 req->status = SCLP_REQ_RUNNING;
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 92be75d99a56..8cf9905d484b 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
232 return 0; 232 return 0;
233 233
234 mask = 0x80 >> j; 234 mask = 0x80 >> j;
235 spin_lock(&sch->lock); 235 spin_lock_irq(&sch->lock);
236 236
237 stsch(sch->schid, &schib); 237 stsch(sch->schid, &schib);
238 if (!schib.pmcw.dnv) 238 if (!schib.pmcw.dnv)
@@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
281 if (sch->driver && sch->driver->verify) 281 if (sch->driver && sch->driver->verify)
282 sch->driver->verify(&sch->dev); 282 sch->driver->verify(&sch->dev);
283out_unlock: 283out_unlock:
284 spin_unlock(&sch->lock); 284 spin_unlock_irq(&sch->lock);
285 return 0; 285 return 0;
286out_unreg: 286out_unreg:
287 spin_unlock(&sch->lock); 287 spin_unlock_irq(&sch->lock);
288 sch->lpm = 0; 288 sch->lpm = 0;
289 if (css_enqueue_subchannel_slow(sch->schid)) { 289 if (css_enqueue_subchannel_slow(sch->schid)) {
290 css_clear_subchannel_slow_list(); 290 css_clear_subchannel_slow_list();
@@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data)
652 if (!sch) 652 if (!sch)
653 /* Check if the subchannel is now available. */ 653 /* Check if the subchannel is now available. */
654 return __chp_add_new_sch(schid); 654 return __chp_add_new_sch(schid);
655 spin_lock(&sch->lock); 655 spin_lock_irq(&sch->lock);
656 for (i=0; i<8; i++) 656 for (i=0; i<8; i++)
657 if (sch->schib.pmcw.chpid[i] == chp->id) { 657 if (sch->schib.pmcw.chpid[i] == chp->id) {
658 if (stsch(sch->schid, &sch->schib) != 0) { 658 if (stsch(sch->schid, &sch->schib) != 0) {
@@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data)
674 if (sch->driver && sch->driver->verify) 674 if (sch->driver && sch->driver->verify)
675 sch->driver->verify(&sch->dev); 675 sch->driver->verify(&sch->dev);
676 676
677 spin_unlock(&sch->lock); 677 spin_unlock_irq(&sch->lock);
678 put_device(&sch->dev); 678 put_device(&sch->dev);
679 return 0; 679 return 0;
680} 680}
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index 1d85533d46d2..f3763d2ccb86 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1717,11 +1717,9 @@ ioc4_change_speed(struct uart_port *the_port,
1717 } 1717 }
1718 1718
1719 if (cflag & CRTSCTS) { 1719 if (cflag & CRTSCTS) {
1720 info->flags |= ASYNC_CTS_FLOW;
1721 port->ip_sscr |= IOC4_SSCR_HFC_EN; 1720 port->ip_sscr |= IOC4_SSCR_HFC_EN;
1722 } 1721 }
1723 else { 1722 else {
1724 info->flags &= ~ASYNC_CTS_FLOW;
1725 port->ip_sscr &= ~IOC4_SSCR_HFC_EN; 1723 port->ip_sscr &= ~IOC4_SSCR_HFC_EN;
1726 } 1724 }
1727 writel(port->ip_sscr, &port->ip_serial_regs->sscr); 1725 writel(port->ip_sscr, &port->ip_serial_regs->sscr);
@@ -1760,18 +1758,6 @@ static inline int ic4_startup_local(struct uart_port *the_port)
1760 1758
1761 info = the_port->info; 1759 info = the_port->info;
1762 1760
1763 if (info->tty) {
1764 set_bit(TTY_IO_ERROR, &info->tty->flags);
1765 clear_bit(TTY_IO_ERROR, &info->tty->flags);
1766 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
1767 info->tty->alt_speed = 57600;
1768 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
1769 info->tty->alt_speed = 115200;
1770 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
1771 info->tty->alt_speed = 230400;
1772 if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
1773 info->tty->alt_speed = 460800;
1774 }
1775 local_open(port); 1761 local_open(port);
1776 1762
1777 /* set the speed of the serial port */ 1763 /* set the speed of the serial port */
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index e9e5bc178cef..118288d94423 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -191,8 +191,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
191 } 191 }
192 if (wait_time <= 0) 192 if (wait_time <= 0)
193 printk(KERN_WARNING "%s %s: BIOS handoff " 193 printk(KERN_WARNING "%s %s: BIOS handoff "
194 "failed (BIOS bug ?)\n", 194 "failed (BIOS bug ?) %08x\n",
195 pdev->dev.bus_id, "OHCI"); 195 pdev->dev.bus_id, "OHCI",
196 readl(base + OHCI_CONTROL));
196 197
197 /* reset controller, preserving RWC */ 198 /* reset controller, preserving RWC */
198 writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL); 199 writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
@@ -243,6 +244,12 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
243 pr_debug("%s %s: BIOS handoff\n", 244 pr_debug("%s %s: BIOS handoff\n",
244 pdev->dev.bus_id, "EHCI"); 245 pdev->dev.bus_id, "EHCI");
245 246
247#if 0
248/* aleksey_gorelov@phoenix.com reports that some systems need SMI forced on,
249 * but that seems dubious in general (the BIOS left it off intentionally)
250 * and is known to prevent some systems from booting. so we won't do this
251 * unless maybe we can determine when we're on a system that needs SMI forced.
252 */
246 /* BIOS workaround (?): be sure the 253 /* BIOS workaround (?): be sure the
247 * pre-Linux code receives the SMI 254 * pre-Linux code receives the SMI
248 */ 255 */
@@ -252,6 +259,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
252 pci_write_config_dword(pdev, 259 pci_write_config_dword(pdev,
253 offset + EHCI_USBLEGCTLSTS, 260 offset + EHCI_USBLEGCTLSTS,
254 val | EHCI_USBLEGCTLSTS_SOOE); 261 val | EHCI_USBLEGCTLSTS_SOOE);
262#endif
255 } 263 }
256 264
257 /* always say Linux will own the hardware 265 /* always say Linux will own the hardware
@@ -274,8 +282,8 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
274 * it down, and hope nothing goes too wrong 282 * it down, and hope nothing goes too wrong
275 */ 283 */
276 printk(KERN_WARNING "%s %s: BIOS handoff " 284 printk(KERN_WARNING "%s %s: BIOS handoff "
277 "failed (BIOS bug ?)\n", 285 "failed (BIOS bug ?) %08x\n",
278 pdev->dev.bus_id, "EHCI"); 286 pdev->dev.bus_id, "EHCI", cap);
279 pci_write_config_byte(pdev, offset + 2, 0); 287 pci_write_config_byte(pdev, offset + 2, 0);
280 } 288 }
281 289
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index 466384d7c79f..134d2000128a 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -101,7 +101,7 @@ static struct resource resources[] = {
101 }, 101 },
102}; 102};
103 103
104extern struct device_driver sl811h_driver; 104extern struct platform_driver sl811h_driver;
105 105
106static struct platform_device platform_dev = { 106static struct platform_device platform_dev = {
107 .id = -1, 107 .id = -1,
@@ -132,7 +132,7 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
132 * initialized already because of the link order dependency created 132 * initialized already because of the link order dependency created
133 * by referencing "sl811h_driver". 133 * by referencing "sl811h_driver".
134 */ 134 */
135 platform_dev.name = sl811h_driver.name; 135 platform_dev.name = sl811h_driver.driver.name;
136 return platform_device_register(&platform_dev); 136 return platform_device_register(&platform_dev);
137} 137}
138 138
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 6f7a684c3e07..772478086bd3 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1435,17 +1435,20 @@ void hid_init_reports(struct hid_device *hid)
1435#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004 1435#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
1436 1436
1437#define USB_VENDOR_ID_LD 0x0f11 1437#define USB_VENDOR_ID_LD 0x0f11
1438#define USB_DEVICE_ID_CASSY 0x1000 1438#define USB_DEVICE_ID_LD_CASSY 0x1000
1439#define USB_DEVICE_ID_POCKETCASSY 0x1010 1439#define USB_DEVICE_ID_LD_POCKETCASSY 0x1010
1440#define USB_DEVICE_ID_MOBILECASSY 0x1020 1440#define USB_DEVICE_ID_LD_MOBILECASSY 0x1020
1441#define USB_DEVICE_ID_JWM 0x1080 1441#define USB_DEVICE_ID_LD_JWM 0x1080
1442#define USB_DEVICE_ID_DMMP 0x1081 1442#define USB_DEVICE_ID_LD_DMMP 0x1081
1443#define USB_DEVICE_ID_UMIP 0x1090 1443#define USB_DEVICE_ID_LD_UMIP 0x1090
1444#define USB_DEVICE_ID_VIDEOCOM 0x1200 1444#define USB_DEVICE_ID_LD_XRAY1 0x1100
1445#define USB_DEVICE_ID_COM3LAB 0x2000 1445#define USB_DEVICE_ID_LD_XRAY2 0x1101
1446#define USB_DEVICE_ID_TELEPORT 0x2010 1446#define USB_DEVICE_ID_LD_VIDEOCOM 0x1200
1447#define USB_DEVICE_ID_NETWORKANALYSER 0x2020 1447#define USB_DEVICE_ID_LD_COM3LAB 0x2000
1448#define USB_DEVICE_ID_POWERCONTROL 0x2030 1448#define USB_DEVICE_ID_LD_TELEPORT 0x2010
1449#define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020
1450#define USB_DEVICE_ID_LD_POWERCONTROL 0x2030
1451#define USB_DEVICE_ID_LD_MACHINETEST 0x2040
1449 1452
1450#define USB_VENDOR_ID_APPLE 0x05ac 1453#define USB_VENDOR_ID_APPLE 0x05ac
1451#define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304 1454#define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304
@@ -1491,17 +1494,20 @@ static const struct hid_blacklist {
1491 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, 1494 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
1492 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, 1495 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
1493 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 1496 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
1494 { USB_VENDOR_ID_LD, USB_DEVICE_ID_CASSY, HID_QUIRK_IGNORE }, 1497 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
1495 { USB_VENDOR_ID_LD, USB_DEVICE_ID_POCKETCASSY, HID_QUIRK_IGNORE }, 1498 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
1496 { USB_VENDOR_ID_LD, USB_DEVICE_ID_MOBILECASSY, HID_QUIRK_IGNORE }, 1499 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY, HID_QUIRK_IGNORE },
1497 { USB_VENDOR_ID_LD, USB_DEVICE_ID_JWM, HID_QUIRK_IGNORE }, 1500 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM, HID_QUIRK_IGNORE },
1498 { USB_VENDOR_ID_LD, USB_DEVICE_ID_DMMP, HID_QUIRK_IGNORE }, 1501 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP, HID_QUIRK_IGNORE },
1499 { USB_VENDOR_ID_LD, USB_DEVICE_ID_UMIP, HID_QUIRK_IGNORE }, 1502 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP, HID_QUIRK_IGNORE },
1500 { USB_VENDOR_ID_LD, USB_DEVICE_ID_VIDEOCOM, HID_QUIRK_IGNORE }, 1503 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY1, HID_QUIRK_IGNORE },
1501 { USB_VENDOR_ID_LD, USB_DEVICE_ID_COM3LAB, HID_QUIRK_IGNORE }, 1504 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY2, HID_QUIRK_IGNORE },
1502 { USB_VENDOR_ID_LD, USB_DEVICE_ID_TELEPORT, HID_QUIRK_IGNORE }, 1505 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_VIDEOCOM, HID_QUIRK_IGNORE },
1503 { USB_VENDOR_ID_LD, USB_DEVICE_ID_NETWORKANALYSER, HID_QUIRK_IGNORE }, 1506 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_COM3LAB, HID_QUIRK_IGNORE },
1504 { USB_VENDOR_ID_LD, USB_DEVICE_ID_POWERCONTROL, HID_QUIRK_IGNORE }, 1507 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_TELEPORT, HID_QUIRK_IGNORE },
1508 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER, HID_QUIRK_IGNORE },
1509 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL, HID_QUIRK_IGNORE },
1510 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST, HID_QUIRK_IGNORE },
1505 { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE }, 1511 { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE },
1506 { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE }, 1512 { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE },
1507 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE }, 1513 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index 6649531fa824..8ba6a701e9c1 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -141,7 +141,7 @@ source "drivers/usb/misc/sisusbvga/Kconfig"
141 141
142config USB_LD 142config USB_LD
143 tristate "USB LD driver" 143 tristate "USB LD driver"
144 depends on USB && EXPERIMENTAL 144 depends on USB
145 help 145 help
146 This driver is for generic USB devices that use interrupt transfers, 146 This driver is for generic USB devices that use interrupt transfers,
147 like LD Didactic's USB devices. 147 like LD Didactic's USB devices.
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 331d4ae949ed..e2d1198623eb 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -24,6 +24,7 @@
24 * V0.1 (mh) Initial version 24 * V0.1 (mh) Initial version
25 * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint) 25 * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint)
26 * V0.12 (mh) Added kmalloc check for string buffer 26 * V0.12 (mh) Added kmalloc check for string buffer
27 * V0.13 (mh) Added support for LD X-Ray and Machine Test System
27 */ 28 */
28 29
29#include <linux/config.h> 30#include <linux/config.h>
@@ -40,17 +41,20 @@
40 41
41/* Define these values to match your devices */ 42/* Define these values to match your devices */
42#define USB_VENDOR_ID_LD 0x0f11 /* USB Vendor ID of LD Didactic GmbH */ 43#define USB_VENDOR_ID_LD 0x0f11 /* USB Vendor ID of LD Didactic GmbH */
43#define USB_DEVICE_ID_CASSY 0x1000 /* USB Product ID for all CASSY-S modules */ 44#define USB_DEVICE_ID_LD_CASSY 0x1000 /* USB Product ID of CASSY-S */
44#define USB_DEVICE_ID_POCKETCASSY 0x1010 /* USB Product ID for Pocket-CASSY */ 45#define USB_DEVICE_ID_LD_POCKETCASSY 0x1010 /* USB Product ID of Pocket-CASSY */
45#define USB_DEVICE_ID_MOBILECASSY 0x1020 /* USB Product ID for Mobile-CASSY */ 46#define USB_DEVICE_ID_LD_MOBILECASSY 0x1020 /* USB Product ID of Mobile-CASSY */
46#define USB_DEVICE_ID_JWM 0x1080 /* USB Product ID for Joule and Wattmeter */ 47#define USB_DEVICE_ID_LD_JWM 0x1080 /* USB Product ID of Joule and Wattmeter */
47#define USB_DEVICE_ID_DMMP 0x1081 /* USB Product ID for Digital Multimeter P (reserved) */ 48#define USB_DEVICE_ID_LD_DMMP 0x1081 /* USB Product ID of Digital Multimeter P (reserved) */
48#define USB_DEVICE_ID_UMIP 0x1090 /* USB Product ID for UMI P */ 49#define USB_DEVICE_ID_LD_UMIP 0x1090 /* USB Product ID of UMI P */
49#define USB_DEVICE_ID_VIDEOCOM 0x1200 /* USB Product ID for VideoCom */ 50#define USB_DEVICE_ID_LD_XRAY1 0x1100 /* USB Product ID of X-Ray Apparatus */
50#define USB_DEVICE_ID_COM3LAB 0x2000 /* USB Product ID for COM3LAB */ 51#define USB_DEVICE_ID_LD_XRAY2 0x1101 /* USB Product ID of X-Ray Apparatus */
51#define USB_DEVICE_ID_TELEPORT 0x2010 /* USB Product ID for Terminal Adapter */ 52#define USB_DEVICE_ID_LD_VIDEOCOM 0x1200 /* USB Product ID of VideoCom */
52#define USB_DEVICE_ID_NETWORKANALYSER 0x2020 /* USB Product ID for Network Analyser */ 53#define USB_DEVICE_ID_LD_COM3LAB 0x2000 /* USB Product ID of COM3LAB */
53#define USB_DEVICE_ID_POWERCONTROL 0x2030 /* USB Product ID for Controlling device for Power Electronics */ 54#define USB_DEVICE_ID_LD_TELEPORT 0x2010 /* USB Product ID of Terminal Adapter */
55#define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020 /* USB Product ID of Network Analyser */
56#define USB_DEVICE_ID_LD_POWERCONTROL 0x2030 /* USB Product ID of Converter Control Unit */
57#define USB_DEVICE_ID_LD_MACHINETEST 0x2040 /* USB Product ID of Machine Test System */
54 58
55#define USB_VENDOR_ID_VERNIER 0x08f7 59#define USB_VENDOR_ID_VERNIER 0x08f7
56#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 60#define USB_DEVICE_ID_VERNIER_LABPRO 0x0001
@@ -67,17 +71,20 @@
67 71
68/* table of devices that work with this driver */ 72/* table of devices that work with this driver */
69static struct usb_device_id ld_usb_table [] = { 73static struct usb_device_id ld_usb_table [] = {
70 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_CASSY) }, 74 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) },
71 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_POCKETCASSY) }, 75 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) },
72 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_MOBILECASSY) }, 76 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY) },
73 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_JWM) }, 77 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) },
74 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_DMMP) }, 78 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) },
75 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_UMIP) }, 79 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) },
76 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_VIDEOCOM) }, 80 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY1) },
77 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_COM3LAB) }, 81 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY2) },
78 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_TELEPORT) }, 82 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_VIDEOCOM) },
79 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_NETWORKANALYSER) }, 83 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_COM3LAB) },
80 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_POWERCONTROL) }, 84 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_TELEPORT) },
85 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER) },
86 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL) },
87 { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST) },
81 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) }, 88 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
82 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) }, 89 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
83 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) }, 90 { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
@@ -85,7 +92,7 @@ static struct usb_device_id ld_usb_table [] = {
85 { } /* Terminating entry */ 92 { } /* Terminating entry */
86}; 93};
87MODULE_DEVICE_TABLE(usb, ld_usb_table); 94MODULE_DEVICE_TABLE(usb, ld_usb_table);
88MODULE_VERSION("V0.12"); 95MODULE_VERSION("V0.13");
89MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>"); 96MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");
90MODULE_DESCRIPTION("LD USB Driver"); 97MODULE_DESCRIPTION("LD USB Driver");
91MODULE_LICENSE("GPL"); 98MODULE_LICENSE("GPL");
@@ -632,8 +639,8 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
632 639
633 /* workaround for early firmware versions on fast computers */ 640 /* workaround for early firmware versions on fast computers */
634 if ((le16_to_cpu(udev->descriptor.idVendor) == USB_VENDOR_ID_LD) && 641 if ((le16_to_cpu(udev->descriptor.idVendor) == USB_VENDOR_ID_LD) &&
635 ((le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_CASSY) || 642 ((le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_LD_CASSY) ||
636 (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) && 643 (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_LD_COM3LAB)) &&
637 (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) { 644 (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) {
638 buffer = kmalloc(256, GFP_KERNEL); 645 buffer = kmalloc(256, GFP_KERNEL);
639 if (buffer == NULL) { 646 if (buffer == NULL) {
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index e8e575e037c1..37c81c08faad 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -73,9 +73,10 @@ static struct usb_device_id id_table [] = {
73 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) }, 73 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) },
74 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X75) }, 74 { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X75) },
75 { USB_DEVICE(SYNTECH_VENDOR_ID, SYNTECH_PRODUCT_ID) }, 75 { USB_DEVICE(SYNTECH_VENDOR_ID, SYNTECH_PRODUCT_ID) },
76 { USB_DEVICE(NOKIA_CA42_VENDOR_ID, NOKIA_CA42_PRODUCT_ID ) }, 76 { USB_DEVICE(NOKIA_CA42_VENDOR_ID, NOKIA_CA42_PRODUCT_ID) },
77 { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID ) }, 77 { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID) },
78 { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) }, 78 { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) },
79 { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) },
79 { } /* Terminating entry */ 80 { } /* Terminating entry */
80}; 81};
81 82
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index 1807087a76e3..9bc4755162ad 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -71,3 +71,7 @@
71 71
72#define SAGEM_VENDOR_ID 0x079b 72#define SAGEM_VENDOR_ID 0x079b
73#define SAGEM_PRODUCT_ID 0x0027 73#define SAGEM_PRODUCT_ID 0x0027
74
75/* Leadtek GPS 9531 (ID 0413:2101) */
76#define LEADTEK_VENDOR_ID 0x0413
77#define LEADTEK_9531_PRODUCT_ID 0x2101
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index ee958f986eb8..e71c5ca1a07b 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -106,6 +106,13 @@ UNUSUAL_DEV( 0x0411, 0x001c, 0x0113, 0x0113,
106 US_SC_DEVICE, US_PR_DEVICE, NULL, 106 US_SC_DEVICE, US_PR_DEVICE, NULL,
107 US_FL_FIX_INQUIRY ), 107 US_FL_FIX_INQUIRY ),
108 108
109/* Reported by Christian Leber <christian@leber.de> */
110UNUSUAL_DEV( 0x0419, 0xaaf5, 0x0100, 0x0100,
111 "TrekStor",
112 "i.Beat 115 2.0",
113 US_SC_DEVICE, US_PR_DEVICE, NULL,
114 US_FL_IGNORE_RESIDUE | US_FL_NOT_LOCKABLE ),
115
109/* Reported by Stefan Werner <dustbln@gmx.de> */ 116/* Reported by Stefan Werner <dustbln@gmx.de> */
110UNUSUAL_DEV( 0x0419, 0xaaf6, 0x0100, 0x0100, 117UNUSUAL_DEV( 0x0419, 0xaaf6, 0x0100, 0x0100,
111 "TrekStor", 118 "TrekStor",
@@ -127,6 +134,14 @@ UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100,
127 US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), 134 US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ),
128#endif 135#endif
129 136
137/* Patch submitted by Daniel Drake <dsd@gentoo.org>
138 * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */
139UNUSUAL_DEV( 0x0451, 0x5416, 0x0100, 0x0100,
140 "Neuros Audio",
141 "USB 2.0 HD 2.5",
142 US_SC_DEVICE, US_PR_BULK, NULL,
143 US_FL_NEED_OVERRIDE ),
144
130/* 145/*
131 * Pete Zaitcev <zaitcev@yahoo.com>, from Patrick C. F. Ernzer, bz#162559. 146 * Pete Zaitcev <zaitcev@yahoo.com>, from Patrick C. F. Ernzer, bz#162559.
132 * The key does not actually break, but it returns zero sense which 147 * The key does not actually break, but it returns zero sense which
@@ -137,13 +152,16 @@ UNUSUAL_DEV( 0x0457, 0x0150, 0x0100, 0x0100,
137 "USB Mass Storage Device", 152 "USB Mass Storage Device",
138 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), 153 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ),
139 154
140/* Patch submitted by Daniel Drake <dsd@gentoo.org> 155/*
141 * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */ 156* Bohdan Linda <bohdan.linda@gmail.com>
142UNUSUAL_DEV( 0x0451, 0x5416, 0x0100, 0x0100, 157* 1GB USB sticks MyFlash High Speed. I have restricted
143 "Neuros Audio", 158* the revision to my model only
144 "USB 2.0 HD 2.5", 159*/
145 US_SC_DEVICE, US_PR_BULK, NULL, 160UNUSUAL_DEV( 0x0457, 0x0151, 0x0100, 0x0100,
146 US_FL_NEED_OVERRIDE ), 161 "USB 2.0",
162 "Flash Disk",
163 US_SC_DEVICE, US_PR_DEVICE, NULL,
164 US_FL_NOT_LOCKABLE ),
147 165
148UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101, 166UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101,
149 "Rio", 167 "Rio",
@@ -946,6 +964,12 @@ UNUSUAL_DEV( 0x084d, 0x0011, 0x0110, 0x0110,
946 US_SC_DEVICE, US_PR_DEVICE, NULL, 964 US_SC_DEVICE, US_PR_DEVICE, NULL,
947 US_FL_BULK32), 965 US_FL_BULK32),
948 966
967/* Submitted by Jan De Luyck <lkml@kcore.org> */
968UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000,
969 "CITIZEN",
970 "X1DE-USB",
971 US_SC_DEVICE, US_PR_DEVICE, NULL,
972 US_FL_SINGLE_LUN),
949 973
950/* Entry needed for flags. Moreover, all devices with this ID use 974/* Entry needed for flags. Moreover, all devices with this ID use
951 * bulk-only transport, but _some_ falsely report Control/Bulk instead. 975 * bulk-only transport, but _some_ falsely report Control/Bulk instead.
@@ -1085,6 +1109,13 @@ UNUSUAL_DEV( 0x0dda, 0x0301, 0x0012, 0x0012,
1085 US_SC_DEVICE, US_PR_DEVICE, NULL, 1109 US_SC_DEVICE, US_PR_DEVICE, NULL,
1086 US_FL_IGNORE_RESIDUE ), 1110 US_FL_IGNORE_RESIDUE ),
1087 1111
1112/* Reported by Jim McCloskey <mcclosk@ucsc.edu> */
1113UNUSUAL_DEV( 0x0e21, 0x0520, 0x0100, 0x0100,
1114 "Cowon Systems",
1115 "iAUDIO M5",
1116 US_SC_DEVICE, US_PR_BULK, NULL,
1117 0 ),
1118
1088/* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */ 1119/* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */
1089UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300, 1120UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300,
1090 "USB", 1121 "USB",
@@ -1162,6 +1193,13 @@ UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999,
1162 US_FL_SINGLE_LUN), 1193 US_FL_SINGLE_LUN),
1163#endif 1194#endif
1164 1195
1196/* Reported by Andrew Simmons <andrew.simmons@gmail.com> */
1197UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001,
1198 "DataStor",
1199 "USB4500 FW1.04",
1200 US_SC_DEVICE, US_PR_DEVICE, NULL,
1201 US_FL_FIX_CAPACITY),
1202
1165/* Control/Bulk transport for all SubClass values */ 1203/* Control/Bulk transport for all SubClass values */
1166USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR), 1204USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
1167USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR), 1205USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR),
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 3e153d313bb0..e64ed16bd42f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -525,11 +525,6 @@ config FB_GBE_MEM
525 This is the amount of memory reserved for the framebuffer, 525 This is the amount of memory reserved for the framebuffer,
526 which can be any value between 1MB and 8MB. 526 which can be any value between 1MB and 8MB.
527 527
528config BUS_I2C
529 bool
530 depends on (FB = y) && VISWS
531 default y
532
533config FB_SUN3 528config FB_SUN3
534 bool "Sun3 framebuffer support" 529 bool "Sun3 framebuffer support"
535 depends on (FB = y) && (SUN3 || SUN3X) && BROKEN 530 depends on (FB = y) && (SUN3 || SUN3X) && BROKEN
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index d2dede6ed3e5..996c7b58564e 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1550,6 +1550,7 @@ int fb_get_options(char *name, char **option)
1550 return retval; 1550 return retval;
1551} 1551}
1552 1552
1553#ifndef MODULE
1553/** 1554/**
1554 * video_setup - process command line options 1555 * video_setup - process command line options
1555 * @options: string of options 1556 * @options: string of options
@@ -1593,6 +1594,7 @@ static int __init video_setup(char *options)
1593 return 0; 1594 return 0;
1594} 1595}
1595__setup("video=", video_setup); 1596__setup("video=", video_setup);
1597#endif
1596 1598
1597 /* 1599 /*
1598 * Visible symbols for modules 1600 * Visible symbols for modules
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 747602aa5615..b85e2b180a44 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1334,6 +1334,12 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
1334 struct neofb_par *par = info->par; 1334 struct neofb_par *par = info->par;
1335 int seqflags, lcdflags, dpmsflags, reg; 1335 int seqflags, lcdflags, dpmsflags, reg;
1336 1336
1337 /*
1338 * Reload the value stored in the register, might have been changed via
1339 * FN keystroke
1340 */
1341 par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03;
1342
1337 switch (blank_mode) { 1343 switch (blank_mode) {
1338 case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */ 1344 case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */
1339 seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ 1345 seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
@@ -1366,7 +1372,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
1366 case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */ 1372 case FB_BLANK_NORMAL: /* just blank screen (backlight stays on) */
1367 seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */ 1373 seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
1368 lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */ 1374 lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */
1369 dpmsflags = 0; /* no hsync/vsync suppression */ 1375 dpmsflags = 0x00; /* no hsync/vsync suppression */
1370 break; 1376 break;
1371 case FB_BLANK_UNBLANK: /* unblank */ 1377 case FB_BLANK_UNBLANK: /* unblank */
1372 seqflags = 0; /* Enable sequencer */ 1378 seqflags = 0; /* Enable sequencer */
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index dbcb8962e57d..a7c4e5e8ead6 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -138,6 +138,8 @@ static struct pci_device_id nvidiafb_pci_tbl[] = {
138 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 138 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
139 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X, 139 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X,
140 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 140 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
141 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000,
142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
141 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO, 143 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO,
142 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 144 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
143 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO, 145 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO,
diff --git a/fs/compat.c b/fs/compat.c
index 70c5af4cc270..a2ba78bdf7f7 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1751,11 +1751,15 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
1751 ret = compat_core_sys_select(n, inp, outp, exp, &timeout); 1751 ret = compat_core_sys_select(n, inp, outp, exp, &timeout);
1752 1752
1753 if (tvp) { 1753 if (tvp) {
1754 struct compat_timeval rtv;
1755
1754 if (current->personality & STICKY_TIMEOUTS) 1756 if (current->personality & STICKY_TIMEOUTS)
1755 goto sticky; 1757 goto sticky;
1756 tv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); 1758 rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
1757 tv.tv_sec = timeout; 1759 rtv.tv_sec = timeout;
1758 if (copy_to_user(tvp, &tv, sizeof(tv))) { 1760 if (compat_timeval_compare(&rtv, &tv) < 0)
1761 rtv = tv;
1762 if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
1759sticky: 1763sticky:
1760 /* 1764 /*
1761 * If an application puts its timeval in read-only 1765 * If an application puts its timeval in read-only
@@ -1822,13 +1826,17 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
1822 } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec)); 1826 } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec));
1823 1827
1824 if (tsp && !(current->personality & STICKY_TIMEOUTS)) { 1828 if (tsp && !(current->personality & STICKY_TIMEOUTS)) {
1825 ts.tv_sec += timeout / HZ; 1829 struct compat_timespec rts;
1826 ts.tv_nsec += (timeout % HZ) * (1000000000/HZ); 1830
1827 if (ts.tv_nsec >= 1000000000) { 1831 rts.tv_sec = timeout / HZ;
1828 ts.tv_sec++; 1832 rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ);
1829 ts.tv_nsec -= 1000000000; 1833 if (rts.tv_nsec >= NSEC_PER_SEC) {
1834 rts.tv_sec++;
1835 rts.tv_nsec -= NSEC_PER_SEC;
1830 } 1836 }
1831 (void)copy_to_user(tsp, &ts, sizeof(ts)); 1837 if (compat_timespec_compare(&rts, &ts) < 0)
1838 rts = ts;
1839 copy_to_user(tsp, &rts, sizeof(rts));
1832 } 1840 }
1833 1841
1834 if (ret == -ERESTARTNOHAND) { 1842 if (ret == -ERESTARTNOHAND) {
@@ -1918,12 +1926,17 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
1918 sigprocmask(SIG_SETMASK, &sigsaved, NULL); 1926 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
1919 1927
1920 if (tsp && timeout >= 0) { 1928 if (tsp && timeout >= 0) {
1929 struct compat_timespec rts;
1930
1921 if (current->personality & STICKY_TIMEOUTS) 1931 if (current->personality & STICKY_TIMEOUTS)
1922 goto sticky; 1932 goto sticky;
1923 /* Yes, we know it's actually an s64, but it's also positive. */ 1933 /* Yes, we know it's actually an s64, but it's also positive. */
1924 ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000; 1934 rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
1925 ts.tv_sec = timeout; 1935 1000;
1926 if (copy_to_user(tsp, &ts, sizeof(ts))) { 1936 rts.tv_sec = timeout;
1937 if (compat_timespec_compare(&rts, &ts) < 0)
1938 rts = ts;
1939 if (copy_to_user(tsp, &rts, sizeof(rts))) {
1927sticky: 1940sticky:
1928 /* 1941 /*
1929 * If an application puts its timeval in read-only 1942 * If an application puts its timeval in read-only
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index e6265a0b56b8..543ed543d1e5 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -24,75 +24,29 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
26/* 26/*
27 * Unlink a buffer from a transaction checkpoint list. 27 * Unlink a buffer from a transaction.
28 * 28 *
29 * Called with j_list_lock held. 29 * Called with j_list_lock held.
30 */ 30 */
31 31
32static void __buffer_unlink_first(struct journal_head *jh) 32static inline void __buffer_unlink(struct journal_head *jh)
33{ 33{
34 transaction_t *transaction; 34 transaction_t *transaction;
35 35
36 transaction = jh->b_cp_transaction; 36 transaction = jh->b_cp_transaction;
37 jh->b_cp_transaction = NULL;
37 38
38 jh->b_cpnext->b_cpprev = jh->b_cpprev; 39 jh->b_cpnext->b_cpprev = jh->b_cpprev;
39 jh->b_cpprev->b_cpnext = jh->b_cpnext; 40 jh->b_cpprev->b_cpnext = jh->b_cpnext;
40 if (transaction->t_checkpoint_list == jh) { 41 if (transaction->t_checkpoint_list == jh)
41 transaction->t_checkpoint_list = jh->b_cpnext; 42 transaction->t_checkpoint_list = jh->b_cpnext;
42 if (transaction->t_checkpoint_list == jh) 43 if (transaction->t_checkpoint_list == jh)
43 transaction->t_checkpoint_list = NULL; 44 transaction->t_checkpoint_list = NULL;
44 }
45}
46
47/*
48 * Unlink a buffer from a transaction checkpoint(io) list.
49 *
50 * Called with j_list_lock held.
51 */
52
53static inline void __buffer_unlink(struct journal_head *jh)
54{
55 transaction_t *transaction;
56
57 transaction = jh->b_cp_transaction;
58
59 __buffer_unlink_first(jh);
60 if (transaction->t_checkpoint_io_list == jh) {
61 transaction->t_checkpoint_io_list = jh->b_cpnext;
62 if (transaction->t_checkpoint_io_list == jh)
63 transaction->t_checkpoint_io_list = NULL;
64 }
65}
66
67/*
68 * Move a buffer from the checkpoint list to the checkpoint io list
69 *
70 * Called with j_list_lock held
71 */
72
73static inline void __buffer_relink_io(struct journal_head *jh)
74{
75 transaction_t *transaction;
76
77 transaction = jh->b_cp_transaction;
78 __buffer_unlink_first(jh);
79
80 if (!transaction->t_checkpoint_io_list) {
81 jh->b_cpnext = jh->b_cpprev = jh;
82 } else {
83 jh->b_cpnext = transaction->t_checkpoint_io_list;
84 jh->b_cpprev = transaction->t_checkpoint_io_list->b_cpprev;
85 jh->b_cpprev->b_cpnext = jh;
86 jh->b_cpnext->b_cpprev = jh;
87 }
88 transaction->t_checkpoint_io_list = jh;
89} 45}
90 46
91/* 47/*
92 * Try to release a checkpointed buffer from its transaction. 48 * Try to release a checkpointed buffer from its transaction.
93 * Returns 1 if we released it and 2 if we also released the 49 * Returns 1 if we released it.
94 * whole transaction.
95 *
96 * Requires j_list_lock 50 * Requires j_list_lock
97 * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it 51 * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
98 */ 52 */
@@ -103,11 +57,12 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
103 57
104 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) { 58 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) {
105 JBUFFER_TRACE(jh, "remove from checkpoint list"); 59 JBUFFER_TRACE(jh, "remove from checkpoint list");
106 ret = __journal_remove_checkpoint(jh) + 1; 60 __journal_remove_checkpoint(jh);
107 jbd_unlock_bh_state(bh); 61 jbd_unlock_bh_state(bh);
108 journal_remove_journal_head(bh); 62 journal_remove_journal_head(bh);
109 BUFFER_TRACE(bh, "release"); 63 BUFFER_TRACE(bh, "release");
110 __brelse(bh); 64 __brelse(bh);
65 ret = 1;
111 } else { 66 } else {
112 jbd_unlock_bh_state(bh); 67 jbd_unlock_bh_state(bh);
113 } 68 }
@@ -162,53 +117,83 @@ static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
162} 117}
163 118
164/* 119/*
165 * Clean up transaction's list of buffers submitted for io. 120 * Clean up a transaction's checkpoint list.
166 * We wait for any pending IO to complete and remove any clean 121 *
167 * buffers. Note that we take the buffers in the opposite ordering 122 * We wait for any pending IO to complete and make sure any clean
168 * from the one in which they were submitted for IO. 123 * buffers are removed from the transaction.
124 *
125 * Return 1 if we performed any actions which might have destroyed the
126 * checkpoint. (journal_remove_checkpoint() deletes the transaction when
127 * the last checkpoint buffer is cleansed)
169 * 128 *
170 * Called with j_list_lock held. 129 * Called with j_list_lock held.
171 */ 130 */
172 131static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
173static void __wait_cp_io(journal_t *journal, transaction_t *transaction)
174{ 132{
175 struct journal_head *jh; 133 struct journal_head *jh, *next_jh, *last_jh;
176 struct buffer_head *bh; 134 struct buffer_head *bh;
177 tid_t this_tid; 135 int ret = 0;
178 int released = 0; 136
179 137 assert_spin_locked(&journal->j_list_lock);
180 this_tid = transaction->t_tid; 138 jh = transaction->t_checkpoint_list;
181restart: 139 if (!jh)
182 /* Didn't somebody clean up the transaction in the meanwhile */ 140 return 0;
183 if (journal->j_checkpoint_transactions != transaction || 141
184 transaction->t_tid != this_tid) 142 last_jh = jh->b_cpprev;
185 return; 143 next_jh = jh;
186 while (!released && transaction->t_checkpoint_io_list) { 144 do {
187 jh = transaction->t_checkpoint_io_list; 145 jh = next_jh;
188 bh = jh2bh(jh); 146 bh = jh2bh(jh);
189 if (!jbd_trylock_bh_state(bh)) {
190 jbd_sync_bh(journal, bh);
191 spin_lock(&journal->j_list_lock);
192 goto restart;
193 }
194 if (buffer_locked(bh)) { 147 if (buffer_locked(bh)) {
195 atomic_inc(&bh->b_count); 148 atomic_inc(&bh->b_count);
196 spin_unlock(&journal->j_list_lock); 149 spin_unlock(&journal->j_list_lock);
197 jbd_unlock_bh_state(bh);
198 wait_on_buffer(bh); 150 wait_on_buffer(bh);
199 /* the journal_head may have gone by now */ 151 /* the journal_head may have gone by now */
200 BUFFER_TRACE(bh, "brelse"); 152 BUFFER_TRACE(bh, "brelse");
201 __brelse(bh); 153 __brelse(bh);
202 spin_lock(&journal->j_list_lock); 154 goto out_return_1;
203 goto restart;
204 } 155 }
156
205 /* 157 /*
206 * Now in whatever state the buffer currently is, we know that 158 * This is foul
207 * it has been written out and so we can drop it from the list
208 */ 159 */
209 released = __journal_remove_checkpoint(jh); 160 if (!jbd_trylock_bh_state(bh)) {
210 jbd_unlock_bh_state(bh); 161 jbd_sync_bh(journal, bh);
211 } 162 goto out_return_1;
163 }
164
165 if (jh->b_transaction != NULL) {
166 transaction_t *t = jh->b_transaction;
167 tid_t tid = t->t_tid;
168
169 spin_unlock(&journal->j_list_lock);
170 jbd_unlock_bh_state(bh);
171 log_start_commit(journal, tid);
172 log_wait_commit(journal, tid);
173 goto out_return_1;
174 }
175
176 /*
177 * AKPM: I think the buffer_jbddirty test is redundant - it
178 * shouldn't have NULL b_transaction?
179 */
180 next_jh = jh->b_cpnext;
181 if (!buffer_dirty(bh) && !buffer_jbddirty(bh)) {
182 BUFFER_TRACE(bh, "remove from checkpoint");
183 __journal_remove_checkpoint(jh);
184 jbd_unlock_bh_state(bh);
185 journal_remove_journal_head(bh);
186 __brelse(bh);
187 ret = 1;
188 } else {
189 jbd_unlock_bh_state(bh);
190 }
191 } while (jh != last_jh);
192
193 return ret;
194out_return_1:
195 spin_lock(&journal->j_list_lock);
196 return 1;
212} 197}
213 198
214#define NR_BATCH 64 199#define NR_BATCH 64
@@ -218,7 +203,9 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
218{ 203{
219 int i; 204 int i;
220 205
206 spin_unlock(&journal->j_list_lock);
221 ll_rw_block(SWRITE, *batch_count, bhs); 207 ll_rw_block(SWRITE, *batch_count, bhs);
208 spin_lock(&journal->j_list_lock);
222 for (i = 0; i < *batch_count; i++) { 209 for (i = 0; i < *batch_count; i++) {
223 struct buffer_head *bh = bhs[i]; 210 struct buffer_head *bh = bhs[i];
224 clear_buffer_jwrite(bh); 211 clear_buffer_jwrite(bh);
@@ -234,46 +221,19 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
234 * Return 1 if something happened which requires us to abort the current 221 * Return 1 if something happened which requires us to abort the current
235 * scan of the checkpoint list. 222 * scan of the checkpoint list.
236 * 223 *
237 * Called with j_list_lock held and drops it if 1 is returned 224 * Called with j_list_lock held.
238 * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it 225 * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
239 */ 226 */
240static int __process_buffer(journal_t *journal, struct journal_head *jh, 227static int __flush_buffer(journal_t *journal, struct journal_head *jh,
241 struct buffer_head **bhs, int *batch_count) 228 struct buffer_head **bhs, int *batch_count,
229 int *drop_count)
242{ 230{
243 struct buffer_head *bh = jh2bh(jh); 231 struct buffer_head *bh = jh2bh(jh);
244 int ret = 0; 232 int ret = 0;
245 233
246 if (buffer_locked(bh)) { 234 if (buffer_dirty(bh) && !buffer_locked(bh) && jh->b_jlist == BJ_None) {
247 get_bh(bh); 235 J_ASSERT_JH(jh, jh->b_transaction == NULL);
248 spin_unlock(&journal->j_list_lock);
249 jbd_unlock_bh_state(bh);
250 wait_on_buffer(bh);
251 /* the journal_head may have gone by now */
252 BUFFER_TRACE(bh, "brelse");
253 put_bh(bh);
254 ret = 1;
255 }
256 else if (jh->b_transaction != NULL) {
257 transaction_t *t = jh->b_transaction;
258 tid_t tid = t->t_tid;
259 236
260 spin_unlock(&journal->j_list_lock);
261 jbd_unlock_bh_state(bh);
262 log_start_commit(journal, tid);
263 log_wait_commit(journal, tid);
264 ret = 1;
265 }
266 else if (!buffer_dirty(bh)) {
267 J_ASSERT_JH(jh, !buffer_jbddirty(bh));
268 BUFFER_TRACE(bh, "remove from checkpoint");
269 __journal_remove_checkpoint(jh);
270 spin_unlock(&journal->j_list_lock);
271 jbd_unlock_bh_state(bh);
272 journal_remove_journal_head(bh);
273 put_bh(bh);
274 ret = 1;
275 }
276 else {
277 /* 237 /*
278 * Important: we are about to write the buffer, and 238 * Important: we are about to write the buffer, and
279 * possibly block, while still holding the journal lock. 239 * possibly block, while still holding the journal lock.
@@ -286,30 +246,45 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
286 J_ASSERT_BH(bh, !buffer_jwrite(bh)); 246 J_ASSERT_BH(bh, !buffer_jwrite(bh));
287 set_buffer_jwrite(bh); 247 set_buffer_jwrite(bh);
288 bhs[*batch_count] = bh; 248 bhs[*batch_count] = bh;
289 __buffer_relink_io(jh);
290 jbd_unlock_bh_state(bh); 249 jbd_unlock_bh_state(bh);
291 (*batch_count)++; 250 (*batch_count)++;
292 if (*batch_count == NR_BATCH) { 251 if (*batch_count == NR_BATCH) {
293 spin_unlock(&journal->j_list_lock);
294 __flush_batch(journal, bhs, batch_count); 252 __flush_batch(journal, bhs, batch_count);
295 ret = 1; 253 ret = 1;
296 } 254 }
255 } else {
256 int last_buffer = 0;
257 if (jh->b_cpnext == jh) {
258 /* We may be about to drop the transaction. Tell the
259 * caller that the lists have changed.
260 */
261 last_buffer = 1;
262 }
263 if (__try_to_free_cp_buf(jh)) {
264 (*drop_count)++;
265 ret = last_buffer;
266 }
297 } 267 }
298 return ret; 268 return ret;
299} 269}
300 270
301/* 271/*
302 * Perform an actual checkpoint. We take the first transaction on the 272 * Perform an actual checkpoint. We don't write out only enough to
303 * list of transactions to be checkpointed and send all its buffers 273 * satisfy the current blocked requests: rather we submit a reasonably
304 * to disk. We submit larger chunks of data at once. 274 * sized chunk of the outstanding data to disk at once for
275 * efficiency. __log_wait_for_space() will retry if we didn't free enough.
305 * 276 *
277 * However, we _do_ take into account the amount requested so that once
278 * the IO has been queued, we can return as soon as enough of it has
279 * completed to disk.
280 *
306 * The journal should be locked before calling this function. 281 * The journal should be locked before calling this function.
307 */ 282 */
308int log_do_checkpoint(journal_t *journal) 283int log_do_checkpoint(journal_t *journal)
309{ 284{
310 transaction_t *transaction;
311 tid_t this_tid;
312 int result; 285 int result;
286 int batch_count = 0;
287 struct buffer_head *bhs[NR_BATCH];
313 288
314 jbd_debug(1, "Start checkpoint\n"); 289 jbd_debug(1, "Start checkpoint\n");
315 290
@@ -324,70 +299,79 @@ int log_do_checkpoint(journal_t *journal)
324 return result; 299 return result;
325 300
326 /* 301 /*
327 * OK, we need to start writing disk blocks. Take one transaction 302 * OK, we need to start writing disk blocks. Try to free up a
328 * and write it. 303 * quarter of the log in a single checkpoint if we can.
329 */ 304 */
330 spin_lock(&journal->j_list_lock);
331 if (!journal->j_checkpoint_transactions)
332 goto out;
333 transaction = journal->j_checkpoint_transactions;
334 this_tid = transaction->t_tid;
335restart:
336 /* 305 /*
337 * If someone cleaned up this transaction while we slept, we're 306 * AKPM: check this code. I had a feeling a while back that it
338 * done (maybe it's a new transaction, but it fell at the same 307 * degenerates into a busy loop at unmount time.
339 * address).
340 */ 308 */
341 if (journal->j_checkpoint_transactions == transaction && 309 spin_lock(&journal->j_list_lock);
342 transaction->t_tid == this_tid) { 310 while (journal->j_checkpoint_transactions) {
343 int batch_count = 0; 311 transaction_t *transaction;
344 struct buffer_head *bhs[NR_BATCH]; 312 struct journal_head *jh, *last_jh, *next_jh;
345 struct journal_head *jh; 313 int drop_count = 0;
346 int retry = 0; 314 int cleanup_ret, retry = 0;
347 315 tid_t this_tid;
348 while (!retry && transaction->t_checkpoint_list) { 316
317 transaction = journal->j_checkpoint_transactions;
318 this_tid = transaction->t_tid;
319 jh = transaction->t_checkpoint_list;
320 last_jh = jh->b_cpprev;
321 next_jh = jh;
322 do {
349 struct buffer_head *bh; 323 struct buffer_head *bh;
350 324
351 jh = transaction->t_checkpoint_list; 325 jh = next_jh;
326 next_jh = jh->b_cpnext;
352 bh = jh2bh(jh); 327 bh = jh2bh(jh);
353 if (!jbd_trylock_bh_state(bh)) { 328 if (!jbd_trylock_bh_state(bh)) {
354 jbd_sync_bh(journal, bh); 329 jbd_sync_bh(journal, bh);
330 spin_lock(&journal->j_list_lock);
355 retry = 1; 331 retry = 1;
356 break; 332 break;
357 } 333 }
358 retry = __process_buffer(journal, jh, bhs, 334 retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count);
359 &batch_count); 335 if (cond_resched_lock(&journal->j_list_lock)) {
360 if (!retry &&
361 lock_need_resched(&journal->j_list_lock)) {
362 spin_unlock(&journal->j_list_lock);
363 retry = 1; 336 retry = 1;
364 break; 337 break;
365 } 338 }
366 } 339 } while (jh != last_jh && !retry);
367 340
368 if (batch_count) { 341 if (batch_count) {
369 if (!retry) {
370 spin_unlock(&journal->j_list_lock);
371 retry = 1;
372 }
373 __flush_batch(journal, bhs, &batch_count); 342 __flush_batch(journal, bhs, &batch_count);
343 retry = 1;
374 } 344 }
375 345
376 if (retry) {
377 spin_lock(&journal->j_list_lock);
378 goto restart;
379 }
380 /* 346 /*
381 * Now we have cleaned up the first transaction's checkpoint 347 * If someone cleaned up this transaction while we slept, we're
382 * list. Let's clean up the second one. 348 * done
349 */
350 if (journal->j_checkpoint_transactions != transaction)
351 break;
352 if (retry)
353 continue;
354 /*
355 * Maybe it's a new transaction, but it fell at the same
356 * address
383 */ 357 */
384 __wait_cp_io(journal, transaction); 358 if (transaction->t_tid != this_tid)
359 continue;
360 /*
361 * We have walked the whole transaction list without
362 * finding anything to write to disk. We had better be
363 * able to make some progress or we are in trouble.
364 */
365 cleanup_ret = __cleanup_transaction(journal, transaction);
366 J_ASSERT(drop_count != 0 || cleanup_ret != 0);
367 if (journal->j_checkpoint_transactions != transaction)
368 break;
385 } 369 }
386out:
387 spin_unlock(&journal->j_list_lock); 370 spin_unlock(&journal->j_list_lock);
388 result = cleanup_journal_tail(journal); 371 result = cleanup_journal_tail(journal);
389 if (result < 0) 372 if (result < 0)
390 return result; 373 return result;
374
391 return 0; 375 return 0;
392} 376}
393 377
@@ -472,91 +456,52 @@ int cleanup_journal_tail(journal_t *journal)
472/* Checkpoint list management */ 456/* Checkpoint list management */
473 457
474/* 458/*
475 * journal_clean_one_cp_list
476 *
477 * Find all the written-back checkpoint buffers in the given list and release them.
478 *
479 * Called with the journal locked.
480 * Called with j_list_lock held.
481 * Returns number of bufers reaped (for debug)
482 */
483
484static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
485{
486 struct journal_head *last_jh;
487 struct journal_head *next_jh = jh;
488 int ret, freed = 0;
489
490 *released = 0;
491 if (!jh)
492 return 0;
493
494 last_jh = jh->b_cpprev;
495 do {
496 jh = next_jh;
497 next_jh = jh->b_cpnext;
498 /* Use trylock because of the ranking */
499 if (jbd_trylock_bh_state(jh2bh(jh))) {
500 ret = __try_to_free_cp_buf(jh);
501 if (ret) {
502 freed++;
503 if (ret == 2) {
504 *released = 1;
505 return freed;
506 }
507 }
508 }
509 /*
510 * This function only frees up some memory if possible so we
511 * dont have an obligation to finish processing. Bail out if
512 * preemption requested:
513 */
514 if (need_resched())
515 return freed;
516 } while (jh != last_jh);
517
518 return freed;
519}
520
521/*
522 * journal_clean_checkpoint_list 459 * journal_clean_checkpoint_list
523 * 460 *
524 * Find all the written-back checkpoint buffers in the journal and release them. 461 * Find all the written-back checkpoint buffers in the journal and release them.
525 * 462 *
526 * Called with the journal locked. 463 * Called with the journal locked.
527 * Called with j_list_lock held. 464 * Called with j_list_lock held.
528 * Returns number of buffers reaped (for debug) 465 * Returns number of bufers reaped (for debug)
529 */ 466 */
530 467
531int __journal_clean_checkpoint_list(journal_t *journal) 468int __journal_clean_checkpoint_list(journal_t *journal)
532{ 469{
533 transaction_t *transaction, *last_transaction, *next_transaction; 470 transaction_t *transaction, *last_transaction, *next_transaction;
534 int ret = 0, released; 471 int ret = 0;
535 472
536 transaction = journal->j_checkpoint_transactions; 473 transaction = journal->j_checkpoint_transactions;
537 if (!transaction) 474 if (transaction == 0)
538 goto out; 475 goto out;
539 476
540 last_transaction = transaction->t_cpprev; 477 last_transaction = transaction->t_cpprev;
541 next_transaction = transaction; 478 next_transaction = transaction;
542 do { 479 do {
480 struct journal_head *jh;
481
543 transaction = next_transaction; 482 transaction = next_transaction;
544 next_transaction = transaction->t_cpnext; 483 next_transaction = transaction->t_cpnext;
545 ret += journal_clean_one_cp_list(transaction-> 484 jh = transaction->t_checkpoint_list;
546 t_checkpoint_list, &released); 485 if (jh) {
547 if (need_resched()) 486 struct journal_head *last_jh = jh->b_cpprev;
548 goto out; 487 struct journal_head *next_jh = jh;
549 if (released) 488
550 continue; 489 do {
551 /* 490 jh = next_jh;
552 * It is essential that we are as careful as in the case of 491 next_jh = jh->b_cpnext;
553 * t_checkpoint_list with removing the buffer from the list as 492 /* Use trylock because of the ranknig */
554 * we can possibly see not yet submitted buffers on io_list 493 if (jbd_trylock_bh_state(jh2bh(jh)))
555 */ 494 ret += __try_to_free_cp_buf(jh);
556 ret += journal_clean_one_cp_list(transaction-> 495 /*
557 t_checkpoint_io_list, &released); 496 * This function only frees up some memory
558 if (need_resched()) 497 * if possible so we dont have an obligation
559 goto out; 498 * to finish processing. Bail out if preemption
499 * requested:
500 */
501 if (need_resched())
502 goto out;
503 } while (jh != last_jh);
504 }
560 } while (transaction != last_transaction); 505 } while (transaction != last_transaction);
561out: 506out:
562 return ret; 507 return ret;
@@ -571,22 +516,18 @@ out:
571 * buffer updates committed in that transaction have safely been stored 516 * buffer updates committed in that transaction have safely been stored
572 * elsewhere on disk. To achieve this, all of the buffers in a 517 * elsewhere on disk. To achieve this, all of the buffers in a
573 * transaction need to be maintained on the transaction's checkpoint 518 * transaction need to be maintained on the transaction's checkpoint
574 * lists until they have been rewritten, at which point this function is 519 * list until they have been rewritten, at which point this function is
575 * called to remove the buffer from the existing transaction's 520 * called to remove the buffer from the existing transaction's
576 * checkpoint lists. 521 * checkpoint list.
577 *
578 * The function returns 1 if it frees the transaction, 0 otherwise.
579 * 522 *
580 * This function is called with the journal locked. 523 * This function is called with the journal locked.
581 * This function is called with j_list_lock held. 524 * This function is called with j_list_lock held.
582 * This function is called with jbd_lock_bh_state(jh2bh(jh))
583 */ 525 */
584 526
585int __journal_remove_checkpoint(struct journal_head *jh) 527void __journal_remove_checkpoint(struct journal_head *jh)
586{ 528{
587 transaction_t *transaction; 529 transaction_t *transaction;
588 journal_t *journal; 530 journal_t *journal;
589 int ret = 0;
590 531
591 JBUFFER_TRACE(jh, "entry"); 532 JBUFFER_TRACE(jh, "entry");
592 533
@@ -597,10 +538,8 @@ int __journal_remove_checkpoint(struct journal_head *jh)
597 journal = transaction->t_journal; 538 journal = transaction->t_journal;
598 539
599 __buffer_unlink(jh); 540 __buffer_unlink(jh);
600 jh->b_cp_transaction = NULL;
601 541
602 if (transaction->t_checkpoint_list != NULL || 542 if (transaction->t_checkpoint_list != NULL)
603 transaction->t_checkpoint_io_list != NULL)
604 goto out; 543 goto out;
605 JBUFFER_TRACE(jh, "transaction has no more buffers"); 544 JBUFFER_TRACE(jh, "transaction has no more buffers");
606 545
@@ -626,10 +565,8 @@ int __journal_remove_checkpoint(struct journal_head *jh)
626 /* Just in case anybody was waiting for more transactions to be 565 /* Just in case anybody was waiting for more transactions to be
627 checkpointed... */ 566 checkpointed... */
628 wake_up(&journal->j_wait_logspace); 567 wake_up(&journal->j_wait_logspace);
629 ret = 1;
630out: 568out:
631 JBUFFER_TRACE(jh, "exit"); 569 JBUFFER_TRACE(jh, "exit");
632 return ret;
633} 570}
634 571
635/* 572/*
@@ -691,7 +628,6 @@ void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
691 J_ASSERT(transaction->t_shadow_list == NULL); 628 J_ASSERT(transaction->t_shadow_list == NULL);
692 J_ASSERT(transaction->t_log_list == NULL); 629 J_ASSERT(transaction->t_log_list == NULL);
693 J_ASSERT(transaction->t_checkpoint_list == NULL); 630 J_ASSERT(transaction->t_checkpoint_list == NULL);
694 J_ASSERT(transaction->t_checkpoint_io_list == NULL);
695 J_ASSERT(transaction->t_updates == 0); 631 J_ASSERT(transaction->t_updates == 0);
696 J_ASSERT(journal->j_committing_transaction != transaction); 632 J_ASSERT(journal->j_committing_transaction != transaction);
697 J_ASSERT(journal->j_running_transaction != transaction); 633 J_ASSERT(journal->j_running_transaction != transaction);
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 29e62d98bae6..002ad2bbc769 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -829,8 +829,7 @@ restart_loop:
829 journal->j_committing_transaction = NULL; 829 journal->j_committing_transaction = NULL;
830 spin_unlock(&journal->j_state_lock); 830 spin_unlock(&journal->j_state_lock);
831 831
832 if (commit_transaction->t_checkpoint_list == NULL && 832 if (commit_transaction->t_checkpoint_list == NULL) {
833 commit_transaction->t_checkpoint_io_list == NULL) {
834 __journal_drop_transaction(journal, commit_transaction); 833 __journal_drop_transaction(journal, commit_transaction);
835 } else { 834 } else {
836 if (journal->j_checkpoint_transactions == NULL) { 835 if (journal->j_checkpoint_transactions == NULL) {
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index 3eaf6e701087..da6354baa0b8 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -111,9 +111,10 @@ long nlmclnt_block(struct nlm_rqst *req, long timeout)
111/* 111/*
112 * The server lockd has called us back to tell us the lock was granted 112 * The server lockd has called us back to tell us the lock was granted
113 */ 113 */
114u32 114u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
115nlmclnt_grant(struct nlm_lock *lock)
116{ 115{
116 const struct file_lock *fl = &lock->fl;
117 const struct nfs_fh *fh = &lock->fh;
117 struct nlm_wait *block; 118 struct nlm_wait *block;
118 u32 res = nlm_lck_denied; 119 u32 res = nlm_lck_denied;
119 120
@@ -122,14 +123,20 @@ nlmclnt_grant(struct nlm_lock *lock)
122 * Warning: must not use cookie to match it! 123 * Warning: must not use cookie to match it!
123 */ 124 */
124 list_for_each_entry(block, &nlm_blocked, b_list) { 125 list_for_each_entry(block, &nlm_blocked, b_list) {
125 if (nlm_compare_locks(block->b_lock, &lock->fl)) { 126 struct file_lock *fl_blocked = block->b_lock;
126 /* Alright, we found a lock. Set the return status 127
127 * and wake up the caller 128 if (!nlm_compare_locks(fl_blocked, fl))
128 */ 129 continue;
129 block->b_status = NLM_LCK_GRANTED; 130 if (!nlm_cmp_addr(&block->b_host->h_addr, addr))
130 wake_up(&block->b_wait); 131 continue;
131 res = nlm_granted; 132 if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_dentry->d_inode) ,fh) != 0)
132 } 133 continue;
134 /* Alright, we found a lock. Set the return status
135 * and wake up the caller
136 */
137 block->b_status = NLM_LCK_GRANTED;
138 wake_up(&block->b_wait);
139 res = nlm_granted;
133 } 140 }
134 return res; 141 return res;
135} 142}
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 4063095d849e..b10f913aa06a 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -228,7 +228,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
228 resp->cookie = argp->cookie; 228 resp->cookie = argp->cookie;
229 229
230 dprintk("lockd: GRANTED called\n"); 230 dprintk("lockd: GRANTED called\n");
231 resp->status = nlmclnt_grant(&argp->lock); 231 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock);
232 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 232 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
233 return rpc_success; 233 return rpc_success;
234} 234}
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index 3bc437e0cf5b..35681d9cf1fc 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -256,7 +256,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
256 resp->cookie = argp->cookie; 256 resp->cookie = argp->cookie;
257 257
258 dprintk("lockd: GRANTED called\n"); 258 dprintk("lockd: GRANTED called\n");
259 resp->status = nlmclnt_grant(&argp->lock); 259 resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock);
260 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status)); 260 dprintk("lockd: GRANTED status %d\n", ntohl(resp->status));
261 return rpc_success; 261 return rpc_success;
262} 262}
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index ef5e5414e7a8..d63da756eb49 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1124,8 +1124,6 @@ static void handle_attrs(struct super_block *s)
1124 "reiserfs: cannot support attributes until flag is set in super-block"); 1124 "reiserfs: cannot support attributes until flag is set in super-block");
1125 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); 1125 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
1126 } 1126 }
1127 } else if (le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared) {
1128 REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ATTRS);
1129 } 1127 }
1130} 1128}
1131 1129
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 43de3ba83332..ab8894c3b9e5 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -228,7 +228,8 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
228 acl = ERR_PTR(retval); 228 acl = ERR_PTR(retval);
229 } else { 229 } else {
230 acl = posix_acl_from_disk(value, retval); 230 acl = posix_acl_from_disk(value, retval);
231 *p_acl = posix_acl_dup(acl); 231 if (!IS_ERR(acl))
232 *p_acl = posix_acl_dup(acl);
232 } 233 }
233 234
234 kfree(value); 235 kfree(value);
diff --git a/fs/select.c b/fs/select.c
index bc60a3e14ef3..6ce68a9c8976 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -398,11 +398,15 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
398 ret = core_sys_select(n, inp, outp, exp, &timeout); 398 ret = core_sys_select(n, inp, outp, exp, &timeout);
399 399
400 if (tvp) { 400 if (tvp) {
401 struct timeval rtv;
402
401 if (current->personality & STICKY_TIMEOUTS) 403 if (current->personality & STICKY_TIMEOUTS)
402 goto sticky; 404 goto sticky;
403 tv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)); 405 rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
404 tv.tv_sec = timeout; 406 rtv.tv_sec = timeout;
405 if (copy_to_user(tvp, &tv, sizeof(tv))) { 407 if (timeval_compare(&rtv, &tv) < 0)
408 rtv = tv;
409 if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
406sticky: 410sticky:
407 /* 411 /*
408 * If an application puts its timeval in read-only 412 * If an application puts its timeval in read-only
@@ -460,11 +464,16 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
460 ret = core_sys_select(n, inp, outp, exp, &timeout); 464 ret = core_sys_select(n, inp, outp, exp, &timeout);
461 465
462 if (tsp) { 466 if (tsp) {
467 struct timespec rts;
468
463 if (current->personality & STICKY_TIMEOUTS) 469 if (current->personality & STICKY_TIMEOUTS)
464 goto sticky; 470 goto sticky;
465 ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000; 471 rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
466 ts.tv_sec = timeout; 472 1000;
467 if (copy_to_user(tsp, &ts, sizeof(ts))) { 473 rts.tv_sec = timeout;
474 if (timespec_compare(&rts, &ts) < 0)
475 rts = ts;
476 if (copy_to_user(tsp, &rts, sizeof(rts))) {
468sticky: 477sticky:
469 /* 478 /*
470 * If an application puts its timeval in read-only 479 * If an application puts its timeval in read-only
@@ -758,12 +767,17 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
758 sigprocmask(SIG_SETMASK, &sigsaved, NULL); 767 sigprocmask(SIG_SETMASK, &sigsaved, NULL);
759 768
760 if (tsp && timeout >= 0) { 769 if (tsp && timeout >= 0) {
770 struct timespec rts;
771
761 if (current->personality & STICKY_TIMEOUTS) 772 if (current->personality & STICKY_TIMEOUTS)
762 goto sticky; 773 goto sticky;
763 /* Yes, we know it's actually an s64, but it's also positive. */ 774 /* Yes, we know it's actually an s64, but it's also positive. */
764 ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000; 775 rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
765 ts.tv_sec = timeout; 776 1000;
766 if (copy_to_user(tsp, &ts, sizeof(ts))) { 777 rts.tv_sec = timeout;
778 if (timespec_compare(&rts, &ts) < 0)
779 rts = ts;
780 if (copy_to_user(tsp, &rts, sizeof(rts))) {
767 sticky: 781 sticky:
768 /* 782 /*
769 * If an application puts its timeval in read-only 783 * If an application puts its timeval in read-only
diff --git a/fs/stat.c b/fs/stat.c
index 24211b030f39..9948cc1685a4 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -261,6 +261,7 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
261 return error; 261 return error;
262} 262}
263 263
264#ifndef __ARCH_WANT_STAT64
264asmlinkage long sys_newfstatat(int dfd, char __user *filename, 265asmlinkage long sys_newfstatat(int dfd, char __user *filename,
265 struct stat __user *statbuf, int flag) 266 struct stat __user *statbuf, int flag)
266{ 267{
@@ -281,6 +282,7 @@ asmlinkage long sys_newfstatat(int dfd, char __user *filename,
281out: 282out:
282 return error; 283 return error;
283} 284}
285#endif
284 286
285asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf) 287asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
286{ 288{
@@ -395,6 +397,26 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
395 return error; 397 return error;
396} 398}
397 399
400asmlinkage long sys_fstatat64(int dfd, char __user *filename,
401 struct stat64 __user *statbuf, int flag)
402{
403 struct kstat stat;
404 int error = -EINVAL;
405
406 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
407 goto out;
408
409 if (flag & AT_SYMLINK_NOFOLLOW)
410 error = vfs_lstat_fd(dfd, filename, &stat);
411 else
412 error = vfs_stat_fd(dfd, filename, &stat);
413
414 if (!error)
415 error = cp_new_stat64(&stat, statbuf);
416
417out:
418 return error;
419}
398#endif /* __ARCH_WANT_STAT64 */ 420#endif /* __ARCH_WANT_STAT64 */
399 421
400void inode_add_bytes(struct inode *inode, loff_t bytes) 422void inode_add_bytes(struct inode *inode, loff_t bytes)
diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h
index f6439532a262..a21515c16a43 100644
--- a/include/asm-alpha/mman.h
+++ b/include/asm-alpha/mman.h
@@ -43,6 +43,8 @@
43#define MADV_SPACEAVAIL 5 /* ensure resources are available */ 43#define MADV_SPACEAVAIL 5 /* ensure resources are available */
44#define MADV_DONTNEED 6 /* don't need these pages */ 44#define MADV_DONTNEED 6 /* don't need these pages */
45#define MADV_REMOVE 7 /* remove these pages & resources */ 45#define MADV_REMOVE 7 /* remove these pages & resources */
46#define MADV_DONTFORK 0x30 /* dont inherit across fork */
47#define MADV_DOFORK 0x31 /* do inherit across fork */
46 48
47/* compatibility flags */ 49/* compatibility flags */
48#define MAP_ANON MAP_ANONYMOUS 50#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-arm/arch-s3c2410/h1940-latch.h b/include/asm-arm/arch-s3c2410/h1940-latch.h
new file mode 100644
index 000000000000..c5802411f43d
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/h1940-latch.h
@@ -0,0 +1,64 @@
1/* linux/include/asm-arm/arch-s3c2410/h1940-latch.h
2 *
3 * (c) 2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * iPAQ H1940 series - latch definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_H1940_LATCH_H
15#define __ASM_ARCH_H1940_LATCH_H
16
17
18#ifndef __ASSEMBLY__
19#define H1940_LATCH ((void __iomem *)0xF8000000)
20#else
21#define H1940_LATCH 0xF8000000
22#endif
23
24#define H1940_PA_LATCH (S3C2410_CS2)
25
26/* SD layer latch */
27
28#define H1940_LATCH_SDQ1 (1<<16)
29#define H1940_LATCH_LCD_P1 (1<<17)
30#define H1940_LATCH_LCD_P2 (1<<18)
31#define H1940_LATCH_LCD_P3 (1<<19)
32#define H1940_LATCH_MAX1698_nSHUTDOWN (1<<20) /* LCD backlight */
33#define H1940_LATCH_LED_RED (1<<21)
34#define H1940_LATCH_SDQ7 (1<<22)
35#define H1940_LATCH_USB_DP (1<<23)
36
37/* CPU layer latch */
38
39#define H1940_LATCH_UDA_POWER (1<<24)
40#define H1940_LATCH_AUDIO_POWER (1<<25)
41#define H1940_LATCH_SM803_ENABLE (1<<26)
42#define H1940_LATCH_LCD_P4 (1<<27)
43#define H1940_LATCH_CPUQ5 (1<<28) /* untraced */
44#define H1940_LATCH_BLUETOOTH_POWER (1<<29) /* active high */
45#define H1940_LATCH_LED_GREEN (1<<30)
46#define H1940_LATCH_LED_FLASH (1<<31)
47
48/* default settings */
49
50#define H1940_LATCH_DEFAULT \
51 H1940_LATCH_LCD_P4 | \
52 H1940_LATCH_SM803_ENABLE | \
53 H1940_LATCH_SDQ1 | \
54 H1940_LATCH_LCD_P1 | \
55 H1940_LATCH_LCD_P2 | \
56 H1940_LATCH_LCD_P3 | \
57 H1940_LATCH_MAX1698_nSHUTDOWN | \
58 H1940_LATCH_CPUQ5
59
60/* control functions */
61
62extern void h1940_latch_control(unsigned int clear, unsigned int set);
63
64#endif /* __ASM_ARCH_H1940_LATCH_H */
diff --git a/include/asm-arm/mman.h b/include/asm-arm/mman.h
index f0bebca2ac21..693ed859e632 100644
--- a/include/asm-arm/mman.h
+++ b/include/asm-arm/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-arm26/mman.h b/include/asm-arm26/mman.h
index 0ed7780541fa..2096c50df888 100644
--- a/include/asm-arm26/mman.h
+++ b/include/asm-arm26/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-cris/mman.h b/include/asm-cris/mman.h
index 5a382b8bf3f7..deddfb239ff5 100644
--- a/include/asm-cris/mman.h
+++ b/include/asm-cris/mman.h
@@ -38,6 +38,8 @@
38#define MADV_WILLNEED 0x3 /* pre-fault pages */ 38#define MADV_WILLNEED 0x3 /* pre-fault pages */
39#define MADV_DONTNEED 0x4 /* discard these pages */ 39#define MADV_DONTNEED 0x4 /* discard these pages */
40#define MADV_REMOVE 0x5 /* remove these pages & resources */ 40#define MADV_REMOVE 0x5 /* remove these pages & resources */
41#define MADV_DONTFORK 0x30 /* dont inherit across fork */
42#define MADV_DOFORK 0x31 /* do inherit across fork */
41 43
42/* compatibility flags */ 44/* compatibility flags */
43#define MAP_ANON MAP_ANONYMOUS 45#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h
index a59f684b4f33..5d9f84bfdcad 100644
--- a/include/asm-frv/atomic.h
+++ b/include/asm-frv/atomic.h
@@ -220,9 +220,9 @@ extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsig
220 switch (sizeof(__xg_orig)) { \ 220 switch (sizeof(__xg_orig)) { \
221 case 4: \ 221 case 4: \
222 asm volatile( \ 222 asm volatile( \
223 "swap%I0 %2,%M0" \ 223 "swap%I0 %M0,%1" \
224 : "+m"(*__xg_ptr), "=&r"(__xg_orig) \ 224 : "+m"(*__xg_ptr), "=r"(__xg_orig) \
225 : "r"(x) \ 225 : "1"(x) \
226 : "memory" \ 226 : "memory" \
227 ); \ 227 ); \
228 break; \ 228 break; \
diff --git a/include/asm-frv/cacheflush.h b/include/asm-frv/cacheflush.h
index 3007deccb490..eaa5826bc1c8 100644
--- a/include/asm-frv/cacheflush.h
+++ b/include/asm-frv/cacheflush.h
@@ -87,5 +87,17 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa
87 flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE); 87 flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE);
88} 88}
89 89
90/*
91 * permit ptrace to access another process's address space through the icache
92 * and the dcache
93 */
94#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
95do { \
96 memcpy((dst), (src), (len)); \
97 flush_icache_user_range((vma), (page), (vaddr), (len)); \
98} while(0)
99
100#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
101 memcpy((dst), (src), (len))
90 102
91#endif /* _ASM_CACHEFLUSH_H */ 103#endif /* _ASM_CACHEFLUSH_H */
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h
index 075369b1a34b..01247cb2bc39 100644
--- a/include/asm-frv/io.h
+++ b/include/asm-frv/io.h
@@ -251,7 +251,6 @@ static inline void writel(uint32_t datum, volatile void __iomem *addr)
251#define IOMAP_WRITETHROUGH 3 251#define IOMAP_WRITETHROUGH 3
252 252
253extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); 253extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
254extern void __iounmap(void __iomem *addr, unsigned long size);
255 254
256static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) 255static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
257{ 256{
diff --git a/include/asm-frv/mman.h b/include/asm-frv/mman.h
index 8af4a41c255e..d3bca306da82 100644
--- a/include/asm-frv/mman.h
+++ b/include/asm-frv/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-frv/spr-regs.h b/include/asm-frv/spr-regs.h
index ef472f058d9c..c2a541ef828d 100644
--- a/include/asm-frv/spr-regs.h
+++ b/include/asm-frv/spr-regs.h
@@ -98,6 +98,7 @@
98#define TBR_TT_TRAP0 (0x80 << 4) 98#define TBR_TT_TRAP0 (0x80 << 4)
99#define TBR_TT_TRAP1 (0x81 << 4) 99#define TBR_TT_TRAP1 (0x81 << 4)
100#define TBR_TT_TRAP2 (0x82 << 4) 100#define TBR_TT_TRAP2 (0x82 << 4)
101#define TBR_TT_TRAP3 (0x83 << 4)
101#define TBR_TT_TRAP126 (0xfe << 4) 102#define TBR_TT_TRAP126 (0xfe << 4)
102#define TBR_TT_BREAK (0xff << 4) 103#define TBR_TT_BREAK (0xff << 4)
103 104
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index d2aea70a5f64..f72ff0c4dc0b 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -40,8 +40,84 @@ do { \
40 40
41/* 41/*
42 * interrupt flag manipulation 42 * interrupt flag manipulation
43 * - use virtual interrupt management since touching the PSR is slow
44 * - ICC2.Z: T if interrupts virtually disabled
45 * - ICC2.C: F if interrupts really disabled
46 * - if Z==1 upon interrupt:
47 * - C is set to 0
48 * - interrupts are really disabled
49 * - entry.S returns immediately
50 * - uses TIHI (TRAP if Z==0 && C==0) #2 to really reenable interrupts
51 * - if taken, the trap:
52 * - sets ICC2.C
53 * - enables interrupts
43 */ 54 */
44#define local_irq_disable() \ 55#define local_irq_disable() \
56do { \
57 /* set Z flag, but don't change the C flag */ \
58 asm volatile(" andcc gr0,gr0,gr0,icc2 \n" \
59 : \
60 : \
61 : "memory", "icc2" \
62 ); \
63} while(0)
64
65#define local_irq_enable() \
66do { \
67 /* clear Z flag and then test the C flag */ \
68 asm volatile(" oricc gr0,#1,gr0,icc2 \n" \
69 " tihi icc2,gr0,#2 \n" \
70 : \
71 : \
72 : "memory", "icc2" \
73 ); \
74} while(0)
75
76#define local_save_flags(flags) \
77do { \
78 typecheck(unsigned long, flags); \
79 asm volatile("movsg ccr,%0" \
80 : "=r"(flags) \
81 : \
82 : "memory"); \
83 \
84 /* shift ICC2.Z to bit 0 */ \
85 flags >>= 26; \
86 \
87 /* make flags 1 if interrupts disabled, 0 otherwise */ \
88 flags &= 1UL; \
89} while(0)
90
91#define irqs_disabled() \
92 ({unsigned long flags; local_save_flags(flags); flags; })
93
94#define local_irq_save(flags) \
95do { \
96 typecheck(unsigned long, flags); \
97 local_save_flags(flags); \
98 local_irq_disable(); \
99} while(0)
100
101#define local_irq_restore(flags) \
102do { \
103 typecheck(unsigned long, flags); \
104 \
105 /* load the Z flag by turning 1 if disabled into 0 if disabled \
106 * and thus setting the Z flag but not the C flag */ \
107 asm volatile(" xoricc %0,#1,gr0,icc2 \n" \
108 /* then test Z=0 and C=0 */ \
109 " tihi icc2,gr0,#2 \n" \
110 : \
111 : "r"(flags) \
112 : "memory", "icc2" \
113 ); \
114 \
115} while(0)
116
117/*
118 * real interrupt flag manipulation
119 */
120#define __local_irq_disable() \
45do { \ 121do { \
46 unsigned long psr; \ 122 unsigned long psr; \
47 asm volatile(" movsg psr,%0 \n" \ 123 asm volatile(" movsg psr,%0 \n" \
@@ -53,7 +129,7 @@ do { \
53 : "memory"); \ 129 : "memory"); \
54} while(0) 130} while(0)
55 131
56#define local_irq_enable() \ 132#define __local_irq_enable() \
57do { \ 133do { \
58 unsigned long psr; \ 134 unsigned long psr; \
59 asm volatile(" movsg psr,%0 \n" \ 135 asm volatile(" movsg psr,%0 \n" \
@@ -64,7 +140,7 @@ do { \
64 : "memory"); \ 140 : "memory"); \
65} while(0) 141} while(0)
66 142
67#define local_save_flags(flags) \ 143#define __local_save_flags(flags) \
68do { \ 144do { \
69 typecheck(unsigned long, flags); \ 145 typecheck(unsigned long, flags); \
70 asm("movsg psr,%0" \ 146 asm("movsg psr,%0" \
@@ -73,7 +149,7 @@ do { \
73 : "memory"); \ 149 : "memory"); \
74} while(0) 150} while(0)
75 151
76#define local_irq_save(flags) \ 152#define __local_irq_save(flags) \
77do { \ 153do { \
78 unsigned long npsr; \ 154 unsigned long npsr; \
79 typecheck(unsigned long, flags); \ 155 typecheck(unsigned long, flags); \
@@ -86,7 +162,7 @@ do { \
86 : "memory"); \ 162 : "memory"); \
87} while(0) 163} while(0)
88 164
89#define local_irq_restore(flags) \ 165#define __local_irq_restore(flags) \
90do { \ 166do { \
91 typecheck(unsigned long, flags); \ 167 typecheck(unsigned long, flags); \
92 asm volatile(" movgs %0,psr \n" \ 168 asm volatile(" movgs %0,psr \n" \
@@ -95,7 +171,7 @@ do { \
95 : "memory"); \ 171 : "memory"); \
96} while(0) 172} while(0)
97 173
98#define irqs_disabled() \ 174#define __irqs_disabled() \
99 ((__get_PSR() & PSR_PIL) >= PSR_PIL_14) 175 ((__get_PSR() & PSR_PIL) >= PSR_PIL_14)
100 176
101/* 177/*
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h
index b6bcbe01f6ee..a1d140438863 100644
--- a/include/asm-frv/uaccess.h
+++ b/include/asm-frv/uaccess.h
@@ -306,7 +306,4 @@ extern long strnlen_user(const char *src, long count);
306 306
307extern unsigned long search_exception_table(unsigned long addr); 307extern unsigned long search_exception_table(unsigned long addr);
308 308
309#define copy_to_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
310#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
311
312#endif /* _ASM_UACCESS_H */ 309#endif /* _ASM_UACCESS_H */
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 4d994d2e99e3..322531caa484 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -295,13 +295,29 @@
295#define __NR_add_key 286 295#define __NR_add_key 286
296#define __NR_request_key 287 296#define __NR_request_key 287
297#define __NR_keyctl 288 297#define __NR_keyctl 288
298#define __NR_vperfctr_open 289 298#define __NR_ioprio_set 289
299#define __NR_vperfctr_control (__NR_perfctr_info+1) 299#define __NR_ioprio_get 290
300#define __NR_vperfctr_unlink (__NR_perfctr_info+2) 300#define __NR_inotify_init 291
301#define __NR_vperfctr_iresume (__NR_perfctr_info+3) 301#define __NR_inotify_add_watch 292
302#define __NR_vperfctr_read (__NR_perfctr_info+4) 302#define __NR_inotify_rm_watch 293
303#define __NR_migrate_pages 294
304#define __NR_openat 295
305#define __NR_mkdirat 296
306#define __NR_mknodat 297
307#define __NR_fchownat 298
308#define __NR_futimesat 299
309#define __NR_newfstatat 300
310#define __NR_unlinkat 301
311#define __NR_renameat 302
312#define __NR_linkat 303
313#define __NR_symlinkat 304
314#define __NR_readlinkat 305
315#define __NR_fchmodat 306
316#define __NR_faccessat 307
317#define __NR_pselect6 308
318#define __NR_ppoll 309
303 319
304#define NR_syscalls 294 320#define NR_syscalls 310
305 321
306/* 322/*
307 * process the return value of a syscall, consigning it to one of two possible fates 323 * process the return value of a syscall, consigning it to one of two possible fates
diff --git a/include/asm-h8300/mman.h b/include/asm-h8300/mman.h
index 744a8fb485c2..ac0346f7d11d 100644
--- a/include/asm-h8300/mman.h
+++ b/include/asm-h8300/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-i386/mman.h b/include/asm-i386/mman.h
index ba4941e6f643..ab2339a1d807 100644
--- a/include/asm-i386/mman.h
+++ b/include/asm-i386/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index af503a122b23..aa958c6ee83e 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -27,7 +27,7 @@
27#ifndef _ASM_I386_TOPOLOGY_H 27#ifndef _ASM_I386_TOPOLOGY_H
28#define _ASM_I386_TOPOLOGY_H 28#define _ASM_I386_TOPOLOGY_H
29 29
30#ifdef CONFIG_SMP 30#ifdef CONFIG_X86_HT
31#define topology_physical_package_id(cpu) \ 31#define topology_physical_package_id(cpu) \
32 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) 32 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu])
33#define topology_core_id(cpu) \ 33#define topology_core_id(cpu) \
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index cf6f2cd9c514..dc81a55dd94d 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -305,7 +305,7 @@
305#define __NR_mknodat 297 305#define __NR_mknodat 297
306#define __NR_fchownat 298 306#define __NR_fchownat 298
307#define __NR_futimesat 299 307#define __NR_futimesat 299
308#define __NR_newfstatat 300 308#define __NR_fstatat64 300
309#define __NR_unlinkat 301 309#define __NR_unlinkat 301
310#define __NR_renameat 302 310#define __NR_renameat 302
311#define __NR_linkat 303 311#define __NR_linkat 303
diff --git a/include/asm-ia64/mman.h b/include/asm-ia64/mman.h
index 828beb24a20e..357ebb780cc0 100644
--- a/include/asm-ia64/mman.h
+++ b/include/asm-ia64/mman.h
@@ -44,6 +44,8 @@
44#define MADV_WILLNEED 0x3 /* pre-fault pages */ 44#define MADV_WILLNEED 0x3 /* pre-fault pages */
45#define MADV_DONTNEED 0x4 /* discard these pages */ 45#define MADV_DONTNEED 0x4 /* discard these pages */
46#define MADV_REMOVE 0x5 /* remove these pages & resources */ 46#define MADV_REMOVE 0x5 /* remove these pages & resources */
47#define MADV_DONTFORK 0x30 /* dont inherit across fork */
48#define MADV_DOFORK 0x31 /* do inherit across fork */
47 49
48/* compatibility flags */ 50/* compatibility flags */
49#define MAP_ANON MAP_ANONYMOUS 51#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-m32r/mman.h b/include/asm-m32r/mman.h
index 12e29747bc84..6b02fe3fcff2 100644
--- a/include/asm-m32r/mman.h
+++ b/include/asm-m32r/mman.h
@@ -38,6 +38,8 @@
38#define MADV_WILLNEED 0x3 /* pre-fault pages */ 38#define MADV_WILLNEED 0x3 /* pre-fault pages */
39#define MADV_DONTNEED 0x4 /* discard these pages */ 39#define MADV_DONTNEED 0x4 /* discard these pages */
40#define MADV_REMOVE 0x5 /* remove these pages & resources */ 40#define MADV_REMOVE 0x5 /* remove these pages & resources */
41#define MADV_DONTFORK 0x30 /* dont inherit across fork */
42#define MADV_DOFORK 0x31 /* do inherit across fork */
41 43
42/* compatibility flags */ 44/* compatibility flags */
43#define MAP_ANON MAP_ANONYMOUS 45#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-m68k/mman.h b/include/asm-m68k/mman.h
index ea262ab88b3b..efd12bc4ccb7 100644
--- a/include/asm-m68k/mman.h
+++ b/include/asm-m68k/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index 934e063e79f1..818b9a97e214 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -204,9 +204,9 @@
204 */ 204 */
205#define MIPS_CPU_ISA_I 0x00000001 205#define MIPS_CPU_ISA_I 0x00000001
206#define MIPS_CPU_ISA_II 0x00000002 206#define MIPS_CPU_ISA_II 0x00000002
207#define MIPS_CPU_ISA_III 0x00000003 207#define MIPS_CPU_ISA_III 0x00000004
208#define MIPS_CPU_ISA_IV 0x00000004 208#define MIPS_CPU_ISA_IV 0x00000008
209#define MIPS_CPU_ISA_V 0x00000005 209#define MIPS_CPU_ISA_V 0x00000010
210#define MIPS_CPU_ISA_M32R1 0x00000020 210#define MIPS_CPU_ISA_M32R1 0x00000020
211#define MIPS_CPU_ISA_M32R2 0x00000040 211#define MIPS_CPU_ISA_M32R2 0x00000040
212#define MIPS_CPU_ISA_M64R1 0x00000080 212#define MIPS_CPU_ISA_M64R1 0x00000080
diff --git a/include/asm-mips/gcc/sgidefs.h b/include/asm-mips/gcc/sgidefs.h
deleted file mode 100644
index 05994371a2af..000000000000
--- a/include/asm-mips/gcc/sgidefs.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * include/sgidefs.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1996 by Ralf Baechle
9 *
10 * This file is here to satisfy GCC's expectations.
11 */
12#ifndef __SGIDEFS_H
13#define __SGIDEFS_H
14
15#include <asm/sgidefs.h>
16
17#endif /* __SGIDEFS_H */
diff --git a/include/asm-mips/mach-generic/timex.h b/include/asm-mips/mach-generic/timex.h
index c6a2e5f0574a..48b4cfaa0d50 100644
--- a/include/asm-mips/mach-generic/timex.h
+++ b/include/asm-mips/mach-generic/timex.h
@@ -3,20 +3,11 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 by Ralf Baechle 6 * Copyright (C) 2003, 2005 by Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_GENERIC_TIMEX_H 8#ifndef __ASM_MACH_GENERIC_TIMEX_H
9#define __ASM_MACH_GENERIC_TIMEX_H 9#define __ASM_MACH_GENERIC_TIMEX_H
10 10
11#include <linux/config.h>
12
13/*
14 * Last remaining user of the i8254 PIC, will be converted, too ...
15 */
16#ifdef CONFIG_SNI_RM200_PCI
17#define CLOCK_TICK_RATE 1193182
18#else
19#define CLOCK_TICK_RATE 500000 11#define CLOCK_TICK_RATE 500000
20#endif
21 12
22#endif /* __ASM_MACH_GENERIC_TIMEX_H */ 13#endif /* __ASM_MACH_GENERIC_TIMEX_H */
diff --git a/include/asm-mips/mach-rm200/timex.h b/include/asm-mips/mach-rm200/timex.h
new file mode 100644
index 000000000000..11ff6cb0f214
--- /dev/null
+++ b/include/asm-mips/mach-rm200/timex.h
@@ -0,0 +1,13 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003, 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_RM200_TIMEX_H
9#define __ASM_MACH_RM200_TIMEX_H
10
11#define CLOCK_TICK_RATE 1193182
12
13#endif /* __ASM_MACH_RM200_TIMEX_H */
diff --git a/include/asm-mips/mman.h b/include/asm-mips/mman.h
index dd17c8bd62a1..6d01e26830fa 100644
--- a/include/asm-mips/mman.h
+++ b/include/asm-mips/mman.h
@@ -66,6 +66,8 @@
66#define MADV_WILLNEED 0x3 /* pre-fault pages */ 66#define MADV_WILLNEED 0x3 /* pre-fault pages */
67#define MADV_DONTNEED 0x4 /* discard these pages */ 67#define MADV_DONTNEED 0x4 /* discard these pages */
68#define MADV_REMOVE 0x5 /* remove these pages & resources */ 68#define MADV_REMOVE 0x5 /* remove these pages & resources */
69#define MADV_DONTFORK 0x30 /* dont inherit across fork */
70#define MADV_DOFORK 0x31 /* do inherit across fork */
69 71
70/* compatibility flags */ 72/* compatibility flags */
71#define MAP_ANON MAP_ANONYMOUS 73#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h
index cc53196efa40..9632c27dad15 100644
--- a/include/asm-mips/r4kcache.h
+++ b/include/asm-mips/r4kcache.h
@@ -14,6 +14,7 @@
14 14
15#include <asm/asm.h> 15#include <asm/asm.h>
16#include <asm/cacheops.h> 16#include <asm/cacheops.h>
17#include <asm/cpu-features.h>
17 18
18/* 19/*
19 * This macro return a properly sign-extended address suitable as base address 20 * This macro return a properly sign-extended address suitable as base address
@@ -78,22 +79,25 @@ static inline void flush_scache_line(unsigned long addr)
78 cache_op(Hit_Writeback_Inv_SD, addr); 79 cache_op(Hit_Writeback_Inv_SD, addr);
79} 80}
80 81
82#define protected_cache_op(op,addr) \
83 __asm__ __volatile__( \
84 " .set push \n" \
85 " .set noreorder \n" \
86 " .set mips3 \n" \
87 "1: cache %0, (%1) \n" \
88 "2: .set pop \n" \
89 " .section __ex_table,\"a\" \n" \
90 " "STR(PTR)" 1b, 2b \n" \
91 " .previous" \
92 : \
93 : "i" (op), "r" (addr))
94
81/* 95/*
82 * The next two are for badland addresses like signal trampolines. 96 * The next two are for badland addresses like signal trampolines.
83 */ 97 */
84static inline void protected_flush_icache_line(unsigned long addr) 98static inline void protected_flush_icache_line(unsigned long addr)
85{ 99{
86 __asm__ __volatile__( 100 protected_cache_op(Hit_Invalidate_I, addr);
87 " .set push \n"
88 " .set noreorder \n"
89 " .set mips3 \n"
90 "1: cache %0, (%1) \n"
91 "2: .set pop \n"
92 " .section __ex_table,\"a\" \n"
93 " "STR(PTR)" 1b, 2b \n"
94 " .previous"
95 :
96 : "i" (Hit_Invalidate_I), "r" (addr));
97} 101}
98 102
99/* 103/*
@@ -104,32 +108,12 @@ static inline void protected_flush_icache_line(unsigned long addr)
104 */ 108 */
105static inline void protected_writeback_dcache_line(unsigned long addr) 109static inline void protected_writeback_dcache_line(unsigned long addr)
106{ 110{
107 __asm__ __volatile__( 111 protected_cache_op(Hit_Writeback_Inv_D, addr);
108 " .set push \n"
109 " .set noreorder \n"
110 " .set mips3 \n"
111 "1: cache %0, (%1) \n"
112 "2: .set pop \n"
113 " .section __ex_table,\"a\" \n"
114 " "STR(PTR)" 1b, 2b \n"
115 " .previous"
116 :
117 : "i" (Hit_Writeback_Inv_D), "r" (addr));
118} 112}
119 113
120static inline void protected_writeback_scache_line(unsigned long addr) 114static inline void protected_writeback_scache_line(unsigned long addr)
121{ 115{
122 __asm__ __volatile__( 116 protected_cache_op(Hit_Writeback_Inv_SD, addr);
123 " .set push \n"
124 " .set noreorder \n"
125 " .set mips3 \n"
126 "1: cache %0, (%1) \n"
127 "2: .set pop \n"
128 " .section __ex_table,\"a\" \n"
129 " "STR(PTR)" 1b, 2b \n"
130 " .previous"
131 :
132 : "i" (Hit_Writeback_Inv_SD), "r" (addr));
133} 117}
134 118
135/* 119/*
@@ -295,4 +279,28 @@ __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
295__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) 279__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64)
296__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) 280__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)
297 281
282/* build blast_xxx_range, protected_blast_xxx_range */
283#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \
284static inline void prot##blast_##pfx##cache##_range(unsigned long start, \
285 unsigned long end) \
286{ \
287 unsigned long lsize = cpu_##desc##_line_size(); \
288 unsigned long addr = start & ~(lsize - 1); \
289 unsigned long aend = (end - 1) & ~(lsize - 1); \
290 while (1) { \
291 prot##cache_op(hitop, addr); \
292 if (addr == aend) \
293 break; \
294 addr += lsize; \
295 } \
296}
297
298__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_)
299__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_)
300__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_)
301__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, )
302__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, )
303/* blast_inv_dcache_range */
304__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, )
305
298#endif /* _ASM_R4KCACHE_H */ 306#endif /* _ASM_R4KCACHE_H */
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 91d813a37823..7a553e9d44d3 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -266,6 +266,8 @@ do { \
266 */ 266 */
267#define __get_user_asm_ll32(val, addr) \ 267#define __get_user_asm_ll32(val, addr) \
268{ \ 268{ \
269 unsigned long long __gu_tmp; \
270 \
269 __asm__ __volatile__( \ 271 __asm__ __volatile__( \
270 "1: lw %1, (%3) \n" \ 272 "1: lw %1, (%3) \n" \
271 "2: lw %D1, 4(%3) \n" \ 273 "2: lw %D1, 4(%3) \n" \
@@ -280,8 +282,9 @@ do { \
280 " " __UA_ADDR " 1b, 4b \n" \ 282 " " __UA_ADDR " 1b, 4b \n" \
281 " " __UA_ADDR " 2b, 4b \n" \ 283 " " __UA_ADDR " 2b, 4b \n" \
282 " .previous \n" \ 284 " .previous \n" \
283 : "=r" (__gu_err), "=&r" (val) \ 285 : "=r" (__gu_err), "=&r" (__gu_tmp) \
284 : "0" (0), "r" (addr), "i" (-EFAULT)); \ 286 : "0" (0), "r" (addr), "i" (-EFAULT)); \
287 (val) = __gu_tmp; \
285} 288}
286 289
287/* 290/*
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index e7ff9b187783..769305d20108 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -1184,10 +1184,8 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1184#define __ARCH_WANT_SYS_SIGPENDING 1184#define __ARCH_WANT_SYS_SIGPENDING
1185#define __ARCH_WANT_SYS_SIGPROCMASK 1185#define __ARCH_WANT_SYS_SIGPROCMASK
1186#define __ARCH_WANT_SYS_RT_SIGACTION 1186#define __ARCH_WANT_SYS_RT_SIGACTION
1187# ifndef __mips64
1188# define __ARCH_WANT_STAT64
1189# endif
1190# ifdef CONFIG_32BIT 1187# ifdef CONFIG_32BIT
1188# define __ARCH_WANT_STAT64
1191# define __ARCH_WANT_SYS_TIME 1189# define __ARCH_WANT_SYS_TIME
1192# endif 1190# endif
1193# ifdef CONFIG_MIPS32_O32 1191# ifdef CONFIG_MIPS32_O32
diff --git a/include/asm-parisc/mman.h b/include/asm-parisc/mman.h
index 736b0abcac05..a381cf5c8f55 100644
--- a/include/asm-parisc/mman.h
+++ b/include/asm-parisc/mman.h
@@ -49,6 +49,8 @@
49#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */ 49#define MADV_4M_PAGES 22 /* Use 4 Megabyte pages */
50#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */ 50#define MADV_16M_PAGES 24 /* Use 16 Megabyte pages */
51#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */ 51#define MADV_64M_PAGES 26 /* Use 64 Megabyte pages */
52#define MADV_DONTFORK 0x30 /* dont inherit across fork */
53#define MADV_DOFORK 0x31 /* do inherit across fork */
52 54
53/* compatibility flags */ 55/* compatibility flags */
54#define MAP_ANON MAP_ANONYMOUS 56#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-powerpc/mman.h b/include/asm-powerpc/mman.h
index a2e34c21b44f..fcff25d13f13 100644
--- a/include/asm-powerpc/mman.h
+++ b/include/asm-powerpc/mman.h
@@ -45,6 +45,8 @@
45#define MADV_WILLNEED 0x3 /* pre-fault pages */ 45#define MADV_WILLNEED 0x3 /* pre-fault pages */
46#define MADV_DONTNEED 0x4 /* discard these pages */ 46#define MADV_DONTNEED 0x4 /* discard these pages */
47#define MADV_REMOVE 0x5 /* remove these pages & resources */ 47#define MADV_REMOVE 0x5 /* remove these pages & resources */
48#define MADV_DONTFORK 0x30 /* dont inherit across fork */
49#define MADV_DOFORK 0x31 /* do inherit across fork */
48 50
49/* compatibility flags */ 51/* compatibility flags */
50#define MAP_ANON MAP_ANONYMOUS 52#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index a40cdff21a88..35556993f066 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -300,8 +300,9 @@
300#define __NR_spu_create 279 300#define __NR_spu_create 279
301#define __NR_pselect6 280 301#define __NR_pselect6 280
302#define __NR_ppoll 281 302#define __NR_ppoll 281
303#define __NR_unshare 282
303 304
304#define __NR_syscalls 282 305#define __NR_syscalls 283
305 306
306#ifdef __KERNEL__ 307#ifdef __KERNEL__
307#define __NR__exit __NR_exit 308#define __NR__exit __NR_exit
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index 61232760cc3b..3628899f48bb 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -518,8 +518,8 @@ static inline int __test_bit(unsigned long nr, const volatile unsigned long *ptr
518 518
519static inline int 519static inline int
520__constant_test_bit(unsigned long nr, const volatile unsigned long *addr) { 520__constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
521 return ((((volatile char *) addr) 521 return (((volatile char *) addr)
522 [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7)))) != 0; 522 [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7))) != 0;
523} 523}
524 524
525#define test_bit(nr,addr) \ 525#define test_bit(nr,addr) \
diff --git a/include/asm-s390/mman.h b/include/asm-s390/mman.h
index c8d5409b5d56..d41ca1477010 100644
--- a/include/asm-s390/mman.h
+++ b/include/asm-s390/mman.h
@@ -44,6 +44,8 @@
44#define MADV_WILLNEED 0x3 /* pre-fault pages */ 44#define MADV_WILLNEED 0x3 /* pre-fault pages */
45#define MADV_DONTNEED 0x4 /* discard these pages */ 45#define MADV_DONTNEED 0x4 /* discard these pages */
46#define MADV_REMOVE 0x5 /* remove these pages & resources */ 46#define MADV_REMOVE 0x5 /* remove these pages & resources */
47#define MADV_DONTFORK 0x30 /* dont inherit across fork */
48#define MADV_DOFORK 0x31 /* do inherit across fork */
47 49
48/* compatibility flags */ 50/* compatibility flags */
49#define MAP_ANON MAP_ANONYMOUS 51#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index 348a88137445..da3fd4a7bb32 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -8,6 +8,8 @@
8#ifndef _ASM_S390_SETUP_H 8#ifndef _ASM_S390_SETUP_H
9#define _ASM_S390_SETUP_H 9#define _ASM_S390_SETUP_H
10 10
11#ifdef __KERNEL__
12
11#include <asm/types.h> 13#include <asm/types.h>
12 14
13#define PARMAREA 0x10400 15#define PARMAREA 0x10400
@@ -114,7 +116,7 @@ extern u16 ipl_devno;
114 IPL_PARMBLOCK_ORIGIN) 116 IPL_PARMBLOCK_ORIGIN)
115#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.length) 117#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.length)
116 118
117#else 119#else /* __ASSEMBLY__ */
118 120
119#ifndef __s390x__ 121#ifndef __s390x__
120#define IPL_DEVICE 0x10404 122#define IPL_DEVICE 0x10404
@@ -127,6 +129,6 @@ extern u16 ipl_devno;
127#endif /* __s390x__ */ 129#endif /* __s390x__ */
128#define COMMAND_LINE 0x10480 130#define COMMAND_LINE 0x10480
129 131
130#endif 132#endif /* __ASSEMBLY__ */
131 133#endif /* __KERNEL__ */
132#endif 134#endif /* _ASM_S390_SETUP_H */
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index a2ae7628bbaa..9c6e9c300eb9 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -101,6 +101,7 @@ smp_call_function_on(void (*func) (void *info), void *info,
101 func(info); 101 func(info);
102 return 0; 102 return 0;
103} 103}
104#define smp_cpu_not_running(cpu) 1
104#define smp_get_cpu(cpu) ({ 0; }) 105#define smp_get_cpu(cpu) ({ 0; })
105#define smp_put_cpu(cpu) ({ 0; }) 106#define smp_put_cpu(cpu) ({ 0; })
106#endif 107#endif
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 29a9f357eb9e..657d582e8149 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -285,7 +285,7 @@
285#define __NR_mknodat 290 285#define __NR_mknodat 290
286#define __NR_fchownat 291 286#define __NR_fchownat 291
287#define __NR_futimesat 292 287#define __NR_futimesat 292
288#define __NR_newfstatat 293 288#define __NR_fstatat64 293
289#define __NR_unlinkat 294 289#define __NR_unlinkat 294
290#define __NR_renameat 295 290#define __NR_renameat 295
291#define __NR_linkat 296 291#define __NR_linkat 296
@@ -295,8 +295,9 @@
295#define __NR_faccessat 300 295#define __NR_faccessat 300
296#define __NR_pselect6 301 296#define __NR_pselect6 301
297#define __NR_ppoll 302 297#define __NR_ppoll 302
298#define __NR_unshare 303
298 299
299#define NR_syscalls 303 300#define NR_syscalls 304
300 301
301/* 302/*
302 * There are some system calls that are not present on 64 bit, some 303 * There are some system calls that are not present on 64 bit, some
@@ -358,6 +359,7 @@
358#undef __NR_fcntl64 359#undef __NR_fcntl64
359#undef __NR_sendfile64 360#undef __NR_sendfile64
360#undef __NR_fadvise64_64 361#undef __NR_fadvise64_64
362#undef __NR_fstatat64
361 363
362#define __NR_select 142 364#define __NR_select 142
363#define __NR_getrlimit 191 /* SuS compliant getrlimit */ 365#define __NR_getrlimit 191 /* SuS compliant getrlimit */
@@ -380,6 +382,7 @@
380#define __NR_setgid 214 382#define __NR_setgid 214
381#define __NR_setfsuid 215 383#define __NR_setfsuid 215
382#define __NR_setfsgid 216 384#define __NR_setfsgid 216
385#define __NR_newfstatat 293
383 386
384#endif 387#endif
385 388
diff --git a/include/asm-sh/mman.h b/include/asm-sh/mman.h
index 693bd55a3710..0e08d0573abc 100644
--- a/include/asm-sh/mman.h
+++ b/include/asm-sh/mman.h
@@ -36,6 +36,8 @@
36#define MADV_WILLNEED 0x3 /* pre-fault pages */ 36#define MADV_WILLNEED 0x3 /* pre-fault pages */
37#define MADV_DONTNEED 0x4 /* discard these pages */ 37#define MADV_DONTNEED 0x4 /* discard these pages */
38#define MADV_REMOVE 0x5 /* remove these pages & resources */ 38#define MADV_REMOVE 0x5 /* remove these pages & resources */
39#define MADV_DONTFORK 0x30 /* dont inherit across fork */
40#define MADV_DOFORK 0x31 /* do inherit across fork */
39 41
40/* compatibility flags */ 42/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS 43#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
index 98435ad8619e..4a298b2be859 100644
--- a/include/asm-sparc/mman.h
+++ b/include/asm-sparc/mman.h
@@ -55,6 +55,8 @@
55#define MADV_DONTNEED 0x4 /* discard these pages */ 55#define MADV_DONTNEED 0x4 /* discard these pages */
56#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ 56#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
57#define MADV_REMOVE 0x6 /* remove these pages & resources */ 57#define MADV_REMOVE 0x6 /* remove these pages & resources */
58#define MADV_DONTFORK 0x30 /* dont inherit across fork */
59#define MADV_DOFORK 0x31 /* do inherit across fork */
58 60
59/* compatibility flags */ 61/* compatibility flags */
60#define MAP_ANON MAP_ANONYMOUS 62#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 0615d601a7c6..64ec640a40ee 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -305,7 +305,7 @@
305#define __NR_mknodat 286 305#define __NR_mknodat 286
306#define __NR_fchownat 287 306#define __NR_fchownat 287
307#define __NR_futimesat 288 307#define __NR_futimesat 288
308#define __NR_newfstatat 289 308#define __NR_fstatat64 289
309#define __NR_unlinkat 290 309#define __NR_unlinkat 290
310#define __NR_renameat 291 310#define __NR_renameat 291
311#define __NR_linkat 292 311#define __NR_linkat 292
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index cb4b6156194d..d705ec92da8b 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -55,6 +55,8 @@
55#define MADV_DONTNEED 0x4 /* discard these pages */ 55#define MADV_DONTNEED 0x4 /* discard these pages */
56#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ 56#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
57#define MADV_REMOVE 0x6 /* remove these pages & resources */ 57#define MADV_REMOVE 0x6 /* remove these pages & resources */
58#define MADV_DONTFORK 0x30 /* dont inherit across fork */
59#define MADV_DOFORK 0x31 /* do inherit across fork */
58 60
59/* compatibility flags */ 61/* compatibility flags */
60#define MAP_ANON MAP_ANONYMOUS 62#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index c58ba8a096cf..a284986b1541 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -307,7 +307,7 @@
307#define __NR_mknodat 286 307#define __NR_mknodat 286
308#define __NR_fchownat 287 308#define __NR_fchownat 287
309#define __NR_futimesat 288 309#define __NR_futimesat 288
310#define __NR_newfstatat 289 310#define __NR_fstatat64 289
311#define __NR_unlinkat 290 311#define __NR_unlinkat 290
312#define __NR_renameat 291 312#define __NR_renameat 291
313#define __NR_linkat 292 313#define __NR_linkat 292
diff --git a/include/asm-v850/mman.h b/include/asm-v850/mman.h
index edc79965193a..7b851c310e41 100644
--- a/include/asm-v850/mman.h
+++ b/include/asm-v850/mman.h
@@ -33,6 +33,8 @@
33#define MADV_WILLNEED 0x3 /* pre-fault pages */ 33#define MADV_WILLNEED 0x3 /* pre-fault pages */
34#define MADV_DONTNEED 0x4 /* discard these pages */ 34#define MADV_DONTNEED 0x4 /* discard these pages */
35#define MADV_REMOVE 0x5 /* remove these pages & resources */ 35#define MADV_REMOVE 0x5 /* remove these pages & resources */
36#define MADV_DONTFORK 0x30 /* dont inherit across fork */
37#define MADV_DOFORK 0x31 /* do inherit across fork */
36 38
37/* compatibility flags */ 39/* compatibility flags */
38#define MAP_ANON MAP_ANONYMOUS 40#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h
index c20c28f5c7a0..08b75c15269a 100644
--- a/include/asm-x86_64/hpet.h
+++ b/include/asm-x86_64/hpet.h
@@ -55,6 +55,8 @@ extern int is_hpet_enabled(void);
55extern int hpet_rtc_timer_init(void); 55extern int hpet_rtc_timer_init(void);
56extern int oem_force_hpet_timer(void); 56extern int oem_force_hpet_timer(void);
57 57
58extern int hpet_use_timer;
59
58#ifdef CONFIG_HPET_EMULATE_RTC 60#ifdef CONFIG_HPET_EMULATE_RTC
59extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask); 61extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
60extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); 62extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h
index 20468983d453..eeb2bcd635de 100644
--- a/include/asm-x86_64/ia32_unistd.h
+++ b/include/asm-x86_64/ia32_unistd.h
@@ -305,7 +305,7 @@
305#define __NR_ia32_mknodat 297 305#define __NR_ia32_mknodat 297
306#define __NR_ia32_fchownat 298 306#define __NR_ia32_fchownat 298
307#define __NR_ia32_futimesat 299 307#define __NR_ia32_futimesat 299
308#define __NR_ia32_newfstatat 300 308#define __NR_ia32_fstatat64 300
309#define __NR_ia32_unlinkat 301 309#define __NR_ia32_unlinkat 301
310#define __NR_ia32_renameat 302 310#define __NR_ia32_renameat 302
311#define __NR_ia32_linkat 303 311#define __NR_ia32_linkat 303
diff --git a/include/asm-x86_64/mman.h b/include/asm-x86_64/mman.h
index d0e97b74f735..b699a38c1c3c 100644
--- a/include/asm-x86_64/mman.h
+++ b/include/asm-x86_64/mman.h
@@ -37,6 +37,8 @@
37#define MADV_WILLNEED 0x3 /* pre-fault pages */ 37#define MADV_WILLNEED 0x3 /* pre-fault pages */
38#define MADV_DONTNEED 0x4 /* discard these pages */ 38#define MADV_DONTNEED 0x4 /* discard these pages */
39#define MADV_REMOVE 0x5 /* remove these pages & resources */ 39#define MADV_REMOVE 0x5 /* remove these pages & resources */
40#define MADV_DONTFORK 0x30 /* dont inherit across fork */
41#define MADV_DOFORK 0x31 /* do inherit across fork */
40 42
41/* compatibility flags */ 43/* compatibility flags */
42#define MAP_ANON MAP_ANONYMOUS 44#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/asm-xtensa/mman.h b/include/asm-xtensa/mman.h
index 082a7504925e..e2d7afb679c8 100644
--- a/include/asm-xtensa/mman.h
+++ b/include/asm-xtensa/mman.h
@@ -73,6 +73,8 @@
73#define MADV_WILLNEED 0x3 /* pre-fault pages */ 73#define MADV_WILLNEED 0x3 /* pre-fault pages */
74#define MADV_DONTNEED 0x4 /* discard these pages */ 74#define MADV_DONTNEED 0x4 /* discard these pages */
75#define MADV_REMOVE 0x5 /* remove these pages & resources */ 75#define MADV_REMOVE 0x5 /* remove these pages & resources */
76#define MADV_DONTFORK 0x30 /* dont inherit across fork */
77#define MADV_DOFORK 0x31 /* do inherit across fork */
76 78
77/* compatibility flags */ 79/* compatibility flags */
78#define MAP_ANON MAP_ANONYMOUS 80#define MAP_ANON MAP_ANONYMOUS
diff --git a/include/linux/compat.h b/include/linux/compat.h
index f9ca534787e2..c9ab2a26348c 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -161,5 +161,25 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
161int get_compat_sigevent(struct sigevent *event, 161int get_compat_sigevent(struct sigevent *event,
162 const struct compat_sigevent __user *u_event); 162 const struct compat_sigevent __user *u_event);
163 163
164static inline int compat_timeval_compare(struct compat_timeval *lhs,
165 struct compat_timeval *rhs)
166{
167 if (lhs->tv_sec < rhs->tv_sec)
168 return -1;
169 if (lhs->tv_sec > rhs->tv_sec)
170 return 1;
171 return lhs->tv_usec - rhs->tv_usec;
172}
173
174static inline int compat_timespec_compare(struct compat_timespec *lhs,
175 struct compat_timespec *rhs)
176{
177 if (lhs->tv_sec < rhs->tv_sec)
178 return -1;
179 if (lhs->tv_sec > rhs->tv_sec)
180 return 1;
181 return lhs->tv_nsec - rhs->tv_nsec;
182}
183
164#endif /* CONFIG_COMPAT */ 184#endif /* CONFIG_COMPAT */
165#endif /* _LINUX_COMPAT_H */ 185#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 0fe4aa891ddc..41ee79962bb2 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -498,12 +498,6 @@ struct transaction_s
498 struct journal_head *t_checkpoint_list; 498 struct journal_head *t_checkpoint_list;
499 499
500 /* 500 /*
501 * Doubly-linked circular list of all buffers submitted for IO while
502 * checkpointing. [j_list_lock]
503 */
504 struct journal_head *t_checkpoint_io_list;
505
506 /*
507 * Doubly-linked circular list of temporary buffers currently undergoing 501 * Doubly-linked circular list of temporary buffers currently undergoing
508 * IO in the log [j_list_lock] 502 * IO in the log [j_list_lock]
509 */ 503 */
@@ -852,7 +846,7 @@ extern void journal_commit_transaction(journal_t *);
852 846
853/* Checkpoint list management */ 847/* Checkpoint list management */
854int __journal_clean_checkpoint_list(journal_t *journal); 848int __journal_clean_checkpoint_list(journal_t *journal);
855int __journal_remove_checkpoint(struct journal_head *); 849void __journal_remove_checkpoint(struct journal_head *);
856void __journal_insert_checkpoint(struct journal_head *, transaction_t *); 850void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
857 851
858/* Buffer IO */ 852/* Buffer IO */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 920766cea79c..ef21ed296039 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -149,7 +149,7 @@ struct nlm_rqst * nlmclnt_alloc_call(void);
149int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); 149int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl);
150void nlmclnt_finish_block(struct nlm_rqst *req); 150void nlmclnt_finish_block(struct nlm_rqst *req);
151long nlmclnt_block(struct nlm_rqst *req, long timeout); 151long nlmclnt_block(struct nlm_rqst *req, long timeout);
152u32 nlmclnt_grant(struct nlm_lock *); 152u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
153void nlmclnt_recovery(struct nlm_host *, u32); 153void nlmclnt_recovery(struct nlm_host *, u32);
154int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); 154int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
155int nlmclnt_setgrantargs(struct nlm_rqst *, struct nlm_lock *); 155int nlmclnt_setgrantargs(struct nlm_rqst *, struct nlm_lock *);
@@ -204,7 +204,7 @@ nlmsvc_file_inode(struct nlm_file *file)
204 * Compare two host addresses (needs modifying for ipv6) 204 * Compare two host addresses (needs modifying for ipv6)
205 */ 205 */
206static __inline__ int 206static __inline__ int
207nlm_cmp_addr(struct sockaddr_in *sin1, struct sockaddr_in *sin2) 207nlm_cmp_addr(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
208{ 208{
209 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; 209 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
210} 210}
@@ -214,7 +214,7 @@ nlm_cmp_addr(struct sockaddr_in *sin1, struct sockaddr_in *sin2)
214 * When the second lock is of type F_UNLCK, this acts like a wildcard. 214 * When the second lock is of type F_UNLCK, this acts like a wildcard.
215 */ 215 */
216static __inline__ int 216static __inline__ int
217nlm_compare_locks(struct file_lock *fl1, struct file_lock *fl2) 217nlm_compare_locks(const struct file_lock *fl1, const struct file_lock *fl2)
218{ 218{
219 return fl1->fl_pid == fl2->fl_pid 219 return fl1->fl_pid == fl2->fl_pid
220 && fl1->fl_start == fl2->fl_start 220 && fl1->fl_start == fl2->fl_start
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7a61ccdcbc4b..82b83da25d77 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1087,6 +1087,7 @@
1087#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_8X 0x0181 1087#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_8X 0x0181
1088#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440SE_8X 0x0182 1088#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440SE_8X 0x0182
1089#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X 0x0183 1089#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X 0x0183
1090#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000 0x0185
1090#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO 0x0186 1091#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO 0x0186
1091#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO 0x0187 1092#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO 0x0187
1092#define PCI_DEVICE_ID_NVIDIA_QUADRO4_580_XGL 0x0188 1093#define PCI_DEVICE_ID_NVIDIA_QUADRO4_580_XGL 0x0188
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9c1da0269a18..b6f51e3a38ec 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -697,12 +697,9 @@ struct task_struct {
697 697
698 int lock_depth; /* BKL lock depth */ 698 int lock_depth; /* BKL lock depth */
699 699
700#if defined(CONFIG_SMP) 700#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
701 int last_waker_cpu; /* CPU that last woke this task up */
702#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
703 int oncpu; 701 int oncpu;
704#endif 702#endif
705#endif
706 int prio, static_prio; 703 int prio, static_prio;
707 struct list_head run_list; 704 struct list_head run_list;
708 prio_array_t *array; 705 prio_array_t *array;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 3877209d23c3..d73501ba7e44 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -557,6 +557,8 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
557 int mode); 557 int mode);
558asmlinkage long sys_newfstatat(int dfd, char __user *filename, 558asmlinkage long sys_newfstatat(int dfd, char __user *filename,
559 struct stat __user *statbuf, int flag); 559 struct stat __user *statbuf, int flag);
560asmlinkage long sys_fstatat64(int dfd, char __user *filename,
561 struct stat64 __user *statbuf, int flag);
560asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, 562asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
561 int bufsiz); 563 int bufsiz);
562asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, 564asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
diff --git a/include/linux/time.h b/include/linux/time.h
index 7b4dc36532bb..d9cdba54b789 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -33,11 +33,34 @@ struct timezone {
33#define NSEC_PER_SEC 1000000000L 33#define NSEC_PER_SEC 1000000000L
34#define NSEC_PER_USEC 1000L 34#define NSEC_PER_USEC 1000L
35 35
36static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) 36static inline int timespec_equal(struct timespec *a, struct timespec *b)
37{ 37{
38 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); 38 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
39} 39}
40 40
41/*
42 * lhs < rhs: return <0
43 * lhs == rhs: return 0
44 * lhs > rhs: return >0
45 */
46static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs)
47{
48 if (lhs->tv_sec < rhs->tv_sec)
49 return -1;
50 if (lhs->tv_sec > rhs->tv_sec)
51 return 1;
52 return lhs->tv_nsec - rhs->tv_nsec;
53}
54
55static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs)
56{
57 if (lhs->tv_sec < rhs->tv_sec)
58 return -1;
59 if (lhs->tv_sec > rhs->tv_sec)
60 return 1;
61 return lhs->tv_usec - rhs->tv_usec;
62}
63
41extern unsigned long mktime(const unsigned int year, const unsigned int mon, 64extern unsigned long mktime(const unsigned int year, const unsigned int mon,
42 const unsigned int day, const unsigned int hour, 65 const unsigned int day, const unsigned int hour,
43 const unsigned int min, const unsigned int sec); 66 const unsigned int min, const unsigned int sec);
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index bbfac86734ec..89d743cfdfdf 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -33,7 +33,7 @@
33#define RFCOMM_DEFAULT_MTU 127 33#define RFCOMM_DEFAULT_MTU 127
34#define RFCOMM_DEFAULT_CREDITS 7 34#define RFCOMM_DEFAULT_CREDITS 7
35 35
36#define RFCOMM_MAX_L2CAP_MTU 1024 36#define RFCOMM_MAX_L2CAP_MTU 1013
37#define RFCOMM_MAX_CREDITS 40 37#define RFCOMM_MAX_CREDITS 40
38 38
39#define RFCOMM_SKB_HEAD_RESERVE 8 39#define RFCOMM_SKB_HEAD_RESERVE 8
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 05a840837fe7..1880e46ecc9b 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -82,9 +82,9 @@ do { if(!(expr)) { \
82#define IRDA_ASSERT_LABEL(label) 82#define IRDA_ASSERT_LABEL(label)
83#endif /* CONFIG_IRDA_DEBUG */ 83#endif /* CONFIG_IRDA_DEBUG */
84 84
85#define IRDA_WARNING(args...) printk(KERN_WARNING args) 85#define IRDA_WARNING(args...) do { if (net_ratelimit()) printk(KERN_WARNING args); } while (0)
86#define IRDA_MESSAGE(args...) printk(KERN_INFO args) 86#define IRDA_MESSAGE(args...) do { if (net_ratelimit()) printk(KERN_INFO args); } while (0)
87#define IRDA_ERROR(args...) printk(KERN_ERR args) 87#define IRDA_ERROR(args...) do { if (net_ratelimit()) printk(KERN_ERR args); } while (0)
88 88
89/* 89/*
90 * Magic numbers used by Linux-IrDA. Random numbers which must be unique to 90 * Magic numbers used by Linux-IrDA. Random numbers which must be unique to
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 2b6e1757aedd..5ae51f1bc7c8 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
418 /* Switch the timer base, if necessary: */ 418 /* Switch the timer base, if necessary: */
419 new_base = switch_hrtimer_base(timer, base); 419 new_base = switch_hrtimer_base(timer, base);
420 420
421 if (mode == HRTIMER_REL) 421 if (mode == HRTIMER_REL) {
422 tim = ktime_add(tim, new_base->get_time()); 422 tim = ktime_add(tim, new_base->get_time());
423 /*
424 * CONFIG_TIME_LOW_RES is a temporary way for architectures
425 * to signal that they simply return xtime in
426 * do_gettimeoffset(). In this case we want to round up by
427 * resolution when starting a relative timer, to avoid short
428 * timeouts. This will go away with the GTOD framework.
429 */
430#ifdef CONFIG_TIME_LOW_RES
431 tim = ktime_add(tim, base->resolution);
432#endif
433 }
423 timer->expires = tim; 434 timer->expires = tim;
424 435
425 enqueue_hrtimer(timer, new_base); 436 enqueue_hrtimer(timer, new_base);
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 5f33cdb6fff5..d2cf144d0af5 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -242,8 +242,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
242 if (write) { 242 if (write) {
243 copy_to_user_page(vma, page, addr, 243 copy_to_user_page(vma, page, addr,
244 maddr + offset, buf, bytes); 244 maddr + offset, buf, bytes);
245 if (!PageCompound(page)) 245 set_page_dirty_lock(page);
246 set_page_dirty_lock(page);
247 } else { 246 } else {
248 copy_from_user_page(vma, page, addr, 247 copy_from_user_page(vma, page, addr,
249 buf, maddr + offset, bytes); 248 buf, maddr + offset, bytes);
diff --git a/kernel/sched.c b/kernel/sched.c
index 87d93be336a1..66d957227de9 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1204,9 +1204,6 @@ static int try_to_wake_up(task_t *p, unsigned int state, int sync)
1204 } 1204 }
1205 } 1205 }
1206 1206
1207 if (p->last_waker_cpu != this_cpu)
1208 goto out_set_cpu;
1209
1210 if (unlikely(!cpu_isset(this_cpu, p->cpus_allowed))) 1207 if (unlikely(!cpu_isset(this_cpu, p->cpus_allowed)))
1211 goto out_set_cpu; 1208 goto out_set_cpu;
1212 1209
@@ -1277,8 +1274,6 @@ out_set_cpu:
1277 cpu = task_cpu(p); 1274 cpu = task_cpu(p);
1278 } 1275 }
1279 1276
1280 p->last_waker_cpu = this_cpu;
1281
1282out_activate: 1277out_activate:
1283#endif /* CONFIG_SMP */ 1278#endif /* CONFIG_SMP */
1284 if (old_state == TASK_UNINTERRUPTIBLE) { 1279 if (old_state == TASK_UNINTERRUPTIBLE) {
@@ -1360,12 +1355,9 @@ void fastcall sched_fork(task_t *p, int clone_flags)
1360#ifdef CONFIG_SCHEDSTATS 1355#ifdef CONFIG_SCHEDSTATS
1361 memset(&p->sched_info, 0, sizeof(p->sched_info)); 1356 memset(&p->sched_info, 0, sizeof(p->sched_info));
1362#endif 1357#endif
1363#if defined(CONFIG_SMP) 1358#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
1364 p->last_waker_cpu = cpu;
1365#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
1366 p->oncpu = 0; 1359 p->oncpu = 0;
1367#endif 1360#endif
1368#endif
1369#ifdef CONFIG_PREEMPT 1361#ifdef CONFIG_PREEMPT
1370 /* Want to start with kernel preemption disabled. */ 1362 /* Want to start with kernel preemption disabled. */
1371 task_thread_info(p)->preempt_count = 1; 1363 task_thread_info(p)->preempt_count = 1;
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 67f29516662a..508707704d2c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -85,7 +85,7 @@ void free_huge_page(struct page *page)
85 BUG_ON(page_count(page)); 85 BUG_ON(page_count(page));
86 86
87 INIT_LIST_HEAD(&page->lru); 87 INIT_LIST_HEAD(&page->lru);
88 page[1].mapping = NULL; 88 page[1].lru.next = NULL; /* reset dtor */
89 89
90 spin_lock(&hugetlb_lock); 90 spin_lock(&hugetlb_lock);
91 enqueue_huge_page(page); 91 enqueue_huge_page(page);
@@ -105,7 +105,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr)
105 } 105 }
106 spin_unlock(&hugetlb_lock); 106 spin_unlock(&hugetlb_lock);
107 set_page_count(page, 1); 107 set_page_count(page, 1);
108 page[1].mapping = (void *)free_huge_page; 108 page[1].lru.next = (void *)free_huge_page; /* set dtor */
109 for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) 109 for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i)
110 clear_user_highpage(&page[i], addr); 110 clear_user_highpage(&page[i], addr);
111 return page; 111 return page;
diff --git a/mm/madvise.c b/mm/madvise.c
index ae0ae3ea299a..af3d573b0141 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -22,16 +22,23 @@ static long madvise_behavior(struct vm_area_struct * vma,
22 struct mm_struct * mm = vma->vm_mm; 22 struct mm_struct * mm = vma->vm_mm;
23 int error = 0; 23 int error = 0;
24 pgoff_t pgoff; 24 pgoff_t pgoff;
25 int new_flags = vma->vm_flags & ~VM_READHINTMASK; 25 int new_flags = vma->vm_flags;
26 26
27 switch (behavior) { 27 switch (behavior) {
28 case MADV_NORMAL:
29 new_flags = new_flags & ~VM_RAND_READ & ~VM_SEQ_READ;
30 break;
28 case MADV_SEQUENTIAL: 31 case MADV_SEQUENTIAL:
29 new_flags |= VM_SEQ_READ; 32 new_flags = (new_flags & ~VM_RAND_READ) | VM_SEQ_READ;
30 break; 33 break;
31 case MADV_RANDOM: 34 case MADV_RANDOM:
32 new_flags |= VM_RAND_READ; 35 new_flags = (new_flags & ~VM_SEQ_READ) | VM_RAND_READ;
33 break; 36 break;
34 default: 37 case MADV_DONTFORK:
38 new_flags |= VM_DONTCOPY;
39 break;
40 case MADV_DOFORK:
41 new_flags &= ~VM_DONTCOPY;
35 break; 42 break;
36 } 43 }
37 44
@@ -177,6 +184,12 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
177 long error; 184 long error;
178 185
179 switch (behavior) { 186 switch (behavior) {
187 case MADV_DOFORK:
188 if (vma->vm_flags & VM_IO) {
189 error = -EINVAL;
190 break;
191 }
192 case MADV_DONTFORK:
180 case MADV_NORMAL: 193 case MADV_NORMAL:
181 case MADV_SEQUENTIAL: 194 case MADV_SEQUENTIAL:
182 case MADV_RANDOM: 195 case MADV_RANDOM:
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index dde04ff4be31..62c122528587 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -56,6 +56,7 @@ long nr_swap_pages;
56int percpu_pagelist_fraction; 56int percpu_pagelist_fraction;
57 57
58static void fastcall free_hot_cold_page(struct page *page, int cold); 58static void fastcall free_hot_cold_page(struct page *page, int cold);
59static void __free_pages_ok(struct page *page, unsigned int order);
59 60
60/* 61/*
61 * results with 256, 32 in the lowmem_reserve sysctl: 62 * results with 256, 32 in the lowmem_reserve sysctl:
@@ -169,20 +170,23 @@ static void bad_page(struct page *page)
169 * All pages have PG_compound set. All pages have their ->private pointing at 170 * All pages have PG_compound set. All pages have their ->private pointing at
170 * the head page (even the head page has this). 171 * the head page (even the head page has this).
171 * 172 *
172 * The first tail page's ->mapping, if non-zero, holds the address of the 173 * The first tail page's ->lru.next holds the address of the compound page's
173 * compound page's put_page() function. 174 * put_page() function. Its ->lru.prev holds the order of allocation.
174 * 175 * This usage means that zero-order pages may not be compound.
175 * The order of the allocation is stored in the first tail page's ->index
176 * This is only for debug at present. This usage means that zero-order pages
177 * may not be compound.
178 */ 176 */
177
178static void free_compound_page(struct page *page)
179{
180 __free_pages_ok(page, (unsigned long)page[1].lru.prev);
181}
182
179static void prep_compound_page(struct page *page, unsigned long order) 183static void prep_compound_page(struct page *page, unsigned long order)
180{ 184{
181 int i; 185 int i;
182 int nr_pages = 1 << order; 186 int nr_pages = 1 << order;
183 187
184 page[1].mapping = NULL; 188 page[1].lru.next = (void *)free_compound_page; /* set dtor */
185 page[1].index = order; 189 page[1].lru.prev = (void *)order;
186 for (i = 0; i < nr_pages; i++) { 190 for (i = 0; i < nr_pages; i++) {
187 struct page *p = page + i; 191 struct page *p = page + i;
188 192
@@ -196,7 +200,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
196 int i; 200 int i;
197 int nr_pages = 1 << order; 201 int nr_pages = 1 << order;
198 202
199 if (unlikely(page[1].index != order)) 203 if (unlikely((unsigned long)page[1].lru.prev != order))
200 bad_page(page); 204 bad_page(page);
201 205
202 for (i = 0; i < nr_pages; i++) { 206 for (i = 0; i < nr_pages; i++) {
diff --git a/mm/swap.c b/mm/swap.c
index 76247424dea1..cce3dda59c59 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -40,7 +40,7 @@ static void put_compound_page(struct page *page)
40 if (put_page_testzero(page)) { 40 if (put_page_testzero(page)) {
41 void (*dtor)(struct page *page); 41 void (*dtor)(struct page *page);
42 42
43 dtor = (void (*)(struct page *))page[1].mapping; 43 dtor = (void (*)(struct page *))page[1].lru.next;
44 (*dtor)(page); 44 (*dtor)(page);
45 } 45 }
46} 46}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5db32fdfaf39..1838c15ca4fd 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -443,6 +443,10 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
443 BUG_ON(PageActive(page)); 443 BUG_ON(PageActive(page));
444 444
445 sc->nr_scanned++; 445 sc->nr_scanned++;
446
447 if (!sc->may_swap && page_mapped(page))
448 goto keep_locked;
449
446 /* Double the slab pressure for mapped and swapcache pages */ 450 /* Double the slab pressure for mapped and swapcache pages */
447 if (page_mapped(page) || PageSwapCache(page)) 451 if (page_mapped(page) || PageSwapCache(page))
448 sc->nr_scanned++; 452 sc->nr_scanned++;
@@ -1191,9 +1195,47 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
1191 struct page *page; 1195 struct page *page;
1192 struct pagevec pvec; 1196 struct pagevec pvec;
1193 int reclaim_mapped = 0; 1197 int reclaim_mapped = 0;
1194 long mapped_ratio; 1198
1195 long distress; 1199 if (unlikely(sc->may_swap)) {
1196 long swap_tendency; 1200 long mapped_ratio;
1201 long distress;
1202 long swap_tendency;
1203
1204 /*
1205 * `distress' is a measure of how much trouble we're having
1206 * reclaiming pages. 0 -> no problems. 100 -> great trouble.
1207 */
1208 distress = 100 >> zone->prev_priority;
1209
1210 /*
1211 * The point of this algorithm is to decide when to start
1212 * reclaiming mapped memory instead of just pagecache. Work out
1213 * how much memory
1214 * is mapped.
1215 */
1216 mapped_ratio = (sc->nr_mapped * 100) / total_memory;
1217
1218 /*
1219 * Now decide how much we really want to unmap some pages. The
1220 * mapped ratio is downgraded - just because there's a lot of
1221 * mapped memory doesn't necessarily mean that page reclaim
1222 * isn't succeeding.
1223 *
1224 * The distress ratio is important - we don't want to start
1225 * going oom.
1226 *
1227 * A 100% value of vm_swappiness overrides this algorithm
1228 * altogether.
1229 */
1230 swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
1231
1232 /*
1233 * Now use this metric to decide whether to start moving mapped
1234 * memory onto the inactive list.
1235 */
1236 if (swap_tendency >= 100)
1237 reclaim_mapped = 1;
1238 }
1197 1239
1198 lru_add_drain(); 1240 lru_add_drain();
1199 spin_lock_irq(&zone->lru_lock); 1241 spin_lock_irq(&zone->lru_lock);
@@ -1203,37 +1245,6 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
1203 zone->nr_active -= pgmoved; 1245 zone->nr_active -= pgmoved;
1204 spin_unlock_irq(&zone->lru_lock); 1246 spin_unlock_irq(&zone->lru_lock);
1205 1247
1206 /*
1207 * `distress' is a measure of how much trouble we're having reclaiming
1208 * pages. 0 -> no problems. 100 -> great trouble.
1209 */
1210 distress = 100 >> zone->prev_priority;
1211
1212 /*
1213 * The point of this algorithm is to decide when to start reclaiming
1214 * mapped memory instead of just pagecache. Work out how much memory
1215 * is mapped.
1216 */
1217 mapped_ratio = (sc->nr_mapped * 100) / total_memory;
1218
1219 /*
1220 * Now decide how much we really want to unmap some pages. The mapped
1221 * ratio is downgraded - just because there's a lot of mapped memory
1222 * doesn't necessarily mean that page reclaim isn't succeeding.
1223 *
1224 * The distress ratio is important - we don't want to start going oom.
1225 *
1226 * A 100% value of vm_swappiness overrides this algorithm altogether.
1227 */
1228 swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
1229
1230 /*
1231 * Now use this metric to decide whether to start moving mapped memory
1232 * onto the inactive list.
1233 */
1234 if (swap_tendency >= 100)
1235 reclaim_mapped = 1;
1236
1237 while (!list_empty(&l_hold)) { 1248 while (!list_empty(&l_hold)) {
1238 cond_resched(); 1249 cond_resched();
1239 page = lru_to_page(&l_hold); 1250 page = lru_to_page(&l_hold);
@@ -1610,9 +1621,7 @@ scan:
1610 sc.nr_reclaimed = 0; 1621 sc.nr_reclaimed = 0;
1611 sc.priority = priority; 1622 sc.priority = priority;
1612 sc.swap_cluster_max = nr_pages? nr_pages : SWAP_CLUSTER_MAX; 1623 sc.swap_cluster_max = nr_pages? nr_pages : SWAP_CLUSTER_MAX;
1613 atomic_inc(&zone->reclaim_in_progress);
1614 shrink_zone(zone, &sc); 1624 shrink_zone(zone, &sc);
1615 atomic_dec(&zone->reclaim_in_progress);
1616 reclaim_state->reclaimed_slab = 0; 1625 reclaim_state->reclaimed_slab = 0;
1617 nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL, 1626 nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL,
1618 lru_pages); 1627 lru_pages);
diff --git a/net/802/p8023.c b/net/802/p8023.c
index d23e906456eb..53cf05709283 100644
--- a/net/802/p8023.c
+++ b/net/802/p8023.c
@@ -59,3 +59,5 @@ void destroy_8023_client(struct datalink_proto *dl)
59 59
60EXPORT_SYMBOL(destroy_8023_client); 60EXPORT_SYMBOL(destroy_8023_client);
61EXPORT_SYMBOL(make_8023_client); 61EXPORT_SYMBOL(make_8023_client);
62
63MODULE_LICENSE("GPL");
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index e7211a7f382c..93ad59a28ef5 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -56,7 +56,8 @@ static void sigd_put_skb(struct sk_buff *skb)
56 remove_wait_queue(&sigd_sleep,&wait); 56 remove_wait_queue(&sigd_sleep,&wait);
57#else 57#else
58 if (!sigd) { 58 if (!sigd) {
59 printk(KERN_WARNING "atmsvc: no signaling demon\n"); 59 if (net_ratelimit())
60 printk(KERN_WARNING "atmsvc: no signaling demon\n");
60 kfree_skb(skb); 61 kfree_skb(skb);
61 return; 62 return;
62 } 63 }
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index bdb6458c6bd5..97bdec73d17e 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -143,13 +143,15 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
143static int hci_sock_release(struct socket *sock) 143static int hci_sock_release(struct socket *sock)
144{ 144{
145 struct sock *sk = sock->sk; 145 struct sock *sk = sock->sk;
146 struct hci_dev *hdev = hci_pi(sk)->hdev; 146 struct hci_dev *hdev;
147 147
148 BT_DBG("sock %p sk %p", sock, sk); 148 BT_DBG("sock %p sk %p", sock, sk);
149 149
150 if (!sk) 150 if (!sk)
151 return 0; 151 return 0;
152 152
153 hdev = hci_pi(sk)->hdev;
154
153 bt_sock_unlink(&hci_sk_list, sk); 155 bt_sock_unlink(&hci_sk_list, sk);
154 156
155 if (hdev) { 157 if (hdev) {
@@ -311,14 +313,18 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, int *add
311{ 313{
312 struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr; 314 struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr;
313 struct sock *sk = sock->sk; 315 struct sock *sk = sock->sk;
316 struct hci_dev *hdev = hci_pi(sk)->hdev;
314 317
315 BT_DBG("sock %p sk %p", sock, sk); 318 BT_DBG("sock %p sk %p", sock, sk);
316 319
320 if (!hdev)
321 return -EBADFD;
322
317 lock_sock(sk); 323 lock_sock(sk);
318 324
319 *addr_len = sizeof(*haddr); 325 *addr_len = sizeof(*haddr);
320 haddr->hci_family = AF_BLUETOOTH; 326 haddr->hci_family = AF_BLUETOOTH;
321 haddr->hci_dev = hci_pi(sk)->hdev->id; 327 haddr->hci_dev = hdev->id;
322 328
323 release_sock(sk); 329 release_sock(sk);
324 return 0; 330 return 0;
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 0d89d6434136..5b4253c61f62 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -46,13 +46,15 @@
46#include <net/bluetooth/l2cap.h> 46#include <net/bluetooth/l2cap.h>
47#include <net/bluetooth/rfcomm.h> 47#include <net/bluetooth/rfcomm.h>
48 48
49#define VERSION "1.6"
50
51#ifndef CONFIG_BT_RFCOMM_DEBUG 49#ifndef CONFIG_BT_RFCOMM_DEBUG
52#undef BT_DBG 50#undef BT_DBG
53#define BT_DBG(D...) 51#define BT_DBG(D...)
54#endif 52#endif
55 53
54#define VERSION "1.7"
55
56static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;
57
56static struct task_struct *rfcomm_thread; 58static struct task_struct *rfcomm_thread;
57 59
58static DECLARE_MUTEX(rfcomm_sem); 60static DECLARE_MUTEX(rfcomm_sem);
@@ -623,7 +625,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
623 /* Set L2CAP options */ 625 /* Set L2CAP options */
624 sk = sock->sk; 626 sk = sock->sk;
625 lock_sock(sk); 627 lock_sock(sk);
626 l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU; 628 l2cap_pi(sk)->imtu = l2cap_mtu;
627 release_sock(sk); 629 release_sock(sk);
628 630
629 s = rfcomm_session_add(sock, BT_BOUND); 631 s = rfcomm_session_add(sock, BT_BOUND);
@@ -1868,7 +1870,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
1868 /* Set L2CAP options */ 1870 /* Set L2CAP options */
1869 sk = sock->sk; 1871 sk = sock->sk;
1870 lock_sock(sk); 1872 lock_sock(sk);
1871 l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU; 1873 l2cap_pi(sk)->imtu = l2cap_mtu;
1872 release_sock(sk); 1874 release_sock(sk);
1873 1875
1874 /* Start listening on the socket */ 1876 /* Start listening on the socket */
@@ -2070,6 +2072,9 @@ static void __exit rfcomm_exit(void)
2070module_init(rfcomm_init); 2072module_init(rfcomm_init);
2071module_exit(rfcomm_exit); 2073module_exit(rfcomm_exit);
2072 2074
2075module_param(l2cap_mtu, uint, 0644);
2076MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection");
2077
2073MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>"); 2078MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
2074MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION); 2079MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
2075MODULE_VERSION(VERSION); 2080MODULE_VERSION(VERSION);
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index b5018166b0e5..6bb0c7eb1ef0 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -805,8 +805,8 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
805print_error: 805print_error:
806 if (skb->dev != NULL) { 806 if (skb->dev != NULL) {
807 printk("[%s]", skb->dev->name); 807 printk("[%s]", skb->dev->name);
808 if (has_bridge_parent(skb->dev)) 808 if (realoutdev)
809 printk("[%s]", bridge_parent(skb->dev)->name); 809 printk("[%s]", realoutdev->name);
810 } 810 }
811 printk(" head:%p, raw:%p, data:%p\n", skb->head, skb->mac.raw, 811 printk(" head:%p, raw:%p, data:%p\n", skb->head, skb->mac.raw,
812 skb->data); 812 skb->data);
diff --git a/net/core/datagram.c b/net/core/datagram.c
index f8d322e1ea92..b8ce6bf81188 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -247,49 +247,74 @@ EXPORT_SYMBOL(skb_kill_datagram);
247int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset, 247int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
248 struct iovec *to, int len) 248 struct iovec *to, int len)
249{ 249{
250 int i, err, fraglen, end = 0; 250 int start = skb_headlen(skb);
251 struct sk_buff *next = skb_shinfo(skb)->frag_list; 251 int i, copy = start - offset;
252 252
253 if (!len) 253 /* Copy header. */
254 return 0; 254 if (copy > 0) {
255 if (copy > len)
256 copy = len;
257 if (memcpy_toiovec(to, skb->data + offset, copy))
258 goto fault;
259 if ((len -= copy) == 0)
260 return 0;
261 offset += copy;
262 }
255 263
256next_skb: 264 /* Copy paged appendix. Hmm... why does this look so complicated? */
257 fraglen = skb_headlen(skb); 265 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
258 i = -1; 266 int end;
259 267
260 while (1) { 268 BUG_TRAP(start <= offset + len);
261 int start = end;
262 269
263 if ((end += fraglen) > offset) { 270 end = start + skb_shinfo(skb)->frags[i].size;
264 int copy = end - offset, o = offset - start; 271 if ((copy = end - offset) > 0) {
272 int err;
273 u8 *vaddr;
274 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
275 struct page *page = frag->page;
265 276
266 if (copy > len) 277 if (copy > len)
267 copy = len; 278 copy = len;
268 if (i == -1) 279 vaddr = kmap(page);
269 err = memcpy_toiovec(to, skb->data + o, copy); 280 err = memcpy_toiovec(to, vaddr + frag->page_offset +
270 else { 281 offset - start, copy);
271 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 282 kunmap(page);
272 struct page *page = frag->page;
273 void *p = kmap(page) + frag->page_offset + o;
274 err = memcpy_toiovec(to, p, copy);
275 kunmap(page);
276 }
277 if (err) 283 if (err)
278 goto fault; 284 goto fault;
279 if (!(len -= copy)) 285 if (!(len -= copy))
280 return 0; 286 return 0;
281 offset += copy; 287 offset += copy;
282 } 288 }
283 if (++i >= skb_shinfo(skb)->nr_frags) 289 start = end;
284 break;
285 fraglen = skb_shinfo(skb)->frags[i].size;
286 } 290 }
287 if (next) { 291
288 skb = next; 292 if (skb_shinfo(skb)->frag_list) {
289 BUG_ON(skb_shinfo(skb)->frag_list); 293 struct sk_buff *list = skb_shinfo(skb)->frag_list;
290 next = skb->next; 294
291 goto next_skb; 295 for (; list; list = list->next) {
296 int end;
297
298 BUG_TRAP(start <= offset + len);
299
300 end = start + list->len;
301 if ((copy = end - offset) > 0) {
302 if (copy > len)
303 copy = len;
304 if (skb_copy_datagram_iovec(list,
305 offset - start,
306 to, copy))
307 goto fault;
308 if ((len -= copy) == 0)
309 return 0;
310 offset += copy;
311 }
312 start = end;
313 }
292 } 314 }
315 if (!len)
316 return 0;
317
293fault: 318fault:
294 return -EFAULT; 319 return -EFAULT;
295} 320}
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 4d1c40972a4b..e7bbff4340bb 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -192,7 +192,7 @@ int sysctl_icmp_echo_ignore_all;
192int sysctl_icmp_echo_ignore_broadcasts = 1; 192int sysctl_icmp_echo_ignore_broadcasts = 1;
193 193
194/* Control parameter - ignore bogus broadcast responses? */ 194/* Control parameter - ignore bogus broadcast responses? */
195int sysctl_icmp_ignore_bogus_error_responses; 195int sysctl_icmp_ignore_bogus_error_responses = 1;
196 196
197/* 197/*
198 * Configurable global rate limit. 198 * Configurable global rate limit.
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 738376cf0c51..ae20a0ec9bd8 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -803,10 +803,7 @@ back_from_confirm:
803 err = rawv6_push_pending_frames(sk, &fl, rp); 803 err = rawv6_push_pending_frames(sk, &fl, rp);
804 } 804 }
805done: 805done:
806 ip6_dst_store(sk, dst, 806 dst_release(dst);
807 ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
808 &np->daddr : NULL);
809
810 release_sock(sk); 807 release_sock(sk);
811out: 808out:
812 fl6_sock_release(flowlabel); 809 fl6_sock_release(flowlabel);
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 99c0a0fa4a97..0e550127fa7e 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -102,8 +102,6 @@ config NF_CT_NETLINK
102 help 102 help
103 This option enables support for a netlink-based userspace interface 103 This option enables support for a netlink-based userspace interface
104 104
105endmenu
106
107config NETFILTER_XTABLES 105config NETFILTER_XTABLES
108 tristate "Netfilter Xtables support (required for ip_tables)" 106 tristate "Netfilter Xtables support (required for ip_tables)"
109 help 107 help
@@ -361,3 +359,5 @@ config NETFILTER_XT_MATCH_TCPMSS
361 359
362 To compile it as a module, choose M here. If unsure, say N. 360 To compile it as a module, choose M here. If unsure, say N.
363 361
362endmenu
363
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 4ae1538c54a9..43e72419c868 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -238,7 +238,7 @@ int genl_register_family(struct genl_family *family)
238 sizeof(struct nlattr *), GFP_KERNEL); 238 sizeof(struct nlattr *), GFP_KERNEL);
239 if (family->attrbuf == NULL) { 239 if (family->attrbuf == NULL) {
240 err = -ENOMEM; 240 err = -ENOMEM;
241 goto errout; 241 goto errout_locked;
242 } 242 }
243 } else 243 } else
244 family->attrbuf = NULL; 244 family->attrbuf = NULL;
@@ -288,7 +288,7 @@ int genl_unregister_family(struct genl_family *family)
288 return -ENOENT; 288 return -ENOENT;
289} 289}
290 290
291static inline int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, 291static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
292 int *errp) 292 int *errp)
293{ 293{
294 struct genl_ops *ops; 294 struct genl_ops *ops;
@@ -375,7 +375,7 @@ static void genl_rcv(struct sock *sk, int len)
375 do { 375 do {
376 if (genl_trylock()) 376 if (genl_trylock())
377 return; 377 return;
378 netlink_run_queue(sk, &qlen, &genl_rcv_msg); 378 netlink_run_queue(sk, &qlen, genl_rcv_msg);
379 genl_unlock(); 379 genl_unlock();
380 } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen); 380 } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen);
381} 381}
@@ -549,10 +549,8 @@ static int __init genl_init(void)
549 netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV); 549 netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
550 genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID, 550 genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID,
551 genl_rcv, THIS_MODULE); 551 genl_rcv, THIS_MODULE);
552 if (genl_sock == NULL) { 552 if (genl_sock == NULL)
553 panic("GENL: Cannot initialize generic netlink\n"); 553 panic("GENL: Cannot initialize generic netlink\n");
554 return -ENOMEM;
555 }
556 554
557 return 0; 555 return 0;
558 556
@@ -560,7 +558,6 @@ errout_register:
560 genl_unregister_family(&genl_ctrl); 558 genl_unregister_family(&genl_ctrl);
561errout: 559errout:
562 panic("GENL: Cannot register controller: %d\n", err); 560 panic("GENL: Cannot register controller: %d\n", err);
563 return err;
564} 561}
565 562
566subsys_initcall(genl_init); 563subsys_initcall(genl_init);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index dbf4620768d6..98ec53bd3ac7 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -889,7 +889,9 @@ restart:
889 xfrm_pol_put(policy); 889 xfrm_pol_put(policy);
890 if (dst) 890 if (dst)
891 dst_free(dst); 891 dst_free(dst);
892 goto restart; 892
893 err = -EHOSTUNREACH;
894 goto error;
893 } 895 }
894 dst->next = policy->bundles; 896 dst->next = policy->bundles;
895 policy->bundles = dst; 897 policy->bundles = dst;