diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos3250.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos3250.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos3250.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos3250.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -80,6 +80,22 @@
 			compatible = "arm,cortex-a7";
 			reg = <1>;
 			clock-frequency = <1000000000>;
+			clocks = <&cmu CLK_ARM_CLK>;
+			clock-names = "cpu";
+			#cooling-cells = <2>;
+
+			operating-points = <
+				1000000 1150000
+				900000  1112500
+				800000  1075000
+				700000  1037500
+				600000  1000000
+				500000  962500
+				400000  925000
+				300000  887500
+				200000  850000
+				100000  850000
+			>;
 		};
 	};
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos4210.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos4210.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos4210.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos4210.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -52,8 +52,6 @@
 				400000	975000
 				200000	950000
 			>;
-			cooling-min-level = <4>;
-			cooling-max-level = <2>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -61,6 +59,19 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0x901>;
+			clocks = <&clock CLK_ARM_CLK>;
+			clock-names = "cpu";
+			clock-latency = <160000>;
+
+			operating-points = <
+				1200000 1250000
+				1000000 1150000
+				800000	1075000
+				500000	975000
+				400000	975000
+				200000	950000
+			>;
+			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos4412.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos4412.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos4412.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos4412.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -33,8 +33,6 @@
 			clocks = <&clock CLK_ARM_CLK>;
 			clock-names = "cpu";
 			operating-points-v2 = <&cpu0_opp_table>;
-			cooling-min-level = <13>;
-			cooling-max-level = <7>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5250.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5250.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5250.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5250.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -57,38 +57,106 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <0>;
-			clock-frequency = <1700000000>;
 			clocks = <&clock CLK_ARM_CLK>;
 			clock-names = "cpu";
-			clock-latency = <140000>;
-
-			operating-points = <
-				1700000 1300000
-				1600000 1250000
-				1500000 1225000
-				1400000 1200000
-				1300000 1150000
-				1200000 1125000
-				1100000 1100000
-				1000000 1075000
-				 900000 1050000
-				 800000 1025000
-				 700000 1012500
-				 600000 1000000
-				 500000  975000
-				 400000  950000
-				 300000  937500
-				 200000  925000
-			>;
-			cooling-min-level = <15>;
-			cooling-max-level = <9>;
+			operating-points-v2 = <&cpu0_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 		cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <1>;
-			clock-frequency = <1700000000>;
+			clocks = <&clock CLK_ARM_CLK>;
+			clock-names = "cpu";
+			operating-points-v2 = <&cpu0_opp_table>;
+			#cooling-cells = <2>; /* min followed by max */
+		};
+	};
+
+	cpu0_opp_table: opp_table0 {
+		compatible = "operating-points-v2";
+		opp-shared;
+
+		opp-200000000 {
+			opp-hz = /bits/ 64 <200000000>;
+			opp-microvolt = <925000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-300000000 {
+			opp-hz = /bits/ 64 <300000000>;
+			opp-microvolt = <937500>;
+			clock-latency-ns = <140000>;
+		};
+		opp-400000000 {
+			opp-hz = /bits/ 64 <400000000>;
+			opp-microvolt = <950000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-500000000 {
+			opp-hz = /bits/ 64 <500000000>;
+			opp-microvolt = <975000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt = <1000000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-700000000 {
+			opp-hz = /bits/ 64 <700000000>;
+			opp-microvolt = <1012500>;
+			clock-latency-ns = <140000>;
+		};
+		opp-800000000 {
+			opp-hz = /bits/ 64 <800000000>;
+			opp-microvolt = <1025000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-900000000 {
+			opp-hz = /bits/ 64 <900000000>;
+			opp-microvolt = <1050000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1000000000 {
+			opp-hz = /bits/ 64 <1000000000>;
+			opp-microvolt = <1075000>;
+			clock-latency-ns = <140000>;
+			opp-suspend;
+		};
+		opp-1100000000 {
+			opp-hz = /bits/ 64 <1100000000>;
+			opp-microvolt = <1100000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1200000000 {
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt = <1125000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1300000000 {
+			opp-hz = /bits/ 64 <1300000000>;
+			opp-microvolt = <1150000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1400000000 {
+			opp-hz = /bits/ 64 <1400000000>;
+			opp-microvolt = <1200000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1500000000 {
+			opp-hz = /bits/ 64 <1500000000>;
+			opp-microvolt = <1225000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1600000000 {
+			opp-hz = /bits/ 64 <1600000000>;
+			opp-microvolt = <1250000>;
+			clock-latency-ns = <140000>;
+		};
+		opp-1700000000 {
+			opp-hz = /bits/ 64 <1700000000>;
+			opp-microvolt = <1300000>;
+			clock-latency-ns = <140000>;
 		};
 	};
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5420-cpus.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5420-cpus.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5420-cpus.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5420-cpus.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -33,8 +33,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -45,8 +43,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -57,8 +53,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -69,8 +63,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -82,8 +74,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <7>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -94,8 +84,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <7>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -106,8 +94,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <7>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -118,8 +104,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <7>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5422-cpus.dtsi linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5422-cpus.dtsi
--- linux-libre-4.9.136-gnu/arch/arm/boot/dts/exynos5422-cpus.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm/boot/dts/exynos5422-cpus.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -32,8 +32,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -44,8 +42,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -56,8 +52,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -68,8 +62,6 @@
 			clock-frequency = <1000000000>;
 			cci-control-port = <&cci_control0>;
 			operating-points-v2 = <&cluster_a7_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <11>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -81,8 +73,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <15>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -93,8 +83,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <15>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -105,8 +93,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <15>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 
@@ -117,8 +103,6 @@
 			clock-frequency = <1800000000>;
 			cci-control-port = <&cci_control1>;
 			operating-points-v2 = <&cluster_a15_opp_table>;
-			cooling-min-level = <0>;
-			cooling-max-level = <15>;
 			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi linux-libre-4.9.137-gnu/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
--- linux-libre-4.9.136-gnu/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi	2018-11-13 14:17:06.000000000 -0500
@@ -249,7 +249,7 @@
 
 		sysmgr: sysmgr@ffd12000 {
 			compatible = "altr,sys-mgr", "syscon";
-			reg = <0xffd12000 0x1000>;
+			reg = <0xffd12000 0x228>;
 		};
 
 		/* Local timer */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/arm64/lib/Makefile linux-libre-4.9.137-gnu/arch/arm64/lib/Makefile
--- linux-libre-4.9.136-gnu/arch/arm64/lib/Makefile	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/arm64/lib/Makefile	2018-11-13 14:17:06.000000000 -0500
@@ -11,7 +11,7 @@ lib-y		:= bitops.o clear_user.o delay.o
 # when supported by the CPU. Result and argument registers are handled
 # correctly, based on the function prototype.
 lib-$(CONFIG_ARM64_LSE_ATOMICS) += atomic_ll_sc.o
-CFLAGS_atomic_ll_sc.o	:= -fcall-used-x0 -ffixed-x1 -ffixed-x2		\
+CFLAGS_atomic_ll_sc.o	:= -ffixed-x1 -ffixed-x2        		\
 		   -ffixed-x3 -ffixed-x4 -ffixed-x5 -ffixed-x6		\
 		   -ffixed-x7 -fcall-saved-x8 -fcall-saved-x9		\
 		   -fcall-saved-x10 -fcall-saved-x11 -fcall-saved-x12	\
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/mips/cavium-octeon/executive/cvmx-helper.c linux-libre-4.9.137-gnu/arch/mips/cavium-octeon/executive/cvmx-helper.c
--- linux-libre-4.9.136-gnu/arch/mips/cavium-octeon/executive/cvmx-helper.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/mips/cavium-octeon/executive/cvmx-helper.c	2018-11-13 14:17:06.000000000 -0500
@@ -67,7 +67,7 @@ void (*cvmx_override_pko_queue_priority)
 void (*cvmx_override_ipd_port_setup) (int ipd_port);
 
 /* Port count per interface */
-static int interface_port_count[5];
+static int interface_port_count[9];
 
 /* Port last configured link info index by IPD/PKO port */
 static cvmx_helper_link_info_t
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/parisc/kernel/entry.S linux-libre-4.9.137-gnu/arch/parisc/kernel/entry.S
--- linux-libre-4.9.136-gnu/arch/parisc/kernel/entry.S	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/parisc/kernel/entry.S	2018-11-13 14:17:06.000000000 -0500
@@ -185,7 +185,7 @@
 	bv,n	0(%r3)
 	nop
 	.word	0		/* checksum (will be patched) */
-	.word	PA(os_hpmc)	/* address of handler */
+	.word	0		/* address of handler */
 	.word	0		/* length of handler */
 	.endm
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/parisc/kernel/traps.c linux-libre-4.9.137-gnu/arch/parisc/kernel/traps.c
--- linux-libre-4.9.136-gnu/arch/parisc/kernel/traps.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/parisc/kernel/traps.c	2018-11-13 14:17:06.000000000 -0500
@@ -826,7 +826,8 @@ void __init initialize_ivt(const void *i
 	for (i = 0; i < 8; i++)
 	    *ivap++ = 0;
 
-	/* Compute Checksum for HPMC handler */
+	/* Setup IVA and compute checksum for HPMC handler */
+	ivap[6] = (u32)__pa(os_hpmc);
 	length = os_hpmc_size;
 	ivap[7] = length;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/parisc/mm/init.c linux-libre-4.9.137-gnu/arch/parisc/mm/init.c
--- linux-libre-4.9.136-gnu/arch/parisc/mm/init.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/parisc/mm/init.c	2018-11-13 14:17:06.000000000 -0500
@@ -491,12 +491,8 @@ static void __init map_pages(unsigned lo
 						pte = pte_mkhuge(pte);
 				}
 
-				if (address >= end_paddr) {
-					if (force)
-						break;
-					else
-						pte_val(pte) = 0;
-				}
+				if (address >= end_paddr)
+					break;
 
 				set_pte(pg_table, pte);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/powerpc/include/asm/mpic.h linux-libre-4.9.137-gnu/arch/powerpc/include/asm/mpic.h
--- linux-libre-4.9.136-gnu/arch/powerpc/include/asm/mpic.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/powerpc/include/asm/mpic.h	2018-11-13 14:17:06.000000000 -0500
@@ -392,7 +392,14 @@ extern struct bus_type mpic_subsys;
 #define	MPIC_REGSET_TSI108		MPIC_REGSET(1)	/* Tsi108/109 PIC */
 
 /* Get the version of primary MPIC */
+#ifdef CONFIG_MPIC
 extern u32 fsl_mpic_primary_get_version(void);
+#else
+static inline u32 fsl_mpic_primary_get_version(void)
+{
+	return 0;
+}
+#endif
 
 /* Allocate the controller structure and setup the linux irq descs
  * for the range if interrupts passed in. No HW initialization is
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/s390/kvm/sthyi.c linux-libre-4.9.137-gnu/arch/s390/kvm/sthyi.c
--- linux-libre-4.9.136-gnu/arch/s390/kvm/sthyi.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/s390/kvm/sthyi.c	2018-11-13 14:17:06.000000000 -0500
@@ -174,17 +174,19 @@ static void fill_hdr(struct sthyi_sctns
 static void fill_stsi_mac(struct sthyi_sctns *sctns,
 			  struct sysinfo_1_1_1 *sysinfo)
 {
+	sclp_ocf_cpc_name_copy(sctns->mac.infmname);
+	if (*(u64 *)sctns->mac.infmname != 0)
+		sctns->mac.infmval1 |= MAC_NAME_VLD;
+
 	if (stsi(sysinfo, 1, 1, 1))
 		return;
 
-	sclp_ocf_cpc_name_copy(sctns->mac.infmname);
-
 	memcpy(sctns->mac.infmtype, sysinfo->type, sizeof(sctns->mac.infmtype));
 	memcpy(sctns->mac.infmmanu, sysinfo->manufacturer, sizeof(sctns->mac.infmmanu));
 	memcpy(sctns->mac.infmpman, sysinfo->plant, sizeof(sctns->mac.infmpman));
 	memcpy(sctns->mac.infmseq, sysinfo->sequence, sizeof(sctns->mac.infmseq));
 
-	sctns->mac.infmval1 |= MAC_ID_VLD | MAC_NAME_VLD;
+	sctns->mac.infmval1 |= MAC_ID_VLD;
 }
 
 static void fill_stsi_par(struct sthyi_sctns *sctns,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/sparc/include/asm/cpudata_64.h linux-libre-4.9.137-gnu/arch/sparc/include/asm/cpudata_64.h
--- linux-libre-4.9.136-gnu/arch/sparc/include/asm/cpudata_64.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/sparc/include/asm/cpudata_64.h	2018-11-13 14:17:06.000000000 -0500
@@ -27,7 +27,7 @@ typedef struct {
 	unsigned short	sock_id;	/* physical package */
 	unsigned short	core_id;
 	unsigned short  max_cache_id;	/* groupings of highest shared cache */
-	unsigned short	proc_id;	/* strand (aka HW thread) id */
+	signed short	proc_id;	/* strand (aka HW thread) id */
 } cpuinfo_sparc;
 
 DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/sparc/kernel/perf_event.c linux-libre-4.9.137-gnu/arch/sparc/kernel/perf_event.c
--- linux-libre-4.9.136-gnu/arch/sparc/kernel/perf_event.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/sparc/kernel/perf_event.c	2018-11-13 14:17:06.000000000 -0500
@@ -926,6 +926,8 @@ static void read_in_all_counters(struct
 			sparc_perf_event_update(cp, &cp->hw,
 						cpuc->current_idx[i]);
 			cpuc->current_idx[i] = PIC_NO_INDEX;
+			if (cp->hw.state & PERF_HES_STOPPED)
+				cp->hw.state |= PERF_HES_ARCH;
 		}
 	}
 }
@@ -958,10 +960,12 @@ static void calculate_single_pcr(struct
 
 		enc = perf_event_get_enc(cpuc->events[i]);
 		cpuc->pcr[0] &= ~mask_for_index(idx);
-		if (hwc->state & PERF_HES_STOPPED)
+		if (hwc->state & PERF_HES_ARCH) {
 			cpuc->pcr[0] |= nop_for_index(idx);
-		else
+		} else {
 			cpuc->pcr[0] |= event_encoding(enc, idx);
+			hwc->state = 0;
+		}
 	}
 out:
 	cpuc->pcr[0] |= cpuc->event[0]->hw.config_base;
@@ -987,6 +991,9 @@ static void calculate_multiple_pcrs(stru
 
 		cpuc->current_idx[i] = idx;
 
+		if (cp->hw.state & PERF_HES_ARCH)
+			continue;
+
 		sparc_pmu_start(cp, PERF_EF_RELOAD);
 	}
 out:
@@ -1078,6 +1085,8 @@ static void sparc_pmu_start(struct perf_
 	event->hw.state = 0;
 
 	sparc_pmu_enable_event(cpuc, &event->hw, idx);
+
+	perf_event_update_userpage(event);
 }
 
 static void sparc_pmu_stop(struct perf_event *event, int flags)
@@ -1370,9 +1379,9 @@ static int sparc_pmu_add(struct perf_eve
 	cpuc->events[n0] = event->hw.event_base;
 	cpuc->current_idx[n0] = PIC_NO_INDEX;
 
-	event->hw.state = PERF_HES_UPTODATE;
+	event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
 	if (!(ef_flags & PERF_EF_START))
-		event->hw.state |= PERF_HES_STOPPED;
+		event->hw.state |= PERF_HES_ARCH;
 
 	/*
 	 * If group events scheduling transaction was started,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/boot/tools/build.c linux-libre-4.9.137-gnu/arch/x86/boot/tools/build.c
--- linux-libre-4.9.136-gnu/arch/x86/boot/tools/build.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/boot/tools/build.c	2018-11-13 14:17:06.000000000 -0500
@@ -390,6 +390,13 @@ int main(int argc, char ** argv)
 		die("Unable to mmap '%s': %m", argv[2]);
 	/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
 	sys_size = (sz + 15 + 4) / 16;
+#ifdef CONFIG_EFI_STUB
+	/*
+	 * COFF requires minimum 32-byte alignment of sections, and
+	 * adding a signature is problematic without that alignment.
+	 */
+	sys_size = (sys_size + 1) & ~1;
+#endif
 
 	/* Patch the setup code with the appropriate size parameters */
 	buf[0x1f1] = setup_sectors-1;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/include/asm/cpufeatures.h linux-libre-4.9.137-gnu/arch/x86/include/asm/cpufeatures.h
--- linux-libre-4.9.136-gnu/arch/x86/include/asm/cpufeatures.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/include/asm/cpufeatures.h	2018-11-13 14:17:06.000000000 -0500
@@ -213,6 +213,7 @@
 #define X86_FEATURE_STIBP	( 7*32+27) /* Single Thread Indirect Branch Predictors */
 #define X86_FEATURE_ZEN		( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
 #define X86_FEATURE_L1TF_PTEINV	( 7*32+29) /* "" L1TF workaround PTE inversion */
+#define X86_FEATURE_IBRS_ENHANCED	( 7*32+30) /* Enhanced IBRS */
 
 /* Virtualization flags: Linux defined, word 8 */
 #define X86_FEATURE_TPR_SHADOW  ( 8*32+ 0) /* Intel TPR Shadow */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/include/asm/nospec-branch.h linux-libre-4.9.137-gnu/arch/x86/include/asm/nospec-branch.h
--- linux-libre-4.9.136-gnu/arch/x86/include/asm/nospec-branch.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/include/asm/nospec-branch.h	2018-11-13 14:17:06.000000000 -0500
@@ -215,6 +215,7 @@ enum spectre_v2_mitigation {
 	SPECTRE_V2_RETPOLINE_GENERIC,
 	SPECTRE_V2_RETPOLINE_AMD,
 	SPECTRE_V2_IBRS,
+	SPECTRE_V2_IBRS_ENHANCED,
 };
 
 /* The Speculative Store Bypass disable variants */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/kernel/check.c linux-libre-4.9.137-gnu/arch/x86/kernel/check.c
--- linux-libre-4.9.136-gnu/arch/x86/kernel/check.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/kernel/check.c	2018-11-13 14:17:06.000000000 -0500
@@ -30,6 +30,11 @@ static __init int set_corruption_check(c
 	ssize_t ret;
 	unsigned long val;
 
+	if (!arg) {
+		pr_err("memory_corruption_check config string not provided\n");
+		return -EINVAL;
+	}
+
 	ret = kstrtoul(arg, 10, &val);
 	if (ret)
 		return ret;
@@ -44,6 +49,11 @@ static __init int set_corruption_check_p
 	ssize_t ret;
 	unsigned long val;
 
+	if (!arg) {
+		pr_err("memory_corruption_check_period config string not provided\n");
+		return -EINVAL;
+	}
+
 	ret = kstrtoul(arg, 10, &val);
 	if (ret)
 		return ret;
@@ -58,6 +68,11 @@ static __init int set_corruption_check_s
 	char *end;
 	unsigned size;
 
+	if (!arg) {
+		pr_err("memory_corruption_check_size config string not provided\n");
+		return -EINVAL;
+	}
+
 	size = memparse(arg, &end);
 
 	if (*end == '\0')
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/kernel/cpu/bugs.c linux-libre-4.9.137-gnu/arch/x86/kernel/cpu/bugs.c
--- linux-libre-4.9.136-gnu/arch/x86/kernel/cpu/bugs.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/kernel/cpu/bugs.c	2018-11-13 14:17:06.000000000 -0500
@@ -33,12 +33,10 @@ static void __init spectre_v2_select_mit
 static void __init ssb_select_mitigation(void);
 static void __init l1tf_select_mitigation(void);
 
-/*
- * Our boot-time value of the SPEC_CTRL MSR. We read it once so that any
- * writes to SPEC_CTRL contain whatever reserved bits have been set.
- */
-u64 __ro_after_init x86_spec_ctrl_base;
+/* The base value of the SPEC_CTRL MSR that always has to be preserved. */
+u64 x86_spec_ctrl_base;
 EXPORT_SYMBOL_GPL(x86_spec_ctrl_base);
+static DEFINE_MUTEX(spec_ctrl_mutex);
 
 /*
  * The vendor and possibly platform specific bits which can be modified in
@@ -139,6 +137,7 @@ static const char *spectre_v2_strings[]
 	[SPECTRE_V2_RETPOLINE_MINIMAL_AMD]	= "Vulnerable: Minimal AMD ASM retpoline",
 	[SPECTRE_V2_RETPOLINE_GENERIC]		= "Mitigation: Full generic retpoline",
 	[SPECTRE_V2_RETPOLINE_AMD]		= "Mitigation: Full AMD retpoline",
+	[SPECTRE_V2_IBRS_ENHANCED]		= "Mitigation: Enhanced IBRS",
 };
 
 #undef pr_fmt
@@ -321,6 +320,46 @@ static enum spectre_v2_mitigation_cmd __
 	return cmd;
 }
 
+static bool stibp_needed(void)
+{
+	if (spectre_v2_enabled == SPECTRE_V2_NONE)
+		return false;
+
+	if (!boot_cpu_has(X86_FEATURE_STIBP))
+		return false;
+
+	return true;
+}
+
+static void update_stibp_msr(void *info)
+{
+	wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
+}
+
+void arch_smt_update(void)
+{
+	u64 mask;
+
+	if (!stibp_needed())
+		return;
+
+	mutex_lock(&spec_ctrl_mutex);
+	mask = x86_spec_ctrl_base;
+	if (cpu_smt_control == CPU_SMT_ENABLED)
+		mask |= SPEC_CTRL_STIBP;
+	else
+		mask &= ~SPEC_CTRL_STIBP;
+
+	if (mask != x86_spec_ctrl_base) {
+		pr_info("Spectre v2 cross-process SMT mitigation: %s STIBP\n",
+				cpu_smt_control == CPU_SMT_ENABLED ?
+				"Enabling" : "Disabling");
+		x86_spec_ctrl_base = mask;
+		on_each_cpu(update_stibp_msr, NULL, 1);
+	}
+	mutex_unlock(&spec_ctrl_mutex);
+}
+
 static void __init spectre_v2_select_mitigation(void)
 {
 	enum spectre_v2_mitigation_cmd cmd = spectre_v2_parse_cmdline();
@@ -340,6 +379,13 @@ static void __init spectre_v2_select_mit
 
 	case SPECTRE_V2_CMD_FORCE:
 	case SPECTRE_V2_CMD_AUTO:
+		if (boot_cpu_has(X86_FEATURE_IBRS_ENHANCED)) {
+			mode = SPECTRE_V2_IBRS_ENHANCED;
+			/* Force it so VMEXIT will restore correctly */
+			x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
+			wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
+			goto specv2_set_mode;
+		}
 		if (IS_ENABLED(CONFIG_RETPOLINE))
 			goto retpoline_auto;
 		break;
@@ -377,6 +423,7 @@ retpoline_auto:
 		setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
 	}
 
+specv2_set_mode:
 	spectre_v2_enabled = mode;
 	pr_info("%s\n", spectre_v2_strings[mode]);
 
@@ -399,12 +446,22 @@ retpoline_auto:
 
 	/*
 	 * Retpoline means the kernel is safe because it has no indirect
-	 * branches. But firmware isn't, so use IBRS to protect that.
+	 * branches. Enhanced IBRS protects firmware too, so, enable restricted
+	 * speculation around firmware calls only when Enhanced IBRS isn't
+	 * supported.
+	 *
+	 * Use "mode" to check Enhanced IBRS instead of boot_cpu_has(), because
+	 * the user might select retpoline on the kernel command line and if
+	 * the CPU supports Enhanced IBRS, kernel might un-intentionally not
+	 * enable IBRS around firmware calls.
 	 */
-	if (boot_cpu_has(X86_FEATURE_IBRS)) {
+	if (boot_cpu_has(X86_FEATURE_IBRS) && mode != SPECTRE_V2_IBRS_ENHANCED) {
 		setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW);
 		pr_info("Enabling Restricted Speculation for firmware calls\n");
 	}
+
+	/* Enable STIBP if appropriate */
+	arch_smt_update();
 }
 
 #undef pr_fmt
@@ -797,6 +854,8 @@ static ssize_t l1tf_show_state(char *buf
 static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr,
 			       char *buf, unsigned int bug)
 {
+	int ret;
+
 	if (!boot_cpu_has_bug(bug))
 		return sprintf(buf, "Not affected\n");
 
@@ -811,10 +870,12 @@ static ssize_t cpu_show_common(struct de
 		return sprintf(buf, "Mitigation: __user pointer sanitization\n");
 
 	case X86_BUG_SPECTRE_V2:
-		return sprintf(buf, "%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
+		ret = sprintf(buf, "%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
 			       boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "",
 			       boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
+			       (x86_spec_ctrl_base & SPEC_CTRL_STIBP) ? ", STIBP" : "",
 			       spectre_v2_module_string());
+		return ret;
 
 	case X86_BUG_SPEC_STORE_BYPASS:
 		return sprintf(buf, "%s\n", ssb_strings[ssb_mode]);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/kernel/cpu/common.c linux-libre-4.9.137-gnu/arch/x86/kernel/cpu/common.c
--- linux-libre-4.9.136-gnu/arch/x86/kernel/cpu/common.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/kernel/cpu/common.c	2018-11-13 14:17:06.000000000 -0500
@@ -959,6 +959,9 @@ static void __init cpu_set_bug_bits(stru
 	setup_force_cpu_bug(X86_BUG_SPECTRE_V1);
 	setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
 
+	if (ia32_cap & ARCH_CAP_IBRS_ALL)
+		setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
+
 	if (x86_match_cpu(cpu_no_meltdown))
 		return;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/kernel/fpu/signal.c linux-libre-4.9.137-gnu/arch/x86/kernel/fpu/signal.c
--- linux-libre-4.9.136-gnu/arch/x86/kernel/fpu/signal.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/kernel/fpu/signal.c	2018-11-13 14:17:06.000000000 -0500
@@ -309,7 +309,6 @@ static int __fpu__restore_sig(void __use
 		 * thread's fpu state, reconstruct fxstate from the fsave
 		 * header. Sanitize the copied state etc.
 		 */
-		struct fpu *fpu = &tsk->thread.fpu;
 		struct user_i387_ia32_struct env;
 		int err = 0;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/platform/olpc/olpc-xo1-rtc.c linux-libre-4.9.137-gnu/arch/x86/platform/olpc/olpc-xo1-rtc.c
--- linux-libre-4.9.136-gnu/arch/x86/platform/olpc/olpc-xo1-rtc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/platform/olpc/olpc-xo1-rtc.c	2018-11-13 14:17:06.000000000 -0500
@@ -16,6 +16,7 @@
 
 #include <asm/msr.h>
 #include <asm/olpc.h>
+#include <asm/x86_init.h>
 
 static void rtc_wake_on(struct device *dev)
 {
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)
 	if (r)
 		return r;
 
+	x86_platform.legacy.rtc = 0;
+
 	device_init_wakeup(&xo1_rtc_device.dev, 1);
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/arch/x86/xen/spinlock.c linux-libre-4.9.137-gnu/arch/x86/xen/spinlock.c
--- linux-libre-4.9.136-gnu/arch/x86/xen/spinlock.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/arch/x86/xen/spinlock.c	2018-11-13 14:17:06.000000000 -0500
@@ -8,6 +8,7 @@
 #include <linux/log2.h>
 #include <linux/gfp.h>
 #include <linux/slab.h>
+#include <linux/atomic.h>
 
 #include <asm/paravirt.h>
 
@@ -19,6 +20,7 @@
 
 static DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
 static DEFINE_PER_CPU(char *, irq_name);
+static DEFINE_PER_CPU(atomic_t, xen_qlock_wait_nest);
 static bool xen_pvspin = true;
 
 #include <asm/qspinlock.h>
@@ -40,33 +42,24 @@ static void xen_qlock_kick(int cpu)
 static void xen_qlock_wait(u8 *byte, u8 val)
 {
 	int irq = __this_cpu_read(lock_kicker_irq);
+	atomic_t *nest_cnt = this_cpu_ptr(&xen_qlock_wait_nest);
 
 	/* If kicker interrupts not initialized yet, just spin */
-	if (irq == -1)
+	if (irq == -1 || in_nmi())
 		return;
 
-	/* clear pending */
-	xen_clear_irq_pending(irq);
-	barrier();
-
-	/*
-	 * We check the byte value after clearing pending IRQ to make sure
-	 * that we won't miss a wakeup event because of the clearing.
-	 *
-	 * The sync_clear_bit() call in xen_clear_irq_pending() is atomic.
-	 * So it is effectively a memory barrier for x86.
-	 */
-	if (READ_ONCE(*byte) != val)
-		return;
+	/* Detect reentry. */
+	atomic_inc(nest_cnt);
 
-	/*
-	 * If an interrupt happens here, it will leave the wakeup irq
-	 * pending, which will cause xen_poll_irq() to return
-	 * immediately.
-	 */
+	/* If irq pending already and no nested call clear it. */
+	if (atomic_read(nest_cnt) == 1 && xen_test_irq_pending(irq)) {
+		xen_clear_irq_pending(irq);
+	} else if (READ_ONCE(*byte) == val) {
+		/* Block until irq becomes pending (or a spurious wakeup) */
+		xen_poll_irq(irq);
+	}
 
-	/* Block until irq becomes pending (or perhaps a spurious wakeup) */
-	xen_poll_irq(irq);
+	atomic_dec(nest_cnt);
 }
 
 static irqreturn_t dummy_handler(int irq, void *dev_id)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/crypto/lrw.c linux-libre-4.9.137-gnu/crypto/lrw.c
--- linux-libre-4.9.136-gnu/crypto/lrw.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/crypto/lrw.c	2018-11-13 14:17:06.000000000 -0500
@@ -132,7 +132,12 @@ static inline int get_index128(be128 *bl
 		return x + ffz(val);
 	}
 
-	return x;
+	/*
+	 * If we get here, then x == 128 and we are incrementing the counter
+	 * from all ones to all zeros. This means we must return index 127, i.e.
+	 * the one corresponding to key2*{ 1,...,1 }.
+	 */
+	return 127;
 }
 
 static int crypt(struct blkcipher_desc *d,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/crypto/tcrypt.c linux-libre-4.9.137-gnu/crypto/tcrypt.c
--- linux-libre-4.9.136-gnu/crypto/tcrypt.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/crypto/tcrypt.c	2018-11-13 14:17:06.000000000 -0500
@@ -729,6 +729,9 @@ static void test_ahash_speed_common(cons
 			break;
 		}
 
+		if (speed[i].klen)
+			crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
+
 		pr_info("test%3u "
 			"(%5u byte blocks,%5u bytes per update,%4u updates): ",
 			i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/acpi/acpi_lpss.c linux-libre-4.9.137-gnu/drivers/acpi/acpi_lpss.c
--- linux-libre-4.9.136-gnu/drivers/acpi/acpi_lpss.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/acpi/acpi_lpss.c	2018-11-13 14:17:06.000000000 -0500
@@ -278,9 +278,11 @@ static const struct acpi_device_id acpi_
 	{ "INT33FC", },
 
 	/* Braswell LPSS devices */
+	{ "80862286", LPSS_ADDR(lpss_dma_desc) },
 	{ "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
 	{ "8086228A", LPSS_ADDR(bsw_uart_dev_desc) },
 	{ "8086228E", LPSS_ADDR(bsw_spi_dev_desc) },
+	{ "808622C0", LPSS_ADDR(lpss_dma_desc) },
 	{ "808622C1", LPSS_ADDR(bsw_i2c_dev_desc) },
 
 	/* Broadwell LPSS devices */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/block/ataflop.c linux-libre-4.9.137-gnu/drivers/block/ataflop.c
--- linux-libre-4.9.136-gnu/drivers/block/ataflop.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/block/ataflop.c	2018-11-13 14:17:06.000000000 -0500
@@ -1933,6 +1933,11 @@ static int __init atari_floppy_init (voi
 		unit[i].disk = alloc_disk(1);
 		if (!unit[i].disk)
 			goto Enomem;
+
+		unit[i].disk->queue = blk_init_queue(do_fd_request,
+						     &ataflop_lock);
+		if (!unit[i].disk->queue)
+			goto Enomem;
 	}
 
 	if (UseTrackbuffer < 0)
@@ -1964,10 +1969,6 @@ static int __init atari_floppy_init (voi
 		sprintf(unit[i].disk->disk_name, "fd%d", i);
 		unit[i].disk->fops = &floppy_fops;
 		unit[i].disk->private_data = &unit[i];
-		unit[i].disk->queue = blk_init_queue(do_fd_request,
-					&ataflop_lock);
-		if (!unit[i].disk->queue)
-			goto Enomem;
 		set_capacity(unit[i].disk, MAX_DISK_SIZE * 2);
 		add_disk(unit[i].disk);
 	}
@@ -1982,13 +1983,17 @@ static int __init atari_floppy_init (voi
 
 	return 0;
 Enomem:
-	while (i--) {
-		struct request_queue *q = unit[i].disk->queue;
+	do {
+		struct gendisk *disk = unit[i].disk;
 
-		put_disk(unit[i].disk);
-		if (q)
-			blk_cleanup_queue(q);
-	}
+		if (disk) {
+			if (disk->queue) {
+				blk_cleanup_queue(disk->queue);
+				disk->queue = NULL;
+			}
+			put_disk(unit[i].disk);
+		}
+	} while (i--);
 
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
 	return -ENOMEM;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/block/swim.c linux-libre-4.9.137-gnu/drivers/block/swim.c
--- linux-libre-4.9.136-gnu/drivers/block/swim.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/block/swim.c	2018-11-13 14:17:06.000000000 -0500
@@ -868,8 +868,17 @@ static int swim_floppy_init(struct swim_
 
 exit_put_disks:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
-	while (drive--)
-		put_disk(swd->unit[drive].disk);
+	do {
+		struct gendisk *disk = swd->unit[drive].disk;
+
+		if (disk) {
+			if (disk->queue) {
+				blk_cleanup_queue(disk->queue);
+				disk->queue = NULL;
+			}
+			put_disk(disk);
+		}
+	} while (drive--);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/block/xen-blkfront.c linux-libre-4.9.137-gnu/drivers/block/xen-blkfront.c
--- linux-libre-4.9.136-gnu/drivers/block/xen-blkfront.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/block/xen-blkfront.c	2018-11-13 14:17:06.000000000 -0500
@@ -2524,6 +2524,9 @@ static int blkfront_remove(struct xenbus
 
 	dev_dbg(&xbdev->dev, "%s removed", xbdev->nodename);
 
+	if (!info)
+		return 0;
+
 	blkif_free(info, 0);
 
 	mutex_lock(&info->mutex);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/bluetooth/btbcm.c linux-libre-4.9.137-gnu/drivers/bluetooth/btbcm.c
--- linux-libre-4.9.136-gnu/drivers/bluetooth/btbcm.c	2018-11-10 14:14:35.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/bluetooth/btbcm.c	2018-11-13 17:55:25.000000000 -0500
@@ -270,6 +270,7 @@ static const struct {
 	{ 0x4103, "BCM4330B1"	},	/* 002.001.003 */
 	{ 0x410e, "BCM43341B0"	},	/* 002.001.014 */
 	{ 0x4406, "BCM4324B3"	},	/* 002.004.006 */
+	{ 0x6109, "BCM4335C0"	},	/* 003.001.009 */
 	{ 0x610c, "BCM4354"	},	/* 003.001.012 */
 	{ }
 };
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/char/ipmi/ipmi_ssif.c linux-libre-4.9.137-gnu/drivers/char/ipmi/ipmi_ssif.c
--- linux-libre-4.9.136-gnu/drivers/char/ipmi/ipmi_ssif.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/char/ipmi/ipmi_ssif.c	2018-11-13 14:17:06.000000000 -0500
@@ -617,8 +617,9 @@ static void msg_done_handler(struct ssif
 			flags = ipmi_ssif_lock_cond(ssif_info, &oflags);
 			ssif_info->waiting_alert = true;
 			ssif_info->rtc_us_timer = SSIF_MSG_USEC;
-			mod_timer(&ssif_info->retry_timer,
-				  jiffies + SSIF_MSG_JIFFIES);
+			if (!ssif_info->stopping)
+				mod_timer(&ssif_info->retry_timer,
+					  jiffies + SSIF_MSG_JIFFIES);
 			ipmi_ssif_unlock_cond(ssif_info, flags);
 			return;
 		}
@@ -950,8 +951,9 @@ static void msg_written_handler(struct s
 			ssif_info->waiting_alert = true;
 			ssif_info->retries_left = SSIF_RECV_RETRIES;
 			ssif_info->rtc_us_timer = SSIF_MSG_PART_USEC;
-			mod_timer(&ssif_info->retry_timer,
-				  jiffies + SSIF_MSG_PART_JIFFIES);
+			if (!ssif_info->stopping)
+				mod_timer(&ssif_info->retry_timer,
+					  jiffies + SSIF_MSG_PART_JIFFIES);
 			ipmi_ssif_unlock_cond(ssif_info, flags);
 		}
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/char/tpm/tpm-interface.c linux-libre-4.9.137-gnu/drivers/char/tpm/tpm-interface.c
--- linux-libre-4.9.136-gnu/drivers/char/tpm/tpm-interface.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/char/tpm/tpm-interface.c	2018-11-13 14:17:06.000000000 -0500
@@ -420,7 +420,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip
 	header = cmd;
 
 	err = be32_to_cpu(header->return_code);
-	if (err != 0 && desc)
+	if (err != 0 && err != TPM_ERR_DISABLED && err != TPM_ERR_DEACTIVATED
+	    && desc)
 		dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
 			desc);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/char/tpm/xen-tpmfront.c linux-libre-4.9.137-gnu/drivers/char/tpm/xen-tpmfront.c
--- linux-libre-4.9.136-gnu/drivers/char/tpm/xen-tpmfront.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/char/tpm/xen-tpmfront.c	2018-11-13 14:17:06.000000000 -0500
@@ -203,7 +203,7 @@ static int setup_ring(struct xenbus_devi
 		return -ENOMEM;
 	}
 
-	rv = xenbus_grant_ring(dev, &priv->shr, 1, &gref);
+	rv = xenbus_grant_ring(dev, priv->shr, 1, &gref);
 	if (rv < 0)
 		return rv;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/cpufreq/cpufreq-dt.c linux-libre-4.9.137-gnu/drivers/cpufreq/cpufreq-dt.c
--- linux-libre-4.9.136-gnu/drivers/cpufreq/cpufreq-dt.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/cpufreq/cpufreq-dt.c	2018-11-13 14:17:06.000000000 -0500
@@ -32,6 +32,7 @@ struct private_data {
 	struct device *cpu_dev;
 	struct thermal_cooling_device *cdev;
 	const char *reg_name;
+	bool have_static_opps;
 };
 
 static struct freq_attr *cpufreq_dt_attr[] = {
@@ -197,6 +198,15 @@ static int cpufreq_init(struct cpufreq_p
 		}
 	}
 
+	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+	if (!priv) {
+		ret = -ENOMEM;
+		goto out_put_regulator;
+	}
+
+	priv->reg_name = name;
+	priv->opp_table = opp_table;
+
 	/*
 	 * Initialize OPP tables for all policy->cpus. They will be shared by
 	 * all CPUs which have marked their CPUs shared with OPP bindings.
@@ -207,7 +217,8 @@ static int cpufreq_init(struct cpufreq_p
 	 *
 	 * OPPs might be populated at runtime, don't check for error here
 	 */
-	dev_pm_opp_of_cpumask_add_table(policy->cpus);
+	if (!dev_pm_opp_of_cpumask_add_table(policy->cpus))
+		priv->have_static_opps = true;
 
 	/*
 	 * But we need OPP table to function so if it is not there let's
@@ -233,19 +244,10 @@ static int cpufreq_init(struct cpufreq_p
 				__func__, ret);
 	}
 
-	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-	if (!priv) {
-		ret = -ENOMEM;
-		goto out_free_opp;
-	}
-
-	priv->reg_name = name;
-	priv->opp_table = opp_table;
-
 	ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
 	if (ret) {
 		dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
-		goto out_free_priv;
+		goto out_free_opp;
 	}
 
 	priv->cpu_dev = cpu_dev;
@@ -284,10 +286,11 @@ static int cpufreq_init(struct cpufreq_p
 
 out_free_cpufreq_table:
 	dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
-out_free_priv:
-	kfree(priv);
 out_free_opp:
-	dev_pm_opp_of_cpumask_remove_table(policy->cpus);
+	if (priv->have_static_opps)
+		dev_pm_opp_of_cpumask_remove_table(policy->cpus);
+	kfree(priv);
+out_put_regulator:
 	if (name)
 		dev_pm_opp_put_regulator(opp_table);
 out_put_clk:
@@ -302,7 +305,8 @@ static int cpufreq_exit(struct cpufreq_p
 
 	cpufreq_cooling_unregister(priv->cdev);
 	dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
-	dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
+	if (priv->have_static_opps)
+		dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
 	if (priv->reg_name)
 		dev_pm_opp_put_regulator(priv->opp_table);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/crypto/caam/regs.h linux-libre-4.9.137-gnu/drivers/crypto/caam/regs.h
--- linux-libre-4.9.136-gnu/drivers/crypto/caam/regs.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/crypto/caam/regs.h	2018-11-13 14:17:06.000000000 -0500
@@ -68,22 +68,22 @@
 
 extern bool caam_little_end;
 
-#define caam_to_cpu(len)				\
-static inline u##len caam##len ## _to_cpu(u##len val)	\
-{							\
-	if (caam_little_end)				\
-		return le##len ## _to_cpu(val);		\
-	else						\
-		return be##len ## _to_cpu(val);		\
+#define caam_to_cpu(len)						\
+static inline u##len caam##len ## _to_cpu(u##len val)			\
+{									\
+	if (caam_little_end)						\
+		return le##len ## _to_cpu((__force __le##len)val);	\
+	else								\
+		return be##len ## _to_cpu((__force __be##len)val);	\
 }
 
-#define cpu_to_caam(len)				\
-static inline u##len cpu_to_caam##len(u##len val)	\
-{							\
-	if (caam_little_end)				\
-		return cpu_to_le##len(val);		\
-	else						\
-		return cpu_to_be##len(val);		\
+#define cpu_to_caam(len)					\
+static inline u##len cpu_to_caam##len(u##len val)		\
+{								\
+	if (caam_little_end)					\
+		return (__force u##len)cpu_to_le##len(val);	\
+	else							\
+		return (__force u##len)cpu_to_be##len(val);	\
 }
 
 caam_to_cpu(16)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/dma/dma-jz4780.c linux-libre-4.9.137-gnu/drivers/dma/dma-jz4780.c
--- linux-libre-4.9.136-gnu/drivers/dma/dma-jz4780.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/dma/dma-jz4780.c	2018-11-13 14:17:06.000000000 -0500
@@ -754,6 +754,11 @@ static int jz4780_dma_probe(struct platf
 	struct resource *res;
 	int i, ret;
 
+	if (!dev->of_node) {
+		dev_err(dev, "This driver must be probed from devicetree\n");
+		return -EINVAL;
+	}
+
 	jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL);
 	if (!jzdma)
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/dma/ioat/init.c linux-libre-4.9.137-gnu/drivers/dma/ioat/init.c
--- linux-libre-4.9.136-gnu/drivers/dma/ioat/init.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/dma/ioat/init.c	2018-11-13 14:17:06.000000000 -0500
@@ -1210,8 +1210,15 @@ static void ioat_shutdown(struct pci_dev
 
 		spin_lock_bh(&ioat_chan->prep_lock);
 		set_bit(IOAT_CHAN_DOWN, &ioat_chan->state);
-		del_timer_sync(&ioat_chan->timer);
 		spin_unlock_bh(&ioat_chan->prep_lock);
+		/*
+		 * Synchronization rule for del_timer_sync():
+		 *  - The caller must not hold locks which would prevent
+		 *    completion of the timer's handler.
+		 * So prep_lock cannot be held before calling it.
+		 */
+		del_timer_sync(&ioat_chan->timer);
+
 		/* this should quiesce then reset */
 		ioat_reset_hw(ioat_chan);
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/edac/i7core_edac.c linux-libre-4.9.137-gnu/drivers/edac/i7core_edac.c
--- linux-libre-4.9.136-gnu/drivers/edac/i7core_edac.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/edac/i7core_edac.c	2018-11-13 14:17:06.000000000 -0500
@@ -1711,6 +1711,7 @@ static void i7core_mce_output_error(stru
 	u32 errnum = find_first_bit(&error, 32);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv)
 			tp_event = HW_EVENT_ERR_FATAL;
 		else
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/edac/sb_edac.c linux-libre-4.9.137-gnu/drivers/edac/sb_edac.c
--- linux-libre-4.9.136-gnu/drivers/edac/sb_edac.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/edac/sb_edac.c	2018-11-13 14:17:06.000000000 -0500
@@ -2934,6 +2934,7 @@ static void sbridge_mce_output_error(str
 		recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv) {
 			type = "FATAL";
 			tp_event = HW_EVENT_ERR_FATAL;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/edac/skx_edac.c linux-libre-4.9.137-gnu/drivers/edac/skx_edac.c
--- linux-libre-4.9.136-gnu/drivers/edac/skx_edac.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/edac/skx_edac.c	2018-11-13 14:17:06.000000000 -0500
@@ -606,7 +606,7 @@ sad_found:
 			break;
 		case 2:
 			lchan = (addr >> shift) % 2;
-			lchan = (lchan << 1) | ~lchan;
+			lchan = (lchan << 1) | !lchan;
 			break;
 		case 3:
 			lchan = ((addr >> shift) % 2) << 1;
@@ -897,6 +897,7 @@ static void skx_mce_output_error(struct
 	recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	if (uncorrected_error) {
+		core_err_cnt = 1;
 		if (ripv) {
 			type = "FATAL";
 			tp_event = HW_EVENT_ERR_FATAL;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/hid/usbhid/hiddev.c linux-libre-4.9.137-gnu/drivers/hid/usbhid/hiddev.c
--- linux-libre-4.9.136-gnu/drivers/hid/usbhid/hiddev.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/hid/usbhid/hiddev.c	2018-11-13 14:17:06.000000000 -0500
@@ -521,14 +521,24 @@ static noinline int hiddev_ioctl_usage(s
 			if (cmd == HIDIOCGCOLLECTIONINDEX) {
 				if (uref->usage_index >= field->maxusage)
 					goto inval;
+				uref->usage_index =
+					array_index_nospec(uref->usage_index,
+							   field->maxusage);
 			} else if (uref->usage_index >= field->report_count)
 				goto inval;
 		}
 
-		if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
-		    (uref_multi->num_values > HID_MAX_MULTI_USAGES ||
-		     uref->usage_index + uref_multi->num_values > field->report_count))
-			goto inval;
+		if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
+			if (uref_multi->num_values > HID_MAX_MULTI_USAGES ||
+			    uref->usage_index + uref_multi->num_values >
+			    field->report_count)
+				goto inval;
+
+			uref->usage_index =
+				array_index_nospec(uref->usage_index,
+						   field->report_count -
+						   uref_multi->num_values);
+		}
 
 		switch (cmd) {
 		case HIDIOCGUSAGE:
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/hwmon/pmbus/pmbus.c linux-libre-4.9.137-gnu/drivers/hwmon/pmbus/pmbus.c
--- linux-libre-4.9.136-gnu/drivers/hwmon/pmbus/pmbus.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/hwmon/pmbus/pmbus.c	2018-11-13 14:17:06.000000000 -0500
@@ -118,6 +118,8 @@ static int pmbus_identify(struct i2c_cli
 		} else {
 			info->pages = 1;
 		}
+
+		pmbus_clear_faults(client);
 	}
 
 	if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/hwmon/pmbus/pmbus_core.c linux-libre-4.9.137-gnu/drivers/hwmon/pmbus/pmbus_core.c
--- linux-libre-4.9.136-gnu/drivers/hwmon/pmbus/pmbus_core.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/hwmon/pmbus/pmbus_core.c	2018-11-13 14:17:06.000000000 -0500
@@ -1759,7 +1759,10 @@ static int pmbus_init_common(struct i2c_
 	if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
 		client->flags |= I2C_CLIENT_PEC;
 
-	pmbus_clear_faults(client);
+	if (data->info->pages)
+		pmbus_clear_faults(client);
+	else
+		pmbus_clear_fault_page(client, -1);
 
 	if (info->identify) {
 		ret = (*info->identify)(client, info);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/hwmon/pwm-fan.c linux-libre-4.9.137-gnu/drivers/hwmon/pwm-fan.c
--- linux-libre-4.9.136-gnu/drivers/hwmon/pwm-fan.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/hwmon/pwm-fan.c	2018-11-13 14:17:06.000000000 -0500
@@ -306,9 +306,19 @@ static int pwm_fan_remove(struct platfor
 static int pwm_fan_suspend(struct device *dev)
 {
 	struct pwm_fan_ctx *ctx = dev_get_drvdata(dev);
+	struct pwm_args args;
+	int ret;
+
+	pwm_get_args(ctx->pwm, &args);
+
+	if (ctx->pwm_value) {
+		ret = pwm_config(ctx->pwm, 0, args.period);
+		if (ret < 0)
+			return ret;
 
-	if (ctx->pwm_value)
 		pwm_disable(ctx->pwm);
+	}
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/hwtracing/coresight/coresight-etb10.c linux-libre-4.9.137-gnu/drivers/hwtracing/coresight/coresight-etb10.c
--- linux-libre-4.9.136-gnu/drivers/hwtracing/coresight/coresight-etb10.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/hwtracing/coresight/coresight-etb10.c	2018-11-13 14:17:06.000000000 -0500
@@ -155,6 +155,10 @@ static int etb_enable(struct coresight_d
 	if (val == CS_MODE_PERF)
 		return -EBUSY;
 
+	/* Don't let perf disturb sysFS sessions */
+	if (val == CS_MODE_SYSFS && mode == CS_MODE_PERF)
+		return -EBUSY;
+
 	/* Nothing to do, the tracer is already enabled. */
 	if (val == CS_MODE_SYSFS)
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/i2c/busses/i2c-rcar.c linux-libre-4.9.137-gnu/drivers/i2c/busses/i2c-rcar.c
--- linux-libre-4.9.136-gnu/drivers/i2c/busses/i2c-rcar.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/i2c/busses/i2c-rcar.c	2018-11-13 14:17:06.000000000 -0500
@@ -723,8 +723,12 @@ static int rcar_i2c_master_xfer(struct i
 
 	time_left = wait_event_timeout(priv->wait, priv->flags & ID_DONE,
 				     num * adap->timeout);
-	if (!time_left) {
+
+	/* cleanup DMA if it couldn't complete properly due to an error */
+	if (priv->dma_direction != DMA_NONE)
 		rcar_i2c_cleanup_dma(priv);
+
+	if (!time_left) {
 		rcar_i2c_init(priv);
 		ret = -ETIMEDOUT;
 	} else if (priv->flags & ID_NACK) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/iio/adc/at91_adc.c linux-libre-4.9.137-gnu/drivers/iio/adc/at91_adc.c
--- linux-libre-4.9.136-gnu/drivers/iio/adc/at91_adc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/iio/adc/at91_adc.c	2018-11-13 14:17:06.000000000 -0500
@@ -247,12 +247,14 @@ static irqreturn_t at91_adc_trigger_hand
 	struct iio_poll_func *pf = p;
 	struct iio_dev *idev = pf->indio_dev;
 	struct at91_adc_state *st = iio_priv(idev);
+	struct iio_chan_spec const *chan;
 	int i, j = 0;
 
 	for (i = 0; i < idev->masklength; i++) {
 		if (!test_bit(i, idev->active_scan_mask))
 			continue;
-		st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, i));
+		chan = idev->channels + i;
+		st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel));
 		j++;
 	}
 
@@ -278,6 +280,8 @@ static void handle_adc_eoc_trigger(int i
 		iio_trigger_poll(idev->trig);
 	} else {
 		st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
+		/* Needed to ACK the DRDY interruption */
+		at91_adc_readl(st, AT91_ADC_LCDR);
 		st->done = true;
 		wake_up_interruptible(&st->wq_data_avail);
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/iio/adc/fsl-imx25-gcq.c linux-libre-4.9.137-gnu/drivers/iio/adc/fsl-imx25-gcq.c
--- linux-libre-4.9.136-gnu/drivers/iio/adc/fsl-imx25-gcq.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/iio/adc/fsl-imx25-gcq.c	2018-11-13 14:17:06.000000000 -0500
@@ -209,12 +209,14 @@ static int mx25_gcq_setup_cfgs(struct pl
 		ret = of_property_read_u32(child, "reg", &reg);
 		if (ret) {
 			dev_err(dev, "Failed to get reg property\n");
+			of_node_put(child);
 			return ret;
 		}
 
 		if (reg >= MX25_NUM_CFGS) {
 			dev_err(dev,
 				"reg value is greater than the number of available configuration registers\n");
+			of_node_put(child);
 			return -EINVAL;
 		}
 
@@ -228,6 +230,7 @@ static int mx25_gcq_setup_cfgs(struct pl
 			if (IS_ERR(priv->vref[refp])) {
 				dev_err(dev, "Error, trying to use external voltage reference without a vref-%s regulator.",
 					mx25_gcq_refp_names[refp]);
+				of_node_put(child);
 				return PTR_ERR(priv->vref[refp]);
 			}
 			priv->channel_vref_mv[reg] =
@@ -240,6 +243,7 @@ static int mx25_gcq_setup_cfgs(struct pl
 			break;
 		default:
 			dev_err(dev, "Invalid positive reference %d\n", refp);
+			of_node_put(child);
 			return -EINVAL;
 		}
 
@@ -254,10 +258,12 @@ static int mx25_gcq_setup_cfgs(struct pl
 
 		if ((refp & MX25_ADCQ_CFG_REFP_MASK) != refp) {
 			dev_err(dev, "Invalid fsl,adc-refp property value\n");
+			of_node_put(child);
 			return -EINVAL;
 		}
 		if ((refn & MX25_ADCQ_CFG_REFN_MASK) != refn) {
 			dev_err(dev, "Invalid fsl,adc-refn property value\n");
+			of_node_put(child);
 			return -EINVAL;
 		}
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/iio/dac/ad5064.c linux-libre-4.9.137-gnu/drivers/iio/dac/ad5064.c
--- linux-libre-4.9.136-gnu/drivers/iio/dac/ad5064.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/iio/dac/ad5064.c	2018-11-13 14:17:06.000000000 -0500
@@ -760,6 +760,40 @@ static int ad5064_set_config(struct ad50
 	return ad5064_write(st, cmd, 0, val, 0);
 }
 
+static int ad5064_request_vref(struct ad5064_state *st, struct device *dev)
+{
+	unsigned int i;
+	int ret;
+
+	for (i = 0; i < ad5064_num_vref(st); ++i)
+		st->vref_reg[i].supply = ad5064_vref_name(st, i);
+
+	if (!st->chip_info->internal_vref)
+		return devm_regulator_bulk_get(dev, ad5064_num_vref(st),
+					       st->vref_reg);
+
+	/*
+	 * This assumes that when the regulator has an internal VREF
+	 * there is only one external VREF connection, which is
+	 * currently the case for all supported devices.
+	 */
+	st->vref_reg[0].consumer = devm_regulator_get_optional(dev, "vref");
+	if (!IS_ERR(st->vref_reg[0].consumer))
+		return 0;
+
+	ret = PTR_ERR(st->vref_reg[0].consumer);
+	if (ret != -ENODEV)
+		return ret;
+
+	/* If no external regulator was supplied use the internal VREF */
+	st->use_internal_vref = true;
+	ret = ad5064_set_config(st, AD5064_CONFIG_INT_VREF_ENABLE);
+	if (ret)
+		dev_err(dev, "Failed to enable internal vref: %d\n", ret);
+
+	return ret;
+}
+
 static int ad5064_probe(struct device *dev, enum ad5064_type type,
 			const char *name, ad5064_write_func write)
 {
@@ -780,22 +814,11 @@ static int ad5064_probe(struct device *d
 	st->dev = dev;
 	st->write = write;
 
-	for (i = 0; i < ad5064_num_vref(st); ++i)
-		st->vref_reg[i].supply = ad5064_vref_name(st, i);
+	ret = ad5064_request_vref(st, dev);
+	if (ret)
+		return ret;
 
-	ret = devm_regulator_bulk_get(dev, ad5064_num_vref(st),
-		st->vref_reg);
-	if (ret) {
-		if (!st->chip_info->internal_vref)
-			return ret;
-		st->use_internal_vref = true;
-		ret = ad5064_set_config(st, AD5064_CONFIG_INT_VREF_ENABLE);
-		if (ret) {
-			dev_err(dev, "Failed to enable internal vref: %d\n",
-				ret);
-			return ret;
-		}
-	} else {
+	if (!st->use_internal_vref) {
 		ret = regulator_bulk_enable(ad5064_num_vref(st), st->vref_reg);
 		if (ret)
 			return ret;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/infiniband/core/sysfs.c linux-libre-4.9.137-gnu/drivers/infiniband/core/sysfs.c
--- linux-libre-4.9.136-gnu/drivers/infiniband/core/sysfs.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/infiniband/core/sysfs.c	2018-11-13 14:17:06.000000000 -0500
@@ -485,7 +485,7 @@ static ssize_t show_pma_counter(struct i
 	ret = get_perf_mad(p->ibdev, p->port_num, tab_attr->attr_id, &data,
 			40 + offset / 8, sizeof(data));
 	if (ret < 0)
-		return sprintf(buf, "N/A (no PMA)\n");
+		return ret;
 
 	switch (width) {
 	case 4:
@@ -1008,10 +1008,12 @@ static int add_port(struct ib_device *de
 		goto err_put;
 	}
 
-	p->pma_table = get_counter_table(device, port_num);
-	ret = sysfs_create_group(&p->kobj, p->pma_table);
-	if (ret)
-		goto err_put_gid_attrs;
+	if (device->process_mad) {
+		p->pma_table = get_counter_table(device, port_num);
+		ret = sysfs_create_group(&p->kobj, p->pma_table);
+		if (ret)
+			goto err_put_gid_attrs;
+	}
 
 	p->gid_group.name  = "gids";
 	p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len);
@@ -1124,7 +1126,8 @@ err_free_gid:
 	p->gid_group.attrs = NULL;
 
 err_remove_pma:
-	sysfs_remove_group(&p->kobj, p->pma_table);
+	if (p->pma_table)
+		sysfs_remove_group(&p->kobj, p->pma_table);
 
 err_put_gid_attrs:
 	kobject_put(&p->gid_attr_group->kobj);
@@ -1236,7 +1239,9 @@ static void free_port_list_attributes(st
 			kfree(port->hw_stats);
 			free_hsag(&port->kobj, port->hw_stats_ag);
 		}
-		sysfs_remove_group(p, port->pma_table);
+
+		if (port->pma_table)
+			sysfs_remove_group(p, port->pma_table);
 		sysfs_remove_group(p, &port->pkey_group);
 		sysfs_remove_group(p, &port->gid_group);
 		sysfs_remove_group(&port->gid_attr_group->kobj,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/infiniband/ulp/ipoib/ipoib_cm.c linux-libre-4.9.137-gnu/drivers/infiniband/ulp/ipoib/ipoib_cm.c
--- linux-libre-4.9.136-gnu/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2018-11-13 14:17:06.000000000 -0500
@@ -1422,11 +1422,15 @@ static void ipoib_cm_skb_reap(struct wor
 		spin_unlock_irqrestore(&priv->lock, flags);
 		netif_tx_unlock_bh(dev);
 
-		if (skb->protocol == htons(ETH_P_IP))
+		if (skb->protocol == htons(ETH_P_IP)) {
+			memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
 			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+		}
 #if IS_ENABLED(CONFIG_IPV6)
-		else if (skb->protocol == htons(ETH_P_IPV6))
+		else if (skb->protocol == htons(ETH_P_IPV6)) {
+			memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
 			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
+		}
 #endif
 		dev_kfree_skb_any(skb);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/md/bcache/btree.c linux-libre-4.9.137-gnu/drivers/md/bcache/btree.c
--- linux-libre-4.9.136-gnu/drivers/md/bcache/btree.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/md/bcache/btree.c	2018-11-13 14:17:06.000000000 -0500
@@ -2367,7 +2367,7 @@ static int refill_keybuf_fn(struct btree
 	struct keybuf *buf = refill->buf;
 	int ret = MAP_CONTINUE;
 
-	if (bkey_cmp(k, refill->end) >= 0) {
+	if (bkey_cmp(k, refill->end) > 0) {
 		ret = MAP_DONE;
 		goto out;
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/md/dm-ioctl.c linux-libre-4.9.137-gnu/drivers/md/dm-ioctl.c
--- linux-libre-4.9.136-gnu/drivers/md/dm-ioctl.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/md/dm-ioctl.c	2018-11-13 14:17:06.000000000 -0500
@@ -1692,8 +1692,7 @@ static void free_params(struct dm_ioctl
 }
 
 static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kernel,
-		       int ioctl_flags,
-		       struct dm_ioctl **param, int *param_flags)
+		       int ioctl_flags, struct dm_ioctl **param, int *param_flags)
 {
 	struct dm_ioctl *dmi;
 	int secure_data;
@@ -1738,18 +1737,13 @@ static int copy_params(struct dm_ioctl _
 
 	*param_flags |= DM_PARAMS_MALLOC;
 
-	if (copy_from_user(dmi, user, param_kernel->data_size))
-		goto bad;
+	/* Copy from param_kernel (which was already copied from user) */
+	memcpy(dmi, param_kernel, minimum_data_size);
 
-data_copied:
-	/*
-	 * Abort if something changed the ioctl data while it was being copied.
-	 */
-	if (dmi->data_size != param_kernel->data_size) {
-		DMERR("rejecting ioctl: data size modified while processing parameters");
+	if (copy_from_user(&dmi->data, (char __user *)user + minimum_data_size,
+			   param_kernel->data_size - minimum_data_size))
 		goto bad;
-	}
-
+data_copied:
 	/* Wipe the user buffer so we do not return it to userspace */
 	if (secure_data && clear_user(user, param_kernel->data_size))
 		goto bad;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/md/raid10.c linux-libre-4.9.137-gnu/drivers/md/raid10.c
--- linux-libre-4.9.136-gnu/drivers/md/raid10.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/md/raid10.c	2018-11-13 14:17:06.000000000 -0500
@@ -1734,6 +1734,7 @@ static int raid10_add_disk(struct mddev
 		first = last = rdev->raid_disk;
 
 	if (rdev->saved_raid_disk >= first &&
+	    rdev->saved_raid_disk < conf->geo.raid_disks &&
 	    conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
 		mirror = rdev->saved_raid_disk;
 	else
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/md/raid1.c linux-libre-4.9.137-gnu/drivers/md/raid1.c
--- linux-libre-4.9.136-gnu/drivers/md/raid1.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/md/raid1.c	2018-11-13 14:17:06.000000000 -0500
@@ -1589,6 +1589,7 @@ static int raid1_add_disk(struct mddev *
 	 */
 	if (rdev->saved_raid_disk >= 0 &&
 	    rdev->saved_raid_disk >= first &&
+	    rdev->saved_raid_disk < conf->raid_disks &&
 	    conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
 		first = last = rdev->saved_raid_disk;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c linux-libre-4.9.137-gnu/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
--- linux-libre-4.9.136-gnu/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c	2018-11-13 14:17:06.000000000 -0500
@@ -1650,7 +1650,7 @@ typedef struct { u16 __; u8 _; } __packe
 				pos[7] = (chr & (0x01 << 0) ? fg : bg);	\
 			} \
 	\
-			pos += (tpg->hflip ? -8 : 8) / hdiv;	\
+			pos += (tpg->hflip ? -8 : 8) / (int)hdiv;	\
 		}	\
 	}	\
 } while (0)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/media/i2c/tvp5150.c linux-libre-4.9.137-gnu/drivers/media/i2c/tvp5150.c
--- linux-libre-4.9.136-gnu/drivers/media/i2c/tvp5150.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/media/i2c/tvp5150.c	2018-11-13 14:17:06.000000000 -0500
@@ -1527,7 +1527,7 @@ static int tvp5150_probe(struct i2c_clie
 			27000000, 1, 27000000);
 	v4l2_ctrl_new_std_menu_items(&core->hdl, &tvp5150_ctrl_ops,
 				     V4L2_CID_TEST_PATTERN,
-				     ARRAY_SIZE(tvp5150_test_patterns),
+				     ARRAY_SIZE(tvp5150_test_patterns) - 1,
 				     0, 0, tvp5150_test_patterns);
 	sd->ctrl_handler = &core->hdl;
 	if (core->hdl.error) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/media/usb/em28xx/em28xx-cards.c linux-libre-4.9.137-gnu/drivers/media/usb/em28xx/em28xx-cards.c
--- linux-libre-4.9.136-gnu/drivers/media/usb/em28xx/em28xx-cards.c	2018-11-10 13:58:10.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/media/usb/em28xx/em28xx-cards.c	2018-11-13 17:36:49.000000000 -0500
@@ -2093,13 +2093,13 @@ struct em28xx_board em28xx_boards[] = {
 		.input           = { {
 			.type     = EM28XX_VMUX_COMPOSITE,
 			.vmux     = TVP5150_COMPOSITE1,
-			.amux     = EM28XX_AUDIO_SRC_LINE,
+			.amux     = EM28XX_AMUX_LINE_IN,
 			.gpio     = terratec_av350_unmute_gpio,
 
 		}, {
 			.type     = EM28XX_VMUX_SVIDEO,
 			.vmux     = TVP5150_SVIDEO,
-			.amux     = EM28XX_AUDIO_SRC_LINE,
+			.amux     = EM28XX_AMUX_LINE_IN,
 			.gpio     = terratec_av350_unmute_gpio,
 		} },
 	},
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/media/usb/em28xx/em28xx-video.c linux-libre-4.9.137-gnu/drivers/media/usb/em28xx/em28xx-video.c
--- linux-libre-4.9.136-gnu/drivers/media/usb/em28xx/em28xx-video.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/media/usb/em28xx/em28xx-video.c	2018-11-13 14:17:06.000000000 -0500
@@ -1290,6 +1290,8 @@ static void em28xx_ctrl_notify(struct v4
 {
 	struct em28xx *dev = priv;
 
+	dev->v4l2->field_count = 0;
+
 	/*
 	 * In the case of non-AC97 volume controls, we still need
 	 * to do some setups at em28xx, in order to mute/unmute
@@ -1435,9 +1437,9 @@ static int vidioc_try_fmt_vid_cap(struct
 
 	fmt = format_by_fourcc(f->fmt.pix.pixelformat);
 	if (!fmt) {
-		em28xx_videodbg("Fourcc format (%08x) invalid.\n",
-				f->fmt.pix.pixelformat);
-		return -EINVAL;
+		fmt = &format[0];
+		em28xx_videodbg("Fourcc format (%08x) invalid. Using default (%08x).\n",
+				f->fmt.pix.pixelformat, fmt->fourcc);
 	}
 
 	if (dev->board.is_em2800) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/misc/genwqe/card_base.h linux-libre-4.9.137-gnu/drivers/misc/genwqe/card_base.h
--- linux-libre-4.9.136-gnu/drivers/misc/genwqe/card_base.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/misc/genwqe/card_base.h	2018-11-13 14:17:06.000000000 -0500
@@ -404,7 +404,7 @@ struct genwqe_file {
 	struct file *filp;
 
 	struct fasync_struct *async_queue;
-	struct task_struct *owner;
+	struct pid *opener;
 	struct list_head list;		/* entry in list of open files */
 
 	spinlock_t map_lock;		/* lock for dma_mappings */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/misc/genwqe/card_dev.c linux-libre-4.9.137-gnu/drivers/misc/genwqe/card_dev.c
--- linux-libre-4.9.136-gnu/drivers/misc/genwqe/card_dev.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/misc/genwqe/card_dev.c	2018-11-13 14:17:06.000000000 -0500
@@ -52,7 +52,7 @@ static void genwqe_add_file(struct genwq
 {
 	unsigned long flags;
 
-	cfile->owner = current;
+	cfile->opener = get_pid(task_tgid(current));
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_add(&cfile->list, &cd->file_list);
 	spin_unlock_irqrestore(&cd->file_lock, flags);
@@ -65,6 +65,7 @@ static int genwqe_del_file(struct genwqe
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_del(&cfile->list);
 	spin_unlock_irqrestore(&cd->file_lock, flags);
+	put_pid(cfile->opener);
 
 	return 0;
 }
@@ -275,7 +276,7 @@ static int genwqe_kill_fasync(struct gen
 	return files;
 }
 
-static int genwqe_force_sig(struct genwqe_dev *cd, int sig)
+static int genwqe_terminate(struct genwqe_dev *cd)
 {
 	unsigned int files = 0;
 	unsigned long flags;
@@ -283,7 +284,7 @@ static int genwqe_force_sig(struct genwq
 
 	spin_lock_irqsave(&cd->file_lock, flags);
 	list_for_each_entry(cfile, &cd->file_list, list) {
-		force_sig(sig, cfile->owner);
+		kill_pid(cfile->opener, SIGKILL, 1);
 		files++;
 	}
 	spin_unlock_irqrestore(&cd->file_lock, flags);
@@ -1356,7 +1357,7 @@ static int genwqe_inform_and_stop_proces
 		dev_warn(&pci_dev->dev,
 			 "[%s] send SIGKILL and wait ...\n", __func__);
 
-		rc = genwqe_force_sig(cd, SIGKILL); /* force terminate */
+		rc = genwqe_terminate(cd);
 		if (rc) {
 			/* Give kill_timout more seconds to end processes */
 			for (i = 0; (i < genwqe_kill_timeout) &&
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/misc/vmw_vmci/vmci_driver.c linux-libre-4.9.137-gnu/drivers/misc/vmw_vmci/vmci_driver.c
--- linux-libre-4.9.136-gnu/drivers/misc/vmw_vmci/vmci_driver.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/misc/vmw_vmci/vmci_driver.c	2018-11-13 14:17:06.000000000 -0500
@@ -113,5 +113,5 @@ module_exit(vmci_drv_exit);
 
 MODULE_AUTHOR("VMware, Inc.");
 MODULE_DESCRIPTION("VMware Virtual Machine Communication Interface.");
-MODULE_VERSION("1.1.5.0-k");
+MODULE_VERSION("1.1.6.0-k");
 MODULE_LICENSE("GPL v2");
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/misc/vmw_vmci/vmci_resource.c linux-libre-4.9.137-gnu/drivers/misc/vmw_vmci/vmci_resource.c
--- linux-libre-4.9.136-gnu/drivers/misc/vmw_vmci/vmci_resource.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/misc/vmw_vmci/vmci_resource.c	2018-11-13 14:17:06.000000000 -0500
@@ -56,7 +56,8 @@ static struct vmci_resource *vmci_resour
 
 		if (r->type == type &&
 		    rid == handle.resource &&
-		    (cid == handle.context || cid == VMCI_INVALID_ID)) {
+		    (cid == handle.context || cid == VMCI_INVALID_ID ||
+		     handle.context == VMCI_INVALID_ID)) {
 			resource = r;
 			break;
 		}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/mmc/host/sdhci-pci-o2micro.c linux-libre-4.9.137-gnu/drivers/mmc/host/sdhci-pci-o2micro.c
--- linux-libre-4.9.136-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2018-11-13 14:17:06.000000000 -0500
@@ -334,6 +334,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_
 		pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
 		break;
 	case PCI_DEVICE_ID_O2_SEABIRD0:
+		if (chip->pdev->revision == 0x01)
+			chip->quirks |= SDHCI_QUIRK_DELAY_AFTER_POWER;
+		/* fall through */
 	case PCI_DEVICE_ID_O2_SEABIRD1:
 		/* UnLock WP */
 		ret = pci_read_config_byte(chip->pdev,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c linux-libre-4.9.137-gnu/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
--- linux-libre-4.9.136-gnu/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c	2018-11-13 14:17:06.000000000 -0500
@@ -3419,6 +3419,10 @@ static void ixgbevf_tx_csum(struct ixgbe
 		skb_checksum_help(skb);
 		goto no_csum;
 	}
+
+	if (first->protocol == htons(ETH_P_IP))
+		type_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;
+
 	/* update TX checksum flag */
 	first->tx_flags |= IXGBE_TX_FLAGS_CSUM;
 	vlan_macip_lens = skb_checksum_start_offset(skb) -
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/ethernet/qlogic/qla3xxx.c linux-libre-4.9.137-gnu/drivers/net/ethernet/qlogic/qla3xxx.c
--- linux-libre-4.9.136-gnu/drivers/net/ethernet/qlogic/qla3xxx.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/ethernet/qlogic/qla3xxx.c	2018-11-13 14:17:06.000000000 -0500
@@ -380,8 +380,6 @@ static void fm93c56a_select(struct ql3_a
 
 	qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
 	ql_write_nvram_reg(qdev, spir, ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
-	ql_write_nvram_reg(qdev, spir,
-			   ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/tun.c linux-libre-4.9.137-gnu/drivers/net/tun.c
--- linux-libre-4.9.136-gnu/drivers/net/tun.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/tun.c	2018-11-13 14:17:06.000000000 -0500
@@ -1570,6 +1570,8 @@ static void tun_setup(struct net_device
  */
 static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
 {
+	if (!data)
+		return 0;
 	return -EINVAL;
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/ath/ath10k/wmi.c linux-libre-4.9.137-gnu/drivers/net/wireless/ath/ath10k/wmi.c
--- linux-libre-4.9.136-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/ath/ath10k/wmi.c	2018-11-13 14:17:06.000000000 -0500
@@ -1822,6 +1822,12 @@ int ath10k_wmi_cmd_send(struct ath10k *a
 	if (ret)
 		dev_kfree_skb_any(skb);
 
+	if (ret == -EAGAIN) {
+		ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
+			    cmd_id);
+		queue_work(ar->workqueue, &ar->restart_work);
+	}
+
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c linux-libre-4.9.137-gnu/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c
--- linux-libre-4.9.136-gnu/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c	2018-11-13 14:17:06.000000000 -0500
@@ -77,6 +77,8 @@ static u16 d11ac_bw(enum brcmu_chan_bw b
 		return BRCMU_CHSPEC_D11AC_BW_40;
 	case BRCMU_CHAN_BW_80:
 		return BRCMU_CHSPEC_D11AC_BW_80;
+	case BRCMU_CHAN_BW_160:
+		return BRCMU_CHSPEC_D11AC_BW_160;
 	default:
 		WARN_ON(1);
 	}
@@ -190,8 +192,38 @@ static void brcmu_d11ac_decchspec(struct
 			break;
 		}
 		break;
-	case BRCMU_CHSPEC_D11AC_BW_8080:
 	case BRCMU_CHSPEC_D11AC_BW_160:
+		switch (ch->sb) {
+		case BRCMU_CHAN_SB_LLL:
+			ch->control_ch_num -= CH_70MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_LLU:
+			ch->control_ch_num -= CH_50MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_LUL:
+			ch->control_ch_num -= CH_30MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_LUU:
+			ch->control_ch_num -= CH_10MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_ULL:
+			ch->control_ch_num += CH_10MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_ULU:
+			ch->control_ch_num += CH_30MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_UUL:
+			ch->control_ch_num += CH_50MHZ_APART;
+			break;
+		case BRCMU_CHAN_SB_UUU:
+			ch->control_ch_num += CH_70MHZ_APART;
+			break;
+		default:
+			WARN_ON_ONCE(1);
+			break;
+		}
+		break;
+	case BRCMU_CHSPEC_D11AC_BW_8080:
 	default:
 		WARN_ON_ONCE(1);
 		break;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h linux-libre-4.9.137-gnu/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h
--- linux-libre-4.9.136-gnu/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h	2018-11-13 14:17:06.000000000 -0500
@@ -29,6 +29,8 @@
 #define CH_UPPER_SB			0x01
 #define CH_LOWER_SB			0x02
 #define CH_EWA_VALID			0x04
+#define CH_70MHZ_APART			14
+#define CH_50MHZ_APART			10
 #define CH_30MHZ_APART			6
 #define CH_20MHZ_APART			4
 #define CH_10MHZ_APART			2
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/intel/iwlwifi/mvm/rs.c linux-libre-4.9.137-gnu/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
--- linux-libre-4.9.136-gnu/drivers/net/wireless/intel/iwlwifi/mvm/rs.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/intel/iwlwifi/mvm/rs.c	2018-11-13 14:17:06.000000000 -0500
@@ -1207,7 +1207,11 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm
 	    !(info->flags & IEEE80211_TX_STAT_AMPDU))
 		return;
 
-	rs_rate_from_ucode_rate(tx_resp_hwrate, info->band, &tx_resp_rate);
+	if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
+				    &tx_resp_rate)) {
+		WARN_ON_ONCE(1);
+		return;
+	}
 
 #ifdef CONFIG_MAC80211_DEBUGFS
 	/* Disable last tx check if we are debugging with fixed rate but
@@ -1263,7 +1267,10 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm
 	 */
 	table = &lq_sta->lq;
 	lq_hwrate = le32_to_cpu(table->rs_table[0]);
-	rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate);
+	if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
+		WARN_ON_ONCE(1);
+		return;
+	}
 
 	/* Here we actually compare this rate to the latest LQ command */
 	if (!rs_rate_equal(&tx_resp_rate, &lq_rate, allow_ant_mismatch)) {
@@ -1365,8 +1372,12 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm
 		/* Collect data for each rate used during failed TX attempts */
 		for (i = 0; i <= retries; ++i) {
 			lq_hwrate = le32_to_cpu(table->rs_table[i]);
-			rs_rate_from_ucode_rate(lq_hwrate, info->band,
-						&lq_rate);
+			if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
+						    &lq_rate)) {
+				WARN_ON_ONCE(1);
+				return;
+			}
+
 			/*
 			 * Only collect stats if retried rate is in the same RS
 			 * table as active/search.
@@ -3261,7 +3272,10 @@ static void rs_build_rates_table_from_fi
 	for (i = 0; i < num_rates; i++)
 		lq_cmd->rs_table[i] = ucode_rate_le32;
 
-	rs_rate_from_ucode_rate(ucode_rate, band, &rate);
+	if (rs_rate_from_ucode_rate(ucode_rate, band, &rate)) {
+		WARN_ON_ONCE(1);
+		return;
+	}
 
 	if (is_mimo(&rate))
 		lq_cmd->mimo_delim = num_rates - 1;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/intel/iwlwifi/pcie/rx.c linux-libre-4.9.137-gnu/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
--- linux-libre-4.9.136-gnu/drivers/net/wireless/intel/iwlwifi/pcie/rx.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/intel/iwlwifi/pcie/rx.c	2018-11-13 14:17:06.000000000 -0500
@@ -1030,6 +1030,14 @@ void iwl_pcie_rx_free(struct iwl_trans *
 	kfree(trans_pcie->rxq);
 }
 
+static void iwl_pcie_rx_move_to_allocator(struct iwl_rxq *rxq,
+					  struct iwl_rb_allocator *rba)
+{
+	spin_lock(&rba->lock);
+	list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
+	spin_unlock(&rba->lock);
+}
+
 /*
  * iwl_pcie_rx_reuse_rbd - Recycle used RBDs
  *
@@ -1061,9 +1069,7 @@ static void iwl_pcie_rx_reuse_rbd(struct
 	if ((rxq->used_count % RX_CLAIM_REQ_ALLOC) == RX_POST_REQ_ALLOC) {
 		/* Move the 2 RBDs to the allocator ownership.
 		 Allocator has another 6 from pool for the request completion*/
-		spin_lock(&rba->lock);
-		list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
-		spin_unlock(&rba->lock);
+		iwl_pcie_rx_move_to_allocator(rxq, rba);
 
 		atomic_inc(&rba->req_pending);
 		queue_work(rba->alloc_wq, &rba->rx_alloc);
@@ -1233,10 +1239,18 @@ restart:
 		IWL_DEBUG_RX(trans, "Q %d: HW = SW = %d\n", rxq->id, r);
 
 	while (i != r) {
+		struct iwl_rb_allocator *rba = &trans_pcie->rba;
 		struct iwl_rx_mem_buffer *rxb;
+		/* number of RBDs still waiting for page allocation */
+		u32 rb_pending_alloc =
+			atomic_read(&trans_pcie->rba.req_pending) *
+			RX_CLAIM_REQ_ALLOC;
 
-		if (unlikely(rxq->used_count == rxq->queue_size / 2))
+		if (unlikely(rb_pending_alloc >= rxq->queue_size / 2 &&
+			     !emergency)) {
+			iwl_pcie_rx_move_to_allocator(rxq, rba);
 			emergency = true;
+		}
 
 		if (trans->cfg->mq_rx_supported) {
 			/*
@@ -1279,17 +1293,13 @@ restart:
 			iwl_pcie_rx_allocator_get(trans, rxq);
 
 		if (rxq->used_count % RX_CLAIM_REQ_ALLOC == 0 && !emergency) {
-			struct iwl_rb_allocator *rba = &trans_pcie->rba;
-
 			/* Add the remaining empty RBDs for allocator use */
-			spin_lock(&rba->lock);
-			list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
-			spin_unlock(&rba->lock);
+			iwl_pcie_rx_move_to_allocator(rxq, rba);
 		} else if (emergency) {
 			count++;
 			if (count == 8) {
 				count = 0;
-				if (rxq->used_count < rxq->queue_size / 3)
+				if (rb_pending_alloc < rxq->queue_size / 3)
 					emergency = false;
 
 				rxq->read = i;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/net/wireless/marvell/libertas/if_usb.c linux-libre-4.9.137-gnu/drivers/net/wireless/marvell/libertas/if_usb.c
--- linux-libre-4.9.136-gnu/drivers/net/wireless/marvell/libertas/if_usb.c	2018-11-10 14:10:36.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/net/wireless/marvell/libertas/if_usb.c	2018-11-13 17:51:34.000000000 -0500
@@ -464,8 +464,6 @@ static int __if_usb_submit_rx_urb(struct
 			  MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn,
 			  cardp);
 
-	cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET;
-
 	lbs_deb_usb2(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb);
 	if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
 		lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed: %d\n", ret);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/nvdimm/bus.c linux-libre-4.9.137-gnu/drivers/nvdimm/bus.c
--- linux-libre-4.9.136-gnu/drivers/nvdimm/bus.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/nvdimm/bus.c	2018-11-13 14:17:06.000000000 -0500
@@ -424,6 +424,8 @@ static void nd_async_device_register(voi
 		put_device(dev);
 	}
 	put_device(dev);
+	if (dev->parent)
+		put_device(dev->parent);
 }
 
 static void nd_async_device_unregister(void *d, async_cookie_t cookie)
@@ -443,6 +445,8 @@ void __nd_device_register(struct device
 	if (!dev)
 		return;
 	dev->bus = &nvdimm_bus_type;
+	if (dev->parent)
+		get_device(dev->parent);
 	get_device(dev);
 	async_schedule_domain(nd_async_device_register, dev,
 			&nd_async_domain);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pci/msi.c linux-libre-4.9.137-gnu/drivers/pci/msi.c
--- linux-libre-4.9.136-gnu/drivers/pci/msi.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pci/msi.c	2018-11-13 14:17:06.000000000 -0500
@@ -981,7 +981,6 @@ static int __pci_enable_msix(struct pci_
 			}
 		}
 	}
-	WARN_ON(!!dev->msix_enabled);
 
 	/* Check whether driver already requested for MSI irq */
 	if (dev->msi_enabled) {
@@ -1068,8 +1067,6 @@ static int __pci_enable_msi_range(struct
 	if (!pci_msi_supported(dev, minvec))
 		return -EINVAL;
 
-	WARN_ON(!!dev->msi_enabled);
-
 	/* Check whether driver already requested MSI-X irqs */
 	if (dev->msix_enabled) {
 		dev_info(&dev->dev,
@@ -1080,6 +1077,9 @@ static int __pci_enable_msi_range(struct
 	if (maxvec < minvec)
 		return -ERANGE;
 
+	if (WARN_ON_ONCE(dev->msi_enabled))
+		return -EINVAL;
+
 	nvec = pci_msi_vec_count(dev);
 	if (nvec < 0)
 		return nvec;
@@ -1138,6 +1138,9 @@ static int __pci_enable_msix_range(struc
 	if (maxvec < minvec)
 		return -ERANGE;
 
+	if (WARN_ON_ONCE(dev->msix_enabled))
+		return -EINVAL;
+
 	for (;;) {
 		if (affinity) {
 			nvec = irq_calc_affinity_vectors(dev->irq_affinity,
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pci/quirks.c linux-libre-4.9.137-gnu/drivers/pci/quirks.c
--- linux-libre-4.9.136-gnu/drivers/pci/quirks.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pci/quirks.c	2018-11-13 14:17:06.000000000 -0500
@@ -3124,7 +3124,11 @@ static void disable_igfx_irq(struct pci_
 
 	pci_iounmap(dev, regs);
 }
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0042, disable_igfx_irq);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0046, disable_igfx_irq);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x004a, disable_igfx_irq);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0106, disable_igfx_irq);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pcmcia/ricoh.h linux-libre-4.9.137-gnu/drivers/pcmcia/ricoh.h
--- linux-libre-4.9.136-gnu/drivers/pcmcia/ricoh.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pcmcia/ricoh.h	2018-11-13 14:17:06.000000000 -0500
@@ -119,6 +119,10 @@
 #define  RL5C4XX_MISC_CONTROL           0x2F /* 8 bit */
 #define  RL5C4XX_ZV_ENABLE              0x08
 
+/* Misc Control 3 Register */
+#define RL5C4XX_MISC3			0x00A2 /* 16 bit */
+#define  RL5C47X_MISC3_CB_CLKRUN_DIS	BIT(1)
+
 #ifdef __YENTA_H
 
 #define rl_misc(socket)		((socket)->private[0])
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_so
         }
 }
 
+static void ricoh_set_clkrun(struct yenta_socket *socket, bool quiet)
+{
+	u16 misc3;
+
+	/*
+	 * RL5C475II likely has this setting, too, however no datasheet
+	 * is publicly available for this chip
+	 */
+	if (socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C476 &&
+	    socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C478)
+		return;
+
+	if (socket->dev->revision < 0x80)
+		return;
+
+	misc3 = config_readw(socket, RL5C4XX_MISC3);
+	if (misc3 & RL5C47X_MISC3_CB_CLKRUN_DIS) {
+		if (!quiet)
+			dev_dbg(&socket->dev->dev,
+				"CLKRUN feature already disabled\n");
+	} else if (disable_clkrun) {
+		if (!quiet)
+			dev_info(&socket->dev->dev,
+				 "Disabling CLKRUN feature\n");
+		misc3 |= RL5C47X_MISC3_CB_CLKRUN_DIS;
+		config_writew(socket, RL5C4XX_MISC3, misc3);
+	}
+}
+
 static void ricoh_save_state(struct yenta_socket *socket)
 {
 	rl_misc(socket) = config_readw(socket, RL5C4XX_MISC);
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct y
 	config_writew(socket, RL5C4XX_16BIT_IO_0, rl_io(socket));
 	config_writew(socket, RL5C4XX_16BIT_MEM_0, rl_mem(socket));
 	config_writew(socket, RL5C4XX_CONFIG, rl_config(socket));
+	ricoh_set_clkrun(socket, true);
 }
 
 
@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_s
 	config_writew(socket, RL5C4XX_CONFIG, config);
 
 	ricoh_set_zv(socket);
+	ricoh_set_clkrun(socket, false);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pcmcia/yenta_socket.c linux-libre-4.9.137-gnu/drivers/pcmcia/yenta_socket.c
--- linux-libre-4.9.136-gnu/drivers/pcmcia/yenta_socket.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pcmcia/yenta_socket.c	2018-11-13 14:17:06.000000000 -0500
@@ -26,7 +26,8 @@
 
 static bool disable_clkrun;
 module_param(disable_clkrun, bool, 0444);
-MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
+MODULE_PARM_DESC(disable_clkrun,
+		 "If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)");
 
 static bool isa_probe = 1;
 module_param(isa_probe, bool, 0444);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c linux-libre-4.9.137-gnu/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
--- linux-libre-4.9.136-gnu/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c	2018-11-13 14:17:06.000000000 -0500
@@ -319,6 +319,8 @@ static int pmic_mpp_set_mux(struct pinct
 	pad->function = function;
 
 	ret = pmic_mpp_write_mode_ctl(state, pad);
+	if (ret < 0)
+		return ret;
 
 	val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT;
 
@@ -343,13 +345,12 @@ static int pmic_mpp_config_get(struct pi
 
 	switch (param) {
 	case PIN_CONFIG_BIAS_DISABLE:
-		arg = pad->pullup == PMIC_MPP_PULL_UP_OPEN;
+		if (pad->pullup != PMIC_MPP_PULL_UP_OPEN)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_BIAS_PULL_UP:
 		switch (pad->pullup) {
-		case PMIC_MPP_PULL_UP_OPEN:
-			arg = 0;
-			break;
 		case PMIC_MPP_PULL_UP_0P6KOHM:
 			arg = 600;
 			break;
@@ -364,13 +365,17 @@ static int pmic_mpp_config_get(struct pi
 		}
 		break;
 	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
-		arg = !pad->is_enabled;
+		if (pad->is_enabled)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_POWER_SOURCE:
 		arg = pad->power_source;
 		break;
 	case PIN_CONFIG_INPUT_ENABLE:
-		arg = pad->input_enabled;
+		if (!pad->input_enabled)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_OUTPUT:
 		arg = pad->out_value;
@@ -382,7 +387,9 @@ static int pmic_mpp_config_get(struct pi
 		arg = pad->amux_input;
 		break;
 	case PMIC_MPP_CONF_PAIRED:
-		arg = pad->paired;
+		if (!pad->paired)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_DRIVE_STRENGTH:
 		arg = pad->drive_strength;
@@ -455,7 +462,7 @@ static int pmic_mpp_config_set(struct pi
 			pad->dtest = arg;
 			break;
 		case PIN_CONFIG_DRIVE_STRENGTH:
-			arg = pad->drive_strength;
+			pad->drive_strength = arg;
 			break;
 		case PMIC_MPP_CONF_AMUX_ROUTE:
 			if (arg >= PMIC_MPP_AMUX_ROUTE_ABUS4)
@@ -502,6 +509,10 @@ static int pmic_mpp_config_set(struct pi
 	if (ret < 0)
 		return ret;
 
+	ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_SINK_CTL, pad->drive_strength);
+	if (ret < 0)
+		return ret;
+
 	val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT;
 
 	return pmic_mpp_write(state, pad, PMIC_MPP_REG_EN_CTL, val);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c linux-libre-4.9.137-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
--- linux-libre-4.9.136-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c	2018-11-13 14:17:06.000000000 -0500
@@ -260,22 +260,32 @@ static int pm8xxx_pin_config_get(struct
 
 	switch (param) {
 	case PIN_CONFIG_BIAS_DISABLE:
-		arg = pin->bias == PM8XXX_GPIO_BIAS_NP;
+		if (pin->bias != PM8XXX_GPIO_BIAS_NP)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_BIAS_PULL_DOWN:
-		arg = pin->bias == PM8XXX_GPIO_BIAS_PD;
+		if (pin->bias != PM8XXX_GPIO_BIAS_PD)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_BIAS_PULL_UP:
-		arg = pin->bias <= PM8XXX_GPIO_BIAS_PU_1P5_30;
+		if (pin->bias > PM8XXX_GPIO_BIAS_PU_1P5_30)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PM8XXX_QCOM_PULL_UP_STRENGTH:
 		arg = pin->pull_up_strength;
 		break;
 	case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
-		arg = pin->disable;
+		if (!pin->disable)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_INPUT_ENABLE:
-		arg = pin->mode == PM8XXX_GPIO_MODE_INPUT;
+		if (pin->mode != PM8XXX_GPIO_MODE_INPUT)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_OUTPUT:
 		if (pin->mode & PM8XXX_GPIO_MODE_OUTPUT)
@@ -290,10 +300,14 @@ static int pm8xxx_pin_config_get(struct
 		arg = pin->output_strength;
 		break;
 	case PIN_CONFIG_DRIVE_PUSH_PULL:
-		arg = !pin->open_drain;
+		if (pin->open_drain)
+			return -EINVAL;
+		arg = 1;
 		break;
 	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
-		arg = pin->open_drain;
+		if (!pin->open_drain)
+			return -EINVAL;
+		arg = 1;
 		break;
 	default:
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/rpmsg/qcom_smd.c linux-libre-4.9.137-gnu/drivers/rpmsg/qcom_smd.c
--- linux-libre-4.9.136-gnu/drivers/rpmsg/qcom_smd.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/rpmsg/qcom_smd.c	2018-11-13 14:17:06.000000000 -0500
@@ -1012,8 +1012,10 @@ static struct qcom_smd_channel *qcom_smd
 
 	channel->edge = edge;
 	channel->name = kstrdup(name, GFP_KERNEL);
-	if (!channel->name)
-		return ERR_PTR(-ENOMEM);
+	if (!channel->name) {
+		ret = -ENOMEM;
+		goto free_channel;
+	}
 
 	mutex_init(&channel->tx_lock);
 	spin_lock_init(&channel->recv_lock);
@@ -1062,6 +1064,7 @@ static struct qcom_smd_channel *qcom_smd
 
 free_name_and_channel:
 	kfree(channel->name);
+free_channel:
 	kfree(channel);
 
 	return ERR_PTR(ret);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/scsi/esp_scsi.c linux-libre-4.9.137-gnu/drivers/scsi/esp_scsi.c
--- linux-libre-4.9.136-gnu/drivers/scsi/esp_scsi.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/scsi/esp_scsi.c	2018-11-13 14:17:06.000000000 -0500
@@ -1349,6 +1349,7 @@ static int esp_data_bytes_sent(struct es
 
 	bytes_sent = esp->data_dma_len;
 	bytes_sent -= ecount;
+	bytes_sent -= esp->send_cmd_residual;
 
 	/*
 	 * The am53c974 has a DMA 'pecularity'. The doc states:
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/scsi/esp_scsi.h linux-libre-4.9.137-gnu/drivers/scsi/esp_scsi.h
--- linux-libre-4.9.136-gnu/drivers/scsi/esp_scsi.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/scsi/esp_scsi.h	2018-11-13 14:17:06.000000000 -0500
@@ -540,6 +540,8 @@ struct esp {
 
 	void			*dma;
 	int			dmarev;
+
+	u32			send_cmd_residual;
 };
 
 /* A front-end driver for the ESP chip should do the following in
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/scsi/lpfc/lpfc_sli.c linux-libre-4.9.137-gnu/drivers/scsi/lpfc/lpfc_sli.c
--- linux-libre-4.9.136-gnu/drivers/scsi/lpfc/lpfc_sli.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/scsi/lpfc/lpfc_sli.c	2018-11-13 14:17:06.000000000 -0500
@@ -3512,6 +3512,7 @@ lpfc_sli_handle_slow_ring_event_s4(struc
 	struct hbq_dmabuf *dmabuf;
 	struct lpfc_cq_event *cq_event;
 	unsigned long iflag;
+	int count = 0;
 
 	spin_lock_irqsave(&phba->hbalock, iflag);
 	phba->hba_flag &= ~HBA_SP_QUEUE_EVT;
@@ -3533,16 +3534,22 @@ lpfc_sli_handle_slow_ring_event_s4(struc
 			if (irspiocbq)
 				lpfc_sli_sp_handle_rspiocb(phba, pring,
 							   irspiocbq);
+			count++;
 			break;
 		case CQE_CODE_RECEIVE:
 		case CQE_CODE_RECEIVE_V1:
 			dmabuf = container_of(cq_event, struct hbq_dmabuf,
 					      cq_event);
 			lpfc_sli4_handle_received_buffer(phba, dmabuf);
+			count++;
 			break;
 		default:
 			break;
 		}
+
+		/* Limit the number of events to 64 to avoid soft lockups */
+		if (count == 64)
+			break;
 	}
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/scsi/mac_esp.c linux-libre-4.9.137-gnu/drivers/scsi/mac_esp.c
--- linux-libre-4.9.136-gnu/drivers/scsi/mac_esp.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/scsi/mac_esp.c	2018-11-13 14:17:06.000000000 -0500
@@ -426,6 +426,8 @@ static void mac_esp_send_pio_cmd(struct
 			scsi_esp_cmd(esp, ESP_CMD_TI);
 		}
 	}
+
+	esp->send_cmd_residual = esp_count;
 }
 
 static int mac_esp_irq_pending(struct esp *esp)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/scsi/megaraid/megaraid_sas_base.c linux-libre-4.9.137-gnu/drivers/scsi/megaraid/megaraid_sas_base.c
--- linux-libre-4.9.136-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/scsi/megaraid/megaraid_sas_base.c	2018-11-13 14:17:06.000000000 -0500
@@ -6901,6 +6901,9 @@ static int megasas_mgmt_compat_ioctl_fw(
 		get_user(user_sense_off, &cioc->sense_off))
 		return -EFAULT;
 
+	if (local_sense_off != user_sense_off)
+		return -EINVAL;
+
 	if (local_sense_len) {
 		void __user **sense_ioc_ptr =
 			(void __user **)((u8 *)((unsigned long)&ioc->frame.raw) + local_sense_off);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/soc/tegra/pmc.c linux-libre-4.9.137-gnu/drivers/soc/tegra/pmc.c
--- linux-libre-4.9.136-gnu/drivers/soc/tegra/pmc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/soc/tegra/pmc.c	2018-11-13 14:17:06.000000000 -0500
@@ -1189,7 +1189,7 @@ static void tegra_pmc_init_tsense_reset(
 	if (!pmc->soc->has_tsense_reset)
 		return;
 
-	np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip");
+	np = of_get_child_by_name(pmc->dev->of_node, "i2c-thermtrip");
 	if (!np) {
 		dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled);
 		return;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/tc/tc.c linux-libre-4.9.137-gnu/drivers/tc/tc.c
--- linux-libre-4.9.136-gnu/drivers/tc/tc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/tc/tc.c	2018-11-13 14:17:06.000000000 -0500
@@ -2,7 +2,7 @@
  *	TURBOchannel bus services.
  *
  *	Copyright (c) Harald Koerfgen, 1998
- *	Copyright (c) 2001, 2003, 2005, 2006  Maciej W. Rozycki
+ *	Copyright (c) 2001, 2003, 2005, 2006, 2018  Maciej W. Rozycki
  *	Copyright (c) 2005  James Simmons
  *
  *	This file is subject to the terms and conditions of the GNU
@@ -10,6 +10,7 @@
  *	directory of this archive for more details.
  */
 #include <linux/compiler.h>
+#include <linux/dma-mapping.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -92,6 +93,11 @@ static void __init tc_bus_add_devices(st
 		tdev->dev.bus = &tc_bus_type;
 		tdev->slot = slot;
 
+		/* TURBOchannel has 34-bit DMA addressing (16GiB space). */
+		tdev->dma_mask = DMA_BIT_MASK(34);
+		tdev->dev.dma_mask = &tdev->dma_mask;
+		tdev->dev.coherent_dma_mask = DMA_BIT_MASK(34);
+
 		for (i = 0; i < 8; i++) {
 			tdev->firmware[i] =
 				readb(module + offset + TC_FIRM_VER + 4 * i);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/tty/serial/kgdboc.c linux-libre-4.9.137-gnu/drivers/tty/serial/kgdboc.c
--- linux-libre-4.9.136-gnu/drivers/tty/serial/kgdboc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/tty/serial/kgdboc.c	2018-11-13 14:17:06.000000000 -0500
@@ -133,6 +133,11 @@ static void kgdboc_unregister_kbd(void)
 
 static int kgdboc_option_setup(char *opt)
 {
+	if (!opt) {
+		pr_err("kgdboc: config string not provided\n");
+		return -EINVAL;
+	}
+
 	if (strlen(opt) >= MAX_CONFIG_LEN) {
 		printk(KERN_ERR "kgdboc: config string too long\n");
 		return -ENOSPC;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/uio/uio.c linux-libre-4.9.137-gnu/drivers/uio/uio.c
--- linux-libre-4.9.136-gnu/drivers/uio/uio.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/uio/uio.c	2018-11-13 14:17:06.000000000 -0500
@@ -249,6 +249,8 @@ static struct class uio_class = {
 	.dev_groups = uio_groups,
 };
 
+bool uio_class_registered;
+
 /*
  * device functions
  */
@@ -780,6 +782,9 @@ static int init_uio_class(void)
 		printk(KERN_ERR "class_register failed for uio\n");
 		goto err_class_register;
 	}
+
+	uio_class_registered = true;
+
 	return 0;
 
 err_class_register:
@@ -790,6 +795,7 @@ exit:
 
 static void release_uio_class(void)
 {
+	uio_class_registered = false;
 	class_unregister(&uio_class);
 	uio_major_cleanup();
 }
@@ -809,6 +815,9 @@ int __uio_register_device(struct module
 	struct uio_device *idev;
 	int ret = 0;
 
+	if (!uio_class_registered)
+		return -EPROBE_DEFER;
+
 	if (!parent || !info || !info->name || !info->version)
 		return -EINVAL;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/usb/chipidea/otg.h linux-libre-4.9.137-gnu/drivers/usb/chipidea/otg.h
--- linux-libre-4.9.136-gnu/drivers/usb/chipidea/otg.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/usb/chipidea/otg.h	2018-11-13 14:17:06.000000000 -0500
@@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdr
 static inline void ci_otg_queue_work(struct ci_hdrc *ci)
 {
 	disable_irq_nosync(ci->irq);
-	queue_work(ci->wq, &ci->work);
+	if (queue_work(ci->wq, &ci->work) == false)
+		enable_irq(ci->irq);
 }
 
 #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/usb/gadget/udc/atmel_usba_udc.c linux-libre-4.9.137-gnu/drivers/usb/gadget/udc/atmel_usba_udc.c
--- linux-libre-4.9.136-gnu/drivers/usb/gadget/udc/atmel_usba_udc.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/usb/gadget/udc/atmel_usba_udc.c	2018-11-13 14:17:06.000000000 -0500
@@ -1923,6 +1923,8 @@ static struct usba_ep * atmel_udc_of_ini
 	udc->errata = match->data;
 	udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc");
 	if (IS_ERR(udc->pmc))
+		udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9rl-pmc");
+	if (IS_ERR(udc->pmc))
 		udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9x5-pmc");
 	if (udc->errata && IS_ERR(udc->pmc))
 		return ERR_CAST(udc->pmc);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/usb/usbip/vudc_main.c linux-libre-4.9.137-gnu/drivers/usb/usbip/vudc_main.c
--- linux-libre-4.9.136-gnu/drivers/usb/usbip/vudc_main.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/usb/usbip/vudc_main.c	2018-11-13 14:17:06.000000000 -0500
@@ -85,6 +85,10 @@ static int __init init(void)
 cleanup:
 	list_for_each_entry_safe(udc_dev, udc_dev2, &vudc_devices, dev_entry) {
 		list_del(&udc_dev->dev_entry);
+		/*
+		 * Just do platform_device_del() here, put_vudc_device()
+		 * calls the platform_device_put()
+		 */
 		platform_device_del(udc_dev->pdev);
 		put_vudc_device(udc_dev);
 	}
@@ -101,7 +105,11 @@ static void __exit cleanup(void)
 
 	list_for_each_entry_safe(udc_dev, udc_dev2, &vudc_devices, dev_entry) {
 		list_del(&udc_dev->dev_entry);
-		platform_device_unregister(udc_dev->pdev);
+		/*
+		 * Just do platform_device_del() here, put_vudc_device()
+		 * calls the platform_device_put()
+		 */
+		platform_device_del(udc_dev->pdev);
 		put_vudc_device(udc_dev);
 	}
 	platform_driver_unregister(&vudc_driver);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/w1/masters/omap_hdq.c linux-libre-4.9.137-gnu/drivers/w1/masters/omap_hdq.c
--- linux-libre-4.9.136-gnu/drivers/w1/masters/omap_hdq.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/w1/masters/omap_hdq.c	2018-11-13 14:17:06.000000000 -0500
@@ -784,6 +784,8 @@ static int omap_hdq_remove(struct platfo
 	/* remove module dependency */
 	pm_runtime_disable(&pdev->dev);
 
+	w1_remove_master_device(&omap_w1_master);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/drivers/xen/swiotlb-xen.c linux-libre-4.9.137-gnu/drivers/xen/swiotlb-xen.c
--- linux-libre-4.9.136-gnu/drivers/xen/swiotlb-xen.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/drivers/xen/swiotlb-xen.c	2018-11-13 14:17:06.000000000 -0500
@@ -310,6 +310,9 @@ xen_swiotlb_alloc_coherent(struct device
 	*/
 	flags &= ~(__GFP_DMA | __GFP_HIGHMEM);
 
+	/* Convert the size to actually allocated. */
+	size = 1UL << (order + XEN_PAGE_SHIFT);
+
 	/* On ARM this function returns an ioremap'ped virtual address for
 	 * which virt_to_phys doesn't return the corresponding physical
 	 * address. In fact on ARM virt_to_phys only works for kernel direct
@@ -359,6 +362,9 @@ xen_swiotlb_free_coherent(struct device
 	 * physical address */
 	phys = xen_bus_to_phys(dev_addr);
 
+	/* Convert the size to actually allocated. */
+	size = 1UL << (order + XEN_PAGE_SHIFT);
+
 	if (((dev_addr + size - 1 <= dma_mask)) ||
 	    range_straddles_page_boundary(phys, size))
 		xen_destroy_contiguous_region(phys, order);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/extent-tree.c linux-libre-4.9.137-gnu/fs/btrfs/extent-tree.c
--- linux-libre-4.9.136-gnu/fs/btrfs/extent-tree.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/extent-tree.c	2018-11-13 14:17:06.000000000 -0500
@@ -8263,6 +8263,19 @@ btrfs_init_new_buffer(struct btrfs_trans
 	if (IS_ERR(buf))
 		return buf;
 
+	/*
+	 * Extra safety check in case the extent tree is corrupted and extent
+	 * allocator chooses to use a tree block which is already used and
+	 * locked.
+	 */
+	if (buf->lock_owner == current->pid) {
+		btrfs_err_rl(root->fs_info,
+"tree block %llu owner %llu already locked by pid=%d, extent tree corruption detected",
+			buf->start, btrfs_header_owner(buf), current->pid);
+		free_extent_buffer(buf);
+		return ERR_PTR(-EUCLEAN);
+	}
+
 	btrfs_set_header_generation(buf, trans->transid);
 	btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level);
 	btrfs_tree_lock(buf);
@@ -9100,15 +9113,14 @@ static noinline int walk_up_proc(struct
 	if (eb == root->node) {
 		if (wc->flags[level] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
 			parent = eb->start;
-		else
-			BUG_ON(root->root_key.objectid !=
-			       btrfs_header_owner(eb));
+		else if (root->root_key.objectid != btrfs_header_owner(eb))
+			goto owner_mismatch;
 	} else {
 		if (wc->flags[level + 1] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
 			parent = path->nodes[level + 1]->start;
-		else
-			BUG_ON(root->root_key.objectid !=
-			       btrfs_header_owner(path->nodes[level + 1]));
+		else if (root->root_key.objectid !=
+			 btrfs_header_owner(path->nodes[level + 1]))
+			goto owner_mismatch;
 	}
 
 	btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1);
@@ -9116,6 +9128,11 @@ out:
 	wc->refs[level] = 0;
 	wc->flags[level] = 0;
 	return 0;
+
+owner_mismatch:
+	btrfs_err_rl(root->fs_info, "unexpected tree owner, have %llu expect %llu",
+		     btrfs_header_owner(eb), root->root_key.objectid);
+	return -EUCLEAN;
 }
 
 static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
@@ -9169,6 +9186,8 @@ static noinline int walk_up_tree(struct
 			ret = walk_up_proc(trans, root, path, wc);
 			if (ret > 0)
 				return 0;
+			if (ret < 0)
+				return ret;
 
 			if (path->locks[level]) {
 				btrfs_tree_unlock_rw(path->nodes[level],
@@ -9933,6 +9952,7 @@ void btrfs_put_block_group_cache(struct
 
 		block_group = btrfs_lookup_first_block_group(info, last);
 		while (block_group) {
+			wait_block_group_cache_done(block_group);
 			spin_lock(&block_group->lock);
 			if (block_group->iref)
 				break;
@@ -10332,7 +10352,7 @@ error:
 void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans,
 				       struct btrfs_root *root)
 {
-	struct btrfs_block_group_cache *block_group, *tmp;
+	struct btrfs_block_group_cache *block_group;
 	struct btrfs_root *extent_root = root->fs_info->extent_root;
 	struct btrfs_block_group_item item;
 	struct btrfs_key key;
@@ -10340,7 +10360,10 @@ void btrfs_create_pending_block_groups(s
 	bool can_flush_pending_bgs = trans->can_flush_pending_bgs;
 
 	trans->can_flush_pending_bgs = false;
-	list_for_each_entry_safe(block_group, tmp, &trans->new_bgs, bg_list) {
+	while (!list_empty(&trans->new_bgs)) {
+		block_group = list_first_entry(&trans->new_bgs,
+					       struct btrfs_block_group_cache,
+					       bg_list);
 		if (ret)
 			goto next;
 
@@ -11052,6 +11075,10 @@ static int btrfs_trim_free_extents(struc
 
 	*trimmed = 0;
 
+	/* Discard not supported = nothing to do. */
+	if (!blk_queue_discard(bdev_get_queue(device->bdev)))
+		return 0;
+
 	/* Not writeable = nothing to do. */
 	if (!device->writeable)
 		return 0;
@@ -11174,8 +11201,8 @@ int btrfs_trim_fs(struct btrfs_root *roo
 	}
 
 	mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
-	devices = &root->fs_info->fs_devices->alloc_list;
-	list_for_each_entry(device, devices, dev_alloc_list) {
+	devices = &root->fs_info->fs_devices->devices;
+	list_for_each_entry(device, devices, dev_list) {
 		ret = btrfs_trim_free_extents(device, range->minlen,
 					      &group_trimmed);
 		if (ret)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/free-space-cache.c linux-libre-4.9.137-gnu/fs/btrfs/free-space-cache.c
--- linux-libre-4.9.136-gnu/fs/btrfs/free-space-cache.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/free-space-cache.c	2018-11-13 14:17:06.000000000 -0500
@@ -1693,6 +1693,8 @@ static inline void __bitmap_clear_bits(s
 	bitmap_clear(info->bitmap, start, count);
 
 	info->bytes -= bytes;
+	if (info->max_extent_size > ctl->unit)
+		info->max_extent_size = 0;
 }
 
 static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
@@ -1776,6 +1778,13 @@ static int search_bitmap(struct btrfs_fr
 	return -1;
 }
 
+static inline u64 get_max_extent_size(struct btrfs_free_space *entry)
+{
+	if (entry->bitmap)
+		return entry->max_extent_size;
+	return entry->bytes;
+}
+
 /* Cache the size of the max extent in bytes */
 static struct btrfs_free_space *
 find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
@@ -1797,8 +1806,8 @@ find_free_space(struct btrfs_free_space_
 	for (node = &entry->offset_index; node; node = rb_next(node)) {
 		entry = rb_entry(node, struct btrfs_free_space, offset_index);
 		if (entry->bytes < *bytes) {
-			if (entry->bytes > *max_extent_size)
-				*max_extent_size = entry->bytes;
+			*max_extent_size = max(get_max_extent_size(entry),
+					       *max_extent_size);
 			continue;
 		}
 
@@ -1816,8 +1825,8 @@ find_free_space(struct btrfs_free_space_
 		}
 
 		if (entry->bytes < *bytes + align_off) {
-			if (entry->bytes > *max_extent_size)
-				*max_extent_size = entry->bytes;
+			*max_extent_size = max(get_max_extent_size(entry),
+					       *max_extent_size);
 			continue;
 		}
 
@@ -1829,8 +1838,10 @@ find_free_space(struct btrfs_free_space_
 				*offset = tmp;
 				*bytes = size;
 				return entry;
-			} else if (size > *max_extent_size) {
-				*max_extent_size = size;
+			} else {
+				*max_extent_size =
+					max(get_max_extent_size(entry),
+					    *max_extent_size);
 			}
 			continue;
 		}
@@ -2689,8 +2700,8 @@ static u64 btrfs_alloc_from_bitmap(struc
 
 	err = search_bitmap(ctl, entry, &search_start, &search_bytes, true);
 	if (err) {
-		if (search_bytes > *max_extent_size)
-			*max_extent_size = search_bytes;
+		*max_extent_size = max(get_max_extent_size(entry),
+				       *max_extent_size);
 		return 0;
 	}
 
@@ -2727,8 +2738,9 @@ u64 btrfs_alloc_from_cluster(struct btrf
 
 	entry = rb_entry(node, struct btrfs_free_space, offset_index);
 	while (1) {
-		if (entry->bytes < bytes && entry->bytes > *max_extent_size)
-			*max_extent_size = entry->bytes;
+		if (entry->bytes < bytes)
+			*max_extent_size = max(get_max_extent_size(entry),
+					       *max_extent_size);
 
 		if (entry->bytes < bytes ||
 		    (!entry->bitmap && entry->offset < min_start)) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/inode.c linux-libre-4.9.137-gnu/fs/btrfs/inode.c
--- linux-libre-4.9.136-gnu/fs/btrfs/inode.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/inode.c	2018-11-13 14:17:06.000000000 -0500
@@ -489,6 +489,7 @@ again:
 		pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
 		if (!pages) {
 			/* just bail out to the uncompressed code */
+			nr_pages = 0;
 			goto cont;
 		}
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/qgroup.c linux-libre-4.9.137-gnu/fs/btrfs/qgroup.c
--- linux-libre-4.9.136-gnu/fs/btrfs/qgroup.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/qgroup.c	2018-11-13 14:17:06.000000000 -0500
@@ -2498,6 +2498,7 @@ qgroup_rescan_zero_tracking(struct btrfs
 		qgroup->rfer_cmpr = 0;
 		qgroup->excl = 0;
 		qgroup->excl_cmpr = 0;
+		qgroup_dirty(fs_info, qgroup);
 	}
 	spin_unlock(&fs_info->qgroup_lock);
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/relocation.c linux-libre-4.9.137-gnu/fs/btrfs/relocation.c
--- linux-libre-4.9.136-gnu/fs/btrfs/relocation.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/relocation.c	2018-11-13 14:17:06.000000000 -0500
@@ -1325,7 +1325,7 @@ static void __del_reloc_root(struct btrf
 	struct mapping_node *node = NULL;
 	struct reloc_control *rc = root->fs_info->reloc_ctl;
 
-	if (rc) {
+	if (rc && root->node) {
 		spin_lock(&rc->reloc_root_tree.lock);
 		rb_node = tree_search(&rc->reloc_root_tree.rb_root,
 				      root->node->start);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/btrfs/tree-log.c linux-libre-4.9.137-gnu/fs/btrfs/tree-log.c
--- linux-libre-4.9.136-gnu/fs/btrfs/tree-log.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/btrfs/tree-log.c	2018-11-13 14:17:06.000000000 -0500
@@ -3016,9 +3016,12 @@ static void free_log_tree(struct btrfs_t
 	};
 
 	ret = walk_log_tree(trans, log, &wc);
-	/* I don't think this can happen but just in case */
-	if (ret)
-		btrfs_abort_transaction(trans, ret);
+	if (ret) {
+		if (trans)
+			btrfs_abort_transaction(trans, ret);
+		else
+			btrfs_handle_fs_error(log->fs_info, ret, NULL);
+	}
 
 	while (1) {
 		ret = find_first_extent_bit(&log->dirty_log_pages,
@@ -5370,9 +5373,33 @@ static int btrfs_log_all_parents(struct
 
 			dir_inode = btrfs_iget(root->fs_info->sb, &inode_key,
 					       root, NULL);
-			/* If parent inode was deleted, skip it. */
-			if (IS_ERR(dir_inode))
-				continue;
+			/*
+			 * If the parent inode was deleted, return an error to
+			 * fallback to a transaction commit. This is to prevent
+			 * getting an inode that was moved from one parent A to
+			 * a parent B, got its former parent A deleted and then
+			 * it got fsync'ed, from existing at both parents after
+			 * a log replay (and the old parent still existing).
+			 * Example:
+			 *
+			 * mkdir /mnt/A
+			 * mkdir /mnt/B
+			 * touch /mnt/B/bar
+			 * sync
+			 * mv /mnt/B/bar /mnt/A/bar
+			 * mv -T /mnt/A /mnt/B
+			 * fsync /mnt/B/bar
+			 * <power fail>
+			 *
+			 * If we ignore the old parent B which got deleted,
+			 * after a log replay we would have file bar linked
+			 * at both parents and the old parent B would still
+			 * exist.
+			 */
+			if (IS_ERR(dir_inode)) {
+				ret = PTR_ERR(dir_inode);
+				goto out;
+			}
 
 			if (ctx)
 				ctx->log_new_dentries = false;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/cifs/cifs_debug.c linux-libre-4.9.137-gnu/fs/cifs/cifs_debug.c
--- linux-libre-4.9.136-gnu/fs/cifs/cifs_debug.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/cifs/cifs_debug.c	2018-11-13 14:17:06.000000000 -0500
@@ -284,6 +284,9 @@ static ssize_t cifs_stats_proc_write(str
 		atomic_set(&totBufAllocCount, 0);
 		atomic_set(&totSmBufAllocCount, 0);
 #endif /* CONFIG_CIFS_STATS2 */
+		atomic_set(&tcpSesReconnectCount, 0);
+		atomic_set(&tconInfoReconnectCount, 0);
+
 		spin_lock(&GlobalMid_Lock);
 		GlobalMaxActiveXid = 0;
 		GlobalCurrentXid = 0;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/cifs/cifs_spnego.c linux-libre-4.9.137-gnu/fs/cifs/cifs_spnego.c
--- linux-libre-4.9.136-gnu/fs/cifs/cifs_spnego.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/cifs/cifs_spnego.c	2018-11-13 14:17:06.000000000 -0500
@@ -147,8 +147,10 @@ cifs_get_spnego_key(struct cifs_ses *ses
 		sprintf(dp, ";sec=krb5");
 	else if (server->sec_mskerberos)
 		sprintf(dp, ";sec=mskrb5");
-	else
-		goto out;
+	else {
+		cifs_dbg(VFS, "unknown or missing server auth type, use krb5\n");
+		sprintf(dp, ";sec=krb5");
+	}
 
 	dp = description + strlen(description);
 	sprintf(dp, ";uid=0x%x",
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/cifs/inode.c linux-libre-4.9.137-gnu/fs/cifs/inode.c
--- linux-libre-4.9.136-gnu/fs/cifs/inode.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/cifs/inode.c	2018-11-13 14:17:06.000000000 -0500
@@ -768,7 +768,15 @@ cifs_get_inode_info(struct inode **inode
 	} else if (rc == -EREMOTE) {
 		cifs_create_dfs_fattr(&fattr, sb);
 		rc = 0;
-	} else if (rc == -EACCES && backup_cred(cifs_sb)) {
+	} else if ((rc == -EACCES) && backup_cred(cifs_sb) &&
+		   (strcmp(server->vals->version_string, SMB1_VERSION_STRING)
+		      == 0)) {
+			/*
+			 * For SMB2 and later the backup intent flag is already
+			 * sent if needed on open and there is no path based
+			 * FindFirst operation to use to retry with
+			 */
+
 			srchinf = kzalloc(sizeof(struct cifs_search_info),
 						GFP_KERNEL);
 			if (srchinf == NULL) {
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/cramfs/inode.c linux-libre-4.9.137-gnu/fs/cramfs/inode.c
--- linux-libre-4.9.136-gnu/fs/cramfs/inode.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/cramfs/inode.c	2018-11-13 14:17:06.000000000 -0500
@@ -186,7 +186,8 @@ static void *cramfs_read(struct super_bl
 			continue;
 		blk_offset = (blocknr - buffer_blocknr[i]) << PAGE_SHIFT;
 		blk_offset += offset;
-		if (blk_offset + len > BUFFER_SIZE)
+		if (blk_offset > BUFFER_SIZE ||
+		    blk_offset + len > BUFFER_SIZE)
 			continue;
 		return read_buffers[i] + blk_offset;
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/ext4/inline.c linux-libre-4.9.137-gnu/fs/ext4/inline.c
--- linux-libre-4.9.136-gnu/fs/ext4/inline.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/ext4/inline.c	2018-11-13 14:17:06.000000000 -0500
@@ -860,7 +860,7 @@ int ext4_da_write_inline_data_begin(stru
 	handle_t *handle;
 	struct page *page;
 	struct ext4_iloc iloc;
-	int retries;
+	int retries = 0;
 
 	ret = ext4_get_inode_loc(inode, &iloc);
 	if (ret)
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/ext4/ioctl.c linux-libre-4.9.137-gnu/fs/ext4/ioctl.c
--- linux-libre-4.9.136-gnu/fs/ext4/ioctl.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/ext4/ioctl.c	2018-11-13 14:17:06.000000000 -0500
@@ -345,7 +345,9 @@ static int ext4_ioctl_setproject(struct
 	}
 	brelse(iloc.bh);
 
-	dquot_initialize(inode);
+	err = dquot_initialize(inode);
+	if (err)
+		return err;
 
 	handle = ext4_journal_start(inode, EXT4_HT_QUOTA,
 		EXT4_QUOTA_INIT_BLOCKS(sb) +
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/ext4/move_extent.c linux-libre-4.9.137-gnu/fs/ext4/move_extent.c
--- linux-libre-4.9.136-gnu/fs/ext4/move_extent.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/ext4/move_extent.c	2018-11-13 14:17:06.000000000 -0500
@@ -526,9 +526,13 @@ mext_check_arguments(struct inode *orig_
 			orig_inode->i_ino, donor_inode->i_ino);
 		return -EINVAL;
 	}
-	if (orig_eof < orig_start + *len - 1)
+	if (orig_eof <= orig_start)
+		*len = 0;
+	else if (orig_eof < orig_start + *len - 1)
 		*len = orig_eof - orig_start;
-	if (donor_eof < donor_start + *len - 1)
+	if (donor_eof <= donor_start)
+		*len = 0;
+	else if (donor_eof < donor_start + *len - 1)
 		*len = donor_eof - donor_start;
 	if (!*len) {
 		ext4_debug("ext4 move extent: len should not be 0 "
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/gfs2/ops_fstype.c linux-libre-4.9.137-gnu/fs/gfs2/ops_fstype.c
--- linux-libre-4.9.136-gnu/fs/gfs2/ops_fstype.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/gfs2/ops_fstype.c	2018-11-13 14:17:06.000000000 -0500
@@ -1355,6 +1355,9 @@ static struct dentry *gfs2_mount_meta(st
 	struct path path;
 	int error;
 
+	if (!dev_name || !*dev_name)
+		return ERR_PTR(-EINVAL);
+
 	error = kern_path(dev_name, LOOKUP_FOLLOW, &path);
 	if (error) {
 		pr_warn("path_lookup on %s returned error %d\n",
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/jbd2/checkpoint.c linux-libre-4.9.137-gnu/fs/jbd2/checkpoint.c
--- linux-libre-4.9.136-gnu/fs/jbd2/checkpoint.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/jbd2/checkpoint.c	2018-11-13 14:17:06.000000000 -0500
@@ -254,8 +254,8 @@ restart:
 		bh = jh2bh(jh);
 
 		if (buffer_locked(bh)) {
-			spin_unlock(&journal->j_list_lock);
 			get_bh(bh);
+			spin_unlock(&journal->j_list_lock);
 			wait_on_buffer(bh);
 			/* the journal_head may have gone by now */
 			BUFFER_TRACE(bh, "brelse");
@@ -336,8 +336,8 @@ restart2:
 		jh = transaction->t_checkpoint_io_list;
 		bh = jh2bh(jh);
 		if (buffer_locked(bh)) {
-			spin_unlock(&journal->j_list_lock);
 			get_bh(bh);
+			spin_unlock(&journal->j_list_lock);
 			wait_on_buffer(bh);
 			/* the journal_head may have gone by now */
 			BUFFER_TRACE(bh, "brelse");
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/jffs2/super.c linux-libre-4.9.137-gnu/fs/jffs2/super.c
--- linux-libre-4.9.136-gnu/fs/jffs2/super.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/jffs2/super.c	2018-11-13 14:17:06.000000000 -0500
@@ -285,10 +285,8 @@ static int jffs2_fill_super(struct super
 	sb->s_fs_info = c;
 
 	ret = jffs2_parse_options(c, data);
-	if (ret) {
-		kfree(c);
+	if (ret)
 		return -EINVAL;
-	}
 
 	/* Initialize JFFS2 superblock locks, the further initialization will
 	 * be done later */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/lockd/host.c linux-libre-4.9.137-gnu/fs/lockd/host.c
--- linux-libre-4.9.136-gnu/fs/lockd/host.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/lockd/host.c	2018-11-13 14:17:06.000000000 -0500
@@ -340,7 +340,7 @@ struct nlm_host *nlmsvc_lookup_host(cons
 	};
 	struct lockd_net *ln = net_generic(net, lockd_net_id);
 
-	dprintk("lockd: %s(host='%*s', vers=%u, proto=%s)\n", __func__,
+	dprintk("lockd: %s(host='%.*s', vers=%u, proto=%s)\n", __func__,
 			(int)hostname_len, hostname, rqstp->rq_vers,
 			(rqstp->rq_prot == IPPROTO_UDP ? "udp" : "tcp"));
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/fs/nfs/nfs4client.c linux-libre-4.9.137-gnu/fs/nfs/nfs4client.c
--- linux-libre-4.9.136-gnu/fs/nfs/nfs4client.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/fs/nfs/nfs4client.c	2018-11-13 14:17:06.000000000 -0500
@@ -988,10 +988,10 @@ EXPORT_SYMBOL_GPL(nfs4_set_ds_client);
 
 /*
  * Session has been established, and the client marked ready.
- * Set the mount rsize and wsize with negotiated fore channel
- * attributes which will be bound checked in nfs_server_set_fsinfo.
+ * Limit the mount rsize, wsize and dtsize using negotiated fore
+ * channel attributes.
  */
-static void nfs4_session_set_rwsize(struct nfs_server *server)
+static void nfs4_session_limit_rwsize(struct nfs_server *server)
 {
 #ifdef CONFIG_NFS_V4_1
 	struct nfs4_session *sess;
@@ -1004,9 +1004,11 @@ static void nfs4_session_set_rwsize(stru
 	server_resp_sz = sess->fc_attrs.max_resp_sz - nfs41_maxread_overhead;
 	server_rqst_sz = sess->fc_attrs.max_rqst_sz - nfs41_maxwrite_overhead;
 
-	if (!server->rsize || server->rsize > server_resp_sz)
+	if (server->dtsize > server_resp_sz)
+		server->dtsize = server_resp_sz;
+	if (server->rsize > server_resp_sz)
 		server->rsize = server_resp_sz;
-	if (!server->wsize || server->wsize > server_rqst_sz)
+	if (server->wsize > server_rqst_sz)
 		server->wsize = server_rqst_sz;
 #endif /* CONFIG_NFS_V4_1 */
 }
@@ -1053,12 +1055,12 @@ static int nfs4_server_common_setup(stru
 			(unsigned long long) server->fsid.minor);
 	nfs_display_fhandle(mntfh, "Pseudo-fs root FH");
 
-	nfs4_session_set_rwsize(server);
-
 	error = nfs_probe_fsinfo(server, mntfh, fattr);
 	if (error < 0)
 		goto out;
 
+	nfs4_session_limit_rwsize(server);
+
 	if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN)
 		server->namelen = NFS4_MAXNAMLEN;
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/include/linux/tc.h linux-libre-4.9.137-gnu/include/linux/tc.h
--- linux-libre-4.9.136-gnu/include/linux/tc.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/include/linux/tc.h	2018-11-13 14:17:06.000000000 -0500
@@ -84,6 +84,7 @@ struct tc_dev {
 					   device. */
 	struct device	dev;		/* Generic device interface. */
 	struct resource	resource;	/* Address space of this device. */
+	u64		dma_mask;	/* DMA addressable range. */
 	char		vendor[9];
 	char		name[9];
 	char		firmware[9];
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/bounds.c linux-libre-4.9.137-gnu/kernel/bounds.c
--- linux-libre-4.9.136-gnu/kernel/bounds.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/bounds.c	2018-11-13 14:17:06.000000000 -0500
@@ -12,7 +12,7 @@
 #include <linux/log2.h>
 #include <linux/spinlock_types.h>
 
-void foo(void)
+int main(void)
 {
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
@@ -22,4 +22,6 @@ void foo(void)
 #endif
 	DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
 	/* End of constants */
+
+	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/cpu.c linux-libre-4.9.137-gnu/kernel/cpu.c
--- linux-libre-4.9.136-gnu/kernel/cpu.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/cpu.c	2018-11-13 14:17:06.000000000 -0500
@@ -1970,6 +1970,12 @@ static void cpuhp_online_cpu_device(unsi
 	kobject_uevent(&dev->kobj, KOBJ_ONLINE);
 }
 
+/*
+ * Architectures that need SMT-specific errata handling during SMT hotplug
+ * should override this.
+ */
+void __weak arch_smt_update(void) { };
+
 static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
 {
 	int cpu, ret = 0;
@@ -1996,8 +2002,10 @@ static int cpuhp_smt_disable(enum cpuhp_
 		 */
 		cpuhp_offline_cpu_device(cpu);
 	}
-	if (!ret)
+	if (!ret) {
 		cpu_smt_control = ctrlval;
+		arch_smt_update();
+	}
 	cpu_maps_update_done();
 	return ret;
 }
@@ -2008,6 +2016,7 @@ static int cpuhp_smt_enable(void)
 
 	cpu_maps_update_begin();
 	cpu_smt_control = CPU_SMT_ENABLED;
+	arch_smt_update();
 	for_each_present_cpu(cpu) {
 		/* Skip online CPUs and CPUs on offline nodes */
 		if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/irq/manage.c linux-libre-4.9.137-gnu/kernel/irq/manage.c
--- linux-libre-4.9.136-gnu/kernel/irq/manage.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/irq/manage.c	2018-11-13 14:17:06.000000000 -0500
@@ -878,6 +878,9 @@ irq_forced_thread_fn(struct irq_desc *de
 
 	local_bh_disable();
 	ret = action->thread_fn(action->irq, action->dev_id);
+	if (ret == IRQ_HANDLED)
+		atomic_inc(&desc->threads_handled);
+
 	irq_finalize_oneshot(desc, action);
 	local_bh_enable();
 	return ret;
@@ -894,6 +897,9 @@ static irqreturn_t irq_thread_fn(struct
 	irqreturn_t ret;
 
 	ret = action->thread_fn(action->irq, action->dev_id);
+	if (ret == IRQ_HANDLED)
+		atomic_inc(&desc->threads_handled);
+
 	irq_finalize_oneshot(desc, action);
 	return ret;
 }
@@ -971,8 +977,6 @@ static int irq_thread(void *data)
 		irq_thread_check_affinity(desc, action);
 
 		action_ret = handler_fn(desc, action);
-		if (action_ret == IRQ_HANDLED)
-			atomic_inc(&desc->threads_handled);
 		if (action_ret == IRQ_WAKE_THREAD)
 			irq_wake_secondary(desc, action);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/kprobes.c linux-libre-4.9.137-gnu/kernel/kprobes.c
--- linux-libre-4.9.136-gnu/kernel/kprobes.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/kprobes.c	2018-11-13 14:17:06.000000000 -0500
@@ -665,9 +665,10 @@ static void unoptimize_kprobe(struct kpr
 }
 
 /* Cancel unoptimizing for reusing */
-static void reuse_unused_kprobe(struct kprobe *ap)
+static int reuse_unused_kprobe(struct kprobe *ap)
 {
 	struct optimized_kprobe *op;
+	int ret;
 
 	BUG_ON(!kprobe_unused(ap));
 	/*
@@ -681,8 +682,12 @@ static void reuse_unused_kprobe(struct k
 	/* Enable the probe again */
 	ap->flags &= ~KPROBE_FLAG_DISABLED;
 	/* Optimize it again (remove from op->list) */
-	BUG_ON(!kprobe_optready(ap));
+	ret = kprobe_optready(ap);
+	if (ret)
+		return ret;
+
 	optimize_kprobe(ap);
+	return 0;
 }
 
 /* Remove optimized instructions */
@@ -894,11 +899,16 @@ static void __disarm_kprobe(struct kprob
 #define kprobe_disarmed(p)			kprobe_disabled(p)
 #define wait_for_kprobe_optimizer()		do {} while (0)
 
-/* There should be no unused kprobes can be reused without optimization */
-static void reuse_unused_kprobe(struct kprobe *ap)
+static int reuse_unused_kprobe(struct kprobe *ap)
 {
+	/*
+	 * If the optimized kprobe is NOT supported, the aggr kprobe is
+	 * released at the same time that the last aggregated kprobe is
+	 * unregistered.
+	 * Thus there should be no chance to reuse unused kprobe.
+	 */
 	printk(KERN_ERR "Error: There should be no unused kprobe here.\n");
-	BUG_ON(kprobe_unused(ap));
+	return -EINVAL;
 }
 
 static void free_aggr_kprobe(struct kprobe *p)
@@ -1276,9 +1286,12 @@ static int register_aggr_kprobe(struct k
 			goto out;
 		}
 		init_aggr_kprobe(ap, orig_p);
-	} else if (kprobe_unused(ap))
+	} else if (kprobe_unused(ap)) {
 		/* This probe is going to die. Rescue it */
-		reuse_unused_kprobe(ap);
+		ret = reuse_unused_kprobe(ap);
+		if (ret)
+			goto out;
+	}
 
 	if (kprobe_gone(ap)) {
 		/*
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/locking/lockdep.c linux-libre-4.9.137-gnu/kernel/locking/lockdep.c
--- linux-libre-4.9.136-gnu/kernel/locking/lockdep.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/locking/lockdep.c	2018-11-13 14:17:06.000000000 -0500
@@ -4010,7 +4010,7 @@ void lock_contended(struct lockdep_map *
 {
 	unsigned long flags;
 
-	if (unlikely(!lock_stat))
+	if (unlikely(!lock_stat || !debug_locks))
 		return;
 
 	if (unlikely(current->lockdep_recursion))
@@ -4030,7 +4030,7 @@ void lock_acquired(struct lockdep_map *l
 {
 	unsigned long flags;
 
-	if (unlikely(!lock_stat))
+	if (unlikely(!lock_stat || !debug_locks))
 		return;
 
 	if (unlikely(current->lockdep_recursion))
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/printk/printk.c linux-libre-4.9.137-gnu/kernel/printk/printk.c
--- linux-libre-4.9.136-gnu/kernel/printk/printk.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/printk/printk.c	2018-11-13 14:17:06.000000000 -0500
@@ -1010,7 +1010,12 @@ static void __init log_buf_len_update(un
 /* save requested log_buf_len since it's too early to process it */
 static int __init log_buf_len_setup(char *str)
 {
-	unsigned size = memparse(str, &str);
+	unsigned int size;
+
+	if (!str)
+		return -EINVAL;
+
+	size = memparse(str, &str);
 
 	log_buf_len_update(size);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/sched/fair.c linux-libre-4.9.137-gnu/kernel/sched/fair.c
--- linux-libre-4.9.136-gnu/kernel/sched/fair.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/sched/fair.c	2018-11-13 14:17:06.000000000 -0500
@@ -3502,7 +3502,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, st
 	 * put back on, and if we advance min_vruntime, we'll be placed back
 	 * further than we started -- ie. we'll be penalized.
 	 */
-	if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) == DEQUEUE_SAVE)
+	if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) != DEQUEUE_SAVE)
 		update_min_vruntime(cfs_rq);
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/kernel/signal.c linux-libre-4.9.137-gnu/kernel/signal.c
--- linux-libre-4.9.136-gnu/kernel/signal.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/kernel/signal.c	2018-11-13 14:17:06.000000000 -0500
@@ -991,7 +991,7 @@ static int __send_signal(int sig, struct
 
 	result = TRACE_SIGNAL_IGNORED;
 	if (!prepare_signal(sig, t,
-			from_ancestor_ns || (info == SEND_SIG_FORCED)))
+			from_ancestor_ns || (info == SEND_SIG_PRIV) || (info == SEND_SIG_FORCED)))
 		goto ret;
 
 	pending = group ? &t->signal->shared_pending : &t->pending;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/lib/debug_locks.c linux-libre-4.9.137-gnu/lib/debug_locks.c
--- linux-libre-4.9.136-gnu/lib/debug_locks.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/lib/debug_locks.c	2018-11-13 14:17:06.000000000 -0500
@@ -37,7 +37,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);
  */
 int debug_locks_off(void)
 {
-	if (__debug_locks_off()) {
+	if (debug_locks && __debug_locks_off()) {
 		if (!debug_locks_silent) {
 			console_verbose();
 			return 1;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/Makefile linux-libre-4.9.137-gnu/Makefile
--- linux-libre-4.9.136-gnu/Makefile	2018-11-10 13:51:32.000000000 -0500
+++ linux-libre-4.9.137-gnu/Makefile	2018-11-13 17:29:46.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 136
+SUBLEVEL = 137
 EXTRAVERSION = -gnu
 NAME = Roaring Lionus
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/mm/hugetlb.c linux-libre-4.9.137-gnu/mm/hugetlb.c
--- linux-libre-4.9.136-gnu/mm/hugetlb.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/mm/hugetlb.c	2018-11-13 14:17:06.000000000 -0500
@@ -3645,6 +3645,12 @@ int huge_add_to_page_cache(struct page *
 		return err;
 	ClearPagePrivate(page);
 
+	/*
+	 * set page dirty so that it will not be removed from cache/file
+	 * by non-hugetlbfs specific code paths.
+	 */
+	set_page_dirty(page);
+
 	spin_lock(&inode->i_lock);
 	inode->i_blocks += blocks_per_huge_page(h);
 	spin_unlock(&inode->i_lock);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/net/core/netclassid_cgroup.c linux-libre-4.9.137-gnu/net/core/netclassid_cgroup.c
--- linux-libre-4.9.136-gnu/net/core/netclassid_cgroup.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/net/core/netclassid_cgroup.c	2018-11-13 14:17:06.000000000 -0500
@@ -104,6 +104,7 @@ static int write_classid(struct cgroup_s
 		iterate_fd(p->files, 0, update_classid_sock,
 			   (void *)(unsigned long)cs->classid);
 		task_unlock(p);
+		cond_resched();
 	}
 	css_task_iter_end(&it);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/net/ipv4/cipso_ipv4.c linux-libre-4.9.137-gnu/net/ipv4/cipso_ipv4.c
--- linux-libre-4.9.136-gnu/net/ipv4/cipso_ipv4.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/net/ipv4/cipso_ipv4.c	2018-11-13 14:17:06.000000000 -0500
@@ -1512,7 +1512,7 @@ static int cipso_v4_parsetag_loc(const s
  *
  * Description:
  * Parse the packet's IP header looking for a CIPSO option.  Returns a pointer
- * to the start of the CIPSO option on success, NULL if one if not found.
+ * to the start of the CIPSO option on success, NULL if one is not found.
  *
  */
 unsigned char *cipso_v4_optptr(const struct sk_buff *skb)
@@ -1522,10 +1522,8 @@ unsigned char *cipso_v4_optptr(const str
 	int optlen;
 	int taglen;
 
-	for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 0; ) {
+	for (optlen = iph->ihl*4 - sizeof(struct iphdr); optlen > 1; ) {
 		switch (optptr[0]) {
-		case IPOPT_CIPSO:
-			return optptr;
 		case IPOPT_END:
 			return NULL;
 		case IPOPT_NOOP:
@@ -1534,6 +1532,11 @@ unsigned char *cipso_v4_optptr(const str
 		default:
 			taglen = optptr[1];
 		}
+		if (!taglen || taglen > optlen)
+			return NULL;
+		if (optptr[0] == IPOPT_CIPSO)
+			return optptr;
+
 		optlen -= taglen;
 		optptr += taglen;
 	}
diff -druNp --no-dereference linux-libre-4.9.136-gnu/net/sunrpc/svc_xprt.c linux-libre-4.9.137-gnu/net/sunrpc/svc_xprt.c
--- linux-libre-4.9.136-gnu/net/sunrpc/svc_xprt.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/net/sunrpc/svc_xprt.c	2018-11-13 14:17:06.000000000 -0500
@@ -1038,7 +1038,7 @@ static void call_xpt_users(struct svc_xp
 	spin_lock(&xprt->xpt_lock);
 	while (!list_empty(&xprt->xpt_users)) {
 		u = list_first_entry(&xprt->xpt_users, struct svc_xpt_user, list);
-		list_del(&u->list);
+		list_del_init(&u->list);
 		u->callback(u);
 	}
 	spin_unlock(&xprt->xpt_lock);
diff -druNp --no-dereference linux-libre-4.9.136-gnu/net/xfrm/xfrm_policy.c linux-libre-4.9.137-gnu/net/xfrm/xfrm_policy.c
--- linux-libre-4.9.136-gnu/net/xfrm/xfrm_policy.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/net/xfrm/xfrm_policy.c	2018-11-13 14:17:06.000000000 -0500
@@ -659,9 +659,9 @@ static void xfrm_hash_rebuild(struct wor
 				break;
 		}
 		if (newpos)
-			hlist_add_behind(&policy->bydst, newpos);
+			hlist_add_behind_rcu(&policy->bydst, newpos);
 		else
-			hlist_add_head(&policy->bydst, chain);
+			hlist_add_head_rcu(&policy->bydst, chain);
 	}
 
 	spin_unlock_bh(&net->xfrm.xfrm_policy_lock);
@@ -800,9 +800,9 @@ int xfrm_policy_insert(int dir, struct x
 			break;
 	}
 	if (newpos)
-		hlist_add_behind(&policy->bydst, newpos);
+		hlist_add_behind_rcu(&policy->bydst, newpos);
 	else
-		hlist_add_head(&policy->bydst, chain);
+		hlist_add_head_rcu(&policy->bydst, chain);
 	__xfrm_policy_link(policy, dir);
 	atomic_inc(&net->xfrm.flow_cache_genid);
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/security/integrity/ima/ima_fs.c linux-libre-4.9.137-gnu/security/integrity/ima/ima_fs.c
--- linux-libre-4.9.136-gnu/security/integrity/ima/ima_fs.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/security/integrity/ima/ima_fs.c	2018-11-13 14:17:06.000000000 -0500
@@ -29,14 +29,14 @@
 static DEFINE_MUTEX(ima_write_mutex);
 
 static int valid_policy = 1;
-#define TMPBUFLEN 12
+
 static ssize_t ima_show_htable_value(char __user *buf, size_t count,
 				     loff_t *ppos, atomic_long_t *val)
 {
-	char tmpbuf[TMPBUFLEN];
+	char tmpbuf[32];	/* greater than largest 'long' string value */
 	ssize_t len;
 
-	len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val));
+	len = scnprintf(tmpbuf, sizeof(tmpbuf), "%li\n", atomic_long_read(val));
 	return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/pci/ca0106/ca0106.h linux-libre-4.9.137-gnu/sound/pci/ca0106/ca0106.h
--- linux-libre-4.9.136-gnu/sound/pci/ca0106/ca0106.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/pci/ca0106/ca0106.h	2018-11-13 14:17:06.000000000 -0500
@@ -582,7 +582,7 @@
 #define SPI_PL_BIT_R_R		(2<<7)	/* right channel = right */
 #define SPI_PL_BIT_R_C		(3<<7)	/* right channel = (L+R)/2 */
 #define SPI_IZD_REG		2
-#define SPI_IZD_BIT		(1<<4)	/* infinite zero detect */
+#define SPI_IZD_BIT		(0<<4)	/* infinite zero detect */
 
 #define SPI_FMT_REG		3
 #define SPI_FMT_BIT_RJ		(0<<0)	/* right justified mode */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/pci/hda/hda_controller.h linux-libre-4.9.137-gnu/sound/pci/hda/hda_controller.h
--- linux-libre-4.9.136-gnu/sound/pci/hda/hda_controller.h	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/pci/hda/hda_controller.h	2018-11-13 14:17:06.000000000 -0500
@@ -155,6 +155,7 @@ struct azx {
 	unsigned int msi:1;
 	unsigned int probing:1; /* codec probing phase */
 	unsigned int snoop:1;
+	unsigned int uc_buffer:1; /* non-cached pages for stream buffers */
 	unsigned int align_buffer_size:1;
 	unsigned int region_requested:1;
 	unsigned int disabled:1; /* disabled by vga_switcheroo */
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/pci/hda/hda_intel.c linux-libre-4.9.137-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.9.136-gnu/sound/pci/hda/hda_intel.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/pci/hda/hda_intel.c	2018-11-13 14:17:06.000000000 -0500
@@ -410,7 +410,7 @@ static void __mark_pages_wc(struct azx *
 #ifdef CONFIG_SND_DMA_SGBUF
 	if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) {
 		struct snd_sg_buf *sgbuf = dmab->private_data;
-		if (chip->driver_type == AZX_DRIVER_CMEDIA)
+		if (!chip->uc_buffer)
 			return; /* deal with only CORB/RIRB buffers */
 		if (on)
 			set_pages_array_wc(sgbuf->page_table, sgbuf->pages);
@@ -1503,6 +1503,7 @@ static void azx_check_snoop_available(st
 		dev_info(chip->card->dev, "Force to %s mode by module option\n",
 			 snoop ? "snoop" : "non-snoop");
 		chip->snoop = snoop;
+		chip->uc_buffer = !snoop;
 		return;
 	}
 
@@ -1523,8 +1524,12 @@ static void azx_check_snoop_available(st
 		snoop = false;
 
 	chip->snoop = snoop;
-	if (!snoop)
+	if (!snoop) {
 		dev_info(chip->card->dev, "Force to non-snoop mode\n");
+		/* C-Media requires non-cached pages only for CORB/RIRB */
+		if (chip->driver_type != AZX_DRIVER_CMEDIA)
+			chip->uc_buffer = true;
+	}
 }
 
 static void azx_probe_work(struct work_struct *work)
@@ -1947,7 +1952,7 @@ static void pcm_mmap_prepare(struct snd_
 #ifdef CONFIG_X86
 	struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
 	struct azx *chip = apcm->chip;
-	if (!azx_snoop(chip) && chip->driver_type != AZX_DRIVER_CMEDIA)
+	if (chip->uc_buffer)
 		area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
 #endif
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/pci/hda/patch_conexant.c linux-libre-4.9.137-gnu/sound/pci/hda/patch_conexant.c
--- linux-libre-4.9.136-gnu/sound/pci/hda/patch_conexant.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/pci/hda/patch_conexant.c	2018-11-13 14:17:06.000000000 -0500
@@ -867,6 +867,7 @@ static const struct snd_pci_quirk cxt506
 	SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT_PINCFG_LENOVO_TP410),
 	SND_PCI_QUIRK(0x17aa, 0x21db, "Lenovo X220-tablet", CXT_PINCFG_LENOVO_TP410),
 	SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo IdeaPad Z560", CXT_FIXUP_MUTE_LED_EAPD),
+	SND_PCI_QUIRK(0x17aa, 0x3905, "Lenovo G50-30", CXT_FIXUP_STEREO_DMIC),
 	SND_PCI_QUIRK(0x17aa, 0x390b, "Lenovo G50-80", CXT_FIXUP_STEREO_DMIC),
 	SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
 	SND_PCI_QUIRK(0x17aa, 0x3977, "Lenovo IdeaPad U310", CXT_FIXUP_STEREO_DMIC),
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/pci/hda/patch_realtek.c linux-libre-4.9.137-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-4.9.136-gnu/sound/pci/hda/patch_realtek.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/pci/hda/patch_realtek.c	2018-11-13 14:17:06.000000000 -0500
@@ -6811,6 +6811,8 @@ enum {
 	ALC662_FIXUP_ASUS_Nx50,
 	ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
 	ALC668_FIXUP_ASUS_Nx51,
+	ALC668_FIXUP_MIC_COEF,
+	ALC668_FIXUP_ASUS_G751,
 	ALC891_FIXUP_HEADSET_MODE,
 	ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
 	ALC662_FIXUP_ACER_VERITON,
@@ -7077,6 +7079,23 @@ static const struct hda_fixup alc662_fix
 		.chained = true,
 		.chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
 	},
+	[ALC668_FIXUP_MIC_COEF] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = (const struct hda_verb[]) {
+			{ 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
+			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
+			{}
+		},
+	},
+	[ALC668_FIXUP_ASUS_G751] = {
+		.type = HDA_FIXUP_PINS,
+		.v.pins = (const struct hda_pintbl[]) {
+			{ 0x16, 0x0421101f }, /* HP */
+			{}
+		},
+		.chained = true,
+		.chain_id = ALC668_FIXUP_MIC_COEF
+	},
 	[ALC891_FIXUP_HEADSET_MODE] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc_fixup_headset_mode,
@@ -7132,6 +7151,7 @@ static const struct snd_pci_quirk alc662
 	SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
 	SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
 	SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
+	SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
 	SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
 	SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
 	SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
diff -druNp --no-dereference linux-libre-4.9.136-gnu/sound/soc/intel/skylake/skl-topology.c linux-libre-4.9.137-gnu/sound/soc/intel/skylake/skl-topology.c
--- linux-libre-4.9.136-gnu/sound/soc/intel/skylake/skl-topology.c	2018-11-10 14:21:26.000000000 -0500
+++ linux-libre-4.9.137-gnu/sound/soc/intel/skylake/skl-topology.c	2018-11-13 18:02:26.000000000 -0500
@@ -1780,6 +1780,7 @@ static int skl_tplg_get_token(struct dev
 
 	case SKL_TKN_U8_CORE_ID:
 		mconfig->core_id = tkn_elem->value;
+		break;
 
 	case SKL_TKN_U8_MOD_TYPE:
 		mconfig->m_type = tkn_elem->value;
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/perf/util/event.c linux-libre-4.9.137-gnu/tools/perf/util/event.c
--- linux-libre-4.9.136-gnu/tools/perf/util/event.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/perf/util/event.c	2018-11-13 14:17:06.000000000 -0500
@@ -839,6 +839,7 @@ void *cpu_map_data__alloc(struct cpu_map
 	}
 
 	*size += sizeof(struct cpu_map_data);
+	*size = PERF_ALIGN(*size, sizeof(u64));
 	return zalloc(*size);
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/perf/util/pmu.c linux-libre-4.9.137-gnu/tools/perf/util/pmu.c
--- linux-libre-4.9.136-gnu/tools/perf/util/pmu.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/perf/util/pmu.c	2018-11-13 14:17:06.000000000 -0500
@@ -685,13 +685,14 @@ static void pmu_format_value(unsigned lo
 
 static __u64 pmu_format_max_value(const unsigned long *format)
 {
-	__u64 w = 0;
-	int fbit;
-
-	for_each_set_bit(fbit, format, PERF_PMU_FORMAT_BITS)
-		w |= (1ULL << fbit);
+	int w;
 
-	return w;
+	w = bitmap_weight(format, PERF_PMU_FORMAT_BITS);
+	if (!w)
+		return 0;
+	if (w < 64)
+		return (1ULL << w) - 1;
+	return -1;
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/perf/util/strbuf.c linux-libre-4.9.137-gnu/tools/perf/util/strbuf.c
--- linux-libre-4.9.136-gnu/tools/perf/util/strbuf.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/perf/util/strbuf.c	2018-11-13 14:17:06.000000000 -0500
@@ -105,19 +105,25 @@ static int strbuf_addv(struct strbuf *sb
 
 	va_copy(ap_saved, ap);
 	len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap);
-	if (len < 0)
+	if (len < 0) {
+		va_end(ap_saved);
 		return len;
+	}
 	if (len > strbuf_avail(sb)) {
 		ret = strbuf_grow(sb, len);
-		if (ret)
+		if (ret) {
+			va_end(ap_saved);
 			return ret;
+		}
 		len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved);
 		va_end(ap_saved);
 		if (len > strbuf_avail(sb)) {
 			pr_debug("this should not happen, your vsnprintf is broken");
+			va_end(ap_saved);
 			return -EINVAL;
 		}
 	}
+	va_end(ap_saved);
 	return strbuf_setlen(sb, sb->len + len);
 }
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/perf/util/trace-event-info.c linux-libre-4.9.137-gnu/tools/perf/util/trace-event-info.c
--- linux-libre-4.9.136-gnu/tools/perf/util/trace-event-info.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/perf/util/trace-event-info.c	2018-11-13 14:17:06.000000000 -0500
@@ -507,12 +507,14 @@ struct tracing_data *tracing_data_get(st
 			 "/tmp/perf-XXXXXX");
 		if (!mkstemp(tdata->temp_file)) {
 			pr_debug("Can't make temp file");
+			free(tdata);
 			return NULL;
 		}
 
 		temp_fd = open(tdata->temp_file, O_RDWR);
 		if (temp_fd < 0) {
 			pr_debug("Can't read '%s'", tdata->temp_file);
+			free(tdata);
 			return NULL;
 		}
 
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/perf/util/trace-event-read.c linux-libre-4.9.137-gnu/tools/perf/util/trace-event-read.c
--- linux-libre-4.9.136-gnu/tools/perf/util/trace-event-read.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/perf/util/trace-event-read.c	2018-11-13 14:17:06.000000000 -0500
@@ -334,9 +334,12 @@ static int read_event_files(struct peven
 		for (x=0; x < count; x++) {
 			size = read8(pevent);
 			ret = read_event_file(pevent, sys, size);
-			if (ret)
+			if (ret) {
+				free(sys);
 				return ret;
+			}
 		}
+		free(sys);
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc linux-libre-4.9.137-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc
--- linux-libre-4.9.136-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc	1969-12-31 19:00:00.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-syntax.tc	2018-11-13 14:17:06.000000000 -0500
@@ -0,0 +1,80 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: event trigger - test synthetic_events syntax parser
+
+do_reset() {
+    reset_trigger
+    echo > set_event
+    clear_trace
+}
+
+fail() { #msg
+    do_reset
+    echo $1
+    exit_fail
+}
+
+if [ ! -f set_event ]; then
+    echo "event tracing is not supported"
+    exit_unsupported
+fi
+
+if [ ! -f synthetic_events ]; then
+    echo "synthetic event is not supported"
+    exit_unsupported
+fi
+
+reset_tracer
+do_reset
+
+echo "Test synthetic_events syntax parser"
+
+echo > synthetic_events
+
+# synthetic event must have a field
+! echo "myevent" >> synthetic_events
+echo "myevent u64 var1" >> synthetic_events
+
+# synthetic event must be found in synthetic_events
+grep "myevent[[:space:]]u64 var1" synthetic_events
+
+# it is not possible to add same name event
+! echo "myevent u64 var2" >> synthetic_events
+
+# Non-append open will cleanup all events and add new one
+echo "myevent u64 var2" > synthetic_events
+
+# multiple fields with different spaces
+echo "myevent u64 var1; u64 var2;" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+echo "myevent u64 var1 ; u64 var2 ;" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+echo "myevent u64 var1 ;u64 var2" > synthetic_events
+grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
+
+# test field types
+echo "myevent u32 var" > synthetic_events
+echo "myevent u16 var" > synthetic_events
+echo "myevent u8 var" > synthetic_events
+echo "myevent s64 var" > synthetic_events
+echo "myevent s32 var" > synthetic_events
+echo "myevent s16 var" > synthetic_events
+echo "myevent s8 var" > synthetic_events
+
+echo "myevent char var" > synthetic_events
+echo "myevent int var" > synthetic_events
+echo "myevent long var" > synthetic_events
+echo "myevent pid_t var" > synthetic_events
+
+echo "myevent unsigned char var" > synthetic_events
+echo "myevent unsigned int var" > synthetic_events
+echo "myevent unsigned long var" > synthetic_events
+grep "myevent[[:space:]]unsigned long var" synthetic_events
+
+# test string type
+echo "myevent char var[10]" > synthetic_events
+grep "myevent[[:space:]]char\[10\] var" synthetic_events
+
+do_reset
+
+exit 0
diff -druNp --no-dereference linux-libre-4.9.136-gnu/tools/testing/selftests/net/reuseport_bpf.c linux-libre-4.9.137-gnu/tools/testing/selftests/net/reuseport_bpf.c
--- linux-libre-4.9.136-gnu/tools/testing/selftests/net/reuseport_bpf.c	2018-11-10 10:43:01.000000000 -0500
+++ linux-libre-4.9.137-gnu/tools/testing/selftests/net/reuseport_bpf.c	2018-11-13 14:17:06.000000000 -0500
@@ -437,14 +437,19 @@ void enable_fastopen(void)
 	}
 }
 
-static struct rlimit rlim_old, rlim_new;
+static struct rlimit rlim_old;
 
 static  __attribute__((constructor)) void main_ctor(void)
 {
 	getrlimit(RLIMIT_MEMLOCK, &rlim_old);
-	rlim_new.rlim_cur = rlim_old.rlim_cur + (1UL << 20);
-	rlim_new.rlim_max = rlim_old.rlim_max + (1UL << 20);
-	setrlimit(RLIMIT_MEMLOCK, &rlim_new);
+
+	if (rlim_old.rlim_cur != RLIM_INFINITY) {
+		struct rlimit rlim_new;
+
+		rlim_new.rlim_cur = rlim_old.rlim_cur + (1UL << 20);
+		rlim_new.rlim_max = rlim_old.rlim_max + (1UL << 20);
+		setrlimit(RLIMIT_MEMLOCK, &rlim_new);
+	}
 }
 
 static __attribute__((destructor)) void main_dtor(void)
