aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/cachetlb.txt5
-rw-r--r--Documentation/filesystems/Locking8
-rw-r--r--Documentation/kdump/kdump.txt224
-rw-r--r--Documentation/powerpc/mpc52xx-device-tree-bindings.txt4
-rw-r--r--Documentation/x86_64/boot-options.txt4
-rw-r--r--MAINTAINERS28
-rw-r--r--Makefile31
-rw-r--r--arch/arm/kernel/entry-armv.S12
-rw-r--r--arch/arm/kernel/time.c13
-rw-r--r--arch/arm/kernel/traps.c1
-rw-r--r--arch/arm/mm/flush.c39
-rw-r--r--arch/cris/arch-v32/kernel/smp.c2
-rw-r--r--arch/i386/defconfig14
-rw-r--r--arch/i386/kernel/cpu/cyrix.c2
-rw-r--r--arch/i386/kernel/mpparse.c8
-rw-r--r--arch/i386/kernel/setup.c4
-rw-r--r--arch/i386/kernel/smpboot.c10
-rw-r--r--arch/i386/kernel/tsc.c2
-rw-r--r--arch/i386/mach-generic/bigsmp.c2
-rw-r--r--arch/i386/mach-generic/default.c2
-rw-r--r--arch/i386/mach-generic/es7000.c2
-rw-r--r--arch/i386/mach-generic/summit.c2
-rw-r--r--arch/i386/mm/init.c4
-rw-r--r--arch/ia64/mm/init.c5
-rw-r--r--arch/m32r/kernel/smpboot.c2
-rw-r--r--arch/mips/au1000/common/pci.c8
-rw-r--r--arch/mips/kernel/linux32.c16
-rw-r--r--arch/mips/kernel/mips_ksyms.c2
-rw-r--r--arch/mips/kernel/scall64-n32.S4
-rw-r--r--arch/mips/kernel/smp.c2
-rw-r--r--arch/mips/kernel/time.c2
-rw-r--r--arch/mips/lib/Makefile2
-rw-r--r--arch/mips/lib/csum_partial.S442
-rw-r--r--arch/mips/lib/csum_partial_copy.c52
-rw-r--r--arch/mips/mips-boards/generic/time.c9
-rw-r--r--arch/mips/mips-boards/malta/malta_mtd.c63
-rw-r--r--arch/mips/mips-boards/sead/sead_int.c4
-rw-r--r--arch/mips/mm/pg-r4k.c9
-rw-r--r--arch/mips/pci/ops-pnx8550.c2
-rw-r--r--arch/mips/philips/pnx8550/common/time.c45
-rw-r--r--arch/parisc/kernel/smp.c2
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts4
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts4
-rw-r--r--arch/powerpc/configs/ppc64_defconfig251
-rw-r--r--arch/powerpc/kernel/asm-offsets.c3
-rw-r--r--arch/powerpc/kernel/entry_64.S13
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/mm/hugetlbpage.c8
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c1
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c7
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c4
-rw-r--r--arch/powerpc/platforms/iseries/mf.c4
-rw-r--r--arch/powerpc/platforms/iseries/proc.c11
-rw-r--r--arch/powerpc/platforms/iseries/setup.c3
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c4
-rw-r--r--arch/powerpc/platforms/maple/setup.c1
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c1
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S9
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c5
-rw-r--r--arch/powerpc/sysdev/Makefile2
-rw-r--r--arch/s390/kernel/head31.S12
-rw-r--r--arch/s390/kernel/head64.S12
-rw-r--r--arch/s390/kernel/setup.c2
-rw-r--r--arch/s390/kernel/smp.c5
-rw-r--r--arch/s390/lib/uaccess_pt.c3
-rw-r--r--arch/s390/lib/uaccess_std.c3
-rw-r--r--arch/s390/mm/vmem.c3
-rw-r--r--arch/sparc64/kernel/smp.c2
-rw-r--r--arch/x86_64/defconfig16
-rw-r--r--arch/x86_64/ia32/ia32_aout.c4
-rw-r--r--arch/x86_64/kernel/early-quirks.c5
-rw-r--r--arch/x86_64/kernel/io_apic.c124
-rw-r--r--arch/x86_64/kernel/pci-calgary.c11
-rw-r--r--arch/x86_64/kernel/time.c25
-rw-r--r--drivers/bluetooth/hci_usb.c7
-rw-r--r--drivers/char/hw_random/amd-rng.c2
-rw-r--r--drivers/char/hw_random/geode-rng.c2
-rw-r--r--drivers/char/hw_random/intel-rng.c34
-rw-r--r--drivers/char/hw_random/ixp4xx-rng.c2
-rw-r--r--drivers/char/hw_random/via-rng.c2
-rw-r--r--drivers/ieee1394/sbp2.c2
-rw-r--r--drivers/infiniband/core/cma.c17
-rw-r--r--drivers/infiniband/core/ucma.c11
-rw-r--r--drivers/infiniband/hw/ehca/ehca_hca.c8
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_iverbs.h4
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c10
-rw-r--r--drivers/infiniband/hw/ehca/ehca_mrmw.c4
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c4
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c8
-rw-r--r--drivers/infiniband/hw/mthca/mthca_memfree.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c26
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c4
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c26
-rw-r--r--drivers/kvm/svm.c8
-rw-r--r--drivers/kvm/vmx.c7
-rw-r--r--drivers/md/raid1.c13
-rw-r--r--drivers/md/raid10.c11
-rw-r--r--drivers/mmc/at91_mci.c11
-rw-r--r--drivers/mmc/mmci.c4
-rw-r--r--drivers/mmc/omap.c6
-rw-r--r--drivers/net/bnx2.c75
-rw-r--r--drivers/net/chelsio/my3126.c5
-rw-r--r--drivers/net/e1000/e1000_main.c6
-rw-r--r--drivers/net/forcedeth.c111
-rw-r--r--drivers/net/ixgb/ixgb.h1
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c1
-rw-r--r--drivers/net/ixgb/ixgb_hw.c3
-rw-r--r--drivers/net/ixgb/ixgb_main.c57
-rw-r--r--drivers/net/pcmcia/3c574_cs.c1
-rw-r--r--drivers/net/pcmcia/3c589_cs.c1
-rw-r--r--drivers/net/pcmcia/com20020_cs.c1
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c2
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c1
-rw-r--r--drivers/net/qla3xxx.c38
-rw-r--r--drivers/net/tg3.c17
-rw-r--r--drivers/net/tg3.h4
-rw-r--r--drivers/net/wireless/ipw2100.c2
-rw-r--r--drivers/net/wireless/netwave_cs.c1
-rw-r--r--drivers/net/wireless/ray_cs.c1
-rw-r--r--drivers/net/wireless/wl3501_cs.c1
-rw-r--r--drivers/pci/pci.c3
-rw-r--r--drivers/pci/quirks.c16
-rw-r--r--drivers/rtc/rtc-sh.c4
-rw-r--r--drivers/s390/char/vmcp.c2
-rw-r--r--drivers/s390/cio/cio.c12
-rw-r--r--drivers/s390/net/Kconfig5
-rw-r--r--drivers/s390/net/qeth.h2
-rw-r--r--drivers/s390/net/qeth_main.c217
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c1
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c1
-rw-r--r--drivers/serial/8250.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c2
-rw-r--r--drivers/usb/serial/Kconfig2
-rw-r--r--drivers/usb/serial/funsoft.c2
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/buffer.c6
-rw-r--r--fs/gfs2/ops_fstype.c4
-rw-r--r--fs/nfs/file.c16
-rw-r--r--fs/proc/proc_misc.c8
-rw-r--r--fs/super.c4
-rw-r--r--include/asm-alpha/posix_types.h2
-rw-r--r--include/asm-arm/arch-iop32x/iop32x.h2
-rw-r--r--include/asm-arm/cacheflush.h10
-rw-r--r--include/asm-arm/hardware/iop3xx.h6
-rw-r--r--include/asm-ia64/posix_types.h2
-rw-r--r--include/asm-mips/checksum.h31
-rw-r--r--include/asm-mips/irq.h6
-rw-r--r--include/asm-parisc/cacheflush.h2
-rw-r--r--include/asm-powerpc/bug.h27
-rw-r--r--include/asm-powerpc/hvcall.h2
-rw-r--r--include/asm-powerpc/mpc52xx.h1
-rw-r--r--include/asm-powerpc/posix_types.h2
-rw-r--r--include/asm-s390/futex.h4
-rw-r--r--include/asm-s390/posix_types.h2
-rw-r--r--include/asm-x86_64/bitops.h34
-rw-r--r--include/asm-xtensa/posix_types.h2
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/highmem.h2
-rw-r--r--include/linux/kernel.h3
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/mmzone.h8
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h1
-rw-r--r--include/linux/profile.h1
-rw-r--r--include/net/ieee80211.h2
-rw-r--r--include/sound/version.h2
-rw-r--r--init/Makefile10
-rw-r--r--init/main.c10
-rw-r--r--init/version.c10
-rw-r--r--kernel/cpu.c4
-rw-r--r--kernel/irq/spurious.c2
-rw-r--r--kernel/profile.c14
-rw-r--r--kernel/sched.c2
-rw-r--r--mm/memory.c2
-rw-r--r--mm/memory_hotplug.c6
-rw-r--r--mm/page_alloc.c25
-rw-r--r--mm/truncate.c12
-rw-r--r--net/bluetooth/cmtp/capi.c39
-rw-r--r--net/bluetooth/hci_sysfs.c7
-rw-r--r--net/bluetooth/rfcomm/sock.c9
-rw-r--r--net/bluetooth/rfcomm/tty.c22
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/devinet.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_standalone.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
-rw-r--r--net/netfilter/nf_conntrack_netbios_ns.c1
-rw-r--r--net/netlabel/netlabel_cipso_v4.c6
-rw-r--r--net/sctp/sm_make_chunk.c4
-rw-r--r--net/x25/x25_facilities.c12
-rw-r--r--scripts/kconfig/qconf.cc15
-rw-r--r--scripts/kconfig/qconf.h2
-rw-r--r--scripts/mod/modpost.c27
-rw-r--r--security/selinux/ss/context.h23
-rw-r--r--security/selinux/ss/mls.c30
-rw-r--r--security/selinux/ss/mls.h20
-rw-r--r--security/selinux/ss/services.c7
-rw-r--r--sound/pci/cmipci.c3
-rw-r--r--sound/pci/echoaudio/midi.c6
-rw-r--r--sound/pci/hda/hda_generic.c5
-rw-r--r--sound/pci/hda/hda_intel.c14
-rw-r--r--sound/usb/usbaudio.c10
-rw-r--r--sound/usb/usbmixer.c2
207 files changed, 2149 insertions, 930 deletions
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
index 73e794f0ff09..debf6813934a 100644
--- a/Documentation/cachetlb.txt
+++ b/Documentation/cachetlb.txt
@@ -373,14 +373,15 @@ maps this page at its virtual address.
373 likely that you will need to flush the instruction cache 373 likely that you will need to flush the instruction cache
374 for copy_to_user_page(). 374 for copy_to_user_page().
375 375
376 void flush_anon_page(struct page *page, unsigned long vmaddr) 376 void flush_anon_page(struct vm_area_struct *vma, struct page *page,
377 unsigned long vmaddr)
377 When the kernel needs to access the contents of an anonymous 378 When the kernel needs to access the contents of an anonymous
378 page, it calls this function (currently only 379 page, it calls this function (currently only
379 get_user_pages()). Note: flush_dcache_page() deliberately 380 get_user_pages()). Note: flush_dcache_page() deliberately
380 doesn't work for an anonymous page. The default 381 doesn't work for an anonymous page. The default
381 implementation is a nop (and should remain so for all coherent 382 implementation is a nop (and should remain so for all coherent
382 architectures). For incoherent architectures, it should flush 383 architectures). For incoherent architectures, it should flush
383 the cache of the page at vmaddr in the current user process. 384 the cache of the page at vmaddr.
384 385
385 void flush_kernel_dcache_page(struct page *page) 386 void flush_kernel_dcache_page(struct page *page)
386 When the kernel needs to modify a user page is has obtained 387 When the kernel needs to modify a user page is has obtained
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 790ef6fbe495..28bfea75bcf2 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -171,6 +171,7 @@ prototypes:
171 int (*releasepage) (struct page *, int); 171 int (*releasepage) (struct page *, int);
172 int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 172 int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
173 loff_t offset, unsigned long nr_segs); 173 loff_t offset, unsigned long nr_segs);
174 int (*launder_page) (struct page *);
174 175
175locking rules: 176locking rules:
176 All except set_page_dirty may block 177 All except set_page_dirty may block
@@ -188,6 +189,7 @@ bmap: yes
188invalidatepage: no yes 189invalidatepage: no yes
189releasepage: no yes 190releasepage: no yes
190direct_IO: no 191direct_IO: no
192launder_page: no yes
191 193
192 ->prepare_write(), ->commit_write(), ->sync_page() and ->readpage() 194 ->prepare_write(), ->commit_write(), ->sync_page() and ->readpage()
193may be called from the request handler (/dev/loop). 195may be called from the request handler (/dev/loop).
@@ -281,6 +283,12 @@ buffers from the page in preparation for freeing it. It returns zero to
281indicate that the buffers are (or may be) freeable. If ->releasepage is zero, 283indicate that the buffers are (or may be) freeable. If ->releasepage is zero,
282the kernel assumes that the fs has no private interest in the buffers. 284the kernel assumes that the fs has no private interest in the buffers.
283 285
286 ->launder_page() may be called prior to releasing a page if
287it is still found to be dirty. It returns zero if the page was successfully
288cleaned, or an error value if not. Note that in order to prevent the page
289getting mapped back in and redirtied, it needs to be kept locked
290across the entire operation.
291
284 Note: currently almost all instances of address_space methods are 292 Note: currently almost all instances of address_space methods are
285using BKL for internal serialization and that's one of the worst sources 293using BKL for internal serialization and that's one of the worst sources
286of contention. Normally they are calling library functions (in fs/buffer.c) 294of contention. Normally they are calling library functions (in fs/buffer.c)
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt
index 99f2d4d4bf7d..5af6676a88f0 100644
--- a/Documentation/kdump/kdump.txt
+++ b/Documentation/kdump/kdump.txt
@@ -17,7 +17,7 @@ You can use common Linux commands, such as cp and scp, to copy the
17memory image to a dump file on the local disk, or across the network to 17memory image to a dump file on the local disk, or across the network to
18a remote system. 18a remote system.
19 19
20Kdump and kexec are currently supported on the x86, x86_64, and ppc64 20Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64
21architectures. 21architectures.
22 22
23When the system kernel boots, it reserves a small section of memory for 23When the system kernel boots, it reserves a small section of memory for
@@ -54,59 +54,64 @@ memory," in two ways:
54Setup and Installation 54Setup and Installation
55====================== 55======================
56 56
57Install kexec-tools and the Kdump patch 57Install kexec-tools
58--------------------------------------- 58-------------------
59 59
601) Login as the root user. 601) Login as the root user.
61 61
622) Download the kexec-tools user-space package from the following URL: 622) Download the kexec-tools user-space package from the following URL:
63 63
64 http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz 64http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz
65 65
663) Unpack the tarball with the tar command, as follows: 66Note: Latest kexec-tools-testing git tree is available at
67
68 tar xvpzf kexec-tools-1.101.tar.gz
69
704) Download the latest consolidated Kdump patch from the following URL:
71
72 http://lse.sourceforge.net/kdump/
73 67
74 (This location is being used until all the user-space Kdump patches 68git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
75 are integrated with the kexec-tools package.) 69or
70http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary
76 71
775) Change to the kexec-tools-1.101 directory, as follows: 723) Unpack the tarball with the tar command, as follows:
78 73
79 cd kexec-tools-1.101 74 tar xvpzf kexec-tools-testing-20061214.tar.gz
80 75
816) Apply the consolidated patch to the kexec-tools-1.101 source tree 764) Change to the kexec-tools-1.101 directory, as follows:
82 with the patch command, as follows. (Modify the path to the downloaded
83 patch as necessary.)
84 77
85 patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch 78 cd kexec-tools-testing-20061214
86 79
877) Configure the package, as follows: 805) Configure the package, as follows:
88 81
89 ./configure 82 ./configure
90 83
918) Compile the package, as follows: 846) Compile the package, as follows:
92 85
93 make 86 make
94 87
959) Install the package, as follows: 887) Install the package, as follows:
96 89
97 make install 90 make install
98 91
99 92
100Download and build the system and dump-capture kernels 93Build the system and dump-capture kernels
101------------------------------------------------------ 94-----------------------------------------
95There are two possible methods of using Kdump.
96
971) Build a separate custom dump-capture kernel for capturing the
98 kernel core dump.
99
1002) Or use the system kernel binary itself as dump-capture kernel and there is
101 no need to build a separate dump-capture kernel. This is possible
102 only with the architecutres which support a relocatable kernel. As
103 of today i386 and ia64 architectures support relocatable kernel.
104
105Building a relocatable kernel is advantageous from the point of view that
106one does not have to build a second kernel for capturing the dump. But
107at the same time one might want to build a custom dump capture kernel
108suitable to his needs.
102 109
103Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer) 110Following are the configuration setting required for system and
104from http://www.kernel.org. Two kernels must be built: a system kernel 111dump-capture kernels for enabling kdump support.
105and a dump-capture kernel. Use the following steps to configure these
106kernels with the necessary kexec and Kdump features:
107 112
108System kernel 113System kernel config options
109------------- 114----------------------------
110 115
1111) Enable "kexec system call" in "Processor type and features." 1161) Enable "kexec system call" in "Processor type and features."
112 117
@@ -132,88 +137,160 @@ System kernel
132 analysis tools require a vmlinux with debug symbols in order to read 137 analysis tools require a vmlinux with debug symbols in order to read
133 and analyze a dump file. 138 and analyze a dump file.
134 139
1354) Make and install the kernel and its modules. Update the boot loader 140Dump-capture kernel config options (Arch Independent)
136 (such as grub, yaboot, or lilo) configuration files as necessary. 141-----------------------------------------------------
137
1385) Boot the system kernel with the boot parameter "crashkernel=Y@X",
139 where Y specifies how much memory to reserve for the dump-capture kernel
140 and X specifies the beginning of this reserved memory. For example,
141 "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
142 starting at physical address 0x01000000 for the dump-capture kernel.
143
144 On x86 and x86_64, use "crashkernel=64M@16M".
145 142
146 On ppc64, use "crashkernel=128M@32M". 1431) Enable "kernel crash dumps" support under "Processor type and
144 features":
147 145
146 CONFIG_CRASH_DUMP=y
148 147
149The dump-capture kernel 1482) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
150-----------------------
151 149
1521) Under "General setup," append "-kdump" to the current string in 150 CONFIG_PROC_VMCORE=y
153 "Local version." 151 (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
154 152
1552) On x86, enable high memory support under "Processor type and 153Dump-capture kernel config options (Arch Dependent, i386)
154--------------------------------------------------------
1551) On x86, enable high memory support under "Processor type and
156 features": 156 features":
157 157
158 CONFIG_HIGHMEM64G=y 158 CONFIG_HIGHMEM64G=y
159 or 159 or
160 CONFIG_HIGHMEM4G 160 CONFIG_HIGHMEM4G
161 161
1623) On x86 and x86_64, disable symmetric multi-processing support 1622) On x86 and x86_64, disable symmetric multi-processing support
163 under "Processor type and features": 163 under "Processor type and features":
164 164
165 CONFIG_SMP=n 165 CONFIG_SMP=n
166
166 (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line 167 (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
167 when loading the dump-capture kernel, see section "Load the Dump-capture 168 when loading the dump-capture kernel, see section "Load the Dump-capture
168 Kernel".) 169 Kernel".)
169 170
1704) On ppc64, disable NUMA support and enable EMBEDDED support: 1713) If one wants to build and use a relocatable kernel,
172 Enable "Build a relocatable kernel" support under "Processor type and
173 features"
171 174
172 CONFIG_NUMA=n 175 CONFIG_RELOCATABLE=y
173 CONFIG_EMBEDDED=y
174 CONFIG_EEH=N for the dump-capture kernel
175 176
1765) Enable "kernel crash dumps" support under "Processor type and 1774) Use a suitable value for "Physical address where the kernel is
177 features": 178 loaded" (under "Processor type and features"). This only appears when
179 "kernel crash dumps" is enabled. A suitable value depends upon
180 whether kernel is relocatable or not.
181
182 If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000
183 This will compile the kernel for physical address 1MB, but given the fact
184 kernel is relocatable, it can be run from any physical address hence
185 kexec boot loader will load it in memory region reserved for dump-capture
186 kernel.
187
188 Otherwise it should be the start of memory region reserved for
189 second kernel using boot parameter "crashkernel=Y@X". Here X is
190 start of memory region reserved for dump-capture kernel.
191 Generally X is 16MB (0x1000000). So you can set
192 CONFIG_PHYSICAL_START=0x1000000
193
1945) Make and install the kernel and its modules. DO NOT add this kernel
195 to the boot loader configuration files.
178 196
179 CONFIG_CRASH_DUMP=y 197Dump-capture kernel config options (Arch Dependent, x86_64)
198----------------------------------------------------------
1991) On x86 and x86_64, disable symmetric multi-processing support
200 under "Processor type and features":
201
202 CONFIG_SMP=n
203
204 (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
205 when loading the dump-capture kernel, see section "Load the Dump-capture
206 Kernel".)
180 207
1816) Use a suitable value for "Physical address where the kernel is 2082) Use a suitable value for "Physical address where the kernel is
182 loaded" (under "Processor type and features"). This only appears when 209 loaded" (under "Processor type and features"). This only appears when
183 "kernel crash dumps" is enabled. By default this value is 0x1000000 210 "kernel crash dumps" is enabled. By default this value is 0x1000000
184 (16MB). It should be the same as X in the "crashkernel=Y@X" boot 211 (16MB). It should be the same as X in the "crashkernel=Y@X" boot
185 parameter discussed above. 212 parameter.
186 213
187 On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000". 214 For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".
188 215
189 On ppc64 the value is automatically set at 32MB when 2163) Make and install the kernel and its modules. DO NOT add this kernel
190 CONFIG_CRASH_DUMP is set. 217 to the boot loader configuration files.
191
1926) Optionally enable "/proc/vmcore support" under "Filesystems" ->
193 "Pseudo filesystems".
194 218
195 CONFIG_PROC_VMCORE=y 219Dump-capture kernel config options (Arch Dependent, ppc64)
196 (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.) 220----------------------------------------------------------
197 221
1987) Make and install the kernel and its modules. DO NOT add this kernel 222- Make and install the kernel and its modules. DO NOT add this kernel
199 to the boot loader configuration files. 223 to the boot loader configuration files.
200 224
225Dump-capture kernel config options (Arch Dependent, ia64)
226----------------------------------------------------------
227(To be filled)
228
229
230Boot into System Kernel
231=======================
232
2331) Make and install the kernel and its modules. Update the boot loader
234 (such as grub, yaboot, or lilo) configuration files as necessary.
235
2362) Boot the system kernel with the boot parameter "crashkernel=Y@X",
237 where Y specifies how much memory to reserve for the dump-capture kernel
238 and X specifies the beginning of this reserved memory. For example,
239 "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
240 starting at physical address 0x01000000 (16MB) for the dump-capture kernel.
241
242 On x86 and x86_64, use "crashkernel=64M@16M".
243
244 On ppc64, use "crashkernel=128M@32M".
201 245
202Load the Dump-capture Kernel 246Load the Dump-capture Kernel
203============================ 247============================
204 248
205After booting to the system kernel, load the dump-capture kernel using 249After booting to the system kernel, dump-capture kernel needs to be
206the following command: 250loaded.
251
252Based on the architecture and type of image (relocatable or not), one
253can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz
254of dump-capture kernel. Following is the summary.
255
256For i386:
257 - Use vmlinux if kernel is not relocatable.
258 - Use bzImage/vmlinuz if kernel is relocatable.
259For x86_64:
260 - Use vmlinux
261For ppc64:
262 - Use vmlinux
263For ia64:
264 (To be filled)
265
266If you are using a uncompressed vmlinux image then use following command
267to load dump-capture kernel.
207 268
208 kexec -p <dump-capture-kernel> \ 269 kexec -p <dump-capture-kernel-vmlinux-image> \
209 --initrd=<initrd-for-dump-capture-kernel> --args-linux \ 270 --initrd=<initrd-for-dump-capture-kernel> --args-linux \
210 --append="root=<root-dev> init 1 irqpoll" 271 --append="root=<root-dev> <arch-specific-options>"
211 272
273If you are using a compressed bzImage/vmlinuz, then use following command
274to load dump-capture kernel.
212 275
213Notes on loading the dump-capture kernel: 276 kexec -p <dump-capture-kernel-bzImage> \
277 --initrd=<initrd-for-dump-capture-kernel> \
278 --append="root=<root-dev> <arch-specific-options>"
279
280Following are the arch specific command line options to be used while
281loading dump-capture kernel.
282
283For i386 and x86_64:
284 "init 1 irqpoll maxcpus=1"
285
286For ppc64:
287 "init 1 maxcpus=1 noirqdistrib"
214 288
215* <dump-capture-kernel> must be a vmlinux image (that is, an 289For IA64
216 uncompressed ELF image). bzImage does not work at this time. 290 (To be filled)
291
292
293Notes on loading the dump-capture kernel:
217 294
218* By default, the ELF headers are stored in ELF64 format to support 295* By default, the ELF headers are stored in ELF64 format to support
219 systems with more than 4GB memory. The --elf32-core-headers option can 296 systems with more than 4GB memory. The --elf32-core-headers option can
@@ -231,6 +308,9 @@ Notes on loading the dump-capture kernel:
231* "init 1" boots the dump-capture kernel into single-user mode without 308* "init 1" boots the dump-capture kernel into single-user mode without
232 networking. If you want networking, use "init 3." 309 networking. If you want networking, use "init 3."
233 310
311* We generally don' have to bring up a SMP kernel just to capture the
312 dump. Hence generally it is useful either to build a UP dump-capture
313 kernel or specify maxcpus=1 option while loading dump-capture kernel.
234 314
235Kernel Panic 315Kernel Panic
236============ 316============
diff --git a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
index d077d764f82b..7fb3b8a44eb6 100644
--- a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
+++ b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
@@ -157,8 +157,8 @@ rtc@<addr> rtc *-rtc Real time clock
157mscan@<addr> mscan *-mscan CAN bus controller 157mscan@<addr> mscan *-mscan CAN bus controller
158pci@<addr> pci *-pci PCI bridge 158pci@<addr> pci *-pci PCI bridge
159serial@<addr> serial *-psc-uart PSC in serial mode 159serial@<addr> serial *-psc-uart PSC in serial mode
160i2s@<addr> i2s *-psc-i2s PSC in i2s mode 160i2s@<addr> sound *-psc-i2s PSC in i2s mode
161ac97@<addr> ac97 *-psc-ac97 PSC in ac97 mode 161ac97@<addr> sound *-psc-ac97 PSC in ac97 mode
162spi@<addr> spi *-psc-spi PSC in spi mode 162spi@<addr> spi *-psc-spi PSC in spi mode
163irda@<addr> irda *-psc-irda PSC in IrDA mode 163irda@<addr> irda *-psc-irda PSC in IrDA mode
164spi@<addr> spi *-spi MPC52xx spi device 164spi@<addr> spi *-spi MPC52xx spi device
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index dbdcaf68e3ea..5c86ed6f0448 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -52,6 +52,10 @@ APICs
52 apicmaintimer. Useful when your PIT timer is totally 52 apicmaintimer. Useful when your PIT timer is totally
53 broken. 53 broken.
54 54
55 disable_8254_timer / enable_8254_timer
56 Enable interrupt 0 timer routing over the 8254 in addition to over
57 the IO-APIC. The kernel tries to set a sensible default.
58
55Early Console 59Early Console
56 60
57 syntax: earlyprintk=vga 61 syntax: earlyprintk=vga
diff --git a/MAINTAINERS b/MAINTAINERS
index 2bd34ef58ffa..49e4f554d211 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -412,20 +412,32 @@ S: Maintained
412ARM/INTEL IOP32X ARM ARCHITECTURE 412ARM/INTEL IOP32X ARM ARCHITECTURE
413P: Lennert Buytenhek 413P: Lennert Buytenhek
414M: kernel@wantstofly.org 414M: kernel@wantstofly.org
415P: Dan Williams
416M: dan.j.williams@intel.com
415L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 417L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
416S: Maintained 418S: Supported
419
420ARM/INTEL IOP33X ARM ARCHITECTURE
421P: Dan Williams
422M: dan.j.williams@intel.com
423L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
424S: Supported
417 425
418ARM/INTEL IOP13XX ARM ARCHITECTURE 426ARM/INTEL IOP13XX ARM ARCHITECTURE
419P: Lennert Buytenhek 427P: Lennert Buytenhek
420M: kernel@wantstofly.org 428M: kernel@wantstofly.org
429P: Dan Williams
430M: dan.j.williams@intel.com
421L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 431L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
422S: Maintained 432S: Supported
423 433
424ARM/INTEL IQ81342EX MACHINE SUPPORT 434ARM/INTEL IQ81342EX MACHINE SUPPORT
425P: Lennert Buytenhek 435P: Lennert Buytenhek
426M: kernel@wantstofly.org 436M: kernel@wantstofly.org
437P: Dan Williams
438M: dan.j.williams@intel.com
427L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 439L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
428S: Maintained 440S: Supported
429 441
430ARM/INTEL IXP2000 ARM ARCHITECTURE 442ARM/INTEL IXP2000 ARM ARCHITECTURE
431P: Lennert Buytenhek 443P: Lennert Buytenhek
@@ -448,8 +460,10 @@ S: Maintained
448ARM/INTEL XSC3 (MANZANO) ARM CORE 460ARM/INTEL XSC3 (MANZANO) ARM CORE
449P: Lennert Buytenhek 461P: Lennert Buytenhek
450M: kernel@wantstofly.org 462M: kernel@wantstofly.org
463P: Dan Williams
464M: dan.j.williams@intel.com
451L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) 465L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
452S: Maintained 466S: Supported
453 467
454ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT 468ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT
455P: Lennert Buytenhek 469P: Lennert Buytenhek
@@ -2622,6 +2636,12 @@ M: promise@pnd-pc.demon.co.uk
2622W: http://www.pnd-pc.demon.co.uk/promise/ 2636W: http://www.pnd-pc.demon.co.uk/promise/
2623S: Maintained 2637S: Maintained
2624 2638
2639PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
2640P: Mikael Pettersson
2641M: mikpe@it.uu.se
2642L: linux-ide@vger.kernel.org
2643S: Maintained
2644
2625PS3 PLATFORM SUPPORT 2645PS3 PLATFORM SUPPORT
2626P: Geoff Levand 2646P: Geoff Levand
2627M: geoffrey.levand@am.sony.com 2647M: geoffrey.levand@am.sony.com
diff --git a/Makefile b/Makefile
index fb5b3ef9ab11..47669cb6c8fb 100644
--- a/Makefile
+++ b/Makefile
@@ -368,14 +368,10 @@ endif
368# Detect when mixed targets is specified, and make a second invocation 368# Detect when mixed targets is specified, and make a second invocation
369# of make so .config is not included in this case either (for *config). 369# of make so .config is not included in this case either (for *config).
370 370
371PHONY += generated_headers 371no-dot-config-targets := clean mrproper distclean \
372
373generated_headers: include/linux/version.h include/linux/compile.h \
374 include/linux/utsrelease.h
375
376no-dot-config-targets := generated_headers clean mrproper distclean \
377 cscope TAGS tags help %docs check% \ 372 cscope TAGS tags help %docs check% \
378 headers_% kernelrelease kernelversion 373 include/linux/version.h headers_% \
374 kernelrelease kernelversion
379 375
380config-targets := 0 376config-targets := 0
381mixed-targets := 0 377mixed-targets := 0
@@ -738,16 +734,6 @@ debug_kallsyms: .tmp_map$(last_kallsyms)
738 734
739endif # ifdef CONFIG_KALLSYMS 735endif # ifdef CONFIG_KALLSYMS
740 736
741# compile.h changes depending on hostname, generation number, etc,
742# so we regenerate it always.
743# mkcompile_h will make sure to only update the
744# actual file if its content has changed.
745
746include/linux/compile.h: FORCE
747 @echo ' CHK $@'
748 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
749 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"
750
751# vmlinux image - including updated kernel symbols 737# vmlinux image - including updated kernel symbols
752vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 738vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
753ifdef CONFIG_HEADERS_CHECK 739ifdef CONFIG_HEADERS_CHECK
@@ -866,8 +852,8 @@ endif
866# prepare2 creates a makefile if using a separate output directory 852# prepare2 creates a makefile if using a separate output directory
867prepare2: prepare3 outputmakefile 853prepare2: prepare3 outputmakefile
868 854
869prepare1: prepare2 generated_headers include/asm include/config/auto.conf 855prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
870 856 include/asm include/config/auto.conf
871ifneq ($(KBUILD_MODULES),) 857ifneq ($(KBUILD_MODULES),)
872 $(Q)mkdir -p $(MODVERDIR) 858 $(Q)mkdir -p $(MODVERDIR)
873 $(Q)rm -f $(MODVERDIR)/* 859 $(Q)rm -f $(MODVERDIR)/*
@@ -936,14 +922,14 @@ export INSTALL_HDR_PATH
936HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) 922HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
937 923
938PHONY += headers_install_all 924PHONY += headers_install_all
939headers_install_all: generated_headers scripts_basic FORCE 925headers_install_all: include/linux/version.h scripts_basic FORCE
940 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 926 $(Q)$(MAKE) $(build)=scripts scripts/unifdef
941 $(Q)for arch in $(HDRARCHES); do \ 927 $(Q)for arch in $(HDRARCHES); do \
942 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ 928 $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\
943 done 929 done
944 930
945PHONY += headers_install 931PHONY += headers_install
946headers_install: generated_headers scripts_basic FORCE 932headers_install: include/linux/version.h scripts_basic FORCE
947 @if [ ! -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ 933 @if [ ! -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
948 echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \ 934 echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \
949 exit 1 ; fi 935 exit 1 ; fi
@@ -1040,7 +1026,8 @@ CLEAN_FILES += vmlinux System.map \
1040# Directories & files removed with 'make mrproper' 1026# Directories & files removed with 'make mrproper'
1041MRPROPER_DIRS += include/config include2 usr/include 1027MRPROPER_DIRS += include/config include2 usr/include
1042MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1028MRPROPER_FILES += .config .config.old include/asm .version .old_version \
1043 include/linux/autoconf.h include/linux/utsrelease.h include/linux/version.h \ 1029 include/linux/autoconf.h include/linux/version.h \
1030 include/linux/utsrelease.h \
1044 Module.symvers tags TAGS cscope* 1031 Module.symvers tags TAGS cscope*
1045 1032
1046# clean - Delete most, but leave enough to build external modules 1033# clean - Delete most, but leave enough to build external modules
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 2db42b18f53f..8517c3c3eb33 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -436,7 +436,7 @@ __und_usr:
436 usr_entry 436 usr_entry
437 437
438 tst r3, #PSR_T_BIT @ Thumb mode? 438 tst r3, #PSR_T_BIT @ Thumb mode?
439 bne fpundefinstr @ ignore FP 439 bne __und_usr_unknown @ ignore FP
440 sub r4, r2, #4 440 sub r4, r2, #4
441 441
442 @ 442 @
@@ -448,7 +448,7 @@ __und_usr:
448 @ 448 @
4491: ldrt r0, [r4] 4491: ldrt r0, [r4]
450 adr r9, ret_from_exception 450 adr r9, ret_from_exception
451 adr lr, fpundefinstr 451 adr lr, __und_usr_unknown
452 @ 452 @
453 @ fallthrough to call_fpe 453 @ fallthrough to call_fpe
454 @ 454 @
@@ -476,7 +476,9 @@ __und_usr:
476 * Emulators may wish to make use of the following registers: 476 * Emulators may wish to make use of the following registers:
477 * r0 = instruction opcode. 477 * r0 = instruction opcode.
478 * r2 = PC+4 478 * r2 = PC+4
479 * r9 = normal "successful" return address
479 * r10 = this threads thread_info structure. 480 * r10 = this threads thread_info structure.
481 * lr = unrecognised instruction return address
480 */ 482 */
481call_fpe: 483call_fpe:
482 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 484 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
@@ -545,10 +547,12 @@ do_fpe:
545 547
546 .data 548 .data
547ENTRY(fp_enter) 549ENTRY(fp_enter)
548 .word fpundefinstr 550 .word no_fp
549 .text 551 .text
550 552
551fpundefinstr: 553no_fp: mov pc, lr
554
555__und_usr_unknown:
552 mov r0, sp 556 mov r0, sp
553 adr lr, ret_from_exception 557 adr lr, ret_from_exception
554 b do_undefinstr 558 b do_undefinstr
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 6ff5e3ff6cb5..3c8cdcfe8d4a 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -29,6 +29,8 @@
29#include <linux/timer.h> 29#include <linux/timer.h>
30#include <linux/irq.h> 30#include <linux/irq.h>
31 31
32#include <linux/mc146818rtc.h>
33
32#include <asm/leds.h> 34#include <asm/leds.h>
33#include <asm/thread_info.h> 35#include <asm/thread_info.h>
34#include <asm/mach/time.h> 36#include <asm/mach/time.h>
@@ -85,6 +87,17 @@ unsigned long long __attribute__((weak)) sched_clock(void)
85 return (unsigned long long)jiffies * (1000000000 / HZ); 87 return (unsigned long long)jiffies * (1000000000 / HZ);
86} 88}
87 89
90/*
91 * An implementation of printk_clock() independent from
92 * sched_clock(). This avoids non-bootable kernels when
93 * printk_clock is enabled.
94 */
95unsigned long long printk_clock(void)
96{
97 return (unsigned long long)(jiffies - INITIAL_JIFFIES) *
98 (1000000000 / HZ);
99}
100
88static unsigned long next_rtc_update; 101static unsigned long next_rtc_update;
89 102
90/* 103/*
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 042a12982e98..908915675edc 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -27,6 +27,7 @@
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/unistd.h> 28#include <asm/unistd.h>
29#include <asm/traps.h> 29#include <asm/traps.h>
30#include <asm/io.h>
30 31
31#include "ptrace.h" 32#include "ptrace.h"
32#include "signal.h" 33#include "signal.h"
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 628348c9f6c5..9df507d36e0b 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -202,3 +202,42 @@ void flush_dcache_page(struct page *page)
202 } 202 }
203} 203}
204EXPORT_SYMBOL(flush_dcache_page); 204EXPORT_SYMBOL(flush_dcache_page);
205
206/*
207 * Flush an anonymous page so that users of get_user_pages()
208 * can safely access the data. The expected sequence is:
209 *
210 * get_user_pages()
211 * -> flush_anon_page
212 * memcpy() to/from page
213 * if written to page, flush_dcache_page()
214 */
215void __flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
216{
217 unsigned long pfn;
218
219 /* VIPT non-aliasing caches need do nothing */
220 if (cache_is_vipt_nonaliasing())
221 return;
222
223 /*
224 * Write back and invalidate userspace mapping.
225 */
226 pfn = page_to_pfn(page);
227 if (cache_is_vivt()) {
228 flush_cache_page(vma, vmaddr, pfn);
229 } else {
230 /*
231 * For aliasing VIPT, we can flush an alias of the
232 * userspace address only.
233 */
234 flush_pfn_alias(pfn, vmaddr);
235 }
236
237 /*
238 * Invalidate kernel mapping. No data should be contained
239 * in this mapping of the page. FIXME: this is overkill
240 * since we actually ask for a write-back and invalidate.
241 */
242 __cpuc_flush_dcache_page(page_address(page));
243}
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 2d0023f2d49b..77e655f26560 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -195,7 +195,7 @@ int setup_profiling_timer(unsigned int multiplier)
195 */ 195 */
196unsigned long cache_decay_ticks = 1; 196unsigned long cache_decay_ticks = 1;
197 197
198int __devinit __cpu_up(unsigned int cpu) 198int __cpuinit __cpu_up(unsigned int cpu)
199{ 199{
200 smp_boot_one_cpu(cpu); 200 smp_boot_one_cpu(cpu);
201 return cpu_online(cpu) ? 0 : -ENOSYS; 201 return cpu_online(cpu) ? 0 : -ENOSYS;
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 88b7c1cf65a2..5d80edfc61b7 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/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.19-git14 3# Linux kernel version: 2.6.20-rc3
4# Sat Dec 9 21:23:14 2006 4# Fri Jan 5 11:54:46 2007
5# 5#
6CONFIG_X86_32=y 6CONFIG_X86_32=y
7CONFIG_GENERIC_TIME=y 7CONFIG_GENERIC_TIME=y
@@ -1287,6 +1287,11 @@ CONFIG_USB_MON=y
1287# 1287#
1288 1288
1289# 1289#
1290# Virtualization
1291#
1292# CONFIG_KVM is not set
1293
1294#
1290# File systems 1295# File systems
1291# 1296#
1292CONFIG_EXT2_FS=y 1297CONFIG_EXT2_FS=y
@@ -1471,6 +1476,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1471# CONFIG_ENABLE_MUST_CHECK is not set 1476# CONFIG_ENABLE_MUST_CHECK is not set
1472CONFIG_MAGIC_SYSRQ=y 1477CONFIG_MAGIC_SYSRQ=y
1473CONFIG_UNUSED_SYMBOLS=y 1478CONFIG_UNUSED_SYMBOLS=y
1479# CONFIG_DEBUG_FS is not set
1480# CONFIG_HEADERS_CHECK is not set
1474CONFIG_DEBUG_KERNEL=y 1481CONFIG_DEBUG_KERNEL=y
1475CONFIG_LOG_BUF_SHIFT=18 1482CONFIG_LOG_BUF_SHIFT=18
1476CONFIG_DETECT_SOFTLOCKUP=y 1483CONFIG_DETECT_SOFTLOCKUP=y
@@ -1489,12 +1496,10 @@ CONFIG_DETECT_SOFTLOCKUP=y
1489# CONFIG_DEBUG_HIGHMEM is not set 1496# CONFIG_DEBUG_HIGHMEM is not set
1490CONFIG_DEBUG_BUGVERBOSE=y 1497CONFIG_DEBUG_BUGVERBOSE=y
1491# CONFIG_DEBUG_INFO is not set 1498# CONFIG_DEBUG_INFO is not set
1492# CONFIG_DEBUG_FS is not set
1493# CONFIG_DEBUG_VM is not set 1499# CONFIG_DEBUG_VM is not set
1494# CONFIG_DEBUG_LIST is not set 1500# CONFIG_DEBUG_LIST is not set
1495# CONFIG_FRAME_POINTER is not set 1501# CONFIG_FRAME_POINTER is not set
1496# CONFIG_FORCED_INLINING is not set 1502# CONFIG_FORCED_INLINING is not set
1497# CONFIG_HEADERS_CHECK is not set
1498# CONFIG_RCU_TORTURE_TEST is not set 1503# CONFIG_RCU_TORTURE_TEST is not set
1499# CONFIG_LKDTM is not set 1504# CONFIG_LKDTM is not set
1500CONFIG_EARLY_PRINTK=y 1505CONFIG_EARLY_PRINTK=y
@@ -1527,6 +1532,7 @@ CONFIG_CRC32=y
1527# CONFIG_LIBCRC32C is not set 1532# CONFIG_LIBCRC32C is not set
1528CONFIG_ZLIB_INFLATE=y 1533CONFIG_ZLIB_INFLATE=y
1529CONFIG_PLIST=y 1534CONFIG_PLIST=y
1535CONFIG_IOMAP_COPY=y
1530CONFIG_GENERIC_HARDIRQS=y 1536CONFIG_GENERIC_HARDIRQS=y
1531CONFIG_GENERIC_IRQ_PROBE=y 1537CONFIG_GENERIC_IRQ_PROBE=y
1532CONFIG_GENERIC_PENDING_IRQ=y 1538CONFIG_GENERIC_PENDING_IRQ=y
diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c
index c0c3b59de32c..abcff92f994c 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/i386/kernel/cpu/cyrix.c
@@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
173 ccr4 = getCx86(CX86_CCR4); 173 ccr4 = getCx86(CX86_CCR4);
174 ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */ 174 ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */
175 175
176 setCx86(CX86_CCR3, ccr3); 176 setCx86(CX86_CCR4, ccr4);
177 177
178 set_cx86_memwb(); 178 set_cx86_memwb();
179 set_cx86_reorder(); 179 set_cx86_reorder();
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index 2ce67228dff8..49bff3596bff 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -36,7 +36,7 @@
36 36
37/* Have we found an MP table */ 37/* Have we found an MP table */
38int smp_found_config; 38int smp_found_config;
39unsigned int __initdata maxcpus = NR_CPUS; 39unsigned int __cpuinitdata maxcpus = NR_CPUS;
40 40
41/* 41/*
42 * Various Linux-internal data structures created from the 42 * Various Linux-internal data structures created from the
@@ -102,9 +102,9 @@ static int __init mpf_checksum(unsigned char *mp, int len)
102 */ 102 */
103 103
104static int mpc_record; 104static int mpc_record;
105static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata; 105static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __cpuinitdata;
106 106
107static void __devinit MP_processor_info (struct mpc_config_processor *m) 107static void __cpuinit MP_processor_info (struct mpc_config_processor *m)
108{ 108{
109 int ver, apicid; 109 int ver, apicid;
110 physid_mask_t phys_cpu; 110 physid_mask_t phys_cpu;
@@ -822,7 +822,7 @@ void __init mp_register_lapic_address(u64 address)
822 Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid); 822 Dprintk("Boot CPU = %d\n", boot_cpu_physical_apicid);
823} 823}
824 824
825void __devinit mp_register_lapic (u8 id, u8 enabled) 825void __cpuinit mp_register_lapic (u8 id, u8 enabled)
826{ 826{
827 struct mpc_config_processor processor; 827 struct mpc_config_processor processor;
828 int boot_cpu = 0; 828 int boot_cpu = 0;
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 6f6cb7b31d18..4b31ad70c1ac 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -77,7 +77,7 @@ extern struct resource code_resource;
77extern struct resource data_resource; 77extern struct resource data_resource;
78 78
79/* cpu data as detected by the assembly code in head.S */ 79/* cpu data as detected by the assembly code in head.S */
80struct cpuinfo_x86 new_cpu_data __initdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 80struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
81/* common cpu data for all cpus */ 81/* common cpu data for all cpus */
82struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; 82struct cpuinfo_x86 boot_cpu_data __read_mostly = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
83EXPORT_SYMBOL(boot_cpu_data); 83EXPORT_SYMBOL(boot_cpu_data);
@@ -495,7 +495,7 @@ static void set_mca_bus(int x) { }
495#endif 495#endif
496 496
497/* Overridden in paravirt.c if CONFIG_PARAVIRT */ 497/* Overridden in paravirt.c if CONFIG_PARAVIRT */
498char * __attribute__((weak)) memory_setup(void) 498char * __init __attribute__((weak)) memory_setup(void)
499{ 499{
500 return machine_specific_memory_setup(); 500 return machine_specific_memory_setup();
501} 501}
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 300d9b38d02e..dea7ef9d3e82 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -159,7 +159,7 @@ void __init smp_alloc_memory(void)
159 * a given CPU 159 * a given CPU
160 */ 160 */
161 161
162static void __devinit smp_store_cpu_info(int id) 162static void __cpuinit smp_store_cpu_info(int id)
163{ 163{
164 struct cpuinfo_x86 *c = cpu_data + id; 164 struct cpuinfo_x86 *c = cpu_data + id;
165 165
@@ -364,7 +364,7 @@ extern void calibrate_delay(void);
364 364
365static atomic_t init_deasserted; 365static atomic_t init_deasserted;
366 366
367static void __devinit smp_callin(void) 367static void __cpuinit smp_callin(void)
368{ 368{
369 int cpuid, phys_id; 369 int cpuid, phys_id;
370 unsigned long timeout; 370 unsigned long timeout;
@@ -538,7 +538,7 @@ set_cpu_sibling_map(int cpu)
538/* 538/*
539 * Activate a secondary processor. 539 * Activate a secondary processor.
540 */ 540 */
541static void __devinit start_secondary(void *unused) 541static void __cpuinit start_secondary(void *unused)
542{ 542{
543 /* 543 /*
544 * Don't put *anything* before secondary_cpu_init(), SMP 544 * Don't put *anything* before secondary_cpu_init(), SMP
@@ -931,7 +931,7 @@ static inline struct task_struct * alloc_idle_task(int cpu)
931#define alloc_idle_task(cpu) fork_idle(cpu) 931#define alloc_idle_task(cpu) fork_idle(cpu)
932#endif 932#endif
933 933
934static int __devinit do_boot_cpu(int apicid, int cpu) 934static int __cpuinit do_boot_cpu(int apicid, int cpu)
935/* 935/*
936 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad 936 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
937 * (ie clustered apic addressing mode), this is a LOGICAL apic ID. 937 * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -1432,7 +1432,7 @@ void __cpu_die(unsigned int cpu)
1432} 1432}
1433#endif /* CONFIG_HOTPLUG_CPU */ 1433#endif /* CONFIG_HOTPLUG_CPU */
1434 1434
1435int __devinit __cpu_up(unsigned int cpu) 1435int __cpuinit __cpu_up(unsigned int cpu)
1436{ 1436{
1437#ifdef CONFIG_HOTPLUG_CPU 1437#ifdef CONFIG_HOTPLUG_CPU
1438 int ret=0; 1438 int ret=0;
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
index 1bbe45dca7a0..2cfc7b09b925 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -24,7 +24,7 @@
24 */ 24 */
25unsigned int tsc_khz; 25unsigned int tsc_khz;
26 26
27int tsc_disable __cpuinitdata = 0; 27int tsc_disable;
28 28
29#ifdef CONFIG_X86_TSC 29#ifdef CONFIG_X86_TSC
30static int __init tsc_setup(char *str) 30static int __init tsc_setup(char *str)
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c
index 33d9f93557ba..8a210fa915b5 100644
--- a/arch/i386/mach-generic/bigsmp.c
+++ b/arch/i386/mach-generic/bigsmp.c
@@ -45,7 +45,7 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
45}; 45};
46 46
47 47
48static __init int probe_bigsmp(void) 48static int probe_bigsmp(void)
49{ 49{
50 if (def_to_bigsmp) 50 if (def_to_bigsmp)
51 dmi_bigsmp = 1; 51 dmi_bigsmp = 1;
diff --git a/arch/i386/mach-generic/default.c b/arch/i386/mach-generic/default.c
index 96c19821e47d..8685208d8512 100644
--- a/arch/i386/mach-generic/default.c
+++ b/arch/i386/mach-generic/default.c
@@ -18,7 +18,7 @@
18#include <asm/mach-default/mach_mpparse.h> 18#include <asm/mach-default/mach_mpparse.h>
19 19
20/* should be called last. */ 20/* should be called last. */
21static __init int probe_default(void) 21static int probe_default(void)
22{ 22{
23 return 1; 23 return 1;
24} 24}
diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c
index aa144d82334d..b8963a5a3b25 100644
--- a/arch/i386/mach-generic/es7000.c
+++ b/arch/i386/mach-generic/es7000.c
@@ -19,7 +19,7 @@
19#include <asm/mach-es7000/mach_mpparse.h> 19#include <asm/mach-es7000/mach_mpparse.h>
20#include <asm/mach-es7000/mach_wakecpu.h> 20#include <asm/mach-es7000/mach_wakecpu.h>
21 21
22static __init int probe_es7000(void) 22static int probe_es7000(void)
23{ 23{
24 /* probed later in mptable/ACPI hooks */ 24 /* probed later in mptable/ACPI hooks */
25 return 0; 25 return 0;
diff --git a/arch/i386/mach-generic/summit.c b/arch/i386/mach-generic/summit.c
index f7e5d66648dc..74883ccb8f73 100644
--- a/arch/i386/mach-generic/summit.c
+++ b/arch/i386/mach-generic/summit.c
@@ -18,7 +18,7 @@
18#include <asm/mach-summit/mach_ipi.h> 18#include <asm/mach-summit/mach_ipi.h>
19#include <asm/mach-summit/mach_mpparse.h> 19#include <asm/mach-summit/mach_mpparse.h>
20 20
21static __init int probe_summit(void) 21static int probe_summit(void)
22{ 22{
23 /* probed later in mptable/ACPI hooks */ 23 /* probed later in mptable/ACPI hooks */
24 return 0; 24 return 0;
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 60a7e57af197..c5c5ea700cc7 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -283,7 +283,7 @@ void __init add_one_highpage_init(struct page *page, int pfn, int bad_ppro)
283 SetPageReserved(page); 283 SetPageReserved(page);
284} 284}
285 285
286static int add_one_highpage_hotplug(struct page *page, unsigned long pfn) 286static int __meminit add_one_highpage_hotplug(struct page *page, unsigned long pfn)
287{ 287{
288 free_new_highpage(page); 288 free_new_highpage(page);
289 totalram_pages++; 289 totalram_pages++;
@@ -300,7 +300,7 @@ static int add_one_highpage_hotplug(struct page *page, unsigned long pfn)
300 * has been added dynamically that would be 300 * has been added dynamically that would be
301 * onlined here is in HIGHMEM 301 * onlined here is in HIGHMEM
302 */ 302 */
303void online_page(struct page *page) 303void __meminit online_page(struct page *page)
304{ 304{
305 ClearPageReserved(page); 305 ClearPageReserved(page);
306 add_one_highpage_hotplug(page, page_to_pfn(page)); 306 add_one_highpage_hotplug(page, page_to_pfn(page));
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 1a3d8a2feb94..1373fae7657f 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -543,7 +543,8 @@ virtual_memmap_init (u64 start, u64 end, void *arg)
543 543
544 if (map_start < map_end) 544 if (map_start < map_end)
545 memmap_init_zone((unsigned long)(map_end - map_start), 545 memmap_init_zone((unsigned long)(map_end - map_start),
546 args->nid, args->zone, page_to_pfn(map_start)); 546 args->nid, args->zone, page_to_pfn(map_start),
547 MEMMAP_EARLY);
547 return 0; 548 return 0;
548} 549}
549 550
@@ -552,7 +553,7 @@ memmap_init (unsigned long size, int nid, unsigned long zone,
552 unsigned long start_pfn) 553 unsigned long start_pfn)
553{ 554{
554 if (!vmem_map) 555 if (!vmem_map)
555 memmap_init_zone(size, nid, zone, start_pfn); 556 memmap_init_zone(size, nid, zone, start_pfn, MEMMAP_EARLY);
556 else { 557 else {
557 struct page *start; 558 struct page *start;
558 struct memmap_init_callback_data args; 559 struct memmap_init_callback_data args;
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index fa7865609495..48d376f47e1a 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -351,7 +351,7 @@ static void __init do_boot_cpu(int phys_id)
351 } 351 }
352} 352}
353 353
354int __devinit __cpu_up(unsigned int cpu_id) 354int __cpuinit __cpu_up(unsigned int cpu_id)
355{ 355{
356 int timeout; 356 int timeout;
357 357
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c
index da591f674893..9f8ce08e173b 100644
--- a/arch/mips/au1000/common/pci.c
+++ b/arch/mips/au1000/common/pci.c
@@ -39,15 +39,15 @@
39 39
40/* TBD */ 40/* TBD */
41static struct resource pci_io_resource = { 41static struct resource pci_io_resource = {
42 .start = PCI_IO_START, 42 .start = (resource_size_t)PCI_IO_START,
43 .end = PCI_IO_END, 43 .end = (resource_size_t)PCI_IO_END,
44 .name = "PCI IO space", 44 .name = "PCI IO space",
45 .flags = IORESOURCE_IO 45 .flags = IORESOURCE_IO
46}; 46};
47 47
48static struct resource pci_mem_resource = { 48static struct resource pci_mem_resource = {
49 .start = PCI_MEM_START, 49 .start = (resource_size_t)PCI_MEM_START,
50 .end = PCI_MEM_END, 50 .end = (resource_size_t)PCI_MEM_END,
51 .name = "PCI memory space", 51 .name = "PCI memory space",
52 .flags = IORESOURCE_MEM 52 .flags = IORESOURCE_MEM
53}; 53};
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index b061c9aa6302..de3fae260ff8 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -440,14 +440,26 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
440} 440}
441 441
442#ifdef CONFIG_MIPS32_N32 442#ifdef CONFIG_MIPS32_N32
443asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, union semun arg) 443asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
444{ 444{
445 /* compat_sys_semctl expects a pointer to union semun */ 445 /* compat_sys_semctl expects a pointer to union semun */
446 u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); 446 u32 __user *uptr = compat_alloc_user_space(sizeof(u32));
447 if (put_user(ptr_to_compat(arg.__pad), uptr)) 447 if (put_user(arg, uptr))
448 return -EFAULT; 448 return -EFAULT;
449 return compat_sys_semctl(semid, semnum, cmd, uptr); 449 return compat_sys_semctl(semid, semnum, cmd, uptr);
450} 450}
451
452asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg)
453{
454 return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp));
455}
456
457asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp,
458 int msgflg)
459{
460 return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64,
461 compat_ptr(msgp));
462}
451#endif 463#endif
452 464
453struct sysctl_args32 465struct sysctl_args32
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index f44a01357ada..2ef857c3ee53 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -46,5 +46,7 @@ EXPORT_SYMBOL(__strnlen_user_nocheck_asm);
46EXPORT_SYMBOL(__strnlen_user_asm); 46EXPORT_SYMBOL(__strnlen_user_asm);
47 47
48EXPORT_SYMBOL(csum_partial); 48EXPORT_SYMBOL(csum_partial);
49EXPORT_SYMBOL(csum_partial_copy_nocheck);
50EXPORT_SYMBOL(__csum_partial_copy_user);
49 51
50EXPORT_SYMBOL(invalid_pte_table); 52EXPORT_SYMBOL(invalid_pte_table);
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 34567d81f940..a7bff2a54723 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -187,8 +187,8 @@ EXPORT(sysn32_call_table)
187 PTR sysn32_semctl 187 PTR sysn32_semctl
188 PTR sys_shmdt /* 6065 */ 188 PTR sys_shmdt /* 6065 */
189 PTR sys_msgget 189 PTR sys_msgget
190 PTR compat_sys_msgsnd 190 PTR sysn32_msgsnd
191 PTR compat_sys_msgrcv 191 PTR sysn32_msgrcv
192 PTR compat_sys_msgctl 192 PTR compat_sys_msgctl
193 PTR compat_sys_fcntl /* 6070 */ 193 PTR compat_sys_fcntl /* 6070 */
194 PTR sys_flock 194 PTR sys_flock
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index f2a8701e414d..0555fc554f65 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -271,7 +271,7 @@ void __devinit smp_prepare_boot_cpu(void)
271 * and keep control until "cpu_online(cpu)" is set. Note: cpu is 271 * and keep control until "cpu_online(cpu)" is set. Note: cpu is
272 * physical, not logical. 272 * physical, not logical.
273 */ 273 */
274int __devinit __cpu_up(unsigned int cpu) 274int __cpuinit __cpu_up(unsigned int cpu)
275{ 275{
276 struct task_struct *idle; 276 struct task_struct *idle;
277 277
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 11aab6d6bfe5..8aa544f73a5e 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -94,10 +94,8 @@ static void c0_timer_ack(void)
94{ 94{
95 unsigned int count; 95 unsigned int count;
96 96
97#ifndef CONFIG_SOC_PNX8550 /* pnx8550 resets to zero */
98 /* Ack this timer interrupt and set the next one. */ 97 /* Ack this timer interrupt and set the next one. */
99 expirelo += cycles_per_jiffy; 98 expirelo += cycles_per_jiffy;
100#endif
101 write_c0_compare(expirelo); 99 write_c0_compare(expirelo);
102 100
103 /* Check to see if we have missed any timer interrupts. */ 101 /* Check to see if we have missed any timer interrupts. */
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 888b61ea12fe..989c900b8b14 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for MIPS-specific library files.. 2# Makefile for MIPS-specific library files..
3# 3#
4 4
5lib-y += csum_partial.o csum_partial_copy.o memcpy.o promlib.o \ 5lib-y += csum_partial.o memcpy.o promlib.o \
6 strlen_user.o strncpy_user.o strnlen_user.o uncached.o 6 strlen_user.o strncpy_user.o strnlen_user.o uncached.o
7 7
8obj-y += iomap.o 8obj-y += iomap.o
diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S
index 9db357294be1..c0a77fe038be 100644
--- a/arch/mips/lib/csum_partial.S
+++ b/arch/mips/lib/csum_partial.S
@@ -8,7 +8,9 @@
8 * Copyright (C) 1998, 1999 Ralf Baechle 8 * Copyright (C) 1998, 1999 Ralf Baechle
9 * Copyright (C) 1999 Silicon Graphics, Inc. 9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 */ 10 */
11#include <linux/errno.h>
11#include <asm/asm.h> 12#include <asm/asm.h>
13#include <asm/asm-offsets.h>
12#include <asm/regdef.h> 14#include <asm/regdef.h>
13 15
14#ifdef CONFIG_64BIT 16#ifdef CONFIG_64BIT
@@ -271,3 +273,443 @@ small_csumcpy:
271 jr ra 273 jr ra
272 .set noreorder 274 .set noreorder
273 END(csum_partial) 275 END(csum_partial)
276
277
278/*
279 * checksum and copy routines based on memcpy.S
280 *
281 * csum_partial_copy_nocheck(src, dst, len, sum)
282 * __csum_partial_copy_user(src, dst, len, sum, errp)
283 *
284 * See "Spec" in memcpy.S for details. Unlike __copy_user, all
285 * function in this file use the standard calling convention.
286 */
287
288#define src a0
289#define dst a1
290#define len a2
291#define psum a3
292#define sum v0
293#define odd t8
294#define errptr t9
295
296/*
297 * The exception handler for loads requires that:
298 * 1- AT contain the address of the byte just past the end of the source
299 * of the copy,
300 * 2- src_entry <= src < AT, and
301 * 3- (dst - src) == (dst_entry - src_entry),
302 * The _entry suffix denotes values when __copy_user was called.
303 *
304 * (1) is set up up by __csum_partial_copy_from_user and maintained by
305 * not writing AT in __csum_partial_copy
306 * (2) is met by incrementing src by the number of bytes copied
307 * (3) is met by not doing loads between a pair of increments of dst and src
308 *
309 * The exception handlers for stores stores -EFAULT to errptr and return.
310 * These handlers do not need to overwrite any data.
311 */
312
313#define EXC(inst_reg,addr,handler) \
3149: inst_reg, addr; \
315 .section __ex_table,"a"; \
316 PTR 9b, handler; \
317 .previous
318
319#ifdef USE_DOUBLE
320
321#define LOAD ld
322#define LOADL ldl
323#define LOADR ldr
324#define STOREL sdl
325#define STORER sdr
326#define STORE sd
327#define ADD daddu
328#define SUB dsubu
329#define SRL dsrl
330#define SLL dsll
331#define SLLV dsllv
332#define SRLV dsrlv
333#define NBYTES 8
334#define LOG_NBYTES 3
335
336#else
337
338#define LOAD lw
339#define LOADL lwl
340#define LOADR lwr
341#define STOREL swl
342#define STORER swr
343#define STORE sw
344#define ADD addu
345#define SUB subu
346#define SRL srl
347#define SLL sll
348#define SLLV sllv
349#define SRLV srlv
350#define NBYTES 4
351#define LOG_NBYTES 2
352
353#endif /* USE_DOUBLE */
354
355#ifdef CONFIG_CPU_LITTLE_ENDIAN
356#define LDFIRST LOADR
357#define LDREST LOADL
358#define STFIRST STORER
359#define STREST STOREL
360#define SHIFT_DISCARD SLLV
361#define SHIFT_DISCARD_REVERT SRLV
362#else
363#define LDFIRST LOADL
364#define LDREST LOADR
365#define STFIRST STOREL
366#define STREST STORER
367#define SHIFT_DISCARD SRLV
368#define SHIFT_DISCARD_REVERT SLLV
369#endif
370
371#define FIRST(unit) ((unit)*NBYTES)
372#define REST(unit) (FIRST(unit)+NBYTES-1)
373
374#define ADDRMASK (NBYTES-1)
375
376 .set noat
377
378LEAF(__csum_partial_copy_user)
379 PTR_ADDU AT, src, len /* See (1) above. */
380#ifdef CONFIG_64BIT
381 move errptr, a4
382#else
383 lw errptr, 16(sp)
384#endif
385FEXPORT(csum_partial_copy_nocheck)
386 move sum, zero
387 move odd, zero
388 /*
389 * Note: dst & src may be unaligned, len may be 0
390 * Temps
391 */
392 /*
393 * The "issue break"s below are very approximate.
394 * Issue delays for dcache fills will perturb the schedule, as will
395 * load queue full replay traps, etc.
396 *
397 * If len < NBYTES use byte operations.
398 */
399 sltu t2, len, NBYTES
400 and t1, dst, ADDRMASK
401 bnez t2, copy_bytes_checklen
402 and t0, src, ADDRMASK
403 andi odd, dst, 0x1 /* odd buffer? */
404 bnez t1, dst_unaligned
405 nop
406 bnez t0, src_unaligned_dst_aligned
407 /*
408 * use delay slot for fall-through
409 * src and dst are aligned; need to compute rem
410 */
411both_aligned:
412 SRL t0, len, LOG_NBYTES+3 # +3 for 8 units/iter
413 beqz t0, cleanup_both_aligned # len < 8*NBYTES
414 nop
415 SUB len, 8*NBYTES # subtract here for bgez loop
416 .align 4
4171:
418EXC( LOAD t0, UNIT(0)(src), l_exc)
419EXC( LOAD t1, UNIT(1)(src), l_exc_copy)
420EXC( LOAD t2, UNIT(2)(src), l_exc_copy)
421EXC( LOAD t3, UNIT(3)(src), l_exc_copy)
422EXC( LOAD t4, UNIT(4)(src), l_exc_copy)
423EXC( LOAD t5, UNIT(5)(src), l_exc_copy)
424EXC( LOAD t6, UNIT(6)(src), l_exc_copy)
425EXC( LOAD t7, UNIT(7)(src), l_exc_copy)
426 SUB len, len, 8*NBYTES
427 ADD src, src, 8*NBYTES
428EXC( STORE t0, UNIT(0)(dst), s_exc)
429 ADDC(sum, t0)
430EXC( STORE t1, UNIT(1)(dst), s_exc)
431 ADDC(sum, t1)
432EXC( STORE t2, UNIT(2)(dst), s_exc)
433 ADDC(sum, t2)
434EXC( STORE t3, UNIT(3)(dst), s_exc)
435 ADDC(sum, t3)
436EXC( STORE t4, UNIT(4)(dst), s_exc)
437 ADDC(sum, t4)
438EXC( STORE t5, UNIT(5)(dst), s_exc)
439 ADDC(sum, t5)
440EXC( STORE t6, UNIT(6)(dst), s_exc)
441 ADDC(sum, t6)
442EXC( STORE t7, UNIT(7)(dst), s_exc)
443 ADDC(sum, t7)
444 bgez len, 1b
445 ADD dst, dst, 8*NBYTES
446 ADD len, 8*NBYTES # revert len (see above)
447
448 /*
449 * len == the number of bytes left to copy < 8*NBYTES
450 */
451cleanup_both_aligned:
452#define rem t7
453 beqz len, done
454 sltu t0, len, 4*NBYTES
455 bnez t0, less_than_4units
456 and rem, len, (NBYTES-1) # rem = len % NBYTES
457 /*
458 * len >= 4*NBYTES
459 */
460EXC( LOAD t0, UNIT(0)(src), l_exc)
461EXC( LOAD t1, UNIT(1)(src), l_exc_copy)
462EXC( LOAD t2, UNIT(2)(src), l_exc_copy)
463EXC( LOAD t3, UNIT(3)(src), l_exc_copy)
464 SUB len, len, 4*NBYTES
465 ADD src, src, 4*NBYTES
466EXC( STORE t0, UNIT(0)(dst), s_exc)
467 ADDC(sum, t0)
468EXC( STORE t1, UNIT(1)(dst), s_exc)
469 ADDC(sum, t1)
470EXC( STORE t2, UNIT(2)(dst), s_exc)
471 ADDC(sum, t2)
472EXC( STORE t3, UNIT(3)(dst), s_exc)
473 ADDC(sum, t3)
474 beqz len, done
475 ADD dst, dst, 4*NBYTES
476less_than_4units:
477 /*
478 * rem = len % NBYTES
479 */
480 beq rem, len, copy_bytes
481 nop
4821:
483EXC( LOAD t0, 0(src), l_exc)
484 ADD src, src, NBYTES
485 SUB len, len, NBYTES
486EXC( STORE t0, 0(dst), s_exc)
487 ADDC(sum, t0)
488 bne rem, len, 1b
489 ADD dst, dst, NBYTES
490
491 /*
492 * src and dst are aligned, need to copy rem bytes (rem < NBYTES)
493 * A loop would do only a byte at a time with possible branch
494 * mispredicts. Can't do an explicit LOAD dst,mask,or,STORE
495 * because can't assume read-access to dst. Instead, use
496 * STREST dst, which doesn't require read access to dst.
497 *
498 * This code should perform better than a simple loop on modern,
499 * wide-issue mips processors because the code has fewer branches and
500 * more instruction-level parallelism.
501 */
502#define bits t2
503 beqz len, done
504 ADD t1, dst, len # t1 is just past last byte of dst
505 li bits, 8*NBYTES
506 SLL rem, len, 3 # rem = number of bits to keep
507EXC( LOAD t0, 0(src), l_exc)
508 SUB bits, bits, rem # bits = number of bits to discard
509 SHIFT_DISCARD t0, t0, bits
510EXC( STREST t0, -1(t1), s_exc)
511 SHIFT_DISCARD_REVERT t0, t0, bits
512 .set reorder
513 ADDC(sum, t0)
514 b done
515 .set noreorder
516dst_unaligned:
517 /*
518 * dst is unaligned
519 * t0 = src & ADDRMASK
520 * t1 = dst & ADDRMASK; T1 > 0
521 * len >= NBYTES
522 *
523 * Copy enough bytes to align dst
524 * Set match = (src and dst have same alignment)
525 */
526#define match rem
527EXC( LDFIRST t3, FIRST(0)(src), l_exc)
528 ADD t2, zero, NBYTES
529EXC( LDREST t3, REST(0)(src), l_exc_copy)
530 SUB t2, t2, t1 # t2 = number of bytes copied
531 xor match, t0, t1
532EXC( STFIRST t3, FIRST(0)(dst), s_exc)
533 SLL t4, t1, 3 # t4 = number of bits to discard
534 SHIFT_DISCARD t3, t3, t4
535 /* no SHIFT_DISCARD_REVERT to handle odd buffer properly */
536 ADDC(sum, t3)
537 beq len, t2, done
538 SUB len, len, t2
539 ADD dst, dst, t2
540 beqz match, both_aligned
541 ADD src, src, t2
542
543src_unaligned_dst_aligned:
544 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter
545 beqz t0, cleanup_src_unaligned
546 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES
5471:
548/*
549 * Avoid consecutive LD*'s to the same register since some mips
550 * implementations can't issue them in the same cycle.
551 * It's OK to load FIRST(N+1) before REST(N) because the two addresses
552 * are to the same unit (unless src is aligned, but it's not).
553 */
554EXC( LDFIRST t0, FIRST(0)(src), l_exc)
555EXC( LDFIRST t1, FIRST(1)(src), l_exc_copy)
556 SUB len, len, 4*NBYTES
557EXC( LDREST t0, REST(0)(src), l_exc_copy)
558EXC( LDREST t1, REST(1)(src), l_exc_copy)
559EXC( LDFIRST t2, FIRST(2)(src), l_exc_copy)
560EXC( LDFIRST t3, FIRST(3)(src), l_exc_copy)
561EXC( LDREST t2, REST(2)(src), l_exc_copy)
562EXC( LDREST t3, REST(3)(src), l_exc_copy)
563 ADD src, src, 4*NBYTES
564#ifdef CONFIG_CPU_SB1
565 nop # improves slotting
566#endif
567EXC( STORE t0, UNIT(0)(dst), s_exc)
568 ADDC(sum, t0)
569EXC( STORE t1, UNIT(1)(dst), s_exc)
570 ADDC(sum, t1)
571EXC( STORE t2, UNIT(2)(dst), s_exc)
572 ADDC(sum, t2)
573EXC( STORE t3, UNIT(3)(dst), s_exc)
574 ADDC(sum, t3)
575 bne len, rem, 1b
576 ADD dst, dst, 4*NBYTES
577
578cleanup_src_unaligned:
579 beqz len, done
580 and rem, len, NBYTES-1 # rem = len % NBYTES
581 beq rem, len, copy_bytes
582 nop
5831:
584EXC( LDFIRST t0, FIRST(0)(src), l_exc)
585EXC( LDREST t0, REST(0)(src), l_exc_copy)
586 ADD src, src, NBYTES
587 SUB len, len, NBYTES
588EXC( STORE t0, 0(dst), s_exc)
589 ADDC(sum, t0)
590 bne len, rem, 1b
591 ADD dst, dst, NBYTES
592
593copy_bytes_checklen:
594 beqz len, done
595 nop
596copy_bytes:
597 /* 0 < len < NBYTES */
598#ifdef CONFIG_CPU_LITTLE_ENDIAN
599#define SHIFT_START 0
600#define SHIFT_INC 8
601#else
602#define SHIFT_START 8*(NBYTES-1)
603#define SHIFT_INC -8
604#endif
605 move t2, zero # partial word
606 li t3, SHIFT_START # shift
607/* use l_exc_copy here to return correct sum on fault */
608#define COPY_BYTE(N) \
609EXC( lbu t0, N(src), l_exc_copy); \
610 SUB len, len, 1; \
611EXC( sb t0, N(dst), s_exc); \
612 SLLV t0, t0, t3; \
613 addu t3, SHIFT_INC; \
614 beqz len, copy_bytes_done; \
615 or t2, t0
616
617 COPY_BYTE(0)
618 COPY_BYTE(1)
619#ifdef USE_DOUBLE
620 COPY_BYTE(2)
621 COPY_BYTE(3)
622 COPY_BYTE(4)
623 COPY_BYTE(5)
624#endif
625EXC( lbu t0, NBYTES-2(src), l_exc_copy)
626 SUB len, len, 1
627EXC( sb t0, NBYTES-2(dst), s_exc)
628 SLLV t0, t0, t3
629 or t2, t0
630copy_bytes_done:
631 ADDC(sum, t2)
632done:
633 /* fold checksum */
634#ifdef USE_DOUBLE
635 dsll32 v1, sum, 0
636 daddu sum, v1
637 sltu v1, sum, v1
638 dsra32 sum, sum, 0
639 addu sum, v1
640#endif
641 sll v1, sum, 16
642 addu sum, v1
643 sltu v1, sum, v1
644 srl sum, sum, 16
645 addu sum, v1
646
647 /* odd buffer alignment? */
648 beqz odd, 1f
649 nop
650 sll v1, sum, 8
651 srl sum, sum, 8
652 or sum, v1
653 andi sum, 0xffff
6541:
655 .set reorder
656 ADDC(sum, psum)
657 jr ra
658 .set noreorder
659
660l_exc_copy:
661 /*
662 * Copy bytes from src until faulting load address (or until a
663 * lb faults)
664 *
665 * When reached by a faulting LDFIRST/LDREST, THREAD_BUADDR($28)
666 * may be more than a byte beyond the last address.
667 * Hence, the lb below may get an exception.
668 *
669 * Assumes src < THREAD_BUADDR($28)
670 */
671 LOAD t0, TI_TASK($28)
672 li t2, SHIFT_START
673 LOAD t0, THREAD_BUADDR(t0)
6741:
675EXC( lbu t1, 0(src), l_exc)
676 ADD src, src, 1
677 sb t1, 0(dst) # can't fault -- we're copy_from_user
678 SLLV t1, t1, t2
679 addu t2, SHIFT_INC
680 ADDC(sum, t1)
681 bne src, t0, 1b
682 ADD dst, dst, 1
683l_exc:
684 LOAD t0, TI_TASK($28)
685 nop
686 LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address
687 nop
688 SUB len, AT, t0 # len number of uncopied bytes
689 /*
690 * Here's where we rely on src and dst being incremented in tandem,
691 * See (3) above.
692 * dst += (fault addr - src) to put dst at first byte to clear
693 */
694 ADD dst, t0 # compute start address in a1
695 SUB dst, src
696 /*
697 * Clear len bytes starting at dst. Can't call __bzero because it
698 * might modify len. An inefficient loop for these rare times...
699 */
700 beqz len, done
701 SUB src, len, 1
7021: sb zero, 0(dst)
703 ADD dst, dst, 1
704 bnez src, 1b
705 SUB src, src, 1
706 li v1, -EFAULT
707 b done
708 sw v1, (errptr)
709
710s_exc:
711 li v0, -1 /* invalid checksum */
712 li v1, -EFAULT
713 jr ra
714 sw v1, (errptr)
715 END(__csum_partial_copy_user)
diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c
deleted file mode 100644
index 06771040a267..000000000000
--- a/arch/mips/lib/csum_partial_copy.c
+++ /dev/null
@@ -1,52 +0,0 @@
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) 1994, 1995 Waldorf Electronics GmbH
7 * Copyright (C) 1998, 1999 Ralf Baechle
8 */
9#include <linux/kernel.h>
10#include <linux/module.h>
11#include <linux/types.h>
12#include <asm/byteorder.h>
13#include <asm/string.h>
14#include <asm/uaccess.h>
15#include <net/checksum.h>
16
17/*
18 * copy while checksumming, otherwise like csum_partial
19 */
20__wsum csum_partial_copy_nocheck(const void *src,
21 void *dst, int len, __wsum sum)
22{
23 /*
24 * It's 2:30 am and I don't feel like doing it real ...
25 * This is lots slower than the real thing (tm)
26 */
27 sum = csum_partial(src, len, sum);
28 memcpy(dst, src, len);
29
30 return sum;
31}
32
33EXPORT_SYMBOL(csum_partial_copy_nocheck);
34
35/*
36 * Copy from userspace and compute checksum. If we catch an exception
37 * then zero the rest of the buffer.
38 */
39__wsum csum_partial_copy_from_user (const void __user *src,
40 void *dst, int len, __wsum sum, int *err_ptr)
41{
42 int missing;
43
44 might_sleep();
45 missing = copy_from_user(dst, src, len);
46 if (missing) {
47 memset(dst + len - missing, 0, missing);
48 *err_ptr = -EFAULT;
49 }
50
51 return csum_partial(dst, len, sum);
52}
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index e4604c73f02e..a3c3a1d462b2 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -47,6 +47,9 @@
47#ifdef CONFIG_MIPS_MALTA 47#ifdef CONFIG_MIPS_MALTA
48#include <asm/mips-boards/maltaint.h> 48#include <asm/mips-boards/maltaint.h>
49#endif 49#endif
50#ifdef CONFIG_MIPS_SEAD
51#include <asm/mips-boards/seadint.h>
52#endif
50 53
51unsigned long cpu_khz; 54unsigned long cpu_khz;
52 55
@@ -263,11 +266,13 @@ void __init mips_time_init(void)
263 266
264void __init plat_timer_setup(struct irqaction *irq) 267void __init plat_timer_setup(struct irqaction *irq)
265{ 268{
269#ifdef MSC01E_INT_BASE
266 if (cpu_has_veic) { 270 if (cpu_has_veic) {
267 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); 271 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch);
268 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; 272 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
269 } 273 } else
270 else { 274#endif
275 {
271 if (cpu_has_vint) 276 if (cpu_has_vint)
272 set_vi_handler (MIPSCPU_INT_CPUCTR, mips_timer_dispatch); 277 set_vi_handler (MIPSCPU_INT_CPUCTR, mips_timer_dispatch);
273 mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR; 278 mips_cpu_timer_irq = MIPSCPU_INT_BASE + MIPSCPU_INT_CPUCTR;
diff --git a/arch/mips/mips-boards/malta/malta_mtd.c b/arch/mips/mips-boards/malta/malta_mtd.c
new file mode 100644
index 000000000000..8ad9bdf25dce
--- /dev/null
+++ b/arch/mips/mips-boards/malta/malta_mtd.c
@@ -0,0 +1,63 @@
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) 2006 MIPS Technologies, Inc.
7 * written by Ralf Baechle <ralf@linux-mips.org>
8 */
9
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/mtd/partitions.h>
13#include <linux/mtd/physmap.h>
14#include <mtd/mtd-abi.h>
15
16static struct mtd_partition malta_mtd_partitions[] = {
17 {
18 .name = "YAMON",
19 .offset = 0x0,
20 .size = 0x100000,
21 .mask_flags = MTD_WRITEABLE
22 }, {
23 .name = "User FS",
24 .offset = 0x100000,
25 .size = 0x2e0000
26 }, {
27 .name = "Board Config",
28 .offset = 0x3e0000,
29 .size = 0x020000,
30 .mask_flags = MTD_WRITEABLE
31 }
32};
33
34static struct physmap_flash_data malta_flash_data = {
35 .width = 4,
36 .nr_parts = ARRAY_SIZE(malta_mtd_partitions),
37 .parts = malta_mtd_partitions
38};
39
40static struct resource malta_flash_resource = {
41 .start = 0x1e000000,
42 .end = 0x1e3fffff,
43 .flags = IORESOURCE_MEM
44};
45
46static struct platform_device malta_flash = {
47 .name = "physmap-flash",
48 .id = 0,
49 .dev = {
50 .platform_data = &malta_flash_data,
51 },
52 .num_resources = 1,
53 .resource = &malta_flash_resource,
54};
55
56static int __init malta_mtd_init(void)
57{
58 platform_device_register(&malta_flash);
59
60 return 0;
61}
62
63module_init(malta_mtd_init)
diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c
index f445fcddfdfd..874ccb0066b8 100644
--- a/arch/mips/mips-boards/sead/sead_int.c
+++ b/arch/mips/mips-boards/sead/sead_int.c
@@ -21,7 +21,7 @@
21 * Sead board. 21 * Sead board.
22 */ 22 */
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/irq.h> 24#include <linux/interrupt.h>
25 25
26#include <asm/irq_cpu.h> 26#include <asm/irq_cpu.h>
27#include <asm/mipsregs.h> 27#include <asm/mipsregs.h>
@@ -108,7 +108,7 @@ asmlinkage void plat_irq_dispatch(void)
108 if (irq >= 0) 108 if (irq >= 0)
109 do_IRQ(MIPSCPU_INT_BASE + irq); 109 do_IRQ(MIPSCPU_INT_BASE + irq);
110 else 110 else
111 spurious_interrupt(regs); 111 spurious_interrupt();
112} 112}
113 113
114void __init arch_init_irq(void) 114void __init arch_init_irq(void)
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index d41fc5885e87..dc795be62807 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -243,11 +243,10 @@ static void __init __build_store_reg(int reg)
243 243
244static inline void build_store_reg(int reg) 244static inline void build_store_reg(int reg)
245{ 245{
246 if (cpu_has_prefetch) 246 int pref_off = cpu_has_prefetch ?
247 if (reg) 247 (reg ? pref_offset_copy : pref_offset_clear) : 0;
248 build_dst_pref(pref_offset_copy); 248 if (pref_off)
249 else 249 build_dst_pref(pref_off);
250 build_dst_pref(pref_offset_clear);
251 else if (cpu_has_cache_cdex_s) 250 else if (cpu_has_cache_cdex_s)
252 build_cdex_s(); 251 build_cdex_s();
253 else if (cpu_has_cache_cdex_p) 252 else if (cpu_has_cache_cdex_p)
diff --git a/arch/mips/pci/ops-pnx8550.c b/arch/mips/pci/ops-pnx8550.c
index 454b65cc3354..f556b7a8dccd 100644
--- a/arch/mips/pci/ops-pnx8550.c
+++ b/arch/mips/pci/ops-pnx8550.c
@@ -202,7 +202,7 @@ write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 val)
202 break; 202 break;
203 } 203 }
204 204
205 err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data); 205 err = config_access(PCI_CMD_CONFIG_WRITE, bus, devfn, where, ~(1 << (where & 3)), &data);
206 206
207 return err; 207 return err;
208} 208}
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index 65c440e8480b..68def3880a1c 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -33,7 +33,17 @@
33#include <int.h> 33#include <int.h>
34#include <cm.h> 34#include <cm.h>
35 35
36extern unsigned int mips_hpt_frequency; 36static unsigned long cpj;
37
38static cycle_t hpt_read(void)
39{
40 return read_c0_count2();
41}
42
43static void timer_ack(void)
44{
45 write_c0_compare(cpj);
46}
37 47
38/* 48/*
39 * pnx8550_time_init() - it does the following things: 49 * pnx8550_time_init() - it does the following things:
@@ -68,27 +78,48 @@ void pnx8550_time_init(void)
68 * HZ timer interrupts per second. 78 * HZ timer interrupts per second.
69 */ 79 */
70 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); 80 mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p));
81 cpj = (mips_hpt_frequency + HZ / 2) / HZ;
82 write_c0_count(0);
83 timer_ack();
84
85 /* Setup Timer 2 */
86 write_c0_count2(0);
87 write_c0_compare2(0xffffffff);
88
89 clocksource_mips.read = hpt_read;
90 mips_timer_ack = timer_ack;
91}
92
93static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
94{
95 /* Timer 2 clear interrupt */
96 write_c0_compare2(-1);
97 return IRQ_HANDLED;
71} 98}
72 99
100static struct irqaction monotonic_irqaction = {
101 .handler = monotonic_interrupt,
102 .flags = IRQF_DISABLED,
103 .name = "Monotonic timer",
104};
105
73void __init plat_timer_setup(struct irqaction *irq) 106void __init plat_timer_setup(struct irqaction *irq)
74{ 107{
75 int configPR; 108 int configPR;
76 109
77 setup_irq(PNX8550_INT_TIMER1, irq); 110 setup_irq(PNX8550_INT_TIMER1, irq);
111 setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
78 112
79 /* Start timer1 */ 113 /* Timer 1 start */
80 configPR = read_c0_config7(); 114 configPR = read_c0_config7();
81 configPR &= ~0x00000008; 115 configPR &= ~0x00000008;
82 write_c0_config7(configPR); 116 write_c0_config7(configPR);
83 117
84 /* Timer 2 stop */ 118 /* Timer 2 start */
85 configPR = read_c0_config7(); 119 configPR = read_c0_config7();
86 configPR |= 0x00000010; 120 configPR &= ~0x00000010;
87 write_c0_config7(configPR); 121 write_c0_config7(configPR);
88 122
89 write_c0_count2(0);
90 write_c0_compare2(0xffffffff);
91
92 /* Timer 3 stop */ 123 /* Timer 3 stop */
93 configPR = read_c0_config7(); 124 configPR = read_c0_config7();
94 configPR |= 0x00000020; 125 configPR |= 0x00000020;
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 4a23a97b06cd..12cc019307ad 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -608,7 +608,7 @@ void smp_cpus_done(unsigned int cpu_max)
608} 608}
609 609
610 610
611int __devinit __cpu_up(unsigned int cpu) 611int __cpuinit __cpu_up(unsigned int cpu)
612{ 612{
613 if (cpu != 0 && cpu < parisc_max_cpus) 613 if (cpu != 0 && cpu < parisc_max_cpus)
614 smp_boot_one_cpu(cpu); 614 smp_boot_one_cpu(cpu);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8699dadcd096..0855d55c194d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -436,7 +436,7 @@ config PPC_EFIKA
436 select RTAS_PROC 436 select RTAS_PROC
437 select PPC_MPC52xx 437 select PPC_MPC52xx
438 select PPC_NATIVE 438 select PPC_NATIVE
439 default y 439 default n
440 440
441config PPC_LITE5200 441config PPC_LITE5200
442 bool "Freescale Lite5200 Eval Board" 442 bool "Freescale Lite5200 Eval Board"
@@ -471,7 +471,7 @@ config PPC_PREP
471 select PPC_INDIRECT_PCI 471 select PPC_INDIRECT_PCI
472 select PPC_UDBG_16550 472 select PPC_UDBG_16550
473 select PPC_NATIVE 473 select PPC_NATIVE
474 default y 474 default n
475 475
476config PPC_MAPLE 476config PPC_MAPLE
477 depends on PPC_MULTIPLATFORM && PPC64 477 depends on PPC_MULTIPLATFORM && PPC64
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index 8bc0d259796d..a8efb59f5dd7 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -238,7 +238,7 @@
238 238
239 // PSC3 in CODEC mode example 239 // PSC3 in CODEC mode example
240 i2s@2400 { // PSC3 240 i2s@2400 { // PSC3
241 device_type = "i2s"; 241 device_type = "sound";
242 compatible = "mpc5200-psc-i2s\0mpc52xx-psc-i2s"; 242 compatible = "mpc5200-psc-i2s\0mpc52xx-psc-i2s";
243 reg = <2400 100>; 243 reg = <2400 100>;
244 interrupts = <2 3 0>; 244 interrupts = <2 3 0>;
@@ -265,7 +265,7 @@
265 265
266 // PSC6 in AC97 mode example 266 // PSC6 in AC97 mode example
267 ac97@2c00 { // PSC6 267 ac97@2c00 { // PSC6
268 device_type = "ac97"; 268 device_type = "sound";
269 compatible = "mpc5200-psc-ac97\0mpc52xx-psc-ac97"; 269 compatible = "mpc5200-psc-ac97\0mpc52xx-psc-ac97";
270 reg = <2c00 100>; 270 reg = <2c00 100>;
271 interrupts = <2 4 0>; 271 interrupts = <2 4 0>;
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index 81cb76418a78..1aabee432d86 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -243,7 +243,7 @@
243 243
244 // PSC3 in CODEC mode example 244 // PSC3 in CODEC mode example
245 i2s@2400 { // PSC3 245 i2s@2400 { // PSC3
246 device_type = "i2s"; 246 device_type = "sound";
247 compatible = "mpc5200b-psc-i2s\0mpc52xx-psc-i2s"; 247 compatible = "mpc5200b-psc-i2s\0mpc52xx-psc-i2s";
248 reg = <2400 100>; 248 reg = <2400 100>;
249 interrupts = <2 3 0>; 249 interrupts = <2 3 0>;
@@ -270,7 +270,7 @@
270 270
271 // PSC6 in AC97 mode example 271 // PSC6 in AC97 mode example
272 ac97@2c00 { // PSC6 272 ac97@2c00 { // PSC6
273 device_type = "ac97"; 273 device_type = "sound";
274 compatible = "mpc5200b-psc-ac97\0mpc52xx-psc-ac97"; 274 compatible = "mpc5200b-psc-ac97\0mpc52xx-psc-ac97";
275 reg = <2c00 100>; 275 reg = <2c00 100>;
276 interrupts = <2 4 0>; 276 interrupts = <2 4 0>;
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 1c009651f925..340376a47001 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18-rc6 3# Linux kernel version: 2.6.20-rc3
4# Sun Sep 10 10:45:11 2006 4# Tue Jan 2 15:32:44 2007
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -10,6 +10,8 @@ CONFIG_MMU=y
10CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_IRQ_PER_CPU=y 11CONFIG_IRQ_PER_CPU=y
12CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12CONFIG_RWSEM_XCHGADD_ALGORITHM=y
13CONFIG_ARCH_HAS_ILOG2_U32=y
14CONFIG_ARCH_HAS_ILOG2_U64=y
13CONFIG_GENERIC_HWEIGHT=y 15CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_CALIBRATE_DELAY=y 16CONFIG_GENERIC_CALIBRATE_DELAY=y
15CONFIG_GENERIC_FIND_NEXT_BIT=y 17CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -22,6 +24,8 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
22CONFIG_PPC_OF=y 24CONFIG_PPC_OF=y
23CONFIG_PPC_UDBG_16550=y 25CONFIG_PPC_UDBG_16550=y
24CONFIG_GENERIC_TBSYNC=y 26CONFIG_GENERIC_TBSYNC=y
27CONFIG_AUDIT_ARCH=y
28CONFIG_GENERIC_BUG=y
25# CONFIG_DEFAULT_UIMAGE is not set 29# CONFIG_DEFAULT_UIMAGE is not set
26 30
27# 31#
@@ -31,6 +35,10 @@ CONFIG_GENERIC_TBSYNC=y
31CONFIG_POWER3=y 35CONFIG_POWER3=y
32CONFIG_POWER4=y 36CONFIG_POWER4=y
33CONFIG_PPC_FPU=y 37CONFIG_PPC_FPU=y
38# CONFIG_PPC_DCR_NATIVE is not set
39CONFIG_PPC_DCR_MMIO=y
40CONFIG_PPC_DCR=y
41CONFIG_PPC_OF_PLATFORM_PCI=y
34CONFIG_ALTIVEC=y 42CONFIG_ALTIVEC=y
35CONFIG_PPC_STD_MMU=y 43CONFIG_PPC_STD_MMU=y
36CONFIG_VIRT_CPU_ACCOUNTING=y 44CONFIG_VIRT_CPU_ACCOUNTING=y
@@ -52,19 +60,24 @@ CONFIG_LOCALVERSION=""
52CONFIG_LOCALVERSION_AUTO=y 60CONFIG_LOCALVERSION_AUTO=y
53CONFIG_SWAP=y 61CONFIG_SWAP=y
54CONFIG_SYSVIPC=y 62CONFIG_SYSVIPC=y
63# CONFIG_IPC_NS is not set
55CONFIG_POSIX_MQUEUE=y 64CONFIG_POSIX_MQUEUE=y
56# CONFIG_BSD_PROCESS_ACCT is not set 65# CONFIG_BSD_PROCESS_ACCT is not set
57CONFIG_TASKSTATS=y 66CONFIG_TASKSTATS=y
58CONFIG_TASK_DELAY_ACCT=y 67CONFIG_TASK_DELAY_ACCT=y
59CONFIG_SYSCTL=y 68# CONFIG_UTS_NS is not set
60# CONFIG_AUDIT is not set 69# CONFIG_AUDIT is not set
61CONFIG_IKCONFIG=y 70CONFIG_IKCONFIG=y
62CONFIG_IKCONFIG_PROC=y 71CONFIG_IKCONFIG_PROC=y
63CONFIG_CPUSETS=y 72CONFIG_CPUSETS=y
73CONFIG_SYSFS_DEPRECATED=y
64CONFIG_RELAY=y 74CONFIG_RELAY=y
65CONFIG_INITRAMFS_SOURCE="" 75CONFIG_INITRAMFS_SOURCE=""
66CONFIG_CC_OPTIMIZE_FOR_SIZE=y 76CONFIG_CC_OPTIMIZE_FOR_SIZE=y
77# CONFIG_TASK_XACCT is not set
78CONFIG_SYSCTL=y
67# CONFIG_EMBEDDED is not set 79# CONFIG_EMBEDDED is not set
80CONFIG_SYSCTL_SYSCALL=y
68CONFIG_KALLSYMS=y 81CONFIG_KALLSYMS=y
69CONFIG_KALLSYMS_ALL=y 82CONFIG_KALLSYMS_ALL=y
70# CONFIG_KALLSYMS_EXTRA_PASS is not set 83# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -73,12 +86,12 @@ CONFIG_PRINTK=y
73CONFIG_BUG=y 86CONFIG_BUG=y
74CONFIG_ELF_CORE=y 87CONFIG_ELF_CORE=y
75CONFIG_BASE_FULL=y 88CONFIG_BASE_FULL=y
76CONFIG_RT_MUTEXES=y
77CONFIG_FUTEX=y 89CONFIG_FUTEX=y
78CONFIG_EPOLL=y 90CONFIG_EPOLL=y
79CONFIG_SHMEM=y 91CONFIG_SHMEM=y
80CONFIG_SLAB=y 92CONFIG_SLAB=y
81CONFIG_VM_EVENT_COUNTERS=y 93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_RT_MUTEXES=y
82# CONFIG_TINY_SHMEM is not set 95# CONFIG_TINY_SHMEM is not set
83CONFIG_BASE_SMALL=0 96CONFIG_BASE_SMALL=0
84# CONFIG_SLOB is not set 97# CONFIG_SLOB is not set
@@ -97,6 +110,7 @@ CONFIG_STOP_MACHINE=y
97# 110#
98# Block layer 111# Block layer
99# 112#
113CONFIG_BLOCK=y
100CONFIG_BLK_DEV_IO_TRACE=y 114CONFIG_BLK_DEV_IO_TRACE=y
101 115
102# 116#
@@ -116,16 +130,20 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
116# Platform support 130# Platform support
117# 131#
118CONFIG_PPC_MULTIPLATFORM=y 132CONFIG_PPC_MULTIPLATFORM=y
119# CONFIG_PPC_ISERIES is not set
120# CONFIG_EMBEDDED6xx is not set 133# CONFIG_EMBEDDED6xx is not set
121# CONFIG_APUS is not set 134# CONFIG_APUS is not set
122CONFIG_PPC_PSERIES=y 135CONFIG_PPC_PSERIES=y
136CONFIG_PPC_ISERIES=y
137# CONFIG_PPC_MPC52xx is not set
123CONFIG_PPC_PMAC=y 138CONFIG_PPC_PMAC=y
124CONFIG_PPC_PMAC64=y 139CONFIG_PPC_PMAC64=y
125CONFIG_PPC_MAPLE=y 140CONFIG_PPC_MAPLE=y
141# CONFIG_PPC_PASEMI is not set
126CONFIG_PPC_CELL=y 142CONFIG_PPC_CELL=y
127CONFIG_PPC_CELL_NATIVE=y 143CONFIG_PPC_CELL_NATIVE=y
128CONFIG_PPC_IBM_CELL_BLADE=y 144CONFIG_PPC_IBM_CELL_BLADE=y
145# CONFIG_PPC_PS3 is not set
146CONFIG_PPC_NATIVE=y
129CONFIG_UDBG_RTAS_CONSOLE=y 147CONFIG_UDBG_RTAS_CONSOLE=y
130CONFIG_XICS=y 148CONFIG_XICS=y
131CONFIG_U3_DART=y 149CONFIG_U3_DART=y
@@ -139,6 +157,8 @@ CONFIG_IBMVIO=y
139# CONFIG_IBMEBUS is not set 157# CONFIG_IBMEBUS is not set
140# CONFIG_PPC_MPC106 is not set 158# CONFIG_PPC_MPC106 is not set
141CONFIG_PPC_970_NAP=y 159CONFIG_PPC_970_NAP=y
160CONFIG_PPC_INDIRECT_IO=y
161CONFIG_GENERIC_IOMAP=y
142CONFIG_CPU_FREQ=y 162CONFIG_CPU_FREQ=y
143CONFIG_CPU_FREQ_TABLE=y 163CONFIG_CPU_FREQ_TABLE=y
144# CONFIG_CPU_FREQ_DEBUG is not set 164# CONFIG_CPU_FREQ_DEBUG is not set
@@ -160,14 +180,16 @@ CONFIG_MPIC=y
160# 180#
161CONFIG_SPU_FS=m 181CONFIG_SPU_FS=m
162CONFIG_SPU_BASE=y 182CONFIG_SPU_BASE=y
163CONFIG_SPUFS_MMAP=y
164CONFIG_CBE_RAS=y 183CONFIG_CBE_RAS=y
184CONFIG_CBE_THERM=m
185CONFIG_CBE_CPUFREQ=m
165 186
166# 187#
167# Kernel options 188# Kernel options
168# 189#
169# CONFIG_HZ_100 is not set 190# CONFIG_HZ_100 is not set
170CONFIG_HZ_250=y 191CONFIG_HZ_250=y
192# CONFIG_HZ_300 is not set
171# CONFIG_HZ_1000 is not set 193# CONFIG_HZ_1000 is not set
172CONFIG_HZ=250 194CONFIG_HZ=250
173CONFIG_PREEMPT_NONE=y 195CONFIG_PREEMPT_NONE=y
@@ -192,6 +214,7 @@ CONFIG_ARCH_SELECT_MEMORY_MODEL=y
192CONFIG_ARCH_FLATMEM_ENABLE=y 214CONFIG_ARCH_FLATMEM_ENABLE=y
193CONFIG_ARCH_SPARSEMEM_ENABLE=y 215CONFIG_ARCH_SPARSEMEM_ENABLE=y
194CONFIG_ARCH_SPARSEMEM_DEFAULT=y 216CONFIG_ARCH_SPARSEMEM_DEFAULT=y
217CONFIG_ARCH_POPULATES_NODE_MAP=y
195CONFIG_SELECT_MEMORY_MODEL=y 218CONFIG_SELECT_MEMORY_MODEL=y
196# CONFIG_FLATMEM_MANUAL is not set 219# CONFIG_FLATMEM_MANUAL is not set
197# CONFIG_DISCONTIGMEM_MANUAL is not set 220# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -201,6 +224,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y
201# CONFIG_SPARSEMEM_STATIC is not set 224# CONFIG_SPARSEMEM_STATIC is not set
202CONFIG_SPARSEMEM_EXTREME=y 225CONFIG_SPARSEMEM_EXTREME=y
203CONFIG_MEMORY_HOTPLUG=y 226CONFIG_MEMORY_HOTPLUG=y
227CONFIG_MEMORY_HOTPLUG_SPARSE=y
204CONFIG_SPLIT_PTLOCK_CPUS=4 228CONFIG_SPLIT_PTLOCK_CPUS=4
205CONFIG_RESOURCES_64BIT=y 229CONFIG_RESOURCES_64BIT=y
206CONFIG_ARCH_MEMORY_PROBE=y 230CONFIG_ARCH_MEMORY_PROBE=y
@@ -222,6 +246,7 @@ CONFIG_PPC_I8259=y
222CONFIG_PCI=y 246CONFIG_PCI=y
223CONFIG_PCI_DOMAINS=y 247CONFIG_PCI_DOMAINS=y
224# CONFIG_PCIEPORTBUS is not set 248# CONFIG_PCIEPORTBUS is not set
249# CONFIG_PCI_MULTITHREAD_PROBE is not set
225# CONFIG_PCI_DEBUG is not set 250# CONFIG_PCI_DEBUG is not set
226 251
227# 252#
@@ -254,6 +279,7 @@ CONFIG_PACKET=y
254CONFIG_UNIX=y 279CONFIG_UNIX=y
255CONFIG_XFRM=y 280CONFIG_XFRM=y
256CONFIG_XFRM_USER=m 281CONFIG_XFRM_USER=m
282# CONFIG_XFRM_SUB_POLICY is not set
257CONFIG_NET_KEY=m 283CONFIG_NET_KEY=m
258CONFIG_INET=y 284CONFIG_INET=y
259CONFIG_IP_MULTICAST=y 285CONFIG_IP_MULTICAST=y
@@ -272,10 +298,13 @@ CONFIG_INET_XFRM_TUNNEL=m
272CONFIG_INET_TUNNEL=y 298CONFIG_INET_TUNNEL=y
273CONFIG_INET_XFRM_MODE_TRANSPORT=y 299CONFIG_INET_XFRM_MODE_TRANSPORT=y
274CONFIG_INET_XFRM_MODE_TUNNEL=y 300CONFIG_INET_XFRM_MODE_TUNNEL=y
301CONFIG_INET_XFRM_MODE_BEET=y
275CONFIG_INET_DIAG=y 302CONFIG_INET_DIAG=y
276CONFIG_INET_TCP_DIAG=y 303CONFIG_INET_TCP_DIAG=y
277# CONFIG_TCP_CONG_ADVANCED is not set 304# CONFIG_TCP_CONG_ADVANCED is not set
278CONFIG_TCP_CONG_BIC=y 305CONFIG_TCP_CONG_CUBIC=y
306CONFIG_DEFAULT_TCP_CONG="cubic"
307# CONFIG_TCP_MD5SIG is not set
279 308
280# 309#
281# IP: Virtual Server Configuration 310# IP: Virtual Server Configuration
@@ -294,25 +323,31 @@ CONFIG_NETFILTER=y
294CONFIG_NETFILTER_NETLINK=y 323CONFIG_NETFILTER_NETLINK=y
295CONFIG_NETFILTER_NETLINK_QUEUE=m 324CONFIG_NETFILTER_NETLINK_QUEUE=m
296CONFIG_NETFILTER_NETLINK_LOG=m 325CONFIG_NETFILTER_NETLINK_LOG=m
326CONFIG_NF_CONNTRACK_ENABLED=m
327CONFIG_NF_CONNTRACK_SUPPORT=y
328# CONFIG_IP_NF_CONNTRACK_SUPPORT is not set
329CONFIG_NF_CONNTRACK=m
330CONFIG_NF_CT_ACCT=y
331CONFIG_NF_CONNTRACK_MARK=y
332CONFIG_NF_CONNTRACK_EVENTS=y
333CONFIG_NF_CT_PROTO_GRE=m
334CONFIG_NF_CT_PROTO_SCTP=m
335CONFIG_NF_CONNTRACK_AMANDA=m
336CONFIG_NF_CONNTRACK_FTP=m
337CONFIG_NF_CONNTRACK_H323=m
338CONFIG_NF_CONNTRACK_IRC=m
339CONFIG_NF_CONNTRACK_NETBIOS_NS=m
340CONFIG_NF_CONNTRACK_PPTP=m
341CONFIG_NF_CONNTRACK_SIP=m
342CONFIG_NF_CONNTRACK_TFTP=m
343CONFIG_NF_CT_NETLINK=m
297# CONFIG_NETFILTER_XTABLES is not set 344# CONFIG_NETFILTER_XTABLES is not set
298 345
299# 346#
300# IP: Netfilter Configuration 347# IP: Netfilter Configuration
301# 348#
302CONFIG_IP_NF_CONNTRACK=m 349CONFIG_NF_CONNTRACK_IPV4=m
303CONFIG_IP_NF_CT_ACCT=y 350CONFIG_NF_CONNTRACK_PROC_COMPAT=y
304CONFIG_IP_NF_CONNTRACK_MARK=y
305CONFIG_IP_NF_CONNTRACK_EVENTS=y
306CONFIG_IP_NF_CONNTRACK_NETLINK=m
307CONFIG_IP_NF_CT_PROTO_SCTP=m
308CONFIG_IP_NF_FTP=m
309CONFIG_IP_NF_IRC=m
310# CONFIG_IP_NF_NETBIOS_NS is not set
311CONFIG_IP_NF_TFTP=m
312CONFIG_IP_NF_AMANDA=m
313# CONFIG_IP_NF_PPTP is not set
314# CONFIG_IP_NF_H323 is not set
315CONFIG_IP_NF_SIP=m
316CONFIG_IP_NF_QUEUE=m 351CONFIG_IP_NF_QUEUE=m
317 352
318# 353#
@@ -339,7 +374,6 @@ CONFIG_LLC=y
339# CONFIG_ATALK is not set 374# CONFIG_ATALK is not set
340# CONFIG_X25 is not set 375# CONFIG_X25 is not set
341# CONFIG_LAPB is not set 376# CONFIG_LAPB is not set
342# CONFIG_NET_DIVERT is not set
343# CONFIG_ECONET is not set 377# CONFIG_ECONET is not set
344# CONFIG_WAN_ROUTER is not set 378# CONFIG_WAN_ROUTER is not set
345 379
@@ -412,6 +446,12 @@ CONFIG_BLK_DEV_INITRD=y
412# CONFIG_ATA_OVER_ETH is not set 446# CONFIG_ATA_OVER_ETH is not set
413 447
414# 448#
449# Misc devices
450#
451# CONFIG_SGI_IOC4 is not set
452# CONFIG_TIFM_CORE is not set
453
454#
415# ATA/ATAPI/MFM/RLL support 455# ATA/ATAPI/MFM/RLL support
416# 456#
417CONFIG_IDE=y 457CONFIG_IDE=y
@@ -438,7 +478,6 @@ CONFIG_IDEPCI_SHARE_IRQ=y
438# CONFIG_BLK_DEV_OFFBOARD is not set 478# CONFIG_BLK_DEV_OFFBOARD is not set
439CONFIG_BLK_DEV_GENERIC=y 479CONFIG_BLK_DEV_GENERIC=y
440# CONFIG_BLK_DEV_OPTI621 is not set 480# CONFIG_BLK_DEV_OPTI621 is not set
441CONFIG_BLK_DEV_SL82C105=y
442CONFIG_BLK_DEV_IDEDMA_PCI=y 481CONFIG_BLK_DEV_IDEDMA_PCI=y
443# CONFIG_BLK_DEV_IDEDMA_FORCED is not set 482# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
444CONFIG_IDEDMA_PCI_AUTO=y 483CONFIG_IDEDMA_PCI_AUTO=y
@@ -453,6 +492,7 @@ CONFIG_BLK_DEV_AMD74XX=y
453# CONFIG_BLK_DEV_CS5530 is not set 492# CONFIG_BLK_DEV_CS5530 is not set
454# CONFIG_BLK_DEV_HPT34X is not set 493# CONFIG_BLK_DEV_HPT34X is not set
455# CONFIG_BLK_DEV_HPT366 is not set 494# CONFIG_BLK_DEV_HPT366 is not set
495# CONFIG_BLK_DEV_JMICRON is not set
456# CONFIG_BLK_DEV_SC1200 is not set 496# CONFIG_BLK_DEV_SC1200 is not set
457# CONFIG_BLK_DEV_PIIX is not set 497# CONFIG_BLK_DEV_PIIX is not set
458# CONFIG_BLK_DEV_IT821X is not set 498# CONFIG_BLK_DEV_IT821X is not set
@@ -461,6 +501,7 @@ CONFIG_BLK_DEV_AMD74XX=y
461# CONFIG_BLK_DEV_PDC202XX_NEW is not set 501# CONFIG_BLK_DEV_PDC202XX_NEW is not set
462# CONFIG_BLK_DEV_SVWKS is not set 502# CONFIG_BLK_DEV_SVWKS is not set
463# CONFIG_BLK_DEV_SIIMAGE is not set 503# CONFIG_BLK_DEV_SIIMAGE is not set
504CONFIG_BLK_DEV_SL82C105=y
464# CONFIG_BLK_DEV_SLC90E66 is not set 505# CONFIG_BLK_DEV_SLC90E66 is not set
465# CONFIG_BLK_DEV_TRM290 is not set 506# CONFIG_BLK_DEV_TRM290 is not set
466# CONFIG_BLK_DEV_VIA82CXXX is not set 507# CONFIG_BLK_DEV_VIA82CXXX is not set
@@ -478,6 +519,8 @@ CONFIG_IDEDMA_AUTO=y
478# 519#
479# CONFIG_RAID_ATTRS is not set 520# CONFIG_RAID_ATTRS is not set
480CONFIG_SCSI=y 521CONFIG_SCSI=y
522# CONFIG_SCSI_TGT is not set
523CONFIG_SCSI_NETLINK=y
481CONFIG_SCSI_PROC_FS=y 524CONFIG_SCSI_PROC_FS=y
482 525
483# 526#
@@ -497,14 +540,16 @@ CONFIG_CHR_DEV_SG=y
497CONFIG_SCSI_MULTI_LUN=y 540CONFIG_SCSI_MULTI_LUN=y
498CONFIG_SCSI_CONSTANTS=y 541CONFIG_SCSI_CONSTANTS=y
499# CONFIG_SCSI_LOGGING is not set 542# CONFIG_SCSI_LOGGING is not set
543# CONFIG_SCSI_SCAN_ASYNC is not set
500 544
501# 545#
502# SCSI Transport Attributes 546# SCSI Transports
503# 547#
504CONFIG_SCSI_SPI_ATTRS=y 548CONFIG_SCSI_SPI_ATTRS=y
505CONFIG_SCSI_FC_ATTRS=y 549CONFIG_SCSI_FC_ATTRS=y
506CONFIG_SCSI_ISCSI_ATTRS=m 550CONFIG_SCSI_ISCSI_ATTRS=m
507# CONFIG_SCSI_SAS_ATTRS is not set 551# CONFIG_SCSI_SAS_ATTRS is not set
552# CONFIG_SCSI_SAS_LIBSAS is not set
508 553
509# 554#
510# SCSI low-level drivers 555# SCSI low-level drivers
@@ -517,26 +562,12 @@ CONFIG_SCSI_ISCSI_ATTRS=m
517# CONFIG_SCSI_AIC7XXX is not set 562# CONFIG_SCSI_AIC7XXX is not set
518# CONFIG_SCSI_AIC7XXX_OLD is not set 563# CONFIG_SCSI_AIC7XXX_OLD is not set
519# CONFIG_SCSI_AIC79XX is not set 564# CONFIG_SCSI_AIC79XX is not set
565# CONFIG_SCSI_AIC94XX is not set
566# CONFIG_SCSI_ARCMSR is not set
520# CONFIG_MEGARAID_NEWGEN is not set 567# CONFIG_MEGARAID_NEWGEN is not set
521# CONFIG_MEGARAID_LEGACY is not set 568# CONFIG_MEGARAID_LEGACY is not set
522# CONFIG_MEGARAID_SAS is not set 569# CONFIG_MEGARAID_SAS is not set
523CONFIG_ATA=y
524# CONFIG_SATA_AHCI is not set
525CONFIG_SATA_SVW=y
526# CONFIG_SCSI_ATA_PIIX is not set
527# CONFIG_SATA_MV is not set
528# CONFIG_SATA_NV is not set
529# CONFIG_SCSI_PDC_ADMA is not set
530# CONFIG_SCSI_HPTIOP is not set 570# CONFIG_SCSI_HPTIOP is not set
531# CONFIG_SATA_QSTOR is not set
532# CONFIG_SATA_PROMISE is not set
533# CONFIG_SATA_SX4 is not set
534# CONFIG_SATA_SIL is not set
535# CONFIG_SATA_SIL24 is not set
536# CONFIG_SATA_SIS is not set
537# CONFIG_SATA_ULI is not set
538# CONFIG_SATA_VIA is not set
539# CONFIG_SATA_VITESSE is not set
540# CONFIG_SCSI_BUSLOGIC is not set 571# CONFIG_SCSI_BUSLOGIC is not set
541# CONFIG_SCSI_DMX3191D is not set 572# CONFIG_SCSI_DMX3191D is not set
542# CONFIG_SCSI_EATA is not set 573# CONFIG_SCSI_EATA is not set
@@ -546,6 +577,7 @@ CONFIG_SATA_SVW=y
546CONFIG_SCSI_IBMVSCSI=y 577CONFIG_SCSI_IBMVSCSI=y
547# CONFIG_SCSI_INITIO is not set 578# CONFIG_SCSI_INITIO is not set
548# CONFIG_SCSI_INIA100 is not set 579# CONFIG_SCSI_INIA100 is not set
580# CONFIG_SCSI_STEX is not set
549CONFIG_SCSI_SYM53C8XX_2=y 581CONFIG_SCSI_SYM53C8XX_2=y
550CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 582CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
551CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 583CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
@@ -556,10 +588,66 @@ CONFIG_SCSI_IPR_TRACE=y
556CONFIG_SCSI_IPR_DUMP=y 588CONFIG_SCSI_IPR_DUMP=y
557# CONFIG_SCSI_QLOGIC_1280 is not set 589# CONFIG_SCSI_QLOGIC_1280 is not set
558# CONFIG_SCSI_QLA_FC is not set 590# CONFIG_SCSI_QLA_FC is not set
591# CONFIG_SCSI_QLA_ISCSI is not set
559CONFIG_SCSI_LPFC=m 592CONFIG_SCSI_LPFC=m
560# CONFIG_SCSI_DC395x is not set 593# CONFIG_SCSI_DC395x is not set
561# CONFIG_SCSI_DC390T is not set 594# CONFIG_SCSI_DC390T is not set
562CONFIG_SCSI_DEBUG=m 595CONFIG_SCSI_DEBUG=m
596# CONFIG_SCSI_SRP is not set
597
598#
599# Serial ATA (prod) and Parallel ATA (experimental) drivers
600#
601CONFIG_ATA=y
602# CONFIG_SATA_AHCI is not set
603CONFIG_SATA_SVW=y
604# CONFIG_ATA_PIIX is not set
605# CONFIG_SATA_MV is not set
606# CONFIG_SATA_NV is not set
607# CONFIG_PDC_ADMA is not set
608# CONFIG_SATA_QSTOR is not set
609# CONFIG_SATA_PROMISE is not set
610# CONFIG_SATA_SX4 is not set
611# CONFIG_SATA_SIL is not set
612# CONFIG_SATA_SIL24 is not set
613# CONFIG_SATA_SIS is not set
614# CONFIG_SATA_ULI is not set
615# CONFIG_SATA_VIA is not set
616# CONFIG_SATA_VITESSE is not set
617# CONFIG_PATA_ALI is not set
618# CONFIG_PATA_AMD is not set
619# CONFIG_PATA_ARTOP is not set
620# CONFIG_PATA_ATIIXP is not set
621# CONFIG_PATA_CMD64X is not set
622# CONFIG_PATA_CS5520 is not set
623# CONFIG_PATA_CS5530 is not set
624# CONFIG_PATA_CYPRESS is not set
625# CONFIG_PATA_EFAR is not set
626# CONFIG_ATA_GENERIC is not set
627# CONFIG_PATA_HPT366 is not set
628# CONFIG_PATA_HPT37X is not set
629# CONFIG_PATA_HPT3X2N is not set
630# CONFIG_PATA_HPT3X3 is not set
631# CONFIG_PATA_IT821X is not set
632# CONFIG_PATA_JMICRON is not set
633# CONFIG_PATA_TRIFLEX is not set
634# CONFIG_PATA_MARVELL is not set
635# CONFIG_PATA_MPIIX is not set
636# CONFIG_PATA_OLDPIIX is not set
637# CONFIG_PATA_NETCELL is not set
638# CONFIG_PATA_NS87410 is not set
639# CONFIG_PATA_OPTI is not set
640# CONFIG_PATA_OPTIDMA is not set
641# CONFIG_PATA_PDC_OLD is not set
642# CONFIG_PATA_RADISYS is not set
643# CONFIG_PATA_RZ1000 is not set
644# CONFIG_PATA_SC1200 is not set
645# CONFIG_PATA_SERVERWORKS is not set
646# CONFIG_PATA_PDC2027X is not set
647# CONFIG_PATA_SIL680 is not set
648# CONFIG_PATA_SIS is not set
649# CONFIG_PATA_VIA is not set
650# CONFIG_PATA_WINBOND is not set
563 651
564# 652#
565# Multi-device support (RAID and LVM) 653# Multi-device support (RAID and LVM)
@@ -575,6 +663,7 @@ CONFIG_MD_RAID5_RESHAPE=y
575CONFIG_MD_MULTIPATH=m 663CONFIG_MD_MULTIPATH=m
576CONFIG_MD_FAULTY=m 664CONFIG_MD_FAULTY=m
577CONFIG_BLK_DEV_DM=y 665CONFIG_BLK_DEV_DM=y
666# CONFIG_DM_DEBUG is not set
578CONFIG_DM_CRYPT=m 667CONFIG_DM_CRYPT=m
579CONFIG_DM_SNAPSHOT=m 668CONFIG_DM_SNAPSHOT=m
580CONFIG_DM_MIRROR=m 669CONFIG_DM_MIRROR=m
@@ -630,11 +719,13 @@ CONFIG_IEEE1394_RAWIO=y
630CONFIG_ADB_PMU=y 719CONFIG_ADB_PMU=y
631# CONFIG_ADB_PMU_LED is not set 720# CONFIG_ADB_PMU_LED is not set
632CONFIG_PMAC_SMU=y 721CONFIG_PMAC_SMU=y
722# CONFIG_MAC_EMUMOUSEBTN is not set
633CONFIG_THERM_PM72=y 723CONFIG_THERM_PM72=y
634CONFIG_WINDFARM=y 724CONFIG_WINDFARM=y
635CONFIG_WINDFARM_PM81=y 725CONFIG_WINDFARM_PM81=y
636CONFIG_WINDFARM_PM91=y 726CONFIG_WINDFARM_PM91=y
637CONFIG_WINDFARM_PM112=y 727CONFIG_WINDFARM_PM112=y
728# CONFIG_PMAC_RACKMETER is not set
638 729
639# 730#
640# Network device support 731# Network device support
@@ -675,6 +766,7 @@ CONFIG_VORTEX=y
675CONFIG_IBMVETH=m 766CONFIG_IBMVETH=m
676CONFIG_NET_PCI=y 767CONFIG_NET_PCI=y
677CONFIG_PCNET32=y 768CONFIG_PCNET32=y
769# CONFIG_PCNET32_NAPI is not set
678# CONFIG_AMD8111_ETH is not set 770# CONFIG_AMD8111_ETH is not set
679# CONFIG_ADAPTEC_STARFIRE is not set 771# CONFIG_ADAPTEC_STARFIRE is not set
680# CONFIG_B44 is not set 772# CONFIG_B44 is not set
@@ -713,7 +805,7 @@ CONFIG_E1000=y
713CONFIG_TIGON3=y 805CONFIG_TIGON3=y
714# CONFIG_BNX2 is not set 806# CONFIG_BNX2 is not set
715CONFIG_SPIDER_NET=m 807CONFIG_SPIDER_NET=m
716# CONFIG_MV643XX_ETH is not set 808# CONFIG_QLA3XXX is not set
717 809
718# 810#
719# Ethernet (10000 Mbit) 811# Ethernet (10000 Mbit)
@@ -723,6 +815,7 @@ CONFIG_IXGB=m
723# CONFIG_IXGB_NAPI is not set 815# CONFIG_IXGB_NAPI is not set
724# CONFIG_S2IO is not set 816# CONFIG_S2IO is not set
725# CONFIG_MYRI10GE is not set 817# CONFIG_MYRI10GE is not set
818# CONFIG_NETXEN_NIC is not set
726 819
727# 820#
728# Token Ring devices 821# Token Ring devices
@@ -741,6 +834,7 @@ CONFIG_IBMOL=y
741# Wan interfaces 834# Wan interfaces
742# 835#
743# CONFIG_WAN is not set 836# CONFIG_WAN is not set
837CONFIG_ISERIES_VETH=m
744# CONFIG_FDDI is not set 838# CONFIG_FDDI is not set
745# CONFIG_HIPPI is not set 839# CONFIG_HIPPI is not set
746CONFIG_PPP=m 840CONFIG_PPP=m
@@ -753,6 +847,7 @@ CONFIG_PPP_BSDCOMP=m
753# CONFIG_PPP_MPPE is not set 847# CONFIG_PPP_MPPE is not set
754CONFIG_PPPOE=m 848CONFIG_PPPOE=m
755# CONFIG_SLIP is not set 849# CONFIG_SLIP is not set
850CONFIG_SLHC=m
756# CONFIG_NET_FC is not set 851# CONFIG_NET_FC is not set
757# CONFIG_SHAPER is not set 852# CONFIG_SHAPER is not set
758CONFIG_NETCONSOLE=y 853CONFIG_NETCONSOLE=y
@@ -775,6 +870,7 @@ CONFIG_NET_POLL_CONTROLLER=y
775# Input device support 870# Input device support
776# 871#
777CONFIG_INPUT=y 872CONFIG_INPUT=y
873# CONFIG_INPUT_FF_MEMLESS is not set
778 874
779# 875#
780# Userland interfaces 876# Userland interfaces
@@ -797,6 +893,7 @@ CONFIG_KEYBOARD_ATKBD=y
797# CONFIG_KEYBOARD_LKKBD is not set 893# CONFIG_KEYBOARD_LKKBD is not set
798# CONFIG_KEYBOARD_XTKBD is not set 894# CONFIG_KEYBOARD_XTKBD is not set
799# CONFIG_KEYBOARD_NEWTON is not set 895# CONFIG_KEYBOARD_NEWTON is not set
896# CONFIG_KEYBOARD_STOWAWAY is not set
800CONFIG_INPUT_MOUSE=y 897CONFIG_INPUT_MOUSE=y
801CONFIG_MOUSE_PS2=y 898CONFIG_MOUSE_PS2=y
802# CONFIG_MOUSE_SERIAL is not set 899# CONFIG_MOUSE_SERIAL is not set
@@ -850,6 +947,7 @@ CONFIG_LEGACY_PTYS=y
850CONFIG_LEGACY_PTY_COUNT=256 947CONFIG_LEGACY_PTY_COUNT=256
851CONFIG_HVC_DRIVER=y 948CONFIG_HVC_DRIVER=y
852CONFIG_HVC_CONSOLE=y 949CONFIG_HVC_CONSOLE=y
950CONFIG_HVC_ISERIES=y
853CONFIG_HVC_RTAS=y 951CONFIG_HVC_RTAS=y
854CONFIG_HVCS=m 952CONFIG_HVCS=m
855 953
@@ -868,10 +966,6 @@ CONFIG_GEN_RTC=y
868# CONFIG_DTLK is not set 966# CONFIG_DTLK is not set
869# CONFIG_R3964 is not set 967# CONFIG_R3964 is not set
870# CONFIG_APPLICOM is not set 968# CONFIG_APPLICOM is not set
871
872#
873# Ftape, the floppy tape device driver
874#
875# CONFIG_AGP is not set 969# CONFIG_AGP is not set
876# CONFIG_DRM is not set 970# CONFIG_DRM is not set
877CONFIG_RAW_DRIVER=y 971CONFIG_RAW_DRIVER=y
@@ -882,7 +976,6 @@ CONFIG_MAX_RAW_DEVS=256
882# TPM devices 976# TPM devices
883# 977#
884# CONFIG_TCG_TPM is not set 978# CONFIG_TCG_TPM is not set
885# CONFIG_TELCLOCK is not set
886 979
887# 980#
888# I2C support 981# I2C support
@@ -947,6 +1040,7 @@ CONFIG_I2C_POWERMAC=y
947# 1040#
948# Dallas's 1-wire bus 1041# Dallas's 1-wire bus
949# 1042#
1043# CONFIG_W1 is not set
950 1044
951# 1045#
952# Hardware Monitoring support 1046# Hardware Monitoring support
@@ -955,14 +1049,9 @@ CONFIG_I2C_POWERMAC=y
955# CONFIG_HWMON_VID is not set 1049# CONFIG_HWMON_VID is not set
956 1050
957# 1051#
958# Misc devices
959#
960
961#
962# Multimedia devices 1052# Multimedia devices
963# 1053#
964# CONFIG_VIDEO_DEV is not set 1054# CONFIG_VIDEO_DEV is not set
965CONFIG_VIDEO_V4L2=y
966 1055
967# 1056#
968# Digital Video Broadcasting Devices 1057# Digital Video Broadcasting Devices
@@ -975,6 +1064,7 @@ CONFIG_VIDEO_V4L2=y
975# 1064#
976CONFIG_FIRMWARE_EDID=y 1065CONFIG_FIRMWARE_EDID=y
977CONFIG_FB=y 1066CONFIG_FB=y
1067CONFIG_FB_DDC=y
978CONFIG_FB_CFB_FILLRECT=y 1068CONFIG_FB_CFB_FILLRECT=y
979CONFIG_FB_CFB_COPYAREA=y 1069CONFIG_FB_CFB_COPYAREA=y
980CONFIG_FB_CFB_IMAGEBLIT=y 1070CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1011,6 +1101,7 @@ CONFIG_FB_RADEON_I2C=y
1011# CONFIG_FB_3DFX is not set 1101# CONFIG_FB_3DFX is not set
1012# CONFIG_FB_VOODOO1 is not set 1102# CONFIG_FB_VOODOO1 is not set
1013# CONFIG_FB_TRIDENT is not set 1103# CONFIG_FB_TRIDENT is not set
1104CONFIG_FB_IBM_GXT4500=y
1014# CONFIG_FB_VIRTUAL is not set 1105# CONFIG_FB_VIRTUAL is not set
1015 1106
1016# 1107#
@@ -1159,6 +1250,11 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m
1159# CONFIG_SOUND_PRIME is not set 1250# CONFIG_SOUND_PRIME is not set
1160 1251
1161# 1252#
1253# HID Devices
1254#
1255CONFIG_HID=y
1256
1257#
1162# USB support 1258# USB support
1163# 1259#
1164CONFIG_USB_ARCH_HAS_HCD=y 1260CONFIG_USB_ARCH_HAS_HCD=y
@@ -1173,6 +1269,7 @@ CONFIG_USB=y
1173CONFIG_USB_DEVICEFS=y 1269CONFIG_USB_DEVICEFS=y
1174# CONFIG_USB_BANDWIDTH is not set 1270# CONFIG_USB_BANDWIDTH is not set
1175# CONFIG_USB_DYNAMIC_MINORS is not set 1271# CONFIG_USB_DYNAMIC_MINORS is not set
1272# CONFIG_USB_MULTITHREAD_PROBE is not set
1176# CONFIG_USB_OTG is not set 1273# CONFIG_USB_OTG is not set
1177 1274
1178# 1275#
@@ -1214,13 +1311,13 @@ CONFIG_USB_STORAGE=m
1214# CONFIG_USB_STORAGE_JUMPSHOT is not set 1311# CONFIG_USB_STORAGE_JUMPSHOT is not set
1215# CONFIG_USB_STORAGE_ALAUDA is not set 1312# CONFIG_USB_STORAGE_ALAUDA is not set
1216# CONFIG_USB_STORAGE_ONETOUCH is not set 1313# CONFIG_USB_STORAGE_ONETOUCH is not set
1314# CONFIG_USB_STORAGE_KARMA is not set
1217# CONFIG_USB_LIBUSUAL is not set 1315# CONFIG_USB_LIBUSUAL is not set
1218 1316
1219# 1317#
1220# USB Input Devices 1318# USB Input Devices
1221# 1319#
1222CONFIG_USB_HID=y 1320CONFIG_USB_HID=y
1223CONFIG_USB_HIDINPUT=y
1224# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1321# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1225# CONFIG_HID_FF is not set 1322# CONFIG_HID_FF is not set
1226CONFIG_USB_HIDDEV=y 1323CONFIG_USB_HIDDEV=y
@@ -1250,6 +1347,7 @@ CONFIG_USB_HIDDEV=y
1250# CONFIG_USB_KAWETH is not set 1347# CONFIG_USB_KAWETH is not set
1251# CONFIG_USB_PEGASUS is not set 1348# CONFIG_USB_PEGASUS is not set
1252# CONFIG_USB_RTL8150 is not set 1349# CONFIG_USB_RTL8150 is not set
1350# CONFIG_USB_USBNET_MII is not set
1253# CONFIG_USB_USBNET is not set 1351# CONFIG_USB_USBNET is not set
1254# CONFIG_USB_MON is not set 1352# CONFIG_USB_MON is not set
1255 1353
@@ -1267,6 +1365,7 @@ CONFIG_USB_HIDDEV=y
1267# 1365#
1268# CONFIG_USB_EMI62 is not set 1366# CONFIG_USB_EMI62 is not set
1269# CONFIG_USB_EMI26 is not set 1367# CONFIG_USB_EMI26 is not set
1368# CONFIG_USB_ADUTUX is not set
1270# CONFIG_USB_AUERSWALD is not set 1369# CONFIG_USB_AUERSWALD is not set
1271# CONFIG_USB_RIO500 is not set 1370# CONFIG_USB_RIO500 is not set
1272# CONFIG_USB_LEGOTOWER is not set 1371# CONFIG_USB_LEGOTOWER is not set
@@ -1274,12 +1373,13 @@ CONFIG_USB_HIDDEV=y
1274# CONFIG_USB_LED is not set 1373# CONFIG_USB_LED is not set
1275# CONFIG_USB_CYPRESS_CY7C63 is not set 1374# CONFIG_USB_CYPRESS_CY7C63 is not set
1276# CONFIG_USB_CYTHERM is not set 1375# CONFIG_USB_CYTHERM is not set
1277# CONFIG_USB_PHIDGETKIT is not set 1376# CONFIG_USB_PHIDGET is not set
1278# CONFIG_USB_PHIDGETSERVO is not set
1279# CONFIG_USB_IDMOUSE is not set 1377# CONFIG_USB_IDMOUSE is not set
1378# CONFIG_USB_FTDI_ELAN is not set
1280CONFIG_USB_APPLEDISPLAY=m 1379CONFIG_USB_APPLEDISPLAY=m
1281# CONFIG_USB_SISUSBVGA is not set 1380# CONFIG_USB_SISUSBVGA is not set
1282# CONFIG_USB_LD is not set 1381# CONFIG_USB_LD is not set
1382# CONFIG_USB_TRANCEVIBRATOR is not set
1283# CONFIG_USB_TEST is not set 1383# CONFIG_USB_TEST is not set
1284 1384
1285# 1385#
@@ -1318,6 +1418,7 @@ CONFIG_INFINIBAND=m
1318CONFIG_INFINIBAND_ADDR_TRANS=y 1418CONFIG_INFINIBAND_ADDR_TRANS=y
1319CONFIG_INFINIBAND_MTHCA=m 1419CONFIG_INFINIBAND_MTHCA=m
1320CONFIG_INFINIBAND_MTHCA_DEBUG=y 1420CONFIG_INFINIBAND_MTHCA_DEBUG=y
1421# CONFIG_INFINIBAND_AMSO1100 is not set
1321CONFIG_INFINIBAND_IPOIB=m 1422CONFIG_INFINIBAND_IPOIB=m
1322CONFIG_INFINIBAND_IPOIB_DEBUG=y 1423CONFIG_INFINIBAND_IPOIB_DEBUG=y
1323# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set 1424# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
@@ -1347,6 +1448,10 @@ CONFIG_INFINIBAND_ISER=m
1347# 1448#
1348 1449
1349# 1450#
1451# Virtualization
1452#
1453
1454#
1350# File systems 1455# File systems
1351# 1456#
1352CONFIG_EXT2_FS=y 1457CONFIG_EXT2_FS=y
@@ -1359,6 +1464,7 @@ CONFIG_EXT3_FS=y
1359CONFIG_EXT3_FS_XATTR=y 1464CONFIG_EXT3_FS_XATTR=y
1360CONFIG_EXT3_FS_POSIX_ACL=y 1465CONFIG_EXT3_FS_POSIX_ACL=y
1361CONFIG_EXT3_FS_SECURITY=y 1466CONFIG_EXT3_FS_SECURITY=y
1467# CONFIG_EXT4DEV_FS is not set
1362CONFIG_JBD=y 1468CONFIG_JBD=y
1363# CONFIG_JBD_DEBUG is not set 1469# CONFIG_JBD_DEBUG is not set
1364CONFIG_FS_MBCACHE=y 1470CONFIG_FS_MBCACHE=y
@@ -1379,6 +1485,7 @@ CONFIG_XFS_FS=m
1379CONFIG_XFS_SECURITY=y 1485CONFIG_XFS_SECURITY=y
1380CONFIG_XFS_POSIX_ACL=y 1486CONFIG_XFS_POSIX_ACL=y
1381# CONFIG_XFS_RT is not set 1487# CONFIG_XFS_RT is not set
1488# CONFIG_GFS2_FS is not set
1382# CONFIG_OCFS2_FS is not set 1489# CONFIG_OCFS2_FS is not set
1383# CONFIG_MINIX_FS is not set 1490# CONFIG_MINIX_FS is not set
1384# CONFIG_ROMFS_FS is not set 1491# CONFIG_ROMFS_FS is not set
@@ -1414,8 +1521,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1414# 1521#
1415CONFIG_PROC_FS=y 1522CONFIG_PROC_FS=y
1416CONFIG_PROC_KCORE=y 1523CONFIG_PROC_KCORE=y
1524CONFIG_PROC_SYSCTL=y
1417CONFIG_SYSFS=y 1525CONFIG_SYSFS=y
1418CONFIG_TMPFS=y 1526CONFIG_TMPFS=y
1527# CONFIG_TMPFS_POSIX_ACL is not set
1419CONFIG_HUGETLBFS=y 1528CONFIG_HUGETLBFS=y
1420CONFIG_HUGETLB_PAGE=y 1529CONFIG_HUGETLB_PAGE=y
1421CONFIG_RAMFS=y 1530CONFIG_RAMFS=y
@@ -1540,8 +1649,23 @@ CONFIG_NLS_KOI8_U=m
1540CONFIG_NLS_UTF8=m 1649CONFIG_NLS_UTF8=m
1541 1650
1542# 1651#
1652# Distributed Lock Manager
1653#
1654# CONFIG_DLM is not set
1655
1656#
1657# iSeries device drivers
1658#
1659# CONFIG_VIOCONS is not set
1660CONFIG_VIODASD=y
1661CONFIG_VIOCD=m
1662CONFIG_VIOTAPE=m
1663CONFIG_VIOPATH=y
1664
1665#
1543# Library routines 1666# Library routines
1544# 1667#
1668CONFIG_BITREVERSE=y
1545CONFIG_CRC_CCITT=m 1669CONFIG_CRC_CCITT=m
1546# CONFIG_CRC16 is not set 1670# CONFIG_CRC16 is not set
1547CONFIG_CRC32=y 1671CONFIG_CRC32=y
@@ -1551,6 +1675,7 @@ CONFIG_ZLIB_DEFLATE=m
1551CONFIG_TEXTSEARCH=y 1675CONFIG_TEXTSEARCH=y
1552CONFIG_TEXTSEARCH_KMP=m 1676CONFIG_TEXTSEARCH_KMP=m
1553CONFIG_PLIST=y 1677CONFIG_PLIST=y
1678CONFIG_IOMAP_COPY=y
1554 1679
1555# 1680#
1556# Instrumentation Support 1681# Instrumentation Support
@@ -1563,8 +1688,11 @@ CONFIG_OPROFILE=y
1563# Kernel hacking 1688# Kernel hacking
1564# 1689#
1565# CONFIG_PRINTK_TIME is not set 1690# CONFIG_PRINTK_TIME is not set
1691CONFIG_ENABLE_MUST_CHECK=y
1566CONFIG_MAGIC_SYSRQ=y 1692CONFIG_MAGIC_SYSRQ=y
1567# CONFIG_UNUSED_SYMBOLS is not set 1693# CONFIG_UNUSED_SYMBOLS is not set
1694CONFIG_DEBUG_FS=y
1695# CONFIG_HEADERS_CHECK is not set
1568CONFIG_DEBUG_KERNEL=y 1696CONFIG_DEBUG_KERNEL=y
1569CONFIG_LOG_BUF_SHIFT=17 1697CONFIG_LOG_BUF_SHIFT=17
1570CONFIG_DETECT_SOFTLOCKUP=y 1698CONFIG_DETECT_SOFTLOCKUP=y
@@ -1578,16 +1706,19 @@ CONFIG_DEBUG_MUTEXES=y
1578# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1706# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1579# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1707# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1580# CONFIG_DEBUG_KOBJECT is not set 1708# CONFIG_DEBUG_KOBJECT is not set
1709CONFIG_DEBUG_BUGVERBOSE=y
1581# CONFIG_DEBUG_INFO is not set 1710# CONFIG_DEBUG_INFO is not set
1582CONFIG_DEBUG_FS=y
1583# CONFIG_DEBUG_VM is not set 1711# CONFIG_DEBUG_VM is not set
1712# CONFIG_DEBUG_LIST is not set
1584CONFIG_FORCED_INLINING=y 1713CONFIG_FORCED_INLINING=y
1585# CONFIG_RCU_TORTURE_TEST is not set 1714# CONFIG_RCU_TORTURE_TEST is not set
1586CONFIG_DEBUG_STACKOVERFLOW=y 1715CONFIG_DEBUG_STACKOVERFLOW=y
1587CONFIG_DEBUG_STACK_USAGE=y 1716CONFIG_DEBUG_STACK_USAGE=y
1717# CONFIG_HCALL_STATS is not set
1588CONFIG_DEBUGGER=y 1718CONFIG_DEBUGGER=y
1589CONFIG_XMON=y 1719CONFIG_XMON=y
1590# CONFIG_XMON_DEFAULT is not set 1720# CONFIG_XMON_DEFAULT is not set
1721CONFIG_XMON_DISASSEMBLY=y
1591CONFIG_IRQSTACKS=y 1722CONFIG_IRQSTACKS=y
1592CONFIG_BOOTX_TEXT=y 1723CONFIG_BOOTX_TEXT=y
1593# CONFIG_PPC_EARLY_DEBUG is not set 1724# CONFIG_PPC_EARLY_DEBUG is not set
@@ -1602,7 +1733,12 @@ CONFIG_BOOTX_TEXT=y
1602# Cryptographic options 1733# Cryptographic options
1603# 1734#
1604CONFIG_CRYPTO=y 1735CONFIG_CRYPTO=y
1736CONFIG_CRYPTO_ALGAPI=y
1737CONFIG_CRYPTO_BLKCIPHER=y
1738CONFIG_CRYPTO_HASH=y
1739CONFIG_CRYPTO_MANAGER=y
1605CONFIG_CRYPTO_HMAC=y 1740CONFIG_CRYPTO_HMAC=y
1741# CONFIG_CRYPTO_XCBC is not set
1606CONFIG_CRYPTO_NULL=m 1742CONFIG_CRYPTO_NULL=m
1607CONFIG_CRYPTO_MD4=m 1743CONFIG_CRYPTO_MD4=m
1608CONFIG_CRYPTO_MD5=y 1744CONFIG_CRYPTO_MD5=y
@@ -1611,9 +1747,14 @@ CONFIG_CRYPTO_SHA256=m
1611CONFIG_CRYPTO_SHA512=m 1747CONFIG_CRYPTO_SHA512=m
1612CONFIG_CRYPTO_WP512=m 1748CONFIG_CRYPTO_WP512=m
1613CONFIG_CRYPTO_TGR192=m 1749CONFIG_CRYPTO_TGR192=m
1750# CONFIG_CRYPTO_GF128MUL is not set
1751CONFIG_CRYPTO_ECB=m
1752CONFIG_CRYPTO_CBC=y
1753# CONFIG_CRYPTO_LRW is not set
1614CONFIG_CRYPTO_DES=y 1754CONFIG_CRYPTO_DES=y
1615CONFIG_CRYPTO_BLOWFISH=m 1755CONFIG_CRYPTO_BLOWFISH=m
1616CONFIG_CRYPTO_TWOFISH=m 1756CONFIG_CRYPTO_TWOFISH=m
1757CONFIG_CRYPTO_TWOFISH_COMMON=m
1617CONFIG_CRYPTO_SERPENT=m 1758CONFIG_CRYPTO_SERPENT=m
1618CONFIG_CRYPTO_AES=m 1759CONFIG_CRYPTO_AES=m
1619CONFIG_CRYPTO_CAST5=m 1760CONFIG_CRYPTO_CAST5=m
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e96521530d21..030d300cd71c 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -303,5 +303,8 @@ int main(void)
303 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); 303 DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
304 DEFINE(CLOCK_REALTIME_RES, TICK_NSEC); 304 DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);
305 305
306#ifdef CONFIG_BUG
307 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
308#endif
306 return 0; 309 return 0;
307} 310}
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 1a3d4de197d2..2551c0884afc 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -28,6 +28,7 @@
28#include <asm/asm-offsets.h> 28#include <asm/asm-offsets.h>
29#include <asm/cputable.h> 29#include <asm/cputable.h>
30#include <asm/firmware.h> 30#include <asm/firmware.h>
31#include <asm/bug.h>
31 32
32/* 33/*
33 * System calls. 34 * System calls.
@@ -634,19 +635,15 @@ _GLOBAL(enter_rtas)
634 li r0,0 635 li r0,0
635 mtcr r0 636 mtcr r0
636 637
638#ifdef CONFIG_BUG
637 /* There is no way it is acceptable to get here with interrupts enabled, 639 /* There is no way it is acceptable to get here with interrupts enabled,
638 * check it with the asm equivalent of WARN_ON 640 * check it with the asm equivalent of WARN_ON
639 */ 641 */
640 lbz r0,PACASOFTIRQEN(r13) 642 lbz r0,PACASOFTIRQEN(r13)
6411: tdnei r0,0 6431: tdnei r0,0
642.section __bug_table,"a" 644 EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING
643 .llong 1b,__LINE__ + 0x1000000, 1f, 2f 645#endif
644.previous 646
645.section .rodata,"a"
6461: .asciz __FILE__
6472: .asciz "enter_rtas"
648.previous
649
650 /* Hard-disable interrupts */ 647 /* Hard-disable interrupts */
651 mfmsr r6 648 mfmsr r6
652 rldicl r7,r6,48,1 649 rldicl r7,r6,48,1
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9b28c238b6c0..0e8beca460af 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -468,7 +468,7 @@ static int __devinit cpu_enable(unsigned int cpu)
468 return -ENOSYS; 468 return -ENOSYS;
469} 469}
470 470
471int __devinit __cpu_up(unsigned int cpu) 471int __cpuinit __cpu_up(unsigned int cpu)
472{ 472{
473 int c; 473 int c;
474 474
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 89c836d54809..1bb20d841080 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -744,7 +744,8 @@ static int htlb_check_hinted_area(unsigned long addr, unsigned long len)
744 struct vm_area_struct *vma; 744 struct vm_area_struct *vma;
745 745
746 vma = find_vma(current->mm, addr); 746 vma = find_vma(current->mm, addr);
747 if (!vma || ((addr + len) <= vma->vm_start)) 747 if (TASK_SIZE - len >= addr &&
748 (!vma || ((addr + len) <= vma->vm_start)))
748 return 0; 749 return 0;
749 750
750 return -ENOMEM; 751 return -ENOMEM;
@@ -815,6 +816,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
815 return -EINVAL; 816 return -EINVAL;
816 if (len & ~HPAGE_MASK) 817 if (len & ~HPAGE_MASK)
817 return -EINVAL; 818 return -EINVAL;
819 if (len > TASK_SIZE)
820 return -ENOMEM;
818 821
819 if (!cpu_has_feature(CPU_FTR_16M_PAGE)) 822 if (!cpu_has_feature(CPU_FTR_16M_PAGE))
820 return -EINVAL; 823 return -EINVAL;
@@ -823,9 +826,6 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
823 BUG_ON((addr + len) < addr); 826 BUG_ON((addr + len) < addr);
824 827
825 if (test_thread_flag(TIF_32BIT)) { 828 if (test_thread_flag(TIF_32BIT)) {
826 /* Paranoia, caller should have dealt with this */
827 BUG_ON((addr + len) > 0x100000000UL);
828
829 curareas = current->mm->context.low_htlb_areas; 829 curareas = current->mm->context.low_htlb_areas;
830 830
831 /* First see if we can use the hint address */ 831 /* First see if we can use the hint address */
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index eaff71e74fb0..0f21bab33f6c 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -153,6 +153,7 @@ define_machine(lite52xx) {
153 .name = "lite52xx", 153 .name = "lite52xx",
154 .probe = lite52xx_probe, 154 .probe = lite52xx_probe,
155 .setup_arch = lite52xx_setup_arch, 155 .setup_arch = lite52xx_setup_arch,
156 .init = mpc52xx_declare_of_platform_devices,
156 .init_IRQ = mpc52xx_init_irq, 157 .init_IRQ = mpc52xx_init_irq,
157 .get_irq = mpc52xx_get_irq, 158 .get_irq = mpc52xx_get_irq,
158 .show_cpuinfo = lite52xx_show_cpuinfo, 159 .show_cpuinfo = lite52xx_show_cpuinfo,
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 8331ff457770..cc40889074bd 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -116,11 +116,12 @@ unmap_regs:
116 if (xlb) iounmap(xlb); 116 if (xlb) iounmap(xlb);
117} 117}
118 118
119static int __init 119void __init
120mpc52xx_declare_of_platform_devices(void) 120mpc52xx_declare_of_platform_devices(void)
121{ 121{
122 /* Find every child of the SOC node and add it to of_platform */ 122 /* Find every child of the SOC node and add it to of_platform */
123 return of_platform_bus_probe(NULL, NULL, NULL); 123 if (of_platform_bus_probe(NULL, NULL, NULL))
124 printk(KERN_ERR __FILE__ ": "
125 "Error while probing of_platform bus\n");
124} 126}
125 127
126device_initcall(mpc52xx_declare_of_platform_devices);
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index e3e929e1b460..c1f4502a3c6a 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -17,6 +17,7 @@
17 17
18#include <asm/system.h> 18#include <asm/system.h>
19#include <asm/paca.h> 19#include <asm/paca.h>
20#include <asm/firmware.h>
20#include <asm/iseries/it_lp_queue.h> 21#include <asm/iseries/it_lp_queue.h>
21#include <asm/iseries/hv_lp_event.h> 22#include <asm/iseries/hv_lp_event.h>
22#include <asm/iseries/hv_call_event.h> 23#include <asm/iseries/hv_call_event.h>
@@ -318,6 +319,9 @@ static int __init proc_lpevents_init(void)
318{ 319{
319 struct proc_dir_entry *e; 320 struct proc_dir_entry *e;
320 321
322 if (!firmware_has_feature(FW_FEATURE_ISERIES))
323 return 0;
324
321 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL); 325 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
322 if (e) 326 if (e)
323 e->proc_fops = &proc_lpevents_operations; 327 e->proc_fops = &proc_lpevents_operations;
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index cff15ae24f6b..1ad0e4aaad1a 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -38,6 +38,7 @@
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/abs_addr.h> 40#include <asm/abs_addr.h>
41#include <asm/firmware.h>
41#include <asm/iseries/vio.h> 42#include <asm/iseries/vio.h>
42#include <asm/iseries/mf.h> 43#include <asm/iseries/mf.h>
43#include <asm/iseries/hv_lp_config.h> 44#include <asm/iseries/hv_lp_config.h>
@@ -1235,6 +1236,9 @@ static int __init mf_proc_init(void)
1235 char name[2]; 1236 char name[2];
1236 int i; 1237 int i;
1237 1238
1239 if (!firmware_has_feature(FW_FEATURE_ISERIES))
1240 return 0;
1241
1238 mf_proc_root = proc_mkdir("iSeries/mf", NULL); 1242 mf_proc_root = proc_mkdir("iSeries/mf", NULL);
1239 if (!mf_proc_root) 1243 if (!mf_proc_root)
1240 return 1; 1244 return 1;
diff --git a/arch/powerpc/platforms/iseries/proc.c b/arch/powerpc/platforms/iseries/proc.c
index c241413629ac..b54e37101e69 100644
--- a/arch/powerpc/platforms/iseries/proc.c
+++ b/arch/powerpc/platforms/iseries/proc.c
@@ -24,6 +24,7 @@
24#include <asm/processor.h> 24#include <asm/processor.h>
25#include <asm/time.h> 25#include <asm/time.h>
26#include <asm/lppaca.h> 26#include <asm/lppaca.h>
27#include <asm/firmware.h>
27#include <asm/iseries/hv_call_xm.h> 28#include <asm/iseries/hv_call_xm.h>
28 29
29#include "processor_vpd.h" 30#include "processor_vpd.h"
@@ -31,7 +32,12 @@
31 32
32static int __init iseries_proc_create(void) 33static int __init iseries_proc_create(void)
33{ 34{
34 struct proc_dir_entry *e = proc_mkdir("iSeries", 0); 35 struct proc_dir_entry *e;
36
37 if (!firmware_has_feature(FW_FEATURE_ISERIES))
38 return 0;
39
40 e = proc_mkdir("iSeries", 0);
35 if (!e) 41 if (!e)
36 return 1; 42 return 1;
37 43
@@ -106,6 +112,9 @@ static int __init iseries_proc_init(void)
106{ 112{
107 struct proc_dir_entry *e; 113 struct proc_dir_entry *e;
108 114
115 if (!firmware_has_feature(FW_FEATURE_ISERIES))
116 return 0;
117
109 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL); 118 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL);
110 if (e) 119 if (e)
111 e->proc_fops = &proc_titantod_operations; 120 e->proc_fops = &proc_titantod_operations;
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index bdf2afbb60c1..cce7e309340c 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -527,7 +527,8 @@ static void __init iSeries_fixup_klimit(void)
527static int __init iSeries_src_init(void) 527static int __init iSeries_src_init(void)
528{ 528{
529 /* clear the progress line */ 529 /* clear the progress line */
530 ppc_md.progress(" ", 0xffff); 530 if (firmware_has_feature(FW_FEATURE_ISERIES))
531 ppc_md.progress(" ", 0xffff);
531 return 0; 532 return 0;
532} 533}
533 534
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 84e7ee2c086f..a6799ed34a66 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -42,6 +42,7 @@
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/prom.h> 44#include <asm/prom.h>
45#include <asm/firmware.h>
45#include <asm/iseries/hv_types.h> 46#include <asm/iseries/hv_types.h>
46#include <asm/iseries/hv_lp_event.h> 47#include <asm/iseries/hv_lp_event.h>
47#include <asm/iseries/hv_lp_config.h> 48#include <asm/iseries/hv_lp_config.h>
@@ -183,6 +184,9 @@ static int __init vio_proc_init(void)
183{ 184{
184 struct proc_dir_entry *e; 185 struct proc_dir_entry *e;
185 186
187 if (!firmware_has_feature(FW_FEATURE_ISERIES))
188 return 0;
189
186 e = create_proc_entry("iSeries/config", 0, NULL); 190 e = create_proc_entry("iSeries/config", 0, NULL);
187 if (e) 191 if (e)
188 e->proc_fops = &proc_viopath_operations; 192 e->proc_fops = &proc_viopath_operations;
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index f12d5c69e74d..50855d4fd5a0 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -254,7 +254,6 @@ static void __init maple_init_IRQ(void)
254 printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n", 254 printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n",
255 openpic_addr, has_isus); 255 openpic_addr, has_isus);
256 } 256 }
257 of_node_put(root);
258 257
259 BUG_ON(openpic_addr == 0); 258 BUG_ON(openpic_addr == 0);
260 259
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 89d6e295dbf7..bea7d1bb1a3b 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -129,7 +129,6 @@ static __init void pas_init_IRQ(void)
129 } 129 }
130 openpic_addr = of_read_number(opprop, naddr); 130 openpic_addr = of_read_number(opprop, naddr);
131 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); 131 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
132 of_node_put(root);
133 132
134 mpic = mpic_alloc(mpic_node, openpic_addr, MPIC_PRIMARY, 0, 0, 133 mpic = mpic_alloc(mpic_node, openpic_addr, MPIC_PRIMARY, 0, 0,
135 " PAS-OPIC "); 134 " PAS-OPIC ");
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index c00cfed7af2c..5c7e38789897 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -26,7 +26,7 @@
26BEGIN_FTR_SECTION; \ 26BEGIN_FTR_SECTION; \
27 mfspr r0,SPRN_PURR; /* get PURR and */ \ 27 mfspr r0,SPRN_PURR; /* get PURR and */ \
28 std r0,STK_PARM(r6)(r1); /* save for later */ \ 28 std r0,STK_PARM(r6)(r1); /* save for later */ \
29END_FTR_SECTION_IFCLR(CPU_FTR_PURR); 29END_FTR_SECTION_IFSET(CPU_FTR_PURR);
30 30
31/* 31/*
32 * postcall is performed immediately before function return which 32 * postcall is performed immediately before function return which
@@ -43,7 +43,7 @@ BEGIN_FTR_SECTION; \
43 mfspr r8,SPRN_PURR; /* PURR after */ \ 43 mfspr r8,SPRN_PURR; /* PURR after */ \
44 ld r6,STK_PARM(r6)(r1); /* PURR before */ \ 44 ld r6,STK_PARM(r6)(r1); /* PURR before */ \
45 subf r6,r6,r8; /* delta */ \ 45 subf r6,r6,r8; /* delta */ \
46END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 46END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
47 ld r5,STK_PARM(r5)(r1); /* timebase before */ \ 47 ld r5,STK_PARM(r5)(r1); /* timebase before */ \
48 subf r5,r5,r7; /* time delta */ \ 48 subf r5,r5,r7; /* time delta */ \
49 \ 49 \
@@ -66,7 +66,7 @@ BEGIN_FTR_SECTION; \
66 ld r7,HCALL_STAT_PURR(r4); /* PURR */ \ 66 ld r7,HCALL_STAT_PURR(r4); /* PURR */ \
67 add r7,r7,r6; \ 67 add r7,r7,r6; \
68 std r7,HCALL_STAT_PURR(r4); \ 68 std r7,HCALL_STAT_PURR(r4); \
69END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 69END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
701: 701:
71#else 71#else
72#define HCALL_INST_PRECALL 72#define HCALL_INST_PRECALL
@@ -145,6 +145,7 @@ _GLOBAL(plpar_hcall9)
145 145
146 HVSC /* invoke the hypervisor */ 146 HVSC /* invoke the hypervisor */
147 147
148 mr r0,r12
148 ld r12,STK_PARM(r4)(r1) 149 ld r12,STK_PARM(r4)(r1)
149 std r4, 0(r12) 150 std r4, 0(r12)
150 std r5, 8(r12) 151 std r5, 8(r12)
@@ -154,7 +155,7 @@ _GLOBAL(plpar_hcall9)
154 std r9, 40(r12) 155 std r9, 40(r12)
155 std r10,48(r12) 156 std r10,48(r12)
156 std r11,56(r12) 157 std r11,56(r12)
157 std r12,64(r12) 158 std r0, 64(r12)
158 159
159 HCALL_INST_POSTCALL 160 HCALL_INST_POSTCALL
160 161
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 80181c4c49eb..3ddc04925d50 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -34,7 +34,7 @@ DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats);
34 */ 34 */
35static void *hc_start(struct seq_file *m, loff_t *pos) 35static void *hc_start(struct seq_file *m, loff_t *pos)
36{ 36{
37 if ((int)*pos < HCALL_STAT_ARRAY_SIZE) 37 if ((int)*pos < (HCALL_STAT_ARRAY_SIZE-1))
38 return (void *)(unsigned long)(*pos + 1); 38 return (void *)(unsigned long)(*pos + 1);
39 39
40 return NULL; 40 return NULL;
@@ -57,7 +57,7 @@ static int hc_show(struct seq_file *m, void *p)
57 struct hcall_stats *hs = (struct hcall_stats *)m->private; 57 struct hcall_stats *hs = (struct hcall_stats *)m->private;
58 58
59 if (hs[h_num].num_calls) { 59 if (hs[h_num].num_calls) {
60 if (!cpu_has_feature(CPU_FTR_PURR)) 60 if (cpu_has_feature(CPU_FTR_PURR))
61 seq_printf(m, "%lu %lu %lu %lu\n", h_num<<2, 61 seq_printf(m, "%lu %lu %lu %lu\n", h_num<<2,
62 hs[h_num].num_calls, 62 hs[h_num].num_calls,
63 hs[h_num].tb_total, 63 hs[h_num].tb_total,
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index b5b2b1103de8..81d172d65038 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -224,7 +224,6 @@ static void xics_unmask_irq(unsigned int virq)
224static void xics_mask_real_irq(unsigned int irq) 224static void xics_mask_real_irq(unsigned int irq)
225{ 225{
226 int call_status; 226 int call_status;
227 unsigned int server;
228 227
229 if (irq == XICS_IPI) 228 if (irq == XICS_IPI)
230 return; 229 return;
@@ -236,9 +235,9 @@ static void xics_mask_real_irq(unsigned int irq)
236 return; 235 return;
237 } 236 }
238 237
239 server = get_irq_server(irq);
240 /* Have to set XIVE to 0xff to be able to remove a slot */ 238 /* Have to set XIVE to 0xff to be able to remove a slot */
241 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff); 239 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq,
240 default_server, 0xff);
242 if (call_status != 0) { 241 if (call_status != 0) {
243 printk(KERN_ERR "xics_disable_irq: irq=%u: ibm_set_xive(0xff)" 242 printk(KERN_ERR "xics_disable_irq: irq=%u: ibm_set_xive(0xff)"
244 " returned %d\n", irq, call_status); 243 " returned %d\n", irq, call_status);
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 04d4917eb303..2621a7e72d2d 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_MMIO_NVRAM) += mmio_nvram.o
12obj-$(CONFIG_FSL_SOC) += fsl_soc.o 12obj-$(CONFIG_FSL_SOC) += fsl_soc.o
13obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 13obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
14obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ 14obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
15obj-$(CONFIG_MTD) += rom.o
16 15
17ifeq ($(CONFIG_PPC_MERGE),y) 16ifeq ($(CONFIG_PPC_MERGE),y)
18obj-$(CONFIG_PPC_I8259) += i8259.o 17obj-$(CONFIG_PPC_I8259) += i8259.o
@@ -21,5 +20,6 @@ endif
21 20
22# Temporary hack until we have migrated to asm-powerpc 21# Temporary hack until we have migrated to asm-powerpc
23ifeq ($(ARCH),powerpc) 22ifeq ($(ARCH),powerpc)
23obj-$(CONFIG_MTD) += rom.o
24obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 24obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
25endif 25endif
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index 4388b3309e0c..eca507050e47 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -164,11 +164,14 @@ startup_continue:
164 srl %r7,28 164 srl %r7,28
165 clr %r6,%r7 # compare cc with last access code 165 clr %r6,%r7 # compare cc with last access code
166 be .Lsame-.LPG1(%r13) 166 be .Lsame-.LPG1(%r13)
167 b .Lchkmem-.LPG1(%r13) 167 lhi %r8,0 # no program checks
168 b .Lsavchk-.LPG1(%r13)
168.Lsame: 169.Lsame:
169 ar %r5,%r1 # add 128KB to end of chunk 170 ar %r5,%r1 # add 128KB to end of chunk
170 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop 171 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
171.Lchkmem: # > 2GB or tprot got a program check 172.Lchkmem: # > 2GB or tprot got a program check
173 lhi %r8,1 # set program check flag
174.Lsavchk:
172 clr %r4,%r5 # chunk size > 0? 175 clr %r4,%r5 # chunk size > 0?
173 be .Lchkloop-.LPG1(%r13) 176 be .Lchkloop-.LPG1(%r13)
174 st %r4,0(%r3) # store start address of chunk 177 st %r4,0(%r3) # store start address of chunk
@@ -190,8 +193,15 @@ startup_continue:
190 je .Ldonemem # if not, leave 193 je .Ldonemem # if not, leave
191 chi %r10,0 # do we have chunks left? 194 chi %r10,0 # do we have chunks left?
192 je .Ldonemem 195 je .Ldonemem
196 chi %r8,1 # program check ?
197 je .Lpgmchk
198 lr %r4,%r5 # potential new chunk
199 alr %r5,%r1 # add 128KB to end of chunk
200 j .Llpcnt
201.Lpgmchk:
193 alr %r5,%r1 # add 128KB to end of chunk 202 alr %r5,%r1 # add 128KB to end of chunk
194 lr %r4,%r5 # potential new chunk 203 lr %r4,%r5 # potential new chunk
204.Llpcnt:
195 clr %r5,%r9 # should we go on? 205 clr %r5,%r9 # should we go on?
196 jl .Lloop 206 jl .Lloop
197.Ldonemem: 207.Ldonemem:
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index c526279e1123..6ba3f4512dd1 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -172,12 +172,15 @@ startup_continue:
172 srl %r7,28 172 srl %r7,28
173 clr %r6,%r7 # compare cc with last access code 173 clr %r6,%r7 # compare cc with last access code
174 je .Lsame 174 je .Lsame
175 j .Lchkmem 175 lghi %r8,0 # no program checks
176 j .Lsavchk
176.Lsame: 177.Lsame:
177 algr %r5,%r1 # add 128KB to end of chunk 178 algr %r5,%r1 # add 128KB to end of chunk
178 # no need to check here, 179 # no need to check here,
179 brc 12,.Lloop # this is the same chunk 180 brc 12,.Lloop # this is the same chunk
180.Lchkmem: # > 16EB or tprot got a program check 181.Lchkmem: # > 16EB or tprot got a program check
182 lghi %r8,1 # set program check flag
183.Lsavchk:
181 clgr %r4,%r5 # chunk size > 0? 184 clgr %r4,%r5 # chunk size > 0?
182 je .Lchkloop 185 je .Lchkloop
183 stg %r4,0(%r3) # store start address of chunk 186 stg %r4,0(%r3) # store start address of chunk
@@ -204,8 +207,15 @@ startup_continue:
204 chi %r10, 0 # do we have chunks left? 207 chi %r10, 0 # do we have chunks left?
205 je .Ldonemem 208 je .Ldonemem
206.Lhsaskip: 209.Lhsaskip:
210 chi %r8,1 # program check ?
211 je .Lpgmchk
212 lgr %r4,%r5 # potential new chunk
213 algr %r5,%r1 # add 128KB to end of chunk
214 j .Llpcnt
215.Lpgmchk:
207 algr %r5,%r1 # add 128KB to end of chunk 216 algr %r5,%r1 # add 128KB to end of chunk
208 lgr %r4,%r5 # potential new chunk 217 lgr %r4,%r5 # potential new chunk
218.Llpcnt:
209 clgr %r5,%r9 # should we go on? 219 clgr %r5,%r9 # should we go on?
210 jl .Lloop 220 jl .Lloop
211.Ldonemem: 221.Ldonemem:
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 49ef206ec880..5d8ee3baac14 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -476,7 +476,7 @@ static void __init setup_memory_end(void)
476 int i; 476 int i;
477 477
478 memory_size = real_size = 0; 478 memory_size = real_size = 0;
479 max_phys = VMALLOC_END - VMALLOC_MIN_SIZE; 479 max_phys = VMALLOC_END_INIT - VMALLOC_MIN_SIZE;
480 memory_end &= PAGE_MASK; 480 memory_end &= PAGE_MASK;
481 481
482 max_mem = memory_end ? min(max_phys, memory_end) : max_phys; 482 max_mem = memory_end ? min(max_phys, memory_end) : max_phys;
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 19090f7d4f51..c0cd255fddbd 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -794,7 +794,10 @@ static int __init topology_init(void)
794 int ret; 794 int ret;
795 795
796 for_each_possible_cpu(cpu) { 796 for_each_possible_cpu(cpu) {
797 ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu); 797 struct cpu *c = &per_cpu(cpu_devices, cpu);
798
799 c->hotpluggable = 1;
800 ret = register_cpu(c, cpu);
798 if (ret) 801 if (ret)
799 printk(KERN_WARNING "topology_init: register_cpu %d " 802 printk(KERN_WARNING "topology_init: register_cpu %d "
800 "failed (%d)\n", cpu, ret); 803 "failed (%d)\n", cpu, ret);
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index 633249c3ba91..49c3e46b4065 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/hardirq.h>
11#include <linux/mm.h> 12#include <linux/mm.h>
12#include <asm/uaccess.h> 13#include <asm/uaccess.h>
13#include <asm/futex.h> 14#include <asm/futex.h>
@@ -18,6 +19,8 @@ static inline int __handle_fault(struct mm_struct *mm, unsigned long address,
18 struct vm_area_struct *vma; 19 struct vm_area_struct *vma;
19 int ret = -EFAULT; 20 int ret = -EFAULT;
20 21
22 if (in_atomic())
23 return ret;
21 down_read(&mm->mmap_sem); 24 down_read(&mm->mmap_sem);
22 vma = find_vma(mm, address); 25 vma = find_vma(mm, address);
23 if (unlikely(!vma)) 26 if (unlikely(!vma))
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c
index bbaca66fa293..56a0214e9928 100644
--- a/arch/s390/lib/uaccess_std.c
+++ b/arch/s390/lib/uaccess_std.c
@@ -258,8 +258,6 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old)
258{ 258{
259 int oldval = 0, newval, ret; 259 int oldval = 0, newval, ret;
260 260
261 pagefault_disable();
262
263 switch (op) { 261 switch (op) {
264 case FUTEX_OP_SET: 262 case FUTEX_OP_SET:
265 __futex_atomic_op("lr %2,%5\n", 263 __futex_atomic_op("lr %2,%5\n",
@@ -284,7 +282,6 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old)
284 default: 282 default:
285 ret = -ENOSYS; 283 ret = -ENOSYS;
286 } 284 }
287 pagefault_enable();
288 *old = oldval; 285 *old = oldval;
289 return ret; 286 return ret;
290} 287}
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 7f2944d3ec2a..cd3d93e8c211 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -61,7 +61,8 @@ void memmap_init(unsigned long size, int nid, unsigned long zone,
61 61
62 if (map_start < map_end) 62 if (map_start < map_end)
63 memmap_init_zone((unsigned long)(map_end - map_start), 63 memmap_init_zone((unsigned long)(map_end - map_start),
64 nid, zone, page_to_pfn(map_start)); 64 nid, zone, page_to_pfn(map_start),
65 MEMMAP_EARLY);
65 } 66 }
66} 67}
67 68
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 0a4958536bcd..fc99f7b8012f 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1388,7 +1388,7 @@ void __devinit smp_prepare_boot_cpu(void)
1388{ 1388{
1389} 1389}
1390 1390
1391int __devinit __cpu_up(unsigned int cpu) 1391int __cpuinit __cpu_up(unsigned int cpu)
1392{ 1392{
1393 int ret = smp_boot_one_cpu(cpu); 1393 int ret = smp_boot_one_cpu(cpu);
1394 1394
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 9cc7c21547a2..69584c295305 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.19-git14 3# Linux kernel version: 2.6.20-rc3
4# Sat Dec 9 21:23:09 2006 4# Fri Jan 5 11:54:41 2007
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -1056,6 +1056,7 @@ CONFIG_HWMON=y
1056# CONFIG_SENSORS_LM92 is not set 1056# CONFIG_SENSORS_LM92 is not set
1057# CONFIG_SENSORS_MAX1619 is not set 1057# CONFIG_SENSORS_MAX1619 is not set
1058# CONFIG_SENSORS_PC87360 is not set 1058# CONFIG_SENSORS_PC87360 is not set
1059# CONFIG_SENSORS_PC87427 is not set
1059# CONFIG_SENSORS_SIS5595 is not set 1060# CONFIG_SENSORS_SIS5595 is not set
1060# CONFIG_SENSORS_SMSC47M1 is not set 1061# CONFIG_SENSORS_SMSC47M1 is not set
1061# CONFIG_SENSORS_SMSC47M192 is not set 1062# CONFIG_SENSORS_SMSC47M192 is not set
@@ -1066,6 +1067,7 @@ CONFIG_SENSORS_SMSC47B397=m
1066# CONFIG_SENSORS_W83781D is not set 1067# CONFIG_SENSORS_W83781D is not set
1067# CONFIG_SENSORS_W83791D is not set 1068# CONFIG_SENSORS_W83791D is not set
1068# CONFIG_SENSORS_W83792D is not set 1069# CONFIG_SENSORS_W83792D is not set
1070# CONFIG_SENSORS_W83793 is not set
1069# CONFIG_SENSORS_W83L785TS is not set 1071# CONFIG_SENSORS_W83L785TS is not set
1070# CONFIG_SENSORS_W83627HF is not set 1072# CONFIG_SENSORS_W83627HF is not set
1071# CONFIG_SENSORS_W83627EHF is not set 1073# CONFIG_SENSORS_W83627EHF is not set
@@ -1311,6 +1313,11 @@ CONFIG_USB_MON=y
1311# 1313#
1312 1314
1313# 1315#
1316# Virtualization
1317#
1318# CONFIG_KVM is not set
1319
1320#
1314# Firmware Drivers 1321# Firmware Drivers
1315# 1322#
1316# CONFIG_EDD is not set 1323# CONFIG_EDD is not set
@@ -1502,6 +1509,8 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1502# CONFIG_ENABLE_MUST_CHECK is not set 1509# CONFIG_ENABLE_MUST_CHECK is not set
1503CONFIG_MAGIC_SYSRQ=y 1510CONFIG_MAGIC_SYSRQ=y
1504CONFIG_UNUSED_SYMBOLS=y 1511CONFIG_UNUSED_SYMBOLS=y
1512CONFIG_DEBUG_FS=y
1513# CONFIG_HEADERS_CHECK is not set
1505CONFIG_DEBUG_KERNEL=y 1514CONFIG_DEBUG_KERNEL=y
1506CONFIG_LOG_BUF_SHIFT=18 1515CONFIG_LOG_BUF_SHIFT=18
1507CONFIG_DETECT_SOFTLOCKUP=y 1516CONFIG_DETECT_SOFTLOCKUP=y
@@ -1519,12 +1528,10 @@ CONFIG_DETECT_SOFTLOCKUP=y
1519# CONFIG_DEBUG_KOBJECT is not set 1528# CONFIG_DEBUG_KOBJECT is not set
1520CONFIG_DEBUG_BUGVERBOSE=y 1529CONFIG_DEBUG_BUGVERBOSE=y
1521# CONFIG_DEBUG_INFO is not set 1530# CONFIG_DEBUG_INFO is not set
1522CONFIG_DEBUG_FS=y
1523# CONFIG_DEBUG_VM is not set 1531# CONFIG_DEBUG_VM is not set
1524# CONFIG_DEBUG_LIST is not set 1532# CONFIG_DEBUG_LIST is not set
1525# CONFIG_FRAME_POINTER is not set 1533# CONFIG_FRAME_POINTER is not set
1526# CONFIG_FORCED_INLINING is not set 1534# CONFIG_FORCED_INLINING is not set
1527# CONFIG_HEADERS_CHECK is not set
1528# CONFIG_RCU_TORTURE_TEST is not set 1535# CONFIG_RCU_TORTURE_TEST is not set
1529# CONFIG_LKDTM is not set 1536# CONFIG_LKDTM is not set
1530# CONFIG_DEBUG_RODATA is not set 1537# CONFIG_DEBUG_RODATA is not set
@@ -1553,3 +1560,4 @@ CONFIG_CRC32=y
1553# CONFIG_LIBCRC32C is not set 1560# CONFIG_LIBCRC32C is not set
1554CONFIG_ZLIB_INFLATE=y 1561CONFIG_ZLIB_INFLATE=y
1555CONFIG_PLIST=y 1562CONFIG_PLIST=y
1563CONFIG_IOMAP_COPY=y
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index be87df506f39..fe83edb93c10 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -241,7 +241,7 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
241 get_user(c,p++); 241 get_user(c,p++);
242 } while (c); 242 } while (c);
243 } 243 }
244 put_user(NULL,argv); 244 put_user(0, argv);
245 current->mm->arg_end = current->mm->env_start = (unsigned long) p; 245 current->mm->arg_end = current->mm->env_start = (unsigned long) p;
246 while (envc-->0) { 246 while (envc-->0) {
247 char c; 247 char c;
@@ -250,7 +250,7 @@ static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
250 get_user(c,p++); 250 get_user(c,p++);
251 } while (c); 251 } while (c);
252 } 252 }
253 put_user(NULL,envp); 253 put_user(0, envp);
254 current->mm->env_end = (unsigned long) p; 254 current->mm->env_end = (unsigned long) p;
255 return sp; 255 return sp;
256} 256}
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c
index 829698f6d049..49802f1bee94 100644
--- a/arch/x86_64/kernel/early-quirks.c
+++ b/arch/x86_64/kernel/early-quirks.c
@@ -69,6 +69,11 @@ static void nvidia_bugs(void)
69 69
70static void ati_bugs(void) 70static void ati_bugs(void)
71{ 71{
72 if (timer_over_8254 == 1) {
73 timer_over_8254 = 0;
74 printk(KERN_INFO
75 "ATI board detected. Disabling timer routing over 8254.\n");
76 }
72} 77}
73 78
74static void intel_bugs(void) 79static void intel_bugs(void)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 2a1dcd5f69c2..d7bad90a5ad8 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -55,6 +55,10 @@ int sis_apic_bug; /* not actually supported, dummy for compile */
55 55
56static int no_timer_check; 56static int no_timer_check;
57 57
58static int disable_timer_pin_1 __initdata;
59
60int timer_over_8254 __initdata = 1;
61
58/* Where if anywhere is the i8259 connect in external int mode */ 62/* Where if anywhere is the i8259 connect in external int mode */
59static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; 63static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
60 64
@@ -350,6 +354,29 @@ static int __init disable_ioapic_setup(char *str)
350} 354}
351early_param("noapic", disable_ioapic_setup); 355early_param("noapic", disable_ioapic_setup);
352 356
357/* Actually the next is obsolete, but keep it for paranoid reasons -AK */
358static int __init disable_timer_pin_setup(char *arg)
359{
360 disable_timer_pin_1 = 1;
361 return 1;
362}
363__setup("disable_timer_pin_1", disable_timer_pin_setup);
364
365static int __init setup_disable_8254_timer(char *s)
366{
367 timer_over_8254 = -1;
368 return 1;
369}
370static int __init setup_enable_8254_timer(char *s)
371{
372 timer_over_8254 = 2;
373 return 1;
374}
375
376__setup("disable_8254_timer", setup_disable_8254_timer);
377__setup("enable_8254_timer", setup_enable_8254_timer);
378
379
353/* 380/*
354 * Find the IRQ entry number of a certain pin. 381 * Find the IRQ entry number of a certain pin.
355 */ 382 */
@@ -1568,33 +1595,10 @@ static inline void unlock_ExtINT_logic(void)
1568 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ 1595 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ
1569 * is so screwy. Thanks to Brian Perkins for testing/hacking this beast 1596 * is so screwy. Thanks to Brian Perkins for testing/hacking this beast
1570 * fanatically on his truly buggy board. 1597 * fanatically on his truly buggy board.
1598 *
1599 * FIXME: really need to revamp this for modern platforms only.
1571 */ 1600 */
1572 1601static inline void check_timer(void)
1573static int try_apic_pin(int apic, int pin, char *msg)
1574{
1575 apic_printk(APIC_VERBOSE, KERN_INFO
1576 "..TIMER: trying IO-APIC=%d PIN=%d %s",
1577 apic, pin, msg);
1578
1579 /*
1580 * Ok, does IRQ0 through the IOAPIC work?
1581 */
1582 if (!no_timer_check && timer_irq_works()) {
1583 nmi_watchdog_default();
1584 if (nmi_watchdog == NMI_IO_APIC) {
1585 disable_8259A_irq(0);
1586 setup_nmi();
1587 enable_8259A_irq(0);
1588 }
1589 return 1;
1590 }
1591 clear_IO_APIC_pin(apic, pin);
1592 apic_printk(APIC_QUIET, KERN_ERR " .. failed\n");
1593 return 0;
1594}
1595
1596/* The function from hell */
1597static void check_timer(void)
1598{ 1602{
1599 int apic1, pin1, apic2, pin2; 1603 int apic1, pin1, apic2, pin2;
1600 int vector; 1604 int vector;
@@ -1615,43 +1619,61 @@ static void check_timer(void)
1615 */ 1619 */
1616 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 1620 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
1617 init_8259A(1); 1621 init_8259A(1);
1622 if (timer_over_8254 > 0)
1623 enable_8259A_irq(0);
1618 1624
1619 pin1 = find_isa_irq_pin(0, mp_INT); 1625 pin1 = find_isa_irq_pin(0, mp_INT);
1620 apic1 = find_isa_irq_apic(0, mp_INT); 1626 apic1 = find_isa_irq_apic(0, mp_INT);
1621 pin2 = ioapic_i8259.pin; 1627 pin2 = ioapic_i8259.pin;
1622 apic2 = ioapic_i8259.apic; 1628 apic2 = ioapic_i8259.apic;
1623 1629
1624 /* Do this first, otherwise we get double interrupts on ATI boards */ 1630 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
1625 if ((pin1 != -1) && try_apic_pin(apic1, pin1,"with 8259 IRQ0 disabled")) 1631 vector, apic1, pin1, apic2, pin2);
1626 return;
1627 1632
1628 /* Now try again with IRQ0 8259A enabled. 1633 if (pin1 != -1) {
1629 Assumes timer is on IO-APIC 0 ?!? */ 1634 /*
1630 enable_8259A_irq(0); 1635 * Ok, does IRQ0 through the IOAPIC work?
1631 unmask_IO_APIC_irq(0); 1636 */
1632 if (try_apic_pin(apic1, pin1, "with 8259 IRQ0 enabled")) 1637 unmask_IO_APIC_irq(0);
1633 return; 1638 if (!no_timer_check && timer_irq_works()) {
1634 disable_8259A_irq(0); 1639 nmi_watchdog_default();
1635 1640 if (nmi_watchdog == NMI_IO_APIC) {
1636 /* Always try pin0 and pin2 on APIC 0 to handle buggy timer overrides 1641 disable_8259A_irq(0);
1637 on Nvidia boards */ 1642 setup_nmi();
1638 if (!(apic1 == 0 && pin1 == 0) && 1643 enable_8259A_irq(0);
1639 try_apic_pin(0, 0, "fallback with 8259 IRQ0 disabled")) 1644 }
1640 return; 1645 if (disable_timer_pin_1 > 0)
1641 if (!(apic1 == 0 && pin1 == 2) && 1646 clear_IO_APIC_pin(0, pin1);
1642 try_apic_pin(0, 2, "fallback with 8259 IRQ0 disabled")) 1647 return;
1643 return; 1648 }
1649 clear_IO_APIC_pin(apic1, pin1);
1650 apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
1651 "connected to IO-APIC\n");
1652 }
1644 1653
1645 /* Then try pure 8259A routing on the 8259 as reported by BIOS*/ 1654 apic_printk(APIC_VERBOSE,KERN_INFO "...trying to set up timer (IRQ0) "
1646 enable_8259A_irq(0); 1655 "through the 8259A ... ");
1647 if (pin2 != -1) { 1656 if (pin2 != -1) {
1657 apic_printk(APIC_VERBOSE,"\n..... (found apic %d pin %d) ...",
1658 apic2, pin2);
1659 /*
1660 * legacy devices should be connected to IO APIC #0
1661 */
1648 setup_ExtINT_IRQ0_pin(apic2, pin2, vector); 1662 setup_ExtINT_IRQ0_pin(apic2, pin2, vector);
1649 if (try_apic_pin(apic2,pin2,"8259A broadcast ExtINT from BIOS")) 1663 if (timer_irq_works()) {
1664 apic_printk(APIC_VERBOSE," works.\n");
1665 nmi_watchdog_default();
1666 if (nmi_watchdog == NMI_IO_APIC) {
1667 setup_nmi();
1668 }
1650 return; 1669 return;
1670 }
1671 /*
1672 * Cleanup, just in case ...
1673 */
1674 clear_IO_APIC_pin(apic2, pin2);
1651 } 1675 }
1652 1676 apic_printk(APIC_VERBOSE," failed.\n");
1653 /* Tried all possibilities to go through the IO-APIC. Now come the
1654 really cheesy fallbacks. */
1655 1677
1656 if (nmi_watchdog == NMI_IO_APIC) { 1678 if (nmi_watchdog == NMI_IO_APIC) {
1657 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); 1679 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c
index 87d90cb68a74..3d65b1d4c2b3 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86_64/kernel/pci-calgary.c
@@ -1068,6 +1068,8 @@ void __init detect_calgary(void)
1068 if (!early_pci_allowed()) 1068 if (!early_pci_allowed())
1069 return; 1069 return;
1070 1070
1071 printk(KERN_DEBUG "Calgary: detecting Calgary via BIOS EBDA area\n");
1072
1071 ptr = (unsigned long)phys_to_virt(get_bios_ebda()); 1073 ptr = (unsigned long)phys_to_virt(get_bios_ebda());
1072 1074
1073 rio_table_hdr = NULL; 1075 rio_table_hdr = NULL;
@@ -1088,14 +1090,14 @@ void __init detect_calgary(void)
1088 offset = *((unsigned short *)(ptr + offset)); 1090 offset = *((unsigned short *)(ptr + offset));
1089 } 1091 }
1090 if (!rio_table_hdr) { 1092 if (!rio_table_hdr) {
1091 printk(KERN_ERR "Calgary: Unable to locate " 1093 printk(KERN_DEBUG "Calgary: Unable to locate Rio Grande table "
1092 "Rio Grande Table in EBDA - bailing!\n"); 1094 "in EBDA - bailing!\n");
1093 return; 1095 return;
1094 } 1096 }
1095 1097
1096 ret = build_detail_arrays(); 1098 ret = build_detail_arrays();
1097 if (ret) { 1099 if (ret) {
1098 printk(KERN_ERR "Calgary: build_detail_arrays ret %d\n", ret); 1100 printk(KERN_DEBUG "Calgary: build_detail_arrays ret %d\n", ret);
1099 return; 1101 return;
1100 } 1102 }
1101 1103
@@ -1128,6 +1130,9 @@ void __init detect_calgary(void)
1128 } 1130 }
1129 } 1131 }
1130 1132
1133 printk(KERN_DEBUG "Calgary: finished detection, Calgary %s\n",
1134 calgary_found ? "found" : "not found");
1135
1131 if (calgary_found) { 1136 if (calgary_found) {
1132 iommu_detected = 1; 1137 iommu_detected = 1;
1133 calgary_detected = 1; 1138 calgary_detected = 1;
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 9f05bc9b2dad..5cc76d0d331f 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -656,6 +656,25 @@ core_initcall(cpufreq_tsc);
656 */ 656 */
657 657
658#define TICK_COUNT 100000000 658#define TICK_COUNT 100000000
659#define TICK_MIN 5000
660
661/*
662 * Some platforms take periodic SMI interrupts with 5ms duration. Make sure none
663 * occurs between the reads of the hpet & TSC.
664 */
665static void __init read_hpet_tsc(int *hpet, int *tsc)
666{
667 int tsc1, tsc2, hpet1;
668
669 do {
670 tsc1 = get_cycles_sync();
671 hpet1 = hpet_readl(HPET_COUNTER);
672 tsc2 = get_cycles_sync();
673 } while (tsc2 - tsc1 > TICK_MIN);
674 *hpet = hpet1;
675 *tsc = tsc2;
676}
677
659 678
660static unsigned int __init hpet_calibrate_tsc(void) 679static unsigned int __init hpet_calibrate_tsc(void)
661{ 680{
@@ -666,13 +685,11 @@ static unsigned int __init hpet_calibrate_tsc(void)
666 local_irq_save(flags); 685 local_irq_save(flags);
667 local_irq_disable(); 686 local_irq_disable();
668 687
669 hpet_start = hpet_readl(HPET_COUNTER); 688 read_hpet_tsc(&hpet_start, &tsc_start);
670 rdtscl(tsc_start);
671 689
672 do { 690 do {
673 local_irq_disable(); 691 local_irq_disable();
674 hpet_now = hpet_readl(HPET_COUNTER); 692 read_hpet_tsc(&hpet_now, &tsc_now);
675 tsc_now = get_cycles_sync();
676 local_irq_restore(flags); 693 local_irq_restore(flags);
677 } while ((tsc_now - tsc_start) < TICK_COUNT && 694 } while ((tsc_now - tsc_start) < TICK_COUNT &&
678 (hpet_now - hpet_start) < TICK_COUNT); 695 (hpet_now - hpet_start) < TICK_COUNT);
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index aeefec97fdee..6bdf593081d8 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -117,10 +117,17 @@ static struct usb_device_id blacklist_ids[] = {
117 117
118 /* IBM/Lenovo ThinkPad with Broadcom chip */ 118 /* IBM/Lenovo ThinkPad with Broadcom chip */
119 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU }, 119 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
120 { USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU },
120 121
121 /* ANYCOM Bluetooth USB-200 and USB-250 */ 122 /* ANYCOM Bluetooth USB-200 and USB-250 */
122 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET }, 123 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
123 124
125 /* HP laptop with Broadcom chip */
126 { USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_WRONG_SCO_MTU },
127
128 /* Dell laptop with Broadcom chip */
129 { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_WRONG_SCO_MTU },
130
124 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ 131 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
125 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, 132 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
126 133
diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c
index 71e4e0f3fd54..556fd81fa815 100644
--- a/drivers/char/hw_random/amd-rng.c
+++ b/drivers/char/hw_random/amd-rng.c
@@ -144,7 +144,7 @@ static void __exit mod_exit(void)
144 hwrng_unregister(&amd_rng); 144 hwrng_unregister(&amd_rng);
145} 145}
146 146
147subsys_initcall(mod_init); 147module_init(mod_init);
148module_exit(mod_exit); 148module_exit(mod_exit);
149 149
150MODULE_AUTHOR("The Linux Kernel team"); 150MODULE_AUTHOR("The Linux Kernel team");
diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c
index d37ced0d132b..8e8658dcd2e3 100644
--- a/drivers/char/hw_random/geode-rng.c
+++ b/drivers/char/hw_random/geode-rng.c
@@ -125,7 +125,7 @@ static void __exit mod_exit(void)
125 iounmap(mem); 125 iounmap(mem);
126} 126}
127 127
128subsys_initcall(mod_init); 128module_init(mod_init);
129module_exit(mod_exit); 129module_exit(mod_exit);
130 130
131MODULE_DESCRIPTION("H/W RNG driver for AMD Geode LX CPUs"); 131MODULE_DESCRIPTION("H/W RNG driver for AMD Geode LX CPUs");
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 8efbc9c0e545..f22e78e3c70f 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -143,6 +143,11 @@ static const struct pci_device_id pci_tbl[] = {
143}; 143};
144MODULE_DEVICE_TABLE(pci, pci_tbl); 144MODULE_DEVICE_TABLE(pci, pci_tbl);
145 145
146static __initdata int no_fwh_detect;
147module_param(no_fwh_detect, int, 0);
148MODULE_PARM_DESC(no_fwh_detect, "Skip FWH detection:\n"
149 " positive value - skip if FWH space locked read-only\n"
150 " negative value - skip always");
146 151
147static inline u8 hwstatus_get(void __iomem *mem) 152static inline u8 hwstatus_get(void __iomem *mem)
148{ 153{
@@ -240,6 +245,11 @@ static int __init mod_init(void)
240 if (!dev) 245 if (!dev)
241 goto out; /* Device not found. */ 246 goto out; /* Device not found. */
242 247
248 if (no_fwh_detect < 0) {
249 pci_dev_put(dev);
250 goto fwh_done;
251 }
252
243 /* Check for Intel 82802 */ 253 /* Check for Intel 82802 */
244 if (dev->device < 0x2640) { 254 if (dev->device < 0x2640) {
245 fwh_dec_en1_off = FWH_DEC_EN1_REG_OLD; 255 fwh_dec_en1_off = FWH_DEC_EN1_REG_OLD;
@@ -252,6 +262,23 @@ static int __init mod_init(void)
252 pci_read_config_byte(dev, fwh_dec_en1_off, &fwh_dec_en1_val); 262 pci_read_config_byte(dev, fwh_dec_en1_off, &fwh_dec_en1_val);
253 pci_read_config_byte(dev, bios_cntl_off, &bios_cntl_val); 263 pci_read_config_byte(dev, bios_cntl_off, &bios_cntl_val);
254 264
265 if ((bios_cntl_val &
266 (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK))
267 == BIOS_CNTL_LOCK_ENABLE_MASK) {
268 static __initdata /*const*/ char warning[] =
269 KERN_WARNING PFX "Firmware space is locked read-only. If you can't or\n"
270 KERN_WARNING PFX "don't want to disable this in firmware setup, and if\n"
271 KERN_WARNING PFX "you are certain that your system has a functional\n"
272 KERN_WARNING PFX "RNG, try using the 'no_fwh_detect' option.\n";
273
274 pci_dev_put(dev);
275 if (no_fwh_detect)
276 goto fwh_done;
277 printk(warning);
278 err = -EBUSY;
279 goto out;
280 }
281
255 mem = ioremap_nocache(INTEL_FWH_ADDR, INTEL_FWH_ADDR_LEN); 282 mem = ioremap_nocache(INTEL_FWH_ADDR, INTEL_FWH_ADDR_LEN);
256 if (mem == NULL) { 283 if (mem == NULL) {
257 pci_dev_put(dev); 284 pci_dev_put(dev);
@@ -280,8 +307,7 @@ static int __init mod_init(void)
280 pci_write_config_byte(dev, 307 pci_write_config_byte(dev,
281 fwh_dec_en1_off, 308 fwh_dec_en1_off,
282 fwh_dec_en1_val | FWH_F8_EN_MASK); 309 fwh_dec_en1_val | FWH_F8_EN_MASK);
283 if (!(bios_cntl_val & 310 if (!(bios_cntl_val & BIOS_CNTL_WRITE_ENABLE_MASK))
284 (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)))
285 pci_write_config_byte(dev, 311 pci_write_config_byte(dev,
286 bios_cntl_off, 312 bios_cntl_off,
287 bios_cntl_val | BIOS_CNTL_WRITE_ENABLE_MASK); 313 bios_cntl_val | BIOS_CNTL_WRITE_ENABLE_MASK);
@@ -315,6 +341,8 @@ static int __init mod_init(void)
315 goto out; 341 goto out;
316 } 342 }
317 343
344fwh_done:
345
318 err = -ENOMEM; 346 err = -ENOMEM;
319 mem = ioremap(INTEL_RNG_ADDR, INTEL_RNG_ADDR_LEN); 347 mem = ioremap(INTEL_RNG_ADDR, INTEL_RNG_ADDR_LEN);
320 if (!mem) 348 if (!mem)
@@ -350,7 +378,7 @@ static void __exit mod_exit(void)
350 iounmap(mem); 378 iounmap(mem);
351} 379}
352 380
353subsys_initcall(mod_init); 381module_init(mod_init);
354module_exit(mod_exit); 382module_exit(mod_exit);
355 383
356MODULE_DESCRIPTION("H/W RNG driver for Intel chipsets"); 384MODULE_DESCRIPTION("H/W RNG driver for Intel chipsets");
diff --git a/drivers/char/hw_random/ixp4xx-rng.c b/drivers/char/hw_random/ixp4xx-rng.c
index c9caff57db85..bab43ca32ac1 100644
--- a/drivers/char/hw_random/ixp4xx-rng.c
+++ b/drivers/char/hw_random/ixp4xx-rng.c
@@ -64,7 +64,7 @@ static void __exit ixp4xx_rng_exit(void)
64 iounmap(rng_base); 64 iounmap(rng_base);
65} 65}
66 66
67subsys_initcall(ixp4xx_rng_init); 67module_init(ixp4xx_rng_init);
68module_exit(ixp4xx_rng_exit); 68module_exit(ixp4xx_rng_exit);
69 69
70MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); 70MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c
index 0e786b617bb8..9ebf84d18655 100644
--- a/drivers/char/hw_random/via-rng.c
+++ b/drivers/char/hw_random/via-rng.c
@@ -176,7 +176,7 @@ static void __exit mod_exit(void)
176 hwrng_unregister(&via_rng); 176 hwrng_unregister(&via_rng);
177} 177}
178 178
179subsys_initcall(mod_init); 179module_init(mod_init);
180module_exit(mod_exit); 180module_exit(mod_exit);
181 181
182MODULE_DESCRIPTION("H/W RNG driver for VIA chipsets"); 182MODULE_DESCRIPTION("H/W RNG driver for VIA chipsets");
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 2b5d7ab3adf7..4325aac7733d 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -2020,6 +2020,8 @@ static int sbp2scsi_slave_configure(struct scsi_device *sdev)
2020 blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 2020 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
2021 sdev->use_10_for_rw = 1; 2021 sdev->use_10_for_rw = 1;
2022 2022
2023 if (sdev->type == TYPE_ROM)
2024 sdev->use_10_for_ms = 1;
2023 if (sdev->type == TYPE_DISK && 2025 if (sdev->type == TYPE_DISK &&
2024 lu->workarounds & SBP2_WORKAROUND_MODE_SENSE_8) 2026 lu->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
2025 sdev->skip_ms_page_8 = 1; 2027 sdev->skip_ms_page_8 = 1;
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 533193d4e5df..9e0ab048c878 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1088,10 +1088,21 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct iw_cm_event *iw_event)
1088 *sin = iw_event->local_addr; 1088 *sin = iw_event->local_addr;
1089 sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; 1089 sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr;
1090 *sin = iw_event->remote_addr; 1090 *sin = iw_event->remote_addr;
1091 if (iw_event->status) 1091 switch (iw_event->status) {
1092 event.event = RDMA_CM_EVENT_REJECTED; 1092 case 0:
1093 else
1094 event.event = RDMA_CM_EVENT_ESTABLISHED; 1093 event.event = RDMA_CM_EVENT_ESTABLISHED;
1094 break;
1095 case -ECONNRESET:
1096 case -ECONNREFUSED:
1097 event.event = RDMA_CM_EVENT_REJECTED;
1098 break;
1099 case -ETIMEDOUT:
1100 event.event = RDMA_CM_EVENT_UNREACHABLE;
1101 break;
1102 default:
1103 event.event = RDMA_CM_EVENT_CONNECT_ERROR;
1104 break;
1105 }
1095 break; 1106 break;
1096 case IW_CM_EVENT_ESTABLISHED: 1107 case IW_CM_EVENT_ESTABLISHED:
1097 event.event = RDMA_CM_EVENT_ESTABLISHED; 1108 event.event = RDMA_CM_EVENT_ESTABLISHED;
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 81a5cdc5733a..e2e8d329b443 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -209,10 +209,21 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
209 if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { 209 if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) {
210 if (!ctx->backlog) { 210 if (!ctx->backlog) {
211 ret = -EDQUOT; 211 ret = -EDQUOT;
212 kfree(uevent);
212 goto out; 213 goto out;
213 } 214 }
214 ctx->backlog--; 215 ctx->backlog--;
216 } else if (!ctx->uid) {
217 /*
218 * We ignore events for new connections until userspace has set
219 * their context. This can only happen if an error occurs on a
220 * new connection before the user accepts it. This is okay,
221 * since the accept will just fail later.
222 */
223 kfree(uevent);
224 goto out;
215 } 225 }
226
216 list_add_tail(&uevent->list, &ctx->file->event_list); 227 list_add_tail(&uevent->list, &ctx->file->event_list);
217 wake_up_interruptible(&ctx->file->poll_wait); 228 wake_up_interruptible(&ctx->file->poll_wait);
218out: 229out:
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index e1b618c5f685..b7be950ab47c 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -50,7 +50,7 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
50 ib_device); 50 ib_device);
51 struct hipz_query_hca *rblock; 51 struct hipz_query_hca *rblock;
52 52
53 rblock = ehca_alloc_fw_ctrlblock(); 53 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
54 if (!rblock) { 54 if (!rblock) {
55 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 55 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
56 return -ENOMEM; 56 return -ENOMEM;
@@ -110,7 +110,7 @@ int ehca_query_port(struct ib_device *ibdev,
110 ib_device); 110 ib_device);
111 struct hipz_query_port *rblock; 111 struct hipz_query_port *rblock;
112 112
113 rblock = ehca_alloc_fw_ctrlblock(); 113 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
114 if (!rblock) { 114 if (!rblock) {
115 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 115 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
116 return -ENOMEM; 116 return -ENOMEM;
@@ -179,7 +179,7 @@ int ehca_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
179 return -EINVAL; 179 return -EINVAL;
180 } 180 }
181 181
182 rblock = ehca_alloc_fw_ctrlblock(); 182 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
183 if (!rblock) { 183 if (!rblock) {
184 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 184 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
185 return -ENOMEM; 185 return -ENOMEM;
@@ -212,7 +212,7 @@ int ehca_query_gid(struct ib_device *ibdev, u8 port,
212 return -EINVAL; 212 return -EINVAL;
213 } 213 }
214 214
215 rblock = ehca_alloc_fw_ctrlblock(); 215 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
216 if (!rblock) { 216 if (!rblock) {
217 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 217 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
218 return -ENOMEM; 218 return -ENOMEM;
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index c3ea746e9045..e7209afb4250 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -138,7 +138,7 @@ int ehca_error_data(struct ehca_shca *shca, void *data,
138 u64 *rblock; 138 u64 *rblock;
139 unsigned long block_count; 139 unsigned long block_count;
140 140
141 rblock = ehca_alloc_fw_ctrlblock(); 141 rblock = ehca_alloc_fw_ctrlblock(GFP_ATOMIC);
142 if (!rblock) { 142 if (!rblock) {
143 ehca_err(&shca->ib_device, "Cannot allocate rblock memory."); 143 ehca_err(&shca->ib_device, "Cannot allocate rblock memory.");
144 ret = -ENOMEM; 144 ret = -ENOMEM;
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h
index 3720e3032cce..cd7789f0d08e 100644
--- a/drivers/infiniband/hw/ehca/ehca_iverbs.h
+++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h
@@ -180,10 +180,10 @@ int ehca_mmap_register(u64 physical,void **mapped,
180int ehca_munmap(unsigned long addr, size_t len); 180int ehca_munmap(unsigned long addr, size_t len);
181 181
182#ifdef CONFIG_PPC_64K_PAGES 182#ifdef CONFIG_PPC_64K_PAGES
183void *ehca_alloc_fw_ctrlblock(void); 183void *ehca_alloc_fw_ctrlblock(gfp_t flags);
184void ehca_free_fw_ctrlblock(void *ptr); 184void ehca_free_fw_ctrlblock(void *ptr);
185#else 185#else
186#define ehca_alloc_fw_ctrlblock() ((void *) get_zeroed_page(GFP_KERNEL)) 186#define ehca_alloc_fw_ctrlblock(flags) ((void *) get_zeroed_page(flags))
187#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr)) 187#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
188#endif 188#endif
189 189
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index cc47e4c13a18..6574fbbaead5 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -106,9 +106,9 @@ static struct timer_list poll_eqs_timer;
106#ifdef CONFIG_PPC_64K_PAGES 106#ifdef CONFIG_PPC_64K_PAGES
107static struct kmem_cache *ctblk_cache = NULL; 107static struct kmem_cache *ctblk_cache = NULL;
108 108
109void *ehca_alloc_fw_ctrlblock(void) 109void *ehca_alloc_fw_ctrlblock(gfp_t flags)
110{ 110{
111 void *ret = kmem_cache_zalloc(ctblk_cache, GFP_KERNEL); 111 void *ret = kmem_cache_zalloc(ctblk_cache, flags);
112 if (!ret) 112 if (!ret)
113 ehca_gen_err("Out of memory for ctblk"); 113 ehca_gen_err("Out of memory for ctblk");
114 return ret; 114 return ret;
@@ -206,7 +206,7 @@ int ehca_sense_attributes(struct ehca_shca *shca)
206 u64 h_ret; 206 u64 h_ret;
207 struct hipz_query_hca *rblock; 207 struct hipz_query_hca *rblock;
208 208
209 rblock = ehca_alloc_fw_ctrlblock(); 209 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
210 if (!rblock) { 210 if (!rblock) {
211 ehca_gen_err("Cannot allocate rblock memory."); 211 ehca_gen_err("Cannot allocate rblock memory.");
212 return -ENOMEM; 212 return -ENOMEM;
@@ -258,7 +258,7 @@ static int init_node_guid(struct ehca_shca *shca)
258 int ret = 0; 258 int ret = 0;
259 struct hipz_query_hca *rblock; 259 struct hipz_query_hca *rblock;
260 260
261 rblock = ehca_alloc_fw_ctrlblock(); 261 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
262 if (!rblock) { 262 if (!rblock) {
263 ehca_err(&shca->ib_device, "Can't allocate rblock memory."); 263 ehca_err(&shca->ib_device, "Can't allocate rblock memory.");
264 return -ENOMEM; 264 return -ENOMEM;
@@ -469,7 +469,7 @@ static ssize_t ehca_show_##name(struct device *dev, \
469 \ 469 \
470 shca = dev->driver_data; \ 470 shca = dev->driver_data; \
471 \ 471 \
472 rblock = ehca_alloc_fw_ctrlblock(); \ 472 rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \
473 if (!rblock) { \ 473 if (!rblock) { \
474 dev_err(dev, "Can't allocate rblock memory."); \ 474 dev_err(dev, "Can't allocate rblock memory."); \
475 return 0; \ 475 return 0; \
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c
index 0a5e2214cc5f..cfb362a1029c 100644
--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -1013,7 +1013,7 @@ int ehca_reg_mr_rpages(struct ehca_shca *shca,
1013 u32 i; 1013 u32 i;
1014 u64 *kpage; 1014 u64 *kpage;
1015 1015
1016 kpage = ehca_alloc_fw_ctrlblock(); 1016 kpage = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
1017 if (!kpage) { 1017 if (!kpage) {
1018 ehca_err(&shca->ib_device, "kpage alloc failed"); 1018 ehca_err(&shca->ib_device, "kpage alloc failed");
1019 ret = -ENOMEM; 1019 ret = -ENOMEM;
@@ -1124,7 +1124,7 @@ inline int ehca_rereg_mr_rereg1(struct ehca_shca *shca,
1124 ehca_mrmw_map_acl(acl, &hipz_acl); 1124 ehca_mrmw_map_acl(acl, &hipz_acl);
1125 ehca_mrmw_set_pgsize_hipz_acl(&hipz_acl); 1125 ehca_mrmw_set_pgsize_hipz_acl(&hipz_acl);
1126 1126
1127 kpage = ehca_alloc_fw_ctrlblock(); 1127 kpage = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
1128 if (!kpage) { 1128 if (!kpage) {
1129 ehca_err(&shca->ib_device, "kpage alloc failed"); 1129 ehca_err(&shca->ib_device, "kpage alloc failed");
1130 ret = -ENOMEM; 1130 ret = -ENOMEM;
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index c6c9cef203e3..34b85556d01e 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -807,7 +807,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
807 unsigned long spl_flags = 0; 807 unsigned long spl_flags = 0;
808 808
809 /* do query_qp to obtain current attr values */ 809 /* do query_qp to obtain current attr values */
810 mqpcb = ehca_alloc_fw_ctrlblock(); 810 mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
811 if (!mqpcb) { 811 if (!mqpcb) {
812 ehca_err(ibqp->device, "Could not get zeroed page for mqpcb " 812 ehca_err(ibqp->device, "Could not get zeroed page for mqpcb "
813 "ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num); 813 "ehca_qp=%p qp_num=%x ", my_qp, ibqp->qp_num);
@@ -1273,7 +1273,7 @@ int ehca_query_qp(struct ib_qp *qp,
1273 return -EINVAL; 1273 return -EINVAL;
1274 } 1274 }
1275 1275
1276 qpcb = ehca_alloc_fw_ctrlblock(); 1276 qpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
1277 if (!qpcb) { 1277 if (!qpcb) {
1278 ehca_err(qp->device,"Out of memory for qpcb " 1278 ehca_err(qp->device,"Out of memory for qpcb "
1279 "ehca_qp=%p qp_num=%x", my_qp, qp->qp_num); 1279 "ehca_qp=%p qp_num=%x", my_qp, qp->qp_num);
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 283d50b76c3d..1159c8a0f2c5 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -54,6 +54,10 @@ enum {
54 MTHCA_CQ_ENTRY_SIZE = 0x20 54 MTHCA_CQ_ENTRY_SIZE = 0x20
55}; 55};
56 56
57enum {
58 MTHCA_ATOMIC_BYTE_LEN = 8
59};
60
57/* 61/*
58 * Must be packed because start is 64 bits but only aligned to 32 bits. 62 * Must be packed because start is 64 bits but only aligned to 32 bits.
59 */ 63 */
@@ -599,11 +603,11 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
599 break; 603 break;
600 case MTHCA_OPCODE_ATOMIC_CS: 604 case MTHCA_OPCODE_ATOMIC_CS:
601 entry->opcode = IB_WC_COMP_SWAP; 605 entry->opcode = IB_WC_COMP_SWAP;
602 entry->byte_len = be32_to_cpu(cqe->byte_cnt); 606 entry->byte_len = MTHCA_ATOMIC_BYTE_LEN;
603 break; 607 break;
604 case MTHCA_OPCODE_ATOMIC_FA: 608 case MTHCA_OPCODE_ATOMIC_FA:
605 entry->opcode = IB_WC_FETCH_ADD; 609 entry->opcode = IB_WC_FETCH_ADD;
606 entry->byte_len = be32_to_cpu(cqe->byte_cnt); 610 entry->byte_len = MTHCA_ATOMIC_BYTE_LEN;
607 break; 611 break;
608 case MTHCA_OPCODE_BIND_MW: 612 case MTHCA_OPCODE_BIND_MW:
609 entry->opcode = IB_WC_BIND_MW; 613 entry->opcode = IB_WC_BIND_MW;
diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
index 15cc2f6eb475..6b19645d946c 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -232,7 +232,7 @@ void *mthca_table_find(struct mthca_icm_table *table, int obj)
232 232
233 list_for_each_entry(chunk, &icm->chunk_list, list) { 233 list_for_each_entry(chunk, &icm->chunk_list, list) {
234 for (i = 0; i < chunk->npages; ++i) { 234 for (i = 0; i < chunk->npages; ++i) {
235 if (chunk->mem[i].length >= offset) { 235 if (chunk->mem[i].length > offset) {
236 page = chunk->mem[i].page; 236 page = chunk->mem[i].page;
237 goto out; 237 goto out;
238 } 238 }
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index d844a2569b47..5f5214c0337d 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -429,13 +429,18 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m
429{ 429{
430 struct mthca_dev *dev = to_mdev(ibqp->device); 430 struct mthca_dev *dev = to_mdev(ibqp->device);
431 struct mthca_qp *qp = to_mqp(ibqp); 431 struct mthca_qp *qp = to_mqp(ibqp);
432 int err; 432 int err = 0;
433 struct mthca_mailbox *mailbox; 433 struct mthca_mailbox *mailbox = NULL;
434 struct mthca_qp_param *qp_param; 434 struct mthca_qp_param *qp_param;
435 struct mthca_qp_context *context; 435 struct mthca_qp_context *context;
436 int mthca_state; 436 int mthca_state;
437 u8 status; 437 u8 status;
438 438
439 if (qp->state == IB_QPS_RESET) {
440 qp_attr->qp_state = IB_QPS_RESET;
441 goto done;
442 }
443
439 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); 444 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
440 if (IS_ERR(mailbox)) 445 if (IS_ERR(mailbox))
441 return PTR_ERR(mailbox); 446 return PTR_ERR(mailbox);
@@ -454,7 +459,6 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m
454 mthca_state = be32_to_cpu(context->flags) >> 28; 459 mthca_state = be32_to_cpu(context->flags) >> 28;
455 460
456 qp_attr->qp_state = to_ib_qp_state(mthca_state); 461 qp_attr->qp_state = to_ib_qp_state(mthca_state);
457 qp_attr->cur_qp_state = qp_attr->qp_state;
458 qp_attr->path_mtu = context->mtu_msgmax >> 5; 462 qp_attr->path_mtu = context->mtu_msgmax >> 5;
459 qp_attr->path_mig_state = 463 qp_attr->path_mig_state =
460 to_ib_mig_state((be32_to_cpu(context->flags) >> 11) & 0x3); 464 to_ib_mig_state((be32_to_cpu(context->flags) >> 11) & 0x3);
@@ -464,11 +468,6 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m
464 qp_attr->dest_qp_num = be32_to_cpu(context->remote_qpn) & 0xffffff; 468 qp_attr->dest_qp_num = be32_to_cpu(context->remote_qpn) & 0xffffff;
465 qp_attr->qp_access_flags = 469 qp_attr->qp_access_flags =
466 to_ib_qp_access_flags(be32_to_cpu(context->params2)); 470 to_ib_qp_access_flags(be32_to_cpu(context->params2));
467 qp_attr->cap.max_send_wr = qp->sq.max;
468 qp_attr->cap.max_recv_wr = qp->rq.max;
469 qp_attr->cap.max_send_sge = qp->sq.max_gs;
470 qp_attr->cap.max_recv_sge = qp->rq.max_gs;
471 qp_attr->cap.max_inline_data = qp->max_inline_data;
472 471
473 if (qp->transport == RC || qp->transport == UC) { 472 if (qp->transport == RC || qp->transport == UC) {
474 to_ib_ah_attr(dev, &qp_attr->ah_attr, &context->pri_path); 473 to_ib_ah_attr(dev, &qp_attr->ah_attr, &context->pri_path);
@@ -495,7 +494,16 @@ int mthca_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_m
495 qp_attr->retry_cnt = (be32_to_cpu(context->params1) >> 16) & 0x7; 494 qp_attr->retry_cnt = (be32_to_cpu(context->params1) >> 16) & 0x7;
496 qp_attr->rnr_retry = context->pri_path.rnr_retry >> 5; 495 qp_attr->rnr_retry = context->pri_path.rnr_retry >> 5;
497 qp_attr->alt_timeout = context->alt_path.ackto >> 3; 496 qp_attr->alt_timeout = context->alt_path.ackto >> 3;
498 qp_init_attr->cap = qp_attr->cap; 497
498done:
499 qp_attr->cur_qp_state = qp_attr->qp_state;
500 qp_attr->cap.max_send_wr = qp->sq.max;
501 qp_attr->cap.max_recv_wr = qp->rq.max;
502 qp_attr->cap.max_send_sge = qp->sq.max_gs;
503 qp_attr->cap.max_recv_sge = qp->rq.max_gs;
504 qp_attr->cap.max_inline_data = qp->max_inline_data;
505
506 qp_init_attr->cap = qp_attr->cap;
499 507
500out: 508out:
501 mthca_free_mailbox(dev, mailbox); 509 mthca_free_mailbox(dev, mailbox);
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 9b2041e25d59..dd221eda3ea6 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -177,7 +177,7 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn,
177 * - if yes, the mtask is recycled at iscsi_complete_pdu 177 * - if yes, the mtask is recycled at iscsi_complete_pdu
178 * - if no, the mtask is recycled at iser_snd_completion 178 * - if no, the mtask is recycled at iser_snd_completion
179 */ 179 */
180 if (error && error != -EAGAIN) 180 if (error && error != -ENOBUFS)
181 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 181 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
182 182
183 return error; 183 return error;
@@ -241,7 +241,7 @@ iscsi_iser_ctask_xmit(struct iscsi_conn *conn,
241 error = iscsi_iser_ctask_xmit_unsol_data(conn, ctask); 241 error = iscsi_iser_ctask_xmit_unsol_data(conn, ctask);
242 242
243 iscsi_iser_ctask_xmit_exit: 243 iscsi_iser_ctask_xmit_exit:
244 if (error && error != -EAGAIN) 244 if (error && error != -ENOBUFS)
245 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 245 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
246 return error; 246 return error;
247} 247}
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index e73c87b9be43..0a7d1ab60e6d 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -304,18 +304,14 @@ int iser_conn_set_full_featured_mode(struct iscsi_conn *conn)
304static int 304static int
305iser_check_xmit(struct iscsi_conn *conn, void *task) 305iser_check_xmit(struct iscsi_conn *conn, void *task)
306{ 306{
307 int rc = 0;
308 struct iscsi_iser_conn *iser_conn = conn->dd_data; 307 struct iscsi_iser_conn *iser_conn = conn->dd_data;
309 308
310 write_lock_bh(conn->recv_lock);
311 if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) == 309 if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
312 ISER_QP_MAX_REQ_DTOS) { 310 ISER_QP_MAX_REQ_DTOS) {
313 iser_dbg("%ld can't xmit task %p, suspending tx\n",jiffies,task); 311 iser_dbg("%ld can't xmit task %p\n",jiffies,task);
314 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); 312 return -ENOBUFS;
315 rc = -EAGAIN;
316 } 313 }
317 write_unlock_bh(conn->recv_lock); 314 return 0;
318 return rc;
319} 315}
320 316
321 317
@@ -340,7 +336,7 @@ int iser_send_command(struct iscsi_conn *conn,
340 return -EPERM; 336 return -EPERM;
341 } 337 }
342 if (iser_check_xmit(conn, ctask)) 338 if (iser_check_xmit(conn, ctask))
343 return -EAGAIN; 339 return -ENOBUFS;
344 340
345 edtl = ntohl(hdr->data_length); 341 edtl = ntohl(hdr->data_length);
346 342
@@ -426,7 +422,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
426 } 422 }
427 423
428 if (iser_check_xmit(conn, ctask)) 424 if (iser_check_xmit(conn, ctask))
429 return -EAGAIN; 425 return -ENOBUFS;
430 426
431 itt = ntohl(hdr->itt); 427 itt = ntohl(hdr->itt);
432 data_seg_len = ntoh24(hdr->dlength); 428 data_seg_len = ntoh24(hdr->dlength);
@@ -498,7 +494,7 @@ int iser_send_control(struct iscsi_conn *conn,
498 } 494 }
499 495
500 if (iser_check_xmit(conn,mtask)) 496 if (iser_check_xmit(conn,mtask))
501 return -EAGAIN; 497 return -ENOBUFS;
502 498
503 /* build the tx desc regd header and add it to the tx desc dto */ 499 /* build the tx desc regd header and add it to the tx desc dto */
504 mdesc->type = ISCSI_TX_CONTROL; 500 mdesc->type = ISCSI_TX_CONTROL;
@@ -605,6 +601,7 @@ void iser_snd_completion(struct iser_desc *tx_desc)
605 struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn; 601 struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn;
606 struct iscsi_conn *conn = iser_conn->iscsi_conn; 602 struct iscsi_conn *conn = iser_conn->iscsi_conn;
607 struct iscsi_mgmt_task *mtask; 603 struct iscsi_mgmt_task *mtask;
604 int resume_tx = 0;
608 605
609 iser_dbg("Initiator, Data sent dto=0x%p\n", dto); 606 iser_dbg("Initiator, Data sent dto=0x%p\n", dto);
610 607
@@ -613,15 +610,16 @@ void iser_snd_completion(struct iser_desc *tx_desc)
613 if (tx_desc->type == ISCSI_TX_DATAOUT) 610 if (tx_desc->type == ISCSI_TX_DATAOUT)
614 kmem_cache_free(ig.desc_cache, tx_desc); 611 kmem_cache_free(ig.desc_cache, tx_desc);
615 612
613 if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
614 ISER_QP_MAX_REQ_DTOS)
615 resume_tx = 1;
616
616 atomic_dec(&ib_conn->post_send_buf_count); 617 atomic_dec(&ib_conn->post_send_buf_count);
617 618
618 write_lock(conn->recv_lock); 619 if (resume_tx) {
619 if (conn->suspend_tx) {
620 iser_dbg("%ld resuming tx\n",jiffies); 620 iser_dbg("%ld resuming tx\n",jiffies);
621 clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
622 scsi_queue_work(conn->session->host, &conn->xmitwork); 621 scsi_queue_work(conn->session->host, &conn->xmitwork);
623 } 622 }
624 write_unlock(conn->recv_lock);
625 623
626 if (tx_desc->type == ISCSI_TX_CONTROL) { 624 if (tx_desc->type == ISCSI_TX_CONTROL) {
627 /* this arithmetic is legal by libiscsi dd_data allocation */ 625 /* this arithmetic is legal by libiscsi dd_data allocation */
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index ccc06b1b91b5..714f6a7841cd 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19#include <linux/highmem.h> 19#include <linux/highmem.h>
20#include <linux/profile.h>
20#include <asm/desc.h> 21#include <asm/desc.h>
21 22
22#include "kvm_svm.h" 23#include "kvm_svm.h"
@@ -1558,6 +1559,13 @@ again:
1558 1559
1559 reload_tss(vcpu); 1560 reload_tss(vcpu);
1560 1561
1562 /*
1563 * Profile KVM exit RIPs:
1564 */
1565 if (unlikely(prof_on == KVM_PROFILING))
1566 profile_hit(KVM_PROFILING,
1567 (void *)(unsigned long)vcpu->svm->vmcb->save.rip);
1568
1561 stgi(); 1569 stgi();
1562 1570
1563 kvm_reput_irq(vcpu); 1571 kvm_reput_irq(vcpu);
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index d4701cb4c654..ce219e3f557f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -21,6 +21,7 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/profile.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/desc.h> 26#include <asm/desc.h>
26 27
@@ -1859,6 +1860,12 @@ again:
1859 asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); 1860 asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
1860#endif 1861#endif
1861 1862
1863 /*
1864 * Profile KVM exit RIPs:
1865 */
1866 if (unlikely(prof_on == KVM_PROFILING))
1867 profile_hit(KVM_PROFILING, (void *)vmcs_readl(GUEST_RIP));
1868
1862 kvm_run->exit_type = 0; 1869 kvm_run->exit_type = 0;
1863 if (fail) { 1870 if (fail) {
1864 kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; 1871 kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY;
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b30f74be3982..164b25dca101 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -775,6 +775,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
775 struct bio_list bl; 775 struct bio_list bl;
776 struct page **behind_pages = NULL; 776 struct page **behind_pages = NULL;
777 const int rw = bio_data_dir(bio); 777 const int rw = bio_data_dir(bio);
778 const int do_sync = bio_sync(bio);
778 int do_barriers; 779 int do_barriers;
779 780
780 /* 781 /*
@@ -835,7 +836,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
835 read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset; 836 read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset;
836 read_bio->bi_bdev = mirror->rdev->bdev; 837 read_bio->bi_bdev = mirror->rdev->bdev;
837 read_bio->bi_end_io = raid1_end_read_request; 838 read_bio->bi_end_io = raid1_end_read_request;
838 read_bio->bi_rw = READ; 839 read_bio->bi_rw = READ | do_sync;
839 read_bio->bi_private = r1_bio; 840 read_bio->bi_private = r1_bio;
840 841
841 generic_make_request(read_bio); 842 generic_make_request(read_bio);
@@ -906,7 +907,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
906 mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset; 907 mbio->bi_sector = r1_bio->sector + conf->mirrors[i].rdev->data_offset;
907 mbio->bi_bdev = conf->mirrors[i].rdev->bdev; 908 mbio->bi_bdev = conf->mirrors[i].rdev->bdev;
908 mbio->bi_end_io = raid1_end_write_request; 909 mbio->bi_end_io = raid1_end_write_request;
909 mbio->bi_rw = WRITE | do_barriers; 910 mbio->bi_rw = WRITE | do_barriers | do_sync;
910 mbio->bi_private = r1_bio; 911 mbio->bi_private = r1_bio;
911 912
912 if (behind_pages) { 913 if (behind_pages) {
@@ -941,6 +942,8 @@ static int make_request(request_queue_t *q, struct bio * bio)
941 blk_plug_device(mddev->queue); 942 blk_plug_device(mddev->queue);
942 spin_unlock_irqrestore(&conf->device_lock, flags); 943 spin_unlock_irqrestore(&conf->device_lock, flags);
943 944
945 if (do_sync)
946 md_wakeup_thread(mddev->thread);
944#if 0 947#if 0
945 while ((bio = bio_list_pop(&bl)) != NULL) 948 while ((bio = bio_list_pop(&bl)) != NULL)
946 generic_make_request(bio); 949 generic_make_request(bio);
@@ -1541,6 +1544,7 @@ static void raid1d(mddev_t *mddev)
1541 * We already have a nr_pending reference on these rdevs. 1544 * We already have a nr_pending reference on these rdevs.
1542 */ 1545 */
1543 int i; 1546 int i;
1547 const int do_sync = bio_sync(r1_bio->master_bio);
1544 clear_bit(R1BIO_BarrierRetry, &r1_bio->state); 1548 clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
1545 clear_bit(R1BIO_Barrier, &r1_bio->state); 1549 clear_bit(R1BIO_Barrier, &r1_bio->state);
1546 for (i=0; i < conf->raid_disks; i++) 1550 for (i=0; i < conf->raid_disks; i++)
@@ -1561,7 +1565,7 @@ static void raid1d(mddev_t *mddev)
1561 conf->mirrors[i].rdev->data_offset; 1565 conf->mirrors[i].rdev->data_offset;
1562 bio->bi_bdev = conf->mirrors[i].rdev->bdev; 1566 bio->bi_bdev = conf->mirrors[i].rdev->bdev;
1563 bio->bi_end_io = raid1_end_write_request; 1567 bio->bi_end_io = raid1_end_write_request;
1564 bio->bi_rw = WRITE; 1568 bio->bi_rw = WRITE | do_sync;
1565 bio->bi_private = r1_bio; 1569 bio->bi_private = r1_bio;
1566 r1_bio->bios[i] = bio; 1570 r1_bio->bios[i] = bio;
1567 generic_make_request(bio); 1571 generic_make_request(bio);
@@ -1593,6 +1597,7 @@ static void raid1d(mddev_t *mddev)
1593 (unsigned long long)r1_bio->sector); 1597 (unsigned long long)r1_bio->sector);
1594 raid_end_bio_io(r1_bio); 1598 raid_end_bio_io(r1_bio);
1595 } else { 1599 } else {
1600 const int do_sync = bio_sync(r1_bio->master_bio);
1596 r1_bio->bios[r1_bio->read_disk] = 1601 r1_bio->bios[r1_bio->read_disk] =
1597 mddev->ro ? IO_BLOCKED : NULL; 1602 mddev->ro ? IO_BLOCKED : NULL;
1598 r1_bio->read_disk = disk; 1603 r1_bio->read_disk = disk;
@@ -1608,7 +1613,7 @@ static void raid1d(mddev_t *mddev)
1608 bio->bi_sector = r1_bio->sector + rdev->data_offset; 1613 bio->bi_sector = r1_bio->sector + rdev->data_offset;
1609 bio->bi_bdev = rdev->bdev; 1614 bio->bi_bdev = rdev->bdev;
1610 bio->bi_end_io = raid1_end_read_request; 1615 bio->bi_end_io = raid1_end_read_request;
1611 bio->bi_rw = READ; 1616 bio->bi_rw = READ | do_sync;
1612 bio->bi_private = r1_bio; 1617 bio->bi_private = r1_bio;
1613 unplug = 1; 1618 unplug = 1;
1614 generic_make_request(bio); 1619 generic_make_request(bio);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index f0141910bb8d..a9401c017e35 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -782,6 +782,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
782 int i; 782 int i;
783 int chunk_sects = conf->chunk_mask + 1; 783 int chunk_sects = conf->chunk_mask + 1;
784 const int rw = bio_data_dir(bio); 784 const int rw = bio_data_dir(bio);
785 const int do_sync = bio_sync(bio);
785 struct bio_list bl; 786 struct bio_list bl;
786 unsigned long flags; 787 unsigned long flags;
787 788
@@ -863,7 +864,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
863 mirror->rdev->data_offset; 864 mirror->rdev->data_offset;
864 read_bio->bi_bdev = mirror->rdev->bdev; 865 read_bio->bi_bdev = mirror->rdev->bdev;
865 read_bio->bi_end_io = raid10_end_read_request; 866 read_bio->bi_end_io = raid10_end_read_request;
866 read_bio->bi_rw = READ; 867 read_bio->bi_rw = READ | do_sync;
867 read_bio->bi_private = r10_bio; 868 read_bio->bi_private = r10_bio;
868 869
869 generic_make_request(read_bio); 870 generic_make_request(read_bio);
@@ -909,7 +910,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
909 conf->mirrors[d].rdev->data_offset; 910 conf->mirrors[d].rdev->data_offset;
910 mbio->bi_bdev = conf->mirrors[d].rdev->bdev; 911 mbio->bi_bdev = conf->mirrors[d].rdev->bdev;
911 mbio->bi_end_io = raid10_end_write_request; 912 mbio->bi_end_io = raid10_end_write_request;
912 mbio->bi_rw = WRITE; 913 mbio->bi_rw = WRITE | do_sync;
913 mbio->bi_private = r10_bio; 914 mbio->bi_private = r10_bio;
914 915
915 atomic_inc(&r10_bio->remaining); 916 atomic_inc(&r10_bio->remaining);
@@ -922,6 +923,9 @@ static int make_request(request_queue_t *q, struct bio * bio)
922 blk_plug_device(mddev->queue); 923 blk_plug_device(mddev->queue);
923 spin_unlock_irqrestore(&conf->device_lock, flags); 924 spin_unlock_irqrestore(&conf->device_lock, flags);
924 925
926 if (do_sync)
927 md_wakeup_thread(mddev->thread);
928
925 return 0; 929 return 0;
926} 930}
927 931
@@ -1563,6 +1567,7 @@ static void raid10d(mddev_t *mddev)
1563 (unsigned long long)r10_bio->sector); 1567 (unsigned long long)r10_bio->sector);
1564 raid_end_bio_io(r10_bio); 1568 raid_end_bio_io(r10_bio);
1565 } else { 1569 } else {
1570 const int do_sync = bio_sync(r10_bio->master_bio);
1566 rdev = conf->mirrors[mirror].rdev; 1571 rdev = conf->mirrors[mirror].rdev;
1567 if (printk_ratelimit()) 1572 if (printk_ratelimit())
1568 printk(KERN_ERR "raid10: %s: redirecting sector %llu to" 1573 printk(KERN_ERR "raid10: %s: redirecting sector %llu to"
@@ -1574,7 +1579,7 @@ static void raid10d(mddev_t *mddev)
1574 bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr 1579 bio->bi_sector = r10_bio->devs[r10_bio->read_slot].addr
1575 + rdev->data_offset; 1580 + rdev->data_offset;
1576 bio->bi_bdev = rdev->bdev; 1581 bio->bi_bdev = rdev->bdev;
1577 bio->bi_rw = READ; 1582 bio->bi_rw = READ | do_sync;
1578 bio->bi_private = r10_bio; 1583 bio->bi_private = r10_bio;
1579 bio->bi_end_io = raid10_end_read_request; 1584 bio->bi_end_io = raid10_end_read_request;
1580 unplug = 1; 1585 unplug = 1;
diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c
index 08a33c33f6ed..aa152f31851e 100644
--- a/drivers/mmc/at91_mci.c
+++ b/drivers/mmc/at91_mci.c
@@ -768,7 +768,7 @@ static irqreturn_t at91_mmc_det_irq(int irq, void *_host)
768 return IRQ_HANDLED; 768 return IRQ_HANDLED;
769} 769}
770 770
771int at91_mci_get_ro(struct mmc_host *mmc) 771static int at91_mci_get_ro(struct mmc_host *mmc)
772{ 772{
773 int read_only = 0; 773 int read_only = 0;
774 struct at91mci_host *host = mmc_priv(mmc); 774 struct at91mci_host *host = mmc_priv(mmc);
@@ -794,7 +794,7 @@ static const struct mmc_host_ops at91_mci_ops = {
794/* 794/*
795 * Probe for the device 795 * Probe for the device
796 */ 796 */
797static int at91_mci_probe(struct platform_device *pdev) 797static int __init at91_mci_probe(struct platform_device *pdev)
798{ 798{
799 struct mmc_host *mmc; 799 struct mmc_host *mmc;
800 struct at91mci_host *host; 800 struct at91mci_host *host;
@@ -910,7 +910,7 @@ static int at91_mci_probe(struct platform_device *pdev)
910/* 910/*
911 * Remove a device 911 * Remove a device
912 */ 912 */
913static int at91_mci_remove(struct platform_device *pdev) 913static int __exit at91_mci_remove(struct platform_device *pdev)
914{ 914{
915 struct mmc_host *mmc = platform_get_drvdata(pdev); 915 struct mmc_host *mmc = platform_get_drvdata(pdev);
916 struct at91mci_host *host; 916 struct at91mci_host *host;
@@ -972,8 +972,7 @@ static int at91_mci_resume(struct platform_device *pdev)
972#endif 972#endif
973 973
974static struct platform_driver at91_mci_driver = { 974static struct platform_driver at91_mci_driver = {
975 .probe = at91_mci_probe, 975 .remove = __exit_p(at91_mci_remove),
976 .remove = at91_mci_remove,
977 .suspend = at91_mci_suspend, 976 .suspend = at91_mci_suspend,
978 .resume = at91_mci_resume, 977 .resume = at91_mci_resume,
979 .driver = { 978 .driver = {
@@ -984,7 +983,7 @@ static struct platform_driver at91_mci_driver = {
984 983
985static int __init at91_mci_init(void) 984static int __init at91_mci_init(void)
986{ 985{
987 return platform_driver_register(&at91_mci_driver); 986 return platform_driver_probe(&at91_mci_driver, at91_mci_probe);
988} 987}
989 988
990static void __exit at91_mci_exit(void) 989static void __exit at91_mci_exit(void)
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index e9b80e920266..ccfe6561be24 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -42,6 +42,8 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
42{ 42{
43 writel(0, host->base + MMCICOMMAND); 43 writel(0, host->base + MMCICOMMAND);
44 44
45 BUG_ON(host->data);
46
45 host->mrq = NULL; 47 host->mrq = NULL;
46 host->cmd = NULL; 48 host->cmd = NULL;
47 49
@@ -198,6 +200,8 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
198 } 200 }
199 201
200 if (!cmd->data || cmd->error != MMC_ERR_NONE) { 202 if (!cmd->data || cmd->error != MMC_ERR_NONE) {
203 if (host->data)
204 mmci_stop_data(host);
201 mmci_request_end(host, cmd->mrq); 205 mmci_request_end(host, cmd->mrq);
202 } else if (!(cmd->data->flags & MMC_DATA_READ)) { 206 } else if (!(cmd->data->flags & MMC_DATA_READ)) {
203 mmci_start_data(host, cmd->data); 207 mmci_start_data(host, cmd->data);
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c
index 435d331e772a..9488408308fb 100644
--- a/drivers/mmc/omap.c
+++ b/drivers/mmc/omap.c
@@ -581,9 +581,9 @@ static void mmc_omap_switch_timer(unsigned long arg)
581 schedule_work(&host->switch_work); 581 schedule_work(&host->switch_work);
582} 582}
583 583
584static void mmc_omap_switch_handler(void *data) 584static void mmc_omap_switch_handler(struct work_struct *work)
585{ 585{
586 struct mmc_omap_host *host = (struct mmc_omap_host *) data; 586 struct mmc_omap_host *host = container_of(work, struct mmc_omap_host, switch_work);
587 struct mmc_card *card; 587 struct mmc_card *card;
588 static int complained = 0; 588 static int complained = 0;
589 int cards = 0, cover_open; 589 int cards = 0, cover_open;
@@ -1116,7 +1116,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
1116 platform_set_drvdata(pdev, host); 1116 platform_set_drvdata(pdev, host);
1117 1117
1118 if (host->switch_pin >= 0) { 1118 if (host->switch_pin >= 0) {
1119 INIT_WORK(&host->switch_work, mmc_omap_switch_handler, host); 1119 INIT_WORK(&host->switch_work, mmc_omap_switch_handler);
1120 init_timer(&host->switch_timer); 1120 init_timer(&host->switch_timer);
1121 host->switch_timer.function = mmc_omap_switch_timer; 1121 host->switch_timer.function = mmc_omap_switch_timer;
1122 host->switch_timer.data = (unsigned long) host; 1122 host->switch_timer.data = (unsigned long) host;
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index ada5e9b9988c..ca5acc4736df 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -57,8 +57,8 @@
57 57
58#define DRV_MODULE_NAME "bnx2" 58#define DRV_MODULE_NAME "bnx2"
59#define PFX DRV_MODULE_NAME ": " 59#define PFX DRV_MODULE_NAME ": "
60#define DRV_MODULE_VERSION "1.5.2" 60#define DRV_MODULE_VERSION "1.5.3"
61#define DRV_MODULE_RELDATE "December 13, 2006" 61#define DRV_MODULE_RELDATE "January 8, 2007"
62 62
63#define RUN_AT(x) (jiffies + (x)) 63#define RUN_AT(x) (jiffies + (x))
64 64
@@ -1345,8 +1345,6 @@ bnx2_init_copper_phy(struct bnx2 *bp)
1345{ 1345{
1346 u32 val; 1346 u32 val;
1347 1347
1348 bp->phy_flags |= PHY_CRC_FIX_FLAG;
1349
1350 if (bp->phy_flags & PHY_CRC_FIX_FLAG) { 1348 if (bp->phy_flags & PHY_CRC_FIX_FLAG) {
1351 bnx2_write_phy(bp, 0x18, 0x0c00); 1349 bnx2_write_phy(bp, 0x18, 0x0c00);
1352 bnx2_write_phy(bp, 0x17, 0x000a); 1350 bnx2_write_phy(bp, 0x17, 0x000a);
@@ -3085,7 +3083,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3085 int buf_size) 3083 int buf_size)
3086{ 3084{
3087 u32 written, offset32, len32; 3085 u32 written, offset32, len32;
3088 u8 *buf, start[4], end[4], *flash_buffer = NULL; 3086 u8 *buf, start[4], end[4], *align_buf = NULL, *flash_buffer = NULL;
3089 int rc = 0; 3087 int rc = 0;
3090 int align_start, align_end; 3088 int align_start, align_end;
3091 3089
@@ -3113,16 +3111,17 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3113 } 3111 }
3114 3112
3115 if (align_start || align_end) { 3113 if (align_start || align_end) {
3116 buf = kmalloc(len32, GFP_KERNEL); 3114 align_buf = kmalloc(len32, GFP_KERNEL);
3117 if (buf == NULL) 3115 if (align_buf == NULL)
3118 return -ENOMEM; 3116 return -ENOMEM;
3119 if (align_start) { 3117 if (align_start) {
3120 memcpy(buf, start, 4); 3118 memcpy(align_buf, start, 4);
3121 } 3119 }
3122 if (align_end) { 3120 if (align_end) {
3123 memcpy(buf + len32 - 4, end, 4); 3121 memcpy(align_buf + len32 - 4, end, 4);
3124 } 3122 }
3125 memcpy(buf + align_start, data_buf, buf_size); 3123 memcpy(align_buf + align_start, data_buf, buf_size);
3124 buf = align_buf;
3126 } 3125 }
3127 3126
3128 if (bp->flash_info->buffered == 0) { 3127 if (bp->flash_info->buffered == 0) {
@@ -3256,11 +3255,8 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
3256 } 3255 }
3257 3256
3258nvram_write_end: 3257nvram_write_end:
3259 if (bp->flash_info->buffered == 0) 3258 kfree(flash_buffer);
3260 kfree(flash_buffer); 3259 kfree(align_buf);
3261
3262 if (align_start || align_end)
3263 kfree(buf);
3264 return rc; 3260 return rc;
3265} 3261}
3266 3262
@@ -5645,6 +5641,44 @@ poll_bnx2(struct net_device *dev)
5645} 5641}
5646#endif 5642#endif
5647 5643
5644static void __devinit
5645bnx2_get_5709_media(struct bnx2 *bp)
5646{
5647 u32 val = REG_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);
5648 u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID;
5649 u32 strap;
5650
5651 if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C)
5652 return;
5653 else if (bond_id == BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_S) {
5654 bp->phy_flags |= PHY_SERDES_FLAG;
5655 return;
5656 }
5657
5658 if (val & BNX2_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE)
5659 strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21;
5660 else
5661 strap = (val & BNX2_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8;
5662
5663 if (PCI_FUNC(bp->pdev->devfn) == 0) {
5664 switch (strap) {
5665 case 0x4:
5666 case 0x5:
5667 case 0x6:
5668 bp->phy_flags |= PHY_SERDES_FLAG;
5669 return;
5670 }
5671 } else {
5672 switch (strap) {
5673 case 0x1:
5674 case 0x2:
5675 case 0x4:
5676 bp->phy_flags |= PHY_SERDES_FLAG;
5677 return;
5678 }
5679 }
5680}
5681
5648static int __devinit 5682static int __devinit
5649bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) 5683bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5650{ 5684{
@@ -5865,10 +5899,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5865 bp->phy_addr = 1; 5899 bp->phy_addr = 1;
5866 5900
5867 /* Disable WOL support if we are running on a SERDES chip. */ 5901 /* Disable WOL support if we are running on a SERDES chip. */
5868 if (CHIP_NUM(bp) == CHIP_NUM_5709) { 5902 if (CHIP_NUM(bp) == CHIP_NUM_5709)
5869 if (CHIP_BOND_ID(bp) != BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID_C) 5903 bnx2_get_5709_media(bp);
5870 bp->phy_flags |= PHY_SERDES_FLAG; 5904 else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT)
5871 } else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT)
5872 bp->phy_flags |= PHY_SERDES_FLAG; 5905 bp->phy_flags |= PHY_SERDES_FLAG;
5873 5906
5874 if (bp->phy_flags & PHY_SERDES_FLAG) { 5907 if (bp->phy_flags & PHY_SERDES_FLAG) {
@@ -5880,7 +5913,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5880 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G) 5913 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)
5881 bp->phy_flags |= PHY_2_5G_CAPABLE_FLAG; 5914 bp->phy_flags |= PHY_2_5G_CAPABLE_FLAG;
5882 } 5915 }
5883 } 5916 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
5917 CHIP_NUM(bp) == CHIP_NUM_5708)
5918 bp->phy_flags |= PHY_CRC_FIX_FLAG;
5884 5919
5885 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || 5920 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
5886 (CHIP_ID(bp) == CHIP_ID_5708_B0) || 5921 (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
diff --git a/drivers/net/chelsio/my3126.c b/drivers/net/chelsio/my3126.c
index c7731b6f9de3..82fed1dd5005 100644
--- a/drivers/net/chelsio/my3126.c
+++ b/drivers/net/chelsio/my3126.c
@@ -170,9 +170,10 @@ static struct cphy *my3126_phy_create(adapter_t *adapter,
170{ 170{
171 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL); 171 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
172 172
173 if (cphy) 173 if (!cphy)
174 cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); 174 return NULL;
175 175
176 cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
176 INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll); 177 INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
177 cphy->bmsr = 0; 178 cphy->bmsr = 0;
178 179
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4c1ff752048c..c6259c7127f6 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -995,12 +995,6 @@ e1000_probe(struct pci_dev *pdev,
995 (adapter->hw.mac_type != e1000_82547)) 995 (adapter->hw.mac_type != e1000_82547))
996 netdev->features |= NETIF_F_TSO; 996 netdev->features |= NETIF_F_TSO;
997 997
998#ifdef CONFIG_DEBUG_SLAB
999 /* 82544's work arounds do not play nicely with DEBUG SLAB */
1000 if (adapter->hw.mac_type == e1000_82544)
1001 netdev->features &= ~NETIF_F_TSO;
1002#endif
1003
1004#ifdef NETIF_F_TSO6 998#ifdef NETIF_F_TSO6
1005 if (adapter->hw.mac_type > e1000_82547_rev_2) 999 if (adapter->hw.mac_type > e1000_82547_rev_2)
1006 netdev->features |= NETIF_F_TSO6; 1000 netdev->features |= NETIF_F_TSO6;
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 2f48fe9a29a7..93f2b7a22160 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -234,6 +234,7 @@ enum {
234#define NVREG_XMITCTL_HOST_SEMA_MASK 0x0000f000 234#define NVREG_XMITCTL_HOST_SEMA_MASK 0x0000f000
235#define NVREG_XMITCTL_HOST_SEMA_ACQ 0x0000f000 235#define NVREG_XMITCTL_HOST_SEMA_ACQ 0x0000f000
236#define NVREG_XMITCTL_HOST_LOADED 0x00004000 236#define NVREG_XMITCTL_HOST_LOADED 0x00004000
237#define NVREG_XMITCTL_TX_PATH_EN 0x01000000
237 NvRegTransmitterStatus = 0x088, 238 NvRegTransmitterStatus = 0x088,
238#define NVREG_XMITSTAT_BUSY 0x01 239#define NVREG_XMITSTAT_BUSY 0x01
239 240
@@ -249,6 +250,7 @@ enum {
249#define NVREG_OFFLOAD_NORMAL RX_NIC_BUFSIZE 250#define NVREG_OFFLOAD_NORMAL RX_NIC_BUFSIZE
250 NvRegReceiverControl = 0x094, 251 NvRegReceiverControl = 0x094,
251#define NVREG_RCVCTL_START 0x01 252#define NVREG_RCVCTL_START 0x01
253#define NVREG_RCVCTL_RX_PATH_EN 0x01000000
252 NvRegReceiverStatus = 0x98, 254 NvRegReceiverStatus = 0x98,
253#define NVREG_RCVSTAT_BUSY 0x01 255#define NVREG_RCVSTAT_BUSY 0x01
254 256
@@ -1169,16 +1171,21 @@ static void nv_start_rx(struct net_device *dev)
1169{ 1171{
1170 struct fe_priv *np = netdev_priv(dev); 1172 struct fe_priv *np = netdev_priv(dev);
1171 u8 __iomem *base = get_hwbase(dev); 1173 u8 __iomem *base = get_hwbase(dev);
1174 u32 rx_ctrl = readl(base + NvRegReceiverControl);
1172 1175
1173 dprintk(KERN_DEBUG "%s: nv_start_rx\n", dev->name); 1176 dprintk(KERN_DEBUG "%s: nv_start_rx\n", dev->name);
1174 /* Already running? Stop it. */ 1177 /* Already running? Stop it. */
1175 if (readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) { 1178 if ((readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) && !np->mac_in_use) {
1176 writel(0, base + NvRegReceiverControl); 1179 rx_ctrl &= ~NVREG_RCVCTL_START;
1180 writel(rx_ctrl, base + NvRegReceiverControl);
1177 pci_push(base); 1181 pci_push(base);
1178 } 1182 }
1179 writel(np->linkspeed, base + NvRegLinkSpeed); 1183 writel(np->linkspeed, base + NvRegLinkSpeed);
1180 pci_push(base); 1184 pci_push(base);
1181 writel(NVREG_RCVCTL_START, base + NvRegReceiverControl); 1185 rx_ctrl |= NVREG_RCVCTL_START;
1186 if (np->mac_in_use)
1187 rx_ctrl &= ~NVREG_RCVCTL_RX_PATH_EN;
1188 writel(rx_ctrl, base + NvRegReceiverControl);
1182 dprintk(KERN_DEBUG "%s: nv_start_rx to duplex %d, speed 0x%08x.\n", 1189 dprintk(KERN_DEBUG "%s: nv_start_rx to duplex %d, speed 0x%08x.\n",
1183 dev->name, np->duplex, np->linkspeed); 1190 dev->name, np->duplex, np->linkspeed);
1184 pci_push(base); 1191 pci_push(base);
@@ -1186,39 +1193,59 @@ static void nv_start_rx(struct net_device *dev)
1186 1193
1187static void nv_stop_rx(struct net_device *dev) 1194static void nv_stop_rx(struct net_device *dev)
1188{ 1195{
1196 struct fe_priv *np = netdev_priv(dev);
1189 u8 __iomem *base = get_hwbase(dev); 1197 u8 __iomem *base = get_hwbase(dev);
1198 u32 rx_ctrl = readl(base + NvRegReceiverControl);
1190 1199
1191 dprintk(KERN_DEBUG "%s: nv_stop_rx\n", dev->name); 1200 dprintk(KERN_DEBUG "%s: nv_stop_rx\n", dev->name);
1192 writel(0, base + NvRegReceiverControl); 1201 if (!np->mac_in_use)
1202 rx_ctrl &= ~NVREG_RCVCTL_START;
1203 else
1204 rx_ctrl |= NVREG_RCVCTL_RX_PATH_EN;
1205 writel(rx_ctrl, base + NvRegReceiverControl);
1193 reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0, 1206 reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
1194 NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX, 1207 NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
1195 KERN_INFO "nv_stop_rx: ReceiverStatus remained busy"); 1208 KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
1196 1209
1197 udelay(NV_RXSTOP_DELAY2); 1210 udelay(NV_RXSTOP_DELAY2);
1198 writel(0, base + NvRegLinkSpeed); 1211 if (!np->mac_in_use)
1212 writel(0, base + NvRegLinkSpeed);
1199} 1213}
1200 1214
1201static void nv_start_tx(struct net_device *dev) 1215static void nv_start_tx(struct net_device *dev)
1202{ 1216{
1217 struct fe_priv *np = netdev_priv(dev);
1203 u8 __iomem *base = get_hwbase(dev); 1218 u8 __iomem *base = get_hwbase(dev);
1219 u32 tx_ctrl = readl(base + NvRegTransmitterControl);
1204 1220
1205 dprintk(KERN_DEBUG "%s: nv_start_tx\n", dev->name); 1221 dprintk(KERN_DEBUG "%s: nv_start_tx\n", dev->name);
1206 writel(NVREG_XMITCTL_START, base + NvRegTransmitterControl); 1222 tx_ctrl |= NVREG_XMITCTL_START;
1223 if (np->mac_in_use)
1224 tx_ctrl &= ~NVREG_XMITCTL_TX_PATH_EN;
1225 writel(tx_ctrl, base + NvRegTransmitterControl);
1207 pci_push(base); 1226 pci_push(base);
1208} 1227}
1209 1228
1210static void nv_stop_tx(struct net_device *dev) 1229static void nv_stop_tx(struct net_device *dev)
1211{ 1230{
1231 struct fe_priv *np = netdev_priv(dev);
1212 u8 __iomem *base = get_hwbase(dev); 1232 u8 __iomem *base = get_hwbase(dev);
1233 u32 tx_ctrl = readl(base + NvRegTransmitterControl);
1213 1234
1214 dprintk(KERN_DEBUG "%s: nv_stop_tx\n", dev->name); 1235 dprintk(KERN_DEBUG "%s: nv_stop_tx\n", dev->name);
1215 writel(0, base + NvRegTransmitterControl); 1236 if (!np->mac_in_use)
1237 tx_ctrl &= ~NVREG_XMITCTL_START;
1238 else
1239 tx_ctrl |= NVREG_XMITCTL_TX_PATH_EN;
1240 writel(tx_ctrl, base + NvRegTransmitterControl);
1216 reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0, 1241 reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0,
1217 NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX, 1242 NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX,
1218 KERN_INFO "nv_stop_tx: TransmitterStatus remained busy"); 1243 KERN_INFO "nv_stop_tx: TransmitterStatus remained busy");
1219 1244
1220 udelay(NV_TXSTOP_DELAY2); 1245 udelay(NV_TXSTOP_DELAY2);
1221 writel(readl(base + NvRegTransmitPoll) & NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); 1246 if (!np->mac_in_use)
1247 writel(readl(base + NvRegTransmitPoll) & NVREG_TRANSMITPOLL_MAC_ADDR_REV,
1248 base + NvRegTransmitPoll);
1222} 1249}
1223 1250
1224static void nv_txrx_reset(struct net_device *dev) 1251static void nv_txrx_reset(struct net_device *dev)
@@ -4148,20 +4175,6 @@ static int nv_mgmt_acquire_sema(struct net_device *dev)
4148 return 0; 4175 return 0;
4149} 4176}
4150 4177
4151/* Indicate to mgmt unit whether driver is loaded or not */
4152static void nv_mgmt_driver_loaded(struct net_device *dev, int loaded)
4153{
4154 u8 __iomem *base = get_hwbase(dev);
4155 u32 tx_ctrl;
4156
4157 tx_ctrl = readl(base + NvRegTransmitterControl);
4158 if (loaded)
4159 tx_ctrl |= NVREG_XMITCTL_HOST_LOADED;
4160 else
4161 tx_ctrl &= ~NVREG_XMITCTL_HOST_LOADED;
4162 writel(tx_ctrl, base + NvRegTransmitterControl);
4163}
4164
4165static int nv_open(struct net_device *dev) 4178static int nv_open(struct net_device *dev)
4166{ 4179{
4167 struct fe_priv *np = netdev_priv(dev); 4180 struct fe_priv *np = netdev_priv(dev);
@@ -4659,33 +4672,24 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
4659 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); 4672 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
4660 4673
4661 if (id->driver_data & DEV_HAS_MGMT_UNIT) { 4674 if (id->driver_data & DEV_HAS_MGMT_UNIT) {
4662 writel(0x1, base + 0x204); pci_push(base);
4663 msleep(500);
4664 /* management unit running on the mac? */ 4675 /* management unit running on the mac? */
4665 np->mac_in_use = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_ST; 4676 if (readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_PHY_INIT) {
4666 if (np->mac_in_use) { 4677 np->mac_in_use = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_ST;
4667 u32 mgmt_sync; 4678 dprintk(KERN_INFO "%s: mgmt unit is running. mac in use %x.\n", pci_name(pci_dev), np->mac_in_use);
4668 /* management unit setup the phy already? */ 4679 for (i = 0; i < 5000; i++) {
4669 mgmt_sync = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK; 4680 msleep(1);
4670 if (mgmt_sync == NVREG_XMITCTL_SYNC_NOT_READY) { 4681 if (nv_mgmt_acquire_sema(dev)) {
4671 if (!nv_mgmt_acquire_sema(dev)) { 4682 /* management unit setup the phy already? */
4672 for (i = 0; i < 5000; i++) { 4683 if ((readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
4673 msleep(1); 4684 NVREG_XMITCTL_SYNC_PHY_INIT) {
4674 mgmt_sync = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK; 4685 /* phy is inited by mgmt unit */
4675 if (mgmt_sync == NVREG_XMITCTL_SYNC_NOT_READY) 4686 phyinitialized = 1;
4676 continue; 4687 dprintk(KERN_INFO "%s: Phy already initialized by mgmt unit.\n", pci_name(pci_dev));
4677 if (mgmt_sync == NVREG_XMITCTL_SYNC_PHY_INIT) 4688 } else {
4678 phyinitialized = 1; 4689 /* we need to init the phy */
4679 break;
4680 } 4690 }
4681 } else { 4691 break;
4682 /* we need to init the phy */
4683 } 4692 }
4684 } else if (mgmt_sync == NVREG_XMITCTL_SYNC_PHY_INIT) {
4685 /* phy is inited by SMU */
4686 phyinitialized = 1;
4687 } else {
4688 /* we need to init the phy */
4689 } 4693 }
4690 } 4694 }
4691 } 4695 }
@@ -4724,10 +4728,12 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
4724 if (!phyinitialized) { 4728 if (!phyinitialized) {
4725 /* reset it */ 4729 /* reset it */
4726 phy_init(dev); 4730 phy_init(dev);
4727 } 4731 } else {
4728 4732 /* see if it is a gigabit phy */
4729 if (id->driver_data & DEV_HAS_MGMT_UNIT) { 4733 u32 mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
4730 nv_mgmt_driver_loaded(dev, 1); 4734 if (mii_status & PHY_GIGABIT) {
4735 np->gigabit = PHY_GIGABIT;
4736 }
4731 } 4737 }
4732 4738
4733 /* set default link speed settings */ 4739 /* set default link speed settings */
@@ -4749,8 +4755,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
4749out_error: 4755out_error:
4750 if (phystate_orig) 4756 if (phystate_orig)
4751 writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); 4757 writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
4752 if (np->mac_in_use)
4753 nv_mgmt_driver_loaded(dev, 0);
4754 pci_set_drvdata(pci_dev, NULL); 4758 pci_set_drvdata(pci_dev, NULL);
4755out_freering: 4759out_freering:
4756 free_rings(dev); 4760 free_rings(dev);
@@ -4780,9 +4784,6 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
4780 writel(np->orig_mac[0], base + NvRegMacAddrA); 4784 writel(np->orig_mac[0], base + NvRegMacAddrA);
4781 writel(np->orig_mac[1], base + NvRegMacAddrB); 4785 writel(np->orig_mac[1], base + NvRegMacAddrB);
4782 4786
4783 if (np->mac_in_use)
4784 nv_mgmt_driver_loaded(dev, 0);
4785
4786 /* free all structures */ 4787 /* free all structures */
4787 free_rings(dev); 4788 free_rings(dev);
4788 iounmap(get_hwbase(dev)); 4789 iounmap(get_hwbase(dev));
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 50ffe90488ff..f4aba4355b19 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -171,6 +171,7 @@ struct ixgb_adapter {
171 171
172 /* TX */ 172 /* TX */
173 struct ixgb_desc_ring tx_ring ____cacheline_aligned_in_smp; 173 struct ixgb_desc_ring tx_ring ____cacheline_aligned_in_smp;
174 unsigned int restart_queue;
174 unsigned long timeo_start; 175 unsigned long timeo_start;
175 uint32_t tx_cmd_type; 176 uint32_t tx_cmd_type;
176 uint64_t hw_csum_tx_good; 177 uint64_t hw_csum_tx_good;
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index cd22523fb035..82c044d6e08a 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -79,6 +79,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
79 {"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)}, 79 {"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)},
80 {"tx_deferred_ok", IXGB_STAT(stats.dc)}, 80 {"tx_deferred_ok", IXGB_STAT(stats.dc)},
81 {"tx_timeout_count", IXGB_STAT(tx_timeout_count) }, 81 {"tx_timeout_count", IXGB_STAT(tx_timeout_count) },
82 {"tx_restart_queue", IXGB_STAT(restart_queue) },
82 {"rx_long_length_errors", IXGB_STAT(stats.roc)}, 83 {"rx_long_length_errors", IXGB_STAT(stats.roc)},
83 {"rx_short_length_errors", IXGB_STAT(stats.ruc)}, 84 {"rx_short_length_errors", IXGB_STAT(stats.ruc)},
84#ifdef NETIF_F_TSO 85#ifdef NETIF_F_TSO
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 02089b64e42c..ecbf45861c68 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -399,8 +399,9 @@ ixgb_init_rx_addrs(struct ixgb_hw *hw)
399 /* Zero out the other 15 receive addresses. */ 399 /* Zero out the other 15 receive addresses. */
400 DEBUGOUT("Clearing RAR[1-15]\n"); 400 DEBUGOUT("Clearing RAR[1-15]\n");
401 for(i = 1; i < IXGB_RAR_ENTRIES; i++) { 401 for(i = 1; i < IXGB_RAR_ENTRIES; i++) {
402 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); 402 /* Write high reg first to disable the AV bit first */
403 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); 403 IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0);
404 IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0);
404 } 405 }
405 406
406 return; 407 return;
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index e628126c9c49..a083a9189230 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -36,7 +36,7 @@ static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
36#else 36#else
37#define DRIVERNAPI "-NAPI" 37#define DRIVERNAPI "-NAPI"
38#endif 38#endif
39#define DRV_VERSION "1.0.117-k2"DRIVERNAPI 39#define DRV_VERSION "1.0.126-k2"DRIVERNAPI
40char ixgb_driver_version[] = DRV_VERSION; 40char ixgb_driver_version[] = DRV_VERSION;
41static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; 41static char ixgb_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
42 42
@@ -1287,6 +1287,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1287 struct ixgb_buffer *buffer_info; 1287 struct ixgb_buffer *buffer_info;
1288 int len = skb->len; 1288 int len = skb->len;
1289 unsigned int offset = 0, size, count = 0, i; 1289 unsigned int offset = 0, size, count = 0, i;
1290 unsigned int mss = skb_shinfo(skb)->gso_size;
1290 1291
1291 unsigned int nr_frags = skb_shinfo(skb)->nr_frags; 1292 unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
1292 unsigned int f; 1293 unsigned int f;
@@ -1298,6 +1299,11 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1298 while(len) { 1299 while(len) {
1299 buffer_info = &tx_ring->buffer_info[i]; 1300 buffer_info = &tx_ring->buffer_info[i];
1300 size = min(len, IXGB_MAX_DATA_PER_TXD); 1301 size = min(len, IXGB_MAX_DATA_PER_TXD);
1302 /* Workaround for premature desc write-backs
1303 * in TSO mode. Append 4-byte sentinel desc */
1304 if (unlikely(mss && !nr_frags && size == len && size > 8))
1305 size -= 4;
1306
1301 buffer_info->length = size; 1307 buffer_info->length = size;
1302 WARN_ON(buffer_info->dma != 0); 1308 WARN_ON(buffer_info->dma != 0);
1303 buffer_info->dma = 1309 buffer_info->dma =
@@ -1324,6 +1330,13 @@ ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb,
1324 while(len) { 1330 while(len) {
1325 buffer_info = &tx_ring->buffer_info[i]; 1331 buffer_info = &tx_ring->buffer_info[i];
1326 size = min(len, IXGB_MAX_DATA_PER_TXD); 1332 size = min(len, IXGB_MAX_DATA_PER_TXD);
1333
1334 /* Workaround for premature desc write-backs
1335 * in TSO mode. Append 4-byte sentinel desc */
1336 if (unlikely(mss && !nr_frags && size == len
1337 && size > 8))
1338 size -= 4;
1339
1327 buffer_info->length = size; 1340 buffer_info->length = size;
1328 buffer_info->dma = 1341 buffer_info->dma =
1329 pci_map_page(adapter->pdev, 1342 pci_map_page(adapter->pdev,
@@ -1398,11 +1411,43 @@ ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags)
1398 IXGB_WRITE_REG(&adapter->hw, TDT, i); 1411 IXGB_WRITE_REG(&adapter->hw, TDT, i);
1399} 1412}
1400 1413
1414static int __ixgb_maybe_stop_tx(struct net_device *netdev, int size)
1415{
1416 struct ixgb_adapter *adapter = netdev_priv(netdev);
1417 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring;
1418
1419 netif_stop_queue(netdev);
1420 /* Herbert's original patch had:
1421 * smp_mb__after_netif_stop_queue();
1422 * but since that doesn't exist yet, just open code it. */
1423 smp_mb();
1424
1425 /* We need to check again in a case another CPU has just
1426 * made room available. */
1427 if (likely(IXGB_DESC_UNUSED(tx_ring) < size))
1428 return -EBUSY;
1429
1430 /* A reprieve! */
1431 netif_start_queue(netdev);
1432 ++adapter->restart_queue;
1433 return 0;
1434}
1435
1436static int ixgb_maybe_stop_tx(struct net_device *netdev,
1437 struct ixgb_desc_ring *tx_ring, int size)
1438{
1439 if (likely(IXGB_DESC_UNUSED(tx_ring) >= size))
1440 return 0;
1441 return __ixgb_maybe_stop_tx(netdev, size);
1442}
1443
1444
1401/* Tx Descriptors needed, worst case */ 1445/* Tx Descriptors needed, worst case */
1402#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \ 1446#define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
1403 (((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0)) 1447 (((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
1404#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \ 1448#define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) /* skb->date */ + \
1405 MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 1449 MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 /* for context */ \
1450 + 1 /* one more needed for sentinel TSO workaround */
1406 1451
1407static int 1452static int
1408ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) 1453ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -1430,7 +1475,8 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1430 spin_lock_irqsave(&adapter->tx_lock, flags); 1475 spin_lock_irqsave(&adapter->tx_lock, flags);
1431#endif 1476#endif
1432 1477
1433 if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { 1478 if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring,
1479 DESC_NEEDED))) {
1434 netif_stop_queue(netdev); 1480 netif_stop_queue(netdev);
1435 spin_unlock_irqrestore(&adapter->tx_lock, flags); 1481 spin_unlock_irqrestore(&adapter->tx_lock, flags);
1436 return NETDEV_TX_BUSY; 1482 return NETDEV_TX_BUSY;
@@ -1468,8 +1514,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1468 1514
1469#ifdef NETIF_F_LLTX 1515#ifdef NETIF_F_LLTX
1470 /* Make sure there is space in the ring for the next send. */ 1516 /* Make sure there is space in the ring for the next send. */
1471 if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) 1517 ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED);
1472 netif_stop_queue(netdev);
1473 1518
1474 spin_unlock_irqrestore(&adapter->tx_lock, flags); 1519 spin_unlock_irqrestore(&adapter->tx_lock, flags);
1475 1520
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 794cc61819dd..448bf4a78016 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -281,7 +281,6 @@ static int tc574_probe(struct pcmcia_device *link)
281 link->conf.Attributes = CONF_ENABLE_IRQ; 281 link->conf.Attributes = CONF_ENABLE_IRQ;
282 link->conf.IntType = INT_MEMORY_AND_IO; 282 link->conf.IntType = INT_MEMORY_AND_IO;
283 link->conf.ConfigIndex = 1; 283 link->conf.ConfigIndex = 1;
284 link->conf.Present = PRESENT_OPTION;
285 284
286 /* The EL3-specific entries in the device structure. */ 285 /* The EL3-specific entries in the device structure. */
287 dev->hard_start_xmit = &el3_start_xmit; 286 dev->hard_start_xmit = &el3_start_xmit;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 1e73ff7d5d8e..342f4062de0b 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -195,7 +195,6 @@ static int tc589_probe(struct pcmcia_device *link)
195 link->conf.Attributes = CONF_ENABLE_IRQ; 195 link->conf.Attributes = CONF_ENABLE_IRQ;
196 link->conf.IntType = INT_MEMORY_AND_IO; 196 link->conf.IntType = INT_MEMORY_AND_IO;
197 link->conf.ConfigIndex = 1; 197 link->conf.ConfigIndex = 1;
198 link->conf.Present = PRESENT_OPTION;
199 198
200 /* The EL3-specific entries in the device structure. */ 199 /* The EL3-specific entries in the device structure. */
201 SET_MODULE_OWNER(dev); 200 SET_MODULE_OWNER(dev);
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 91f65e91cd5f..0d1c7a41c9c6 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -173,7 +173,6 @@ static int com20020_probe(struct pcmcia_device *p_dev)
173 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID; 173 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
174 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 174 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
175 p_dev->conf.IntType = INT_MEMORY_AND_IO; 175 p_dev->conf.IntType = INT_MEMORY_AND_IO;
176 p_dev->conf.Present = PRESENT_OPTION;
177 176
178 p_dev->irq.Instance = info->dev = dev; 177 p_dev->irq.Instance = info->dev = dev;
179 p_dev->priv = info; 178 p_dev->priv = info;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 2b1238e2dbdb..d88e9b2e93cf 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1617,6 +1617,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1617 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), 1617 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
1618 PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), 1618 PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2),
1619 PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), 1619 PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2),
1620 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "(CG-LAPCCTXD)", 0x5261440f, 0x73ec0d88),
1620 PCMCIA_DEVICE_PROD_ID12("CouplerlessPCMCIA", "100BASE", 0xee5af0ad, 0x7c2add04), 1621 PCMCIA_DEVICE_PROD_ID12("CouplerlessPCMCIA", "100BASE", 0xee5af0ad, 0x7c2add04),
1621 PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-010", 0x77008979, 0x9d8d445d), 1622 PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-010", 0x77008979, 0x9d8d445d),
1622 PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-110E 10/100M LAN Card", 0x77008979, 0xfd184814), 1623 PCMCIA_DEVICE_PROD_ID12("CyQ've", "ELA-110E 10/100M LAN Card", 0x77008979, 0xfd184814),
@@ -1667,6 +1668,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1667 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TX", 0x88fcdeda, 0x6d772737), 1668 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TX", 0x88fcdeda, 0x6d772737),
1668 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TE", 0x88fcdeda, 0x0e714bee), 1669 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN100TE", 0x88fcdeda, 0x0e714bee),
1669 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN20T", 0x88fcdeda, 0x81090922), 1670 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN20T", 0x88fcdeda, 0x81090922),
1671 PCMCIA_DEVICE_PROD_ID12("Logitec", "LPM-LN10TE", 0x88fcdeda, 0xc1e2521c),
1670 PCMCIA_DEVICE_PROD_ID12("LONGSHINE", "PCMCIA Ethernet Card", 0xf866b0b0, 0x6f6652e0), 1672 PCMCIA_DEVICE_PROD_ID12("LONGSHINE", "PCMCIA Ethernet Card", 0xf866b0b0, 0x6f6652e0),
1671 PCMCIA_DEVICE_PROD_ID12("MACNICA", "ME1-JEIDA", 0x20841b68, 0xaf8a3578), 1673 PCMCIA_DEVICE_PROD_ID12("MACNICA", "ME1-JEIDA", 0x20841b68, 0xaf8a3578),
1672 PCMCIA_DEVICE_PROD_ID12("Macsense", "MPC-10", 0xd830297f, 0xd265c307), 1674 PCMCIA_DEVICE_PROD_ID12("Macsense", "MPC-10", 0xd830297f, 0xd265c307),
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 8478dca3d8d1..5879e7c36988 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -576,7 +576,6 @@ xirc2ps_probe(struct pcmcia_device *link)
576 link->conf.Attributes = CONF_ENABLE_IRQ; 576 link->conf.Attributes = CONF_ENABLE_IRQ;
577 link->conf.IntType = INT_MEMORY_AND_IO; 577 link->conf.IntType = INT_MEMORY_AND_IO;
578 link->conf.ConfigIndex = 1; 578 link->conf.ConfigIndex = 1;
579 link->conf.Present = PRESENT_OPTION;
580 link->irq.Handler = xirc2ps_interrupt; 579 link->irq.Handler = xirc2ps_interrupt;
581 link->irq.Instance = dev; 580 link->irq.Instance = dev;
582 581
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index d79d141a601d..8844c20eac2d 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -208,6 +208,15 @@ static void ql_write_common_reg(struct ql3_adapter *qdev,
208 return; 208 return;
209} 209}
210 210
211static void ql_write_nvram_reg(struct ql3_adapter *qdev,
212 u32 __iomem *reg, u32 value)
213{
214 writel(value, reg);
215 readl(reg);
216 udelay(1);
217 return;
218}
219
211static void ql_write_page0_reg(struct ql3_adapter *qdev, 220static void ql_write_page0_reg(struct ql3_adapter *qdev,
212 u32 __iomem *reg, u32 value) 221 u32 __iomem *reg, u32 value)
213{ 222{
@@ -336,9 +345,9 @@ static void fm93c56a_select(struct ql3_adapter *qdev)
336 qdev->mem_map_registers; 345 qdev->mem_map_registers;
337 346
338 qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1; 347 qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
339 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 348 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
340 ISP_NVRAM_MASK | qdev->eeprom_cmd_data); 349 ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
341 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 350 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
342 ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data)); 351 ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
343} 352}
344 353
@@ -355,14 +364,14 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
355 qdev->mem_map_registers; 364 qdev->mem_map_registers;
356 365
357 /* Clock in a zero, then do the start bit */ 366 /* Clock in a zero, then do the start bit */
358 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 367 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
359 ISP_NVRAM_MASK | qdev->eeprom_cmd_data | 368 ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
360 AUBURN_EEPROM_DO_1); 369 AUBURN_EEPROM_DO_1);
361 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 370 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
362 ISP_NVRAM_MASK | qdev-> 371 ISP_NVRAM_MASK | qdev->
363 eeprom_cmd_data | AUBURN_EEPROM_DO_1 | 372 eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
364 AUBURN_EEPROM_CLK_RISE); 373 AUBURN_EEPROM_CLK_RISE);
365 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 374 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
366 ISP_NVRAM_MASK | qdev-> 375 ISP_NVRAM_MASK | qdev->
367 eeprom_cmd_data | AUBURN_EEPROM_DO_1 | 376 eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
368 AUBURN_EEPROM_CLK_FALL); 377 AUBURN_EEPROM_CLK_FALL);
@@ -378,20 +387,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
378 * If the bit changed, then change the DO state to 387 * If the bit changed, then change the DO state to
379 * match 388 * match
380 */ 389 */
381 ql_write_common_reg(qdev, 390 ql_write_nvram_reg(qdev,
382 &port_regs->CommonRegs. 391 &port_regs->CommonRegs.
383 serialPortInterfaceReg, 392 serialPortInterfaceReg,
384 ISP_NVRAM_MASK | qdev-> 393 ISP_NVRAM_MASK | qdev->
385 eeprom_cmd_data | dataBit); 394 eeprom_cmd_data | dataBit);
386 previousBit = dataBit; 395 previousBit = dataBit;
387 } 396 }
388 ql_write_common_reg(qdev, 397 ql_write_nvram_reg(qdev,
389 &port_regs->CommonRegs. 398 &port_regs->CommonRegs.
390 serialPortInterfaceReg, 399 serialPortInterfaceReg,
391 ISP_NVRAM_MASK | qdev-> 400 ISP_NVRAM_MASK | qdev->
392 eeprom_cmd_data | dataBit | 401 eeprom_cmd_data | dataBit |
393 AUBURN_EEPROM_CLK_RISE); 402 AUBURN_EEPROM_CLK_RISE);
394 ql_write_common_reg(qdev, 403 ql_write_nvram_reg(qdev,
395 &port_regs->CommonRegs. 404 &port_regs->CommonRegs.
396 serialPortInterfaceReg, 405 serialPortInterfaceReg,
397 ISP_NVRAM_MASK | qdev-> 406 ISP_NVRAM_MASK | qdev->
@@ -412,20 +421,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
412 * If the bit changed, then change the DO state to 421 * If the bit changed, then change the DO state to
413 * match 422 * match
414 */ 423 */
415 ql_write_common_reg(qdev, 424 ql_write_nvram_reg(qdev,
416 &port_regs->CommonRegs. 425 &port_regs->CommonRegs.
417 serialPortInterfaceReg, 426 serialPortInterfaceReg,
418 ISP_NVRAM_MASK | qdev-> 427 ISP_NVRAM_MASK | qdev->
419 eeprom_cmd_data | dataBit); 428 eeprom_cmd_data | dataBit);
420 previousBit = dataBit; 429 previousBit = dataBit;
421 } 430 }
422 ql_write_common_reg(qdev, 431 ql_write_nvram_reg(qdev,
423 &port_regs->CommonRegs. 432 &port_regs->CommonRegs.
424 serialPortInterfaceReg, 433 serialPortInterfaceReg,
425 ISP_NVRAM_MASK | qdev-> 434 ISP_NVRAM_MASK | qdev->
426 eeprom_cmd_data | dataBit | 435 eeprom_cmd_data | dataBit |
427 AUBURN_EEPROM_CLK_RISE); 436 AUBURN_EEPROM_CLK_RISE);
428 ql_write_common_reg(qdev, 437 ql_write_nvram_reg(qdev,
429 &port_regs->CommonRegs. 438 &port_regs->CommonRegs.
430 serialPortInterfaceReg, 439 serialPortInterfaceReg,
431 ISP_NVRAM_MASK | qdev-> 440 ISP_NVRAM_MASK | qdev->
@@ -443,7 +452,7 @@ static void fm93c56a_deselect(struct ql3_adapter *qdev)
443 struct ql3xxx_port_registers __iomem *port_regs = 452 struct ql3xxx_port_registers __iomem *port_regs =
444 qdev->mem_map_registers; 453 qdev->mem_map_registers;
445 qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_0; 454 qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_0;
446 ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, 455 ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
447 ISP_NVRAM_MASK | qdev->eeprom_cmd_data); 456 ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
448} 457}
449 458
@@ -461,12 +470,12 @@ static void fm93c56a_datain(struct ql3_adapter *qdev, unsigned short *value)
461 /* Read the data bits */ 470 /* Read the data bits */
462 /* The first bit is a dummy. Clock right over it. */ 471 /* The first bit is a dummy. Clock right over it. */
463 for (i = 0; i < dataBits; i++) { 472 for (i = 0; i < dataBits; i++) {
464 ql_write_common_reg(qdev, 473 ql_write_nvram_reg(qdev,
465 &port_regs->CommonRegs. 474 &port_regs->CommonRegs.
466 serialPortInterfaceReg, 475 serialPortInterfaceReg,
467 ISP_NVRAM_MASK | qdev->eeprom_cmd_data | 476 ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
468 AUBURN_EEPROM_CLK_RISE); 477 AUBURN_EEPROM_CLK_RISE);
469 ql_write_common_reg(qdev, 478 ql_write_nvram_reg(qdev,
470 &port_regs->CommonRegs. 479 &port_regs->CommonRegs.
471 serialPortInterfaceReg, 480 serialPortInterfaceReg,
472 ISP_NVRAM_MASK | qdev->eeprom_cmd_data | 481 ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
@@ -3370,7 +3379,6 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
3370 SET_MODULE_OWNER(ndev); 3379 SET_MODULE_OWNER(ndev);
3371 SET_NETDEV_DEV(ndev, &pdev->dev); 3380 SET_NETDEV_DEV(ndev, &pdev->dev);
3372 3381
3373 ndev->features = NETIF_F_LLTX;
3374 if (pci_using_dac) 3382 if (pci_using_dac)
3375 ndev->features |= NETIF_F_HIGHDMA; 3383 ndev->features |= NETIF_F_HIGHDMA;
3376 3384
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4056ba1ff3c7..f4bf62c2a7a5 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.71" 71#define DRV_MODULE_VERSION "3.72"
72#define DRV_MODULE_RELDATE "December 15, 2006" 72#define DRV_MODULE_RELDATE "January 8, 2007"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -1015,7 +1015,12 @@ out:
1015 else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) { 1015 else if (tp->tg3_flags2 & TG3_FLG2_PHY_JITTER_BUG) {
1016 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); 1016 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
1017 tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a); 1017 tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
1018 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x010b); 1018 if (tp->tg3_flags2 & TG3_FLG2_PHY_ADJUST_TRIM) {
1019 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x110b);
1020 tg3_writephy(tp, MII_TG3_TEST1,
1021 MII_TG3_TEST1_TRIM_EN | 0x4);
1022 } else
1023 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x010b);
1019 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400); 1024 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
1020 } 1025 }
1021 /* Set Extended packet length bit (bit 14) on all chips that */ 1026 /* Set Extended packet length bit (bit 14) on all chips that */
@@ -10803,9 +10808,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10803 10808
10804 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) { 10809 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
10805 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 10810 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10806 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 10811 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
10807 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG; 10812 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG;
10808 else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) 10813 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M)
10814 tp->tg3_flags2 |= TG3_FLG2_PHY_ADJUST_TRIM;
10815 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)
10809 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 10816 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
10810 } 10817 }
10811 10818
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index cf78a7e5997b..80f59ac7ec58 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1658,6 +1658,9 @@
1658#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ 1658#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */
1659#define MII_TG3_EPHY_SHADOW_EN 0x80 1659#define MII_TG3_EPHY_SHADOW_EN 0x80
1660 1660
1661#define MII_TG3_TEST1 0x1e
1662#define MII_TG3_TEST1_TRIM_EN 0x0010
1663
1661/* There are two ways to manage the TX descriptors on the tigon3. 1664/* There are two ways to manage the TX descriptors on the tigon3.
1662 * Either the descriptors are in host DMA'able memory, or they 1665 * Either the descriptors are in host DMA'able memory, or they
1663 * exist only in the cards on-chip SRAM. All 16 send bds are under 1666 * exist only in the cards on-chip SRAM. All 16 send bds are under
@@ -2256,6 +2259,7 @@ struct tg3 {
2256#define TG3_FLG2_1SHOT_MSI 0x10000000 2259#define TG3_FLG2_1SHOT_MSI 0x10000000
2257#define TG3_FLG2_PHY_JITTER_BUG 0x20000000 2260#define TG3_FLG2_PHY_JITTER_BUG 0x20000000
2258#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000 2261#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
2262#define TG3_FLG2_PHY_ADJUST_TRIM 0x80000000
2259 2263
2260 u32 split_mode_max_reqs; 2264 u32 split_mode_max_reqs;
2261#define SPLIT_MODE_5704_MAX_REQ 3 2265#define SPLIT_MODE_5704_MAX_REQ 3
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 0e94fbbf7a94..b85857a84870 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2664,7 +2664,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
2664 break; 2664 break;
2665 } 2665 }
2666#endif 2666#endif
2667 if (stats.len < sizeof(u->rx_data.header)) 2667 if (stats.len < sizeof(struct ieee80211_hdr_3addr))
2668 break; 2668 break;
2669 switch (WLAN_FC_GET_TYPE(u->rx_data.header.frame_ctl)) { 2669 switch (WLAN_FC_GET_TYPE(u->rx_data.header.frame_ctl)) {
2670 case IEEE80211_FTYPE_MGMT: 2670 case IEEE80211_FTYPE_MGMT:
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 644b4741ef74..a009ab517710 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -406,7 +406,6 @@ static int netwave_probe(struct pcmcia_device *link)
406 link->conf.Attributes = CONF_ENABLE_IRQ; 406 link->conf.Attributes = CONF_ENABLE_IRQ;
407 link->conf.IntType = INT_MEMORY_AND_IO; 407 link->conf.IntType = INT_MEMORY_AND_IO;
408 link->conf.ConfigIndex = 1; 408 link->conf.ConfigIndex = 1;
409 link->conf.Present = PRESENT_OPTION;
410 409
411 /* Netwave private struct init. link/dev/node already taken care of, 410 /* Netwave private struct init. link/dev/node already taken care of,
412 * other stuff zero'd - Jean II */ 411 * other stuff zero'd - Jean II */
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 88e10c9bc4ac..47b2ccb6a633 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -331,7 +331,6 @@ static int ray_probe(struct pcmcia_device *p_dev)
331 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 331 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
332 p_dev->conf.IntType = INT_MEMORY_AND_IO; 332 p_dev->conf.IntType = INT_MEMORY_AND_IO;
333 p_dev->conf.ConfigIndex = 1; 333 p_dev->conf.ConfigIndex = 1;
334 p_dev->conf.Present = PRESENT_OPTION;
335 334
336 p_dev->priv = dev; 335 p_dev->priv = dev;
337 p_dev->irq.Instance = dev; 336 p_dev->irq.Instance = dev;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 583e0d655a98..c250f08c8dd5 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1928,7 +1928,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1928 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1928 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
1929 p_dev->conf.IntType = INT_MEMORY_AND_IO; 1929 p_dev->conf.IntType = INT_MEMORY_AND_IO;
1930 p_dev->conf.ConfigIndex = 1; 1930 p_dev->conf.ConfigIndex = 1;
1931 p_dev->conf.Present = PRESENT_OPTION;
1932 1931
1933 dev = alloc_etherdev(sizeof(struct wl3501_card)); 1932 dev = alloc_etherdev(sizeof(struct wl3501_card));
1934 if (!dev) 1933 if (!dev)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6bfb942428e4..206c834d263a 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -254,7 +254,8 @@ static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap)
254 if ((cap & mask) == ht_cap) 254 if ((cap & mask) == ht_cap)
255 return pos; 255 return pos;
256 256
257 pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn, pos, 257 pos = __pci_find_next_cap_ttl(dev->bus, dev->devfn,
258 pos + PCI_CAP_LIST_NEXT,
258 PCI_CAP_ID_HT, &ttl); 259 PCI_CAP_ID_HT, &ttl);
259 } 260 }
260 261
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 8f0322d6f3bf..0a70943f8bb6 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -955,7 +955,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_ho
955 * becomes necessary to do this tweak in two steps -- I've chosen the Host 955 * becomes necessary to do this tweak in two steps -- I've chosen the Host
956 * bridge as trigger. 956 * bridge as trigger.
957 */ 957 */
958static int __initdata asus_hides_smbus; 958static int asus_hides_smbus;
959 959
960static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) 960static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
961{ 961{
@@ -1117,10 +1117,11 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_h
1117static void quirk_sis_96x_smbus(struct pci_dev *dev) 1117static void quirk_sis_96x_smbus(struct pci_dev *dev)
1118{ 1118{
1119 u8 val = 0; 1119 u8 val = 0;
1120 printk(KERN_INFO "Enabling SiS 96x SMBus.\n");
1121 pci_read_config_byte(dev, 0x77, &val);
1122 pci_write_config_byte(dev, 0x77, val & ~0x10);
1123 pci_read_config_byte(dev, 0x77, &val); 1120 pci_read_config_byte(dev, 0x77, &val);
1121 if (val & 0x10) {
1122 printk(KERN_INFO "Enabling SiS 96x SMBus.\n");
1123 pci_write_config_byte(dev, 0x77, val & ~0x10);
1124 }
1124} 1125}
1125 1126
1126/* 1127/*
@@ -1152,11 +1153,12 @@ static void quirk_sis_503(struct pci_dev *dev)
1152 printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible); 1153 printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible);
1153 1154
1154 /* 1155 /*
1155 * Ok, it now shows up as a 96x.. The 96x quirks are after 1156 * Ok, it now shows up as a 96x.. run the 96x quirk by
1156 * the 503 quirk in the quirk table, so they'll automatically 1157 * hand in case it has already been processed.
1157 * run and enable things like the SMBus device 1158 * (depends on link order, which is apparently not guaranteed)
1158 */ 1159 */
1159 dev->device = devid; 1160 dev->device = devid;
1161 quirk_sis_96x_smbus(dev);
1160} 1162}
1161 1163
1162static void __init quirk_sis_96x_compatible(struct pci_dev *dev) 1164static void __init quirk_sis_96x_compatible(struct pci_dev *dev)
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 72ba1a70f35f..e9e0934380b8 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
264 unsigned int tmp; 264 unsigned int tmp;
265 265
266 tmp = readb(rtc->regbase + RCR1); 266 tmp = readb(rtc->regbase + RCR1);
267 seq_printf(seq, "alarm_IRQ\t: %s\n",
268 (tmp & RCR1_AIE) ? "yes" : "no");
269 seq_printf(seq, "carry_IRQ\t: %s\n", 267 seq_printf(seq, "carry_IRQ\t: %s\n",
270 (tmp & RCR1_CIE) ? "yes" : "no"); 268 (tmp & RCR1_CIE) ? "yes" : "no");
271 269
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
428 tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */ 426 tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
429 tm->tm_year = 0xffff; 427 tm->tm_year = 0xffff;
430 428
429 wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
430
431 spin_unlock_irq(&rtc->lock); 431 spin_unlock_irq(&rtc->lock);
432 432
433 return 0; 433 return 0;
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 1678b6c757ec..a420cd099041 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -117,7 +117,7 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
117 return -ENOMEM; 117 return -ENOMEM;
118 } 118 }
119 debug_text_event(vmcp_debug, 1, cmd); 119 debug_text_event(vmcp_debug, 1, cmd);
120 session->resp_size = __cpcmd(cmd, session->response, 120 session->resp_size = cpcmd(cmd, session->response,
121 session->bufsize, 121 session->bufsize,
122 &session->resp_code); 122 &session->resp_code);
123 up(&session->mutex); 123 up(&session->mutex);
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index b471ac4a1bf6..ae1bf231d089 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -880,19 +880,15 @@ static void cio_reset_pgm_check_handler(void)
880static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr) 880static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr)
881{ 881{
882 int rc; 882 int rc;
883 register struct subchannel_id reg1 asm ("1") = schid;
884 883
885 pgm_check_occured = 0; 884 pgm_check_occured = 0;
886 s390_reset_pgm_handler = cio_reset_pgm_check_handler; 885 s390_reset_pgm_handler = cio_reset_pgm_check_handler;
886 rc = stsch(schid, addr);
887 s390_reset_pgm_handler = NULL;
887 888
888 asm volatile( 889 /* The program check handler could have changed pgm_check_occured */
889 " stsch 0(%2)\n" 890 barrier();
890 " ipm %0\n"
891 " srl %0,28"
892 : "=d" (rc)
893 : "d" (reg1), "a" (addr), "m" (*addr) : "memory", "cc");
894 891
895 s390_reset_pgm_handler = NULL;
896 if (pgm_check_occured) 892 if (pgm_check_occured)
897 return -EIO; 893 return -EIO;
898 else 894 else
diff --git a/drivers/s390/net/Kconfig b/drivers/s390/net/Kconfig
index 1a93fa684e9f..52625153a4f0 100644
--- a/drivers/s390/net/Kconfig
+++ b/drivers/s390/net/Kconfig
@@ -27,10 +27,7 @@ config IUCV
27 help 27 help
28 Select this option if you want to use inter-user communication 28 Select this option if you want to use inter-user communication
29 under VM or VIF. If unsure, say "Y" to enable a fast communication 29 under VM or VIF. If unsure, say "Y" to enable a fast communication
30 link between VM guests. At boot time the user ID of the guest needs 30 link between VM guests.
31 to be passed to the kernel. Note that both kernels need to be
32 compiled with this option and both need to be booted with the user ID
33 of the other VM guest.
34 31
35config NETIUCV 32config NETIUCV
36 tristate "IUCV network device support (VM only)" 33 tristate "IUCV network device support (VM only)"
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 53c358c7d368..e95c281f1e36 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -710,7 +710,7 @@ struct qeth_reply {
710 int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long); 710 int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long);
711 u32 seqno; 711 u32 seqno;
712 unsigned long offset; 712 unsigned long offset;
713 int received; 713 atomic_t received;
714 int rc; 714 int rc;
715 void *param; 715 void *param;
716 struct qeth_card *card; 716 struct qeth_card *card;
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 2bde4f1fb9c2..d2efa5ff125d 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -471,7 +471,7 @@ qeth_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
471 channel->state == CH_STATE_UP) 471 channel->state == CH_STATE_UP)
472 qeth_issue_next_read(card); 472 qeth_issue_next_read(card);
473 473
474 tasklet_schedule(&channel->irq_tasklet); 474 qeth_irq_tasklet((unsigned long)channel);
475 return; 475 return;
476out: 476out:
477 wake_up(&card->wait_q); 477 wake_up(&card->wait_q);
@@ -951,40 +951,6 @@ qeth_do_run_thread(struct qeth_card *card, unsigned long thread)
951} 951}
952 952
953static int 953static int
954qeth_register_ip_addresses(void *ptr)
955{
956 struct qeth_card *card;
957
958 card = (struct qeth_card *) ptr;
959 daemonize("qeth_reg_ip");
960 QETH_DBF_TEXT(trace,4,"regipth1");
961 if (!qeth_do_run_thread(card, QETH_SET_IP_THREAD))
962 return 0;
963 QETH_DBF_TEXT(trace,4,"regipth2");
964 qeth_set_ip_addr_list(card);
965 qeth_clear_thread_running_bit(card, QETH_SET_IP_THREAD);
966 return 0;
967}
968
969/*
970 * Drive the SET_PROMISC_MODE thread
971 */
972static int
973qeth_set_promisc_mode(void *ptr)
974{
975 struct qeth_card *card = (struct qeth_card *) ptr;
976
977 daemonize("qeth_setprm");
978 QETH_DBF_TEXT(trace,4,"setprm1");
979 if (!qeth_do_run_thread(card, QETH_SET_PROMISC_MODE_THREAD))
980 return 0;
981 QETH_DBF_TEXT(trace,4,"setprm2");
982 qeth_setadp_promisc_mode(card);
983 qeth_clear_thread_running_bit(card, QETH_SET_PROMISC_MODE_THREAD);
984 return 0;
985}
986
987static int
988qeth_recover(void *ptr) 954qeth_recover(void *ptr)
989{ 955{
990 struct qeth_card *card; 956 struct qeth_card *card;
@@ -1047,11 +1013,6 @@ qeth_start_kernel_thread(struct work_struct *work)
1047 if (card->read.state != CH_STATE_UP && 1013 if (card->read.state != CH_STATE_UP &&
1048 card->write.state != CH_STATE_UP) 1014 card->write.state != CH_STATE_UP)
1049 return; 1015 return;
1050
1051 if (qeth_do_start_thread(card, QETH_SET_IP_THREAD))
1052 kernel_thread(qeth_register_ip_addresses, (void *)card,SIGCHLD);
1053 if (qeth_do_start_thread(card, QETH_SET_PROMISC_MODE_THREAD))
1054 kernel_thread(qeth_set_promisc_mode, (void *)card, SIGCHLD);
1055 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) 1016 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD))
1056 kernel_thread(qeth_recover, (void *) card, SIGCHLD); 1017 kernel_thread(qeth_recover, (void *) card, SIGCHLD);
1057} 1018}
@@ -1074,7 +1035,7 @@ qeth_set_intial_options(struct qeth_card *card)
1074 card->options.layer2 = 1; 1035 card->options.layer2 = 1;
1075 else 1036 else
1076 card->options.layer2 = 0; 1037 card->options.layer2 = 0;
1077 card->options.performance_stats = 1; 1038 card->options.performance_stats = 0;
1078} 1039}
1079 1040
1080/** 1041/**
@@ -1613,8 +1574,6 @@ qeth_issue_next_read(struct qeth_card *card)
1613 return -ENOMEM; 1574 return -ENOMEM;
1614 } 1575 }
1615 qeth_setup_ccw(&card->read, iob->data, QETH_BUFSIZE); 1576 qeth_setup_ccw(&card->read, iob->data, QETH_BUFSIZE);
1616 wait_event(card->wait_q,
1617 atomic_cmpxchg(&card->read.irq_pending, 0, 1) == 0);
1618 QETH_DBF_TEXT(trace, 6, "noirqpnd"); 1577 QETH_DBF_TEXT(trace, 6, "noirqpnd");
1619 rc = ccw_device_start(card->read.ccwdev, &card->read.ccw, 1578 rc = ccw_device_start(card->read.ccwdev, &card->read.ccw,
1620 (addr_t) iob, 0, 0); 1579 (addr_t) iob, 0, 0);
@@ -1635,6 +1594,7 @@ qeth_alloc_reply(struct qeth_card *card)
1635 reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC); 1594 reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC);
1636 if (reply){ 1595 if (reply){
1637 atomic_set(&reply->refcnt, 1); 1596 atomic_set(&reply->refcnt, 1);
1597 atomic_set(&reply->received, 0);
1638 reply->card = card; 1598 reply->card = card;
1639 }; 1599 };
1640 return reply; 1600 return reply;
@@ -1655,31 +1615,6 @@ qeth_put_reply(struct qeth_reply *reply)
1655 kfree(reply); 1615 kfree(reply);
1656} 1616}
1657 1617
1658static void
1659qeth_cmd_timeout(unsigned long data)
1660{
1661 struct qeth_reply *reply, *list_reply, *r;
1662 unsigned long flags;
1663
1664 reply = (struct qeth_reply *) data;
1665 spin_lock_irqsave(&reply->card->lock, flags);
1666 list_for_each_entry_safe(list_reply, r,
1667 &reply->card->cmd_waiter_list, list) {
1668 if (reply == list_reply){
1669 qeth_get_reply(reply);
1670 list_del_init(&reply->list);
1671 spin_unlock_irqrestore(&reply->card->lock, flags);
1672 reply->rc = -ETIME;
1673 reply->received = 1;
1674 wake_up(&reply->wait_q);
1675 qeth_put_reply(reply);
1676 return;
1677 }
1678 }
1679 spin_unlock_irqrestore(&reply->card->lock, flags);
1680}
1681
1682
1683static struct qeth_ipa_cmd * 1618static struct qeth_ipa_cmd *
1684qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) 1619qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob)
1685{ 1620{
@@ -1745,7 +1680,7 @@ qeth_clear_ipacmd_list(struct qeth_card *card)
1745 list_for_each_entry_safe(reply, r, &card->cmd_waiter_list, list) { 1680 list_for_each_entry_safe(reply, r, &card->cmd_waiter_list, list) {
1746 qeth_get_reply(reply); 1681 qeth_get_reply(reply);
1747 reply->rc = -EIO; 1682 reply->rc = -EIO;
1748 reply->received = 1; 1683 atomic_inc(&reply->received);
1749 list_del_init(&reply->list); 1684 list_del_init(&reply->list);
1750 wake_up(&reply->wait_q); 1685 wake_up(&reply->wait_q);
1751 qeth_put_reply(reply); 1686 qeth_put_reply(reply);
@@ -1814,7 +1749,7 @@ qeth_send_control_data_cb(struct qeth_channel *channel,
1814 &card->cmd_waiter_list); 1749 &card->cmd_waiter_list);
1815 spin_unlock_irqrestore(&card->lock, flags); 1750 spin_unlock_irqrestore(&card->lock, flags);
1816 } else { 1751 } else {
1817 reply->received = 1; 1752 atomic_inc(&reply->received);
1818 wake_up(&reply->wait_q); 1753 wake_up(&reply->wait_q);
1819 } 1754 }
1820 qeth_put_reply(reply); 1755 qeth_put_reply(reply);
@@ -1858,7 +1793,7 @@ qeth_send_control_data(struct qeth_card *card, int len,
1858 int rc; 1793 int rc;
1859 unsigned long flags; 1794 unsigned long flags;
1860 struct qeth_reply *reply = NULL; 1795 struct qeth_reply *reply = NULL;
1861 struct timer_list timer; 1796 unsigned long timeout;
1862 1797
1863 QETH_DBF_TEXT(trace, 2, "sendctl"); 1798 QETH_DBF_TEXT(trace, 2, "sendctl");
1864 1799
@@ -1873,21 +1808,20 @@ qeth_send_control_data(struct qeth_card *card, int len,
1873 reply->seqno = QETH_IDX_COMMAND_SEQNO; 1808 reply->seqno = QETH_IDX_COMMAND_SEQNO;
1874 else 1809 else
1875 reply->seqno = card->seqno.ipa++; 1810 reply->seqno = card->seqno.ipa++;
1876 init_timer(&timer);
1877 timer.function = qeth_cmd_timeout;
1878 timer.data = (unsigned long) reply;
1879 init_waitqueue_head(&reply->wait_q); 1811 init_waitqueue_head(&reply->wait_q);
1880 spin_lock_irqsave(&card->lock, flags); 1812 spin_lock_irqsave(&card->lock, flags);
1881 list_add_tail(&reply->list, &card->cmd_waiter_list); 1813 list_add_tail(&reply->list, &card->cmd_waiter_list);
1882 spin_unlock_irqrestore(&card->lock, flags); 1814 spin_unlock_irqrestore(&card->lock, flags);
1883 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); 1815 QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN);
1884 wait_event(card->wait_q, 1816
1885 atomic_cmpxchg(&card->write.irq_pending, 0, 1) == 0); 1817 while (atomic_cmpxchg(&card->write.irq_pending, 0, 1)) ;
1886 qeth_prepare_control_data(card, len, iob); 1818 qeth_prepare_control_data(card, len, iob);
1819
1887 if (IS_IPA(iob->data)) 1820 if (IS_IPA(iob->data))
1888 timer.expires = jiffies + QETH_IPA_TIMEOUT; 1821 timeout = jiffies + QETH_IPA_TIMEOUT;
1889 else 1822 else
1890 timer.expires = jiffies + QETH_TIMEOUT; 1823 timeout = jiffies + QETH_TIMEOUT;
1824
1891 QETH_DBF_TEXT(trace, 6, "noirqpnd"); 1825 QETH_DBF_TEXT(trace, 6, "noirqpnd");
1892 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags); 1826 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags);
1893 rc = ccw_device_start(card->write.ccwdev, &card->write.ccw, 1827 rc = ccw_device_start(card->write.ccwdev, &card->write.ccw,
@@ -1906,9 +1840,16 @@ qeth_send_control_data(struct qeth_card *card, int len,
1906 wake_up(&card->wait_q); 1840 wake_up(&card->wait_q);
1907 return rc; 1841 return rc;
1908 } 1842 }
1909 add_timer(&timer); 1843 while (!atomic_read(&reply->received)) {
1910 wait_event(reply->wait_q, reply->received); 1844 if (time_after(jiffies, timeout)) {
1911 del_timer_sync(&timer); 1845 spin_lock_irqsave(&reply->card->lock, flags);
1846 list_del_init(&reply->list);
1847 spin_unlock_irqrestore(&reply->card->lock, flags);
1848 reply->rc = -ETIME;
1849 atomic_inc(&reply->received);
1850 wake_up(&reply->wait_q);
1851 }
1852 };
1912 rc = reply->rc; 1853 rc = reply->rc;
1913 qeth_put_reply(reply); 1854 qeth_put_reply(reply);
1914 return rc; 1855 return rc;
@@ -2466,32 +2407,17 @@ qeth_rebuild_skb_fake_ll(struct qeth_card *card, struct sk_buff *skb,
2466 qeth_rebuild_skb_fake_ll_eth(card, skb, hdr); 2407 qeth_rebuild_skb_fake_ll_eth(card, skb, hdr);
2467} 2408}
2468 2409
2469static inline __u16 2410static inline void
2470qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb, 2411qeth_layer2_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
2471 struct qeth_hdr *hdr) 2412 struct qeth_hdr *hdr)
2472{ 2413{
2473 unsigned short vlan_id = 0;
2474#ifdef CONFIG_QETH_VLAN
2475 struct vlan_hdr *vhdr;
2476#endif
2477
2478 skb->pkt_type = PACKET_HOST; 2414 skb->pkt_type = PACKET_HOST;
2479 skb->protocol = qeth_type_trans(skb, skb->dev); 2415 skb->protocol = qeth_type_trans(skb, skb->dev);
2480 if (card->options.checksum_type == NO_CHECKSUMMING) 2416 if (card->options.checksum_type == NO_CHECKSUMMING)
2481 skb->ip_summed = CHECKSUM_UNNECESSARY; 2417 skb->ip_summed = CHECKSUM_UNNECESSARY;
2482 else 2418 else
2483 skb->ip_summed = CHECKSUM_NONE; 2419 skb->ip_summed = CHECKSUM_NONE;
2484#ifdef CONFIG_QETH_VLAN
2485 if (hdr->hdr.l2.flags[2] & (QETH_LAYER2_FLAG_VLAN)) {
2486 vhdr = (struct vlan_hdr *) skb->data;
2487 skb->protocol =
2488 __constant_htons(vhdr->h_vlan_encapsulated_proto);
2489 vlan_id = hdr->hdr.l2.vlan_id;
2490 skb_pull(skb, VLAN_HLEN);
2491 }
2492#endif
2493 *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno; 2420 *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno;
2494 return vlan_id;
2495} 2421}
2496 2422
2497static inline __u16 2423static inline __u16
@@ -2560,7 +2486,6 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2560 int offset; 2486 int offset;
2561 int rxrc; 2487 int rxrc;
2562 __u16 vlan_tag = 0; 2488 __u16 vlan_tag = 0;
2563 __u16 *vlan_addr;
2564 2489
2565 /* get first element of current buffer */ 2490 /* get first element of current buffer */
2566 element = (struct qdio_buffer_element *)&buf->buffer->element[0]; 2491 element = (struct qdio_buffer_element *)&buf->buffer->element[0];
@@ -2571,7 +2496,7 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2571 &offset, &hdr))) { 2496 &offset, &hdr))) {
2572 skb->dev = card->dev; 2497 skb->dev = card->dev;
2573 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) 2498 if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2)
2574 vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); 2499 qeth_layer2_rebuild_skb(card, skb, hdr);
2575 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) 2500 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3)
2576 vlan_tag = qeth_rebuild_skb(card, skb, hdr); 2501 vlan_tag = qeth_rebuild_skb(card, skb, hdr);
2577 else { /*in case of OSN*/ 2502 else { /*in case of OSN*/
@@ -3968,13 +3893,22 @@ static inline struct sk_buff *
3968qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, 3893qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb,
3969 struct qeth_hdr **hdr, int ipv) 3894 struct qeth_hdr **hdr, int ipv)
3970{ 3895{
3971 struct sk_buff *new_skb; 3896 struct sk_buff *new_skb, *new_skb2;
3972 3897
3973 QETH_DBF_TEXT(trace, 6, "prepskb"); 3898 QETH_DBF_TEXT(trace, 6, "prepskb");
3974 3899 new_skb = skb;
3975 new_skb = qeth_realloc_headroom(card, skb, sizeof(struct qeth_hdr)); 3900 new_skb = qeth_pskb_unshare(skb, GFP_ATOMIC);
3976 if (new_skb == NULL) 3901 if (!new_skb)
3902 return NULL;
3903 new_skb2 = qeth_realloc_headroom(card, new_skb,
3904 sizeof(struct qeth_hdr));
3905 if (!new_skb2) {
3906 __qeth_free_new_skb(skb, new_skb);
3977 return NULL; 3907 return NULL;
3908 }
3909 if (new_skb != skb)
3910 __qeth_free_new_skb(new_skb2, new_skb);
3911 new_skb = new_skb2;
3978 *hdr = __qeth_prepare_skb(card, new_skb, ipv); 3912 *hdr = __qeth_prepare_skb(card, new_skb, ipv);
3979 if (*hdr == NULL) { 3913 if (*hdr == NULL) {
3980 __qeth_free_new_skb(skb, new_skb); 3914 __qeth_free_new_skb(skb, new_skb);
@@ -4844,9 +4778,11 @@ qeth_arp_query(struct qeth_card *card, char __user *udata)
4844 "(0x%x/%d)\n", 4778 "(0x%x/%d)\n",
4845 QETH_CARD_IFNAME(card), qeth_arp_get_error_cause(&rc), 4779 QETH_CARD_IFNAME(card), qeth_arp_get_error_cause(&rc),
4846 tmp, tmp); 4780 tmp, tmp);
4847 copy_to_user(udata, qinfo.udata, 4); 4781 if (copy_to_user(udata, qinfo.udata, 4))
4782 rc = -EFAULT;
4848 } else { 4783 } else {
4849 copy_to_user(udata, qinfo.udata, qinfo.udata_len); 4784 if (copy_to_user(udata, qinfo.udata, qinfo.udata_len))
4785 rc = -EFAULT;
4850 } 4786 }
4851 kfree(qinfo.udata); 4787 kfree(qinfo.udata);
4852 return rc; 4788 return rc;
@@ -4992,8 +4928,10 @@ qeth_snmp_command(struct qeth_card *card, char __user *udata)
4992 if (rc) 4928 if (rc)
4993 PRINT_WARN("SNMP command failed on %s: (0x%x)\n", 4929 PRINT_WARN("SNMP command failed on %s: (0x%x)\n",
4994 QETH_CARD_IFNAME(card), rc); 4930 QETH_CARD_IFNAME(card), rc);
4995 else 4931 else {
4996 copy_to_user(udata, qinfo.udata, qinfo.udata_len); 4932 if (copy_to_user(udata, qinfo.udata, qinfo.udata_len))
4933 rc = -EFAULT;
4934 }
4997 4935
4998 kfree(ureq); 4936 kfree(ureq);
4999 kfree(qinfo.udata); 4937 kfree(qinfo.udata);
@@ -5544,12 +5482,10 @@ qeth_set_multicast_list(struct net_device *dev)
5544 qeth_add_multicast_ipv6(card); 5482 qeth_add_multicast_ipv6(card);
5545#endif 5483#endif
5546out: 5484out:
5547 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 5485 qeth_set_ip_addr_list(card);
5548 schedule_work(&card->kernel_thread_starter);
5549 if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) 5486 if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
5550 return; 5487 return;
5551 if (qeth_set_thread_start_bit(card, QETH_SET_PROMISC_MODE_THREAD)==0) 5488 qeth_setadp_promisc_mode(card);
5552 schedule_work(&card->kernel_thread_starter);
5553} 5489}
5554 5490
5555static int 5491static int
@@ -6351,6 +6287,42 @@ static struct ethtool_ops qeth_ethtool_ops = {
6351}; 6287};
6352 6288
6353static int 6289static int
6290qeth_hard_header_parse(struct sk_buff *skb, unsigned char *haddr)
6291{
6292 struct qeth_card *card;
6293 struct ethhdr *eth;
6294
6295 card = qeth_get_card_from_dev(skb->dev);
6296 if (card->options.layer2)
6297 goto haveheader;
6298#ifdef CONFIG_QETH_IPV6
6299 /* cause of the manipulated arp constructor and the ARP
6300 flag for OSAE devices we have some nasty exceptions */
6301 if (card->info.type == QETH_CARD_TYPE_OSAE) {
6302 if (!card->options.fake_ll) {
6303 if ((skb->pkt_type==PACKET_OUTGOING) &&
6304 (skb->protocol==ETH_P_IPV6))
6305 goto haveheader;
6306 else
6307 return 0;
6308 } else {
6309 if ((skb->pkt_type==PACKET_OUTGOING) &&
6310 (skb->protocol==ETH_P_IP))
6311 return 0;
6312 else
6313 goto haveheader;
6314 }
6315 }
6316#endif
6317 if (!card->options.fake_ll)
6318 return 0;
6319haveheader:
6320 eth = eth_hdr(skb);
6321 memcpy(haddr, eth->h_source, ETH_ALEN);
6322 return ETH_ALEN;
6323}
6324
6325static int
6354qeth_netdev_init(struct net_device *dev) 6326qeth_netdev_init(struct net_device *dev)
6355{ 6327{
6356 struct qeth_card *card; 6328 struct qeth_card *card;
@@ -6388,7 +6360,10 @@ qeth_netdev_init(struct net_device *dev)
6388 if (card->options.fake_ll && 6360 if (card->options.fake_ll &&
6389 (qeth_get_netdev_flags(card) & IFF_NOARP)) 6361 (qeth_get_netdev_flags(card) & IFF_NOARP))
6390 dev->hard_header = qeth_fake_header; 6362 dev->hard_header = qeth_fake_header;
6391 dev->hard_header_parse = NULL; 6363 if (dev->type == ARPHRD_IEEE802_TR)
6364 dev->hard_header_parse = NULL;
6365 else
6366 dev->hard_header_parse = qeth_hard_header_parse;
6392 dev->set_mac_address = qeth_layer2_set_mac_address; 6367 dev->set_mac_address = qeth_layer2_set_mac_address;
6393 dev->flags |= qeth_get_netdev_flags(card); 6368 dev->flags |= qeth_get_netdev_flags(card);
6394 if ((card->options.fake_broadcast) || 6369 if ((card->options.fake_broadcast) ||
@@ -8235,8 +8210,7 @@ qeth_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
8235 } 8210 }
8236 if (!qeth_add_ip(card, ipaddr)) 8211 if (!qeth_add_ip(card, ipaddr))
8237 kfree(ipaddr); 8212 kfree(ipaddr);
8238 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8213 qeth_set_ip_addr_list(card);
8239 schedule_work(&card->kernel_thread_starter);
8240 return rc; 8214 return rc;
8241} 8215}
8242 8216
@@ -8264,8 +8238,7 @@ qeth_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
8264 return; 8238 return;
8265 if (!qeth_delete_ip(card, ipaddr)) 8239 if (!qeth_delete_ip(card, ipaddr))
8266 kfree(ipaddr); 8240 kfree(ipaddr);
8267 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8241 qeth_set_ip_addr_list(card);
8268 schedule_work(&card->kernel_thread_starter);
8269} 8242}
8270 8243
8271/* 8244/*
@@ -8308,8 +8281,7 @@ qeth_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
8308 } 8281 }
8309 if (!qeth_add_ip(card, ipaddr)) 8282 if (!qeth_add_ip(card, ipaddr))
8310 kfree(ipaddr); 8283 kfree(ipaddr);
8311 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8284 qeth_set_ip_addr_list(card);
8312 schedule_work(&card->kernel_thread_starter);
8313 return 0; 8285 return 0;
8314} 8286}
8315 8287
@@ -8337,8 +8309,7 @@ qeth_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
8337 return; 8309 return;
8338 if (!qeth_delete_ip(card, ipaddr)) 8310 if (!qeth_delete_ip(card, ipaddr))
8339 kfree(ipaddr); 8311 kfree(ipaddr);
8340 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8312 qeth_set_ip_addr_list(card);
8341 schedule_work(&card->kernel_thread_starter);
8342} 8313}
8343 8314
8344/** 8315/**
@@ -8380,8 +8351,7 @@ qeth_ip_event(struct notifier_block *this,
8380 default: 8351 default:
8381 break; 8352 break;
8382 } 8353 }
8383 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8354 qeth_set_ip_addr_list(card);
8384 schedule_work(&card->kernel_thread_starter);
8385out: 8355out:
8386 return NOTIFY_DONE; 8356 return NOTIFY_DONE;
8387} 8357}
@@ -8433,8 +8403,7 @@ qeth_ip6_event(struct notifier_block *this,
8433 default: 8403 default:
8434 break; 8404 break;
8435 } 8405 }
8436 if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) 8406 qeth_set_ip_addr_list(card);
8437 schedule_work(&card->kernel_thread_starter);
8438out: 8407out:
8439 return NOTIFY_DONE; 8408 return NOTIFY_DONE;
8440} 8409}
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index d72df5dae4ee..e16fe361436e 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1629,7 +1629,6 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1629 /* General socket configuration */ 1629 /* General socket configuration */
1630 link->conf.Attributes = CONF_ENABLE_IRQ; 1630 link->conf.Attributes = CONF_ENABLE_IRQ;
1631 link->conf.IntType = INT_MEMORY_AND_IO; 1631 link->conf.IntType = INT_MEMORY_AND_IO;
1632 link->conf.Present = PRESENT_OPTION;
1633 1632
1634 ret = nsp_cs_config(link); 1633 ret = nsp_cs_config(link);
1635 1634
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index fb7acea60286..9fb0ea5c1fb9 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -895,7 +895,6 @@ SYM53C500_probe(struct pcmcia_device *link)
895 link->irq.IRQInfo1 = IRQ_LEVEL_ID; 895 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
896 link->conf.Attributes = CONF_ENABLE_IRQ; 896 link->conf.Attributes = CONF_ENABLE_IRQ;
897 link->conf.IntType = INT_MEMORY_AND_IO; 897 link->conf.IntType = INT_MEMORY_AND_IO;
898 link->conf.Present = PRESENT_OPTION;
899 898
900 return SYM53C500_config(link); 899 return SYM53C500_config(link);
901} /* SYM53C500_attach */ 900} /* SYM53C500_attach */
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 51f3c739f7e1..5261f0af8b10 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2296,7 +2296,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
2296 local_irq_restore(flags); 2296 local_irq_restore(flags);
2297} 2297}
2298 2298
2299static int serial8250_console_setup(struct console *co, char *options) 2299static int __init serial8250_console_setup(struct console *co, char *options)
2300{ 2300{
2301 struct uart_port *port; 2301 struct uart_port *port;
2302 int baud = 9600; 2302 int baud = 9600;
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 9d11a75663e6..3c4b6c243712 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -789,7 +789,9 @@ static struct console mpc52xx_console = {
789static int __init 789static int __init
790mpc52xx_console_init(void) 790mpc52xx_console_init(void)
791{ 791{
792#if defined(CONFIG_PPC_MERGE)
792 mpc52xx_uart_of_enumerate(); 793 mpc52xx_uart_of_enumerate();
794#endif
793 register_console(&mpc52xx_console); 795 register_console(&mpc52xx_console);
794 return 0; 796 return 0;
795} 797}
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index c8999ae58652..2f4d303ee36f 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -170,7 +170,7 @@ config USB_SERIAL_FTDI_SIO
170 170
171config USB_SERIAL_FUNSOFT 171config USB_SERIAL_FUNSOFT
172 tristate "USB Fundamental Software Dongle Driver" 172 tristate "USB Fundamental Software Dongle Driver"
173 depends on USB_SERIAL && !(SPARC || SPARC64) 173 depends on USB_SERIAL
174 ---help--- 174 ---help---
175 Say Y here if you want to use the Fundamental Software dongle. 175 Say Y here if you want to use the Fundamental Software dongle.
176 176
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c
index d3be9214c7c1..31501c9361b9 100644
--- a/drivers/usb/serial/funsoft.c
+++ b/drivers/usb/serial/funsoft.c
@@ -32,7 +32,7 @@ static int funsoft_ioctl(struct usb_serial_port *port, struct file *file,
32 dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd); 32 dbg("%s - port %d, cmd 0x%04x", __FUNCTION__, port->number, cmd);
33 33
34 if (cmd == TCSETSF) { 34 if (cmd == TCSETSF) {
35 if (user_termios_to_kernel_termios(&t, (void __user *)arg)) 35 if (user_termios_to_kernel_termios(&t, (struct termios __user *)arg))
36 return -EFAULT; 36 return -EFAULT;
37 37
38 dbg("%s - iflag:%x oflag:%x cflag:%x lflag:%x", __FUNCTION__, 38 dbg("%s - iflag:%x oflag:%x cflag:%x lflag:%x", __FUNCTION__,
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 1715d6b5f411..8b18e43b82fe 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -411,7 +411,7 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
411 { 411 {
412 memset(bdev, 0, sizeof(*bdev)); 412 memset(bdev, 0, sizeof(*bdev));
413 mutex_init(&bdev->bd_mutex); 413 mutex_init(&bdev->bd_mutex);
414 mutex_init(&bdev->bd_mount_mutex); 414 sema_init(&bdev->bd_mount_sem, 1);
415 INIT_LIST_HEAD(&bdev->bd_inodes); 415 INIT_LIST_HEAD(&bdev->bd_inodes);
416 INIT_LIST_HEAD(&bdev->bd_list); 416 INIT_LIST_HEAD(&bdev->bd_list);
417#ifdef CONFIG_SYSFS 417#ifdef CONFIG_SYSFS
diff --git a/fs/buffer.c b/fs/buffer.c
index 263f88e4dffb..3b116078b4c3 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -180,7 +180,7 @@ int fsync_bdev(struct block_device *bdev)
180 * freeze_bdev -- lock a filesystem and force it into a consistent state 180 * freeze_bdev -- lock a filesystem and force it into a consistent state
181 * @bdev: blockdevice to lock 181 * @bdev: blockdevice to lock
182 * 182 *
183 * This takes the block device bd_mount_mutex to make sure no new mounts 183 * This takes the block device bd_mount_sem to make sure no new mounts
184 * happen on bdev until thaw_bdev() is called. 184 * happen on bdev until thaw_bdev() is called.
185 * If a superblock is found on this device, we take the s_umount semaphore 185 * If a superblock is found on this device, we take the s_umount semaphore
186 * on it to make sure nobody unmounts until the snapshot creation is done. 186 * on it to make sure nobody unmounts until the snapshot creation is done.
@@ -189,7 +189,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
189{ 189{
190 struct super_block *sb; 190 struct super_block *sb;
191 191
192 mutex_lock(&bdev->bd_mount_mutex); 192 down(&bdev->bd_mount_sem);
193 sb = get_super(bdev); 193 sb = get_super(bdev);
194 if (sb && !(sb->s_flags & MS_RDONLY)) { 194 if (sb && !(sb->s_flags & MS_RDONLY)) {
195 sb->s_frozen = SB_FREEZE_WRITE; 195 sb->s_frozen = SB_FREEZE_WRITE;
@@ -231,7 +231,7 @@ void thaw_bdev(struct block_device *bdev, struct super_block *sb)
231 drop_super(sb); 231 drop_super(sb);
232 } 232 }
233 233
234 mutex_unlock(&bdev->bd_mount_mutex); 234 up(&bdev->bd_mount_sem);
235} 235}
236EXPORT_SYMBOL(thaw_bdev); 236EXPORT_SYMBOL(thaw_bdev);
237 237
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index d14e139d2674..ee80b8a5e7bc 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -867,9 +867,9 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
867 error = -EBUSY; 867 error = -EBUSY;
868 goto error; 868 goto error;
869 } 869 }
870 mutex_lock(&sb->s_bdev->bd_mount_mutex); 870 down(&sb->s_bdev->bd_mount_sem);
871 new = sget(fs_type, test_bdev_super, set_bdev_super, sb->s_bdev); 871 new = sget(fs_type, test_bdev_super, set_bdev_super, sb->s_bdev);
872 mutex_unlock(&sb->s_bdev->bd_mount_mutex); 872 up(&sb->s_bdev->bd_mount_sem);
873 if (IS_ERR(new)) { 873 if (IS_ERR(new)) {
874 error = PTR_ERR(new); 874 error = PTR_ERR(new);
875 goto error; 875 goto error;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 0dd6be346aa7..fab20d06d936 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -315,14 +315,13 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset)
315 315
316static int nfs_release_page(struct page *page, gfp_t gfp) 316static int nfs_release_page(struct page *page, gfp_t gfp)
317{ 317{
318 /* 318 /* If PagePrivate() is set, then the page is not freeable */
319 * Avoid deadlock on nfs_wait_on_request(). 319 return 0;
320 */ 320}
321 if (!(gfp & __GFP_FS)) 321
322 return 0; 322static int nfs_launder_page(struct page *page)
323 /* Hack... Force nfs_wb_page() to write out the page */ 323{
324 SetPageDirty(page); 324 return nfs_wb_page(page->mapping->host, page);
325 return !nfs_wb_page(page->mapping->host, page);
326} 325}
327 326
328const struct address_space_operations nfs_file_aops = { 327const struct address_space_operations nfs_file_aops = {
@@ -338,6 +337,7 @@ const struct address_space_operations nfs_file_aops = {
338#ifdef CONFIG_NFS_DIRECTIO 337#ifdef CONFIG_NFS_DIRECTIO
339 .direct_IO = nfs_direct_IO, 338 .direct_IO = nfs_direct_IO,
340#endif 339#endif
340 .launder_page = nfs_launder_page,
341}; 341};
342 342
343static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, 343static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 92ea7743fe8f..b37ce33f67ea 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -47,7 +47,6 @@
47#include <linux/vmalloc.h> 47#include <linux/vmalloc.h>
48#include <linux/crash_dump.h> 48#include <linux/crash_dump.h>
49#include <linux/pid_namespace.h> 49#include <linux/pid_namespace.h>
50#include <linux/compile.h>
51#include <asm/uaccess.h> 50#include <asm/uaccess.h>
52#include <asm/pgtable.h> 51#include <asm/pgtable.h>
53#include <asm/io.h> 52#include <asm/io.h>
@@ -254,12 +253,7 @@ static int version_read_proc(char *page, char **start, off_t off,
254{ 253{
255 int len; 254 int len;
256 255
257 /* FIXED STRING! Don't touch! */ 256 len = snprintf(page, PAGE_SIZE, linux_proc_banner,
258 len = snprintf(page, PAGE_SIZE,
259 "%s version %s"
260 " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
261 " (" LINUX_COMPILER ")"
262 " %s\n",
263 utsname()->sysname, 257 utsname()->sysname,
264 utsname()->release, 258 utsname()->release,
265 utsname()->version); 259 utsname()->version);
diff --git a/fs/super.c b/fs/super.c
index f961e0307997..3e7458c2bb76 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -753,9 +753,9 @@ int get_sb_bdev(struct file_system_type *fs_type,
753 * will protect the lockfs code from trying to start a snapshot 753 * will protect the lockfs code from trying to start a snapshot
754 * while we are mounting 754 * while we are mounting
755 */ 755 */
756 mutex_lock(&bdev->bd_mount_mutex); 756 down(&bdev->bd_mount_sem);
757 s = sget(fs_type, test_bdev_super, set_bdev_super, bdev); 757 s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
758 mutex_unlock(&bdev->bd_mount_mutex); 758 up(&bdev->bd_mount_sem);
759 if (IS_ERR(s)) 759 if (IS_ERR(s))
760 goto error_s; 760 goto error_s;
761 761
diff --git a/include/asm-alpha/posix_types.h b/include/asm-alpha/posix_types.h
index c78c04a94f4e..db167413300b 100644
--- a/include/asm-alpha/posix_types.h
+++ b/include/asm-alpha/posix_types.h
@@ -49,7 +49,7 @@ typedef unsigned int __kernel_old_dev_t;
49#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 49#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
50#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 50#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
51#define __FD_ZERO(set) \ 51#define __FD_ZERO(set) \
52 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 52 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
53 53
54#else /* __GNUC__ */ 54#else /* __GNUC__ */
55 55
diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h
index 4bbd85f3ed2a..2e9469047eb1 100644
--- a/include/asm-arm/arch-iop32x/iop32x.h
+++ b/include/asm-arm/arch-iop32x/iop32x.h
@@ -19,7 +19,7 @@
19 * Peripherals that are shared between the iop32x and iop33x but 19 * Peripherals that are shared between the iop32x and iop33x but
20 * located at different addresses. 20 * located at different addresses.
21 */ 21 */
22#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c0 + (reg)) 22#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4 + (reg))
23#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) 23#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg))
24 24
25#include <asm/hardware/iop3xx.h> 25#include <asm/hardware/iop3xx.h>
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index d51049522cd0..5f531ea03059 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -357,6 +357,16 @@ extern void flush_dcache_page(struct page *);
357 357
358extern void __flush_dcache_page(struct address_space *mapping, struct page *page); 358extern void __flush_dcache_page(struct address_space *mapping, struct page *page);
359 359
360#define ARCH_HAS_FLUSH_ANON_PAGE
361static inline void flush_anon_page(struct vm_area_struct *vma,
362 struct page *page, unsigned long vmaddr)
363{
364 extern void __flush_anon_page(struct vm_area_struct *vma,
365 struct page *, unsigned long);
366 if (PageAnon(page))
367 __flush_anon_page(vma, page, vmaddr);
368}
369
360#define flush_dcache_mmap_lock(mapping) \ 370#define flush_dcache_mmap_lock(mapping) \
361 write_lock_irq(&(mapping)->tree_lock) 371 write_lock_irq(&(mapping)->tree_lock)
362#define flush_dcache_mmap_unlock(mapping) \ 372#define flush_dcache_mmap_unlock(mapping) \
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 1018a7486ab7..13ac8a4cd01f 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -168,9 +168,9 @@ extern void gpio_line_set(int line, int value);
168#define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) 168#define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
169 169
170/* General Purpose I/O */ 170/* General Purpose I/O */
171#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0004) 171#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0000)
172#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0008) 172#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0004)
173#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x000c) 173#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x0008)
174 174
175/* Timers */ 175/* Timers */
176#define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) 176#define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000)
diff --git a/include/asm-ia64/posix_types.h b/include/asm-ia64/posix_types.h
index adb62272694f..17885567b731 100644
--- a/include/asm-ia64/posix_types.h
+++ b/include/asm-ia64/posix_types.h
@@ -54,7 +54,7 @@ typedef unsigned int __kernel_old_dev_t;
54#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 54#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
55#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 55#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
56#define __FD_ZERO(set) \ 56#define __FD_ZERO(set) \
57 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 57 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
58 58
59# else /* !__GNUC__ */ 59# else /* !__GNUC__ */
60 60
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index 9b768c3b96b3..24cdcc6eaab8 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -29,31 +29,38 @@
29 */ 29 */
30__wsum csum_partial(const void *buff, int len, __wsum sum); 30__wsum csum_partial(const void *buff, int len, __wsum sum);
31 31
32__wsum __csum_partial_copy_user(const void *src, void *dst,
33 int len, __wsum sum, int *err_ptr);
34
32/* 35/*
33 * this is a new version of the above that records errors it finds in *errp, 36 * this is a new version of the above that records errors it finds in *errp,
34 * but continues and zeros the rest of the buffer. 37 * but continues and zeros the rest of the buffer.
35 */ 38 */
36__wsum csum_partial_copy_from_user(const void __user *src, 39static inline
37 void *dst, int len, 40__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
38 __wsum sum, int *errp); 41 __wsum sum, int *err_ptr)
42{
43 might_sleep();
44 return __csum_partial_copy_user((__force void *)src, dst,
45 len, sum, err_ptr);
46}
39 47
40/* 48/*
41 * Copy and checksum to user 49 * Copy and checksum to user
42 */ 50 */
43#define HAVE_CSUM_COPY_USER 51#define HAVE_CSUM_COPY_USER
44static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst, 52static inline
45 int len, __wsum sum, 53__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
46 int *err_ptr) 54 __wsum sum, int *err_ptr)
47{ 55{
48 might_sleep(); 56 might_sleep();
49 sum = csum_partial(src, len, sum); 57 if (access_ok(VERIFY_WRITE, dst, len))
50 58 return __csum_partial_copy_user(src, (__force void *)dst,
51 if (copy_to_user(dst, src, len)) { 59 len, sum, err_ptr);
60 if (len)
52 *err_ptr = -EFAULT; 61 *err_ptr = -EFAULT;
53 return (__force __wsum)-1;
54 }
55 62
56 return sum; 63 return (__force __wsum)-1; /* invalid checksum */
57} 64}
58 65
59/* 66/*
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 67657089efa7..386da82e5774 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -31,14 +31,14 @@ static inline int irq_canonicalize(int irq)
31 * functions will take over re-enabling the low-level mask. 31 * functions will take over re-enabling the low-level mask.
32 * Otherwise it will be done on return from exception. 32 * Otherwise it will be done on return from exception.
33 */ 33 */
34#define __DO_IRQ_SMTC_HOOK() \ 34#define __DO_IRQ_SMTC_HOOK(irq) \
35do { \ 35do { \
36 if (irq_hwmask[irq] & 0x0000ff00) \ 36 if (irq_hwmask[irq] & 0x0000ff00) \
37 write_c0_tccontext(read_c0_tccontext() & \ 37 write_c0_tccontext(read_c0_tccontext() & \
38 ~(irq_hwmask[irq] & 0x0000ff00)); \ 38 ~(irq_hwmask[irq] & 0x0000ff00)); \
39} while (0) 39} while (0)
40#else 40#else
41#define __DO_IRQ_SMTC_HOOK() do { } while (0) 41#define __DO_IRQ_SMTC_HOOK(irq) do { } while (0)
42#endif 42#endif
43 43
44/* 44/*
@@ -52,7 +52,7 @@ do { \
52#define do_IRQ(irq) \ 52#define do_IRQ(irq) \
53do { \ 53do { \
54 irq_enter(); \ 54 irq_enter(); \
55 __DO_IRQ_SMTC_HOOK(); \ 55 __DO_IRQ_SMTC_HOOK(irq); \
56 generic_handle_irq(irq); \ 56 generic_handle_irq(irq); \
57 irq_exit(); \ 57 irq_exit(); \
58} while (0) 58} while (0)
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index aedb0512cb04..a799dd8ef395 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -186,7 +186,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
186} 186}
187 187
188static inline void 188static inline void
189flush_anon_page(struct page *page, unsigned long vmaddr) 189flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
190{ 190{
191 if (PageAnon(page)) 191 if (PageAnon(page))
192 flush_user_dcache_page(vmaddr); 192 flush_user_dcache_page(vmaddr);
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index 709568879f73..f6fa39474846 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -11,10 +11,31 @@
11#define BUG_OPCODE .long 0x00b00b00 /* For asm */ 11#define BUG_OPCODE .long 0x00b00b00 /* For asm */
12#define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */ 12#define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */
13 13
14#ifndef __ASSEMBLY__
15
16#ifdef CONFIG_BUG 14#ifdef CONFIG_BUG
17 15
16#ifdef __ASSEMBLY__
17#ifdef CONFIG_DEBUG_BUGVERBOSE
18.macro EMIT_BUG_ENTRY addr,file,line,flags
19 .section __bug_table,"a"
205001: PPC_LONG \addr, 5002f
21 .short \line, \flags
22 .org 5001b+BUG_ENTRY_SIZE
23 .previous
24 .section .rodata,"a"
255002: .asciz "\file"
26 .previous
27.endm
28#else
29 .macro EMIT_BUG_ENTRY addr,file,line,flags
30 .section __bug_table,"a"
315001: PPC_LONG \addr
32 .short \flags
33 .org 5001b+BUG_ENTRY_SIZE
34 .previous
35.endm
36#endif /* verbose */
37
38#else /* !__ASSEMBLY__ */
18/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and 39/* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and
19 sizeof(struct bug_entry), respectively */ 40 sizeof(struct bug_entry), respectively */
20#ifdef CONFIG_DEBUG_BUGVERBOSE 41#ifdef CONFIG_DEBUG_BUGVERBOSE
@@ -91,8 +112,8 @@
91#define HAVE_ARCH_BUG 112#define HAVE_ARCH_BUG
92#define HAVE_ARCH_BUG_ON 113#define HAVE_ARCH_BUG_ON
93#define HAVE_ARCH_WARN_ON 114#define HAVE_ARCH_WARN_ON
94#endif /* CONFIG_BUG */
95#endif /* __ASSEMBLY __ */ 115#endif /* __ASSEMBLY __ */
116#endif /* CONFIG_BUG */
96 117
97#include <asm-generic/bug.h> 118#include <asm-generic/bug.h>
98 119
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 257d1cecb8c9..7a500732b671 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -252,8 +252,6 @@ struct hcall_stats {
252 unsigned long tb_total; /* total wall time (mftb) of calls. */ 252 unsigned long tb_total; /* total wall time (mftb) of calls. */
253 unsigned long purr_total; /* total cpu time (PURR) of calls. */ 253 unsigned long purr_total; /* total cpu time (PURR) of calls. */
254}; 254};
255void update_hcall_stats(unsigned long opcode, unsigned long tb_delta,
256 unsigned long purr_delta);
257#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) 255#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
258 256
259#endif /* __ASSEMBLY__ */ 257#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 4a28a850998c..4560d72fc758 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -244,6 +244,7 @@ struct mpc52xx_cdm {
244extern void __iomem * mpc52xx_find_and_map(const char *); 244extern void __iomem * mpc52xx_find_and_map(const char *);
245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node); 245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
246extern void mpc52xx_setup_cpu(void); 246extern void mpc52xx_setup_cpu(void);
247extern void mpc52xx_declare_of_platform_devices(void);
247 248
248extern void mpc52xx_init_irq(void); 249extern void mpc52xx_init_irq(void);
249extern unsigned int mpc52xx_get_irq(void); 250extern unsigned int mpc52xx_get_irq(void);
diff --git a/include/asm-powerpc/posix_types.h b/include/asm-powerpc/posix_types.h
index c6391077224f..2f2288f520be 100644
--- a/include/asm-powerpc/posix_types.h
+++ b/include/asm-powerpc/posix_types.h
@@ -60,7 +60,7 @@ typedef struct {
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) 61#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
62#define __FD_ZERO(set) \ 62#define __FD_ZERO(set) \
63 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 63 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
64 64
65#else /* __GNUC__ */ 65#else /* __GNUC__ */
66 66
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
index 5e261e1de671..5c5d02de49e9 100644
--- a/include/asm-s390/futex.h
+++ b/include/asm-s390/futex.h
@@ -4,8 +4,8 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/futex.h> 6#include <linux/futex.h>
7#include <linux/uaccess.h>
7#include <asm/errno.h> 8#include <asm/errno.h>
8#include <asm/uaccess.h>
9 9
10static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 10static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
11{ 11{
@@ -21,7 +21,9 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) 21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT; 22 return -EFAULT;
23 23
24 pagefault_disable();
24 ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval); 25 ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval);
26 pagefault_enable();
25 27
26 if (!ret) { 28 if (!ret) {
27 switch (cmp) { 29 switch (cmp) {
diff --git a/include/asm-s390/posix_types.h b/include/asm-s390/posix_types.h
index b94c98856e12..397d93fba3a7 100644
--- a/include/asm-s390/posix_types.h
+++ b/include/asm-s390/posix_types.h
@@ -104,7 +104,7 @@ static inline int __FD_ISSET(unsigned long fd, const __kernel_fd_set *fdsetp)
104 104
105#undef __FD_ZERO 105#undef __FD_ZERO
106#define __FD_ZERO(fdsetp) \ 106#define __FD_ZERO(fdsetp) \
107 ((void) memset ((__ptr_t) (fdsetp), 0, sizeof (__kernel_fd_set))) 107 ((void) memset ((void *) (fdsetp), 0, sizeof (__kernel_fd_set)))
108 108
109#endif /* __KERNEL__ */ 109#endif /* __KERNEL__ */
110 110
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 5b535eaf5309..8da9609070f4 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -7,7 +7,13 @@
7 7
8#include <asm/alternative.h> 8#include <asm/alternative.h>
9 9
10#define ADDR (*(volatile long *) addr) 10#if __GNUC__ < 4 || __GNUC_MINOR__ < 1
11/* Technically wrong, but this avoids compilation errors on some gcc
12 versions. */
13#define ADDR "=m" (*(volatile long *) addr)
14#else
15#define ADDR "+m" (*(volatile long *) addr)
16#endif
11 17
12/** 18/**
13 * set_bit - Atomically set a bit in memory 19 * set_bit - Atomically set a bit in memory
@@ -23,7 +29,7 @@ static __inline__ void set_bit(int nr, volatile void * addr)
23{ 29{
24 __asm__ __volatile__( LOCK_PREFIX 30 __asm__ __volatile__( LOCK_PREFIX
25 "btsl %1,%0" 31 "btsl %1,%0"
26 :"+m" (ADDR) 32 :ADDR
27 :"dIr" (nr) : "memory"); 33 :"dIr" (nr) : "memory");
28} 34}
29 35
@@ -40,7 +46,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
40{ 46{
41 __asm__ volatile( 47 __asm__ volatile(
42 "btsl %1,%0" 48 "btsl %1,%0"
43 :"+m" (ADDR) 49 :ADDR
44 :"dIr" (nr) : "memory"); 50 :"dIr" (nr) : "memory");
45} 51}
46 52
@@ -58,7 +64,7 @@ static __inline__ void clear_bit(int nr, volatile void * addr)
58{ 64{
59 __asm__ __volatile__( LOCK_PREFIX 65 __asm__ __volatile__( LOCK_PREFIX
60 "btrl %1,%0" 66 "btrl %1,%0"
61 :"+m" (ADDR) 67 :ADDR
62 :"dIr" (nr)); 68 :"dIr" (nr));
63} 69}
64 70
@@ -66,7 +72,7 @@ static __inline__ void __clear_bit(int nr, volatile void * addr)
66{ 72{
67 __asm__ __volatile__( 73 __asm__ __volatile__(
68 "btrl %1,%0" 74 "btrl %1,%0"
69 :"+m" (ADDR) 75 :ADDR
70 :"dIr" (nr)); 76 :"dIr" (nr));
71} 77}
72 78
@@ -86,7 +92,7 @@ static __inline__ void __change_bit(int nr, volatile void * addr)
86{ 92{
87 __asm__ __volatile__( 93 __asm__ __volatile__(
88 "btcl %1,%0" 94 "btcl %1,%0"
89 :"+m" (ADDR) 95 :ADDR
90 :"dIr" (nr)); 96 :"dIr" (nr));
91} 97}
92 98
@@ -103,7 +109,7 @@ static __inline__ void change_bit(int nr, volatile void * addr)
103{ 109{
104 __asm__ __volatile__( LOCK_PREFIX 110 __asm__ __volatile__( LOCK_PREFIX
105 "btcl %1,%0" 111 "btcl %1,%0"
106 :"+m" (ADDR) 112 :ADDR
107 :"dIr" (nr)); 113 :"dIr" (nr));
108} 114}
109 115
@@ -121,7 +127,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr)
121 127
122 __asm__ __volatile__( LOCK_PREFIX 128 __asm__ __volatile__( LOCK_PREFIX
123 "btsl %2,%1\n\tsbbl %0,%0" 129 "btsl %2,%1\n\tsbbl %0,%0"
124 :"=r" (oldbit),"+m" (ADDR) 130 :"=r" (oldbit),ADDR
125 :"dIr" (nr) : "memory"); 131 :"dIr" (nr) : "memory");
126 return oldbit; 132 return oldbit;
127} 133}
@@ -141,7 +147,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
141 147
142 __asm__( 148 __asm__(
143 "btsl %2,%1\n\tsbbl %0,%0" 149 "btsl %2,%1\n\tsbbl %0,%0"
144 :"=r" (oldbit),"+m" (ADDR) 150 :"=r" (oldbit),ADDR
145 :"dIr" (nr)); 151 :"dIr" (nr));
146 return oldbit; 152 return oldbit;
147} 153}
@@ -160,7 +166,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
160 166
161 __asm__ __volatile__( LOCK_PREFIX 167 __asm__ __volatile__( LOCK_PREFIX
162 "btrl %2,%1\n\tsbbl %0,%0" 168 "btrl %2,%1\n\tsbbl %0,%0"
163 :"=r" (oldbit),"+m" (ADDR) 169 :"=r" (oldbit),ADDR
164 :"dIr" (nr) : "memory"); 170 :"dIr" (nr) : "memory");
165 return oldbit; 171 return oldbit;
166} 172}
@@ -180,7 +186,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
180 186
181 __asm__( 187 __asm__(
182 "btrl %2,%1\n\tsbbl %0,%0" 188 "btrl %2,%1\n\tsbbl %0,%0"
183 :"=r" (oldbit),"+m" (ADDR) 189 :"=r" (oldbit),ADDR
184 :"dIr" (nr)); 190 :"dIr" (nr));
185 return oldbit; 191 return oldbit;
186} 192}
@@ -192,7 +198,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile void * addr)
192 198
193 __asm__ __volatile__( 199 __asm__ __volatile__(
194 "btcl %2,%1\n\tsbbl %0,%0" 200 "btcl %2,%1\n\tsbbl %0,%0"
195 :"=r" (oldbit),"+m" (ADDR) 201 :"=r" (oldbit),ADDR
196 :"dIr" (nr) : "memory"); 202 :"dIr" (nr) : "memory");
197 return oldbit; 203 return oldbit;
198} 204}
@@ -211,7 +217,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr)
211 217
212 __asm__ __volatile__( LOCK_PREFIX 218 __asm__ __volatile__( LOCK_PREFIX
213 "btcl %2,%1\n\tsbbl %0,%0" 219 "btcl %2,%1\n\tsbbl %0,%0"
214 :"=r" (oldbit),"+m" (ADDR) 220 :"=r" (oldbit),ADDR
215 :"dIr" (nr) : "memory"); 221 :"dIr" (nr) : "memory");
216 return oldbit; 222 return oldbit;
217} 223}
@@ -237,7 +243,7 @@ static __inline__ int variable_test_bit(int nr, volatile const void * addr)
237 __asm__ __volatile__( 243 __asm__ __volatile__(
238 "btl %2,%1\n\tsbbl %0,%0" 244 "btl %2,%1\n\tsbbl %0,%0"
239 :"=r" (oldbit) 245 :"=r" (oldbit)
240 :"m" (ADDR),"dIr" (nr)); 246 :"m" (*(volatile long *)addr),"dIr" (nr));
241 return oldbit; 247 return oldbit;
242} 248}
243 249
diff --git a/include/asm-xtensa/posix_types.h b/include/asm-xtensa/posix_types.h
index 3470b44c12ce..4ad77dda6d5f 100644
--- a/include/asm-xtensa/posix_types.h
+++ b/include/asm-xtensa/posix_types.h
@@ -60,7 +60,7 @@ typedef struct {
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) 60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) 61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
62#define __FD_ZERO(set) \ 62#define __FD_ZERO(set) \
63 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) 63 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
64 64
65#else /* __GNUC__ */ 65#else /* __GNUC__ */
66 66
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 186da813541e..1410e5330c8d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -426,6 +426,7 @@ struct address_space_operations {
426 /* migrate the contents of a page to the specified target */ 426 /* migrate the contents of a page to the specified target */
427 int (*migratepage) (struct address_space *, 427 int (*migratepage) (struct address_space *,
428 struct page *, struct page *); 428 struct page *, struct page *);
429 int (*launder_page) (struct page *);
429}; 430};
430 431
431struct backing_dev_info; 432struct backing_dev_info;
@@ -458,7 +459,7 @@ struct block_device {
458 struct inode * bd_inode; /* will die */ 459 struct inode * bd_inode; /* will die */
459 int bd_openers; 460 int bd_openers;
460 struct mutex bd_mutex; /* open/close mutex */ 461 struct mutex bd_mutex; /* open/close mutex */
461 struct mutex bd_mount_mutex; /* mount mutex */ 462 struct semaphore bd_mount_sem;
462 struct list_head bd_inodes; 463 struct list_head bd_inodes;
463 void * bd_holder; 464 void * bd_holder;
464 int bd_holders; 465 int bd_holders;
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index ca9a602cffd7..645d440807c2 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -8,7 +8,7 @@
8#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
9 9
10#ifndef ARCH_HAS_FLUSH_ANON_PAGE 10#ifndef ARCH_HAS_FLUSH_ANON_PAGE
11static inline void flush_anon_page(struct page *page, unsigned long vmaddr) 11static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
12{ 12{
13} 13}
14#endif 14#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b0c4a05a4b0c..63fb18dcac30 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -17,6 +17,9 @@
17#include <asm/byteorder.h> 17#include <asm/byteorder.h>
18#include <asm/bug.h> 18#include <asm/bug.h>
19 19
20extern const char linux_banner[];
21extern const char linux_proc_banner[];
22
20#define INT_MAX ((int)(~0U>>1)) 23#define INT_MAX ((int)(~0U>>1))
21#define INT_MIN (-INT_MAX - 1) 24#define INT_MIN (-INT_MAX - 1)
22#define UINT_MAX (~0U) 25#define UINT_MAX (~0U)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a17b147c61e7..76912231af41 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -978,7 +978,8 @@ extern int early_pfn_to_nid(unsigned long pfn);
978#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 978#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
979#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ 979#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
980extern void set_dma_reserve(unsigned long new_dma_reserve); 980extern void set_dma_reserve(unsigned long new_dma_reserve);
981extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 981extern void memmap_init_zone(unsigned long, int, unsigned long,
982 unsigned long, enum memmap_context);
982extern void setup_per_zone_pages_min(void); 983extern void setup_per_zone_pages_min(void);
983extern void mem_init(void); 984extern void mem_init(void);
984extern void show_mem(void); 985extern void show_mem(void);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index e339a7345f25..b262f47961fb 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -450,9 +450,13 @@ void build_all_zonelists(void);
450void wakeup_kswapd(struct zone *zone, int order); 450void wakeup_kswapd(struct zone *zone, int order);
451int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 451int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
452 int classzone_idx, int alloc_flags); 452 int classzone_idx, int alloc_flags);
453 453enum memmap_context {
454 MEMMAP_EARLY,
455 MEMMAP_HOTPLUG,
456};
454extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, 457extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
455 unsigned long size); 458 unsigned long size,
459 enum memmap_context context);
456 460
457#ifdef CONFIG_HAVE_MEMORY_PRESENT 461#ifdef CONFIG_HAVE_MEMORY_PRESENT
458void memory_present(int nid, unsigned long start, unsigned long end); 462void memory_present(int nid, unsigned long start, unsigned long end);
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 6b01ba297727..2f4e98b90cc0 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -25,7 +25,7 @@ enum tcp_conntrack {
25#define IP_CT_TCP_FLAG_SACK_PERM 0x02 25#define IP_CT_TCP_FLAG_SACK_PERM 0x02
26 26
27/* This sender sent FIN first */ 27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03 28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 0be235418a2f..24c8786d12e9 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -190,6 +190,7 @@ struct arpt_replace
190 190
191/* The argument to ARPT_SO_ADD_COUNTERS. */ 191/* The argument to ARPT_SO_ADD_COUNTERS. */
192#define arpt_counters_info xt_counters_info 192#define arpt_counters_info xt_counters_info
193#define arpt_counters xt_counters
193 194
194/* The argument to ARPT_SO_GET_ENTRIES. */ 195/* The argument to ARPT_SO_GET_ENTRIES. */
195struct arpt_get_entries 196struct arpt_get_entries
diff --git a/include/linux/profile.h b/include/linux/profile.h
index 5670b340c4ef..eec48f5f9348 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -15,6 +15,7 @@ extern int prof_on __read_mostly;
15#define CPU_PROFILING 1 15#define CPU_PROFILING 1
16#define SCHED_PROFILING 2 16#define SCHED_PROFILING 2
17#define SLEEP_PROFILING 3 17#define SLEEP_PROFILING 3
18#define KVM_PROFILING 4
18 19
19struct proc_dir_entry; 20struct proc_dir_entry;
20struct pt_regs; 21struct pt_regs;
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index e6af381e206d..e02d85f56e60 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -218,7 +218,7 @@ struct ieee80211_snap_hdr {
218#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) 218#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
219 219
220#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 220#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
221#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ) 221#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
222 222
223/* Authentication algorithms */ 223/* Authentication algorithms */
224#define WLAN_AUTH_OPEN 0 224#define WLAN_AUTH_OPEN 0
diff --git a/include/sound/version.h b/include/sound/version.h
index 2949b9b991b5..20f7babad514 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14rc1" 2#define CONFIG_SND_VERSION "1.0.14rc1"
3#define CONFIG_SND_DATE " (Wed Dec 20 08:11:48 2006 UTC)" 3#define CONFIG_SND_DATE " (Tue Jan 09 09:56:17 2007 UTC)"
diff --git a/init/Makefile b/init/Makefile
index 9cd871ce5784..633a268d270d 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -15,6 +15,14 @@ clean-files := ../include/linux/compile.h
15 15
16# dependencies on generated files need to be listed explicitly 16# dependencies on generated files need to be listed explicitly
17 17
18$(obj)/main.o: include/linux/compile.h
19$(obj)/version.o: include/linux/compile.h 18$(obj)/version.o: include/linux/compile.h
20 19
20# compile.h changes depending on hostname, generation number, etc,
21# so we regenerate it always.
22# mkcompile_h will make sure to only update the
23# actual file if its content has changed.
24
25include/linux/compile.h: FORCE
26 @echo ' CHK $@'
27 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
28 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(CFLAGS)"
diff --git a/init/main.c b/init/main.c
index bc27d72bbb19..8b4a7d769162 100644
--- a/init/main.c
+++ b/init/main.c
@@ -50,9 +50,7 @@
50#include <linux/buffer_head.h> 50#include <linux/buffer_head.h>
51#include <linux/debug_locks.h> 51#include <linux/debug_locks.h>
52#include <linux/lockdep.h> 52#include <linux/lockdep.h>
53#include <linux/utsrelease.h>
54#include <linux/pid_namespace.h> 53#include <linux/pid_namespace.h>
55#include <linux/compile.h>
56#include <linux/device.h> 54#include <linux/device.h>
57 55
58#include <asm/io.h> 56#include <asm/io.h>
@@ -482,12 +480,6 @@ void __init __attribute__((weak)) smp_setup_processor_id(void)
482{ 480{
483} 481}
484 482
485static const char linux_banner[] =
486 "Linux version " UTS_RELEASE
487 " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
488 " (" LINUX_COMPILER ")"
489 " " UTS_VERSION "\n";
490
491asmlinkage void __init start_kernel(void) 483asmlinkage void __init start_kernel(void)
492{ 484{
493 char * command_line; 485 char * command_line;
@@ -703,7 +695,7 @@ static void __init do_basic_setup(void)
703 do_initcalls(); 695 do_initcalls();
704} 696}
705 697
706static void do_pre_smp_initcalls(void) 698static void __init do_pre_smp_initcalls(void)
707{ 699{
708 extern int spawn_ksoftirqd(void); 700 extern int spawn_ksoftirqd(void);
709#ifdef CONFIG_SMP 701#ifdef CONFIG_SMP
diff --git a/init/version.c b/init/version.c
index 9d96d36501ca..6c01ec1cc48d 100644
--- a/init/version.c
+++ b/init/version.c
@@ -33,3 +33,13 @@ struct uts_namespace init_uts_ns = {
33 }, 33 },
34}; 34};
35EXPORT_SYMBOL_GPL(init_uts_ns); 35EXPORT_SYMBOL_GPL(init_uts_ns);
36
37/* FIXED STRINGS! Don't touch! */
38const char linux_banner[] =
39 "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
40 LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
41
42const char linux_proc_banner[] =
43 "%s version %s"
44 " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
45 " (" LINUX_COMPILER ") %s\n";
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 241064a32241..7406fe6966f9 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -204,7 +204,7 @@ int cpu_down(unsigned int cpu)
204#endif /*CONFIG_HOTPLUG_CPU*/ 204#endif /*CONFIG_HOTPLUG_CPU*/
205 205
206/* Requires cpu_add_remove_lock to be held */ 206/* Requires cpu_add_remove_lock to be held */
207static int __devinit _cpu_up(unsigned int cpu) 207static int __cpuinit _cpu_up(unsigned int cpu)
208{ 208{
209 int ret; 209 int ret;
210 void *hcpu = (void *)(long)cpu; 210 void *hcpu = (void *)(long)cpu;
@@ -239,7 +239,7 @@ out_notify:
239 return ret; 239 return ret;
240} 240}
241 241
242int __devinit cpu_up(unsigned int cpu) 242int __cpuinit cpu_up(unsigned int cpu)
243{ 243{
244 int err = 0; 244 int err = 0;
245 245
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 543ea2e5ad93..9d8c79b48823 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -176,7 +176,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
176 176
177int noirqdebug __read_mostly; 177int noirqdebug __read_mostly;
178 178
179int __init noirqdebug_setup(char *str) 179int noirqdebug_setup(char *str)
180{ 180{
181 noirqdebug = 1; 181 noirqdebug = 1;
182 printk(KERN_INFO "IRQ lockup detection disabled\n"); 182 printk(KERN_INFO "IRQ lockup detection disabled\n");
diff --git a/kernel/profile.c b/kernel/profile.c
index 11550b2290b6..a6574a18514e 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -40,7 +40,10 @@ int (*timer_hook)(struct pt_regs *) __read_mostly;
40 40
41static atomic_t *prof_buffer; 41static atomic_t *prof_buffer;
42static unsigned long prof_len, prof_shift; 42static unsigned long prof_len, prof_shift;
43
43int prof_on __read_mostly; 44int prof_on __read_mostly;
45EXPORT_SYMBOL_GPL(prof_on);
46
44static cpumask_t prof_cpu_mask = CPU_MASK_ALL; 47static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
45#ifdef CONFIG_SMP 48#ifdef CONFIG_SMP
46static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits); 49static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
@@ -52,6 +55,7 @@ static int __init profile_setup(char * str)
52{ 55{
53 static char __initdata schedstr[] = "schedule"; 56 static char __initdata schedstr[] = "schedule";
54 static char __initdata sleepstr[] = "sleep"; 57 static char __initdata sleepstr[] = "sleep";
58 static char __initdata kvmstr[] = "kvm";
55 int par; 59 int par;
56 60
57 if (!strncmp(str, sleepstr, strlen(sleepstr))) { 61 if (!strncmp(str, sleepstr, strlen(sleepstr))) {
@@ -72,6 +76,15 @@ static int __init profile_setup(char * str)
72 printk(KERN_INFO 76 printk(KERN_INFO
73 "kernel schedule profiling enabled (shift: %ld)\n", 77 "kernel schedule profiling enabled (shift: %ld)\n",
74 prof_shift); 78 prof_shift);
79 } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
80 prof_on = KVM_PROFILING;
81 if (str[strlen(kvmstr)] == ',')
82 str += strlen(kvmstr) + 1;
83 if (get_option(&str, &par))
84 prof_shift = par;
85 printk(KERN_INFO
86 "kernel KVM profiling enabled (shift: %ld)\n",
87 prof_shift);
75 } else if (get_option(&str, &par)) { 88 } else if (get_option(&str, &par)) {
76 prof_shift = par; 89 prof_shift = par;
77 prof_on = CPU_PROFILING; 90 prof_on = CPU_PROFILING;
@@ -318,6 +331,7 @@ out:
318 local_irq_restore(flags); 331 local_irq_restore(flags);
319 put_cpu(); 332 put_cpu();
320} 333}
334EXPORT_SYMBOL_GPL(profile_hits);
321 335
322static int __devinit profile_cpu_callback(struct notifier_block *info, 336static int __devinit profile_cpu_callback(struct notifier_block *info,
323 unsigned long action, void *__cpu) 337 unsigned long action, void *__cpu)
diff --git a/kernel/sched.c b/kernel/sched.c
index 3df33da0dafc..cca93cc0dd7d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6865,7 +6865,7 @@ void __init sched_init_smp(void)
6865 6865
6866 lock_cpu_hotplug(); 6866 lock_cpu_hotplug();
6867 arch_init_sched_domains(&cpu_online_map); 6867 arch_init_sched_domains(&cpu_online_map);
6868 cpus_andnot(non_isolated_cpus, cpu_online_map, cpu_isolated_map); 6868 cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
6869 if (cpus_empty(non_isolated_cpus)) 6869 if (cpus_empty(non_isolated_cpus))
6870 cpu_set(smp_processor_id(), non_isolated_cpus); 6870 cpu_set(smp_processor_id(), non_isolated_cpus);
6871 unlock_cpu_hotplug(); 6871 unlock_cpu_hotplug();
diff --git a/mm/memory.c b/mm/memory.c
index 563792f4f687..af227d26e104 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1091,7 +1091,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1091 if (pages) { 1091 if (pages) {
1092 pages[i] = page; 1092 pages[i] = page;
1093 1093
1094 flush_anon_page(page, start); 1094 flush_anon_page(vma, page, start);
1095 flush_dcache_page(page); 1095 flush_dcache_page(page);
1096 } 1096 }
1097 if (vmas) 1097 if (vmas)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 0c055a090f4d..84279127fcd3 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -67,11 +67,13 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
67 zone_type = zone - pgdat->node_zones; 67 zone_type = zone - pgdat->node_zones;
68 if (!populated_zone(zone)) { 68 if (!populated_zone(zone)) {
69 int ret = 0; 69 int ret = 0;
70 ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages); 70 ret = init_currently_empty_zone(zone, phys_start_pfn,
71 nr_pages, MEMMAP_HOTPLUG);
71 if (ret < 0) 72 if (ret < 0)
72 return ret; 73 return ret;
73 } 74 }
74 memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn); 75 memmap_init_zone(nr_pages, nid, zone_type,
76 phys_start_pfn, MEMMAP_HOTPLUG);
75 return 0; 77 return 0;
76} 78}
77 79
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a49f96b7ea43..fc5b5442e942 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1956,17 +1956,24 @@ static inline unsigned long wait_table_bits(unsigned long size)
1956 * done. Non-atomic initialization, single-pass. 1956 * done. Non-atomic initialization, single-pass.
1957 */ 1957 */
1958void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, 1958void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
1959 unsigned long start_pfn) 1959 unsigned long start_pfn, enum memmap_context context)
1960{ 1960{
1961 struct page *page; 1961 struct page *page;
1962 unsigned long end_pfn = start_pfn + size; 1962 unsigned long end_pfn = start_pfn + size;
1963 unsigned long pfn; 1963 unsigned long pfn;
1964 1964
1965 for (pfn = start_pfn; pfn < end_pfn; pfn++) { 1965 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
1966 if (!early_pfn_valid(pfn)) 1966 /*
1967 continue; 1967 * There can be holes in boot-time mem_map[]s
1968 if (!early_pfn_in_nid(pfn, nid)) 1968 * handed to this function. They do not
1969 continue; 1969 * exist on hotplugged memory.
1970 */
1971 if (context == MEMMAP_EARLY) {
1972 if (!early_pfn_valid(pfn))
1973 continue;
1974 if (!early_pfn_in_nid(pfn, nid))
1975 continue;
1976 }
1970 page = pfn_to_page(pfn); 1977 page = pfn_to_page(pfn);
1971 set_page_links(page, zone, nid, pfn); 1978 set_page_links(page, zone, nid, pfn);
1972 init_page_count(page); 1979 init_page_count(page);
@@ -1993,7 +2000,7 @@ void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
1993 2000
1994#ifndef __HAVE_ARCH_MEMMAP_INIT 2001#ifndef __HAVE_ARCH_MEMMAP_INIT
1995#define memmap_init(size, nid, zone, start_pfn) \ 2002#define memmap_init(size, nid, zone, start_pfn) \
1996 memmap_init_zone((size), (nid), (zone), (start_pfn)) 2003 memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY)
1997#endif 2004#endif
1998 2005
1999static int __cpuinit zone_batchsize(struct zone *zone) 2006static int __cpuinit zone_batchsize(struct zone *zone)
@@ -2239,7 +2246,8 @@ static __meminit void zone_pcp_init(struct zone *zone)
2239 2246
2240__meminit int init_currently_empty_zone(struct zone *zone, 2247__meminit int init_currently_empty_zone(struct zone *zone,
2241 unsigned long zone_start_pfn, 2248 unsigned long zone_start_pfn,
2242 unsigned long size) 2249 unsigned long size,
2250 enum memmap_context context)
2243{ 2251{
2244 struct pglist_data *pgdat = zone->zone_pgdat; 2252 struct pglist_data *pgdat = zone->zone_pgdat;
2245 int ret; 2253 int ret;
@@ -2683,7 +2691,8 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2683 if (!size) 2691 if (!size)
2684 continue; 2692 continue;
2685 2693
2686 ret = init_currently_empty_zone(zone, zone_start_pfn, size); 2694 ret = init_currently_empty_zone(zone, zone_start_pfn,
2695 size, MEMMAP_EARLY);
2687 BUG_ON(ret); 2696 BUG_ON(ret);
2688 zone_start_pfn += size; 2697 zone_start_pfn += size;
2689 } 2698 }
diff --git a/mm/truncate.c b/mm/truncate.c
index ecdfdcc50522..6c79ca4a1ca7 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -341,6 +341,15 @@ failed:
341 return 0; 341 return 0;
342} 342}
343 343
344static int do_launder_page(struct address_space *mapping, struct page *page)
345{
346 if (!PageDirty(page))
347 return 0;
348 if (page->mapping != mapping || mapping->a_ops->launder_page == NULL)
349 return 0;
350 return mapping->a_ops->launder_page(page);
351}
352
344/** 353/**
345 * invalidate_inode_pages2_range - remove range of pages from an address_space 354 * invalidate_inode_pages2_range - remove range of pages from an address_space
346 * @mapping: the address_space 355 * @mapping: the address_space
@@ -405,7 +414,8 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
405 PAGE_CACHE_SIZE, 0); 414 PAGE_CACHE_SIZE, 0);
406 } 415 }
407 } 416 }
408 if (!invalidate_complete_page2(mapping, page)) 417 ret = do_launder_page(mapping, page);
418 if (ret == 0 && !invalidate_complete_page2(mapping, page))
409 ret = -EIO; 419 ret = -EIO;
410 unlock_page(page); 420 unlock_page(page);
411 } 421 }
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index be04e9fb11f6..ab166b48ce8d 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -196,6 +196,9 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
196 196
197 switch (CAPIMSG_SUBCOMMAND(skb->data)) { 197 switch (CAPIMSG_SUBCOMMAND(skb->data)) {
198 case CAPI_CONF: 198 case CAPI_CONF:
199 if (skb->len < CAPI_MSG_BASELEN + 10)
200 break;
201
199 func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5); 202 func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 5);
200 info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8); 203 info = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 8);
201 204
@@ -226,6 +229,9 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
226 break; 229 break;
227 230
228 case CAPI_FUNCTION_GET_PROFILE: 231 case CAPI_FUNCTION_GET_PROFILE:
232 if (skb->len < CAPI_MSG_BASELEN + 11 + sizeof(capi_profile))
233 break;
234
229 controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 11); 235 controller = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 11);
230 msgnum = CAPIMSG_MSGID(skb->data); 236 msgnum = CAPIMSG_MSGID(skb->data);
231 237
@@ -246,17 +252,26 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
246 break; 252 break;
247 253
248 case CAPI_FUNCTION_GET_MANUFACTURER: 254 case CAPI_FUNCTION_GET_MANUFACTURER:
255 if (skb->len < CAPI_MSG_BASELEN + 15)
256 break;
257
249 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10); 258 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10);
250 259
251 if (!info && ctrl) { 260 if (!info && ctrl) {
261 int len = min_t(uint, CAPI_MANUFACTURER_LEN,
262 skb->data[CAPI_MSG_BASELEN + 14]);
263
264 memset(ctrl->manu, 0, CAPI_MANUFACTURER_LEN);
252 strncpy(ctrl->manu, 265 strncpy(ctrl->manu,
253 skb->data + CAPI_MSG_BASELEN + 15, 266 skb->data + CAPI_MSG_BASELEN + 15, len);
254 skb->data[CAPI_MSG_BASELEN + 14]);
255 } 267 }
256 268
257 break; 269 break;
258 270
259 case CAPI_FUNCTION_GET_VERSION: 271 case CAPI_FUNCTION_GET_VERSION:
272 if (skb->len < CAPI_MSG_BASELEN + 32)
273 break;
274
260 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); 275 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
261 276
262 if (!info && ctrl) { 277 if (!info && ctrl) {
@@ -269,13 +284,18 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
269 break; 284 break;
270 285
271 case CAPI_FUNCTION_GET_SERIAL_NUMBER: 286 case CAPI_FUNCTION_GET_SERIAL_NUMBER:
287 if (skb->len < CAPI_MSG_BASELEN + 17)
288 break;
289
272 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12); 290 controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
273 291
274 if (!info && ctrl) { 292 if (!info && ctrl) {
293 int len = min_t(uint, CAPI_SERIAL_LEN,
294 skb->data[CAPI_MSG_BASELEN + 16]);
295
275 memset(ctrl->serial, 0, CAPI_SERIAL_LEN); 296 memset(ctrl->serial, 0, CAPI_SERIAL_LEN);
276 strncpy(ctrl->serial, 297 strncpy(ctrl->serial,
277 skb->data + CAPI_MSG_BASELEN + 17, 298 skb->data + CAPI_MSG_BASELEN + 17, len);
278 skb->data[CAPI_MSG_BASELEN + 16]);
279 } 299 }
280 300
281 break; 301 break;
@@ -284,14 +304,18 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
284 break; 304 break;
285 305
286 case CAPI_IND: 306 case CAPI_IND:
307 if (skb->len < CAPI_MSG_BASELEN + 6)
308 break;
309
287 func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3); 310 func = CAPIMSG_U16(skb->data, CAPI_MSG_BASELEN + 3);
288 311
289 if (func == CAPI_FUNCTION_LOOPBACK) { 312 if (func == CAPI_FUNCTION_LOOPBACK) {
313 int len = min_t(uint, skb->len - CAPI_MSG_BASELEN - 6,
314 skb->data[CAPI_MSG_BASELEN + 5]);
290 appl = CAPIMSG_APPID(skb->data); 315 appl = CAPIMSG_APPID(skb->data);
291 msgnum = CAPIMSG_MSGID(skb->data); 316 msgnum = CAPIMSG_MSGID(skb->data);
292 cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, func, 317 cmtp_send_interopmsg(session, CAPI_RESP, appl, msgnum, func,
293 skb->data + CAPI_MSG_BASELEN + 6, 318 skb->data + CAPI_MSG_BASELEN + 6, len);
294 skb->data[CAPI_MSG_BASELEN + 5]);
295 } 319 }
296 320
297 break; 321 break;
@@ -309,6 +333,9 @@ void cmtp_recv_capimsg(struct cmtp_session *session, struct sk_buff *skb)
309 333
310 BT_DBG("session %p skb %p len %d", session, skb, skb->len); 334 BT_DBG("session %p skb %p len %d", session, skb, skb->len);
311 335
336 if (skb->len < CAPI_MSG_BASELEN)
337 return;
338
312 if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) { 339 if (CAPIMSG_COMMAND(skb->data) == CAPI_INTEROPERABILITY) {
313 cmtp_recv_interopmsg(session, skb); 340 cmtp_recv_interopmsg(session, skb);
314 return; 341 return;
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index d4c935692ccf..801d687ea4ef 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -242,7 +242,7 @@ static void add_conn(struct work_struct *work)
242 struct hci_conn *conn = container_of(work, struct hci_conn, work); 242 struct hci_conn *conn = container_of(work, struct hci_conn, work);
243 int i; 243 int i;
244 244
245 if (device_register(&conn->dev) < 0) { 245 if (device_add(&conn->dev) < 0) {
246 BT_ERR("Failed to register connection device"); 246 BT_ERR("Failed to register connection device");
247 return; 247 return;
248 } 248 }
@@ -272,6 +272,8 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
272 272
273 dev_set_drvdata(&conn->dev, conn); 273 dev_set_drvdata(&conn->dev, conn);
274 274
275 device_initialize(&conn->dev);
276
275 INIT_WORK(&conn->work, add_conn); 277 INIT_WORK(&conn->work, add_conn);
276 278
277 schedule_work(&conn->work); 279 schedule_work(&conn->work);
@@ -287,6 +289,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
287{ 289{
288 BT_DBG("conn %p", conn); 290 BT_DBG("conn %p", conn);
289 291
292 if (!device_is_registered(&conn->dev))
293 return;
294
290 INIT_WORK(&conn->work, del_conn); 295 INIT_WORK(&conn->work, del_conn);
291 296
292 schedule_work(&conn->work); 297 schedule_work(&conn->work);
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 544d65b7baa7..cb7e855f0828 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -557,7 +557,6 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
557 struct sock *sk = sock->sk; 557 struct sock *sk = sock->sk;
558 struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc; 558 struct rfcomm_dlc *d = rfcomm_pi(sk)->dlc;
559 struct sk_buff *skb; 559 struct sk_buff *skb;
560 int err;
561 int sent = 0; 560 int sent = 0;
562 561
563 if (msg->msg_flags & MSG_OOB) 562 if (msg->msg_flags & MSG_OOB)
@@ -572,6 +571,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
572 571
573 while (len) { 572 while (len) {
574 size_t size = min_t(size_t, len, d->mtu); 573 size_t size = min_t(size_t, len, d->mtu);
574 int err;
575 575
576 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE, 576 skb = sock_alloc_send_skb(sk, size + RFCOMM_SKB_RESERVE,
577 msg->msg_flags & MSG_DONTWAIT, &err); 577 msg->msg_flags & MSG_DONTWAIT, &err);
@@ -582,13 +582,16 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
582 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); 582 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
583 if (err) { 583 if (err) {
584 kfree_skb(skb); 584 kfree_skb(skb);
585 sent = err; 585 if (sent == 0)
586 sent = err;
586 break; 587 break;
587 } 588 }
588 589
589 err = rfcomm_dlc_send(d, skb); 590 err = rfcomm_dlc_send(d, skb);
590 if (err < 0) { 591 if (err < 0) {
591 kfree_skb(skb); 592 kfree_skb(skb);
593 if (sent == 0)
594 sent = err;
592 break; 595 break;
593 } 596 }
594 597
@@ -598,7 +601,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
598 601
599 release_sock(sk); 602 release_sock(sk);
600 603
601 return sent ? sent : err; 604 return sent;
602} 605}
603 606
604static long rfcomm_sock_data_wait(struct sock *sk, long timeo) 607static long rfcomm_sock_data_wait(struct sock *sk, long timeo)
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index e0e0d09023b2..eb2b52484c70 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -697,9 +697,13 @@ static int rfcomm_tty_write_room(struct tty_struct *tty)
697 697
698 BT_DBG("tty %p", tty); 698 BT_DBG("tty %p", tty);
699 699
700 if (!dev || !dev->dlc)
701 return 0;
702
700 room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc); 703 room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc);
701 if (room < 0) 704 if (room < 0)
702 room = 0; 705 room = 0;
706
703 return room; 707 return room;
704} 708}
705 709
@@ -915,12 +919,14 @@ static void rfcomm_tty_unthrottle(struct tty_struct *tty)
915static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty) 919static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty)
916{ 920{
917 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 921 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
918 struct rfcomm_dlc *dlc = dev->dlc;
919 922
920 BT_DBG("tty %p dev %p", tty, dev); 923 BT_DBG("tty %p dev %p", tty, dev);
921 924
922 if (!skb_queue_empty(&dlc->tx_queue)) 925 if (!dev || !dev->dlc)
923 return dlc->mtu; 926 return 0;
927
928 if (!skb_queue_empty(&dev->dlc->tx_queue))
929 return dev->dlc->mtu;
924 930
925 return 0; 931 return 0;
926} 932}
@@ -928,11 +934,12 @@ static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty)
928static void rfcomm_tty_flush_buffer(struct tty_struct *tty) 934static void rfcomm_tty_flush_buffer(struct tty_struct *tty)
929{ 935{
930 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 936 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
931 if (!dev)
932 return;
933 937
934 BT_DBG("tty %p dev %p", tty, dev); 938 BT_DBG("tty %p dev %p", tty, dev);
935 939
940 if (!dev || !dev->dlc)
941 return;
942
936 skb_queue_purge(&dev->dlc->tx_queue); 943 skb_queue_purge(&dev->dlc->tx_queue);
937 944
938 if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup) 945 if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup)
@@ -952,11 +959,12 @@ static void rfcomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
952static void rfcomm_tty_hangup(struct tty_struct *tty) 959static void rfcomm_tty_hangup(struct tty_struct *tty)
953{ 960{
954 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; 961 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
955 if (!dev)
956 return;
957 962
958 BT_DBG("tty %p dev %p", tty, dev); 963 BT_DBG("tty %p dev %p", tty, dev);
959 964
965 if (!dev)
966 return;
967
960 rfcomm_tty_flush_buffer(tty); 968 rfcomm_tty_flush_buffer(tty);
961 969
962 if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) 970 if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 1144900d37f6..864009643675 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -305,7 +305,7 @@ lookup_protocol:
305 sk->sk_reuse = 1; 305 sk->sk_reuse = 1;
306 306
307 inet = inet_sk(sk); 307 inet = inet_sk(sk);
308 inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; 308 inet->is_icsk = (INET_PROTOSW_ICSK & answer_flags) != 0;
309 309
310 if (SOCK_RAW == sock->type) { 310 if (SOCK_RAW == sock->type) {
311 inet->num = protocol; 311 inet->num = protocol;
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 25c8a42965df..480ace9819f6 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -174,9 +174,10 @@ struct in_device *inetdev_init(struct net_device *dev)
174 ip_mc_init_dev(in_dev); 174 ip_mc_init_dev(in_dev);
175 if (dev->flags & IFF_UP) 175 if (dev->flags & IFF_UP)
176 ip_mc_up(in_dev); 176 ip_mc_up(in_dev);
177out: 177
178 /* we can receive as soon as ip_ptr is set -- do this last */ 178 /* we can receive as soon as ip_ptr is set -- do this last */
179 rcu_assign_pointer(dev->ip_ptr, in_dev); 179 rcu_assign_pointer(dev->ip_ptr, in_dev);
180out:
180 return in_dev; 181 return in_dev;
181out_kfree: 182out_kfree:
182 kfree(in_dev); 183 kfree(in_dev);
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c
index 730a7a44c883..00d6dea9f7f3 100644
--- a/net/ipv4/netfilter/nf_nat_standalone.c
+++ b/net/ipv4/netfilter/nf_nat_standalone.c
@@ -123,7 +123,7 @@ nf_nat_fn(unsigned int hooknum,
123 123
124 nat = nfct_nat(ct); 124 nat = nfct_nat(ct);
125 if (!nat) 125 if (!nat)
126 return NF_DROP; 126 return NF_ACCEPT;
127 127
128 switch (ctinfo) { 128 switch (ctinfo) {
129 case IP_CT_RELATED: 129 case IP_CT_RELATED:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index bf7a22412bcb..12de90a5047c 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -648,7 +648,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
648 TCPOLEN_TIMESTAMP); 648 TCPOLEN_TIMESTAMP);
649 rep.opt[1] = htonl(tcp_time_stamp); 649 rep.opt[1] = htonl(tcp_time_stamp);
650 rep.opt[2] = htonl(ts); 650 rep.opt[2] = htonl(ts);
651 arg.iov[0].iov_len = TCPOLEN_TSTAMP_ALIGNED; 651 arg.iov[0].iov_len += TCPOLEN_TSTAMP_ALIGNED;
652 } 652 }
653 653
654 /* Swap the send and the receive. */ 654 /* Swap the send and the receive. */
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e5cd83b2205d..0e0e4262f4dc 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -171,7 +171,7 @@ lookup_protocol:
171 sk->sk_reuse = 1; 171 sk->sk_reuse = 1;
172 172
173 inet = inet_sk(sk); 173 inet = inet_sk(sk);
174 inet->is_icsk = INET_PROTOSW_ICSK & answer_flags; 174 inet->is_icsk = (INET_PROTOSW_ICSK & answer_flags) != 0;
175 175
176 if (SOCK_RAW == sock->type) { 176 if (SOCK_RAW == sock->type) {
177 inet->num = protocol; 177 inet->num = protocol;
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 37e5fca923aa..d9c15402ba66 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -835,6 +835,8 @@ void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
835 s->nfct_reasm = skb; 835 s->nfct_reasm = skb;
836 836
837 s2 = s->next; 837 s2 = s->next;
838 s->next = NULL;
839
838 NF_HOOK_THRESH(PF_INET6, hooknum, s, in, out, okfn, 840 NF_HOOK_THRESH(PF_INET6, hooknum, s, in, out, okfn,
839 NF_IP6_PRI_CONNTRACK_DEFRAG + 1); 841 NF_IP6_PRI_CONNTRACK_DEFRAG + 1);
840 s = s2; 842 s = s2;
diff --git a/net/netfilter/nf_conntrack_netbios_ns.c b/net/netfilter/nf_conntrack_netbios_ns.c
index a5b234e444dc..2a48efdf0d67 100644
--- a/net/netfilter/nf_conntrack_netbios_ns.c
+++ b/net/netfilter/nf_conntrack_netbios_ns.c
@@ -89,6 +89,7 @@ static int help(struct sk_buff **pskb, unsigned int protoff,
89 89
90 exp->expectfn = NULL; 90 exp->expectfn = NULL;
91 exp->flags = NF_CT_EXPECT_PERMANENT; 91 exp->flags = NF_CT_EXPECT_PERMANENT;
92 exp->helper = NULL;
92 93
93 nf_conntrack_expect_related(exp); 94 nf_conntrack_expect_related(exp);
94 nf_conntrack_expect_put(exp); 95 nf_conntrack_expect_put(exp);
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index 4afc75f9e377..73e0ff469bff 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -130,12 +130,12 @@ static int netlbl_cipsov4_add_common(struct genl_info *info,
130 130
131 nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) 131 nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem)
132 if (nla->nla_type == NLBL_CIPSOV4_A_TAG) { 132 if (nla->nla_type == NLBL_CIPSOV4_A_TAG) {
133 if (iter > CIPSO_V4_TAG_MAXCNT) 133 if (iter >= CIPSO_V4_TAG_MAXCNT)
134 return -EINVAL; 134 return -EINVAL;
135 doi_def->tags[iter++] = nla_get_u8(nla); 135 doi_def->tags[iter++] = nla_get_u8(nla);
136 } 136 }
137 if (iter < CIPSO_V4_TAG_MAXCNT) 137 while (iter < CIPSO_V4_TAG_MAXCNT)
138 doi_def->tags[iter] = CIPSO_V4_TAG_INVALID; 138 doi_def->tags[iter++] = CIPSO_V4_TAG_INVALID;
139 139
140 return 0; 140 return 0;
141} 141}
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index f0bbe36799cf..167d888d1df2 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -124,8 +124,8 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
124 padlen = len % 4; 124 padlen = len % 4;
125 err.length = htons(len); 125 err.length = htons(len);
126 len += padlen; 126 len += padlen;
127 sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); 127 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
128 chunk->subh.err_hdr = sctp_addto_chunk(chunk, paylen, payload); 128 sctp_addto_chunk(chunk, paylen, payload);
129} 129}
130 130
131/* 3.3.2 Initiation (INIT) (1) 131/* 3.3.2 Initiation (INIT) (1)
diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c
index 9f42b9c9de37..27f5cc7966f6 100644
--- a/net/x25/x25_facilities.c
+++ b/net/x25/x25_facilities.c
@@ -254,7 +254,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk,
254 * They want reverse charging, we won't accept it. 254 * They want reverse charging, we won't accept it.
255 */ 255 */
256 if ((theirs.reverse & 0x01 ) && (ours->reverse & 0x01)) { 256 if ((theirs.reverse & 0x01 ) && (ours->reverse & 0x01)) {
257 SOCK_DEBUG(sk, "X.25: rejecting reverse charging request"); 257 SOCK_DEBUG(sk, "X.25: rejecting reverse charging request\n");
258 return -1; 258 return -1;
259 } 259 }
260 260
@@ -262,29 +262,29 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk,
262 262
263 if (theirs.throughput) { 263 if (theirs.throughput) {
264 if (theirs.throughput < ours->throughput) { 264 if (theirs.throughput < ours->throughput) {
265 SOCK_DEBUG(sk, "X.25: throughput negotiated down"); 265 SOCK_DEBUG(sk, "X.25: throughput negotiated down\n");
266 new->throughput = theirs.throughput; 266 new->throughput = theirs.throughput;
267 } 267 }
268 } 268 }
269 269
270 if (theirs.pacsize_in && theirs.pacsize_out) { 270 if (theirs.pacsize_in && theirs.pacsize_out) {
271 if (theirs.pacsize_in < ours->pacsize_in) { 271 if (theirs.pacsize_in < ours->pacsize_in) {
272 SOCK_DEBUG(sk, "X.25: packet size inwards negotiated down"); 272 SOCK_DEBUG(sk, "X.25: packet size inwards negotiated down\n");
273 new->pacsize_in = theirs.pacsize_in; 273 new->pacsize_in = theirs.pacsize_in;
274 } 274 }
275 if (theirs.pacsize_out < ours->pacsize_out) { 275 if (theirs.pacsize_out < ours->pacsize_out) {
276 SOCK_DEBUG(sk, "X.25: packet size outwards negotiated down"); 276 SOCK_DEBUG(sk, "X.25: packet size outwards negotiated down\n");
277 new->pacsize_out = theirs.pacsize_out; 277 new->pacsize_out = theirs.pacsize_out;
278 } 278 }
279 } 279 }
280 280
281 if (theirs.winsize_in && theirs.winsize_out) { 281 if (theirs.winsize_in && theirs.winsize_out) {
282 if (theirs.winsize_in < ours->winsize_in) { 282 if (theirs.winsize_in < ours->winsize_in) {
283 SOCK_DEBUG(sk, "X.25: window size inwards negotiated down"); 283 SOCK_DEBUG(sk, "X.25: window size inwards negotiated down\n");
284 new->winsize_in = theirs.winsize_in; 284 new->winsize_in = theirs.winsize_in;
285 } 285 }
286 if (theirs.winsize_out < ours->winsize_out) { 286 if (theirs.winsize_out < ours->winsize_out) {
287 SOCK_DEBUG(sk, "X.25: window size outwards negotiated down"); 287 SOCK_DEBUG(sk, "X.25: window size outwards negotiated down\n");
288 new->winsize_out = theirs.winsize_out; 288 new->winsize_out = theirs.winsize_out;
289 } 289 }
290 } 290 }
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index a8ffc329666a..c0ae0a7ddb42 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -917,7 +917,7 @@ void ConfigView::updateListAll(void)
917} 917}
918 918
919ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) 919ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
920 : Parent(parent, name), menu(0) 920 : Parent(parent, name), menu(0), sym(0)
921{ 921{
922 if (name) { 922 if (name) {
923 configSettings->beginGroup(name); 923 configSettings->beginGroup(name);
@@ -925,8 +925,6 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
925 configSettings->endGroup(); 925 configSettings->endGroup();
926 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); 926 connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
927 } 927 }
928
929 has_dbg_info = 0;
930} 928}
931 929
932void ConfigInfoView::saveSettings(void) 930void ConfigInfoView::saveSettings(void)
@@ -955,13 +953,11 @@ void ConfigInfoView::setInfo(struct menu *m)
955 if (menu == m) 953 if (menu == m)
956 return; 954 return;
957 menu = m; 955 menu = m;
958 if (!menu) { 956 sym = NULL;
959 has_dbg_info = 0; 957 if (!menu)
960 clear(); 958 clear();
961 } else { 959 else
962 has_dbg_info = 1;
963 menuInfo(); 960 menuInfo();
964 }
965} 961}
966 962
967void ConfigInfoView::setSource(const QString& name) 963void ConfigInfoView::setSource(const QString& name)
@@ -996,9 +992,6 @@ void ConfigInfoView::symbolInfo(void)
996{ 992{
997 QString str; 993 QString str;
998 994
999 if (!has_dbg_info)
1000 return;
1001
1002 str += "<big>Symbol: <b>"; 995 str += "<big>Symbol: <b>";
1003 str += print_filter(sym->name); 996 str += print_filter(sym->name);
1004 str += "</b></big><br><br>value: "; 997 str += "</b></big><br><br>value: ";
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index a397edb5adcf..6fc1c5f14425 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -273,8 +273,6 @@ protected:
273 struct symbol *sym; 273 struct symbol *sym;
274 struct menu *menu; 274 struct menu *menu;
275 bool _showDebug; 275 bool _showDebug;
276
277 int has_dbg_info;
278}; 276};
279 277
280class ConfigSearchWindow : public QDialog { 278class ConfigSearchWindow : public QDialog {
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 15ab5d02e80a..2aa47623f5f8 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -582,9 +582,19 @@ static int strrcmp(const char *s, const char *sub)
582 * tosec = .init.text | .exit.text | .init.data 582 * tosec = .init.text | .exit.text | .init.data
583 * fromsec = .data 583 * fromsec = .data
584 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one 584 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
585 *
586 * Pattern 3:
587 * Some symbols belong to init section but still it is ok to reference
588 * these from non-init sections as these symbols don't have any memory
589 * allocated for them and symbol address and value are same. So even
590 * if init section is freed, its ok to reference those symbols.
591 * For ex. symbols marking the init section boundaries.
592 * This pattern is identified by
593 * refsymname = __init_begin, _sinittext, _einittext
585 **/ 594 **/
586static int secref_whitelist(const char *modname, const char *tosec, 595static int secref_whitelist(const char *modname, const char *tosec,
587 const char *fromsec, const char *atsym) 596 const char *fromsec, const char *atsym,
597 const char *refsymname)
588{ 598{
589 int f1 = 1, f2 = 1; 599 int f1 = 1, f2 = 1;
590 const char **s; 600 const char **s;
@@ -595,6 +605,14 @@ static int secref_whitelist(const char *modname, const char *tosec,
595 "_ops", 605 "_ops",
596 "_probe", 606 "_probe",
597 "_probe_one", 607 "_probe_one",
608 "_console",
609 NULL
610 };
611
612 const char *pat3refsym[] = {
613 "__init_begin",
614 "_sinittext",
615 "_einittext",
598 NULL 616 NULL
599 }; 617 };
600 618
@@ -628,6 +646,11 @@ static int secref_whitelist(const char *modname, const char *tosec,
628 if ((strcmp(fromsec, ".pci_fixup") == 0) && 646 if ((strcmp(fromsec, ".pci_fixup") == 0) &&
629 (strcmp(tosec, ".init.text") == 0)) 647 (strcmp(tosec, ".init.text") == 0))
630 return 1; 648 return 1;
649
650 /* Check for pattern 3 */
651 for (s = pat3refsym; *s; s++)
652 if (strcmp(refsymname, *s) == 0)
653 return 1;
631 } 654 }
632 return 0; 655 return 0;
633} 656}
@@ -737,7 +760,7 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec,
737 /* check whitelist - we may ignore it */ 760 /* check whitelist - we may ignore it */
738 if (before && 761 if (before &&
739 secref_whitelist(modname, secname, fromsec, 762 secref_whitelist(modname, secname, fromsec,
740 elf->strtab + before->st_name)) 763 elf->strtab + before->st_name, refsymname))
741 return; 764 return;
742 765
743 if (before && after) { 766 if (before && after) {
diff --git a/security/selinux/ss/context.h b/security/selinux/ss/context.h
index 0562bacb7b99..2eee0dab524d 100644
--- a/security/selinux/ss/context.h
+++ b/security/selinux/ss/context.h
@@ -55,6 +55,29 @@ out:
55 return rc; 55 return rc;
56} 56}
57 57
58/*
59 * Sets both levels in the MLS range of 'dst' to the low level of 'src'.
60 */
61static inline int mls_context_cpy_low(struct context *dst, struct context *src)
62{
63 int rc;
64
65 if (!selinux_mls_enabled)
66 return 0;
67
68 dst->range.level[0].sens = src->range.level[0].sens;
69 rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat);
70 if (rc)
71 goto out;
72
73 dst->range.level[1].sens = src->range.level[0].sens;
74 rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat);
75 if (rc)
76 ebitmap_destroy(&dst->range.level[0].cat);
77out:
78 return rc;
79}
80
58static inline int mls_context_cmp(struct context *c1, struct context *c2) 81static inline int mls_context_cmp(struct context *c1, struct context *c2)
59{ 82{
60 if (!selinux_mls_enabled) 83 if (!selinux_mls_enabled)
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index b4f682dc13ff..4a8bab2f3c71 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -270,7 +270,7 @@ int mls_context_to_sid(char oldc,
270 if (!defcon) 270 if (!defcon)
271 goto out; 271 goto out;
272 272
273 rc = mls_copy_context(context, defcon); 273 rc = mls_context_cpy(context, defcon);
274 goto out; 274 goto out;
275 } 275 }
276 276
@@ -401,26 +401,6 @@ int mls_from_string(char *str, struct context *context, gfp_t gfp_mask)
401} 401}
402 402
403/* 403/*
404 * Copies the effective MLS range from `src' into `dst'.
405 */
406static inline int mls_scopy_context(struct context *dst,
407 struct context *src)
408{
409 int l, rc = 0;
410
411 /* Copy the MLS range from the source context */
412 for (l = 0; l < 2; l++) {
413 dst->range.level[l].sens = src->range.level[0].sens;
414 rc = ebitmap_cpy(&dst->range.level[l].cat,
415 &src->range.level[0].cat);
416 if (rc)
417 break;
418 }
419
420 return rc;
421}
422
423/*
424 * Copies the MLS range `range' into `context'. 404 * Copies the MLS range `range' into `context'.
425 */ 405 */
426static inline int mls_range_set(struct context *context, 406static inline int mls_range_set(struct context *context,
@@ -552,19 +532,19 @@ int mls_compute_sid(struct context *scontext,
552 case AVTAB_CHANGE: 532 case AVTAB_CHANGE:
553 if (tclass == SECCLASS_PROCESS) 533 if (tclass == SECCLASS_PROCESS)
554 /* Use the process MLS attributes. */ 534 /* Use the process MLS attributes. */
555 return mls_copy_context(newcontext, scontext); 535 return mls_context_cpy(newcontext, scontext);
556 else 536 else
557 /* Use the process effective MLS attributes. */ 537 /* Use the process effective MLS attributes. */
558 return mls_scopy_context(newcontext, scontext); 538 return mls_context_cpy_low(newcontext, scontext);
559 case AVTAB_MEMBER: 539 case AVTAB_MEMBER:
560 /* Only polyinstantiate the MLS attributes if 540 /* Only polyinstantiate the MLS attributes if
561 the type is being polyinstantiated */ 541 the type is being polyinstantiated */
562 if (newcontext->type != tcontext->type) { 542 if (newcontext->type != tcontext->type) {
563 /* Use the process effective MLS attributes. */ 543 /* Use the process effective MLS attributes. */
564 return mls_scopy_context(newcontext, scontext); 544 return mls_context_cpy_low(newcontext, scontext);
565 } else { 545 } else {
566 /* Use the related object MLS attributes. */ 546 /* Use the related object MLS attributes. */
567 return mls_copy_context(newcontext, tcontext); 547 return mls_context_cpy(newcontext, tcontext);
568 } 548 }
569 default: 549 default:
570 return -EINVAL; 550 return -EINVAL;
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h
index 661d6fc76966..096d1b4ef7fb 100644
--- a/security/selinux/ss/mls.h
+++ b/security/selinux/ss/mls.h
@@ -24,26 +24,6 @@
24#include "context.h" 24#include "context.h"
25#include "policydb.h" 25#include "policydb.h"
26 26
27/*
28 * Copies the MLS range from `src' into `dst'.
29 */
30static inline int mls_copy_context(struct context *dst,
31 struct context *src)
32{
33 int l, rc = 0;
34
35 /* Copy the MLS range from the source context */
36 for (l = 0; l < 2; l++) {
37 dst->range.level[l].sens = src->range.level[l].sens;
38 rc = ebitmap_cpy(&dst->range.level[l].cat,
39 &src->range.level[l].cat);
40 if (rc)
41 break;
42 }
43
44 return rc;
45}
46
47int mls_compute_context_len(struct context *context); 27int mls_compute_context_len(struct context *context);
48void mls_sid_to_context(struct context *context, char **scontext); 28void mls_sid_to_context(struct context *context, char **scontext);
49int mls_context_isvalid(struct policydb *p, struct context *c); 29int mls_context_isvalid(struct policydb *p, struct context *c);
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index ee0581557966..3eb1fa9f0de1 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -1916,11 +1916,10 @@ int security_sid_mls_copy(u32 sid, u32 mls_sid, u32 *new_sid)
1916 newcon.user = context1->user; 1916 newcon.user = context1->user;
1917 newcon.role = context1->role; 1917 newcon.role = context1->role;
1918 newcon.type = context1->type; 1918 newcon.type = context1->type;
1919 rc = mls_copy_context(&newcon, context2); 1919 rc = mls_context_cpy(&newcon, context2);
1920 if (rc) 1920 if (rc)
1921 goto out_unlock; 1921 goto out_unlock;
1922 1922
1923
1924 /* Check the validity of the new context. */ 1923 /* Check the validity of the new context. */
1925 if (!policydb_context_isvalid(&policydb, &newcon)) { 1924 if (!policydb_context_isvalid(&policydb, &newcon)) {
1926 rc = convert_context_handle_invalid_context(&newcon); 1925 rc = convert_context_handle_invalid_context(&newcon);
@@ -2492,9 +2491,9 @@ static int selinux_netlbl_socket_setsid(struct socket *sock, u32 sid)
2492 2491
2493 rc = netlbl_socket_setattr(sock, &secattr); 2492 rc = netlbl_socket_setattr(sock, &secattr);
2494 if (rc == 0) { 2493 if (rc == 0) {
2495 spin_lock(&sksec->nlbl_lock); 2494 spin_lock_bh(&sksec->nlbl_lock);
2496 sksec->nlbl_state = NLBL_LABELED; 2495 sksec->nlbl_state = NLBL_LABELED;
2497 spin_unlock(&sksec->nlbl_lock); 2496 spin_unlock_bh(&sksec->nlbl_lock);
2498 } 2497 }
2499 2498
2500netlbl_socket_setsid_return: 2499netlbl_socket_setsid_return:
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 71c58df4af28..70face7e1048 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2198,7 +2198,8 @@ static int _snd_cmipci_uswitch_put(struct snd_kcontrol *kcontrol,
2198 val = inb(cm->iobase + args->reg); 2198 val = inb(cm->iobase + args->reg);
2199 else 2199 else
2200 val = snd_cmipci_read(cm, args->reg); 2200 val = snd_cmipci_read(cm, args->reg);
2201 change = (val & args->mask) != (ucontrol->value.integer.value[0] ? args->mask : 0); 2201 change = (val & args->mask) != (ucontrol->value.integer.value[0] ?
2202 args->mask_on : (args->mask & ~args->mask_on));
2202 if (change) { 2203 if (change) {
2203 val &= ~args->mask; 2204 val &= ~args->mask;
2204 if (ucontrol->value.integer.value[0]) 2205 if (ucontrol->value.integer.value[0])
diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c
index e31f0f11e3a8..91f5bff66d3f 100644
--- a/sound/pci/echoaudio/midi.c
+++ b/sound/pci/echoaudio/midi.c
@@ -213,7 +213,7 @@ static void snd_echo_midi_output_write(unsigned long data)
213 sent = bytes = 0; 213 sent = bytes = 0;
214 spin_lock_irqsave(&chip->lock, flags); 214 spin_lock_irqsave(&chip->lock, flags);
215 chip->midi_full = 0; 215 chip->midi_full = 0;
216 if (chip->midi_out && !snd_rawmidi_transmit_empty(chip->midi_out)) { 216 if (!snd_rawmidi_transmit_empty(chip->midi_out)) {
217 bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf, 217 bytes = snd_rawmidi_transmit_peek(chip->midi_out, buf,
218 MIDI_OUT_BUFFER_SIZE - 1); 218 MIDI_OUT_BUFFER_SIZE - 1);
219 DE_MID(("Try to send %d bytes...\n", bytes)); 219 DE_MID(("Try to send %d bytes...\n", bytes));
@@ -264,9 +264,11 @@ static void snd_echo_midi_output_trigger(struct snd_rawmidi_substream *substream
264 } 264 }
265 } else { 265 } else {
266 if (chip->tinuse) { 266 if (chip->tinuse) {
267 del_timer(&chip->timer);
268 chip->tinuse = 0; 267 chip->tinuse = 0;
268 spin_unlock_irq(&chip->lock);
269 del_timer_sync(&chip->timer);
269 DE_MID(("Timer removed\n")); 270 DE_MID(("Timer removed\n"));
271 return;
270 } 272 }
271 } 273 }
272 spin_unlock_irq(&chip->lock); 274 spin_unlock_irq(&chip->lock);
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 97e9af130b71..1589d2f2917f 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -485,8 +485,9 @@ static const char *get_input_type(struct hda_gnode *node, unsigned int *pinctl)
485 return "Front Aux"; 485 return "Front Aux";
486 return "Aux"; 486 return "Aux";
487 case AC_JACK_MIC_IN: 487 case AC_JACK_MIC_IN:
488 if (node->pin_caps & 488 if (pinctl &&
489 (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT)) 489 (node->pin_caps &
490 (AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT)))
490 *pinctl |= AC_PINCTL_VREF_80; 491 *pinctl |= AC_PINCTL_VREF_80;
491 if ((location & 0x0f) == AC_JACK_LOC_FRONT) 492 if ((location & 0x0f) == AC_JACK_LOC_FRONT)
492 return "Front Mic"; 493 return "Front Mic";
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 9fd34f85cad5..1a7e82104bb9 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -83,6 +83,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
83 "{Intel, ICH7}," 83 "{Intel, ICH7},"
84 "{Intel, ESB2}," 84 "{Intel, ESB2},"
85 "{Intel, ICH8}," 85 "{Intel, ICH8},"
86 "{Intel, ICH9},"
86 "{ATI, SB450}," 87 "{ATI, SB450},"
87 "{ATI, SB600}," 88 "{ATI, SB600},"
88 "{ATI, RS600}," 89 "{ATI, RS600},"
@@ -1711,6 +1712,8 @@ static struct pci_device_id azx_ids[] = {
1711 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */ 1712 { 0x8086, 0x27d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH7 */
1712 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */ 1713 { 0x8086, 0x269a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ESB2 */
1713 { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */ 1714 { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */
1715 { 0x8086, 0x293e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */
1716 { 0x8086, 0x293f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH9 */
1714 { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ 1717 { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */
1715 { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ 1718 { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */
1716 { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ 1719 { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */
@@ -1718,9 +1721,14 @@ static struct pci_device_id azx_ids[] = {
1718 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ 1721 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */
1719 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ 1722 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */
1720 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ 1723 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */
1721 { 0x10de, 0x026c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 026c */ 1724 { 0x10de, 0x026c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP51 */
1722 { 0x10de, 0x0371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 0371 */ 1725 { 0x10de, 0x0371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP55 */
1723 { 0x10de, 0x03f0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA 03f0 */ 1726 { 0x10de, 0x03e4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP61 */
1727 { 0x10de, 0x03f0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP61 */
1728 { 0x10de, 0x044a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP65 */
1729 { 0x10de, 0x044b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP65 */
1730 { 0x10de, 0x055c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP67 */
1731 { 0x10de, 0x055d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_NVIDIA }, /* NVIDIA MCP67 */
1724 { 0, } 1732 { 0, }
1725}; 1733};
1726MODULE_DEVICE_TABLE(pci, azx_ids); 1734MODULE_DEVICE_TABLE(pci, azx_ids);
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 3d7f36fb4cf0..19bdcc74c96c 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -2471,7 +2471,13 @@ static int parse_audio_format_rates(struct snd_usb_audio *chip, struct audioform
2471 fp->nr_rates = nr_rates; 2471 fp->nr_rates = nr_rates;
2472 fp->rate_min = fp->rate_max = combine_triple(&fmt[8]); 2472 fp->rate_min = fp->rate_max = combine_triple(&fmt[8]);
2473 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) { 2473 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
2474 unsigned int rate = fp->rate_table[r] = combine_triple(&fmt[idx]); 2474 unsigned int rate = combine_triple(&fmt[idx]);
2475 /* C-Media CM6501 mislabels its 96 kHz altsetting */
2476 if (rate == 48000 && nr_rates == 1 &&
2477 chip->usb_id == USB_ID(0x0d8c, 0x0201) &&
2478 fp->altsetting == 5 && fp->maxpacksize == 392)
2479 rate = 96000;
2480 fp->rate_table[r] = rate;
2475 if (rate < fp->rate_min) 2481 if (rate < fp->rate_min)
2476 fp->rate_min = rate; 2482 fp->rate_min = rate;
2477 else if (rate > fp->rate_max) 2483 else if (rate > fp->rate_max)
@@ -3280,6 +3286,7 @@ static void snd_usb_audio_create_proc(struct snd_usb_audio *chip)
3280 3286
3281static int snd_usb_audio_free(struct snd_usb_audio *chip) 3287static int snd_usb_audio_free(struct snd_usb_audio *chip)
3282{ 3288{
3289 usb_chip[chip->index] = NULL;
3283 kfree(chip); 3290 kfree(chip);
3284 return 0; 3291 return 0;
3285} 3292}
@@ -3541,7 +3548,6 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3541 list_for_each(p, &chip->mixer_list) { 3548 list_for_each(p, &chip->mixer_list) {
3542 snd_usb_mixer_disconnect(p); 3549 snd_usb_mixer_disconnect(p);
3543 } 3550 }
3544 usb_chip[chip->index] = NULL;
3545 mutex_unlock(&register_mutex); 3551 mutex_unlock(&register_mutex);
3546 snd_card_free_when_closed(card); 3552 snd_card_free_when_closed(card);
3547 } else { 3553 } else {
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index e74eb1bc8d87..7b3bf3545a3b 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1526,7 +1526,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
1526 namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL); 1526 namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL);
1527 if (! namelist[i]) { 1527 if (! namelist[i]) {
1528 snd_printk(KERN_ERR "cannot malloc\n"); 1528 snd_printk(KERN_ERR "cannot malloc\n");
1529 while (--i > 0) 1529 while (i--)
1530 kfree(namelist[i]); 1530 kfree(namelist[i]);
1531 kfree(namelist); 1531 kfree(namelist);
1532 kfree(cval); 1532 kfree(cval);