diff -druNp --no-dereference linux-libre-3.18.44-gnu/arch/mips/kvm/emulate.c linux-libre-3.18.45-gnu/arch/mips/kvm/emulate.c
--- linux-libre-3.18.44-gnu/arch/mips/kvm/emulate.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/arch/mips/kvm/emulate.c	2016-11-29 11:44:43.000000000 -0500
@@ -752,15 +752,15 @@ enum emulation_result kvm_mips_emul_eret
 	struct mips_coproc *cop0 = vcpu->arch.cop0;
 	enum emulation_result er = EMULATE_DONE;
 
-	if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
+	if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
+		kvm_clear_c0_guest_status(cop0, ST0_ERL);
+		vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
+	} else if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
 		kvm_debug("[%#lx] ERET to %#lx\n", vcpu->arch.pc,
 			  kvm_read_c0_guest_epc(cop0));
 		kvm_clear_c0_guest_status(cop0, ST0_EXL);
 		vcpu->arch.pc = kvm_read_c0_guest_epc(cop0);
 
-	} else if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
-		kvm_clear_c0_guest_status(cop0, ST0_ERL);
-		vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
 	} else {
 		kvm_err("[%#lx] ERET when MIPS_SR_EXL|MIPS_SR_ERL == 0\n",
 			vcpu->arch.pc);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/arch/parisc/kernel/syscall.S linux-libre-3.18.45-gnu/arch/parisc/kernel/syscall.S
--- linux-libre-3.18.44-gnu/arch/parisc/kernel/syscall.S	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/arch/parisc/kernel/syscall.S	2016-11-29 11:44:43.000000000 -0500
@@ -106,8 +106,6 @@ linux_gateway_entry:
 	mtsp	%r0,%sr4			/* get kernel space into sr4 */
 	mtsp	%r0,%sr5			/* get kernel space into sr5 */
 	mtsp	%r0,%sr6			/* get kernel space into sr6 */
-	mfsp    %sr7,%r1                        /* save user sr7 */
-	mtsp    %r1,%sr3                        /* and store it in sr3 */
 
 #ifdef CONFIG_64BIT
 	/* for now we can *always* set the W bit on entry to the syscall
@@ -133,6 +131,14 @@ linux_gateway_entry:
 	depdi	0, 31, 32, %r21
 1:	
 #endif
+
+	/* We use a rsm/ssm pair to prevent sr3 from being clobbered
+	 * by external interrupts.
+	 */
+	mfsp    %sr7,%r1                        /* save user sr7 */
+	rsm	PSW_SM_I, %r0			/* disable interrupts */
+	mtsp    %r1,%sr3                        /* and store it in sr3 */
+
 	mfctl   %cr30,%r1
 	xor     %r1,%r30,%r30                   /* ye olde xor trick */
 	xor     %r1,%r30,%r1
@@ -147,6 +153,7 @@ linux_gateway_entry:
 	 */
 
 	mtsp	%r0,%sr7			/* get kernel space into sr7 */
+	ssm	PSW_SM_I, %r0			/* enable interrupts */
 	STREGM	%r1,FRAME_SIZE(%r30)		/* save r1 (usp) here for now */
 	mfctl	%cr30,%r1			/* get task ptr in %r1 */
 	LDREG	TI_TASK(%r1),%r1
diff -druNp --no-dereference linux-libre-3.18.44-gnu/arch/powerpc/kernel/idle_power7.S linux-libre-3.18.45-gnu/arch/powerpc/kernel/idle_power7.S
--- linux-libre-3.18.44-gnu/arch/powerpc/kernel/idle_power7.S	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/arch/powerpc/kernel/idle_power7.S	2016-11-29 11:44:43.000000000 -0500
@@ -28,7 +28,7 @@
 	std	r0,0(r1);					\
 	ptesync;						\
 	ld	r0,0(r1);					\
-1:	cmp	cr0,r0,r0;					\
+1:	cmpd	cr0,r0,r0;					\
 	bne	1b;						\
 	IDLE_INST;						\
 	b	.
diff -druNp --no-dereference linux-libre-3.18.44-gnu/arch/powerpc/mm/copro_fault.c linux-libre-3.18.45-gnu/arch/powerpc/mm/copro_fault.c
--- linux-libre-3.18.44-gnu/arch/powerpc/mm/copro_fault.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/arch/powerpc/mm/copro_fault.c	2016-11-29 11:44:43.000000000 -0500
@@ -102,6 +102,8 @@ int copro_calculate_slb(struct mm_struct
 	switch (REGION_ID(ea)) {
 	case USER_REGION_ID:
 		pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
+		if (mm == NULL)
+			return 1;
 		psize = get_slice_psize(mm, ea);
 		ssize = user_segment_size(ea);
 		vsid = get_vsid(mm->context.id, ea, ssize);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/char/virtio_console.c linux-libre-3.18.45-gnu/drivers/char/virtio_console.c
--- linux-libre-3.18.44-gnu/drivers/char/virtio_console.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/char/virtio_console.c	2016-11-29 11:44:43.000000000 -0500
@@ -1532,19 +1532,29 @@ static void remove_port_data(struct port
 	spin_lock_irq(&port->inbuf_lock);
 	/* Remove unused data this port might have received. */
 	discard_port_data(port);
+	spin_unlock_irq(&port->inbuf_lock);
 
 	/* Remove buffers we queued up for the Host to send us data in. */
-	while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
-		free_buf(buf, true);
-	spin_unlock_irq(&port->inbuf_lock);
+	do {
+		spin_lock_irq(&port->inbuf_lock);
+		buf = virtqueue_detach_unused_buf(port->in_vq);
+		spin_unlock_irq(&port->inbuf_lock);
+		if (buf)
+			free_buf(buf, true);
+	} while (buf);
 
 	spin_lock_irq(&port->outvq_lock);
 	reclaim_consumed_buffers(port);
+	spin_unlock_irq(&port->outvq_lock);
 
 	/* Free pending buffers from the out-queue. */
-	while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
-		free_buf(buf, true);
-	spin_unlock_irq(&port->outvq_lock);
+	do {
+		spin_lock_irq(&port->outvq_lock);
+		buf = virtqueue_detach_unused_buf(port->out_vq);
+		spin_unlock_irq(&port->outvq_lock);
+		if (buf)
+			free_buf(buf, true);
+	} while (buf);
 }
 
 /*
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/firewire/net.c linux-libre-3.18.45-gnu/drivers/firewire/net.c
--- linux-libre-3.18.44-gnu/drivers/firewire/net.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/firewire/net.c	2016-11-29 11:44:43.000000000 -0500
@@ -73,13 +73,13 @@ struct rfc2734_header {
 
 #define fwnet_get_hdr_lf(h)		(((h)->w0 & 0xc0000000) >> 30)
 #define fwnet_get_hdr_ether_type(h)	(((h)->w0 & 0x0000ffff))
-#define fwnet_get_hdr_dg_size(h)	(((h)->w0 & 0x0fff0000) >> 16)
+#define fwnet_get_hdr_dg_size(h)	((((h)->w0 & 0x0fff0000) >> 16) + 1)
 #define fwnet_get_hdr_fg_off(h)		(((h)->w0 & 0x00000fff))
 #define fwnet_get_hdr_dgl(h)		(((h)->w1 & 0xffff0000) >> 16)
 
-#define fwnet_set_hdr_lf(lf)		((lf)  << 30)
+#define fwnet_set_hdr_lf(lf)		((lf) << 30)
 #define fwnet_set_hdr_ether_type(et)	(et)
-#define fwnet_set_hdr_dg_size(dgs)	((dgs) << 16)
+#define fwnet_set_hdr_dg_size(dgs)	(((dgs) - 1) << 16)
 #define fwnet_set_hdr_fg_off(fgo)	(fgo)
 
 #define fwnet_set_hdr_dgl(dgl)		((dgl) << 16)
@@ -591,6 +591,9 @@ static int fwnet_incoming_packet(struct
 	int retval;
 	u16 ether_type;
 
+	if (len <= RFC2374_UNFRAG_HDR_SIZE)
+		return 0;
+
 	hdr.w0 = be32_to_cpu(buf[0]);
 	lf = fwnet_get_hdr_lf(&hdr);
 	if (lf == RFC2374_HDR_UNFRAG) {
@@ -615,7 +618,12 @@ static int fwnet_incoming_packet(struct
 		return fwnet_finish_incoming_packet(net, skb, source_node_id,
 						    is_broadcast, ether_type);
 	}
+
 	/* A datagram fragment has been received, now the fun begins. */
+
+	if (len <= RFC2374_FRAG_HDR_SIZE)
+		return 0;
+
 	hdr.w1 = ntohl(buf[1]);
 	buf += 2;
 	len -= RFC2374_FRAG_HDR_SIZE;
@@ -627,7 +635,10 @@ static int fwnet_incoming_packet(struct
 		fg_off = fwnet_get_hdr_fg_off(&hdr);
 	}
 	datagram_label = fwnet_get_hdr_dgl(&hdr);
-	dg_size = fwnet_get_hdr_dg_size(&hdr); /* ??? + 1 */
+	dg_size = fwnet_get_hdr_dg_size(&hdr);
+
+	if (fg_off + len > dg_size)
+		return 0;
 
 	spin_lock_irqsave(&dev->lock, flags);
 
@@ -735,6 +746,22 @@ static void fwnet_receive_packet(struct
 	fw_send_response(card, r, rcode);
 }
 
+static int gasp_source_id(__be32 *p)
+{
+	return be32_to_cpu(p[0]) >> 16;
+}
+
+static u32 gasp_specifier_id(__be32 *p)
+{
+	return (be32_to_cpu(p[0]) & 0xffff) << 8 |
+	       (be32_to_cpu(p[1]) & 0xff000000) >> 24;
+}
+
+static u32 gasp_version(__be32 *p)
+{
+	return be32_to_cpu(p[1]) & 0xffffff;
+}
+
 static void fwnet_receive_broadcast(struct fw_iso_context *context,
 		u32 cycle, size_t header_length, void *header, void *data)
 {
@@ -744,9 +771,6 @@ static void fwnet_receive_broadcast(stru
 	__be32 *buf_ptr;
 	int retval;
 	u32 length;
-	u16 source_node_id;
-	u32 specifier_id;
-	u32 ver;
 	unsigned long offset;
 	unsigned long flags;
 
@@ -763,22 +787,17 @@ static void fwnet_receive_broadcast(stru
 
 	spin_unlock_irqrestore(&dev->lock, flags);
 
-	specifier_id =    (be32_to_cpu(buf_ptr[0]) & 0xffff) << 8
-			| (be32_to_cpu(buf_ptr[1]) & 0xff000000) >> 24;
-	ver = be32_to_cpu(buf_ptr[1]) & 0xffffff;
-	source_node_id = be32_to_cpu(buf_ptr[0]) >> 16;
-
-	if (specifier_id == IANA_SPECIFIER_ID &&
-	    (ver == RFC2734_SW_VERSION
+	if (length > IEEE1394_GASP_HDR_SIZE &&
+	    gasp_specifier_id(buf_ptr) == IANA_SPECIFIER_ID &&
+	    (gasp_version(buf_ptr) == RFC2734_SW_VERSION
 #if IS_ENABLED(CONFIG_IPV6)
-	     || ver == RFC3146_SW_VERSION
+	     || gasp_version(buf_ptr) == RFC3146_SW_VERSION
 #endif
-	    )) {
-		buf_ptr += 2;
-		length -= IEEE1394_GASP_HDR_SIZE;
-		fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
+	    ))
+		fwnet_incoming_packet(dev, buf_ptr + 2,
+				      length - IEEE1394_GASP_HDR_SIZE,
+				      gasp_source_id(buf_ptr),
 				      context->card->generation, true);
-	}
 
 	packet.payload_length = dev->rcv_buffer_size;
 	packet.interrupt = 1;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/ni.c linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/ni.c
--- linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/ni.c	2016-10-24 20:17:48.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/ni.c	2016-11-30 13:36:08.000000000 -0500
@@ -1319,9 +1319,7 @@ static void cayman_pcie_gart_fini(struct
 void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
 			      int ring, u32 cp_int_cntl)
 {
-	u32 srbm_gfx_cntl = RREG32(SRBM_GFX_CNTL) & ~3;
-
-	WREG32(SRBM_GFX_CNTL, srbm_gfx_cntl | (ring & 3));
+	WREG32(SRBM_GFX_CNTL, RINGID(ring));
 	WREG32(CP_INT_CNTL, cp_int_cntl);
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/r600_dpm.c linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/r600_dpm.c
--- linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/r600_dpm.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/r600_dpm.c	2016-11-29 11:44:43.000000000 -0500
@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct rade
 	struct drm_device *dev = rdev->ddev;
 	struct drm_crtc *crtc;
 	struct radeon_crtc *radeon_crtc;
-	u32 line_time_us, vblank_lines;
+	u32 vblank_in_pixels;
 	u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
 
 	if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
 		list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 			radeon_crtc = to_radeon_crtc(crtc);
 			if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
-				line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
-					radeon_crtc->hw_mode.clock;
-				vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
-					radeon_crtc->hw_mode.crtc_vdisplay +
-					(radeon_crtc->v_border * 2);
-				vblank_time_us = vblank_lines * line_time_us;
+				vblank_in_pixels =
+					radeon_crtc->hw_mode.crtc_htotal *
+					(radeon_crtc->hw_mode.crtc_vblank_end -
+					 radeon_crtc->hw_mode.crtc_vdisplay +
+					 (radeon_crtc->v_border * 2));
+
+				vblank_time_us = vblank_in_pixels * 1000 / radeon_crtc->hw_mode.clock;
 				break;
 			}
 		}
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/si_dpm.c linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/si_dpm.c
--- linux-libre-3.18.44-gnu/drivers/gpu/drm/radeon/si_dpm.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/gpu/drm/radeon/si_dpm.c	2016-11-29 11:44:43.000000000 -0500
@@ -2945,6 +2945,49 @@ static void si_apply_state_adjust_rules(
 	int i;
 	struct si_dpm_quirk *p = si_dpm_quirk_list;
 
+	/* limit all SI kickers */
+	if (rdev->family == CHIP_PITCAIRN) {
+		if ((rdev->pdev->revision == 0x81) ||
+		    (rdev->pdev->device == 0x6810) ||
+		    (rdev->pdev->device == 0x6811) ||
+		    (rdev->pdev->device == 0x6816) ||
+		    (rdev->pdev->device == 0x6817) ||
+		    (rdev->pdev->device == 0x6806))
+			max_mclk = 120000;
+	} else if (rdev->family == CHIP_VERDE) {
+		if ((rdev->pdev->revision == 0x81) ||
+		    (rdev->pdev->revision == 0x83) ||
+		    (rdev->pdev->revision == 0x87) ||
+		    (rdev->pdev->device == 0x6820) ||
+		    (rdev->pdev->device == 0x6821) ||
+		    (rdev->pdev->device == 0x6822) ||
+		    (rdev->pdev->device == 0x6823) ||
+		    (rdev->pdev->device == 0x682A) ||
+		    (rdev->pdev->device == 0x682B)) {
+			max_sclk = 75000;
+			max_mclk = 80000;
+		}
+	} else if (rdev->family == CHIP_OLAND) {
+		if ((rdev->pdev->revision == 0xC7) ||
+		    (rdev->pdev->revision == 0x80) ||
+		    (rdev->pdev->revision == 0x81) ||
+		    (rdev->pdev->revision == 0x83) ||
+		    (rdev->pdev->device == 0x6604) ||
+		    (rdev->pdev->device == 0x6605)) {
+			max_sclk = 75000;
+			max_mclk = 80000;
+		}
+	} else if (rdev->family == CHIP_HAINAN) {
+		if ((rdev->pdev->revision == 0x81) ||
+		    (rdev->pdev->revision == 0x83) ||
+		    (rdev->pdev->revision == 0xC3) ||
+		    (rdev->pdev->device == 0x6664) ||
+		    (rdev->pdev->device == 0x6665) ||
+		    (rdev->pdev->device == 0x6667)) {
+			max_sclk = 75000;
+			max_mclk = 80000;
+		}
+	}
 	/* Apply dpm quirks */
 	while (p && p->chip_device != 0) {
 		if (rdev->pdev->vendor == p->chip_vendor &&
@@ -2957,10 +3000,6 @@ static void si_apply_state_adjust_rules(
 		}
 		++p;
 	}
-	/* limit mclk on all R7 370 parts for stability */
-	if (rdev->pdev->device == 0x6811 &&
-	    rdev->pdev->revision == 0x81)
-		max_mclk = 120000;
 
 	if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
 	    ni_dpm_vblank_too_short(rdev))
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/hv/hv_util.c linux-libre-3.18.45-gnu/drivers/hv/hv_util.c
--- linux-libre-3.18.44-gnu/drivers/hv/hv_util.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/hv/hv_util.c	2016-11-29 11:44:43.000000000 -0500
@@ -283,10 +283,14 @@ static void heartbeat_onchannelcallback(
 	u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
 	struct icmsg_negotiate *negop = NULL;
 
-	vmbus_recvpacket(channel, hbeat_txf_buf,
-			 PAGE_SIZE, &recvlen, &requestid);
+	while (1) {
+
+		vmbus_recvpacket(channel, hbeat_txf_buf,
+				 PAGE_SIZE, &recvlen, &requestid);
+
+		if (!recvlen)
+			break;
 
-	if (recvlen > 0) {
 		icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
 				sizeof(struct vmbuspipe_hdr)];
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/input/serio/i8042-x86ia64io.h linux-libre-3.18.45-gnu/drivers/input/serio/i8042-x86ia64io.h
--- linux-libre-3.18.44-gnu/drivers/input/serio/i8042-x86ia64io.h	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/input/serio/i8042-x86ia64io.h	2016-11-29 11:44:43.000000000 -0500
@@ -783,6 +783,13 @@ static const struct dmi_system_id __init
 			DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
 		},
 	},
+	{
+		/* Schenker XMG C504 - Elantech touchpad */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
+		},
+	},
 	{ }
 };
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/irqchip/irq-gic-v3.c linux-libre-3.18.45-gnu/drivers/irqchip/irq-gic-v3.c
--- linux-libre-3.18.44-gnu/drivers/irqchip/irq-gic-v3.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/irqchip/irq-gic-v3.c	2016-11-29 11:44:43.000000000 -0500
@@ -178,7 +178,7 @@ static void gic_enable_redist(bool enabl
 			return;	/* No PM support in this redistributor */
 	}
 
-	while (count--) {
+	while (--count) {
 		val = readl_relaxed(rbase + GICR_WAKER);
 		if (enable ^ (val & GICR_WAKER_ChildrenAsleep))
 			break;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/md/dm-table.c linux-libre-3.18.45-gnu/drivers/md/dm-table.c
--- linux-libre-3.18.44-gnu/drivers/md/dm-table.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/md/dm-table.c	2016-11-29 11:44:43.000000000 -0500
@@ -691,37 +691,32 @@ int dm_table_add_target(struct dm_table
 
 	tgt->type = dm_get_target_type(type);
 	if (!tgt->type) {
-		DMERR("%s: %s: unknown target type", dm_device_name(t->md),
-		      type);
+		DMERR("%s: %s: unknown target type", dm_device_name(t->md), type);
 		return -EINVAL;
 	}
 
 	if (dm_target_needs_singleton(tgt->type)) {
 		if (t->num_targets) {
-			DMERR("%s: target type %s must appear alone in table",
-			      dm_device_name(t->md), type);
-			return -EINVAL;
+			tgt->error = "singleton target type must appear alone in table";
+			goto bad;
 		}
 		t->singleton = 1;
 	}
 
 	if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) {
-		DMERR("%s: target type %s may not be included in read-only tables",
-		      dm_device_name(t->md), type);
-		return -EINVAL;
+		tgt->error = "target type may not be included in a read-only table";
+		goto bad;
 	}
 
 	if (t->immutable_target_type) {
 		if (t->immutable_target_type != tgt->type) {
-			DMERR("%s: immutable target type %s cannot be mixed with other target types",
-			      dm_device_name(t->md), t->immutable_target_type->name);
-			return -EINVAL;
+			tgt->error = "immutable target type cannot be mixed with other target types";
+			goto bad;
 		}
 	} else if (dm_target_is_immutable(tgt->type)) {
 		if (t->num_targets) {
-			DMERR("%s: immutable target type %s cannot be mixed with other target types",
-			      dm_device_name(t->md), tgt->type->name);
-			return -EINVAL;
+			tgt->error = "immutable target type cannot be mixed with other target types";
+			goto bad;
 		}
 		t->immutable_target_type = tgt->type;
 	}
@@ -736,7 +731,6 @@ int dm_table_add_target(struct dm_table
 	 */
 	if (!adjoin(t, tgt)) {
 		tgt->error = "Gap in table";
-		r = -EINVAL;
 		goto bad;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/md/md.c linux-libre-3.18.45-gnu/drivers/md/md.c
--- linux-libre-3.18.44-gnu/drivers/md/md.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/md/md.c	2016-11-29 11:44:43.000000000 -0500
@@ -7409,6 +7409,9 @@ void md_do_sync(struct md_thread *thread
 			break;
 
 		j += sectors;
+		if (j > max_sectors)
+			/* when skipping, extra large numbers can be returned. */
+			j = max_sectors;
 		if (j > 2)
 			mddev->curr_resync = j;
 		mddev->curr_mark_cnt = io_sectors;
@@ -7468,11 +7471,17 @@ void md_do_sync(struct md_thread *thread
 	blk_finish_plug(&plug);
 	wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
 
+	if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
+	    !test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
+	    mddev->curr_resync > 3) {
+		mddev->curr_resync_completed = mddev->curr_resync;
+		sysfs_notify(&mddev->kobj, NULL, "sync_completed");
+	}
 	/* tell personality that we are finished */
 	mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
 
 	if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
-	    mddev->curr_resync > 2) {
+	    mddev->curr_resync > 3) {
 		if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
 			if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
 				if (mddev->curr_resync >= mddev->recovery_cp) {
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/memstick/host/rtsx_usb_ms.c linux-libre-3.18.45-gnu/drivers/memstick/host/rtsx_usb_ms.c
--- linux-libre-3.18.44-gnu/drivers/memstick/host/rtsx_usb_ms.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/memstick/host/rtsx_usb_ms.c	2016-11-29 11:44:43.000000000 -0500
@@ -524,6 +524,7 @@ static void rtsx_usb_ms_handle_req(struc
 	int rc;
 
 	if (!host->req) {
+		pm_runtime_get_sync(ms_dev(host));
 		do {
 			rc = memstick_next_req(msh, &host->req);
 			dev_dbg(ms_dev(host), "next req %d\n", rc);
@@ -544,6 +545,7 @@ static void rtsx_usb_ms_handle_req(struc
 						host->req->error);
 			}
 		} while (!rc);
+		pm_runtime_put(ms_dev(host));
 	}
 
 }
@@ -570,6 +572,7 @@ static int rtsx_usb_ms_set_param(struct
 	dev_dbg(ms_dev(host), "%s: param = %d, value = %d\n",
 			__func__, param, value);
 
+	pm_runtime_get_sync(ms_dev(host));
 	mutex_lock(&ucr->dev_mutex);
 
 	err = rtsx_usb_card_exclusive_check(ucr, RTSX_USB_MS_CARD);
@@ -635,6 +638,7 @@ static int rtsx_usb_ms_set_param(struct
 	}
 out:
 	mutex_unlock(&ucr->dev_mutex);
+	pm_runtime_put(ms_dev(host));
 
 	/* power-on delay */
 	if (param == MEMSTICK_POWER && value == MEMSTICK_POWER_ON)
@@ -681,6 +685,7 @@ static int rtsx_usb_detect_ms_card(void
 	int err;
 
 	for (;;) {
+		pm_runtime_get_sync(ms_dev(host));
 		mutex_lock(&ucr->dev_mutex);
 
 		/* Check pending MS card changes */
@@ -703,6 +708,7 @@ static int rtsx_usb_detect_ms_card(void
 		}
 
 poll_again:
+		pm_runtime_put(ms_dev(host));
 		if (host->eject)
 			break;
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/misc/genwqe/card_utils.c linux-libre-3.18.45-gnu/drivers/misc/genwqe/card_utils.c
--- linux-libre-3.18.44-gnu/drivers/misc/genwqe/card_utils.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/misc/genwqe/card_utils.c	2016-11-29 11:44:43.000000000 -0500
@@ -351,17 +351,27 @@ int genwqe_alloc_sync_sgl(struct genwqe_
 		if (copy_from_user(sgl->lpage, user_addr + user_size -
 				   sgl->lpage_size, sgl->lpage_size)) {
 			rc = -EFAULT;
-			goto err_out1;
+			goto err_out2;
 		}
 	}
 	return 0;
 
+ err_out2:
+	__genwqe_free_consistent(cd, PAGE_SIZE, sgl->lpage,
+				 sgl->lpage_dma_addr);
+	sgl->lpage = NULL;
+	sgl->lpage_dma_addr = 0;
  err_out1:
 	__genwqe_free_consistent(cd, PAGE_SIZE, sgl->fpage,
 				 sgl->fpage_dma_addr);
+	sgl->fpage = NULL;
+	sgl->fpage_dma_addr = 0;
  err_out:
 	__genwqe_free_consistent(cd, sgl->sgl_size, sgl->sgl,
 				 sgl->sgl_dma_addr);
+	sgl->sgl = NULL;
+	sgl->sgl_dma_addr = 0;
+	sgl->sgl_size = 0;
 	return -ENOMEM;
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/misc/mei/hw-txe.c linux-libre-3.18.45-gnu/drivers/misc/mei/hw-txe.c
--- linux-libre-3.18.44-gnu/drivers/misc/mei/hw-txe.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/misc/mei/hw-txe.c	2016-11-29 11:44:43.000000000 -0500
@@ -973,11 +973,13 @@ static bool mei_txe_check_and_ack_intrs(
 	hisr = mei_txe_br_reg_read(hw, HISR_REG);
 
 	aliveness = mei_txe_aliveness_get(dev);
-	if (hhisr & IPC_HHIER_SEC && aliveness)
+	if (hhisr & IPC_HHIER_SEC && aliveness) {
 		ipc_isr = mei_txe_sec_reg_read_silent(hw,
 				SEC_IPC_HOST_INT_STATUS_REG);
-	else
+	} else {
 		ipc_isr = 0;
+		hhisr &= ~IPC_HHIER_SEC;
+	}
 
 	generated = generated ||
 		(hisr & HISR_INT_STS_MSK) ||
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/mmc/card/block.c linux-libre-3.18.45-gnu/drivers/mmc/card/block.c
--- linux-libre-3.18.44-gnu/drivers/mmc/card/block.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/mmc/card/block.c	2016-11-29 11:44:43.000000000 -0500
@@ -1657,7 +1657,7 @@ static void mmc_blk_packed_hdr_wrq_prep(
 	struct mmc_blk_data *md = mq->data;
 	struct mmc_packed *packed = mqrq->packed;
 	bool do_rel_wr, do_data_tag;
-	u32 *packed_cmd_hdr;
+	__le32 *packed_cmd_hdr;
 	u8 hdr_blocks;
 	u8 i = 1;
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/mmc/card/queue.h linux-libre-3.18.45-gnu/drivers/mmc/card/queue.h
--- linux-libre-3.18.44-gnu/drivers/mmc/card/queue.h	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/mmc/card/queue.h	2016-11-29 11:44:43.000000000 -0500
@@ -24,7 +24,7 @@ enum mmc_packed_type {
 
 struct mmc_packed {
 	struct list_head	list;
-	u32			cmd_hdr[1024];
+	__le32			cmd_hdr[1024];
 	unsigned int		blocks;
 	u8			nr_entries;
 	u8			retries;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/mmc/host/rtsx_usb_sdmmc.c linux-libre-3.18.45-gnu/drivers/mmc/host/rtsx_usb_sdmmc.c
--- linux-libre-3.18.44-gnu/drivers/mmc/host/rtsx_usb_sdmmc.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/mmc/host/rtsx_usb_sdmmc.c	2016-11-29 11:44:43.000000000 -0500
@@ -1138,11 +1138,6 @@ static void sdmmc_set_ios(struct mmc_hos
 	dev_dbg(sdmmc_dev(host), "%s\n", __func__);
 	mutex_lock(&ucr->dev_mutex);
 
-	if (rtsx_usb_card_exclusive_check(ucr, RTSX_USB_SD_CARD)) {
-		mutex_unlock(&ucr->dev_mutex);
-		return;
-	}
-
 	sd_set_power_mode(host, ios->power_mode);
 	sd_set_bus_width(host, ios->bus_width);
 	sd_set_timing(host, ios->timing, &host->ddr_mode);
@@ -1314,6 +1309,7 @@ static void rtsx_usb_update_led(struct w
 		container_of(work, struct rtsx_usb_sdmmc, led_work);
 	struct rtsx_ucr *ucr = host->ucr;
 
+	pm_runtime_get_sync(sdmmc_dev(host));
 	mutex_lock(&ucr->dev_mutex);
 
 	if (host->led.brightness == LED_OFF)
@@ -1322,6 +1318,7 @@ static void rtsx_usb_update_led(struct w
 		rtsx_usb_turn_on_led(ucr);
 
 	mutex_unlock(&ucr->dev_mutex);
+	pm_runtime_put(sdmmc_dev(host));
 }
 #endif
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/mmc/host/sdhci.c linux-libre-3.18.45-gnu/drivers/mmc/host/sdhci.c
--- linux-libre-3.18.44-gnu/drivers/mmc/host/sdhci.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/mmc/host/sdhci.c	2016-11-29 11:44:43.000000000 -0500
@@ -669,7 +669,7 @@ static u8 sdhci_calc_timeout(struct sdhc
 			 * host->clock is in Hz.  target_timeout is in us.
 			 * Hence, us = 1000000 * cycles / Hz.  Round up.
 			 */
-			val = 1000000 * data->timeout_clks;
+			val = 1000000ULL * data->timeout_clks;
 			if (do_div(val, host->clock))
 				target_timeout++;
 			target_timeout += val;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/scsi/arcmsr/arcmsr_hba.c linux-libre-3.18.45-gnu/drivers/scsi/arcmsr/arcmsr_hba.c
--- linux-libre-3.18.44-gnu/drivers/scsi/arcmsr/arcmsr_hba.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/scsi/arcmsr/arcmsr_hba.c	2016-11-29 11:44:43.000000000 -0500
@@ -2545,18 +2545,9 @@ static int arcmsr_queue_command_lck(stru
 	struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
 	struct CommandControlBlock *ccb;
 	int target = cmd->device->id;
-	int lun = cmd->device->lun;
-	uint8_t scsicmd = cmd->cmnd[0];
 	cmd->scsi_done = done;
 	cmd->host_scribble = NULL;
 	cmd->result = 0;
-	if ((scsicmd == SYNCHRONIZE_CACHE) ||(scsicmd == SEND_DIAGNOSTIC)){
-		if(acb->devstate[target][lun] == ARECA_RAID_GONE) {
-    			cmd->result = (DID_NO_CONNECT << 16);
-		}
-		cmd->scsi_done(cmd);
-		return 0;
-	}
 	if (target == 16) {
 		/* virtual device for iop message transfer */
 		arcmsr_handle_virtual_command(acb, cmd);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/scsi/megaraid/megaraid_sas_base.c linux-libre-3.18.45-gnu/drivers/scsi/megaraid/megaraid_sas_base.c
--- linux-libre-3.18.44-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2016-11-29 11:44:43.000000000 -0500
@@ -1614,16 +1614,13 @@ megasas_queue_command(struct Scsi_Host *
 		goto out_done;
 	}
 
-	switch (scmd->cmnd[0]) {
-	case SYNCHRONIZE_CACHE:
-		/*
-		 * FW takes care of flush cache on its own
-		 * No need to send it down
-		 */
+	/*
+	 * FW takes care of flush cache on its own for Virtual Disk.
+	 * No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to FW.
+	 */
+	if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) {
 		scmd->result = DID_OK << 16;
 		goto out_done;
-	default:
-		break;
 	}
 
 	if (instance->instancet->build_and_issue_cmd(instance, scmd)) {
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/scsi/scsi_debug.c linux-libre-3.18.45-gnu/drivers/scsi/scsi_debug.c
--- linux-libre-3.18.44-gnu/drivers/scsi/scsi_debug.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/scsi/scsi_debug.c	2016-11-29 11:44:43.000000000 -0500
@@ -3998,6 +3998,7 @@ static void __exit scsi_debug_exit(void)
 	if (dif_storep)
 		vfree(dif_storep);
 
+	vfree(map_storep);
 	vfree(fake_storep);
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/scsi/scsi_scan.c linux-libre-3.18.45-gnu/drivers/scsi/scsi_scan.c
--- linux-libre-3.18.44-gnu/drivers/scsi/scsi_scan.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/scsi/scsi_scan.c	2016-11-29 11:44:43.000000000 -0500
@@ -1531,12 +1531,12 @@ static int scsi_report_lun_scan(struct s
  out_err:
 	kfree(lun_data);
  out:
-	scsi_device_put(sdev);
 	if (scsi_device_created(sdev))
 		/*
 		 * the sdev we used didn't appear in the report luns scan
 		 */
 		__scsi_remove_device(sdev);
+	scsi_device_put(sdev);
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/target/target_core_xcopy.c linux-libre-3.18.45-gnu/drivers/target/target_core_xcopy.c
--- linux-libre-3.18.44-gnu/drivers/target/target_core_xcopy.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/target/target_core_xcopy.c	2016-11-29 11:44:43.000000000 -0500
@@ -698,6 +698,7 @@ static int target_xcopy_read_source(
 	rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0],
 				remote_port, true);
 	if (rc < 0) {
+		ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
 		transport_generic_free_cmd(se_cmd, 0);
 		return rc;
 	}
@@ -709,6 +710,7 @@ static int target_xcopy_read_source(
 
 	rc = target_xcopy_issue_pt_cmd(xpt_cmd);
 	if (rc < 0) {
+		ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
 		transport_generic_free_cmd(se_cmd, 0);
 		return rc;
 	}
@@ -759,6 +761,7 @@ static int target_xcopy_write_destinatio
 				remote_port, false);
 	if (rc < 0) {
 		struct se_cmd *src_cmd = &xop->src_pt_cmd->se_cmd;
+		ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
 		/*
 		 * If the failure happened before the t_mem_list hand-off in
 		 * target_xcopy_setup_pt_cmd(), Reset memory + clear flag so that
@@ -774,6 +777,7 @@ static int target_xcopy_write_destinatio
 
 	rc = target_xcopy_issue_pt_cmd(xpt_cmd);
 	if (rc < 0) {
+		ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
 		se_cmd->se_cmd_flags &= ~SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC;
 		transport_generic_free_cmd(se_cmd, 0);
 		return rc;
@@ -860,9 +864,14 @@ static void target_xcopy_do_work(struct
 out:
 	xcopy_pt_undepend_remotedev(xop);
 	kfree(xop);
-
-	pr_warn("target_xcopy_do_work: Setting X-COPY CHECK_CONDITION -> sending response\n");
-	ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
+	/*
+	 * Don't override an error scsi status if it has already been set
+	 */
+	if (ec_cmd->scsi_status == SAM_STAT_GOOD) {
+		pr_warn_ratelimited("target_xcopy_do_work: rc: %d, Setting X-COPY"
+			" CHECK_CONDITION -> sending response\n", rc);
+		ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
+	}
 	target_complete_cmd(ec_cmd, SAM_STAT_CHECK_CONDITION);
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/tty/vt/vt.c linux-libre-3.18.45-gnu/drivers/tty/vt/vt.c
--- linux-libre-3.18.44-gnu/drivers/tty/vt/vt.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/tty/vt/vt.c	2016-11-29 11:44:43.000000000 -0500
@@ -863,10 +863,15 @@ static int vc_do_resize(struct tty_struc
 	if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)
 		return 0;
 
+	if (new_screen_size > (4 << 20))
+		return -EINVAL;
 	newscreen = kmalloc(new_screen_size, GFP_USER);
 	if (!newscreen)
 		return -ENOMEM;
 
+	if (vc == sel_cons)
+		clear_selection();
+
 	old_rows = vc->vc_rows;
 	old_row_size = vc->vc_size_row;
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/gadget/function/u_ether.c linux-libre-3.18.45-gnu/drivers/usb/gadget/function/u_ether.c
--- linux-libre-3.18.44-gnu/drivers/usb/gadget/function/u_ether.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/gadget/function/u_ether.c	2016-11-29 11:44:43.000000000 -0500
@@ -591,8 +591,9 @@ static netdev_tx_t eth_start_xmit(struct
 
 	/* throttle high/super speed IRQ rate back slightly */
 	if (gadget_is_dualspeed(dev->gadget))
-		req->no_interrupt = (dev->gadget->speed == USB_SPEED_HIGH ||
-				     dev->gadget->speed == USB_SPEED_SUPER)
+		req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH ||
+				       dev->gadget->speed == USB_SPEED_SUPER)) &&
+					!list_empty(&dev->tx_reqs))
 			? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0)
 			: 0;
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/host/ohci-hcd.c linux-libre-3.18.45-gnu/drivers/usb/host/ohci-hcd.c
--- linux-libre-3.18.44-gnu/drivers/usb/host/ohci-hcd.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/host/ohci-hcd.c	2016-11-29 11:44:43.000000000 -0500
@@ -72,7 +72,7 @@
 static const char	hcd_name [] = "ohci_hcd";
 
 #define	STATECHANGE_DELAY	msecs_to_jiffies(300)
-#define	IO_WATCHDOG_DELAY	msecs_to_jiffies(250)
+#define	IO_WATCHDOG_DELAY	msecs_to_jiffies(275)
 
 #include "ohci.h"
 #include "pci-quirks.h"
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/host/xhci-pci.c linux-libre-3.18.45-gnu/drivers/usb/host/xhci-pci.c
--- linux-libre-3.18.44-gnu/drivers/usb/host/xhci-pci.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/host/xhci-pci.c	2016-11-29 11:44:43.000000000 -0500
@@ -45,6 +45,7 @@
 
 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI	0x8c31
 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI	0x9c31
+#define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI	0x9cb1
 #define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI		0x22b5
 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI		0xa12f
 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI	0x9d2f
@@ -147,7 +148,8 @@ static void xhci_pci_quirks(struct devic
 		xhci->quirks |= XHCI_SPURIOUS_REBOOT;
 	}
 	if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
-		pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
+		(pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI ||
+		 pdev->device == PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI)) {
 		xhci->quirks |= XHCI_SPURIOUS_REBOOT;
 		xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
 	}
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/serial/cp210x.c linux-libre-3.18.45-gnu/drivers/usb/serial/cp210x.c
--- linux-libre-3.18.44-gnu/drivers/usb/serial/cp210x.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/serial/cp210x.c	2016-11-29 11:44:43.000000000 -0500
@@ -845,7 +845,9 @@ static int cp210x_tiocmget(struct tty_st
 	unsigned int control;
 	int result;
 
-	cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+	result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+	if (result)
+		return result;
 
 	result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
 		|((control & CONTROL_RTS) ? TIOCM_RTS : 0)
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/serial/ftdi_sio.c linux-libre-3.18.45-gnu/drivers/usb/serial/ftdi_sio.c
--- linux-libre-3.18.44-gnu/drivers/usb/serial/ftdi_sio.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/serial/ftdi_sio.c	2016-11-29 11:44:43.000000000 -0500
@@ -986,7 +986,8 @@ static const struct usb_device_id id_tab
 	/* ekey Devices */
 	{ USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) },
 	/* Infineon Devices */
-	{ USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC1798_PID, 1) },
+	{ USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_TC2X7_PID, 1) },
 	/* GE Healthcare devices */
 	{ USB_DEVICE(GE_HEALTHCARE_VID, GE_HEALTHCARE_NEMO_TRACKER_PID) },
 	/* Active Research (Actisense) devices */
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/serial/ftdi_sio_ids.h linux-libre-3.18.45-gnu/drivers/usb/serial/ftdi_sio_ids.h
--- linux-libre-3.18.44-gnu/drivers/usb/serial/ftdi_sio_ids.h	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/serial/ftdi_sio_ids.h	2016-11-29 11:44:43.000000000 -0500
@@ -626,8 +626,9 @@
 /*
  * Infineon Technologies
  */
-#define INFINEON_VID		0x058b
-#define INFINEON_TRIBOARD_PID	0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
+#define INFINEON_VID		        0x058b
+#define INFINEON_TRIBOARD_TC1798_PID	0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
+#define INFINEON_TRIBOARD_TC2X7_PID	0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
 
 /*
  * Acton Research Corp.
diff -druNp --no-dereference linux-libre-3.18.44-gnu/drivers/usb/serial/usb-serial.c linux-libre-3.18.45-gnu/drivers/usb/serial/usb-serial.c
--- linux-libre-3.18.44-gnu/drivers/usb/serial/usb-serial.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/drivers/usb/serial/usb-serial.c	2016-11-29 11:44:43.000000000 -0500
@@ -1061,7 +1061,8 @@ static int usb_serial_probe(struct usb_i
 
 	serial->disconnected = 0;
 
-	usb_serial_console_init(serial->port[0]->minor);
+	if (num_ports > 0)
+		usb_serial_console_init(serial->port[0]->minor);
 exit:
 	module_put(type->driver.owner);
 	return 0;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/btrfs/tree-log.c linux-libre-3.18.45-gnu/fs/btrfs/tree-log.c
--- linux-libre-3.18.44-gnu/fs/btrfs/tree-log.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/btrfs/tree-log.c	2016-11-29 11:44:43.000000000 -0500
@@ -2453,14 +2453,12 @@ static inline void btrfs_remove_all_log_
 					     int index, int error)
 {
 	struct btrfs_log_ctx *ctx;
+	struct btrfs_log_ctx *safe;
 
-	if (!error) {
-		INIT_LIST_HEAD(&root->log_ctxs[index]);
-		return;
-	}
-
-	list_for_each_entry(ctx, &root->log_ctxs[index], list)
+	list_for_each_entry_safe(ctx, safe, &root->log_ctxs[index], list) {
+		list_del_init(&ctx->list);
 		ctx->log_ret = error;
+	}
 
 	INIT_LIST_HEAD(&root->log_ctxs[index]);
 }
@@ -2690,13 +2688,9 @@ int btrfs_sync_log(struct btrfs_trans_ha
 	mutex_unlock(&root->log_mutex);
 
 out_wake_log_root:
-	/*
-	 * We needn't get log_mutex here because we are sure all
-	 * the other tasks are blocked.
-	 */
+	mutex_lock(&log_root_tree->log_mutex);
 	btrfs_remove_all_log_ctxs(log_root_tree, index2, ret);
 
-	mutex_lock(&log_root_tree->log_mutex);
 	log_root_tree->log_transid_committed++;
 	atomic_set(&log_root_tree->log_commit[index2], 0);
 	mutex_unlock(&log_root_tree->log_mutex);
@@ -2704,10 +2698,8 @@ out_wake_log_root:
 	if (waitqueue_active(&log_root_tree->log_commit_wait[index2]))
 		wake_up(&log_root_tree->log_commit_wait[index2]);
 out:
-	/* See above. */
-	btrfs_remove_all_log_ctxs(root, index1, ret);
-
 	mutex_lock(&root->log_mutex);
+	btrfs_remove_all_log_ctxs(root, index1, ret);
 	root->log_transid_committed++;
 	atomic_set(&root->log_commit[index1], 0);
 	mutex_unlock(&root->log_mutex);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/isofs/inode.c linux-libre-3.18.45-gnu/fs/isofs/inode.c
--- linux-libre-3.18.44-gnu/fs/isofs/inode.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/isofs/inode.c	2016-11-29 11:44:43.000000000 -0500
@@ -690,6 +690,11 @@ static int isofs_fill_super(struct super
 	pri_bh = NULL;
 
 root_found:
+	/* We don't support read-write mounts */
+	if (!(s->s_flags & MS_RDONLY)) {
+		error = -EACCES;
+		goto out_freebh;
+	}
 
 	if (joliet_level && (pri == NULL || !opt.rock)) {
 		/* This is the case of Joliet with the norock mount flag.
@@ -1503,9 +1508,6 @@ struct inode *__isofs_iget(struct super_
 static struct dentry *isofs_mount(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *data)
 {
-	/* We don't support read-write mounts */
-	if (!(flags & MS_RDONLY))
-		return ERR_PTR(-EACCES);
 	return mount_bdev(fs_type, flags, dev_name, data, isofs_fill_super);
 }
 
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/jbd2/transaction.c linux-libre-3.18.45-gnu/fs/jbd2/transaction.c
--- linux-libre-3.18.44-gnu/fs/jbd2/transaction.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/jbd2/transaction.c	2016-11-29 11:44:43.000000000 -0500
@@ -1087,6 +1087,7 @@ int jbd2_journal_get_create_access(handl
 		JBUFFER_TRACE(jh, "file as BJ_Reserved");
 		spin_lock(&journal->j_list_lock);
 		__jbd2_journal_file_buffer(jh, transaction, BJ_Reserved);
+		spin_unlock(&journal->j_list_lock);
 	} else if (jh->b_transaction == journal->j_committing_transaction) {
 		/* first access by this transaction */
 		jh->b_modified = 0;
@@ -1094,8 +1095,8 @@ int jbd2_journal_get_create_access(handl
 		JBUFFER_TRACE(jh, "set next transaction");
 		spin_lock(&journal->j_list_lock);
 		jh->b_next_transaction = transaction;
+		spin_unlock(&journal->j_list_lock);
 	}
-	spin_unlock(&journal->j_list_lock);
 	jbd_unlock_bh_state(bh);
 
 	/*
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/overlayfs/copy_up.c linux-libre-3.18.45-gnu/fs/overlayfs/copy_up.c
--- linux-libre-3.18.44-gnu/fs/overlayfs/copy_up.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/overlayfs/copy_up.c	2016-11-29 11:44:43.000000000 -0500
@@ -129,6 +129,8 @@ static int ovl_copy_up_data(struct path
 		len -= bytes;
 	}
 
+	if (!error)
+		error = vfs_fsync(new_file, 0);
 	fput(new_file);
 out_fput:
 	fput(old_file);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/ubifs/xattr.c linux-libre-3.18.45-gnu/fs/ubifs/xattr.c
--- linux-libre-3.18.44-gnu/fs/ubifs/xattr.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/ubifs/xattr.c	2016-11-29 11:44:43.000000000 -0500
@@ -167,6 +167,7 @@ out_cancel:
 	host_ui->xattr_cnt -= 1;
 	host_ui->xattr_size -= CALC_DENT_SIZE(nm->len);
 	host_ui->xattr_size -= CALC_XATTR_BYTES(size);
+	host_ui->xattr_names -= nm->len;
 	mutex_unlock(&host_ui->ui_mutex);
 out_free:
 	make_bad_inode(inode);
@@ -514,6 +515,7 @@ out_cancel:
 	host_ui->xattr_cnt += 1;
 	host_ui->xattr_size += CALC_DENT_SIZE(nm->len);
 	host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len);
+	host_ui->xattr_names += nm->len;
 	mutex_unlock(&host_ui->ui_mutex);
 	ubifs_release_budget(c, &req);
 	make_bad_inode(inode);
diff -druNp --no-dereference linux-libre-3.18.44-gnu/fs/xfs/libxfs/xfs_dquot_buf.c linux-libre-3.18.45-gnu/fs/xfs/libxfs/xfs_dquot_buf.c
--- linux-libre-3.18.44-gnu/fs/xfs/libxfs/xfs_dquot_buf.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/fs/xfs/libxfs/xfs_dquot_buf.c	2016-11-29 11:44:43.000000000 -0500
@@ -193,8 +193,7 @@ xfs_dquot_buf_verify_crc(
 	if (mp->m_quotainfo)
 		ndquots = mp->m_quotainfo->qi_dqperchunk;
 	else
-		ndquots = xfs_calc_dquots_per_chunk(
-					XFS_BB_TO_FSB(mp, bp->b_length));
+		ndquots = xfs_calc_dquots_per_chunk(bp->b_length);
 
 	for (i = 0; i < ndquots; i++, d++) {
 		if (!xfs_verify_cksum((char *)d, sizeof(struct xfs_dqblk),
diff -druNp --no-dereference linux-libre-3.18.44-gnu/Makefile linux-libre-3.18.45-gnu/Makefile
--- linux-libre-3.18.44-gnu/Makefile	2016-10-24 20:14:55.000000000 -0400
+++ linux-libre-3.18.45-gnu/Makefile	2016-11-30 13:32:42.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 44
+SUBLEVEL = 45
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
@@ -610,6 +610,8 @@ all: vmlinux
 include $(srctree)/arch/$(SRCARCH)/Makefile
 
 KBUILD_CFLAGS	+= $(call cc-option,-fno-delete-null-pointer-checks,)
+KBUILD_CFLAGS	+= $(call cc-option,-fno-PIE)
+KBUILD_AFLAGS	+= $(call cc-option,-fno-PIE)
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
diff -druNp --no-dereference linux-libre-3.18.44-gnu/net/ipv4/udp.c linux-libre-3.18.45-gnu/net/ipv4/udp.c
--- linux-libre-3.18.44-gnu/net/ipv4/udp.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/net/ipv4/udp.c	2016-11-29 11:44:43.000000000 -0500
@@ -1252,6 +1252,7 @@ int udp_recvmsg(struct kiocb *iocb, stru
 	int peeked, off = 0;
 	int err;
 	int is_udplite = IS_UDPLITE(sk);
+	bool checksum_valid = false;
 	bool slow;
 
 	if (flags & MSG_ERRQUEUE)
@@ -1277,11 +1278,12 @@ try_again:
 	 */
 
 	if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
-		if (udp_lib_checksum_complete(skb))
+		checksum_valid = !udp_lib_checksum_complete(skb);
+		if (!checksum_valid)
 			goto csum_copy_err;
 	}
 
-	if (skb_csum_unnecessary(skb))
+	if (checksum_valid || skb_csum_unnecessary(skb))
 		err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
 					      msg->msg_iov, copied);
 	else {
diff -druNp --no-dereference linux-libre-3.18.44-gnu/net/ipv6/udp.c linux-libre-3.18.45-gnu/net/ipv6/udp.c
--- linux-libre-3.18.44-gnu/net/ipv6/udp.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/net/ipv6/udp.c	2016-11-29 11:44:43.000000000 -0500
@@ -388,6 +388,7 @@ int udpv6_recvmsg(struct kiocb *iocb, st
 	int peeked, off = 0;
 	int err;
 	int is_udplite = IS_UDPLITE(sk);
+	bool checksum_valid = false;
 	int is_udp4;
 	bool slow;
 
@@ -419,11 +420,12 @@ try_again:
 	 */
 
 	if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
-		if (udp_lib_checksum_complete(skb))
+		checksum_valid = !udp_lib_checksum_complete(skb);
+		if (!checksum_valid)
 			goto csum_copy_err;
 	}
 
-	if (skb_csum_unnecessary(skb))
+	if (checksum_valid || skb_csum_unnecessary(skb))
 		err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
 					      msg->msg_iov, copied);
 	else {
diff -druNp --no-dereference linux-libre-3.18.44-gnu/net/mac80211/rx.c linux-libre-3.18.45-gnu/net/mac80211/rx.c
--- linux-libre-3.18.44-gnu/net/mac80211/rx.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/net/mac80211/rx.c	2016-11-29 11:44:43.000000000 -0500
@@ -2040,16 +2040,22 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
 	if (!(status->rx_flags & IEEE80211_RX_AMSDU))
 		return RX_CONTINUE;
 
-	if (ieee80211_has_a4(hdr->frame_control) &&
-	    rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
-	    !rx->sdata->u.vlan.sta)
-		return RX_DROP_UNUSABLE;
+	if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
+		switch (rx->sdata->vif.type) {
+		case NL80211_IFTYPE_AP_VLAN:
+			if (!rx->sdata->u.vlan.sta)
+				return RX_DROP_UNUSABLE;
+			break;
+		case NL80211_IFTYPE_STATION:
+			if (!rx->sdata->u.mgd.use_4addr)
+				return RX_DROP_UNUSABLE;
+			break;
+		default:
+			return RX_DROP_UNUSABLE;
+		}
+	}
 
-	if (is_multicast_ether_addr(hdr->addr1) &&
-	    ((rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
-	      rx->sdata->u.vlan.sta) ||
-	     (rx->sdata->vif.type == NL80211_IFTYPE_STATION &&
-	      rx->sdata->u.mgd.use_4addr)))
+	if (is_multicast_ether_addr(hdr->addr1))
 		return RX_DROP_UNUSABLE;
 
 	skb->dev = dev;
diff -druNp --no-dereference linux-libre-3.18.44-gnu/security/keys/proc.c linux-libre-3.18.45-gnu/security/keys/proc.c
--- linux-libre-3.18.44-gnu/security/keys/proc.c	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/security/keys/proc.c	2016-11-29 11:44:43.000000000 -0500
@@ -187,7 +187,7 @@ static int proc_keys_show(struct seq_fil
 	struct timespec now;
 	unsigned long timo;
 	key_ref_t key_ref, skey_ref;
-	char xbuf[12];
+	char xbuf[16];
 	int rc;
 
 	struct keyring_search_context ctx = {
diff -druNp --no-dereference linux-libre-3.18.44-gnu/sound/usb/quirks-table.h linux-libre-3.18.45-gnu/sound/usb/quirks-table.h
--- linux-libre-3.18.44-gnu/sound/usb/quirks-table.h	2016-10-22 16:45:02.000000000 -0400
+++ linux-libre-3.18.45-gnu/sound/usb/quirks-table.h	2016-11-29 11:44:43.000000000 -0500
@@ -2942,6 +2942,23 @@ AU0828_DEVICE(0x2040, 0x7260, "Hauppauge
 AU0828_DEVICE(0x2040, 0x7213, "Hauppauge", "HVR-950Q"),
 AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
 
+/* Syntek STK1160 */
+{
+	.match_flags = USB_DEVICE_ID_MATCH_DEVICE |
+		       USB_DEVICE_ID_MATCH_INT_CLASS |
+		       USB_DEVICE_ID_MATCH_INT_SUBCLASS,
+	.idVendor = 0x05e1,
+	.idProduct = 0x0408,
+	.bInterfaceClass = USB_CLASS_AUDIO,
+	.bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
+	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.vendor_name = "Syntek",
+		.product_name = "STK1160",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_AUDIO_ALIGN_TRANSFER
+	}
+},
+
 /* Digidesign Mbox */
 {
 	/* Thanks to Clemens Ladisch <clemens@ladisch.de> */
