diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts linux-libre-4.9.183-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2019-06-22 02:17:25.000000000 -0400
@@ -110,6 +110,7 @@
 				regulator-name = "PVDD_APIO_1V8";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
 			};
 
 			ldo3_reg: LDO3 {
@@ -148,6 +149,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.9.182-gnu/arch/arm/boot/dts/imx6qdl.dtsi linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6qdl.dtsi
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/imx6qdl.dtsi	2019-06-17 20:36:25.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6qdl.dtsi	2019-06-22 08:50:49.000000000 -0400
@@ -875,7 +875,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.9.182-gnu/arch/arm/boot/dts/imx6sl.dtsi linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6sl.dtsi
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/imx6sl.dtsi	2019-06-17 20:36:29.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6sl.dtsi	2019-06-22 08:50:52.000000000 -0400
@@ -704,7 +704,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.9.182-gnu/arch/arm/boot/dts/imx6sx.dtsi linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6sx.dtsi
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/imx6sx.dtsi	2019-06-17 20:36:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6sx.dtsi	2019-06-22 08:50:55.000000000 -0400
@@ -751,7 +751,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.9.182-gnu/arch/arm/boot/dts/imx6ul.dtsi linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6ul.dtsi
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/imx6ul.dtsi	2019-06-17 20:36:37.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx6ul.dtsi	2019-06-22 08:50:58.000000000 -0400
@@ -669,7 +669,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.9.182-gnu/arch/arm/boot/dts/imx7s.dtsi linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx7s.dtsi
--- linux-libre-4.9.182-gnu/arch/arm/boot/dts/imx7s.dtsi	2019-06-17 20:36:42.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/boot/dts/imx7s.dtsi	2019-06-22 08:51:01.000000000 -0400
@@ -962,8 +962,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.9.182-gnu/arch/arm/include/asm/hardirq.h linux-libre-4.9.183-gnu/arch/arm/include/asm/hardirq.h
--- linux-libre-4.9.182-gnu/arch/arm/include/asm/hardirq.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/include/asm/hardirq.h	2019-06-22 02:17:25.000000000 -0400
@@ -5,6 +5,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.9.182-gnu/arch/arm/kernel/smp.c linux-libre-4.9.183-gnu/arch/arm/kernel/smp.c
--- linux-libre-4.9.182-gnu/arch/arm/kernel/smp.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/kernel/smp.c	2019-06-22 02:17:25.000000000 -0400
@@ -75,6 +75,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
@@ -801,7 +805,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.9.182-gnu/arch/arm/mach-exynos/suspend.c linux-libre-4.9.183-gnu/arch/arm/mach-exynos/suspend.c
--- linux-libre-4.9.182-gnu/arch/arm/mach-exynos/suspend.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm/mach-exynos/suspend.c	2019-06-22 02:17:25.000000000 -0400
@@ -500,8 +500,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.9.182-gnu/arch/arm64/mm/mmu.c linux-libre-4.9.183-gnu/arch/arm64/mm/mmu.c
--- linux-libre-4.9.182-gnu/arch/arm64/mm/mmu.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/arm64/mm/mmu.c	2019-06-22 02:17:25.000000000 -0400
@@ -765,13 +765,18 @@ void *__init fixmap_remap_fdt(phys_addr_
 
 int __init arch_ioremap_pud_supported(void)
 {
-	/* only 4k granule supports level 1 block mappings */
-	return IS_ENABLED(CONFIG_ARM64_4K_PAGES);
+	/*
+	 * Only 4k granule supports level 1 block mappings.
+	 * SW table walks can't handle removal of intermediate entries.
+	 */
+	return IS_ENABLED(CONFIG_ARM64_4K_PAGES) &&
+	       !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
 }
 
 int __init arch_ioremap_pmd_supported(void)
 {
-	return 1;
+	/* See arch_ioremap_pud_supported() */
+	return !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
 }
 
 int pud_set_huge(pud_t *pud, phys_addr_t phys, pgprot_t prot)
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/ia64/mm/numa.c linux-libre-4.9.183-gnu/arch/ia64/mm/numa.c
--- linux-libre-4.9.182-gnu/arch/ia64/mm/numa.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/ia64/mm/numa.c	2019-06-22 02:17:25.000000000 -0400
@@ -49,6 +49,7 @@ paddr_to_nid(unsigned long paddr)
 
 	return (i < num_node_memblks) ? node_memblk[i].nid : (num_node_memblks ? -1 : 0);
 }
+EXPORT_SYMBOL(paddr_to_nid);
 
 #if defined(CONFIG_SPARSEMEM) && defined(CONFIG_NUMA)
 /*
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/powerpc/include/asm/kvm_host.h linux-libre-4.9.183-gnu/arch/powerpc/include/asm/kvm_host.h
--- linux-libre-4.9.182-gnu/arch/powerpc/include/asm/kvm_host.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/powerpc/include/asm/kvm_host.h	2019-06-22 02:17:25.000000000 -0400
@@ -271,6 +271,7 @@ struct kvm_arch {
 #ifdef CONFIG_PPC_BOOK3S_64
 	struct list_head spapr_tce_tables;
 	struct list_head rtas_tokens;
+	struct mutex rtas_token_lock;
 	DECLARE_BITMAP(enabled_hcalls, MAX_HCALL_OPCODE/4 + 1);
 #endif
 #ifdef CONFIG_KVM_MPIC
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s.c linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s.c
--- linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s.c	2019-06-22 02:17:25.000000000 -0400
@@ -811,6 +811,7 @@ int kvmppc_core_init_vm(struct kvm *kvm)
 #ifdef CONFIG_PPC64
 	INIT_LIST_HEAD_RCU(&kvm->arch.spapr_tce_tables);
 	INIT_LIST_HEAD(&kvm->arch.rtas_tokens);
+	mutex_init(&kvm->arch.rtas_token_lock);
 #endif
 
 	return kvm->arch.kvm_ops->init_vm(kvm);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s_hv.c linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s_hv.c
--- linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s_hv.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s_hv.c	2019-06-22 02:17:25.000000000 -0400
@@ -374,12 +374,7 @@ static void kvmppc_dump_regs(struct kvm_
 
 static struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id)
 {
-	struct kvm_vcpu *ret;
-
-	mutex_lock(&kvm->lock);
-	ret = kvm_get_vcpu_by_id(kvm, id);
-	mutex_unlock(&kvm->lock);
-	return ret;
+	return kvm_get_vcpu_by_id(kvm, id);
 }
 
 static void init_vpa(struct kvm_vcpu *vcpu, struct lppaca *vpa)
@@ -1098,7 +1093,6 @@ static void kvmppc_set_lpcr(struct kvm_v
 	struct kvmppc_vcore *vc = vcpu->arch.vcore;
 	u64 mask;
 
-	mutex_lock(&kvm->lock);
 	spin_lock(&vc->lock);
 	/*
 	 * If ILE (interrupt little-endian) has changed, update the
@@ -1132,7 +1126,6 @@ static void kvmppc_set_lpcr(struct kvm_v
 		mask &= 0xFFFFFFFF;
 	vc->lpcr = (vc->lpcr & ~mask) | (new_lpcr & mask);
 	spin_unlock(&vc->lock);
-	mutex_unlock(&kvm->lock);
 }
 
 static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s_rtas.c linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s_rtas.c
--- linux-libre-4.9.182-gnu/arch/powerpc/kvm/book3s_rtas.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/powerpc/kvm/book3s_rtas.c	2019-06-22 02:17:25.000000000 -0400
@@ -133,7 +133,7 @@ static int rtas_token_undefine(struct kv
 {
 	struct rtas_token_definition *d, *tmp;
 
-	lockdep_assert_held(&kvm->lock);
+	lockdep_assert_held(&kvm->arch.rtas_token_lock);
 
 	list_for_each_entry_safe(d, tmp, &kvm->arch.rtas_tokens, list) {
 		if (rtas_name_matches(d->handler->name, name)) {
@@ -154,7 +154,7 @@ static int rtas_token_define(struct kvm
 	bool found;
 	int i;
 
-	lockdep_assert_held(&kvm->lock);
+	lockdep_assert_held(&kvm->arch.rtas_token_lock);
 
 	list_for_each_entry(d, &kvm->arch.rtas_tokens, list) {
 		if (d->token == token)
@@ -193,14 +193,14 @@ int kvm_vm_ioctl_rtas_define_token(struc
 	if (copy_from_user(&args, argp, sizeof(args)))
 		return -EFAULT;
 
-	mutex_lock(&kvm->lock);
+	mutex_lock(&kvm->arch.rtas_token_lock);
 
 	if (args.token)
 		rc = rtas_token_define(kvm, args.name, args.token);
 	else
 		rc = rtas_token_undefine(kvm, args.name);
 
-	mutex_unlock(&kvm->lock);
+	mutex_unlock(&kvm->arch.rtas_token_lock);
 
 	return rc;
 }
@@ -232,7 +232,7 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *v
 	orig_rets = args.rets;
 	args.rets = &args.args[be32_to_cpu(args.nargs)];
 
-	mutex_lock(&vcpu->kvm->lock);
+	mutex_lock(&vcpu->kvm->arch.rtas_token_lock);
 
 	rc = -ENOENT;
 	list_for_each_entry(d, &vcpu->kvm->arch.rtas_tokens, list) {
@@ -243,7 +243,7 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *v
 		}
 	}
 
-	mutex_unlock(&vcpu->kvm->lock);
+	mutex_unlock(&vcpu->kvm->arch.rtas_token_lock);
 
 	if (rc == 0) {
 		args.rets = orig_rets;
@@ -269,8 +269,6 @@ void kvmppc_rtas_tokens_free(struct kvm
 {
 	struct rtas_token_definition *d, *tmp;
 
-	lockdep_assert_held(&kvm->lock);
-
 	list_for_each_entry_safe(d, tmp, &kvm->arch.rtas_tokens, list) {
 		list_del(&d->list);
 		kfree(d);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/s390/kvm/kvm-s390.c linux-libre-4.9.183-gnu/arch/s390/kvm/kvm-s390.c
--- linux-libre-4.9.182-gnu/arch/s390/kvm/kvm-s390.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/s390/kvm/kvm-s390.c	2019-06-22 02:17:25.000000000 -0400
@@ -3288,21 +3288,28 @@ void kvm_arch_commit_memory_region(struc
 				const struct kvm_memory_slot *new,
 				enum kvm_mr_change change)
 {
-	int rc;
-
-	/* If the basics of the memslot do not change, we do not want
-	 * to update the gmap. Every update causes several unnecessary
-	 * segment translation exceptions. This is usually handled just
-	 * fine by the normal fault handler + gmap, but it will also
-	 * cause faults on the prefix page of running guest CPUs.
-	 */
-	if (old->userspace_addr == mem->userspace_addr &&
-	    old->base_gfn * PAGE_SIZE == mem->guest_phys_addr &&
-	    old->npages * PAGE_SIZE == mem->memory_size)
-		return;
+	int rc = 0;
 
-	rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr,
-		mem->guest_phys_addr, mem->memory_size);
+	switch (change) {
+	case KVM_MR_DELETE:
+		rc = gmap_unmap_segment(kvm->arch.gmap, old->base_gfn * PAGE_SIZE,
+					old->npages * PAGE_SIZE);
+		break;
+	case KVM_MR_MOVE:
+		rc = gmap_unmap_segment(kvm->arch.gmap, old->base_gfn * PAGE_SIZE,
+					old->npages * PAGE_SIZE);
+		if (rc)
+			break;
+		/* FALLTHROUGH */
+	case KVM_MR_CREATE:
+		rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr,
+				      mem->guest_phys_addr, mem->memory_size);
+		break;
+	case KVM_MR_FLAGS_ONLY:
+		break;
+	default:
+		WARN(1, "Unknown KVM MR CHANGE: %d\n", change);
+	}
 	if (rc)
 		pr_warn("failed to commit memory region\n");
 	return;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/um/kernel/time.c linux-libre-4.9.183-gnu/arch/um/kernel/time.c
--- linux-libre-4.9.182-gnu/arch/um/kernel/time.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/um/kernel/time.c	2019-06-22 02:17:25.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.9.182-gnu/arch/x86/events/intel/core.c linux-libre-4.9.183-gnu/arch/x86/events/intel/core.c
--- linux-libre-4.9.182-gnu/arch/x86/events/intel/core.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/x86/events/intel/core.c	2019-06-22 02:17:25.000000000 -0400
@@ -2867,7 +2867,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_free_running_flags(event)))
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/x86/events/intel/ds.c linux-libre-4.9.183-gnu/arch/x86/events/intel/ds.c
--- linux-libre-4.9.182-gnu/arch/x86/events/intel/ds.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/x86/events/intel/ds.c	2019-06-22 02:17:25.000000000 -0400
@@ -655,7 +655,7 @@ struct event_constraint intel_core2_pebs
 	INTEL_FLAGS_UEVENT_CONSTRAINT(0x1fc7, 0x1), /* SIMD_INST_RETURED.ANY */
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0x1),    /* MEM_LOAD_RETIRED.* */
 	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x01),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x01),
 	EVENT_CONSTRAINT_END
 };
 
@@ -664,7 +664,7 @@ struct event_constraint intel_atom_pebs_
 	INTEL_FLAGS_UEVENT_CONSTRAINT(0x00c5, 0x1), /* MISPREDICTED_BRANCH_RETIRED */
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0x1),    /* MEM_LOAD_RETIRED.* */
 	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x01),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x01),
 	/* Allow all events as PEBS with no flags */
 	INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
 	EVENT_CONSTRAINT_END
@@ -672,7 +672,7 @@ struct event_constraint intel_atom_pebs_
 
 struct event_constraint intel_slm_pebs_event_constraints[] = {
 	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x1),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x1),
 	/* Allow all events as PEBS with no flags */
 	INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
 	EVENT_CONSTRAINT_END
@@ -697,7 +697,7 @@ struct event_constraint intel_nehalem_pe
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0xf),    /* MEM_LOAD_RETIRED.* */
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xf7, 0xf),    /* FP_ASSIST.* */
 	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x0f),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x0f),
 	EVENT_CONSTRAINT_END
 };
 
@@ -714,7 +714,7 @@ struct event_constraint intel_westmere_p
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0xf),    /* MEM_LOAD_RETIRED.* */
 	INTEL_FLAGS_EVENT_CONSTRAINT(0xf7, 0xf),    /* FP_ASSIST.* */
 	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x0f),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x0f),
 	EVENT_CONSTRAINT_END
 };
 
@@ -723,7 +723,7 @@ struct event_constraint intel_snb_pebs_e
 	INTEL_PLD_CONSTRAINT(0x01cd, 0x8),    /* MEM_TRANS_RETIRED.LAT_ABOVE_THR */
 	INTEL_PST_CONSTRAINT(0x02cd, 0x8),    /* MEM_TRANS_RETIRED.PRECISE_STORES */
 	/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c2, 0xf),
         INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf),    /* MEM_UOP_RETIRED.* */
         INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf),    /* MEM_LOAD_UOPS_RETIRED.* */
         INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf),    /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */
@@ -738,9 +738,9 @@ struct event_constraint intel_ivb_pebs_e
         INTEL_PLD_CONSTRAINT(0x01cd, 0x8),    /* MEM_TRANS_RETIRED.LAT_ABOVE_THR */
 	INTEL_PST_CONSTRAINT(0x02cd, 0x8),    /* MEM_TRANS_RETIRED.PRECISE_STORES */
 	/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c2, 0xf),
 	/* INST_RETIRED.PREC_DIST, inv=1, cmask=16 (cycles:ppp). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c0, 0x2),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c0, 0x2),
 	INTEL_EXCLEVT_CONSTRAINT(0xd0, 0xf),    /* MEM_UOP_RETIRED.* */
 	INTEL_EXCLEVT_CONSTRAINT(0xd1, 0xf),    /* MEM_LOAD_UOPS_RETIRED.* */
 	INTEL_EXCLEVT_CONSTRAINT(0xd2, 0xf),    /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */
@@ -754,9 +754,9 @@ struct event_constraint intel_hsw_pebs_e
 	INTEL_FLAGS_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PRECDIST */
 	INTEL_PLD_CONSTRAINT(0x01cd, 0xf),    /* MEM_TRANS_RETIRED.* */
 	/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c2, 0xf),
 	/* INST_RETIRED.PREC_DIST, inv=1, cmask=16 (cycles:ppp). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c0, 0x2),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c0, 0x2),
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_NA(0x01c2, 0xf), /* UOPS_RETIRED.ALL */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_XLD(0x11d0, 0xf), /* MEM_UOPS_RETIRED.STLB_MISS_LOADS */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_XLD(0x21d0, 0xf), /* MEM_UOPS_RETIRED.LOCK_LOADS */
@@ -777,9 +777,9 @@ struct event_constraint intel_bdw_pebs_e
 	INTEL_FLAGS_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PRECDIST */
 	INTEL_PLD_CONSTRAINT(0x01cd, 0xf),    /* MEM_TRANS_RETIRED.* */
 	/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c2, 0xf),
 	/* INST_RETIRED.PREC_DIST, inv=1, cmask=16 (cycles:ppp). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c0, 0x2),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c0, 0x2),
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_NA(0x01c2, 0xf), /* UOPS_RETIRED.ALL */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_UOPS_RETIRED.STLB_MISS_LOADS */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x21d0, 0xf), /* MEM_UOPS_RETIRED.LOCK_LOADS */
@@ -800,9 +800,9 @@ struct event_constraint intel_bdw_pebs_e
 struct event_constraint intel_skl_pebs_event_constraints[] = {
 	INTEL_FLAGS_UEVENT_CONSTRAINT(0x1c0, 0x2),	/* INST_RETIRED.PREC_DIST */
 	/* INST_RETIRED.PREC_DIST, inv=1, cmask=16 (cycles:ppp). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c0, 0x2),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108001c0, 0x2),
 	/* INST_RETIRED.TOTAL_CYCLES_PS (inv=1, cmask=16) (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x0f),
+	INTEL_FLAGS_UEVENT_CONSTRAINT(0x108000c0, 0x0f),
 	INTEL_PLD_CONSTRAINT(0x1cd, 0xf),		      /* MEM_TRANS_RETIRED.* */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_LOADS */
 	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x12d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_STORES */
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/x86/kernel/cpu/amd.c linux-libre-4.9.183-gnu/arch/x86/kernel/cpu/amd.c
--- linux-libre-4.9.182-gnu/arch/x86/kernel/cpu/amd.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/x86/kernel/cpu/amd.c	2019-06-22 02:17:25.000000000 -0400
@@ -766,8 +766,11 @@ static void init_amd_zn(struct cpuinfo_x
 {
 	set_cpu_cap(c, X86_FEATURE_ZEN);
 
-	/* Fix erratum 1076: CPB feature bit not being set in CPUID. */
-	if (!cpu_has(c, X86_FEATURE_CPB))
+	/*
+	 * Fix erratum 1076: CPB feature bit not being set in CPUID.
+	 * Always set it, except when running under a hypervisor.
+	 */
+	if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && !cpu_has(c, X86_FEATURE_CPB))
 		set_cpu_cap(c, X86_FEATURE_CPB);
 }
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/x86/kvm/pmu_intel.c linux-libre-4.9.183-gnu/arch/x86/kvm/pmu_intel.c
--- linux-libre-4.9.182-gnu/arch/x86/kvm/pmu_intel.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/x86/kvm/pmu_intel.c	2019-06-22 02:17:25.000000000 -0400
@@ -235,11 +235,14 @@ static int intel_pmu_set_msr(struct kvm_
 		}
 		break;
 	default:
-		if ((pmc = get_gp_pmc(pmu, msr, MSR_IA32_PERFCTR0)) ||
-		    (pmc = get_fixed_pmc(pmu, msr))) {
-			if (!msr_info->host_initiated)
-				data = (s64)(s32)data;
-			pmc->counter += data - pmc_read_counter(pmc);
+		if ((pmc = get_gp_pmc(pmu, msr, MSR_IA32_PERFCTR0))) {
+			if (msr_info->host_initiated)
+				pmc->counter = data;
+			else
+				pmc->counter = (s32)data;
+			return 0;
+		} else if ((pmc = get_fixed_pmc(pmu, msr))) {
+			pmc->counter = data;
 			return 0;
 		} else if ((pmc = get_gp_pmc(pmu, msr, MSR_P6_EVNTSEL0))) {
 			if (data == pmc->eventsel)
diff -druNp --no-dereference linux-libre-4.9.182-gnu/arch/x86/pci/irq.c linux-libre-4.9.183-gnu/arch/x86/pci/irq.c
--- linux-libre-4.9.182-gnu/arch/x86/pci/irq.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/arch/x86/pci/irq.c	2019-06-22 02:17:25.000000000 -0400
@@ -1117,6 +1117,8 @@ static struct dmi_system_id __initdata p
 
 void __init pcibios_irq_init(void)
 {
+	struct irq_routing_table *rtable = NULL;
+
 	DBG(KERN_DEBUG "PCI: IRQ init\n");
 
 	if (raw_pci_ops == NULL)
@@ -1127,8 +1129,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();
@@ -1143,8 +1147,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.9.182-gnu/drivers/ata/libata-core.c linux-libre-4.9.183-gnu/drivers/ata/libata-core.c
--- linux-libre-4.9.182-gnu/drivers/ata/libata-core.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/ata/libata-core.c	2019-06-22 02:17:25.000000000 -0400
@@ -4355,9 +4355,12 @@ static const struct ata_blacklist_entry
 	{ "ST3320[68]13AS",	"SD1[5-9]",	ATA_HORKAGE_NONCQ |
 						ATA_HORKAGE_FIRMWARE_WARN },
 
-	/* drives which fail FPDMA_AA activation (some may freeze afterwards) */
-	{ "ST1000LM024 HN-M101MBB", "2AR10001",	ATA_HORKAGE_BROKEN_FPDMA_AA },
-	{ "ST1000LM024 HN-M101MBB", "2BA30001",	ATA_HORKAGE_BROKEN_FPDMA_AA },
+	/* drives which fail FPDMA_AA activation (some may freeze afterwards)
+	   the ST disks also have LPM issues */
+	{ "ST1000LM024 HN-M101MBB", "2AR10001",	ATA_HORKAGE_BROKEN_FPDMA_AA |
+						ATA_HORKAGE_NOLPM, },
+	{ "ST1000LM024 HN-M101MBB", "2BA30001",	ATA_HORKAGE_BROKEN_FPDMA_AA |
+						ATA_HORKAGE_NOLPM, },
 	{ "VB0250EAVER",	"HPG7",		ATA_HORKAGE_BROKEN_FPDMA_AA },
 
 	/* Blacklist entries taken from Silicon Image 3124/3132
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/clk/rockchip/clk-rk3288.c linux-libre-4.9.183-gnu/drivers/clk/rockchip/clk-rk3288.c
--- linux-libre-4.9.182-gnu/drivers/clk/rockchip/clk-rk3288.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/clk/rockchip/clk-rk3288.c	2019-06-22 02:17:25.000000000 -0400
@@ -826,6 +826,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)];
@@ -842,6 +845,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.9.182-gnu/drivers/dma/idma64.c linux-libre-4.9.183-gnu/drivers/dma/idma64.c
--- linux-libre-4.9.182-gnu/drivers/dma/idma64.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/dma/idma64.c	2019-06-22 02:17:25.000000000 -0400
@@ -589,7 +589,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);
 
@@ -629,6 +629,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;
 
@@ -645,11 +646,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.9.182-gnu/drivers/dma/idma64.h linux-libre-4.9.183-gnu/drivers/dma/idma64.h
--- linux-libre-4.9.182-gnu/drivers/dma/idma64.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/dma/idma64.h	2019-06-22 02:17:25.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.9.182-gnu/drivers/gpio/gpio-omap.c linux-libre-4.9.183-gnu/drivers/gpio/gpio-omap.c
--- linux-libre-4.9.182-gnu/drivers/gpio/gpio-omap.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/gpio/gpio-omap.c	2019-06-22 02:17:25.000000000 -0400
@@ -296,6 +296,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)
 {
@@ -327,13 +343,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
@@ -346,7 +356,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.9.182-gnu/drivers/gpio/Kconfig linux-libre-4.9.183-gnu/drivers/gpio/Kconfig
--- linux-libre-4.9.182-gnu/drivers/gpio/Kconfig	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/gpio/Kconfig	2019-06-22 02:17:25.000000000 -0400
@@ -670,6 +670,7 @@ config GPIO_ADP5588
 config GPIO_ADP5588_IRQ
 	bool "Interrupt controller support for ADP5588"
 	depends on GPIO_ADP5588=y
+	select GPIOLIB_IRQCHIP
 	help
 	  Say yes here to enable the adp5588 to be used as an interrupt
 	  controller. It requires the driver to be built in the kernel.
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c linux-libre-4.9.183-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
--- linux-libre-4.9.182-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c	2019-06-22 02:17:25.000000000 -0400
@@ -735,11 +735,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.9.182-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c linux-libre-4.9.183-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
--- linux-libre-4.9.182-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c	2019-06-22 02:17:25.000000000 -0400
@@ -2493,7 +2493,8 @@ static int vmw_cmd_dx_set_shader(struct
 
 	cmd = container_of(header, typeof(*cmd), header);
 
-	if (cmd->body.type >= SVGA3D_SHADERTYPE_DX10_MAX) {
+	if (cmd->body.type >= SVGA3D_SHADERTYPE_DX10_MAX ||
+	    cmd->body.type < SVGA3D_SHADERTYPE_MIN) {
 		DRM_ERROR("Illegal shader type %u.\n",
 			  (unsigned) cmd->body.type);
 		return -EINVAL;
@@ -2732,6 +2733,10 @@ static int vmw_cmd_dx_view_define(struct
 	if (view_type == vmw_view_max)
 		return -EINVAL;
 	cmd = container_of(header, typeof(*cmd), header);
+	if (unlikely(cmd->sid == SVGA3D_INVALID_ID)) {
+		DRM_ERROR("Invalid surface id.\n");
+		return -EINVAL;
+	}
 	ret = vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface,
 				user_surface_converter,
 				&cmd->sid, &srf_node);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/i2c/busses/i2c-acorn.c linux-libre-4.9.183-gnu/drivers/i2c/busses/i2c-acorn.c
--- linux-libre-4.9.182-gnu/drivers/i2c/busses/i2c-acorn.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/i2c/busses/i2c-acorn.c	2019-06-22 02:17:25.000000000 -0400
@@ -83,6 +83,7 @@ static struct i2c_algo_bit_data ioc_data
 
 static struct i2c_adapter ioc_ops = {
 	.nr			= 0,
+	.name			= "ioc",
 	.algo_data		= &ioc_data,
 };
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/i2c/i2c-dev.c linux-libre-4.9.183-gnu/drivers/i2c/i2c-dev.c
--- linux-libre-4.9.182-gnu/drivers/i2c/i2c-dev.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/i2c/i2c-dev.c	2019-06-22 02:17:25.000000000 -0400
@@ -297,6 +297,7 @@ static noinline int i2cdev_ioctl_rdwr(st
 			    rdwr_pa[i].buf[0] < 1 ||
 			    rdwr_pa[i].len < rdwr_pa[i].buf[0] +
 					     I2C_SMBUS_BLOCK_MAX) {
+				i++;
 				res = -EINVAL;
 				break;
 			}
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/iommu/intel-iommu.c linux-libre-4.9.183-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-4.9.182-gnu/drivers/iommu/intel-iommu.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/iommu/intel-iommu.c	2019-06-22 02:17:25.000000000 -0400
@@ -4119,9 +4119,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)
@@ -4870,6 +4868,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.9.182-gnu/drivers/isdn/mISDN/socket.c linux-libre-4.9.183-gnu/drivers/isdn/mISDN/socket.c
--- linux-libre-4.9.182-gnu/drivers/isdn/mISDN/socket.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/isdn/mISDN/socket.c	2019-06-22 02:17:25.000000000 -0400
@@ -394,7 +394,7 @@ data_sock_ioctl(struct socket *sock, uns
 			memcpy(di.channelmap, dev->channelmap,
 			       sizeof(di.channelmap));
 			di.nrbchan = dev->nrbchan;
-			strcpy(di.name, dev_name(&dev->dev));
+			strscpy(di.name, dev_name(&dev->dev), sizeof(di.name));
 			if (copy_to_user((void __user *)arg, &di, sizeof(di)))
 				err = -EFAULT;
 		} else
@@ -678,7 +678,7 @@ base_sock_ioctl(struct socket *sock, uns
 			memcpy(di.channelmap, dev->channelmap,
 			       sizeof(di.channelmap));
 			di.nrbchan = dev->nrbchan;
-			strcpy(di.name, dev_name(&dev->dev));
+			strscpy(di.name, dev_name(&dev->dev), sizeof(di.name));
 			if (copy_to_user((void __user *)arg, &di, sizeof(di)))
 				err = -EFAULT;
 		} else
@@ -692,6 +692,7 @@ base_sock_ioctl(struct socket *sock, uns
 			err = -EFAULT;
 			break;
 		}
+		dn.name[sizeof(dn.name) - 1] = '\0';
 		dev = get_mdevice(dn.id);
 		if (dev)
 			err = device_rename(&dev->dev, dn.name);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/md/bcache/bset.c linux-libre-4.9.183-gnu/drivers/md/bcache/bset.c
--- linux-libre-4.9.182-gnu/drivers/md/bcache/bset.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/md/bcache/bset.c	2019-06-22 02:17:25.000000000 -0400
@@ -823,12 +823,22 @@ unsigned bch_btree_insert_key(struct btr
 	struct bset *i = bset_tree_last(b)->data;
 	struct bkey *m, *prev = NULL;
 	struct btree_iter iter;
+	struct bkey preceding_key_on_stack = ZERO_KEY;
+	struct bkey *preceding_key_p = &preceding_key_on_stack;
 
 	BUG_ON(b->ops->is_extents && !KEY_SIZE(k));
 
-	m = bch_btree_iter_init(b, &iter, b->ops->is_extents
-				? PRECEDING_KEY(&START_KEY(k))
-				: PRECEDING_KEY(k));
+	/*
+	 * If k has preceding key, preceding_key_p will be set to address
+	 *  of k's preceding key; otherwise preceding_key_p will be set
+	 * to NULL inside preceding_key().
+	 */
+	if (b->ops->is_extents)
+		preceding_key(&START_KEY(k), &preceding_key_p);
+	else
+		preceding_key(k, &preceding_key_p);
+
+	m = bch_btree_iter_init(b, &iter, preceding_key_p);
 
 	if (b->ops->insert_fixup(b, k, &iter, replace_key))
 		return status;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/md/bcache/bset.h linux-libre-4.9.183-gnu/drivers/md/bcache/bset.h
--- linux-libre-4.9.182-gnu/drivers/md/bcache/bset.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/md/bcache/bset.h	2019-06-22 02:17:25.000000000 -0400
@@ -417,20 +417,26 @@ static inline bool bch_cut_back(const st
 	return __bch_cut_back(where, k);
 }
 
-#define PRECEDING_KEY(_k)					\
-({								\
-	struct bkey *_ret = NULL;				\
-								\
-	if (KEY_INODE(_k) || KEY_OFFSET(_k)) {			\
-		_ret = &KEY(KEY_INODE(_k), KEY_OFFSET(_k), 0);	\
-								\
-		if (!_ret->low)					\
-			_ret->high--;				\
-		_ret->low--;					\
-	}							\
-								\
-	_ret;							\
-})
+/*
+ * Pointer '*preceding_key_p' points to a memory object to store preceding
+ * key of k. If the preceding key does not exist, set '*preceding_key_p' to
+ * NULL. So the caller of preceding_key() needs to take care of memory
+ * which '*preceding_key_p' pointed to before calling preceding_key().
+ * Currently the only caller of preceding_key() is bch_btree_insert_key(),
+ * and it points to an on-stack variable, so the memory release is handled
+ * by stackframe itself.
+ */
+static inline void preceding_key(struct bkey *k, struct bkey **preceding_key_p)
+{
+	if (KEY_INODE(k) || KEY_OFFSET(k)) {
+		(**preceding_key_p) = KEY(KEY_INODE(k), KEY_OFFSET(k), 0);
+		if (!(*preceding_key_p)->low)
+			(*preceding_key_p)->high--;
+		(*preceding_key_p)->low--;
+	} else {
+		(*preceding_key_p) = NULL;
+	}
+}
 
 static inline bool bch_ptr_invalid(struct btree_keys *b, const struct bkey *k)
 {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/media/v4l2-core/v4l2-ioctl.c linux-libre-4.9.183-gnu/drivers/media/v4l2-core/v4l2-ioctl.c
--- linux-libre-4.9.182-gnu/drivers/media/v4l2-core/v4l2-ioctl.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/media/v4l2-core/v4l2-ioctl.c	2019-06-22 02:17:25.000000000 -0400
@@ -1959,7 +1959,22 @@ static int v4l_s_parm(const struct v4l2_
 	struct v4l2_streamparm *p = arg;
 	int ret = check_fmt(file, p->type);
 
-	return ret ? ret : ops->vidioc_s_parm(file, fh, p);
+	if (ret)
+		return ret;
+
+	/* Note: extendedmode is never used in drivers */
+	if (V4L2_TYPE_IS_OUTPUT(p->type)) {
+		memset(p->parm.output.reserved, 0,
+		       sizeof(p->parm.output.reserved));
+		p->parm.output.extendedmode = 0;
+		p->parm.output.outputmode &= V4L2_MODE_HIGHQUALITY;
+	} else {
+		memset(p->parm.capture.reserved, 0,
+		       sizeof(p->parm.capture.reserved));
+		p->parm.capture.extendedmode = 0;
+		p->parm.capture.capturemode &= V4L2_MODE_HIGHQUALITY;
+	}
+	return ops->vidioc_s_parm(file, fh, p);
 }
 
 static int v4l_queryctrl(const struct v4l2_ioctl_ops *ops,
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/mfd/intel-lpss.c linux-libre-4.9.183-gnu/drivers/mfd/intel-lpss.c
--- linux-libre-4.9.182-gnu/drivers/mfd/intel-lpss.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/mfd/intel-lpss.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/mfd/tps65912-spi.c linux-libre-4.9.183-gnu/drivers/mfd/tps65912-spi.c
--- linux-libre-4.9.182-gnu/drivers/mfd/tps65912-spi.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/mfd/tps65912-spi.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/mfd/twl6040.c linux-libre-4.9.183-gnu/drivers/mfd/twl6040.c
--- linux-libre-4.9.182-gnu/drivers/mfd/twl6040.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/mfd/twl6040.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/misc/kgdbts.c linux-libre-4.9.183-gnu/drivers/misc/kgdbts.c
--- linux-libre-4.9.182-gnu/drivers/misc/kgdbts.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/misc/kgdbts.c	2019-06-22 02:17:25.000000000 -0400
@@ -1132,7 +1132,7 @@ static void kgdbts_put_char(u8 chr)
 
 static int param_set_kgdbts_var(const char *kmessage, struct kernel_param *kp)
 {
-	int len = strlen(kmessage);
+	size_t len = strlen(kmessage);
 
 	if (len >= MAX_CONFIG_LEN) {
 		printk(KERN_ERR "kgdbts: config string too long\n");
@@ -1152,7 +1152,7 @@ static int param_set_kgdbts_var(const ch
 
 	strcpy(config, kmessage);
 	/* Chop out \n char as a result of echo */
-	if (config[len - 1] == '\n')
+	if (len && config[len - 1] == '\n')
 		config[len - 1] = '\0';
 
 	/* Go and configure with the new params. */
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/net/ethernet/dec/tulip/de4x5.c linux-libre-4.9.183-gnu/drivers/net/ethernet/dec/tulip/de4x5.c
--- linux-libre-4.9.182-gnu/drivers/net/ethernet/dec/tulip/de4x5.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/net/ethernet/dec/tulip/de4x5.c	2019-06-22 02:17:25.000000000 -0400
@@ -2109,7 +2109,6 @@ static struct eisa_driver de4x5_eisa_dri
 		.remove  = de4x5_eisa_remove,
         }
 };
-MODULE_DEVICE_TABLE(eisa, de4x5_eisa_ids);
 #endif
 
 #ifdef CONFIG_PCI
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/net/ethernet/emulex/benet/be_ethtool.c linux-libre-4.9.183-gnu/drivers/net/ethernet/emulex/benet/be_ethtool.c
--- linux-libre-4.9.182-gnu/drivers/net/ethernet/emulex/benet/be_ethtool.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/net/ethernet/emulex/benet/be_ethtool.c	2019-06-22 02:17:25.000000000 -0400
@@ -1108,7 +1108,7 @@ static int be_get_rxnfc(struct net_devic
 		cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
 		break;
 	case ETHTOOL_GRXRINGS:
-		cmd->data = adapter->num_rx_qs - 1;
+		cmd->data = adapter->num_rx_qs;
 		break;
 	default:
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum.c linux-libre-4.9.183-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
--- linux-libre-4.9.182-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/net/ethernet/mellanox/mlxsw/spectrum.c	2019-06-22 02:17:25.000000000 -0400
@@ -2044,6 +2044,10 @@ mlxsw_sp_port_set_link_ksettings(struct
 	mlxsw_reg_ptys_unpack(ptys_pl, &eth_proto_cap, NULL, NULL);
 
 	autoneg = cmd->base.autoneg == AUTONEG_ENABLE;
+	if (!autoneg && cmd->base.speed == SPEED_56000) {
+		netdev_err(dev, "56G not supported with autoneg off\n");
+		return -EINVAL;
+	}
 	eth_proto_new = autoneg ?
 		mlxsw_sp_to_ptys_advert_link(cmd) :
 		mlxsw_sp_to_ptys_speed(cmd->base.speed);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/net/ethernet/renesas/sh_eth.c linux-libre-4.9.183-gnu/drivers/net/ethernet/renesas/sh_eth.c
--- linux-libre-4.9.182-gnu/drivers/net/ethernet/renesas/sh_eth.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/net/ethernet/renesas/sh_eth.c	2019-06-22 02:17:25.000000000 -0400
@@ -1388,6 +1388,10 @@ static void sh_eth_dev_exit(struct net_d
 	sh_eth_get_stats(ndev);
 	sh_eth_reset(ndev);
 
+	/* Set the RMII mode again if required */
+	if (mdp->cd->rmiimode)
+		sh_eth_write(ndev, 0x1, RMIIMODE);
+
 	/* Set MAC address again */
 	update_mac_address(ndev);
 }
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/net/usb/ipheth.c linux-libre-4.9.183-gnu/drivers/net/usb/ipheth.c
--- linux-libre-4.9.182-gnu/drivers/net/usb/ipheth.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/net/usb/ipheth.c	2019-06-22 02:17:25.000000000 -0400
@@ -437,17 +437,18 @@ static int ipheth_tx(struct sk_buff *skb
 			  dev);
 	dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
+	netif_stop_queue(net);
 	retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
 	if (retval) {
 		dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
 			__func__, retval);
 		dev->net->stats.tx_errors++;
 		dev_kfree_skb_any(skb);
+		netif_wake_queue(net);
 	} else {
 		dev->net->stats.tx_packets++;
 		dev->net->stats.tx_bytes += skb->len;
 		dev_consume_skb_any(skb);
-		netif_stop_queue(net);
 	}
 
 	return NETDEV_TX_OK;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/nvmem/core.c linux-libre-4.9.183-gnu/drivers/nvmem/core.c
--- linux-libre-4.9.182-gnu/drivers/nvmem/core.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/nvmem/core.c	2019-06-22 02:17:25.000000000 -0400
@@ -934,7 +934,7 @@ static inline void nvmem_shift_read_buff
 						    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) {
@@ -949,11 +949,16 @@ static inline void nvmem_shift_read_buff
 			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.9.182-gnu/drivers/pci/host/pcie-rcar.c linux-libre-4.9.183-gnu/drivers/pci/host/pcie-rcar.c
--- linux-libre-4.9.182-gnu/drivers/pci/host/pcie-rcar.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pci/host/pcie-rcar.c	2019-06-22 02:17:25.000000000 -0400
@@ -847,7 +847,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);
@@ -886,10 +886,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.9.182-gnu/drivers/pci/host/pcie-xilinx.c linux-libre-4.9.183-gnu/drivers/pci/host/pcie-xilinx.c
--- linux-libre-4.9.182-gnu/drivers/pci/host/pcie-xilinx.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pci/host/pcie-xilinx.c	2019-06-22 02:17:25.000000000 -0400
@@ -337,14 +337,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 */
@@ -516,6 +521,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);
@@ -544,7 +550,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.9.182-gnu/drivers/pci/hotplug/rpadlpar_core.c linux-libre-4.9.183-gnu/drivers/pci/hotplug/rpadlpar_core.c
--- linux-libre-4.9.182-gnu/drivers/pci/hotplug/rpadlpar_core.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pci/hotplug/rpadlpar_core.c	2019-06-22 02:17:25.000000000 -0400
@@ -55,6 +55,7 @@ static struct device_node *find_vio_slot
 		if ((rc == 0) && (!strcmp(drc_name, name)))
 			break;
 	}
+	of_node_put(parent);
 
 	return dn;
 }
@@ -78,6 +79,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;
@@ -313,6 +315,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:
@@ -446,6 +449,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.9.182-gnu/drivers/platform/chrome/cros_ec_proto.c linux-libre-4.9.183-gnu/drivers/platform/chrome/cros_ec_proto.c
--- linux-libre-4.9.182-gnu/drivers/platform/chrome/cros_ec_proto.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/platform/chrome/cros_ec_proto.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/platform/x86/intel_pmc_ipc.c linux-libre-4.9.183-gnu/drivers/platform/x86/intel_pmc_ipc.c
--- linux-libre-4.9.182-gnu/drivers/platform/x86/intel_pmc_ipc.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/platform/x86/intel_pmc_ipc.c	2019-06-22 02:17:25.000000000 -0400
@@ -620,13 +620,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.9.182-gnu/drivers/pwm/core.c linux-libre-4.9.183-gnu/drivers/pwm/core.c
--- linux-libre-4.9.182-gnu/drivers/pwm/core.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pwm/core.c	2019-06-22 02:17:25.000000000 -0400
@@ -302,10 +302,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);
@@ -339,7 +341,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);
 
@@ -359,8 +361,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.9.182-gnu/drivers/pwm/pwm-meson.c linux-libre-4.9.183-gnu/drivers/pwm/pwm-meson.c
--- linux-libre-4.9.182-gnu/drivers/pwm/pwm-meson.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pwm/pwm-meson.c	2019-06-22 02:17:25.000000000 -0400
@@ -110,6 +110,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;
 };
 
@@ -230,6 +234,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:
@@ -250,6 +255,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;
@@ -262,11 +269,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:
@@ -281,9 +291,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,
@@ -291,19 +305,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 ||
@@ -324,7 +335,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;
@@ -336,9 +347,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.9.182-gnu/drivers/pwm/pwm-tiehrpwm.c linux-libre-4.9.183-gnu/drivers/pwm/pwm-tiehrpwm.c
--- linux-libre-4.9.182-gnu/drivers/pwm/pwm-tiehrpwm.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pwm/pwm-tiehrpwm.c	2019-06-22 02:17:25.000000000 -0400
@@ -383,6 +383,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.9.182-gnu/drivers/pwm/sysfs.c linux-libre-4.9.183-gnu/drivers/pwm/sysfs.c
--- linux-libre-4.9.182-gnu/drivers/pwm/sysfs.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/pwm/sysfs.c	2019-06-22 02:17:25.000000000 -0400
@@ -399,19 +399,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,
@@ -427,6 +414,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.9.182-gnu/drivers/rapidio/rio_cm.c linux-libre-4.9.183-gnu/drivers/rapidio/rio_cm.c
--- linux-libre-4.9.182-gnu/drivers/rapidio/rio_cm.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/rapidio/rio_cm.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/rtc/rtc-pcf8523.c linux-libre-4.9.183-gnu/drivers/rtc/rtc-pcf8523.c
--- linux-libre-4.9.182-gnu/drivers/rtc/rtc-pcf8523.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/rtc/rtc-pcf8523.c	2019-06-22 02:17:25.000000000 -0400
@@ -82,6 +82,18 @@ static int pcf8523_write(struct i2c_clie
 	return 0;
 }
 
+static int pcf8523_voltage_low(struct i2c_client *client)
+{
+	u8 value;
+	int err;
+
+	err = pcf8523_read(client, REG_CONTROL3, &value);
+	if (err < 0)
+		return err;
+
+	return !!(value & REG_CONTROL3_BLF);
+}
+
 static int pcf8523_select_capacitance(struct i2c_client *client, bool high)
 {
 	u8 value;
@@ -164,6 +176,14 @@ static int pcf8523_rtc_read_time(struct
 	struct i2c_msg msgs[2];
 	int err;
 
+	err = pcf8523_voltage_low(client);
+	if (err < 0) {
+		return err;
+	} else if (err > 0) {
+		dev_err(dev, "low voltage detected, time is unreliable\n");
+		return -EINVAL;
+	}
+
 	msgs[0].addr = client->addr;
 	msgs[0].flags = 0;
 	msgs[0].len = 1;
@@ -248,17 +268,13 @@ static int pcf8523_rtc_ioctl(struct devi
 			     unsigned long arg)
 {
 	struct i2c_client *client = to_i2c_client(dev);
-	u8 value;
-	int ret = 0, err;
+	int ret;
 
 	switch (cmd) {
 	case RTC_VL_READ:
-		err = pcf8523_read(client, REG_CONTROL3, &value);
-		if (err < 0)
-			return err;
-
-		if (value & REG_CONTROL3_BLF)
-			ret = 1;
+		ret = pcf8523_voltage_low(client);
+		if (ret < 0)
+			return ret;
 
 		if (copy_to_user((void __user *)arg, &ret, sizeof(int)))
 			return -EFAULT;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/scsi/bnx2fc/bnx2fc_hwi.c linux-libre-4.9.183-gnu/drivers/scsi/bnx2fc/bnx2fc_hwi.c
--- linux-libre-4.9.182-gnu/drivers/scsi/bnx2fc/bnx2fc_hwi.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/scsi/bnx2fc/bnx2fc_hwi.c	2019-06-22 02:17:25.000000000 -0400
@@ -829,7 +829,7 @@ ret_err_rqe:
 			((u64)err_entry->data.err_warn_bitmap_hi << 32) |
 			(u64)err_entry->data.err_warn_bitmap_lo;
 		for (i = 0; i < BNX2FC_NUM_ERR_BITS; i++) {
-			if (err_warn_bit_map & (u64) (1 << i)) {
+			if (err_warn_bit_map & ((u64)1 << i)) {
 				err_warn = i;
 				break;
 			}
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/scsi/cxgbi/libcxgbi.c linux-libre-4.9.183-gnu/drivers/scsi/cxgbi/libcxgbi.c
--- linux-libre-4.9.182-gnu/drivers/scsi/cxgbi/libcxgbi.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/scsi/cxgbi/libcxgbi.c	2019-06-22 02:17:25.000000000 -0400
@@ -637,6 +637,10 @@ static struct cxgbi_sock *cxgbi_check_ro
 
 	if (ndev->flags & IFF_LOOPBACK) {
 		ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr);
+		if (!ndev) {
+			err = -ENETUNREACH;
+			goto rel_neigh;
+		}
 		mtu = ndev->mtu;
 		pr_info("rt dev %s, loopback -> %s, mtu %u.\n",
 			n->dev->name, ndev->name, mtu);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/scsi/libsas/sas_expander.c linux-libre-4.9.183-gnu/drivers/scsi/libsas/sas_expander.c
--- linux-libre-4.9.182-gnu/drivers/scsi/libsas/sas_expander.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/scsi/libsas/sas_expander.c	2019-06-22 02:17:25.000000000 -0400
@@ -978,6 +978,8 @@ static struct domain_device *sas_ex_disc
 		list_del(&child->dev_list_node);
 		spin_unlock_irq(&parent->port->dev_list_lock);
 		sas_put_device(child);
+		sas_port_delete(phy->port);
+		phy->port = NULL;
 		return NULL;
 	}
 	list_add_tail(&child->siblings, &parent->ex_dev.children);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/scsi/lpfc/lpfc_els.c linux-libre-4.9.183-gnu/drivers/scsi/lpfc/lpfc_els.c
--- linux-libre-4.9.182-gnu/drivers/scsi/lpfc/lpfc_els.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/scsi/lpfc/lpfc_els.c	2019-06-22 02:17:25.000000000 -0400
@@ -6789,7 +6789,10 @@ int
 lpfc_send_rrq(struct lpfc_hba *phba, struct lpfc_node_rrq *rrq)
 {
 	struct lpfc_nodelist *ndlp = lpfc_findnode_did(rrq->vport,
-							rrq->nlp_DID);
+						       rrq->nlp_DID);
+	if (!ndlp)
+		return 1;
+
 	if (lpfc_test_rrq_active(phba, ndlp, rrq->xritag))
 		return lpfc_issue_els_rrq(rrq->vport, ndlp,
 					 rrq->nlp_DID, rrq);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/scsi/smartpqi/smartpqi_init.c linux-libre-4.9.183-gnu/drivers/scsi/smartpqi/smartpqi_init.c
--- linux-libre-4.9.182-gnu/drivers/scsi/smartpqi/smartpqi_init.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/scsi/smartpqi/smartpqi_init.c	2019-06-22 02:17:25.000000000 -0400
@@ -5478,7 +5478,7 @@ static int pqi_pci_init(struct pqi_ctrl_
 	else
 		mask = DMA_BIT_MASK(32);
 
-	rc = dma_set_mask(&ctrl_info->pci_dev->dev, mask);
+	rc = dma_set_mask_and_coherent(&ctrl_info->pci_dev->dev, mask);
 	if (rc) {
 		dev_err(&ctrl_info->pci_dev->dev, "failed to set DMA mask\n");
 		goto disable_device;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c linux-libre-4.9.183-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c
--- linux-libre-4.9.182-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/soc/mediatek/mtk-pmic-wrap.c	2019-06-22 02:17:25.000000000 -0400
@@ -778,7 +778,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.9.182-gnu/drivers/spi/spi-pxa2xx.c linux-libre-4.9.183-gnu/drivers/spi/spi-pxa2xx.c
--- linux-libre-4.9.182-gnu/drivers/spi/spi-pxa2xx.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/spi/spi-pxa2xx.c	2019-06-22 02:17:25.000000000 -0400
@@ -1475,12 +1475,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.9.182-gnu/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-libre-4.9.183-gnu/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
--- linux-libre-4.9.182-gnu/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c	2019-06-22 02:17:25.000000000 -0400
@@ -381,18 +381,9 @@ create_pagelist(char __user *buf, size_t
 	int run, addridx, actual_pages;
         unsigned long *need_release;
 
-	if (count >= INT_MAX - PAGE_SIZE)
-		return NULL;
-
 	offset = (unsigned int)buf & (PAGE_SIZE - 1);
 	num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE;
 
-	if (num_pages > (SIZE_MAX - sizeof(PAGELIST_T) -
-			 sizeof(struct vchiq_pagelist_info)) /
-			(sizeof(u32) + sizeof(pages[0]) +
-			 sizeof(struct scatterlist)))
-		return NULL;
-
 	*ppagelist = NULL;
 
 	/* Allocate enough storage to hold the page pointers and the page
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/thermal/qcom/tsens.c linux-libre-4.9.183-gnu/drivers/thermal/qcom/tsens.c
--- linux-libre-4.9.182-gnu/drivers/thermal/qcom/tsens.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/thermal/qcom/tsens.c	2019-06-22 02:17:25.000000000 -0400
@@ -162,7 +162,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.9.182-gnu/drivers/tty/serial/8250/8250_dw.c linux-libre-4.9.183-gnu/drivers/tty/serial/8250/8250_dw.c
--- linux-libre-4.9.182-gnu/drivers/tty/serial/8250/8250_dw.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/tty/serial/8250/8250_dw.c	2019-06-22 02:17:25.000000000 -0400
@@ -269,7 +269,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;
 }
 
 static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
@@ -311,7 +311,7 @@ static void dw8250_quirks(struct uart_po
 		p->set_termios = dw8250_set_termios;
 	}
 
-	/* Platforms with iDMA */
+	/* Platforms with iDMA 64-bit */
 	if (platform_get_resource_byname(to_platform_device(p->dev),
 					 IORESOURCE_MEM, "lpss_priv")) {
 		p->set_termios = dw8250_set_termios;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/tty/serial/sunhv.c linux-libre-4.9.183-gnu/drivers/tty/serial/sunhv.c
--- linux-libre-4.9.182-gnu/drivers/tty/serial/sunhv.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/tty/serial/sunhv.c	2019-06-22 02:17:25.000000000 -0400
@@ -392,7 +392,7 @@ static struct uart_ops sunhv_pops = {
 static struct uart_driver sunhv_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "sunhv",
-	.dev_name		= "ttyS",
+	.dev_name		= "ttyHV",
 	.major			= TTY_MAJOR,
 };
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/core/quirks.c linux-libre-4.9.183-gnu/drivers/usb/core/quirks.c
--- linux-libre-4.9.182-gnu/drivers/usb/core/quirks.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/core/quirks.c	2019-06-22 02:17:25.000000000 -0400
@@ -70,6 +70,9 @@ static const struct usb_device_id usb_qu
 	/* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */
 	{ USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* Logitech HD Webcam C270 */
+	{ USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */
 	{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
 	{ USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/dwc2/hcd.c linux-libre-4.9.183-gnu/drivers/usb/dwc2/hcd.c
--- linux-libre-4.9.182-gnu/drivers/usb/dwc2/hcd.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/dwc2/hcd.c	2019-06-22 02:17:25.000000000 -0400
@@ -2552,8 +2552,10 @@ static void dwc2_free_dma_aligned_buffer
 		return;
 
 	/* Restore urb->transfer_buffer from the end of the allocated area */
-	memcpy(&stored_xfer_buffer, urb->transfer_buffer +
-	       urb->transfer_buffer_length, sizeof(urb->transfer_buffer));
+	memcpy(&stored_xfer_buffer,
+	       PTR_ALIGN(urb->transfer_buffer + urb->transfer_buffer_length,
+			 dma_get_cache_alignment()),
+	       sizeof(urb->transfer_buffer));
 
 	if (usb_urb_dir_in(urb))
 		memcpy(stored_xfer_buffer, urb->transfer_buffer,
@@ -2580,6 +2582,7 @@ static int dwc2_alloc_dma_aligned_buffer
 	 * DMA
 	 */
 	kmalloc_size = urb->transfer_buffer_length +
+		(dma_get_cache_alignment() - 1) +
 		sizeof(urb->transfer_buffer);
 
 	kmalloc_ptr = kmalloc(kmalloc_size, mem_flags);
@@ -2590,7 +2593,8 @@ static int dwc2_alloc_dma_aligned_buffer
 	 * Position value of original urb->transfer_buffer pointer to the end
 	 * of allocation for later referencing
 	 */
-	memcpy(kmalloc_ptr + urb->transfer_buffer_length,
+	memcpy(PTR_ALIGN(kmalloc_ptr + urb->transfer_buffer_length,
+			 dma_get_cache_alignment()),
 	       &urb->transfer_buffer, sizeof(urb->transfer_buffer));
 
 	if (usb_urb_dir_out(urb))
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/serial/option.c linux-libre-4.9.183-gnu/drivers/usb/serial/option.c
--- linux-libre-4.9.182-gnu/drivers/usb/serial/option.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/serial/option.c	2019-06-22 02:17:25.000000000 -0400
@@ -1166,6 +1166,10 @@ static const struct usb_device_id option
 	{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214),
 	  .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
+	{ USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
+	  .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
+	{ USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
+	  .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
 	{ USB_DEVICE(TELIT_VENDOR_ID, 0x1900),				/* Telit LN940 (QMI) */
 	  .driver_info = NCTRL(0) | RSVD(1) },
 	{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff),	/* Telit LN940 (MBIM) */
@@ -1767,6 +1771,8 @@ static const struct usb_device_id option
 	{ USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E),
 	  .driver_info = RSVD(5) | RSVD(6) },
 	{ USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) },	/* Simcom SIM7500/SIM7600 MBIM mode */
+	{ USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff),	/* Simcom SIM7500/SIM7600 RNDIS mode */
+	  .driver_info = RSVD(7) },
 	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
 	  .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },
 	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/serial/pl2303.c linux-libre-4.9.183-gnu/drivers/usb/serial/pl2303.c
--- linux-libre-4.9.182-gnu/drivers/usb/serial/pl2303.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/serial/pl2303.c	2019-06-22 02:17:25.000000000 -0400
@@ -101,6 +101,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
 	{ USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
 	{ USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
+	{ USB_DEVICE(AT_VENDOR_ID, AT_VTKIT3_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/serial/pl2303.h linux-libre-4.9.183-gnu/drivers/usb/serial/pl2303.h
--- linux-libre-4.9.182-gnu/drivers/usb/serial/pl2303.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/serial/pl2303.h	2019-06-22 02:17:25.000000000 -0400
@@ -159,3 +159,6 @@
 #define SMART_VENDOR_ID	0x0b8c
 #define SMART_PRODUCT_ID	0x2303
 
+/* Allied Telesis VT-Kit3 */
+#define AT_VENDOR_ID		0x0caa
+#define AT_VTKIT3_PRODUCT_ID	0x3001
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/usb/storage/unusual_realtek.h linux-libre-4.9.183-gnu/drivers/usb/storage/unusual_realtek.h
--- linux-libre-4.9.182-gnu/drivers/usb/storage/unusual_realtek.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/usb/storage/unusual_realtek.h	2019-06-22 02:17:25.000000000 -0400
@@ -29,6 +29,11 @@ UNUSUAL_DEV(0x0bda, 0x0138, 0x0000, 0x99
 		"USB Card Reader",
 		USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0),
 
+UNUSUAL_DEV(0x0bda, 0x0153, 0x0000, 0x9999,
+		"Realtek",
+		"USB Card Reader",
+		USB_SC_DEVICE, USB_PR_DEVICE, init_realtek_cr, 0),
+
 UNUSUAL_DEV(0x0bda, 0x0158, 0x0000, 0x9999,
 		"Realtek",
 		"USB Card Reader",
diff -druNp --no-dereference linux-libre-4.9.182-gnu/drivers/video/fbdev/hgafb.c linux-libre-4.9.183-gnu/drivers/video/fbdev/hgafb.c
--- linux-libre-4.9.182-gnu/drivers/video/fbdev/hgafb.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/video/fbdev/hgafb.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/video/fbdev/imsttfb.c linux-libre-4.9.183-gnu/drivers/video/fbdev/imsttfb.c
--- linux-libre-4.9.182-gnu/drivers/video/fbdev/imsttfb.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/video/fbdev/imsttfb.c	2019-06-22 02:17:25.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.9.182-gnu/drivers/watchdog/imx2_wdt.c linux-libre-4.9.183-gnu/drivers/watchdog/imx2_wdt.c
--- linux-libre-4.9.182-gnu/drivers/watchdog/imx2_wdt.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/watchdog/imx2_wdt.c	2019-06-22 02:17:25.000000000 -0400
@@ -181,8 +181,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.9.182-gnu/drivers/watchdog/Kconfig linux-libre-4.9.183-gnu/drivers/watchdog/Kconfig
--- linux-libre-4.9.182-gnu/drivers/watchdog/Kconfig	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/drivers/watchdog/Kconfig	2019-06-22 02:17:25.000000000 -0400
@@ -1850,6 +1850,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.9.182-gnu/fs/configfs/dir.c linux-libre-4.9.183-gnu/fs/configfs/dir.c
--- linux-libre-4.9.182-gnu/fs/configfs/dir.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/configfs/dir.c	2019-06-22 02:17:25.000000000 -0400
@@ -58,15 +58,13 @@ static void configfs_d_iput(struct dentr
 	if (sd) {
 		/* Coordinate with configfs_readdir */
 		spin_lock(&configfs_dirent_lock);
-		/* Coordinate with configfs_attach_attr where will increase
-		 * sd->s_count and update sd->s_dentry to new allocated one.
-		 * Only set sd->dentry to null when this dentry is the only
-		 * sd owner.
-		 * If not do so, configfs_d_iput may run just after
-		 * configfs_attach_attr and set sd->s_dentry to null
-		 * even it's still in use.
+		/*
+		 * Set sd->s_dentry to null only when this dentry is the one
+		 * that is going to be killed.  Otherwise configfs_d_iput may
+		 * run just after configfs_attach_attr and set sd->s_dentry to
+		 * NULL even it's still in use.
 		 */
-		if (atomic_read(&sd->s_count) <= 2)
+		if (sd->s_dentry == dentry)
 			sd->s_dentry = NULL;
 
 		spin_unlock(&configfs_dirent_lock);
@@ -1755,12 +1753,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.9.182-gnu/fs/f2fs/inode.c linux-libre-4.9.183-gnu/fs/f2fs/inode.c
--- linux-libre-4.9.182-gnu/fs/f2fs/inode.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/f2fs/inode.c	2019-06-22 02:17:25.000000000 -0400
@@ -288,6 +288,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.9.182-gnu/fs/f2fs/recovery.c linux-libre-4.9.183-gnu/fs/f2fs/recovery.c
--- linux-libre-4.9.182-gnu/fs/f2fs/recovery.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/f2fs/recovery.c	2019-06-22 02:17:25.000000000 -0400
@@ -407,7 +407,15 @@ retry_dn:
 
 	get_node_info(sbi, dn.nid, &ni);
 	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.9.182-gnu/fs/f2fs/segment.h linux-libre-4.9.183-gnu/fs/f2fs/segment.h
--- linux-libre-4.9.182-gnu/fs/f2fs/segment.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/f2fs/segment.h	2019-06-22 02:17:25.000000000 -0400
@@ -613,7 +613,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;
@@ -640,7 +639,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.9.182-gnu/fs/fat/file.c linux-libre-4.9.183-gnu/fs/fat/file.c
--- linux-libre-4.9.182-gnu/fs/fat/file.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/fat/file.c	2019-06-22 02:17:25.000000000 -0400
@@ -160,12 +160,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.9.182-gnu/fs/fuse/dev.c linux-libre-4.9.183-gnu/fs/fuse/dev.c
--- linux-libre-4.9.182-gnu/fs/fuse/dev.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/fuse/dev.c	2019-06-22 02:17:25.000000000 -0400
@@ -1668,7 +1668,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.9.182-gnu/fs/inode.c linux-libre-4.9.183-gnu/fs/inode.c
--- linux-libre-4.9.182-gnu/fs/inode.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/inode.c	2019-06-22 02:17:25.000000000 -0400
@@ -1804,8 +1804,13 @@ int file_remove_privs(struct file *file)
 	int kill;
 	int error = 0;
 
-	/* Fast path for nothing security related */
-	if (IS_NOSEC(inode))
+	/*
+	 * Fast path for nothing security related.
+	 * As well for non-regular files, e.g. blkdev inodes.
+	 * For example, blkdev_write_iter() might get here
+	 * trying to remove privs which it is not allowed to.
+	 */
+	if (IS_NOSEC(inode) || !S_ISREG(inode->i_mode))
 		return 0;
 
 	kill = dentry_needs_remove_privs(dentry);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/fs/nfsd/vfs.h linux-libre-4.9.183-gnu/fs/nfsd/vfs.h
--- linux-libre-4.9.182-gnu/fs/nfsd/vfs.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/nfsd/vfs.h	2019-06-22 02:17:25.000000000 -0400
@@ -116,8 +116,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.9.182-gnu/fs/ocfs2/dcache.c linux-libre-4.9.183-gnu/fs/ocfs2/dcache.c
--- linux-libre-4.9.182-gnu/fs/ocfs2/dcache.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/fs/ocfs2/dcache.c	2019-06-22 02:17:25.000000000 -0400
@@ -310,6 +310,18 @@ int ocfs2_dentry_attach_lock(struct dent
 
 out_attach:
 	spin_lock(&dentry_attach_lock);
+	if (unlikely(dentry->d_fsdata && !alias)) {
+		/* d_fsdata is set by a racing thread which is doing
+		 * the same thing as this thread is doing. Leave the racing
+		 * thread going ahead and we return here.
+		 */
+		spin_unlock(&dentry_attach_lock);
+		iput(dl->dl_inode);
+		ocfs2_lock_res_free(&dl->dl_lockres);
+		kfree(dl);
+		return 0;
+	}
+
 	dentry->d_fsdata = dl;
 	dl->dl_count++;
 	spin_unlock(&dentry_attach_lock);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/include/linux/cgroup.h linux-libre-4.9.183-gnu/include/linux/cgroup.h
--- linux-libre-4.9.182-gnu/include/linux/cgroup.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/include/linux/cgroup.h	2019-06-22 02:17:25.000000000 -0400
@@ -462,7 +462,7 @@ static inline struct cgroup_subsys_state
  *
  * Find the css for the (@task, @subsys_id) combination, increment a
  * reference on and return it.  This function is guaranteed to return a
- * valid css.
+ * valid css.  The returned css may already have been offlined.
  */
 static inline struct cgroup_subsys_state *
 task_get_css(struct task_struct *task, int subsys_id)
@@ -472,7 +472,13 @@ task_get_css(struct task_struct *task, i
 	rcu_read_lock();
 	while (true) {
 		css = task_css(task, subsys_id);
-		if (likely(css_tryget_online(css)))
+		/*
+		 * Can't use css_tryget_online() here.  A task which has
+		 * PF_EXITING set may stay associated with an offline css.
+		 * If such task calls this function, css_tryget_online()
+		 * will keep failing.
+		 */
+		if (likely(css_tryget(css)))
 			break;
 		cpu_relax();
 	}
diff -druNp --no-dereference linux-libre-4.9.182-gnu/include/linux/pwm.h linux-libre-4.9.183-gnu/include/linux/pwm.h
--- linux-libre-4.9.182-gnu/include/linux/pwm.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/include/linux/pwm.h	2019-06-22 02:17:25.000000000 -0400
@@ -641,7 +641,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)
 {
@@ -650,10 +649,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.9.182-gnu/include/net/bluetooth/hci_core.h linux-libre-4.9.183-gnu/include/net/bluetooth/hci_core.h
--- linux-libre-4.9.182-gnu/include/net/bluetooth/hci_core.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/include/net/bluetooth/hci_core.h	2019-06-22 02:17:25.000000000 -0400
@@ -176,9 +176,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.9.182-gnu/ipc/mqueue.c linux-libre-4.9.183-gnu/ipc/mqueue.c
--- linux-libre-4.9.182-gnu/ipc/mqueue.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/ipc/mqueue.c	2019-06-22 02:17:25.000000000 -0400
@@ -371,7 +371,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);
 
@@ -382,10 +383,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.9.182-gnu/ipc/msgutil.c linux-libre-4.9.183-gnu/ipc/msgutil.c
--- linux-libre-4.9.182-gnu/ipc/msgutil.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/ipc/msgutil.c	2019-06-22 02:17:25.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.9.182-gnu/kernel/cred.c linux-libre-4.9.183-gnu/kernel/cred.c
--- linux-libre-4.9.182-gnu/kernel/cred.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/cred.c	2019-06-22 02:17:25.000000000 -0400
@@ -447,6 +447,15 @@ int commit_creds(struct cred *new)
 		if (task->mm)
 			set_dumpable(task->mm, suid_dumpable);
 		task->pdeath_signal = 0;
+		/*
+		 * If a task drops privileges and becomes nondumpable,
+		 * the dumpability change must become visible before
+		 * the credential change; otherwise, a __ptrace_may_access()
+		 * racing with this change may be able to attach to a task it
+		 * shouldn't be able to attach to (as if the task had dropped
+		 * privileges without becoming nondumpable).
+		 * Pairs with a read barrier in __ptrace_may_access().
+		 */
 		smp_wmb();
 	}
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/kernel/events/ring_buffer.c linux-libre-4.9.183-gnu/kernel/events/ring_buffer.c
--- linux-libre-4.9.182-gnu/kernel/events/ring_buffer.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/events/ring_buffer.c	2019-06-22 02:17:25.000000000 -0400
@@ -49,14 +49,30 @@ static void perf_output_put_handle(struc
 	unsigned long head;
 
 again:
+	/*
+	 * In order to avoid publishing a head value that goes backwards,
+	 * we must ensure the load of @rb->head happens after we've
+	 * incremented @rb->nest.
+	 *
+	 * Otherwise we can observe a @rb->head value before one published
+	 * by an IRQ/NMI happening between the load and the increment.
+	 */
+	barrier();
 	head = local_read(&rb->head);
 
 	/*
-	 * IRQ/NMI can happen here, which means we can miss a head update.
+	 * IRQ/NMI can happen here and advance @rb->head, causing our
+	 * load above to be stale.
 	 */
 
-	if (!local_dec_and_test(&rb->nest))
+	/*
+	 * If this isn't the outermost nesting, we don't have to update
+	 * @rb->user_page->data_head.
+	 */
+	if (local_read(&rb->nest) > 1) {
+		local_dec(&rb->nest);
 		goto out;
+	}
 
 	/*
 	 * Since the mmap() consumer (userspace) can run on a different CPU:
@@ -88,9 +104,18 @@ again:
 	rb->user_page->data_head = head;
 
 	/*
-	 * Now check if we missed an update -- rely on previous implied
-	 * compiler barriers to force a re-read.
+	 * We must publish the head before decrementing the nest count,
+	 * otherwise an IRQ/NMI can publish a more recent head value and our
+	 * write will (temporarily) publish a stale value.
 	 */
+	barrier();
+	local_set(&rb->nest, 0);
+
+	/*
+	 * Ensure we decrement @rb->nest before we validate the @rb->head.
+	 * Otherwise we cannot be sure we caught the 'last' nested update.
+	 */
+	barrier();
 	if (unlikely(head != local_read(&rb->head))) {
 		local_inc(&rb->nest);
 		goto again;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/kernel/Makefile linux-libre-4.9.183-gnu/kernel/Makefile
--- linux-libre-4.9.182-gnu/kernel/Makefile	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/Makefile	2019-06-22 02:17:25.000000000 -0400
@@ -28,6 +28,7 @@ KCOV_INSTRUMENT_extable.o := n
 # Don't self-instrument.
 KCOV_INSTRUMENT_kcov.o := n
 KASAN_SANITIZE_kcov.o := n
+CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
 
 # cond_syscall is currently not LTO compatible
 CFLAGS_sys_ni.o = $(DISABLE_LTO)
diff -druNp --no-dereference linux-libre-4.9.182-gnu/kernel/ptrace.c linux-libre-4.9.183-gnu/kernel/ptrace.c
--- linux-libre-4.9.182-gnu/kernel/ptrace.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/ptrace.c	2019-06-22 02:17:25.000000000 -0400
@@ -322,6 +322,16 @@ static int __ptrace_may_access(struct ta
 	return -EPERM;
 ok:
 	rcu_read_unlock();
+	/*
+	 * If a task drops privileges and becomes nondumpable (through a syscall
+	 * like setresuid()) while we are trying to access it, we must ensure
+	 * that the dumpability is read after the credentials; otherwise,
+	 * we may be able to attach to a task that we shouldn't be able to
+	 * attach to (as if the task had dropped privileges without becoming
+	 * nondumpable).
+	 * Pairs with a write barrier in commit_creds().
+	 */
+	smp_rmb();
 	mm = task->mm;
 	if (mm &&
 	    ((get_dumpable(mm) != SUID_DUMP_USER) &&
@@ -710,6 +720,10 @@ static int ptrace_peek_siginfo(struct ta
 	if (arg.nr < 0)
 		return -EINVAL;
 
+	/* Ensure arg.off fits in an unsigned long */
+	if (arg.off > ULONG_MAX)
+		return 0;
+
 	if (arg.flags & PTRACE_PEEKSIGINFO_SHARED)
 		pending = &child->signal->shared_pending;
 	else
@@ -717,18 +731,20 @@ static int ptrace_peek_siginfo(struct ta
 
 	for (i = 0; i < arg.nr; ) {
 		siginfo_t info;
-		s32 off = arg.off + i;
+		unsigned long off = arg.off + i;
+		bool found = false;
 
 		spin_lock_irq(&child->sighand->siglock);
 		list_for_each_entry(q, &pending->list, list) {
 			if (!off--) {
+				found = true;
 				copy_siginfo(&info, &q->info);
 				break;
 			}
 		}
 		spin_unlock_irq(&child->sighand->siglock);
 
-		if (off >= 0) /* beyond the end of the list */
+		if (!found) /* beyond the end of the list */
 			break;
 
 #ifdef CONFIG_COMPAT
diff -druNp --no-dereference linux-libre-4.9.182-gnu/kernel/sys.c linux-libre-4.9.183-gnu/kernel/sys.c
--- linux-libre-4.9.182-gnu/kernel/sys.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/sys.c	2019-06-22 02:17:25.000000000 -0400
@@ -1762,7 +1762,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.9.182-gnu/kernel/sysctl.c linux-libre-4.9.183-gnu/kernel/sysctl.c
--- linux-libre-4.9.182-gnu/kernel/sysctl.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/sysctl.c	2019-06-22 02:17:25.000000000 -0400
@@ -2527,8 +2527,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.9.182-gnu/kernel/time/ntp.c linux-libre-4.9.183-gnu/kernel/time/ntp.c
--- linux-libre-4.9.182-gnu/kernel/time/ntp.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/kernel/time/ntp.c	2019-06-22 02:17:25.000000000 -0400
@@ -639,7 +639,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.9.182-gnu/Makefile linux-libre-4.9.183-gnu/Makefile
--- linux-libre-4.9.182-gnu/Makefile	2019-06-17 20:30:39.000000000 -0400
+++ linux-libre-4.9.183-gnu/Makefile	2019-06-22 08:46:05.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 182
+SUBLEVEL = 183
 EXTRAVERSION = -gnu
 NAME = Roaring Lionus
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/mm/cma.c linux-libre-4.9.183-gnu/mm/cma.c
--- linux-libre-4.9.182-gnu/mm/cma.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/cma.c	2019-06-22 02:17:25.000000000 -0400
@@ -100,8 +100,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));
diff -druNp --no-dereference linux-libre-4.9.182-gnu/mm/cma_debug.c linux-libre-4.9.183-gnu/mm/cma_debug.c
--- linux-libre-4.9.182-gnu/mm/cma_debug.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/cma_debug.c	2019-06-22 02:17:25.000000000 -0400
@@ -57,7 +57,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.9.182-gnu/mm/hugetlb.c linux-libre-4.9.183-gnu/mm/hugetlb.c
--- linux-libre-4.9.182-gnu/mm/hugetlb.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/hugetlb.c	2019-06-22 02:17:25.000000000 -0400
@@ -1247,12 +1247,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.9.182-gnu/mm/list_lru.c linux-libre-4.9.183-gnu/mm/list_lru.c
--- linux-libre-4.9.182-gnu/mm/list_lru.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/list_lru.c	2019-06-22 02:17:25.000000000 -0400
@@ -313,7 +313,7 @@ static int __memcg_init_list_lru_node(st
 	}
 	return 0;
 fail:
-	__memcg_destroy_list_lru_node(memcg_lrus, begin, i - 1);
+	__memcg_destroy_list_lru_node(memcg_lrus, begin, i);
 	return -ENOMEM;
 }
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/mm/page_alloc.c linux-libre-4.9.183-gnu/mm/page_alloc.c
--- linux-libre-4.9.182-gnu/mm/page_alloc.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/page_alloc.c	2019-06-22 02:17:25.000000000 -0400
@@ -5491,13 +5491,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.9.182-gnu/mm/slab.c linux-libre-4.9.183-gnu/mm/slab.c
--- linux-libre-4.9.182-gnu/mm/slab.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/mm/slab.c	2019-06-22 02:17:25.000000000 -0400
@@ -4365,8 +4365,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.9.182-gnu/net/ax25/ax25_route.c linux-libre-4.9.183-gnu/net/ax25/ax25_route.c
--- linux-libre-4.9.182-gnu/net/ax25/ax25_route.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/net/ax25/ax25_route.c	2019-06-22 02:17:25.000000000 -0400
@@ -443,9 +443,11 @@ int ax25_rt_autobind(ax25_cb *ax25, ax25
 	}
 
 	if (ax25->sk != NULL) {
+		local_bh_disable();
 		bh_lock_sock(ax25->sk);
 		sock_reset_flag(ax25->sk, SOCK_ZAPPED);
 		bh_unlock_sock(ax25->sk);
+		local_bh_enable();
 	}
 
 put:
diff -druNp --no-dereference linux-libre-4.9.182-gnu/net/bluetooth/hci_conn.c linux-libre-4.9.183-gnu/net/bluetooth/hci_conn.c
--- linux-libre-4.9.182-gnu/net/bluetooth/hci_conn.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/net/bluetooth/hci_conn.c	2019-06-22 02:17:25.000000000 -0400
@@ -1165,14 +1165,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.9.182-gnu/net/core/neighbour.c linux-libre-4.9.183-gnu/net/core/neighbour.c
--- linux-libre-4.9.182-gnu/net/core/neighbour.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/net/core/neighbour.c	2019-06-22 02:17:25.000000000 -0400
@@ -2704,6 +2704,7 @@ static void *neigh_get_idx_any(struct se
 }
 
 void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags)
+	__acquires(tbl->lock)
 	__acquires(rcu_bh)
 {
 	struct neigh_seq_state *state = seq->private;
@@ -2714,6 +2715,7 @@ void *neigh_seq_start(struct seq_file *s
 
 	rcu_read_lock_bh();
 	state->nht = rcu_dereference_bh(tbl->nht);
+	read_lock(&tbl->lock);
 
 	return *pos ? neigh_get_idx_any(seq, pos) : SEQ_START_TOKEN;
 }
@@ -2747,8 +2749,13 @@ out:
 EXPORT_SYMBOL(neigh_seq_next);
 
 void neigh_seq_stop(struct seq_file *seq, void *v)
+	__releases(tbl->lock)
 	__releases(rcu_bh)
 {
+	struct neigh_seq_state *state = seq->private;
+	struct neigh_table *tbl = state->tbl;
+
+	read_unlock(&tbl->lock);
 	rcu_read_unlock_bh();
 }
 EXPORT_SYMBOL(neigh_seq_stop);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/net/ipv6/ip6_flowlabel.c linux-libre-4.9.183-gnu/net/ipv6/ip6_flowlabel.c
--- linux-libre-4.9.182-gnu/net/ipv6/ip6_flowlabel.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/net/ipv6/ip6_flowlabel.c	2019-06-22 02:17:25.000000000 -0400
@@ -254,9 +254,9 @@ struct ip6_flowlabel *fl6_sock_lookup(st
 	rcu_read_lock_bh();
 	for_each_sk_fl_rcu(np, sfl) {
 		struct ip6_flowlabel *fl = sfl->fl;
-		if (fl->label == label) {
+
+		if (fl->label == label && atomic_inc_not_zero(&fl->users)) {
 			fl->lastuse = jiffies;
-			atomic_inc(&fl->users);
 			rcu_read_unlock_bh();
 			return fl;
 		}
@@ -623,7 +623,8 @@ int ipv6_flowlabel_opt(struct sock *sk,
 						goto done;
 					}
 					fl1 = sfl->fl;
-					atomic_inc(&fl1->users);
+					if (!atomic_inc_not_zero(&fl1->users))
+						fl1 = NULL;
 					break;
 				}
 			}
diff -druNp --no-dereference linux-libre-4.9.182-gnu/net/lapb/lapb_iface.c linux-libre-4.9.183-gnu/net/lapb/lapb_iface.c
--- linux-libre-4.9.182-gnu/net/lapb/lapb_iface.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/net/lapb/lapb_iface.c	2019-06-22 02:17:25.000000000 -0400
@@ -182,6 +182,7 @@ int lapb_unregister(struct net_device *d
 	lapb = __lapb_devtostruct(dev);
 	if (!lapb)
 		goto out;
+	lapb_put(lapb);
 
 	lapb_stop_t1timer(lapb);
 	lapb_stop_t2timer(lapb);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/core/seq/seq_clientmgr.c linux-libre-4.9.183-gnu/sound/core/seq/seq_clientmgr.c
--- linux-libre-4.9.182-gnu/sound/core/seq/seq_clientmgr.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/core/seq/seq_clientmgr.c	2019-06-22 02:17:25.000000000 -0400
@@ -1905,20 +1905,14 @@ static int snd_seq_ioctl_get_subscriptio
 	int result;
 	struct snd_seq_client *sender = NULL;
 	struct snd_seq_client_port *sport = NULL;
-	struct snd_seq_subscribers *p;
 
 	result = -EINVAL;
 	if ((sender = snd_seq_client_use_ptr(subs->sender.client)) == NULL)
 		goto __end;
 	if ((sport = snd_seq_port_use_ptr(sender, subs->sender.port)) == NULL)
 		goto __end;
-	p = snd_seq_port_get_subscription(&sport->c_src, &subs->dest);
-	if (p) {
-		result = 0;
-		*subs = p->info;
-	} else
-		result = -ENOENT;
-
+	result = snd_seq_port_get_subscription(&sport->c_src, &subs->dest,
+					       subs);
       __end:
       	if (sport)
 		snd_seq_port_unlock(sport);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/core/seq/seq_ports.c linux-libre-4.9.183-gnu/sound/core/seq/seq_ports.c
--- linux-libre-4.9.182-gnu/sound/core/seq/seq_ports.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/core/seq/seq_ports.c	2019-06-22 02:17:25.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 */
@@ -635,20 +635,23 @@ int snd_seq_port_disconnect(struct snd_s
 
 
 /* get matched subscriber */
-struct snd_seq_subscribers *snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
-							  struct snd_seq_addr *dest_addr)
+int snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
+				  struct snd_seq_addr *dest_addr,
+				  struct snd_seq_port_subscribe *subs)
 {
-	struct snd_seq_subscribers *s, *found = NULL;
+	struct snd_seq_subscribers *s;
+	int err = -ENOENT;
 
 	down_read(&src_grp->list_mutex);
 	list_for_each_entry(s, &src_grp->list_head, src_list) {
 		if (addr_match(dest_addr, &s->info.dest)) {
-			found = s;
+			*subs = s->info;
+			err = 0;
 			break;
 		}
 	}
 	up_read(&src_grp->list_mutex);
-	return found;
+	return err;
 }
 
 /*
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/core/seq/seq_ports.h linux-libre-4.9.183-gnu/sound/core/seq/seq_ports.h
--- linux-libre-4.9.182-gnu/sound/core/seq/seq_ports.h	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/core/seq/seq_ports.h	2019-06-22 02:17:25.000000000 -0400
@@ -135,7 +135,8 @@ int snd_seq_port_subscribe(struct snd_se
 			   struct snd_seq_port_subscribe *info);
 
 /* get matched subscriber */
-struct snd_seq_subscribers *snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
-							  struct snd_seq_addr *dest_addr);
+int snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
+				  struct snd_seq_addr *dest_addr,
+				  struct snd_seq_port_subscribe *subs);
 
 #endif
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/firewire/oxfw/oxfw.c linux-libre-4.9.183-gnu/sound/firewire/oxfw/oxfw.c
--- linux-libre-4.9.182-gnu/sound/firewire/oxfw/oxfw.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/firewire/oxfw/oxfw.c	2019-06-22 02:17:25.000000000 -0400
@@ -175,9 +175,6 @@ static int detect_quirks(struct snd_oxfw
 		oxfw->midi_input_ports = 0;
 		oxfw->midi_output_ports = 0;
 
-		/* Output stream exists but no data channels are useful. */
-		oxfw->has_output = false;
-
 		return snd_oxfw_scs1x_add(oxfw);
 	}
 
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/pci/hda/hda_intel.c linux-libre-4.9.183-gnu/sound/pci/hda/hda_intel.c
--- linux-libre-4.9.182-gnu/sound/pci/hda/hda_intel.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/pci/hda/hda_intel.c	2019-06-22 02:17:25.000000000 -0400
@@ -1700,9 +1700,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);
 
@@ -1809,6 +1806,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.9.182-gnu/sound/soc/codecs/cs42xx8.c linux-libre-4.9.183-gnu/sound/soc/codecs/cs42xx8.c
--- linux-libre-4.9.182-gnu/sound/soc/codecs/cs42xx8.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/soc/codecs/cs42xx8.c	2019-06-22 02:17:25.000000000 -0400
@@ -569,6 +569,7 @@ static int cs42xx8_runtime_resume(struct
 	msleep(5);
 
 	regcache_cache_only(cs42xx8->regmap, false);
+	regcache_mark_dirty(cs42xx8->regmap);
 
 	ret = regcache_sync(cs42xx8->regmap);
 	if (ret) {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/sound/soc/fsl/fsl_asrc.c linux-libre-4.9.183-gnu/sound/soc/fsl/fsl_asrc.c
--- linux-libre-4.9.182-gnu/sound/soc/fsl/fsl_asrc.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/sound/soc/fsl/fsl_asrc.c	2019-06-22 02:17:25.000000000 -0400
@@ -286,8 +286,8 @@ static int fsl_asrc_config_pair(struct f
 		return -EINVAL;
 	}
 
-	if ((outrate > 8000 && outrate < 30000) &&
-	    (outrate/inrate > 24 || inrate/outrate > 8)) {
+	if ((outrate >= 8000 && outrate <= 30000) &&
+	    (outrate > 24 * inrate || inrate > 8 * outrate)) {
 		pair_err("exceed supported ratio range [1/24, 8] for \
 				inrate/outrate: %d/%d\n", inrate, outrate);
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/objtool/check.c linux-libre-4.9.183-gnu/tools/objtool/check.c
--- linux-libre-4.9.182-gnu/tools/objtool/check.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/objtool/check.c	2019-06-22 02:17:25.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;
@@ -498,7 +500,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,
@@ -645,10 +647,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) {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/perf/arch/s390/util/machine.c linux-libre-4.9.183-gnu/tools/perf/arch/s390/util/machine.c
--- linux-libre-4.9.182-gnu/tools/perf/arch/s390/util/machine.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/perf/arch/s390/util/machine.c	2019-06-22 02:17:25.000000000 -0400
@@ -4,16 +4,19 @@
 #include "util.h"
 #include "machine.h"
 #include "api/fs/fs.h"
+#include "debug.h"
 
 int arch__fix_module_text_start(u64 *start, const char *name)
 {
+	u64 m_start = *start;
 	char path[PATH_MAX];
 
 	snprintf(path, PATH_MAX, "module/%.*s/sections/.text",
 				(int)strlen(name) - 2, name + 1);
-
-	if (sysfs__read_ull(path, (unsigned long long *)start) < 0)
-		return -1;
+	if (sysfs__read_ull(path, (unsigned long long *)start) < 0) {
+		pr_debug2("Using module %s start:%#lx\n", path, m_start);
+		*start = m_start;
+	}
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/perf/util/data-convert-bt.c linux-libre-4.9.183-gnu/tools/perf/util/data-convert-bt.c
--- linux-libre-4.9.182-gnu/tools/perf/util/data-convert-bt.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/perf/util/data-convert-bt.c	2019-06-22 02:17:25.000000000 -0400
@@ -265,7 +265,7 @@ static int string_set_value(struct bt_ct
 				if (i > 0)
 					strncpy(buffer, string, i);
 			}
-			strncat(buffer + p, numstr, 4);
+			memcpy(buffer + p, numstr, 4);
 			p += 3;
 		}
 	}
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/netfilter/nft_nat.sh linux-libre-4.9.183-gnu/tools/testing/selftests/netfilter/nft_nat.sh
--- linux-libre-4.9.182-gnu/tools/testing/selftests/netfilter/nft_nat.sh	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/netfilter/nft_nat.sh	2019-06-22 02:17:25.000000000 -0400
@@ -23,7 +23,11 @@ ip netns add ns0
 ip netns add ns1
 ip netns add ns2
 
-ip link add veth0 netns ns0 type veth peer name eth0 netns ns1
+ip link add veth0 netns ns0 type veth peer name eth0 netns ns1 > /dev/null 2>&1
+if [ $? -ne 0 ];then
+    echo "SKIP: No virtual ethernet pair device support in kernel"
+    exit $ksft_skip
+fi
 ip link add veth1 netns ns0 type veth peer name eth0 netns ns2
 
 ip -net ns0 link set lo up
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/adjtick.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/adjtick.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/adjtick.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/adjtick.c	2019-06-22 02:17:25.000000000 -0400
@@ -147,6 +147,7 @@ int check_tick_adj(long tickval)
 
 	eppm = get_ppm_drift();
 	printf("%lld usec, %lld ppm", systick + (systick * eppm / MILLION), eppm);
+	fflush(stdout);
 
 	tx1.modes = 0;
 	adjtimex(&tx1);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/leapcrash.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/leapcrash.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/leapcrash.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/leapcrash.c	2019-06-22 02:17:25.000000000 -0400
@@ -114,6 +114,7 @@ int main(void)
 		}
 		clear_time_state();
 		printf(".");
+		fflush(stdout);
 	}
 	printf("[OK]\n");
 	return ksft_exit_pass();
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/mqueue-lat.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/mqueue-lat.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/mqueue-lat.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/mqueue-lat.c	2019-06-22 02:17:25.000000000 -0400
@@ -113,6 +113,7 @@ int main(int argc, char **argv)
 	int ret;
 
 	printf("Mqueue latency :                          ");
+	fflush(stdout);
 
 	ret = mqueue_lat_test();
 	if (ret < 0) {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/nanosleep.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/nanosleep.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/nanosleep.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/nanosleep.c	2019-06-22 02:17:25.000000000 -0400
@@ -153,6 +153,7 @@ int main(int argc, char **argv)
 			continue;
 
 		printf("Nanosleep %-31s ", clockstring(clockid));
+		fflush(stdout);
 
 		length = 10;
 		while (length <= (NSEC_PER_SEC * 10)) {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/nsleep-lat.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/nsleep-lat.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/nsleep-lat.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/nsleep-lat.c	2019-06-22 02:17:25.000000000 -0400
@@ -166,6 +166,7 @@ int main(int argc, char **argv)
 			continue;
 
 		printf("nsleep latency %-26s ", clockstring(clockid));
+		fflush(stdout);
 
 		length = 10;
 		while (length <= (NSEC_PER_SEC * 10)) {
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/raw_skew.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/raw_skew.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/raw_skew.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/raw_skew.c	2019-06-22 02:17:25.000000000 -0400
@@ -124,6 +124,7 @@ int main(int argv, char **argc)
 		printf("WARNING: ADJ_OFFSET in progress, this will cause inaccurate results\n");
 
 	printf("Estimating clock drift: ");
+	fflush(stdout);
 	sleep(120);
 
 	get_monotonic_and_raw(&mon, &raw);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/set-tai.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/set-tai.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/set-tai.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/set-tai.c	2019-06-22 02:17:25.000000000 -0400
@@ -66,6 +66,7 @@ int main(int argc, char **argv)
 	printf("tai offset started at %i\n", ret);
 
 	printf("Checking tai offsets can be properly set: ");
+	fflush(stdout);
 	for (i = 1; i <= 60; i++) {
 		ret = set_tai(i);
 		ret = get_tai();
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/set-tz.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/set-tz.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/set-tz.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/set-tz.c	2019-06-22 02:17:25.000000000 -0400
@@ -76,6 +76,7 @@ int main(int argc, char **argv)
 	printf("tz_minuteswest started at %i, dst at %i\n", min, dst);
 
 	printf("Checking tz_minuteswest can be properly set: ");
+	fflush(stdout);
 	for (i = -15*60; i < 15*60; i += 30) {
 		ret = set_tz(i, dst);
 		ret = get_tz_min();
@@ -87,6 +88,7 @@ int main(int argc, char **argv)
 	printf("[OK]\n");
 
 	printf("Checking invalid tz_minuteswest values are caught: ");
+	fflush(stdout);
 
 	if (!set_tz(-15*60-1, dst)) {
 		printf("[FAILED] %i didn't return failure!\n", -15*60-1);
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/threadtest.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/threadtest.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/threadtest.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/threadtest.c	2019-06-22 02:17:25.000000000 -0400
@@ -175,6 +175,7 @@ int main(int argc, char **argv)
 	strftime(buf, 255, "%a, %d %b %Y %T %z", localtime(&start));
 	printf("%s\n", buf);
 	printf("Testing consistency with %i threads for %ld seconds: ", thread_count, runtime);
+	fflush(stdout);
 
 	/* spawn */
 	for (i = 0; i < thread_count; i++)
diff -druNp --no-dereference linux-libre-4.9.182-gnu/tools/testing/selftests/timers/valid-adjtimex.c linux-libre-4.9.183-gnu/tools/testing/selftests/timers/valid-adjtimex.c
--- linux-libre-4.9.182-gnu/tools/testing/selftests/timers/valid-adjtimex.c	2019-06-17 13:53:33.000000000 -0400
+++ linux-libre-4.9.183-gnu/tools/testing/selftests/timers/valid-adjtimex.c	2019-06-22 02:17:25.000000000 -0400
@@ -134,6 +134,7 @@ int validate_freq(void)
 	/* Set the leap second insert flag */
 
 	printf("Testing ADJ_FREQ... ");
+	fflush(stdout);
 	for (i = 0; i < NUM_FREQ_VALID; i++) {
 		tx.modes = ADJ_FREQUENCY;
 		tx.freq = valid_freq[i];
@@ -261,6 +262,7 @@ int set_bad_offset(long sec, long usec,
 int validate_set_offset(void)
 {
 	printf("Testing ADJ_SETOFFSET... ");
+	fflush(stdout);
 
 	/* Test valid values */
 	if (set_offset(NSEC_PER_SEC - 1, 1))
