diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts linux-libre-4.19.51-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2019-06-15 05:54:11.000000000 -0400
@@ -106,6 +106,7 @@
 				regulator-name = "PVDD_APIO_1V8";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
 			};
 
 			ldo3_reg: LDO3 {
@@ -144,6 +145,7 @@
 				regulator-name = "PVDD_ABB_1V8";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
 			};
 
 			ldo9_reg: LDO9 {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx50.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx50.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx50.dtsi	2019-06-11 15:18:55.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx50.dtsi	2019-06-15 17:48:58.000000000 -0400
@@ -420,7 +420,7 @@
 				reg = <0x63fb0000 0x4000>;
 				interrupts = <6>;
 				clocks = <&clks IMX5_CLK_SDMA_GATE>,
-					 <&clks IMX5_CLK_SDMA_GATE>;
+					 <&clks IMX5_CLK_AHB>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
 				fsl,sdma-ram-script-name = "/*(DEBLOBBED)*/";
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx51.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx51.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx51.dtsi	2019-06-11 15:18:58.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx51.dtsi	2019-06-15 17:49:01.000000000 -0400
@@ -481,7 +481,7 @@
 				reg = <0x83fb0000 0x4000>;
 				interrupts = <6>;
 				clocks = <&clks IMX5_CLK_SDMA_GATE>,
-					 <&clks IMX5_CLK_SDMA_GATE>;
+					 <&clks IMX5_CLK_AHB>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
 				fsl,sdma-ram-script-name = "/*(DEBLOBBED)*/";
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx53.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx53.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx53.dtsi	2019-06-11 15:19:01.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx53.dtsi	2019-06-15 17:49:04.000000000 -0400
@@ -701,7 +701,7 @@
 				reg = <0x63fb0000 0x4000>;
 				interrupts = <6>;
 				clocks = <&clks IMX5_CLK_SDMA_GATE>,
-					 <&clks IMX5_CLK_SDMA_GATE>;
+					 <&clks IMX5_CLK_AHB>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
 				fsl,sdma-ram-script-name = "/*(DEBLOBBED)*/";
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6qdl.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6qdl.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6qdl.dtsi	2019-06-11 15:19:07.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6qdl.dtsi	2019-06-15 17:49:11.000000000 -0400
@@ -905,7 +905,7 @@
 				compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
 				reg = <0x020ec000 0x4000>;
 				interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX6QDL_CLK_SDMA>,
+				clocks = <&clks IMX6QDL_CLK_IPG>,
 					 <&clks IMX6QDL_CLK_SDMA>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sl.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sl.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sl.dtsi	2019-06-11 15:19:10.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sl.dtsi	2019-06-15 17:49:14.000000000 -0400
@@ -739,7 +739,7 @@
 				reg = <0x020ec000 0x4000>;
 				interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&clks IMX6SL_CLK_SDMA>,
-					 <&clks IMX6SL_CLK_SDMA>;
+					 <&clks IMX6SL_CLK_AHB>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
 				/* imx6sl reuses imx6q sdma firmware */
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sll.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sll.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sll.dtsi	2019-06-11 15:19:13.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sll.dtsi	2019-06-15 17:49:17.000000000 -0400
@@ -591,7 +591,7 @@
 				compatible = "fsl,imx6sll-sdma", "fsl,imx35-sdma";
 				reg = <0x020ec000 0x4000>;
 				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX6SLL_CLK_SDMA>,
+				clocks = <&clks IMX6SLL_CLK_IPG>,
 					 <&clks IMX6SLL_CLK_SDMA>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sx.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sx.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6sx.dtsi	2019-06-11 15:19:17.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6sx.dtsi	2019-06-15 17:49:20.000000000 -0400
@@ -803,7 +803,7 @@
 				compatible = "fsl,imx6sx-sdma", "fsl,imx6q-sdma";
 				reg = <0x020ec000 0x4000>;
 				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX6SX_CLK_SDMA>,
+				clocks = <&clks IMX6SX_CLK_IPG>,
 					 <&clks IMX6SX_CLK_SDMA>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6ul.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6ul.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx6ul.dtsi	2019-06-11 15:19:20.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx6ul.dtsi	2019-06-15 17:49:24.000000000 -0400
@@ -707,7 +707,7 @@
 					     "fsl,imx35-sdma";
 				reg = <0x020ec000 0x4000>;
 				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX6UL_CLK_SDMA>,
+				clocks = <&clks IMX6UL_CLK_IPG>,
 					 <&clks IMX6UL_CLK_SDMA>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx7s.dtsi linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx7s.dtsi
--- linux-libre-4.19.50-gnu/arch/arm/boot/dts/imx7s.dtsi	2019-06-11 15:19:24.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/boot/dts/imx7s.dtsi	2019-06-15 17:49:27.000000000 -0400
@@ -1050,8 +1050,8 @@
 				compatible = "fsl,imx7d-sdma", "fsl,imx35-sdma";
 				reg = <0x30bd0000 0x10000>;
 				interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clks IMX7D_SDMA_CORE_CLK>,
-					 <&clks IMX7D_AHB_CHANNEL_ROOT_CLK>;
+				clocks = <&clks IMX7D_IPG_ROOT_CLK>,
+					 <&clks IMX7D_SDMA_CORE_CLK>;
 				clock-names = "ipg", "ahb";
 				#dma-cells = <3>;
 				fsl,sdma-ram-script-name = "/*(DEBLOBBED)*/";
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/include/asm/hardirq.h linux-libre-4.19.51-gnu/arch/arm/include/asm/hardirq.h
--- linux-libre-4.19.50-gnu/arch/arm/include/asm/hardirq.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/include/asm/hardirq.h	2019-06-15 05:54:11.000000000 -0400
@@ -6,6 +6,7 @@
 #include <linux/threads.h>
 #include <asm/irq.h>
 
+/* number of IPIS _not_ including IPI_CPU_BACKTRACE */
 #define NR_IPI	7
 
 typedef struct {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/kernel/smp.c linux-libre-4.19.51-gnu/arch/arm/kernel/smp.c
--- linux-libre-4.19.50-gnu/arch/arm/kernel/smp.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/kernel/smp.c	2019-06-15 05:54:11.000000000 -0400
@@ -76,6 +76,10 @@ enum ipi_msg_type {
 	IPI_CPU_STOP,
 	IPI_IRQ_WORK,
 	IPI_COMPLETION,
+	/*
+	 * CPU_BACKTRACE is special and not included in NR_IPI
+	 * or tracable with trace_ipi_*
+	 */
 	IPI_CPU_BACKTRACE,
 	/*
 	 * SGI8-15 can be reserved by secure firmware, and thus may
@@ -803,7 +807,7 @@ core_initcall(register_cpufreq_notifier)
 
 static void raise_nmi(cpumask_t *mask)
 {
-	smp_cross_call(mask, IPI_CPU_BACKTRACE);
+	__smp_cross_call(mask, IPI_CPU_BACKTRACE);
 }
 
 void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/mach-exynos/suspend.c linux-libre-4.19.51-gnu/arch/arm/mach-exynos/suspend.c
--- linux-libre-4.19.50-gnu/arch/arm/mach-exynos/suspend.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/mach-exynos/suspend.c	2019-06-15 05:54:11.000000000 -0400
@@ -434,8 +434,27 @@ early_wakeup:
 
 static void exynos5420_prepare_pm_resume(void)
 {
+	unsigned int mpidr, cluster;
+
+	mpidr = read_cpuid_mpidr();
+	cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+
 	if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
 		WARN_ON(mcpm_cpu_powered_up());
+
+	if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) {
+		/*
+		 * When system is resumed on the LITTLE/KFC core (cluster 1),
+		 * the DSCR is not properly updated until the power is turned
+		 * on also for the cluster 0. Enable it for a while to
+		 * propagate the SPNIDEN and SPIDEN signals from Secure JTAG
+		 * block and avoid undefined instruction issue on CP14 reset.
+		 */
+		pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN,
+				EXYNOS_COMMON_CONFIGURATION(0));
+		pmu_raw_writel(0,
+				EXYNOS_COMMON_CONFIGURATION(0));
+	}
 }
 
 static void exynos5420_pm_resume(void)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/arm/mach-omap2/pm33xx-core.c linux-libre-4.19.51-gnu/arch/arm/mach-omap2/pm33xx-core.c
--- linux-libre-4.19.50-gnu/arch/arm/mach-omap2/pm33xx-core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/arm/mach-omap2/pm33xx-core.c	2019-06-15 05:54:11.000000000 -0400
@@ -51,10 +51,12 @@ static int amx3_common_init(void)
 
 	/* CEFUSE domain can be turned off post bootup */
 	cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm");
-	if (cefuse_pwrdm)
-		omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF);
-	else
+	if (!cefuse_pwrdm)
 		pr_err("PM: Failed to get cefuse_pwrdm\n");
+	else if (omap_type() != OMAP2_DEVICE_TYPE_GP)
+		pr_info("PM: Leaving EFUSE power domain active\n");
+	else
+		omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/mips/kernel/prom.c linux-libre-4.19.51-gnu/arch/mips/kernel/prom.c
--- linux-libre-4.19.50-gnu/arch/mips/kernel/prom.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/mips/kernel/prom.c	2019-06-15 05:54:11.000000000 -0400
@@ -41,7 +41,19 @@ char *mips_get_machine_name(void)
 #ifdef CONFIG_USE_OF
 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
 {
-	return add_memory_region(base, size, BOOT_MEM_RAM);
+	if (base >= PHYS_ADDR_MAX) {
+		pr_warn("Trying to add an invalid memory region, skipped\n");
+		return;
+	}
+
+	/* Truncate the passed memory region instead of type casting */
+	if (base + size - 1 >= PHYS_ADDR_MAX || base + size < base) {
+		pr_warn("Truncate memory region %llx @ %llx to size %llx\n",
+			size, base, PHYS_ADDR_MAX - base);
+		size = PHYS_ADDR_MAX - base;
+	}
+
+	add_memory_region(base, size, BOOT_MEM_RAM);
 }
 
 int __init early_init_dt_reserve_memory_arch(phys_addr_t base,
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/um/kernel/time.c linux-libre-4.19.51-gnu/arch/um/kernel/time.c
--- linux-libre-4.19.50-gnu/arch/um/kernel/time.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/um/kernel/time.c	2019-06-15 05:54:11.000000000 -0400
@@ -56,7 +56,7 @@ static int itimer_one_shot(struct clock_
 static struct clock_event_device timer_clockevent = {
 	.name			= "posix-timer",
 	.rating			= 250,
-	.cpumask		= cpu_all_mask,
+	.cpumask		= cpu_possible_mask,
 	.features		= CLOCK_EVT_FEAT_PERIODIC |
 				  CLOCK_EVT_FEAT_ONESHOT,
 	.set_state_shutdown	= itimer_shutdown,
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/x86/events/intel/core.c linux-libre-4.19.51-gnu/arch/x86/events/intel/core.c
--- linux-libre-4.19.50-gnu/arch/x86/events/intel/core.c	2019-06-11 15:13:49.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/x86/events/intel/core.c	2019-06-15 17:43:46.000000000 -0400
@@ -3072,7 +3072,7 @@ static int intel_pmu_hw_config(struct pe
 		return ret;
 
 	if (event->attr.precise_ip) {
-		if (!(event->attr.freq || event->attr.wakeup_events)) {
+		if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {
 			event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
 			if (!(event->attr.sample_type &
 			      ~intel_pmu_large_pebs_flags(event)))
diff -druNp --no-dereference linux-libre-4.19.50-gnu/arch/x86/pci/irq.c linux-libre-4.19.51-gnu/arch/x86/pci/irq.c
--- linux-libre-4.19.50-gnu/arch/x86/pci/irq.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/arch/x86/pci/irq.c	2019-06-15 05:54:11.000000000 -0400
@@ -1119,6 +1119,8 @@ static const struct dmi_system_id pciirq
 
 void __init pcibios_irq_init(void)
 {
+	struct irq_routing_table *rtable = NULL;
+
 	DBG(KERN_DEBUG "PCI: IRQ init\n");
 
 	if (raw_pci_ops == NULL)
@@ -1129,8 +1131,10 @@ void __init pcibios_irq_init(void)
 	pirq_table = pirq_find_routing_table();
 
 #ifdef CONFIG_PCI_BIOS
-	if (!pirq_table && (pci_probe & PCI_BIOS_IRQ_SCAN))
+	if (!pirq_table && (pci_probe & PCI_BIOS_IRQ_SCAN)) {
 		pirq_table = pcibios_get_irq_routing_table();
+		rtable = pirq_table;
+	}
 #endif
 	if (pirq_table) {
 		pirq_peer_trick();
@@ -1145,8 +1149,10 @@ void __init pcibios_irq_init(void)
 		 * If we're using the I/O APIC, avoid using the PCI IRQ
 		 * routing table
 		 */
-		if (io_apic_assign_pci_irqs)
+		if (io_apic_assign_pci_irqs) {
+			kfree(rtable);
 			pirq_table = NULL;
+		}
 	}
 
 	x86_init.pci.fixup_irqs();
diff -druNp --no-dereference linux-libre-4.19.50-gnu/block/bfq-iosched.c linux-libre-4.19.51-gnu/block/bfq-iosched.c
--- linux-libre-4.19.50-gnu/block/bfq-iosched.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/block/bfq-iosched.c	2019-06-15 05:54:11.000000000 -0400
@@ -2509,6 +2509,8 @@ static void bfq_arm_slice_timer(struct b
 	if (BFQQ_SEEKY(bfqq) && bfqq->wr_coeff == 1 &&
 	    bfq_symmetric_scenario(bfqd))
 		sl = min_t(u64, sl, BFQ_MIN_TT);
+	else if (bfqq->wr_coeff > 1)
+		sl = max_t(u32, sl, 20ULL * NSEC_PER_MSEC);
 
 	bfqd->last_idling_start = ktime_get();
 	hrtimer_start(&bfqd->idle_slice_timer, ns_to_ktime(sl),
diff -druNp --no-dereference linux-libre-4.19.50-gnu/block/blk-core.c linux-libre-4.19.51-gnu/block/blk-core.c
--- linux-libre-4.19.50-gnu/block/blk-core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/block/blk-core.c	2019-06-15 05:54:11.000000000 -0400
@@ -411,7 +411,6 @@ void blk_sync_queue(struct request_queue
 		struct blk_mq_hw_ctx *hctx;
 		int i;
 
-		cancel_delayed_work_sync(&q->requeue_work);
 		queue_for_each_hw_ctx(q, hctx, i)
 			cancel_delayed_work_sync(&hctx->run_work);
 	} else {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/block/blk-mq.c linux-libre-4.19.51-gnu/block/blk-mq.c
--- linux-libre-4.19.50-gnu/block/blk-mq.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/block/blk-mq.c	2019-06-15 05:54:11.000000000 -0400
@@ -2465,6 +2465,8 @@ void blk_mq_release(struct request_queue
 	struct blk_mq_hw_ctx *hctx;
 	unsigned int i;
 
+	cancel_delayed_work_sync(&q->requeue_work);
+
 	/* hctx kobj stays in hctx */
 	queue_for_each_hw_ctx(q, hctx, i) {
 		if (!hctx)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/clk/rockchip/clk-rk3288.c linux-libre-4.19.51-gnu/drivers/clk/rockchip/clk-rk3288.c
--- linux-libre-4.19.50-gnu/drivers/clk/rockchip/clk-rk3288.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/clk/rockchip/clk-rk3288.c	2019-06-15 05:54:11.000000000 -0400
@@ -835,6 +835,9 @@ static const int rk3288_saved_cru_reg_id
 	RK3288_CLKSEL_CON(10),
 	RK3288_CLKSEL_CON(33),
 	RK3288_CLKSEL_CON(37),
+
+	/* We turn aclk_dmac1 on for suspend; this will restore it */
+	RK3288_CLKGATE_CON(10),
 };
 
 static u32 rk3288_saved_cru_regs[ARRAY_SIZE(rk3288_saved_cru_reg_ids)];
@@ -851,6 +854,14 @@ static int rk3288_clk_suspend(void)
 	}
 
 	/*
+	 * Going into deep sleep (specifically setting PMU_CLR_DMA in
+	 * RK3288_PMU_PWRMODE_CON1) appears to fail unless
+	 * "aclk_dmac1" is on.
+	 */
+	writel_relaxed(1 << (12 + 16),
+		       rk3288_cru_base + RK3288_CLKGATE_CON(10));
+
+	/*
 	 * Switch PLLs other than DPLL (for SDRAM) to slow mode to
 	 * avoid crashes on resume. The Mask ROM on the system will
 	 * put APLL, CPLL, and GPLL into slow mode at resume time
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/dma/idma64.c linux-libre-4.19.51-gnu/drivers/dma/idma64.c
--- linux-libre-4.19.50-gnu/drivers/dma/idma64.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/dma/idma64.c	2019-06-15 05:54:11.000000000 -0400
@@ -597,7 +597,7 @@ static int idma64_probe(struct idma64_ch
 	idma64->dma.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	idma64->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
-	idma64->dma.dev = chip->dev;
+	idma64->dma.dev = chip->sysdev;
 
 	dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
 
@@ -637,6 +637,7 @@ static int idma64_platform_probe(struct
 {
 	struct idma64_chip *chip;
 	struct device *dev = &pdev->dev;
+	struct device *sysdev = dev->parent;
 	struct resource *mem;
 	int ret;
 
@@ -653,11 +654,12 @@ static int idma64_platform_probe(struct
 	if (IS_ERR(chip->regs))
 		return PTR_ERR(chip->regs);
 
-	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	ret = dma_coerce_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
 	if (ret)
 		return ret;
 
 	chip->dev = dev;
+	chip->sysdev = sysdev;
 
 	ret = idma64_probe(chip);
 	if (ret)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/dma/idma64.h linux-libre-4.19.51-gnu/drivers/dma/idma64.h
--- linux-libre-4.19.50-gnu/drivers/dma/idma64.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/dma/idma64.h	2019-06-15 05:54:11.000000000 -0400
@@ -216,12 +216,14 @@ static inline void idma64_writel(struct
 /**
  * struct idma64_chip - representation of iDMA 64-bit controller hardware
  * @dev:		struct device of the DMA controller
+ * @sysdev:		struct device of the physical device that does DMA
  * @irq:		irq line
  * @regs:		memory mapped I/O space
  * @idma64:		struct idma64 that is filed by idma64_probe()
  */
 struct idma64_chip {
 	struct device	*dev;
+	struct device	*sysdev;
 	int		irq;
 	void __iomem	*regs;
 	struct idma64	*idma64;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/edac/Kconfig linux-libre-4.19.51-gnu/drivers/edac/Kconfig
--- linux-libre-4.19.50-gnu/drivers/edac/Kconfig	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/edac/Kconfig	2019-06-15 05:54:11.000000000 -0400
@@ -250,8 +250,8 @@ config EDAC_PND2
 	  micro-server but may appear on others in the future.
 
 config EDAC_MPC85XX
-	tristate "Freescale MPC83xx / MPC85xx"
-	depends on FSL_SOC
+	bool "Freescale MPC83xx / MPC85xx"
+	depends on FSL_SOC && EDAC=y
 	help
 	  Support for error detection and correction on the Freescale
 	  MPC8349, MPC8560, MPC8540, MPC8548, T4240
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpio/gpio-omap.c linux-libre-4.19.51-gnu/drivers/gpio/gpio-omap.c
--- linux-libre-4.19.50-gnu/drivers/gpio/gpio-omap.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpio/gpio-omap.c	2019-06-15 05:54:11.000000000 -0400
@@ -343,6 +343,22 @@ static void omap_clear_gpio_debounce(str
 	}
 }
 
+/*
+ * Off mode wake-up capable GPIOs in bank(s) that are in the wakeup domain.
+ * See TRM section for GPIO for "Wake-Up Generation" for the list of GPIOs
+ * in wakeup domain. If bank->non_wakeup_gpios is not configured, assume none
+ * are capable waking up the system from off mode.
+ */
+static bool omap_gpio_is_off_wakeup_capable(struct gpio_bank *bank, u32 gpio_mask)
+{
+	u32 no_wake = bank->non_wakeup_gpios;
+
+	if (no_wake)
+		return !!(~no_wake & gpio_mask);
+
+	return false;
+}
+
 static inline void omap_set_gpio_trigger(struct gpio_bank *bank, int gpio,
 						unsigned trigger)
 {
@@ -374,13 +390,7 @@ static inline void omap_set_gpio_trigger
 	}
 
 	/* This part needs to be executed always for OMAP{34xx, 44xx} */
-	if (!bank->regs->irqctrl) {
-		/* On omap24xx proceed only when valid GPIO bit is set */
-		if (bank->non_wakeup_gpios) {
-			if (!(bank->non_wakeup_gpios & gpio_bit))
-				goto exit;
-		}
-
+	if (!bank->regs->irqctrl && !omap_gpio_is_off_wakeup_capable(bank, gpio)) {
 		/*
 		 * Log the edge gpio and manually trigger the IRQ
 		 * after resume if the input level changes
@@ -393,7 +403,6 @@ static inline void omap_set_gpio_trigger
 			bank->enabled_non_wakeup_gpios &= ~gpio_bit;
 	}
 
-exit:
 	bank->level_mask =
 		readl_relaxed(bank->base + bank->regs->leveldetect0) |
 		readl_relaxed(bank->base + bank->regs->leveldetect1);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpio/gpio-vf610.c linux-libre-4.19.51-gnu/drivers/gpio/gpio-vf610.c
--- linux-libre-4.19.50-gnu/drivers/gpio/gpio-vf610.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpio/gpio-vf610.c	2019-06-15 05:54:11.000000000 -0400
@@ -37,6 +37,7 @@ struct fsl_gpio_soc_data {
 
 struct vf610_gpio_port {
 	struct gpio_chip gc;
+	struct irq_chip ic;
 	void __iomem *base;
 	void __iomem *gpio_base;
 	const struct fsl_gpio_soc_data *sdata;
@@ -66,8 +67,6 @@ struct vf610_gpio_port {
 #define PORT_INT_EITHER_EDGE	0xb
 #define PORT_INT_LOGIC_ONE	0xc
 
-static struct irq_chip vf610_gpio_irq_chip;
-
 static const struct fsl_gpio_soc_data imx_data = {
 	.have_paddr = true,
 };
@@ -243,15 +242,6 @@ static int vf610_gpio_irq_set_wake(struc
 	return 0;
 }
 
-static struct irq_chip vf610_gpio_irq_chip = {
-	.name		= "gpio-vf610",
-	.irq_ack	= vf610_gpio_irq_ack,
-	.irq_mask	= vf610_gpio_irq_mask,
-	.irq_unmask	= vf610_gpio_irq_unmask,
-	.irq_set_type	= vf610_gpio_irq_set_type,
-	.irq_set_wake	= vf610_gpio_irq_set_wake,
-};
-
 static int vf610_gpio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -259,6 +249,7 @@ static int vf610_gpio_probe(struct platf
 	struct vf610_gpio_port *port;
 	struct resource *iores;
 	struct gpio_chip *gc;
+	struct irq_chip *ic;
 	int i;
 	int ret;
 
@@ -295,6 +286,14 @@ static int vf610_gpio_probe(struct platf
 	gc->direction_output = vf610_gpio_direction_output;
 	gc->set = vf610_gpio_set;
 
+	ic = &port->ic;
+	ic->name = "gpio-vf610";
+	ic->irq_ack = vf610_gpio_irq_ack;
+	ic->irq_mask = vf610_gpio_irq_mask;
+	ic->irq_unmask = vf610_gpio_irq_unmask;
+	ic->irq_set_type = vf610_gpio_irq_set_type;
+	ic->irq_set_wake = vf610_gpio_irq_set_wake;
+
 	ret = gpiochip_add_data(gc, port);
 	if (ret < 0)
 		return ret;
@@ -306,14 +305,13 @@ static int vf610_gpio_probe(struct platf
 	/* Clear the interrupt status register for all GPIO's */
 	vf610_gpio_writel(~0, port->base + PORT_ISFR);
 
-	ret = gpiochip_irqchip_add(gc, &vf610_gpio_irq_chip, 0,
-				   handle_edge_irq, IRQ_TYPE_NONE);
+	ret = gpiochip_irqchip_add(gc, ic, 0, handle_edge_irq, IRQ_TYPE_NONE);
 	if (ret) {
 		dev_err(dev, "failed to add irqchip\n");
 		gpiochip_remove(gc);
 		return ret;
 	}
-	gpiochip_set_chained_irqchip(gc, &vf610_gpio_irq_chip, port->irq,
+	gpiochip_set_chained_irqchip(gc, ic, port->irq,
 				     vf610_gpio_irq_handler);
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c linux-libre-4.19.51-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c	2019-06-15 05:54:11.000000000 -0400
@@ -388,6 +388,10 @@ void dpp1_cnv_setup (
 	default:
 		break;
 	}
+
+	/* Set default color space based on format if none is given. */
+	color_space = input_color_space ? input_color_space : color_space;
+
 	REG_SET(CNVC_SURFACE_PIXEL_FORMAT, 0,
 			CNVC_SURFACE_PIXEL_FORMAT, pixel_format);
 	REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en);
@@ -399,7 +403,7 @@ void dpp1_cnv_setup (
 		for (i = 0; i < 12; i++)
 			tbl_entry.regval[i] = input_csc_color_matrix.matrix[i];
 
-		tbl_entry.color_space = input_color_space;
+		tbl_entry.color_space = color_space;
 
 		if (color_space >= COLOR_SPACE_YCBCR601)
 			select = INPUT_CSC_SELECT_ICSC;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c linux-libre-4.19.51-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c	2019-06-15 05:54:11.000000000 -0400
@@ -1890,7 +1890,7 @@ static void update_dpp(struct dpp *dpp,
 			plane_state->format,
 			EXPANSION_MODE_ZERO,
 			plane_state->input_csc_color_matrix,
-			COLOR_SPACE_YCBCR601_LIMITED);
+			plane_state->color_space);
 
 	//set scale and bias registers
 	build_prescale_params(&bns_params, plane_state);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c linux-libre-4.19.51-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c	2019-06-15 05:54:11.000000000 -0400
@@ -747,11 +747,11 @@ static void adv7511_mode_set(struct adv7
 			vsync_polarity = 1;
 	}
 
-	if (mode->vrefresh <= 24000)
+	if (drm_mode_vrefresh(mode) <= 24)
 		low_refresh_rate = ADV7511_LOW_REFRESH_RATE_24HZ;
-	else if (mode->vrefresh <= 25000)
+	else if (drm_mode_vrefresh(mode) <= 25)
 		low_refresh_rate = ADV7511_LOW_REFRESH_RATE_25HZ;
-	else if (mode->vrefresh <= 30000)
+	else if (drm_mode_vrefresh(mode) <= 30)
 		low_refresh_rate = ADV7511_LOW_REFRESH_RATE_30HZ;
 	else
 		low_refresh_rate = ADV7511_LOW_REFRESH_RATE_NONE;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/disp.h linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/disp.h
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/disp.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/disp.h	2019-06-15 05:54:11.000000000 -0400
@@ -41,6 +41,7 @@ struct nv50_disp_interlock {
 		NV50_DISP_INTERLOCK__SIZE
 	} type;
 	u32 data;
+	u32 wimm;
 };
 
 void corec37d_ntfy_init(struct nouveau_bo *, u32);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/head.c linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/head.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/head.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/head.c	2019-06-15 05:54:11.000000000 -0400
@@ -306,7 +306,7 @@ nv50_head_atomic_check(struct drm_crtc *
 			asyh->set.or = head->func->or != NULL;
 		}
 
-		if (asyh->state.mode_changed)
+		if (asyh->state.mode_changed || asyh->state.connectors_changed)
 			nv50_head_atomic_check_mode(head, asyh);
 
 		if (asyh->state.color_mgmt_changed ||
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c	2019-06-15 05:54:11.000000000 -0400
@@ -75,6 +75,7 @@ wimmc37b_init_(const struct nv50_wimm_fu
 		return ret;
 	}
 
+	wndw->interlock.wimm = wndw->interlock.data;
 	wndw->immd = func;
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/wndw.c linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/wndw.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/dispnv50/wndw.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/dispnv50/wndw.c	2019-06-15 05:54:11.000000000 -0400
@@ -151,7 +151,7 @@ nv50_wndw_flush_set(struct nv50_wndw *wn
 	if (asyw->set.point) {
 		if (asyw->set.point = false, asyw->set.mask)
 			interlock[wndw->interlock.type] |= wndw->interlock.data;
-		interlock[NV50_DISP_INTERLOCK_WIMM] |= wndw->interlock.data;
+		interlock[NV50_DISP_INTERLOCK_WIMM] |= wndw->interlock.wimm;
 
 		wndw->immd->point(wndw, asyw);
 		wndw->immd->update(wndw, interlock);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/Kconfig linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/Kconfig
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/Kconfig	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/Kconfig	2019-06-15 05:54:11.000000000 -0400
@@ -16,20 +16,9 @@ config DRM_NOUVEAU
 	select INPUT if ACPI && X86
 	select THERMAL if ACPI && X86
 	select ACPI_VIDEO if ACPI && X86
-	help
-	  Choose this option for open-source NVIDIA support.
-
-config NOUVEAU_LEGACY_CTX_SUPPORT
-	bool "Nouveau legacy context support"
-	depends on DRM_NOUVEAU
 	select DRM_VM
-	default y
 	help
-	  There was a version of the nouveau DDX that relied on legacy
-	  ctx ioctls not erroring out. But that was back in time a long
-	  ways, so offer a way to disable it now. For uapi compat with
-	  old nouveau ddx this should be on by default, but modern distros
-	  should consider turning it off.
+	  Choose this option for open-source NVIDIA support.
 
 config NOUVEAU_PLATFORM_DRIVER
 	bool "Nouveau (NVIDIA) SoC GPUs"
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/nouveau_drm.c linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/nouveau_drm.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/nouveau_drm.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/nouveau_drm.c	2019-06-15 05:54:11.000000000 -0400
@@ -1015,11 +1015,8 @@ nouveau_driver_fops = {
 static struct drm_driver
 driver_stub = {
 	.driver_features =
-		DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER
-#if defined(CONFIG_NOUVEAU_LEGACY_CTX_SUPPORT)
-		| DRIVER_KMS_LEGACY_CONTEXT
-#endif
-		,
+		DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME | DRIVER_RENDER |
+		DRIVER_KMS_LEGACY_CONTEXT,
 
 	.load = nouveau_drm_load,
 	.unload = nouveau_drm_unload,
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c	2019-06-15 05:54:11.000000000 -0400
@@ -365,8 +365,15 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 da
 	 * and it's better to have a failed modeset than that.
 	 */
 	for (cfg = nvkm_dp_rates; cfg->rate; cfg++) {
-		if (cfg->nr <= outp_nr && cfg->nr <= outp_bw)
-			failsafe = cfg;
+		if (cfg->nr <= outp_nr && cfg->nr <= outp_bw) {
+			/* Try to respect sink limits too when selecting
+			 * lowest link configuration.
+			 */
+			if (!failsafe ||
+			    (cfg->nr <= sink_nr && cfg->bw <= sink_bw))
+				failsafe = cfg;
+		}
+
 		if (failsafe && cfg[1].rate < dataKBps)
 			break;
 	}
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/pl111/pl111_display.c linux-libre-4.19.51-gnu/drivers/gpu/drm/pl111/pl111_display.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/pl111/pl111_display.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/pl111/pl111_display.c	2019-06-15 05:54:11.000000000 -0400
@@ -531,14 +531,15 @@ pl111_init_clock_divider(struct drm_devi
 		dev_err(drm->dev, "CLCD: unable to get clcdclk.\n");
 		return PTR_ERR(parent);
 	}
+
+	spin_lock_init(&priv->tim2_lock);
+
 	/* If the clock divider is broken, use the parent directly */
 	if (priv->variant->broken_clockdivider) {
 		priv->clk = parent;
 		return 0;
 	}
 	parent_name = __clk_get_name(parent);
-
-	spin_lock_init(&priv->tim2_lock);
 	div->init = &init;
 
 	ret = devm_clk_hw_register(drm->dev, div);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/gpu/drm/vc4/vc4_plane.c linux-libre-4.19.51-gnu/drivers/gpu/drm/vc4/vc4_plane.c
--- linux-libre-4.19.50-gnu/drivers/gpu/drm/vc4/vc4_plane.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/gpu/drm/vc4/vc4_plane.c	2019-06-15 05:54:11.000000000 -0400
@@ -818,6 +818,7 @@ static void vc4_plane_atomic_async_updat
 		drm_atomic_set_fb_for_plane(plane->state, state->fb);
 	}
 
+	swap(plane->state->fb, state->fb);
 	/* Set the cursor's position on the screen.  This is the
 	 * expected change from the drm_mode_cursor_universal()
 	 * helper.
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/iommu/arm-smmu-v3.c linux-libre-4.19.51-gnu/drivers/iommu/arm-smmu-v3.c
--- linux-libre-4.19.50-gnu/drivers/iommu/arm-smmu-v3.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/iommu/arm-smmu-v3.c	2019-06-15 05:54:11.000000000 -0400
@@ -2414,13 +2414,9 @@ static int arm_smmu_device_reset(struct
 	/* Clear CR0 and sync (disables SMMU and queue processing) */
 	reg = readl_relaxed(smmu->base + ARM_SMMU_CR0);
 	if (reg & CR0_SMMUEN) {
-		if (is_kdump_kernel()) {
-			arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
-			arm_smmu_device_disable(smmu);
-			return -EBUSY;
-		}
-
 		dev_warn(smmu->dev, "SMMU currently enabled! Resetting...\n");
+		WARN_ON(is_kdump_kernel() && !disable_bypass);
+		arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0);
 	}
 
 	ret = arm_smmu_device_disable(smmu);
@@ -2513,6 +2509,8 @@ static int arm_smmu_device_reset(struct
 		return ret;
 	}
 
+	if (is_kdump_kernel())
+		enables &= ~(CR0_EVTQEN | CR0_PRIQEN);
 
 	/* Enable the SMMU interface, or ensure bypass */
 	if (!bypass || disable_bypass) {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/iommu/intel-iommu.c linux-libre-4.19.51-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-4.19.50-gnu/drivers/iommu/intel-iommu.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/iommu/intel-iommu.c	2019-06-15 05:54:11.000000000 -0400
@@ -4033,9 +4033,7 @@ static void __init init_no_remapping_dev
 
 		/* This IOMMU has *only* gfx devices. Either bypass it or
 		   set the gfx_mapped flag, as appropriate */
-		if (dmar_map_gfx) {
-			intel_iommu_gfx_mapped = 1;
-		} else {
+		if (!dmar_map_gfx) {
 			drhd->ignored = 1;
 			for_each_active_dev_scope(drhd->devices,
 						  drhd->devices_cnt, i, dev)
@@ -4831,6 +4829,9 @@ int __init intel_iommu_init(void)
 		goto out_free_reserved_range;
 	}
 
+	if (dmar_map_gfx)
+		intel_iommu_gfx_mapped = 1;
+
 	init_no_remapping_devices();
 
 	ret = init_dmars();
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/mailbox/stm32-ipcc.c linux-libre-4.19.51-gnu/drivers/mailbox/stm32-ipcc.c
--- linux-libre-4.19.50-gnu/drivers/mailbox/stm32-ipcc.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/mailbox/stm32-ipcc.c	2019-06-15 05:54:11.000000000 -0400
@@ -8,9 +8,9 @@
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/interrupt.h>
+#include <linux/io.h>
 #include <linux/mailbox_controller.h>
 #include <linux/module.h>
-#include <linux/of_irq.h>
 #include <linux/platform_device.h>
 #include <linux/pm_wakeirq.h>
 
@@ -240,9 +240,11 @@ static int stm32_ipcc_probe(struct platf
 
 	/* irq */
 	for (i = 0; i < IPCC_IRQ_NUM; i++) {
-		ipcc->irqs[i] = of_irq_get_byname(dev->of_node, irq_name[i]);
+		ipcc->irqs[i] = platform_get_irq_byname(pdev, irq_name[i]);
 		if (ipcc->irqs[i] < 0) {
-			dev_err(dev, "no IRQ specified %s\n", irq_name[i]);
+			if (ipcc->irqs[i] != -EPROBE_DEFER)
+				dev_err(dev, "no IRQ specified %s\n",
+					irq_name[i]);
 			ret = ipcc->irqs[i];
 			goto err_clk;
 		}
@@ -263,9 +265,10 @@ static int stm32_ipcc_probe(struct platf
 
 	/* wakeup */
 	if (of_property_read_bool(np, "wakeup-source")) {
-		ipcc->wkp = of_irq_get_byname(dev->of_node, "wakeup");
+		ipcc->wkp = platform_get_irq_byname(pdev, "wakeup");
 		if (ipcc->wkp < 0) {
-			dev_err(dev, "could not get wakeup IRQ\n");
+			if (ipcc->wkp != -EPROBE_DEFER)
+				dev_err(dev, "could not get wakeup IRQ\n");
 			ret = ipcc->wkp;
 			goto err_clk;
 		}
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/mfd/intel-lpss.c linux-libre-4.19.51-gnu/drivers/mfd/intel-lpss.c
--- linux-libre-4.19.50-gnu/drivers/mfd/intel-lpss.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/mfd/intel-lpss.c	2019-06-15 05:54:11.000000000 -0400
@@ -273,6 +273,9 @@ static void intel_lpss_init_dev(const st
 {
 	u32 value = LPSS_PRIV_SSP_REG_DIS_DMA_FIN;
 
+	/* Set the device in reset state */
+	writel(0, lpss->priv + LPSS_PRIV_RESETS);
+
 	intel_lpss_deassert_reset(lpss);
 
 	intel_lpss_set_remap_addr(lpss);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/mfd/tps65912-spi.c linux-libre-4.19.51-gnu/drivers/mfd/tps65912-spi.c
--- linux-libre-4.19.50-gnu/drivers/mfd/tps65912-spi.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/mfd/tps65912-spi.c	2019-06-15 05:54:11.000000000 -0400
@@ -27,6 +27,7 @@ static const struct of_device_id tps6591
 	{ .compatible = "ti,tps65912", },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, tps65912_spi_of_match_table);
 
 static int tps65912_spi_probe(struct spi_device *spi)
 {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/mfd/twl6040.c linux-libre-4.19.51-gnu/drivers/mfd/twl6040.c
--- linux-libre-4.19.50-gnu/drivers/mfd/twl6040.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/mfd/twl6040.c	2019-06-15 05:54:11.000000000 -0400
@@ -322,8 +322,19 @@ int twl6040_power(struct twl6040 *twl604
 			}
 		}
 
+		/*
+		 * Register access can produce errors after power-up unless we
+		 * wait at least 8ms based on measurements on duovero.
+		 */
+		usleep_range(10000, 12000);
+
 		/* Sync with the HW */
-		regcache_sync(twl6040->regmap);
+		ret = regcache_sync(twl6040->regmap);
+		if (ret) {
+			dev_err(twl6040->dev, "Failed to sync with the HW: %i\n",
+				ret);
+			goto out;
+		}
 
 		/* Default PLL configuration after power up */
 		twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/misc/pci_endpoint_test.c linux-libre-4.19.51-gnu/drivers/misc/pci_endpoint_test.c
--- linux-libre-4.19.50-gnu/drivers/misc/pci_endpoint_test.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/misc/pci_endpoint_test.c	2019-06-15 05:54:11.000000000 -0400
@@ -662,6 +662,7 @@ static int pci_endpoint_test_probe(struc
 	data = (struct pci_endpoint_test_data *)ent->driver_data;
 	if (data) {
 		test_reg_bar = data->test_reg_bar;
+		test->test_reg_bar = test_reg_bar;
 		test->alignment = data->alignment;
 		irq_type = data->irq_type;
 	}
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/mmc/host/mmci.c linux-libre-4.19.51-gnu/drivers/mmc/host/mmci.c
--- linux-libre-4.19.50-gnu/drivers/mmc/host/mmci.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/mmc/host/mmci.c	2019-06-15 05:54:11.000000000 -0400
@@ -1295,9 +1295,10 @@ static irqreturn_t mmci_irq(int irq, voi
 		}
 
 		/*
-		 * Don't poll for busy completion in irq context.
+		 * Busy detection has been handled by mmci_cmd_irq() above.
+		 * Clear the status bit to prevent polling in IRQ context.
 		 */
-		if (host->variant->busy_detect && host->busy_status)
+		if (host->variant->busy_detect_flag)
 			status &= ~host->variant->busy_detect_flag;
 
 		ret = 1;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c linux-libre-4.19.51-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
--- linux-libre-4.19.50-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c	2019-06-15 05:54:11.000000000 -0400
@@ -4300,8 +4300,11 @@ int hclge_add_uc_addr_common(struct hclg
 		return hclge_add_mac_vlan_tbl(vport, &req, NULL);
 
 	/* check if we just hit the duplicate */
-	if (!ret)
-		ret = -EINVAL;
+	if (!ret) {
+		dev_warn(&hdev->pdev->dev, "VF %d mac(%pM) exists\n",
+			 vport->vport_id, addr);
+		return 0;
+	}
 
 	dev_err(&hdev->pdev->dev,
 		"PF failed to add unicast entry(%pM) in the MAC table\n",
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/net/ethernet/intel/i40e/i40e_main.c linux-libre-4.19.51-gnu/drivers/net/ethernet/intel/i40e/i40e_main.c
--- linux-libre-4.19.50-gnu/drivers/net/ethernet/intel/i40e/i40e_main.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/net/ethernet/intel/i40e/i40e_main.c	2019-06-15 05:54:11.000000000 -0400
@@ -6758,10 +6758,12 @@ static int i40e_setup_tc(struct net_devi
 	struct i40e_pf *pf = vsi->back;
 	u8 enabled_tc = 0, num_tc, hw;
 	bool need_reset = false;
+	int old_queue_pairs;
 	int ret = -EINVAL;
 	u16 mode;
 	int i;
 
+	old_queue_pairs = vsi->num_queue_pairs;
 	num_tc = mqprio_qopt->qopt.num_tc;
 	hw = mqprio_qopt->qopt.hw;
 	mode = mqprio_qopt->mode;
@@ -6862,6 +6864,7 @@ config_tc:
 		}
 		ret = i40e_configure_queue_channels(vsi);
 		if (ret) {
+			vsi->num_queue_pairs = old_queue_pairs;
 			netdev_info(netdev,
 				    "Failed configuring queue channels\n");
 			need_reset = true;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/net/ethernet/intel/ice/ice_main.c linux-libre-4.19.51-gnu/drivers/net/ethernet/intel/ice/ice_main.c
--- linux-libre-4.19.50-gnu/drivers/net/ethernet/intel/ice/ice_main.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/net/ethernet/intel/ice/ice_main.c	2019-06-15 05:54:11.000000000 -0400
@@ -652,6 +652,9 @@ void ice_print_link_msg(struct ice_vsi *
 	case ICE_FC_RX_PAUSE:
 		fc = "RX";
 		break;
+	case ICE_FC_NONE:
+		fc = "None";
+		break;
 	default:
 		fc = "Unknown";
 		break;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/net/thunderbolt.c linux-libre-4.19.51-gnu/drivers/net/thunderbolt.c
--- linux-libre-4.19.50-gnu/drivers/net/thunderbolt.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/net/thunderbolt.c	2019-06-15 05:54:11.000000000 -0400
@@ -1285,6 +1285,7 @@ static int __maybe_unused tbnet_suspend(
 		tbnet_tear_down(net, true);
 	}
 
+	tb_unregister_protocol_handler(&net->handler);
 	return 0;
 }
 
@@ -1293,6 +1294,8 @@ static int __maybe_unused tbnet_resume(s
 	struct tb_service *svc = tb_to_service(dev);
 	struct tbnet *net = tb_service_get_drvdata(svc);
 
+	tb_register_protocol_handler(&net->handler);
+
 	netif_carrier_off(net->dev);
 	if (netif_running(net->dev)) {
 		netif_device_attach(net->dev);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/nvme/host/pci.c linux-libre-4.19.51-gnu/drivers/nvme/host/pci.c
--- linux-libre-4.19.50-gnu/drivers/nvme/host/pci.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/nvme/host/pci.c	2019-06-15 05:54:11.000000000 -0400
@@ -1132,6 +1132,7 @@ static enum blk_eh_timer_return nvme_tim
 	struct nvme_dev *dev = nvmeq->dev;
 	struct request *abort_req;
 	struct nvme_command cmd;
+	bool shutdown = false;
 	u32 csts = readl(dev->bar + NVME_REG_CSTS);
 
 	/* If PCI error recovery process is happening, we cannot reset or
@@ -1168,12 +1169,14 @@ static enum blk_eh_timer_return nvme_tim
 	 * shutdown, so we return BLK_EH_DONE.
 	 */
 	switch (dev->ctrl.state) {
+	case NVME_CTRL_DELETING:
+		shutdown = true;
 	case NVME_CTRL_CONNECTING:
 	case NVME_CTRL_RESETTING:
 		dev_warn_ratelimited(dev->ctrl.device,
 			 "I/O %d QID %d timeout, disable controller\n",
 			 req->tag, nvmeq->qid);
-		nvme_dev_disable(dev, false);
+		nvme_dev_disable(dev, shutdown);
 		nvme_req(req)->flags |= NVME_REQ_CANCELLED;
 		return BLK_EH_DONE;
 	default:
@@ -2187,8 +2190,11 @@ static void nvme_dev_disable(struct nvme
 	 * must flush all entered requests to their failed completion to avoid
 	 * deadlocking blk-mq hot-cpu notifier.
 	 */
-	if (shutdown)
+	if (shutdown) {
 		nvme_start_queues(&dev->ctrl);
+		if (dev->ctrl.admin_q && !blk_queue_dying(dev->ctrl.admin_q))
+			blk_mq_unquiesce_queue(dev->ctrl.admin_q);
+	}
 	mutex_unlock(&dev->shutdown_lock);
 }
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/nvmem/core.c linux-libre-4.19.51-gnu/drivers/nvmem/core.c
--- linux-libre-4.19.50-gnu/drivers/nvmem/core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/nvmem/core.c	2019-06-15 05:54:11.000000000 -0400
@@ -1028,7 +1028,7 @@ EXPORT_SYMBOL_GPL(nvmem_cell_put);
 static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf)
 {
 	u8 *p, *b;
-	int i, bit_offset = cell->bit_offset;
+	int i, extra, bit_offset = cell->bit_offset;
 
 	p = b = buf;
 	if (bit_offset) {
@@ -1043,11 +1043,16 @@ static void nvmem_shift_read_buffer_in_p
 			p = b;
 			*b++ >>= bit_offset;
 		}
-
-		/* result fits in less bytes */
-		if (cell->bytes != DIV_ROUND_UP(cell->nbits, BITS_PER_BYTE))
-			*p-- = 0;
+	} else {
+		/* point to the msb */
+		p += cell->bytes - 1;
 	}
+
+	/* result fits in less bytes */
+	extra = cell->bytes - DIV_ROUND_UP(cell->nbits, BITS_PER_BYTE);
+	while (--extra >= 0)
+		*p-- = 0;
+
 	/* clear msb bits if any leftover in the last byte */
 	*p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0);
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/nvmem/sunxi_sid.c linux-libre-4.19.51-gnu/drivers/nvmem/sunxi_sid.c
--- linux-libre-4.19.50-gnu/drivers/nvmem/sunxi_sid.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/nvmem/sunxi_sid.c	2019-06-15 05:54:11.000000000 -0400
@@ -235,8 +235,10 @@ static const struct sunxi_sid_cfg sun50i
 static const struct of_device_id sunxi_sid_of_match[] = {
 	{ .compatible = "allwinner,sun4i-a10-sid", .data = &sun4i_a10_cfg },
 	{ .compatible = "allwinner,sun7i-a20-sid", .data = &sun7i_a20_cfg },
+	{ .compatible = "allwinner,sun8i-a83t-sid", .data = &sun50i_a64_cfg },
 	{ .compatible = "allwinner,sun8i-h3-sid", .data = &sun8i_h3_cfg },
 	{ .compatible = "allwinner,sun50i-a64-sid", .data = &sun50i_a64_cfg },
+	{ .compatible = "allwinner,sun50i-h5-sid", .data = &sun50i_a64_cfg },
 	{/* sentinel */},
 };
 MODULE_DEVICE_TABLE(of, sunxi_sid_of_match);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware-ep.c linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware-ep.c
--- linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware-ep.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware-ep.c	2019-06-15 05:54:11.000000000 -0400
@@ -385,6 +385,7 @@ int dw_pcie_ep_raise_msi_irq(struct dw_p
 {
 	struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
 	struct pci_epc *epc = ep->epc;
+	unsigned int aligned_offset;
 	u16 msg_ctrl, msg_data;
 	u32 msg_addr_lower, msg_addr_upper, reg;
 	u64 msg_addr;
@@ -410,13 +411,15 @@ int dw_pcie_ep_raise_msi_irq(struct dw_p
 		reg = ep->msi_cap + PCI_MSI_DATA_32;
 		msg_data = dw_pcie_readw_dbi(pci, reg);
 	}
-	msg_addr = ((u64) msg_addr_upper) << 32 | msg_addr_lower;
+	aligned_offset = msg_addr_lower & (epc->mem->page_size - 1);
+	msg_addr = ((u64)msg_addr_upper) << 32 |
+			(msg_addr_lower & ~aligned_offset);
 	ret = dw_pcie_ep_map_addr(epc, func_no, ep->msi_mem_phys, msg_addr,
 				  epc->mem->page_size);
 	if (ret)
 		return ret;
 
-	writel(msg_data | (interrupt_num - 1), ep->msi_mem);
+	writel(msg_data | (interrupt_num - 1), ep->msi_mem + aligned_offset);
 
 	dw_pcie_ep_unmap_addr(epc, func_no, ep->msi_mem_phys);
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware.h linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware.h
--- linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware.h	2019-06-15 05:54:11.000000000 -0400
@@ -164,6 +164,7 @@ struct pcie_port {
 	struct irq_domain	*irq_domain;
 	struct irq_domain	*msi_domain;
 	dma_addr_t		msi_data;
+	struct page		*msi_page;
 	u32			num_vectors;
 	u32			irq_status[MAX_MSI_CTRLS];
 	raw_spinlock_t		lock;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware-host.c linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware-host.c
--- linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pcie-designware-host.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pcie-designware-host.c	2019-06-15 05:54:11.000000000 -0400
@@ -303,20 +303,24 @@ void dw_pcie_free_msi(struct pcie_port *
 
 	irq_domain_remove(pp->msi_domain);
 	irq_domain_remove(pp->irq_domain);
+
+	if (pp->msi_page)
+		__free_page(pp->msi_page);
 }
 
 void dw_pcie_msi_init(struct pcie_port *pp)
 {
 	struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
 	struct device *dev = pci->dev;
-	struct page *page;
 	u64 msi_target;
 
-	page = alloc_page(GFP_KERNEL);
-	pp->msi_data = dma_map_page(dev, page, 0, PAGE_SIZE, DMA_FROM_DEVICE);
+	pp->msi_page = alloc_page(GFP_KERNEL);
+	pp->msi_data = dma_map_page(dev, pp->msi_page, 0, PAGE_SIZE,
+				    DMA_FROM_DEVICE);
 	if (dma_mapping_error(dev, pp->msi_data)) {
 		dev_err(dev, "Failed to map MSI data\n");
-		__free_page(page);
+		__free_page(pp->msi_page);
+		pp->msi_page = NULL;
 		return;
 	}
 	msi_target = (u64)pp->msi_data;
@@ -439,7 +443,7 @@ int dw_pcie_host_init(struct pcie_port *
 	if (ret)
 		pci->num_viewport = 2;
 
-	if (IS_ENABLED(CONFIG_PCI_MSI) && pci_msi_enabled()) {
+	if (pci_msi_enabled()) {
 		/*
 		 * If a specific SoC driver needs to change the
 		 * default number of vectors, it needs to implement
@@ -477,7 +481,7 @@ int dw_pcie_host_init(struct pcie_port *
 	if (pp->ops->host_init) {
 		ret = pp->ops->host_init(pp);
 		if (ret)
-			goto error;
+			goto err_free_msi;
 	}
 
 	pp->root_bus_nr = pp->busn->start;
@@ -491,7 +495,7 @@ int dw_pcie_host_init(struct pcie_port *
 
 	ret = pci_scan_root_bus_bridge(bridge);
 	if (ret)
-		goto error;
+		goto err_free_msi;
 
 	bus = bridge->bus;
 
@@ -507,6 +511,9 @@ int dw_pcie_host_init(struct pcie_port *
 	pci_bus_add_devices(bus);
 	return 0;
 
+err_free_msi:
+	if (pci_msi_enabled() && !pp->ops->msi_host_init)
+		dw_pcie_free_msi(pp);
 error:
 	pci_free_host_bridge(bridge);
 	return ret;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pci-keystone.c linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pci-keystone.c
--- linux-libre-4.19.50-gnu/drivers/pci/controller/dwc/pci-keystone.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/dwc/pci-keystone.c	2019-06-15 05:54:11.000000000 -0400
@@ -237,6 +237,7 @@ static void ks_pcie_setup_interrupts(str
 		ks_dw_pcie_enable_error_irq(ks_pcie);
 }
 
+#ifdef CONFIG_ARM
 /*
  * When a PCI device does not exist during config cycles, keystone host gets a
  * bus error instead of returning 0xffffffff. This handler always returns 0
@@ -256,6 +257,7 @@ static int keystone_pcie_fault(unsigned
 
 	return 0;
 }
+#endif
 
 static int __init ks_pcie_host_init(struct pcie_port *pp)
 {
@@ -279,12 +281,14 @@ static int __init ks_pcie_host_init(stru
 	val |= BIT(12);
 	writel(val, pci->dbi_base + PCIE_CAP_BASE + PCI_EXP_DEVCTL);
 
+#ifdef CONFIG_ARM
 	/*
 	 * PCIe access errors that result into OCP errors are caught by ARM as
 	 * "External aborts"
 	 */
 	hook_fault_code(17, keystone_pcie_fault, SIGBUS, 0,
 			"Asynchronous external abort");
+#endif
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/pcie-rcar.c linux-libre-4.19.51-gnu/drivers/pci/controller/pcie-rcar.c
--- linux-libre-4.19.50-gnu/drivers/pci/controller/pcie-rcar.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/pcie-rcar.c	2019-06-15 05:54:11.000000000 -0400
@@ -892,7 +892,7 @@ static int rcar_pcie_enable_msi(struct r
 {
 	struct device *dev = pcie->dev;
 	struct rcar_msi *msi = &pcie->msi;
-	unsigned long base;
+	phys_addr_t base;
 	int err, i;
 
 	mutex_init(&msi->lock);
@@ -931,10 +931,14 @@ static int rcar_pcie_enable_msi(struct r
 
 	/* setup MSI data target */
 	msi->pages = __get_free_pages(GFP_KERNEL, 0);
+	if (!msi->pages) {
+		err = -ENOMEM;
+		goto err;
+	}
 	base = virt_to_phys((void *)msi->pages);
 
-	rcar_pci_write_reg(pcie, base | MSIFE, PCIEMSIALR);
-	rcar_pci_write_reg(pcie, 0, PCIEMSIAUR);
+	rcar_pci_write_reg(pcie, lower_32_bits(base) | MSIFE, PCIEMSIALR);
+	rcar_pci_write_reg(pcie, upper_32_bits(base), PCIEMSIAUR);
 
 	/* enable all MSI interrupts */
 	rcar_pci_write_reg(pcie, 0xffffffff, PCIEMSIIER);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/controller/pcie-xilinx.c linux-libre-4.19.51-gnu/drivers/pci/controller/pcie-xilinx.c
--- linux-libre-4.19.50-gnu/drivers/pci/controller/pcie-xilinx.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/controller/pcie-xilinx.c	2019-06-15 05:54:11.000000000 -0400
@@ -336,14 +336,19 @@ static const struct irq_domain_ops msi_d
  * xilinx_pcie_enable_msi - Enable MSI support
  * @port: PCIe port information
  */
-static void xilinx_pcie_enable_msi(struct xilinx_pcie_port *port)
+static int xilinx_pcie_enable_msi(struct xilinx_pcie_port *port)
 {
 	phys_addr_t msg_addr;
 
 	port->msi_pages = __get_free_pages(GFP_KERNEL, 0);
+	if (!port->msi_pages)
+		return -ENOMEM;
+
 	msg_addr = virt_to_phys((void *)port->msi_pages);
 	pcie_write(port, 0x0, XILINX_PCIE_REG_MSIBASE1);
 	pcie_write(port, msg_addr, XILINX_PCIE_REG_MSIBASE2);
+
+	return 0;
 }
 
 /* INTx Functions */
@@ -498,6 +503,7 @@ static int xilinx_pcie_init_irq_domain(s
 	struct device *dev = port->dev;
 	struct device_node *node = dev->of_node;
 	struct device_node *pcie_intc_node;
+	int ret;
 
 	/* Setup INTx */
 	pcie_intc_node = of_get_next_child(node, NULL);
@@ -526,7 +532,9 @@ static int xilinx_pcie_init_irq_domain(s
 			return -ENODEV;
 		}
 
-		xilinx_pcie_enable_msi(port);
+		ret = xilinx_pcie_enable_msi(port);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/hotplug/rpadlpar_core.c linux-libre-4.19.51-gnu/drivers/pci/hotplug/rpadlpar_core.c
--- linux-libre-4.19.50-gnu/drivers/pci/hotplug/rpadlpar_core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/hotplug/rpadlpar_core.c	2019-06-15 05:54:11.000000000 -0400
@@ -51,6 +51,7 @@ static struct device_node *find_vio_slot
 		if (rc == 0)
 			break;
 	}
+	of_node_put(parent);
 
 	return dn;
 }
@@ -71,6 +72,7 @@ static struct device_node *find_php_slot
 	return np;
 }
 
+/* Returns a device_node with its reference count incremented */
 static struct device_node *find_dlpar_node(char *drc_name, int *node_type)
 {
 	struct device_node *dn;
@@ -306,6 +308,7 @@ int dlpar_add_slot(char *drc_name)
 			rc = dlpar_add_phb(drc_name, dn);
 			break;
 	}
+	of_node_put(dn);
 
 	printk(KERN_INFO "%s: slot %s added\n", DLPAR_MODULE_NAME, drc_name);
 exit:
@@ -439,6 +442,7 @@ int dlpar_remove_slot(char *drc_name)
 			rc = dlpar_remove_pci_slot(drc_name, dn);
 			break;
 	}
+	of_node_put(dn);
 	vm_unmap_aliases();
 
 	printk(KERN_INFO "%s: slot %s removed\n", DLPAR_MODULE_NAME, drc_name);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pci/switch/switchtec.c linux-libre-4.19.51-gnu/drivers/pci/switch/switchtec.c
--- linux-libre-4.19.50-gnu/drivers/pci/switch/switchtec.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pci/switch/switchtec.c	2019-06-15 05:54:11.000000000 -0400
@@ -1116,7 +1116,8 @@ static int mask_event(struct switchtec_d
 	if (!(hdr & SWITCHTEC_EVENT_OCCURRED && hdr & SWITCHTEC_EVENT_EN_IRQ))
 		return 0;
 
-	if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE)
+	if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE ||
+	    eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP)
 		return 0;
 
 	dev_dbg(&stdev->dev, "%s: %d %d %x\n", __func__, eid, idx, hdr);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/platform/chrome/cros_ec_proto.c linux-libre-4.19.51-gnu/drivers/platform/chrome/cros_ec_proto.c
--- linux-libre-4.19.50-gnu/drivers/platform/chrome/cros_ec_proto.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/platform/chrome/cros_ec_proto.c	2019-06-15 05:54:11.000000000 -0400
@@ -67,6 +67,17 @@ static int send_command(struct cros_ec_d
 	else
 		xfer_fxn = ec_dev->cmd_xfer;
 
+	if (!xfer_fxn) {
+		/*
+		 * This error can happen if a communication error happened and
+		 * the EC is trying to use protocol v2, on an underlying
+		 * communication mechanism that does not support v2.
+		 */
+		dev_err_once(ec_dev->dev,
+			     "missing EC transfer API, cannot send command\n");
+		return -EIO;
+	}
+
 	ret = (*xfer_fxn)(ec_dev, msg);
 	if (msg->result == EC_RES_IN_PROGRESS) {
 		int i;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/platform/x86/intel_pmc_ipc.c linux-libre-4.19.51-gnu/drivers/platform/x86/intel_pmc_ipc.c
--- linux-libre-4.19.50-gnu/drivers/platform/x86/intel_pmc_ipc.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/platform/x86/intel_pmc_ipc.c	2019-06-15 05:54:11.000000000 -0400
@@ -776,13 +776,17 @@ static int ipc_create_pmc_devices(void)
 	if (ret) {
 		dev_err(ipcdev.dev, "Failed to add punit platform device\n");
 		platform_device_unregister(ipcdev.tco_dev);
+		return ret;
 	}
 
 	if (!ipcdev.telem_res_inval) {
 		ret = ipc_create_telemetry_device();
-		if (ret)
+		if (ret) {
 			dev_warn(ipcdev.dev,
 				"Failed to add telemetry platform device\n");
+			platform_device_unregister(ipcdev.punit_dev);
+			platform_device_unregister(ipcdev.tco_dev);
+		}
 	}
 
 	return ret;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/power/supply/max14656_charger_detector.c linux-libre-4.19.51-gnu/drivers/power/supply/max14656_charger_detector.c
--- linux-libre-4.19.50-gnu/drivers/power/supply/max14656_charger_detector.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/power/supply/max14656_charger_detector.c	2019-06-15 05:54:11.000000000 -0400
@@ -280,6 +280,13 @@ static int max14656_probe(struct i2c_cli
 
 	INIT_DELAYED_WORK(&chip->irq_work, max14656_irq_worker);
 
+	chip->detect_psy = devm_power_supply_register(dev,
+		       &chip->psy_desc, &psy_cfg);
+	if (IS_ERR(chip->detect_psy)) {
+		dev_err(dev, "power_supply_register failed\n");
+		return -EINVAL;
+	}
+
 	ret = devm_request_irq(dev, chip->irq, max14656_irq,
 			       IRQF_TRIGGER_FALLING,
 			       MAX14656_NAME, chip);
@@ -289,13 +296,6 @@ static int max14656_probe(struct i2c_cli
 	}
 	enable_irq_wake(chip->irq);
 
-	chip->detect_psy = devm_power_supply_register(dev,
-		       &chip->psy_desc, &psy_cfg);
-	if (IS_ERR(chip->detect_psy)) {
-		dev_err(dev, "power_supply_register failed\n");
-		return -EINVAL;
-	}
-
 	schedule_delayed_work(&chip->irq_work, msecs_to_jiffies(2000));
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pwm/core.c linux-libre-4.19.51-gnu/drivers/pwm/core.c
--- linux-libre-4.19.50-gnu/drivers/pwm/core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pwm/core.c	2019-06-15 05:54:11.000000000 -0400
@@ -311,10 +311,12 @@ int pwmchip_add_with_polarity(struct pwm
 	if (IS_ENABLED(CONFIG_OF))
 		of_pwmchip_add(chip);
 
-	pwmchip_sysfs_export(chip);
-
 out:
 	mutex_unlock(&pwm_lock);
+
+	if (!ret)
+		pwmchip_sysfs_export(chip);
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(pwmchip_add_with_polarity);
@@ -348,7 +350,7 @@ int pwmchip_remove(struct pwm_chip *chip
 	unsigned int i;
 	int ret = 0;
 
-	pwmchip_sysfs_unexport_children(chip);
+	pwmchip_sysfs_unexport(chip);
 
 	mutex_lock(&pwm_lock);
 
@@ -368,8 +370,6 @@ int pwmchip_remove(struct pwm_chip *chip
 
 	free_pwms(chip);
 
-	pwmchip_sysfs_unexport(chip);
-
 out:
 	mutex_unlock(&pwm_lock);
 	return ret;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pwm/pwm-meson.c linux-libre-4.19.51-gnu/drivers/pwm/pwm-meson.c
--- linux-libre-4.19.50-gnu/drivers/pwm/pwm-meson.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pwm/pwm-meson.c	2019-06-15 05:54:11.000000000 -0400
@@ -111,6 +111,10 @@ struct meson_pwm {
 	const struct meson_pwm_data *data;
 	void __iomem *base;
 	u8 inverter_mask;
+	/*
+	 * Protects register (write) access to the REG_MISC_AB register
+	 * that is shared between the two PWMs.
+	 */
 	spinlock_t lock;
 };
 
@@ -235,6 +239,7 @@ static void meson_pwm_enable(struct meso
 {
 	u32 value, clk_shift, clk_enable, enable;
 	unsigned int offset;
+	unsigned long flags;
 
 	switch (id) {
 	case 0:
@@ -255,6 +260,8 @@ static void meson_pwm_enable(struct meso
 		return;
 	}
 
+	spin_lock_irqsave(&meson->lock, flags);
+
 	value = readl(meson->base + REG_MISC_AB);
 	value &= ~(MISC_CLK_DIV_MASK << clk_shift);
 	value |= channel->pre_div << clk_shift;
@@ -267,11 +274,14 @@ static void meson_pwm_enable(struct meso
 	value = readl(meson->base + REG_MISC_AB);
 	value |= enable;
 	writel(value, meson->base + REG_MISC_AB);
+
+	spin_unlock_irqrestore(&meson->lock, flags);
 }
 
 static void meson_pwm_disable(struct meson_pwm *meson, unsigned int id)
 {
 	u32 value, enable;
+	unsigned long flags;
 
 	switch (id) {
 	case 0:
@@ -286,9 +296,13 @@ static void meson_pwm_disable(struct mes
 		return;
 	}
 
+	spin_lock_irqsave(&meson->lock, flags);
+
 	value = readl(meson->base + REG_MISC_AB);
 	value &= ~enable;
 	writel(value, meson->base + REG_MISC_AB);
+
+	spin_unlock_irqrestore(&meson->lock, flags);
 }
 
 static int meson_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
@@ -296,19 +310,16 @@ static int meson_pwm_apply(struct pwm_ch
 {
 	struct meson_pwm_channel *channel = pwm_get_chip_data(pwm);
 	struct meson_pwm *meson = to_meson_pwm(chip);
-	unsigned long flags;
 	int err = 0;
 
 	if (!state)
 		return -EINVAL;
 
-	spin_lock_irqsave(&meson->lock, flags);
-
 	if (!state->enabled) {
 		meson_pwm_disable(meson, pwm->hwpwm);
 		channel->state.enabled = false;
 
-		goto unlock;
+		return 0;
 	}
 
 	if (state->period != channel->state.period ||
@@ -329,7 +340,7 @@ static int meson_pwm_apply(struct pwm_ch
 		err = meson_pwm_calc(meson, channel, pwm->hwpwm,
 				     state->duty_cycle, state->period);
 		if (err < 0)
-			goto unlock;
+			return err;
 
 		channel->state.polarity = state->polarity;
 		channel->state.period = state->period;
@@ -341,9 +352,7 @@ static int meson_pwm_apply(struct pwm_ch
 		channel->state.enabled = true;
 	}
 
-unlock:
-	spin_unlock_irqrestore(&meson->lock, flags);
-	return err;
+	return 0;
 }
 
 static void meson_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pwm/pwm-tiehrpwm.c linux-libre-4.19.51-gnu/drivers/pwm/pwm-tiehrpwm.c
--- linux-libre-4.19.50-gnu/drivers/pwm/pwm-tiehrpwm.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pwm/pwm-tiehrpwm.c	2019-06-15 05:54:11.000000000 -0400
@@ -382,6 +382,8 @@ static void ehrpwm_pwm_disable(struct pw
 	}
 
 	/* Update shadow register first before modifying active register */
+	ehrpwm_modify(pc->mmio_base, AQSFRC, AQSFRC_RLDCSF_MASK,
+		      AQSFRC_RLDCSF_ZRO);
 	ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val);
 	/*
 	 * Changes to immediate action on Action Qualifier. This puts
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/pwm/sysfs.c linux-libre-4.19.51-gnu/drivers/pwm/sysfs.c
--- linux-libre-4.19.50-gnu/drivers/pwm/sysfs.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/pwm/sysfs.c	2019-06-15 05:54:11.000000000 -0400
@@ -401,19 +401,6 @@ void pwmchip_sysfs_export(struct pwm_chi
 void pwmchip_sysfs_unexport(struct pwm_chip *chip)
 {
 	struct device *parent;
-
-	parent = class_find_device(&pwm_class, NULL, chip,
-				   pwmchip_sysfs_match);
-	if (parent) {
-		/* for class_find_device() */
-		put_device(parent);
-		device_unregister(parent);
-	}
-}
-
-void pwmchip_sysfs_unexport_children(struct pwm_chip *chip)
-{
-	struct device *parent;
 	unsigned int i;
 
 	parent = class_find_device(&pwm_class, NULL, chip,
@@ -429,6 +416,7 @@ void pwmchip_sysfs_unexport_children(str
 	}
 
 	put_device(parent);
+	device_unregister(parent);
 }
 
 static int __init pwm_sysfs_init(void)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/rapidio/rio_cm.c linux-libre-4.19.51-gnu/drivers/rapidio/rio_cm.c
--- linux-libre-4.19.50-gnu/drivers/rapidio/rio_cm.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/rapidio/rio_cm.c	2019-06-15 05:54:11.000000000 -0400
@@ -2145,6 +2145,14 @@ static int riocm_add_mport(struct device
 	mutex_init(&cm->rx_lock);
 	riocm_rx_fill(cm, RIOCM_RX_RING_SIZE);
 	cm->rx_wq = create_workqueue(DRV_NAME "/rxq");
+	if (!cm->rx_wq) {
+		riocm_error("failed to allocate IBMBOX_%d on %s",
+			    cmbox, mport->name);
+		rio_release_outb_mbox(mport, cmbox);
+		kfree(cm);
+		return -ENOMEM;
+	}
+
 	INIT_WORK(&cm->rx_work, rio_ibmsg_handler);
 
 	cm->tx_slot = 0;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/scsi/qla2xxx/qla_gs.c linux-libre-4.19.51-gnu/drivers/scsi/qla2xxx/qla_gs.c
--- linux-libre-4.19.50-gnu/drivers/scsi/qla2xxx/qla_gs.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/scsi/qla2xxx/qla_gs.c	2019-06-15 05:54:11.000000000 -0400
@@ -3261,6 +3261,8 @@ static void qla24xx_async_gpsc_sp_done(v
 	    "Async done-%s res %x, WWPN %8phC \n",
 	    sp->name, res, fcport->port_name);
 
+	fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
+
 	if (res == QLA_FUNCTION_TIMEOUT)
 		return;
 
@@ -4604,6 +4606,7 @@ int qla24xx_async_gnnid(scsi_qla_host_t
 
 done_free_sp:
 	sp->free(sp);
+	fcport->flags &= ~FCF_ASYNC_SENT;
 done:
 	return rval;
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c linux-libre-4.19.51-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c
--- linux-libre-4.19.50-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c	2019-06-15 05:54:11.000000000 -0400
@@ -1104,7 +1104,7 @@ static bool pwrap_is_pmic_cipher_ready(s
 static int pwrap_init_cipher(struct pmic_wrapper *wrp)
 {
 	int ret;
-	u32 rdata;
+	u32 rdata = 0;
 
 	pwrap_writel(wrp, 0x1, PWRAP_CIPHER_SWRST);
 	pwrap_writel(wrp, 0x0, PWRAP_CIPHER_SWRST);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/soc/renesas/renesas-soc.c linux-libre-4.19.51-gnu/drivers/soc/renesas/renesas-soc.c
--- linux-libre-4.19.50-gnu/drivers/soc/renesas/renesas-soc.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/soc/renesas/renesas-soc.c	2019-06-15 05:54:11.000000000 -0400
@@ -285,6 +285,9 @@ static int __init renesas_soc_init(void)
 		/* R-Car M3-W ES1.1 incorrectly identifies as ES2.0 */
 		if ((product & 0x7fff) == 0x5210)
 			product ^= 0x11;
+		/* R-Car M3-W ES1.3 incorrectly identifies as ES2.1 */
+		if ((product & 0x7fff) == 0x5211)
+			product ^= 0x12;
 		if (soc->id && ((product >> 8) & 0xff) != soc->id) {
 			pr_warn("SoC mismatch (product = 0x%x)\n", product);
 			return -ENODEV;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/soc/rockchip/grf.c linux-libre-4.19.51-gnu/drivers/soc/rockchip/grf.c
--- linux-libre-4.19.50-gnu/drivers/soc/rockchip/grf.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/soc/rockchip/grf.c	2019-06-15 05:54:11.000000000 -0400
@@ -66,9 +66,11 @@ static const struct rockchip_grf_info rk
 };
 
 #define RK3288_GRF_SOC_CON0		0x244
+#define RK3288_GRF_SOC_CON2		0x24c
 
 static const struct rockchip_grf_value rk3288_defaults[] __initconst = {
 	{ "jtag switching", RK3288_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 12) },
+	{ "pwm select", RK3288_GRF_SOC_CON2, HIWORD_UPDATE(1, 1, 0) },
 };
 
 static const struct rockchip_grf_info rk3288_grf __initconst = {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/spi/spi-pxa2xx.c linux-libre-4.19.51-gnu/drivers/spi/spi-pxa2xx.c
--- linux-libre-4.19.50-gnu/drivers/spi/spi-pxa2xx.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/spi/spi-pxa2xx.c	2019-06-15 05:54:11.000000000 -0400
@@ -1416,12 +1416,7 @@ static const struct pci_device_id pxa2xx
 
 static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
 {
-	struct device *dev = param;
-
-	if (dev != chan->device->dev->parent)
-		return false;
-
-	return true;
+	return param == chan->device->dev;
 }
 
 static struct pxa2xx_spi_master *
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/thermal/qcom/tsens.c linux-libre-4.19.51-gnu/drivers/thermal/qcom/tsens.c
--- linux-libre-4.19.50-gnu/drivers/thermal/qcom/tsens.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/thermal/qcom/tsens.c	2019-06-15 05:54:11.000000000 -0400
@@ -171,7 +171,8 @@ static int tsens_probe(struct platform_d
 	if (tmdev->ops->calibrate) {
 		ret = tmdev->ops->calibrate(tmdev);
 		if (ret < 0) {
-			dev_err(dev, "tsens calibration failed\n");
+			if (ret != -EPROBE_DEFER)
+				dev_err(dev, "tsens calibration failed\n");
 			return ret;
 		}
 	}
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/thermal/rcar_gen3_thermal.c linux-libre-4.19.51-gnu/drivers/thermal/rcar_gen3_thermal.c
--- linux-libre-4.19.50-gnu/drivers/thermal/rcar_gen3_thermal.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/thermal/rcar_gen3_thermal.c	2019-06-15 05:54:11.000000000 -0400
@@ -328,6 +328,9 @@ MODULE_DEVICE_TABLE(of, rcar_gen3_therma
 static int rcar_gen3_thermal_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev);
+
+	rcar_thermal_irq_set(priv, false);
 
 	pm_runtime_put(dev);
 	pm_runtime_disable(dev);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/tty/serial/8250/8250_dw.c linux-libre-4.19.51-gnu/drivers/tty/serial/8250/8250_dw.c
--- linux-libre-4.19.50-gnu/drivers/tty/serial/8250/8250_dw.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/tty/serial/8250/8250_dw.c	2019-06-15 05:54:11.000000000 -0400
@@ -365,7 +365,7 @@ static bool dw8250_fallback_dma_filter(s
 
 static bool dw8250_idma_filter(struct dma_chan *chan, void *param)
 {
-	return param == chan->device->dev->parent;
+	return param == chan->device->dev;
 }
 
 /*
@@ -434,7 +434,7 @@ static void dw8250_quirks(struct uart_po
 		data->uart_16550_compatible = true;
 	}
 
-	/* Platforms with iDMA */
+	/* Platforms with iDMA 64-bit */
 	if (platform_get_resource_byname(to_platform_device(p->dev),
 					 IORESOURCE_MEM, "lpss_priv")) {
 		data->dma.rx_param = p->dev->parent;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/usb/typec/fusb302/fusb302.c linux-libre-4.19.51-gnu/drivers/usb/typec/fusb302/fusb302.c
--- linux-libre-4.19.50-gnu/drivers/usb/typec/fusb302/fusb302.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/usb/typec/fusb302/fusb302.c	2019-06-15 05:54:11.000000000 -0400
@@ -641,6 +641,8 @@ static int fusb302_set_toggling(struct f
 			return ret;
 		chip->intr_togdone = false;
 	} else {
+		/* Datasheet says vconn MUST be off when toggling */
+		WARN(chip->vconn_on, "Vconn is on during toggle start");
 		/* unmask TOGDONE interrupt */
 		ret = fusb302_i2c_clear_bits(chip, FUSB_REG_MASKA,
 					     FUSB_REG_MASKA_TOGDONE);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/vfio/vfio.c linux-libre-4.19.51-gnu/drivers/vfio/vfio.c
--- linux-libre-4.19.50-gnu/drivers/vfio/vfio.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/vfio/vfio.c	2019-06-15 05:54:11.000000000 -0400
@@ -34,6 +34,7 @@
 #include <linux/uaccess.h>
 #include <linux/vfio.h>
 #include <linux/wait.h>
+#include <linux/sched/signal.h>
 
 #define DRIVER_VERSION	"0.3"
 #define DRIVER_AUTHOR	"Alex Williamson <alex.williamson@redhat.com>"
@@ -904,30 +905,17 @@ void *vfio_device_data(struct vfio_devic
 }
 EXPORT_SYMBOL_GPL(vfio_device_data);
 
-/* Given a referenced group, check if it contains the device */
-static bool vfio_dev_present(struct vfio_group *group, struct device *dev)
-{
-	struct vfio_device *device;
-
-	device = vfio_group_get_device(group, dev);
-	if (!device)
-		return false;
-
-	vfio_device_put(device);
-	return true;
-}
-
 /*
  * Decrement the device reference count and wait for the device to be
  * removed.  Open file descriptors for the device... */
 void *vfio_del_group_dev(struct device *dev)
 {
+	DEFINE_WAIT_FUNC(wait, woken_wake_function);
 	struct vfio_device *device = dev_get_drvdata(dev);
 	struct vfio_group *group = device->group;
 	void *device_data = device->device_data;
 	struct vfio_unbound_dev *unbound;
 	unsigned int i = 0;
-	long ret;
 	bool interrupted = false;
 
 	/*
@@ -964,6 +952,8 @@ void *vfio_del_group_dev(struct device *
 	 * interval with counter to allow the driver to take escalating
 	 * measures to release the device if it has the ability to do so.
 	 */
+	add_wait_queue(&vfio.release_q, &wait);
+
 	do {
 		device = vfio_group_get_device(group, dev);
 		if (!device)
@@ -975,12 +965,10 @@ void *vfio_del_group_dev(struct device *
 		vfio_device_put(device);
 
 		if (interrupted) {
-			ret = wait_event_timeout(vfio.release_q,
-					!vfio_dev_present(group, dev), HZ * 10);
+			wait_woken(&wait, TASK_UNINTERRUPTIBLE, HZ * 10);
 		} else {
-			ret = wait_event_interruptible_timeout(vfio.release_q,
-					!vfio_dev_present(group, dev), HZ * 10);
-			if (ret == -ERESTARTSYS) {
+			wait_woken(&wait, TASK_INTERRUPTIBLE, HZ * 10);
+			if (signal_pending(current)) {
 				interrupted = true;
 				dev_warn(dev,
 					 "Device is currently in use, task"
@@ -989,8 +977,10 @@ void *vfio_del_group_dev(struct device *
 					 current->comm, task_pid_nr(current));
 			}
 		}
-	} while (ret <= 0);
 
+	} while (1);
+
+	remove_wait_queue(&vfio.release_q, &wait);
 	/*
 	 * In order to support multiple devices per group, devices can be
 	 * plucked from the group while other devices in the group are still
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/video/fbdev/hgafb.c linux-libre-4.19.51-gnu/drivers/video/fbdev/hgafb.c
--- linux-libre-4.19.50-gnu/drivers/video/fbdev/hgafb.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/video/fbdev/hgafb.c	2019-06-15 05:54:11.000000000 -0400
@@ -285,6 +285,8 @@ static int hga_card_detect(void)
 	hga_vram_len  = 0x08000;
 
 	hga_vram = ioremap(0xb0000, hga_vram_len);
+	if (!hga_vram)
+		goto error;
 
 	if (request_region(0x3b0, 12, "hgafb"))
 		release_io_ports = 1;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/video/fbdev/imsttfb.c linux-libre-4.19.51-gnu/drivers/video/fbdev/imsttfb.c
--- linux-libre-4.19.50-gnu/drivers/video/fbdev/imsttfb.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/video/fbdev/imsttfb.c	2019-06-15 05:54:11.000000000 -0400
@@ -1516,6 +1516,11 @@ static int imsttfb_probe(struct pci_dev
 	info->fix.smem_start = addr;
 	info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
 					    0x400000 : 0x800000);
+	if (!info->screen_base) {
+		release_mem_region(addr, size);
+		framebuffer_release(info);
+		return -ENOMEM;
+	}
 	info->fix.mmio_start = addr + 0x800000;
 	par->dc_regs = ioremap(addr + 0x800000, 0x1000);
 	par->cmap_regs_phys = addr + 0x840000;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/watchdog/imx2_wdt.c linux-libre-4.19.51-gnu/drivers/watchdog/imx2_wdt.c
--- linux-libre-4.19.50-gnu/drivers/watchdog/imx2_wdt.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/watchdog/imx2_wdt.c	2019-06-15 05:54:11.000000000 -0400
@@ -178,8 +178,10 @@ static void __imx2_wdt_set_timeout(struc
 static int imx2_wdt_set_timeout(struct watchdog_device *wdog,
 				unsigned int new_timeout)
 {
-	__imx2_wdt_set_timeout(wdog, new_timeout);
+	unsigned int actual;
 
+	actual = min(new_timeout, wdog->max_hw_heartbeat_ms * 1000);
+	__imx2_wdt_set_timeout(wdog, actual);
 	wdog->timeout = new_timeout;
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.19.50-gnu/drivers/watchdog/Kconfig linux-libre-4.19.51-gnu/drivers/watchdog/Kconfig
--- linux-libre-4.19.50-gnu/drivers/watchdog/Kconfig	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/drivers/watchdog/Kconfig	2019-06-15 05:54:11.000000000 -0400
@@ -1967,6 +1967,7 @@ comment "Watchdog Pretimeout Governors"
 
 config WATCHDOG_PRETIMEOUT_GOV
 	bool "Enable watchdog pretimeout governors"
+	depends on WATCHDOG_CORE
 	help
 	  The option allows to select watchdog pretimeout governors.
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/configfs/dir.c linux-libre-4.19.51-gnu/fs/configfs/dir.c
--- linux-libre-4.19.50-gnu/fs/configfs/dir.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/configfs/dir.c	2019-06-15 05:54:11.000000000 -0400
@@ -1755,12 +1755,19 @@ int configfs_register_group(struct confi
 
 	inode_lock_nested(d_inode(parent), I_MUTEX_PARENT);
 	ret = create_default_group(parent_group, group);
-	if (!ret) {
-		spin_lock(&configfs_dirent_lock);
-		configfs_dir_set_ready(group->cg_item.ci_dentry->d_fsdata);
-		spin_unlock(&configfs_dirent_lock);
-	}
+	if (ret)
+		goto err_out;
+
+	spin_lock(&configfs_dirent_lock);
+	configfs_dir_set_ready(group->cg_item.ci_dentry->d_fsdata);
+	spin_unlock(&configfs_dirent_lock);
+	inode_unlock(d_inode(parent));
+	return 0;
+err_out:
 	inode_unlock(d_inode(parent));
+	mutex_lock(&subsys->su_mutex);
+	unlink_group(group);
+	mutex_unlock(&subsys->su_mutex);
 	return ret;
 }
 EXPORT_SYMBOL(configfs_register_group);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/dax.c linux-libre-4.19.51-gnu/fs/dax.c
--- linux-libre-4.19.50-gnu/fs/dax.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/dax.c	2019-06-15 05:54:11.000000000 -0400
@@ -908,7 +908,7 @@ static void dax_mapping_entry_mkclean(st
 				goto unlock_pmd;
 
 			flush_cache_page(vma, address, pfn);
-			pmd = pmdp_huge_clear_flush(vma, address, pmdp);
+			pmd = pmdp_invalidate(vma, address, pmdp);
 			pmd = pmd_wrprotect(pmd);
 			pmd = pmd_mkclean(pmd);
 			set_pmd_at(vma->vm_mm, address, pmdp, pmd);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/f2fs.h linux-libre-4.19.51-gnu/fs/f2fs/f2fs.h
--- linux-libre-4.19.50-gnu/fs/f2fs/f2fs.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/f2fs.h	2019-06-15 05:54:11.000000000 -0400
@@ -1744,6 +1744,7 @@ enospc:
 	return -ENOSPC;
 }
 
+void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...);
 static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
 						struct inode *inode,
 						block_t count)
@@ -1752,13 +1753,21 @@ static inline void dec_valid_block_count
 
 	spin_lock(&sbi->stat_lock);
 	f2fs_bug_on(sbi, sbi->total_valid_block_count < (block_t) count);
-	f2fs_bug_on(sbi, inode->i_blocks < sectors);
 	sbi->total_valid_block_count -= (block_t)count;
 	if (sbi->reserved_blocks &&
 		sbi->current_reserved_blocks < sbi->reserved_blocks)
 		sbi->current_reserved_blocks = min(sbi->reserved_blocks,
 					sbi->current_reserved_blocks + count);
 	spin_unlock(&sbi->stat_lock);
+	if (unlikely(inode->i_blocks < sectors)) {
+		f2fs_msg(sbi->sb, KERN_WARNING,
+			"Inconsistent i_blocks, ino:%lu, iblocks:%llu, sectors:%llu",
+			inode->i_ino,
+			(unsigned long long)inode->i_blocks,
+			(unsigned long long)sectors);
+		set_sbi_flag(sbi, SBI_NEED_FSCK);
+		return;
+	}
 	f2fs_i_blocks_write(inode, count, false, true);
 }
 
@@ -2488,7 +2497,9 @@ static inline void *inline_xattr_addr(st
 
 static inline int inline_xattr_size(struct inode *inode)
 {
-	return get_inline_xattr_addrs(inode) * sizeof(__le32);
+	if (f2fs_has_inline_xattr(inode))
+		return get_inline_xattr_addrs(inode) * sizeof(__le32);
+	return 0;
 }
 
 static inline int f2fs_has_inline_data(struct inode *inode)
@@ -2727,7 +2738,6 @@ static inline void f2fs_update_iostat(st
 
 bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
 					block_t blkaddr, int type);
-void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...);
 static inline void verify_blkaddr(struct f2fs_sb_info *sbi,
 					block_t blkaddr, int type)
 {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/inode.c linux-libre-4.19.51-gnu/fs/f2fs/inode.c
--- linux-libre-4.19.50-gnu/fs/f2fs/inode.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/inode.c	2019-06-15 05:54:11.000000000 -0400
@@ -179,8 +179,8 @@ bool f2fs_inode_chksum_verify(struct f2f
 
 	if (provided != calculated)
 		f2fs_msg(sbi->sb, KERN_WARNING,
-			"checksum invalid, ino = %x, %x vs. %x",
-			ino_of_node(page), provided, calculated);
+			"checksum invalid, nid = %lu, ino_of_node = %x, %x vs. %x",
+			page->index, ino_of_node(page), provided, calculated);
 
 	return provided == calculated;
 }
@@ -476,6 +476,7 @@ make_now:
 	return inode;
 
 bad_inode:
+	f2fs_inode_synced(inode);
 	iget_failed(inode);
 	trace_f2fs_iget_exit(inode, ret);
 	return ERR_PTR(ret);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/node.c linux-libre-4.19.51-gnu/fs/f2fs/node.c
--- linux-libre-4.19.50-gnu/fs/f2fs/node.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/node.c	2019-06-15 05:54:11.000000000 -0400
@@ -1180,8 +1180,14 @@ int f2fs_remove_inode_page(struct inode
 		f2fs_put_dnode(&dn);
 		return -EIO;
 	}
-	f2fs_bug_on(F2FS_I_SB(inode),
-			inode->i_blocks != 0 && inode->i_blocks != 8);
+
+	if (unlikely(inode->i_blocks != 0 && inode->i_blocks != 8)) {
+		f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING,
+			"Inconsistent i_blocks, ino:%lu, iblocks:%llu",
+			inode->i_ino,
+			(unsigned long long)inode->i_blocks);
+		set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK);
+	}
 
 	/* will put inode & node pages */
 	err = truncate_node(&dn);
@@ -1276,9 +1282,10 @@ static int read_node_page(struct page *p
 	int err;
 
 	if (PageUptodate(page)) {
-#ifdef CONFIG_F2FS_CHECK_FS
-		f2fs_bug_on(sbi, !f2fs_inode_chksum_verify(sbi, page));
-#endif
+		if (!f2fs_inode_chksum_verify(sbi, page)) {
+			ClearPageUptodate(page);
+			return -EBADMSG;
+		}
 		return LOCKED_PAGE;
 	}
 
@@ -2073,6 +2080,9 @@ static bool add_free_nid(struct f2fs_sb_
 	if (unlikely(nid == 0))
 		return false;
 
+	if (unlikely(f2fs_check_nid_range(sbi, nid)))
+		return false;
+
 	i = f2fs_kmem_cache_alloc(free_nid_slab, GFP_NOFS);
 	i->nid = nid;
 	i->state = FREE_NID;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/recovery.c linux-libre-4.19.51-gnu/fs/f2fs/recovery.c
--- linux-libre-4.19.50-gnu/fs/f2fs/recovery.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/recovery.c	2019-06-15 05:54:11.000000000 -0400
@@ -485,7 +485,15 @@ retry_dn:
 		goto err;
 
 	f2fs_bug_on(sbi, ni.ino != ino_of_node(page));
-	f2fs_bug_on(sbi, ofs_of_node(dn.node_page) != ofs_of_node(page));
+
+	if (ofs_of_node(dn.node_page) != ofs_of_node(page)) {
+		f2fs_msg(sbi->sb, KERN_WARNING,
+			"Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u",
+			inode->i_ino, ofs_of_node(dn.node_page),
+			ofs_of_node(page));
+		err = -EFAULT;
+		goto err;
+	}
 
 	for (; start < end; start++, dn.ofs_in_node++) {
 		block_t src, dest;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/segment.c linux-libre-4.19.51-gnu/fs/f2fs/segment.c
--- linux-libre-4.19.50-gnu/fs/f2fs/segment.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/segment.c	2019-06-15 05:54:11.000000000 -0400
@@ -3069,13 +3069,18 @@ int f2fs_inplace_write_data(struct f2fs_
 {
 	int err;
 	struct f2fs_sb_info *sbi = fio->sbi;
+	unsigned int segno;
 
 	fio->new_blkaddr = fio->old_blkaddr;
 	/* i/o temperature is needed for passing down write hints */
 	__get_segment_type(fio);
 
-	f2fs_bug_on(sbi, !IS_DATASEG(get_seg_entry(sbi,
-			GET_SEGNO(sbi, fio->new_blkaddr))->type));
+	segno = GET_SEGNO(sbi, fio->new_blkaddr);
+
+	if (!IS_DATASEG(get_seg_entry(sbi, segno)->type)) {
+		set_sbi_flag(sbi, SBI_NEED_FSCK);
+		return -EFAULT;
+	}
 
 	stat_inc_inplace_blocks(fio->sbi);
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/f2fs/segment.h linux-libre-4.19.51-gnu/fs/f2fs/segment.h
--- linux-libre-4.19.50-gnu/fs/f2fs/segment.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/f2fs/segment.h	2019-06-15 05:54:11.000000000 -0400
@@ -660,7 +660,6 @@ static inline void verify_block_addr(str
 static inline int check_block_count(struct f2fs_sb_info *sbi,
 		int segno, struct f2fs_sit_entry *raw_sit)
 {
-#ifdef CONFIG_F2FS_CHECK_FS
 	bool is_valid  = test_bit_le(0, raw_sit->valid_map) ? true : false;
 	int valid_blocks = 0;
 	int cur_pos = 0, next_pos;
@@ -687,7 +686,7 @@ static inline int check_block_count(stru
 		set_sbi_flag(sbi, SBI_NEED_FSCK);
 		return -EINVAL;
 	}
-#endif
+
 	/* check segment usage, and check boundary of a given segment number */
 	if (unlikely(GET_SIT_VBLOCKS(raw_sit) > sbi->blocks_per_seg
 					|| segno > TOTAL_SEGS(sbi) - 1)) {
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/fat/file.c linux-libre-4.19.51-gnu/fs/fat/file.c
--- linux-libre-4.19.50-gnu/fs/fat/file.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/fat/file.c	2019-06-15 05:54:11.000000000 -0400
@@ -193,12 +193,17 @@ static int fat_file_release(struct inode
 int fat_file_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
 {
 	struct inode *inode = filp->f_mapping->host;
-	int res, err;
+	int err;
+
+	err = __generic_file_fsync(filp, start, end, datasync);
+	if (err)
+		return err;
 
-	res = generic_file_fsync(filp, start, end, datasync);
 	err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping);
+	if (err)
+		return err;
 
-	return res ? res : err;
+	return blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
 }
 
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/fuse/dev.c linux-libre-4.19.51-gnu/fs/fuse/dev.c
--- linux-libre-4.19.50-gnu/fs/fuse/dev.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/fuse/dev.c	2019-06-15 05:54:11.000000000 -0400
@@ -1681,7 +1681,7 @@ static int fuse_retrieve(struct fuse_con
 	offset = outarg->offset & ~PAGE_MASK;
 	file_size = i_size_read(inode);
 
-	num = outarg->size;
+	num = min(outarg->size, fc->max_write);
 	if (outarg->offset > file_size)
 		num = 0;
 	else if (outarg->offset + num > file_size)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/nfsd/nfs4xdr.c linux-libre-4.19.51-gnu/fs/nfsd/nfs4xdr.c
--- linux-libre-4.19.50-gnu/fs/nfsd/nfs4xdr.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/nfsd/nfs4xdr.c	2019-06-15 05:54:11.000000000 -0400
@@ -2413,8 +2413,10 @@ nfsd4_encode_fattr(struct xdr_stream *xd
 	__be32 status;
 	int err;
 	struct nfs4_acl *acl = NULL;
+#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
 	void *context = NULL;
 	int contextlen;
+#endif
 	bool contextsupport = false;
 	struct nfsd4_compoundres *resp = rqstp->rq_resp;
 	u32 minorversion = resp->cstate.minorversion;
@@ -2899,12 +2901,14 @@ out_acl:
 			*p++ = cpu_to_be32(NFS4_CHANGE_TYPE_IS_TIME_METADATA);
 	}
 
+#ifdef CONFIG_NFSD_V4_SECURITY_LABEL
 	if (bmval2 & FATTR4_WORD2_SECURITY_LABEL) {
 		status = nfsd4_encode_security_label(xdr, rqstp, context,
 								contextlen);
 		if (status)
 			goto out;
 	}
+#endif
 
 	attrlen = htonl(xdr->buf->len - attrlen_offset - 4);
 	write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/nfsd/vfs.h linux-libre-4.19.51-gnu/fs/nfsd/vfs.h
--- linux-libre-4.19.50-gnu/fs/nfsd/vfs.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/nfsd/vfs.h	2019-06-15 05:54:11.000000000 -0400
@@ -120,8 +120,11 @@ void		nfsd_put_raparams(struct file *fil
 
 static inline int fh_want_write(struct svc_fh *fh)
 {
-	int ret = mnt_want_write(fh->fh_export->ex_path.mnt);
+	int ret;
 
+	if (fh->fh_want_write)
+		return 0;
+	ret = mnt_want_write(fh->fh_export->ex_path.mnt);
 	if (!ret)
 		fh->fh_want_write = true;
 	return ret;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/fs/overlayfs/file.c linux-libre-4.19.51-gnu/fs/overlayfs/file.c
--- linux-libre-4.19.50-gnu/fs/overlayfs/file.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/fs/overlayfs/file.c	2019-06-15 05:54:11.000000000 -0400
@@ -11,6 +11,7 @@
 #include <linux/mount.h>
 #include <linux/xattr.h>
 #include <linux/uio.h>
+#include <linux/uaccess.h>
 #include "overlayfs.h"
 
 static char ovl_whatisit(struct inode *inode, struct inode *realinode)
@@ -29,10 +30,11 @@ static struct file *ovl_open_realfile(co
 	struct inode *inode = file_inode(file);
 	struct file *realfile;
 	const struct cred *old_cred;
+	int flags = file->f_flags | O_NOATIME | FMODE_NONOTIFY;
 
 	old_cred = ovl_override_creds(inode->i_sb);
-	realfile = open_with_fake_path(&file->f_path, file->f_flags | O_NOATIME,
-				       realinode, current_cred());
+	realfile = open_with_fake_path(&file->f_path, flags, realinode,
+				       current_cred());
 	revert_creds(old_cred);
 
 	pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",
@@ -50,7 +52,7 @@ static int ovl_change_flags(struct file
 	int err;
 
 	/* No atime modificaton on underlying */
-	flags |= O_NOATIME;
+	flags |= O_NOATIME | FMODE_NONOTIFY;
 
 	/* If some flag changed that cannot be changed then something's amiss */
 	if (WARN_ON((file->f_flags ^ flags) & ~OVL_SETFL_MASK))
@@ -144,11 +146,47 @@ static int ovl_release(struct inode *ino
 
 static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
 {
-	struct inode *realinode = ovl_inode_real(file_inode(file));
+	struct inode *inode = file_inode(file);
+	struct fd real;
+	const struct cred *old_cred;
+	ssize_t ret;
 
-	return generic_file_llseek_size(file, offset, whence,
-					realinode->i_sb->s_maxbytes,
-					i_size_read(realinode));
+	/*
+	 * The two special cases below do not need to involve real fs,
+	 * so we can optimizing concurrent callers.
+	 */
+	if (offset == 0) {
+		if (whence == SEEK_CUR)
+			return file->f_pos;
+
+		if (whence == SEEK_SET)
+			return vfs_setpos(file, 0, 0);
+	}
+
+	ret = ovl_real_fdget(file, &real);
+	if (ret)
+		return ret;
+
+	/*
+	 * Overlay file f_pos is the master copy that is preserved
+	 * through copy up and modified on read/write, but only real
+	 * fs knows how to SEEK_HOLE/SEEK_DATA and real fs may impose
+	 * limitations that are more strict than ->s_maxbytes for specific
+	 * files, so we use the real file to perform seeks.
+	 */
+	inode_lock(inode);
+	real.file->f_pos = file->f_pos;
+
+	old_cred = ovl_override_creds(inode->i_sb);
+	ret = vfs_llseek(real.file, offset, whence);
+	revert_creds(old_cred);
+
+	file->f_pos = real.file->f_pos;
+	inode_unlock(inode);
+
+	fdput(real);
+
+	return ret;
 }
 
 static void ovl_file_accessed(struct file *file)
@@ -371,10 +409,68 @@ static long ovl_real_ioctl(struct file *
 	return ret;
 }
 
-static long ovl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static unsigned int ovl_get_inode_flags(struct inode *inode)
+{
+	unsigned int flags = READ_ONCE(inode->i_flags);
+	unsigned int ovl_iflags = 0;
+
+	if (flags & S_SYNC)
+		ovl_iflags |= FS_SYNC_FL;
+	if (flags & S_APPEND)
+		ovl_iflags |= FS_APPEND_FL;
+	if (flags & S_IMMUTABLE)
+		ovl_iflags |= FS_IMMUTABLE_FL;
+	if (flags & S_NOATIME)
+		ovl_iflags |= FS_NOATIME_FL;
+
+	return ovl_iflags;
+}
+
+static long ovl_ioctl_set_flags(struct file *file, unsigned long arg)
 {
 	long ret;
 	struct inode *inode = file_inode(file);
+	unsigned int flags;
+	unsigned int old_flags;
+
+	if (!inode_owner_or_capable(inode))
+		return -EACCES;
+
+	if (get_user(flags, (int __user *) arg))
+		return -EFAULT;
+
+	ret = mnt_want_write_file(file);
+	if (ret)
+		return ret;
+
+	inode_lock(inode);
+
+	/* Check the capability before cred override */
+	ret = -EPERM;
+	old_flags = ovl_get_inode_flags(inode);
+	if (((flags ^ old_flags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) &&
+	    !capable(CAP_LINUX_IMMUTABLE))
+		goto unlock;
+
+	ret = ovl_maybe_copy_up(file_dentry(file), O_WRONLY);
+	if (ret)
+		goto unlock;
+
+	ret = ovl_real_ioctl(file, FS_IOC_SETFLAGS, arg);
+
+	ovl_copyflags(ovl_inode_real(inode), inode);
+unlock:
+	inode_unlock(inode);
+
+	mnt_drop_write_file(file);
+
+	return ret;
+
+}
+
+static long ovl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+	long ret;
 
 	switch (cmd) {
 	case FS_IOC_GETFLAGS:
@@ -382,23 +478,7 @@ static long ovl_ioctl(struct file *file,
 		break;
 
 	case FS_IOC_SETFLAGS:
-		if (!inode_owner_or_capable(inode))
-			return -EACCES;
-
-		ret = mnt_want_write_file(file);
-		if (ret)
-			return ret;
-
-		ret = ovl_maybe_copy_up(file_dentry(file), O_WRONLY);
-		if (!ret) {
-			ret = ovl_real_ioctl(file, cmd, arg);
-
-			inode_lock(inode);
-			ovl_copyflags(ovl_inode_real(inode), inode);
-			inode_unlock(inode);
-		}
-
-		mnt_drop_write_file(file);
+		ret = ovl_ioctl_set_flags(file, arg);
 		break;
 
 	default:
diff -druNp --no-dereference linux-libre-4.19.50-gnu/include/linux/pwm.h linux-libre-4.19.51-gnu/include/linux/pwm.h
--- linux-libre-4.19.50-gnu/include/linux/pwm.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/include/linux/pwm.h	2019-06-15 05:54:11.000000000 -0400
@@ -639,7 +639,6 @@ static inline void pwm_remove_table(stru
 #ifdef CONFIG_PWM_SYSFS
 void pwmchip_sysfs_export(struct pwm_chip *chip);
 void pwmchip_sysfs_unexport(struct pwm_chip *chip);
-void pwmchip_sysfs_unexport_children(struct pwm_chip *chip);
 #else
 static inline void pwmchip_sysfs_export(struct pwm_chip *chip)
 {
@@ -648,10 +647,6 @@ static inline void pwmchip_sysfs_export(
 static inline void pwmchip_sysfs_unexport(struct pwm_chip *chip)
 {
 }
-
-static inline void pwmchip_sysfs_unexport_children(struct pwm_chip *chip)
-{
-}
 #endif /* CONFIG_PWM_SYSFS */
 
 #endif /* __LINUX_PWM_H */
diff -druNp --no-dereference linux-libre-4.19.50-gnu/include/net/bluetooth/hci_core.h linux-libre-4.19.51-gnu/include/net/bluetooth/hci_core.h
--- linux-libre-4.19.50-gnu/include/net/bluetooth/hci_core.h	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/include/net/bluetooth/hci_core.h	2019-06-15 05:54:11.000000000 -0400
@@ -182,9 +182,6 @@ 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-4.19.50-gnu/init/initramfs.c linux-libre-4.19.51-gnu/init/initramfs.c
--- linux-libre-4.19.50-gnu/init/initramfs.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/init/initramfs.c	2019-06-15 05:54:11.000000000 -0400
@@ -612,13 +612,12 @@ static int __init populate_rootfs(void)
 		printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n");
 		err = unpack_to_rootfs((char *)initrd_start,
 			initrd_end - initrd_start);
-		if (!err) {
-			free_initrd();
+		if (!err)
 			goto done;
-		} else {
-			clean_rootfs();
-			unpack_to_rootfs(__initramfs_start, __initramfs_size);
-		}
+
+		clean_rootfs();
+		unpack_to_rootfs(__initramfs_start, __initramfs_size);
+
 		printk(KERN_INFO "rootfs image is not initramfs (%s)"
 				"; looks like an initrd\n", err);
 		fd = ksys_open("/initrd.image",
@@ -632,7 +631,6 @@ static int __init populate_rootfs(void)
 				       written, initrd_end - initrd_start);
 
 			ksys_close(fd);
-			free_initrd();
 		}
 	done:
 		/* empty statement */;
@@ -642,9 +640,9 @@ static int __init populate_rootfs(void)
 			initrd_end - initrd_start);
 		if (err)
 			printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
-		free_initrd();
 #endif
 	}
+	free_initrd();
 	flush_delayed_fput();
 	/*
 	 * Try loading default modules from initramfs.  This gives
diff -druNp --no-dereference linux-libre-4.19.50-gnu/ipc/mqueue.c linux-libre-4.19.51-gnu/ipc/mqueue.c
--- linux-libre-4.19.50-gnu/ipc/mqueue.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/ipc/mqueue.c	2019-06-15 05:54:11.000000000 -0400
@@ -391,7 +391,8 @@ static void mqueue_evict_inode(struct in
 	struct user_struct *user;
 	unsigned long mq_bytes, mq_treesize;
 	struct ipc_namespace *ipc_ns;
-	struct msg_msg *msg;
+	struct msg_msg *msg, *nmsg;
+	LIST_HEAD(tmp_msg);
 
 	clear_inode(inode);
 
@@ -402,10 +403,15 @@ static void mqueue_evict_inode(struct in
 	info = MQUEUE_I(inode);
 	spin_lock(&info->lock);
 	while ((msg = msg_get(info)) != NULL)
-		free_msg(msg);
+		list_add_tail(&msg->m_list, &tmp_msg);
 	kfree(info->node_cache);
 	spin_unlock(&info->lock);
 
+	list_for_each_entry_safe(msg, nmsg, &tmp_msg, m_list) {
+		list_del(&msg->m_list);
+		free_msg(msg);
+	}
+
 	/* Total amount of bytes accounted for the mqueue */
 	mq_treesize = info->attr.mq_maxmsg * sizeof(struct msg_msg) +
 		min_t(unsigned int, info->attr.mq_maxmsg, MQ_PRIO_MAX) *
diff -druNp --no-dereference linux-libre-4.19.50-gnu/ipc/msgutil.c linux-libre-4.19.51-gnu/ipc/msgutil.c
--- linux-libre-4.19.50-gnu/ipc/msgutil.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/ipc/msgutil.c	2019-06-15 05:54:11.000000000 -0400
@@ -18,6 +18,7 @@
 #include <linux/utsname.h>
 #include <linux/proc_ns.h>
 #include <linux/uaccess.h>
+#include <linux/sched.h>
 
 #include "util.h"
 
@@ -64,6 +65,9 @@ static struct msg_msg *alloc_msg(size_t
 	pseg = &msg->next;
 	while (len > 0) {
 		struct msg_msgseg *seg;
+
+		cond_resched();
+
 		alen = min(len, DATALEN_SEG);
 		seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL_ACCOUNT);
 		if (seg == NULL)
@@ -176,6 +180,8 @@ void free_msg(struct msg_msg *msg)
 	kfree(msg);
 	while (seg != NULL) {
 		struct msg_msgseg *tmp = seg->next;
+
+		cond_resched();
 		kfree(seg);
 		seg = tmp;
 	}
diff -druNp --no-dereference linux-libre-4.19.50-gnu/kernel/bpf/verifier.c linux-libre-4.19.51-gnu/kernel/bpf/verifier.c
--- linux-libre-4.19.50-gnu/kernel/bpf/verifier.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/kernel/bpf/verifier.c	2019-06-15 05:54:11.000000000 -0400
@@ -5743,7 +5743,7 @@ static int convert_ctx_accesses(struct b
 									insn->dst_reg,
 									shift);
 				insn_buf[cnt++] = BPF_ALU64_IMM(BPF_AND, insn->dst_reg,
-								(1 << size * 8) - 1);
+								(1ULL << size * 8) - 1);
 			}
 		}
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/kernel/sys.c linux-libre-4.19.51-gnu/kernel/sys.c
--- linux-libre-4.19.50-gnu/kernel/sys.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/kernel/sys.c	2019-06-15 05:54:11.000000000 -0400
@@ -1919,7 +1919,7 @@ static int validate_prctl_map(struct prc
 	((unsigned long)prctl_map->__m1 __op				\
 	 (unsigned long)prctl_map->__m2) ? 0 : -EINVAL
 	error  = __prctl_check_order(start_code, <, end_code);
-	error |= __prctl_check_order(start_data, <, end_data);
+	error |= __prctl_check_order(start_data,<=, end_data);
 	error |= __prctl_check_order(start_brk, <=, brk);
 	error |= __prctl_check_order(arg_start, <=, arg_end);
 	error |= __prctl_check_order(env_start, <=, env_end);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/kernel/sysctl.c linux-libre-4.19.51-gnu/kernel/sysctl.c
--- linux-libre-4.19.50-gnu/kernel/sysctl.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/kernel/sysctl.c	2019-06-15 05:54:11.000000000 -0400
@@ -2791,8 +2791,10 @@ static int __do_proc_doulongvec_minmax(v
 			if (neg)
 				continue;
 			val = convmul * val / convdiv;
-			if ((min && val < *min) || (max && val > *max))
-				continue;
+			if ((min && val < *min) || (max && val > *max)) {
+				err = -EINVAL;
+				break;
+			}
 			*i = val;
 		} else {
 			val = convdiv * (*i) / convmul;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/kernel/time/ntp.c linux-libre-4.19.51-gnu/kernel/time/ntp.c
--- linux-libre-4.19.50-gnu/kernel/time/ntp.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/kernel/time/ntp.c	2019-06-15 05:54:11.000000000 -0400
@@ -698,7 +698,7 @@ static inline void process_adjtimex_mode
 		time_constant = max(time_constant, 0l);
 	}
 
-	if (txc->modes & ADJ_TAI && txc->constant > 0)
+	if (txc->modes & ADJ_TAI && txc->constant >= 0)
 		*time_tai = txc->constant;
 
 	if (txc->modes & ADJ_OFFSET)
diff -druNp --no-dereference linux-libre-4.19.50-gnu/Makefile linux-libre-4.19.51-gnu/Makefile
--- linux-libre-4.19.50-gnu/Makefile	2019-06-11 15:13:35.000000000 -0400
+++ linux-libre-4.19.51-gnu/Makefile	2019-06-15 17:43:31.000000000 -0400
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 VERSION = 4
 PATCHLEVEL = 19
-SUBLEVEL = 50
+SUBLEVEL = 51
 EXTRAVERSION = -gnu
 NAME = "People's Front"
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/cma.c linux-libre-4.19.51-gnu/mm/cma.c
--- linux-libre-4.19.50-gnu/mm/cma.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/cma.c	2019-06-15 05:54:11.000000000 -0400
@@ -106,8 +106,10 @@ static int __init cma_activate_area(stru
 
 	cma->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
 
-	if (!cma->bitmap)
+	if (!cma->bitmap) {
+		cma->count = 0;
 		return -ENOMEM;
+	}
 
 	WARN_ON_ONCE(!pfn_valid(pfn));
 	zone = page_zone(pfn_to_page(pfn));
@@ -369,23 +371,26 @@ err:
 #ifdef CONFIG_CMA_DEBUG
 static void cma_debug_show_areas(struct cma *cma)
 {
-	unsigned long next_zero_bit, next_set_bit;
+	unsigned long next_zero_bit, next_set_bit, nr_zero;
 	unsigned long start = 0;
-	unsigned int nr_zero, nr_total = 0;
+	unsigned long nr_part, nr_total = 0;
+	unsigned long nbits = cma_bitmap_maxno(cma);
 
 	mutex_lock(&cma->lock);
 	pr_info("number of available pages: ");
 	for (;;) {
-		next_zero_bit = find_next_zero_bit(cma->bitmap, cma->count, start);
-		if (next_zero_bit >= cma->count)
+		next_zero_bit = find_next_zero_bit(cma->bitmap, nbits, start);
+		if (next_zero_bit >= nbits)
 			break;
-		next_set_bit = find_next_bit(cma->bitmap, cma->count, next_zero_bit);
+		next_set_bit = find_next_bit(cma->bitmap, nbits, next_zero_bit);
 		nr_zero = next_set_bit - next_zero_bit;
-		pr_cont("%s%u@%lu", nr_total ? "+" : "", nr_zero, next_zero_bit);
-		nr_total += nr_zero;
+		nr_part = nr_zero << cma->order_per_bit;
+		pr_cont("%s%lu@%lu", nr_total ? "+" : "", nr_part,
+			next_zero_bit);
+		nr_total += nr_part;
 		start = next_zero_bit + nr_zero;
 	}
-	pr_cont("=> %u free of %lu total pages\n", nr_total, cma->count);
+	pr_cont("=> %lu free of %lu total pages\n", nr_total, cma->count);
 	mutex_unlock(&cma->lock);
 }
 #else
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/cma_debug.c linux-libre-4.19.51-gnu/mm/cma_debug.c
--- linux-libre-4.19.50-gnu/mm/cma_debug.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/cma_debug.c	2019-06-15 05:54:11.000000000 -0400
@@ -58,7 +58,7 @@ static int cma_maxchunk_get(void *data,
 	mutex_lock(&cma->lock);
 	for (;;) {
 		start = find_next_zero_bit(cma->bitmap, bitmap_maxno, end);
-		if (start >= cma->count)
+		if (start >= bitmap_maxno)
 			break;
 		end = find_next_bit(cma->bitmap, bitmap_maxno, start);
 		maxchunk = max(end - start, maxchunk);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/hugetlb.c linux-libre-4.19.51-gnu/mm/hugetlb.c
--- linux-libre-4.19.50-gnu/mm/hugetlb.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/hugetlb.c	2019-06-15 05:54:11.000000000 -0400
@@ -1256,12 +1256,23 @@ void free_huge_page(struct page *page)
 	ClearPagePrivate(page);
 
 	/*
-	 * A return code of zero implies that the subpool will be under its
-	 * minimum size if the reservation is not restored after page is free.
-	 * Therefore, force restore_reserve operation.
+	 * If PagePrivate() was set on page, page allocation consumed a
+	 * reservation.  If the page was associated with a subpool, there
+	 * would have been a page reserved in the subpool before allocation
+	 * via hugepage_subpool_get_pages().  Since we are 'restoring' the
+	 * reservtion, do not call hugepage_subpool_put_pages() as this will
+	 * remove the reserved page from the subpool.
 	 */
-	if (hugepage_subpool_put_pages(spool, 1) == 0)
-		restore_reserve = true;
+	if (!restore_reserve) {
+		/*
+		 * A return code of zero implies that the subpool will be
+		 * under its minimum size if the reservation is not restored
+		 * after page is free.  Therefore, force restore_reserve
+		 * operation.
+		 */
+		if (hugepage_subpool_put_pages(spool, 1) == 0)
+			restore_reserve = true;
+	}
 
 	spin_lock(&hugetlb_lock);
 	clear_page_huge_active(page);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/Kconfig linux-libre-4.19.51-gnu/mm/Kconfig
--- linux-libre-4.19.50-gnu/mm/Kconfig	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/Kconfig	2019-06-15 05:54:11.000000000 -0400
@@ -700,12 +700,12 @@ config DEV_PAGEMAP_OPS
 
 config HMM
 	bool
+	select MMU_NOTIFIER
 	select MIGRATE_VMA_HELPER
 
 config HMM_MIRROR
 	bool "HMM mirror CPU page table into a device page table"
 	depends on ARCH_HAS_HMM
-	select MMU_NOTIFIER
 	select HMM
 	help
 	  Select HMM_MIRROR if you want to mirror range of the CPU page table of a
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/page_alloc.c linux-libre-4.19.51-gnu/mm/page_alloc.c
--- linux-libre-4.19.50-gnu/mm/page_alloc.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/page_alloc.c	2019-06-15 05:54:11.000000000 -0400
@@ -5937,13 +5937,15 @@ static unsigned long __meminit zone_span
 					unsigned long *zone_end_pfn,
 					unsigned long *ignored)
 {
+	unsigned long zone_low = arch_zone_lowest_possible_pfn[zone_type];
+	unsigned long zone_high = arch_zone_highest_possible_pfn[zone_type];
 	/* When hotadd a new node from cpu_up(), the node should be empty */
 	if (!node_start_pfn && !node_end_pfn)
 		return 0;
 
 	/* Get the start and end of the zone */
-	*zone_start_pfn = arch_zone_lowest_possible_pfn[zone_type];
-	*zone_end_pfn = arch_zone_highest_possible_pfn[zone_type];
+	*zone_start_pfn = clamp(node_start_pfn, zone_low, zone_high);
+	*zone_end_pfn = clamp(node_end_pfn, zone_low, zone_high);
 	adjust_zone_range_for_zone_movable(nid, zone_type,
 				node_start_pfn, node_end_pfn,
 				zone_start_pfn, zone_end_pfn);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/percpu.c linux-libre-4.19.51-gnu/mm/percpu.c
--- linux-libre-4.19.50-gnu/mm/percpu.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/percpu.c	2019-06-15 05:54:11.000000000 -0400
@@ -988,7 +988,8 @@ static int pcpu_alloc_area(struct pcpu_c
 	/*
 	 * Search to find a fit.
 	 */
-	end = start + alloc_bits + PCPU_BITMAP_BLOCK_BITS;
+	end = min_t(int, start + alloc_bits + PCPU_BITMAP_BLOCK_BITS,
+		    pcpu_chunk_map_bits(chunk));
 	bit_off = bitmap_find_next_zero_area(chunk->alloc_map, end, start,
 					     alloc_bits, align_mask);
 	if (bit_off >= end)
@@ -1721,6 +1722,7 @@ void free_percpu(void __percpu *ptr)
 	struct pcpu_chunk *chunk;
 	unsigned long flags;
 	int off;
+	bool need_balance = false;
 
 	if (!ptr)
 		return;
@@ -1742,7 +1744,7 @@ void free_percpu(void __percpu *ptr)
 
 		list_for_each_entry(pos, &pcpu_slot[pcpu_nr_slots - 1], list)
 			if (pos != chunk) {
-				pcpu_schedule_balance_work();
+				need_balance = true;
 				break;
 			}
 	}
@@ -1750,6 +1752,9 @@ void free_percpu(void __percpu *ptr)
 	trace_percpu_free_percpu(chunk->base_addr, off, ptr);
 
 	spin_unlock_irqrestore(&pcpu_lock, flags);
+
+	if (need_balance)
+		pcpu_schedule_balance_work();
 }
 EXPORT_SYMBOL_GPL(free_percpu);
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/rmap.c linux-libre-4.19.51-gnu/mm/rmap.c
--- linux-libre-4.19.50-gnu/mm/rmap.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/rmap.c	2019-06-15 05:54:11.000000000 -0400
@@ -926,7 +926,7 @@ static bool page_mkclean_one(struct page
 				continue;
 
 			flush_cache_page(vma, address, page_to_pfn(page));
-			entry = pmdp_huge_clear_flush(vma, address, pmd);
+			entry = pmdp_invalidate(vma, address, pmd);
 			entry = pmd_wrprotect(entry);
 			entry = pmd_mkclean(entry);
 			set_pmd_at(vma->vm_mm, address, pmd, entry);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/mm/slab.c linux-libre-4.19.51-gnu/mm/slab.c
--- linux-libre-4.19.50-gnu/mm/slab.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/mm/slab.c	2019-06-15 05:54:11.000000000 -0400
@@ -4326,8 +4326,12 @@ static int leaks_show(struct seq_file *m
 	 * whole processing.
 	 */
 	do {
-		set_store_user_clean(cachep);
 		drain_cpu_caches(cachep);
+		/*
+		 * drain_cpu_caches() could make kmemleak_object and
+		 * debug_objects_cache dirty, so reset afterwards.
+		 */
+		set_store_user_clean(cachep);
 
 		x[1] = 0;
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/bluetooth/hci_conn.c linux-libre-4.19.51-gnu/net/bluetooth/hci_conn.c
--- linux-libre-4.19.50-gnu/net/bluetooth/hci_conn.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/bluetooth/hci_conn.c	2019-06-15 05:54:11.000000000 -0400
@@ -1276,14 +1276,6 @@ int hci_conn_check_link_mode(struct hci_
 	    !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
 		return 0;
 
-	/* 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.
-	 */
-	if (conn->enc_key_size < HCI_MIN_ENC_KEY_SIZE)
-		return 0;
-
 	return 1;
 }
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/netfilter/nf_conntrack_h323_asn1.c linux-libre-4.19.51-gnu/net/netfilter/nf_conntrack_h323_asn1.c
--- linux-libre-4.19.50-gnu/net/netfilter/nf_conntrack_h323_asn1.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/netfilter/nf_conntrack_h323_asn1.c	2019-06-15 05:54:11.000000000 -0400
@@ -172,7 +172,7 @@ static int nf_h323_error_boundary(struct
 	if (bits % BITS_PER_BYTE > 0)
 		bytes++;
 
-	if (*bs->cur + bytes > *bs->end)
+	if (bs->cur + bytes > bs->end)
 		return 1;
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/netfilter/nf_flow_table_core.c linux-libre-4.19.51-gnu/net/netfilter/nf_flow_table_core.c
--- linux-libre-4.19.50-gnu/net/netfilter/nf_flow_table_core.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/netfilter/nf_flow_table_core.c	2019-06-15 05:54:11.000000000 -0400
@@ -185,14 +185,25 @@ static const struct rhashtable_params nf
 
 int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
 {
-	flow->timeout = (u32)jiffies;
+	int err;
 
-	rhashtable_insert_fast(&flow_table->rhashtable,
-			       &flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].node,
-			       nf_flow_offload_rhash_params);
-	rhashtable_insert_fast(&flow_table->rhashtable,
-			       &flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].node,
-			       nf_flow_offload_rhash_params);
+	err = rhashtable_insert_fast(&flow_table->rhashtable,
+				     &flow->tuplehash[0].node,
+				     nf_flow_offload_rhash_params);
+	if (err < 0)
+		return err;
+
+	err = rhashtable_insert_fast(&flow_table->rhashtable,
+				     &flow->tuplehash[1].node,
+				     nf_flow_offload_rhash_params);
+	if (err < 0) {
+		rhashtable_remove_fast(&flow_table->rhashtable,
+				       &flow->tuplehash[0].node,
+				       nf_flow_offload_rhash_params);
+		return err;
+	}
+
+	flow->timeout = (u32)jiffies;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(flow_offload_add);
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/netfilter/nf_flow_table_ip.c linux-libre-4.19.51-gnu/net/netfilter/nf_flow_table_ip.c
--- linux-libre-4.19.50-gnu/net/netfilter/nf_flow_table_ip.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/netfilter/nf_flow_table_ip.c	2019-06-15 05:54:11.000000000 -0400
@@ -181,6 +181,9 @@ static int nf_flow_tuple_ip(struct sk_bu
 	    iph->protocol != IPPROTO_UDP)
 		return -1;
 
+	if (iph->ttl <= 1)
+		return -1;
+
 	thoff = iph->ihl * 4;
 	if (!pskb_may_pull(skb, thoff + sizeof(*ports)))
 		return -1;
@@ -412,6 +415,9 @@ static int nf_flow_tuple_ipv6(struct sk_
 	    ip6h->nexthdr != IPPROTO_UDP)
 		return -1;
 
+	if (ip6h->hop_limit <= 1)
+		return -1;
+
 	thoff = sizeof(*ip6h);
 	if (!pskb_may_pull(skb, thoff + sizeof(*ports)))
 		return -1;
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/netfilter/nf_tables_api.c linux-libre-4.19.51-gnu/net/netfilter/nf_tables_api.c
--- linux-libre-4.19.50-gnu/net/netfilter/nf_tables_api.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/netfilter/nf_tables_api.c	2019-06-15 05:54:11.000000000 -0400
@@ -1142,6 +1142,9 @@ static int nft_dump_stats(struct sk_buff
 	u64 pkts, bytes;
 	int cpu;
 
+	if (!stats)
+		return 0;
+
 	memset(&total, 0, sizeof(total));
 	for_each_possible_cpu(cpu) {
 		cpu_stats = per_cpu_ptr(stats, cpu);
@@ -1199,6 +1202,7 @@ static int nf_tables_fill_chain_info(str
 	if (nft_is_base_chain(chain)) {
 		const struct nft_base_chain *basechain = nft_base_chain(chain);
 		const struct nf_hook_ops *ops = &basechain->ops;
+		struct nft_stats __percpu *stats;
 		struct nlattr *nest;
 
 		nest = nla_nest_start(skb, NFTA_CHAIN_HOOK);
@@ -1220,8 +1224,9 @@ static int nf_tables_fill_chain_info(str
 		if (nla_put_string(skb, NFTA_CHAIN_TYPE, basechain->type->name))
 			goto nla_put_failure;
 
-		if (rcu_access_pointer(basechain->stats) &&
-		    nft_dump_stats(skb, rcu_dereference(basechain->stats)))
+		stats = rcu_dereference_check(basechain->stats,
+					      lockdep_commit_lock_is_held(net));
+		if (nft_dump_stats(skb, stats))
 			goto nla_put_failure;
 	}
 
diff -druNp --no-dereference linux-libre-4.19.50-gnu/net/netfilter/nft_flow_offload.c linux-libre-4.19.51-gnu/net/netfilter/nft_flow_offload.c
--- linux-libre-4.19.50-gnu/net/netfilter/nft_flow_offload.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/net/netfilter/nft_flow_offload.c	2019-06-15 05:54:11.000000000 -0400
@@ -113,6 +113,7 @@ static void nft_flow_offload_eval(const
 	if (ret < 0)
 		goto err_flow_add;
 
+	dst_release(route.tuple[!dir].dst);
 	return;
 
 err_flow_add:
diff -druNp --no-dereference linux-libre-4.19.50-gnu/sound/core/seq/seq_ports.c linux-libre-4.19.51-gnu/sound/core/seq/seq_ports.c
--- linux-libre-4.19.50-gnu/sound/core/seq/seq_ports.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/sound/core/seq/seq_ports.c	2019-06-15 05:54:11.000000000 -0400
@@ -550,10 +550,10 @@ static void delete_and_unsubscribe_port(
 		list_del_init(list);
 	grp->exclusive = 0;
 	write_unlock_irq(&grp->list_lock);
-	up_write(&grp->list_mutex);
 
 	if (!empty)
 		unsubscribe_port(client, port, grp, &subs->info, ack);
+	up_write(&grp->list_mutex);
 }
 
 /* connect two ports */
diff -druNp --no-dereference linux-libre-4.19.50-gnu/sound/pci/hda/hda_intel.c linux-libre-4.19.51-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.19.50-gnu/sound/pci/hda/hda_intel.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/sound/pci/hda/hda_intel.c	2019-06-15 05:54:11.000000000 -0400
@@ -1883,9 +1883,6 @@ static int azx_first_init(struct azx *ch
 			chip->msi = 0;
 	}
 
-	if (azx_acquire_irq(chip, 0) < 0)
-		return -EBUSY;
-
 	pci_set_master(pci);
 	synchronize_irq(bus->irq);
 
@@ -2000,6 +1997,9 @@ static int azx_first_init(struct azx *ch
 		return -ENODEV;
 	}
 
+	if (azx_acquire_irq(chip, 0) < 0)
+		return -EBUSY;
+
 	strcpy(card->driver, "HDA-Intel");
 	strlcpy(card->shortname, driver_short_names[chip->driver_type],
 		sizeof(card->shortname));
diff -druNp --no-dereference linux-libre-4.19.50-gnu/tools/objtool/check.c linux-libre-4.19.51-gnu/tools/objtool/check.c
--- linux-libre-4.19.50-gnu/tools/objtool/check.c	2019-06-11 06:20:57.000000000 -0400
+++ linux-libre-4.19.51-gnu/tools/objtool/check.c	2019-06-15 05:54:11.000000000 -0400
@@ -28,6 +28,8 @@
 #include <linux/hashtable.h>
 #include <linux/kernel.h>
 
+#define FAKE_JUMP_OFFSET -1
+
 struct alternative {
 	struct list_head list;
 	struct instruction *insn;
@@ -501,7 +503,7 @@ static int add_jump_destinations(struct
 		    insn->type != INSN_JUMP_UNCONDITIONAL)
 			continue;
 
-		if (insn->ignore)
+		if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET)
 			continue;
 
 		rela = find_rela_by_dest_range(insn->sec, insn->offset,
@@ -670,10 +672,10 @@ static int handle_group_alt(struct objto
 		clear_insn_state(&fake_jump->state);
 
 		fake_jump->sec = special_alt->new_sec;
-		fake_jump->offset = -1;
+		fake_jump->offset = FAKE_JUMP_OFFSET;
 		fake_jump->type = INSN_JUMP_UNCONDITIONAL;
 		fake_jump->jump_dest = list_next_entry(last_orig_insn, list);
-		fake_jump->ignore = true;
+		fake_jump->func = orig_insn->func;
 	}
 
 	if (!special_alt->new_len) {
