diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/at91sam9263.dtsi linux-libre-3.18.125-gnu/arch/arm/boot/dts/at91sam9263.dtsi
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/at91sam9263.dtsi	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/at91sam9263.dtsi	2018-11-10 10:39:23.000000000 -0500
@@ -913,6 +913,8 @@
 			interrupts = <26 IRQ_TYPE_LEVEL_HIGH 3>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_fb>;
+			clocks = <&lcd_clk>, <&lcd_clk>;
+			clock-names = "lcdc_clk", "hclk";
 			status = "disabled";
 		};
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5250.dtsi linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5250.dtsi
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5250.dtsi	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5250.dtsi	2018-11-10 10:39:23.000000000 -0500
@@ -732,7 +732,7 @@
 
 	dp_phy: video-phy@10040720 {
 		compatible = "samsung,exynos5250-dp-video-phy";
-		reg = <0x10040720 4>;
+		samsung,pmu-syscon = <&pmu_system_controller>;
 		#phy-cells = <0>;
 	};
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5420-arndale-octa.dts	2018-11-10 10:39:23.000000000 -0500
@@ -372,3 +372,7 @@
 &usbdrd_dwc3_1 {
 	dr_mode = "host";
 };
+
+&cci {
+	status = "disabled";
+};
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5420.dtsi linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5420.dtsi
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/exynos5420.dtsi	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/exynos5420.dtsi	2018-11-10 10:39:23.000000000 -0500
@@ -120,7 +120,7 @@
 		};
 	};
 
-	cci@10d20000 {
+	cci: cci@10d20000 {
 		compatible = "arm,cci-400";
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -503,8 +503,8 @@
 	};
 
 	dp_phy: video-phy@10040728 {
-		compatible = "samsung,exynos5250-dp-video-phy";
-		reg = <0x10040728 4>;
+		compatible = "samsung,exynos5420-dp-video-phy";
+		samsung,pmu-syscon = <&pmu_system_controller>;
 		#phy-cells = <0>;
 	};
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/sama5d3xmb.dtsi linux-libre-3.18.125-gnu/arch/arm/boot/dts/sama5d3xmb.dtsi
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/sama5d3xmb.dtsi	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/sama5d3xmb.dtsi	2018-11-10 10:39:23.000000000 -0500
@@ -176,7 +176,7 @@
 			"Headphone Jack", "HPOUTR",
 			"IN2L", "Line In Jack",
 			"IN2R", "Line In Jack",
-			"MICBIAS", "IN1L",
+			"Mic", "MICBIAS",
 			"IN1L", "Mic";
 
 		atmel,ssc-controller = <&ssc0>;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/boot/dts/sama5d4.dtsi linux-libre-3.18.125-gnu/arch/arm/boot/dts/sama5d4.dtsi
--- linux-libre-3.18.124-gnu/arch/arm/boot/dts/sama5d4.dtsi	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/boot/dts/sama5d4.dtsi	2018-11-10 10:39:23.000000000 -0500
@@ -939,7 +939,7 @@
 
 			pit: timer@fc068630 {
 				compatible = "atmel,at91sam9260-pit";
-				reg = <0xfc068630 0xf>;
+				reg = <0xfc068630 0x10>;
 				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
 				clocks = <&h32ck>;
 			};
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/kvm/mmu.c linux-libre-3.18.125-gnu/arch/arm/kvm/mmu.c
--- linux-libre-3.18.124-gnu/arch/arm/kvm/mmu.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/kvm/mmu.c	2018-11-10 10:39:23.000000000 -0500
@@ -760,6 +760,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 	int idx;
 
 	idx = srcu_read_lock(&kvm->srcu);
+	down_read(&current->mm->mmap_sem);
 	spin_lock(&kvm->mmu_lock);
 
 	slots = kvm_memslots(kvm);
@@ -767,6 +768,7 @@ void stage2_unmap_vm(struct kvm *kvm)
 		stage2_unmap_memslot(kvm, memslot);
 
 	spin_unlock(&kvm->mmu_lock);
+	up_read(&current->mm->mmap_sem);
 	srcu_read_unlock(&kvm->srcu, idx);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/mach-at91/board-dt-sama5.c linux-libre-3.18.125-gnu/arch/arm/mach-at91/board-dt-sama5.c
--- linux-libre-3.18.124-gnu/arch/arm/mach-at91/board-dt-sama5.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/mach-at91/board-dt-sama5.c	2018-11-10 10:39:23.000000000 -0500
@@ -17,6 +17,7 @@
 #include <linux/of_platform.h>
 #include <linux/phy.h>
 #include <linux/clk-provider.h>
+#include <linux/phy.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -27,8 +28,25 @@
 #include "at91_aic.h"
 #include "generic.h"
 
+static int ksz8081_phy_fixup(struct phy_device *phy)
+{
+	int value;
+
+	value = phy_read(phy, 0x16);
+	value &= ~0x20;
+	phy_write(phy, 0x16, value);
+
+	return 0;
+}
+
 static void __init sama5_dt_device_init(void)
 {
+	if (of_machine_is_compatible("atmel,sama5d4ek") &&
+	   IS_ENABLED(CONFIG_PHYLIB)) {
+		phy_register_fixup_for_id("fc028000.etherne:00",
+						ksz8081_phy_fixup);
+	}
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/mach-omap2/control.h linux-libre-3.18.125-gnu/arch/arm/mach-omap2/control.h
--- linux-libre-3.18.124-gnu/arch/arm/mach-omap2/control.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/mach-omap2/control.h	2018-11-10 10:39:23.000000000 -0500
@@ -286,6 +286,10 @@
 #define OMAP5XXX_CONTROL_STATUS                0x134
 #define OMAP5_DEVICETYPE_MASK          (0x7 << 6)
 
+/* DRA7XX CONTROL CORE BOOTSTRAP */
+#define DRA7_CTRL_CORE_BOOTSTRAP	0x6c4
+#define DRA7_SPEEDSELECT_MASK		(0x3 << 8)
+
 /*
  * REVISIT: This list of registers is not comprehensive - there are more
  * that should be added.
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/mach-omap2/timer.c linux-libre-3.18.125-gnu/arch/arm/mach-omap2/timer.c
--- linux-libre-3.18.124-gnu/arch/arm/mach-omap2/timer.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/mach-omap2/timer.c	2018-11-10 10:39:23.000000000 -0500
@@ -54,6 +54,7 @@
 
 #include "soc.h"
 #include "common.h"
+#include "control.h"
 #include "powerdomain.h"
 #include "omap-secure.h"
 
@@ -496,7 +497,8 @@ static void __init realtime_counter_init
 	void __iomem *base;
 	static struct clk *sys_clk;
 	unsigned long rate;
-	unsigned int reg, num, den;
+	unsigned int reg;
+	unsigned long long num, den;
 
 	base = ioremap(REALTIME_COUNTER_BASE, SZ_32);
 	if (!base) {
@@ -511,6 +513,35 @@ static void __init realtime_counter_init
 	}
 
 	rate = clk_get_rate(sys_clk);
+
+	if (soc_is_dra7xx()) {
+		/*
+		 * Errata i856 says the 32.768KHz crystal does not start at
+		 * power on, so the CPU falls back to an emulated 32KHz clock
+		 * based on sysclk / 610 instead. This causes the master counter
+		 * frequency to not be 6.144MHz but at sysclk / 610 * 375 / 2
+		 * (OR sysclk * 75 / 244)
+		 *
+		 * This affects at least the DRA7/AM572x 1.0, 1.1 revisions.
+		 * Of course any board built without a populated 32.768KHz
+		 * crystal would also need this fix even if the CPU is fixed
+		 * later.
+		 *
+		 * Either case can be detected by using the two speedselect bits
+		 * If they are not 0, then the 32.768KHz clock driving the
+		 * coarse counter that corrects the fine counter every time it
+		 * ticks is actually rate/610 rather than 32.768KHz and we
+		 * should compensate to avoid the 570ppm (at 20MHz, much worse
+		 * at other rates) too fast system time.
+		 */
+		reg = omap_ctrl_readl(DRA7_CTRL_CORE_BOOTSTRAP);
+		if (reg & DRA7_SPEEDSELECT_MASK) {
+			num = 75;
+			den = 244;
+			goto sysclk1_based;
+		}
+	}
+
 	/* Numerator/denumerator values refer TRM Realtime Counter section */
 	switch (rate) {
 	case 12000000:
@@ -545,6 +576,7 @@ static void __init realtime_counter_init
 		break;
 	}
 
+sysclk1_based:
 	/* Program numerator and denumerator registers */
 	reg = readl_relaxed(base + INCREMENTER_NUMERATOR_OFFSET) &
 			NUMERATOR_DENUMERATOR_MASK;
@@ -556,7 +588,7 @@ static void __init realtime_counter_init
 	reg |= den;
 	writel_relaxed(reg, base + INCREMENTER_DENUMERATOR_RELOAD_OFFSET);
 
-	arch_timer_freq = (rate / den) * num;
+	arch_timer_freq = DIV_ROUND_UP_ULL(rate * num, den);
 	set_cntfreq();
 
 	iounmap(base);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/mach-shmobile/setup-r8a7740.c linux-libre-3.18.125-gnu/arch/arm/mach-shmobile/setup-r8a7740.c
--- linux-libre-3.18.124-gnu/arch/arm/mach-shmobile/setup-r8a7740.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/mach-shmobile/setup-r8a7740.c	2018-11-10 10:39:23.000000000 -0500
@@ -792,7 +792,14 @@ void __init r8a7740_init_irq_of(void)
 	void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
 	void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
 
+#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
+	void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000);
+	void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000);
+
+	gic_init(0, 29, gic_dist_base, gic_cpu_base);
+#else
 	irqchip_init();
+#endif
 
 	/* route signals to GIC */
 	iowrite32(0x0, pfc_inta_ctrl);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/arm/mm/ioremap.c linux-libre-3.18.125-gnu/arch/arm/mm/ioremap.c
--- linux-libre-3.18.124-gnu/arch/arm/mm/ioremap.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/arm/mm/ioremap.c	2018-11-10 10:39:23.000000000 -0500
@@ -447,7 +447,7 @@ void pci_ioremap_set_mem_type(int mem_ty
 
 int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
 {
-	BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
+	BUG_ON(offset + SZ_64K - 1 > IO_SPACE_LIMIT);
 
 	return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
 				  PCI_IO_VIRT_BASE + offset + SZ_64K,
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/mips/kernel/smp-cps.c linux-libre-3.18.125-gnu/arch/mips/kernel/smp-cps.c
--- linux-libre-3.18.124-gnu/arch/mips/kernel/smp-cps.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/mips/kernel/smp-cps.c	2018-11-10 10:39:23.000000000 -0500
@@ -92,7 +92,7 @@ static void __init cps_smp_setup(void)
 #ifdef CONFIG_MIPS_MT_FPAFF
 	/* If we have an FPU, enroll ourselves in the FPU-full mask */
 	if (cpu_has_fpu)
-		cpu_set(0, mt_fpu_cpumask);
+		cpumask_set_cpu(0, &mt_fpu_cpumask);
 #endif /* CONFIG_MIPS_MT_FPAFF */
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/powerpc/kernel/tm.S linux-libre-3.18.125-gnu/arch/powerpc/kernel/tm.S
--- linux-libre-3.18.124-gnu/arch/powerpc/kernel/tm.S	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/powerpc/kernel/tm.S	2018-11-10 10:39:23.000000000 -0500
@@ -199,13 +199,27 @@ dont_backup_fp:
 	std	r1, PACATMSCRATCH(r13)
 	ld	r1, PACAR1(r13)
 
-	/* Store the PPR in r11 and reset to decent value */
 	std	r11, GPR11(r1)			/* Temporary stash */
 
+	/*
+	 * Move the saved user r1 to the kernel stack in case PACATMSCRATCH is
+	 * clobbered by an exception once we turn on MSR_RI below.
+	 */
+	ld	r11, PACATMSCRATCH(r13)
+	std	r11, GPR1(r1)
+
+	/*
+	 * Store r13 away so we can free up the scratch SPR for the SLB fault
+	 * handler (needed once we start accessing the thread_struct).
+	 */
+	GET_SCRATCH0(r11)
+	std	r11, GPR13(r1)
+
 	/* Reset MSR RI so we can take SLB faults again */
 	li	r11, MSR_RI
 	mtmsrd	r11, 1
 
+	/* Store the PPR in r11 and reset to decent value */
 	mfspr	r11, SPRN_PPR
 	HMT_MEDIUM
 
@@ -230,11 +244,11 @@ dont_backup_fp:
 	SAVE_GPR(8, r7)				/* user r8 */
 	SAVE_GPR(9, r7)				/* user r9 */
 	SAVE_GPR(10, r7)			/* user r10 */
-	ld	r3, PACATMSCRATCH(r13)		/* user r1 */
+	ld	r3, GPR1(r1)			/* user r1 */
 	ld	r4, GPR7(r1)			/* user r7 */
 	ld	r5, GPR11(r1)			/* user r11 */
 	ld	r6, GPR12(r1)			/* user r12 */
-	GET_SCRATCH0(8)				/* user r13 */
+	ld	r8, GPR13(r1)			/* user r13 */
 	std	r3, GPR1(r7)
 	std	r4, GPR7(r7)
 	std	r5, GPR11(r7)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/s390/kernel/kprobes.c linux-libre-3.18.125-gnu/arch/s390/kernel/kprobes.c
--- linux-libre-3.18.124-gnu/arch/s390/kernel/kprobes.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/s390/kernel/kprobes.c	2018-11-10 10:39:23.000000000 -0500
@@ -633,6 +633,15 @@ int __kprobes setjmp_pre_handler(struct
 	stack = (unsigned long) regs->gprs[15];
 
 	memcpy(kcb->jprobes_stack, (void *) stack, MIN_STACK_SIZE(stack));
+
+	/*
+	 * jprobes use jprobe_return() which skips the normal return
+	 * path of the function, and this messes up the accounting of the
+	 * function graph tracer to get messed up.
+	 *
+	 * Pause function graph tracing while performing the jprobe function.
+	 */
+	pause_graph_tracing();
 	return 1;
 }
 
@@ -646,6 +655,9 @@ int __kprobes longjmp_break_handler(stru
 	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
 	unsigned long stack;
 
+	/* It's OK to start function graph tracing again */
+	unpause_graph_tracing();
+
 	stack = (unsigned long) kcb->jprobe_saved_regs.gprs[15];
 
 	/* Put the regs back */
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/s390/kvm/gaccess.c linux-libre-3.18.125-gnu/arch/s390/kvm/gaccess.c
--- linux-libre-3.18.124-gnu/arch/s390/kvm/gaccess.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/s390/kvm/gaccess.c	2018-11-10 10:39:23.000000000 -0500
@@ -229,12 +229,10 @@ static void ipte_lock_simple(struct kvm_
 		goto out;
 	ic = &vcpu->kvm->arch.sca->ipte_control;
 	do {
-		old = *ic;
-		barrier();
+		old = READ_ONCE(*ic);
 		while (old.k) {
 			cond_resched();
-			old = *ic;
-			barrier();
+			old = READ_ONCE(*ic);
 		}
 		new = old;
 		new.k = 1;
@@ -253,8 +251,7 @@ static void ipte_unlock_simple(struct kv
 		goto out;
 	ic = &vcpu->kvm->arch.sca->ipte_control;
 	do {
-		old = *ic;
-		barrier();
+		old = READ_ONCE(*ic);
 		new = old;
 		new.k = 0;
 	} while (cmpxchg(&ic->val, old.val, new.val) != old.val);
@@ -269,12 +266,10 @@ static void ipte_lock_siif(struct kvm_vc
 
 	ic = &vcpu->kvm->arch.sca->ipte_control;
 	do {
-		old = *ic;
-		barrier();
+		old = READ_ONCE(*ic);
 		while (old.kg) {
 			cond_resched();
-			old = *ic;
-			barrier();
+			old = READ_ONCE(*ic);
 		}
 		new = old;
 		new.k = 1;
@@ -288,8 +283,7 @@ static void ipte_unlock_siif(struct kvm_
 
 	ic = &vcpu->kvm->arch.sca->ipte_control;
 	do {
-		old = *ic;
-		barrier();
+		old = READ_ONCE(*ic);
 		new = old;
 		new.kh--;
 		if (!new.kh)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/kernel/cpu/perf_event_intel_ds.c linux-libre-3.18.125-gnu/arch/x86/kernel/cpu/perf_event_intel_ds.c
--- linux-libre-3.18.124-gnu/arch/x86/kernel/cpu/perf_event_intel_ds.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/kernel/cpu/perf_event_intel_ds.c	2018-11-10 10:39:23.000000000 -0500
@@ -568,8 +568,8 @@ struct event_constraint intel_atom_pebs_
 };
 
 struct event_constraint intel_slm_pebs_event_constraints[] = {
-	/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
-	INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+	/* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
+	INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x1),
 	/* Allow all events as PEBS with no flags */
 	INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
 	EVENT_CONSTRAINT_END
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/kernel/cpu/perf_event_intel_rapl.c linux-libre-3.18.125-gnu/arch/x86/kernel/cpu/perf_event_intel_rapl.c
--- linux-libre-3.18.124-gnu/arch/x86/kernel/cpu/perf_event_intel_rapl.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/kernel/cpu/perf_event_intel_rapl.c	2018-11-10 10:39:23.000000000 -0500
@@ -103,6 +103,13 @@ static struct kobj_attribute format_attr
 
 #define RAPL_CNTR_WIDTH 32 /* 32-bit rapl counters */
 
+#define RAPL_EVENT_ATTR_STR(_name, v, str)				\
+static struct perf_pmu_events_attr event_attr_##v = {			\
+	.attr		= __ATTR(_name, 0444, rapl_sysfs_show, NULL),	\
+	.id		= 0,						\
+	.event_str	= str,						\
+};
+
 struct rapl_pmu {
 	spinlock_t	 lock;
 	int		 hw_unit;  /* 1/2^hw_unit Joule */
@@ -383,23 +390,36 @@ static struct attribute_group rapl_pmu_a
 	.attrs = rapl_pmu_attrs,
 };
 
-EVENT_ATTR_STR(energy-cores, rapl_cores, "event=0x01");
-EVENT_ATTR_STR(energy-pkg  ,   rapl_pkg, "event=0x02");
-EVENT_ATTR_STR(energy-ram  ,   rapl_ram, "event=0x03");
-EVENT_ATTR_STR(energy-gpu  ,   rapl_gpu, "event=0x04");
+static ssize_t rapl_sysfs_show(struct device *dev,
+			       struct device_attribute *attr,
+			       char *page)
+{
+	struct perf_pmu_events_attr *pmu_attr = \
+		container_of(attr, struct perf_pmu_events_attr, attr);
 
-EVENT_ATTR_STR(energy-cores.unit, rapl_cores_unit, "Joules");
-EVENT_ATTR_STR(energy-pkg.unit  ,   rapl_pkg_unit, "Joules");
-EVENT_ATTR_STR(energy-ram.unit  ,   rapl_ram_unit, "Joules");
-EVENT_ATTR_STR(energy-gpu.unit  ,   rapl_gpu_unit, "Joules");
+	if (pmu_attr->event_str)
+		return sprintf(page, "%s", pmu_attr->event_str);
+
+	return 0;
+}
+
+RAPL_EVENT_ATTR_STR(energy-cores, rapl_cores, "event=0x01");
+RAPL_EVENT_ATTR_STR(energy-pkg  ,   rapl_pkg, "event=0x02");
+RAPL_EVENT_ATTR_STR(energy-ram  ,   rapl_ram, "event=0x03");
+RAPL_EVENT_ATTR_STR(energy-gpu  ,   rapl_gpu, "event=0x04");
+
+RAPL_EVENT_ATTR_STR(energy-cores.unit, rapl_cores_unit, "Joules");
+RAPL_EVENT_ATTR_STR(energy-pkg.unit  ,   rapl_pkg_unit, "Joules");
+RAPL_EVENT_ATTR_STR(energy-ram.unit  ,   rapl_ram_unit, "Joules");
+RAPL_EVENT_ATTR_STR(energy-gpu.unit  ,   rapl_gpu_unit, "Joules");
 
 /*
  * we compute in 0.23 nJ increments regardless of MSR
  */
-EVENT_ATTR_STR(energy-cores.scale, rapl_cores_scale, "2.3283064365386962890625e-10");
-EVENT_ATTR_STR(energy-pkg.scale,     rapl_pkg_scale, "2.3283064365386962890625e-10");
-EVENT_ATTR_STR(energy-ram.scale,     rapl_ram_scale, "2.3283064365386962890625e-10");
-EVENT_ATTR_STR(energy-gpu.scale,     rapl_gpu_scale, "2.3283064365386962890625e-10");
+RAPL_EVENT_ATTR_STR(energy-cores.scale, rapl_cores_scale, "2.3283064365386962890625e-10");
+RAPL_EVENT_ATTR_STR(energy-pkg.scale,     rapl_pkg_scale, "2.3283064365386962890625e-10");
+RAPL_EVENT_ATTR_STR(energy-ram.scale,     rapl_ram_scale, "2.3283064365386962890625e-10");
+RAPL_EVENT_ATTR_STR(energy-gpu.scale,     rapl_gpu_scale, "2.3283064365386962890625e-10");
 
 static struct attribute *rapl_events_srv_attr[] = {
 	EVENT_PTR(rapl_cores),
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/kernel/irq.c linux-libre-3.18.125-gnu/arch/x86/kernel/irq.c
--- linux-libre-3.18.124-gnu/arch/x86/kernel/irq.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/kernel/irq.c	2018-11-10 10:39:23.000000000 -0500
@@ -302,6 +302,9 @@ int check_irq_vectors_for_cpu_disable(vo
 		irq = __this_cpu_read(vector_irq[vector]);
 		if (irq >= 0) {
 			desc = irq_to_desc(irq);
+			if (!desc)
+				continue;
+
 			data = irq_desc_get_irq_data(desc);
 			cpumask_copy(&affinity_new, data->affinity);
 			cpu_clear(this_cpu, affinity_new);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/kernel/ldt.c linux-libre-3.18.125-gnu/arch/x86/kernel/ldt.c
--- linux-libre-3.18.124-gnu/arch/x86/kernel/ldt.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/kernel/ldt.c	2018-11-10 10:39:23.000000000 -0500
@@ -58,7 +58,7 @@ static struct ldt_struct *alloc_ldt_stru
 	if (alloc_size > PAGE_SIZE)
 		new_ldt->entries = vzalloc(alloc_size);
 	else
-		new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL);
+		new_ldt->entries = (void *)get_zeroed_page(GFP_KERNEL);
 
 	if (!new_ldt->entries) {
 		kfree(new_ldt);
@@ -95,7 +95,7 @@ static void free_ldt_struct(struct ldt_s
 	if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE)
 		vfree(ldt->entries);
 	else
-		kfree(ldt->entries);
+		free_page((unsigned long)ldt->entries);
 	kfree(ldt);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/kernel/process.c linux-libre-3.18.125-gnu/arch/x86/kernel/process.c
--- linux-libre-3.18.124-gnu/arch/x86/kernel/process.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/kernel/process.c	2018-11-10 10:39:23.000000000 -0500
@@ -430,6 +430,7 @@ static int prefer_mwait_c1_over_halt(con
 static void mwait_idle(void)
 {
 	if (!current_set_polling_and_test()) {
+		trace_cpu_idle_rcuidle(1, smp_processor_id());
 		if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) {
 			smp_mb(); /* quirk */
 			clflush((void *)&current_thread_info()->flags);
@@ -441,6 +442,7 @@ static void mwait_idle(void)
 			__sti_mwait(0, 0);
 		else
 			local_irq_enable();
+		trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
 	} else {
 		local_irq_enable();
 	}
diff -druNp --no-dereference linux-libre-3.18.124-gnu/arch/x86/pci/fixup.c linux-libre-3.18.125-gnu/arch/x86/pci/fixup.c
--- linux-libre-3.18.124-gnu/arch/x86/pci/fixup.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/arch/x86/pci/fixup.c	2018-11-10 10:39:23.000000000 -0500
@@ -554,9 +554,16 @@ static void twinhead_reserve_killing_zon
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x27B9, twinhead_reserve_killing_zone);
 
+/*
+ * Broadwell EP Home Agent BARs erroneously return non-zero values when read.
+ *
+ * See http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
+ * entry BDF2.
+ */
 static void pci_bdwep_bar(struct pci_dev *dev)
 {
 	dev->non_compliant_bars = 1;
 }
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6f60, pci_bdwep_bar);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fa0, pci_bdwep_bar);
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x6fc0, pci_bdwep_bar);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/ata/ahci_xgene.c linux-libre-3.18.125-gnu/drivers/ata/ahci_xgene.c
--- linux-libre-3.18.124-gnu/drivers/ata/ahci_xgene.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/ata/ahci_xgene.c	2018-11-10 10:39:23.000000000 -0500
@@ -125,10 +125,11 @@ static int xgene_ahci_restart_engine(str
  * xgene_ahci_qc_issue - Issue commands to the device
  * @qc: Command to issue
  *
- * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot
- * clear the BSY bit after receiving the PIO setup FIS. This results in the dma
- * state machine goes into the CMFatalErrorUpdate state and locks up. By
- * restarting the dma engine, it removes the controller out of lock up state.
+ * Due to Hardware errata for IDENTIFY DEVICE command and PACKET
+ * command of ATAPI protocol set, the controller cannot clear the BSY bit
+ * after receiving the PIO setup FIS. This results in the DMA state machine
+ * going into the CMFatalErrorUpdate state and locks up. By restarting the
+ * DMA engine, it removes the controller out of lock up state.
  */
 static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
 {
@@ -137,7 +138,8 @@ static unsigned int xgene_ahci_qc_issue(
 	struct xgene_ahci_context *ctx = hpriv->plat_data;
 	int rc = 0;
 
-	if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA))
+	if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) ||
+	    (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET)))
 		xgene_ahci_restart_engine(ap);
 
 	rc = ahci_qc_issue(qc);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/ata/libata-core.c linux-libre-3.18.125-gnu/drivers/ata/libata-core.c
--- linux-libre-3.18.124-gnu/drivers/ata/libata-core.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/ata/libata-core.c	2018-11-10 10:39:23.000000000 -0500
@@ -4249,6 +4249,8 @@ static const struct ata_blacklist_entry
 						ATA_HORKAGE_NOLPM, },
 
 	/* devices that don't properly handle queued TRIM commands */
+	{ "Micron_M500IT_*",		"MU01",	ATA_HORKAGE_NO_NCQ_TRIM |
+						ATA_HORKAGE_ZERO_AFTER_TRIM, },
 	{ "Micron_M500_*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
 						ATA_HORKAGE_ZERO_AFTER_TRIM, },
 	{ "Crucial_CT*M500*",		NULL,	ATA_HORKAGE_NO_NCQ_TRIM |
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/bus/arm-cci.c linux-libre-3.18.125-gnu/drivers/bus/arm-cci.c
--- linux-libre-3.18.124-gnu/drivers/bus/arm-cci.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/bus/arm-cci.c	2018-11-10 10:39:23.000000000 -0500
@@ -976,6 +976,9 @@ static int cci_probe(void)
 	if (!np)
 		return -ENODEV;
 
+	if (!of_device_is_available(np))
+		return -ENODEV;
+
 	cci_config = of_match_node(arm_cci_matches, np)->data;
 	if (!cci_config)
 		return -ENODEV;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/clk/rockchip/clk-cpu.c linux-libre-3.18.125-gnu/drivers/clk/rockchip/clk-cpu.c
--- linux-libre-3.18.124-gnu/drivers/clk/rockchip/clk-cpu.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/clk/rockchip/clk-cpu.c	2018-11-10 10:39:23.000000000 -0500
@@ -124,10 +124,11 @@ static int rockchip_cpuclk_pre_rate_chan
 {
 	const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data;
 	unsigned long alt_prate, alt_div;
+	unsigned long flags;
 
 	alt_prate = clk_get_rate(cpuclk->alt_parent);
 
-	spin_lock(cpuclk->lock);
+	spin_lock_irqsave(cpuclk->lock, flags);
 
 	/*
 	 * If the old parent clock speed is less than the clock speed
@@ -164,7 +165,7 @@ static int rockchip_cpuclk_pre_rate_chan
 			cpuclk->reg_base + reg_data->core_reg);
 	}
 
-	spin_unlock(cpuclk->lock);
+	spin_unlock_irqrestore(cpuclk->lock, flags);
 	return 0;
 }
 
@@ -173,6 +174,7 @@ static int rockchip_cpuclk_post_rate_cha
 {
 	const struct rockchip_cpuclk_reg_data *reg_data = cpuclk->reg_data;
 	const struct rockchip_cpuclk_rate_table *rate;
+	unsigned long flags;
 
 	rate = rockchip_get_cpuclk_settings(cpuclk, ndata->new_rate);
 	if (!rate) {
@@ -181,7 +183,7 @@ static int rockchip_cpuclk_post_rate_cha
 		return -EINVAL;
 	}
 
-	spin_lock(cpuclk->lock);
+	spin_lock_irqsave(cpuclk->lock, flags);
 
 	if (ndata->old_rate < ndata->new_rate)
 		rockchip_cpuclk_set_dividers(cpuclk, rate);
@@ -201,7 +203,7 @@ static int rockchip_cpuclk_post_rate_cha
 	if (ndata->old_rate > ndata->new_rate)
 		rockchip_cpuclk_set_dividers(cpuclk, rate);
 
-	spin_unlock(cpuclk->lock);
+	spin_unlock_irqrestore(cpuclk->lock, flags);
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/gpu/drm/i915/i915_gem.c linux-libre-3.18.125-gnu/drivers/gpu/drm/i915/i915_gem.c
--- linux-libre-3.18.124-gnu/drivers/gpu/drm/i915/i915_gem.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/gpu/drm/i915/i915_gem.c	2018-11-10 10:39:23.000000000 -0500
@@ -5144,7 +5144,7 @@ static bool mutex_is_locked_by(struct mu
 	if (!mutex_is_locked(mutex))
 		return false;
 
-#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES)
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)
 	return mutex->owner == task;
 #else
 	/* Since UP may be pre-empted, we cannot assume that we own the lock */
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/i2c/busses/i2c-scmi.c linux-libre-3.18.125-gnu/drivers/i2c/busses/i2c-scmi.c
--- linux-libre-3.18.124-gnu/drivers/i2c/busses/i2c-scmi.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/i2c/busses/i2c-scmi.c	2018-11-10 10:39:23.000000000 -0500
@@ -152,6 +152,7 @@ acpi_smbus_cmi_access(struct i2c_adapter
 			mt_params[3].type = ACPI_TYPE_INTEGER;
 			mt_params[3].integer.value = len;
 			mt_params[4].type = ACPI_TYPE_BUFFER;
+			mt_params[4].buffer.length = len;
 			mt_params[4].buffer.pointer = data->block + 1;
 		}
 		break;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/iio/inkern.c linux-libre-3.18.125-gnu/drivers/iio/inkern.c
--- linux-libre-3.18.124-gnu/drivers/iio/inkern.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/iio/inkern.c	2018-11-10 10:39:23.000000000 -0500
@@ -426,6 +426,9 @@ static int iio_channel_read(struct iio_c
 	if (val2 == NULL)
 		val2 = &unused;
 
+	if(!iio_channel_has_info(chan->channel, info))
+		return -EINVAL;
+
 	if (chan->indio_dev->info->read_raw_multi) {
 		ret = chan->indio_dev->info->read_raw_multi(chan->indio_dev,
 					chan->channel, INDIO_MAX_RAW_ELEMENTS,
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/iommu/intel-iommu.c linux-libre-3.18.125-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-3.18.124-gnu/drivers/iommu/intel-iommu.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/iommu/intel-iommu.c	2018-11-10 10:39:23.000000000 -0500
@@ -1759,8 +1759,9 @@ static int domain_init(struct dmar_domai
 
 static void domain_exit(struct dmar_domain *domain)
 {
+	struct dmar_drhd_unit *drhd;
+	struct intel_iommu *iommu;
 	struct page *freelist = NULL;
-	int i;
 
 	/* Domain 0 is reserved, so dont process it */
 	if (!domain)
@@ -1780,8 +1781,10 @@ static void domain_exit(struct dmar_doma
 
 	/* clear attached or cached domains */
 	rcu_read_lock();
-	for_each_set_bit(i, domain->iommu_bmp, g_num_of_iommus)
-		iommu_detach_domain(domain, g_iommus[i]);
+	for_each_active_iommu(iommu, drhd)
+		if (domain_type_is_vm(domain) ||
+		    test_bit(iommu->seq_id, domain->iommu_bmp))
+			iommu_detach_domain(domain, iommu);
 	rcu_read_unlock();
 
 	dma_free_pagelist(freelist);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/mcb/mcb-internal.h linux-libre-3.18.125-gnu/drivers/mcb/mcb-internal.h
--- linux-libre-3.18.124-gnu/drivers/mcb/mcb-internal.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/mcb/mcb-internal.h	2018-11-10 10:39:23.000000000 -0500
@@ -7,6 +7,7 @@
 #define PCI_DEVICE_ID_MEN_CHAMELEON	0x4d45
 #define CHAMELEON_FILENAME_LEN		12
 #define CHAMELEONV2_MAGIC		0xabce
+#define CHAM_HEADER_SIZE		0x200
 
 enum chameleon_descriptor_type {
 	CHAMELEON_DTYPE_GENERAL = 0x0,
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/mcb/mcb-pci.c linux-libre-3.18.125-gnu/drivers/mcb/mcb-pci.c
--- linux-libre-3.18.124-gnu/drivers/mcb/mcb-pci.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/mcb/mcb-pci.c	2018-11-10 10:39:23.000000000 -0500
@@ -17,6 +17,7 @@
 
 struct priv {
 	struct mcb_bus *bus;
+	phys_addr_t mapbase;
 	void __iomem *base;
 };
 
@@ -31,8 +32,8 @@ static int mcb_pci_get_irq(struct mcb_de
 
 static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
+	struct resource *res;
 	struct priv *priv;
-	phys_addr_t mapbase;
 	int ret;
 	int num_cells;
 	unsigned long flags;
@@ -47,19 +48,21 @@ static int mcb_pci_probe(struct pci_dev
 		return -ENODEV;
 	}
 
-	mapbase = pci_resource_start(pdev, 0);
-	if (!mapbase) {
+	priv->mapbase = pci_resource_start(pdev, 0);
+	if (!priv->mapbase) {
 		dev_err(&pdev->dev, "No PCI resource\n");
 		goto err_start;
 	}
 
-	ret = pci_request_region(pdev, 0, KBUILD_MODNAME);
-	if (ret) {
-		dev_err(&pdev->dev, "Failed to request PCI BARs\n");
+	res = request_mem_region(priv->mapbase, CHAM_HEADER_SIZE,
+				 KBUILD_MODNAME);
+	if (IS_ERR(res)) {
+		dev_err(&pdev->dev, "Failed to request PCI memory\n");
+		ret = PTR_ERR(res);
 		goto err_start;
 	}
 
-	priv->base = pci_iomap(pdev, 0, 0);
+	priv->base = ioremap(priv->mapbase, CHAM_HEADER_SIZE);
 	if (!priv->base) {
 		dev_err(&pdev->dev, "Cannot ioremap\n");
 		ret = -ENOMEM;
@@ -84,7 +87,7 @@ static int mcb_pci_probe(struct pci_dev
 
 	priv->bus->get_irq = mcb_pci_get_irq;
 
-	ret = chameleon_parse_cells(priv->bus, mapbase, priv->base);
+	ret = chameleon_parse_cells(priv->bus, priv->mapbase, priv->base);
 	if (ret < 0)
 		goto err_drvdata;
 	num_cells = ret;
@@ -93,8 +96,10 @@ static int mcb_pci_probe(struct pci_dev
 
 	mcb_bus_add_devices(priv->bus);
 
+	return 0;
+
 err_drvdata:
-	pci_iounmap(pdev, priv->base);
+	iounmap(priv->base);
 err_ioremap:
 	pci_release_region(pdev, 0);
 err_start:
@@ -107,6 +112,10 @@ static void mcb_pci_remove(struct pci_de
 	struct priv *priv = pci_get_drvdata(pdev);
 
 	mcb_release_bus(priv->bus);
+
+	iounmap(priv->base);
+	release_region(priv->mapbase, CHAM_HEADER_SIZE);
+	pci_disable_device(pdev);
 }
 
 static const struct pci_device_id mcb_pci_tbl[] = {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/md/dm.c linux-libre-3.18.125-gnu/drivers/md/dm.c
--- linux-libre-3.18.124-gnu/drivers/md/dm.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/md/dm.c	2018-11-10 10:39:23.000000000 -0500
@@ -2599,14 +2599,14 @@ static void __dm_destroy(struct mapped_d
 	 * do not race with internal suspend.
 	 */
 	mutex_lock(&md->suspend_lock);
+	map = dm_get_live_table(md, &srcu_idx);
 	if (!dm_suspended_md(md)) {
 		dm_table_presuspend_targets(map);
 		dm_table_postsuspend_targets(map);
 	}
-	mutex_unlock(&md->suspend_lock);
-
 	/* dm_put_live_table must be before msleep, otherwise deadlock is possible */
 	dm_put_live_table(md, srcu_idx);
+	mutex_unlock(&md->suspend_lock);
 
 	/*
 	 * Rare, but there may be I/O requests still going to complete,
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/md/dm-thin.c linux-libre-3.18.125-gnu/drivers/md/dm-thin.c
--- linux-libre-3.18.124-gnu/drivers/md/dm-thin.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/md/dm-thin.c	2018-11-10 10:39:23.000000000 -0500
@@ -1909,6 +1909,7 @@ static void set_pool_mode(struct pool *p
 	case PM_WRITE:
 		if (old_mode != new_mode)
 			notify_of_pool_mode_change(pool, "write");
+		pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space;
 		dm_pool_metadata_read_write(pool->pmd);
 		pool->process_bio = process_bio;
 		pool->process_discard = process_discard;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/media/usb/dvb-usb-v2/af9035.c linux-libre-3.18.125-gnu/drivers/media/usb/dvb-usb-v2/af9035.c
--- linux-libre-3.18.124-gnu/drivers/media/usb/dvb-usb-v2/af9035.c	2018-10-13 21:44:50.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/media/usb/dvb-usb-v2/af9035.c	2018-11-10 15:39:23.000000000 -0500
@@ -389,8 +389,10 @@ static int af9035_i2c_master_xfer(struct
 			    msg[0].addr == (state->af9033_i2c_addr[1] >> 1))
 				reg |= 0x100000;
 
-			ret = af9035_wr_regs(d, reg, &msg[0].buf[3],
-					msg[0].len - 3);
+			ret = (msg[0].len >= 3) ? af9035_wr_regs(d, reg,
+							         &msg[0].buf[3],
+							         msg[0].len - 3)
+					        : -EOPNOTSUPP;
 		} else {
 			/* I2C write */
 			u8 buf[MAX_XFER_SIZE];
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/mfd/omap-usb-host.c linux-libre-3.18.125-gnu/drivers/mfd/omap-usb-host.c
--- linux-libre-3.18.124-gnu/drivers/mfd/omap-usb-host.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/mfd/omap-usb-host.c	2018-11-10 10:39:23.000000000 -0500
@@ -558,8 +558,8 @@ static int usbhs_omap_get_dt_pdata(struc
 }
 
 static const struct of_device_id usbhs_child_match_table[] = {
-	{ .compatible = "ti,omap-ehci", },
-	{ .compatible = "ti,omap-ohci", },
+	{ .compatible = "ti,ehci-omap", },
+	{ .compatible = "ti,ohci-omap3", },
 	{ }
 };
 
@@ -886,6 +886,7 @@ static struct platform_driver usbhs_omap
 		.pm		= &usbhsomap_dev_pm_ops,
 		.of_match_table = usbhs_omap_dt_ids,
 	},
+	.probe		= usbhs_omap_probe,
 	.remove		= usbhs_omap_remove,
 };
 
@@ -895,9 +896,9 @@ MODULE_ALIAS("platform:" USBHS_DRIVER_NA
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("usb host common core driver for omap EHCI and OHCI");
 
-static int __init omap_usbhs_drvinit(void)
+static int omap_usbhs_drvinit(void)
 {
-	return platform_driver_probe(&usbhs_omap_driver, usbhs_omap_probe);
+	return platform_driver_register(&usbhs_omap_driver);
 }
 
 /*
@@ -909,7 +910,7 @@ static int __init omap_usbhs_drvinit(voi
  */
 fs_initcall_sync(omap_usbhs_drvinit);
 
-static void __exit omap_usbhs_drvexit(void)
+static void omap_usbhs_drvexit(void)
 {
 	platform_driver_unregister(&usbhs_omap_driver);
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/misc/cxl/context.c linux-libre-3.18.125-gnu/drivers/misc/cxl/context.c
--- linux-libre-3.18.124-gnu/drivers/misc/cxl/context.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/misc/cxl/context.c	2018-11-10 10:39:23.000000000 -0500
@@ -100,6 +100,46 @@ int cxl_context_init(struct cxl_context
 	return 0;
 }
 
+static int cxl_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+	struct cxl_context *ctx = vma->vm_file->private_data;
+	unsigned long address = (unsigned long)vmf->virtual_address;
+	u64 area, offset;
+
+	offset = vmf->pgoff << PAGE_SHIFT;
+
+	pr_devel("%s: pe: %i address: 0x%lx offset: 0x%llx\n",
+			__func__, ctx->pe, address, offset);
+
+	if (ctx->afu->current_mode == CXL_MODE_DEDICATED) {
+		area = ctx->afu->psn_phys;
+		if (offset > ctx->afu->adapter->ps_size)
+			return VM_FAULT_SIGBUS;
+	} else {
+		area = ctx->psn_phys;
+		if (offset > ctx->psn_size)
+			return VM_FAULT_SIGBUS;
+	}
+
+	mutex_lock(&ctx->status_mutex);
+
+	if (ctx->status != STARTED) {
+		mutex_unlock(&ctx->status_mutex);
+		pr_devel("%s: Context not started, failing problem state access\n", __func__);
+		return VM_FAULT_SIGBUS;
+	}
+
+	vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
+
+	mutex_unlock(&ctx->status_mutex);
+
+	return VM_FAULT_NOPAGE;
+}
+
+static const struct vm_operations_struct cxl_mmap_vmops = {
+	.fault = cxl_mmap_fault,
+};
+
 /*
  * Map a per-context mmio space into the given vma.
  */
@@ -108,26 +148,25 @@ int cxl_context_iomap(struct cxl_context
 	u64 len = vma->vm_end - vma->vm_start;
 	len = min(len, ctx->psn_size);
 
-	if (ctx->afu->current_mode == CXL_MODE_DEDICATED) {
-		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-		return vm_iomap_memory(vma, ctx->afu->psn_phys, ctx->afu->adapter->ps_size);
-	}
+	if (ctx->afu->current_mode != CXL_MODE_DEDICATED) {
+		/* make sure there is a valid per process space for this AFU */
+		if ((ctx->master && !ctx->afu->psa) || (!ctx->afu->pp_psa)) {
+			pr_devel("AFU doesn't support mmio space\n");
+			return -EINVAL;
+		}
 
-	/* make sure there is a valid per process space for this AFU */
-	if ((ctx->master && !ctx->afu->psa) || (!ctx->afu->pp_psa)) {
-		pr_devel("AFU doesn't support mmio space\n");
-		return -EINVAL;
+		/* Can't mmap until the AFU is enabled */
+		if (!ctx->afu->enabled)
+			return -EBUSY;
 	}
 
-	/* Can't mmap until the AFU is enabled */
-	if (!ctx->afu->enabled)
-		return -EBUSY;
-
 	pr_devel("%s: mmio physical: %llx pe: %i master:%i\n", __func__,
 		 ctx->psn_phys, ctx->pe , ctx->master);
 
+	vma->vm_flags |= VM_IO | VM_PFNMAP;
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-	return vm_iomap_memory(vma, ctx->psn_phys, len);
+	vma->vm_ops = &cxl_mmap_vmops;
+	return 0;
 }
 
 /*
@@ -150,12 +189,6 @@ static void __detach_context(struct cxl_
 	afu_release_irqs(ctx);
 	flush_work(&ctx->fault_work); /* Only needed for dedicated process */
 	wake_up_all(&ctx->wq);
-
-	/* Release Problem State Area mapping */
-	mutex_lock(&ctx->mapping_lock);
-	if (ctx->mapping)
-		unmap_mapping_range(ctx->mapping, 0, 0, 1);
-	mutex_unlock(&ctx->mapping_lock);
 }
 
 /*
@@ -184,6 +217,17 @@ void cxl_context_detach_all(struct cxl_a
 		 * created and torn down after the IDR removed
 		 */
 		__detach_context(ctx);
+
+		/*
+		 * We are force detaching - remove any active PSA mappings so
+		 * userspace cannot interfere with the card if it comes back.
+		 * Easiest way to exercise this is to unbind and rebind the
+		 * driver via sysfs while it is in use.
+		 */
+		mutex_lock(&ctx->mapping_lock);
+		if (ctx->mapping)
+			unmap_mapping_range(ctx->mapping, 0, 0, 1);
+		mutex_unlock(&ctx->mapping_lock);
 	}
 	mutex_unlock(&afu->contexts_lock);
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/misc/cxl/file.c linux-libre-3.18.125-gnu/drivers/misc/cxl/file.c
--- linux-libre-3.18.124-gnu/drivers/misc/cxl/file.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/misc/cxl/file.c	2018-11-10 10:39:23.000000000 -0500
@@ -140,18 +140,20 @@ static long afu_ioctl_start_work(struct
 
 	pr_devel("%s: pe: %i\n", __func__, ctx->pe);
 
-	mutex_lock(&ctx->status_mutex);
-	if (ctx->status != OPENED) {
-		rc = -EIO;
-		goto out;
-	}
-
+	/* Do this outside the status_mutex to avoid a circular dependency with
+	 * the locking in cxl_mmap_fault() */
 	if (copy_from_user(&work, uwork,
 			   sizeof(struct cxl_ioctl_start_work))) {
 		rc = -EFAULT;
 		goto out;
 	}
 
+	mutex_lock(&ctx->status_mutex);
+	if (ctx->status != OPENED) {
+		rc = -EIO;
+		goto out;
+	}
+
 	/*
 	 * if any of the reserved fields are set or any of the unused
 	 * flags are set it's invalid
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/mmc/host/sdhci.c linux-libre-3.18.125-gnu/drivers/mmc/host/sdhci.c
--- linux-libre-3.18.124-gnu/drivers/mmc/host/sdhci.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/mmc/host/sdhci.c	2018-11-10 10:39:23.000000000 -0500
@@ -1248,19 +1248,6 @@ static void sdhci_set_power(struct sdhci
 	struct mmc_host *mmc = host->mmc;
 	u8 pwr = 0;
 
-	if (!IS_ERR(mmc->supply.vmmc)) {
-		spin_unlock_irq(&host->lock);
-		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
-		spin_lock_irq(&host->lock);
-
-		if (mode != MMC_POWER_OFF)
-			sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
-		else
-			sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
-
-		return;
-	}
-
 	if (mode != MMC_POWER_OFF) {
 		switch (1 << vdd) {
 		case MMC_VDD_165_195:
@@ -1319,6 +1306,12 @@ static void sdhci_set_power(struct sdhci
 		if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
 			mdelay(10);
 	}
+
+	if (!IS_ERR(mmc->supply.vmmc)) {
+		spin_unlock_irq(&host->lock);
+		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+		spin_lock_irq(&host->lock);
+	}
 }
 
 /*****************************************************************************\
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/mtd/mtd_blkdevs.c linux-libre-3.18.125-gnu/drivers/mtd/mtd_blkdevs.c
--- linux-libre-3.18.124-gnu/drivers/mtd/mtd_blkdevs.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/mtd/mtd_blkdevs.c	2018-11-10 10:39:23.000000000 -0500
@@ -195,8 +195,8 @@ static int blktrans_open(struct block_de
 	if (!dev)
 		return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
 
-	mutex_lock(&dev->lock);
 	mutex_lock(&mtd_table_mutex);
+	mutex_lock(&dev->lock);
 
 	if (dev->open)
 		goto unlock;
@@ -220,8 +220,8 @@ static int blktrans_open(struct block_de
 
 unlock:
 	dev->open++;
-	mutex_unlock(&mtd_table_mutex);
 	mutex_unlock(&dev->lock);
+	mutex_unlock(&mtd_table_mutex);
 	blktrans_dev_put(dev);
 	return ret;
 
@@ -231,8 +231,8 @@ error_release:
 error_put:
 	module_put(dev->tr->owner);
 	kref_put(&dev->ref, blktrans_dev_release);
-	mutex_unlock(&mtd_table_mutex);
 	mutex_unlock(&dev->lock);
+	mutex_unlock(&mtd_table_mutex);
 	blktrans_dev_put(dev);
 	return ret;
 }
@@ -244,8 +244,8 @@ static void blktrans_release(struct gend
 	if (!dev)
 		return;
 
-	mutex_lock(&dev->lock);
 	mutex_lock(&mtd_table_mutex);
+	mutex_lock(&dev->lock);
 
 	if (--dev->open)
 		goto unlock;
@@ -259,8 +259,8 @@ static void blktrans_release(struct gend
 		__put_mtd_device(dev->mtd);
 	}
 unlock:
-	mutex_unlock(&mtd_table_mutex);
 	mutex_unlock(&dev->lock);
+	mutex_unlock(&mtd_table_mutex);
 	blktrans_dev_put(dev);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/broadcom/bcmsysport.c linux-libre-3.18.125-gnu/drivers/net/ethernet/broadcom/bcmsysport.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/broadcom/bcmsysport.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/broadcom/bcmsysport.c	2018-11-10 10:39:23.000000000 -0500
@@ -769,14 +769,22 @@ static void bcm_sysport_resume_from_wol(
 {
 	u32 reg;
 
-	/* Stop monitoring MPD interrupt */
-	intrl2_0_mask_set(priv, INTRL2_0_MPD);
-
 	/* Clear the MagicPacket detection logic */
 	reg = umac_readl(priv, UMAC_MPD_CTRL);
 	reg &= ~MPD_EN;
 	umac_writel(priv, reg, UMAC_MPD_CTRL);
 
+	reg = intrl2_0_readl(priv, INTRL2_CPU_STATUS);
+	if (reg & INTRL2_0_MPD)
+		netdev_info(priv->netdev, "Wake-on-LAN (MPD) interrupt!\n");
+
+	if (reg & INTRL2_0_BRCM_MATCH_TAG) {
+		reg = rxchk_readl(priv, RXCHK_BRCM_TAG_MATCH_STATUS) &
+				  RXCHK_BRCM_TAG_MATCH_MASK;
+		netdev_info(priv->netdev,
+			    "Wake-on-LAN (filters 0x%02x) interrupt!\n", reg);
+	}
+
 	netif_dbg(priv, wol, priv->netdev, "resumed from WOL\n");
 }
 
@@ -809,11 +817,6 @@ static irqreturn_t bcm_sysport_rx_isr(in
 	if (priv->irq0_stat & INTRL2_0_TX_RING_FULL)
 		bcm_sysport_tx_reclaim_all(priv);
 
-	if (priv->irq0_stat & INTRL2_0_MPD) {
-		netdev_info(priv->netdev, "Wake-on-LAN interrupt!\n");
-		bcm_sysport_resume_from_wol(priv);
-	}
-
 	return IRQ_HANDLED;
 }
 
@@ -1786,9 +1789,6 @@ static int bcm_sysport_suspend_to_wol(st
 	/* UniMAC receive needs to be turned on */
 	umac_enable_set(priv, CMD_RX_EN, 1);
 
-	/* Enable the interrupt wake-up source */
-	intrl2_0_mask_clear(priv, INTRL2_0_MPD);
-
 	netif_dbg(priv, wol, ndev, "entered WOL mode\n");
 
 	return 0;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c linux-libre-3.18.125-gnu/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c	2018-10-13 21:49:19.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c	2018-11-10 15:45:53.000000000 -0500
@@ -2139,6 +2139,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EPERM;
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
+		if (t.cmd != CHELSIO_SET_QSET_PARAMS)
+			return -EINVAL;
 		if (t.qset_idx >= SGE_QSETS)
 			return -EINVAL;
 		if (!in_range(t.intr_lat, 0, M_NEWTIMER) ||
@@ -2238,6 +2240,9 @@ static int cxgb_extension_ioctl(struct n
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
 
+		if (t.cmd != CHELSIO_GET_QSET_PARAMS)
+			return -EINVAL;
+
 		/* Display qsets for all ports when offload enabled */
 		if (test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) {
 			q1 = 0;
@@ -2282,6 +2287,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EBUSY;
 		if (copy_from_user(&edata, useraddr, sizeof(edata)))
 			return -EFAULT;
+		if (edata.cmd != CHELSIO_SET_QSET_NUM)
+			return -EINVAL;
 		if (edata.val < 1 ||
 			(edata.val > 1 && !(adapter->flags & USING_MSIX)))
 			return -EINVAL;
@@ -2322,6 +2329,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EPERM;
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
+		if (t.cmd != CHELSIO_LOAD_FW)
+			return -EINVAL;
 		/* Check t.len sanity ? */
 		fw_data = memdup_user(useraddr + sizeof(t), t.len);
 		if (IS_ERR(fw_data))
@@ -2345,6 +2354,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EBUSY;
 		if (copy_from_user(&m, useraddr, sizeof(m)))
 			return -EFAULT;
+		if (m.cmd != CHELSIO_SETMTUTAB)
+			return -EINVAL;
 		if (m.nmtus != NMTUS)
 			return -EINVAL;
 		if (m.mtus[0] < 81)	/* accommodate SACK */
@@ -2386,6 +2397,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EBUSY;
 		if (copy_from_user(&m, useraddr, sizeof(m)))
 			return -EFAULT;
+		if (m.cmd != CHELSIO_SET_PM)
+			return -EINVAL;
 		if (!is_power_of_2(m.rx_pg_sz) ||
 			!is_power_of_2(m.tx_pg_sz))
 			return -EINVAL;	/* not power of 2 */
@@ -2419,6 +2432,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EIO;	/* need the memory controllers */
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
+		if (t.cmd != CHELSIO_GET_MEM)
+			return -EINVAL;
 		if ((t.addr & 7) || (t.len & 7))
 			return -EINVAL;
 		if (t.mem_id == MEM_CM)
@@ -2471,6 +2486,8 @@ static int cxgb_extension_ioctl(struct n
 			return -EAGAIN;
 		if (copy_from_user(&t, useraddr, sizeof(t)))
 			return -EFAULT;
+		if (t.cmd != CHELSIO_SET_TRACE_FILTER)
+			return -EINVAL;
 
 		tp = (const struct trace_params *)&t.sip;
 		if (t.config_tx)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/davicom/dm9000.c linux-libre-3.18.125-gnu/drivers/net/ethernet/davicom/dm9000.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/davicom/dm9000.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/davicom/dm9000.c	2018-11-10 10:39:23.000000000 -0500
@@ -125,7 +125,6 @@ struct board_info {
 	struct resource *data_res;
 	struct resource	*addr_req;   /* resources requested */
 	struct resource *data_req;
-	struct resource *irq_res;
 
 	int		 irq_wake;
 
@@ -1297,21 +1296,18 @@ static int
 dm9000_open(struct net_device *dev)
 {
 	struct board_info *db = netdev_priv(dev);
-	unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;
+	unsigned int irq_flags = irq_get_trigger_type(dev->irq);
 
 	if (netif_msg_ifup(db))
 		dev_dbg(db->dev, "enabling %s\n", dev->name);
 
-	/* If there is no IRQ type specified, default to something that
-	 * may work, and tell the user that this is a problem */
-
-	if (irqflags == IRQF_TRIGGER_NONE)
-		irqflags = irq_get_trigger_type(dev->irq);
-
-	if (irqflags == IRQF_TRIGGER_NONE)
+	/* If there is no IRQ type specified, tell the user that this is a
+	 * problem
+	 */
+	if (irq_flags == IRQF_TRIGGER_NONE)
 		dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n");
 
-	irqflags |= IRQF_SHARED;
+	irq_flags |= IRQF_SHARED;
 
 	/* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */
 	iow(db, DM9000_GPR, 0);	/* REG_1F bit0 activate phyxcer */
@@ -1320,7 +1316,7 @@ dm9000_open(struct net_device *dev)
 	/* Initialize DM9000 board */
 	dm9000_init_dm9000(dev);
 
-	if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev))
+	if (request_irq(dev->irq, dm9000_interrupt, irq_flags, dev->name, dev))
 		return -EAGAIN;
 	/* Now that we have an interrupt handler hooked up we can unmask
 	 * our interrupts
@@ -1460,15 +1456,22 @@ dm9000_probe(struct platform_device *pde
 
 	db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	db->irq_res  = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 
-	if (db->addr_res == NULL || db->data_res == NULL ||
-	    db->irq_res == NULL) {
-		dev_err(db->dev, "insufficient resources\n");
+	if (!db->addr_res || !db->data_res) {
+		dev_err(db->dev, "insufficient resources addr=%p data=%p\n",
+			db->addr_res, db->data_res);
 		ret = -ENOENT;
 		goto out;
 	}
 
+	ndev->irq = platform_get_irq(pdev, 0);
+	if (ndev->irq < 0) {
+		dev_err(db->dev, "interrupt resource unavailable: %d\n",
+			ndev->irq);
+		ret = ndev->irq;
+		goto out;
+	}
+
 	db->irq_wake = platform_get_irq(pdev, 1);
 	if (db->irq_wake >= 0) {
 		dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake);
@@ -1530,7 +1533,6 @@ dm9000_probe(struct platform_device *pde
 
 	/* fill in parameters for net-dev structure */
 	ndev->base_addr = (unsigned long)db->io_addr;
-	ndev->irq	= db->irq_res->start;
 
 	/* ensure at least we have a default set of IO routines */
 	dm9000_set_io(db, iosize);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/intel/igb/igb_main.c linux-libre-3.18.125-gnu/drivers/net/ethernet/intel/igb/igb_main.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/intel/igb/igb_main.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/intel/igb/igb_main.c	2018-11-10 10:39:23.000000000 -0500
@@ -2866,6 +2866,13 @@ static void igb_probe_vfs(struct igb_ada
 	if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
 		return;
 
+	/* Of the below we really only want the effect of getting
+	 * IGB_FLAG_HAS_MSIX set (if available), without which
+	 * igb_enable_sriov() has no effect.
+	 */
+	igb_set_interrupt_capability(adapter, true);
+	igb_reset_interrupt_capability(adapter);
+
 	pci_sriov_set_totalvfs(pdev, 7);
 	igb_enable_sriov(pdev, max_vfs);
 
@@ -2941,6 +2948,8 @@ void igb_set_flag_queue_pairs(struct igb
 		 */
 		if (adapter->rss_queues > (max_rss_queues / 2))
 			adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
+		else
+			adapter->flags &= ~IGB_FLAG_QUEUE_PAIRS;
 		break;
 	}
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/marvell/mvpp2.c linux-libre-3.18.125-gnu/drivers/net/ethernet/marvell/mvpp2.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/marvell/mvpp2.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/marvell/mvpp2.c	2018-11-10 10:39:23.000000000 -0500
@@ -27,6 +27,7 @@
 #include <linux/of_address.h>
 #include <linux/phy.h>
 #include <linux/clk.h>
+#include <linux/if_vlan.h>
 #include <uapi/linux/ppp_defs.h>
 #include <net/ip.h>
 #include <net/ipv6.h>
@@ -4246,7 +4247,7 @@ static void mvpp2_txq_desc_put(struct mv
 }
 
 /* Set Tx descriptors fields relevant for CSUM calculation */
-static u32 mvpp2_txq_desc_csum(int l3_offs, int l3_proto,
+static u32 mvpp2_txq_desc_csum(int l3_offs, __be16 l3_proto,
 			       int ip_hdr_len, int l4_proto)
 {
 	u32 command;
@@ -4957,14 +4958,15 @@ static u32 mvpp2_skb_tx_csum(struct mvpp
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		int ip_hdr_len = 0;
 		u8 l4_proto;
+		__be16 l3_proto = vlan_get_protocol(skb);
 
-		if (skb->protocol == htons(ETH_P_IP)) {
+		if (l3_proto == htons(ETH_P_IP)) {
 			struct iphdr *ip4h = ip_hdr(skb);
 
 			/* Calculate IPv4 checksum and L4 checksum */
 			ip_hdr_len = ip4h->ihl;
 			l4_proto = ip4h->protocol;
-		} else if (skb->protocol == htons(ETH_P_IPV6)) {
+		} else if (l3_proto == htons(ETH_P_IPV6)) {
 			struct ipv6hdr *ip6h = ipv6_hdr(skb);
 
 			/* Read l4_protocol from one of IPv6 extra headers */
@@ -4976,7 +4978,7 @@ static u32 mvpp2_skb_tx_csum(struct mvpp
 		}
 
 		return mvpp2_txq_desc_csum(skb_network_offset(skb),
-				skb->protocol, ip_hdr_len, l4_proto);
+					   l3_proto, ip_hdr_len, l4_proto);
 	}
 
 	return MVPP2_TXD_L4_CSUM_NOT | MVPP2_TXD_IP_CSUM_DISABLE;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c linux-libre-3.18.125-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/mellanox/mlx4/en_netdev.c	2018-11-10 10:39:23.000000000 -0500
@@ -2638,9 +2638,8 @@ int mlx4_en_init_netdev(struct mlx4_en_d
 	}
 	queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
 
-	if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
-		queue_delayed_work(mdev->workqueue, &priv->service_task,
-				   SERVICE_TASK_DELAY);
+	queue_delayed_work(mdev->workqueue, &priv->service_task,
+			   SERVICE_TASK_DELAY);
 
 	err = register_netdev(dev);
 	if (err) {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c	2018-11-10 10:39:23.000000000 -0500
@@ -2132,7 +2132,8 @@ out:
 }
 
 void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
-				  u16 vlan_id)
+				  u16 vlan_id,
+				  struct qlcnic_host_tx_ring *tx_ring)
 {
 	u8 mac[ETH_ALEN];
 	memcpy(&mac, addr, ETH_ALEN);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h	2018-10-13 21:49:52.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h	2018-11-10 15:46:35.000000000 -0500
@@ -549,7 +549,8 @@ int qlcnic_83xx_wrt_reg_indirect(struct
 int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32);
 int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int);
 int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int);
-void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *, u64 *, u16);
+void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
+				  u16 vlan, struct qlcnic_host_tx_ring *ring);
 int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info *);
 int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *);
 void qlcnic_83xx_initialize_nic(struct qlcnic_adapter *, int);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h	2018-10-13 21:49:49.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h	2018-11-10 15:46:32.000000000 -0500
@@ -1796,7 +1796,8 @@ struct qlcnic_hardware_ops {
 	int (*config_loopback) (struct qlcnic_adapter *, u8);
 	int (*clear_loopback) (struct qlcnic_adapter *, u8);
 	int (*config_promisc_mode) (struct qlcnic_adapter *, u32);
-	void (*change_l2_filter) (struct qlcnic_adapter *, u64 *, u16);
+	void (*change_l2_filter)(struct qlcnic_adapter *adapter, u64 *addr,
+				 u16 vlan, struct qlcnic_host_tx_ring *tx_ring);
 	int (*get_board_info) (struct qlcnic_adapter *);
 	void (*set_mac_filter_count) (struct qlcnic_adapter *);
 	void (*free_mac_list) (struct qlcnic_adapter *);
@@ -2038,9 +2039,10 @@ static inline int qlcnic_nic_set_promisc
 }
 
 static inline void qlcnic_change_filter(struct qlcnic_adapter *adapter,
-					u64 *addr, u16 id)
+					u64 *addr, u16 vlan,
+					struct qlcnic_host_tx_ring *tx_ring)
 {
-	adapter->ahw->hw_ops->change_l2_filter(adapter, addr, id);
+	adapter->ahw->hw_ops->change_l2_filter(adapter, addr, vlan, tx_ring);
 }
 
 static inline int qlcnic_get_board_info(struct qlcnic_adapter *adapter)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h	2018-11-10 10:39:23.000000000 -0500
@@ -172,7 +172,8 @@ int qlcnic_82xx_napi_add(struct qlcnic_a
 			 struct net_device *netdev);
 void qlcnic_82xx_get_beacon_state(struct qlcnic_adapter *);
 void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter,
-			       u64 *uaddr, u16 vlan_id);
+			       u64 *uaddr, u16 vlan_id,
+			       struct qlcnic_host_tx_ring *tx_ring);
 int qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *,
 				     struct ethtool_coalesce *);
 int qlcnic_82xx_set_rx_coalesce(struct qlcnic_adapter *);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c	2018-11-10 10:39:23.000000000 -0500
@@ -268,13 +268,12 @@ static void qlcnic_add_lb_filter(struct
 }
 
 void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter, u64 *uaddr,
-			       u16 vlan_id)
+			       u16 vlan_id, struct qlcnic_host_tx_ring *tx_ring)
 {
 	struct cmd_desc_type0 *hwdesc;
 	struct qlcnic_nic_req *req;
 	struct qlcnic_mac_req *mac_req;
 	struct qlcnic_vlan_req *vlan_req;
-	struct qlcnic_host_tx_ring *tx_ring = adapter->tx_ring;
 	u32 producer;
 	u64 word;
 
@@ -301,7 +300,8 @@ void qlcnic_82xx_change_filter(struct ql
 
 static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
 			       struct cmd_desc_type0 *first_desc,
-			       struct sk_buff *skb)
+			       struct sk_buff *skb,
+			       struct qlcnic_host_tx_ring *tx_ring)
 {
 	struct vlan_ethhdr *vh = (struct vlan_ethhdr *)(skb->data);
 	struct ethhdr *phdr = (struct ethhdr *)(skb->data);
@@ -335,7 +335,7 @@ static void qlcnic_send_filter(struct ql
 		    tmp_fil->vlan_id == vlan_id) {
 			if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime))
 				qlcnic_change_filter(adapter, &src_addr,
-						     vlan_id);
+						     vlan_id, tx_ring);
 			tmp_fil->ftime = jiffies;
 			return;
 		}
@@ -350,7 +350,7 @@ static void qlcnic_send_filter(struct ql
 	if (!fil)
 		return;
 
-	qlcnic_change_filter(adapter, &src_addr, vlan_id);
+	qlcnic_change_filter(adapter, &src_addr, vlan_id, tx_ring);
 	fil->ftime = jiffies;
 	fil->vlan_id = vlan_id;
 	memcpy(fil->faddr, &src_addr, ETH_ALEN);
@@ -766,7 +766,7 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_
 	}
 
 	if (adapter->drv_mac_learn)
-		qlcnic_send_filter(adapter, first_desc, skb);
+		qlcnic_send_filter(adapter, first_desc, skb, tx_ring);
 
 	tx_ring->tx_stats.tx_bytes += skb->len;
 	tx_ring->tx_stats.xmit_called++;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/realtek/r8169.c linux-libre-3.18.125-gnu/drivers/net/ethernet/realtek/r8169.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/realtek/r8169.c	2018-10-13 21:50:01.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/realtek/r8169.c	2018-11-10 15:46:47.000000000 -0500
@@ -7427,17 +7427,15 @@ static int rtl8169_poll(struct napi_stru
 	struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi);
 	struct net_device *dev = tp->dev;
 	u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
-	int work_done= 0;
+	int work_done;
 	u16 status;
 
 	status = rtl_get_events(tp);
 	rtl_ack_events(tp, status & ~tp->event_slow);
 
-	if (status & RTL_EVENT_NAPI_RX)
-		work_done = rtl_rx(dev, tp, (u32) budget);
+	work_done = rtl_rx(dev, tp, (u32) budget);
 
-	if (status & RTL_EVENT_NAPI_TX)
-		rtl_tx(dev, tp);
+	rtl_tx(dev, tp);
 
 	if (status & tp->event_slow) {
 		enable_mask &= ~tp->event_slow;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c linux-libre-3.18.125-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c	2018-11-10 10:39:23.000000000 -0500
@@ -130,7 +130,7 @@ static int stmmac_mdio_write(struct mii_
  */
 int stmmac_mdio_reset(struct mii_bus *bus)
 {
-#if defined(CONFIG_STMMAC_PLATFORM)
+#if IS_ENABLED(CONFIG_STMMAC_PLATFORM)
 	struct net_device *ndev = bus->priv;
 	struct stmmac_priv *priv = netdev_priv(ndev);
 	unsigned int mii_address = priv->hw->mii.addr;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c linux-libre-3.18.125-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
--- linux-libre-3.18.124-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c	2018-11-10 10:39:23.000000000 -0500
@@ -85,7 +85,7 @@ static int dwmac1000_validate_mcast_bins
 
 /* This function validates the number of Unicast address entries supported
  * by a particular Synopsys 10/100/1000 controller. The Synopsys controller
- * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter
+ * supports 1..32, 64, or 128 Unicast filter entries for it's Unicast filter
  * logic. This function validates a valid, supported configuration is
  * selected, and defaults to 1 Unicast address if an unsupported
  * configuration is selected.
@@ -95,8 +95,7 @@ static int dwmac1000_validate_ucast_entr
 	int x = ucast_entries;
 
 	switch (x) {
-	case 1:
-	case 32:
+	case 1 ... 32:
 	case 64:
 	case 128:
 		break;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/team/team.c linux-libre-3.18.125-gnu/drivers/net/team/team.c
--- linux-libre-3.18.124-gnu/drivers/net/team/team.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/team/team.c	2018-11-10 10:39:23.000000000 -0500
@@ -1143,6 +1143,11 @@ static int team_port_add(struct team *te
 		return -EBUSY;
 	}
 
+	if (dev == port_dev) {
+		netdev_err(dev, "Cannot enslave team device to itself\n");
+		return -EINVAL;
+	}
+
 	if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
 	    vlan_uses_dev(dev)) {
 		netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/usb/asix_common.c linux-libre-3.18.125-gnu/drivers/net/usb/asix_common.c
--- linux-libre-3.18.124-gnu/drivers/net/usb/asix_common.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/usb/asix_common.c	2018-11-10 10:39:23.000000000 -0500
@@ -417,6 +417,9 @@ int asix_set_wol(struct net_device *net,
 	struct usbnet *dev = netdev_priv(net);
 	u8 opt = 0;
 
+	if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
+		return -EINVAL;
+
 	if (wolinfo->wolopts & WAKE_PHY)
 		opt |= AX_MONITOR_LINK;
 	if (wolinfo->wolopts & WAKE_MAGIC)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/usb/ax88179_178a.c linux-libre-3.18.125-gnu/drivers/net/usb/ax88179_178a.c
--- linux-libre-3.18.124-gnu/drivers/net/usb/ax88179_178a.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/usb/ax88179_178a.c	2018-11-10 10:39:23.000000000 -0500
@@ -566,6 +566,9 @@ ax88179_set_wol(struct net_device *net,
 	struct usbnet *dev = netdev_priv(net);
 	u8 opt = 0;
 
+	if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
+		return -EINVAL;
+
 	if (wolinfo->wolopts & WAKE_PHY)
 		opt |= AX_MONITOR_MODE_RWLC;
 	if (wolinfo->wolopts & WAKE_MAGIC)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/usb/smsc75xx.c linux-libre-3.18.125-gnu/drivers/net/usb/smsc75xx.c
--- linux-libre-3.18.124-gnu/drivers/net/usb/smsc75xx.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/usb/smsc75xx.c	2018-11-10 10:39:23.000000000 -0500
@@ -728,6 +728,9 @@ static int smsc75xx_ethtool_set_wol(stru
 	struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
 	int ret;
 
+	if (wolinfo->wolopts & ~SUPPORTED_WAKE)
+		return -EINVAL;
+
 	pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE;
 
 	ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);
@@ -1506,6 +1509,7 @@ static void smsc75xx_unbind(struct usbne
 {
 	struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
 	if (pdata) {
+		cancel_work_sync(&pdata->set_multicast);
 		netif_dbg(dev, ifdown, dev->net, "free pdata\n");
 		kfree(pdata);
 		pdata = NULL;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/usb/smsc95xx.c linux-libre-3.18.125-gnu/drivers/net/usb/smsc95xx.c
--- linux-libre-3.18.124-gnu/drivers/net/usb/smsc95xx.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/usb/smsc95xx.c	2018-11-10 10:39:23.000000000 -0500
@@ -727,6 +727,9 @@ static int smsc95xx_ethtool_set_wol(stru
 	struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
 	int ret;
 
+	if (wolinfo->wolopts & ~SUPPORTED_WAKE)
+		return -EINVAL;
+
 	pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE;
 
 	ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/usb/sr9800.c linux-libre-3.18.125-gnu/drivers/net/usb/sr9800.c
--- linux-libre-3.18.124-gnu/drivers/net/usb/sr9800.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/usb/sr9800.c	2018-11-10 10:39:23.000000000 -0500
@@ -421,6 +421,9 @@ sr_set_wol(struct net_device *net, struc
 	struct usbnet *dev = netdev_priv(net);
 	u8 opt = 0;
 
+	if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
+		return -EINVAL;
+
 	if (wolinfo->wolopts & WAKE_PHY)
 		opt |= SR_MONITOR_LINK;
 	if (wolinfo->wolopts & WAKE_MAGIC)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/wireless/iwlwifi/pcie/drv.c linux-libre-3.18.125-gnu/drivers/net/wireless/iwlwifi/pcie/drv.c
--- linux-libre-3.18.124-gnu/drivers/net/wireless/iwlwifi/pcie/drv.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/wireless/iwlwifi/pcie/drv.c	2018-11-10 10:39:23.000000000 -0500
@@ -533,8 +533,10 @@ static int iwl_pci_probe(struct pci_dev
 	else if (cfg == &iwl7265_n_cfg)
 		cfg_7265d = &iwl7265d_n_cfg;
 	if (cfg_7265d &&
-	    (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D)
+	    (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D) {
 		cfg = cfg_7265d;
+		iwl_trans->cfg = cfg_7265d;
+	}
 #endif
 
 	pci_set_drvdata(pdev, iwl_trans);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/pci.h linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/pci.h
--- linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/pci.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/pci.h	2018-11-10 10:39:23.000000000 -0500
@@ -247,6 +247,8 @@ struct rtl_pci {
 	/* MSI support */
 	bool msi_support;
 	bool using_msi;
+	/* interrupt clear before set */
+	bool int_clear;
 };
 
 struct mp_adapter {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c
--- linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/hw.c	2018-11-10 10:39:23.000000000 -0500
@@ -2253,11 +2253,28 @@ void rtl8821ae_set_qos(struct ieee80211_
 	}
 }
 
+static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw)
+{
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
+	u32 tmp = rtl_read_dword(rtlpriv, REG_HISR);
+
+	rtl_write_dword(rtlpriv, REG_HISR, tmp);
+
+	tmp = rtl_read_dword(rtlpriv, REG_HISRE);
+	rtl_write_dword(rtlpriv, REG_HISRE, tmp);
+
+	tmp = rtl_read_dword(rtlpriv, REG_HSISR);
+	rtl_write_dword(rtlpriv, REG_HSISR, tmp);
+}
+
 void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 
+	if (rtlpci->int_clear)
+		rtl8821ae_clear_interrupt(hw);/*clear it here first*/
+
 	rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF);
 	rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
 	rtlpci->irq_enabled = true;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c
--- linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c	2018-10-13 21:54:27.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/rtl8821ae/sw.c	2018-11-10 15:52:09.000000000 -0500
@@ -142,6 +142,7 @@ int rtl8821ae_init_sw_vars(struct ieee80
 
 	rtl8821ae_bt_reg_init(hw);
 	rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
+	rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
 	rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
 
 	rtlpriv->dm.dm_initialgain_enable = 1;
@@ -213,6 +214,7 @@ int rtl8821ae_init_sw_vars(struct ieee80
 	rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
 	rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
 	rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
+	rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear;
 	if (rtlpriv->cfg->mod_params->disable_watchdog)
 		pr_info("watchdog disabled\n");
 	rtlpriv->psc.reg_fwctrl_lps = 3;
@@ -334,6 +336,7 @@ static struct rtl_mod_params rtl8821ae_m
 	.swctrl_lps = false,
 	.fwctrl_lps = true,
 	.msi_support = true,
+	.int_clear = true,
 	.debug = DBG_EMERG,
 	.disable_watchdog = 0,
 };
@@ -463,6 +466,7 @@ module_param_named(fwlps, rtl8821ae_mod_
 module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444);
 module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog,
 		   bool, 0444);
+module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444);
 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
 MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
@@ -470,6 +474,7 @@ MODULE_PARM_DESC(fwlps, "Set to 1 to use
 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
 MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
 MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
+MODULE_PARM_DESC(int_clear, "Set to 0 to disable interrupt clear before set (default 1)\n");
 
 static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/wifi.h linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/wifi.h
--- linux-libre-3.18.124-gnu/drivers/net/wireless/rtlwifi/wifi.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/net/wireless/rtlwifi/wifi.h	2018-11-10 10:39:23.000000000 -0500
@@ -2212,6 +2212,9 @@ struct rtl_mod_params {
 
 	/* default 0: 1 means disable */
 	bool disable_watchdog;
+
+	/* default 0: 1 means do not disable interrupts */
+	bool int_clear;
 };
 
 struct rtl_hal_usbint_cfg {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/of/of_pci.c linux-libre-3.18.125-gnu/drivers/of/of_pci.c
--- linux-libre-3.18.124-gnu/drivers/of/of_pci.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/of/of_pci.c	2018-11-10 10:39:23.000000000 -0500
@@ -229,7 +229,6 @@ parse_failed:
 	list_for_each_entry(window, resources, list)
 		kfree(window->res);
 	pci_free_resource_list(resources);
-	kfree(bus_range);
 	return err;
 }
 EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/pci/access.c linux-libre-3.18.125-gnu/drivers/pci/access.c
--- linux-libre-3.18.124-gnu/drivers/pci/access.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/pci/access.c	2018-11-10 10:39:23.000000000 -0500
@@ -355,7 +355,8 @@ static const struct pci_vpd_ops pci_vpd_
 static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count,
 			       void *arg)
 {
-	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	struct pci_dev *tdev = pci_get_slot(dev->bus,
+					    PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	ssize_t ret;
 
 	if (!tdev)
@@ -369,7 +370,8 @@ static ssize_t pci_vpd_f0_read(struct pc
 static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count,
 				const void *arg)
 {
-	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	struct pci_dev *tdev = pci_get_slot(dev->bus,
+					    PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	ssize_t ret;
 
 	if (!tdev)
@@ -388,7 +390,8 @@ static const struct pci_vpd_ops pci_vpd_
 
 static int pci_vpd_f0_dev_check(struct pci_dev *dev)
 {
-	struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
+	struct pci_dev *tdev = pci_get_slot(dev->bus,
+					    PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	int ret = 0;
 
 	if (!tdev)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/pci/quirks.c linux-libre-3.18.125-gnu/drivers/pci/quirks.c
--- linux-libre-3.18.124-gnu/drivers/pci/quirks.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/pci/quirks.c	2018-11-10 10:39:23.000000000 -0500
@@ -3081,6 +3081,7 @@ static void quirk_no_bus_reset(struct pc
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0032, quirk_no_bus_reset);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x003c, quirk_no_bus_reset);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0033, quirk_no_bus_reset);
 
 #ifdef CONFIG_ACPI
 /*
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/phy/phy-omap-control.c linux-libre-3.18.125-gnu/drivers/phy/phy-omap-control.c
--- linux-libre-3.18.124-gnu/drivers/phy/phy-omap-control.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/phy/phy-omap-control.c	2018-11-10 10:39:23.000000000 -0500
@@ -29,10 +29,9 @@
 /**
  * omap_control_pcie_pcs - set the PCS delay count
  * @dev: the control module device
- * @id: index of the pcie PHY (should be 1 or 2)
  * @delay: 8 bit delay value
  */
-void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay)
+void omap_control_pcie_pcs(struct device *dev, u8 delay)
 {
 	u32 val;
 	struct omap_control_phy	*control_phy;
@@ -55,8 +54,8 @@ void omap_control_pcie_pcs(struct device
 
 	val = readl(control_phy->pcie_pcs);
 	val &= ~(OMAP_CTRL_PCIE_PCS_MASK <<
-		(id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT));
-	val |= delay << (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
+		OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
+	val |= (delay << OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
 	writel(val, control_phy->pcie_pcs);
 }
 EXPORT_SYMBOL_GPL(omap_control_pcie_pcs);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/phy/phy-sun4i-usb.c linux-libre-3.18.125-gnu/drivers/phy/phy-sun4i-usb.c
--- linux-libre-3.18.124-gnu/drivers/phy/phy-sun4i-usb.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/phy/phy-sun4i-usb.c	2018-11-10 10:39:23.000000000 -0500
@@ -240,7 +240,8 @@ static int sun4i_usb_phy_probe(struct pl
 	else
 		data->num_phys = 3;
 
-	if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy"))
+	if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy") ||
+	    of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy"))
 		data->disc_thresh = 3;
 	else
 		data->disc_thresh = 2;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/phy/phy-ti-pipe3.c linux-libre-3.18.125-gnu/drivers/phy/phy-ti-pipe3.c
--- linux-libre-3.18.124-gnu/drivers/phy/phy-ti-pipe3.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/phy/phy-ti-pipe3.c	2018-11-10 10:39:23.000000000 -0500
@@ -82,7 +82,6 @@ struct ti_pipe3 {
 	struct clk		*refclk;
 	struct clk		*div_clk;
 	struct pipe3_dpll_map	*dpll_map;
-	u8			id;
 };
 
 static struct pipe3_dpll_map dpll_map_usb[] = {
@@ -217,8 +216,13 @@ static int ti_pipe3_init(struct phy *x)
 	u32 val;
 	int ret = 0;
 
+	/*
+	 * Set pcie_pcs register to 0x96 for proper functioning of phy
+	 * as recommended in AM572x TRM SPRUHZ6, section 18.5.2.2, table
+	 * 18-1804.
+	 */
 	if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) {
-		omap_control_pcie_pcs(phy->control_dev, phy->id, 0xF1);
+		omap_control_pcie_pcs(phy->control_dev, 0x96);
 		return 0;
 	}
 
@@ -347,8 +351,6 @@ static int ti_pipe3_probe(struct platfor
 	}
 
 	if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
-		if (of_property_read_u8(node, "id", &phy->id) < 0)
-			phy->id = 1;
 
 		clk = devm_clk_get(phy->dev, "dpll_ref");
 		if (IS_ERR(clk)) {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/pinctrl/freescale/pinctrl-imx25.c linux-libre-3.18.125-gnu/drivers/pinctrl/freescale/pinctrl-imx25.c
--- linux-libre-3.18.124-gnu/drivers/pinctrl/freescale/pinctrl-imx25.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/pinctrl/freescale/pinctrl-imx25.c	2018-11-10 10:39:23.000000000 -0500
@@ -26,7 +26,8 @@
 #include "pinctrl-imx.h"
 
 enum imx25_pads {
-	MX25_PAD_RESERVE0 = 1,
+	MX25_PAD_RESERVE0 = 0,
+	MX25_PAD_RESERVE1 = 1,
 	MX25_PAD_A10 = 2,
 	MX25_PAD_A13 = 3,
 	MX25_PAD_A14 = 4,
@@ -169,6 +170,7 @@ enum imx25_pads {
 /* Pad names for the pinmux subsystem */
 static const struct pinctrl_pin_desc imx25_pinctrl_pads[] = {
 	IMX_PINCTRL_PIN(MX25_PAD_RESERVE0),
+	IMX_PINCTRL_PIN(MX25_PAD_RESERVE1),
 	IMX_PINCTRL_PIN(MX25_PAD_A10),
 	IMX_PINCTRL_PIN(MX25_PAD_A13),
 	IMX_PINCTRL_PIN(MX25_PAD_A14),
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/pinctrl/pinctrl-at91.c linux-libre-3.18.125-gnu/drivers/pinctrl/pinctrl-at91.c
--- linux-libre-3.18.124-gnu/drivers/pinctrl/pinctrl-at91.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/pinctrl/pinctrl-at91.c	2018-11-10 10:39:23.000000000 -0500
@@ -322,6 +322,9 @@ static const struct pinctrl_ops at91_pct
 static void __iomem *pin_to_controller(struct at91_pinctrl *info,
 				 unsigned int bank)
 {
+	if (!gpio_chips[bank])
+		return NULL;
+
 	return gpio_chips[bank]->regbase;
 }
 
@@ -731,6 +734,10 @@ static int at91_pmx_set(struct pinctrl_d
 		pin = &pins_conf[i];
 		at91_pin_dbg(info->dev, pin);
 		pio = pin_to_controller(info, pin->bank);
+
+		if (!pio)
+			continue;
+
 		mask = pin_to_mask(pin->pin);
 		at91_mux_disable_interrupt(pio, mask);
 		switch (pin->mux) {
@@ -850,6 +857,10 @@ static int at91_pinconf_get(struct pinct
 	*config = 0;
 	dev_dbg(info->dev, "%s:%d, pin_id=%d", __func__, __LINE__, pin_id);
 	pio = pin_to_controller(info, pin_to_bank(pin_id));
+
+	if (!pio)
+		return -EINVAL;
+
 	pin = pin_id % MAX_NB_GPIO_PER_BANK;
 
 	if (at91_mux_get_multidrive(pio, pin))
@@ -891,6 +902,10 @@ static int at91_pinconf_set(struct pinct
 			"%s:%d, pin_id=%d, config=0x%lx",
 			__func__, __LINE__, pin_id, config);
 		pio = pin_to_controller(info, pin_to_bank(pin_id));
+
+		if (!pio)
+			return -EINVAL;
+
 		pin = pin_id % MAX_NB_GPIO_PER_BANK;
 		mask = pin_to_mask(pin);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/scsi/scsi_lib.c linux-libre-3.18.125-gnu/drivers/scsi/scsi_lib.c
--- linux-libre-3.18.124-gnu/drivers/scsi/scsi_lib.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/scsi/scsi_lib.c	2018-11-10 10:39:23.000000000 -0500
@@ -616,7 +616,7 @@ static int scsi_alloc_sgtable(struct scs
 	}
 
 	ret = __sg_alloc_table(&sdb->table, nents, SCSI_MAX_SG_SEGMENTS,
-			       first_chunk, gfp_mask, scsi_sg_alloc);
+			       first_chunk, GFP_ATOMIC, scsi_sg_alloc);
 	if (unlikely(ret))
 		scsi_free_sgtable(sdb, mq);
 	return ret;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/scsi/scsi_pm.c linux-libre-3.18.125-gnu/drivers/scsi/scsi_pm.c
--- linux-libre-3.18.124-gnu/drivers/scsi/scsi_pm.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/scsi/scsi_pm.c	2018-11-10 10:39:23.000000000 -0500
@@ -221,13 +221,13 @@ static int sdev_runtime_suspend(struct d
 	struct scsi_device *sdev = to_scsi_device(dev);
 	int err = 0;
 
-	if (pm && pm->runtime_suspend) {
-		err = blk_pre_runtime_suspend(sdev->request_queue);
-		if (err)
-			return err;
+	err = blk_pre_runtime_suspend(sdev->request_queue);
+	if (err)
+		return err;
+	if (pm && pm->runtime_suspend)
 		err = pm->runtime_suspend(dev);
-		blk_post_runtime_suspend(sdev->request_queue, err);
-	}
+	blk_post_runtime_suspend(sdev->request_queue, err);
+
 	return err;
 }
 
@@ -250,11 +250,11 @@ static int sdev_runtime_resume(struct de
 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 	int err = 0;
 
-	if (pm && pm->runtime_resume) {
-		blk_pre_runtime_resume(sdev->request_queue);
+	blk_pre_runtime_resume(sdev->request_queue);
+	if (pm && pm->runtime_resume)
 		err = pm->runtime_resume(dev);
-		blk_post_runtime_resume(sdev->request_queue, err);
-	}
+	blk_post_runtime_resume(sdev->request_queue, err);
+
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/tty/n_tty.c linux-libre-3.18.125-gnu/drivers/tty/n_tty.c
--- linux-libre-3.18.124-gnu/drivers/tty/n_tty.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/tty/n_tty.c	2018-11-10 10:39:23.000000000 -0500
@@ -195,7 +195,7 @@ static inline int tty_copy_to_user(struc
 {
 	struct n_tty_data *ldata = tty->disc_data;
 
-	tty_audit_add_data(tty, to, n, ldata->icanon);
+	tty_audit_add_data(tty, from, n, ldata->icanon);
 	return copy_to_user(to, from, n);
 }
 
@@ -2472,17 +2472,12 @@ static unsigned int n_tty_poll(struct tt
 
 	poll_wait(file, &tty->read_wait, wait);
 	poll_wait(file, &tty->write_wait, wait);
-	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
-		mask |= POLLHUP;
 	if (input_available_p(tty, 1))
 		mask |= POLLIN | POLLRDNORM;
-	else if (mask & POLLHUP) {
-		tty_flush_to_ldisc(tty);
-		if (input_available_p(tty, 1))
-			mask |= POLLIN | POLLRDNORM;
-	}
 	if (tty->packet && tty->link->ctrl_status)
 		mask |= POLLPRI | POLLIN | POLLRDNORM;
+	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
+		mask |= POLLHUP;
 	if (tty_hung_up_p(file))
 		mask |= POLLHUP;
 	if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/tty/serial/fsl_lpuart.c linux-libre-3.18.125-gnu/drivers/tty/serial/fsl_lpuart.c
--- linux-libre-3.18.124-gnu/drivers/tty/serial/fsl_lpuart.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/tty/serial/fsl_lpuart.c	2018-11-10 10:39:23.000000000 -0500
@@ -910,13 +910,16 @@ static void lpuart_setup_watermark(struc
 	writeb(val | UARTPFIFO_TXFE | UARTPFIFO_RXFE,
 			sport->port.membase + UARTPFIFO);
 
-	/* explicitly clear RDRF */
-	readb(sport->port.membase + UARTSR1);
-
 	/* flush Tx and Rx FIFO */
 	writeb(UARTCFIFO_TXFLUSH | UARTCFIFO_RXFLUSH,
 			sport->port.membase + UARTCFIFO);
 
+	/* explicitly clear RDRF */
+	if (readb(sport->port.membase + UARTSR1) & UARTSR1_RDRF) {
+		readb(sport->port.membase + UARTDR);
+		writeb(UARTSFIFO_RXUF, sport->port.membase + UARTSFIFO);
+	}
+
 	writeb(0, sport->port.membase + UARTTWFIFO);
 	writeb(1, sport->port.membase + UARTRWFIFO);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/tty/serial/samsung.c linux-libre-3.18.125-gnu/drivers/tty/serial/samsung.c
--- linux-libre-3.18.124-gnu/drivers/tty/serial/samsung.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/tty/serial/samsung.c	2018-11-10 10:39:23.000000000 -0500
@@ -1785,32 +1785,43 @@ static struct s3c24xx_serial_drv_data s5
 #endif
 
 #if defined(CONFIG_ARCH_EXYNOS)
+#define EXYNOS_COMMON_SERIAL_DRV_DATA				\
+	.info = &(struct s3c24xx_uart_info) {			\
+		.name		= "Samsung Exynos UART",	\
+		.type		= PORT_S3C6400,			\
+		.has_divslot	= 1,				\
+		.rx_fifomask	= S5PV210_UFSTAT_RXMASK,	\
+		.rx_fifoshift	= S5PV210_UFSTAT_RXSHIFT,	\
+		.rx_fifofull	= S5PV210_UFSTAT_RXFULL,	\
+		.tx_fifofull	= S5PV210_UFSTAT_TXFULL,	\
+		.tx_fifomask	= S5PV210_UFSTAT_TXMASK,	\
+		.tx_fifoshift	= S5PV210_UFSTAT_TXSHIFT,	\
+		.def_clk_sel	= S3C2410_UCON_CLKSEL0,		\
+		.num_clks	= 1,				\
+		.clksel_mask	= 0,				\
+		.clksel_shift	= 0,				\
+	},							\
+	.def_cfg = &(struct s3c2410_uartcfg) {			\
+		.ucon		= S5PV210_UCON_DEFAULT,		\
+		.ufcon		= S5PV210_UFCON_DEFAULT,	\
+		.has_fracval	= 1,				\
+	}							\
+
 static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = {
-	.info = &(struct s3c24xx_uart_info) {
-		.name		= "Samsung Exynos4 UART",
-		.type		= PORT_S3C6400,
-		.has_divslot	= 1,
-		.rx_fifomask	= S5PV210_UFSTAT_RXMASK,
-		.rx_fifoshift	= S5PV210_UFSTAT_RXSHIFT,
-		.rx_fifofull	= S5PV210_UFSTAT_RXFULL,
-		.tx_fifofull	= S5PV210_UFSTAT_TXFULL,
-		.tx_fifomask	= S5PV210_UFSTAT_TXMASK,
-		.tx_fifoshift	= S5PV210_UFSTAT_TXSHIFT,
-		.def_clk_sel	= S3C2410_UCON_CLKSEL0,
-		.num_clks	= 1,
-		.clksel_mask	= 0,
-		.clksel_shift	= 0,
-	},
-	.def_cfg = &(struct s3c2410_uartcfg) {
-		.ucon		= S5PV210_UCON_DEFAULT,
-		.ufcon		= S5PV210_UFCON_DEFAULT,
-		.has_fracval	= 1,
-	},
+	EXYNOS_COMMON_SERIAL_DRV_DATA,
 	.fifosize = { 256, 64, 16, 16 },
 };
+
+static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = {
+	EXYNOS_COMMON_SERIAL_DRV_DATA,
+	.fifosize = { 64, 256, 16, 256 },
+};
+
 #define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data)
+#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data)
 #else
 #define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL
+#define EXYNOS5433_SERIAL_DRV_DATA (kernel_ulong_t)NULL
 #endif
 
 static struct platform_device_id s3c24xx_serial_driver_ids[] = {
@@ -1832,6 +1843,9 @@ static struct platform_device_id s3c24xx
 	}, {
 		.name		= "exynos4210-uart",
 		.driver_data	= EXYNOS4210_SERIAL_DRV_DATA,
+	}, {
+		.name		= "exynos5433-uart",
+		.driver_data	= EXYNOS5433_SERIAL_DRV_DATA,
 	},
 	{ },
 };
@@ -1851,6 +1865,8 @@ static const struct of_device_id s3c24xx
 		.data = (void *)S5PV210_SERIAL_DRV_DATA },
 	{ .compatible = "samsung,exynos4210-uart",
 		.data = (void *)EXYNOS4210_SERIAL_DRV_DATA },
+	{ .compatible = "samsung,exynos5433-uart",
+		.data = (void *)EXYNOS5433_SERIAL_DRV_DATA },
 	{},
 };
 MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/tty/tty_audit.c linux-libre-3.18.125-gnu/drivers/tty/tty_audit.c
--- linux-libre-3.18.124-gnu/drivers/tty/tty_audit.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/tty/tty_audit.c	2018-11-10 10:39:23.000000000 -0500
@@ -265,7 +265,7 @@ static struct tty_audit_buf *tty_audit_b
  *
  *	Audit @data of @size from @tty, if necessary.
  */
-void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
+void tty_audit_add_data(struct tty_struct *tty, const void *data,
 			size_t size, unsigned icanon)
 {
 	struct tty_audit_buf *buf;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/class/cdc-acm.c linux-libre-3.18.125-gnu/drivers/usb/class/cdc-acm.c
--- linux-libre-3.18.124-gnu/drivers/usb/class/cdc-acm.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/class/cdc-acm.c	2018-11-10 10:39:23.000000000 -0500
@@ -336,17 +336,17 @@ static void acm_ctrl_irq(struct urb *urb
 
 		if (difference & ACM_CTRL_DSR)
 			acm->iocount.dsr++;
-		if (difference & ACM_CTRL_BRK)
-			acm->iocount.brk++;
-		if (difference & ACM_CTRL_RI)
-			acm->iocount.rng++;
 		if (difference & ACM_CTRL_DCD)
 			acm->iocount.dcd++;
-		if (difference & ACM_CTRL_FRAMING)
+		if (newctrl & ACM_CTRL_BRK)
+			acm->iocount.brk++;
+		if (newctrl & ACM_CTRL_RI)
+			acm->iocount.rng++;
+		if (newctrl & ACM_CTRL_FRAMING)
 			acm->iocount.frame++;
-		if (difference & ACM_CTRL_PARITY)
+		if (newctrl & ACM_CTRL_PARITY)
 			acm->iocount.parity++;
-		if (difference & ACM_CTRL_OVERRUN)
+		if (newctrl & ACM_CTRL_OVERRUN)
 			acm->iocount.overrun++;
 		spin_unlock(&acm->read_lock);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/core/devio.c linux-libre-3.18.125-gnu/drivers/usb/core/devio.c
--- linux-libre-3.18.124-gnu/drivers/usb/core/devio.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/core/devio.c	2018-11-10 10:39:23.000000000 -0500
@@ -1326,8 +1326,6 @@ static int proc_do_submiturb(struct usb_
 	u = 0;
 	switch(uurb->type) {
 	case USBDEVFS_URB_TYPE_CONTROL:
-		if (is_in)
-			allow_short = true;
 		if (!usb_endpoint_xfer_control(&ep->desc))
 			return -EINVAL;
 		/* min 8 byte setup packet */
@@ -1357,6 +1355,8 @@ static int proc_do_submiturb(struct usb_
 			is_in = 0;
 			uurb->endpoint &= ~USB_DIR_IN;
 		}
+		if (is_in)
+			allow_short = true;
 		snoop(&ps->dev->dev, "control urb: bRequestType=%02x "
 			"bRequest=%02x wValue=%04x "
 			"wIndex=%04x wLength=%04x\n",
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/core/hub.c linux-libre-3.18.125-gnu/drivers/usb/core/hub.c
--- linux-libre-3.18.124-gnu/drivers/usb/core/hub.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/core/hub.c	2018-11-10 10:39:23.000000000 -0500
@@ -1000,11 +1000,8 @@ static void hub_activate(struct usb_hub
 		device_lock(hub->intfdev);
 
 		/* Was the hub disconnected while we were waiting? */
-		if (hub->disconnected) {
-			device_unlock(hub->intfdev);
-			kref_put(&hub->kref, hub_release);
-			return;
-		}
+		if (hub->disconnected)
+			goto disconnected;
 		if (type == HUB_INIT2)
 			goto init2;
 		goto init3;
@@ -1230,12 +1227,12 @@ static void hub_activate(struct usb_hub
 	/* Scan all ports that need attention */
 	kick_hub_wq(hub);
 
-	/* Allow autosuspend if it was suppressed */
-	if (type <= HUB_INIT3)
+	if (type == HUB_INIT2 || type == HUB_INIT3) {
+		/* Allow autosuspend if it was suppressed */
+ disconnected:
 		usb_autopm_put_interface_async(to_usb_interface(hub->intfdev));
-
-	if (type == HUB_INIT2 || type == HUB_INIT3)
 		device_unlock(hub->intfdev);
+	}
 
 	kref_put(&hub->kref, hub_release);
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/dwc2/gadget.c linux-libre-3.18.125-gnu/drivers/usb/dwc2/gadget.c
--- linux-libre-3.18.124-gnu/drivers/usb/dwc2/gadget.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/dwc2/gadget.c	2018-11-10 10:39:23.000000000 -0500
@@ -2590,7 +2590,7 @@ error:
  * s3c_hsotg_ep_disable - disable given endpoint
  * @ep: The endpoint to disable.
  */
-static int s3c_hsotg_ep_disable(struct usb_ep *ep)
+static int s3c_hsotg_ep_disable_force(struct usb_ep *ep, bool force)
 {
 	struct s3c_hsotg_ep *hs_ep = our_ep(ep);
 	struct s3c_hsotg *hsotg = hs_ep->parent;
@@ -2611,7 +2611,7 @@ static int s3c_hsotg_ep_disable(struct u
 
 	spin_lock_irqsave(&hsotg->lock, flags);
 	/* terminate all requests with shutdown */
-	kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, false);
+	kill_all_requests(hsotg, hs_ep, -ESHUTDOWN, force);
 
 	hsotg->fifo_map &= ~(1<<hs_ep->fifo_index);
 	hs_ep->fifo_index = 0;
@@ -2632,6 +2632,10 @@ static int s3c_hsotg_ep_disable(struct u
 	return 0;
 }
 
+static int s3c_hsotg_ep_disable(struct usb_ep *ep)
+{
+	return s3c_hsotg_ep_disable_force(ep, false);
+}
 /**
  * on_list - check request is on the given endpoint
  * @ep: The endpoint to check.
@@ -2933,7 +2937,7 @@ static int s3c_hsotg_udc_stop(struct usb
 
 	/* all endpoints should be shutdown */
 	for (ep = 1; ep < hsotg->num_of_eps; ep++)
-		s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
+		s3c_hsotg_ep_disable_force(&hsotg->eps[ep].ep, true);
 
 	spin_lock_irqsave(&hsotg->lock, flags);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/gadget/function/f_uac1.c linux-libre-3.18.125-gnu/drivers/usb/gadget/function/f_uac1.c
--- linux-libre-3.18.124-gnu/drivers/usb/gadget/function/f_uac1.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/gadget/function/f_uac1.c	2018-11-10 10:39:23.000000000 -0500
@@ -897,7 +897,6 @@ static void f_audio_free_inst(struct usb
 	struct f_uac1_opts *opts;
 
 	opts = container_of(f, struct f_uac1_opts, func_inst);
-	gaudio_cleanup(opts->card);
 	if (opts->fn_play_alloc)
 		kfree(opts->fn_play);
 	if (opts->fn_cap_alloc)
@@ -935,6 +934,7 @@ static void f_audio_free(struct usb_func
 	struct f_audio *audio = func_to_audio(f);
 	struct f_uac1_opts *opts;
 
+	gaudio_cleanup(&audio->card);
 	opts = container_of(f->fi, struct f_uac1_opts, func_inst);
 	kfree(audio);
 	mutex_lock(&opts->lock);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/gadget/legacy/inode.c linux-libre-3.18.125-gnu/drivers/usb/gadget/legacy/inode.c
--- linux-libre-3.18.124-gnu/drivers/usb/gadget/legacy/inode.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/gadget/legacy/inode.c	2018-11-10 10:39:23.000000000 -0500
@@ -442,6 +442,7 @@ ep_write (struct file *fd, const char __
 	kbuf = memdup_user(buf, len);
 	if (IS_ERR(kbuf)) {
 		value = PTR_ERR(kbuf);
+		kbuf = NULL;
 		goto free1;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/host/ehci-sched.c linux-libre-3.18.125-gnu/drivers/usb/host/ehci-sched.c
--- linux-libre-3.18.124-gnu/drivers/usb/host/ehci-sched.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/host/ehci-sched.c	2018-11-10 10:39:23.000000000 -0500
@@ -1604,11 +1604,11 @@ iso_stream_schedule (
 	 */
 	now2 = (now - base) & (mod - 1);
 
-	/* Is the schedule already full? */
+	/* Is the schedule about to wrap around? */
 	if (unlikely(!empty && start < period)) {
-		ehci_dbg(ehci, "iso sched full %p (%u-%u < %u mod %u)\n",
+		ehci_dbg(ehci, "request %p would overflow (%u-%u < %u mod %u)\n",
 				urb, stream->next_uframe, base, period, mod);
-		status = -ENOSPC;
+		status = -EFBIG;
 		goto fail;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/host/ehci-tegra.c linux-libre-3.18.125-gnu/drivers/usb/host/ehci-tegra.c
--- linux-libre-3.18.124-gnu/drivers/usb/host/ehci-tegra.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/host/ehci-tegra.c	2018-11-10 10:39:23.000000000 -0500
@@ -451,7 +451,7 @@ static int tegra_ehci_probe(struct platf
 
 	u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
 	if (IS_ERR(u_phy)) {
-		err = PTR_ERR(u_phy);
+		err = -EPROBE_DEFER;
 		goto cleanup_clk_en;
 	}
 	hcd->usb_phy = u_phy;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/host/xhci-hub.c linux-libre-3.18.125-gnu/drivers/usb/host/xhci-hub.c
--- linux-libre-3.18.124-gnu/drivers/usb/host/xhci-hub.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/host/xhci-hub.c	2018-11-10 10:39:23.000000000 -0500
@@ -926,17 +926,17 @@ int xhci_hub_control(struct usb_hcd *hcd
 				temp = readl(port_array[wIndex]);
 				break;
 			}
-
-			/* Software should not attempt to set
-			 * port link state above '3' (U3) and the port
-			 * must be enabled.
-			 */
-			if ((temp & PORT_PE) == 0 ||
-				(link_state > USB_SS_PORT_LS_U3)) {
-				xhci_warn(xhci, "Cannot set link state.\n");
+			/* Port must be enabled */
+			if (!(temp & PORT_PE)) {
+				retval = -ENODEV;
+				break;
+			}
+			/* Can't set port link state above '3' (U3) */
+			if (link_state > USB_SS_PORT_LS_U3) {
+				xhci_warn(xhci, "Cannot set port %d link state %d\n",
+					 wIndex, link_state);
 				goto error;
 			}
-
 			if (link_state == USB_SS_PORT_LS_U3) {
 				slot_id = xhci_find_slot_id_by_port(hcd, xhci,
 						wIndex + 1);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/musb/Kconfig linux-libre-3.18.125-gnu/drivers/usb/musb/Kconfig
--- linux-libre-3.18.124-gnu/drivers/usb/musb/Kconfig	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/musb/Kconfig	2018-11-10 10:39:23.000000000 -0500
@@ -73,6 +73,8 @@ config USB_MUSB_DA8XX
 
 config USB_MUSB_TUSB6010
 	tristate "TUSB6010"
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
+	depends on NOP_USB_XCEIV = USB_MUSB_HDRC # both built-in or both modules
 
 config USB_MUSB_OMAP2PLUS
 	tristate "OMAP2430 and onwards"
@@ -86,6 +88,7 @@ config USB_MUSB_AM35X
 config USB_MUSB_DSPS
 	tristate "TI DSPS platforms"
 	select USB_MUSB_AM335X_CHILD
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	depends on OF_IRQ
 
 config USB_MUSB_BLACKFIN
@@ -94,6 +97,7 @@ config USB_MUSB_BLACKFIN
 
 config USB_MUSB_UX500
 	tristate "Ux500 platforms"
+	depends on ARCH_U8500 || COMPILE_TEST
 
 config USB_MUSB_JZ4740
 	tristate "JZ4740"
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/musb/musb_cppi41.c linux-libre-3.18.125-gnu/drivers/usb/musb/musb_cppi41.c
--- linux-libre-3.18.124-gnu/drivers/usb/musb/musb_cppi41.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/musb/musb_cppi41.c	2018-11-10 10:39:23.000000000 -0500
@@ -629,9 +629,9 @@ static int cppi41_dma_controller_start(s
 		ret = of_property_read_string_index(np, "dma-names", i, &str);
 		if (ret)
 			goto err;
-		if (!strncmp(str, "tx", 2))
+		if (strstarts(str, "tx"))
 			is_tx = 1;
-		else if (!strncmp(str, "rx", 2))
+		else if (strstarts(str, "rx"))
 			is_tx = 0;
 		else {
 			dev_err(dev, "Wrong dmatype %s\n", str);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/musb/musb_debugfs.c linux-libre-3.18.125-gnu/drivers/usb/musb/musb_debugfs.c
--- linux-libre-3.18.124-gnu/drivers/usb/musb/musb_debugfs.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/musb/musb_debugfs.c	2018-11-10 10:39:23.000000000 -0500
@@ -194,30 +194,30 @@ static ssize_t musb_test_mode_write(stru
 	if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
 		return -EFAULT;
 
-	if (!strncmp(buf, "force host", 9))
+	if (strstarts(buf, "force host"))
 		test = MUSB_TEST_FORCE_HOST;
 
-	if (!strncmp(buf, "fifo access", 11))
+	if (strstarts(buf, "fifo access"))
 		test = MUSB_TEST_FIFO_ACCESS;
 
-	if (!strncmp(buf, "force full-speed", 15))
+	if (strstarts(buf, "force full-speed"))
 		test = MUSB_TEST_FORCE_FS;
 
-	if (!strncmp(buf, "force high-speed", 15))
+	if (strstarts(buf, "force high-speed"))
 		test = MUSB_TEST_FORCE_HS;
 
-	if (!strncmp(buf, "test packet", 10)) {
+	if (strstarts(buf, "test packet")) {
 		test = MUSB_TEST_PACKET;
 		musb_load_testpacket(musb);
 	}
 
-	if (!strncmp(buf, "test K", 6))
+	if (strstarts(buf, "test K"))
 		test = MUSB_TEST_K;
 
-	if (!strncmp(buf, "test J", 6))
+	if (strstarts(buf, "test J"))
 		test = MUSB_TEST_J;
 
-	if (!strncmp(buf, "test SE0 NAK", 12))
+	if (strstarts(buf, "test SE0 NAK"))
 		test = MUSB_TEST_SE0_NAK;
 
 	musb_writeb(musb->mregs, MUSB_TESTMODE, test);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/serial/qcserial.c linux-libre-3.18.125-gnu/drivers/usb/serial/qcserial.c
--- linux-libre-3.18.124-gnu/drivers/usb/serial/qcserial.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/serial/qcserial.c	2018-11-10 10:39:23.000000000 -0500
@@ -190,6 +190,10 @@ static int qcprobe(struct usb_serial *se
 	__u8 ifnum;
 	int altsetting = -1;
 
+	/* we only support vendor specific functions */
+	if (intf->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
+		goto done;
+
 	nintf = serial->dev->actconfig->desc.bNumInterfaces;
 	dev_dbg(dev, "Num Interfaces = %d\n", nintf);
 	ifnum = intf->desc.bInterfaceNumber;
@@ -309,29 +313,39 @@ static int qcprobe(struct usb_serial *se
 		break;
 	case QCSERIAL_HWI:
 		/*
-		 * Huawei layout:
-		 * 0: AT-capable modem port
-		 * 1: DM/DIAG
-		 * 2: AT-capable modem port
-		 * 3: CCID-compatible PCSC interface
-		 * 4: QMI/net
-		 * 5: NMEA
+		 * Huawei devices map functions by subclass + protocol
+		 * instead of interface numbers. The protocol identify
+		 * a specific function, while the subclass indicate a
+		 * specific firmware source
+		 *
+		 * This is a blacklist of functions known to be
+		 * non-serial.  The rest are assumed to be serial and
+		 * will be handled by this driver
 		 */
-		switch (ifnum) {
-		case 0:
-		case 2:
-			dev_dbg(dev, "Modem port found\n");
-			break;
-		case 1:
-			dev_dbg(dev, "DM/DIAG interface found\n");
-			break;
-		case 5:
-			dev_dbg(dev, "NMEA GPS interface found\n");
-			break;
-		default:
-			/* don't claim any unsupported interface */
+		switch (intf->desc.bInterfaceProtocol) {
+			/* QMI combined (qmi_wwan) */
+		case 0x07:
+		case 0x37:
+		case 0x67:
+			/* QMI data (qmi_wwan) */
+		case 0x08:
+		case 0x38:
+		case 0x68:
+			/* QMI control (qmi_wwan) */
+		case 0x09:
+		case 0x39:
+		case 0x69:
+			/* NCM like (huawei_cdc_ncm) */
+		case 0x16:
+		case 0x46:
+		case 0x76:
 			altsetting = -1;
 			break;
+		default:
+			dev_dbg(dev, "Huawei type serial port found (%02x/%02x/%02x)\n",
+				intf->desc.bInterfaceClass,
+				intf->desc.bInterfaceSubClass,
+				intf->desc.bInterfaceProtocol);
 		}
 		break;
 	default:
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/usb/storage/unusual_uas.h linux-libre-3.18.125-gnu/drivers/usb/storage/unusual_uas.h
--- linux-libre-3.18.124-gnu/drivers/usb/storage/unusual_uas.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/usb/storage/unusual_uas.h	2018-11-10 10:39:23.000000000 -0500
@@ -40,6 +40,16 @@
  * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org>
  */
 
+/*
+ * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
+ * commands in UAS mode.  Observed with the 1.28 firmware; are there others?
+ */
+UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128,
+		"Apricorn",
+		"",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_IGNORE_UAS),
+
 /* https://bugzilla.kernel.org/show_bug.cgi?id=79511 */
 UNUSUAL_DEV(0x0bc2, 0x2312, 0x0000, 0x9999,
 		"Seagate",
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/atyfb_base.c linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/atyfb_base.c
--- linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/atyfb_base.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/atyfb_base.c	2018-11-10 10:39:23.000000000 -0500
@@ -3112,17 +3112,18 @@ static int atyfb_setup_sparc(struct pci_
 		/*
 		 * PLL Reference Divider M:
 		 */
-		M = pll_regs[2];
+		M = pll_regs[PLL_REF_DIV];
 
 		/*
 		 * PLL Feedback Divider N (Dependent on CLOCK_CNTL):
 		 */
-		N = pll_regs[7 + (clock_cntl & 3)];
+		N = pll_regs[VCLK0_FB_DIV + (clock_cntl & 3)];
 
 		/*
 		 * PLL Post Divider P (Dependent on CLOCK_CNTL):
 		 */
-		P = 1 << (pll_regs[6] >> ((clock_cntl & 3) << 1));
+		P = aty_postdividers[((pll_regs[VCLK_POST_DIV] >> ((clock_cntl & 3) << 1)) & 3) |
+		                     ((pll_regs[PLL_EXT_CNTL] >> (2 + (clock_cntl & 3))) & 4)];
 
 		/*
 		 * PLL Divider Q:
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/atyfb.h linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/atyfb.h
--- linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/atyfb.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/atyfb.h	2018-11-10 10:39:23.000000000 -0500
@@ -335,6 +335,8 @@ extern const struct aty_pll_ops aty_pll_
 extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll);
 extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
 
+extern const u8 aty_postdividers[8];
+
 
     /*
      *  Hardware cursor support
@@ -361,7 +363,6 @@ static inline void wait_for_idle(struct
 
 extern void aty_reset_engine(const struct atyfb_par *par);
 extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
-extern u8   aty_ld_pll_ct(int offset, const struct atyfb_par *par);
 
 void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/mach64_ct.c linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/mach64_ct.c
--- linux-libre-3.18.124-gnu/drivers/video/fbdev/aty/mach64_ct.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/video/fbdev/aty/mach64_ct.c	2018-11-10 10:39:23.000000000 -0500
@@ -114,7 +114,7 @@ static void aty_st_pll_ct(int offset, u8
  */
 
 #define Maximum_DSP_PRECISION 7
-static u8 postdividers[] = {1,2,4,8,3};
+const u8 aty_postdividers[8] = {1,2,4,8,3,5,6,12};
 
 static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll)
 {
@@ -221,7 +221,7 @@ static int aty_valid_pll_ct(const struct
 		pll->vclk_post_div += (q <  64*8);
 		pll->vclk_post_div += (q <  32*8);
 	}
-	pll->vclk_post_div_real = postdividers[pll->vclk_post_div];
+	pll->vclk_post_div_real = aty_postdividers[pll->vclk_post_div];
 	//    pll->vclk_post_div <<= 6;
 	pll->vclk_fb_div = q * pll->vclk_post_div_real / 8;
 	pllvclk = (1000000 * 2 * pll->vclk_fb_div) /
@@ -512,7 +512,7 @@ static int aty_init_pll_ct(const struct
 		u8 mclk_fb_div, pll_ext_cntl;
 		pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
 		pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par);
-		pll->ct.xclk_post_div_real = postdividers[pll_ext_cntl & 0x07];
+		pll->ct.xclk_post_div_real = aty_postdividers[pll_ext_cntl & 0x07];
 		mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par);
 		if (pll_ext_cntl & PLL_MFB_TIMES_4_2B)
 			mclk_fb_div <<= 1;
@@ -534,7 +534,7 @@ static int aty_init_pll_ct(const struct
 		xpost_div += (q <  64*8);
 		xpost_div += (q <  32*8);
 	}
-	pll->ct.xclk_post_div_real = postdividers[xpost_div];
+	pll->ct.xclk_post_div_real = aty_postdividers[xpost_div];
 	pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
 
 #ifdef CONFIG_PPC
@@ -583,7 +583,7 @@ static int aty_init_pll_ct(const struct
 			mpost_div += (q <  64*8);
 			mpost_div += (q <  32*8);
 		}
-		sclk_post_div_real = postdividers[mpost_div];
+		sclk_post_div_real = aty_postdividers[mpost_div];
 		pll->ct.sclk_fb_div = q * sclk_post_div_real / 8;
 		pll->ct.spll_cntl2 = mpost_div << 4;
 #ifdef DEBUG
diff -druNp --no-dereference linux-libre-3.18.124-gnu/drivers/video/fbdev/broadsheetfb.c linux-libre-3.18.125-gnu/drivers/video/fbdev/broadsheetfb.c
--- linux-libre-3.18.124-gnu/drivers/video/fbdev/broadsheetfb.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/drivers/video/fbdev/broadsheetfb.c	2018-11-10 10:39:23.000000000 -0500
@@ -636,7 +636,7 @@ static int broadsheet_spiflash_rewrite_s
 		err = broadsheet_spiflash_read_range(par, start_sector_addr,
 						data_start_addr, sector_buffer);
 		if (err)
-			return err;
+			goto out;
 	}
 
 	/* now we copy our data into the right place in the sector buffer */
@@ -657,7 +657,7 @@ static int broadsheet_spiflash_rewrite_s
 		err = broadsheet_spiflash_read_range(par, tail_start_addr,
 			tail_len, sector_buffer + tail_start_addr);
 		if (err)
-			return err;
+			goto out;
 	}
 
 	/* if we got here we have the full sector that we want to rewrite. */
@@ -665,11 +665,13 @@ static int broadsheet_spiflash_rewrite_s
 	/* first erase the sector */
 	err = broadsheet_spiflash_erase_sector(par, start_sector_addr);
 	if (err)
-		return err;
+		goto out;
 
 	/* now write it */
 	err = broadsheet_spiflash_write_sector(par, start_sector_addr,
 					sector_buffer, sector_size);
+out:
+	kfree(sector_buffer);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/btrfs/file.c linux-libre-3.18.125-gnu/fs/btrfs/file.c
--- linux-libre-3.18.124-gnu/fs/btrfs/file.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/btrfs/file.c	2018-11-10 10:39:23.000000000 -0500
@@ -1879,6 +1879,7 @@ int btrfs_sync_file(struct file *file, l
 	struct btrfs_log_ctx ctx;
 	int ret = 0;
 	bool full_sync = 0;
+	const u64 len = end - start + 1;
 
 	trace_btrfs_sync_file(file, datasync);
 
@@ -1907,7 +1908,7 @@ int btrfs_sync_file(struct file *file, l
 		 * all extents are persisted and the respective file extent
 		 * items are in the fs/subvol btree.
 		 */
-		ret = btrfs_wait_ordered_range(inode, start, end - start + 1);
+		ret = btrfs_wait_ordered_range(inode, start, len);
 	} else {
 		/*
 		 * Start any new ordered operations before starting to log the
@@ -1979,8 +1980,10 @@ int btrfs_sync_file(struct file *file, l
 	 */
 	smp_mb();
 	if (btrfs_inode_in_log(inode, root->fs_info->generation) ||
-	    (full_sync && BTRFS_I(inode)->last_trans <=
-	     root->fs_info->last_trans_committed)) {
+	    (BTRFS_I(inode)->last_trans <=
+	     root->fs_info->last_trans_committed &&
+	     (full_sync ||
+	      !btrfs_have_ordered_extents_in_range(inode, start, len)))) {
 		/*
 		 * We'v had everything committed since the last time we were
 		 * modified so clear this flag in case it was set for whatever
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/btrfs/ordered-data.c linux-libre-3.18.125-gnu/fs/btrfs/ordered-data.c
--- linux-libre-3.18.124-gnu/fs/btrfs/ordered-data.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/btrfs/ordered-data.c	2018-11-10 10:39:23.000000000 -0500
@@ -848,6 +848,20 @@ out:
 	return entry;
 }
 
+bool btrfs_have_ordered_extents_in_range(struct inode *inode,
+					 u64 file_offset,
+					 u64 len)
+{
+	struct btrfs_ordered_extent *oe;
+
+	oe = btrfs_lookup_ordered_range(inode, file_offset, len);
+	if (oe) {
+		btrfs_put_ordered_extent(oe);
+		return true;
+	}
+	return false;
+}
+
 /*
  * lookup and return any extent before 'file_offset'.  NULL is returned
  * if none is found
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/btrfs/ordered-data.h linux-libre-3.18.125-gnu/fs/btrfs/ordered-data.h
--- linux-libre-3.18.124-gnu/fs/btrfs/ordered-data.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/btrfs/ordered-data.h	2018-11-10 10:39:23.000000000 -0500
@@ -191,6 +191,9 @@ btrfs_lookup_first_ordered_extent(struct
 struct btrfs_ordered_extent *btrfs_lookup_ordered_range(struct inode *inode,
 							u64 file_offset,
 							u64 len);
+bool btrfs_have_ordered_extents_in_range(struct inode *inode,
+					 u64 file_offset,
+					 u64 len);
 int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
 				struct btrfs_ordered_extent *ordered);
 int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr,
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/btrfs/xattr.c linux-libre-3.18.125-gnu/fs/btrfs/xattr.c
--- linux-libre-3.18.124-gnu/fs/btrfs/xattr.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/btrfs/xattr.c	2018-11-10 10:39:23.000000000 -0500
@@ -111,6 +111,8 @@ static int do_setxattr(struct btrfs_tran
 					name, name_len, -1);
 		if (!di && (flags & XATTR_REPLACE))
 			ret = -ENODATA;
+		else if (IS_ERR(di))
+			ret = PTR_ERR(di);
 		else if (di)
 			ret = btrfs_delete_one_dir_name(trans, root, path, di);
 		goto out;
@@ -127,10 +129,12 @@ static int do_setxattr(struct btrfs_tran
 		ASSERT(mutex_is_locked(&inode->i_mutex));
 		di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode),
 					name, name_len, 0);
-		if (!di) {
+		if (!di)
 			ret = -ENODATA;
+		else if (IS_ERR(di))
+			ret = PTR_ERR(di);
+		if (ret)
 			goto out;
-		}
 		btrfs_release_path(path);
 		di = NULL;
 	}
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/cachefiles/namei.c linux-libre-3.18.125-gnu/fs/cachefiles/namei.c
--- linux-libre-3.18.124-gnu/fs/cachefiles/namei.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/cachefiles/namei.c	2018-11-10 10:39:23.000000000 -0500
@@ -317,7 +317,7 @@ try_again:
 	trap = lock_rename(cache->graveyard, dir);
 
 	/* do some checks before getting the grave dentry */
-	if (rep->d_parent != dir) {
+	if (rep->d_parent != dir || IS_DEADDIR(d_inode(rep))) {
 		/* the entry was probably culled when we dropped the parent dir
 		 * lock */
 		unlock_rename(cache->graveyard, dir);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/ext4/extents.c linux-libre-3.18.125-gnu/fs/ext4/extents.c
--- linux-libre-3.18.124-gnu/fs/ext4/extents.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/ext4/extents.c	2018-11-10 10:39:23.000000000 -0500
@@ -5400,6 +5400,14 @@ int ext4_collapse_range(struct inode *in
 	loff_t new_size, ioffset;
 	int ret;
 
+	/*
+	 * We need to test this early because xfstests assumes that a
+	 * collapse range of (0, 1) will return EOPNOTSUPP if the file
+	 * system does not support collapse range.
+	 */
+	if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))
+		return -EOPNOTSUPP;
+
 	/* Collapse range works only on fs block size aligned offsets. */
 	if (offset & (EXT4_CLUSTER_SIZE(sb) - 1) ||
 	    len & (EXT4_CLUSTER_SIZE(sb) - 1))
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/fat/fatent.c linux-libre-3.18.125-gnu/fs/fat/fatent.c
--- linux-libre-3.18.124-gnu/fs/fat/fatent.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/fat/fatent.c	2018-11-10 10:39:23.000000000 -0500
@@ -684,6 +684,7 @@ int fat_count_free_clusters(struct super
 			if (ops->ent_get(&fatent) == FAT_ENT_FREE)
 				free++;
 		} while (fat_ent_next(sbi, &fatent));
+		cond_resched();
 	}
 	sbi->free_clusters = free;
 	sbi->free_clus_valid = 1;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/nfs/callback.c linux-libre-3.18.125-gnu/fs/nfs/callback.c
--- linux-libre-3.18.124-gnu/fs/nfs/callback.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/nfs/callback.c	2018-11-10 10:39:23.000000000 -0500
@@ -128,7 +128,7 @@ nfs41_callback_svc(void *vrqstp)
 		if (try_to_freeze())
 			continue;
 
-		prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_UNINTERRUPTIBLE);
+		prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE);
 		spin_lock_bh(&serv->sv_cb_lock);
 		if (!list_empty(&serv->sv_cb_list)) {
 			req = list_first_entry(&serv->sv_cb_list,
@@ -142,10 +142,10 @@ nfs41_callback_svc(void *vrqstp)
 				error);
 		} else {
 			spin_unlock_bh(&serv->sv_cb_lock);
-			/* schedule_timeout to game the hung task watchdog */
-			schedule_timeout(60 * HZ);
+			schedule();
 			finish_wait(&serv->sv_cb_waitq, &wq);
 		}
+		flush_signals(current);
 	}
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/nfs/nfs4client.c linux-libre-3.18.125-gnu/fs/nfs/nfs4client.c
--- linux-libre-3.18.124-gnu/fs/nfs/nfs4client.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/nfs/nfs4client.c	2018-11-10 10:39:23.000000000 -0500
@@ -228,6 +228,7 @@ static void nfs4_shutdown_client(struct
 	kfree(clp->cl_serverowner);
 	kfree(clp->cl_serverscope);
 	kfree(clp->cl_implid);
+	kfree(clp->cl_owner_id);
 }
 
 void nfs4_free_client(struct nfs_client *clp)
@@ -455,6 +456,14 @@ static void nfs4_swap_callback_idents(st
 	spin_unlock(&nn->nfs_client_lock);
 }
 
+static bool nfs4_match_client_owner_id(const struct nfs_client *clp1,
+		const struct nfs_client *clp2)
+{
+	if (clp1->cl_owner_id == NULL || clp2->cl_owner_id == NULL)
+		return true;
+	return strcmp(clp1->cl_owner_id, clp2->cl_owner_id) == 0;
+}
+
 /**
  * nfs40_walk_client_list - Find server that recognizes a client ID
  *
@@ -486,9 +495,6 @@ int nfs40_walk_client_list(struct nfs_cl
 		if (pos->rpc_ops != new->rpc_ops)
 			continue;
 
-		if (pos->cl_proto != new->cl_proto)
-			continue;
-
 		if (pos->cl_minorversion != new->cl_minorversion)
 			continue;
 
@@ -514,6 +520,9 @@ int nfs40_walk_client_list(struct nfs_cl
 		if (pos->cl_clientid != new->cl_clientid)
 			continue;
 
+		if (!nfs4_match_client_owner_id(pos, new))
+			continue;
+
 		atomic_inc(&pos->cl_count);
 		spin_unlock(&nn->nfs_client_lock);
 
@@ -621,9 +630,6 @@ int nfs41_walk_client_list(struct nfs_cl
 		if (pos->rpc_ops != new->rpc_ops)
 			continue;
 
-		if (pos->cl_proto != new->cl_proto)
-			continue;
-
 		if (pos->cl_minorversion != new->cl_minorversion)
 			continue;
 
@@ -663,6 +669,13 @@ int nfs41_walk_client_list(struct nfs_cl
 		if (!nfs4_check_clientid_trunking(pos, new))
 			continue;
 
+		/* Unlike NFSv4.0, we know that NFSv4.1 always uses the
+		 * uniform string, however someone might switch the
+		 * uniquifier string on us.
+		 */
+		if (!nfs4_match_client_owner_id(pos, new))
+			continue;
+
 		atomic_inc(&pos->cl_count);
 		*result = pos;
 		status = 0;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/nfs/nfs4proc.c linux-libre-3.18.125-gnu/fs/nfs/nfs4proc.c
--- linux-libre-3.18.124-gnu/fs/nfs/nfs4proc.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/nfs/nfs4proc.c	2018-11-10 10:39:23.000000000 -0500
@@ -1117,8 +1117,6 @@ static int can_open_delegated(struct nfs
 		return 0;
 	if ((delegation->type & fmode) != fmode)
 		return 0;
-	if (test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags))
-		return 0;
 	if (test_bit(NFS_DELEGATION_RETURNING, &delegation->flags))
 		return 0;
 	nfs_mark_delegation_referenced(delegation);
@@ -4913,11 +4911,14 @@ static void nfs4_init_boot_verifier(cons
 }
 
 static unsigned int
-nfs4_init_nonuniform_client_string(const struct nfs_client *clp,
+nfs4_init_nonuniform_client_string(struct nfs_client *clp,
 				   char *buf, size_t len)
 {
 	unsigned int result;
 
+	if (clp->cl_owner_id != NULL)
+		return strlcpy(buf, clp->cl_owner_id, len);
+
 	rcu_read_lock();
 	result = scnprintf(buf, len, "Linux NFSv4.0 %s/%s %s",
 				clp->cl_ipaddr,
@@ -4926,24 +4927,32 @@ nfs4_init_nonuniform_client_string(const
 				rpc_peeraddr2str(clp->cl_rpcclient,
 							RPC_DISPLAY_PROTO));
 	rcu_read_unlock();
+	clp->cl_owner_id = kstrdup(buf, GFP_KERNEL);
 	return result;
 }
 
 static unsigned int
-nfs4_init_uniform_client_string(const struct nfs_client *clp,
+nfs4_init_uniform_client_string(struct nfs_client *clp,
 				char *buf, size_t len)
 {
 	const char *nodename = clp->cl_rpcclient->cl_nodename;
+	unsigned int result;
+
+	if (clp->cl_owner_id != NULL)
+		return strlcpy(buf, clp->cl_owner_id, len);
 
 	if (nfs4_client_id_uniquifier[0] != '\0')
-		return scnprintf(buf, len, "Linux NFSv%u.%u %s/%s",
+		result = scnprintf(buf, len, "Linux NFSv%u.%u %s/%s",
 				clp->rpc_ops->version,
 				clp->cl_minorversion,
 				nfs4_client_id_uniquifier,
 				nodename);
-	return scnprintf(buf, len, "Linux NFSv%u.%u %s",
+	else
+		result = scnprintf(buf, len, "Linux NFSv%u.%u %s",
 				clp->rpc_ops->version, clp->cl_minorversion,
 				nodename);
+	clp->cl_owner_id = kstrdup(buf, GFP_KERNEL);
+	return result;
 }
 
 /*
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/ocfs2/alloc.c linux-libre-3.18.125-gnu/fs/ocfs2/alloc.c
--- linux-libre-3.18.124-gnu/fs/ocfs2/alloc.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/ocfs2/alloc.c	2018-11-10 10:39:23.000000000 -0500
@@ -6871,7 +6871,7 @@ int ocfs2_convert_inline_data_to_extents
 	if (IS_ERR(handle)) {
 		ret = PTR_ERR(handle);
 		mlog_errno(ret);
-		goto out_unlock;
+		goto out;
 	}
 
 	ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), di_bh,
@@ -6929,7 +6929,7 @@ int ocfs2_convert_inline_data_to_extents
 		if (ret) {
 			mlog_errno(ret);
 			need_free = 1;
-			goto out_commit;
+			goto out_unlock;
 		}
 
 		page_end = PAGE_CACHE_SIZE;
@@ -6962,12 +6962,16 @@ int ocfs2_convert_inline_data_to_extents
 		if (ret) {
 			mlog_errno(ret);
 			need_free = 1;
-			goto out_commit;
+			goto out_unlock;
 		}
 
 		inode->i_blocks = ocfs2_inode_sector_count(inode);
 	}
 
+out_unlock:
+	if (pages)
+		ocfs2_unlock_and_free_pages(pages, num_pages);
+
 out_commit:
 	if (ret < 0 && did_quota)
 		dquot_free_space_nodirty(inode,
@@ -6987,15 +6991,11 @@ out_commit:
 
 	ocfs2_commit_trans(osb, handle);
 
-out_unlock:
+out:
 	if (data_ac)
 		ocfs2_free_alloc_context(data_ac);
-
-out:
-	if (pages) {
-		ocfs2_unlock_and_free_pages(pages, num_pages);
+	if (pages)
 		kfree(pages);
-	}
 
 	return ret;
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/overlayfs/inode.c linux-libre-3.18.125-gnu/fs/overlayfs/inode.c
--- linux-libre-3.18.124-gnu/fs/overlayfs/inode.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/overlayfs/inode.c	2018-11-10 10:39:23.000000000 -0500
@@ -377,6 +377,9 @@ struct inode *ovl_d_select_inode(struct
 		ovl_path_upper(dentry, &realpath);
 	}
 
+	if (realpath.dentry->d_flags & DCACHE_OP_SELECT_INODE)
+		return realpath.dentry->d_op->d_select_inode(realpath.dentry, file_flags);
+
 	return d_backing_inode(realpath.dentry);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/quota/quota_v2.c linux-libre-3.18.125-gnu/fs/quota/quota_v2.c
--- linux-libre-3.18.124-gnu/fs/quota/quota_v2.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/quota/quota_v2.c	2018-11-10 10:39:23.000000000 -0500
@@ -117,12 +117,16 @@ static int v2_read_file_info(struct supe
 	qinfo = info->dqi_priv;
 	if (version == 0) {
 		/* limits are stored as unsigned 32-bit data */
-		info->dqi_max_spc_limit = 0xffffffffULL << QUOTABLOCK_BITS;
+		info->dqi_max_spc_limit = 0xffffffffLL << QUOTABLOCK_BITS;
 		info->dqi_max_ino_limit = 0xffffffff;
 	} else {
-		/* used space is stored as unsigned 64-bit value in bytes */
-		info->dqi_max_spc_limit = 0xffffffffffffffffULL; /* 2^64-1 */
-		info->dqi_max_ino_limit = 0xffffffffffffffffULL;
+		/*
+		 * Used space is stored as unsigned 64-bit value in bytes but
+		 * quota core supports only signed 64-bit values so use that
+		 * as a limit
+		 */
+		info->dqi_max_spc_limit = 0x7fffffffffffffffLL; /* 2^63-1 */
+		info->dqi_max_ino_limit = 0x7fffffffffffffffLL;
 	}
 	info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace);
 	info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/fs/splice.c linux-libre-3.18.125-gnu/fs/splice.c
--- linux-libre-3.18.124-gnu/fs/splice.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/fs/splice.c	2018-11-10 10:39:23.000000000 -0500
@@ -809,6 +809,13 @@ static int splice_from_pipe_feed(struct
  */
 static int splice_from_pipe_next(struct pipe_inode_info *pipe, struct splice_desc *sd)
 {
+	/*
+	 * Check for signal early to make process killable when there are
+	 * always buffers available
+	 */
+	if (signal_pending(current))
+		return -ERESTARTSYS;
+
 	while (!pipe->nrbufs) {
 		if (!pipe->writers)
 			return 0;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/compiler-gcc.h linux-libre-3.18.125-gnu/include/linux/compiler-gcc.h
--- linux-libre-3.18.124-gnu/include/linux/compiler-gcc.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/compiler-gcc.h	2018-11-10 10:39:23.000000000 -0500
@@ -9,10 +9,24 @@
 		   + __GNUC_MINOR__ * 100 \
 		   + __GNUC_PATCHLEVEL__)
 
-
 /* Optimization barrier */
+
 /* The "volatile" is due to gcc bugs */
 #define barrier() __asm__ __volatile__("": : :"memory")
+/*
+ * This version is i.e. to prevent dead stores elimination on @ptr
+ * where gcc and llvm may behave differently when otherwise using
+ * normal barrier(): while gcc behavior gets along with a normal
+ * barrier(), llvm needs an explicit input variable to be assumed
+ * clobbered. The issue is as follows: while the inline asm might
+ * access any memory it wants, the compiler could have fit all of
+ * @ptr into memory registers instead, and since @ptr never escaped
+ * from that, it proofed that the inline asm wasn't touching any of
+ * it. This version works well with both compilers, i.e. we're telling
+ * the compiler that the inline asm absolutely may see the contents
+ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
+ */
+#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
 
 /*
  * This macro obfuscates arithmetic on a variable address so that gcc
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/compiler.h linux-libre-3.18.125-gnu/include/linux/compiler.h
--- linux-libre-3.18.124-gnu/include/linux/compiler.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/compiler.h	2018-11-10 10:39:23.000000000 -0500
@@ -165,6 +165,10 @@ void ftrace_likely_update(struct ftrace_
 # define barrier() __memory_barrier()
 #endif
 
+#ifndef barrier_data
+# define barrier_data(ptr) barrier()
+#endif
+
 /* Unreachable code */
 #ifndef unreachable
 # define unreachable() do { } while (1)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/compiler-intel.h linux-libre-3.18.125-gnu/include/linux/compiler-intel.h
--- linux-libre-3.18.124-gnu/include/linux/compiler-intel.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/compiler-intel.h	2018-11-10 10:39:23.000000000 -0500
@@ -13,9 +13,12 @@
 /* Intel ECC compiler doesn't support gcc specific asm stmts.
  * It uses intrinsics to do the equivalent things.
  */
+#undef barrier_data
 #undef RELOC_HIDE
 #undef OPTIMIZER_HIDE_VAR
 
+#define barrier_data(ptr) barrier()
+
 #define RELOC_HIDE(ptr, off)					\
   ({ unsigned long __ptr;					\
      __ptr = (unsigned long) (ptr);				\
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/nfs_fs_sb.h linux-libre-3.18.125-gnu/include/linux/nfs_fs_sb.h
--- linux-libre-3.18.124-gnu/include/linux/nfs_fs_sb.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/nfs_fs_sb.h	2018-11-10 10:39:23.000000000 -0500
@@ -74,6 +74,9 @@ struct nfs_client {
 	/* idmapper */
 	struct idmap *		cl_idmap;
 
+	/* Client owner identifier */
+	const char *		cl_owner_id;
+
 	/* Our own IP address, as a null-terminated string.
 	 * This is used to generate the mv0 callback address.
 	 */
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/phy/omap_control_phy.h linux-libre-3.18.125-gnu/include/linux/phy/omap_control_phy.h
--- linux-libre-3.18.124-gnu/include/linux/phy/omap_control_phy.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/phy/omap_control_phy.h	2018-11-10 10:39:23.000000000 -0500
@@ -66,7 +66,7 @@ enum omap_control_usb_mode {
 #define	OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF	0x0
 
 #define	OMAP_CTRL_PCIE_PCS_MASK			0xff
-#define	OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT	0x8
+#define	OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT	16
 
 #define OMAP_CTRL_USB2_PHY_PD		BIT(28)
 
@@ -79,7 +79,7 @@ enum omap_control_usb_mode {
 void omap_control_phy_power(struct device *dev, int on);
 void omap_control_usb_set_mode(struct device *dev,
 			       enum omap_control_usb_mode mode);
-void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay);
+void omap_control_pcie_pcs(struct device *dev, u8 delay);
 #else
 
 static inline void omap_control_phy_power(struct device *dev, int on)
@@ -91,7 +91,7 @@ static inline void omap_control_usb_set_
 {
 }
 
-static inline void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay)
+static inline void omap_control_pcie_pcs(struct device *dev, u8 delay)
 {
 }
 #endif
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/linux/tty.h linux-libre-3.18.125-gnu/include/linux/tty.h
--- linux-libre-3.18.124-gnu/include/linux/tty.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/linux/tty.h	2018-11-10 10:39:23.000000000 -0500
@@ -587,7 +587,7 @@ extern void n_tty_inherit_ops(struct tty
 
 /* tty_audit.c */
 #ifdef CONFIG_AUDIT
-extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
+extern void tty_audit_add_data(struct tty_struct *tty, const void *data,
 			       size_t size, unsigned icanon);
 extern void tty_audit_exit(void);
 extern void tty_audit_fork(struct signal_struct *sig);
@@ -595,8 +595,8 @@ extern void tty_audit_tiocsti(struct tty
 extern void tty_audit_push(struct tty_struct *tty);
 extern int tty_audit_push_current(void);
 #else
-static inline void tty_audit_add_data(struct tty_struct *tty,
-		unsigned char *data, size_t size, unsigned icanon)
+static inline void tty_audit_add_data(struct tty_struct *tty, const void *data,
+				      size_t size, unsigned icanon)
 {
 }
 static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/net/af_unix.h linux-libre-3.18.125-gnu/include/net/af_unix.h
--- linux-libre-3.18.124-gnu/include/net/af_unix.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/net/af_unix.h	2018-11-10 10:39:23.000000000 -0500
@@ -6,8 +6,8 @@
 #include <linux/mutex.h>
 #include <net/sock.h>
 
-void unix_inflight(struct file *fp);
-void unix_notinflight(struct file *fp);
+void unix_inflight(struct user_struct *user, struct file *fp);
+void unix_notinflight(struct user_struct *user, struct file *fp);
 void unix_gc(void);
 void wait_for_unix_gc(void);
 struct sock *unix_get_socket(struct file *filp);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/net/scm.h linux-libre-3.18.125-gnu/include/net/scm.h
--- linux-libre-3.18.124-gnu/include/net/scm.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/net/scm.h	2018-11-10 10:39:23.000000000 -0500
@@ -21,6 +21,7 @@ struct scm_creds {
 struct scm_fp_list {
 	short			count;
 	short			max;
+	struct user_struct	*user;
 	struct file		*fp[SCM_MAX_FD];
 };
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/include/net/sock.h linux-libre-3.18.125-gnu/include/net/sock.h
--- linux-libre-3.18.124-gnu/include/net/sock.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/include/net/sock.h	2018-11-10 10:39:23.000000000 -0500
@@ -379,8 +379,8 @@ struct sock {
 				sk_no_check_rx : 1,
 				sk_userlocks : 4,
 				sk_protocol  : 8,
-#define SK_PROTOCOL_MAX U8_MAX
 				sk_type      : 16;
+#define SK_PROTOCOL_MAX U8_MAX
 	kmemcheck_bitfield_end(flags);
 	int			sk_wmem_queued;
 	gfp_t			sk_allocation;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/events/core.c linux-libre-3.18.125-gnu/kernel/events/core.c
--- linux-libre-3.18.124-gnu/kernel/events/core.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/events/core.c	2018-11-10 10:39:23.000000000 -0500
@@ -3929,7 +3929,14 @@ retry:
 		goto retry;
 	}
 
-	__perf_event_period(&pe);
+	if (event->attr.freq) {
+		event->attr.sample_freq = value;
+	} else {
+		event->attr.sample_period = value;
+		event->hw.sample_period = value;
+	}
+
+	local64_set(&event->hw.period_left, 0);
 	raw_spin_unlock_irq(&ctx->lock);
 
 	return 0;
@@ -6351,6 +6358,8 @@ void perf_tp_event(u64 addr, u64 count,
 			goto unlock;
 
 		list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
+			if (event->cpu != smp_processor_id())
+				continue;
 			if (event->attr.type != PERF_TYPE_TRACEPOINT)
 				continue;
 			if (event->attr.config != entry->type)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/rcu/tree_plugin.h linux-libre-3.18.125-gnu/kernel/rcu/tree_plugin.h
--- linux-libre-3.18.124-gnu/kernel/rcu/tree_plugin.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/rcu/tree_plugin.h	2018-11-10 10:39:23.000000000 -0500
@@ -328,6 +328,7 @@ void rcu_read_unlock_special(struct task
 	special = t->rcu_read_unlock_special;
 	if (special.b.need_qs) {
 		rcu_preempt_qs();
+		t->rcu_read_unlock_special.b.need_qs = false;
 		if (!t->rcu_read_unlock_special.s) {
 			local_irq_restore(flags);
 			return;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/resource.c linux-libre-3.18.125-gnu/kernel/resource.c
--- linux-libre-3.18.124-gnu/kernel/resource.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/resource.c	2018-11-10 10:39:23.000000000 -0500
@@ -104,16 +104,25 @@ static int r_show(struct seq_file *m, vo
 {
 	struct resource *root = m->private;
 	struct resource *r = v, *p;
+	unsigned long long start, end;
 	int width = root->end < 0x10000 ? 4 : 8;
 	int depth;
 
 	for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent)
 		if (p->parent == root)
 			break;
+
+	if (file_ns_capable(m->file, &init_user_ns, CAP_SYS_ADMIN)) {
+		start = r->start;
+		end = r->end;
+	} else {
+		start = end = 0;
+	}
+
 	seq_printf(m, "%*s%0*llx-%0*llx : %s\n",
 			depth * 2, "",
-			width, (unsigned long long) r->start,
-			width, (unsigned long long) r->end,
+			width, start,
+			width, end,
 			r->name ? r->name : "<BAD>");
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/sched/fair.c linux-libre-3.18.125-gnu/kernel/sched/fair.c
--- linux-libre-3.18.124-gnu/kernel/sched/fair.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/sched/fair.c	2018-11-10 10:39:23.000000000 -0500
@@ -3416,9 +3416,14 @@ static void throttle_cfs_rq(struct cfs_r
 	raw_spin_lock(&cfs_b->lock);
 	/*
 	 * Add to the _head_ of the list, so that an already-started
-	 * distribute_cfs_runtime will not see us
+	 * distribute_cfs_runtime will not see us. If disribute_cfs_runtime is
+	 * not running add to the tail so that later runqueues don't get starved.
 	 */
-	list_add_rcu(&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq);
+	if (cfs_b->distribute_running)
+		list_add_rcu(&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq);
+	else
+		list_add_tail_rcu(&cfs_rq->throttled_list, &cfs_b->throttled_cfs_rq);
+
 	if (!cfs_b->timer_active)
 		__start_cfs_bandwidth(cfs_b, false);
 	raw_spin_unlock(&cfs_b->lock);
@@ -3562,14 +3567,16 @@ static int do_sched_cfs_period_timer(str
 	 * in us over-using our runtime if it is all used during this loop, but
 	 * only by limited amounts in that extreme case.
 	 */
-	while (throttled && cfs_b->runtime > 0) {
+	while (throttled && cfs_b->runtime > 0 && !cfs_b->distribute_running) {
 		runtime = cfs_b->runtime;
+		cfs_b->distribute_running = 1;
 		raw_spin_unlock(&cfs_b->lock);
 		/* we can't nest cfs_b->lock while distributing bandwidth */
 		runtime = distribute_cfs_runtime(cfs_b, runtime,
 						 runtime_expires);
 		raw_spin_lock(&cfs_b->lock);
 
+		cfs_b->distribute_running = 0;
 		throttled = !list_empty(&cfs_b->throttled_cfs_rq);
 
 		cfs_b->runtime -= min(runtime, cfs_b->runtime);
@@ -3680,6 +3687,11 @@ static void do_sched_cfs_slack_timer(str
 
 	/* confirm we're still not at a refresh boundary */
 	raw_spin_lock(&cfs_b->lock);
+	if (cfs_b->distribute_running) {
+		raw_spin_unlock(&cfs_b->lock);
+		return;
+	}
+
 	if (runtime_refresh_within(cfs_b, min_bandwidth_expiration)) {
 		raw_spin_unlock(&cfs_b->lock);
 		return;
@@ -3689,6 +3701,9 @@ static void do_sched_cfs_slack_timer(str
 		runtime = cfs_b->runtime;
 
 	expires = cfs_b->runtime_expires;
+	if (runtime)
+		cfs_b->distribute_running = 1;
+
 	raw_spin_unlock(&cfs_b->lock);
 
 	if (!runtime)
@@ -3699,6 +3714,7 @@ static void do_sched_cfs_slack_timer(str
 	raw_spin_lock(&cfs_b->lock);
 	if (expires == cfs_b->runtime_expires)
 		cfs_b->runtime -= min(runtime, cfs_b->runtime);
+	cfs_b->distribute_running = 0;
 	raw_spin_unlock(&cfs_b->lock);
 }
 
@@ -3790,6 +3806,7 @@ void init_cfs_bandwidth(struct cfs_bandw
 	cfs_b->period_timer.function = sched_cfs_period_timer;
 	hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	cfs_b->slack_timer.function = sched_cfs_slack_timer;
+	cfs_b->distribute_running = 0;
 }
 
 static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/sched/sched.h linux-libre-3.18.125-gnu/kernel/sched/sched.h
--- linux-libre-3.18.124-gnu/kernel/sched/sched.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/sched/sched.h	2018-11-10 10:39:23.000000000 -0500
@@ -202,6 +202,8 @@ struct cfs_bandwidth {
 	/* statistics */
 	int nr_periods, nr_throttled;
 	u64 throttled_time;
+
+	bool distribute_running;
 #endif
 };
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/kernel/trace/trace_events.c linux-libre-3.18.125-gnu/kernel/trace/trace_events.c
--- linux-libre-3.18.124-gnu/kernel/trace/trace_events.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/kernel/trace/trace_events.c	2018-11-10 10:39:23.000000000 -0500
@@ -2400,12 +2400,39 @@ static __init int event_trace_memsetup(v
 	return 0;
 }
 
+static __init void
+early_enable_events(struct trace_array *tr, bool disable_first)
+{
+	char *buf = bootup_event_buf;
+	char *token;
+	int ret;
+
+	while (true) {
+		token = strsep(&buf, ",");
+
+		if (!token)
+			break;
+		if (!*token)
+			continue;
+
+		/* Restarting syscalls requires that we stop them first */
+		if (disable_first)
+			ftrace_set_clr_event(tr, token, 0);
+
+		ret = ftrace_set_clr_event(tr, token, 1);
+		if (ret)
+			pr_warn("Failed to enable trace event: %s\n", token);
+
+		/* Put back the comma to allow this to be called again */
+		if (buf)
+			*(buf - 1) = ',';
+	}
+}
+
 static __init int event_trace_enable(void)
 {
 	struct trace_array *tr = top_trace_array();
 	struct ftrace_event_call **iter, *call;
-	char *buf = bootup_event_buf;
-	char *token;
 	int ret;
 
 	if (!tr)
@@ -2427,18 +2454,7 @@ static __init int event_trace_enable(voi
 	 */
 	__trace_early_add_events(tr);
 
-	while (true) {
-		token = strsep(&buf, ",");
-
-		if (!token)
-			break;
-		if (!*token)
-			continue;
-
-		ret = ftrace_set_clr_event(tr, token, 1);
-		if (ret)
-			pr_warn("Failed to enable trace event: %s\n", token);
-	}
+	early_enable_events(tr, false);
 
 	trace_printk_start_comm();
 
@@ -2449,6 +2465,31 @@ static __init int event_trace_enable(voi
 	return 0;
 }
 
+/*
+ * event_trace_enable() is called from trace_event_init() first to
+ * initialize events and perhaps start any events that are on the
+ * command line. Unfortunately, there are some events that will not
+ * start this early, like the system call tracepoints that need
+ * to set the TIF_SYSCALL_TRACEPOINT flag of pid 1. But event_trace_enable()
+ * is called before pid 1 starts, and this flag is never set, making
+ * the syscall tracepoint never get reached, but the event is enabled
+ * regardless (and not doing anything).
+ */
+static __init int event_trace_enable_again(void)
+{
+	struct trace_array *tr;
+
+	tr = top_trace_array();
+	if (!tr)
+		return -ENODEV;
+
+	early_enable_events(tr, true);
+
+	return 0;
+}
+
+early_initcall(event_trace_enable_again);
+
 static __init int event_trace_init(void)
 {
 	struct trace_array *tr;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/lib/string.c linux-libre-3.18.125-gnu/lib/string.c
--- linux-libre-3.18.124-gnu/lib/string.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/lib/string.c	2018-11-10 10:39:23.000000000 -0500
@@ -699,7 +699,7 @@ EXPORT_SYMBOL(memset);
 void memzero_explicit(void *s, size_t count)
 {
 	memset(s, 0, count);
-	barrier();
+	barrier_data(s);
 }
 EXPORT_SYMBOL(memzero_explicit);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/Makefile linux-libre-3.18.125-gnu/Makefile
--- linux-libre-3.18.124-gnu/Makefile	2018-10-13 21:41:30.000000000 -0400
+++ linux-libre-3.18.125-gnu/Makefile	2018-11-10 15:35:24.000000000 -0500
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 124
+SUBLEVEL = 125
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/mm/huge_memory.c linux-libre-3.18.125-gnu/mm/huge_memory.c
--- linux-libre-3.18.124-gnu/mm/huge_memory.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/mm/huge_memory.c	2018-11-10 10:39:23.000000000 -0500
@@ -1462,7 +1462,7 @@ int move_huge_pmd(struct vm_area_struct
 	spinlock_t *old_ptl, *new_ptl;
 	int ret = 0;
 	pmd_t pmd;
-
+	bool force_flush = false;
 	struct mm_struct *mm = vma->vm_mm;
 
 	if ((old_addr & ~HPAGE_PMD_MASK) ||
@@ -1490,6 +1490,8 @@ int move_huge_pmd(struct vm_area_struct
 		if (new_ptl != old_ptl)
 			spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
 		pmd = pmdp_get_and_clear(mm, old_addr, old_pmd);
+		if (pmd_present(pmd))
+			force_flush = true;
 		VM_BUG_ON(!pmd_none(*new_pmd));
 
 		if (pmd_move_must_withdraw(new_ptl, old_ptl)) {
@@ -1498,6 +1500,8 @@ int move_huge_pmd(struct vm_area_struct
 			pgtable_trans_huge_deposit(mm, new_pmd, pgtable);
 		}
 		set_pmd_at(mm, new_addr, new_pmd, pmd_mksoft_dirty(pmd));
+		if (force_flush)
+			flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE);
 		if (new_ptl != old_ptl)
 			spin_unlock(new_ptl);
 		spin_unlock(old_ptl);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/mm/migrate.c linux-libre-3.18.125-gnu/mm/migrate.c
--- linux-libre-3.18.124-gnu/mm/migrate.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/mm/migrate.c	2018-11-10 10:39:23.000000000 -0500
@@ -1077,7 +1077,7 @@ out:
 	if (rc != MIGRATEPAGE_SUCCESS && put_new_page)
 		put_new_page(new_hpage, private);
 	else
-		put_page(new_hpage);
+		putback_active_hugepage(new_hpage);
 
 	if (result) {
 		if (rc)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/mm/mremap.c linux-libre-3.18.125-gnu/mm/mremap.c
--- linux-libre-3.18.124-gnu/mm/mremap.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/mm/mremap.c	2018-11-10 10:39:23.000000000 -0500
@@ -97,6 +97,8 @@ static void move_ptes(struct vm_area_str
 	struct mm_struct *mm = vma->vm_mm;
 	pte_t *old_pte, *new_pte, pte;
 	spinlock_t *old_ptl, *new_ptl;
+	bool force_flush = false;
+	unsigned long len = old_end - old_addr;
 
 	/*
 	 * When need_rmap_locks is true, we take the i_mmap_mutex and anon_vma
@@ -143,12 +145,26 @@ static void move_ptes(struct vm_area_str
 		if (pte_none(*old_pte))
 			continue;
 		pte = ptep_get_and_clear(mm, old_addr, old_pte);
+		/*
+		 * If we are remapping a valid PTE, make sure
+		 * to flush TLB before we drop the PTL for the PTE.
+		 *
+		 * NOTE! Both old and new PTL matter: the old one
+		 * for racing with page_mkclean(), the new one to
+		 * make sure the physical page stays valid until
+		 * the TLB entry for the old mapping has been
+		 * flushed.
+		 */
+		if (pte_present(pte))
+			force_flush = true;
 		pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr);
 		pte = move_soft_dirty_pte(pte);
 		set_pte_at(mm, new_addr, new_pte, pte);
 	}
 
 	arch_leave_lazy_mmu_mode();
+	if (force_flush)
+		flush_tlb_range(vma, old_end - len, old_end);
 	if (new_ptl != old_ptl)
 		spin_unlock(new_ptl);
 	pte_unmap(new_pte - 1);
@@ -168,7 +184,6 @@ unsigned long move_page_tables(struct vm
 {
 	unsigned long extent, next, old_end;
 	pmd_t *old_pmd, *new_pmd;
-	bool need_flush = false;
 	unsigned long mmun_start;	/* For mmu_notifiers */
 	unsigned long mmun_end;		/* For mmu_notifiers */
 
@@ -207,7 +222,6 @@ unsigned long move_page_tables(struct vm
 					anon_vma_unlock_write(vma->anon_vma);
 			}
 			if (err > 0) {
-				need_flush = true;
 				continue;
 			} else if (!err) {
 				split_huge_page_pmd(vma, old_addr, old_pmd);
@@ -224,10 +238,7 @@ unsigned long move_page_tables(struct vm
 			extent = LATENCY_LIMIT;
 		move_ptes(vma, old_pmd, old_addr, old_addr + extent,
 			  new_vma, new_pmd, new_addr, need_rmap_locks);
-		need_flush = true;
 	}
-	if (likely(need_flush))
-		flush_tlb_range(vma, old_end-len, old_addr);
 
 	mmu_notifier_invalidate_range_end(vma->vm_mm, mmun_start, mmun_end);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/core/rtnetlink.c linux-libre-3.18.125-gnu/net/core/rtnetlink.c
--- linux-libre-3.18.124-gnu/net/core/rtnetlink.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/core/rtnetlink.c	2018-11-10 10:39:23.000000000 -0500
@@ -817,8 +817,6 @@ static size_t rtnl_port_size(const struc
 {
 	size_t port_size = nla_total_size(4)		/* PORT_VF */
 		+ nla_total_size(PORT_PROFILE_MAX)	/* PORT_PROFILE */
-		+ nla_total_size(sizeof(struct ifla_port_vsi))
-							/* PORT_VSI_TYPE */
 		+ nla_total_size(PORT_UUID_MAX)		/* PORT_INSTANCE_UUID */
 		+ nla_total_size(PORT_UUID_MAX)		/* PORT_HOST_UUID */
 		+ nla_total_size(1)			/* PROT_VDP_REQUEST */
@@ -1231,14 +1229,19 @@ static const struct nla_policy ifla_port
 	[IFLA_PORT_VF]		= { .type = NLA_U32 },
 	[IFLA_PORT_PROFILE]	= { .type = NLA_STRING,
 				    .len = PORT_PROFILE_MAX },
-	[IFLA_PORT_VSI_TYPE]	= { .type = NLA_BINARY,
-				    .len = sizeof(struct ifla_port_vsi)},
 	[IFLA_PORT_INSTANCE_UUID] = { .type = NLA_BINARY,
 				      .len = PORT_UUID_MAX },
 	[IFLA_PORT_HOST_UUID]	= { .type = NLA_STRING,
 				    .len = PORT_UUID_MAX },
 	[IFLA_PORT_REQUEST]	= { .type = NLA_U8, },
 	[IFLA_PORT_RESPONSE]	= { .type = NLA_U16, },
+
+	/* Unused, but we need to keep it here since user space could
+	 * fill it. It's also broken with regard to NLA_BINARY use in
+	 * combination with structs.
+	 */
+	[IFLA_PORT_VSI_TYPE]	= { .type = NLA_BINARY,
+				    .len = sizeof(struct ifla_port_vsi) },
 };
 
 static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
@@ -1871,6 +1874,12 @@ struct net_device *rtnl_create_link(stru
 	else if (ops->get_num_rx_queues)
 		num_rx_queues = ops->get_num_rx_queues();
 
+	if (num_tx_queues < 1 || num_tx_queues > 4096)
+		return ERR_PTR(-EINVAL);
+
+	if (num_rx_queues < 1 || num_rx_queues > 4096)
+		return ERR_PTR(-EINVAL);
+
 	err = -ENOMEM;
 	dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type,
 			       ops->setup, num_tx_queues, num_rx_queues);
@@ -2400,6 +2409,11 @@ static int rtnl_fdb_add(struct sk_buff *
 		return -EINVAL;
 	}
 
+	if (dev->type != ARPHRD_ETHER) {
+		pr_info("PF_BRIDGE: FDB add only supported for Ethernet devices");
+		return -EINVAL;
+	}
+
 	addr = nla_data(tb[NDA_LLADDR]);
 
 	err = -EOPNOTSUPP;
@@ -2495,6 +2509,11 @@ static int rtnl_fdb_del(struct sk_buff *
 		return -EINVAL;
 	}
 
+	if (dev->type != ARPHRD_ETHER) {
+		pr_info("PF_BRIDGE: FDB delete only supported for Ethernet devices");
+		return -EINVAL;
+	}
+
 	addr = nla_data(tb[NDA_LLADDR]);
 
 	err = -EOPNOTSUPP;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/core/scm.c linux-libre-3.18.125-gnu/net/core/scm.c
--- linux-libre-3.18.124-gnu/net/core/scm.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/core/scm.c	2018-11-10 10:39:23.000000000 -0500
@@ -87,6 +87,7 @@ static int scm_fp_copy(struct cmsghdr *c
 		*fplp = fpl;
 		fpl->count = 0;
 		fpl->max = SCM_MAX_FD;
+		fpl->user = NULL;
 	}
 	fpp = &fpl->fp[fpl->count];
 
@@ -107,6 +108,10 @@ static int scm_fp_copy(struct cmsghdr *c
 		*fpp++ = file;
 		fpl->count++;
 	}
+
+	if (!fpl->user)
+		fpl->user = get_uid(current_user());
+
 	return num;
 }
 
@@ -119,6 +124,7 @@ void __scm_destroy(struct scm_cookie *sc
 		scm->fp = NULL;
 		for (i=fpl->count-1; i>=0; i--)
 			fput(fpl->fp[i]);
+		free_uid(fpl->user);
 		kfree(fpl);
 	}
 }
@@ -337,6 +343,7 @@ struct scm_fp_list *scm_fp_dup(struct sc
 		for (i = 0; i < fpl->count; i++)
 			get_file(fpl->fp[i]);
 		new_fpl->max = new_fpl->count;
+		new_fpl->user = get_uid(fpl->user);
 	}
 	return new_fpl;
 }
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv4/ip_fragment.c linux-libre-3.18.125-gnu/net/ipv4/ip_fragment.c
--- linux-libre-3.18.124-gnu/net/ipv4/ip_fragment.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv4/ip_fragment.c	2018-11-10 10:39:23.000000000 -0500
@@ -684,10 +684,14 @@ struct sk_buff *ip_check_defrag(struct s
 	if (ip_is_fragment(&iph)) {
 		skb = skb_share_check(skb, GFP_ATOMIC);
 		if (skb) {
-			if (!pskb_may_pull(skb, netoff + iph.ihl * 4))
-				return skb;
-			if (pskb_trim_rcsum(skb, netoff + len))
-				return skb;
+			if (!pskb_may_pull(skb, netoff + iph.ihl * 4)) {
+				kfree_skb(skb);
+				return NULL;
+			}
+			if (pskb_trim_rcsum(skb, netoff + len)) {
+				kfree_skb(skb);
+				return NULL;
+			}
 			memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
 			if (ip_defrag(skb, user))
 				return NULL;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv4/ip_tunnel.c linux-libre-3.18.125-gnu/net/ipv4/ip_tunnel.c
--- linux-libre-3.18.124-gnu/net/ipv4/ip_tunnel.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv4/ip_tunnel.c	2018-11-10 10:39:23.000000000 -0500
@@ -641,6 +641,7 @@ void ip_tunnel_xmit(struct sk_buff *skb,
 		    const struct iphdr *tnl_params, u8 protocol)
 {
 	struct ip_tunnel *tunnel = netdev_priv(dev);
+	unsigned int inner_nhdr_len = 0;
 	const struct iphdr *inner_iph;
 	struct flowi4 fl4;
 	u8     tos, ttl;
@@ -651,6 +652,14 @@ void ip_tunnel_xmit(struct sk_buff *skb,
 	int err;
 	bool connected;
 
+	/* ensure we can access the inner net header, for several users below */
+	if (skb->protocol == htons(ETH_P_IP))
+		inner_nhdr_len = sizeof(struct iphdr);
+	else if (skb->protocol == htons(ETH_P_IPV6))
+		inner_nhdr_len = sizeof(struct ipv6hdr);
+	if (unlikely(!pskb_may_pull(skb, inner_nhdr_len)))
+		goto tx_error;
+
 	inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
 	connected = (tunnel->parms.iph.daddr != 0);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv6/addrconf.c linux-libre-3.18.125-gnu/net/ipv6/addrconf.c
--- linux-libre-3.18.124-gnu/net/ipv6/addrconf.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv6/addrconf.c	2018-11-10 10:39:23.000000000 -0500
@@ -3448,7 +3448,6 @@ static struct inet6_ifaddr *if6_get_firs
 				p++;
 				continue;
 			}
-			state->offset++;
 			return ifa;
 		}
 
@@ -3472,13 +3471,12 @@ static struct inet6_ifaddr *if6_get_next
 		return ifa;
 	}
 
+	state->offset = 0;
 	while (++state->bucket < IN6_ADDR_HSIZE) {
-		state->offset = 0;
 		hlist_for_each_entry_rcu_bh(ifa,
 				     &inet6_addr_lst[state->bucket], addr_lst) {
 			if (!net_eq(dev_net(ifa->idev->dev), net))
 				continue;
-			state->offset++;
 			return ifa;
 		}
 	}
@@ -4100,8 +4098,8 @@ static int in6_dump_addrs(struct inet6_d
 
 		/* unicast address incl. temp addr */
 		list_for_each_entry(ifa, &idev->addr_list, if_list) {
-			if (++ip_idx < s_ip_idx)
-				continue;
+			if (ip_idx < s_ip_idx)
+				goto next;
 			err = inet6_fill_ifaddr(skb, ifa,
 						NETLINK_CB(cb->skb).portid,
 						cb->nlh->nlmsg_seq,
@@ -4110,6 +4108,8 @@ static int in6_dump_addrs(struct inet6_d
 			if (err <= 0)
 				break;
 			nl_dump_check_consistent(cb, nlmsg_hdr(skb));
+next:
+			ip_idx++;
 		}
 		break;
 	}
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv6/ip6_tunnel.c linux-libre-3.18.125-gnu/net/ipv6/ip6_tunnel.c
--- linux-libre-3.18.124-gnu/net/ipv6/ip6_tunnel.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv6/ip6_tunnel.c	2018-11-10 10:39:23.000000000 -0500
@@ -1083,13 +1083,19 @@ static inline int
 ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ip6_tnl *t = netdev_priv(dev);
-	const struct iphdr  *iph = ip_hdr(skb);
+	const struct iphdr  *iph;
 	int encap_limit = -1;
 	struct flowi6 fl6;
 	__u8 dsfield;
 	__u32 mtu;
 	int err;
 
+	/* ensure we can access the full inner ip header */
+	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
+		return -1;
+
+	iph = ip_hdr(skb);
+
 	if ((t->parms.proto != IPPROTO_IPIP && t->parms.proto != 0) ||
 	    !ip6_tnl_xmit_ctl(t))
 		return -1;
@@ -1124,7 +1130,7 @@ static inline int
 ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ip6_tnl *t = netdev_priv(dev);
-	struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+	struct ipv6hdr *ipv6h;
 	int encap_limit = -1;
 	__u16 offset;
 	struct flowi6 fl6;
@@ -1132,6 +1138,10 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
 	__u32 mtu;
 	int err;
 
+	if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
+		return -1;
+
+	ipv6h = ipv6_hdr(skb);
 	if ((t->parms.proto != IPPROTO_IPV6 && t->parms.proto != 0) ||
 	    !ip6_tnl_xmit_ctl(t) || ip6_tnl_addr_conflict(t, ipv6h))
 		return -1;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv6/mcast.c linux-libre-3.18.125-gnu/net/ipv6/mcast.c
--- linux-libre-3.18.124-gnu/net/ipv6/mcast.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv6/mcast.c	2018-11-10 10:39:23.000000000 -0500
@@ -2391,17 +2391,17 @@ static int ip6_mc_leave_src(struct sock
 {
 	int err;
 
-	/* callers have the socket lock and rtnl lock
-	 * so no other readers or writers of iml or its sflist
-	 */
+	write_lock_bh(&iml->sflock);
 	if (!iml->sflist) {
 		/* any-source empty exclude case */
-		return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);
+		err = ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);
+	} else {
+		err = ip6_mc_del_src(idev, &iml->addr, iml->sfmode,
+				iml->sflist->sl_count, iml->sflist->sl_addr, 0);
+		sock_kfree_s(sk, iml->sflist, IP6_SFLSIZE(iml->sflist->sl_max));
+		iml->sflist = NULL;
 	}
-	err = ip6_mc_del_src(idev, &iml->addr, iml->sfmode,
-		iml->sflist->sl_count, iml->sflist->sl_addr, 0);
-	sock_kfree_s(sk, iml->sflist, IP6_SFLSIZE(iml->sflist->sl_max));
-	iml->sflist = NULL;
+	write_unlock_bh(&iml->sflock);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv6/ndisc.c linux-libre-3.18.125-gnu/net/ipv6/ndisc.c
--- linux-libre-3.18.124-gnu/net/ipv6/ndisc.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv6/ndisc.c	2018-11-10 10:39:23.000000000 -0500
@@ -1610,10 +1610,9 @@ int ndisc_rcv(struct sk_buff *skb)
 		return 0;
 	}
 
-	memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
-
 	switch (msg->icmph.icmp6_type) {
 	case NDISC_NEIGHBOUR_SOLICITATION:
+		memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
 		ndisc_recv_ns(skb);
 		break;
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/ipv6/xfrm6_output.c linux-libre-3.18.125-gnu/net/ipv6/xfrm6_output.c
--- linux-libre-3.18.124-gnu/net/ipv6/xfrm6_output.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/ipv6/xfrm6_output.c	2018-11-10 10:39:23.000000000 -0500
@@ -151,9 +151,11 @@ static int __xfrm6_output(struct sk_buff
 
 	if (skb->len > mtu && xfrm6_local_dontfrag(skb)) {
 		xfrm6_local_rxpmtu(skb, mtu);
+		kfree_skb(skb);
 		return -EMSGSIZE;
 	} else if (!skb->ignore_df && skb->len > mtu && skb->sk) {
 		xfrm_local_error(skb, mtu);
+		kfree_skb(skb);
 		return -EMSGSIZE;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/netlabel/netlabel_unlabeled.c linux-libre-3.18.125-gnu/net/netlabel/netlabel_unlabeled.c
--- linux-libre-3.18.124-gnu/net/netlabel/netlabel_unlabeled.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/netlabel/netlabel_unlabeled.c	2018-11-10 10:39:23.000000000 -0500
@@ -787,7 +787,8 @@ static int netlbl_unlabel_addrinfo_get(s
 {
 	u32 addr_len;
 
-	if (info->attrs[NLBL_UNLABEL_A_IPV4ADDR]) {
+	if (info->attrs[NLBL_UNLABEL_A_IPV4ADDR] &&
+	    info->attrs[NLBL_UNLABEL_A_IPV4MASK]) {
 		addr_len = nla_len(info->attrs[NLBL_UNLABEL_A_IPV4ADDR]);
 		if (addr_len != sizeof(struct in_addr) &&
 		    addr_len != nla_len(info->attrs[NLBL_UNLABEL_A_IPV4MASK]))
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/sched/sch_gred.c linux-libre-3.18.125-gnu/net/sched/sch_gred.c
--- linux-libre-3.18.124-gnu/net/sched/sch_gred.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/sched/sch_gred.c	2018-11-10 10:39:23.000000000 -0500
@@ -437,7 +437,7 @@ static int gred_change(struct Qdisc *sch
 		return err;
 
 	if (tb[TCA_GRED_PARMS] == NULL && tb[TCA_GRED_STAB] == NULL)
-		return gred_change_table_def(sch, opt);
+		return gred_change_table_def(sch, tb[TCA_GRED_DPS]);
 
 	if (tb[TCA_GRED_PARMS] == NULL ||
 	    tb[TCA_GRED_STAB] == NULL)
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/sctp/socket.c linux-libre-3.18.125-gnu/net/sctp/socket.c
--- linux-libre-3.18.124-gnu/net/sctp/socket.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/sctp/socket.c	2018-11-10 10:39:23.000000000 -0500
@@ -253,11 +253,10 @@ struct sctp_association *sctp_id2assoc(s
 
 	spin_lock_bh(&sctp_assocs_id_lock);
 	asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id);
+	if (asoc && (asoc->base.sk != sk || asoc->base.dead))
+		asoc = NULL;
 	spin_unlock_bh(&sctp_assocs_id_lock);
 
-	if (!asoc || (asoc->base.sk != sk) || asoc->base.dead)
-		return NULL;
-
 	return asoc;
 }
 
@@ -5607,6 +5606,7 @@ static int sctp_getsockopt_hmac_ident(st
 	struct sctp_hmac_algo_param *hmacs;
 	__u16 data_len = 0;
 	u32 num_idents;
+	int i;
 
 	if (!ep->auth_enable)
 		return -EACCES;
@@ -5624,8 +5624,12 @@ static int sctp_getsockopt_hmac_ident(st
 		return -EFAULT;
 	if (put_user(num_idents, &p->shmac_num_idents))
 		return -EFAULT;
-	if (copy_to_user(p->shmac_idents, hmacs->hmac_ids, data_len))
-		return -EFAULT;
+	for (i = 0; i < num_idents; i++) {
+		__u16 hmacid = ntohs(hmacs->hmac_ids[i]);
+
+		if (copy_to_user(&p->shmac_idents[i], &hmacid, sizeof(__u16)))
+			return -EFAULT;
+	}
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/socket.c linux-libre-3.18.125-gnu/net/socket.c
--- linux-libre-3.18.124-gnu/net/socket.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/socket.c	2018-11-10 10:39:23.000000000 -0500
@@ -2918,9 +2918,14 @@ static int ethtool_ioctl(struct net *net
 		    copy_in_user(&rxnfc->fs.ring_cookie,
 				 &compat_rxnfc->fs.ring_cookie,
 				 (void __user *)(&rxnfc->fs.location + 1) -
-				 (void __user *)&rxnfc->fs.ring_cookie) ||
-		    copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
-				 sizeof(rxnfc->rule_cnt)))
+				 (void __user *)&rxnfc->fs.ring_cookie))
+			return -EFAULT;
+		if (ethcmd == ETHTOOL_GRXCLSRLALL) {
+			if (put_user(rule_cnt, &rxnfc->rule_cnt))
+				return -EFAULT;
+		} else if (copy_in_user(&rxnfc->rule_cnt,
+					&compat_rxnfc->rule_cnt,
+					sizeof(rxnfc->rule_cnt)))
 			return -EFAULT;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/unix/af_unix.c linux-libre-3.18.125-gnu/net/unix/af_unix.c
--- linux-libre-3.18.124-gnu/net/unix/af_unix.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/unix/af_unix.c	2018-11-10 10:39:23.000000000 -0500
@@ -1469,7 +1469,7 @@ static void unix_detach_fds(struct scm_c
 	UNIXCB(skb).fp = NULL;
 
 	for (i = scm->fp->count-1; i >= 0; i--)
-		unix_notinflight(scm->fp->fp[i]);
+		unix_notinflight(scm->fp->user, scm->fp->fp[i]);
 }
 
 static void unix_destruct_scm(struct sk_buff *skb)
@@ -1534,7 +1534,7 @@ static int unix_attach_fds(struct scm_co
 		return -ENOMEM;
 
 	for (i = scm->fp->count - 1; i >= 0; i--)
-		unix_inflight(scm->fp->fp[i]);
+		unix_inflight(scm->fp->user, scm->fp->fp[i]);
 	return max_level;
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/unix/garbage.c linux-libre-3.18.125-gnu/net/unix/garbage.c
--- linux-libre-3.18.124-gnu/net/unix/garbage.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/unix/garbage.c	2018-11-10 10:39:23.000000000 -0500
@@ -122,7 +122,7 @@ struct sock *unix_get_socket(struct file
  *	descriptor if it is for an AF_UNIX socket.
  */
 
-void unix_inflight(struct file *fp)
+void unix_inflight(struct user_struct *user, struct file *fp)
 {
 	struct sock *s = unix_get_socket(fp);
 
@@ -139,11 +139,11 @@ void unix_inflight(struct file *fp)
 		}
 		unix_tot_inflight++;
 	}
-	fp->f_cred->user->unix_inflight++;
+	user->unix_inflight++;
 	spin_unlock(&unix_gc_lock);
 }
 
-void unix_notinflight(struct file *fp)
+void unix_notinflight(struct user_struct *user, struct file *fp)
 {
 	struct sock *s = unix_get_socket(fp);
 
@@ -158,7 +158,7 @@ void unix_notinflight(struct file *fp)
 			list_del_init(&u->link);
 		unix_tot_inflight--;
 	}
-	fp->f_cred->user->unix_inflight--;
+	user->unix_inflight--;
 	spin_unlock(&unix_gc_lock);
 }
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/wireless/reg.c linux-libre-3.18.125-gnu/net/wireless/reg.c
--- linux-libre-3.18.124-gnu/net/wireless/reg.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/wireless/reg.c	2018-11-10 10:39:23.000000000 -0500
@@ -2033,6 +2033,7 @@ static int regulatory_hint_core(const ch
 	request->alpha2[0] = alpha2[0];
 	request->alpha2[1] = alpha2[1];
 	request->initiator = NL80211_REGDOM_SET_BY_CORE;
+	request->wiphy_idx = WIPHY_IDX_INVALID;
 
 	queue_regulatory_request(request);
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/net/xfrm/xfrm_user.c linux-libre-3.18.125-gnu/net/xfrm/xfrm_user.c
--- linux-libre-3.18.124-gnu/net/xfrm/xfrm_user.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/net/xfrm/xfrm_user.c	2018-11-10 10:39:23.000000000 -0500
@@ -150,10 +150,16 @@ static int verify_newsa_info(struct xfrm
 	err = -EINVAL;
 	switch (p->family) {
 	case AF_INET:
+		if (p->sel.prefixlen_d > 32 || p->sel.prefixlen_s > 32)
+			goto out;
+
 		break;
 
 	case AF_INET6:
 #if IS_ENABLED(CONFIG_IPV6)
+		if (p->sel.prefixlen_d > 128 || p->sel.prefixlen_s > 128)
+			goto out;
+
 		break;
 #else
 		err = -EAFNOSUPPORT;
@@ -1285,10 +1291,16 @@ static int verify_newpolicy_info(struct
 
 	switch (p->sel.family) {
 	case AF_INET:
+		if (p->sel.prefixlen_d > 32 || p->sel.prefixlen_s > 32)
+			return -EINVAL;
+
 		break;
 
 	case AF_INET6:
 #if IS_ENABLED(CONFIG_IPV6)
+		if (p->sel.prefixlen_d > 128 || p->sel.prefixlen_s > 128)
+			return -EINVAL;
+
 		break;
 #else
 		return  -EAFNOSUPPORT;
@@ -1369,6 +1381,9 @@ static int validate_tmpl(int nr, struct
 		    (ut[i].family != prev_family))
 			return -EINVAL;
 
+		if (ut[i].mode >= XFRM_MODE_MAX)
+			return -EINVAL;
+
 		prev_family = ut[i].family;
 
 		switch (ut[i].family) {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/security/keys/process_keys.c linux-libre-3.18.125-gnu/security/keys/process_keys.c
--- linux-libre-3.18.124-gnu/security/keys/process_keys.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/security/keys/process_keys.c	2018-11-10 10:39:23.000000000 -0500
@@ -808,15 +808,14 @@ long join_session_keyring(const char *na
 		ret = PTR_ERR(keyring);
 		goto error2;
 	} else if (keyring == new->session_keyring) {
-		key_put(keyring);
 		ret = 0;
-		goto error2;
+		goto error3;
 	}
 
 	/* we've got a keyring - now to install it */
 	ret = install_session_keyring_to_cred(new, keyring);
 	if (ret < 0)
-		goto error2;
+		goto error3;
 
 	commit_creds(new);
 	mutex_unlock(&key_session_mutex);
@@ -826,6 +825,8 @@ long join_session_keyring(const char *na
 okay:
 	return ret;
 
+error3:
+	key_put(keyring);
 error2:
 	mutex_unlock(&key_session_mutex);
 error:
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/pci/hda/patch_realtek.c linux-libre-3.18.125-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-3.18.124-gnu/sound/pci/hda/patch_realtek.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/pci/hda/patch_realtek.c	2018-11-10 10:39:23.000000000 -0500
@@ -5185,7 +5185,7 @@ static const struct hda_fixup alc269_fix
 			{ 0x14, 0x90170110 },
 			{ 0x17, 0x40000008 },
 			{ 0x18, 0x411111f0 },
-			{ 0x19, 0x411111f0 },
+			{ 0x19, 0x01a1913c },
 			{ 0x1a, 0x411111f0 },
 			{ 0x1b, 0x411111f0 },
 			{ 0x1d, 0x40f89b2d },
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/soc/soc-dapm.c linux-libre-3.18.125-gnu/sound/soc/soc-dapm.c
--- linux-libre-3.18.124-gnu/sound/soc/soc-dapm.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/soc/soc-dapm.c	2018-11-10 10:39:23.000000000 -0500
@@ -3087,16 +3087,10 @@ snd_soc_dapm_new_control(struct snd_soc_
 	}
 
 	prefix = soc_dapm_prefix(dapm);
-	if (prefix) {
+	if (prefix)
 		w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name);
-		if (widget->sname)
-			w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix,
-					     widget->sname);
-	} else {
+	else
 		w->name = kasprintf(GFP_KERNEL, "%s", widget->name);
-		if (widget->sname)
-			w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname);
-	}
 	if (w->name == NULL) {
 		kfree(w);
 		return NULL;
@@ -3422,7 +3416,7 @@ int snd_soc_dapm_link_dai_widgets(struct
 				break;
 			}
 
-			if (!w->sname || !strstr(w->sname, dai_w->name))
+			if (!w->sname || !strstr(w->sname, dai_w->sname))
 				continue;
 
 			if (dai_w->id == snd_soc_dapm_dai_in) {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/usb/mixer.c linux-libre-3.18.125-gnu/sound/usb/mixer.c
--- linux-libre-3.18.124-gnu/sound/usb/mixer.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/usb/mixer.c	2018-11-10 10:39:23.000000000 -0500
@@ -1347,6 +1347,8 @@ static void build_feature_ctl(struct mix
 		}
 	}
 
+	snd_usb_mixer_fu_apply_quirk(state->mixer, cval, unitid, kctl);
+
 	range = (cval->max - cval->min) / cval->res;
 	/*
 	 * Are there devices with volume range more than 255? I use a bit more
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/usb/mixer_maps.c linux-libre-3.18.125-gnu/sound/usb/mixer_maps.c
--- linux-libre-3.18.124-gnu/sound/usb/mixer_maps.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/usb/mixer_maps.c	2018-11-10 10:39:23.000000000 -0500
@@ -343,13 +343,6 @@ static struct usbmix_name_map bose_compa
 	{ 0 }	/* terminator */
 };
 
-/* Dragonfly DAC 1.2, the dB conversion factor is 1 instead of 256 */
-static struct usbmix_dB_map dragonfly_1_2_dB = {0, 5000};
-static struct usbmix_name_map dragonfly_1_2_map[] = {
-	{ 7, NULL, .dB = &dragonfly_1_2_dB },
-	{ 0 }	/* terminator */
-};
-
 /*
  * Dell usb dock with ALC4020 codec had a firmware problem where it got
  * screwed up when zero volume is passed; just skip it as a workaround
@@ -478,11 +471,6 @@ static struct usbmix_ctl_map usbmix_ctl_
 		.id = USB_ID(0x05a7, 0x1020),
 		.map = bose_companion5_map,
 	},
-	{
-		/* Dragonfly DAC 1.2 */
-		.id = USB_ID(0x21b4, 0x0081),
-		.map = dragonfly_1_2_map,
-	},
 	{ 0 } /* terminator */
 };
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/usb/mixer_quirks.c linux-libre-3.18.125-gnu/sound/usb/mixer_quirks.c
--- linux-libre-3.18.124-gnu/sound/usb/mixer_quirks.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/usb/mixer_quirks.c	2018-11-10 10:39:23.000000000 -0500
@@ -37,6 +37,7 @@
 #include <sound/control.h>
 #include <sound/hwdep.h>
 #include <sound/info.h>
+#include <sound/tlv.h>
 
 #include "usbaudio.h"
 #include "mixer.h"
@@ -1710,4 +1711,40 @@ void snd_usb_mixer_rc_memory_change(stru
 		break;
 	}
 }
+
+static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer,
+					 struct snd_kcontrol *kctl)
+{
+	/* Approximation using 10 ranges based on output measurement on hw v1.2.
+	 * This seems close to the cubic mapping e.g. alsamixer uses. */
+	static const DECLARE_TLV_DB_RANGE(scale,
+		 0,  1, TLV_DB_MINMAX_ITEM(-5300, -4970),
+		 2,  5, TLV_DB_MINMAX_ITEM(-4710, -4160),
+		 6,  7, TLV_DB_MINMAX_ITEM(-3884, -3710),
+		 8, 14, TLV_DB_MINMAX_ITEM(-3443, -2560),
+		15, 16, TLV_DB_MINMAX_ITEM(-2475, -2324),
+		17, 19, TLV_DB_MINMAX_ITEM(-2228, -2031),
+		20, 26, TLV_DB_MINMAX_ITEM(-1910, -1393),
+		27, 31, TLV_DB_MINMAX_ITEM(-1322, -1032),
+		32, 40, TLV_DB_MINMAX_ITEM(-968, -490),
+		41, 50, TLV_DB_MINMAX_ITEM(-441, 0),
+	);
+
+	usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk\n");
+	kctl->tlv.p = scale;
+	kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
+	kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
+}
+
+void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
+				  struct usb_mixer_elem_info *cval, int unitid,
+				  struct snd_kcontrol *kctl)
+{
+	switch (mixer->chip->usb_id) {
+	case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
+		if (unitid == 7 && cval->min == 0 && cval->max == 50)
+			snd_dragonfly_quirk_db_scale(mixer, kctl);
+		break;
+	}
+}
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/sound/usb/mixer_quirks.h linux-libre-3.18.125-gnu/sound/usb/mixer_quirks.h
--- linux-libre-3.18.124-gnu/sound/usb/mixer_quirks.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/sound/usb/mixer_quirks.h	2018-11-10 10:39:23.000000000 -0500
@@ -9,5 +9,9 @@ void snd_emuusb_set_samplerate(struct sn
 void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
 				    int unitid);
 
+void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
+				  struct usb_mixer_elem_info *cval, int unitid,
+				  struct snd_kcontrol *kctl);
+
 #endif /* SND_USB_MIXER_QUIRKS_H */
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/lib/api/fs/debugfs.c linux-libre-3.18.125-gnu/tools/lib/api/fs/debugfs.c
--- linux-libre-3.18.124-gnu/tools/lib/api/fs/debugfs.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/lib/api/fs/debugfs.c	2018-11-10 10:39:23.000000000 -0500
@@ -67,7 +67,7 @@ int debugfs_valid_mountpoint(const char
 
 	if (statfs(debugfs, &st_fs) < 0)
 		return -ENOENT;
-	else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
+	else if ((long)st_fs.f_type != (long)DEBUGFS_MAGIC)
 		return -ENOENT;
 
 	return 0;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/lib/api/fs/fs.c linux-libre-3.18.125-gnu/tools/lib/api/fs/fs.c
--- linux-libre-3.18.124-gnu/tools/lib/api/fs/fs.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/lib/api/fs/fs.c	2018-11-10 10:39:23.000000000 -0500
@@ -75,7 +75,7 @@ static int fs__valid_mount(const char *f
 
 	if (statfs(fs, &st_fs) < 0)
 		return -ENOENT;
-	else if (st_fs.f_type != magic)
+	else if ((long)st_fs.f_type != magic)
 		return -ENOENT;
 
 	return 0;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/bench/sched-pipe.c linux-libre-3.18.125-gnu/tools/perf/bench/sched-pipe.c
--- linux-libre-3.18.124-gnu/tools/perf/bench/sched-pipe.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/bench/sched-pipe.c	2018-11-10 10:39:23.000000000 -0500
@@ -19,12 +19,12 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <sys/wait.h>
-#include <linux/unistd.h>
 #include <string.h>
 #include <errno.h>
 #include <assert.h>
 #include <sys/time.h>
 #include <sys/types.h>
+#include <sys/syscall.h>
 
 #include <pthread.h>
 
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/builtin-top.c linux-libre-3.18.125-gnu/tools/perf/builtin-top.c
--- linux-libre-3.18.124-gnu/tools/perf/builtin-top.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/builtin-top.c	2018-11-10 10:39:23.000000000 -0500
@@ -66,7 +66,6 @@
 #include <sys/utsname.h>
 #include <sys/mman.h>
 
-#include <linux/unistd.h>
 #include <linux/types.h>
 
 static volatile int done;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/Makefile linux-libre-3.18.125-gnu/tools/perf/Makefile
--- linux-libre-3.18.124-gnu/tools/perf/Makefile	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/Makefile	2018-11-10 10:39:23.000000000 -0500
@@ -69,10 +69,10 @@ all tags TAGS:
 	$(make)
 
 #
-# The clean target is not really parallel, don't print the jobs info:
+# Explicitly disable parallelism for the clean target.
 #
 clean:
-	$(make)
+	$(make) -j1
 
 #
 # The build-test target is not really parallel, don't print the jobs info:
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/perf-sys.h linux-libre-3.18.125-gnu/tools/perf/perf-sys.h
--- linux-libre-3.18.124-gnu/tools/perf/perf-sys.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/perf-sys.h	2018-11-10 10:39:23.000000000 -0500
@@ -6,7 +6,6 @@
 #include <sys/syscall.h>
 #include <linux/types.h>
 #include <linux/perf_event.h>
-#include <asm/unistd.h>
 
 #if defined(__i386__)
 #define mb()		asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/util/annotate.h linux-libre-3.18.125-gnu/tools/perf/util/annotate.h
--- linux-libre-3.18.124-gnu/tools/perf/util/annotate.h	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/util/annotate.h	2018-11-10 10:39:23.000000000 -0500
@@ -115,11 +115,6 @@ struct annotation {
 	struct annotated_source *src;
 };
 
-struct sannotation {
-	struct annotation annotation;
-	struct symbol	  symbol;
-};
-
 static inline struct sym_hist *annotation__histogram(struct annotation *notes, int idx)
 {
 	return (((void *)&notes->src->histograms) +
@@ -128,8 +123,7 @@ static inline struct sym_hist *annotatio
 
 static inline struct annotation *symbol__annotation(struct symbol *sym)
 {
-	struct sannotation *a = container_of(sym, struct sannotation, symbol);
-	return &a->annotation;
+	return (void *)sym - symbol_conf.priv_size;
 }
 
 int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx);
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/util/cloexec.c linux-libre-3.18.125-gnu/tools/perf/util/cloexec.c
--- linux-libre-3.18.124-gnu/tools/perf/util/cloexec.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/util/cloexec.c	2018-11-10 10:39:23.000000000 -0500
@@ -7,11 +7,15 @@
 
 static unsigned long flag = PERF_FLAG_FD_CLOEXEC;
 
+#ifdef __GLIBC_PREREQ
+#if !__GLIBC_PREREQ(2, 6)
 int __weak sched_getcpu(void)
 {
 	errno = ENOSYS;
 	return -1;
 }
+#endif
+#endif
 
 static int perf_flag_probe(void)
 {
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/perf/util/machine.c linux-libre-3.18.125-gnu/tools/perf/util/machine.c
--- linux-libre-3.18.124-gnu/tools/perf/util/machine.c	2018-10-13 03:09:32.000000000 -0400
+++ linux-libre-3.18.125-gnu/tools/perf/util/machine.c	2018-11-10 10:39:23.000000000 -0500
@@ -389,7 +389,6 @@ static struct thread *__machine__findnew
 	if (th != NULL) {
 		rb_link_node(&th->rb_node, parent, p);
 		rb_insert_color(&th->rb_node, &machine->threads);
-		machine->last_match = th;
 
 		/*
 		 * We have to initialize map_groups separately
@@ -400,9 +399,12 @@ static struct thread *__machine__findnew
 		 * leader and that would screwed the rb tree.
 		 */
 		if (thread__init_map_groups(th, machine)) {
+			rb_erase(&th->rb_node, &machine->threads);
 			thread__delete(th);
 			return NULL;
 		}
+
+		machine->last_match = th;
 	}
 
 	return th;
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/testing/selftests/efivarfs/config linux-libre-3.18.125-gnu/tools/testing/selftests/efivarfs/config
--- linux-libre-3.18.124-gnu/tools/testing/selftests/efivarfs/config	1969-12-31 19:00:00.000000000 -0500
+++ linux-libre-3.18.125-gnu/tools/testing/selftests/efivarfs/config	2018-11-10 10:39:23.000000000 -0500
@@ -0,0 +1 @@
+CONFIG_EFIVAR_FS=y
diff -druNp --no-dereference linux-libre-3.18.124-gnu/tools/testing/selftests/tc-testing/tdc_batch.py linux-libre-3.18.125-gnu/tools/testing/selftests/tc-testing/tdc_batch.py
--- linux-libre-3.18.124-gnu/tools/testing/selftests/tc-testing/tdc_batch.py	1969-12-31 19:00:00.000000000 -0500
+++ linux-libre-3.18.125-gnu/tools/testing/selftests/tc-testing/tdc_batch.py	2018-11-10 10:39:23.000000000 -0500
@@ -0,0 +1,62 @@
+#!/usr/bin/python3
+
+"""
+tdc_batch.py - a script to generate TC batch file
+
+Copyright (C) 2017 Chris Mi <chrism@mellanox.com>
+"""
+
+import argparse
+
+parser = argparse.ArgumentParser(description='TC batch file generator')
+parser.add_argument("device", help="device name")
+parser.add_argument("file", help="batch file name")
+parser.add_argument("-n", "--number", type=int,
+                    help="how many lines in batch file")
+parser.add_argument("-o", "--skip_sw",
+                    help="skip_sw (offload), by default skip_hw",
+                    action="store_true")
+parser.add_argument("-s", "--share_action",
+                    help="all filters share the same action",
+                    action="store_true")
+parser.add_argument("-p", "--prio",
+                    help="all filters have different prio",
+                    action="store_true")
+args = parser.parse_args()
+
+device = args.device
+file = open(args.file, 'w')
+
+number = 1
+if args.number:
+    number = args.number
+
+skip = "skip_hw"
+if args.skip_sw:
+    skip = "skip_sw"
+
+share_action = ""
+if args.share_action:
+    share_action = "index 1"
+
+prio = "prio 1"
+if args.prio:
+    prio = ""
+    if number > 0x4000:
+        number = 0x4000
+
+index = 0
+for i in range(0x100):
+    for j in range(0x100):
+        for k in range(0x100):
+            mac = ("%02x:%02x:%02x" % (i, j, k))
+            src_mac = "e4:11:00:" + mac
+            dst_mac = "e4:12:00:" + mac
+            cmd = ("filter add dev %s %s protocol ip parent ffff: flower %s "
+                   "src_mac %s dst_mac %s action drop %s" %
+                   (device, prio, skip, src_mac, dst_mac, share_action))
+            file.write("%s\n" % cmd)
+            index += 1
+            if index >= number:
+                file.close()
+                exit(0)
