diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/exynos3250.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/exynos3250.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -325,7 +325,7 @@
 		};
 
 		hsotg: hsotg@12480000 {
-			compatible = "snps,dwc2";
+			compatible = "samsung,s3c6400-hsotg", "snps,dwc2";
 			reg = <0x12480000 0x20000>;
 			interrupts = <0 141 0>;
 			clocks = <&cmu CLK_USBOTG>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/mmp2.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/mmp2.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -180,7 +180,7 @@
 				clocks = <&soc_clocks MMP2_CLK_GPIO>;
 				resets = <&soc_clocks MMP2_CLK_GPIO>;
 				interrupt-controller;
-				#interrupt-cells = <1>;
+				#interrupt-cells = <2>;
 				ranges;
 
 				gcb0: gpio@d4019000 {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -225,7 +225,7 @@
 	pinctrl-0 = <&mmc1_pins>;
 	vmmc-supply = <&vmmc1>;
 	vmmc_aux-supply = <&vsim>;
-	cd-gpios = <&twl_gpio 0 GPIO_ACTIVE_HIGH>;
+	cd-gpios = <&twl_gpio 0 GPIO_ACTIVE_LOW>;
 	bus-width = <8>;
 };
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa27x.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa27x.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -27,7 +27,7 @@
 			clocks = <&clks CLK_NONE>;
 		};
 
-		pxa27x_ohci: usb@4c000000 {
+		usb0: usb@4c000000 {
 			compatible = "marvell,pxa-ohci";
 			reg = <0x4c000000 0x10000>;
 			interrupts = <3>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa2xx.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa2xx.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -117,13 +117,6 @@
 			status = "disabled";
 		};
 
-		usb0: ohci@4c000000 {
-			compatible = "marvell,pxa-ohci";
-			reg = <0x4c000000 0x10000>;
-			interrupts = <3>;
-			status = "disabled";
-		};
-
 		mmc0: mmc@41100000 {
 			compatible = "marvell,pxa-mmc";
 			reg = <0x41100000 0x1000>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa3xx.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa3xx.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -88,7 +88,7 @@
 			status = "disabled";
 		};
 
-		pxa3xx_ohci: usb@4c000000 {
+		usb0: usb@4c000000 {
 			compatible = "marvell,pxa-ohci";
 			reg = <0x4c000000 0x10000>;
 			interrupts = <3>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts linux-libre-4.4.207-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts	2019-12-21 04:35:48.000000000 -0500
@@ -167,6 +167,10 @@
 	};
 };
 
+&clocks {
+	clocks = <&fin_pll>;
+};
+
 &sdhci0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts linux-libre-4.4.207-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts	2019-12-21 04:35:48.000000000 -0500
@@ -71,6 +71,10 @@
 	};
 };
 
+&clocks {
+	clocks = <&fin_pll>;
+};
+
 &sdhci0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/sun6i-a31.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/sun6i-a31.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -167,7 +167,7 @@
 	};
 
 	pmu {
-		compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu";
+		compatible = "arm,cortex-a7-pmu";
 		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/boot/dts/sun7i-a20.dtsi linux-libre-4.4.207-gnu/arch/arm/boot/dts/sun7i-a20.dtsi
--- linux-libre-4.4.206-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-21 04:35:48.000000000 -0500
@@ -167,7 +167,7 @@
 	};
 
 	pmu {
-		compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu";
+		compatible = "arm,cortex-a7-pmu";
 		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
 			     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
 	};
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/include/asm/uaccess.h linux-libre-4.4.207-gnu/arch/arm/include/asm/uaccess.h
--- linux-libre-4.4.206-gnu/arch/arm/include/asm/uaccess.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/include/asm/uaccess.h	2019-12-21 04:35:48.000000000 -0500
@@ -387,6 +387,13 @@ do {									\
 #define __get_user_asm_byte(x, addr, err)			\
 	__get_user_asm(x, addr, err, ldrb)
 
+#if __LINUX_ARM_ARCH__ >= 6
+
+#define __get_user_asm_half(x, addr, err)			\
+	__get_user_asm(x, addr, err, ldrh)
+
+#else
+
 #ifndef __ARMEB__
 #define __get_user_asm_half(x, __gu_addr, err)			\
 ({								\
@@ -405,6 +412,8 @@ do {									\
 })
 #endif
 
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
+
 #define __get_user_asm_word(x, addr, err)			\
 	__get_user_asm(x, addr, err, ldr)
 #endif
@@ -480,6 +489,13 @@ do {									\
 #define __put_user_asm_byte(x, __pu_addr, err)			\
 	__put_user_asm(x, __pu_addr, err, strb)
 
+#if __LINUX_ARM_ARCH__ >= 6
+
+#define __put_user_asm_half(x, __pu_addr, err)			\
+	__put_user_asm(x, __pu_addr, err, strh)
+
+#else
+
 #ifndef __ARMEB__
 #define __put_user_asm_half(x, __pu_addr, err)			\
 ({								\
@@ -496,6 +512,8 @@ do {									\
 })
 #endif
 
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
+
 #define __put_user_asm_word(x, __pu_addr, err)			\
 	__put_user_asm(x, __pu_addr, err, str)
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/lib/getuser.S linux-libre-4.4.207-gnu/arch/arm/lib/getuser.S
--- linux-libre-4.4.206-gnu/arch/arm/lib/getuser.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/lib/getuser.S	2019-12-21 04:35:48.000000000 -0500
@@ -42,6 +42,12 @@ _ASM_NOKPROBE(__get_user_1)
 
 ENTRY(__get_user_2)
 	check_uaccess r0, 2, r1, r2, __get_user_bad
+#if __LINUX_ARM_ARCH__ >= 6
+
+2: TUSER(ldrh)	r2, [r0]
+
+#else
+
 #ifdef CONFIG_CPU_USE_DOMAINS
 rb	.req	ip
 2:	ldrbt	r2, [r0], #1
@@ -56,6 +62,9 @@ rb	.req	r0
 #else
 	orr	r2, rb, r2, lsl #8
 #endif
+
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
+
 	mov	r0, #0
 	ret	lr
 ENDPROC(__get_user_2)
@@ -145,7 +154,9 @@ _ASM_NOKPROBE(__get_user_bad8)
 .pushsection __ex_table, "a"
 	.long	1b, __get_user_bad
 	.long	2b, __get_user_bad
+#if __LINUX_ARM_ARCH__ < 6
 	.long	3b, __get_user_bad
+#endif
 	.long	4b, __get_user_bad
 	.long	5b, __get_user_bad8
 	.long	6b, __get_user_bad8
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/lib/putuser.S linux-libre-4.4.207-gnu/arch/arm/lib/putuser.S
--- linux-libre-4.4.206-gnu/arch/arm/lib/putuser.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/lib/putuser.S	2019-12-21 04:35:48.000000000 -0500
@@ -41,16 +41,13 @@ ENDPROC(__put_user_1)
 
 ENTRY(__put_user_2)
 	check_uaccess r0, 2, r1, ip, __put_user_bad
-	mov	ip, r2, lsr #8
-#ifdef CONFIG_THUMB2_KERNEL
-#ifndef __ARMEB__
-2: TUSER(strb)	r2, [r0]
-3: TUSER(strb)	ip, [r0, #1]
+#if __LINUX_ARM_ARCH__ >= 6
+
+2: TUSER(strh)	r2, [r0]
+
 #else
-2: TUSER(strb)	ip, [r0]
-3: TUSER(strb)	r2, [r0, #1]
-#endif
-#else	/* !CONFIG_THUMB2_KERNEL */
+
+	mov	ip, r2, lsr #8
 #ifndef __ARMEB__
 2: TUSER(strb)	r2, [r0], #1
 3: TUSER(strb)	ip, [r0]
@@ -58,7 +55,8 @@ ENTRY(__put_user_2)
 2: TUSER(strb)	ip, [r0], #1
 3: TUSER(strb)	r2, [r0]
 #endif
-#endif	/* CONFIG_THUMB2_KERNEL */
+
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
 	mov	r0, #0
 	ret	lr
 ENDPROC(__put_user_2)
@@ -91,7 +89,9 @@ ENDPROC(__put_user_bad)
 .pushsection __ex_table, "a"
 	.long	1b, __put_user_bad
 	.long	2b, __put_user_bad
+#if __LINUX_ARM_ARCH__ < 6
 	.long	3b, __put_user_bad
+#endif
 	.long	4b, __put_user_bad
 	.long	5b, __put_user_bad
 	.long	6b, __put_user_bad
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/mach-omap1/id.c linux-libre-4.4.207-gnu/arch/arm/mach-omap1/id.c
--- linux-libre-4.4.206-gnu/arch/arm/mach-omap1/id.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/mach-omap1/id.c	2019-12-21 04:35:48.000000000 -0500
@@ -200,10 +200,10 @@ void __init omap_check_revision(void)
 		printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type);
 	}
 
-	printk(KERN_INFO "OMAP%04x", omap_revision >> 16);
+	pr_info("OMAP%04x", omap_revision >> 16);
 	if ((omap_revision >> 8) & 0xff)
-		printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff);
-	printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n",
+		pr_cont("%x", (omap_revision >> 8) & 0xff);
+	pr_cont(" revision %i handled as %02xxx id: %08x%08x\n",
 	       die_rev, omap_revision & 0xff, system_serial_low,
 	       system_serial_high);
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/mach-omap2/id.c linux-libre-4.4.207-gnu/arch/arm/mach-omap2/id.c
--- linux-libre-4.4.206-gnu/arch/arm/mach-omap2/id.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/mach-omap2/id.c	2019-12-21 04:35:48.000000000 -0500
@@ -199,8 +199,8 @@ void __init omap2xxx_check_revision(void
 
 	pr_info("%s", soc_name);
 	if ((omap_rev() >> 8) & 0x0f)
-		pr_info("%s", soc_rev);
-	pr_info("\n");
+		pr_cont("%s", soc_rev);
+	pr_cont("\n");
 }
 
 #define OMAP3_SHOW_FEATURE(feat)		\
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/arm/mach-tegra/reset-handler.S linux-libre-4.4.207-gnu/arch/arm/mach-tegra/reset-handler.S
--- linux-libre-4.4.206-gnu/arch/arm/mach-tegra/reset-handler.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/arm/mach-tegra/reset-handler.S	2019-12-21 04:35:48.000000000 -0500
@@ -56,16 +56,16 @@ ENTRY(tegra_resume)
 	cmp	r6, #TEGRA20
 	beq	1f				@ Yes
 	/* Clear the flow controller flags for this CPU. */
-	cpu_to_csr_reg r1, r0
+	cpu_to_csr_reg r3, r0
 	mov32	r2, TEGRA_FLOW_CTRL_BASE
-	ldr	r1, [r2, r1]
+	ldr	r1, [r2, r3]
 	/* Clear event & intr flag */
 	orr	r1, r1, \
 		#FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
 	movw	r0, #0x3FFD	@ enable, cluster_switch, immed, bitmaps
 				@ & ext flags for CPU power mgnt
 	bic	r1, r1, r0
-	str	r1, [r2]
+	str	r1, [r2, r3]
 1:
 
 	mov32	r9, 0xc09
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c linux-libre-4.4.207-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c
--- linux-libre-4.4.206-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-21 04:35:48.000000000 -0500
@@ -266,7 +266,7 @@ int cvmx_cmd_queue_length(cvmx_cmd_queue
 		} else {
 			union cvmx_pko_mem_debug8 debug8;
 			debug8.u64 = cvmx_read_csr(CVMX_PKO_MEM_DEBUG8);
-			return debug8.cn58xx.doorbell;
+			return debug8.cn50xx.doorbell;
 		}
 	case CVMX_CMD_QUEUE_ZIP:
 	case CVMX_CMD_QUEUE_DFA:
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/mips/cavium-octeon/octeon-platform.c linux-libre-4.4.207-gnu/arch/mips/cavium-octeon/octeon-platform.c
--- linux-libre-4.4.206-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-21 04:35:48.000000000 -0500
@@ -485,7 +485,7 @@ static void __init octeon_fdt_set_phy(in
 	if (phy_addr >= 256 && alt_phy > 0) {
 		const struct fdt_property *phy_prop;
 		struct fdt_property *alt_prop;
-		u32 phy_handle_name;
+		fdt32_t phy_handle_name;
 
 		/* Use the alt phy node instead.*/
 		phy_prop = fdt_get_property(initial_boot_params, eth, "phy-handle", NULL);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/mips/include/asm/octeon/cvmx-pko.h linux-libre-4.4.207-gnu/arch/mips/include/asm/octeon/cvmx-pko.h
--- linux-libre-4.4.206-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-21 04:35:48.000000000 -0500
@@ -611,7 +611,7 @@ static inline void cvmx_pko_get_port_sta
 		pko_reg_read_idx.s.index = cvmx_pko_get_base_queue(port_num);
 		cvmx_write_csr(CVMX_PKO_REG_READ_IDX, pko_reg_read_idx.u64);
 		debug8.u64 = cvmx_read_csr(CVMX_PKO_MEM_DEBUG8);
-		status->doorbell = debug8.cn58xx.doorbell;
+		status->doorbell = debug8.cn50xx.doorbell;
 	}
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/mips/Kconfig linux-libre-4.4.207-gnu/arch/mips/Kconfig
--- linux-libre-4.4.206-gnu/arch/mips/Kconfig	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/mips/Kconfig	2019-12-21 04:35:48.000000000 -0500
@@ -773,6 +773,7 @@ config SIBYTE_LITTLESUR
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select SYS_SUPPORTS_HIGHMEM
 	select SYS_SUPPORTS_LITTLE_ENDIAN
+	select ZONE_DMA32 if 64BIT
 
 config SIBYTE_SENTOSA
 	bool "Sibyte BCM91250E-Sentosa"
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/include/asm/sfp-machine.h linux-libre-4.4.207-gnu/arch/powerpc/include/asm/sfp-machine.h
--- linux-libre-4.4.206-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-21 04:35:48.000000000 -0500
@@ -213,30 +213,18 @@
  * respectively.  The result is placed in HIGH_SUM and LOW_SUM.  Overflow
  * (i.e. carry out) is not stored anywhere, and is lost.
  */
-#define add_ssaaaa(sh, sl, ah, al, bh, bl)				\
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   do {									\
     if (__builtin_constant_p (bh) && (bh) == 0)				\
-      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2"		\
-	     : "=r" ((USItype)(sh)),					\
-	       "=&r" ((USItype)(sl))					\
-	     : "%r" ((USItype)(ah)),					\
-	       "%r" ((USItype)(al)),					\
-	       "rI" ((USItype)(bl)));					\
-    else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0)		\
-      __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2"		\
-	     : "=r" ((USItype)(sh)),					\
-	       "=&r" ((USItype)(sl))					\
-	     : "%r" ((USItype)(ah)),					\
-	       "%r" ((USItype)(al)),					\
-	       "rI" ((USItype)(bl)));					\
+      __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0)		\
+      __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2"		\
+	     : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
     else								\
-      __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3"		\
-	     : "=r" ((USItype)(sh)),					\
-	       "=&r" ((USItype)(sl))					\
-	     : "%r" ((USItype)(ah)),					\
-	       "r" ((USItype)(bh)),					\
-	       "%r" ((USItype)(al)),					\
-	       "rI" ((USItype)(bl)));					\
+      __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3"		\
+	     : "=r" (sh), "=&r" (sl)					\
+	     : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl));		\
   } while (0)
 
 /* sub_ddmmss is used in op-2.h and udivmodti4.c and should be equivalent to
@@ -248,44 +236,24 @@
  * and LOW_DIFFERENCE.  Overflow (i.e. carry out) is not stored anywhere,
  * and is lost.
  */
-#define sub_ddmmss(sh, sl, ah, al, bh, bl)				\
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   do {									\
     if (__builtin_constant_p (ah) && (ah) == 0)				\
-      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2"	\
-	       : "=r" ((USItype)(sh)),					\
-		 "=&r" ((USItype)(sl))					\
-	       : "r" ((USItype)(bh)),					\
-		 "rI" ((USItype)(al)),					\
-		 "r" ((USItype)(bl)));					\
-    else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0)		\
-      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2"	\
-	       : "=r" ((USItype)(sh)),					\
-		 "=&r" ((USItype)(sl))					\
-	       : "r" ((USItype)(bh)),					\
-		 "rI" ((USItype)(al)),					\
-		 "r" ((USItype)(bl)));					\
+      __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0)		\
+      __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2"	\
+	       : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
     else if (__builtin_constant_p (bh) && (bh) == 0)			\
-      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2"		\
-	       : "=r" ((USItype)(sh)),					\
-		 "=&r" ((USItype)(sl))					\
-	       : "r" ((USItype)(ah)),					\
-		 "rI" ((USItype)(al)),					\
-		 "r" ((USItype)(bl)));					\
-    else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0)		\
-      __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2"		\
-	       : "=r" ((USItype)(sh)),					\
-		 "=&r" ((USItype)(sl))					\
-	       : "r" ((USItype)(ah)),					\
-		 "rI" ((USItype)(al)),					\
-		 "r" ((USItype)(bl)));					\
+      __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+    else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0)		\
+      __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2"		\
+	       : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
     else								\
-      __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2"	\
-	       : "=r" ((USItype)(sh)),					\
-		 "=&r" ((USItype)(sl))					\
-	       : "r" ((USItype)(ah)),					\
-		 "r" ((USItype)(bh)),					\
-		 "rI" ((USItype)(al)),					\
-		 "r" ((USItype)(bl)));					\
+      __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2"	\
+	       : "=r" (sh), "=&r" (sl)					\
+	       : "r" (ah), "r" (bh), "rI" (al), "r" (bl));		\
   } while (0)
 
 /* asm fragments for mul and div */
@@ -294,13 +262,10 @@
  * UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype
  * word product in HIGH_PROD and LOW_PROD.
  */
-#define umul_ppmm(ph, pl, m0, m1)					\
+#define umul_ppmm(ph, pl, m0, m1) \
   do {									\
     USItype __m0 = (m0), __m1 = (m1);					\
-    __asm__ ("mulhwu %0,%1,%2"						\
-	     : "=r" ((USItype)(ph))					\
-	     : "%r" (__m0),						\
-               "r" (__m1));						\
+    __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1));	\
     (pl) = __m0 * __m1;							\
   } while (0)
 
@@ -312,9 +277,10 @@
  * significant bit of DENOMINATOR must be 1, then the pre-processor symbol
  * UDIV_NEEDS_NORMALIZATION is defined to 1.
  */
-#define udiv_qrnnd(q, r, n1, n0, d)					\
+#define udiv_qrnnd(q, r, n1, n0, d) \
   do {									\
-    UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m;			\
+    UWtype __d1, __d0, __q1, __q0;					\
+    UWtype __r1, __r0, __m;						\
     __d1 = __ll_highpart (d);						\
     __d0 = __ll_lowpart (d);						\
 									\
@@ -325,7 +291,7 @@
     if (__r1 < __m)							\
       {									\
 	__q1--, __r1 += (d);						\
-	if (__r1 >= (d)) /* we didn't get carry when adding to __r1 */	\
+	if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
 	  if (__r1 < __m)						\
 	    __q1--, __r1 += (d);					\
       }									\
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/include/asm/vdso_datapage.h linux-libre-4.4.207-gnu/arch/powerpc/include/asm/vdso_datapage.h
--- linux-libre-4.4.206-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-21 04:35:48.000000000 -0500
@@ -86,6 +86,7 @@ struct vdso_data {
 	__s32 wtom_clock_nsec;
 	struct timespec stamp_xtime;	/* xtime as at tb_orig_stamp */
 	__u32 stamp_sec_fraction;	/* fractional seconds of stamp_xtime */
+	__u32 hrtimer_res;			/* hrtimer resolution */
    	__u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls  */
    	__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
 };
@@ -107,6 +108,7 @@ struct vdso_data {
 	__s32 wtom_clock_nsec;
 	struct timespec stamp_xtime;	/* xtime as at tb_orig_stamp */
 	__u32 stamp_sec_fraction;	/* fractional seconds of stamp_xtime */
+	__u32 hrtimer_res;		/* hrtimer resolution */
    	__u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
 	__u32 dcache_block_size;	/* L1 d-cache block size     */
 	__u32 icache_block_size;	/* L1 i-cache block size     */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/kernel/asm-offsets.c linux-libre-4.4.207-gnu/arch/powerpc/kernel/asm-offsets.c
--- linux-libre-4.4.206-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-21 04:35:48.000000000 -0500
@@ -398,6 +398,7 @@ int main(void)
 	DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
 	DEFINE(STAMP_XTIME, offsetof(struct vdso_data, stamp_xtime));
 	DEFINE(STAMP_SEC_FRAC, offsetof(struct vdso_data, stamp_sec_fraction));
+	DEFINE(CLOCK_HRTIMER_RES, offsetof(struct vdso_data, hrtimer_res));
 	DEFINE(CFG_ICACHE_BLOCKSZ, offsetof(struct vdso_data, icache_block_size));
 	DEFINE(CFG_DCACHE_BLOCKSZ, offsetof(struct vdso_data, dcache_block_size));
 	DEFINE(CFG_ICACHE_LOGBLOCKSZ, offsetof(struct vdso_data, icache_log_block_size));
@@ -426,7 +427,6 @@ int main(void)
 	DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
 	DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
 	DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
-	DEFINE(CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
 
 #ifdef CONFIG_BUG
 	DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/kernel/time.c linux-libre-4.4.207-gnu/arch/powerpc/kernel/time.c
--- linux-libre-4.4.206-gnu/arch/powerpc/kernel/time.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/kernel/time.c	2019-12-21 04:35:48.000000000 -0500
@@ -829,6 +829,7 @@ void update_vsyscall_old(struct timespec
 	vdso_data->wtom_clock_nsec = wtm->tv_nsec;
 	vdso_data->stamp_xtime = *wall_time;
 	vdso_data->stamp_sec_fraction = frac_sec;
+	vdso_data->hrtimer_res = hrtimer_resolution;
 	smp_wmb();
 	++(vdso_data->tb_update_count);
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S
--- linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-21 04:35:48.000000000 -0500
@@ -160,12 +160,15 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
 	cror	cr0*4+eq,cr0*4+eq,cr1*4+eq
 	bne	cr0,99f
 
+	mflr	r12
+  .cfi_register lr,r12
+	bl	__get_datapage@local	/* get data page */
+	lwz	r5, CLOCK_HRTIMER_RES(r3)
+	mtlr	r12
 	li	r3,0
 	cmpli	cr0,r4,0
 	crclr	cr0*4+so
 	beqlr
-	lis	r5,CLOCK_REALTIME_RES@h
-	ori	r5,r5,CLOCK_REALTIME_RES@l
 	stw	r3,TSPC32_TV_SEC(r4)
 	stw	r5,TSPC32_TV_NSEC(r4)
 	blr
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso64/cacheflush.S linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso64/cacheflush.S
--- linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-21 04:35:48.000000000 -0500
@@ -39,7 +39,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache)
 	subf	r8,r6,r4		/* compute length */
 	add	r8,r8,r5		/* ensure we get enough */
 	lwz	r9,CFG_DCACHE_LOGBLOCKSZ(r10)
-	srw.	r8,r8,r9		/* compute line count */
+	srd.	r8,r8,r9		/* compute line count */
 	crclr	cr0*4+so
 	beqlr				/* nothing to do? */
 	mtctr	r8
@@ -56,7 +56,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache)
 	subf	r8,r6,r4		/* compute length */
 	add	r8,r8,r5
 	lwz	r9,CFG_ICACHE_LOGBLOCKSZ(r10)
-	srw.	r8,r8,r9		/* compute line count */
+	srd.	r8,r8,r9		/* compute line count */
 	crclr	cr0*4+so
 	beqlr				/* nothing to do? */
 	mtctr	r8
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S
--- linux-libre-4.4.206-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-21 04:35:48.000000000 -0500
@@ -145,12 +145,15 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
 	cror	cr0*4+eq,cr0*4+eq,cr1*4+eq
 	bne	cr0,99f
 
+	mflr	r12
+  .cfi_register lr,r12
+	bl	V_LOCAL_FUNC(__get_datapage)
+	lwz	r5, CLOCK_HRTIMER_RES(r3)
+	mtlr	r12
 	li	r3,0
 	cmpldi	cr0,r4,0
 	crclr	cr0*4+so
 	beqlr
-	lis	r5,CLOCK_REALTIME_RES@h
-	ori	r5,r5,CLOCK_REALTIME_RES@l
 	std	r3,TSPC64_TV_SEC(r4)
 	std	r5,TSPC64_TV_NSEC(r4)
 	blr
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/x86/kernel/apic/apic.c linux-libre-4.4.207-gnu/arch/x86/kernel/apic/apic.c
--- linux-libre-4.4.206-gnu/arch/x86/kernel/apic/apic.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/x86/kernel/apic/apic.c	2019-12-21 04:35:48.000000000 -0500
@@ -1298,16 +1298,21 @@ void setup_local_APIC(void)
 	apic->init_apic_ldr();
 
 #ifdef CONFIG_X86_32
-	/*
-	 * APIC LDR is initialized.  If logical_apicid mapping was
-	 * initialized during get_smp_config(), make sure it matches the
-	 * actual value.
-	 */
-	i = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
-	WARN_ON(i != BAD_APICID && i != logical_smp_processor_id());
-	/* always use the value from LDR */
-	early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
-		logical_smp_processor_id();
+	if (apic->dest_logical) {
+		int logical_apicid, ldr_apicid;
+
+		/*
+		 * APIC LDR is initialized.  If logical_apicid mapping was
+		 * initialized during get_smp_config(), make sure it matches
+		 * the actual value.
+		 */
+		logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
+		ldr_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
+		if (logical_apicid != BAD_APICID)
+			WARN_ON(logical_apicid != ldr_apicid);
+		/* Always use the value from LDR. */
+		early_per_cpu(x86_cpu_to_logical_apicid, cpu) = ldr_apicid;
+	}
 #endif
 
 	/*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/x86/kernel/cpu/mcheck/mce.c linux-libre-4.4.207-gnu/arch/x86/kernel/cpu/mcheck/mce.c
--- linux-libre-4.4.206-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-21 04:35:48.000000000 -0500
@@ -1536,11 +1536,10 @@ static int __mcheck_cpu_apply_quirks(str
 			mce_flags.overflow_recov = 1;
 
 		/*
-		 * Turn off MC4_MISC thresholding banks on those models since
+		 * Turn off MC4_MISC thresholding banks on all models since
 		 * they're not supported there.
 		 */
-		if (c->x86 == 0x15 &&
-		    (c->x86_model >= 0x10 && c->x86_model <= 0x1f)) {
+		if (c->x86 == 0x15) {
 			int i;
 			u64 hwcr;
 			bool need_toggle;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/x86/kvm/cpuid.c linux-libre-4.4.207-gnu/arch/x86/kvm/cpuid.c
--- linux-libre-4.4.206-gnu/arch/x86/kvm/cpuid.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/x86/kvm/cpuid.c	2019-12-21 04:35:48.000000000 -0500
@@ -373,7 +373,7 @@ static inline int __do_cpuid_ent(struct
 
 	r = -E2BIG;
 
-	if (*nent >= maxnent)
+	if (WARN_ON(*nent >= maxnent))
 		goto out;
 
 	do_cpuid_1_ent(entry, function, index);
@@ -669,6 +669,9 @@ out:
 static int do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 func,
 			u32 idx, int *nent, int maxnent, unsigned int type)
 {
+	if (*nent >= maxnent)
+		return -E2BIG;
+
 	if (type == KVM_GET_EMULATED_CPUID)
 		return __do_cpuid_ent_emulated(entry, func, idx, nent, maxnent);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/x86/kvm/x86.c linux-libre-4.4.207-gnu/arch/x86/kvm/x86.c
--- linux-libre-4.4.206-gnu/arch/x86/kvm/x86.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/x86/kvm/x86.c	2019-12-21 04:35:48.000000000 -0500
@@ -260,13 +260,14 @@ int kvm_set_shared_msr(unsigned slot, u6
 	struct kvm_shared_msrs *smsr = per_cpu_ptr(shared_msrs, cpu);
 	int err;
 
-	if (((value ^ smsr->values[slot].curr) & mask) == 0)
+	value = (value & mask) | (smsr->values[slot].host & ~mask);
+	if (value == smsr->values[slot].curr)
 		return 0;
-	smsr->values[slot].curr = value;
 	err = wrmsrl_safe(shared_msrs_global.msrs[slot], value);
 	if (err)
 		return 1;
 
+	smsr->values[slot].curr = value;
 	if (!smsr->registered) {
 		smsr->urn.on_user_return = kvm_on_user_return;
 		user_return_notifier_register(&smsr->urn);
@@ -1023,10 +1024,15 @@ u64 kvm_get_arch_capabilities(void)
 	 * If TSX is disabled on the system, guests are also mitigated against
 	 * TAA and clear CPU buffer mitigation is not required for guests.
 	 */
-	if (boot_cpu_has_bug(X86_BUG_TAA) && boot_cpu_has(X86_FEATURE_RTM) &&
-	    (data & ARCH_CAP_TSX_CTRL_MSR))
+	if (!boot_cpu_has(X86_FEATURE_RTM))
+		data &= ~ARCH_CAP_TAA_NO;
+	else if (!boot_cpu_has_bug(X86_BUG_TAA))
+		data |= ARCH_CAP_TAA_NO;
+	else if (data & ARCH_CAP_TSX_CTRL_MSR)
 		data &= ~ARCH_CAP_MDS_NO;
 
+	/* KVM does not emulate MSR_IA32_TSX_CTRL.  */
+	data &= ~ARCH_CAP_TSX_CTRL_MSR;
 	return data;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/x86/pci/fixup.c linux-libre-4.4.207-gnu/arch/x86/pci/fixup.c
--- linux-libre-4.4.206-gnu/arch/x86/pci/fixup.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/x86/pci/fixup.c	2019-12-21 04:35:48.000000000 -0500
@@ -542,6 +542,17 @@ static void twinhead_reserve_killing_zon
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x27B9, twinhead_reserve_killing_zone);
 
 /*
+ * Device [1022:7914]
+ * When in D0, PME# doesn't get asserted when plugging USB 2.0 device.
+ */
+static void pci_fixup_amd_fch_xhci_pme(struct pci_dev *dev)
+{
+	dev_info(&dev->dev, "PME# does not work under D0, disabling it\n");
+	dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7914, pci_fixup_amd_fch_xhci_pme);
+
+/*
  * Broadwell EP Home Agent BARs erroneously return non-zero values when read.
  *
  * See http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
diff -druNp --no-dereference linux-libre-4.4.206-gnu/arch/xtensa/mm/tlb.c linux-libre-4.4.207-gnu/arch/xtensa/mm/tlb.c
--- linux-libre-4.4.206-gnu/arch/xtensa/mm/tlb.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/arch/xtensa/mm/tlb.c	2019-12-21 04:35:48.000000000 -0500
@@ -218,6 +218,8 @@ static int check_tlb_entry(unsigned w, u
 	unsigned tlbidx = w | (e << PAGE_SHIFT);
 	unsigned r0 = dtlb ?
 		read_dtlb_virtual(tlbidx) : read_itlb_virtual(tlbidx);
+	unsigned r1 = dtlb ?
+		read_dtlb_translation(tlbidx) : read_itlb_translation(tlbidx);
 	unsigned vpn = (r0 & PAGE_MASK) | (e << PAGE_SHIFT);
 	unsigned pte = get_pte_for_vaddr(vpn);
 	unsigned mm_asid = (get_rasid_register() >> 8) & ASID_MASK;
@@ -233,8 +235,6 @@ static int check_tlb_entry(unsigned w, u
 	}
 
 	if (tlb_asid == mm_asid) {
-		unsigned r1 = dtlb ? read_dtlb_translation(tlbidx) :
-			read_itlb_translation(tlbidx);
 		if ((pte ^ r1) & PAGE_MASK) {
 			pr_err("%cTLB: way: %u, entry: %u, mapping: %08x->%08x, PTE: %08x\n",
 					dtlb ? 'D' : 'I', w, e, r0, r1, pte);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/block/blk-mq-sysfs.c linux-libre-4.4.207-gnu/block/blk-mq-sysfs.c
--- linux-libre-4.4.206-gnu/block/blk-mq-sysfs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/block/blk-mq-sysfs.c	2019-12-21 04:35:48.000000000 -0500
@@ -231,20 +231,25 @@ static ssize_t blk_mq_hw_sysfs_active_sh
 
 static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page)
 {
+	const size_t size = PAGE_SIZE - 1;
 	unsigned int i, first = 1;
-	ssize_t ret = 0;
+	int ret = 0, pos = 0;
 
 	for_each_cpu(i, hctx->cpumask) {
 		if (first)
-			ret += sprintf(ret + page, "%u", i);
+			ret = snprintf(pos + page, size - pos, "%u", i);
 		else
-			ret += sprintf(ret + page, ", %u", i);
+			ret = snprintf(pos + page, size - pos, ", %u", i);
+
+		if (ret >= size - pos)
+			break;
 
 		first = 0;
+		pos += ret;
 	}
 
-	ret += sprintf(ret + page, "\n");
-	return ret;
+	ret = snprintf(pos + page, size + 1 - pos, "\n");
+	return pos + ret;
 }
 
 static struct blk_mq_ctx_sysfs_entry blk_mq_sysfs_dispatched = {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/crypto/crypto_user.c linux-libre-4.4.207-gnu/crypto/crypto_user.c
--- linux-libre-4.4.206-gnu/crypto/crypto_user.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/crypto/crypto_user.c	2019-12-21 04:35:48.000000000 -0500
@@ -249,8 +249,10 @@ static int crypto_report(struct sk_buff
 drop_alg:
 	crypto_mod_put(alg);
 
-	if (err)
+	if (err) {
+		kfree_skb(skb);
 		return err;
+	}
 
 	return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid);
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt linux-libre-4.4.207-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt
--- linux-libre-4.4.206-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-21 04:35:48.000000000 -0500
@@ -27,4 +27,4 @@ and valid to enable charging:
 
  - "abracon,tc-diode": should be "standard" (0.6V) or "schottky" (0.3V)
  - "abracon,tc-resistor": should be <0>, <3>, <6> or <11>. 0 disables the output
-                          resistor, the other values are in ohm.
+                          resistor, the other values are in kOhm.
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/acpi/bus.c linux-libre-4.4.207-gnu/drivers/acpi/bus.c
--- linux-libre-4.4.206-gnu/drivers/acpi/bus.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/acpi/bus.c	2019-12-21 04:35:48.000000000 -0500
@@ -154,7 +154,7 @@ int acpi_bus_get_private_data(acpi_handl
 {
 	acpi_status status;
 
-	if (!*data)
+	if (!data)
 		return -EINVAL;
 
 	status = acpi_get_data(handle, acpi_bus_private_data_handler, data);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/acpi/device_pm.c linux-libre-4.4.207-gnu/drivers/acpi/device_pm.c
--- linux-libre-4.4.206-gnu/drivers/acpi/device_pm.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/acpi/device_pm.c	2019-12-21 04:35:48.000000000 -0500
@@ -1094,9 +1094,19 @@ static void acpi_dev_pm_detach(struct de
  */
 int acpi_dev_pm_attach(struct device *dev, bool power_on)
 {
+	/*
+	 * Skip devices whose ACPI companions match the device IDs below,
+	 * because they require special power management handling incompatible
+	 * with the generic ACPI PM domain.
+	 */
+	static const struct acpi_device_id special_pm_ids[] = {
+		{"PNP0C0B", }, /* Generic ACPI fan */
+		{"INT3404", }, /* Fan */
+		{}
+	};
 	struct acpi_device *adev = ACPI_COMPANION(dev);
 
-	if (!adev)
+	if (!adev || !acpi_match_device_ids(adev, special_pm_ids))
 		return -ENODEV;
 
 	if (dev->pm_domain)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/acpi/osl.c linux-libre-4.4.207-gnu/drivers/acpi/osl.c
--- linux-libre-4.4.206-gnu/drivers/acpi/osl.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/acpi/osl.c	2019-12-21 04:35:48.000000000 -0500
@@ -424,24 +424,27 @@ acpi_os_map_memory(acpi_physical_address
 }
 EXPORT_SYMBOL_GPL(acpi_os_map_memory);
 
-static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
+/* Must be called with mutex_lock(&acpi_ioremap_lock) */
+static unsigned long acpi_os_drop_map_ref(struct acpi_ioremap *map)
 {
-	if (!--map->refcount)
+	unsigned long refcount = --map->refcount;
+
+	if (!refcount)
 		list_del_rcu(&map->list);
+	return refcount;
 }
 
 static void acpi_os_map_cleanup(struct acpi_ioremap *map)
 {
-	if (!map->refcount) {
-		synchronize_rcu_expedited();
-		acpi_unmap(map->phys, map->virt);
-		kfree(map);
-	}
+	synchronize_rcu_expedited();
+	acpi_unmap(map->phys, map->virt);
+	kfree(map);
 }
 
 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
 {
 	struct acpi_ioremap *map;
+	unsigned long refcount;
 
 	if (!acpi_gbl_permanent_mmap) {
 		__acpi_unmap_table(virt, size);
@@ -455,10 +458,11 @@ void __ref acpi_os_unmap_iomem(void __io
 		WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
 		return;
 	}
-	acpi_os_drop_map_ref(map);
+	refcount = acpi_os_drop_map_ref(map);
 	mutex_unlock(&acpi_ioremap_lock);
 
-	acpi_os_map_cleanup(map);
+	if (!refcount)
+		acpi_os_map_cleanup(map);
 }
 EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);
 
@@ -499,6 +503,7 @@ void acpi_os_unmap_generic_address(struc
 {
 	u64 addr;
 	struct acpi_ioremap *map;
+	unsigned long refcount;
 
 	if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
 		return;
@@ -514,10 +519,11 @@ void acpi_os_unmap_generic_address(struc
 		mutex_unlock(&acpi_ioremap_lock);
 		return;
 	}
-	acpi_os_drop_map_ref(map);
+	refcount = acpi_os_drop_map_ref(map);
 	mutex_unlock(&acpi_ioremap_lock);
 
-	acpi_os_map_cleanup(map);
+	if (!refcount)
+		acpi_os_map_cleanup(map);
 }
 EXPORT_SYMBOL(acpi_os_unmap_generic_address);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/block/rsxx/core.c linux-libre-4.4.207-gnu/drivers/block/rsxx/core.c
--- linux-libre-4.4.206-gnu/drivers/block/rsxx/core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/block/rsxx/core.c	2019-12-21 04:35:48.000000000 -0500
@@ -1028,8 +1028,10 @@ static void rsxx_pci_remove(struct pci_d
 
 	cancel_work_sync(&card->event_work);
 
+	destroy_workqueue(card->event_wq);
 	rsxx_destroy_dev(card);
 	rsxx_dma_destroy(card);
+	destroy_workqueue(card->creg_ctrl.creg_wq);
 
 	spin_lock_irqsave(&card->irq_lock, flags);
 	rsxx_disable_ier_and_isr(card, CR_INTR_ALL);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/clk/rockchip/clk-rk3188.c linux-libre-4.4.207-gnu/drivers/clk/rockchip/clk-rk3188.c
--- linux-libre-4.4.206-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-21 04:35:48.000000000 -0500
@@ -329,8 +329,8 @@ static struct rockchip_clk_branch common
 			RK2928_CLKGATE_CON(2), 5, GFLAGS),
 	MUX(SCLK_MAC, "sclk_macref", mux_sclk_macref_p, CLK_SET_RATE_PARENT,
 			RK2928_CLKSEL_CON(21), 4, 1, MFLAGS),
-	GATE(0, "sclk_mac_lbtest", "sclk_macref",
-			RK2928_CLKGATE_CON(2), 12, 0, GFLAGS),
+	GATE(0, "sclk_mac_lbtest", "sclk_macref", 0,
+			RK2928_CLKGATE_CON(2), 12, GFLAGS),
 
 	COMPOSITE(0, "hsadc_src", mux_pll_src_gpll_cpll_p, 0,
 			RK2928_CLKSEL_CON(22), 0, 1, MFLAGS, 8, 8, DFLAGS,
@@ -360,8 +360,8 @@ static struct rockchip_clk_branch common
 	 * Clock-Architecture Diagram 4
 	 */
 
-	GATE(SCLK_SMC, "sclk_smc", "hclk_peri",
-			RK2928_CLKGATE_CON(2), 4, 0, GFLAGS),
+	GATE(SCLK_SMC, "sclk_smc", "hclk_peri", 0,
+			RK2928_CLKGATE_CON(2), 4, GFLAGS),
 
 	COMPOSITE_NOMUX(SCLK_SPI0, "sclk_spi0", "pclk_peri", 0,
 			RK2928_CLKSEL_CON(25), 0, 7, DFLAGS,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/cpuidle/driver.c linux-libre-4.4.207-gnu/drivers/cpuidle/driver.c
--- linux-libre-4.4.206-gnu/drivers/cpuidle/driver.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/cpuidle/driver.c	2019-12-21 04:35:48.000000000 -0500
@@ -60,24 +60,23 @@ static inline void __cpuidle_unset_drive
  * __cpuidle_set_driver - set per CPU driver variables for the given driver.
  * @drv: a valid pointer to a struct cpuidle_driver
  *
- * For each CPU in the driver's cpumask, unset the registered driver per CPU
- * to @drv.
- *
- * Returns 0 on success, -EBUSY if the CPUs have driver(s) already.
+ * Returns 0 on success, -EBUSY if any CPU in the cpumask have a driver
+ * different from drv already.
  */
 static inline int __cpuidle_set_driver(struct cpuidle_driver *drv)
 {
 	int cpu;
 
 	for_each_cpu(cpu, drv->cpumask) {
+		struct cpuidle_driver *old_drv;
 
-		if (__cpuidle_get_cpu_driver(cpu)) {
-			__cpuidle_unset_driver(drv);
+		old_drv = __cpuidle_get_cpu_driver(cpu);
+		if (old_drv && old_drv != drv)
 			return -EBUSY;
-		}
+	}
 
+	for_each_cpu(cpu, drv->cpumask)
 		per_cpu(cpuidle_drivers, cpu) = drv;
-	}
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/crypto/amcc/crypto4xx_core.c linux-libre-4.4.207-gnu/drivers/crypto/amcc/crypto4xx_core.c
--- linux-libre-4.4.206-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-21 04:35:48.000000000 -0500
@@ -399,12 +399,8 @@ static u32 crypto4xx_build_sdr(struct cr
 		dma_alloc_coherent(dev->core_dev->device,
 			dev->scatter_buffer_size * PPC4XX_NUM_SD,
 			&dev->scatter_buffer_pa, GFP_ATOMIC);
-	if (!dev->scatter_buffer_va) {
-		dma_free_coherent(dev->core_dev->device,
-				  sizeof(struct ce_sd) * PPC4XX_NUM_SD,
-				  dev->sdr, dev->sdr_pa);
+	if (!dev->scatter_buffer_va)
 		return -ENOMEM;
-	}
 
 	sd_array = dev->sdr;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/dma/coh901318.c linux-libre-4.4.207-gnu/drivers/dma/coh901318.c
--- linux-libre-4.4.206-gnu/drivers/dma/coh901318.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/dma/coh901318.c	2019-12-21 04:35:48.000000000 -0500
@@ -1810,13 +1810,10 @@ static struct dma_chan *coh901318_xlate(
 static int coh901318_config(struct coh901318_chan *cohc,
 			    struct coh901318_params *param)
 {
-	unsigned long flags;
 	const struct coh901318_params *p;
 	int channel = cohc->id;
 	void __iomem *virtbase = cohc->base->virtbase;
 
-	spin_lock_irqsave(&cohc->lock, flags);
-
 	if (param)
 		p = param;
 	else
@@ -1836,8 +1833,6 @@ static int coh901318_config(struct coh90
 	coh901318_set_conf(cohc, p->config);
 	coh901318_set_ctrl(cohc, p->ctrl_lli_last);
 
-	spin_unlock_irqrestore(&cohc->lock, flags);
-
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/extcon/extcon-max8997.c linux-libre-4.4.207-gnu/drivers/extcon/extcon-max8997.c
--- linux-libre-4.4.206-gnu/drivers/extcon/extcon-max8997.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/extcon/extcon-max8997.c	2019-12-21 04:35:48.000000000 -0500
@@ -320,12 +320,10 @@ static int max8997_muic_handle_usb(struc
 {
 	int ret = 0;
 
-	if (usb_type == MAX8997_USB_HOST) {
-		ret = max8997_muic_set_path(info, info->path_usb, attached);
-		if (ret < 0) {
-			dev_err(info->dev, "failed to update muic register\n");
-			return ret;
-		}
+	ret = max8997_muic_set_path(info, info->path_usb, attached);
+	if (ret < 0) {
+		dev_err(info->dev, "failed to update muic register\n");
+		return ret;
 	}
 
 	switch (usb_type) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/gpu/drm/i810/i810_dma.c linux-libre-4.4.207-gnu/drivers/gpu/drm/i810/i810_dma.c
--- linux-libre-4.4.206-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-21 04:35:48.000000000 -0500
@@ -723,7 +723,7 @@ static void i810_dma_dispatch_vertex(str
 	if (nbox > I810_NR_SAREA_CLIPRECTS)
 		nbox = I810_NR_SAREA_CLIPRECTS;
 
-	if (used > 4 * 1024)
+	if (used < 0 || used > 4 * 1024)
 		used = 0;
 
 	if (sarea_priv->dirty)
@@ -1043,7 +1043,7 @@ static void i810_dma_dispatch_mc(struct
 	if (u != I810_BUF_CLIENT)
 		DRM_DEBUG("MC found buffer that isn't mine!\n");
 
-	if (used > 4 * 1024)
+	if (used < 0 || used > 4 * 1024)
 		used = 0;
 
 	sarea_priv->dirty = 0x7f;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/gpu/drm/radeon/r100.c linux-libre-4.4.207-gnu/drivers/gpu/drm/radeon/r100.c
--- linux-libre-4.4.206-gnu/drivers/gpu/drm/radeon/r100.c	2019-12-05 11:45:30.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/gpu/drm/radeon/r100.c	2019-12-22 01:55:16.000000000 -0500
@@ -1820,8 +1820,8 @@ static int r100_packet0_check(struct rad
 			track->textures[i].use_pitch = 1;
 		} else {
 			track->textures[i].use_pitch = 0;
-			track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK);
-			track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK);
+			track->textures[i].width = 1 << ((idx_value & RADEON_TXFORMAT_WIDTH_MASK) >> RADEON_TXFORMAT_WIDTH_SHIFT);
+			track->textures[i].height = 1 << ((idx_value & RADEON_TXFORMAT_HEIGHT_MASK) >> RADEON_TXFORMAT_HEIGHT_SHIFT);
 		}
 		if (idx_value & RADEON_TXFORMAT_CUBIC_MAP_ENABLE)
 			track->textures[i].tex_coord_type = 2;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/gpu/drm/radeon/r200.c linux-libre-4.4.207-gnu/drivers/gpu/drm/radeon/r200.c
--- linux-libre-4.4.206-gnu/drivers/gpu/drm/radeon/r200.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/gpu/drm/radeon/r200.c	2019-12-21 04:35:48.000000000 -0500
@@ -476,8 +476,8 @@ int r200_packet0_check(struct radeon_cs_
 			track->textures[i].use_pitch = 1;
 		} else {
 			track->textures[i].use_pitch = 0;
-			track->textures[i].width = 1 << ((idx_value >> RADEON_TXFORMAT_WIDTH_SHIFT) & RADEON_TXFORMAT_WIDTH_MASK);
-			track->textures[i].height = 1 << ((idx_value >> RADEON_TXFORMAT_HEIGHT_SHIFT) & RADEON_TXFORMAT_HEIGHT_MASK);
+			track->textures[i].width = 1 << ((idx_value & RADEON_TXFORMAT_WIDTH_MASK) >> RADEON_TXFORMAT_WIDTH_SHIFT);
+			track->textures[i].height = 1 << ((idx_value & RADEON_TXFORMAT_HEIGHT_MASK) >> RADEON_TXFORMAT_HEIGHT_SHIFT);
 		}
 		if (idx_value & R200_TXFORMAT_LOOKUP_DISABLE)
 			track->textures[i].lookup_disable = true;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/i2c/busses/i2c-imx.c linux-libre-4.4.207-gnu/drivers/i2c/busses/i2c-imx.c
--- linux-libre-4.4.206-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-21 04:35:48.000000000 -0500
@@ -1076,7 +1076,8 @@ static int i2c_imx_probe(struct platform
 	/* Get I2C clock */
 	i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(i2c_imx->clk)) {
-		dev_err(&pdev->dev, "can't get I2C clock\n");
+		if (PTR_ERR(i2c_imx->clk) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "can't get I2C clock\n");
 		return PTR_ERR(i2c_imx->clk);
 	}
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/iio/humidity/hdc100x.c linux-libre-4.4.207-gnu/drivers/iio/humidity/hdc100x.c
--- linux-libre-4.4.206-gnu/drivers/iio/humidity/hdc100x.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/iio/humidity/hdc100x.c	2019-12-21 04:35:48.000000000 -0500
@@ -215,7 +215,7 @@ static int hdc100x_read_raw(struct iio_d
 			*val2 = 65536;
 			return IIO_VAL_FRACTIONAL;
 		} else {
-			*val = 100;
+			*val = 100000;
 			*val2 = 65536;
 			return IIO_VAL_FRACTIONAL;
 		}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/iio/imu/adis16480.c linux-libre-4.4.207-gnu/drivers/iio/imu/adis16480.c
--- linux-libre-4.4.206-gnu/drivers/iio/imu/adis16480.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/iio/imu/adis16480.c	2019-12-21 04:35:48.000000000 -0500
@@ -724,6 +724,7 @@ static const struct iio_info adis16480_i
 	.write_raw = &adis16480_write_raw,
 	.update_scan_mode = adis_update_scan_mode,
 	.driver_module = THIS_MODULE,
+	.debugfs_reg_access = adis_debugfs_reg_access,
 };
 
 static int adis16480_stop_device(struct iio_dev *indio_dev)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/infiniband/hw/mlx4/sysfs.c linux-libre-4.4.207-gnu/drivers/infiniband/hw/mlx4/sysfs.c
--- linux-libre-4.4.206-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-21 04:35:48.000000000 -0500
@@ -352,16 +352,12 @@ err:
 
 static void get_name(struct mlx4_ib_dev *dev, char *name, int i, int max)
 {
-	char base_name[9];
-
-	/* pci_name format is: bus:dev:func -> xxxx:yy:zz.n */
-	strlcpy(name, pci_name(dev->dev->persist->pdev), max);
-	strncpy(base_name, name, 8); /*till xxxx:yy:*/
-	base_name[8] = '\0';
-	/* with no ARI only 3 last bits are used so when the fn is higher than 8
+	/* pci_name format is: bus:dev:func -> xxxx:yy:zz.n
+	 * with no ARI only 3 last bits are used so when the fn is higher than 8
 	 * need to add it to the dev num, so count in the last number will be
 	 * modulo 8 */
-	sprintf(name, "%s%.2d.%d", base_name, (i/8), (i%8));
+	snprintf(name, max, "%.8s%.2d.%d", pci_name(dev->dev->persist->pdev),
+		 i / 8, i % 8);
 }
 
 struct mlx4_port {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/infiniband/hw/qib/qib_sysfs.c linux-libre-4.4.207-gnu/drivers/infiniband/hw/qib/qib_sysfs.c
--- linux-libre-4.4.206-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-21 04:35:48.000000000 -0500
@@ -301,6 +301,9 @@ static ssize_t qib_portattr_show(struct
 	struct qib_pportdata *ppd =
 		container_of(kobj, struct qib_pportdata, pport_kobj);
 
+	if (!pattr->show)
+		return -EIO;
+
 	return pattr->show(ppd, buf);
 }
 
@@ -312,6 +315,9 @@ static ssize_t qib_portattr_store(struct
 	struct qib_pportdata *ppd =
 		container_of(kobj, struct qib_pportdata, pport_kobj);
 
+	if (!pattr->store)
+		return -EIO;
+
 	return pattr->store(ppd, buf, len);
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/input/touchscreen/cyttsp4_core.c linux-libre-4.4.207-gnu/drivers/input/touchscreen/cyttsp4_core.c
--- linux-libre-4.4.206-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-21 04:35:48.000000000 -0500
@@ -1972,11 +1972,6 @@ static int cyttsp4_mt_probe(struct cytts
 
 	/* get sysinfo */
 	md->si = &cd->sysinfo;
-	if (!md->si) {
-		dev_err(dev, "%s: Fail get sysinfo pointer from core p=%p\n",
-			__func__, md->si);
-		goto error_get_sysinfo;
-	}
 
 	rc = cyttsp4_setup_input_device(cd);
 	if (rc)
@@ -1986,8 +1981,6 @@ static int cyttsp4_mt_probe(struct cytts
 
 error_init_input:
 	input_free_device(md->input);
-error_get_sysinfo:
-	input_set_drvdata(md->input, NULL);
 error_alloc_failed:
 	dev_err(dev, "%s failed.\n", __func__);
 	return rc;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/input/touchscreen/goodix.c linux-libre-4.4.207-gnu/drivers/input/touchscreen/goodix.c
--- linux-libre-4.4.206-gnu/drivers/input/touchscreen/goodix.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/input/touchscreen/goodix.c	2019-12-21 04:35:48.000000000 -0500
@@ -69,6 +69,15 @@ static const unsigned long goodix_irq_fl
 static const struct dmi_system_id rotated_screen[] = {
 #if defined(CONFIG_DMI) && defined(CONFIG_X86)
 	{
+		.ident = "Teclast X89",
+		.matches = {
+			/* tPAD is too generic, also match on bios date */
+			DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
+			DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
+			DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"),
+		},
+	},
+	{
 		.ident = "WinBook TW100",
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/isdn/gigaset/usb-gigaset.c linux-libre-4.4.207-gnu/drivers/isdn/gigaset/usb-gigaset.c
--- linux-libre-4.4.206-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-21 04:35:48.000000000 -0500
@@ -574,8 +574,7 @@ static int gigaset_initcshw(struct cards
 {
 	struct usb_cardstate *ucs;
 
-	cs->hw.usb = ucs =
-		kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
+	cs->hw.usb = ucs = kzalloc(sizeof(struct usb_cardstate), GFP_KERNEL);
 	if (!ucs) {
 		pr_err("out of memory\n");
 		return -ENOMEM;
@@ -587,9 +586,6 @@ static int gigaset_initcshw(struct cards
 	ucs->bchars[3] = 0;
 	ucs->bchars[4] = 0x11;
 	ucs->bchars[5] = 0x13;
-	ucs->bulk_out_buffer = NULL;
-	ucs->bulk_out_urb = NULL;
-	ucs->read_urb = NULL;
 	tasklet_init(&cs->write_tasklet,
 		     gigaset_modem_fill, (unsigned long) cs);
 
@@ -688,6 +684,11 @@ static int gigaset_probe(struct usb_inte
 		return -ENODEV;
 	}
 
+	if (hostif->desc.bNumEndpoints < 2) {
+		dev_err(&interface->dev, "missing endpoints\n");
+		return -ENODEV;
+	}
+
 	dev_info(&udev->dev, "%s: Device matched ... !\n", __func__);
 
 	/* allocate memory for our device state and initialize it */
@@ -707,6 +708,12 @@ static int gigaset_probe(struct usb_inte
 
 	endpoint = &hostif->endpoint[0].desc;
 
+	if (!usb_endpoint_is_bulk_out(endpoint)) {
+		dev_err(&interface->dev, "missing bulk-out endpoint\n");
+		retval = -ENODEV;
+		goto error;
+	}
+
 	buffer_size = le16_to_cpu(endpoint->wMaxPacketSize);
 	ucs->bulk_out_size = buffer_size;
 	ucs->bulk_out_epnum = usb_endpoint_num(endpoint);
@@ -726,6 +733,12 @@ static int gigaset_probe(struct usb_inte
 
 	endpoint = &hostif->endpoint[1].desc;
 
+	if (!usb_endpoint_is_int_in(endpoint)) {
+		dev_err(&interface->dev, "missing int-in endpoint\n");
+		retval = -ENODEV;
+		goto error;
+	}
+
 	ucs->busy = 0;
 
 	ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/md/persistent-data/dm-btree-remove.c linux-libre-4.4.207-gnu/drivers/md/persistent-data/dm-btree-remove.c
--- linux-libre-4.4.206-gnu/drivers/md/persistent-data/dm-btree-remove.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/md/persistent-data/dm-btree-remove.c	2019-12-21 04:35:48.000000000 -0500
@@ -203,7 +203,13 @@ static void __rebalance2(struct dm_btree
 	struct btree_node *right = r->n;
 	uint32_t nr_left = le32_to_cpu(left->header.nr_entries);
 	uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
-	unsigned threshold = 2 * merge_threshold(left) + 1;
+	/*
+	 * Ensure the number of entries in each child will be greater
+	 * than or equal to (max_entries / 3 + 1), so no matter which
+	 * child is used for removal, the number will still be not
+	 * less than (max_entries / 3).
+	 */
+	unsigned int threshold = 2 * (merge_threshold(left) + 1);
 
 	if (nr_left + nr_right < threshold) {
 		/*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c linux-libre-4.4.207-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
--- linux-libre-4.4.206-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-21 04:35:48.000000000 -0500
@@ -652,8 +652,7 @@ static int bdisp_release(struct file *fi
 
 	dev_dbg(bdisp->dev, "%s\n", __func__);
 
-	if (mutex_lock_interruptible(&bdisp->lock))
-		return -ERESTARTSYS;
+	mutex_lock(&bdisp->lock);
 
 	v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/media/radio/radio-wl1273.c linux-libre-4.4.207-gnu/drivers/media/radio/radio-wl1273.c
--- linux-libre-4.4.206-gnu/drivers/media/radio/radio-wl1273.c	2019-12-05 11:55:01.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/media/radio/radio-wl1273.c	2019-12-22 02:04:22.000000000 -0500
@@ -1149,8 +1149,7 @@ static int wl1273_fm_fops_release(struct
 	if (radio->rds_users > 0) {
 		radio->rds_users--;
 		if (radio->rds_users == 0) {
-			if (mutex_lock_interruptible(&core->lock))
-				return -EINTR;
+			mutex_lock(&core->lock);
 
 			radio->irq_flags &= ~WL1273_RDS_EVENT;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/misc/altera-stapl/altera.c linux-libre-4.4.207-gnu/drivers/misc/altera-stapl/altera.c
--- linux-libre-4.4.206-gnu/drivers/misc/altera-stapl/altera.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/misc/altera-stapl/altera.c	2019-12-21 04:35:48.000000000 -0500
@@ -2176,8 +2176,7 @@ static int altera_get_note(u8 *p, s32 pr
 			key_ptr = &p[note_strings +
 					get_unaligned_be32(
 					&p[note_table + (8 * i)])];
-			if ((strncasecmp(key, key_ptr, strlen(key_ptr)) == 0) &&
-						(key != NULL)) {
+			if (key && !strncasecmp(key, key_ptr, strlen(key_ptr))) {
 				status = 0;
 
 				value_ptr = &p[note_strings +
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/mtd/devices/spear_smi.c linux-libre-4.4.207-gnu/drivers/mtd/devices/spear_smi.c
--- linux-libre-4.4.206-gnu/drivers/mtd/devices/spear_smi.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/mtd/devices/spear_smi.c	2019-12-21 04:35:48.000000000 -0500
@@ -595,6 +595,26 @@ static int spear_mtd_read(struct mtd_inf
 	return 0;
 }
 
+/*
+ * The purpose of this function is to ensure a memcpy_toio() with byte writes
+ * only. Its structure is inspired from the ARM implementation of _memcpy_toio()
+ * which also does single byte writes but cannot be used here as this is just an
+ * implementation detail and not part of the API. Not mentioning the comment
+ * stating that _memcpy_toio() should be optimized.
+ */
+static void spear_smi_memcpy_toio_b(volatile void __iomem *dest,
+				    const void *src, size_t len)
+{
+	const unsigned char *from = src;
+
+	while (len) {
+		len--;
+		writeb(*from, dest);
+		from++;
+		dest++;
+	}
+}
+
 static inline int spear_smi_cpy_toio(struct spear_smi *dev, u32 bank,
 		void __iomem *dest, const void *src, size_t len)
 {
@@ -617,7 +637,23 @@ static inline int spear_smi_cpy_toio(str
 	ctrlreg1 = readl(dev->io_base + SMI_CR1);
 	writel((ctrlreg1 | WB_MODE) & ~SW_MODE, dev->io_base + SMI_CR1);
 
-	memcpy_toio(dest, src, len);
+	/*
+	 * In Write Burst mode (WB_MODE), the specs states that writes must be:
+	 * - incremental
+	 * - of the same size
+	 * The ARM implementation of memcpy_toio() will optimize the number of
+	 * I/O by using as much 4-byte writes as possible, surrounded by
+	 * 2-byte/1-byte access if:
+	 * - the destination is not 4-byte aligned
+	 * - the length is not a multiple of 4-byte.
+	 * Avoid this alternance of write access size by using our own 'byte
+	 * access' helper if at least one of the two conditions above is true.
+	 */
+	if (IS_ALIGNED(len, sizeof(u32)) &&
+	    IS_ALIGNED((uintptr_t)dest, sizeof(u32)))
+		memcpy_toio(dest, src, len);
+	else
+		spear_smi_memcpy_toio_b(dest, src, len);
 
 	writel(ctrlreg1, dev->io_base + SMI_CR1);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/can/slcan.c linux-libre-4.4.207-gnu/drivers/net/can/slcan.c
--- linux-libre-4.4.206-gnu/drivers/net/can/slcan.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/can/slcan.c	2019-12-21 04:35:48.000000000 -0500
@@ -613,6 +613,7 @@ err_free_chan:
 	sl->tty = NULL;
 	tty->disc_data = NULL;
 	clear_bit(SLF_INUSE, &sl->flags);
+	slc_free_netdev(sl->dev);
 	free_netdev(sl->dev);
 
 err_exit:
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c linux-libre-4.4.207-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-21 04:35:48.000000000 -0500
@@ -776,6 +776,7 @@ static int ep93xx_eth_remove(struct plat
 {
 	struct net_device *dev;
 	struct ep93xx_priv *ep;
+	struct resource *mem;
 
 	dev = platform_get_drvdata(pdev);
 	if (dev == NULL)
@@ -791,8 +792,8 @@ static int ep93xx_eth_remove(struct plat
 		iounmap(ep->base_addr);
 
 	if (ep->res != NULL) {
-		release_resource(ep->res);
-		kfree(ep->res);
+		mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+		release_mem_region(mem->start, resource_size(mem));
 	}
 
 	free_netdev(dev);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/intel/e100.c linux-libre-4.4.207-gnu/drivers/net/ethernet/intel/e100.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/intel/e100.c	2019-12-05 11:56:45.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/intel/e100.c	2019-12-22 02:06:08.000000000 -0500
@@ -1369,8 +1369,8 @@ static inline int e100_load_ucode_wait(s
 
 	fw = e100_request_firmware(nic);
 	/* If it's NULL, then no ucode is required */
-	if (!fw || IS_ERR(fw))
-		return PTR_ERR(fw);
+	if (IS_ERR_OR_NULL(fw))
+		return PTR_ERR_OR_ZERO(fw);
 
 	if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
 		netif_err(nic, probe, nic->netdev,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/common.h linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/common.h
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/common.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/common.h	2019-12-21 04:35:48.000000000 -0500
@@ -301,7 +301,7 @@ struct dma_features {
 struct stmmac_desc_ops {
 	/* DMA RX descriptor ring initialization */
 	void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode,
-			      int end);
+			      int end, int bfsize);
 	/* DMA TX descriptor ring initialization */
 	void (*init_tx_desc) (struct dma_desc *p, int mode, int end);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h	2019-12-21 04:35:48.000000000 -0500
@@ -33,9 +33,10 @@
 /* Specific functions used for Ring mode */
 
 /* Enhanced descriptors */
-static inline void ehn_desc_rx_set_on_ring(struct dma_desc *p, int end)
+static inline void ehn_desc_rx_set_on_ring(struct dma_desc *p, int end, int bfsize)
 {
-	p->des01.erx.buffer2_size = BUF_SIZE_8KiB - 1;
+	if (bfsize == BUF_SIZE_16KiB)
+		p->des01.erx.buffer2_size = BUF_SIZE_8KiB - 1;
 	if (end)
 		p->des01.erx.end_ring = 1;
 }
@@ -61,9 +62,14 @@ static inline void enh_set_tx_desc_len_o
 }
 
 /* Normal descriptors */
-static inline void ndesc_rx_set_on_ring(struct dma_desc *p, int end)
+static inline void ndesc_rx_set_on_ring(struct dma_desc *p, int end, int bfsize)
 {
-	p->des01.rx.buffer2_size = BUF_SIZE_2KiB - 1;
+	int size;
+
+	if (bfsize >= BUF_SIZE_2KiB) {
+		size = min(bfsize - BUF_SIZE_2KiB + 1, BUF_SIZE_2KiB - 1);
+		p->des01.rx.buffer2_size = size;
+	}
 	if (end)
 		p->des01.rx.end_ring = 1;
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c	2019-12-21 04:35:48.000000000 -0500
@@ -238,16 +238,20 @@ static int enh_desc_get_rx_status(void *
 }
 
 static void enh_desc_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
-				  int mode, int end)
+				  int mode, int end, int bfsize)
 {
+	int bfsize1;
+
 	p->des01.all_flags = 0;
 	p->des01.erx.own = 1;
-	p->des01.erx.buffer1_size = BUF_SIZE_8KiB - 1;
+
+	bfsize1 = min(bfsize, BUF_SIZE_8KiB - 1);
+	p->des01.erx.buffer1_size = bfsize1;
 
 	if (mode == STMMAC_CHAIN_MODE)
 		ehn_desc_rx_set_on_chain(p, end);
 	else
-		ehn_desc_rx_set_on_ring(p, end);
+		ehn_desc_rx_set_on_ring(p, end, bfsize);
 
 	if (disable_rx_ic)
 		p->des01.erx.disable_ic = 1;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c	2019-12-21 04:35:48.000000000 -0500
@@ -121,16 +121,20 @@ static int ndesc_get_rx_status(void *dat
 }
 
 static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode,
-			       int end)
+			       int end, int bfsize)
 {
+	int bfsize1;
+
 	p->des01.all_flags = 0;
 	p->des01.rx.own = 1;
-	p->des01.rx.buffer1_size = BUF_SIZE_2KiB - 1;
+
+	bfsize1 = min(bfsize, (BUF_SIZE_2KiB - 1));
+	p->des01.rx.buffer1_size = bfsize1;
 
 	if (mode == STMMAC_CHAIN_MODE)
 		ndesc_rx_set_on_chain(p, end);
 	else
-		ndesc_rx_set_on_ring(p, end);
+		ndesc_rx_set_on_ring(p, end, bfsize);
 
 	if (disable_rx_ic)
 		p->des01.rx.disable_ic = 1;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2019-12-21 04:35:48.000000000 -0500
@@ -964,11 +964,11 @@ static void stmmac_clear_descriptors(str
 		if (priv->extend_desc)
 			priv->hw->desc->init_rx_desc(&priv->dma_erx[i].basic,
 						     priv->use_riwt, priv->mode,
-						     (i == rxsize - 1));
+						     (i == rxsize - 1), priv->dma_buf_sz);
 		else
 			priv->hw->desc->init_rx_desc(&priv->dma_rx[i],
 						     priv->use_riwt, priv->mode,
-						     (i == rxsize - 1));
+						     (i == rxsize - 1), priv->dma_buf_sz);
 	for (i = 0; i < txsize; i++)
 		if (priv->extend_desc)
 			priv->hw->desc->init_tx_desc(&priv->dma_etx[i].basic,
@@ -2176,8 +2176,7 @@ static inline void stmmac_rx_refill(stru
 static int stmmac_rx(struct stmmac_priv *priv, int limit)
 {
 	unsigned int rxsize = priv->dma_rx_size;
-	unsigned int entry = priv->cur_rx % rxsize;
-	unsigned int next_entry;
+	unsigned int next_entry = priv->cur_rx % rxsize;
 	unsigned int count = 0;
 	int coe = priv->hw->rx_csum;
 
@@ -2189,9 +2188,11 @@ static int stmmac_rx(struct stmmac_priv
 			stmmac_display_ring((void *)priv->dma_rx, rxsize, 0);
 	}
 	while (count < limit) {
-		int status;
+		int status, entry;
 		struct dma_desc *p;
 
+		entry = next_entry;
+
 		if (priv->extend_desc)
 			p = (struct dma_desc *)(priv->dma_erx + entry);
 		else
@@ -2239,7 +2240,7 @@ static int stmmac_rx(struct stmmac_priv
 			/*  check if frame_len fits the preallocated memory */
 			if (frame_len > priv->dma_buf_sz) {
 				priv->dev->stats.rx_length_errors++;
-				break;
+				continue;
 			}
 
 			/* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
@@ -2260,7 +2261,7 @@ static int stmmac_rx(struct stmmac_priv
 				pr_err("%s: Inconsistent Rx descriptor chain\n",
 				       priv->dev->name);
 				priv->dev->stats.rx_dropped++;
-				break;
+				continue;
 			}
 			prefetch(skb->data - NET_IP_ALIGN);
 			priv->rx_skbuff[entry] = NULL;
@@ -2291,7 +2292,6 @@ static int stmmac_rx(struct stmmac_priv
 			priv->dev->stats.rx_packets++;
 			priv->dev->stats.rx_bytes += frame_len;
 		}
-		entry = next_entry;
 	}
 
 	stmmac_rx_refill(priv);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/ethernet/ti/cpsw.c linux-libre-4.4.207-gnu/drivers/net/ethernet/ti/cpsw.c
--- linux-libre-4.4.206-gnu/drivers/net/ethernet/ti/cpsw.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/ethernet/ti/cpsw.c	2019-12-21 04:35:48.000000000 -0500
@@ -777,8 +777,8 @@ static irqreturn_t cpsw_rx_interrupt(int
 {
 	struct cpsw_priv *priv = dev_id;
 
-	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
 	writel(0, &priv->wr_regs->rx_en);
+	cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
 
 	if (priv->quirk_irq) {
 		disable_irq_nosync(priv->irqs_table[0]);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/ath/ar5523/ar5523.c linux-libre-4.4.207-gnu/drivers/net/wireless/ath/ar5523/ar5523.c
--- linux-libre-4.4.206-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-05 12:00:52.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-22 02:10:16.000000000 -0500
@@ -255,7 +255,8 @@ static int ar5523_cmd(struct ar5523 *ar,
 
 	if (flags & AR5523_CMD_FLAG_MAGIC)
 		hdr->magic = cpu_to_be32(1 << 24);
-	memcpy(hdr + 1, idata, ilen);
+	if (ilen)
+		memcpy(hdr + 1, idata, ilen);
 
 	cmd->odata = odata;
 	cmd->olen = olen;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/iwlwifi/mvm/mac80211.c linux-libre-4.4.207-gnu/drivers/net/wireless/iwlwifi/mvm/mac80211.c
--- linux-libre-4.4.206-gnu/drivers/net/wireless/iwlwifi/mvm/mac80211.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/iwlwifi/mvm/mac80211.c	2019-12-21 04:35:48.000000000 -0500
@@ -741,6 +741,21 @@ static void iwl_mvm_mac_tx(struct ieee80
 		     !ieee80211_is_action(hdr->frame_control)))
 		sta = NULL;
 
+	/* If there is no sta, and it's not offchannel - send through AP */
+	if (info->control.vif->type == NL80211_IFTYPE_STATION &&
+	    info->hw_queue != IWL_MVM_OFFCHANNEL_QUEUE && !sta) {
+		struct iwl_mvm_vif *mvmvif =
+			iwl_mvm_vif_from_mac80211(info->control.vif);
+		u8 ap_sta_id = READ_ONCE(mvmvif->ap_sta_id);
+
+		if (ap_sta_id < IWL_MVM_STATION_COUNT) {
+			/* mac80211 holds rcu read lock */
+			sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]);
+			if (IS_ERR_OR_NULL(sta))
+				goto drop;
+		}
+	}
+
 	if (sta) {
 		if (iwl_mvm_defer_tx(mvm, sta, skb))
 			return;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
--- linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-21 04:35:48.000000000 -0500
@@ -1206,6 +1206,7 @@ void rtl92de_enable_interrupt(struct iee
 
 	rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF);
 	rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
+	rtlpci->irq_enabled = true;
 }
 
 void rtl92de_disable_interrupt(struct ieee80211_hw *hw)
@@ -1215,7 +1216,7 @@ void rtl92de_disable_interrupt(struct ie
 
 	rtl_write_dword(rtlpriv, REG_HIMR, IMR8190_DISABLED);
 	rtl_write_dword(rtlpriv, REG_HIMRE, IMR8190_DISABLED);
-	synchronize_irq(rtlpci->pdev->irq);
+	rtlpci->irq_enabled = false;
 }
 
 static void _rtl92de_poweroff_adapter(struct ieee80211_hw *hw)
@@ -1386,7 +1387,7 @@ void rtl92de_set_beacon_related_register
 
 	bcn_interval = mac->beacon_interval;
 	atim_window = 2;
-	/*rtl92de_disable_interrupt(hw);  */
+	rtl92de_disable_interrupt(hw);
 	rtl_write_word(rtlpriv, REG_ATIMWND, atim_window);
 	rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
 	rtl_write_word(rtlpriv, REG_BCNTCFG, 0x660f);
@@ -1406,9 +1407,9 @@ void rtl92de_set_beacon_interval(struct
 
 	RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG,
 		 "beacon_interval:%d\n", bcn_interval);
-	/* rtl92de_disable_interrupt(hw); */
+	rtl92de_disable_interrupt(hw);
 	rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
-	/* rtl92de_enable_interrupt(hw); */
+	rtl92de_enable_interrupt(hw);
 }
 
 void rtl92de_update_interrupt_mask(struct ieee80211_hw *hw,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
--- linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-05 12:02:33.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-22 02:11:59.000000000 -0500
@@ -242,6 +242,7 @@ static struct rtl_hal_ops rtl8192de_hal_
 	.led_control = rtl92de_led_control,
 	.set_desc = rtl92de_set_desc,
 	.get_desc = rtl92de_get_desc,
+	.is_tx_desc_closed = rtl92de_is_tx_desc_closed,
 	.tx_polling = rtl92de_tx_polling,
 	.enable_hw_sec = rtl92de_enable_hw_security_config,
 	.set_key = rtl92de_set_key,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
--- linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-21 04:35:48.000000000 -0500
@@ -843,13 +843,15 @@ u32 rtl92de_get_desc(u8 *p_desc, bool is
 			break;
 		}
 	} else {
-		struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc;
 		switch (desc_name) {
 		case HW_DESC_OWN:
-			ret = GET_RX_DESC_OWN(pdesc);
+			ret = GET_RX_DESC_OWN(p_desc);
 			break;
 		case HW_DESC_RXPKT_LEN:
-			ret = GET_RX_DESC_PKT_LEN(pdesc);
+			ret = GET_RX_DESC_PKT_LEN(p_desc);
+			break;
+		case HW_DESC_RXBUFF_ADDR:
+			ret = GET_RX_DESC_BUFF_ADDR(p_desc);
 			break;
 		default:
 			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
@@ -860,6 +862,23 @@ u32 rtl92de_get_desc(u8 *p_desc, bool is
 	return ret;
 }
 
+bool rtl92de_is_tx_desc_closed(struct ieee80211_hw *hw,
+			       u8 hw_queue, u16 index)
+{
+	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
+	struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
+	u8 *entry = (u8 *)(&ring->desc[ring->idx]);
+	u8 own = (u8)rtl92de_get_desc(entry, true, HW_DESC_OWN);
+
+	/* a beacon packet will only use the first
+	 * descriptor by defaut, and the own bit may not
+	 * be cleared by the hardware
+	 */
+	if (own)
+		return false;
+	return true;
+}
+
 void rtl92de_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h
--- linux-libre-4.4.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-21 04:35:48.000000000 -0500
@@ -740,6 +740,8 @@ bool rtl92de_rx_query_desc(struct ieee80
 void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 		      u8 desc_name, u8 *val);
 u32 rtl92de_get_desc(u8 *pdesc, bool istx, u8 desc_name);
+bool rtl92de_is_tx_desc_closed(struct ieee80211_hw *hw,
+			       u8 hw_queue, u16 index);
 void rtl92de_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
 void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
 			     bool b_firstseg, bool b_lastseg,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/nfc/nxp-nci/i2c.c linux-libre-4.4.207-gnu/drivers/nfc/nxp-nci/i2c.c
--- linux-libre-4.4.206-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-21 04:35:48.000000000 -0500
@@ -239,8 +239,10 @@ static irqreturn_t nxp_nci_i2c_irq_threa
 
 	if (r == -EREMOTEIO) {
 		phy->hard_fault = r;
-		skb = NULL;
-	} else if (r < 0) {
+		if (info->mode == NXP_NCI_MODE_FW)
+			nxp_nci_fw_recv_frame(phy->ndev, NULL);
+	}
+	if (r < 0) {
 		nfc_err(&client->dev, "Read failed with error %d\n", r);
 		goto exit_irq_handled;
 	}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pci/msi.c linux-libre-4.4.207-gnu/drivers/pci/msi.c
--- linux-libre-4.4.206-gnu/drivers/pci/msi.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pci/msi.c	2019-12-21 04:35:48.000000000 -0500
@@ -224,7 +224,7 @@ u32 __pci_msix_desc_mask_irq(struct msi_
 		return 0;
 
 	mask_bits &= ~PCI_MSIX_ENTRY_CTRL_MASKBIT;
-	if (flag)
+	if (flag & PCI_MSIX_ENTRY_CTRL_MASKBIT)
 		mask_bits |= PCI_MSIX_ENTRY_CTRL_MASKBIT;
 	writel(mask_bits, desc->mask_base + offset);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pci/quirks.c linux-libre-4.4.207-gnu/drivers/pci/quirks.c
--- linux-libre-4.4.206-gnu/drivers/pci/quirks.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pci/quirks.c	2019-12-21 04:35:48.000000000 -0500
@@ -4038,7 +4038,7 @@ int pci_dev_specific_acs_enabled(struct
 #define INTEL_BSPR_REG_BPPD  (1 << 9)
 
 /* Upstream Peer Decode Configuration Register */
-#define INTEL_UPDCR_REG 0x1114
+#define INTEL_UPDCR_REG 0x1014
 /* 5:0 Peer Decode Enable bits */
 #define INTEL_UPDCR_REG_MASK 0x3f
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c linux-libre-4.4.207-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
--- linux-libre-4.4.206-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-21 04:35:48.000000000 -0500
@@ -755,12 +755,23 @@ static int pm8xxx_gpio_probe(struct plat
 		goto unregister_pinctrl;
 	}
 
-	ret = gpiochip_add_pin_range(&pctrl->chip,
-				     dev_name(pctrl->dev),
-				     0, 0, pctrl->chip.ngpio);
-	if (ret) {
-		dev_err(pctrl->dev, "failed to add pin range\n");
-		goto unregister_gpiochip;
+	/*
+	 * For DeviceTree-supported systems, the gpio core checks the
+	 * pinctrl's device node for the "gpio-ranges" property.
+	 * If it is present, it takes care of adding the pin ranges
+	 * for the driver. In this case the driver can skip ahead.
+	 *
+	 * In order to remain compatible with older, existing DeviceTree
+	 * files which don't set the "gpio-ranges" property or systems that
+	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
+	 */
+	if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
+		ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev),
+					     0, 0, pctrl->chip.ngpio);
+		if (ret) {
+			dev_err(pctrl->dev, "failed to add pin range\n");
+			goto unregister_gpiochip;
+		}
 	}
 
 	platform_set_drvdata(pdev, pctrl);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
--- linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-21 04:35:48.000000000 -0500
@@ -495,8 +495,10 @@ static int s3c24xx_eint_init(struct sams
 		return -ENODEV;
 
 	eint_data = devm_kzalloc(dev, sizeof(*eint_data), GFP_KERNEL);
-	if (!eint_data)
+	if (!eint_data) {
+		of_node_put(eint_np);
 		return -ENOMEM;
+	}
 
 	eint_data->drvdata = d;
 
@@ -508,12 +510,14 @@ static int s3c24xx_eint_init(struct sams
 		irq = irq_of_parse_and_map(eint_np, i);
 		if (!irq) {
 			dev_err(dev, "failed to get wakeup EINT IRQ %d\n", i);
+			of_node_put(eint_np);
 			return -ENXIO;
 		}
 
 		eint_data->parents[i] = irq;
 		irq_set_chained_handler_and_data(irq, handlers[i], eint_data);
 	}
+	of_node_put(eint_np);
 
 	bank = d->pin_banks;
 	for (i = 0; i < d->nr_banks; ++i, ++bank) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
--- linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-21 04:35:48.000000000 -0500
@@ -713,6 +713,7 @@ static int s3c64xx_eint_eint0_init(struc
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
 	if (!data) {
 		dev_err(dev, "could not allocate memory for wkup eint data\n");
+		of_node_put(eint0_np);
 		return -ENOMEM;
 	}
 	data->drvdata = d;
@@ -723,6 +724,7 @@ static int s3c64xx_eint_eint0_init(struc
 		irq = irq_of_parse_and_map(eint0_np, i);
 		if (!irq) {
 			dev_err(dev, "failed to get wakeup EINT IRQ %d\n", i);
+			of_node_put(eint0_np);
 			return -ENXIO;
 		}
 
@@ -730,6 +732,7 @@ static int s3c64xx_eint_eint0_init(struc
 						 s3c64xx_eint0_handlers[i],
 						 data);
 	}
+	of_node_put(eint0_np);
 
 	bank = d->pin_banks;
 	for (i = 0; i < d->nr_banks; ++i, ++bank) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c
--- linux-libre-4.4.206-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-21 04:35:48.000000000 -0500
@@ -286,6 +286,7 @@ static int samsung_dt_node_to_map(struct
 						&reserved_maps, num_maps);
 		if (ret < 0) {
 			samsung_dt_free_map(pctldev, *map, *num_maps);
+			of_node_put(np);
 			return ret;
 		}
 	}
@@ -753,8 +754,10 @@ static struct samsung_pmx_func *samsung_
 		if (!of_get_child_count(cfg_np)) {
 			ret = samsung_pinctrl_create_function(dev, drvdata,
 							cfg_np, func);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(cfg_np);
 				return ERR_PTR(ret);
+			}
 			if (ret > 0) {
 				++func;
 				++func_cnt;
@@ -765,8 +768,11 @@ static struct samsung_pmx_func *samsung_
 		for_each_child_of_node(cfg_np, func_np) {
 			ret = samsung_pinctrl_create_function(dev, drvdata,
 						func_np, func);
-			if (ret < 0)
+			if (ret < 0) {
+				of_node_put(func_np);
+				of_node_put(cfg_np);
 				return ERR_PTR(ret);
+			}
 			if (ret > 0) {
 				++func;
 				++func_cnt;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/rtc/rtc-max8997.c linux-libre-4.4.207-gnu/drivers/rtc/rtc-max8997.c
--- linux-libre-4.4.206-gnu/drivers/rtc/rtc-max8997.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/rtc/rtc-max8997.c	2019-12-21 04:35:48.000000000 -0500
@@ -221,7 +221,7 @@ static int max8997_rtc_read_alarm(struct
 
 out:
 	mutex_unlock(&info->lock);
-	return 0;
+	return ret;
 }
 
 static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/s390/scsi/zfcp_dbf.c linux-libre-4.4.207-gnu/drivers/s390/scsi/zfcp_dbf.c
--- linux-libre-4.4.206-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-21 04:35:48.000000000 -0500
@@ -93,11 +93,9 @@ void zfcp_dbf_hba_fsf_res(char *tag, int
 	memcpy(rec->u.res.fsf_status_qual, &q_head->fsf_status_qual,
 	       FSF_STATUS_QUALIFIER_SIZE);
 
-	if (req->fsf_command != FSF_QTCB_FCP_CMND) {
-		rec->pl_len = q_head->log_length;
-		zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start,
-				  rec->pl_len, "fsf_res", req->req_id);
-	}
+	rec->pl_len = q_head->log_length;
+	zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start,
+			  rec->pl_len, "fsf_res", req->req_id);
 
 	debug_event(dbf->hba, level, rec, sizeof(*rec));
 	spin_unlock_irqrestore(&dbf->hba_lock, flags);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/s390/scsi/zfcp_erp.c linux-libre-4.4.207-gnu/drivers/s390/scsi/zfcp_erp.c
--- linux-libre-4.4.206-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-21 04:35:48.000000000 -0500
@@ -178,9 +178,6 @@ static int zfcp_erp_handle_failed(int wa
 				adapter, ZFCP_STATUS_COMMON_ERP_FAILED);
 		}
 		break;
-	default:
-		need = 0;
-		break;
 	}
 
 	return need;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc_attr.c linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc_attr.c
--- linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-21 04:35:48.000000000 -0500
@@ -1213,6 +1213,9 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
 		max_vpi = (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) > 0) ?
 			(bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - 1) : 0;
 
+		/* Limit the max we support */
+		if (max_vpi > LPFC_MAX_VPI)
+			max_vpi = LPFC_MAX_VPI;
 		if (mvpi)
 			*mvpi = max_vpi;
 		if (avpi)
@@ -1228,8 +1231,13 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
 			*axri = pmb->un.varRdConfig.avail_xri;
 		if (mvpi)
 			*mvpi = pmb->un.varRdConfig.max_vpi;
-		if (avpi)
-			*avpi = pmb->un.varRdConfig.avail_vpi;
+		if (avpi) {
+			/* avail_vpi is only valid if link is up and ready */
+			if (phba->link_state == LPFC_HBA_READY)
+				*avpi = pmb->un.varRdConfig.avail_vpi;
+			else
+				*avpi = pmb->un.varRdConfig.max_vpi;
+		}
 	}
 
 	mempool_free(pmboxq, phba->mbox_mem_pool);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc.h linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc.h
--- linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-21 04:35:48.000000000 -0500
@@ -867,7 +867,8 @@ struct lpfc_hba {
 	struct list_head port_list;
 	struct lpfc_vport *pport;	/* physical lpfc_vport pointer */
 	uint16_t max_vpi;		/* Maximum virtual nports */
-#define LPFC_MAX_VPI 0xFFFF		/* Max number of VPI supported */
+#define LPFC_MAX_VPI	0xFF		/* Max number VPI supported 0 - 0xff */
+#define LPFC_MAX_VPORTS	0x100		/* Max vports per port, with pport */
 	uint16_t max_vports;            /*
 					 * For IOV HBAs max_vpi can change
 					 * after a reset. max_vports is max
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc_init.c linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc_init.c
--- linux-libre-4.4.206-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-05 12:06:12.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-22 02:15:46.000000000 -0500
@@ -6890,6 +6890,9 @@ lpfc_sli4_read_config(struct lpfc_hba *p
 			bf_get(lpfc_mbx_rd_conf_xri_base, rd_config);
 		phba->sli4_hba.max_cfg_param.max_vpi =
 			bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config);
+		/* Limit the max we support */
+		if (phba->sli4_hba.max_cfg_param.max_vpi > LPFC_MAX_VPORTS)
+			phba->sli4_hba.max_cfg_param.max_vpi = LPFC_MAX_VPORTS;
 		phba->sli4_hba.max_cfg_param.vpi_base =
 			bf_get(lpfc_mbx_rd_conf_vpi_base, rd_config);
 		phba->sli4_hba.max_cfg_param.max_rpi =
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_attr.c linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_attr.c
--- linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-21 04:35:48.000000000 -0500
@@ -760,7 +760,8 @@ qla2x00_sysfs_write_reset(struct file *f
 			break;
 		} else {
 			/* Make sure FC side is not in reset */
-			qla2x00_wait_for_hba_online(vha);
+			WARN_ON_ONCE(qla2x00_wait_for_hba_online(vha) !=
+				     QLA_SUCCESS);
 
 			/* Issue MPI reset */
 			scsi_block_requests(vha->host);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_bsg.c linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_bsg.c
--- linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-21 04:35:48.000000000 -0500
@@ -336,6 +336,8 @@ qla2x00_process_els(struct fc_bsg_job *b
 		dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list,
 		bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
 	if (!req_sg_cnt) {
+		dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list,
+		    bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
 		rval = -ENOMEM;
 		goto done_free_fcport;
 	}
@@ -343,6 +345,8 @@ qla2x00_process_els(struct fc_bsg_job *b
 	rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list,
 		bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE);
         if (!rsp_sg_cnt) {
+		dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list,
+		    bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE);
 		rval = -ENOMEM;
 		goto done_free_fcport;
 	}
@@ -1739,8 +1743,8 @@ qla24xx_process_bidir_cmd(struct fc_bsg_
 	uint16_t nextlid = 0;
 	uint32_t tot_dsds;
 	srb_t *sp = NULL;
-	uint32_t req_data_len = 0;
-	uint32_t rsp_data_len = 0;
+	uint32_t req_data_len;
+	uint32_t rsp_data_len;
 
 	/* Check the type of the adapter */
 	if (!IS_BIDI_CAPABLE(ha)) {
@@ -1845,6 +1849,9 @@ qla24xx_process_bidir_cmd(struct fc_bsg_
 		goto done_unmap_sg;
 	}
 
+	req_data_len = bsg_job->request_payload.payload_len;
+	rsp_data_len = bsg_job->reply_payload.payload_len;
+
 	if (req_data_len != rsp_data_len) {
 		rval = EXT_STATUS_BUSY;
 		ql_log(ql_log_warn, vha, 0x70aa,
@@ -1852,10 +1859,6 @@ qla24xx_process_bidir_cmd(struct fc_bsg_
 		goto done_unmap_sg;
 	}
 
-	req_data_len = bsg_job->request_payload.payload_len;
-	rsp_data_len = bsg_job->reply_payload.payload_len;
-
-
 	/* Alloc SRB structure */
 	sp = qla2x00_get_sp(vha, &(vha->bidir_fcport), GFP_KERNEL);
 	if (!sp) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_target.c linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_target.c
--- linux-libre-4.4.206-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-21 04:35:48.000000000 -0500
@@ -6026,7 +6026,8 @@ qlt_enable_vha(struct scsi_qla_host *vha
 	} else {
 		set_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags);
 		qla2xxx_wake_dpc(base_vha);
-		qla2x00_wait_for_hba_online(base_vha);
+		WARN_ON_ONCE(qla2x00_wait_for_hba_online(base_vha) !=
+			     QLA_SUCCESS);
 	}
 }
 EXPORT_SYMBOL(qlt_enable_vha);
@@ -6056,7 +6057,9 @@ static void qlt_disable_vha(struct scsi_
 
 	set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
 	qla2xxx_wake_dpc(vha);
-	qla2x00_wait_for_hba_online(vha);
+	if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS)
+		ql_dbg(ql_dbg_tgt, vha, 0xe081,
+		       "qla2x00_wait_for_hba_online() failed\n");
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/spi/spi-atmel.c linux-libre-4.4.207-gnu/drivers/spi/spi-atmel.c
--- linux-libre-4.4.206-gnu/drivers/spi/spi-atmel.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/spi/spi-atmel.c	2019-12-21 04:35:48.000000000 -0500
@@ -1209,10 +1209,8 @@ static int atmel_spi_setup(struct spi_de
 	as = spi_master_get_devdata(spi->master);
 
 	/* see notes above re chipselect */
-	if (!atmel_spi_is_v2(as)
-			&& spi->chip_select == 0
-			&& (spi->mode & SPI_CS_HIGH)) {
-		dev_dbg(&spi->dev, "setup: can't be active-high\n");
+	if (!as->use_cs_gpios && (spi->mode & SPI_CS_HIGH)) {
+		dev_warn(&spi->dev, "setup: non GPIO CS can't be active-high\n");
 		return -EINVAL;
 	}
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/staging/iio/addac/adt7316-i2c.c linux-libre-4.4.207-gnu/drivers/staging/iio/addac/adt7316-i2c.c
--- linux-libre-4.4.206-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-21 04:35:48.000000000 -0500
@@ -35,6 +35,8 @@ static int adt7316_i2c_read(void *client
 		return ret;
 	}
 
+	*data = ret;
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c linux-libre-4.4.207-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c
--- linux-libre-4.4.206-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-21 04:35:48.000000000 -0500
@@ -82,7 +82,7 @@ static struct dvobj_priv *usb_dvobj_init
 	phost_conf = pusbd->actconfig;
 	pconf_desc = &phost_conf->desc;
 
-	phost_iface = &usb_intf->altsetting[0];
+	phost_iface = usb_intf->cur_altsetting;
 	piface_desc = &phost_iface->desc;
 
 	pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/staging/rtl8712/usb_intf.c linux-libre-4.4.207-gnu/drivers/staging/rtl8712/usb_intf.c
--- linux-libre-4.4.206-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-21 04:35:48.000000000 -0500
@@ -263,7 +263,7 @@ static uint r8712_usb_dvobj_init(struct
 
 	pdvobjpriv->padapter = padapter;
 	padapter->EepromAddressSize = 6;
-	phost_iface = &pintf->altsetting[0];
+	phost_iface = pintf->cur_altsetting;
 	piface_desc = &phost_iface->desc;
 	pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
 	if (pusbd->speed == USB_SPEED_HIGH) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/thermal/thermal_core.c linux-libre-4.4.207-gnu/drivers/thermal/thermal_core.c
--- linux-libre-4.4.206-gnu/drivers/thermal/thermal_core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/thermal/thermal_core.c	2019-12-21 04:35:48.000000000 -0500
@@ -402,7 +402,7 @@ static void thermal_zone_device_set_poll
 		mod_delayed_work(system_freezable_wq, &tz->poll_queue,
 				 msecs_to_jiffies(delay));
 	else
-		cancel_delayed_work_sync(&tz->poll_queue);
+		cancel_delayed_work(&tz->poll_queue);
 }
 
 static void monitor_thermal_zone(struct thermal_zone_device *tz)
@@ -2002,7 +2002,7 @@ void thermal_zone_device_unregister(stru
 
 	mutex_unlock(&thermal_list_lock);
 
-	thermal_zone_device_set_polling(tz, 0);
+	cancel_delayed_work_sync(&tz->poll_queue);
 
 	if (tz->type[0])
 		device_remove_file(&tz->device, &dev_attr_type);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/tty/serial/ifx6x60.c linux-libre-4.4.207-gnu/drivers/tty/serial/ifx6x60.c
--- linux-libre-4.4.206-gnu/drivers/tty/serial/ifx6x60.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/tty/serial/ifx6x60.c	2019-12-21 04:35:48.000000000 -0500
@@ -1241,6 +1241,9 @@ static int ifx_spi_spi_remove(struct spi
 	struct ifx_spi_device *ifx_dev = spi_get_drvdata(spi);
 	/* stop activity */
 	tasklet_kill(&ifx_dev->io_work_tasklet);
+
+	pm_runtime_disable(&spi->dev);
+
 	/* free irq */
 	free_irq(gpio_to_irq(ifx_dev->gpio.reset_out), ifx_dev);
 	free_irq(gpio_to_irq(ifx_dev->gpio.srdy), ifx_dev);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/tty/serial/imx.c linux-libre-4.4.207-gnu/drivers/tty/serial/imx.c
--- linux-libre-4.4.206-gnu/drivers/tty/serial/imx.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/tty/serial/imx.c	2019-12-21 04:35:48.000000000 -0500
@@ -1784,7 +1784,7 @@ imx_console_setup(struct console *co, ch
 
 	retval = clk_prepare(sport->clk_per);
 	if (retval)
-		clk_disable_unprepare(sport->clk_ipg);
+		clk_unprepare(sport->clk_ipg);
 
 error_console:
 	return retval;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/tty/serial/msm_serial.c linux-libre-4.4.207-gnu/drivers/tty/serial/msm_serial.c
--- linux-libre-4.4.206-gnu/drivers/tty/serial/msm_serial.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/tty/serial/msm_serial.c	2019-12-21 04:35:48.000000000 -0500
@@ -823,6 +823,7 @@ static unsigned int msm_get_mctrl(struct
 static void msm_reset(struct uart_port *port)
 {
 	struct msm_port *msm_port = UART_TO_MSM(port);
+	unsigned int mr;
 
 	/* reset everything */
 	msm_write(port, UART_CR_CMD_RESET_RX, UART_CR);
@@ -830,7 +831,10 @@ static void msm_reset(struct uart_port *
 	msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR);
 	msm_write(port, UART_CR_CMD_RESET_BREAK_INT, UART_CR);
 	msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR);
-	msm_write(port, UART_CR_CMD_SET_RFR, UART_CR);
+	msm_write(port, UART_CR_CMD_RESET_RFR, UART_CR);
+	mr = msm_read(port, UART_MR1);
+	mr &= ~UART_MR1_RX_RDY_CTL;
+	msm_write(port, mr, UART_MR1);
 
 	/* Disable DM modes */
 	if (msm_port->is_uartdm)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/tty/serial/serial_core.c linux-libre-4.4.207-gnu/drivers/tty/serial/serial_core.c
--- linux-libre-4.4.206-gnu/drivers/tty/serial/serial_core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/tty/serial/serial_core.c	2019-12-21 04:35:48.000000000 -0500
@@ -1015,7 +1015,7 @@ static int uart_break_ctl(struct tty_str
 
 	mutex_lock(&port->mutex);
 
-	if (uport->type != PORT_UNKNOWN)
+	if (uport->type != PORT_UNKNOWN && uport->ops->break_ctl)
 		uport->ops->break_ctl(uport, break_state);
 
 	mutex_unlock(&port->mutex);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/tty/vt/keyboard.c linux-libre-4.4.207-gnu/drivers/tty/vt/keyboard.c
--- linux-libre-4.4.206-gnu/drivers/tty/vt/keyboard.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/tty/vt/keyboard.c	2019-12-21 04:35:48.000000000 -0500
@@ -1460,7 +1460,7 @@ static void kbd_event(struct input_handl
 
 	if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev))
 		kbd_rawcode(value);
-	if (event_type == EV_KEY)
+	if (event_type == EV_KEY && event_code <= KEY_MAX)
 		kbd_keycode(event_code, value, HW_RAW(handle->dev));
 
 	spin_unlock(&kbd_event_lock);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/atm/ueagle-atm.c linux-libre-4.4.207-gnu/drivers/usb/atm/ueagle-atm.c
--- linux-libre-4.4.206-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-05 12:06:32.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-22 02:16:05.000000000 -0500
@@ -2167,10 +2167,11 @@ resubmit:
 /*
  * Start the modem : init the data and start kernel thread
  */
-static int uea_boot(struct uea_softc *sc)
+static int uea_boot(struct uea_softc *sc, struct usb_interface *intf)
 {
-	int ret, size;
 	struct intr_pkt *intr;
+	int ret = -ENOMEM;
+	int size;
 
 	uea_enters(INS_TO_USBDEV(sc));
 
@@ -2195,6 +2196,11 @@ static int uea_boot(struct uea_softc *sc
 	if (UEA_CHIP_VERSION(sc) == ADI930)
 		load_XILINX_firmware(sc);
 
+	if (intf->cur_altsetting->desc.bNumEndpoints < 1) {
+		ret = -ENODEV;
+		goto err0;
+	}
+
 	intr = kmalloc(size, GFP_KERNEL);
 	if (!intr) {
 		uea_err(INS_TO_USBDEV(sc),
@@ -2211,8 +2217,7 @@ static int uea_boot(struct uea_softc *sc
 	usb_fill_int_urb(sc->urb_int, sc->usb_dev,
 			 usb_rcvintpipe(sc->usb_dev, UEA_INTR_PIPE),
 			 intr, size, uea_intr, sc,
-			 sc->usb_dev->actconfig->interface[0]->altsetting[0].
-			 endpoint[0].desc.bInterval);
+			 intf->cur_altsetting->endpoint[0].desc.bInterval);
 
 	ret = usb_submit_urb(sc->urb_int, GFP_KERNEL);
 	if (ret < 0) {
@@ -2227,6 +2232,7 @@ static int uea_boot(struct uea_softc *sc
 	sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm");
 	if (IS_ERR(sc->kthread)) {
 		uea_err(INS_TO_USBDEV(sc), "failed to create thread\n");
+		ret = PTR_ERR(sc->kthread);
 		goto err2;
 	}
 
@@ -2241,7 +2247,7 @@ err1:
 	kfree(intr);
 err0:
 	uea_leaves(INS_TO_USBDEV(sc));
-	return -ENOMEM;
+	return ret;
 }
 
 /*
@@ -2604,7 +2610,7 @@ static int uea_bind(struct usbatm_data *
 	if (ret < 0)
 		goto error;
 
-	ret = uea_boot(sc);
+	ret = uea_boot(sc, intf);
 	if (ret < 0)
 		goto error_rm_grp;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/core/hub.c linux-libre-4.4.207-gnu/drivers/usb/core/hub.c
--- linux-libre-4.4.206-gnu/drivers/usb/core/hub.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/core/hub.c	2019-12-21 04:35:48.000000000 -0500
@@ -5554,7 +5554,7 @@ re_enumerate_no_bos:
 
 /**
  * usb_reset_device - warn interface drivers and perform a USB port reset
- * @udev: device to reset (not in SUSPENDED or NOTATTACHED state)
+ * @udev: device to reset (not in NOTATTACHED state)
  *
  * Warns all drivers bound to registered interfaces (using their pre_reset
  * method), performs the port reset, and then lets the drivers know that
@@ -5582,8 +5582,7 @@ int usb_reset_device(struct usb_device *
 	struct usb_host_config *config = udev->actconfig;
 	struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent);
 
-	if (udev->state == USB_STATE_NOTATTACHED ||
-			udev->state == USB_STATE_SUSPENDED) {
+	if (udev->state == USB_STATE_NOTATTACHED) {
 		dev_dbg(&udev->dev, "device reset not allowed in state %d\n",
 				udev->state);
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/core/urb.c linux-libre-4.4.207-gnu/drivers/usb/core/urb.c
--- linux-libre-4.4.206-gnu/drivers/usb/core/urb.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/core/urb.c	2019-12-21 04:35:48.000000000 -0500
@@ -40,6 +40,7 @@ void usb_init_urb(struct urb *urb)
 	if (urb) {
 		memset(urb, 0, sizeof(*urb));
 		kref_init(&urb->kref);
+		INIT_LIST_HEAD(&urb->urb_list);
 		INIT_LIST_HEAD(&urb->anchor_list);
 	}
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/gadget/configfs.c linux-libre-4.4.207-gnu/drivers/usb/gadget/configfs.c
--- linux-libre-4.4.206-gnu/drivers/usb/gadget/configfs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/gadget/configfs.c	2019-12-21 04:35:48.000000000 -0500
@@ -1542,6 +1542,7 @@ static struct config_group *gadgets_make
 	gi->composite.resume = NULL;
 	gi->composite.max_speed = USB_SPEED_SUPER;
 
+	spin_lock_init(&gi->spinlock);
 	mutex_init(&gi->lock);
 	INIT_LIST_HEAD(&gi->string_list);
 	INIT_LIST_HEAD(&gi->available_func);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/gadget/function/u_serial.c linux-libre-4.4.207-gnu/drivers/usb/gadget/function/u_serial.c
--- linux-libre-4.4.206-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-21 04:35:48.000000000 -0500
@@ -1137,8 +1137,10 @@ int gserial_alloc_line(unsigned char *li
 				__func__, port_num, PTR_ERR(tty_dev));
 
 		ret = PTR_ERR(tty_dev);
+		mutex_lock(&ports[port_num].lock);
 		port = ports[port_num].port;
 		ports[port_num].port = NULL;
+		mutex_unlock(&ports[port_num].lock);
 		gserial_free_port(port);
 		goto err;
 	}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci.c linux-libre-4.4.207-gnu/drivers/usb/host/xhci.c
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci.c	2019-12-21 04:35:48.000000000 -0500
@@ -754,11 +754,8 @@ void xhci_shutdown(struct usb_hcd *hcd)
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"xhci_shutdown completed - status = %x",
 			readl(&xhci->op_regs->status));
-
-	/* Yet another workaround for spurious wakeups at shutdown with HSW */
-	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
-		pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot);
 }
+EXPORT_SYMBOL_GPL(xhci_shutdown);
 
 #ifdef CONFIG_PM
 static void xhci_save_registers(struct xhci_hcd *xhci)
@@ -929,7 +926,7 @@ static bool xhci_pending_portevent(struc
 int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 {
 	int			rc = 0;
-	unsigned int		delay = XHCI_MAX_HALT_USEC;
+	unsigned int		delay = XHCI_MAX_HALT_USEC * 2;
 	struct usb_hcd		*hcd = xhci_to_hcd(xhci);
 	u32			command;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci.h linux-libre-4.4.207-gnu/drivers/usb/host/xhci.h
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci.h	2019-12-21 04:35:48.000000000 -0500
@@ -314,6 +314,7 @@ struct xhci_op_regs {
 #define XDEV_U3		(0x3 << 5)
 #define XDEV_INACTIVE	(0x6 << 5)
 #define XDEV_POLLING	(0x7 << 5)
+#define XDEV_RECOVERY	(0x8 << 5)
 #define XDEV_COMP_MODE  (0xa << 5)
 #define XDEV_RESUME	(0xf << 5)
 /* true: port has power (see HCC_PPC) */
@@ -1833,6 +1834,7 @@ int xhci_run(struct usb_hcd *hcd);
 void xhci_stop(struct usb_hcd *hcd);
 void xhci_shutdown(struct usb_hcd *hcd);
 int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks);
+void xhci_shutdown(struct usb_hcd *hcd);
 void xhci_init_driver(struct hc_driver *drv,
 		      const struct xhci_driver_overrides *over);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci-hub.c linux-libre-4.4.207-gnu/drivers/usb/host/xhci-hub.c
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci-hub.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci-hub.c	2019-12-21 04:35:48.000000000 -0500
@@ -704,7 +704,7 @@ static u32 xhci_get_port_status(struct u
 		struct xhci_bus_state *bus_state,
 		__le32 __iomem **port_array,
 		u16 wIndex, u32 raw_port_status,
-		unsigned long flags)
+		unsigned long *flags)
 	__releases(&xhci->lock)
 	__acquires(&xhci->lock)
 {
@@ -736,6 +736,14 @@ static u32 xhci_get_port_status(struct u
 			status |= USB_PORT_STAT_C_BH_RESET << 16;
 		if ((raw_port_status & PORT_CEC))
 			status |= USB_PORT_STAT_C_CONFIG_ERROR << 16;
+
+		/* USB3 remote wake resume signaling completed */
+		if (bus_state->port_remote_wakeup & (1 << wIndex) &&
+		    (raw_port_status & PORT_PLS_MASK) != XDEV_RESUME &&
+		    (raw_port_status & PORT_PLS_MASK) != XDEV_RECOVERY) {
+			bus_state->port_remote_wakeup &= ~(1 << wIndex);
+			usb_hcd_end_port_resume(&hcd->self, wIndex);
+		}
 	}
 
 	if (hcd->speed < HCD_USB3) {
@@ -786,12 +794,12 @@ static u32 xhci_get_port_status(struct u
 			xhci_set_link_state(xhci, port_array, wIndex,
 					XDEV_U0);
 
-			spin_unlock_irqrestore(&xhci->lock, flags);
+			spin_unlock_irqrestore(&xhci->lock, *flags);
 			time_left = wait_for_completion_timeout(
 					&bus_state->rexit_done[wIndex],
 					msecs_to_jiffies(
 						XHCI_MAX_REXIT_TIMEOUT_MS));
-			spin_lock_irqsave(&xhci->lock, flags);
+			spin_lock_irqsave(&xhci->lock, *flags);
 
 			if (time_left) {
 				slot_id = xhci_find_slot_id_by_port(hcd,
@@ -937,7 +945,7 @@ int xhci_hub_control(struct usb_hcd *hcd
 			break;
 		}
 		status = xhci_get_port_status(hcd, bus_state, port_array,
-				wIndex, temp, flags);
+				wIndex, temp, &flags);
 		if (status == 0xffffffff)
 			goto error;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci-mem.c linux-libre-4.4.207-gnu/drivers/usb/host/xhci-mem.c
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci-mem.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci-mem.c	2019-12-21 04:35:48.000000000 -0500
@@ -1928,10 +1928,14 @@ no_bw:
 	kfree(xhci->port_array);
 	kfree(xhci->rh_bw);
 	kfree(xhci->ext_caps);
+	kfree(xhci->usb2_rhub.psi);
+	kfree(xhci->usb3_rhub.psi);
 
 	xhci->usb2_ports = NULL;
 	xhci->usb3_ports = NULL;
 	xhci->port_array = NULL;
+	xhci->usb2_rhub.psi = NULL;
+	xhci->usb3_rhub.psi = NULL;
 	xhci->rh_bw = NULL;
 	xhci->ext_caps = NULL;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci-pci.c linux-libre-4.4.207-gnu/drivers/usb/host/xhci-pci.c
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci-pci.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci-pci.c	2019-12-21 04:35:48.000000000 -0500
@@ -446,6 +446,18 @@ static int xhci_pci_resume(struct usb_hc
 }
 #endif /* CONFIG_PM */
 
+static void xhci_pci_shutdown(struct usb_hcd *hcd)
+{
+	struct xhci_hcd		*xhci = hcd_to_xhci(hcd);
+	struct pci_dev		*pdev = to_pci_dev(hcd->self.controller);
+
+	xhci_shutdown(hcd);
+
+	/* Yet another workaround for spurious wakeups at shutdown with HSW */
+	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
+		pci_set_power_state(pdev, PCI_D3hot);
+}
+
 /*-------------------------------------------------------------------------*/
 
 /* PCI driver selection metadata; PCI hotplugging uses this */
@@ -481,6 +493,7 @@ static int __init xhci_pci_init(void)
 #ifdef CONFIG_PM
 	xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
 	xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
+	xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
 #endif
 	return pci_register_driver(&xhci_pci_driver);
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/host/xhci-ring.c linux-libre-4.4.207-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-4.4.206-gnu/drivers/usb/host/xhci-ring.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/host/xhci-ring.c	2019-12-21 04:35:48.000000000 -0500
@@ -1602,9 +1602,6 @@ static void handle_port_status(struct xh
 		usb_hcd_resume_root_hub(hcd);
 	}
 
-	if (hcd->speed >= HCD_USB3 && (temp & PORT_PLS_MASK) == XDEV_INACTIVE)
-		bus_state->port_remote_wakeup &= ~(1 << faked_port_index);
-
 	if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_RESUME) {
 		xhci_dbg(xhci, "port resume event for port %d\n", port_id);
 
@@ -1623,6 +1620,7 @@ static void handle_port_status(struct xh
 			bus_state->port_remote_wakeup |= 1 << faked_port_index;
 			xhci_test_and_clear_bit(xhci, port_array,
 					faked_port_index, PORT_PLC);
+			usb_hcd_start_port_resume(&hcd->self, faked_port_index);
 			xhci_set_link_state(xhci, port_array, faked_port_index,
 						XDEV_U0);
 			/* Need to wait until the next link state change
@@ -1660,8 +1658,6 @@ static void handle_port_status(struct xh
 		if (slot_id && xhci->devs[slot_id])
 			xhci_ring_device(xhci, slot_id);
 		if (bus_state->port_remote_wakeup & (1 << faked_port_index)) {
-			bus_state->port_remote_wakeup &=
-				~(1 << faked_port_index);
 			xhci_test_and_clear_bit(xhci, port_array,
 					faked_port_index, PORT_PLC);
 			usb_wakeup_notification(hcd->self.root_hub,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/misc/adutux.c linux-libre-4.4.207-gnu/drivers/usb/misc/adutux.c
--- linux-libre-4.4.206-gnu/drivers/usb/misc/adutux.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/misc/adutux.c	2019-12-21 04:35:48.000000000 -0500
@@ -686,7 +686,7 @@ static int adu_probe(struct usb_interfac
 	init_waitqueue_head(&dev->read_wait);
 	init_waitqueue_head(&dev->write_wait);
 
-	iface_desc = &interface->altsetting[0];
+	iface_desc = &interface->cur_altsetting[0];
 
 	/* set up the endpoint information */
 	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/misc/idmouse.c linux-libre-4.4.207-gnu/drivers/usb/misc/idmouse.c
--- linux-libre-4.4.206-gnu/drivers/usb/misc/idmouse.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/misc/idmouse.c	2019-12-21 04:35:48.000000000 -0500
@@ -342,7 +342,7 @@ static int idmouse_probe(struct usb_inte
 	int result;
 
 	/* check if we have gotten the data or the hid interface */
-	iface_desc = &interface->altsetting[0];
+	iface_desc = interface->cur_altsetting;
 	if (iface_desc->desc.bInterfaceClass != 0x0A)
 		return -ENODEV;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/mon/mon_bin.c linux-libre-4.4.207-gnu/drivers/usb/mon/mon_bin.c
--- linux-libre-4.4.206-gnu/drivers/usb/mon/mon_bin.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/mon/mon_bin.c	2019-12-21 04:35:48.000000000 -0500
@@ -1035,12 +1035,18 @@ static long mon_bin_ioctl(struct file *f
 
 		mutex_lock(&rp->fetch_lock);
 		spin_lock_irqsave(&rp->b_lock, flags);
-		mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE);
-		kfree(rp->b_vec);
-		rp->b_vec  = vec;
-		rp->b_size = size;
-		rp->b_read = rp->b_in = rp->b_out = rp->b_cnt = 0;
-		rp->cnt_lost = 0;
+		if (rp->mmap_active) {
+			mon_free_buff(vec, size/CHUNK_SIZE);
+			kfree(vec);
+			ret = -EBUSY;
+		} else {
+			mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE);
+			kfree(rp->b_vec);
+			rp->b_vec  = vec;
+			rp->b_size = size;
+			rp->b_read = rp->b_in = rp->b_out = rp->b_cnt = 0;
+			rp->cnt_lost = 0;
+		}
 		spin_unlock_irqrestore(&rp->b_lock, flags);
 		mutex_unlock(&rp->fetch_lock);
 		}
@@ -1212,13 +1218,21 @@ mon_bin_poll(struct file *file, struct p
 static void mon_bin_vma_open(struct vm_area_struct *vma)
 {
 	struct mon_reader_bin *rp = vma->vm_private_data;
+	unsigned long flags;
+
+	spin_lock_irqsave(&rp->b_lock, flags);
 	rp->mmap_active++;
+	spin_unlock_irqrestore(&rp->b_lock, flags);
 }
 
 static void mon_bin_vma_close(struct vm_area_struct *vma)
 {
+	unsigned long flags;
+
 	struct mon_reader_bin *rp = vma->vm_private_data;
+	spin_lock_irqsave(&rp->b_lock, flags);
 	rp->mmap_active--;
+	spin_unlock_irqrestore(&rp->b_lock, flags);
 }
 
 /*
@@ -1230,16 +1244,12 @@ static int mon_bin_vma_fault(struct vm_a
 	unsigned long offset, chunk_idx;
 	struct page *pageptr;
 
-	mutex_lock(&rp->fetch_lock);
 	offset = vmf->pgoff << PAGE_SHIFT;
-	if (offset >= rp->b_size) {
-		mutex_unlock(&rp->fetch_lock);
+	if (offset >= rp->b_size)
 		return VM_FAULT_SIGBUS;
-	}
 	chunk_idx = offset / CHUNK_SIZE;
 	pageptr = rp->b_vec[chunk_idx].pg;
 	get_page(pageptr);
-	mutex_unlock(&rp->fetch_lock);
 	vmf->page = pageptr;
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/usb/serial/io_edgeport.c linux-libre-4.4.207-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-4.4.206-gnu/drivers/usb/serial/io_edgeport.c	2019-12-05 12:07:03.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/usb/serial/io_edgeport.c	2019-12-22 02:16:37.000000000 -0500
@@ -2859,16 +2859,18 @@ static int edge_startup(struct usb_seria
 	response = 0;
 
 	if (edge_serial->is_epic) {
+		struct usb_host_interface *alt;
+
+		alt = serial->interface->cur_altsetting;
+
 		/* EPIC thing, set up our interrupt polling now and our read
 		 * urb, so that the device knows it really is connected. */
 		interrupt_in_found = bulk_in_found = bulk_out_found = false;
-		for (i = 0; i < serial->interface->altsetting[0]
-						.desc.bNumEndpoints; ++i) {
+		for (i = 0; i < alt->desc.bNumEndpoints; ++i) {
 			struct usb_endpoint_descriptor *endpoint;
 			int buffer_size;
 
-			endpoint = &serial->interface->altsetting[0].
-							endpoint[i].desc;
+			endpoint = &alt->endpoint[i].desc;
 			buffer_size = usb_endpoint_maxp(endpoint);
 			if (!interrupt_in_found &&
 			    (usb_endpoint_is_int_in(endpoint))) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/vfio/pci/vfio_pci_intrs.c linux-libre-4.4.207-gnu/drivers/vfio/pci/vfio_pci_intrs.c
--- linux-libre-4.4.206-gnu/drivers/vfio/pci/vfio_pci_intrs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/vfio/pci/vfio_pci_intrs.c	2019-12-21 04:35:48.000000000 -0500
@@ -318,8 +318,8 @@ static int vfio_msi_set_vector_signal(st
 		return -EINVAL;
 
 	if (vdev->ctx[vector].trigger) {
-		free_irq(irq, vdev->ctx[vector].trigger);
 		irq_bypass_unregister_producer(&vdev->ctx[vector].producer);
+		free_irq(irq, vdev->ctx[vector].trigger);
 		kfree(vdev->ctx[vector].name);
 		eventfd_ctx_put(vdev->ctx[vector].trigger);
 		vdev->ctx[vector].trigger = NULL;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/video/hdmi.c linux-libre-4.4.207-gnu/drivers/video/hdmi.c
--- linux-libre-4.4.206-gnu/drivers/video/hdmi.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/video/hdmi.c	2019-12-21 04:35:48.000000000 -0500
@@ -1032,12 +1032,12 @@ static int hdmi_avi_infoframe_unpack(str
 	if (ptr[0] & 0x10)
 		frame->active_aspect = ptr[1] & 0xf;
 	if (ptr[0] & 0x8) {
-		frame->top_bar = (ptr[5] << 8) + ptr[6];
-		frame->bottom_bar = (ptr[7] << 8) + ptr[8];
+		frame->top_bar = (ptr[6] << 8) | ptr[5];
+		frame->bottom_bar = (ptr[8] << 8) | ptr[7];
 	}
 	if (ptr[0] & 0x4) {
-		frame->left_bar = (ptr[9] << 8) + ptr[10];
-		frame->right_bar = (ptr[11] << 8) + ptr[12];
+		frame->left_bar = (ptr[10] << 8) | ptr[9];
+		frame->right_bar = (ptr[12] << 8) | ptr[11];
 	}
 	frame->scan_mode = ptr[0] & 0x3;
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/drivers/virtio/virtio_balloon.c linux-libre-4.4.207-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-4.4.206-gnu/drivers/virtio/virtio_balloon.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/drivers/virtio/virtio_balloon.c	2019-12-21 04:35:48.000000000 -0500
@@ -468,6 +468,17 @@ static int virtballoon_migratepage(struc
 
 	get_page(newpage); /* balloon reference */
 
+	/*
+	  * When we migrate a page to a different zone and adjusted the
+	  * managed page count when inflating, we have to fixup the count of
+	  * both involved zones.
+	  */
+	if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM) &&
+	    page_zone(page) != page_zone(newpage)) {
+		adjust_managed_page_count(page, 1);
+		adjust_managed_page_count(newpage, -1);
+	}
+
 	/* balloon's page migration 1st step  -- inflate "newpage" */
 	spin_lock_irqsave(&vb_dev_info->pages_lock, flags);
 	balloon_page_insert(vb_dev_info, newpage);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/autofs4/expire.c linux-libre-4.4.207-gnu/fs/autofs4/expire.c
--- linux-libre-4.4.206-gnu/fs/autofs4/expire.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/autofs4/expire.c	2019-12-21 04:35:48.000000000 -0500
@@ -467,9 +467,10 @@ struct dentry *autofs4_expire_indirect(s
 		 */
 		flags &= ~AUTOFS_EXP_LEAVES;
 		found = should_expire(expired, mnt, timeout, how);
-		if (!found || found != expired)
-			/* Something has changed, continue */
+		if (found != expired) { // something has changed, continue
+			dput(found);
 			goto next;
+		}
 
 		if (expired != dentry)
 			dput(dentry);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/btrfs/file.c linux-libre-4.4.207-gnu/fs/btrfs/file.c
--- linux-libre-4.4.206-gnu/fs/btrfs/file.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/btrfs/file.c	2019-12-21 04:35:48.000000000 -0500
@@ -1525,6 +1525,7 @@ static noinline ssize_t __btrfs_buffered
 		}
 
 		reserve_bytes = num_pages << PAGE_CACHE_SHIFT;
+		only_release_metadata = false;
 
 		if ((BTRFS_I(inode)->flags & (BTRFS_INODE_NODATACOW |
 					      BTRFS_INODE_PREALLOC)) &&
@@ -1659,7 +1660,6 @@ again:
 			set_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
 				       lockend, EXTENT_NORESERVE, NULL,
 				       NULL, GFP_NOFS);
-			only_release_metadata = false;
 		}
 
 		btrfs_drop_pages(pages, num_pages);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/btrfs/free-space-cache.c linux-libre-4.4.207-gnu/fs/btrfs/free-space-cache.c
--- linux-libre-4.4.206-gnu/fs/btrfs/free-space-cache.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/btrfs/free-space-cache.c	2019-12-21 04:35:48.000000000 -0500
@@ -391,6 +391,12 @@ static int io_ctl_prepare_pages(struct b
 		if (uptodate && !PageUptodate(page)) {
 			btrfs_readpage(NULL, page);
 			lock_page(page);
+			if (page->mapping != inode->i_mapping) {
+				btrfs_err(BTRFS_I(inode)->root->fs_info,
+					  "free space cache page truncated");
+				io_ctl_drop_pages(io_ctl);
+				return -EIO;
+			}
 			if (!PageUptodate(page)) {
 				btrfs_err(BTRFS_I(inode)->root->fs_info,
 					   "error reading free space cache");
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/btrfs/volumes.h linux-libre-4.4.207-gnu/fs/btrfs/volumes.h
--- linux-libre-4.4.206-gnu/fs/btrfs/volumes.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/btrfs/volumes.h	2019-12-21 04:35:48.000000000 -0500
@@ -312,7 +312,6 @@ struct btrfs_bio {
 	u64 map_type; /* get from map_lookup->type */
 	bio_end_io_t *end_io;
 	struct bio *orig_bio;
-	unsigned long flags;
 	void *private;
 	atomic_t error;
 	int max_errors;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/cifs/file.c linux-libre-4.4.207-gnu/fs/cifs/file.c
--- linux-libre-4.4.206-gnu/fs/cifs/file.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/cifs/file.c	2019-12-21 04:35:48.000000000 -0500
@@ -312,9 +312,6 @@ cifs_new_fileinfo(struct cifs_fid *fid,
 	INIT_LIST_HEAD(&fdlocks->locks);
 	fdlocks->cfile = cfile;
 	cfile->llist = fdlocks;
-	cifs_down_write(&cinode->lock_sem);
-	list_add(&fdlocks->llist, &cinode->llist);
-	up_write(&cinode->lock_sem);
 
 	cfile->count = 1;
 	cfile->pid = current->tgid;
@@ -338,6 +335,10 @@ cifs_new_fileinfo(struct cifs_fid *fid,
 		oplock = 0;
 	}
 
+	cifs_down_write(&cinode->lock_sem);
+	list_add(&fdlocks->llist, &cinode->llist);
+	up_write(&cinode->lock_sem);
+
 	spin_lock(&tcon->open_file_lock);
 	if (fid->pending_open->oplock != CIFS_OPLOCK_NO_CHANGE && oplock)
 		oplock = fid->pending_open->oplock;
@@ -702,6 +703,13 @@ cifs_reopen_file(struct cifsFileInfo *cf
 	if (backup_cred(cifs_sb))
 		create_options |= CREATE_OPEN_BACKUP_INTENT;
 
+	/* O_SYNC also has bit for O_DSYNC so following check picks up either */
+	if (cfile->f_flags & O_SYNC)
+		create_options |= CREATE_WRITE_THROUGH;
+
+	if (cfile->f_flags & O_DIRECT)
+		create_options |= CREATE_NO_BUFFER;
+
 	if (server->ops->get_lease_key)
 		server->ops->get_lease_key(inode, &cfile->fid);
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/cifs/smb2misc.c linux-libre-4.4.207-gnu/fs/cifs/smb2misc.c
--- linux-libre-4.4.206-gnu/fs/cifs/smb2misc.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/cifs/smb2misc.c	2019-12-21 04:35:48.000000000 -0500
@@ -582,10 +582,10 @@ smb2_is_valid_oplock_break(char *buffer,
 	spin_lock(&cifs_tcp_ses_lock);
 	list_for_each(tmp, &server->smb_ses_list) {
 		ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
+
 		list_for_each(tmp1, &ses->tcon_list) {
 			tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
 
-			cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks);
 			spin_lock(&tcon->open_file_lock);
 			list_for_each(tmp2, &tcon->openFileList) {
 				cfile = list_entry(tmp2, struct cifsFileInfo,
@@ -597,6 +597,8 @@ smb2_is_valid_oplock_break(char *buffer,
 					continue;
 
 				cifs_dbg(FYI, "file id match, oplock break\n");
+				cifs_stats_inc(
+				    &tcon->stats.cifs_stats.num_oplock_brks);
 				cinode = CIFS_I(d_inode(cfile->dentry));
 				spin_lock(&cfile->file_info_lock);
 				if (!CIFS_CACHE_WRITE(cinode) &&
@@ -628,9 +630,6 @@ smb2_is_valid_oplock_break(char *buffer,
 				return true;
 			}
 			spin_unlock(&tcon->open_file_lock);
-			spin_unlock(&cifs_tcp_ses_lock);
-			cifs_dbg(FYI, "No matching file for oplock break\n");
-			return true;
 		}
 	}
 	spin_unlock(&cifs_tcp_ses_lock);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/dlm/lockspace.c linux-libre-4.4.207-gnu/fs/dlm/lockspace.c
--- linux-libre-4.4.206-gnu/fs/dlm/lockspace.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/dlm/lockspace.c	2019-12-21 04:35:48.000000000 -0500
@@ -800,6 +800,7 @@ static int release_lockspace(struct dlm_
 
 	dlm_delete_debug_file(ls);
 
+	idr_destroy(&ls->ls_recover_idr);
 	kfree(ls->ls_recover_buf);
 
 	/*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/dlm/memory.c linux-libre-4.4.207-gnu/fs/dlm/memory.c
--- linux-libre-4.4.206-gnu/fs/dlm/memory.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/dlm/memory.c	2019-12-21 04:35:48.000000000 -0500
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)
 
 void dlm_memory_exit(void)
 {
-	if (lkb_cache)
-		kmem_cache_destroy(lkb_cache);
-	if (rsb_cache)
-		kmem_cache_destroy(rsb_cache);
+	kmem_cache_destroy(lkb_cache);
+	kmem_cache_destroy(rsb_cache);
 }
 
 char *dlm_allocate_lvb(struct dlm_ls *ls)
@@ -86,8 +84,7 @@ void dlm_free_lkb(struct dlm_lkb *lkb)
 		struct dlm_user_args *ua;
 		ua = lkb->lkb_ua;
 		if (ua) {
-			if (ua->lksb.sb_lvbptr)
-				kfree(ua->lksb.sb_lvbptr);
+			kfree(ua->lksb.sb_lvbptr);
 			kfree(ua);
 		}
 	}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/dlm/user.c linux-libre-4.4.207-gnu/fs/dlm/user.c
--- linux-libre-4.4.206-gnu/fs/dlm/user.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/dlm/user.c	2019-12-21 04:35:48.000000000 -0500
@@ -25,6 +25,7 @@
 #include "lvb_table.h"
 #include "user.h"
 #include "ast.h"
+#include "config.h"
 
 static const char name_prefix[] = "dlm";
 static const struct file_operations device_fops;
@@ -402,7 +403,7 @@ static int device_create_lockspace(struc
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	error = dlm_new_lockspace(params->name, NULL, params->flags,
+	error = dlm_new_lockspace(params->name, dlm_config.ci_cluster_name, params->flags,
 				  DLM_USER_LVB_LEN, NULL, NULL, NULL,
 				  &lockspace);
 	if (error)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/fuse/dir.c linux-libre-4.4.207-gnu/fs/fuse/dir.c
--- linux-libre-4.4.206-gnu/fs/fuse/dir.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/fuse/dir.c	2019-12-21 04:35:48.000000000 -0500
@@ -240,7 +240,8 @@ static int fuse_dentry_revalidate(struct
 		kfree(forget);
 		if (ret == -ENOMEM)
 			goto out;
-		if (ret || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
+		if (ret || fuse_invalid_attr(&outarg.attr) ||
+		    (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
 			goto invalid;
 
 		fuse_change_attributes(inode, &outarg.attr,
@@ -282,6 +283,12 @@ int fuse_valid_type(int m)
 		S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
 }
 
+bool fuse_invalid_attr(struct fuse_attr *attr)
+{
+	return !fuse_valid_type(attr->mode) ||
+		attr->size > LLONG_MAX;
+}
+
 int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
 		     struct fuse_entry_out *outarg, struct inode **inode)
 {
@@ -313,7 +320,7 @@ int fuse_lookup_name(struct super_block
 	err = -EIO;
 	if (!outarg->nodeid)
 		goto out_put_forget;
-	if (!fuse_valid_type(outarg->attr.mode))
+	if (fuse_invalid_attr(&outarg->attr))
 		goto out_put_forget;
 
 	*inode = fuse_iget(sb, outarg->nodeid, outarg->generation,
@@ -433,7 +440,8 @@ static int fuse_create_open(struct inode
 		goto out_free_ff;
 
 	err = -EIO;
-	if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid))
+	if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid) ||
+	    fuse_invalid_attr(&outentry.attr))
 		goto out_free_ff;
 
 	ff->fh = outopen.fh;
@@ -539,7 +547,7 @@ static int create_new_entry(struct fuse_
 		goto out_put_forget_req;
 
 	err = -EIO;
-	if (invalid_nodeid(outarg.nodeid))
+	if (invalid_nodeid(outarg.nodeid) || fuse_invalid_attr(&outarg.attr))
 		goto out_put_forget_req;
 
 	if ((outarg.attr.mode ^ mode) & S_IFMT)
@@ -812,7 +820,8 @@ static int fuse_link(struct dentry *entr
 
 		spin_lock(&fc->lock);
 		fi->attr_version = ++fc->attr_version;
-		inc_nlink(inode);
+		if (likely(inode->i_nlink < UINT_MAX))
+			inc_nlink(inode);
 		spin_unlock(&fc->lock);
 		fuse_invalidate_attr(inode);
 		fuse_update_ctime(inode);
@@ -892,7 +901,8 @@ static int fuse_do_getattr(struct inode
 	args.out.args[0].value = &outarg;
 	err = fuse_simple_request(fc, &args);
 	if (!err) {
-		if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) {
+		if (fuse_invalid_attr(&outarg.attr) ||
+		    (inode->i_mode ^ outarg.attr.mode) & S_IFMT) {
 			make_bad_inode(inode);
 			err = -EIO;
 		} else {
@@ -1197,7 +1207,7 @@ static int fuse_direntplus_link(struct f
 
 	if (invalid_nodeid(o->nodeid))
 		return -EIO;
-	if (!fuse_valid_type(o->attr.mode))
+	if (fuse_invalid_attr(&o->attr))
 		return -EIO;
 
 	fc = get_fuse_conn(dir);
@@ -1669,7 +1679,8 @@ int fuse_do_setattr(struct inode *inode,
 		goto error;
 	}
 
-	if ((inode->i_mode ^ outarg.attr.mode) & S_IFMT) {
+	if (fuse_invalid_attr(&outarg.attr) ||
+	    (inode->i_mode ^ outarg.attr.mode) & S_IFMT) {
 		make_bad_inode(inode);
 		err = -EIO;
 		goto error;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/fuse/fuse_i.h linux-libre-4.4.207-gnu/fs/fuse/fuse_i.h
--- linux-libre-4.4.206-gnu/fs/fuse/fuse_i.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/fuse/fuse_i.h	2019-12-21 04:35:48.000000000 -0500
@@ -887,6 +887,8 @@ void fuse_ctl_remove_conn(struct fuse_co
  */
 int fuse_valid_type(int m);
 
+bool fuse_invalid_attr(struct fuse_attr *attr);
+
 /**
  * Is current process allowed to perform filesystem operation?
  */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/nfsd/nfs4recover.c linux-libre-4.4.207-gnu/fs/nfsd/nfs4recover.c
--- linux-libre-4.4.206-gnu/fs/nfsd/nfs4recover.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/nfsd/nfs4recover.c	2019-12-21 04:35:48.000000000 -0500
@@ -655,7 +655,7 @@ struct cld_net {
 struct cld_upcall {
 	struct list_head	 cu_list;
 	struct cld_net		*cu_net;
-	struct task_struct	*cu_task;
+	struct completion	 cu_done;
 	struct cld_msg		 cu_msg;
 };
 
@@ -664,23 +664,18 @@ __cld_pipe_upcall(struct rpc_pipe *pipe,
 {
 	int ret;
 	struct rpc_pipe_msg msg;
+	struct cld_upcall *cup = container_of(cmsg, struct cld_upcall, cu_msg);
 
 	memset(&msg, 0, sizeof(msg));
 	msg.data = cmsg;
 	msg.len = sizeof(*cmsg);
 
-	/*
-	 * Set task state before we queue the upcall. That prevents
-	 * wake_up_process in the downcall from racing with schedule.
-	 */
-	set_current_state(TASK_UNINTERRUPTIBLE);
 	ret = rpc_queue_upcall(pipe, &msg);
 	if (ret < 0) {
-		set_current_state(TASK_RUNNING);
 		goto out;
 	}
 
-	schedule();
+	wait_for_completion(&cup->cu_done);
 
 	if (msg.errno < 0)
 		ret = msg.errno;
@@ -747,7 +742,7 @@ cld_pipe_downcall(struct file *filp, con
 	if (copy_from_user(&cup->cu_msg, src, mlen) != 0)
 		return -EFAULT;
 
-	wake_up_process(cup->cu_task);
+	complete(&cup->cu_done);
 	return mlen;
 }
 
@@ -762,7 +757,7 @@ cld_pipe_destroy_msg(struct rpc_pipe_msg
 	if (msg->errno >= 0)
 		return;
 
-	wake_up_process(cup->cu_task);
+	complete(&cup->cu_done);
 }
 
 static const struct rpc_pipe_ops cld_upcall_ops = {
@@ -893,7 +888,7 @@ restart_search:
 			goto restart_search;
 		}
 	}
-	new->cu_task = current;
+	init_completion(&new->cu_done);
 	new->cu_msg.cm_vers = CLD_UPCALL_VERSION;
 	put_unaligned(cn->cn_xid++, &new->cu_msg.cm_xid);
 	new->cu_net = cn;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/nfsd/vfs.c linux-libre-4.4.207-gnu/fs/nfsd/vfs.c
--- linux-libre-4.4.206-gnu/fs/nfsd/vfs.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/nfsd/vfs.c	2019-12-21 04:35:48.000000000 -0500
@@ -387,10 +387,23 @@ nfsd_setattr(struct svc_rqst *rqstp, str
 	bool		get_write_count;
 	bool		size_change = (iap->ia_valid & ATTR_SIZE);
 
-	if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME | ATTR_SIZE))
+	if (iap->ia_valid & ATTR_SIZE) {
 		accmode |= NFSD_MAY_WRITE|NFSD_MAY_OWNER_OVERRIDE;
-	if (iap->ia_valid & ATTR_SIZE)
 		ftype = S_IFREG;
+	}
+
+	/*
+	 * If utimes(2) and friends are called with times not NULL, we should
+	 * not set NFSD_MAY_WRITE bit. Otherwise fh_verify->nfsd_permission
+	 * will return EACCESS, when the caller's effective UID does not match
+	 * the owner of the file, and the caller is not privileged. In this
+	 * situation, we should return EPERM(notify_change will return this).
+	 */
+	if (iap->ia_valid & (ATTR_ATIME | ATTR_MTIME)) {
+		accmode |= NFSD_MAY_OWNER_OVERRIDE;
+		if (!(iap->ia_valid & (ATTR_ATIME_SET | ATTR_MTIME_SET)))
+			accmode |= NFSD_MAY_WRITE;
+	}
 
 	/* Callers that do fh_verify should do the fh_want_write: */
 	get_write_count = !fhp->fh_dentry;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/ocfs2/quota_global.c linux-libre-4.4.207-gnu/fs/ocfs2/quota_global.c
--- linux-libre-4.4.206-gnu/fs/ocfs2/quota_global.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/ocfs2/quota_global.c	2019-12-21 04:35:48.000000000 -0500
@@ -714,7 +714,7 @@ static int ocfs2_release_dquot(struct dq
 
 	mutex_lock(&dquot->dq_lock);
 	/* Check whether we are not racing with some other dqget() */
-	if (atomic_read(&dquot->dq_count) > 1)
+	if (dquot_is_busy(dquot))
 		goto out;
 	/* Running from downconvert thread? Postpone quota processing to wq */
 	if (current == osb->dc_task) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/proc/array.c linux-libre-4.4.207-gnu/fs/proc/array.c
--- linux-libre-4.4.206-gnu/fs/proc/array.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/proc/array.c	2019-12-21 04:35:48.000000000 -0500
@@ -425,9 +425,21 @@ static int do_task_stat(struct seq_file
 	mm = get_task_mm(task);
 	if (mm) {
 		vsize = task_vsize(mm);
-		if (permitted) {
-			eip = KSTK_EIP(task);
-			esp = KSTK_ESP(task);
+		/*
+		 * esp and eip are intentionally zeroed out.  There is no
+		 * non-racy way to read them without freezing the task.
+		 * Programs that need reliable values can use ptrace(2).
+		 *
+		 * The only exception is if the task is core dumping because
+		 * a program is not able to use ptrace(2) in that case. It is
+		 * safe because the task has stopped executing permanently.
+		 */
+		if (permitted && (task->flags & (PF_EXITING|PF_DUMPCORE))) {
+			if (try_get_task_stack(task)) {
+				eip = KSTK_EIP(task);
+				esp = KSTK_ESP(task);
+				put_task_stack(task);
+			}
 		}
 	}
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/fs/quota/dquot.c linux-libre-4.4.207-gnu/fs/quota/dquot.c
--- linux-libre-4.4.206-gnu/fs/quota/dquot.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/fs/quota/dquot.c	2019-12-21 04:35:48.000000000 -0500
@@ -472,7 +472,7 @@ int dquot_release(struct dquot *dquot)
 
 	mutex_lock(&dquot->dq_lock);
 	/* Check whether we are not racing with some other dqget() */
-	if (atomic_read(&dquot->dq_count) > 1)
+	if (dquot_is_busy(dquot))
 		goto out_dqlock;
 	mutex_lock(&dqopt->dqio_mutex);
 	if (dqopt->ops[dquot->dq_id.type]->release_dqblk) {
@@ -604,7 +604,7 @@ EXPORT_SYMBOL(dquot_scan_active);
 /* Write all dquot structures to quota files */
 int dquot_writeback_dquots(struct super_block *sb, int type)
 {
-	struct list_head *dirty;
+	struct list_head dirty;
 	struct dquot *dquot;
 	struct quota_info *dqopt = sb_dqopt(sb);
 	int cnt;
@@ -617,9 +617,10 @@ int dquot_writeback_dquots(struct super_
 		if (!sb_has_quota_active(sb, cnt))
 			continue;
 		spin_lock(&dq_list_lock);
-		dirty = &dqopt->info[cnt].dqi_dirty_list;
-		while (!list_empty(dirty)) {
-			dquot = list_first_entry(dirty, struct dquot,
+		/* Move list away to avoid livelock. */
+		list_replace_init(&dqopt->info[cnt].dqi_dirty_list, &dirty);
+		while (!list_empty(&dirty)) {
+			dquot = list_first_entry(&dirty, struct dquot,
 						 dq_dirty);
 			/* Dirty and inactive can be only bad dquot... */
 			if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/acpi.h linux-libre-4.4.207-gnu/include/linux/acpi.h
--- linux-libre-4.4.206-gnu/include/linux/acpi.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/acpi.h	2019-12-21 04:35:48.000000000 -0500
@@ -75,7 +75,7 @@ static inline bool has_acpi_companion(st
 static inline void acpi_preset_companion(struct device *dev,
 					 struct acpi_device *parent, u64 addr)
 {
-	ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL));
+	ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, false));
 }
 
 static inline const char *acpi_dev_name(struct acpi_device *adev)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/atalk.h linux-libre-4.4.207-gnu/include/linux/atalk.h
--- linux-libre-4.4.206-gnu/include/linux/atalk.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/atalk.h	2019-12-21 04:35:48.000000000 -0500
@@ -107,7 +107,7 @@ static __inline__ struct elapaarp *aarp_
 #define AARP_RESOLVE_TIME	(10 * HZ)
 
 extern struct datalink_proto *ddp_dl, *aarp_dl;
-extern void aarp_proto_init(void);
+extern int aarp_proto_init(void);
 
 /* Inter module exports */
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/dma-mapping.h linux-libre-4.4.207-gnu/include/linux/dma-mapping.h
--- linux-libre-4.4.206-gnu/include/linux/dma-mapping.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/dma-mapping.h	2019-12-21 04:35:48.000000000 -0500
@@ -151,8 +151,7 @@ static inline unsigned int dma_get_max_s
 	return SZ_64K;
 }
 
-static inline unsigned int dma_set_max_seg_size(struct device *dev,
-						unsigned int size)
+static inline int dma_set_max_seg_size(struct device *dev, unsigned int size)
 {
 	if (dev->dma_parms) {
 		dev->dma_parms->max_segment_size = size;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/init_task.h linux-libre-4.4.207-gnu/include/linux/init_task.h
--- linux-libre-4.4.206-gnu/include/linux/init_task.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/init_task.h	2019-12-21 04:35:48.000000000 -0500
@@ -15,6 +15,8 @@
 #include <net/net_namespace.h>
 #include <linux/sched/rt.h>
 
+#include <asm/thread_info.h>
+
 #ifdef CONFIG_SMP
 # define INIT_PUSHABLE_TASKS(tsk)					\
 	.pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO),
@@ -183,12 +185,19 @@ extern struct task_group root_task_group
 # define INIT_KASAN(tsk)
 #endif
 
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+# define INIT_TASK_TI(tsk) .thread_info = INIT_THREAD_INFO(tsk),
+#else
+# define INIT_TASK_TI(tsk)
+#endif
+
 /*
  *  INIT_TASK is used to set up the first task table, touch at
  * your own risk!. Base=0, limit=0x1fffff (=2MB)
  */
 #define INIT_TASK(tsk)	\
 {									\
+	INIT_TASK_TI(tsk)						\
 	.state		= 0,						\
 	.stack		= &init_thread_info,				\
 	.usage		= ATOMIC_INIT(2),				\
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/jbd2.h linux-libre-4.4.207-gnu/include/linux/jbd2.h
--- linux-libre-4.4.206-gnu/include/linux/jbd2.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/jbd2.h	2019-12-21 04:35:48.000000000 -0500
@@ -1440,7 +1440,7 @@ static inline int jbd2_space_needed(jour
 static inline unsigned long jbd2_log_space_left(journal_t *journal)
 {
 	/* Allow for rounding errors */
-	unsigned long free = journal->j_free - 32;
+	long free = journal->j_free - 32;
 
 	if (journal->j_committing_transaction) {
 		unsigned long committing = atomic_read(&journal->
@@ -1449,7 +1449,7 @@ static inline unsigned long jbd2_log_spa
 		/* Transaction + control blocks */
 		free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT);
 	}
-	return free;
+	return max_t(long, free, 0);
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/netdevice.h linux-libre-4.4.207-gnu/include/linux/netdevice.h
--- linux-libre-4.4.206-gnu/include/linux/netdevice.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/netdevice.h	2019-12-21 04:35:48.000000000 -0500
@@ -1617,6 +1617,11 @@ struct net_device {
 	unsigned char		if_port;
 	unsigned char		dma;
 
+	/* Note : dev->mtu is often read without holding a lock.
+	 * Writers usually hold RTNL.
+	 * It is recommended to use READ_ONCE() to annotate the reads,
+	 * and to use WRITE_ONCE() to annotate the writes.
+	 */
 	unsigned int		mtu;
 	unsigned short		type;
 	unsigned short		hard_header_len;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/quotaops.h linux-libre-4.4.207-gnu/include/linux/quotaops.h
--- linux-libre-4.4.206-gnu/include/linux/quotaops.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/quotaops.h	2019-12-21 04:35:48.000000000 -0500
@@ -54,6 +54,16 @@ static inline struct dquot *dqgrab(struc
 	atomic_inc(&dquot->dq_count);
 	return dquot;
 }
+
+static inline bool dquot_is_busy(struct dquot *dquot)
+{
+	if (test_bit(DQ_MOD_B, &dquot->dq_flags))
+		return true;
+	if (atomic_read(&dquot->dq_count) > 1)
+		return true;
+	return false;
+}
+
 void dqput(struct dquot *dquot);
 int dquot_scan_active(struct super_block *sb,
 		      int (*fn)(struct dquot *dquot, unsigned long priv),
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/regulator/consumer.h linux-libre-4.4.207-gnu/include/linux/regulator/consumer.h
--- linux-libre-4.4.206-gnu/include/linux/regulator/consumer.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/regulator/consumer.h	2019-12-21 04:35:48.000000000 -0500
@@ -485,7 +485,7 @@ static inline unsigned int regulator_get
 
 static inline int regulator_set_load(struct regulator *regulator, int load_uA)
 {
-	return REGULATOR_MODE_NORMAL;
+	return 0;
 }
 
 static inline int regulator_allow_bypass(struct regulator *regulator,
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/sched.h linux-libre-4.4.207-gnu/include/linux/sched.h
--- linux-libre-4.4.206-gnu/include/linux/sched.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/sched.h	2019-12-21 04:35:48.000000000 -0500
@@ -1389,6 +1389,13 @@ struct tlbflush_unmap_batch {
 };
 
 struct task_struct {
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+	/*
+	 * For reasons of header soup (see current_thread_info()), this
+	 * must be the first element of task_struct.
+	 */
+	struct thread_info thread_info;
+#endif
 	volatile long state;	/* -1 unrunnable, 0 runnable, >0 stopped */
 	void *stack;
 	atomic_t usage;
@@ -1398,6 +1405,9 @@ struct task_struct {
 #ifdef CONFIG_SMP
 	struct llist_node wake_entry;
 	int on_cpu;
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+	unsigned int cpu;	/* current CPU */
+#endif
 	unsigned int wakee_flips;
 	unsigned long wakee_flip_decay_ts;
 	struct task_struct *last_wakee;
@@ -2440,7 +2450,9 @@ extern void set_curr_task(int cpu, struc
 void yield(void);
 
 union thread_union {
+#ifndef CONFIG_THREAD_INFO_IN_TASK
 	struct thread_info thread_info;
+#endif
 	unsigned long stack[THREAD_SIZE/sizeof(long)];
 };
 
@@ -2840,10 +2852,34 @@ static inline void threadgroup_change_en
 	cgroup_threadgroup_change_end(tsk);
 }
 
-#ifndef __HAVE_THREAD_FUNCTIONS
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+
+static inline struct thread_info *task_thread_info(struct task_struct *task)
+{
+	return &task->thread_info;
+}
+
+/*
+ * When accessing the stack of a non-current task that might exit, use
+ * try_get_task_stack() instead.  task_stack_page will return a pointer
+ * that could get freed out from under you.
+ */
+static inline void *task_stack_page(const struct task_struct *task)
+{
+	return task->stack;
+}
+
+#define setup_thread_stack(new,old)	do { } while(0)
+
+static inline unsigned long *end_of_stack(const struct task_struct *task)
+{
+	return task->stack;
+}
+
+#elif !defined(__HAVE_THREAD_FUNCTIONS)
 
 #define task_thread_info(task)	((struct thread_info *)(task)->stack)
-#define task_stack_page(task)	((task)->stack)
+#define task_stack_page(task)	((void *)(task)->stack)
 
 static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org)
 {
@@ -2870,6 +2906,14 @@ static inline unsigned long *end_of_stac
 }
 
 #endif
+
+static inline void *try_get_task_stack(struct task_struct *tsk)
+{
+	return task_stack_page(tsk);
+}
+
+static inline void put_task_stack(struct task_struct *tsk) {}
+
 #define task_stack_end_corrupted(task) \
 		(*(end_of_stack(task)) != STACK_END_MAGIC)
 
@@ -3135,7 +3179,11 @@ static inline void ptrace_signal_wake_up
 
 static inline unsigned int task_cpu(const struct task_struct *p)
 {
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+	return p->cpu;
+#else
 	return task_thread_info(p)->cpu;
+#endif
 }
 
 static inline int task_node(const struct task_struct *p)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/serial_core.h linux-libre-4.4.207-gnu/include/linux/serial_core.h
--- linux-libre-4.4.206-gnu/include/linux/serial_core.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/serial_core.h	2019-12-21 04:35:48.000000000 -0500
@@ -159,6 +159,7 @@ struct uart_port {
 	struct console		*cons;			/* struct console, if any */
 #if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(SUPPORT_SYSRQ)
 	unsigned long		sysrq;			/* sysrq timeout */
+	unsigned int		sysrq_ch;		/* char for sysrq */
 #endif
 
 	/* flags must be updated while holding port mutex */
@@ -440,8 +441,42 @@ uart_handle_sysrq_char(struct uart_port
 	}
 	return 0;
 }
+static inline int
+uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)
+{
+	if (port->sysrq) {
+		if (ch && time_before(jiffies, port->sysrq)) {
+			port->sysrq_ch = ch;
+			port->sysrq = 0;
+			return 1;
+		}
+		port->sysrq = 0;
+	}
+	return 0;
+}
+static inline void
+uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+{
+	int sysrq_ch;
+
+	sysrq_ch = port->sysrq_ch;
+	port->sysrq_ch = 0;
+
+	spin_unlock_irqrestore(&port->lock, irqflags);
+
+	if (sysrq_ch)
+		handle_sysrq(sysrq_ch);
+}
 #else
-#define uart_handle_sysrq_char(port,ch) ({ (void)port; 0; })
+static inline int
+uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) { return 0; }
+static inline int
+uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch) { return 0; }
+static inline void
+uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+{
+	spin_unlock_irqrestore(&port->lock, irqflags);
+}
 #endif
 
 /*
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/thread_info.h linux-libre-4.4.207-gnu/include/linux/thread_info.h
--- linux-libre-4.4.206-gnu/include/linux/thread_info.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/thread_info.h	2019-12-21 04:35:48.000000000 -0500
@@ -13,6 +13,10 @@
 struct timespec;
 struct compat_timespec;
 
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+#define current_thread_info() ((struct thread_info *)current)
+#endif
+
 /*
  * System call restart block.
  */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/linux/time.h linux-libre-4.4.207-gnu/include/linux/time.h
--- linux-libre-4.4.206-gnu/include/linux/time.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/linux/time.h	2019-12-21 04:35:48.000000000 -0500
@@ -262,4 +262,16 @@ static __always_inline void timespec_add
 	a->tv_nsec = ns;
 }
 
+/**
+ * time_between32 - check if a 32-bit timestamp is within a given time range
+ * @t:	the time which may be within [l,h]
+ * @l:	the lower bound of the range
+ * @h:	the higher bound of the range
+ *
+ * time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are
+ * treated as 32-bit integers.
+ *
+ * Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)).
+ */
+#define time_between32(t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l))
 #endif
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/math-emu/soft-fp.h linux-libre-4.4.207-gnu/include/math-emu/soft-fp.h
--- linux-libre-4.4.206-gnu/include/math-emu/soft-fp.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/math-emu/soft-fp.h	2019-12-21 04:35:48.000000000 -0500
@@ -138,7 +138,7 @@ do {							\
       _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND);		\
 } while (0)
 
-#define _FP_ROUND_ZERO(wc, X)		0
+#define _FP_ROUND_ZERO(wc, X)		(void)0
 
 #define _FP_ROUND_PINF(wc, X)				\
 do {							\
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/net/ip.h linux-libre-4.4.207-gnu/include/net/ip.h
--- linux-libre-4.4.206-gnu/include/net/ip.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/net/ip.h	2019-12-21 04:35:48.000000000 -0500
@@ -596,4 +596,9 @@ extern int sysctl_icmp_msgs_burst;
 int ip_misc_proc_init(void);
 #endif
 
+static inline bool inetdev_valid_mtu(unsigned int mtu)
+{
+	return likely(mtu >= IPV4_MIN_MTU);
+}
+
 #endif	/* _IP_H */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/include/net/tcp.h linux-libre-4.4.207-gnu/include/net/tcp.h
--- linux-libre-4.4.206-gnu/include/net/tcp.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/include/net/tcp.h	2019-12-21 04:35:48.000000000 -0500
@@ -502,19 +502,27 @@ struct sock *cookie_v4_check(struct sock
  */
 static inline void tcp_synq_overflow(const struct sock *sk)
 {
-	unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
+	unsigned long last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
 	unsigned long now = jiffies;
 
-	if (time_after(now, last_overflow + HZ))
-		tcp_sk(sk)->rx_opt.ts_recent_stamp = now;
+	if (!time_between32(now, last_overflow, last_overflow + HZ))
+		WRITE_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp, now);
 }
 
 /* syncookies: no recent synqueue overflow on this listening socket? */
 static inline bool tcp_synq_no_recent_overflow(const struct sock *sk)
 {
-	unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
+	unsigned long last_overflow = READ_ONCE(tcp_sk(sk)->rx_opt.ts_recent_stamp);
 
-	return time_after(jiffies, last_overflow + TCP_SYNCOOKIE_VALID);
+	/* If last_overflow <= jiffies <= last_overflow + TCP_SYNCOOKIE_VALID,
+	 * then we're under synflood. However, we have to use
+	 * 'last_overflow - HZ' as lower bound. That's because a concurrent
+	 * tcp_synq_overflow() could update .ts_recent_stamp after we read
+	 * jiffies but before we store .ts_recent_stamp into last_overflow,
+	 * which could lead to rejecting a valid syncookie.
+	 */
+	return !time_between32(jiffies, last_overflow - HZ,
+			       last_overflow + TCP_SYNCOOKIE_VALID);
 }
 
 static inline u32 tcp_cookie_time(void)
diff -druNp --no-dereference linux-libre-4.4.206-gnu/init/init_task.c linux-libre-4.4.207-gnu/init/init_task.c
--- linux-libre-4.4.206-gnu/init/init_task.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/init/init_task.c	2019-12-21 04:35:48.000000000 -0500
@@ -22,5 +22,8 @@ EXPORT_SYMBOL(init_task);
  * Initial thread structure. Alignment of this is handled by a special
  * linker map entry.
  */
-union thread_union init_thread_union __init_task_data =
-	{ INIT_THREAD_INFO(init_task) };
+union thread_union init_thread_union __init_task_data = {
+#ifndef CONFIG_THREAD_INFO_IN_TASK
+	INIT_THREAD_INFO(init_task)
+#endif
+};
diff -druNp --no-dereference linux-libre-4.4.206-gnu/init/Kconfig linux-libre-4.4.207-gnu/init/Kconfig
--- linux-libre-4.4.206-gnu/init/Kconfig	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/init/Kconfig	2019-12-21 04:35:48.000000000 -0500
@@ -26,6 +26,16 @@ config IRQ_WORK
 config BUILDTIME_EXTABLE_SORT
 	bool
 
+config THREAD_INFO_IN_TASK
+	bool
+	help
+	  Select this to move thread_info off the stack into task_struct.  To
+	  make this work, an arch will need to remove all thread_info fields
+	  except flags and fix any runtime bugs.
+
+	  One subtle change that will be needed is to use try_get_task_stack()
+	  and put_task_stack() in save_thread_stack_tsk() and get_wchan().
+
 menu "General setup"
 
 config BROKEN
diff -druNp --no-dereference linux-libre-4.4.206-gnu/kernel/cgroup_pids.c linux-libre-4.4.207-gnu/kernel/cgroup_pids.c
--- linux-libre-4.4.206-gnu/kernel/cgroup_pids.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/kernel/cgroup_pids.c	2019-12-21 04:35:48.000000000 -0500
@@ -48,7 +48,7 @@ struct pids_cgroup {
 	 * %PIDS_MAX = (%PID_MAX_LIMIT + 1).
 	 */
 	atomic64_t			counter;
-	int64_t				limit;
+	atomic64_t			limit;
 };
 
 static struct pids_cgroup *css_pids(struct cgroup_subsys_state *css)
@@ -70,8 +70,8 @@ pids_css_alloc(struct cgroup_subsys_stat
 	if (!pids)
 		return ERR_PTR(-ENOMEM);
 
-	pids->limit = PIDS_MAX;
 	atomic64_set(&pids->counter, 0);
+	atomic64_set(&pids->limit, PIDS_MAX);
 	return &pids->css;
 }
 
@@ -142,13 +142,14 @@ static int pids_try_charge(struct pids_c
 
 	for (p = pids; parent_pids(p); p = parent_pids(p)) {
 		int64_t new = atomic64_add_return(num, &p->counter);
+		int64_t limit = atomic64_read(&p->limit);
 
 		/*
 		 * Since new is capped to the maximum number of pid_t, if
 		 * p->limit is %PIDS_MAX then we know that this test will never
 		 * fail.
 		 */
-		if (new > p->limit)
+		if (new > limit)
 			goto revert;
 	}
 
@@ -262,7 +263,7 @@ set_limit:
 	 * Limit updates don't need to be mutex'd, since it isn't
 	 * critical that any racing fork()s follow the new limit.
 	 */
-	pids->limit = limit;
+	atomic64_set(&pids->limit, limit);
 	return nbytes;
 }
 
@@ -270,7 +271,7 @@ static int pids_max_show(struct seq_file
 {
 	struct cgroup_subsys_state *css = seq_css(sf);
 	struct pids_cgroup *pids = css_pids(css);
-	int64_t limit = pids->limit;
+	int64_t limit = atomic64_read(&pids->limit);
 
 	if (limit >= PIDS_MAX)
 		seq_printf(sf, "%s\n", PIDS_MAX_STR);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/kernel/module.c linux-libre-4.4.207-gnu/kernel/module.c
--- linux-libre-4.4.206-gnu/kernel/module.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/kernel/module.c	2019-12-21 04:35:48.000000000 -0500
@@ -1014,6 +1014,8 @@ SYSCALL_DEFINE2(delete_module, const cha
 	strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
 
 	free_module(mod);
+	/* someone could wait for the module in add_unformed_module() */
+	wake_up_all(&module_wq);
 	return 0;
 out:
 	mutex_unlock(&module_mutex);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/kernel/sched/fair.c linux-libre-4.4.207-gnu/kernel/sched/fair.c
--- linux-libre-4.4.206-gnu/kernel/sched/fair.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/kernel/sched/fair.c	2019-12-21 04:35:48.000000000 -0500
@@ -4055,20 +4055,28 @@ static enum hrtimer_restart sched_cfs_pe
 		if (++count > 3) {
 			u64 new, old = ktime_to_ns(cfs_b->period);
 
-			new = (old * 147) / 128; /* ~115% */
-			new = min(new, max_cfs_quota_period);
-
-			cfs_b->period = ns_to_ktime(new);
-
-			/* since max is 1s, this is limited to 1e9^2, which fits in u64 */
-			cfs_b->quota *= new;
-			cfs_b->quota = div64_u64(cfs_b->quota, old);
+			/*
+			 * Grow period by a factor of 2 to avoid losing precision.
+			 * Precision loss in the quota/period ratio can cause __cfs_schedulable
+			 * to fail.
+			 */
+			new = old * 2;
+			if (new < max_cfs_quota_period) {
+				cfs_b->period = ns_to_ktime(new);
+				cfs_b->quota *= 2;
 
-			pr_warn_ratelimited(
-        "cfs_period_timer[cpu%d]: period too short, scaling up (new cfs_period_us %lld, cfs_quota_us = %lld)\n",
-	                        smp_processor_id(),
-	                        div_u64(new, NSEC_PER_USEC),
-                                div_u64(cfs_b->quota, NSEC_PER_USEC));
+				pr_warn_ratelimited(
+	"cfs_period_timer[cpu%d]: period too short, scaling up (new cfs_period_us = %lld, cfs_quota_us = %lld)\n",
+					smp_processor_id(),
+					div_u64(new, NSEC_PER_USEC),
+					div_u64(cfs_b->quota, NSEC_PER_USEC));
+			} else {
+				pr_warn_ratelimited(
+	"cfs_period_timer[cpu%d]: period too short, but cannot scale up without losing precision (cfs_period_us = %lld, cfs_quota_us = %lld)\n",
+					smp_processor_id(),
+					div_u64(old, NSEC_PER_USEC),
+					div_u64(cfs_b->quota, NSEC_PER_USEC));
+			}
 
 			/* reset count so we don't come right back in here */
 			count = 0;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/kernel/sched/sched.h linux-libre-4.4.207-gnu/kernel/sched/sched.h
--- linux-libre-4.4.206-gnu/kernel/sched/sched.h	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/kernel/sched/sched.h	2019-12-21 04:35:48.000000000 -0500
@@ -978,7 +978,11 @@ static inline void __set_task_cpu(struct
 	 * per-task data have been completed by this moment.
 	 */
 	smp_wmb();
+#ifdef CONFIG_THREAD_INFO_IN_TASK
+	p->cpu = cpu;
+#else
 	task_thread_info(p)->cpu = cpu;
+#endif
 	p->wake_cpu = cpu;
 #endif
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/kernel/workqueue.c linux-libre-4.4.207-gnu/kernel/workqueue.c
--- linux-libre-4.4.206-gnu/kernel/workqueue.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/kernel/workqueue.c	2019-12-21 04:35:48.000000000 -0500
@@ -2308,8 +2308,14 @@ repeat:
 			 */
 			if (need_to_create_worker(pool)) {
 				spin_lock(&wq_mayday_lock);
-				get_pwq(pwq);
-				list_move_tail(&pwq->mayday_node, &wq->maydays);
+				/*
+				 * Queue iff we aren't racing destruction
+				 * and somebody else hasn't queued it already.
+				 */
+				if (wq->rescuer && list_empty(&pwq->mayday_node)) {
+					get_pwq(pwq);
+					list_add_tail(&pwq->mayday_node, &wq->maydays);
+				}
 				spin_unlock(&wq_mayday_lock);
 			}
 		}
@@ -3949,9 +3955,29 @@ void destroy_workqueue(struct workqueue_
 	struct pool_workqueue *pwq;
 	int node;
 
+	/*
+	 * Remove it from sysfs first so that sanity check failure doesn't
+	 * lead to sysfs name conflicts.
+	 */
+	workqueue_sysfs_unregister(wq);
+
 	/* drain it before proceeding with destruction */
 	drain_workqueue(wq);
 
+	/* kill rescuer, if sanity checks fail, leave it w/o rescuer */
+	if (wq->rescuer) {
+		struct worker *rescuer = wq->rescuer;
+
+		/* this prevents new queueing */
+		spin_lock_irq(&wq_mayday_lock);
+		wq->rescuer = NULL;
+		spin_unlock_irq(&wq_mayday_lock);
+
+		/* rescuer will empty maydays list before exiting */
+		kthread_stop(rescuer->task);
+		kfree(rescuer);
+	}
+
 	/* sanity checks */
 	mutex_lock(&wq->mutex);
 	for_each_pwq(pwq, wq) {
@@ -3981,11 +4007,6 @@ void destroy_workqueue(struct workqueue_
 	list_del_rcu(&wq->list);
 	mutex_unlock(&wq_pool_mutex);
 
-	workqueue_sysfs_unregister(wq);
-
-	if (wq->rescuer)
-		kthread_stop(wq->rescuer->task);
-
 	if (!(wq->flags & WQ_UNBOUND)) {
 		/*
 		 * The base ref is never dropped on per-cpu pwqs.  Directly
@@ -4262,7 +4283,8 @@ static void show_pwq(struct pool_workque
 	pr_info("  pwq %d:", pool->id);
 	pr_cont_pool_info(pool);
 
-	pr_cont(" active=%d/%d%s\n", pwq->nr_active, pwq->max_active,
+	pr_cont(" active=%d/%d refcnt=%d%s\n",
+		pwq->nr_active, pwq->max_active, pwq->refcnt,
 		!list_empty(&pwq->mayday_node) ? " MAYDAY" : "");
 
 	hash_for_each(pool->busy_hash, bkt, worker, hentry) {
diff -druNp --no-dereference linux-libre-4.4.206-gnu/lib/raid6/unroll.awk linux-libre-4.4.207-gnu/lib/raid6/unroll.awk
--- linux-libre-4.4.206-gnu/lib/raid6/unroll.awk	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/lib/raid6/unroll.awk	2019-12-21 04:35:48.000000000 -0500
@@ -13,7 +13,7 @@ BEGIN {
 	for (i = 0; i < rep; ++i) {
 		tmp = $0
 		gsub(/\$\$/, i, tmp)
-		gsub(/\$\#/, n, tmp)
+		gsub(/\$#/, n, tmp)
 		gsub(/\$\*/, "$", tmp)
 		print tmp
 	}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/Makefile linux-libre-4.4.207-gnu/Makefile
--- linux-libre-4.4.206-gnu/Makefile	2019-12-05 11:42:04.000000000 -0500
+++ linux-libre-4.4.207-gnu/Makefile	2019-12-22 01:51:39.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 4
-SUBLEVEL = 206
+SUBLEVEL = 207
 EXTRAVERSION = -gnu
 NAME = Blurry Fish Butt
 
@@ -1424,9 +1424,6 @@ else # KBUILD_EXTMOD
 
 # We are always building modules
 KBUILD_MODULES := 1
-PHONY += crmodverdir
-crmodverdir:
-	$(cmd_crmodverdir)
 
 PHONY += $(objtree)/Module.symvers
 $(objtree)/Module.symvers:
@@ -1438,7 +1435,7 @@ $(objtree)/Module.symvers:
 
 module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
 PHONY += $(module-dirs) modules
-$(module-dirs): crmodverdir $(objtree)/Module.symvers
+$(module-dirs): prepare $(objtree)/Module.symvers
 	$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 
 modules: $(module-dirs)
@@ -1478,7 +1475,8 @@ help:
 
 # Dummies...
 PHONY += prepare scripts
-prepare: ;
+prepare:
+	$(cmd_crmodverdir)
 scripts: ;
 endif # KBUILD_EXTMOD
 
@@ -1602,17 +1600,14 @@ endif
 
 # Modules
 /: prepare scripts FORCE
-	$(cmd_crmodverdir)
 	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
 	$(build)=$(build-dir)
 # Make sure the latest headers are built for Documentation
 Documentation/: headers_install
 %/: prepare scripts FORCE
-	$(cmd_crmodverdir)
 	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
 	$(build)=$(build-dir)
 %.ko: prepare scripts FORCE
-	$(cmd_crmodverdir)
 	$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
 	$(build)=$(build-dir) $(@:.ko=.o)
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
diff -druNp --no-dereference linux-libre-4.4.206-gnu/mm/shmem.c linux-libre-4.4.207-gnu/mm/shmem.c
--- linux-libre-4.4.206-gnu/mm/shmem.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/mm/shmem.c	2019-12-21 04:35:48.000000000 -0500
@@ -2092,7 +2092,7 @@ static long shmem_fallocate(struct file
 		}
 
 		shmem_falloc.waitq = &shmem_falloc_waitq;
-		shmem_falloc.start = unmap_start >> PAGE_SHIFT;
+		shmem_falloc.start = (u64)unmap_start >> PAGE_SHIFT;
 		shmem_falloc.next = (unmap_end + 1) >> PAGE_SHIFT;
 		spin_lock(&inode->i_lock);
 		inode->i_private = &shmem_falloc;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/appletalk/aarp.c linux-libre-4.4.207-gnu/net/appletalk/aarp.c
--- linux-libre-4.4.206-gnu/net/appletalk/aarp.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/appletalk/aarp.c	2019-12-21 04:35:48.000000000 -0500
@@ -879,15 +879,24 @@ static struct notifier_block aarp_notifi
 
 static unsigned char aarp_snap_id[] = { 0x00, 0x00, 0x00, 0x80, 0xF3 };
 
-void __init aarp_proto_init(void)
+int __init aarp_proto_init(void)
 {
+	int rc;
+
 	aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
-	if (!aarp_dl)
+	if (!aarp_dl) {
 		printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
+		return -ENOMEM;
+	}
 	setup_timer(&aarp_timer, aarp_expire_timeout, 0);
 	aarp_timer.expires  = jiffies + sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
-	register_netdevice_notifier(&aarp_notifier);
+	rc = register_netdevice_notifier(&aarp_notifier);
+	if (rc) {
+		del_timer_sync(&aarp_timer);
+		unregister_snap_client(aarp_dl);
+	}
+	return rc;
 }
 
 /* Remove the AARP entries associated with a device. */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/appletalk/ddp.c linux-libre-4.4.207-gnu/net/appletalk/ddp.c
--- linux-libre-4.4.206-gnu/net/appletalk/ddp.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/appletalk/ddp.c	2019-12-21 04:35:48.000000000 -0500
@@ -1911,9 +1911,6 @@ static unsigned char ddp_snap_id[] = { 0
 EXPORT_SYMBOL(atrtr_get_dev);
 EXPORT_SYMBOL(atalk_find_dev_addr);
 
-static const char atalk_err_snap[] __initconst =
-	KERN_CRIT "Unable to register DDP with SNAP.\n";
-
 /* Called by proto.c on kernel start up */
 static int __init atalk_init(void)
 {
@@ -1928,17 +1925,23 @@ static int __init atalk_init(void)
 		goto out_proto;
 
 	ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv);
-	if (!ddp_dl)
-		printk(atalk_err_snap);
+	if (!ddp_dl) {
+		pr_crit("Unable to register DDP with SNAP.\n");
+		rc = -ENOMEM;
+		goto out_sock;
+	}
 
 	dev_add_pack(&ltalk_packet_type);
 	dev_add_pack(&ppptalk_packet_type);
 
 	rc = register_netdevice_notifier(&ddp_notifier);
 	if (rc)
-		goto out_sock;
+		goto out_snap;
+
+	rc = aarp_proto_init();
+	if (rc)
+		goto out_dev;
 
-	aarp_proto_init();
 	rc = atalk_proc_init();
 	if (rc)
 		goto out_aarp;
@@ -1952,11 +1955,13 @@ out_proc:
 	atalk_proc_exit();
 out_aarp:
 	aarp_cleanup_module();
+out_dev:
 	unregister_netdevice_notifier(&ddp_notifier);
-out_sock:
+out_snap:
 	dev_remove_pack(&ppptalk_packet_type);
 	dev_remove_pack(&ltalk_packet_type);
 	unregister_snap_client(ddp_dl);
+out_sock:
 	sock_unregister(PF_APPLETALK);
 out_proto:
 	proto_unregister(&ddp_proto);
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/bridge/br_device.c linux-libre-4.4.207-gnu/net/bridge/br_device.c
--- linux-libre-4.4.206-gnu/net/bridge/br_device.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/bridge/br_device.c	2019-12-21 04:35:48.000000000 -0500
@@ -199,6 +199,12 @@ static int br_set_mac_address(struct net
 	if (!is_valid_ether_addr(addr->sa_data))
 		return -EADDRNOTAVAIL;
 
+	/* dev_set_mac_addr() can be called by a master device on bridge's
+	 * NETDEV_UNREGISTER, but since it's being destroyed do nothing
+	 */
+	if (dev->reg_state != NETREG_REGISTERED)
+		return -EBUSY;
+
 	spin_lock_bh(&br->lock);
 	if (!ether_addr_equal(dev->dev_addr, addr->sa_data)) {
 		/* Mac address will be changed in br_stp_change_bridge_id(). */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/core/dev.c linux-libre-4.4.207-gnu/net/core/dev.c
--- linux-libre-4.4.206-gnu/net/core/dev.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/core/dev.c	2019-12-21 04:35:48.000000000 -0500
@@ -6126,7 +6126,8 @@ static int __dev_set_mtu(struct net_devi
 	if (ops->ndo_change_mtu)
 		return ops->ndo_change_mtu(dev, new_mtu);
 
-	dev->mtu = new_mtu;
+	/* Pairs with all the lockless reads of dev->mtu in the stack */
+	WRITE_ONCE(dev->mtu, new_mtu);
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/ipv4/devinet.c linux-libre-4.4.207-gnu/net/ipv4/devinet.c
--- linux-libre-4.4.206-gnu/net/ipv4/devinet.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/ipv4/devinet.c	2019-12-21 04:35:48.000000000 -0500
@@ -1364,11 +1364,6 @@ skip:
 	}
 }
 
-static bool inetdev_valid_mtu(unsigned int mtu)
-{
-	return mtu >= IPV4_MIN_MTU;
-}
-
 static void inetdev_send_gratuitous_arp(struct net_device *dev,
 					struct in_device *in_dev)
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/ipv4/ip_output.c linux-libre-4.4.207-gnu/net/ipv4/ip_output.c
--- linux-libre-4.4.206-gnu/net/ipv4/ip_output.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/ipv4/ip_output.c	2019-12-21 04:35:48.000000000 -0500
@@ -1145,13 +1145,17 @@ static int ip_setup_cork(struct sock *sk
 	rt = *rtp;
 	if (unlikely(!rt))
 		return -EFAULT;
-	/*
-	 * We steal reference to this route, caller should not release it
-	 */
-	*rtp = NULL;
+
 	cork->fragsize = ip_sk_use_pmtu(sk) ?
-			 dst_mtu(&rt->dst) : rt->dst.dev->mtu;
+			 dst_mtu(&rt->dst) : READ_ONCE(rt->dst.dev->mtu);
+
+	if (!inetdev_valid_mtu(cork->fragsize))
+		return -ENETUNREACH;
+
 	cork->dst = &rt->dst;
+	/* We stole this route, caller should not release it. */
+	*rtp = NULL;
+
 	cork->length = 0;
 	cork->ttl = ipc->ttl;
 	cork->tos = ipc->tos;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/ipv4/tcp_output.c linux-libre-4.4.207-gnu/net/ipv4/tcp_output.c
--- linux-libre-4.4.206-gnu/net/ipv4/tcp_output.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/ipv4/tcp_output.c	2019-12-21 04:35:48.000000000 -0500
@@ -710,8 +710,9 @@ static unsigned int tcp_established_opti
 			min_t(unsigned int, eff_sacks,
 			      (remaining - TCPOLEN_SACK_BASE_ALIGNED) /
 			      TCPOLEN_SACK_PERBLOCK);
-		size += TCPOLEN_SACK_BASE_ALIGNED +
-			opts->num_sack_blocks * TCPOLEN_SACK_PERBLOCK;
+		if (likely(opts->num_sack_blocks))
+			size += TCPOLEN_SACK_BASE_ALIGNED +
+				opts->num_sack_blocks * TCPOLEN_SACK_PERBLOCK;
 	}
 
 	return size;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/ipv4/tcp_timer.c linux-libre-4.4.207-gnu/net/ipv4/tcp_timer.c
--- linux-libre-4.4.206-gnu/net/ipv4/tcp_timer.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/ipv4/tcp_timer.c	2019-12-21 04:35:48.000000000 -0500
@@ -336,7 +336,7 @@ static void tcp_probe_timer(struct sock
 			return;
 	}
 
-	if (icsk->icsk_probes_out > max_probes) {
+	if (icsk->icsk_probes_out >= max_probes) {
 abort:		tcp_write_err(sk);
 	} else {
 		/* Only send another probe if we didn't close things up. */
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/sunrpc/cache.c linux-libre-4.4.207-gnu/net/sunrpc/cache.c
--- linux-libre-4.4.206-gnu/net/sunrpc/cache.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/sunrpc/cache.c	2019-12-21 04:35:48.000000000 -0500
@@ -54,9 +54,6 @@ static void cache_init(struct cache_head
 	h->last_refresh = now;
 }
 
-static inline int cache_is_valid(struct cache_head *h);
-static void cache_fresh_locked(struct cache_head *head, time_t expiry,
-				struct cache_detail *detail);
 static void cache_fresh_unlocked(struct cache_head *head,
 				struct cache_detail *detail);
 
@@ -101,9 +98,6 @@ struct cache_head *sunrpc_cache_lookup(s
 			if (cache_is_expired(detail, tmp)) {
 				hlist_del_init(&tmp->cache_list);
 				detail->entries --;
-				if (cache_is_valid(tmp) == -EAGAIN)
-					set_bit(CACHE_NEGATIVE, &tmp->flags);
-				cache_fresh_locked(tmp, 0, detail);
 				freeme = tmp;
 				break;
 			}
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/tipc/core.c linux-libre-4.4.207-gnu/net/tipc/core.c
--- linux-libre-4.4.206-gnu/net/tipc/core.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/tipc/core.c	2019-12-21 04:35:48.000000000 -0500
@@ -117,14 +117,6 @@ static int __init tipc_init(void)
 			      TIPC_CRITICAL_IMPORTANCE;
 	sysctl_tipc_rmem[2] = TIPC_CONN_OVERLOAD_LIMIT;
 
-	err = tipc_netlink_start();
-	if (err)
-		goto out_netlink;
-
-	err = tipc_netlink_compat_start();
-	if (err)
-		goto out_netlink_compat;
-
 	err = tipc_register_sysctl();
 	if (err)
 		goto out_sysctl;
@@ -145,8 +137,21 @@ static int __init tipc_init(void)
 	if (err)
 		goto out_bearer;
 
+	err = tipc_netlink_start();
+	if (err)
+		goto out_netlink;
+
+	err = tipc_netlink_compat_start();
+	if (err)
+		goto out_netlink_compat;
+
 	pr_info("Started in single node mode\n");
 	return 0;
+
+out_netlink_compat:
+	tipc_netlink_stop();
+out_netlink:
+	tipc_bearer_cleanup();
 out_bearer:
 	unregister_pernet_device(&tipc_topsrv_net_ops);
 out_pernet_topsrv:
@@ -156,22 +161,18 @@ out_socket:
 out_pernet:
 	tipc_unregister_sysctl();
 out_sysctl:
-	tipc_netlink_compat_stop();
-out_netlink_compat:
-	tipc_netlink_stop();
-out_netlink:
 	pr_err("Unable to start in single node mode\n");
 	return err;
 }
 
 static void __exit tipc_exit(void)
 {
+	tipc_netlink_compat_stop();
+	tipc_netlink_stop();
 	tipc_bearer_cleanup();
 	unregister_pernet_device(&tipc_topsrv_net_ops);
 	tipc_socket_stop();
 	unregister_pernet_device(&tipc_net_ops);
-	tipc_netlink_stop();
-	tipc_netlink_compat_stop();
 	tipc_unregister_sysctl();
 
 	pr_info("Deactivated\n");
diff -druNp --no-dereference linux-libre-4.4.206-gnu/net/x25/af_x25.c linux-libre-4.4.207-gnu/net/x25/af_x25.c
--- linux-libre-4.4.206-gnu/net/x25/af_x25.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/net/x25/af_x25.c	2019-12-21 04:35:48.000000000 -0500
@@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_bu
 	}
 
 	len = *skb->data;
-	needed = 1 + (len >> 4) + (len & 0x0f);
+	needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2;
 
 	if (!pskb_may_pull(skb, needed)) {
 		/* packet is too short to hold the addresses it claims
@@ -288,7 +288,7 @@ static struct sock *x25_find_listener(st
 	sk_for_each(s, &x25_list)
 		if ((!strcmp(addr->x25_addr,
 			x25_sk(s)->source_addr.x25_addr) ||
-				!strcmp(addr->x25_addr,
+				!strcmp(x25_sk(s)->source_addr.x25_addr,
 					null_x25_address.x25_addr)) &&
 					s->sk_state == TCP_LISTEN) {
 			/*
@@ -684,11 +684,15 @@ static int x25_bind(struct socket *sock,
 		goto out;
 	}
 
-	len = strlen(addr->sx25_addr.x25_addr);
-	for (i = 0; i < len; i++) {
-		if (!isdigit(addr->sx25_addr.x25_addr[i])) {
-			rc = -EINVAL;
-			goto out;
+	/* check for the null_x25_address */
+	if (strcmp(addr->sx25_addr.x25_addr, null_x25_address.x25_addr)) {
+
+		len = strlen(addr->sx25_addr.x25_addr);
+		for (i = 0; i < len; i++) {
+			if (!isdigit(addr->sx25_addr.x25_addr[i])) {
+				rc = -EINVAL;
+				goto out;
+			}
 		}
 	}
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/scripts/mod/modpost.c linux-libre-4.4.207-gnu/scripts/mod/modpost.c
--- linux-libre-4.4.206-gnu/scripts/mod/modpost.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/scripts/mod/modpost.c	2019-12-21 04:35:48.000000000 -0500
@@ -1156,6 +1156,14 @@ static const struct sectioncheck *sectio
  *   fromsec = text section
  *   refsymname = *.constprop.*
  *
+ * Pattern 6:
+ *   Hide section mismatch warnings for ELF local symbols.  The goal
+ *   is to eliminate false positive modpost warnings caused by
+ *   compiler-generated ELF local symbol names such as ".LANCHOR1".
+ *   Autogenerated symbol names bypass modpost's "Pattern 2"
+ *   whitelisting, which relies on pattern-matching against symbol
+ *   names to work.  (One situation where gcc can autogenerate ELF
+ *   local symbols is when "-fsection-anchors" is used.)
  **/
 static int secref_whitelist(const struct sectioncheck *mismatch,
 			    const char *fromsec, const char *fromsym,
@@ -1194,6 +1202,10 @@ static int secref_whitelist(const struct
 	    match(fromsym, optim_symbols))
 		return 0;
 
+	/* Check for pattern 6 */
+	if (strstarts(fromsym, ".L"))
+		return 0;
+
 	return 1;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/core/oss/linear.c linux-libre-4.4.207-gnu/sound/core/oss/linear.c
--- linux-libre-4.4.206-gnu/sound/core/oss/linear.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/core/oss/linear.c	2019-12-21 04:35:48.000000000 -0500
@@ -107,6 +107,8 @@ static snd_pcm_sframes_t linear_transfer
 		}
 	}
 #endif
+	if (frames > dst_channels[0].frames)
+		frames = dst_channels[0].frames;
 	convert(plugin, src_channels, dst_channels, frames);
 	return frames;
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/core/oss/mulaw.c linux-libre-4.4.207-gnu/sound/core/oss/mulaw.c
--- linux-libre-4.4.206-gnu/sound/core/oss/mulaw.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/core/oss/mulaw.c	2019-12-21 04:35:48.000000000 -0500
@@ -269,6 +269,8 @@ static snd_pcm_sframes_t mulaw_transfer(
 		}
 	}
 #endif
+	if (frames > dst_channels[0].frames)
+		frames = dst_channels[0].frames;
 	data = (struct mulaw_priv *)plugin->extra_data;
 	data->func(plugin, src_channels, dst_channels, frames);
 	return frames;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/core/oss/route.c linux-libre-4.4.207-gnu/sound/core/oss/route.c
--- linux-libre-4.4.206-gnu/sound/core/oss/route.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/core/oss/route.c	2019-12-21 04:35:48.000000000 -0500
@@ -57,6 +57,8 @@ static snd_pcm_sframes_t route_transfer(
 		return -ENXIO;
 	if (frames == 0)
 		return 0;
+	if (frames > dst_channels[0].frames)
+		frames = dst_channels[0].frames;
 
 	nsrcs = plugin->src_format.channels;
 	ndsts = plugin->dst_format.channels;
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/core/pcm_lib.c linux-libre-4.4.207-gnu/sound/core/pcm_lib.c
--- linux-libre-4.4.206-gnu/sound/core/pcm_lib.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/core/pcm_lib.c	2019-12-21 04:35:48.000000000 -0500
@@ -1877,11 +1877,14 @@ void snd_pcm_period_elapsed(struct snd_p
 	struct snd_pcm_runtime *runtime;
 	unsigned long flags;
 
-	if (PCM_RUNTIME_CHECK(substream))
+	if (snd_BUG_ON(!substream))
 		return;
-	runtime = substream->runtime;
 
 	snd_pcm_stream_lock_irqsave(substream, flags);
+	if (PCM_RUNTIME_CHECK(substream))
+		goto _unlock;
+	runtime = substream->runtime;
+
 	if (!snd_pcm_running(substream) ||
 	    snd_pcm_update_hw_ptr0(substream, 1) < 0)
 		goto _end;
@@ -1892,6 +1895,7 @@ void snd_pcm_period_elapsed(struct snd_p
 #endif
  _end:
 	kill_fasync(&runtime->fasync, SIGIO, POLL_IN);
+ _unlock:
 	snd_pcm_stream_unlock_irqrestore(substream, flags);
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/pci/hda/hda_bind.c linux-libre-4.4.207-gnu/sound/pci/hda/hda_bind.c
--- linux-libre-4.4.206-gnu/sound/pci/hda/hda_bind.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/pci/hda/hda_bind.c	2019-12-21 04:35:48.000000000 -0500
@@ -42,6 +42,10 @@ static void hda_codec_unsol_event(struct
 {
 	struct hda_codec *codec = container_of(dev, struct hda_codec, core);
 
+	/* ignore unsol events during shutdown */
+	if (codec->bus->shutdown)
+		return;
+
 	if (codec->patch_ops.unsol_event)
 		codec->patch_ops.unsol_event(codec, ev);
 }
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/pci/hda/hda_intel.c linux-libre-4.4.207-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.4.206-gnu/sound/pci/hda/hda_intel.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/pci/hda/hda_intel.c	2019-12-21 04:35:48.000000000 -0500
@@ -1310,8 +1310,11 @@ static int azx_free(struct azx *chip)
 static int azx_dev_disconnect(struct snd_device *device)
 {
 	struct azx *chip = device->device_data;
+	struct hdac_bus *bus = azx_bus(chip);
 
 	chip->bus.shutdown = 1;
+	cancel_work_sync(&bus->unsol_work);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.4.206-gnu/sound/soc/soc-jack.c linux-libre-4.4.207-gnu/sound/soc/soc-jack.c
--- linux-libre-4.4.206-gnu/sound/soc/soc-jack.c	2019-12-05 09:27:18.000000000 -0500
+++ linux-libre-4.4.207-gnu/sound/soc/soc-jack.c	2019-12-21 04:35:48.000000000 -0500
@@ -80,10 +80,9 @@ void snd_soc_jack_report(struct snd_soc_
 	unsigned int sync = 0;
 	int enable;
 
-	trace_snd_soc_jack_report(jack, mask, status);
-
 	if (!jack)
 		return;
+	trace_snd_soc_jack_report(jack, mask, status);
 
 	dapm = &jack->card->dapm;
 
