diff -druN linux-libre-3.4.10-gnu/arch/alpha/include/asm/fpu.h linux-libre-3.4.11-gnu/arch/alpha/include/asm/fpu.h
--- linux-libre-3.4.10-gnu/arch/alpha/include/asm/fpu.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/alpha/include/asm/fpu.h	2012-09-14 18:18:55.000000000 -0400
@@ -1,7 +1,9 @@
 #ifndef __ASM_ALPHA_FPU_H
 #define __ASM_ALPHA_FPU_H
 
+#ifdef __KERNEL__
 #include <asm/special_insns.h>
+#endif
 
 /*
  * Alpha floating-point control register defines:
diff -druN linux-libre-3.4.10-gnu/arch/alpha/include/asm/socket.h linux-libre-3.4.11-gnu/arch/alpha/include/asm/socket.h
--- linux-libre-3.4.10-gnu/arch/alpha/include/asm/socket.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/alpha/include/asm/socket.h	2012-09-14 18:18:55.000000000 -0400
@@ -76,9 +76,11 @@
 /* Instruct lower device to use last 4-bytes of skb data as FCS */
 #define SO_NOFCS		43
 
+#ifdef __KERNEL__
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * have to define SOCK_NONBLOCK to a different value here.
  */
 #define SOCK_NONBLOCK	0x40000000
+#endif /* __KERNEL__ */
 
 #endif /* _ASM_SOCKET_H */
diff -druN linux-libre-3.4.10-gnu/arch/arm/include/asm/pgtable.h linux-libre-3.4.11-gnu/arch/arm/include/asm/pgtable.h
--- linux-libre-3.4.10-gnu/arch/arm/include/asm/pgtable.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/include/asm/pgtable.h	2012-09-14 18:18:55.000000000 -0400
@@ -195,6 +195,18 @@
 
 #define pte_clear(mm,addr,ptep)	set_pte_ext(ptep, __pte(0), 0)
 
+#define pte_none(pte)		(!pte_val(pte))
+#define pte_present(pte)	(pte_val(pte) & L_PTE_PRESENT)
+#define pte_write(pte)		(!(pte_val(pte) & L_PTE_RDONLY))
+#define pte_dirty(pte)		(pte_val(pte) & L_PTE_DIRTY)
+#define pte_young(pte)		(pte_val(pte) & L_PTE_YOUNG)
+#define pte_exec(pte)		(!(pte_val(pte) & L_PTE_XN))
+#define pte_special(pte)	(0)
+
+#define pte_present_user(pte) \
+	((pte_val(pte) & (L_PTE_PRESENT | L_PTE_USER)) == \
+	 (L_PTE_PRESENT | L_PTE_USER))
+
 #if __LINUX_ARM_ARCH__ < 6
 static inline void __sync_icache_dcache(pte_t pteval)
 {
@@ -206,25 +218,15 @@
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
 			      pte_t *ptep, pte_t pteval)
 {
-	if (addr >= TASK_SIZE)
-		set_pte_ext(ptep, pteval, 0);
-	else {
+	unsigned long ext = 0;
+
+	if (addr < TASK_SIZE && pte_present_user(pteval)) {
 		__sync_icache_dcache(pteval);
-		set_pte_ext(ptep, pteval, PTE_EXT_NG);
+		ext |= PTE_EXT_NG;
 	}
-}
-
-#define pte_none(pte)		(!pte_val(pte))
-#define pte_present(pte)	(pte_val(pte) & L_PTE_PRESENT)
-#define pte_write(pte)		(!(pte_val(pte) & L_PTE_RDONLY))
-#define pte_dirty(pte)		(pte_val(pte) & L_PTE_DIRTY)
-#define pte_young(pte)		(pte_val(pte) & L_PTE_YOUNG)
-#define pte_exec(pte)		(!(pte_val(pte) & L_PTE_XN))
-#define pte_special(pte)	(0)
 
-#define pte_present_user(pte) \
-	((pte_val(pte) & (L_PTE_PRESENT | L_PTE_USER)) == \
-	 (L_PTE_PRESENT | L_PTE_USER))
+	set_pte_ext(ptep, pteval, ext);
+}
 
 #define PTE_BIT_FUNC(fn,op) \
 static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
@@ -251,13 +253,13 @@
  *
  *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- *   <--------------- offset --------------------> <- type --> 0 0 0
+ *   <--------------- offset ----------------------> < type -> 0 0 0
  *
- * This gives us up to 63 swap files and 32GB per swap file.  Note that
+ * This gives us up to 31 swap files and 64GB per swap file.  Note that
  * the offset field is always non-zero.
  */
 #define __SWP_TYPE_SHIFT	3
-#define __SWP_TYPE_BITS		6
+#define __SWP_TYPE_BITS		5
 #define __SWP_TYPE_MASK		((1 << __SWP_TYPE_BITS) - 1)
 #define __SWP_OFFSET_SHIFT	(__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
 
diff -druN linux-libre-3.4.10-gnu/arch/arm/Kconfig linux-libre-3.4.11-gnu/arch/arm/Kconfig
--- linux-libre-3.4.10-gnu/arch/arm/Kconfig	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/Kconfig	2012-09-14 18:18:55.000000000 -0400
@@ -2113,6 +2113,7 @@
 config CPU_FREQ_IMX
 	tristate "CPUfreq driver for i.MX CPUs"
 	depends on ARCH_MXC && CPU_FREQ
+	select CPU_FREQ_TABLE
 	help
 	  This enables the CPUfreq driver for i.MX CPUs.
 
diff -druN linux-libre-3.4.10-gnu/arch/arm/mach-imx/hotplug.c linux-libre-3.4.11-gnu/arch/arm/mach-imx/hotplug.c
--- linux-libre-3.4.10-gnu/arch/arm/mach-imx/hotplug.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/mach-imx/hotplug.c	2012-09-14 18:18:55.000000000 -0400
@@ -42,22 +42,6 @@
 	  : "cc");
 }
 
-static inline void cpu_leave_lowpower(void)
-{
-	unsigned int v;
-
-	asm volatile(
-		"mrc	p15, 0, %0, c1, c0, 0\n"
-	"	orr	%0, %0, %1\n"
-	"	mcr	p15, 0, %0, c1, c0, 0\n"
-	"	mrc	p15, 0, %0, c1, c0, 1\n"
-	"	orr	%0, %0, %2\n"
-	"	mcr	p15, 0, %0, c1, c0, 1\n"
-	  : "=&r" (v)
-	  : "Ir" (CR_C), "Ir" (0x40)
-	  : "cc");
-}
-
 /*
  * platform-specific code to shutdown a CPU
  *
@@ -67,11 +51,10 @@
 {
 	cpu_enter_lowpower();
 	imx_enable_cpu(cpu, false);
-	cpu_do_idle();
-	cpu_leave_lowpower();
 
-	/* We should never return from idle */
-	panic("cpu %d unexpectedly exit from shutdown\n", cpu);
+	/* spin here until hardware takes it down */
+	while (1)
+		;
 }
 
 int platform_cpu_disable(unsigned int cpu)
diff -druN linux-libre-3.4.10-gnu/arch/arm/mach-s3c24xx/include/mach/dma.h linux-libre-3.4.11-gnu/arch/arm/mach-s3c24xx/include/mach/dma.h
--- linux-libre-3.4.10-gnu/arch/arm/mach-s3c24xx/include/mach/dma.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/mach-s3c24xx/include/mach/dma.h	2012-09-14 18:18:55.000000000 -0400
@@ -24,7 +24,8 @@
 */
 
 enum dma_ch {
-	DMACH_XD0,
+	DMACH_DT_PROP = -1,	/* not yet supported, do not use */
+	DMACH_XD0 = 0,
 	DMACH_XD1,
 	DMACH_SDI,
 	DMACH_SPI0,
diff -druN linux-libre-3.4.10-gnu/arch/arm/mm/flush.c linux-libre-3.4.11-gnu/arch/arm/mm/flush.c
--- linux-libre-3.4.10-gnu/arch/arm/mm/flush.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/mm/flush.c	2012-09-14 18:18:55.000000000 -0400
@@ -231,8 +231,6 @@
 	struct page *page;
 	struct address_space *mapping;
 
-	if (!pte_present_user(pteval))
-		return;
 	if (cache_is_vipt_nonaliasing() && !pte_exec(pteval))
 		/* only flush non-aliasing VIPT caches for exec mappings */
 		return;
diff -druN linux-libre-3.4.10-gnu/arch/arm/mm/tlb-v7.S linux-libre-3.4.11-gnu/arch/arm/mm/tlb-v7.S
--- linux-libre-3.4.10-gnu/arch/arm/mm/tlb-v7.S	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/mm/tlb-v7.S	2012-09-14 18:18:55.000000000 -0400
@@ -38,10 +38,10 @@
 	dsb
 	mov	r0, r0, lsr #PAGE_SHIFT		@ align address
 	mov	r1, r1, lsr #PAGE_SHIFT
-#ifdef CONFIG_ARM_ERRATA_720789
-	mov	r3, #0
-#else
 	asid	r3, r3				@ mask ASID
+#ifdef CONFIG_ARM_ERRATA_720789
+	ALT_SMP(W(mov)	r3, #0	)
+	ALT_UP(W(nop)		)
 #endif
 	orr	r0, r3, r0, lsl #PAGE_SHIFT	@ Create initial MVA
 	mov	r1, r1, lsl #PAGE_SHIFT
diff -druN linux-libre-3.4.10-gnu/arch/arm/plat-omap/dmtimer.c linux-libre-3.4.11-gnu/arch/arm/plat-omap/dmtimer.c
--- linux-libre-3.4.10-gnu/arch/arm/plat-omap/dmtimer.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/plat-omap/dmtimer.c	2012-09-14 18:18:55.000000000 -0400
@@ -238,7 +238,7 @@
 
 void omap_dm_timer_disable(struct omap_dm_timer *timer)
 {
-	pm_runtime_put(&timer->pdev->dev);
+	pm_runtime_put_sync(&timer->pdev->dev);
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
 
diff -druN linux-libre-3.4.10-gnu/arch/arm/plat-s3c24xx/dma.c linux-libre-3.4.11-gnu/arch/arm/plat-s3c24xx/dma.c
--- linux-libre-3.4.10-gnu/arch/arm/plat-s3c24xx/dma.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/plat-s3c24xx/dma.c	2012-09-14 18:18:55.000000000 -0400
@@ -430,7 +430,7 @@
  * when necessary.
 */
 
-int s3c2410_dma_enqueue(unsigned int channel, void *id,
+int s3c2410_dma_enqueue(enum dma_ch channel, void *id,
 			dma_addr_t data, int size)
 {
 	struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
diff -druN linux-libre-3.4.10-gnu/arch/arm/vfp/vfpmodule.c linux-libre-3.4.11-gnu/arch/arm/vfp/vfpmodule.c
--- linux-libre-3.4.10-gnu/arch/arm/vfp/vfpmodule.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/arm/vfp/vfpmodule.c	2012-09-14 18:18:55.000000000 -0400
@@ -719,8 +719,10 @@
 			if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
 				elf_hwcap |= HWCAP_NEON;
 #endif
+#ifdef CONFIG_VFPv3
 			if ((fmrx(MVFR1) & 0xf0000000) == 0x10000000)
 				elf_hwcap |= HWCAP_VFPv4;
+#endif
 		}
 	}
 	return 0;
diff -druN linux-libre-3.4.10-gnu/arch/parisc/include/asm/atomic.h linux-libre-3.4.11-gnu/arch/parisc/include/asm/atomic.h
--- linux-libre-3.4.10-gnu/arch/parisc/include/asm/atomic.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/parisc/include/asm/atomic.h	2012-09-14 18:18:55.000000000 -0400
@@ -141,7 +141,7 @@
 
 #define atomic_sub_and_test(i,v)	(atomic_sub_return((i),(v)) == 0)
 
-#define ATOMIC_INIT(i)	((atomic_t) { (i) })
+#define ATOMIC_INIT(i)	{ (i) }
 
 #define smp_mb__before_atomic_dec()	smp_mb()
 #define smp_mb__after_atomic_dec()	smp_mb()
@@ -150,7 +150,7 @@
 
 #ifdef CONFIG_64BIT
 
-#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
+#define ATOMIC64_INIT(i) { (i) }
 
 static __inline__ s64
 __atomic64_add_return(s64 i, atomic64_t *v)
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/asm-offsets.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/asm-offsets.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/asm-offsets.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/asm-offsets.c	2012-09-14 18:18:55.000000000 -0400
@@ -76,6 +76,7 @@
 	DEFINE(SIGSEGV, SIGSEGV);
 	DEFINE(NMI_MASK, NMI_MASK);
 	DEFINE(THREAD_DSCR, offsetof(struct thread_struct, dscr));
+	DEFINE(THREAD_DSCR_INHERIT, offsetof(struct thread_struct, dscr_inherit));
 #else
 	DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
 #endif /* CONFIG_PPC64 */
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/dbell.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/dbell.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/dbell.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/dbell.c	2012-09-14 18:18:55.000000000 -0400
@@ -28,6 +28,8 @@
 
 void doorbell_cause_ipi(int cpu, unsigned long data)
 {
+	/* Order previous accesses vs. msgsnd, which is treated as a store */
+	mb();
 	ppc_msgsnd(PPC_DBELL, 0, data);
 }
 
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/entry_64.S linux-libre-3.4.11-gnu/arch/powerpc/kernel/entry_64.S
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/entry_64.S	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/entry_64.S	2012-09-14 18:18:55.000000000 -0400
@@ -373,6 +373,12 @@
 	li	r3,0
 	b	syscall_exit
 
+	.section	".toc","aw"
+DSCR_DEFAULT:
+	.tc dscr_default[TC],dscr_default
+
+	.section	".text"
+
 /*
  * This routine switches between two different tasks.  The process
  * state of one is saved on its kernel stack.  Then the state
@@ -512,9 +518,6 @@
 	mr	r1,r8		/* start using new stack pointer */
 	std	r7,PACAKSAVE(r13)
 
-	ld	r6,_CCR(r1)
-	mtcrf	0xFF,r6
-
 #ifdef CONFIG_ALTIVEC
 BEGIN_FTR_SECTION
 	ld	r0,THREAD_VRSAVE(r4)
@@ -523,14 +526,22 @@
 #endif /* CONFIG_ALTIVEC */
 #ifdef CONFIG_PPC64
 BEGIN_FTR_SECTION
+	lwz	r6,THREAD_DSCR_INHERIT(r4)
+	ld	r7,DSCR_DEFAULT@toc(2)
 	ld	r0,THREAD_DSCR(r4)
-	cmpd	r0,r25
-	beq	1f
+	cmpwi	r6,0
+	bne	1f
+	ld	r0,0(r7)
+1:	cmpd	r0,r25
+	beq	2f
 	mtspr	SPRN_DSCR,r0
-1:	
+2:
 END_FTR_SECTION_IFSET(CPU_FTR_DSCR)
 #endif
 
+	ld	r6,_CCR(r1)
+	mtcrf	0xFF,r6
+
 	/* r3-r13 are destroyed -- Cort */
 	REST_8GPRS(14, r1)
 	REST_10GPRS(22, r1)
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/process.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/process.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/process.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/process.c	2012-09-14 18:18:55.000000000 -0400
@@ -799,16 +799,8 @@
 #endif /* CONFIG_PPC_STD_MMU_64 */
 #ifdef CONFIG_PPC64 
 	if (cpu_has_feature(CPU_FTR_DSCR)) {
-		if (current->thread.dscr_inherit) {
-			p->thread.dscr_inherit = 1;
-			p->thread.dscr = current->thread.dscr;
-		} else if (0 != dscr_default) {
-			p->thread.dscr_inherit = 1;
-			p->thread.dscr = dscr_default;
-		} else {
-			p->thread.dscr_inherit = 0;
-			p->thread.dscr = 0;
-		}
+		p->thread.dscr_inherit = current->thread.dscr_inherit;
+		p->thread.dscr = current->thread.dscr;
 	}
 #endif
 
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/smp.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/smp.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/smp.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/smp.c	2012-09-14 18:18:55.000000000 -0400
@@ -215,8 +215,15 @@
 	struct cpu_messages *info = &per_cpu(ipi_message, cpu);
 	char *message = (char *)&info->messages;
 
+	/*
+	 * Order previous accesses before accesses in the IPI handler.
+	 */
+	smp_mb();
 	message[msg] = 1;
-	mb();
+	/*
+	 * cause_ipi functions are required to include a full barrier
+	 * before doing whatever causes the IPI.
+	 */
 	smp_ops->cause_ipi(cpu, info->data);
 }
 
@@ -228,7 +235,7 @@
 	mb();	/* order any irq clear */
 
 	do {
-		all = xchg_local(&info->messages, 0);
+		all = xchg(&info->messages, 0);
 
 #ifdef __BIG_ENDIAN
 		if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION)))
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/sysfs.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/sysfs.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/sysfs.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/sysfs.c	2012-09-14 18:18:55.000000000 -0400
@@ -194,6 +194,14 @@
 	return sprintf(buf, "%lx\n", dscr_default);
 }
 
+static void update_dscr(void *dummy)
+{
+	if (!current->thread.dscr_inherit) {
+		current->thread.dscr = dscr_default;
+		mtspr(SPRN_DSCR, dscr_default);
+	}
+}
+
 static ssize_t __used store_dscr_default(struct device *dev,
 		struct device_attribute *attr, const char *buf,
 		size_t count)
@@ -206,6 +214,8 @@
 		return -EINVAL;
 	dscr_default = val;
 
+	on_each_cpu(update_dscr, NULL, 1);
+
 	return count;
 }
 
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/kernel/traps.c linux-libre-3.4.11-gnu/arch/powerpc/kernel/traps.c
--- linux-libre-3.4.10-gnu/arch/powerpc/kernel/traps.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/kernel/traps.c	2012-09-14 18:18:55.000000000 -0400
@@ -972,8 +972,9 @@
 			cpu_has_feature(CPU_FTR_DSCR)) {
 		PPC_WARN_EMULATED(mtdscr, regs);
 		rd = (instword >> 21) & 0x1f;
-		mtspr(SPRN_DSCR, regs->gpr[rd]);
+		current->thread.dscr = regs->gpr[rd];
 		current->thread.dscr_inherit = 1;
+		mtspr(SPRN_DSCR, current->thread.dscr);
 		return 0;
 	}
 #endif
diff -druN linux-libre-3.4.10-gnu/arch/powerpc/sysdev/xics/icp-hv.c linux-libre-3.4.11-gnu/arch/powerpc/sysdev/xics/icp-hv.c
--- linux-libre-3.4.10-gnu/arch/powerpc/sysdev/xics/icp-hv.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/powerpc/sysdev/xics/icp-hv.c	2012-09-14 18:18:55.000000000 -0400
@@ -65,7 +65,11 @@
 static inline void icp_hv_set_qirr(int n_cpu , u8 value)
 {
 	int hw_cpu = get_hard_smp_processor_id(n_cpu);
-	long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
+	long rc;
+
+	/* Make sure all previous accesses are ordered before IPI sending */
+	mb();
+	rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
 	if (rc != H_SUCCESS) {
 		pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
 			"returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);
diff -druN linux-libre-3.4.10-gnu/arch/x86/kernel/microcode_amd.c linux-libre-3.4.11-gnu/arch/x86/kernel/microcode_amd.c
--- linux-libre-3.4.10-gnu/arch/x86/kernel/microcode_amd.c	2012-08-27 14:47:04.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/x86/kernel/microcode_amd.c	2012-09-14 21:16:55.000000000 -0400
@@ -143,11 +143,12 @@
 				  unsigned int *current_size)
 {
 	struct microcode_header_amd *mc_hdr;
-	unsigned int actual_size;
+	unsigned int actual_size, patch_size;
 	u16 equiv_cpu_id;
 
 	/* size of the current patch we're staring at */
-	*current_size = *(u32 *)(ucode_ptr + 4) + SECTION_HDR_SIZE;
+	patch_size = *(u32 *)(ucode_ptr + 4);
+	*current_size = patch_size + SECTION_HDR_SIZE;
 
 	equiv_cpu_id = find_equiv_id();
 	if (!equiv_cpu_id)
@@ -174,7 +175,7 @@
 	/*
 	 * now that the header looks sane, verify its size
 	 */
-	actual_size = verify_ucode_size(cpu, *current_size, leftover_size);
+	actual_size = verify_ucode_size(cpu, patch_size, leftover_size);
 	if (!actual_size)
 		return 0;
 
diff -druN linux-libre-3.4.10-gnu/arch/x86/mm/hugetlbpage.c linux-libre-3.4.11-gnu/arch/x86/mm/hugetlbpage.c
--- linux-libre-3.4.10-gnu/arch/x86/mm/hugetlbpage.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/x86/mm/hugetlbpage.c	2012-09-14 18:18:55.000000000 -0400
@@ -56,9 +56,16 @@
 }
 
 /*
- * search for a shareable pmd page for hugetlb.
+ * Search for a shareable pmd page for hugetlb. In any case calls pmd_alloc()
+ * and returns the corresponding pte. While this is not necessary for the
+ * !shared pmd case because we can allocate the pmd later as well, it makes the
+ * code much cleaner. pmd allocation is essential for the shared case because
+ * pud has to be populated inside the same i_mmap_mutex section - otherwise
+ * racing tasks could either miss the sharing (see huge_pte_offset) or select a
+ * bad pmd for sharing.
  */
-static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
+static pte_t *
+huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
 {
 	struct vm_area_struct *vma = find_vma(mm, addr);
 	struct address_space *mapping = vma->vm_file->f_mapping;
@@ -68,9 +75,10 @@
 	struct vm_area_struct *svma;
 	unsigned long saddr;
 	pte_t *spte = NULL;
+	pte_t *pte;
 
 	if (!vma_shareable(vma, addr))
-		return;
+		return (pte_t *)pmd_alloc(mm, pud, addr);
 
 	mutex_lock(&mapping->i_mmap_mutex);
 	vma_prio_tree_foreach(svma, &iter, &mapping->i_mmap, idx, idx) {
@@ -97,7 +105,9 @@
 		put_page(virt_to_page(spte));
 	spin_unlock(&mm->page_table_lock);
 out:
+	pte = (pte_t *)pmd_alloc(mm, pud, addr);
 	mutex_unlock(&mapping->i_mmap_mutex);
+	return pte;
 }
 
 /*
@@ -142,8 +152,9 @@
 		} else {
 			BUG_ON(sz != PMD_SIZE);
 			if (pud_none(*pud))
-				huge_pmd_share(mm, addr, pud);
-			pte = (pte_t *) pmd_alloc(mm, pud, addr);
+				pte = huge_pmd_share(mm, addr, pud);
+			else
+				pte = (pte_t *)pmd_alloc(mm, pud, addr);
 		}
 	}
 	BUG_ON(pte && !pte_none(*pte) && !pte_huge(*pte));
diff -druN linux-libre-3.4.10-gnu/arch/x86/syscalls/syscall_64.tbl linux-libre-3.4.11-gnu/arch/x86/syscalls/syscall_64.tbl
--- linux-libre-3.4.10-gnu/arch/x86/syscalls/syscall_64.tbl	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/x86/syscalls/syscall_64.tbl	2012-09-14 18:18:55.000000000 -0400
@@ -60,8 +60,8 @@
 51	common	getsockname		sys_getsockname
 52	common	getpeername		sys_getpeername
 53	common	socketpair		sys_socketpair
-54	common	setsockopt		sys_setsockopt
-55	common	getsockopt		sys_getsockopt
+54	64	setsockopt		sys_setsockopt
+55	64	getsockopt		sys_getsockopt
 56	common	clone			stub_clone
 57	common	fork			stub_fork
 58	common	vfork			stub_vfork
@@ -351,3 +351,5 @@
 538	x32	sendmmsg		compat_sys_sendmmsg
 539	x32	process_vm_readv	compat_sys_process_vm_readv
 540	x32	process_vm_writev	compat_sys_process_vm_writev
+541	x32	setsockopt		compat_sys_setsockopt
+542	x32	getsockopt		compat_sys_getsockopt
diff -druN linux-libre-3.4.10-gnu/arch/x86/xen/setup.c linux-libre-3.4.11-gnu/arch/x86/xen/setup.c
--- linux-libre-3.4.10-gnu/arch/x86/xen/setup.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/arch/x86/xen/setup.c	2012-09-14 18:18:55.000000000 -0400
@@ -79,9 +79,16 @@
 	memblock_reserve(start, size);
 
 	xen_max_p2m_pfn = PFN_DOWN(start + size);
+	for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) {
+		unsigned long mfn = pfn_to_mfn(pfn);
+
+		if (WARN(mfn == pfn, "Trying to over-write 1-1 mapping (pfn: %lx)\n", pfn))
+			continue;
+		WARN(mfn != INVALID_P2M_ENTRY, "Trying to remove %lx which has %lx mfn!\n",
+			pfn, mfn);
 
-	for (pfn = PFN_DOWN(start); pfn <= xen_max_p2m_pfn; pfn++)
 		__set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
+	}
 }
 
 static unsigned long __init xen_release_chunk(unsigned long start,
diff -druN linux-libre-3.4.10-gnu/Documentation/i2c/busses/i2c-i801 linux-libre-3.4.11-gnu/Documentation/i2c/busses/i2c-i801
--- linux-libre-3.4.10-gnu/Documentation/i2c/busses/i2c-i801	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/Documentation/i2c/busses/i2c-i801	2012-09-14 18:18:55.000000000 -0400
@@ -21,6 +21,7 @@
   * Intel DH89xxCC (PCH)
   * Intel Panther Point (PCH)
   * Intel Lynx Point (PCH)
+  * Intel Lynx Point-LP (PCH)
    Datasheets: Publicly available at the Intel website
 
 On Intel Patsburg and later chipsets, both the normal host SMBus controller
diff -druN linux-libre-3.4.10-gnu/drivers/acpi/acpica/tbxface.c linux-libre-3.4.11-gnu/drivers/acpi/acpica/tbxface.c
--- linux-libre-3.4.10-gnu/drivers/acpi/acpica/tbxface.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/acpi/acpica/tbxface.c	2012-09-14 18:18:55.000000000 -0400
@@ -436,6 +436,7 @@
 
 	return (AE_NOT_FOUND);
 }
+ACPI_EXPORT_SYMBOL(acpi_get_table_with_size)
 
 acpi_status
 acpi_get_table(char *signature,
diff -druN linux-libre-3.4.10-gnu/drivers/block/cciss_scsi.c linux-libre-3.4.11-gnu/drivers/block/cciss_scsi.c
--- linux-libre-3.4.10-gnu/drivers/block/cciss_scsi.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/block/cciss_scsi.c	2012-09-14 18:18:55.000000000 -0400
@@ -763,16 +763,7 @@
 		{
 			case CMD_TARGET_STATUS:
 				/* Pass it up to the upper layers... */
-				if( ei->ScsiStatus)
-                		{
-#if 0
-                    			printk(KERN_WARNING "cciss: cmd %p "
-						"has SCSI Status = %x\n",
-						c, ei->ScsiStatus);
-#endif
-					cmd->result |= (ei->ScsiStatus << 1);
-                		}
-				else {  /* scsi status is zero??? How??? */
+				if (!ei->ScsiStatus) {
 					
 	/* Ordinarily, this case should never happen, but there is a bug
 	   in some released firmware revisions that allows it to happen
diff -druN linux-libre-3.4.10-gnu/drivers/dma/imx-dma.c linux-libre-3.4.11-gnu/drivers/dma/imx-dma.c
--- linux-libre-3.4.10-gnu/drivers/dma/imx-dma.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/dma/imx-dma.c	2012-09-14 18:18:55.000000000 -0400
@@ -172,8 +172,7 @@
 	struct device_dma_parameters	dma_parms;
 	struct dma_device		dma_device;
 	void __iomem			*base;
-	struct clk			*dma_ahb;
-	struct clk			*dma_ipg;
+	struct clk			*dma_clk;
 	spinlock_t			lock;
 	struct imx_dma_2d_config	slots_2d[IMX_DMA_2D_SLOTS];
 	struct imxdma_channel		channel[IMX_DMA_CHANNELS];
@@ -977,20 +976,10 @@
 		return 0;
 	}
 
-	imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
-	if (IS_ERR(imxdma->dma_ipg)) {
-		ret = PTR_ERR(imxdma->dma_ipg);
-		goto err_clk;
-	}
-
-	imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb");
-	if (IS_ERR(imxdma->dma_ahb)) {
-		ret = PTR_ERR(imxdma->dma_ahb);
-		goto err_clk;
-	}
-
-	clk_prepare_enable(imxdma->dma_ipg);
-	clk_prepare_enable(imxdma->dma_ahb);
+	imxdma->dma_clk = clk_get(NULL, "dma");
+	if (IS_ERR(imxdma->dma_clk))
+		return PTR_ERR(imxdma->dma_clk);
+	clk_enable(imxdma->dma_clk);
 
 	/* reset DMA module */
 	imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
@@ -999,14 +988,16 @@
 		ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", imxdma);
 		if (ret) {
 			dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
-			goto err_enable;
+			kfree(imxdma);
+			return ret;
 		}
 
 		ret = request_irq(MX1_DMA_ERR, imxdma_err_handler, 0, "DMA", imxdma);
 		if (ret) {
 			dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
 			free_irq(MX1_DMA_INT, NULL);
-			goto err_enable;
+			kfree(imxdma);
+			return ret;
 		}
 	}
 
@@ -1103,10 +1094,7 @@
 		free_irq(MX1_DMA_INT, NULL);
 		free_irq(MX1_DMA_ERR, NULL);
 	}
-err_enable:
-	clk_disable_unprepare(imxdma->dma_ipg);
-	clk_disable_unprepare(imxdma->dma_ahb);
-err_clk:
+
 	kfree(imxdma);
 	return ret;
 }
@@ -1126,9 +1114,7 @@
 		free_irq(MX1_DMA_ERR, NULL);
 	}
 
-	clk_disable_unprepare(imxdma->dma_ipg);
-	clk_disable_unprepare(imxdma->dma_ahb);
-	kfree(imxdma);
+        kfree(imxdma);
 
         return 0;
 }
diff -druN linux-libre-3.4.10-gnu/drivers/gpu/drm/radeon/radeon_object.c linux-libre-3.4.11-gnu/drivers/gpu/drm/radeon/radeon_object.c
--- linux-libre-3.4.10-gnu/drivers/gpu/drm/radeon/radeon_object.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/gpu/drm/radeon/radeon_object.c	2012-09-14 18:18:55.000000000 -0400
@@ -136,6 +136,7 @@
 	acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size,
 				       sizeof(struct radeon_bo));
 
+retry:
 	bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL);
 	if (bo == NULL)
 		return -ENOMEM;
@@ -149,8 +150,6 @@
 	bo->surface_reg = -1;
 	INIT_LIST_HEAD(&bo->list);
 	INIT_LIST_HEAD(&bo->va);
-
-retry:
 	radeon_ttm_placement_from_domain(bo, domain);
 	/* Kernel allocation are uninterruptible */
 	mutex_lock(&rdev->vram_mutex);
diff -druN linux-libre-3.4.10-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c linux-libre-3.4.11-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
--- linux-libre-3.4.10-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c	2012-09-14 18:18:55.000000000 -0400
@@ -182,6 +182,7 @@
 	{0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
 	{0, 0, 0}
 };
+MODULE_DEVICE_TABLE(pci, vmw_pci_id_list);
 
 static int enable_fbdev;
 
diff -druN linux-libre-3.4.10-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c linux-libre-3.4.11-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
--- linux-libre-3.4.10-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c	2012-09-14 18:18:55.000000000 -0400
@@ -1688,15 +1688,19 @@
 	struct vmw_private *dev_priv = vmw_priv(crtc->dev);
 	struct drm_framebuffer *old_fb = crtc->fb;
 	struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(fb);
-	struct drm_file *file_priv = event->base.file_priv;
+	struct drm_file *file_priv ;
 	struct vmw_fence_obj *fence = NULL;
 	struct drm_clip_rect clips;
 	int ret;
 
+	if (event == NULL)
+		return -EINVAL;
+
 	/* require ScreenObject support for page flipping */
 	if (!dev_priv->sou_priv)
 		return -ENOSYS;
 
+	file_priv = event->base.file_priv;
 	if (!vmw_kms_screen_object_flippable(dev_priv, crtc))
 		return -EINVAL;
 
diff -druN linux-libre-3.4.10-gnu/drivers/hid/usbhid/hid-quirks.c linux-libre-3.4.11-gnu/drivers/hid/usbhid/hid-quirks.c
--- linux-libre-3.4.10-gnu/drivers/hid/usbhid/hid-quirks.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/hid/usbhid/hid-quirks.c	2012-09-14 18:18:55.000000000 -0400
@@ -70,6 +70,7 @@
 	{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+	{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
 	{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
diff -druN linux-libre-3.4.10-gnu/drivers/hwmon/asus_atk0110.c linux-libre-3.4.11-gnu/drivers/hwmon/asus_atk0110.c
--- linux-libre-3.4.10-gnu/drivers/hwmon/asus_atk0110.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/hwmon/asus_atk0110.c	2012-09-14 18:18:55.000000000 -0400
@@ -34,6 +34,12 @@
 		.matches = {
 			DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58")
 		}
+	}, {
+		/* Old interface reads the same sensor for fan0 and fan1 */
+		.ident = "Asus M5A78L",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_NAME, "M5A78L")
+		}
 	},
 	{ }
 };
diff -druN linux-libre-3.4.10-gnu/drivers/i2c/busses/i2c-designware-core.c linux-libre-3.4.11-gnu/drivers/i2c/busses/i2c-designware-core.c
--- linux-libre-3.4.10-gnu/drivers/i2c/busses/i2c-designware-core.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/i2c/busses/i2c-designware-core.c	2012-09-14 18:18:55.000000000 -0400
@@ -25,6 +25,7 @@
  * ----------------------------------------------------------------------------
  *
  */
+#include <linux/export.h>
 #include <linux/clk.h>
 #include <linux/errno.h>
 #include <linux/err.h>
@@ -305,6 +306,7 @@
 	dw_writel(dev, dev->master_cfg , DW_IC_CON);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_init);
 
 /*
  * Waiting for bus not busy
@@ -557,12 +559,14 @@
 
 	return ret;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_xfer);
 
 u32 i2c_dw_func(struct i2c_adapter *adap)
 {
 	struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
 	return dev->functionality;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_func);
 
 static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
 {
@@ -667,17 +671,20 @@
 
 	return IRQ_HANDLED;
 }
+EXPORT_SYMBOL_GPL(i2c_dw_isr);
 
 void i2c_dw_enable(struct dw_i2c_dev *dev)
 {
        /* Enable the adapter */
 	dw_writel(dev, 1, DW_IC_ENABLE);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_enable);
 
 u32 i2c_dw_is_enabled(struct dw_i2c_dev *dev)
 {
 	return dw_readl(dev, DW_IC_ENABLE);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_is_enabled);
 
 void i2c_dw_disable(struct dw_i2c_dev *dev)
 {
@@ -688,18 +695,22 @@
 	dw_writel(dev, 0, DW_IC_INTR_MASK);
 	dw_readl(dev, DW_IC_CLR_INTR);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_disable);
 
 void i2c_dw_clear_int(struct dw_i2c_dev *dev)
 {
 	dw_readl(dev, DW_IC_CLR_INTR);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_clear_int);
 
 void i2c_dw_disable_int(struct dw_i2c_dev *dev)
 {
 	dw_writel(dev, 0, DW_IC_INTR_MASK);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_disable_int);
 
 u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev)
 {
 	return dw_readl(dev, DW_IC_COMP_PARAM_1);
 }
+EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);
diff -druN linux-libre-3.4.10-gnu/drivers/i2c/busses/i2c-i801.c linux-libre-3.4.11-gnu/drivers/i2c/busses/i2c-i801.c
--- linux-libre-3.4.10-gnu/drivers/i2c/busses/i2c-i801.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/i2c/busses/i2c-i801.c	2012-09-14 18:18:55.000000000 -0400
@@ -52,6 +52,7 @@
   DH89xxCC (PCH)        0x2330     32     hard     yes     yes     yes
   Panther Point (PCH)   0x1e22     32     hard     yes     yes     yes
   Lynx Point (PCH)      0x8c22     32     hard     yes     yes     yes
+  Lynx Point-LP (PCH)   0x9c22     32     hard     yes     yes     yes
 
   Features supported by this driver:
   Software PEC                     no
@@ -147,6 +148,7 @@
 #define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS	0x2330
 #define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS	0x3b30
 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS	0x8c22
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS	0x9c22
 
 struct i801_priv {
 	struct i2c_adapter adapter;
@@ -636,6 +638,7 @@
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS) },
 	{ 0, }
 };
 
diff -druN linux-libre-3.4.10-gnu/drivers/i2c/busses/Kconfig linux-libre-3.4.11-gnu/drivers/i2c/busses/Kconfig
--- linux-libre-3.4.10-gnu/drivers/i2c/busses/Kconfig	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/i2c/busses/Kconfig	2012-09-14 18:18:55.000000000 -0400
@@ -104,6 +104,7 @@
 	    DH89xxCC (PCH)
 	    Panther Point (PCH)
 	    Lynx Point (PCH)
+	    Lynx Point-LP (PCH)
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-i801.
@@ -350,9 +351,13 @@
 	  devices such as DaVinci NIC.
 	  For details please see http://www.ti.com/davinci
 
+config I2C_DESIGNWARE_CORE
+	tristate
+
 config I2C_DESIGNWARE_PLATFORM
 	tristate "Synopsys DesignWare Platfrom"
 	depends on HAVE_CLK
+	select I2C_DESIGNWARE_CORE
 	help
 	  If you say yes to this option, support will be included for the
 	  Synopsys DesignWare I2C adapter. Only master mode is supported.
@@ -363,6 +368,7 @@
 config I2C_DESIGNWARE_PCI
 	tristate "Synopsys DesignWare PCI"
 	depends on PCI
+	select I2C_DESIGNWARE_CORE
 	help
 	  If you say yes to this option, support will be included for the
 	  Synopsys DesignWare I2C adapter. Only master mode is supported.
diff -druN linux-libre-3.4.10-gnu/drivers/i2c/busses/Makefile linux-libre-3.4.11-gnu/drivers/i2c/busses/Makefile
--- linux-libre-3.4.10-gnu/drivers/i2c/busses/Makefile	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/i2c/busses/Makefile	2012-09-14 18:18:55.000000000 -0400
@@ -33,10 +33,11 @@
 obj-$(CONFIG_I2C_BLACKFIN_TWI)	+= i2c-bfin-twi.o
 obj-$(CONFIG_I2C_CPM)		+= i2c-cpm.o
 obj-$(CONFIG_I2C_DAVINCI)	+= i2c-davinci.o
+obj-$(CONFIG_I2C_DESIGNWARE_CORE)	+= i2c-designware-core.o
 obj-$(CONFIG_I2C_DESIGNWARE_PLATFORM)	+= i2c-designware-platform.o
-i2c-designware-platform-objs := i2c-designware-platdrv.o i2c-designware-core.o
+i2c-designware-platform-objs := i2c-designware-platdrv.o
 obj-$(CONFIG_I2C_DESIGNWARE_PCI)	+= i2c-designware-pci.o
-i2c-designware-pci-objs := i2c-designware-pcidrv.o i2c-designware-core.o
+i2c-designware-pci-objs := i2c-designware-pcidrv.o
 obj-$(CONFIG_I2C_EG20T)		+= i2c-eg20t.o
 obj-$(CONFIG_I2C_GPIO)		+= i2c-gpio.o
 obj-$(CONFIG_I2C_HIGHLANDER)	+= i2c-highlander.o
diff -druN linux-libre-3.4.10-gnu/drivers/input/serio/i8042-x86ia64io.h linux-libre-3.4.11-gnu/drivers/input/serio/i8042-x86ia64io.h
--- linux-libre-3.4.10-gnu/drivers/input/serio/i8042-x86ia64io.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/input/serio/i8042-x86ia64io.h	2012-09-14 18:18:55.000000000 -0400
@@ -177,6 +177,20 @@
 		},
 	},
 	{
+		/* Gigabyte T1005 - defines wrong chassis type ("Other") */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
+		},
+	},
+	{
+		/* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
+		},
+	},
+	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
diff -druN linux-libre-3.4.10-gnu/drivers/media/dvb/siano/smsusb.c linux-libre-3.4.11-gnu/drivers/media/dvb/siano/smsusb.c
--- linux-libre-3.4.10-gnu/drivers/media/dvb/siano/smsusb.c	2012-08-27 14:50:24.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/media/dvb/siano/smsusb.c	2012-09-14 21:20:14.000000000 -0400
@@ -481,7 +481,7 @@
 	return 0;
 }
 
-static const struct usb_device_id smsusb_id_table[] __devinitconst = {
+static const struct usb_device_id smsusb_id_table[] = {
 	{ USB_DEVICE(0x187f, 0x0010),
 		.driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
 	{ USB_DEVICE(0x187f, 0x0100),
diff -druN linux-libre-3.4.10-gnu/drivers/media/video/gspca/jl2005bcd.c linux-libre-3.4.11-gnu/drivers/media/video/gspca/jl2005bcd.c
--- linux-libre-3.4.10-gnu/drivers/media/video/gspca/jl2005bcd.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/media/video/gspca/jl2005bcd.c	2012-09-14 18:18:55.000000000 -0400
@@ -510,7 +510,7 @@
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
 	{USB_DEVICE(0x0979, 0x0227)},
 	{}
 };
diff -druN linux-libre-3.4.10-gnu/drivers/media/video/gspca/spca506.c linux-libre-3.4.11-gnu/drivers/media/video/gspca/spca506.c
--- linux-libre-3.4.10-gnu/drivers/media/video/gspca/spca506.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/media/video/gspca/spca506.c	2012-09-14 18:18:55.000000000 -0400
@@ -685,7 +685,7 @@
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
 	{USB_DEVICE(0x06e1, 0xa190)},
 /*fixme: may be IntelPCCameraPro BRIDGE_SPCA505
 	{USB_DEVICE(0x0733, 0x0430)}, */
diff -druN linux-libre-3.4.10-gnu/drivers/media/video/uvc/uvc_queue.c linux-libre-3.4.11-gnu/drivers/media/video/uvc/uvc_queue.c
--- linux-libre-3.4.10-gnu/drivers/media/video/uvc/uvc_queue.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/media/video/uvc/uvc_queue.c	2012-09-14 18:18:55.000000000 -0400
@@ -355,6 +355,7 @@
 	if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) {
 		buf->error = 0;
 		buf->state = UVC_BUF_STATE_QUEUED;
+		buf->bytesused = 0;
 		vb2_set_plane_payload(&buf->buf, 0, 0);
 		return buf;
 	}
diff -druN linux-libre-3.4.10-gnu/drivers/net/wireless/ath/ath9k/recv.c linux-libre-3.4.11-gnu/drivers/net/wireless/ath/ath9k/recv.c
--- linux-libre-3.4.10-gnu/drivers/net/wireless/ath/ath9k/recv.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/net/wireless/ath/ath9k/recv.c	2012-09-14 18:18:55.000000000 -0400
@@ -1774,7 +1774,6 @@
 	struct ieee80211_hw *hw = sc->hw;
 	struct ieee80211_hdr *hdr;
 	int retval;
-	bool decrypt_error = false;
 	struct ath_rx_status rs;
 	enum ath9k_rx_qtype qtype;
 	bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
@@ -1796,6 +1795,7 @@
 	tsf_lower = tsf & 0xffffffff;
 
 	do {
+		bool decrypt_error = false;
 		/* If handling rx interrupt and flush is in progress => exit */
 		if ((sc->sc_flags & SC_OP_RXFLUSH) && (flush == 0))
 			break;
diff -druN linux-libre-3.4.10-gnu/drivers/net/wireless/p54/p54usb.c linux-libre-3.4.11-gnu/drivers/net/wireless/p54/p54usb.c
--- linux-libre-3.4.10-gnu/drivers/net/wireless/p54/p54usb.c	2012-08-27 14:56:13.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/net/wireless/p54/p54usb.c	2012-09-14 21:25:45.000000000 -0400
@@ -41,7 +41,7 @@
  * whenever you add a new device.
  */
 
-static struct usb_device_id p54u_table[] __devinitdata = {
+static struct usb_device_id p54u_table[] = {
 	/* Version 1 devices (pci chip + net2280) */
 	{USB_DEVICE(0x0411, 0x0050)},	/* Buffalo WLI2-USB2-G54 */
 	{USB_DEVICE(0x045e, 0x00c2)},	/* Microsoft MN-710 */
diff -druN linux-libre-3.4.10-gnu/drivers/net/wireless/rtl818x/rtl8187/dev.c linux-libre-3.4.11-gnu/drivers/net/wireless/rtl818x/rtl8187/dev.c
--- linux-libre-3.4.10-gnu/drivers/net/wireless/rtl818x/rtl8187/dev.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/net/wireless/rtl818x/rtl8187/dev.c	2012-09-14 18:18:55.000000000 -0400
@@ -44,7 +44,7 @@
 MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver");
 MODULE_LICENSE("GPL");
 
-static struct usb_device_id rtl8187_table[] __devinitdata = {
+static struct usb_device_id rtl8187_table[] = {
 	/* Asus */
 	{USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187},
 	/* Belkin */
diff -druN linux-libre-3.4.10-gnu/drivers/pci/pci-driver.c linux-libre-3.4.11-gnu/drivers/pci/pci-driver.c
--- linux-libre-3.4.10-gnu/drivers/pci/pci-driver.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/pci/pci-driver.c	2012-09-14 18:18:55.000000000 -0400
@@ -952,6 +952,13 @@
 	if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
 		pci_prepare_to_sleep(pci_dev);
 
+	/*
+	 * The reason for doing this here is the same as for the analogous code
+	 * in pci_pm_suspend_noirq().
+	 */
+	if (pci_dev->class == PCI_CLASS_SERIAL_USB_EHCI)
+		pci_write_config_word(pci_dev, PCI_COMMAND, 0);
+
 	return 0;
 }
 
diff -druN linux-libre-3.4.10-gnu/drivers/rapidio/devices/tsi721.c linux-libre-3.4.11-gnu/drivers/rapidio/devices/tsi721.c
--- linux-libre-3.4.10-gnu/drivers/rapidio/devices/tsi721.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/rapidio/devices/tsi721.c	2012-09-14 18:18:55.000000000 -0400
@@ -439,6 +439,9 @@
 				" info %4.4x\n", DBELL_SID(idb.bytes),
 				DBELL_TID(idb.bytes), DBELL_INF(idb.bytes));
 		}
+
+		wr_ptr = ioread32(priv->regs +
+				  TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
 	}
 
 	iowrite32(rd_ptr & (IDB_QSIZE - 1),
@@ -449,6 +452,10 @@
 	regval |= TSI721_SR_CHINT_IDBQRCV;
 	iowrite32(regval,
 		priv->regs + TSI721_SR_CHINTE(IDB_QUEUE));
+
+	wr_ptr = ioread32(priv->regs + TSI721_IDQ_WP(IDB_QUEUE)) % IDB_QSIZE;
+	if (wr_ptr != rd_ptr)
+		schedule_work(&priv->idb_work);
 }
 
 /**
@@ -2155,7 +2162,7 @@
 				  const struct pci_device_id *id)
 {
 	struct tsi721_device *priv;
-	int i, cap;
+	int cap;
 	int err;
 	u32 regval;
 
@@ -2175,12 +2182,15 @@
 	priv->pdev = pdev;
 
 #ifdef DEBUG
+	{
+	int i;
 	for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
 		dev_dbg(&pdev->dev, "res[%d] @ 0x%llx (0x%lx, 0x%lx)\n",
 			i, (unsigned long long)pci_resource_start(pdev, i),
 			(unsigned long)pci_resource_len(pdev, i),
 			pci_resource_flags(pdev, i));
 	}
+	}
 #endif
 	/*
 	 * Verify BAR configuration
diff -druN linux-libre-3.4.10-gnu/drivers/regulator/twl-regulator.c linux-libre-3.4.11-gnu/drivers/regulator/twl-regulator.c
--- linux-libre-3.4.10-gnu/drivers/regulator/twl-regulator.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/regulator/twl-regulator.c	2012-09-14 18:18:55.000000000 -0400
@@ -1085,7 +1085,7 @@
 TWL6025_ADJUSTABLE_LDO(LDO6, 0x60, 1000, 3300);
 TWL6025_ADJUSTABLE_LDO(LDOLN, 0x64, 1000, 3300);
 TWL6025_ADJUSTABLE_LDO(LDOUSB, 0x70, 1000, 3300);
-TWL4030_FIXED_LDO(VINTANA2, 0x3f, 1500, 11, 100, 0x08);
+TWL4030_FIXED_LDO(VINTANA1, 0x3f, 1500, 11, 100, 0x08);
 TWL4030_FIXED_LDO(VINTDIG, 0x47, 1500, 13, 100, 0x08);
 TWL4030_FIXED_LDO(VUSB1V5, 0x71, 1500, 17, 100, 0x08);
 TWL4030_FIXED_LDO(VUSB1V8, 0x74, 1800, 18, 100, 0x08);
@@ -1166,7 +1166,7 @@
 	TWL6025_OF_MATCH("ti,twl6025-ldo6", LDO6),
 	TWL6025_OF_MATCH("ti,twl6025-ldoln", LDOLN),
 	TWL6025_OF_MATCH("ti,twl6025-ldousb", LDOUSB),
-	TWLFIXED_OF_MATCH("ti,twl4030-vintana2", VINTANA2),
+	TWLFIXED_OF_MATCH("ti,twl4030-vintana1", VINTANA1),
 	TWLFIXED_OF_MATCH("ti,twl4030-vintdig", VINTDIG),
 	TWLFIXED_OF_MATCH("ti,twl4030-vusb1v5", VUSB1V5),
 	TWLFIXED_OF_MATCH("ti,twl4030-vusb1v8", VUSB1V8),
diff -druN linux-libre-3.4.10-gnu/drivers/scsi/megaraid/megaraid_sas_base.c linux-libre-3.4.11-gnu/drivers/scsi/megaraid/megaraid_sas_base.c
--- linux-libre-3.4.10-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2012-09-14 18:18:55.000000000 -0400
@@ -4066,7 +4066,6 @@
 	spin_lock_init(&instance->cmd_pool_lock);
 	spin_lock_init(&instance->hba_lock);
 	spin_lock_init(&instance->completion_lock);
-	spin_lock_init(&poll_aen_lock);
 
 	mutex_init(&instance->aen_mutex);
 	mutex_init(&instance->reset_mutex);
@@ -5392,6 +5391,8 @@
 	printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
 	       MEGASAS_EXT_VERSION);
 
+	spin_lock_init(&poll_aen_lock);
+
 	support_poll_for_event = 2;
 	support_device_change = 1;
 
diff -druN linux-libre-3.4.10-gnu/drivers/scsi/mpt2sas/mpt2sas_base.c linux-libre-3.4.11-gnu/drivers/scsi/mpt2sas/mpt2sas_base.c
--- linux-libre-3.4.10-gnu/drivers/scsi/mpt2sas/mpt2sas_base.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/scsi/mpt2sas/mpt2sas_base.c	2012-09-14 18:18:55.000000000 -0400
@@ -2417,10 +2417,13 @@
 	}
 
 	/* command line tunables  for max controller queue depth */
-	if (max_queue_depth != -1)
-		max_request_credit = (max_queue_depth < facts->RequestCredit)
-		    ? max_queue_depth : facts->RequestCredit;
-	else
+	if (max_queue_depth != -1 && max_queue_depth != 0) {
+		max_request_credit = min_t(u16, max_queue_depth +
+			ioc->hi_priority_depth + ioc->internal_depth,
+			facts->RequestCredit);
+		if (max_request_credit > MAX_HBA_QUEUE_DEPTH)
+			max_request_credit =  MAX_HBA_QUEUE_DEPTH;
+	} else
 		max_request_credit = min_t(u16, facts->RequestCredit,
 		    MAX_HBA_QUEUE_DEPTH);
 
@@ -2495,7 +2498,7 @@
 	/* set the scsi host can_queue depth
 	 * with some internal commands that could be outstanding
 	 */
-	ioc->shost->can_queue = ioc->scsiio_depth - (2);
+	ioc->shost->can_queue = ioc->scsiio_depth;
 	dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scsi host: "
 	    "can_queue depth (%d)\n", ioc->name, ioc->shost->can_queue));
 
diff -druN linux-libre-3.4.10-gnu/drivers/scsi/scsi_error.c linux-libre-3.4.11-gnu/drivers/scsi/scsi_error.c
--- linux-libre-3.4.10-gnu/drivers/scsi/scsi_error.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/scsi/scsi_error.c	2012-09-14 18:18:55.000000000 -0400
@@ -42,6 +42,8 @@
 
 #include <trace/events/scsi.h>
 
+static void scsi_eh_done(struct scsi_cmnd *scmd);
+
 #define SENSE_TIMEOUT		(10*HZ)
 
 /*
@@ -241,6 +243,14 @@
 	if (! scsi_command_normalize_sense(scmd, &sshdr))
 		return FAILED;	/* no valid sense data */
 
+	if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done)
+		/*
+		 * nasty: for mid-layer issued TURs, we need to return the
+		 * actual sense data without any recovery attempt.  For eh
+		 * issued ones, we need to try to recover and interpret
+		 */
+		return SUCCESS;
+
 	if (scsi_sense_is_deferred(&sshdr))
 		return NEEDS_RETRY;
 
diff -druN linux-libre-3.4.10-gnu/drivers/scsi/scsi_lib.c linux-libre-3.4.11-gnu/drivers/scsi/scsi_lib.c
--- linux-libre-3.4.10-gnu/drivers/scsi/scsi_lib.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/scsi/scsi_lib.c	2012-09-14 18:18:55.000000000 -0400
@@ -760,7 +760,6 @@
 	}
 
 	if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */
-		req->errors = result;
 		if (result) {
 			if (sense_valid && req->sense) {
 				/*
@@ -776,6 +775,10 @@
 			if (!sense_deferred)
 				error = __scsi_error_from_host_byte(cmd, result);
 		}
+		/*
+		 * __scsi_error_from_host_byte may have reset the host_byte
+		 */
+		req->errors = cmd->result;
 
 		req->resid_len = scsi_get_resid(cmd);
 
diff -druN linux-libre-3.4.10-gnu/drivers/scsi/scsi_scan.c linux-libre-3.4.11-gnu/drivers/scsi/scsi_scan.c
--- linux-libre-3.4.10-gnu/drivers/scsi/scsi_scan.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/scsi/scsi_scan.c	2012-09-14 18:18:55.000000000 -0400
@@ -776,6 +776,16 @@
 	sdev->model = (char *) (sdev->inquiry + 16);
 	sdev->rev = (char *) (sdev->inquiry + 32);
 
+	if (strncmp(sdev->vendor, "ATA     ", 8) == 0) {
+		/*
+		 * sata emulation layer device.  This is a hack to work around
+		 * the SATL power management specifications which state that
+		 * when the SATL detects the device has gone into standby
+		 * mode, it shall respond with NOT READY.
+		 */
+		sdev->allow_restart = 1;
+	}
+
 	if (*bflags & BLIST_ISROM) {
 		sdev->type = TYPE_ROM;
 		sdev->removable = 1;
diff -druN linux-libre-3.4.10-gnu/drivers/staging/vt6656/main_usb.c linux-libre-3.4.11-gnu/drivers/staging/vt6656/main_usb.c
--- linux-libre-3.4.10-gnu/drivers/staging/vt6656/main_usb.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/staging/vt6656/main_usb.c	2012-09-14 18:18:55.000000000 -0400
@@ -222,7 +222,7 @@
 // Static vars definitions
 //
 
-static struct usb_device_id vt6656_table[] __devinitdata = {
+static struct usb_device_id vt6656_table[] = {
 	{USB_DEVICE(VNT_USB_VENDOR_ID, VNT_USB_PRODUCT_ID)},
 	{}
 };
diff -druN linux-libre-3.4.10-gnu/drivers/staging/winbond/wbusb.c linux-libre-3.4.11-gnu/drivers/staging/winbond/wbusb.c
--- linux-libre-3.4.10-gnu/drivers/staging/winbond/wbusb.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/staging/winbond/wbusb.c	2012-09-14 18:18:55.000000000 -0400
@@ -25,7 +25,7 @@
 MODULE_LICENSE("GPL");
 MODULE_VERSION("0.1");
 
-static const struct usb_device_id wb35_table[] __devinitconst = {
+static const struct usb_device_id wb35_table[] = {
 	{ USB_DEVICE(0x0416, 0x0035) },
 	{ USB_DEVICE(0x18E8, 0x6201) },
 	{ USB_DEVICE(0x18E8, 0x6206) },
diff -druN linux-libre-3.4.10-gnu/drivers/target/target_core_transport.c linux-libre-3.4.11-gnu/drivers/target/target_core_transport.c
--- linux-libre-3.4.10-gnu/drivers/target/target_core_transport.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/target/target_core_transport.c	2012-09-14 18:18:55.000000000 -0400
@@ -3675,9 +3675,9 @@
 	return 0;
 
 out:
-	while (i >= 0) {
-		__free_page(sg_page(&cmd->t_data_sg[i]));
+	while (i > 0) {
 		i--;
+		__free_page(sg_page(&cmd->t_data_sg[i]));
 	}
 	kfree(cmd->t_data_sg);
 	cmd->t_data_sg = NULL;
diff -druN linux-libre-3.4.10-gnu/drivers/usb/class/cdc-acm.c linux-libre-3.4.11-gnu/drivers/usb/class/cdc-acm.c
--- linux-libre-3.4.10-gnu/drivers/usb/class/cdc-acm.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/usb/class/cdc-acm.c	2012-09-14 18:18:55.000000000 -0400
@@ -1104,7 +1104,8 @@
 	}
 
 
-	if (data_interface->cur_altsetting->desc.bNumEndpoints < 2)
+	if (data_interface->cur_altsetting->desc.bNumEndpoints < 2 ||
+	    control_interface->cur_altsetting->desc.bNumEndpoints == 0)
 		return -EINVAL;
 
 	epctrl = &control_interface->cur_altsetting->endpoint[0].desc;
diff -druN linux-libre-3.4.10-gnu/drivers/usb/misc/emi62.c linux-libre-3.4.11-gnu/drivers/usb/misc/emi62.c
--- linux-libre-3.4.10-gnu/drivers/usb/misc/emi62.c	2012-08-27 14:58:50.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/usb/misc/emi62.c	2012-09-14 21:28:19.000000000 -0400
@@ -256,7 +256,7 @@
 	return err;
 }
 
-static const struct usb_device_id id_table[] __devinitconst = {
+static const struct usb_device_id id_table[] = {
 	{ USB_DEVICE(EMI62_VENDOR_ID, EMI62_PRODUCT_ID) },
 	{ }                                             /* Terminating entry */
 };
diff -druN linux-libre-3.4.10-gnu/drivers/xen/swiotlb-xen.c linux-libre-3.4.11-gnu/drivers/xen/swiotlb-xen.c
--- linux-libre-3.4.10-gnu/drivers/xen/swiotlb-xen.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/xen/swiotlb-xen.c	2012-09-14 18:18:55.000000000 -0400
@@ -232,7 +232,7 @@
 		return ret;
 
 	if (hwdev && hwdev->coherent_dma_mask)
-		dma_mask = hwdev->coherent_dma_mask;
+		dma_mask = dma_alloc_coherent_mask(hwdev, flags);
 
 	phys = virt_to_phys(ret);
 	dev_addr = xen_phys_to_bus(phys);
diff -druN linux-libre-3.4.10-gnu/drivers/xen/xen-pciback/pci_stub.c linux-libre-3.4.11-gnu/drivers/xen/xen-pciback/pci_stub.c
--- linux-libre-3.4.10-gnu/drivers/xen/xen-pciback/pci_stub.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/drivers/xen/xen-pciback/pci_stub.c	2012-09-14 18:18:55.000000000 -0400
@@ -353,16 +353,16 @@
 	if (err)
 		goto config_release;
 
-	dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
-	__pci_reset_function_locked(dev);
-
 	/* We need the device active to save the state. */
 	dev_dbg(&dev->dev, "save state of device\n");
 	pci_save_state(dev);
 	dev_data->pci_saved_state = pci_store_saved_state(dev);
 	if (!dev_data->pci_saved_state)
 		dev_err(&dev->dev, "Could not store PCI conf saved state!\n");
-
+	else {
+		dev_dbg(&dev->dev, "reseting (FLR, D3, etc) the device\n");
+		__pci_reset_function_locked(dev);
+	}
 	/* Now disable the device (this also ensures some private device
 	 * data is setup before we export)
 	 */
diff -druN linux-libre-3.4.10-gnu/fs/buffer.c linux-libre-3.4.11-gnu/fs/buffer.c
--- linux-libre-3.4.10-gnu/fs/buffer.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/buffer.c	2012-09-14 18:18:55.000000000 -0400
@@ -914,7 +914,7 @@
 /*
  * Initialise the state of a blockdev page's buffers.
  */ 
-static void
+static sector_t
 init_page_buffers(struct page *page, struct block_device *bdev,
 			sector_t block, int size)
 {
@@ -936,33 +936,41 @@
 		block++;
 		bh = bh->b_this_page;
 	} while (bh != head);
+
+	/*
+	 * Caller needs to validate requested block against end of device.
+	 */
+	return end_block;
 }
 
 /*
  * Create the page-cache page that contains the requested block.
  *
- * This is user purely for blockdev mappings.
+ * This is used purely for blockdev mappings.
  */
-static struct page *
+static int
 grow_dev_page(struct block_device *bdev, sector_t block,
-		pgoff_t index, int size)
+		pgoff_t index, int size, int sizebits)
 {
 	struct inode *inode = bdev->bd_inode;
 	struct page *page;
 	struct buffer_head *bh;
+	sector_t end_block;
+	int ret = 0;		/* Will call free_more_memory() */
 
 	page = find_or_create_page(inode->i_mapping, index,
 		(mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
 	if (!page)
-		return NULL;
+		return ret;
 
 	BUG_ON(!PageLocked(page));
 
 	if (page_has_buffers(page)) {
 		bh = page_buffers(page);
 		if (bh->b_size == size) {
-			init_page_buffers(page, bdev, block, size);
-			return page;
+			end_block = init_page_buffers(page, bdev,
+						index << sizebits, size);
+			goto done;
 		}
 		if (!try_to_free_buffers(page))
 			goto failed;
@@ -982,14 +990,14 @@
 	 */
 	spin_lock(&inode->i_mapping->private_lock);
 	link_dev_buffers(page, bh);
-	init_page_buffers(page, bdev, block, size);
+	end_block = init_page_buffers(page, bdev, index << sizebits, size);
 	spin_unlock(&inode->i_mapping->private_lock);
-	return page;
-
+done:
+	ret = (block < end_block) ? 1 : -ENXIO;
 failed:
 	unlock_page(page);
 	page_cache_release(page);
-	return NULL;
+	return ret;
 }
 
 /*
@@ -999,7 +1007,6 @@
 static int
 grow_buffers(struct block_device *bdev, sector_t block, int size)
 {
-	struct page *page;
 	pgoff_t index;
 	int sizebits;
 
@@ -1023,22 +1030,14 @@
 			bdevname(bdev, b));
 		return -EIO;
 	}
-	block = index << sizebits;
+
 	/* Create a page with the proper size buffers.. */
-	page = grow_dev_page(bdev, block, index, size);
-	if (!page)
-		return 0;
-	unlock_page(page);
-	page_cache_release(page);
-	return 1;
+	return grow_dev_page(bdev, block, index, size, sizebits);
 }
 
 static struct buffer_head *
 __getblk_slow(struct block_device *bdev, sector_t block, int size)
 {
-	int ret;
-	struct buffer_head *bh;
-
 	/* Size must be multiple of hard sectorsize */
 	if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
 			(size < 512 || size > PAGE_SIZE))) {
@@ -1051,21 +1050,20 @@
 		return NULL;
 	}
 
-retry:
-	bh = __find_get_block(bdev, block, size);
-	if (bh)
-		return bh;
+	for (;;) {
+		struct buffer_head *bh;
+		int ret;
 
-	ret = grow_buffers(bdev, block, size);
-	if (ret == 0) {
-		free_more_memory();
-		goto retry;
-	} else if (ret > 0) {
 		bh = __find_get_block(bdev, block, size);
 		if (bh)
 			return bh;
+
+		ret = grow_buffers(bdev, block, size);
+		if (ret < 0)
+			return NULL;
+		if (ret == 0)
+			free_more_memory();
 	}
-	return NULL;
 }
 
 /*
@@ -1321,10 +1319,6 @@
  * which corresponds to the passed block_device, block and size. The
  * returned buffer has its reference count incremented.
  *
- * __getblk() cannot fail - it just keeps trying.  If you pass it an
- * illegal block number, __getblk() will happily return a buffer_head
- * which represents the non-existent block.  Very weird.
- *
  * __getblk() will lock up the machine if grow_dev_page's try_to_free_buffers()
  * attempt is failing.  FIXME, perhaps?
  */
diff -druN linux-libre-3.4.10-gnu/fs/compat.c linux-libre-3.4.11-gnu/fs/compat.c
--- linux-libre-3.4.10-gnu/fs/compat.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/compat.c	2012-09-14 18:18:55.000000000 -0400
@@ -1160,11 +1160,14 @@
 	struct file *file;
 	int fput_needed;
 	ssize_t ret;
+	loff_t pos;
 
 	file = fget_light(fd, &fput_needed);
 	if (!file)
 		return -EBADF;
-	ret = compat_readv(file, vec, vlen, &file->f_pos);
+	pos = file->f_pos;
+	ret = compat_readv(file, vec, vlen, &pos);
+	file->f_pos = pos;
 	fput_light(file, fput_needed);
 	return ret;
 }
@@ -1226,11 +1229,14 @@
 	struct file *file;
 	int fput_needed;
 	ssize_t ret;
+	loff_t pos;
 
 	file = fget_light(fd, &fput_needed);
 	if (!file)
 		return -EBADF;
-	ret = compat_writev(file, vec, vlen, &file->f_pos);
+	pos = file->f_pos;
+	ret = compat_writev(file, vec, vlen, &pos);
+	file->f_pos = pos;
 	fput_light(file, fput_needed);
 	return ret;
 }
diff -druN linux-libre-3.4.10-gnu/fs/ext3/inode.c linux-libre-3.4.11-gnu/fs/ext3/inode.c
--- linux-libre-3.4.10-gnu/fs/ext3/inode.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/ext3/inode.c	2012-09-14 18:18:55.000000000 -0400
@@ -3068,6 +3068,8 @@
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	struct buffer_head *bh = iloc->bh;
 	int err = 0, rc, block;
+	int need_datasync = 0;
+	__le32 disksize;
 
 again:
 	/* we can't allow multiple procs in here at once, its a bit racey */
@@ -3105,7 +3107,11 @@
 		raw_inode->i_gid_high = 0;
 	}
 	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
-	raw_inode->i_size = cpu_to_le32(ei->i_disksize);
+	disksize = cpu_to_le32(ei->i_disksize);
+	if (disksize != raw_inode->i_size) {
+		need_datasync = 1;
+		raw_inode->i_size = disksize;
+	}
 	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
 	raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
 	raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec);
@@ -3121,8 +3127,11 @@
 	if (!S_ISREG(inode->i_mode)) {
 		raw_inode->i_dir_acl = cpu_to_le32(ei->i_dir_acl);
 	} else {
-		raw_inode->i_size_high =
-			cpu_to_le32(ei->i_disksize >> 32);
+		disksize = cpu_to_le32(ei->i_disksize >> 32);
+		if (disksize != raw_inode->i_size_high) {
+			raw_inode->i_size_high = disksize;
+			need_datasync = 1;
+		}
 		if (ei->i_disksize > 0x7fffffffULL) {
 			struct super_block *sb = inode->i_sb;
 			if (!EXT3_HAS_RO_COMPAT_FEATURE(sb,
@@ -3175,6 +3184,8 @@
 	ext3_clear_inode_state(inode, EXT3_STATE_NEW);
 
 	atomic_set(&ei->i_sync_tid, handle->h_transaction->t_tid);
+	if (need_datasync)
+		atomic_set(&ei->i_datasync_tid, handle->h_transaction->t_tid);
 out_brelse:
 	brelse (bh);
 	ext3_std_error(inode->i_sb, err);
diff -druN linux-libre-3.4.10-gnu/fs/fuse/dev.c linux-libre-3.4.11-gnu/fs/fuse/dev.c
--- linux-libre-3.4.10-gnu/fs/fuse/dev.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/fuse/dev.c	2012-09-14 18:18:55.000000000 -0400
@@ -1576,6 +1576,7 @@
 		req->pages[req->num_pages] = page;
 		req->num_pages++;
 
+		offset = 0;
 		num -= this_num;
 		total_len += this_num;
 		index++;
diff -druN linux-libre-3.4.10-gnu/fs/nfs/idmap.c linux-libre-3.4.11-gnu/fs/nfs/idmap.c
--- linux-libre-3.4.10-gnu/fs/nfs/idmap.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/idmap.c	2012-09-14 18:18:55.000000000 -0400
@@ -63,6 +63,12 @@
 	struct mutex		idmap_mutex;
 };
 
+struct idmap_legacy_upcalldata {
+	struct rpc_pipe_msg pipe_msg;
+	struct idmap_msg idmap_msg;
+	struct idmap *idmap;
+};
+
 /**
  * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
  * @fattr: fully initialised struct nfs_fattr
@@ -326,6 +332,7 @@
 		ret = nfs_idmap_request_key(&key_type_id_resolver_legacy,
 					    name, namelen, type, data,
 					    data_size, idmap);
+		idmap->idmap_key_cons = NULL;
 		mutex_unlock(&idmap->idmap_mutex);
 	}
 	return ret;
@@ -383,11 +390,13 @@
 static int nfs_idmap_legacy_upcall(struct key_construction *, const char *, void *);
 static ssize_t idmap_pipe_downcall(struct file *, const char __user *,
 				   size_t);
+static void idmap_release_pipe(struct inode *);
 static void idmap_pipe_destroy_msg(struct rpc_pipe_msg *);
 
 static const struct rpc_pipe_ops idmap_upcall_ops = {
 	.upcall		= rpc_pipe_generic_upcall,
 	.downcall	= idmap_pipe_downcall,
+	.release_pipe	= idmap_release_pipe,
 	.destroy_msg	= idmap_pipe_destroy_msg,
 };
 
@@ -603,7 +612,8 @@
 	nfs_idmap_quit_keyring();
 }
 
-static int nfs_idmap_prepare_message(char *desc, struct idmap_msg *im,
+static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
+				     struct idmap_msg *im,
 				     struct rpc_pipe_msg *msg)
 {
 	substring_t substr;
@@ -646,6 +656,7 @@
 				   const char *op,
 				   void *aux)
 {
+	struct idmap_legacy_upcalldata *data;
 	struct rpc_pipe_msg *msg;
 	struct idmap_msg *im;
 	struct idmap *idmap = (struct idmap *)aux;
@@ -653,15 +664,15 @@
 	int ret = -ENOMEM;
 
 	/* msg and im are freed in idmap_pipe_destroy_msg */
-	msg = kmalloc(sizeof(*msg), GFP_KERNEL);
-	if (!msg)
-		goto out0;
-
-	im = kmalloc(sizeof(*im), GFP_KERNEL);
-	if (!im)
+	data = kmalloc(sizeof(*data), GFP_KERNEL);
+	if (!data)
 		goto out1;
 
-	ret = nfs_idmap_prepare_message(key->description, im, msg);
+	msg = &data->pipe_msg;
+	im = &data->idmap_msg;
+	data->idmap = idmap;
+
+	ret = nfs_idmap_prepare_message(key->description, idmap, im, msg);
 	if (ret < 0)
 		goto out2;
 
@@ -670,15 +681,15 @@
 
 	ret = rpc_queue_upcall(idmap->idmap_pipe, msg);
 	if (ret < 0)
-		goto out2;
+		goto out3;
 
 	return ret;
 
+out3:
+	idmap->idmap_key_cons = NULL;
 out2:
-	kfree(im);
+	kfree(data);
 out1:
-	kfree(msg);
-out0:
 	complete_request_key(cons, ret);
 	return ret;
 }
@@ -736,9 +747,8 @@
 	}
 
 	if (!(im.im_status & IDMAP_STATUS_SUCCESS)) {
-		ret = mlen;
-		complete_request_key(cons, -ENOKEY);
-		goto out_incomplete;
+		ret = -ENOKEY;
+		goto out;
 	}
 
 	namelen_in = strnlen(im.im_name, IDMAP_NAMESZ);
@@ -755,16 +765,32 @@
 
 out:
 	complete_request_key(cons, ret);
-out_incomplete:
 	return ret;
 }
 
 static void
 idmap_pipe_destroy_msg(struct rpc_pipe_msg *msg)
 {
+	struct idmap_legacy_upcalldata *data = container_of(msg,
+			struct idmap_legacy_upcalldata,
+			pipe_msg);
+	struct idmap *idmap = data->idmap;
+	struct key_construction *cons;
+	if (msg->errno) {
+		cons = ACCESS_ONCE(idmap->idmap_key_cons);
+		idmap->idmap_key_cons = NULL;
+		complete_request_key(cons, msg->errno);
+	}
 	/* Free memory allocated in nfs_idmap_legacy_upcall() */
-	kfree(msg->data);
-	kfree(msg);
+	kfree(data);
+}
+
+static void
+idmap_release_pipe(struct inode *inode)
+{
+	struct rpc_inode *rpci = RPC_I(inode);
+	struct idmap *idmap = (struct idmap *)rpci->private;
+	idmap->idmap_key_cons = NULL;
 }
 
 int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
diff -druN linux-libre-3.4.10-gnu/fs/nfs/nfs3proc.c linux-libre-3.4.11-gnu/fs/nfs/nfs3proc.c
--- linux-libre-3.4.10-gnu/fs/nfs/nfs3proc.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/nfs3proc.c	2012-09-14 18:18:55.000000000 -0400
@@ -69,7 +69,7 @@
 	nfs_fattr_init(info->fattr);
 	status = rpc_call_sync(client, &msg, 0);
 	dprintk("%s: reply fsinfo: %d\n", __func__, status);
-	if (!(info->fattr->valid & NFS_ATTR_FATTR)) {
+	if (status == 0 && !(info->fattr->valid & NFS_ATTR_FATTR)) {
 		msg.rpc_proc = &nfs3_procedures[NFS3PROC_GETATTR];
 		msg.rpc_resp = info->fattr;
 		status = rpc_call_sync(client, &msg, 0);
diff -druN linux-libre-3.4.10-gnu/fs/nfs/nfs4proc.c linux-libre-3.4.11-gnu/fs/nfs/nfs4proc.c
--- linux-libre-3.4.10-gnu/fs/nfs/nfs4proc.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/nfs4proc.c	2012-09-14 18:18:55.000000000 -0400
@@ -5966,11 +5966,58 @@
 	dprintk("<-- %s\n", __func__);
 }
 
+static size_t max_response_pages(struct nfs_server *server)
+{
+	u32 max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
+	return nfs_page_array_len(0, max_resp_sz);
+}
+
+static void nfs4_free_pages(struct page **pages, size_t size)
+{
+	int i;
+
+	if (!pages)
+		return;
+
+	for (i = 0; i < size; i++) {
+		if (!pages[i])
+			break;
+		__free_page(pages[i]);
+	}
+	kfree(pages);
+}
+
+static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags)
+{
+	struct page **pages;
+	int i;
+
+	pages = kcalloc(size, sizeof(struct page *), gfp_flags);
+	if (!pages) {
+		dprintk("%s: can't alloc array of %zu pages\n", __func__, size);
+		return NULL;
+	}
+
+	for (i = 0; i < size; i++) {
+		pages[i] = alloc_page(gfp_flags);
+		if (!pages[i]) {
+			dprintk("%s: failed to allocate page\n", __func__);
+			nfs4_free_pages(pages, size);
+			return NULL;
+		}
+	}
+
+	return pages;
+}
+
 static void nfs4_layoutget_release(void *calldata)
 {
 	struct nfs4_layoutget *lgp = calldata;
+	struct nfs_server *server = NFS_SERVER(lgp->args.inode);
+	size_t max_pages = max_response_pages(server);
 
 	dprintk("--> %s\n", __func__);
+	nfs4_free_pages(lgp->args.layout.pages, max_pages);
 	put_nfs_open_context(lgp->args.ctx);
 	kfree(calldata);
 	dprintk("<-- %s\n", __func__);
@@ -5982,9 +6029,10 @@
 	.rpc_release = nfs4_layoutget_release,
 };
 
-int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
+int nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags)
 {
 	struct nfs_server *server = NFS_SERVER(lgp->args.inode);
+	size_t max_pages = max_response_pages(server);
 	struct rpc_task *task;
 	struct rpc_message msg = {
 		.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
@@ -6002,6 +6050,13 @@
 
 	dprintk("--> %s\n", __func__);
 
+	lgp->args.layout.pages = nfs4_alloc_pages(max_pages, gfp_flags);
+	if (!lgp->args.layout.pages) {
+		nfs4_layoutget_release(lgp);
+		return -ENOMEM;
+	}
+	lgp->args.layout.pglen = max_pages * PAGE_SIZE;
+
 	lgp->res.layoutp = &lgp->args.layout;
 	lgp->res.seq_res.sr_slot = NULL;
 	nfs41_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0);
@@ -6047,12 +6102,8 @@
 		return;
 	}
 	spin_lock(&lo->plh_inode->i_lock);
-	if (task->tk_status == 0) {
-		if (lrp->res.lrs_present) {
-			pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
-		} else
-			BUG_ON(!list_empty(&lo->plh_segs));
-	}
+	if (task->tk_status == 0 && lrp->res.lrs_present)
+		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
 	lo->plh_block_lgets--;
 	spin_unlock(&lo->plh_inode->i_lock);
 	dprintk("<-- %s\n", __func__);
diff -druN linux-libre-3.4.10-gnu/fs/nfs/pnfs.c linux-libre-3.4.11-gnu/fs/nfs/pnfs.c
--- linux-libre-3.4.10-gnu/fs/nfs/pnfs.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/pnfs.c	2012-09-14 18:18:55.000000000 -0400
@@ -574,9 +574,6 @@
 	struct nfs_server *server = NFS_SERVER(ino);
 	struct nfs4_layoutget *lgp;
 	struct pnfs_layout_segment *lseg = NULL;
-	struct page **pages = NULL;
-	int i;
-	u32 max_resp_sz, max_pages;
 
 	dprintk("--> %s\n", __func__);
 
@@ -585,20 +582,6 @@
 	if (lgp == NULL)
 		return NULL;
 
-	/* allocate pages for xdr post processing */
-	max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
-	max_pages = nfs_page_array_len(0, max_resp_sz);
-
-	pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags);
-	if (!pages)
-		goto out_err_free;
-
-	for (i = 0; i < max_pages; i++) {
-		pages[i] = alloc_page(gfp_flags);
-		if (!pages[i])
-			goto out_err_free;
-	}
-
 	lgp->args.minlength = PAGE_CACHE_SIZE;
 	if (lgp->args.minlength > range->length)
 		lgp->args.minlength = range->length;
@@ -607,39 +590,19 @@
 	lgp->args.type = server->pnfs_curr_ld->id;
 	lgp->args.inode = ino;
 	lgp->args.ctx = get_nfs_open_context(ctx);
-	lgp->args.layout.pages = pages;
-	lgp->args.layout.pglen = max_pages * PAGE_SIZE;
 	lgp->lsegpp = &lseg;
 	lgp->gfp_flags = gfp_flags;
 
 	/* Synchronously retrieve layout information from server and
 	 * store in lseg.
 	 */
-	nfs4_proc_layoutget(lgp);
+	nfs4_proc_layoutget(lgp, gfp_flags);
 	if (!lseg) {
 		/* remember that LAYOUTGET failed and suspend trying */
 		set_bit(lo_fail_bit(range->iomode), &lo->plh_flags);
 	}
 
-	/* free xdr pages */
-	for (i = 0; i < max_pages; i++)
-		__free_page(pages[i]);
-	kfree(pages);
-
 	return lseg;
-
-out_err_free:
-	/* free any allocated xdr pages, lgp as it's not used */
-	if (pages) {
-		for (i = 0; i < max_pages; i++) {
-			if (!pages[i])
-				break;
-			__free_page(pages[i]);
-		}
-		kfree(pages);
-	}
-	kfree(lgp);
-	return NULL;
 }
 
 /* Initiates a LAYOUTRETURN(FILE) */
diff -druN linux-libre-3.4.10-gnu/fs/nfs/pnfs.h linux-libre-3.4.11-gnu/fs/nfs/pnfs.h
--- linux-libre-3.4.10-gnu/fs/nfs/pnfs.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/pnfs.h	2012-09-14 18:18:55.000000000 -0400
@@ -161,7 +161,7 @@
 				   struct pnfs_devicelist *devlist);
 extern int nfs4_proc_getdeviceinfo(struct nfs_server *server,
 				   struct pnfs_device *dev);
-extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp);
+extern int nfs4_proc_layoutget(struct nfs4_layoutget *lgp, gfp_t gfp_flags);
 extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp);
 
 /* pnfs.c */
diff -druN linux-libre-3.4.10-gnu/fs/nfs/super.c linux-libre-3.4.11-gnu/fs/nfs/super.c
--- linux-libre-3.4.10-gnu/fs/nfs/super.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/nfs/super.c	2012-09-14 18:18:55.000000000 -0400
@@ -3146,4 +3146,6 @@
 	return res;
 }
 
+MODULE_ALIAS("nfs4");
+
 #endif /* CONFIG_NFS_V4 */
diff -druN linux-libre-3.4.10-gnu/fs/open.c linux-libre-3.4.11-gnu/fs/open.c
--- linux-libre-3.4.10-gnu/fs/open.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/open.c	2012-09-14 18:18:55.000000000 -0400
@@ -882,9 +882,10 @@
 	int lookup_flags = 0;
 	int acc_mode;
 
-	if (!(flags & O_CREAT))
-		mode = 0;
-	op->mode = mode;
+	if (flags & O_CREAT)
+		op->mode = (mode & S_IALLUGO) | S_IFREG;
+	else
+		op->mode = 0;
 
 	/* Must never be set by userspace */
 	flags &= ~FMODE_NONOTIFY;
diff -druN linux-libre-3.4.10-gnu/fs/ubifs/debug.h linux-libre-3.4.11-gnu/fs/ubifs/debug.h
--- linux-libre-3.4.10-gnu/fs/ubifs/debug.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/ubifs/debug.h	2012-09-14 18:18:55.000000000 -0400
@@ -170,7 +170,7 @@
 #define ubifs_dbg_msg(type, fmt, ...) \
 	pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
 
-#define DBG_KEY_BUF_LEN 32
+#define DBG_KEY_BUF_LEN 48
 #define ubifs_dbg_msg_key(type, key, fmt, ...) do {                            \
 	char __tmp_key_buf[DBG_KEY_BUF_LEN];                                   \
 	pr_debug("UBIFS DBG " type ": " fmt "%s\n", ##__VA_ARGS__,             \
diff -druN linux-libre-3.4.10-gnu/fs/udf/file.c linux-libre-3.4.11-gnu/fs/udf/file.c
--- linux-libre-3.4.10-gnu/fs/udf/file.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/fs/udf/file.c	2012-09-14 18:18:55.000000000 -0400
@@ -39,20 +39,24 @@
 #include "udf_i.h"
 #include "udf_sb.h"
 
-static int udf_adinicb_readpage(struct file *file, struct page *page)
+static void __udf_adinicb_readpage(struct page *page)
 {
 	struct inode *inode = page->mapping->host;
 	char *kaddr;
 	struct udf_inode_info *iinfo = UDF_I(inode);
 
-	BUG_ON(!PageLocked(page));
-
 	kaddr = kmap(page);
-	memset(kaddr, 0, PAGE_CACHE_SIZE);
 	memcpy(kaddr, iinfo->i_ext.i_data + iinfo->i_lenEAttr, inode->i_size);
+	memset(kaddr + inode->i_size, 0, PAGE_CACHE_SIZE - inode->i_size);
 	flush_dcache_page(page);
 	SetPageUptodate(page);
 	kunmap(page);
+}
+
+static int udf_adinicb_readpage(struct file *file, struct page *page)
+{
+	BUG_ON(!PageLocked(page));
+	__udf_adinicb_readpage(page);
 	unlock_page(page);
 
 	return 0;
@@ -77,6 +81,25 @@
 	return 0;
 }
 
+static int udf_adinicb_write_begin(struct file *file,
+			struct address_space *mapping, loff_t pos,
+			unsigned len, unsigned flags, struct page **pagep,
+			void **fsdata)
+{
+	struct page *page;
+
+	if (WARN_ON_ONCE(pos >= PAGE_CACHE_SIZE))
+		return -EIO;
+	page = grab_cache_page_write_begin(mapping, 0, flags);
+	if (!page)
+		return -ENOMEM;
+	*pagep = page;
+
+	if (!PageUptodate(page) && len != PAGE_CACHE_SIZE)
+		__udf_adinicb_readpage(page);
+	return 0;
+}
+
 static int udf_adinicb_write_end(struct file *file,
 			struct address_space *mapping,
 			loff_t pos, unsigned len, unsigned copied,
@@ -98,8 +121,8 @@
 const struct address_space_operations udf_adinicb_aops = {
 	.readpage	= udf_adinicb_readpage,
 	.writepage	= udf_adinicb_writepage,
-	.write_begin = simple_write_begin,
-	.write_end = udf_adinicb_write_end,
+	.write_begin	= udf_adinicb_write_begin,
+	.write_end	= udf_adinicb_write_end,
 };
 
 static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
diff -druN linux-libre-3.4.10-gnu/kernel/audit_tree.c linux-libre-3.4.11-gnu/kernel/audit_tree.c
--- linux-libre-3.4.10-gnu/kernel/audit_tree.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/kernel/audit_tree.c	2012-09-14 18:18:55.000000000 -0400
@@ -250,7 +250,6 @@
 		spin_unlock(&hash_lock);
 		spin_unlock(&entry->lock);
 		fsnotify_destroy_mark(entry);
-		fsnotify_put_mark(entry);
 		goto out;
 	}
 
@@ -259,7 +258,7 @@
 
 	fsnotify_duplicate_mark(&new->mark, entry);
 	if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, NULL, 1)) {
-		free_chunk(new);
+		fsnotify_put_mark(&new->mark);
 		goto Fallback;
 	}
 
@@ -293,7 +292,6 @@
 	spin_unlock(&hash_lock);
 	spin_unlock(&entry->lock);
 	fsnotify_destroy_mark(entry);
-	fsnotify_put_mark(entry);
 	goto out;
 
 Fallback:
@@ -322,7 +320,7 @@
 
 	entry = &chunk->mark;
 	if (fsnotify_add_mark(entry, audit_tree_group, inode, NULL, 0)) {
-		free_chunk(chunk);
+		fsnotify_put_mark(entry);
 		return -ENOSPC;
 	}
 
@@ -332,6 +330,7 @@
 		spin_unlock(&hash_lock);
 		chunk->dead = 1;
 		spin_unlock(&entry->lock);
+		fsnotify_get_mark(entry);
 		fsnotify_destroy_mark(entry);
 		fsnotify_put_mark(entry);
 		return 0;
@@ -396,7 +395,7 @@
 	fsnotify_duplicate_mark(chunk_entry, old_entry);
 	if (fsnotify_add_mark(chunk_entry, chunk_entry->group, chunk_entry->i.inode, NULL, 1)) {
 		spin_unlock(&old_entry->lock);
-		free_chunk(chunk);
+		fsnotify_put_mark(chunk_entry);
 		fsnotify_put_mark(old_entry);
 		return -ENOSPC;
 	}
@@ -412,6 +411,7 @@
 		spin_unlock(&chunk_entry->lock);
 		spin_unlock(&old_entry->lock);
 
+		fsnotify_get_mark(chunk_entry);
 		fsnotify_destroy_mark(chunk_entry);
 
 		fsnotify_put_mark(chunk_entry);
@@ -445,7 +445,6 @@
 	spin_unlock(&old_entry->lock);
 	fsnotify_destroy_mark(old_entry);
 	fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */
-	fsnotify_put_mark(old_entry); /* and kill it */
 	return 0;
 }
 
diff -druN linux-libre-3.4.10-gnu/kernel/sched/core.c linux-libre-3.4.11-gnu/kernel/sched/core.c
--- linux-libre-3.4.10-gnu/kernel/sched/core.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/kernel/sched/core.c	2012-09-14 18:18:55.000000000 -0400
@@ -3084,6 +3084,20 @@
 # define nsecs_to_cputime(__nsecs)	nsecs_to_jiffies(__nsecs)
 #endif
 
+static cputime_t scale_utime(cputime_t utime, cputime_t rtime, cputime_t total)
+{
+	u64 temp = (__force u64) rtime;
+
+	temp *= (__force u64) utime;
+
+	if (sizeof(cputime_t) == 4)
+		temp = div_u64(temp, (__force u32) total);
+	else
+		temp = div64_u64(temp, (__force u64) total);
+
+	return (__force cputime_t) temp;
+}
+
 void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
 {
 	cputime_t rtime, utime = p->utime, total = utime + p->stime;
@@ -3093,13 +3107,9 @@
 	 */
 	rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
 
-	if (total) {
-		u64 temp = (__force u64) rtime;
-
-		temp *= (__force u64) utime;
-		do_div(temp, (__force u32) total);
-		utime = (__force cputime_t) temp;
-	} else
+	if (total)
+		utime = scale_utime(utime, rtime, total);
+	else
 		utime = rtime;
 
 	/*
@@ -3126,13 +3136,9 @@
 	total = cputime.utime + cputime.stime;
 	rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
 
-	if (total) {
-		u64 temp = (__force u64) rtime;
-
-		temp *= (__force u64) cputime.utime;
-		do_div(temp, (__force u32) total);
-		utime = (__force cputime_t) temp;
-	} else
+	if (total)
+		utime = scale_utime(cputime.utime, rtime, total);
+	else
 		utime = rtime;
 
 	sig->prev_utime = max(sig->prev_utime, utime);
@@ -7011,6 +7017,7 @@
 
 #ifdef CONFIG_CGROUP_SCHED
 struct task_group root_task_group;
+LIST_HEAD(task_groups);
 #endif
 
 DECLARE_PER_CPU(cpumask_var_t, load_balance_tmpmask);
diff -druN linux-libre-3.4.10-gnu/kernel/sched/sched.h linux-libre-3.4.11-gnu/kernel/sched/sched.h
--- linux-libre-3.4.10-gnu/kernel/sched/sched.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/kernel/sched/sched.h	2012-09-14 18:18:55.000000000 -0400
@@ -80,7 +80,7 @@
 struct cfs_rq;
 struct rt_rq;
 
-static LIST_HEAD(task_groups);
+extern struct list_head task_groups;
 
 struct cfs_bandwidth {
 #ifdef CONFIG_CFS_BANDWIDTH
diff -druN linux-libre-3.4.10-gnu/Makefile linux-libre-3.4.11-gnu/Makefile
--- linux-libre-3.4.10-gnu/Makefile	2012-08-27 14:47:01.000000000 -0400
+++ linux-libre-3.4.11-gnu/Makefile	2012-09-14 21:16:53.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 4
-SUBLEVEL = 10
+SUBLEVEL = 11
 EXTRAVERSION =-gnu
 NAME = Saber-toothed Squirrel
 
diff -druN linux-libre-3.4.10-gnu/mm/mempolicy.c linux-libre-3.4.11-gnu/mm/mempolicy.c
--- linux-libre-3.4.10-gnu/mm/mempolicy.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/mm/mempolicy.c	2012-09-14 18:18:55.000000000 -0400
@@ -2536,7 +2536,7 @@
 		break;
 
 	default:
-		BUG();
+		return -EINVAL;
 	}
 
 	l = strlen(policy_modes[mode]);
diff -druN linux-libre-3.4.10-gnu/net/bluetooth/hci_event.c linux-libre-3.4.11-gnu/net/bluetooth/hci_event.c
--- linux-libre-3.4.10-gnu/net/bluetooth/hci_event.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/bluetooth/hci_event.c	2012-09-14 18:18:55.000000000 -0400
@@ -1357,6 +1357,9 @@
 		return false;
 
 	e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY, NAME_NEEDED);
+	if (!e)
+		return false;
+
 	if (hci_resolve_name(hdev, e) == 0) {
 		e->name_state = NAME_PENDING;
 		return true;
@@ -1385,12 +1388,20 @@
 		return;
 
 	e = hci_inquiry_cache_lookup_resolve(hdev, bdaddr, NAME_PENDING);
-	if (e) {
+	/* If the device was not found in a list of found devices names of which
+	 * are pending. there is no need to continue resolving a next name as it
+	 * will be done upon receiving another Remote Name Request Complete
+	 * Event */
+	if (!e)
+		return;
+
+	list_del(&e->list);
+	if (name) {
 		e->name_state = NAME_KNOWN;
-		list_del(&e->list);
-		if (name)
-			mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00,
-					 e->data.rssi, name, name_len);
+		mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00,
+				 e->data.rssi, name, name_len);
+	} else {
+		e->name_state = NAME_NOT_KNOWN;
 	}
 
 	if (hci_resolve_next_name(hdev))
@@ -1749,7 +1760,12 @@
 		if (conn->type == ACL_LINK) {
 			conn->state = BT_CONFIG;
 			hci_conn_hold(conn);
-			conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+
+			if (!conn->out && !hci_conn_ssp_enabled(conn) &&
+			    !hci_find_link_key(hdev, &ev->bdaddr))
+				conn->disc_timeout = HCI_PAIRING_TIMEOUT;
+			else
+				conn->disc_timeout = HCI_DISCONN_TIMEOUT;
 		} else
 			conn->state = BT_CONNECTED;
 
diff -druN linux-libre-3.4.10-gnu/net/bluetooth/l2cap_core.c linux-libre-3.4.11-gnu/net/bluetooth/l2cap_core.c
--- linux-libre-3.4.10-gnu/net/bluetooth/l2cap_core.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/bluetooth/l2cap_core.c	2012-09-14 18:18:55.000000000 -0400
@@ -893,6 +893,7 @@
 	sk = chan->sk;
 
 	hci_conn_hold(conn->hcon);
+	conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT;
 
 	bacpy(&bt_sk(sk)->src, conn->src);
 	bacpy(&bt_sk(sk)->dst, conn->dst);
diff -druN linux-libre-3.4.10-gnu/net/dccp/ccid.h linux-libre-3.4.11-gnu/net/dccp/ccid.h
--- linux-libre-3.4.10-gnu/net/dccp/ccid.h	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/dccp/ccid.h	2012-09-14 18:18:55.000000000 -0400
@@ -246,7 +246,7 @@
 					u32 __user *optval, int __user *optlen)
 {
 	int rc = -ENOPROTOOPT;
-	if (ccid->ccid_ops->ccid_hc_rx_getsockopt != NULL)
+	if (ccid != NULL && ccid->ccid_ops->ccid_hc_rx_getsockopt != NULL)
 		rc = ccid->ccid_ops->ccid_hc_rx_getsockopt(sk, optname, len,
 						 optval, optlen);
 	return rc;
@@ -257,7 +257,7 @@
 					u32 __user *optval, int __user *optlen)
 {
 	int rc = -ENOPROTOOPT;
-	if (ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
+	if (ccid != NULL && ccid->ccid_ops->ccid_hc_tx_getsockopt != NULL)
 		rc = ccid->ccid_ops->ccid_hc_tx_getsockopt(sk, optname, len,
 						 optval, optlen);
 	return rc;
diff -druN linux-libre-3.4.10-gnu/net/socket.c linux-libre-3.4.11-gnu/net/socket.c
--- linux-libre-3.4.10-gnu/net/socket.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/socket.c	2012-09-14 18:18:55.000000000 -0400
@@ -2605,7 +2605,7 @@
 	err = sock_do_ioctl(net, sock, cmd, (unsigned long)&ktv);
 	set_fs(old_fs);
 	if (!err)
-		err = compat_put_timeval(up, &ktv);
+		err = compat_put_timeval(&ktv, up);
 
 	return err;
 }
@@ -2621,7 +2621,7 @@
 	err = sock_do_ioctl(net, sock, cmd, (unsigned long)&kts);
 	set_fs(old_fs);
 	if (!err)
-		err = compat_put_timespec(up, &kts);
+		err = compat_put_timespec(&kts, up);
 
 	return err;
 }
diff -druN linux-libre-3.4.10-gnu/net/sunrpc/svcsock.c linux-libre-3.4.11-gnu/net/sunrpc/svcsock.c
--- linux-libre-3.4.10-gnu/net/sunrpc/svcsock.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/sunrpc/svcsock.c	2012-09-14 18:18:55.000000000 -0400
@@ -1137,9 +1137,9 @@
 	if (len >= 0)
 		svsk->sk_tcplen += len;
 	if (len != want) {
+		svc_tcp_save_pages(svsk, rqstp);
 		if (len < 0 && len != -EAGAIN)
 			goto err_other;
-		svc_tcp_save_pages(svsk, rqstp);
 		dprintk("svc: incomplete TCP record (%d of %d)\n",
 			svsk->sk_tcplen, svsk->sk_reclen);
 		goto err_noclose;
diff -druN linux-libre-3.4.10-gnu/net/sunrpc/svc_xprt.c linux-libre-3.4.11-gnu/net/sunrpc/svc_xprt.c
--- linux-libre-3.4.10-gnu/net/sunrpc/svc_xprt.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/net/sunrpc/svc_xprt.c	2012-09-14 18:18:55.000000000 -0400
@@ -316,7 +316,6 @@
  */
 void svc_xprt_enqueue(struct svc_xprt *xprt)
 {
-	struct svc_serv	*serv = xprt->xpt_server;
 	struct svc_pool *pool;
 	struct svc_rqst	*rqstp;
 	int cpu;
@@ -362,8 +361,6 @@
 				rqstp, rqstp->rq_xprt);
 		rqstp->rq_xprt = xprt;
 		svc_xprt_get(xprt);
-		rqstp->rq_reserved = serv->sv_max_mesg;
-		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 		pool->sp_stats.threads_woken++;
 		wake_up(&rqstp->rq_wait);
 	} else {
@@ -643,8 +640,6 @@
 	if (xprt) {
 		rqstp->rq_xprt = xprt;
 		svc_xprt_get(xprt);
-		rqstp->rq_reserved = serv->sv_max_mesg;
-		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 
 		/* As there is a shortage of threads and this request
 		 * had to be queued, don't allow the thread to wait so
@@ -741,6 +736,8 @@
 		else
 			len = xprt->xpt_ops->xpo_recvfrom(rqstp);
 		dprintk("svc: got len=%d\n", len);
+		rqstp->rq_reserved = serv->sv_max_mesg;
+		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
 	}
 	svc_xprt_received(xprt);
 
@@ -797,7 +794,8 @@
 
 	/* Grab mutex to serialize outgoing data. */
 	mutex_lock(&xprt->xpt_mutex);
-	if (test_bit(XPT_DEAD, &xprt->xpt_flags))
+	if (test_bit(XPT_DEAD, &xprt->xpt_flags)
+			|| test_bit(XPT_CLOSE, &xprt->xpt_flags))
 		len = -ENOTCONN;
 	else
 		len = xprt->xpt_ops->xpo_sendto(rqstp);
diff -druN linux-libre-3.4.10-gnu/sound/pci/hda/hda_proc.c linux-libre-3.4.11-gnu/sound/pci/hda/hda_proc.c
--- linux-libre-3.4.10-gnu/sound/pci/hda/hda_proc.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/sound/pci/hda/hda_proc.c	2012-09-14 18:18:55.000000000 -0400
@@ -412,7 +412,7 @@
 	if (digi1 & AC_DIG1_EMPHASIS)
 		snd_iprintf(buffer, " Preemphasis");
 	if (digi1 & AC_DIG1_COPYRIGHT)
-		snd_iprintf(buffer, " Copyright");
+		snd_iprintf(buffer, " Non-Copyright");
 	if (digi1 & AC_DIG1_NONAUDIO)
 		snd_iprintf(buffer, " Non-Audio");
 	if (digi1 & AC_DIG1_PROFESSIONAL)
diff -druN linux-libre-3.4.10-gnu/sound/pci/hda/patch_ca0132.c linux-libre-3.4.11-gnu/sound/pci/hda/patch_ca0132.c
--- linux-libre-3.4.10-gnu/sound/pci/hda/patch_ca0132.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/sound/pci/hda/patch_ca0132.c	2012-09-14 18:18:55.000000000 -0400
@@ -276,6 +276,10 @@
 	int type = dir ? HDA_INPUT : HDA_OUTPUT;
 	struct snd_kcontrol_new knew =
 		HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type);
+	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_MUTE) == 0) {
+		snd_printdd("Skipping '%s %s Switch' (no mute on node 0x%x)\n", pfx, dirstr[dir], nid);
+		return 0;
+	}
 	sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]);
 	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
 }
@@ -287,6 +291,10 @@
 	int type = dir ? HDA_INPUT : HDA_OUTPUT;
 	struct snd_kcontrol_new knew =
 		HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type);
+	if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_NUM_STEPS) == 0) {
+		snd_printdd("Skipping '%s %s Volume' (no amp on node 0x%x)\n", pfx, dirstr[dir], nid);
+		return 0;
+	}
 	sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]);
 	return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
 }
diff -druN linux-libre-3.4.10-gnu/sound/soc/codecs/wm9712.c linux-libre-3.4.11-gnu/sound/soc/codecs/wm9712.c
--- linux-libre-3.4.10-gnu/sound/soc/codecs/wm9712.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/sound/soc/codecs/wm9712.c	2012-09-14 18:18:55.000000000 -0400
@@ -272,7 +272,7 @@
 
 /* Mic select */
 static const struct snd_kcontrol_new wm9712_mic_src_controls =
-SOC_DAPM_ENUM("Route", wm9712_enum[7]);
+SOC_DAPM_ENUM("Mic Source Select", wm9712_enum[7]);
 
 /* diff select */
 static const struct snd_kcontrol_new wm9712_diff_sel_controls =
@@ -291,7 +291,9 @@
 	&wm9712_capture_selectl_controls),
 SND_SOC_DAPM_MUX("Right Capture Select", SND_SOC_NOPM, 0, 0,
 	&wm9712_capture_selectr_controls),
-SND_SOC_DAPM_MUX("Mic Select Source", SND_SOC_NOPM, 0, 0,
+SND_SOC_DAPM_MUX("Left Mic Select Source", SND_SOC_NOPM, 0, 0,
+	&wm9712_mic_src_controls),
+SND_SOC_DAPM_MUX("Right Mic Select Source", SND_SOC_NOPM, 0, 0,
 	&wm9712_mic_src_controls),
 SND_SOC_DAPM_MUX("Differential Source", SND_SOC_NOPM, 0, 0,
 	&wm9712_diff_sel_controls),
@@ -319,6 +321,7 @@
 SND_SOC_DAPM_PGA("Line PGA", AC97_INT_PAGING, 2, 1, NULL, 0),
 SND_SOC_DAPM_PGA("Phone PGA", AC97_INT_PAGING, 1, 1, NULL, 0),
 SND_SOC_DAPM_PGA("Mic PGA", AC97_INT_PAGING, 0, 1, NULL, 0),
+SND_SOC_DAPM_PGA("Differential Mic", SND_SOC_NOPM, 0, 0, NULL, 0),
 SND_SOC_DAPM_MICBIAS("Mic Bias", AC97_INT_PAGING, 10, 1),
 SND_SOC_DAPM_OUTPUT("MONOOUT"),
 SND_SOC_DAPM_OUTPUT("HPOUTL"),
@@ -379,6 +382,18 @@
 	{"Mic PGA", NULL, "MIC1"},
 	{"Mic PGA", NULL, "MIC2"},
 
+	/* microphones */
+	{"Differential Mic", NULL, "MIC1"},
+	{"Differential Mic", NULL, "MIC2"},
+	{"Left Mic Select Source", "Mic 1", "MIC1"},
+	{"Left Mic Select Source", "Mic 2", "MIC2"},
+	{"Left Mic Select Source", "Stereo", "MIC1"},
+	{"Left Mic Select Source", "Differential", "Differential Mic"},
+	{"Right Mic Select Source", "Mic 1", "MIC1"},
+	{"Right Mic Select Source", "Mic 2", "MIC2"},
+	{"Right Mic Select Source", "Stereo", "MIC2"},
+	{"Right Mic Select Source", "Differential", "Differential Mic"},
+
 	/* left capture selector */
 	{"Left Capture Select", "Mic", "MIC1"},
 	{"Left Capture Select", "Speaker Mixer", "Speaker Mixer"},
diff -druN linux-libre-3.4.10-gnu/sound/soc/omap/mcbsp.c linux-libre-3.4.11-gnu/sound/soc/omap/mcbsp.c
--- linux-libre-3.4.10-gnu/sound/soc/omap/mcbsp.c	2012-08-26 18:02:10.000000000 -0400
+++ linux-libre-3.4.11-gnu/sound/soc/omap/mcbsp.c	2012-09-14 18:18:55.000000000 -0400
@@ -691,7 +691,7 @@
 {
 	const char *signal, *src;
 
-	if (mcbsp->pdata->mux_signal)
+	if (!mcbsp->pdata->mux_signal)
 		return -EINVAL;
 
 	switch (mux) {
