diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/include/asm/asm-uaccess.h linux-libre-5.4-gnu/arch/arm64/include/asm/asm-uaccess.h
--- linux-libre-5.4-rc8-gnu/arch/arm64/include/asm/asm-uaccess.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/include/asm/asm-uaccess.h	2019-11-24 19:32:01.000000000 -0500
@@ -59,23 +59,6 @@ alternative_else_nop_endif
 #endif
 
 /*
- * These macros are no-ops when UAO is present.
- */
-	.macro	uaccess_disable_not_uao, tmp1, tmp2
-	uaccess_ttbr0_disable \tmp1, \tmp2
-alternative_if ARM64_ALT_PAN_NOT_UAO
-	SET_PSTATE_PAN(1)
-alternative_else_nop_endif
-	.endm
-
-	.macro	uaccess_enable_not_uao, tmp1, tmp2, tmp3
-	uaccess_ttbr0_enable \tmp1, \tmp2, \tmp3
-alternative_if ARM64_ALT_PAN_NOT_UAO
-	SET_PSTATE_PAN(0)
-alternative_else_nop_endif
-	.endm
-
-/*
  * Remove the address tag from a virtual address, if present.
  */
 	.macro	untagged_addr, dst, addr
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/include/asm/uaccess.h linux-libre-5.4-gnu/arch/arm64/include/asm/uaccess.h
--- linux-libre-5.4-rc8-gnu/arch/arm64/include/asm/uaccess.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/include/asm/uaccess.h	2019-11-24 19:32:01.000000000 -0500
@@ -378,20 +378,34 @@ do {									\
 extern unsigned long __must_check __arch_copy_from_user(void *to, const void __user *from, unsigned long n);
 #define raw_copy_from_user(to, from, n)					\
 ({									\
-	__arch_copy_from_user((to), __uaccess_mask_ptr(from), (n));	\
+	unsigned long __acfu_ret;					\
+	uaccess_enable_not_uao();					\
+	__acfu_ret = __arch_copy_from_user((to),			\
+				      __uaccess_mask_ptr(from), (n));	\
+	uaccess_disable_not_uao();					\
+	__acfu_ret;							\
 })
 
 extern unsigned long __must_check __arch_copy_to_user(void __user *to, const void *from, unsigned long n);
 #define raw_copy_to_user(to, from, n)					\
 ({									\
-	__arch_copy_to_user(__uaccess_mask_ptr(to), (from), (n));	\
+	unsigned long __actu_ret;					\
+	uaccess_enable_not_uao();					\
+	__actu_ret = __arch_copy_to_user(__uaccess_mask_ptr(to),	\
+				    (from), (n));			\
+	uaccess_disable_not_uao();					\
+	__actu_ret;							\
 })
 
 extern unsigned long __must_check __arch_copy_in_user(void __user *to, const void __user *from, unsigned long n);
 #define raw_copy_in_user(to, from, n)					\
 ({									\
-	__arch_copy_in_user(__uaccess_mask_ptr(to),			\
-			    __uaccess_mask_ptr(from), (n));		\
+	unsigned long __aciu_ret;					\
+	uaccess_enable_not_uao();					\
+	__aciu_ret = __arch_copy_in_user(__uaccess_mask_ptr(to),	\
+				    __uaccess_mask_ptr(from), (n));	\
+	uaccess_disable_not_uao();					\
+	__aciu_ret;							\
 })
 
 #define INLINE_COPY_TO_USER
@@ -400,8 +414,11 @@ extern unsigned long __must_check __arch
 extern unsigned long __must_check __arch_clear_user(void __user *to, unsigned long n);
 static inline unsigned long __must_check __clear_user(void __user *to, unsigned long n)
 {
-	if (access_ok(to, n))
+	if (access_ok(to, n)) {
+		uaccess_enable_not_uao();
 		n = __arch_clear_user(__uaccess_mask_ptr(to), n);
+		uaccess_disable_not_uao();
+	}
 	return n;
 }
 #define clear_user	__clear_user
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/lib/clear_user.S linux-libre-5.4-gnu/arch/arm64/lib/clear_user.S
--- linux-libre-5.4-rc8-gnu/arch/arm64/lib/clear_user.S	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/lib/clear_user.S	2019-11-24 19:32:01.000000000 -0500
@@ -20,7 +20,6 @@
  * Alignment fixed up by hardware.
  */
 ENTRY(__arch_clear_user)
-	uaccess_enable_not_uao x2, x3, x4
 	mov	x2, x1			// save the size for fixup return
 	subs	x1, x1, #8
 	b.mi	2f
@@ -40,7 +39,6 @@ uao_user_alternative 9f, strh, sttrh, wz
 	b.mi	5f
 uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
 5:	mov	x0, #0
-	uaccess_disable_not_uao x2, x3
 	ret
 ENDPROC(__arch_clear_user)
 EXPORT_SYMBOL(__arch_clear_user)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_from_user.S linux-libre-5.4-gnu/arch/arm64/lib/copy_from_user.S
--- linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_from_user.S	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/lib/copy_from_user.S	2019-11-24 19:32:01.000000000 -0500
@@ -54,10 +54,8 @@
 
 end	.req	x5
 ENTRY(__arch_copy_from_user)
-	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3, x4
 	mov	x0, #0				// Nothing to copy
 	ret
 ENDPROC(__arch_copy_from_user)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_in_user.S linux-libre-5.4-gnu/arch/arm64/lib/copy_in_user.S
--- linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_in_user.S	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/lib/copy_in_user.S	2019-11-24 19:32:01.000000000 -0500
@@ -56,10 +56,8 @@
 end	.req	x5
 
 ENTRY(__arch_copy_in_user)
-	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3, x4
 	mov	x0, #0
 	ret
 ENDPROC(__arch_copy_in_user)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_to_user.S linux-libre-5.4-gnu/arch/arm64/lib/copy_to_user.S
--- linux-libre-5.4-rc8-gnu/arch/arm64/lib/copy_to_user.S	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/lib/copy_to_user.S	2019-11-24 19:32:01.000000000 -0500
@@ -53,10 +53,8 @@
 
 end	.req	x5
 ENTRY(__arch_copy_to_user)
-	uaccess_enable_not_uao x3, x4, x5
 	add	end, x0, x2
 #include "copy_template.S"
-	uaccess_disable_not_uao x3, x4
 	mov	x0, #0
 	ret
 ENDPROC(__arch_copy_to_user)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/arch/arm64/lib/uaccess_flushcache.c linux-libre-5.4-gnu/arch/arm64/lib/uaccess_flushcache.c
--- linux-libre-5.4-rc8-gnu/arch/arm64/lib/uaccess_flushcache.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/arch/arm64/lib/uaccess_flushcache.c	2019-11-24 19:32:01.000000000 -0500
@@ -28,7 +28,11 @@ void memcpy_page_flushcache(char *to, st
 unsigned long __copy_user_flushcache(void *to, const void __user *from,
 				     unsigned long n)
 {
-	unsigned long rc = __arch_copy_from_user(to, from, n);
+	unsigned long rc;
+
+	uaccess_enable_not_uao();
+	rc = __arch_copy_from_user(to, from, n);
+	uaccess_disable_not_uao();
 
 	/* See above */
 	__clean_dcache_area_pop(to, n - rc);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/block/nbd.c linux-libre-5.4-gnu/drivers/block/nbd.c
--- linux-libre-5.4-rc8-gnu/drivers/block/nbd.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/block/nbd.c	2019-11-24 19:32:01.000000000 -0500
@@ -993,6 +993,7 @@ static struct socket *nbd_get_socket(str
 	if (sock->ops->shutdown == sock_no_shutdown) {
 		dev_err(disk_to_dev(nbd->disk), "Unsupported socket: shutdown callout must be supported.\n");
 		*err = -EINVAL;
+		sockfd_put(sock);
 		return NULL;
 	}
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/char/virtio_console.c linux-libre-5.4-gnu/drivers/char/virtio_console.c
--- linux-libre-5.4-rc8-gnu/drivers/char/virtio_console.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/char/virtio_console.c	2019-11-24 19:32:01.000000000 -0500
@@ -1325,24 +1325,24 @@ static void set_console_size(struct port
 	port->cons.ws.ws_col = cols;
 }
 
-static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock)
+static int fill_queue(struct virtqueue *vq, spinlock_t *lock)
 {
 	struct port_buffer *buf;
-	unsigned int nr_added_bufs;
+	int nr_added_bufs;
 	int ret;
 
 	nr_added_bufs = 0;
 	do {
 		buf = alloc_buf(vq->vdev, PAGE_SIZE, 0);
 		if (!buf)
-			break;
+			return -ENOMEM;
 
 		spin_lock_irq(lock);
 		ret = add_inbuf(vq, buf);
 		if (ret < 0) {
 			spin_unlock_irq(lock);
 			free_buf(buf, true);
-			break;
+			return ret;
 		}
 		nr_added_bufs++;
 		spin_unlock_irq(lock);
@@ -1362,7 +1362,6 @@ static int add_port(struct ports_device
 	char debugfs_name[16];
 	struct port *port;
 	dev_t devt;
-	unsigned int nr_added_bufs;
 	int err;
 
 	port = kmalloc(sizeof(*port), GFP_KERNEL);
@@ -1421,11 +1420,13 @@ static int add_port(struct ports_device
 	spin_lock_init(&port->outvq_lock);
 	init_waitqueue_head(&port->waitqueue);
 
-	/* Fill the in_vq with buffers so the host can send us data. */
-	nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock);
-	if (!nr_added_bufs) {
+	/* We can safely ignore ENOSPC because it means
+	 * the queue already has buffers. Buffers are removed
+	 * only by virtcons_remove(), not by unplug_port()
+	 */
+	err = fill_queue(port->in_vq, &port->inbuf_lock);
+	if (err < 0 && err != -ENOSPC) {
 		dev_err(port->dev, "Error allocating inbufs\n");
-		err = -ENOMEM;
 		goto free_device;
 	}
 
@@ -2059,14 +2060,11 @@ static int virtcons_probe(struct virtio_
 	INIT_WORK(&portdev->control_work, &control_work_handler);
 
 	if (multiport) {
-		unsigned int nr_added_bufs;
-
 		spin_lock_init(&portdev->c_ivq_lock);
 		spin_lock_init(&portdev->c_ovq_lock);
 
-		nr_added_bufs = fill_queue(portdev->c_ivq,
-					   &portdev->c_ivq_lock);
-		if (!nr_added_bufs) {
+		err = fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
+		if (err < 0) {
 			dev_err(&vdev->dev,
 				"Error allocating buffers for control queue\n");
 			/*
@@ -2077,7 +2075,7 @@ static int virtcons_probe(struct virtio_
 					   VIRTIO_CONSOLE_DEVICE_READY, 0);
 			/* Device was functional: we need full cleanup. */
 			virtcons_remove(vdev);
-			return -ENOMEM;
+			return err;
 		}
 	} else {
 		/*
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpio/gpio-bd70528.c linux-libre-5.4-gnu/drivers/gpio/gpio-bd70528.c
--- linux-libre-5.4-rc8-gnu/drivers/gpio/gpio-bd70528.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpio/gpio-bd70528.c	2019-11-24 19:32:01.000000000 -0500
@@ -25,13 +25,13 @@ static int bd70528_set_debounce(struct b
 	case 0:
 		val = BD70528_DEBOUNCE_DISABLE;
 		break;
-	case 1 ... 15:
+	case 1 ... 15000:
 		val = BD70528_DEBOUNCE_15MS;
 		break;
-	case 16 ... 30:
+	case 15001 ... 30000:
 		val = BD70528_DEBOUNCE_30MS;
 		break;
-	case 31 ... 50:
+	case 30001 ... 50000:
 		val = BD70528_DEBOUNCE_50MS;
 		break;
 	default:
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpio/gpiolib-acpi.c linux-libre-5.4-gnu/drivers/gpio/gpiolib-acpi.c
--- linux-libre-5.4-rc8-gnu/drivers/gpio/gpiolib-acpi.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpio/gpiolib-acpi.c	2019-11-24 19:32:01.000000000 -0500
@@ -1304,11 +1304,28 @@ late_initcall_sync(acpi_gpio_handle_defe
 
 static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
 	{
+		/*
+		 * The Minix Neo Z83-4 has a micro-USB-B id-pin handler for
+		 * a non existing micro-USB-B connector which puts the HDMI
+		 * DDC pins in GPIO mode, breaking HDMI support.
+		 */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
 		}
 	},
+	{
+		/*
+		 * The Terra Pad 1061 has a micro-USB-B id-pin handler, which
+		 * instead of controlling the actual micro-USB-B turns the 5V
+		 * boost for its USB-A connector off. The actual micro-USB-B
+		 * connector is wired for charging only.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"),
+		}
+	},
 	{} /* Terminating entry */
 };
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpio/gpio-max77620.c linux-libre-5.4-gnu/drivers/gpio/gpio-max77620.c
--- linux-libre-5.4-rc8-gnu/drivers/gpio/gpio-max77620.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpio/gpio-max77620.c	2019-11-24 19:32:01.000000000 -0500
@@ -192,13 +192,13 @@ static int max77620_gpio_set_debounce(st
 	case 0:
 		val = MAX77620_CNFG_GPIO_DBNC_None;
 		break;
-	case 1000 ... 8000:
+	case 1 ... 8000:
 		val = MAX77620_CNFG_GPIO_DBNC_8ms;
 		break;
-	case 9000 ... 16000:
+	case 8001 ... 16000:
 		val = MAX77620_CNFG_GPIO_DBNC_16ms;
 		break;
-	case 17000 ... 32000:
+	case 16001 ... 32000:
 		val = MAX77620_CNFG_GPIO_DBNC_32ms;
 		break;
 	default:
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c	2019-11-24 19:32:01.000000000 -0500
@@ -511,7 +511,7 @@ uint32_t amdgpu_display_supported_domain
 	 * Also, don't allow GTT domain if the BO doens't have USWC falg set.
 	 */
 	if (adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type <= CHIP_RAVEN &&
+	    adev->asic_type < CHIP_RAVEN &&
 	    (adev->flags & AMD_IS_APU) &&
 	    (bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) &&
 	    amdgpu_bo_support_uswc(bo_flags) &&
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c	2019-11-24 19:32:01.000000000 -0500
@@ -1013,10 +1013,10 @@ static const struct pci_device_id pciidl
 	{0x1002, 0x731B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	{0x1002, 0x731F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI10},
 	/* Navi14 */
-	{0x1002, 0x7340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14|AMD_EXP_HW_SUPPORT},
-	{0x1002, 0x7341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14|AMD_EXP_HW_SUPPORT},
-	{0x1002, 0x7347, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14|AMD_EXP_HW_SUPPORT},
-	{0x1002, 0x734F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14|AMD_EXP_HW_SUPPORT},
+	{0x1002, 0x7340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
+	{0x1002, 0x7341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
+	{0x1002, 0x7347, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
+	{0x1002, 0x734F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI14},
 
 	/* Renoir */
 	{0x1002, 0x1636, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RENOIR|AMD_IS_APU|AMD_EXP_HW_SUPPORT},
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c	2019-11-24 19:32:01.000000000 -0500
@@ -649,15 +649,19 @@ static int amdgpu_info_ioctl(struct drm_
 			return -ENOMEM;
 		alloc_size = info->read_mmr_reg.count * sizeof(*regs);
 
-		for (i = 0; i < info->read_mmr_reg.count; i++)
+		amdgpu_gfx_off_ctrl(adev, false);
+		for (i = 0; i < info->read_mmr_reg.count; i++) {
 			if (amdgpu_asic_read_register(adev, se_num, sh_num,
 						      info->read_mmr_reg.dword_offset + i,
 						      &regs[i])) {
 				DRM_DEBUG_KMS("unallowed offset %#x\n",
 					      info->read_mmr_reg.dword_offset + i);
 				kfree(regs);
+				amdgpu_gfx_off_ctrl(adev, true);
 				return -EFAULT;
 			}
+		}
+		amdgpu_gfx_off_ctrl(adev, true);
 		n = copy_to_user(out, regs, min(size, alloc_size));
 		kfree(regs);
 		return n ? -EFAULT : 0;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c	2019-11-17 18:51:57.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c	2019-11-24 20:52:46.000000000 -0500
@@ -985,8 +985,13 @@ static void gfx_v9_0_check_if_need_gfxof
 	case CHIP_VEGA20:
 		break;
 	case CHIP_RAVEN:
-		if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
-			&&((adev->gfx.rlc_fw_version != 106 &&
+		/* Disable GFXOFF on original raven.  There are combinations
+		 * of sbios and platforms that are not stable.
+		 */
+		if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8))
+			adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
+		else if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
+			 &&((adev->gfx.rlc_fw_version != 106 &&
 			     adev->gfx.rlc_fw_version < 531) ||
 			    (adev->gfx.rlc_fw_version == 53815) ||
 			    (adev->gfx.rlc_feature_version < 1) ||
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c	2019-11-17 18:53:01.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c	2019-11-24 20:54:11.000000000 -0500
@@ -688,7 +688,7 @@ static int amdgpu_dm_init(struct amdgpu_
 	 */
 	if (adev->flags & AMD_IS_APU &&
 	    adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type <= CHIP_RAVEN)
+	    adev->asic_type < CHIP_RAVEN)
 		init_data.flags.gpu_vm_support = true;
 
 	if (amdgpu_dc_feature_mask & DC_FBC_MASK)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c	2019-11-24 19:32:01.000000000 -0500
@@ -3478,18 +3478,31 @@ static int smu7_get_pp_table_entry(struc
 
 static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
 {
+	struct amdgpu_device *adev = hwmgr->adev;
 	int i;
 	u32 tmp = 0;
 
 	if (!query)
 		return -EINVAL;
 
-	smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
-	tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
-	*query = tmp;
+	/*
+	 * PPSMC_MSG_GetCurrPkgPwr is not supported on:
+	 *  - Hawaii
+	 *  - Bonaire
+	 *  - Fiji
+	 *  - Tonga
+	 */
+	if ((adev->asic_type != CHIP_HAWAII) &&
+	    (adev->asic_type != CHIP_BONAIRE) &&
+	    (adev->asic_type != CHIP_FIJI) &&
+	    (adev->asic_type != CHIP_TONGA)) {
+		smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
+		tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
+		*query = tmp;
 
-	if (tmp != 0)
-		return 0;
+		if (tmp != 0)
+			return 0;
+	}
 
 	smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
 	cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/powerplay/navi10_ppt.c linux-libre-5.4-gnu/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/amd/powerplay/navi10_ppt.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/amd/powerplay/navi10_ppt.c	2019-11-24 19:32:01.000000000 -0500
@@ -759,6 +759,12 @@ static int navi10_force_clk_levels(struc
 	case SMU_UCLK:
 	case SMU_DCEFCLK:
 	case SMU_FCLK:
+		/* There is only 2 levels for fine grained DPM */
+		if (navi10_is_support_fine_grained_dpm(smu, clk_type)) {
+			soft_max_level = (soft_max_level >= 1 ? 1 : 0);
+			soft_min_level = (soft_min_level >= 1 ? 1 : 0);
+		}
+
 		ret = smu_get_dpm_freq_by_index(smu, clk_type, soft_min_level, &min_freq);
 		if (ret)
 			return size;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_atomic.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_atomic.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_atomic.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_atomic.c	2019-11-24 19:32:01.000000000 -0500
@@ -201,6 +201,7 @@ intel_crtc_duplicate_state(struct drm_cr
 	crtc_state->update_wm_post = false;
 	crtc_state->fb_changed = false;
 	crtc_state->fifo_changed = false;
+	crtc_state->preload_luts = false;
 	crtc_state->wm.need_postvbl_update = false;
 	crtc_state->fb_bits = 0;
 	crtc_state->update_planes = 0;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_color.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_color.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_color.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_color.c	2019-11-24 19:32:01.000000000 -0500
@@ -990,6 +990,55 @@ void intel_color_commit(const struct int
 	dev_priv->display.color_commit(crtc_state);
 }
 
+static bool intel_can_preload_luts(const struct intel_crtc_state *new_crtc_state)
+{
+	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->base.crtc);
+	struct intel_atomic_state *state =
+		to_intel_atomic_state(new_crtc_state->base.state);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
+
+	return !old_crtc_state->base.gamma_lut &&
+		!old_crtc_state->base.degamma_lut;
+}
+
+static bool chv_can_preload_luts(const struct intel_crtc_state *new_crtc_state)
+{
+	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->base.crtc);
+	struct intel_atomic_state *state =
+		to_intel_atomic_state(new_crtc_state->base.state);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
+
+	/*
+	 * CGM_PIPE_MODE is itself single buffered. We'd have to
+	 * somehow split it out from chv_load_luts() if we wanted
+	 * the ability to preload the CGM LUTs/CSC without tearing.
+	 */
+	if (old_crtc_state->cgm_mode || new_crtc_state->cgm_mode)
+		return false;
+
+	return !old_crtc_state->base.gamma_lut;
+}
+
+static bool glk_can_preload_luts(const struct intel_crtc_state *new_crtc_state)
+{
+	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->base.crtc);
+	struct intel_atomic_state *state =
+		to_intel_atomic_state(new_crtc_state->base.state);
+	const struct intel_crtc_state *old_crtc_state =
+		intel_atomic_get_old_crtc_state(state, crtc);
+
+	/*
+	 * The hardware degamma is active whenever the pipe
+	 * CSC is active. Thus even if the old state has no
+	 * software degamma we need to avoid clobbering the
+	 * linear hardware degamma mid scanout.
+	 */
+	return !old_crtc_state->csc_enable &&
+		!old_crtc_state->base.gamma_lut;
+}
+
 int intel_color_check(struct intel_crtc_state *crtc_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
@@ -1133,6 +1182,8 @@ static int i9xx_color_check(struct intel
 	if (ret)
 		return ret;
 
+	crtc_state->preload_luts = intel_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
@@ -1185,6 +1236,8 @@ static int chv_color_check(struct intel_
 	if (ret)
 		return ret;
 
+	crtc_state->preload_luts = chv_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
@@ -1224,6 +1277,8 @@ static int ilk_color_check(struct intel_
 	if (ret)
 		return ret;
 
+	crtc_state->preload_luts = intel_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
@@ -1281,6 +1336,8 @@ static int ivb_color_check(struct intel_
 	if (ret)
 		return ret;
 
+	crtc_state->preload_luts = intel_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
@@ -1319,6 +1376,8 @@ static int glk_color_check(struct intel_
 	if (ret)
 		return ret;
 
+	crtc_state->preload_luts = glk_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
@@ -1368,6 +1427,8 @@ static int icl_color_check(struct intel_
 
 	crtc_state->csc_mode = icl_csc_mode(crtc_state);
 
+	crtc_state->preload_luts = intel_can_preload_luts(crtc_state);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_display.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_display.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_display.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_display.c	2019-11-24 19:32:01.000000000 -0500
@@ -2504,6 +2504,9 @@ u32 intel_plane_fb_max_stride(struct drm
 	 * the highest stride limits of them all.
 	 */
 	crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
+	if (!crtc)
+		return 0;
+
 	plane = to_intel_plane(crtc->base.primary);
 
 	return plane->max_stride(plane, pixel_format, modifier,
@@ -13740,6 +13743,11 @@ static void intel_update_crtc(struct int
 		/* vblanks work again, re-enable pipe CRC. */
 		intel_crtc_enable_pipe_crc(crtc);
 	} else {
+		if (new_crtc_state->preload_luts &&
+		    (new_crtc_state->base.color_mgmt_changed ||
+		     new_crtc_state->update_pipe))
+			intel_color_load_luts(new_crtc_state);
+
 		intel_pre_plane_update(old_crtc_state, new_crtc_state);
 
 		if (new_crtc_state->update_pipe)
@@ -14034,6 +14042,7 @@ static void intel_atomic_commit_tail(str
 	for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
 		if (new_crtc_state->base.active &&
 		    !needs_modeset(new_crtc_state) &&
+		    !new_crtc_state->preload_luts &&
 		    (new_crtc_state->base.color_mgmt_changed ||
 		     new_crtc_state->update_pipe))
 			intel_color_load_luts(new_crtc_state);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_display_types.h linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_display_types.h
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_display_types.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_display_types.h	2019-11-24 19:32:01.000000000 -0500
@@ -761,6 +761,7 @@ struct intel_crtc_state {
 	bool update_wm_pre, update_wm_post; /* watermarks are updated */
 	bool fb_changed; /* fb on any of the planes is changed */
 	bool fifo_changed; /* FIFO split is changed */
+	bool preload_luts;
 
 	/* Pipe source size (ie. panel fitter input size)
 	 * All planes will be positioned inside this space,
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_fbdev.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_fbdev.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/display/intel_fbdev.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/display/intel_fbdev.c	2019-11-24 19:32:01.000000000 -0500
@@ -235,6 +235,11 @@ static int intelfb_create(struct drm_fb_
 	info->apertures->ranges[0].base = ggtt->gmadr.start;
 	info->apertures->ranges[0].size = ggtt->mappable_end;
 
+	/* Our framebuffer is the entirety of fbdev's system memory */
+	info->fix.smem_start =
+		(unsigned long)(ggtt->gmadr.start + vma->node.start);
+	info->fix.smem_len = vma->node.size;
+
 	vaddr = i915_vma_pin_iomap(vma);
 	if (IS_ERR(vaddr)) {
 		DRM_ERROR("Failed to remap framebuffer into virtual memory\n");
@@ -244,10 +249,6 @@ static int intelfb_create(struct drm_fb_
 	info->screen_base = vaddr;
 	info->screen_size = vma->node.size;
 
-	/* Our framebuffer is the entirety of fbdev's system memory */
-	info->fix.smem_start = (unsigned long)info->screen_base;
-	info->fix.smem_len = info->screen_size;
-
 	drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
 
 	/* If the object is shmemfs backed, it will have given us zeroed pages.
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/gem/i915_gem_userptr.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/gem/i915_gem_userptr.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/gem/i915_gem_userptr.c	2019-11-24 19:32:01.000000000 -0500
@@ -671,8 +671,28 @@ i915_gem_userptr_put_pages(struct drm_i9
 		obj->mm.dirty = false;
 
 	for_each_sgt_page(page, sgt_iter, pages) {
-		if (obj->mm.dirty)
+		if (obj->mm.dirty && trylock_page(page)) {
+			/*
+			 * As this may not be anonymous memory (e.g. shmem)
+			 * but exist on a real mapping, we have to lock
+			 * the page in order to dirty it -- holding
+			 * the page reference is not sufficient to
+			 * prevent the inode from being truncated.
+			 * Play safe and take the lock.
+			 *
+			 * However...!
+			 *
+			 * The mmu-notifier can be invalidated for a
+			 * migrate_page, that is alreadying holding the lock
+			 * on the page. Such a try_to_unmap() will result
+			 * in us calling put_pages() and so recursively try
+			 * to lock the page. We avoid that deadlock with
+			 * a trylock_page() and in exchange we risk missing
+			 * some page dirtying.
+			 */
 			set_page_dirty(page);
+			unlock_page(page);
+		}
 
 		mark_page_accessed(page);
 		put_page(page);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/gt/intel_engine_pool.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/gt/intel_engine_pool.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/gt/intel_engine_pool.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/gt/intel_engine_pool.c	2019-11-24 19:32:01.000000000 -0500
@@ -103,6 +103,8 @@ node_create(struct intel_engine_pool *po
 		return ERR_CAST(obj);
 	}
 
+	i915_gem_object_set_readonly(obj);
+
 	node->obj = obj;
 	return node;
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/i915_pmu.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/i915_pmu.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/i915_pmu.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/i915_pmu.c	2019-11-24 19:32:01.000000000 -0500
@@ -843,8 +843,8 @@ create_event_attributes(struct i915_pmu
 		const char *name;
 		const char *unit;
 	} events[] = {
-		__event(I915_PMU_ACTUAL_FREQUENCY, "actual-frequency", "MHz"),
-		__event(I915_PMU_REQUESTED_FREQUENCY, "requested-frequency", "MHz"),
+		__event(I915_PMU_ACTUAL_FREQUENCY, "actual-frequency", "M"),
+		__event(I915_PMU_REQUESTED_FREQUENCY, "requested-frequency", "M"),
 		__event(I915_PMU_INTERRUPTS, "interrupts", NULL),
 		__event(I915_PMU_RC6_RESIDENCY, "rc6-residency", "ns"),
 	};
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/i915_scheduler.c linux-libre-5.4-gnu/drivers/gpu/drm/i915/i915_scheduler.c
--- linux-libre-5.4-rc8-gnu/drivers/gpu/drm/i915/i915_scheduler.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/gpu/drm/i915/i915_scheduler.c	2019-11-24 19:32:01.000000000 -0500
@@ -177,9 +177,37 @@ static inline int rq_prio(const struct i
 	return rq->sched.attr.priority | __NO_PREEMPTION;
 }
 
-static void kick_submission(struct intel_engine_cs *engine, int prio)
+static inline bool need_preempt(int prio, int active)
 {
-	const struct i915_request *inflight = *engine->execlists.active;
+	/*
+	 * Allow preemption of low -> normal -> high, but we do
+	 * not allow low priority tasks to preempt other low priority
+	 * tasks under the impression that latency for low priority
+	 * tasks does not matter (as much as background throughput),
+	 * so kiss.
+	 */
+	return prio >= max(I915_PRIORITY_NORMAL, active);
+}
+
+static void kick_submission(struct intel_engine_cs *engine,
+			    const struct i915_request *rq,
+			    int prio)
+{
+	const struct i915_request *inflight;
+
+	/*
+	 * We only need to kick the tasklet once for the high priority
+	 * new context we add into the queue.
+	 */
+	if (prio <= engine->execlists.queue_priority_hint)
+		return;
+
+	rcu_read_lock();
+
+	/* Nothing currently active? We're overdue for a submission! */
+	inflight = execlists_active(&engine->execlists);
+	if (!inflight)
+		goto unlock;
 
 	/*
 	 * If we are already the currently executing context, don't
@@ -188,10 +216,15 @@ static void kick_submission(struct intel
 	 * tasklet, i.e. we have not change the priority queue
 	 * sufficiently to oust the running context.
 	 */
-	if (!inflight || !i915_scheduler_need_preempt(prio, rq_prio(inflight)))
-		return;
+	if (inflight->hw_context == rq->hw_context)
+		goto unlock;
 
-	tasklet_hi_schedule(&engine->execlists.tasklet);
+	engine->execlists.queue_priority_hint = prio;
+	if (need_preempt(prio, rq_prio(inflight)))
+		tasklet_hi_schedule(&engine->execlists.tasklet);
+
+unlock:
+	rcu_read_unlock();
 }
 
 static void __i915_schedule(struct i915_sched_node *node,
@@ -317,13 +350,8 @@ static void __i915_schedule(struct i915_
 			list_move_tail(&node->link, cache.priolist);
 		}
 
-		if (prio <= engine->execlists.queue_priority_hint)
-			continue;
-
-		engine->execlists.queue_priority_hint = prio;
-
 		/* Defer (tasklet) submission until after all of our updates. */
-		kick_submission(engine, prio);
+		kick_submission(engine, node_to_request(node), prio);
 	}
 
 	spin_unlock(&engine->active.lock);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/input/mouse/synaptics.c linux-libre-5.4-gnu/drivers/input/mouse/synaptics.c
--- linux-libre-5.4-rc8-gnu/drivers/input/mouse/synaptics.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/input/mouse/synaptics.c	2019-11-24 19:32:01.000000000 -0500
@@ -177,7 +177,6 @@ static const char * const smbus_pnp_ids[
 	"LEN0096", /* X280 */
 	"LEN0097", /* X280 -> ALPS trackpoint */
 	"LEN009b", /* T580 */
-	"LEN0402", /* X1 Extreme 2nd Generation */
 	"LEN200f", /* T450s */
 	"LEN2054", /* E480 */
 	"LEN2055", /* E580 */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/can/m_can/m_can_platform.c linux-libre-5.4-gnu/drivers/net/can/m_can/m_can_platform.c
--- linux-libre-5.4-rc8-gnu/drivers/net/can/m_can/m_can_platform.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/can/m_can/m_can_platform.c	2019-11-24 19:32:01.000000000 -0500
@@ -107,7 +107,7 @@ static int m_can_plat_probe(struct platf
 
 	mcan_class->is_peripheral = false;
 
-	platform_set_drvdata(pdev, mcan_class->dev);
+	platform_set_drvdata(pdev, mcan_class->net);
 
 	m_can_init_ram(mcan_class);
 
@@ -166,8 +166,6 @@ static int __maybe_unused m_can_runtime_
 	if (err)
 		clk_disable_unprepare(mcan_class->hclk);
 
-	m_can_class_resume(dev);
-
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/freescale/fec_main.c linux-libre-5.4-gnu/drivers/net/ethernet/freescale/fec_main.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/freescale/fec_main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/freescale/fec_main.c	2019-11-24 19:32:01.000000000 -0500
@@ -3636,6 +3636,11 @@ fec_drv_remove(struct platform_device *p
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct device_node *np = pdev->dev.of_node;
+	int ret;
+
+	ret = pm_runtime_get_sync(&pdev->dev);
+	if (ret < 0)
+		return ret;
 
 	cancel_work_sync(&fep->tx_timeout_work);
 	fec_ptp_stop(pdev);
@@ -3643,15 +3648,17 @@ fec_drv_remove(struct platform_device *p
 	fec_enet_mii_remove(fep);
 	if (fep->reg_phy)
 		regulator_disable(fep->reg_phy);
-	pm_runtime_put(&pdev->dev);
-	pm_runtime_disable(&pdev->dev);
-	clk_disable_unprepare(fep->clk_ahb);
-	clk_disable_unprepare(fep->clk_ipg);
+
 	if (of_phy_is_fixed_link(np))
 		of_phy_deregister_fixed_link(np);
 	of_node_put(fep->phy_node);
 	free_netdev(ndev);
 
+	clk_disable_unprepare(fep->clk_ahb);
+	clk_disable_unprepare(fep->clk_ipg);
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/google/gve/gve_tx.c linux-libre-5.4-gnu/drivers/net/ethernet/google/gve/gve_tx.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/google/gve/gve_tx.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/google/gve/gve_tx.c	2019-11-24 19:32:01.000000000 -0500
@@ -393,12 +393,13 @@ static void gve_tx_fill_seg_desc(union g
 static void gve_dma_sync_for_device(struct device *dev, dma_addr_t *page_buses,
 				    u64 iov_offset, u64 iov_len)
 {
+	u64 last_page = (iov_offset + iov_len - 1) / PAGE_SIZE;
+	u64 first_page = iov_offset / PAGE_SIZE;
 	dma_addr_t dma;
-	u64 addr;
+	u64 page;
 
-	for (addr = iov_offset; addr < iov_offset + iov_len;
-	     addr += PAGE_SIZE) {
-		dma = page_buses[addr / PAGE_SIZE];
+	for (page = first_page; page <= last_page; page++) {
+		dma = page_buses[page];
 		dma_sync_single_for_device(dev, dma, PAGE_SIZE, DMA_TO_DEVICE);
 	}
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h linux-libre-5.4-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h	2019-11-24 19:32:01.000000000 -0500
@@ -166,7 +166,7 @@ enum HLCGE_PORT_TYPE {
 #define HCLGE_GLOBAL_RESET_BIT		0
 #define HCLGE_CORE_RESET_BIT		1
 #define HCLGE_IMP_RESET_BIT		2
-#define HCLGE_RESET_INT_M		GENMASK(2, 0)
+#define HCLGE_RESET_INT_M		GENMASK(7, 5)
 #define HCLGE_FUN_RST_ING		0x20C00
 #define HCLGE_FUN_RST_ING_B		0
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/ibm/ibmvnic.c linux-libre-5.4-gnu/drivers/net/ethernet/ibm/ibmvnic.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/ibm/ibmvnic.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/ibm/ibmvnic.c	2019-11-24 19:32:01.000000000 -0500
@@ -2878,10 +2878,15 @@ static int enable_scrq_irq(struct ibmvni
 
 	if (test_bit(0, &adapter->resetting) &&
 	    adapter->reset_reason == VNIC_RESET_MOBILITY) {
-		struct irq_desc *desc = irq_to_desc(scrq->irq);
-		struct irq_chip *chip = irq_desc_get_chip(desc);
+		u64 val = (0xff000000) | scrq->hw_irq;
 
-		chip->irq_eoi(&desc->irq_data);
+		rc = plpar_hcall_norets(H_EOI, val);
+		/* H_EOI would fail with rc = H_FUNCTION when running
+		 * in XIVE mode which is expected, but not an error.
+		 */
+		if (rc && (rc != H_FUNCTION))
+			dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
+				val, rc);
 	}
 
 	rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c	2019-11-24 19:32:01.000000000 -0500
@@ -1745,6 +1745,7 @@ static int mlx4_en_get_rxnfc(struct net_
 		err = mlx4_en_get_flow(dev, cmd, cmd->fs.location);
 		break;
 	case ETHTOOL_GRXCLSRLALL:
+		cmd->data = MAX_NUM_OF_FS_RULES;
 		while ((!err || err == -ENOENT) && priority < cmd->rule_cnt) {
 			err = mlx4_en_get_flow(dev, cmd, i);
 			if (!err)
@@ -1811,6 +1812,7 @@ static int mlx4_en_set_channels(struct n
 	struct mlx4_en_dev *mdev = priv->mdev;
 	struct mlx4_en_port_profile new_prof;
 	struct mlx4_en_priv *tmp;
+	int total_tx_count;
 	int port_up = 0;
 	int xdp_count;
 	int err = 0;
@@ -1825,13 +1827,12 @@ static int mlx4_en_set_channels(struct n
 
 	mutex_lock(&mdev->state_lock);
 	xdp_count = priv->tx_ring_num[TX_XDP] ? channel->rx_count : 0;
-	if (channel->tx_count * priv->prof->num_up + xdp_count >
-	    priv->mdev->profile.max_num_tx_rings_p_up * priv->prof->num_up) {
+	total_tx_count = channel->tx_count * priv->prof->num_up + xdp_count;
+	if (total_tx_count > MAX_TX_RINGS) {
 		err = -EINVAL;
 		en_err(priv,
 		       "Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n",
-		       channel->tx_count * priv->prof->num_up  + xdp_count,
-		       MAX_TX_RINGS);
+		       total_tx_count, MAX_TX_RINGS);
 		goto out;
 	}
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c	2019-11-24 19:32:01.000000000 -0500
@@ -91,6 +91,7 @@ int mlx4_en_alloc_tx_queue_per_tc(struct
 	struct mlx4_en_dev *mdev = priv->mdev;
 	struct mlx4_en_port_profile new_prof;
 	struct mlx4_en_priv *tmp;
+	int total_count;
 	int port_up = 0;
 	int err = 0;
 
@@ -104,6 +105,14 @@ int mlx4_en_alloc_tx_queue_per_tc(struct
 				      MLX4_EN_NUM_UP_HIGH;
 	new_prof.tx_ring_num[TX] = new_prof.num_tx_rings_p_up *
 				   new_prof.num_up;
+	total_count = new_prof.tx_ring_num[TX] + new_prof.tx_ring_num[TX_XDP];
+	if (total_count > MAX_TX_RINGS) {
+		err = -EINVAL;
+		en_err(priv,
+		       "Total number of TX and XDP rings (%d) exceeds the maximum supported (%d)\n",
+		       total_count, MAX_TX_RINGS);
+		goto out;
+	}
 	err = mlx4_en_try_alloc_resources(priv, tmp, &new_prof, true);
 	if (err)
 		goto out;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c	2019-11-24 19:32:01.000000000 -0500
@@ -239,12 +239,15 @@ int mlx5e_tc_tun_create_header_ipv4(stru
 	if (max_encap_size < ipv4_encap_size) {
 		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
 			       ipv4_encap_size, max_encap_size);
-		return -EOPNOTSUPP;
+		err = -EOPNOTSUPP;
+		goto out;
 	}
 
 	encap_header = kzalloc(ipv4_encap_size, GFP_KERNEL);
-	if (!encap_header)
-		return -ENOMEM;
+	if (!encap_header) {
+		err = -ENOMEM;
+		goto out;
+	}
 
 	/* used by mlx5e_detach_encap to lookup a neigh hash table
 	 * entry in the neigh hash table when a user deletes a rule
@@ -355,12 +358,15 @@ int mlx5e_tc_tun_create_header_ipv6(stru
 	if (max_encap_size < ipv6_encap_size) {
 		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
 			       ipv6_encap_size, max_encap_size);
-		return -EOPNOTSUPP;
+		err = -EOPNOTSUPP;
+		goto out;
 	}
 
 	encap_header = kzalloc(ipv6_encap_size, GFP_KERNEL);
-	if (!encap_header)
-		return -ENOMEM;
+	if (!encap_header) {
+		err = -ENOMEM;
+		goto out;
+	}
 
 	/* used by mlx5e_detach_encap to lookup a neigh hash table
 	 * entry in the neigh hash table when a user deletes a rule
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-11-24 19:32:01.000000000 -0500
@@ -708,9 +708,9 @@ static int get_fec_supported_advertised(
 
 static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings *link_ksettings,
 						   u32 eth_proto_cap,
-						   u8 connector_type)
+						   u8 connector_type, bool ext)
 {
-	if (!connector_type || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
+	if ((!connector_type && !ext) || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
 		if (eth_proto_cap & (MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
 				   | MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
 				   | MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
@@ -842,9 +842,9 @@ static int ptys2connector_type[MLX5E_CON
 		[MLX5E_PORT_OTHER]              = PORT_OTHER,
 	};
 
-static u8 get_connector_port(u32 eth_proto, u8 connector_type)
+static u8 get_connector_port(u32 eth_proto, u8 connector_type, bool ext)
 {
-	if (connector_type && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
+	if ((connector_type || ext) && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
 		return ptys2connector_type[connector_type];
 
 	if (eth_proto &
@@ -945,9 +945,9 @@ int mlx5e_ethtool_get_link_ksettings(str
 	eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
 
 	link_ksettings->base.port = get_connector_port(eth_proto_oper,
-						       connector_type);
+						       connector_type, ext);
 	ptys2ethtool_supported_advertised_port(link_ksettings, eth_proto_admin,
-					       connector_type);
+					       connector_type, ext);
 	get_lp_advertising(mdev, eth_proto_lp, link_ksettings);
 
 	if (an_status == MLX5_AN_COMPLETE)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_main.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_main.c	2019-11-24 19:32:01.000000000 -0500
@@ -4252,9 +4252,12 @@ static netdev_features_t mlx5e_tunnel_fe
 
 	switch (proto) {
 	case IPPROTO_GRE:
+		return features;
 	case IPPROTO_IPIP:
 	case IPPROTO_IPV6:
-		return features;
+		if (mlx5e_tunnel_proto_supported(priv->mdev, IPPROTO_IPIP))
+			return features;
+		break;
 	case IPPROTO_UDP:
 		udph = udp_hdr(skb);
 		port = be16_to_cpu(udph->dest);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c	2019-11-24 19:32:01.000000000 -0500
@@ -3268,7 +3268,20 @@ static int parse_tc_fdb_actions(struct m
 
 			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
 				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
-			if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
+			if (encap) {
+				parse_attr->mirred_ifindex[attr->out_count] =
+					out_dev->ifindex;
+				parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
+				if (!parse_attr->tun_info[attr->out_count])
+					return -ENOMEM;
+				encap = false;
+				attr->dests[attr->out_count].flags |=
+					MLX5_ESW_DEST_ENCAP;
+				attr->out_count++;
+				/* attr->dests[].rep is resolved when we
+				 * handle encap
+				 */
+			} else if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
 				struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
 				struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
 				struct net_device *uplink_upper;
@@ -3310,19 +3323,6 @@ static int parse_tc_fdb_actions(struct m
 				attr->dests[attr->out_count].rep = rpriv->rep;
 				attr->dests[attr->out_count].mdev = out_priv->mdev;
 				attr->out_count++;
-			} else if (encap) {
-				parse_attr->mirred_ifindex[attr->out_count] =
-					out_dev->ifindex;
-				parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
-				if (!parse_attr->tun_info[attr->out_count])
-					return -ENOMEM;
-				encap = false;
-				attr->dests[attr->out_count].flags |=
-					MLX5_ESW_DEST_ENCAP;
-				attr->out_count++;
-				/* attr->dests[].rep is resolved when we
-				 * handle encap
-				 */
 			} else if (parse_attr->filter_dev != priv->netdev) {
 				/* All mlx5 devices are called to configure
 				 * high level device filters. Therefore, the
@@ -4000,9 +4000,8 @@ int mlx5e_tc_configure_matchall(struct m
 				struct tc_cls_matchall_offload *ma)
 {
 	struct netlink_ext_ack *extack = ma->common.extack;
-	int prio = TC_H_MAJ(ma->common.prio) >> 16;
 
-	if (prio != 1) {
+	if (ma->common.prio != 1) {
 		NL_SET_ERR_MSG_MOD(extack, "only priority 1 is supported");
 		return -EINVAL;
 	}
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c	2019-11-24 19:32:01.000000000 -0500
@@ -2117,7 +2117,7 @@ int mlx5_eswitch_set_vport_state(struct
 
 unlock:
 	mutex_unlock(&esw->state_lock);
-	return 0;
+	return err;
 }
 
 int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c	2019-11-24 19:32:01.000000000 -0500
@@ -579,7 +579,7 @@ static void del_sw_flow_group(struct fs_
 
 	rhashtable_destroy(&fg->ftes_hash);
 	ida_destroy(&fg->fte_allocator);
-	if (ft->autogroup.active)
+	if (ft->autogroup.active && fg->max_ftes == ft->autogroup.group_size)
 		ft->autogroup.num_groups--;
 	err = rhltable_remove(&ft->fgs_hash,
 			      &fg->hash,
@@ -1126,6 +1126,8 @@ mlx5_create_auto_grouped_flow_table(stru
 
 	ft->autogroup.active = true;
 	ft->autogroup.required_groups = max_num_groups;
+	/* We save place for flow groups in addition to max types */
+	ft->autogroup.group_size = ft->max_fte / (max_num_groups + 1);
 
 	return ft;
 }
@@ -1328,8 +1330,7 @@ static struct mlx5_flow_group *alloc_aut
 		return ERR_PTR(-ENOENT);
 
 	if (ft->autogroup.num_groups < ft->autogroup.required_groups)
-		/* We save place for flow groups in addition to max types */
-		group_size = ft->max_fte / (ft->autogroup.required_groups + 1);
+		group_size = ft->autogroup.group_size;
 
 	/*  ft->max_fte == ft->autogroup.max_types */
 	if (group_size == 0)
@@ -1356,7 +1357,8 @@ static struct mlx5_flow_group *alloc_aut
 	if (IS_ERR(fg))
 		goto out;
 
-	ft->autogroup.num_groups++;
+	if (group_size == ft->autogroup.group_size)
+		ft->autogroup.num_groups++;
 
 out:
 	return fg;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h	2019-11-24 19:32:01.000000000 -0500
@@ -162,6 +162,7 @@ struct mlx5_flow_table {
 	struct {
 		bool			active;
 		unsigned int		required_groups;
+		unsigned int		group_size;
 		unsigned int		num_groups;
 	} autogroup;
 	/* Protect fwd_rules */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/main.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/main.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/main.c	2019-11-24 19:32:01.000000000 -0500
@@ -1566,6 +1566,7 @@ static const struct pci_device_id mlx5_c
 	{ PCI_VDEVICE(MELLANOX, 0x101c), MLX5_PCI_DEV_IS_VF},	/* ConnectX-6 VF */
 	{ PCI_VDEVICE(MELLANOX, 0x101d) },			/* ConnectX-6 Dx */
 	{ PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF},	/* ConnectX Family mlx5Gen Virtual Function */
+	{ PCI_VDEVICE(MELLANOX, 0x101f) },			/* ConnectX-6 LX */
 	{ PCI_VDEVICE(MELLANOX, 0xa2d2) },			/* BlueField integrated ConnectX-5 network controller */
 	{ PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF},	/* BlueField integrated ConnectX-5 network controller VF */
 	{ PCI_VDEVICE(MELLANOX, 0xa2d6) },			/* BlueField-2 integrated ConnectX-6 Dx network controller */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c	2019-11-24 19:32:01.000000000 -0500
@@ -595,6 +595,18 @@ static void dr_rule_clean_rule_members(s
 	}
 }
 
+static u16 dr_get_bits_per_mask(u16 byte_mask)
+{
+	u16 bits = 0;
+
+	while (byte_mask) {
+		byte_mask = byte_mask & (byte_mask - 1);
+		bits++;
+	}
+
+	return bits;
+}
+
 static bool dr_rule_need_enlarge_hash(struct mlx5dr_ste_htbl *htbl,
 				      struct mlx5dr_domain *dmn,
 				      struct mlx5dr_domain_rx_tx *nic_dmn)
@@ -607,6 +619,9 @@ static bool dr_rule_need_enlarge_hash(st
 	if (!ctrl->may_grow)
 		return false;
 
+	if (dr_get_bits_per_mask(htbl->byte_mask) * BITS_PER_BYTE <= htbl->chunk_size)
+		return false;
+
 	if (ctrl->num_of_collisions >= ctrl->increase_threshold &&
 	    (ctrl->num_of_valid_entries - ctrl->num_of_collisions) >= ctrl->increase_threshold)
 		return true;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c	2019-11-24 19:32:01.000000000 -0500
@@ -700,6 +700,7 @@ static struct mlx5dr_cq *dr_create_cq(st
 	unsigned int irqn;
 	void *cqc, *in;
 	__be64 *pas;
+	int vector;
 	u32 i;
 
 	cq = kzalloc(sizeof(*cq), GFP_KERNEL);
@@ -728,7 +729,8 @@ static struct mlx5dr_cq *dr_create_cq(st
 	if (!in)
 		goto err_cqwq;
 
-	err = mlx5_vector2eqn(mdev, smp_processor_id(), &eqn, &irqn);
+	vector = smp_processor_id() % mlx5_comp_vectors_count(mdev);
+	err = mlx5_vector2eqn(mdev, vector, &eqn, &irqn);
 	if (err) {
 		kvfree(in);
 		goto err_cqwq;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c	2019-11-24 19:32:01.000000000 -0500
@@ -560,18 +560,6 @@ bool mlx5dr_ste_not_used_ste(struct mlx5
 	return !refcount_read(&ste->refcount);
 }
 
-static u16 get_bits_per_mask(u16 byte_mask)
-{
-	u16 bits = 0;
-
-	while (byte_mask) {
-		byte_mask = byte_mask & (byte_mask - 1);
-		bits++;
-	}
-
-	return bits;
-}
-
 /* Init one ste as a pattern for ste data array */
 void mlx5dr_ste_set_formatted_ste(u16 gvmi,
 				  struct mlx5dr_domain_rx_tx *nic_dmn,
@@ -620,20 +608,12 @@ int mlx5dr_ste_create_next_htbl(struct m
 	struct mlx5dr_ste_htbl *next_htbl;
 
 	if (!mlx5dr_ste_is_last_in_rule(nic_matcher, ste->ste_chain_location)) {
-		u32 bits_in_mask;
 		u8 next_lu_type;
 		u16 byte_mask;
 
 		next_lu_type = MLX5_GET(ste_general, hw_ste, next_lu_type);
 		byte_mask = MLX5_GET(ste_general, hw_ste, byte_mask);
 
-		/* Don't allocate table more than required,
-		 * the size of the table defined via the byte_mask, so no need
-		 * to allocate more than that.
-		 */
-		bits_in_mask = get_bits_per_mask(byte_mask) * BITS_PER_BYTE;
-		log_table_size = min(log_table_size, bits_in_mask);
-
 		next_htbl = mlx5dr_ste_htbl_alloc(dmn->ste_icm_pool,
 						  log_table_size,
 						  next_lu_type,
@@ -671,7 +651,7 @@ static void dr_ste_set_ctrl(struct mlx5d
 
 	htbl->ctrl.may_grow = true;
 
-	if (htbl->chunk_size == DR_CHUNK_SIZE_MAX - 1)
+	if (htbl->chunk_size == DR_CHUNK_SIZE_MAX - 1 || !htbl->byte_mask)
 		htbl->ctrl.may_grow = false;
 
 	/* Threshold is 50%, one is added to table of size 1 */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c	2019-11-24 19:32:01.000000000 -0500
@@ -66,6 +66,8 @@ retry:
 		return err;
 
 	if (fsm_state_err != MLXFW_FSM_STATE_ERR_OK) {
+		fsm_state_err = min_t(enum mlxfw_fsm_state_err,
+				      fsm_state_err, MLXFW_FSM_STATE_ERR_MAX);
 		pr_err("Firmware flash failed: %s\n",
 		       mlxfw_fsm_state_err_str[fsm_state_err]);
 		NL_SET_ERR_MSG_MOD(extack, "Firmware flash failed");
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c	2019-11-24 19:32:01.000000000 -0500
@@ -994,7 +994,7 @@ u32 mlxsw_sp_ipip_dev_ul_tb_id(const str
 	if (d)
 		return l3mdev_fib_table(d) ? : RT_TABLE_MAIN;
 	else
-		return l3mdev_fib_table(ol_dev) ? : RT_TABLE_MAIN;
+		return RT_TABLE_MAIN;
 }
 
 static struct mlxsw_sp_rif *
@@ -1598,27 +1598,10 @@ static int mlxsw_sp_netdevice_ipip_ol_vr
 {
 	struct mlxsw_sp_ipip_entry *ipip_entry =
 		mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev);
-	enum mlxsw_sp_l3proto ul_proto;
-	union mlxsw_sp_l3addr saddr;
-	u32 ul_tb_id;
 
 	if (!ipip_entry)
 		return 0;
 
-	/* For flat configuration cases, moving overlay to a different VRF might
-	 * cause local address conflict, and the conflicting tunnels need to be
-	 * demoted.
-	 */
-	ul_tb_id = mlxsw_sp_ipip_dev_ul_tb_id(ol_dev);
-	ul_proto = mlxsw_sp->router->ipip_ops_arr[ipip_entry->ipipt]->ul_proto;
-	saddr = mlxsw_sp_ipip_netdev_saddr(ul_proto, ol_dev);
-	if (mlxsw_sp_ipip_demote_tunnel_by_saddr(mlxsw_sp, ul_proto,
-						 saddr, ul_tb_id,
-						 ipip_entry)) {
-		mlxsw_sp_ipip_entry_demote_tunnel(mlxsw_sp, ipip_entry);
-		return 0;
-	}
-
 	return __mlxsw_sp_ipip_entry_update_tunnel(mlxsw_sp, ipip_entry,
 						   true, false, false, extack);
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/qualcomm/qca_spi.c linux-libre-5.4-gnu/drivers/net/ethernet/qualcomm/qca_spi.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/qualcomm/qca_spi.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/qualcomm/qca_spi.c	2019-11-24 19:32:01.000000000 -0500
@@ -363,7 +363,7 @@ qcaspi_receive(struct qcaspi *qca)
 	netdev_dbg(net_dev, "qcaspi_receive: SPI_REG_RDBUF_BYTE_AVA: Value: %08x\n",
 		   available);
 
-	if (available > QCASPI_HW_BUF_LEN) {
+	if (available > QCASPI_HW_BUF_LEN + QCASPI_HW_PKT_LEN) {
 		/* This could only happen by interferences on the SPI line.
 		 * So retry later ...
 		 */
@@ -496,7 +496,6 @@ qcaspi_qca7k_sync(struct qcaspi *qca, in
 	u16 signature = 0;
 	u16 spi_config;
 	u16 wrbuf_space = 0;
-	static u16 reset_count;
 
 	if (event == QCASPI_EVENT_CPUON) {
 		/* Read signature twice, if not valid
@@ -549,13 +548,13 @@ qcaspi_qca7k_sync(struct qcaspi *qca, in
 
 		qca->sync = QCASPI_SYNC_RESET;
 		qca->stats.trig_reset++;
-		reset_count = 0;
+		qca->reset_count = 0;
 		break;
 	case QCASPI_SYNC_RESET:
-		reset_count++;
+		qca->reset_count++;
 		netdev_dbg(qca->net_dev, "sync: waiting for CPU on, count %u.\n",
-			   reset_count);
-		if (reset_count >= QCASPI_RESET_TIMEOUT) {
+			   qca->reset_count);
+		if (qca->reset_count >= QCASPI_RESET_TIMEOUT) {
 			/* reset did not seem to take place, try again */
 			qca->sync = QCASPI_SYNC_UNKNOWN;
 			qca->stats.reset_timeout++;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/qualcomm/qca_spi.h linux-libre-5.4-gnu/drivers/net/ethernet/qualcomm/qca_spi.h
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/qualcomm/qca_spi.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/qualcomm/qca_spi.h	2019-11-24 19:32:01.000000000 -0500
@@ -94,6 +94,7 @@ struct qcaspi {
 
 	unsigned int intr_req;
 	unsigned int intr_svc;
+	u16 reset_count;
 
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *device_root;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/realtek/r8169_main.c linux-libre-5.4-gnu/drivers/net/ethernet/realtek/r8169_main.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/realtek/r8169_main.c	2019-11-17 19:05:02.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/realtek/r8169_main.c	2019-11-24 21:07:35.000000000 -0500
@@ -7160,8 +7160,11 @@ static int rtl_init_one(struct pci_dev *
 		dev->gso_max_segs = RTL_GSO_MAX_SEGS_V1;
 	}
 
-	/* RTL8168e-vl has a HW issue with TSO */
-	if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
+	/* RTL8168e-vl and one RTL8168c variant are known to have a
+	 * HW issue with TSO.
+	 */
+	if (tp->mac_version == RTL_GIGA_MAC_VER_34 ||
+	    tp->mac_version == RTL_GIGA_MAC_VER_22) {
 		dev->vlan_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
 		dev->hw_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
 		dev->features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/ethernet/sfc/ptp.c linux-libre-5.4-gnu/drivers/net/ethernet/sfc/ptp.c
--- linux-libre-5.4-rc8-gnu/drivers/net/ethernet/sfc/ptp.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/ethernet/sfc/ptp.c	2019-11-24 19:32:01.000000000 -0500
@@ -1531,7 +1531,8 @@ void efx_ptp_remove(struct efx_nic *efx)
 	(void)efx_ptp_disable(efx);
 
 	cancel_work_sync(&efx->ptp_data->work);
-	cancel_work_sync(&efx->ptp_data->pps_work);
+	if (efx->ptp_data->pps_workwq)
+		cancel_work_sync(&efx->ptp_data->pps_work);
 
 	skb_queue_purge(&efx->ptp_data->rxq);
 	skb_queue_purge(&efx->ptp_data->txq);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/hyperv/hyperv_net.h linux-libre-5.4-gnu/drivers/net/hyperv/hyperv_net.h
--- linux-libre-5.4-rc8-gnu/drivers/net/hyperv/hyperv_net.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/hyperv/hyperv_net.h	2019-11-24 19:32:01.000000000 -0500
@@ -609,7 +609,8 @@ struct nvsp_5_send_indirect_table {
 	/* The number of entries in the send indirection table */
 	u32 count;
 
-	/* The offset of the send indirection table from top of this struct.
+	/* The offset of the send indirection table from the beginning of
+	 * struct nvsp_message.
 	 * The send indirection table tells which channel to put the send
 	 * traffic on. Each entry is a channel number.
 	 */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/hyperv/netvsc.c linux-libre-5.4-gnu/drivers/net/hyperv/netvsc.c
--- linux-libre-5.4-rc8-gnu/drivers/net/hyperv/netvsc.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/hyperv/netvsc.c	2019-11-24 19:32:01.000000000 -0500
@@ -1178,20 +1178,39 @@ static int netvsc_receive(struct net_dev
 }
 
 static void netvsc_send_table(struct net_device *ndev,
-			      const struct nvsp_message *nvmsg)
+			      struct netvsc_device *nvscdev,
+			      const struct nvsp_message *nvmsg,
+			      u32 msglen)
 {
 	struct net_device_context *net_device_ctx = netdev_priv(ndev);
-	u32 count, *tab;
+	u32 count, offset, *tab;
 	int i;
 
 	count = nvmsg->msg.v5_msg.send_table.count;
+	offset = nvmsg->msg.v5_msg.send_table.offset;
+
 	if (count != VRSS_SEND_TAB_SIZE) {
 		netdev_err(ndev, "Received wrong send-table size:%u\n", count);
 		return;
 	}
 
-	tab = (u32 *)((unsigned long)&nvmsg->msg.v5_msg.send_table +
-		      nvmsg->msg.v5_msg.send_table.offset);
+	/* If negotiated version <= NVSP_PROTOCOL_VERSION_6, the offset may be
+	 * wrong due to a host bug. So fix the offset here.
+	 */
+	if (nvscdev->nvsp_version <= NVSP_PROTOCOL_VERSION_6 &&
+	    msglen >= sizeof(struct nvsp_message_header) +
+	    sizeof(union nvsp_6_message_uber) + count * sizeof(u32))
+		offset = sizeof(struct nvsp_message_header) +
+			 sizeof(union nvsp_6_message_uber);
+
+	/* Boundary check for all versions */
+	if (offset > msglen - count * sizeof(u32)) {
+		netdev_err(ndev, "Received send-table offset too big:%u\n",
+			   offset);
+		return;
+	}
+
+	tab = (void *)nvmsg + offset;
 
 	for (i = 0; i < count; i++)
 		net_device_ctx->tx_table[i] = tab[i];
@@ -1209,12 +1228,14 @@ static void netvsc_send_vf(struct net_de
 		    net_device_ctx->vf_alloc ? "added" : "removed");
 }
 
-static  void netvsc_receive_inband(struct net_device *ndev,
-				   const struct nvsp_message *nvmsg)
+static void netvsc_receive_inband(struct net_device *ndev,
+				  struct netvsc_device *nvscdev,
+				  const struct nvsp_message *nvmsg,
+				  u32 msglen)
 {
 	switch (nvmsg->hdr.msg_type) {
 	case NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE:
-		netvsc_send_table(ndev, nvmsg);
+		netvsc_send_table(ndev, nvscdev, nvmsg, msglen);
 		break;
 
 	case NVSP_MSG4_TYPE_SEND_VF_ASSOCIATION:
@@ -1232,6 +1253,7 @@ static int netvsc_process_raw_pkt(struct
 {
 	struct vmbus_channel *channel = nvchan->channel;
 	const struct nvsp_message *nvmsg = hv_pkt_data(desc);
+	u32 msglen = hv_pkt_datalen(desc);
 
 	trace_nvsp_recv(ndev, channel, nvmsg);
 
@@ -1247,7 +1269,7 @@ static int netvsc_process_raw_pkt(struct
 		break;
 
 	case VM_PKT_DATA_INBAND:
-		netvsc_receive_inband(ndev, nvmsg);
+		netvsc_receive_inband(ndev, net_device, nvmsg, msglen);
 		break;
 
 	default:
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/phy/mdio_bus.c linux-libre-5.4-gnu/drivers/net/phy/mdio_bus.c
--- linux-libre-5.4-rc8-gnu/drivers/net/phy/mdio_bus.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/phy/mdio_bus.c	2019-11-24 19:32:01.000000000 -0500
@@ -65,7 +65,7 @@ static int mdiobus_register_reset(struct
 		reset = devm_reset_control_get_exclusive(&mdiodev->dev,
 							 "phy");
 	if (IS_ERR(reset)) {
-		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOSYS)
+		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOTSUPP)
 			reset = NULL;
 		else
 			return PTR_ERR(reset);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/phy/mdio-sun4i.c linux-libre-5.4-gnu/drivers/net/phy/mdio-sun4i.c
--- linux-libre-5.4-rc8-gnu/drivers/net/phy/mdio-sun4i.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/phy/mdio-sun4i.c	2019-11-24 19:32:01.000000000 -0500
@@ -145,8 +145,11 @@ err_out_free_mdiobus:
 static int sun4i_mdio_remove(struct platform_device *pdev)
 {
 	struct mii_bus *bus = platform_get_drvdata(pdev);
+	struct sun4i_mdio_data *data = bus->priv;
 
 	mdiobus_unregister(bus);
+	if (data->regulator)
+		regulator_disable(data->regulator);
 	mdiobus_free(bus);
 
 	return 0;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/phy/phylink.c linux-libre-5.4-gnu/drivers/net/phy/phylink.c
--- linux-libre-5.4-rc8-gnu/drivers/net/phy/phylink.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/phy/phylink.c	2019-11-24 19:32:01.000000000 -0500
@@ -601,6 +601,8 @@ static int phylink_register_sfp(struct p
  * Create a new phylink instance, and parse the link parameters found in @np.
  * This will parse in-band modes, fixed-link or SFP configuration.
  *
+ * Note: the rtnl lock must not be held when calling this function.
+ *
  * Returns a pointer to a &struct phylink, or an error-pointer value. Users
  * must use IS_ERR() to check for errors from this function.
  */
@@ -678,6 +680,8 @@ EXPORT_SYMBOL_GPL(phylink_create);
  *
  * Destroy a phylink instance. Any PHY that has been attached must have been
  * cleaned up via phylink_disconnect_phy() prior to calling this function.
+ *
+ * Note: the rtnl lock must not be held when calling this function.
  */
 void phylink_destroy(struct phylink *pl)
 {
@@ -1254,7 +1258,13 @@ int phylink_ethtool_ksettings_set(struct
 	pl->link_config.duplex = our_kset.base.duplex;
 	pl->link_config.an_enabled = our_kset.base.autoneg != AUTONEG_DISABLE;
 
-	if (!test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state)) {
+	/* If we have a PHY, phylib will call our link state function if the
+	 * mode has changed, which will trigger a resolve and update the MAC
+	 * configuration. For a fixed link, this isn't able to change any
+	 * parameters, which just leaves inband mode.
+	 */
+	if (pl->link_an_mode == MLO_AN_INBAND &&
+	    !test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state)) {
 		phylink_mac_config(pl, &pl->link_config);
 		phylink_mac_an_restart(pl);
 	}
@@ -1334,15 +1344,16 @@ int phylink_ethtool_set_pauseparam(struc
 	if (pause->tx_pause)
 		config->pause |= MLO_PAUSE_TX;
 
-	if (!test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state)) {
+	/* If we have a PHY, phylib will call our link state function if the
+	 * mode has changed, which will trigger a resolve and update the MAC
+	 * configuration.
+	 */
+	if (pl->phydev) {
+		phy_set_asym_pause(pl->phydev, pause->rx_pause,
+				   pause->tx_pause);
+	} else if (!test_bit(PHYLINK_DISABLE_STOPPED,
+			     &pl->phylink_disable_state)) {
 		switch (pl->link_an_mode) {
-		case MLO_AN_PHY:
-			/* Silently mark the carrier down, and then trigger a resolve */
-			if (pl->netdev)
-				netif_carrier_off(pl->netdev);
-			phylink_run_resolve(pl);
-			break;
-
 		case MLO_AN_FIXED:
 			/* Should we allow fixed links to change against the config? */
 			phylink_resolve_flow(pl, config);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/net/usb/r8152.c linux-libre-5.4-gnu/drivers/net/usb/r8152.c
--- linux-libre-5.4-rc8-gnu/drivers/net/usb/r8152.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/net/usb/r8152.c	2019-11-24 19:32:01.000000000 -0500
@@ -4283,10 +4283,10 @@ static int rtl8152_close(struct net_devi
 	unregister_pm_notifier(&tp->pm_notifier);
 #endif
 	tasklet_disable(&tp->tx_tl);
-	napi_disable(&tp->napi);
 	clear_bit(WORK_ENABLE, &tp->flags);
 	usb_kill_urb(tp->intr_urb);
 	cancel_delayed_work_sync(&tp->schedule);
+	napi_disable(&tp->napi);
 	netif_stop_queue(netdev);
 
 	res = usb_autopm_get_interface(tp->intf);
@@ -4552,10 +4552,10 @@ static int rtl8152_pre_reset(struct usb_
 
 	netif_stop_queue(netdev);
 	tasklet_disable(&tp->tx_tl);
-	napi_disable(&tp->napi);
 	clear_bit(WORK_ENABLE, &tp->flags);
 	usb_kill_urb(tp->intr_urb);
 	cancel_delayed_work_sync(&tp->schedule);
+	napi_disable(&tp->napi);
 	if (netif_carrier_ok(netdev)) {
 		mutex_lock(&tp->control);
 		tp->rtl_ops.disable(tp);
@@ -4673,7 +4673,7 @@ static int rtl8152_system_resume(struct
 
 	netif_device_attach(netdev);
 
-	if (netif_running(netdev) && netdev->flags & IFF_UP) {
+	if (netif_running(netdev) && (netdev->flags & IFF_UP)) {
 		tp->rtl_ops.up(tp);
 		netif_carrier_off(netdev);
 		set_bit(WORK_ENABLE, &tp->flags);
@@ -5244,9 +5244,15 @@ static int rtl8152_set_tunable(struct ne
 		}
 
 		if (tp->rx_copybreak != val) {
-			napi_disable(&tp->napi);
-			tp->rx_copybreak = val;
-			napi_enable(&tp->napi);
+			if (netdev->flags & IFF_UP) {
+				mutex_lock(&tp->control);
+				napi_disable(&tp->napi);
+				tp->rx_copybreak = val;
+				napi_enable(&tp->napi);
+				mutex_unlock(&tp->control);
+			} else {
+				tp->rx_copybreak = val;
+			}
 		}
 		break;
 	default:
@@ -5274,9 +5280,15 @@ static int rtl8152_set_ringparam(struct
 		return -EINVAL;
 
 	if (tp->rx_pending != ring->rx_pending) {
-		napi_disable(&tp->napi);
-		tp->rx_pending = ring->rx_pending;
-		napi_enable(&tp->napi);
+		if (netdev->flags & IFF_UP) {
+			mutex_lock(&tp->control);
+			napi_disable(&tp->napi);
+			tp->rx_pending = ring->rx_pending;
+			napi_enable(&tp->napi);
+			mutex_unlock(&tp->control);
+		} else {
+			tp->rx_pending = ring->rx_pending;
+		}
 	}
 
 	return 0;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/nfc/port100.c linux-libre-5.4-gnu/drivers/nfc/port100.c
--- linux-libre-5.4-rc8-gnu/drivers/nfc/port100.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/nfc/port100.c	2019-11-24 19:32:01.000000000 -0500
@@ -783,7 +783,7 @@ static int port100_send_frame_async(stru
 
 	rc = port100_submit_urb_for_ack(dev, GFP_KERNEL);
 	if (rc)
-		usb_unlink_urb(dev->out_urb);
+		usb_kill_urb(dev->out_urb);
 
 exit:
 	mutex_unlock(&dev->out_urb_lock);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_core.h linux-libre-5.4-gnu/drivers/s390/net/qeth_core.h
--- linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_core.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/s390/net/qeth_core.h	2019-11-24 19:32:01.000000000 -0500
@@ -839,6 +839,7 @@ struct qeth_card {
 	struct service_level qeth_service_level;
 	struct qdio_ssqd_desc ssqd;
 	debug_info_t *debug;
+	struct mutex sbp_lock;
 	struct mutex conf_mutex;
 	struct mutex discipline_mutex;
 	struct napi_struct napi;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_core_main.c linux-libre-5.4-gnu/drivers/s390/net/qeth_core_main.c
--- linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_core_main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/s390/net/qeth_core_main.c	2019-11-24 19:32:01.000000000 -0500
@@ -901,30 +901,30 @@ static int qeth_get_problem(struct qeth_
 				 CCW_DEVID(cdev), dstat, cstat);
 		print_hex_dump(KERN_WARNING, "qeth: irb ", DUMP_PREFIX_OFFSET,
 				16, 1, irb, 64, 1);
-		return 1;
+		return -EIO;
 	}
 
 	if (dstat & DEV_STAT_UNIT_CHECK) {
 		if (sense[SENSE_RESETTING_EVENT_BYTE] &
 		    SENSE_RESETTING_EVENT_FLAG) {
 			QETH_CARD_TEXT(card, 2, "REVIND");
-			return 1;
+			return -EIO;
 		}
 		if (sense[SENSE_COMMAND_REJECT_BYTE] &
 		    SENSE_COMMAND_REJECT_FLAG) {
 			QETH_CARD_TEXT(card, 2, "CMDREJi");
-			return 1;
+			return -EIO;
 		}
 		if ((sense[2] == 0xaf) && (sense[3] == 0xfe)) {
 			QETH_CARD_TEXT(card, 2, "AFFE");
-			return 1;
+			return -EIO;
 		}
 		if ((!sense[0]) && (!sense[1]) && (!sense[2]) && (!sense[3])) {
 			QETH_CARD_TEXT(card, 2, "ZEROSEN");
 			return 0;
 		}
 		QETH_CARD_TEXT(card, 2, "DGENCHK");
-			return 1;
+			return -EIO;
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_l2_main.c linux-libre-5.4-gnu/drivers/s390/net/qeth_l2_main.c
--- linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_l2_main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/s390/net/qeth_l2_main.c	2019-11-24 19:32:01.000000000 -0500
@@ -467,10 +467,14 @@ static void qeth_l2_set_promisc_mode(str
 	if (card->info.promisc_mode == enable)
 		return;
 
-	if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE))
+	if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) {
 		qeth_setadp_promisc_mode(card, enable);
-	else if (card->options.sbp.reflect_promisc)
-		qeth_l2_promisc_to_bridge(card, enable);
+	} else {
+		mutex_lock(&card->sbp_lock);
+		if (card->options.sbp.reflect_promisc)
+			qeth_l2_promisc_to_bridge(card, enable);
+		mutex_unlock(&card->sbp_lock);
+	}
 }
 
 /* New MAC address is added to the hash table and marked to be written on card
@@ -631,6 +635,7 @@ static int qeth_l2_probe_device(struct c
 	int rc;
 
 	qeth_l2_vnicc_set_defaults(card);
+	mutex_init(&card->sbp_lock);
 
 	if (gdev->dev.type == &qeth_generic_devtype) {
 		rc = qeth_l2_create_device_attributes(&gdev->dev);
@@ -804,10 +809,12 @@ static int qeth_l2_set_online(struct ccw
 	} else
 		card->info.hwtrap = 0;
 
+	mutex_lock(&card->sbp_lock);
 	qeth_bridgeport_query_support(card);
 	if (card->options.sbp.supported_funcs)
 		dev_info(&card->gdev->dev,
 		"The device represents a Bridge Capable Port\n");
+	mutex_unlock(&card->sbp_lock);
 
 	qeth_l2_register_dev_addr(card);
 
@@ -1162,9 +1169,9 @@ static void qeth_bridge_state_change_wor
 
 	/* Role should not change by itself, but if it did, */
 	/* information from the hardware is authoritative.  */
-	mutex_lock(&data->card->conf_mutex);
+	mutex_lock(&data->card->sbp_lock);
 	data->card->options.sbp.role = entry->role;
-	mutex_unlock(&data->card->conf_mutex);
+	mutex_unlock(&data->card->sbp_lock);
 
 	snprintf(env_locrem, sizeof(env_locrem), "BRIDGEPORT=statechange");
 	snprintf(env_role, sizeof(env_role), "ROLE=%s",
@@ -1230,9 +1237,9 @@ static void qeth_bridge_host_event_worke
 			: (data->hostevs.lost_event_mask == 0x02)
 			? "Bridge port state change"
 			: "Unknown reason");
-		mutex_lock(&data->card->conf_mutex);
+		mutex_lock(&data->card->sbp_lock);
 		data->card->options.sbp.hostnotification = 0;
-		mutex_unlock(&data->card->conf_mutex);
+		mutex_unlock(&data->card->sbp_lock);
 		qeth_bridge_emit_host_event(data->card, anev_abort,
 			0, NULL, NULL);
 	} else
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_l2_sys.c linux-libre-5.4-gnu/drivers/s390/net/qeth_l2_sys.c
--- linux-libre-5.4-rc8-gnu/drivers/s390/net/qeth_l2_sys.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/s390/net/qeth_l2_sys.c	2019-11-24 19:32:01.000000000 -0500
@@ -24,6 +24,7 @@ static ssize_t qeth_bridge_port_role_sta
 	if (qeth_l2_vnicc_is_in_use(card))
 		return sprintf(buf, "n/a (VNIC characteristics)\n");
 
+	mutex_lock(&card->sbp_lock);
 	if (qeth_card_hw_is_reachable(card) &&
 					card->options.sbp.supported_funcs)
 		rc = qeth_bridgeport_query_ports(card,
@@ -57,6 +58,7 @@ static ssize_t qeth_bridge_port_role_sta
 		else
 			rc = sprintf(buf, "%s\n", word);
 	}
+	mutex_unlock(&card->sbp_lock);
 
 	return rc;
 }
@@ -91,6 +93,7 @@ static ssize_t qeth_bridge_port_role_sto
 		return -EINVAL;
 
 	mutex_lock(&card->conf_mutex);
+	mutex_lock(&card->sbp_lock);
 
 	if (qeth_l2_vnicc_is_in_use(card))
 		rc = -EBUSY;
@@ -104,6 +107,7 @@ static ssize_t qeth_bridge_port_role_sto
 	} else
 		card->options.sbp.role = role;
 
+	mutex_unlock(&card->sbp_lock);
 	mutex_unlock(&card->conf_mutex);
 
 	return rc ? rc : count;
@@ -158,6 +162,7 @@ static ssize_t qeth_bridgeport_hostnotif
 		return rc;
 
 	mutex_lock(&card->conf_mutex);
+	mutex_lock(&card->sbp_lock);
 
 	if (qeth_l2_vnicc_is_in_use(card))
 		rc = -EBUSY;
@@ -168,6 +173,7 @@ static ssize_t qeth_bridgeport_hostnotif
 	} else
 		card->options.sbp.hostnotification = enable;
 
+	mutex_unlock(&card->sbp_lock);
 	mutex_unlock(&card->conf_mutex);
 
 	return rc ? rc : count;
@@ -223,6 +229,7 @@ static ssize_t qeth_bridgeport_reflect_s
 		return -EINVAL;
 
 	mutex_lock(&card->conf_mutex);
+	mutex_lock(&card->sbp_lock);
 
 	if (qeth_l2_vnicc_is_in_use(card))
 		rc = -EBUSY;
@@ -234,6 +241,7 @@ static ssize_t qeth_bridgeport_reflect_s
 		rc = 0;
 	}
 
+	mutex_unlock(&card->sbp_lock);
 	mutex_unlock(&card->conf_mutex);
 
 	return rc ? rc : count;
@@ -269,6 +277,8 @@ void qeth_l2_setup_bridgeport_attrs(stru
 		return;
 	if (!card->options.sbp.supported_funcs)
 		return;
+
+	mutex_lock(&card->sbp_lock);
 	if (card->options.sbp.role != QETH_SBP_ROLE_NONE) {
 		/* Conditional to avoid spurious error messages */
 		qeth_bridgeport_setrole(card, card->options.sbp.role);
@@ -280,8 +290,10 @@ void qeth_l2_setup_bridgeport_attrs(stru
 		rc = qeth_bridgeport_an_set(card, 1);
 		if (rc)
 			card->options.sbp.hostnotification = 0;
-	} else
+	} else {
 		qeth_bridgeport_an_set(card, 0);
+	}
+	mutex_unlock(&card->sbp_lock);
 }
 
 /* VNIC CHARS support */
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/virtio/virtio_balloon.c linux-libre-5.4-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-5.4-rc8-gnu/drivers/virtio/virtio_balloon.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/virtio/virtio_balloon.c	2019-11-24 19:32:01.000000000 -0500
@@ -772,6 +772,13 @@ static unsigned long shrink_free_pages(s
 	return blocks_freed << VIRTIO_BALLOON_FREE_PAGE_ORDER;
 }
 
+static unsigned long leak_balloon_pages(struct virtio_balloon *vb,
+                                          unsigned long pages_to_free)
+{
+	return leak_balloon(vb, pages_to_free * VIRTIO_BALLOON_PAGES_PER_PAGE) /
+		VIRTIO_BALLOON_PAGES_PER_PAGE;
+}
+
 static unsigned long shrink_balloon_pages(struct virtio_balloon *vb,
 					  unsigned long pages_to_free)
 {
@@ -782,11 +789,10 @@ static unsigned long shrink_balloon_page
 	 * VIRTIO_BALLOON_ARRAY_PFNS_MAX balloon pages, so we call it
 	 * multiple times to deflate pages till reaching pages_to_free.
 	 */
-	while (vb->num_pages && pages_to_free) {
-		pages_freed += leak_balloon(vb, pages_to_free) /
-					VIRTIO_BALLOON_PAGES_PER_PAGE;
-		pages_to_free -= pages_freed;
-	}
+	while (vb->num_pages && pages_freed < pages_to_free)
+		pages_freed += leak_balloon_pages(vb,
+						  pages_to_free - pages_freed);
+
 	update_balloon_size(vb);
 
 	return pages_freed;
@@ -799,7 +805,7 @@ static unsigned long virtio_balloon_shri
 	struct virtio_balloon *vb = container_of(shrinker,
 					struct virtio_balloon, shrinker);
 
-	pages_to_free = sc->nr_to_scan * VIRTIO_BALLOON_PAGES_PER_PAGE;
+	pages_to_free = sc->nr_to_scan;
 
 	if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
 		pages_freed = shrink_free_pages(vb, pages_to_free);
@@ -820,7 +826,7 @@ static unsigned long virtio_balloon_shri
 	unsigned long count;
 
 	count = vb->num_pages / VIRTIO_BALLOON_PAGES_PER_PAGE;
-	count += vb->num_free_page_blocks >> VIRTIO_BALLOON_FREE_PAGE_ORDER;
+	count += vb->num_free_page_blocks << VIRTIO_BALLOON_FREE_PAGE_ORDER;
 
 	return count;
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/drivers/virtio/virtio_ring.c linux-libre-5.4-gnu/drivers/virtio/virtio_ring.c
--- linux-libre-5.4-rc8-gnu/drivers/virtio/virtio_ring.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/drivers/virtio/virtio_ring.c	2019-11-24 19:32:01.000000000 -0500
@@ -583,7 +583,7 @@ unmap_release:
 		kfree(desc);
 
 	END_USE(vq);
-	return -EIO;
+	return -ENOMEM;
 }
 
 static bool virtqueue_kick_prepare_split(struct virtqueue *_vq)
@@ -1085,7 +1085,7 @@ unmap_release:
 	kfree(desc);
 
 	END_USE(vq);
-	return -EIO;
+	return -ENOMEM;
 }
 
 static inline int virtqueue_add_packed(struct virtqueue *_vq,
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/fs/afs/callback.c linux-libre-5.4-gnu/fs/afs/callback.c
--- linux-libre-5.4-rc8-gnu/fs/afs/callback.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/fs/afs/callback.c	2019-11-24 19:32:01.000000000 -0500
@@ -312,7 +312,6 @@ void afs_break_callbacks(struct afs_serv
 	_enter("%p,%zu,", server, count);
 
 	ASSERT(server != NULL);
-	ASSERTCMP(count, <=, AFSCBMAX);
 
 	/* TODO: Sort the callback break list by volume ID */
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/fs/afs/rxrpc.c linux-libre-5.4-gnu/fs/afs/rxrpc.c
--- linux-libre-5.4-rc8-gnu/fs/afs/rxrpc.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/fs/afs/rxrpc.c	2019-11-24 19:32:01.000000000 -0500
@@ -637,6 +637,7 @@ long afs_wait_for_call_to_complete(struc
 			call->need_attention = false;
 			__set_current_state(TASK_RUNNING);
 			afs_deliver_to_call(call);
+			timeout = rtt2;
 			continue;
 		}
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/fs/afs/super.c linux-libre-5.4-gnu/fs/afs/super.c
--- linux-libre-5.4-rc8-gnu/fs/afs/super.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/fs/afs/super.c	2019-11-24 19:32:01.000000000 -0500
@@ -435,6 +435,7 @@ static int afs_fill_super(struct super_b
 	/* fill in the superblock */
 	sb->s_blocksize		= PAGE_SIZE;
 	sb->s_blocksize_bits	= PAGE_SHIFT;
+	sb->s_maxbytes		= MAX_LFS_FILESIZE;
 	sb->s_magic		= AFS_FS_MAGIC;
 	sb->s_op		= &afs_super_ops;
 	if (!as->dyn_root)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/fs/cramfs/inode.c linux-libre-5.4-gnu/fs/cramfs/inode.c
--- linux-libre-5.4-rc8-gnu/fs/cramfs/inode.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/fs/cramfs/inode.c	2019-11-24 19:32:01.000000000 -0500
@@ -958,8 +958,8 @@ static int cramfs_get_tree(struct fs_con
 
 	if (IS_ENABLED(CONFIG_CRAMFS_MTD)) {
 		ret = get_tree_mtd(fc, cramfs_mtd_fill_super);
-		if (ret < 0)
-			return ret;
+		if (!ret)
+			return 0;
 	}
 	if (IS_ENABLED(CONFIG_CRAMFS_BLOCKDEV))
 		ret = get_tree_bdev(fc, cramfs_blkdev_fill_super);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/fs/ocfs2/xattr.c linux-libre-5.4-gnu/fs/ocfs2/xattr.c
--- linux-libre-5.4-rc8-gnu/fs/ocfs2/xattr.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/fs/ocfs2/xattr.c	2019-11-24 19:32:01.000000000 -0500
@@ -1490,6 +1490,18 @@ static int ocfs2_xa_check_space(struct o
 	return loc->xl_ops->xlo_check_space(loc, xi);
 }
 
+static void ocfs2_xa_add_entry(struct ocfs2_xa_loc *loc, u32 name_hash)
+{
+	loc->xl_ops->xlo_add_entry(loc, name_hash);
+	loc->xl_entry->xe_name_hash = cpu_to_le32(name_hash);
+	/*
+	 * We can't leave the new entry's xe_name_offset at zero or
+	 * add_namevalue() will go nuts.  We set it to the size of our
+	 * storage so that it can never be less than any other entry.
+	 */
+	loc->xl_entry->xe_name_offset = cpu_to_le16(loc->xl_size);
+}
+
 static void ocfs2_xa_add_namevalue(struct ocfs2_xa_loc *loc,
 				   struct ocfs2_xattr_info *xi)
 {
@@ -2121,31 +2133,29 @@ static int ocfs2_xa_prepare_entry(struct
 	if (rc)
 		goto out;
 
-	if (!loc->xl_entry) {
-		rc = -EINVAL;
-		goto out;
-	}
-
-	if (ocfs2_xa_can_reuse_entry(loc, xi)) {
-		orig_value_size = loc->xl_entry->xe_value_size;
-		rc = ocfs2_xa_reuse_entry(loc, xi, ctxt);
-		if (rc)
-			goto out;
-		goto alloc_value;
-	}
+	if (loc->xl_entry) {
+		if (ocfs2_xa_can_reuse_entry(loc, xi)) {
+			orig_value_size = loc->xl_entry->xe_value_size;
+			rc = ocfs2_xa_reuse_entry(loc, xi, ctxt);
+			if (rc)
+				goto out;
+			goto alloc_value;
+		}
 
-	if (!ocfs2_xattr_is_local(loc->xl_entry)) {
-		orig_clusters = ocfs2_xa_value_clusters(loc);
-		rc = ocfs2_xa_value_truncate(loc, 0, ctxt);
-		if (rc) {
-			mlog_errno(rc);
-			ocfs2_xa_cleanup_value_truncate(loc,
-							"overwriting",
-							orig_clusters);
-			goto out;
+		if (!ocfs2_xattr_is_local(loc->xl_entry)) {
+			orig_clusters = ocfs2_xa_value_clusters(loc);
+			rc = ocfs2_xa_value_truncate(loc, 0, ctxt);
+			if (rc) {
+				mlog_errno(rc);
+				ocfs2_xa_cleanup_value_truncate(loc,
+								"overwriting",
+								orig_clusters);
+				goto out;
+			}
 		}
-	}
-	ocfs2_xa_wipe_namevalue(loc);
+		ocfs2_xa_wipe_namevalue(loc);
+	} else
+		ocfs2_xa_add_entry(loc, name_hash);
 
 	/*
 	 * If we get here, we have a blank entry.  Fill it.  We grow our
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/include/linux/skbuff.h linux-libre-5.4-gnu/include/linux/skbuff.h
--- linux-libre-5.4-rc8-gnu/include/linux/skbuff.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/include/linux/skbuff.h	2019-11-24 19:32:01.000000000 -0500
@@ -4169,12 +4169,18 @@ static inline void skb_ext_reset(struct
 		skb->active_extensions = 0;
 	}
 }
+
+static inline bool skb_has_extensions(struct sk_buff *skb)
+{
+	return unlikely(skb->active_extensions);
+}
 #else
 static inline void skb_ext_put(struct sk_buff *skb) {}
 static inline void skb_ext_reset(struct sk_buff *skb) {}
 static inline void skb_ext_del(struct sk_buff *skb, int unused) {}
 static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}
 static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}
+static inline bool skb_has_extensions(struct sk_buff *skb) { return false; }
 #endif /* CONFIG_SKB_EXTENSIONS */
 
 static inline void nf_reset_ct(struct sk_buff *skb)
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/include/net/tls.h linux-libre-5.4-gnu/include/net/tls.h
--- linux-libre-5.4-rc8-gnu/include/net/tls.h	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/include/net/tls.h	2019-11-24 19:32:01.000000000 -0500
@@ -356,6 +356,8 @@ int tls_set_sw_offload(struct sock *sk,
 void tls_sw_strparser_arm(struct sock *sk, struct tls_context *ctx);
 void tls_sw_strparser_done(struct tls_context *tls_ctx);
 int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
+int tls_sw_sendpage_locked(struct sock *sk, struct page *page,
+			   int offset, size_t size, int flags);
 int tls_sw_sendpage(struct sock *sk, struct page *page,
 		    int offset, size_t size, int flags);
 void tls_sw_cancel_work_tx(struct tls_context *tls_ctx);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/kernel/bpf/offload.c linux-libre-5.4-gnu/kernel/bpf/offload.c
--- linux-libre-5.4-rc8-gnu/kernel/bpf/offload.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/kernel/bpf/offload.c	2019-11-24 19:32:01.000000000 -0500
@@ -678,8 +678,10 @@ bpf_offload_dev_create(const struct bpf_
 	down_write(&bpf_devs_lock);
 	if (!offdevs_inited) {
 		err = rhashtable_init(&offdevs, &offdevs_params);
-		if (err)
+		if (err) {
+			up_write(&bpf_devs_lock);
 			return ERR_PTR(err);
+		}
 		offdevs_inited = true;
 	}
 	up_write(&bpf_devs_lock);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/kernel/fork.c linux-libre-5.4-gnu/kernel/fork.c
--- linux-libre-5.4-rc8-gnu/kernel/fork.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/kernel/fork.c	2019-11-24 19:32:01.000000000 -0500
@@ -1708,11 +1708,11 @@ static void pidfd_show_fdinfo(struct seq
 /*
  * Poll support for process exit notification.
  */
-static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts)
+static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts)
 {
 	struct task_struct *task;
 	struct pid *pid = file->private_data;
-	int poll_flags = 0;
+	__poll_t poll_flags = 0;
 
 	poll_wait(file, &pid->wait_pidfd, pts);
 
@@ -1724,7 +1724,7 @@ static unsigned int pidfd_poll(struct fi
 	 * group, then poll(2) should block, similar to the wait(2) family.
 	 */
 	if (!task || (task->exit_state && thread_group_empty(task)))
-		poll_flags = POLLIN | POLLRDNORM;
+		poll_flags = EPOLLIN | EPOLLRDNORM;
 	rcu_read_unlock();
 
 	return poll_flags;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/kernel/power/qos.c linux-libre-5.4-gnu/kernel/power/qos.c
--- linux-libre-5.4-rc8-gnu/kernel/power/qos.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/kernel/power/qos.c	2019-11-24 19:32:01.000000000 -0500
@@ -814,6 +814,8 @@ EXPORT_SYMBOL_GPL(freq_qos_update_reques
  */
 int freq_qos_remove_request(struct freq_qos_request *req)
 {
+	int ret;
+
 	if (!req)
 		return -EINVAL;
 
@@ -821,7 +823,11 @@ int freq_qos_remove_request(struct freq_
 		 "%s() called for unknown object\n", __func__))
 		return -EINVAL;
 
-	return freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
+	ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
+	req->qos = NULL;
+	req->type = 0;
+
+	return ret;
 }
 EXPORT_SYMBOL_GPL(freq_qos_remove_request);
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/MAINTAINERS linux-libre-5.4-gnu/MAINTAINERS
--- linux-libre-5.4-rc8-gnu/MAINTAINERS	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/MAINTAINERS	2019-11-24 19:32:01.000000000 -0500
@@ -643,7 +643,7 @@ F:	drivers/net/ethernet/alacritech/*
 
 FORCEDETH GIGABIT ETHERNET DRIVER
 M:	Rain River <rain.1986.08.12@gmail.com>
-M:	Zhu Yanjun <yanjun.zhu@oracle.com>
+M:	Zhu Yanjun <zyjzyj2000@gmail.com>
 L:	netdev@vger.kernel.org
 S:	Maintained
 F:	drivers/net/ethernet/nvidia/*
@@ -17215,6 +17215,7 @@ F:	virt/lib/
 
 VIRTIO AND VHOST VSOCK DRIVER
 M:	Stefan Hajnoczi <stefanha@redhat.com>
+M:	Stefano Garzarella <sgarzare@redhat.com>
 L:	kvm@vger.kernel.org
 L:	virtualization@lists.linux-foundation.org
 L:	netdev@vger.kernel.org
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/Makefile linux-libre-5.4-gnu/Makefile
--- linux-libre-5.4-rc8-gnu/Makefile	2019-11-17 18:49:31.000000000 -0500
+++ linux-libre-5.4-gnu/Makefile	2019-11-24 20:49:59.000000000 -0500
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 4
 SUBLEVEL = 0
-EXTRAVERSION = -rc8-gnu
+EXTRAVERSION = -gnu
 NAME = Kleptomaniac Octopus
 
 # *DOCUMENTATION*
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/mm/ksm.c linux-libre-5.4-gnu/mm/ksm.c
--- linux-libre-5.4-rc8-gnu/mm/ksm.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/mm/ksm.c	2019-11-24 19:32:01.000000000 -0500
@@ -885,13 +885,13 @@ static int remove_stable_node(struct sta
 		return 0;
 	}
 
-	if (WARN_ON_ONCE(page_mapped(page))) {
-		/*
-		 * This should not happen: but if it does, just refuse to let
-		 * merge_across_nodes be switched - there is no need to panic.
-		 */
-		err = -EBUSY;
-	} else {
+	/*
+	 * Page could be still mapped if this races with __mmput() running in
+	 * between ksm_exit() and exit_mmap(). Just refuse to let
+	 * merge_across_nodes/max_page_sharing be switched.
+	 */
+	err = -EBUSY;
+	if (!page_mapped(page)) {
 		/*
 		 * The stable node did not yet appear stale to get_ksm_page(),
 		 * since that allows for an unmapped ksm page to be recognized
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/mm/memory_hotplug.c linux-libre-5.4-gnu/mm/memory_hotplug.c
--- linux-libre-5.4-rc8-gnu/mm/memory_hotplug.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/mm/memory_hotplug.c	2019-11-24 19:32:01.000000000 -0500
@@ -331,7 +331,7 @@ static unsigned long find_smallest_secti
 				     unsigned long end_pfn)
 {
 	for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SUBSECTION) {
-		if (unlikely(!pfn_valid(start_pfn)))
+		if (unlikely(!pfn_to_online_page(start_pfn)))
 			continue;
 
 		if (unlikely(pfn_to_nid(start_pfn) != nid))
@@ -356,7 +356,7 @@ static unsigned long find_biggest_sectio
 	/* pfn is the end pfn of a memory section. */
 	pfn = end_pfn - 1;
 	for (; pfn >= start_pfn; pfn -= PAGES_PER_SUBSECTION) {
-		if (unlikely(!pfn_valid(pfn)))
+		if (unlikely(!pfn_to_online_page(pfn)))
 			continue;
 
 		if (unlikely(pfn_to_nid(pfn) != nid))
@@ -415,7 +415,7 @@ static void shrink_zone_span(struct zone
 	 */
 	pfn = zone_start_pfn;
 	for (; pfn < zone_end_pfn; pfn += PAGES_PER_SUBSECTION) {
-		if (unlikely(!pfn_valid(pfn)))
+		if (unlikely(!pfn_to_online_page(pfn)))
 			continue;
 
 		if (page_zone(pfn_to_page(pfn)) != zone)
@@ -471,6 +471,16 @@ static void __remove_zone(struct zone *z
 	struct pglist_data *pgdat = zone->zone_pgdat;
 	unsigned long flags;
 
+#ifdef CONFIG_ZONE_DEVICE
+	/*
+	 * Zone shrinking code cannot properly deal with ZONE_DEVICE. So
+	 * we will not try to shrink the zones - which is okay as
+	 * set_zone_contiguous() cannot deal with ZONE_DEVICE either way.
+	 */
+	if (zone_idx(zone) == ZONE_DEVICE)
+		return;
+#endif
+
 	pgdat_resize_lock(zone->zone_pgdat, &flags);
 	shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
 	update_pgdat_span(pgdat);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/atm/clip.c linux-libre-5.4-gnu/net/atm/clip.c
--- linux-libre-5.4-rc8-gnu/net/atm/clip.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/atm/clip.c	2019-11-24 19:32:01.000000000 -0500
@@ -89,7 +89,7 @@ static void unlink_clip_vcc(struct clip_
 	struct clip_vcc **walk;
 
 	if (!entry) {
-		pr_crit("!clip_vcc->entry (clip_vcc %p)\n", clip_vcc);
+		pr_err("!clip_vcc->entry (clip_vcc %p)\n", clip_vcc);
 		return;
 	}
 	netif_tx_lock_bh(entry->neigh->dev);	/* block clip_start_xmit() */
@@ -109,10 +109,10 @@ static void unlink_clip_vcc(struct clip_
 			error = neigh_update(entry->neigh, NULL, NUD_NONE,
 					     NEIGH_UPDATE_F_ADMIN, 0);
 			if (error)
-				pr_crit("neigh_update failed with %d\n", error);
+				pr_err("neigh_update failed with %d\n", error);
 			goto out;
 		}
-	pr_crit("ATMARP: failed (entry %p, vcc 0x%p)\n", entry, clip_vcc);
+	pr_err("ATMARP: failed (entry %p, vcc 0x%p)\n", entry, clip_vcc);
 out:
 	netif_tx_unlock_bh(entry->neigh->dev);
 }
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/core/net-sysfs.c linux-libre-5.4-gnu/net/core/net-sysfs.c
--- linux-libre-5.4-rc8-gnu/net/core/net-sysfs.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/core/net-sysfs.c	2019-11-24 19:32:01.000000000 -0500
@@ -923,21 +923,23 @@ static int rx_queue_add_kobject(struct n
 	error = kobject_init_and_add(kobj, &rx_queue_ktype, NULL,
 				     "rx-%u", index);
 	if (error)
-		return error;
+		goto err;
 
 	dev_hold(queue->dev);
 
 	if (dev->sysfs_rx_queue_group) {
 		error = sysfs_create_group(kobj, dev->sysfs_rx_queue_group);
-		if (error) {
-			kobject_put(kobj);
-			return error;
-		}
+		if (error)
+			goto err;
 	}
 
 	kobject_uevent(kobj, KOBJ_ADD);
 
 	return error;
+
+err:
+	kobject_put(kobj);
+	return error;
 }
 #endif /* CONFIG_SYSFS */
 
@@ -1461,21 +1463,22 @@ static int netdev_queue_add_kobject(stru
 	error = kobject_init_and_add(kobj, &netdev_queue_ktype, NULL,
 				     "tx-%u", index);
 	if (error)
-		return error;
+		goto err;
 
 	dev_hold(queue->dev);
 
 #ifdef CONFIG_BQL
 	error = sysfs_create_group(kobj, &dql_group);
-	if (error) {
-		kobject_put(kobj);
-		return error;
-	}
+	if (error)
+		goto err;
 #endif
 
 	kobject_uevent(kobj, KOBJ_ADD);
-
 	return 0;
+
+err:
+	kobject_put(kobj);
+	return error;
 }
 #endif /* CONFIG_SYSFS */
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/core/rtnetlink.c linux-libre-5.4-gnu/net/core/rtnetlink.c
--- linux-libre-5.4-rc8-gnu/net/core/rtnetlink.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/core/rtnetlink.c	2019-11-24 19:32:01.000000000 -0500
@@ -2195,6 +2195,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_MAC]) {
 		struct ifla_vf_mac *ivm = nla_data(tb[IFLA_VF_MAC]);
 
+		if (ivm->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_mac)
 			err = ops->ndo_set_vf_mac(dev, ivm->vf,
@@ -2206,6 +2208,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_VLAN]) {
 		struct ifla_vf_vlan *ivv = nla_data(tb[IFLA_VF_VLAN]);
 
+		if (ivv->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_vlan)
 			err = ops->ndo_set_vf_vlan(dev, ivv->vf, ivv->vlan,
@@ -2238,6 +2242,8 @@ static int do_setvfinfo(struct net_devic
 		if (len == 0)
 			return -EINVAL;
 
+		if (ivvl[0]->vf >= INT_MAX)
+			return -EINVAL;
 		err = ops->ndo_set_vf_vlan(dev, ivvl[0]->vf, ivvl[0]->vlan,
 					   ivvl[0]->qos, ivvl[0]->vlan_proto);
 		if (err < 0)
@@ -2248,6 +2254,8 @@ static int do_setvfinfo(struct net_devic
 		struct ifla_vf_tx_rate *ivt = nla_data(tb[IFLA_VF_TX_RATE]);
 		struct ifla_vf_info ivf;
 
+		if (ivt->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_get_vf_config)
 			err = ops->ndo_get_vf_config(dev, ivt->vf, &ivf);
@@ -2266,6 +2274,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_RATE]) {
 		struct ifla_vf_rate *ivt = nla_data(tb[IFLA_VF_RATE]);
 
+		if (ivt->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_rate)
 			err = ops->ndo_set_vf_rate(dev, ivt->vf,
@@ -2278,6 +2288,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_SPOOFCHK]) {
 		struct ifla_vf_spoofchk *ivs = nla_data(tb[IFLA_VF_SPOOFCHK]);
 
+		if (ivs->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_spoofchk)
 			err = ops->ndo_set_vf_spoofchk(dev, ivs->vf,
@@ -2289,6 +2301,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_LINK_STATE]) {
 		struct ifla_vf_link_state *ivl = nla_data(tb[IFLA_VF_LINK_STATE]);
 
+		if (ivl->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_link_state)
 			err = ops->ndo_set_vf_link_state(dev, ivl->vf,
@@ -2302,6 +2316,8 @@ static int do_setvfinfo(struct net_devic
 
 		err = -EOPNOTSUPP;
 		ivrssq_en = nla_data(tb[IFLA_VF_RSS_QUERY_EN]);
+		if (ivrssq_en->vf >= INT_MAX)
+			return -EINVAL;
 		if (ops->ndo_set_vf_rss_query_en)
 			err = ops->ndo_set_vf_rss_query_en(dev, ivrssq_en->vf,
 							   ivrssq_en->setting);
@@ -2312,6 +2328,8 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_TRUST]) {
 		struct ifla_vf_trust *ivt = nla_data(tb[IFLA_VF_TRUST]);
 
+		if (ivt->vf >= INT_MAX)
+			return -EINVAL;
 		err = -EOPNOTSUPP;
 		if (ops->ndo_set_vf_trust)
 			err = ops->ndo_set_vf_trust(dev, ivt->vf, ivt->setting);
@@ -2322,15 +2340,18 @@ static int do_setvfinfo(struct net_devic
 	if (tb[IFLA_VF_IB_NODE_GUID]) {
 		struct ifla_vf_guid *ivt = nla_data(tb[IFLA_VF_IB_NODE_GUID]);
 
+		if (ivt->vf >= INT_MAX)
+			return -EINVAL;
 		if (!ops->ndo_set_vf_guid)
 			return -EOPNOTSUPP;
-
 		return handle_vf_guid(dev, ivt, IFLA_VF_IB_NODE_GUID);
 	}
 
 	if (tb[IFLA_VF_IB_PORT_GUID]) {
 		struct ifla_vf_guid *ivt = nla_data(tb[IFLA_VF_IB_PORT_GUID]);
 
+		if (ivt->vf >= INT_MAX)
+			return -EINVAL;
 		if (!ops->ndo_set_vf_guid)
 			return -EOPNOTSUPP;
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/ipv4/sysctl_net_ipv4.c linux-libre-5.4-gnu/net/ipv4/sysctl_net_ipv4.c
--- linux-libre-5.4-rc8-gnu/net/ipv4/sysctl_net_ipv4.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/ipv4/sysctl_net_ipv4.c	2019-11-24 19:32:01.000000000 -0500
@@ -1037,7 +1037,7 @@ static struct ctl_table ipv4_net_table[]
 		.mode		= 0644,
 		.proc_handler	= proc_fib_multipath_hash_policy,
 		.extra1		= SYSCTL_ZERO,
-		.extra2		= SYSCTL_ONE,
+		.extra2		= &two,
 	},
 #endif
 	{
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/ipv4/udp.c linux-libre-5.4-gnu/net/ipv4/udp.c
--- linux-libre-5.4-rc8-gnu/net/ipv4/udp.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/ipv4/udp.c	2019-11-24 19:32:01.000000000 -0500
@@ -1297,6 +1297,27 @@ out:
 
 #define UDP_SKB_IS_STATELESS 0x80000000
 
+/* all head states (dst, sk, nf conntrack) except skb extensions are
+ * cleared by udp_rcv().
+ *
+ * We need to preserve secpath, if present, to eventually process
+ * IP_CMSG_PASSSEC at recvmsg() time.
+ *
+ * Other extensions can be cleared.
+ */
+static bool udp_try_make_stateless(struct sk_buff *skb)
+{
+	if (!skb_has_extensions(skb))
+		return true;
+
+	if (!secpath_exists(skb)) {
+		skb_ext_reset(skb);
+		return true;
+	}
+
+	return false;
+}
+
 static void udp_set_dev_scratch(struct sk_buff *skb)
 {
 	struct udp_dev_scratch *scratch = udp_skb_scratch(skb);
@@ -1308,11 +1329,7 @@ static void udp_set_dev_scratch(struct s
 	scratch->csum_unnecessary = !!skb_csum_unnecessary(skb);
 	scratch->is_linear = !skb_is_nonlinear(skb);
 #endif
-	/* all head states execept sp (dst, sk, nf) are always cleared by
-	 * udp_rcv() and we need to preserve secpath, if present, to eventually
-	 * process IP_CMSG_PASSSEC at recvmsg() time
-	 */
-	if (likely(!skb_sec_path(skb)))
+	if (udp_try_make_stateless(skb))
 		scratch->_tsize_state |= UDP_SKB_IS_STATELESS;
 }
 
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/ipv6/ipv6_sockglue.c linux-libre-5.4-gnu/net/ipv6/ipv6_sockglue.c
--- linux-libre-5.4-rc8-gnu/net/ipv6/ipv6_sockglue.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/ipv6/ipv6_sockglue.c	2019-11-24 19:32:01.000000000 -0500
@@ -363,8 +363,8 @@ static int do_ipv6_setsockopt(struct soc
 		break;
 
 	case IPV6_TRANSPARENT:
-		if (valbool && !ns_capable(net->user_ns, CAP_NET_ADMIN) &&
-		    !ns_capable(net->user_ns, CAP_NET_RAW)) {
+		if (valbool && !ns_capable(net->user_ns, CAP_NET_RAW) &&
+		    !ns_capable(net->user_ns, CAP_NET_ADMIN)) {
 			retv = -EPERM;
 			break;
 		}
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/ipv6/route.c linux-libre-5.4-gnu/net/ipv6/route.c
--- linux-libre-5.4-rc8-gnu/net/ipv6/route.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/ipv6/route.c	2019-11-24 19:32:01.000000000 -0500
@@ -634,7 +634,7 @@ static void rt6_probe(struct fib6_nh *fi
 	 * Router Reachability Probe MUST be rate-limited
 	 * to no more than one per minute.
 	 */
-	if (fib6_nh->fib_nh_gw_family)
+	if (!fib6_nh->fib_nh_gw_family)
 		return;
 
 	nh_gw = &fib6_nh->fib_nh_gw6;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/sched/act_pedit.c linux-libre-5.4-gnu/net/sched/act_pedit.c
--- linux-libre-5.4-rc8-gnu/net/sched/act_pedit.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/sched/act_pedit.c	2019-11-24 19:32:01.000000000 -0500
@@ -43,7 +43,7 @@ static struct tcf_pedit_key_ex *tcf_pedi
 	int err = -EINVAL;
 	int rem;
 
-	if (!nla || !n)
+	if (!nla)
 		return NULL;
 
 	keys_ex = kcalloc(n, sizeof(*k), GFP_KERNEL);
@@ -170,6 +170,10 @@ static int tcf_pedit_init(struct net *ne
 	}
 
 	parm = nla_data(pattr);
+	if (!parm->nkeys) {
+		NL_SET_ERR_MSG_MOD(extack, "Pedit requires keys to be passed");
+		return -EINVAL;
+	}
 	ksize = parm->nkeys * sizeof(struct tc_pedit_key);
 	if (nla_len(pattr) < sizeof(*parm) + ksize) {
 		NL_SET_ERR_MSG_ATTR(extack, pattr, "Length of TCA_PEDIT_PARMS or TCA_PEDIT_PARMS_EX pedit attribute is invalid");
@@ -183,12 +187,6 @@ static int tcf_pedit_init(struct net *ne
 	index = parm->index;
 	err = tcf_idr_check_alloc(tn, &index, a, bind);
 	if (!err) {
-		if (!parm->nkeys) {
-			tcf_idr_cleanup(tn, index);
-			NL_SET_ERR_MSG_MOD(extack, "Pedit requires keys to be passed");
-			ret = -EINVAL;
-			goto out_free;
-		}
 		ret = tcf_idr_create(tn, index, est, a,
 				     &act_pedit_ops, bind, false);
 		if (ret) {
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/sched/act_tunnel_key.c linux-libre-5.4-gnu/net/sched/act_tunnel_key.c
--- linux-libre-5.4-rc8-gnu/net/sched/act_tunnel_key.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/sched/act_tunnel_key.c	2019-11-24 19:32:01.000000000 -0500
@@ -135,6 +135,10 @@ static int tunnel_key_copy_opts(const st
 			if (opt_len < 0)
 				return opt_len;
 			opts_len += opt_len;
+			if (opts_len > IP_TUNNEL_OPTS_MAX) {
+				NL_SET_ERR_MSG(extack, "Tunnel options exceeds max size");
+				return -EINVAL;
+			}
 			if (dst) {
 				dst_len -= opt_len;
 				dst += opt_len;
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/sched/sch_taprio.c linux-libre-5.4-gnu/net/sched/sch_taprio.c
--- linux-libre-5.4-rc8-gnu/net/sched/sch_taprio.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/sched/sch_taprio.c	2019-11-24 19:32:01.000000000 -0500
@@ -922,7 +922,7 @@ static int taprio_parse_mqprio_opt(struc
 	}
 
 	/* Verify priority mapping uses valid tcs */
-	for (i = 0; i < TC_BITMASK + 1; i++) {
+	for (i = 0; i <= TC_BITMASK; i++) {
 		if (qopt->prio_tc_map[i] >= qopt->num_tc) {
 			NL_SET_ERR_MSG(extack, "Invalid traffic class in priority to traffic class mapping");
 			return -EINVAL;
@@ -1347,6 +1347,26 @@ out:
 	return err;
 }
 
+static int taprio_mqprio_cmp(const struct net_device *dev,
+			     const struct tc_mqprio_qopt *mqprio)
+{
+	int i;
+
+	if (!mqprio || mqprio->num_tc != dev->num_tc)
+		return -1;
+
+	for (i = 0; i < mqprio->num_tc; i++)
+		if (dev->tc_to_txq[i].count != mqprio->count[i] ||
+		    dev->tc_to_txq[i].offset != mqprio->offset[i])
+			return -1;
+
+	for (i = 0; i <= TC_BITMASK; i++)
+		if (dev->prio_tc_map[i] != mqprio->prio_tc_map[i])
+			return -1;
+
+	return 0;
+}
+
 static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
 			 struct netlink_ext_ack *extack)
 {
@@ -1398,6 +1418,10 @@ static int taprio_change(struct Qdisc *s
 	admin = rcu_dereference(q->admin_sched);
 	rcu_read_unlock();
 
+	/* no changes - no new mqprio settings */
+	if (!taprio_mqprio_cmp(dev, mqprio))
+		mqprio = NULL;
+
 	if (mqprio && (oper || admin)) {
 		NL_SET_ERR_MSG(extack, "Changing the traffic mapping of a running schedule is not supported");
 		err = -ENOTSUPP;
@@ -1455,7 +1479,7 @@ static int taprio_change(struct Qdisc *s
 					    mqprio->offset[i]);
 
 		/* Always use supplied priority mappings */
-		for (i = 0; i < TC_BITMASK + 1; i++)
+		for (i = 0; i <= TC_BITMASK; i++)
 			netdev_set_prio_tc_map(dev, i,
 					       mqprio->prio_tc_map[i]);
 	}
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/tls/tls_main.c linux-libre-5.4-gnu/net/tls/tls_main.c
--- linux-libre-5.4-rc8-gnu/net/tls/tls_main.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/tls/tls_main.c	2019-11-24 19:32:01.000000000 -0500
@@ -908,6 +908,7 @@ static int __init tls_register(void)
 {
 	tls_sw_proto_ops = inet_stream_ops;
 	tls_sw_proto_ops.splice_read = tls_sw_splice_read;
+	tls_sw_proto_ops.sendpage_locked   = tls_sw_sendpage_locked,
 
 	tls_device_init();
 	tcp_register_ulp(&tcp_tls_ulp_ops);
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/net/tls/tls_sw.c linux-libre-5.4-gnu/net/tls/tls_sw.c
--- linux-libre-5.4-rc8-gnu/net/tls/tls_sw.c	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/net/tls/tls_sw.c	2019-11-24 19:32:01.000000000 -0500
@@ -1204,6 +1204,17 @@ sendpage_end:
 	return copied ? copied : ret;
 }
 
+int tls_sw_sendpage_locked(struct sock *sk, struct page *page,
+			   int offset, size_t size, int flags)
+{
+	if (flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
+		      MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY |
+		      MSG_NO_SHARED_FRAGS))
+		return -ENOTSUPP;
+
+	return tls_sw_do_sendpage(sk, page, offset, size, flags);
+}
+
 int tls_sw_sendpage(struct sock *sk, struct page *page,
 		    int offset, size_t size, int flags)
 {
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/tools/gpio/Build linux-libre-5.4-gnu/tools/gpio/Build
--- linux-libre-5.4-rc8-gnu/tools/gpio/Build	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/tools/gpio/Build	2019-11-24 19:32:01.000000000 -0500
@@ -1,3 +1,4 @@
+gpio-utils-y += gpio-utils.o
 lsgpio-y += lsgpio.o gpio-utils.o
 gpio-hammer-y += gpio-hammer.o gpio-utils.o
 gpio-event-mon-y += gpio-event-mon.o gpio-utils.o
diff -druNp --no-dereference linux-libre-5.4-rc8-gnu/tools/gpio/Makefile linux-libre-5.4-gnu/tools/gpio/Makefile
--- linux-libre-5.4-rc8-gnu/tools/gpio/Makefile	2019-11-17 17:47:30.000000000 -0500
+++ linux-libre-5.4-gnu/tools/gpio/Makefile	2019-11-24 19:32:01.000000000 -0500
@@ -35,11 +35,15 @@ $(OUTPUT)include/linux/gpio.h: ../../inc
 
 prepare: $(OUTPUT)include/linux/gpio.h
 
+GPIO_UTILS_IN := $(output)gpio-utils-in.o
+$(GPIO_UTILS_IN): prepare FORCE
+	$(Q)$(MAKE) $(build)=gpio-utils
+
 #
 # lsgpio
 #
 LSGPIO_IN := $(OUTPUT)lsgpio-in.o
-$(LSGPIO_IN): prepare FORCE
+$(LSGPIO_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
 	$(Q)$(MAKE) $(build)=lsgpio
 $(OUTPUT)lsgpio: $(LSGPIO_IN)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -48,7 +52,7 @@ $(OUTPUT)lsgpio: $(LSGPIO_IN)
 # gpio-hammer
 #
 GPIO_HAMMER_IN := $(OUTPUT)gpio-hammer-in.o
-$(GPIO_HAMMER_IN): prepare FORCE
+$(GPIO_HAMMER_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
 	$(Q)$(MAKE) $(build)=gpio-hammer
 $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -57,7 +61,7 @@ $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
 # gpio-event-mon
 #
 GPIO_EVENT_MON_IN := $(OUTPUT)gpio-event-mon-in.o
-$(GPIO_EVENT_MON_IN): prepare FORCE
+$(GPIO_EVENT_MON_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
 	$(Q)$(MAKE) $(build)=gpio-event-mon
 $(OUTPUT)gpio-event-mon: $(GPIO_EVENT_MON_IN)
 	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
