[kernel] r15923 - in dists/sid/linux-2.6/debian: . patches/bugfix/all/stable patches/debian patches/features/all patches/series

Ben Hutchings benh at alioth.debian.org
Fri Jul 2 03:18:12 UTC 2010


Author: benh
Date: Fri Jul  2 03:18:08 2010
New Revision: 15923

Log:
Add stable 2.6.32.16-rc1

ath9k has been further patched since we applied
ath9k-add-support-for-802.11n-bonded-out-AR2427.patch so we need a
separate patch to revert it.

This stable release patches option so we need a new version of
USB-option-Use-generic-USB-wwan-code.patch.

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.32.16-rc1.patch
   dists/sid/linux-2.6/debian/patches/debian/revert-ath9k-add-support-for-802.11n-bonded-out-AR2427.patch
   dists/sid/linux-2.6/debian/patches/features/all/USB-option-Use-generic-USB-wwan-code-2.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/16

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Fri Jul  2 01:12:56 2010	(r15922)
+++ dists/sid/linux-2.6/debian/changelog	Fri Jul  2 03:18:08 2010	(r15923)
@@ -42,6 +42,7 @@
   * ipv6: Clamp reported valid_lft to a minimum of 0 (Closes: #514644)
   * ipv6: Use interface max_desync_factor instead of static default
     (Closes: #514646)
+  * Add stable 2.6.32.16-rc1
 
   [ Aurelien Jarno ]
   * [sh4] fix sh_tmu clocksource following recent nohz changes.

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.32.16-rc1.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/stable/2.6.32.16-rc1.patch	Fri Jul  2 03:18:08 2010	(r15923)
@@ -0,0 +1,4477 @@
+diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245
+index 02838a4..86b5880 100644
+--- a/Documentation/hwmon/ltc4245
++++ b/Documentation/hwmon/ltc4245
+@@ -72,9 +72,7 @@ in6_min_alarm		5v  output undervoltage alarm
+ in7_min_alarm		3v  output undervoltage alarm
+ in8_min_alarm		Vee (-12v) output undervoltage alarm
+ 
+-in9_input		GPIO #1 voltage data
+-in10_input		GPIO #2 voltage data
+-in11_input		GPIO #3 voltage data
++in9_input		GPIO voltage data
+ 
+ power1_input		12v power usage (mW)
+ power2_input		5v  power usage (mW)
+diff --git a/Documentation/networking/3c509.txt b/Documentation/networking/3c509.txt
+index 0643e3b..3c45d5d 100644
+--- a/Documentation/networking/3c509.txt
++++ b/Documentation/networking/3c509.txt
+@@ -48,11 +48,11 @@ for LILO parameters for doing this:
+ This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
+ transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
+ with other card types when overriding the I/O address. When the driver is
+-loaded as a module, only the IRQ and transceiver setting may be overridden.
+-For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using
+-the xcvr and irq module options:
++loaded as a module, only the IRQ may be overridden. For example,
++setting two cards to IRQ10 and IRQ11 is done by using the irq module
++option:
+ 
+-   options 3c509 xcvr=3,1 irq=10,11
++   options 3c509 irq=10,11
+ 
+ 
+ (2) Full-duplex mode
+@@ -77,6 +77,8 @@ operation.
+ itself full-duplex capable. This is almost certainly one of two things: a full-
+ duplex-capable  Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
+ another system that's connected directly to the 3c509B via a crossover cable.
++
++Full-duplex mode can be enabled using 'ethtool'.
+  
+ /////Extremely important caution concerning full-duplex mode/////
+ Understand that the 3c509B's hardware's full-duplex support is much more
+@@ -113,6 +115,8 @@ This insured that merely upgrading the driver from an earlier version would
+ never automatically enable full-duplex mode in an existing installation;
+ it must always be explicitly enabled via one of these code in order to be
+ activated.
++
++The transceiver type can be changed using 'ethtool'.
+   
+ 
+ (4a) Interpretation of error messages and common problems
+diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
+index 8ba7044..b07bfee 100644
+--- a/arch/arm/common/sa1111.c
++++ b/arch/arm/common/sa1111.c
+@@ -887,8 +887,6 @@ static int sa1111_resume(struct platform_device *dev)
+ 	if (!save)
+ 		return 0;
+ 
+-	spin_lock_irqsave(&sachip->lock, flags);
+-
+ 	/*
+ 	 * Ensure that the SA1111 is still here.
+ 	 * FIXME: shouldn't do this here.
+@@ -905,6 +903,13 @@ static int sa1111_resume(struct platform_device *dev)
+ 	 * First of all, wake up the chip.
+ 	 */
+ 	sa1111_wake(sachip);
++
++	/*
++	 * Only lock for write ops. Also, sa1111_wake must be called with
++	 * released spinlock!
++	 */
++	spin_lock_irqsave(&sachip->lock, flags);
++
+ 	sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
+ 	sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
+ 
+diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c
+index 70997d5..dd9598b 100644
+--- a/arch/arm/mm/copypage-feroceon.c
++++ b/arch/arm/mm/copypage-feroceon.c
+@@ -18,7 +18,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
+ {
+ 	asm("\
+ 	stmfd	sp!, {r4-r9, lr}		\n\
+-	mov	ip, %0				\n\
++	mov	ip, %2				\n\
+ 1:	mov	lr, r1				\n\
+ 	ldmia	r1!, {r2 - r9}			\n\
+ 	pld	[lr, #32]			\n\
+@@ -64,7 +64,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
+ 	mcr	p15, 0, ip, c7, c10, 4		@ drain WB\n\
+ 	ldmfd	sp!, {r4-r9, pc}"
+ 	:
+-	: "I" (PAGE_SIZE));
++	: "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
+ }
+ 
+ void feroceon_copy_user_highpage(struct page *to, struct page *from,
+diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c
+index 9ab0984..7bc0ac7 100644
+--- a/arch/arm/mm/copypage-v4wb.c
++++ b/arch/arm/mm/copypage-v4wb.c
+@@ -27,7 +27,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
+ {
+ 	asm("\
+ 	stmfd	sp!, {r4, lr}			@ 2\n\
+-	mov	r2, %0				@ 1\n\
++	mov	r2, %2				@ 1\n\
+ 	ldmia	r1!, {r3, r4, ip, lr}		@ 4\n\
+ 1:	mcr	p15, 0, r0, c7, c6, 1		@ 1   invalidate D line\n\
+ 	stmia	r0!, {r3, r4, ip, lr}		@ 4\n\
+@@ -44,7 +44,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
+ 	mcr	p15, 0, r1, c7, c10, 4		@ 1   drain WB\n\
+ 	ldmfd	 sp!, {r4, pc}			@ 3"
+ 	:
+-	: "I" (PAGE_SIZE / 64));
++	: "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
+ }
+ 
+ void v4wb_copy_user_highpage(struct page *to, struct page *from,
+diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c
+index 300efaf..35bf609 100644
+--- a/arch/arm/mm/copypage-v4wt.c
++++ b/arch/arm/mm/copypage-v4wt.c
+@@ -25,7 +25,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
+ {
+ 	asm("\
+ 	stmfd	sp!, {r4, lr}			@ 2\n\
+-	mov	r2, %0				@ 1\n\
++	mov	r2, %2				@ 1\n\
+ 	ldmia	r1!, {r3, r4, ip, lr}		@ 4\n\
+ 1:	stmia	r0!, {r3, r4, ip, lr}		@ 4\n\
+ 	ldmia	r1!, {r3, r4, ip, lr}		@ 4+1\n\
+@@ -40,7 +40,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
+ 	mcr	p15, 0, r2, c7, c7, 0		@ flush ID cache\n\
+ 	ldmfd	sp!, {r4, pc}			@ 3"
+ 	:
+-	: "I" (PAGE_SIZE / 64));
++	: "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
+ }
+ 
+ void v4wt_copy_user_highpage(struct page *to, struct page *from,
+diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c
+index bc4525f..27dc363 100644
+--- a/arch/arm/mm/copypage-xsc3.c
++++ b/arch/arm/mm/copypage-xsc3.c
+@@ -34,7 +34,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
+ {
+ 	asm("\
+ 	stmfd	sp!, {r4, r5, lr}		\n\
+-	mov	lr, %0				\n\
++	mov	lr, %2				\n\
+ 						\n\
+ 	pld	[r1, #0]			\n\
+ 	pld	[r1, #32]			\n\
+@@ -67,7 +67,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
+ 						\n\
+ 	ldmfd	sp!, {r4, r5, pc}"
+ 	:
+-	: "I" (PAGE_SIZE / 64 - 1));
++	: "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1));
+ }
+ 
+ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
+diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
+index 10e0680..3191cd6 100644
+--- a/arch/arm/mm/fault.c
++++ b/arch/arm/mm/fault.c
+@@ -386,6 +386,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
+ 	if (addr < TASK_SIZE)
+ 		return do_page_fault(addr, fsr, regs);
+ 
++	if (user_mode(regs))
++		goto bad_area;
++
+ 	index = pgd_index(addr);
+ 
+ 	/*
+diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
+index 52c40d1..94945db 100644
+--- a/arch/arm/mm/init.c
++++ b/arch/arm/mm/init.c
+@@ -632,10 +632,10 @@ void __init mem_init(void)
+ void free_initmem(void)
+ {
+ #ifdef CONFIG_HAVE_TCM
+-	extern char *__tcm_start, *__tcm_end;
++	extern char __tcm_start, __tcm_end;
+ 
+-	totalram_pages += free_area(__phys_to_pfn(__pa(__tcm_start)),
+-				    __phys_to_pfn(__pa(__tcm_end)),
++	totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)),
++				    __phys_to_pfn(__pa(&__tcm_end)),
+ 				    "TCM link");
+ #endif
+ 
+diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
+index 66dc2d0..d66cead 100644
+--- a/arch/arm/vfp/vfphw.S
++++ b/arch/arm/vfp/vfphw.S
+@@ -277,7 +277,7 @@ ENTRY(vfp_put_double)
+ #ifdef CONFIG_VFPv3
+ 	@ d16 - d31 registers
+ 	.irp	dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
+-1:	mcrr	p11, 3, r1, r2, c\dr	@ fmdrr	r1, r2, d\dr
++1:	mcrr	p11, 3, r0, r1, c\dr	@ fmdrr	r0, r1, d\dr
+ 	mov	pc, lr
+ 	.org	1b + 8
+ 	.endr
+diff --git a/arch/blackfin/include/asm/cache.h b/arch/blackfin/include/asm/cache.h
+index 8542bc3..93f6c63 100644
+--- a/arch/blackfin/include/asm/cache.h
++++ b/arch/blackfin/include/asm/cache.h
+@@ -15,6 +15,8 @@
+ #define L1_CACHE_BYTES	(1 << L1_CACHE_SHIFT)
+ #define SMP_CACHE_BYTES	L1_CACHE_BYTES
+ 
++#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
++
+ #ifdef CONFIG_SMP
+ #define __cacheline_aligned
+ #else
+diff --git a/arch/frv/include/asm/cache.h b/arch/frv/include/asm/cache.h
+index 2797163..7dc0f0f 100644
+--- a/arch/frv/include/asm/cache.h
++++ b/arch/frv/include/asm/cache.h
+@@ -17,6 +17,8 @@
+ #define L1_CACHE_SHIFT		(CONFIG_FRV_L1_CACHE_SHIFT)
+ #define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)
+ 
++#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
++
+ #define __cacheline_aligned	__attribute__((aligned(L1_CACHE_BYTES)))
+ #define ____cacheline_aligned	__attribute__((aligned(L1_CACHE_BYTES)))
+ 
+diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h
+index fed3fd3..ecafbe1 100644
+--- a/arch/m68k/include/asm/cache.h
++++ b/arch/m68k/include/asm/cache.h
+@@ -8,4 +8,6 @@
+ #define        L1_CACHE_SHIFT  4
+ #define        L1_CACHE_BYTES  (1<< L1_CACHE_SHIFT)
+ 
++#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
++
+ #endif
+diff --git a/arch/mn10300/include/asm/cache.h b/arch/mn10300/include/asm/cache.h
+index e03cfa2..6e2fe28 100644
+--- a/arch/mn10300/include/asm/cache.h
++++ b/arch/mn10300/include/asm/cache.h
+@@ -21,6 +21,8 @@
+ #define L1_CACHE_DISPARITY	L1_CACHE_NENTRIES * L1_CACHE_BYTES
+ #endif
+ 
++#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
++
+ /* data cache purge registers
+  * - read from the register to unconditionally purge that cache line
+  * - write address & 0xffffff00 to conditionally purge that cache line
+diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c
+index 3ca1c61..27a7492 100644
+--- a/arch/parisc/math-emu/decode_exc.c
++++ b/arch/parisc/math-emu/decode_exc.c
+@@ -342,6 +342,7 @@ decode_fpu(unsigned int Fpu_register[], unsigned int trap_counts[])
+ 		return SIGNALCODE(SIGFPE, FPE_FLTINV);
+ 	  case DIVISIONBYZEROEXCEPTION:
+ 		update_trap_counts(Fpu_register, aflags, bflags, trap_counts);
++		Clear_excp_register(exception_index);
+ 	  	return SIGNALCODE(SIGFPE, FPE_FLTDIV);
+ 	  case INEXACTEXCEPTION:
+ 		update_trap_counts(Fpu_register, aflags, bflags, trap_counts);
+diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
+index 2a4551f..ff184f4 100644
+--- a/arch/powerpc/kvm/powerpc.c
++++ b/arch/powerpc/kvm/powerpc.c
+@@ -176,7 +176,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
+ {
+ 	struct kvm_vcpu *vcpu;
+ 	vcpu = kvmppc_core_vcpu_create(kvm, id);
+-	kvmppc_create_vcpu_debugfs(vcpu, id);
++	if (!IS_ERR(vcpu))
++		kvmppc_create_vcpu_debugfs(vcpu, id);
+ 	return vcpu;
+ }
+ 
+diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S
+index 64e2e49..3ac0cd3 100644
+--- a/arch/powerpc/lib/string.S
++++ b/arch/powerpc/lib/string.S
+@@ -71,7 +71,7 @@ _GLOBAL(strcmp)
+ 
+ _GLOBAL(strncmp)
+ 	PPC_LCMPI r5,0
+-	beqlr
++	ble-	2f
+ 	mtctr	r5
+ 	addi	r5,r3,-1
+ 	addi	r4,r4,-1
+@@ -82,6 +82,8 @@ _GLOBAL(strncmp)
+ 	beqlr	1
+ 	bdnzt	eq,1b
+ 	blr
++2:	li	r3,0
++	blr
+ 
+ _GLOBAL(strlen)
+ 	addi	r4,r3,-1
+diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
+index ae06c62..c8fc4dc 100644
+--- a/arch/powerpc/oprofile/op_model_cell.c
++++ b/arch/powerpc/oprofile/op_model_cell.c
+@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
+ 		index = ENTRIES-1;
+ 
+ 	/* make sure index is valid */
+-	if ((index > ENTRIES) || (index < 0))
++	if ((index >= ENTRIES) || (index < 0))
+ 		index = ENTRIES-1;
+ 
+ 	return initial_lfsr[index];
+diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
+index 440000c..e4822fe 100644
+--- a/arch/powerpc/platforms/pseries/smp.c
++++ b/arch/powerpc/platforms/pseries/smp.c
+@@ -81,6 +81,12 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
+ 
+ 	pcpu = get_hard_smp_processor_id(lcpu);
+ 
++	/* Check to see if the CPU out of FW already for kexec */
++	if (smp_query_cpu_stopped(pcpu) == QCSS_NOT_STOPPED){
++		cpu_set(lcpu, of_spin_map);
++		return 1;
++	}
++
+ 	/* Fixup atomic count: it exited inside IRQ handler. */
+ 	task_thread_info(paca[lcpu].__current)->preempt_count	= 0;
+ 
+diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
+index ca2d312..75fbf19 100644
+--- a/arch/s390/kvm/kvm-s390.c
++++ b/arch/s390/kvm/kvm-s390.c
+@@ -338,11 +338,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
+ 
+ 	rc = kvm_vcpu_init(vcpu, kvm, id);
+ 	if (rc)
+-		goto out_free_cpu;
++		goto out_free_sie_block;
+ 	VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu,
+ 		 vcpu->arch.sie_block);
+ 
+ 	return vcpu;
++out_free_sie_block:
++	free_page((unsigned long)(vcpu->arch.sie_block));
+ out_free_cpu:
+ 	kfree(vcpu);
+ out_nomem:
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
+index 6ead43e..9113954 100644
+--- a/arch/x86/include/asm/kvm_host.h
++++ b/arch/x86/include/asm/kvm_host.h
+@@ -193,6 +193,7 @@ union kvm_mmu_page_role {
+ 		unsigned invalid:1;
+ 		unsigned cr4_pge:1;
+ 		unsigned nxe:1;
++		unsigned cr0_wp:1;
+ 	};
+ };
+ 
+diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
+index 7825b0c..a7881c7 100644
+--- a/arch/x86/include/asm/msr-index.h
++++ b/arch/x86/include/asm/msr-index.h
+@@ -198,8 +198,9 @@
+ #define MSR_IA32_EBL_CR_POWERON		0x0000002a
+ #define MSR_IA32_FEATURE_CONTROL        0x0000003a
+ 
+-#define FEATURE_CONTROL_LOCKED		(1<<0)
+-#define FEATURE_CONTROL_VMXON_ENABLED	(1<<2)
++#define FEATURE_CONTROL_LOCKED				(1<<0)
++#define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX	(1<<1)
++#define FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX	(1<<2)
+ 
+ #define MSR_IA32_APICBASE		0x0000001b
+ #define MSR_IA32_APICBASE_BSP		(1<<8)
+diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
+index c0ebc63..f0fa7a1 100644
+--- a/arch/x86/kernel/amd_iommu.c
++++ b/arch/x86/kernel/amd_iommu.c
+@@ -544,7 +544,7 @@ static void flush_devices_by_domain(struct protection_domain *domain)
+ 
+ 	for (i = 0; i <= amd_iommu_last_bdf; ++i) {
+ 		if ((domain == NULL && amd_iommu_pd_table[i] == NULL) ||
+-		    (amd_iommu_pd_table[i] != domain))
++		    (domain != NULL && amd_iommu_pd_table[i] != domain))
+ 			continue;
+ 
+ 		iommu = amd_iommu_rlookup_table[i];
+diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
+index efea222..0ff02ca 100644
+--- a/arch/x86/kernel/cpu/perf_event.c
++++ b/arch/x86/kernel/cpu/perf_event.c
+@@ -1005,8 +1005,11 @@ static int __hw_perf_event_init(struct perf_event *event)
+ 		if (atomic_read(&active_events) == 0) {
+ 			if (!reserve_pmc_hardware())
+ 				err = -EBUSY;
+-			else
++			else {
+ 				err = reserve_bts_hardware();
++				if (err)
++					release_pmc_hardware();
++			}
+ 		}
+ 		if (!err)
+ 			atomic_inc(&active_events);
+diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
+index 03801f2..dfdfe46 100644
+--- a/arch/x86/kernel/pvclock.c
++++ b/arch/x86/kernel/pvclock.c
+@@ -109,11 +109,14 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src)
+ 	return pv_tsc_khz;
+ }
+ 
++static atomic64_t last_value = ATOMIC64_INIT(0);
++
+ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
+ {
+ 	struct pvclock_shadow_time shadow;
+ 	unsigned version;
+ 	cycle_t ret, offset;
++	u64 last;
+ 
+ 	do {
+ 		version = pvclock_get_time_values(&shadow, src);
+@@ -123,6 +126,27 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
+ 		barrier();
+ 	} while (version != src->version);
+ 
++	/*
++	 * Assumption here is that last_value, a global accumulator, always goes
++	 * forward. If we are less than that, we should not be much smaller.
++	 * We assume there is an error marging we're inside, and then the correction
++	 * does not sacrifice accuracy.
++	 *
++	 * For reads: global may have changed between test and return,
++	 * but this means someone else updated poked the clock at a later time.
++	 * We just need to make sure we are not seeing a backwards event.
++	 *
++	 * For updates: last_value = ret is not enough, since two vcpus could be
++	 * updating at the same time, and one of them could be slightly behind,
++	 * making the assumption that last_value always go forward fail to hold.
++	 */
++	last = atomic64_read(&last_value);
++	do {
++		if (ret < last)
++			return last;
++		last = atomic64_cmpxchg(&last_value, last, ret);
++	} while (unlikely(last != ret));
++
+ 	return ret;
+ }
+ 
+diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
+index 8425f7e..d7a0888 100644
+--- a/arch/x86/kernel/setup.c
++++ b/arch/x86/kernel/setup.c
+@@ -688,6 +688,17 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
+ 			DMI_MATCH(DMI_BOARD_NAME, "DG45FC"),
+ 		},
+ 	},
++	/*
++	 * The Dell Inspiron Mini 1012 has DMI_BIOS_VENDOR = "Dell Inc.", so
++	 * match on the product name.
++	 */
++	{
++		.callback = dmi_low_memory_corruption,
++		.ident = "Phoenix BIOS",
++		.matches = {
++			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
++		},
++	},
+ #endif
+ 	{}
+ };
+diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
+index 86c9f91..46b8277 100644
+--- a/arch/x86/kernel/tboot.c
++++ b/arch/x86/kernel/tboot.c
+@@ -46,6 +46,7 @@
+ 
+ /* Global pointer to shared data; NULL means no measured launch. */
+ struct tboot *tboot __read_mostly;
++EXPORT_SYMBOL(tboot);
+ 
+ /* timeout for APs (in secs) to enter wait-for-SIPI state during shutdown */
+ #define AP_WAIT_TIMEOUT		1
+diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
+index 762efc2..a265626 100644
+--- a/arch/x86/kvm/mmu.c
++++ b/arch/x86/kvm/mmu.c
+@@ -221,7 +221,7 @@ void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask,
+ }
+ EXPORT_SYMBOL_GPL(kvm_mmu_set_mask_ptes);
+ 
+-static int is_write_protection(struct kvm_vcpu *vcpu)
++static bool is_write_protection(struct kvm_vcpu *vcpu)
+ {
+ 	return vcpu->arch.cr0 & X86_CR0_WP;
+ }
+@@ -2091,11 +2091,13 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
+ 			direct = 1;
+ 		if (mmu_check_root(vcpu, root_gfn))
+ 			return 1;
++		spin_lock(&vcpu->kvm->mmu_lock);
+ 		sp = kvm_mmu_get_page(vcpu, root_gfn, 0,
+ 				      PT64_ROOT_LEVEL, direct,
+ 				      ACC_ALL, NULL);
+ 		root = __pa(sp->spt);
+ 		++sp->root_count;
++		spin_unlock(&vcpu->kvm->mmu_lock);
+ 		vcpu->arch.mmu.root_hpa = root;
+ 		return 0;
+ 	}
+@@ -2117,11 +2119,14 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
+ 			root_gfn = 0;
+ 		if (mmu_check_root(vcpu, root_gfn))
+ 			return 1;
++		spin_lock(&vcpu->kvm->mmu_lock);
+ 		sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
+ 				      PT32_ROOT_LEVEL, direct,
+ 				      ACC_ALL, NULL);
+ 		root = __pa(sp->spt);
+ 		++sp->root_count;
++		spin_unlock(&vcpu->kvm->mmu_lock);
++
+ 		vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK;
+ 	}
+ 	vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
+@@ -2445,6 +2450,7 @@ static int init_kvm_softmmu(struct kvm_vcpu *vcpu)
+ 		r = paging32_init_context(vcpu);
+ 
+ 	vcpu->arch.mmu.base_role.glevels = vcpu->arch.mmu.root_level;
++	vcpu->arch.mmu.base_role.cr0_wp = is_write_protection(vcpu);
+ 
+ 	return r;
+ }
+@@ -2484,7 +2490,9 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu)
+ 		goto out;
+ 	spin_lock(&vcpu->kvm->mmu_lock);
+ 	kvm_mmu_free_some_pages(vcpu);
++	spin_unlock(&vcpu->kvm->mmu_lock);
+ 	r = mmu_alloc_roots(vcpu);
++	spin_lock(&vcpu->kvm->mmu_lock);
+ 	mmu_sync_roots(vcpu);
+ 	spin_unlock(&vcpu->kvm->mmu_lock);
+ 	if (r)
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
+index fa297d6..6a28d5d 100644
+--- a/arch/x86/kvm/vmx.c
++++ b/arch/x86/kvm/vmx.c
+@@ -26,6 +26,7 @@
+ #include <linux/sched.h>
+ #include <linux/moduleparam.h>
+ #include <linux/ftrace_event.h>
++#include <linux/tboot.h>
+ #include "kvm_cache_regs.h"
+ #include "x86.h"
+ 
+@@ -1140,9 +1141,16 @@ static __init int vmx_disabled_by_bios(void)
+ 	u64 msr;
+ 
+ 	rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
+-	return (msr & (FEATURE_CONTROL_LOCKED |
+-		       FEATURE_CONTROL_VMXON_ENABLED))
+-	    == FEATURE_CONTROL_LOCKED;
++	if (msr & FEATURE_CONTROL_LOCKED) {
++		if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
++			&& tboot_enabled())
++			return 1;
++		if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
++			&& !tboot_enabled())
++			return 1;
++	}
++
++	return 0;
+ 	/* locked but not enabled */
+ }
+ 
+@@ -1150,18 +1158,20 @@ static void hardware_enable(void *garbage)
+ {
+ 	int cpu = raw_smp_processor_id();
+ 	u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
+-	u64 old;
++	u64 old, test_bits;
+ 
+ 	INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu));
+ 	rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
+-	if ((old & (FEATURE_CONTROL_LOCKED |
+-		    FEATURE_CONTROL_VMXON_ENABLED))
+-	    != (FEATURE_CONTROL_LOCKED |
+-		FEATURE_CONTROL_VMXON_ENABLED))
++
++	test_bits = FEATURE_CONTROL_LOCKED;
++	test_bits |= FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
++	if (tboot_enabled())
++		test_bits |= FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX;
++
++	if ((old & test_bits) != test_bits) {
+ 		/* enable and lock */
+-		wrmsrl(MSR_IA32_FEATURE_CONTROL, old |
+-		       FEATURE_CONTROL_LOCKED |
+-		       FEATURE_CONTROL_VMXON_ENABLED);
++		wrmsrl(MSR_IA32_FEATURE_CONTROL, old | test_bits);
++	}
+ 	write_cr4(read_cr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */
+ 	asm volatile (ASM_VMX_VMXON_RAX
+ 		      : : "a"(&phys_addr), "m"(phys_addr)
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
+index 2782509..281ac63 100644
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -345,7 +345,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);
+ 
+ void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
+ {
+-	kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0ful) | (msw & 0x0f));
++	kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0eul) | (msw & 0x0f));
+ }
+ EXPORT_SYMBOL_GPL(kvm_lmsw);
+ 
+@@ -483,48 +483,42 @@ static u32 emulated_msrs[] = {
+ 	MSR_IA32_MISC_ENABLE,
+ };
+ 
+-static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
++static int set_efer(struct kvm_vcpu *vcpu, u64 efer)
+ {
+-	if (efer & efer_reserved_bits) {
+-		kvm_inject_gp(vcpu, 0);
+-		return;
+-	}
++	if (efer & efer_reserved_bits)
++		return 1;
+ 
+ 	if (is_paging(vcpu)
+-	    && (vcpu->arch.shadow_efer & EFER_LME) != (efer & EFER_LME)) {
+-		kvm_inject_gp(vcpu, 0);
+-		return;
+-	}
++	    && (vcpu->arch.shadow_efer & EFER_LME) != (efer & EFER_LME))
++		return 1;
+ 
+ 	if (efer & EFER_FFXSR) {
+ 		struct kvm_cpuid_entry2 *feat;
+ 
+ 		feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
+-		if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT))) {
+-			kvm_inject_gp(vcpu, 0);
+-			return;
+-		}
++		if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT)))
++			return 1;
+ 	}
+ 
+ 	if (efer & EFER_SVME) {
+ 		struct kvm_cpuid_entry2 *feat;
+ 
+ 		feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
+-		if (!feat || !(feat->ecx & bit(X86_FEATURE_SVM))) {
+-			kvm_inject_gp(vcpu, 0);
+-			return;
+-		}
++		if (!feat || !(feat->ecx & bit(X86_FEATURE_SVM)))
++			return 1;
+ 	}
+ 
+-	kvm_x86_ops->set_efer(vcpu, efer);
+-
+ 	efer &= ~EFER_LMA;
+ 	efer |= vcpu->arch.shadow_efer & EFER_LMA;
+ 
++	kvm_x86_ops->set_efer(vcpu, efer);
++
+ 	vcpu->arch.shadow_efer = efer;
+ 
+ 	vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;
+ 	kvm_mmu_reset_context(vcpu);
++
++	return 0;
+ }
+ 
+ void kvm_enable_efer_bits(u64 mask)
+@@ -554,14 +548,22 @@ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
+ 
+ static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
+ {
+-	static int version;
++	int version;
++	int r;
+ 	struct pvclock_wall_clock wc;
+ 	struct timespec boot;
+ 
+ 	if (!wall_clock)
+ 		return;
+ 
+-	version++;
++	r = kvm_read_guest(kvm, wall_clock, &version, sizeof(version));
++	if (r)
++		return;
++
++	if (version & 1)
++		++version;  /* first time write, random junk */
++
++	++version;
+ 
+ 	kvm_write_guest(kvm, wall_clock, &version, sizeof(version));
+ 
+@@ -819,8 +821,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
+ {
+ 	switch (msr) {
+ 	case MSR_EFER:
+-		set_efer(vcpu, data);
+-		break;
++		return set_efer(vcpu, data);
+ 	case MSR_K7_HWCR:
+ 		data &= ~(u64)0x40;	/* ignore flush filter disable */
+ 		if (data != 0) {
+@@ -1412,6 +1413,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
+ {
+ 	int r;
+ 
++	vcpu_load(vcpu);
+ 	r = -E2BIG;
+ 	if (cpuid->nent < vcpu->arch.cpuid_nent)
+ 		goto out;
+@@ -1423,6 +1425,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
+ 
+ out:
+ 	cpuid->nent = vcpu->arch.cpuid_nent;
++	vcpu_put(vcpu);
+ 	return r;
+ }
+ 
+@@ -1672,6 +1675,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
+ 	int r;
+ 	unsigned bank_num = mcg_cap & 0xff, bank;
+ 
++	vcpu_load(vcpu);
+ 	r = -EINVAL;
+ 	if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
+ 		goto out;
+@@ -1686,6 +1690,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
+ 	for (bank = 0; bank < bank_num; bank++)
+ 		vcpu->arch.mce_banks[bank*4] = ~(u64)0;
+ out:
++	vcpu_put(vcpu);
+ 	return r;
+ }
+ 
+@@ -1888,7 +1893,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
+ 		r = -EFAULT;
+ 		if (copy_from_user(&mce, argp, sizeof mce))
+ 			goto out;
++		vcpu_load(vcpu);
+ 		r = kvm_vcpu_ioctl_x86_set_mce(vcpu, &mce);
++		vcpu_put(vcpu);
+ 		break;
+ 	}
+ 	default:
+diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
+index 2c505ee..f1fb411 100644
+--- a/arch/x86/oprofile/nmi_int.c
++++ b/arch/x86/oprofile/nmi_int.c
+@@ -95,7 +95,10 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs)
+ static void nmi_cpu_start(void *dummy)
+ {
+ 	struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
+-	model->start(msrs);
++	if (!msrs->controls)
++		WARN_ON_ONCE(1);
++	else
++		model->start(msrs);
+ }
+ 
+ static int nmi_start(void)
+@@ -107,7 +110,10 @@ static int nmi_start(void)
+ static void nmi_cpu_stop(void *dummy)
+ {
+ 	struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
+-	model->stop(msrs);
++	if (!msrs->controls)
++		WARN_ON_ONCE(1);
++	else
++		model->stop(msrs);
+ }
+ 
+ static void nmi_stop(void)
+diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
+index 987267f..a9c6611 100644
+--- a/arch/x86/xen/suspend.c
++++ b/arch/x86/xen/suspend.c
+@@ -60,6 +60,6 @@ static void xen_vcpu_notify_restore(void *data)
+ 
+ void xen_arch_resume(void)
+ {
+-	smp_call_function(xen_vcpu_notify_restore,
+-			       (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
++	on_each_cpu(xen_vcpu_notify_restore,
++		    (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
+ }
+diff --git a/arch/xtensa/include/asm/cache.h b/arch/xtensa/include/asm/cache.h
+index f04c989..ed8cd3c 100644
+--- a/arch/xtensa/include/asm/cache.h
++++ b/arch/xtensa/include/asm/cache.h
+@@ -29,5 +29,6 @@
+ # define CACHE_WAY_SIZE ICACHE_WAY_SIZE
+ #endif
+ 
++#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES
+ 
+ #endif	/* _XTENSA_CACHE_H */
+diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
+index 575593a..e7b9606 100644
+--- a/drivers/acpi/video_detect.c
++++ b/drivers/acpi/video_detect.c
+@@ -250,7 +250,7 @@ static int __init acpi_backlight(char *str)
+ 				ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR;
+ 		if (!strcmp("video", str))
+ 			acpi_video_support |=
+-				ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO;
++				ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO;
+ 	}
+ 	return 1;
+ }
+diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
+index 3b09e83..6a96da6 100644
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -159,6 +159,10 @@ int libata_allow_tpm = 0;
+ module_param_named(allow_tpm, libata_allow_tpm, int, 0444);
+ MODULE_PARM_DESC(allow_tpm, "Permit the use of TPM commands (0=off [default], 1=on)");
+ 
++static int atapi_an;
++module_param(atapi_an, int, 0444);
++MODULE_PARM_DESC(atapi_an, "Enable ATAPI AN media presence notification (0=0ff [default], 1=on)");
++
+ MODULE_AUTHOR("Jeff Garzik");
+ MODULE_DESCRIPTION("Library module for ATA devices");
+ MODULE_LICENSE("GPL");
+@@ -2570,7 +2574,8 @@ int ata_dev_configure(struct ata_device *dev)
+ 		 * to enable ATAPI AN to discern between PHY status
+ 		 * changed notifications and ATAPI ANs.
+ 		 */
+-		if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
++		if (atapi_an &&
++		    (ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
+ 		    (!sata_pmp_attached(ap) ||
+ 		     sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) {
+ 			unsigned int err_mask;
+diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
+index 2ae15c3..776a895 100644
+--- a/drivers/ata/libata-sff.c
++++ b/drivers/ata/libata-sff.c
+@@ -893,7 +893,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
+ 				       do_write);
+ 	}
+ 
+-	if (!do_write)
++	if (!do_write && !PageSlab(page))
+ 		flush_dcache_page(page);
+ 
+ 	qc->curbytes += qc->sect_size;
+diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
+index 1eb4e02..ae2297c 100644
+--- a/drivers/ata/sata_nv.c
++++ b/drivers/ata/sata_nv.c
+@@ -1673,7 +1673,6 @@ static void nv_mcp55_freeze(struct ata_port *ap)
+ 	mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
+ 	mask &= ~(NV_INT_ALL_MCP55 << shift);
+ 	writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
+-	ata_sff_freeze(ap);
+ }
+ 
+ static void nv_mcp55_thaw(struct ata_port *ap)
+@@ -1687,7 +1686,6 @@ static void nv_mcp55_thaw(struct ata_port *ap)
+ 	mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
+ 	mask |= (NV_INT_MASK_MCP55 << shift);
+ 	writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
+-	ata_sff_thaw(ap);
+ }
+ 
+ static void nv_adma_error_handler(struct ata_port *ap)
+@@ -2478,8 +2476,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	}
+ 
+ 	pci_set_master(pdev);
+-	return ata_host_activate(host, pdev->irq, ipriv->irq_handler,
+-				 IRQF_SHARED, ipriv->sht);
++	return ata_pci_sff_activate_host(host, ipriv->irq_handler, ipriv->sht);
+ }
+ 
+ #ifdef CONFIG_PM
+diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
+index 02efd9a..e35596b 100644
+--- a/drivers/ata/sata_via.c
++++ b/drivers/ata/sata_via.c
+@@ -558,6 +558,19 @@ static void svia_configure(struct pci_dev *pdev)
+ 		tmp8 |= NATIVE_MODE_ALL;
+ 		pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
+ 	}
++
++	/*
++	 * vt6421 has problems talking to some drives.  The following
++	 * is the magic fix from Joseph Chan <JosephChan at via.com.tw>.
++	 * Please add proper documentation if possible.
++	 *
++	 * https://bugzilla.kernel.org/show_bug.cgi?id=15173
++	 */
++	if (pdev->device == 0x3249) {
++		pci_read_config_byte(pdev, 0x52, &tmp8);
++		tmp8 |= 1 << 2;
++		pci_write_config_byte(pdev, 0x52, tmp8);
++	}
+ }
+ 
+ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
+index e62a4cc..1e2196f 100644
+--- a/drivers/base/cpu.c
++++ b/drivers/base/cpu.c
+@@ -149,7 +149,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf)
+ 	/* display offline cpus < nr_cpu_ids */
+ 	if (!alloc_cpumask_var(&offline, GFP_KERNEL))
+ 		return -ENOMEM;
+-	cpumask_complement(offline, cpu_online_mask);
++	cpumask_andnot(offline, cpu_possible_mask, cpu_online_mask);
+ 	n = cpulist_scnprintf(buf, len, offline);
+ 	free_cpumask_var(offline);
+ 
+diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
+index d2e6980..abae8c9 100644
+--- a/drivers/char/ipmi/ipmi_si_intf.c
++++ b/drivers/char/ipmi/ipmi_si_intf.c
+@@ -310,9 +310,14 @@ static void deliver_recv_msg(struct smi_info *smi_info,
+ {
+ 	/* Deliver the message to the upper layer with the lock
+ 	   released. */
+-	spin_unlock(&(smi_info->si_lock));
+-	ipmi_smi_msg_received(smi_info->intf, msg);
+-	spin_lock(&(smi_info->si_lock));
++
++	if (smi_info->run_to_completion) {
++		ipmi_smi_msg_received(smi_info->intf, msg);
++	} else {
++		spin_unlock(&(smi_info->si_lock));
++		ipmi_smi_msg_received(smi_info->intf, msg);
++		spin_lock(&(smi_info->si_lock));
++	}
+ }
+ 
+ static void return_hosed_msg(struct smi_info *smi_info, int cCode)
+diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
+index 6fe4f77..234d9f6 100644
+--- a/drivers/clocksource/sh_cmt.c
++++ b/drivers/clocksource/sh_cmt.c
+@@ -413,18 +413,10 @@ static cycle_t sh_cmt_clocksource_read(struct clocksource *cs)
+ static int sh_cmt_clocksource_enable(struct clocksource *cs)
+ {
+ 	struct sh_cmt_priv *p = cs_to_sh_cmt(cs);
+-	int ret;
+ 
+ 	p->total_cycles = 0;
+ 
+-	ret = sh_cmt_start(p, FLAG_CLOCKSOURCE);
+-	if (ret)
+-		return ret;
+-
+-	/* TODO: calculate good shift from rate and counter bit width */
+-	cs->shift = 0;
+-	cs->mult = clocksource_hz2mult(p->rate, cs->shift);
+-	return 0;
++	return sh_cmt_start(p, FLAG_CLOCKSOURCE);
+ }
+ 
+ static void sh_cmt_clocksource_disable(struct clocksource *cs)
+@@ -444,7 +436,18 @@ static int sh_cmt_register_clocksource(struct sh_cmt_priv *p,
+ 	cs->disable = sh_cmt_clocksource_disable;
+ 	cs->mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
+ 	cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
++
++	/* clk_get_rate() needs an enabled clock */
++	clk_enable(p->clk);
++	p->rate = clk_get_rate(p->clk) / (p->width == 16) ? 512 : 8;
++	clk_disable(p->clk);
++
++	/* TODO: calculate good shift from rate and counter bit width */
++	cs->shift = 10;
++	cs->mult = clocksource_hz2mult(p->rate, cs->shift);
++
+ 	pr_info("sh_cmt: %s used as clock source\n", cs->name);
++
+ 	clocksource_register(cs);
+ 	return 0;
+ }
+diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
+index ed635ae..3fc2ceb 100644
+--- a/drivers/firewire/core-card.c
++++ b/drivers/firewire/core-card.c
+@@ -239,7 +239,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
+ static void fw_card_bm_work(struct work_struct *work)
+ {
+ 	struct fw_card *card = container_of(work, struct fw_card, work.work);
+-	struct fw_device *root_device;
++	struct fw_device *root_device, *irm_device;
+ 	struct fw_node *root_node;
+ 	unsigned long flags;
+ 	int root_id, new_root_id, irm_id, local_id;
+@@ -247,6 +247,7 @@ static void fw_card_bm_work(struct work_struct *work)
+ 	bool do_reset = false;
+ 	bool root_device_is_running;
+ 	bool root_device_is_cmc;
++	bool irm_is_1394_1995_only;
+ 
+ 	spin_lock_irqsave(&card->lock, flags);
+ 
+@@ -256,12 +257,18 @@ static void fw_card_bm_work(struct work_struct *work)
+ 	}
+ 
+ 	generation = card->generation;
++
+ 	root_node = card->root_node;
+ 	fw_node_get(root_node);
+ 	root_device = root_node->data;
+ 	root_device_is_running = root_device &&
+ 			atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
+ 	root_device_is_cmc = root_device && root_device->cmc;
++
++	irm_device = card->irm_node->data;
++	irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
++			(irm_device->config_rom[2] & 0x000000f0) == 0;
++
+ 	root_id  = root_node->node_id;
+ 	irm_id   = card->irm_node->node_id;
+ 	local_id = card->local_node->node_id;
+@@ -284,8 +291,15 @@ static void fw_card_bm_work(struct work_struct *work)
+ 
+ 		if (!card->irm_node->link_on) {
+ 			new_root_id = local_id;
+-			fw_notify("IRM has link off, making local node (%02x) root.\n",
+-				  new_root_id);
++			fw_notify("%s, making local node (%02x) root.\n",
++				  "IRM has link off", new_root_id);
++			goto pick_me;
++		}
++
++		if (irm_is_1394_1995_only) {
++			new_root_id = local_id;
++			fw_notify("%s, making local node (%02x) root.\n",
++				  "IRM is not 1394a compliant", new_root_id);
+ 			goto pick_me;
+ 		}
+ 
+@@ -324,8 +338,8 @@ static void fw_card_bm_work(struct work_struct *work)
+ 			 * root, and thus, IRM.
+ 			 */
+ 			new_root_id = local_id;
+-			fw_notify("BM lock failed, making local node (%02x) root.\n",
+-				  new_root_id);
++			fw_notify("%s, making local node (%02x) root.\n",
++				  "BM lock failed", new_root_id);
+ 			goto pick_me;
+ 		}
+ 	} else if (card->bm_generation != generation) {
+diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
+index 8fb1346..259ec21 100644
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index aa8a4e9..df6f7c9 100644
+diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
+index 4a85aa3..bf05762 100644
+diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
+index 969502a..a4813c6 100644
+diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
+index 1c46848..c7236f4 100644
+diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
+index 350962e..76e4070 100644
+diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
+index 38537d9..4747910 100644
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
+index 668604b..1597863 100644
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1306,6 +1306,7 @@ static const struct hid_device_id hid_blacklist[] = {
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
++	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
+diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c
+index 62416e6..3975e03 100644
+--- a/drivers/hid/hid-gyration.c
++++ b/drivers/hid/hid-gyration.c
+@@ -73,6 +73,7 @@ static int gyration_event(struct hid_device *hdev, struct hid_field *field,
+ static const struct hid_device_id gyration_devices[] = {
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
+ 	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
++	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
+ 	{ }
+ };
+ MODULE_DEVICE_TABLE(hid, gyration_devices);
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index 9831c3a..252853d 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -251,6 +251,7 @@
+ #define USB_VENDOR_ID_GYRATION		0x0c16
+ #define USB_DEVICE_ID_GYRATION_REMOTE	0x0002
+ #define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003
++#define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008
+ 
+ #define USB_VENDOR_ID_HAPP		0x078b
+ #define USB_DEVICE_ID_UGCI_DRIVING	0x0010
+diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
+index 65c232a..21d201b 100644
+--- a/drivers/hwmon/ltc4245.c
++++ b/drivers/hwmon/ltc4245.c
+@@ -45,9 +45,7 @@ enum ltc4245_cmd {
+ 	LTC4245_VEEIN			= 0x19,
+ 	LTC4245_VEESENSE		= 0x1a,
+ 	LTC4245_VEEOUT			= 0x1b,
+-	LTC4245_GPIOADC1		= 0x1c,
+-	LTC4245_GPIOADC2		= 0x1d,
+-	LTC4245_GPIOADC3		= 0x1e,
++	LTC4245_GPIOADC			= 0x1c,
+ };
+ 
+ struct ltc4245_data {
+@@ -61,7 +59,7 @@ struct ltc4245_data {
+ 	u8 cregs[0x08];
+ 
+ 	/* Voltage registers */
+-	u8 vregs[0x0f];
++	u8 vregs[0x0d];
+ };
+ 
+ static struct ltc4245_data *ltc4245_update_device(struct device *dev)
+@@ -86,7 +84,7 @@ static struct ltc4245_data *ltc4245_update_device(struct device *dev)
+ 				data->cregs[i] = val;
+ 		}
+ 
+-		/* Read voltage registers -- 0x10 to 0x1f */
++		/* Read voltage registers -- 0x10 to 0x1c */
+ 		for (i = 0; i < ARRAY_SIZE(data->vregs); i++) {
+ 			val = i2c_smbus_read_byte_data(client, i+0x10);
+ 			if (unlikely(val < 0))
+@@ -128,9 +126,7 @@ static int ltc4245_get_voltage(struct device *dev, u8 reg)
+ 	case LTC4245_VEEOUT:
+ 		voltage = regval * -55;
+ 		break;
+-	case LTC4245_GPIOADC1:
+-	case LTC4245_GPIOADC2:
+-	case LTC4245_GPIOADC3:
++	case LTC4245_GPIOADC:
+ 		voltage = regval * 10;
+ 		break;
+ 	default:
+@@ -297,9 +293,7 @@ LTC4245_ALARM(in7_min_alarm,	(1 << 2),	LTC4245_FAULT2);
+ LTC4245_ALARM(in8_min_alarm,	(1 << 3),	LTC4245_FAULT2);
+ 
+ /* GPIO voltages */
+-LTC4245_VOLTAGE(in9_input,			LTC4245_GPIOADC1);
+-LTC4245_VOLTAGE(in10_input,			LTC4245_GPIOADC2);
+-LTC4245_VOLTAGE(in11_input,			LTC4245_GPIOADC3);
++LTC4245_VOLTAGE(in9_input,			LTC4245_GPIOADC);
+ 
+ /* Power Consumption (virtual) */
+ LTC4245_POWER(power1_input,			LTC4245_12VSENSE);
+@@ -342,8 +336,6 @@ static struct attribute *ltc4245_attributes[] = {
+ 	&sensor_dev_attr_in8_min_alarm.dev_attr.attr,
+ 
+ 	&sensor_dev_attr_in9_input.dev_attr.attr,
+-	&sensor_dev_attr_in10_input.dev_attr.attr,
+-	&sensor_dev_attr_in11_input.dev_attr.attr,
+ 
+ 	&sensor_dev_attr_power1_input.dev_attr.attr,
+ 	&sensor_dev_attr_power2_input.dev_attr.attr,
+diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
+index 0876d82..9451e28 100644
+--- a/drivers/input/mouse/psmouse-base.c
++++ b/drivers/input/mouse/psmouse-base.c
+@@ -1349,6 +1349,7 @@ static int psmouse_reconnect(struct serio *serio)
+ 	struct psmouse *psmouse = serio_get_drvdata(serio);
+ 	struct psmouse *parent = NULL;
+ 	struct serio_driver *drv = serio->drv;
++	unsigned char type;
+ 	int rc = -1;
+ 
+ 	if (!drv || !psmouse) {
+@@ -1368,10 +1369,15 @@ static int psmouse_reconnect(struct serio *serio)
+ 	if (psmouse->reconnect) {
+ 		if (psmouse->reconnect(psmouse))
+ 			goto out;
+-	} else if (psmouse_probe(psmouse) < 0 ||
+-		   psmouse->type != psmouse_extensions(psmouse,
+-						psmouse_max_proto, false)) {
+-		goto out;
++	} else {
++		psmouse_reset(psmouse);
++
++		if (psmouse_probe(psmouse) < 0)
++			goto out;
++
++		type = psmouse_extensions(psmouse, psmouse_max_proto, false);
++		if (psmouse->type != type)
++			goto out;
+ 	}
+ 
+ 	/* ok, the device type (and capabilities) match the old one,
+diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
+index 8a223a4..5f9315b 100644
+--- a/drivers/md/dm-exception-store.h
++++ b/drivers/md/dm-exception-store.h
+@@ -162,7 +162,7 @@ static inline sector_t get_dev_size(struct block_device *bdev)
+ static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
+ 				      sector_t sector)
+ {
+-	return (sector & ~store->chunk_mask) >> store->chunk_shift;
++	return sector >> store->chunk_shift;
+ }
+ 
+ int dm_exception_store_type_register(struct dm_exception_store_type *type);
+diff --git a/drivers/md/md.c b/drivers/md/md.c
+index f2e719d..0147079 100644
+--- a/drivers/md/md.c
++++ b/drivers/md/md.c
+@@ -5334,6 +5334,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
+ 	int err = 0;
+ 	void __user *argp = (void __user *)arg;
+ 	mddev_t *mddev = NULL;
++	int ro;
+ 
+ 	if (!capable(CAP_SYS_ADMIN))
+ 		return -EACCES;
+@@ -5469,6 +5470,34 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
+ 			err = do_md_stop(mddev, 1, 1);
+ 			goto done_unlock;
+ 
++		case BLKROSET:
++			if (get_user(ro, (int __user *)(arg))) {
++				err = -EFAULT;
++				goto done_unlock;
++			}
++			err = -EINVAL;
++
++			/* if the bdev is going readonly the value of mddev->ro
++			 * does not matter, no writes are coming
++			 */
++			if (ro)
++				goto done_unlock;
++
++			/* are we are already prepared for writes? */
++			if (mddev->ro != 1)
++				goto done_unlock;
++
++			/* transitioning to readauto need only happen for
++			 * arrays that call md_write_start
++			 */
++			if (mddev->pers) {
++				err = restart_array(mddev);
++				if (err == 0) {
++					mddev->ro = 2;
++					set_disk_ro(mddev->gendisk, 0);
++				}
++			}
++			goto done_unlock;
+ 	}
+ 
+ 	/*
+diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
+index e07ce2e..5ccad28 100644
+--- a/drivers/md/raid1.c
++++ b/drivers/md/raid1.c
+@@ -417,7 +417,7 @@ static void raid1_end_write_request(struct bio *bio, int error)
+  */
+ static int read_balance(conf_t *conf, r1bio_t *r1_bio)
+ {
+-	const unsigned long this_sector = r1_bio->sector;
++	const sector_t this_sector = r1_bio->sector;
+ 	int new_disk = conf->last_used, disk = new_disk;
+ 	int wonly_disk = -1;
+ 	const int sectors = r1_bio->sectors;
+@@ -433,7 +433,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio)
+  retry:
+ 	if (conf->mddev->recovery_cp < MaxSector &&
+ 	    (this_sector + sectors >= conf->next_resync)) {
+-		/* Choose the first operation device, for consistancy */
++		/* Choose the first operational device, for consistancy */
+ 		new_disk = 0;
+ 
+ 		for (rdev = rcu_dereference(conf->mirrors[new_disk].rdev);
+@@ -891,9 +891,10 @@ static int make_request(struct request_queue *q, struct bio * bio)
+ 			if (test_bit(Faulty, &rdev->flags)) {
+ 				rdev_dec_pending(rdev, mddev);
+ 				r1_bio->bios[i] = NULL;
+-			} else
++			} else {
+ 				r1_bio->bios[i] = bio;
+-			targets++;
++				targets++;
++			}
+ 		} else
+ 			r1_bio->bios[i] = NULL;
+ 	}
+diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
+index 3860ac7..6c2a35b 100644
+--- a/drivers/md/raid10.c
++++ b/drivers/md/raid10.c
+@@ -493,7 +493,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
+  */
+ static int read_balance(conf_t *conf, r10bio_t *r10_bio)
+ {
+-	const unsigned long this_sector = r10_bio->sector;
++	const sector_t this_sector = r10_bio->sector;
+ 	int disk, slot, nslot;
+ 	const int sectors = r10_bio->sectors;
+ 	sector_t new_distance, current_distance;
+diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c
+index bfae63f..7878182 100644
+--- a/drivers/media/video/gspca/stv06xx/stv06xx.c
++++ b/drivers/media/video/gspca/stv06xx/stv06xx.c
+@@ -497,8 +497,6 @@ static const __devinitdata struct usb_device_id device_table[] = {
+ 	{USB_DEVICE(0x046D, 0x08F5), .driver_info = BRIDGE_ST6422 },
+ 	/* QuickCam Messenger (new) */
+ 	{USB_DEVICE(0x046D, 0x08F6), .driver_info = BRIDGE_ST6422 },
+-	/* QuickCam Messenger (new) */
+-	{USB_DEVICE(0x046D, 0x08DA), .driver_info = BRIDGE_ST6422 },
+ 	{}
+ };
+ MODULE_DEVICE_TABLE(usb, device_table);
+diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
+index dbf4de3..69698e5 100644
+--- a/drivers/net/arcnet/com20020-pci.c
++++ b/drivers/net/arcnet/com20020-pci.c
+@@ -165,8 +165,8 @@ static struct pci_device_id com20020pci_id_table[] = {
+ 	{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+ 	{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+ 	{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+-	{ 0x10B5, 0x9030, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+-	{ 0x10B5, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
++	{ 0x10B5, 0x9030, 0x10B5,     0x2978,     0, 0, ARC_CAN_10MBIT },
++	{ 0x10B5, 0x9050, 0x10B5,     0x2273,     0, 0, ARC_CAN_10MBIT },
+ 	{ 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+ 	{ 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+ 	{0,}
+diff --git a/drivers/net/atl1e/atl1e_ethtool.c b/drivers/net/atl1e/atl1e_ethtool.c
+index 60edb9f..b0fb725 100644
+--- a/drivers/net/atl1e/atl1e_ethtool.c
++++ b/drivers/net/atl1e/atl1e_ethtool.c
+@@ -394,11 +394,13 @@ static const struct ethtool_ops atl1e_ethtool_ops = {
+ 	.get_eeprom             = atl1e_get_eeprom,
+ 	.set_eeprom             = atl1e_set_eeprom,
+ 	.get_tx_csum            = atl1e_get_tx_csum,
++	.set_tx_csum            = ethtool_op_set_tx_hw_csum,
+ 	.get_sg                 = ethtool_op_get_sg,
+ 	.set_sg                 = ethtool_op_set_sg,
+ #ifdef NETIF_F_TSO
+ 	.get_tso                = ethtool_op_get_tso,
+ #endif
++	.set_tso                = ethtool_op_set_tso,
+ };
+ 
+ void atl1e_set_ethtool_ops(struct net_device *netdev)
+diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
+index 16d2ecd..9463e5d 100644
+--- a/drivers/net/can/sja1000/sja1000.c
++++ b/drivers/net/can/sja1000/sja1000.c
+@@ -84,6 +84,20 @@ static struct can_bittiming_const sja1000_bittiming_const = {
+ 	.brp_inc = 1,
+ };
+ 
++static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
++{
++	unsigned long flags;
++
++	/*
++	 * The command register needs some locking and time to settle
++	 * the write_reg() operation - especially on SMP systems.
++	 */
++	spin_lock_irqsave(&priv->cmdreg_lock, flags);
++	priv->write_reg(priv, REG_CMR, val);
++	priv->read_reg(priv, REG_SR);
++	spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
++}
++
+ static int sja1000_probe_chip(struct net_device *dev)
+ {
+ 	struct sja1000_priv *priv = netdev_priv(dev);
+@@ -279,7 +293,7 @@ static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb,
+ 
+ 	can_put_echo_skb(skb, dev, 0);
+ 
+-	priv->write_reg(priv, REG_CMR, CMD_TR);
++	sja1000_write_cmdreg(priv, CMD_TR);
+ 
+ 	return NETDEV_TX_OK;
+ }
+@@ -334,7 +348,7 @@ static void sja1000_rx(struct net_device *dev)
+ 		cf->data[i++] = 0;
+ 
+ 	/* release receive buffer */
+-	priv->write_reg(priv, REG_CMR, CMD_RRB);
++	sja1000_write_cmdreg(priv, CMD_RRB);
+ 
+ 	netif_rx(skb);
+ 
+@@ -368,7 +382,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
+ 		cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
+ 		stats->rx_over_errors++;
+ 		stats->rx_errors++;
+-		priv->write_reg(priv, REG_CMR, CMD_CDO);	/* clear bit */
++		sja1000_write_cmdreg(priv, CMD_CDO);	/* clear bit */
+ 	}
+ 
+ 	if (isrc & IRQ_EI) {
+diff --git a/drivers/net/can/sja1000/sja1000.h b/drivers/net/can/sja1000/sja1000.h
+index 302d2c7..cfd3f57 100644
+--- a/drivers/net/can/sja1000/sja1000.h
++++ b/drivers/net/can/sja1000/sja1000.h
+@@ -165,6 +165,7 @@ struct sja1000_priv {
+ 
+ 	void __iomem *reg_base;	 /* ioremap'ed address to registers */
+ 	unsigned long irq_flags; /* for request_irq() */
++	spinlock_t cmdreg_lock;  /* lock for concurrent cmd register writes */
+ 
+ 	u16 flags;		/* custom mode flags */
+ 	u8 ocr;			/* output control register */
+diff --git a/drivers/net/mlx4/icm.c b/drivers/net/mlx4/icm.c
+index 04b382f..83eef8e 100644
+--- a/drivers/net/mlx4/icm.c
++++ b/drivers/net/mlx4/icm.c
+@@ -174,9 +174,10 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
+ 
+ 				if (chunk->nsg <= 0)
+ 					goto fail;
++			}
+ 
++			if (chunk->npages == MLX4_ICM_CHUNK_LEN)
+ 				chunk = NULL;
+-			}
+ 
+ 			npages -= 1 << cur_order;
+ 		} else {
+diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
+index 5910df6..b724d7f 100644
+--- a/drivers/net/pppol2tp.c
++++ b/drivers/net/pppol2tp.c
+@@ -1178,7 +1178,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
+ 	/* Calculate UDP checksum if configured to do so */
+ 	if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT)
+ 		skb->ip_summed = CHECKSUM_NONE;
+-	else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
++	else if ((skb_dst(skb) && skb_dst(skb)->dev) &&
++		 (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM))) {
+ 		skb->ip_summed = CHECKSUM_COMPLETE;
+ 		csum = skb_checksum(skb, 0, udp_len, 0);
+ 		uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr,
+diff --git a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig
+index 1cc8cf4..516713f 100644
+--- a/drivers/net/tulip/Kconfig
++++ b/drivers/net/tulip/Kconfig
+@@ -101,6 +101,10 @@ config TULIP_NAPI_HW_MITIGATION
+ 
+ 	  If in doubt, say Y.
+ 
++config TULIP_DM910X
++	def_bool y
++	depends on TULIP && SPARC
++
+ config DE4X5
+ 	tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
+ 	depends on PCI || EISA
+diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
+index a45ded0..b94370f 100644
+--- a/drivers/net/tulip/dmfe.c
++++ b/drivers/net/tulip/dmfe.c
+@@ -92,6 +92,10 @@
+ #include <asm/uaccess.h>
+ #include <asm/irq.h>
+ 
++#ifdef CONFIG_TULIP_DM910X
++#include <linux/of.h>
++#endif
++
+ 
+ /* Board/System/Debug information/definition ---------------- */
+ #define PCI_DM9132_ID   0x91321282      /* Davicom DM9132 ID */
+@@ -377,6 +381,23 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
+ 	if (!printed_version++)
+ 		printk(version);
+ 
++	/*
++	 *	SPARC on-board DM910x chips should be handled by the main
++	 *	tulip driver, except for early DM9100s.
++	 */
++#ifdef CONFIG_TULIP_DM910X
++	if ((ent->driver_data == PCI_DM9100_ID && pdev->revision >= 0x30) ||
++	    ent->driver_data == PCI_DM9102_ID) {
++		struct device_node *dp = pci_device_to_OF_node(pdev);
++
++		if (dp && of_get_property(dp, "local-mac-address", NULL)) {
++			printk(KERN_INFO DRV_NAME
++			       ": skipping on-board DM910x (use tulip)\n");
++			return -ENODEV;
++		}
++	}
++#endif
++
+ 	/* Init network device */
+ 	dev = alloc_etherdev(sizeof(*db));
+ 	if (dev == NULL)
+diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
+index 6b2330e..88bf54f 100644
+--- a/drivers/net/tulip/tulip_core.c
++++ b/drivers/net/tulip/tulip_core.c
+@@ -196,9 +196,13 @@ struct tulip_chip_table tulip_tbl[] = {
+ 	| HAS_NWAY | HAS_PCI_MWI, tulip_timer, tulip_media_task },
+ 
+   /* DM910X */
++#ifdef CONFIG_TULIP_DM910X
+   { "Davicom DM9102/DM9102A", 128, 0x0001ebef,
+ 	HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI,
+ 	tulip_timer, tulip_media_task },
++#else
++  { NULL },
++#endif
+ 
+   /* RS7112 */
+   { "Conexant LANfinity", 256, 0x0001ebef,
+@@ -228,8 +232,10 @@ static struct pci_device_id tulip_pci_tbl[] = {
+ 	{ 0x1259, 0xa120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+ 	{ 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 },
+ 	{ 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 },
++#ifdef CONFIG_TULIP_DM910X
+ 	{ 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
+ 	{ 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
++#endif
+ 	{ 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+ 	{ 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
+ 	{ 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
+@@ -1299,18 +1305,30 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
+ 	}
+ 
+ 	/*
+-	 *	Early DM9100's need software CRC and the DMFE driver
++	 *	DM910x chips should be handled by the dmfe driver, except
++	 *	on-board chips on SPARC systems.  Also, early DM9100s need
++	 *	software CRC which only the dmfe driver supports.
+ 	 */
+ 
+-	if (pdev->vendor == 0x1282 && pdev->device == 0x9100)
+-	{
+-		/* Read Chip revision */
+-		if (pdev->revision < 0x30)
+-		{
+-			printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n");
++#ifdef CONFIG_TULIP_DM910X
++	if (chip_idx == DM910X) {
++		struct device_node *dp;
++
++		if (pdev->vendor == 0x1282 && pdev->device == 0x9100 &&
++		    pdev->revision < 0x30) {
++			printk(KERN_INFO PFX
++			       "skipping early DM9100 with Crc bug (use dmfe)\n");
++			return -ENODEV;
++		}
++
++		dp = pci_device_to_OF_node(pdev);
++		if (!(dp && of_get_property(dp, "local-mac-address", NULL))) {
++			printk(KERN_INFO PFX
++			       "skipping DM910x expansion card (use dmfe)\n");
+ 			return -ENODEV;
+ 		}
+ 	}
++#endif
+ 
+ 	/*
+ 	 *	Looks for early PCI chipsets where people report hangs
+diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
+index 4469f24..b4b25ff 100644
+--- a/drivers/net/ucc_geth.c
++++ b/drivers/net/ucc_geth.c
+@@ -1563,7 +1563,10 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode)
+ 
+ static void ugeth_quiesce(struct ucc_geth_private *ugeth)
+ {
+-	/* Wait for and prevent any further xmits. */
++	/* Prevent any further xmits, plus detach the device. */
++	netif_device_detach(ugeth->ndev);
++
++	/* Wait for any current xmits to finish. */
+ 	netif_tx_disable(ugeth->ndev);
+ 
+ 	/* Disable the interrupt to avoid NAPI rescheduling. */
+@@ -1577,7 +1580,7 @@ static void ugeth_activate(struct ucc_geth_private *ugeth)
+ {
+ 	napi_enable(&ugeth->napi);
+ 	enable_irq(ugeth->ug_info->uf_info.irq);
+-	netif_tx_wake_all_queues(ugeth->ndev);
++	netif_device_attach(ugeth->ndev);
+ }
+ 
+ /* Called every time the controller might need to be made
+@@ -3273,13 +3276,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
+ 		/* Handle the transmitted buffer and release */
+ 		/* the BD to be used with the current frame  */
+ 
+-		if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
++		skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
++		if (!skb)
+ 			break;
+ 
+ 		dev->stats.tx_packets++;
+ 
+-		skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
+-
+ 		if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
+ 			     skb_recycle_check(skb,
+ 				    ugeth->ug_info->uf_info.max_rx_buf_length +
+diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
+index e04e5be..74b9d7d 100644
+--- a/drivers/net/via-velocity.c
++++ b/drivers/net/via-velocity.c
+@@ -2186,8 +2186,6 @@ static int velocity_open(struct net_device *dev)
+ 	/* Ensure chip is running */
+ 	pci_set_power_state(vptr->pdev, PCI_D0);
+ 
+-	velocity_give_many_rx_descs(vptr);
+-
+ 	velocity_init_registers(vptr, VELOCITY_INIT_COLD);
+ 
+ 	ret = request_irq(vptr->pdev->irq, &velocity_intr, IRQF_SHARED,
+@@ -2199,6 +2197,8 @@ static int velocity_open(struct net_device *dev)
+ 		goto out;
+ 	}
+ 
++	velocity_give_many_rx_descs(vptr);
++
+ 	mac_enable_int(vptr->mac_regs);
+ 	netif_start_queue(dev);
+ 	vptr->flags |= VELOCITY_FLAGS_OPENED;
+@@ -2287,10 +2287,10 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)
+ 
+ 		dev->mtu = new_mtu;
+ 
+-		velocity_give_many_rx_descs(vptr);
+-
+ 		velocity_init_registers(vptr, VELOCITY_INIT_COLD);
+ 
++		velocity_give_many_rx_descs(vptr);
++
+ 		mac_enable_int(vptr->mac_regs);
+ 		netif_start_queue(dev);
+ 
+diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
+index b9e002f..7e3788d 100644
+--- a/drivers/net/virtio_net.c
++++ b/drivers/net/virtio_net.c
+@@ -398,8 +398,7 @@ static void refill_work(struct work_struct *work)
+ 
+ 	vi = container_of(work, struct virtnet_info, refill.work);
+ 	napi_disable(&vi->napi);
+-	try_fill_recv(vi, GFP_KERNEL);
+-	still_empty = (vi->num == 0);
++	still_empty = !try_fill_recv(vi, GFP_KERNEL);
+ 	napi_enable(&vi->napi);
+ 
+ 	/* In theory, this can happen: if we don't get any buffers in
+diff --git a/drivers/net/wireless/ath/ar9170/hw.h b/drivers/net/wireless/ath/ar9170/hw.h
+index 6cbfb2f..3931181 100644
+--- a/drivers/net/wireless/ath/ar9170/hw.h
++++ b/drivers/net/wireless/ath/ar9170/hw.h
+@@ -422,5 +422,6 @@ enum ar9170_txq {
+ 
+ #define AR9170_TXQ_DEPTH	32
+ #define AR9170_TX_MAX_PENDING	128
++#define AR9170_RX_STREAM_MAX_SIZE 65535
+ 
+ #endif /* __AR9170_HW_H */
+diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
+index c1f8c69..3e547b5 100644
+--- a/drivers/net/wireless/ath/ar9170/main.c
++++ b/drivers/net/wireless/ath/ar9170/main.c
+@@ -2526,7 +2526,7 @@ void *ar9170_alloc(size_t priv_size)
+ 	 * tends to split the streams into seperate rx descriptors.
+ 	 */
+ 
+-	skb = __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE, GFP_KERNEL);
++	skb = __dev_alloc_skb(AR9170_RX_STREAM_MAX_SIZE, GFP_KERNEL);
+ 	if (!skb)
+ 		goto err_nomem;
+ 
+diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
+index 6c70481..dbcb729 100644
+--- a/drivers/net/wireless/ath/ar9170/usb.c
++++ b/drivers/net/wireless/ath/ar9170/usb.c
+@@ -66,18 +66,28 @@ static struct usb_device_id ar9170_usb_ids[] = {
+ 	{ USB_DEVICE(0x0cf3, 0x1001) },
+ 	/* TP-Link TL-WN821N v2 */
+ 	{ USB_DEVICE(0x0cf3, 0x1002) },
++	/* 3Com Dual Band 802.11n USB Adapter */
++	{ USB_DEVICE(0x0cf3, 0x1010) },
++	/* H3C Dual Band 802.11n USB Adapter */
++	{ USB_DEVICE(0x0cf3, 0x1011) },
+ 	/* Cace Airpcap NX */
+ 	{ USB_DEVICE(0xcace, 0x0300) },
+ 	/* D-Link DWA 160 A1 */
+ 	{ USB_DEVICE(0x07d1, 0x3c10) },
+ 	/* D-Link DWA 160 A2 */
+ 	{ USB_DEVICE(0x07d1, 0x3a09) },
++	/* Netgear WNA1000 */
++	{ USB_DEVICE(0x0846, 0x9040) },
+ 	/* Netgear WNDA3100 */
+ 	{ USB_DEVICE(0x0846, 0x9010) },
+ 	/* Netgear WN111 v2 */
+ 	{ USB_DEVICE(0x0846, 0x9001) },
+ 	/* Zydas ZD1221 */
+ 	{ USB_DEVICE(0x0ace, 0x1221) },
++	/* Proxim ORiNOCO 802.11n USB */
++	{ USB_DEVICE(0x1435, 0x0804) },
++	/* WNC Generic 11n USB Dongle */
++	{ USB_DEVICE(0x1435, 0x0326) },
+ 	/* ZyXEL NWD271N */
+ 	{ USB_DEVICE(0x0586, 0x3417) },
+ 	/* Z-Com UB81 BG */
+diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
+index 6313788..cefbfb9 100644
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -2975,13 +2975,15 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
+ 
+ 	if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
+ 		if (*new_flags & FIF_PROMISC_IN_BSS) {
+-			rfilt |= AR5K_RX_FILTER_PROM;
+ 			__set_bit(ATH_STAT_PROMISC, sc->status);
+ 		} else {
+ 			__clear_bit(ATH_STAT_PROMISC, sc->status);
+ 		}
+ 	}
+ 
++	if (test_bit(ATH_STAT_PROMISC, sc->status))
++		rfilt |= AR5K_RX_FILTER_PROM;
++
+ 	/* Note, AR5K_RX_FILTER_MCAST is already enabled */
+ 	if (*new_flags & FIF_ALLMULTI) {
+ 		mfilt[0] =  ~0;
+diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
+index f735a96..2185f97 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -398,7 +398,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
+ 	ah->config.pcie_clock_req = 0;
+ 	ah->config.pcie_waen = 0;
+ 	ah->config.analog_shiftreg = 1;
+-	ah->config.ht_enable = 1;
+ 	ah->config.ofdm_trig_low = 200;
+ 	ah->config.ofdm_trig_high = 500;
+ 	ah->config.cck_trig_high = 200;
+@@ -412,6 +411,11 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
+ 		ah->config.spurchans[i][1] = AR_NO_SPUR;
+ 	}
+ 
++	if (ah->hw_version.devid != AR2427_DEVID_PCIE)
++		ah->config.ht_enable = 1;
++	else
++		ah->config.ht_enable = 0;
++
+ 	ah->config.intr_mitigation = true;
+ 
+ 	/*
+@@ -617,6 +621,7 @@ static bool ath9k_hw_devid_supported(u16 devid)
+ 	case AR9285_DEVID_PCIE:
+ 	case AR5416_DEVID_AR9287_PCI:
+ 	case AR5416_DEVID_AR9287_PCIE:
++	case AR2427_DEVID_PCIE:
+ 		return true;
+ 	default:
+ 		break;
+diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
+index ff4383b..262556a 100644
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -37,6 +37,7 @@
+ #define AR9280_DEVID_PCI	0x0029
+ #define AR9280_DEVID_PCIE	0x002a
+ #define AR9285_DEVID_PCIE	0x002b
++#define AR2427_DEVID_PCIE	0x002c
+ #define AR5416_AR9100_DEVID	0x000b
+ #define	AR_SUBVENDOR_ID_NOG	0x0e11
+ #define AR_SUBVENDOR_ID_NEW_A	0x7065
+diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
+index 15eb245..087b7e5 100644
+--- a/drivers/net/wireless/ath/ath9k/main.c
++++ b/drivers/net/wireless/ath/ath9k/main.c
+@@ -1541,12 +1541,14 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
+ 	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
+ 		IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+ 		IEEE80211_HW_SIGNAL_DBM |
+-		IEEE80211_HW_AMPDU_AGGREGATION |
+ 		IEEE80211_HW_SUPPORTS_PS |
+ 		IEEE80211_HW_PS_NULLFUNC_STACK |
+ 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
+ 		IEEE80211_HW_SPECTRUM_MGMT;
+ 
++	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
++		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
++
+ 	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt)
+ 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
+ 
+diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
+index 903dd8a..14cf3fe 100644
+--- a/drivers/net/wireless/ath/ath9k/pci.c
++++ b/drivers/net/wireless/ath/ath9k/pci.c
+@@ -25,6 +25,7 @@ static struct pci_device_id ath_pci_id_table[] __devinitdata = {
+ 	{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI   */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
++	{ PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI   */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
+ 	{ 0 }
+diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
+index d636639..1f423f2 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
++++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
+@@ -1674,12 +1674,12 @@ struct iwl_cfg iwl5300_agn_cfg = {
+ 	.use_rts_for_ht = true, /* use rts/cts protection */
+ };
+ 
+-struct iwl_cfg iwl5100_bg_cfg = {
+-	.name = "5100BG",
++struct iwl_cfg iwl5100_bgn_cfg = {
++	.name = "5100BGN",
+ 	.fw_name_pre = IWL5000_FW_PRE,
+ 	.ucode_api_max = IWL5000_UCODE_API_MAX,
+ 	.ucode_api_min = IWL5000_UCODE_API_MIN,
+-	.sku = IWL_SKU_G,
++	.sku = IWL_SKU_G|IWL_SKU_N,
+ 	.ops = &iwl5000_ops,
+ 	.eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
+ 	.eeprom_ver = EEPROM_5000_EEPROM_VERSION,
+@@ -1705,7 +1705,6 @@ struct iwl_cfg iwl5100_abg_cfg = {
+ 	.valid_tx_ant = ANT_B,
+ 	.valid_rx_ant = ANT_AB,
+ 	.need_pll_cfg = true,
+-	.ht_greenfield_support = true,
+ };
+ 
+ struct iwl_cfg iwl5100_agn_cfg = {
+@@ -1762,6 +1761,22 @@ struct iwl_cfg iwl5150_agn_cfg = {
+ 	.use_rts_for_ht = true, /* use rts/cts protection */
+ };
+ 
++struct iwl_cfg iwl5150_abg_cfg = {
++	.name = "5150ABG",
++	.fw_name_pre = IWL5150_FW_PRE,
++	.ucode_api_max = IWL5150_UCODE_API_MAX,
++	.ucode_api_min = IWL5150_UCODE_API_MIN,
++	.sku = IWL_SKU_A|IWL_SKU_G,
++	.ops = &iwl5150_ops,
++	.eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
++	.eeprom_ver = EEPROM_5050_EEPROM_VERSION,
++	.eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
++	.mod_params = &iwl50_mod_params,
++	.valid_tx_ant = ANT_A,
++	.valid_rx_ant = ANT_AB,
++	.need_pll_cfg = true,
++};
++
+ MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
+ MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
+ 
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+index 0eb2591..1a3dfa2 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+@@ -402,10 +402,23 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
+ 				      struct iwl_lq_sta *lq_data, u8 tid,
+ 				      struct ieee80211_sta *sta)
+ {
++	int ret;
++
+ 	if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
+ 		IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n",
+ 				sta->addr, tid);
+-		ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
++		ret = ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
++		if (ret == -EAGAIN) {
++			/*
++			 * driver and mac80211 is out of sync
++			 * this might be cause by reloading firmware
++			 * stop the tx ba session here
++			 */
++			IWL_DEBUG_HT(priv, "Fail start Tx agg on tid: %d\n",
++				tid);
++			ret = ieee80211_stop_tx_ba_session(priv->hw, sta->addr, tid,
++						WLAN_BACK_INITIATOR);
++		}
+ 	}
+ }
+ 
+@@ -2180,9 +2193,12 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
+ 
+ 	/* Else we have enough samples; calculate estimate of
+ 	 * actual average throughput */
+-
+-	BUG_ON(window->average_tpt != ((window->success_ratio *
+-			tbl->expected_tpt[index] + 64) / 128));
++	if (window->average_tpt != ((window->success_ratio *
++			tbl->expected_tpt[index] + 64) / 128)) {
++		IWL_ERR(priv, "expected_tpt should have been calculated by now\n");
++		window->average_tpt = ((window->success_ratio *
++					tbl->expected_tpt[index] + 64) / 128);
++	}
+ 
+ 	/* If we are searching for better modulation mode, check success. */
+ 	if (lq_sta->search_better_tbl &&
+diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
+index 921dc4a..166bedd 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
+@@ -3203,23 +3203,63 @@ static struct pci_device_id iwl_hw_card_ids[] = {
+ 	{IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
+ #endif /* CONFIG_IWL4965 */
+ #ifdef CONFIG_IWL5000
+-	{IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bg_cfg)},
+-	{IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bg_cfg)},
+-	{IWL_PCI_DEVICE(0x4232, 0x1206, iwl5100_abg_cfg)},
+-	{IWL_PCI_DEVICE(0x4232, 0x1306, iwl5100_abg_cfg)},
+-	{IWL_PCI_DEVICE(0x4232, 0x1326, iwl5100_abg_cfg)},
+-	{IWL_PCI_DEVICE(0x4237, 0x1216, iwl5100_abg_cfg)},
+-	{IWL_PCI_DEVICE(0x4232, PCI_ANY_ID, iwl5100_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x4235, PCI_ANY_ID, iwl5300_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x4236, PCI_ANY_ID, iwl5300_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x4237, PCI_ANY_ID, iwl5100_agn_cfg)},
+-/* 5350 WiFi/WiMax */
+-	{IWL_PCI_DEVICE(0x423A, 0x1001, iwl5350_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x423A, 0x1021, iwl5350_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x423B, 0x1011, iwl5350_agn_cfg)},
+-/* 5150 Wifi/WiMax */
+-	{IWL_PCI_DEVICE(0x423C, PCI_ANY_ID, iwl5150_agn_cfg)},
+-	{IWL_PCI_DEVICE(0x423D, PCI_ANY_ID, iwl5150_agn_cfg)},
++/* 5100 Series WiFi */
++	{IWL_PCI_DEVICE(0x4232, 0x1201, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1301, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1204, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1304, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bgn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bgn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1206, iwl5100_abg_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1306, iwl5100_abg_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1221, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1321, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1224, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1324, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1225, iwl5100_bgn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1325, iwl5100_bgn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1226, iwl5100_abg_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4232, 0x1326, iwl5100_abg_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1211, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1311, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1214, iwl5100_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1314, iwl5100_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1215, iwl5100_bgn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1315, iwl5100_bgn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1216, iwl5100_abg_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4237, 0x1316, iwl5100_abg_cfg)}, /* Half Mini Card */
++
++/* 5300 Series WiFi */
++	{IWL_PCI_DEVICE(0x4235, 0x1021, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1121, iwl5300_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1024, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1124, iwl5300_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1001, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1101, iwl5300_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1004, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4235, 0x1104, iwl5300_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4236, 0x1011, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4236, 0x1111, iwl5300_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x4236, 0x1014, iwl5300_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x4236, 0x1114, iwl5300_agn_cfg)}, /* Half Mini Card */
++
++/* 5350 Series WiFi/WiMax */
++	{IWL_PCI_DEVICE(0x423A, 0x1001, iwl5350_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423A, 0x1021, iwl5350_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423B, 0x1011, iwl5350_agn_cfg)}, /* Mini Card */
++
++/* 5150 Series Wifi/WiMax */
++	{IWL_PCI_DEVICE(0x423C, 0x1201, iwl5150_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423C, 0x1301, iwl5150_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x423C, 0x1206, iwl5150_abg_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
++
++	{IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
++	{IWL_PCI_DEVICE(0x423D, 0x1216, iwl5150_abg_cfg)}, /* Mini Card */
++	{IWL_PCI_DEVICE(0x423D, 0x1316, iwl5150_abg_cfg)}, /* Half Mini Card */
+ /* 6000/6050 Series */
+ 	{IWL_PCI_DEVICE(0x008D, PCI_ANY_ID, iwl6000h_2agn_cfg)},
+ 	{IWL_PCI_DEVICE(0x008E, PCI_ANY_ID, iwl6000h_2agn_cfg)},
+diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
+index cea2ee2..3539ea4 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
++++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
+@@ -53,9 +53,10 @@ extern struct iwl_cfg iwl4965_agn_cfg;
+ extern struct iwl_cfg iwl5300_agn_cfg;
+ extern struct iwl_cfg iwl5100_agn_cfg;
+ extern struct iwl_cfg iwl5350_agn_cfg;
+-extern struct iwl_cfg iwl5100_bg_cfg;
++extern struct iwl_cfg iwl5100_bgn_cfg;
+ extern struct iwl_cfg iwl5100_abg_cfg;
+ extern struct iwl_cfg iwl5150_agn_cfg;
++extern struct iwl_cfg iwl5150_abg_cfg;
+ extern struct iwl_cfg iwl6000h_2agn_cfg;
+ extern struct iwl_cfg iwl6000i_2agn_cfg;
+ extern struct iwl_cfg iwl6000_3agn_cfg;
+diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
+index cc96d13..7f15b7e 100644
+--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
++++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
+@@ -791,8 +791,10 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
+ 		hdr->seq_ctrl |= cpu_to_le16(seq_number);
+ 		seq_number += 0x10;
+ 		/* aggregation is on for this <sta,tid> */
+-		if (info->flags & IEEE80211_TX_CTL_AMPDU)
++		if (info->flags & IEEE80211_TX_CTL_AMPDU &&
++		    priv->stations[sta_id].tid[tid].agg.state == IWL_AGG_ON) {
+ 			txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
++		}
+ 	}
+ 
+ 	txq = &priv->txq[txq_id];
+@@ -1273,7 +1275,7 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
+ {
+ 	int tx_fifo_id, txq_id, sta_id, ssn = -1;
+ 	struct iwl_tid_data *tid_data;
+-	int ret, write_ptr, read_ptr;
++	int write_ptr, read_ptr;
+ 	unsigned long flags;
+ 
+ 	if (!ra) {
+@@ -1325,13 +1327,17 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
+ 	priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF;
+ 
+ 	spin_lock_irqsave(&priv->lock, flags);
+-	ret = priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, ssn,
++	/*
++	 * the only reason this call can fail is queue number out of range,
++	 * which can happen if uCode is reloaded and all the station
++	 * information are lost. if it is outside the range, there is no need
++	 * to deactivate the uCode queue, just return "success" to allow
++	 *  mac80211 to clean up it own data.
++	 */
++	priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, ssn,
+ 						   tx_fifo_id);
+ 	spin_unlock_irqrestore(&priv->lock, flags);
+ 
+-	if (ret)
+-		return ret;
+-
+ 	ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid);
+ 
+ 	return 0;
+diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
+index b3c4fbd..805284d 100644
+--- a/drivers/net/wireless/p54/p54usb.c
++++ b/drivers/net/wireless/p54/p54usb.c
+@@ -78,6 +78,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
+ 	{USB_DEVICE(0x1413, 0x5400)},   /* Telsey 802.11g USB2.0 Adapter */
+ 	{USB_DEVICE(0x1435, 0x0427)},	/* Inventel UR054G */
+ 	{USB_DEVICE(0x2001, 0x3704)},	/* DLink DWL-G122 rev A2 */
++	{USB_DEVICE(0x413c, 0x5513)},	/* Dell WLA3310 USB Wireless Adapter */
+ 	{USB_DEVICE(0x413c, 0x8102)},	/* Spinnaker DUT */
+ 	{USB_DEVICE(0x413c, 0x8104)},	/* Cohiba Proto board */
+ 	{}
+diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
+index 16429c4..c6ca7ee 100644
+--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
+@@ -190,6 +190,7 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio)
+ 			info->flags |= IEEE80211_TX_STAT_ACK;
+ 
+ 		info->status.rates[0].count = (flags & 0xFF) + 1;
++		info->status.rates[1].idx = -1;
+ 
+ 		ieee80211_tx_status_irqsafe(dev, skb);
+ 		if (ring->entries - skb_queue_len(&ring->queue) == 2)
+diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
+index 9423f22..d74b89b 100644
+--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
++++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
+@@ -160,6 +160,7 @@ disable:
+ 	sdio_disable_func(func);
+ release:
+ 	sdio_release_host(func);
++	wl1251_free_hw(wl);
+ 	return ret;
+ }
+ 
+diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
+index a7aae24..1f1f5a8 100644
+--- a/drivers/oprofile/cpu_buffer.c
++++ b/drivers/oprofile/cpu_buffer.c
+@@ -30,23 +30,7 @@
+ 
+ #define OP_BUFFER_FLAGS	0
+ 
+-/*
+- * Read and write access is using spin locking. Thus, writing to the
+- * buffer by NMI handler (x86) could occur also during critical
+- * sections when reading the buffer. To avoid this, there are 2
+- * buffers for independent read and write access. Read access is in
+- * process context only, write access only in the NMI handler. If the
+- * read buffer runs empty, both buffers are swapped atomically. There
+- * is potentially a small window during swapping where the buffers are
+- * disabled and samples could be lost.
+- *
+- * Using 2 buffers is a little bit overhead, but the solution is clear
+- * and does not require changes in the ring buffer implementation. It
+- * can be changed to a single buffer solution when the ring buffer
+- * access is implemented as non-locking atomic code.
+- */
+-static struct ring_buffer *op_ring_buffer_read;
+-static struct ring_buffer *op_ring_buffer_write;
++static struct ring_buffer *op_ring_buffer;
+ DEFINE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer);
+ 
+ static void wq_sync_buffer(struct work_struct *work);
+@@ -69,12 +53,9 @@ void oprofile_cpu_buffer_inc_smpl_lost(void)
+ 
+ void free_cpu_buffers(void)
+ {
+-	if (op_ring_buffer_read)
+-		ring_buffer_free(op_ring_buffer_read);
+-	op_ring_buffer_read = NULL;
+-	if (op_ring_buffer_write)
+-		ring_buffer_free(op_ring_buffer_write);
+-	op_ring_buffer_write = NULL;
++	if (op_ring_buffer)
++		ring_buffer_free(op_ring_buffer);
++	op_ring_buffer = NULL;
+ }
+ 
+ #define RB_EVENT_HDR_SIZE 4
+@@ -87,11 +68,8 @@ int alloc_cpu_buffers(void)
+ 	unsigned long byte_size = buffer_size * (sizeof(struct op_sample) +
+ 						 RB_EVENT_HDR_SIZE);
+ 
+-	op_ring_buffer_read = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
+-	if (!op_ring_buffer_read)
+-		goto fail;
+-	op_ring_buffer_write = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
+-	if (!op_ring_buffer_write)
++	op_ring_buffer = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
++	if (!op_ring_buffer)
+ 		goto fail;
+ 
+ 	for_each_possible_cpu(i) {
+@@ -163,16 +141,11 @@ struct op_sample
+ *op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size)
+ {
+ 	entry->event = ring_buffer_lock_reserve
+-		(op_ring_buffer_write, sizeof(struct op_sample) +
++		(op_ring_buffer, sizeof(struct op_sample) +
+ 		 size * sizeof(entry->sample->data[0]));
+-	if (entry->event)
+-		entry->sample = ring_buffer_event_data(entry->event);
+-	else
+-		entry->sample = NULL;
+-
+-	if (!entry->sample)
++	if (!entry->event)
+ 		return NULL;
+-
++	entry->sample = ring_buffer_event_data(entry->event);
+ 	entry->size = size;
+ 	entry->data = entry->sample->data;
+ 
+@@ -181,25 +154,16 @@ struct op_sample
+ 
+ int op_cpu_buffer_write_commit(struct op_entry *entry)
+ {
+-	return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event);
++	return ring_buffer_unlock_commit(op_ring_buffer, entry->event);
+ }
+ 
+ struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu)
+ {
+ 	struct ring_buffer_event *e;
+-	e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
+-	if (e)
+-		goto event;
+-	if (ring_buffer_swap_cpu(op_ring_buffer_read,
+-				 op_ring_buffer_write,
+-				 cpu))
++	e = ring_buffer_consume(op_ring_buffer, cpu, NULL);
++	if (!e)
+ 		return NULL;
+-	e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
+-	if (e)
+-		goto event;
+-	return NULL;
+ 
+-event:
+ 	entry->event = e;
+ 	entry->sample = ring_buffer_event_data(e);
+ 	entry->size = (ring_buffer_event_length(e) - sizeof(struct op_sample))
+@@ -210,8 +174,7 @@ event:
+ 
+ unsigned long op_cpu_buffer_entries(int cpu)
+ {
+-	return ring_buffer_entries_cpu(op_ring_buffer_read, cpu)
+-		+ ring_buffer_entries_cpu(op_ring_buffer_write, cpu);
++	return ring_buffer_entries_cpu(op_ring_buffer, cpu);
+ }
+ 
+ static int
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index e2641cd..c0de0b9 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -1444,7 +1444,8 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
+ 	conf5 &= ~(1 << 24);  /* Clear bit 24 */
+ 
+ 	switch (pdev->device) {
+-	case PCI_DEVICE_ID_JMICRON_JMB360:
++	case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */
++	case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */
+ 		/* The controller should be in single function ahci mode */
+ 		conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */
+ 		break;
+@@ -1480,12 +1481,14 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
+ }
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
++DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
+ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
+@@ -2092,6 +2095,8 @@ static void __devinit quirk_disable_msi(struct pci_dev *dev)
+ 	}
+ }
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi);
+ 
+ /* Go through the list of Hypertransport capabilities and
+  * return 1 if a HT MSI capability is found and enabled */
+@@ -2183,15 +2188,16 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
+ 			 ht_enable_msi_mapping);
+ 
+-/* The P5N32-SLI Premium motherboard from Asus has a problem with msi
++/* The P5N32-SLI motherboards from Asus have a problem with msi
+  * for the MCP55 NIC. It is not yet determined whether the msi problem
+  * also affects other devices. As for now, turn off msi for this device.
+  */
+ static void __devinit nvenet_msi_disable(struct pci_dev *dev)
+ {
+-	if (dmi_name_in_vendors("P5N32-SLI PREMIUM")) {
++	if (dmi_name_in_vendors("P5N32-SLI PREMIUM") ||
++	    dmi_name_in_vendors("P5N32-E SLI")) {
+ 		dev_info(&dev->dev,
+-			 "Disabling msi for MCP55 NIC on P5N32-SLI Premium\n");
++			 "Disabling msi for MCP55 NIC on P5N32-SLI\n");
+ 		dev->no_msi = 1;
+ 	}
+ }
+diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
+index 473e5f2..66c2d6a 100644
+--- a/drivers/rtc/rtc-cmos.c
++++ b/drivers/rtc/rtc-cmos.c
+@@ -723,6 +723,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
+ 		}
+ 	}
+ 
++	cmos_rtc.dev = dev;
++	dev_set_drvdata(dev, &cmos_rtc);
++
+ 	cmos_rtc.rtc = rtc_device_register(driver_name, dev,
+ 				&cmos_rtc_ops, THIS_MODULE);
+ 	if (IS_ERR(cmos_rtc.rtc)) {
+@@ -730,8 +733,6 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
+ 		goto cleanup0;
+ 	}
+ 
+-	cmos_rtc.dev = dev;
+-	dev_set_drvdata(dev, &cmos_rtc);
+ 	rename_region(ports, dev_name(&cmos_rtc.rtc->dev));
+ 
+ 	spin_lock_irq(&rtc_lock);
+diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
+index e0d7b99..43bfffe 100644
+--- a/drivers/rtc/rtc-s3c.c
++++ b/drivers/rtc/rtc-s3c.c
+@@ -456,8 +456,6 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
+  	pr_debug("s3c2410_rtc: RTCCON=%02x\n",
+ 		 readb(s3c_rtc_base + S3C2410_RTCCON));
+ 
+-	s3c_rtc_setfreq(&pdev->dev, 1);
+-
+ 	device_init_wakeup(&pdev->dev, 1);
+ 
+ 	/* register RTC and exit */
+@@ -474,6 +472,9 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
+ 	rtc->max_user_freq = 128;
+ 
+ 	platform_set_drvdata(pdev, rtc);
++
++	s3c_rtc_setfreq(&pdev->dev, 1);
++
+ 	return 0;
+ 
+  err_nortc:
+diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
+index 799bd75..f3e5e30 100644
+--- a/drivers/scsi/qla2xxx/qla_isr.c
++++ b/drivers/scsi/qla2xxx/qla_isr.c
+@@ -2240,30 +2240,28 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
+ 
+ 	/* If possible, enable MSI-X. */
+ 	if (!IS_QLA2432(ha) && !IS_QLA2532(ha) &&
+-	    !IS_QLA8432(ha) && !IS_QLA8001(ha))
+-		goto skip_msix;
++		!IS_QLA8432(ha) && !IS_QLA8001(ha))
++		goto skip_msi;
++
++	if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
++		(ha->pdev->subsystem_device == 0x7040 ||
++		ha->pdev->subsystem_device == 0x7041 ||
++		ha->pdev->subsystem_device == 0x1705)) {
++		DEBUG2(qla_printk(KERN_WARNING, ha,
++			"MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X,0x%X).\n",
++			ha->pdev->subsystem_vendor,
++			ha->pdev->subsystem_device));
++		goto skip_msi;
++	}
+ 
+ 	if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX ||
+ 		!QLA_MSIX_FW_MODE_1(ha->fw_attributes))) {
+ 		DEBUG2(qla_printk(KERN_WARNING, ha,
+ 		"MSI-X: Unsupported ISP2432 (0x%X, 0x%X).\n",
+ 			ha->pdev->revision, ha->fw_attributes));
+-
+ 		goto skip_msix;
+ 	}
+ 
+-	if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
+-	    (ha->pdev->subsystem_device == 0x7040 ||
+-		ha->pdev->subsystem_device == 0x7041 ||
+-		ha->pdev->subsystem_device == 0x1705)) {
+-		DEBUG2(qla_printk(KERN_WARNING, ha,
+-		    "MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X, 0x%X).\n",
+-		    ha->pdev->subsystem_vendor,
+-		    ha->pdev->subsystem_device));
+-
+-		goto skip_msi;
+-	}
+-
+ 	ret = qla24xx_enable_msix(ha, rsp);
+ 	if (!ret) {
+ 		DEBUG2(qla_printk(KERN_INFO, ha,
+diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
+index 9aef87f..27829e7 100644
+--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
++++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
+@@ -123,7 +123,7 @@ static const struct ni_board_struct ni_boards[] = {
+ 	 .adbits = 12,
+ 	 .ai_fifo_depth = 1024,
+ 	 .alwaysdither = 0,
+-	 .gainlkup = ai_gain_16,
++	 .gainlkup = ai_gain_4,
+ 	 .ai_speed = 5000,
+ 	 .n_aochan = 2,
+ 	 .aobits = 12,
+diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
+index 66274d7..88644ef 100644
+--- a/drivers/staging/rtl8192su/r8192U_core.c
++++ b/drivers/staging/rtl8192su/r8192U_core.c
+@@ -120,6 +120,7 @@ static struct usb_device_id rtl8192_usb_id_tbl[] = {
+ 	{USB_DEVICE(0x050d, 0x805E)},
+ 	/* Sitecom */
+ 	{USB_DEVICE(0x0df6, 0x0031)},
++	{USB_DEVICE(0x0df6, 0x004b)},	/* WL-349 */
+ 	/* EnGenius */
+ 	{USB_DEVICE(0x1740, 0x9201)},
+ 	/* Dlink */
+diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
+index 53450b4..269d1e2 100644
+--- a/drivers/staging/vt6655/device_main.c
++++ b/drivers/staging/vt6655/device_main.c
+@@ -1089,11 +1089,13 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
+     }
+ //2008-07-21-01<Add>by MikeLiu
+ //register wpadev
++#if 0
+    if(wpa_set_wpadev(pDevice, 1)!=0) {
+      printk("Fail to Register WPADEV?\n");
+         unregister_netdev(pDevice->dev);
+         free_netdev(dev);
+    }
++#endif
+     device_print_info(pDevice);
+     pci_set_drvdata(pcid, pDevice);
+     return 0;
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
+index e6119ed..0e64037 100644
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -1201,7 +1201,7 @@ made_compressed_probe:
+ 		if (rcv->urb == NULL) {
+ 			dev_dbg(&intf->dev,
+ 				"out of memory (read urbs usb_alloc_urb)\n");
+-			goto alloc_fail7;
++			goto alloc_fail6;
+ 		}
+ 
+ 		rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+@@ -1225,7 +1225,7 @@ made_compressed_probe:
+ 		if (snd->urb == NULL) {
+ 			dev_dbg(&intf->dev,
+ 				"out of memory (write urbs usb_alloc_urb)");
+-			goto alloc_fail7;
++			goto alloc_fail8;
+ 		}
+ 
+ 		if (usb_endpoint_xfer_int(epwrite))
+@@ -1264,6 +1264,7 @@ made_compressed_probe:
+ 		i = device_create_file(&intf->dev,
+ 						&dev_attr_iCountryCodeRelDate);
+ 		if (i < 0) {
++			device_remove_file(&intf->dev, &dev_attr_wCountryCodes);
+ 			kfree(acm->country_codes);
+ 			goto skip_countries;
+ 		}
+@@ -1300,6 +1301,7 @@ alloc_fail8:
+ 		usb_free_urb(acm->wb[i].urb);
+ alloc_fail7:
+ 	acm_read_buffers_free(acm);
++alloc_fail6:
+ 	for (i = 0; i < num_rx_buf; i++)
+ 		usb_free_urb(acm->ru[i].urb);
+ 	usb_free_urb(acm->ctrlurb);
+diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
+index fa3d142..08a9a62 100644
+--- a/drivers/usb/gadget/fsl_udc_core.c
++++ b/drivers/usb/gadget/fsl_udc_core.c
+@@ -489,7 +489,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
+ 	case USB_ENDPOINT_XFER_ISOC:
+ 		/* Calculate transactions needed for high bandwidth iso */
+ 		mult = (unsigned char)(1 + ((max >> 11) & 0x03));
+-		max = max & 0x8ff;	/* bit 0~10 */
++		max = max & 0x7ff;	/* bit 0~10 */
+ 		/* 3 transactions at most */
+ 		if (mult > 3)
+ 			goto en_done;
+diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
+index 698f461..6ac3976 100644
+--- a/drivers/usb/host/ehci-hub.c
++++ b/drivers/usb/host/ehci-hub.c
+@@ -292,6 +292,16 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
+ 	/* manually resume the ports we suspended during bus_suspend() */
+ 	i = HCS_N_PORTS (ehci->hcs_params);
+ 	while (i--) {
++		/* clear phy low power mode before resume */
++		if (ehci->has_hostpc) {
++			u32 __iomem	*hostpc_reg =
++				(u32 __iomem *)((u8 *)ehci->regs
++				+ HOSTPC0 + 4 * (i & 0xff));
++			temp = ehci_readl(ehci, hostpc_reg);
++			ehci_writel(ehci, temp & ~HOSTPC_PHCD,
++				hostpc_reg);
++			mdelay(5);
++		}
+ 		temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
+ 		temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
+ 		if (test_bit(i, &ehci->bus_suspended) &&
+@@ -676,6 +686,13 @@ static int ehci_hub_control (
+ 			if (temp & PORT_SUSPEND) {
+ 				if ((temp & PORT_PE) == 0)
+ 					goto error;
++				/* clear phy low power mode before resume */
++				if (hostpc_reg) {
++					temp1 = ehci_readl(ehci, hostpc_reg);
++					ehci_writel(ehci, temp1 & ~HOSTPC_PHCD,
++						hostpc_reg);
++					mdelay(5);
++				}
+ 				/* resume signaling for 20 msec */
+ 				temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
+ 				ehci_writel(ehci, temp | PORT_RESUME,
+diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c
+index 9974f32..a24a92f 100644
+--- a/drivers/usb/host/xhci-hcd.c
++++ b/drivers/usb/host/xhci-hcd.c
+@@ -97,6 +97,33 @@ int xhci_halt(struct xhci_hcd *xhci)
+ }
+ 
+ /*
++ * Set the run bit and wait for the host to be running.
++ */
++int xhci_start(struct xhci_hcd *xhci)
++{
++	u32 temp;
++	int ret;
++
++	temp = xhci_readl(xhci, &xhci->op_regs->command);
++	temp |= (CMD_RUN);
++	xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
++			temp);
++	xhci_writel(xhci, temp, &xhci->op_regs->command);
++
++	/*
++	 * Wait for the HCHalted Status bit to be 0 to indicate the host is
++	 * running.
++	 */
++	ret = handshake(xhci, &xhci->op_regs->status,
++			STS_HALT, 0, XHCI_MAX_HALT_USEC);
++	if (ret == -ETIMEDOUT)
++		xhci_err(xhci, "Host took too long to start, "
++				"waited %u microseconds.\n",
++				XHCI_MAX_HALT_USEC);
++	return ret;
++}
++
++/*
+  * Reset a halted HC, and set the internal HC state to HC_STATE_HALT.
+  *
+  * This resets pipelines, timers, counters, state machines, etc.
+@@ -107,6 +134,7 @@ int xhci_reset(struct xhci_hcd *xhci)
+ {
+ 	u32 command;
+ 	u32 state;
++	int ret;
+ 
+ 	state = xhci_readl(xhci, &xhci->op_regs->status);
+ 	if ((state & STS_HALT) == 0) {
+@@ -121,7 +149,17 @@ int xhci_reset(struct xhci_hcd *xhci)
+ 	/* XXX: Why does EHCI set this here?  Shouldn't other code do this? */
+ 	xhci_to_hcd(xhci)->state = HC_STATE_HALT;
+ 
+-	return handshake(xhci, &xhci->op_regs->command, CMD_RESET, 0, 250 * 1000);
++	ret = handshake(xhci, &xhci->op_regs->command,
++			CMD_RESET, 0, 250 * 1000);
++	if (ret)
++		return ret;
++
++	xhci_dbg(xhci, "Wait for controller to be ready for doorbell rings\n");
++	/*
++	 * xHCI cannot write to any doorbells or operational registers other
++	 * than status until the "Controller Not Ready" flag is cleared.
++	 */
++	return handshake(xhci, &xhci->op_regs->status, STS_CNR, 0, 250 * 1000);
+ }
+ 
+ /*
+@@ -460,13 +498,11 @@ int xhci_run(struct usb_hcd *hcd)
+ 	if (NUM_TEST_NOOPS > 0)
+ 		doorbell = xhci_setup_one_noop(xhci);
+ 
+-	temp = xhci_readl(xhci, &xhci->op_regs->command);
+-	temp |= (CMD_RUN);
+-	xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
+-			temp);
+-	xhci_writel(xhci, temp, &xhci->op_regs->command);
+-	/* Flush PCI posted writes */
+-	temp = xhci_readl(xhci, &xhci->op_regs->command);
++	if (xhci_start(xhci)) {
++		xhci_halt(xhci);
++		return -ENODEV;
++	}
++
+ 	xhci_dbg(xhci, "// @%p = 0x%x\n", &xhci->op_regs->command, temp);
+ 	if (doorbell)
+ 		(*doorbell)(xhci);
+@@ -1414,6 +1450,8 @@ void xhci_endpoint_reset(struct usb_hcd *hcd,
+ 		kfree(virt_ep->stopped_td);
+ 		xhci_ring_cmd_db(xhci);
+ 	}
++	virt_ep->stopped_td = NULL;
++	virt_ep->stopped_trb = NULL;
+ 	spin_unlock_irqrestore(&xhci->lock, flags);
+ 
+ 	if (ret)
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
+index 821b7b4..317e8dc 100644
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -241,10 +241,27 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
+ 	int i;
+ 	union xhci_trb *enq = ring->enqueue;
+ 	struct xhci_segment *enq_seg = ring->enq_seg;
++	struct xhci_segment *cur_seg;
++	unsigned int left_on_ring;
+ 
+ 	/* Check if ring is empty */
+-	if (enq == ring->dequeue)
++	if (enq == ring->dequeue) {
++		/* Can't use link trbs */
++		left_on_ring = TRBS_PER_SEGMENT - 1;
++		for (cur_seg = enq_seg->next; cur_seg != enq_seg;
++				cur_seg = cur_seg->next)
++			left_on_ring += TRBS_PER_SEGMENT - 1;
++
++		/* Always need one TRB free in the ring. */
++		left_on_ring -= 1;
++		if (num_trbs > left_on_ring) {
++			xhci_warn(xhci, "Not enough room on ring; "
++					"need %u TRBs, %u TRBs left\n",
++					num_trbs, left_on_ring);
++			return 0;
++		}
+ 		return 1;
++	}
+ 	/* Make sure there's an extra empty TRB available */
+ 	for (i = 0; i <= num_trbs; ++i) {
+ 		if (enq == ring->dequeue)
+@@ -333,7 +350,8 @@ static struct xhci_segment *find_trb_seg(
+ 	while (cur_seg->trbs > trb ||
+ 			&cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) {
+ 		generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic;
+-		if (TRB_TYPE(generic_trb->field[3]) == TRB_LINK &&
++		if ((generic_trb->field[3] & TRB_TYPE_BITMASK) ==
++				TRB_TYPE(TRB_LINK) &&
+ 				(generic_trb->field[3] & LINK_TOGGLE))
+ 			*cycle_state = ~(*cycle_state) & 0x1;
+ 		cur_seg = cur_seg->next;
+@@ -389,7 +407,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
+ 		BUG();
+ 
+ 	trb = &state->new_deq_ptr->generic;
+-	if (TRB_TYPE(trb->field[3]) == TRB_LINK &&
++	if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) &&
+ 				(trb->field[3] & LINK_TOGGLE))
+ 		state->new_cycle_state = ~(state->new_cycle_state) & 0x1;
+ 	next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
+@@ -548,6 +566,8 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
+ 		/* Otherwise just ring the doorbell to restart the ring */
+ 		ring_ep_doorbell(xhci, slot_id, ep_index);
+ 	}
++	ep->stopped_td = NULL;
++	ep->stopped_trb = NULL;
+ 
+ 	/*
+ 	 * Drop the lock and complete the URBs in the cancelled TD list.
+@@ -1065,8 +1085,13 @@ static int handle_tx_event(struct xhci_hcd *xhci,
+ 
+ 			ep->stopped_td = td;
+ 			ep->stopped_trb = event_trb;
++
+ 			xhci_queue_reset_ep(xhci, slot_id, ep_index);
+ 			xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index);
++
++			ep->stopped_td = NULL;
++			ep->stopped_trb = NULL;
++
+ 			xhci_ring_cmd_db(xhci);
+ 			goto td_cleanup;
+ 		default:
+@@ -1186,8 +1211,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
+ 			for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg;
+ 					cur_trb != event_trb;
+ 					next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) {
+-				if (TRB_TYPE(cur_trb->generic.field[3]) != TRB_TR_NOOP &&
+-						TRB_TYPE(cur_trb->generic.field[3]) != TRB_LINK)
++				if ((cur_trb->generic.field[3] &
++				 TRB_TYPE_BITMASK) != TRB_TYPE(TRB_TR_NOOP) &&
++				    (cur_trb->generic.field[3] &
++				 TRB_TYPE_BITMASK) != TRB_TYPE(TRB_LINK))
+ 					td->urb->actual_length +=
+ 						TRB_LEN(cur_trb->generic.field[2]);
+ 			}
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
+index 7d920f2..e3e087e 100644
+--- a/drivers/usb/serial/cp210x.c
++++ b/drivers/usb/serial/cp210x.c
+@@ -61,6 +61,8 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
+ 	{ USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
+ 	{ USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
++	{ USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
++	{ USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */
+ 	{ USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
+ 	{ USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */
+ 	{ USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */
+@@ -72,9 +74,12 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x10C4, 0x1601) }, /* Arkham Technology DS101 Adapter */
+ 	{ USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
+ 	{ USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
++	{ USB_DEVICE(0x10C4, 0x8044) }, /* Cygnal Debug Adapter */
++	{ USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
+ 	{ USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
+ 	{ USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */
+ 	{ USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
++	{ USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */
+ 	{ USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
+ 	{ USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
+ 	{ USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */
+@@ -82,12 +87,15 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */
+ 	{ USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
+ 	{ USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */
++	{ USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */
+ 	{ USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
+ 	{ USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
+ 	{ USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
++	{ USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
+ 	{ USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
+ 	{ USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
+ 	{ USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
++	{ USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
+ 	{ USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
+ 	{ USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
+ 	{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
+@@ -105,6 +113,7 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
+ 	{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
+ 	{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
++	{ USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
+ 	{ USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
+ 	{ USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */
+ 	{ USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */
+@@ -115,6 +124,8 @@ static struct usb_device_id id_table [] = {
+ 	{ USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
+ 	{ USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
+ 	{ USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
++	{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
++	{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
+ 	{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
+ 	{ USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
+ 	{ } /* Terminating Entry */
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
+index 9cf4652..bf56be1 100644
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -2306,6 +2306,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
+ 				"urb failed to set to rts/cts flow control\n");
+ 		}
+ 
++		/* raise DTR/RTS */
++		set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
+ 	} else {
+ 		/*
+ 		 * Xon/Xoff code
+@@ -2353,6 +2355,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
+ 			}
+ 		}
+ 
++		/* lower DTR/RTS */
++		clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
+ 	}
+ 	return;
+ }
+diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
+index 95d8d26..2e0497b 100644
+--- a/drivers/usb/serial/ir-usb.c
++++ b/drivers/usb/serial/ir-usb.c
+@@ -312,6 +312,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
+ 		kfree(port->read_urb->transfer_buffer);
+ 		port->read_urb->transfer_buffer = buffer;
+ 		port->read_urb->transfer_buffer_length = buffer_size;
++		port->bulk_in_buffer = buffer;
+ 
+ 		buffer = kmalloc(buffer_size, GFP_KERNEL);
+ 		if (!buffer) {
+@@ -321,6 +322,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
+ 		kfree(port->write_urb->transfer_buffer);
+ 		port->write_urb->transfer_buffer = buffer;
+ 		port->write_urb->transfer_buffer_length = buffer_size;
++		port->bulk_out_buffer = buffer;
+ 		port->bulk_out_size = buffer_size;
+ 	}
+ 
+diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
+index 3a78738..6825082 100644
+--- a/drivers/usb/serial/kl5kusb105.c
++++ b/drivers/usb/serial/kl5kusb105.c
+@@ -310,6 +310,7 @@ err_cleanup:
+ 				usb_free_urb(priv->write_urb_pool[j]);
+ 			}
+ 		}
++		kfree(priv);
+ 		usb_set_serial_port_data(serial->port[i], NULL);
+ 	}
+ 	return -ENOMEM;
+diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
+index 45ea694..9d99e68 100644
+--- a/drivers/usb/serial/kobil_sct.c
++++ b/drivers/usb/serial/kobil_sct.c
+@@ -345,7 +345,8 @@ static void kobil_close(struct usb_serial_port *port)
+ 
+ 	/* FIXME: Add rts/dtr methods */
+ 	if (port->write_urb) {
+-		usb_kill_urb(port->write_urb);
++		usb_poison_urb(port->write_urb);
++		kfree(port->write_urb->transfer_buffer);
+ 		usb_free_urb(port->write_urb);
+ 		port->write_urb = NULL;
+ 	}
+diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
+index 485fa9c..a861cd2 100644
+--- a/drivers/usb/serial/mos7840.c
++++ b/drivers/usb/serial/mos7840.c
+@@ -714,7 +714,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
+ 	mos7840_port = urb->context;
+ 	if (!mos7840_port) {
+ 		dbg("%s", "NULL mos7840_port pointer");
+-		mos7840_port->read_urb_busy = false;
+ 		return;
+ 	}
+ 
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
+index fcf56f9..fac0732 100644
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -334,6 +334,24 @@ static int  option_resume(struct usb_serial *serial);
+ #define ALCATEL_VENDOR_ID			0x1bbb
+ #define ALCATEL_PRODUCT_X060S			0x0000
+ 
++#define PIRELLI_VENDOR_ID			0x1266
++#define PIRELLI_PRODUCT_C100_1			0x1002
++#define PIRELLI_PRODUCT_C100_2			0x1003
++#define PIRELLI_PRODUCT_1004			0x1004
++#define PIRELLI_PRODUCT_1005			0x1005
++#define PIRELLI_PRODUCT_1006			0x1006
++#define PIRELLI_PRODUCT_1007			0x1007
++#define PIRELLI_PRODUCT_1008			0x1008
++#define PIRELLI_PRODUCT_1009			0x1009
++#define PIRELLI_PRODUCT_100A			0x100a
++#define PIRELLI_PRODUCT_100B			0x100b
++#define PIRELLI_PRODUCT_100C			0x100c
++#define PIRELLI_PRODUCT_100D			0x100d
++#define PIRELLI_PRODUCT_100E			0x100e
++#define PIRELLI_PRODUCT_100F			0x100f
++#define PIRELLI_PRODUCT_1011			0x1011
++#define PIRELLI_PRODUCT_1012			0x1012
++
+ /* Airplus products */
+ #define AIRPLUS_VENDOR_ID			0x1011
+ #define AIRPLUS_PRODUCT_MCD650			0x3198
+@@ -346,6 +364,12 @@ static int  option_resume(struct usb_serial *serial);
+ #define HAIER_VENDOR_ID				0x201e
+ #define HAIER_PRODUCT_CE100			0x2009
+ 
++#define CINTERION_VENDOR_ID			0x0681
++
++/* Olivetti products */
++#define OLIVETTI_VENDOR_ID			0x0b3c
++#define OLIVETTI_PRODUCT_OLICARD100		0xc000
++
+ static struct usb_device_id option_ids[] = {
+ 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
+ 	{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
+@@ -621,6 +645,180 @@ static struct usb_device_id option_ids[] = {
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1060, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1061, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1062, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1063, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1064, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1065, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1066, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1067, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1068, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1069, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1070, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1071, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1072, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1073, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1074, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1075, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1076, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1077, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1078, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1079, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1080, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1081, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1082, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1083, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1084, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1085, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1086, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1087, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1088, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1089, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1090, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1091, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1092, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1093, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1094, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1095, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1096, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1097, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1098, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1099, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1100, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1101, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1102, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1103, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1104, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1105, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1106, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1107, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1108, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1109, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1110, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1111, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1112, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1113, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1114, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1115, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1116, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1117, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1118, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1119, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1120, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1121, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1122, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1123, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1124, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1125, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1126, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1127, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1128, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1129, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1130, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1131, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1132, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1133, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1134, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1135, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1136, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1137, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1138, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1139, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1140, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1141, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1142, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1143, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1144, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1145, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1146, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1147, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1148, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1149, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1150, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1151, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1152, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1153, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1154, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1155, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1156, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1157, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1158, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1159, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1160, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1161, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1162, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1163, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1164, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1165, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1166, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1167, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1168, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1169, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1170, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1244, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1246, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1248, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1249, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1250, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1251, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1253, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1257, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1258, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1259, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1260, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1261, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1262, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1263, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1264, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1265, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1266, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1274, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1275, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1276, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1277, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1278, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1279, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1280, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1281, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1282, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1283, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1284, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1285, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1286, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1287, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1288, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1289, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1290, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1291, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1292, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1293, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1294, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1295, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1296, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1297, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
++	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
+ 	{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
+@@ -649,6 +847,27 @@ static struct usb_device_id option_ids[] = {
+ 	{ USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
+ 	{ USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) },
+ 	{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
++	/* Pirelli  */
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) },
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) },
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) },
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) },
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) },
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)},
++	{ USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)},
++
++	{ USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) },
++
++	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
+ 	{ } /* Terminating entry */
+ };
+ MODULE_DEVICE_TABLE(usb, option_ids);
+@@ -771,12 +990,19 @@ static int option_probe(struct usb_serial *serial,
+ 			const struct usb_device_id *id)
+ {
+ 	struct option_intf_private *data;
++
+ 	/* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
+ 	if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
+ 		serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
+ 		serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8)
+ 		return -ENODEV;
+ 
++	/* Bandrich modem and AT command interface is 0xff */
++	if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID ||
++		serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) &&
++		serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
++		return -ENODEV;
++
+ 	data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL);
+ 	if (!data)
+ 		return -ENOMEM;
+diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
+index ad1f923..c140870 100644
+--- a/drivers/usb/serial/visor.c
++++ b/drivers/usb/serial/visor.c
+@@ -249,6 +249,7 @@ static struct usb_serial_driver clie_3_5_device = {
+ 	.throttle =		visor_throttle,
+ 	.unthrottle =		visor_unthrottle,
+ 	.attach =		clie_3_5_startup,
++	.release =		visor_release,
+ 	.write =		visor_write,
+ 	.write_room =		visor_write_room,
+ 	.write_bulk_callback =	visor_write_bulk_callback,
+diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
+index 4d0a208..7215002 100644
+--- a/drivers/usb/storage/unusual_devs.h
++++ b/drivers/usb/storage/unusual_devs.h
+@@ -1858,6 +1858,21 @@ UNUSUAL_DEV(  0x1652, 0x6600, 0x0201, 0x0201,
+ 		US_SC_DEVICE, US_PR_DEVICE, NULL,
+ 		US_FL_IGNORE_RESIDUE ),
+ 
++/* Reported by Hans de Goede <hdegoede at redhat.com>
++ * These Appotech controllers are found in Picture Frames, they provide a
++ * (buggy) emulation of a cdrom drive which contains the windows software
++ * Uploading of pictures happens over the corresponding /dev/sg device. */
++UNUSUAL_DEV( 0x1908, 0x1315, 0x0000, 0x0000,
++		"BUILDWIN",
++		"Photo Frame",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		US_FL_BAD_SENSE ),
++UNUSUAL_DEV( 0x1908, 0x1320, 0x0000, 0x0000,
++		"BUILDWIN",
++		"Photo Frame",
++		US_SC_DEVICE, US_PR_DEVICE, NULL,
++		US_FL_BAD_SENSE ),
++
+ UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001,
+ 		"ST",
+ 		"2A",
+diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
+index eab33f1..7b547f5 100644
+--- a/drivers/xen/xenbus/xenbus_xs.c
++++ b/drivers/xen/xenbus/xenbus_xs.c
+@@ -499,7 +499,7 @@ int xenbus_printf(struct xenbus_transaction t,
+ #define PRINTF_BUFFER_SIZE 4096
+ 	char *printf_buffer;
+ 
+-	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL);
++	printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_NOIO | __GFP_HIGH);
+ 	if (printf_buffer == NULL)
+ 		return -ENOMEM;
+ 
+diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
+index 3616042..38ebe78 100644
+--- a/fs/btrfs/acl.c
++++ b/fs/btrfs/acl.c
+@@ -157,6 +157,9 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
+ 	int ret = 0;
+ 	struct posix_acl *acl = NULL;
+ 
++	if (!is_owner_or_cap(inode))
++		return -EPERM;
++
+ 	if (value) {
+ 		acl = posix_acl_from_xattr(value, size);
+ 		if (acl == NULL) {
+diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
+index 5646727..05a9b77 100644
+--- a/fs/cifs/cifsproto.h
++++ b/fs/cifs/cifsproto.h
+@@ -95,8 +95,10 @@ extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode,
+ 				__u16 fileHandle, struct file *file,
+ 				struct vfsmount *mnt, unsigned int oflags);
+ extern int cifs_posix_open(char *full_path, struct inode **pinode,
+-			   struct vfsmount *mnt, int mode, int oflags,
+-			   __u32 *poplock, __u16 *pnetfid, int xid);
++				struct vfsmount *mnt,
++				struct super_block *sb,
++				int mode, int oflags,
++				__u32 *poplock, __u16 *pnetfid, int xid);
+ extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
+ 				     FILE_UNIX_BASIC_INFO *info,
+ 				     struct cifs_sb_info *cifs_sb);
+diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
+index 1f42f77..c3d6182 100644
+--- a/fs/cifs/dir.c
++++ b/fs/cifs/dir.c
+@@ -183,13 +183,14 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
+ }
+ 
+ int cifs_posix_open(char *full_path, struct inode **pinode,
+-		    struct vfsmount *mnt, int mode, int oflags,
+-		    __u32 *poplock, __u16 *pnetfid, int xid)
++			struct vfsmount *mnt, struct super_block *sb,
++			int mode, int oflags,
++			__u32 *poplock, __u16 *pnetfid, int xid)
+ {
+ 	int rc;
+ 	FILE_UNIX_BASIC_INFO *presp_data;
+ 	__u32 posix_flags = 0;
+-	struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb);
++	struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
+ 	struct cifs_fattr fattr;
+ 
+ 	cFYI(1, ("posix open %s", full_path));
+@@ -241,7 +242,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
+ 
+ 	/* get new inode and set it up */
+ 	if (*pinode == NULL) {
+-		*pinode = cifs_iget(mnt->mnt_sb, &fattr);
++		*pinode = cifs_iget(sb, &fattr);
+ 		if (!*pinode) {
+ 			rc = -ENOMEM;
+ 			goto posix_open_ret;
+@@ -250,7 +251,8 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
+ 		cifs_fattr_to_inode(*pinode, &fattr);
+ 	}
+ 
+-	cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
++	if (mnt)
++		cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
+ 
+ posix_open_ret:
+ 	kfree(presp_data);
+@@ -314,13 +316,14 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
+ 	if (nd && (nd->flags & LOOKUP_OPEN))
+ 		oflags = nd->intent.open.flags;
+ 	else
+-		oflags = FMODE_READ;
++		oflags = FMODE_READ | SMB_O_CREAT;
+ 
+ 	if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
+ 	    (CIFS_UNIX_POSIX_PATH_OPS_CAP &
+ 			le64_to_cpu(tcon->fsUnixInfo.Capability))) {
+-		rc = cifs_posix_open(full_path, &newinode, nd->path.mnt,
+-				     mode, oflags, &oplock, &fileHandle, xid);
++		rc = cifs_posix_open(full_path, &newinode,
++			nd ? nd->path.mnt : NULL,
++			inode->i_sb, mode, oflags, &oplock, &fileHandle, xid);
+ 		/* EIO could indicate that (posix open) operation is not
+ 		   supported, despite what server claimed in capability
+ 		   negotation.  EREMOTE indicates DFS junction, which is not
+@@ -677,6 +680,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
+ 		     (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
+ 		     (nd->intent.open.flags & O_CREAT)) {
+ 			rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,
++					parent_dir_inode->i_sb,
+ 					nd->intent.open.create_mode,
+ 					nd->intent.open.flags, &oplock,
+ 					&fileHandle, xid);
+diff --git a/fs/cifs/file.c b/fs/cifs/file.c
+index 429337e..5d1099a 100644
+--- a/fs/cifs/file.c
++++ b/fs/cifs/file.c
+@@ -295,10 +295,12 @@ int cifs_open(struct inode *inode, struct file *file)
+ 	    (CIFS_UNIX_POSIX_PATH_OPS_CAP &
+ 			le64_to_cpu(tcon->fsUnixInfo.Capability))) {
+ 		int oflags = (int) cifs_posix_convert_flags(file->f_flags);
++		oflags |= SMB_O_CREAT;
+ 		/* can not refresh inode info since size could be stale */
+ 		rc = cifs_posix_open(full_path, &inode, file->f_path.mnt,
+-				     cifs_sb->mnt_file_mode /* ignored */,
+-				     oflags, &oplock, &netfid, xid);
++				inode->i_sb,
++				cifs_sb->mnt_file_mode /* ignored */,
++				oflags, &oplock, &netfid, xid);
+ 		if (rc == 0) {
+ 			cFYI(1, ("posix open succeeded"));
+ 			/* no need for special case handling of setting mode
+@@ -510,8 +512,9 @@ reopen_error_exit:
+ 		int oflags = (int) cifs_posix_convert_flags(file->f_flags);
+ 		/* can not refresh inode info since size could be stale */
+ 		rc = cifs_posix_open(full_path, NULL, file->f_path.mnt,
+-				     cifs_sb->mnt_file_mode /* ignored */,
+-				     oflags, &oplock, &netfid, xid);
++				inode->i_sb,
++				cifs_sb->mnt_file_mode /* ignored */,
++				oflags, &oplock, &netfid, xid);
+ 		if (rc == 0) {
+ 			cFYI(1, ("posix reopen succeeded"));
+ 			goto reopen_success;
+diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c
+index 4cfab1c..d91e9d8 100644
+--- a/fs/exofs/dir.c
++++ b/fs/exofs/dir.c
+@@ -608,7 +608,7 @@ int exofs_make_empty(struct inode *inode, struct inode *parent)
+ 	de->inode_no = cpu_to_le64(parent->i_ino);
+ 	memcpy(de->name, PARENT_DIR, sizeof(PARENT_DIR));
+ 	exofs_set_de_type(de, inode);
+-	kunmap_atomic(page, KM_USER0);
++	kunmap_atomic(kaddr, KM_USER0);
+ 	err = exofs_commit_chunk(page, 0, chunk_size);
+ fail:
+ 	page_cache_release(page);
+diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
+index f5b03a1..d55b15c 100644
+--- a/fs/ext4/move_extent.c
++++ b/fs/ext4/move_extent.c
+@@ -964,6 +964,9 @@ mext_check_arguments(struct inode *orig_inode,
+ 		return -EINVAL;
+ 	}
+ 
++	if (IS_IMMUTABLE(donor_inode) || IS_APPEND(donor_inode))
++		return -EPERM;
++
+ 	/* Ext4 move extent does not support swapfile */
+ 	if (IS_SWAPFILE(orig_inode) || IS_SWAPFILE(donor_inode)) {
+ 		ext4_debug("ext4 move extent: The argument files should "
+diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
+index 3b2c554..433ea27 100644
+--- a/fs/ext4/resize.c
++++ b/fs/ext4/resize.c
+@@ -930,7 +930,8 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
+ 	percpu_counter_add(&sbi->s_freeinodes_counter,
+ 			   EXT4_INODES_PER_GROUP(sb));
+ 
+-	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
++	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG) &&
++	    sbi->s_log_groups_per_flex) {
+ 		ext4_group_t flex_group;
+ 		flex_group = ext4_flex_group(sbi, input->group);
+ 		atomic_add(input->free_blocks_count,
+diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
+index bff5f77..ef2acd2 100644
+--- a/fs/fs-writeback.c
++++ b/fs/fs-writeback.c
+@@ -859,6 +859,12 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
+ 	unsigned long expired;
+ 	long nr_pages;
+ 
++	/*
++	 * When set to zero, disable periodic writeback
++	 */
++	if (!dirty_writeback_interval)
++		return 0;
++
+ 	expired = wb->last_old_flush +
+ 			msecs_to_jiffies(dirty_writeback_interval * 10);
+ 	if (time_before(jiffies, expired))
+@@ -954,8 +960,12 @@ int bdi_writeback_task(struct bdi_writeback *wb)
+ 				break;
+ 		}
+ 
+-		wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
+-		schedule_timeout_interruptible(wait_jiffies);
++		if (dirty_writeback_interval) {
++			wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
++			schedule_timeout_interruptible(wait_jiffies);
++		} else
++			schedule();
++
+ 		try_to_freeze();
+ 	}
+ 
+diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
+index a32bcd7..b3fd1d8 100644
+--- a/fs/gfs2/file.c
++++ b/fs/gfs2/file.c
+@@ -218,6 +218,11 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
+ 	if (error)
+ 		goto out_drop_write;
+ 
++	error = -EACCES;
++	if (!is_owner_or_cap(inode))
++		goto out;
++
++	error = 0;
+ 	flags = ip->i_diskflags;
+ 	new_flags = (flags & ~mask) | (reqflags & mask);
+ 	if ((new_flags ^ flags) == 0)
+@@ -275,8 +280,10 @@ static int gfs2_set_flags(struct file *filp, u32 __user *ptr)
+ {
+ 	struct inode *inode = filp->f_path.dentry->d_inode;
+ 	u32 fsflags, gfsflags;
++
+ 	if (get_user(fsflags, ptr))
+ 		return -EFAULT;
++
+ 	gfsflags = fsflags_cvt(fsflags_to_gfs2, fsflags);
+ 	if (!S_ISDIR(inode->i_mode)) {
+ 		if (gfsflags & GFS2_DIF_INHERIT_JDATA)
+diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
+index 4160afa..bd224ee 100644
+--- a/fs/jbd/journal.c
++++ b/fs/jbd/journal.c
+@@ -1913,7 +1913,7 @@ static void __init jbd_create_debugfs_entry(void)
+ {
+ 	jbd_debugfs_dir = debugfs_create_dir("jbd", NULL);
+ 	if (jbd_debugfs_dir)
+-		jbd_debug = debugfs_create_u8("jbd-debug", S_IRUGO,
++		jbd_debug = debugfs_create_u8("jbd-debug", S_IRUGO | S_IWUSR,
+ 					       jbd_debugfs_dir,
+ 					       &journal_enable_debug);
+ }
+diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
+index b7ca3a9..17af879 100644
+--- a/fs/jbd2/journal.c
++++ b/fs/jbd2/journal.c
+@@ -2115,7 +2115,8 @@ static void __init jbd2_create_debugfs_entry(void)
+ {
+ 	jbd2_debugfs_dir = debugfs_create_dir("jbd2", NULL);
+ 	if (jbd2_debugfs_dir)
+-		jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME, S_IRUGO,
++		jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME,
++					       S_IRUGO | S_IWUSR,
+ 					       jbd2_debugfs_dir,
+ 					       &jbd2_journal_enable_debug);
+ }
+diff --git a/fs/libfs.c b/fs/libfs.c
+index 219576c..ba36e93 100644
+--- a/fs/libfs.c
++++ b/fs/libfs.c
+@@ -415,7 +415,8 @@ int simple_write_end(struct file *file, struct address_space *mapping,
+  * unique inode values later for this filesystem, then you must take care
+  * to pass it an appropriate max_reserved value to avoid collisions.
+  */
+-int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files)
++int simple_fill_super(struct super_block *s, unsigned long magic,
++		      struct tree_descr *files)
+ {
+ 	struct inode *inode;
+ 	struct dentry *root;
+diff --git a/fs/namespace.c b/fs/namespace.c
+index bdc3cb4..2beb0fb 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -1119,8 +1119,15 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
+ {
+ 	struct path path;
+ 	int retval;
++	int lookup_flags = 0;
+ 
+-	retval = user_path(name, &path);
++	if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW))
++		return -EINVAL;
++
++	if (!(flags & UMOUNT_NOFOLLOW))
++		lookup_flags |= LOOKUP_FOLLOW;
++
++	retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
+ 	if (retval)
+ 		goto out;
+ 	retval = -EINVAL;
+diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
+index 67ea83e..4d4e2d0 100644
+--- a/fs/nfsd/nfssvc.c
++++ b/fs/nfsd/nfssvc.c
+@@ -136,7 +136,7 @@ u32 nfsd_supported_minorversion;
+ int nfsd_vers(int vers, enum vers_op change)
+ {
+ 	if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
+-		return -1;
++		return 0;
+ 	switch(change) {
+ 	case NFSD_SET:
+ 		nfsd_versions[vers] = nfsd_version[vers];
+diff --git a/include/linux/fs.h b/include/linux/fs.h
+index 9b67805..b6a5622 100644
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -1310,6 +1310,8 @@ extern int send_sigurg(struct fown_struct *fown);
+ #define MNT_FORCE	0x00000001	/* Attempt to forcibily umount */
+ #define MNT_DETACH	0x00000002	/* Just detach from the tree */
+ #define MNT_EXPIRE	0x00000004	/* Mark for expiry */
++#define UMOUNT_NOFOLLOW	0x00000008	/* Don't follow symlink on umount */
++#define UMOUNT_UNUSED	0x80000000	/* Flag guaranteed to be unused */
+ 
+ extern struct list_head super_blocks;
+ extern spinlock_t sb_lock;
+@@ -2376,7 +2378,7 @@ extern const struct file_operations simple_dir_operations;
+ extern const struct inode_operations simple_dir_inode_operations;
+ struct tree_descr { char *name; const struct file_operations *ops; int mode; };
+ struct dentry *d_alloc_name(struct dentry *, const char *);
+-extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
++extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
+ extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
+ extern void simple_release_fs(struct vfsmount **mount, int *count);
+ 
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
+index 63adefe..67325bf 100644
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -2317,6 +2317,7 @@
+ #define PCI_VENDOR_ID_JMICRON		0x197B
+ #define PCI_DEVICE_ID_JMICRON_JMB360	0x2360
+ #define PCI_DEVICE_ID_JMICRON_JMB361	0x2361
++#define PCI_DEVICE_ID_JMICRON_JMB362	0x2362
+ #define PCI_DEVICE_ID_JMICRON_JMB363	0x2363
+ #define PCI_DEVICE_ID_JMICRON_JMB365	0x2365
+ #define PCI_DEVICE_ID_JMICRON_JMB366	0x2366
+diff --git a/include/linux/swap.h b/include/linux/swap.h
+index 4ec9001..977d150 100644
+--- a/include/linux/swap.h
++++ b/include/linux/swap.h
+@@ -218,21 +218,11 @@ static inline void lru_cache_add_anon(struct page *page)
+ 	__lru_cache_add(page, LRU_INACTIVE_ANON);
+ }
+ 
+-static inline void lru_cache_add_active_anon(struct page *page)
+-{
+-	__lru_cache_add(page, LRU_ACTIVE_ANON);
+-}
+-
+ static inline void lru_cache_add_file(struct page *page)
+ {
+ 	__lru_cache_add(page, LRU_INACTIVE_FILE);
+ }
+ 
+-static inline void lru_cache_add_active_file(struct page *page)
+-{
+-	__lru_cache_add(page, LRU_ACTIVE_FILE);
+-}
+-
+ /* linux/mm/vmscan.c */
+ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
+ 					gfp_t gfp_mask, nodemask_t *mask);
+diff --git a/include/linux/tboot.h b/include/linux/tboot.h
+index bf2a0c7..1dba6ee 100644
+--- a/include/linux/tboot.h
++++ b/include/linux/tboot.h
+@@ -150,6 +150,7 @@ extern int tboot_force_iommu(void);
+ 
+ #else
+ 
++#define tboot_enabled()			0
+ #define tboot_probe()			do { } while (0)
+ #define tboot_shutdown(shutdown_type)	do { } while (0)
+ #define tboot_sleep(sleep_state, pm1a_control, pm1b_control)	\
+diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
+index 0a47456..89e54e9 100644
+--- a/include/net/sctp/structs.h
++++ b/include/net/sctp/structs.h
+@@ -772,6 +772,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
+ 			  struct iovec *data);
+ void sctp_chunk_free(struct sctp_chunk *);
+ void  *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
++void  *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
+ struct sctp_chunk *sctp_chunkify(struct sk_buff *,
+ 				 const struct sctp_association *,
+ 				 struct sock *);
+diff --git a/kernel/compat.c b/kernel/compat.c
+index f6c204f..180d188 100644
+--- a/kernel/compat.c
++++ b/kernel/compat.c
+@@ -494,29 +494,26 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
+ {
+ 	int ret;
+ 	cpumask_var_t mask;
+-	unsigned long *k;
+-	unsigned int min_length = cpumask_size();
+-
+-	if (nr_cpu_ids <= BITS_PER_COMPAT_LONG)
+-		min_length = sizeof(compat_ulong_t);
+ 
+-	if (len < min_length)
++	if ((len * BITS_PER_BYTE) < nr_cpu_ids)
++		return -EINVAL;
++	if (len & (sizeof(compat_ulong_t)-1))
+ 		return -EINVAL;
+ 
+ 	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+ 		return -ENOMEM;
+ 
+ 	ret = sched_getaffinity(pid, mask);
+-	if (ret < 0)
+-		goto out;
++	if (ret == 0) {
++		size_t retlen = min_t(size_t, len, cpumask_size());
+ 
+-	k = cpumask_bits(mask);
+-	ret = compat_put_bitmap(user_mask_ptr, k, min_length * 8);
+-	if (ret == 0)
+-		ret = min_length;
+-
+-out:
++		if (compat_put_bitmap(user_mask_ptr, cpumask_bits(mask), retlen * 8))
++			ret = -EFAULT;
++		else
++			ret = retlen;
++	}
+ 	free_cpumask_var(mask);
++
+ 	return ret;
+ }
+ 
+diff --git a/kernel/mutex.c b/kernel/mutex.c
+index 947b3ad..f85644c 100644
+--- a/kernel/mutex.c
++++ b/kernel/mutex.c
+@@ -172,6 +172,13 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
+ 		struct thread_info *owner;
+ 
+ 		/*
++		 * If we own the BKL, then don't spin. The owner of
++		 * the mutex might be waiting on us to release the BKL.
++		 */
++		if (unlikely(current->lock_depth >= 0))
++			break;
++
++		/*
+ 		 * If there's an owner, wait for it to either
+ 		 * release the lock or go to sleep.
+ 		 */
+diff --git a/kernel/perf_event.c b/kernel/perf_event.c
+index 72df1eb..183d437 100644
+--- a/kernel/perf_event.c
++++ b/kernel/perf_event.c
+@@ -4510,8 +4510,8 @@ SYSCALL_DEFINE5(perf_event_open,
+ 	struct perf_event_context *ctx;
+ 	struct file *event_file = NULL;
+ 	struct file *group_file = NULL;
++	int event_fd;
+ 	int fput_needed = 0;
+-	int fput_needed2 = 0;
+ 	int err;
+ 
+ 	/* for future expandability... */
+@@ -4532,12 +4532,18 @@ SYSCALL_DEFINE5(perf_event_open,
+ 			return -EINVAL;
+ 	}
+ 
++	event_fd = get_unused_fd_flags(O_RDWR);
++	if (event_fd < 0)
++		return event_fd;
++
+ 	/*
+ 	 * Get the target context (task or percpu):
+ 	 */
+ 	ctx = find_get_context(pid, cpu);
+-	if (IS_ERR(ctx))
+-		return PTR_ERR(ctx);
++	if (IS_ERR(ctx)) {
++		err = PTR_ERR(ctx);
++		goto err_fd;
++	}
+ 
+ 	/*
+ 	 * Look up the group leader (we will attach this event to it):
+@@ -4577,13 +4583,11 @@ SYSCALL_DEFINE5(perf_event_open,
+ 	if (IS_ERR(event))
+ 		goto err_put_context;
+ 
+-	err = anon_inode_getfd("[perf_event]", &perf_fops, event, 0);
+-	if (err < 0)
+-		goto err_free_put_context;
+-
+-	event_file = fget_light(err, &fput_needed2);
+-	if (!event_file)
++	event_file = anon_inode_getfile("[perf_event]", &perf_fops, event, O_RDWR);
++	if (IS_ERR(event_file)) {
++		err = PTR_ERR(event_file);
+ 		goto err_free_put_context;
++	}
+ 
+ 	if (flags & PERF_FLAG_FD_OUTPUT) {
+ 		err = perf_event_set_output(event, group_fd);
+@@ -4604,19 +4608,19 @@ SYSCALL_DEFINE5(perf_event_open,
+ 	list_add_tail(&event->owner_entry, &current->perf_event_list);
+ 	mutex_unlock(&current->perf_event_mutex);
+ 
+-err_fput_free_put_context:
+-	fput_light(event_file, fput_needed2);
++	fput_light(group_file, fput_needed);
++	fd_install(event_fd, event_file);
++	return event_fd;
+ 
++err_fput_free_put_context:
++	fput(event_file);
+ err_free_put_context:
+-	if (err < 0)
+-		free_event(event);
+-
++	free_event(event);
+ err_put_context:
+-	if (err < 0)
+-		put_ctx(ctx);
+-
+ 	fput_light(group_file, fput_needed);
+-
++	put_ctx(ctx);
++err_fd:
++	put_unused_fd(event_fd);
+ 	return err;
+ }
+ 
+diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
+index 4954407..5e76d22 100644
+--- a/kernel/posix-timers.c
++++ b/kernel/posix-timers.c
+@@ -559,14 +559,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
+ 	new_timer->it_id = (timer_t) new_timer_id;
+ 	new_timer->it_clock = which_clock;
+ 	new_timer->it_overrun = -1;
+-	error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
+-	if (error)
+-		goto out;
+ 
+-	/*
+-	 * return the timer_id now.  The next step is hard to
+-	 * back out if there is an error.
+-	 */
+ 	if (copy_to_user(created_timer_id,
+ 			 &new_timer_id, sizeof (new_timer_id))) {
+ 		error = -EFAULT;
+@@ -597,6 +590,10 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
+ 	new_timer->sigq->info.si_tid   = new_timer->it_id;
+ 	new_timer->sigq->info.si_code  = SI_TIMER;
+ 
++	error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
++	if (error)
++		goto out;
++
+ 	spin_lock_irq(&current->sighand->siglock);
+ 	new_timer->it_signal = current->signal;
+ 	list_add(&new_timer->list, &current->signal->posix_timers);
+diff --git a/kernel/signal.c b/kernel/signal.c
+index 4d0658d..423655a 100644
+--- a/kernel/signal.c
++++ b/kernel/signal.c
+@@ -591,7 +591,7 @@ static int rm_from_queue(unsigned long mask, struct sigpending *s)
+ static int check_kill_permission(int sig, struct siginfo *info,
+ 				 struct task_struct *t)
+ {
+-	const struct cred *cred = current_cred(), *tcred;
++	const struct cred *cred, *tcred;
+ 	struct pid *sid;
+ 	int error;
+ 
+@@ -605,8 +605,10 @@ static int check_kill_permission(int sig, struct siginfo *info,
+ 	if (error)
+ 		return error;
+ 
++	cred = current_cred();
+ 	tcred = __task_cred(t);
+-	if ((cred->euid ^ tcred->suid) &&
++	if (!same_thread_group(current, t) &&
++	    (cred->euid ^ tcred->suid) &&
+ 	    (cred->euid ^ tcred->uid) &&
+ 	    (cred->uid  ^ tcred->suid) &&
+ 	    (cred->uid  ^ tcred->uid) &&
+diff --git a/mm/filemap.c b/mm/filemap.c
+index 8e96c90..46e3f8a 100644
+--- a/mm/filemap.c
++++ b/mm/filemap.c
+@@ -462,7 +462,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
+ 	/*
+ 	 * Splice_read and readahead add shmem/tmpfs pages into the page cache
+ 	 * before shmem_readpage has a chance to mark them as SwapBacked: they
+-	 * need to go on the active_anon lru below, and mem_cgroup_cache_charge
++	 * need to go on the anon lru below, and mem_cgroup_cache_charge
+ 	 * (called in add_to_page_cache) needs to know where they're going too.
+ 	 */
+ 	if (mapping_cap_swap_backed(mapping))
+@@ -473,7 +473,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
+ 		if (page_is_file_cache(page))
+ 			lru_cache_add_file(page);
+ 		else
+-			lru_cache_add_active_anon(page);
++			lru_cache_add_anon(page);
+ 	}
+ 	return ret;
+ }
+@@ -1120,6 +1120,12 @@ page_not_up_to_date_locked:
+ 		}
+ 
+ readpage:
++		/*
++		 * A previous I/O error may have been due to temporary
++		 * failures, eg. multipath errors.
++		 * PG_error will be set again if readpage fails.
++		 */
++		ClearPageError(page);
+ 		/* Start the actual read. The read will unlock the page. */
+ 		error = mapping->a_ops->readpage(filp, page);
+ 
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c
+index b7b02ce..f5a106e 100644
+--- a/mm/hugetlb.c
++++ b/mm/hugetlb.c
+@@ -401,7 +401,7 @@ static void clear_huge_page(struct page *page,
+ {
+ 	int i;
+ 
+-	if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
++	if (unlikely(sz/PAGE_SIZE > MAX_ORDER_NR_PAGES)) {
+ 		clear_gigantic_page(page, addr, sz);
+ 		return;
+ 	}
+diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
+index 4d5543a..ea367cf 100644
+--- a/net/mac80211/Kconfig
++++ b/net/mac80211/Kconfig
+@@ -15,8 +15,12 @@ comment "CFG80211 needs to be enabled for MAC80211"
+ 
+ if MAC80211 != n
+ 
++config MAC80211_HAS_RC
++	def_bool n
++
+ config MAC80211_RC_PID
+ 	bool "PID controller based rate control algorithm" if EMBEDDED
++	select MAC80211_HAS_RC
+ 	---help---
+ 	  This option enables a TX rate control algorithm for
+ 	  mac80211 that uses a PID controller to select the TX
+@@ -24,12 +28,14 @@ config MAC80211_RC_PID
+ 
+ config MAC80211_RC_MINSTREL
+ 	bool "Minstrel" if EMBEDDED
++	select MAC80211_HAS_RC
+ 	default y
+ 	---help---
+ 	  This option enables the 'minstrel' TX rate control algorithm
+ 
+ choice
+ 	prompt "Default rate control algorithm"
++	depends on MAC80211_HAS_RC
+ 	default MAC80211_RC_DEFAULT_MINSTREL
+ 	---help---
+ 	  This option selects the default rate control algorithm
+@@ -62,6 +68,9 @@ config MAC80211_RC_DEFAULT
+ 
+ endif
+ 
++comment "Some wireless drivers require a rate control algorithm"
++	depends on MAC80211_HAS_RC=n
++
+ config MAC80211_MESH
+ 	bool "Enable mac80211 mesh networking (pre-802.11s) support"
+ 	depends on MAC80211 && EXPERIMENTAL
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index 538a7d7..3ee3cb8 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -1220,7 +1220,8 @@ ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
+ 		     (rx->key || rx->sdata->drop_unencrypted)))
+ 		return -EACCES;
+ 	if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) {
+-		if (unlikely(ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
++		if (unlikely(!ieee80211_has_protected(fc) &&
++			     ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
+ 			     rx->key))
+ 			return -EACCES;
+ 		/* BIP does not use Protected field, so need to check MMIE */
+diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
+index d3efff2..b1d7904 100644
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -496,7 +496,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
+ 	struct ieee80211_hdr *hdr = (void *)tx->skb->data;
+ 	struct ieee80211_supported_band *sband;
+ 	struct ieee80211_rate *rate;
+-	int i, len;
++	int i;
++	u32 len;
+ 	bool inval = false, rts = false, short_preamble = false;
+ 	struct ieee80211_tx_rate_control txrc;
+ 	u32 sta_flags;
+@@ -505,7 +506,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
+ 
+ 	sband = tx->local->hw.wiphy->bands[tx->channel->band];
+ 
+-	len = min_t(int, tx->skb->len + FCS_LEN,
++	len = min_t(u32, tx->skb->len + FCS_LEN,
+ 			 tx->local->hw.wiphy->frag_threshold);
+ 
+ 	/* set up the tx rate control struct we give the RC algo */
+diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
+index 9d881a6..8579b4f 100644
+--- a/net/sctp/sm_make_chunk.c
++++ b/net/sctp/sm_make_chunk.c
+@@ -107,7 +107,7 @@ static const struct sctp_paramhdr prsctp_param = {
+ 	cpu_to_be16(sizeof(struct sctp_paramhdr)),
+ };
+ 
+-/* A helper to initialize to initialize an op error inside a
++/* A helper to initialize an op error inside a
+  * provided chunk, as most cause codes will be embedded inside an
+  * abort chunk.
+  */
+@@ -124,6 +124,29 @@ void  sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
+ 	chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
+ }
+ 
++/* A helper to initialize an op error inside a
++ * provided chunk, as most cause codes will be embedded inside an
++ * abort chunk.  Differs from sctp_init_cause in that it won't oops
++ * if there isn't enough space in the op error chunk
++ */
++int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code,
++		      size_t paylen)
++{
++	sctp_errhdr_t err;
++	__u16 len;
++
++	/* Cause code constants are now defined in network order.  */
++	err.cause = cause_code;
++	len = sizeof(sctp_errhdr_t) + paylen;
++	err.length  = htons(len);
++
++	if (skb_tailroom(chunk->skb) < len)
++		return -ENOSPC;
++	chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk,
++						     sizeof(sctp_errhdr_t),
++						     &err);
++	return 0;
++}
+ /* 3.3.2 Initiation (INIT) (1)
+  *
+  * This chunk is used to initiate a SCTP association between two
+@@ -1125,6 +1148,24 @@ nodata:
+ 	return retval;
+ }
+ 
++/* Create an Operation Error chunk of a fixed size,
++ * specifically, max(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT)
++ * This is a helper function to allocate an error chunk for
++ * for those invalid parameter codes in which we may not want
++ * to report all the errors, if the incomming chunk is large
++ */
++static inline struct sctp_chunk *sctp_make_op_error_fixed(
++	const struct sctp_association *asoc,
++	const struct sctp_chunk *chunk)
++{
++	size_t size = asoc ? asoc->pathmtu : 0;
++
++	if (!size)
++		size = SCTP_DEFAULT_MAXSEGMENT;
++
++	return sctp_make_op_error_space(asoc, chunk, size);
++}
++
+ /* Create an Operation Error chunk.  */
+ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc,
+ 				 const struct sctp_chunk *chunk,
+@@ -1365,6 +1406,18 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
+ 	return target;
+ }
+ 
++/* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient
++ * space in the chunk
++ */
++void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
++			     int len, const void *data)
++{
++	if (skb_tailroom(chunk->skb) >= len)
++		return sctp_addto_chunk(chunk, len, data);
++	else
++		return NULL;
++}
++
+ /* Append bytes from user space to the end of a chunk.  Will panic if
+  * chunk is not big enough.
+  * Returns a kernel err value.
+@@ -1968,13 +2021,12 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
+ 		 * returning multiple unknown parameters.
+ 		 */
+ 		if (NULL == *errp)
+-			*errp = sctp_make_op_error_space(asoc, chunk,
+-					ntohs(chunk->chunk_hdr->length));
++			*errp = sctp_make_op_error_fixed(asoc, chunk);
+ 
+ 		if (*errp) {
+-			sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
++			sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,
+ 					WORD_ROUND(ntohs(param.p->length)));
+-			sctp_addto_chunk(*errp,
++			sctp_addto_chunk_fixed(*errp,
+ 					WORD_ROUND(ntohs(param.p->length)),
+ 					param.v);
+ 		} else {
+diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
+index 327011f..7809137 100644
+--- a/net/tipc/bearer.c
++++ b/net/tipc/bearer.c
+@@ -45,10 +45,10 @@
+ 
+ #define MAX_ADDR_STR 32
+ 
+-static struct media *media_list = NULL;
++static struct media media_list[MAX_MEDIA];
+ static u32 media_count = 0;
+ 
+-struct bearer *tipc_bearers = NULL;
++struct bearer tipc_bearers[MAX_BEARERS];
+ 
+ /**
+  * media_name_valid - validate media name
+@@ -108,9 +108,11 @@ int  tipc_register_media(u32 media_type,
+ 	int res = -EINVAL;
+ 
+ 	write_lock_bh(&tipc_net_lock);
+-	if (!media_list)
+-		goto exit;
+ 
++	if (tipc_mode != TIPC_NET_MODE) {
++		warn("Media <%s> rejected, not in networked mode yet\n", name);
++		goto exit;
++	}
+ 	if (!media_name_valid(name)) {
+ 		warn("Media <%s> rejected, illegal name\n", name);
+ 		goto exit;
+@@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name)
+ 
+ 
+ 
+-int tipc_bearer_init(void)
+-{
+-	int res;
+-
+-	write_lock_bh(&tipc_net_lock);
+-	tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
+-	media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
+-	if (tipc_bearers && media_list) {
+-		res = 0;
+-	} else {
+-		kfree(tipc_bearers);
+-		kfree(media_list);
+-		tipc_bearers = NULL;
+-		media_list = NULL;
+-		res = -ENOMEM;
+-	}
+-	write_unlock_bh(&tipc_net_lock);
+-	return res;
+-}
+-
+ void tipc_bearer_stop(void)
+ {
+ 	u32 i;
+ 
+-	if (!tipc_bearers)
+-		return;
+-
+ 	for (i = 0; i < MAX_BEARERS; i++) {
+ 		if (tipc_bearers[i].active)
+ 			tipc_bearers[i].publ.blocked = 1;
+@@ -695,10 +674,6 @@ void tipc_bearer_stop(void)
+ 		if (tipc_bearers[i].active)
+ 			bearer_disable(tipc_bearers[i].publ.name);
+ 	}
+-	kfree(tipc_bearers);
+-	kfree(media_list);
+-	tipc_bearers = NULL;
+-	media_list = NULL;
+ 	media_count = 0;
+ }
+ 
+diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
+index ca57348..000228e 100644
+--- a/net/tipc/bearer.h
++++ b/net/tipc/bearer.h
+@@ -114,7 +114,7 @@ struct bearer_name {
+ 
+ struct link;
+ 
+-extern struct bearer *tipc_bearers;
++extern struct bearer tipc_bearers[];
+ 
+ void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a);
+ struct sk_buff *tipc_media_get_names(void);
+diff --git a/net/tipc/net.c b/net/tipc/net.c
+index 7906608..f25b1cd 100644
+--- a/net/tipc/net.c
++++ b/net/tipc/net.c
+@@ -116,7 +116,8 @@
+ */
+ 
+ DEFINE_RWLOCK(tipc_net_lock);
+-struct network tipc_net = { NULL };
++struct _zone *tipc_zones[256] = { NULL, };
++struct network tipc_net = { tipc_zones };
+ 
+ struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref)
+ {
+@@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 dest)
+ 	}
+ }
+ 
+-static int net_init(void)
+-{
+-	memset(&tipc_net, 0, sizeof(tipc_net));
+-	tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC);
+-	if (!tipc_net.zones) {
+-		return -ENOMEM;
+-	}
+-	return 0;
+-}
+-
+ static void net_stop(void)
+ {
+ 	u32 z_num;
+ 
+-	if (!tipc_net.zones)
+-		return;
+-
+-	for (z_num = 1; z_num <= tipc_max_zones; z_num++) {
++	for (z_num = 1; z_num <= tipc_max_zones; z_num++)
+ 		tipc_zone_delete(tipc_net.zones[z_num]);
+-	}
+-	kfree(tipc_net.zones);
+-	tipc_net.zones = NULL;
+ }
+ 
+ static void net_route_named_msg(struct sk_buff *buf)
+@@ -282,9 +267,7 @@ int tipc_net_start(u32 addr)
+ 	tipc_named_reinit();
+ 	tipc_port_reinit();
+ 
+-	if ((res = tipc_bearer_init()) ||
+-	    (res = net_init()) ||
+-	    (res = tipc_cltr_init()) ||
++	if ((res = tipc_cltr_init()) ||
+ 	    (res = tipc_bclink_init())) {
+ 		return res;
+ 	}
+diff --git a/net/wireless/core.h b/net/wireless/core.h
+index 68b3219..376798f 100644
+--- a/net/wireless/core.h
++++ b/net/wireless/core.h
+@@ -385,6 +385,8 @@ int rdev_set_freq(struct cfg80211_registered_device *rdev,
+ 		  struct wireless_dev *for_wdev,
+ 		  int freq, enum nl80211_channel_type channel_type);
+ 
++u16 cfg80211_calculate_bitrate(struct rate_info *rate);
++
+ #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
+ #define CFG80211_DEV_WARN_ON(cond)	WARN_ON(cond)
+ #else
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index ca3c92a..b75e718 100644
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -1562,39 +1562,6 @@ static int parse_station_flags(struct genl_info *info,
+ 	return 0;
+ }
+ 
+-static u16 nl80211_calculate_bitrate(struct rate_info *rate)
+-{
+-	int modulation, streams, bitrate;
+-
+-	if (!(rate->flags & RATE_INFO_FLAGS_MCS))
+-		return rate->legacy;
+-
+-	/* the formula below does only work for MCS values smaller than 32 */
+-	if (rate->mcs >= 32)
+-		return 0;
+-
+-	modulation = rate->mcs & 7;
+-	streams = (rate->mcs >> 3) + 1;
+-
+-	bitrate = (rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH) ?
+-			13500000 : 6500000;
+-
+-	if (modulation < 4)
+-		bitrate *= (modulation + 1);
+-	else if (modulation == 4)
+-		bitrate *= (modulation + 2);
+-	else
+-		bitrate *= (modulation + 3);
+-
+-	bitrate *= streams;
+-
+-	if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
+-		bitrate = (bitrate / 9) * 10;
+-
+-	/* do NOT round down here */
+-	return (bitrate + 50000) / 100000;
+-}
+-
+ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
+ 				int flags, struct net_device *dev,
+ 				u8 *mac_addr, struct station_info *sinfo)
+@@ -1641,8 +1608,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
+ 		if (!txrate)
+ 			goto nla_put_failure;
+ 
+-		/* nl80211_calculate_bitrate will return 0 for mcs >= 32 */
+-		bitrate = nl80211_calculate_bitrate(&sinfo->txrate);
++		/* cfg80211_calculate_bitrate will return 0 for mcs >= 32 */
++		bitrate = cfg80211_calculate_bitrate(&sinfo->txrate);
+ 		if (bitrate > 0)
+ 			NLA_PUT_U16(msg, NL80211_RATE_INFO_BITRATE, bitrate);
+ 
+diff --git a/net/wireless/util.c b/net/wireless/util.c
+index 3fc2df8..a6a38b1 100644
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -682,3 +682,36 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
+ 
+ 	return err;
+ }
++
++u16 cfg80211_calculate_bitrate(struct rate_info *rate)
++{
++	int modulation, streams, bitrate;
++
++	if (!(rate->flags & RATE_INFO_FLAGS_MCS))
++		return rate->legacy;
++
++	/* the formula below does only work for MCS values smaller than 32 */
++	if (rate->mcs >= 32)
++		return 0;
++
++	modulation = rate->mcs & 7;
++	streams = (rate->mcs >> 3) + 1;
++
++	bitrate = (rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH) ?
++			13500000 : 6500000;
++
++	if (modulation < 4)
++		bitrate *= (modulation + 1);
++	else if (modulation == 4)
++		bitrate *= (modulation + 2);
++	else
++		bitrate *= (modulation + 3);
++
++	bitrate *= streams;
++
++	if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
++		bitrate = (bitrate / 9) * 10;
++
++	/* do NOT round down here */
++	return (bitrate + 50000) / 100000;
++}
+diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
+index 561a45c..6a60c5a 100644
+--- a/net/wireless/wext-compat.c
++++ b/net/wireless/wext-compat.c
+@@ -1227,10 +1227,7 @@ int cfg80211_wext_giwrate(struct net_device *dev,
+ 	if (!(sinfo.filled & STATION_INFO_TX_BITRATE))
+ 		return -EOPNOTSUPP;
+ 
+-	rate->value = 0;
+-
+-	if (!(sinfo.txrate.flags & RATE_INFO_FLAGS_MCS))
+-		rate->value = 100000 * sinfo.txrate.legacy;
++	rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate);
+ 
+ 	return 0;
+ }
+diff --git a/security/keys/keyring.c b/security/keys/keyring.c
+index 8ec0274..e031952 100644
+--- a/security/keys/keyring.c
++++ b/security/keys/keyring.c
+@@ -524,9 +524,8 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
+ 	struct key *keyring;
+ 	int bucket;
+ 
+-	keyring = ERR_PTR(-EINVAL);
+ 	if (!name)
+-		goto error;
++		return ERR_PTR(-EINVAL);
+ 
+ 	bucket = keyring_hash(name);
+ 
+@@ -553,17 +552,18 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
+ 					   KEY_SEARCH) < 0)
+ 				continue;
+ 
+-			/* we've got a match */
+-			atomic_inc(&keyring->usage);
+-			read_unlock(&keyring_name_lock);
+-			goto error;
++			/* we've got a match but we might end up racing with
++			 * key_cleanup() if the keyring is currently 'dead'
++			 * (ie. it has a zero usage count) */
++			if (!atomic_inc_not_zero(&keyring->usage))
++				continue;
++			goto out;
+ 		}
+ 	}
+ 
+-	read_unlock(&keyring_name_lock);
+ 	keyring = ERR_PTR(-ENOKEY);
+-
+- error:
++out:
++	read_unlock(&keyring_name_lock);
+ 	return keyring;
+ 
+ } /* end find_keyring_by_name() */
+diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
+index 5c23afb..931cfda 100644
+--- a/security/keys/process_keys.c
++++ b/security/keys/process_keys.c
+@@ -509,7 +509,7 @@ try_again:
+ 
+ 			ret = install_thread_keyring();
+ 			if (ret < 0) {
+-				key = ERR_PTR(ret);
++				key_ref = ERR_PTR(ret);
+ 				goto error;
+ 			}
+ 			goto reget_creds;
+@@ -527,7 +527,7 @@ try_again:
+ 
+ 			ret = install_process_keyring();
+ 			if (ret < 0) {
+-				key = ERR_PTR(ret);
++				key_ref = ERR_PTR(ret);
+ 				goto error;
+ 			}
+ 			goto reget_creds;
+@@ -586,7 +586,7 @@ try_again:
+ 
+ 	case KEY_SPEC_GROUP_KEYRING:
+ 		/* group keyrings are not yet supported */
+-		key = ERR_PTR(-EINVAL);
++		key_ref = ERR_PTR(-EINVAL);
+ 		goto error;
+ 
+ 	case KEY_SPEC_REQKEY_AUTH_KEY:
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
+index ebba28e..cc2a5a2 100644
+--- a/sound/pci/hda/hda_intel.c
++++ b/sound/pci/hda/hda_intel.c
+@@ -2226,16 +2226,23 @@ static int azx_dev_free(struct snd_device *device)
+  * white/black-listing for position_fix
+  */
+ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
++	SND_PCI_QUIRK(0x1025, 0x009f, "Acer Aspire 5110", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
+-	SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
+-	SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x1565, 0x8218, "Biostar Microtech", POS_FIX_LPIB),
++	SND_PCI_QUIRK(0x1849, 0x0888, "775Dual-VSTA", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x8086, 0x2503, "DG965OT AAD63733-203", POS_FIX_LPIB),
+ 	SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB),
+ 	{}
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
+index a9bdccc..82a53d9 100644
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -8937,6 +8937,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
+ 	SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
+ 	SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
+ 	SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
++	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
+ 	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
+ 	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
+ 	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
+diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
+index a519a72..fee411b 100644
+--- a/sound/pci/hda/patch_sigmatel.c
++++ b/sound/pci/hda/patch_sigmatel.c
+@@ -2059,12 +2059,12 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
+ 	SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000,
+ 			   "Intel D965", STAC_D965_3ST),
+ 	/* Dell 3 stack systems */
+-	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f7, "Dell XPS M1730", STAC_DELL_3ST),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01ed, "Dell     ", STAC_DELL_3ST),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f4, "Dell     ", STAC_DELL_3ST),
+ 	/* Dell 3 stack systems with verb table in BIOS */
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS),
++	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x01f7, "Dell XPS M1730", STAC_DELL_BIOS),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x0227, "Dell Vostro 1400  ", STAC_DELL_BIOS),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x022e, "Dell     ", STAC_DELL_BIOS),
+ 	SND_PCI_QUIRK(PCI_VENDOR_ID_DELL,  0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS),
+diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
+index 2089fe7..9f9bcd8 100644
+--- a/sound/soc/codecs/wm8350.c
++++ b/sound/soc/codecs/wm8350.c
+@@ -423,8 +423,8 @@ static const struct soc_enum wm8350_enum[] = {
+ 	SOC_ENUM_SINGLE(WM8350_INPUT_MIXER_VOLUME, 15, 2, wm8350_lr),
+ };
+ 
+-static DECLARE_TLV_DB_LINEAR(pre_amp_tlv, -1200, 3525);
+-static DECLARE_TLV_DB_LINEAR(out_pga_tlv, -5700, 600);
++static DECLARE_TLV_DB_SCALE(pre_amp_tlv, -1200, 3525, 0);
++static DECLARE_TLV_DB_SCALE(out_pga_tlv, -5700, 600, 0);
+ static DECLARE_TLV_DB_SCALE(dac_pcm_tlv, -7163, 36, 1);
+ static DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -12700, 50, 1);
+ static DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 1);
+diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
+index b9ef4d9..775195b 100644
+--- a/sound/soc/codecs/wm8400.c
++++ b/sound/soc/codecs/wm8400.c
+@@ -106,21 +106,21 @@ static void wm8400_codec_reset(struct snd_soc_codec *codec)
+ 	wm8400_reset_codec_reg_cache(wm8400->wm8400);
+ }
+ 
+-static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
++static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 600, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
++static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, -2100, 0);
++static const DECLARE_TLV_DB_SCALE(out_mix_tlv, -2100, 0, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
++static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
++static const DECLARE_TLV_DB_SCALE(out_omix_tlv, -600, 0, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
++static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
++static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
++static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
+ 
+ static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
+         struct snd_ctl_elem_value *ucontrol)
+@@ -439,7 +439,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
+ /* INMIX dB values */
+ static const unsigned int in_mix_tlv[] = {
+ 	TLV_DB_RANGE_HEAD(1),
+-	0,7, TLV_DB_LINEAR_ITEM(-1200, 600),
++	0,7, TLV_DB_SCALE_ITEM(-1200, 600, 0),
+ };
+ 
+ /* Left In PGA Connections */
+diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
+index 2d702db..253159c 100644
+--- a/sound/soc/codecs/wm8990.c
++++ b/sound/soc/codecs/wm8990.c
+@@ -110,21 +110,21 @@ static const u16 wm8990_reg[] = {
+ 
+ #define wm8990_reset(c) snd_soc_write(c, WM8990_RESET, 0)
+ 
+-static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
++static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 600, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
++static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, 0, -2100);
++static const DECLARE_TLV_DB_SCALE(out_mix_tlv, 0, -2100, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
++static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
++static const DECLARE_TLV_DB_SCALE(out_omix_tlv, -600, 0, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
++static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
++static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
+ 
+-static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
++static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
+ 
+ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
+ 	struct snd_ctl_elem_value *ucontrol)
+@@ -450,7 +450,7 @@ static int outmixer_event(struct snd_soc_dapm_widget *w,
+ /* INMIX dB values */
+ static const unsigned int in_mix_tlv[] = {
+ 	TLV_DB_RANGE_HEAD(1),
+-	0, 7, TLV_DB_LINEAR_ITEM(-1200, 600),
++	0, 7, TLV_DB_SCALE_ITEM(-1200, 600, 0),
+ };
+ 
+ /* Left In PGA Connections */

Added: dists/sid/linux-2.6/debian/patches/debian/revert-ath9k-add-support-for-802.11n-bonded-out-AR2427.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/debian/revert-ath9k-add-support-for-802.11n-bonded-out-AR2427.patch	Fri Jul  2 03:18:08 2010	(r15923)
@@ -0,0 +1,71 @@
+reverted:
+--- b/drivers/net/wireless/ath/ath9k/hw.c
++++ a/drivers/net/wireless/ath/ath9k/hw.c
+@@ -398,6 +398,7 @@
+ 	ah->config.pcie_clock_req = 0;
+ 	ah->config.pcie_waen = 0;
+ 	ah->config.analog_shiftreg = 1;
++	ah->config.ht_enable = 1;
+ 	ah->config.ofdm_trig_low = 200;
+ 	ah->config.ofdm_trig_high = 500;
+ 	ah->config.cck_trig_high = 200;
+@@ -411,11 +412,6 @@
+ 		ah->config.spurchans[i][1] = AR_NO_SPUR;
+ 	}
+ 
+-	if (ah->hw_version.devid != AR2427_DEVID_PCIE)
+-		ah->config.ht_enable = 1;
+-	else
+-		ah->config.ht_enable = 0;
+-
+ 	ah->config.intr_mitigation = true;
+ 
+ 	/*
+@@ -622,6 +618,5 @@
+ 	case AR5416_DEVID_AR9287_PCI:
+ 	case AR5416_DEVID_AR9287_PCIE:
+-	case AR2427_DEVID_PCIE:
+ 		return true;
+ 	default:
+ 		break;
+reverted:
+--- b/drivers/net/wireless/ath/ath9k/hw.h
++++ a/drivers/net/wireless/ath/ath9k/hw.h
+@@ -37,7 +37,6 @@
+ #define AR9280_DEVID_PCI	0x0029
+ #define AR9280_DEVID_PCIE	0x002a
+ #define AR9285_DEVID_PCIE	0x002b
+-#define AR2427_DEVID_PCIE	0x002c
+ #define AR5416_AR9100_DEVID	0x000b
+ #define	AR_SUBVENDOR_ID_NOG	0x0e11
+ #define AR_SUBVENDOR_ID_NEW_A	0x7065
+reverted:
+--- b/drivers/net/wireless/ath/ath9k/main.c
++++ a/drivers/net/wireless/ath/ath9k/main.c
+@@ -1541,14 +1541,12 @@
+ 	hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
+ 		IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
+ 		IEEE80211_HW_SIGNAL_DBM |
++		IEEE80211_HW_AMPDU_AGGREGATION |
+ 		IEEE80211_HW_SUPPORTS_PS |
+ 		IEEE80211_HW_PS_NULLFUNC_STACK |
+ 		IEEE80211_HW_REPORTS_TX_ACK_STATUS |
+ 		IEEE80211_HW_SPECTRUM_MGMT;
+ 
+-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
+-		 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+-
+ 	if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt)
+ 		hw->flags |= IEEE80211_HW_MFP_CAPABLE;
+ 
+reverted:
+--- b/drivers/net/wireless/ath/ath9k/pci.c
++++ a/drivers/net/wireless/ath/ath9k/pci.c
+@@ -25,7 +25,6 @@
+ 	{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI   */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
+-	{ PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI   */
+ 	{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
+ 	{ 0 }

Added: dists/sid/linux-2.6/debian/patches/features/all/USB-option-Use-generic-USB-wwan-code-2.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/USB-option-Use-generic-USB-wwan-code-2.patch	Fri Jul  2 03:18:08 2010	(r15923)
@@ -0,0 +1,742 @@
+From: Matthew Garrett <mjg at redhat.com>
+Date: Thu, 1 Apr 2010 12:31:08 -0400
+Subject: [PATCH] USB: option: Use generic USB wwan code
+
+commit 8b4c6a3ab596961b784659c71dc24b341f938a1a upstream.
+
+As this code was simply factored out of option, this is a simple
+conversion.
+
+Signed-off-by: Matthew Garrett <mjg at redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+[mhy: Backport to 2.6.32]
+---
+--- a/drivers/usb/serial/Kconfig
++++ b/drivers/usb/serial/Kconfig
+@@ -581,6 +581,7 @@ config USB_SERIAL_WWAN
+ 
+ config USB_SERIAL_OPTION
+ 	tristate "USB driver for GSM and CDMA modems"
++	select USB_SERIAL_WWAN
+ 	help
+ 	  Say Y here if you have a GSM or CDMA modem that's connected to USB.
+ 
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -41,35 +41,14 @@
+ #include <linux/bitops.h>
+ #include <linux/usb.h>
+ #include <linux/usb/serial.h>
++#include "usb-wwan.h"
+ 
+ /* Function prototypes */
+ static int  option_probe(struct usb_serial *serial,
+ 			const struct usb_device_id *id);
+-static int  option_open(struct tty_struct *tty, struct usb_serial_port *port);
+-static void option_close(struct usb_serial_port *port);
+-static void option_dtr_rts(struct usb_serial_port *port, int on);
+-
+-static int  option_startup(struct usb_serial *serial);
+-static void option_disconnect(struct usb_serial *serial);
+-static void option_release(struct usb_serial *serial);
+-static int  option_write_room(struct tty_struct *tty);
+-
++static int option_send_setup(struct usb_serial_port *port);
+ static void option_instat_callback(struct urb *urb);
+ 
+-static int option_write(struct tty_struct *tty, struct usb_serial_port *port,
+-			const unsigned char *buf, int count);
+-static int  option_chars_in_buffer(struct tty_struct *tty);
+-static void option_set_termios(struct tty_struct *tty,
+-			struct usb_serial_port *port, struct ktermios *old);
+-static int  option_tiocmget(struct tty_struct *tty, struct file *file);
+-static int  option_tiocmset(struct tty_struct *tty, struct file *file,
+-				unsigned int set, unsigned int clear);
+-static int  option_send_setup(struct usb_serial_port *port);
+-#ifdef CONFIG_PM
+-static int  option_suspend(struct usb_serial *serial, pm_message_t message);
+-static int  option_resume(struct usb_serial *serial);
+-#endif
+-
+ /* Vendor and product IDs */
+ #define OPTION_VENDOR_ID			0x0AF0
+ #define OPTION_PRODUCT_COLT			0x5000
+@@ -680,22 +659,22 @@
+ 	.id_table          = option_ids,
+ 	.num_ports         = 1,
+ 	.probe             = option_probe,
+-	.open              = option_open,
+-	.close             = option_close,
+-	.dtr_rts	   = option_dtr_rts,
+-	.write             = option_write,
+-	.write_room        = option_write_room,
+-	.chars_in_buffer   = option_chars_in_buffer,
+-	.set_termios       = option_set_termios,
+-	.tiocmget          = option_tiocmget,
+-	.tiocmset          = option_tiocmset,
+-	.attach            = option_startup,
+-	.disconnect        = option_disconnect,
+-	.release           = option_release,
++	.open              = usb_wwan_open,
++	.close             = usb_wwan_close,
++	.dtr_rts	   = usb_wwan_dtr_rts,
++	.write             = usb_wwan_write,
++	.write_room        = usb_wwan_write_room,
++	.chars_in_buffer   = usb_wwan_chars_in_buffer,
++	.set_termios       = usb_wwan_set_termios,
++	.tiocmget          = usb_wwan_tiocmget,
++	.tiocmset          = usb_wwan_tiocmset,
++	.attach            = usb_wwan_startup,
++	.disconnect        = usb_wwan_disconnect,
++	.release           = usb_wwan_release,
+ 	.read_int_callback = option_instat_callback,
+ #ifdef CONFIG_PM
+-	.suspend           = option_suspend,
+-	.resume            = option_resume,
++	.suspend           = usb_wwan_suspend,
++	.resume            = usb_wwan_resume,
+ #endif
+ };
+ 
+@@ -708,12 +687,6 @@
+ #define IN_BUFLEN 4096
+ #define OUT_BUFLEN 4096
+ 
+-struct option_intf_private {
+-	spinlock_t susp_lock;
+-	unsigned int suspended:1;
+-	int in_flight;
+-};
+-
+ struct option_port_private {
+ 	/* Input endpoints and buffer for this port */
+ 	struct urb *in_urbs[N_IN_URB];
+@@ -770,216 +743,28 @@
+ static int option_probe(struct usb_serial *serial,
+ 			const struct usb_device_id *id)
+ {
+-	struct option_intf_private *data;
++	struct usb_wwan_intf_private *data;
+ 
+ 	/* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
+ 	if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
+ 		serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
+ 		serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8)
+ 		return -ENODEV;
+ 
+ 	/* Bandrich modem and AT command interface is 0xff */
+ 	if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID ||
+ 		serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) &&
+ 		serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
+ 		return -ENODEV;
+ 
+-	data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL);
++	data = serial->private = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL);
+ 	if (!data)
+ 		return -ENOMEM;
++	data->send_setup = option_send_setup;
+ 	spin_lock_init(&data->susp_lock);
+ 	return 0;
+ }
+ 
+-static void option_set_termios(struct tty_struct *tty,
+-		struct usb_serial_port *port, struct ktermios *old_termios)
+-{
+-	dbg("%s", __func__);
+-	/* Doesn't support option setting */
+-	tty_termios_copy_hw(tty->termios, old_termios);
+-	option_send_setup(port);
+-}
+-
+-static int option_tiocmget(struct tty_struct *tty, struct file *file)
+-{
+-	struct usb_serial_port *port = tty->driver_data;
+-	unsigned int value;
+-	struct option_port_private *portdata;
+-
+-	portdata = usb_get_serial_port_data(port);
+-
+-	value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
+-		((portdata->dtr_state) ? TIOCM_DTR : 0) |
+-		((portdata->cts_state) ? TIOCM_CTS : 0) |
+-		((portdata->dsr_state) ? TIOCM_DSR : 0) |
+-		((portdata->dcd_state) ? TIOCM_CAR : 0) |
+-		((portdata->ri_state) ? TIOCM_RNG : 0);
+-
+-	return value;
+-}
+-
+-static int option_tiocmset(struct tty_struct *tty, struct file *file,
+-			unsigned int set, unsigned int clear)
+-{
+-	struct usb_serial_port *port = tty->driver_data;
+-	struct option_port_private *portdata;
+-
+-	portdata = usb_get_serial_port_data(port);
+-
+-	/* FIXME: what locks portdata fields ? */
+-	if (set & TIOCM_RTS)
+-		portdata->rts_state = 1;
+-	if (set & TIOCM_DTR)
+-		portdata->dtr_state = 1;
+-
+-	if (clear & TIOCM_RTS)
+-		portdata->rts_state = 0;
+-	if (clear & TIOCM_DTR)
+-		portdata->dtr_state = 0;
+-	return option_send_setup(port);
+-}
+-
+-/* Write */
+-static int option_write(struct tty_struct *tty, struct usb_serial_port *port,
+-			const unsigned char *buf, int count)
+-{
+-	struct option_port_private *portdata;
+-	struct option_intf_private *intfdata;
+-	int i;
+-	int left, todo;
+-	struct urb *this_urb = NULL; /* spurious */
+-	int err;
+-	unsigned long flags;
+-
+-	portdata = usb_get_serial_port_data(port);
+-	intfdata = port->serial->private;
+-
+-	dbg("%s: write (%d chars)", __func__, count);
+-
+-	i = 0;
+-	left = count;
+-	for (i = 0; left > 0 && i < N_OUT_URB; i++) {
+-		todo = left;
+-		if (todo > OUT_BUFLEN)
+-			todo = OUT_BUFLEN;
+-
+-		this_urb = portdata->out_urbs[i];
+-		if (test_and_set_bit(i, &portdata->out_busy)) {
+-			if (time_before(jiffies,
+-					portdata->tx_start_time[i] + 10 * HZ))
+-				continue;
+-			usb_unlink_urb(this_urb);
+-			continue;
+-		}
+-		dbg("%s: endpoint %d buf %d", __func__,
+-			usb_pipeendpoint(this_urb->pipe), i);
+-
+-		err = usb_autopm_get_interface_async(port->serial->interface);
+-		if (err < 0)
+-			break;
+-
+-		/* send the data */
+-		memcpy(this_urb->transfer_buffer, buf, todo);
+-		this_urb->transfer_buffer_length = todo;
+-
+-		spin_lock_irqsave(&intfdata->susp_lock, flags);
+-		if (intfdata->suspended) {
+-			usb_anchor_urb(this_urb, &portdata->delayed);
+-			spin_unlock_irqrestore(&intfdata->susp_lock, flags);
+-		} else {
+-			intfdata->in_flight++;
+-			spin_unlock_irqrestore(&intfdata->susp_lock, flags);
+-			err = usb_submit_urb(this_urb, GFP_ATOMIC);
+-			if (err) {
+-				dbg("usb_submit_urb %p (write bulk) failed "
+-					"(%d)", this_urb, err);
+-				clear_bit(i, &portdata->out_busy);
+-				spin_lock_irqsave(&intfdata->susp_lock, flags);
+-				intfdata->in_flight--;
+-				spin_unlock_irqrestore(&intfdata->susp_lock, flags);
+-				continue;
+-			}
+-		}
+-
+-		portdata->tx_start_time[i] = jiffies;
+-		buf += todo;
+-		left -= todo;
+-	}
+-
+-	count -= left;
+-	dbg("%s: wrote (did %d)", __func__, count);
+-	return count;
+-}
+-
+-static void option_indat_callback(struct urb *urb)
+-{
+-	int err;
+-	int endpoint;
+-	struct usb_serial_port *port;
+-	struct tty_struct *tty;
+-	unsigned char *data = urb->transfer_buffer;
+-	int status = urb->status;
+-
+-	dbg("%s: %p", __func__, urb);
+-
+-	endpoint = usb_pipeendpoint(urb->pipe);
+-	port =  urb->context;
+-
+-	if (status) {
+-		dbg("%s: nonzero status: %d on endpoint %02x.",
+-		    __func__, status, endpoint);
+-	} else {
+-		tty = tty_port_tty_get(&port->port);
+-		if (urb->actual_length) {
+-			tty_buffer_request_room(tty, urb->actual_length);
+-			tty_insert_flip_string(tty, data, urb->actual_length);
+-			tty_flip_buffer_push(tty);
+-		} else 
+-			dbg("%s: empty read urb received", __func__);
+-		tty_kref_put(tty);
+-
+-		/* Resubmit urb so we continue receiving */
+-		if (port->port.count && status != -ESHUTDOWN) {
+-			err = usb_submit_urb(urb, GFP_ATOMIC);
+-			if (err)
+-				printk(KERN_ERR "%s: resubmit read urb failed. "
+-					"(%d)", __func__, err);
+-			else
+-				usb_mark_last_busy(port->serial->dev);
+-		}
+-
+-	}
+-	return;
+-}
+-
+-static void option_outdat_callback(struct urb *urb)
+-{
+-	struct usb_serial_port *port;
+-	struct option_port_private *portdata;
+-	struct option_intf_private *intfdata;
+-	int i;
+-
+-	dbg("%s", __func__);
+-
+-	port =  urb->context;
+-	intfdata = port->serial->private;
+-
+-	usb_serial_port_softint(port);
+-	usb_autopm_put_interface_async(port->serial->interface);
+-	portdata = usb_get_serial_port_data(port);
+-	spin_lock(&intfdata->susp_lock);
+-	intfdata->in_flight--;
+-	spin_unlock(&intfdata->susp_lock);
+-
+-	for (i = 0; i < N_OUT_URB; ++i) {
+-		if (portdata->out_urbs[i] == urb) {
+-			smp_mb__before_clear_bit();
+-			clear_bit(i, &portdata->out_busy);
+-			break;
+-		}
+-	}
+-}
+-
+ static void option_instat_callback(struct urb *urb)
+ {
+ 	int err;
+@@ -1029,183 +814,6 @@
+ 	}
+ }
+ 
+-static int option_write_room(struct tty_struct *tty)
+-{
+-	struct usb_serial_port *port = tty->driver_data;
+-	struct option_port_private *portdata;
+-	int i;
+-	int data_len = 0;
+-	struct urb *this_urb;
+-
+-	portdata = usb_get_serial_port_data(port);
+-
+-	for (i = 0; i < N_OUT_URB; i++) {
+-		this_urb = portdata->out_urbs[i];
+-		if (this_urb && !test_bit(i, &portdata->out_busy))
+-			data_len += OUT_BUFLEN;
+-	}
+-
+-	dbg("%s: %d", __func__, data_len);
+-	return data_len;
+-}
+-
+-static int option_chars_in_buffer(struct tty_struct *tty)
+-{
+-	struct usb_serial_port *port = tty->driver_data;
+-	struct option_port_private *portdata;
+-	int i;
+-	int data_len = 0;
+-	struct urb *this_urb;
+-
+-	portdata = usb_get_serial_port_data(port);
+-
+-	for (i = 0; i < N_OUT_URB; i++) {
+-		this_urb = portdata->out_urbs[i];
+-		/* FIXME: This locking is insufficient as this_urb may
+-		   go unused during the test */
+-		if (this_urb && test_bit(i, &portdata->out_busy))
+-			data_len += this_urb->transfer_buffer_length;
+-	}
+-	dbg("%s: %d", __func__, data_len);
+-	return data_len;
+-}
+-
+-static int option_open(struct tty_struct *tty, struct usb_serial_port *port)
+-{
+-	struct option_port_private *portdata;
+-	struct option_intf_private *intfdata;
+-	struct usb_serial *serial = port->serial;
+-	int i, err;
+-	struct urb *urb;
+-
+-	portdata = usb_get_serial_port_data(port);
+-	intfdata = serial->private;
+-
+-	dbg("%s", __func__);
+-
+-	/* Start reading from the IN endpoint */
+-	for (i = 0; i < N_IN_URB; i++) {
+-		urb = portdata->in_urbs[i];
+-		if (!urb)
+-			continue;
+-		err = usb_submit_urb(urb, GFP_KERNEL);
+-		if (err) {
+-			dbg("%s: submit urb %d failed (%d) %d",
+-				__func__, i, err,
+-				urb->transfer_buffer_length);
+-		}
+-	}
+-
+-	option_send_setup(port);
+-
+-	serial->interface->needs_remote_wakeup = 1;
+-	spin_lock_irq(&intfdata->susp_lock);
+-	portdata->opened = 1;
+-	spin_unlock_irq(&intfdata->susp_lock);
+-	usb_autopm_put_interface(serial->interface);
+-
+-	return 0;
+-}
+-
+-static void option_dtr_rts(struct usb_serial_port *port, int on)
+-{
+-	struct usb_serial *serial = port->serial;
+-	struct option_port_private *portdata;
+-
+-	dbg("%s", __func__);
+-	portdata = usb_get_serial_port_data(port);
+-	mutex_lock(&serial->disc_mutex);
+-	portdata->rts_state = on;
+-	portdata->dtr_state = on;
+-	if (serial->dev)
+-		option_send_setup(port);
+-	mutex_unlock(&serial->disc_mutex);
+-}
+-
+-
+-static void option_close(struct usb_serial_port *port)
+-{
+-	int i;
+-	struct usb_serial *serial = port->serial;
+-	struct option_port_private *portdata;
+-	struct option_intf_private *intfdata = port->serial->private;
+-
+-	dbg("%s", __func__);
+-	portdata = usb_get_serial_port_data(port);
+-
+-	if (serial->dev) {
+-		/* Stop reading/writing urbs */
+-		spin_lock_irq(&intfdata->susp_lock);
+-		portdata->opened = 0;
+-		spin_unlock_irq(&intfdata->susp_lock);
+-
+-		for (i = 0; i < N_IN_URB; i++)
+-			usb_kill_urb(portdata->in_urbs[i]);
+-		for (i = 0; i < N_OUT_URB; i++)
+-			usb_kill_urb(portdata->out_urbs[i]);
+-		usb_autopm_get_interface(serial->interface);
+-		serial->interface->needs_remote_wakeup = 0;
+-	}
+-}
+-
+-/* Helper functions used by option_setup_urbs */
+-static struct urb *option_setup_urb(struct usb_serial *serial, int endpoint,
+-		int dir, void *ctx, char *buf, int len,
+-		void (*callback)(struct urb *))
+-{
+-	struct urb *urb;
+-
+-	if (endpoint == -1)
+-		return NULL;		/* endpoint not needed */
+-
+-	urb = usb_alloc_urb(0, GFP_KERNEL);		/* No ISO */
+-	if (urb == NULL) {
+-		dbg("%s: alloc for endpoint %d failed.", __func__, endpoint);
+-		return NULL;
+-	}
+-
+-		/* Fill URB using supplied data. */
+-	usb_fill_bulk_urb(urb, serial->dev,
+-		      usb_sndbulkpipe(serial->dev, endpoint) | dir,
+-		      buf, len, callback, ctx);
+-
+-	return urb;
+-}
+-
+-/* Setup urbs */
+-static void option_setup_urbs(struct usb_serial *serial)
+-{
+-	int i, j;
+-	struct usb_serial_port *port;
+-	struct option_port_private *portdata;
+-
+-	dbg("%s", __func__);
+-
+-	for (i = 0; i < serial->num_ports; i++) {
+-		port = serial->port[i];
+-		portdata = usb_get_serial_port_data(port);
+-
+-		/* Do indat endpoints first */
+-		for (j = 0; j < N_IN_URB; ++j) {
+-			portdata->in_urbs[j] = option_setup_urb(serial,
+-					port->bulk_in_endpointAddress,
+-					USB_DIR_IN, port,
+-					portdata->in_buffer[j],
+-					IN_BUFLEN, option_indat_callback);
+-		}
+-
+-		/* outdat endpoints */
+-		for (j = 0; j < N_OUT_URB; ++j) {
+-			portdata->out_urbs[j] = option_setup_urb(serial,
+-					port->bulk_out_endpointAddress,
+-					USB_DIR_OUT, port,
+-					portdata->out_buffer[j],
+-					OUT_BUFLEN, option_outdat_callback);
+-		}
+-	}
+-}
+-
+-
+ /** send RTS/DTR state to the port.
+  *
+  * This is exactly the same as SET_CONTROL_LINE_STATE from the PSTN
+@@ -1231,224 +839,6 @@
+ 		0x22, 0x21, val, ifNum, NULL, 0, USB_CTRL_SET_TIMEOUT);
+ }
+ 
+-static int option_startup(struct usb_serial *serial)
+-{
+-	int i, j, err;
+-	struct usb_serial_port *port;
+-	struct option_port_private *portdata;
+-	u8 *buffer;
+-
+-	dbg("%s", __func__);
+-
+-	/* Now setup per port private data */
+-	for (i = 0; i < serial->num_ports; i++) {
+-		port = serial->port[i];
+-		portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
+-		if (!portdata) {
+-			dbg("%s: kmalloc for option_port_private (%d) failed!.",
+-					__func__, i);
+-			return 1;
+-		}
+-		init_usb_anchor(&portdata->delayed);
+-
+-		for (j = 0; j < N_IN_URB; j++) {
+-			buffer = (u8 *)__get_free_page(GFP_KERNEL);
+-			if (!buffer)
+-				goto bail_out_error;
+-			portdata->in_buffer[j] = buffer;
+-		}
+-
+-		for (j = 0; j < N_OUT_URB; j++) {
+-			buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
+-			if (!buffer)
+-				goto bail_out_error2;
+-			portdata->out_buffer[j] = buffer;
+-		}
+-
+-		usb_set_serial_port_data(port, portdata);
+-
+-		if (!port->interrupt_in_urb)
+-			continue;
+-		err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+-		if (err)
+-			dbg("%s: submit irq_in urb failed %d",
+-				__func__, err);
+-	}
+-	option_setup_urbs(serial);
+-	return 0;
+-
+-bail_out_error2:
+-	for (j = 0; j < N_OUT_URB; j++)
+-		kfree(portdata->out_buffer[j]);
+-bail_out_error:
+-	for (j = 0; j < N_IN_URB; j++)
+-		if (portdata->in_buffer[j])
+-			free_page((unsigned long)portdata->in_buffer[j]);
+-	kfree(portdata);
+-	return 1;
+-}
+-
+-static void stop_read_write_urbs(struct usb_serial *serial)
+-{
+-	int i, j;
+-	struct usb_serial_port *port;
+-	struct option_port_private *portdata;
+-
+-	/* Stop reading/writing urbs */
+-	for (i = 0; i < serial->num_ports; ++i) {
+-		port = serial->port[i];
+-		portdata = usb_get_serial_port_data(port);
+-		for (j = 0; j < N_IN_URB; j++)
+-			usb_kill_urb(portdata->in_urbs[j]);
+-		for (j = 0; j < N_OUT_URB; j++)
+-			usb_kill_urb(portdata->out_urbs[j]);
+-	}
+-}
+-
+-static void option_disconnect(struct usb_serial *serial)
+-{
+-	dbg("%s", __func__);
+-
+-	stop_read_write_urbs(serial);
+-}
+-
+-static void option_release(struct usb_serial *serial)
+-{
+-	int i, j;
+-	struct usb_serial_port *port;
+-	struct option_port_private *portdata;
+-
+-	dbg("%s", __func__);
+-
+-	/* Now free them */
+-	for (i = 0; i < serial->num_ports; ++i) {
+-		port = serial->port[i];
+-		portdata = usb_get_serial_port_data(port);
+-
+-		for (j = 0; j < N_IN_URB; j++) {
+-			if (portdata->in_urbs[j]) {
+-				usb_free_urb(portdata->in_urbs[j]);
+-				free_page((unsigned long)
+-					portdata->in_buffer[j]);
+-				portdata->in_urbs[j] = NULL;
+-			}
+-		}
+-		for (j = 0; j < N_OUT_URB; j++) {
+-			if (portdata->out_urbs[j]) {
+-				usb_free_urb(portdata->out_urbs[j]);
+-				kfree(portdata->out_buffer[j]);
+-				portdata->out_urbs[j] = NULL;
+-			}
+-		}
+-	}
+-
+-	/* Now free per port private data */
+-	for (i = 0; i < serial->num_ports; i++) {
+-		port = serial->port[i];
+-		kfree(usb_get_serial_port_data(port));
+-	}
+-}
+-
+-#ifdef CONFIG_PM
+-static int option_suspend(struct usb_serial *serial, pm_message_t message)
+-{
+-	struct option_intf_private *intfdata = serial->private;
+-	int b;
+-
+-	dbg("%s entered", __func__);
+-
+-	if (serial->dev->auto_pm) {
+-		spin_lock_irq(&intfdata->susp_lock);
+-		b = intfdata->in_flight;
+-		spin_unlock_irq(&intfdata->susp_lock);
+-
+-		if (b)
+-			return -EBUSY;
+-	}
+-
+-	spin_lock_irq(&intfdata->susp_lock);
+-	intfdata->suspended = 1;
+-	spin_unlock_irq(&intfdata->susp_lock);
+-	stop_read_write_urbs(serial);
+-
+-	return 0;
+-}
+-
+-static void play_delayed(struct usb_serial_port *port)
+-{
+-	struct option_intf_private *data;
+-	struct option_port_private *portdata;
+-	struct urb *urb;
+-	int err;
+-
+-	portdata = usb_get_serial_port_data(port);
+-	data = port->serial->private;
+-	while ((urb = usb_get_from_anchor(&portdata->delayed))) {
+-		err = usb_submit_urb(urb, GFP_ATOMIC);
+-		if (!err)
+-			data->in_flight++;
+-	}
+-}
+-
+-static int option_resume(struct usb_serial *serial)
+-{
+-	int i, j;
+-	struct usb_serial_port *port;
+-	struct option_intf_private *intfdata = serial->private;
+-	struct option_port_private *portdata;
+-	struct urb *urb;
+-	int err = 0;
+-
+-	dbg("%s entered", __func__);
+-	/* get the interrupt URBs resubmitted unconditionally */
+-	for (i = 0; i < serial->num_ports; i++) {
+-		port = serial->port[i];
+-		if (!port->interrupt_in_urb) {
+-			dbg("%s: No interrupt URB for port %d\n", __func__, i);
+-			continue;
+-		}
+-		err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
+-		dbg("Submitted interrupt URB for port %d (result %d)", i, err);
+-		if (err < 0) {
+-			err("%s: Error %d for interrupt URB of port%d",
+-				 __func__, err, i);
+-			goto err_out;
+-		}
+-	}
+-
+-	for (i = 0; i < serial->num_ports; i++) {
+-		/* walk all ports */
+-		port = serial->port[i];
+-		portdata = usb_get_serial_port_data(port);
+-
+-		/* skip closed ports */
+-		spin_lock_irq(&intfdata->susp_lock);
+-		if (!portdata->opened) {
+-			spin_unlock_irq(&intfdata->susp_lock);
+-			continue;
+-		}
+-
+-		for (j = 0; j < N_IN_URB; j++) {
+-			urb = portdata->in_urbs[j];
+-			err = usb_submit_urb(urb, GFP_ATOMIC);
+-			if (err < 0) {
+-				err("%s: Error %d for bulk URB %d",
+-					 __func__, err, i);
+-				spin_unlock_irq(&intfdata->susp_lock);
+-				goto err_out;
+-			}
+-		}
+-		play_delayed(port);
+-		spin_unlock_irq(&intfdata->susp_lock);
+-	}
+-	spin_lock_irq(&intfdata->susp_lock);
+-	intfdata->suspended = 0;
+-	spin_unlock_irq(&intfdata->susp_lock);
+-err_out:
+-	return err;
+-}
+-#endif
+-
+ MODULE_AUTHOR(DRIVER_AUTHOR);
+ MODULE_DESCRIPTION(DRIVER_DESC);
+ MODULE_VERSION(DRIVER_VERSION);

Modified: dists/sid/linux-2.6/debian/patches/series/16
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/16	Fri Jul  2 01:12:56 2010	(r15922)
+++ dists/sid/linux-2.6/debian/patches/series/16	Fri Jul  2 03:18:08 2010	(r15923)
@@ -163,3 +163,22 @@
 + bugfix/all/asix-fix-setting-mac-address-for-AX88772.patch
 + bugfix/all/ipv6-Clamp-reported-valid_lft-to-a-minimum-of-0.patch
 + bugfix/all/ipv6-Use-interface-max_desync_factor.patch
+- bugfix/all/sctp-fix-append-error-cause-to-ERROR-chunk-correctly.patch
+- bugfix/parisc/clear-fp-exception-flag-on-SIGFPE.patch
+- features/all/rtl8192su-Add-Sitecom-WL-349.patch
+- bugfix/all/KEYS-find_keyring_by_name-can-gain-access-to-a-freed.patch
+- bugfix/all/tipc-fix-oops-on-send-prior-to-entering-networked-mode.patch
+- bugfix/all/cifs-allow-null-nd-on-create.patch
+- bugfix/all/sctp-fix-skb_over_panic-resulting-from-multiple-invalid-parameter-errors.patch
+- bugfix/all/virtio_net-Make-delayed-refill-more-reliable.patch
+- bugfix/x86/PCI-Disable-MSI-for-MCP55-on-P5N32-E-SLI.patch
+- bugfix/all/qla2xxx-disable-broken-msi.patch
++ debian/revert-ath9k-add-support-for-802.11n-bonded-out-AR2427.patch
+- features/all/wireless-report-reasonable-bitrate-for-MCS-rates-th.patch
+- bugfix/all/Documentation-3c509-document-ethtool-support.patch
+- bugfix/all/dmfe-tulip-Let-dmfe-handle-DM910x-except-SPARC-onboard.patch
+- bugfix/all/via-velocity-give-rx-descriptors-later.patch
+- features/all/atl1e-allow-offload-disable.patch
+- features/all/USB-option-Use-generic-USB-wwan-code.patch
++ bugfix/all/stable/2.6.32.16-rc1.patch
++ features/all/USB-option-Use-generic-USB-wwan-code-2.patch



More information about the Kernel-svn-changes mailing list