[kernel] r10933 - in dists/trunk/linux-2.6/debian/patches: bugfix/all bugfix/arm series
Maximilian Attems
maks at alioth.debian.org
Sat Mar 22 11:35:17 UTC 2008
Author: maks
Date: Sat Mar 22 11:35:17 2008
New Revision: 10933
Log:
update to 2.6.25-rc6-git6
net, scsi, important fixes.
kill overseen merged arm enable_wb_coal.patch conflict.
Added:
dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git6
- copied, changed from r10932, /dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git5
Removed:
dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git5
dists/trunk/linux-2.6/debian/patches/bugfix/arm/enable_wb_coal.patch
Modified:
dists/trunk/linux-2.6/debian/patches/series/1~experimental.1
Copied: dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git6 (from r10932, /dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git5)
==============================================================================
--- /dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git5 (original)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/all/patch-2.6.25-rc6-git6 Sat Mar 22 11:35:17 2008
@@ -223,7 +223,7 @@
Better support for these cards than the driver for ISA.
Supports multiple cards with IRQ sharing.
diff --git a/MAINTAINERS b/MAINTAINERS
-index 6d628fb..d8ec68d 100644
+index 6d628fb..03e4602 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -452,7 +452,7 @@ S: Maintained
@@ -235,6 +235,15 @@
L: linux-arm-kernel at lists.arm.linux.org.uk (subscribers-only)
W: http://maxim.org.za/at91_26.html
S: Maintained
+@@ -880,7 +880,7 @@ P: Marcel Holtmann
+ M: marcel at holtmann.org
+ P: Maxim Krasnyansky
+ M: maxk at qualcomm.com
+-L: bluez-devel at lists.sf.net
++L: linux-bluetooth at vger.kernel.org
+ W: http://bluez.sf.net
+ W: http://www.bluez.org
+ W: http://www.holtmann.org/linux/bluetooth/
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 955fc53..4039a13 100644
--- a/arch/arm/Kconfig
@@ -5693,6 +5702,438 @@
spin_lock(¤t->mm->page_table_lock);
uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
if (!uaddr) {
+diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
+index 95b7534..1272048 100644
+--- a/arch/sh/Kconfig
++++ b/arch/sh/Kconfig
+@@ -580,6 +580,7 @@ config SH_TIMER_IRQ
+ CPU_SUBTYPE_SH7763
+ default "86" if CPU_SUBTYPE_SH7619
+ default "140" if CPU_SUBTYPE_SH7206
++ default "142" if CPU_SUBTYPE_SH7203
+ default "16"
+
+ config SH_PCLK_FREQ
+diff --git a/arch/sh/Makefile b/arch/sh/Makefile
+index c510c22..cffc92b 100644
+--- a/arch/sh/Makefile
++++ b/arch/sh/Makefile
+@@ -154,7 +154,11 @@ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
+
+ boot := arch/sh/boot
+
++ifneq ($(KBUILD_SRC),)
+ incdir-prefix := $(srctree)/include/asm-sh/
++else
++incdir-prefix :=
++endif
+
+ # Update machine arch and proc symlinks if something which affects
+ # them changed. We use .arch and .mach to indicate when they were
+@@ -182,7 +186,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
+ $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
+ $(Q)rm -f include/asm-sh/mach
+ $(Q)for i in $(incdir-y); do \
+- if [ -d $(incdir-prefix)$$i ]; then \
++ if [ -d $(srctree)/include/asm-sh/$$i ]; then \
+ echo -n ' SYMLINK include/asm-sh/mach -> '; \
+ echo -e "include/asm-sh/$$i"; \
+ ln -fsn $(incdir-prefix)$$i \
+@@ -191,7 +195,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
+ if [ ! -d include/asm-sh/mach ]; then \
+ echo -n ' SYMLINK include/asm-sh/mach -> '; \
+ echo -e 'include/asm-sh'; \
+- ln -fsn $(incdir-prefix) include/asm-sh/mach; \
++ ln -fsn $(incdir-prefix)../asm-sh include/asm-sh/mach; \
+ fi; \
+ fi; \
+ done
+diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
+index 59f552c..3dda24d 100644
+--- a/arch/sh/boot/Makefile
++++ b/arch/sh/boot/Makefile
+@@ -32,12 +32,12 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
+ $(obj)/compressed/vmlinux: FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
+
+-KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \
++KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
+ $$[$(CONFIG_PAGE_OFFSET) + \
+ $(CONFIG_MEMORY_START) + \
+ $(CONFIG_ZERO_PAGE_OFFSET)]')
+
+-KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%8x" \
++KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
+ $$[$(CONFIG_PAGE_OFFSET) + \
+ $(CONFIG_MEMORY_START) + \
+ $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]')
+diff --git a/arch/sh/kernel/cpu/sh2/entry.S b/arch/sh/kernel/cpu/sh2/entry.S
+index 7a26569..0fc8906 100644
+--- a/arch/sh/kernel/cpu/sh2/entry.S
++++ b/arch/sh/kernel/cpu/sh2/entry.S
+@@ -267,7 +267,6 @@ ENTRY(sh_bios_handler)
+
+ ENTRY(address_error_trap_handler)
+ mov r15,r4 ! regs
+- add #4,r4
+ mov #OFF_PC,r0
+ mov.l @(r0,r15),r6 ! pc
+ mov.l 1f,r0
+diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
+index 94075e1..5d039d1 100644
+--- a/arch/sh/kernel/smp.c
++++ b/arch/sh/kernel/smp.c
+@@ -179,7 +179,7 @@ void smp_send_stop(void)
+ }
+
+ struct smp_fn_call_struct smp_fn_call = {
+- .lock = SPIN_LOCK_UNLOCKED,
++ .lock = __SPIN_LOCK_UNLOCKED(smp_fn_call.lock),
+ .finished = ATOMIC_INIT(0),
+ };
+
+diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
+index 28c187c..f5b608b 100644
+--- a/arch/sparc/kernel/sys_sunos.c
++++ b/arch/sparc/kernel/sys_sunos.c
+@@ -659,7 +659,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
+
+ socket = SOCKET_I(inode);
+ local.sin_family = AF_INET;
+- local.sin_addr.s_addr = INADDR_ANY;
++ local.sin_addr.s_addr = htonl(INADDR_ANY);
+
+ /* IPPORT_RESERVED = 1024, can't find the definition in the kernel */
+ try_port = 1024;
+diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
+index cfc22d3..e91194f 100644
+--- a/arch/sparc64/kernel/sys_sunos32.c
++++ b/arch/sparc64/kernel/sys_sunos32.c
+@@ -618,7 +618,7 @@ sunos_nfs_get_server_fd (int fd, struct sockaddr_in *addr)
+
+ socket = SOCKET_I(inode);
+ local.sin_family = AF_INET;
+- local.sin_addr.s_addr = INADDR_ANY;
++ local.sin_addr.s_addr = htonl(INADDR_ANY);
+
+ /* IPPORT_RESERVED = 1024, can't find the definition in the kernel */
+ try_port = 1024;
+diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
+index 608152a..00df126 100644
+--- a/arch/x86/kernel/aperture_64.c
++++ b/arch/x86/kernel/aperture_64.c
+@@ -18,6 +18,7 @@
+ #include <linux/pci.h>
+ #include <linux/bitops.h>
+ #include <linux/ioport.h>
++#include <linux/suspend.h>
+ #include <asm/e820.h>
+ #include <asm/io.h>
+ #include <asm/gart.h>
+@@ -76,6 +77,8 @@ static u32 __init allocate_aperture(void)
+ printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
+ aper_size >> 10, __pa(p));
+ insert_aperture_resource((u32)__pa(p), aper_size);
++ register_nosave_region((u32)__pa(p) >> PAGE_SHIFT,
++ (u32)__pa(p+aper_size) >> PAGE_SHIFT);
+
+ return (u32)__pa(p);
+ }
+diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
+index be83336..a6450b3 100644
+--- a/arch/x86/kernel/cpu/mtrr/main.c
++++ b/arch/x86/kernel/cpu/mtrr/main.c
+@@ -711,7 +711,8 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
+ trim_size = end_pfn;
+ trim_size <<= PAGE_SHIFT;
+ trim_size -= trim_start;
+- add_memory_region(trim_start, trim_size, E820_RESERVED);
++ update_memory_range(trim_start, trim_size, E820_RAM,
++ E820_RESERVED);
+ update_e820();
+ return 1;
+ }
+diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c
+index 4e16ef4..80444c5 100644
+--- a/arch/x86/kernel/e820_32.c
++++ b/arch/x86/kernel/e820_32.c
+@@ -749,6 +749,32 @@ static int __init parse_memmap(char *arg)
+ return 0;
+ }
+ early_param("memmap", parse_memmap);
++void __init update_memory_range(u64 start, u64 size, unsigned old_type,
++ unsigned new_type)
++{
++ int i;
++
++ BUG_ON(old_type == new_type);
++
++ for (i = 0; i < e820.nr_map; i++) {
++ struct e820entry *ei = &e820.map[i];
++ u64 final_start, final_end;
++ if (ei->type != old_type)
++ continue;
++ /* totally covered? */
++ if (ei->addr >= start && ei->size <= size) {
++ ei->type = new_type;
++ continue;
++ }
++ /* partially covered */
++ final_start = max(start, ei->addr);
++ final_end = min(start + size, ei->addr + ei->size);
++ if (final_start >= final_end)
++ continue;
++ add_memory_region(final_start, final_end - final_start,
++ new_type);
++ }
++}
+ void __init update_e820(void)
+ {
+ u8 nr_map;
+diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
+index 9f65b4c..9be6971 100644
+--- a/arch/x86/kernel/e820_64.c
++++ b/arch/x86/kernel/e820_64.c
+@@ -744,6 +744,33 @@ void __init finish_e820_parsing(void)
+ }
+ }
+
++void __init update_memory_range(u64 start, u64 size, unsigned old_type,
++ unsigned new_type)
++{
++ int i;
++
++ BUG_ON(old_type == new_type);
++
++ for (i = 0; i < e820.nr_map; i++) {
++ struct e820entry *ei = &e820.map[i];
++ u64 final_start, final_end;
++ if (ei->type != old_type)
++ continue;
++ /* totally covered? */
++ if (ei->addr >= start && ei->size <= size) {
++ ei->type = new_type;
++ continue;
++ }
++ /* partially covered */
++ final_start = max(start, ei->addr);
++ final_end = min(start + size, ei->addr + ei->size);
++ if (final_start >= final_end)
++ continue;
++ add_memory_region(final_start, final_end - final_start,
++ new_type);
++ }
++}
++
+ void __init update_e820(void)
+ {
+ u8 nr_map;
+diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
+index fd8ca53..74d87ea 100644
+--- a/arch/x86/kernel/head_32.S
++++ b/arch/x86/kernel/head_32.S
+@@ -657,7 +657,7 @@ int_msg:
+ .asciz "Unknown interrupt or fault at EIP %p %p %p\n"
+
+ fault_msg:
+- .ascii \
++ .asciz \
+ /* fault info: */ "BUG: Int %d: CR2 %p\n" \
+ /* pusha regs: */ " EDI %p ESI %p EBP %p ESP %p\n" \
+ " EBX %p EDX %p ECX %p EAX %p\n" \
+diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c
+index a82473d..8bc1e18 100644
+--- a/arch/x86/kernel/pci-dma_64.c
++++ b/arch/x86/kernel/pci-dma_64.c
+@@ -8,6 +8,8 @@
+ #include <linux/pci.h>
+ #include <linux/module.h>
+ #include <linux/dmar.h>
++#include <linux/bootmem.h>
++#include <asm/proto.h>
+ #include <asm/io.h>
+ #include <asm/gart.h>
+ #include <asm/calgary.h>
+@@ -53,11 +55,6 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
+ int node;
+
+ node = dev_to_node(dev);
+- if (node == -1)
+- node = numa_node_id();
+-
+- if (node < first_node(node_online_map))
+- node = first_node(node_online_map);
+
+ page = alloc_pages_node(node, gfp, order);
+ return page ? page_address(page) : NULL;
+@@ -291,8 +288,55 @@ static __init int iommu_setup(char *p)
+ }
+ early_param("iommu", iommu_setup);
+
++static __initdata void *dma32_bootmem_ptr;
++static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);
++
++static int __init parse_dma32_size_opt(char *p)
++{
++ if (!p)
++ return -EINVAL;
++ dma32_bootmem_size = memparse(p, &p);
++ return 0;
++}
++early_param("dma32_size", parse_dma32_size_opt);
++
++void __init dma32_reserve_bootmem(void)
++{
++ unsigned long size, align;
++ if (end_pfn <= MAX_DMA32_PFN)
++ return;
++
++ align = 64ULL<<20;
++ size = round_up(dma32_bootmem_size, align);
++ dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
++ __pa(MAX_DMA_ADDRESS));
++ if (dma32_bootmem_ptr)
++ dma32_bootmem_size = size;
++ else
++ dma32_bootmem_size = 0;
++}
++static void __init dma32_free_bootmem(void)
++{
++ int node;
++
++ if (end_pfn <= MAX_DMA32_PFN)
++ return;
++
++ if (!dma32_bootmem_ptr)
++ return;
++
++ for_each_online_node(node)
++ free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),
++ dma32_bootmem_size);
++
++ dma32_bootmem_ptr = NULL;
++ dma32_bootmem_size = 0;
++}
++
+ void __init pci_iommu_alloc(void)
+ {
++ /* free the range so iommu could get some range less than 4G */
++ dma32_free_bootmem();
+ /*
+ * The order of these functions is important for
+ * fall-back/fail-over reasons
+diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
+index c47208f..d89a648 100644
+--- a/arch/x86/kernel/quirks.c
++++ b/arch/x86/kernel/quirks.c
+@@ -363,6 +363,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051,
+ nvidia_force_enable_hpet);
+
+ /* LPC bridges */
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0260,
++ nvidia_force_enable_hpet);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0360,
+ nvidia_force_enable_hpet);
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0361,
+diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
+index 55ceb8c..484c4a8 100644
+--- a/arch/x86/kernel/reboot.c
++++ b/arch/x86/kernel/reboot.c
+@@ -152,6 +152,24 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
+ DMI_MATCH(DMI_BOARD_NAME, "0WF810"),
+ },
+ },
++ { /* Handle problems with rebooting on Dell Optiplex 745's DFF*/
++ .callback = set_bios_reboot,
++ .ident = "Dell OptiPlex 745",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
++ DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
++ },
++ },
++ { /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
++ .callback = set_bios_reboot,
++ .ident = "Dell OptiPlex 745",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
++ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
++ DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
++ },
++ },
+ { /* Handle problems with rebooting on Dell 2400's */
+ .callback = set_bios_reboot,
+ .ident = "Dell PowerEdge 2400",
+diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c
+index 309366f..e24c456 100644
+--- a/arch/x86/kernel/setup64.c
++++ b/arch/x86/kernel/setup64.c
+@@ -142,14 +142,16 @@ void __init setup_per_cpu_areas(void)
+ printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n", size);
+ for_each_cpu_mask (i, cpu_possible_map) {
+ char *ptr;
++#ifndef CONFIG_NEED_MULTIPLE_NODES
++ ptr = alloc_bootmem_pages(size);
++#else
++ int node = early_cpu_to_node(i);
+
+- if (!NODE_DATA(early_cpu_to_node(i))) {
+- printk("cpu with no node %d, num_online_nodes %d\n",
+- i, num_online_nodes());
++ if (!node_online(node) || !NODE_DATA(node))
+ ptr = alloc_bootmem_pages(size);
+- } else {
+- ptr = alloc_bootmem_pages_node(NODE_DATA(early_cpu_to_node(i)), size);
+- }
++ else
++ ptr = alloc_bootmem_pages_node(NODE_DATA(node), size);
++#endif
+ if (!ptr)
+ panic("Cannot allocate cpu data for CPU %d\n", i);
+ cpu_pda(i)->data_offset = ptr - __per_cpu_start;
+diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
+index 7637dc9..a775fe3 100644
+--- a/arch/x86/kernel/setup_64.c
++++ b/arch/x86/kernel/setup_64.c
+@@ -389,6 +389,8 @@ void __init setup_arch(char **cmdline_p)
+
+ early_res_to_bootmem();
+
++ dma32_reserve_bootmem();
++
+ #ifdef CONFIG_ACPI_SLEEP
+ /*
+ * Reserve low memory region for sleep support.
+diff --git a/arch/x86/mach-visws/traps.c b/arch/x86/mach-visws/traps.c
+index 843b67a..bfac6ba 100644
+--- a/arch/x86/mach-visws/traps.c
++++ b/arch/x86/mach-visws/traps.c
+@@ -46,8 +46,9 @@ static __init void cobalt_init(void)
+ */
+ set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE);
+ setup_local_APIC();
+- printk(KERN_INFO "Local APIC Version %#lx, ID %#lx\n",
+- apic_read(APIC_LVR), apic_read(APIC_ID));
++ printk(KERN_INFO "Local APIC Version %#x, ID %#x\n",
++ (unsigned int)apic_read(APIC_LVR),
++ (unsigned int)apic_read(APIC_ID));
+
+ set_fixmap(FIX_CO_CPU, CO_CPU_PHYS);
+ set_fixmap(FIX_CO_APIC, CO_APIC_PHYS);
+diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
+index 8ccfee1..16b82ad 100644
+--- a/arch/x86/mm/numa_64.c
++++ b/arch/x86/mm/numa_64.c
+@@ -221,8 +221,7 @@ void __init setup_node_bootmem(int nodeid, unsigned long start,
+ bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
+ if (bootmap == NULL) {
+ if (nodedata_phys < start || nodedata_phys >= end)
+- free_bootmem((unsigned long)node_data[nodeid],
+- pgdat_size);
++ free_bootmem(nodedata_phys, pgdat_size);
+ node_data[nodeid] = NULL;
+ return;
+ }
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 7a9db35..1c445c7 100644
--- a/crypto/async_tx/async_xor.c
@@ -6218,6 +6659,342 @@
return -EOPNOTSUPP;
return 0;
}
+diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
+index 9427a61..432181e 100644
+--- a/drivers/atm/fore200e.c
++++ b/drivers/atm/fore200e.c
+@@ -1988,19 +1988,19 @@ fore200e_fetch_stats(struct fore200e* fore200e, struct sonet_stats __user *arg)
+ if (fore200e_getstats(fore200e) < 0)
+ return -EIO;
+
+- tmp.section_bip = cpu_to_be32(fore200e->stats->oc3.section_bip8_errors);
+- tmp.line_bip = cpu_to_be32(fore200e->stats->oc3.line_bip24_errors);
+- tmp.path_bip = cpu_to_be32(fore200e->stats->oc3.path_bip8_errors);
+- tmp.line_febe = cpu_to_be32(fore200e->stats->oc3.line_febe_errors);
+- tmp.path_febe = cpu_to_be32(fore200e->stats->oc3.path_febe_errors);
+- tmp.corr_hcs = cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors);
+- tmp.uncorr_hcs = cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors);
+- tmp.tx_cells = cpu_to_be32(fore200e->stats->aal0.cells_transmitted) +
+- cpu_to_be32(fore200e->stats->aal34.cells_transmitted) +
+- cpu_to_be32(fore200e->stats->aal5.cells_transmitted);
+- tmp.rx_cells = cpu_to_be32(fore200e->stats->aal0.cells_received) +
+- cpu_to_be32(fore200e->stats->aal34.cells_received) +
+- cpu_to_be32(fore200e->stats->aal5.cells_received);
++ tmp.section_bip = be32_to_cpu(fore200e->stats->oc3.section_bip8_errors);
++ tmp.line_bip = be32_to_cpu(fore200e->stats->oc3.line_bip24_errors);
++ tmp.path_bip = be32_to_cpu(fore200e->stats->oc3.path_bip8_errors);
++ tmp.line_febe = be32_to_cpu(fore200e->stats->oc3.line_febe_errors);
++ tmp.path_febe = be32_to_cpu(fore200e->stats->oc3.path_febe_errors);
++ tmp.corr_hcs = be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors);
++ tmp.uncorr_hcs = be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors);
++ tmp.tx_cells = be32_to_cpu(fore200e->stats->aal0.cells_transmitted) +
++ be32_to_cpu(fore200e->stats->aal34.cells_transmitted) +
++ be32_to_cpu(fore200e->stats->aal5.cells_transmitted);
++ tmp.rx_cells = be32_to_cpu(fore200e->stats->aal0.cells_received) +
++ be32_to_cpu(fore200e->stats->aal34.cells_received) +
++ be32_to_cpu(fore200e->stats->aal5.cells_received);
+
+ if (arg)
+ return copy_to_user(arg, &tmp, sizeof(struct sonet_stats)) ? -EFAULT : 0;
+@@ -2587,7 +2587,7 @@ fore200e_start_fw(struct fore200e* fore200e)
+ static int __devinit
+ fore200e_load_fw(struct fore200e* fore200e)
+ {
+- u32* fw_data = (u32*) fore200e->bus->fw_data;
++ __le32* fw_data = (__le32*) fore200e->bus->fw_data;
+ u32 fw_size = (u32) *fore200e->bus->fw_size / sizeof(u32);
+
+ struct fw_header* fw_header = (struct fw_header*) fw_data;
+@@ -2965,8 +2965,8 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " 4b5b:\n"
+ " crc_header_errors:\t\t%10u\n"
+ " framing_errors:\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->phy.crc_header_errors),
+- cpu_to_be32(fore200e->stats->phy.framing_errors));
++ be32_to_cpu(fore200e->stats->phy.crc_header_errors),
++ be32_to_cpu(fore200e->stats->phy.framing_errors));
+
+ if (!left--)
+ return sprintf(page, "\n"
+@@ -2978,13 +2978,13 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " path_febe_errors:\t\t%10u\n"
+ " corr_hcs_errors:\t\t%10u\n"
+ " ucorr_hcs_errors:\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->oc3.section_bip8_errors),
+- cpu_to_be32(fore200e->stats->oc3.path_bip8_errors),
+- cpu_to_be32(fore200e->stats->oc3.line_bip24_errors),
+- cpu_to_be32(fore200e->stats->oc3.line_febe_errors),
+- cpu_to_be32(fore200e->stats->oc3.path_febe_errors),
+- cpu_to_be32(fore200e->stats->oc3.corr_hcs_errors),
+- cpu_to_be32(fore200e->stats->oc3.ucorr_hcs_errors));
++ be32_to_cpu(fore200e->stats->oc3.section_bip8_errors),
++ be32_to_cpu(fore200e->stats->oc3.path_bip8_errors),
++ be32_to_cpu(fore200e->stats->oc3.line_bip24_errors),
++ be32_to_cpu(fore200e->stats->oc3.line_febe_errors),
++ be32_to_cpu(fore200e->stats->oc3.path_febe_errors),
++ be32_to_cpu(fore200e->stats->oc3.corr_hcs_errors),
++ be32_to_cpu(fore200e->stats->oc3.ucorr_hcs_errors));
+
+ if (!left--)
+ return sprintf(page,"\n"
+@@ -2995,12 +2995,12 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " vpi no conn:\t\t%10u\n"
+ " vci out of range:\t\t%10u\n"
+ " vci no conn:\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->atm.cells_transmitted),
+- cpu_to_be32(fore200e->stats->atm.cells_received),
+- cpu_to_be32(fore200e->stats->atm.vpi_bad_range),
+- cpu_to_be32(fore200e->stats->atm.vpi_no_conn),
+- cpu_to_be32(fore200e->stats->atm.vci_bad_range),
+- cpu_to_be32(fore200e->stats->atm.vci_no_conn));
++ be32_to_cpu(fore200e->stats->atm.cells_transmitted),
++ be32_to_cpu(fore200e->stats->atm.cells_received),
++ be32_to_cpu(fore200e->stats->atm.vpi_bad_range),
++ be32_to_cpu(fore200e->stats->atm.vpi_no_conn),
++ be32_to_cpu(fore200e->stats->atm.vci_bad_range),
++ be32_to_cpu(fore200e->stats->atm.vci_no_conn));
+
+ if (!left--)
+ return sprintf(page,"\n"
+@@ -3008,9 +3008,9 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " TX:\t\t\t%10u\n"
+ " RX:\t\t\t%10u\n"
+ " dropped:\t\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->aal0.cells_transmitted),
+- cpu_to_be32(fore200e->stats->aal0.cells_received),
+- cpu_to_be32(fore200e->stats->aal0.cells_dropped));
++ be32_to_cpu(fore200e->stats->aal0.cells_transmitted),
++ be32_to_cpu(fore200e->stats->aal0.cells_received),
++ be32_to_cpu(fore200e->stats->aal0.cells_dropped));
+
+ if (!left--)
+ return sprintf(page,"\n"
+@@ -3026,15 +3026,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " RX:\t\t\t%10u\n"
+ " dropped:\t\t\t%10u\n"
+ " protocol errors:\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->aal34.cells_transmitted),
+- cpu_to_be32(fore200e->stats->aal34.cells_received),
+- cpu_to_be32(fore200e->stats->aal34.cells_dropped),
+- cpu_to_be32(fore200e->stats->aal34.cells_crc_errors),
+- cpu_to_be32(fore200e->stats->aal34.cells_protocol_errors),
+- cpu_to_be32(fore200e->stats->aal34.cspdus_transmitted),
+- cpu_to_be32(fore200e->stats->aal34.cspdus_received),
+- cpu_to_be32(fore200e->stats->aal34.cspdus_dropped),
+- cpu_to_be32(fore200e->stats->aal34.cspdus_protocol_errors));
++ be32_to_cpu(fore200e->stats->aal34.cells_transmitted),
++ be32_to_cpu(fore200e->stats->aal34.cells_received),
++ be32_to_cpu(fore200e->stats->aal34.cells_dropped),
++ be32_to_cpu(fore200e->stats->aal34.cells_crc_errors),
++ be32_to_cpu(fore200e->stats->aal34.cells_protocol_errors),
++ be32_to_cpu(fore200e->stats->aal34.cspdus_transmitted),
++ be32_to_cpu(fore200e->stats->aal34.cspdus_received),
++ be32_to_cpu(fore200e->stats->aal34.cspdus_dropped),
++ be32_to_cpu(fore200e->stats->aal34.cspdus_protocol_errors));
+
+ if (!left--)
+ return sprintf(page,"\n"
+@@ -3050,15 +3050,15 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " dropped:\t\t\t%10u\n"
+ " CRC errors:\t\t%10u\n"
+ " protocol errors:\t\t%10u\n",
+- cpu_to_be32(fore200e->stats->aal5.cells_transmitted),
+- cpu_to_be32(fore200e->stats->aal5.cells_received),
+- cpu_to_be32(fore200e->stats->aal5.cells_dropped),
+- cpu_to_be32(fore200e->stats->aal5.congestion_experienced),
+- cpu_to_be32(fore200e->stats->aal5.cspdus_transmitted),
+- cpu_to_be32(fore200e->stats->aal5.cspdus_received),
+- cpu_to_be32(fore200e->stats->aal5.cspdus_dropped),
+- cpu_to_be32(fore200e->stats->aal5.cspdus_crc_errors),
+- cpu_to_be32(fore200e->stats->aal5.cspdus_protocol_errors));
++ be32_to_cpu(fore200e->stats->aal5.cells_transmitted),
++ be32_to_cpu(fore200e->stats->aal5.cells_received),
++ be32_to_cpu(fore200e->stats->aal5.cells_dropped),
++ be32_to_cpu(fore200e->stats->aal5.congestion_experienced),
++ be32_to_cpu(fore200e->stats->aal5.cspdus_transmitted),
++ be32_to_cpu(fore200e->stats->aal5.cspdus_received),
++ be32_to_cpu(fore200e->stats->aal5.cspdus_dropped),
++ be32_to_cpu(fore200e->stats->aal5.cspdus_crc_errors),
++ be32_to_cpu(fore200e->stats->aal5.cspdus_protocol_errors));
+
+ if (!left--)
+ return sprintf(page,"\n"
+@@ -3069,11 +3069,11 @@ fore200e_proc_read(struct atm_dev *dev, loff_t* pos, char* page)
+ " large b2:\t\t\t%10u\n"
+ " RX PDUs:\t\t\t%10u\n"
+ " TX PDUs:\t\t\t%10lu\n",
+- cpu_to_be32(fore200e->stats->aux.small_b1_failed),
+- cpu_to_be32(fore200e->stats->aux.large_b1_failed),
+- cpu_to_be32(fore200e->stats->aux.small_b2_failed),
+- cpu_to_be32(fore200e->stats->aux.large_b2_failed),
+- cpu_to_be32(fore200e->stats->aux.rpd_alloc_failed),
++ be32_to_cpu(fore200e->stats->aux.small_b1_failed),
++ be32_to_cpu(fore200e->stats->aux.large_b1_failed),
++ be32_to_cpu(fore200e->stats->aux.small_b2_failed),
++ be32_to_cpu(fore200e->stats->aux.large_b2_failed),
++ be32_to_cpu(fore200e->stats->aux.rpd_alloc_failed),
+ fore200e->tx_sat);
+
+ if (!left--)
+diff --git a/drivers/atm/fore200e.h b/drivers/atm/fore200e.h
+index b85a546..183841c 100644
+--- a/drivers/atm/fore200e.h
++++ b/drivers/atm/fore200e.h
+@@ -349,90 +349,90 @@ typedef struct oc3_block {
+ /* physical encoding statistics */
+
+ typedef struct stats_phy {
+- u32 crc_header_errors; /* cells received with bad header CRC */
+- u32 framing_errors; /* cells received with bad framing */
+- u32 pad[ 2 ]; /* i960 padding */
++ __be32 crc_header_errors; /* cells received with bad header CRC */
++ __be32 framing_errors; /* cells received with bad framing */
++ __be32 pad[ 2 ]; /* i960 padding */
+ } stats_phy_t;
+
+
+ /* OC-3 statistics */
+
+ typedef struct stats_oc3 {
+- u32 section_bip8_errors; /* section 8 bit interleaved parity */
+- u32 path_bip8_errors; /* path 8 bit interleaved parity */
+- u32 line_bip24_errors; /* line 24 bit interleaved parity */
+- u32 line_febe_errors; /* line far end block errors */
+- u32 path_febe_errors; /* path far end block errors */
+- u32 corr_hcs_errors; /* correctable header check sequence */
+- u32 ucorr_hcs_errors; /* uncorrectable header check sequence */
+- u32 pad[ 1 ]; /* i960 padding */
++ __be32 section_bip8_errors; /* section 8 bit interleaved parity */
++ __be32 path_bip8_errors; /* path 8 bit interleaved parity */
++ __be32 line_bip24_errors; /* line 24 bit interleaved parity */
++ __be32 line_febe_errors; /* line far end block errors */
++ __be32 path_febe_errors; /* path far end block errors */
++ __be32 corr_hcs_errors; /* correctable header check sequence */
++ __be32 ucorr_hcs_errors; /* uncorrectable header check sequence */
++ __be32 pad[ 1 ]; /* i960 padding */
+ } stats_oc3_t;
+
+
+ /* ATM statistics */
+
+ typedef struct stats_atm {
+- u32 cells_transmitted; /* cells transmitted */
+- u32 cells_received; /* cells received */
+- u32 vpi_bad_range; /* cell drops: VPI out of range */
+- u32 vpi_no_conn; /* cell drops: no connection for VPI */
+- u32 vci_bad_range; /* cell drops: VCI out of range */
+- u32 vci_no_conn; /* cell drops: no connection for VCI */
+- u32 pad[ 2 ]; /* i960 padding */
++ __be32 cells_transmitted; /* cells transmitted */
++ __be32 cells_received; /* cells received */
++ __be32 vpi_bad_range; /* cell drops: VPI out of range */
++ __be32 vpi_no_conn; /* cell drops: no connection for VPI */
++ __be32 vci_bad_range; /* cell drops: VCI out of range */
++ __be32 vci_no_conn; /* cell drops: no connection for VCI */
++ __be32 pad[ 2 ]; /* i960 padding */
+ } stats_atm_t;
+
+ /* AAL0 statistics */
+
+ typedef struct stats_aal0 {
+- u32 cells_transmitted; /* cells transmitted */
+- u32 cells_received; /* cells received */
+- u32 cells_dropped; /* cells dropped */
+- u32 pad[ 1 ]; /* i960 padding */
++ __be32 cells_transmitted; /* cells transmitted */
++ __be32 cells_received; /* cells received */
++ __be32 cells_dropped; /* cells dropped */
++ __be32 pad[ 1 ]; /* i960 padding */
+ } stats_aal0_t;
+
+
+ /* AAL3/4 statistics */
+
+ typedef struct stats_aal34 {
+- u32 cells_transmitted; /* cells transmitted from segmented PDUs */
+- u32 cells_received; /* cells reassembled into PDUs */
+- u32 cells_crc_errors; /* payload CRC error count */
+- u32 cells_protocol_errors; /* SAR or CS layer protocol errors */
+- u32 cells_dropped; /* cells dropped: partial reassembly */
+- u32 cspdus_transmitted; /* CS PDUs transmitted */
+- u32 cspdus_received; /* CS PDUs received */
+- u32 cspdus_protocol_errors; /* CS layer protocol errors */
+- u32 cspdus_dropped; /* reassembled PDUs drop'd (in cells) */
+- u32 pad[ 3 ]; /* i960 padding */
++ __be32 cells_transmitted; /* cells transmitted from segmented PDUs */
++ __be32 cells_received; /* cells reassembled into PDUs */
++ __be32 cells_crc_errors; /* payload CRC error count */
++ __be32 cells_protocol_errors; /* SAR or CS layer protocol errors */
++ __be32 cells_dropped; /* cells dropped: partial reassembly */
++ __be32 cspdus_transmitted; /* CS PDUs transmitted */
++ __be32 cspdus_received; /* CS PDUs received */
++ __be32 cspdus_protocol_errors; /* CS layer protocol errors */
++ __be32 cspdus_dropped; /* reassembled PDUs drop'd (in cells) */
++ __be32 pad[ 3 ]; /* i960 padding */
+ } stats_aal34_t;
+
+
+ /* AAL5 statistics */
+
+ typedef struct stats_aal5 {
+- u32 cells_transmitted; /* cells transmitted from segmented SDUs */
+- u32 cells_received; /* cells reassembled into SDUs */
+- u32 cells_dropped; /* reassembled PDUs dropped (in cells) */
+- u32 congestion_experienced; /* CRC error and length wrong */
+- u32 cspdus_transmitted; /* CS PDUs transmitted */
+- u32 cspdus_received; /* CS PDUs received */
+- u32 cspdus_crc_errors; /* CS PDUs CRC errors */
+- u32 cspdus_protocol_errors; /* CS layer protocol errors */
+- u32 cspdus_dropped; /* reassembled PDUs dropped */
+- u32 pad[ 3 ]; /* i960 padding */
++ __be32 cells_transmitted; /* cells transmitted from segmented SDUs */
++ __be32 cells_received; /* cells reassembled into SDUs */
++ __be32 cells_dropped; /* reassembled PDUs dropped (in cells) */
++ __be32 congestion_experienced; /* CRC error and length wrong */
++ __be32 cspdus_transmitted; /* CS PDUs transmitted */
++ __be32 cspdus_received; /* CS PDUs received */
++ __be32 cspdus_crc_errors; /* CS PDUs CRC errors */
++ __be32 cspdus_protocol_errors; /* CS layer protocol errors */
++ __be32 cspdus_dropped; /* reassembled PDUs dropped */
++ __be32 pad[ 3 ]; /* i960 padding */
+ } stats_aal5_t;
+
+
+ /* auxiliary statistics */
+
+ typedef struct stats_aux {
+- u32 small_b1_failed; /* receive BD allocation failures */
+- u32 large_b1_failed; /* receive BD allocation failures */
+- u32 small_b2_failed; /* receive BD allocation failures */
+- u32 large_b2_failed; /* receive BD allocation failures */
+- u32 rpd_alloc_failed; /* receive PDU allocation failures */
+- u32 receive_carrier; /* no carrier = 0, carrier = 1 */
+- u32 pad[ 2 ]; /* i960 padding */
++ __be32 small_b1_failed; /* receive BD allocation failures */
++ __be32 large_b1_failed; /* receive BD allocation failures */
++ __be32 small_b2_failed; /* receive BD allocation failures */
++ __be32 large_b2_failed; /* receive BD allocation failures */
++ __be32 rpd_alloc_failed; /* receive PDU allocation failures */
++ __be32 receive_carrier; /* no carrier = 0, carrier = 1 */
++ __be32 pad[ 2 ]; /* i960 padding */
+ } stats_aux_t;
+
+
+@@ -643,10 +643,10 @@ typedef struct host_bsq {
+ /* header of the firmware image */
+
+ typedef struct fw_header {
+- u32 magic; /* magic number */
+- u32 version; /* firmware version id */
+- u32 load_offset; /* fw load offset in board memory */
+- u32 start_offset; /* fw execution start address in board memory */
++ __le32 magic; /* magic number */
++ __le32 version; /* firmware version id */
++ __le32 load_offset; /* fw load offset in board memory */
++ __le32 start_offset; /* fw execution start address in board memory */
+ } fw_header_t;
+
+ #define FW_HEADER_MAGIC 0x65726f66 /* 'fore' */
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index b6d230b..0d1d213 100644
--- a/drivers/block/Kconfig
@@ -8403,6 +9180,23 @@
#define FSL_DMA_SR_CB 0x00000004
#define FSL_DMA_SR_TE 0x00000080
#define FSL_DMA_SR_EOSI 0x00000002
+diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
+index 99529e5..e6f1bda 100644
+--- a/drivers/firewire/fw-transaction.c
++++ b/drivers/firewire/fw-transaction.c
+@@ -736,6 +736,12 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
+ break;
+ }
+
++ /*
++ * The response handler may be executed while the request handler
++ * is still pending. Cancel the request handler.
++ */
++ card->driver->cancel_packet(card, &t->packet);
++
+ t->callback(card, rcode, data, data_length, t->callback_data);
+ }
+ EXPORT_SYMBOL(fw_core_handle_response);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d73a768..f0b00ec 100644
--- a/drivers/hid/hid-core.c
@@ -10031,130 +10825,2186 @@
if (host_status & TIFM_MS_STAT_RDY)
host->cmd_flags |= CMD_READY;
-diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
-index 19fd4cb..b58472c 100644
---- a/drivers/net/virtio_net.c
-+++ b/drivers/net/virtio_net.c
-@@ -203,8 +203,11 @@ again:
- if (received < budget) {
- netif_rx_complete(vi->dev, napi);
- if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq))
-- && netif_rx_reschedule(vi->dev, napi))
-+ && napi_schedule_prep(napi)) {
-+ vi->rvq->vq_ops->disable_cb(vi->rvq);
-+ __netif_rx_schedule(vi->dev, napi);
- goto again;
-+ }
- }
-
- return received;
-@@ -278,10 +281,11 @@ again:
- pr_debug("%s: virtio not prepared to send\n", dev->name);
- netif_stop_queue(dev);
-
-- /* Activate callback for using skbs: if this fails it
-+ /* Activate callback for using skbs: if this returns false it
- * means some were used in the meantime. */
- if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
-- printk("Unlikely: restart svq failed\n");
-+ printk("Unlikely: restart svq race\n");
-+ vi->svq->vq_ops->disable_cb(vi->svq);
- netif_start_queue(dev);
- goto again;
- }
-@@ -294,6 +298,15 @@ again:
- return 0;
+diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
+index 6b6df86..c6be6eb 100644
+--- a/drivers/message/fusion/mptbase.c
++++ b/drivers/message/fusion/mptbase.c
+@@ -1430,6 +1430,98 @@ mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name)
+ sprintf(prod_name, "%s", product_str);
}
-+#ifdef CONFIG_NET_POLL_CONTROLLER
-+static void virtnet_netpoll(struct net_device *dev)
++/**
++ * mpt_mapresources - map in memory mapped io
++ * @ioc: Pointer to pointer to IOC adapter
++ *
++ **/
++static int
++mpt_mapresources(MPT_ADAPTER *ioc)
+{
-+ struct virtnet_info *vi = netdev_priv(dev);
++ u8 __iomem *mem;
++ int ii;
++ unsigned long mem_phys;
++ unsigned long port;
++ u32 msize;
++ u32 psize;
++ u8 revision;
++ int r = -ENODEV;
++ struct pci_dev *pdev;
++
++ pdev = ioc->pcidev;
++ ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
++ if (pci_enable_device_mem(pdev)) {
++ printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() "
++ "failed\n", ioc->name);
++ return r;
++ }
++ if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) {
++ printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with "
++ "MEM failed\n", ioc->name);
++ return r;
++ }
+
-+ napi_schedule(&vi->napi);
++ pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
++
++ if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)
++ && !pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
++ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT
++ ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n",
++ ioc->name));
++ } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)
++ && !pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) {
++ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT
++ ": 32 BIT PCI BUS DMA ADDRESSING SUPPORTED\n",
++ ioc->name));
++ } else {
++ printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n",
++ ioc->name, pci_name(pdev));
++ pci_release_selected_regions(pdev, ioc->bars);
++ return r;
++ }
++
++ mem_phys = msize = 0;
++ port = psize = 0;
++ for (ii = 0; ii < DEVICE_COUNT_RESOURCE; ii++) {
++ if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
++ if (psize)
++ continue;
++ /* Get I/O space! */
++ port = pci_resource_start(pdev, ii);
++ psize = pci_resource_len(pdev, ii);
++ } else {
++ if (msize)
++ continue;
++ /* Get memmap */
++ mem_phys = pci_resource_start(pdev, ii);
++ msize = pci_resource_len(pdev, ii);
++ }
++ }
++ ioc->mem_size = msize;
++
++ mem = NULL;
++ /* Get logical ptr for PciMem0 space */
++ /*mem = ioremap(mem_phys, msize);*/
++ mem = ioremap(mem_phys, msize);
++ if (mem == NULL) {
++ printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter"
++ " memory!\n", ioc->name);
++ return -EINVAL;
++ }
++ ioc->memmap = mem;
++ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n",
++ ioc->name, mem, mem_phys));
++
++ ioc->mem_phys = mem_phys;
++ ioc->chip = (SYSIF_REGS __iomem *)mem;
++
++ /* Save Port IO values in case we need to do downloadboot */
++ ioc->pio_mem_phys = port;
++ ioc->pio_chip = (SYSIF_REGS __iomem *)port;
++
++ return 0;
+}
-+#endif
+
- static int virtnet_open(struct net_device *dev)
+ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+ /**
+ * mpt_attach - Install a PCI intelligent MPT adapter.
+@@ -1452,13 +1544,6 @@ int
+ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
{
- struct virtnet_info *vi = netdev_priv(dev);
-@@ -336,6 +349,9 @@ static int virtnet_probe(struct virtio_device *vdev)
- dev->stop = virtnet_close;
- dev->hard_start_xmit = start_xmit;
- dev->features = NETIF_F_HIGHDMA;
-+#ifdef CONFIG_NET_POLL_CONTROLLER
-+ dev->poll_controller = virtnet_netpoll;
-+#endif
- SET_NETDEV_DEV(dev, &vdev->dev);
+ MPT_ADAPTER *ioc;
+- u8 __iomem *mem;
+- u8 __iomem *pmem;
+- unsigned long mem_phys;
+- unsigned long port;
+- u32 msize;
+- u32 psize;
+- int ii;
+ u8 cb_idx;
+ int r = -ENODEV;
+ u8 revision;
+@@ -1468,52 +1553,32 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
+ struct proc_dir_entry *dent, *ent;
+ #endif
- /* Do we support "hardware" checksums? */
-diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
-index 7f4836b..5fa4ba0 100644
---- a/drivers/pci/hotplug/pciehp_core.c
-+++ b/drivers/pci/hotplug/pciehp_core.c
-@@ -467,7 +467,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
- t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
+- if (mpt_debug_level)
+- printk(KERN_INFO MYNAM ": mpt_debug_level=%xh\n", mpt_debug_level);
+-
+ ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
+ if (ioc == NULL) {
+ printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n");
+ return -ENOMEM;
+ }
+- ioc->debug_level = mpt_debug_level;
++
+ ioc->id = mpt_ids++;
+ sprintf(ioc->name, "ioc%d", ioc->id);
- t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
-- if (value) {
-+ if (value && pciehp_force) {
- rc = pciehp_enable_slot(t_slot);
- if (rc) /* -ENODEV: shouldn't happen, but deal with it */
- value = 0;
-diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
-index 82f5ad9..9e7de63 100644
---- a/drivers/rtc/Kconfig
-+++ b/drivers/rtc/Kconfig
-@@ -16,7 +16,7 @@ menuconfig RTC_CLASS
- probably want to enable one or more of the interfaces below.
+- ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
+- if (pci_enable_device_mem(pdev)) {
+- printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() "
+- "failed\n", ioc->name);
+- kfree(ioc);
+- return r;
+- }
+- if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) {
+- printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with "
+- "MEM failed\n", ioc->name);
+- kfree(ioc);
+- return r;
+- }
++ /*
++ * set initial debug level
++ * (refer to mptdebug.h)
++ *
++ */
++ ioc->debug_level = mpt_debug_level;
++ if (mpt_debug_level)
++ printk(KERN_INFO "mpt_debug_level=%xh\n", mpt_debug_level);
+
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": mpt_adapter_install\n", ioc->name));
+
+- if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
+- dprintk(ioc, printk(MYIOC_s_INFO_FMT
+- ": 64 BIT PCI BUS DMA ADDRESSING SUPPORTED\n", ioc->name));
+- } else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
+- printk(MYIOC_s_WARN_FMT ": 32 BIT PCI BUS DMA ADDRESSING NOT SUPPORTED\n",
+- ioc->name);
++ ioc->pcidev = pdev;
++ if (mpt_mapresources(ioc)) {
+ kfree(ioc);
+ return r;
+ }
- This driver can also be built as a module. If so, the module
-- will be called rtc-class.
-+ will be called rtc-core.
+- if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) {
+- dprintk(ioc, printk(MYIOC_s_INFO_FMT
+- ": Using 64 bit consistent mask\n", ioc->name));
+- } else {
+- dprintk(ioc, printk(MYIOC_s_INFO_FMT
+- ": Not using 64 bit consistent mask\n", ioc->name));
+- }
+-
+ ioc->alloc_total = sizeof(MPT_ADAPTER);
+ ioc->req_sz = MPT_DEFAULT_FRAME_SIZE; /* avoid div by zero! */
+ ioc->reply_sz = MPT_REPLY_FRAME_SIZE;
+@@ -1551,48 +1616,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
+ /* Find lookup slot. */
+ INIT_LIST_HEAD(&ioc->list);
+
+- mem_phys = msize = 0;
+- port = psize = 0;
+- for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
+- if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
+- if (psize)
+- continue;
+- /* Get I/O space! */
+- port = pci_resource_start(pdev, ii);
+- psize = pci_resource_len(pdev,ii);
+- } else {
+- if (msize)
+- continue;
+- /* Get memmap */
+- mem_phys = pci_resource_start(pdev, ii);
+- msize = pci_resource_len(pdev,ii);
+- }
+- }
+- ioc->mem_size = msize;
+-
+- mem = NULL;
+- /* Get logical ptr for PciMem0 space */
+- /*mem = ioremap(mem_phys, msize);*/
+- mem = ioremap(mem_phys, msize);
+- if (mem == NULL) {
+- printk(MYIOC_s_ERR_FMT "Unable to map adapter memory!\n", ioc->name);
+- kfree(ioc);
+- return -EINVAL;
+- }
+- ioc->memmap = mem;
+- dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "mem = %p, mem_phys = %lx\n", ioc->name, mem, mem_phys));
+-
+ dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n",
+ ioc->name, &ioc->facts, &ioc->pfacts[0]));
- if RTC_CLASS
+- ioc->mem_phys = mem_phys;
+- ioc->chip = (SYSIF_REGS __iomem *)mem;
+-
+- /* Save Port IO values in case we need to do downloadboot */
+- ioc->pio_mem_phys = port;
+- pmem = (u8 __iomem *)port;
+- ioc->pio_chip = (SYSIF_REGS __iomem *)pmem;
+-
+ pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
+ mpt_get_product_name(pdev->vendor, pdev->device, revision, ioc->prod_name);
+
+@@ -1688,7 +1714,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
+ list_del(&ioc->list);
+ if (ioc->alt_ioc)
+ ioc->alt_ioc->alt_ioc = NULL;
+- iounmap(mem);
++ iounmap(ioc->memmap);
++ if (r != -5)
++ pci_release_selected_regions(pdev, ioc->bars);
+ kfree(ioc);
+ pci_set_drvdata(pdev, NULL);
+ return r;
+@@ -1784,13 +1812,10 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state)
+ u32 device_state;
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+
+- device_state=pci_choose_state(pdev, state);
+-
+- printk(MYIOC_s_INFO_FMT
+- "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n",
+- ioc->name, pdev, pci_name(pdev), device_state);
+-
+- pci_save_state(pdev);
++ device_state = pci_choose_state(pdev, state);
++ printk(MYIOC_s_INFO_FMT "pci-suspend: pdev=0x%p, slot=%s, Entering "
++ "operating state [D%d]\n", ioc->name, pdev, pci_name(pdev),
++ device_state);
+
+ /* put ioc into READY_STATE */
+ if(SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, CAN_SLEEP)) {
+@@ -1805,10 +1830,14 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state)
+ /* Clear any lingering interrupt */
+ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
+
++ free_irq(ioc->pci_irq, ioc);
++ if (mpt_msi_enable)
++ pci_disable_msi(ioc->pcidev);
++ ioc->pci_irq = -1;
++ pci_save_state(pdev);
+ pci_disable_device(pdev);
+ pci_release_selected_regions(pdev, ioc->bars);
+ pci_set_power_state(pdev, device_state);
+-
+ return 0;
+ }
-diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
-index bbf10ec..56728a2 100644
---- a/drivers/rtc/rtc-at91sam9.c
-+++ b/drivers/rtc/rtc-at91sam9.c
-@@ -274,7 +274,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *_rtc)
- * SR clears it, so we must only read it in this irq handler!
- */
- mr = rtt_readl(rtc, MR) & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
-- sr = rtt_readl(rtc, SR) & mr;
-+ sr = rtt_readl(rtc, SR) & (mr >> 16);
- if (!sr)
- return IRQ_NONE;
+@@ -1823,48 +1852,54 @@ mpt_resume(struct pci_dev *pdev)
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ u32 device_state = pdev->current_state;
+ int recovery_state;
++ int err;
+
+- printk(MYIOC_s_INFO_FMT
+- "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
+- ioc->name, pdev, pci_name(pdev), device_state);
++ printk(MYIOC_s_INFO_FMT "pci-resume: pdev=0x%p, slot=%s, Previous "
++ "operating state [D%d]\n", ioc->name, pdev, pci_name(pdev),
++ device_state);
+
+- pci_set_power_state(pdev, 0);
++ pci_set_power_state(pdev, PCI_D0);
++ pci_enable_wake(pdev, PCI_D0, 0);
+ pci_restore_state(pdev);
+- if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
+- ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
+- IORESOURCE_IO);
+- if (pci_enable_device(pdev))
+- return 0;
+- } else {
+- ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
+- if (pci_enable_device_mem(pdev))
+- return 0;
+- }
+- if (pci_request_selected_regions(pdev, ioc->bars, "mpt"))
+- return 0;
++ ioc->pcidev = pdev;
++ err = mpt_mapresources(ioc);
++ if (err)
++ return err;
-@@ -321,6 +321,10 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
- if (!rtc)
- return -ENOMEM;
+- /* enable interrupts */
+- CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
+- ioc->active = 1;
++ printk(MYIOC_s_INFO_FMT "pci-resume: ioc-state=0x%x,doorbell=0x%x\n",
++ ioc->name, (mpt_GetIocState(ioc, 1) >> MPI_IOC_STATE_SHIFT),
++ CHIPREG_READ32(&ioc->chip->Doorbell));
+
+- printk(MYIOC_s_INFO_FMT
+- "pci-resume: ioc-state=0x%x,doorbell=0x%x\n",
+- ioc->name,
+- (mpt_GetIocState(ioc, 1) >> MPI_IOC_STATE_SHIFT),
+- CHIPREG_READ32(&ioc->chip->Doorbell));
++ /*
++ * Errata workaround for SAS pci express:
++ * Upon returning to the D0 state, the contents of the doorbell will be
++ * stale data, and this will incorrectly signal to the host driver that
++ * the firmware is ready to process mpt commands. The workaround is
++ * to issue a diagnostic reset.
++ */
++ if (ioc->bus_type == SAS && (pdev->device ==
++ MPI_MANUFACTPAGE_DEVID_SAS1068E || pdev->device ==
++ MPI_MANUFACTPAGE_DEVID_SAS1064E)) {
++ if (KickStart(ioc, 1, CAN_SLEEP) < 0) {
++ printk(MYIOC_s_WARN_FMT "pci-resume: Cannot recover\n",
++ ioc->name);
++ goto out;
++ }
++ }
-+ /* platform setup code should have handled this; sigh */
-+ if (!device_can_wakeup(&pdev->dev))
-+ device_init_wakeup(&pdev->dev, 1);
+ /* bring ioc to operational state */
+- if ((recovery_state = mpt_do_ioc_recovery(ioc,
+- MPT_HOSTEVENT_IOC_RECOVER, CAN_SLEEP)) != 0) {
+- printk(MYIOC_s_INFO_FMT
+- "pci-resume: Cannot recover, error:[%x]\n",
+- ioc->name, recovery_state);
+- } else {
++ printk(MYIOC_s_INFO_FMT "Sending mpt_do_ioc_recovery\n", ioc->name);
++ recovery_state = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
++ CAN_SLEEP);
++ if (recovery_state != 0)
++ printk(MYIOC_s_WARN_FMT "pci-resume: Cannot recover, "
++ "error:[%x]\n", ioc->name, recovery_state);
++ else
+ printk(MYIOC_s_INFO_FMT
+- "pci-resume: success\n", ioc->name);
+- }
+-
++ "pci-resume: success\n", ioc->name);
++ out:
+ return 0;
+
- platform_set_drvdata(pdev, rtc);
- rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
- rtc->rtt += r->start;
-diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
-index 3ab313e..17e71d5 100644
---- a/drivers/thermal/Kconfig
-+++ b/drivers/thermal/Kconfig
-@@ -4,8 +4,6 @@
+ }
+ #endif
- menuconfig THERMAL
- bool "Generic Thermal sysfs driver"
-- select HWMON
-- default y
- help
- Generic Thermal Sysfs driver offers a generic mechanism for
- thermal management. Usually it's made up of one or more thermal
-diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c
-index 41bd4c8..8b86e53 100644
---- a/drivers/thermal/thermal.c
-+++ b/drivers/thermal/thermal.c
+@@ -1903,6 +1938,7 @@ mpt_signal_reset(u8 index, MPT_ADAPTER *ioc, int reset_phase)
+ * -3 if READY but PrimeIOCFifos Failed
+ * -4 if READY but IOCInit Failed
+ * -5 if failed to enable_device and/or request_selected_regions
++ * -6 if failed to upload firmware
+ */
+ static int
+ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
+@@ -2097,7 +2133,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
+ } else {
+ printk(MYIOC_s_WARN_FMT
+ "firmware upload failure!\n", ioc->name);
+- ret = -5;
++ ret = -6;
+ }
+ }
+ }
+diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
+index 0c252f6..c207bda 100644
+--- a/drivers/message/fusion/mptscsih.c
++++ b/drivers/message/fusion/mptscsih.c
+@@ -1170,6 +1170,10 @@ mptscsih_shutdown(struct pci_dev *pdev)
+ int
+ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
+ {
++ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
++
++ scsi_block_requests(ioc->sh);
++ flush_scheduled_work();
+ mptscsih_shutdown(pdev);
+ return mpt_suspend(pdev,state);
+ }
+@@ -1183,7 +1187,12 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
+ int
+ mptscsih_resume(struct pci_dev *pdev)
+ {
+- return mpt_resume(pdev);
++ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
++ int rc;
++
++ rc = mpt_resume(pdev);
++ scsi_unblock_requests(ioc->sh);
++ return rc;
+ }
+
+ #endif
+diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
+index 7d25368..5ba4bab 100644
+--- a/drivers/net/3c501.c
++++ b/drivers/net/3c501.c
+@@ -485,9 +485,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ printk(KERN_DEBUG "%s: burped during tx load.\n",
+ dev->name);
+ spin_lock_irqsave(&lp->lock, flags);
+- }
+- while (1);
+-
++ } while (1);
+ }
+
+ /**
+@@ -612,7 +610,8 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
+ dev->stats.tx_packets++;
+ if (el_debug > 6)
+ printk(KERN_DEBUG " Tx succeeded %s\n",
+- (txsr & TX_RDY) ? "." : "but tx is busy!");
++ (txsr & TX_RDY) ? "." :
++ "but tx is busy!");
+ /*
+ * This is safe the interrupt is atomic WRT itself.
+ */
+@@ -693,7 +692,8 @@ static void el_receive(struct net_device *dev)
+
+ if (pkt_len < 60 || pkt_len > 1536) {
+ if (el_debug)
+- printk(KERN_DEBUG "%s: bogus packet, length=%d\n", dev->name, pkt_len);
++ printk(KERN_DEBUG "%s: bogus packet, length=%d\n",
++ dev->name, pkt_len);
+ dev->stats.rx_over_errors++;
+ return;
+ }
+@@ -711,7 +711,8 @@ static void el_receive(struct net_device *dev)
+
+ outw(0x00, GP_LOW);
+ if (skb == NULL) {
+- printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n", dev->name);
++ printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n",
++ dev->name);
+ dev->stats.rx_dropped++;
+ return;
+ } else {
+@@ -748,7 +749,8 @@ static void el_reset(struct net_device *dev)
+ if (el_debug > 2)
+ printk(KERN_INFO "3c501 reset...");
+ outb(AX_RESET, AX_CMD); /* Reset the chip */
+- outb(AX_LOOP, AX_CMD); /* Aux control, irq and loopback enabled */
++ /* Aux control, irq and loopback enabled */
++ outb(AX_LOOP, AX_CMD);
+ {
+ int i;
+ for (i = 0; i < 6; i++) /* Set the station address. */
+diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
+index 9200ee5..129b8b3 100644
+--- a/drivers/net/atl1/atl1_main.c
++++ b/drivers/net/atl1/atl1_main.c
+@@ -1765,15 +1765,12 @@ static irqreturn_t atl1_intr(int irq, void *data)
+ {
+ struct atl1_adapter *adapter = netdev_priv(data);
+ u32 status;
+- u8 update_rx;
+ int max_ints = 10;
+
+ status = adapter->cmb.cmb->int_stats;
+ if (!status)
+ return IRQ_NONE;
+
+- update_rx = 0;
+-
+ do {
+ /* clear CMB interrupt status at once */
+ adapter->cmb.cmb->int_stats = 0;
+diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
+index 979f3fc..db58687 100644
+--- a/drivers/net/cxgb3/sge.c
++++ b/drivers/net/cxgb3/sge.c
+@@ -1107,9 +1107,15 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
+ }
+
+ q->in_use += ndesc;
+- if (unlikely(credits - ndesc < q->stop_thres))
+- if (USE_GTS || !should_restart_tx(q))
+- t3_stop_queue(dev, qs, q);
++ if (unlikely(credits - ndesc < q->stop_thres)) {
++ t3_stop_queue(dev, qs, q);
++
++ if (should_restart_tx(q) &&
++ test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
++ q->restarts++;
++ netif_wake_queue(dev);
++ }
++ }
+
+ gen = q->gen;
+ q->unacked += ndesc;
+diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
+index 0b365b8..76118dd 100644
+--- a/drivers/net/epic100.c
++++ b/drivers/net/epic100.c
+@@ -131,8 +131,8 @@ IIIa. Ring buffers
+
+ IVb. References
+
+-http://www.smsc.com/main/datasheets/83c171.pdf
+-http://www.smsc.com/main/datasheets/83c175.pdf
++http://www.smsc.com/main/tools/discontinued/83c171.pdf
++http://www.smsc.com/main/tools/discontinued/83c175.pdf
+ http://scyld.com/expert/NWay.html
+ http://www.national.com/pf/DP/DP83840A.html
+
+@@ -227,7 +227,12 @@ static const u16 media2miictl[16] = {
+ 0, 0x0C00, 0x0C00, 0x2000, 0x0100, 0x2100, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+
+-/* The EPIC100 Rx and Tx buffer descriptors. */
++/*
++ * The EPIC100 Rx and Tx buffer descriptors. Note that these
++ * really ARE host-endian; it's not a misannotation. We tell
++ * the card to byteswap them internally on big-endian hosts -
++ * look for #ifdef CONFIG_BIG_ENDIAN in epic_open().
++ */
+
+ struct epic_tx_desc {
+ u32 txstatus;
+@@ -418,7 +423,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
+
+ /* Note: the '175 does not have a serial EEPROM. */
+ for (i = 0; i < 3; i++)
+- ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4));
++ ((__le16 *)dev->dev_addr)[i] = cpu_to_le16(inw(ioaddr + LAN0 + i*4));
+
+ if (debug > 2) {
+ dev_printk(KERN_DEBUG, &pdev->dev, "EEPROM contents:\n");
+@@ -682,7 +687,8 @@ static int epic_open(struct net_device *dev)
+ if (ep->chip_flags & MII_PWRDWN)
+ outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
+
+-#if defined(__powerpc__) || defined(__sparc__) /* Big endian */
++ /* Tell the chip to byteswap descriptors on big-endian hosts */
++#ifdef CONFIG_BIG_ENDIAN
+ outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
+ inl(ioaddr + GENCTL);
+ outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
+@@ -695,7 +701,7 @@ static int epic_open(struct net_device *dev)
+ udelay(20); /* Looks like EPII needs that if you want reliable RX init. FIXME: pci posting bug? */
+
+ for (i = 0; i < 3; i++)
+- outl(cpu_to_le16(((u16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4);
++ outl(le16_to_cpu(((__le16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4);
+
+ ep->tx_threshold = TX_FIFO_THRESH;
+ outl(ep->tx_threshold, ioaddr + TxThresh);
+@@ -798,7 +804,7 @@ static void epic_restart(struct net_device *dev)
+ for (i = 16; i > 0; i--)
+ outl(0x0008, ioaddr + TEST1);
+
+-#if defined(__powerpc__) || defined(__sparc__) /* Big endian */
++#ifdef CONFIG_BIG_ENDIAN
+ outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
+ #else
+ outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
+@@ -808,7 +814,7 @@ static void epic_restart(struct net_device *dev)
+ outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
+
+ for (i = 0; i < 3; i++)
+- outl(cpu_to_le16(((u16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4);
++ outl(le16_to_cpu(((__le16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4);
+
+ ep->tx_threshold = TX_FIFO_THRESH;
+ outl(ep->tx_threshold, ioaddr + TxThresh);
+@@ -919,7 +925,7 @@ static void epic_init_ring(struct net_device *dev)
+ /* Initialize all Rx descriptors. */
+ for (i = 0; i < RX_RING_SIZE; i++) {
+ ep->rx_ring[i].rxstatus = 0;
+- ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz);
++ ep->rx_ring[i].buflength = ep->rx_buf_sz;
+ ep->rx_ring[i].next = ep->rx_ring_dma +
+ (i+1)*sizeof(struct epic_rx_desc);
+ ep->rx_skbuff[i] = NULL;
+@@ -936,7 +942,7 @@ static void epic_init_ring(struct net_device *dev)
+ skb_reserve(skb, 2); /* 16 byte align the IP header. */
+ ep->rx_ring[i].bufaddr = pci_map_single(ep->pci_dev,
+ skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
+- ep->rx_ring[i].rxstatus = cpu_to_le32(DescOwn);
++ ep->rx_ring[i].rxstatus = DescOwn;
+ }
+ ep->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
+
+@@ -974,20 +980,20 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ ep->tx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, skb->data,
+ skb->len, PCI_DMA_TODEVICE);
+ if (free_count < TX_QUEUE_LEN/2) {/* Typical path */
+- ctrl_word = cpu_to_le32(0x100000); /* No interrupt */
++ ctrl_word = 0x100000; /* No interrupt */
+ } else if (free_count == TX_QUEUE_LEN/2) {
+- ctrl_word = cpu_to_le32(0x140000); /* Tx-done intr. */
++ ctrl_word = 0x140000; /* Tx-done intr. */
+ } else if (free_count < TX_QUEUE_LEN - 1) {
+- ctrl_word = cpu_to_le32(0x100000); /* No Tx-done intr. */
++ ctrl_word = 0x100000; /* No Tx-done intr. */
+ } else {
+ /* Leave room for an additional entry. */
+- ctrl_word = cpu_to_le32(0x140000); /* Tx-done intr. */
++ ctrl_word = 0x140000; /* Tx-done intr. */
+ ep->tx_full = 1;
+ }
+- ep->tx_ring[entry].buflength = ctrl_word | cpu_to_le32(skb->len);
++ ep->tx_ring[entry].buflength = ctrl_word | skb->len;
+ ep->tx_ring[entry].txstatus =
+ ((skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN) << 16)
+- | cpu_to_le32(DescOwn);
++ | DescOwn;
+
+ ep->cur_tx++;
+ if (ep->tx_full)
+@@ -1041,7 +1047,7 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep)
+ for (dirty_tx = ep->dirty_tx; cur_tx - dirty_tx > 0; dirty_tx++) {
+ struct sk_buff *skb;
+ int entry = dirty_tx % TX_RING_SIZE;
+- int txstatus = le32_to_cpu(ep->tx_ring[entry].txstatus);
++ int txstatus = ep->tx_ring[entry].txstatus;
+
+ if (txstatus & DescOwn)
+ break; /* It still hasn't been Txed */
+@@ -1163,8 +1169,8 @@ static int epic_rx(struct net_device *dev, int budget)
+ rx_work_limit = budget;
+
+ /* If we own the next entry, it's a new packet. Send it up. */
+- while ((ep->rx_ring[entry].rxstatus & cpu_to_le32(DescOwn)) == 0) {
+- int status = le32_to_cpu(ep->rx_ring[entry].rxstatus);
++ while ((ep->rx_ring[entry].rxstatus & DescOwn) == 0) {
++ int status = ep->rx_ring[entry].rxstatus;
+
+ if (debug > 4)
+ printk(KERN_DEBUG " epic_rx() status was %8.8x.\n", status);
+@@ -1238,7 +1244,8 @@ static int epic_rx(struct net_device *dev, int budget)
+ skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE);
+ work_done++;
+ }
+- ep->rx_ring[entry].rxstatus = cpu_to_le32(DescOwn);
++ /* AV: shouldn't we add a barrier here? */
++ ep->rx_ring[entry].rxstatus = DescOwn;
+ }
+ return work_done;
+ }
+diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
+index 801b4d9..6f7e3fd 100644
+--- a/drivers/net/forcedeth.c
++++ b/drivers/net/forcedeth.c
+@@ -184,6 +184,7 @@
+ #define DEV_HAS_PAUSEFRAME_TX_V1 0x08000 /* device supports tx pause frames version 1 */
+ #define DEV_HAS_PAUSEFRAME_TX_V2 0x10000 /* device supports tx pause frames version 2 */
+ #define DEV_HAS_PAUSEFRAME_TX_V3 0x20000 /* device supports tx pause frames version 3 */
++#define DEV_NEED_TX_LIMIT 0x40000 /* device needs to limit tx */
+
+ enum {
+ NvRegIrqStatus = 0x000,
+@@ -635,6 +636,8 @@ union ring_type {
+ #define NV_RESTART_TX 0x1
+ #define NV_RESTART_RX 0x2
+
++#define NV_TX_LIMIT_COUNT 16
++
+ /* statistics */
+ struct nv_ethtool_str {
+ char name[ETH_GSTRING_LEN];
+@@ -743,6 +746,8 @@ struct nv_skb_map {
+ struct sk_buff *skb;
+ dma_addr_t dma;
+ unsigned int dma_len;
++ struct ring_desc_ex *first_tx_desc;
++ struct nv_skb_map *next_tx_ctx;
+ };
+
+ /*
+@@ -827,6 +832,10 @@ struct fe_priv {
+ union ring_type tx_ring;
+ u32 tx_flags;
+ int tx_ring_size;
++ int tx_limit;
++ u32 tx_pkts_in_progress;
++ struct nv_skb_map *tx_change_owner;
++ struct nv_skb_map *tx_end_flip;
+ int tx_stop;
+
+ /* vlan fields */
+@@ -1707,6 +1716,9 @@ static void nv_init_tx(struct net_device *dev)
+ np->last_tx.ex = &np->tx_ring.ex[np->tx_ring_size-1];
+ np->get_tx_ctx = np->put_tx_ctx = np->first_tx_ctx = np->tx_skb;
+ np->last_tx_ctx = &np->tx_skb[np->tx_ring_size-1];
++ np->tx_pkts_in_progress = 0;
++ np->tx_change_owner = NULL;
++ np->tx_end_flip = NULL;
+
+ for (i = 0; i < np->tx_ring_size; i++) {
+ if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
+@@ -1720,6 +1732,9 @@ static void nv_init_tx(struct net_device *dev)
+ }
+ np->tx_skb[i].skb = NULL;
+ np->tx_skb[i].dma = 0;
++ np->tx_skb[i].dma_len = 0;
++ np->tx_skb[i].first_tx_desc = NULL;
++ np->tx_skb[i].next_tx_ctx = NULL;
+ }
+ }
+
+@@ -1771,7 +1786,14 @@ static void nv_drain_tx(struct net_device *dev)
+ }
+ if (nv_release_txskb(dev, &np->tx_skb[i]))
+ dev->stats.tx_dropped++;
++ np->tx_skb[i].dma = 0;
++ np->tx_skb[i].dma_len = 0;
++ np->tx_skb[i].first_tx_desc = NULL;
++ np->tx_skb[i].next_tx_ctx = NULL;
+ }
++ np->tx_pkts_in_progress = 0;
++ np->tx_change_owner = NULL;
++ np->tx_end_flip = NULL;
+ }
+
+ static void nv_drain_rx(struct net_device *dev)
+@@ -1948,6 +1970,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev)
+ struct ring_desc_ex* start_tx;
+ struct ring_desc_ex* prev_tx;
+ struct nv_skb_map* prev_tx_ctx;
++ struct nv_skb_map* start_tx_ctx;
+
+ /* add fragments to entries count */
+ for (i = 0; i < fragments; i++) {
+@@ -1965,6 +1988,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev)
+ }
+
+ start_tx = put_tx = np->put_tx.ex;
++ start_tx_ctx = np->put_tx_ctx;
+
+ /* setup the header buffer */
+ do {
+@@ -2037,6 +2061,26 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev)
+
+ spin_lock_irq(&np->lock);
+
++ if (np->tx_limit) {
++ /* Limit the number of outstanding tx. Setup all fragments, but
++ * do not set the VALID bit on the first descriptor. Save a pointer
++ * to that descriptor and also for next skb_map element.
++ */
++
++ if (np->tx_pkts_in_progress == NV_TX_LIMIT_COUNT) {
++ if (!np->tx_change_owner)
++ np->tx_change_owner = start_tx_ctx;
++
++ /* remove VALID bit */
++ tx_flags &= ~NV_TX2_VALID;
++ start_tx_ctx->first_tx_desc = start_tx;
++ start_tx_ctx->next_tx_ctx = np->put_tx_ctx;
++ np->tx_end_flip = np->put_tx_ctx;
++ } else {
++ np->tx_pkts_in_progress++;
++ }
++ }
++
+ /* set tx flags */
+ start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra);
+ np->put_tx.ex = put_tx;
+@@ -2060,6 +2104,25 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev)
+ return NETDEV_TX_OK;
+ }
+
++static inline void nv_tx_flip_ownership(struct net_device *dev)
++{
++ struct fe_priv *np = netdev_priv(dev);
++
++ np->tx_pkts_in_progress--;
++ if (np->tx_change_owner) {
++ __le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen);
++ flaglen |= NV_TX2_VALID;
++ np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen);
++ np->tx_pkts_in_progress++;
++
++ np->tx_change_owner = np->tx_change_owner->next_tx_ctx;
++ if (np->tx_change_owner == np->tx_end_flip)
++ np->tx_change_owner = NULL;
++
++ writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
++ }
++}
++
+ /*
+ * nv_tx_done: check for completed packets, release the skbs.
+ *
+@@ -2147,6 +2210,10 @@ static void nv_tx_done_optimized(struct net_device *dev, int limit)
+ dev->stats.tx_packets++;
+ dev_kfree_skb_any(np->get_tx_ctx->skb);
+ np->get_tx_ctx->skb = NULL;
++
++ if (np->tx_limit) {
++ nv_tx_flip_ownership(dev);
++ }
+ }
+ if (unlikely(np->get_tx.ex++ == np->last_tx.ex))
+ np->get_tx.ex = np->first_tx.ex;
+@@ -5333,6 +5400,21 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
+ np->need_linktimer = 0;
+ }
+
++ /* Limit the number of tx's outstanding for hw bug */
++ if (id->driver_data & DEV_NEED_TX_LIMIT) {
++ np->tx_limit = 1;
++ if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_32 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_33 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_34 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_35 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_36 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_37 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_38 ||
++ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_39) &&
++ pci_dev->revision >= 0xA2)
++ np->tx_limit = 0;
++ }
++
+ /* clear phy state and temporarily halt phy interrupts */
+ writel(0, base + NvRegMIIMask);
+ phystate = readl(base + NvRegAdapterControl);
+@@ -5563,19 +5645,19 @@ static struct pci_device_id pci_tbl[] = {
+ },
+ { /* CK804 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_8),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1|DEV_NEED_TX_LIMIT,
+ },
+ { /* CK804 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_9),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP04 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_10),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP04 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_11),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_STATISTICS_V1|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP51 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12),
+@@ -5587,11 +5669,11 @@ static struct pci_device_id pci_tbl[] = {
+ },
+ { /* MCP55 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP55 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP61 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_16),
+@@ -5611,19 +5693,19 @@ static struct pci_device_id pci_tbl[] = {
+ },
+ { /* MCP65 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_20),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_NEED_TX_LIMIT|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP65 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_21),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP65 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_22),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP65 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_23),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP67 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_24),
+@@ -5659,35 +5741,35 @@ static struct pci_device_id pci_tbl[] = {
+ },
+ { /* MCP77 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP77 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP77 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP77 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP79 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP79 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP79 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ { /* MCP79 Ethernet Controller */
+ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
+- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX,
++ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT,
+ },
+ {0,},
+ };
+diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
+index e6c69f7..0789802 100644
+--- a/drivers/net/ibm_newemac/core.c
++++ b/drivers/net/ibm_newemac/core.c
+@@ -143,6 +143,10 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
+ #define STOP_TIMEOUT_1000 13
+ #define STOP_TIMEOUT_1000_JUMBO 73
+
++static unsigned char default_mcast_addr[] = {
++ 0x01, 0x80, 0xC2, 0x00, 0x00, 0x01
++};
++
+ /* Please, keep in sync with struct ibm_emac_stats/ibm_emac_error_stats */
+ static const char emac_stats_keys[EMAC_ETHTOOL_STATS_COUNT][ETH_GSTRING_LEN] = {
+ "rx_packets", "rx_bytes", "tx_packets", "tx_bytes", "rx_packets_csum",
+@@ -618,6 +622,9 @@ static int emac_configure(struct emac_instance *dev)
+ if (emac_phy_gpcs(dev->phy.mode))
+ emac_mii_reset_phy(&dev->phy);
+
++ /* Required for Pause packet support in EMAC */
++ dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1);
++
+ return 0;
+ }
+
+diff --git a/drivers/net/ibm_newemac/tah.c b/drivers/net/ibm_newemac/tah.c
+index 96417ad..b023d10 100644
+--- a/drivers/net/ibm_newemac/tah.c
++++ b/drivers/net/ibm_newemac/tah.c
+@@ -155,6 +155,10 @@ static int __devexit tah_remove(struct of_device *ofdev)
+ static struct of_device_id tah_match[] =
+ {
+ {
++ .compatible = "ibm,tah",
++ },
++ /* For backward compat with old DT */
++ {
+ .type = "tah",
+ },
+ {},
+diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
+index 15949d3..af233b5 100644
+--- a/drivers/net/ifb.c
++++ b/drivers/net/ifb.c
+@@ -35,6 +35,7 @@
+ #include <linux/moduleparam.h>
+ #include <net/pkt_sched.h>
+ #include <net/net_namespace.h>
++#include <linux/lockdep.h>
+
+ #define TX_TIMEOUT (2*HZ)
+
+@@ -227,6 +228,16 @@ static struct rtnl_link_ops ifb_link_ops __read_mostly = {
+ module_param(numifbs, int, 0);
+ MODULE_PARM_DESC(numifbs, "Number of ifb devices");
+
++/*
++ * dev_ifb->queue_lock is usually taken after dev->ingress_lock,
++ * reversely to e.g. qdisc_lock_tree(). It should be safe until
++ * ifb doesn't take dev->queue_lock with dev_ifb->ingress_lock.
++ * But lockdep should know that ifb has different locks from dev.
++ */
++static struct lock_class_key ifb_queue_lock_key;
++static struct lock_class_key ifb_ingress_lock_key;
++
++
+ static int __init ifb_init_one(int index)
+ {
+ struct net_device *dev_ifb;
+@@ -246,6 +257,10 @@ static int __init ifb_init_one(int index)
+ err = register_netdevice(dev_ifb);
+ if (err < 0)
+ goto err;
++
++ lockdep_set_class(&dev_ifb->queue_lock, &ifb_queue_lock_key);
++ lockdep_set_class(&dev_ifb->ingress_lock, &ifb_ingress_lock_key);
++
+ return 0;
+
+ err:
+diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
+index 6a1f230..928ce82 100644
+--- a/drivers/net/igb/igb_main.c
++++ b/drivers/net/igb/igb_main.c
+@@ -31,7 +31,6 @@
+ #include <linux/vmalloc.h>
+ #include <linux/pagemap.h>
+ #include <linux/netdevice.h>
+-#include <linux/tcp.h>
+ #include <linux/ipv6.h>
+ #include <net/checksum.h>
+ #include <net/ip6_checksum.h>
+@@ -2484,10 +2483,24 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
+ tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT);
+
+ if (skb->ip_summed == CHECKSUM_PARTIAL) {
+- if (skb->protocol == htons(ETH_P_IP))
++ switch (skb->protocol) {
++ case __constant_htons(ETH_P_IP):
+ tu_cmd |= E1000_ADVTXD_TUCMD_IPV4;
+- if (skb->sk && (skb->sk->sk_protocol == IPPROTO_TCP))
+- tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
++ if (ip_hdr(skb)->protocol == IPPROTO_TCP)
++ tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
++ break;
++ case __constant_htons(ETH_P_IPV6):
++ /* XXX what about other V6 headers?? */
++ if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
++ tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP;
++ break;
++ default:
++ if (unlikely(net_ratelimit()))
++ dev_warn(&adapter->pdev->dev,
++ "partial checksum but proto=%x!\n",
++ skb->protocol);
++ break;
++ }
+ }
+
+ context_desc->type_tucmd_mlhl = cpu_to_le32(tu_cmd);
+diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
+index 373f72c..1f25263 100644
+--- a/drivers/net/ioc3-eth.c
++++ b/drivers/net/ioc3-eth.c
+@@ -1221,7 +1221,8 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
+ }
+ #endif
+
+-static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++static int __devinit ioc3_probe(struct pci_dev *pdev,
++ const struct pci_device_id *ent)
+ {
+ unsigned int sw_physid1, sw_physid2;
+ struct net_device *dev = NULL;
+diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
+index 5e5d9b5..9b358f6 100644
+--- a/drivers/net/ipg.c
++++ b/drivers/net/ipg.c
+@@ -472,7 +472,6 @@ static int ipg_config_autoneg(struct net_device *dev)
+ unsigned int txflowcontrol;
+ unsigned int rxflowcontrol;
+ unsigned int fullduplex;
+- unsigned int gig;
+ u32 mac_ctrl_val;
+ u32 asicctrl;
+ u8 phyctrl;
+@@ -489,7 +488,6 @@ static int ipg_config_autoneg(struct net_device *dev)
+ fullduplex = 0;
+ txflowcontrol = 0;
+ rxflowcontrol = 0;
+- gig = 0;
+
+ /* To accomodate a problem in 10Mbps operation,
+ * set a global flag if PHY running in 10Mbps mode.
+@@ -511,7 +509,6 @@ static int ipg_config_autoneg(struct net_device *dev)
+ break;
+ case IPG_PC_LINK_SPEED_1000MBPS:
+ printk("1000Mbps.\n");
+- gig = 1;
+ break;
+ default:
+ printk("undefined!\n");
+@@ -1900,8 +1897,13 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+
+ /* Specify the TFC field within the TFD. */
+ txfd->tfc |= cpu_to_le64(IPG_TFC_WORDALIGNDISABLED |
+- (IPG_TFC_FRAMEID & cpu_to_le64(sp->tx_current)) |
++ (IPG_TFC_FRAMEID & sp->tx_current) |
+ (IPG_TFC_FRAGCOUNT & (1 << 24)));
++ /*
++ * 16--17 (WordAlign) <- 3 (disable),
++ * 0--15 (FrameId) <- sp->tx_current,
++ * 24--27 (FragCount) <- 1
++ */
+
+ /* Request TxComplete interrupts at an interval defined
+ * by the constant IPG_FRAMESBETWEENTXCOMPLETES.
+diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
+index b569c90..de0de74 100644
+--- a/drivers/net/ne2k-pci.c
++++ b/drivers/net/ne2k-pci.c
+@@ -535,9 +535,9 @@ static void ne2k_pci_block_input(struct net_device *dev, int count,
+ if (count & 3) {
+ buf += count & ~3;
+ if (count & 2) {
+- u16 *b = (u16 *)buf;
++ __le16 *b = (__le16 *)buf;
+
+- *b++ = le16_to_cpu(inw(NE_BASE + NE_DATAPORT));
++ *b++ = cpu_to_le16(inw(NE_BASE + NE_DATAPORT));
+ buf = (char *)b;
+ }
+ if (count & 1)
+@@ -600,9 +600,9 @@ static void ne2k_pci_block_output(struct net_device *dev, int count,
+ if (count & 3) {
+ buf += count & ~3;
+ if (count & 2) {
+- u16 *b = (u16 *)buf;
++ __le16 *b = (__le16 *)buf;
+
+- outw(cpu_to_le16(*b++), NE_BASE + NE_DATAPORT);
++ outw(le16_to_cpu(*b++), NE_BASE + NE_DATAPORT);
+ buf = (char *)b;
+ }
+ }
+diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
+index daf5aba..ddbc6e4 100644
+--- a/drivers/net/ps3_gelic_wireless.c
++++ b/drivers/net/ps3_gelic_wireless.c
+@@ -1644,13 +1644,24 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
+ }
+
+ /* put them in the newtork_list */
+- scan_info = wl->buf;
+- scan_info_size = 0;
+- i = 0;
+- while (scan_info_size < data_len) {
++ for (i = 0, scan_info_size = 0, scan_info = wl->buf;
++ scan_info_size < data_len;
++ i++, scan_info_size += be16_to_cpu(scan_info->size),
++ scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) {
+ pr_debug("%s:size=%d bssid=%s scan_info=%p\n", __func__,
+ be16_to_cpu(scan_info->size),
+ print_mac(mac, &scan_info->bssid[2]), scan_info);
++
++ /*
++ * The wireless firmware may return invalid channel 0 and/or
++ * invalid rate if the AP emits zero length SSID ie. As this
++ * scan information is useless, ignore it
++ */
++ if (!be16_to_cpu(scan_info->channel) || !scan_info->rate[0]) {
++ pr_debug("%s: invalid scan info\n", __func__);
++ continue;
++ }
++
+ found = 0;
+ oldest = NULL;
+ list_for_each_entry(target, &wl->network_list, list) {
+@@ -1687,10 +1698,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
+ GFP_KERNEL);
+ if (!target->hwinfo) {
+ pr_info("%s: kzalloc failed\n", __func__);
+- i++;
+- scan_info_size += be16_to_cpu(scan_info->size);
+- scan_info = (void *)scan_info +
+- be16_to_cpu(scan_info->size);
+ continue;
+ }
+ /* copy hw scan info */
+@@ -1709,10 +1716,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
+ if (scan_info->ext_rate[r])
+ target->rate_ext_len++;
+ list_move_tail(&target->list, &wl->network_list);
+- /* bump pointer */
+- i++;
+- scan_info_size += be16_to_cpu(scan_info->size);
+- scan_info = (void *)scan_info + be16_to_cpu(scan_info->size);
+ }
+ memset(&data, 0, sizeof(data));
+ wireless_send_event(port_to_netdev(wl_port(wl)), SIOCGIWSCAN, &data,
+@@ -2389,6 +2392,8 @@ static struct net_device *gelic_wl_alloc(struct gelic_card *card)
+ if (!netdev)
+ return NULL;
+
++ strcpy(netdev->name, "wlan%d");
++
+ port = netdev_priv(netdev);
+ port->netdev = netdev;
+ port->card = card;
+diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
+index 19184e4..169edc1 100644
+--- a/drivers/net/r6040.c
++++ b/drivers/net/r6040.c
+@@ -239,7 +239,8 @@ static void r6040_free_txbufs(struct net_device *dev)
+
+ for (i = 0; i < TX_DCNT; i++) {
+ if (lp->tx_insert_ptr->skb_ptr) {
+- pci_unmap_single(lp->pdev, lp->tx_insert_ptr->buf,
++ pci_unmap_single(lp->pdev,
++ le32_to_cpu(lp->tx_insert_ptr->buf),
+ MAX_BUF_SIZE, PCI_DMA_TODEVICE);
+ dev_kfree_skb(lp->tx_insert_ptr->skb_ptr);
+ lp->rx_insert_ptr->skb_ptr = NULL;
+@@ -255,7 +256,8 @@ static void r6040_free_rxbufs(struct net_device *dev)
+
+ for (i = 0; i < RX_DCNT; i++) {
+ if (lp->rx_insert_ptr->skb_ptr) {
+- pci_unmap_single(lp->pdev, lp->rx_insert_ptr->buf,
++ pci_unmap_single(lp->pdev,
++ le32_to_cpu(lp->rx_insert_ptr->buf),
+ MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+ dev_kfree_skb(lp->rx_insert_ptr->skb_ptr);
+ lp->rx_insert_ptr->skb_ptr = NULL;
+@@ -542,7 +544,7 @@ static int r6040_rx(struct net_device *dev, int limit)
+ skb_ptr->dev = priv->dev;
+ /* Do not count the CRC */
+ skb_put(skb_ptr, descptr->len - 4);
+- pci_unmap_single(priv->pdev, descptr->buf,
++ pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
+ MAX_BUF_SIZE, PCI_DMA_FROMDEVICE);
+ skb_ptr->protocol = eth_type_trans(skb_ptr, priv->dev);
+ /* Send to upper layer */
+@@ -585,7 +587,7 @@ static void r6040_tx(struct net_device *dev)
+ if (descptr->status & 0x8000)
+ break; /* Not complete */
+ skb_ptr = descptr->skb_ptr;
+- pci_unmap_single(priv->pdev, descptr->buf,
++ pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
+ skb_ptr->len, PCI_DMA_TODEVICE);
+ /* Free buffer */
+ dev_kfree_skb_irq(skb_ptr);
+diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
+index 26ffb67..f9ef8bd 100644
+--- a/drivers/net/tg3.c
++++ b/drivers/net/tg3.c
+@@ -64,8 +64,8 @@
+
+ #define DRV_MODULE_NAME "tg3"
+ #define PFX DRV_MODULE_NAME ": "
+-#define DRV_MODULE_VERSION "3.87"
+-#define DRV_MODULE_RELDATE "December 20, 2007"
++#define DRV_MODULE_VERSION "3.88"
++#define DRV_MODULE_RELDATE "March 20, 2008"
+
+ #define TG3_DEF_MAC_MODE 0
+ #define TG3_DEF_RX_MODE 0
+@@ -11841,7 +11841,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
+ }
+
+ if (!is_valid_ether_addr(&dev->dev_addr[0])) {
+-#ifdef CONFIG_SPARC64
++#ifdef CONFIG_SPARC
+ if (!tg3_get_default_macaddr_sparc(tp))
+ return 0;
+ #endif
+diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
+index 567c627..1b5edd6 100644
+--- a/drivers/net/tulip/de2104x.c
++++ b/drivers/net/tulip/de2104x.c
+@@ -842,7 +842,7 @@ static inline int de_is_running (struct de_private *de)
+ static void de_stop_rxtx (struct de_private *de)
+ {
+ u32 macmode;
+- unsigned int work = 1000;
++ unsigned int i = 1300/100;
+
+ macmode = dr32(MacMode);
+ if (macmode & RxTx) {
+@@ -850,10 +850,14 @@ static void de_stop_rxtx (struct de_private *de)
+ dr32(MacMode);
+ }
+
+- while (--work > 0) {
++ /* wait until in-flight frame completes.
++ * Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin)
++ * Typically expect this loop to end in < 50 us on 100BT.
++ */
++ while (--i) {
+ if (!de_is_running(de))
+ return;
+- cpu_relax();
++ udelay(100);
+ }
+
+ printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name);
+diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
+index fba0811..8cc3166 100644
+--- a/drivers/net/ucc_geth.c
++++ b/drivers/net/ucc_geth.c
+@@ -154,8 +154,8 @@ static struct ucc_geth_info ugeth_primary_info = {
+ .rxQoSMode = UCC_GETH_QOS_MODE_DEFAULT,
+ .aufc = UPSMR_AUTOMATIC_FLOW_CONTROL_MODE_NONE,
+ .padAndCrc = MACCFG2_PAD_AND_CRC_MODE_PAD_AND_CRC,
+- .numThreadsTx = UCC_GETH_NUM_OF_THREADS_4,
+- .numThreadsRx = UCC_GETH_NUM_OF_THREADS_4,
++ .numThreadsTx = UCC_GETH_NUM_OF_THREADS_1,
++ .numThreadsRx = UCC_GETH_NUM_OF_THREADS_1,
+ .riscTx = QE_RISC_ALLOCATION_RISC1_AND_RISC2,
+ .riscRx = QE_RISC_ALLOCATION_RISC1_AND_RISC2,
+ };
+@@ -3975,6 +3975,8 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
+ ug_info->uf_info.utfs = UCC_GETH_UTFS_GIGA_INIT;
+ ug_info->uf_info.utfet = UCC_GETH_UTFET_GIGA_INIT;
+ ug_info->uf_info.utftt = UCC_GETH_UTFTT_GIGA_INIT;
++ ug_info->numThreadsTx = UCC_GETH_NUM_OF_THREADS_4;
++ ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
+ }
+
+ /* Set the bus id */
+diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
+index a613247..727547a 100644
+--- a/drivers/net/usb/rndis_host.c
++++ b/drivers/net/usb/rndis_host.c
+@@ -16,10 +16,6 @@
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+-
+-// #define DEBUG // error path messages, extra info
+-// #define VERBOSE // more; success messages
+-
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/netdevice.h>
+@@ -318,6 +314,14 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
+ net->hard_header_len += sizeof (struct rndis_data_hdr);
+ dev->hard_mtu = net->mtu + net->hard_header_len;
+
++ dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
++ if (dev->maxpacket == 0) {
++ if (netif_msg_probe(dev))
++ dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
++ retval = -EINVAL;
++ goto fail_and_release;
++ }
++
+ dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1);
+ dev->rx_urb_size &= ~(dev->maxpacket - 1);
+ u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
+diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
+index 19fd4cb..b58472c 100644
+--- a/drivers/net/virtio_net.c
++++ b/drivers/net/virtio_net.c
+@@ -203,8 +203,11 @@ again:
+ if (received < budget) {
+ netif_rx_complete(vi->dev, napi);
+ if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq))
+- && netif_rx_reschedule(vi->dev, napi))
++ && napi_schedule_prep(napi)) {
++ vi->rvq->vq_ops->disable_cb(vi->rvq);
++ __netif_rx_schedule(vi->dev, napi);
+ goto again;
++ }
+ }
+
+ return received;
+@@ -278,10 +281,11 @@ again:
+ pr_debug("%s: virtio not prepared to send\n", dev->name);
+ netif_stop_queue(dev);
+
+- /* Activate callback for using skbs: if this fails it
++ /* Activate callback for using skbs: if this returns false it
+ * means some were used in the meantime. */
+ if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
+- printk("Unlikely: restart svq failed\n");
++ printk("Unlikely: restart svq race\n");
++ vi->svq->vq_ops->disable_cb(vi->svq);
+ netif_start_queue(dev);
+ goto again;
+ }
+@@ -294,6 +298,15 @@ again:
+ return 0;
+ }
+
++#ifdef CONFIG_NET_POLL_CONTROLLER
++static void virtnet_netpoll(struct net_device *dev)
++{
++ struct virtnet_info *vi = netdev_priv(dev);
++
++ napi_schedule(&vi->napi);
++}
++#endif
++
+ static int virtnet_open(struct net_device *dev)
+ {
+ struct virtnet_info *vi = netdev_priv(dev);
+@@ -336,6 +349,9 @@ static int virtnet_probe(struct virtio_device *vdev)
+ dev->stop = virtnet_close;
+ dev->hard_start_xmit = start_xmit;
+ dev->features = NETIF_F_HIGHDMA;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++ dev->poll_controller = virtnet_netpoll;
++#endif
+ SET_NETDEV_DEV(dev, &vdev->dev);
+
+ /* Do we support "hardware" checksums? */
+diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
+index cf27bf4..547368e 100644
+--- a/drivers/net/wan/farsync.c
++++ b/drivers/net/wan/farsync.c
+@@ -2024,6 +2024,7 @@ fst_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ struct fstioc_write wrthdr;
+ struct fstioc_info info;
+ unsigned long flags;
++ void *buf;
+
+ dbg(DBG_IOCTL, "ioctl: %x, %p\n", cmd, ifr->ifr_data);
+
+@@ -2065,16 +2066,22 @@ fst_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+ return -ENXIO;
+ }
+
+- /* Now copy the data to the card.
+- * This will probably break on some architectures.
+- * I'll fix it when I have something to test on.
+- */
+- if (copy_from_user(card->mem + wrthdr.offset,
++ /* Now copy the data to the card. */
++
++ buf = kmalloc(wrthdr.size, GFP_KERNEL);
++ if (!buf)
++ return -ENOMEM;
++
++ if (copy_from_user(buf,
+ ifr->ifr_data + sizeof (struct fstioc_write),
+ wrthdr.size)) {
++ kfree(buf);
+ return -EFAULT;
+ }
+
++ memcpy_toio(card->mem + wrthdr.offset, buf, wrthdr.size);
++ kfree(buf);
++
+ /* Writes to the memory of a card in the reset state constitute
+ * a download
+ */
+diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
+index c2de2d9..0175743 100644
+--- a/drivers/net/wireless/ath5k/hw.c
++++ b/drivers/net/wireless/ath5k/hw.c
+@@ -427,6 +427,8 @@ void ath5k_hw_detach(struct ath5k_hw *ah)
+ {
+ ATH5K_TRACE(ah->ah_sc);
+
++ __set_bit(ATH_STAT_INVALID, ah->ah_sc->status);
++
+ if (ah->ah_rf_banks != NULL)
+ kfree(ah->ah_rf_banks);
+
+diff --git a/drivers/net/wireless/b43/phy.c b/drivers/net/wireless/b43/phy.c
+index 71507b2..575c543 100644
+--- a/drivers/net/wireless/b43/phy.c
++++ b/drivers/net/wireless/b43/phy.c
+@@ -860,7 +860,7 @@ static void b43_phy_ww(struct b43_wldev *dev)
+ b43_phy_write(dev, B43_PHY_OFDM(0xBB),
+ (b43_phy_read(dev, B43_PHY_OFDM(0xBB)) & 0xF000) | 0x0053);
+ b43_phy_write(dev, B43_PHY_OFDM61,
+- (b43_phy_read(dev, B43_PHY_OFDM61 & 0xFE1F)) | 0x0120);
++ (b43_phy_read(dev, B43_PHY_OFDM61) & 0xFE1F) | 0x0120);
+ b43_phy_write(dev, B43_PHY_OFDM(0x13),
+ (b43_phy_read(dev, B43_PHY_OFDM(0x13)) & 0x0FFF) | 0x3000);
+ b43_phy_write(dev, B43_PHY_OFDM(0x14),
+diff --git a/drivers/net/wireless/p54usb.c b/drivers/net/wireless/p54usb.c
+index e7d4aee..98ddbb3 100644
+--- a/drivers/net/wireless/p54usb.c
++++ b/drivers/net/wireless/p54usb.c
+@@ -63,6 +63,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
+ {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */
+ {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */
+ {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
++ {USB_DEVICE(0x124a, 0x4025)}, /* IOGear GWU513 (GW3887IK chip) */
+ {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */
+ {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
+ {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
+diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
+index 05927b9..6c72542 100644
+--- a/drivers/net/wireless/rt2x00/rt2x00.h
++++ b/drivers/net/wireless/rt2x00/rt2x00.h
+@@ -620,6 +620,9 @@ struct rt2x00_dev {
+ * This will only be compiled in when required.
+ */
+ #ifdef CONFIG_RT2X00_LIB_RFKILL
++unsigned long rfkill_state;
++#define RFKILL_STATE_ALLOCATED 1
++#define RFKILL_STATE_REGISTERED 2
+ struct rfkill *rfkill;
+ struct input_polled_dev *poll_dev;
+ #endif /* CONFIG_RT2X00_LIB_RFKILL */
+diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
+index 0d51f47..bd305f7 100644
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
+@@ -1098,7 +1098,7 @@ static void rt2x00lib_uninitialize(struct rt2x00_dev *rt2x00dev)
+ return;
+
+ /*
+- * Unregister rfkill.
++ * Unregister extra components.
+ */
+ rt2x00rfkill_unregister(rt2x00dev);
+
+@@ -1139,17 +1139,12 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev)
+ __set_bit(DEVICE_INITIALIZED, &rt2x00dev->flags);
+
+ /*
+- * Register the rfkill handler.
++ * Register the extra components.
+ */
+- status = rt2x00rfkill_register(rt2x00dev);
+- if (status)
+- goto exit_unitialize;
++ rt2x00rfkill_register(rt2x00dev);
+
+ return 0;
+
+-exit_unitialize:
+- rt2x00lib_uninitialize(rt2x00dev);
+-
+ exit:
+ rt2x00lib_free_ring_entries(rt2x00dev);
+
+@@ -1313,15 +1308,9 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
+ }
+
+ /*
+- * Allocatie rfkill.
+- */
+- retval = rt2x00rfkill_allocate(rt2x00dev);
+- if (retval)
+- goto exit;
+-
+- /*
+- * Open the debugfs entry.
++ * Register extra components.
+ */
++ rt2x00rfkill_allocate(rt2x00dev);
+ rt2x00debug_register(rt2x00dev);
+
+ __set_bit(DEVICE_PRESENT, &rt2x00dev->flags);
+@@ -1350,13 +1339,9 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
+ rt2x00lib_uninitialize(rt2x00dev);
+
+ /*
+- * Close debugfs entry.
++ * Free extra components
+ */
+ rt2x00debug_deregister(rt2x00dev);
+-
+- /*
+- * Free rfkill
+- */
+ rt2x00rfkill_free(rt2x00dev);
+
+ /*
+@@ -1395,11 +1380,15 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state)
+ __set_bit(DEVICE_STARTED_SUSPEND, &rt2x00dev->flags);
+
+ /*
+- * Disable radio and unitialize all items
+- * that must be recreated on resume.
++ * Disable radio.
+ */
+ rt2x00lib_stop(rt2x00dev);
+ rt2x00lib_uninitialize(rt2x00dev);
++
++ /*
++ * Suspend/disable extra components.
++ */
++ rt2x00rfkill_suspend(rt2x00dev);
+ rt2x00debug_deregister(rt2x00dev);
+
+ exit:
+@@ -1422,9 +1411,10 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
+ NOTICE(rt2x00dev, "Waking up.\n");
+
+ /*
+- * Open the debugfs entry.
++ * Restore/enable extra components.
+ */
+ rt2x00debug_register(rt2x00dev);
++ rt2x00rfkill_resume(rt2x00dev);
+
+ /*
+ * Only continue if mac80211 had open interfaces.
+diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
+index 1adbd28..ce58c65 100644
+--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
++++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
+@@ -100,28 +100,36 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
+ * RFkill handlers.
+ */
+ #ifdef CONFIG_RT2X00_LIB_RFKILL
+-int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);
++void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);
+ void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev);
+-int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev);
++void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev);
+ void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev);
++void rt2x00rfkill_suspend(struct rt2x00_dev *rt2x00dev);
++void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev);
+ #else
+-static inline int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
++static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
+ {
+- return 0;
+ }
+
+ static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
+ {
+ }
+
+-static inline int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
++static inline void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
+ {
+- return 0;
+ }
+
+ static inline void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
+ {
+ }
++
++static inline void rt2x00rfkill_suspend(struct rt2x00_dev *rt2x00dev)
++{
++}
++
++static inline void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev)
++{
++}
+ #endif /* CONFIG_RT2X00_LIB_RFKILL */
+
+ #endif /* RT2X00LIB_H */
+diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
+index 34a96d4..f955775 100644
+--- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
++++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
+@@ -69,56 +69,81 @@ static void rt2x00rfkill_poll(struct input_polled_dev *poll_dev)
+ }
+ }
+
+-int rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
++void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
+ {
+- int retval;
+-
+- if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags))
+- return 0;
++ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags) ||
++ !test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
++ return;
+
+- retval = rfkill_register(rt2x00dev->rfkill);
+- if (retval) {
++ if (rfkill_register(rt2x00dev->rfkill)) {
+ ERROR(rt2x00dev, "Failed to register rfkill handler.\n");
+- return retval;
++ return;
+ }
+
+- retval = input_register_polled_device(rt2x00dev->poll_dev);
+- if (retval) {
++ if (input_register_polled_device(rt2x00dev->poll_dev)) {
+ ERROR(rt2x00dev, "Failed to register polled device.\n");
+ rfkill_unregister(rt2x00dev->rfkill);
+- return retval;
++ return;
+ }
+
++ __set_bit(RFKILL_STATE_REGISTERED, &rt2x00dev->rfkill_state);
++
+ /*
+ * Force initial poll which will detect the initial device state,
+ * and correctly sends the signal to the rfkill layer about this
+ * state.
+ */
+ rt2x00rfkill_poll(rt2x00dev->poll_dev);
+-
+- return 0;
+ }
+
+ void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
+ {
+- if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags))
++ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags) ||
++ !test_bit(RFKILL_STATE_REGISTERED, &rt2x00dev->rfkill_state))
+ return;
+
+ input_unregister_polled_device(rt2x00dev->poll_dev);
+ rfkill_unregister(rt2x00dev->rfkill);
++
++ __clear_bit(RFKILL_STATE_REGISTERED, &rt2x00dev->rfkill_state);
+ }
+
+-int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
++static struct input_polled_dev *
++rt2x00rfkill_allocate_polldev(struct rt2x00_dev *rt2x00dev)
+ {
+- struct device *device = wiphy_dev(rt2x00dev->hw->wiphy);
++ struct input_polled_dev *poll_dev;
++
++ poll_dev = input_allocate_polled_device();
++ if (!poll_dev)
++ return NULL;
++
++ poll_dev->private = rt2x00dev;
++ poll_dev->poll = rt2x00rfkill_poll;
++ poll_dev->poll_interval = RFKILL_POLL_INTERVAL;
++
++ poll_dev->input->name = rt2x00dev->ops->name;
++ poll_dev->input->phys = wiphy_name(rt2x00dev->hw->wiphy);
++ poll_dev->input->id.bustype = BUS_HOST;
++ poll_dev->input->id.vendor = 0x1814;
++ poll_dev->input->id.product = rt2x00dev->chip.rt;
++ poll_dev->input->id.version = rt2x00dev->chip.rev;
++ poll_dev->input->dev.parent = wiphy_dev(rt2x00dev->hw->wiphy);
++ poll_dev->input->evbit[0] = BIT(EV_KEY);
++ set_bit(KEY_WLAN, poll_dev->input->keybit);
++
++ return poll_dev;
++}
+
++void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
++{
+ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags))
+- return 0;
++ return;
+
+- rt2x00dev->rfkill = rfkill_allocate(device, RFKILL_TYPE_WLAN);
++ rt2x00dev->rfkill =
++ rfkill_allocate(wiphy_dev(rt2x00dev->hw->wiphy), RFKILL_TYPE_WLAN);
+ if (!rt2x00dev->rfkill) {
+ ERROR(rt2x00dev, "Failed to allocate rfkill handler.\n");
+- goto exit;
++ return;
+ }
+
+ rt2x00dev->rfkill->name = rt2x00dev->ops->name;
+@@ -126,40 +151,49 @@ int rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
+ rt2x00dev->rfkill->state = -1;
+ rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio;
+
+- rt2x00dev->poll_dev = input_allocate_polled_device();
++ rt2x00dev->poll_dev = rt2x00rfkill_allocate_polldev(rt2x00dev);
+ if (!rt2x00dev->poll_dev) {
+ ERROR(rt2x00dev, "Failed to allocate polled device.\n");
+- goto exit_free_rfkill;
++ rfkill_free(rt2x00dev->rfkill);
++ rt2x00dev->rfkill = NULL;
++ return;
+ }
+
+- rt2x00dev->poll_dev->private = rt2x00dev;
+- rt2x00dev->poll_dev->poll = rt2x00rfkill_poll;
+- rt2x00dev->poll_dev->poll_interval = RFKILL_POLL_INTERVAL;
++ return;
++}
+
+- rt2x00dev->poll_dev->input->name = rt2x00dev->ops->name;
+- rt2x00dev->poll_dev->input->phys = wiphy_name(rt2x00dev->hw->wiphy);
+- rt2x00dev->poll_dev->input->id.bustype = BUS_HOST;
+- rt2x00dev->poll_dev->input->id.vendor = 0x1814;
+- rt2x00dev->poll_dev->input->id.product = rt2x00dev->chip.rt;
+- rt2x00dev->poll_dev->input->id.version = rt2x00dev->chip.rev;
+- rt2x00dev->poll_dev->input->dev.parent = device;
+- rt2x00dev->poll_dev->input->evbit[0] = BIT(EV_KEY);
+- set_bit(KEY_WLAN, rt2x00dev->poll_dev->input->keybit);
++void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
++{
++ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags) ||
++ !test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
++ return;
+
+- return 0;
++ input_free_polled_device(rt2x00dev->poll_dev);
++ rt2x00dev->poll_dev = NULL;
+
+-exit_free_rfkill:
+ rfkill_free(rt2x00dev->rfkill);
+-
+-exit:
+- return -ENOMEM;
++ rt2x00dev->rfkill = NULL;
+ }
+
+-void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
++void rt2x00rfkill_suspend(struct rt2x00_dev *rt2x00dev)
+ {
+- if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags))
++ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags) ||
++ !test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
+ return;
+
+ input_free_polled_device(rt2x00dev->poll_dev);
+- rfkill_free(rt2x00dev->rfkill);
++ rt2x00dev->poll_dev = NULL;
++}
++
++void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev)
++{
++ if (!test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags) ||
++ !test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
++ return;
++
++ rt2x00dev->poll_dev = rt2x00rfkill_allocate_polldev(rt2x00dev);
++ if (!rt2x00dev->poll_dev) {
++ ERROR(rt2x00dev, "Failed to allocate polled device.\n");
++ return;
++ }
+ }
+diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
+index 7f4836b..5fa4ba0 100644
+--- a/drivers/pci/hotplug/pciehp_core.c
++++ b/drivers/pci/hotplug/pciehp_core.c
+@@ -467,7 +467,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
+ t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
+
+ t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
+- if (value) {
++ if (value && pciehp_force) {
+ rc = pciehp_enable_slot(t_slot);
+ if (rc) /* -ENODEV: shouldn't happen, but deal with it */
+ value = 0;
+diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
+index 82f5ad9..9e7de63 100644
+--- a/drivers/rtc/Kconfig
++++ b/drivers/rtc/Kconfig
+@@ -16,7 +16,7 @@ menuconfig RTC_CLASS
+ probably want to enable one or more of the interfaces below.
+
+ This driver can also be built as a module. If so, the module
+- will be called rtc-class.
++ will be called rtc-core.
+
+ if RTC_CLASS
+
+diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
+index bbf10ec..56728a2 100644
+--- a/drivers/rtc/rtc-at91sam9.c
++++ b/drivers/rtc/rtc-at91sam9.c
+@@ -274,7 +274,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *_rtc)
+ * SR clears it, so we must only read it in this irq handler!
+ */
+ mr = rtt_readl(rtc, MR) & (AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN);
+- sr = rtt_readl(rtc, SR) & mr;
++ sr = rtt_readl(rtc, SR) & (mr >> 16);
+ if (!sr)
+ return IRQ_NONE;
+
+@@ -321,6 +321,10 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
+ if (!rtc)
+ return -ENOMEM;
+
++ /* platform setup code should have handled this; sigh */
++ if (!device_can_wakeup(&pdev->dev))
++ device_init_wakeup(&pdev->dev, 1);
++
+ platform_set_drvdata(pdev, rtc);
+ rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
+ rtc->rtt += r->start;
+diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
+index c46666a..b9d3740 100644
+--- a/drivers/scsi/Kconfig
++++ b/drivers/scsi/Kconfig
+@@ -325,7 +325,7 @@ menuconfig SCSI_LOWLEVEL
+ depends on SCSI!=n
+ default y
+
+-if SCSI_LOWLEVEL
++if SCSI_LOWLEVEL && SCSI
+
+ config ISCSI_TCP
+ tristate "iSCSI Initiator over TCP/IP"
+diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
+index f608d4a..792b2e8 100644
+--- a/drivers/scsi/a100u2w.c
++++ b/drivers/scsi/a100u2w.c
+@@ -674,12 +674,13 @@ static struct orc_scb *__orc_alloc_scb(struct orc_host * host)
+ for (index = 0; index < 32; index++) {
+ if ((host->allocation_map[channel][i] >> index) & 0x01) {
+ host->allocation_map[channel][i] &= ~(1 << index);
+- break;
++ idx = index + 32 * i;
++ /*
++ * Translate the index to a structure instance
++ */
++ return host->scb_virt + idx;
+ }
+ }
+- idx = index + 32 * i;
+- /* Translate the index to a structure instance */
+- return (struct orc_scb *) ((unsigned long) host->scb_virt + (idx * sizeof(struct orc_scb)));
+ }
+ return NULL;
+ }
+diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
+index 3c2d688..8591585 100644
+--- a/drivers/scsi/advansys.c
++++ b/drivers/scsi/advansys.c
+@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr iop_base, unsigned char *buf, int size,
+ i += 2;
+ len += 2;
+ } else {
+- unsigned char off = buf[i] * 2;
++ unsigned int off = buf[i] * 2;
+ unsigned short word = (buf[off + 1] << 8) | buf[off];
+ AdvWriteWordAutoIncLram(iop_base, word);
+ len += 2;
+diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
+index 0393707..3288be2 100644
+--- a/drivers/scsi/arcmsr/arcmsr.h
++++ b/drivers/scsi/arcmsr/arcmsr.h
+@@ -341,13 +341,13 @@ struct MessageUnit_B
+ uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];
+ uint32_t postq_index;
+ uint32_t doneq_index;
+- uint32_t __iomem *drv2iop_doorbell_reg;
+- uint32_t __iomem *drv2iop_doorbell_mask_reg;
+- uint32_t __iomem *iop2drv_doorbell_reg;
+- uint32_t __iomem *iop2drv_doorbell_mask_reg;
+- uint32_t __iomem *msgcode_rwbuffer_reg;
+- uint32_t __iomem *ioctl_wbuffer_reg;
+- uint32_t __iomem *ioctl_rbuffer_reg;
++ void __iomem *drv2iop_doorbell_reg;
++ void __iomem *drv2iop_doorbell_mask_reg;
++ void __iomem *iop2drv_doorbell_reg;
++ void __iomem *iop2drv_doorbell_mask_reg;
++ void __iomem *msgcode_rwbuffer_reg;
++ void __iomem *ioctl_wbuffer_reg;
++ void __iomem *ioctl_rbuffer_reg;
+ };
+
+ /*
+diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
+index 27ebd33..0b2080d 100644
+--- a/drivers/scsi/gdth.c
++++ b/drivers/scsi/gdth.c
+@@ -493,6 +493,12 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
+ if (!scp)
+ return -ENOMEM;
+
++ scp->sense_buffer = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
++ if (!scp->sense_buffer) {
++ kfree(scp);
++ return -ENOMEM;
++ }
++
+ scp->device = sdev;
+ memset(&cmndinfo, 0, sizeof(cmndinfo));
+
+@@ -513,6 +519,7 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
+ rval = cmndinfo.status;
+ if (info)
+ *info = cmndinfo.info;
++ kfree(scp->sense_buffer);
+ kfree(scp);
+ return rval;
+ }
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
+index ba21d97..f40898d 100644
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -2162,10 +2162,15 @@ void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt)
+ {
+ unsigned long flags;
+
++#if 0
++ /* FIXME: currently this check eliminates all media change events
++ * for polled devices. Need to update to discriminate between AN
++ * and polled events */
+ if (!test_bit(evt->evt_type, sdev->supported_events)) {
+ kfree(evt);
+ return;
+ }
++#endif
+
+ spin_lock_irqsave(&sdev->list_lock, flags);
+ list_add_tail(&evt->node, &sdev->event_list);
+diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
+index ed83cdb..b9b09a7 100644
+--- a/drivers/scsi/scsi_sysfs.c
++++ b/drivers/scsi/scsi_sysfs.c
+@@ -294,6 +294,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
+ }
+
+ if (sdev->request_queue) {
++ bsg_unregister_queue(sdev->request_queue);
+ sdev->request_queue->queuedata = NULL;
+ /* user context needed to free queue */
+ scsi_free_queue(sdev->request_queue);
+@@ -857,7 +858,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
+ if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
+ return;
+
+- bsg_unregister_queue(sdev->request_queue);
+ class_device_unregister(&sdev->sdev_classdev);
+ transport_remove_device(dev);
+ device_del(dev);
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
+index 7aee64d..5fe7aae 100644
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -1654,6 +1654,7 @@ static int sd_probe(struct device *dev)
+ sdkp->disk = gd;
+ sdkp->index = index;
+ sdkp->openers = 0;
++ sdkp->previous_state = 1;
+
+ if (!sdp->timeout) {
+ if (sdp->type != TYPE_MOD)
+diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
+index 208565b..7ee86d4 100644
+--- a/drivers/scsi/sr.c
++++ b/drivers/scsi/sr.c
+@@ -623,6 +623,7 @@ static int sr_probe(struct device *dev)
+ cd->disk = disk;
+ cd->capacity = 0x1fffff;
+ cd->device->changed = 1; /* force recheck CD type */
++ cd->previous_state = 1;
+ cd->use = 1;
+ cd->readcd_known = 0;
+ cd->readcd_cdda = 0;
+diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
+index a8c116b..9d244d1 100644
+--- a/drivers/serial/sh-sci.c
++++ b/drivers/serial/sh-sci.c
+@@ -414,12 +414,12 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
+ defined(CONFIG_CPU_SUBTYPE_SH7785)
+ static inline int scif_txroom(struct uart_port *port)
+ {
+- return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0x7f);
++ return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff);
+ }
+
+ static inline int scif_rxroom(struct uart_port *port)
+ {
+- return sci_in(port, SCRFDR) & 0x7f;
++ return sci_in(port, SCRFDR) & 0xff;
+ }
+ #else
+ static inline int scif_txroom(struct uart_port *port)
+diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
+index 29fcd6d..a0aa33d 100644
+--- a/drivers/sn/ioc3.c
++++ b/drivers/sn/ioc3.c
+@@ -561,7 +561,7 @@ void ioc3_unregister_submodule(struct ioc3_submodule *is)
+ printk(KERN_WARNING
+ "%s: IOC3 submodule %s remove failed "
+ "for pci_dev %s.\n",
+- __FUNCTION__, module_name(is->owner),
++ __func__, module_name(is->owner),
+ pci_name(idd->pdev));
+ idd->active[is->id] = 0;
+ if(is->irq_mask)
+@@ -611,7 +611,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ if ((ret = pci_enable_device(pdev))) {
+ printk(KERN_WARNING
+ "%s: Failed to enable IOC3 device for pci_dev %s.\n",
+- __FUNCTION__, pci_name(pdev));
++ __func__, pci_name(pdev));
+ goto out;
+ }
+ pci_set_master(pdev);
+@@ -623,7 +623,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ if (ret < 0) {
+ printk(KERN_WARNING "%s: Unable to obtain 64 bit DMA "
+ "for consistent allocations\n",
+- __FUNCTION__);
++ __func__);
+ }
+ }
+ #endif
+@@ -633,7 +633,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ if (!idd) {
+ printk(KERN_WARNING
+ "%s: Failed to allocate IOC3 data for pci_dev %s.\n",
+- __FUNCTION__, pci_name(pdev));
++ __func__, pci_name(pdev));
+ ret = -ENODEV;
+ goto out_idd;
+ }
+@@ -649,7 +649,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ printk(KERN_WARNING
+ "%s: Unable to find IOC3 resource "
+ "for pci_dev %s.\n",
+- __FUNCTION__, pci_name(pdev));
++ __func__, pci_name(pdev));
+ ret = -ENODEV;
+ goto out_pci;
+ }
+@@ -657,7 +657,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ printk(KERN_WARNING
+ "%s: Unable to request IOC3 region "
+ "for pci_dev %s.\n",
+- __FUNCTION__, pci_name(pdev));
++ __func__, pci_name(pdev));
+ ret = -ENODEV;
+ goto out_pci;
+ }
+@@ -666,7 +666,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ printk(KERN_WARNING
+ "%s: Unable to remap IOC3 region "
+ "for pci_dev %s.\n",
+- __FUNCTION__, pci_name(pdev));
++ __func__, pci_name(pdev));
+ ret = -ENODEV;
+ goto out_misc_region;
+ }
+@@ -709,7 +709,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ } else {
+ printk(KERN_WARNING
+ "%s : request_irq fails for IRQ 0x%x\n ",
+- __FUNCTION__, pdev->irq);
++ __func__, pdev->irq);
+ }
+ if (!request_irq(pdev->irq+2, ioc3_intr_io, IRQF_SHARED,
+ "ioc3-io", (void *)idd)) {
+@@ -717,7 +717,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ } else {
+ printk(KERN_WARNING
+ "%s : request_irq fails for IRQ 0x%x\n ",
+- __FUNCTION__, pdev->irq+2);
++ __func__, pdev->irq+2);
+ }
+ } else {
+ if (!request_irq(pdev->irq, ioc3_intr_io, IRQF_SHARED,
+@@ -726,7 +726,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
+ } else {
+ printk(KERN_WARNING
+ "%s : request_irq fails for IRQ 0x%x\n ",
+- __FUNCTION__, pdev->irq);
++ __func__, pdev->irq);
+ }
+ }
+
+@@ -769,7 +769,7 @@ static void ioc3_remove(struct pci_dev *pdev)
+ printk(KERN_WARNING
+ "%s: IOC3 submodule 0x%s remove failed "
+ "for pci_dev %s.\n",
+- __FUNCTION__,
++ __func__,
+ module_name(ioc3_submodules[id]->owner),
+ pci_name(pdev));
+ idd->active[id] = 0;
+diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
+index 3ab313e..17e71d5 100644
+--- a/drivers/thermal/Kconfig
++++ b/drivers/thermal/Kconfig
+@@ -4,8 +4,6 @@
+
+ menuconfig THERMAL
+ bool "Generic Thermal sysfs driver"
+- select HWMON
+- default y
+ help
+ Generic Thermal Sysfs driver offers a generic mechanism for
+ thermal management. Usually it's made up of one or more thermal
+diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c
+index 41bd4c8..8b86e53 100644
+--- a/drivers/thermal/thermal.c
++++ b/drivers/thermal/thermal.c
@@ -30,10 +30,8 @@
#include <linux/idr.h>
#include <linux/thermal.h>
@@ -10419,6 +13269,29 @@
+
subsys_initcall(thermal_init);
module_exit(thermal_exit);
+diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
+index 2ae1e86..9d3f28b 100644
+--- a/drivers/usb/storage/isd200.c
++++ b/drivers/usb/storage/isd200.c
+@@ -1469,6 +1469,7 @@ static void isd200_free_info_ptrs(void *info_)
+ if (info) {
+ kfree(info->id);
+ kfree(info->RegsBuf);
++ kfree(info->srb.sense_buffer);
+ }
+ }
+
+@@ -1494,7 +1495,9 @@ static int isd200_init_info(struct us_data *us)
+ kzalloc(sizeof(struct hd_driveid), GFP_KERNEL);
+ info->RegsBuf = (unsigned char *)
+ kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
+- if (!info->id || !info->RegsBuf) {
++ info->srb.sense_buffer =
++ kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
++ if (!info->id || !info->RegsBuf || !info->srb.sense_buffer) {
+ isd200_free_info_ptrs(info);
+ kfree(info);
+ retStatus = ISD200_ERROR;
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index e0b0580..1bd5fb3 100644
--- a/drivers/video/Kconfig
@@ -12015,8 +14888,63 @@
* nameidata argument is passed to the filesystem methods and a filesystem
* using this helper needs to be prepared for that.
*/
+diff --git a/fs/nfs/read.c b/fs/nfs/read.c
+index 3d7d963..5a70be5 100644
+--- a/fs/nfs/read.c
++++ b/fs/nfs/read.c
+@@ -533,7 +533,10 @@ readpage_async_filler(void *data, struct page *page)
+
+ if (len < PAGE_CACHE_SIZE)
+ zero_user_segment(page, len, PAGE_CACHE_SIZE);
+- nfs_pageio_add_request(desc->pgio, new);
++ if (!nfs_pageio_add_request(desc->pgio, new)) {
++ error = desc->pgio->pg_error;
++ goto out_unlock;
++ }
+ return 0;
+ out_error:
+ error = PTR_ERR(new);
+diff --git a/fs/nfs/super.c b/fs/nfs/super.c
+index fcf4b98..dd4dfcd 100644
+--- a/fs/nfs/super.c
++++ b/fs/nfs/super.c
+@@ -632,7 +632,7 @@ static int nfs_verify_server_address(struct sockaddr *addr)
+ switch (addr->sa_family) {
+ case AF_INET: {
+ struct sockaddr_in *sa = (struct sockaddr_in *)addr;
+- return sa->sin_addr.s_addr != INADDR_ANY;
++ return sa->sin_addr.s_addr != htonl(INADDR_ANY);
+ }
+ case AF_INET6: {
+ struct in6_addr *sa = &((struct sockaddr_in6 *)addr)->sin6_addr;
+diff --git a/fs/nfs/write.c b/fs/nfs/write.c
+index 80c61fd..bed6341 100644
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -39,6 +39,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*,
+ unsigned int, unsigned int);
+ static void nfs_pageio_init_write(struct nfs_pageio_descriptor *desc,
+ struct inode *inode, int ioflags);
++static void nfs_redirty_request(struct nfs_page *req);
+ static const struct rpc_call_ops nfs_write_partial_ops;
+ static const struct rpc_call_ops nfs_write_full_ops;
+ static const struct rpc_call_ops nfs_commit_ops;
+@@ -288,7 +289,12 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
+ BUG();
+ }
+ spin_unlock(&inode->i_lock);
+- nfs_pageio_add_request(pgio, req);
++ if (!nfs_pageio_add_request(pgio, req)) {
++ nfs_redirty_request(req);
++ nfs_end_page_writeback(page);
++ nfs_clear_page_tag_locked(req);
++ return pgio->pg_error;
++ }
+ return 0;
+ }
+
diff --git a/fs/proc/base.c b/fs/proc/base.c
-index 9a4da0a..8a10f6f 100644
+index 9a4da0a..81d7d14 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1036,6 +1036,26 @@ static const struct file_operations proc_loginuid_operations = {
@@ -12046,6 +14974,15 @@
#endif
#ifdef CONFIG_FAULT_INJECTION
+@@ -2270,7 +2290,7 @@ static const struct pid_entry tgid_base_stuff[] = {
+ DIR("fd", S_IRUSR|S_IXUSR, fd),
+ DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo),
+ #ifdef CONFIG_NET
+- DIR("net", S_IRUGO|S_IXUSR, net),
++ DIR("net", S_IRUGO|S_IXUGO, net),
+ #endif
+ REG("environ", S_IRUSR, environ),
+ INF("auxv", S_IRUSR, pid_auxv),
@@ -2319,6 +2339,7 @@ static const struct pid_entry tgid_base_stuff[] = {
REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust),
#ifdef CONFIG_AUDITSYSCALL
@@ -12221,6 +15158,241 @@
#define IRQ_LCD_FIFO S3C2410_IRQ(52)
#define IRQ_LCD_FRAME S3C2410_IRQ(53)
+diff --git a/include/asm-sh/byteorder.h b/include/asm-sh/byteorder.h
+index 0eb9904..4c13e61 100644
+--- a/include/asm-sh/byteorder.h
++++ b/include/asm-sh/byteorder.h
+@@ -11,13 +11,13 @@
+ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+ {
+ __asm__(
+-#ifdef CONFIG_SUPERH32
++#ifdef __SH5__
++ "byterev %0, %0\n\t"
++ "shari %0, 32, %0"
++#else
+ "swap.b %0, %0\n\t"
+ "swap.w %0, %0\n\t"
+ "swap.b %0, %0"
+-#else
+- "byterev %0, %0\n\t"
+- "shari %0, 32, %0"
+ #endif
+ : "=r" (x)
+ : "0" (x));
+@@ -28,12 +28,11 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+ static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
+ {
+ __asm__(
+-#ifdef CONFIG_SUPERH32
+- "swap.b %0, %0"
+-#else
++#ifdef __SH5__
+ "byterev %0, %0\n\t"
+ "shari %0, 32, %0"
+-
++#else
++ "swap.b %0, %0"
+ #endif
+ : "=r" (x)
+ : "0" (x));
+diff --git a/include/asm-sh/posix_types.h b/include/asm-sh/posix_types.h
+index 4b9d11c..4eeb723 100644
+--- a/include/asm-sh/posix_types.h
++++ b/include/asm-sh/posix_types.h
+@@ -4,4 +4,10 @@
+ # else
+ # include "posix_types_64.h"
+ # endif
++#else
++# ifdef __SH5__
++# include "posix_types_64.h"
++# else
++# include "posix_types_32.h"
++# endif
+ #endif /* __KERNEL__ */
+diff --git a/include/asm-sparc64/backoff.h b/include/asm-sparc64/backoff.h
+index dadd6c3..fa1fdf6 100644
+--- a/include/asm-sparc64/backoff.h
++++ b/include/asm-sparc64/backoff.h
+@@ -12,7 +12,8 @@
+ mov reg, tmp; \
+ 88: brnz,pt tmp, 88b; \
+ sub tmp, 1, tmp; \
+- cmp reg, BACKOFF_LIMIT; \
++ set BACKOFF_LIMIT, tmp; \
++ cmp reg, tmp; \
+ bg,pn %xcc, label; \
+ nop; \
+ ba,pt %xcc, label; \
+diff --git a/include/asm-x86/cmpxchg_32.h b/include/asm-x86/cmpxchg_32.h
+index cea1dae..959fad0 100644
+--- a/include/asm-x86/cmpxchg_32.h
++++ b/include/asm-x86/cmpxchg_32.h
+@@ -269,22 +269,26 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old,
+ ({ \
+ __typeof__(*(ptr)) __ret; \
+ if (likely(boot_cpu_data.x86 > 3)) \
+- __ret = __cmpxchg((ptr), (unsigned long)(o), \
+- (unsigned long)(n), sizeof(*(ptr))); \
++ __ret = (__typeof__(*(ptr)))__cmpxchg((ptr), \
++ (unsigned long)(o), (unsigned long)(n), \
++ sizeof(*(ptr))); \
+ else \
+- __ret = cmpxchg_386((ptr), (unsigned long)(o), \
+- (unsigned long)(n), sizeof(*(ptr))); \
++ __ret = (__typeof__(*(ptr)))cmpxchg_386((ptr), \
++ (unsigned long)(o), (unsigned long)(n), \
++ sizeof(*(ptr))); \
+ __ret; \
+ })
+ #define cmpxchg_local(ptr, o, n) \
+ ({ \
+ __typeof__(*(ptr)) __ret; \
+ if (likely(boot_cpu_data.x86 > 3)) \
+- __ret = __cmpxchg_local((ptr), (unsigned long)(o), \
+- (unsigned long)(n), sizeof(*(ptr))); \
++ __ret = (__typeof__(*(ptr)))__cmpxchg_local((ptr), \
++ (unsigned long)(o), (unsigned long)(n), \
++ sizeof(*(ptr))); \
+ else \
+- __ret = cmpxchg_386((ptr), (unsigned long)(o), \
+- (unsigned long)(n), sizeof(*(ptr))); \
++ __ret = (__typeof__(*(ptr)))cmpxchg_386((ptr), \
++ (unsigned long)(o), (unsigned long)(n), \
++ sizeof(*(ptr))); \
+ __ret; \
+ })
+ #endif
+@@ -301,10 +305,12 @@ extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
+ ({ \
+ __typeof__(*(ptr)) __ret; \
+ if (likely(boot_cpu_data.x86 > 4)) \
+- __ret = __cmpxchg64((ptr), (unsigned long long)(o), \
++ __ret = (__typeof__(*(ptr)))__cmpxchg64((ptr), \
++ (unsigned long long)(o), \
+ (unsigned long long)(n)); \
+ else \
+- __ret = cmpxchg_486_u64((ptr), (unsigned long long)(o), \
++ __ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr), \
++ (unsigned long long)(o), \
+ (unsigned long long)(n)); \
+ __ret; \
+ })
+@@ -312,10 +318,12 @@ extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64);
+ ({ \
+ __typeof__(*(ptr)) __ret; \
+ if (likely(boot_cpu_data.x86 > 4)) \
+- __ret = __cmpxchg64_local((ptr), (unsigned long long)(o), \
++ __ret = (__typeof__(*(ptr)))__cmpxchg64_local((ptr), \
++ (unsigned long long)(o), \
+ (unsigned long long)(n)); \
+ else \
+- __ret = cmpxchg_486_u64((ptr), (unsigned long long)(o), \
++ __ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr), \
++ (unsigned long long)(o), \
+ (unsigned long long)(n)); \
+ __ret; \
+ })
+diff --git a/include/asm-x86/e820_32.h b/include/asm-x86/e820_32.h
+index f1da7eb..e7207a6 100644
+--- a/include/asm-x86/e820_32.h
++++ b/include/asm-x86/e820_32.h
+@@ -28,6 +28,8 @@ extern void find_max_pfn(void);
+ extern void register_bootmem_low_pages(unsigned long max_low_pfn);
+ extern void add_memory_region(unsigned long long start,
+ unsigned long long size, int type);
++extern void update_memory_range(u64 start, u64 size, unsigned old_type,
++ unsigned new_type);
+ extern void e820_register_memory(void);
+ extern void limit_regions(unsigned long long size);
+ extern void print_memory_map(char *who);
+diff --git a/include/asm-x86/e820_64.h b/include/asm-x86/e820_64.h
+index a560c4f..22ede73 100644
+--- a/include/asm-x86/e820_64.h
++++ b/include/asm-x86/e820_64.h
+@@ -18,6 +18,8 @@ extern unsigned long find_e820_area(unsigned long start, unsigned long end,
+ unsigned size, unsigned long align);
+ extern void add_memory_region(unsigned long start, unsigned long size,
+ int type);
++extern void update_memory_range(u64 start, u64 size, unsigned old_type,
++ unsigned new_type);
+ extern void setup_memory_region(void);
+ extern void contig_e820_setup(void);
+ extern unsigned long e820_end_of_ram(void);
+diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
+index 1cb7c51..a05b289 100644
+--- a/include/asm-x86/page.h
++++ b/include/asm-x86/page.h
+@@ -52,13 +52,13 @@ extern int page_is_ram(unsigned long pagenr);
+
+ struct page;
+
+-static void inline clear_user_page(void *page, unsigned long vaddr,
++static inline void clear_user_page(void *page, unsigned long vaddr,
+ struct page *pg)
+ {
+ clear_page(page);
+ }
+
+-static void inline copy_user_page(void *to, void *from, unsigned long vaddr,
++static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
+ struct page *topage)
+ {
+ copy_page(to, from);
+diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
+index 3746903..da8266a 100644
+--- a/include/asm-x86/pci_64.h
++++ b/include/asm-x86/pci_64.h
+@@ -25,6 +25,7 @@ extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int l
+
+
+
++extern void dma32_reserve_bootmem(void);
+ extern void pci_iommu_alloc(void);
+
+ /* The PCI address space does equal the physical memory
+diff --git a/include/asm-x86/sync_bitops.h b/include/asm-x86/sync_bitops.h
+index cbce08a..6b775c9 100644
+--- a/include/asm-x86/sync_bitops.h
++++ b/include/asm-x86/sync_bitops.h
+@@ -23,10 +23,6 @@
+ * This function is atomic and may not be reordered. See __set_bit()
+ * if you do not require the atomic guarantees.
+ *
+- * Note: there are no guarantees that this function will not be reordered
+- * on non-x86 architectures, so if you are writing portable code,
+- * make sure not to rely on its reordering guarantees.
+- *
+ * Note that @nr may be almost arbitrarily large; this function is not
+ * restricted to acting on a single-word quantity.
+ */
+@@ -61,8 +57,7 @@ static inline void sync_clear_bit(int nr, volatile unsigned long * addr)
+ * @nr: Bit to change
+ * @addr: Address to start counting from
+ *
+- * change_bit() is atomic and may not be reordered. It may be
+- * reordered on other architectures than x86.
++ * sync_change_bit() is atomic and may not be reordered.
+ * Note that @nr may be almost arbitrarily large; this function is not
+ * restricted to acting on a single-word quantity.
+ */
+@@ -80,7 +75,6 @@ static inline void sync_change_bit(int nr, volatile unsigned long * addr)
+ * @addr: Address to count from
+ *
+ * This operation is atomic and cannot be reordered.
+- * It may be reordered on other architectures than x86.
+ * It also implies a memory barrier.
+ */
+ static inline int sync_test_and_set_bit(int nr, volatile unsigned long * addr)
+@@ -99,7 +93,6 @@ static inline int sync_test_and_set_bit(int nr, volatile unsigned long * addr)
+ * @addr: Address to count from
+ *
+ * This operation is atomic and cannot be reordered.
+- * It can be reorderdered on other architectures other than x86.
+ * It also implies a memory barrier.
+ */
+ static inline int sync_test_and_clear_bit(int nr, volatile unsigned long * addr)
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 0fac822..4108b38 100644
--- a/include/linux/Kbuild
@@ -12233,6 +15405,19 @@
header-y += qnxtypes.h
header-y += quotaio_v1.h
header-y += quotaio_v2.h
+diff --git a/include/linux/in.h b/include/linux/in.h
+index 70c6df8..4065313 100644
+--- a/include/linux/in.h
++++ b/include/linux/in.h
+@@ -265,7 +265,7 @@ static inline bool ipv4_is_local_multicast(__be32 addr)
+ static inline bool ipv4_is_lbcast(__be32 addr)
+ {
+ /* limited broadcast */
+- return addr == INADDR_BROADCAST;
++ return addr == htonl(INADDR_BROADCAST);
+ }
+
+ static inline bool ipv4_is_zeronet(__be32 addr)
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index b18fd3b..423f582 100644
--- a/include/linux/jbd.h
@@ -12295,6 +15480,36 @@
void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask);
extern int pci_pci_problems;
+diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
+index 28dfc61..99efbed 100644
+--- a/include/linux/pkt_cls.h
++++ b/include/linux/pkt_cls.h
+@@ -201,8 +201,8 @@ enum
+
+ struct tc_u32_key
+ {
+- __u32 mask;
+- __u32 val;
++ __be32 mask;
++ __be32 val;
+ int off;
+ int offmask;
+ };
+@@ -213,12 +213,12 @@ struct tc_u32_sel
+ unsigned char offshift;
+ unsigned char nkeys;
+
+- __u16 offmask;
++ __be16 offmask;
+ __u16 off;
+ short offoff;
+
+ short hoff;
+- __u32 hmask;
++ __be32 hmask;
+ struct tc_u32_key keys[0];
+ };
+
diff --git a/include/linux/ps2esdi.h b/include/linux/ps2esdi.h
deleted file mode 100644
index c0e050b..0000000
@@ -12422,10 +15637,18 @@
}
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 11d8e9a..3625fca 100644
+index 11d8e9a..fed07d0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -929,6 +929,9 @@ struct sched_entity {
+@@ -790,6 +790,7 @@ struct sched_domain {
+ };
+
+ extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new);
++extern int arch_reinit_sched_domains(void);
+
+ #endif /* CONFIG_SMP */
+
+@@ -929,6 +930,9 @@ struct sched_entity {
u64 vruntime;
u64 prev_sum_exec_runtime;
@@ -12457,10 +15680,19 @@
static inline int security_task_wait (struct task_struct *p)
diff --git a/include/linux/topology.h b/include/linux/topology.h
-index 2352f46..2d8dac8 100644
+index 2352f46..bd14f8b 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
-@@ -138,7 +138,6 @@
+@@ -50,6 +50,8 @@
+ for_each_online_node(node) \
+ if (nr_cpus_node(node))
+
++void arch_update_cpu_topology(void);
++
+ /* Conform to ACPI 2.0 SLIT distance definitions */
+ #define LOCAL_DISTANCE 10
+ #define REMOTE_DISTANCE 20
+@@ -138,7 +140,6 @@
| SD_BALANCE_FORK \
| SD_BALANCE_EXEC \
| SD_WAKE_AFFINE \
@@ -12484,6 +15716,84 @@
*
* Locking rules are straightforward: the driver is responsible for
* locking. No two operations may be invoked simultaneously.
+diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
+index 57df27f..57ed3e3 100644
+--- a/include/net/sctp/sctp.h
++++ b/include/net/sctp/sctp.h
+@@ -380,15 +380,19 @@ static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int
+
+ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+
+-int sctp_v6_init(void);
+-void sctp_v6_exit(void);
++void sctp_v6_pf_init(void);
++void sctp_v6_pf_exit(void);
++int sctp_v6_protosw_init(void);
++void sctp_v6_protosw_exit(void);
+ int sctp_v6_add_protocol(void);
+ void sctp_v6_del_protocol(void);
+
+ #else /* #ifdef defined(CONFIG_IPV6) */
+
+-static inline int sctp_v6_init(void) { return 0; }
+-static inline void sctp_v6_exit(void) { return; }
++static inline void sctp_v6_pf_init(void) { return 0; }
++static inline void sctp_v6_pf_exit(void) { return; }
++static inline int sctp_v6_protosw_init(void) { return 0; }
++static inline void sctp_v6_protosw_exit(void) { return; }
+ static inline int sctp_v6_add_protocol(void) { return 0; }
+ static inline void sctp_v6_del_protocol(void) { return; }
+
+diff --git a/include/net/xfrm.h b/include/net/xfrm.h
+index eea7785..619c53b 100644
+--- a/include/net/xfrm.h
++++ b/include/net/xfrm.h
+@@ -277,7 +277,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
+ struct xfrm_state_afinfo {
+ unsigned int family;
+ unsigned int proto;
+- unsigned int eth_proto;
++ __be16 eth_proto;
+ struct module *owner;
+ const struct xfrm_type *type_map[IPPROTO_MAX];
+ struct xfrm_mode *mode_map[XFRM_MODE_MAX];
+diff --git a/kernel/audit.c b/kernel/audit.c
+index 10c4930..be55cb5 100644
+--- a/kernel/audit.c
++++ b/kernel/audit.c
+@@ -78,9 +78,13 @@ static int audit_default;
+ /* If auditing cannot proceed, audit_failure selects what happens. */
+ static int audit_failure = AUDIT_FAIL_PRINTK;
+
+-/* If audit records are to be written to the netlink socket, audit_pid
+- * contains the (non-zero) pid. */
++/*
++ * If audit records are to be written to the netlink socket, audit_pid
++ * contains the pid of the auditd process and audit_nlk_pid contains
++ * the pid to use to send netlink messages to that process.
++ */
+ int audit_pid;
++static int audit_nlk_pid;
+
+ /* If audit_rate_limit is non-zero, limit the rate of sending audit records
+ * to that number per second. This prevents DoS attacks, but results in
+@@ -350,7 +354,7 @@ static int kauditd_thread(void *dummy)
+ wake_up(&audit_backlog_wait);
+ if (skb) {
+ if (audit_pid) {
+- int err = netlink_unicast(audit_sock, skb, audit_pid, 0);
++ int err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0);
+ if (err < 0) {
+ BUG_ON(err != -ECONNREFUSED); /* Shoudn't happen */
+ printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
+@@ -626,6 +630,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
+ sid, 1);
+
+ audit_pid = new_pid;
++ audit_nlk_pid = NETLINK_CB(skb).pid;
+ }
+ if (status_get->mask & AUDIT_STATUS_RATE_LIMIT)
+ err = audit_set_rate_limit(status_get->rate_limit,
diff --git a/kernel/relay.c b/kernel/relay.c
index d080b9d..4c035a8 100644
--- a/kernel/relay.c
@@ -12509,10 +15819,31 @@
unsigned int cur_pos = read_start + total_len;
diff --git a/kernel/sched.c b/kernel/sched.c
-index d1ad69b..3f7c5eb 100644
+index d1ad69b..28c73f0 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
-@@ -1396,6 +1396,12 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
+@@ -594,18 +594,14 @@ enum {
+ SCHED_FEAT_NEW_FAIR_SLEEPERS = 1,
+ SCHED_FEAT_WAKEUP_PREEMPT = 2,
+ SCHED_FEAT_START_DEBIT = 4,
+- SCHED_FEAT_TREE_AVG = 8,
+- SCHED_FEAT_APPROX_AVG = 16,
+- SCHED_FEAT_HRTICK = 32,
+- SCHED_FEAT_DOUBLE_TICK = 64,
++ SCHED_FEAT_HRTICK = 8,
++ SCHED_FEAT_DOUBLE_TICK = 16,
+ };
+
+ const_debug unsigned int sysctl_sched_features =
+ SCHED_FEAT_NEW_FAIR_SLEEPERS * 1 |
+ SCHED_FEAT_WAKEUP_PREEMPT * 1 |
+ SCHED_FEAT_START_DEBIT * 1 |
+- SCHED_FEAT_TREE_AVG * 0 |
+- SCHED_FEAT_APPROX_AVG * 0 |
+ SCHED_FEAT_HRTICK * 1 |
+ SCHED_FEAT_DOUBLE_TICK * 0;
+
+@@ -1396,6 +1392,12 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
{
s64 delta;
@@ -12525,7 +15856,7 @@
if (p->sched_class != &fair_sched_class)
return 0;
-@@ -1855,10 +1861,11 @@ out_activate:
+@@ -1855,10 +1857,11 @@ out_activate:
schedstat_inc(p, se.nr_wakeups_remote);
update_rq_clock(rq);
activate_task(rq, p, 1);
@@ -12538,7 +15869,7 @@
p->state = TASK_RUNNING;
#ifdef CONFIG_SMP
if (p->sched_class->task_wake_up)
-@@ -1892,6 +1899,8 @@ static void __sched_fork(struct task_struct *p)
+@@ -1892,6 +1895,8 @@ static void __sched_fork(struct task_struct *p)
p->se.exec_start = 0;
p->se.sum_exec_runtime = 0;
p->se.prev_sum_exec_runtime = 0;
@@ -12547,6 +15878,43 @@
#ifdef CONFIG_SCHEDSTATS
p->se.wait_start = 0;
+@@ -3877,7 +3882,7 @@ need_resched_nonpreemptible:
+
+ if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
+ if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
+- unlikely(signal_pending(prev)))) {
++ signal_pending(prev))) {
+ prev->state = TASK_RUNNING;
+ } else {
+ deactivate_task(rq, prev, 1);
+@@ -6802,6 +6807,10 @@ static int ndoms_cur; /* number of sched domains in 'doms_cur' */
+ */
+ static cpumask_t fallback_doms;
+
++void __attribute__((weak)) arch_update_cpu_topology(void)
++{
++}
++
+ /*
+ * Set up scheduler domains and groups. Callers must hold the hotplug lock.
+ * For now this just excludes isolated cpus, but could be used to
+@@ -6811,6 +6820,7 @@ static int arch_init_sched_domains(const cpumask_t *cpu_map)
+ {
+ int err;
+
++ arch_update_cpu_topology();
+ ndoms_cur = 1;
+ doms_cur = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
+ if (!doms_cur)
+@@ -6915,7 +6925,7 @@ match2:
+ }
+
+ #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
+-static int arch_reinit_sched_domains(void)
++int arch_reinit_sched_domains(void)
+ {
+ int err;
+
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 4b5e24c..ef358ba 100644
--- a/kernel/sched_debug.c
@@ -12560,7 +15928,7 @@
nr_switches = p->nvcsw + p->nivcsw;
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
-index f2cc590..b85cac4 100644
+index f2cc590..86a9337 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -73,13 +73,13 @@ unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL;
@@ -12579,7 +15947,35 @@
const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
-@@ -556,6 +556,21 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
+@@ -302,11 +302,6 @@ static u64 __sched_vslice(unsigned long rq_weight, unsigned long nr_running)
+ return vslice;
+ }
+
+-static u64 sched_vslice(struct cfs_rq *cfs_rq)
+-{
+- return __sched_vslice(cfs_rq->load.weight, cfs_rq->nr_running);
+-}
+-
+ static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
+ {
+ return __sched_vslice(cfs_rq->load.weight + se->load.weight,
+@@ -504,15 +499,6 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
+ } else
+ vruntime = cfs_rq->min_vruntime;
+
+- if (sched_feat(TREE_AVG)) {
+- struct sched_entity *last = __pick_last_entity(cfs_rq);
+- if (last) {
+- vruntime += last->vruntime;
+- vruntime >>= 1;
+- }
+- } else if (sched_feat(APPROX_AVG) && cfs_rq->nr_running)
+- vruntime += sched_vslice(cfs_rq)/2;
+-
+ /*
+ * The 'current' period is already promised to the current tasks,
+ * however the extra weight of the new task will slow them down a
+@@ -556,6 +542,21 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup)
account_entity_enqueue(cfs_rq, se);
}
@@ -12601,7 +15997,7 @@
static void
dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
{
-@@ -566,6 +581,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
+@@ -566,6 +567,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
update_stats_dequeue(cfs_rq, se);
if (sleep) {
@@ -12609,7 +16005,7 @@
#ifdef CONFIG_SCHEDSTATS
if (entity_is_task(se)) {
struct task_struct *tsk = task_of(se);
-@@ -980,96 +996,121 @@ static inline int wake_idle(int cpu, struct task_struct *p)
+@@ -980,96 +982,121 @@ static inline int wake_idle(int cpu, struct task_struct *p)
#endif
#ifdef CONFIG_SMP
@@ -12644,16 +16040,10 @@
+ p->se.avg_overlap < sysctl_sched_migration_cost)
+ return 1;
+ }
-
-- cpu = task_cpu(p);
-- rq = task_rq(p);
-- this_cpu = smp_processor_id();
-- new_cpu = cpu;
++
+ schedstat_inc(p, se.nr_wakeups_affine_attempts);
+ tl_per_task = cpu_avg_load_per_task(this_cpu);
-
-- if (cpu == this_cpu)
-- goto out_set_cpu;
++
+ /*
+ * If sync wakeup then subtract the (maximum possible)
+ * effect of the currently running task from the load
@@ -12672,11 +16062,17 @@
+ schedstat_inc(this_sd, ttwu_move_affine);
+ schedstat_inc(p, se.nr_wakeups_affine);
+- cpu = task_cpu(p);
+- rq = task_rq(p);
+- this_cpu = smp_processor_id();
+- new_cpu = cpu;
+ return 1;
+ }
+ return 0;
+}
-+
+
+- if (cpu == this_cpu)
+- goto out_set_cpu;
+static int select_task_rq_fair(struct task_struct *p, int sync)
+{
+ struct sched_domain *sd, *this_sd = NULL;
@@ -12691,7 +16087,7 @@
+ this_cpu = smp_processor_id();
+ this_rq = cpu_rq(this_cpu);
+ new_cpu = prev_cpu;
-+
+
+ /*
+ * 'this_sd' is the first domain that both
+ * this_cpu and prev_cpu are present in:
@@ -12802,7 +16198,7 @@
return wake_idle(new_cpu, p);
}
#endif /* CONFIG_SMP */
-@@ -1092,6 +1133,10 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
+@@ -1092,6 +1119,10 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
return;
}
@@ -13420,6 +16816,51 @@
*
* This function reserves a range of kernel address space, and
* allocates pagetables to map that range. No actual mappings
+diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
+index 77f04e4..8fbcefe 100644
+--- a/net/8021q/vlan_dev.c
++++ b/net/8021q/vlan_dev.c
+@@ -382,7 +382,7 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ vlan_dev_info(dev)->cnt_encap_on_xmit++;
+
+ pr_debug("%s: proto to encap: 0x%hx\n",
+- __FUNCTION__, htons(veth->h_vlan_proto));
++ __FUNCTION__, ntohs(veth->h_vlan_proto));
+ /* Construct the second two bytes. This field looks something
+ * like:
+ * usr_priority: 3 bits (high bits)
+diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
+index bc40377..9326c37 100644
+--- a/net/bridge/br_fdb.c
++++ b/net/bridge/br_fdb.c
+@@ -136,7 +136,7 @@ void br_fdb_cleanup(unsigned long _data)
+ this_timer = f->ageing_timer + delay;
+ if (time_before_eq(this_timer, jiffies))
+ fdb_delete(f);
+- else if (this_timer < next_timer)
++ else if (time_before(this_timer, next_timer))
+ next_timer = this_timer;
+ }
+ }
+diff --git a/net/core/netpoll.c b/net/core/netpoll.c
+index 4b7e756..c635de5 100644
+--- a/net/core/netpoll.c
++++ b/net/core/netpoll.c
+@@ -215,10 +215,12 @@ static void zap_completion_queue(void)
+ while (clist != NULL) {
+ struct sk_buff *skb = clist;
+ clist = clist->next;
+- if (skb->destructor)
++ if (skb->destructor) {
++ atomic_inc(&skb->users);
+ dev_kfree_skb_any(skb); /* put this one back */
+- else
++ } else {
+ __kfree_skb(skb);
++ }
+ }
+ }
+
diff --git a/net/core/sock.c b/net/core/sock.c
index 09cb3a7..2654c14 100644
--- a/net/core/sock.c
@@ -13442,6 +16883,527 @@
/* Should agree with poll, otherwise some programs break */
if (sock_writeable(sk))
+diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
+index 09ca529..0d10950 100644
+--- a/net/ipv4/af_inet.c
++++ b/net/ipv4/af_inet.c
+@@ -458,7 +458,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
+ err = -EADDRNOTAVAIL;
+ if (!sysctl_ip_nonlocal_bind &&
+ !inet->freebind &&
+- addr->sin_addr.s_addr != INADDR_ANY &&
++ addr->sin_addr.s_addr != htonl(INADDR_ANY) &&
+ chk_addr_ret != RTN_LOCAL &&
+ chk_addr_ret != RTN_MULTICAST &&
+ chk_addr_ret != RTN_BROADCAST)
+diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
+index 091e670..f3ceca3 100644
+--- a/net/ipv4/esp4.c
++++ b/net/ipv4/esp4.c
+@@ -168,7 +168,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb)
+ struct xfrm_encap_tmpl *encap = x->encap;
+ struct udphdr *uh;
+ __be32 *udpdata32;
+- unsigned int sport, dport;
++ __be16 sport, dport;
+ int encap_type;
+
+ spin_lock_bh(&x->lock);
+diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
+index de0572c..f72457b 100644
+--- a/net/ipv4/ip_sockglue.c
++++ b/net/ipv4/ip_sockglue.c
+@@ -583,7 +583,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
+ }
+
+ if (!mreq.imr_ifindex) {
+- if (mreq.imr_address.s_addr == INADDR_ANY) {
++ if (mreq.imr_address.s_addr == htonl(INADDR_ANY)) {
+ inet->mc_index = 0;
+ inet->mc_addr = 0;
+ err = 0;
+diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
+index 5dd9385..7c992fb 100644
+--- a/net/ipv4/ipconfig.c
++++ b/net/ipv4/ipconfig.c
+@@ -103,6 +103,7 @@
+ - '3' from resolv.h */
+
+ #define NONE __constant_htonl(INADDR_NONE)
++#define ANY __constant_htonl(INADDR_ANY)
+
+ /*
+ * Public IP configuration
+@@ -1479,19 +1480,19 @@ static int __init ip_auto_config_setup(char *addrs)
+ DBG(("IP-Config: Parameter #%d: `%s'\n", num, ip));
+ switch (num) {
+ case 0:
+- if ((ic_myaddr = in_aton(ip)) == INADDR_ANY)
++ if ((ic_myaddr = in_aton(ip)) == ANY)
+ ic_myaddr = NONE;
+ break;
+ case 1:
+- if ((ic_servaddr = in_aton(ip)) == INADDR_ANY)
++ if ((ic_servaddr = in_aton(ip)) == ANY)
+ ic_servaddr = NONE;
+ break;
+ case 2:
+- if ((ic_gateway = in_aton(ip)) == INADDR_ANY)
++ if ((ic_gateway = in_aton(ip)) == ANY)
+ ic_gateway = NONE;
+ break;
+ case 3:
+- if ((ic_netmask = in_aton(ip)) == INADDR_ANY)
++ if ((ic_netmask = in_aton(ip)) == ANY)
+ ic_netmask = NONE;
+ break;
+ case 4:
+diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
+index 68cbe3c..8e8f042 100644
+--- a/net/ipv4/netfilter/ipt_recent.c
++++ b/net/ipv4/netfilter/ipt_recent.c
+@@ -252,6 +252,8 @@ recent_mt_check(const char *tablename, const void *ip,
+ if ((info->check_set & (IPT_RECENT_SET | IPT_RECENT_REMOVE)) &&
+ (info->seconds || info->hit_count))
+ return false;
++ if (info->hit_count > ip_pkt_list_tot)
++ return false;
+ if (info->name[0] == '\0' ||
+ strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN)
+ return false;
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
+index 01578f5..72b9350 100644
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -255,7 +255,7 @@ static u16 tcp_select_window(struct sock *sk)
+ *
+ * Relax Will Robinson.
+ */
+- new_win = cur_win;
++ new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale);
+ }
+ tp->rcv_wnd = new_win;
+ tp->rcv_wup = tp->rcv_nxt;
+diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
+index 58219df..47263e4 100644
+--- a/net/ipv6/Kconfig
++++ b/net/ipv6/Kconfig
+@@ -179,11 +179,12 @@ config IPV6_SIT
+ Saying M here will produce a module called sit.ko. If unsure, say Y.
+
+ config IPV6_TUNNEL
+- tristate "IPv6: IPv6-in-IPv6 tunnel"
++ tristate "IPv6: IP-in-IPv6 tunnel (RFC2473)"
+ select INET6_TUNNEL
+ depends on IPV6
+ ---help---
+- Support for IPv6-in-IPv6 tunnels described in RFC 2473.
++ Support for IPv6-in-IPv6 and IPv4-in-IPv6 tunnels described in
++ RFC 2473.
+
+ If unsure, say N.
+
+diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
+index 6213787..898f192 100644
+--- a/net/netfilter/nf_conntrack_h323_main.c
++++ b/net/netfilter/nf_conntrack_h323_main.c
+@@ -842,7 +842,7 @@ static int process_setup(struct sk_buff *skb, struct nf_conn *ct,
+
+ set_h225_addr = rcu_dereference(set_h225_addr_hook);
+ if ((setup->options & eSetup_UUIE_destCallSignalAddress) &&
+- (set_h225_addr) && ct->status && IPS_NAT_MASK &&
++ (set_h225_addr) && ct->status & IPS_NAT_MASK &&
+ get_h225_addr(ct, *data, &setup->destCallSignalAddress,
+ &addr, &port) &&
+ memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) {
+diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
+index b18fa95..c5c16b4 100644
+--- a/net/sched/cls_u32.c
++++ b/net/sched/cls_u32.c
+@@ -89,7 +89,7 @@ static const struct tcf_ext_map u32_ext_map = {
+
+ static struct tc_u_common *u32_list;
+
+-static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift)
++static __inline__ unsigned u32_hash_fold(__be32 key, struct tc_u32_sel *sel, u8 fshift)
+ {
+ unsigned h = ntohl(key & sel->hmask)>>fshift;
+
+@@ -137,7 +137,7 @@ next_knode:
+
+ for (i = n->sel.nkeys; i>0; i--, key++) {
+
+- if ((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
++ if ((*(__be32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
+ n = n->next;
+ goto next_knode;
+ }
+@@ -182,7 +182,7 @@ check_terminal:
+ ht = n->ht_down;
+ sel = 0;
+ if (ht->divisor)
+- sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
++ sel = ht->divisor&u32_hash_fold(*(__be32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
+
+ if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
+ goto next_ht;
+@@ -190,7 +190,7 @@ check_terminal:
+ if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
+ off2 = n->sel.off + 3;
+ if (n->sel.flags&TC_U32_VAROFFSET)
+- off2 += ntohs(n->sel.offmask & *(u16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
++ off2 += ntohs(n->sel.offmask & *(__be16*)(ptr+n->sel.offoff)) >>n->sel.offshift;
+ off2 &= ~3;
+ }
+ if (n->sel.flags&TC_U32_EAT) {
+diff --git a/net/sched/em_u32.c b/net/sched/em_u32.c
+index 112796e..953f147 100644
+--- a/net/sched/em_u32.c
++++ b/net/sched/em_u32.c
+@@ -35,7 +35,7 @@ static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em,
+ if (!tcf_valid_offset(skb, ptr, sizeof(u32)))
+ return 0;
+
+- return !(((*(u32*) ptr) ^ key->val) & key->mask);
++ return !(((*(__be32*) ptr) ^ key->val) & key->mask);
+ }
+
+ static struct tcf_ematch_ops em_u32_ops = {
+diff --git a/net/sctp/input.c b/net/sctp/input.c
+index 57fe2f8..812ff17 100644
+--- a/net/sctp/input.c
++++ b/net/sctp/input.c
+@@ -944,7 +944,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb,
+ static struct sctp_association *__sctp_rcv_asconf_lookup(
+ sctp_chunkhdr_t *ch,
+ const union sctp_addr *laddr,
+- __be32 peer_port,
++ __be16 peer_port,
+ struct sctp_transport **transportp)
+ {
+ sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch;
+diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
+index 9aa0733..b1e05d7 100644
+--- a/net/sctp/ipv6.c
++++ b/net/sctp/ipv6.c
+@@ -1014,15 +1014,24 @@ static struct sctp_pf sctp_pf_inet6 = {
+ };
+
+ /* Initialize IPv6 support and register with socket layer. */
+-int sctp_v6_init(void)
++void sctp_v6_pf_init(void)
+ {
+- int rc;
+-
+ /* Register the SCTP specific PF_INET6 functions. */
+ sctp_register_pf(&sctp_pf_inet6, PF_INET6);
+
+ /* Register the SCTP specific AF_INET6 functions. */
+ sctp_register_af(&sctp_af_inet6);
++}
++
++void sctp_v6_pf_exit(void)
++{
++ list_del(&sctp_af_inet6.list);
++}
++
++/* Initialize IPv6 support and register with socket layer. */
++int sctp_v6_protosw_init(void)
++{
++ int rc;
+
+ rc = proto_register(&sctpv6_prot, 1);
+ if (rc)
+@@ -1035,6 +1044,14 @@ int sctp_v6_init(void)
+ return 0;
+ }
+
++void sctp_v6_protosw_exit(void)
++{
++ inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
++ inet6_unregister_protosw(&sctpv6_stream_protosw);
++ proto_unregister(&sctpv6_prot);
++}
++
++
+ /* Register with inet6 layer. */
+ int sctp_v6_add_protocol(void)
+ {
+@@ -1047,15 +1064,6 @@ int sctp_v6_add_protocol(void)
+ return 0;
+ }
+
+-/* IPv6 specific exit support. */
+-void sctp_v6_exit(void)
+-{
+- inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
+- inet6_unregister_protosw(&sctpv6_stream_protosw);
+- proto_unregister(&sctpv6_prot);
+- list_del(&sctp_af_inet6.list);
+-}
+-
+ /* Unregister with inet6 layer. */
+ void sctp_v6_del_protocol(void)
+ {
+diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
+index ad0a406..f90091a 100644
+--- a/net/sctp/protocol.c
++++ b/net/sctp/protocol.c
+@@ -337,14 +337,14 @@ static int sctp_v4_cmp_addr(const union sctp_addr *addr1,
+ static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port)
+ {
+ addr->v4.sin_family = AF_INET;
+- addr->v4.sin_addr.s_addr = INADDR_ANY;
++ addr->v4.sin_addr.s_addr = htonl(INADDR_ANY);
+ addr->v4.sin_port = port;
+ }
+
+ /* Is this a wildcard address? */
+ static int sctp_v4_is_any(const union sctp_addr *addr)
+ {
+- return INADDR_ANY == addr->v4.sin_addr.s_addr;
++ return htonl(INADDR_ANY) == addr->v4.sin_addr.s_addr;
+ }
+
+ /* This function checks if the address is a valid address to be used for
+@@ -375,7 +375,7 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
+ int ret = inet_addr_type(&init_net, addr->v4.sin_addr.s_addr);
+
+
+- if (addr->v4.sin_addr.s_addr != INADDR_ANY &&
++ if (addr->v4.sin_addr.s_addr != htonl(INADDR_ANY) &&
+ ret != RTN_LOCAL &&
+ !sp->inet.freebind &&
+ !sysctl_ip_nonlocal_bind)
+@@ -785,8 +785,8 @@ static int sctp_inet_cmp_addr(const union sctp_addr *addr1,
+ /* PF_INET only supports AF_INET addresses. */
+ if (addr1->sa.sa_family != addr2->sa.sa_family)
+ return 0;
+- if (INADDR_ANY == addr1->v4.sin_addr.s_addr ||
+- INADDR_ANY == addr2->v4.sin_addr.s_addr)
++ if (htonl(INADDR_ANY) == addr1->v4.sin_addr.s_addr ||
++ htonl(INADDR_ANY) == addr2->v4.sin_addr.s_addr)
+ return 1;
+ if (addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr)
+ return 1;
+@@ -992,6 +992,58 @@ static void cleanup_sctp_mibs(void)
+ free_percpu(sctp_statistics[1]);
+ }
+
++static void sctp_v4_pf_init(void)
++{
++ /* Initialize the SCTP specific PF functions. */
++ sctp_register_pf(&sctp_pf_inet, PF_INET);
++ sctp_register_af(&sctp_af_inet);
++}
++
++static void sctp_v4_pf_exit(void)
++{
++ list_del(&sctp_af_inet.list);
++}
++
++static int sctp_v4_protosw_init(void)
++{
++ int rc;
++
++ rc = proto_register(&sctp_prot, 1);
++ if (rc)
++ return rc;
++
++ /* Register SCTP(UDP and TCP style) with socket layer. */
++ inet_register_protosw(&sctp_seqpacket_protosw);
++ inet_register_protosw(&sctp_stream_protosw);
++
++ return 0;
++}
++
++static void sctp_v4_protosw_exit(void)
++{
++ inet_unregister_protosw(&sctp_stream_protosw);
++ inet_unregister_protosw(&sctp_seqpacket_protosw);
++ proto_unregister(&sctp_prot);
++}
++
++static int sctp_v4_add_protocol(void)
++{
++ /* Register notifier for inet address additions/deletions. */
++ register_inetaddr_notifier(&sctp_inetaddr_notifier);
++
++ /* Register SCTP with inet layer. */
++ if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0)
++ return -EAGAIN;
++
++ return 0;
++}
++
++static void sctp_v4_del_protocol(void)
++{
++ inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
++ unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
++}
++
+ /* Initialize the universe into something sensible. */
+ SCTP_STATIC __init int sctp_init(void)
+ {
+@@ -1035,8 +1087,6 @@ SCTP_STATIC __init int sctp_init(void)
+ /* Initialize object count debugging. */
+ sctp_dbg_objcnt_init();
+
+- /* Initialize the SCTP specific PF functions. */
+- sctp_register_pf(&sctp_pf_inet, PF_INET);
+ /*
+ * 14. Suggested SCTP Protocol Parameter Values
+ */
+@@ -1194,19 +1244,22 @@ SCTP_STATIC __init int sctp_init(void)
+ sctp_sysctl_register();
+
+ INIT_LIST_HEAD(&sctp_address_families);
+- sctp_register_af(&sctp_af_inet);
++ sctp_v4_pf_init();
++ sctp_v6_pf_init();
+
+- status = proto_register(&sctp_prot, 1);
+- if (status)
+- goto err_proto_register;
++ /* Initialize the local address list. */
++ INIT_LIST_HEAD(&sctp_local_addr_list);
++ spin_lock_init(&sctp_local_addr_lock);
++ sctp_get_local_addr_list();
+
+- /* Register SCTP(UDP and TCP style) with socket layer. */
+- inet_register_protosw(&sctp_seqpacket_protosw);
+- inet_register_protosw(&sctp_stream_protosw);
++ status = sctp_v4_protosw_init();
+
+- status = sctp_v6_init();
+ if (status)
+- goto err_v6_init;
++ goto err_protosw_init;
++
++ status = sctp_v6_protosw_init();
++ if (status)
++ goto err_v6_protosw_init;
+
+ /* Initialize the control inode/socket for handling OOTB packets. */
+ if ((status = sctp_ctl_sock_init())) {
+@@ -1215,19 +1268,9 @@ SCTP_STATIC __init int sctp_init(void)
+ goto err_ctl_sock_init;
+ }
+
+- /* Initialize the local address list. */
+- INIT_LIST_HEAD(&sctp_local_addr_list);
+- spin_lock_init(&sctp_local_addr_lock);
+- sctp_get_local_addr_list();
+-
+- /* Register notifier for inet address additions/deletions. */
+- register_inetaddr_notifier(&sctp_inetaddr_notifier);
+-
+- /* Register SCTP with inet layer. */
+- if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0) {
+- status = -EAGAIN;
++ status = sctp_v4_add_protocol();
++ if (status)
+ goto err_add_protocol;
+- }
+
+ /* Register SCTP with inet6 layer. */
+ status = sctp_v6_add_protocol();
+@@ -1238,18 +1281,18 @@ SCTP_STATIC __init int sctp_init(void)
+ out:
+ return status;
+ err_v6_add_protocol:
+- inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
+- unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
++ sctp_v6_del_protocol();
+ err_add_protocol:
+- sctp_free_local_addr_list();
++ sctp_v4_del_protocol();
+ sock_release(sctp_ctl_socket);
+ err_ctl_sock_init:
+- sctp_v6_exit();
+-err_v6_init:
+- inet_unregister_protosw(&sctp_stream_protosw);
+- inet_unregister_protosw(&sctp_seqpacket_protosw);
+- proto_unregister(&sctp_prot);
+-err_proto_register:
++ sctp_v6_protosw_exit();
++err_v6_protosw_init:
++ sctp_v4_protosw_exit();
++err_protosw_init:
++ sctp_free_local_addr_list();
++ sctp_v4_pf_exit();
++ sctp_v6_pf_exit();
+ sctp_sysctl_unregister();
+ list_del(&sctp_af_inet.list);
+ free_pages((unsigned long)sctp_port_hashtable,
+@@ -1282,23 +1325,21 @@ SCTP_STATIC __exit void sctp_exit(void)
+
+ /* Unregister with inet6/inet layers. */
+ sctp_v6_del_protocol();
+- inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
+-
+- /* Unregister notifier for inet address additions/deletions. */
+- unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
+-
+- /* Free the local address list. */
+- sctp_free_local_addr_list();
++ sctp_v4_del_protocol();
+
+ /* Free the control endpoint. */
+ sock_release(sctp_ctl_socket);
+
+- /* Cleanup v6 initializations. */
+- sctp_v6_exit();
++ /* Free protosw registrations */
++ sctp_v6_protosw_exit();
++ sctp_v4_protosw_exit();
++
++ /* Free the local address list. */
++ sctp_free_local_addr_list();
+
+ /* Unregister with socket layer. */
+- inet_unregister_protosw(&sctp_stream_protosw);
+- inet_unregister_protosw(&sctp_seqpacket_protosw);
++ sctp_v6_pf_exit();
++ sctp_v4_pf_exit();
+
+ sctp_sysctl_unregister();
+ list_del(&sctp_af_inet.list);
+@@ -1317,8 +1358,6 @@ SCTP_STATIC __exit void sctp_exit(void)
+
+ kmem_cache_destroy(sctp_chunk_cachep);
+ kmem_cache_destroy(sctp_bucket_cachep);
+-
+- proto_unregister(&sctp_prot);
+ }
+
+ module_init(sctp_init);
+diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
+index 61801a0..bce9d52 100644
+--- a/net/sunrpc/auth_gss/gss_mech_switch.c
++++ b/net/sunrpc/auth_gss/gss_mech_switch.c
+@@ -317,7 +317,7 @@ gss_delete_sec_context(struct gss_ctx **context_handle)
+
+ if (!*context_handle)
+ return(GSS_S_NO_CONTEXT);
+- if ((*context_handle)->internal_ctx_id != 0)
++ if ((*context_handle)->internal_ctx_id)
+ (*context_handle)->mech_type->gm_ops
+ ->gss_delete_sec_context((*context_handle)
+ ->internal_ctx_id);
+diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
+index ea377e0..332eb47 100644
+--- a/net/sunrpc/svc_xprt.c
++++ b/net/sunrpc/svc_xprt.c
+@@ -185,7 +185,7 @@ int svc_create_xprt(struct svc_serv *serv, char *xprt_name, unsigned short port,
+ struct svc_xprt_class *xcl;
+ struct sockaddr_in sin = {
+ .sin_family = AF_INET,
+- .sin_addr.s_addr = INADDR_ANY,
++ .sin_addr.s_addr = htonl(INADDR_ANY),
+ .sin_port = htons(port),
+ };
+ dprintk("svc: creating transport %s[%d]\n", xprt_name, port);
diff --git a/security/capability.c b/security/capability.c
index 9e99f36..2c6e06d 100644
--- a/security/capability.c
Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.1
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 (original)
+++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.1 Sat Mar 22 11:35:17 2008
@@ -1,3 +1,4 @@
++ bugfix/all/patch-2.6.25-rc6-git6
+ debian/version.patch
+ debian/kernelvariables.patch
+ debian/doc-build-parallel.patch
@@ -16,7 +17,6 @@
+ bugfix/powerpc/prep-utah-ide-interrupt.patch
+ bugfix/powerpc/serial.patch
+ bugfix/mips/tulip_mwi_fix.patch
-+ bugfix/arm/enable_wb_coal.patch
+ features/arm/ixp4xx-net-drivers.patch
+ bugfix/sparc/drivers_net-broken.patch
+ bugfix/ia64/hardcode-arch-script-output.patch
More information about the Kernel-svn-changes
mailing list