diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts	2019-12-21 04:42:35.000000000 -0500
@@ -45,7 +45,7 @@
 	};
 
 	/* The voltage to the MMC card is hardwired at 3.3V */
-	vmmc: fixedregulator@0 {
+	vmmc: regulator-vmmc {
 		compatible = "regulator-fixed";
 		regulator-name = "vmmc";
 		regulator-min-microvolt = <3300000>;
@@ -53,7 +53,7 @@
 		regulator-boot-on;
         };
 
-	veth: fixedregulator@0 {
+	veth: regulator-veth {
 		compatible = "regulator-fixed";
 		regulator-name = "veth";
 		regulator-min-microvolt = <3300000>;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts	2019-12-21 04:42:35.000000000 -0500
@@ -145,7 +145,7 @@
 	};
 
 	/* The voltage to the MMC card is hardwired at 3.3V */
-	vmmc: fixedregulator@0 {
+	vmmc: regulator-vmmc {
 		compatible = "regulator-fixed";
 		regulator-name = "vmmc";
 		regulator-min-microvolt = <3300000>;
@@ -153,7 +153,7 @@
 		regulator-boot-on;
         };
 
-	veth: fixedregulator@0 {
+	veth: regulator-veth {
 		compatible = "regulator-fixed";
 		regulator-name = "veth";
 		regulator-min-microvolt = <3300000>;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -43,7 +43,7 @@
 	};
 
 	/* The voltage to the MMC card is hardwired at 3.3V */
-	vmmc: fixedregulator@0 {
+	vmmc: regulator-vmmc {
 		compatible = "regulator-fixed";
 		regulator-name = "vmmc";
 		regulator-min-microvolt = <3300000>;
@@ -51,7 +51,7 @@
 		regulator-boot-on;
         };
 
-	veth: fixedregulator@0 {
+	veth: regulator-veth {
 		compatible = "regulator-fixed";
 		regulator-name = "veth";
 		regulator-min-microvolt = <3300000>;
@@ -539,4 +539,3 @@
 		};
 	};
 };
-
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/exynos3250.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/exynos3250.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -345,7 +345,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.9.206-gnu/arch/arm/boot/dts/mmp2.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/mmp2.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -221,6 +221,17 @@
 		gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>;	/* GPIO_164 */
 	};
 
+	/* wl1251 wifi+bt module */
+	wlan_en: fixed-regulator-wg7210_en {
+		compatible = "regulator-fixed";
+		regulator-name = "vwlan";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		startup-delay-us = <50000>;
+		enable-active-high;
+		gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+	};
+
 	/* wg7210 (wifi+bt module) 32k clock buffer */
 	wg7210_32k: fixed-regulator-wg7210_32k {
 		compatible = "regulator-fixed";
@@ -514,9 +525,30 @@
 	/*wp-gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;*/	/* GPIO_127 */
 };
 
-/* mmc3 is probed using pdata-quirks to pass wl1251 card data */
 &mmc3 {
-	status = "disabled";
+	vmmc-supply = <&wlan_en>;
+
+	bus-width = <4>;
+	non-removable;
+	ti,non-removable;
+	cap-power-off-card;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc3_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	wlan: wifi@1 {
+		compatible = "ti,wl1251";
+
+		reg = <1>;
+
+		interrupt-parent = <&gpio1>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;	/* GPIO_21 */
+
+		ti,wl1251-has-eeprom;
+	};
 };
 
 /* bluetooth*/
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/boot/dts/pxa27x.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa27x.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -34,7 +34,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.9.206-gnu/arch/arm/boot/dts/pxa2xx.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa2xx.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/boot/dts/pxa3xx.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa3xx.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -187,7 +187,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.9.206-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -63,7 +63,7 @@
 
 	vcc_flash: flash-regulator {
 		compatible = "regulator-fixed";
-		regulator-name = "vcc_sys";
+		regulator-name = "vcc_flash";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
 		startup-delay-us = <150>;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts linux-libre-4.9.207-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/s3c6410-mini6410.dts	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts linux-libre-4.9.207-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/s3c6410-smdk6410.dts	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/boot/dts/sun6i-a31.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/sun6i-a31.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -174,7 +174,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.9.206-gnu/arch/arm/boot/dts/sun7i-a20.dtsi linux-libre-4.9.207-gnu/arch/arm/boot/dts/sun7i-a20.dtsi
--- linux-libre-4.9.206-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -172,7 +172,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.9.206-gnu/arch/arm/include/asm/uaccess.h linux-libre-4.9.207-gnu/arch/arm/include/asm/uaccess.h
--- linux-libre-4.9.206-gnu/arch/arm/include/asm/uaccess.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/include/asm/uaccess.h	2019-12-21 04:42:35.000000000 -0500
@@ -379,6 +379,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)			\
 ({								\
@@ -397,6 +404,8 @@ do {									\
 })
 #endif
 
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
+
 #define __get_user_asm_word(x, addr, err)			\
 	__get_user_asm(x, addr, err, ldr)
 #endif
@@ -472,6 +481,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)			\
 ({								\
@@ -488,6 +504,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.9.206-gnu/arch/arm/Kconfig.debug linux-libre-4.9.207-gnu/arch/arm/Kconfig.debug
--- linux-libre-4.9.206-gnu/arch/arm/Kconfig.debug	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/Kconfig.debug	2019-12-21 04:42:35.000000000 -0500
@@ -987,14 +987,21 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on SOCFPGA(Cyclone 5 and Arria 5) based platforms.
 
-	config DEBUG_SOCFPGA_UART1
+	config DEBUG_SOCFPGA_ARRIA10_UART1
 		depends on ARCH_SOCFPGA
-		bool "Use SOCFPGA UART1 for low-level debug"
+		bool "Use SOCFPGA Arria10 UART1 for low-level debug"
 		select DEBUG_UART_8250
 		help
 		  Say Y here if you want kernel low-level debugging support
 		  on SOCFPGA(Arria 10) based platforms.
 
+	config DEBUG_SOCFPGA_CYCLONE5_UART1
+		depends on ARCH_SOCFPGA
+		bool "Use SOCFPGA Cyclone 5 UART1 for low-level debug"
+		select DEBUG_UART_8250
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on SOCFPGA(Cyclone 5 and Arria 5) based platforms.
 
 	config DEBUG_SUN9I_UART0
 		bool "Kernel low-level debugging messages via sun9i UART0"
@@ -1534,7 +1541,8 @@ config DEBUG_UART_PHYS
 	default 0xfe800000 if ARCH_IOP32X
 	default 0xff690000 if DEBUG_RK32_UART2
 	default 0xffc02000 if DEBUG_SOCFPGA_UART0
-	default 0xffc02100 if DEBUG_SOCFPGA_UART1
+	default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1
+	default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1
 	default 0xffd82340 if ARCH_IOP13XX
 	default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0
 	default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2
@@ -1624,7 +1632,8 @@ config DEBUG_UART_VIRT
 	default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
 	default 0xfeb31000 if DEBUG_KEYSTONE_UART1
 	default 0xfec02000 if DEBUG_SOCFPGA_UART0
-	default 0xfec02100 if DEBUG_SOCFPGA_UART1
+	default 0xfec02100 if DEBUG_SOCFPGA_ARRIA10_UART1
+	default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1
 	default 0xfec12000 if (DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE) && ARCH_MVEBU
 	default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE
 	default 0xfec10000 if DEBUG_SIRFATLAS7_UART0
@@ -1672,9 +1681,9 @@ config DEBUG_UART_8250_WORD
 	depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
 	depends on DEBUG_UART_8250_SHIFT >= 2
 	default y if DEBUG_PICOXCELL_UART || \
-		DEBUG_SOCFPGA_UART0 || DEBUG_SOCFPGA_UART1 || \
-		DEBUG_KEYSTONE_UART0 || DEBUG_KEYSTONE_UART1 || \
-		DEBUG_ALPINE_UART0 || \
+		DEBUG_SOCFPGA_UART0 || DEBUG_SOCFPGA_ARRIA10_UART1 || \
+		DEBUG_SOCFPGA_CYCLONE5_UART1 || DEBUG_KEYSTONE_UART0 || \
+		DEBUG_KEYSTONE_UART1 || DEBUG_ALPINE_UART0 || \
 		DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
 		DEBUG_DAVINCI_DA8XX_UART2 || \
 		DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/lib/getuser.S linux-libre-4.9.207-gnu/arch/arm/lib/getuser.S
--- linux-libre-4.9.206-gnu/arch/arm/lib/getuser.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/lib/getuser.S	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/lib/putuser.S linux-libre-4.9.207-gnu/arch/arm/lib/putuser.S
--- linux-libre-4.9.206-gnu/arch/arm/lib/putuser.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/lib/putuser.S	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/mach-omap1/id.c linux-libre-4.9.207-gnu/arch/arm/mach-omap1/id.c
--- linux-libre-4.9.206-gnu/arch/arm/mach-omap1/id.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/mach-omap1/id.c	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/mach-omap2/id.c linux-libre-4.9.207-gnu/arch/arm/mach-omap2/id.c
--- linux-libre-4.9.206-gnu/arch/arm/mach-omap2/id.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/mach-omap2/id.c	2019-12-21 04:42:35.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.9.206-gnu/arch/arm/mach-omap2/pdata-quirks.c linux-libre-4.9.207-gnu/arch/arm/mach-omap2/pdata-quirks.c
--- linux-libre-4.9.206-gnu/arch/arm/mach-omap2/pdata-quirks.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/mach-omap2/pdata-quirks.c	2019-12-21 04:42:35.000000000 -0500
@@ -308,108 +308,15 @@ static void __init omap3_logicpd_torpedo
 }
 
 /* omap3pandora legacy devices */
-#define PANDORA_WIFI_IRQ_GPIO		21
-#define PANDORA_WIFI_NRESET_GPIO	23
 
 static struct platform_device pandora_backlight = {
 	.name	= "pandora-backlight",
 	.id	= -1,
 };
 
-static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
-	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
-};
-
-static struct regulator_init_data pandora_vmmc3 = {
-	.constraints = {
-		.valid_ops_mask		= REGULATOR_CHANGE_STATUS,
-	},
-	.num_consumer_supplies	= ARRAY_SIZE(pandora_vmmc3_supply),
-	.consumer_supplies	= pandora_vmmc3_supply,
-};
-
-static struct fixed_voltage_config pandora_vwlan = {
-	.supply_name		= "vwlan",
-	.microvolts		= 1800000, /* 1.8V */
-	.gpio			= PANDORA_WIFI_NRESET_GPIO,
-	.startup_delay		= 50000, /* 50ms */
-	.enable_high		= 1,
-	.init_data		= &pandora_vmmc3,
-};
-
-static struct platform_device pandora_vwlan_device = {
-	.name		= "reg-fixed-voltage",
-	.id		= 1,
-	.dev = {
-		.platform_data = &pandora_vwlan,
-	},
-};
-
-static void pandora_wl1251_init_card(struct mmc_card *card)
-{
-	/*
-	 * We have TI wl1251 attached to MMC3. Pass this information to
-	 * SDIO core because it can't be probed by normal methods.
-	 */
-	if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) {
-		card->quirks |= MMC_QUIRK_NONSTD_SDIO;
-		card->cccr.wide_bus = 1;
-		card->cis.vendor = 0x104c;
-		card->cis.device = 0x9066;
-		card->cis.blksize = 512;
-		card->cis.max_dtr = 24000000;
-		card->ocr = 0x80;
-	}
-}
-
-static struct omap2_hsmmc_info pandora_mmc3[] = {
-	{
-		.mmc		= 3,
-		.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
-		.gpio_cd	= -EINVAL,
-		.gpio_wp	= -EINVAL,
-		.init_card	= pandora_wl1251_init_card,
-	},
-	{}	/* Terminator */
-};
-
-static void __init pandora_wl1251_init(void)
-{
-	struct wl1251_platform_data pandora_wl1251_pdata;
-	int ret;
-
-	memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
-
-	pandora_wl1251_pdata.power_gpio = -1;
-
-	ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
-	if (ret < 0)
-		goto fail;
-
-	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
-	if (pandora_wl1251_pdata.irq < 0)
-		goto fail_irq;
-
-	pandora_wl1251_pdata.use_eeprom = true;
-	ret = wl1251_set_platform_data(&pandora_wl1251_pdata);
-	if (ret < 0)
-		goto fail_irq;
-
-	return;
-
-fail_irq:
-	gpio_free(PANDORA_WIFI_IRQ_GPIO);
-fail:
-	pr_err("wl1251 board initialisation failed\n");
-}
-
 static void __init omap3_pandora_legacy_init(void)
 {
 	platform_device_register(&pandora_backlight);
-	platform_device_register(&pandora_vwlan_device);
-	omap_hsmmc_init(pandora_mmc3);
-	omap_hsmmc_late_init(pandora_mmc3);
-	pandora_wl1251_init();
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/arm/mach-tegra/reset-handler.S linux-libre-4.9.207-gnu/arch/arm/mach-tegra/reset-handler.S
--- linux-libre-4.9.206-gnu/arch/arm/mach-tegra/reset-handler.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm/mach-tegra/reset-handler.S	2019-12-21 04:42:35.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.9.206-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi linux-libre-4.9.207-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
--- linux-libre-4.9.206-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi	2019-12-21 04:42:35.000000000 -0500
@@ -1583,7 +1583,7 @@
 			regulator-name = "VDD_HDMI_5V0";
 			regulator-min-microvolt = <5000000>;
 			regulator-max-microvolt = <5000000>;
-			gpio = <&exp1 12 GPIO_ACTIVE_LOW>;
+			gpio = <&exp1 12 GPIO_ACTIVE_HIGH>;
 			enable-active-high;
 			vin-supply = <&vdd_5v0_sys>;
 		};
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c linux-libre-4.9.207-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c
--- linux-libre-4.9.206-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-21 04:42:35.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.9.206-gnu/arch/mips/cavium-octeon/octeon-platform.c linux-libre-4.9.207-gnu/arch/mips/cavium-octeon/octeon-platform.c
--- linux-libre-4.9.206-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-21 04:42:35.000000000 -0500
@@ -502,7 +502,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.9.206-gnu/arch/mips/include/asm/octeon/cvmx-pko.h linux-libre-4.9.207-gnu/arch/mips/include/asm/octeon/cvmx-pko.h
--- linux-libre-4.9.206-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-21 04:42:35.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.9.206-gnu/arch/mips/Kconfig linux-libre-4.9.207-gnu/arch/mips/Kconfig
--- linux-libre-4.9.206-gnu/arch/mips/Kconfig	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/mips/Kconfig	2019-12-21 04:42:35.000000000 -0500
@@ -804,6 +804,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.9.206-gnu/arch/powerpc/include/asm/sfp-machine.h linux-libre-4.9.207-gnu/arch/powerpc/include/asm/sfp-machine.h
--- linux-libre-4.9.206-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-21 04:42:35.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.9.206-gnu/arch/powerpc/include/asm/vdso_datapage.h linux-libre-4.9.207-gnu/arch/powerpc/include/asm/vdso_datapage.h
--- linux-libre-4.9.206-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-21 04:42:35.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.9.206-gnu/arch/powerpc/kernel/asm-offsets.c linux-libre-4.9.207-gnu/arch/powerpc/kernel/asm-offsets.c
--- linux-libre-4.9.206-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-21 04:42:35.000000000 -0500
@@ -383,6 +383,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));
@@ -411,7 +412,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.9.206-gnu/arch/powerpc/kernel/time.c linux-libre-4.9.207-gnu/arch/powerpc/kernel/time.c
--- linux-libre-4.9.206-gnu/arch/powerpc/kernel/time.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/kernel/time.c	2019-12-21 04:42:35.000000000 -0500
@@ -862,6 +862,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.9.206-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S
--- linux-libre-4.9.206-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-21 04:42:35.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.9.206-gnu/arch/powerpc/kernel/vdso64/cacheflush.S linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso64/cacheflush.S
--- linux-libre-4.9.206-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-21 04:42:35.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.9.206-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S
--- linux-libre-4.9.206-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-21 04:42:35.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.9.206-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c linux-libre-4.9.207-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c
--- linux-libre-4.9.206-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c	2019-12-21 04:42:35.000000000 -0500
@@ -499,6 +499,40 @@ out:
 	return offset;
 }
 
+/*
+ * Turn off MC4_MISC thresholding banks on all family 0x15 models since
+ * they're not supported there.
+ */
+void disable_err_thresholding(struct cpuinfo_x86 *c)
+{
+	int i;
+	u64 hwcr;
+	bool need_toggle;
+	u32 msrs[] = {
+		0x00000413, /* MC4_MISC0 */
+		0xc0000408, /* MC4_MISC1 */
+	};
+
+	if (c->x86 != 0x15)
+		return;
+
+	rdmsrl(MSR_K7_HWCR, hwcr);
+
+	/* McStatusWrEn has to be set */
+	need_toggle = !(hwcr & BIT(18));
+
+	if (need_toggle)
+		wrmsrl(MSR_K7_HWCR, hwcr | BIT(18));
+
+	/* Clear CntP bit safely */
+	for (i = 0; i < ARRAY_SIZE(msrs); i++)
+		msr_clear_bit(msrs[i], 62);
+
+	/* restore old settings */
+	if (need_toggle)
+		wrmsrl(MSR_K7_HWCR, hwcr);
+}
+
 /* cpu init entry point, called from mce.c with preempt off */
 void mce_amd_feature_init(struct cpuinfo_x86 *c)
 {
@@ -506,6 +540,8 @@ void mce_amd_feature_init(struct cpuinfo
 	unsigned int bank, block, cpu = smp_processor_id();
 	int offset = -1;
 
+	disable_err_thresholding(c);
+
 	for (bank = 0; bank < mca_cfg.banks; ++bank) {
 		if (mce_flags.smca)
 			get_smca_bank_info(bank);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/x86/kernel/cpu/mcheck/mce.c linux-libre-4.9.207-gnu/arch/x86/kernel/cpu/mcheck/mce.c
--- linux-libre-4.9.206-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-21 04:42:35.000000000 -0500
@@ -1648,36 +1648,6 @@ static int __mcheck_cpu_apply_quirks(str
 		if (c->x86 == 0x15 && c->x86_model <= 0xf)
 			mce_flags.overflow_recov = 1;
 
-		/*
-		 * Turn off MC4_MISC thresholding banks on those models since
-		 * they're not supported there.
-		 */
-		if (c->x86 == 0x15 &&
-		    (c->x86_model >= 0x10 && c->x86_model <= 0x1f)) {
-			int i;
-			u64 hwcr;
-			bool need_toggle;
-			u32 msrs[] = {
-				0x00000413, /* MC4_MISC0 */
-				0xc0000408, /* MC4_MISC1 */
-			};
-
-			rdmsrl(MSR_K7_HWCR, hwcr);
-
-			/* McStatusWrEn has to be set */
-			need_toggle = !(hwcr & BIT(18));
-
-			if (need_toggle)
-				wrmsrl(MSR_K7_HWCR, hwcr | BIT(18));
-
-			/* Clear CntP bit safely */
-			for (i = 0; i < ARRAY_SIZE(msrs); i++)
-				msr_clear_bit(msrs[i], 62);
-
-			/* restore old settings */
-			if (need_toggle)
-				wrmsrl(MSR_K7_HWCR, hwcr);
-		}
 	}
 
 	if (c->x86_vendor == X86_VENDOR_INTEL) {
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/x86/kvm/cpuid.c linux-libre-4.9.207-gnu/arch/x86/kvm/cpuid.c
--- linux-libre-4.9.206-gnu/arch/x86/kvm/cpuid.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/x86/kvm/cpuid.c	2019-12-21 04:42:35.000000000 -0500
@@ -389,7 +389,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);
@@ -691,6 +691,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.9.206-gnu/arch/x86/kvm/x86.c linux-libre-4.9.207-gnu/arch/x86/kvm/x86.c
--- linux-libre-4.9.206-gnu/arch/x86/kvm/x86.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/x86/kvm/x86.c	2019-12-21 04:42:35.000000000 -0500
@@ -273,13 +273,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);
@@ -1074,10 +1075,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.9.206-gnu/arch/x86/pci/fixup.c linux-libre-4.9.207-gnu/arch/x86/pci/fixup.c
--- linux-libre-4.9.206-gnu/arch/x86/pci/fixup.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/x86/pci/fixup.c	2019-12-21 04:42:35.000000000 -0500
@@ -573,6 +573,17 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_invalid_bar);
 
 /*
+ * 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);
+
+/*
  * Apple MacBook Pro: Avoid [mem 0x7fa00000-0x7fbfffff]
  *
  * Using the [mem 0x7fa00000-0x7fbfffff] region, e.g., by assigning it to
diff -druNp --no-dereference linux-libre-4.9.206-gnu/arch/xtensa/mm/tlb.c linux-libre-4.9.207-gnu/arch/xtensa/mm/tlb.c
--- linux-libre-4.9.206-gnu/arch/xtensa/mm/tlb.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/arch/xtensa/mm/tlb.c	2019-12-21 04:42:35.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.9.206-gnu/block/blk-mq-sysfs.c linux-libre-4.9.207-gnu/block/blk-mq-sysfs.c
--- linux-libre-4.9.206-gnu/block/blk-mq-sysfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/block/blk-mq-sysfs.c	2019-12-21 04:42:35.000000000 -0500
@@ -243,20 +243,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.9.206-gnu/crypto/crypto_user.c linux-libre-4.9.207-gnu/crypto/crypto_user.c
--- linux-libre-4.9.206-gnu/crypto/crypto_user.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/crypto/crypto_user.c	2019-12-21 04:42:35.000000000 -0500
@@ -269,8 +269,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.9.206-gnu/crypto/ecc.c linux-libre-4.9.207-gnu/crypto/ecc.c
--- linux-libre-4.9.206-gnu/crypto/ecc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/crypto/ecc.c	2019-12-21 04:42:35.000000000 -0500
@@ -897,10 +897,11 @@ static void ecc_point_mult(struct ecc_po
 static inline void ecc_swap_digits(const u64 *in, u64 *out,
 				   unsigned int ndigits)
 {
+	const __be64 *src = (__force __be64 *)in;
 	int i;
 
 	for (i = 0; i < ndigits; i++)
-		out[i] = __swab64(in[ndigits - 1 - i]);
+		out[i] = be64_to_cpu(src[ndigits - 1 - i]);
 }
 
 int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits,
diff -druNp --no-dereference linux-libre-4.9.206-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt linux-libre-4.9.207-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt
--- linux-libre-4.9.206-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-21 04:42:35.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.9.206-gnu/drivers/acpi/bus.c linux-libre-4.9.207-gnu/drivers/acpi/bus.c
--- linux-libre-4.9.206-gnu/drivers/acpi/bus.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/acpi/bus.c	2019-12-21 04:42:35.000000000 -0500
@@ -158,7 +158,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.9.206-gnu/drivers/acpi/device_pm.c linux-libre-4.9.207-gnu/drivers/acpi/device_pm.c
--- linux-libre-4.9.206-gnu/drivers/acpi/device_pm.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/acpi/device_pm.c	2019-12-21 04:42:35.000000000 -0500
@@ -1096,9 +1096,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.9.206-gnu/drivers/acpi/osl.c linux-libre-4.9.207-gnu/drivers/acpi/osl.c
--- linux-libre-4.9.206-gnu/drivers/acpi/osl.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/acpi/osl.c	2019-12-21 04:42:35.000000000 -0500
@@ -375,19 +375,21 @@ void *__ref acpi_os_map_memory(acpi_phys
 }
 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);
 }
 
 /**
@@ -407,6 +409,7 @@ static void acpi_os_map_cleanup(struct a
 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);
@@ -420,10 +423,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);
 
@@ -464,6 +468,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;
@@ -479,10 +484,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.9.206-gnu/drivers/block/rsxx/core.c linux-libre-4.9.207-gnu/drivers/block/rsxx/core.c
--- linux-libre-4.9.206-gnu/drivers/block/rsxx/core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/block/rsxx/core.c	2019-12-21 04:42:35.000000000 -0500
@@ -1025,8 +1025,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.9.206-gnu/drivers/char/ppdev.c linux-libre-4.9.207-gnu/drivers/char/ppdev.c
--- linux-libre-4.9.206-gnu/drivers/char/ppdev.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/char/ppdev.c	2019-12-21 04:42:35.000000000 -0500
@@ -624,20 +624,27 @@ static int pp_do_ioctl(struct file *file
 		if (copy_from_user(time32, argp, sizeof(time32)))
 			return -EFAULT;
 
+		if ((time32[0] < 0) || (time32[1] < 0))
+			return -EINVAL;
+
 		return pp_set_timeout(pp->pdev, time32[0], time32[1]);
 
 	case PPSETTIME64:
 		if (copy_from_user(time64, argp, sizeof(time64)))
 			return -EFAULT;
 
+		if ((time64[0] < 0) || (time64[1] < 0))
+			return -EINVAL;
+
+		if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall())
+			time64[1] >>= 32;
+
 		return pp_set_timeout(pp->pdev, time64[0], time64[1]);
 
 	case PPGETTIME32:
 		jiffies_to_timespec64(pp->pdev->timeout, &ts);
 		time32[0] = ts.tv_sec;
 		time32[1] = ts.tv_nsec / NSEC_PER_USEC;
-		if ((time32[0] < 0) || (time32[1] < 0))
-			return -EINVAL;
 
 		if (copy_to_user(argp, time32, sizeof(time32)))
 			return -EFAULT;
@@ -648,8 +655,9 @@ static int pp_do_ioctl(struct file *file
 		jiffies_to_timespec64(pp->pdev->timeout, &ts);
 		time64[0] = ts.tv_sec;
 		time64[1] = ts.tv_nsec / NSEC_PER_USEC;
-		if ((time64[0] < 0) || (time64[1] < 0))
-			return -EINVAL;
+
+		if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall())
+			time64[1] <<= 32;
 
 		if (copy_to_user(argp, time64, sizeof(time64)))
 			return -EFAULT;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/clk/rockchip/clk-rk3188.c linux-libre-4.9.207-gnu/drivers/clk/rockchip/clk-rk3188.c
--- linux-libre-4.9.206-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-21 04:42:35.000000000 -0500
@@ -361,8 +361,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,
@@ -390,8 +390,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.9.206-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c linux-libre-4.9.207-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
--- linux-libre-4.9.206-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c	2019-12-21 04:42:35.000000000 -0500
@@ -458,7 +458,7 @@ static const char * const csi_sclk_paren
 static SUNXI_CCU_M_WITH_MUX_GATE(csi_sclk_clk, "csi-sclk", csi_sclk_parents,
 				 0x134, 16, 4, 24, 3, BIT(31), 0);
 
-static const char * const csi_mclk_parents[] = { "osc24M", "pll-video", "pll-periph0" };
+static const char * const csi_mclk_parents[] = { "osc24M", "pll-video", "pll-periph1" };
 static SUNXI_CCU_M_WITH_MUX_GATE(csi_mclk_clk, "csi-mclk", csi_mclk_parents,
 				 0x134, 0, 5, 8, 3, BIT(15), 0);
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/cpuidle/driver.c linux-libre-4.9.207-gnu/drivers/cpuidle/driver.c
--- linux-libre-4.9.206-gnu/drivers/cpuidle/driver.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/cpuidle/driver.c	2019-12-21 04:42:35.000000000 -0500
@@ -61,24 +61,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.9.206-gnu/drivers/crypto/amcc/crypto4xx_core.c linux-libre-4.9.207-gnu/drivers/crypto/amcc/crypto4xx_core.c
--- linux-libre-4.9.206-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-21 04:42:35.000000000 -0500
@@ -400,12 +400,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.9.206-gnu/drivers/crypto/ccp/ccp-dmaengine.c linux-libre-4.9.207-gnu/drivers/crypto/ccp/ccp-dmaengine.c
--- linux-libre-4.9.206-gnu/drivers/crypto/ccp/ccp-dmaengine.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/crypto/ccp/ccp-dmaengine.c	2019-12-21 04:42:35.000000000 -0500
@@ -309,6 +309,7 @@ static struct ccp_dma_desc *ccp_alloc_dm
 	desc->tx_desc.flags = flags;
 	desc->tx_desc.tx_submit = ccp_tx_submit;
 	desc->ccp = chan->ccp;
+	INIT_LIST_HEAD(&desc->entry);
 	INIT_LIST_HEAD(&desc->pending);
 	INIT_LIST_HEAD(&desc->active);
 	desc->status = DMA_IN_PROGRESS;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/devfreq/devfreq.c linux-libre-4.9.207-gnu/drivers/devfreq/devfreq.c
--- linux-libre-4.9.206-gnu/drivers/devfreq/devfreq.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/devfreq/devfreq.c	2019-12-21 04:42:35.000000000 -0500
@@ -135,6 +135,7 @@ int devfreq_update_status(struct devfreq
 	int lev, prev_lev, ret = 0;
 	unsigned long cur_time;
 
+	lockdep_assert_held(&devfreq->lock);
 	cur_time = jiffies;
 
 	/* Immediately exit if previous_freq is not initialized yet. */
@@ -1170,12 +1171,17 @@ static ssize_t trans_stat_show(struct de
 	int i, j;
 	unsigned int max_state = devfreq->profile->max_state;
 
-	if (!devfreq->stop_polling &&
-			devfreq_update_status(devfreq, devfreq->previous_freq))
-		return 0;
 	if (max_state == 0)
 		return sprintf(buf, "Not Supported.\n");
 
+	mutex_lock(&devfreq->lock);
+	if (!devfreq->stop_polling &&
+			devfreq_update_status(devfreq, devfreq->previous_freq)) {
+		mutex_unlock(&devfreq->lock);
+		return 0;
+	}
+	mutex_unlock(&devfreq->lock);
+
 	len = sprintf(buf, "     From  :   To\n");
 	len += sprintf(buf + len, "           :");
 	for (i = 0; i < max_state; i++)
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/dma/coh901318.c linux-libre-4.9.207-gnu/drivers/dma/coh901318.c
--- linux-libre-4.9.206-gnu/drivers/dma/coh901318.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/dma/coh901318.c	2019-12-21 04:42:35.000000000 -0500
@@ -1797,13 +1797,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
@@ -1823,8 +1820,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.9.206-gnu/drivers/dma-buf/sync_file.c linux-libre-4.9.207-gnu/drivers/dma-buf/sync_file.c
--- linux-libre-4.9.206-gnu/drivers/dma-buf/sync_file.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/dma-buf/sync_file.c	2019-12-21 04:42:35.000000000 -0500
@@ -204,7 +204,7 @@ static struct sync_file *sync_file_merge
 	a_fences = get_fences(a, &a_num_fences);
 	b_fences = get_fences(b, &b_num_fences);
 	if (a_num_fences > INT_MAX - b_num_fences)
-		return NULL;
+		goto err;
 
 	num_fences = a_num_fences + b_num_fences;
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/extcon/extcon-max8997.c linux-libre-4.9.207-gnu/drivers/extcon/extcon-max8997.c
--- linux-libre-4.9.206-gnu/drivers/extcon/extcon-max8997.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/extcon/extcon-max8997.c	2019-12-21 04:42:35.000000000 -0500
@@ -321,12 +321,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.9.206-gnu/drivers/firmware/qcom_scm-64.c linux-libre-4.9.207-gnu/drivers/firmware/qcom_scm-64.c
--- linux-libre-4.9.206-gnu/drivers/firmware/qcom_scm-64.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/firmware/qcom_scm-64.c	2019-12-21 04:42:35.000000000 -0500
@@ -158,7 +158,7 @@ static int qcom_scm_call(struct device *
 		kfree(args_virt);
 	}
 
-	if (res->a0 < 0)
+	if ((long)res->a0 < 0)
 		return qcom_scm_remap_error(res->a0);
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/gpu/drm/i810/i810_dma.c linux-libre-4.9.207-gnu/drivers/gpu/drm/i810/i810_dma.c
--- linux-libre-4.9.206-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/gpu/drm/radeon/r100.c linux-libre-4.9.207-gnu/drivers/gpu/drm/radeon/r100.c
--- linux-libre-4.9.206-gnu/drivers/gpu/drm/radeon/r100.c	2019-12-05 10:57:09.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/gpu/drm/radeon/r100.c	2019-12-22 01:06:12.000000000 -0500
@@ -1818,8 +1818,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.9.206-gnu/drivers/gpu/drm/radeon/r200.c linux-libre-4.9.207-gnu/drivers/gpu/drm/radeon/r200.c
--- linux-libre-4.9.206-gnu/drivers/gpu/drm/radeon/r200.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/gpu/drm/radeon/r200.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c linux-libre-4.9.207-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
--- linux-libre-4.9.206-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c	2019-12-21 04:42:35.000000000 -0500
@@ -667,10 +667,13 @@ static ssize_t cyc_threshold_store(struc
 
 	if (kstrtoul(buf, 16, &val))
 		return -EINVAL;
+
+	/* mask off max threshold before checking min value */
+	val &= ETM_CYC_THRESHOLD_MASK;
 	if (val < drvdata->ccitmin)
 		return -EINVAL;
 
-	config->ccctlr = val & ETM_CYC_THRESHOLD_MASK;
+	config->ccctlr = val;
 	return size;
 }
 static DEVICE_ATTR_RW(cyc_threshold);
@@ -701,14 +704,16 @@ static ssize_t bb_ctrl_store(struct devi
 		return -EINVAL;
 	if (!drvdata->nr_addr_cmp)
 		return -EINVAL;
+
 	/*
-	 * Bit[7:0] selects which address range comparator is used for
-	 * branch broadcast control.
+	 * Bit[8] controls include(1) / exclude(0), bits[0-7] select
+	 * individual range comparators. If include then at least 1
+	 * range must be selected.
 	 */
-	if (BMVAL(val, 0, 7) > drvdata->nr_addr_cmp)
+	if ((val & BIT(8)) && (BMVAL(val, 0, 7) == 0))
 		return -EINVAL;
 
-	config->bb_ctrl = val;
+	config->bb_ctrl = val & GENMASK(8, 0);
 	return size;
 }
 static DEVICE_ATTR_RW(bb_ctrl);
@@ -1341,8 +1346,8 @@ static ssize_t seq_event_store(struct de
 
 	spin_lock(&drvdata->spinlock);
 	idx = config->seq_idx;
-	/* RST, bits[7:0] */
-	config->seq_ctrl[idx] = val & 0xFF;
+	/* Seq control has two masks B[15:8] F[7:0] */
+	config->seq_ctrl[idx] = val & 0xFFFF;
 	spin_unlock(&drvdata->spinlock);
 	return size;
 }
@@ -1597,7 +1602,7 @@ static ssize_t res_ctrl_store(struct dev
 	if (idx % 2 != 0)
 		/* PAIRINV, bit[21] */
 		val &= ~BIT(21);
-	config->res_ctrl[idx] = val;
+	config->res_ctrl[idx] = val & GENMASK(21, 0);
 	spin_unlock(&drvdata->spinlock);
 	return size;
 }
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/i2c/busses/i2c-imx.c linux-libre-4.9.207-gnu/drivers/i2c/busses/i2c-imx.c
--- linux-libre-4.9.206-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-21 04:42:35.000000000 -0500
@@ -1088,7 +1088,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.9.206-gnu/drivers/iio/humidity/hdc100x.c linux-libre-4.9.207-gnu/drivers/iio/humidity/hdc100x.c
--- linux-libre-4.9.206-gnu/drivers/iio/humidity/hdc100x.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/iio/humidity/hdc100x.c	2019-12-21 04:42:35.000000000 -0500
@@ -202,7 +202,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.9.206-gnu/drivers/iio/imu/adis16480.c linux-libre-4.9.207-gnu/drivers/iio/imu/adis16480.c
--- linux-libre-4.9.206-gnu/drivers/iio/imu/adis16480.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/iio/imu/adis16480.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h linux-libre-4.9.207-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h
--- linux-libre-4.9.206-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h	2019-12-21 04:42:35.000000000 -0500
@@ -52,7 +52,7 @@ enum {
 
 #define HNS_ROCE_HEM_CHUNK_LEN	\
 	 ((256 - sizeof(struct list_head) - 2 * sizeof(int)) /	 \
-	 (sizeof(struct scatterlist)))
+	 (sizeof(struct scatterlist) + sizeof(void *)))
 
 enum {
 	 HNS_ROCE_HEM_PAGE_SHIFT = 12,
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/infiniband/hw/mlx4/sysfs.c linux-libre-4.9.207-gnu/drivers/infiniband/hw/mlx4/sysfs.c
--- linux-libre-4.9.206-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/infiniband/hw/qib/qib_sysfs.c linux-libre-4.9.207-gnu/drivers/infiniband/hw/qib/qib_sysfs.c
--- linux-libre-4.9.206-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/input/touchscreen/cyttsp4_core.c linux-libre-4.9.207-gnu/drivers/input/touchscreen/cyttsp4_core.c
--- linux-libre-4.9.206-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/input/touchscreen/goodix.c linux-libre-4.9.207-gnu/drivers/input/touchscreen/goodix.c
--- linux-libre-4.9.206-gnu/drivers/input/touchscreen/goodix.c	2019-12-05 11:18:51.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/input/touchscreen/goodix.c	2019-12-22 01:24:38.000000000 -0500
@@ -90,6 +90,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.9.206-gnu/drivers/isdn/gigaset/usb-gigaset.c linux-libre-4.9.207-gnu/drivers/isdn/gigaset/usb-gigaset.c
--- linux-libre-4.9.206-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/md/persistent-data/dm-btree-remove.c linux-libre-4.9.207-gnu/drivers/md/persistent-data/dm-btree-remove.c
--- linux-libre-4.9.206-gnu/drivers/md/persistent-data/dm-btree-remove.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/md/persistent-data/dm-btree-remove.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c linux-libre-4.9.207-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
--- linux-libre-4.9.206-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-21 04:42:35.000000000 -0500
@@ -651,8 +651,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.9.206-gnu/drivers/media/radio/radio-wl1273.c linux-libre-4.9.207-gnu/drivers/media/radio/radio-wl1273.c
--- linux-libre-4.9.206-gnu/drivers/media/radio/radio-wl1273.c	2019-12-05 11:06:58.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/media/radio/radio-wl1273.c	2019-12-22 01:14:54.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.9.206-gnu/drivers/media/usb/stkwebcam/stk-webcam.c linux-libre-4.9.207-gnu/drivers/media/usb/stkwebcam/stk-webcam.c
--- linux-libre-4.9.206-gnu/drivers/media/usb/stkwebcam/stk-webcam.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/media/usb/stkwebcam/stk-webcam.c	2019-12-21 04:42:35.000000000 -0500
@@ -166,7 +166,11 @@ int stk_camera_read_reg(struct stk_camer
 		*value = *buf;
 
 	kfree(buf);
-	return ret;
+
+	if (ret < 0)
+		return ret;
+	else
+		return 0;
 }
 
 static int stk_start_stream(struct stk_camera *dev)
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/misc/altera-stapl/altera.c linux-libre-4.9.207-gnu/drivers/misc/altera-stapl/altera.c
--- linux-libre-4.9.206-gnu/drivers/misc/altera-stapl/altera.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/misc/altera-stapl/altera.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/mmc/host/omap_hsmmc.c linux-libre-4.9.207-gnu/drivers/mmc/host/omap_hsmmc.c
--- linux-libre-4.9.206-gnu/drivers/mmc/host/omap_hsmmc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/mmc/host/omap_hsmmc.c	2019-12-21 04:42:35.000000000 -0500
@@ -1700,6 +1700,36 @@ static void omap_hsmmc_init_card(struct
 
 	if (mmc_pdata(host)->init_card)
 		mmc_pdata(host)->init_card(card);
+	else if (card->type == MMC_TYPE_SDIO ||
+		 card->type == MMC_TYPE_SD_COMBO) {
+		struct device_node *np = mmc_dev(mmc)->of_node;
+
+		/*
+		 * REVISIT: should be moved to sdio core and made more
+		 * general e.g. by expanding the DT bindings of child nodes
+		 * to provide a mechanism to provide this information:
+		 * Documentation/devicetree/bindings/mmc/mmc-card.txt
+		 */
+
+		np = of_get_compatible_child(np, "ti,wl1251");
+		if (np) {
+			/*
+			 * We have TI wl1251 attached to MMC3. Pass this
+			 * information to the SDIO core because it can't be
+			 * probed by normal methods.
+			 */
+
+			dev_info(host->dev, "found wl1251\n");
+			card->quirks |= MMC_QUIRK_NONSTD_SDIO;
+			card->cccr.wide_bus = 1;
+			card->cis.vendor = 0x104c;
+			card->cis.device = 0x9066;
+			card->cis.blksize = 512;
+			card->cis.max_dtr = 24000000;
+			card->ocr = 0x80;
+			of_node_put(np);
+		}
+	}
 }
 
 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/mtd/devices/spear_smi.c linux-libre-4.9.207-gnu/drivers/mtd/devices/spear_smi.c
--- linux-libre-4.9.206-gnu/drivers/mtd/devices/spear_smi.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/mtd/devices/spear_smi.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/net/can/slcan.c linux-libre-4.9.207-gnu/drivers/net/can/slcan.c
--- linux-libre-4.9.206-gnu/drivers/net/can/slcan.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/can/slcan.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c linux-libre-4.9.207-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c	2019-12-21 04:42:35.000000000 -0500
@@ -718,6 +718,10 @@ static int adapter_up(struct adapter *ad
 
 		if (adapter->flags & USING_MSIX)
 			name_msix_vecs(adapter);
+
+		/* Initialize hash mac addr list*/
+		INIT_LIST_HEAD(&adapter->mac_hlist);
+
 		adapter->flags |= FULL_INIT_DONE;
 	}
 
@@ -743,8 +747,6 @@ static int adapter_up(struct adapter *ad
 	enable_rx(adapter);
 	t4vf_sge_start(adapter);
 
-	/* Initialize hash mac addr list*/
-	INIT_LIST_HEAD(&adapter->mac_hlist);
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c linux-libre-4.9.207-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-21 04:42:35.000000000 -0500
@@ -780,6 +780,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)
@@ -795,8 +796,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.9.206-gnu/drivers/net/ethernet/intel/e100.c linux-libre-4.9.207-gnu/drivers/net/ethernet/intel/e100.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/intel/e100.c	2019-12-05 11:08:44.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/intel/e100.c	2019-12-22 01:16:05.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.9.206-gnu/drivers/net/ethernet/mellanox/mlx4/main.c linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx4/main.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2019-12-21 04:42:35.000000000 -0500
@@ -198,7 +198,7 @@ int mlx4_check_port_params(struct mlx4_d
 		for (i = 0; i < dev->caps.num_ports - 1; i++) {
 			if (port_type[i] != port_type[i + 1]) {
 				mlx4_err(dev, "Only same port types supported on this HCA, aborting\n");
-				return -EINVAL;
+				return -EOPNOTSUPP;
 			}
 		}
 	}
@@ -207,7 +207,7 @@ int mlx4_check_port_params(struct mlx4_d
 		if (!(port_type[i] & dev->caps.supported_type[i+1])) {
 			mlx4_err(dev, "Requested port type for port %d is not supported on this HCA\n",
 				 i + 1);
-			return -EINVAL;
+			return -EOPNOTSUPP;
 		}
 	}
 	return 0;
@@ -1122,8 +1122,7 @@ static int __set_port_type(struct mlx4_p
 		mlx4_err(mdev,
 			 "Requested port type for port %d is not supported on this HCA\n",
 			 info->port);
-		err = -EINVAL;
-		goto err_sup;
+		return -EOPNOTSUPP;
 	}
 
 	mlx4_stop_sense(mdev);
@@ -1145,7 +1144,7 @@ static int __set_port_type(struct mlx4_p
 		for (i = 1; i <= mdev->caps.num_ports; i++) {
 			if (mdev->caps.possible_type[i] == MLX4_PORT_TYPE_AUTO) {
 				mdev->caps.possible_type[i] = mdev->caps.port_type[i];
-				err = -EINVAL;
+				err = -EOPNOTSUPP;
 			}
 		}
 	}
@@ -1171,7 +1170,7 @@ static int __set_port_type(struct mlx4_p
 out:
 	mlx4_start_sense(mdev);
 	mutex_unlock(&priv->port_mutex);
-err_sup:
+
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-12-21 04:42:35.000000000 -0500
@@ -1368,7 +1368,7 @@ static int mlx5e_get_module_info(struct
 		break;
 	case MLX5_MODULE_ID_SFP:
 		modinfo->type       = ETH_MODULE_SFF_8472;
-		modinfo->eeprom_len = MLX5_EEPROM_PAGE_LENGTH;
+		modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
 		break;
 	default:
 		netdev_err(priv->netdev, "%s: cable type not recognized:0x%x\n",
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c	2019-12-21 04:42:35.000000000 -0500
@@ -125,7 +125,7 @@ void mlx5_rsc_event(struct mlx5_core_dev
 	if (!is_event_type_allowed((rsn >> MLX5_USER_INDEX_LEN), event_type)) {
 		mlx5_core_warn(dev, "event 0x%.2x is not allowed on resource 0x%.8x\n",
 			       event_type, rsn);
-		return;
+		goto out;
 	}
 
 	switch (common->res) {
@@ -139,7 +139,7 @@ void mlx5_rsc_event(struct mlx5_core_dev
 	default:
 		mlx5_core_warn(dev, "invalid resource type for 0x%x\n", rsn);
 	}
-
+out:
 	mlx5_core_put_rsc(common);
 }
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/common.h linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/common.h
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/common.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/common.h	2019-12-21 04:42:35.000000000 -0500
@@ -354,7 +354,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.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/descs_com.h	2019-12-21 04:42:35.000000000 -0500
@@ -33,11 +33,14 @@
 /* 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->des1 |= cpu_to_le32(((BUF_SIZE_8KiB - 1)
-			<< ERDES1_BUFFER2_SIZE_SHIFT)
-		   & ERDES1_BUFFER2_SIZE_MASK);
+	if (bfsize == BUF_SIZE_16KiB)
+		p->des1 |= cpu_to_le32((BUF_SIZE_8KiB
+				<< ERDES1_BUFFER2_SIZE_SHIFT)
+                & ERDES1_BUFFER2_SIZE_MASK);
+
 
 	if (end)
 		p->des1 |= cpu_to_le32(ERDES1_END_RING);
@@ -63,11 +66,15 @@ 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->des1 |= cpu_to_le32(((BUF_SIZE_2KiB - 1)
-				<< RDES1_BUFFER2_SIZE_SHIFT)
-		    & RDES1_BUFFER2_SIZE_MASK);
+	if (bfsize >= BUF_SIZE_2KiB) {
+		int bfsize2;
+
+		bfsize2 = min(bfsize - BUF_SIZE_2KiB + 1, BUF_SIZE_2KiB - 1);
+		p->des1 |= cpu_to_le32((bfsize2 << RDES1_BUFFER2_SIZE_SHIFT)
+			    & RDES1_BUFFER2_SIZE_MASK);
+	}
 
 	if (end)
 		p->des1 |= cpu_to_le32(RDES1_END_RING);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c	2019-12-21 04:42:35.000000000 -0500
@@ -289,7 +289,7 @@ exit:
 }
 
 static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
-				   int mode, int end)
+				   int mode, int end, int bfsize)
 {
 	p->des3 = cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR);
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/enh_desc.c	2019-12-21 04:42:35.000000000 -0500
@@ -269,15 +269,19 @@ 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->des0 |= cpu_to_le32(RDES0_OWN);
-	p->des1 |= cpu_to_le32((BUF_SIZE_8KiB - 1) & ERDES1_BUFFER1_SIZE_MASK);
+
+	bfsize1 = min(bfsize, BUF_SIZE_8KiB);
+	p->des1 |= cpu_to_le32(bfsize1 & ERDES1_BUFFER1_SIZE_MASK);
 
 	if (mode == STMMAC_CHAIN_MODE)
 		ehn_desc_rx_set_on_chain(p);
 	else
-		ehn_desc_rx_set_on_ring(p, end);
+		ehn_desc_rx_set_on_ring(p, end, bfsize);
 
 	if (disable_rx_ic)
 		p->des1 |= cpu_to_le32(ERDES1_DISABLE_IC);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/norm_desc.c	2019-12-21 04:42:35.000000000 -0500
@@ -137,15 +137,19 @@ 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->des0 |= cpu_to_le32(RDES0_OWN);
-	p->des1 |= cpu_to_le32((BUF_SIZE_2KiB - 1) & RDES1_BUFFER1_SIZE_MASK);
+
+	bfsize1 = min(bfsize, BUF_SIZE_2KiB - 1);
+	p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK);
 
 	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->des1 |= cpu_to_le32(RDES1_DISABLE_IC);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c	2019-12-21 04:42:35.000000000 -0500
@@ -956,11 +956,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 == DMA_RX_SIZE - 1));
+						     (i == DMA_RX_SIZE - 1), priv->dma_buf_sz);
 		else
 			priv->hw->desc->init_rx_desc(&priv->dma_rx[i],
 						     priv->use_riwt, priv->mode,
-						     (i == DMA_RX_SIZE - 1));
+						     (i == DMA_RX_SIZE - 1), priv->dma_buf_sz);
 	for (i = 0; i < DMA_TX_SIZE; i++)
 		if (priv->extend_desc)
 			priv->hw->desc->init_tx_desc(&priv->dma_etx[i].basic,
@@ -2479,7 +2479,7 @@ static inline void stmmac_rx_refill(stru
 		wmb();
 
 		if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
-			priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0);
+			priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0, priv->dma_buf_sz);
 		else
 			priv->hw->desc->set_rx_owner(p);
 
@@ -2499,8 +2499,7 @@ static inline void stmmac_rx_refill(stru
  */
 static int stmmac_rx(struct stmmac_priv *priv, int limit)
 {
-	unsigned int entry = priv->cur_rx;
-	unsigned int next_entry;
+	unsigned int next_entry = priv->cur_rx;
 	unsigned int count = 0;
 	int coe = priv->hw->rx_csum;
 
@@ -2516,10 +2515,12 @@ static int stmmac_rx(struct stmmac_priv
 		priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true);
 	}
 	while (count < limit) {
-		int status;
+		int entry, status;
 		struct dma_desc *p;
 		struct dma_desc *np;
 
+		entry = next_entry;
+
 		if (priv->extend_desc)
 			p = (struct dma_desc *)(priv->dma_erx + entry);
 		else
@@ -2584,7 +2585,7 @@ static int stmmac_rx(struct stmmac_priv
 				       priv->dev->name, 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
@@ -2615,7 +2616,7 @@ static int stmmac_rx(struct stmmac_priv
 						dev_warn(priv->device,
 							 "packet dropped\n");
 					priv->dev->stats.rx_dropped++;
-					break;
+					continue;
 				}
 
 				dma_sync_single_for_cpu(priv->device,
@@ -2638,7 +2639,7 @@ static int stmmac_rx(struct stmmac_priv
 					pr_err("%s: Inconsistent Rx chain\n",
 					       priv->dev->name);
 					priv->dev->stats.rx_dropped++;
-					break;
+					continue;
 				}
 				prefetch(skb->data - NET_IP_ALIGN);
 				priv->rx_skbuff[entry] = NULL;
@@ -2672,7 +2673,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.9.206-gnu/drivers/net/ethernet/ti/cpsw.c linux-libre-4.9.207-gnu/drivers/net/ethernet/ti/cpsw.c
--- linux-libre-4.9.206-gnu/drivers/net/ethernet/ti/cpsw.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/ethernet/ti/cpsw.c	2019-12-21 04:42:35.000000000 -0500
@@ -773,8 +773,8 @@ static irqreturn_t cpsw_rx_interrupt(int
 {
 	struct cpsw_common *cpsw = dev_id;
 
-	cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX);
 	writel(0, &cpsw->wr_regs->rx_en);
+	cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX);
 
 	if (cpsw->quirk_irq) {
 		disable_irq_nosync(cpsw->irqs_table[0]);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/wireless/ath/ar5523/ar5523.c linux-libre-4.9.207-gnu/drivers/net/wireless/ath/ar5523/ar5523.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-05 11:14:28.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-22 01:20:14.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.9.206-gnu/drivers/net/wireless/ath/ath10k/pci.c linux-libre-4.9.207-gnu/drivers/net/wireless/ath/ath10k/pci.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/ath/ath10k/pci.c	2019-12-05 11:14:54.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/ath/ath10k/pci.c	2019-12-22 01:20:43.000000000 -0500
@@ -1765,6 +1765,11 @@ static void ath10k_pci_hif_stop(struct a
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n");
 
+	ath10k_pci_irq_disable(ar);
+	ath10k_pci_irq_sync(ar);
+	napi_synchronize(&ar->napi);
+	napi_disable(&ar->napi);
+
 	/* Most likely the device has HTT Rx ring configured. The only way to
 	 * prevent the device from accessing (and possible corrupting) host
 	 * memory is to reset the chip now.
@@ -1778,10 +1783,6 @@ static void ath10k_pci_hif_stop(struct a
 	 */
 	ath10k_pci_safe_chip_reset(ar);
 
-	ath10k_pci_irq_disable(ar);
-	ath10k_pci_irq_sync(ar);
-	napi_synchronize(&ar->napi);
-	napi_disable(&ar->napi);
 	ath10k_pci_flush(ar);
 
 	spin_lock_irqsave(&ar_pci->ps_lock, flags);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c linux-libre-4.9.207-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-12-21 04:42:35.000000000 -0500
@@ -805,6 +805,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.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-21 04:42:35.000000000 -0500
@@ -1209,6 +1209,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)
@@ -1218,7 +1219,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)
@@ -1389,7 +1390,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);
@@ -1409,9 +1410,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.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-05 11:16:22.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-22 01:22:10.000000000 -0500
@@ -243,6 +243,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.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
--- linux-libre-4.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h
--- linux-libre-4.9.206-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-21 04:42:35.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.9.206-gnu/drivers/nfc/nxp-nci/i2c.c linux-libre-4.9.207-gnu/drivers/nfc/nxp-nci/i2c.c
--- linux-libre-4.9.206-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-21 04:42:35.000000000 -0500
@@ -238,8 +238,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.9.206-gnu/drivers/nvme/host/core.c linux-libre-4.9.207-gnu/drivers/nvme/host/core.c
--- linux-libre-4.9.206-gnu/drivers/nvme/host/core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/nvme/host/core.c	2019-12-21 04:42:35.000000000 -0500
@@ -1043,7 +1043,7 @@ static int nvme_pr_reserve(struct block_
 static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
 		enum pr_type type, bool abort)
 {
-	u32 cdw10 = nvme_pr_type(type) << 8 | abort ? 2 : 1;
+	u32 cdw10 = nvme_pr_type(type) << 8 | (abort ? 2 : 1);
 	return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_acquire);
 }
 
@@ -1055,7 +1055,7 @@ static int nvme_pr_clear(struct block_de
 
 static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type)
 {
-	u32 cdw10 = nvme_pr_type(type) << 8 | key ? 1 << 3 : 0;
+	u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0);
 	return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
 }
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/pci/msi.c linux-libre-4.9.207-gnu/drivers/pci/msi.c
--- linux-libre-4.9.206-gnu/drivers/pci/msi.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pci/msi.c	2019-12-21 04:42:35.000000000 -0500
@@ -230,7 +230,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, pci_msix_desc_addr(desc) + PCI_MSIX_ENTRY_VECTOR_CTRL);
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/pci/quirks.c linux-libre-4.9.207-gnu/drivers/pci/quirks.c
--- linux-libre-4.9.206-gnu/drivers/pci/quirks.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pci/quirks.c	2019-12-21 04:42:35.000000000 -0500
@@ -4446,7 +4446,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.9.206-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c linux-libre-4.9.207-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
--- linux-libre-4.9.206-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-21 04:42:35.000000000 -0500
@@ -762,12 +762,23 @@ static int pm8xxx_gpio_probe(struct plat
 		return ret;
 	}
 
-	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.9.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
--- linux-libre-4.9.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
--- linux-libre-4.9.206-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c
--- linux-libre-4.9.206-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-21 04:42:35.000000000 -0500
@@ -281,6 +281,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;
 		}
 	}
@@ -770,8 +771,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;
@@ -782,8 +785,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.9.206-gnu/drivers/regulator/core.c linux-libre-4.9.207-gnu/drivers/regulator/core.c
--- linux-libre-4.9.206-gnu/drivers/regulator/core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/regulator/core.c	2019-12-21 04:42:35.000000000 -0500
@@ -4452,7 +4452,7 @@ static int __init regulator_init(void)
 /* init early to allow our consumers to complete system booting */
 core_initcall(regulator_init);
 
-static int regulator_late_cleanup(struct device *dev, void *data)
+static int __init regulator_late_cleanup(struct device *dev, void *data)
 {
 	struct regulator_dev *rdev = dev_to_rdev(dev);
 	const struct regulator_ops *ops = rdev->desc->ops;
@@ -4501,9 +4501,18 @@ unlock:
 	return 0;
 }
 
-static void regulator_init_complete_work_function(struct work_struct *work)
+static int __init regulator_init_complete(void)
 {
 	/*
+	 * Since DT doesn't provide an idiomatic mechanism for
+	 * enabling full constraints and since it's much more natural
+	 * with DT to provide them just assume that a DT enabled
+	 * system has full constraints.
+	 */
+	if (of_have_populated_dt())
+		has_full_constraints = true;
+
+	/*
 	 * Regulators may had failed to resolve their input supplies
 	 * when were registered, either because the input supply was
 	 * not registered yet or because its parent device was not
@@ -4520,35 +4529,6 @@ static void regulator_init_complete_work
 	 */
 	class_for_each_device(&regulator_class, NULL, NULL,
 			      regulator_late_cleanup);
-}
-
-static DECLARE_DELAYED_WORK(regulator_init_complete_work,
-			    regulator_init_complete_work_function);
-
-static int __init regulator_init_complete(void)
-{
-	/*
-	 * Since DT doesn't provide an idiomatic mechanism for
-	 * enabling full constraints and since it's much more natural
-	 * with DT to provide them just assume that a DT enabled
-	 * system has full constraints.
-	 */
-	if (of_have_populated_dt())
-		has_full_constraints = true;
-
-	/*
-	 * We punt completion for an arbitrary amount of time since
-	 * systems like distros will load many drivers from userspace
-	 * so consumers might not always be ready yet, this is
-	 * particularly an issue with laptops where this might bounce
-	 * the display off then on.  Ideally we'd get a notification
-	 * from userspace when this happens but we don't so just wait
-	 * a bit and hope we waited long enough.  It'd be better if
-	 * we'd only do this on systems that need it, and a kernel
-	 * command line option might be useful.
-	 */
-	schedule_delayed_work(&regulator_init_complete_work,
-			      msecs_to_jiffies(30000));
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/rtc/rtc-max8997.c linux-libre-4.9.207-gnu/drivers/rtc/rtc-max8997.c
--- linux-libre-4.9.206-gnu/drivers/rtc/rtc-max8997.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/rtc/rtc-max8997.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/s390/scsi/zfcp_dbf.c linux-libre-4.9.207-gnu/drivers/s390/scsi/zfcp_dbf.c
--- linux-libre-4.9.206-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/s390/scsi/zfcp_erp.c linux-libre-4.9.207-gnu/drivers/s390/scsi/zfcp_erp.c
--- linux-libre-4.9.206-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/scsi/libiscsi.c linux-libre-4.9.207-gnu/drivers/scsi/libiscsi.c
--- linux-libre-4.9.206-gnu/drivers/scsi/libiscsi.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/libiscsi.c	2019-12-21 04:42:35.000000000 -0500
@@ -1982,7 +1982,7 @@ static enum blk_eh_timer_return iscsi_eh
 
 	ISCSI_DBG_EH(session, "scsi cmd %p timedout\n", sc);
 
-	spin_lock(&session->frwd_lock);
+	spin_lock_bh(&session->frwd_lock);
 	task = (struct iscsi_task *)sc->SCp.ptr;
 	if (!task) {
 		/*
@@ -2109,7 +2109,7 @@ static enum blk_eh_timer_return iscsi_eh
 done:
 	if (task)
 		task->last_timeout = jiffies;
-	spin_unlock(&session->frwd_lock);
+	spin_unlock_bh(&session->frwd_lock);
 	ISCSI_DBG_EH(session, "return %s\n", rc == BLK_EH_RESET_TIMER ?
 		     "timer reset" : "shutdown or nh");
 	return rc;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/scsi/lpfc/lpfc_attr.c linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc_attr.c
--- linux-libre-4.9.206-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-21 04:42:35.000000000 -0500
@@ -1214,6 +1214,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)
@@ -1229,8 +1232,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.9.206-gnu/drivers/scsi/lpfc/lpfc.h linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc.h
--- linux-libre-4.9.206-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-21 04:42:35.000000000 -0500
@@ -878,7 +878,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.9.206-gnu/drivers/scsi/lpfc/lpfc_init.c linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc_init.c
--- linux-libre-4.9.206-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-05 11:20:02.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-22 01:25:55.000000000 -0500
@@ -6973,6 +6973,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.9.206-gnu/drivers/scsi/qla2xxx/qla_attr.c linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_attr.c
--- linux-libre-4.9.206-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-21 04:42:35.000000000 -0500
@@ -682,7 +682,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.9.206-gnu/drivers/scsi/qla2xxx/qla_bsg.c linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_bsg.c
--- linux-libre-4.9.206-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-21 04:42:35.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;
 	}
@@ -1740,8 +1744,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)) {
@@ -1846,6 +1850,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,
@@ -1853,10 +1860,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.9.206-gnu/drivers/scsi/qla2xxx/qla_target.c linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_target.c
--- linux-libre-4.9.206-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-21 04:42:35.000000000 -0500
@@ -5893,7 +5893,6 @@ static void qlt_abort_work(struct qla_tg
 	struct qla_hw_data *ha = vha->hw;
 	struct qla_tgt_sess *sess = NULL;
 	unsigned long flags = 0, flags2 = 0;
-	uint32_t be_s_id;
 	uint8_t s_id[3];
 	int rc;
 
@@ -5906,8 +5905,7 @@ static void qlt_abort_work(struct qla_tg
 	s_id[1] = prm->abts.fcp_hdr_le.s_id[1];
 	s_id[2] = prm->abts.fcp_hdr_le.s_id[0];
 
-	sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha,
-	    (unsigned char *)&be_s_id);
+	sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, s_id);
 	if (!sess) {
 		spin_unlock_irqrestore(&ha->tgt.sess_lock, flags2);
 
@@ -6343,7 +6341,8 @@ qlt_enable_vha(struct scsi_qla_host *vha
 
 		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);
@@ -6373,7 +6372,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.9.206-gnu/drivers/spi/spi-atmel.c linux-libre-4.9.207-gnu/drivers/spi/spi-atmel.c
--- linux-libre-4.9.206-gnu/drivers/spi/spi-atmel.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/spi/spi-atmel.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/staging/iio/addac/adt7316-i2c.c linux-libre-4.9.207-gnu/drivers/staging/iio/addac/adt7316-i2c.c
--- linux-libre-4.9.206-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/staging/media/pulse8-cec/pulse8-cec.c linux-libre-4.9.207-gnu/drivers/staging/media/pulse8-cec/pulse8-cec.c
--- linux-libre-4.9.206-gnu/drivers/staging/media/pulse8-cec/pulse8-cec.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/staging/media/pulse8-cec/pulse8-cec.c	2019-12-21 04:42:35.000000000 -0500
@@ -580,7 +580,7 @@ unlock:
 	else
 		pulse8->config_pending = true;
 	mutex_unlock(&pulse8->config_lock);
-	return err;
+	return log_addr == CEC_LOG_ADDR_INVALID ? 0 : err;
 }
 
 static int pulse8_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c linux-libre-4.9.207-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c
--- linux-libre-4.9.206-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-21 04:42:35.000000000 -0500
@@ -78,7 +78,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.9.206-gnu/drivers/staging/rtl8712/usb_intf.c linux-libre-4.9.207-gnu/drivers/staging/rtl8712/usb_intf.c
--- linux-libre-4.9.206-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-21 04:42:35.000000000 -0500
@@ -275,7 +275,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.9.206-gnu/drivers/thermal/thermal_core.c linux-libre-4.9.207-gnu/drivers/thermal/thermal_core.c
--- linux-libre-4.9.206-gnu/drivers/thermal/thermal_core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/thermal/thermal_core.c	2019-12-21 04:42:35.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)
@@ -2073,7 +2073,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.9.206-gnu/drivers/tty/n_hdlc.c linux-libre-4.9.207-gnu/drivers/tty/n_hdlc.c
--- linux-libre-4.9.206-gnu/drivers/tty/n_hdlc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/n_hdlc.c	2019-12-21 04:42:35.000000000 -0500
@@ -614,7 +614,7 @@ static ssize_t n_hdlc_tty_read(struct tt
 		}
 			
 		/* no data */
-		if (file->f_flags & O_NONBLOCK) {
+		if (tty_io_nonblock(tty, file)) {
 			ret = -EAGAIN;
 			break;
 		}
@@ -681,7 +681,7 @@ static ssize_t n_hdlc_tty_write(struct t
 		if (tbuf)
 			break;
 
-		if (file->f_flags & O_NONBLOCK) {
+		if (tty_io_nonblock(tty, file)) {
 			error = -EAGAIN;
 			break;
 		}
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/n_r3964.c linux-libre-4.9.207-gnu/drivers/tty/n_r3964.c
--- linux-libre-4.9.206-gnu/drivers/tty/n_r3964.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/n_r3964.c	2019-12-21 04:42:35.000000000 -0500
@@ -1080,7 +1080,7 @@ static ssize_t r3964_read(struct tty_str
 		pMsg = remove_msg(pInfo, pClient);
 		if (pMsg == NULL) {
 			/* no messages available. */
-			if (file->f_flags & O_NONBLOCK) {
+			if (tty_io_nonblock(tty, file)) {
 				ret = -EAGAIN;
 				goto unlock;
 			}
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/n_tty.c linux-libre-4.9.207-gnu/drivers/tty/n_tty.c
--- linux-libre-4.9.206-gnu/drivers/tty/n_tty.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/n_tty.c	2019-12-21 04:42:35.000000000 -0500
@@ -1704,7 +1704,7 @@ n_tty_receive_buf_common(struct tty_stru
 
 	down_read(&tty->termios_rwsem);
 
-	while (1) {
+	do {
 		/*
 		 * When PARMRK is set, each input char may take up to 3 chars
 		 * in the read buf; reduce the buffer space avail by 3x
@@ -1746,7 +1746,7 @@ n_tty_receive_buf_common(struct tty_stru
 			fp += n;
 		count -= n;
 		rcvd += n;
-	}
+	} while (!test_bit(TTY_LDISC_CHANGING, &tty->flags));
 
 	tty->receive_room = room;
 
@@ -2213,7 +2213,7 @@ static ssize_t n_tty_read(struct tty_str
 					break;
 				if (!timeout)
 					break;
-				if (file->f_flags & O_NONBLOCK) {
+				if (tty_io_nonblock(tty, file)) {
 					retval = -EAGAIN;
 					break;
 				}
@@ -2367,7 +2367,7 @@ static ssize_t n_tty_write(struct tty_st
 		}
 		if (!nr)
 			break;
-		if (file->f_flags & O_NONBLOCK) {
+		if (tty_io_nonblock(tty, file)) {
 			retval = -EAGAIN;
 			break;
 		}
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/serial/amba-pl011.c linux-libre-4.9.207-gnu/drivers/tty/serial/amba-pl011.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/amba-pl011.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/amba-pl011.c	2019-12-21 04:42:35.000000000 -0500
@@ -811,10 +811,8 @@ __acquires(&uap->port.lock)
 	if (!uap->using_tx_dma)
 		return;
 
-	/* Avoid deadlock with the DMA engine callback */
-	spin_unlock(&uap->port.lock);
-	dmaengine_terminate_all(uap->dmatx.chan);
-	spin_lock(&uap->port.lock);
+	dmaengine_terminate_async(uap->dmatx.chan);
+
 	if (uap->dmatx.queued) {
 		dma_unmap_sg(uap->dmatx.chan->device->dev, &uap->dmatx.sg, 1,
 			     DMA_TO_DEVICE);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/serial/fsl_lpuart.c linux-libre-4.9.207-gnu/drivers/tty/serial/fsl_lpuart.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/fsl_lpuart.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/fsl_lpuart.c	2019-12-21 04:42:35.000000000 -0500
@@ -346,8 +346,8 @@ static void lpuart_dma_tx(struct lpuart_
 	}
 
 	sport->dma_tx_desc = dmaengine_prep_slave_sg(sport->dma_tx_chan, sgl,
-					sport->dma_tx_nents,
-					DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT);
+					ret, DMA_MEM_TO_DEV,
+					DMA_PREP_INTERRUPT);
 	if (!sport->dma_tx_desc) {
 		dma_unmap_sg(dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE);
 		dev_err(dev, "Cannot prepare TX slave DMA!\n");
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/serial/ifx6x60.c linux-libre-4.9.207-gnu/drivers/tty/serial/ifx6x60.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/ifx6x60.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/ifx6x60.c	2019-12-21 04:42:35.000000000 -0500
@@ -1244,6 +1244,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.9.206-gnu/drivers/tty/serial/imx.c linux-libre-4.9.207-gnu/drivers/tty/serial/imx.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/imx.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/imx.c	2019-12-21 04:42:35.000000000 -0500
@@ -1943,7 +1943,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.9.206-gnu/drivers/tty/serial/msm_serial.c linux-libre-4.9.207-gnu/drivers/tty/serial/msm_serial.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/msm_serial.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/msm_serial.c	2019-12-21 04:42:35.000000000 -0500
@@ -988,6 +988,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);
@@ -995,7 +996,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.9.206-gnu/drivers/tty/serial/serial_core.c linux-libre-4.9.207-gnu/drivers/tty/serial/serial_core.c
--- linux-libre-4.9.206-gnu/drivers/tty/serial/serial_core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/serial/serial_core.c	2019-12-21 04:42:35.000000000 -0500
@@ -1106,7 +1106,7 @@ static int uart_break_ctl(struct tty_str
 	if (!uport)
 		goto out;
 
-	if (uport->type != PORT_UNKNOWN)
+	if (uport->type != PORT_UNKNOWN && uport->ops->break_ctl)
 		uport->ops->break_ctl(uport, break_state);
 	ret = 0;
 out:
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/tty_ldisc.c linux-libre-4.9.207-gnu/drivers/tty/tty_ldisc.c
--- linux-libre-4.9.206-gnu/drivers/tty/tty_ldisc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/tty_ldisc.c	2019-12-21 04:42:35.000000000 -0500
@@ -348,6 +348,11 @@ int tty_ldisc_lock(struct tty_struct *tt
 {
 	int ret;
 
+	/* Kindly asking blocked readers to release the read side */
+	set_bit(TTY_LDISC_CHANGING, &tty->flags);
+	wake_up_interruptible_all(&tty->read_wait);
+	wake_up_interruptible_all(&tty->write_wait);
+
 	ret = __tty_ldisc_lock(tty, timeout);
 	if (!ret)
 		return -EBUSY;
@@ -358,6 +363,8 @@ int tty_ldisc_lock(struct tty_struct *tt
 void tty_ldisc_unlock(struct tty_struct *tty)
 {
 	clear_bit(TTY_LDISC_HALTED, &tty->flags);
+	/* Can be cleared here - ldisc_unlock will wake up writers firstly */
+	clear_bit(TTY_LDISC_CHANGING, &tty->flags);
 	__tty_ldisc_unlock(tty);
 }
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/tty/vt/keyboard.c linux-libre-4.9.207-gnu/drivers/tty/vt/keyboard.c
--- linux-libre-4.9.206-gnu/drivers/tty/vt/keyboard.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/tty/vt/keyboard.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/usb/atm/ueagle-atm.c linux-libre-4.9.207-gnu/drivers/usb/atm/ueagle-atm.c
--- linux-libre-4.9.206-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-05 11:20:22.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-22 01:26:16.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)
 		goto err0;
@@ -2206,8 +2212,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) {
@@ -2222,6 +2227,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;
 	}
 
@@ -2236,7 +2242,7 @@ err1:
 	kfree(intr);
 err0:
 	uea_leaves(INS_TO_USBDEV(sc));
-	return -ENOMEM;
+	return ret;
 }
 
 /*
@@ -2597,7 +2603,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.9.206-gnu/drivers/usb/core/hub.c linux-libre-4.9.207-gnu/drivers/usb/core/hub.c
--- linux-libre-4.9.206-gnu/drivers/usb/core/hub.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/core/hub.c	2019-12-21 04:42:35.000000000 -0500
@@ -5620,7 +5620,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
@@ -5648,8 +5648,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.9.206-gnu/drivers/usb/core/urb.c linux-libre-4.9.207-gnu/drivers/usb/core/urb.c
--- linux-libre-4.9.206-gnu/drivers/usb/core/urb.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/core/urb.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/usb/dwc3/core.c linux-libre-4.9.207-gnu/drivers/usb/dwc3/core.c
--- linux-libre-4.9.206-gnu/drivers/usb/dwc3/core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/dwc3/core.c	2019-12-21 04:42:35.000000000 -0500
@@ -1102,7 +1102,8 @@ static int dwc3_probe(struct platform_de
 
 	ret = dwc3_core_init(dwc);
 	if (ret) {
-		dev_err(dev, "failed to initialize core\n");
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "failed to initialize core: %d\n", ret);
 		goto err4;
 	}
 
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/usb/gadget/configfs.c linux-libre-4.9.207-gnu/drivers/usb/gadget/configfs.c
--- linux-libre-4.9.206-gnu/drivers/usb/gadget/configfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/gadget/configfs.c	2019-12-21 04:42:35.000000000 -0500
@@ -1541,6 +1541,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.9.206-gnu/drivers/usb/gadget/function/u_serial.c linux-libre-4.9.207-gnu/drivers/usb/gadget/function/u_serial.c
--- linux-libre-4.9.206-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-21 04:42:35.000000000 -0500
@@ -1391,8 +1391,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.9.206-gnu/drivers/usb/host/xhci.c linux-libre-4.9.207-gnu/drivers/usb/host/xhci.c
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci.c	2019-12-21 04:42:35.000000000 -0500
@@ -758,11 +758,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)
@@ -933,7 +930,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.9.206-gnu/drivers/usb/host/xhci.h linux-libre-4.9.207-gnu/drivers/usb/host/xhci.h
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci.h	2019-12-21 04:42:35.000000000 -0500
@@ -316,6 +316,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) */
@@ -1865,6 +1866,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.9.206-gnu/drivers/usb/host/xhci-hub.c linux-libre-4.9.207-gnu/drivers/usb/host/xhci-hub.c
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci-hub.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci-hub.c	2019-12-21 04:42:35.000000000 -0500
@@ -728,7 +728,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)
 {
@@ -760,6 +760,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) {
@@ -810,12 +818,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,
@@ -961,7 +969,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.9.206-gnu/drivers/usb/host/xhci-mem.c linux-libre-4.9.207-gnu/drivers/usb/host/xhci-mem.c
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci-mem.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci-mem.c	2019-12-21 04:42:35.000000000 -0500
@@ -1940,10 +1940,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.9.206-gnu/drivers/usb/host/xhci-pci.c linux-libre-4.9.207-gnu/drivers/usb/host/xhci-pci.c
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci-pci.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci-pci.c	2019-12-21 04:42:35.000000000 -0500
@@ -470,6 +470,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 */
@@ -505,6 +517,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.9.206-gnu/drivers/usb/host/xhci-ring.c linux-libre-4.9.207-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-4.9.206-gnu/drivers/usb/host/xhci-ring.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/host/xhci-ring.c	2019-12-21 04:42:35.000000000 -0500
@@ -1609,9 +1609,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);
 
@@ -1630,6 +1627,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
@@ -1667,8 +1665,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.9.206-gnu/drivers/usb/misc/adutux.c linux-libre-4.9.207-gnu/drivers/usb/misc/adutux.c
--- linux-libre-4.9.206-gnu/drivers/usb/misc/adutux.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/misc/adutux.c	2019-12-21 04:42:35.000000000 -0500
@@ -685,7 +685,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.9.206-gnu/drivers/usb/misc/idmouse.c linux-libre-4.9.207-gnu/drivers/usb/misc/idmouse.c
--- linux-libre-4.9.206-gnu/drivers/usb/misc/idmouse.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/misc/idmouse.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/usb/mon/mon_bin.c linux-libre-4.9.207-gnu/drivers/usb/mon/mon_bin.c
--- linux-libre-4.9.206-gnu/drivers/usb/mon/mon_bin.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/mon/mon_bin.c	2019-12-21 04:42:35.000000000 -0500
@@ -1036,12 +1036,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);
 		}
@@ -1213,13 +1219,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);
 }
 
 /*
@@ -1231,16 +1245,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.9.206-gnu/drivers/usb/serial/io_edgeport.c linux-libre-4.9.207-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-4.9.206-gnu/drivers/usb/serial/io_edgeport.c	2019-12-05 11:21:00.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/serial/io_edgeport.c	2019-12-22 01:26:53.000000000 -0500
@@ -2852,16 +2852,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.9.206-gnu/drivers/usb/storage/uas.c linux-libre-4.9.207-gnu/drivers/usb/storage/uas.c
--- linux-libre-4.9.206-gnu/drivers/usb/storage/uas.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/usb/storage/uas.c	2019-12-21 04:42:35.000000000 -0500
@@ -832,6 +832,10 @@ static int uas_slave_configure(struct sc
 		sdev->wce_default_on = 1;
 	}
 
+	/* Some disks cannot handle READ_CAPACITY_16 */
+	if (devinfo->flags & US_FL_NO_READ_CAPACITY_16)
+		sdev->no_read_capacity_16 = 1;
+
 	/*
 	 * Some disks return the total number of blocks in response
 	 * to READ CAPACITY rather than the highest block number.
@@ -841,6 +845,12 @@ static int uas_slave_configure(struct sc
 		sdev->fix_capacity = 1;
 
 	/*
+	 * in some cases we have to guess
+	 */
+	if (devinfo->flags & US_FL_CAPACITY_HEURISTICS)
+		sdev->guess_capacity = 1;
+
+	/*
 	 * Some devices don't like MODE SENSE with page=0x3f,
 	 * which is the command used for checking if a device
 	 * is write-protected.  Now that we tell the sd driver
diff -druNp --no-dereference linux-libre-4.9.206-gnu/drivers/vfio/pci/vfio_pci_intrs.c linux-libre-4.9.207-gnu/drivers/vfio/pci/vfio_pci_intrs.c
--- linux-libre-4.9.206-gnu/drivers/vfio/pci/vfio_pci_intrs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/vfio/pci/vfio_pci_intrs.c	2019-12-21 04:42:35.000000000 -0500
@@ -297,8 +297,8 @@ static int vfio_msi_set_vector_signal(st
 	irq = pci_irq_vector(pdev, vector);
 
 	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.9.206-gnu/drivers/video/hdmi.c linux-libre-4.9.207-gnu/drivers/video/hdmi.c
--- linux-libre-4.9.206-gnu/drivers/video/hdmi.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/video/hdmi.c	2019-12-21 04:42:35.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.9.206-gnu/drivers/virtio/virtio_balloon.c linux-libre-4.9.207-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-4.9.206-gnu/drivers/virtio/virtio_balloon.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/drivers/virtio/virtio_balloon.c	2019-12-21 04:42:35.000000000 -0500
@@ -482,6 +482,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.9.206-gnu/fs/autofs4/expire.c linux-libre-4.9.207-gnu/fs/autofs4/expire.c
--- linux-libre-4.9.206-gnu/fs/autofs4/expire.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/autofs4/expire.c	2019-12-21 04:42:35.000000000 -0500
@@ -469,9 +469,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.9.206-gnu/fs/btrfs/file.c linux-libre-4.9.207-gnu/fs/btrfs/file.c
--- linux-libre-4.9.206-gnu/fs/btrfs/file.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/btrfs/file.c	2019-12-21 04:42:35.000000000 -0500
@@ -1555,6 +1555,7 @@ static noinline ssize_t __btrfs_buffered
 			break;
 		}
 
+		only_release_metadata = false;
 		sector_offset = pos & (root->sectorsize - 1);
 		reserve_bytes = round_up(write_bytes + sector_offset,
 				root->sectorsize);
@@ -1704,7 +1705,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.9.206-gnu/fs/btrfs/free-space-cache.c linux-libre-4.9.207-gnu/fs/btrfs/free-space-cache.c
--- linux-libre-4.9.206-gnu/fs/btrfs/free-space-cache.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/btrfs/free-space-cache.c	2019-12-21 04:42:35.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.9.206-gnu/fs/btrfs/inode.c linux-libre-4.9.207-gnu/fs/btrfs/inode.c
--- linux-libre-4.9.206-gnu/fs/btrfs/inode.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/btrfs/inode.c	2019-12-21 04:42:35.000000000 -0500
@@ -9616,6 +9616,9 @@ static int btrfs_rename_exchange(struct
 		goto out_notrans;
 	}
 
+	if (dest != root)
+		btrfs_record_root_in_trans(trans, dest);
+
 	/*
 	 * We need to find a free sequence number both in the source and
 	 * in the destination directory for the exchange.
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/btrfs/send.c linux-libre-4.9.207-gnu/fs/btrfs/send.c
--- linux-libre-4.9.206-gnu/fs/btrfs/send.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/btrfs/send.c	2019-12-21 04:42:35.000000000 -0500
@@ -37,6 +37,14 @@
 #include "compression.h"
 
 /*
+ * Maximum number of references an extent can have in order for us to attempt to
+ * issue clone operations instead of write operations. This currently exists to
+ * avoid hitting limitations of the backreference walking code (taking a lot of
+ * time and using too much memory for extents with large number of references).
+ */
+#define SEND_MAX_EXTENT_REFS	64
+
+/*
  * A fs_path is a helper to dynamically build path names with unknown size.
  * It reallocates the internal buffer on demand.
  * It allows fast adding of path elements on the right side (normal path) and
@@ -1327,6 +1335,7 @@ static int find_extent_clone(struct send
 	struct clone_root *cur_clone_root;
 	struct btrfs_key found_key;
 	struct btrfs_path *tmp_path;
+	struct btrfs_extent_item *ei;
 	int compressed;
 	u32 i;
 
@@ -1376,7 +1385,6 @@ static int find_extent_clone(struct send
 	ret = extent_from_logical(fs_info, disk_byte, tmp_path,
 				  &found_key, &flags);
 	up_read(&fs_info->commit_root_sem);
-	btrfs_release_path(tmp_path);
 
 	if (ret < 0)
 		goto out;
@@ -1385,6 +1393,21 @@ static int find_extent_clone(struct send
 		goto out;
 	}
 
+	ei = btrfs_item_ptr(tmp_path->nodes[0], tmp_path->slots[0],
+			    struct btrfs_extent_item);
+	/*
+	 * Backreference walking (iterate_extent_inodes() below) is currently
+	 * too expensive when an extent has a large number of references, both
+	 * in time spent and used memory. So for now just fallback to write
+	 * operations instead of clone operations when an extent has more than
+	 * a certain amount of references.
+	 */
+	if (btrfs_extent_refs(tmp_path->nodes[0], ei) > SEND_MAX_EXTENT_REFS) {
+		ret = -ENOENT;
+		goto out;
+	}
+	btrfs_release_path(tmp_path);
+
 	/*
 	 * Setup the clone roots.
 	 */
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/btrfs/volumes.h linux-libre-4.9.207-gnu/fs/btrfs/volumes.h
--- linux-libre-4.9.206-gnu/fs/btrfs/volumes.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/btrfs/volumes.h	2019-12-21 04:42:35.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.9.206-gnu/fs/cifs/file.c linux-libre-4.9.207-gnu/fs/cifs/file.c
--- linux-libre-4.9.206-gnu/fs/cifs/file.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/cifs/file.c	2019-12-21 04:42:35.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;
@@ -721,6 +722,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.9.206-gnu/fs/cifs/smb2misc.c linux-libre-4.9.207-gnu/fs/cifs/smb2misc.c
--- linux-libre-4.9.206-gnu/fs/cifs/smb2misc.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/cifs/smb2misc.c	2019-12-21 04:42:35.000000000 -0500
@@ -617,10 +617,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,
@@ -632,6 +632,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) &&
@@ -664,9 +666,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.9.206-gnu/fs/dlm/lockspace.c linux-libre-4.9.207-gnu/fs/dlm/lockspace.c
--- linux-libre-4.9.206-gnu/fs/dlm/lockspace.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/dlm/lockspace.c	2019-12-21 04:42:35.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.9.206-gnu/fs/dlm/memory.c linux-libre-4.9.207-gnu/fs/dlm/memory.c
--- linux-libre-4.9.206-gnu/fs/dlm/memory.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/dlm/memory.c	2019-12-21 04:42:35.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.9.206-gnu/fs/dlm/user.c linux-libre-4.9.207-gnu/fs/dlm/user.c
--- linux-libre-4.9.206-gnu/fs/dlm/user.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/dlm/user.c	2019-12-21 04:42:35.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.9.206-gnu/fs/exportfs/expfs.c linux-libre-4.9.207-gnu/fs/exportfs/expfs.c
--- linux-libre-4.9.206-gnu/fs/exportfs/expfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/exportfs/expfs.c	2019-12-21 04:42:35.000000000 -0500
@@ -506,26 +506,33 @@ struct dentry *exportfs_decode_fh(struct
 		 * inode is actually connected to the parent.
 		 */
 		err = exportfs_get_name(mnt, target_dir, nbuf, result);
-		if (!err) {
-			inode_lock(target_dir->d_inode);
-			nresult = lookup_one_len(nbuf, target_dir,
-						 strlen(nbuf));
-			inode_unlock(target_dir->d_inode);
-			if (!IS_ERR(nresult)) {
-				if (nresult->d_inode) {
-					dput(result);
-					result = nresult;
-				} else
-					dput(nresult);
-			}
+		if (err) {
+			dput(target_dir);
+			goto err_result;
 		}
 
+		inode_lock(target_dir->d_inode);
+		nresult = lookup_one_len(nbuf, target_dir, strlen(nbuf));
+		if (!IS_ERR(nresult)) {
+			if (unlikely(nresult->d_inode != result->d_inode)) {
+				dput(nresult);
+				nresult = ERR_PTR(-ESTALE);
+			}
+		}
+		inode_unlock(target_dir->d_inode);
 		/*
 		 * At this point we are done with the parent, but it's pinned
 		 * by the child dentry anyway.
 		 */
 		dput(target_dir);
 
+		if (IS_ERR(nresult)) {
+			err = PTR_ERR(nresult);
+			goto err_result;
+		}
+		dput(result);
+		result = nresult;
+
 		/*
 		 * And finally make sure the dentry is actually acceptable
 		 * to NFSD.
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/ext2/inode.c linux-libre-4.9.207-gnu/fs/ext2/inode.c
--- linux-libre-4.9.206-gnu/fs/ext2/inode.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/ext2/inode.c	2019-12-21 04:42:35.000000000 -0500
@@ -697,10 +697,13 @@ static int ext2_get_blocks(struct inode
 		if (!partial) {
 			count++;
 			mutex_unlock(&ei->truncate_mutex);
-			if (err)
-				goto cleanup;
 			goto got_it;
 		}
+
+		if (err) {
+			mutex_unlock(&ei->truncate_mutex);
+			goto cleanup;
+		}
 	}
 
 	/*
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/ext4/inode.c linux-libre-4.9.207-gnu/fs/ext4/inode.c
--- linux-libre-4.9.206-gnu/fs/ext4/inode.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/ext4/inode.c	2019-12-21 04:42:35.000000000 -0500
@@ -5080,11 +5080,15 @@ static void ext4_wait_for_tail_page_comm
 
 	offset = inode->i_size & (PAGE_SIZE - 1);
 	/*
-	 * All buffers in the last page remain valid? Then there's nothing to
-	 * do. We do the check mainly to optimize the common PAGE_SIZE ==
-	 * blocksize case
+	 * If the page is fully truncated, we don't need to wait for any commit
+	 * (and we even should not as __ext4_journalled_invalidatepage() may
+	 * strip all buffers from the page but keep the page dirty which can then
+	 * confuse e.g. concurrent ext4_writepage() seeing dirty page without
+	 * buffers). Also we don't need to wait for any commit if all buffers in
+	 * the page remain valid. This is most beneficial for the common case of
+	 * blocksize == PAGESIZE.
 	 */
-	if (offset > PAGE_SIZE - i_blocksize(inode))
+	if (!offset || offset > (PAGE_SIZE - i_blocksize(inode)))
 		return;
 	while (1) {
 		page = find_lock_page(inode->i_mapping,
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/fuse/dir.c linux-libre-4.9.207-gnu/fs/fuse/dir.c
--- linux-libre-4.9.206-gnu/fs/fuse/dir.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/fuse/dir.c	2019-12-21 04:42:35.000000000 -0500
@@ -234,7 +234,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;
 
 		forget_all_cached_acls(inode);
@@ -297,6 +298,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, const struct qstr *name,
 		     struct fuse_entry_out *outarg, struct inode **inode)
 {
@@ -328,7 +335,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,
@@ -451,7 +458,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;
@@ -557,7 +565,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)
@@ -830,7 +838,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);
@@ -910,7 +919,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 {
@@ -1218,7 +1228,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);
@@ -1695,7 +1705,8 @@ int fuse_do_setattr(struct dentry *dentr
 		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.9.206-gnu/fs/fuse/fuse_i.h linux-libre-4.9.207-gnu/fs/fuse/fuse_i.h
--- linux-libre-4.9.206-gnu/fs/fuse/fuse_i.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/fuse/fuse_i.h	2019-12-21 04:42:35.000000000 -0500
@@ -898,6 +898,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.9.206-gnu/fs/nfsd/nfs4recover.c linux-libre-4.9.207-gnu/fs/nfsd/nfs4recover.c
--- linux-libre-4.9.206-gnu/fs/nfsd/nfs4recover.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/nfsd/nfs4recover.c	2019-12-21 04:42:35.000000000 -0500
@@ -661,7 +661,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;
 };
 
@@ -670,23 +670,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;
@@ -753,7 +748,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;
 }
 
@@ -768,7 +763,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 = {
@@ -899,7 +894,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.9.206-gnu/fs/nfsd/vfs.c linux-libre-4.9.207-gnu/fs/nfsd/vfs.c
--- linux-libre-4.9.206-gnu/fs/nfsd/vfs.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/nfsd/vfs.c	2019-12-21 04:42:35.000000000 -0500
@@ -395,10 +395,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.9.206-gnu/fs/ocfs2/quota_global.c linux-libre-4.9.207-gnu/fs/ocfs2/quota_global.c
--- linux-libre-4.9.206-gnu/fs/ocfs2/quota_global.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/ocfs2/quota_global.c	2019-12-21 04:42:35.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.9.206-gnu/fs/quota/dquot.c linux-libre-4.9.207-gnu/fs/quota/dquot.c
--- linux-libre-4.9.206-gnu/fs/quota/dquot.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/quota/dquot.c	2019-12-21 04:42:35.000000000 -0500
@@ -479,7 +479,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) {
@@ -611,7 +611,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;
@@ -624,9 +624,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.9.206-gnu/fs/reiserfs/inode.c linux-libre-4.9.207-gnu/fs/reiserfs/inode.c
--- linux-libre-4.9.206-gnu/fs/reiserfs/inode.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/inode.c	2019-12-21 04:42:35.000000000 -0500
@@ -2102,6 +2102,15 @@ int reiserfs_new_inode(struct reiserfs_t
 		goto out_inserted_sd;
 	}
 
+	/*
+	 * Mark it private if we're creating the privroot
+	 * or something under it.
+	 */
+	if (IS_PRIVATE(dir) || dentry == REISERFS_SB(sb)->priv_root) {
+		inode->i_flags |= S_PRIVATE;
+		inode->i_opflags &= ~IOP_XATTR;
+	}
+
 	if (reiserfs_posixacl(inode->i_sb)) {
 		reiserfs_write_unlock(inode->i_sb);
 		retval = reiserfs_inherit_default_acl(th, dir, dentry, inode);
@@ -2116,8 +2125,7 @@ int reiserfs_new_inode(struct reiserfs_t
 		reiserfs_warning(inode->i_sb, "jdm-13090",
 				 "ACLs aren't enabled in the fs, "
 				 "but vfs thinks they are!");
-	} else if (IS_PRIVATE(dir))
-		inode->i_flags |= S_PRIVATE;
+	}
 
 	if (security->name) {
 		reiserfs_write_unlock(inode->i_sb);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/reiserfs/namei.c linux-libre-4.9.207-gnu/fs/reiserfs/namei.c
--- linux-libre-4.9.206-gnu/fs/reiserfs/namei.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/namei.c	2019-12-21 04:42:35.000000000 -0500
@@ -377,10 +377,13 @@ static struct dentry *reiserfs_lookup(st
 
 		/*
 		 * Propagate the private flag so we know we're
-		 * in the priv tree
+		 * in the priv tree.  Also clear IOP_XATTR
+		 * since we don't have xattrs on xattr files.
 		 */
-		if (IS_PRIVATE(dir))
+		if (IS_PRIVATE(dir)) {
 			inode->i_flags |= S_PRIVATE;
+			inode->i_opflags &= ~IOP_XATTR;
+		}
 	}
 	reiserfs_write_unlock(dir->i_sb);
 	if (retval == IO_ERROR) {
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/reiserfs/reiserfs.h linux-libre-4.9.207-gnu/fs/reiserfs/reiserfs.h
--- linux-libre-4.9.206-gnu/fs/reiserfs/reiserfs.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/reiserfs.h	2019-12-21 04:42:35.000000000 -0500
@@ -1167,6 +1167,8 @@ static inline int bmap_would_wrap(unsign
 	return bmap_nr > ((1LL << 16) - 1);
 }
 
+extern const struct xattr_handler *reiserfs_xattr_handlers[];
+
 /*
  * this says about version of key of all items (but stat data) the
  * object consists of
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/reiserfs/super.c linux-libre-4.9.207-gnu/fs/reiserfs/super.c
--- linux-libre-4.9.206-gnu/fs/reiserfs/super.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/super.c	2019-12-21 04:42:35.000000000 -0500
@@ -2026,6 +2026,8 @@ static int reiserfs_fill_super(struct su
 	if (replay_only(s))
 		goto error_unlocked;
 
+	s->s_xattr = reiserfs_xattr_handlers;
+
 	if (bdev_read_only(s->s_bdev) && !(s->s_flags & MS_RDONLY)) {
 		SWARN(silent, s, "clm-7000",
 		      "Detected readonly device, marking FS readonly");
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/reiserfs/xattr_acl.c linux-libre-4.9.207-gnu/fs/reiserfs/xattr_acl.c
--- linux-libre-4.9.206-gnu/fs/reiserfs/xattr_acl.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/xattr_acl.c	2019-12-21 04:42:35.000000000 -0500
@@ -316,10 +316,8 @@ reiserfs_inherit_default_acl(struct reis
 	 * would be useless since permissions are ignored, and a pain because
 	 * it introduces locking cycles
 	 */
-	if (IS_PRIVATE(dir)) {
-		inode->i_flags |= S_PRIVATE;
+	if (IS_PRIVATE(inode))
 		goto apply_umask;
-	}
 
 	err = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl);
 	if (err)
diff -druNp --no-dereference linux-libre-4.9.206-gnu/fs/reiserfs/xattr.c linux-libre-4.9.207-gnu/fs/reiserfs/xattr.c
--- linux-libre-4.9.206-gnu/fs/reiserfs/xattr.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/fs/reiserfs/xattr.c	2019-12-21 04:42:35.000000000 -0500
@@ -121,13 +121,13 @@ static struct dentry *open_xa_root(struc
 	struct dentry *xaroot;
 
 	if (d_really_is_negative(privroot))
-		return ERR_PTR(-ENODATA);
+		return ERR_PTR(-EOPNOTSUPP);
 
 	inode_lock_nested(d_inode(privroot), I_MUTEX_XATTR);
 
 	xaroot = dget(REISERFS_SB(sb)->xattr_root);
 	if (!xaroot)
-		xaroot = ERR_PTR(-ENODATA);
+		xaroot = ERR_PTR(-EOPNOTSUPP);
 	else if (d_really_is_negative(xaroot)) {
 		int err = -ENODATA;
 
@@ -609,6 +609,10 @@ int reiserfs_xattr_set(struct inode *ino
 	int error, error2;
 	size_t jbegin_count = reiserfs_xattr_nblocks(inode, buffer_size);
 
+	/* Check before we start a transaction and then do nothing. */
+	if (!d_really_is_positive(REISERFS_SB(inode->i_sb)->priv_root))
+		return -EOPNOTSUPP;
+
 	if (!(flags & XATTR_REPLACE))
 		jbegin_count += reiserfs_xattr_jcreate_nblocks(inode);
 
@@ -831,8 +835,7 @@ ssize_t reiserfs_listxattr(struct dentry
 	if (d_really_is_negative(dentry))
 		return -EINVAL;
 
-	if (!dentry->d_sb->s_xattr ||
-	    get_inode_sd_version(d_inode(dentry)) == STAT_DATA_V1)
+	if (get_inode_sd_version(d_inode(dentry)) == STAT_DATA_V1)
 		return -EOPNOTSUPP;
 
 	dir = open_xa_dir(d_inode(dentry), XATTR_REPLACE);
@@ -872,6 +875,7 @@ static int create_privroot(struct dentry
 	}
 
 	d_inode(dentry)->i_flags |= S_PRIVATE;
+	d_inode(dentry)->i_opflags &= ~IOP_XATTR;
 	reiserfs_info(dentry->d_sb, "Created %s - reserved for xattr "
 		      "storage.\n", PRIVROOT_NAME);
 
@@ -885,7 +889,7 @@ static int create_privroot(struct dentry
 #endif
 
 /* Actual operations that are exported to VFS-land */
-static const struct xattr_handler *reiserfs_xattr_handlers[] = {
+const struct xattr_handler *reiserfs_xattr_handlers[] = {
 #ifdef CONFIG_REISERFS_FS_XATTR
 	&reiserfs_xattr_user_handler,
 	&reiserfs_xattr_trusted_handler,
@@ -956,8 +960,10 @@ int reiserfs_lookup_privroot(struct supe
 	if (!IS_ERR(dentry)) {
 		REISERFS_SB(s)->priv_root = dentry;
 		d_set_d_op(dentry, &xattr_lookup_poison_ops);
-		if (d_really_is_positive(dentry))
+		if (d_really_is_positive(dentry)) {
 			d_inode(dentry)->i_flags |= S_PRIVATE;
+			d_inode(dentry)->i_opflags &= ~IOP_XATTR;
+		}
 	} else
 		err = PTR_ERR(dentry);
 	inode_unlock(d_inode(s->s_root));
@@ -986,7 +992,6 @@ int reiserfs_xattr_init(struct super_blo
 	}
 
 	if (d_really_is_positive(privroot)) {
-		s->s_xattr = reiserfs_xattr_handlers;
 		inode_lock(d_inode(privroot));
 		if (!REISERFS_SB(s)->xattr_root) {
 			struct dentry *dentry;
diff -druNp --no-dereference linux-libre-4.9.206-gnu/include/linux/acpi.h linux-libre-4.9.207-gnu/include/linux/acpi.h
--- linux-libre-4.9.206-gnu/include/linux/acpi.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/acpi.h	2019-12-21 04:42:35.000000000 -0500
@@ -77,7 +77,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.9.206-gnu/include/linux/atalk.h linux-libre-4.9.207-gnu/include/linux/atalk.h
--- linux-libre-4.9.206-gnu/include/linux/atalk.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/atalk.h	2019-12-21 04:42:35.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.9.206-gnu/include/linux/dma-mapping.h linux-libre-4.9.207-gnu/include/linux/dma-mapping.h
--- linux-libre-4.9.206-gnu/include/linux/dma-mapping.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/dma-mapping.h	2019-12-21 04:42:35.000000000 -0500
@@ -618,8 +618,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.9.206-gnu/include/linux/jbd2.h linux-libre-4.9.207-gnu/include/linux/jbd2.h
--- linux-libre-4.9.206-gnu/include/linux/jbd2.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/jbd2.h	2019-12-21 04:42:35.000000000 -0500
@@ -1560,7 +1560,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->
@@ -1569,7 +1569,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.9.206-gnu/include/linux/mtd/mtd.h linux-libre-4.9.207-gnu/include/linux/mtd/mtd.h
--- linux-libre-4.9.206-gnu/include/linux/mtd/mtd.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/mtd/mtd.h	2019-12-21 04:42:35.000000000 -0500
@@ -392,7 +392,7 @@ static inline struct device_node *mtd_ge
 	return mtd->dev.of_node;
 }
 
-static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
+static inline u32 mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
 {
 	return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize;
 }
diff -druNp --no-dereference linux-libre-4.9.206-gnu/include/linux/netdevice.h linux-libre-4.9.207-gnu/include/linux/netdevice.h
--- linux-libre-4.9.206-gnu/include/linux/netdevice.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/netdevice.h	2019-12-21 04:42:35.000000000 -0500
@@ -1730,6 +1730,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.9.206-gnu/include/linux/quotaops.h linux-libre-4.9.207-gnu/include/linux/quotaops.h
--- linux-libre-4.9.206-gnu/include/linux/quotaops.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/quotaops.h	2019-12-21 04:42:35.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.9.206-gnu/include/linux/regulator/consumer.h linux-libre-4.9.207-gnu/include/linux/regulator/consumer.h
--- linux-libre-4.9.206-gnu/include/linux/regulator/consumer.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/regulator/consumer.h	2019-12-21 04:42:35.000000000 -0500
@@ -479,7 +479,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.9.206-gnu/include/linux/serial_core.h linux-libre-4.9.207-gnu/include/linux/serial_core.h
--- linux-libre-4.9.206-gnu/include/linux/serial_core.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/serial_core.h	2019-12-21 04:42:35.000000000 -0500
@@ -161,6 +161,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 */
@@ -470,8 +471,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.9.206-gnu/include/linux/time.h linux-libre-4.9.207-gnu/include/linux/time.h
--- linux-libre-4.9.206-gnu/include/linux/time.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/time.h	2019-12-21 04:42:35.000000000 -0500
@@ -275,4 +275,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.9.206-gnu/include/linux/tty.h linux-libre-4.9.207-gnu/include/linux/tty.h
--- linux-libre-4.9.206-gnu/include/linux/tty.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/linux/tty.h	2019-12-21 04:42:35.000000000 -0500
@@ -356,6 +356,7 @@ struct tty_file_private {
 #define TTY_NO_WRITE_SPLIT 	17	/* Preserve write boundaries to driver */
 #define TTY_HUPPED 		18	/* Post driver->hangup() */
 #define TTY_HUPPING		19	/* Hangup in progress */
+#define TTY_LDISC_CHANGING	20	/* Change pending - non-block IO */
 #define TTY_LDISC_HALTED	22	/* Line discipline is halted */
 
 /* Values for tty->flow_change */
@@ -373,6 +374,12 @@ static inline void tty_set_flow_change(s
 	smp_mb();
 }
 
+static inline bool tty_io_nonblock(struct tty_struct *tty, struct file *file)
+{
+	return file->f_flags & O_NONBLOCK ||
+		test_bit(TTY_LDISC_CHANGING, &tty->flags);
+}
+
 static inline bool tty_io_error(struct tty_struct *tty)
 {
 	return test_bit(TTY_IO_ERROR, &tty->flags);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/include/math-emu/soft-fp.h linux-libre-4.9.207-gnu/include/math-emu/soft-fp.h
--- linux-libre-4.9.206-gnu/include/math-emu/soft-fp.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/math-emu/soft-fp.h	2019-12-21 04:42:35.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.9.206-gnu/include/net/ip.h linux-libre-4.9.207-gnu/include/net/ip.h
--- linux-libre-4.9.206-gnu/include/net/ip.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/net/ip.h	2019-12-21 04:42:35.000000000 -0500
@@ -620,4 +620,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.9.206-gnu/include/net/tcp.h linux-libre-4.9.207-gnu/include/net/tcp.h
--- linux-libre-4.9.206-gnu/include/net/tcp.h	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/include/net/tcp.h	2019-12-21 04:42:35.000000000 -0500
@@ -494,19 +494,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.9.206-gnu/kernel/audit_watch.c linux-libre-4.9.207-gnu/kernel/audit_watch.c
--- linux-libre-4.9.206-gnu/kernel/audit_watch.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/kernel/audit_watch.c	2019-12-21 04:42:35.000000000 -0500
@@ -365,12 +365,12 @@ static int audit_get_nd(struct audit_wat
 	struct dentry *d = kern_path_locked(watch->path, parent);
 	if (IS_ERR(d))
 		return PTR_ERR(d);
-	inode_unlock(d_backing_inode(parent->dentry));
 	if (d_is_positive(d)) {
 		/* update watch filter fields */
 		watch->dev = d->d_sb->s_dev;
 		watch->ino = d_backing_inode(d)->i_ino;
 	}
+	inode_unlock(d_backing_inode(parent->dentry));
 	dput(d);
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.206-gnu/kernel/cgroup_pids.c linux-libre-4.9.207-gnu/kernel/cgroup_pids.c
--- linux-libre-4.9.206-gnu/kernel/cgroup_pids.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/kernel/cgroup_pids.c	2019-12-21 04:42:35.000000000 -0500
@@ -48,7 +48,7 @@ struct pids_cgroup {
 	 * %PIDS_MAX = (%PID_MAX_LIMIT + 1).
 	 */
 	atomic64_t			counter;
-	int64_t				limit;
+	atomic64_t			limit;
 
 	/* Handle for "pids.events" */
 	struct cgroup_file		events_file;
@@ -76,8 +76,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);
 	atomic64_set(&pids->events_limit, 0);
 	return &pids->css;
 }
@@ -149,13 +149,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;
 	}
 
@@ -280,7 +281,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;
 }
 
@@ -288,7 +289,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.9.206-gnu/kernel/module.c linux-libre-4.9.207-gnu/kernel/module.c
--- linux-libre-4.9.206-gnu/kernel/module.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/kernel/module.c	2019-12-21 04:42:35.000000000 -0500
@@ -995,6 +995,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.9.206-gnu/kernel/sched/fair.c linux-libre-4.9.207-gnu/kernel/sched/fair.c
--- linux-libre-4.9.206-gnu/kernel/sched/fair.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/kernel/sched/fair.c	2019-12-21 04:42:35.000000000 -0500
@@ -4391,20 +4391,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.9.206-gnu/kernel/workqueue.c linux-libre-4.9.207-gnu/kernel/workqueue.c
--- linux-libre-4.9.206-gnu/kernel/workqueue.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/kernel/workqueue.c	2019-12-21 04:42:35.000000000 -0500
@@ -2344,8 +2344,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);
 			}
 		}
@@ -4031,9 +4037,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) {
@@ -4063,11 +4089,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
@@ -4344,7 +4365,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.9.206-gnu/lib/raid6/unroll.awk linux-libre-4.9.207-gnu/lib/raid6/unroll.awk
--- linux-libre-4.9.206-gnu/lib/raid6/unroll.awk	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/lib/raid6/unroll.awk	2019-12-21 04:42:35.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.9.206-gnu/Makefile linux-libre-4.9.207-gnu/Makefile
--- linux-libre-4.9.206-gnu/Makefile	2019-12-05 10:52:50.000000000 -0500
+++ linux-libre-4.9.207-gnu/Makefile	2019-12-22 01:00:47.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 206
+SUBLEVEL = 207
 EXTRAVERSION = -gnu
 NAME = Roaring Lionus
 
@@ -1521,9 +1521,6 @@ else # KBUILD_EXTMOD
 
 # We are always building modules
 KBUILD_MODULES := 1
-PHONY += crmodverdir
-crmodverdir:
-	$(cmd_crmodverdir)
 
 PHONY += $(objtree)/Module.symvers
 $(objtree)/Module.symvers:
@@ -1535,7 +1532,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)
@@ -1576,7 +1573,8 @@ help:
 
 # Dummies...
 PHONY += prepare scripts
-prepare: ;
+prepare:
+	$(cmd_crmodverdir)
 scripts: ;
 endif # KBUILD_EXTMOD
 
@@ -1701,17 +1699,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/ samples/: 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.9.206-gnu/mm/shmem.c linux-libre-4.9.207-gnu/mm/shmem.c
--- linux-libre-4.9.206-gnu/mm/shmem.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/mm/shmem.c	2019-12-21 04:42:35.000000000 -0500
@@ -2695,7 +2695,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.9.206-gnu/net/appletalk/aarp.c linux-libre-4.9.207-gnu/net/appletalk/aarp.c
--- linux-libre-4.9.206-gnu/net/appletalk/aarp.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/appletalk/aarp.c	2019-12-21 04:42:35.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.9.206-gnu/net/appletalk/ddp.c linux-libre-4.9.207-gnu/net/appletalk/ddp.c
--- linux-libre-4.9.206-gnu/net/appletalk/ddp.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/appletalk/ddp.c	2019-12-21 04:42:35.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.9.206-gnu/net/bridge/br_device.c linux-libre-4.9.207-gnu/net/bridge/br_device.c
--- linux-libre-4.9.206-gnu/net/bridge/br_device.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/bridge/br_device.c	2019-12-21 04:42:35.000000000 -0500
@@ -210,6 +210,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.9.206-gnu/net/core/dev.c linux-libre-4.9.207-gnu/net/core/dev.c
--- linux-libre-4.9.206-gnu/net/core/dev.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/core/dev.c	2019-12-21 04:42:35.000000000 -0500
@@ -6584,7 +6584,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.9.206-gnu/net/ipv4/devinet.c linux-libre-4.9.207-gnu/net/ipv4/devinet.c
--- linux-libre-4.9.206-gnu/net/ipv4/devinet.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/ipv4/devinet.c	2019-12-21 04:42:35.000000000 -0500
@@ -1386,11 +1386,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.9.206-gnu/net/ipv4/ip_output.c linux-libre-4.9.207-gnu/net/ipv4/ip_output.c
--- linux-libre-4.9.206-gnu/net/ipv4/ip_output.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/ipv4/ip_output.c	2019-12-21 04:42:35.000000000 -0500
@@ -1159,13 +1159,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.9.206-gnu/net/ipv4/tcp_output.c linux-libre-4.9.207-gnu/net/ipv4/tcp_output.c
--- linux-libre-4.9.206-gnu/net/ipv4/tcp_output.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/ipv4/tcp_output.c	2019-12-21 04:42:35.000000000 -0500
@@ -707,8 +707,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.9.206-gnu/net/ipv4/tcp_timer.c linux-libre-4.9.207-gnu/net/ipv4/tcp_timer.c
--- linux-libre-4.9.206-gnu/net/ipv4/tcp_timer.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/ipv4/tcp_timer.c	2019-12-21 04:42:35.000000000 -0500
@@ -372,7 +372,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. */
@@ -478,11 +478,12 @@ void tcp_retransmit_timer(struct sock *s
 		goto out_reset_timer;
 	}
 
+	__NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEOUTS);
 	if (tcp_write_timeout(sk))
 		goto out;
 
 	if (icsk->icsk_retransmits == 0) {
-		int mib_idx;
+		int mib_idx = 0;
 
 		if (icsk->icsk_ca_state == TCP_CA_Recovery) {
 			if (tcp_is_sack(tp))
@@ -497,10 +498,9 @@ void tcp_retransmit_timer(struct sock *s
 				mib_idx = LINUX_MIB_TCPSACKFAILURES;
 			else
 				mib_idx = LINUX_MIB_TCPRENOFAILURES;
-		} else {
-			mib_idx = LINUX_MIB_TCPTIMEOUTS;
 		}
-		__NET_INC_STATS(sock_net(sk), mib_idx);
+		if (mib_idx)
+			__NET_INC_STATS(sock_net(sk), mib_idx);
 	}
 
 	tcp_enter_loss(sk);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/net/openvswitch/conntrack.c linux-libre-4.9.207-gnu/net/openvswitch/conntrack.c
--- linux-libre-4.9.206-gnu/net/openvswitch/conntrack.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/openvswitch/conntrack.c	2019-12-21 04:42:35.000000000 -0500
@@ -709,6 +709,17 @@ static int ovs_ct_nat(struct net *net, s
 	}
 	err = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range, maniptype);
 
+	if (err == NF_ACCEPT &&
+	    ct->status & IPS_SRC_NAT && ct->status & IPS_DST_NAT) {
+		if (maniptype == NF_NAT_MANIP_SRC)
+			maniptype = NF_NAT_MANIP_DST;
+		else
+			maniptype = NF_NAT_MANIP_SRC;
+
+		err = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range,
+					 maniptype);
+	}
+
 	/* Mark NAT done if successful and update the flow key. */
 	if (err == NF_ACCEPT)
 		ovs_nat_update_key(key, skb, maniptype);
diff -druNp --no-dereference linux-libre-4.9.206-gnu/net/sunrpc/cache.c linux-libre-4.9.207-gnu/net/sunrpc/cache.c
--- linux-libre-4.9.206-gnu/net/sunrpc/cache.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/sunrpc/cache.c	2019-12-21 04:42:35.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.9.206-gnu/net/tipc/core.c linux-libre-4.9.207-gnu/net/tipc/core.c
--- linux-libre-4.9.206-gnu/net/tipc/core.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/tipc/core.c	2019-12-21 04:42:35.000000000 -0500
@@ -116,14 +116,6 @@ static int __init tipc_init(void)
 	sysctl_tipc_rmem[1] = RCVBUF_DEF;
 	sysctl_tipc_rmem[2] = RCVBUF_MAX;
 
-	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;
@@ -144,8 +136,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:
@@ -155,22 +160,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.9.206-gnu/net/x25/af_x25.c linux-libre-4.9.207-gnu/net/x25/af_x25.c
--- linux-libre-4.9.206-gnu/net/x25/af_x25.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/net/x25/af_x25.c	2019-12-21 04:42:35.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.9.206-gnu/scripts/mod/modpost.c linux-libre-4.9.207-gnu/scripts/mod/modpost.c
--- linux-libre-4.9.206-gnu/scripts/mod/modpost.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/scripts/mod/modpost.c	2019-12-21 04:42:35.000000000 -0500
@@ -1157,6 +1157,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,
@@ -1195,6 +1203,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.9.206-gnu/sound/core/oss/linear.c linux-libre-4.9.207-gnu/sound/core/oss/linear.c
--- linux-libre-4.9.206-gnu/sound/core/oss/linear.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/core/oss/linear.c	2019-12-21 04:42:35.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.9.206-gnu/sound/core/oss/mulaw.c linux-libre-4.9.207-gnu/sound/core/oss/mulaw.c
--- linux-libre-4.9.206-gnu/sound/core/oss/mulaw.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/core/oss/mulaw.c	2019-12-21 04:42:35.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.9.206-gnu/sound/core/oss/route.c linux-libre-4.9.207-gnu/sound/core/oss/route.c
--- linux-libre-4.9.206-gnu/sound/core/oss/route.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/core/oss/route.c	2019-12-21 04:42:35.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.9.206-gnu/sound/core/pcm_lib.c linux-libre-4.9.207-gnu/sound/core/pcm_lib.c
--- linux-libre-4.9.206-gnu/sound/core/pcm_lib.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/core/pcm_lib.c	2019-12-21 04:42:35.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.9.206-gnu/sound/pci/hda/hda_bind.c linux-libre-4.9.207-gnu/sound/pci/hda/hda_bind.c
--- linux-libre-4.9.206-gnu/sound/pci/hda/hda_bind.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/pci/hda/hda_bind.c	2019-12-21 04:42:35.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.9.206-gnu/sound/pci/hda/hda_intel.c linux-libre-4.9.207-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.9.206-gnu/sound/pci/hda/hda_intel.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/pci/hda/hda_intel.c	2019-12-21 04:42:35.000000000 -0500
@@ -1275,8 +1275,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.9.206-gnu/sound/soc/soc-jack.c linux-libre-4.9.207-gnu/sound/soc/soc-jack.c
--- linux-libre-4.9.206-gnu/sound/soc/soc-jack.c	2019-12-05 09:35:34.000000000 -0500
+++ linux-libre-4.9.207-gnu/sound/soc/soc-jack.c	2019-12-21 04:42:35.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;
 
