diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arc/boot/dts/hsdk.dts linux-libre-5.1.15-gnu/arch/arc/boot/dts/hsdk.dts
--- linux-libre-5.1.14-gnu/arch/arc/boot/dts/hsdk.dts	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arc/boot/dts/hsdk.dts	2019-06-24 23:34:56.000000000 -0400
@@ -187,6 +187,7 @@
 			interrupt-names = "macirq";
 			phy-mode = "rgmii";
 			snps,pbl = <32>;
+			snps,multicast-filter-bins = <256>;
 			clocks = <&gmacclk>;
 			clock-names = "stmmaceth";
 			phy-handle = <&phy0>;
@@ -195,6 +196,9 @@
 			mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */
 			dma-coherent;
 
+			tx-fifo-depth = <4096>;
+			rx-fifo-depth = <4096>;
+
 			mdio {
 				#address-cells = <1>;
 				#size-cells = <0>;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arc/include/asm/cmpxchg.h linux-libre-5.1.15-gnu/arch/arc/include/asm/cmpxchg.h
--- linux-libre-5.1.14-gnu/arch/arc/include/asm/cmpxchg.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arc/include/asm/cmpxchg.h	2019-06-24 23:34:56.000000000 -0400
@@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned l
 
 #endif /* CONFIG_ARC_HAS_LLSC */
 
-#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \
-				(unsigned long)(o), (unsigned long)(n)))
+#define cmpxchg(ptr, o, n) ({				\
+	(typeof(*(ptr)))__cmpxchg((ptr),		\
+				  (unsigned long)(o),	\
+				  (unsigned long)(n));	\
+})
 
 /*
  * atomic_cmpxchg is same as cmpxchg
@@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsig
 	return __xchg_bad_pointer();
 }
 
-#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \
-						 sizeof(*(ptr))))
+#define xchg(ptr, with) ({				\
+	(typeof(*(ptr)))__xchg((unsigned long)(with),	\
+			       (ptr),			\
+			       sizeof(*(ptr)));		\
+})
 
 #endif /* CONFIG_ARC_PLAT_EZNPS */
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arc/mm/tlb.c linux-libre-5.1.15-gnu/arch/arc/mm/tlb.c
--- linux-libre-5.1.14-gnu/arch/arc/mm/tlb.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arc/mm/tlb.c	2019-06-24 23:34:56.000000000 -0400
@@ -911,9 +911,11 @@ void do_tlb_overlap_fault(unsigned long
 			  struct pt_regs *regs)
 {
 	struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu;
-	unsigned int pd0[mmu->ways];
 	unsigned long flags;
-	int set;
+	int set, n_ways = mmu->ways;
+
+	n_ways = min(n_ways, 4);
+	BUG_ON(mmu->ways > 4);
 
 	local_irq_save(flags);
 
@@ -921,9 +923,10 @@ void do_tlb_overlap_fault(unsigned long
 	for (set = 0; set < mmu->sets; set++) {
 
 		int is_valid, way;
+		unsigned int pd0[4];
 
 		/* read out all the ways of current set */
-		for (way = 0, is_valid = 0; way < mmu->ways; way++) {
+		for (way = 0, is_valid = 0; way < n_ways; way++) {
 			write_aux_reg(ARC_REG_TLBINDEX,
 					  SET_WAY_TO_IDX(mmu, set, way));
 			write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead);
@@ -937,14 +940,14 @@ void do_tlb_overlap_fault(unsigned long
 			continue;
 
 		/* Scan the set for duplicate ways: needs a nested loop */
-		for (way = 0; way < mmu->ways - 1; way++) {
+		for (way = 0; way < n_ways - 1; way++) {
 
 			int n;
 
 			if (!pd0[way])
 				continue;
 
-			for (n = way + 1; n < mmu->ways; n++) {
+			for (n = way + 1; n < n_ways; n++) {
 				if (pd0[way] != pd0[n])
 					continue;
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm/boot/dts/am57xx-idk-common.dtsi linux-libre-5.1.15-gnu/arch/arm/boot/dts/am57xx-idk-common.dtsi
--- linux-libre-5.1.14-gnu/arch/arm/boot/dts/am57xx-idk-common.dtsi	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm/boot/dts/am57xx-idk-common.dtsi	2019-06-24 23:34:56.000000000 -0400
@@ -420,6 +420,7 @@
 	vqmmc-supply = <&ldo1_reg>;
 	bus-width = <4>;
 	cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
+	no-1-8-v;
 };
 
 &mmc2 {
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi linux-libre-5.1.15-gnu/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi
--- linux-libre-5.1.14-gnu/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm/boot/dts/dra76x-mmc-iodelay.dtsi	2019-06-24 23:34:56.000000000 -0400
@@ -22,7 +22,7 @@
  *
  * Datamanual Revisions:
  *
- * DRA76x Silicon Revision 1.0: SPRS993A, Revised July 2017
+ * DRA76x Silicon Revision 1.0: SPRS993E, Revised December 2018
  *
  */
 
@@ -169,25 +169,25 @@
 	/* Corresponds to MMC2_HS200_MANUAL1 in datamanual */
 	mmc2_iodelay_hs200_conf: mmc2_iodelay_hs200_conf {
 		pinctrl-pin-array = <
-			0x190 A_DELAY_PS(384) G_DELAY_PS(0)       /* CFG_GPMC_A19_OEN */
-			0x194 A_DELAY_PS(0) G_DELAY_PS(174)       /* CFG_GPMC_A19_OUT */
-			0x1a8 A_DELAY_PS(410) G_DELAY_PS(0)       /* CFG_GPMC_A20_OEN */
-			0x1ac A_DELAY_PS(85) G_DELAY_PS(0)        /* CFG_GPMC_A20_OUT */
-			0x1b4 A_DELAY_PS(468) G_DELAY_PS(0)       /* CFG_GPMC_A21_OEN */
-			0x1b8 A_DELAY_PS(139) G_DELAY_PS(0)       /* CFG_GPMC_A21_OUT */
-			0x1c0 A_DELAY_PS(676) G_DELAY_PS(0)       /* CFG_GPMC_A22_OEN */
-			0x1c4 A_DELAY_PS(69) G_DELAY_PS(0)        /* CFG_GPMC_A22_OUT */
-			0x1d0 A_DELAY_PS(1062) G_DELAY_PS(154)	  /* CFG_GPMC_A23_OUT */
-			0x1d8 A_DELAY_PS(640) G_DELAY_PS(0)       /* CFG_GPMC_A24_OEN */
-			0x1dc A_DELAY_PS(0) G_DELAY_PS(0)         /* CFG_GPMC_A24_OUT */
-			0x1e4 A_DELAY_PS(356) G_DELAY_PS(0)       /* CFG_GPMC_A25_OEN */
-			0x1e8 A_DELAY_PS(0) G_DELAY_PS(0)         /* CFG_GPMC_A25_OUT */
-			0x1f0 A_DELAY_PS(579) G_DELAY_PS(0)       /* CFG_GPMC_A26_OEN */
-			0x1f4 A_DELAY_PS(0) G_DELAY_PS(0)         /* CFG_GPMC_A26_OUT */
-			0x1fc A_DELAY_PS(435) G_DELAY_PS(0)       /* CFG_GPMC_A27_OEN */
-			0x200 A_DELAY_PS(36) G_DELAY_PS(0)        /* CFG_GPMC_A27_OUT */
-			0x364 A_DELAY_PS(759) G_DELAY_PS(0)       /* CFG_GPMC_CS1_OEN */
-			0x368 A_DELAY_PS(72) G_DELAY_PS(0)        /* CFG_GPMC_CS1_OUT */
+			0x190 A_DELAY_PS(384) G_DELAY_PS(0)	/* CFG_GPMC_A19_OEN */
+			0x194 A_DELAY_PS(350) G_DELAY_PS(174)	/* CFG_GPMC_A19_OUT */
+			0x1a8 A_DELAY_PS(410) G_DELAY_PS(0)	/* CFG_GPMC_A20_OEN */
+			0x1ac A_DELAY_PS(335) G_DELAY_PS(0)	/* CFG_GPMC_A20_OUT */
+			0x1b4 A_DELAY_PS(468) G_DELAY_PS(0)	/* CFG_GPMC_A21_OEN */
+			0x1b8 A_DELAY_PS(339) G_DELAY_PS(0)	/* CFG_GPMC_A21_OUT */
+			0x1c0 A_DELAY_PS(676) G_DELAY_PS(0)	/* CFG_GPMC_A22_OEN */
+			0x1c4 A_DELAY_PS(219) G_DELAY_PS(0)	/* CFG_GPMC_A22_OUT */
+			0x1d0 A_DELAY_PS(1062) G_DELAY_PS(154)	/* CFG_GPMC_A23_OUT */
+			0x1d8 A_DELAY_PS(640) G_DELAY_PS(0)	/* CFG_GPMC_A24_OEN */
+			0x1dc A_DELAY_PS(150) G_DELAY_PS(0)	/* CFG_GPMC_A24_OUT */
+			0x1e4 A_DELAY_PS(356) G_DELAY_PS(0)	/* CFG_GPMC_A25_OEN */
+			0x1e8 A_DELAY_PS(150) G_DELAY_PS(0)	/* CFG_GPMC_A25_OUT */
+			0x1f0 A_DELAY_PS(579) G_DELAY_PS(0)	/* CFG_GPMC_A26_OEN */
+			0x1f4 A_DELAY_PS(200) G_DELAY_PS(0)	/* CFG_GPMC_A26_OUT */
+			0x1fc A_DELAY_PS(435) G_DELAY_PS(0)	/* CFG_GPMC_A27_OEN */
+			0x200 A_DELAY_PS(236) G_DELAY_PS(0)	/* CFG_GPMC_A27_OUT */
+			0x364 A_DELAY_PS(759) G_DELAY_PS(0)	/* CFG_GPMC_CS1_OEN */
+			0x368 A_DELAY_PS(372) G_DELAY_PS(0)	/* CFG_GPMC_CS1_OUT */
 	      >;
 	};
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm/configs/mvebu_v7_defconfig linux-libre-5.1.15-gnu/arch/arm/configs/mvebu_v7_defconfig
--- linux-libre-5.1.14-gnu/arch/arm/configs/mvebu_v7_defconfig	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm/configs/mvebu_v7_defconfig	2019-06-24 23:34:56.000000000 -0400
@@ -131,6 +131,7 @@ CONFIG_MV_XOR=y
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_MEMORY=y
 CONFIG_PWM=y
+CONFIG_PHY_MVEBU_A38X_COMPHY=y
 CONFIG_EXT4_FS=y
 CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm/mach-imx/cpuidle-imx6sx.c linux-libre-5.1.15-gnu/arch/arm/mach-imx/cpuidle-imx6sx.c
--- linux-libre-5.1.14-gnu/arch/arm/mach-imx/cpuidle-imx6sx.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm/mach-imx/cpuidle-imx6sx.c	2019-06-24 23:34:56.000000000 -0400
@@ -15,6 +15,7 @@
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static int imx6sx_idle_finish(unsigned long val)
 {
@@ -110,7 +111,7 @@ int __init imx6sx_cpuidle_init(void)
 	 * except for power up sw2iso which need to be
 	 * larger than LDO ramp up time.
 	 */
-	imx_gpc_set_arm_power_up_timing(0xf, 1);
+	imx_gpc_set_arm_power_up_timing(cpu_is_imx6sx() ? 0xf : 0x2, 1);
 	imx_gpc_set_arm_power_down_timing(1, 1);
 
 	return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm64/include/uapi/asm/ptrace.h linux-libre-5.1.15-gnu/arch/arm64/include/uapi/asm/ptrace.h
--- linux-libre-5.1.14-gnu/arch/arm64/include/uapi/asm/ptrace.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm64/include/uapi/asm/ptrace.h	2019-06-24 23:34:56.000000000 -0400
@@ -65,8 +65,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/prctl.h>
-
 /*
  * User structures for general purpose, floating point and debug registers.
  */
@@ -113,10 +111,10 @@ struct user_sve_header {
 
 /*
  * Common SVE_PT_* flags:
- * These must be kept in sync with prctl interface in <linux/ptrace.h>
+ * These must be kept in sync with prctl interface in <linux/prctl.h>
  */
-#define SVE_PT_VL_INHERIT		(PR_SVE_VL_INHERIT >> 16)
-#define SVE_PT_VL_ONEXEC		(PR_SVE_SET_VL_ONEXEC >> 16)
+#define SVE_PT_VL_INHERIT		((1 << 17) /* PR_SVE_VL_INHERIT */ >> 16)
+#define SVE_PT_VL_ONEXEC		((1 << 18) /* PR_SVE_SET_VL_ONEXEC */ >> 16)
 
 
 /*
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm64/kernel/ssbd.c linux-libre-5.1.15-gnu/arch/arm64/kernel/ssbd.c
--- linux-libre-5.1.14-gnu/arch/arm64/kernel/ssbd.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm64/kernel/ssbd.c	2019-06-24 23:34:56.000000000 -0400
@@ -5,6 +5,7 @@
 
 #include <linux/compat.h>
 #include <linux/errno.h>
+#include <linux/prctl.h>
 #include <linux/sched.h>
 #include <linux/sched/task_stack.h>
 #include <linux/thread_info.h>
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/arm64/Makefile linux-libre-5.1.15-gnu/arch/arm64/Makefile
--- linux-libre-5.1.14-gnu/arch/arm64/Makefile	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/arm64/Makefile	2019-06-24 23:34:56.000000000 -0400
@@ -51,6 +51,7 @@ endif
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)
 KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
+KBUILD_CFLAGS	+= -Wno-psabi
 KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
 
 KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/mips/include/asm/ginvt.h linux-libre-5.1.15-gnu/arch/mips/include/asm/ginvt.h
--- linux-libre-5.1.14-gnu/arch/mips/include/asm/ginvt.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/mips/include/asm/ginvt.h	2019-06-24 23:34:56.000000000 -0400
@@ -19,7 +19,7 @@ _ASM_MACRO_1R1I(ginvt, rs, type,
 # define _ASM_SET_GINV
 #endif
 
-static inline void ginvt(unsigned long addr, enum ginvt_type type)
+static __always_inline void ginvt(unsigned long addr, enum ginvt_type type)
 {
 	asm volatile(
 		".set	push\n"
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/mips/kernel/uprobes.c linux-libre-5.1.15-gnu/arch/mips/kernel/uprobes.c
--- linux-libre-5.1.14-gnu/arch/mips/kernel/uprobes.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/mips/kernel/uprobes.c	2019-06-24 23:34:56.000000000 -0400
@@ -112,9 +112,6 @@ int arch_uprobe_pre_xol(struct arch_upro
 	 */
 	aup->resume_epc = regs->cp0_epc + 4;
 	if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) {
-		unsigned long epc;
-
-		epc = regs->cp0_epc;
 		__compute_return_epc_for_insn(regs,
 			(union mips_instruction) aup->insn[0]);
 		aup->resume_epc = regs->cp0_epc;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/parisc/math-emu/cnv_float.h linux-libre-5.1.15-gnu/arch/parisc/math-emu/cnv_float.h
--- linux-libre-5.1.14-gnu/arch/parisc/math-emu/cnv_float.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/parisc/math-emu/cnv_float.h	2019-06-24 23:34:56.000000000 -0400
@@ -60,19 +60,19 @@
     ((exponent < (SGL_P - 1)) ?				\
      (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)
 
-#define Int_isinexact_to_sgl(int_value)	(int_value << 33 - SGL_EXP_LENGTH)
+#define Int_isinexact_to_sgl(int_value)	((int_value << 33 - SGL_EXP_LENGTH) != 0)
 
 #define Sgl_roundnearest_from_int(int_value,sgl_value)			\
     if (int_value & 1<<(SGL_EXP_LENGTH - 2))   /* round bit */		\
-    	if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value))	\
+	if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
 		Sall(sgl_value)++
 
 #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB)		\
-    ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
+    (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
 
 #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value)	\
     if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) 			\
-    	if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) ||		\
+	if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) ||	\
     	Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++
 
 #define Dint_isinexact_to_dbl(dint_value) 	\
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/powerpc/include/asm/ppc-opcode.h linux-libre-5.1.15-gnu/arch/powerpc/include/asm/ppc-opcode.h
--- linux-libre-5.1.14-gnu/arch/powerpc/include/asm/ppc-opcode.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/powerpc/include/asm/ppc-opcode.h	2019-06-24 23:34:56.000000000 -0400
@@ -342,6 +342,7 @@
 #define PPC_INST_MADDLD			0x10000033
 #define PPC_INST_DIVWU			0x7c000396
 #define PPC_INST_DIVD			0x7c0003d2
+#define PPC_INST_DIVDU			0x7c000392
 #define PPC_INST_RLWINM			0x54000000
 #define PPC_INST_RLWINM_DOT		0x54000001
 #define PPC_INST_RLWIMI			0x50000000
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/powerpc/mm/mmu_context_book3s64.c linux-libre-5.1.15-gnu/arch/powerpc/mm/mmu_context_book3s64.c
--- linux-libre-5.1.14-gnu/arch/powerpc/mm/mmu_context_book3s64.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/powerpc/mm/mmu_context_book3s64.c	2019-06-24 23:34:56.000000000 -0400
@@ -55,14 +55,48 @@ EXPORT_SYMBOL_GPL(hash__alloc_context_id
 
 void slb_setup_new_exec(void);
 
+static int realloc_context_ids(mm_context_t *ctx)
+{
+	int i, id;
+
+	/*
+	 * id 0 (aka. ctx->id) is special, we always allocate a new one, even if
+	 * there wasn't one allocated previously (which happens in the exec
+	 * case where ctx is newly allocated).
+	 *
+	 * We have to be a bit careful here. We must keep the existing ids in
+	 * the array, so that we can test if they're non-zero to decide if we
+	 * need to allocate a new one. However in case of error we must free the
+	 * ids we've allocated but *not* any of the existing ones (or risk a
+	 * UAF). That's why we decrement i at the start of the error handling
+	 * loop, to skip the id that we just tested but couldn't reallocate.
+	 */
+	for (i = 0; i < ARRAY_SIZE(ctx->extended_id); i++) {
+		if (i == 0 || ctx->extended_id[i]) {
+			id = hash__alloc_context_id();
+			if (id < 0)
+				goto error;
+
+			ctx->extended_id[i] = id;
+		}
+	}
+
+	/* The caller expects us to return id */
+	return ctx->id;
+
+error:
+	for (i--; i >= 0; i--) {
+		if (ctx->extended_id[i])
+			ida_free(&mmu_context_ida, ctx->extended_id[i]);
+	}
+
+	return id;
+}
+
 static int hash__init_new_context(struct mm_struct *mm)
 {
 	int index;
 
-	index = hash__alloc_context_id();
-	if (index < 0)
-		return index;
-
 	/*
 	 * The old code would re-promote on fork, we don't do that when using
 	 * slices as it could cause problem promoting slices that have been
@@ -80,6 +114,10 @@ static int hash__init_new_context(struct
 	if (mm->context.id == 0)
 		slice_init_new_context_exec(mm);
 
+	index = realloc_context_ids(&mm->context);
+	if (index < 0)
+		return index;
+
 	subpage_prot_init_new_context(mm);
 
 	pkey_mm_init(mm);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/powerpc/net/bpf_jit_comp64.c linux-libre-5.1.15-gnu/arch/powerpc/net/bpf_jit_comp64.c
--- linux-libre-5.1.14-gnu/arch/powerpc/net/bpf_jit_comp64.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/powerpc/net/bpf_jit_comp64.c	2019-06-24 23:34:56.000000000 -0400
@@ -399,12 +399,12 @@ static int bpf_jit_build_body(struct bpf
 		case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */
 		case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */
 			if (BPF_OP(code) == BPF_MOD) {
-				PPC_DIVD(b2p[TMP_REG_1], dst_reg, src_reg);
+				PPC_DIVDU(b2p[TMP_REG_1], dst_reg, src_reg);
 				PPC_MULD(b2p[TMP_REG_1], src_reg,
 						b2p[TMP_REG_1]);
 				PPC_SUB(dst_reg, dst_reg, b2p[TMP_REG_1]);
 			} else
-				PPC_DIVD(dst_reg, dst_reg, src_reg);
+				PPC_DIVDU(dst_reg, dst_reg, src_reg);
 			break;
 		case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */
 		case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */
@@ -432,7 +432,7 @@ static int bpf_jit_build_body(struct bpf
 				break;
 			case BPF_ALU64:
 				if (BPF_OP(code) == BPF_MOD) {
-					PPC_DIVD(b2p[TMP_REG_2], dst_reg,
+					PPC_DIVDU(b2p[TMP_REG_2], dst_reg,
 							b2p[TMP_REG_1]);
 					PPC_MULD(b2p[TMP_REG_1],
 							b2p[TMP_REG_1],
@@ -440,7 +440,7 @@ static int bpf_jit_build_body(struct bpf
 					PPC_SUB(dst_reg, dst_reg,
 							b2p[TMP_REG_1]);
 				} else
-					PPC_DIVD(dst_reg, dst_reg,
+					PPC_DIVDU(dst_reg, dst_reg,
 							b2p[TMP_REG_1]);
 				break;
 			}
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/powerpc/net/bpf_jit.h linux-libre-5.1.15-gnu/arch/powerpc/net/bpf_jit.h
--- linux-libre-5.1.14-gnu/arch/powerpc/net/bpf_jit.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/powerpc/net/bpf_jit.h	2019-06-24 23:34:56.000000000 -0400
@@ -116,7 +116,7 @@
 				     ___PPC_RA(a) | IMM_L(i))
 #define PPC_DIVWU(d, a, b)	EMIT(PPC_INST_DIVWU | ___PPC_RT(d) |	      \
 				     ___PPC_RA(a) | ___PPC_RB(b))
-#define PPC_DIVD(d, a, b)	EMIT(PPC_INST_DIVD | ___PPC_RT(d) |	      \
+#define PPC_DIVDU(d, a, b)	EMIT(PPC_INST_DIVDU | ___PPC_RT(d) |	      \
 				     ___PPC_RA(a) | ___PPC_RB(b))
 #define PPC_AND(d, a, b)	EMIT(PPC_INST_AND | ___PPC_RA(d) |	      \
 				     ___PPC_RS(a) | ___PPC_RB(b))
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/riscv/mm/fault.c linux-libre-5.1.15-gnu/arch/riscv/mm/fault.c
--- linux-libre-5.1.14-gnu/arch/riscv/mm/fault.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/riscv/mm/fault.c	2019-06-24 23:34:56.000000000 -0400
@@ -29,6 +29,7 @@
 
 #include <asm/pgalloc.h>
 #include <asm/ptrace.h>
+#include <asm/tlbflush.h>
 
 /*
  * This routine handles page faults.  It determines the address and the
@@ -281,6 +282,18 @@ vmalloc_fault:
 		pte_k = pte_offset_kernel(pmd_k, addr);
 		if (!pte_present(*pte_k))
 			goto no_context;
+
+		/*
+		 * The kernel assumes that TLBs don't cache invalid
+		 * entries, but in RISC-V, SFENCE.VMA specifies an
+		 * ordering constraint, not a cache flush; it is
+		 * necessary even after writing invalid entries.
+		 * Relying on flush_tlb_fix_spurious_fault would
+		 * suffice, but the extra traps reduce
+		 * performance. So, eagerly SFENCE.VMA.
+		 */
+		local_flush_tlb_page(addr);
+
 		return;
 	}
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/sparc/kernel/mdesc.c linux-libre-5.1.15-gnu/arch/sparc/kernel/mdesc.c
--- linux-libre-5.1.14-gnu/arch/sparc/kernel/mdesc.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/sparc/kernel/mdesc.c	2019-06-24 23:34:56.000000000 -0400
@@ -356,6 +356,8 @@ static int get_vdev_port_node_info(struc
 
 	node_info->vdev_port.id = *idp;
 	node_info->vdev_port.name = kstrdup_const(name, GFP_KERNEL);
+	if (!node_info->vdev_port.name)
+		return -1;
 	node_info->vdev_port.parent_cfg_hdl = *parent_cfg_hdlp;
 
 	return 0;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/sparc/kernel/perf_event.c linux-libre-5.1.15-gnu/arch/sparc/kernel/perf_event.c
--- linux-libre-5.1.14-gnu/arch/sparc/kernel/perf_event.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/sparc/kernel/perf_event.c	2019-06-24 23:34:56.000000000 -0400
@@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(s
 	s64 period = hwc->sample_period;
 	int ret = 0;
 
+	/* The period may have been changed by PERF_EVENT_IOC_PERIOD */
+	if (unlikely(period != hwc->last_period))
+		left = period - (hwc->last_period - left);
+
 	if (unlikely(left <= -period)) {
 		left = period;
 		local64_set(&hwc->period_left, left);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/x86/entry/vdso/vclock_gettime.c linux-libre-5.1.15-gnu/arch/x86/entry/vdso/vclock_gettime.c
--- linux-libre-5.1.14-gnu/arch/x86/entry/vdso/vclock_gettime.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/x86/entry/vdso/vclock_gettime.c	2019-06-24 23:34:56.000000000 -0400
@@ -128,13 +128,24 @@ notrace static inline u64 vgetcyc(int mo
 {
 	if (mode == VCLOCK_TSC)
 		return (u64)rdtsc_ordered();
+
+	/*
+	 * For any memory-mapped vclock type, we need to make sure that gcc
+	 * doesn't cleverly hoist a load before the mode check.  Otherwise we
+	 * might end up touching the memory-mapped page even if the vclock in
+	 * question isn't enabled, which will segfault.  Hence the barriers.
+	 */
 #ifdef CONFIG_PARAVIRT_CLOCK
-	else if (mode == VCLOCK_PVCLOCK)
+	if (mode == VCLOCK_PVCLOCK) {
+		barrier();
 		return vread_pvclock();
+	}
 #endif
 #ifdef CONFIG_HYPERV_TSCPAGE
-	else if (mode == VCLOCK_HVCLOCK)
+	if (mode == VCLOCK_HVCLOCK) {
+		barrier();
 		return vread_hvclock();
+	}
 #endif
 	return U64_MAX;
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/x86/kernel/cpu/resctrl/rdtgroup.c linux-libre-5.1.15-gnu/arch/x86/kernel/cpu/resctrl/rdtgroup.c
--- linux-libre-5.1.14-gnu/arch/x86/kernel/cpu/resctrl/rdtgroup.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/x86/kernel/cpu/resctrl/rdtgroup.c	2019-06-24 23:34:56.000000000 -0400
@@ -2556,7 +2556,7 @@ static int rdtgroup_init_alloc(struct rd
 				if (closid_allocated(i) && i != closid) {
 					mode = rdtgroup_mode_by_closid(i);
 					if (mode == RDT_MODE_PSEUDO_LOCKSETUP)
-						break;
+						continue;
 					/*
 					 * If CDP is active include peer
 					 * domain's usage to ensure there
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/x86/kvm/mmu.c linux-libre-5.1.15-gnu/arch/x86/kvm/mmu.c
--- linux-libre-5.1.14-gnu/arch/x86/kvm/mmu.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/x86/kvm/mmu.c	2019-06-24 23:34:56.000000000 -0400
@@ -5591,14 +5591,18 @@ static int alloc_mmu_pages(struct kvm_vc
 	struct page *page;
 	int i;
 
-	if (tdp_enabled)
-		return 0;
-
 	/*
-	 * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64.
-	 * Therefore we need to allocate shadow page tables in the first
-	 * 4GB of memory, which happens to fit the DMA32 zone.
+	 * When using PAE paging, the four PDPTEs are treated as 'root' pages,
+	 * while the PDP table is a per-vCPU construct that's allocated at MMU
+	 * creation.  When emulating 32-bit mode, cr3 is only 32 bits even on
+	 * x86_64.  Therefore we need to allocate the PDP table in the first
+	 * 4GB of memory, which happens to fit the DMA32 zone.  Except for
+	 * SVM's 32-bit NPT support, TDP paging doesn't use PAE paging and can
+	 * skip allocating the PDP table.
 	 */
+	if (tdp_enabled && kvm_x86_ops->get_tdp_level(vcpu) > PT32E_ROOT_LEVEL)
+		return 0;
+
 	page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_DMA32);
 	if (!page)
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/arch/xtensa/kernel/setup.c linux-libre-5.1.15-gnu/arch/xtensa/kernel/setup.c
--- linux-libre-5.1.14-gnu/arch/xtensa/kernel/setup.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/arch/xtensa/kernel/setup.c	2019-06-24 23:34:56.000000000 -0400
@@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_s
 extern char _SecondaryResetVector_text_end;
 #endif
 
-static inline int mem_reserve(unsigned long start, unsigned long end)
+static inline int __init_memblock mem_reserve(unsigned long start,
+					      unsigned long end)
 {
 	return memblock_reserve(start, end - start);
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/crypto/hmac.c linux-libre-5.1.15-gnu/crypto/hmac.c
--- linux-libre-5.1.14-gnu/crypto/hmac.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/crypto/hmac.c	2019-06-24 23:34:56.000000000 -0400
@@ -168,8 +168,10 @@ static int hmac_init_tfm(struct crypto_t
 
 	parent->descsize = sizeof(struct shash_desc) +
 			   crypto_shash_descsize(hash);
-	if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE))
+	if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) {
+		crypto_free_shash(hash);
 		return -EINVAL;
+	}
 
 	ctx->hash = hash;
 	return 0;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/android/binder.c linux-libre-5.1.15-gnu/drivers/android/binder.c
--- linux-libre-5.1.14-gnu/drivers/android/binder.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/android/binder.c	2019-06-24 23:34:56.000000000 -0400
@@ -1950,8 +1950,18 @@ static void binder_free_txn_fixups(struc
 
 static void binder_free_transaction(struct binder_transaction *t)
 {
-	if (t->buffer)
-		t->buffer->transaction = NULL;
+	struct binder_proc *target_proc = t->to_proc;
+
+	if (target_proc) {
+		binder_inner_proc_lock(target_proc);
+		if (t->buffer)
+			t->buffer->transaction = NULL;
+		binder_inner_proc_unlock(target_proc);
+	}
+	/*
+	 * If the transaction has no target_proc, then
+	 * t->buffer->transaction has already been cleared.
+	 */
 	binder_free_txn_fixups(t);
 	kfree(t);
 	binder_stats_deleted(BINDER_STAT_TRANSACTION);
@@ -3550,10 +3560,12 @@ err_invalid_target_handle:
 static void
 binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer)
 {
+	binder_inner_proc_lock(proc);
 	if (buffer->transaction) {
 		buffer->transaction->buffer = NULL;
 		buffer->transaction = NULL;
 	}
+	binder_inner_proc_unlock(proc);
 	if (buffer->async_transaction && buffer->target_node) {
 		struct binder_node *buf_node;
 		struct binder_work *w;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/dma/dma-jz4780.c linux-libre-5.1.15-gnu/drivers/dma/dma-jz4780.c
--- linux-libre-5.1.14-gnu/drivers/dma/dma-jz4780.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/dma/dma-jz4780.c	2019-06-24 23:34:56.000000000 -0400
@@ -666,10 +666,11 @@ static enum dma_status jz4780_dma_tx_sta
 	return status;
 }
 
-static void jz4780_dma_chan_irq(struct jz4780_dma_dev *jzdma,
-	struct jz4780_dma_chan *jzchan)
+static bool jz4780_dma_chan_irq(struct jz4780_dma_dev *jzdma,
+				struct jz4780_dma_chan *jzchan)
 {
 	uint32_t dcs;
+	bool ack = true;
 
 	spin_lock(&jzchan->vchan.lock);
 
@@ -692,12 +693,20 @@ static void jz4780_dma_chan_irq(struct j
 		if ((dcs & (JZ_DMA_DCS_AR | JZ_DMA_DCS_HLT)) == 0) {
 			if (jzchan->desc->type == DMA_CYCLIC) {
 				vchan_cyclic_callback(&jzchan->desc->vdesc);
-			} else {
+
+				jz4780_dma_begin(jzchan);
+			} else if (dcs & JZ_DMA_DCS_TT) {
 				vchan_cookie_complete(&jzchan->desc->vdesc);
 				jzchan->desc = NULL;
-			}
 
-			jz4780_dma_begin(jzchan);
+				jz4780_dma_begin(jzchan);
+			} else {
+				/* False positive - continue the transfer */
+				ack = false;
+				jz4780_dma_chn_writel(jzdma, jzchan->id,
+						      JZ_DMA_REG_DCS,
+						      JZ_DMA_DCS_CTE);
+			}
 		}
 	} else {
 		dev_err(&jzchan->vchan.chan.dev->device,
@@ -705,21 +714,22 @@ static void jz4780_dma_chan_irq(struct j
 	}
 
 	spin_unlock(&jzchan->vchan.lock);
+
+	return ack;
 }
 
 static irqreturn_t jz4780_dma_irq_handler(int irq, void *data)
 {
 	struct jz4780_dma_dev *jzdma = data;
+	unsigned int nb_channels = jzdma->soc_data->nb_channels;
 	uint32_t pending, dmac;
 	int i;
 
 	pending = jz4780_dma_ctrl_readl(jzdma, JZ_DMA_REG_DIRQP);
 
-	for (i = 0; i < jzdma->soc_data->nb_channels; i++) {
-		if (!(pending & (1<<i)))
-			continue;
-
-		jz4780_dma_chan_irq(jzdma, &jzdma->chan[i]);
+	for_each_set_bit(i, (unsigned long *)&pending, nb_channels) {
+		if (jz4780_dma_chan_irq(jzdma, &jzdma->chan[i]))
+			pending &= ~BIT(i);
 	}
 
 	/* Clear halt and address error status of all channels. */
@@ -728,7 +738,7 @@ static irqreturn_t jz4780_dma_irq_handle
 	jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DMAC, dmac);
 
 	/* Clear interrupt pending status. */
-	jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DIRQP, 0);
+	jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DIRQP, pending);
 
 	return IRQ_HANDLED;
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c linux-libre-5.1.15-gnu/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
--- linux-libre-5.1.14-gnu/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c	2019-06-24 23:34:56.000000000 -0400
@@ -512,7 +512,8 @@ dma_chan_prep_dma_memcpy(struct dma_chan
 	return vchan_tx_prep(&chan->vc, &first->vd, flags);
 
 err_desc_get:
-	axi_desc_put(first);
+	if (first)
+		axi_desc_put(first);
 	return NULL;
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/dma/mediatek/mtk-cqdma.c linux-libre-5.1.15-gnu/drivers/dma/mediatek/mtk-cqdma.c
--- linux-libre-5.1.14-gnu/drivers/dma/mediatek/mtk-cqdma.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/dma/mediatek/mtk-cqdma.c	2019-06-24 23:34:56.000000000 -0400
@@ -225,7 +225,7 @@ static int mtk_cqdma_hard_reset(struct m
 	mtk_dma_set(pc, MTK_CQDMA_RESET, MTK_CQDMA_HARD_RST_BIT);
 	mtk_dma_clr(pc, MTK_CQDMA_RESET, MTK_CQDMA_HARD_RST_BIT);
 
-	return mtk_cqdma_poll_engine_done(pc, false);
+	return mtk_cqdma_poll_engine_done(pc, true);
 }
 
 static void mtk_cqdma_start(struct mtk_cqdma_pchan *pc,
@@ -671,7 +671,7 @@ static void mtk_cqdma_free_chan_resource
 		mtk_dma_set(cvc->pc, MTK_CQDMA_FLUSH, MTK_CQDMA_FLUSH_BIT);
 
 		/* wait for the completion of flush operation */
-		if (mtk_cqdma_poll_engine_done(cvc->pc, false) < 0)
+		if (mtk_cqdma_poll_engine_done(cvc->pc, true) < 0)
 			dev_err(cqdma2dev(to_cqdma_dev(c)), "cqdma flush timeout\n");
 
 		/* clear the flush bit and interrupt flag */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/dma/sprd-dma.c linux-libre-5.1.15-gnu/drivers/dma/sprd-dma.c
--- linux-libre-5.1.14-gnu/drivers/dma/sprd-dma.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/dma/sprd-dma.c	2019-06-24 23:34:56.000000000 -0400
@@ -510,7 +510,9 @@ static void sprd_dma_start(struct sprd_d
 	sprd_dma_set_uid(schan);
 	sprd_dma_enable_chn(schan);
 
-	if (schan->dev_id == SPRD_DMA_SOFTWARE_UID)
+	if (schan->dev_id == SPRD_DMA_SOFTWARE_UID &&
+	    schan->chn_mode != SPRD_DMA_DST_CHN0 &&
+	    schan->chn_mode != SPRD_DMA_DST_CHN1)
 		sprd_dma_soft_request(schan);
 }
 
@@ -552,12 +554,17 @@ static irqreturn_t dma_irq_handle(int ir
 		schan = &sdev->channels[i];
 
 		spin_lock(&schan->vc.lock);
+
+		sdesc = schan->cur_desc;
+		if (!sdesc) {
+			spin_unlock(&schan->vc.lock);
+			return IRQ_HANDLED;
+		}
+
 		int_type = sprd_dma_get_int_type(schan);
 		req_type = sprd_dma_get_req_type(schan);
 		sprd_dma_clear_int(schan);
 
-		sdesc = schan->cur_desc;
-
 		/* cyclic mode schedule callback */
 		cyclic = schan->linklist.phy_addr ? true : false;
 		if (cyclic == true) {
@@ -625,7 +632,7 @@ static enum dma_status sprd_dma_tx_statu
 		else
 			pos = 0;
 	} else if (schan->cur_desc && schan->cur_desc->vd.tx.cookie == cookie) {
-		struct sprd_dma_desc *sdesc = to_sprd_dma_desc(vd);
+		struct sprd_dma_desc *sdesc = schan->cur_desc;
 
 		if (sdesc->dir == DMA_DEV_TO_MEM)
 			pos = sprd_dma_get_dst_addr(schan);
@@ -771,7 +778,7 @@ static int sprd_dma_fill_desc(struct dma
 	temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK;
 	hw->frg_len = temp;
 
-	hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK;
+	hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK;
 	hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK;
 
 	temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET;
@@ -904,6 +911,12 @@ sprd_dma_prep_slave_sg(struct dma_chan *
 		schan->linklist.virt_addr = 0;
 	}
 
+	/* Set channel mode and trigger mode for 2-stage transfer */
+	schan->chn_mode =
+		(flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK;
+	schan->trg_mode =
+		(flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK;
+
 	sdesc = kzalloc(sizeof(*sdesc), GFP_NOWAIT);
 	if (!sdesc)
 		return NULL;
@@ -937,12 +950,6 @@ sprd_dma_prep_slave_sg(struct dma_chan *
 		}
 	}
 
-	/* Set channel mode and trigger mode for 2-stage transfer */
-	schan->chn_mode =
-		(flags >> SPRD_DMA_CHN_MODE_SHIFT) & SPRD_DMA_CHN_MODE_MASK;
-	schan->trg_mode =
-		(flags >> SPRD_DMA_TRG_MODE_SHIFT) & SPRD_DMA_TRG_MODE_MASK;
-
 	ret = sprd_dma_fill_desc(chan, &sdesc->chn_hw, 0, 0, src, dst, len,
 				 dir, flags, slave_cfg);
 	if (ret) {
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/dma-buf/udmabuf.c linux-libre-5.1.15-gnu/drivers/dma-buf/udmabuf.c
--- linux-libre-5.1.14-gnu/drivers/dma-buf/udmabuf.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/dma-buf/udmabuf.c	2019-06-24 23:34:56.000000000 -0400
@@ -77,6 +77,7 @@ static void unmap_udmabuf(struct dma_buf
 			  struct sg_table *sg,
 			  enum dma_data_direction direction)
 {
+	dma_unmap_sg(at->dev, sg->sgl, sg->nents, direction);
 	sg_free_table(sg);
 	kfree(sg);
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/fpga/dfl-afu-dma-region.c linux-libre-5.1.15-gnu/drivers/fpga/dfl-afu-dma-region.c
--- linux-libre-5.1.14-gnu/drivers/fpga/dfl-afu-dma-region.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/fpga/dfl-afu-dma-region.c	2019-06-24 23:34:56.000000000 -0400
@@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_featur
 				    region->pages[0], 0,
 				    region->length,
 				    DMA_BIDIRECTIONAL);
-	if (dma_mapping_error(&pdata->dev->dev, region->iova)) {
+	if (dma_mapping_error(dfl_fpga_pdata_to_parent(pdata), region->iova)) {
 		dev_err(&pdata->dev->dev, "failed to map for dma\n");
 		ret = -EFAULT;
 		goto unpin_pages;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/fpga/dfl.c linux-libre-5.1.15-gnu/drivers/fpga/dfl.c
--- linux-libre-5.1.14-gnu/drivers/fpga/dfl.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/fpga/dfl.c	2019-06-24 23:34:56.000000000 -0400
@@ -40,6 +40,13 @@ enum dfl_fpga_devt_type {
 	DFL_FPGA_DEVT_MAX,
 };
 
+static struct lock_class_key dfl_pdata_keys[DFL_ID_MAX];
+
+static const char *dfl_pdata_key_strings[DFL_ID_MAX] = {
+	"dfl-fme-pdata",
+	"dfl-port-pdata",
+};
+
 /**
  * dfl_dev_info - dfl feature device information.
  * @name: name string of the feature platform device.
@@ -443,11 +450,16 @@ static int build_info_commit_dev(struct
 	struct platform_device *fdev = binfo->feature_dev;
 	struct dfl_feature_platform_data *pdata;
 	struct dfl_feature_info *finfo, *p;
+	enum dfl_id_type type;
 	int ret, index = 0;
 
 	if (!fdev)
 		return 0;
 
+	type = feature_dev_id_type(fdev);
+	if (WARN_ON_ONCE(type >= DFL_ID_MAX))
+		return -EINVAL;
+
 	/*
 	 * we do not need to care for the memory which is associated with
 	 * the platform device. After calling platform_device_unregister(),
@@ -463,6 +475,8 @@ static int build_info_commit_dev(struct
 	pdata->num = binfo->feature_num;
 	pdata->dfl_cdev = binfo->cdev;
 	mutex_init(&pdata->lock);
+	lockdep_set_class_and_name(&pdata->lock, &dfl_pdata_keys[type],
+				   dfl_pdata_key_strings[type]);
 
 	/*
 	 * the count should be initialized to 0 to make sure
@@ -497,7 +511,7 @@ static int build_info_commit_dev(struct
 
 	ret = platform_device_add(binfo->feature_dev);
 	if (!ret) {
-		if (feature_dev_id_type(binfo->feature_dev) == PORT_ID)
+		if (type == PORT_ID)
 			dfl_fpga_cdev_add_port_dev(binfo->cdev,
 						   binfo->feature_dev);
 		else
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/fpga/stratix10-soc.c linux-libre-5.1.15-gnu/drivers/fpga/stratix10-soc.c
--- linux-libre-5.1.14-gnu/drivers/fpga/stratix10-soc.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/fpga/stratix10-soc.c	2019-06-24 23:34:56.000000000 -0400
@@ -507,12 +507,16 @@ static int __init s10_init(void)
 	if (!fw_np)
 		return -ENODEV;
 
+	of_node_get(fw_np);
 	np = of_find_matching_node(fw_np, s10_of_match);
-	if (!np)
+	if (!np) {
+		of_node_put(fw_np);
 		return -ENODEV;
+	}
 
 	of_node_put(np);
 	ret = of_platform_populate(fw_np, s10_of_match, NULL, NULL);
+	of_node_put(fw_np);
 	if (ret)
 		return ret;
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/gpu/drm/arm/hdlcd_crtc.c linux-libre-5.1.15-gnu/drivers/gpu/drm/arm/hdlcd_crtc.c
--- linux-libre-5.1.14-gnu/drivers/gpu/drm/arm/hdlcd_crtc.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/gpu/drm/arm/hdlcd_crtc.c	2019-06-24 23:34:56.000000000 -0400
@@ -186,20 +186,20 @@ static void hdlcd_crtc_atomic_disable(st
 	clk_disable_unprepare(hdlcd->clk);
 }
 
-static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc,
-				   struct drm_crtc_state *state)
+static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc,
+		const struct drm_display_mode *mode)
 {
 	struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
-	struct drm_display_mode *mode = &state->adjusted_mode;
 	long rate, clk_rate = mode->clock * 1000;
 
 	rate = clk_round_rate(hdlcd->clk, clk_rate);
-	if (rate != clk_rate) {
+	/* 0.1% seems a close enough tolerance for the TDA19988 on Juno */
+	if (abs(rate - clk_rate) * 1000 > clk_rate) {
 		/* clock required by mode not supported by hardware */
-		return -EINVAL;
+		return MODE_NOCLOCK;
 	}
 
-	return 0;
+	return MODE_OK;
 }
 
 static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc,
@@ -220,7 +220,7 @@ static void hdlcd_crtc_atomic_begin(stru
 }
 
 static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {
-	.atomic_check	= hdlcd_crtc_atomic_check,
+	.mode_valid	= hdlcd_crtc_mode_valid,
 	.atomic_begin	= hdlcd_crtc_atomic_begin,
 	.atomic_enable	= hdlcd_crtc_atomic_enable,
 	.atomic_disable	= hdlcd_crtc_atomic_disable,
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/gpu/drm/arm/malidp_drv.c linux-libre-5.1.15-gnu/drivers/gpu/drm/arm/malidp_drv.c
--- linux-libre-5.1.14-gnu/drivers/gpu/drm/arm/malidp_drv.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/gpu/drm/arm/malidp_drv.c	2019-06-24 23:34:56.000000000 -0400
@@ -192,6 +192,7 @@ static void malidp_atomic_commit_hw_done
 {
 	struct drm_device *drm = state->dev;
 	struct malidp_drm *malidp = drm->dev_private;
+	int loop = 5;
 
 	malidp->event = malidp->crtc.state->event;
 	malidp->crtc.state->event = NULL;
@@ -206,8 +207,18 @@ static void malidp_atomic_commit_hw_done
 			drm_crtc_vblank_get(&malidp->crtc);
 
 		/* only set config_valid if the CRTC is enabled */
-		if (malidp_set_and_wait_config_valid(drm) < 0)
+		if (malidp_set_and_wait_config_valid(drm) < 0) {
+			/*
+			 * make a loop around the second CVAL setting and
+			 * try 5 times before giving up.
+			 */
+			while (loop--) {
+				if (!malidp_set_and_wait_config_valid(drm))
+					break;
+			}
 			DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n");
+		}
+
 	} else if (malidp->event) {
 		/* CRTC inactive means vblank IRQ is disabled, send event directly */
 		spin_lock_irq(&drm->event_lock);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/gpu/drm/i915/intel_display.c linux-libre-5.1.15-gnu/drivers/gpu/drm/i915/intel_display.c
--- linux-libre-5.1.14-gnu/drivers/gpu/drm/i915/intel_display.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/gpu/drm/i915/intel_display.c	2019-06-24 23:34:56.000000000 -0400
@@ -11820,9 +11820,6 @@ intel_compare_link_m_n(const struct inte
 			      m2_n2->gmch_m, m2_n2->gmch_n, !adjust) &&
 	    intel_compare_m_n(m_n->link_m, m_n->link_n,
 			      m2_n2->link_m, m2_n2->link_n, !adjust)) {
-		if (adjust)
-			*m2_n2 = *m_n;
-
 		return true;
 	}
 
@@ -12855,6 +12852,33 @@ static int calc_watermark_data(struct in
 	return 0;
 }
 
+static void intel_crtc_check_fastset(struct intel_crtc_state *old_crtc_state,
+				     struct intel_crtc_state *new_crtc_state)
+{
+	struct drm_i915_private *dev_priv =
+		to_i915(new_crtc_state->base.crtc->dev);
+
+	if (!intel_pipe_config_compare(dev_priv, old_crtc_state,
+				       new_crtc_state, true))
+		return;
+
+	new_crtc_state->base.mode_changed = false;
+	new_crtc_state->update_pipe = true;
+
+	/*
+	 * If we're not doing the full modeset we want to
+	 * keep the current M/N values as they may be
+	 * sufficiently different to the computed values
+	 * to cause problems.
+	 *
+	 * FIXME: should really copy more fuzzy state here
+	 */
+	new_crtc_state->fdi_m_n = old_crtc_state->fdi_m_n;
+	new_crtc_state->dp_m_n = old_crtc_state->dp_m_n;
+	new_crtc_state->dp_m2_n2 = old_crtc_state->dp_m2_n2;
+	new_crtc_state->has_drrs = old_crtc_state->has_drrs;
+}
+
 /**
  * intel_atomic_check - validate state object
  * @dev: drm device
@@ -12903,12 +12927,8 @@ static int intel_atomic_check(struct drm
 			return ret;
 		}
 
-		if (intel_pipe_config_compare(dev_priv,
-					to_intel_crtc_state(old_crtc_state),
-					pipe_config, true)) {
-			crtc_state->mode_changed = false;
-			pipe_config->update_pipe = true;
-		}
+		intel_crtc_check_fastset(to_intel_crtc_state(old_crtc_state),
+					 pipe_config);
 
 		if (needs_modeset(crtc_state))
 			any_ms = true;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c linux-libre-5.1.15-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
--- linux-libre-5.1.14-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c	2019-06-24 23:34:56.000000000 -0400
@@ -136,6 +136,114 @@ static int vmw_close_channel(struct rpc_
 	return 0;
 }
 
+/**
+ * vmw_port_hb_out - Send the message payload either through the
+ * high-bandwidth port if available, or through the backdoor otherwise.
+ * @channel: The rpc channel.
+ * @msg: NULL-terminated message.
+ * @hb: Whether the high-bandwidth port is available.
+ *
+ * Return: The port status.
+ */
+static unsigned long vmw_port_hb_out(struct rpc_channel *channel,
+				     const char *msg, bool hb)
+{
+	unsigned long si, di, eax, ebx, ecx, edx;
+	unsigned long msg_len = strlen(msg);
+
+	if (hb) {
+		unsigned long bp = channel->cookie_high;
+
+		si = (uintptr_t) msg;
+		di = channel->cookie_low;
+
+		VMW_PORT_HB_OUT(
+			(MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
+			msg_len, si, di,
+			VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
+			VMW_HYPERVISOR_MAGIC, bp,
+			eax, ebx, ecx, edx, si, di);
+
+		return ebx;
+	}
+
+	/* HB port not available. Send the message 4 bytes at a time. */
+	ecx = MESSAGE_STATUS_SUCCESS << 16;
+	while (msg_len && (HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS)) {
+		unsigned int bytes = min_t(size_t, msg_len, 4);
+		unsigned long word = 0;
+
+		memcpy(&word, msg, bytes);
+		msg_len -= bytes;
+		msg += bytes;
+		si = channel->cookie_high;
+		di = channel->cookie_low;
+
+		VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_SENDPAYLOAD << 16),
+			 word, si, di,
+			 VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
+			 VMW_HYPERVISOR_MAGIC,
+			 eax, ebx, ecx, edx, si, di);
+	}
+
+	return ecx;
+}
+
+/**
+ * vmw_port_hb_in - Receive the message payload either through the
+ * high-bandwidth port if available, or through the backdoor otherwise.
+ * @channel: The rpc channel.
+ * @reply: Pointer to buffer holding reply.
+ * @reply_len: Length of the reply.
+ * @hb: Whether the high-bandwidth port is available.
+ *
+ * Return: The port status.
+ */
+static unsigned long vmw_port_hb_in(struct rpc_channel *channel, char *reply,
+				    unsigned long reply_len, bool hb)
+{
+	unsigned long si, di, eax, ebx, ecx, edx;
+
+	if (hb) {
+		unsigned long bp = channel->cookie_low;
+
+		si = channel->cookie_high;
+		di = (uintptr_t) reply;
+
+		VMW_PORT_HB_IN(
+			(MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
+			reply_len, si, di,
+			VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
+			VMW_HYPERVISOR_MAGIC, bp,
+			eax, ebx, ecx, edx, si, di);
+
+		return ebx;
+	}
+
+	/* HB port not available. Retrieve the message 4 bytes at a time. */
+	ecx = MESSAGE_STATUS_SUCCESS << 16;
+	while (reply_len) {
+		unsigned int bytes = min_t(unsigned long, reply_len, 4);
+
+		si = channel->cookie_high;
+		di = channel->cookie_low;
+
+		VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_RECVPAYLOAD << 16),
+			 MESSAGE_STATUS_SUCCESS, si, di,
+			 VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
+			 VMW_HYPERVISOR_MAGIC,
+			 eax, ebx, ecx, edx, si, di);
+
+		if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0)
+			break;
+
+		memcpy(reply, &ebx, bytes);
+		reply_len -= bytes;
+		reply += bytes;
+	}
+
+	return ecx;
+}
 
 
 /**
@@ -148,11 +256,10 @@ static int vmw_close_channel(struct rpc_
  */
 static int vmw_send_msg(struct rpc_channel *channel, const char *msg)
 {
-	unsigned long eax, ebx, ecx, edx, si, di, bp;
+	unsigned long eax, ebx, ecx, edx, si, di;
 	size_t msg_len = strlen(msg);
 	int retries = 0;
 
-
 	while (retries < RETRIES) {
 		retries++;
 
@@ -166,23 +273,14 @@ static int vmw_send_msg(struct rpc_chann
 			VMW_HYPERVISOR_MAGIC,
 			eax, ebx, ecx, edx, si, di);
 
-		if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0 ||
-		    (HIGH_WORD(ecx) & MESSAGE_STATUS_HB) == 0) {
-			/* Expected success + high-bandwidth. Give up. */
+		if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
+			/* Expected success. Give up. */
 			return -EINVAL;
 		}
 
 		/* Send msg */
-		si  = (uintptr_t) msg;
-		di  = channel->cookie_low;
-		bp  = channel->cookie_high;
-
-		VMW_PORT_HB_OUT(
-			(MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
-			msg_len, si, di,
-			VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
-			VMW_HYPERVISOR_MAGIC, bp,
-			eax, ebx, ecx, edx, si, di);
+		ebx = vmw_port_hb_out(channel, msg,
+				      !!(HIGH_WORD(ecx) & MESSAGE_STATUS_HB));
 
 		if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) != 0) {
 			return 0;
@@ -211,7 +309,7 @@ STACK_FRAME_NON_STANDARD(vmw_send_msg);
 static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
 			size_t *msg_len)
 {
-	unsigned long eax, ebx, ecx, edx, si, di, bp;
+	unsigned long eax, ebx, ecx, edx, si, di;
 	char *reply;
 	size_t reply_len;
 	int retries = 0;
@@ -233,8 +331,7 @@ static int vmw_recv_msg(struct rpc_chann
 			VMW_HYPERVISOR_MAGIC,
 			eax, ebx, ecx, edx, si, di);
 
-		if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0 ||
-		    (HIGH_WORD(ecx) & MESSAGE_STATUS_HB) == 0) {
+		if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
 			DRM_ERROR("Failed to get reply size for host message.\n");
 			return -EINVAL;
 		}
@@ -252,17 +349,8 @@ static int vmw_recv_msg(struct rpc_chann
 
 
 		/* Receive buffer */
-		si  = channel->cookie_high;
-		di  = (uintptr_t) reply;
-		bp  = channel->cookie_low;
-
-		VMW_PORT_HB_IN(
-			(MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
-			reply_len, si, di,
-			VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
-			VMW_HYPERVISOR_MAGIC, bp,
-			eax, ebx, ecx, edx, si, di);
-
+		ebx = vmw_port_hb_in(channel, reply, reply_len,
+				     !!(HIGH_WORD(ecx) & MESSAGE_STATUS_HB));
 		if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
 			kfree(reply);
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/hwmon/hwmon.c linux-libre-5.1.15-gnu/drivers/hwmon/hwmon.c
--- linux-libre-5.1.14-gnu/drivers/hwmon/hwmon.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/hwmon/hwmon.c	2019-06-24 23:34:56.000000000 -0400
@@ -633,7 +633,7 @@ __hwmon_device_register(struct device *d
 	if (err)
 		goto free_hwmon;
 
-	if (dev && chip && chip->ops->read &&
+	if (dev && dev->of_node && chip && chip->ops->read &&
 	    chip->info[0]->type == hwmon_chip &&
 	    (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) {
 		const struct hwmon_channel_info **info = chip->info;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/hwmon/pmbus/pmbus_core.c linux-libre-5.1.15-gnu/drivers/hwmon/pmbus/pmbus_core.c
--- linux-libre-5.1.14-gnu/drivers/hwmon/pmbus/pmbus_core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/hwmon/pmbus/pmbus_core.c	2019-06-24 23:34:56.000000000 -0400
@@ -1230,7 +1230,8 @@ static int pmbus_add_sensor_attrs_one(st
 				      const struct pmbus_driver_info *info,
 				      const char *name,
 				      int index, int page,
-				      const struct pmbus_sensor_attr *attr)
+				      const struct pmbus_sensor_attr *attr,
+				      bool paged)
 {
 	struct pmbus_sensor *base;
 	bool upper = !!(attr->gbit & 0xff00);	/* need to check STATUS_WORD */
@@ -1238,7 +1239,7 @@ static int pmbus_add_sensor_attrs_one(st
 
 	if (attr->label) {
 		ret = pmbus_add_label(data, name, index, attr->label,
-				      attr->paged ? page + 1 : 0);
+				      paged ? page + 1 : 0);
 		if (ret)
 			return ret;
 	}
@@ -1271,6 +1272,30 @@ static int pmbus_add_sensor_attrs_one(st
 	return 0;
 }
 
+static bool pmbus_sensor_is_paged(const struct pmbus_driver_info *info,
+				  const struct pmbus_sensor_attr *attr)
+{
+	int p;
+
+	if (attr->paged)
+		return true;
+
+	/*
+	 * Some attributes may be present on more than one page despite
+	 * not being marked with the paged attribute. If that is the case,
+	 * then treat the sensor as being paged and add the page suffix to the
+	 * attribute name.
+	 * We don't just add the paged attribute to all such attributes, in
+	 * order to maintain the un-suffixed labels in the case where the
+	 * attribute is only on page 0.
+	 */
+	for (p = 1; p < info->pages; p++) {
+		if (info->func[p] & attr->func)
+			return true;
+	}
+	return false;
+}
+
 static int pmbus_add_sensor_attrs(struct i2c_client *client,
 				  struct pmbus_data *data,
 				  const char *name,
@@ -1284,14 +1309,15 @@ static int pmbus_add_sensor_attrs(struct
 	index = 1;
 	for (i = 0; i < nattrs; i++) {
 		int page, pages;
+		bool paged = pmbus_sensor_is_paged(info, attrs);
 
-		pages = attrs->paged ? info->pages : 1;
+		pages = paged ? info->pages : 1;
 		for (page = 0; page < pages; page++) {
 			if (!(info->func[page] & attrs->func))
 				continue;
 			ret = pmbus_add_sensor_attrs_one(client, data, info,
 							 name, index, page,
-							 attrs);
+							 attrs, paged);
 			if (ret)
 				return ret;
 			index++;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c linux-libre-5.1.15-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
--- linux-libre-5.1.14-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c	2019-06-24 23:34:56.000000000 -0400
@@ -1023,8 +1023,6 @@ static int __maybe_unused st_lsm6dsx_sus
 {
 	struct st_lsm6dsx_hw *hw = dev_get_drvdata(dev);
 	struct st_lsm6dsx_sensor *sensor;
-	const struct st_lsm6dsx_reg *reg;
-	unsigned int data;
 	int i, err = 0;
 
 	for (i = 0; i < ST_LSM6DSX_ID_MAX; i++) {
@@ -1035,12 +1033,16 @@ static int __maybe_unused st_lsm6dsx_sus
 		if (!(hw->enable_mask & BIT(sensor->id)))
 			continue;
 
-		reg = &st_lsm6dsx_odr_table[sensor->id].reg;
-		data = ST_LSM6DSX_SHIFT_VAL(0, reg->mask);
-		err = st_lsm6dsx_update_bits_locked(hw, reg->addr, reg->mask,
-						    data);
+		if (sensor->id == ST_LSM6DSX_ID_EXT0 ||
+		    sensor->id == ST_LSM6DSX_ID_EXT1 ||
+		    sensor->id == ST_LSM6DSX_ID_EXT2)
+			err = st_lsm6dsx_shub_set_enable(sensor, false);
+		else
+			err = st_lsm6dsx_sensor_set_enable(sensor, false);
 		if (err < 0)
 			return err;
+
+		hw->suspend_mask |= BIT(sensor->id);
 	}
 
 	if (hw->fifo_mode != ST_LSM6DSX_FIFO_BYPASS)
@@ -1060,12 +1062,19 @@ static int __maybe_unused st_lsm6dsx_res
 			continue;
 
 		sensor = iio_priv(hw->iio_devs[i]);
-		if (!(hw->enable_mask & BIT(sensor->id)))
+		if (!(hw->suspend_mask & BIT(sensor->id)))
 			continue;
 
-		err = st_lsm6dsx_set_odr(sensor, sensor->odr);
+		if (sensor->id == ST_LSM6DSX_ID_EXT0 ||
+		    sensor->id == ST_LSM6DSX_ID_EXT1 ||
+		    sensor->id == ST_LSM6DSX_ID_EXT2)
+			err = st_lsm6dsx_shub_set_enable(sensor, true);
+		else
+			err = st_lsm6dsx_sensor_set_enable(sensor, true);
 		if (err < 0)
 			return err;
+
+		hw->suspend_mask &= ~BIT(sensor->id);
 	}
 
 	if (hw->enable_mask)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h linux-libre-5.1.15-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
--- linux-libre-5.1.14-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h	2019-06-24 23:34:56.000000000 -0400
@@ -265,6 +265,7 @@ struct st_lsm6dsx_sensor {
  * @conf_lock: Mutex to prevent concurrent FIFO configuration update.
  * @page_lock: Mutex to prevent concurrent memory page configuration.
  * @fifo_mode: FIFO operating mode supported by the device.
+ * @suspend_mask: Suspended sensor bitmask.
  * @enable_mask: Enabled sensor bitmask.
  * @ts_sip: Total number of timestamp samples in a given pattern.
  * @sip: Total number of samples (acc/gyro/ts) in a given pattern.
@@ -282,6 +283,7 @@ struct st_lsm6dsx_hw {
 	struct mutex page_lock;
 
 	enum st_lsm6dsx_fifo_mode fifo_mode;
+	u8 suspend_mask;
 	u8 enable_mask;
 	u8 ts_sip;
 	u8 sip;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/iio/temperature/mlx90632.c linux-libre-5.1.15-gnu/drivers/iio/temperature/mlx90632.c
--- linux-libre-5.1.14-gnu/drivers/iio/temperature/mlx90632.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/iio/temperature/mlx90632.c	2019-06-24 23:34:56.000000000 -0400
@@ -81,6 +81,8 @@
 /* Magic constants */
 #define MLX90632_ID_MEDICAL	0x0105 /* EEPROM DSPv5 Medical device id */
 #define MLX90632_ID_CONSUMER	0x0205 /* EEPROM DSPv5 Consumer device id */
+#define MLX90632_DSP_VERSION	5 /* DSP version */
+#define MLX90632_DSP_MASK	GENMASK(7, 0) /* DSP version in EE_VERSION */
 #define MLX90632_RESET_CMD	0x0006 /* Reset sensor (address or global) */
 #define MLX90632_REF_12		12LL /**< ResCtrlRef value of Ch 1 or Ch 2 */
 #define MLX90632_REF_3		12LL /**< ResCtrlRef value of Channel 3 */
@@ -667,10 +669,13 @@ static int mlx90632_probe(struct i2c_cli
 	} else if (read == MLX90632_ID_CONSUMER) {
 		dev_dbg(&client->dev,
 			"Detected Consumer EEPROM calibration %x\n", read);
+	} else if ((read & MLX90632_DSP_MASK) == MLX90632_DSP_VERSION) {
+		dev_dbg(&client->dev,
+			"Detected Unknown EEPROM calibration %x\n", read);
 	} else {
 		dev_err(&client->dev,
-			"EEPROM version mismatch %x (expected %x or %x)\n",
-			read, MLX90632_ID_CONSUMER, MLX90632_ID_MEDICAL);
+			"Wrong DSP version %x (expected %x)\n",
+			read, MLX90632_DSP_VERSION);
 		return -EPROTONOSUPPORT;
 	}
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/chip.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/chip.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/chip.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/chip.c	2019-06-24 23:34:56.000000000 -0400
@@ -9848,6 +9848,7 @@ void hfi1_quiet_serdes(struct hfi1_pport
 
 	/* disable the port */
 	clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
+	cancel_work_sync(&ppd->freeze_work);
 }
 
 static inline int init_cpu_counters(struct hfi1_devdata *dd)
@@ -14028,6 +14029,19 @@ static void init_kdeth_qp(struct hfi1_de
 }
 
 /**
+ * hfi1_get_qp_map
+ * @dd: device data
+ * @idx: index to read
+ */
+u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx)
+{
+	u64 reg = read_csr(dd, RCV_QP_MAP_TABLE + (idx / 8) * 8);
+
+	reg >>= (idx % 8) * 8;
+	return reg;
+}
+
+/**
  * init_qpmap_table
  * @dd - device data
  * @first_ctxt - first context
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/chip.h linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/chip.h
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/chip.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/chip.h	2019-06-24 23:34:56.000000000 -0400
@@ -1442,6 +1442,7 @@ void clear_all_interrupts(struct hfi1_de
 void remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr);
 void remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr);
 void reset_interrupts(struct hfi1_devdata *dd);
+u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx);
 
 /*
  * Interrupt source table.
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/fault.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/fault.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/fault.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/fault.c	2019-06-24 23:34:56.000000000 -0400
@@ -153,6 +153,7 @@ static ssize_t fault_opcodes_write(struc
 		char *dash;
 		unsigned long range_start, range_end, i;
 		bool remove = false;
+		unsigned long bound = 1U << BITS_PER_BYTE;
 
 		end = strchr(ptr, ',');
 		if (end)
@@ -178,6 +179,10 @@ static ssize_t fault_opcodes_write(struc
 				    BITS_PER_BYTE);
 			break;
 		}
+		/* Check the inputs */
+		if (range_start >= bound || range_end >= bound)
+			break;
+
 		for (i = range_start; i <= range_end; i++) {
 			if (remove)
 				clear_bit(i, fault->opcodes);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/sdma.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/sdma.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/sdma.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/sdma.c	2019-06-24 23:34:56.000000000 -0400
@@ -410,10 +410,7 @@ static void sdma_flush(struct sdma_engin
 	sdma_flush_descq(sde);
 	spin_lock_irqsave(&sde->flushlist_lock, flags);
 	/* copy flush list */
-	list_for_each_entry_safe(txp, txp_next, &sde->flushlist, list) {
-		list_del_init(&txp->list);
-		list_add_tail(&txp->list, &flushlist);
-	}
+	list_splice_init(&sde->flushlist, &flushlist);
 	spin_unlock_irqrestore(&sde->flushlist_lock, flags);
 	/* flush from flush list */
 	list_for_each_entry_safe(txp, txp_next, &flushlist, list)
@@ -2413,7 +2410,7 @@ unlock_noconn:
 	list_add_tail(&tx->list, &sde->flushlist);
 	spin_unlock(&sde->flushlist_lock);
 	iowait_inc_wait_count(wait, tx->num_desc);
-	schedule_work(&sde->flush_worker);
+	queue_work_on(sde->cpu, system_highpri_wq, &sde->flush_worker);
 	ret = -ECOMM;
 	goto unlock;
 nodesc:
@@ -2511,7 +2508,7 @@ unlock_noconn:
 		iowait_inc_wait_count(wait, tx->num_desc);
 	}
 	spin_unlock(&sde->flushlist_lock);
-	schedule_work(&sde->flush_worker);
+	queue_work_on(sde->cpu, system_highpri_wq, &sde->flush_worker);
 	ret = -ECOMM;
 	goto update_tail;
 nodesc:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/tid_rdma.c	2019-06-24 23:34:56.000000000 -0400
@@ -305,9 +305,7 @@ static struct hfi1_ctxtdata *qp_to_rcd(s
 	if (qp->ibqp.qp_num == 0)
 		ctxt = 0;
 	else
-		ctxt = ((qp->ibqp.qp_num >> dd->qos_shift) %
-			(dd->n_krcv_queues - 1)) + 1;
-
+		ctxt = hfi1_get_qp_map(dd, qp->ibqp.qp_num >> dd->qos_shift);
 	return dd->rcd[ctxt];
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_exp_rcv.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_exp_rcv.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_exp_rcv.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_exp_rcv.c	2019-06-24 23:34:56.000000000 -0400
@@ -324,6 +324,9 @@ int hfi1_user_exp_rcv_setup(struct hfi1_
 	u32 *tidlist = NULL;
 	struct tid_user_buf *tidbuf;
 
+	if (!PAGE_ALIGNED(tinfo->vaddr))
+		return -EINVAL;
+
 	tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL);
 	if (!tidbuf)
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_sdma.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_sdma.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_sdma.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_sdma.c	2019-06-24 23:34:56.000000000 -0400
@@ -130,20 +130,16 @@ static int defer_packet_queue(
 {
 	struct hfi1_user_sdma_pkt_q *pq =
 		container_of(wait->iow, struct hfi1_user_sdma_pkt_q, busy);
-	struct user_sdma_txreq *tx =
-		container_of(txreq, struct user_sdma_txreq, txreq);
 
-	if (sdma_progress(sde, seq, txreq)) {
-		if (tx->busycount++ < MAX_DEFER_RETRY_COUNT)
-			goto eagain;
-	}
+	write_seqlock(&sde->waitlock);
+	if (sdma_progress(sde, seq, txreq))
+		goto eagain;
 	/*
 	 * We are assuming that if the list is enqueued somewhere, it
 	 * is to the dmawait list since that is the only place where
 	 * it is supposed to be enqueued.
 	 */
 	xchg(&pq->state, SDMA_PKT_Q_DEFERRED);
-	write_seqlock(&sde->waitlock);
 	if (list_empty(&pq->busy.list)) {
 		iowait_get_priority(&pq->busy);
 		iowait_queue(pkts_sent, &pq->busy, &sde->dmawait);
@@ -151,6 +147,7 @@ static int defer_packet_queue(
 	write_sequnlock(&sde->waitlock);
 	return -EBUSY;
 eagain:
+	write_sequnlock(&sde->waitlock);
 	return -EAGAIN;
 }
 
@@ -804,7 +801,6 @@ static int user_sdma_send_pkts(struct us
 
 		tx->flags = 0;
 		tx->req = req;
-		tx->busycount = 0;
 		INIT_LIST_HEAD(&tx->list);
 
 		/*
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_sdma.h linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_sdma.h
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/user_sdma.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/user_sdma.h	2019-06-24 23:34:56.000000000 -0400
@@ -245,7 +245,6 @@ struct user_sdma_txreq {
 	struct list_head list;
 	struct user_sdma_request *req;
 	u16 flags;
-	unsigned int busycount;
 	u16 seqnum;
 };
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs.c	2019-06-24 23:34:56.000000000 -0400
@@ -1355,8 +1355,6 @@ static void hfi1_fill_device_attr(struct
 	rdi->dparms.props.max_cq = hfi1_max_cqs;
 	rdi->dparms.props.max_ah = hfi1_max_ahs;
 	rdi->dparms.props.max_cqe = hfi1_max_cqes;
-	rdi->dparms.props.max_mr = rdi->lkey_table.max;
-	rdi->dparms.props.max_fmr = rdi->lkey_table.max;
 	rdi->dparms.props.max_map_per_fmr = 32767;
 	rdi->dparms.props.max_pd = hfi1_max_pds;
 	rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.c	2019-06-24 23:34:56.000000000 -0400
@@ -100,7 +100,7 @@ struct verbs_txreq *__get_txreq(struct h
 	if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) {
 		struct hfi1_qp_priv *priv;
 
-		tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
+		tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
 		if (tx)
 			goto out;
 		priv = qp->priv;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.h linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.h
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/hfi1/verbs_txreq.h	2019-06-24 23:34:56.000000000 -0400
@@ -72,6 +72,7 @@ struct hfi1_ibdev;
 struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
 				struct rvt_qp *qp);
 
+#define VERBS_TXREQ_GFP (GFP_ATOMIC | __GFP_NOWARN)
 static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
 					    struct rvt_qp *qp)
 	__must_hold(&qp->slock)
@@ -79,7 +80,7 @@ static inline struct verbs_txreq *get_tx
 	struct verbs_txreq *tx;
 	struct hfi1_qp_priv *priv = qp->priv;
 
-	tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
+	tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
 	if (unlikely(!tx)) {
 		/* call slow path to get the lock */
 		tx = __get_txreq(dev, qp);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/hw/qib/qib_verbs.c linux-libre-5.1.15-gnu/drivers/infiniband/hw/qib/qib_verbs.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/hw/qib/qib_verbs.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/hw/qib/qib_verbs.c	2019-06-24 23:34:56.000000000 -0400
@@ -1459,8 +1459,6 @@ static void qib_fill_device_attr(struct
 	rdi->dparms.props.max_cq = ib_qib_max_cqs;
 	rdi->dparms.props.max_cqe = ib_qib_max_cqes;
 	rdi->dparms.props.max_ah = ib_qib_max_ahs;
-	rdi->dparms.props.max_mr = rdi->lkey_table.max;
-	rdi->dparms.props.max_fmr = rdi->lkey_table.max;
 	rdi->dparms.props.max_map_per_fmr = 32767;
 	rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC;
 	rdi->dparms.props.max_qp_init_rd_atom = 255;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/sw/rdmavt/mr.c linux-libre-5.1.15-gnu/drivers/infiniband/sw/rdmavt/mr.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/sw/rdmavt/mr.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/sw/rdmavt/mr.c	2019-06-24 23:34:56.000000000 -0400
@@ -96,6 +96,8 @@ int rvt_driver_mr_init(struct rvt_dev_in
 	for (i = 0; i < rdi->lkey_table.max; i++)
 		RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL);
 
+	rdi->dparms.props.max_mr = rdi->lkey_table.max;
+	rdi->dparms.props.max_fmr = rdi->lkey_table.max;
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/infiniband/sw/rdmavt/qp.c linux-libre-5.1.15-gnu/drivers/infiniband/sw/rdmavt/qp.c
--- linux-libre-5.1.14-gnu/drivers/infiniband/sw/rdmavt/qp.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/infiniband/sw/rdmavt/qp.c	2019-06-24 23:34:56.000000000 -0400
@@ -594,7 +594,8 @@ static int alloc_qpn(struct rvt_dev_info
 			offset = qpt->incr | ((offset & 1) ^ 1);
 		}
 		/* there can be no set bits in low-order QoS bits */
-		WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1));
+		WARN_ON(rdi->dparms.qos_shift > 1 &&
+			offset & ((BIT(rdi->dparms.qos_shift - 1) - 1) << 1));
 		qpn = mk_qpn(qpt, map, offset);
 	}
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/input/misc/uinput.c linux-libre-5.1.15-gnu/drivers/input/misc/uinput.c
--- linux-libre-5.1.14-gnu/drivers/input/misc/uinput.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/input/misc/uinput.c	2019-06-24 23:34:56.000000000 -0400
@@ -1051,13 +1051,31 @@ static long uinput_ioctl(struct file *fi
 
 #ifdef CONFIG_COMPAT
 
-#define UI_SET_PHYS_COMPAT	_IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
+/*
+ * These IOCTLs change their size and thus their numbers between
+ * 32 and 64 bits.
+ */
+#define UI_SET_PHYS_COMPAT		\
+	_IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
+#define UI_BEGIN_FF_UPLOAD_COMPAT	\
+	_IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload_compat)
+#define UI_END_FF_UPLOAD_COMPAT		\
+	_IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload_compat)
 
 static long uinput_compat_ioctl(struct file *file,
 				unsigned int cmd, unsigned long arg)
 {
-	if (cmd == UI_SET_PHYS_COMPAT)
+	switch (cmd) {
+	case UI_SET_PHYS_COMPAT:
 		cmd = UI_SET_PHYS;
+		break;
+	case UI_BEGIN_FF_UPLOAD_COMPAT:
+		cmd = UI_BEGIN_FF_UPLOAD;
+		break;
+	case UI_END_FF_UPLOAD_COMPAT:
+		cmd = UI_END_FF_UPLOAD;
+		break;
+	}
 
 	return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
 }
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/input/mouse/synaptics.c linux-libre-5.1.15-gnu/drivers/input/mouse/synaptics.c
--- linux-libre-5.1.14-gnu/drivers/input/mouse/synaptics.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/input/mouse/synaptics.c	2019-06-24 23:34:56.000000000 -0400
@@ -179,6 +179,8 @@ static const char * const smbus_pnp_ids[
 	"LEN0096", /* X280 */
 	"LEN0097", /* X280 -> ALPS trackpoint */
 	"LEN200f", /* T450s */
+	"LEN2054", /* E480 */
+	"LEN2055", /* E580 */
 	"SYN3052", /* HP EliteBook 840 G4 */
 	"SYN3221", /* HP 15-ay000 */
 	NULL
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/input/touchscreen/silead.c linux-libre-5.1.15-gnu/drivers/input/touchscreen/silead.c
--- linux-libre-5.1.14-gnu/drivers/input/touchscreen/silead.c	2019-06-22 06:26:10.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/input/touchscreen/silead.c	2019-06-25 00:54:07.000000000 -0400
@@ -616,6 +616,7 @@ static const struct acpi_device_id silea
 	{ "MSSL1680", 0 },
 	{ "MSSL0001", 0 },
 	{ "MSSL0002", 0 },
+	{ "MSSL0017", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/misc/habanalabs/memory.c linux-libre-5.1.15-gnu/drivers/misc/habanalabs/memory.c
--- linux-libre-5.1.14-gnu/drivers/misc/habanalabs/memory.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/misc/habanalabs/memory.c	2019-06-24 23:34:56.000000000 -0400
@@ -675,11 +675,6 @@ static int init_phys_pg_pack_from_userpt
 
 		total_npages += npages;
 
-		if (first) {
-			first = false;
-			dma_addr &= PAGE_MASK_2MB;
-		}
-
 		if ((npages % PGS_IN_2MB_PAGE) ||
 					(dma_addr & (PAGE_SIZE_2MB - 1)))
 			is_huge_page_opt = false;
@@ -704,7 +699,6 @@ static int init_phys_pg_pack_from_userpt
 	phys_pg_pack->total_size = total_npages * page_size;
 
 	j = 0;
-	first = true;
 	for_each_sg(userptr->sgt->sgl, sg, userptr->sgt->nents, i) {
 		npages = get_sg_info(sg, &dma_addr);
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/misc/lkdtm/usercopy.c linux-libre-5.1.15-gnu/drivers/misc/lkdtm/usercopy.c
--- linux-libre-5.1.14-gnu/drivers/misc/lkdtm/usercopy.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/misc/lkdtm/usercopy.c	2019-06-24 23:34:56.000000000 -0400
@@ -324,14 +324,16 @@ free_user:
 
 void lkdtm_USERCOPY_KERNEL_DS(void)
 {
-	char __user *user_ptr = (char __user *)ERR_PTR(-EINVAL);
+	char __user *user_ptr =
+		(char __user *)(0xFUL << (sizeof(unsigned long) * 8 - 4));
 	mm_segment_t old_fs = get_fs();
 	char buf[10] = {0};
 
-	pr_info("attempting copy_to_user on unmapped kernel address\n");
+	pr_info("attempting copy_to_user() to noncanonical address: %px\n",
+		user_ptr);
 	set_fs(KERNEL_DS);
-	if (copy_to_user(user_ptr, buf, sizeof(buf)))
-		pr_info("copy_to_user un unmapped kernel address failed\n");
+	if (copy_to_user(user_ptr, buf, sizeof(buf)) == 0)
+		pr_err("copy_to_user() to noncanonical address succeeded!?\n");
 	set_fs(old_fs);
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/core/core.c linux-libre-5.1.15-gnu/drivers/mmc/core/core.c
--- linux-libre-5.1.14-gnu/drivers/mmc/core/core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/core/core.c	2019-06-24 23:34:56.000000000 -0400
@@ -144,8 +144,9 @@ void mmc_request_done(struct mmc_host *h
 	int err = cmd->error;
 
 	/* Flag re-tuning needed on CRC errors */
-	if ((cmd->opcode != MMC_SEND_TUNING_BLOCK &&
-	    cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
+	if (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
+	    cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200 &&
+	    !host->retune_crc_disable &&
 	    (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
 	    (mrq->data && mrq->data->error == -EILSEQ) ||
 	    (mrq->stop && mrq->stop->error == -EILSEQ)))
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/core/sdio.c linux-libre-5.1.15-gnu/drivers/mmc/core/sdio.c
--- linux-libre-5.1.14-gnu/drivers/mmc/core/sdio.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/core/sdio.c	2019-06-24 23:34:56.000000000 -0400
@@ -941,6 +941,10 @@ static int mmc_sdio_pre_suspend(struct m
  */
 static int mmc_sdio_suspend(struct mmc_host *host)
 {
+	/* Prevent processing of SDIO IRQs in suspended state. */
+	mmc_card_set_suspended(host->card);
+	cancel_delayed_work_sync(&host->sdio_irq_work);
+
 	mmc_claim_host(host);
 
 	if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host))
@@ -989,13 +993,20 @@ static int mmc_sdio_resume(struct mmc_ho
 		err = sdio_enable_4bit_bus(host->card);
 	}
 
-	if (!err && host->sdio_irqs) {
+	if (err)
+		goto out;
+
+	/* Allow SDIO IRQs to be processed again. */
+	mmc_card_clr_suspended(host->card);
+
+	if (host->sdio_irqs) {
 		if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
 			wake_up_process(host->sdio_irq_thread);
 		else if (host->caps & MMC_CAP_SDIO_IRQ)
 			host->ops->enable_sdio_irq(host, 1);
 	}
 
+out:
 	mmc_release_host(host);
 
 	host->pm_flags &= ~MMC_PM_KEEP_POWER;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/core/sdio_io.c linux-libre-5.1.15-gnu/drivers/mmc/core/sdio_io.c
--- linux-libre-5.1.14-gnu/drivers/mmc/core/sdio_io.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/core/sdio_io.c	2019-06-24 23:34:56.000000000 -0400
@@ -19,6 +19,7 @@
 #include "sdio_ops.h"
 #include "core.h"
 #include "card.h"
+#include "host.h"
 
 /**
  *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
@@ -738,3 +739,79 @@ int sdio_set_host_pm_flags(struct sdio_f
 	return 0;
 }
 EXPORT_SYMBOL_GPL(sdio_set_host_pm_flags);
+
+/**
+ *	sdio_retune_crc_disable - temporarily disable retuning on CRC errors
+ *	@func: SDIO function attached to host
+ *
+ *	If the SDIO card is known to be in a state where it might produce
+ *	CRC errors on the bus in response to commands (like if we know it is
+ *	transitioning between power states), an SDIO function driver can
+ *	call this function to temporarily disable the SD/MMC core behavior of
+ *	triggering an automatic retuning.
+ *
+ *	This function should be called while the host is claimed and the host
+ *	should remain claimed until sdio_retune_crc_enable() is called.
+ *	Specifically, the expected sequence of calls is:
+ *	- sdio_claim_host()
+ *	- sdio_retune_crc_disable()
+ *	- some number of calls like sdio_writeb() and sdio_readb()
+ *	- sdio_retune_crc_enable()
+ *	- sdio_release_host()
+ */
+void sdio_retune_crc_disable(struct sdio_func *func)
+{
+	func->card->host->retune_crc_disable = true;
+}
+EXPORT_SYMBOL_GPL(sdio_retune_crc_disable);
+
+/**
+ *	sdio_retune_crc_enable - re-enable retuning on CRC errors
+ *	@func: SDIO function attached to host
+ *
+ *	This is the compement to sdio_retune_crc_disable().
+ */
+void sdio_retune_crc_enable(struct sdio_func *func)
+{
+	func->card->host->retune_crc_disable = false;
+}
+EXPORT_SYMBOL_GPL(sdio_retune_crc_enable);
+
+/**
+ *	sdio_retune_hold_now - start deferring retuning requests till release
+ *	@func: SDIO function attached to host
+ *
+ *	This function can be called if it's currently a bad time to do
+ *	a retune of the SDIO card.  Retune requests made during this time
+ *	will be held and we'll actually do the retune sometime after the
+ *	release.
+ *
+ *	This function could be useful if an SDIO card is in a power state
+ *	where it can respond to a small subset of commands that doesn't
+ *	include the retuning command.  Care should be taken when using
+ *	this function since (presumably) the retuning request we might be
+ *	deferring was made for a good reason.
+ *
+ *	This function should be called while the host is claimed.
+ */
+void sdio_retune_hold_now(struct sdio_func *func)
+{
+	mmc_retune_hold_now(func->card->host);
+}
+EXPORT_SYMBOL_GPL(sdio_retune_hold_now);
+
+/**
+ *	sdio_retune_release - signal that it's OK to retune now
+ *	@func: SDIO function attached to host
+ *
+ *	This is the complement to sdio_retune_hold_now().  Calling this
+ *	function won't make a retune happen right away but will allow
+ *	them to be scheduled normally.
+ *
+ *	This function should be called while the host is claimed.
+ */
+void sdio_retune_release(struct sdio_func *func)
+{
+	mmc_retune_release(func->card->host);
+}
+EXPORT_SYMBOL_GPL(sdio_retune_release);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/core/sdio_irq.c linux-libre-5.1.15-gnu/drivers/mmc/core/sdio_irq.c
--- linux-libre-5.1.14-gnu/drivers/mmc/core/sdio_irq.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/core/sdio_irq.c	2019-06-24 23:34:56.000000000 -0400
@@ -38,6 +38,10 @@ static int process_sdio_pending_irqs(str
 	unsigned char pending;
 	struct sdio_func *func;
 
+	/* Don't process SDIO IRQs if the card is suspended. */
+	if (mmc_card_suspended(card))
+		return 0;
+
 	/*
 	 * Optimization, if there is only 1 function interrupt registered
 	 * and we know an IRQ was signaled then call irq handler directly.
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/host/mtk-sd.c linux-libre-5.1.15-gnu/drivers/mmc/host/mtk-sd.c
--- linux-libre-5.1.14-gnu/drivers/mmc/host/mtk-sd.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/host/mtk-sd.c	2019-06-24 23:34:56.000000000 -0400
@@ -1003,6 +1003,8 @@ static void msdc_request_done(struct msd
 	msdc_track_cmd_data(host, mrq->cmd, mrq->data);
 	if (mrq->data)
 		msdc_unprepare_data(host, mrq);
+	if (host->error)
+		msdc_reset_hw(host);
 	mmc_request_done(host->mmc, mrq);
 }
 
@@ -1355,24 +1357,25 @@ static void msdc_request_timeout(struct
 	}
 }
 
-static void __msdc_enable_sdio_irq(struct mmc_host *mmc, int enb)
+static void __msdc_enable_sdio_irq(struct msdc_host *host, int enb)
 {
-	unsigned long flags;
-	struct msdc_host *host = mmc_priv(mmc);
-
-	spin_lock_irqsave(&host->lock, flags);
-	if (enb)
+	if (enb) {
 		sdr_set_bits(host->base + MSDC_INTEN, MSDC_INTEN_SDIOIRQ);
-	else
+		sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+	} else {
 		sdr_clr_bits(host->base + MSDC_INTEN, MSDC_INTEN_SDIOIRQ);
-	spin_unlock_irqrestore(&host->lock, flags);
+		sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+	}
 }
 
 static void msdc_enable_sdio_irq(struct mmc_host *mmc, int enb)
 {
+	unsigned long flags;
 	struct msdc_host *host = mmc_priv(mmc);
 
-	__msdc_enable_sdio_irq(mmc, enb);
+	spin_lock_irqsave(&host->lock, flags);
+	__msdc_enable_sdio_irq(host, enb);
+	spin_unlock_irqrestore(&host->lock, flags);
 
 	if (enb)
 		pm_runtime_get_noresume(host->dev);
@@ -1394,6 +1397,8 @@ static irqreturn_t msdc_irq(int irq, voi
 		spin_lock_irqsave(&host->lock, flags);
 		events = readl(host->base + MSDC_INT);
 		event_mask = readl(host->base + MSDC_INTEN);
+		if ((events & event_mask) & MSDC_INT_SDIOIRQ)
+			__msdc_enable_sdio_irq(host, 0);
 		/* clear interrupts */
 		writel(events & event_mask, host->base + MSDC_INT);
 
@@ -1402,10 +1407,8 @@ static irqreturn_t msdc_irq(int irq, voi
 		data = host->data;
 		spin_unlock_irqrestore(&host->lock, flags);
 
-		if ((events & event_mask) & MSDC_INT_SDIOIRQ) {
-			__msdc_enable_sdio_irq(host->mmc, 0);
+		if ((events & event_mask) & MSDC_INT_SDIOIRQ)
 			sdio_signal_irq(host->mmc);
-		}
 
 		if (!(events & (event_mask & ~MSDC_INT_SDIOIRQ)))
 			break;
@@ -1528,10 +1531,7 @@ static void msdc_init_hw(struct msdc_hos
 	sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIO);
 
 	/* Config SDIO device detect interrupt function */
-	if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
-		sdr_set_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
-	else
-		sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
+	sdr_clr_bits(host->base + SDC_CFG, SDC_CFG_SDIOIDE);
 
 	/* Configure to default data timeout */
 	sdr_set_field(host->base + SDC_CFG, SDC_CFG_DTOC, 3);
@@ -2052,7 +2052,12 @@ static void msdc_hw_reset(struct mmc_hos
 
 static void msdc_ack_sdio_irq(struct mmc_host *mmc)
 {
-	__msdc_enable_sdio_irq(mmc, 1);
+	unsigned long flags;
+	struct msdc_host *host = mmc_priv(mmc);
+
+	spin_lock_irqsave(&host->lock, flags);
+	__msdc_enable_sdio_irq(host, 1);
+	spin_unlock_irqrestore(&host->lock, flags);
 }
 
 static const struct mmc_host_ops mt_msdc_ops = {
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/host/renesas_sdhi_core.c linux-libre-5.1.15-gnu/drivers/mmc/host/renesas_sdhi_core.c
--- linux-libre-5.1.14-gnu/drivers/mmc/host/renesas_sdhi_core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/host/renesas_sdhi_core.c	2019-06-24 23:34:56.000000000 -0400
@@ -620,11 +620,16 @@ static const struct renesas_sdhi_quirks
 	.hs400_4taps = true,
 };
 
+static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
+	.hs400_disabled = true,
+};
+
 static const struct soc_device_attribute sdhi_quirks_match[]  = {
 	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_h3_m3w_es1 },
 	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_h3_es2 },
-	{ .soc_id = "r8a7796", .revision = "ES1.0", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7796", .revision = "ES1.1", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/mmc/host/sdhci-pci-o2micro.c linux-libre-5.1.15-gnu/drivers/mmc/host/sdhci-pci-o2micro.c
--- linux-libre-5.1.14-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/mmc/host/sdhci-pci-o2micro.c	2019-06-24 23:34:56.000000000 -0400
@@ -124,6 +124,7 @@ static int sdhci_o2_execute_tuning(struc
 	 */
 	if (mmc->ios.bus_width == MMC_BUS_WIDTH_8) {
 		current_bus_width = mmc->ios.bus_width;
+		mmc->ios.bus_width = MMC_BUS_WIDTH_4;
 		sdhci_set_bus_width(host, MMC_BUS_WIDTH_4);
 	}
 
@@ -135,8 +136,10 @@ static int sdhci_o2_execute_tuning(struc
 
 	sdhci_end_tuning(host);
 
-	if (current_bus_width == MMC_BUS_WIDTH_8)
+	if (current_bus_width == MMC_BUS_WIDTH_8) {
+		mmc->ios.bus_width = MMC_BUS_WIDTH_8;
 		sdhci_set_bus_width(host, current_bus_width);
+	}
 
 	host->flags &= ~SDHCI_HS400_TUNING;
 	return 0;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/can/flexcan.c linux-libre-5.1.15-gnu/drivers/net/can/flexcan.c
--- linux-libre-5.1.14-gnu/drivers/net/can/flexcan.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/can/flexcan.c	2019-06-24 23:34:56.000000000 -0400
@@ -166,7 +166,7 @@
 #define FLEXCAN_MB_CNT_LENGTH(x)	(((x) & 0xf) << 16)
 #define FLEXCAN_MB_CNT_TIMESTAMP(x)	((x) & 0xffff)
 
-#define FLEXCAN_TIMEOUT_US		(50)
+#define FLEXCAN_TIMEOUT_US		(250)
 
 /* FLEXCAN hardware feature flags
  *
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/can/xilinx_can.c linux-libre-5.1.15-gnu/drivers/net/can/xilinx_can.c
--- linux-libre-5.1.14-gnu/drivers/net/can/xilinx_can.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/can/xilinx_can.c	2019-06-24 23:34:56.000000000 -0400
@@ -1443,7 +1443,7 @@ static const struct xcan_devtype_data xc
 		 XCAN_FLAG_RXMNF |
 		 XCAN_FLAG_TX_MAILBOXES |
 		 XCAN_FLAG_RX_FIFO_MULTI,
-	.bittiming_const = &xcan_bittiming_const,
+	.bittiming_const = &xcan_bittiming_const_canfd,
 	.btr_ts2_shift = XCAN_BTR_TS2_SHIFT_CANFD,
 	.btr_sjw_shift = XCAN_BTR_SJW_SHIFT_CANFD,
 	.bus_clk_name = "s_axi_aclk",
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/dsa/mv88e6xxx/chip.c linux-libre-5.1.15-gnu/drivers/net/dsa/mv88e6xxx/chip.c
--- linux-libre-5.1.14-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-06-24 23:34:56.000000000 -0400
@@ -1517,7 +1517,7 @@ static int mv88e6xxx_vtu_get(struct mv88
 	int err;
 
 	if (!vid)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	entry->vid = vid - 1;
 	entry->valid = false;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c linux-libre-5.1.15-gnu/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
--- linux-libre-5.1.14-gnu/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c	2019-06-24 23:34:56.000000000 -0400
@@ -339,6 +339,7 @@ static int __lb_setup(struct net_device
 static int __lb_up(struct net_device *ndev,
 		   enum hnae_loop loop_mode)
 {
+#define NIC_LB_TEST_WAIT_PHY_LINK_TIME 300
 	struct hns_nic_priv *priv = netdev_priv(ndev);
 	struct hnae_handle *h = priv->ae_handle;
 	int speed, duplex;
@@ -365,6 +366,9 @@ static int __lb_up(struct net_device *nd
 
 	h->dev->ops->adjust_link(h, speed, duplex);
 
+	/* wait adjust link done and phy ready */
+	msleep(NIC_LB_TEST_WAIT_PHY_LINK_TIME);
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/ethernet/mediatek/mtk_eth_soc.c linux-libre-5.1.15-gnu/drivers/net/ethernet/mediatek/mtk_eth_soc.c
--- linux-libre-5.1.14-gnu/drivers/net/ethernet/mediatek/mtk_eth_soc.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/ethernet/mediatek/mtk_eth_soc.c	2019-06-24 23:34:56.000000000 -0400
@@ -1777,6 +1777,7 @@ static void mtk_poll_controller(struct n
 
 static int mtk_start_dma(struct mtk_eth *eth)
 {
+	u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
 	int err;
 
 	err = mtk_dma_init(eth);
@@ -1793,7 +1794,7 @@ static int mtk_start_dma(struct mtk_eth
 		MTK_QDMA_GLO_CFG);
 
 	mtk_w32(eth,
-		MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
+		MTK_RX_DMA_EN | rx_2b_offset |
 		MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
 		MTK_PDMA_GLO_CFG);
 
@@ -2297,13 +2298,13 @@ static int mtk_get_rxnfc(struct net_devi
 
 	switch (cmd->cmd) {
 	case ETHTOOL_GRXRINGS:
-		if (dev->features & NETIF_F_LRO) {
+		if (dev->hw_features & NETIF_F_LRO) {
 			cmd->data = MTK_MAX_RX_RING_NUM;
 			ret = 0;
 		}
 		break;
 	case ETHTOOL_GRXCLSRLCNT:
-		if (dev->features & NETIF_F_LRO) {
+		if (dev->hw_features & NETIF_F_LRO) {
 			struct mtk_mac *mac = netdev_priv(dev);
 
 			cmd->rule_cnt = mac->hwlro_ip_cnt;
@@ -2311,11 +2312,11 @@ static int mtk_get_rxnfc(struct net_devi
 		}
 		break;
 	case ETHTOOL_GRXCLSRULE:
-		if (dev->features & NETIF_F_LRO)
+		if (dev->hw_features & NETIF_F_LRO)
 			ret = mtk_hwlro_get_fdir_entry(dev, cmd);
 		break;
 	case ETHTOOL_GRXCLSRLALL:
-		if (dev->features & NETIF_F_LRO)
+		if (dev->hw_features & NETIF_F_LRO)
 			ret = mtk_hwlro_get_fdir_all(dev, cmd,
 						     rule_locs);
 		break;
@@ -2332,11 +2333,11 @@ static int mtk_set_rxnfc(struct net_devi
 
 	switch (cmd->cmd) {
 	case ETHTOOL_SRXCLSRLINS:
-		if (dev->features & NETIF_F_LRO)
+		if (dev->hw_features & NETIF_F_LRO)
 			ret = mtk_hwlro_add_ipaddr(dev, cmd);
 		break;
 	case ETHTOOL_SRXCLSRLDEL:
-		if (dev->features & NETIF_F_LRO)
+		if (dev->hw_features & NETIF_F_LRO)
 			ret = mtk_hwlro_del_ipaddr(dev, cmd);
 		break;
 	default:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/ipvlan/ipvlan_main.c linux-libre-5.1.15-gnu/drivers/net/ipvlan/ipvlan_main.c
--- linux-libre-5.1.14-gnu/drivers/net/ipvlan/ipvlan_main.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/ipvlan/ipvlan_main.c	2019-06-24 23:34:56.000000000 -0400
@@ -112,7 +112,7 @@ static void ipvlan_port_destroy(struct n
 }
 
 #define IPVLAN_FEATURES \
-	(NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
+	(NETIF_F_SG | NETIF_F_CSUM_MASK | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
 	 NETIF_F_GSO | NETIF_F_TSO | NETIF_F_GSO_ROBUST | \
 	 NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \
 	 NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/phy/phylink.c linux-libre-5.1.15-gnu/drivers/net/phy/phylink.c
--- linux-libre-5.1.14-gnu/drivers/net/phy/phylink.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/phy/phylink.c	2019-06-24 23:34:56.000000000 -0400
@@ -1080,6 +1080,7 @@ EXPORT_SYMBOL_GPL(phylink_ethtool_ksetti
 int phylink_ethtool_ksettings_set(struct phylink *pl,
 				  const struct ethtool_link_ksettings *kset)
 {
+	__ETHTOOL_DECLARE_LINK_MODE_MASK(support);
 	struct ethtool_link_ksettings our_kset;
 	struct phylink_link_state config;
 	int ret;
@@ -1090,11 +1091,12 @@ int phylink_ethtool_ksettings_set(struct
 	    kset->base.autoneg != AUTONEG_ENABLE)
 		return -EINVAL;
 
+	linkmode_copy(support, pl->supported);
 	config = pl->link_config;
 
 	/* Mask out unsupported advertisements */
 	linkmode_and(config.advertising, kset->link_modes.advertising,
-		     pl->supported);
+		     support);
 
 	/* FIXME: should we reject autoneg if phy/mac does not support it? */
 	if (kset->base.autoneg == AUTONEG_DISABLE) {
@@ -1104,7 +1106,7 @@ int phylink_ethtool_ksettings_set(struct
 		 * duplex.
 		 */
 		s = phy_lookup_setting(kset->base.speed, kset->base.duplex,
-				       pl->supported, false);
+				       support, false);
 		if (!s)
 			return -EINVAL;
 
@@ -1133,7 +1135,7 @@ int phylink_ethtool_ksettings_set(struct
 		__set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, config.advertising);
 	}
 
-	if (phylink_validate(pl, pl->supported, &config))
+	if (phylink_validate(pl, support, &config))
 		return -EINVAL;
 
 	/* If autonegotiation is enabled, we must have an advertisement */
@@ -1583,6 +1585,7 @@ static int phylink_sfp_module_insert(voi
 {
 	struct phylink *pl = upstream;
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, };
+	__ETHTOOL_DECLARE_LINK_MODE_MASK(support1);
 	struct phylink_link_state config;
 	phy_interface_t iface;
 	int ret = 0;
@@ -1610,6 +1613,8 @@ static int phylink_sfp_module_insert(voi
 		return ret;
 	}
 
+	linkmode_copy(support1, support);
+
 	iface = sfp_select_interface(pl->sfp_bus, id, config.advertising);
 	if (iface == PHY_INTERFACE_MODE_NA) {
 		netdev_err(pl->netdev,
@@ -1619,7 +1624,7 @@ static int phylink_sfp_module_insert(voi
 	}
 
 	config.interface = iface;
-	ret = phylink_validate(pl, support, &config);
+	ret = phylink_validate(pl, support1, &config);
 	if (ret) {
 		netdev_err(pl->netdev, "validation of %s/%s with support %*pb failed: %d\n",
 			   phylink_an_mode_str(MLO_AN_INBAND),
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c linux-libre-5.1.15-gnu/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
--- linux-libre-5.1.14-gnu/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c	2019-06-22 06:17:42.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c	2019-06-25 00:45:32.000000000 -0400
@@ -676,6 +676,12 @@ brcmf_sdio_kso_control(struct brcmf_sdio
 
 	brcmf_dbg(TRACE, "Enter: on=%d\n", on);
 
+	sdio_retune_crc_disable(bus->sdiodev->func1);
+
+	/* Cannot re-tune if device is asleep; defer till we're awake */
+	if (on)
+		sdio_retune_hold_now(bus->sdiodev->func1);
+
 	wr_val = (on << SBSDIO_FUNC1_SLEEPCSR_KSO_SHIFT);
 	/* 1st KSO write goes to AOS wake up core if device is asleep  */
 	brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err);
@@ -736,6 +742,11 @@ brcmf_sdio_kso_control(struct brcmf_sdio
 	if (try_cnt > MAX_KSO_ATTEMPTS)
 		brcmf_err("max tries: rd_val=0x%x err=%d\n", rd_val, err);
 
+	if (on)
+		sdio_retune_release(bus->sdiodev->func1);
+
+	sdio_retune_crc_enable(bus->sdiodev->func1);
+
 	return err;
 }
 
@@ -3373,11 +3384,7 @@ err:
 
 static bool brcmf_sdio_aos_no_decode(struct brcmf_sdio *bus)
 {
-	if (bus->ci->chip == CY_CC_43012_CHIP_ID ||
-	    bus->ci->chip == CY_CC_4373_CHIP_ID ||
-	    bus->ci->chip == BRCM_CC_4339_CHIP_ID ||
-	    bus->ci->chip == BRCM_CC_4345_CHIP_ID ||
-	    bus->ci->chip == BRCM_CC_4354_CHIP_ID)
+	if (bus->ci->chip == CY_CC_43012_CHIP_ID)
 		return true;
 	else
 		return false;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/nvme/host/core.c linux-libre-5.1.15-gnu/drivers/nvme/host/core.c
--- linux-libre-5.1.14-gnu/drivers/nvme/host/core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/nvme/host/core.c	2019-06-24 23:34:56.000000000 -0400
@@ -3397,7 +3397,8 @@ static int nvme_scan_ns_list(struct nvme
 {
 	struct nvme_ns *ns;
 	__le32 *ns_list;
-	unsigned i, j, nsid, prev = 0, num_lists = DIV_ROUND_UP(nn, 1024);
+	unsigned i, j, nsid, prev = 0;
+	unsigned num_lists = DIV_ROUND_UP_ULL((u64)nn, 1024);
 	int ret = 0;
 
 	ns_list = kzalloc(NVME_IDENTIFY_DATA_SIZE, GFP_KERNEL);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/nvme/target/io-cmd-bdev.c linux-libre-5.1.15-gnu/drivers/nvme/target/io-cmd-bdev.c
--- linux-libre-5.1.14-gnu/drivers/nvme/target/io-cmd-bdev.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/nvme/target/io-cmd-bdev.c	2019-06-24 23:34:56.000000000 -0400
@@ -295,6 +295,7 @@ u16 nvmet_bdev_parse_io_cmd(struct nvmet
 		return 0;
 	case nvme_cmd_write_zeroes:
 		req->execute = nvmet_bdev_execute_write_zeroes;
+		req->data_len = 0;
 		return 0;
 	default:
 		pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode,
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/parport/share.c linux-libre-5.1.15-gnu/drivers/parport/share.c
--- linux-libre-5.1.14-gnu/drivers/parport/share.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/parport/share.c	2019-06-24 23:34:56.000000000 -0400
@@ -895,6 +895,7 @@ parport_register_dev_model(struct parpor
 	par_dev->devmodel = true;
 	ret = device_register(&par_dev->dev);
 	if (ret) {
+		kfree(par_dev->state);
 		put_device(&par_dev->dev);
 		goto err_put_port;
 	}
@@ -912,6 +913,7 @@ parport_register_dev_model(struct parpor
 			spin_unlock(&port->physport->pardevice_lock);
 			pr_debug("%s: cannot grant exclusive access for device %s\n",
 				 port->name, name);
+			kfree(par_dev->state);
 			device_unregister(&par_dev->dev);
 			goto err_put_port;
 		}
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/s390/net/qeth_l2_main.c linux-libre-5.1.15-gnu/drivers/s390/net/qeth_l2_main.c
--- linux-libre-5.1.14-gnu/drivers/s390/net/qeth_l2_main.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/s390/net/qeth_l2_main.c	2019-06-24 23:34:56.000000000 -0400
@@ -1679,7 +1679,7 @@ static void qeth_bridgeport_an_set_cb(vo
 
 	l2entry = (struct qdio_brinfo_entry_l2 *)entry;
 	code = IPA_ADDR_CHANGE_CODE_MACADDR;
-	if (l2entry->addr_lnid.lnid)
+	if (l2entry->addr_lnid.lnid < VLAN_N_VID)
 		code |= IPA_ADDR_CHANGE_CODE_VLANID;
 	qeth_bridge_emit_host_event(card, anev_reg_unreg, code,
 		(struct net_if_token *)&l2entry->nit,
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/s390/net/qeth_l3_main.c linux-libre-5.1.15-gnu/drivers/s390/net/qeth_l3_main.c
--- linux-libre-5.1.14-gnu/drivers/s390/net/qeth_l3_main.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/s390/net/qeth_l3_main.c	2019-06-24 23:34:56.000000000 -0400
@@ -1883,13 +1883,20 @@ static int qeth_l3_do_ioctl(struct net_d
 
 static int qeth_l3_get_cast_type(struct sk_buff *skb)
 {
+	int ipv = qeth_get_ip_version(skb);
 	struct neighbour *n = NULL;
 	struct dst_entry *dst;
 
 	rcu_read_lock();
 	dst = skb_dst(skb);
-	if (dst)
-		n = dst_neigh_lookup_skb(dst, skb);
+	if (dst) {
+		struct rt6_info *rt = (struct rt6_info *) dst;
+
+		dst = dst_check(dst, (ipv == 6) ? rt6_get_cookie(rt) : 0);
+		if (dst)
+			n = dst_neigh_lookup_skb(dst, skb);
+	}
+
 	if (n) {
 		int cast_type = n->type;
 
@@ -1904,8 +1911,10 @@ static int qeth_l3_get_cast_type(struct
 	rcu_read_unlock();
 
 	/* no neighbour (eg AF_PACKET), fall back to target's IP address ... */
-	switch (qeth_get_ip_version(skb)) {
+	switch (ipv) {
 	case 4:
+		if (ipv4_is_lbcast(ip_hdr(skb)->daddr))
+			return RTN_BROADCAST;
 		return ipv4_is_multicast(ip_hdr(skb)->daddr) ?
 				RTN_MULTICAST : RTN_UNICAST;
 	case 6:
@@ -1941,6 +1950,7 @@ static void qeth_l3_fill_header(struct q
 	struct qeth_hdr_layer3 *l3_hdr = &hdr->hdr.l3;
 	struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
 	struct qeth_card *card = queue->card;
+	struct dst_entry *dst;
 
 	hdr->hdr.l3.length = data_len;
 
@@ -1991,15 +2001,27 @@ static void qeth_l3_fill_header(struct q
 
 	hdr->hdr.l3.flags = qeth_l3_cast_type_to_flag(cast_type);
 	rcu_read_lock();
+	dst = skb_dst(skb);
+
 	if (ipv == 4) {
-		struct rtable *rt = skb_rtable(skb);
+		struct rtable *rt;
+
+		if (dst)
+			dst = dst_check(dst, 0);
+		rt = (struct rtable *) dst;
 
 		*((__be32 *) &hdr->hdr.l3.next_hop.ipv4.addr) = (rt) ?
 				rt_nexthop(rt, ip_hdr(skb)->daddr) :
 				ip_hdr(skb)->daddr;
 	} else {
 		/* IPv6 */
-		const struct rt6_info *rt = skb_rt6_info(skb);
+		struct rt6_info *rt;
+
+		if (dst) {
+			rt = (struct rt6_info *) dst;
+			dst = dst_check(dst, rt6_get_cookie(rt));
+		}
+		rt = (struct rt6_info *) dst;
 
 		if (rt && !ipv6_addr_any(&rt->rt6i_gateway))
 			l3_hdr->next_hop.ipv6_addr = rt->rt6i_gateway;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/scsi/smartpqi/smartpqi_init.c linux-libre-5.1.15-gnu/drivers/scsi/smartpqi/smartpqi_init.c
--- linux-libre-5.1.14-gnu/drivers/scsi/smartpqi/smartpqi_init.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/scsi/smartpqi/smartpqi_init.c	2019-06-24 23:34:56.000000000 -0400
@@ -4044,8 +4044,10 @@ static int pqi_submit_raid_request_synch
 				return -ETIMEDOUT;
 			msecs_blocked =
 				jiffies_to_msecs(jiffies - start_jiffies);
-			if (msecs_blocked >= timeout_msecs)
-				return -ETIMEDOUT;
+			if (msecs_blocked >= timeout_msecs) {
+				rc = -ETIMEDOUT;
+				goto out;
+			}
 			timeout_msecs -= msecs_blocked;
 		}
 	}
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/scsi/ufs/ufshcd.c linux-libre-5.1.15-gnu/drivers/scsi/ufs/ufshcd.c
--- linux-libre-5.1.14-gnu/drivers/scsi/ufs/ufshcd.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/scsi/ufs/ufshcd.c	2019-06-24 23:34:56.000000000 -0400
@@ -1917,7 +1917,8 @@ int ufshcd_copy_query_response(struct uf
 	memcpy(&query_res->upiu_res, &lrbp->ucd_rsp_ptr->qr, QUERY_OSF_SIZE);
 
 	/* Get the descriptor */
-	if (lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
+	if (hba->dev_cmd.query.descriptor &&
+	    lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
 		u8 *descp = (u8 *)lrbp->ucd_rsp_ptr +
 				GENERAL_UPIU_REQUEST_SIZE;
 		u16 resp_len;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/scsi/ufs/ufshcd-pltfrm.c linux-libre-5.1.15-gnu/drivers/scsi/ufs/ufshcd-pltfrm.c
--- linux-libre-5.1.14-gnu/drivers/scsi/ufs/ufshcd-pltfrm.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/scsi/ufs/ufshcd-pltfrm.c	2019-06-24 23:34:56.000000000 -0400
@@ -340,24 +340,21 @@ int ufshcd_pltfrm_init(struct platform_d
 		goto dealloc_host;
 	}
 
-	pm_runtime_set_active(&pdev->dev);
-	pm_runtime_enable(&pdev->dev);
-
 	ufshcd_init_lanes_per_dir(hba);
 
 	err = ufshcd_init(hba, mmio_base, irq);
 	if (err) {
 		dev_err(dev, "Initialization failed\n");
-		goto out_disable_rpm;
+		goto dealloc_host;
 	}
 
 	platform_set_drvdata(pdev, hba);
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+
 	return 0;
 
-out_disable_rpm:
-	pm_runtime_disable(&pdev->dev);
-	pm_runtime_set_suspended(&pdev->dev);
 dealloc_host:
 	ufshcd_dealloc_host(hba);
 out:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/staging/erofs/erofs_fs.h linux-libre-5.1.15-gnu/drivers/staging/erofs/erofs_fs.h
--- linux-libre-5.1.14-gnu/drivers/staging/erofs/erofs_fs.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/staging/erofs/erofs_fs.h	2019-06-24 23:34:56.000000000 -0400
@@ -17,10 +17,16 @@
 #define EROFS_SUPER_MAGIC_V1    0xE0F5E1E2
 #define EROFS_SUPER_OFFSET      1024
 
+/*
+ * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be
+ * incompatible with this kernel version.
+ */
+#define EROFS_ALL_REQUIREMENTS  0
+
 struct erofs_super_block {
 /*  0 */__le32 magic;           /* in the little endian */
 /*  4 */__le32 checksum;        /* crc32c(super_block) */
-/*  8 */__le32 features;
+/*  8 */__le32 features;        /* (aka. feature_compat) */
 /* 12 */__u8 blkszbits;         /* support block_size == PAGE_SIZE only */
 /* 13 */__u8 reserved;
 
@@ -34,9 +40,10 @@ struct erofs_super_block {
 /* 44 */__le32 xattr_blkaddr;
 /* 48 */__u8 uuid[16];          /* 128-bit uuid for volume */
 /* 64 */__u8 volume_name[16];   /* volume name */
+/* 80 */__le32 requirements;    /* (aka. feature_incompat) */
 
-/* 80 */__u8 reserved2[48];     /* 128 bytes */
-} __packed;
+/* 84 */__u8 reserved2[44];
+} __packed;                     /* 128 bytes */
 
 /*
  * erofs inode data mapping:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/staging/erofs/internal.h linux-libre-5.1.15-gnu/drivers/staging/erofs/internal.h
--- linux-libre-5.1.14-gnu/drivers/staging/erofs/internal.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/staging/erofs/internal.h	2019-06-24 23:34:56.000000000 -0400
@@ -114,6 +114,8 @@ struct erofs_sb_info {
 
 	u8 uuid[16];                    /* 128-bit uuid for volume */
 	u8 volume_name[16];             /* volume name */
+	u32 requirements;
+
 	char *dev_name;
 
 	unsigned int mount_opt;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/staging/erofs/super.c linux-libre-5.1.15-gnu/drivers/staging/erofs/super.c
--- linux-libre-5.1.14-gnu/drivers/staging/erofs/super.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/staging/erofs/super.c	2019-06-24 23:34:56.000000000 -0400
@@ -76,6 +76,22 @@ static void destroy_inode(struct inode *
 	call_rcu(&inode->i_rcu, i_callback);
 }
 
+static bool check_layout_compatibility(struct super_block *sb,
+				       struct erofs_super_block *layout)
+{
+	const unsigned int requirements = le32_to_cpu(layout->requirements);
+
+	EROFS_SB(sb)->requirements = requirements;
+
+	/* check if current kernel meets all mandatory requirements */
+	if (requirements & (~EROFS_ALL_REQUIREMENTS)) {
+		errln("unidentified requirements %x, please upgrade kernel version",
+		      requirements & ~EROFS_ALL_REQUIREMENTS);
+		return false;
+	}
+	return true;
+}
+
 static int superblock_read(struct super_block *sb)
 {
 	struct erofs_sb_info *sbi;
@@ -109,6 +125,9 @@ static int superblock_read(struct super_
 		goto out;
 	}
 
+	if (!check_layout_compatibility(sb, layout))
+		goto out;
+
 	sbi->blocks = le32_to_cpu(layout->blocks);
 	sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr);
 #ifdef CONFIG_EROFS_FS_XATTR
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/usb/chipidea/udc.c linux-libre-5.1.15-gnu/drivers/usb/chipidea/udc.c
--- linux-libre-5.1.14-gnu/drivers/usb/chipidea/udc.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/usb/chipidea/udc.c	2019-06-24 23:34:56.000000000 -0400
@@ -1622,6 +1622,25 @@ static int ci_udc_pullup(struct usb_gadg
 static int ci_udc_start(struct usb_gadget *gadget,
 			 struct usb_gadget_driver *driver);
 static int ci_udc_stop(struct usb_gadget *gadget);
+
+/* Match ISOC IN from the highest endpoint */
+static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
+			      struct usb_endpoint_descriptor *desc,
+			      struct usb_ss_ep_comp_descriptor *comp_desc)
+{
+	struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
+	struct usb_ep *ep;
+
+	if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
+		list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
+			if (ep->caps.dir_in && !ep->claimed)
+				return ep;
+		}
+	}
+
+	return NULL;
+}
+
 /**
  * Device operations part of the API to the USB controller hardware,
  * which don't involve endpoints (or i/o)
@@ -1635,6 +1654,7 @@ static const struct usb_gadget_ops usb_g
 	.vbus_draw	= ci_udc_vbus_draw,
 	.udc_start	= ci_udc_start,
 	.udc_stop	= ci_udc_stop,
+	.match_ep 	= ci_udc_match_ep,
 };
 
 static int init_eps(struct ci_hdrc *ci)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/usb/host/xhci.c linux-libre-5.1.15-gnu/drivers/usb/host/xhci.c
--- linux-libre-5.1.14-gnu/drivers/usb/host/xhci.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/usb/host/xhci.c	2019-06-24 23:34:56.000000000 -0400
@@ -1442,6 +1442,10 @@ static int xhci_urb_enqueue(struct usb_h
 			xhci_dbg(xhci, "urb submitted during PCI suspend\n");
 		return -ESHUTDOWN;
 	}
+	if (xhci->devs[slot_id]->flags & VDEV_PORT_ERROR) {
+		xhci_dbg(xhci, "Can't queue urb, port error, link inactive\n");
+		return -ENODEV;
+	}
 
 	if (usb_endpoint_xfer_isoc(&urb->ep->desc))
 		num_tds = urb->number_of_packets;
@@ -3724,6 +3728,7 @@ static int xhci_discover_or_reset_device
 	}
 	/* If necessary, update the number of active TTs on this root port */
 	xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps);
+	virt_dev->flags = 0;
 	ret = 0;
 
 command_cleanup:
@@ -5029,16 +5034,26 @@ int xhci_gen_setup(struct usb_hcd *hcd,
 	} else {
 		/*
 		 * Some 3.1 hosts return sbrn 0x30, use xhci supported protocol
-		 * minor revision instead of sbrn
+		 * minor revision instead of sbrn. Minor revision is a two digit
+		 * BCD containing minor and sub-minor numbers, only show minor.
 		 */
-		minor_rev = xhci->usb3_rhub.min_rev;
-		if (minor_rev) {
+		minor_rev = xhci->usb3_rhub.min_rev / 0x10;
+
+		switch (minor_rev) {
+		case 2:
+			hcd->speed = HCD_USB32;
+			hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
+			hcd->self.root_hub->rx_lanes = 2;
+			hcd->self.root_hub->tx_lanes = 2;
+			break;
+		case 1:
 			hcd->speed = HCD_USB31;
 			hcd->self.root_hub->speed = USB_SPEED_SUPER_PLUS;
+			break;
 		}
-		xhci_info(xhci, "Host supports USB 3.%x %s SuperSpeed\n",
+		xhci_info(xhci, "Host supports USB 3.%x %sSuperSpeed\n",
 			  minor_rev,
-			  minor_rev ? "Enhanced" : "");
+			  minor_rev ? "Enhanced " : "");
 
 		xhci->usb3_rhub.hcd = hcd;
 		/* xHCI private pointer was set in xhci_pci_probe for the second
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/usb/host/xhci.h linux-libre-5.1.15-gnu/drivers/usb/host/xhci.h
--- linux-libre-5.1.14-gnu/drivers/usb/host/xhci.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/usb/host/xhci.h	2019-06-24 23:34:56.000000000 -0400
@@ -1010,6 +1010,15 @@ struct xhci_virt_device {
 	u8				real_port;
 	struct xhci_interval_bw_table	*bw_table;
 	struct xhci_tt_bw_info		*tt_info;
+	/*
+	 * flags for state tracking based on events and issued commands.
+	 * Software can not rely on states from output contexts because of
+	 * latency between events and xHC updating output context values.
+	 * See xhci 1.1 section 4.8.3 for more details
+	 */
+	unsigned long			flags;
+#define VDEV_PORT_ERROR			BIT(0) /* Port error, link inactive */
+
 	/* The current max exit latency for the enabled USB3 link states. */
 	u16				current_mel;
 	/* Used for the debugfs interfaces. */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/drivers/usb/host/xhci-ring.c linux-libre-5.1.15-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-5.1.14-gnu/drivers/usb/host/xhci-ring.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/drivers/usb/host/xhci-ring.c	2019-06-24 23:34:56.000000000 -0400
@@ -1608,8 +1608,13 @@ static void handle_port_status(struct xh
 		usb_hcd_resume_root_hub(hcd);
 	}
 
-	if (hcd->speed >= HCD_USB3 && (portsc & PORT_PLS_MASK) == XDEV_INACTIVE)
+	if (hcd->speed >= HCD_USB3 &&
+	    (portsc & PORT_PLS_MASK) == XDEV_INACTIVE) {
+		slot_id = xhci_find_slot_id_by_port(hcd, xhci, hcd_portnum + 1);
+		if (slot_id && xhci->devs[slot_id])
+			xhci->devs[slot_id]->flags |= VDEV_PORT_ERROR;
 		bus_state->port_remote_wakeup &= ~(1 << hcd_portnum);
+	}
 
 	if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_RESUME) {
 		xhci_dbg(xhci, "port resume event for port %d\n", port_id);
@@ -1797,6 +1802,14 @@ static void xhci_cleanup_halted_endpoint
 {
 	struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index];
 	struct xhci_command *command;
+
+	/*
+	 * Avoid resetting endpoint if link is inactive. Can cause host hang.
+	 * Device will be reset soon to recover the link so don't do anything
+	 */
+	if (xhci->devs[slot_id]->flags & VDEV_PORT_ERROR)
+		return;
+
 	command = xhci_alloc_command(xhci, false, GFP_ATOMIC);
 	if (!command)
 		return;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/btrfs/reada.c linux-libre-5.1.15-gnu/fs/btrfs/reada.c
--- linux-libre-5.1.14-gnu/fs/btrfs/reada.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/btrfs/reada.c	2019-06-24 23:34:56.000000000 -0400
@@ -747,6 +747,7 @@ static void __reada_start_machine(struct
 	u64 total = 0;
 	int i;
 
+again:
 	do {
 		enqueued = 0;
 		mutex_lock(&fs_devices->device_list_mutex);
@@ -758,6 +759,10 @@ static void __reada_start_machine(struct
 		mutex_unlock(&fs_devices->device_list_mutex);
 		total += enqueued;
 	} while (enqueued && total < 10000);
+	if (fs_devices->seed) {
+		fs_devices = fs_devices->seed;
+		goto again;
+	}
 
 	if (enqueued == 0)
 		return;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/cifs/cifsfs.c linux-libre-5.1.15-gnu/fs/cifs/cifsfs.c
--- linux-libre-5.1.14-gnu/fs/cifs/cifsfs.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/cifs/cifsfs.c	2019-06-24 23:34:56.000000000 -0400
@@ -303,6 +303,7 @@ cifs_alloc_inode(struct super_block *sb)
 	cifs_inode->uniqueid = 0;
 	cifs_inode->createtime = 0;
 	cifs_inode->epoch = 0;
+	spin_lock_init(&cifs_inode->open_file_lock);
 	generate_random_uuid(cifs_inode->lease_key);
 
 	/*
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/cifs/cifsglob.h linux-libre-5.1.15-gnu/fs/cifs/cifsglob.h
--- linux-libre-5.1.14-gnu/fs/cifs/cifsglob.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/cifs/cifsglob.h	2019-06-24 23:34:56.000000000 -0400
@@ -1357,6 +1357,7 @@ struct cifsInodeInfo {
 	struct rw_semaphore lock_sem;	/* protect the fields above */
 	/* BB add in lists for dirty pages i.e. write caching info for oplock */
 	struct list_head openFileList;
+	spinlock_t	open_file_lock;	/* protects openFileList */
 	__u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
 	unsigned int oplock;		/* oplock/lease level we have */
 	unsigned int epoch;		/* used to track lease state changes */
@@ -1760,10 +1761,14 @@ require use of the stronger protocol */
  *  tcp_ses_lock protects:
  *	list operations on tcp and SMB session lists
  *  tcon->open_file_lock protects the list of open files hanging off the tcon
+ *  inode->open_file_lock protects the openFileList hanging off the inode
  *  cfile->file_info_lock protects counters and fields in cifs file struct
  *  f_owner.lock protects certain per file struct operations
  *  mapping->page_lock protects certain per page operations
  *
+ *  Note that the cifs_tcon.open_file_lock should be taken before
+ *  not after the cifsInodeInfo.open_file_lock
+ *
  *  Semaphores
  *  ----------
  *  sesSem     operations on smb session
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/cifs/connect.c linux-libre-5.1.15-gnu/fs/cifs/connect.c
--- linux-libre-5.1.14-gnu/fs/cifs/connect.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/cifs/connect.c	2019-06-24 23:34:56.000000000 -0400
@@ -478,6 +478,7 @@ cifs_reconnect(struct TCP_Server_Info *s
 	spin_lock(&GlobalMid_Lock);
 	server->nr_targets = 1;
 #ifdef CONFIG_CIFS_DFS_UPCALL
+	spin_unlock(&GlobalMid_Lock);
 	cifs_sb = find_super_by_tcp(server);
 	if (IS_ERR(cifs_sb)) {
 		rc = PTR_ERR(cifs_sb);
@@ -495,6 +496,7 @@ cifs_reconnect(struct TCP_Server_Info *s
 	}
 	cifs_dbg(FYI, "%s: will retry %d target(s)\n", __func__,
 		 server->nr_targets);
+	spin_lock(&GlobalMid_Lock);
 #endif
 	if (server->tcpStatus == CifsExiting) {
 		/* the demux thread will exit normally
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/cifs/file.c linux-libre-5.1.15-gnu/fs/cifs/file.c
--- linux-libre-5.1.14-gnu/fs/cifs/file.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/cifs/file.c	2019-06-24 23:34:56.000000000 -0400
@@ -338,10 +338,12 @@ cifs_new_fileinfo(struct cifs_fid *fid,
 	atomic_inc(&tcon->num_local_opens);
 
 	/* if readable file instance put first in list*/
+	spin_lock(&cinode->open_file_lock);
 	if (file->f_mode & FMODE_READ)
 		list_add(&cfile->flist, &cinode->openFileList);
 	else
 		list_add_tail(&cfile->flist, &cinode->openFileList);
+	spin_unlock(&cinode->open_file_lock);
 	spin_unlock(&tcon->open_file_lock);
 
 	if (fid->purge_cache)
@@ -413,7 +415,9 @@ void _cifsFileInfo_put(struct cifsFileIn
 	cifs_add_pending_open_locked(&fid, cifs_file->tlink, &open);
 
 	/* remove it from the lists */
+	spin_lock(&cifsi->open_file_lock);
 	list_del(&cifs_file->flist);
+	spin_unlock(&cifsi->open_file_lock);
 	list_del(&cifs_file->tlist);
 	atomic_dec(&tcon->num_local_opens);
 
@@ -1950,9 +1954,9 @@ refind_writable:
 			return 0;
 		}
 
-		spin_lock(&tcon->open_file_lock);
+		spin_lock(&cifs_inode->open_file_lock);
 		list_move_tail(&inv_file->flist, &cifs_inode->openFileList);
-		spin_unlock(&tcon->open_file_lock);
+		spin_unlock(&cifs_inode->open_file_lock);
 		cifsFileInfo_put(inv_file);
 		++refind;
 		inv_file = NULL;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/cifs/smb2maperror.c linux-libre-5.1.15-gnu/fs/cifs/smb2maperror.c
--- linux-libre-5.1.14-gnu/fs/cifs/smb2maperror.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/cifs/smb2maperror.c	2019-06-24 23:34:56.000000000 -0400
@@ -457,7 +457,7 @@ static const struct status_to_posix_erro
 	{STATUS_FILE_INVALID, -EIO, "STATUS_FILE_INVALID"},
 	{STATUS_ALLOTTED_SPACE_EXCEEDED, -EIO,
 	"STATUS_ALLOTTED_SPACE_EXCEEDED"},
-	{STATUS_INSUFFICIENT_RESOURCES, -EREMOTEIO,
+	{STATUS_INSUFFICIENT_RESOURCES, -EAGAIN,
 				"STATUS_INSUFFICIENT_RESOURCES"},
 	{STATUS_DFS_EXIT_PATH_FOUND, -EIO, "STATUS_DFS_EXIT_PATH_FOUND"},
 	{STATUS_DEVICE_DATA_ERROR, -EIO, "STATUS_DEVICE_DATA_ERROR"},
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/namespace.c linux-libre-5.1.15-gnu/fs/namespace.c
--- linux-libre-5.1.14-gnu/fs/namespace.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/namespace.c	2019-06-24 23:34:56.000000000 -0400
@@ -2079,6 +2079,7 @@ static int attach_recursive_mnt(struct m
 		/* Notice when we are propagating across user namespaces */
 		if (child->mnt_parent->mnt_ns->user_ns != user_ns)
 			lock_mnt_tree(child);
+		child->mnt.mnt_flags &= ~MNT_LOCKED;
 		commit_tree(child);
 	}
 	put_mountpoint(smp);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/inode.c linux-libre-5.1.15-gnu/fs/overlayfs/inode.c
--- linux-libre-5.1.14-gnu/fs/overlayfs/inode.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/inode.c	2019-06-24 23:34:56.000000000 -0400
@@ -553,15 +553,15 @@ static void ovl_fill_inode(struct inode
 	int xinobits = ovl_xino_bits(inode->i_sb);
 
 	/*
-	 * When NFS export is enabled and d_ino is consistent with st_ino
-	 * (samefs or i_ino has enough bits to encode layer), set the same
-	 * value used for d_ino to i_ino, because nfsd readdirplus compares
-	 * d_ino values to i_ino values of child entries. When called from
+	 * When d_ino is consistent with st_ino (samefs or i_ino has enough
+	 * bits to encode layer), set the same value used for st_ino to i_ino,
+	 * so inode number exposed via /proc/locks and a like will be
+	 * consistent with d_ino and st_ino values. An i_ino value inconsistent
+	 * with d_ino also causes nfsd readdirplus to fail.  When called from
 	 * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real
 	 * upper inode i_ino on ovl_inode_init() or ovl_inode_update().
 	 */
-	if (inode->i_sb->s_export_op &&
-	    (ovl_same_sb(inode->i_sb) || xinobits)) {
+	if (ovl_same_sb(inode->i_sb) || xinobits) {
 		inode->i_ino = ino;
 		if (xinobits && fsid && !(ino >> (64 - xinobits)))
 			inode->i_ino |= (unsigned long)fsid << (64 - xinobits);
@@ -777,6 +777,54 @@ struct inode *ovl_lookup_inode(struct su
 	return inode;
 }
 
+bool ovl_lookup_trap_inode(struct super_block *sb, struct dentry *dir)
+{
+	struct inode *key = d_inode(dir);
+	struct inode *trap;
+	bool res;
+
+	trap = ilookup5(sb, (unsigned long) key, ovl_inode_test, key);
+	if (!trap)
+		return false;
+
+	res = IS_DEADDIR(trap) && !ovl_inode_upper(trap) &&
+				  !ovl_inode_lower(trap);
+
+	iput(trap);
+	return res;
+}
+
+/*
+ * Create an inode cache entry for layer root dir, that will intentionally
+ * fail ovl_verify_inode(), so any lookup that will find some layer root
+ * will fail.
+ */
+struct inode *ovl_get_trap_inode(struct super_block *sb, struct dentry *dir)
+{
+	struct inode *key = d_inode(dir);
+	struct inode *trap;
+
+	if (!d_is_dir(dir))
+		return ERR_PTR(-ENOTDIR);
+
+	trap = iget5_locked(sb, (unsigned long) key, ovl_inode_test,
+			    ovl_inode_set, key);
+	if (!trap)
+		return ERR_PTR(-ENOMEM);
+
+	if (!(trap->i_state & I_NEW)) {
+		/* Conflicting layer roots? */
+		iput(trap);
+		return ERR_PTR(-ELOOP);
+	}
+
+	trap->i_mode = S_IFDIR;
+	trap->i_flags = S_DEAD;
+	unlock_new_inode(trap);
+
+	return trap;
+}
+
 /*
  * Does overlay inode need to be hashed by lower inode?
  */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/namei.c linux-libre-5.1.15-gnu/fs/overlayfs/namei.c
--- linux-libre-5.1.14-gnu/fs/overlayfs/namei.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/namei.c	2019-06-24 23:34:56.000000000 -0400
@@ -18,6 +18,7 @@
 #include "overlayfs.h"
 
 struct ovl_lookup_data {
+	struct super_block *sb;
 	struct qstr name;
 	bool is_dir;
 	bool opaque;
@@ -244,6 +245,12 @@ static int ovl_lookup_single(struct dent
 		if (!d->metacopy || d->last)
 			goto out;
 	} else {
+		if (ovl_lookup_trap_inode(d->sb, this)) {
+			/* Caught in a trap of overlapping layers */
+			err = -ELOOP;
+			goto out_err;
+		}
+
 		if (last_element)
 			d->is_dir = true;
 		if (d->last)
@@ -819,6 +826,7 @@ struct dentry *ovl_lookup(struct inode *
 	int err;
 	bool metacopy = false;
 	struct ovl_lookup_data d = {
+		.sb = dentry->d_sb,
 		.name = dentry->d_name,
 		.is_dir = false,
 		.opaque = false,
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/overlayfs.h linux-libre-5.1.15-gnu/fs/overlayfs/overlayfs.h
--- linux-libre-5.1.14-gnu/fs/overlayfs/overlayfs.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/overlayfs.h	2019-06-24 23:34:56.000000000 -0400
@@ -270,6 +270,7 @@ void ovl_clear_flag(unsigned long flag,
 bool ovl_test_flag(unsigned long flag, struct inode *inode);
 bool ovl_inuse_trylock(struct dentry *dentry);
 void ovl_inuse_unlock(struct dentry *dentry);
+bool ovl_is_inuse(struct dentry *dentry);
 bool ovl_need_index(struct dentry *dentry);
 int ovl_nlink_start(struct dentry *dentry);
 void ovl_nlink_end(struct dentry *dentry);
@@ -376,6 +377,8 @@ struct ovl_inode_params {
 struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev);
 struct inode *ovl_lookup_inode(struct super_block *sb, struct dentry *real,
 			       bool is_upper);
+bool ovl_lookup_trap_inode(struct super_block *sb, struct dentry *dir);
+struct inode *ovl_get_trap_inode(struct super_block *sb, struct dentry *dir);
 struct inode *ovl_get_inode(struct super_block *sb,
 			    struct ovl_inode_params *oip);
 static inline void ovl_copyattr(struct inode *from, struct inode *to)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/ovl_entry.h linux-libre-5.1.15-gnu/fs/overlayfs/ovl_entry.h
--- linux-libre-5.1.14-gnu/fs/overlayfs/ovl_entry.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/ovl_entry.h	2019-06-24 23:34:56.000000000 -0400
@@ -29,6 +29,8 @@ struct ovl_sb {
 
 struct ovl_layer {
 	struct vfsmount *mnt;
+	/* Trap in ovl inode cache */
+	struct inode *trap;
 	struct ovl_sb *fs;
 	/* Index of this layer in fs root (upper idx == 0) */
 	int idx;
@@ -65,6 +67,10 @@ struct ovl_fs {
 	/* Did we take the inuse lock? */
 	bool upperdir_locked;
 	bool workdir_locked;
+	/* Traps in ovl inode cache */
+	struct inode *upperdir_trap;
+	struct inode *workdir_trap;
+	struct inode *indexdir_trap;
 	/* Inode numbers in all layers do not use the high xino_bits */
 	unsigned int xino_bits;
 };
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/super.c linux-libre-5.1.15-gnu/fs/overlayfs/super.c
--- linux-libre-5.1.14-gnu/fs/overlayfs/super.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/super.c	2019-06-24 23:34:56.000000000 -0400
@@ -217,6 +217,9 @@ static void ovl_free_fs(struct ovl_fs *o
 {
 	unsigned i;
 
+	iput(ofs->indexdir_trap);
+	iput(ofs->workdir_trap);
+	iput(ofs->upperdir_trap);
 	dput(ofs->indexdir);
 	dput(ofs->workdir);
 	if (ofs->workdir_locked)
@@ -225,8 +228,10 @@ static void ovl_free_fs(struct ovl_fs *o
 	if (ofs->upperdir_locked)
 		ovl_inuse_unlock(ofs->upper_mnt->mnt_root);
 	mntput(ofs->upper_mnt);
-	for (i = 0; i < ofs->numlower; i++)
+	for (i = 0; i < ofs->numlower; i++) {
+		iput(ofs->lower_layers[i].trap);
 		mntput(ofs->lower_layers[i].mnt);
+	}
 	for (i = 0; i < ofs->numlowerfs; i++)
 		free_anon_bdev(ofs->lower_fs[i].pseudo_dev);
 	kfree(ofs->lower_layers);
@@ -984,7 +989,26 @@ static const struct xattr_handler *ovl_x
 	NULL
 };
 
-static int ovl_get_upper(struct ovl_fs *ofs, struct path *upperpath)
+static int ovl_setup_trap(struct super_block *sb, struct dentry *dir,
+			  struct inode **ptrap, const char *name)
+{
+	struct inode *trap;
+	int err;
+
+	trap = ovl_get_trap_inode(sb, dir);
+	err = PTR_ERR_OR_ZERO(trap);
+	if (err) {
+		if (err == -ELOOP)
+			pr_err("overlayfs: conflicting %s path\n", name);
+		return err;
+	}
+
+	*ptrap = trap;
+	return 0;
+}
+
+static int ovl_get_upper(struct super_block *sb, struct ovl_fs *ofs,
+			 struct path *upperpath)
 {
 	struct vfsmount *upper_mnt;
 	int err;
@@ -1004,6 +1028,11 @@ static int ovl_get_upper(struct ovl_fs *
 	if (err)
 		goto out;
 
+	err = ovl_setup_trap(sb, upperpath->dentry, &ofs->upperdir_trap,
+			     "upperdir");
+	if (err)
+		goto out;
+
 	upper_mnt = clone_private_mount(upperpath);
 	err = PTR_ERR(upper_mnt);
 	if (IS_ERR(upper_mnt)) {
@@ -1030,7 +1059,8 @@ out:
 	return err;
 }
 
-static int ovl_make_workdir(struct ovl_fs *ofs, struct path *workpath)
+static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
+			    struct path *workpath)
 {
 	struct vfsmount *mnt = ofs->upper_mnt;
 	struct dentry *temp;
@@ -1045,6 +1075,10 @@ static int ovl_make_workdir(struct ovl_f
 	if (!ofs->workdir)
 		goto out;
 
+	err = ovl_setup_trap(sb, ofs->workdir, &ofs->workdir_trap, "workdir");
+	if (err)
+		goto out;
+
 	/*
 	 * Upper should support d_type, else whiteouts are visible.  Given
 	 * workdir and upper are on same fs, we can do iterate_dir() on
@@ -1105,7 +1139,8 @@ out:
 	return err;
 }
 
-static int ovl_get_workdir(struct ovl_fs *ofs, struct path *upperpath)
+static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs,
+			   struct path *upperpath)
 {
 	int err;
 	struct path workpath = { };
@@ -1136,19 +1171,16 @@ static int ovl_get_workdir(struct ovl_fs
 		pr_warn("overlayfs: workdir is in-use by another mount, accessing files from both mounts will result in undefined behavior.\n");
 	}
 
-	err = ovl_make_workdir(ofs, &workpath);
-	if (err)
-		goto out;
+	err = ovl_make_workdir(sb, ofs, &workpath);
 
-	err = 0;
 out:
 	path_put(&workpath);
 
 	return err;
 }
 
-static int ovl_get_indexdir(struct ovl_fs *ofs, struct ovl_entry *oe,
-			    struct path *upperpath)
+static int ovl_get_indexdir(struct super_block *sb, struct ovl_fs *ofs,
+			    struct ovl_entry *oe, struct path *upperpath)
 {
 	struct vfsmount *mnt = ofs->upper_mnt;
 	int err;
@@ -1167,6 +1199,11 @@ static int ovl_get_indexdir(struct ovl_f
 
 	ofs->indexdir = ovl_workdir_create(ofs, OVL_INDEXDIR_NAME, true);
 	if (ofs->indexdir) {
+		err = ovl_setup_trap(sb, ofs->indexdir, &ofs->indexdir_trap,
+				     "indexdir");
+		if (err)
+			goto out;
+
 		/*
 		 * Verify upper root is exclusively associated with index dir.
 		 * Older kernels stored upper fh in "trusted.overlay.origin"
@@ -1254,8 +1291,8 @@ static int ovl_get_fsid(struct ovl_fs *o
 	return ofs->numlowerfs;
 }
 
-static int ovl_get_lower_layers(struct ovl_fs *ofs, struct path *stack,
-				unsigned int numlower)
+static int ovl_get_lower_layers(struct super_block *sb, struct ovl_fs *ofs,
+				struct path *stack, unsigned int numlower)
 {
 	int err;
 	unsigned int i;
@@ -1273,16 +1310,28 @@ static int ovl_get_lower_layers(struct o
 
 	for (i = 0; i < numlower; i++) {
 		struct vfsmount *mnt;
+		struct inode *trap;
 		int fsid;
 
 		err = fsid = ovl_get_fsid(ofs, &stack[i]);
 		if (err < 0)
 			goto out;
 
+		err = -EBUSY;
+		if (ovl_is_inuse(stack[i].dentry)) {
+			pr_err("overlayfs: lowerdir is in-use as upperdir/workdir\n");
+			goto out;
+		}
+
+		err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir");
+		if (err)
+			goto out;
+
 		mnt = clone_private_mount(&stack[i]);
 		err = PTR_ERR(mnt);
 		if (IS_ERR(mnt)) {
 			pr_err("overlayfs: failed to clone lowerpath\n");
+			iput(trap);
 			goto out;
 		}
 
@@ -1292,6 +1341,7 @@ static int ovl_get_lower_layers(struct o
 		 */
 		mnt->mnt_flags |= MNT_READONLY | MNT_NOATIME;
 
+		ofs->lower_layers[ofs->numlower].trap = trap;
 		ofs->lower_layers[ofs->numlower].mnt = mnt;
 		ofs->lower_layers[ofs->numlower].idx = i + 1;
 		ofs->lower_layers[ofs->numlower].fsid = fsid;
@@ -1386,7 +1436,7 @@ static struct ovl_entry *ovl_get_lowerst
 		goto out_err;
 	}
 
-	err = ovl_get_lower_layers(ofs, stack, numlower);
+	err = ovl_get_lower_layers(sb, ofs, stack, numlower);
 	if (err)
 		goto out_err;
 
@@ -1418,6 +1468,77 @@ out_err:
 	goto out;
 }
 
+/*
+ * Check if this layer root is a descendant of:
+ * - another layer of this overlayfs instance
+ * - upper/work dir of any overlayfs instance
+ */
+static int ovl_check_layer(struct super_block *sb, struct dentry *dentry,
+			   const char *name)
+{
+	struct dentry *next = dentry, *parent;
+	int err = 0;
+
+	if (!dentry)
+		return 0;
+
+	parent = dget_parent(next);
+
+	/* Walk back ancestors to root (inclusive) looking for traps */
+	while (!err && parent != next) {
+		if (ovl_is_inuse(parent)) {
+			err = -EBUSY;
+			pr_err("overlayfs: %s path overlapping in-use upperdir/workdir\n",
+			       name);
+		} else if (ovl_lookup_trap_inode(sb, parent)) {
+			err = -ELOOP;
+			pr_err("overlayfs: overlapping %s path\n", name);
+		}
+		next = parent;
+		parent = dget_parent(next);
+		dput(next);
+	}
+
+	dput(parent);
+
+	return err;
+}
+
+/*
+ * Check if any of the layers or work dirs overlap.
+ */
+static int ovl_check_overlapping_layers(struct super_block *sb,
+					struct ovl_fs *ofs)
+{
+	int i, err;
+
+	if (ofs->upper_mnt) {
+		err = ovl_check_layer(sb, ofs->upper_mnt->mnt_root, "upperdir");
+		if (err)
+			return err;
+
+		/*
+		 * Checking workbasedir avoids hitting ovl_is_inuse(parent) of
+		 * this instance and covers overlapping work and index dirs,
+		 * unless work or index dir have been moved since created inside
+		 * workbasedir.  In that case, we already have their traps in
+		 * inode cache and we will catch that case on lookup.
+		 */
+		err = ovl_check_layer(sb, ofs->workbasedir, "workdir");
+		if (err)
+			return err;
+	}
+
+	for (i = 0; i < ofs->numlower; i++) {
+		err = ovl_check_layer(sb, ofs->lower_layers[i].mnt->mnt_root,
+				      "lowerdir");
+		if (err)
+			return err;
+	}
+
+	return 0;
+}
+
 static int ovl_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct path upperpath = { };
@@ -1457,17 +1578,20 @@ static int ovl_fill_super(struct super_b
 	if (ofs->config.xino != OVL_XINO_OFF)
 		ofs->xino_bits = BITS_PER_LONG - 32;
 
+	/* alloc/destroy_inode needed for setting up traps in inode cache */
+	sb->s_op = &ovl_super_operations;
+
 	if (ofs->config.upperdir) {
 		if (!ofs->config.workdir) {
 			pr_err("overlayfs: missing 'workdir'\n");
 			goto out_err;
 		}
 
-		err = ovl_get_upper(ofs, &upperpath);
+		err = ovl_get_upper(sb, ofs, &upperpath);
 		if (err)
 			goto out_err;
 
-		err = ovl_get_workdir(ofs, &upperpath);
+		err = ovl_get_workdir(sb, ofs, &upperpath);
 		if (err)
 			goto out_err;
 
@@ -1488,7 +1612,7 @@ static int ovl_fill_super(struct super_b
 		sb->s_flags |= SB_RDONLY;
 
 	if (!(ovl_force_readonly(ofs)) && ofs->config.index) {
-		err = ovl_get_indexdir(ofs, oe, &upperpath);
+		err = ovl_get_indexdir(sb, ofs, oe, &upperpath);
 		if (err)
 			goto out_free_oe;
 
@@ -1501,6 +1625,10 @@ static int ovl_fill_super(struct super_b
 
 	}
 
+	err = ovl_check_overlapping_layers(sb, ofs);
+	if (err)
+		goto out_free_oe;
+
 	/* Show index=off in /proc/mounts for forced r/o mount */
 	if (!ofs->indexdir) {
 		ofs->config.index = false;
@@ -1522,7 +1650,6 @@ static int ovl_fill_super(struct super_b
 	cap_lower(cred->cap_effective, CAP_SYS_RESOURCE);
 
 	sb->s_magic = OVERLAYFS_SUPER_MAGIC;
-	sb->s_op = &ovl_super_operations;
 	sb->s_xattr = ovl_xattr_handlers;
 	sb->s_fs_info = ofs;
 	sb->s_flags |= SB_POSIXACL;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/overlayfs/util.c linux-libre-5.1.15-gnu/fs/overlayfs/util.c
--- linux-libre-5.1.14-gnu/fs/overlayfs/util.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/overlayfs/util.c	2019-06-24 23:34:56.000000000 -0400
@@ -652,6 +652,18 @@ void ovl_inuse_unlock(struct dentry *den
 	}
 }
 
+bool ovl_is_inuse(struct dentry *dentry)
+{
+	struct inode *inode = d_inode(dentry);
+	bool inuse;
+
+	spin_lock(&inode->i_lock);
+	inuse = (inode->i_state & I_OVL_INUSE);
+	spin_unlock(&inode->i_lock);
+
+	return inuse;
+}
+
 /*
  * Does this overlay dentry need to be indexed on copy up?
  */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/fs/pnode.c linux-libre-5.1.15-gnu/fs/pnode.c
--- linux-libre-5.1.14-gnu/fs/pnode.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/fs/pnode.c	2019-06-24 23:34:56.000000000 -0400
@@ -262,7 +262,6 @@ static int propagate_one(struct mount *m
 	child = copy_tree(last_source, last_source->mnt.mnt_root, type);
 	if (IS_ERR(child))
 		return PTR_ERR(child);
-	child->mnt.mnt_flags &= ~MNT_LOCKED;
 	mnt_set_mountpoint(m, mp, child);
 	last_dest = m;
 	last_source = child;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/include/linux/mmc/host.h linux-libre-5.1.15-gnu/include/linux/mmc/host.h
--- linux-libre-5.1.14-gnu/include/linux/mmc/host.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/include/linux/mmc/host.h	2019-06-24 23:34:56.000000000 -0400
@@ -398,6 +398,7 @@ struct mmc_host {
 	unsigned int		retune_now:1;	/* do re-tuning at next req */
 	unsigned int		retune_paused:1; /* re-tuning is temporarily disabled */
 	unsigned int		use_blk_mq:1;	/* use blk-mq */
+	unsigned int		retune_crc_disable:1; /* don't trigger retune upon crc */
 
 	int			rescan_disable;	/* disable card detection */
 	int			rescan_entered;	/* used with nonremovable devices */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/include/linux/mmc/sdio_func.h linux-libre-5.1.15-gnu/include/linux/mmc/sdio_func.h
--- linux-libre-5.1.14-gnu/include/linux/mmc/sdio_func.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/include/linux/mmc/sdio_func.h	2019-06-24 23:34:56.000000000 -0400
@@ -159,4 +159,10 @@ extern void sdio_f0_writeb(struct sdio_f
 extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
 extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
 
+extern void sdio_retune_crc_disable(struct sdio_func *func);
+extern void sdio_retune_crc_enable(struct sdio_func *func);
+
+extern void sdio_retune_hold_now(struct sdio_func *func);
+extern void sdio_retune_release(struct sdio_func *func);
+
 #endif /* LINUX_MMC_SDIO_FUNC_H */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/include/net/bluetooth/hci_core.h linux-libre-5.1.15-gnu/include/net/bluetooth/hci_core.h
--- linux-libre-5.1.14-gnu/include/net/bluetooth/hci_core.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/include/net/bluetooth/hci_core.h	2019-06-24 23:34:56.000000000 -0400
@@ -190,6 +190,9 @@ struct adv_info {
 
 #define HCI_MAX_SHORT_NAME_LENGTH	10
 
+/* Min encryption key size to match with SMP */
+#define HCI_MIN_ENC_KEY_SIZE		7
+
 /* Default LE RPA expiry time, 15 minutes */
 #define HCI_DEFAULT_RPA_TIMEOUT		(15 * 60)
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/include/net/cfg80211.h linux-libre-5.1.15-gnu/include/net/cfg80211.h
--- linux-libre-5.1.14-gnu/include/net/cfg80211.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/include/net/cfg80211.h	2019-06-24 23:34:56.000000000 -0400
@@ -3767,7 +3767,8 @@ struct cfg80211_ops {
  *	on wiphy_new(), but can be changed by the driver if it has a good
  *	reason to override the default
  * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
- *	on a VLAN interface)
+ *	on a VLAN interface). This flag also serves an extra purpose of
+ *	supporting 4ADDR AP mode on devices which do not support AP/VLAN iftype.
  * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
  * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
  *	control port protocol ethertype. The device also honours the
diff -druNp --no-dereference linux-libre-5.1.14-gnu/kernel/trace/trace.c linux-libre-5.1.15-gnu/kernel/trace/trace.c
--- linux-libre-5.1.14-gnu/kernel/trace/trace.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/kernel/trace/trace.c	2019-06-24 23:34:56.000000000 -0400
@@ -8627,12 +8627,8 @@ void ftrace_dump(enum ftrace_dump_mode o
 
 		cnt++;
 
-		/* reset all but tr, trace, and overruns */
-		memset(&iter.seq, 0,
-		       sizeof(struct trace_iterator) -
-		       offsetof(struct trace_iterator, seq));
+		trace_iterator_reset(&iter);
 		iter.iter_flags |= TRACE_FILE_LAT_FMT;
-		iter.pos = -1;
 
 		if (trace_find_next_entry_inc(&iter) != NULL) {
 			int ret;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/kernel/trace/trace.h linux-libre-5.1.15-gnu/kernel/trace/trace.h
--- linux-libre-5.1.14-gnu/kernel/trace/trace.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/kernel/trace/trace.h	2019-06-24 23:34:56.000000000 -0400
@@ -1964,4 +1964,22 @@ static inline void tracer_hardirqs_off(u
 
 extern struct trace_iterator *tracepoint_print_iter;
 
+/*
+ * Reset the state of the trace_iterator so that it can read consumed data.
+ * Normally, the trace_iterator is used for reading the data when it is not
+ * consumed, and must retain state.
+ */
+static __always_inline void trace_iterator_reset(struct trace_iterator *iter)
+{
+	const size_t offset = offsetof(struct trace_iterator, seq);
+
+	/*
+	 * Keep gcc from complaining about overwriting more than just one
+	 * member in the structure.
+	 */
+	memset((char *)iter + offset, 0, sizeof(struct trace_iterator) - offset);
+
+	iter->pos = -1;
+}
+
 #endif /* _LINUX_KERNEL_TRACE_H */
diff -druNp --no-dereference linux-libre-5.1.14-gnu/kernel/trace/trace_kdb.c linux-libre-5.1.15-gnu/kernel/trace/trace_kdb.c
--- linux-libre-5.1.14-gnu/kernel/trace/trace_kdb.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/kernel/trace/trace_kdb.c	2019-06-24 23:34:56.000000000 -0400
@@ -41,12 +41,8 @@ static void ftrace_dump_buf(int skip_lin
 
 	kdb_printf("Dumping ftrace buffer:\n");
 
-	/* reset all but tr, trace, and overruns */
-	memset(&iter.seq, 0,
-		   sizeof(struct trace_iterator) -
-		   offsetof(struct trace_iterator, seq));
+	trace_iterator_reset(&iter);
 	iter.iter_flags |= TRACE_FILE_LAT_FMT;
-	iter.pos = -1;
 
 	if (cpu_file == RING_BUFFER_ALL_CPUS) {
 		for_each_tracing_cpu(cpu) {
diff -druNp --no-dereference linux-libre-5.1.14-gnu/Makefile linux-libre-5.1.15-gnu/Makefile
--- linux-libre-5.1.14-gnu/Makefile	2019-06-22 06:02:04.000000000 -0400
+++ linux-libre-5.1.15-gnu/Makefile	2019-06-25 00:28:07.000000000 -0400
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 5
 PATCHLEVEL = 1
-SUBLEVEL = 14
+SUBLEVEL = 15
 EXTRAVERSION = -gnu
 NAME = Shy Crocodile
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/bluetooth/hci_conn.c linux-libre-5.1.15-gnu/net/bluetooth/hci_conn.c
--- linux-libre-5.1.14-gnu/net/bluetooth/hci_conn.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/bluetooth/hci_conn.c	2019-06-24 23:34:56.000000000 -0400
@@ -1392,8 +1392,16 @@ auth:
 		return 0;
 
 encrypt:
-	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+	if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) {
+		/* Ensure that the encryption key size has been read,
+		 * otherwise stall the upper layer responses.
+		 */
+		if (!conn->enc_key_size)
+			return 0;
+
+		/* Nothing else needed, all requirements are met */
 		return 1;
+	}
 
 	hci_conn_encrypt(conn);
 	return 0;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/bluetooth/l2cap_core.c linux-libre-5.1.15-gnu/net/bluetooth/l2cap_core.c
--- linux-libre-5.1.14-gnu/net/bluetooth/l2cap_core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/bluetooth/l2cap_core.c	2019-06-24 23:34:56.000000000 -0400
@@ -1341,6 +1341,21 @@ static void l2cap_request_info(struct l2
 		       sizeof(req), &req);
 }
 
+static bool l2cap_check_enc_key_size(struct hci_conn *hcon)
+{
+	/* The minimum encryption key size needs to be enforced by the
+	 * host stack before establishing any L2CAP connections. The
+	 * specification in theory allows a minimum of 1, but to align
+	 * BR/EDR and LE transports, a minimum of 7 is chosen.
+	 *
+	 * This check might also be called for unencrypted connections
+	 * that have no key size requirements. Ensure that the link is
+	 * actually encrypted before enforcing a key size.
+	 */
+	return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
+		hcon->enc_key_size > HCI_MIN_ENC_KEY_SIZE);
+}
+
 static void l2cap_do_start(struct l2cap_chan *chan)
 {
 	struct l2cap_conn *conn = chan->conn;
@@ -1358,9 +1373,14 @@ static void l2cap_do_start(struct l2cap_
 	if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE))
 		return;
 
-	if (l2cap_chan_check_security(chan, true) &&
-	    __l2cap_no_conn_pending(chan))
+	if (!l2cap_chan_check_security(chan, true) ||
+	    !__l2cap_no_conn_pending(chan))
+		return;
+
+	if (l2cap_check_enc_key_size(conn->hcon))
 		l2cap_start_connection(chan);
+	else
+		__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
 }
 
 static inline int l2cap_mode_supported(__u8 mode, __u32 feat_mask)
@@ -1439,7 +1459,10 @@ static void l2cap_conn_start(struct l2ca
 				continue;
 			}
 
-			l2cap_start_connection(chan);
+			if (l2cap_check_enc_key_size(conn->hcon))
+				l2cap_start_connection(chan);
+			else
+				l2cap_chan_close(chan, ECONNREFUSED);
 
 		} else if (chan->state == BT_CONNECT2) {
 			struct l2cap_conn_rsp rsp;
@@ -7490,7 +7513,7 @@ static void l2cap_security_cfm(struct hc
 		}
 
 		if (chan->state == BT_CONNECT) {
-			if (!status)
+			if (!status && l2cap_check_enc_key_size(hcon))
 				l2cap_start_connection(chan);
 			else
 				__set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
@@ -7499,7 +7522,7 @@ static void l2cap_security_cfm(struct hc
 			struct l2cap_conn_rsp rsp;
 			__u16 res, stat;
 
-			if (!status) {
+			if (!status && l2cap_check_enc_key_size(hcon)) {
 				if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
 					res = L2CAP_CR_PEND;
 					stat = L2CAP_CS_AUTHOR_PEND;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/can/af_can.c linux-libre-5.1.15-gnu/net/can/af_can.c
--- linux-libre-5.1.14-gnu/net/can/af_can.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/can/af_can.c	2019-06-24 23:34:56.000000000 -0400
@@ -105,6 +105,7 @@ EXPORT_SYMBOL(can_ioctl);
 static void can_sock_destruct(struct sock *sk)
 {
 	skb_queue_purge(&sk->sk_receive_queue);
+	skb_queue_purge(&sk->sk_error_queue);
 }
 
 static const struct can_proto *can_get_proto(int protocol)
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/ieee80211_i.h linux-libre-5.1.15-gnu/net/mac80211/ieee80211_i.h
--- linux-libre-5.1.14-gnu/net/mac80211/ieee80211_i.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/ieee80211_i.h	2019-06-24 23:34:56.000000000 -0400
@@ -2222,6 +2222,9 @@ void ieee80211_tdls_cancel_channel_switc
 					  const u8 *addr);
 void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata);
 void ieee80211_tdls_chsw_work(struct work_struct *wk);
+void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
+				      const u8 *peer, u16 reason);
+const char *ieee80211_get_reason_code_string(u16 reason_code);
 
 extern const struct ethtool_ops ieee80211_ethtool_ops;
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/mlme.c linux-libre-5.1.15-gnu/net/mac80211/mlme.c
--- linux-libre-5.1.14-gnu/net/mac80211/mlme.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/mlme.c	2019-06-24 23:34:56.000000000 -0400
@@ -2963,7 +2963,7 @@ static void ieee80211_rx_mgmt_auth(struc
 #define case_WLAN(type) \
 	case WLAN_REASON_##type: return #type
 
-static const char *ieee80211_get_reason_code_string(u16 reason_code)
+const char *ieee80211_get_reason_code_string(u16 reason_code)
 {
 	switch (reason_code) {
 	case_WLAN(UNSPECIFIED);
@@ -3028,6 +3028,11 @@ static void ieee80211_rx_mgmt_deauth(str
 	if (len < 24 + 2)
 		return;
 
+	if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) {
+		ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code);
+		return;
+	}
+
 	if (ifmgd->associated &&
 	    ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) {
 		const u8 *bssid = ifmgd->associated->bssid;
@@ -3077,6 +3082,11 @@ static void ieee80211_rx_mgmt_disassoc(s
 
 	reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
 
+	if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) {
+		ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code);
+		return;
+	}
+
 	sdata_info(sdata, "disassociated from %pM (Reason: %u=%s)\n",
 		   mgmt->sa, reason_code,
 		   ieee80211_get_reason_code_string(reason_code));
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/rx.c linux-libre-5.1.15-gnu/net/mac80211/rx.c
--- linux-libre-5.1.14-gnu/net/mac80211/rx.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/rx.c	2019-06-24 23:34:56.000000000 -0400
@@ -3823,6 +3823,8 @@ static bool ieee80211_accept_frame(struc
 	case NL80211_IFTYPE_STATION:
 		if (!bssid && !sdata->u.mgd.use_4addr)
 			return false;
+		if (ieee80211_is_robust_mgmt_frame(skb) && !rx->sta)
+			return false;
 		if (multicast)
 			return true;
 		return ether_addr_equal(sdata->vif.addr, hdr->addr1);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/tdls.c linux-libre-5.1.15-gnu/net/mac80211/tdls.c
--- linux-libre-5.1.14-gnu/net/mac80211/tdls.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/tdls.c	2019-06-24 23:34:56.000000000 -0400
@@ -1994,3 +1994,26 @@ void ieee80211_tdls_chsw_work(struct wor
 	}
 	rtnl_unlock();
 }
+
+void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
+				      const u8 *peer, u16 reason)
+{
+	struct ieee80211_sta *sta;
+
+	rcu_read_lock();
+	sta = ieee80211_find_sta(&sdata->vif, peer);
+	if (!sta || !sta->tdls) {
+		rcu_read_unlock();
+		return;
+	}
+	rcu_read_unlock();
+
+	tdls_dbg(sdata, "disconnected from TDLS peer %pM (Reason: %u=%s)\n",
+		 peer, reason,
+		 ieee80211_get_reason_code_string(reason));
+
+	ieee80211_tdls_oper_request(&sdata->vif, peer,
+				    NL80211_TDLS_TEARDOWN,
+				    WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE,
+				    GFP_ATOMIC);
+}
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/util.c linux-libre-5.1.15-gnu/net/mac80211/util.c
--- linux-libre-5.1.14-gnu/net/mac80211/util.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/util.c	2019-06-24 23:34:56.000000000 -0400
@@ -3757,7 +3757,9 @@ int ieee80211_check_combinations(struct
 	}
 
 	/* Always allow software iftypes */
-	if (local->hw.wiphy->software_iftypes & BIT(iftype)) {
+	if (local->hw.wiphy->software_iftypes & BIT(iftype) ||
+	    (iftype == NL80211_IFTYPE_AP_VLAN &&
+	     local->hw.wiphy->flags & WIPHY_FLAG_4ADDR_AP)) {
 		if (radar_detect)
 			return -EINVAL;
 		return 0;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/mac80211/wpa.c linux-libre-5.1.15-gnu/net/mac80211/wpa.c
--- linux-libre-5.1.14-gnu/net/mac80211/wpa.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/mac80211/wpa.c	2019-06-24 23:34:56.000000000 -0400
@@ -1175,7 +1175,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
 	struct ieee80211_key *key = rx->key;
 	struct ieee80211_mmie_16 *mmie;
-	u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN];
+	u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN];
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 
 	if (!ieee80211_is_mgmt(hdr->frame_control))
@@ -1206,13 +1206,18 @@ ieee80211_crypto_aes_gmac_decrypt(struct
 		memcpy(nonce, hdr->addr2, ETH_ALEN);
 		memcpy(nonce + ETH_ALEN, ipn, 6);
 
+		mic = kmalloc(GMAC_MIC_LEN, GFP_ATOMIC);
+		if (!mic)
+			return RX_DROP_UNUSABLE;
 		if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce,
 				       skb->data + 24, skb->len - 24,
 				       mic) < 0 ||
 		    crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) {
 			key->u.aes_gmac.icverrors++;
+			kfree(mic);
 			return RX_DROP_UNUSABLE;
 		}
+		kfree(mic);
 	}
 
 	memcpy(key->u.aes_gmac.rx_pn, ipn, 6);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/wireless/core.c linux-libre-5.1.15-gnu/net/wireless/core.c
--- linux-libre-5.1.14-gnu/net/wireless/core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/wireless/core.c	2019-06-24 23:34:56.000000000 -0400
@@ -513,7 +513,7 @@ use_default_name:
 				   &rdev->rfkill_ops, rdev);
 
 	if (!rdev->rfkill) {
-		kfree(rdev);
+		wiphy_free(&rdev->wiphy);
 		return NULL;
 	}
 
@@ -1396,8 +1396,12 @@ static int cfg80211_netdev_notifier_call
 		}
 		break;
 	case NETDEV_PRE_UP:
-		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
+		if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)) &&
+		    !(wdev->iftype == NL80211_IFTYPE_AP_VLAN &&
+		      rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP &&
+		      wdev->use_4addr))
 			return notifier_from_errno(-EOPNOTSUPP);
+
 		if (rfkill_blocked(rdev->rfkill))
 			return notifier_from_errno(-ERFKILL);
 		break;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/net/wireless/nl80211.c linux-libre-5.1.15-gnu/net/wireless/nl80211.c
--- linux-libre-5.1.14-gnu/net/wireless/nl80211.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/net/wireless/nl80211.c	2019-06-24 23:34:56.000000000 -0400
@@ -3385,8 +3385,7 @@ static int nl80211_new_interface(struct
 	if (info->attrs[NL80211_ATTR_IFTYPE])
 		type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
 
-	if (!rdev->ops->add_virtual_intf ||
-	    !(rdev->wiphy.interface_modes & (1 << type)))
+	if (!rdev->ops->add_virtual_intf)
 		return -EOPNOTSUPP;
 
 	if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN ||
@@ -3405,6 +3404,11 @@ static int nl80211_new_interface(struct
 			return err;
 	}
 
+	if (!(rdev->wiphy.interface_modes & (1 << type)) &&
+	    !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr &&
+	      rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP))
+		return -EOPNOTSUPP;
+
 	err = nl80211_parse_mon_options(rdev, type, info, &params);
 	if (err < 0)
 		return err;
@@ -4800,8 +4804,10 @@ static int nl80211_send_station(struct s
 	struct nlattr *sinfoattr, *bss_param;
 
 	hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
-	if (!hdr)
+	if (!hdr) {
+		cfg80211_sinfo_release_content(sinfo);
 		return -1;
+	}
 
 	if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
 	    nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
diff -druNp --no-dereference linux-libre-5.1.14-gnu/scripts/checkstack.pl linux-libre-5.1.15-gnu/scripts/checkstack.pl
--- linux-libre-5.1.14-gnu/scripts/checkstack.pl	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/scripts/checkstack.pl	2019-06-24 23:34:56.000000000 -0400
@@ -46,7 +46,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre)
 	$x	= "[0-9a-f]";	# hex character
 	$xs	= "[0-9a-f ]";	# hex character or space
 	$funcre = qr/^$x* <(.*)>:$/;
-	if ($arch eq 'aarch64') {
+	if ($arch =~ '^(aarch|arm)64$') {
 		#ffffffc0006325cc:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
 		#a110:       d11643ff        sub     sp, sp, #0x590
 		$re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/scripts/package/Makefile linux-libre-5.1.15-gnu/scripts/package/Makefile
--- linux-libre-5.1.14-gnu/scripts/package/Makefile	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/scripts/package/Makefile	2019-06-24 23:34:56.000000000 -0400
@@ -103,7 +103,7 @@ clean-dirs += $(objtree)/snap/
 # ---------------------------------------------------------------------------
 tar%pkg: FORCE
 	$(MAKE) -f $(srctree)/Makefile
-	$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
+	+$(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
 
 clean-dirs += $(objtree)/tar-install/
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/security/apparmor/include/policy.h linux-libre-5.1.15-gnu/security/apparmor/include/policy.h
--- linux-libre-5.1.14-gnu/security/apparmor/include/policy.h	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/security/apparmor/include/policy.h	2019-06-24 23:34:56.000000000 -0400
@@ -217,7 +217,16 @@ static inline struct aa_profile *aa_get_
 	return labels_profile(aa_get_newest_label(&p->label));
 }
 
-#define PROFILE_MEDIATES(P, T)  ((P)->policy.start[(unsigned char) (T)])
+static inline unsigned int PROFILE_MEDIATES(struct aa_profile *profile,
+					    unsigned char class)
+{
+	if (class <= AA_CLASS_LAST)
+		return profile->policy.start[class];
+	else
+		return aa_dfa_match_len(profile->policy.dfa,
+					profile->policy.start[0], &class, 1);
+}
+
 static inline unsigned int PROFILE_MEDIATES_AF(struct aa_profile *profile,
 					       u16 AF) {
 	unsigned int state = PROFILE_MEDIATES(profile, AA_CLASS_NET);
diff -druNp --no-dereference linux-libre-5.1.14-gnu/security/apparmor/policy_unpack.c linux-libre-5.1.15-gnu/security/apparmor/policy_unpack.c
--- linux-libre-5.1.14-gnu/security/apparmor/policy_unpack.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/security/apparmor/policy_unpack.c	2019-06-24 23:34:56.000000000 -0400
@@ -223,16 +223,21 @@ static void *kvmemdup(const void *src, s
 static size_t unpack_u16_chunk(struct aa_ext *e, char **chunk)
 {
 	size_t size = 0;
+	void *pos = e->pos;
 
 	if (!inbounds(e, sizeof(u16)))
-		return 0;
+		goto fail;
 	size = le16_to_cpu(get_unaligned((__le16 *) e->pos));
 	e->pos += sizeof(__le16);
 	if (!inbounds(e, size))
-		return 0;
+		goto fail;
 	*chunk = e->pos;
 	e->pos += size;
 	return size;
+
+fail:
+	e->pos = pos;
+	return 0;
 }
 
 /* unpack control byte */
@@ -276,7 +281,7 @@ static bool unpack_nameX(struct aa_ext *
 		char *tag = NULL;
 		size_t size = unpack_u16_chunk(e, &tag);
 		/* if a name is specified it must match. otherwise skip tag */
-		if (name && (!size || strcmp(name, tag)))
+		if (name && (!size || tag[size-1] != '\0' || strcmp(name, tag)))
 			goto fail;
 	} else if (name) {
 		/* if a name is specified and there is no name tag fail */
@@ -294,62 +299,84 @@ fail:
 
 static bool unpack_u8(struct aa_ext *e, u8 *data, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_U8, name)) {
 		if (!inbounds(e, sizeof(u8)))
-			return 0;
+			goto fail;
 		if (data)
 			*data = get_unaligned((u8 *)e->pos);
 		e->pos += sizeof(u8);
 		return 1;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static bool unpack_u32(struct aa_ext *e, u32 *data, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_U32, name)) {
 		if (!inbounds(e, sizeof(u32)))
-			return 0;
+			goto fail;
 		if (data)
 			*data = le32_to_cpu(get_unaligned((__le32 *) e->pos));
 		e->pos += sizeof(u32);
 		return 1;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static bool unpack_u64(struct aa_ext *e, u64 *data, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_U64, name)) {
 		if (!inbounds(e, sizeof(u64)))
-			return 0;
+			goto fail;
 		if (data)
 			*data = le64_to_cpu(get_unaligned((__le64 *) e->pos));
 		e->pos += sizeof(u64);
 		return 1;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static size_t unpack_array(struct aa_ext *e, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_ARRAY, name)) {
 		int size;
 		if (!inbounds(e, sizeof(u16)))
-			return 0;
+			goto fail;
 		size = (int)le16_to_cpu(get_unaligned((__le16 *) e->pos));
 		e->pos += sizeof(u16);
 		return size;
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
 static size_t unpack_blob(struct aa_ext *e, char **blob, const char *name)
 {
+	void *pos = e->pos;
+
 	if (unpack_nameX(e, AA_BLOB, name)) {
 		u32 size;
 		if (!inbounds(e, sizeof(u32)))
-			return 0;
+			goto fail;
 		size = le32_to_cpu(get_unaligned((__le32 *) e->pos));
 		e->pos += sizeof(u32);
 		if (inbounds(e, (size_t) size)) {
@@ -358,6 +385,9 @@ static size_t unpack_blob(struct aa_ext
 			return size;
 		}
 	}
+
+fail:
+	e->pos = pos;
 	return 0;
 }
 
@@ -374,9 +404,10 @@ static int unpack_str(struct aa_ext *e,
 			if (src_str[size - 1] != 0)
 				goto fail;
 			*string = src_str;
+
+			return size;
 		}
 	}
-	return size;
 
 fail:
 	e->pos = pos;
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/cgroup/test_core.c linux-libre-5.1.15-gnu/tools/testing/selftests/cgroup/test_core.c
--- linux-libre-5.1.14-gnu/tools/testing/selftests/cgroup/test_core.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/cgroup/test_core.c	2019-06-24 23:34:56.000000000 -0400
@@ -198,7 +198,7 @@ static int test_cgcore_no_internal_proce
 	char *parent = NULL, *child = NULL;
 
 	if (cg_read_strstr(root, "cgroup.controllers", "cpu") ||
-	    cg_read_strstr(root, "cgroup.subtree_control", "cpu")) {
+	    cg_write(root, "cgroup.subtree_control", "+cpu")) {
 		ret = KSFT_SKIP;
 		goto cleanup;
 	}
@@ -376,6 +376,11 @@ int main(int argc, char *argv[])
 
 	if (cg_find_unified_root(root, sizeof(root)))
 		ksft_exit_skip("cgroup v2 isn't mounted\n");
+
+	if (cg_read_strstr(root, "cgroup.subtree_control", "memory"))
+		if (cg_write(root, "cgroup.subtree_control", "+memory"))
+			ksft_exit_skip("Failed to set memory controller\n");
+
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 		switch (tests[i].fn(root)) {
 		case KSFT_PASS:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/cgroup/test_memcontrol.c linux-libre-5.1.15-gnu/tools/testing/selftests/cgroup/test_memcontrol.c
--- linux-libre-5.1.14-gnu/tools/testing/selftests/cgroup/test_memcontrol.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/cgroup/test_memcontrol.c	2019-06-24 23:34:56.000000000 -0400
@@ -1205,6 +1205,10 @@ int main(int argc, char **argv)
 	if (cg_read_strstr(root, "cgroup.controllers", "memory"))
 		ksft_exit_skip("memory controller isn't available\n");
 
+	if (cg_read_strstr(root, "cgroup.subtree_control", "memory"))
+		if (cg_write(root, "cgroup.subtree_control", "+memory"))
+			ksft_exit_skip("Failed to set memory controller\n");
+
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 		switch (tests[i].fn(root)) {
 		case KSFT_PASS:
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/net/forwarding/router_broadcast.sh linux-libre-5.1.15-gnu/tools/testing/selftests/net/forwarding/router_broadcast.sh
--- linux-libre-5.1.14-gnu/tools/testing/selftests/net/forwarding/router_broadcast.sh	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/net/forwarding/router_broadcast.sh	2019-06-24 23:34:56.000000000 -0400
@@ -145,16 +145,19 @@ bc_forwarding_disable()
 {
 	sysctl_set net.ipv4.conf.all.bc_forwarding 0
 	sysctl_set net.ipv4.conf.$rp1.bc_forwarding 0
+	sysctl_set net.ipv4.conf.$rp2.bc_forwarding 0
 }
 
 bc_forwarding_enable()
 {
 	sysctl_set net.ipv4.conf.all.bc_forwarding 1
 	sysctl_set net.ipv4.conf.$rp1.bc_forwarding 1
+	sysctl_set net.ipv4.conf.$rp2.bc_forwarding 1
 }
 
 bc_forwarding_restore()
 {
+	sysctl_restore net.ipv4.conf.$rp2.bc_forwarding
 	sysctl_restore net.ipv4.conf.$rp1.bc_forwarding
 	sysctl_restore net.ipv4.conf.all.bc_forwarding
 }
@@ -171,7 +174,7 @@ ping_test_from()
 	log_info "ping $dip, expected reply from $from"
 	ip vrf exec $(master_name_get $oif) \
 		$PING -I $oif $dip -c 10 -i 0.1 -w $PING_TIMEOUT -b 2>&1 \
-		| grep $from &> /dev/null
+		| grep "bytes from $from" > /dev/null
 	check_err_fail $fail $?
 }
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/pidfd/pidfd_test.c linux-libre-5.1.15-gnu/tools/testing/selftests/pidfd/pidfd_test.c
--- linux-libre-5.1.14-gnu/tools/testing/selftests/pidfd/pidfd_test.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/pidfd/pidfd_test.c	2019-06-24 23:34:56.000000000 -0400
@@ -16,6 +16,10 @@
 
 #include "../kselftest.h"
 
+#ifndef __NR_pidfd_send_signal
+#define __NR_pidfd_send_signal -1
+#endif
+
 static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
 					unsigned int flags)
 {
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/vm/Makefile linux-libre-5.1.15-gnu/tools/testing/selftests/vm/Makefile
--- linux-libre-5.1.14-gnu/tools/testing/selftests/vm/Makefile	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/vm/Makefile	2019-06-24 23:34:56.000000000 -0400
@@ -25,6 +25,8 @@ TEST_GEN_FILES += virtual_address_range
 
 TEST_PROGS := run_vmtests
 
+TEST_FILES := test_vmalloc.sh
+
 KSFT_KHDR_INSTALL := 1
 include ../lib.mk
 
diff -druNp --no-dereference linux-libre-5.1.14-gnu/tools/testing/selftests/vm/userfaultfd.c linux-libre-5.1.15-gnu/tools/testing/selftests/vm/userfaultfd.c
--- linux-libre-5.1.14-gnu/tools/testing/selftests/vm/userfaultfd.c	2019-06-22 05:09:17.000000000 -0400
+++ linux-libre-5.1.15-gnu/tools/testing/selftests/vm/userfaultfd.c	2019-06-24 23:34:56.000000000 -0400
@@ -123,7 +123,7 @@ static void usage(void)
 	fprintf(stderr, "Supported <test type>: anon, hugetlb, "
 		"hugetlb_shared, shmem\n\n");
 	fprintf(stderr, "Examples:\n\n");
-	fprintf(stderr, examples);
+	fprintf(stderr, "%s", examples);
 	exit(1);
 }
 
