diff -druNp --no-dereference linux-libre-4.4.217-gnu/arch/arm/boot/dts/dra7.dtsi linux-libre-4.4.218-gnu/arch/arm/boot/dts/dra7.dtsi
--- linux-libre-4.4.217-gnu/arch/arm/boot/dts/dra7.dtsi	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/arch/arm/boot/dts/dra7.dtsi	2020-04-02 13:02:40.000000000 -0400
@@ -227,6 +227,7 @@
 				device_type = "pci";
 				ranges = <0x81000000 0 0          0x03000 0 0x00010000
 					  0x82000000 0 0x20013000 0x13000 0 0xffed000>;
+				dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
 				bus-range = <0x00 0xff>;
 				#interrupt-cells = <1>;
 				num-lanes = <1>;
@@ -263,6 +264,7 @@
 				device_type = "pci";
 				ranges = <0x81000000 0 0          0x03000 0 0x00010000
 					  0x82000000 0 0x30013000 0x13000 0 0xffed000>;
+				dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>;
 				bus-range = <0x00 0xff>;
 				#interrupt-cells = <1>;
 				num-lanes = <1>;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/arch/arm64/kernel/smp.c linux-libre-4.4.218-gnu/arch/arm64/kernel/smp.c
--- linux-libre-4.4.217-gnu/arch/arm64/kernel/smp.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/arch/arm64/kernel/smp.c	2020-04-02 13:02:40.000000000 -0400
@@ -769,11 +769,22 @@ void tick_broadcast(const struct cpumask
 }
 #endif
 
+/*
+ * The number of CPUs online, not counting this CPU (which may not be
+ * fully online and so not counted in num_online_cpus()).
+ */
+static inline unsigned int num_other_online_cpus(void)
+{
+	unsigned int this_cpu_online = cpu_online(smp_processor_id());
+
+	return num_online_cpus() - this_cpu_online;
+}
+
 void smp_send_stop(void)
 {
 	unsigned long timeout;
 
-	if (num_online_cpus() > 1) {
+	if (num_other_online_cpus()) {
 		cpumask_t mask;
 
 		cpumask_copy(&mask, cpu_online_mask);
@@ -784,10 +795,10 @@ void smp_send_stop(void)
 
 	/* Wait up to one second for other CPUs to stop */
 	timeout = USEC_PER_SEC;
-	while (num_online_cpus() > 1 && timeout--)
+	while (num_other_online_cpus() && timeout--)
 		udelay(1);
 
-	if (num_online_cpus() > 1)
+	if (num_other_online_cpus())
 		pr_warning("SMP: failed to stop secondary CPUs\n");
 }
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/arch/powerpc/kernel/vmlinux.lds.S linux-libre-4.4.218-gnu/arch/powerpc/kernel/vmlinux.lds.S
--- linux-libre-4.4.217-gnu/arch/powerpc/kernel/vmlinux.lds.S	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/arch/powerpc/kernel/vmlinux.lds.S	2020-04-02 13:02:40.000000000 -0400
@@ -255,6 +255,12 @@ SECTIONS
 		*(.branch_lt)
 	}
 
+#ifdef CONFIG_DEBUG_INFO_BTF
+	.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {
+		*(.BTF)
+	}
+#endif
+
 	.opd : AT(ADDR(.opd) - LOAD_OFFSET) {
 		*(.opd)
 	}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/arch/x86/kvm/vmx.c linux-libre-4.4.218-gnu/arch/x86/kvm/vmx.c
--- linux-libre-4.4.217-gnu/arch/x86/kvm/vmx.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/arch/x86/kvm/vmx.c	2020-04-02 13:02:40.000000000 -0400
@@ -6187,8 +6187,8 @@ static int handle_ept_misconfig(struct k
 			return 1;
 		}
 		else
-			return x86_emulate_instruction(vcpu, gpa, EMULTYPE_SKIP,
-						       NULL, 0) == EMULATE_DONE;
+			return emulate_instruction(vcpu, EMULTYPE_SKIP) ==
+								EMULATE_DONE;
 	}
 
 	ret = handle_mmio_page_fault(vcpu, gpa, true);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/arch/x86/mm/fault.c linux-libre-4.4.218-gnu/arch/x86/mm/fault.c
--- linux-libre-4.4.217-gnu/arch/x86/mm/fault.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/arch/x86/mm/fault.c	2020-04-02 13:02:40.000000000 -0400
@@ -228,7 +228,7 @@ static inline pmd_t *vmalloc_sync_one(pg
 	return pmd_k;
 }
 
-void vmalloc_sync_all(void)
+static void vmalloc_sync(void)
 {
 	unsigned long address;
 
@@ -255,6 +255,16 @@ void vmalloc_sync_all(void)
 	}
 }
 
+void vmalloc_sync_mappings(void)
+{
+	vmalloc_sync();
+}
+
+void vmalloc_sync_unmappings(void)
+{
+	vmalloc_sync();
+}
+
 /*
  * 32-bit:
  *
@@ -349,11 +359,23 @@ out:
 
 #else /* CONFIG_X86_64: */
 
-void vmalloc_sync_all(void)
+void vmalloc_sync_mappings(void)
 {
+	/*
+	 * 64-bit mappings might allocate new p4d/pud pages
+	 * that need to be propagated to all tasks' PGDs.
+	 */
 	sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END, 0);
 }
 
+void vmalloc_sync_unmappings(void)
+{
+	/*
+	 * Unmappings never allocate or free p4d/pud pages.
+	 * No work is required here.
+	 */
+}
+
 /*
  * 64-bit:
  *
diff -druNp --no-dereference linux-libre-4.4.217-gnu/Documentation/devicetree/bindings/powerpc/fsl/fman.txt linux-libre-4.4.218-gnu/Documentation/devicetree/bindings/powerpc/fsl/fman.txt
--- linux-libre-4.4.217-gnu/Documentation/devicetree/bindings/powerpc/fsl/fman.txt	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/Documentation/devicetree/bindings/powerpc/fsl/fman.txt	2020-04-02 13:02:40.000000000 -0400
@@ -110,6 +110,13 @@ PROPERTIES
 		Usage: required
 		Definition: See soc/fsl/qman.txt and soc/fsl/bman.txt
 
+- fsl,erratum-a050385
+		Usage: optional
+		Value type: boolean
+		Definition: A boolean property. Indicates the presence of the
+		erratum A050385 which indicates that DMA transactions that are
+		split can result in a FMan lock.
+
 =============================================================================
 FMan MURAM Node
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/acpi/apei/ghes.c linux-libre-4.4.218-gnu/drivers/acpi/apei/ghes.c
--- linux-libre-4.4.217-gnu/drivers/acpi/apei/ghes.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/acpi/apei/ghes.c	2020-04-02 13:02:40.000000000 -0400
@@ -229,7 +229,7 @@ static int ghes_estatus_pool_expand(unsi
 	 * New allocation must be visible in all pgd before it can be found by
 	 * an NMI allocating from the pool.
 	 */
-	vmalloc_sync_all();
+	vmalloc_sync_mappings();
 
 	return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
 }
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/gpu/drm/drm_dp_mst_topology.c linux-libre-4.4.218-gnu/drivers/gpu/drm/drm_dp_mst_topology.c
--- linux-libre-4.4.217-gnu/drivers/gpu/drm/drm_dp_mst_topology.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/gpu/drm/drm_dp_mst_topology.c	2020-04-02 13:02:40.000000000 -0400
@@ -975,20 +975,9 @@ static struct drm_dp_mst_port *drm_dp_ms
 static struct drm_dp_mst_port *drm_dp_get_validated_port_ref(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port)
 {
 	struct drm_dp_mst_port *rport = NULL;
-
 	mutex_lock(&mgr->lock);
-	/*
-	 * Port may or may not be 'valid' but we don't care about that when
-	 * destroying the port and we are guaranteed that the port pointer
-	 * will be valid until we've finished
-	 */
-	if (current_work() == &mgr->destroy_connector_work) {
-		kref_get(&port->kref);
-		rport = port;
-	} else if (mgr->mst_primary) {
-		rport = drm_dp_mst_get_port_ref_locked(mgr->mst_primary,
-						       port);
-	}
+	if (mgr->mst_primary)
+		rport = drm_dp_mst_get_port_ref_locked(mgr->mst_primary, port);
 	mutex_unlock(&mgr->lock);
 	return rport;
 }
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/gpu/drm/exynos/exynos_drm_dsi.c linux-libre-4.4.218-gnu/drivers/gpu/drm/exynos/exynos_drm_dsi.c
--- linux-libre-4.4.217-gnu/drivers/gpu/drm/exynos/exynos_drm_dsi.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/gpu/drm/exynos/exynos_drm_dsi.c	2020-04-02 13:02:40.000000000 -0400
@@ -1899,8 +1899,9 @@ static int exynos_dsi_probe(struct platf
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies),
 				      dsi->supplies);
 	if (ret) {
-		dev_info(dev, "failed to get regulators: %d\n", ret);
-		return -EPROBE_DEFER;
+		if (ret != -EPROBE_DEFER)
+			dev_info(dev, "failed to get regulators: %d\n", ret);
+		return ret;
 	}
 
 	dsi->clks = devm_kzalloc(dev,
@@ -1913,9 +1914,10 @@ static int exynos_dsi_probe(struct platf
 		dsi->clks[i] = devm_clk_get(dev, clk_names[i]);
 		if (IS_ERR(dsi->clks[i])) {
 			if (strcmp(clk_names[i], "sclk_mipi") == 0) {
-				strcpy(clk_names[i], OLD_SCLK_MIPI_CLK_NAME);
-				i--;
-				continue;
+				dsi->clks[i] = devm_clk_get(dev,
+							OLD_SCLK_MIPI_CLK_NAME);
+				if (!IS_ERR(dsi->clks[i]))
+					continue;
 			}
 
 			dev_info(dev, "failed to get the clock: %s\n",
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/hwspinlock/hwspinlock_core.c linux-libre-4.4.218-gnu/drivers/hwspinlock/hwspinlock_core.c
--- linux-libre-4.4.217-gnu/drivers/hwspinlock/hwspinlock_core.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/hwspinlock/hwspinlock_core.c	2020-04-02 13:02:40.000000000 -0400
@@ -313,7 +313,7 @@ int of_hwspin_lock_get_id(struct device_
 		hwlock = radix_tree_deref_slot(slot);
 		if (unlikely(!hwlock))
 			continue;
-		if (radix_tree_is_indirect_ptr(hwlock)) {
+		if (radix_tree_deref_retry(hwlock)) {
 			slot = radix_tree_iter_retry(&iter);
 			continue;
 		}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/hwtracing/intel_th/msu.c linux-libre-4.4.218-gnu/drivers/hwtracing/intel_th/msu.c
--- linux-libre-4.4.217-gnu/drivers/hwtracing/intel_th/msu.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/hwtracing/intel_th/msu.c	2020-04-02 13:02:40.000000000 -0400
@@ -483,7 +483,7 @@ static int msc_configure(struct msc *msc
 	u32 reg;
 
 	if (msc->mode > MSC_MODE_MULTI)
-		return -ENOTSUPP;
+		return -EINVAL;
 
 	if (msc->mode == MSC_MODE_MULTI)
 		msc_buffer_clear_hw_header(msc);
@@ -935,7 +935,7 @@ static int msc_buffer_alloc(struct msc *
 	} else if (msc->mode == MSC_MODE_MULTI) {
 		ret = msc_buffer_multi_alloc(msc, nr_pages, nr_wins);
 	} else {
-		ret = -ENOTSUPP;
+		ret = -EINVAL;
 	}
 
 	if (!ret) {
@@ -1164,7 +1164,7 @@ static ssize_t intel_th_msc_read(struct
 		if (ret >= 0)
 			*ppos = iter->offset;
 	} else {
-		ret = -ENOTSUPP;
+		ret = -EINVAL;
 	}
 
 put_count:
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/i2c/busses/i2c-hix5hd2.c linux-libre-4.4.218-gnu/drivers/i2c/busses/i2c-hix5hd2.c
--- linux-libre-4.4.217-gnu/drivers/i2c/busses/i2c-hix5hd2.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/i2c/busses/i2c-hix5hd2.c	2020-04-02 13:02:40.000000000 -0400
@@ -500,6 +500,7 @@ static int hix5hd2_i2c_remove(struct pla
 	i2c_del_adapter(&priv->adap);
 	pm_runtime_disable(priv->dev);
 	pm_runtime_set_suspended(priv->dev);
+	clk_disable_unprepare(priv->clk);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/infiniband/ulp/ipoib/ipoib_fs.c linux-libre-4.4.218-gnu/drivers/infiniband/ulp/ipoib/ipoib_fs.c
--- linux-libre-4.4.217-gnu/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2020-04-02 13:02:40.000000000 -0400
@@ -281,8 +281,6 @@ void ipoib_delete_debug_files(struct net
 {
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 
-	WARN_ONCE(!priv->mcg_dentry, "null mcg debug file\n");
-	WARN_ONCE(!priv->path_dentry, "null path debug file\n");
 	debugfs_remove(priv->mcg_dentry);
 	debugfs_remove(priv->path_dentry);
 	priv->mcg_dentry = priv->path_dentry = NULL;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/b2c2/flexcop-usb.c linux-libre-4.4.218-gnu/drivers/media/usb/b2c2/flexcop-usb.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/b2c2/flexcop-usb.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/b2c2/flexcop-usb.c	2020-04-02 13:02:40.000000000 -0400
@@ -481,6 +481,9 @@ static int flexcop_usb_init(struct flexc
 		return ret;
 	}
 
+	if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	switch (fc_usb->udev->speed) {
 	case USB_SPEED_LOW:
 		err("cannot handle USB speed because it is too slow.");
@@ -514,9 +517,6 @@ static int flexcop_usb_probe(struct usb_
 	struct flexcop_device *fc = NULL;
 	int ret;
 
-	if (intf->cur_altsetting->desc.bNumEndpoints < 1)
-		return -ENODEV;
-
 	if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) {
 		err("out of memory\n");
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/dvb-usb/dib0700_core.c linux-libre-4.4.218-gnu/drivers/media/usb/dvb-usb/dib0700_core.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/dvb-usb/dib0700_core.c	2020-03-20 06:38:41.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/dvb-usb/dib0700_core.c	2020-04-02 23:29:09.000000000 -0400
@@ -783,7 +783,7 @@ int dib0700_rc_setup(struct dvb_usb_devi
 
 	/* Starting in firmware 1.20, the RC info is provided on a bulk pipe */
 
-	if (intf->altsetting[0].desc.bNumEndpoints < rc_ep + 1)
+	if (intf->cur_altsetting->desc.bNumEndpoints < rc_ep + 1)
 		return -ENODEV;
 
 	purb = usb_alloc_urb(0, GFP_KERNEL);
@@ -805,7 +805,7 @@ int dib0700_rc_setup(struct dvb_usb_devi
 	 * Some devices like the Hauppauge NovaTD model 52009 use an interrupt
 	 * endpoint, while others use a bulk one.
 	 */
-	e = &intf->altsetting[0].endpoint[rc_ep].desc;
+	e = &intf->cur_altsetting->endpoint[rc_ep].desc;
 	if (usb_endpoint_dir_in(e)) {
 		if (usb_endpoint_xfer_bulk(e)) {
 			pipe = usb_rcvbulkpipe(d->udev, rc_ep);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/gspca/ov519.c linux-libre-4.4.218-gnu/drivers/media/usb/gspca/ov519.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/gspca/ov519.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/gspca/ov519.c	2020-04-02 13:02:40.000000000 -0400
@@ -3507,6 +3507,11 @@ static void ov511_mode_init_regs(struct
 		return;
 	}
 
+	if (alt->desc.bNumEndpoints < 1) {
+		sd->gspca_dev.usb_err = -ENODEV;
+		return;
+	}
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	reg_w(sd, R51x_FIFO_PSIZE, packet_size >> 5);
 
@@ -3632,6 +3637,11 @@ static void ov518_mode_init_regs(struct
 		return;
 	}
 
+	if (alt->desc.bNumEndpoints < 1) {
+		sd->gspca_dev.usb_err = -ENODEV;
+		return;
+	}
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	ov518_reg_w32(sd, R51x_FIFO_PSIZE, packet_size & ~7, 2);
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/gspca/stv06xx/stv06xx.c linux-libre-4.4.218-gnu/drivers/media/usb/gspca/stv06xx/stv06xx.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/gspca/stv06xx/stv06xx.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/gspca/stv06xx/stv06xx.c	2020-04-02 13:02:40.000000000 -0400
@@ -293,6 +293,9 @@ static int stv06xx_start(struct gspca_de
 		return -EIO;
 	}
 
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	err = stv06xx_write_bridge(sd, STV_ISO_SIZE_L, packet_size);
 	if (err < 0)
@@ -317,11 +320,21 @@ out:
 
 static int stv06xx_isoc_init(struct gspca_dev *gspca_dev)
 {
+	struct usb_interface_cache *intfc;
 	struct usb_host_interface *alt;
 	struct sd *sd = (struct sd *) gspca_dev;
 
+	intfc = gspca_dev->dev->actconfig->intf_cache[0];
+
+	if (intfc->num_altsetting < 2)
+		return -ENODEV;
+
+	alt = &intfc->altsetting[1];
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	/* Start isoc bandwidth "negotiation" at max isoc bandwidth */
-	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	alt->endpoint[0].desc.wMaxPacketSize =
 		cpu_to_le16(sd->sensor->max_packet_size[gspca_dev->curr_mode]);
 
@@ -334,6 +347,10 @@ static int stv06xx_isoc_nego(struct gspc
 	struct usb_host_interface *alt;
 	struct sd *sd = (struct sd *) gspca_dev;
 
+	/*
+	 * Existence of altsetting and endpoint was verified in
+	 * stv06xx_isoc_init()
+	 */
 	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	min_packet_size = sd->sensor->min_packet_size[gspca_dev->curr_mode];
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c linux-libre-4.4.218-gnu/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c	2020-04-02 13:02:40.000000000 -0400
@@ -198,6 +198,10 @@ static int pb0100_start(struct sd *sd)
 	alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
 	if (!alt)
 		return -ENODEV;
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 
 	/* If we don't have enough bandwidth use a lower framerate */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/gspca/xirlink_cit.c linux-libre-4.4.218-gnu/drivers/media/usb/gspca/xirlink_cit.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/gspca/xirlink_cit.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/gspca/xirlink_cit.c	2020-04-02 13:02:40.000000000 -0400
@@ -1455,6 +1455,9 @@ static int cit_get_packet_size(struct gs
 		return -EIO;
 	}
 
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	return le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 }
 
@@ -2638,6 +2641,7 @@ static int sd_start(struct gspca_dev *gs
 
 static int sd_isoc_init(struct gspca_dev *gspca_dev)
 {
+	struct usb_interface_cache *intfc;
 	struct usb_host_interface *alt;
 	int max_packet_size;
 
@@ -2653,8 +2657,17 @@ static int sd_isoc_init(struct gspca_dev
 		break;
 	}
 
+	intfc = gspca_dev->dev->actconfig->intf_cache[0];
+
+	if (intfc->num_altsetting < 2)
+		return -ENODEV;
+
+	alt = &intfc->altsetting[1];
+
+	if (alt->desc.bNumEndpoints < 1)
+		return -ENODEV;
+
 	/* Start isoc bandwidth "negotiation" at max isoc bandwidth */
-	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	alt->endpoint[0].desc.wMaxPacketSize = cpu_to_le16(max_packet_size);
 
 	return 0;
@@ -2677,6 +2690,9 @@ static int sd_isoc_nego(struct gspca_dev
 		break;
 	}
 
+	/*
+	 * Existence of altsetting and endpoint was verified in sd_isoc_init()
+	 */
 	alt = &gspca_dev->dev->actconfig->intf_cache[0]->altsetting[1];
 	packet_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize);
 	if (packet_size <= min_packet_size)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/media/usb/usbtv/usbtv-core.c linux-libre-4.4.218-gnu/drivers/media/usb/usbtv/usbtv-core.c
--- linux-libre-4.4.217-gnu/drivers/media/usb/usbtv/usbtv-core.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/media/usb/usbtv/usbtv-core.c	2020-04-02 13:02:40.000000000 -0400
@@ -42,7 +42,7 @@ int usbtv_set_regs(struct usbtv *usbtv,
 
 		ret = usb_control_msg(usbtv->udev, pipe, USBTV_REQUEST_REG,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			value, index, NULL, 0, 0);
+			value, index, NULL, 0, USB_CTRL_GET_TIMEOUT);
 		if (ret < 0)
 			return ret;
 	}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/misc/altera-stapl/altera.c linux-libre-4.4.218-gnu/drivers/misc/altera-stapl/altera.c
--- linux-libre-4.4.217-gnu/drivers/misc/altera-stapl/altera.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/misc/altera-stapl/altera.c	2020-04-02 13:02:40.000000000 -0400
@@ -2126,8 +2126,8 @@ exit_done:
 	return status;
 }
 
-static int altera_get_note(u8 *p, s32 program_size,
-			s32 *offset, char *key, char *value, int length)
+static int altera_get_note(u8 *p, s32 program_size, s32 *offset,
+			   char *key, char *value, int keylen, int vallen)
 /*
  * Gets key and value of NOTE fields in the JBC file.
  * Can be called in two modes:  if offset pointer is NULL,
@@ -2184,7 +2184,7 @@ static int altera_get_note(u8 *p, s32 pr
 						&p[note_table + (8 * i) + 4])];
 
 				if (value != NULL)
-					strlcpy(value, value_ptr, length);
+					strlcpy(value, value_ptr, vallen);
 
 			}
 		}
@@ -2203,13 +2203,13 @@ static int altera_get_note(u8 *p, s32 pr
 				strlcpy(key, &p[note_strings +
 						get_unaligned_be32(
 						&p[note_table + (8 * i)])],
-					length);
+					keylen);
 
 			if (value != NULL)
 				strlcpy(value, &p[note_strings +
 						get_unaligned_be32(
 						&p[note_table + (8 * i) + 4])],
-					length);
+					vallen);
 
 			*offset = i + 1;
 		}
@@ -2463,7 +2463,7 @@ int altera_init(struct altera_config *co
 			__func__, (format_version == 2) ? "Jam STAPL" :
 						"pre-standardized Jam 1.1");
 		while (altera_get_note((u8 *)fw->data, fw->size,
-					&offset, key, value, 256) == 0)
+					&offset, key, value, 32, 256) == 0)
 			printk(KERN_INFO "%s: NOTE \"%s\" = \"%s\"\n",
 					__func__, key, value);
 	}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/net/can/slcan.c linux-libre-4.4.218-gnu/drivers/net/can/slcan.c
--- linux-libre-4.4.217-gnu/drivers/net/can/slcan.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/net/can/slcan.c	2020-04-02 13:02:40.000000000 -0400
@@ -621,7 +621,10 @@ err_free_chan:
 	tty->disc_data = NULL;
 	clear_bit(SLF_INUSE, &sl->flags);
 	slc_free_netdev(sl->dev);
+	/* do not call free_netdev before rtnl_unlock */
+	rtnl_unlock();
 	free_netdev(sl->dev);
+	return err;
 
 err_exit:
 	rtnl_unlock();
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/net/ethernet/micrel/ks8851_mll.c linux-libre-4.4.218-gnu/drivers/net/ethernet/micrel/ks8851_mll.c
--- linux-libre-4.4.217-gnu/drivers/net/ethernet/micrel/ks8851_mll.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/net/ethernet/micrel/ks8851_mll.c	2020-04-02 13:02:40.000000000 -0400
@@ -475,6 +475,50 @@ static int msg_enable;
  */
 
 /**
+ * ks_check_endian - Check whether endianness of the bus is correct
+ * @ks	  : The chip information
+ *
+ * The KS8851-16MLL EESK pin allows selecting the endianness of the 16bit
+ * bus. To maintain optimum performance, the bus endianness should be set
+ * such that it matches the endianness of the CPU.
+ */
+
+static int ks_check_endian(struct ks_net *ks)
+{
+	u16 cider;
+
+	/*
+	 * Read CIDER register first, however read it the "wrong" way around.
+	 * If the endian strap on the KS8851-16MLL in incorrect and the chip
+	 * is operating in different endianness than the CPU, then the meaning
+	 * of BE[3:0] byte-enable bits is also swapped such that:
+	 *    BE[3,2,1,0] becomes BE[1,0,3,2]
+	 *
+	 * Luckily for us, the byte-enable bits are the top four MSbits of
+	 * the address register and the CIDER register is at offset 0xc0.
+	 * Hence, by reading address 0xc0c0, which is not impacted by endian
+	 * swapping, we assert either BE[3:2] or BE[1:0] while reading the
+	 * CIDER register.
+	 *
+	 * If the bus configuration is correct, reading 0xc0c0 asserts
+	 * BE[3:2] and this read returns 0x0000, because to read register
+	 * with bottom two LSbits of address set to 0, BE[1:0] must be
+	 * asserted.
+	 *
+	 * If the bus configuration is NOT correct, reading 0xc0c0 asserts
+	 * BE[1:0] and this read returns non-zero 0x8872 value.
+	 */
+	iowrite16(BE3 | BE2 | KS_CIDER, ks->hw_addr_cmd);
+	cider = ioread16(ks->hw_addr);
+	if (!cider)
+		return 0;
+
+	netdev_err(ks->netdev, "incorrect EESK endian strap setting\n");
+
+	return -EINVAL;
+}
+
+/**
  * ks_rdreg16 - read 16 bit register from device
  * @ks	  : The chip information
  * @offset: The register address
@@ -484,7 +528,7 @@ static int msg_enable;
 
 static u16 ks_rdreg16(struct ks_net *ks, int offset)
 {
-	ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02));
+	ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
 	iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
 	return ioread16(ks->hw_addr);
 }
@@ -499,7 +543,7 @@ static u16 ks_rdreg16(struct ks_net *ks,
 
 static void ks_wrreg16(struct ks_net *ks, int offset, u16 value)
 {
-	ks->cmd_reg_cache = (u16)offset | ((BE3 | BE2) >> (offset & 0x02));
+	ks->cmd_reg_cache = (u16)offset | ((BE1 | BE0) << (offset & 0x02));
 	iowrite16(ks->cmd_reg_cache, ks->hw_addr_cmd);
 	iowrite16(value, ks->hw_addr);
 }
@@ -515,7 +559,7 @@ static inline void ks_inblk(struct ks_ne
 {
 	len >>= 1;
 	while (len--)
-		*wptr++ = be16_to_cpu(ioread16(ks->hw_addr));
+		*wptr++ = (u16)ioread16(ks->hw_addr);
 }
 
 /**
@@ -529,7 +573,7 @@ static inline void ks_outblk(struct ks_n
 {
 	len >>= 1;
 	while (len--)
-		iowrite16(cpu_to_be16(*wptr++), ks->hw_addr);
+		iowrite16(*wptr++, ks->hw_addr);
 }
 
 static void ks_disable_int(struct ks_net *ks)
@@ -1535,6 +1579,10 @@ static int ks8851_probe(struct platform_
 		goto err_free;
 	}
 
+	err = ks_check_endian(ks);
+	if (err)
+		goto err_free;
+
 	netdev->irq = platform_get_irq(pdev, 0);
 
 	if ((int)netdev->irq < 0) {
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c linux-libre-4.4.218-gnu/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
--- linux-libre-4.4.217-gnu/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c	2020-04-02 13:02:40.000000000 -0400
@@ -2315,7 +2315,7 @@ static int __init sxgbe_cmdline_opt(char
 	if (!str || !*str)
 		return -EINVAL;
 	while ((opt = strsep(&str, ",")) != NULL) {
-		if (!strncmp(opt, "eee_timer:", 6)) {
+		if (!strncmp(opt, "eee_timer:", 10)) {
 			if (kstrtoint(opt + 10, 0, &eee_timer))
 				goto err;
 		}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/net/vxlan.c linux-libre-4.4.218-gnu/drivers/net/vxlan.c
--- linux-libre-4.4.217-gnu/drivers/net/vxlan.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/net/vxlan.c	2020-04-02 13:02:40.000000000 -0400
@@ -2303,10 +2303,19 @@ static void vxlan_vs_add_dev(struct vxla
 /* Setup stats when device is created */
 static int vxlan_init(struct net_device *dev)
 {
+	struct vxlan_dev *vxlan = netdev_priv(dev);
+	int err;
+
 	dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!dev->tstats)
 		return -ENOMEM;
 
+	err = gro_cells_init(&vxlan->gro_cells, dev);
+	if (err) {
+		free_percpu(dev->tstats);
+		return err;
+	}
+
 	return 0;
 }
 
@@ -2584,8 +2593,6 @@ static void vxlan_setup(struct net_devic
 
 	vxlan->dev = dev;
 
-	gro_cells_init(&vxlan->gro_cells, dev);
-
 	for (h = 0; h < FDB_HASH_SIZE; ++h)
 		INIT_HLIST_HEAD(&vxlan->fdb_head[h]);
 }
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/nfc/fdp/fdp.c linux-libre-4.4.218-gnu/drivers/nfc/fdp/fdp.c
--- linux-libre-4.4.217-gnu/drivers/nfc/fdp/fdp.c	2020-03-20 06:47:26.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/nfc/fdp/fdp.c	2020-04-02 23:39:28.000000000 -0400
@@ -191,7 +191,7 @@ static int fdp_nci_send_patch(struct nci
 	const struct firmware *fw;
 	struct sk_buff *skb;
 	unsigned long len;
-	u8 max_size, payload_size;
+	int max_size, payload_size;
 	int rc = 0;
 
 	if ((type == NCI_PATCH_TYPE_OTP && !info->otp_patch) ||
@@ -214,8 +214,7 @@ static int fdp_nci_send_patch(struct nci
 
 	while (len) {
 
-		payload_size = min_t(unsigned long, (unsigned long) max_size,
-				     len);
+		payload_size = min_t(unsigned long, max_size, len);
 
 		skb = nci_skb_alloc(ndev, (NCI_CTRL_HDR_SIZE + payload_size),
 				    GFP_KERNEL);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/rtc/Kconfig linux-libre-4.4.218-gnu/drivers/rtc/Kconfig
--- linux-libre-4.4.217-gnu/drivers/rtc/Kconfig	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/rtc/Kconfig	2020-04-02 13:02:40.000000000 -0400
@@ -278,6 +278,7 @@ config RTC_DRV_MAX6900
 config RTC_DRV_MAX8907
 	tristate "Maxim MAX8907"
 	depends on MFD_MAX8907
+	select REGMAP_IRQ
 	help
 	  If you say yes here you will get support for the
 	  RTC of Maxim MAX8907 PMIC.
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/scsi/ipr.c linux-libre-4.4.218-gnu/drivers/scsi/ipr.c
--- linux-libre-4.4.217-gnu/drivers/scsi/ipr.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/scsi/ipr.c	2020-04-02 13:02:40.000000000 -0400
@@ -9730,6 +9730,7 @@ static void ipr_init_ioa_cfg(struct ipr_
 	ioa_cfg->max_devs_supported = ipr_max_devs;
 
 	if (ioa_cfg->sis64) {
+		host->max_channel = IPR_MAX_SIS64_BUSES;
 		host->max_id = IPR_MAX_SIS64_TARGETS_PER_BUS;
 		host->max_lun = IPR_MAX_SIS64_LUNS_PER_TARGET;
 		if (ipr_max_devs > IPR_MAX_SIS64_DEVS)
@@ -9738,6 +9739,7 @@ static void ipr_init_ioa_cfg(struct ipr_
 					   + ((sizeof(struct ipr_config_table_entry64)
 					       * ioa_cfg->max_devs_supported)));
 	} else {
+		host->max_channel = IPR_VSET_BUS;
 		host->max_id = IPR_MAX_NUM_TARGETS_PER_BUS;
 		host->max_lun = IPR_MAX_NUM_LUNS_PER_TARGET;
 		if (ipr_max_devs > IPR_MAX_PHYSICAL_DEVS)
@@ -9747,7 +9749,6 @@ static void ipr_init_ioa_cfg(struct ipr_
 					       * ioa_cfg->max_devs_supported)));
 	}
 
-	host->max_channel = IPR_VSET_BUS;
 	host->unique_id = host->host_no;
 	host->max_cmd_len = IPR_MAX_CDB_LEN;
 	host->can_queue = ioa_cfg->max_cmds;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/scsi/ipr.h linux-libre-4.4.218-gnu/drivers/scsi/ipr.h
--- linux-libre-4.4.217-gnu/drivers/scsi/ipr.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/scsi/ipr.h	2020-04-02 13:02:40.000000000 -0400
@@ -1301,6 +1301,7 @@ struct ipr_resource_entry {
 #define IPR_ARRAY_VIRTUAL_BUS			0x1
 #define IPR_VSET_VIRTUAL_BUS			0x2
 #define IPR_IOAFP_VIRTUAL_BUS			0x3
+#define IPR_MAX_SIS64_BUSES			0x4
 
 #define IPR_GET_RES_PHYS_LOC(res) \
 	(((res)->bus << 24) | ((res)->target << 8) | (res)->lun)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/scsi/sd.c linux-libre-4.4.218-gnu/drivers/scsi/sd.c
--- linux-libre-4.4.217-gnu/drivers/scsi/sd.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/scsi/sd.c	2020-04-02 13:02:40.000000000 -0400
@@ -2915,9 +2915,11 @@ static int sd_revalidate_disk(struct gen
 	    logical_to_bytes(sdp, sdkp->opt_xfer_blocks) >= PAGE_CACHE_SIZE) {
 		q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
 		rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
-	} else
+	} else {
+		q->limits.io_opt = 0;
 		rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
 				      (sector_t)BLK_DEF_MAX_SECTORS);
+	}
 
 	/* Do not exceed controller limit */
 	rw_max = min(rw_max, queue_max_hw_sectors(q));
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/spi/spi-qup.c linux-libre-4.4.218-gnu/drivers/spi/spi-qup.c
--- linux-libre-4.4.217-gnu/drivers/spi/spi-qup.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/spi/spi-qup.c	2020-04-02 13:02:40.000000000 -0400
@@ -961,6 +961,11 @@ static int spi_qup_suspend(struct device
 	struct spi_qup *controller = spi_master_get_devdata(master);
 	int ret;
 
+	if (pm_runtime_suspended(device)) {
+		ret = spi_qup_pm_resume_runtime(device);
+		if (ret)
+			return ret;
+	}
 	ret = spi_master_suspend(master);
 	if (ret)
 		return ret;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/spi/spi-zynqmp-gqspi.c linux-libre-4.4.218-gnu/drivers/spi/spi-zynqmp-gqspi.c
--- linux-libre-4.4.217-gnu/drivers/spi/spi-zynqmp-gqspi.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/spi/spi-zynqmp-gqspi.c	2020-04-02 13:02:40.000000000 -0400
@@ -414,9 +414,6 @@ static void zynqmp_qspi_chipselect(struc
 
 	zynqmp_gqspi_write(xqspi, GQSPI_GEN_FIFO_OFST, genfifoentry);
 
-	/* Dummy generic FIFO entry */
-	zynqmp_gqspi_write(xqspi, GQSPI_GEN_FIFO_OFST, 0x0);
-
 	/* Manually start the generic FIFO command */
 	zynqmp_gqspi_write(xqspi, GQSPI_CONFIG_OFST,
 			zynqmp_gqspi_read(xqspi, GQSPI_CONFIG_OFST) |
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c linux-libre-4.4.218-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c
--- linux-libre-4.4.217-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2020-04-02 13:02:40.000000000 -0400
@@ -44,12 +44,14 @@ static struct usb_device_id rtw_usb_id_t
 	/****** 8188EUS ********/
 	{USB_DEVICE(0x056e, 0x4008)}, /* Elecom WDC-150SU2M */
 	{USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
+	{USB_DEVICE(0x0B05, 0x18F0)}, /* ASUS USB-N10 Nano B1 */
 	{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
 	{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
 	{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
 	{USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
 	{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
 	{USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
+	{USB_DEVICE(0x2C4E, 0x0102)}, /* MERCUSYS MW150US v2 */
 	{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
 	{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
 	{}	/* Terminating entry */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/staging/speakup/main.c linux-libre-4.4.218-gnu/drivers/staging/speakup/main.c
--- linux-libre-4.4.217-gnu/drivers/staging/speakup/main.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/staging/speakup/main.c	2020-04-02 13:02:40.000000000 -0400
@@ -562,8 +562,7 @@ static u_long get_word(struct vc_data *v
 		return 0;
 	} else if ((tmpx < vc->vc_cols - 2)
 		   && (ch == SPACE || ch == 0 || IS_WDLM(ch))
-		   && ((char)get_char(vc, (u_short *) &tmp_pos + 1, &temp) >
-		       SPACE)) {
+		   && ((char)get_char(vc, (u_short *)tmp_pos + 1, &temp) > SPACE)) {
 		tmp_pos += 2;
 		tmpx++;
 	} else
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/staging/wlan-ng/hfa384x_usb.c linux-libre-4.4.218-gnu/drivers/staging/wlan-ng/hfa384x_usb.c
--- linux-libre-4.4.217-gnu/drivers/staging/wlan-ng/hfa384x_usb.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/staging/wlan-ng/hfa384x_usb.c	2020-04-02 13:02:40.000000000 -0400
@@ -3574,6 +3574,8 @@ static void hfa384x_int_rxmonitor(wlande
 	     WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)) {
 		pr_debug("overlen frm: len=%zd\n",
 			 skblen - sizeof(struct p80211_caphdr));
+
+		return;
 	}
 
 	skb = dev_alloc_skb(skblen);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/tty/vt/selection.c linux-libre-4.4.218-gnu/drivers/tty/vt/selection.c
--- linux-libre-4.4.217-gnu/drivers/tty/vt/selection.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/tty/vt/selection.c	2020-04-02 13:02:40.000000000 -0400
@@ -80,6 +80,11 @@ void clear_selection(void)
 	}
 }
 
+bool vc_is_sel(struct vc_data *vc)
+{
+	return vc == sel_cons;
+}
+
 /*
  * User settable table: what characters are to be considered alphabetic?
  * 256 bits. Locked by the console lock.
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/tty/vt/vt.c linux-libre-4.4.218-gnu/drivers/tty/vt/vt.c
--- linux-libre-4.4.217-gnu/drivers/tty/vt/vt.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/tty/vt/vt.c	2020-04-02 13:02:40.000000000 -0400
@@ -600,8 +600,9 @@ static void hide_softcursor(struct vc_da
 
 static void hide_cursor(struct vc_data *vc)
 {
-	if (vc == sel_cons)
+	if (vc_is_sel(vc))
 		clear_selection();
+
 	vc->vc_sw->con_cursor(vc, CM_ERASE);
 	hide_softcursor(vc);
 }
@@ -612,7 +613,7 @@ static void set_cursor(struct vc_data *v
 	    vc->vc_mode == KD_GRAPHICS)
 		return;
 	if (vc->vc_deccm) {
-		if (vc == sel_cons)
+		if (vc_is_sel(vc))
 			clear_selection();
 		add_softcursor(vc);
 		if ((vc->vc_cursor_type & 0x0f) != 1)
@@ -759,6 +760,17 @@ static void visual_init(struct vc_data *
 	vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
 }
 
+static void vc_port_destruct(struct tty_port *port)
+{
+	struct vc_data *vc = container_of(port, struct vc_data, port);
+
+	kfree(vc);
+}
+
+static const struct tty_port_operations vc_port_ops = {
+	.destruct = vc_port_destruct,
+};
+
 int vc_allocate(unsigned int currcons)	/* return 0 on success */
 {
 	WARN_CONSOLE_UNLOCKED();
@@ -784,6 +796,7 @@ int vc_allocate(unsigned int currcons)	/
 		return -ENOMEM;
 	    vc_cons[currcons].d = vc;
 	    tty_port_init(&vc->port);
+	    vc->port.ops = &vc_port_ops;
 	    INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
 	    visual_init(vc, currcons, 1);
 	    if (!*vc->vc_uni_pagedir_loc)
@@ -878,7 +891,7 @@ static int vc_do_resize(struct tty_struc
 	if (!newscreen)
 		return -ENOMEM;
 
-	if (vc == sel_cons)
+	if (vc_is_sel(vc))
 		clear_selection();
 
 	old_rows = vc->vc_rows;
@@ -2893,6 +2906,7 @@ static int con_install(struct tty_driver
 
 	tty->driver_data = vc;
 	vc->port.tty = tty;
+	tty_port_get(&vc->port);
 
 	if (!tty->winsize.ws_row && !tty->winsize.ws_col) {
 		tty->winsize.ws_row = vc_cons[currcons].d->vc_rows;
@@ -2928,6 +2942,13 @@ static void con_shutdown(struct tty_stru
 	console_unlock();
 }
 
+static void con_cleanup(struct tty_struct *tty)
+{
+	struct vc_data *vc = tty->driver_data;
+
+	tty_port_put(&vc->port);
+}
+
 static int default_color           = 7; /* white */
 static int default_italic_color    = 2; // green (ASCII)
 static int default_underline_color = 3; // cyan (ASCII)
@@ -3052,7 +3073,8 @@ static const struct tty_operations con_o
 	.throttle = con_throttle,
 	.unthrottle = con_unthrottle,
 	.resize = vt_resize,
-	.shutdown = con_shutdown
+	.shutdown = con_shutdown,
+	.cleanup = con_cleanup,
 };
 
 static struct cdev vc0_cdev;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/tty/vt/vt_ioctl.c linux-libre-4.4.218-gnu/drivers/tty/vt/vt_ioctl.c
--- linux-libre-4.4.217-gnu/drivers/tty/vt/vt_ioctl.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/tty/vt/vt_ioctl.c	2020-04-02 13:02:40.000000000 -0400
@@ -38,11 +38,32 @@
 #include <linux/kbd_diacr.h>
 #include <linux/selection.h>
 
-char vt_dont_switch;
-extern struct tty_driver *console_driver;
+bool vt_dont_switch;
 
-#define VT_IS_IN_USE(i)	(console_driver->ttys[i] && console_driver->ttys[i]->count)
-#define VT_BUSY(i)	(VT_IS_IN_USE(i) || i == fg_console || vc_cons[i].d == sel_cons)
+static inline bool vt_in_use(unsigned int i)
+{
+	const struct vc_data *vc = vc_cons[i].d;
+
+	/*
+	 * console_lock must be held to prevent the vc from being deallocated
+	 * while we're checking whether it's in-use.
+	 */
+	WARN_CONSOLE_UNLOCKED();
+
+	return vc && kref_read(&vc->port.kref) > 1;
+}
+
+static inline bool vt_busy(int i)
+{
+	if (vt_in_use(i))
+		return true;
+	if (i == fg_console)
+		return true;
+	if (vc_is_sel(vc_cons[i].d))
+		return true;
+
+	return false;
+}
 
 /*
  * Console (vt and kd) routines, as defined by USL SVR4 manual, and by
@@ -292,16 +313,14 @@ static int vt_disallocate(unsigned int v
 	int ret = 0;
 
 	console_lock();
-	if (VT_BUSY(vc_num))
+	if (vt_busy(vc_num))
 		ret = -EBUSY;
 	else if (vc_num)
 		vc = vc_deallocate(vc_num);
 	console_unlock();
 
-	if (vc && vc_num >= MIN_NR_CONSOLES) {
-		tty_port_destroy(&vc->port);
-		kfree(vc);
-	}
+	if (vc && vc_num >= MIN_NR_CONSOLES)
+		tty_port_put(&vc->port);
 
 	return ret;
 }
@@ -314,17 +333,15 @@ static void vt_disallocate_all(void)
 
 	console_lock();
 	for (i = 1; i < MAX_NR_CONSOLES; i++)
-		if (!VT_BUSY(i))
+		if (!vt_busy(i))
 			vc[i] = vc_deallocate(i);
 		else
 			vc[i] = NULL;
 	console_unlock();
 
 	for (i = 1; i < MAX_NR_CONSOLES; i++) {
-		if (vc[i] && i >= MIN_NR_CONSOLES) {
-			tty_port_destroy(&vc[i]->port);
-			kfree(vc[i]);
-		}
+		if (vc[i] && i >= MIN_NR_CONSOLES)
+			tty_port_put(&vc[i]->port);
 	}
 }
 
@@ -338,22 +355,13 @@ int vt_ioctl(struct tty_struct *tty,
 {
 	struct vc_data *vc = tty->driver_data;
 	struct console_font_op op;	/* used in multiple places here */
-	unsigned int console;
+	unsigned int console = vc->vc_num;
 	unsigned char ucval;
 	unsigned int uival;
 	void __user *up = (void __user *)arg;
 	int i, perm;
 	int ret = 0;
 
-	console = vc->vc_num;
-
-
-	if (!vc_cons_allocated(console)) { 	/* impossible? */
-		ret = -ENOIOCTLCMD;
-		goto out;
-	}
-
-
 	/*
 	 * To have permissions to do most of the vt ioctls, we either have
 	 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
@@ -644,15 +652,16 @@ int vt_ioctl(struct tty_struct *tty,
 		struct vt_stat __user *vtstat = up;
 		unsigned short state, mask;
 
-		/* Review: FIXME: Console lock ? */
 		if (put_user(fg_console + 1, &vtstat->v_active))
 			ret = -EFAULT;
 		else {
 			state = 1;	/* /dev/tty0 is always open */
+			console_lock(); /* required by vt_in_use() */
 			for (i = 0, mask = 2; i < MAX_NR_CONSOLES && mask;
 							++i, mask <<= 1)
-				if (VT_IS_IN_USE(i))
+				if (vt_in_use(i))
 					state |= mask;
+			console_unlock();
 			ret = put_user(state, &vtstat->v_state);
 		}
 		break;
@@ -662,10 +671,11 @@ int vt_ioctl(struct tty_struct *tty,
 	 * Returns the first available (non-opened) console.
 	 */
 	case VT_OPENQRY:
-		/* FIXME: locking ? - but then this is a stupid API */
+		console_lock(); /* required by vt_in_use() */
 		for (i = 0; i < MAX_NR_CONSOLES; ++i)
-			if (! VT_IS_IN_USE(i))
+			if (!vt_in_use(i))
 				break;
+		console_unlock();
 		uival = i < MAX_NR_CONSOLES ? (i+1) : -1;
 		goto setint;		 
 
@@ -1020,12 +1030,12 @@ int vt_ioctl(struct tty_struct *tty,
 	case VT_LOCKSWITCH:
 		if (!capable(CAP_SYS_TTY_CONFIG))
 			return -EPERM;
-		vt_dont_switch = 1;
+		vt_dont_switch = true;
 		break;
 	case VT_UNLOCKSWITCH:
 		if (!capable(CAP_SYS_TTY_CONFIG))
 			return -EPERM;
-		vt_dont_switch = 0;
+		vt_dont_switch = false;
 		break;
 	case VT_GETHIFONTMASK:
 		ret = put_user(vc->vc_hi_font_mask,
@@ -1193,18 +1203,10 @@ long vt_compat_ioctl(struct tty_struct *
 {
 	struct vc_data *vc = tty->driver_data;
 	struct console_font_op op;	/* used in multiple places here */
-	unsigned int console;
 	void __user *up = (void __user *)arg;
 	int perm;
 	int ret = 0;
 
-	console = vc->vc_num;
-
-	if (!vc_cons_allocated(console)) { 	/* impossible? */
-		ret = -ENOIOCTLCMD;
-		goto out;
-	}
-
 	/*
 	 * To have permissions to do most of the vt ioctls, we either have
 	 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
@@ -1264,7 +1266,7 @@ long vt_compat_ioctl(struct tty_struct *
 		arg = (unsigned long)compat_ptr(arg);
 		goto fallback;
 	}
-out:
+
 	return ret;
 
 fallback:
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/class/cdc-acm.c linux-libre-4.4.218-gnu/drivers/usb/class/cdc-acm.c
--- linux-libre-4.4.217-gnu/drivers/usb/class/cdc-acm.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/class/cdc-acm.c	2020-04-02 13:02:40.000000000 -0400
@@ -841,10 +841,10 @@ static int get_serial_info(struct acm *a
 	tmp.flags = ASYNC_LOW_LATENCY;
 	tmp.xmit_fifo_size = acm->writesize;
 	tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);
-	tmp.close_delay	= acm->port.close_delay / 10;
+	tmp.close_delay	= jiffies_to_msecs(acm->port.close_delay) / 10;
 	tmp.closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
 				ASYNC_CLOSING_WAIT_NONE :
-				acm->port.closing_wait / 10;
+				jiffies_to_msecs(acm->port.closing_wait) / 10;
 
 	if (copy_to_user(info, &tmp, sizeof(tmp)))
 		return -EFAULT;
@@ -857,20 +857,28 @@ static int set_serial_info(struct acm *a
 {
 	struct serial_struct new_serial;
 	unsigned int closing_wait, close_delay;
+	unsigned int old_closing_wait, old_close_delay;
 	int retval = 0;
 
 	if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
 		return -EFAULT;
 
-	close_delay = new_serial.close_delay * 10;
+	close_delay = msecs_to_jiffies(new_serial.close_delay * 10);
 	closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-			ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10;
+			ASYNC_CLOSING_WAIT_NONE :
+			msecs_to_jiffies(new_serial.closing_wait * 10);
+
+	/* we must redo the rounding here, so that the values match */
+	old_close_delay	= jiffies_to_msecs(acm->port.close_delay) / 10;
+	old_closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
+				ASYNC_CLOSING_WAIT_NONE :
+				jiffies_to_msecs(acm->port.closing_wait) / 10;
 
 	mutex_lock(&acm->port.mutex);
 
 	if (!capable(CAP_SYS_ADMIN)) {
-		if ((close_delay != acm->port.close_delay) ||
-		    (closing_wait != acm->port.closing_wait))
+		if ((new_serial.close_delay != old_close_delay) ||
+	            (new_serial.closing_wait != old_closing_wait))
 			retval = -EPERM;
 		else
 			retval = -EOPNOTSUPP;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/core/quirks.c linux-libre-4.4.218-gnu/drivers/usb/core/quirks.c
--- linux-libre-4.4.217-gnu/drivers/usb/core/quirks.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/core/quirks.c	2020-04-02 13:02:40.000000000 -0400
@@ -229,6 +229,12 @@ static const struct usb_device_id usb_qu
 	{ USB_DEVICE(0x0b05, 0x17e0), .driver_info =
 			USB_QUIRK_IGNORE_REMOTE_WAKEUP },
 
+	/* Realtek hub in Dell WD19 (Type-C) */
+	{ USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
+
+	/* Generic RTL8153 based ethernet adapters */
+	{ USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM },
+
 	/* Action Semiconductor flash disk */
 	{ USB_DEVICE(0x10d6, 0x2200), .driver_info =
 			USB_QUIRK_STRING_FETCH_255 },
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/host/xhci-plat.c linux-libre-4.4.218-gnu/drivers/usb/host/xhci-plat.c
--- linux-libre-4.4.217-gnu/drivers/usb/host/xhci-plat.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/host/xhci-plat.c	2020-04-02 13:02:40.000000000 -0400
@@ -284,6 +284,7 @@ MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_
 static struct platform_driver usb_xhci_driver = {
 	.probe	= xhci_plat_probe,
 	.remove	= xhci_plat_remove,
+	.shutdown = usb_hcd_platform_shutdown,
 	.driver	= {
 		.name = "xhci-hcd",
 		.pm = DEV_PM_OPS,
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/musb/musb_host.c linux-libre-4.4.218-gnu/drivers/usb/musb/musb_host.c
--- linux-libre-4.4.217-gnu/drivers/usb/musb/musb_host.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/musb/musb_host.c	2020-04-02 13:02:40.000000000 -0400
@@ -1519,10 +1519,7 @@ done:
 	 * We need to map sg if the transfer_buffer is
 	 * NULL.
 	 */
-	if (!urb->transfer_buffer)
-		qh->use_sg = true;
-
-	if (qh->use_sg) {
+	if (!urb->transfer_buffer) {
 		/* sg_miter_start is already done in musb_ep_program */
 		if (!sg_miter_next(&qh->sg_miter)) {
 			dev_err(musb->controller, "error: sg list empty\n");
@@ -1530,9 +1527,8 @@ done:
 			status = -EINVAL;
 			goto done;
 		}
-		urb->transfer_buffer = qh->sg_miter.addr;
 		length = min_t(u32, length, qh->sg_miter.length);
-		musb_write_fifo(hw_ep, length, urb->transfer_buffer);
+		musb_write_fifo(hw_ep, length, qh->sg_miter.addr);
 		qh->sg_miter.consumed = length;
 		sg_miter_stop(&qh->sg_miter);
 	} else {
@@ -1541,11 +1537,6 @@ done:
 
 	qh->segsize = length;
 
-	if (qh->use_sg) {
-		if (offset + length >= urb->transfer_buffer_length)
-			qh->use_sg = false;
-	}
-
 	musb_ep_select(mbase, epnum);
 	musb_writew(epio, MUSB_TXCSR,
 			MUSB_TXCSR_H_WZC_BITS | MUSB_TXCSR_TXPKTRDY);
@@ -2064,8 +2055,10 @@ finish:
 	urb->actual_length += xfer_len;
 	qh->offset += xfer_len;
 	if (done) {
-		if (qh->use_sg)
+		if (qh->use_sg) {
 			qh->use_sg = false;
+			urb->transfer_buffer = NULL;
+		}
 
 		if (urb->status == -EINPROGRESS)
 			urb->status = status;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/serial/io_edgeport.c linux-libre-4.4.218-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-4.4.217-gnu/drivers/usb/serial/io_edgeport.c	2020-03-20 06:55:44.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/serial/io_edgeport.c	2020-04-02 23:49:30.000000000 -0400
@@ -634,7 +634,7 @@ static void edge_interrupt_callback(stru
 		/* grab the txcredits for the ports if available */
 		position = 2;
 		portNumber = 0;
-		while ((position < length) &&
+		while ((position < length - 1) &&
 				(portNumber < edge_serial->serial->num_ports)) {
 			txCredits = data[position] | (data[position+1] << 8);
 			if (txCredits) {
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/serial/option.c linux-libre-4.4.218-gnu/drivers/usb/serial/option.c
--- linux-libre-4.4.217-gnu/drivers/usb/serial/option.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/serial/option.c	2020-04-02 13:02:40.000000000 -0400
@@ -1172,6 +1172,8 @@ static const struct usb_device_id option
 	  .driver_info = NCTRL(0) },
 	{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110a, 0xff),	/* Telit ME910G1 */
 	  .driver_info = NCTRL(0) | RSVD(3) },
+	{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110b, 0xff),	/* Telit ME910G1 (ECM) */
+	  .driver_info = NCTRL(0) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
 	  .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
@@ -1981,8 +1983,14 @@ static const struct usb_device_id option
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) },	/* D-Link DWM-152/C1 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) },	/* D-Link DWM-156/C1 */
 	{ USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) },	/* D-Link DWM-156/A3 */
+	{ USB_DEVICE_INTERFACE_CLASS(0x1435, 0xd191, 0xff),			/* Wistron Neweb D19Q1 */
+	  .driver_info = RSVD(1) | RSVD(4) },
+	{ USB_DEVICE_INTERFACE_CLASS(0x1690, 0x7588, 0xff),			/* ASKEY WWHC050 */
+	  .driver_info = RSVD(1) | RSVD(4) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2031, 0xff),			/* Olicard 600 */
 	  .driver_info = RSVD(4) },
+	{ USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2033, 0xff),			/* BroadMobi BM806U */
+	  .driver_info = RSVD(4) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2060, 0xff),			/* BroadMobi BM818 */
 	  .driver_info = RSVD(4) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) },			/* OLICARD300 - MT6225 */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/serial/pl2303.c linux-libre-4.4.218-gnu/drivers/usb/serial/pl2303.c
--- linux-libre-4.4.217-gnu/drivers/usb/serial/pl2303.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/serial/pl2303.c	2020-04-02 13:02:40.000000000 -0400
@@ -88,6 +88,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
 	{ USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
 	{ USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) },
+	{ USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) },
 	{ USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) },
 	{ USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) },
 	{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/usb/serial/pl2303.h linux-libre-4.4.218-gnu/drivers/usb/serial/pl2303.h
--- linux-libre-4.4.217-gnu/drivers/usb/serial/pl2303.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/usb/serial/pl2303.h	2020-04-02 13:02:40.000000000 -0400
@@ -128,6 +128,7 @@
 #define HP_LM920_PRODUCT_ID	0x026b
 #define HP_TD620_PRODUCT_ID	0x0956
 #define HP_LD960_PRODUCT_ID	0x0b39
+#define HP_LD381_PRODUCT_ID	0x0f7f
 #define HP_LCM220_PRODUCT_ID	0x3139
 #define HP_LCM960_PRODUCT_ID	0x3239
 #define HP_LD220_PRODUCT_ID	0x3524
diff -druNp --no-dereference linux-libre-4.4.217-gnu/drivers/vhost/net.c linux-libre-4.4.218-gnu/drivers/vhost/net.c
--- linux-libre-4.4.217-gnu/drivers/vhost/net.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/drivers/vhost/net.c	2020-04-02 13:02:40.000000000 -0400
@@ -815,11 +815,7 @@ static int vhost_net_release(struct inod
 
 static struct socket *get_raw_socket(int fd)
 {
-	struct {
-		struct sockaddr_ll sa;
-		char  buf[MAX_ADDR_LEN];
-	} uaddr;
-	int uaddr_len = sizeof uaddr, r;
+	int r;
 	struct socket *sock = sockfd_lookup(fd, &r);
 
 	if (!sock)
@@ -831,12 +827,7 @@ static struct socket *get_raw_socket(int
 		goto err;
 	}
 
-	r = sock->ops->getname(sock, (struct sockaddr *)&uaddr.sa,
-			       &uaddr_len, 0);
-	if (r)
-		goto err;
-
-	if (uaddr.sa.sll_family != AF_PACKET) {
+	if (sock->sk->sk_family != AF_PACKET) {
 		r = -EPFNOSUPPORT;
 		goto err;
 	}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/fs/inode.c linux-libre-4.4.218-gnu/fs/inode.c
--- linux-libre-4.4.217-gnu/fs/inode.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/fs/inode.c	2020-04-02 13:02:40.000000000 -0400
@@ -135,6 +135,7 @@ int inode_init_always(struct super_block
 	inode->i_sb = sb;
 	inode->i_blkbits = sb->s_blocksize_bits;
 	inode->i_flags = 0;
+	atomic64_set(&inode->i_sequence, 0);
 	atomic_set(&inode->i_count, 1);
 	inode->i_op = &empty_iops;
 	inode->i_fop = &no_open_fops;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/fs/libfs.c linux-libre-4.4.218-gnu/fs/libfs.c
--- linux-libre-4.4.217-gnu/fs/libfs.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/fs/libfs.c	2020-04-02 13:02:40.000000000 -0400
@@ -761,7 +761,7 @@ int simple_attr_open(struct inode *inode
 {
 	struct simple_attr *attr;
 
-	attr = kmalloc(sizeof(*attr), GFP_KERNEL);
+	attr = kzalloc(sizeof(*attr), GFP_KERNEL);
 	if (!attr)
 		return -ENOMEM;
 
@@ -801,9 +801,11 @@ ssize_t simple_attr_read(struct file *fi
 	if (ret)
 		return ret;
 
-	if (*ppos) {		/* continued read */
+	if (*ppos && attr->get_buf[0]) {
+		/* continued read */
 		size = strlen(attr->get_buf);
-	} else {		/* first read */
+	} else {
+		/* first read */
 		u64 val;
 		ret = attr->get(attr->data, &val);
 		if (ret)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/fs.h linux-libre-4.4.218-gnu/include/linux/fs.h
--- linux-libre-4.4.217-gnu/include/linux/fs.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/fs.h	2020-04-02 13:02:40.000000000 -0400
@@ -658,6 +658,7 @@ struct inode {
 		struct rcu_head		i_rcu;
 	};
 	u64			i_version;
+	atomic64_t		i_sequence; /* see futex */
 	atomic_t		i_count;
 	atomic_t		i_dio_count;
 	atomic_t		i_writecount;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/futex.h linux-libre-4.4.218-gnu/include/linux/futex.h
--- linux-libre-4.4.217-gnu/include/linux/futex.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/futex.h	2020-04-02 13:02:40.000000000 -0400
@@ -34,23 +34,26 @@ handle_futex_death(u32 __user *uaddr, st
 
 union futex_key {
 	struct {
+		u64 i_seq;
 		unsigned long pgoff;
-		struct inode *inode;
-		int offset;
+		unsigned int offset;
 	} shared;
 	struct {
+		union {
+			struct mm_struct *mm;
+			u64 __tmp;
+		};
 		unsigned long address;
-		struct mm_struct *mm;
-		int offset;
+		unsigned int offset;
 	} private;
 	struct {
+		u64 ptr;
 		unsigned long word;
-		void *ptr;
-		int offset;
+		unsigned int offset;
 	} both;
 };
 
-#define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } }
+#define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = 0ULL } }
 
 #ifdef CONFIG_FUTEX
 extern void exit_robust_list(struct task_struct *curr);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/kref.h linux-libre-4.4.218-gnu/include/linux/kref.h
--- linux-libre-4.4.217-gnu/include/linux/kref.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/kref.h	2020-04-02 13:02:40.000000000 -0400
@@ -33,6 +33,11 @@ static inline void kref_init(struct kref
 	atomic_set(&kref->refcount, 1);
 }
 
+static inline int kref_read(const struct kref *kref)
+{
+	return atomic_read(&kref->refcount);
+}
+
 /**
  * kref_get - increment refcount for object.
  * @kref: object.
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/selection.h linux-libre-4.4.218-gnu/include/linux/selection.h
--- linux-libre-4.4.217-gnu/include/linux/selection.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/selection.h	2020-04-02 13:02:40.000000000 -0400
@@ -12,8 +12,8 @@
 
 struct tty_struct;
 
-extern struct vc_data *sel_cons;
 struct tty_struct;
+struct vc_data;
 
 extern void clear_selection(void);
 extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty);
@@ -22,6 +22,8 @@ extern int sel_loadlut(char __user *p);
 extern int mouse_reporting(void);
 extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry);
 
+bool vc_is_sel(struct vc_data *vc);
+
 extern int console_blanked;
 
 extern unsigned char color_table[];
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/vmalloc.h linux-libre-4.4.218-gnu/include/linux/vmalloc.h
--- linux-libre-4.4.217-gnu/include/linux/vmalloc.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/vmalloc.h	2020-04-02 13:02:40.000000000 -0400
@@ -92,8 +92,9 @@ extern int remap_vmalloc_range_partial(s
 
 extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
 							unsigned long pgoff);
-void vmalloc_sync_all(void);
- 
+void vmalloc_sync_mappings(void);
+void vmalloc_sync_unmappings(void);
+
 /*
  *	Lowlevel-APIs (not for driver use!)
  */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/linux/vt_kern.h linux-libre-4.4.218-gnu/include/linux/vt_kern.h
--- linux-libre-4.4.217-gnu/include/linux/vt_kern.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/linux/vt_kern.h	2020-04-02 13:02:40.000000000 -0400
@@ -142,7 +142,7 @@ static inline bool vt_force_oops_output(
 	return false;
 }
 
-extern char vt_dont_switch;
+extern bool vt_dont_switch;
 extern int default_utf8;
 extern int global_cursor_default;
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/include/uapi/linux/if.h linux-libre-4.4.218-gnu/include/uapi/linux/if.h
--- linux-libre-4.4.217-gnu/include/uapi/linux/if.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/include/uapi/linux/if.h	2020-04-02 13:02:40.000000000 -0400
@@ -31,7 +31,7 @@
 #include <linux/hdlc/ioctl.h>
 
 /* For glibc compatibility. An empty enum does not compile. */
-#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && \
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \
     __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
 /**
  * enum net_device_flags - &struct net_device flags
@@ -99,7 +99,7 @@ enum net_device_flags {
 	IFF_ECHO			= 1<<18, /* volatile */
 #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
 };
-#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
 
 /* for compatibility with glibc net/if.h */
 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS
diff -druNp --no-dereference linux-libre-4.4.217-gnu/kernel/bpf/syscall.c linux-libre-4.4.218-gnu/kernel/bpf/syscall.c
--- linux-libre-4.4.217-gnu/kernel/bpf/syscall.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/kernel/bpf/syscall.c	2020-04-02 13:02:40.000000000 -0400
@@ -667,7 +667,7 @@ static int bpf_obj_get(const union bpf_a
 
 SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
 {
-	union bpf_attr attr = {};
+	union bpf_attr attr;
 	int err;
 
 	if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN))
@@ -703,6 +703,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf
 	}
 
 	/* copy attributes from user space, may be less than sizeof(bpf_attr) */
+	memset(&attr, 0, sizeof(attr));
 	if (copy_from_user(&attr, uattr, size) != 0)
 		return -EFAULT;
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/kernel/futex.c linux-libre-4.4.218-gnu/kernel/futex.c
--- linux-libre-4.4.217-gnu/kernel/futex.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/kernel/futex.c	2020-04-02 13:02:40.000000000 -0400
@@ -378,9 +378,9 @@ static inline int hb_waiters_pending(str
  */
 static struct futex_hash_bucket *hash_futex(union futex_key *key)
 {
-	u32 hash = jhash2((u32*)&key->both.word,
-			  (sizeof(key->both.word)+sizeof(key->both.ptr))/4,
+	u32 hash = jhash2((u32 *)key, offsetof(typeof(*key), both.offset) / 4,
 			  key->both.offset);
+
 	return &futex_queues[hash & (futex_hashsize - 1)];
 }
 
@@ -407,7 +407,7 @@ static void get_futex_key_refs(union fut
 
 	switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
 	case FUT_OFF_INODE:
-		ihold(key->shared.inode); /* implies MB (B) */
+		smp_mb();		/* explicit smp_mb(); (B) */
 		break;
 	case FUT_OFF_MMSHARED:
 		futex_get_mm(key); /* implies MB (B) */
@@ -438,7 +438,6 @@ static void drop_futex_key_refs(union fu
 
 	switch (key->both.offset & (FUT_OFF_INODE|FUT_OFF_MMSHARED)) {
 	case FUT_OFF_INODE:
-		iput(key->shared.inode);
 		break;
 	case FUT_OFF_MMSHARED:
 		mmdrop(key->private.mm);
@@ -446,6 +445,46 @@ static void drop_futex_key_refs(union fu
 	}
 }
 
+/*
+ * Generate a machine wide unique identifier for this inode.
+ *
+ * This relies on u64 not wrapping in the life-time of the machine; which with
+ * 1ns resolution means almost 585 years.
+ *
+ * This further relies on the fact that a well formed program will not unmap
+ * the file while it has a (shared) futex waiting on it. This mapping will have
+ * a file reference which pins the mount and inode.
+ *
+ * If for some reason an inode gets evicted and read back in again, it will get
+ * a new sequence number and will _NOT_ match, even though it is the exact same
+ * file.
+ *
+ * It is important that match_futex() will never have a false-positive, esp.
+ * for PI futexes that can mess up the state. The above argues that false-negatives
+ * are only possible for malformed programs.
+ */
+static u64 get_inode_sequence_number(struct inode *inode)
+{
+	static atomic64_t i_seq;
+	u64 old;
+
+	/* Does the inode already have a sequence number? */
+	old = atomic64_read(&inode->i_sequence);
+	if (likely(old))
+		return old;
+
+	for (;;) {
+		u64 new = atomic64_add_return(1, &i_seq);
+		if (WARN_ON_ONCE(!new))
+			continue;
+
+		old = atomic64_cmpxchg_relaxed(&inode->i_sequence, 0, new);
+		if (old)
+			return old;
+		return new;
+	}
+}
+
 /**
  * get_futex_key() - Get parameters which are the keys for a futex
  * @uaddr:	virtual address of the futex
@@ -458,9 +497,15 @@ static void drop_futex_key_refs(union fu
  *
  * The key words are stored in *key on success.
  *
- * For shared mappings, it's (page->index, file_inode(vma->vm_file),
- * offset_within_page).  For private mappings, it's (uaddr, current->mm).
- * We can usually work out the index without swapping in the page.
+ * For shared mappings (when @fshared), the key is:
+ *   ( inode->i_sequence, page->index, offset_within_page )
+ * [ also see get_inode_sequence_number() ]
+ *
+ * For private mappings (or when !@fshared), the key is:
+ *   ( current->mm, address, 0 )
+ *
+ * This allows (cross process, where applicable) identification of the futex
+ * without keeping the page pinned for the duration of the FUTEX_WAIT.
  *
  * lock_page() might sleep, the caller should not hold a spinlock.
  */
@@ -628,8 +673,6 @@ again:
 		key->private.mm = mm;
 		key->private.address = address;
 
-		get_futex_key_refs(key); /* implies smp_mb(); (B) */
-
 	} else {
 		struct inode *inode;
 
@@ -661,40 +704,14 @@ again:
 			goto again;
 		}
 
-		/*
-		 * Take a reference unless it is about to be freed. Previously
-		 * this reference was taken by ihold under the page lock
-		 * pinning the inode in place so i_lock was unnecessary. The
-		 * only way for this check to fail is if the inode was
-		 * truncated in parallel which is almost certainly an
-		 * application bug. In such a case, just retry.
-		 *
-		 * We are not calling into get_futex_key_refs() in file-backed
-		 * cases, therefore a successful atomic_inc return below will
-		 * guarantee that get_futex_key() will still imply smp_mb(); (B).
-		 */
-		if (!atomic_inc_not_zero(&inode->i_count)) {
-			rcu_read_unlock();
-			put_page(page_head);
-
-			goto again;
-		}
-
-		/* Should be impossible but lets be paranoid for now */
-		if (WARN_ON_ONCE(inode->i_mapping != mapping)) {
-			err = -EFAULT;
-			rcu_read_unlock();
-			iput(inode);
-
-			goto out;
-		}
-
 		key->both.offset |= FUT_OFF_INODE; /* inode-based key */
-		key->shared.inode = inode;
+		key->shared.i_seq = get_inode_sequence_number(inode);
 		key->shared.pgoff = basepage_index(page);
 		rcu_read_unlock();
 	}
 
+	get_futex_key_refs(key); /* implies smp_mb(); (B) */
+
 out:
 	put_page(page_head);
 	return err;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/kernel/irq/manage.c linux-libre-4.4.218-gnu/kernel/irq/manage.c
--- linux-libre-4.4.217-gnu/kernel/irq/manage.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/kernel/irq/manage.c	2020-04-02 13:02:40.000000000 -0400
@@ -220,7 +220,11 @@ int irq_set_affinity_locked(struct irq_d
 
 	if (desc->affinity_notify) {
 		kref_get(&desc->affinity_notify->kref);
-		schedule_work(&desc->affinity_notify->work);
+		if (!schedule_work(&desc->affinity_notify->work)) {
+			/* Work was already scheduled, drop our extra ref */
+			kref_put(&desc->affinity_notify->kref,
+				 desc->affinity_notify->release);
+		}
 	}
 	irqd_set(data, IRQD_AFFINITY_SET);
 
@@ -320,7 +324,10 @@ irq_set_affinity_notifier(unsigned int i
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	if (old_notify) {
-		cancel_work_sync(&old_notify->work);
+		if (cancel_work_sync(&old_notify->work)) {
+			/* Pending work had a ref, put that one too */
+			kref_put(&old_notify->kref, old_notify->release);
+		}
 		kref_put(&old_notify->kref, old_notify->release);
 	}
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/kernel/notifier.c linux-libre-4.4.218-gnu/kernel/notifier.c
--- linux-libre-4.4.217-gnu/kernel/notifier.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/kernel/notifier.c	2020-04-02 13:02:40.000000000 -0400
@@ -552,7 +552,7 @@ NOKPROBE_SYMBOL(notify_die);
 
 int register_die_notifier(struct notifier_block *nb)
 {
-	vmalloc_sync_all();
+	vmalloc_sync_mappings();
 	return atomic_notifier_chain_register(&die_chain, nb);
 }
 EXPORT_SYMBOL_GPL(register_die_notifier);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/Makefile linux-libre-4.4.218-gnu/Makefile
--- linux-libre-4.4.217-gnu/Makefile	2020-03-20 06:32:10.000000000 -0400
+++ linux-libre-4.4.218-gnu/Makefile	2020-04-02 23:23:09.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 217
+SUBLEVEL = 218
 EXTRAVERSION = -gnu
 NAME = Blurry Fish Butt
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/mm/memcontrol.c linux-libre-4.4.218-gnu/mm/memcontrol.c
--- linux-libre-4.4.217-gnu/mm/memcontrol.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/mm/memcontrol.c	2020-04-02 13:02:40.000000000 -0400
@@ -3480,7 +3480,7 @@ static void __mem_cgroup_usage_unregiste
 	struct mem_cgroup_thresholds *thresholds;
 	struct mem_cgroup_threshold_ary *new;
 	unsigned long usage;
-	int i, j, size;
+	int i, j, size, entries;
 
 	mutex_lock(&memcg->thresholds_lock);
 
@@ -3500,14 +3500,20 @@ static void __mem_cgroup_usage_unregiste
 	__mem_cgroup_threshold(memcg, type == _MEMSWAP);
 
 	/* Calculate new number of threshold */
-	size = 0;
+	size = entries = 0;
 	for (i = 0; i < thresholds->primary->size; i++) {
 		if (thresholds->primary->entries[i].eventfd != eventfd)
 			size++;
+		else
+			entries++;
 	}
 
 	new = thresholds->spare;
 
+	/* If no items related to eventfd have been cleared, nothing to do */
+	if (!entries)
+		goto unlock;
+
 	/* Set thresholds array to NULL if we don't have thresholds */
 	if (!size) {
 		kfree(new);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/mm/nommu.c linux-libre-4.4.218-gnu/mm/nommu.c
--- linux-libre-4.4.217-gnu/mm/nommu.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/mm/nommu.c	2020-04-02 13:02:40.000000000 -0400
@@ -472,10 +472,14 @@ void vm_unmap_aliases(void)
 EXPORT_SYMBOL_GPL(vm_unmap_aliases);
 
 /*
- * Implement a stub for vmalloc_sync_all() if the architecture chose not to
- * have one.
+ * Implement a stub for vmalloc_sync_[un]mapping() if the architecture
+ * chose not to have one.
  */
-void __weak vmalloc_sync_all(void)
+void __weak vmalloc_sync_mappings(void)
+{
+}
+
+void __weak vmalloc_sync_unmappings(void)
 {
 }
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/mm/slub.c linux-libre-4.4.218-gnu/mm/slub.c
--- linux-libre-4.4.217-gnu/mm/slub.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/mm/slub.c	2020-04-02 13:02:40.000000000 -0400
@@ -1777,8 +1777,6 @@ static void *get_partial(struct kmem_cac
 
 	if (node == NUMA_NO_NODE)
 		searchnode = numa_mem_id();
-	else if (!node_present_pages(node))
-		searchnode = node_to_mem_node(node);
 
 	object = get_partial_node(s, get_node(s, searchnode), c, flags);
 	if (object || node != NUMA_NO_NODE)
@@ -2355,17 +2353,27 @@ static void *___slab_alloc(struct kmem_c
 	struct page *page;
 
 	page = c->page;
-	if (!page)
+	if (!page) {
+		/*
+		 * if the node is not online or has no normal memory, just
+		 * ignore the node constraint
+		 */
+		if (unlikely(node != NUMA_NO_NODE &&
+			     !node_state(node, N_NORMAL_MEMORY)))
+			node = NUMA_NO_NODE;
 		goto new_slab;
+	}
 redo:
 
 	if (unlikely(!node_match(page, node))) {
-		int searchnode = node;
-
-		if (node != NUMA_NO_NODE && !node_present_pages(node))
-			searchnode = node_to_mem_node(node);
-
-		if (unlikely(!node_match(page, searchnode))) {
+		/*
+		 * same as above but node_match() being false already
+		 * implies node != NUMA_NO_NODE
+		 */
+		if (!node_state(node, N_NORMAL_MEMORY)) {
+			node = NUMA_NO_NODE;
+			goto redo;
+		} else {
 			stat(s, ALLOC_NODE_MISMATCH);
 			deactivate_slab(s, page, c->freelist);
 			c->page = NULL;
@@ -2788,11 +2796,13 @@ redo:
 	barrier();
 
 	if (likely(page == c->page)) {
-		set_freepointer(s, tail_obj, c->freelist);
+		void **freelist = READ_ONCE(c->freelist);
+
+		set_freepointer(s, tail_obj, freelist);
 
 		if (unlikely(!this_cpu_cmpxchg_double(
 				s->cpu_slab->freelist, s->cpu_slab->tid,
-				c->freelist, tid,
+				freelist, tid,
 				head, next_tid(tid)))) {
 
 			note_cmpxchg_failure("slab_free", s, tid);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/mm/vmalloc.c linux-libre-4.4.218-gnu/mm/vmalloc.c
--- linux-libre-4.4.217-gnu/mm/vmalloc.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/mm/vmalloc.c	2020-04-02 13:02:40.000000000 -0400
@@ -1681,7 +1681,7 @@ void *__vmalloc_node_range(unsigned long
 	 * First make sure the mappings are removed from all page-tables
 	 * before they are freed.
 	 */
-	vmalloc_sync_all();
+	vmalloc_sync_unmappings();
 
 	/*
 	 * In this function, newly allocated vm_struct has VM_UNINITIALIZED
@@ -2218,16 +2218,19 @@ int remap_vmalloc_range(struct vm_area_s
 EXPORT_SYMBOL(remap_vmalloc_range);
 
 /*
- * Implement a stub for vmalloc_sync_all() if the architecture chose not to
- * have one.
+ * Implement stubs for vmalloc_sync_[un]mappings () if the architecture chose
+ * not to have one.
  *
  * The purpose of this function is to make sure the vmalloc area
  * mappings are identical in all page-tables in the system.
  */
-void __weak vmalloc_sync_all(void)
+void __weak vmalloc_sync_mappings(void)
 {
 }
 
+void __weak vmalloc_sync_unmappings(void)
+{
+}
 
 static int f(pte_t *pte, pgtable_t table, unsigned long addr, void *data)
 {
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/dsa/tag_brcm.c linux-libre-4.4.218-gnu/net/dsa/tag_brcm.c
--- linux-libre-4.4.217-gnu/net/dsa/tag_brcm.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/dsa/tag_brcm.c	2020-04-02 13:02:40.000000000 -0400
@@ -84,6 +84,8 @@ static struct sk_buff *brcm_tag_xmit(str
 		brcm_tag[2] = BRCM_IG_DSTMAP2_MASK;
 	brcm_tag[3] = (1 << p->port) & BRCM_IG_DSTMAP1_MASK;
 
+	skb->offload_fwd_mark = 1;
+
 	return skb;
 
 out_free:
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/hsr/hsr_framereg.c linux-libre-4.4.218-gnu/net/hsr/hsr_framereg.c
--- linux-libre-4.4.217-gnu/net/hsr/hsr_framereg.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/hsr/hsr_framereg.c	2020-04-02 13:02:40.000000000 -0400
@@ -455,13 +455,9 @@ int hsr_get_node_data(struct hsr_priv *h
 	struct hsr_port *port;
 	unsigned long tdiff;
 
-
-	rcu_read_lock();
 	node = find_node_by_AddrA(&hsr->node_db, addr);
-	if (!node) {
-		rcu_read_unlock();
-		return -ENOENT;	/* No such entry */
-	}
+	if (!node)
+		return -ENOENT;
 
 	ether_addr_copy(addr_b, node->MacAddressB);
 
@@ -496,7 +492,5 @@ int hsr_get_node_data(struct hsr_priv *h
 		*addr_b_ifindex = -1;
 	}
 
-	rcu_read_unlock();
-
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/hsr/hsr_netlink.c linux-libre-4.4.218-gnu/net/hsr/hsr_netlink.c
--- linux-libre-4.4.217-gnu/net/hsr/hsr_netlink.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/hsr/hsr_netlink.c	2020-04-02 13:02:40.000000000 -0400
@@ -132,6 +132,7 @@ static struct genl_family hsr_genl_famil
 	.name = "HSR",
 	.version = 1,
 	.maxattr = HSR_A_MAX,
+	.netnsok = true,
 };
 
 static const struct genl_multicast_group hsr_mcgrps[] = {
@@ -259,17 +260,16 @@ static int hsr_get_node_status(struct sk
 	if (!na)
 		goto invalid;
 
-	hsr_dev = __dev_get_by_index(genl_info_net(info),
-					nla_get_u32(info->attrs[HSR_A_IFINDEX]));
+	rcu_read_lock();
+	hsr_dev = dev_get_by_index_rcu(genl_info_net(info),
+				       nla_get_u32(info->attrs[HSR_A_IFINDEX]));
 	if (!hsr_dev)
-		goto invalid;
+		goto rcu_unlock;
 	if (!is_hsr_master(hsr_dev))
-		goto invalid;
-
+		goto rcu_unlock;
 
 	/* Send reply */
-
-	skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
+	skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
 	if (!skb_out) {
 		res = -ENOMEM;
 		goto fail;
@@ -321,12 +321,10 @@ static int hsr_get_node_status(struct sk
 	res = nla_put_u16(skb_out, HSR_A_IF1_SEQ, hsr_node_if1_seq);
 	if (res < 0)
 		goto nla_put_failure;
-	rcu_read_lock();
 	port = hsr_port_get_hsr(hsr, HSR_PT_SLAVE_A);
 	if (port)
 		res = nla_put_u32(skb_out, HSR_A_IF1_IFINDEX,
 				  port->dev->ifindex);
-	rcu_read_unlock();
 	if (res < 0)
 		goto nla_put_failure;
 
@@ -336,20 +334,22 @@ static int hsr_get_node_status(struct sk
 	res = nla_put_u16(skb_out, HSR_A_IF2_SEQ, hsr_node_if2_seq);
 	if (res < 0)
 		goto nla_put_failure;
-	rcu_read_lock();
 	port = hsr_port_get_hsr(hsr, HSR_PT_SLAVE_B);
 	if (port)
 		res = nla_put_u32(skb_out, HSR_A_IF2_IFINDEX,
 				  port->dev->ifindex);
-	rcu_read_unlock();
 	if (res < 0)
 		goto nla_put_failure;
 
+	rcu_read_unlock();
+
 	genlmsg_end(skb_out, msg_head);
 	genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid);
 
 	return 0;
 
+rcu_unlock:
+	rcu_read_unlock();
 invalid:
 	netlink_ack(skb_in, nlmsg_hdr(skb_in), -EINVAL);
 	return 0;
@@ -359,6 +359,7 @@ nla_put_failure:
 	/* Fall through */
 
 fail:
+	rcu_read_unlock();
 	return res;
 }
 
@@ -366,16 +367,14 @@ fail:
  */
 static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
 {
-	/* For receiving */
-	struct nlattr *na;
+	unsigned char addr[ETH_ALEN];
 	struct net_device *hsr_dev;
-
-	/* For sending */
 	struct sk_buff *skb_out;
-	void *msg_head;
 	struct hsr_priv *hsr;
-	void *pos;
-	unsigned char addr[ETH_ALEN];
+	bool restart = false;
+	struct nlattr *na;
+	void *pos = NULL;
+	void *msg_head;
 	int res;
 
 	if (!info)
@@ -385,17 +384,17 @@ static int hsr_get_node_list(struct sk_b
 	if (!na)
 		goto invalid;
 
-	hsr_dev = __dev_get_by_index(genl_info_net(info),
-				     nla_get_u32(info->attrs[HSR_A_IFINDEX]));
+	rcu_read_lock();
+	hsr_dev = dev_get_by_index_rcu(genl_info_net(info),
+				       nla_get_u32(info->attrs[HSR_A_IFINDEX]));
 	if (!hsr_dev)
-		goto invalid;
+		goto rcu_unlock;
 	if (!is_hsr_master(hsr_dev))
-		goto invalid;
-
+		goto rcu_unlock;
 
+restart:
 	/* Send reply */
-
-	skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
+	skb_out = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_ATOMIC);
 	if (!skb_out) {
 		res = -ENOMEM;
 		goto fail;
@@ -409,18 +408,26 @@ static int hsr_get_node_list(struct sk_b
 		goto nla_put_failure;
 	}
 
-	res = nla_put_u32(skb_out, HSR_A_IFINDEX, hsr_dev->ifindex);
-	if (res < 0)
-		goto nla_put_failure;
+	if (!restart) {
+		res = nla_put_u32(skb_out, HSR_A_IFINDEX, hsr_dev->ifindex);
+		if (res < 0)
+			goto nla_put_failure;
+	}
 
 	hsr = netdev_priv(hsr_dev);
 
-	rcu_read_lock();
-	pos = hsr_get_next_node(hsr, NULL, addr);
+	if (!pos)
+		pos = hsr_get_next_node(hsr, NULL, addr);
 	while (pos) {
 		res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, addr);
 		if (res < 0) {
-			rcu_read_unlock();
+			if (res == -EMSGSIZE) {
+				genlmsg_end(skb_out, msg_head);
+				genlmsg_unicast(genl_info_net(info), skb_out,
+						info->snd_portid);
+				restart = true;
+				goto restart;
+			}
 			goto nla_put_failure;
 		}
 		pos = hsr_get_next_node(hsr, pos, addr);
@@ -432,15 +439,18 @@ static int hsr_get_node_list(struct sk_b
 
 	return 0;
 
+rcu_unlock:
+	rcu_read_unlock();
 invalid:
 	netlink_ack(skb_in, nlmsg_hdr(skb_in), -EINVAL);
 	return 0;
 
 nla_put_failure:
-	kfree_skb(skb_out);
+	nlmsg_free(skb_out);
 	/* Fall through */
 
 fail:
+	rcu_read_unlock();
 	return res;
 }
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/hsr/hsr_slave.c linux-libre-4.4.218-gnu/net/hsr/hsr_slave.c
--- linux-libre-4.4.217-gnu/net/hsr/hsr_slave.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/hsr/hsr_slave.c	2020-04-02 13:02:40.000000000 -0400
@@ -149,16 +149,16 @@ int hsr_add_port(struct hsr_priv *hsr, s
 	if (port == NULL)
 		return -ENOMEM;
 
+	port->hsr = hsr;
+	port->dev = dev;
+	port->type = type;
+
 	if (type != HSR_PT_MASTER) {
 		res = hsr_portdev_setup(dev, port);
 		if (res)
 			goto fail_dev_setup;
 	}
 
-	port->hsr = hsr;
-	port->dev = dev;
-	port->type = type;
-
 	list_add_tail_rcu(&port->port_list, &hsr->ports);
 	synchronize_rcu();
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/ipv4/ip_vti.c linux-libre-4.4.218-gnu/net/ipv4/ip_vti.c
--- linux-libre-4.4.217-gnu/net/ipv4/ip_vti.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/ipv4/ip_vti.c	2020-04-02 13:02:40.000000000 -0400
@@ -195,17 +195,39 @@ static netdev_tx_t vti_xmit(struct sk_bu
 	int err;
 
 	if (!dst) {
-		struct rtable *rt;
+		switch (skb->protocol) {
+		case htons(ETH_P_IP): {
+			struct rtable *rt;
 
-		fl->u.ip4.flowi4_oif = dev->ifindex;
-		fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
-		rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4);
-		if (IS_ERR(rt)) {
+			fl->u.ip4.flowi4_oif = dev->ifindex;
+			fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
+			rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4);
+			if (IS_ERR(rt)) {
+				dev->stats.tx_carrier_errors++;
+				goto tx_error_icmp;
+			}
+			dst = &rt->dst;
+			skb_dst_set(skb, dst);
+			break;
+		}
+#if IS_ENABLED(CONFIG_IPV6)
+		case htons(ETH_P_IPV6):
+			fl->u.ip6.flowi6_oif = dev->ifindex;
+			fl->u.ip6.flowi6_flags |= FLOWI_FLAG_ANYSRC;
+			dst = ip6_route_output(dev_net(dev), NULL, &fl->u.ip6);
+			if (dst->error) {
+				dst_release(dst);
+				dst = NULL;
+				dev->stats.tx_carrier_errors++;
+				goto tx_error_icmp;
+			}
+			skb_dst_set(skb, dst);
+			break;
+#endif
+		default:
 			dev->stats.tx_carrier_errors++;
 			goto tx_error_icmp;
 		}
-		dst = &rt->dst;
-		skb_dst_set(skb, dst);
 	}
 
 	dst_hold(dst);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/ipv4/Kconfig linux-libre-4.4.218-gnu/net/ipv4/Kconfig
--- linux-libre-4.4.217-gnu/net/ipv4/Kconfig	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/ipv4/Kconfig	2020-04-02 13:02:40.000000000 -0400
@@ -298,6 +298,7 @@ config SYN_COOKIES
 
 config NET_IPVTI
 	tristate "Virtual (secure) IP: tunneling"
+	depends on IPV6 || IPV6=n
 	select INET_TUNNEL
 	select NET_IP_TUNNEL
 	depends on INET_XFRM_MODE_TUNNEL
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/ipv4/route.c linux-libre-4.4.218-gnu/net/ipv4/route.c
--- linux-libre-4.4.217-gnu/net/ipv4/route.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/ipv4/route.c	2020-04-02 13:02:40.000000000 -0400
@@ -985,21 +985,22 @@ out:	kfree_skb(skb);
 static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
 {
 	struct dst_entry *dst = &rt->dst;
+	u32 old_mtu = ipv4_mtu(dst);
 	struct fib_result res;
 	bool lock = false;
 
 	if (ip_mtu_locked(dst))
 		return;
 
-	if (ipv4_mtu(dst) < mtu)
+	if (old_mtu < mtu)
 		return;
 
 	if (mtu < ip_rt_min_pmtu) {
 		lock = true;
-		mtu = ip_rt_min_pmtu;
+		mtu = min(old_mtu, ip_rt_min_pmtu);
 	}
 
-	if (rt->rt_pmtu == mtu &&
+	if (rt->rt_pmtu == mtu && !lock &&
 	    time_before(jiffies, dst->expires - ip_rt_mtu_expires / 2))
 		return;
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/ipv6/ip6_vti.c linux-libre-4.4.218-gnu/net/ipv6/ip6_vti.c
--- linux-libre-4.4.217-gnu/net/ipv6/ip6_vti.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/ipv6/ip6_vti.c	2020-04-02 13:02:40.000000000 -0400
@@ -315,7 +315,7 @@ static int vti6_rcv(struct sk_buff *skb)
 
 		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
 			rcu_read_unlock();
-			return 0;
+			goto discard;
 		}
 
 		if (!ip6_tnl_rcv_ctl(t, &ipv6h->daddr, &ipv6h->saddr)) {
@@ -442,15 +442,33 @@ vti6_xmit(struct sk_buff *skb, struct ne
 	int mtu;
 
 	if (!dst) {
-		fl->u.ip6.flowi6_oif = dev->ifindex;
-		fl->u.ip6.flowi6_flags |= FLOWI_FLAG_ANYSRC;
-		dst = ip6_route_output(dev_net(dev), NULL, &fl->u.ip6);
-		if (dst->error) {
-			dst_release(dst);
-			dst = NULL;
+		switch (skb->protocol) {
+		case htons(ETH_P_IP): {
+			struct rtable *rt;
+
+			fl->u.ip4.flowi4_oif = dev->ifindex;
+			fl->u.ip4.flowi4_flags |= FLOWI_FLAG_ANYSRC;
+			rt = __ip_route_output_key(dev_net(dev), &fl->u.ip4);
+			if (IS_ERR(rt))
+				goto tx_err_link_failure;
+			dst = &rt->dst;
+			skb_dst_set(skb, dst);
+			break;
+		}
+		case htons(ETH_P_IPV6):
+			fl->u.ip6.flowi6_oif = dev->ifindex;
+			fl->u.ip6.flowi6_flags |= FLOWI_FLAG_ANYSRC;
+			dst = ip6_route_output(dev_net(dev), NULL, &fl->u.ip6);
+			if (dst->error) {
+				dst_release(dst);
+				dst = NULL;
+				goto tx_err_link_failure;
+			}
+			skb_dst_set(skb, dst);
+			break;
+		default:
 			goto tx_err_link_failure;
 		}
-		skb_dst_set(skb, dst);
 	}
 
 	dst_hold(dst);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/mac80211/mesh_hwmp.c linux-libre-4.4.218-gnu/net/mac80211/mesh_hwmp.c
--- linux-libre-4.4.217-gnu/net/mac80211/mesh_hwmp.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/mac80211/mesh_hwmp.c	2020-04-02 13:02:40.000000000 -0400
@@ -1112,7 +1112,8 @@ int mesh_nexthop_resolve(struct ieee8021
 		}
 	}
 
-	if (!(mpath->flags & MESH_PATH_RESOLVING))
+	if (!(mpath->flags & MESH_PATH_RESOLVING) &&
+	    mesh_path_sel_is_hwmp(sdata))
 		mesh_queue_preq(mpath, PREQ_Q_F_START);
 
 	if (skb_queue_len(&mpath->frame_queue) >= MESH_FRAME_QUEUE_LEN)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/mac80211/sta_info.c linux-libre-4.4.218-gnu/net/mac80211/sta_info.c
--- linux-libre-4.4.217-gnu/net/mac80211/sta_info.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/mac80211/sta_info.c	2020-04-02 13:02:40.000000000 -0400
@@ -2,6 +2,7 @@
  * Copyright 2002-2005, Instant802 Networks, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
+ * Copyright (C) 2018-2020 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -904,6 +905,11 @@ static void __sta_info_destroy_part2(str
 	might_sleep();
 	lockdep_assert_held(&local->sta_mtx);
 
+	while (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
+		ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
+		WARN_ON_ONCE(ret);
+	}
+
 	/* now keys can no longer be reached */
 	ieee80211_free_sta_keys(local, sta);
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/sched/cls_route.c linux-libre-4.4.218-gnu/net/sched/cls_route.c
--- linux-libre-4.4.217-gnu/net/sched/cls_route.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/sched/cls_route.c	2020-04-02 13:02:40.000000000 -0400
@@ -540,8 +540,8 @@ static int route4_change(struct net *net
 			fp = &b->ht[h];
 			for (pfp = rtnl_dereference(*fp); pfp;
 			     fp = &pfp->next, pfp = rtnl_dereference(*fp)) {
-				if (pfp == f) {
-					*fp = f->next;
+				if (pfp == fold) {
+					rcu_assign_pointer(*fp, fold->next);
 					break;
 				}
 			}
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/sched/cls_tcindex.c linux-libre-4.4.218-gnu/net/sched/cls_tcindex.c
--- linux-libre-4.4.217-gnu/net/sched/cls_tcindex.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/sched/cls_tcindex.c	2020-04-02 13:02:40.000000000 -0400
@@ -293,6 +293,7 @@ tcindex_set_parms(struct net *net, struc
 				      sizeof(*r) * cp->hash, GFP_KERNEL);
 		if (!cp->perfect)
 			goto errout;
+		cp->alloc_hash = cp->hash;
 		for (i = 0; i < min(cp->hash, p->hash); i++)
 			tcf_exts_init(&cp->perfect[i].exts,
 				      TCA_TCINDEX_ACT, TCA_TCINDEX_POLICE);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/xfrm/xfrm_policy.c linux-libre-4.4.218-gnu/net/xfrm/xfrm_policy.c
--- linux-libre-4.4.217-gnu/net/xfrm/xfrm_policy.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/xfrm/xfrm_policy.c	2020-04-02 13:02:40.000000000 -0400
@@ -330,7 +330,9 @@ EXPORT_SYMBOL(xfrm_policy_destroy);
 
 static void xfrm_policy_kill(struct xfrm_policy *policy)
 {
+	write_lock_bh(&policy->lock);
 	policy->walk.dead = 1;
+	write_unlock_bh(&policy->lock);
 
 	atomic_inc(&policy->genid);
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/net/xfrm/xfrm_user.c linux-libre-4.4.218-gnu/net/xfrm/xfrm_user.c
--- linux-libre-4.4.217-gnu/net/xfrm/xfrm_user.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/net/xfrm/xfrm_user.c	2020-04-02 13:02:40.000000000 -0400
@@ -109,7 +109,8 @@ static inline int verify_sec_ctx_len(str
 		return 0;
 
 	uctx = nla_data(rt);
-	if (uctx->len != (sizeof(struct xfrm_user_sec_ctx) + uctx->ctx_len))
+	if (uctx->len > nla_len(rt) ||
+	    uctx->len != (sizeof(struct xfrm_user_sec_ctx) + uctx->ctx_len))
 		return -EINVAL;
 
 	return 0;
@@ -2174,6 +2175,9 @@ static int xfrm_add_acquire(struct sk_bu
 
 	err = verify_newpolicy_info(&ua->policy);
 	if (err)
+		goto free_state;
+	err = verify_sec_ctx_len(attrs);
+	if (err)
 		goto bad_policy;
 
 	/*   build an XP */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/scripts/dtc/dtc-lexer.l linux-libre-4.4.218-gnu/scripts/dtc/dtc-lexer.l
--- linux-libre-4.4.217-gnu/scripts/dtc/dtc-lexer.l	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/scripts/dtc/dtc-lexer.l	2020-04-02 13:02:40.000000000 -0400
@@ -38,7 +38,6 @@ LINECOMMENT	"//".*\n
 #include "srcpos.h"
 #include "dtc-parser.tab.h"
 
-YYLTYPE yylloc;
 extern bool treesource_error;
 
 /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/scripts/dtc/dtc-lexer.lex.c_shipped linux-libre-4.4.218-gnu/scripts/dtc/dtc-lexer.lex.c_shipped
--- linux-libre-4.4.217-gnu/scripts/dtc/dtc-lexer.lex.c_shipped	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/scripts/dtc/dtc-lexer.lex.c_shipped	2020-04-02 13:02:40.000000000 -0400
@@ -637,7 +637,6 @@ char *yytext;
 #include "srcpos.h"
 #include "dtc-parser.tab.h"
 
-YYLTYPE yylloc;
 extern bool treesource_error;
 
 /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
diff -druNp --no-dereference linux-libre-4.4.217-gnu/scripts/Makefile.extrawarn linux-libre-4.4.218-gnu/scripts/Makefile.extrawarn
--- linux-libre-4.4.217-gnu/scripts/Makefile.extrawarn	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/scripts/Makefile.extrawarn	2020-04-02 13:02:40.000000000 -0400
@@ -67,5 +67,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni
 KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
 KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
+KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
 endif
 endif
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/core/oss/pcm_plugin.c linux-libre-4.4.218-gnu/sound/core/oss/pcm_plugin.c
--- linux-libre-4.4.217-gnu/sound/core/oss/pcm_plugin.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/core/oss/pcm_plugin.c	2020-04-02 13:02:40.000000000 -0400
@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_su
 		while (plugin->next) {
 			if (plugin->dst_frames)
 				frames = plugin->dst_frames(plugin, frames);
-			if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
+			if ((snd_pcm_sframes_t)frames <= 0)
 				return -ENXIO;
 			plugin = plugin->next;
 			err = snd_pcm_plugin_alloc(plugin, frames);
@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_su
 		while (plugin->prev) {
 			if (plugin->src_frames)
 				frames = plugin->src_frames(plugin, frames);
-			if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0))
+			if ((snd_pcm_sframes_t)frames <= 0)
 				return -ENXIO;
 			plugin = plugin->prev;
 			err = snd_pcm_plugin_alloc(plugin, frames);
@@ -209,6 +209,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_si
 	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
 		plugin = snd_pcm_plug_last(plug);
 		while (plugin && drv_frames > 0) {
+			if (drv_frames > plugin->buf_frames)
+				drv_frames = plugin->buf_frames;
 			plugin_prev = plugin->prev;
 			if (plugin->src_frames)
 				drv_frames = plugin->src_frames(plugin, drv_frames);
@@ -220,6 +222,8 @@ snd_pcm_sframes_t snd_pcm_plug_client_si
 			plugin_next = plugin->next;
 			if (plugin->dst_frames)
 				drv_frames = plugin->dst_frames(plugin, drv_frames);
+			if (drv_frames > plugin->buf_frames)
+				drv_frames = plugin->buf_frames;
 			plugin = plugin_next;
 		}
 	} else
@@ -248,11 +252,15 @@ snd_pcm_sframes_t snd_pcm_plug_slave_siz
 				if (frames < 0)
 					return frames;
 			}
+			if (frames > plugin->buf_frames)
+				frames = plugin->buf_frames;
 			plugin = plugin_next;
 		}
 	} else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
 		plugin = snd_pcm_plug_last(plug);
 		while (plugin) {
+			if (frames > plugin->buf_frames)
+				frames = plugin->buf_frames;
 			plugin_prev = plugin->prev;
 			if (plugin->src_frames) {
 				frames = plugin->src_frames(plugin, frames);
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/core/seq/oss/seq_oss_midi.c linux-libre-4.4.218-gnu/sound/core/seq/oss/seq_oss_midi.c
--- linux-libre-4.4.217-gnu/sound/core/seq/oss/seq_oss_midi.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/core/seq/oss/seq_oss_midi.c	2020-04-02 13:02:40.000000000 -0400
@@ -615,6 +615,7 @@ send_midi_event(struct seq_oss_devinfo *
 		len = snd_seq_oss_timer_start(dp->timer);
 	if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
 		snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev);
+		snd_midi_event_reset_decode(mdev->coder);
 	} else {
 		len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev);
 		if (len > 0)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/core/seq/seq_virmidi.c linux-libre-4.4.218-gnu/sound/core/seq/seq_virmidi.c
--- linux-libre-4.4.217-gnu/sound/core/seq/seq_virmidi.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/core/seq/seq_virmidi.c	2020-04-02 13:02:40.000000000 -0400
@@ -95,6 +95,7 @@ static int snd_virmidi_dev_receive_event
 			if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
 				continue;
 			snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
+			snd_midi_event_reset_decode(vmidi->parser);
 		} else {
 			len = snd_midi_event_decode(vmidi->parser, msg, sizeof(msg), ev);
 			if (len > 0)
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/pci/hda/patch_realtek.c linux-libre-4.4.218-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-4.4.217-gnu/sound/pci/hda/patch_realtek.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/pci/hda/patch_realtek.c	2020-04-02 13:02:40.000000000 -0400
@@ -6333,6 +6333,8 @@ static int patch_alc269(struct hda_codec
 		alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
 		break;
 	case 0x10ec0225:
+		codec->power_save_node = 1;
+		/* fall through */
 	case 0x10ec0295:
 	case 0x10ec0299:
 		spec->codec_variant = ALC269_TYPE_ALC225;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/usb/line6/driver.c linux-libre-4.4.218-gnu/sound/usb/line6/driver.c
--- linux-libre-4.4.217-gnu/sound/usb/line6/driver.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/usb/line6/driver.c	2020-04-02 13:02:40.000000000 -0400
@@ -283,7 +283,7 @@ static void line6_data_received(struct u
 		    line6_midibuf_read(mb, line6->buffer_message,
 				       LINE6_MESSAGE_MAXLEN);
 
-		if (done == 0)
+		if (done <= 0)
 			break;
 
 		line6->message_length = done;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/sound/usb/line6/midibuf.c linux-libre-4.4.218-gnu/sound/usb/line6/midibuf.c
--- linux-libre-4.4.217-gnu/sound/usb/line6/midibuf.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/sound/usb/line6/midibuf.c	2020-04-02 13:02:40.000000000 -0400
@@ -163,7 +163,7 @@ int line6_midibuf_read(struct midi_buffe
 			int midi_length_prev =
 			    midibuf_message_length(this->command_prev);
 
-			if (midi_length_prev > 0) {
+			if (midi_length_prev > 1) {
 				midi_length = midi_length_prev - 1;
 				repeat = 1;
 			} else
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/perf/Makefile linux-libre-4.4.218-gnu/tools/perf/Makefile
--- linux-libre-4.4.217-gnu/tools/perf/Makefile	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/perf/Makefile	2020-04-02 13:02:40.000000000 -0400
@@ -34,7 +34,7 @@ endif
 # Only pass canonical directory names as the output directory:
 #
 ifneq ($(O),)
-  FULL_O := $(shell readlink -f $(O) || echo $(O))
+  FULL_O := $(shell cd $(PWD); readlink -f $(O) || echo $(O))
 endif
 
 #
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/perf/util/map.c linux-libre-4.4.218-gnu/tools/perf/util/map.c
--- linux-libre-4.4.217-gnu/tools/perf/util/map.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/perf/util/map.c	2020-04-02 13:02:40.000000000 -0400
@@ -85,7 +85,7 @@ static inline bool replace_android_lib(c
 		return true;
 	}
 
-	if (!strncmp(filename, "/system/lib/", 11)) {
+	if (!strncmp(filename, "/system/lib/", 12)) {
 		char *ndk, *app;
 		const char *arch;
 		size_t ndk_length;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/perf/util/probe-finder.c linux-libre-4.4.218-gnu/tools/perf/util/probe-finder.c
--- linux-libre-4.4.217-gnu/tools/perf/util/probe-finder.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/perf/util/probe-finder.c	2020-04-02 13:02:40.000000000 -0400
@@ -608,14 +608,19 @@ static int convert_to_trace_point(Dwarf_
 		return -EINVAL;
 	}
 
-	/* Try to get actual symbol name from symtab */
-	symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
+	if (dwarf_entrypc(sp_die, &eaddr) == 0) {
+		/* If the DIE has entrypc, use it. */
+		symbol = dwarf_diename(sp_die);
+	} else {
+		/* Try to get actual symbol name and address from symtab */
+		symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
+		eaddr = sym.st_value;
+	}
 	if (!symbol) {
 		pr_warning("Failed to find symbol at 0x%lx\n",
 			   (unsigned long)paddr);
 		return -ENOENT;
 	}
-	eaddr = sym.st_value;
 
 	tp->offset = (unsigned long)(paddr - eaddr);
 	tp->address = (unsigned long)paddr;
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
--- linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c	2020-04-02 13:02:40.000000000 -0400
@@ -83,7 +83,7 @@ static struct pci_access *pci_acc;
 static struct pci_dev *amd_fam14h_pci_dev;
 static int nbp1_entered;
 
-struct timespec start_time;
+static struct timespec start_time;
 static unsigned long long timediff;
 
 #ifdef DEBUG
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
--- linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c	2020-04-02 13:02:40.000000000 -0400
@@ -21,7 +21,7 @@ struct cpuidle_monitor cpuidle_sysfs_mon
 
 static unsigned long long **previous_count;
 static unsigned long long **current_count;
-struct timespec start_time;
+static struct timespec start_time;
 static unsigned long long timediff;
 
 static int cpuidle_get_count_percent(unsigned int id, double *percent,
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
--- linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c	2020-04-02 13:02:40.000000000 -0400
@@ -29,6 +29,8 @@ struct cpuidle_monitor *all_monitors[] =
 0
 };
 
+int cpu_count;
+
 static struct cpuidle_monitor *monitors[MONITORS_MAX];
 static unsigned int avail_monitors;
 
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
--- linux-libre-4.4.217-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h	2020-04-02 13:02:40.000000000 -0400
@@ -18,7 +18,7 @@
 #define CSTATE_NAME_LEN 5
 #define CSTATE_DESC_LEN 60
 
-int cpu_count;
+extern int cpu_count;
 
 /* Hard to define the right names ...: */
 enum power_range_e {
diff -druNp --no-dereference linux-libre-4.4.217-gnu/tools/scripts/Makefile.include linux-libre-4.4.218-gnu/tools/scripts/Makefile.include
--- linux-libre-4.4.217-gnu/tools/scripts/Makefile.include	2020-03-20 04:06:35.000000000 -0400
+++ linux-libre-4.4.218-gnu/tools/scripts/Makefile.include	2020-04-02 13:02:40.000000000 -0400
@@ -1,7 +1,7 @@
 ifneq ($(O),)
 ifeq ($(origin O), command line)
-	dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
-	ABSOLUTE_O := $(shell cd $(O) ; pwd)
+	dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
+	ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
 	OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
 	COMMAND_O := O=$(ABSOLUTE_O)
 ifeq ($(objtree),)
