diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pb1176.dts	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pb11mp.dts	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/arm-realview-pbx.dtsi	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/exynos3250.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/exynos3250.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/exynos3250.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -359,7 +359,7 @@
 		};
 
 		hsotg: hsotg@12480000 {
-			compatible = "snps,dwc2";
+			compatible = "samsung,s3c6400-hsotg", "snps,dwc2";
 			reg = <0x12480000 0x20000>;
 			interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&cmu CLK_USBOTG>;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/boot/dts/mmp2.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/mmp2.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/mmp2.dtsi	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/omap3-pandora-common.dtsi	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/omap3-tao3530.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -224,7 +224,7 @@
 	pinctrl-0 = <&mmc1_pins>;
 	vmmc-supply = <&vmmc1>;
 	vqmmc-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.14.158-gnu/arch/arm/boot/dts/pxa27x.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa27x.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa27x.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -35,7 +35,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.14.158-gnu/arch/arm/boot/dts/pxa2xx.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa2xx.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa2xx.dtsi	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/pxa3xx.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa3xx.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/pxa3xx.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -189,7 +189,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.14.158-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/rk3288-rock2-som.dtsi	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/boot/dts/rv1108.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/rv1108.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/rv1108.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/rv1108.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -101,7 +101,7 @@
 
 	arm-pmu {
 		compatible = "arm,cortex-a7-pmu";
-		interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
+		interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
 	};
 
 	timer {
@@ -522,7 +522,7 @@
 			compatible = "rockchip,gpio-bank";
 			reg = <0x20030000 0x100>;
 			interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&xin24m>;
+			clocks = <&cru PCLK_GPIO0_PMU>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
@@ -535,7 +535,7 @@
 			compatible = "rockchip,gpio-bank";
 			reg = <0x10310000 0x100>;
 			interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&xin24m>;
+			clocks = <&cru PCLK_GPIO1>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
@@ -548,7 +548,7 @@
 			compatible = "rockchip,gpio-bank";
 			reg = <0x10320000 0x100>;
 			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&xin24m>;
+			clocks = <&cru PCLK_GPIO2>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
@@ -561,7 +561,7 @@
 			compatible = "rockchip,gpio-bank";
 			reg = <0x10330000 0x100>;
 			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&xin24m>;
+			clocks = <&cru PCLK_GPIO3>;
 
 			gpio-controller;
 			#gpio-cells = <2>;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun5i-a10s.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun5i-a10s.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun5i-a10s.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun5i-a10s.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -104,8 +104,6 @@
 				};
 
 				hdmi_out: port@1 {
-					#address-cells = <1>;
-					#size-cells = <0>;
 					reg = <1>;
 				};
 			};
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun6i-a31.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun6i-a31.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun6i-a31.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -173,7 +173,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.14.158-gnu/arch/arm/boot/dts/sun7i-a20.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun7i-a20.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun7i-a20.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -171,7 +171,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.14.158-gnu/arch/arm/boot/dts/sun8i-v3s.dtsi linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun8i-v3s.dtsi
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun8i-v3s.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun8i-v3s.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -292,17 +292,17 @@
 			interrupt-controller;
 			#interrupt-cells = <3>;
 
-			i2c0_pins: i2c0 {
+			i2c0_pins: i2c0-pins {
 				pins = "PB6", "PB7";
 				function = "i2c0";
 			};
 
-			uart0_pins_a: uart0@0 {
+			uart0_pb_pins: uart0-pb-pins {
 				pins = "PB8", "PB9";
 				function = "uart0";
 			};
 
-			mmc0_pins_a: mmc0@0 {
+			mmc0_pins: mmc0-pins {
 				pins = "PF0", "PF1", "PF2", "PF3",
 				       "PF4", "PF5";
 				function = "mmc0";
@@ -310,7 +310,7 @@
 				bias-pull-up;
 			};
 
-			mmc1_pins: mmc1 {
+			mmc1_pins: mmc1-pins {
 				pins = "PG0", "PG1", "PG2", "PG3",
 				       "PG4", "PG5";
 				function = "mmc1";
@@ -318,7 +318,7 @@
 				bias-pull-up;
 			};
 
-			spi0_pins: spi0 {
+			spi0_pins: spi0-pins {
 				pins = "PC0", "PC1", "PC2", "PC3";
 				function = "spi0";
 			};
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
--- linux-libre-4.14.158-gnu/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts	2019-12-17 14:40:05.000000000 -0500
@@ -78,7 +78,7 @@
 };
 
 &mmc0 {
-	pinctrl-0 = <&mmc0_pins_a>;
+	pinctrl-0 = <&mmc0_pins>;
 	pinctrl-names = "default";
 	broken-cd;
 	bus-width = <4>;
@@ -87,7 +87,7 @@
 };
 
 &uart0 {
-	pinctrl-0 = <&uart0_pins_a>;
+	pinctrl-0 = <&uart0_pb_pins>;
 	pinctrl-names = "default";
 	status = "okay";
 };
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm/include/asm/uaccess.h linux-libre-4.14.159-gnu/arch/arm/include/asm/uaccess.h
--- linux-libre-4.14.158-gnu/arch/arm/include/asm/uaccess.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/include/asm/uaccess.h	2019-12-17 14:40:05.000000000 -0500
@@ -349,6 +349,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)			\
 ({								\
@@ -367,6 +374,8 @@ do {									\
 })
 #endif
 
+#endif /* __LINUX_ARM_ARCH__ >= 6 */
+
 #define __get_user_asm_word(x, addr, err)			\
 	__get_user_asm(x, addr, err, ldr)
 #endif
@@ -442,6 +451,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)			\
 ({								\
@@ -458,6 +474,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.14.158-gnu/arch/arm/Kconfig.debug linux-libre-4.14.159-gnu/arch/arm/Kconfig.debug
--- linux-libre-4.14.158-gnu/arch/arm/Kconfig.debug	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/Kconfig.debug	2019-12-17 14:40:05.000000000 -0500
@@ -1023,14 +1023,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"
@@ -1585,7 +1592,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
@@ -1689,7 +1697,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
@@ -1737,9 +1746,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.14.158-gnu/arch/arm/lib/getuser.S linux-libre-4.14.159-gnu/arch/arm/lib/getuser.S
--- linux-libre-4.14.158-gnu/arch/arm/lib/getuser.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/lib/getuser.S	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/lib/putuser.S linux-libre-4.14.159-gnu/arch/arm/lib/putuser.S
--- linux-libre-4.14.158-gnu/arch/arm/lib/putuser.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/lib/putuser.S	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/mach-omap1/id.c linux-libre-4.14.159-gnu/arch/arm/mach-omap1/id.c
--- linux-libre-4.14.158-gnu/arch/arm/mach-omap1/id.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/mach-omap1/id.c	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/mach-omap2/id.c linux-libre-4.14.159-gnu/arch/arm/mach-omap2/id.c
--- linux-libre-4.14.158-gnu/arch/arm/mach-omap2/id.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/mach-omap2/id.c	2019-12-17 14:40:05.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.14.158-gnu/arch/arm/mach-omap2/pdata-quirks.c linux-libre-4.14.159-gnu/arch/arm/mach-omap2/pdata-quirks.c
--- linux-libre-4.14.158-gnu/arch/arm/mach-omap2/pdata-quirks.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm/mach-omap2/pdata-quirks.c	2019-12-17 14:40:05.000000000 -0500
@@ -307,108 +307,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.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
--- linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts	2019-12-17 14:40:05.000000000 -0500
@@ -178,7 +178,7 @@
 	pinctrl-names = "default";
 };
 
-&pinctrl_aobus {
+&gpio_ao {
 	gpio-line-names = "UART TX", "UART RX", "Power Control", "Power Key In",
 			  "VCCK En", "CON1 Header Pin31",
 			  "I2S Header Pin6", "IR In", "I2S Header Pin7",
@@ -186,7 +186,7 @@
 			  "I2S Header Pin5", "HDMI CEC", "SYS LED";
 };
 
-&pinctrl_periphs {
+&gpio {
 	gpio-line-names = /* Bank GPIOZ */
 			  "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk",
 			  "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
--- linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts	2019-12-17 14:40:05.000000000 -0500
@@ -189,7 +189,7 @@
 	pinctrl-names = "default";
 };
 
-&pinctrl_aobus {
+&gpio_ao {
 	gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En",
 			  "USB HUB nRESET", "USB OTG Power En",
 			  "J7 Header Pin2", "IR In", "J7 Header Pin4",
@@ -197,7 +197,7 @@
 			  "HDMI CEC", "SYS LED";
 };
 
-&pinctrl_periphs {
+&gpio {
 	gpio-line-names = /* Bank GPIOZ */
 			  "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk",
 			  "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
--- linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts	2019-12-17 14:40:05.000000000 -0500
@@ -112,7 +112,7 @@
 	linux,rc-map-name = "rc-geekbox";
 };
 
-&pinctrl_aobus {
+&gpio_ao {
 	gpio-line-names = "UART TX",
 			  "UART RX",
 			  "Power Key In",
@@ -125,7 +125,7 @@
 			  "SYS LED";
 };
 
-&pinctrl_periphs {
+&gpio {
 	gpio-line-names = /* Bank GPIOZ */
 			  "", "", "", "", "", "", "",
 			  "", "", "", "", "", "", "",
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
--- linux-libre-4.14.158-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts	2019-12-17 14:40:05.000000000 -0500
@@ -139,7 +139,7 @@
 	};
 };
 
-&pinctrl_aobus {
+&gpio_ao {
 	gpio-line-names = "UART TX",
 			  "UART RX",
 			  "Blue LED",
@@ -152,7 +152,7 @@
 			  "7J1 Header Pin13";
 };
 
-&pinctrl_periphs {
+&gpio {
 	gpio-line-names = /* Bank GPIOZ */
 			  "", "", "", "", "", "", "",
 			  "", "", "", "", "", "", "",
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi linux-libre-4.14.159-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
--- linux-libre-4.14.158-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi	2019-12-17 14:40:05.000000000 -0500
@@ -1584,7 +1584,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.14.158-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c linux-libre-4.14.159-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c
--- linux-libre-4.14.158-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c	2019-12-17 14:40:05.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.14.158-gnu/arch/mips/cavium-octeon/octeon-platform.c linux-libre-4.14.159-gnu/arch/mips/cavium-octeon/octeon-platform.c
--- linux-libre-4.14.158-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/mips/cavium-octeon/octeon-platform.c	2019-12-17 14:40:05.000000000 -0500
@@ -501,7 +501,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.14.158-gnu/arch/mips/include/asm/octeon/cvmx-pko.h linux-libre-4.14.159-gnu/arch/mips/include/asm/octeon/cvmx-pko.h
--- linux-libre-4.14.158-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/mips/include/asm/octeon/cvmx-pko.h	2019-12-17 14:40:05.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.14.158-gnu/arch/mips/Kconfig linux-libre-4.14.159-gnu/arch/mips/Kconfig
--- linux-libre-4.14.158-gnu/arch/mips/Kconfig	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/mips/Kconfig	2019-12-17 14:40:05.000000000 -0500
@@ -812,6 +812,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.14.158-gnu/arch/powerpc/include/asm/sfp-machine.h linux-libre-4.14.159-gnu/arch/powerpc/include/asm/sfp-machine.h
--- linux-libre-4.14.158-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/include/asm/sfp-machine.h	2019-12-17 14:40:05.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.14.158-gnu/arch/powerpc/include/asm/vdso_datapage.h linux-libre-4.14.159-gnu/arch/powerpc/include/asm/vdso_datapage.h
--- linux-libre-4.14.158-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/include/asm/vdso_datapage.h	2019-12-17 14:40:05.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.14.158-gnu/arch/powerpc/kernel/asm-offsets.c linux-libre-4.14.159-gnu/arch/powerpc/kernel/asm-offsets.c
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/asm-offsets.c	2019-12-17 14:40:05.000000000 -0500
@@ -373,6 +373,7 @@ int main(void)
 	OFFSET(WTOM_CLOCK_NSEC, vdso_data, wtom_clock_nsec);
 	OFFSET(STAMP_XTIME, vdso_data, stamp_xtime);
 	OFFSET(STAMP_SEC_FRAC, vdso_data, stamp_sec_fraction);
+	OFFSET(CLOCK_HRTIMER_RES, vdso_data, hrtimer_res);
 	OFFSET(CFG_ICACHE_BLOCKSZ, vdso_data, icache_block_size);
 	OFFSET(CFG_DCACHE_BLOCKSZ, vdso_data, dcache_block_size);
 	OFFSET(CFG_ICACHE_LOGBLOCKSZ, vdso_data, icache_log_block_size);
@@ -401,7 +402,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.14.158-gnu/arch/powerpc/kernel/Makefile linux-libre-4.14.159-gnu/arch/powerpc/kernel/Makefile
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/Makefile	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/Makefile	2019-12-17 14:40:05.000000000 -0500
@@ -5,8 +5,8 @@
 
 CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
 
-# Disable clang warning for using setjmp without setjmp.h header
-CFLAGS_crash.o		+= $(call cc-disable-warning, builtin-requires-header)
+# Avoid clang warnings around longjmp/setjmp declarations
+CFLAGS_crash.o += -ffreestanding
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/powerpc/kernel/misc_64.S linux-libre-4.14.159-gnu/arch/powerpc/kernel/misc_64.S
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/misc_64.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/misc_64.S	2019-12-17 14:40:05.000000000 -0500
@@ -86,7 +86,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_I
 	subf	r8,r6,r4		/* compute length */
 	add	r8,r8,r5		/* ensure we get enough */
 	lwz	r9,DCACHEL1LOGBLOCKSIZE(r10)	/* Get log-2 of cache block size */
-	srw.	r8,r8,r9		/* compute line count */
+	srd.	r8,r8,r9		/* compute line count */
 	beqlr				/* nothing to do? */
 	mtctr	r8
 1:	dcbst	0,r6
@@ -102,7 +102,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_I
 	subf	r8,r6,r4		/* compute length */
 	add	r8,r8,r5
 	lwz	r9,ICACHEL1LOGBLOCKSIZE(r10)	/* Get log-2 of Icache block size */
-	srw.	r8,r8,r9		/* compute line count */
+	srd.	r8,r8,r9		/* compute line count */
 	beqlr				/* nothing to do? */
 	mtctr	r8
 2:	icbi	0,r6
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/powerpc/kernel/time.c linux-libre-4.14.159-gnu/arch/powerpc/kernel/time.c
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/time.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/time.c	2019-12-17 14:40:05.000000000 -0500
@@ -920,6 +920,7 @@ void update_vsyscall(struct timekeeper *
 	vdso_data->wtom_clock_nsec = tk->wall_to_monotonic.tv_nsec;
 	vdso_data->stamp_xtime = xt;
 	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.14.158-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso32/gettimeofday.S	2019-12-17 14:40:05.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.14.158-gnu/arch/powerpc/kernel/vdso64/cacheflush.S linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso64/cacheflush.S
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso64/cacheflush.S	2019-12-17 14:40:05.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.14.158-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S
--- linux-libre-4.14.158-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/kernel/vdso64/gettimeofday.S	2019-12-17 14:40:05.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.14.158-gnu/arch/powerpc/sysdev/xive/common.c linux-libre-4.14.159-gnu/arch/powerpc/sysdev/xive/common.c
--- linux-libre-4.14.158-gnu/arch/powerpc/sysdev/xive/common.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/sysdev/xive/common.c	2019-12-17 14:40:05.000000000 -0500
@@ -967,6 +967,15 @@ static int xive_irq_alloc_data(unsigned
 	xd->target = XIVE_INVALID_TARGET;
 	irq_set_handler_data(virq, xd);
 
+	/*
+	 * Turn OFF by default the interrupt being mapped. A side
+	 * effect of this check is the mapping the ESB page of the
+	 * interrupt in the Linux address space. This prevents page
+	 * fault issues in the crash handler which masks all
+	 * interrupts.
+	 */
+	xive_esb_read(xd, XIVE_ESB_SET_PQ_01);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/powerpc/sysdev/xive/spapr.c linux-libre-4.14.159-gnu/arch/powerpc/sysdev/xive/spapr.c
--- linux-libre-4.14.158-gnu/arch/powerpc/sysdev/xive/spapr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/sysdev/xive/spapr.c	2019-12-17 14:40:05.000000000 -0500
@@ -293,20 +293,28 @@ static int xive_spapr_populate_irq_data(
 	data->esb_shift = esb_shift;
 	data->trig_page = trig_page;
 
+	data->hw_irq = hw_irq;
+
 	/*
 	 * No chip-id for the sPAPR backend. This has an impact how we
 	 * pick a target. See xive_pick_irq_target().
 	 */
 	data->src_chip = XIVE_INVALID_CHIP_ID;
 
+	/*
+	 * When the H_INT_ESB flag is set, the H_INT_ESB hcall should
+	 * be used for interrupt management. Skip the remapping of the
+	 * ESB pages which are not available.
+	 */
+	if (data->flags & XIVE_IRQ_FLAG_H_INT_ESB)
+		return 0;
+
 	data->eoi_mmio = ioremap(data->eoi_page, 1u << data->esb_shift);
 	if (!data->eoi_mmio) {
 		pr_err("Failed to map EOI page for irq 0x%x\n", hw_irq);
 		return -ENOMEM;
 	}
 
-	data->hw_irq = hw_irq;
-
 	/* Full function page supports trigger */
 	if (flags & XIVE_SRC_TRIGGER) {
 		data->trig_mmio = data->eoi_mmio;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/powerpc/xmon/Makefile linux-libre-4.14.159-gnu/arch/powerpc/xmon/Makefile
--- linux-libre-4.14.158-gnu/arch/powerpc/xmon/Makefile	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/powerpc/xmon/Makefile	2019-12-17 14:40:05.000000000 -0500
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for xmon
 
-# Disable clang warning for using setjmp without setjmp.h header
-subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header)
+# Avoid clang warnings around longjmp/setjmp declarations
+subdir-ccflags-y := -ffreestanding
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/s390/include/asm/pgtable.h linux-libre-4.14.159-gnu/arch/s390/include/asm/pgtable.h
--- linux-libre-4.14.158-gnu/arch/s390/include/asm/pgtable.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/s390/include/asm/pgtable.h	2019-12-17 14:40:05.000000000 -0500
@@ -1126,8 +1126,6 @@ int pgste_perform_essa(struct mm_struct
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
 			      pte_t *ptep, pte_t entry)
 {
-	if (!MACHINE_HAS_NX)
-		pte_val(entry) &= ~_PAGE_NOEXEC;
 	if (pte_present(entry))
 		pte_val(entry) &= ~_PAGE_UNUSED;
 	if (mm_has_pgste(mm))
@@ -1144,6 +1142,8 @@ static inline pte_t mk_pte_phys(unsigned
 {
 	pte_t __pte;
 	pte_val(__pte) = physpage + pgprot_val(pgprot);
+	if (!MACHINE_HAS_NX)
+		pte_val(__pte) &= ~_PAGE_NOEXEC;
 	return pte_mkyoung(__pte);
 }
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/sparc/net/bpf_jit_comp_64.c linux-libre-4.14.159-gnu/arch/sparc/net/bpf_jit_comp_64.c
--- linux-libre-4.14.158-gnu/arch/sparc/net/bpf_jit_comp_64.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/sparc/net/bpf_jit_comp_64.c	2019-12-17 14:40:05.000000000 -0500
@@ -1326,6 +1326,9 @@ static int build_insn(const struct bpf_i
 		const u8 tmp2 = bpf2sparc[TMP_REG_2];
 		u32 opcode = 0, rs2;
 
+		if (insn->dst_reg == BPF_REG_FP)
+			ctx->saw_frame_pointer = true;
+
 		ctx->tmp_2_used = true;
 		emit_loadimm(imm, tmp2, ctx);
 
@@ -1364,6 +1367,9 @@ static int build_insn(const struct bpf_i
 		const u8 tmp = bpf2sparc[TMP_REG_1];
 		u32 opcode = 0, rs2;
 
+		if (insn->dst_reg == BPF_REG_FP)
+			ctx->saw_frame_pointer = true;
+
 		switch (BPF_SIZE(code)) {
 		case BPF_W:
 			opcode = ST32;
@@ -1396,6 +1402,9 @@ static int build_insn(const struct bpf_i
 		const u8 tmp2 = bpf2sparc[TMP_REG_2];
 		const u8 tmp3 = bpf2sparc[TMP_REG_3];
 
+		if (insn->dst_reg == BPF_REG_FP)
+			ctx->saw_frame_pointer = true;
+
 		ctx->tmp_1_used = true;
 		ctx->tmp_2_used = true;
 		ctx->tmp_3_used = true;
@@ -1416,6 +1425,9 @@ static int build_insn(const struct bpf_i
 		const u8 tmp2 = bpf2sparc[TMP_REG_2];
 		const u8 tmp3 = bpf2sparc[TMP_REG_3];
 
+		if (insn->dst_reg == BPF_REG_FP)
+			ctx->saw_frame_pointer = true;
+
 		ctx->tmp_1_used = true;
 		ctx->tmp_2_used = true;
 		ctx->tmp_3_used = true;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c linux-libre-4.14.159-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c
--- linux-libre-4.14.158-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/x86/kernel/cpu/mcheck/mce_amd.c	2019-12-17 14:40:05.000000000 -0500
@@ -544,6 +544,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)
 {
@@ -551,6 +585,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)
 			smca_configure(bank, cpu);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/arch/x86/kernel/cpu/mcheck/mce.c linux-libre-4.14.159-gnu/arch/x86/kernel/cpu/mcheck/mce.c
--- linux-libre-4.14.158-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/x86/kernel/cpu/mcheck/mce.c	2019-12-17 14:40:05.000000000 -0500
@@ -1660,36 +1660,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.14.158-gnu/arch/x86/kvm/cpuid.c linux-libre-4.14.159-gnu/arch/x86/kvm/cpuid.c
--- linux-libre-4.14.158-gnu/arch/x86/kvm/cpuid.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/x86/kvm/cpuid.c	2019-12-17 14:40:05.000000000 -0500
@@ -404,7 +404,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);
@@ -707,6 +707,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.14.158-gnu/arch/x86/kvm/x86.c linux-libre-4.14.159-gnu/arch/x86/kvm/x86.c
--- linux-libre-4.14.158-gnu/arch/x86/kvm/x86.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/x86/kvm/x86.c	2019-12-17 14:40:05.000000000 -0500
@@ -276,13 +276,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);
@@ -1112,10 +1113,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.14.158-gnu/arch/x86/pci/fixup.c linux-libre-4.14.159-gnu/arch/x86/pci/fixup.c
--- linux-libre-4.14.158-gnu/arch/x86/pci/fixup.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/arch/x86/pci/fixup.c	2019-12-17 14:40:05.000000000 -0500
@@ -589,6 +589,17 @@ static void pci_fixup_amd_ehci_pme(struc
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7808, pci_fixup_amd_ehci_pme);
 
 /*
+ * 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.14.158-gnu/block/blk-merge.c linux-libre-4.14.159-gnu/block/blk-merge.c
--- linux-libre-4.14.158-gnu/block/blk-merge.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/block/blk-merge.c	2019-12-17 14:40:05.000000000 -0500
@@ -765,7 +765,7 @@ static struct request *attempt_merge(str
 
 	req->__data_len += blk_rq_bytes(next);
 
-	if (req_op(req) != REQ_OP_DISCARD)
+	if (!blk_discard_mergable(req))
 		elv_merge_requests(q, req, next);
 
 	/*
diff -druNp --no-dereference linux-libre-4.14.158-gnu/block/blk-mq-sysfs.c linux-libre-4.14.159-gnu/block/blk-mq-sysfs.c
--- linux-libre-4.14.158-gnu/block/blk-mq-sysfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/block/blk-mq-sysfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -145,20 +145,25 @@ static ssize_t blk_mq_hw_sysfs_nr_reserv
 
 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 attribute *default_ctx_attrs[] = {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/crypto/af_alg.c linux-libre-4.14.159-gnu/crypto/af_alg.c
--- linux-libre-4.14.158-gnu/crypto/af_alg.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/crypto/af_alg.c	2019-12-17 14:40:05.000000000 -0500
@@ -1086,7 +1086,7 @@ void af_alg_async_cb(struct crypto_async
 	af_alg_free_resources(areq);
 	sock_put(sk);
 
-	iocb->ki_complete(iocb, err ? err : resultlen, 0);
+	iocb->ki_complete(iocb, err ? err : (int)resultlen, 0);
 }
 EXPORT_SYMBOL_GPL(af_alg_async_cb);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/crypto/crypto_user.c linux-libre-4.14.159-gnu/crypto/crypto_user.c
--- linux-libre-4.14.158-gnu/crypto/crypto_user.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/crypto/crypto_user.c	2019-12-17 14:40:05.000000000 -0500
@@ -288,8 +288,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.14.158-gnu/crypto/ecc.c linux-libre-4.14.159-gnu/crypto/ecc.c
--- linux-libre-4.14.158-gnu/crypto/ecc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/crypto/ecc.c	2019-12-17 14:40:05.000000000 -0500
@@ -898,36 +898,50 @@ 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,
-		     const u64 *private_key, unsigned int private_key_len)
+static int __ecc_is_key_valid(const struct ecc_curve *curve,
+			      const u64 *private_key, unsigned int ndigits)
 {
-	int nbytes;
-	const struct ecc_curve *curve = ecc_get_curve(curve_id);
+	u64 one[ECC_MAX_DIGITS] = { 1, };
+	u64 res[ECC_MAX_DIGITS];
 
 	if (!private_key)
 		return -EINVAL;
 
-	nbytes = ndigits << ECC_DIGITS_TO_BYTES_SHIFT;
-
-	if (private_key_len != nbytes)
+	if (curve->g.ndigits != ndigits)
 		return -EINVAL;
 
-	if (vli_is_zero(private_key, ndigits))
+	/* Make sure the private key is in the range [2, n-3]. */
+	if (vli_cmp(one, private_key, ndigits) != -1)
 		return -EINVAL;
-
-	/* Make sure the private key is in the range [1, n-1]. */
-	if (vli_cmp(curve->n, private_key, ndigits) != 1)
+	vli_sub(res, curve->n, one, ndigits);
+	vli_sub(res, res, one, ndigits);
+	if (vli_cmp(res, private_key, ndigits) != 1)
 		return -EINVAL;
 
 	return 0;
 }
 
+int ecc_is_key_valid(unsigned int curve_id, unsigned int ndigits,
+		     const u64 *private_key, unsigned int private_key_len)
+{
+	int nbytes;
+	const struct ecc_curve *curve = ecc_get_curve(curve_id);
+
+	nbytes = ndigits << ECC_DIGITS_TO_BYTES_SHIFT;
+
+	if (private_key_len != nbytes)
+		return -EINVAL;
+
+	return __ecc_is_key_valid(curve, private_key, ndigits);
+}
+
 /*
  * ECC private keys are generated using the method of extra random bits,
  * equivalent to that described in FIPS 186-4, Appendix B.4.1.
@@ -971,11 +985,8 @@ int ecc_gen_privkey(unsigned int curve_i
 	if (err)
 		return err;
 
-	if (vli_is_zero(priv, ndigits))
-		return -EINVAL;
-
-	/* Make sure the private key is in the range [1, n-1]. */
-	if (vli_cmp(curve->n, priv, ndigits) != 1)
+	/* Make sure the private key is in the valid range. */
+	if (__ecc_is_key_valid(curve, priv, ndigits))
 		return -EINVAL;
 
 	ecc_swap_digits(priv, privkey, ndigits);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/Documentation/admin-guide/kernel-parameters.txt linux-libre-4.14.159-gnu/Documentation/admin-guide/kernel-parameters.txt
--- linux-libre-4.14.158-gnu/Documentation/admin-guide/kernel-parameters.txt	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/Documentation/admin-guide/kernel-parameters.txt	2019-12-17 14:40:05.000000000 -0500
@@ -4693,13 +4693,13 @@
 			Flags is a set of characters, each corresponding
 			to a common usb-storage quirk flag as follows:
 				a = SANE_SENSE (collect more than 18 bytes
-					of sense data);
+					of sense data, not on uas);
 				b = BAD_SENSE (don't collect more than 18
-					bytes of sense data);
+					bytes of sense data, not on uas);
 				c = FIX_CAPACITY (decrease the reported
 					device capacity by one sector);
 				d = NO_READ_DISC_INFO (don't use
-					READ_DISC_INFO command);
+					READ_DISC_INFO command, not on uas);
 				e = NO_READ_CAPACITY_16 (don't use
 					READ_CAPACITY_16 command);
 				f = NO_REPORT_OPCODES (don't use report opcodes
@@ -4714,17 +4714,18 @@
 				j = NO_REPORT_LUNS (don't use report luns
 					command, uas only);
 				l = NOT_LOCKABLE (don't try to lock and
-					unlock ejectable media);
+					unlock ejectable media, not on uas);
 				m = MAX_SECTORS_64 (don't transfer more
-					than 64 sectors = 32 KB at a time);
+					than 64 sectors = 32 KB at a time,
+					not on uas);
 				n = INITIAL_READ10 (force a retry of the
-					initial READ(10) command);
+					initial READ(10) command, not on uas);
 				o = CAPACITY_OK (accept the capacity
-					reported by the device);
+					reported by the device, not on uas);
 				p = WRITE_CACHE (the device cache is ON
-					by default);
+					by default, not on uas);
 				r = IGNORE_RESIDUE (the device reports
-					bogus residue values);
+					bogus residue values, not on uas);
 				s = SINGLE_LUN (the device has only one
 					Logical Unit);
 				t = NO_ATA_1X (don't allow ATA(12) and ATA(16)
@@ -4733,7 +4734,8 @@
 				w = NO_WP_DETECT (don't test whether the
 					medium is write-protected).
 				y = ALWAYS_SYNC (issue a SYNCHRONIZE_CACHE
-					even if the device claims no cache)
+					even if the device claims no cache,
+					not on uas)
 			Example: quirks=0419:aaf5:rl,0421:0433:rc
 
 	user_debug=	[KNL,ARM]
diff -druNp --no-dereference linux-libre-4.14.158-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt linux-libre-4.14.159-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt
--- linux-libre-4.14.158-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/Documentation/devicetree/bindings/rtc/abracon,abx80x.txt	2019-12-17 14:40:05.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.14.158-gnu/drivers/acpi/bus.c linux-libre-4.14.159-gnu/drivers/acpi/bus.c
--- linux-libre-4.14.158-gnu/drivers/acpi/bus.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/acpi/bus.c	2019-12-17 14:40:05.000000000 -0500
@@ -196,7 +196,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.14.158-gnu/drivers/acpi/device_pm.c linux-libre-4.14.159-gnu/drivers/acpi/device_pm.c
--- linux-libre-4.14.158-gnu/drivers/acpi/device_pm.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/acpi/device_pm.c	2019-12-17 14:40:05.000000000 -0500
@@ -1154,9 +1154,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.14.158-gnu/drivers/acpi/osl.c linux-libre-4.14.159-gnu/drivers/acpi/osl.c
--- linux-libre-4.14.158-gnu/drivers/acpi/osl.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/acpi/osl.c	2019-12-17 14:40:05.000000000 -0500
@@ -371,19 +371,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);
 }
 
 /**
@@ -403,6 +405,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_permanent_mmap) {
 		__acpi_unmap_table(virt, size);
@@ -416,10 +419,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);
 
@@ -454,6 +458,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;
@@ -469,10 +474,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.14.158-gnu/drivers/android/binder_alloc.c linux-libre-4.14.159-gnu/drivers/android/binder_alloc.c
--- linux-libre-4.14.158-gnu/drivers/android/binder_alloc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/android/binder_alloc.c	2019-12-17 14:40:05.000000000 -0500
@@ -289,8 +289,7 @@ static int binder_update_page_range(stru
 	return 0;
 
 free_range:
-	for (page_addr = end - PAGE_SIZE; page_addr >= start;
-	     page_addr -= PAGE_SIZE) {
+	for (page_addr = end - PAGE_SIZE; 1; page_addr -= PAGE_SIZE) {
 		bool ret;
 		size_t index;
 
@@ -303,6 +302,8 @@ free_range:
 		WARN_ON(!ret);
 
 		trace_binder_free_lru_end(alloc, index);
+		if (page_addr == start)
+			break;
 		continue;
 
 err_vm_insert_page_failed:
@@ -312,7 +313,8 @@ err_map_kernel_failed:
 		page->page_ptr = NULL;
 err_alloc_page_failed:
 err_page_ptr_cleared:
-		;
+		if (page_addr == start)
+			break;
 	}
 err_no_vma:
 	if (mm) {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/block/drbd/drbd_state.c linux-libre-4.14.159-gnu/drivers/block/drbd/drbd_state.c
--- linux-libre-4.14.158-gnu/drivers/block/drbd/drbd_state.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/block/drbd/drbd_state.c	2019-12-17 14:40:05.000000000 -0500
@@ -688,11 +688,9 @@ request_detach(struct drbd_device *devic
 			CS_VERBOSE | CS_ORDERED | CS_INHIBIT_MD_IO);
 }
 
-enum drbd_state_rv
-drbd_request_detach_interruptible(struct drbd_device *device)
+int drbd_request_detach_interruptible(struct drbd_device *device)
 {
-	enum drbd_state_rv rv;
-	int ret;
+	int ret, rv;
 
 	drbd_suspend_io(device); /* so no-one is stuck in drbd_al_begin_io */
 	wait_event_interruptible(device->state_wait,
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/block/drbd/drbd_state.h linux-libre-4.14.159-gnu/drivers/block/drbd/drbd_state.h
--- linux-libre-4.14.158-gnu/drivers/block/drbd/drbd_state.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/block/drbd/drbd_state.h	2019-12-17 14:40:05.000000000 -0500
@@ -162,8 +162,7 @@ static inline int drbd_request_state(str
 }
 
 /* for use in adm_detach() (drbd_adm_detach(), drbd_adm_down()) */
-enum drbd_state_rv
-drbd_request_detach_interruptible(struct drbd_device *device);
+int drbd_request_detach_interruptible(struct drbd_device *device);
 
 enum drbd_role conn_highest_role(struct drbd_connection *connection);
 enum drbd_role conn_highest_peer(struct drbd_connection *connection);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/block/rsxx/core.c linux-libre-4.14.159-gnu/drivers/block/rsxx/core.c
--- linux-libre-4.14.158-gnu/drivers/block/rsxx/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/block/rsxx/core.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/char/hw_random/omap-rng.c linux-libre-4.14.159-gnu/drivers/char/hw_random/omap-rng.c
--- linux-libre-4.14.158-gnu/drivers/char/hw_random/omap-rng.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/char/hw_random/omap-rng.c	2019-12-17 14:40:05.000000000 -0500
@@ -66,6 +66,13 @@
 #define OMAP4_RNG_OUTPUT_SIZE			0x8
 #define EIP76_RNG_OUTPUT_SIZE			0x10
 
+/*
+ * EIP76 RNG takes approx. 700us to produce 16 bytes of output data
+ * as per testing results. And to account for the lack of udelay()'s
+ * reliability, we keep the timeout as 1000us.
+ */
+#define RNG_DATA_FILL_TIMEOUT			100
+
 enum {
 	RNG_OUTPUT_0_REG = 0,
 	RNG_OUTPUT_1_REG,
@@ -175,7 +182,7 @@ static int omap_rng_do_read(struct hwrng
 	if (max < priv->pdata->data_size)
 		return 0;
 
-	for (i = 0; i < 20; i++) {
+	for (i = 0; i < RNG_DATA_FILL_TIMEOUT; i++) {
 		present = priv->pdata->data_present(priv);
 		if (present || !wait)
 			break;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/char/ppdev.c linux-libre-4.14.159-gnu/drivers/char/ppdev.c
--- linux-libre-4.14.158-gnu/drivers/char/ppdev.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/char/ppdev.c	2019-12-17 14:40:05.000000000 -0500
@@ -623,20 +623,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;
@@ -647,8 +654,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.14.158-gnu/drivers/char/tpm/tpm2-cmd.c linux-libre-4.14.159-gnu/drivers/char/tpm/tpm2-cmd.c
--- linux-libre-4.14.158-gnu/drivers/char/tpm/tpm2-cmd.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/char/tpm/tpm2-cmd.c	2019-12-17 14:40:05.000000000 -0500
@@ -1029,6 +1029,10 @@ static int tpm2_get_cc_attrs_tbl(struct
 
 	chip->cc_attrs_tbl = devm_kzalloc(&chip->dev, 4 * nr_commands,
 					  GFP_KERNEL);
+	if (!chip->cc_attrs_tbl) {
+		rc = -ENOMEM;
+		goto out;
+	}
 
 	rc = tpm_buf_init(&buf, TPM2_ST_NO_SESSIONS, TPM2_CC_GET_CAPABILITY);
 	if (rc)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/clk/renesas/r8a77995-cpg-mssr.c linux-libre-4.14.159-gnu/drivers/clk/renesas/r8a77995-cpg-mssr.c
--- linux-libre-4.14.158-gnu/drivers/clk/renesas/r8a77995-cpg-mssr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/clk/renesas/r8a77995-cpg-mssr.c	2019-12-17 14:40:05.000000000 -0500
@@ -141,8 +141,8 @@ static const struct mssr_mod_clk r8a7799
 	DEF_MOD("vspbs",		 627,	R8A77995_CLK_S0D1),
 	DEF_MOD("ehci0",		 703,	R8A77995_CLK_S3D2),
 	DEF_MOD("hsusb",		 704,	R8A77995_CLK_S3D2),
-	DEF_MOD("du1",			 723,	R8A77995_CLK_S2D1),
-	DEF_MOD("du0",			 724,	R8A77995_CLK_S2D1),
+	DEF_MOD("du1",			 723,	R8A77995_CLK_S1D1),
+	DEF_MOD("du0",			 724,	R8A77995_CLK_S1D1),
 	DEF_MOD("lvds",			 727,	R8A77995_CLK_S2D1),
 	DEF_MOD("vin7",			 804,	R8A77995_CLK_S1D2),
 	DEF_MOD("vin6",			 805,	R8A77995_CLK_S1D2),
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/clk/rockchip/clk-rk3188.c linux-libre-4.14.159-gnu/drivers/clk/rockchip/clk-rk3188.c
--- linux-libre-4.14.158-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/clk/rockchip/clk-rk3188.c	2019-12-17 14:40:05.000000000 -0500
@@ -362,8 +362,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,
@@ -391,8 +391,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.14.158-gnu/drivers/clk/rockchip/clk-rk3328.c linux-libre-4.14.159-gnu/drivers/clk/rockchip/clk-rk3328.c
--- linux-libre-4.14.158-gnu/drivers/clk/rockchip/clk-rk3328.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/clk/rockchip/clk-rk3328.c	2019-12-17 14:40:05.000000000 -0500
@@ -392,7 +392,7 @@ static struct rockchip_clk_branch rk3328
 			RK3328_CLKGATE_CON(1), 5, GFLAGS,
 			&rk3328_i2s1_fracmux),
 	GATE(SCLK_I2S1, "clk_i2s1", "i2s1_pre", CLK_SET_RATE_PARENT,
-			RK3328_CLKGATE_CON(0), 6, GFLAGS),
+			RK3328_CLKGATE_CON(1), 6, GFLAGS),
 	COMPOSITE_NODIV(SCLK_I2S1_OUT, "i2s1_out", mux_i2s1out_p, 0,
 			RK3328_CLKSEL_CON(8), 12, 1, MFLAGS,
 			RK3328_CLKGATE_CON(1), 7, GFLAGS),
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/clk/sunxi-ng/ccu-sun50i-a64.c linux-libre-4.14.159-gnu/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
--- linux-libre-4.14.158-gnu/drivers/clk/sunxi-ng/ccu-sun50i-a64.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/clk/sunxi-ng/ccu-sun50i-a64.c	2019-12-17 14:40:05.000000000 -0500
@@ -565,7 +565,7 @@ static const char * const dsi_dphy_paren
 static const u8 dsi_dphy_table[] = { 0, 2, };
 static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(dsi_dphy_clk, "dsi-dphy",
 				       dsi_dphy_parents, dsi_dphy_table,
-				       0x168, 0, 4, 8, 2, BIT(31), CLK_SET_RATE_PARENT);
+				       0x168, 0, 4, 8, 2, BIT(15), CLK_SET_RATE_PARENT);
 
 static SUNXI_CCU_M_WITH_GATE(gpu_clk, "gpu", "pll-gpu",
 			     0x1a0, 0, 3, BIT(31), CLK_SET_RATE_PARENT);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c linux-libre-4.14.159-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
--- linux-libre-4.14.158-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/clk/sunxi-ng/ccu-sun8i-h3.c	2019-12-17 14:40:05.000000000 -0500
@@ -460,7 +460,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.14.158-gnu/drivers/cpufreq/powernv-cpufreq.c linux-libre-4.14.159-gnu/drivers/cpufreq/powernv-cpufreq.c
--- linux-libre-4.14.158-gnu/drivers/cpufreq/powernv-cpufreq.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/cpufreq/powernv-cpufreq.c	2019-12-17 14:40:05.000000000 -0500
@@ -1002,9 +1002,14 @@ static struct cpufreq_driver powernv_cpu
 
 static int init_chip_info(void)
 {
-	unsigned int chip[256];
+	unsigned int *chip;
 	unsigned int cpu, i;
 	unsigned int prev_chip_id = UINT_MAX;
+	int ret = 0;
+
+	chip = kcalloc(num_possible_cpus(), sizeof(*chip), GFP_KERNEL);
+	if (!chip)
+		return -ENOMEM;
 
 	for_each_possible_cpu(cpu) {
 		unsigned int id = cpu_to_chip_id(cpu);
@@ -1016,8 +1021,10 @@ static int init_chip_info(void)
 	}
 
 	chips = kcalloc(nr_chips, sizeof(struct chip), GFP_KERNEL);
-	if (!chips)
-		return -ENOMEM;
+	if (!chips) {
+		ret = -ENOMEM;
+		goto free_and_return;
+	}
 
 	for (i = 0; i < nr_chips; i++) {
 		chips[i].id = chip[i];
@@ -1027,7 +1034,9 @@ static int init_chip_info(void)
 			per_cpu(chip_info, cpu) =  &chips[i];
 	}
 
-	return 0;
+free_and_return:
+	kfree(chip);
+	return ret;
 }
 
 static inline void clean_chip_info(void)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/cpuidle/driver.c linux-libre-4.14.159-gnu/drivers/cpuidle/driver.c
--- linux-libre-4.14.158-gnu/drivers/cpuidle/driver.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/cpuidle/driver.c	2019-12-17 14:40:05.000000000 -0500
@@ -62,24 +62,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.14.158-gnu/drivers/crypto/amcc/crypto4xx_core.c linux-libre-4.14.159-gnu/drivers/crypto/amcc/crypto4xx_core.c
--- linux-libre-4.14.158-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/crypto/amcc/crypto4xx_core.c	2019-12-17 14:40:05.000000000 -0500
@@ -399,12 +399,8 @@ static u32 crypto4xx_build_sdr(struct cr
 		dma_alloc_coherent(dev->core_dev->device,
 			dev->scatter_buffer_size * PPC4XX_NUM_SD,
 			&dev->scatter_buffer_pa, GFP_ATOMIC);
-	if (!dev->scatter_buffer_va) {
-		dma_free_coherent(dev->core_dev->device,
-				  sizeof(struct ce_sd) * PPC4XX_NUM_SD,
-				  dev->sdr, dev->sdr_pa);
+	if (!dev->scatter_buffer_va)
 		return -ENOMEM;
-	}
 
 	sd_array = dev->sdr;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/crypto/bcm/cipher.c linux-libre-4.14.159-gnu/drivers/crypto/bcm/cipher.c
--- linux-libre-4.14.158-gnu/drivers/crypto/bcm/cipher.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/crypto/bcm/cipher.c	2019-12-17 14:40:05.000000000 -0500
@@ -4637,12 +4637,16 @@ static int spu_register_ahash(struct ipr
 	hash->halg.statesize = sizeof(struct spu_hash_export_s);
 
 	if (driver_alg->auth_info.mode != HASH_MODE_HMAC) {
-		hash->setkey = ahash_setkey;
 		hash->init = ahash_init;
 		hash->update = ahash_update;
 		hash->final = ahash_final;
 		hash->finup = ahash_finup;
 		hash->digest = ahash_digest;
+		if ((driver_alg->auth_info.alg == HASH_ALG_AES) &&
+		    ((driver_alg->auth_info.mode == HASH_MODE_XCBC) ||
+		    (driver_alg->auth_info.mode == HASH_MODE_CMAC))) {
+			hash->setkey = ahash_setkey;
+		}
 	} else {
 		hash->setkey = ahash_hmac_setkey;
 		hash->init = ahash_hmac_init;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/crypto/ccp/ccp-dmaengine.c linux-libre-4.14.159-gnu/drivers/crypto/ccp/ccp-dmaengine.c
--- linux-libre-4.14.158-gnu/drivers/crypto/ccp/ccp-dmaengine.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/crypto/ccp/ccp-dmaengine.c	2019-12-17 14:40:05.000000000 -0500
@@ -341,6 +341,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.14.158-gnu/drivers/devfreq/devfreq.c linux-libre-4.14.159-gnu/drivers/devfreq/devfreq.c
--- linux-libre-4.14.158-gnu/drivers/devfreq/devfreq.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/devfreq/devfreq.c	2019-12-17 14:40:05.000000000 -0500
@@ -133,6 +133,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. */
@@ -1161,12 +1162,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.14.158-gnu/drivers/dma/coh901318.c linux-libre-4.14.159-gnu/drivers/dma/coh901318.c
--- linux-libre-4.14.158-gnu/drivers/dma/coh901318.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/dma/coh901318.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/dma/dw/core.c linux-libre-4.14.159-gnu/drivers/dma/dw/core.c
--- linux-libre-4.14.158-gnu/drivers/dma/dw/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/dma/dw/core.c	2019-12-17 14:40:05.000000000 -0500
@@ -160,12 +160,14 @@ static void dwc_initialize_chan_idma32(s
 
 static void dwc_initialize_chan_dw(struct dw_dma_chan *dwc)
 {
+	struct dw_dma *dw = to_dw_dma(dwc->chan.device);
 	u32 cfghi = DWC_CFGH_FIFO_MODE;
 	u32 cfglo = DWC_CFGL_CH_PRIOR(dwc->priority);
 	bool hs_polarity = dwc->dws.hs_polarity;
 
 	cfghi |= DWC_CFGH_DST_PER(dwc->dws.dst_id);
 	cfghi |= DWC_CFGH_SRC_PER(dwc->dws.src_id);
+	cfghi |= DWC_CFGH_PROTCTL(dw->pdata->protctl);
 
 	/* Set polarity of handshake interface */
 	cfglo |= hs_polarity ? DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL : 0;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/dma/dw/platform.c linux-libre-4.14.159-gnu/drivers/dma/dw/platform.c
--- linux-libre-4.14.158-gnu/drivers/dma/dw/platform.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/dma/dw/platform.c	2019-12-17 14:40:05.000000000 -0500
@@ -162,6 +162,12 @@ dw_dma_parse_dt(struct platform_device *
 			pdata->multi_block[tmp] = 1;
 	}
 
+	if (!of_property_read_u32(np, "snps,dma-protection-control", &tmp)) {
+		if (tmp > CHAN_PROTCTL_MASK)
+			return NULL;
+		pdata->protctl = tmp;
+	}
+
 	return pdata;
 }
 #else
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/dma/dw/regs.h linux-libre-4.14.159-gnu/drivers/dma/dw/regs.h
--- linux-libre-4.14.158-gnu/drivers/dma/dw/regs.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/dma/dw/regs.h	2019-12-17 14:40:05.000000000 -0500
@@ -200,6 +200,10 @@ enum dw_dma_msize {
 #define DWC_CFGH_FCMODE		(1 << 0)
 #define DWC_CFGH_FIFO_MODE	(1 << 1)
 #define DWC_CFGH_PROTCTL(x)	((x) << 2)
+#define DWC_CFGH_PROTCTL_DATA	(0 << 2)	/* data access - always set */
+#define DWC_CFGH_PROTCTL_PRIV	(1 << 2)	/* privileged -> AHB HPROT[1] */
+#define DWC_CFGH_PROTCTL_BUFFER	(2 << 2)	/* bufferable -> AHB HPROT[2] */
+#define DWC_CFGH_PROTCTL_CACHE	(4 << 2)	/* cacheable  -> AHB HPROT[3] */
 #define DWC_CFGH_DS_UPD_EN	(1 << 5)
 #define DWC_CFGH_SS_UPD_EN	(1 << 6)
 #define DWC_CFGH_SRC_PER(x)	((x) << 7)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/extcon/extcon-max8997.c linux-libre-4.14.159-gnu/drivers/extcon/extcon-max8997.c
--- linux-libre-4.14.158-gnu/drivers/extcon/extcon-max8997.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/extcon/extcon-max8997.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/firmware/qcom_scm-64.c linux-libre-4.14.159-gnu/drivers/firmware/qcom_scm-64.c
--- linux-libre-4.14.158-gnu/drivers/firmware/qcom_scm-64.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/firmware/qcom_scm-64.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/gpio/gpiolib-acpi.c linux-libre-4.14.159-gnu/drivers/gpio/gpiolib-acpi.c
--- linux-libre-4.14.158-gnu/drivers/gpio/gpiolib-acpi.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/gpio/gpiolib-acpi.c	2019-12-17 14:40:05.000000000 -0500
@@ -1314,11 +1314,28 @@ late_initcall_sync(acpi_gpio_handle_defe
 
 static const struct dmi_system_id run_edge_events_on_boot_blacklist[] = {
 	{
+		/*
+		 * The Minix Neo Z83-4 has a micro-USB-B id-pin handler for
+		 * a non existing micro-USB-B connector which puts the HDMI
+		 * DDC pins in GPIO mode, breaking HDMI support.
+		 */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "MINIX"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Z83-4"),
 		}
 	},
+	{
+		/*
+		 * The Terra Pad 1061 has a micro-USB-B id-pin handler, which
+		 * instead of controlling the actual micro-USB-B turns the 5V
+		 * boost for its USB-A connector off. The actual micro-USB-B
+		 * connector is wired for charging only.
+		 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Wortmann_AG"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TERRA_PAD_1061"),
+		}
+	},
 	{} /* Terminating entry */
 };
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/gpu/drm/i810/i810_dma.c linux-libre-4.14.159-gnu/drivers/gpu/drm/i810/i810_dma.c
--- linux-libre-4.14.158-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/gpu/drm/i810/i810_dma.c	2019-12-17 14:40:05.000000000 -0500
@@ -721,7 +721,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)
@@ -1041,7 +1041,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.14.158-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c linux-libre-4.14.159-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
--- linux-libre-4.14.158-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/hwtracing/intel_th/core.c linux-libre-4.14.159-gnu/drivers/hwtracing/intel_th/core.c
--- linux-libre-4.14.158-gnu/drivers/hwtracing/intel_th/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/hwtracing/intel_th/core.c	2019-12-17 14:40:05.000000000 -0500
@@ -628,10 +628,8 @@ intel_th_subdevice_alloc(struct intel_th
 	}
 
 	err = intel_th_device_add_resources(thdev, res, subdev->nres);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
 		goto fail_put_device;
-	}
 
 	if (subdev->type == INTEL_TH_OUTPUT) {
 		thdev->dev.devt = MKDEV(th->major, th->num_thdevs);
@@ -644,10 +642,8 @@ intel_th_subdevice_alloc(struct intel_th
 	}
 
 	err = device_add(&thdev->dev);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
 		goto fail_free_res;
-	}
 
 	/* need switch driver to be loaded to enumerate the rest */
 	if (subdev->type == INTEL_TH_SWITCH && !req) {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/hwtracing/intel_th/pci.c linux-libre-4.14.159-gnu/drivers/hwtracing/intel_th/pci.c
--- linux-libre-4.14.158-gnu/drivers/hwtracing/intel_th/pci.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/hwtracing/intel_th/pci.c	2019-12-17 14:40:05.000000000 -0500
@@ -194,6 +194,16 @@ static const struct pci_device_id intel_
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
 	},
 	{
+		/* Ice Lake CPU */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8a29),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
+	{
+		/* Tiger Lake CPU */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9a33),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
+	{
 		/* Tiger Lake PCH */
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/i2c/busses/i2c-imx.c linux-libre-4.14.159-gnu/drivers/i2c/busses/i2c-imx.c
--- linux-libre-4.14.158-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/i2c/busses/i2c-imx.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/i2c/i2c-core-of.c linux-libre-4.14.159-gnu/drivers/i2c/i2c-core-of.c
--- linux-libre-4.14.158-gnu/drivers/i2c/i2c-core-of.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/i2c/i2c-core-of.c	2019-12-17 14:40:05.000000000 -0500
@@ -238,14 +238,14 @@ static int of_i2c_notify(struct notifier
 		}
 
 		client = of_i2c_register_device(adap, rd->dn);
-		put_device(&adap->dev);
-
 		if (IS_ERR(client)) {
 			dev_err(&adap->dev, "failed to create client for '%pOF'\n",
 				 rd->dn);
+			put_device(&adap->dev);
 			of_node_clear_flag(rd->dn, OF_POPULATED);
 			return notifier_from_errno(PTR_ERR(client));
 		}
+		put_device(&adap->dev);
 		break;
 	case OF_RECONFIG_CHANGE_REMOVE:
 		/* already depopulated? */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/iio/humidity/hdc100x.c linux-libre-4.14.159-gnu/drivers/iio/humidity/hdc100x.c
--- linux-libre-4.14.158-gnu/drivers/iio/humidity/hdc100x.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/iio/humidity/hdc100x.c	2019-12-17 14:40:05.000000000 -0500
@@ -237,7 +237,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.14.158-gnu/drivers/iio/imu/adis16480.c linux-libre-4.14.159-gnu/drivers/iio/imu/adis16480.c
--- linux-libre-4.14.158-gnu/drivers/iio/imu/adis16480.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/iio/imu/adis16480.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/infiniband/hw/hfi1/chip.c linux-libre-4.14.159-gnu/drivers/infiniband/hw/hfi1/chip.c
--- linux-libre-4.14.158-gnu/drivers/infiniband/hw/hfi1/chip.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/infiniband/hw/hfi1/chip.c	2019-12-17 14:40:05.000000000 -0500
@@ -1074,6 +1074,8 @@ static void log_state_transition(struct
 static void log_physical_state(struct hfi1_pportdata *ppd, u32 state);
 static int wait_physical_linkstate(struct hfi1_pportdata *ppd, u32 state,
 				   int msecs);
+static int wait_phys_link_out_of_offline(struct hfi1_pportdata *ppd,
+					 int msecs);
 static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc);
 static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr);
 static void handle_temp_err(struct hfi1_devdata *dd);
@@ -10731,13 +10733,15 @@ int set_link_state(struct hfi1_pportdata
 			break;
 
 		ppd->port_error_action = 0;
-		ppd->host_link_state = HLS_DN_POLL;
 
 		if (quick_linkup) {
 			/* quick linkup does not go into polling */
 			ret = do_quick_linkup(dd);
 		} else {
 			ret1 = set_physical_link_state(dd, PLS_POLLING);
+			if (!ret1)
+				ret1 = wait_phys_link_out_of_offline(ppd,
+								     3000);
 			if (ret1 != HCMD_SUCCESS) {
 				dd_dev_err(dd,
 					   "Failed to transition to Polling link state, return 0x%x\n",
@@ -10745,6 +10749,14 @@ int set_link_state(struct hfi1_pportdata
 				ret = -EINVAL;
 			}
 		}
+
+		/*
+		 * Change the host link state after requesting DC8051 to
+		 * change its physical state so that we can ignore any
+		 * interrupt with stale LNI(XX) error, which will not be
+		 * cleared until DC8051 transitions to Polling state.
+		 */
+		ppd->host_link_state = HLS_DN_POLL;
 		ppd->offline_disabled_reason =
 			HFI1_ODR_MASK(OPA_LINKDOWN_REASON_NONE);
 		/*
@@ -12863,6 +12875,39 @@ static int wait_phys_link_offline_substa
 				   read_state, msecs);
 			return -ETIMEDOUT;
 		}
+		usleep_range(1950, 2050); /* sleep 2ms-ish */
+	}
+
+	log_state_transition(ppd, read_state);
+	return read_state;
+}
+
+/*
+ * wait_phys_link_out_of_offline - wait for any out of offline state
+ * @ppd: port device
+ * @msecs: the number of milliseconds to wait
+ *
+ * Wait up to msecs milliseconds for any out of offline physical link
+ * state change to occur.
+ * Returns 0 if at least one state is reached, otherwise -ETIMEDOUT.
+ */
+static int wait_phys_link_out_of_offline(struct hfi1_pportdata *ppd,
+					 int msecs)
+{
+	u32 read_state;
+	unsigned long timeout;
+
+	timeout = jiffies + msecs_to_jiffies(msecs);
+	while (1) {
+		read_state = read_physical_state(ppd->dd);
+		if ((read_state & 0xF0) != PLS_OFFLINE)
+			break;
+		if (time_after(jiffies, timeout)) {
+			dd_dev_err(ppd->dd,
+				   "timeout waiting for phy link out of offline. Read state 0x%x, %dms\n",
+				   read_state, msecs);
+			return -ETIMEDOUT;
+		}
 		usleep_range(1950, 2050); /* sleep 2ms-ish */
 	}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/infiniband/hw/hfi1/vnic_sdma.c linux-libre-4.14.159-gnu/drivers/infiniband/hw/hfi1/vnic_sdma.c
--- linux-libre-4.14.158-gnu/drivers/infiniband/hw/hfi1/vnic_sdma.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/infiniband/hw/hfi1/vnic_sdma.c	2019-12-17 14:40:05.000000000 -0500
@@ -57,7 +57,6 @@
 
 #define HFI1_VNIC_TXREQ_NAME_LEN   32
 #define HFI1_VNIC_SDMA_DESC_WTRMRK 64
-#define HFI1_VNIC_SDMA_RETRY_COUNT 1
 
 /*
  * struct vnic_txreq - VNIC transmit descriptor
@@ -67,7 +66,6 @@
  * @pad: pad buffer
  * @plen: pad length
  * @pbc_val: pbc value
- * @retry_count: tx retry count
  */
 struct vnic_txreq {
 	struct sdma_txreq       txreq;
@@ -77,8 +75,6 @@ struct vnic_txreq {
 	unsigned char           pad[HFI1_VNIC_MAX_PAD];
 	u16                     plen;
 	__le64                  pbc_val;
-
-	u32                     retry_count;
 };
 
 static void vnic_sdma_complete(struct sdma_txreq *txreq,
@@ -196,7 +192,6 @@ int hfi1_vnic_send_dma(struct hfi1_devda
 	ret = build_vnic_tx_desc(sde, tx, pbc);
 	if (unlikely(ret))
 		goto free_desc;
-	tx->retry_count = 0;
 
 	ret = sdma_send_txreq(sde, &vnic_sdma->wait, &tx->txreq,
 			      vnic_sdma->pkts_sent);
@@ -238,14 +233,14 @@ static int hfi1_vnic_sdma_sleep(struct s
 	struct hfi1_vnic_sdma *vnic_sdma =
 		container_of(wait, struct hfi1_vnic_sdma, wait);
 	struct hfi1_ibdev *dev = &vnic_sdma->dd->verbs_dev;
-	struct vnic_txreq *tx = container_of(txreq, struct vnic_txreq, txreq);
 
-	if (sdma_progress(sde, seq, txreq))
-		if (tx->retry_count++ < HFI1_VNIC_SDMA_RETRY_COUNT)
-			return -EAGAIN;
+	write_seqlock(&dev->iowait_lock);
+	if (sdma_progress(sde, seq, txreq)) {
+		write_sequnlock(&dev->iowait_lock);
+		return -EAGAIN;
+	}
 
 	vnic_sdma->state = HFI1_VNIC_SDMA_Q_DEFERRED;
-	write_seqlock(&dev->iowait_lock);
 	if (list_empty(&vnic_sdma->wait.list))
 		iowait_queue(pkts_sent, wait, &sde->dmawait);
 	write_sequnlock(&dev->iowait_lock);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h linux-libre-4.14.159-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h
--- linux-libre-4.14.158-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/infiniband/hw/hns/hns_roce_hem.h	2019-12-17 14:40:05.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.14.158-gnu/drivers/infiniband/hw/mlx4/sysfs.c linux-libre-4.14.159-gnu/drivers/infiniband/hw/mlx4/sysfs.c
--- linux-libre-4.14.158-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/infiniband/hw/mlx4/sysfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -353,16 +353,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.14.158-gnu/drivers/infiniband/hw/qib/qib_sysfs.c linux-libre-4.14.159-gnu/drivers/infiniband/hw/qib/qib_sysfs.c
--- linux-libre-4.14.158-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/infiniband/hw/qib/qib_sysfs.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/input/joystick/psxpad-spi.c linux-libre-4.14.159-gnu/drivers/input/joystick/psxpad-spi.c
--- linux-libre-4.14.158-gnu/drivers/input/joystick/psxpad-spi.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/joystick/psxpad-spi.c	2019-12-17 14:40:05.000000000 -0500
@@ -292,7 +292,7 @@ static int psxpad_spi_probe(struct spi_d
 	if (!pad)
 		return -ENOMEM;
 
-	pdev = input_allocate_polled_device();
+	pdev = devm_input_allocate_polled_device(&spi->dev);
 	if (!pdev) {
 		dev_err(&spi->dev, "failed to allocate input device\n");
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/input/mouse/synaptics.c linux-libre-4.14.159-gnu/drivers/input/mouse/synaptics.c
--- linux-libre-4.14.158-gnu/drivers/input/mouse/synaptics.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/mouse/synaptics.c	2019-12-17 14:40:05.000000000 -0500
@@ -175,6 +175,7 @@ static const char * const smbus_pnp_ids[
 	"LEN0071", /* T480 */
 	"LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */
 	"LEN0073", /* X1 Carbon G5 (Elantech) */
+	"LEN0091", /* X1 Carbon 6 */
 	"LEN0092", /* X1 Carbon 6 */
 	"LEN0093", /* T480 */
 	"LEN0096", /* X280 */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/input/rmi4/rmi_f34v7.c linux-libre-4.14.159-gnu/drivers/input/rmi4/rmi_f34v7.c
--- linux-libre-4.14.158-gnu/drivers/input/rmi4/rmi_f34v7.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/rmi4/rmi_f34v7.c	2019-12-17 14:40:05.000000000 -0500
@@ -1192,6 +1192,9 @@ int rmi_f34v7_do_reflash(struct f34_data
 {
 	int ret;
 
+	f34->fn->rmi_dev->driver->set_irq_bits(f34->fn->rmi_dev,
+					       f34->fn->irq_mask);
+
 	rmi_f34v7_read_queries_bl_version(f34);
 
 	f34->v7.image = fw->data;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/input/rmi4/rmi_smbus.c linux-libre-4.14.159-gnu/drivers/input/rmi4/rmi_smbus.c
--- linux-libre-4.14.158-gnu/drivers/input/rmi4/rmi_smbus.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/rmi4/rmi_smbus.c	2019-12-17 14:40:05.000000000 -0500
@@ -166,7 +166,6 @@ static int rmi_smb_write_block(struct rm
 		/* prepare to write next block of bytes */
 		cur_len -= SMB_MAX_COUNT;
 		databuff += SMB_MAX_COUNT;
-		rmiaddr += SMB_MAX_COUNT;
 	}
 exit:
 	mutex_unlock(&rmi_smb->page_mutex);
@@ -218,7 +217,6 @@ static int rmi_smb_read_block(struct rmi
 		/* prepare to read next block of bytes */
 		cur_len -= SMB_MAX_COUNT;
 		databuff += SMB_MAX_COUNT;
-		rmiaddr += SMB_MAX_COUNT;
 	}
 
 	retval = 0;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/input/touchscreen/cyttsp4_core.c linux-libre-4.14.159-gnu/drivers/input/touchscreen/cyttsp4_core.c
--- linux-libre-4.14.158-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/touchscreen/cyttsp4_core.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/input/touchscreen/goodix.c linux-libre-4.14.159-gnu/drivers/input/touchscreen/goodix.c
--- linux-libre-4.14.158-gnu/drivers/input/touchscreen/goodix.c	2019-12-05 10:29:14.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/input/touchscreen/goodix.c	2019-12-17 20:57:08.000000000 -0500
@@ -93,6 +93,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.14.158-gnu/drivers/isdn/gigaset/usb-gigaset.c linux-libre-4.14.159-gnu/drivers/isdn/gigaset/usb-gigaset.c
--- linux-libre-4.14.158-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/isdn/gigaset/usb-gigaset.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/md/dm-zoned.h linux-libre-4.14.159-gnu/drivers/md/dm-zoned.h
--- linux-libre-4.14.158-gnu/drivers/md/dm-zoned.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/dm-zoned.h	2019-12-17 14:40:05.000000000 -0500
@@ -71,6 +71,7 @@ struct dmz_dev {
 
 /* Device flags. */
 #define DMZ_BDEV_DYING		(1 << 0)
+#define DMZ_CHECK_BDEV		(2 << 0)
 
 /*
  * Zone descriptor.
@@ -254,5 +255,6 @@ void dmz_schedule_reclaim(struct dmz_rec
  * Functions defined in dm-zoned-target.c
  */
 bool dmz_bdev_is_dying(struct dmz_dev *dmz_dev);
+bool dmz_check_bdev(struct dmz_dev *dmz_dev);
 
 #endif /* DM_ZONED_H */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/md/dm-zoned-metadata.c linux-libre-4.14.159-gnu/drivers/md/dm-zoned-metadata.c
--- linux-libre-4.14.158-gnu/drivers/md/dm-zoned-metadata.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/dm-zoned-metadata.c	2019-12-17 14:40:05.000000000 -0500
@@ -552,6 +552,7 @@ static struct dmz_mblock *dmz_get_mblock
 		       TASK_UNINTERRUPTIBLE);
 	if (test_bit(DMZ_META_ERROR, &mblk->state)) {
 		dmz_release_mblock(zmd, mblk);
+		dmz_check_bdev(zmd->dev);
 		return ERR_PTR(-EIO);
 	}
 
@@ -623,6 +624,8 @@ static int dmz_rdwr_block(struct dmz_met
 	ret = submit_bio_wait(bio);
 	bio_put(bio);
 
+	if (ret)
+		dmz_check_bdev(zmd->dev);
 	return ret;
 }
 
@@ -689,6 +692,7 @@ static int dmz_write_dirty_mblocks(struc
 			       TASK_UNINTERRUPTIBLE);
 		if (test_bit(DMZ_META_ERROR, &mblk->state)) {
 			clear_bit(DMZ_META_ERROR, &mblk->state);
+			dmz_check_bdev(zmd->dev);
 			ret = -EIO;
 		}
 		nr_mblks_submitted--;
@@ -766,7 +770,7 @@ int dmz_flush_metadata(struct dmz_metada
 	/* If there are no dirty metadata blocks, just flush the device cache */
 	if (list_empty(&write_list)) {
 		ret = blkdev_issue_flush(zmd->dev->bdev, GFP_NOIO, NULL);
-		goto out;
+		goto err;
 	}
 
 	/*
@@ -776,7 +780,7 @@ int dmz_flush_metadata(struct dmz_metada
 	 */
 	ret = dmz_log_dirty_mblocks(zmd, &write_list);
 	if (ret)
-		goto out;
+		goto err;
 
 	/*
 	 * The log is on disk. It is now safe to update in place
@@ -784,11 +788,11 @@ int dmz_flush_metadata(struct dmz_metada
 	 */
 	ret = dmz_write_dirty_mblocks(zmd, &write_list, zmd->mblk_primary);
 	if (ret)
-		goto out;
+		goto err;
 
 	ret = dmz_write_sb(zmd, zmd->mblk_primary);
 	if (ret)
-		goto out;
+		goto err;
 
 	while (!list_empty(&write_list)) {
 		mblk = list_first_entry(&write_list, struct dmz_mblock, link);
@@ -803,16 +807,20 @@ int dmz_flush_metadata(struct dmz_metada
 
 	zmd->sb_gen++;
 out:
-	if (ret && !list_empty(&write_list)) {
-		spin_lock(&zmd->mblk_lock);
-		list_splice(&write_list, &zmd->mblk_dirty_list);
-		spin_unlock(&zmd->mblk_lock);
-	}
-
 	dmz_unlock_flush(zmd);
 	up_write(&zmd->mblk_sem);
 
 	return ret;
+
+err:
+	if (!list_empty(&write_list)) {
+		spin_lock(&zmd->mblk_lock);
+		list_splice(&write_list, &zmd->mblk_dirty_list);
+		spin_unlock(&zmd->mblk_lock);
+	}
+	if (!dmz_check_bdev(zmd->dev))
+		ret = -EIO;
+	goto out;
 }
 
 /*
@@ -1235,6 +1243,7 @@ static int dmz_update_zone(struct dmz_me
 	if (ret) {
 		dmz_dev_err(zmd->dev, "Get zone %u report failed",
 			    dmz_id(zmd, zone));
+		dmz_check_bdev(zmd->dev);
 		return ret;
 	}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/md/dm-zoned-reclaim.c linux-libre-4.14.159-gnu/drivers/md/dm-zoned-reclaim.c
--- linux-libre-4.14.158-gnu/drivers/md/dm-zoned-reclaim.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/dm-zoned-reclaim.c	2019-12-17 14:40:05.000000000 -0500
@@ -81,6 +81,7 @@ static int dmz_reclaim_align_wp(struct d
 			    "Align zone %u wp %llu to %llu (wp+%u) blocks failed %d",
 			    dmz_id(zmd, zone), (unsigned long long)wp_block,
 			    (unsigned long long)block, nr_blocks, ret);
+		dmz_check_bdev(zrc->dev);
 		return ret;
 	}
 
@@ -490,12 +491,7 @@ static void dmz_reclaim_work(struct work
 	ret = dmz_do_reclaim(zrc);
 	if (ret) {
 		dmz_dev_debug(zrc->dev, "Reclaim error %d\n", ret);
-		if (ret == -EIO)
-			/*
-			 * LLD might be performing some error handling sequence
-			 * at the underlying device. To not interfere, do not
-			 * attempt to schedule the next reclaim run immediately.
-			 */
+		if (!dmz_check_bdev(zrc->dev))
 			return;
 	}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/md/dm-zoned-target.c linux-libre-4.14.159-gnu/drivers/md/dm-zoned-target.c
--- linux-libre-4.14.158-gnu/drivers/md/dm-zoned-target.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/dm-zoned-target.c	2019-12-17 14:40:05.000000000 -0500
@@ -79,6 +79,8 @@ static inline void dmz_bio_endio(struct
 
 	if (status != BLK_STS_OK && bio->bi_status == BLK_STS_OK)
 		bio->bi_status = status;
+	if (bio->bi_status != BLK_STS_OK)
+		bioctx->target->dev->flags |= DMZ_CHECK_BDEV;
 
 	if (atomic_dec_and_test(&bioctx->ref)) {
 		struct dm_zone *zone = bioctx->zone;
@@ -564,32 +566,52 @@ out:
 }
 
 /*
- * Check the backing device availability. If it's on the way out,
+ * Check if the backing device is being removed. If it's on the way out,
  * start failing I/O. Reclaim and metadata components also call this
  * function to cleanly abort operation in the event of such failure.
  */
 bool dmz_bdev_is_dying(struct dmz_dev *dmz_dev)
 {
-	struct gendisk *disk;
+	if (dmz_dev->flags & DMZ_BDEV_DYING)
+		return true;
 
-	if (!(dmz_dev->flags & DMZ_BDEV_DYING)) {
-		disk = dmz_dev->bdev->bd_disk;
-		if (blk_queue_dying(bdev_get_queue(dmz_dev->bdev))) {
-			dmz_dev_warn(dmz_dev, "Backing device queue dying");
-			dmz_dev->flags |= DMZ_BDEV_DYING;
-		} else if (disk->fops->check_events) {
-			if (disk->fops->check_events(disk, 0) &
-					DISK_EVENT_MEDIA_CHANGE) {
-				dmz_dev_warn(dmz_dev, "Backing device offline");
-				dmz_dev->flags |= DMZ_BDEV_DYING;
-			}
-		}
+	if (dmz_dev->flags & DMZ_CHECK_BDEV)
+		return !dmz_check_bdev(dmz_dev);
+
+	if (blk_queue_dying(bdev_get_queue(dmz_dev->bdev))) {
+		dmz_dev_warn(dmz_dev, "Backing device queue dying");
+		dmz_dev->flags |= DMZ_BDEV_DYING;
 	}
 
 	return dmz_dev->flags & DMZ_BDEV_DYING;
 }
 
 /*
+ * Check the backing device availability. This detects such events as
+ * backing device going offline due to errors, media removals, etc.
+ * This check is less efficient than dmz_bdev_is_dying() and should
+ * only be performed as a part of error handling.
+ */
+bool dmz_check_bdev(struct dmz_dev *dmz_dev)
+{
+	struct gendisk *disk;
+
+	dmz_dev->flags &= ~DMZ_CHECK_BDEV;
+
+	if (dmz_bdev_is_dying(dmz_dev))
+		return false;
+
+	disk = dmz_dev->bdev->bd_disk;
+	if (disk->fops->check_events &&
+	    disk->fops->check_events(disk, 0) & DISK_EVENT_MEDIA_CHANGE) {
+		dmz_dev_warn(dmz_dev, "Backing device offline");
+		dmz_dev->flags |= DMZ_BDEV_DYING;
+	}
+
+	return !(dmz_dev->flags & DMZ_BDEV_DYING);
+}
+
+/*
  * Process a new BIO.
  */
 static int dmz_map(struct dm_target *ti, struct bio *bio)
@@ -901,8 +923,8 @@ static int dmz_prepare_ioctl(struct dm_t
 {
 	struct dmz_target *dmz = ti->private;
 
-	if (dmz_bdev_is_dying(dmz->dev))
-		return -ENODEV;
+	if (!dmz_check_bdev(dmz->dev))
+		return -EIO;
 
 	*bdev = dmz->dev->bdev;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/md/raid0.c linux-libre-4.14.159-gnu/drivers/md/raid0.c
--- linux-libre-4.14.158-gnu/drivers/md/raid0.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/raid0.c	2019-12-17 14:40:05.000000000 -0500
@@ -616,7 +616,7 @@ static bool raid0_make_request(struct md
 		tmp_dev = map_sector(mddev, zone, sector, &sector);
 		break;
 	default:
-		WARN("md/raid0:%s: Invalid layout\n", mdname(mddev));
+		WARN(1, "md/raid0:%s: Invalid layout\n", mdname(mddev));
 		bio_io_error(bio);
 		return true;
 	}
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/md/raid5.c linux-libre-4.14.159-gnu/drivers/md/raid5.c
--- linux-libre-4.14.158-gnu/drivers/md/raid5.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/md/raid5.c	2019-12-17 14:40:05.000000000 -0500
@@ -5721,7 +5721,7 @@ static bool raid5_make_request(struct md
 				do_flush = false;
 			}
 
-			if (!sh->batch_head)
+			if (!sh->batch_head || sh == sh->batch_head)
 				set_bit(STRIPE_HANDLE, &sh->state);
 			clear_bit(STRIPE_DELAYED, &sh->state);
 			if ((!sh->batch_head || sh == sh->batch_head) &&
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/cec/cec-adap.c linux-libre-4.14.159-gnu/drivers/media/cec/cec-adap.c
--- linux-libre-4.14.158-gnu/drivers/media/cec/cec-adap.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/cec/cec-adap.c	2019-12-17 14:40:05.000000000 -0500
@@ -1403,6 +1403,13 @@ configured:
 			las->log_addr[i],
 			cec_phys_addr_exp(adap->phys_addr));
 		cec_transmit_msg_fh(adap, &msg, NULL, false);
+
+		/* Report Vendor ID */
+		if (adap->log_addrs.vendor_id != CEC_VENDOR_ID_NONE) {
+			cec_msg_device_vendor_id(&msg,
+						 adap->log_addrs.vendor_id);
+			cec_transmit_msg_fh(adap, &msg, NULL, false);
+		}
 	}
 	adap->kthread_config = NULL;
 	complete(&adap->config_completion);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/platform/qcom/venus/vdec.c linux-libre-4.14.159-gnu/drivers/media/platform/qcom/venus/vdec.c
--- linux-libre-4.14.158-gnu/drivers/media/platform/qcom/venus/vdec.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/platform/qcom/venus/vdec.c	2019-12-17 14:40:05.000000000 -0500
@@ -1060,9 +1060,6 @@ static const struct v4l2_file_operations
 	.unlocked_ioctl = video_ioctl2,
 	.poll = v4l2_m2m_fop_poll,
 	.mmap = v4l2_m2m_fop_mmap,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl32 = v4l2_compat_ioctl32,
-#endif
 };
 
 static int vdec_probe(struct platform_device *pdev)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/platform/qcom/venus/venc.c linux-libre-4.14.159-gnu/drivers/media/platform/qcom/venus/venc.c
--- linux-libre-4.14.158-gnu/drivers/media/platform/qcom/venus/venc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/platform/qcom/venus/venc.c	2019-12-17 14:40:05.000000000 -0500
@@ -1166,9 +1166,6 @@ static const struct v4l2_file_operations
 	.unlocked_ioctl = video_ioctl2,
 	.poll = v4l2_m2m_fop_poll,
 	.mmap = v4l2_m2m_fop_mmap,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl32 = v4l2_compat_ioctl32,
-#endif
 };
 
 static int venc_probe(struct platform_device *pdev)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c linux-libre-4.14.159-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
--- linux-libre-4.14.158-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/platform/sti/bdisp/bdisp-v4l2.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/media/platform/vimc/vimc-common.c linux-libre-4.14.159-gnu/drivers/media/platform/vimc/vimc-common.c
--- linux-libre-4.14.158-gnu/drivers/media/platform/vimc/vimc-common.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/platform/vimc/vimc-common.c	2019-12-17 14:40:05.000000000 -0500
@@ -241,6 +241,8 @@ int vimc_pipeline_s_stream(struct media_
 
 		/* Start the stream in the subdevice direct connected */
 		pad = media_entity_remote_pad(&ent->pads[i]);
+		if (!pad)
+			continue;
 
 		if (!is_media_entity_v4l2_subdev(pad->entity))
 			return -EINVAL;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/platform/vimc/vimc-core.c linux-libre-4.14.159-gnu/drivers/media/platform/vimc/vimc-core.c
--- linux-libre-4.14.158-gnu/drivers/media/platform/vimc/vimc-core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/platform/vimc/vimc-core.c	2019-12-17 14:40:05.000000000 -0500
@@ -243,10 +243,7 @@ static void vimc_comp_unbind(struct devi
 
 static int vimc_comp_compare(struct device *comp, void *data)
 {
-	const struct platform_device *pdev = to_platform_device(comp);
-	const char *name = data;
-
-	return !strcmp(pdev->dev.platform_data, name);
+	return comp == data;
 }
 
 static struct component_match *vimc_add_subdevs(struct vimc_device *vimc)
@@ -275,7 +272,7 @@ static struct component_match *vimc_add_
 		}
 
 		component_match_add(&vimc->pdev.dev, &match, vimc_comp_compare,
-				    (void *)vimc->pipe_cfg->ents[i].name);
+				    &vimc->subdevs[i]->dev);
 	}
 
 	return match;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/media/radio/radio-wl1273.c linux-libre-4.14.159-gnu/drivers/media/radio/radio-wl1273.c
--- linux-libre-4.14.158-gnu/drivers/media/radio/radio-wl1273.c	2019-12-05 10:18:48.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/radio/radio-wl1273.c	2019-12-17 20:46:49.000000000 -0500
@@ -1156,8 +1156,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.14.158-gnu/drivers/media/usb/pulse8-cec/pulse8-cec.c linux-libre-4.14.159-gnu/drivers/media/usb/pulse8-cec/pulse8-cec.c
--- linux-libre-4.14.158-gnu/drivers/media/usb/pulse8-cec/pulse8-cec.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/usb/pulse8-cec/pulse8-cec.c	2019-12-17 14:40:05.000000000 -0500
@@ -585,7 +585,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.14.158-gnu/drivers/media/usb/stkwebcam/stk-webcam.c linux-libre-4.14.159-gnu/drivers/media/usb/stkwebcam/stk-webcam.c
--- linux-libre-4.14.158-gnu/drivers/media/usb/stkwebcam/stk-webcam.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/media/usb/stkwebcam/stk-webcam.c	2019-12-17 14:40:05.000000000 -0500
@@ -164,7 +164,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.14.158-gnu/drivers/misc/altera-stapl/altera.c linux-libre-4.14.159-gnu/drivers/misc/altera-stapl/altera.c
--- linux-libre-4.14.158-gnu/drivers/misc/altera-stapl/altera.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/misc/altera-stapl/altera.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/mmc/host/omap_hsmmc.c linux-libre-4.14.159-gnu/drivers/mmc/host/omap_hsmmc.c
--- linux-libre-4.14.158-gnu/drivers/mmc/host/omap_hsmmc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/mmc/host/omap_hsmmc.c	2019-12-17 14:40:05.000000000 -0500
@@ -1678,6 +1678,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.14.158-gnu/drivers/mtd/devices/spear_smi.c linux-libre-4.14.159-gnu/drivers/mtd/devices/spear_smi.c
--- linux-libre-4.14.158-gnu/drivers/mtd/devices/spear_smi.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/mtd/devices/spear_smi.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/net/can/slcan.c linux-libre-4.14.159-gnu/drivers/net/can/slcan.c
--- linux-libre-4.14.158-gnu/drivers/net/can/slcan.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/can/slcan.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/net/dsa/mv88e6xxx/chip.c linux-libre-4.14.159-gnu/drivers/net/dsa/mv88e6xxx/chip.c
--- linux-libre-4.14.158-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-12-17 14:40:05.000000000 -0500
@@ -2196,11 +2196,22 @@ static int mv88e6xxx_mdio_read(struct mi
 	mutex_unlock(&chip->reg_lock);
 
 	if (reg == MII_PHYSID2) {
-		/* Some internal PHYS don't have a model number.  Use
-		 * the mv88e6390 family model number instead.
-		 */
-		if (!(val & 0x3f0))
-			val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
+		/* Some internal PHYs don't have a model number. */
+		if (chip->info->family != MV88E6XXX_FAMILY_6165)
+			/* Then there is the 6165 family. It gets is
+			 * PHYs correct. But it can also have two
+			 * SERDES interfaces in the PHY address
+			 * space. And these don't have a model
+			 * number. But they are not PHYs, so we don't
+			 * want to give them something a PHY driver
+			 * will recognise.
+			 *
+			 * Use the mv88e6390 family model number
+			 * instead, for anything which really could be
+			 * a PHY,
+			 */
+			if (!(val & 0x3f0))
+				val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
 	}
 
 	return err ? err : val;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h linux-libre-4.14.159-gnu/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h	2019-12-17 14:40:05.000000000 -0500
@@ -40,8 +40,8 @@
 #define AQ_CFG_IS_LRO_DEF           1U
 
 /* RSS */
-#define AQ_CFG_RSS_INDIRECTION_TABLE_MAX  128U
-#define AQ_CFG_RSS_HASHKEY_SIZE           320U
+#define AQ_CFG_RSS_INDIRECTION_TABLE_MAX  64U
+#define AQ_CFG_RSS_HASHKEY_SIZE           40U
 
 #define AQ_CFG_IS_RSS_DEF           1U
 #define AQ_CFG_NUM_RSS_QUEUES_DEF   AQ_CFG_VECS_DEF
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/aquantia/atlantic/aq_nic.c linux-libre-4.14.159-gnu/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/aquantia/atlantic/aq_nic.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/aquantia/atlantic/aq_nic.c	2019-12-17 14:40:05.000000000 -0500
@@ -43,7 +43,7 @@ static void aq_nic_rss_init(struct aq_ni
 	struct aq_rss_parameters *rss_params = &cfg->aq_rss;
 	int i = 0;
 
-	static u8 rss_key[40] = {
+	static u8 rss_key[AQ_CFG_RSS_HASHKEY_SIZE] = {
 		0x1e, 0xad, 0x71, 0x87, 0x65, 0xfc, 0x26, 0x7d,
 		0x0d, 0x45, 0x67, 0x74, 0xcd, 0x06, 0x1a, 0x18,
 		0xb6, 0xc1, 0xf0, 0xc7, 0xbb, 0x18, 0xbe, 0xf8,
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c linux-libre-4.14.159-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c	2019-12-17 14:40:05.000000000 -0500
@@ -714,6 +714,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;
 	}
 
@@ -739,8 +743,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.14.158-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c linux-libre-4.14.159-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/cirrus/ep93xx_eth.c	2019-12-17 14:40:05.000000000 -0500
@@ -767,6 +767,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)
@@ -782,8 +783,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.14.158-gnu/drivers/net/ethernet/huawei/hinic/hinic_main.c linux-libre-4.14.159-gnu/drivers/net/ethernet/huawei/hinic/hinic_main.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/huawei/hinic/hinic_main.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/huawei/hinic/hinic_main.c	2019-12-17 14:40:05.000000000 -0500
@@ -598,9 +598,6 @@ static int add_mac_addr(struct net_devic
 	u16 vid = 0;
 	int err;
 
-	if (!is_valid_ether_addr(addr))
-		return -EADDRNOTAVAIL;
-
 	netif_info(nic_dev, drv, netdev, "set mac addr = %02x %02x %02x %02x %02x %02x\n",
 		   addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
 
@@ -724,6 +721,7 @@ static void set_rx_mode(struct work_stru
 {
 	struct hinic_rx_mode_work *rx_mode_work = work_to_rx_mode_work(work);
 	struct hinic_dev *nic_dev = rx_mode_work_to_nic_dev(rx_mode_work);
+	struct netdev_hw_addr *ha;
 
 	netif_info(nic_dev, drv, nic_dev->netdev, "set rx mode work\n");
 
@@ -731,6 +729,9 @@ static void set_rx_mode(struct work_stru
 
 	__dev_uc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr);
 	__dev_mc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr);
+
+	netdev_for_each_mc_addr(ha, nic_dev->netdev)
+		add_mac_addr(nic_dev->netdev, ha->addr);
 }
 
 static void hinic_set_rx_mode(struct net_device *netdev)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/intel/e100.c linux-libre-4.14.159-gnu/drivers/net/ethernet/intel/e100.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/intel/e100.c	2019-12-05 10:19:56.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/intel/e100.c	2019-12-17 20:47:55.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.14.158-gnu/drivers/net/ethernet/intel/i40e/i40e_ethtool.c linux-libre-4.14.159-gnu/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/intel/i40e/i40e_ethtool.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/intel/i40e/i40e_ethtool.c	2019-12-17 14:40:05.000000000 -0500
@@ -969,6 +969,7 @@ static int i40e_set_pauseparam(struct ne
 	i40e_status status;
 	u8 aq_failures;
 	int err = 0;
+	u32 is_an;
 
 	/* Changing the port's flow control is not supported if this isn't the
 	 * port's controlling PF
@@ -981,15 +982,14 @@ static int i40e_set_pauseparam(struct ne
 	if (vsi != pf->vsi[pf->lan_vsi])
 		return -EOPNOTSUPP;
 
-	if (pause->autoneg != ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?
-	    AUTONEG_ENABLE : AUTONEG_DISABLE)) {
+	is_an = hw_link_info->an_info & I40E_AQ_AN_COMPLETED;
+	if (pause->autoneg != is_an) {
 		netdev_info(netdev, "To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n");
 		return -EOPNOTSUPP;
 	}
 
 	/* If we have link and don't have autoneg */
-	if (!test_bit(__I40E_DOWN, pf->state) &&
-	    !(hw_link_info->an_info & I40E_AQ_AN_COMPLETED)) {
+	if (!test_bit(__I40E_DOWN, pf->state) && !is_an) {
 		/* Send message that it might not necessarily work*/
 		netdev_info(netdev, "Autoneg did not complete so changing settings may not result in an actual change.\n");
 	}
@@ -1040,7 +1040,7 @@ static int i40e_set_pauseparam(struct ne
 		err = -EAGAIN;
 	}
 
-	if (!test_bit(__I40E_DOWN, pf->state)) {
+	if (!test_bit(__I40E_DOWN, pf->state) && is_an) {
 		/* Give it a little more time to try to come back */
 		msleep(75);
 		if (!test_bit(__I40E_DOWN, pf->state))
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/mellanox/mlx4/main.c linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx4/main.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2019-12-17 14:40:05.000000000 -0500
@@ -199,7 +199,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;
 			}
 		}
 	}
@@ -208,7 +208,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;
@@ -1152,8 +1152,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);
@@ -1175,7 +1174,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;
 			}
 		}
 	}
@@ -1201,7 +1200,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.14.158-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c	2019-12-17 14:40:05.000000000 -0500
@@ -1625,7 +1625,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.14.158-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlx5/core/qp.c	2019-12-17 14:40:05.000000000 -0500
@@ -124,7 +124,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) {
@@ -138,7 +138,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.14.158-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c	2019-12-17 14:40:05.000000000 -0500
@@ -1252,15 +1252,12 @@ mlxsw_sp_ipip_entry_matches_decap(struct
 {
 	u32 ul_tb_id = l3mdev_fib_table(ul_dev) ? : RT_TABLE_MAIN;
 	enum mlxsw_sp_ipip_type ipipt = ipip_entry->ipipt;
-	struct net_device *ipip_ul_dev;
 
 	if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto)
 		return false;
 
-	ipip_ul_dev = __mlxsw_sp_ipip_netdev_ul_dev_get(ipip_entry->ol_dev);
 	return mlxsw_sp_ipip_entry_saddr_matches(mlxsw_sp, ul_proto, ul_dip,
-						 ul_tb_id, ipip_entry) &&
-	       (!ipip_ul_dev || ipip_ul_dev == ul_dev);
+						 ul_tb_id, ipip_entry);
 }
 
 /* Given decap parameters, find the corresponding IPIP entry. */
@@ -1765,7 +1762,7 @@ static void mlxsw_sp_router_probe_unreso
 static void
 mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp,
 			      struct mlxsw_sp_neigh_entry *neigh_entry,
-			      bool removing);
+			      bool removing, bool dead);
 
 static enum mlxsw_reg_rauht_op mlxsw_sp_rauht_op(bool adding)
 {
@@ -1894,7 +1891,8 @@ static void mlxsw_sp_router_neigh_event_
 
 	memcpy(neigh_entry->ha, ha, ETH_ALEN);
 	mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, entry_connected);
-	mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected);
+	mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected,
+				      dead);
 
 	if (!neigh_entry->connected && list_empty(&neigh_entry->nexthop_list))
 		mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry);
@@ -2538,13 +2536,79 @@ static void __mlxsw_sp_nexthop_neigh_upd
 	nh->update = 1;
 }
 
+static int
+mlxsw_sp_nexthop_dead_neigh_replace(struct mlxsw_sp *mlxsw_sp,
+				    struct mlxsw_sp_neigh_entry *neigh_entry)
+{
+	struct neighbour *n, *old_n = neigh_entry->key.n;
+	struct mlxsw_sp_nexthop *nh;
+	bool entry_connected;
+	u8 nud_state, dead;
+	int err;
+
+	nh = list_first_entry(&neigh_entry->nexthop_list,
+			      struct mlxsw_sp_nexthop, neigh_list_node);
+
+	n = neigh_lookup(nh->nh_grp->neigh_tbl, &nh->gw_addr, nh->rif->dev);
+	if (!n) {
+		n = neigh_create(nh->nh_grp->neigh_tbl, &nh->gw_addr,
+				 nh->rif->dev);
+		if (IS_ERR(n))
+			return PTR_ERR(n);
+		neigh_event_send(n, NULL);
+	}
+
+	mlxsw_sp_neigh_entry_remove(mlxsw_sp, neigh_entry);
+	neigh_entry->key.n = n;
+	err = mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry);
+	if (err)
+		goto err_neigh_entry_insert;
+
+	read_lock_bh(&n->lock);
+	nud_state = n->nud_state;
+	dead = n->dead;
+	read_unlock_bh(&n->lock);
+	entry_connected = nud_state & NUD_VALID && !dead;
+
+	list_for_each_entry(nh, &neigh_entry->nexthop_list,
+			    neigh_list_node) {
+		neigh_release(old_n);
+		neigh_clone(n);
+		__mlxsw_sp_nexthop_neigh_update(nh, !entry_connected);
+		mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nh_grp);
+	}
+
+	neigh_release(n);
+
+	return 0;
+
+err_neigh_entry_insert:
+	neigh_entry->key.n = old_n;
+	mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry);
+	neigh_release(n);
+	return err;
+}
+
 static void
 mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp *mlxsw_sp,
 			      struct mlxsw_sp_neigh_entry *neigh_entry,
-			      bool removing)
+			      bool removing, bool dead)
 {
 	struct mlxsw_sp_nexthop *nh;
 
+	if (list_empty(&neigh_entry->nexthop_list))
+		return;
+
+	if (dead) {
+		int err;
+
+		err = mlxsw_sp_nexthop_dead_neigh_replace(mlxsw_sp,
+							  neigh_entry);
+		if (err)
+			dev_err(mlxsw_sp->bus_info->dev, "Failed to replace dead neigh\n");
+		return;
+	}
+
 	list_for_each_entry(nh, &neigh_entry->nexthop_list,
 			    neigh_list_node) {
 		__mlxsw_sp_nexthop_neigh_update(nh, removing);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/ethernet/ti/cpts.c linux-libre-4.14.159-gnu/drivers/net/ethernet/ti/cpts.c
--- linux-libre-4.14.158-gnu/drivers/net/ethernet/ti/cpts.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/ethernet/ti/cpts.c	2019-12-17 14:40:05.000000000 -0500
@@ -116,9 +116,7 @@ static bool cpts_match_tx_ts(struct cpts
 				mtype, seqid);
 		} else if (time_after(jiffies, skb_cb->tmo)) {
 			/* timeout any expired skbs over 1s */
-			dev_dbg(cpts->dev,
-				"expiring tx timestamp mtype %u seqid %04x\n",
-				mtype, seqid);
+			dev_dbg(cpts->dev, "expiring tx timestamp from txq\n");
 			__skb_unlink(skb, &cpts->txq);
 			dev_consume_skb_any(skb);
 		}
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/wireless/ath/ar5523/ar5523.c linux-libre-4.14.159-gnu/drivers/net/wireless/ath/ar5523/ar5523.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-05 10:24:17.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/ath/ar5523/ar5523.c	2019-12-17 20:52:15.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.14.158-gnu/drivers/net/wireless/ath/ath10k/pci.c linux-libre-4.14.159-gnu/drivers/net/wireless/ath/ath10k/pci.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/ath/ath10k/pci.c	2019-12-05 10:24:45.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/ath/ath10k/pci.c	2019-12-17 20:52:42.000000000 -0500
@@ -1771,6 +1771,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.
@@ -1784,10 +1789,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.14.158-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-12-17 14:40:05.000000000 -0500
@@ -822,6 +822,21 @@ static void iwl_mvm_mac_tx(struct ieee80
 	    !ieee80211_is_bufferable_mmpdu(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.14.158-gnu/drivers/net/wireless/intel/iwlwifi/mvm/sta.c linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/intel/iwlwifi/mvm/sta.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/mvm/sta.c	2019-12-17 14:40:05.000000000 -0500
@@ -436,6 +436,16 @@ static int iwl_mvm_remove_sta_queue_mark
 
 	rcu_read_unlock();
 
+	/*
+	 * The TX path may have been using this TXQ_ID from the tid_data,
+	 * so make sure it's no longer running so that we can safely reuse
+	 * this TXQ later. We've set all the TIDs to IWL_MVM_INVALID_QUEUE
+	 * above, but nothing guarantees we've stopped using them. Thus,
+	 * without this, we could get to iwl_mvm_disable_txq() and remove
+	 * the queue while still sending frames to it.
+	 */
+	synchronize_net();
+
 	return disable_agg_tids;
 }
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c	2019-12-17 14:40:05.000000000 -0500
@@ -232,27 +232,23 @@ static int iwl_pcie_gen2_build_amsdu(str
 	struct ieee80211_hdr *hdr = (void *)skb->data;
 	unsigned int snap_ip_tcp_hdrlen, ip_hdrlen, total_len, hdr_room;
 	unsigned int mss = skb_shinfo(skb)->gso_size;
-	u16 length, iv_len, amsdu_pad;
+	u16 length, amsdu_pad;
 	u8 *start_hdr;
 	struct iwl_tso_hdr_page *hdr_page;
 	struct page **page_ptr;
 	struct tso_t tso;
 
-	/* if the packet is protected, then it must be CCMP or GCMP */
-	iv_len = ieee80211_has_protected(hdr->frame_control) ?
-		IEEE80211_CCMP_HDR_LEN : 0;
-
 	trace_iwlwifi_dev_tx(trans->dev, skb, tfd, sizeof(*tfd),
 			     &dev_cmd->hdr, start_len, 0);
 
 	ip_hdrlen = skb_transport_header(skb) - skb_network_header(skb);
 	snap_ip_tcp_hdrlen = 8 + ip_hdrlen + tcp_hdrlen(skb);
-	total_len = skb->len - snap_ip_tcp_hdrlen - hdr_len - iv_len;
+	total_len = skb->len - snap_ip_tcp_hdrlen - hdr_len;
 	amsdu_pad = 0;
 
 	/* total amount of header we may need for this A-MSDU */
 	hdr_room = DIV_ROUND_UP(total_len, mss) *
-		(3 + snap_ip_tcp_hdrlen + sizeof(struct ethhdr)) + iv_len;
+		(3 + snap_ip_tcp_hdrlen + sizeof(struct ethhdr));
 
 	/* Our device supports 9 segments at most, it will fit in 1 page */
 	hdr_page = get_page_hdr(trans, hdr_room);
@@ -263,14 +259,12 @@ static int iwl_pcie_gen2_build_amsdu(str
 	start_hdr = hdr_page->pos;
 	page_ptr = (void *)((u8 *)skb->cb + trans_pcie->page_offs);
 	*page_ptr = hdr_page->page;
-	memcpy(hdr_page->pos, skb->data + hdr_len, iv_len);
-	hdr_page->pos += iv_len;
 
 	/*
-	 * Pull the ieee80211 header + IV to be able to use TSO core,
+	 * Pull the ieee80211 header to be able to use TSO core,
 	 * we will restore it for the tx_status flow.
 	 */
-	skb_pull(skb, hdr_len + iv_len);
+	skb_pull(skb, hdr_len);
 
 	/*
 	 * Remove the length of all the headers that we don't actually
@@ -348,8 +342,8 @@ static int iwl_pcie_gen2_build_amsdu(str
 		}
 	}
 
-	/* re -add the WiFi header and IV */
-	skb_push(skb, hdr_len + iv_len);
+	/* re -add the WiFi header */
+	skb_push(skb, hdr_len);
 
 	return 0;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c	2019-12-17 14:40:05.000000000 -0500
@@ -1198,6 +1198,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)
@@ -1207,7 +1208,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)
@@ -1378,7 +1379,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);
@@ -1398,9 +1399,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.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-05 10:26:22.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c	2019-12-17 20:54:18.000000000 -0500
@@ -237,6 +237,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.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c	2019-12-17 14:40:05.000000000 -0500
@@ -839,13 +839,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:
 			WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
@@ -856,6 +858,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.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h
--- linux-libre-4.14.158-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.h	2019-12-17 14:40:05.000000000 -0500
@@ -736,6 +736,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.14.158-gnu/drivers/net/wireless/rsi/rsi_91x_mgmt.c linux-libre-4.14.159-gnu/drivers/net/wireless/rsi/rsi_91x_mgmt.c
--- linux-libre-4.14.158-gnu/drivers/net/wireless/rsi/rsi_91x_mgmt.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/net/wireless/rsi/rsi_91x_mgmt.c	2019-12-17 14:40:05.000000000 -0500
@@ -1576,6 +1576,7 @@ static int rsi_send_beacon(struct rsi_co
 		skb_pull(skb, (64 - dword_align_bytes));
 	if (rsi_prepare_beacon(common, skb)) {
 		rsi_dbg(ERR_ZONE, "Failed to prepare beacon\n");
+		dev_kfree_skb(skb);
 		return -EINVAL;
 	}
 	skb_queue_tail(&common->tx_queue[MGMT_BEACON_Q], skb);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/nfc/nxp-nci/i2c.c linux-libre-4.14.159-gnu/drivers/nfc/nxp-nci/i2c.c
--- linux-libre-4.14.158-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/nfc/nxp-nci/i2c.c	2019-12-17 14:40:05.000000000 -0500
@@ -236,8 +236,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.14.158-gnu/drivers/of/unittest.c linux-libre-4.14.159-gnu/drivers/of/unittest.c
--- linux-libre-4.14.158-gnu/drivers/of/unittest.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/of/unittest.c	2019-12-17 14:40:05.000000000 -0500
@@ -965,8 +965,10 @@ static void attach_node_and_children(str
 	full_name = kasprintf(GFP_KERNEL, "%pOF", np);
 
 	if (!strcmp(full_name, "/__local_fixups__") ||
-	    !strcmp(full_name, "/__fixups__"))
+	    !strcmp(full_name, "/__fixups__")) {
+		kfree(full_name);
 		return;
+	}
 
 	dup = of_find_node_by_path(full_name);
 	kfree(full_name);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/phy/renesas/phy-rcar-gen3-usb2.c linux-libre-4.14.159-gnu/drivers/phy/renesas/phy-rcar-gen3-usb2.c
--- linux-libre-4.14.158-gnu/drivers/phy/renesas/phy-rcar-gen3-usb2.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/phy/renesas/phy-rcar-gen3-usb2.c	2019-12-17 14:40:05.000000000 -0500
@@ -22,6 +22,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/string.h>
 #include <linux/workqueue.h>
 
 /******* USB2.0 Host registers (original offset is +0x200) *******/
@@ -234,9 +235,9 @@ static ssize_t role_store(struct device
 	 */
 	is_b_device = rcar_gen3_check_id(ch);
 	is_host = rcar_gen3_is_host(ch);
-	if (!strncmp(buf, "host", strlen("host")))
+	if (sysfs_streq(buf, "host"))
 		new_mode_is_host = true;
-	else if (!strncmp(buf, "peripheral", strlen("peripheral")))
+	else if (sysfs_streq(buf, "peripheral"))
 		new_mode_is_host = false;
 	else
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c linux-libre-4.14.159-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
--- linux-libre-4.14.158-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/pinctrl/samsung/pinctrl-exynos.c linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-exynos.c
--- linux-libre-4.14.158-gnu/drivers/pinctrl/samsung/pinctrl-exynos.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-exynos.c	2019-12-17 14:40:05.000000000 -0500
@@ -467,8 +467,10 @@ int exynos_eint_wkup_init(struct samsung
 		if (match) {
 			irq_chip = kmemdup(match->data,
 				sizeof(*irq_chip), GFP_KERNEL);
-			if (!irq_chip)
+			if (!irq_chip) {
+				of_node_put(np);
 				return -ENOMEM;
+			}
 			wkup_np = np;
 			break;
 		}
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c
--- linux-libre-4.14.158-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-s3c24xx.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c
--- linux-libre-4.14.158-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-s3c64xx.c	2019-12-17 14:40:05.000000000 -0500
@@ -709,8 +709,10 @@ static int s3c64xx_eint_eint0_init(struc
 		return -ENODEV;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
+	if (!data) {
+		of_node_put(eint0_np);
 		return -ENOMEM;
+	}
 	data->drvdata = d;
 
 	for (i = 0; i < NUM_EINT0_IRQ; ++i) {
@@ -719,6 +721,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;
 		}
 
@@ -726,6 +729,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.14.158-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c
--- linux-libre-4.14.158-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/pinctrl/samsung/pinctrl-samsung.c	2019-12-17 14:40:05.000000000 -0500
@@ -277,6 +277,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;
 		}
 	}
@@ -761,8 +762,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;
@@ -773,8 +776,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.14.158-gnu/drivers/power/supply/cpcap-battery.c linux-libre-4.14.159-gnu/drivers/power/supply/cpcap-battery.c
--- linux-libre-4.14.158-gnu/drivers/power/supply/cpcap-battery.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/power/supply/cpcap-battery.c	2019-12-17 14:40:05.000000000 -0500
@@ -82,7 +82,7 @@ struct cpcap_battery_config {
 };
 
 struct cpcap_coulomb_counter_data {
-	s32 sample;		/* 24-bits */
+	s32 sample;		/* 24 or 32 bits */
 	s32 accumulator;
 	s16 offset;		/* 10-bits */
 };
@@ -213,7 +213,7 @@ static int cpcap_battery_get_current(str
  * TI or ST coulomb counter in the PMIC.
  */
 static int cpcap_battery_cc_raw_div(struct cpcap_battery_ddata *ddata,
-				    u32 sample, s32 accumulator,
+				    s32 sample, s32 accumulator,
 				    s16 offset, u32 divider)
 {
 	s64 acc;
@@ -224,7 +224,6 @@ static int cpcap_battery_cc_raw_div(stru
 	if (!divider)
 		return 0;
 
-	sample &= 0xffffff;		/* 24-bits, unsigned */
 	offset &= 0x7ff;		/* 10-bits, signed */
 
 	switch (ddata->vendor) {
@@ -259,7 +258,7 @@ static int cpcap_battery_cc_raw_div(stru
 
 /* 3600000μAms = 1μAh */
 static int cpcap_battery_cc_to_uah(struct cpcap_battery_ddata *ddata,
-				   u32 sample, s32 accumulator,
+				   s32 sample, s32 accumulator,
 				   s16 offset)
 {
 	return cpcap_battery_cc_raw_div(ddata, sample,
@@ -268,7 +267,7 @@ static int cpcap_battery_cc_to_uah(struc
 }
 
 static int cpcap_battery_cc_to_ua(struct cpcap_battery_ddata *ddata,
-				  u32 sample, s32 accumulator,
+				  s32 sample, s32 accumulator,
 				  s16 offset)
 {
 	return cpcap_battery_cc_raw_div(ddata, sample,
@@ -312,6 +311,8 @@ cpcap_battery_read_accumulated(struct cp
 	/* Sample value CPCAP_REG_CCS1 & 2 */
 	ccd->sample = (buf[1] & 0x0fff) << 16;
 	ccd->sample |= buf[0];
+	if (ddata->vendor == CPCAP_VENDOR_TI)
+		ccd->sample = sign_extend32(24, ccd->sample);
 
 	/* Accumulator value CPCAP_REG_CCA1 & 2 */
 	ccd->accumulator = ((s16)buf[3]) << 16;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/rtc/rtc-max8997.c linux-libre-4.14.159-gnu/drivers/rtc/rtc-max8997.c
--- linux-libre-4.14.158-gnu/drivers/rtc/rtc-max8997.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/rtc/rtc-max8997.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/rtc/rtc-s3c.c linux-libre-4.14.159-gnu/drivers/rtc/rtc-s3c.c
--- linux-libre-4.14.158-gnu/drivers/rtc/rtc-s3c.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/rtc/rtc-s3c.c	2019-12-17 14:40:05.000000000 -0500
@@ -327,7 +327,6 @@ static int s3c_rtc_setalarm(struct devic
 	struct rtc_time *tm = &alrm->time;
 	unsigned int alrm_en;
 	int ret;
-	int year = tm->tm_year - 100;
 
 	dev_dbg(dev, "s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n",
 		alrm->enabled,
@@ -356,11 +355,6 @@ static int s3c_rtc_setalarm(struct devic
 		writeb(bin2bcd(tm->tm_hour), info->base + S3C2410_ALMHOUR);
 	}
 
-	if (year < 100 && year >= 0) {
-		alrm_en |= S3C2410_RTCALM_YEAREN;
-		writeb(bin2bcd(year), info->base + S3C2410_ALMYEAR);
-	}
-
 	if (tm->tm_mon < 12 && tm->tm_mon >= 0) {
 		alrm_en |= S3C2410_RTCALM_MONEN;
 		writeb(bin2bcd(tm->tm_mon + 1), info->base + S3C2410_ALMMON);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/s390/scsi/zfcp_dbf.c linux-libre-4.14.159-gnu/drivers/s390/scsi/zfcp_dbf.c
--- linux-libre-4.14.158-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/s390/scsi/zfcp_dbf.c	2019-12-17 14:40:05.000000000 -0500
@@ -94,11 +94,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.14.158-gnu/drivers/s390/scsi/zfcp_erp.c linux-libre-4.14.159-gnu/drivers/s390/scsi/zfcp_erp.c
--- linux-libre-4.14.158-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/s390/scsi/zfcp_erp.c	2019-12-17 14:40:05.000000000 -0500
@@ -179,9 +179,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.14.158-gnu/drivers/scsi/lpfc/lpfc_attr.c linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_attr.c
--- linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_attr.c	2019-12-17 14:40:05.000000000 -0500
@@ -1478,6 +1478,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)
@@ -1493,8 +1496,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.14.158-gnu/drivers/scsi/lpfc/lpfc.h linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc.h
--- linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc.h	2019-12-17 14:40:05.000000000 -0500
@@ -969,7 +969,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.14.158-gnu/drivers/scsi/lpfc/lpfc_init.c linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_init.c
--- linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-05 10:30:32.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-12-17 20:58:24.000000000 -0500
@@ -7643,6 +7643,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.14.158-gnu/drivers/scsi/lpfc/lpfc_nvme.c linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_nvme.c
--- linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc_nvme.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_nvme.c	2019-12-17 14:40:05.000000000 -0500
@@ -1544,7 +1544,6 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local
 	bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG);
 
 	/* word 7 */
-	bf_set(wqe_ct, &abts_wqe->abort_cmd.wqe_com, 0);
 	bf_set(wqe_cmnd, &abts_wqe->abort_cmd.wqe_com, CMD_ABORT_XRI_CX);
 	bf_set(wqe_class, &abts_wqe->abort_cmd.wqe_com,
 	       nvmereq_wqe->iocb.ulpClass);
@@ -1559,7 +1558,6 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local
 	       abts_buf->iotag);
 
 	/* word 10 */
-	bf_set(wqe_wqid, &abts_wqe->abort_cmd.wqe_com, nvmereq_wqe->hba_wqidx);
 	bf_set(wqe_qosd, &abts_wqe->abort_cmd.wqe_com, 1);
 	bf_set(wqe_lenloc, &abts_wqe->abort_cmd.wqe_com, LPFC_WQE_LENLOC_NONE);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc_sli.c linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_sli.c
--- linux-libre-4.14.158-gnu/drivers/scsi/lpfc/lpfc_sli.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/lpfc/lpfc_sli.c	2019-12-17 14:40:05.000000000 -0500
@@ -10722,19 +10722,12 @@ lpfc_sli4_abort_nvme_io(struct lpfc_hba
 
 	/* Complete prepping the abort wqe and issue to the FW. */
 	abts_wqe = &abtsiocbp->wqe;
-	bf_set(abort_cmd_ia, &abts_wqe->abort_cmd, 0);
-	bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG);
 
-	/* Explicitly set reserved fields to zero.*/
-	abts_wqe->abort_cmd.rsrvd4 = 0;
-	abts_wqe->abort_cmd.rsrvd5 = 0;
-
-	/* WQE Common - word 6.  Context is XRI tag.  Set 0. */
-	bf_set(wqe_xri_tag, &abts_wqe->abort_cmd.wqe_com, 0);
-	bf_set(wqe_ctxt_tag, &abts_wqe->abort_cmd.wqe_com, 0);
+	/* Clear any stale WQE contents */
+	memset(abts_wqe, 0, sizeof(union lpfc_wqe));
+	bf_set(abort_cmd_criteria, &abts_wqe->abort_cmd, T_XRI_TAG);
 
 	/* word 7 */
-	bf_set(wqe_ct, &abts_wqe->abort_cmd.wqe_com, 0);
 	bf_set(wqe_cmnd, &abts_wqe->abort_cmd.wqe_com, CMD_ABORT_XRI_CX);
 	bf_set(wqe_class, &abts_wqe->abort_cmd.wqe_com,
 	       cmdiocb->iocb.ulpClass);
@@ -10749,7 +10742,6 @@ lpfc_sli4_abort_nvme_io(struct lpfc_hba
 	       abtsiocbp->iotag);
 
 	/* word 10 */
-	bf_set(wqe_wqid, &abts_wqe->abort_cmd.wqe_com, cmdiocb->hba_wqidx);
 	bf_set(wqe_qosd, &abts_wqe->abort_cmd.wqe_com, 1);
 	bf_set(wqe_lenloc, &abts_wqe->abort_cmd.wqe_com, LPFC_WQE_LENLOC_NONE);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_attr.c linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_attr.c
--- linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_attr.c	2019-12-17 14:40:05.000000000 -0500
@@ -652,7 +652,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.14.158-gnu/drivers/scsi/qla2xxx/qla_bsg.c linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_bsg.c
--- linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_bsg.c	2019-12-17 14:40:05.000000000 -0500
@@ -342,6 +342,8 @@ qla2x00_process_els(struct bsg_job *bsg_
 		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;
 	}
@@ -349,6 +351,8 @@ qla2x00_process_els(struct bsg_job *bsg_
 	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;
 	}
@@ -1778,8 +1782,8 @@ qla24xx_process_bidir_cmd(struct bsg_job
 	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)) {
@@ -1884,6 +1888,9 @@ qla24xx_process_bidir_cmd(struct bsg_job
 		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,
@@ -1891,10 +1898,6 @@ qla24xx_process_bidir_cmd(struct bsg_job
 		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.14.158-gnu/drivers/scsi/qla2xxx/qla_init.c linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_init.c
--- linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_init.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_init.c	2019-12-17 14:40:05.000000000 -0500
@@ -8092,8 +8092,6 @@ int qla2xxx_delete_qpair(struct scsi_qla
 	struct qla_hw_data *ha = qpair->hw;
 
 	qpair->delete_in_progress = 1;
-	while (atomic_read(&qpair->ref_count))
-		msleep(500);
 
 	ret = qla25xx_delete_req_que(vha, qpair->req);
 	if (ret != QLA_SUCCESS)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_isr.c linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_isr.c
--- linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_isr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_isr.c	2019-12-17 14:40:05.000000000 -0500
@@ -3369,10 +3369,8 @@ qla24xx_enable_msix(struct qla_hw_data *
 		    ha->msix_count, ret);
 		goto msix_out;
 	} else if (ret < ha->msix_count) {
-		ql_log(ql_log_warn, vha, 0x00c6,
-		    "MSI-X: Failed to enable support "
-		     "with %d vectors, using %d vectors.\n",
-		    ha->msix_count, ret);
+		ql_log(ql_log_info, vha, 0x00c6,
+		    "MSI-X: Using %d vectors\n", ret);
 		ha->msix_count = ret;
 		/* Recalculate queue values */
 		if (ha->mqiobase && ql2xmqsupport) {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_target.c linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_target.c
--- linux-libre-4.14.158-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/scsi/qla2xxx/qla_target.c	2019-12-17 14:40:05.000000000 -0500
@@ -5918,7 +5918,6 @@ static void qlt_abort_work(struct qla_tg
 	struct qla_hw_data *ha = vha->hw;
 	struct fc_port *sess = NULL;
 	unsigned long flags = 0, flags2 = 0;
-	uint32_t be_s_id;
 	uint8_t s_id[3];
 	int rc;
 
@@ -5931,8 +5930,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);
 
@@ -6396,7 +6394,8 @@ qlt_enable_vha(struct scsi_qla_host *vha
 	} else {
 		set_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags);
 		qla2xxx_wake_dpc(base_vha);
-		qla2x00_wait_for_hba_online(base_vha);
+		WARN_ON_ONCE(qla2x00_wait_for_hba_online(base_vha) !=
+			     QLA_SUCCESS);
 	}
 }
 EXPORT_SYMBOL(qlt_enable_vha);
@@ -6426,7 +6425,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.14.158-gnu/drivers/spi/spi-atmel.c linux-libre-4.14.159-gnu/drivers/spi/spi-atmel.c
--- linux-libre-4.14.158-gnu/drivers/spi/spi-atmel.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/spi/spi-atmel.c	2019-12-17 14:40:05.000000000 -0500
@@ -1150,10 +1150,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.14.158-gnu/drivers/staging/iio/addac/adt7316-i2c.c linux-libre-4.14.159-gnu/drivers/staging/iio/addac/adt7316-i2c.c
--- linux-libre-4.14.158-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/staging/iio/addac/adt7316-i2c.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c linux-libre-4.14.159-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c
--- linux-libre-4.14.158-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/staging/rtl8188eu/os_dep/usb_intf.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/staging/rtl8712/usb_intf.c linux-libre-4.14.159-gnu/drivers/staging/rtl8712/usb_intf.c
--- linux-libre-4.14.158-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/staging/rtl8712/usb_intf.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/thermal/thermal_core.c linux-libre-4.14.159-gnu/drivers/thermal/thermal_core.c
--- linux-libre-4.14.158-gnu/drivers/thermal/thermal_core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/thermal/thermal_core.c	2019-12-17 14:40:05.000000000 -0500
@@ -299,7 +299,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)
@@ -1350,7 +1350,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);
 
 	thermal_set_governor(tz, NULL);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/tty/n_hdlc.c linux-libre-4.14.159-gnu/drivers/tty/n_hdlc.c
--- linux-libre-4.14.158-gnu/drivers/tty/n_hdlc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/n_hdlc.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/tty/n_r3964.c linux-libre-4.14.159-gnu/drivers/tty/n_r3964.c
--- linux-libre-4.14.158-gnu/drivers/tty/n_r3964.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/n_r3964.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/tty/n_tty.c linux-libre-4.14.159-gnu/drivers/tty/n_tty.c
--- linux-libre-4.14.158-gnu/drivers/tty/n_tty.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/n_tty.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/tty/serial/amba-pl011.c linux-libre-4.14.159-gnu/drivers/tty/serial/amba-pl011.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/amba-pl011.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/amba-pl011.c	2019-12-17 14:40:05.000000000 -0500
@@ -829,10 +829,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.14.158-gnu/drivers/tty/serial/fsl_lpuart.c linux-libre-4.14.159-gnu/drivers/tty/serial/fsl_lpuart.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/fsl_lpuart.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/fsl_lpuart.c	2019-12-17 14:40:05.000000000 -0500
@@ -380,8 +380,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.14.158-gnu/drivers/tty/serial/ifx6x60.c linux-libre-4.14.159-gnu/drivers/tty/serial/ifx6x60.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/ifx6x60.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/ifx6x60.c	2019-12-17 14:40:05.000000000 -0500
@@ -1245,6 +1245,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.14.158-gnu/drivers/tty/serial/imx.c linux-libre-4.14.159-gnu/drivers/tty/serial/imx.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/imx.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/imx.c	2019-12-17 14:40:05.000000000 -0500
@@ -1956,7 +1956,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.14.158-gnu/drivers/tty/serial/msm_serial.c linux-libre-4.14.159-gnu/drivers/tty/serial/msm_serial.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/msm_serial.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/msm_serial.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/tty/serial/serial_core.c linux-libre-4.14.159-gnu/drivers/tty/serial/serial_core.c
--- linux-libre-4.14.158-gnu/drivers/tty/serial/serial_core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/serial/serial_core.c	2019-12-17 14:40:05.000000000 -0500
@@ -1125,7 +1125,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.14.158-gnu/drivers/tty/tty_ldisc.c linux-libre-4.14.159-gnu/drivers/tty/tty_ldisc.c
--- linux-libre-4.14.158-gnu/drivers/tty/tty_ldisc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/tty_ldisc.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/tty/vt/keyboard.c linux-libre-4.14.159-gnu/drivers/tty/vt/keyboard.c
--- linux-libre-4.14.158-gnu/drivers/tty/vt/keyboard.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/tty/vt/keyboard.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/usb/atm/ueagle-atm.c linux-libre-4.14.159-gnu/drivers/usb/atm/ueagle-atm.c
--- linux-libre-4.14.158-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-05 10:30:53.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/atm/ueagle-atm.c	2019-12-17 20:58:45.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.14.158-gnu/drivers/usb/core/hub.c linux-libre-4.14.159-gnu/drivers/usb/core/hub.c
--- linux-libre-4.14.158-gnu/drivers/usb/core/hub.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/core/hub.c	2019-12-17 14:40:05.000000000 -0500
@@ -5630,7 +5630,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
@@ -5658,8 +5658,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.14.158-gnu/drivers/usb/core/urb.c linux-libre-4.14.159-gnu/drivers/usb/core/urb.c
--- linux-libre-4.14.158-gnu/drivers/usb/core/urb.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/core/urb.c	2019-12-17 14:40:05.000000000 -0500
@@ -45,6 +45,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.14.158-gnu/drivers/usb/dwc3/core.c linux-libre-4.14.159-gnu/drivers/usb/dwc3/core.c
--- linux-libre-4.14.158-gnu/drivers/usb/dwc3/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/dwc3/core.c	2019-12-17 14:40:05.000000000 -0500
@@ -1261,7 +1261,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.14.158-gnu/drivers/usb/dwc3/debugfs.c linux-libre-4.14.159-gnu/drivers/usb/dwc3/debugfs.c
--- linux-libre-4.14.158-gnu/drivers/usb/dwc3/debugfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/dwc3/debugfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -436,13 +436,17 @@ static int dwc3_link_state_show(struct s
 	unsigned long		flags;
 	enum dwc3_link_state	state;
 	u32			reg;
+	u8			speed;
 
 	spin_lock_irqsave(&dwc->lock, flags);
 	reg = dwc3_readl(dwc->regs, DWC3_DSTS);
 	state = DWC3_DSTS_USBLNKST(reg);
-	spin_unlock_irqrestore(&dwc->lock, flags);
+	speed = reg & DWC3_DSTS_CONNECTSPD;
 
-	seq_printf(s, "%s\n", dwc3_gadget_link_string(state));
+	seq_printf(s, "%s\n", (speed >= DWC3_DSTS_SUPERSPEED) ?
+		   dwc3_gadget_link_string(state) :
+		   dwc3_gadget_hs_link_string(state));
+	spin_unlock_irqrestore(&dwc->lock, flags);
 
 	return 0;
 }
@@ -460,6 +464,8 @@ static ssize_t dwc3_link_state_write(str
 	unsigned long		flags;
 	enum dwc3_link_state	state = 0;
 	char			buf[32];
+	u32			reg;
+	u8			speed;
 
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
@@ -480,6 +486,15 @@ static ssize_t dwc3_link_state_write(str
 		return -EINVAL;
 
 	spin_lock_irqsave(&dwc->lock, flags);
+	reg = dwc3_readl(dwc->regs, DWC3_DSTS);
+	speed = reg & DWC3_DSTS_CONNECTSPD;
+
+	if (speed < DWC3_DSTS_SUPERSPEED &&
+	    state != DWC3_LINK_STATE_RECOV) {
+		spin_unlock_irqrestore(&dwc->lock, flags);
+		return -EINVAL;
+	}
+
 	dwc3_gadget_set_link_state(dwc, state);
 	spin_unlock_irqrestore(&dwc->lock, flags);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/dwc3/debug.h linux-libre-4.14.159-gnu/drivers/usb/dwc3/debug.h
--- linux-libre-4.14.158-gnu/drivers/usb/dwc3/debug.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/dwc3/debug.h	2019-12-17 14:40:05.000000000 -0500
@@ -125,6 +125,35 @@ dwc3_gadget_link_string(enum dwc3_link_s
 }
 
 /**
+ * dwc3_gadget_hs_link_string - returns highspeed and below link name
+ * @link_state: link state code
+ */
+static inline const char *
+dwc3_gadget_hs_link_string(enum dwc3_link_state link_state)
+{
+	switch (link_state) {
+	case DWC3_LINK_STATE_U0:
+		return "On";
+	case DWC3_LINK_STATE_U2:
+		return "Sleep";
+	case DWC3_LINK_STATE_U3:
+		return "Suspend";
+	case DWC3_LINK_STATE_SS_DIS:
+		return "Disconnected";
+	case DWC3_LINK_STATE_RX_DET:
+		return "Early Suspend";
+	case DWC3_LINK_STATE_RECOV:
+		return "Recovery";
+	case DWC3_LINK_STATE_RESET:
+		return "Reset";
+	case DWC3_LINK_STATE_RESUME:
+		return "Resume";
+	default:
+		return "UNKNOWN link state\n";
+	}
+}
+
+/**
  * dwc3_trb_type_string - returns TRB type as a string
  * @type: the type of the TRB
  */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/dwc3/ep0.c linux-libre-4.14.159-gnu/drivers/usb/dwc3/ep0.c
--- linux-libre-4.14.158-gnu/drivers/usb/dwc3/ep0.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/dwc3/ep0.c	2019-12-17 14:40:05.000000000 -0500
@@ -1147,6 +1147,9 @@ static void dwc3_ep0_xfernotready(struct
 void dwc3_ep0_interrupt(struct dwc3 *dwc,
 		const struct dwc3_event_depevt *event)
 {
+	struct dwc3_ep	*dep = dwc->eps[event->endpoint_number];
+	u8		cmd;
+
 	switch (event->endpoint_event) {
 	case DWC3_DEPEVT_XFERCOMPLETE:
 		dwc3_ep0_xfer_complete(dwc, event);
@@ -1159,7 +1162,12 @@ void dwc3_ep0_interrupt(struct dwc3 *dwc
 	case DWC3_DEPEVT_XFERINPROGRESS:
 	case DWC3_DEPEVT_RXTXFIFOEVT:
 	case DWC3_DEPEVT_STREAMEVT:
+		break;
 	case DWC3_DEPEVT_EPCMDCMPLT:
+		cmd = DEPEVT_PARAMETER_CMD(event->parameters);
+
+		if (cmd == DWC3_DEPCMD_ENDTRANSFER)
+			dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
 		break;
 	}
 }
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/gadget/configfs.c linux-libre-4.14.159-gnu/drivers/usb/gadget/configfs.c
--- linux-libre-4.14.158-gnu/drivers/usb/gadget/configfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/gadget/configfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -1543,6 +1543,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.14.158-gnu/drivers/usb/gadget/function/u_serial.c linux-libre-4.14.159-gnu/drivers/usb/gadget/function/u_serial.c
--- linux-libre-4.14.158-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/gadget/function/u_serial.c	2019-12-17 14:40:05.000000000 -0500
@@ -1392,8 +1392,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.14.158-gnu/drivers/usb/gadget/udc/pch_udc.c linux-libre-4.14.159-gnu/drivers/usb/gadget/udc/pch_udc.c
--- linux-libre-4.14.158-gnu/drivers/usb/gadget/udc/pch_udc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/gadget/udc/pch_udc.c	2019-12-17 14:40:05.000000000 -0500
@@ -1523,7 +1523,6 @@ static void pch_udc_free_dma_chain(struc
 		td = phys_to_virt(addr);
 		addr2 = (dma_addr_t)td->next;
 		dma_pool_free(dev->data_requests, td, addr);
-		td->next = 0x00;
 		addr = addr2;
 	}
 	req->chain_len = 1;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/host/xhci.c linux-libre-4.14.159-gnu/drivers/usb/host/xhci.c
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci.c	2019-12-17 14:40:05.000000000 -0500
@@ -717,7 +717,7 @@ static void xhci_stop(struct usb_hcd *hc
  *
  * This will only ever be called with the main usb_hcd (the USB3 roothub).
  */
-static void xhci_shutdown(struct usb_hcd *hcd)
+void xhci_shutdown(struct usb_hcd *hcd)
 {
 	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 
@@ -736,11 +736,8 @@ static void xhci_shutdown(struct usb_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.sysdev), PCI_D3hot);
 }
+EXPORT_SYMBOL_GPL(xhci_shutdown);
 
 #ifdef CONFIG_PM
 static void xhci_save_registers(struct xhci_hcd *xhci)
@@ -911,7 +908,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;
 	u32			res;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/host/xhci.h linux-libre-4.14.159-gnu/drivers/usb/host/xhci.h
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci.h	2019-12-17 14:40:05.000000000 -0500
@@ -2022,6 +2022,7 @@ int xhci_start(struct xhci_hcd *xhci);
 int xhci_reset(struct xhci_hcd *xhci);
 int xhci_run(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);
 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/host/xhci-hub.c linux-libre-4.14.159-gnu/drivers/usb/host/xhci-hub.c
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci-hub.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci-hub.c	2019-12-17 14:40:05.000000000 -0500
@@ -855,7 +855,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)
 {
@@ -937,12 +937,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,
@@ -1090,7 +1090,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.14.158-gnu/drivers/usb/host/xhci-mem.c linux-libre-4.14.159-gnu/drivers/usb/host/xhci-mem.c
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci-mem.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci-mem.c	2019-12-17 14:40:05.000000000 -0500
@@ -1866,10 +1866,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.14.158-gnu/drivers/usb/host/xhci-pci.c linux-libre-4.14.159-gnu/drivers/usb/host/xhci-pci.c
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci-pci.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci-pci.c	2019-12-17 14:40:05.000000000 -0500
@@ -499,6 +499,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 */
@@ -534,6 +546,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.14.158-gnu/drivers/usb/host/xhci-ring.c linux-libre-4.14.159-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-4.14.158-gnu/drivers/usb/host/xhci-ring.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/host/xhci-ring.c	2019-12-17 14:40:05.000000000 -0500
@@ -2398,7 +2398,8 @@ static int handle_tx_event(struct xhci_h
 	case COMP_SUCCESS:
 		if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0)
 			break;
-		if (xhci->quirks & XHCI_TRUST_TX_LENGTH)
+		if (xhci->quirks & XHCI_TRUST_TX_LENGTH ||
+		    ep_ring->last_td_was_short)
 			trb_comp_code = COMP_SHORT_PACKET;
 		else
 			xhci_warn_ratelimited(xhci,
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/misc/adutux.c linux-libre-4.14.159-gnu/drivers/usb/misc/adutux.c
--- linux-libre-4.14.158-gnu/drivers/usb/misc/adutux.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/misc/adutux.c	2019-12-17 14:40:05.000000000 -0500
@@ -671,7 +671,7 @@ static int adu_probe(struct usb_interfac
 	init_waitqueue_head(&dev->read_wait);
 	init_waitqueue_head(&dev->write_wait);
 
-	res = usb_find_common_endpoints_reverse(&interface->altsetting[0],
+	res = usb_find_common_endpoints_reverse(interface->cur_altsetting,
 			NULL, NULL,
 			&dev->interrupt_in_endpoint,
 			&dev->interrupt_out_endpoint);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/misc/idmouse.c linux-libre-4.14.159-gnu/drivers/usb/misc/idmouse.c
--- linux-libre-4.14.158-gnu/drivers/usb/misc/idmouse.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/misc/idmouse.c	2019-12-17 14:40:05.000000000 -0500
@@ -341,7 +341,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.14.158-gnu/drivers/usb/mon/mon_bin.c linux-libre-4.14.159-gnu/drivers/usb/mon/mon_bin.c
--- linux-libre-4.14.158-gnu/drivers/usb/mon/mon_bin.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/mon/mon_bin.c	2019-12-17 14:40:05.000000000 -0500
@@ -1038,12 +1038,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);
 		}
@@ -1215,13 +1221,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);
 }
 
 /*
@@ -1233,16 +1247,12 @@ static int mon_bin_vma_fault(struct vm_f
 	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.14.158-gnu/drivers/usb/mtu3/mtu3_qmu.c linux-libre-4.14.159-gnu/drivers/usb/mtu3/mtu3_qmu.c
--- linux-libre-4.14.158-gnu/drivers/usb/mtu3/mtu3_qmu.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/mtu3/mtu3_qmu.c	2019-12-17 14:40:05.000000000 -0500
@@ -372,7 +372,7 @@ static void qmu_tx_zlp_error_handler(str
 		return;
 	}
 
-	dev_dbg(mtu->dev, "%s send ZLP for req=%p\n", __func__, mreq);
+	dev_dbg(mtu->dev, "%s send ZLP for req=%p\n", __func__, req);
 
 	mtu3_clrbits(mbase, MU3D_EP_TXCR0(mep->epnum), TX_DMAREQEN);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/drivers/usb/serial/io_edgeport.c linux-libre-4.14.159-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-4.14.158-gnu/drivers/usb/serial/io_edgeport.c	2019-12-05 10:31:20.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/serial/io_edgeport.c	2019-12-17 20:59:12.000000000 -0500
@@ -2918,16 +2918,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.14.158-gnu/drivers/usb/storage/uas.c linux-libre-4.14.159-gnu/drivers/usb/storage/uas.c
--- linux-libre-4.14.158-gnu/drivers/usb/storage/uas.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/usb/storage/uas.c	2019-12-17 14:40:05.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.14.158-gnu/drivers/video/hdmi.c linux-libre-4.14.159-gnu/drivers/video/hdmi.c
--- linux-libre-4.14.158-gnu/drivers/video/hdmi.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/video/hdmi.c	2019-12-17 14:40:05.000000000 -0500
@@ -1036,12 +1036,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.14.158-gnu/drivers/virtio/virtio_balloon.c linux-libre-4.14.159-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-4.14.158-gnu/drivers/virtio/virtio_balloon.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/virtio/virtio_balloon.c	2019-12-17 14:40:05.000000000 -0500
@@ -492,6 +492,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.14.158-gnu/drivers/watchdog/aspeed_wdt.c linux-libre-4.14.159-gnu/drivers/watchdog/aspeed_wdt.c
--- linux-libre-4.14.158-gnu/drivers/watchdog/aspeed_wdt.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/drivers/watchdog/aspeed_wdt.c	2019-12-17 14:40:05.000000000 -0500
@@ -204,11 +204,6 @@ static int aspeed_wdt_probe(struct platf
 	if (IS_ERR(wdt->base))
 		return PTR_ERR(wdt->base);
 
-	/*
-	 * The ast2400 wdt can run at PCLK, or 1MHz. The ast2500 only
-	 * runs at 1MHz. We chose to always run at 1MHz, as there's no
-	 * good reason to have a faster watchdog counter.
-	 */
 	wdt->wdd.info = &aspeed_wdt_info;
 	wdt->wdd.ops = &aspeed_wdt_ops;
 	wdt->wdd.max_hw_heartbeat_ms = WDT_MAX_TIMEOUT_MS;
@@ -224,7 +219,16 @@ static int aspeed_wdt_probe(struct platf
 		return -EINVAL;
 	config = ofdid->data;
 
-	wdt->ctrl = WDT_CTRL_1MHZ_CLK;
+	/*
+	 * On clock rates:
+	 *  - ast2400 wdt can run at PCLK, or 1MHz
+	 *  - ast2500 only runs at 1MHz, hard coding bit 4 to 1
+	 *  - ast2600 always runs at 1MHz
+	 *
+	 * Set the ast2400 to run at 1MHz as it simplifies the driver.
+	 */
+	if (of_device_is_compatible(np, "aspeed,ast2400-wdt"))
+		wdt->ctrl = WDT_CTRL_1MHZ_CLK;
 
 	/*
 	 * Control reset on a per-device basis to ensure the
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/autofs4/expire.c linux-libre-4.14.159-gnu/fs/autofs4/expire.c
--- linux-libre-4.14.158-gnu/fs/autofs4/expire.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/autofs4/expire.c	2019-12-17 14:40:05.000000000 -0500
@@ -472,9 +472,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.14.158-gnu/fs/btrfs/delayed-inode.c linux-libre-4.14.159-gnu/fs/btrfs/delayed-inode.c
--- linux-libre-4.14.158-gnu/fs/btrfs/delayed-inode.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/delayed-inode.c	2019-12-17 14:40:05.000000000 -0500
@@ -1975,12 +1975,19 @@ void btrfs_kill_all_delayed_nodes(struct
 		}
 
 		inode_id = delayed_nodes[n - 1]->inode_id + 1;
-
-		for (i = 0; i < n; i++)
-			refcount_inc(&delayed_nodes[i]->refs);
+		for (i = 0; i < n; i++) {
+			/*
+			 * Don't increase refs in case the node is dead and
+			 * about to be removed from the tree in the loop below
+			 */
+			if (!refcount_inc_not_zero(&delayed_nodes[i]->refs))
+				delayed_nodes[i] = NULL;
+		}
 		spin_unlock(&root->inode_lock);
 
 		for (i = 0; i < n; i++) {
+			if (!delayed_nodes[i])
+				continue;
 			__btrfs_kill_delayed_node(delayed_nodes[i]);
 			btrfs_release_delayed_node(delayed_nodes[i]);
 		}
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/btrfs/file.c linux-libre-4.14.159-gnu/fs/btrfs/file.c
--- linux-libre-4.14.158-gnu/fs/btrfs/file.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/file.c	2019-12-17 14:40:05.000000000 -0500
@@ -1625,6 +1625,7 @@ static noinline ssize_t __btrfs_buffered
 			break;
 		}
 
+		only_release_metadata = false;
 		sector_offset = pos & (fs_info->sectorsize - 1);
 		reserve_bytes = round_up(write_bytes + sector_offset,
 				fs_info->sectorsize);
@@ -1778,7 +1779,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.14.158-gnu/fs/btrfs/free-space-cache.c linux-libre-4.14.159-gnu/fs/btrfs/free-space-cache.c
--- linux-libre-4.14.158-gnu/fs/btrfs/free-space-cache.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/free-space-cache.c	2019-12-17 14:40:05.000000000 -0500
@@ -398,6 +398,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.14.158-gnu/fs/btrfs/inode.c linux-libre-4.14.159-gnu/fs/btrfs/inode.c
--- linux-libre-4.14.158-gnu/fs/btrfs/inode.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/inode.c	2019-12-17 14:40:05.000000000 -0500
@@ -9839,6 +9839,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.14.158-gnu/fs/btrfs/send.c linux-libre-4.14.159-gnu/fs/btrfs/send.c
--- linux-libre-4.14.158-gnu/fs/btrfs/send.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/send.c	2019-12-17 14:40:05.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
@@ -1324,6 +1332,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;
 
@@ -1373,7 +1382,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;
@@ -1382,6 +1390,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.14.158-gnu/fs/btrfs/volumes.h linux-libre-4.14.159-gnu/fs/btrfs/volumes.h
--- linux-libre-4.14.158-gnu/fs/btrfs/volumes.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/btrfs/volumes.h	2019-12-17 14:40:05.000000000 -0500
@@ -317,7 +317,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.14.158-gnu/fs/cifs/file.c linux-libre-4.14.159-gnu/fs/cifs/file.c
--- linux-libre-4.14.158-gnu/fs/cifs/file.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/cifs/file.c	2019-12-17 14:40:05.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;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/cifs/smb2misc.c linux-libre-4.14.159-gnu/fs/cifs/smb2misc.c
--- linux-libre-4.14.158-gnu/fs/cifs/smb2misc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/cifs/smb2misc.c	2019-12-17 14:40:05.000000000 -0500
@@ -622,10 +622,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,
@@ -637,6 +637,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) &&
@@ -669,9 +671,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.14.158-gnu/fs/dlm/lockspace.c linux-libre-4.14.159-gnu/fs/dlm/lockspace.c
--- linux-libre-4.14.158-gnu/fs/dlm/lockspace.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/dlm/lockspace.c	2019-12-17 14:40:05.000000000 -0500
@@ -807,6 +807,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.14.158-gnu/fs/dlm/member.c linux-libre-4.14.159-gnu/fs/dlm/member.c
--- linux-libre-4.14.158-gnu/fs/dlm/member.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/dlm/member.c	2019-12-17 14:40:05.000000000 -0500
@@ -671,7 +671,7 @@ int dlm_ls_stop(struct dlm_ls *ls)
 int dlm_ls_start(struct dlm_ls *ls)
 {
 	struct dlm_recover *rv, *rv_old;
-	struct dlm_config_node *nodes;
+	struct dlm_config_node *nodes = NULL;
 	int error, count;
 
 	rv = kzalloc(sizeof(*rv), GFP_NOFS);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/dlm/memory.c linux-libre-4.14.159-gnu/fs/dlm/memory.c
--- linux-libre-4.14.158-gnu/fs/dlm/memory.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/dlm/memory.c	2019-12-17 14:40:05.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.14.158-gnu/fs/dlm/user.c linux-libre-4.14.159-gnu/fs/dlm/user.c
--- linux-libre-4.14.158-gnu/fs/dlm/user.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/dlm/user.c	2019-12-17 14:40:05.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;
@@ -404,7 +405,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.14.158-gnu/fs/exportfs/expfs.c linux-libre-4.14.159-gnu/fs/exportfs/expfs.c
--- linux-libre-4.14.158-gnu/fs/exportfs/expfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/exportfs/expfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -508,26 +508,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.14.158-gnu/fs/ext2/inode.c linux-libre-4.14.159-gnu/fs/ext2/inode.c
--- linux-libre-4.14.158-gnu/fs/ext2/inode.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/ext2/inode.c	2019-12-17 14:40:05.000000000 -0500
@@ -699,10 +699,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.14.158-gnu/fs/ext4/inode.c linux-libre-4.14.159-gnu/fs/ext4/inode.c
--- linux-libre-4.14.158-gnu/fs/ext4/inode.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/ext4/inode.c	2019-12-17 14:40:05.000000000 -0500
@@ -195,7 +195,12 @@ void ext4_evict_inode(struct inode *inod
 {
 	handle_t *handle;
 	int err;
-	int extra_credits = 3;
+	/*
+	 * Credits for final inode cleanup and freeing:
+	 * sb + inode (ext4_orphan_del()), block bitmap, group descriptor
+	 * (xattr block freeing), bitmap, group descriptor (inode freeing)
+	 */
+	int extra_credits = 6;
 	struct ext4_xattr_inode_array *ea_inode_array = NULL;
 
 	trace_ext4_evict_inode(inode);
@@ -251,8 +256,12 @@ void ext4_evict_inode(struct inode *inod
 	if (!IS_NOQUOTA(inode))
 		extra_credits += EXT4_MAXQUOTAS_DEL_BLOCKS(inode->i_sb);
 
+	/*
+	 * Block bitmap, group descriptor, and inode are accounted in both
+	 * ext4_blocks_for_truncate() and extra_credits. So subtract 3.
+	 */
 	handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE,
-				 ext4_blocks_for_truncate(inode)+extra_credits);
+			 ext4_blocks_for_truncate(inode) + extra_credits - 3);
 	if (IS_ERR(handle)) {
 		ext4_std_error(inode->i_sb, PTR_ERR(handle));
 		/*
@@ -5296,11 +5305,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.14.158-gnu/fs/ext4/namei.c linux-libre-4.14.159-gnu/fs/ext4/namei.c
--- linux-libre-4.14.158-gnu/fs/ext4/namei.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/ext4/namei.c	2019-12-17 14:40:05.000000000 -0500
@@ -3065,18 +3065,17 @@ static int ext4_unlink(struct inode *dir
 	if (IS_DIRSYNC(dir))
 		ext4_handle_sync(handle);
 
-	if (inode->i_nlink == 0) {
-		ext4_warning_inode(inode, "Deleting file '%.*s' with no links",
-				   dentry->d_name.len, dentry->d_name.name);
-		set_nlink(inode, 1);
-	}
 	retval = ext4_delete_entry(handle, dir, de, bh);
 	if (retval)
 		goto end_unlink;
 	dir->i_ctime = dir->i_mtime = current_time(dir);
 	ext4_update_dx_flag(dir);
 	ext4_mark_inode_dirty(handle, dir);
-	drop_nlink(inode);
+	if (inode->i_nlink == 0)
+		ext4_warning_inode(inode, "Deleting file '%.*s' with no links",
+				   dentry->d_name.len, dentry->d_name.name);
+	else
+		drop_nlink(inode);
 	if (!inode->i_nlink)
 		ext4_orphan_add(handle, inode);
 	inode->i_ctime = current_time(inode);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/f2fs/file.c linux-libre-4.14.159-gnu/fs/f2fs/file.c
--- linux-libre-4.14.158-gnu/fs/f2fs/file.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/f2fs/file.c	2019-12-17 14:40:05.000000000 -0500
@@ -2029,7 +2029,7 @@ do_more:
 	}
 
 	ret = f2fs_gc(sbi, range.sync, true, GET_SEGNO(sbi, range.start));
-	range.start += sbi->blocks_per_seg;
+	range.start += BLKS_PER_SEC(sbi);
 	if (range.start <= end)
 		goto do_more;
 out:
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/f2fs/gc.c linux-libre-4.14.159-gnu/fs/f2fs/gc.c
--- linux-libre-4.14.158-gnu/fs/f2fs/gc.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/f2fs/gc.c	2019-12-17 14:40:05.000000000 -0500
@@ -330,8 +330,7 @@ static int get_victim_by_default(struct
 	p.min_cost = get_max_cost(sbi, &p);
 
 	if (*result != NULL_SEGNO) {
-		if (IS_DATASEG(get_seg_entry(sbi, *result)->type) &&
-			get_valid_blocks(sbi, *result, false) &&
+		if (get_valid_blocks(sbi, *result, false) &&
 			!sec_usage_check(sbi, GET_SEC_FROM_SEG(sbi, *result)))
 			p.min_segno = *result;
 		goto out;
@@ -952,9 +951,9 @@ static int do_garbage_collect(struct f2f
 					GET_SUM_BLOCK(sbi, segno));
 		f2fs_put_page(sum_page, 0);
 
-		if (get_valid_blocks(sbi, segno, false) == 0 ||
-				!PageUptodate(sum_page) ||
-				unlikely(f2fs_cp_error(sbi)))
+		if (get_valid_blocks(sbi, segno, false) == 0)
+			goto freed;
+		if (!PageUptodate(sum_page) || unlikely(f2fs_cp_error(sbi)))
 			goto next;
 
 		sum = page_address(sum_page);
@@ -981,6 +980,7 @@ static int do_garbage_collect(struct f2f
 
 		stat_inc_seg_count(sbi, type, gc_type);
 
+freed:
 		if (gc_type == FG_GC &&
 				get_valid_blocks(sbi, segno, false) == 0)
 			seg_freed++;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/fuse/dir.c linux-libre-4.14.159-gnu/fs/fuse/dir.c
--- linux-libre-4.14.158-gnu/fs/fuse/dir.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/fuse/dir.c	2019-12-17 14:40:05.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 {
@@ -1214,7 +1224,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);
@@ -1691,7 +1701,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.14.158-gnu/fs/fuse/fuse_i.h linux-libre-4.14.159-gnu/fs/fuse/fuse_i.h
--- linux-libre-4.14.158-gnu/fs/fuse/fuse_i.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/fuse/fuse_i.h	2019-12-17 14:40:05.000000000 -0500
@@ -896,6 +896,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.14.158-gnu/fs/gfs2/log.c linux-libre-4.14.159-gnu/fs/gfs2/log.c
--- linux-libre-4.14.158-gnu/fs/gfs2/log.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/gfs2/log.c	2019-12-17 14:40:05.000000000 -0500
@@ -594,6 +594,14 @@ void gfs2_add_revoke(struct gfs2_sbd *sd
 	list_add(&bd->bd_list, &sdp->sd_log_le_revoke);
 }
 
+void gfs2_glock_remove_revoke(struct gfs2_glock *gl)
+{
+	if (atomic_dec_return(&gl->gl_revokes) == 0) {
+		clear_bit(GLF_LFLUSH, &gl->gl_flags);
+		gfs2_glock_queue_put(gl);
+	}
+}
+
 void gfs2_write_revokes(struct gfs2_sbd *sdp)
 {
 	struct gfs2_trans *tr;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/gfs2/log.h linux-libre-4.14.159-gnu/fs/gfs2/log.h
--- linux-libre-4.14.158-gnu/fs/gfs2/log.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/gfs2/log.h	2019-12-17 14:40:05.000000000 -0500
@@ -80,6 +80,7 @@ extern void gfs2_ail1_flush(struct gfs2_
 extern void gfs2_log_shutdown(struct gfs2_sbd *sdp);
 extern int gfs2_logd(void *data);
 extern void gfs2_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
+extern void gfs2_glock_remove_revoke(struct gfs2_glock *gl);
 extern void gfs2_write_revokes(struct gfs2_sbd *sdp);
 
 #endif /* __LOG_DOT_H__ */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/gfs2/lops.c linux-libre-4.14.159-gnu/fs/gfs2/lops.c
--- linux-libre-4.14.158-gnu/fs/gfs2/lops.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/gfs2/lops.c	2019-12-17 14:40:05.000000000 -0500
@@ -660,10 +660,7 @@ static void revoke_lo_after_commit(struc
 		bd = list_entry(head->next, struct gfs2_bufdata, bd_list);
 		list_del_init(&bd->bd_list);
 		gl = bd->bd_gl;
-		if (atomic_dec_return(&gl->gl_revokes) == 0) {
-			clear_bit(GLF_LFLUSH, &gl->gl_flags);
-			gfs2_glock_queue_put(gl);
-		}
+		gfs2_glock_remove_revoke(gl);
 		kmem_cache_free(gfs2_bufdata_cachep, bd);
 	}
 }
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/gfs2/trans.c linux-libre-4.14.159-gnu/fs/gfs2/trans.c
--- linux-libre-4.14.158-gnu/fs/gfs2/trans.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/gfs2/trans.c	2019-12-17 14:40:05.000000000 -0500
@@ -277,6 +277,8 @@ void gfs2_trans_add_unrevoke(struct gfs2
 			list_del_init(&bd->bd_list);
 			gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke);
 			sdp->sd_log_num_revoke--;
+			if (bd->bd_gl)
+				gfs2_glock_remove_revoke(bd->bd_gl);
 			kmem_cache_free(gfs2_bufdata_cachep, bd);
 			tr->tr_num_revoke_rm++;
 			if (--n == 0)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/iomap.c linux-libre-4.14.159-gnu/fs/iomap.c
--- linux-libre-4.14.158-gnu/fs/iomap.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/iomap.c	2019-12-17 14:40:05.000000000 -0500
@@ -941,7 +941,14 @@ iomap_dio_actor(struct inode *inode, lof
 		dio->submit.cookie = submit_bio(bio);
 	} while (nr_pages);
 
-	if (need_zeroout) {
+	/*
+	 * We need to zeroout the tail of a sub-block write if the extent type
+	 * requires zeroing or the write extends beyond EOF. If we don't zero
+	 * the block tail in the latter case, we can expose stale data via mmap
+	 * reads of the EOF block.
+	 */
+	if (need_zeroout ||
+	    ((dio->flags & IOMAP_DIO_WRITE) && pos >= i_size_read(inode))) {
 		/* zero out from the end of the write to the end of the block */
 		pad = pos & (fs_block_size - 1);
 		if (pad)
@@ -1046,8 +1053,15 @@ iomap_dio_rw(struct kiocb *iocb, struct
 		}
 		pos += ret;
 
-		if (iov_iter_rw(iter) == READ && pos >= dio->i_size)
+		if (iov_iter_rw(iter) == READ && pos >= dio->i_size) {
+			/*
+			 * We only report that we've read data up to i_size.
+			 * Revert iter to a state corresponding to that as
+			 * some callers (such as splice code) rely on it.
+			 */
+			iov_iter_revert(iter, pos - dio->i_size);
 			break;
+		}
 	} while ((count = iov_iter_count(iter)) > 0);
 	blk_finish_plug(&plug);
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/kernfs/dir.c linux-libre-4.14.159-gnu/fs/kernfs/dir.c
--- linux-libre-4.14.158-gnu/fs/kernfs/dir.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/kernfs/dir.c	2019-12-17 14:40:05.000000000 -0500
@@ -623,7 +623,6 @@ static struct kernfs_node *__kernfs_new_
 {
 	struct kernfs_node *kn;
 	u32 gen;
-	int cursor;
 	int ret;
 
 	name = kstrdup_const(name, GFP_KERNEL);
@@ -636,11 +635,11 @@ static struct kernfs_node *__kernfs_new_
 
 	idr_preload(GFP_KERNEL);
 	spin_lock(&kernfs_idr_lock);
-	cursor = idr_get_cursor(&root->ino_idr);
 	ret = idr_alloc_cyclic(&root->ino_idr, kn, 1, 0, GFP_ATOMIC);
-	if (ret >= 0 && ret < cursor)
+	if (ret >= 0 && ret < root->last_ino)
 		root->next_generation++;
 	gen = root->next_generation;
+	root->last_ino = ret;
 	spin_unlock(&kernfs_idr_lock);
 	idr_preload_end();
 	if (ret < 0)
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/lockd/clnt4xdr.c linux-libre-4.14.159-gnu/fs/lockd/clnt4xdr.c
--- linux-libre-4.14.158-gnu/fs/lockd/clnt4xdr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/lockd/clnt4xdr.c	2019-12-17 14:40:05.000000000 -0500
@@ -128,24 +128,14 @@ static void encode_netobj(struct xdr_str
 static int decode_netobj(struct xdr_stream *xdr,
 			 struct xdr_netobj *obj)
 {
-	u32 length;
-	__be32 *p;
+	ssize_t ret;
 
-	p = xdr_inline_decode(xdr, 4);
-	if (unlikely(p == NULL))
-		goto out_overflow;
-	length = be32_to_cpup(p++);
-	if (unlikely(length > XDR_MAX_NETOBJ))
-		goto out_size;
-	obj->len = length;
-	obj->data = (u8 *)p;
+	ret = xdr_stream_decode_opaque_inline(xdr, (void *)&obj->data,
+						XDR_MAX_NETOBJ);
+	if (unlikely(ret < 0))
+		return -EIO;
+	obj->len = ret;
 	return 0;
-out_size:
-	dprintk("NFS: returned netobj was too long: %u\n", length);
-	return -EIO;
-out_overflow:
-	print_overflow_msg(__func__, xdr);
-	return -EIO;
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/lockd/clntxdr.c linux-libre-4.14.159-gnu/fs/lockd/clntxdr.c
--- linux-libre-4.14.158-gnu/fs/lockd/clntxdr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/lockd/clntxdr.c	2019-12-17 14:40:05.000000000 -0500
@@ -125,24 +125,14 @@ static void encode_netobj(struct xdr_str
 static int decode_netobj(struct xdr_stream *xdr,
 			 struct xdr_netobj *obj)
 {
-	u32 length;
-	__be32 *p;
+	ssize_t ret;
 
-	p = xdr_inline_decode(xdr, 4);
-	if (unlikely(p == NULL))
-		goto out_overflow;
-	length = be32_to_cpup(p++);
-	if (unlikely(length > XDR_MAX_NETOBJ))
-		goto out_size;
-	obj->len = length;
-	obj->data = (u8 *)p;
+	ret = xdr_stream_decode_opaque_inline(xdr, (void *)&obj->data,
+			XDR_MAX_NETOBJ);
+	if (unlikely(ret < 0))
+		return -EIO;
+	obj->len = ret;
 	return 0;
-out_size:
-	dprintk("NFS: returned netobj was too long: %u\n", length);
-	return -EIO;
-out_overflow:
-	print_overflow_msg(__func__, xdr);
-	return -EIO;
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/nfsd/nfs4recover.c linux-libre-4.14.159-gnu/fs/nfsd/nfs4recover.c
--- linux-libre-4.14.158-gnu/fs/nfsd/nfs4recover.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/nfsd/nfs4recover.c	2019-12-17 14:40:05.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.14.158-gnu/fs/nfsd/vfs.c linux-libre-4.14.159-gnu/fs/nfsd/vfs.c
--- linux-libre-4.14.158-gnu/fs/nfsd/vfs.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/nfsd/vfs.c	2019-12-17 14:40:05.000000000 -0500
@@ -396,10 +396,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.14.158-gnu/fs/ocfs2/quota_global.c linux-libre-4.14.159-gnu/fs/ocfs2/quota_global.c
--- linux-libre-4.14.158-gnu/fs/ocfs2/quota_global.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/ocfs2/quota_global.c	2019-12-17 14:40:05.000000000 -0500
@@ -727,7 +727,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.14.158-gnu/fs/overlayfs/dir.c linux-libre-4.14.159-gnu/fs/overlayfs/dir.c
--- linux-libre-4.14.158-gnu/fs/overlayfs/dir.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/overlayfs/dir.c	2019-12-17 14:40:05.000000000 -0500
@@ -1042,7 +1042,7 @@ static int ovl_rename(struct inode *oldd
 	if (newdentry == trap)
 		goto out_dput;
 
-	if (WARN_ON(olddentry->d_inode == newdentry->d_inode))
+	if (olddentry->d_inode == newdentry->d_inode)
 		goto out_dput;
 
 	err = 0;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/pstore/ram.c linux-libre-4.14.159-gnu/fs/pstore/ram.c
--- linux-libre-4.14.158-gnu/fs/pstore/ram.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/pstore/ram.c	2019-12-17 14:40:05.000000000 -0500
@@ -297,6 +297,7 @@ static ssize_t ramoops_pstore_read(struc
 					  GFP_KERNEL);
 			if (!tmp_prz)
 				return -ENOMEM;
+			prz = tmp_prz;
 			free_prz = true;
 
 			while (cxt->ftrace_read_cnt < cxt->max_ftrace_cnt) {
@@ -319,7 +320,6 @@ static ssize_t ramoops_pstore_read(struc
 					goto out;
 			}
 			record->id = 0;
-			prz = tmp_prz;
 		}
 	}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/quota/dquot.c linux-libre-4.14.159-gnu/fs/quota/dquot.c
--- linux-libre-4.14.158-gnu/fs/quota/dquot.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/quota/dquot.c	2019-12-17 14:40:05.000000000 -0500
@@ -491,7 +491,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;
 	if (dqopt->ops[dquot->dq_id.type]->release_dqblk) {
 		ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot);
@@ -617,7 +617,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;
@@ -631,9 +631,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);
 
 			WARN_ON(!test_bit(DQ_ACTIVE_B, &dquot->dq_flags));
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/reiserfs/inode.c linux-libre-4.14.159-gnu/fs/reiserfs/inode.c
--- linux-libre-4.14.158-gnu/fs/reiserfs/inode.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/inode.c	2019-12-17 14:40:05.000000000 -0500
@@ -2096,6 +2096,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);
@@ -2110,8 +2119,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.14.158-gnu/fs/reiserfs/namei.c linux-libre-4.14.159-gnu/fs/reiserfs/namei.c
--- linux-libre-4.14.158-gnu/fs/reiserfs/namei.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/namei.c	2019-12-17 14:40:05.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.14.158-gnu/fs/reiserfs/reiserfs.h linux-libre-4.14.159-gnu/fs/reiserfs/reiserfs.h
--- linux-libre-4.14.158-gnu/fs/reiserfs/reiserfs.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/reiserfs.h	2019-12-17 14:40:05.000000000 -0500
@@ -1168,6 +1168,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.14.158-gnu/fs/reiserfs/super.c linux-libre-4.14.159-gnu/fs/reiserfs/super.c
--- linux-libre-4.14.158-gnu/fs/reiserfs/super.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/super.c	2019-12-17 14:40:05.000000000 -0500
@@ -2052,6 +2052,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) && !sb_rdonly(s)) {
 		SWARN(silent, s, "clm-7000",
 		      "Detected readonly device, marking FS readonly");
diff -druNp --no-dereference linux-libre-4.14.158-gnu/fs/reiserfs/xattr_acl.c linux-libre-4.14.159-gnu/fs/reiserfs/xattr_acl.c
--- linux-libre-4.14.158-gnu/fs/reiserfs/xattr_acl.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/xattr_acl.c	2019-12-17 14:40:05.000000000 -0500
@@ -320,10 +320,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.14.158-gnu/fs/reiserfs/xattr.c linux-libre-4.14.159-gnu/fs/reiserfs/xattr.c
--- linux-libre-4.14.158-gnu/fs/reiserfs/xattr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/fs/reiserfs/xattr.c	2019-12-17 14:40:05.000000000 -0500
@@ -122,13 +122,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;
 
@@ -610,6 +610,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);
 
@@ -832,8 +836,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);
@@ -873,6 +876,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);
 
@@ -886,7 +890,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,
@@ -957,8 +961,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));
@@ -987,7 +993,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.14.158-gnu/include/dt-bindings/clock/rk3328-cru.h linux-libre-4.14.159-gnu/include/dt-bindings/clock/rk3328-cru.h
--- linux-libre-4.14.158-gnu/include/dt-bindings/clock/rk3328-cru.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/dt-bindings/clock/rk3328-cru.h	2019-12-17 14:40:05.000000000 -0500
@@ -178,7 +178,7 @@
 #define HCLK_TSP		309
 #define HCLK_GMAC		310
 #define HCLK_I2S0_8CH		311
-#define HCLK_I2S1_8CH		313
+#define HCLK_I2S1_8CH		312
 #define HCLK_I2S2_2CH		313
 #define HCLK_SPDIF_8CH		314
 #define HCLK_VOP		315
diff -druNp --no-dereference linux-libre-4.14.158-gnu/include/linux/acpi.h linux-libre-4.14.159-gnu/include/linux/acpi.h
--- linux-libre-4.14.158-gnu/include/linux/acpi.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/acpi.h	2019-12-17 14:40:05.000000000 -0500
@@ -99,7 +99,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.14.158-gnu/include/linux/atalk.h linux-libre-4.14.159-gnu/include/linux/atalk.h
--- linux-libre-4.14.158-gnu/include/linux/atalk.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/atalk.h	2019-12-17 14:40:05.000000000 -0500
@@ -108,7 +108,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.14.158-gnu/include/linux/dma-mapping.h linux-libre-4.14.159-gnu/include/linux/dma-mapping.h
--- linux-libre-4.14.158-gnu/include/linux/dma-mapping.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/dma-mapping.h	2019-12-17 14:40:05.000000000 -0500
@@ -650,8 +650,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.14.158-gnu/include/linux/jbd2.h linux-libre-4.14.159-gnu/include/linux/jbd2.h
--- linux-libre-4.14.158-gnu/include/linux/jbd2.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/jbd2.h	2019-12-17 14:40:05.000000000 -0500
@@ -1584,7 +1584,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->
@@ -1593,7 +1593,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.14.158-gnu/include/linux/kernfs.h linux-libre-4.14.159-gnu/include/linux/kernfs.h
--- linux-libre-4.14.158-gnu/include/linux/kernfs.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/kernfs.h	2019-12-17 14:40:05.000000000 -0500
@@ -185,6 +185,7 @@ struct kernfs_root {
 
 	/* private fields, do not use outside kernfs proper */
 	struct idr		ino_idr;
+	u32			last_ino;
 	u32			next_generation;
 	struct kernfs_syscall_ops *syscall_ops;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/include/linux/mfd/rk808.h linux-libre-4.14.159-gnu/include/linux/mfd/rk808.h
--- linux-libre-4.14.158-gnu/include/linux/mfd/rk808.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/mfd/rk808.h	2019-12-17 14:40:05.000000000 -0500
@@ -443,7 +443,7 @@ enum {
 enum {
 	RK805_ID = 0x8050,
 	RK808_ID = 0x0000,
-	RK818_ID = 0x8181,
+	RK818_ID = 0x8180,
 };
 
 struct rk808 {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/include/linux/mtd/mtd.h linux-libre-4.14.159-gnu/include/linux/mtd/mtd.h
--- linux-libre-4.14.158-gnu/include/linux/mtd/mtd.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/mtd/mtd.h	2019-12-17 14:40:05.000000000 -0500
@@ -401,7 +401,7 @@ static inline struct device_node *mtd_ge
 	return dev_of_node(&mtd->dev);
 }
 
-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.14.158-gnu/include/linux/platform_data/dma-dw.h linux-libre-4.14.159-gnu/include/linux/platform_data/dma-dw.h
--- linux-libre-4.14.158-gnu/include/linux/platform_data/dma-dw.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/platform_data/dma-dw.h	2019-12-17 14:40:05.000000000 -0500
@@ -49,6 +49,7 @@ struct dw_dma_slave {
  * @data_width: Maximum data width supported by hardware per AHB master
  *		(in bytes, power of 2)
  * @multi_block: Multi block transfers supported by hardware per channel.
+ * @protctl: Protection control signals setting per channel.
  */
 struct dw_dma_platform_data {
 	unsigned int	nr_channels;
@@ -65,6 +66,11 @@ struct dw_dma_platform_data {
 	unsigned char	nr_masters;
 	unsigned char	data_width[DW_DMA_MAX_NR_MASTERS];
 	unsigned char	multi_block[DW_DMA_MAX_NR_CHANNELS];
+#define CHAN_PROTCTL_PRIVILEGED		BIT(0)
+#define CHAN_PROTCTL_BUFFERABLE		BIT(1)
+#define CHAN_PROTCTL_CACHEABLE		BIT(2)
+#define CHAN_PROTCTL_MASK		GENMASK(2, 0)
+	unsigned char	protctl;
 };
 
 #endif /* _PLATFORM_DATA_DMA_DW_H */
diff -druNp --no-dereference linux-libre-4.14.158-gnu/include/linux/qcom_scm.h linux-libre-4.14.159-gnu/include/linux/qcom_scm.h
--- linux-libre-4.14.158-gnu/include/linux/qcom_scm.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/qcom_scm.h	2019-12-17 14:40:05.000000000 -0500
@@ -44,6 +44,9 @@ extern int qcom_scm_restore_sec_cfg(u32
 extern int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size);
 extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare);
 #else
+
+#include <linux/errno.h>
+
 static inline
 int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
 {
diff -druNp --no-dereference linux-libre-4.14.158-gnu/include/linux/quotaops.h linux-libre-4.14.159-gnu/include/linux/quotaops.h
--- linux-libre-4.14.158-gnu/include/linux/quotaops.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/quotaops.h	2019-12-17 14:40:05.000000000 -0500
@@ -51,6 +51,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.14.158-gnu/include/linux/regulator/consumer.h linux-libre-4.14.159-gnu/include/linux/regulator/consumer.h
--- linux-libre-4.14.158-gnu/include/linux/regulator/consumer.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/regulator/consumer.h	2019-12-17 14:40:05.000000000 -0500
@@ -508,7 +508,7 @@ static inline int regulator_get_error_fl
 
 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.14.158-gnu/include/linux/serial_core.h linux-libre-4.14.159-gnu/include/linux/serial_core.h
--- linux-libre-4.14.158-gnu/include/linux/serial_core.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/serial_core.h	2019-12-17 14:40:05.000000000 -0500
@@ -166,6 +166,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 */
@@ -474,8 +475,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.14.158-gnu/include/linux/tty.h linux-libre-4.14.159-gnu/include/linux/tty.h
--- linux-libre-4.14.158-gnu/include/linux/tty.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/linux/tty.h	2019-12-17 14:40:05.000000000 -0500
@@ -365,6 +365,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 */
@@ -382,6 +383,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.14.158-gnu/include/math-emu/soft-fp.h linux-libre-4.14.159-gnu/include/math-emu/soft-fp.h
--- linux-libre-4.14.158-gnu/include/math-emu/soft-fp.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/math-emu/soft-fp.h	2019-12-17 14:40:05.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.14.158-gnu/include/uapi/linux/cec.h linux-libre-4.14.159-gnu/include/uapi/linux/cec.h
--- linux-libre-4.14.158-gnu/include/uapi/linux/cec.h	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/include/uapi/linux/cec.h	2019-12-17 14:40:05.000000000 -0500
@@ -789,8 +789,8 @@ struct cec_event {
 #define CEC_MSG_SELECT_DIGITAL_SERVICE			0x93
 #define CEC_MSG_TUNER_DEVICE_STATUS			0x07
 /* Recording Flag Operand (rec_flag) */
-#define CEC_OP_REC_FLAG_USED				0
-#define CEC_OP_REC_FLAG_NOT_USED			1
+#define CEC_OP_REC_FLAG_NOT_USED			0
+#define CEC_OP_REC_FLAG_USED				1
 /* Tuner Display Info Operand (tuner_display_info) */
 #define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL		0
 #define CEC_OP_TUNER_DISPLAY_INFO_NONE			1
diff -druNp --no-dereference linux-libre-4.14.158-gnu/kernel/audit_watch.c linux-libre-4.14.159-gnu/kernel/audit_watch.c
--- linux-libre-4.14.158-gnu/kernel/audit_watch.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/audit_watch.c	2019-12-17 14:40:05.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.14.158-gnu/kernel/cgroup/pids.c linux-libre-4.14.159-gnu/kernel/cgroup/pids.c
--- linux-libre-4.14.158-gnu/kernel/cgroup/pids.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/cgroup/pids.c	2019-12-17 14:40:05.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.14.158-gnu/kernel/module.c linux-libre-4.14.159-gnu/kernel/module.c
--- linux-libre-4.14.158-gnu/kernel/module.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/module.c	2019-12-17 14:40:05.000000000 -0500
@@ -1020,6 +1020,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.14.158-gnu/kernel/sched/core.c linux-libre-4.14.159-gnu/kernel/sched/core.c
--- linux-libre-4.14.158-gnu/kernel/sched/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/sched/core.c	2019-12-17 14:40:05.000000000 -0500
@@ -5242,10 +5242,11 @@ void init_idle(struct task_struct *idle,
 	struct rq *rq = cpu_rq(cpu);
 	unsigned long flags;
 
+	__sched_fork(0, idle);
+
 	raw_spin_lock_irqsave(&idle->pi_lock, flags);
 	raw_spin_lock(&rq->lock);
 
-	__sched_fork(0, idle);
 	idle->state = TASK_RUNNING;
 	idle->se.exec_start = sched_clock();
 	idle->flags |= PF_IDLE;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/kernel/sched/fair.c linux-libre-4.14.159-gnu/kernel/sched/fair.c
--- linux-libre-4.14.158-gnu/kernel/sched/fair.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/sched/fair.c	2019-12-17 14:40:05.000000000 -0500
@@ -4655,20 +4655,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.14.158-gnu/kernel/workqueue.c linux-libre-4.14.159-gnu/kernel/workqueue.c
--- linux-libre-4.14.158-gnu/kernel/workqueue.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/kernel/workqueue.c	2019-12-17 14:40:05.000000000 -0500
@@ -2366,8 +2366,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);
 			}
 		}
@@ -4084,9 +4090,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) {
@@ -4118,11 +4144,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
@@ -4399,7 +4420,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.14.158-gnu/lib/raid6/unroll.awk linux-libre-4.14.159-gnu/lib/raid6/unroll.awk
--- linux-libre-4.14.158-gnu/lib/raid6/unroll.awk	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/lib/raid6/unroll.awk	2019-12-17 14:40:05.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.14.158-gnu/Makefile linux-libre-4.14.159-gnu/Makefile
--- linux-libre-4.14.158-gnu/Makefile	2019-12-05 10:08:23.000000000 -0500
+++ linux-libre-4.14.159-gnu/Makefile	2019-12-17 20:35:59.000000000 -0500
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 4
 PATCHLEVEL = 14
-SUBLEVEL = 158
+SUBLEVEL = 159
 EXTRAVERSION = -gnu
 NAME = Petit Gorille
 
@@ -1529,9 +1529,6 @@ else # KBUILD_EXTMOD
 
 # We are always building modules
 KBUILD_MODULES := 1
-PHONY += crmodverdir
-crmodverdir:
-	$(cmd_crmodverdir)
 
 PHONY += $(objtree)/Module.symvers
 $(objtree)/Module.symvers:
@@ -1543,7 +1540,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)
@@ -1584,7 +1581,8 @@ help:
 
 # Dummies...
 PHONY += prepare scripts
-prepare: ;
+prepare:
+	$(cmd_crmodverdir)
 scripts: ;
 endif # KBUILD_EXTMOD
 
@@ -1709,17 +1707,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.14.158-gnu/mm/shmem.c linux-libre-4.14.159-gnu/mm/shmem.c
--- linux-libre-4.14.158-gnu/mm/shmem.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/mm/shmem.c	2019-12-17 14:40:05.000000000 -0500
@@ -2895,7 +2895,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.14.158-gnu/mm/vmstat.c linux-libre-4.14.159-gnu/mm/vmstat.c
--- linux-libre-4.14.158-gnu/mm/vmstat.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/mm/vmstat.c	2019-12-17 14:40:05.000000000 -0500
@@ -1805,12 +1805,13 @@ static bool need_update(int cpu)
 
 		/*
 		 * The fast way of checking if there are any vmstat diffs.
-		 * This works because the diffs are byte sized items.
 		 */
-		if (memchr_inv(p->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS))
+		if (memchr_inv(p->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS *
+			       sizeof(p->vm_stat_diff[0])))
 			return true;
 #ifdef CONFIG_NUMA
-		if (memchr_inv(p->vm_numa_stat_diff, 0, NR_VM_NUMA_STAT_ITEMS))
+		if (memchr_inv(p->vm_numa_stat_diff, 0, NR_VM_NUMA_STAT_ITEMS *
+			       sizeof(p->vm_numa_stat_diff[0])))
 			return true;
 #endif
 	}
diff -druNp --no-dereference linux-libre-4.14.158-gnu/net/appletalk/aarp.c linux-libre-4.14.159-gnu/net/appletalk/aarp.c
--- linux-libre-4.14.158-gnu/net/appletalk/aarp.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/appletalk/aarp.c	2019-12-17 14:40:05.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.14.158-gnu/net/appletalk/ddp.c linux-libre-4.14.159-gnu/net/appletalk/ddp.c
--- linux-libre-4.14.158-gnu/net/appletalk/ddp.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/appletalk/ddp.c	2019-12-17 14:40:05.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.14.158-gnu/net/ipv4/tcp_output.c linux-libre-4.14.159-gnu/net/ipv4/tcp_output.c
--- linux-libre-4.14.158-gnu/net/ipv4/tcp_output.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/ipv4/tcp_output.c	2019-12-17 14:40:05.000000000 -0500
@@ -2932,7 +2932,7 @@ int __tcp_retransmit_skb(struct sock *sk
 	if (likely(!err)) {
 		TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS;
 	} else if (err != -EBUSY) {
-		NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
+		NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL, segs);
 	}
 	return err;
 }
diff -druNp --no-dereference linux-libre-4.14.158-gnu/net/ipv4/tcp_timer.c linux-libre-4.14.159-gnu/net/ipv4/tcp_timer.c
--- linux-libre-4.14.158-gnu/net/ipv4/tcp_timer.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/ipv4/tcp_timer.c	2019-12-17 14:40:05.000000000 -0500
@@ -358,7 +358,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. */
@@ -413,6 +413,7 @@ void tcp_retransmit_timer(struct sock *s
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct net *net = sock_net(sk);
 	struct inet_connection_sock *icsk = inet_csk(sk);
+	struct sk_buff *skb;
 
 	if (tp->fastopen_rsk) {
 		WARN_ON_ONCE(sk->sk_state != TCP_SYN_RECV &&
@@ -423,10 +424,13 @@ void tcp_retransmit_timer(struct sock *s
 		 */
 		return;
 	}
+
 	if (!tp->packets_out)
-		goto out;
+		return;
 
-	WARN_ON(tcp_write_queue_empty(sk));
+	skb = tcp_rtx_queue_head(sk);
+	if (WARN_ON_ONCE(!skb))
+		return;
 
 	tp->tlp_high_seq = 0;
 
@@ -459,16 +463,17 @@ void tcp_retransmit_timer(struct sock *s
 			goto out;
 		}
 		tcp_enter_loss(sk);
-		tcp_retransmit_skb(sk, tcp_write_queue_head(sk), 1);
+		tcp_retransmit_skb(sk, skb, 1);
 		__sk_dst_reset(sk);
 		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))
@@ -483,10 +488,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.14.158-gnu/net/smc/smc_wr.c linux-libre-4.14.159-gnu/net/smc/smc_wr.c
--- linux-libre-4.14.158-gnu/net/smc/smc_wr.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/smc/smc_wr.c	2019-12-17 14:40:05.000000000 -0500
@@ -223,12 +223,14 @@ int smc_wr_tx_put_slot(struct smc_link *
 
 	pend = container_of(wr_pend_priv, struct smc_wr_tx_pend, priv);
 	if (pend->idx < link->wr_tx_cnt) {
+		u32 idx = pend->idx;
+
 		/* clear the full struct smc_wr_tx_pend including .priv */
 		memset(&link->wr_tx_pends[pend->idx], 0,
 		       sizeof(link->wr_tx_pends[pend->idx]));
 		memset(&link->wr_tx_bufs[pend->idx], 0,
 		       sizeof(link->wr_tx_bufs[pend->idx]));
-		test_and_clear_bit(pend->idx, link->wr_tx_mask);
+		test_and_clear_bit(idx, link->wr_tx_mask);
 		return 1;
 	}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/net/sunrpc/cache.c linux-libre-4.14.159-gnu/net/sunrpc/cache.c
--- linux-libre-4.14.158-gnu/net/sunrpc/cache.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/sunrpc/cache.c	2019-12-17 14:40:05.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.14.158-gnu/net/x25/af_x25.c linux-libre-4.14.159-gnu/net/x25/af_x25.c
--- linux-libre-4.14.158-gnu/net/x25/af_x25.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/x25/af_x25.c	2019-12-17 14:40:05.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.14.158-gnu/net/xfrm/xfrm_input.c linux-libre-4.14.159-gnu/net/xfrm/xfrm_input.c
--- linux-libre-4.14.158-gnu/net/xfrm/xfrm_input.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/net/xfrm/xfrm_input.c	2019-12-17 14:40:05.000000000 -0500
@@ -245,6 +245,9 @@ int xfrm_input(struct sk_buff *skb, int
 			else
 				XFRM_INC_STATS(net,
 					       LINUX_MIB_XFRMINSTATEINVALID);
+
+			if (encap_type == -1)
+				dev_put(skb->dev);
 			goto drop;
 		}
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/scripts/mod/modpost.c linux-libre-4.14.159-gnu/scripts/mod/modpost.c
--- linux-libre-4.14.158-gnu/scripts/mod/modpost.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/scripts/mod/modpost.c	2019-12-17 14:40:05.000000000 -0500
@@ -1174,6 +1174,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,
@@ -1212,6 +1220,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.14.158-gnu/sound/core/oss/linear.c linux-libre-4.14.159-gnu/sound/core/oss/linear.c
--- linux-libre-4.14.158-gnu/sound/core/oss/linear.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/core/oss/linear.c	2019-12-17 14:40:05.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.14.158-gnu/sound/core/oss/mulaw.c linux-libre-4.14.159-gnu/sound/core/oss/mulaw.c
--- linux-libre-4.14.158-gnu/sound/core/oss/mulaw.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/core/oss/mulaw.c	2019-12-17 14:40:05.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.14.158-gnu/sound/core/oss/route.c linux-libre-4.14.159-gnu/sound/core/oss/route.c
--- linux-libre-4.14.158-gnu/sound/core/oss/route.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/core/oss/route.c	2019-12-17 14:40:05.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.14.158-gnu/sound/core/pcm_lib.c linux-libre-4.14.159-gnu/sound/core/pcm_lib.c
--- linux-libre-4.14.158-gnu/sound/core/pcm_lib.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/core/pcm_lib.c	2019-12-17 14:40:05.000000000 -0500
@@ -1803,11 +1803,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;
@@ -1818,6 +1821,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);
 }
 EXPORT_SYMBOL(snd_pcm_period_elapsed);
diff -druNp --no-dereference linux-libre-4.14.158-gnu/sound/pci/hda/hda_bind.c linux-libre-4.14.159-gnu/sound/pci/hda/hda_bind.c
--- linux-libre-4.14.158-gnu/sound/pci/hda/hda_bind.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/pci/hda/hda_bind.c	2019-12-17 14:40:05.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.14.158-gnu/sound/pci/hda/hda_intel.c linux-libre-4.14.159-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.14.158-gnu/sound/pci/hda/hda_intel.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/pci/hda/hda_intel.c	2019-12-17 14:40:05.000000000 -0500
@@ -1450,8 +1450,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.14.158-gnu/sound/pci/hda/patch_conexant.c linux-libre-4.14.159-gnu/sound/pci/hda/patch_conexant.c
--- linux-libre-4.14.158-gnu/sound/pci/hda/patch_conexant.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/pci/hda/patch_conexant.c	2019-12-17 14:40:05.000000000 -0500
@@ -960,6 +960,7 @@ static const struct snd_pci_quirk cxt506
 	SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO),
 	SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE),
+	SND_PCI_QUIRK(0x103c, 0x8402, "HP ProBook 645 G4", CXT_FIXUP_MUTE_LED_GPIO),
 	SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
 	SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
diff -druNp --no-dereference linux-libre-4.14.158-gnu/sound/pci/hda/patch_realtek.c linux-libre-4.14.159-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-4.14.158-gnu/sound/pci/hda/patch_realtek.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/pci/hda/patch_realtek.c	2019-12-17 14:40:05.000000000 -0500
@@ -333,9 +333,7 @@ static void alc_fill_eapd_coef(struct hd
 	case 0x10ec0215:
 	case 0x10ec0233:
 	case 0x10ec0235:
-	case 0x10ec0236:
 	case 0x10ec0255:
-	case 0x10ec0256:
 	case 0x10ec0257:
 	case 0x10ec0282:
 	case 0x10ec0283:
@@ -347,6 +345,11 @@ static void alc_fill_eapd_coef(struct hd
 	case 0x10ec0300:
 		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
 		break;
+	case 0x10ec0236:
+	case 0x10ec0256:
+		alc_write_coef_idx(codec, 0x36, 0x5757);
+		alc_update_coef_idx(codec, 0x10, 1<<9, 0);
+		break;
 	case 0x10ec0275:
 		alc_update_coef_idx(codec, 0xe, 0, 1<<0);
 		break;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/sound/soc/codecs/nau8540.c linux-libre-4.14.159-gnu/sound/soc/codecs/nau8540.c
--- linux-libre-4.14.158-gnu/sound/soc/codecs/nau8540.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/soc/codecs/nau8540.c	2019-12-17 14:40:05.000000000 -0500
@@ -548,7 +548,7 @@ static int nau8540_calc_fll_param(unsign
 	fvco_max = 0;
 	fvco_sel = ARRAY_SIZE(mclk_src_scaling);
 	for (i = 0; i < ARRAY_SIZE(mclk_src_scaling); i++) {
-		fvco = 256 * fs * 2 * mclk_src_scaling[i].param;
+		fvco = 256ULL * fs * 2 * mclk_src_scaling[i].param;
 		if (fvco > NAU_FVCO_MIN && fvco < NAU_FVCO_MAX &&
 			fvco_max < fvco) {
 			fvco_max = fvco;
diff -druNp --no-dereference linux-libre-4.14.158-gnu/sound/soc/sh/rcar/core.c linux-libre-4.14.159-gnu/sound/soc/sh/rcar/core.c
--- linux-libre-4.14.158-gnu/sound/soc/sh/rcar/core.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/soc/sh/rcar/core.c	2019-12-17 14:40:05.000000000 -0500
@@ -1278,6 +1278,18 @@ int rsnd_kctrl_new(struct rsnd_mod *mod,
 	};
 	int ret;
 
+	/*
+	 * 1) Avoid duplicate register for DVC with MIX case
+	 * 2) Allow duplicate register for MIX
+	 * 3) re-register if card was rebinded
+	 */
+	list_for_each_entry(kctrl, &card->controls, list) {
+		struct rsnd_kctrl_cfg *c = kctrl->private_data;
+
+		if (c == cfg)
+			return 0;
+	}
+
 	if (size > RSND_MAX_CHANNELS)
 		return -EINVAL;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/sound/soc/soc-jack.c linux-libre-4.14.159-gnu/sound/soc/soc-jack.c
--- linux-libre-4.14.158-gnu/sound/soc/soc-jack.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/sound/soc/soc-jack.c	2019-12-17 14:40:05.000000000 -0500
@@ -127,10 +127,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;
 
diff -druNp --no-dereference linux-libre-4.14.158-gnu/virt/kvm/arm/vgic/vgic-v3.c linux-libre-4.14.159-gnu/virt/kvm/arm/vgic/vgic-v3.c
--- linux-libre-4.14.158-gnu/virt/kvm/arm/vgic/vgic-v3.c	2019-12-05 09:38:36.000000000 -0500
+++ linux-libre-4.14.159-gnu/virt/kvm/arm/vgic/vgic-v3.c	2019-12-17 14:40:05.000000000 -0500
@@ -331,8 +331,8 @@ retry:
 int vgic_v3_save_pending_tables(struct kvm *kvm)
 {
 	struct vgic_dist *dist = &kvm->arch.vgic;
-	int last_byte_offset = -1;
 	struct vgic_irq *irq;
+	gpa_t last_ptr = ~(gpa_t)0;
 	int ret;
 	u8 val;
 
@@ -352,11 +352,11 @@ int vgic_v3_save_pending_tables(struct k
 		bit_nr = irq->intid % BITS_PER_BYTE;
 		ptr = pendbase + byte_offset;
 
-		if (byte_offset != last_byte_offset) {
+		if (ptr != last_ptr) {
 			ret = kvm_read_guest_lock(kvm, ptr, &val, 1);
 			if (ret)
 				return ret;
-			last_byte_offset = byte_offset;
+			last_ptr = ptr;
 		}
 
 		stored = val & (1U << bit_nr);
