diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arc/kernel/ctx_sw_asm.S linux-libre-3.15.5-gnu/arch/arc/kernel/ctx_sw_asm.S
--- linux-libre-3.15.4-gnu/arch/arc/kernel/ctx_sw_asm.S	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arc/kernel/ctx_sw_asm.S	2014-07-09 14:21:40.000000000 -0400
@@ -10,9 +10,9 @@
  *  -This is the more "natural" hand written assembler
  */
 
+#include <linux/linkage.h>
 #include <asm/entry.h>       /* For the SAVE_* macros */
 #include <asm/asm-offsets.h>
-#include <asm/linkage.h>
 
 #define KSP_WORD_OFF 	((TASK_THREAD + THREAD_KSP) / 4)
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-380.dtsi linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-380.dtsi
--- linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-380.dtsi	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-380.dtsi	2014-07-09 14:21:40.000000000 -0400
@@ -16,7 +16,7 @@
 
 / {
 	model = "Marvell Armada 380 family SoC";
-	compatible = "marvell,armada380", "marvell,armada38x";
+	compatible = "marvell,armada380";
 
 	cpus {
 		#address-cells = <1>;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385-db.dts linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385-db.dts
--- linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385-db.dts	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385-db.dts	2014-07-09 14:21:40.000000000 -0400
@@ -16,7 +16,7 @@
 
 / {
 	model = "Marvell Armada 385 Development Board";
-	compatible = "marvell,a385-db", "marvell,armada385", "marvell,armada38x";
+	compatible = "marvell,a385-db", "marvell,armada385", "marvell,armada380";
 
 	chosen {
 		bootargs = "console=ttyS0,115200 earlyprintk";
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385.dtsi linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385.dtsi
--- linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385.dtsi	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385.dtsi	2014-07-09 14:21:40.000000000 -0400
@@ -16,7 +16,7 @@
 
 / {
 	model = "Marvell Armada 385 family SoC";
-	compatible = "marvell,armada385", "marvell,armada38x";
+	compatible = "marvell,armada385", "marvell,armada380";
 
 	cpus {
 		#address-cells = <1>;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385-rd.dts linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385-rd.dts
--- linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-385-rd.dts	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-385-rd.dts	2014-07-09 14:21:40.000000000 -0400
@@ -17,7 +17,7 @@
 
 / {
 	model = "Marvell Armada 385 Reference Design";
-	compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada38x";
+	compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada380";
 
 	chosen {
 		bootargs = "console=ttyS0,115200 earlyprintk";
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-38x.dtsi linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-38x.dtsi
--- linux-libre-3.15.4-gnu/arch/arm/boot/dts/armada-38x.dtsi	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/boot/dts/armada-38x.dtsi	2014-07-09 14:21:40.000000000 -0400
@@ -20,7 +20,7 @@
 
 / {
 	model = "Marvell Armada 38x family SoC";
-	compatible = "marvell,armada38x";
+	compatible = "marvell,armada380";
 
 	aliases {
 		gpio0 = &gpio0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm/mach-omap2/mux.c linux-libre-3.15.5-gnu/arch/arm/mach-omap2/mux.c
--- linux-libre-3.15.4-gnu/arch/arm/mach-omap2/mux.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm/mach-omap2/mux.c	2014-07-09 14:21:40.000000000 -0400
@@ -183,8 +183,10 @@ static int __init _omap_mux_get_by_name(
 		m0_entry = mux->muxnames[0];
 
 		/* First check for full name in mode0.muxmode format */
-		if (mode0_len && strncmp(muxname, m0_entry, mode0_len))
-			continue;
+		if (mode0_len)
+			if (strncmp(muxname, m0_entry, mode0_len) ||
+			    (strlen(m0_entry) != mode0_len))
+				continue;
 
 		/* Then check for muxmode only */
 		for (i = 0; i < OMAP_MUX_NR_MODES; i++) {
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm64/kernel/entry.S linux-libre-3.15.5-gnu/arch/arm64/kernel/entry.S
--- linux-libre-3.15.4-gnu/arch/arm64/kernel/entry.S	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm64/kernel/entry.S	2014-07-09 14:21:40.000000000 -0400
@@ -275,7 +275,6 @@ el1_sp_pc:
 	 * Stack or PC alignment exception handling
 	 */
 	mrs	x0, far_el1
-	mov	x1, x25
 	mov	x2, sp
 	b	do_sp_pc_abort
 el1_undef:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/arm64/mm/flush.c linux-libre-3.15.5-gnu/arch/arm64/mm/flush.c
--- linux-libre-3.15.4-gnu/arch/arm64/mm/flush.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/arm64/mm/flush.c	2014-07-09 14:21:40.000000000 -0400
@@ -79,7 +79,8 @@ void __sync_icache_dcache(pte_t pte, uns
 		return;
 
 	if (!test_and_set_bit(PG_dcache_clean, &page->flags)) {
-		__flush_dcache_area(page_address(page), PAGE_SIZE);
+		__flush_dcache_area(page_address(page),
+				PAGE_SIZE << compound_order(page));
 		__flush_icache_all();
 	} else if (icache_is_aivivt()) {
 		__flush_icache_all();
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/ia64/include/uapi/asm/fcntl.h linux-libre-3.15.5-gnu/arch/ia64/include/uapi/asm/fcntl.h
--- linux-libre-3.15.4-gnu/arch/ia64/include/uapi/asm/fcntl.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/ia64/include/uapi/asm/fcntl.h	2014-07-09 14:21:40.000000000 -0400
@@ -8,6 +8,7 @@
 #define force_o_largefile()	\
 		(personality(current->personality) != PER_LINUX32)
 
+#include <linux/personality.h>
 #include <asm-generic/fcntl.h>
 
 #endif /* _ASM_IA64_FCNTL_H */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/unicore32/mm/alignment.c linux-libre-3.15.5-gnu/arch/unicore32/mm/alignment.c
--- linux-libre-3.15.4-gnu/arch/unicore32/mm/alignment.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/unicore32/mm/alignment.c	2014-07-09 14:21:40.000000000 -0400
@@ -21,6 +21,7 @@
 #include <linux/sched.h>
 #include <linux/uaccess.h>
 
+#include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/unaligned.h>
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/x86/include/asm/kvm_host.h linux-libre-3.15.5-gnu/arch/x86/include/asm/kvm_host.h
--- linux-libre-3.15.4-gnu/arch/x86/include/asm/kvm_host.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/x86/include/asm/kvm_host.h	2014-07-09 14:21:40.000000000 -0400
@@ -99,7 +99,7 @@ static inline gfn_t gfn_to_index(gfn_t g
 #define KVM_REFILL_PAGES 25
 #define KVM_MAX_CPUID_ENTRIES 80
 #define KVM_NR_FIXED_MTRR_REGION 88
-#define KVM_NR_VAR_MTRR 8
+#define KVM_NR_VAR_MTRR 10
 
 #define ASYNC_PF_PER_VCPU 64
 
@@ -466,7 +466,7 @@ struct kvm_vcpu_arch {
 	bool nmi_injected;    /* Trying to inject an NMI this entry */
 
 	struct mtrr_state_type mtrr_state;
-	u32 pat;
+	u64 pat;
 
 	unsigned switch_db_regs;
 	unsigned long db[KVM_NR_DB_REGS];
diff -druNp --no-dereference linux-libre-3.15.4-gnu/arch/x86/kvm/x86.c linux-libre-3.15.5-gnu/arch/x86/kvm/x86.c
--- linux-libre-3.15.4-gnu/arch/x86/kvm/x86.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/arch/x86/kvm/x86.c	2014-07-09 14:21:40.000000000 -0400
@@ -1912,7 +1912,7 @@ static int set_msr_hyperv_pw(struct kvm_
 		if (!(data & HV_X64_MSR_TSC_REFERENCE_ENABLE))
 			break;
 		gfn = data >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT;
-		if (kvm_write_guest(kvm, data,
+		if (kvm_write_guest(kvm, gfn << HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT,
 			&tsc_ref, sizeof(tsc_ref)))
 			return 1;
 		mark_page_dirty(kvm, gfn);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/block/blk-cgroup.c linux-libre-3.15.5-gnu/block/blk-cgroup.c
--- linux-libre-3.15.4-gnu/block/blk-cgroup.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/block/blk-cgroup.c	2014-07-09 14:21:40.000000000 -0400
@@ -80,7 +80,7 @@ static struct blkcg_gq *blkg_alloc(struc
 	blkg->q = q;
 	INIT_LIST_HEAD(&blkg->q_node);
 	blkg->blkcg = blkcg;
-	blkg->refcnt = 1;
+	atomic_set(&blkg->refcnt, 1);
 
 	/* root blkg uses @q->root_rl, init rl only for !root blkgs */
 	if (blkcg != &blkcg_root) {
@@ -399,11 +399,8 @@ void __blkg_release_rcu(struct rcu_head
 
 	/* release the blkcg and parent blkg refs this blkg has been holding */
 	css_put(&blkg->blkcg->css);
-	if (blkg->parent) {
-		spin_lock_irq(blkg->q->queue_lock);
+	if (blkg->parent)
 		blkg_put(blkg->parent);
-		spin_unlock_irq(blkg->q->queue_lock);
-	}
 
 	blkg_free(blkg);
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/block/blk-cgroup.h linux-libre-3.15.5-gnu/block/blk-cgroup.h
--- linux-libre-3.15.4-gnu/block/blk-cgroup.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/block/blk-cgroup.h	2014-07-09 14:21:40.000000000 -0400
@@ -18,6 +18,7 @@
 #include <linux/seq_file.h>
 #include <linux/radix-tree.h>
 #include <linux/blkdev.h>
+#include <linux/atomic.h>
 
 /* Max limits for throttle policy */
 #define THROTL_IOPS_MAX		UINT_MAX
@@ -104,7 +105,7 @@ struct blkcg_gq {
 	struct request_list		rl;
 
 	/* reference count */
-	int				refcnt;
+	atomic_t			refcnt;
 
 	/* is this blkg online? protected by both blkcg and q locks */
 	bool				online;
@@ -257,13 +258,12 @@ static inline int blkg_path(struct blkcg
  * blkg_get - get a blkg reference
  * @blkg: blkg to get
  *
- * The caller should be holding queue_lock and an existing reference.
+ * The caller should be holding an existing reference.
  */
 static inline void blkg_get(struct blkcg_gq *blkg)
 {
-	lockdep_assert_held(blkg->q->queue_lock);
-	WARN_ON_ONCE(!blkg->refcnt);
-	blkg->refcnt++;
+	WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0);
+	atomic_inc(&blkg->refcnt);
 }
 
 void __blkg_release_rcu(struct rcu_head *rcu);
@@ -271,14 +271,11 @@ void __blkg_release_rcu(struct rcu_head
 /**
  * blkg_put - put a blkg reference
  * @blkg: blkg to put
- *
- * The caller should be holding queue_lock.
  */
 static inline void blkg_put(struct blkcg_gq *blkg)
 {
-	lockdep_assert_held(blkg->q->queue_lock);
-	WARN_ON_ONCE(blkg->refcnt <= 0);
-	if (!--blkg->refcnt)
+	WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0);
+	if (atomic_dec_and_test(&blkg->refcnt))
 		call_rcu(&blkg->rcu_head, __blkg_release_rcu);
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/Documentation/devicetree/bindings/arm/armada-38x.txt linux-libre-3.15.5-gnu/Documentation/devicetree/bindings/arm/armada-38x.txt
--- linux-libre-3.15.4-gnu/Documentation/devicetree/bindings/arm/armada-38x.txt	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/Documentation/devicetree/bindings/arm/armada-38x.txt	2014-07-09 14:21:40.000000000 -0400
@@ -6,5 +6,15 @@ following property:
 
 Required root node property:
 
- - compatible: must contain either "marvell,armada380" or
-   "marvell,armada385" depending on the variant of the SoC being used.
+ - compatible: must contain "marvell,armada380"
+
+In addition, boards using the Marvell Armada 385 SoC shall have the
+following property before the previous one:
+
+Required root node property:
+
+compatible: must contain "marvell,armada385"
+
+Example:
+
+compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada380";
diff -druNp --no-dereference linux-libre-3.15.4-gnu/Documentation/sysctl/vm.txt linux-libre-3.15.5-gnu/Documentation/sysctl/vm.txt
--- linux-libre-3.15.4-gnu/Documentation/sysctl/vm.txt	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/Documentation/sysctl/vm.txt	2014-07-09 14:21:40.000000000 -0400
@@ -702,7 +702,8 @@ The batch value of each per cpu pagelist
 set to pcp->high/4.  The upper limit of batch is (PAGE_SHIFT * 8)
 
 The initial value is zero.  Kernel does not use this value at boot time to set
-the high water marks for each per cpu page list.
+the high water marks for each per cpu page list.  If the user writes '0' to this
+sysctl, it will revert to this default behavior.
 
 ==============================================================
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/block/rbd.c linux-libre-3.15.5-gnu/drivers/block/rbd.c
--- linux-libre-3.15.4-gnu/drivers/block/rbd.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/block/rbd.c	2014-07-09 14:21:40.000000000 -0400
@@ -1366,6 +1366,14 @@ static bool obj_request_exists_test(stru
 	return test_bit(OBJ_REQ_EXISTS, &obj_request->flags) != 0;
 }
 
+static bool obj_request_overlaps_parent(struct rbd_obj_request *obj_request)
+{
+	struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev;
+
+	return obj_request->img_offset <
+	    round_up(rbd_dev->parent_overlap, rbd_obj_bytes(&rbd_dev->header));
+}
+
 static void rbd_obj_request_get(struct rbd_obj_request *obj_request)
 {
 	dout("%s: obj %p (was %d)\n", __func__, obj_request,
@@ -1382,6 +1390,13 @@ static void rbd_obj_request_put(struct r
 	kref_put(&obj_request->kref, rbd_obj_request_destroy);
 }
 
+static void rbd_img_request_get(struct rbd_img_request *img_request)
+{
+	dout("%s: img %p (was %d)\n", __func__, img_request,
+	     atomic_read(&img_request->kref.refcount));
+	kref_get(&img_request->kref);
+}
+
 static bool img_request_child_test(struct rbd_img_request *img_request);
 static void rbd_parent_request_destroy(struct kref *kref);
 static void rbd_img_request_destroy(struct kref *kref);
@@ -2142,6 +2157,7 @@ static void rbd_img_obj_callback(struct
 	img_request->next_completion = which;
 out:
 	spin_unlock_irq(&img_request->completion_lock);
+	rbd_img_request_put(img_request);
 
 	if (!more)
 		rbd_img_request_complete(img_request);
@@ -2242,6 +2258,7 @@ static int rbd_img_request_fill(struct r
 			goto out_unwind;
 		obj_request->osd_req = osd_req;
 		obj_request->callback = rbd_img_obj_callback;
+		rbd_img_request_get(img_request);
 
 		if (write_request) {
 			osd_req_op_alloc_hint_init(osd_req, which,
@@ -2674,7 +2691,7 @@ static int rbd_img_obj_request_submit(st
 	 */
 	if (!img_request_write_test(img_request) ||
 		!img_request_layered_test(img_request) ||
-		rbd_dev->parent_overlap <= obj_request->img_offset ||
+		!obj_request_overlaps_parent(obj_request) ||
 		((known = obj_request_known_test(obj_request)) &&
 			obj_request_exists_test(obj_request))) {
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/block/zram/zram_drv.c linux-libre-3.15.5-gnu/drivers/block/zram/zram_drv.c
--- linux-libre-3.15.4-gnu/drivers/block/zram/zram_drv.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/block/zram/zram_drv.c	2014-07-09 14:21:40.000000000 -0400
@@ -622,8 +622,10 @@ static void zram_reset_device(struct zra
 	memset(&zram->stats, 0, sizeof(zram->stats));
 
 	zram->disksize = 0;
-	if (reset_capacity)
+	if (reset_capacity) {
 		set_capacity(zram->disk, 0);
+		revalidate_disk(zram->disk);
+	}
 	up_write(&zram->init_lock);
 }
 
@@ -664,6 +666,7 @@ static ssize_t disksize_store(struct dev
 	zram->comp = comp;
 	zram->disksize = disksize;
 	set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
+	revalidate_disk(zram->disk);
 	up_write(&zram->init_lock);
 	return len;
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/clk/qcom/clk-rcg2.c linux-libre-3.15.5-gnu/drivers/clk/qcom/clk-rcg2.c
--- linux-libre-3.15.4-gnu/drivers/clk/qcom/clk-rcg2.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/clk/qcom/clk-rcg2.c	2014-07-09 14:21:40.000000000 -0400
@@ -55,7 +55,7 @@ static int clk_rcg2_is_enabled(struct cl
 	if (ret)
 		return ret;
 
-	return (cmd & CMD_ROOT_OFF) != 0;
+	return (cmd & CMD_ROOT_OFF) == 0;
 }
 
 static u8 clk_rcg2_get_parent(struct clk_hw *hw)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/clk/qcom/mmcc-msm8974.c linux-libre-3.15.5-gnu/drivers/clk/qcom/mmcc-msm8974.c
--- linux-libre-3.15.4-gnu/drivers/clk/qcom/mmcc-msm8974.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/clk/qcom/mmcc-msm8974.c	2014-07-09 14:21:40.000000000 -0400
@@ -169,6 +169,7 @@ static struct clk_pll mmpll0 = {
 	.config_reg = 0x0014,
 	.mode_reg = 0x0000,
 	.status_reg = 0x001c,
+	.status_bit = 17,
         .clkr.hw.init = &(struct clk_init_data){
                 .name = "mmpll0",
                 .parent_names = (const char *[]){ "xo" },
@@ -192,9 +193,10 @@ static struct clk_pll mmpll1 = {
 	.l_reg = 0x0044,
 	.m_reg = 0x0048,
 	.n_reg = 0x004c,
-	.config_reg = 0x0054,
+	.config_reg = 0x0050,
 	.mode_reg = 0x0040,
 	.status_reg = 0x005c,
+	.status_bit = 17,
         .clkr.hw.init = &(struct clk_init_data){
                 .name = "mmpll1",
                 .parent_names = (const char *[]){ "xo" },
@@ -218,7 +220,7 @@ static struct clk_pll mmpll2 = {
 	.l_reg = 0x4104,
 	.m_reg = 0x4108,
 	.n_reg = 0x410c,
-	.config_reg = 0x4114,
+	.config_reg = 0x4110,
 	.mode_reg = 0x4100,
 	.status_reg = 0x411c,
         .clkr.hw.init = &(struct clk_init_data){
@@ -233,9 +235,10 @@ static struct clk_pll mmpll3 = {
 	.l_reg = 0x0084,
 	.m_reg = 0x0088,
 	.n_reg = 0x008c,
-	.config_reg = 0x0094,
+	.config_reg = 0x0090,
 	.mode_reg = 0x0080,
 	.status_reg = 0x009c,
+	.status_bit = 17,
         .clkr.hw.init = &(struct clk_init_data){
                 .name = "mmpll3",
                 .parent_names = (const char *[]){ "xo" },
@@ -2318,7 +2321,7 @@ static const struct pll_config mmpll1_co
 	.vco_val = 0x0,
 	.vco_mask = 0x3 << 20,
 	.pre_div_val = 0x0,
-	.pre_div_mask = 0x3 << 12,
+	.pre_div_mask = 0x7 << 12,
 	.post_div_val = 0x0,
 	.post_div_mask = 0x3 << 8,
 	.mn_ena_mask = BIT(24),
@@ -2332,7 +2335,7 @@ static struct pll_config mmpll3_config =
 	.vco_val = 0x0,
 	.vco_mask = 0x3 << 20,
 	.pre_div_val = 0x0,
-	.pre_div_mask = 0x3 << 12,
+	.pre_div_mask = 0x7 << 12,
 	.post_div_val = 0x0,
 	.post_div_mask = 0x3 << 8,
 	.mn_ena_mask = BIT(24),
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/cpufreq/intel_pstate.c linux-libre-3.15.5-gnu/drivers/cpufreq/intel_pstate.c
--- linux-libre-3.15.4-gnu/drivers/cpufreq/intel_pstate.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/cpufreq/intel_pstate.c	2014-07-09 14:21:40.000000000 -0400
@@ -200,10 +200,7 @@ static signed int pid_calc(struct _pid *
 	pid->last_err = fp_error;
 
 	result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm;
-	if (result >= 0)
-		result = result + (1 << (FRAC_BITS-1));
-	else
-		result = result - (1 << (FRAC_BITS-1));
+	result = result + (1 << (FRAC_BITS-1));
 	return (signed int)fp_toint(result);
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/drm_drv.c linux-libre-3.15.5-gnu/drivers/gpu/drm/drm_drv.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/drm_drv.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/drm_drv.c	2014-07-09 14:21:40.000000000 -0400
@@ -419,8 +419,9 @@ long drm_ioctl(struct file *filp,
 			retcode = -EFAULT;
 			goto err_i1;
 		}
-	} else
+	} else if (cmd & IOC_OUT) {
 		memset(kdata, 0, usize);
+	}
 
 	if (ioctl->flags & DRM_UNLOCKED)
 		retcode = func(dev, kdata, file_priv);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i2c/tda998x_drv.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i2c/tda998x_drv.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i2c/tda998x_drv.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i2c/tda998x_drv.c	2014-07-09 14:21:40.000000000 -0400
@@ -1183,7 +1183,6 @@ static void
 tda998x_encoder_destroy(struct drm_encoder *encoder)
 {
 	struct tda998x_priv *priv = to_tda998x_priv(encoder);
-	drm_i2c_encoder_destroy(encoder);
 
 	/* disable all IRQs and free the IRQ handler */
 	cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
@@ -1193,6 +1192,7 @@ tda998x_encoder_destroy(struct drm_encod
 
 	if (priv->cec)
 		i2c_unregister_device(priv->cec);
+	drm_i2c_encoder_destroy(encoder);
 	kfree(priv);
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_debugfs.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_debugfs.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_debugfs.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_debugfs.c	2014-07-09 14:21:40.000000000 -0400
@@ -446,7 +446,9 @@ static int i915_gem_object_info(struct s
 
 		memset(&stats, 0, sizeof(stats));
 		stats.file_priv = file->driver_priv;
+		spin_lock(&file->table_lock);
 		idr_for_each(&file->object_idr, per_file_stats, &stats);
+		spin_unlock(&file->table_lock);
 		/*
 		 * Although we have a valid reference on file->pid, that does
 		 * not guarantee that the task_struct who called get_pid() is
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_gem_gtt.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_gem_gtt.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_gem_gtt.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_gem_gtt.c	2014-07-09 14:21:40.000000000 -0400
@@ -1811,6 +1811,13 @@ static inline unsigned int gen8_get_tota
 	bdw_gmch_ctl &= BDW_GMCH_GGMS_MASK;
 	if (bdw_gmch_ctl)
 		bdw_gmch_ctl = 1 << bdw_gmch_ctl;
+
+#ifdef CONFIG_X86_32
+	/* Limit 32b platforms to a 2GB GGTT: 4 << 20 / pte size * PAGE_SIZE */
+	if (bdw_gmch_ctl > 4)
+		bdw_gmch_ctl = 4;
+#endif
+
 	return bdw_gmch_ctl << 20;
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_gpu_error.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_gpu_error.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_gpu_error.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_gpu_error.c	2014-07-09 14:21:40.000000000 -0400
@@ -894,6 +894,8 @@ static void i915_gem_record_rings(struct
 	for (i = 0; i < I915_NUM_RINGS; i++) {
 		struct intel_ring_buffer *ring = &dev_priv->ring[i];
 
+		error->ring[i].pid = -1;
+
 		if (ring->dev == NULL)
 			continue;
 
@@ -901,7 +903,6 @@ static void i915_gem_record_rings(struct
 
 		i915_record_ring_state(dev, ring, &error->ring[i]);
 
-		error->ring[i].pid = -1;
 		request = i915_gem_find_active_request(ring);
 		if (request) {
 			/* We need to copy these to an anonymous buffer
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_irq.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_irq.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/i915_irq.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/i915_irq.c	2014-07-09 14:21:40.000000000 -0400
@@ -2561,10 +2561,14 @@ static int semaphore_passed(struct intel
 	struct intel_ring_buffer *signaller;
 	u32 seqno, ctl;
 
-	ring->hangcheck.deadlock = true;
+	ring->hangcheck.deadlock++;
 
 	signaller = semaphore_waits_for(ring, &seqno);
-	if (signaller == NULL || signaller->hangcheck.deadlock)
+	if (signaller == NULL)
+		return -1;
+
+	/* Prevent pathological recursion due to driver bugs */
+	if (signaller->hangcheck.deadlock >= I915_NUM_RINGS)
 		return -1;
 
 	/* cursory check for an unkickable deadlock */
@@ -2572,7 +2576,13 @@ static int semaphore_passed(struct intel
 	if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0)
 		return -1;
 
-	return i915_seqno_passed(signaller->get_seqno(signaller, false), seqno);
+	if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno))
+		return 1;
+
+	if (signaller->hangcheck.deadlock)
+		return -1;
+
+	return 0;
 }
 
 static void semaphore_clear_deadlocks(struct drm_i915_private *dev_priv)
@@ -2581,7 +2591,7 @@ static void semaphore_clear_deadlocks(st
 	int i;
 
 	for_each_ring(ring, dev_priv, i)
-		ring->hangcheck.deadlock = false;
+		ring->hangcheck.deadlock = 0;
 }
 
 static enum intel_ring_hangcheck_action
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_bios.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_bios.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_bios.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_bios.c	2014-07-09 14:21:40.000000000 -0400
@@ -287,9 +287,6 @@ parse_lfp_backlight(struct drm_i915_priv
 	const struct bdb_lfp_backlight_data *backlight_data;
 	const struct bdb_lfp_backlight_data_entry *entry;
 
-	/* Err to enabling backlight if no backlight block. */
-	dev_priv->vbt.backlight.present = true;
-
 	backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
 	if (!backlight_data)
 		return;
@@ -839,6 +836,9 @@ init_vbt_defaults(struct drm_i915_privat
 
 	dev_priv->vbt.crt_ddc_pin = GMBUS_PORT_VGADDC;
 
+	/* Default to having backlight */
+	dev_priv->vbt.backlight.present = true;
+
 	/* LFP panel data */
 	dev_priv->vbt.lvds_dither = 1;
 	dev_priv->vbt.lvds_vbt = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_panel.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_panel.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_panel.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_panel.c	2014-07-09 14:21:40.000000000 -0400
@@ -723,9 +723,6 @@ static void i965_enable_backlight(struct
 	ctl = freq << 16;
 	I915_WRITE(BLC_PWM_CTL, ctl);
 
-	/* XXX: combine this into above write? */
-	intel_panel_actually_set_backlight(connector, panel->backlight.level);
-
 	ctl2 = BLM_PIPE(pipe);
 	if (panel->backlight.combination_mode)
 		ctl2 |= BLM_COMBINATION_MODE;
@@ -734,6 +731,8 @@ static void i965_enable_backlight(struct
 	I915_WRITE(BLC_PWM_CTL2, ctl2);
 	POSTING_READ(BLC_PWM_CTL2);
 	I915_WRITE(BLC_PWM_CTL2, ctl2 | BLM_PWM_ENABLE);
+
+	intel_panel_actually_set_backlight(connector, panel->backlight.level);
 }
 
 static void vlv_enable_backlight(struct intel_connector *connector)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_pm.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_pm.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_pm.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_pm.c	2014-07-09 14:21:40.000000000 -0400
@@ -511,8 +511,7 @@ void intel_update_fbc(struct drm_device
 	obj = intel_fb->obj;
 	adjusted_mode = &intel_crtc->config.adjusted_mode;
 
-	if (i915.enable_fbc < 0 &&
-	    INTEL_INFO(dev)->gen <= 7 && !IS_HASWELL(dev)) {
+	if (i915.enable_fbc < 0) {
 		if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
 			DRM_DEBUG_KMS("disabled per chip default\n");
 		goto out_disable;
@@ -5314,10 +5313,25 @@ bool intel_display_power_enabled_sw(stru
 				    enum intel_display_power_domain domain)
 {
 	struct i915_power_domains *power_domains;
+	struct i915_power_well *power_well;
+	bool is_enabled;
+	int i;
+
+	if (dev_priv->pm.suspended)
+		return false;
 
 	power_domains = &dev_priv->power_domains;
+	is_enabled = true;
+	for_each_power_well_rev(i, power_well, BIT(domain), power_domains) {
+		if (power_well->always_on)
+			continue;
 
-	return power_domains->domain_use_count[domain];
+		if (!power_well->count) {
+			is_enabled = false;
+			break;
+		}
+	}
+	return is_enabled;
 }
 
 bool intel_display_power_enabled(struct drm_i915_private *dev_priv,
@@ -5706,33 +5720,56 @@ void intel_display_power_put(struct drm_
 static struct i915_power_domains *hsw_pwr;
 
 /* Display audio driver power well request */
-void i915_request_power_well(void)
+int i915_request_power_well(void)
 {
 	struct drm_i915_private *dev_priv;
 
-	if (WARN_ON(!hsw_pwr))
-		return;
+	if (!hsw_pwr)
+		return -ENODEV;
 
 	dev_priv = container_of(hsw_pwr, struct drm_i915_private,
 				power_domains);
 	intel_display_power_get(dev_priv, POWER_DOMAIN_AUDIO);
+	return 0;
 }
 EXPORT_SYMBOL_GPL(i915_request_power_well);
 
 /* Display audio driver power well release */
-void i915_release_power_well(void)
+int i915_release_power_well(void)
 {
 	struct drm_i915_private *dev_priv;
 
-	if (WARN_ON(!hsw_pwr))
-		return;
+	if (!hsw_pwr)
+		return -ENODEV;
 
 	dev_priv = container_of(hsw_pwr, struct drm_i915_private,
 				power_domains);
 	intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO);
+	return 0;
 }
 EXPORT_SYMBOL_GPL(i915_release_power_well);
 
+/*
+ * Private interface for the audio driver to get CDCLK in kHz.
+ *
+ * Caller must request power well using i915_request_power_well() prior to
+ * making the call.
+ */
+int i915_get_cdclk_freq(void)
+{
+	struct drm_i915_private *dev_priv;
+
+	if (!hsw_pwr)
+		return -ENODEV;
+
+	dev_priv = container_of(hsw_pwr, struct drm_i915_private,
+				power_domains);
+
+	return intel_ddi_get_cdclk_freq(dev_priv);
+}
+EXPORT_SYMBOL_GPL(i915_get_cdclk_freq);
+
+
 #define POWER_DOMAIN_MASK (BIT(POWER_DOMAIN_NUM) - 1)
 
 #define HSW_ALWAYS_ON_POWER_DOMAINS (			\
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_ringbuffer.h linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_ringbuffer.h
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_ringbuffer.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_ringbuffer.h	2014-07-09 14:21:40.000000000 -0400
@@ -51,7 +51,7 @@ struct intel_ring_hangcheck {
 	u32 seqno;
 	int score;
 	enum intel_ring_hangcheck_action action;
-	bool deadlock;
+	int deadlock;
 };
 
 struct  intel_ring_buffer {
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_sdvo.c linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_sdvo.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/i915/intel_sdvo.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/i915/intel_sdvo.c	2014-07-09 14:21:40.000000000 -0400
@@ -1383,7 +1383,9 @@ static void intel_sdvo_get_config(struct
 			 >> SDVO_PORT_MULTIPLY_SHIFT) + 1;
 	}
 
-	dotclock = pipe_config->port_clock / pipe_config->pixel_multiplier;
+	dotclock = pipe_config->port_clock;
+	if (pipe_config->pixel_multiplier)
+		dotclock /= pipe_config->pixel_multiplier;
 
 	if (HAS_PCH_SPLIT(dev))
 		ironlake_check_encoder_dotclock(pipe_config, dotclock);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/engine/disp/nv04.c	2014-07-09 14:21:40.000000000 -0400
@@ -51,6 +51,14 @@ nv04_disp_scanoutpos(struct nouveau_obje
 	args->htotal  = nv_rd32(priv, 0x680824 + (head * 0x2000)) & 0xffff;
 	args->hblanke = args->htotal - 1;
 
+	/*
+	 * If output is vga instead of digital then vtotal/htotal is invalid
+	 * so we have to give up and trigger the timestamping fallback in the
+	 * drm core.
+	 */
+	if (!args->vtotal || !args->htotal)
+		return -ENOTSUPP;
+
 	args->time[0] = ktime_to_ns(ktime_get());
 	line = nv_rd32(priv, 0x600868 + (head * 0x2000));
 	args->time[1] = ktime_to_ns(ktime_get());
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/engine/graph/ctxnv108.c	2014-07-09 14:21:40.000000000 -0400
@@ -545,10 +545,12 @@ nv108_grctx_generate_mods(struct nvc0_gr
 	mmio_list(0x408010, 0x80000000,  0, 0);
 	mmio_list(0x419004, 0x00000000,  8, 1);
 	mmio_list(0x419008, 0x00000000,  0, 0);
+	mmio_list(0x4064cc, 0x80000000,  0, 0);
 	mmio_list(0x408004, 0x00000000,  8, 0);
 	mmio_list(0x408008, 0x80000030,  0, 0);
 	mmio_list(0x418808, 0x00000000,  8, 0);
 	mmio_list(0x41880c, 0x80000030,  0, 0);
+	mmio_list(0x4064c8, 0x00c20200,  0, 0);
 	mmio_list(0x418810, 0x80000000, 12, 2);
 	mmio_list(0x419848, 0x10000000, 12, 2);
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c	2014-07-09 14:21:40.000000000 -0400
@@ -26,6 +26,7 @@
 
 const struct nouveau_mc_intr
 nv50_mc_intr[] = {
+	{ 0x04000000, NVDEV_ENGINE_DISP },  /* DISP before FIFO, so pageflip-timestamping works! */
 	{ 0x00000001, NVDEV_ENGINE_MPEG },
 	{ 0x00000100, NVDEV_ENGINE_FIFO },
 	{ 0x00001000, NVDEV_ENGINE_GR },
@@ -34,7 +35,6 @@ nv50_mc_intr[] = {
 	{ 0x00020000, NVDEV_ENGINE_VP },	/* NV84- */
 	{ 0x00100000, NVDEV_SUBDEV_TIMER },
 	{ 0x00200000, NVDEV_SUBDEV_GPIO },
-	{ 0x04000000, NVDEV_ENGINE_DISP },
 	{ 0x10000000, NVDEV_SUBDEV_BUS },
 	{ 0x80000000, NVDEV_ENGINE_SW },
 	{ 0x0002d101, NVDEV_SUBDEV_FB },
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nv98.c	2014-07-09 14:21:40.000000000 -0400
@@ -26,6 +26,7 @@
 
 static const struct nouveau_mc_intr
 nv98_mc_intr[] = {
+	{ 0x04000000, NVDEV_ENGINE_DISP },  /* DISP first, so pageflip timestamps work */
 	{ 0x00000001, NVDEV_ENGINE_PPP },
 	{ 0x00000100, NVDEV_ENGINE_FIFO },
 	{ 0x00001000, NVDEV_ENGINE_GR },
@@ -37,7 +38,6 @@ nv98_mc_intr[] = {
 	{ 0x00100000, NVDEV_SUBDEV_TIMER },
 	{ 0x00200000, NVDEV_SUBDEV_GPIO },
 	{ 0x00400000, NVDEV_ENGINE_COPY0 },	/* NVA3-     */
-	{ 0x04000000, NVDEV_ENGINE_DISP },
 	{ 0x10000000, NVDEV_SUBDEV_BUS },
 	{ 0x80000000, NVDEV_ENGINE_SW },
 	{ 0x0042d101, NVDEV_SUBDEV_FB },
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/core/subdev/mc/nvc0.c	2014-07-09 14:21:40.000000000 -0400
@@ -26,6 +26,7 @@
 
 const struct nouveau_mc_intr
 nvc0_mc_intr[] = {
+	{ 0x04000000, NVDEV_ENGINE_DISP },  /* DISP first, so pageflip timestamps work. */
 	{ 0x00000001, NVDEV_ENGINE_PPP },
 	{ 0x00000020, NVDEV_ENGINE_COPY0 },
 	{ 0x00000040, NVDEV_ENGINE_COPY1 },
@@ -40,7 +41,6 @@ nvc0_mc_intr[] = {
 	{ 0x00200000, NVDEV_SUBDEV_GPIO },
 	{ 0x01000000, NVDEV_SUBDEV_PWR },
 	{ 0x02000000, NVDEV_SUBDEV_LTCG },
-	{ 0x04000000, NVDEV_ENGINE_DISP },
 	{ 0x08000000, NVDEV_SUBDEV_FB },
 	{ 0x10000000, NVDEV_SUBDEV_BUS },
 	{ 0x40000000, NVDEV_SUBDEV_IBUS },
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/nouveau_display.c linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/nouveau_display.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/nouveau/nouveau_display.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/nouveau/nouveau_display.c	2014-07-09 14:21:40.000000000 -0400
@@ -736,6 +736,9 @@ nouveau_crtc_page_flip(struct drm_crtc *
 		  fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y,
 		  new_bo->bo.offset };
 
+	/* Keep vblanks on during flip, for the target crtc of this flip */
+	drm_vblank_get(dev, nouveau_crtc(crtc)->index);
+
 	/* Emit a page flip */
 	if (nv_device(drm->device)->card_type >= NV_50) {
 		ret = nv50_display_flip_next(crtc, fb, chan, swap_interval);
@@ -779,6 +782,7 @@ nouveau_crtc_page_flip(struct drm_crtc *
 	return 0;
 
 fail_unreserve:
+	drm_vblank_put(dev, nouveau_crtc(crtc)->index);
 	ttm_bo_unreserve(&old_bo->bo);
 fail_unpin:
 	mutex_unlock(&chan->cli->mutex);
@@ -798,6 +802,7 @@ nouveau_finish_page_flip(struct nouveau_
 	struct drm_device *dev = drm->dev;
 	struct nouveau_page_flip_state *s;
 	unsigned long flags;
+	int crtcid = -1;
 
 	spin_lock_irqsave(&dev->event_lock, flags);
 
@@ -808,8 +813,16 @@ nouveau_finish_page_flip(struct nouveau_
 	}
 
 	s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head);
-	if (s->event)
-		drm_send_vblank_event(dev, s->crtc, s->event);
+	if (s->event) {
+		/* Vblank timestamps/counts are only correct on >= NV-50 */
+		if (nv_device(drm->device)->card_type >= NV_50)
+			crtcid = s->crtc;
+
+		drm_send_vblank_event(dev, crtcid, s->event);
+	}
+
+	/* Give up ownership of vblank for page-flipped crtc */
+	drm_vblank_put(dev, s->crtc);
 
 	list_del(&s->head);
 	if (ps)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_crtc.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_crtc.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_crtc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_crtc.c	2014-07-09 14:21:40.000000000 -0400
@@ -862,14 +862,16 @@ static void atombios_crtc_program_pll(st
 			args.v5.ucMiscInfo = 0; /* HDMI depth, etc. */
 			if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
 				args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_REF_DIV_SRC;
-			switch (bpc) {
-			case 8:
-			default:
-				args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP;
-				break;
-			case 10:
-				args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP;
-				break;
+			if (encoder_mode == ATOM_ENCODER_MODE_HDMI) {
+				switch (bpc) {
+				case 8:
+				default:
+					args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP;
+					break;
+				case 10:
+					args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP;
+					break;
+				}
 			}
 			args.v5.ucTransmitterID = encoder_id;
 			args.v5.ucEncoderMode = encoder_mode;
@@ -884,20 +886,22 @@ static void atombios_crtc_program_pll(st
 			args.v6.ucMiscInfo = 0; /* HDMI depth, etc. */
 			if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK))
 				args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_REF_DIV_SRC;
-			switch (bpc) {
-			case 8:
-			default:
-				args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP;
-				break;
-			case 10:
-				args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP;
-				break;
-			case 12:
-				args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP;
-				break;
-			case 16:
-				args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP;
-				break;
+			if (encoder_mode == ATOM_ENCODER_MODE_HDMI) {
+				switch (bpc) {
+				case 8:
+				default:
+					args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP;
+					break;
+				case 10:
+					args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP;
+					break;
+				case 12:
+					args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP;
+					break;
+				case 16:
+					args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP;
+					break;
+				}
 			}
 			args.v6.ucTransmitterID = encoder_id;
 			args.v6.ucEncoderMode = encoder_mode;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_dp.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_dp.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_dp.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_dp.c	2014-07-09 14:21:40.000000000 -0400
@@ -281,6 +281,19 @@ static int dp_get_max_dp_pix_clock(int l
 
 /***** radeon specific DP functions *****/
 
+static int radeon_dp_get_max_link_rate(struct drm_connector *connector,
+				       u8 dpcd[DP_DPCD_SIZE])
+{
+	int max_link_rate;
+
+	if (radeon_connector_is_dp12_capable(connector))
+		max_link_rate = min(drm_dp_max_link_rate(dpcd), 540000);
+	else
+		max_link_rate = min(drm_dp_max_link_rate(dpcd), 270000);
+
+	return max_link_rate;
+}
+
 /* First get the min lane# when low rate is used according to pixel clock
  * (prefer low rate), second check max lane# supported by DP panel,
  * if the max lane# < low rate lane# then use max lane# instead.
@@ -290,7 +303,7 @@ static int radeon_dp_get_dp_lane_number(
 					int pix_clock)
 {
 	int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector));
-	int max_link_rate = drm_dp_max_link_rate(dpcd);
+	int max_link_rate = radeon_dp_get_max_link_rate(connector, dpcd);
 	int max_lane_num = drm_dp_max_lane_count(dpcd);
 	int lane_num;
 	int max_dp_pix_clock;
@@ -328,7 +341,7 @@ static int radeon_dp_get_dp_link_clock(s
 			return 540000;
 	}
 
-	return drm_dp_max_link_rate(dpcd);
+	return radeon_dp_get_max_link_rate(connector, dpcd);
 }
 
 static u8 radeon_dp_encoder_service(struct radeon_device *rdev,
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_encoders.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_encoders.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/atombios_encoders.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/atombios_encoders.c	2014-07-09 14:21:40.000000000 -0400
@@ -1884,8 +1884,11 @@ atombios_set_encoder_crtc_source(struct
 					args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT;
 				else
 					args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);
-			} else
+			} else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
+				args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS;
+			} else {
 				args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder);
+			}
 			switch (radeon_encoder->encoder_id) {
 			case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
 			case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/cikd.h linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/cikd.h
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/cikd.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/cikd.h	2014-07-09 14:21:40.000000000 -0400
@@ -1751,12 +1751,12 @@
 #define		EOP_TC_WB_ACTION_EN                     (1 << 15) /* L2 */
 #define		EOP_TCL1_ACTION_EN                      (1 << 16)
 #define		EOP_TC_ACTION_EN                        (1 << 17) /* L2 */
+#define		EOP_TCL2_VOLATILE                       (1 << 24)
 #define		EOP_CACHE_POLICY(x)                     ((x) << 25)
                 /* 0 - LRU
 		 * 1 - Stream
 		 * 2 - Bypass
 		 */
-#define		EOP_TCL2_VOLATILE                       (1 << 27)
 #define		DATA_SEL(x)                             ((x) << 29)
                 /* 0 - discard
 		 * 1 - send low 32bit data
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/cypress_dpm.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/cypress_dpm.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/cypress_dpm.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/cypress_dpm.c	2014-07-09 14:21:40.000000000 -0400
@@ -1551,7 +1551,7 @@ int cypress_populate_smc_voltage_tables(
 
 		table->voltageMaskTable.highMask[RV770_SMC_VOLTAGEMASK_VDDCI] = 0;
 		table->voltageMaskTable.lowMask[RV770_SMC_VOLTAGEMASK_VDDCI] =
-			cpu_to_be32(eg_pi->vddc_voltage_table.mask_low);
+			cpu_to_be32(eg_pi->vddci_voltage_table.mask_low);
 	}
 
 	return 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/ni_dpm.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/ni_dpm.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/ni_dpm.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/ni_dpm.c	2014-07-09 14:21:40.000000000 -0400
@@ -1315,7 +1315,7 @@ static void ni_populate_smc_voltage_tabl
 
 		table->voltageMaskTable.highMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] = 0;
 		table->voltageMaskTable.lowMask[NISLANDS_SMC_VOLTAGEMASK_VDDCI] =
-			cpu_to_be32(eg_pi->vddc_voltage_table.mask_low);
+			cpu_to_be32(eg_pi->vddci_voltage_table.mask_low);
 	}
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/radeon_connectors.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/radeon_connectors.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/radeon_connectors.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/radeon_connectors.c	2014-07-09 14:21:40.000000000 -0400
@@ -1387,7 +1387,7 @@ bool radeon_connector_is_dp12_capable(st
 	struct radeon_device *rdev = dev->dev_private;
 
 	if (ASIC_IS_DCE5(rdev) &&
-	    (rdev->clock.dp_extclk >= 53900) &&
+	    (rdev->clock.default_dispclk >= 53900) &&
 	    radeon_connector_encoder_is_hbr2(connector)) {
 		return true;
 	}
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/radeon_vce.c linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/radeon_vce.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/radeon/radeon_vce.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/radeon/radeon_vce.c	2014-07-09 14:21:40.000000000 -0400
@@ -66,6 +66,7 @@ int radeon_vce_init(struct radeon_device
 	case CHIP_BONAIRE:
 	case CHIP_KAVERI:
 	case CHIP_KABINI:
+	case CHIP_HAWAII:
 	case CHIP_MULLINS:
 		fw_name = FIRMWARE_BONAIRE;
 		break;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c linux-libre-3.15.5-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
--- linux-libre-3.15.4-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c	2014-07-09 14:21:40.000000000 -0400
@@ -179,7 +179,6 @@ static int vmw_fb_set_par(struct fb_info
 		vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset);
 		vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres);
 		vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres);
-		vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length);
 		vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
 	}
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/gpu/vga/vga_switcheroo.c linux-libre-3.15.5-gnu/drivers/gpu/vga/vga_switcheroo.c
--- linux-libre-3.15.4-gnu/drivers/gpu/vga/vga_switcheroo.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/gpu/vga/vga_switcheroo.c	2014-07-09 14:21:40.000000000 -0400
@@ -623,7 +623,8 @@ static int vga_switcheroo_runtime_suspen
 	ret = dev->bus->pm->runtime_suspend(dev);
 	if (ret)
 		return ret;
-
+	if (vgasr_priv.handler->switchto)
+		vgasr_priv.handler->switchto(VGA_SWITCHEROO_IGD);
 	vga_switcheroo_power_switch(pdev, VGA_SWITCHEROO_OFF);
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/hwmon/ina2xx.c linux-libre-3.15.5-gnu/drivers/hwmon/ina2xx.c
--- linux-libre-3.15.4-gnu/drivers/hwmon/ina2xx.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/hwmon/ina2xx.c	2014-07-09 14:21:40.000000000 -0400
@@ -148,7 +148,8 @@ static int ina2xx_get_value(struct ina2x
 
 	switch (reg) {
 	case INA2XX_SHUNT_VOLTAGE:
-		val = DIV_ROUND_CLOSEST(data->regs[reg],
+		/* signed register */
+		val = DIV_ROUND_CLOSEST((s16)data->regs[reg],
 					data->config->shunt_div);
 		break;
 	case INA2XX_BUS_VOLTAGE:
@@ -160,8 +161,8 @@ static int ina2xx_get_value(struct ina2x
 		val = data->regs[reg] * data->config->power_lsb;
 		break;
 	case INA2XX_CURRENT:
-		/* LSB=1mA (selected). Is in mA */
-		val = data->regs[reg];
+		/* signed register, LSB=1mA (selected), in mA */
+		val = (s16)data->regs[reg];
 		break;
 	default:
 		/* programmer goofed */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/iio/adc/twl4030-madc.c linux-libre-3.15.5-gnu/drivers/iio/adc/twl4030-madc.c
--- linux-libre-3.15.4-gnu/drivers/iio/adc/twl4030-madc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/iio/adc/twl4030-madc.c	2014-07-09 14:21:40.000000000 -0400
@@ -645,6 +645,7 @@ int twl4030_get_madc_conversion(int chan
 	req.channels = (1 << channel_no);
 	req.method = TWL4030_MADC_SW2;
 	req.active = 0;
+	req.raw = 0;
 	req.func_cb = NULL;
 	ret = twl4030_madc_conversion(&req);
 	if (ret < 0)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/iio/inkern.c linux-libre-3.15.5-gnu/drivers/iio/inkern.c
--- linux-libre-3.15.4-gnu/drivers/iio/inkern.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/iio/inkern.c	2014-07-09 14:21:40.000000000 -0400
@@ -183,7 +183,7 @@ static struct iio_channel *of_iio_channe
 		else if (name && index >= 0) {
 			pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
 				np->full_name, name ? name : "", index);
-			return chan;
+			return NULL;
 		}
 
 		/*
@@ -193,8 +193,9 @@ static struct iio_channel *of_iio_channe
 		 */
 		np = np->parent;
 		if (np && !of_get_property(np, "io-channel-ranges", NULL))
-			break;
+			return NULL;
 	}
+
 	return chan;
 }
 
@@ -317,6 +318,7 @@ struct iio_channel *iio_channel_get(stru
 		if (channel != NULL)
 			return channel;
 	}
+
 	return iio_channel_get_sys(name, channel_name);
 }
 EXPORT_SYMBOL_GPL(iio_channel_get);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/iommu/intel-iommu.c linux-libre-3.15.5-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-3.15.4-gnu/drivers/iommu/intel-iommu.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/iommu/intel-iommu.c	2014-07-09 14:21:40.000000000 -0400
@@ -3799,14 +3799,11 @@ int dmar_iommu_notify_scope_dev(struct d
 				((void *)rmrr) + rmrr->header.length,
 				rmrr->segment, rmrru->devices,
 				rmrru->devices_cnt);
-			if (ret > 0)
-				break;
-			else if(ret < 0)
+			if(ret < 0)
 				return ret;
 		} else if (info->event == BUS_NOTIFY_DEL_DEVICE) {
-			if (dmar_remove_dev_scope(info, rmrr->segment,
-				rmrru->devices, rmrru->devices_cnt))
-				break;
+			dmar_remove_dev_scope(info, rmrr->segment,
+				rmrru->devices, rmrru->devices_cnt);
 		}
 	}
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/irqchip/spear-shirq.c linux-libre-3.15.5-gnu/drivers/irqchip/spear-shirq.c
--- linux-libre-3.15.4-gnu/drivers/irqchip/spear-shirq.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/irqchip/spear-shirq.c	2014-07-09 14:21:40.000000000 -0400
@@ -125,7 +125,7 @@ static struct spear_shirq spear320_shirq
 };
 
 static struct spear_shirq spear320_shirq_ras3 = {
-	.irq_nr = 3,
+	.irq_nr = 7,
 	.irq_bit_off = 0,
 	.invalid_irq = 1,
 	.regs = {
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/md/dm-era-target.c linux-libre-3.15.5-gnu/drivers/md/dm-era-target.c
--- linux-libre-3.15.4-gnu/drivers/md/dm-era-target.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/md/dm-era-target.c	2014-07-09 14:21:40.000000000 -0400
@@ -1391,7 +1391,8 @@ static int era_is_congested(struct dm_ta
 
 static void era_destroy(struct era *era)
 {
-	metadata_close(era->md);
+	if (era->md)
+		metadata_close(era->md);
 
 	if (era->wq)
 		destroy_workqueue(era->wq);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/md/dm-thin.c linux-libre-3.15.5-gnu/drivers/md/dm-thin.c
--- linux-libre-3.15.4-gnu/drivers/md/dm-thin.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/md/dm-thin.c	2014-07-09 14:21:40.000000000 -0400
@@ -3068,7 +3068,8 @@ static void set_discard_limits(struct po
 	 */
 	if (pt->adjusted_pf.discard_passdown) {
 		data_limits = &bdev_get_queue(pt->data_dev->bdev)->limits;
-		limits->discard_granularity = data_limits->discard_granularity;
+		limits->discard_granularity = max(data_limits->discard_granularity,
+						  pool->sectors_per_block << SECTOR_SHIFT);
 	} else
 		limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT;
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/md/md.c linux-libre-3.15.5-gnu/drivers/md/md.c
--- linux-libre-3.15.4-gnu/drivers/md/md.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/md/md.c	2014-07-09 14:21:40.000000000 -0400
@@ -7491,6 +7491,19 @@ void md_do_sync(struct md_thread *thread
 			    rdev->recovery_offset < j)
 				j = rdev->recovery_offset;
 		rcu_read_unlock();
+
+		/* If there is a bitmap, we need to make sure all
+		 * writes that started before we added a spare
+		 * complete before we start doing a recovery.
+		 * Otherwise the write might complete and (via
+		 * bitmap_endwrite) set a bit in the bitmap after the
+		 * recovery has checked that bit and skipped that
+		 * region.
+		 */
+		if (mddev->bitmap) {
+			mddev->pers->quiesce(mddev, 1);
+			mddev->pers->quiesce(mddev, 0);
+		}
 	}
 
 	printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev));
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/mmc/host/rtsx_pci_sdmmc.c linux-libre-3.15.5-gnu/drivers/mmc/host/rtsx_pci_sdmmc.c
--- linux-libre-3.15.4-gnu/drivers/mmc/host/rtsx_pci_sdmmc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/mmc/host/rtsx_pci_sdmmc.c	2014-07-09 14:21:40.000000000 -0400
@@ -236,6 +236,9 @@ static void sd_send_cmd_get_rsp(struct r
 	case MMC_RSP_R1:
 		rsp_type = SD_RSP_TYPE_R1;
 		break;
+	case MMC_RSP_R1 & ~MMC_RSP_CRC:
+		rsp_type = SD_RSP_TYPE_R1 | SD_NO_CHECK_CRC7;
+		break;
 	case MMC_RSP_R1B:
 		rsp_type = SD_RSP_TYPE_R1b;
 		break;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/mtd/nand/fsl_elbc_nand.c linux-libre-3.15.5-gnu/drivers/mtd/nand/fsl_elbc_nand.c
--- linux-libre-3.15.4-gnu/drivers/mtd/nand/fsl_elbc_nand.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/mtd/nand/fsl_elbc_nand.c	2014-07-09 14:21:40.000000000 -0400
@@ -723,6 +723,19 @@ static int fsl_elbc_write_page(struct mt
 	return 0;
 }
 
+/* ECC will be calculated automatically, and errors will be detected in
+ * waitfunc.
+ */
+static int fsl_elbc_write_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+				uint32_t offset, uint32_t data_len,
+				const uint8_t *buf, int oob_required)
+{
+	fsl_elbc_write_buf(mtd, buf, mtd->writesize);
+	fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize);
+
+	return 0;
+}
+
 static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
 {
 	struct fsl_lbc_ctrl *ctrl = priv->ctrl;
@@ -761,6 +774,7 @@ static int fsl_elbc_chip_init(struct fsl
 
 	chip->ecc.read_page = fsl_elbc_read_page;
 	chip->ecc.write_page = fsl_elbc_write_page;
+	chip->ecc.write_subpage = fsl_elbc_write_subpage;
 
 	/* If CS Base Register selects full hardware ECC then use it */
 	if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) ==
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/mtd/nand/omap2.c linux-libre-3.15.5-gnu/drivers/mtd/nand/omap2.c
--- linux-libre-3.15.4-gnu/drivers/mtd/nand/omap2.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/mtd/nand/omap2.c	2014-07-09 14:21:40.000000000 -0400
@@ -1382,7 +1382,7 @@ static int omap_elm_correct_data(struct
 
 	/* Check if any error reported */
 	if (!is_error_reported)
-		return 0;
+		return stat;
 
 	/* Decode BCH error using ELM module */
 	elm_decode_bch_error_page(info->elm_dev, ecc_vec, err_vec);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/mtd/nand/pxa3xx_nand.c linux-libre-3.15.5-gnu/drivers/mtd/nand/pxa3xx_nand.c
--- linux-libre-3.15.4-gnu/drivers/mtd/nand/pxa3xx_nand.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/mtd/nand/pxa3xx_nand.c	2014-07-09 14:21:40.000000000 -0400
@@ -127,10 +127,10 @@
 
 /* macros for registers read/write */
 #define nand_writel(info, off, val)	\
-	__raw_writel((val), (info)->mmio_base + (off))
+	writel_relaxed((val), (info)->mmio_base + (off))
 
 #define nand_readl(info, off)		\
-	__raw_readl((info)->mmio_base + (off))
+	readl_relaxed((info)->mmio_base + (off))
 
 /* error code and state */
 enum {
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/ethernet/allwinner/sun4i-emac.c linux-libre-3.15.5-gnu/drivers/net/ethernet/allwinner/sun4i-emac.c
--- linux-libre-3.15.4-gnu/drivers/net/ethernet/allwinner/sun4i-emac.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/ethernet/allwinner/sun4i-emac.c	2014-07-09 14:21:40.000000000 -0400
@@ -736,6 +736,7 @@ static int emac_open(struct net_device *
 
 	ret = emac_mdio_probe(dev);
 	if (ret < 0) {
+		free_irq(dev->irq, dev);
 		netdev_err(dev, "cannot probe MDIO bus\n");
 		return ret;
 	}
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/ethernet/mellanox/mlx4/fw.c linux-libre-3.15.5-gnu/drivers/net/ethernet/mellanox/mlx4/fw.c
--- linux-libre-3.15.4-gnu/drivers/net/ethernet/mellanox/mlx4/fw.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/ethernet/mellanox/mlx4/fw.c	2014-07-09 14:21:40.000000000 -0400
@@ -414,7 +414,7 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev
 
 	MLX4_GET(func_cap->flags1, outbox, QUERY_FUNC_CAP_FLAGS1_OFFSET);
 	if (dev->caps.port_type[gen_or_port] == MLX4_PORT_TYPE_ETH) {
-		if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_OFFSET) {
+		if (func_cap->flags1 & QUERY_FUNC_CAP_FLAGS1_FORCE_VLAN) {
 			mlx4_err(dev, "VLAN is enforced on this port\n");
 			err = -EPROTONOSUPPORT;
 			goto out;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/ethernet/mellanox/mlx4/main.c linux-libre-3.15.5-gnu/drivers/net/ethernet/mellanox/mlx4/main.c
--- linux-libre-3.15.4-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2014-07-09 14:21:40.000000000 -0400
@@ -2800,7 +2800,7 @@ static struct pci_driver mlx4_driver = {
 	.name		= DRV_NAME,
 	.id_table	= mlx4_pci_table,
 	.probe		= mlx4_init_one,
-	.shutdown	= mlx4_remove_one,
+	.shutdown	= __mlx4_remove_one,
 	.remove		= mlx4_remove_one,
 	.err_handler    = &mlx4_err_handler,
 };
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/b43/xmit.c linux-libre-3.15.5-gnu/drivers/net/wireless/b43/xmit.c
--- linux-libre-3.15.4-gnu/drivers/net/wireless/b43/xmit.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/b43/xmit.c	2014-07-09 14:21:40.000000000 -0400
@@ -811,9 +811,13 @@ void b43_rx(struct b43_wldev *dev, struc
 		break;
 	case B43_PHYTYPE_G:
 		status.band = IEEE80211_BAND_2GHZ;
-		/* chanid is the radio channel cookie value as used
-		 * to tune the radio. */
-		status.freq = chanid + 2400;
+		/* Somewhere between 478.104 and 508.1084 firmware for G-PHY
+		 * has been modified to be compatible with N-PHY and others.
+		 */
+		if (dev->fw.rev >= 508)
+			status.freq = ieee80211_channel_to_frequency(chanid, status.band);
+		else
+			status.freq = chanid + 2400;
 		break;
 	case B43_PHYTYPE_N:
 	case B43_PHYTYPE_LP:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/iwlwifi/pcie/trans.c linux-libre-3.15.5-gnu/drivers/net/wireless/iwlwifi/pcie/trans.c
--- linux-libre-3.15.4-gnu/drivers/net/wireless/iwlwifi/pcie/trans.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/iwlwifi/pcie/trans.c	2014-07-09 14:21:40.000000000 -0400
@@ -454,6 +454,7 @@ static int iwl_pcie_prepare_card_hw(stru
 {
 	int ret;
 	int t = 0;
+	int iter;
 
 	IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");
 
@@ -462,18 +463,23 @@ static int iwl_pcie_prepare_card_hw(stru
 	if (ret >= 0)
 		return 0;
 
-	/* If HW is not ready, prepare the conditions to check again */
-	iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
-		    CSR_HW_IF_CONFIG_REG_PREPARE);
+	for (iter = 0; iter < 10; iter++) {
+		/* If HW is not ready, prepare the conditions to check again */
+		iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
+			    CSR_HW_IF_CONFIG_REG_PREPARE);
 
-	do {
-		ret = iwl_pcie_set_hw_ready(trans);
-		if (ret >= 0)
-			return 0;
+		do {
+			ret = iwl_pcie_set_hw_ready(trans);
+			if (ret >= 0)
+				return 0;
 
-		usleep_range(200, 1000);
-		t += 200;
-	} while (t < 150000);
+			usleep_range(200, 1000);
+			t += 200;
+		} while (t < 150000);
+		msleep(25);
+	}
+
+	IWL_DEBUG_INFO(trans, "got NIC after %d iterations\n", iter);
 
 	return ret;
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2500pci.c linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2500pci.c
--- linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2500pci.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2500pci.c	2014-07-09 14:21:40.000000000 -0400
@@ -1681,8 +1681,13 @@ static int rt2500pci_init_eeprom(struct
 	/*
 	 * Detect if this device has an hardware controlled radio.
 	 */
-	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
+	if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) {
 		__set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags);
+		/*
+		 * On this device RFKILL initialized during probe does not work.
+		 */
+		__set_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags);
+	}
 
 	/*
 	 * Check if the BBP tuning should be enabled.
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00dev.c linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00dev.c
--- linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00dev.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00dev.c	2014-07-09 14:21:40.000000000 -0400
@@ -1126,9 +1126,10 @@ static void rt2x00lib_uninitialize(struc
 		return;
 
 	/*
-	 * Unregister extra components.
+	 * Stop rfkill polling.
 	 */
-	rt2x00rfkill_unregister(rt2x00dev);
+	if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_unregister(rt2x00dev);
 
 	/*
 	 * Allow the HW to uninitialize.
@@ -1166,6 +1167,12 @@ static int rt2x00lib_initialize(struct r
 
 	set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags);
 
+	/*
+	 * Start rfkill polling.
+	 */
+	if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_register(rt2x00dev);
+
 	return 0;
 }
 
@@ -1375,7 +1382,12 @@ int rt2x00lib_probe_dev(struct rt2x00_de
 	rt2x00link_register(rt2x00dev);
 	rt2x00leds_register(rt2x00dev);
 	rt2x00debug_register(rt2x00dev);
-	rt2x00rfkill_register(rt2x00dev);
+
+	/*
+	 * Start rfkill polling.
+	 */
+	if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_register(rt2x00dev);
 
 	return 0;
 
@@ -1391,6 +1403,12 @@ void rt2x00lib_remove_dev(struct rt2x00_
 	clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
 
 	/*
+	 * Stop rfkill polling.
+	 */
+	if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags))
+		rt2x00rfkill_unregister(rt2x00dev);
+
+	/*
 	 * Disable radio.
 	 */
 	rt2x00lib_disable_radio(rt2x00dev);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00.h linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00.h
--- linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00.h	2014-07-09 14:21:40.000000000 -0400
@@ -693,6 +693,7 @@ enum rt2x00_capability_flags {
 	REQUIRE_SW_SEQNO,
 	REQUIRE_HT_TX_DESC,
 	REQUIRE_PS_AUTOWAKE,
+	REQUIRE_DELAYED_RFKILL,
 
 	/*
 	 * Capabilities
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00mac.c linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00mac.c
--- linux-libre-3.15.4-gnu/drivers/net/wireless/rt2x00/rt2x00mac.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/net/wireless/rt2x00/rt2x00mac.c	2014-07-09 14:21:40.000000000 -0400
@@ -487,6 +487,8 @@ int rt2x00mac_set_key(struct ieee80211_h
 	crypto.cipher = rt2x00crypto_key_to_cipher(key);
 	if (crypto.cipher == CIPHER_NONE)
 		return -EOPNOTSUPP;
+	if (crypto.cipher == CIPHER_TKIP && rt2x00_is_usb(rt2x00dev))
+		return -EOPNOTSUPP;
 
 	crypto.cmd = cmd;
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/regulator/tps65218-regulator.c linux-libre-3.15.5-gnu/drivers/regulator/tps65218-regulator.c
--- linux-libre-3.15.4-gnu/drivers/regulator/tps65218-regulator.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/regulator/tps65218-regulator.c	2014-07-09 14:21:40.000000000 -0400
@@ -226,7 +226,7 @@ static const struct regulator_desc regul
 			   1, -1, -1, TPS65218_REG_ENABLE1,
 			   TPS65218_ENABLE1_DC6_EN, NULL, NULL, 0),
 	TPS65218_REGULATOR("LDO1", TPS65218_LDO_1, tps65218_ldo1_dcdc34_ops, 64,
-			   TPS65218_REG_CONTROL_DCDC4,
+			   TPS65218_REG_CONTROL_LDO1,
 			   TPS65218_CONTROL_LDO1_MASK, TPS65218_REG_ENABLE2,
 			   TPS65218_ENABLE2_LDO1_EN, NULL, ldo1_dcdc3_ranges,
 			   2),
@@ -257,6 +257,7 @@ static int tps65218_regulator_probe(stru
 	config.init_data = init_data;
 	config.driver_data = tps;
 	config.regmap = tps->regmap;
+	config.of_node = pdev->dev.of_node;
 
 	rdev = devm_regulator_register(&pdev->dev, &regulators[id], &config);
 	if (IS_ERR(rdev)) {
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/scsi/ibmvscsi/ibmvscsi.c linux-libre-3.15.5-gnu/drivers/scsi/ibmvscsi/ibmvscsi.c
--- linux-libre-3.15.4-gnu/drivers/scsi/ibmvscsi/ibmvscsi.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/scsi/ibmvscsi/ibmvscsi.c	2014-07-09 14:21:40.000000000 -0400
@@ -185,6 +185,11 @@ static struct viosrp_crq *crq_queue_next
 	if (crq->valid & 0x80) {
 		if (++queue->cur == queue->size)
 			queue->cur = 0;
+
+		/* Ensure the read of the valid bit occurs before reading any
+		 * other bits of the CRQ entry
+		 */
+		rmb();
 	} else
 		crq = NULL;
 	spin_unlock_irqrestore(&queue->lock, flags);
@@ -203,6 +208,11 @@ static int ibmvscsi_send_crq(struct ibmv
 {
 	struct vio_dev *vdev = to_vio_dev(hostdata->dev);
 
+	/*
+	 * Ensure the command buffer is flushed to memory before handing it
+	 * over to the VIOS to prevent it from fetching any stale data.
+	 */
+	mb();
 	return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2);
 }
 
@@ -797,7 +807,8 @@ static void purge_requests(struct ibmvsc
 				       evt->hostdata->dev);
 			if (evt->cmnd_done)
 				evt->cmnd_done(evt->cmnd);
-		} else if (evt->done)
+		} else if (evt->done && evt->crq.format != VIOSRP_MAD_FORMAT &&
+			   evt->iu.srp.login_req.opcode != SRP_LOGIN_REQ)
 			evt->done(evt);
 		free_event_struct(&evt->hostdata->pool, evt);
 		spin_lock_irqsave(hostdata->host->host_lock, flags);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/scsi/scsi_error.c linux-libre-3.15.5-gnu/drivers/scsi/scsi_error.c
--- linux-libre-3.15.4-gnu/drivers/scsi/scsi_error.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/scsi/scsi_error.c	2014-07-09 14:21:40.000000000 -0400
@@ -131,7 +131,7 @@ scmd_eh_abort_handler(struct work_struct
 				    "aborting command %p\n", scmd));
 		rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
 		if (rtn == SUCCESS) {
-			scmd->result |= DID_TIME_OUT << 16;
+			set_host_byte(scmd, DID_TIME_OUT);
 			if (scsi_host_eh_past_deadline(sdev->host)) {
 				SCSI_LOG_ERROR_RECOVERY(3,
 					scmd_printk(KERN_INFO, scmd,
@@ -167,7 +167,7 @@ scmd_eh_abort_handler(struct work_struct
 			scmd_printk(KERN_WARNING, scmd,
 				    "scmd %p terminate "
 				    "aborted command\n", scmd));
-		scmd->result |= DID_TIME_OUT << 16;
+		set_host_byte(scmd, DID_TIME_OUT);
 		scsi_finish_command(scmd);
 	}
 }
@@ -291,7 +291,7 @@ enum blk_eh_timer_return scsi_times_out(
 		if (scsi_abort_command(scmd) == SUCCESS)
 			return BLK_EH_NOT_HANDLED;
 
-	scmd->result |= DID_TIME_OUT << 16;
+	set_host_byte(scmd, DID_TIME_OUT);
 
 	if (unlikely(rtn == BLK_EH_NOT_HANDLED &&
 		     !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD)))
@@ -1776,7 +1776,7 @@ int scsi_decide_disposition(struct scsi_
 		break;
 	case DID_ABORT:
 		if (scmd->eh_eflags & SCSI_EH_ABORT_SCHEDULED) {
-			scmd->result |= DID_TIME_OUT << 16;
+			set_host_byte(scmd, DID_TIME_OUT);
 			return SUCCESS;
 		}
 	case DID_NO_CONNECT:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/scsi/sd.c linux-libre-3.15.5-gnu/drivers/scsi/sd.c
--- linux-libre-3.15.4-gnu/drivers/scsi/sd.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/scsi/sd.c	2014-07-09 14:21:40.000000000 -0400
@@ -2455,7 +2455,10 @@ sd_read_cache_type(struct scsi_disk *sdk
 		}
 
 		sdkp->DPOFUA = (data.device_specific & 0x10) != 0;
-		if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) {
+		if (sdp->broken_fua) {
+			sd_first_printk(KERN_NOTICE, sdkp, "Disabling FUA\n");
+			sdkp->DPOFUA = 0;
+		} else if (sdkp->DPOFUA && !sdkp->device->use_10_for_rw) {
 			sd_first_printk(KERN_NOTICE, sdkp,
 				  "Uses READ/WRITE(6), disabling FUA\n");
 			sdkp->DPOFUA = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/scsi/virtio_scsi.c linux-libre-3.15.5-gnu/drivers/scsi/virtio_scsi.c
--- linux-libre-3.15.4-gnu/drivers/scsi/virtio_scsi.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/scsi/virtio_scsi.c	2014-07-09 14:21:40.000000000 -0400
@@ -273,6 +273,16 @@ static void virtscsi_req_done(struct vir
 	virtscsi_vq_done(vscsi, req_vq, virtscsi_complete_cmd);
 };
 
+static void virtscsi_poll_requests(struct virtio_scsi *vscsi)
+{
+	int i, num_vqs;
+
+	num_vqs = vscsi->num_queues;
+	for (i = 0; i < num_vqs; i++)
+		virtscsi_vq_done(vscsi, &vscsi->req_vqs[i],
+				 virtscsi_complete_cmd);
+}
+
 static void virtscsi_complete_free(struct virtio_scsi *vscsi, void *buf)
 {
 	struct virtio_scsi_cmd *cmd = buf;
@@ -291,6 +301,8 @@ static void virtscsi_ctrl_done(struct vi
 	virtscsi_vq_done(vscsi, &vscsi->ctrl_vq, virtscsi_complete_free);
 };
 
+static void virtscsi_handle_event(struct work_struct *work);
+
 static int virtscsi_kick_event(struct virtio_scsi *vscsi,
 			       struct virtio_scsi_event_node *event_node)
 {
@@ -298,6 +310,7 @@ static int virtscsi_kick_event(struct vi
 	struct scatterlist sg;
 	unsigned long flags;
 
+	INIT_WORK(&event_node->work, virtscsi_handle_event);
 	sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event));
 
 	spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags);
@@ -415,7 +428,6 @@ static void virtscsi_complete_event(stru
 {
 	struct virtio_scsi_event_node *event_node = buf;
 
-	INIT_WORK(&event_node->work, virtscsi_handle_event);
 	schedule_work(&event_node->work);
 }
 
@@ -605,6 +617,18 @@ static int virtscsi_tmf(struct virtio_sc
 	    cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)
 		ret = SUCCESS;
 
+	/*
+	 * The spec guarantees that all requests related to the TMF have
+	 * been completed, but the callback might not have run yet if
+	 * we're using independent interrupts (e.g. MSI).  Poll the
+	 * virtqueues once.
+	 *
+	 * In the abort case, sc->scsi_done will do nothing, because
+	 * the block layer must have detected a timeout and as a result
+	 * REQ_ATOM_COMPLETE has been set.
+	 */
+	virtscsi_poll_requests(vscsi);
+
 out:
 	mempool_free(cmd, virtscsi_cmd_pool);
 	return ret;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/staging/iio/adc/ad7291.c linux-libre-3.15.5-gnu/drivers/staging/iio/adc/ad7291.c
--- linux-libre-3.15.4-gnu/drivers/staging/iio/adc/ad7291.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/staging/iio/adc/ad7291.c	2014-07-09 14:21:40.000000000 -0400
@@ -465,7 +465,7 @@ static int ad7291_probe(struct i2c_clien
 	struct ad7291_platform_data *pdata = client->dev.platform_data;
 	struct ad7291_chip_info *chip;
 	struct iio_dev *indio_dev;
-	int ret = 0;
+	int ret;
 
 	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*chip));
 	if (!indio_dev)
@@ -475,7 +475,7 @@ static int ad7291_probe(struct i2c_clien
 	if (pdata && pdata->use_external_ref) {
 		chip->reg = devm_regulator_get(&client->dev, "vref");
 		if (IS_ERR(chip->reg))
-			return ret;
+			return PTR_ERR(chip->reg);
 
 		ret = regulator_enable(chip->reg);
 		if (ret)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/staging/tidspbridge/core/tiomap3430.c linux-libre-3.15.5-gnu/drivers/staging/tidspbridge/core/tiomap3430.c
--- linux-libre-3.15.4-gnu/drivers/staging/tidspbridge/core/tiomap3430.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/staging/tidspbridge/core/tiomap3430.c	2014-07-09 14:21:40.000000000 -0400
@@ -280,8 +280,10 @@ static int bridge_brd_monitor(struct bri
 					OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
 
 		/* Wait until the state has moved to ON */
-		while (*pdata->dsp_prm_read(OMAP3430_IVA2_MOD, OMAP2_PM_PWSTST)&
-					OMAP_INTRANSITION_MASK);
+		while ((*pdata->dsp_prm_read)(OMAP3430_IVA2_MOD,
+					      OMAP2_PM_PWSTST) &
+						OMAP_INTRANSITION_MASK)
+			;
 		/* Disable Automatic transition */
 		(*pdata->dsp_cm_write)(OMAP34XX_CLKSTCTRL_DISABLE_AUTO,
 					OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/n_tty.c linux-libre-3.15.5-gnu/drivers/tty/n_tty.c
--- linux-libre-3.15.4-gnu/drivers/tty/n_tty.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/n_tty.c	2014-07-09 14:21:40.000000000 -0400
@@ -1214,15 +1214,16 @@ static void n_tty_receive_parity_error(s
 {
 	struct n_tty_data *ldata = tty->disc_data;
 
-	if (I_IGNPAR(tty))
-		return;
-	if (I_PARMRK(tty)) {
-		put_tty_queue('\377', ldata);
-		put_tty_queue('\0', ldata);
-		put_tty_queue(c, ldata);
-	} else	if (I_INPCK(tty))
-		put_tty_queue('\0', ldata);
-	else
+	if (I_INPCK(tty)) {
+		if (I_IGNPAR(tty))
+			return;
+		if (I_PARMRK(tty)) {
+			put_tty_queue('\377', ldata);
+			put_tty_queue('\0', ldata);
+			put_tty_queue(c, ldata);
+		} else
+			put_tty_queue('\0', ldata);
+	} else
 		put_tty_queue(c, ldata);
 	if (waitqueue_active(&tty->read_wait))
 		wake_up_interruptible(&tty->read_wait);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/8250/8250_core.c linux-libre-3.15.5-gnu/drivers/tty/serial/8250/8250_core.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/8250/8250_core.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/8250/8250_core.c	2014-07-09 14:21:40.000000000 -0400
@@ -2360,7 +2360,7 @@ serial8250_do_set_termios(struct uart_po
 	port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= UART_LSR_BI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/altera_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/altera_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/altera_uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/altera_uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -185,6 +185,12 @@ static void altera_uart_set_termios(stru
 	uart_update_timeout(port, termios->c_cflag, baud);
 	altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG);
 	spin_unlock_irqrestore(&port->lock, flags);
+
+	/*
+	 * FIXME: port->read_status_mask and port->ignore_status_mask
+	 * need to be initialized based on termios settings for
+	 * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
+	 */
 }
 
 static void altera_uart_rx_chars(struct altera_uart *pp)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/amba-pl010.c linux-libre-3.15.5-gnu/drivers/tty/serial/amba-pl010.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/amba-pl010.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/amba-pl010.c	2014-07-09 14:21:40.000000000 -0400
@@ -420,7 +420,7 @@ pl010_set_termios(struct uart_port *port
 	uap->port.read_status_mask = UART01x_RSR_OE;
 	if (termios->c_iflag & INPCK)
 		uap->port.read_status_mask |= UART01x_RSR_FE | UART01x_RSR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		uap->port.read_status_mask |= UART01x_RSR_BE;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/amba-pl011.c linux-libre-3.15.5-gnu/drivers/tty/serial/amba-pl011.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/amba-pl011.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/amba-pl011.c	2014-07-09 14:21:40.000000000 -0400
@@ -1744,7 +1744,7 @@ pl011_set_termios(struct uart_port *port
 	port->read_status_mask = UART011_DR_OE | 255;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= UART011_DR_FE | UART011_DR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= UART011_DR_BE;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/atmel_serial.c linux-libre-3.15.5-gnu/drivers/tty/serial/atmel_serial.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/atmel_serial.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/atmel_serial.c	2014-07-09 14:21:40.000000000 -0400
@@ -1784,7 +1784,7 @@ static void atmel_set_termios(struct uar
 	port->read_status_mask = ATMEL_US_OVRE;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE);
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= ATMEL_US_RXBRK;
 
 	if (atmel_use_pdc_rx(port))
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/bcm63xx_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/bcm63xx_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/bcm63xx_uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/bcm63xx_uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -567,7 +567,7 @@ static void bcm_uart_set_termios(struct
 		port->read_status_mask |= UART_FIFO_FRAMEERR_MASK;
 		port->read_status_mask |= UART_FIFO_PARERR_MASK;
 	}
-	if (new->c_iflag & (BRKINT))
+	if (new->c_iflag & (IGNBRK | BRKINT))
 		port->read_status_mask |= UART_FIFO_BRKDET_MASK;
 
 	port->ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/bfin_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/bfin_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/bfin_uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/bfin_uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -833,7 +833,7 @@ bfin_serial_set_termios(struct uart_port
 	port->read_status_mask = OE;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= (FE | PE);
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= BI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/dz.c linux-libre-3.15.5-gnu/drivers/tty/serial/dz.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/dz.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/dz.c	2014-07-09 14:21:40.000000000 -0400
@@ -625,7 +625,7 @@ static void dz_set_termios(struct uart_p
 	dport->port.read_status_mask = DZ_OERR;
 	if (termios->c_iflag & INPCK)
 		dport->port.read_status_mask |= DZ_FERR | DZ_PERR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		dport->port.read_status_mask |= DZ_BREAK;
 
 	/* characters to ignore */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/efm32-uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/efm32-uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/efm32-uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/efm32-uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -407,7 +407,7 @@ static void efm32_uart_set_termios(struc
 	if (new->c_iflag & INPCK)
 		port->read_status_mask |=
 			UARTn_RXDATAX_FERR | UARTn_RXDATAX_PERR;
-	if (new->c_iflag & (BRKINT | PARMRK))
+	if (new->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= SW_UARTn_RXDATAX_BERR;
 
 	port->ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/fsl_lpuart.c linux-libre-3.15.5-gnu/drivers/tty/serial/fsl_lpuart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/fsl_lpuart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/fsl_lpuart.c	2014-07-09 14:21:40.000000000 -0400
@@ -902,7 +902,7 @@ lpuart_set_termios(struct uart_port *por
 	sport->port.read_status_mask = 0;
 	if (termios->c_iflag & INPCK)
 		sport->port.read_status_mask |=	(UARTSR1_FE | UARTSR1_PE);
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		sport->port.read_status_mask |= UARTSR1_FE;
 
 	/* characters to ignore */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/ip22zilog.c linux-libre-3.15.5-gnu/drivers/tty/serial/ip22zilog.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/ip22zilog.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/ip22zilog.c	2014-07-09 14:21:40.000000000 -0400
@@ -850,7 +850,7 @@ ip22zilog_convert_to_zs(struct uart_ip22
 	up->port.read_status_mask = Rx_OVR;
 	if (iflag & INPCK)
 		up->port.read_status_mask |= CRC_ERR | PAR_ERR;
-	if (iflag & (BRKINT | PARMRK))
+	if (iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= BRK_ABRT;
 
 	up->port.ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/m32r_sio.c linux-libre-3.15.5-gnu/drivers/tty/serial/m32r_sio.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/m32r_sio.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/m32r_sio.c	2014-07-09 14:21:40.000000000 -0400
@@ -737,7 +737,7 @@ static void m32r_sio_set_termios(struct
 	up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
 	if (termios->c_iflag & INPCK)
 		up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= UART_LSR_BI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/max310x.c linux-libre-3.15.5-gnu/drivers/tty/serial/max310x.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/max310x.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/max310x.c	2014-07-09 14:21:40.000000000 -0400
@@ -835,7 +835,7 @@ static void max310x_set_termios(struct u
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= MAX310X_LSR_RXPAR_BIT |
 					  MAX310X_LSR_FRERR_BIT;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= MAX310X_LSR_RXBRK_BIT;
 
 	/* Set status ignore mask */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/mcf.c linux-libre-3.15.5-gnu/drivers/tty/serial/mcf.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/mcf.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/mcf.c	2014-07-09 14:21:40.000000000 -0400
@@ -248,6 +248,12 @@ static void mcf_set_termios(struct uart_
 		mr1 |= MCFUART_MR1_PARITYNONE;
 	}
 
+	/*
+	 * FIXME: port->read_status_mask and port->ignore_status_mask
+	 * need to be initialized based on termios settings for
+	 * INPCK, IGNBRK, IGNPAR, PARMRK, BRKINT
+	 */
+
 	if (termios->c_cflag & CSTOPB)
 		mr2 |= MCFUART_MR2_STOP2;
 	else
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/mfd.c linux-libre-3.15.5-gnu/drivers/tty/serial/mfd.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/mfd.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/mfd.c	2014-07-09 14:21:40.000000000 -0400
@@ -977,7 +977,7 @@ serial_hsu_set_termios(struct uart_port
 	up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
 	if (termios->c_iflag & INPCK)
 		up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= UART_LSR_BI;
 
 	/* Characters to ignore */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/mpsc.c linux-libre-3.15.5-gnu/drivers/tty/serial/mpsc.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/mpsc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/mpsc.c	2014-07-09 14:21:40.000000000 -0400
@@ -1458,7 +1458,7 @@ static void mpsc_set_termios(struct uart
 		pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_PE
 			| SDMA_DESC_CMDSTAT_FR;
 
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		pi->port.read_status_mask |= SDMA_DESC_CMDSTAT_BR;
 
 	/* Characters/events to ignore */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/msm_serial.c linux-libre-3.15.5-gnu/drivers/tty/serial/msm_serial.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/msm_serial.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/msm_serial.c	2014-07-09 14:21:40.000000000 -0400
@@ -583,7 +583,7 @@ static void msm_set_termios(struct uart_
 	port->read_status_mask = 0;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= UART_SR_PAR_FRAME_ERR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= UART_SR_RX_BREAK;
 
 	uart_update_timeout(port, termios->c_cflag, baud);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/mxs-auart.c linux-libre-3.15.5-gnu/drivers/tty/serial/mxs-auart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/mxs-auart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/mxs-auart.c	2014-07-09 14:21:40.000000000 -0400
@@ -604,7 +604,7 @@ static void mxs_auart_settermios(struct
 
 	if (termios->c_iflag & INPCK)
 		u->read_status_mask |= AUART_STAT_PERR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		u->read_status_mask |= AUART_STAT_BERR;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/netx-serial.c linux-libre-3.15.5-gnu/drivers/tty/serial/netx-serial.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/netx-serial.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/netx-serial.c	2014-07-09 14:21:40.000000000 -0400
@@ -419,7 +419,7 @@ netx_set_termios(struct uart_port *port,
 	}
 
 	port->read_status_mask = 0;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= SR_BE;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= SR_PE | SR_FE;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/pmac_zilog.c linux-libre-3.15.5-gnu/drivers/tty/serial/pmac_zilog.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/pmac_zilog.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/pmac_zilog.c	2014-07-09 14:21:40.000000000 -0400
@@ -1092,7 +1092,7 @@ static void pmz_convert_to_zs(struct uar
 	uap->port.read_status_mask = Rx_OVR;
 	if (iflag & INPCK)
 		uap->port.read_status_mask |= CRC_ERR | PAR_ERR;
-	if (iflag & (BRKINT | PARMRK))
+	if (iflag & (IGNBRK | BRKINT | PARMRK))
 		uap->port.read_status_mask |= BRK_ABRT;
 
 	uap->port.ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/pnx8xxx_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/pnx8xxx_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/pnx8xxx_uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/pnx8xxx_uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -477,7 +477,7 @@ pnx8xxx_set_termios(struct uart_port *po
 		sport->port.read_status_mask |=
 			FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) |
 			FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR);
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		sport->port.read_status_mask |=
 			ISTAT_TO_SM(PNX8XXX_UART_INT_BREAK);
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/pxa.c linux-libre-3.15.5-gnu/drivers/tty/serial/pxa.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/pxa.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/pxa.c	2014-07-09 14:21:40.000000000 -0400
@@ -492,7 +492,7 @@ serial_pxa_set_termios(struct uart_port
 	up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
 	if (termios->c_iflag & INPCK)
 		up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= UART_LSR_BI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sb1250-duart.c linux-libre-3.15.5-gnu/drivers/tty/serial/sb1250-duart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sb1250-duart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sb1250-duart.c	2014-07-09 14:21:40.000000000 -0400
@@ -596,7 +596,7 @@ static void sbd_set_termios(struct uart_
 	if (termios->c_iflag & INPCK)
 		uport->read_status_mask |= M_DUART_FRM_ERR |
 					   M_DUART_PARITY_ERR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		uport->read_status_mask |= M_DUART_RCVD_BRK;
 
 	uport->ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sccnxp.c linux-libre-3.15.5-gnu/drivers/tty/serial/sccnxp.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sccnxp.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sccnxp.c	2014-07-09 14:21:40.000000000 -0400
@@ -667,7 +667,7 @@ static void sccnxp_set_termios(struct ua
 	port->read_status_mask = SR_OVR;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= SR_PE | SR_FE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= SR_BRK;
 
 	/* Set status ignore mask */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/serial_ks8695.c linux-libre-3.15.5-gnu/drivers/tty/serial/serial_ks8695.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/serial_ks8695.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/serial_ks8695.c	2014-07-09 14:21:40.000000000 -0400
@@ -437,7 +437,7 @@ static void ks8695uart_set_termios(struc
 	port->read_status_mask = URLS_URROE;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= (URLS_URFE | URLS_URPE);
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= URLS_URBI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/serial_txx9.c linux-libre-3.15.5-gnu/drivers/tty/serial/serial_txx9.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/serial_txx9.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/serial_txx9.c	2014-07-09 14:21:40.000000000 -0400
@@ -702,7 +702,7 @@ serial_txx9_set_termios(struct uart_port
 		TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS;
 	if (termios->c_iflag & INPCK)
 		up->port.read_status_mask |= TXX9_SIDISR_UFER | TXX9_SIDISR_UPER;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= TXX9_SIDISR_UBRK;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sirfsoc_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/sirfsoc_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sirfsoc_uart.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sirfsoc_uart.c	2014-07-09 14:21:40.000000000 -0400
@@ -907,7 +907,7 @@ static void sirfsoc_uart_set_termios(str
 		if (termios->c_iflag & INPCK)
 			port->read_status_mask |= uint_en->sirfsoc_frm_err_en;
 	}
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 			port->read_status_mask |= uint_en->sirfsoc_rxd_brk_en;
 	if (sirfport->uart_reg->uart_type == SIRF_REAL_UART) {
 		if (termios->c_iflag & IGNPAR)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/st-asc.c linux-libre-3.15.5-gnu/drivers/tty/serial/st-asc.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/st-asc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/st-asc.c	2014-07-09 14:21:40.000000000 -0400
@@ -547,7 +547,7 @@ static void asc_set_termios(struct uart_
 	ascport->port.read_status_mask = ASC_RXBUF_DUMMY_OE;
 	if (termios->c_iflag & INPCK)
 		ascport->port.read_status_mask |= ASC_RXBUF_FE | ASC_RXBUF_PE;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		ascport->port.read_status_mask |= ASC_RXBUF_DUMMY_BE;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sunsab.c linux-libre-3.15.5-gnu/drivers/tty/serial/sunsab.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sunsab.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sunsab.c	2014-07-09 14:21:40.000000000 -0400
@@ -719,7 +719,7 @@ static void sunsab_convert_to_sab(struct
 	if (iflag & INPCK)
 		up->port.read_status_mask |= (SAB82532_ISR0_PERR |
 					      SAB82532_ISR0_FERR);
-	if (iflag & (BRKINT | PARMRK))
+	if (iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= (SAB82532_ISR1_BRK << 8);
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sunsu.c linux-libre-3.15.5-gnu/drivers/tty/serial/sunsu.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sunsu.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sunsu.c	2014-07-09 14:21:40.000000000 -0400
@@ -834,7 +834,7 @@ sunsu_change_speed(struct uart_port *por
 	up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
 	if (iflag & INPCK)
 		up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (iflag & (BRKINT | PARMRK))
+	if (iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= UART_LSR_BI;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/sunzilog.c linux-libre-3.15.5-gnu/drivers/tty/serial/sunzilog.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/sunzilog.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/sunzilog.c	2014-07-09 14:21:40.000000000 -0400
@@ -915,7 +915,7 @@ sunzilog_convert_to_zs(struct uart_sunzi
 	up->port.read_status_mask = Rx_OVR;
 	if (iflag & INPCK)
 		up->port.read_status_mask |= CRC_ERR | PAR_ERR;
-	if (iflag & (BRKINT | PARMRK))
+	if (iflag & (IGNBRK | BRKINT | PARMRK))
 		up->port.read_status_mask |= BRK_ABRT;
 
 	up->port.ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/ucc_uart.c linux-libre-3.15.5-gnu/drivers/tty/serial/ucc_uart.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/ucc_uart.c	2014-07-07 00:41:55.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/ucc_uart.c	2014-07-09 17:33:59.000000000 -0400
@@ -936,7 +936,7 @@ static void qe_uart_set_termios(struct u
 	port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= BD_SC_FR | BD_SC_PR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= BD_SC_BR;
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/vr41xx_siu.c linux-libre-3.15.5-gnu/drivers/tty/serial/vr41xx_siu.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/vr41xx_siu.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/vr41xx_siu.c	2014-07-09 14:21:40.000000000 -0400
@@ -559,7 +559,7 @@ static void siu_set_termios(struct uart_
 	port->read_status_mask = UART_LSR_THRE | UART_LSR_OE | UART_LSR_DR;
 	if (c_iflag & INPCK)
 		port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
-	if (c_iflag & (BRKINT | PARMRK))
+	if (c_iflag & (IGNBRK | BRKINT | PARMRK))
 		port->read_status_mask |= UART_LSR_BI;
 
 	port->ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/tty/serial/zs.c linux-libre-3.15.5-gnu/drivers/tty/serial/zs.c
--- linux-libre-3.15.4-gnu/drivers/tty/serial/zs.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/tty/serial/zs.c	2014-07-09 14:21:40.000000000 -0400
@@ -923,7 +923,7 @@ static void zs_set_termios(struct uart_p
 	uport->read_status_mask = Rx_OVR;
 	if (termios->c_iflag & INPCK)
 		uport->read_status_mask |= FRM_ERR | PAR_ERR;
-	if (termios->c_iflag & (BRKINT | PARMRK))
+	if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))
 		uport->read_status_mask |= Rx_BRK;
 
 	uport->ignore_status_mask = 0;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/chipidea/udc.c linux-libre-3.15.5-gnu/drivers/usb/chipidea/udc.c
--- linux-libre-3.15.4-gnu/drivers/usb/chipidea/udc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/chipidea/udc.c	2014-07-09 14:21:40.000000000 -0400
@@ -1328,6 +1328,7 @@ static int ep_dequeue(struct usb_ep *ep,
 	struct ci_hw_ep  *hwep  = container_of(ep,  struct ci_hw_ep, ep);
 	struct ci_hw_req *hwreq = container_of(req, struct ci_hw_req, req);
 	unsigned long flags;
+	struct td_node *node, *tmpnode;
 
 	if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY ||
 		hwep->ep.desc == NULL || list_empty(&hwreq->queue) ||
@@ -1338,6 +1339,12 @@ static int ep_dequeue(struct usb_ep *ep,
 
 	hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
 
+	list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
+		dma_pool_free(hwep->td_pool, node->ptr, node->dma);
+		list_del(&node->td);
+		kfree(node);
+	}
+
 	/* pop request */
 	list_del_init(&hwreq->queue);
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/gadget/f_fs.c linux-libre-3.15.5-gnu/drivers/usb/gadget/f_fs.c
--- linux-libre-3.15.4-gnu/drivers/usb/gadget/f_fs.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/gadget/f_fs.c	2014-07-09 14:21:40.000000000 -0400
@@ -1508,11 +1508,13 @@ static int functionfs_bind(struct ffs_da
 	ffs->ep0req->context = ffs;
 
 	lang = ffs->stringtabs;
-	for (lang = ffs->stringtabs; *lang; ++lang) {
-		struct usb_string *str = (*lang)->strings;
-		int id = first_id;
-		for (; str->s; ++id, ++str)
-			str->id = id;
+	if (lang) {
+		for (; *lang; ++lang) {
+			struct usb_string *str = (*lang)->strings;
+			int id = first_id;
+			for (; str->s; ++id, ++str)
+				str->id = id;
+		}
 	}
 
 	ffs->gadget = cdev->gadget;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/host/xhci.c linux-libre-3.15.5-gnu/drivers/usb/host/xhci.c
--- linux-libre-3.15.4-gnu/drivers/usb/host/xhci.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/host/xhci.c	2014-07-09 14:21:40.000000000 -0400
@@ -932,7 +932,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
  */
 int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 {
-	u32			command, temp = 0;
+	u32			command, temp = 0, status;
 	struct usb_hcd		*hcd = xhci_to_hcd(xhci);
 	struct usb_hcd		*secondary_hcd;
 	int			retval = 0;
@@ -1050,8 +1050,12 @@ int xhci_resume(struct xhci_hcd *xhci, b
 
  done:
 	if (retval == 0) {
-		usb_hcd_resume_root_hub(hcd);
-		usb_hcd_resume_root_hub(xhci->shared_hcd);
+		/* Resume root hubs only when have pending events. */
+		status = readl(&xhci->op_regs->status);
+		if (status & STS_EINT) {
+			usb_hcd_resume_root_hub(hcd);
+			usb_hcd_resume_root_hub(xhci->shared_hcd);
+		}
 	}
 
 	/*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/host/xhci-ring.c linux-libre-3.15.5-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-3.15.4-gnu/drivers/usb/host/xhci-ring.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/host/xhci-ring.c	2014-07-09 14:21:40.000000000 -0400
@@ -1611,8 +1611,11 @@ static void handle_cmd_completion(struct
 		xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
 		break;
 	case TRB_RESET_DEV:
-		WARN_ON(slot_id != TRB_TO_SLOT_ID(
-				le32_to_cpu(cmd_trb->generic.field[3])));
+		/* SLOT_ID field in reset device cmd completion event TRB is 0.
+		 * Use the SLOT_ID from the command TRB instead (xhci 4.6.11)
+		 */
+		slot_id = TRB_TO_SLOT_ID(
+				le32_to_cpu(cmd_trb->generic.field[3]));
 		xhci_handle_cmd_reset_dev(xhci, slot_id, event);
 		break;
 	case TRB_NEC_GET_FW:
@@ -3696,7 +3699,7 @@ static unsigned int xhci_get_burst_count
 		return 0;
 
 	max_burst = urb->ep->ss_ep_comp.bMaxBurst;
-	return roundup(total_packet_count, max_burst + 1) - 1;
+	return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1;
 }
 
 /*
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/musb/musb_am335x.c linux-libre-3.15.5-gnu/drivers/usb/musb/musb_am335x.c
--- linux-libre-3.15.4-gnu/drivers/usb/musb/musb_am335x.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/musb/musb_am335x.c	2014-07-09 14:21:40.000000000 -0400
@@ -19,21 +19,6 @@ err:
 	return ret;
 }
 
-static int of_remove_populated_child(struct device *dev, void *d)
-{
-	struct platform_device *pdev = to_platform_device(dev);
-
-	of_device_unregister(pdev);
-	return 0;
-}
-
-static int am335x_child_remove(struct platform_device *pdev)
-{
-	device_for_each_child(&pdev->dev, NULL, of_remove_populated_child);
-	pm_runtime_disable(&pdev->dev);
-	return 0;
-}
-
 static const struct of_device_id am335x_child_of_match[] = {
 	{ .compatible = "ti,am33xx-usb" },
 	{  },
@@ -42,13 +27,17 @@ MODULE_DEVICE_TABLE(of, am335x_child_of_
 
 static struct platform_driver am335x_child_driver = {
 	.probe		= am335x_child_probe,
-	.remove         = am335x_child_remove,
 	.driver         = {
 		.name   = "am335x-usb-childs",
 		.of_match_table	= am335x_child_of_match,
 	},
 };
 
-module_platform_driver(am335x_child_driver);
+static int __init am335x_child_init(void)
+{
+	return platform_driver_register(&am335x_child_driver);
+}
+module_init(am335x_child_init);
+
 MODULE_DESCRIPTION("AM33xx child devices");
 MODULE_LICENSE("GPL v2");
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/musb/musb_cppi41.c linux-libre-3.15.5-gnu/drivers/usb/musb/musb_cppi41.c
--- linux-libre-3.15.4-gnu/drivers/usb/musb/musb_cppi41.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/musb/musb_cppi41.c	2014-07-09 14:21:40.000000000 -0400
@@ -318,7 +318,7 @@ static void cppi41_dma_callback(void *pr
 		}
 		list_add_tail(&cppi41_channel->tx_check,
 				&controller->early_tx_list);
-		if (!hrtimer_active(&controller->early_tx)) {
+		if (!hrtimer_is_queued(&controller->early_tx)) {
 			hrtimer_start_range_ns(&controller->early_tx,
 				ktime_set(0, 140 * NSEC_PER_USEC),
 				40 * NSEC_PER_USEC,
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/musb/ux500.c linux-libre-3.15.5-gnu/drivers/usb/musb/ux500.c
--- linux-libre-3.15.4-gnu/drivers/usb/musb/ux500.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/musb/ux500.c	2014-07-09 14:21:40.000000000 -0400
@@ -274,7 +274,6 @@ static int ux500_probe(struct platform_d
 	musb->dev.parent		= &pdev->dev;
 	musb->dev.dma_mask		= &pdev->dev.coherent_dma_mask;
 	musb->dev.coherent_dma_mask	= pdev->dev.coherent_dma_mask;
-	musb->dev.of_node		= pdev->dev.of_node;
 
 	glue->dev			= &pdev->dev;
 	glue->musb			= musb;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/serial/ftdi_sio.c linux-libre-3.15.5-gnu/drivers/usb/serial/ftdi_sio.c
--- linux-libre-3.15.4-gnu/drivers/usb/serial/ftdi_sio.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/serial/ftdi_sio.c	2014-07-09 14:21:40.000000000 -0400
@@ -1566,14 +1566,17 @@ static void ftdi_set_max_packet_size(str
 	struct usb_device *udev = serial->dev;
 
 	struct usb_interface *interface = serial->interface;
-	struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc;
+	struct usb_endpoint_descriptor *ep_desc;
 
 	unsigned num_endpoints;
-	int i;
+	unsigned i;
 
 	num_endpoints = interface->cur_altsetting->desc.bNumEndpoints;
 	dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints);
 
+	if (!num_endpoints)
+		return;
+
 	/* NOTE: some customers have programmed FT232R/FT245R devices
 	 * with an endpoint size of 0 - not good.  In this case, we
 	 * want to override the endpoint descriptor setting and use a
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/serial/option.c linux-libre-3.15.5-gnu/drivers/usb/serial/option.c
--- linux-libre-3.15.4-gnu/drivers/usb/serial/option.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/serial/option.c	2014-07-09 14:21:40.000000000 -0400
@@ -352,6 +352,9 @@ static void option_instat_callback(struc
 /* Zoom */
 #define ZOOM_PRODUCT_4597			0x9607
 
+/* SpeedUp SU9800 usb 3g modem */
+#define SPEEDUP_PRODUCT_SU9800			0x9800
+
 /* Haier products */
 #define HAIER_VENDOR_ID				0x201e
 #define HAIER_PRODUCT_CE100			0x2009
@@ -372,8 +375,12 @@ static void option_instat_callback(struc
 /* Olivetti products */
 #define OLIVETTI_VENDOR_ID			0x0b3c
 #define OLIVETTI_PRODUCT_OLICARD100		0xc000
+#define OLIVETTI_PRODUCT_OLICARD120		0xc001
+#define OLIVETTI_PRODUCT_OLICARD140		0xc002
 #define OLIVETTI_PRODUCT_OLICARD145		0xc003
+#define OLIVETTI_PRODUCT_OLICARD155		0xc004
 #define OLIVETTI_PRODUCT_OLICARD200		0xc005
+#define OLIVETTI_PRODUCT_OLICARD160		0xc00a
 #define OLIVETTI_PRODUCT_OLICARD500		0xc00b
 
 /* Celot products */
@@ -1577,6 +1584,7 @@ static const struct usb_device_id option
 	{ USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
   	  .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
   	},
+	{ USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) },
 	{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
 	{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
 	{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
@@ -1611,15 +1619,21 @@ static const struct usb_device_id option
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) },
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */
 	{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
-
-	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
+	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
+		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
+		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD140),
+		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) },
+	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD155),
+		.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
 	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200),
-		.driver_info = (kernel_ulong_t)&net_intf6_blacklist
-	},
+		.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
+	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD160),
+		.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
 	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500),
-		.driver_info = (kernel_ulong_t)&net_intf4_blacklist
-	},
+		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
 	{ USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
 	{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
 	{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/storage/scsiglue.c linux-libre-3.15.5-gnu/drivers/usb/storage/scsiglue.c
--- linux-libre-3.15.4-gnu/drivers/usb/storage/scsiglue.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/storage/scsiglue.c	2014-07-09 14:21:40.000000000 -0400
@@ -256,6 +256,10 @@ static int slave_configure(struct scsi_d
 		if (us->fflags & US_FL_WRITE_CACHE)
 			sdev->wce_default_on = 1;
 
+		/* A few buggy USB-ATA bridges don't understand FUA */
+		if (us->fflags & US_FL_BROKEN_FUA)
+			sdev->broken_fua = 1;
+
 	} else {
 
 		/* Non-disk-type devices don't need to blacklist any pages
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/usb/storage/unusual_devs.h linux-libre-3.15.5-gnu/drivers/usb/storage/unusual_devs.h
--- linux-libre-3.15.4-gnu/drivers/usb/storage/unusual_devs.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/usb/storage/unusual_devs.h	2014-07-09 14:21:40.000000000 -0400
@@ -1936,6 +1936,13 @@ UNUSUAL_DEV(  0x14cd, 0x6600, 0x0201, 0x
 		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
 		US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Michael Büsch <m@bues.ch> */
+UNUSUAL_DEV(  0x152d, 0x0567, 0x0114, 0x0114,
+		"JMicron",
+		"USB to ATA/ATAPI Bridge",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_BROKEN_FUA ),
+
 /* Reported by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
  * JMicron responds to USN and several other SCSI ioctls with a
  * residue that causes subsequent I/O requests to fail.  */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/drivers/video/fbdev/fb-puv3.c linux-libre-3.15.5-gnu/drivers/video/fbdev/fb-puv3.c
--- linux-libre-3.15.4-gnu/drivers/video/fbdev/fb-puv3.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/drivers/video/fbdev/fb-puv3.c	2014-07-09 14:21:40.000000000 -0400
@@ -18,8 +18,10 @@
 #include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/console.h>
+#include <linux/mm.h>
 
 #include <asm/sizes.h>
+#include <asm/pgtable.h>
 #include <mach/hardware.h>
 
 /* Platform_data reserved for unifb registers. */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/btrfs/disk-io.c linux-libre-3.15.5-gnu/fs/btrfs/disk-io.c
--- linux-libre-3.15.4-gnu/fs/btrfs/disk-io.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/btrfs/disk-io.c	2014-07-09 14:21:40.000000000 -0400
@@ -368,7 +368,8 @@ static int verify_parent_transid(struct
 out:
 	unlock_extent_cached(io_tree, eb->start, eb->start + eb->len - 1,
 			     &cached_state, GFP_NOFS);
-	btrfs_tree_read_unlock_blocking(eb);
+	if (need_lock)
+		btrfs_tree_read_unlock_blocking(eb);
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/cifs/cifs_unicode.c linux-libre-3.15.5-gnu/fs/cifs/cifs_unicode.c
--- linux-libre-3.15.4-gnu/fs/cifs/cifs_unicode.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/cifs/cifs_unicode.c	2014-07-09 14:21:40.000000000 -0400
@@ -290,7 +290,8 @@ int
 cifsConvertToUTF16(__le16 *target, const char *source, int srclen,
 		 const struct nls_table *cp, int mapChars)
 {
-	int i, j, charlen;
+	int i, charlen;
+	int j = 0;
 	char src_char;
 	__le16 dst_char;
 	wchar_t tmp;
@@ -298,12 +299,11 @@ cifsConvertToUTF16(__le16 *target, const
 	if (!mapChars)
 		return cifs_strtoUTF16(target, source, PATH_MAX, cp);
 
-	for (i = 0, j = 0; i < srclen; j++) {
+	for (i = 0; i < srclen; j++) {
 		src_char = source[i];
 		charlen = 1;
 		switch (src_char) {
 		case 0:
-			put_unaligned(0, &target[j]);
 			goto ctoUTF16_out;
 		case ':':
 			dst_char = cpu_to_le16(UNI_COLON);
@@ -350,6 +350,7 @@ cifsConvertToUTF16(__le16 *target, const
 	}
 
 ctoUTF16_out:
+	put_unaligned(0, &target[j]); /* Null terminate target unicode string */
 	return j;
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/cifs/link.c linux-libre-3.15.5-gnu/fs/cifs/link.c
--- linux-libre-3.15.4-gnu/fs/cifs/link.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/cifs/link.c	2014-07-09 14:21:40.000000000 -0400
@@ -374,7 +374,7 @@ cifs_create_mf_symlink(unsigned int xid,
 	oparms.cifs_sb = cifs_sb;
 	oparms.desired_access = GENERIC_WRITE;
 	oparms.create_options = create_options;
-	oparms.disposition = FILE_OPEN;
+	oparms.disposition = FILE_CREATE;
 	oparms.path = path;
 	oparms.fid = &fid;
 	oparms.reconnect = false;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/ext4/indirect.c linux-libre-3.15.5-gnu/fs/ext4/indirect.c
--- linux-libre-3.15.4-gnu/fs/ext4/indirect.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/ext4/indirect.c	2014-07-09 14:21:40.000000000 -0400
@@ -389,7 +389,13 @@ static int ext4_alloc_branch(handle_t *h
 	return 0;
 failed:
 	for (; i >= 0; i--) {
-		if (i != indirect_blks && branch[i].bh)
+		/*
+		 * We want to ext4_forget() only freshly allocated indirect
+		 * blocks.  Buffer for new_blocks[i-1] is at branch[i].bh and
+		 * buffer at branch[0].bh is indirect block / inode already
+		 * existing before ext4_alloc_branch() was called.
+		 */
+		if (i > 0 && i != indirect_blks && branch[i].bh)
 			ext4_forget(handle, 1, inode, branch[i].bh,
 				    branch[i].bh->b_blocknr);
 		ext4_free_blocks(handle, inode, NULL, new_blocks[i],
@@ -1312,16 +1318,24 @@ static int free_hole_blocks(handle_t *ha
 		blk = *i_data;
 		if (level > 0) {
 			ext4_lblk_t first2;
+			ext4_lblk_t count2;
+
 			bh = sb_bread(inode->i_sb, le32_to_cpu(blk));
 			if (!bh) {
 				EXT4_ERROR_INODE_BLOCK(inode, le32_to_cpu(blk),
 						       "Read failure");
 				return -EIO;
 			}
-			first2 = (first > offset) ? first - offset : 0;
+			if (first > offset) {
+				first2 = first - offset;
+				count2 = count;
+			} else {
+				first2 = 0;
+				count2 = count - (offset - first);
+			}
 			ret = free_hole_blocks(handle, inode, bh,
 					       (__le32 *)bh->b_data, level - 1,
-					       first2, count - offset,
+					       first2, count2,
 					       inode->i_sb->s_blocksize >> 2);
 			if (ret) {
 				brelse(bh);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/nfsd/nfs4proc.c linux-libre-3.15.5-gnu/fs/nfsd/nfs4proc.c
--- linux-libre-3.15.4-gnu/fs/nfsd/nfs4proc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/nfsd/nfs4proc.c	2014-07-09 14:21:40.000000000 -0400
@@ -618,15 +618,6 @@ nfsd4_create(struct svc_rqst *rqstp, str
 
 	switch (create->cr_type) {
 	case NF4LNK:
-		/* ugh! we have to null-terminate the linktext, or
-		 * vfs_symlink() will choke.  it is always safe to
-		 * null-terminate by brute force, since at worst we
-		 * will overwrite the first byte of the create namelen
-		 * in the XDR buffer, which has already been extracted
-		 * during XDR decode.
-		 */
-		create->cr_linkname[create->cr_linklen] = 0;
-
 		status = nfsd_symlink(rqstp, &cstate->current_fh,
 				      create->cr_name, create->cr_namelen,
 				      create->cr_linkname, create->cr_linklen,
diff -druNp --no-dereference linux-libre-3.15.4-gnu/fs/nfsd/nfs4xdr.c linux-libre-3.15.5-gnu/fs/nfsd/nfs4xdr.c
--- linux-libre-3.15.4-gnu/fs/nfsd/nfs4xdr.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/fs/nfsd/nfs4xdr.c	2014-07-09 14:21:40.000000000 -0400
@@ -602,7 +602,18 @@ nfsd4_decode_create(struct nfsd4_compoun
 		READ_BUF(4);
 		READ32(create->cr_linklen);
 		READ_BUF(create->cr_linklen);
-		SAVEMEM(create->cr_linkname, create->cr_linklen);
+		/*
+		 * The VFS will want a null-terminated string, and
+		 * null-terminating in place isn't safe since this might
+		 * end on a page boundary:
+		 */
+		create->cr_linkname =
+				kmalloc(create->cr_linklen + 1, GFP_KERNEL);
+		if (!create->cr_linkname)
+			return nfserr_jukebox;
+		memcpy(create->cr_linkname, p, create->cr_linklen);
+		create->cr_linkname[create->cr_linklen] = '\0';
+		defer_free(argp, kfree, create->cr_linkname);
 		break;
 	case NF4BLK:
 	case NF4CHR:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/include/drm/i915_powerwell.h linux-libre-3.15.5-gnu/include/drm/i915_powerwell.h
--- linux-libre-3.15.4-gnu/include/drm/i915_powerwell.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/include/drm/i915_powerwell.h	2014-07-09 14:21:40.000000000 -0400
@@ -30,7 +30,8 @@
 #define _I915_POWERWELL_H_
 
 /* For use by hda_i915 driver */
-extern void i915_request_power_well(void);
-extern void i915_release_power_well(void);
+extern int i915_request_power_well(void);
+extern int i915_release_power_well(void);
+extern int i915_get_cdclk_freq(void);
 
 #endif				/* _I915_POWERWELL_H_ */
diff -druNp --no-dereference linux-libre-3.15.4-gnu/include/linux/usb_usual.h linux-libre-3.15.5-gnu/include/linux/usb_usual.h
--- linux-libre-3.15.4-gnu/include/linux/usb_usual.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/include/linux/usb_usual.h	2014-07-09 14:21:40.000000000 -0400
@@ -70,7 +70,9 @@
 	US_FLAG(NEEDS_CAP16,	0x00400000)			\
 		/* cannot handle READ_CAPACITY_10 */		\
 	US_FLAG(IGNORE_UAS,	0x00800000)			\
-		/* Device advertises UAS but it is broken */
+		/* Device advertises UAS but it is broken */	\
+	US_FLAG(BROKEN_FUA,	0x01000000)			\
+		/* Cannot handle FUA in WRITE or READ CDBs */	\
 
 #define US_FLAG(name, value)	US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
diff -druNp --no-dereference linux-libre-3.15.4-gnu/include/scsi/scsi_cmnd.h linux-libre-3.15.5-gnu/include/scsi/scsi_cmnd.h
--- linux-libre-3.15.4-gnu/include/scsi/scsi_cmnd.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/include/scsi/scsi_cmnd.h	2014-07-09 14:21:40.000000000 -0400
@@ -309,7 +309,7 @@ static inline void set_driver_byte(struc
 
 static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd)
 {
-	unsigned int xfer_len = blk_rq_bytes(scmd->request);
+	unsigned int xfer_len = scsi_out(scmd)->length;
 	unsigned int prot_op = scsi_get_prot_op(scmd);
 	unsigned int sector_size = scmd->device->sector_size;
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/include/scsi/scsi_device.h linux-libre-3.15.5-gnu/include/scsi/scsi_device.h
--- linux-libre-3.15.4-gnu/include/scsi/scsi_device.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/include/scsi/scsi_device.h	2014-07-09 14:21:40.000000000 -0400
@@ -173,6 +173,7 @@ struct scsi_device {
 	unsigned is_visible:1;	/* is the device visible in sysfs */
 	unsigned wce_default_on:1;	/* Cache is ON by default */
 	unsigned no_dif:1;	/* T10 PI (DIF) should be disabled */
+	unsigned broken_fua:1;		/* Don't set FUA bit */
 
 	atomic_t disk_events_disable_depth; /* disable depth for disk events */
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/include/uapi/linux/usb/functionfs.h linux-libre-3.15.5-gnu/include/uapi/linux/usb/functionfs.h
--- linux-libre-3.15.4-gnu/include/uapi/linux/usb/functionfs.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/include/uapi/linux/usb/functionfs.h	2014-07-09 14:21:40.000000000 -0400
@@ -33,6 +33,13 @@ struct usb_endpoint_descriptor_no_audio
 	__u8  bInterval;
 } __attribute__((packed));
 
+/* Legacy format, deprecated as of 3.14. */
+struct usb_functionfs_descs_head {
+	__le32 magic;
+	__le32 length;
+	__le32 fs_count;
+	__le32 hs_count;
+} __attribute__((packed, deprecated));
 
 /*
  * Descriptors format:
diff -druNp --no-dereference linux-libre-3.15.4-gnu/kernel/sysctl.c linux-libre-3.15.5-gnu/kernel/sysctl.c
--- linux-libre-3.15.4-gnu/kernel/sysctl.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/kernel/sysctl.c	2014-07-09 14:21:40.000000000 -0400
@@ -136,7 +136,6 @@ static unsigned long dirty_bytes_min = 2
 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
 static int maxolduid = 65535;
 static int minolduid;
-static int min_percpu_pagelist_fract = 8;
 
 static int ngroups_max = NGROUPS_MAX;
 static const int cap_last_cap = CAP_LAST_CAP;
@@ -1305,7 +1304,7 @@ static struct ctl_table vm_table[] = {
 		.maxlen		= sizeof(percpu_pagelist_fraction),
 		.mode		= 0644,
 		.proc_handler	= percpu_pagelist_fraction_sysctl_handler,
-		.extra1		= &min_percpu_pagelist_fract,
+		.extra1		= &zero,
 	},
 #ifdef CONFIG_MMU
 	{
diff -druNp --no-dereference linux-libre-3.15.4-gnu/kernel/trace/trace.c linux-libre-3.15.5-gnu/kernel/trace/trace.c
--- linux-libre-3.15.4-gnu/kernel/trace/trace.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/kernel/trace/trace.c	2014-07-09 14:21:40.000000000 -0400
@@ -1367,7 +1367,6 @@ void tracing_start(void)
 
 	arch_spin_unlock(&ftrace_max_lock);
 
-	ftrace_start();
  out:
 	raw_spin_unlock_irqrestore(&global_trace.start_lock, flags);
 }
@@ -1414,7 +1413,6 @@ void tracing_stop(void)
 	struct ring_buffer *buffer;
 	unsigned long flags;
 
-	ftrace_stop();
 	raw_spin_lock_irqsave(&global_trace.start_lock, flags);
 	if (global_trace.stop_count++)
 		goto out;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/kernel/trace/trace_uprobe.c linux-libre-3.15.5-gnu/kernel/trace/trace_uprobe.c
--- linux-libre-3.15.4-gnu/kernel/trace/trace_uprobe.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/kernel/trace/trace_uprobe.c	2014-07-09 14:21:40.000000000 -0400
@@ -893,6 +893,9 @@ probe_event_enable(struct trace_uprobe *
 	int ret;
 
 	if (file) {
+		if (tu->tp.flags & TP_FLAG_PROFILE)
+			return -EINTR;
+
 		link = kmalloc(sizeof(*link), GFP_KERNEL);
 		if (!link)
 			return -ENOMEM;
@@ -901,29 +904,40 @@ probe_event_enable(struct trace_uprobe *
 		list_add_tail_rcu(&link->list, &tu->tp.files);
 
 		tu->tp.flags |= TP_FLAG_TRACE;
-	} else
-		tu->tp.flags |= TP_FLAG_PROFILE;
+	} else {
+		if (tu->tp.flags & TP_FLAG_TRACE)
+			return -EINTR;
 
-	ret = uprobe_buffer_enable();
-	if (ret < 0)
-		return ret;
+		tu->tp.flags |= TP_FLAG_PROFILE;
+	}
 
 	WARN_ON(!uprobe_filter_is_empty(&tu->filter));
 
 	if (enabled)
 		return 0;
 
+	ret = uprobe_buffer_enable();
+	if (ret)
+		goto err_flags;
+
 	tu->consumer.filter = filter;
 	ret = uprobe_register(tu->inode, tu->offset, &tu->consumer);
-	if (ret) {
-		if (file) {
-			list_del(&link->list);
-			kfree(link);
-			tu->tp.flags &= ~TP_FLAG_TRACE;
-		} else
-			tu->tp.flags &= ~TP_FLAG_PROFILE;
-	}
+	if (ret)
+		goto err_buffer;
+
+	return 0;
+
+ err_buffer:
+	uprobe_buffer_disable();
 
+ err_flags:
+	if (file) {
+		list_del(&link->list);
+		kfree(link);
+		tu->tp.flags &= ~TP_FLAG_TRACE;
+	} else {
+		tu->tp.flags &= ~TP_FLAG_PROFILE;
+	}
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/Makefile linux-libre-3.15.5-gnu/Makefile
--- linux-libre-3.15.4-gnu/Makefile	2014-07-07 00:29:23.000000000 -0400
+++ linux-libre-3.15.5-gnu/Makefile	2014-07-09 17:20:06.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 15
-SUBLEVEL = 4
+SUBLEVEL = 5
 EXTRAVERSION =-gnu
 NAME = Shuffling Zombie Juror
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/mm/hugetlb.c linux-libre-3.15.5-gnu/mm/hugetlb.c
--- linux-libre-3.15.4-gnu/mm/hugetlb.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/mm/hugetlb.c	2014-07-09 14:21:40.000000000 -0400
@@ -2377,6 +2377,31 @@ static void set_huge_ptep_writable(struc
 		update_mmu_cache(vma, address, ptep);
 }
 
+static int is_hugetlb_entry_migration(pte_t pte)
+{
+	swp_entry_t swp;
+
+	if (huge_pte_none(pte) || pte_present(pte))
+		return 0;
+	swp = pte_to_swp_entry(pte);
+	if (non_swap_entry(swp) && is_migration_entry(swp))
+		return 1;
+	else
+		return 0;
+}
+
+static int is_hugetlb_entry_hwpoisoned(pte_t pte)
+{
+	swp_entry_t swp;
+
+	if (huge_pte_none(pte) || pte_present(pte))
+		return 0;
+	swp = pte_to_swp_entry(pte);
+	if (non_swap_entry(swp) && is_hwpoison_entry(swp))
+		return 1;
+	else
+		return 0;
+}
 
 int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 			    struct vm_area_struct *vma)
@@ -2416,10 +2441,26 @@ int copy_hugetlb_page_range(struct mm_st
 		dst_ptl = huge_pte_lock(h, dst, dst_pte);
 		src_ptl = huge_pte_lockptr(h, src, src_pte);
 		spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);
-		if (!huge_pte_none(huge_ptep_get(src_pte))) {
+		entry = huge_ptep_get(src_pte);
+		if (huge_pte_none(entry)) { /* skip none entry */
+			;
+		} else if (unlikely(is_hugetlb_entry_migration(entry) ||
+				    is_hugetlb_entry_hwpoisoned(entry))) {
+			swp_entry_t swp_entry = pte_to_swp_entry(entry);
+
+			if (is_write_migration_entry(swp_entry) && cow) {
+				/*
+				 * COW mappings require pages in both
+				 * parent and child to be set to read.
+				 */
+				make_migration_entry_read(&swp_entry);
+				entry = swp_entry_to_pte(swp_entry);
+				set_huge_pte_at(src, addr, src_pte, entry);
+			}
+			set_huge_pte_at(dst, addr, dst_pte, entry);
+		} else {
 			if (cow)
 				huge_ptep_set_wrprotect(src, addr, src_pte);
-			entry = huge_ptep_get(src_pte);
 			ptepage = pte_page(entry);
 			get_page(ptepage);
 			page_dup_rmap(ptepage);
@@ -2435,32 +2476,6 @@ int copy_hugetlb_page_range(struct mm_st
 	return ret;
 }
 
-static int is_hugetlb_entry_migration(pte_t pte)
-{
-	swp_entry_t swp;
-
-	if (huge_pte_none(pte) || pte_present(pte))
-		return 0;
-	swp = pte_to_swp_entry(pte);
-	if (non_swap_entry(swp) && is_migration_entry(swp))
-		return 1;
-	else
-		return 0;
-}
-
-static int is_hugetlb_entry_hwpoisoned(pte_t pte)
-{
-	swp_entry_t swp;
-
-	if (huge_pte_none(pte) || pte_present(pte))
-		return 0;
-	swp = pte_to_swp_entry(pte);
-	if (non_swap_entry(swp) && is_hwpoison_entry(swp))
-		return 1;
-	else
-		return 0;
-}
-
 void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
 			    unsigned long start, unsigned long end,
 			    struct page *ref_page)
diff -druNp --no-dereference linux-libre-3.15.4-gnu/mm/memory.c linux-libre-3.15.5-gnu/mm/memory.c
--- linux-libre-3.15.4-gnu/mm/memory.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/mm/memory.c	2014-07-09 14:21:40.000000000 -0400
@@ -3920,9 +3920,6 @@ static int __handle_mm_fault(struct mm_s
 		}
 	}
 
-	/* THP should already have been handled */
-	BUG_ON(pmd_numa(*pmd));
-
 	/*
 	 * Use __pte_alloc instead of pte_alloc_map, because we can't
 	 * run pte_offset_map on the pmd, if an huge pmd could
diff -druNp --no-dereference linux-libre-3.15.4-gnu/mm/mempolicy.c linux-libre-3.15.5-gnu/mm/mempolicy.c
--- linux-libre-3.15.4-gnu/mm/mempolicy.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/mm/mempolicy.c	2014-07-09 14:21:40.000000000 -0400
@@ -653,19 +653,18 @@ static unsigned long change_prot_numa(st
  * @nodes and @flags,) it's isolated and queued to the pagelist which is
  * passed via @private.)
  */
-static struct vm_area_struct *
+static int
 queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end,
 		const nodemask_t *nodes, unsigned long flags, void *private)
 {
-	int err;
-	struct vm_area_struct *first, *vma, *prev;
-
+	int err = 0;
+	struct vm_area_struct *vma, *prev;
 
-	first = find_vma(mm, start);
-	if (!first)
-		return ERR_PTR(-EFAULT);
+	vma = find_vma(mm, start);
+	if (!vma)
+		return -EFAULT;
 	prev = NULL;
-	for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) {
+	for (; vma && vma->vm_start < end; vma = vma->vm_next) {
 		unsigned long endvma = vma->vm_end;
 
 		if (endvma > end)
@@ -675,9 +674,9 @@ queue_pages_range(struct mm_struct *mm,
 
 		if (!(flags & MPOL_MF_DISCONTIG_OK)) {
 			if (!vma->vm_next && vma->vm_end < end)
-				return ERR_PTR(-EFAULT);
+				return -EFAULT;
 			if (prev && prev->vm_end < vma->vm_start)
-				return ERR_PTR(-EFAULT);
+				return -EFAULT;
 		}
 
 		if (flags & MPOL_MF_LAZY) {
@@ -691,15 +690,13 @@ queue_pages_range(struct mm_struct *mm,
 
 			err = queue_pages_pgd_range(vma, start, endvma, nodes,
 						flags, private);
-			if (err) {
-				first = ERR_PTR(err);
+			if (err)
 				break;
-			}
 		}
 next:
 		prev = vma;
 	}
-	return first;
+	return err;
 }
 
 /*
@@ -1153,16 +1150,17 @@ out:
 
 /*
  * Allocate a new page for page migration based on vma policy.
- * Start assuming that page is mapped by vma pointed to by @private.
+ * Start by assuming the page is mapped by the same vma as contains @start.
  * Search forward from there, if not.  N.B., this assumes that the
  * list of pages handed to migrate_pages()--which is how we get here--
  * is in virtual address order.
  */
-static struct page *new_vma_page(struct page *page, unsigned long private, int **x)
+static struct page *new_page(struct page *page, unsigned long start, int **x)
 {
-	struct vm_area_struct *vma = (struct vm_area_struct *)private;
+	struct vm_area_struct *vma;
 	unsigned long uninitialized_var(address);
 
+	vma = find_vma(current->mm, start);
 	while (vma) {
 		address = page_address_in_vma(page, vma);
 		if (address != -EFAULT)
@@ -1192,7 +1190,7 @@ int do_migrate_pages(struct mm_struct *m
 	return -ENOSYS;
 }
 
-static struct page *new_vma_page(struct page *page, unsigned long private, int **x)
+static struct page *new_page(struct page *page, unsigned long start, int **x)
 {
 	return NULL;
 }
@@ -1202,7 +1200,6 @@ static long do_mbind(unsigned long start
 		     unsigned short mode, unsigned short mode_flags,
 		     nodemask_t *nmask, unsigned long flags)
 {
-	struct vm_area_struct *vma;
 	struct mm_struct *mm = current->mm;
 	struct mempolicy *new;
 	unsigned long end;
@@ -1268,11 +1265,9 @@ static long do_mbind(unsigned long start
 	if (err)
 		goto mpol_out;
 
-	vma = queue_pages_range(mm, start, end, nmask,
+	err = queue_pages_range(mm, start, end, nmask,
 			  flags | MPOL_MF_INVERT, &pagelist);
-
-	err = PTR_ERR(vma);	/* maybe ... */
-	if (!IS_ERR(vma))
+	if (!err)
 		err = mbind_range(mm, start, end, new);
 
 	if (!err) {
@@ -1280,9 +1275,8 @@ static long do_mbind(unsigned long start
 
 		if (!list_empty(&pagelist)) {
 			WARN_ON_ONCE(flags & MPOL_MF_LAZY);
-			nr_failed = migrate_pages(&pagelist, new_vma_page,
-					(unsigned long)vma,
-					MIGRATE_SYNC, MR_MEMPOLICY_MBIND);
+			nr_failed = migrate_pages(&pagelist, new_page,
+				start, MIGRATE_SYNC, MR_MEMPOLICY_MBIND);
 			if (nr_failed)
 				putback_movable_pages(&pagelist);
 		}
diff -druNp --no-dereference linux-libre-3.15.4-gnu/mm/nommu.c linux-libre-3.15.5-gnu/mm/nommu.c
--- linux-libre-3.15.4-gnu/mm/nommu.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/mm/nommu.c	2014-07-09 14:21:40.000000000 -0400
@@ -783,7 +783,7 @@ static void delete_vma_from_mm(struct vm
 	for (i = 0; i < VMACACHE_SIZE; i++) {
 		/* if the vma is cached, invalidate the entire cache */
 		if (curr->vmacache[i] == vma) {
-			vmacache_invalidate(curr->mm);
+			vmacache_invalidate(mm);
 			break;
 		}
 	}
diff -druNp --no-dereference linux-libre-3.15.4-gnu/mm/page_alloc.c linux-libre-3.15.5-gnu/mm/page_alloc.c
--- linux-libre-3.15.4-gnu/mm/page_alloc.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/mm/page_alloc.c	2014-07-09 14:21:40.000000000 -0400
@@ -69,6 +69,7 @@
 
 /* prevent >1 _updater_ of zone percpu pageset ->high and ->batch fields */
 static DEFINE_MUTEX(pcp_batch_high_lock);
+#define MIN_PERCPU_PAGELIST_FRACTION	(8)
 
 #ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID
 DEFINE_PER_CPU(int, numa_node);
@@ -799,9 +800,21 @@ void __init init_cma_reserved_pageblock(
 		set_page_count(p, 0);
 	} while (++p, --i);
 
-	set_page_refcounted(page);
 	set_pageblock_migratetype(page, MIGRATE_CMA);
-	__free_pages(page, pageblock_order);
+
+	if (pageblock_order >= MAX_ORDER) {
+		i = pageblock_nr_pages;
+		p = page;
+		do {
+			set_page_refcounted(p);
+			__free_pages(p, MAX_ORDER - 1);
+			p += MAX_ORDER_NR_PAGES;
+		} while (i -= MAX_ORDER_NR_PAGES);
+	} else {
+		set_page_refcounted(page);
+		__free_pages(page, pageblock_order);
+	}
+
 	adjust_managed_page_count(page, pageblock_nr_pages);
 }
 #endif
@@ -4107,7 +4120,7 @@ static void __meminit zone_init_free_lis
 	memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY)
 #endif
 
-static int __meminit zone_batchsize(struct zone *zone)
+static int zone_batchsize(struct zone *zone)
 {
 #ifdef CONFIG_MMU
 	int batch;
@@ -4223,8 +4236,8 @@ static void pageset_set_high(struct per_
 	pageset_update(&p->pcp, high, batch);
 }
 
-static void __meminit pageset_set_high_and_batch(struct zone *zone,
-		struct per_cpu_pageset *pcp)
+static void pageset_set_high_and_batch(struct zone *zone,
+				       struct per_cpu_pageset *pcp)
 {
 	if (percpu_pagelist_fraction)
 		pageset_set_high(pcp,
@@ -5850,23 +5863,38 @@ int percpu_pagelist_fraction_sysctl_hand
 	void __user *buffer, size_t *length, loff_t *ppos)
 {
 	struct zone *zone;
-	unsigned int cpu;
+	int old_percpu_pagelist_fraction;
 	int ret;
 
+	mutex_lock(&pcp_batch_high_lock);
+	old_percpu_pagelist_fraction = percpu_pagelist_fraction;
+
 	ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
-	if (!write || (ret < 0))
-		return ret;
+	if (!write || ret < 0)
+		goto out;
+
+	/* Sanity checking to avoid pcp imbalance */
+	if (percpu_pagelist_fraction &&
+	    percpu_pagelist_fraction < MIN_PERCPU_PAGELIST_FRACTION) {
+		percpu_pagelist_fraction = old_percpu_pagelist_fraction;
+		ret = -EINVAL;
+		goto out;
+	}
+
+	/* No change? */
+	if (percpu_pagelist_fraction == old_percpu_pagelist_fraction)
+		goto out;
 
-	mutex_lock(&pcp_batch_high_lock);
 	for_each_populated_zone(zone) {
-		unsigned long  high;
-		high = zone->managed_pages / percpu_pagelist_fraction;
+		unsigned int cpu;
+
 		for_each_possible_cpu(cpu)
-			pageset_set_high(per_cpu_ptr(zone->pageset, cpu),
-					 high);
+			pageset_set_high_and_batch(zone,
+					per_cpu_ptr(zone->pageset, cpu));
 	}
+out:
 	mutex_unlock(&pcp_batch_high_lock);
-	return 0;
+	return ret;
 }
 
 int hashdist = HASHDIST_DEFAULT;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/hci_conn.c linux-libre-3.15.5-gnu/net/bluetooth/hci_conn.c
--- linux-libre-3.15.4-gnu/net/bluetooth/hci_conn.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/hci_conn.c	2014-07-09 14:21:40.000000000 -0400
@@ -584,11 +584,6 @@ static void hci_req_add_le_create_conn(s
 	if (hci_update_random_address(req, false, &own_addr_type))
 		return;
 
-	/* Save the address type used for this connnection attempt so we able
-	 * to retrieve this information if we need it.
-	 */
-	conn->src_type = own_addr_type;
-
 	cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
 	cp.scan_window = cpu_to_le16(hdev->le_scan_window);
 	bacpy(&cp.peer_addr, &conn->dst);
@@ -826,7 +821,7 @@ static int hci_conn_auth(struct hci_conn
 		/* If we're already encrypted set the REAUTH_PEND flag,
 		 * otherwise set the ENCRYPT_PEND.
 		 */
-		if (conn->key_type != 0xff)
+		if (conn->link_mode & HCI_LM_ENCRYPT)
 			set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
 		else
 			set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/hci_event.c linux-libre-3.15.5-gnu/net/bluetooth/hci_event.c
--- linux-libre-3.15.4-gnu/net/bluetooth/hci_event.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/hci_event.c	2014-07-09 14:21:40.000000000 -0400
@@ -48,6 +48,10 @@ static void hci_cc_inquiry_cancel(struct
 	smp_mb__after_clear_bit(); /* wake_up_bit advises about this barrier */
 	wake_up_bit(&hdev->flags, HCI_INQUIRY);
 
+	hci_dev_lock(hdev);
+	hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+	hci_dev_unlock(hdev);
+
 	hci_conn_check_pending(hdev);
 }
 
@@ -3503,8 +3507,11 @@ static void hci_user_confirm_request_evt
 
 		/* If we're not the initiators request authorization to
 		 * proceed from user space (mgmt_user_confirm with
-		 * confirm_hint set to 1). */
-		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags)) {
+		 * confirm_hint set to 1). The exception is if neither
+		 * side had MITM in which case we do auto-accept.
+		 */
+		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
+		    (loc_mitm || rem_mitm)) {
 			BT_DBG("Confirming auto-accept as acceptor");
 			confirm_hint = 1;
 			goto confirm;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/l2cap_core.c linux-libre-3.15.5-gnu/net/bluetooth/l2cap_core.c
--- linux-libre-3.15.4-gnu/net/bluetooth/l2cap_core.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/l2cap_core.c	2014-07-09 14:21:40.000000000 -0400
@@ -1657,7 +1657,13 @@ static void l2cap_conn_del(struct hci_co
 	kfree_skb(conn->rx_skb);
 
 	skb_queue_purge(&conn->pending_rx);
-	flush_work(&conn->pending_rx_work);
+
+	/* We can not call flush_work(&conn->pending_rx_work) here since we
+	 * might block if we are running on a worker from the same workqueue
+	 * pending_rx_work is waiting on.
+	 */
+	if (work_pending(&conn->pending_rx_work))
+		cancel_work_sync(&conn->pending_rx_work);
 
 	l2cap_unregister_all_users(conn);
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/l2cap_sock.c linux-libre-3.15.5-gnu/net/bluetooth/l2cap_sock.c
--- linux-libre-3.15.4-gnu/net/bluetooth/l2cap_sock.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/l2cap_sock.c	2014-07-09 14:21:40.000000000 -0400
@@ -787,11 +787,6 @@ static int l2cap_sock_setsockopt(struct
 
 		/*change security for LE channels */
 		if (chan->scid == L2CAP_CID_ATT) {
-			if (!conn->hcon->out) {
-				err = -EINVAL;
-				break;
-			}
-
 			if (smp_conn_security(conn->hcon, sec.level))
 				break;
 			sk->sk_state = BT_CONFIG;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/mgmt.c linux-libre-3.15.5-gnu/net/bluetooth/mgmt.c
--- linux-libre-3.15.4-gnu/net/bluetooth/mgmt.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/mgmt.c	2014-07-09 14:21:40.000000000 -0400
@@ -1045,6 +1045,43 @@ static void clean_up_hci_complete(struct
 	}
 }
 
+static void hci_stop_discovery(struct hci_request *req)
+{
+	struct hci_dev *hdev = req->hdev;
+	struct hci_cp_remote_name_req_cancel cp;
+	struct inquiry_entry *e;
+
+	switch (hdev->discovery.state) {
+	case DISCOVERY_FINDING:
+		if (test_bit(HCI_INQUIRY, &hdev->flags)) {
+			hci_req_add(req, HCI_OP_INQUIRY_CANCEL, 0, NULL);
+		} else {
+			cancel_delayed_work(&hdev->le_scan_disable);
+			hci_req_add_le_scan_disable(req);
+		}
+
+		break;
+
+	case DISCOVERY_RESOLVING:
+		e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY,
+						     NAME_PENDING);
+		if (!e)
+			return;
+
+		bacpy(&cp.bdaddr, &e->data.bdaddr);
+		hci_req_add(req, HCI_OP_REMOTE_NAME_REQ_CANCEL, sizeof(cp),
+			    &cp);
+
+		break;
+
+	default:
+		/* Passive scanning */
+		if (test_bit(HCI_LE_SCAN, &hdev->dev_flags))
+			hci_req_add_le_scan_disable(req);
+		break;
+	}
+}
+
 static int clean_up_hci_state(struct hci_dev *hdev)
 {
 	struct hci_request req;
@@ -1061,9 +1098,7 @@ static int clean_up_hci_state(struct hci
 	if (test_bit(HCI_ADVERTISING, &hdev->dev_flags))
 		disable_advertising(&req);
 
-	if (test_bit(HCI_LE_SCAN, &hdev->dev_flags)) {
-		hci_req_add_le_scan_disable(&req);
-	}
+	hci_stop_discovery(&req);
 
 	list_for_each_entry(conn, &hdev->conn_hash.list, list) {
 		struct hci_cp_disconnect dc;
@@ -2997,8 +3032,13 @@ static int user_pairing_resp(struct sock
 	}
 
 	if (addr->type == BDADDR_LE_PUBLIC || addr->type == BDADDR_LE_RANDOM) {
-		/* Continue with pairing via SMP */
+		/* Continue with pairing via SMP. The hdev lock must be
+		 * released as SMP may try to recquire it for crypto
+		 * purposes.
+		 */
+		hci_dev_unlock(hdev);
 		err = smp_user_confirm_reply(conn, mgmt_op, passkey);
+		hci_dev_lock(hdev);
 
 		if (!err)
 			err = cmd_complete(sk, hdev->id, mgmt_op,
@@ -3570,8 +3610,6 @@ static int stop_discovery(struct sock *s
 {
 	struct mgmt_cp_stop_discovery *mgmt_cp = data;
 	struct pending_cmd *cmd;
-	struct hci_cp_remote_name_req_cancel cp;
-	struct inquiry_entry *e;
 	struct hci_request req;
 	int err;
 
@@ -3601,52 +3639,22 @@ static int stop_discovery(struct sock *s
 
 	hci_req_init(&req, hdev);
 
-	switch (hdev->discovery.state) {
-	case DISCOVERY_FINDING:
-		if (test_bit(HCI_INQUIRY, &hdev->flags)) {
-			hci_req_add(&req, HCI_OP_INQUIRY_CANCEL, 0, NULL);
-		} else {
-			cancel_delayed_work(&hdev->le_scan_disable);
-
-			hci_req_add_le_scan_disable(&req);
-		}
-
-		break;
-
-	case DISCOVERY_RESOLVING:
-		e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY,
-						     NAME_PENDING);
-		if (!e) {
-			mgmt_pending_remove(cmd);
-			err = cmd_complete(sk, hdev->id,
-					   MGMT_OP_STOP_DISCOVERY, 0,
-					   &mgmt_cp->type,
-					   sizeof(mgmt_cp->type));
-			hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
-			goto unlock;
-		}
-
-		bacpy(&cp.bdaddr, &e->data.bdaddr);
-		hci_req_add(&req, HCI_OP_REMOTE_NAME_REQ_CANCEL, sizeof(cp),
-			    &cp);
-
-		break;
-
-	default:
-		BT_DBG("unknown discovery state %u", hdev->discovery.state);
+	hci_stop_discovery(&req);
 
-		mgmt_pending_remove(cmd);
-		err = cmd_complete(sk, hdev->id, MGMT_OP_STOP_DISCOVERY,
-				   MGMT_STATUS_FAILED, &mgmt_cp->type,
-				   sizeof(mgmt_cp->type));
+	err = hci_req_run(&req, stop_discovery_complete);
+	if (!err) {
+		hci_discovery_set_state(hdev, DISCOVERY_STOPPING);
 		goto unlock;
 	}
 
-	err = hci_req_run(&req, stop_discovery_complete);
-	if (err < 0)
-		mgmt_pending_remove(cmd);
-	else
-		hci_discovery_set_state(hdev, DISCOVERY_STOPPING);
+	mgmt_pending_remove(cmd);
+
+	/* If no HCI commands were sent we're done */
+	if (err == -ENODATA) {
+		err = cmd_complete(sk, hdev->id, MGMT_OP_STOP_DISCOVERY, 0,
+				   &mgmt_cp->type, sizeof(mgmt_cp->type));
+		hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+	}
 
 unlock:
 	hci_dev_unlock(hdev);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/bluetooth/smp.c linux-libre-3.15.5-gnu/net/bluetooth/smp.c
--- linux-libre-3.15.4-gnu/net/bluetooth/smp.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/bluetooth/smp.c	2014-07-09 14:21:40.000000000 -0400
@@ -533,7 +533,7 @@ static void random_work(struct work_stru
 		hci_le_start_enc(hcon, ediv, rand, stk);
 		hcon->enc_key_size = smp->enc_key_size;
 	} else {
-		u8 stk[16];
+		u8 stk[16], auth;
 		__le64 rand = 0;
 		__le16 ediv = 0;
 
@@ -545,8 +545,13 @@ static void random_work(struct work_stru
 		memset(stk + smp->enc_key_size, 0,
 		       SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size);
 
+		if (hcon->pending_sec_level == BT_SECURITY_HIGH)
+			auth = 1;
+		else
+			auth = 0;
+
 		hci_add_ltk(hcon->hdev, &hcon->dst, hcon->dst_type,
-			    HCI_SMP_STK_SLAVE, 0, stk, smp->enc_key_size,
+			    HCI_SMP_STK_SLAVE, auth, stk, smp->enc_key_size,
 			    ediv, rand);
 	}
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/mac80211/debugfs_netdev.c linux-libre-3.15.5-gnu/net/mac80211/debugfs_netdev.c
--- linux-libre-3.15.4-gnu/net/mac80211/debugfs_netdev.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/mac80211/debugfs_netdev.c	2014-07-09 14:21:40.000000000 -0400
@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read(
 	ssize_t ret = -EINVAL;
 
 	read_lock(&dev_base_lock);
-	if (sdata->dev->reg_state == NETREG_REGISTERED)
-		ret = (*format)(sdata, buf, sizeof(buf));
+	ret = (*format)(sdata, buf, sizeof(buf));
 	read_unlock(&dev_base_lock);
 
 	if (ret >= 0)
@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write(
 
 	ret = -ENODEV;
 	rtnl_lock();
-	if (sdata->dev->reg_state == NETREG_REGISTERED)
-		ret = (*write)(sdata, buf, count);
+	ret = (*write)(sdata, buf, count);
 	rtnl_unlock();
 
 	return ret;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/mac80211/ibss.c linux-libre-3.15.5-gnu/net/mac80211/ibss.c
--- linux-libre-3.15.4-gnu/net/mac80211/ibss.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/mac80211/ibss.c	2014-07-09 14:21:40.000000000 -0400
@@ -1648,6 +1648,7 @@ int ieee80211_ibss_join(struct ieee80211
 	sdata->u.ibss.control_port = params->control_port;
 	sdata->u.ibss.userspace_handles_dfs = params->userspace_handles_dfs;
 	sdata->u.ibss.basic_rates = params->basic_rates;
+	sdata->u.ibss.last_scan_completed = jiffies;
 
 	/* fix basic_rates if channel does not support these rates */
 	rate_flags = ieee80211_chandef_rate_flags(&params->chandef);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/mac80211/sta_info.c linux-libre-3.15.5-gnu/net/mac80211/sta_info.c
--- linux-libre-3.15.4-gnu/net/mac80211/sta_info.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/mac80211/sta_info.c	2014-07-09 14:21:40.000000000 -0400
@@ -240,6 +240,7 @@ void sta_info_free(struct ieee80211_loca
 
 	sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
 
+	kfree(rcu_dereference_raw(sta->sta.rates));
 	kfree(sta);
 }
 
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/netfilter/nf_conntrack_netlink.c linux-libre-3.15.5-gnu/net/netfilter/nf_conntrack_netlink.c
--- linux-libre-3.15.4-gnu/net/netfilter/nf_conntrack_netlink.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/netfilter/nf_conntrack_netlink.c	2014-07-09 14:21:40.000000000 -0400
@@ -1150,7 +1150,7 @@ static int ctnetlink_done_list(struct ne
 static int
 ctnetlink_dump_list(struct sk_buff *skb, struct netlink_callback *cb, bool dying)
 {
-	struct nf_conn *ct, *last = NULL;
+	struct nf_conn *ct, *last;
 	struct nf_conntrack_tuple_hash *h;
 	struct hlist_nulls_node *n;
 	struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
@@ -1163,8 +1163,7 @@ ctnetlink_dump_list(struct sk_buff *skb,
 	if (cb->args[2])
 		return 0;
 
-	if (cb->args[0] == nr_cpu_ids)
-		return 0;
+	last = (struct nf_conn *)cb->args[1];
 
 	for (cpu = cb->args[0]; cpu < nr_cpu_ids; cpu++) {
 		struct ct_pcpu *pcpu;
@@ -1174,7 +1173,6 @@ ctnetlink_dump_list(struct sk_buff *skb,
 
 		pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu);
 		spin_lock_bh(&pcpu->lock);
-		last = (struct nf_conn *)cb->args[1];
 		list = dying ? &pcpu->dying : &pcpu->unconfirmed;
 restart:
 		hlist_nulls_for_each_entry(h, n, list, hnnode) {
@@ -1193,7 +1191,9 @@ restart:
 						  ct);
 			rcu_read_unlock();
 			if (res < 0) {
-				nf_conntrack_get(&ct->ct_general);
+				if (!atomic_inc_not_zero(&ct->ct_general.use))
+					continue;
+				cb->args[0] = cpu;
 				cb->args[1] = (unsigned long)ct;
 				spin_unlock_bh(&pcpu->lock);
 				goto out;
@@ -1202,10 +1202,10 @@ restart:
 		if (cb->args[1]) {
 			cb->args[1] = 0;
 			goto restart;
-		} else
-			cb->args[2] = 1;
+		}
 		spin_unlock_bh(&pcpu->lock);
 	}
+	cb->args[2] = 1;
 out:
 	if (last)
 		nf_ct_put(last);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/net/netfilter/nf_nat_core.c linux-libre-3.15.5-gnu/net/netfilter/nf_nat_core.c
--- linux-libre-3.15.4-gnu/net/netfilter/nf_nat_core.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/net/netfilter/nf_nat_core.c	2014-07-09 14:21:40.000000000 -0400
@@ -517,6 +517,39 @@ static int nf_nat_proto_remove(struct nf
 	return i->status & IPS_NAT_MASK ? 1 : 0;
 }
 
+static int nf_nat_proto_clean(struct nf_conn *ct, void *data)
+{
+	struct nf_conn_nat *nat = nfct_nat(ct);
+
+	if (nf_nat_proto_remove(ct, data))
+		return 1;
+
+	if (!nat || !nat->ct)
+		return 0;
+
+	/* This netns is being destroyed, and conntrack has nat null binding.
+	 * Remove it from bysource hash, as the table will be freed soon.
+	 *
+	 * Else, when the conntrack is destoyed, nf_nat_cleanup_conntrack()
+	 * will delete entry from already-freed table.
+	 */
+	if (!del_timer(&ct->timeout))
+		return 1;
+
+	spin_lock_bh(&nf_nat_lock);
+	hlist_del_rcu(&nat->bysource);
+	ct->status &= ~IPS_NAT_DONE_MASK;
+	nat->ct = NULL;
+	spin_unlock_bh(&nf_nat_lock);
+
+	add_timer(&ct->timeout);
+
+	/* don't delete conntrack.  Although that would make things a lot
+	 * simpler, we'd end up flushing all conntracks on nat rmmod.
+	 */
+	return 0;
+}
+
 static void nf_nat_l4proto_clean(u8 l3proto, u8 l4proto)
 {
 	struct nf_nat_proto_clean clean = {
@@ -787,7 +820,7 @@ static void __net_exit nf_nat_net_exit(s
 {
 	struct nf_nat_proto_clean clean = {};
 
-	nf_ct_iterate_cleanup(net, &nf_nat_proto_remove, &clean, 0, 0);
+	nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean, 0, 0);
 	synchronize_rcu();
 	nf_ct_free_hashtable(net->ct.nat_bysource, net->ct.nat_htable_size);
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/sound/pci/hda/hda_i915.c linux-libre-3.15.5-gnu/sound/pci/hda/hda_i915.c
--- linux-libre-3.15.4-gnu/sound/pci/hda/hda_i915.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/sound/pci/hda/hda_i915.c	2014-07-09 14:21:40.000000000 -0400
@@ -20,24 +20,71 @@
 #include <linux/module.h>
 #include <sound/core.h>
 #include <drm/i915_powerwell.h>
+#include "hda_priv.h"
 #include "hda_i915.h"
 
-static void (*get_power)(void);
-static void (*put_power)(void);
+/* Intel HSW/BDW display HDA controller Extended Mode registers.
+ * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
+ * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
+ * The values will be lost when the display power well is disabled.
+ */
+#define ICH6_REG_EM4			0x100c
+#define ICH6_REG_EM5			0x1010
 
-void hda_display_power(bool enable)
+static int (*get_power)(void);
+static int (*put_power)(void);
+static int (*get_cdclk)(void);
+
+int hda_display_power(bool enable)
 {
 	if (!get_power || !put_power)
-		return;
+		return -ENODEV;
 
 	pr_debug("HDA display power %s \n",
 			enable ? "Enable" : "Disable");
 	if (enable)
-		get_power();
+		return get_power();
 	else
-		put_power();
+		return put_power();
 }
 
+void haswell_set_bclk(struct azx *chip)
+{
+	int cdclk_freq;
+	unsigned int bclk_m, bclk_n;
+
+	if (!get_cdclk)
+		return;
+
+	cdclk_freq = get_cdclk();
+	switch (cdclk_freq) {
+	case 337500:
+		bclk_m = 16;
+		bclk_n = 225;
+		break;
+
+	case 450000:
+	default: /* default CDCLK 450MHz */
+		bclk_m = 4;
+		bclk_n = 75;
+		break;
+
+	case 540000:
+		bclk_m = 4;
+		bclk_n = 90;
+		break;
+
+	case 675000:
+		bclk_m = 8;
+		bclk_n = 225;
+		break;
+	}
+
+	azx_writew(chip, EM4, bclk_m);
+	azx_writew(chip, EM5, bclk_n);
+}
+
+
 int hda_i915_init(void)
 {
 	int err = 0;
@@ -55,6 +102,10 @@ int hda_i915_init(void)
 		return -ENODEV;
 	}
 
+	get_cdclk = symbol_request(i915_get_cdclk_freq);
+	if (!get_cdclk)	/* may have abnormal BCLK and audio playback rate */
+		pr_warn("hda-i915: get_cdclk symbol get fail\n");
+
 	pr_debug("HDA driver get symbol successfully from i915 module\n");
 
 	return err;
@@ -70,6 +121,10 @@ int hda_i915_exit(void)
 		symbol_put(i915_release_power_well);
 		put_power = NULL;
 	}
+	if (get_cdclk) {
+		symbol_put(i915_get_cdclk_freq);
+		get_cdclk = NULL;
+	}
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.15.4-gnu/sound/pci/hda/hda_i915.h linux-libre-3.15.5-gnu/sound/pci/hda/hda_i915.h
--- linux-libre-3.15.4-gnu/sound/pci/hda/hda_i915.h	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/sound/pci/hda/hda_i915.h	2014-07-09 14:21:40.000000000 -0400
@@ -17,11 +17,13 @@
 #define __SOUND_HDA_I915_H
 
 #ifdef CONFIG_SND_HDA_I915
-void hda_display_power(bool enable);
+int hda_display_power(bool enable);
+void haswell_set_bclk(struct azx *chip);
 int hda_i915_init(void);
 int hda_i915_exit(void);
 #else
-static inline void hda_display_power(bool enable) {}
+static inline int hda_display_power(bool enable) { return 0; }
+static inline void haswell_set_bclk(struct azx *chip) { return; }
 static inline int hda_i915_init(void)
 {
 	return -ENODEV;
diff -druNp --no-dereference linux-libre-3.15.4-gnu/sound/pci/hda/hda_intel.c linux-libre-3.15.5-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-3.15.4-gnu/sound/pci/hda/hda_intel.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/sound/pci/hda/hda_intel.c	2014-07-09 14:21:40.000000000 -0400
@@ -62,9 +62,9 @@
 #include <linux/vga_switcheroo.h>
 #include <linux/firmware.h>
 #include "hda_codec.h"
-#include "hda_i915.h"
 #include "hda_controller.h"
 #include "hda_priv.h"
+#include "hda_i915.h"
 
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
@@ -282,21 +282,8 @@ static char *driver_short_names[] = {
 	[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
 };
 
-
-/* Intel HSW/BDW display HDA controller Extended Mode registers.
- * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
- * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
- * The values will be lost when the display power well is disabled.
- */
-#define ICH6_REG_EM4			0x100c
-#define ICH6_REG_EM5			0x1010
-
 struct hda_intel {
 	struct azx chip;
-
-	/* HSW/BDW display HDA controller to restore BCLK from CDCLK */
-	unsigned int bclk_m;
-	unsigned int bclk_n;
 };
 
 
@@ -592,22 +579,6 @@ static int param_set_xint(const char *va
 #define azx_del_card_list(chip) /* NOP */
 #endif /* CONFIG_PM */
 
-static void haswell_save_bclk(struct azx *chip)
-{
-	struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
-
-	hda->bclk_m = azx_readw(chip, EM4);
-	hda->bclk_n = azx_readw(chip, EM5);
-}
-
-static void haswell_restore_bclk(struct azx *chip)
-{
-	struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
-
-	azx_writew(chip, EM4, hda->bclk_m);
-	azx_writew(chip, EM5, hda->bclk_n);
-}
-
 #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO)
 /*
  * power management
@@ -635,12 +606,6 @@ static int azx_suspend(struct device *de
 		chip->irq = -1;
 	}
 
-	/* Save BCLK M/N values before they become invalid in D3.
-	 * Will test if display power well can be released now.
-	 */
-	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
-		haswell_save_bclk(chip);
-
 	if (chip->msi)
 		pci_disable_msi(chip->pci);
 	pci_disable_device(pci);
@@ -662,7 +627,7 @@ static int azx_resume(struct device *dev
 
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
 		hda_display_power(true);
-		haswell_restore_bclk(chip);
+		haswell_set_bclk(chip);
 	}
 	pci_set_power_state(pci, PCI_D0);
 	pci_restore_state(pci);
@@ -707,10 +672,9 @@ static int azx_runtime_suspend(struct de
 	azx_stop_chip(chip);
 	azx_enter_link_reset(chip);
 	azx_clear_irq_pending(chip);
-	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
-		haswell_save_bclk(chip);
+	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
 		hda_display_power(false);
-	}
+
 	return 0;
 }
 
@@ -730,7 +694,7 @@ static int azx_runtime_resume(struct dev
 
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
 		hda_display_power(true);
-		haswell_restore_bclk(chip);
+		haswell_set_bclk(chip);
 	}
 
 	/* Read STATESTS before controller reset */
@@ -1426,6 +1390,10 @@ static int azx_first_init(struct azx *ch
 
 	/* initialize chip */
 	azx_init_pci(chip);
+
+	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
+		haswell_set_bclk(chip);
+
 	azx_init_chip(chip, (probe_only[dev] & 2) == 0);
 
 	/* codec detection */
@@ -1707,8 +1675,13 @@ static int azx_probe_continue(struct azx
 				"Error request power-well from i915\n");
 			goto out_free;
 		}
+		err = hda_display_power(true);
+		if (err < 0) {
+			dev_err(chip->card->dev,
+				"Cannot turn on display power on i915\n");
+			goto out_free;
+		}
 #endif
-		hda_display_power(true);
 	}
 
 	err = azx_first_init(chip);
diff -druNp --no-dereference linux-libre-3.15.4-gnu/tools/usb/ffs-test.c linux-libre-3.15.5-gnu/tools/usb/ffs-test.c
--- linux-libre-3.15.4-gnu/tools/usb/ffs-test.c	2014-07-06 21:59:25.000000000 -0400
+++ linux-libre-3.15.5-gnu/tools/usb/ffs-test.c	2014-07-09 14:21:40.000000000 -0400
@@ -116,8 +116,8 @@ static const struct {
 	.header = {
 		.magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC),
 		.length = cpu_to_le32(sizeof descriptors),
-		.fs_count = 3,
-		.hs_count = 3,
+		.fs_count = cpu_to_le32(3),
+		.hs_count = cpu_to_le32(3),
 	},
 	.fs_descs = {
 		.intf = {
