diff -u linux-oem-4.15.0/Makefile linux-oem-4.15.0/Makefile --- linux-oem-4.15.0/Makefile +++ linux-oem-4.15.0/Makefile @@ -684,14 +684,20 @@ KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os +KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) +else +ifdef CONFIG_PROFILE_ALL_BRANCHES +KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) else KBUILD_CFLAGS += -O2 endif +endif + +KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ + $(call cc-disable-warning,maybe-uninitialized,)) # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) -KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races) # check for 'asm goto' ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) @@ -830,17 +836,6 @@ # disable stringop warnings in gcc 8+ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) -# We'll want to enable this eventually, but it's not going away for 5.7 at least -KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds) -KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds) -KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) - -# Another good warning that we'll want to enable eventually -KBUILD_CFLAGS += $(call cc-disable-warning, restrict) - -# Enabled with W=2, disabled by default as noisy -KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) - # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow) diff -u linux-oem-4.15.0/arch/arm/boot/dts/dra7.dtsi linux-oem-4.15.0/arch/arm/boot/dts/dra7.dtsi --- linux-oem-4.15.0/arch/arm/boot/dts/dra7.dtsi +++ linux-oem-4.15.0/arch/arm/boot/dts/dra7.dtsi @@ -289,7 +289,6 @@ #address-cells = <1>; ranges = <0x51000000 0x51000000 0x3000 0x0 0x20000000 0x10000000>; - dma-ranges; /** * To enable PCI endpoint mode, disable the pcie1_rc * node and enable pcie1_ep mode. @@ -304,6 +303,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x03000 0 0x00010000 0x82000000 0 0x20013000 0x13000 0 0xffed000>; + dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; bus-range = <0x00 0xff>; #interrupt-cells = <1>; num-lanes = <1>; @@ -347,7 +347,6 @@ #address-cells = <1>; ranges = <0x51800000 0x51800000 0x3000 0x0 0x30000000 0x10000000>; - dma-ranges; status = "disabled"; pcie@51800000 { compatible = "ti,dra7-pcie"; @@ -359,6 +358,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x03000 0 0x00010000 0x82000000 0 0x30013000 0x13000 0 0xffed000>; + dma-ranges = <0x02000000 0x0 0x00000000 0x00000000 0x1 0x00000000>; bus-range = <0x00 0xff>; #interrupt-cells = <1>; num-lanes = <1>; reverted: --- linux-oem-4.15.0/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts +++ linux-oem-4.15.0.orig/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts @@ -81,8 +81,8 @@ imx27-phycard-s-rdk { pinctrl_i2c1: i2c1grp { fsl,pins = < + MX27_PAD_I2C2_SDA__I2C2_SDA 0x0 + MX27_PAD_I2C2_SCL__I2C2_SCL 0x0 - MX27_PAD_I2C_DATA__I2C_DATA 0x0 - MX27_PAD_I2C_CLK__I2C_CLK 0x0 >; }; reverted: --- linux-oem-4.15.0/arch/arm/boot/dts/r8a73a4.dtsi +++ linux-oem-4.15.0.orig/arch/arm/boot/dts/r8a73a4.dtsi @@ -134,14 +134,7 @@ cmt1: timer@e6130000 { compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2"; reg = <0 0xe6130000 0 0x1004>; + interrupts = ; - interrupts = , - , - , - , - , - , - , - ; clocks = <&mstp3_clks R8A73A4_CLK_CMT1>; clock-names = "fck"; power-domains = <&pd_c5>; reverted: --- linux-oem-4.15.0/arch/arm/boot/dts/r8a7740.dtsi +++ linux-oem-4.15.0.orig/arch/arm/boot/dts/r8a7740.dtsi @@ -467,7 +467,7 @@ cpg_clocks: cpg_clocks@e6150000 { compatible = "renesas,r8a7740-cpg-clocks"; reg = <0xe6150000 0x10000>; + clocks = <&extal1_clk>, <&extalr_clk>; - clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>; #clock-cells = <1>; clock-output-names = "system", "pllc0", "pllc1", "pllc2", "r", reverted: --- linux-oem-4.15.0/arch/arm/include/asm/futex.h +++ linux-oem-4.15.0.orig/arch/arm/include/asm/futex.h @@ -163,13 +163,8 @@ preempt_enable(); #endif + if (!ret) + *oval = oldval; - /* - * Store unconditionally. If ret != 0 the extra store is the least - * of the worries but GCC cannot figure out that __futex_atomic_op() - * is either setting ret to -EFAULT or storing the old value in - * oldval which results in a uninitialized warning at the call site. - */ - *oval = oldval; return ret; } reverted: --- linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3328-evb.dts +++ linux-oem-4.15.0.orig/arch/arm64/boot/dts/rockchip/rk3328-evb.dts @@ -129,7 +129,7 @@ &i2c1 { status = "okay"; + rk805: rk805@18 { - rk805: pmic@18 { compatible = "rockchip,rk805"; reg = <0x18>; interrupt-parent = <&gpio2>; diff -u linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts --- linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +++ linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts @@ -151,7 +151,7 @@ &i2c1 { status = "okay"; - rk805: pmic@18 { + rk805: rk805@18 { compatible = "rockchip,rk805"; reg = <0x18>; interrupt-parent = <&gpio2>; diff -u linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi --- linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ linux-oem-4.15.0/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -403,7 +403,7 @@ "bus_clk", "grf_clk"; status = "disabled"; - usbdrd_dwc3_0: usb@fe800000 { + usbdrd_dwc3_0: dwc3 { compatible = "snps,dwc3"; reg = <0x0 0xfe800000 0x0 0x100000>; interrupts = ; @@ -431,7 +431,7 @@ "bus_clk", "grf_clk"; status = "disabled"; - usbdrd_dwc3_1: usb@fe900000 { + usbdrd_dwc3_1: dwc3 { compatible = "snps,dwc3"; reg = <0x0 0xfe900000 0x0 0x100000>; interrupts = ; reverted: --- linux-oem-4.15.0/arch/arm64/kernel/machine_kexec.c +++ linux-oem-4.15.0.orig/arch/arm64/kernel/machine_kexec.c @@ -185,8 +185,7 @@ /* Flush the reboot_code_buffer in preparation for its execution. */ __flush_dcache_area(reboot_code_buffer, arm64_relocate_new_kernel_size); flush_icache_range((uintptr_t)reboot_code_buffer, + arm64_relocate_new_kernel_size); - (uintptr_t)reboot_code_buffer + - arm64_relocate_new_kernel_size); /* Flush the kimage list and its buffers. */ kexec_list_flush(kimage); diff -u linux-oem-4.15.0/arch/arm64/mm/hugetlbpage.c linux-oem-4.15.0/arch/arm64/mm/hugetlbpage.c --- linux-oem-4.15.0/arch/arm64/mm/hugetlbpage.c +++ linux-oem-4.15.0/arch/arm64/mm/hugetlbpage.c @@ -220,8 +220,6 @@ pte = (pte_t *)pud; } else if (sz == (PAGE_SIZE * CONT_PTES)) { pmd_t *pmd = pmd_alloc(mm, pud, addr); - if (!pmd) - return NULL; WARN_ON(addr & (sz - 1)); /* diff -u linux-oem-4.15.0/arch/hexagon/include/asm/io.h linux-oem-4.15.0/arch/hexagon/include/asm/io.h --- linux-oem-4.15.0/arch/hexagon/include/asm/io.h +++ linux-oem-4.15.0/arch/hexagon/include/asm/io.h @@ -186,10 +186,16 @@ #define mmiowb() -void __iomem *ioremap(unsigned long phys_addr, unsigned long size); -#define ioremap_nocache ioremap -#define ioremap_uc(X, Y) ioremap((X), (Y)) +/* + * Need an mtype somewhere in here, for cache type deals? + * This is probably too long for an inline. + */ +void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size); +static inline void __iomem *ioremap(unsigned long phys_addr, unsigned long size) +{ + return ioremap_nocache(phys_addr, size); +} static inline void iounmap(volatile void __iomem *addr) { reverted: --- linux-oem-4.15.0/arch/hexagon/kernel/hexagon_ksyms.c +++ linux-oem-4.15.0.orig/arch/hexagon/kernel/hexagon_ksyms.c @@ -33,7 +33,7 @@ EXPORT_SYMBOL(__vmsetie); EXPORT_SYMBOL(__vmyield); EXPORT_SYMBOL(empty_zero_page); +EXPORT_SYMBOL(ioremap_nocache); -EXPORT_SYMBOL(ioremap); EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memset); reverted: --- linux-oem-4.15.0/arch/hexagon/mm/ioremap.c +++ linux-oem-4.15.0.orig/arch/hexagon/mm/ioremap.c @@ -22,7 +22,7 @@ #include #include +void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size) -void __iomem *ioremap(unsigned long phys_addr, unsigned long size) { unsigned long last_addr, addr; unsigned long offset = phys_addr & ~PAGE_MASK; diff -u linux-oem-4.15.0/arch/powerpc/Kconfig linux-oem-4.15.0/arch/powerpc/Kconfig --- linux-oem-4.15.0/arch/powerpc/Kconfig +++ linux-oem-4.15.0/arch/powerpc/Kconfig @@ -142,7 +142,6 @@ select ARCH_HAS_PMEM_API if PPC64 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE select ARCH_HAS_SG_CHAIN - select ARCH_HAS_STRICT_KERNEL_RWX if (PPC32 && !HIBERNATION) select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_UACCESS_FLUSHCACHE if PPC64 select ARCH_HAS_UBSAN_SANITIZE_ALL @@ -150,7 +149,6 @@ select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO - select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_SUPPORTS_ATOMIC_RMW select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT select ARCH_USE_BUILTIN_BSWAP @@ -182,6 +180,8 @@ select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_TRACEHOOK + select ARCH_HAS_STRICT_KERNEL_RWX if ((PPC_BOOK3S_64 || PPC32) && !RELOCATABLE && !HIBERNATION) + select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select HAVE_CBPF_JIT if !PPC64 select HAVE_CONTEXT_TRACKING if PPC64 select HAVE_DEBUG_KMEMLEAK diff -u linux-oem-4.15.0/arch/powerpc/kernel/pci_of_scan.c linux-oem-4.15.0/arch/powerpc/kernel/pci_of_scan.c --- linux-oem-4.15.0/arch/powerpc/kernel/pci_of_scan.c +++ linux-oem-4.15.0/arch/powerpc/kernel/pci_of_scan.c @@ -82,16 +82,10 @@ const __be32 *addrs; u32 i; int proplen; - bool mark_unset = false; addrs = of_get_property(node, "assigned-addresses", &proplen); - if (!addrs || !proplen) { - addrs = of_get_property(node, "reg", &proplen); - if (!addrs || !proplen) - return; - mark_unset = true; - } - + if (!addrs) + return; pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs); for (; proplen >= 20; proplen -= 20, addrs += 5) { flags = pci_parse_of_flags(of_read_number(addrs, 1), 0); @@ -116,8 +110,6 @@ continue; } res->flags = flags; - if (mark_unset) - res->flags |= IORESOURCE_UNSET; res->name = pci_name(dev); region.start = base; region.end = base + size - 1; diff -u linux-oem-4.15.0/arch/riscv/kernel/setup.c linux-oem-4.15.0/arch/riscv/kernel/setup.c --- linux-oem-4.15.0/arch/riscv/kernel/setup.c +++ linux-oem-4.15.0/arch/riscv/kernel/setup.c @@ -19,7 +19,6 @@ * to the Free Software Foundation, Inc., */ -#include #include #include #include @@ -189,7 +188,6 @@ set_max_mapnr(PFN_DOWN(mem_size)); max_low_pfn = memblock_end_of_DRAM(); - max_pfn = max_low_pfn; #ifdef CONFIG_BLK_DEV_INITRD setup_initrd(); diff -u linux-oem-4.15.0/arch/riscv/kernel/vdso/Makefile linux-oem-4.15.0/arch/riscv/kernel/vdso/Makefile --- linux-oem-4.15.0/arch/riscv/kernel/vdso/Makefile +++ linux-oem-4.15.0/arch/riscv/kernel/vdso/Makefile @@ -30,15 +30,15 @@ $(call if_changed,vdsold) # We also create a special relocatable object that should mirror the symbol -# table and layout of the linked DSO. With ld --just-symbols we can then -# refer to these symbols in the kernel code rather than hand-coded addresses. +# table and layout of the linked DSO. With ld -R we can then refer to +# these symbols in the kernel code rather than hand-coded addresses. SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ $(call cc-ldoption, -Wl$(comma)--hash-style=both) $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/rt_sigreturn.o FORCE $(call if_changed,vdsold) -LDFLAGS_vdso-syms.o := -r --just-symbols +LDFLAGS_vdso-syms.o := -r -R $(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE $(call if_changed,ld) diff -u linux-oem-4.15.0/arch/s390/kernel/diag.c linux-oem-4.15.0/arch/s390/kernel/diag.c --- linux-oem-4.15.0/arch/s390/kernel/diag.c +++ linux-oem-4.15.0/arch/s390/kernel/diag.c @@ -128,7 +128,7 @@ } EXPORT_SYMBOL(diag_stat_inc); -void notrace diag_stat_inc_norecursion(enum diag_stat_enum nr) +void diag_stat_inc_norecursion(enum diag_stat_enum nr) { this_cpu_inc(diag_stat.counter[nr]); trace_s390_diagnose_norecursion(diag_map[nr].code); diff -u linux-oem-4.15.0/arch/s390/kernel/smp.c linux-oem-4.15.0/arch/s390/kernel/smp.c --- linux-oem-4.15.0/arch/s390/kernel/smp.c +++ linux-oem-4.15.0/arch/s390/kernel/smp.c @@ -394,7 +394,7 @@ return -1; } -bool notrace arch_vcpu_is_preempted(int cpu) +bool arch_vcpu_is_preempted(int cpu) { if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu)) return false; @@ -404,7 +404,7 @@ } EXPORT_SYMBOL(arch_vcpu_is_preempted); -void notrace smp_yield_cpu(int cpu) +void smp_yield_cpu(int cpu) { if (MACHINE_HAS_DIAG9C) { diag_stat_inc_norecursion(DIAG_STAT_X09C); reverted: --- linux-oem-4.15.0/arch/s390/kernel/trace.c +++ linux-oem-4.15.0.orig/arch/s390/kernel/trace.c @@ -14,7 +14,7 @@ static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth); +void trace_s390_diagnose_norecursion(int diag_nr) -void notrace trace_s390_diagnose_norecursion(int diag_nr) { unsigned long flags; unsigned int *depth; diff -u linux-oem-4.15.0/arch/x86/entry/calling.h linux-oem-4.15.0/arch/x86/entry/calling.h --- linux-oem-4.15.0/arch/x86/entry/calling.h +++ linux-oem-4.15.0/arch/x86/entry/calling.h @@ -98,6 +98,13 @@ #define SIZEOF_PTREGS 21*8 .macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0 + /* + * Push registers and sanitize registers of values that a + * speculation attack might otherwise want to exploit. The + * lower registers are likely clobbered well before they + * could be put to use in a speculative execution gadget. + * Interleave XOR with PUSH for better uop scheduling: + */ .if \save_ret pushq %rsi /* pt_regs->si */ movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */ @@ -110,40 +117,29 @@ pushq %rcx /* pt_regs->cx */ pushq \rax /* pt_regs->ax */ pushq %r8 /* pt_regs->r8 */ + xorl %r8d, %r8d /* nospec r8 */ pushq %r9 /* pt_regs->r9 */ + xorl %r9d, %r9d /* nospec r9 */ pushq %r10 /* pt_regs->r10 */ + xorl %r10d, %r10d /* nospec r10 */ pushq %r11 /* pt_regs->r11 */ + xorl %r11d, %r11d /* nospec r11*/ pushq %rbx /* pt_regs->rbx */ + xorl %ebx, %ebx /* nospec rbx*/ pushq %rbp /* pt_regs->rbp */ + xorl %ebp, %ebp /* nospec rbp*/ pushq %r12 /* pt_regs->r12 */ + xorl %r12d, %r12d /* nospec r12*/ pushq %r13 /* pt_regs->r13 */ + xorl %r13d, %r13d /* nospec r13*/ pushq %r14 /* pt_regs->r14 */ + xorl %r14d, %r14d /* nospec r14*/ pushq %r15 /* pt_regs->r15 */ + xorl %r15d, %r15d /* nospec r15*/ UNWIND_HINT_REGS - .if \save_ret pushq %rsi /* return address on top of stack */ .endif - - /* - * Sanitize registers of values that a speculation attack might - * otherwise want to exploit. The lower registers are likely clobbered - * well before they could be put to use in a speculative execution - * gadget. - */ - xorl %edx, %edx /* nospec dx */ - xorl %ecx, %ecx /* nospec cx */ - xorl %r8d, %r8d /* nospec r8 */ - xorl %r9d, %r9d /* nospec r9 */ - xorl %r10d, %r10d /* nospec r10 */ - xorl %r11d, %r11d /* nospec r11 */ - xorl %ebx, %ebx /* nospec rbx */ - xorl %ebp, %ebp /* nospec rbp */ - xorl %r12d, %r12d /* nospec r12 */ - xorl %r13d, %r13d /* nospec r13 */ - xorl %r14d, %r14d /* nospec r14 */ - xorl %r15d, %r15d /* nospec r15 */ - .endm .macro POP_REGS pop_rdi=1 skip_r11rcx=0 diff -u linux-oem-4.15.0/arch/x86/entry/entry_64.S linux-oem-4.15.0/arch/x86/entry/entry_64.S --- linux-oem-4.15.0/arch/x86/entry/entry_64.S +++ linux-oem-4.15.0/arch/x86/entry/entry_64.S @@ -306,6 +306,7 @@ */ syscall_return_via_sysret: /* rcx and r11 are already restored (see code above) */ + UNWIND_HINT_EMPTY POP_REGS pop_rdi=0 skip_r11rcx=1 /* @@ -314,7 +315,6 @@ */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp - UNWIND_HINT_EMPTY pushq RSP-RDI(%rdi) /* RSP */ pushq (%rdi) /* RDI */ @@ -610,7 +610,6 @@ */ movq %rsp, %rdi movq PER_CPU_VAR(cpu_tss_rw + TSS_sp0), %rsp - UNWIND_HINT_EMPTY /* Copy the IRET frame to the trampoline stack. */ pushq 6*8(%rdi) /* SS */ @@ -1656,7 +1655,7 @@ movq PER_CPU_VAR(cpu_current_top_of_stack), %rax leaq -PTREGS_SIZE(%rax), %rsp - UNWIND_HINT_REGS + UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE call do_exit END(rewind_stack_do_exit) diff -u linux-oem-4.15.0/arch/x86/include/asm/bitops.h linux-oem-4.15.0/arch/x86/include/asm/bitops.h --- linux-oem-4.15.0/arch/x86/include/asm/bitops.h +++ linux-oem-4.15.0/arch/x86/include/asm/bitops.h @@ -72,7 +72,7 @@ : "iq" ((u8)CONST_MASK(nr)) : "memory"); } else { - asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0" + asm volatile(LOCK_PREFIX "bts %1,%0" : BITOP_ADDR(addr) : "Ir" (nr) : "memory"); } } @@ -88,7 +88,7 @@ */ static __always_inline void __set_bit(long nr, volatile unsigned long *addr) { - asm volatile(__ASM_SIZE(bts) " %1,%0" : ADDR : "Ir" (nr) : "memory"); + asm volatile("bts %1,%0" : ADDR : "Ir" (nr) : "memory"); } /** @@ -109,7 +109,7 @@ : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)~CONST_MASK(nr))); } else { - asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0" + asm volatile(LOCK_PREFIX "btr %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); } @@ -131,7 +131,7 @@ static __always_inline void __clear_bit(long nr, volatile unsigned long *addr) { - asm volatile(__ASM_SIZE(btr) " %1,%0" : ADDR : "Ir" (nr)); + asm volatile("btr %1,%0" : ADDR : "Ir" (nr)); } static __always_inline bool clear_bit_unlock_is_negative_byte(long nr, volatile unsigned long *addr) @@ -176,7 +176,7 @@ */ static __always_inline void __change_bit(long nr, volatile unsigned long *addr) { - asm volatile(__ASM_SIZE(btc) " %1,%0" : ADDR : "Ir" (nr)); + asm volatile("btc %1,%0" : ADDR : "Ir" (nr)); } /** @@ -195,7 +195,7 @@ : CONST_MASK_ADDR(nr, addr) : "iq" ((u8)CONST_MASK(nr))); } else { - asm volatile(LOCK_PREFIX __ASM_SIZE(btc) " %1,%0" + asm volatile(LOCK_PREFIX "btc %1,%0" : BITOP_ADDR(addr) : "Ir" (nr)); } @@ -211,8 +211,7 @@ */ static __always_inline bool test_and_set_bit(long nr, volatile unsigned long *addr) { - GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(bts), - *addr, "Ir", nr, "%0", c); + GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", c); } /** @@ -241,7 +240,7 @@ { bool oldbit; - asm(__ASM_SIZE(bts) " %2,%1" + asm("bts %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr)); @@ -258,8 +257,7 @@ */ static __always_inline bool test_and_clear_bit(long nr, volatile unsigned long *addr) { - GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btr), - *addr, "Ir", nr, "%0", c); + GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", c); } /** @@ -282,7 +280,7 @@ { bool oldbit; - asm volatile(__ASM_SIZE(btr) " %2,%1" + asm volatile("btr %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr)); @@ -294,7 +292,7 @@ { bool oldbit; - asm volatile(__ASM_SIZE(btc) " %2,%1" + asm volatile("btc %2,%1" CC_SET(c) : CC_OUT(c) (oldbit), ADDR : "Ir" (nr) : "memory"); @@ -312,8 +310,7 @@ */ static __always_inline bool test_and_change_bit(long nr, volatile unsigned long *addr) { - GEN_BINARY_RMWcc(LOCK_PREFIX __ASM_SIZE(btc), - *addr, "Ir", nr, "%0", c); + GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", c); } static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr) @@ -326,7 +323,7 @@ { bool oldbit; - asm volatile(__ASM_SIZE(bt) " %2,%1" + asm volatile("bt %2,%1" CC_SET(c) : CC_OUT(c) (oldbit) : "m" (*(unsigned long *)addr), "Ir" (nr)); diff -u linux-oem-4.15.0/arch/x86/include/asm/percpu.h linux-oem-4.15.0/arch/x86/include/asm/percpu.h --- linux-oem-4.15.0/arch/x86/include/asm/percpu.h +++ linux-oem-4.15.0/arch/x86/include/asm/percpu.h @@ -526,7 +526,7 @@ { bool oldbit; - asm volatile("btl "__percpu_arg(2)",%1" + asm volatile("bt "__percpu_arg(2)",%1" CC_SET(c) : CC_OUT(c) (oldbit) : "m" (*(unsigned long __percpu *)addr), "Ir" (nr)); reverted: --- linux-oem-4.15.0/arch/x86/include/asm/stackprotector.h +++ linux-oem-4.15.0.orig/arch/x86/include/asm/stackprotector.h @@ -55,13 +55,8 @@ /* * Initialize the stackprotector canary value. * + * NOTE: this must only be called from functions that never return, - * NOTE: this must only be called from functions that never return * and it must always be inlined. - * - * In addition, it should be called from a compilation unit for which - * stack protector is disabled. Alternatively, the caller should not end - * with a function call which gets tail-call optimized as that would - * lead to checking a modified canary value. */ static __always_inline void boot_init_stack_canary(void) { diff -u linux-oem-4.15.0/arch/x86/kernel/apic/apic.c linux-oem-4.15.0/arch/x86/kernel/apic/apic.c --- linux-oem-4.15.0/arch/x86/kernel/apic/apic.c +++ linux-oem-4.15.0/arch/x86/kernel/apic/apic.c @@ -345,6 +345,8 @@ * According to Intel, MFENCE can do the serialization here. */ asm volatile("mfence" : : : "memory"); + + printk_once(KERN_DEBUG "TSC deadline timer enabled\n"); return; } @@ -543,7 +545,7 @@ #define DEADLINE_MODEL_MATCH_REV(model, rev) \ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)rev } -static __init u32 hsx_deadline_rev(void) +static u32 hsx_deadline_rev(void) { switch (boot_cpu_data.x86_stepping) { case 0x02: return 0x3a; /* EP */ @@ -553,7 +555,7 @@ return ~0U; } -static __init u32 bdx_deadline_rev(void) +static u32 bdx_deadline_rev(void) { switch (boot_cpu_data.x86_stepping) { case 0x02: return 0x00000011; @@ -565,7 +567,7 @@ return ~0U; } -static __init u32 skx_deadline_rev(void) +static u32 skx_deadline_rev(void) { switch (boot_cpu_data.x86_stepping) { case 0x03: return 0x01000136; @@ -578,7 +580,7 @@ return ~0U; } -static const struct x86_cpu_id deadline_match[] __initconst = { +static const struct x86_cpu_id deadline_match[] = { DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_HASWELL_X, hsx_deadline_rev), DEADLINE_MODEL_MATCH_REV ( INTEL_FAM6_BROADWELL_X, 0x0b000020), DEADLINE_MODEL_MATCH_FUNC( INTEL_FAM6_BROADWELL_XEON_D, bdx_deadline_rev), @@ -600,19 +602,18 @@ {}, }; -static __init bool apic_validate_deadline_timer(void) +static void apic_check_deadline_errata(void) { const struct x86_cpu_id *m; u32 rev; - if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER)) - return false; - if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) - return true; + if (!boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER) || + boot_cpu_has(X86_FEATURE_HYPERVISOR)) + return; m = x86_match_cpu(deadline_match); if (!m) - return true; + return; /* * Function pointers will have the MSB set due to address layout, @@ -624,12 +625,11 @@ rev = (u32)m->driver_data; if (boot_cpu_data.microcode >= rev) - return true; + return; setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); pr_err(FW_BUG "TSC_DEADLINE disabled due to Errata; " "please update microcode to version: 0x%x (or later)\n", rev); - return false; } /* @@ -2032,8 +2032,7 @@ { unsigned int new_apicid; - if (apic_validate_deadline_timer()) - pr_debug("TSC deadline timer available\n"); + apic_check_deadline_errata(); if (x2apic_mode) { boot_cpu_physical_apicid = read_apic_id(); diff -u linux-oem-4.15.0/arch/x86/kernel/cpu/bugs.c linux-oem-4.15.0/arch/x86/kernel/cpu/bugs.c --- linux-oem-4.15.0/arch/x86/kernel/cpu/bugs.c +++ linux-oem-4.15.0/arch/x86/kernel/cpu/bugs.c @@ -425,7 +425,7 @@ if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) return; - if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) + if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED) return; rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl); diff -u linux-oem-4.15.0/arch/x86/kernel/smpboot.c linux-oem-4.15.0/arch/x86/kernel/smpboot.c --- linux-oem-4.15.0/arch/x86/kernel/smpboot.c +++ linux-oem-4.15.0/arch/x86/kernel/smpboot.c @@ -268,14 +268,6 @@ wmb(); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); - - /* - * Prevent tail call to cpu_startup_entry() because the stack protector - * guard has been changed a couple of function calls up, in - * boot_init_stack_canary() and must not be checked before tail calling - * another function. - */ - prevent_tail_call_optimization(); } /** diff -u linux-oem-4.15.0/arch/x86/kernel/unwind_orc.c linux-oem-4.15.0/arch/x86/kernel/unwind_orc.c --- linux-oem-4.15.0/arch/x86/kernel/unwind_orc.c +++ linux-oem-4.15.0/arch/x86/kernel/unwind_orc.c @@ -132,6 +132,9 @@ { static struct orc_entry *orc; + if (!orc_init) + return NULL; + if (ip == 0) return &null_orc_entry; @@ -301,19 +304,12 @@ unsigned long *unwind_get_return_address_ptr(struct unwind_state *state) { - struct task_struct *task = state->task; - if (unwind_done(state)) return NULL; if (state->regs) return &state->regs->ip; - if (task != current && state->sp == task->thread.sp) { - struct inactive_task_frame *frame = (void *)task->thread.sp; - return &frame->ret_addr; - } - if (state->sp) return (unsigned long *)state->sp - 1; @@ -510,7 +506,7 @@ default: orc_warn("unknown .orc_unwind entry type %d for ip %pB\n", orc->type, (void *)orig_ip); - goto done; + break; } /* Find BP: */ @@ -561,20 +557,17 @@ memset(state, 0, sizeof(*state)); state->task = task; - if (!orc_init) - goto err; - /* * Refuse to unwind the stack of a task while it's executing on another * CPU. This check is racy, but that's ok: the unwinder has other * checks to prevent it from going off the rails. */ if (task_on_another_cpu(task)) - goto err; + goto done; if (regs) { if (user_mode(regs)) - goto the_end; + goto done; state->ip = regs->ip; state->sp = kernel_stack_pointer(regs); @@ -607,7 +600,6 @@ * generate some kind of backtrace if this happens. */ void *next_page = (void *)PAGE_ALIGN((unsigned long)state->sp); - state->error = true; if (get_stack_info(next_page, state->task, &state->stack_info, &state->stack_mask)) return; @@ -629,13 +621,12 @@ while (!unwind_done(state) && (!on_stack(&state->stack_info, first_frame, sizeof(long)) || - state->sp < (unsigned long)first_frame)) + state->sp <= (unsigned long)first_frame)) unwind_next_frame(state); return; -err: - state->error = true; -the_end: +done: state->stack_info.type = STACK_TYPE_UNKNOWN; + return; } EXPORT_SYMBOL_GPL(__unwind_start); diff -u linux-oem-4.15.0/arch/x86/kvm/x86.c linux-oem-4.15.0/arch/x86/kvm/x86.c --- linux-oem-4.15.0/arch/x86/kvm/x86.c +++ linux-oem-4.15.0/arch/x86/kvm/x86.c @@ -3242,7 +3242,7 @@ unsigned bank_num = mcg_cap & 0xff, bank; r = -EINVAL; - if (!bank_num || bank_num > KVM_MAX_MCE_BANKS) + if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS) goto out; if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000)) goto out; diff -u linux-oem-4.15.0/arch/x86/xen/smp_pv.c linux-oem-4.15.0/arch/x86/xen/smp_pv.c --- linux-oem-4.15.0/arch/x86/xen/smp_pv.c +++ linux-oem-4.15.0/arch/x86/xen/smp_pv.c @@ -89,7 +89,6 @@ { cpu_bringup(); cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); - prevent_tail_call_optimization(); } void xen_smp_intr_free_pv(unsigned int cpu) diff -u linux-oem-4.15.0/crypto/lrw.c linux-oem-4.15.0/crypto/lrw.c --- linux-oem-4.15.0/crypto/lrw.c +++ linux-oem-4.15.0/crypto/lrw.c @@ -527,7 +527,7 @@ crypto_free_skcipher(ctx->child); } -static void free_inst(struct skcipher_instance *inst) +static void free(struct skcipher_instance *inst) { crypto_drop_skcipher(skcipher_instance_ctx(inst)); kfree(inst); @@ -639,7 +639,7 @@ inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; - inst->free = free_inst; + inst->free = free; err = skcipher_register_instance(tmpl, inst); if (err) reverted: --- linux-oem-4.15.0/crypto/xts.c +++ linux-oem-4.15.0.orig/crypto/xts.c @@ -465,7 +465,7 @@ crypto_free_cipher(ctx->tweak); } +static void free(struct skcipher_instance *inst) -static void free_inst(struct skcipher_instance *inst) { crypto_drop_skcipher(skcipher_instance_ctx(inst)); kfree(inst); @@ -576,7 +576,7 @@ inst->alg.encrypt = encrypt; inst->alg.decrypt = decrypt; + inst->free = free; - inst->free = free_inst; err = skcipher_register_instance(tmpl, inst); if (err) diff -u linux-oem-4.15.0/debian.master/changelog linux-oem-4.15.0/debian.master/changelog --- linux-oem-4.15.0/debian.master/changelog +++ linux-oem-4.15.0/debian.master/changelog @@ -1,270 +1,12 @@ -linux (4.15.0-107.108) bionic; urgency=medium - - * CVE-2020-0543 - - UBUNTU/SAUCE: x86/speculation/srbds: do not try to turn mitigation off when - not supported - - * Build Nvidia drivers in conjunction with kernel (LP: #1764792) - - [Packaging] disable nvidia dkms builds for mainline - - * Bionic update: upstream stable patchset 2020-06-02 (LP: #1881801) - - i2c: dev: Fix the race between the release of i2c_dev and cdev - - ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() - - evm: Check also if *tfm is an error pointer in init_desc() - - ima: Fix return value of ima_write_policy() - - fix multiplication overflow in copy_fdtable() - - iommu/amd: Fix over-read of ACPI UID from IVRS table - - i2c: mux: demux-pinctrl: Fix an error handling path in - 'i2c_demux_pinctrl_probe()' - - ubi: Fix seq_file usage in detailed_erase_block_info debugfs file - - gcc-common.h: Update for GCC 10 - - HID: multitouch: add eGalaxTouch P80H84 support - - scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV - - configfs: fix config_item refcnt leak in configfs_rmdir() - - vhost/vsock: fix packet delivery order to monitoring devices - - component: Silence bind error on -EPROBE_DEFER - - scsi: ibmvscsi: Fix WARN_ON during event pool release - - x86/apic: Move TSC deadline timer debug printk - - gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() - - ceph: fix double unlock in handle_cap_export() - - USB: core: Fix misleading driver bug report - - platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA - - ARM: futex: Address build warning - - padata: Replace delayed timer with immediate workqueue in padata_reorder - - padata: initialize pd->cpu with effective cpumask - - padata: purge get_cpu and reorder_via_wq from padata_do_serial - - arm64: fix the flush_icache_range arguments in machine_kexec - - ALSA: iec1712: Initialize STDSP24 properly when using the model=staudio - option - - ALSA: pcm: fix incorrect hw_base increase - - apparmor: Fix aa_label refcnt leak in policy_update - - dmaengine: tegra210-adma: Fix an error handling path in 'tegra_adma_probe()' - - powerpc: restore alphabetic order in Kconfig - - powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE - - powerpc/64s: Disable STRICT_KERNEL_RWX - - x86/uaccess, ubsan: Fix UBSAN vs. SMAP - - ubsan: build ubsan.c more conservatively - - libnvdimm/btt: Remove unnecessary code in btt_freelist_init - - libnvdimm/btt: Fix LBA masking during 'free list' population - - media: fdp1: Fix R-Car M3-N naming in debug message - - cxgb4: free mac_hlist properly - - cxgb4/cxgb4vf: Fix mac_hlist initialization and free - - Revert "gfs2: Don't demote a glock until its revokes are written" - - staging: iio: ad2s1210: Fix SPI reading - - staging: greybus: Fix uninitialized scalar variable - - iio: sca3000: Remove an erroneous 'get_device()' - - iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()' - - mei: release me_cl object reference - - rapidio: fix an error in get_user_pages_fast() error handling - - rxrpc: Fix a memory leak in rxkad_verify_response() - - x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks - - iio: adc: stm32-adc: Use dma_request_chan() instead - dma_request_slave_channel() - - iio: adc: stm32-adc: fix device used to request dma - - riscv: set max_pfn to the PFN of the last page - - ubifs: remove broken lazytime support - - HID: alps: Add AUI1657 device ID - - HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead - - aquantia: Fix the media type of AQC100 ethernet controller in the driver - - HID: i2c-hid: reset Synaptics SYNA2393 on resume - - HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock - - stmmac: fix pointer check after utilization in stmmac_interrupt - - ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Xtreme - - ALSA: hda/realtek - Add more fixup entries for Clevo machines - - drm/etnaviv: fix perfmon domain interation - - nfit: Add Hyper-V NVDIMM DSM command set to white list - - thunderbolt: Drop duplicated get_switch_at_route() - - net: bcmgenet: code movement - - net: bcmgenet: abort suspend on error - - misc: rtsx: Add short delay after exit from ASPM - - * Bionic update: upstream stable patchset 2020-05-21 (LP: #1880014) - - USB: serial: qcserial: Add DW5816e support - - dp83640: reverse arguments to list_add_tail - - fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks - - net: macsec: preserve ingress frame ordering - - net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() - - net: usb: qmi_wwan: add support for DW5816e - - sch_choke: avoid potential panic in choke_reset() - - sch_sfq: validate silly quantum values - - bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features(). - - net/mlx5: Fix forced completion access non initialized command entry - - net/mlx5: Fix command entry leak in Internal Error State - - bnxt_en: Improve AER slot reset. - - bnxt_en: Fix VF anti-spoof filter setup. - - net: stricter validation of untrusted gso packets - - ipv6: fix cleanup ordering for ip6_mr failure - - HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices - - HID: usbhid: Fix race between usbhid_close() and usbhid_stop() - - USB: uas: add quirk for LaCie 2Big Quadra - - USB: serial: garmin_gps: add sanity checking for data length - - tracing: Add a vmalloc_sync_mappings() for safe measure - - KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER - - mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous() - - coredump: fix crash when umh is disabled - - batman-adv: fix batadv_nc_random_weight_tq - - batman-adv: Fix refcnt leak in batadv_show_throughput_override - - batman-adv: Fix refcnt leak in batadv_store_throughput_override - - batman-adv: Fix refcnt leak in batadv_v_ogm_process - - x86/entry/64: Fix unwind hints in kernel exit path - - x86/entry/64: Fix unwind hints in rewind_stack_do_exit() - - x86/unwind/orc: Don't skip the first frame for inactive tasks - - x86/unwind/orc: Prevent unwinding before ORC initialization - - x86/unwind/orc: Fix error path for bad ORC entry type - - netfilter: nat: never update the UDP checksum when it's 0 - - objtool: Fix stack offset tracking for indirect CFAs - - scripts/decodecode: fix trapping instruction formatting - - net: stmmac: Use mutex instead of spinlock - - shmem: fix possible deadlocks on shmlock_user_lock - - net/sonic: Fix a resource leak in an error handling path in - 'jazz_sonic_probe()' - - net: moxa: Fix a potential double 'free_irq()' - - drop_monitor: work around gcc-10 stringop-overflow warning - - virtio-blk: handle block_device_operations callbacks after hot unplug - - scsi: sg: add sg_remove_request in sg_write - - dmaengine: pch_dma.c: Avoid data race between probe and irq handler - - dmaengine: mmp_tdma: Reset channel error on release - - cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once - - ALSA: hda/hdmi: fix race in monitor detection during probe - - drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() - - ipc/util.c: sysvipc_find_ipc() incorrectly updates position index - - x86/entry/64: Fix unwind hints in register clearing code - - ipmi: Fix NULL pointer dereference in ssif_probe - - pinctrl: baytrail: Enable pin configuration setting for GPIO chip - - pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler - - i40iw: Fix error handling in i40iw_manage_arp_cache() - - netfilter: conntrack: avoid gcc-10 zero-length-bounds warning - - IB/mlx4: Test return value of calls to ib_get_cached_pkey - - hwmon: (da9052) Synchronize access with mfd - - pnp: Use list_for_each_entry() instead of open coding - - gcc-10 warnings: fix low-hanging fruit - - kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig - - Stop the ad-hoc games with -Wno-maybe-initialized - - gcc-10: disable 'zero-length-bounds' warning for now - - gcc-10: disable 'array-bounds' warning for now - - gcc-10: disable 'stringop-overflow' warning for now - - gcc-10: disable 'restrict' warning for now - - gcc-10: avoid shadowing standard library 'free()' in crypto - - x86/asm: Add instruction suffixes to bitops - - net: phy: micrel: Use strlcpy() for ethtool::get_strings - - net: fix a potential recursive NETDEV_FEAT_CHANGE - - net: phy: fix aneg restart in phy_ethtool_set_eee - - Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu" - - hinic: fix a bug of ndo_stop - - net: dsa: loop: Add module soft dependency - - net: ipv4: really enforce backoff for redirects - - netprio_cgroup: Fix unlimited memory leak of v2 cgroups - - net: tcp: fix rx timestamp behavior for tcp_recvmsg - - ALSA: hda/realtek - Limit int mic boost for Thinkpad T530 - - ALSA: rawmidi: Initialize allocated buffers - - ALSA: rawmidi: Fix racy buffer resize under concurrent accesses - - ARM: dts: dra7: Fix bus_dma_limit for PCIe - - ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries - - x86: Fix early boot crash on gcc-10, third try - - ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset - - usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B - - usb: host: xhci-plat: keep runtime active when removing host - - usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list - - x86/unwind/orc: Fix error handling in __unwind_start() - - exec: Move would_dump into flush_old_exec - - clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks - - usb: gadget: net2272: Fix a memory leak in an error handling path in - 'net2272_plat_probe()' - - usb: gadget: audio: Fix a missing error return value in audio_bind() - - usb: gadget: legacy: fix error return code in gncm_bind() - - usb: gadget: legacy: fix error return code in cdc_bind() - - arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 - boards - - arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy - - ARM: dts: r8a73a4: Add missing CMT1 interrupts - - ARM: dts: r8a7740: Add missing extal2 to CPG node - - KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce - - Makefile: disallow data races on gcc-10 as well - - sctp: Fix bundling of SHUTDOWN with COOKIE-ACK - - arm64: hugetlb: avoid potential NULL dereference - - net: dsa: Do not make user port errors fatal - - pppoe: only process PADT targeted at local interfaces - - riscv: fix vdso build with lld - - netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() - - cifs: fix leaked reference on requeued write - - clk: Unlink clock if failed to prepare or enable - - * upgrading to 4.15.0-99-generic breaks the sound and the trackpad - (LP: #1875916) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - Revert "ALSA: hda/realtek: Fix pop noise on ALC225" - - * Pop sound from build-in speaker during cold boot and resume from S3 - (LP: #1866357) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse - - * Bionic update: upstream stable patchset 2020-05-19 (LP: #1879536) - - vhost: vsock: kick send_pkt worker once device is started - - powerpc/pci/of: Parse unassigned resources - - ASoC: topology: Check return value of pcm_new_ver - - selftests/ipc: Fix test failure seen after initial test run - - ASoC: sgtl5000: Fix VAG power-on handling - - ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode - - ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry - - wimax/i2400m: Fix potential urb refcnt leak - - net: stmmac: fix enabling socfpga's ptp_ref_clock - - net: stmmac: Fix sub-second increment - - cifs: protect updating server->dstaddr with a spinlock - - s390/ftrace: fix potential crashes when switching tracers - - scripts/config: allow colons in option strings for sed - - lib/mpi: Fix building for powerpc with clang - - net: bcmgenet: suppress warnings on failed Rx SKB allocations - - net: systemport: suppress warnings on failed Rx SKB allocations - - sctp: Fix SHUTDOWN CTSN Ack in the peer restart case - - ALSA: hda: Match both PCI ID and SSID for driver blacklist - - mac80211: add ieee80211_is_any_nullfunc() - - cgroup, netclassid: remove double cond_resched - - ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode - - drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay - table v0 (e.g Hawaii) - - ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent - - ASoC: rsnd: Fix "status check failed" spam for multi-SSI - - drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event - - hexagon: clean up ioremap - - hexagon: define ioremap_uc - - drm/atomic: Take the atomic toys away from X - - * Performing function level reset of AMD onboard USB and audio devices causes - system lockup (LP: #1865988) - - SAUCE: PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 - - SAUCE: PCI: Avoid FLR for AMD Starship USB 3.0 - - * add 16-bit width registers support for EEPROM at24 device (LP: #1876699) - - SAUCE: at24-smbus-16bit-address - - * qeth: utilize virtual MAC for Layer2 OSD devices (LP: #1880834) - - s390/qeth: improve fallback to random MAC address - - s390/qeth: utilize virtual MAC for Layer2 OSD devices - - * Slow send speed with Intel I219-V on Ubuntu 18.04.1 (LP: #1802691) - - e1000e: Disable TSO for buffer overrun workaround - - * CVE-2020-10711 - - netlabel: cope with NULL catmap - - * CVE-2020-13143 - - USB: gadget: fix illegal array access in binding with UDC - - * rtl8723bu wifi issue after being turned off (LP: #1878296) - - rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver - - rtl8xxxu: add bluetooth co-existence support for single antenna - - rtl8xxxu: remove set but not used variable 'rate_mask' - - rtl8xxxu: Remove set but not used variable 'vif', 'dev', 'len' - - * Cannot create ipvlans with > 1500 MTU on recent Bionic kernels - (LP: #1879658) - - ipvlan: use ETH_MAX_MTU as max mtu +linux (4.15.0-108.109) bionic; urgency=medium * Packaging resync (LP: #1786013) - - [Packaging] update helper scripts + - update dkms package versions + + * dkms-build: downloads fail in private PPAs (LP: #1883874) + - dkms-build: apt-cache policy elides username:password information - -- Kleber Sacilotto de Souza Mon, 08 Jun 2020 18:11:54 +0200 + -- Kleber Sacilotto de Souza Fri, 19 Jun 2020 13:07:28 +0200 linux (4.15.0-106.107) bionic; urgency=medium diff -u linux-oem-4.15.0/debian.master/upstream-stable linux-oem-4.15.0/debian.master/upstream-stable --- linux-oem-4.15.0/debian.master/upstream-stable +++ linux-oem-4.15.0/debian.master/upstream-stable @@ -3,2 +3,2 @@ - linux-4.14.y = v4.14.182 - linux-4.19.y = v4.19.125 + linux-4.14.y = v4.14.179 + linux-4.19.y = v4.19.121 diff -u linux-oem-4.15.0/debian.oem/changelog linux-oem-4.15.0/debian.oem/changelog --- linux-oem-4.15.0/debian.oem/changelog +++ linux-oem-4.15.0/debian.oem/changelog @@ -1,259 +1,14 @@ -linux-oem (4.15.0-1088.98) bionic; urgency=medium +linux-oem (4.15.0-1090.100) bionic; urgency=medium - * bionic/linux-oem: 4.15.0-1088.98 -proposed tracker (LP: #1862011) - [ Ubuntu: 4.15.0-107.108 ] + [ Ubuntu: 4.15.0-108.109 ] - * CVE-2020-0543 - - UBUNTU/SAUCE: x86/speculation/srbds: do not try to turn mitigation off when - not supported - * Build Nvidia drivers in conjunction with kernel (LP: #1764792) - - [Packaging] disable nvidia dkms builds for mainline - * Bionic update: upstream stable patchset 2020-06-02 (LP: #1881801) - - i2c: dev: Fix the race between the release of i2c_dev and cdev - - ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() - - evm: Check also if *tfm is an error pointer in init_desc() - - ima: Fix return value of ima_write_policy() - - fix multiplication overflow in copy_fdtable() - - iommu/amd: Fix over-read of ACPI UID from IVRS table - - i2c: mux: demux-pinctrl: Fix an error handling path in - 'i2c_demux_pinctrl_probe()' - - ubi: Fix seq_file usage in detailed_erase_block_info debugfs file - - gcc-common.h: Update for GCC 10 - - HID: multitouch: add eGalaxTouch P80H84 support - - scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV - - configfs: fix config_item refcnt leak in configfs_rmdir() - - vhost/vsock: fix packet delivery order to monitoring devices - - component: Silence bind error on -EPROBE_DEFER - - scsi: ibmvscsi: Fix WARN_ON during event pool release - - x86/apic: Move TSC deadline timer debug printk - - gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() - - ceph: fix double unlock in handle_cap_export() - - USB: core: Fix misleading driver bug report - - platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA - - ARM: futex: Address build warning - - padata: Replace delayed timer with immediate workqueue in padata_reorder - - padata: initialize pd->cpu with effective cpumask - - padata: purge get_cpu and reorder_via_wq from padata_do_serial - - arm64: fix the flush_icache_range arguments in machine_kexec - - ALSA: iec1712: Initialize STDSP24 properly when using the model=staudio - option - - ALSA: pcm: fix incorrect hw_base increase - - apparmor: Fix aa_label refcnt leak in policy_update - - dmaengine: tegra210-adma: Fix an error handling path in 'tegra_adma_probe()' - - powerpc: restore alphabetic order in Kconfig - - powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE - - powerpc/64s: Disable STRICT_KERNEL_RWX - - x86/uaccess, ubsan: Fix UBSAN vs. SMAP - - ubsan: build ubsan.c more conservatively - - libnvdimm/btt: Remove unnecessary code in btt_freelist_init - - libnvdimm/btt: Fix LBA masking during 'free list' population - - media: fdp1: Fix R-Car M3-N naming in debug message - - cxgb4: free mac_hlist properly - - cxgb4/cxgb4vf: Fix mac_hlist initialization and free - - Revert "gfs2: Don't demote a glock until its revokes are written" - - staging: iio: ad2s1210: Fix SPI reading - - staging: greybus: Fix uninitialized scalar variable - - iio: sca3000: Remove an erroneous 'get_device()' - - iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()' - - mei: release me_cl object reference - - rapidio: fix an error in get_user_pages_fast() error handling - - rxrpc: Fix a memory leak in rxkad_verify_response() - - x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks - - iio: adc: stm32-adc: Use dma_request_chan() instead - dma_request_slave_channel() - - iio: adc: stm32-adc: fix device used to request dma - - riscv: set max_pfn to the PFN of the last page - - ubifs: remove broken lazytime support - - HID: alps: Add AUI1657 device ID - - HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead - - aquantia: Fix the media type of AQC100 ethernet controller in the driver - - HID: i2c-hid: reset Synaptics SYNA2393 on resume - - HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock - - stmmac: fix pointer check after utilization in stmmac_interrupt - - ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Xtreme - - ALSA: hda/realtek - Add more fixup entries for Clevo machines - - drm/etnaviv: fix perfmon domain interation - - nfit: Add Hyper-V NVDIMM DSM command set to white list - - thunderbolt: Drop duplicated get_switch_at_route() - - net: bcmgenet: code movement - - net: bcmgenet: abort suspend on error - - misc: rtsx: Add short delay after exit from ASPM - * Bionic update: upstream stable patchset 2020-05-21 (LP: #1880014) - - USB: serial: qcserial: Add DW5816e support - - dp83640: reverse arguments to list_add_tail - - fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks - - net: macsec: preserve ingress frame ordering - - net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() - - net: usb: qmi_wwan: add support for DW5816e - - sch_choke: avoid potential panic in choke_reset() - - sch_sfq: validate silly quantum values - - bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features(). - - net/mlx5: Fix forced completion access non initialized command entry - - net/mlx5: Fix command entry leak in Internal Error State - - bnxt_en: Improve AER slot reset. - - bnxt_en: Fix VF anti-spoof filter setup. - - net: stricter validation of untrusted gso packets - - ipv6: fix cleanup ordering for ip6_mr failure - - HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices - - HID: usbhid: Fix race between usbhid_close() and usbhid_stop() - - USB: uas: add quirk for LaCie 2Big Quadra - - USB: serial: garmin_gps: add sanity checking for data length - - tracing: Add a vmalloc_sync_mappings() for safe measure - - KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER - - mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous() - - coredump: fix crash when umh is disabled - - batman-adv: fix batadv_nc_random_weight_tq - - batman-adv: Fix refcnt leak in batadv_show_throughput_override - - batman-adv: Fix refcnt leak in batadv_store_throughput_override - - batman-adv: Fix refcnt leak in batadv_v_ogm_process - - x86/entry/64: Fix unwind hints in kernel exit path - - x86/entry/64: Fix unwind hints in rewind_stack_do_exit() - - x86/unwind/orc: Don't skip the first frame for inactive tasks - - x86/unwind/orc: Prevent unwinding before ORC initialization - - x86/unwind/orc: Fix error path for bad ORC entry type - - netfilter: nat: never update the UDP checksum when it's 0 - - objtool: Fix stack offset tracking for indirect CFAs - - scripts/decodecode: fix trapping instruction formatting - - net: stmmac: Use mutex instead of spinlock - - shmem: fix possible deadlocks on shmlock_user_lock - - net/sonic: Fix a resource leak in an error handling path in - 'jazz_sonic_probe()' - - net: moxa: Fix a potential double 'free_irq()' - - drop_monitor: work around gcc-10 stringop-overflow warning - - virtio-blk: handle block_device_operations callbacks after hot unplug - - scsi: sg: add sg_remove_request in sg_write - - dmaengine: pch_dma.c: Avoid data race between probe and irq handler - - dmaengine: mmp_tdma: Reset channel error on release - - cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once - - ALSA: hda/hdmi: fix race in monitor detection during probe - - drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() - - ipc/util.c: sysvipc_find_ipc() incorrectly updates position index - - x86/entry/64: Fix unwind hints in register clearing code - - ipmi: Fix NULL pointer dereference in ssif_probe - - pinctrl: baytrail: Enable pin configuration setting for GPIO chip - - pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler - - i40iw: Fix error handling in i40iw_manage_arp_cache() - - netfilter: conntrack: avoid gcc-10 zero-length-bounds warning - - IB/mlx4: Test return value of calls to ib_get_cached_pkey - - hwmon: (da9052) Synchronize access with mfd - - pnp: Use list_for_each_entry() instead of open coding - - gcc-10 warnings: fix low-hanging fruit - - kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig - - Stop the ad-hoc games with -Wno-maybe-initialized - - gcc-10: disable 'zero-length-bounds' warning for now - - gcc-10: disable 'array-bounds' warning for now - - gcc-10: disable 'stringop-overflow' warning for now - - gcc-10: disable 'restrict' warning for now - - gcc-10: avoid shadowing standard library 'free()' in crypto - - x86/asm: Add instruction suffixes to bitops - - net: phy: micrel: Use strlcpy() for ethtool::get_strings - - net: fix a potential recursive NETDEV_FEAT_CHANGE - - net: phy: fix aneg restart in phy_ethtool_set_eee - - Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu" - - hinic: fix a bug of ndo_stop - - net: dsa: loop: Add module soft dependency - - net: ipv4: really enforce backoff for redirects - - netprio_cgroup: Fix unlimited memory leak of v2 cgroups - - net: tcp: fix rx timestamp behavior for tcp_recvmsg - - ALSA: hda/realtek - Limit int mic boost for Thinkpad T530 - - ALSA: rawmidi: Initialize allocated buffers - - ALSA: rawmidi: Fix racy buffer resize under concurrent accesses - - ARM: dts: dra7: Fix bus_dma_limit for PCIe - - ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries - - x86: Fix early boot crash on gcc-10, third try - - ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset - - usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B - - usb: host: xhci-plat: keep runtime active when removing host - - usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list - - x86/unwind/orc: Fix error handling in __unwind_start() - - exec: Move would_dump into flush_old_exec - - clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks - - usb: gadget: net2272: Fix a memory leak in an error handling path in - 'net2272_plat_probe()' - - usb: gadget: audio: Fix a missing error return value in audio_bind() - - usb: gadget: legacy: fix error return code in gncm_bind() - - usb: gadget: legacy: fix error return code in cdc_bind() - - arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 - boards - - arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy - - ARM: dts: r8a73a4: Add missing CMT1 interrupts - - ARM: dts: r8a7740: Add missing extal2 to CPG node - - KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce - - Makefile: disallow data races on gcc-10 as well - - sctp: Fix bundling of SHUTDOWN with COOKIE-ACK - - arm64: hugetlb: avoid potential NULL dereference - - net: dsa: Do not make user port errors fatal - - pppoe: only process PADT targeted at local interfaces - - riscv: fix vdso build with lld - - netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() - - cifs: fix leaked reference on requeued write - - clk: Unlink clock if failed to prepare or enable - * upgrading to 4.15.0-99-generic breaks the sound and the trackpad - (LP: #1875916) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - Revert "ALSA: hda/realtek: Fix pop noise on ALC225" - * Pop sound from build-in speaker during cold boot and resume from S3 - (LP: #1866357) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse - * Bionic update: upstream stable patchset 2020-05-19 (LP: #1879536) - - vhost: vsock: kick send_pkt worker once device is started - - powerpc/pci/of: Parse unassigned resources - - ASoC: topology: Check return value of pcm_new_ver - - selftests/ipc: Fix test failure seen after initial test run - - ASoC: sgtl5000: Fix VAG power-on handling - - ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode - - ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry - - wimax/i2400m: Fix potential urb refcnt leak - - net: stmmac: fix enabling socfpga's ptp_ref_clock - - net: stmmac: Fix sub-second increment - - cifs: protect updating server->dstaddr with a spinlock - - s390/ftrace: fix potential crashes when switching tracers - - scripts/config: allow colons in option strings for sed - - lib/mpi: Fix building for powerpc with clang - - net: bcmgenet: suppress warnings on failed Rx SKB allocations - - net: systemport: suppress warnings on failed Rx SKB allocations - - sctp: Fix SHUTDOWN CTSN Ack in the peer restart case - - ALSA: hda: Match both PCI ID and SSID for driver blacklist - - mac80211: add ieee80211_is_any_nullfunc() - - cgroup, netclassid: remove double cond_resched - - ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode - - drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay - table v0 (e.g Hawaii) - - ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent - - ASoC: rsnd: Fix "status check failed" spam for multi-SSI - - drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event - - hexagon: clean up ioremap - - hexagon: define ioremap_uc - - drm/atomic: Take the atomic toys away from X - * Performing function level reset of AMD onboard USB and audio devices causes - system lockup (LP: #1865988) - - SAUCE: PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 - - SAUCE: PCI: Avoid FLR for AMD Starship USB 3.0 - * add 16-bit width registers support for EEPROM at24 device (LP: #1876699) - - SAUCE: at24-smbus-16bit-address - * qeth: utilize virtual MAC for Layer2 OSD devices (LP: #1880834) - - s390/qeth: improve fallback to random MAC address - - s390/qeth: utilize virtual MAC for Layer2 OSD devices - * Slow send speed with Intel I219-V on Ubuntu 18.04.1 (LP: #1802691) - - e1000e: Disable TSO for buffer overrun workaround - * CVE-2020-10711 - - netlabel: cope with NULL catmap - * CVE-2020-13143 - - USB: gadget: fix illegal array access in binding with UDC - * rtl8723bu wifi issue after being turned off (LP: #1878296) - - rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver - - rtl8xxxu: add bluetooth co-existence support for single antenna - - rtl8xxxu: remove set but not used variable 'rate_mask' - - rtl8xxxu: Remove set but not used variable 'vif', 'dev', 'len' - * Cannot create ipvlans with > 1500 MTU on recent Bionic kernels - (LP: #1879658) - - ipvlan: use ETH_MAX_MTU as max mtu * Packaging resync (LP: #1786013) - - [Packaging] update helper scripts + - update dkms package versions + * dkms-build: downloads fail in private PPAs (LP: #1883874) + - dkms-build: apt-cache policy elides username:password information - -- Kelsey Skunberg Fri, 12 Jun 2020 00:46:47 -0600 + -- Kleber Sacilotto de Souza Mon, 22 Jun 2020 16:55:18 +0200 linux-oem (4.15.0-1087.97) bionic; urgency=medium diff -u linux-oem-4.15.0/debian.oem/tracking-bug linux-oem-4.15.0/debian.oem/tracking-bug --- linux-oem-4.15.0/debian.oem/tracking-bug +++ linux-oem-4.15.0/debian.oem/tracking-bug @@ -1 +1 @@ -1862011 +1878833 diff -u linux-oem-4.15.0/debian/changelog linux-oem-4.15.0/debian/changelog --- linux-oem-4.15.0/debian/changelog +++ linux-oem-4.15.0/debian/changelog @@ -1,259 +1,14 @@ -linux-oem (4.15.0-1088.98) bionic; urgency=medium +linux-oem (4.15.0-1090.100) bionic; urgency=medium - * bionic/linux-oem: 4.15.0-1088.98 -proposed tracker (LP: #1862011) - [ Ubuntu: 4.15.0-107.108 ] + [ Ubuntu: 4.15.0-108.109 ] - * CVE-2020-0543 - - UBUNTU/SAUCE: x86/speculation/srbds: do not try to turn mitigation off when - not supported - * Build Nvidia drivers in conjunction with kernel (LP: #1764792) - - [Packaging] disable nvidia dkms builds for mainline - * Bionic update: upstream stable patchset 2020-06-02 (LP: #1881801) - - i2c: dev: Fix the race between the release of i2c_dev and cdev - - ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() - - evm: Check also if *tfm is an error pointer in init_desc() - - ima: Fix return value of ima_write_policy() - - fix multiplication overflow in copy_fdtable() - - iommu/amd: Fix over-read of ACPI UID from IVRS table - - i2c: mux: demux-pinctrl: Fix an error handling path in - 'i2c_demux_pinctrl_probe()' - - ubi: Fix seq_file usage in detailed_erase_block_info debugfs file - - gcc-common.h: Update for GCC 10 - - HID: multitouch: add eGalaxTouch P80H84 support - - scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV - - configfs: fix config_item refcnt leak in configfs_rmdir() - - vhost/vsock: fix packet delivery order to monitoring devices - - component: Silence bind error on -EPROBE_DEFER - - scsi: ibmvscsi: Fix WARN_ON during event pool release - - x86/apic: Move TSC deadline timer debug printk - - gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() - - ceph: fix double unlock in handle_cap_export() - - USB: core: Fix misleading driver bug report - - platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA - - ARM: futex: Address build warning - - padata: Replace delayed timer with immediate workqueue in padata_reorder - - padata: initialize pd->cpu with effective cpumask - - padata: purge get_cpu and reorder_via_wq from padata_do_serial - - arm64: fix the flush_icache_range arguments in machine_kexec - - ALSA: iec1712: Initialize STDSP24 properly when using the model=staudio - option - - ALSA: pcm: fix incorrect hw_base increase - - apparmor: Fix aa_label refcnt leak in policy_update - - dmaengine: tegra210-adma: Fix an error handling path in 'tegra_adma_probe()' - - powerpc: restore alphabetic order in Kconfig - - powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE - - powerpc/64s: Disable STRICT_KERNEL_RWX - - x86/uaccess, ubsan: Fix UBSAN vs. SMAP - - ubsan: build ubsan.c more conservatively - - libnvdimm/btt: Remove unnecessary code in btt_freelist_init - - libnvdimm/btt: Fix LBA masking during 'free list' population - - media: fdp1: Fix R-Car M3-N naming in debug message - - cxgb4: free mac_hlist properly - - cxgb4/cxgb4vf: Fix mac_hlist initialization and free - - Revert "gfs2: Don't demote a glock until its revokes are written" - - staging: iio: ad2s1210: Fix SPI reading - - staging: greybus: Fix uninitialized scalar variable - - iio: sca3000: Remove an erroneous 'get_device()' - - iio: dac: vf610: Fix an error handling path in 'vf610_dac_probe()' - - mei: release me_cl object reference - - rapidio: fix an error in get_user_pages_fast() error handling - - rxrpc: Fix a memory leak in rxkad_verify_response() - - x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks - - iio: adc: stm32-adc: Use dma_request_chan() instead - dma_request_slave_channel() - - iio: adc: stm32-adc: fix device used to request dma - - riscv: set max_pfn to the PFN of the last page - - ubifs: remove broken lazytime support - - HID: alps: Add AUI1657 device ID - - HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead - - aquantia: Fix the media type of AQC100 ethernet controller in the driver - - HID: i2c-hid: reset Synaptics SYNA2393 on resume - - HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock - - stmmac: fix pointer check after utilization in stmmac_interrupt - - ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Xtreme - - ALSA: hda/realtek - Add more fixup entries for Clevo machines - - drm/etnaviv: fix perfmon domain interation - - nfit: Add Hyper-V NVDIMM DSM command set to white list - - thunderbolt: Drop duplicated get_switch_at_route() - - net: bcmgenet: code movement - - net: bcmgenet: abort suspend on error - - misc: rtsx: Add short delay after exit from ASPM - * Bionic update: upstream stable patchset 2020-05-21 (LP: #1880014) - - USB: serial: qcserial: Add DW5816e support - - dp83640: reverse arguments to list_add_tail - - fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks - - net: macsec: preserve ingress frame ordering - - net/mlx4_core: Fix use of ENOSPC around mlx4_counter_alloc() - - net: usb: qmi_wwan: add support for DW5816e - - sch_choke: avoid potential panic in choke_reset() - - sch_sfq: validate silly quantum values - - bnxt_en: Fix VLAN acceleration handling in bnxt_fix_features(). - - net/mlx5: Fix forced completion access non initialized command entry - - net/mlx5: Fix command entry leak in Internal Error State - - bnxt_en: Improve AER slot reset. - - bnxt_en: Fix VF anti-spoof filter setup. - - net: stricter validation of untrusted gso packets - - ipv6: fix cleanup ordering for ip6_mr failure - - HID: wacom: Read HID_DG_CONTACTMAX directly for non-generic devices - - HID: usbhid: Fix race between usbhid_close() and usbhid_stop() - - USB: uas: add quirk for LaCie 2Big Quadra - - USB: serial: garmin_gps: add sanity checking for data length - - tracing: Add a vmalloc_sync_mappings() for safe measure - - KVM: arm: vgic: Fix limit condition when writing to GICD_I[CS]ACTIVER - - mm/page_alloc: fix watchdog soft lockups during set_zone_contiguous() - - coredump: fix crash when umh is disabled - - batman-adv: fix batadv_nc_random_weight_tq - - batman-adv: Fix refcnt leak in batadv_show_throughput_override - - batman-adv: Fix refcnt leak in batadv_store_throughput_override - - batman-adv: Fix refcnt leak in batadv_v_ogm_process - - x86/entry/64: Fix unwind hints in kernel exit path - - x86/entry/64: Fix unwind hints in rewind_stack_do_exit() - - x86/unwind/orc: Don't skip the first frame for inactive tasks - - x86/unwind/orc: Prevent unwinding before ORC initialization - - x86/unwind/orc: Fix error path for bad ORC entry type - - netfilter: nat: never update the UDP checksum when it's 0 - - objtool: Fix stack offset tracking for indirect CFAs - - scripts/decodecode: fix trapping instruction formatting - - net: stmmac: Use mutex instead of spinlock - - shmem: fix possible deadlocks on shmlock_user_lock - - net/sonic: Fix a resource leak in an error handling path in - 'jazz_sonic_probe()' - - net: moxa: Fix a potential double 'free_irq()' - - drop_monitor: work around gcc-10 stringop-overflow warning - - virtio-blk: handle block_device_operations callbacks after hot unplug - - scsi: sg: add sg_remove_request in sg_write - - dmaengine: pch_dma.c: Avoid data race between probe and irq handler - - dmaengine: mmp_tdma: Reset channel error on release - - cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once - - ALSA: hda/hdmi: fix race in monitor detection during probe - - drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper() - - ipc/util.c: sysvipc_find_ipc() incorrectly updates position index - - x86/entry/64: Fix unwind hints in register clearing code - - ipmi: Fix NULL pointer dereference in ssif_probe - - pinctrl: baytrail: Enable pin configuration setting for GPIO chip - - pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler - - i40iw: Fix error handling in i40iw_manage_arp_cache() - - netfilter: conntrack: avoid gcc-10 zero-length-bounds warning - - IB/mlx4: Test return value of calls to ib_get_cached_pkey - - hwmon: (da9052) Synchronize access with mfd - - pnp: Use list_for_each_entry() instead of open coding - - gcc-10 warnings: fix low-hanging fruit - - kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig - - Stop the ad-hoc games with -Wno-maybe-initialized - - gcc-10: disable 'zero-length-bounds' warning for now - - gcc-10: disable 'array-bounds' warning for now - - gcc-10: disable 'stringop-overflow' warning for now - - gcc-10: disable 'restrict' warning for now - - gcc-10: avoid shadowing standard library 'free()' in crypto - - x86/asm: Add instruction suffixes to bitops - - net: phy: micrel: Use strlcpy() for ethtool::get_strings - - net: fix a potential recursive NETDEV_FEAT_CHANGE - - net: phy: fix aneg restart in phy_ethtool_set_eee - - Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu" - - hinic: fix a bug of ndo_stop - - net: dsa: loop: Add module soft dependency - - net: ipv4: really enforce backoff for redirects - - netprio_cgroup: Fix unlimited memory leak of v2 cgroups - - net: tcp: fix rx timestamp behavior for tcp_recvmsg - - ALSA: hda/realtek - Limit int mic boost for Thinkpad T530 - - ALSA: rawmidi: Initialize allocated buffers - - ALSA: rawmidi: Fix racy buffer resize under concurrent accesses - - ARM: dts: dra7: Fix bus_dma_limit for PCIe - - ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries - - x86: Fix early boot crash on gcc-10, third try - - ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset - - usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B - - usb: host: xhci-plat: keep runtime active when removing host - - usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list - - x86/unwind/orc: Fix error handling in __unwind_start() - - exec: Move would_dump into flush_old_exec - - clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks - - usb: gadget: net2272: Fix a memory leak in an error handling path in - 'net2272_plat_probe()' - - usb: gadget: audio: Fix a missing error return value in audio_bind() - - usb: gadget: legacy: fix error return code in gncm_bind() - - usb: gadget: legacy: fix error return code in cdc_bind() - - arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 - boards - - arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy - - ARM: dts: r8a73a4: Add missing CMT1 interrupts - - ARM: dts: r8a7740: Add missing extal2 to CPG node - - KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce - - Makefile: disallow data races on gcc-10 as well - - sctp: Fix bundling of SHUTDOWN with COOKIE-ACK - - arm64: hugetlb: avoid potential NULL dereference - - net: dsa: Do not make user port errors fatal - - pppoe: only process PADT targeted at local interfaces - - riscv: fix vdso build with lld - - netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() - - cifs: fix leaked reference on requeued write - - clk: Unlink clock if failed to prepare or enable - * upgrading to 4.15.0-99-generic breaks the sound and the trackpad - (LP: #1875916) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - Revert "ALSA: hda/realtek: Fix pop noise on ALC225" - * Pop sound from build-in speaker during cold boot and resume from S3 - (LP: #1866357) // Bionic update: upstream stable patchset 2020-05-21 - (LP: #1880014) - - ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse - * Bionic update: upstream stable patchset 2020-05-19 (LP: #1879536) - - vhost: vsock: kick send_pkt worker once device is started - - powerpc/pci/of: Parse unassigned resources - - ASoC: topology: Check return value of pcm_new_ver - - selftests/ipc: Fix test failure seen after initial test run - - ASoC: sgtl5000: Fix VAG power-on handling - - ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode - - ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry - - wimax/i2400m: Fix potential urb refcnt leak - - net: stmmac: fix enabling socfpga's ptp_ref_clock - - net: stmmac: Fix sub-second increment - - cifs: protect updating server->dstaddr with a spinlock - - s390/ftrace: fix potential crashes when switching tracers - - scripts/config: allow colons in option strings for sed - - lib/mpi: Fix building for powerpc with clang - - net: bcmgenet: suppress warnings on failed Rx SKB allocations - - net: systemport: suppress warnings on failed Rx SKB allocations - - sctp: Fix SHUTDOWN CTSN Ack in the peer restart case - - ALSA: hda: Match both PCI ID and SSID for driver blacklist - - mac80211: add ieee80211_is_any_nullfunc() - - cgroup, netclassid: remove double cond_resched - - ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode - - drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay - table v0 (e.g Hawaii) - - ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent - - ASoC: rsnd: Fix "status check failed" spam for multi-SSI - - drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event - - hexagon: clean up ioremap - - hexagon: define ioremap_uc - - drm/atomic: Take the atomic toys away from X - * Performing function level reset of AMD onboard USB and audio devices causes - system lockup (LP: #1865988) - - SAUCE: PCI: Avoid FLR for AMD Matisse HD Audio & USB 3.0 - - SAUCE: PCI: Avoid FLR for AMD Starship USB 3.0 - * add 16-bit width registers support for EEPROM at24 device (LP: #1876699) - - SAUCE: at24-smbus-16bit-address - * qeth: utilize virtual MAC for Layer2 OSD devices (LP: #1880834) - - s390/qeth: improve fallback to random MAC address - - s390/qeth: utilize virtual MAC for Layer2 OSD devices - * Slow send speed with Intel I219-V on Ubuntu 18.04.1 (LP: #1802691) - - e1000e: Disable TSO for buffer overrun workaround - * CVE-2020-10711 - - netlabel: cope with NULL catmap - * CVE-2020-13143 - - USB: gadget: fix illegal array access in binding with UDC - * rtl8723bu wifi issue after being turned off (LP: #1878296) - - rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver - - rtl8xxxu: add bluetooth co-existence support for single antenna - - rtl8xxxu: remove set but not used variable 'rate_mask' - - rtl8xxxu: Remove set but not used variable 'vif', 'dev', 'len' - * Cannot create ipvlans with > 1500 MTU on recent Bionic kernels - (LP: #1879658) - - ipvlan: use ETH_MAX_MTU as max mtu * Packaging resync (LP: #1786013) - - [Packaging] update helper scripts + - update dkms package versions + * dkms-build: downloads fail in private PPAs (LP: #1883874) + - dkms-build: apt-cache policy elides username:password information - -- Kelsey Skunberg Fri, 12 Jun 2020 00:46:47 -0600 + -- Kleber Sacilotto de Souza Mon, 22 Jun 2020 16:55:18 +0200 linux-oem (4.15.0-1087.97) bionic; urgency=medium diff -u linux-oem-4.15.0/debian/control linux-oem-4.15.0/debian/control --- linux-oem-4.15.0/debian/control +++ linux-oem-4.15.0/debian/control @@ -50,7 +50,7 @@ XS-Testsuite: autopkgtest #XS-Testsuite-Depends: gcc-4.7 binutils -Package: linux-oem-headers-4.15.0-1088 +Package: linux-oem-headers-4.15.0-1090 Build-Profiles: Architecture: all Multi-Arch: foreign @@ -60,32 +60,32 @@ Description: Header files related to Linux kernel version 4.15.0 This package provides kernel header files for version 4.15.0, for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-oem-headers-4.15.0-1088/debian.README.gz for details + /usr/share/doc/linux-oem-headers-4.15.0-1090/debian.README.gz for details -Package: linux-oem-tools-4.15.0-1088 +Package: linux-oem-tools-4.15.0-1090 Build-Profiles: Architecture: amd64 Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common -Description: Linux kernel version specific tools for version 4.15.0-1088 +Description: Linux kernel version specific tools for version 4.15.0-1090 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 4.15.0-1088 on + version 4.15.0-1090 on 64 bit x86. - You probably want to install linux-tools-4.15.0-1088-. + You probably want to install linux-tools-4.15.0-1090-. -Package: linux-image-unsigned-4.15.0-1088-oem +Package: linux-image-unsigned-4.15.0-1090-oem Build-Profiles: Architecture: amd64 Section: kernel Priority: optional Provides: linux-image, fuse-module, aufs-dkms, kvm-api-4, redhat-cluster-modules, ivtv-modules, virtualbox-guest-modules [i386 amd64 x32]${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-4.15.0-1088-oem +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-4.15.0-1090-oem Recommends: grub-pc [i386 amd64 x32] | grub-efi-amd64 [amd64 x32] | grub-efi-ia32 [i386 amd64 x32] | grub [i386 amd64 x32] | lilo [i386 amd64 x32] | flash-kernel [armhf arm64] | grub-ieee1275 [ppc64el], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.0~rc.4ubuntu64) [arm64] -Conflicts: linux-image-4.15.0-1088-oem -Suggests: fdutils, linux-oem-tools, linux-headers-4.15.0-1088-oem +Conflicts: linux-image-4.15.0-1090-oem +Suggests: fdutils, linux-oem-tools, linux-headers-4.15.0-1090-oem Description: Linux kernel image for version 4.15.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 4.15.0 on 64 bit x86 SMP. @@ -98,7 +98,7 @@ the linux-oem meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-4.15.0-1088-oem +Package: linux-modules-4.15.0-1090-oem Build-Profiles: Architecture: amd64 Section: kernel @@ -116,21 +116,21 @@ the linux-oem meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-4.15.0-1088-oem +Package: linux-headers-4.15.0-1090-oem Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-oem-headers-4.15.0-1088, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-oem-headers-4.15.0-1090, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 4.15.0 on 64 bit x86 SMP This package provides kernel header files for version 4.15.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-4.15.0-1088/debian.README.gz for details. + /usr/share/doc/linux-headers-4.15.0-1090/debian.README.gz for details. -Package: linux-image-unsigned-4.15.0-1088-oem-dbgsym +Package: linux-image-unsigned-4.15.0-1090-oem-dbgsym Build-Profiles: Architecture: amd64 Section: devel @@ -147,16 +147,16 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-4.15.0-1088-oem +Package: linux-tools-4.15.0-1090-oem Build-Profiles: Architecture: amd64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-oem-tools-4.15.0-1088 -Description: Linux kernel version specific tools for version 4.15.0-1088 +Depends: ${misc:Depends}, linux-oem-tools-4.15.0-1090 +Description: Linux kernel version specific tools for version 4.15.0-1090 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 4.15.0-1088 on + version 4.15.0-1090 on 64 bit x86. Package: linux-udebs-oem @@ -170,7 +170,7 @@ for easier version and migration tracking. -Package: linux-buildinfo-4.15.0-1088-oem +Package: linux-buildinfo-4.15.0-1090-oem Build-Profiles: Architecture: amd64 Section: kernel diff -u linux-oem-4.15.0/debian/dkms-versions linux-oem-4.15.0/debian/dkms-versions --- linux-oem-4.15.0/debian/dkms-versions +++ linux-oem-4.15.0/debian/dkms-versions @@ -3,3 +3,3 @@ -nvidia-graphics-drivers-390 390.132-0ubuntu0.18.04.1 +nvidia-graphics-drivers-390 390.138-0ubuntu0.18.04.1 nvidia-graphics-drivers-435 435.21-0ubuntu0.18.04.2 -nvidia-graphics-drivers-440 440.59-0ubuntu0.18.04.1 +nvidia-graphics-drivers-440 440.100-0ubuntu0.18.04.1 diff -u linux-oem-4.15.0/debian/rules linux-oem-4.15.0/debian/rules --- linux-oem-4.15.0/debian/rules +++ linux-oem-4.15.0/debian/rules @@ -44,7 +44,6 @@ do_tools=false disable_d_i=true do_zfs=false - do_dkms_nvidia=false endif # Are any of the kernel signing options enabled. @@ -76,7 +75,6 @@ do_tools=false no_dumpfile=1 do_zfs=false - do_dkms_nvidia=false skipabi=true skipmodule=true skipretpoline=true diff -u linux-oem-4.15.0/debian/scripts/dkms-build linux-oem-4.15.0/debian/scripts/dkms-build --- linux-oem-4.15.0/debian/scripts/dkms-build +++ linux-oem-4.15.0/debian/scripts/dkms-build @@ -60,15 +60,7 @@ fi # Download from the available pools. - for pool in $( apt-cache policy | grep '^ [^ ]' | sort -r -n -k 1,1 -s | \ - awk ' - ($2 ~ /^http/) { - if (!($2 in E)) { - E[$2]=1; - print $2; - } - } - ') + for pool in $( grep -h '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | awk '{print $2}' | sort -u ) do if package_present "$lpackage"; then break diff -u linux-oem-4.15.0/debian/scripts/helpers/close linux-oem-4.15.0/debian/scripts/helpers/close --- linux-oem-4.15.0/debian/scripts/helpers/close +++ linux-oem-4.15.0/debian/scripts/helpers/close @@ -109,20 +109,15 @@ fi # Update configs -if [ -d "$DEBIAN/config" ]; then - chroot_run fakeroot debian/rules clean updateconfigs - changes=$(git diff HEAD -- "./$DEBIAN/config/") - if [ "$commit_configs" -eq 0 ] && [ -n "$changes" ]; then - echo "Config has changed! please, review it and commit." - exit 1 - fi +chroot_run fakeroot debian/rules clean updateconfigs +changes=$(git diff HEAD -- "./$DEBIAN/config/") +if [ "$commit_configs" -eq 0 ] && [ -n "$changes" ]; then + echo "Config has changed! please, review it and commit." + exit 1 fi # Derivatives and backports have a master kernel directory (DEBIAN_MASTER). -case "$DEBIAN" in -debian.master|debian.uc20-efi) skip_master_entries=1 ;; -esac -if [ $skip_master_entries == 0 ]; then +if [ "$DEBIAN" != 'debian.master' ] && [ $skip_master_entries == 0 ]; then if [ "$DEBIAN_MASTER" = "" ]; then echo "DEBIAN_MASTER should be defined either in $DEBIAN/etc/update.conf or the environment" exit 1 diff -u linux-oem-4.15.0/debian/scripts/helpers/rebase linux-oem-4.15.0/debian/scripts/helpers/rebase --- linux-oem-4.15.0/debian/scripts/helpers/rebase +++ linux-oem-4.15.0/debian/scripts/helpers/rebase @@ -56,18 +56,6 @@ done shift $((OPTIND - 1)) -case "$DEBIAN" in -debian.master|debian.uc20-efi) - echo "This is not a rebase kernel, no rebase should be needed, please report if otherwise" - exit 0 - ;; -esac - -if [ "$DEBIAN_MASTER" = "" ]; then - echo "DEBIAN_MASTER should be defined either in ${DEBIAN}/etc/update.conf or the environment" - exit 1 -fi - if [ -z "${LOCAL_BRANCH}" ]; then if [ -z "${RELEASE_REPO}" ] || [ -z "${SOURCE_RELEASE_BRANCH}" ]; then echo Missing update.conf or missing parameters for remote repo and branch. @@ -81,6 +69,16 @@ LOCAL_BRANCH=FETCH_HEAD fi +if [ "$DEBIAN" = "debian.master" ]; then + echo "This is a master kernel, no rebase should be needed, please report if otherwise" + exit 0 +fi + +if [ "$DEBIAN_MASTER" = "" ]; then + echo "DEBIAN_MASTER should be defined either in ${DEBIAN}/etc/update.conf or the environment" + exit 1 +fi + # # Find the most recent tag on given upstream branch, then # rebase against it. This avoids the case where there have been some diff -u linux-oem-4.15.0/drivers/acpi/nfit/core.c linux-oem-4.15.0/drivers/acpi/nfit/core.c --- linux-oem-4.15.0/drivers/acpi/nfit/core.c +++ linux-oem-4.15.0/drivers/acpi/nfit/core.c @@ -1739,17 +1739,9 @@ dev_set_drvdata(&adev_dimm->dev, nfit_mem); /* - * There are 4 "legacy" NVDIMM command sets - * (NVDIMM_FAMILY_{INTEL,MSFT,HPE1,HPE2}) that were created before - * an EFI working group was established to constrain this - * proliferation. The nfit driver probes for the supported command - * set by GUID. Note, if you're a platform developer looking to add - * a new command set to this probe, consider using an existing set, - * or otherwise seek approval to publish the command set at - * http://www.uefi.org/RFIC_LIST. - * - * Note, that checking for function0 (bit0) tells us if any commands - * are reachable through this GUID. + * Until standardization materializes we need to consider 4 + * different command sets. Note, that checking for function0 (bit0) + * tells us if any commands are reachable through this GUID. */ for (i = 0; i <= NVDIMM_FAMILY_MAX; i++) if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1)) @@ -1772,8 +1764,6 @@ dsm_mask &= ~(1 << 8); } else if (nfit_mem->family == NVDIMM_FAMILY_MSFT) { dsm_mask = 0xffffffff; - } else if (nfit_mem->family == NVDIMM_FAMILY_HYPERV) { - dsm_mask = 0x1f; } else { dev_dbg(dev, "unknown dimm command family\n"); nfit_mem->family = -1; @@ -3566,7 +3556,6 @@ guid_parse(UUID_NFIT_DIMM_N_HPE1, &nfit_uuid[NFIT_DEV_DIMM_N_HPE1]); guid_parse(UUID_NFIT_DIMM_N_HPE2, &nfit_uuid[NFIT_DEV_DIMM_N_HPE2]); guid_parse(UUID_NFIT_DIMM_N_MSFT, &nfit_uuid[NFIT_DEV_DIMM_N_MSFT]); - guid_parse(UUID_NFIT_DIMM_N_HYPERV, &nfit_uuid[NFIT_DEV_DIMM_N_HYPERV]); nfit_wq = create_singlethread_workqueue("nfit"); if (!nfit_wq) diff -u linux-oem-4.15.0/drivers/acpi/nfit/nfit.h linux-oem-4.15.0/drivers/acpi/nfit/nfit.h --- linux-oem-4.15.0/drivers/acpi/nfit/nfit.h +++ linux-oem-4.15.0/drivers/acpi/nfit/nfit.h @@ -34,14 +34,11 @@ /* https://msdn.microsoft.com/library/windows/hardware/mt604741 */ #define UUID_NFIT_DIMM_N_MSFT "1ee68b36-d4bd-4a1a-9a16-4f8e53d46e05" -/* http://www.uefi.org/RFIC_LIST (see "Virtual NVDIMM 0x1901") */ -#define UUID_NFIT_DIMM_N_HYPERV "5746c5f2-a9a2-4264-ad0e-e4ddc9e09e80" - #define ACPI_NFIT_MEM_FAILED_MASK (ACPI_NFIT_MEM_SAVE_FAILED \ | ACPI_NFIT_MEM_RESTORE_FAILED | ACPI_NFIT_MEM_FLUSH_FAILED \ | ACPI_NFIT_MEM_NOT_ARMED | ACPI_NFIT_MEM_MAP_FAILED) -#define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_HYPERV +#define NVDIMM_FAMILY_MAX NVDIMM_FAMILY_MSFT #define NVDIMM_STANDARD_CMDMASK \ (1 << ND_CMD_SMART | 1 << ND_CMD_SMART_THRESHOLD | 1 << ND_CMD_DIMM_FLAGS \ @@ -78,7 +75,6 @@ NFIT_DEV_DIMM_N_HPE1 = NVDIMM_FAMILY_HPE1, NFIT_DEV_DIMM_N_HPE2 = NVDIMM_FAMILY_HPE2, NFIT_DEV_DIMM_N_MSFT = NVDIMM_FAMILY_MSFT, - NFIT_DEV_DIMM_N_HYPERV = NVDIMM_FAMILY_HYPERV, NFIT_SPA_VOLATILE, NFIT_SPA_PM, NFIT_SPA_DCR, diff -u linux-oem-4.15.0/drivers/base/component.c linux-oem-4.15.0/drivers/base/component.c --- linux-oem-4.15.0/drivers/base/component.c +++ linux-oem-4.15.0/drivers/base/component.c @@ -162,8 +162,7 @@ ret = master->ops->bind(master->dev); if (ret < 0) { devres_release_group(master->dev, NULL); - if (ret != -EPROBE_DEFER) - dev_info(master->dev, "master bind failed: %d\n", ret); + dev_info(master->dev, "master bind failed: %d\n", ret); return ret; } @@ -432,9 +431,8 @@ devres_release_group(component->dev, NULL); devres_release_group(master->dev, NULL); - if (ret != -EPROBE_DEFER) - dev_err(master->dev, "failed to bind %s (ops %ps): %d\n", - dev_name(component->dev), component->ops, ret); + dev_err(master->dev, "failed to bind %s (ops %ps): %d\n", + dev_name(component->dev), component->ops, ret); } return ret; diff -u linux-oem-4.15.0/drivers/block/virtio_blk.c linux-oem-4.15.0/drivers/block/virtio_blk.c --- linux-oem-4.15.0/drivers/block/virtio_blk.c +++ linux-oem-4.15.0/drivers/block/virtio_blk.c @@ -31,15 +31,6 @@ } ____cacheline_aligned_in_smp; struct virtio_blk { - /* - * This mutex must be held by anything that may run after - * virtblk_remove() sets vblk->vdev to NULL. - * - * blk-mq, virtqueue processing, and sysfs attribute code paths are - * shut down before vblk->vdev is set to NULL and therefore do not need - * to hold this mutex. - */ - struct mutex vdev_mutex; struct virtio_device *vdev; /* The disk structure for the kernel. */ @@ -51,13 +42,6 @@ /* Process context for config space updates */ struct work_struct config_work; - /* - * Tracks references from block_device_operations open/release and - * virtio_driver probe/remove so this object can be freed once no - * longer in use. - */ - refcount_t refs; - /* What host tells us, plus 2 for header & tailer. */ unsigned int sg_elems; @@ -336,55 +320,10 @@ return err; } -static void virtblk_get(struct virtio_blk *vblk) -{ - refcount_inc(&vblk->refs); -} - -static void virtblk_put(struct virtio_blk *vblk) -{ - if (refcount_dec_and_test(&vblk->refs)) { - ida_simple_remove(&vd_index_ida, vblk->index); - mutex_destroy(&vblk->vdev_mutex); - kfree(vblk); - } -} - -static int virtblk_open(struct block_device *bd, fmode_t mode) -{ - struct virtio_blk *vblk = bd->bd_disk->private_data; - int ret = 0; - - mutex_lock(&vblk->vdev_mutex); - - if (vblk->vdev) - virtblk_get(vblk); - else - ret = -ENXIO; - - mutex_unlock(&vblk->vdev_mutex); - return ret; -} - -static void virtblk_release(struct gendisk *disk, fmode_t mode) -{ - struct virtio_blk *vblk = disk->private_data; - - virtblk_put(vblk); -} - /* We provide getgeo only to please some old bootloader/partitioning tools */ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo) { struct virtio_blk *vblk = bd->bd_disk->private_data; - int ret = 0; - - mutex_lock(&vblk->vdev_mutex); - - if (!vblk->vdev) { - ret = -ENXIO; - goto out; - } /* see if the host passed in geometry config */ if (virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_GEOMETRY)) { @@ -400,16 +339,12 @@ geo->sectors = 1 << 5; geo->cylinders = get_capacity(bd->bd_disk) >> 11; } -out: - mutex_unlock(&vblk->vdev_mutex); - return ret; + return 0; } static const struct block_device_operations virtblk_fops = { .ioctl = virtblk_ioctl, .owner = THIS_MODULE, - .open = virtblk_open, - .release = virtblk_release, .getgeo = virtblk_getgeo, }; @@ -729,10 +664,6 @@ goto out_free_index; } - /* This reference is dropped in virtblk_remove(). */ - refcount_set(&vblk->refs, 1); - mutex_init(&vblk->vdev_mutex); - vblk->vdev = vdev; vblk->sg_elems = sg_elems; @@ -895,6 +826,8 @@ static void virtblk_remove(struct virtio_device *vdev) { struct virtio_blk *vblk = vdev->priv; + int index = vblk->index; + int refc; /* Make sure no work handler is accessing the device. */ flush_work(&vblk->config_work); @@ -904,21 +837,18 @@ blk_mq_free_tag_set(&vblk->tag_set); - mutex_lock(&vblk->vdev_mutex); - /* Stop all the virtqueues. */ vdev->config->reset(vdev); - /* Virtqueues are stopped, nothing can use vblk->vdev anymore. */ - vblk->vdev = NULL; - + refc = kref_read(&disk_to_dev(vblk->disk)->kobj.kref); put_disk(vblk->disk); vdev->config->del_vqs(vdev); kfree(vblk->vqs); + kfree(vblk); - mutex_unlock(&vblk->vdev_mutex); - - virtblk_put(vblk); + /* Only free device id if we don't have any users */ + if (refc == 1) + ida_simple_remove(&vd_index_ida, index); } #ifdef CONFIG_PM_SLEEP diff -u linux-oem-4.15.0/drivers/char/ipmi/ipmi_ssif.c linux-oem-4.15.0/drivers/char/ipmi/ipmi_ssif.c --- linux-oem-4.15.0/drivers/char/ipmi/ipmi_ssif.c +++ linux-oem-4.15.0/drivers/char/ipmi/ipmi_ssif.c @@ -1894,9 +1894,7 @@ out: if (rv) { - if (addr_info) - addr_info->client = NULL; - + addr_info->client = NULL; dev_err(&client->dev, "Unable to start IPMI SSIF: %d\n", rv); kfree(ssif_info); } diff -u linux-oem-4.15.0/drivers/clk/clk.c linux-oem-4.15.0/drivers/clk/clk.c --- linux-oem-4.15.0/drivers/clk/clk.c +++ linux-oem-4.15.0/drivers/clk/clk.c @@ -2651,9 +2651,6 @@ out: clk_pm_runtime_put(core); unlock: - if (ret) - hlist_del_init(&core->child_node); - clk_prepare_unlock(); if (!ret) diff -u linux-oem-4.15.0/drivers/clk/rockchip/clk-rk3228.c linux-oem-4.15.0/drivers/clk/rockchip/clk-rk3228.c --- linux-oem-4.15.0/drivers/clk/rockchip/clk-rk3228.c +++ linux-oem-4.15.0/drivers/clk/rockchip/clk-rk3228.c @@ -163,6 +163,8 @@ PNAME(mux_i2s2_p) = { "i2s2_src", "i2s2_frac", "xin12m" }; PNAME(mux_sclk_spdif_p) = { "sclk_spdif_src", "spdif_frac", "xin12m" }; +PNAME(mux_aclk_gpu_pre_p) = { "cpll_gpu", "gpll_gpu", "hdmiphy_gpu", "usb480m_gpu" }; + PNAME(mux_uart0_p) = { "uart0_src", "uart0_frac", "xin24m" }; PNAME(mux_uart1_p) = { "uart1_src", "uart1_frac", "xin24m" }; PNAME(mux_uart2_p) = { "uart2_src", "uart2_frac", "xin24m" }; @@ -473,9 +475,16 @@ RK2928_CLKSEL_CON(24), 6, 10, DFLAGS, RK2928_CLKGATE_CON(2), 8, GFLAGS), - COMPOSITE(0, "aclk_gpu_pre", mux_pll_src_4plls_p, 0, - RK2928_CLKSEL_CON(34), 5, 2, MFLAGS, 0, 5, DFLAGS, + GATE(0, "cpll_gpu", "cpll", 0, + RK2928_CLKGATE_CON(3), 13, GFLAGS), + GATE(0, "gpll_gpu", "gpll", 0, + RK2928_CLKGATE_CON(3), 13, GFLAGS), + GATE(0, "hdmiphy_gpu", "hdmiphy", 0, + RK2928_CLKGATE_CON(3), 13, GFLAGS), + GATE(0, "usb480m_gpu", "usb480m", 0, RK2928_CLKGATE_CON(3), 13, GFLAGS), + COMPOSITE_NOGATE(0, "aclk_gpu_pre", mux_aclk_gpu_pre_p, 0, + RK2928_CLKSEL_CON(34), 5, 2, MFLAGS, 0, 5, DFLAGS), COMPOSITE(SCLK_SPI0, "sclk_spi0", mux_pll_src_2plls_p, 0, RK2928_CLKSEL_CON(25), 8, 1, MFLAGS, 0, 7, DFLAGS, @@ -580,8 +589,8 @@ GATE(0, "pclk_peri_noc", "pclk_peri", CLK_IGNORE_UNUSED, RK2928_CLKGATE_CON(12), 2, GFLAGS), /* PD_GPU */ - GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(7), 14, GFLAGS), - GATE(0, "aclk_gpu_noc", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(7), 15, GFLAGS), + GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(13), 14, GFLAGS), + GATE(0, "aclk_gpu_noc", "aclk_gpu_pre", 0, RK2928_CLKGATE_CON(13), 15, GFLAGS), /* PD_BUS */ GATE(0, "sclk_initmem_mbist", "aclk_cpu", 0, RK2928_CLKGATE_CON(8), 1, GFLAGS), diff -u linux-oem-4.15.0/drivers/cpufreq/intel_pstate.c linux-oem-4.15.0/drivers/cpufreq/intel_pstate.c --- linux-oem-4.15.0/drivers/cpufreq/intel_pstate.c +++ linux-oem-4.15.0/drivers/cpufreq/intel_pstate.c @@ -935,7 +935,7 @@ update_turbo_state(); if (global.turbo_disabled) { - pr_notice_once("Turbo disabled by BIOS or unavailable on processor\n"); + pr_warn("Turbo disabled by BIOS or unavailable on processor\n"); mutex_unlock(&intel_pstate_limits_lock); mutex_unlock(&intel_pstate_driver_lock); return -EPERM; reverted: --- linux-oem-4.15.0/drivers/dma/mmp_tdma.c +++ linux-oem-4.15.0.orig/drivers/dma/mmp_tdma.c @@ -362,8 +362,6 @@ gen_pool_free(gpool, (unsigned long)tdmac->desc_arr, size); tdmac->desc_arr = NULL; - if (tdmac->status == DMA_ERROR) - tdmac->status = DMA_COMPLETE; return; } reverted: --- linux-oem-4.15.0/drivers/dma/pch_dma.c +++ linux-oem-4.15.0.orig/drivers/dma/pch_dma.c @@ -873,7 +873,6 @@ } pci_set_master(pdev); - pd->dma.dev = &pdev->dev; err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd); if (err) { @@ -889,6 +888,7 @@ goto err_free_irq; } + pd->dma.dev = &pdev->dev; INIT_LIST_HEAD(&pd->dma.channels); diff -u linux-oem-4.15.0/drivers/dma/tegra210-adma.c linux-oem-4.15.0/drivers/dma/tegra210-adma.c --- linux-oem-4.15.0/drivers/dma/tegra210-adma.c +++ linux-oem-4.15.0/drivers/dma/tegra210-adma.c @@ -793,7 +793,7 @@ ret = dma_async_device_register(&tdma->dma_dev); if (ret < 0) { dev_err(&pdev->dev, "ADMA registration failed: %d\n", ret); - goto rpm_put; + goto irq_dispose; } ret = of_dma_controller_register(pdev->dev.of_node, diff -u linux-oem-4.15.0/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c linux-oem-4.15.0/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c --- linux-oem-4.15.0/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ linux-oem-4.15.0/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -73,8 +73,7 @@ adev->pm.dpm.ac_power = true; else adev->pm.dpm.ac_power = false; - if (adev->powerplay.pp_funcs && - adev->powerplay.pp_funcs->enable_bapm) + if (adev->powerplay.pp_funcs->enable_bapm) amdgpu_dpm_enable_bapm(adev, adev->pm.dpm.ac_power); mutex_unlock(&adev->pm.mutex); } reverted: --- linux-oem-4.15.0/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +++ linux-oem-4.15.0.orig/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c @@ -983,32 +983,6 @@ struct pp_hwmgr *hwmgr, const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table) { - hwmgr->thermal_controller.ucType = - powerplay_table->sThermalController.ucType; - hwmgr->thermal_controller.ucI2cLine = - powerplay_table->sThermalController.ucI2cLine; - hwmgr->thermal_controller.ucI2cAddress = - powerplay_table->sThermalController.ucI2cAddress; - - hwmgr->thermal_controller.fanInfo.bNoFan = - (0 != (powerplay_table->sThermalController.ucFanParameters & - ATOM_PP_FANPARAMETERS_NOFAN)); - - hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution = - powerplay_table->sThermalController.ucFanParameters & - ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK; - - hwmgr->thermal_controller.fanInfo.ulMinRPM - = powerplay_table->sThermalController.ucFanMinRPM * 100UL; - hwmgr->thermal_controller.fanInfo.ulMaxRPM - = powerplay_table->sThermalController.ucFanMaxRPM * 100UL; - - set_hw_cap(hwmgr, - ATOM_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType, - PHM_PlatformCaps_ThermalController); - - hwmgr->thermal_controller.use_hw_fan_control = 1; - return 0; } diff -u linux-oem-4.15.0/drivers/gpu/drm/drm_ioctl.c linux-oem-4.15.0/drivers/gpu/drm/drm_ioctl.c --- linux-oem-4.15.0/drivers/gpu/drm/drm_ioctl.c +++ linux-oem-4.15.0/drivers/gpu/drm/drm_ioctl.c @@ -321,12 +321,7 @@ case DRM_CLIENT_CAP_ATOMIC: if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) return -EINVAL; - /* The modesetting DDX has a totally broken idea of atomic. */ - if (current->comm[0] == 'X' && req->value == 1) { - pr_info("broken atomic modeset userspace detected, disabling atomic\n"); - return -EOPNOTSUPP; - } - if (req->value > 2) + if (req->value > 1) return -EINVAL; file_priv->atomic = req->value; file_priv->universal_planes = req->value; diff -u linux-oem-4.15.0/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c linux-oem-4.15.0/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c --- linux-oem-4.15.0/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +++ linux-oem-4.15.0/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c @@ -464,7 +464,7 @@ if (!(gpu->identity.features & meta->feature)) continue; - if (index - offset >= meta->nr_domains) { + if (meta->nr_domains < (index - offset)) { offset += meta->nr_domains; continue; } reverted: --- linux-oem-4.15.0/drivers/gpu/drm/qxl/qxl_image.c +++ linux-oem-4.15.0.orig/drivers/gpu/drm/qxl/qxl_image.c @@ -210,8 +210,7 @@ break; default: DRM_ERROR("unsupported image bit depth\n"); + return -EINVAL; /* TODO: cleanup */ - qxl_bo_kunmap_atomic_page(qdev, image_bo, ptr); - return -EINVAL; } image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN; image->u.bitmap.x = width; diff -u linux-oem-4.15.0/drivers/hid/hid-alps.c linux-oem-4.15.0/drivers/hid/hid-alps.c --- linux-oem-4.15.0/drivers/hid/hid-alps.c +++ linux-oem-4.15.0/drivers/hid/hid-alps.c @@ -786,7 +786,6 @@ break; case HID_DEVICE_ID_ALPS_U1_DUAL: case HID_DEVICE_ID_ALPS_U1: - case HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY: data->dev_type = U1; break; default: diff -u linux-oem-4.15.0/drivers/hid/hid-ids.h linux-oem-4.15.0/drivers/hid/hid-ids.h --- linux-oem-4.15.0/drivers/hid/hid-ids.h +++ linux-oem-4.15.0/drivers/hid/hid-ids.h @@ -82,8 +82,8 @@ #define HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP 0x1220 #define HID_DEVICE_ID_ALPS_U1 0x1215 -#define HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY 0x121E #define HID_DEVICE_ID_ALPS_T4_BTNLESS 0x120C #define HID_DEVICE_ID_ALPS_1222 0x1222 + #define USB_VENDOR_ID_AMI 0x046b #define USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE 0xff10 @@ -374,7 +374,6 @@ #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7349 0x7349 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_73F7 0x73f7 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001 -#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002 0xc002 #define USB_VENDOR_ID_ELAN 0x04f3 @@ -1032,7 +1031,4 @@ #define USB_DEVICE_ID_SYMBOL_SCANNER_3 0x1200 -#define I2C_VENDOR_ID_SYNAPTICS 0x06cb -#define I2C_PRODUCT_ID_SYNAPTICS_SYNA2393 0x7a13 - #define USB_VENDOR_ID_SYNAPTICS 0x06cb #define USB_DEVICE_ID_SYNAPTICS_TP 0x0001 @@ -1048,7 +1044,6 @@ #define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10 #define USB_DEVICE_ID_SYNAPTICS_HD 0x0ac3 #define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3 -#define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819 #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968 #define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710 diff -u linux-oem-4.15.0/drivers/hid/hid-multitouch.c linux-oem-4.15.0/drivers/hid/hid-multitouch.c --- linux-oem-4.15.0/drivers/hid/hid-multitouch.c +++ linux-oem-4.15.0/drivers/hid/hid-multitouch.c @@ -1598,9 +1598,6 @@ { .driver_data = MT_CLS_EGALAX_SERIAL, MT_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) }, - { .driver_data = MT_CLS_EGALAX, - MT_USB_DEVICE(USB_VENDOR_ID_DWAV, - USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) }, /* Elitegroup panel */ { .driver_data = MT_CLS_SERIAL, diff -u linux-oem-4.15.0/drivers/hid/hid-quirks.c linux-oem-4.15.0/drivers/hid/hid-quirks.c --- linux-oem-4.15.0/drivers/hid/hid-quirks.c +++ linux-oem-4.15.0/drivers/hid/hid-quirks.c @@ -151,7 +151,6 @@ { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_QUAD_HD), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP_V103), HID_QUIRK_NO_INIT_REPORTS }, - { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_DELL_K12A), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD), HID_QUIRK_BADPAD }, { HID_USB_DEVICE(USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882), HID_QUIRK_NOGET }, diff -u linux-oem-4.15.0/drivers/hid/i2c-hid/i2c-hid-core.c linux-oem-4.15.0/drivers/hid/i2c-hid/i2c-hid-core.c --- linux-oem-4.15.0/drivers/hid/i2c-hid/i2c-hid-core.c +++ linux-oem-4.15.0/drivers/hid/i2c-hid/i2c-hid-core.c @@ -189,8 +189,6 @@ I2C_HID_QUIRK_BOGUS_IRQ }, { USB_VENDOR_ID_ALPS_JP, HID_ANY_ID, I2C_HID_QUIRK_RESET_ON_RESUME }, - { I2C_VENDOR_ID_SYNAPTICS, I2C_PRODUCT_ID_SYNAPTICS_SYNA2393, - I2C_HID_QUIRK_RESET_ON_RESUME }, { USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720, I2C_HID_QUIRK_BAD_INPUT_SIZE }, { 0, 0 } diff -u linux-oem-4.15.0/drivers/hid/usbhid/hid-core.c linux-oem-4.15.0/drivers/hid/usbhid/hid-core.c --- linux-oem-4.15.0/drivers/hid/usbhid/hid-core.c +++ linux-oem-4.15.0/drivers/hid/usbhid/hid-core.c @@ -680,21 +680,16 @@ struct usbhid_device *usbhid = hid->driver_data; int res; - mutex_lock(&usbhid->mutex); - set_bit(HID_OPENED, &usbhid->iofl); - if (hid->quirks & HID_QUIRK_ALWAYS_POLL) { - res = 0; - goto Done; - } + if (hid->quirks & HID_QUIRK_ALWAYS_POLL) + return 0; res = usb_autopm_get_interface(usbhid->intf); /* the device must be awake to reliably request remote wakeup */ if (res < 0) { clear_bit(HID_OPENED, &usbhid->iofl); - res = -EIO; - goto Done; + return -EIO; } usbhid->intf->needs_remote_wakeup = 1; @@ -728,9 +723,6 @@ msleep(50); clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); - - Done: - mutex_unlock(&usbhid->mutex); return res; } @@ -738,8 +730,6 @@ { struct usbhid_device *usbhid = hid->driver_data; - mutex_lock(&usbhid->mutex); - /* * Make sure we don't restart data acquisition due to * a resumption we no longer care about by avoiding racing @@ -751,13 +741,12 @@ clear_bit(HID_IN_POLLING, &usbhid->iofl); spin_unlock_irq(&usbhid->lock); - if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL)) { - hid_cancel_delayed_stuff(usbhid); - usb_kill_urb(usbhid->urbin); - usbhid->intf->needs_remote_wakeup = 0; - } + if (hid->quirks & HID_QUIRK_ALWAYS_POLL) + return; - mutex_unlock(&usbhid->mutex); + hid_cancel_delayed_stuff(usbhid); + usb_kill_urb(usbhid->urbin); + usbhid->intf->needs_remote_wakeup = 0; } /* @@ -1066,8 +1055,6 @@ unsigned int n, insize = 0; int ret; - mutex_lock(&usbhid->mutex); - clear_bit(HID_DISCONNECTED, &usbhid->iofl); usbhid->bufsize = HID_MIN_BUFFER_SIZE; @@ -1182,8 +1169,6 @@ usbhid_set_leds(hid); device_set_wakeup_enable(&dev->dev, 1); } - - mutex_unlock(&usbhid->mutex); return 0; fail: @@ -1194,7 +1179,6 @@ usbhid->urbout = NULL; usbhid->urbctrl = NULL; hid_free_buffers(dev, hid); - mutex_unlock(&usbhid->mutex); return ret; } @@ -1210,8 +1194,6 @@ usbhid->intf->needs_remote_wakeup = 0; } - mutex_lock(&usbhid->mutex); - clear_bit(HID_STARTED, &usbhid->iofl); spin_lock_irq(&usbhid->lock); /* Sync with error and led handlers */ set_bit(HID_DISCONNECTED, &usbhid->iofl); @@ -1232,8 +1214,6 @@ usbhid->urbout = NULL; hid_free_buffers(hid_to_usb_dev(hid), hid); - - mutex_unlock(&usbhid->mutex); } static int usbhid_power(struct hid_device *hid, int lvl) @@ -1393,7 +1373,6 @@ INIT_WORK(&usbhid->reset_work, hid_reset); timer_setup(&usbhid->io_retry, hid_retry_timeout, 0); spin_lock_init(&usbhid->lock); - mutex_init(&usbhid->mutex); ret = hid_add_device(hid); if (ret) { reverted: --- linux-oem-4.15.0/drivers/hid/usbhid/usbhid.h +++ linux-oem-4.15.0.orig/drivers/hid/usbhid/usbhid.h @@ -93,7 +93,6 @@ dma_addr_t outbuf_dma; /* Output buffer dma */ unsigned long last_out; /* record of last output for timeouts */ - struct mutex mutex; /* start/stop/open/close */ spinlock_t lock; /* fifo spinlock */ unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ struct timer_list io_retry; /* Retry timer */ diff -u linux-oem-4.15.0/drivers/hid/wacom_sys.c linux-oem-4.15.0/drivers/hid/wacom_sys.c --- linux-oem-4.15.0/drivers/hid/wacom_sys.c +++ linux-oem-4.15.0/drivers/hid/wacom_sys.c @@ -132,11 +132,9 @@ data[0] = field->report->id; ret = wacom_get_report(hdev, HID_FEATURE_REPORT, data, n, WAC_CMD_RETRIES); - if (ret == n && features->type == HID_GENERIC) { + if (ret == n) { ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, data, n, 0); - } else if (ret == 2 && features->type != HID_GENERIC) { - features->touch_max = data[1]; } else { features->touch_max = 16; hid_warn(hdev, "wacom_feature_mapping: " reverted: --- linux-oem-4.15.0/drivers/hwmon/da9052-hwmon.c +++ linux-oem-4.15.0.orig/drivers/hwmon/da9052-hwmon.c @@ -250,9 +250,9 @@ int channel = to_sensor_dev_attr(devattr)->index; int ret; + mutex_lock(&hwmon->hwmon_lock); - mutex_lock(&hwmon->da9052->auxadc_lock); ret = __da9052_read_tsi(dev, channel); + mutex_unlock(&hwmon->hwmon_lock); - mutex_unlock(&hwmon->da9052->auxadc_lock); if (ret < 0) return ret; diff -u linux-oem-4.15.0/drivers/i2c/i2c-dev.c linux-oem-4.15.0/drivers/i2c/i2c-dev.c --- linux-oem-4.15.0/drivers/i2c/i2c-dev.c +++ linux-oem-4.15.0/drivers/i2c/i2c-dev.c @@ -48,7 +48,7 @@ struct i2c_dev { struct list_head list; struct i2c_adapter *adap; - struct device dev; + struct device *dev; struct cdev cdev; }; @@ -92,14 +92,12 @@ return i2c_dev; } -static void put_i2c_dev(struct i2c_dev *i2c_dev, bool del_cdev) +static void put_i2c_dev(struct i2c_dev *i2c_dev) { spin_lock(&i2c_dev_list_lock); list_del(&i2c_dev->list); spin_unlock(&i2c_dev_list_lock); - if (del_cdev) - cdev_device_del(&i2c_dev->cdev, &i2c_dev->dev); - put_device(&i2c_dev->dev); + kfree(i2c_dev); } static ssize_t name_show(struct device *dev, @@ -636,14 +634,6 @@ static struct class *i2c_dev_class; -static void i2cdev_dev_release(struct device *dev) -{ - struct i2c_dev *i2c_dev; - - i2c_dev = container_of(dev, struct i2c_dev, dev); - kfree(i2c_dev); -} - static int i2cdev_attach_adapter(struct device *dev, void *dummy) { struct i2c_adapter *adap; @@ -660,23 +650,27 @@ cdev_init(&i2c_dev->cdev, &i2cdev_fops); i2c_dev->cdev.owner = THIS_MODULE; - - device_initialize(&i2c_dev->dev); - i2c_dev->dev.devt = MKDEV(I2C_MAJOR, adap->nr); - i2c_dev->dev.class = i2c_dev_class; - i2c_dev->dev.parent = &adap->dev; - i2c_dev->dev.release = i2cdev_dev_release; - dev_set_name(&i2c_dev->dev, "i2c-%d", adap->nr); - - res = cdev_device_add(&i2c_dev->cdev, &i2c_dev->dev); - if (res) { - put_i2c_dev(i2c_dev, false); - return res; + res = cdev_add(&i2c_dev->cdev, MKDEV(I2C_MAJOR, adap->nr), 1); + if (res) + goto error_cdev; + + /* register this i2c device with the driver core */ + i2c_dev->dev = device_create(i2c_dev_class, &adap->dev, + MKDEV(I2C_MAJOR, adap->nr), NULL, + "i2c-%d", adap->nr); + if (IS_ERR(i2c_dev->dev)) { + res = PTR_ERR(i2c_dev->dev); + goto error; } pr_debug("i2c-dev: adapter [%s] registered as minor %d\n", adap->name, adap->nr); return 0; +error: + cdev_del(&i2c_dev->cdev); +error_cdev: + put_i2c_dev(i2c_dev); + return res; } static int i2cdev_detach_adapter(struct device *dev, void *dummy) @@ -692,7 +686,9 @@ if (!i2c_dev) /* attach_adapter must have failed */ return 0; - put_i2c_dev(i2c_dev, true); + cdev_del(&i2c_dev->cdev); + put_i2c_dev(i2c_dev); + device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr)); pr_debug("i2c-dev: adapter [%s] unregistered\n", adap->name); return 0; reverted: --- linux-oem-4.15.0/drivers/i2c/muxes/i2c-demux-pinctrl.c +++ linux-oem-4.15.0.orig/drivers/i2c/muxes/i2c-demux-pinctrl.c @@ -270,7 +270,6 @@ err_rollback_available: device_remove_file(&pdev->dev, &dev_attr_available_masters); err_rollback: - i2c_demux_deactivate_master(priv); for (j = 0; j < i; j++) { of_node_put(priv->chan[j].parent_np); of_changeset_destroy(&priv->chan[j].chgset); diff -u linux-oem-4.15.0/drivers/iio/accel/sca3000.c linux-oem-4.15.0/drivers/iio/accel/sca3000.c --- linux-oem-4.15.0/drivers/iio/accel/sca3000.c +++ linux-oem-4.15.0/drivers/iio/accel/sca3000.c @@ -982,7 +982,7 @@ st->tx[0] = SCA3000_READ_REG(reg_address_high); ret = spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer)); if (ret) { - dev_err(&st->us->dev, "problem reading register\n"); + dev_err(get_device(&st->us->dev), "problem reading register"); return ret; } diff -u linux-oem-4.15.0/drivers/iio/adc/stm32-adc.c linux-oem-4.15.0/drivers/iio/adc/stm32-adc.c --- linux-oem-4.15.0/drivers/iio/adc/stm32-adc.c +++ linux-oem-4.15.0/drivers/iio/adc/stm32-adc.c @@ -1627,27 +1627,15 @@ return 0; } -static int stm32_adc_dma_request(struct device *dev, struct iio_dev *indio_dev) +static int stm32_adc_dma_request(struct iio_dev *indio_dev) { struct stm32_adc *adc = iio_priv(indio_dev); struct dma_slave_config config; int ret; - adc->dma_chan = dma_request_chan(dev, "rx"); - if (IS_ERR(adc->dma_chan)) { - ret = PTR_ERR(adc->dma_chan); - if (ret != -ENODEV) { - if (ret != -EPROBE_DEFER) - dev_err(dev, - "DMA channel request failed with %d\n", - ret); - return ret; - } - - /* DMA is optional: fall back to IRQ mode */ - adc->dma_chan = NULL; + adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx"); + if (!adc->dma_chan) return 0; - } adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev, STM32_DMA_BUFFER_SIZE, @@ -1761,7 +1749,7 @@ if (ret < 0) goto err_clk_disable; - ret = stm32_adc_dma_request(dev, indio_dev); + ret = stm32_adc_dma_request(indio_dev); if (ret < 0) goto err_clk_disable; reverted: --- linux-oem-4.15.0/drivers/iio/dac/vf610_dac.c +++ linux-oem-4.15.0.orig/drivers/iio/dac/vf610_dac.c @@ -234,7 +234,6 @@ return 0; error_iio_device_register: - vf610_dac_exit(info); clk_disable_unprepare(info->clk); return ret; reverted: --- linux-oem-4.15.0/drivers/infiniband/hw/i40iw/i40iw_hw.c +++ linux-oem-4.15.0.orig/drivers/infiniband/hw/i40iw/i40iw_hw.c @@ -484,7 +484,7 @@ int arp_index; arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action); + if (arp_index == -1) - if (arp_index < 0) return; cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false); if (!cqp_request) diff -u linux-oem-4.15.0/drivers/infiniband/hw/mlx4/qp.c linux-oem-4.15.0/drivers/infiniband/hw/mlx4/qp.c --- linux-oem-4.15.0/drivers/infiniband/hw/mlx4/qp.c +++ linux-oem-4.15.0/drivers/infiniband/hw/mlx4/qp.c @@ -2921,7 +2921,6 @@ int send_size; int header_size; int spc; - int err; int i; if (wr->wr.opcode != IB_WR_SEND) @@ -2956,9 +2955,7 @@ sqp->ud_header.lrh.virtual_lane = 0; sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED); - err = ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey); - if (err) - return err; + ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey); sqp->ud_header.bth.pkey = cpu_to_be16(pkey); if (sqp->qp.mlx4_ib_qp_type == MLX4_IB_QPT_TUN_SMI_OWNER) sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn); @@ -3247,14 +3244,9 @@ } sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED); if (!sqp->qp.ibqp.qp_num) - err = ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index, - &pkey); + ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index, &pkey); else - err = ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index, - &pkey); - if (err) - return err; - + ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index, &pkey); sqp->ud_header.bth.pkey = cpu_to_be16(pkey); sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn); sqp->ud_header.bth.psn = cpu_to_be32((sqp->send_psn++) & ((1 << 24) - 1)); diff -u linux-oem-4.15.0/drivers/iommu/amd_iommu_init.c linux-oem-4.15.0/drivers/iommu/amd_iommu_init.c --- linux-oem-4.15.0/drivers/iommu/amd_iommu_init.c +++ linux-oem-4.15.0/drivers/iommu/amd_iommu_init.c @@ -1331,8 +1331,8 @@ } case IVHD_DEV_ACPI_HID: { u16 devid; - u8 hid[ACPIHID_HID_LEN]; - u8 uid[ACPIHID_UID_LEN]; + u8 hid[ACPIHID_HID_LEN] = {0}; + u8 uid[ACPIHID_UID_LEN] = {0}; int ret; if (h->type != 0x40) { @@ -1349,7 +1349,6 @@ break; } - uid[0] = '\0'; switch (e->uidf) { case UID_NOT_PRESENT: @@ -1364,8 +1363,8 @@ break; case UID_IS_CHARACTER: - memcpy(uid, &e->uid, e->uidl); - uid[e->uidl] = '\0'; + memcpy(uid, (u8 *)(&e->uid), ACPIHID_UID_LEN - 1); + uid[ACPIHID_UID_LEN - 1] = '\0'; break; default: diff -u linux-oem-4.15.0/drivers/media/platform/rcar_fdp1.c linux-oem-4.15.0/drivers/media/platform/rcar_fdp1.c --- linux-oem-4.15.0/drivers/media/platform/rcar_fdp1.c +++ linux-oem-4.15.0/drivers/media/platform/rcar_fdp1.c @@ -2372,7 +2372,7 @@ dprintk(fdp1, "FDP1 Version R-Car H3\n"); break; case FD1_IP_M3N: - dprintk(fdp1, "FDP1 Version R-Car M3-N\n"); + dprintk(fdp1, "FDP1 Version R-Car M3N\n"); break; case FD1_IP_E3: dprintk(fdp1, "FDP1 Version R-Car E3\n"); diff -u linux-oem-4.15.0/drivers/misc/cardreader/rtsx_pcr.c linux-oem-4.15.0/drivers/misc/cardreader/rtsx_pcr.c --- linux-oem-4.15.0/drivers/misc/cardreader/rtsx_pcr.c +++ linux-oem-4.15.0/drivers/misc/cardreader/rtsx_pcr.c @@ -155,9 +155,6 @@ rtsx_disable_aspm(pcr); - /* Fixes DMA transfer timout issue after disabling ASPM on RTS5260 */ - msleep(1); - if (option->ltr_enabled) rtsx_set_ltr_latency(pcr, option->ltr_active_latency); diff -u linux-oem-4.15.0/drivers/misc/eeprom/Kconfig linux-oem-4.15.0/drivers/misc/eeprom/Kconfig --- linux-oem-4.15.0/drivers/misc/eeprom/Kconfig +++ linux-oem-4.15.0/drivers/misc/eeprom/Kconfig @@ -23,10 +23,7 @@ If you use this with an SMBus adapter instead of an I2C adapter, full functionality is not available. Only smaller devices are - supported via block reads (24c16 and below, max 4 kByte). - Larger devices that use 16-bit addresses will only work with - individual byte reads, which is very slow in general and is unsafe - in multi-master SMBus topologies. + supported (24c16 and below, max 4 kByte). This driver can also be built as a module. If so, the module will be called at24. diff -u linux-oem-4.15.0/drivers/misc/eeprom/at24.c linux-oem-4.15.0/drivers/misc/eeprom/at24.c --- linux-oem-4.15.0/drivers/misc/eeprom/at24.c +++ linux-oem-4.15.0/drivers/misc/eeprom/at24.c @@ -3,7 +3,6 @@ * * Copyright (C) 2005-2007 David Brownell * Copyright (C) 2008 Wolfram Sang, Pengutronix - * Copyright (C) 2015 Extreme Engineering Solutions, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,7 +52,7 @@ * Other than binding model, current differences from "eeprom" driver are * that this one handles write access and isn't restricted to 24c02 devices. * It also handles larger devices (32 kbit and up) with two-byte addresses, - * which don't work without risks on pure SMBus systems. + * which won't work on pure SMBus systems. */ struct at24_data { @@ -247,88 +246,6 @@ * one "eeprom" file not four, but larger reads would fail when * they crossed certain pages. */ - -/* - * Write a byte to an AT24 device using SMBus cycles. - */ -static inline s32 at24_smbus_write_byte_data(struct at24_data *at24, - struct i2c_client *client, u16 offset, u8 value) -{ - if (!(at24->chip.flags & AT24_FLAG_ADDR16)) - return i2c_smbus_write_byte_data(client, offset, value); - - /* - * Emulate I2C multi-byte write by using SMBus "write word" - * cycle. We split up the 16-bit offset among the "command" - * byte and the first data byte. - */ - return i2c_smbus_write_word_data(client, offset >> 8, - (value << 8) | (offset & 0xff)); -} - -/* - * Write block data to an AT24 device using SMBus cycles. - */ -static inline s32 at24_smbus_write_i2c_block_data(struct at24_data *at24, - const struct i2c_client *client, u16 off, u8 len, const u8 *vals) -{ - s32 res; - - if (!(at24->chip.flags & AT24_FLAG_ADDR16)) - return i2c_smbus_write_i2c_block_data(client, off, len, vals); - - /* Insert extra address byte into data stream */ - at24->writebuf[0] = off & 0xff; - memcpy(&at24->writebuf[1], vals, len); - - res = i2c_smbus_write_i2c_block_data(client, off >> 8, len + 1, - at24->writebuf); - - return res; -} - -/* - * Read block data from an AT24 device using SMBus cycles. - */ -static inline s32 at24_smbus_read_block_data(struct at24_data *at24, - const struct i2c_client *client, u16 off, u8 len, u8 *vals) -{ - int count; - s32 res; - - if (!(at24->chip.flags & AT24_FLAG_ADDR16)) - return i2c_smbus_read_i2c_block_data_or_emulated(client, off, - len, vals); - - /* - * Emulate I2C multi-byte read by using SMBus "write byte" and - * "receive byte". This is slightly unsafe since there is an - * additional STOP involved, which exposes the SMBus and (this - * device!) to takeover by another bus master. However, it's the - * only way to work on SMBus-only controllers when talking to - * EEPROMs with multi-byte addresses. - */ - - /* Address "dummy" write */ - res = i2c_smbus_write_byte_data(client, off >> 8, off & 0xff); - if (res < 0) - return res; - - count = 0; - do { - /* Current Address Read */ - res = i2c_smbus_read_byte(client); - if (res < 0) - break; - - *(vals++) = res; - count++; - len--; - } while (len > 0); - - return count; -} - static struct i2c_client *at24_translate_offset(struct at24_data *at24, unsigned int *offset) { @@ -369,8 +286,10 @@ */ read_time = jiffies; - status = at24_smbus_read_block_data(at24, client, - offset, count, buf); + status = i2c_smbus_read_i2c_block_data_or_emulated(client, + offset, + count, buf); + dev_dbg(&client->dev, "read %zu@%d --> %d (%ld)\n", count, offset, status, jiffies); @@ -589,8 +508,8 @@ */ write_time = jiffies; - status = at24_smbus_write_i2c_block_data(at24, - client, offset, count, buf); + status = i2c_smbus_write_i2c_block_data(client, + offset, count, buf); if (status == 0) status = count; @@ -624,8 +543,7 @@ */ write_time = jiffies; - status = at24_smbus_write_byte_data(at24, client, offset, - buf[0]); + status = i2c_smbus_write_byte_data(client, offset, buf[0]); if (status == 0) status = count; @@ -892,32 +810,13 @@ /* Use I2C operations unless we're stuck with SMBus extensions. */ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { - if ((chip.flags & AT24_FLAG_ADDR16) && - i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_READ_BYTE | - I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { - /* - * We need SMBUS_WRITE_BYTE_DATA and SMBUS_READ_BYTE to - * implement byte reads for 16-bit address devices. - * This will be slow, but better than nothing (e.g. - * read @ 3.6 KiB/s). It is also unsafe in a multi- - * master topology. - */ - use_smbus = I2C_SMBUS_BYTE_DATA; - } else if (i2c_check_functionality(client->adapter, + if (chip.flags & AT24_FLAG_ADDR16) + return -EPFNOSUPPORT; + + if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { use_smbus = I2C_SMBUS_I2C_BLOCK_DATA; - } else if ((chip.flags & AT24_FLAG_ADDR16) && - i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_WRITE_WORD_DATA)) { - /* - * We need SMBUS_WRITE_WORD_DATA to implement - * byte writes for 16-bit address devices. - */ - use_smbus_write = I2C_SMBUS_BYTE_DATA; - chip.page_size = 1; - } else if (!(chip.flags & AT24_FLAG_ADDR16) && - i2c_check_functionality(client->adapter, + } else if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_WORD_DATA)) { use_smbus = I2C_SMBUS_WORD_DATA; } else if (i2c_check_functionality(client->adapter, @@ -937,9 +836,6 @@ } } - if (strcmp(client->name, "24c256") == 0) - chip.page_size = 64; - if (chip.flags & AT24_FLAG_TAKE8ADDR) num_addresses = 8; else @@ -985,15 +881,12 @@ if (writable) { if (!use_smbus || use_smbus_write) { - unsigned int write_max = chip.page_size; - unsigned int smbus_max = (chip.flags & AT24_FLAG_ADDR16) ? - I2C_SMBUS_BLOCK_MAX - 1 : - I2C_SMBUS_BLOCK_MAX; + unsigned write_max = chip.page_size; if (write_max > io_limit) write_max = io_limit; - if (use_smbus && write_max > smbus_max) - write_max = smbus_max; + if (use_smbus && write_max > I2C_SMBUS_BLOCK_MAX) + write_max = I2C_SMBUS_BLOCK_MAX; at24->write_max = write_max; /* buffer (data + address at the beginning) */ reverted: --- linux-oem-4.15.0/drivers/misc/mei/client.c +++ linux-oem-4.15.0.orig/drivers/misc/mei/client.c @@ -276,7 +276,6 @@ down_write(&dev->me_clients_rwsem); me_cl = __mei_me_cl_by_uuid(dev, uuid); __mei_me_cl_del(dev, me_cl); - mei_me_cl_put(me_cl); up_write(&dev->me_clients_rwsem); } @@ -298,7 +297,6 @@ down_write(&dev->me_clients_rwsem); me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id); __mei_me_cl_del(dev, me_cl); - mei_me_cl_put(me_cl); up_write(&dev->me_clients_rwsem); } reverted: --- linux-oem-4.15.0/drivers/mtd/ubi/debug.c +++ linux-oem-4.15.0.orig/drivers/mtd/ubi/debug.c @@ -405,6 +405,9 @@ { struct ubi_device *ubi = s->private; + if (*pos == 0) + return SEQ_START_TOKEN; + if (*pos < ubi->peb_count) return pos; @@ -418,6 +421,8 @@ { struct ubi_device *ubi = s->private; + if (v == SEQ_START_TOKEN) + return pos; (*pos)++; if (*pos < ubi->peb_count) @@ -439,8 +444,11 @@ int err; /* If this is the start, print a header */ + if (iter == SEQ_START_TOKEN) { + seq_puts(s, + "physical_block_number\terase_count\tblock_status\tread_status\n"); + return 0; + } - if (*block_number == 0) - seq_puts(s, "physical_block_number\terase_count\n"); err = ubi_io_is_bad(ubi, *block_number); if (err) reverted: --- linux-oem-4.15.0/drivers/net/dsa/dsa_loop.c +++ linux-oem-4.15.0.orig/drivers/net/dsa/dsa_loop.c @@ -350,7 +350,6 @@ } module_exit(dsa_loop_exit); -MODULE_SOFTDEP("pre: dsa_loop_bdinfo"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Florian Fainelli"); MODULE_DESCRIPTION("DSA loopback driver"); diff -u linux-oem-4.15.0/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c linux-oem-4.15.0/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c --- linux-oem-4.15.0/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ linux-oem-4.15.0/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -60,7 +60,7 @@ { AQ_DEVICE_ID_D108, AQ_HWREV_2, &hw_atl_ops_b0, &hw_atl_b0_caps_aqc108, }, { AQ_DEVICE_ID_D109, AQ_HWREV_2, &hw_atl_ops_b0, &hw_atl_b0_caps_aqc109, }, - { AQ_DEVICE_ID_AQC100, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc100, }, + { AQ_DEVICE_ID_AQC100, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc107, }, { AQ_DEVICE_ID_AQC107, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc107, }, { AQ_DEVICE_ID_AQC108, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc108, }, { AQ_DEVICE_ID_AQC109, AQ_HWREV_ANY, &hw_atl_ops_b1, &hw_atl_b0_caps_aqc109, }, diff -u linux-oem-4.15.0/drivers/net/ethernet/broadcom/bcmsysport.c linux-oem-4.15.0/drivers/net/ethernet/broadcom/bcmsysport.c --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/bcmsysport.c +++ linux-oem-4.15.0/drivers/net/ethernet/broadcom/bcmsysport.c @@ -645,8 +645,7 @@ dma_addr_t mapping; /* Allocate a new SKB for a new packet */ - skb = __netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH, - GFP_ATOMIC | __GFP_NOWARN); + skb = netdev_alloc_skb(priv->netdev, RX_BUF_LENGTH); if (!skb) { priv->mib.alloc_rx_buff_failed++; netif_err(priv, rx_err, ndev, "SKB alloc failed\n"); diff -u linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6854,7 +6854,6 @@ netdev_features_t features) { struct bnxt *bp = netdev_priv(dev); - netdev_features_t vlan_features; if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp)) features &= ~NETIF_F_NTUPLE; @@ -6862,14 +6861,12 @@ /* Both CTAG and STAG VLAN accelaration on the RX side have to be * turned on or off together. */ - vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_VLAN_STAG_RX); - if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_VLAN_STAG_RX)) { + if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) != + (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) { if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) features &= ~(NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX); - else if (vlan_features) + else features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX; } @@ -8489,11 +8486,8 @@ } } - if (result != PCI_ERS_RESULT_RECOVERED) { - if (netif_running(netdev)) - dev_close(netdev); - pci_disable_device(pdev); - } + if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev)) + dev_close(netdev); rtnl_unlock(); @@ -8504,7 +8498,7 @@ err); /* non-fatal, continue */ } - return result; + return PCI_ERS_RESULT_RECOVERED; } /** diff -u linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.h linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.h --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -774,6 +774,7 @@ #define BNXT_VF_SPOOFCHK 0x2 #define BNXT_VF_LINK_FORCED 0x4 #define BNXT_VF_LINK_UP 0x8 + u32 func_flags; /* func cfg flags */ u32 min_tx_rate; u32 max_tx_rate; void *hwrm_cmd_req_addr; diff -u linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ linux-oem-4.15.0/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -99,10 +99,11 @@ if (old_setting == setting) return 0; + func_flags = vf->func_flags; if (setting) - func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE; + func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE; else - func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE; + func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE; /*TODO: if the driver supports VLAN filter on guest VLAN, * the spoof check should also include vlan anti-spoofing */ @@ -111,6 +112,7 @@ req.flags = cpu_to_le32(func_flags); rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); if (!rc) { + vf->func_flags = func_flags; if (setting) vf->flags |= BNXT_VF_SPOOFCHK; else @@ -174,6 +176,7 @@ memcpy(vf->mac_addr, mac, ETH_ALEN); bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); req.fid = cpu_to_le16(vf->fw_fid); + req.flags = cpu_to_le32(vf->func_flags); req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR); memcpy(req.dflt_mac_addr, mac, ETH_ALEN); return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); @@ -211,6 +214,7 @@ bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); req.fid = cpu_to_le16(vf->fw_fid); + req.flags = cpu_to_le32(vf->func_flags); req.dflt_vlan = cpu_to_le16(vlan_tag); req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN); rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); @@ -249,6 +253,7 @@ return 0; bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1); req.fid = cpu_to_le16(vf->fw_fid); + req.flags = cpu_to_le32(vf->func_flags); req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MAX_BW); req.max_bw = cpu_to_le32(max_tx_rate); req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_MIN_BW); diff -u linux-oem-4.15.0/drivers/net/ethernet/broadcom/genet/bcmgenet.c linux-oem-4.15.0/drivers/net/ethernet/broadcom/genet/bcmgenet.c --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ linux-oem-4.15.0/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1669,8 +1669,7 @@ dma_addr_t mapping; /* Allocate a new Rx skb */ - skb = __netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT, - GFP_ATOMIC | __GFP_NOWARN); + skb = netdev_alloc_skb(priv->dev, priv->rx_buf_len + SKB_ALIGNMENT); if (!skb) { priv->mib.alloc_rx_buff_failed++; netif_err(priv, rx_err, priv->dev, @@ -3517,6 +3516,36 @@ } #ifdef CONFIG_PM_SLEEP +static int bcmgenet_suspend(struct device *d) +{ + struct net_device *dev = dev_get_drvdata(d); + struct bcmgenet_priv *priv = netdev_priv(dev); + int ret = 0; + + if (!netif_running(dev)) + return 0; + + netif_device_detach(dev); + + bcmgenet_netif_stop(dev); + + if (!device_may_wakeup(d)) + phy_suspend(dev->phydev); + + /* Prepare the device for Wake-on-LAN and switch to the slow clock */ + if (device_may_wakeup(d) && priv->wolopts) { + ret = bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC); + clk_prepare_enable(priv->clk_wol); + } else if (priv->internal_phy) { + ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE); + } + + /* Turn off the clocks */ + clk_disable_unprepare(priv->clk); + + return ret; +} + static int bcmgenet_resume(struct device *d) { struct net_device *dev = dev_get_drvdata(d); @@ -3595,39 +3624,6 @@ clk_disable_unprepare(priv->clk); return ret; } - -static int bcmgenet_suspend(struct device *d) -{ - struct net_device *dev = dev_get_drvdata(d); - struct bcmgenet_priv *priv = netdev_priv(dev); - int ret = 0; - - if (!netif_running(dev)) - return 0; - - netif_device_detach(dev); - - bcmgenet_netif_stop(dev); - - if (!device_may_wakeup(d)) - phy_suspend(dev->phydev); - - /* Prepare the device for Wake-on-LAN and switch to the slow clock */ - if (device_may_wakeup(d) && priv->wolopts) { - ret = bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC); - clk_prepare_enable(priv->clk_wol); - } else if (priv->internal_phy) { - ret = bcmgenet_power_down(priv, GENET_POWER_PASSIVE); - } - - /* Turn off the clocks */ - clk_disable_unprepare(priv->clk); - - if (ret) - bcmgenet_resume(d); - - return ret; -} #endif /* CONFIG_PM_SLEEP */ static SIMPLE_DEV_PM_OPS(bcmgenet_pm_ops, bcmgenet_suspend, bcmgenet_resume); reverted: --- linux-oem-4.15.0/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +++ linux-oem-4.15.0.orig/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c @@ -186,15 +186,9 @@ } reg = bcmgenet_umac_readl(priv, UMAC_MPD_CTRL); - if (!(reg & MPD_EN)) - return; /* already powered up so skip the rest */ reg &= ~MPD_EN; bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL); - reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL); - reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN); - bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL); - /* Disable CRC Forward */ reg = bcmgenet_umac_readl(priv, UMAC_CMD); reg &= ~CMD_CRC_FWD; diff -u linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c --- linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -2256,6 +2256,8 @@ #if IS_ENABLED(CONFIG_IPV6) update_clip(adap); #endif + /* Initialize hash mac addr list*/ + INIT_LIST_HEAD(&adap->mac_hlist); return err; irq_err: @@ -2277,7 +2279,6 @@ t4_sge_stop(adapter); t4_free_sge_resources(adapter); - adapter->flags &= ~FULL_INIT_DONE; } @@ -4981,9 +4982,6 @@ (is_t5(adapter->params.chip) ? STATMODE_V(0) : T6_STATMODE_V(0))); - /* Initialize hash mac addr list */ - INIT_LIST_HEAD(&adapter->mac_hlist); - for_each_port(adapter, i) { netdev = alloc_etherdev_mq(sizeof(struct port_info), MAX_ETH_QSETS); @@ -5286,7 +5284,6 @@ static void remove_one(struct pci_dev *pdev) { struct adapter *adapter = pci_get_drvdata(pdev); - struct hash_mac_addr *entry, *tmp; if (!adapter) { pci_release_regions(pdev); @@ -5332,12 +5329,6 @@ if (adapter->num_uld || adapter->num_ofld_uld) t4_uld_mem_free(adapter); free_some_resources(adapter); - list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist, - list) { - list_del(&entry->list); - kfree(entry); - } - #if IS_ENABLED(CONFIG_IPV6) t4_cleanup_clip_tbl(adapter); #endif diff -u linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c --- linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ linux-oem-4.15.0/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -715,6 +715,9 @@ if (adapter->flags & USING_MSIX) name_msix_vecs(adapter); + /* Initialize hash mac addr list*/ + INIT_LIST_HEAD(&adapter->mac_hlist); + adapter->flags |= FULL_INIT_DONE; } @@ -2991,9 +2994,6 @@ if (err) goto err_unmap_bar; - /* Initialize hash mac addr list */ - INIT_LIST_HEAD(&adapter->mac_hlist); - /* * Allocate our "adapter ports" and stitch everything together. */ diff -u linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c --- linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +++ linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c @@ -55,6 +55,4 @@ #define MGMT_MSG_TIMEOUT 5000 -#define SET_FUNC_PORT_MGMT_TIMEOUT 25000 - #define mgmt_to_pfhwdev(pf_mgmt) \ container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt) @@ -249,13 +247,12 @@ u8 *buf_in, u16 in_size, u8 *buf_out, u16 *out_size, enum mgmt_direction_type direction, - u16 resp_msg_id, u32 timeout) + u16 resp_msg_id) { struct hinic_hwif *hwif = pf_to_mgmt->hwif; struct pci_dev *pdev = hwif->pdev; struct hinic_recv_msg *recv_msg; struct completion *recv_done; - unsigned long timeo; u16 msg_id; int err; @@ -279,9 +276,8 @@ goto unlock_sync_msg; } - timeo = msecs_to_jiffies(timeout ? timeout : MGMT_MSG_TIMEOUT); - - if (!wait_for_completion_timeout(recv_done, timeo)) { + if (!wait_for_completion_timeout(recv_done, + msecs_to_jiffies(MGMT_MSG_TIMEOUT))) { dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id); err = -ETIMEDOUT; goto unlock_sync_msg; @@ -355,7 +351,6 @@ { struct hinic_hwif *hwif = pf_to_mgmt->hwif; struct pci_dev *pdev = hwif->pdev; - u32 timeout = 0; if (sync != HINIC_MGMT_MSG_SYNC) { dev_err(&pdev->dev, "Invalid MGMT msg type\n"); @@ -367,12 +362,9 @@ return -EINVAL; } - if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) - timeout = SET_FUNC_PORT_MGMT_TIMEOUT; - return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size, buf_out, out_size, MGMT_DIRECT_SEND, - MSG_NOT_RESP, timeout); + MSG_NOT_RESP); } /** diff -u linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_main.c linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_main.c --- linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ linux-oem-4.15.0/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -475,6 +475,7 @@ { struct hinic_dev *nic_dev = netdev_priv(netdev); unsigned int flags; + int err; down(&nic_dev->mgmt_lock); @@ -488,9 +489,20 @@ up(&nic_dev->mgmt_lock); - hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE); - - hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE); + err = hinic_port_set_func_state(nic_dev, HINIC_FUNC_PORT_DISABLE); + if (err) { + netif_err(nic_dev, drv, netdev, + "Failed to set func port state\n"); + nic_dev->flags |= (flags & HINIC_INTF_UP); + return err; + } + + err = hinic_port_set_state(nic_dev, HINIC_PORT_DISABLE); + if (err) { + netif_err(nic_dev, drv, netdev, "Failed to set port state\n"); + nic_dev->flags |= (flags & HINIC_INTF_UP); + return err; + } free_rxqs(nic_dev); free_txqs(nic_dev); diff -u linux-oem-4.15.0/drivers/net/ethernet/intel/e1000e/netdev.c linux-oem-4.15.0/drivers/net/ethernet/intel/e1000e/netdev.c --- linux-oem-4.15.0/drivers/net/ethernet/intel/e1000e/netdev.c +++ linux-oem-4.15.0/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5255,10 +5255,6 @@ /* oops */ break; } - if (hw->mac.type == e1000_pch_spt) { - netdev->features &= ~NETIF_F_TSO; - netdev->features &= ~NETIF_F_TSO6; - } } /* enable transmits in the hardware, need to do this diff -u linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx4/main.c linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx4/main.c --- linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx4/main.c +++ linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx4/main.c @@ -2424,7 +2424,6 @@ if (!err || err == -ENOSPC) { priv->def_counter[port] = idx; - err = 0; } else if (err == -ENOENT) { err = 0; continue; @@ -2475,8 +2474,7 @@ MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED); if (!err) *idx = get_param_l(&out_param); - if (WARN_ON(err == -ENOSPC)) - err = -EINVAL; + return err; } return __mlx4_counter_alloc(dev, idx); diff -u linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx5/core/cmd.c linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx5/core/cmd.c --- linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ linux-oem-4.15.0/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -831,6 +831,7 @@ } cmd->ent_arr[ent->idx] = ent; + set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state); lay = get_inst(cmd, ent->idx); ent->lay = lay; memset(lay, 0, sizeof(*lay)); @@ -852,7 +853,6 @@ if (ent->callback) schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); - set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state); /* Skip sending command to fw if internal error */ if (pci_channel_offline(dev->pdev) || @@ -865,10 +865,6 @@ MLX5_SET(mbox_out, ent->out, syndrome, drv_synd); mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true); - /* no doorbell, no need to keep the entry */ - free_ent(cmd, ent->idx); - if (ent->callback) - free_cmd(ent); return; } reverted: --- linux-oem-4.15.0/drivers/net/ethernet/moxa/moxart_ether.c +++ linux-oem-4.15.0.orig/drivers/net/ethernet/moxa/moxart_ether.c @@ -561,7 +561,7 @@ struct net_device *ndev = platform_get_drvdata(pdev); unregister_netdev(ndev); + free_irq(ndev->irq, ndev); - devm_free_irq(&pdev->dev, ndev->irq, ndev); moxart_mac_free_memory(ndev); free_netdev(ndev); reverted: --- linux-oem-4.15.0/drivers/net/ethernet/natsemi/jazzsonic.c +++ linux-oem-4.15.0.orig/drivers/net/ethernet/natsemi/jazzsonic.c @@ -247,15 +247,13 @@ goto out; err = register_netdev(dev); if (err) + goto out1; - goto undo_probe1; printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq); return 0; +out1: -undo_probe1: - dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), - lp->descriptors, lp->descriptors_laddr); release_mem_region(dev->base_addr, SONIC_MEM_SIZE); out: free_netdev(dev); diff -u linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c --- linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -274,19 +274,16 @@ phymode == PHY_INTERFACE_MODE_MII || phymode == PHY_INTERFACE_MODE_GMII || phymode == PHY_INTERFACE_MODE_SGMII) { + ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, &module); module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift / 2)); regmap_write(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, module); + } else { + ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2)); } - if (dwmac->f2h_ptp_ref_clk) - ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); - else - ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << - (reg_shift / 2)); - regmap_write(sys_mgr_base_addr, reg_offset, ctrl); /* Deassert reset for the phy configuration to be sampled by reverted: --- linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ linux-oem-4.15.0.orig/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -96,7 +96,7 @@ struct net_device *dev; struct device *device; struct mac_device_info *hw; + spinlock_t lock; - struct mutex lock; /* RX Queue */ struct stmmac_rx_queue rx_queue[MTL_MAX_RX_QUEUES]; diff -u linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c --- linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -392,13 +392,13 @@ ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full); - mutex_lock(&priv->lock); + spin_lock(&priv->lock); if (priv->hw->mac->pcs_ctrl_ane) priv->hw->mac->pcs_ctrl_ane(priv->ioaddr, 1, priv->hw->ps, 0); - mutex_unlock(&priv->lock); + spin_unlock(&priv->lock); return 0; } @@ -615,12 +615,12 @@ { struct stmmac_priv *priv = netdev_priv(dev); - mutex_lock(&priv->lock); + spin_lock_irq(&priv->lock); if (device_can_wakeup(priv->device)) { wol->supported = WAKE_MAGIC | WAKE_UCAST; wol->wolopts = priv->wolopts; } - mutex_unlock(&priv->lock); + spin_unlock_irq(&priv->lock); } static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) @@ -649,9 +649,9 @@ disable_irq_wake(priv->wol_irq); } - mutex_lock(&priv->lock); + spin_lock_irq(&priv->lock); priv->wolopts = wol->wolopts; - mutex_unlock(&priv->lock); + spin_unlock_irq(&priv->lock); return 0; } diff -u linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c --- linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -36,16 +36,12 @@ unsigned long data; u32 reg_value; - /* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second - * increment to twice the number of nanoseconds of a clock cycle. - * The calculation of the default_addend value by the caller will set it - * to mid-range = 2^31 when the remainder of this division is zero, - * which will make the accumulator overflow once every 2 ptp_clock - * cycles, adding twice the number of nanoseconds of a clock cycle : - * 2000000000ULL / ptp_clock. + /* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second + * formula = (1/ptp_clock) * 1000000000 + * where ptp_clock is 50MHz if fine method is used to update system */ if (value & PTP_TCR_TSCFUPDT) - data = (2000000000ULL / ptp_clock); + data = (1000000000ULL / 50000000); else data = (1000000000ULL / ptp_clock); diff -u linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c --- linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ linux-oem-4.15.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -365,6 +365,7 @@ { struct net_device *ndev = priv->dev; int interface = priv->plat->interface; + unsigned long flags; bool ret = false; if ((interface != PHY_INTERFACE_MODE_MII) && @@ -391,7 +392,7 @@ * changed). * In that case the driver disable own timers. */ - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); if (priv->eee_active) { netdev_dbg(priv->dev, "disable EEE\n"); del_timer_sync(&priv->eee_ctrl_timer); @@ -399,11 +400,11 @@ tx_lpi_timer); } priv->eee_active = 0; - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); goto out; } /* Activate the EEE and start timers */ - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); if (!priv->eee_active) { priv->eee_active = 1; timer_setup(&priv->eee_ctrl_timer, @@ -419,7 +420,7 @@ priv->hw->mac->set_eee_pls(priv->hw, ndev->phydev->link); ret = true; - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); netdev_dbg(priv->dev, "Energy-Efficient Ethernet initialized\n"); } @@ -797,12 +798,13 @@ { struct stmmac_priv *priv = netdev_priv(dev); struct phy_device *phydev = dev->phydev; + unsigned long flags; bool new_state = false; if (!phydev) return; - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); if (phydev->link) { u32 ctrl = readl(priv->ioaddr + MAC_CTRL_REG); @@ -861,7 +863,7 @@ if (new_state && netif_msg_link(priv)) phy_print_status(phydev); - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); if (phydev->is_pseudo_fixed_link) /* Stop PHY layer to call the hook to adjust the link in case @@ -3679,7 +3681,7 @@ /** * stmmac_interrupt - main ISR * @irq: interrupt number. - * @dev_id: to pass the net device pointer (must be valid). + * @dev_id: to pass the net device pointer. * Description: this is the main driver interrupt service routine. * It can call: * o DMA service routine (to manage incoming frame reception and transmission @@ -3701,6 +3703,11 @@ if (priv->irq_wake) pm_wakeup_event(priv->device, 0); + if (unlikely(!dev)) { + netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__); + return IRQ_NONE; + } + /* To handle GMAC own interrupts */ if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) { int status = priv->hw->mac->host_irq_status(priv->hw, @@ -4283,7 +4290,7 @@ (8 * priv->plat->rx_queues_to_use)); } - mutex_init(&priv->lock); + spin_lock_init(&priv->lock); /* If a specific clk_csr value is passed from the platform * this means that the CSR Clock Range selection cannot be @@ -4374,7 +4381,6 @@ priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); - mutex_destroy(&priv->lock); free_netdev(ndev); return 0; @@ -4392,6 +4398,7 @@ { struct net_device *ndev = dev_get_drvdata(dev); struct stmmac_priv *priv = netdev_priv(ndev); + unsigned long flags; if (!ndev || !netif_running(ndev)) return 0; @@ -4399,7 +4406,7 @@ if (ndev->phydev) phy_stop(ndev->phydev); - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); netif_device_detach(ndev); stmmac_stop_all_queues(priv); @@ -4422,7 +4429,7 @@ clk_disable_unprepare(priv->plat->pclk); clk_disable_unprepare(priv->plat->stmmac_clk); } - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); priv->oldlink = false; priv->speed = SPEED_UNKNOWN; @@ -4466,6 +4473,7 @@ { struct net_device *ndev = dev_get_drvdata(dev); struct stmmac_priv *priv = netdev_priv(ndev); + unsigned long flags; if (!netif_running(ndev)) return 0; @@ -4477,9 +4485,9 @@ * from another devices (e.g. serial console). */ if (device_may_wakeup(priv->device)) { - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); priv->hw->mac->pmt(priv->hw, 0); - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); priv->irq_wake = 0; } else { pinctrl_pm_select_default_state(priv->device); @@ -4495,7 +4503,7 @@ netif_device_attach(ndev); - mutex_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); stmmac_reset_queues_param(priv); @@ -4514,7 +4522,7 @@ stmmac_start_all_queues(priv); - mutex_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); if (ndev->phydev) phy_start(ndev->phydev); diff -u linux-oem-4.15.0/drivers/net/gtp.c linux-oem-4.15.0/drivers/net/gtp.c --- linux-oem-4.15.0/drivers/net/gtp.c +++ linux-oem-4.15.0/drivers/net/gtp.c @@ -1177,11 +1177,11 @@ static struct genl_family gtp_genl_family; static int gtp_genl_fill_info(struct sk_buff *skb, u32 snd_portid, u32 snd_seq, - int flags, u32 type, struct pdp_ctx *pctx) + u32 type, struct pdp_ctx *pctx) { void *genlh; - genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, flags, + genlh = genlmsg_put(skb, snd_portid, snd_seq, >p_genl_family, 0, type); if (genlh == NULL) goto nlmsg_failure; @@ -1235,8 +1235,8 @@ goto err_unlock; } - err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, info->snd_seq, - 0, info->nlhdr->nlmsg_type, pctx); + err = gtp_genl_fill_info(skb2, NETLINK_CB(skb).portid, + info->snd_seq, info->nlhdr->nlmsg_type, pctx); if (err < 0) goto err_unlock_free; @@ -1279,7 +1279,6 @@ gtp_genl_fill_info(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, - NLM_F_MULTI, cb->nlh->nlmsg_type, pctx)) { cb->args[0] = i; cb->args[1] = j; diff -u linux-oem-4.15.0/drivers/net/ipvlan/ipvlan_main.c linux-oem-4.15.0/drivers/net/ipvlan/ipvlan_main.c --- linux-oem-4.15.0/drivers/net/ipvlan/ipvlan_main.c +++ linux-oem-4.15.0/drivers/net/ipvlan/ipvlan_main.c @@ -711,7 +711,6 @@ { ether_setup(dev); - dev->max_mtu = ETH_MAX_MTU; dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING); dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE; dev->netdev_ops = &ipvlan_netdev_ops; diff -u linux-oem-4.15.0/drivers/net/macsec.c linux-oem-4.15.0/drivers/net/macsec.c --- linux-oem-4.15.0/drivers/net/macsec.c +++ linux-oem-4.15.0/drivers/net/macsec.c @@ -1310,8 +1310,7 @@ struct crypto_aead *tfm; int ret; - /* Pick a sync gcm(aes) cipher to ensure order is preserved. */ - tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); + tfm = crypto_alloc_aead("gcm(aes)", 0, 0); if (IS_ERR(tfm)) return tfm; diff -u linux-oem-4.15.0/drivers/net/phy/dp83640.c linux-oem-4.15.0/drivers/net/phy/dp83640.c --- linux-oem-4.15.0/drivers/net/phy/dp83640.c +++ linux-oem-4.15.0/drivers/net/phy/dp83640.c @@ -1110,7 +1110,7 @@ goto out; } dp83640_clock_init(clock, bus); - list_add_tail(&clock->list, &phyter_clocks); + list_add_tail(&phyter_clocks, &clock->list); out: mutex_unlock(&phyter_clocks_lock); diff -u linux-oem-4.15.0/drivers/net/phy/micrel.c linux-oem-4.15.0/drivers/net/phy/micrel.c --- linux-oem-4.15.0/drivers/net/phy/micrel.c +++ linux-oem-4.15.0/drivers/net/phy/micrel.c @@ -676,8 +676,8 @@ int i; for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) { - strlcpy(data + i * ETH_GSTRING_LEN, - kszphy_hw_stats[i].string, ETH_GSTRING_LEN); + memcpy(data + i * ETH_GSTRING_LEN, + kszphy_hw_stats[i].string, ETH_GSTRING_LEN); } } diff -u linux-oem-4.15.0/drivers/net/phy/phy.c linux-oem-4.15.0/drivers/net/phy/phy.c --- linux-oem-4.15.0/drivers/net/phy/phy.c +++ linux-oem-4.15.0/drivers/net/phy/phy.c @@ -1235,11 +1235,9 @@ /* Restart autonegotiation so the new modes get sent to the * link partner. */ - if (phydev->autoneg == AUTONEG_ENABLE) { - ret = phy_restart_aneg(phydev); - if (ret < 0) - return ret; - } + ret = phy_restart_aneg(phydev); + if (ret < 0) + return ret; } return 0; diff -u linux-oem-4.15.0/drivers/net/ppp/pppoe.c linux-oem-4.15.0/drivers/net/ppp/pppoe.c --- linux-oem-4.15.0/drivers/net/ppp/pppoe.c +++ linux-oem-4.15.0/drivers/net/ppp/pppoe.c @@ -497,9 +497,6 @@ if (!skb) goto out; - if (skb->pkt_type != PACKET_HOST) - goto abort; - if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) goto abort; diff -u linux-oem-4.15.0/drivers/net/usb/qmi_wwan.c linux-oem-4.15.0/drivers/net/usb/qmi_wwan.c --- linux-oem-4.15.0/drivers/net/usb/qmi_wwan.c +++ linux-oem-4.15.0/drivers/net/usb/qmi_wwan.c @@ -1293,7 +1293,6 @@ {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ - {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/ reverted: --- linux-oem-4.15.0/drivers/net/wimax/i2400m/usb-fw.c +++ linux-oem-4.15.0.orig/drivers/net/wimax/i2400m/usb-fw.c @@ -354,7 +354,6 @@ usb_autopm_put_interface(i2400mu->usb_iface); d_fnend(8, dev, "(i2400m %p ack %p size %zu) = %ld\n", i2400m, ack, ack_size, (long) result); - usb_put_urb(¬if_urb); return result; error_exceeded: diff -u linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h --- linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +++ linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h @@ -1195,79 +1195,6 @@ struct rtl8xxxu_fileops; -/*mlme related.*/ -enum wireless_mode { - WIRELESS_MODE_UNKNOWN = 0, - /* Sub-Element */ - WIRELESS_MODE_B = BIT(0), - WIRELESS_MODE_G = BIT(1), - WIRELESS_MODE_A = BIT(2), - WIRELESS_MODE_N_24G = BIT(3), - WIRELESS_MODE_N_5G = BIT(4), - WIRELESS_AUTO = BIT(5), - WIRELESS_MODE_AC = BIT(6), - WIRELESS_MODE_MAX = 0x7F, -}; - -/* from rtlwifi/wifi.h */ -enum ratr_table_mode_new { - RATEID_IDX_BGN_40M_2SS = 0, - RATEID_IDX_BGN_40M_1SS = 1, - RATEID_IDX_BGN_20M_2SS_BN = 2, - RATEID_IDX_BGN_20M_1SS_BN = 3, - RATEID_IDX_GN_N2SS = 4, - RATEID_IDX_GN_N1SS = 5, - RATEID_IDX_BG = 6, - RATEID_IDX_G = 7, - RATEID_IDX_B = 8, - RATEID_IDX_VHT_2SS = 9, - RATEID_IDX_VHT_1SS = 10, - RATEID_IDX_MIX1 = 11, - RATEID_IDX_MIX2 = 12, - RATEID_IDX_VHT_3SS = 13, - RATEID_IDX_BGN_3SS = 14, -}; - -#define BT_INFO_8723B_1ANT_B_FTP BIT(7) -#define BT_INFO_8723B_1ANT_B_A2DP BIT(6) -#define BT_INFO_8723B_1ANT_B_HID BIT(5) -#define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT(4) -#define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT(3) -#define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT(2) -#define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT(1) -#define BT_INFO_8723B_1ANT_B_CONNECTION BIT(0) - -enum _BT_8723B_1ANT_STATUS { - BT_8723B_1ANT_STATUS_NON_CONNECTED_IDLE = 0x0, - BT_8723B_1ANT_STATUS_CONNECTED_IDLE = 0x1, - BT_8723B_1ANT_STATUS_INQ_PAGE = 0x2, - BT_8723B_1ANT_STATUS_ACL_BUSY = 0x3, - BT_8723B_1ANT_STATUS_SCO_BUSY = 0x4, - BT_8723B_1ANT_STATUS_ACL_SCO_BUSY = 0x5, - BT_8723B_1ANT_STATUS_MAX -}; - -struct rtl8xxxu_btcoex { - u8 bt_status; - bool bt_busy; - bool has_sco; - bool has_a2dp; - bool has_hid; - bool has_pan; - bool hid_only; - bool a2dp_only; - bool c2h_bt_inquiry; -}; - -#define RTL8XXXU_RATR_STA_INIT 0 -#define RTL8XXXU_RATR_STA_HIGH 1 -#define RTL8XXXU_RATR_STA_MID 2 -#define RTL8XXXU_RATR_STA_LOW 3 - -#define RTL8XXXU_NOISE_FLOOR_MIN -100 -#define RTL8XXXU_SNR_THRESH_HIGH 50 -#define RTL8XXXU_SNR_THRESH_LOW 20 - struct rtl8xxxu_priv { struct ieee80211_hw *hw; struct usb_device *udev; @@ -1372,17 +1299,6 @@ u8 pi_enabled:1; u8 no_pape:1; u8 int_buf[USB_INTR_CONTENT_LENGTH]; - u8 rssi_level; - /* - * Only one virtual interface permitted because only STA mode - * is supported and no iface_combinations are provided. - */ - struct ieee80211_vif *vif; - struct delayed_work ra_watchdog; - struct work_struct c2hcmd_work; - struct sk_buff_head c2hcmd_queue; - spinlock_t c2hcmd_lock; - struct rtl8xxxu_btcoex bt_coex; }; struct rtl8xxxu_rx_urb { @@ -1418,7 +1334,7 @@ void (*set_tx_power) (struct rtl8xxxu_priv *priv, int channel, bool ht40); void (*update_rate_mask) (struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi); + u32 ramask, int sgi); void (*report_connect) (struct rtl8xxxu_priv *priv, u8 macid, bool connect); void (*fill_txdesc) (struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, @@ -1504,9 +1420,9 @@ void rtl8xxxu_gen1_usb_quirks(struct rtl8xxxu_priv *priv); void rtl8xxxu_gen2_usb_quirks(struct rtl8xxxu_priv *priv); void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi); + u32 ramask, int sgi); void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi); + u32 ramask, int sgi); void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, u8 macid, bool connect); void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, @@ -1530,8 +1446,6 @@ struct rtl8xxxu_txdesc32 *tx_desc32, bool sgi, bool short_preamble, bool ampdu_enable, u32 rts_rate); -void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv, - u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5); extern struct rtl8xxxu_fileops rtl8192cu_fops; extern struct rtl8xxxu_fileops rtl8192eu_fops; diff -u linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c --- linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c +++ linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c @@ -1583,7 +1583,9 @@ /* * Software control, antenna at WiFi side */ +#ifdef NEED_PS_TDMA rtl8723bu_set_ps_tdma(priv, 0x08, 0x00, 0x00, 0x00, 0x00); +#endif rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555); rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x55555555); diff -u linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c --- linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ linux-oem-4.15.0/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -3824,8 +3824,9 @@ rtl8xxxu_write8(priv, REG_RSV_CTRL, 0x0e); } -void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv, - u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5) +#ifdef NEED_PS_TDMA +static void rtl8723bu_set_ps_tdma(struct rtl8xxxu_priv *priv, + u8 arg1, u8 arg2, u8 arg3, u8 arg4, u8 arg5) { struct h2c_cmd h2c; @@ -3838,6 +3839,7 @@ h2c.b_type_dma.data5 = arg5; rtl8xxxu_gen2_h2c_cmd(priv, &h2c, sizeof(h2c.b_type_dma)); } +#endif void rtl8xxxu_gen2_disable_rf(struct rtl8xxxu_priv *priv) { @@ -4308,8 +4310,7 @@ rtl8xxxu_write8(priv, REG_BEACON_CTRL, val8); } -void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi) +void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv, u32 ramask, int sgi) { struct h2c_cmd h2c; @@ -4329,7 +4330,7 @@ } void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, - u32 ramask, u8 rateid, int sgi) + u32 ramask, int sgi) { struct h2c_cmd h2c; u8 bw = 0; @@ -4343,7 +4344,7 @@ h2c.b_macid_cfg.ramask3 = (ramask >> 24) & 0xff; h2c.ramask.arg = 0x80; - h2c.b_macid_cfg.data1 = rateid; + h2c.b_macid_cfg.data1 = 0; if (sgi) h2c.b_macid_cfg.data1 |= BIT(7); @@ -4483,35 +4484,6 @@ rtl8xxxu_write8(priv, REG_INIRTS_RATE_SEL, rate_idx); } -static u16 -rtl8xxxu_wireless_mode(struct ieee80211_hw *hw, struct ieee80211_sta *sta) -{ - u16 network_type = WIRELESS_MODE_UNKNOWN; - - if (hw->conf.chandef.chan->band == NL80211_BAND_5GHZ) { - if (sta->vht_cap.vht_supported) - network_type = WIRELESS_MODE_AC; - else if (sta->ht_cap.ht_supported) - network_type = WIRELESS_MODE_N_5G; - - network_type |= WIRELESS_MODE_A; - } else { - if (sta->vht_cap.vht_supported) - network_type = WIRELESS_MODE_AC; - else if (sta->ht_cap.ht_supported) - network_type = WIRELESS_MODE_N_24G; - - if (sta->supp_rates[0] <= 0xf) - network_type |= WIRELESS_MODE_B; - else if (sta->supp_rates[0] & 0xf) - network_type |= (WIRELESS_MODE_B | WIRELESS_MODE_G); - else - network_type |= WIRELESS_MODE_G; - } - - return network_type; -} - static void rtl8xxxu_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changed) @@ -4554,10 +4526,7 @@ sgi = 1; rcu_read_unlock(); - priv->vif = vif; - priv->rssi_level = RTL8XXXU_RATR_STA_INIT; - - priv->fops->update_rate_mask(priv, ramask, 0, sgi); + priv->fops->update_rate_mask(priv, ramask, sgi); rtl8xxxu_write8(priv, REG_BCN_MAX_ERR, 0xff); @@ -5188,259 +5157,12 @@ } } -/* - * The RTL8723BU/RTL8192EU vendor driver use coexistence table type - * 0-7 to represent writing different combinations of register values - * to REG_BT_COEX_TABLEs. It's for different kinds of coexistence use - * cases which Realtek doesn't provide detail for these settings. Keep - * this aligned with vendor driver for easier maintenance. - */ -void rtl8723bu_set_coex_with_type(struct rtl8xxxu_priv *priv, u8 type) -{ - switch (type) { - case 0: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x55555555); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 1: - case 3: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 2: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x5a5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0x5a5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 4: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x5a5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0xaaaa5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 5: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x5a5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0xaa5a5a5a); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 6: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0x55555555); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0xaaaaaaaa); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - case 7: - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE1, 0xaaaaaaaa); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE2, 0xaaaaaaaa); - rtl8xxxu_write32(priv, REG_BT_COEX_TABLE3, 0x00ffffff); - rtl8xxxu_write8(priv, REG_BT_COEX_TABLE4, 0x03); - break; - default: - break; - } -} - -void rtl8723bu_update_bt_link_info(struct rtl8xxxu_priv *priv, u8 bt_info) -{ - struct rtl8xxxu_btcoex *btcoex = &priv->bt_coex; - - if (bt_info & BT_INFO_8723B_1ANT_B_INQ_PAGE) - btcoex->c2h_bt_inquiry = true; - else - btcoex->c2h_bt_inquiry = false; - - if (!(bt_info & BT_INFO_8723B_1ANT_B_CONNECTION)) { - btcoex->bt_status = BT_8723B_1ANT_STATUS_NON_CONNECTED_IDLE; - btcoex->has_sco = false; - btcoex->has_hid = false; - btcoex->has_pan = false; - btcoex->has_a2dp = false; - } else { - if ((bt_info & 0x1f) == BT_INFO_8723B_1ANT_B_CONNECTION) - btcoex->bt_status = BT_8723B_1ANT_STATUS_CONNECTED_IDLE; - else if ((bt_info & BT_INFO_8723B_1ANT_B_SCO_ESCO) || - (bt_info & BT_INFO_8723B_1ANT_B_SCO_BUSY)) - btcoex->bt_status = BT_8723B_1ANT_STATUS_SCO_BUSY; - else if (bt_info & BT_INFO_8723B_1ANT_B_ACL_BUSY) - btcoex->bt_status = BT_8723B_1ANT_STATUS_ACL_BUSY; - else - btcoex->bt_status = BT_8723B_1ANT_STATUS_MAX; - - if (bt_info & BT_INFO_8723B_1ANT_B_FTP) - btcoex->has_pan = true; - else - btcoex->has_pan = false; - - if (bt_info & BT_INFO_8723B_1ANT_B_A2DP) - btcoex->has_a2dp = true; - else - btcoex->has_a2dp = false; - - if (bt_info & BT_INFO_8723B_1ANT_B_HID) - btcoex->has_hid = true; - else - btcoex->has_hid = false; - - if (bt_info & BT_INFO_8723B_1ANT_B_SCO_ESCO) - btcoex->has_sco = true; - else - btcoex->has_sco = false; - } - - if (!btcoex->has_a2dp && !btcoex->has_sco && - !btcoex->has_pan && btcoex->has_hid) - btcoex->hid_only = true; - else - btcoex->hid_only = false; - - if (!btcoex->has_sco && !btcoex->has_pan && - !btcoex->has_hid && btcoex->has_a2dp) - btcoex->has_a2dp = true; - else - btcoex->has_a2dp = false; - - if (btcoex->bt_status == BT_8723B_1ANT_STATUS_SCO_BUSY || - btcoex->bt_status == BT_8723B_1ANT_STATUS_ACL_BUSY) - btcoex->bt_busy = true; - else - btcoex->bt_busy = false; -} - -void rtl8723bu_handle_bt_inquiry(struct rtl8xxxu_priv *priv) -{ - struct ieee80211_vif *vif; - struct rtl8xxxu_btcoex *btcoex; - bool wifi_connected; - - vif = priv->vif; - btcoex = &priv->bt_coex; - wifi_connected = (vif && vif->bss_conf.assoc); - - if (!wifi_connected) { - rtl8723bu_set_ps_tdma(priv, 0x8, 0x0, 0x0, 0x0, 0x0); - rtl8723bu_set_coex_with_type(priv, 0); - } else if (btcoex->has_sco || btcoex->has_hid || btcoex->has_a2dp) { - rtl8723bu_set_ps_tdma(priv, 0x61, 0x35, 0x3, 0x11, 0x11); - rtl8723bu_set_coex_with_type(priv, 4); - } else if (btcoex->has_pan) { - rtl8723bu_set_ps_tdma(priv, 0x61, 0x3f, 0x3, 0x11, 0x11); - rtl8723bu_set_coex_with_type(priv, 4); - } else { - rtl8723bu_set_ps_tdma(priv, 0x8, 0x0, 0x0, 0x0, 0x0); - rtl8723bu_set_coex_with_type(priv, 7); - } -} - -void rtl8723bu_handle_bt_info(struct rtl8xxxu_priv *priv) -{ - struct ieee80211_vif *vif; - struct rtl8xxxu_btcoex *btcoex; - bool wifi_connected; - - vif = priv->vif; - btcoex = &priv->bt_coex; - wifi_connected = (vif && vif->bss_conf.assoc); - - if (wifi_connected) { - u32 val32 = 0; - u32 high_prio_tx = 0, high_prio_rx = 0; - - val32 = rtl8xxxu_read32(priv, 0x770); - high_prio_tx = val32 & 0x0000ffff; - high_prio_rx = (val32 & 0xffff0000) >> 16; - - if (btcoex->bt_busy) { - if (btcoex->hid_only) { - rtl8723bu_set_ps_tdma(priv, 0x61, 0x20, - 0x3, 0x11, 0x11); - rtl8723bu_set_coex_with_type(priv, 5); - } else if (btcoex->a2dp_only) { - rtl8723bu_set_ps_tdma(priv, 0x61, 0x35, - 0x3, 0x11, 0x11); - rtl8723bu_set_coex_with_type(priv, 4); - } else if ((btcoex->has_a2dp && btcoex->has_pan) || - (btcoex->has_hid && btcoex->has_a2dp && - btcoex->has_pan)) { - rtl8723bu_set_ps_tdma(priv, 0x51, 0x21, - 0x3, 0x10, 0x10); - rtl8723bu_set_coex_with_type(priv, 4); - } else if (btcoex->has_hid && btcoex->has_a2dp) { - rtl8723bu_set_ps_tdma(priv, 0x51, 0x21, - 0x3, 0x10, 0x10); - rtl8723bu_set_coex_with_type(priv, 3); - } else { - rtl8723bu_set_ps_tdma(priv, 0x61, 0x35, - 0x3, 0x11, 0x11); - rtl8723bu_set_coex_with_type(priv, 4); - } - } else { - rtl8723bu_set_ps_tdma(priv, 0x8, 0x0, 0x0, 0x0, 0x0); - if (high_prio_tx + high_prio_rx <= 60) - rtl8723bu_set_coex_with_type(priv, 2); - else - rtl8723bu_set_coex_with_type(priv, 7); - } - } else { - rtl8723bu_set_ps_tdma(priv, 0x8, 0x0, 0x0, 0x0, 0x0); - rtl8723bu_set_coex_with_type(priv, 0); - } -} - -static void rtl8xxxu_c2hcmd_callback(struct work_struct *work) -{ - struct rtl8xxxu_priv *priv; - struct rtl8723bu_c2h *c2h; - struct sk_buff *skb = NULL; - unsigned long flags; - u8 bt_info = 0; - struct rtl8xxxu_btcoex *btcoex; - - priv = container_of(work, struct rtl8xxxu_priv, c2hcmd_work); - btcoex = &priv->bt_coex; - - if (priv->rf_paths > 1) - goto out; - - while (!skb_queue_empty(&priv->c2hcmd_queue)) { - spin_lock_irqsave(&priv->c2hcmd_lock, flags); - skb = __skb_dequeue(&priv->c2hcmd_queue); - spin_unlock_irqrestore(&priv->c2hcmd_lock, flags); - - c2h = (struct rtl8723bu_c2h *)skb->data; - - switch (c2h->id) { - case C2H_8723B_BT_INFO: - bt_info = c2h->bt_info.bt_info; - - rtl8723bu_update_bt_link_info(priv, bt_info); - if (btcoex->c2h_bt_inquiry) { - rtl8723bu_handle_bt_inquiry(priv); - break; - } - rtl8723bu_handle_bt_info(priv); - break; - default: - break; - } - } - -out: - dev_kfree_skb(skb); -} - static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv, struct sk_buff *skb) { struct rtl8723bu_c2h *c2h = (struct rtl8723bu_c2h *)skb->data; struct device *dev = &priv->udev->dev; int len; - unsigned long flags; len = skb->len - 2; @@ -5478,12 +5200,6 @@ 16, 1, c2h->raw.payload, len, false); break; } - - spin_lock_irqsave(&priv->c2hcmd_lock, flags); - __skb_queue_tail(&priv->c2hcmd_queue, skb); - spin_unlock_irqrestore(&priv->c2hcmd_lock, flags); - - schedule_work(&priv->c2hcmd_work); } int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb) @@ -5608,6 +5324,7 @@ struct device *dev = &priv->udev->dev; dev_dbg(dev, "%s: C2H packet\n", __func__); rtl8723bu_handle_c2h(priv, skb); + dev_kfree_skb(skb); return RX_TYPE_C2H; } @@ -5757,10 +5474,6 @@ switch (vif->type) { case NL80211_IFTYPE_STATION: - if (!priv->vif) - priv->vif = vif; - else - return -EOPNOTSUPP; rtl8xxxu_stop_tx_beacon(priv); val8 = rtl8xxxu_read8(priv, REG_BEACON_CTRL); @@ -5784,9 +5497,6 @@ struct rtl8xxxu_priv *priv = hw->priv; dev_dbg(&priv->udev->dev, "%s\n", __func__); - - if (priv->vif) - priv->vif = NULL; } static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed) @@ -6072,178 +5782,6 @@ return 0; } -static u8 rtl8xxxu_signal_to_snr(int signal) -{ - if (signal < RTL8XXXU_NOISE_FLOOR_MIN) - signal = RTL8XXXU_NOISE_FLOOR_MIN; - else if (signal > 0) - signal = 0; - return (u8)(signal - RTL8XXXU_NOISE_FLOOR_MIN); -} - -static void rtl8xxxu_refresh_rate_mask(struct rtl8xxxu_priv *priv, - int signal, struct ieee80211_sta *sta) -{ - struct ieee80211_hw *hw = priv->hw; - u16 wireless_mode; - u8 rssi_level, ratr_idx; - u8 txbw_40mhz; - u8 snr, snr_thresh_high, snr_thresh_low; - u8 go_up_gap = 5; - - rssi_level = priv->rssi_level; - snr = rtl8xxxu_signal_to_snr(signal); - snr_thresh_high = RTL8XXXU_SNR_THRESH_HIGH; - snr_thresh_low = RTL8XXXU_SNR_THRESH_LOW; - txbw_40mhz = (hw->conf.chandef.width == NL80211_CHAN_WIDTH_40) ? 1 : 0; - - switch (rssi_level) { - case RTL8XXXU_RATR_STA_MID: - snr_thresh_high += go_up_gap; - break; - case RTL8XXXU_RATR_STA_LOW: - snr_thresh_high += go_up_gap; - snr_thresh_low += go_up_gap; - break; - default: - break; - } - - if (snr > snr_thresh_high) - rssi_level = RTL8XXXU_RATR_STA_HIGH; - else if (snr > snr_thresh_low) - rssi_level = RTL8XXXU_RATR_STA_MID; - else - rssi_level = RTL8XXXU_RATR_STA_LOW; - - if (rssi_level != priv->rssi_level) { - int sgi = 0; - u32 rate_bitmap = 0; - - rcu_read_lock(); - rate_bitmap = (sta->supp_rates[0] & 0xfff) | - (sta->ht_cap.mcs.rx_mask[0] << 12) | - (sta->ht_cap.mcs.rx_mask[1] << 20); - if (sta->ht_cap.cap & - (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20)) - sgi = 1; - rcu_read_unlock(); - - wireless_mode = rtl8xxxu_wireless_mode(hw, sta); - switch (wireless_mode) { - case WIRELESS_MODE_B: - ratr_idx = RATEID_IDX_B; - if (rate_bitmap & 0x0000000c) - rate_bitmap &= 0x0000000d; - else - rate_bitmap &= 0x0000000f; - break; - case WIRELESS_MODE_A: - case WIRELESS_MODE_G: - ratr_idx = RATEID_IDX_G; - if (rssi_level == RTL8XXXU_RATR_STA_HIGH) - rate_bitmap &= 0x00000f00; - else - rate_bitmap &= 0x00000ff0; - break; - case (WIRELESS_MODE_B | WIRELESS_MODE_G): - ratr_idx = RATEID_IDX_BG; - if (rssi_level == RTL8XXXU_RATR_STA_HIGH) - rate_bitmap &= 0x00000f00; - else if (rssi_level == RTL8XXXU_RATR_STA_MID) - rate_bitmap &= 0x00000ff0; - else - rate_bitmap &= 0x00000ff5; - break; - case WIRELESS_MODE_N_24G: - case WIRELESS_MODE_N_5G: - case (WIRELESS_MODE_G | WIRELESS_MODE_N_24G): - case (WIRELESS_MODE_A | WIRELESS_MODE_N_5G): - if (priv->tx_paths == 2 && priv->rx_paths == 2) - ratr_idx = RATEID_IDX_GN_N2SS; - else - ratr_idx = RATEID_IDX_GN_N1SS; - break; - case (WIRELESS_MODE_B | WIRELESS_MODE_G | WIRELESS_MODE_N_24G): - case (WIRELESS_MODE_B | WIRELESS_MODE_N_24G): - if (txbw_40mhz) { - if (priv->tx_paths == 2 && priv->rx_paths == 2) - ratr_idx = RATEID_IDX_BGN_40M_2SS; - else - ratr_idx = RATEID_IDX_BGN_40M_1SS; - } else { - if (priv->tx_paths == 2 && priv->rx_paths == 2) - ratr_idx = RATEID_IDX_BGN_20M_2SS_BN; - else - ratr_idx = RATEID_IDX_BGN_20M_1SS_BN; - } - - if (priv->tx_paths == 2 && priv->rx_paths == 2) { - if (rssi_level == RTL8XXXU_RATR_STA_HIGH) { - rate_bitmap &= 0x0f8f0000; - } else if (rssi_level == RTL8XXXU_RATR_STA_MID) { - rate_bitmap &= 0x0f8ff000; - } else { - if (txbw_40mhz) - rate_bitmap &= 0x0f8ff015; - else - rate_bitmap &= 0x0f8ff005; - } - } else { - if (rssi_level == RTL8XXXU_RATR_STA_HIGH) { - rate_bitmap &= 0x000f0000; - } else if (rssi_level == RTL8XXXU_RATR_STA_MID) { - rate_bitmap &= 0x000ff000; - } else { - if (txbw_40mhz) - rate_bitmap &= 0x000ff015; - else - rate_bitmap &= 0x000ff005; - } - } - break; - default: - ratr_idx = RATEID_IDX_BGN_40M_2SS; - rate_bitmap &= 0x0fffffff; - break; - } - - priv->rssi_level = rssi_level; - priv->fops->update_rate_mask(priv, rate_bitmap, ratr_idx, sgi); - } -} - -static void rtl8xxxu_watchdog_callback(struct work_struct *work) -{ - struct ieee80211_vif *vif; - struct rtl8xxxu_priv *priv; - - priv = container_of(work, struct rtl8xxxu_priv, ra_watchdog.work); - vif = priv->vif; - - if (vif && vif->type == NL80211_IFTYPE_STATION) { - int signal; - struct ieee80211_sta *sta; - - rcu_read_lock(); - sta = ieee80211_find_sta(vif, vif->bss_conf.bssid); - if (!sta) { - struct device *dev = &priv->udev->dev; - - dev_dbg(dev, "%s: no sta found\n", __func__); - rcu_read_unlock(); - goto out; - } - rcu_read_unlock(); - - signal = ieee80211_ave_rssi(vif); - rtl8xxxu_refresh_rate_mask(priv, signal, sta); - } - -out: - schedule_delayed_work(&priv->ra_watchdog, 2 * HZ); -} - static int rtl8xxxu_start(struct ieee80211_hw *hw) { struct rtl8xxxu_priv *priv = hw->priv; @@ -6300,8 +5838,6 @@ ret = rtl8xxxu_submit_rx_urb(priv, rx_urb); } - - schedule_delayed_work(&priv->ra_watchdog, 2 * HZ); exit: /* * Accept all data and mgmt frames @@ -6353,8 +5889,6 @@ if (priv->usb_interrupts) rtl8xxxu_write32(priv, REG_USB_HIMR, 0); - cancel_delayed_work_sync(&priv->ra_watchdog); - rtl8xxxu_free_rx_resources(priv); rtl8xxxu_free_tx_resources(priv); } @@ -6527,10 +6061,6 @@ INIT_LIST_HEAD(&priv->rx_urb_pending_list); spin_lock_init(&priv->rx_urb_lock); INIT_WORK(&priv->rx_urb_wq, rtl8xxxu_rx_urb_work); - INIT_DELAYED_WORK(&priv->ra_watchdog, rtl8xxxu_watchdog_callback); - spin_lock_init(&priv->c2hcmd_lock); - INIT_WORK(&priv->c2hcmd_work, rtl8xxxu_c2hcmd_callback); - skb_queue_head_init(&priv->c2hcmd_queue); usb_set_intfdata(interface, hw); diff -u linux-oem-4.15.0/drivers/nvdimm/btt.c linux-oem-4.15.0/drivers/nvdimm/btt.c --- linux-oem-4.15.0/drivers/nvdimm/btt.c +++ linux-oem-4.15.0/drivers/nvdimm/btt.c @@ -541,9 +541,9 @@ static int btt_freelist_init(struct arena_info *arena) { - int new, ret; - struct log_entry log_new; - u32 i, map_entry, log_oldmap, log_newmap; + int old, new, ret; + u32 i, map_entry; + struct log_entry log_new, log_old; arena->freelist = kcalloc(arena->nfree, sizeof(struct free_entry), GFP_KERNEL); @@ -551,26 +551,24 @@ return -ENOMEM; for (i = 0; i < arena->nfree; i++) { + old = btt_log_read(arena, i, &log_old, LOG_OLD_ENT); + if (old < 0) + return old; + new = btt_log_read(arena, i, &log_new, LOG_NEW_ENT); if (new < 0) return new; - /* old and new map entries with any flags stripped out */ - log_oldmap = ent_lba(le32_to_cpu(log_new.old_map)); - log_newmap = ent_lba(le32_to_cpu(log_new.new_map)); - /* sub points to the next one to be overwritten */ arena->freelist[i].sub = 1 - new; arena->freelist[i].seq = nd_inc_seq(le32_to_cpu(log_new.seq)); - arena->freelist[i].block = log_oldmap; + arena->freelist[i].block = le32_to_cpu(log_new.old_map); /* * FIXME: if error clearing fails during init, we want to make * the BTT read-only */ - if (ent_e_flag(log_new.old_map) && - !ent_normal(log_new.old_map)) { - arena->freelist[i].has_err = 1; + if (ent_e_flag(log_new.old_map)) { ret = arena_clear_freelist_error(arena, i); if (ret) dev_err_ratelimited(to_dev(arena), @@ -578,7 +576,7 @@ } /* This implies a newly created or untouched flog entry */ - if (log_oldmap == log_newmap) + if (log_new.old_map == log_new.new_map) continue; /* Check if map recovery is needed */ @@ -586,15 +584,8 @@ NULL, NULL, 0); if (ret) return ret; - - /* - * The map_entry from btt_read_map is stripped of any flag bits, - * so use the stripped out versions from the log as well for - * testing whether recovery is needed. For restoration, use the - * 'raw' version of the log entries as that captured what we - * were going to write originally. - */ - if ((log_newmap != map_entry) && (log_oldmap == map_entry)) { + if ((le32_to_cpu(log_new.new_map) != map_entry) && + (le32_to_cpu(log_new.old_map) == map_entry)) { /* * Last transaction wrote the flog, but wasn't able * to complete the map write. So fix up the map. reverted: --- linux-oem-4.15.0/drivers/nvdimm/btt.h +++ linux-oem-4.15.0.orig/drivers/nvdimm/btt.h @@ -44,8 +44,6 @@ #define ent_e_flag(ent) (!!(ent & MAP_ERR_MASK)) #define ent_z_flag(ent) (!!(ent & MAP_TRIM_MASK)) #define set_e_flag(ent) (ent |= MAP_ERR_MASK) -/* 'normal' is both e and z flags set */ -#define ent_normal(ent) (ent_e_flag(ent) && ent_z_flag(ent)) enum btt_init_state { INIT_UNCHECKED = 0, diff -u linux-oem-4.15.0/drivers/nvdimm/btt_devs.c linux-oem-4.15.0/drivers/nvdimm/btt_devs.c --- linux-oem-4.15.0/drivers/nvdimm/btt_devs.c +++ linux-oem-4.15.0/drivers/nvdimm/btt_devs.c @@ -159,19 +159,11 @@ } static DEVICE_ATTR_RO(size); -static ssize_t log_zero_flags_show(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return sprintf(buf, "Y\n"); -} -static DEVICE_ATTR_RO(log_zero_flags); - static struct attribute *nd_btt_attributes[] = { &dev_attr_sector_size.attr, &dev_attr_namespace.attr, &dev_attr_uuid.attr, &dev_attr_size.attr, - &dev_attr_log_zero_flags.attr, NULL, }; diff -u linux-oem-4.15.0/drivers/pci/quirks.c linux-oem-4.15.0/drivers/pci/quirks.c --- linux-oem-4.15.0/drivers/pci/quirks.c +++ linux-oem-4.15.0/drivers/pci/quirks.c @@ -4936,25 +4936,13 @@ } DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x443, quirk_intel_qat_vf_cap); -/* - * FLR may cause the following to devices to hang: - * - * AMD Starship/Matisse HD Audio Controller 0x1487 - * AMD Starship USB 3.0 Host Controller 0x148c - * AMD Matisse USB 3.0 Host Controller 0x149c - * Intel 82579LM Gigabit Ethernet Controller 0x1502 - * Intel 82579V Gigabit Ethernet Controller 0x1503 - * - */ -static void quirk_no_flr(struct pci_dev *dev) +/* FLR may cause some 82579 devices to hang. */ +static void quirk_intel_no_flr(struct pci_dev *dev) { dev->dev_flags |= PCI_DEV_FLAGS_NO_FLR_RESET; } -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x1487, quirk_no_flr); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x148c, quirk_no_flr); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x149c, quirk_no_flr); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_intel_no_flr); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_intel_no_flr); static void quirk_intel_th_rtit_bar(struct pci_dev *dev) { diff -u linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-baytrail.c linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-baytrail.c --- linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-baytrail.c +++ linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -1503,7 +1503,6 @@ .direction_output = byt_gpio_direction_output, .get = byt_gpio_get, .set = byt_gpio_set, - .set_config = gpiochip_generic_config, .dbg_show = byt_gpio_dbg_show, }; diff -u linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-cherryview.c linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-cherryview.c --- linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-cherryview.c +++ linux-oem-4.15.0/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1488,15 +1488,11 @@ struct chv_pinctrl *pctrl = gpiochip_get_data(gc); struct irq_chip *chip = irq_desc_get_chip(desc); unsigned long pending; - unsigned long flags; u32 intr_line; chained_irq_enter(chip, desc); - raw_spin_lock_irqsave(&chv_lock, flags); pending = readl(pctrl->regs + CHV_INTSTAT); - raw_spin_unlock_irqrestore(&chv_lock, flags); - for_each_set_bit(intr_line, &pending, pctrl->community->nirqs) { unsigned irq, offset; diff -u linux-oem-4.15.0/drivers/platform/x86/asus-nb-wmi.c linux-oem-4.15.0/drivers/platform/x86/asus-nb-wmi.c --- linux-oem-4.15.0/drivers/platform/x86/asus-nb-wmi.c +++ linux-oem-4.15.0/drivers/platform/x86/asus-nb-wmi.c @@ -517,33 +517,9 @@ .detect_quirks = asus_nb_wmi_quirks, }; -static const struct dmi_system_id asus_nb_wmi_blacklist[] __initconst = { - { - /* - * asus-nb-wm adds no functionality. The T100TA has a detachable - * USB kbd, so no hotkeys and it has no WMI rfkill; and loading - * asus-nb-wm causes the camera LED to turn and _stay_ on. - */ - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"), - }, - }, - { - /* The Asus T200TA has the same issue as the T100TA */ - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T200TA"), - }, - }, - {} /* Terminating entry */ -}; static int __init asus_nb_wmi_init(void) { - if (dmi_check_system(asus_nb_wmi_blacklist)) - return -ENODEV; - return asus_wmi_register_driver(&asus_nb_wmi_driver); } diff -u linux-oem-4.15.0/drivers/rapidio/devices/rio_mport_cdev.c linux-oem-4.15.0/drivers/rapidio/devices/rio_mport_cdev.c --- linux-oem-4.15.0/drivers/rapidio/devices/rio_mport_cdev.c +++ linux-oem-4.15.0/drivers/rapidio/devices/rio_mport_cdev.c @@ -902,11 +902,6 @@ rmcd_error("pinned %ld out of %ld pages", pinned, nr_pages); ret = -EFAULT; - /* - * Set nr_pages up to mean "how many pages to unpin, in - * the error handler: - */ - nr_pages = pinned; goto err_pg; } diff -u linux-oem-4.15.0/drivers/s390/net/qeth_core.h linux-oem-4.15.0/drivers/s390/net/qeth_core.h --- linux-oem-4.15.0/drivers/s390/net/qeth_core.h +++ linux-oem-4.15.0/drivers/s390/net/qeth_core.h @@ -663,6 +663,7 @@ #define QETH_BROADCAST_WITH_ECHO 0x01 #define QETH_BROADCAST_WITHOUT_ECHO 0x02 +#define QETH_LAYER2_MAC_READ 0x01 #define QETH_LAYER2_MAC_REGISTERED 0x02 struct qeth_card_info { unsigned short unit_addr2; @@ -706,8 +707,6 @@ char hsuid[9]; }; -#define IS_LAYER2(card) ((card)->options.layer2 == QETH_DISCIPLINE_LAYER2) - /* * thread bits for qeth_card thread masks */ diff -u linux-oem-4.15.0/drivers/s390/net/qeth_core_main.c linux-oem-4.15.0/drivers/s390/net/qeth_core_main.c --- linux-oem-4.15.0/drivers/s390/net/qeth_core_main.c +++ linux-oem-4.15.0/drivers/s390/net/qeth_core_main.c @@ -4285,18 +4285,18 @@ struct qeth_reply *reply, unsigned long data) { struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; - struct qeth_ipacmd_setadpparms *adp_cmd; QETH_CARD_TEXT(card, 4, "chgmaccb"); if (qeth_setadpparms_inspect_rc(cmd)) return 0; - adp_cmd = &cmd->data.setadapterparms; - if (IS_LAYER2(card) && IS_OSD(card) && !IS_VM_NIC(card) && - !(adp_cmd->hdr.flags & QETH_SETADP_FLAGS_VIRTUAL_MAC)) - return 0; - - ether_addr_copy(card->dev->dev_addr, adp_cmd->data.change_addr.addr); + if (!card->options.layer2 || + !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { + memcpy(card->dev->dev_addr, + &cmd->data.setadapterparms.data.change_addr.addr, + OSA_ADDR_LEN); + card->info.mac_bits |= QETH_LAYER2_MAC_READ; + } return 0; } diff -u linux-oem-4.15.0/drivers/s390/net/qeth_core_mpc.h linux-oem-4.15.0/drivers/s390/net/qeth_core_mpc.h --- linux-oem-4.15.0/drivers/s390/net/qeth_core_mpc.h +++ linux-oem-4.15.0/drivers/s390/net/qeth_core_mpc.h @@ -64,10 +64,6 @@ QETH_CARD_TYPE_OSX = 2, }; -#define IS_OSD(card) ((card)->info.type == QETH_CARD_TYPE_OSD) -#define IS_OSN(card) ((card)->info.type == QETH_CARD_TYPE_OSN) -#define IS_VM_NIC(card) ((card)->info.guestlan) - #define QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE 0x18 /* only the first two bytes are looked at in qeth_get_cardname_short */ enum qeth_link_types { @@ -503,20 +499,17 @@ __u8 reserved3[8]; }; -#define QETH_SETADP_FLAGS_VIRTUAL_MAC 0x80 /* for CHANGE_ADDR_READ_MAC */ - struct qeth_ipacmd_setadpparms_hdr { - u32 supp_hw_cmds; - u32 reserved1; - u16 cmdlength; - u16 reserved2; - u32 command_code; - u16 return_code; - u8 used_total; - u8 seq_no; - u8 flags; - u8 reserved3[3]; -}; + __u32 supp_hw_cmds; + __u32 reserved1; + __u16 cmdlength; + __u16 reserved2; + __u32 command_code; + __u16 return_code; + __u8 used_total; + __u8 seq_no; + __u32 reserved3; +} __attribute__ ((packed)); struct qeth_ipacmd_setadpparms { struct qeth_ipacmd_setadpparms_hdr hdr; diff -u linux-oem-4.15.0/drivers/s390/net/qeth_l2_main.c linux-oem-4.15.0/drivers/s390/net/qeth_l2_main.c --- linux-oem-4.15.0/drivers/s390/net/qeth_l2_main.c +++ linux-oem-4.15.0/drivers/s390/net/qeth_l2_main.c @@ -498,23 +498,21 @@ /* fall back to alternative mechanism: */ } - if (!IS_OSN(card)) { + if (card->info.type == QETH_CARD_TYPE_IQD || + card->info.type == QETH_CARD_TYPE_OSM || + card->info.type == QETH_CARD_TYPE_OSX || + card->info.guestlan) { rc = qeth_setadpparms_change_macaddr(card); - if (!rc && is_valid_ether_addr(card->dev->dev_addr)) - goto out; - QETH_DBF_MESSAGE(2, "READ_MAC Assist failed on device %x: %#x\n", - CARD_DEVID(card), rc); - QETH_DBF_TEXT_(SETUP, 2, "1err%04x", rc); - /* fall back once more: */ + if (rc) { + QETH_DBF_MESSAGE(2, "couldn't get MAC address on " + "device %x: %#x\n", CARD_DEVID(card), rc); + QETH_DBF_TEXT_(SETUP, 2, "1err%04x", rc); + return rc; + } + } else { + eth_random_addr(card->dev->dev_addr); + memcpy(card->dev->dev_addr, vendor_pre, 3); } - - /* some devices don't support a custom MAC address: */ - if (card->info.type == QETH_CARD_TYPE_OSM || - card->info.type == QETH_CARD_TYPE_OSX) - return (rc) ? rc : -EADDRNOTAVAIL; - eth_random_addr(card->dev->dev_addr); - memcpy(card->dev->dev_addr, vendor_pre, 3); - out: QETH_DBF_HEX(SETUP, 2, card->dev->dev_addr, card->dev->addr_len); return 0; @@ -1013,8 +1011,7 @@ } card->info.broadcast_capable = 1; - if (!is_valid_ether_addr(card->dev->dev_addr)) - qeth_l2_request_initial_mac(card); + qeth_l2_request_initial_mac(card); SET_NETDEV_DEV(card->dev, &card->gdev->dev); netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); netif_carrier_off(card->dev); diff -u linux-oem-4.15.0/drivers/scsi/ibmvscsi/ibmvscsi.c linux-oem-4.15.0/drivers/scsi/ibmvscsi/ibmvscsi.c --- linux-oem-4.15.0/drivers/scsi/ibmvscsi/ibmvscsi.c +++ linux-oem-4.15.0/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -2298,12 +2298,16 @@ static int ibmvscsi_remove(struct vio_dev *vdev) { struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); + unsigned long flags; srp_remove_host(hostdata->host); scsi_remove_host(hostdata->host); purge_requests(hostdata, DID_ERROR); + + spin_lock_irqsave(hostdata->host->host_lock, flags); release_event_pool(&hostdata->pool, hostdata); + spin_unlock_irqrestore(hostdata->host->host_lock, flags); ibmvscsi_release_crq_queue(&hostdata->queue, hostdata, max_events); diff -u linux-oem-4.15.0/drivers/scsi/qla2xxx/qla_mbx.c linux-oem-4.15.0/drivers/scsi/qla2xxx/qla_mbx.c --- linux-oem-4.15.0/drivers/scsi/qla2xxx/qla_mbx.c +++ linux-oem-4.15.0/drivers/scsi/qla2xxx/qla_mbx.c @@ -3011,7 +3011,7 @@ ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x108c, "Entered %s.\n", __func__); - if (sp->qpair) + if (vha->flags.qpairs_available && sp->qpair) req = sp->qpair->req; if (ql2xasynctmfenable) diff -u linux-oem-4.15.0/drivers/scsi/sg.c linux-oem-4.15.0/drivers/scsi/sg.c --- linux-oem-4.15.0/drivers/scsi/sg.c +++ linux-oem-4.15.0/drivers/scsi/sg.c @@ -695,10 +695,8 @@ hp->flags = input_size; /* structure abuse ... */ hp->pack_id = old_hdr.pack_id; hp->usr_ptr = NULL; - if (__copy_from_user(cmnd, buf, cmd_size)) { - sg_remove_request(sfp, srp); + if (__copy_from_user(cmnd, buf, cmd_size)) return -EFAULT; - } /* * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV, * but is is possible that the app intended SG_DXFER_TO_DEV, because there reverted: --- linux-oem-4.15.0/drivers/staging/greybus/uart.c +++ linux-oem-4.15.0.orig/drivers/staging/greybus/uart.c @@ -537,9 +537,9 @@ } if (C_CRTSCTS(tty) && C_BAUD(tty) != B0) + newline.flow_control |= GB_SERIAL_AUTO_RTSCTS_EN; - newline.flow_control = GB_SERIAL_AUTO_RTSCTS_EN; else + newline.flow_control &= ~GB_SERIAL_AUTO_RTSCTS_EN; - newline.flow_control = 0; if (memcmp(&gb_tty->line_coding, &newline, sizeof(newline))) { memcpy(&gb_tty->line_coding, &newline, sizeof(newline)); reverted: --- linux-oem-4.15.0/drivers/staging/iio/resolver/ad2s1210.c +++ linux-oem-4.15.0.orig/drivers/staging/iio/resolver/ad2s1210.c @@ -126,24 +126,17 @@ static int ad2s1210_config_read(struct ad2s1210_state *st, unsigned char address) { + struct spi_transfer xfer = { + .len = 2, + .rx_buf = st->rx, + .tx_buf = st->tx, - struct spi_transfer xfers[] = { - { - .len = 1, - .rx_buf = &st->rx[0], - .tx_buf = &st->tx[0], - .cs_change = 1, - }, { - .len = 1, - .rx_buf = &st->rx[1], - .tx_buf = &st->tx[1], - }, }; int ret = 0; ad2s1210_set_mode(MOD_CONFIG, st); st->tx[0] = address | AD2S1210_MSB_IS_HIGH; st->tx[1] = AD2S1210_REG_FAULT; + ret = spi_sync_transfer(st->sdev, &xfer, 1); - ret = spi_sync_transfer(st->sdev, xfers, 2); if (ret < 0) return ret; st->old_data = true; diff -u linux-oem-4.15.0/drivers/thunderbolt/icm.c linux-oem-4.15.0/drivers/thunderbolt/icm.c --- linux-oem-4.15.0/drivers/thunderbolt/icm.c +++ linux-oem-4.15.0/drivers/thunderbolt/icm.c @@ -803,11 +803,9 @@ * connected another host to the same port, remove the switch * first. */ - sw = tb_switch_find_by_route(tb, route); - if (sw) { + sw = get_switch_at_route(tb->root_switch, route); + if (sw) remove_switch(sw); - tb_switch_put(sw); - } sw = tb_switch_find_by_link_depth(tb, link, depth); if (!sw) { @@ -1150,11 +1148,9 @@ * connected another host to the same port, remove the switch * first. */ - sw = tb_switch_find_by_route(tb, route); - if (sw) { + sw = get_switch_at_route(tb->root_switch, route); + if (sw) remove_switch(sw); - tb_switch_put(sw); - } sw = tb_switch_find_by_route(tb, get_parent_route(route)); if (!sw) { diff -u linux-oem-4.15.0/drivers/thunderbolt/switch.c linux-oem-4.15.0/drivers/thunderbolt/switch.c --- linux-oem-4.15.0/drivers/thunderbolt/switch.c +++ linux-oem-4.15.0/drivers/thunderbolt/switch.c @@ -664,6 +664,24 @@ return res.err; } +struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route) +{ + u8 next_port = route; /* + * Routes use a stride of 8 bits, + * eventhough a port index has 6 bits at most. + * */ + if (route == 0) + return sw; + if (next_port > sw->config.max_port_number) + return NULL; + if (tb_is_upstream_port(&sw->ports[next_port])) + return NULL; + if (!sw->ports[next_port].remote) + return NULL; + return get_switch_at_route(sw->ports[next_port].remote->sw, + route >> TB_ROUTE_SHIFT); +} + /** * tb_plug_events_active() - enable/disable plug events on a switch * reverted: --- linux-oem-4.15.0/drivers/thunderbolt/tb.c +++ linux-oem-4.15.0.orig/drivers/thunderbolt/tb.c @@ -258,7 +258,7 @@ if (!tcm->hotplug_active) goto out; /* during init, suspend or shutdown */ + sw = get_switch_at_route(tb->root_switch, ev->route); - sw = tb_switch_find_by_route(tb, ev->route); if (!sw) { tb_warn(tb, "hotplug event from non existent switch %llx:%x (unplug: %d)\n", @@ -269,14 +269,14 @@ tb_warn(tb, "hotplug event from non existent port %llx:%x (unplug: %d)\n", ev->route, ev->port, ev->unplug); + goto out; - goto put_sw; } port = &sw->ports[ev->port]; if (tb_is_upstream_port(port)) { tb_warn(tb, "hotplug event for upstream port %llx:%x (unplug: %d)\n", ev->route, ev->port, ev->unplug); + goto out; - goto put_sw; } if (ev->unplug) { if (port->remote) { @@ -306,9 +306,6 @@ tb_activate_pcie_devices(tb); } } - -put_sw: - tb_switch_put(sw); out: mutex_unlock(&tb->lock); kfree(ev); diff -u linux-oem-4.15.0/drivers/thunderbolt/tb.h linux-oem-4.15.0/drivers/thunderbolt/tb.h --- linux-oem-4.15.0/drivers/thunderbolt/tb.h +++ linux-oem-4.15.0/drivers/thunderbolt/tb.h @@ -397,6 +397,7 @@ int tb_switch_resume(struct tb_switch *sw); int tb_switch_reset(struct tb *tb, u64 route); void tb_sw_set_unplugged(struct tb_switch *sw); +struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route); struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link, u8 depth); struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid); diff -u linux-oem-4.15.0/drivers/usb/core/hub.c linux-oem-4.15.0/drivers/usb/core/hub.c --- linux-oem-4.15.0/drivers/usb/core/hub.c +++ linux-oem-4.15.0/drivers/usb/core/hub.c @@ -37,7 +37,6 @@ #define USB_VENDOR_GENESYS_LOGIC 0x05e3 #define USB_VENDOR_SMSC 0x0424 -#define USB_PRODUCT_USB5534B 0x5534 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 @@ -5366,11 +5365,8 @@ } static const struct usb_device_id hub_id_table[] = { - { .match_flags = USB_DEVICE_ID_MATCH_VENDOR - | USB_DEVICE_ID_MATCH_PRODUCT - | USB_DEVICE_ID_MATCH_INT_CLASS, + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_CLASS, .idVendor = USB_VENDOR_SMSC, - .idProduct = USB_PRODUCT_USB5534B, .bInterfaceClass = USB_CLASS_HUB, .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, { .match_flags = USB_DEVICE_ID_MATCH_VENDOR diff -u linux-oem-4.15.0/drivers/usb/core/message.c linux-oem-4.15.0/drivers/usb/core/message.c --- linux-oem-4.15.0/drivers/usb/core/message.c +++ linux-oem-4.15.0/drivers/usb/core/message.c @@ -1117,11 +1117,11 @@ if (usb_endpoint_out(epaddr)) { ep = dev->ep_out[epnum]; - if (reset_hardware && epnum != 0) + if (reset_hardware) dev->ep_out[epnum] = NULL; } else { ep = dev->ep_in[epnum]; - if (reset_hardware && epnum != 0) + if (reset_hardware) dev->ep_in[epnum] = NULL; } if (ep) { diff -u linux-oem-4.15.0/drivers/usb/gadget/configfs.c linux-oem-4.15.0/drivers/usb/gadget/configfs.c --- linux-oem-4.15.0/drivers/usb/gadget/configfs.c +++ linux-oem-4.15.0/drivers/usb/gadget/configfs.c @@ -260,9 +260,6 @@ char *name; int ret; - if (strlen(page) < len) - return -EOVERFLOW; - name = kstrdup(page, GFP_KERNEL); if (!name) return -ENOMEM; reverted: --- linux-oem-4.15.0/drivers/usb/gadget/legacy/audio.c +++ linux-oem-4.15.0.orig/drivers/usb/gadget/legacy/audio.c @@ -302,10 +302,8 @@ struct usb_descriptor_header *usb_desc; usb_desc = usb_otg_descriptor_alloc(cdev->gadget); + if (!usb_desc) - if (!usb_desc) { - status = -ENOMEM; goto fail; - } usb_otg_descriptor_init(cdev->gadget, usb_desc); otg_desc[0] = usb_desc; otg_desc[1] = NULL; diff -u linux-oem-4.15.0/drivers/usb/gadget/legacy/cdc2.c linux-oem-4.15.0/drivers/usb/gadget/legacy/cdc2.c --- linux-oem-4.15.0/drivers/usb/gadget/legacy/cdc2.c +++ linux-oem-4.15.0/drivers/usb/gadget/legacy/cdc2.c @@ -179,10 +179,8 @@ struct usb_descriptor_header *usb_desc; usb_desc = usb_otg_descriptor_alloc(gadget); - if (!usb_desc) { - status = -ENOMEM; + if (!usb_desc) goto fail1; - } usb_otg_descriptor_init(gadget, usb_desc); otg_desc[0] = usb_desc; otg_desc[1] = NULL; diff -u linux-oem-4.15.0/drivers/usb/gadget/legacy/ncm.c linux-oem-4.15.0/drivers/usb/gadget/legacy/ncm.c --- linux-oem-4.15.0/drivers/usb/gadget/legacy/ncm.c +++ linux-oem-4.15.0/drivers/usb/gadget/legacy/ncm.c @@ -158,10 +158,8 @@ struct usb_descriptor_header *usb_desc; usb_desc = usb_otg_descriptor_alloc(gadget); - if (!usb_desc) { - status = -ENOMEM; + if (!usb_desc) goto fail; - } usb_otg_descriptor_init(gadget, usb_desc); otg_desc[0] = usb_desc; otg_desc[1] = NULL; diff -u linux-oem-4.15.0/drivers/usb/gadget/udc/net2272.c linux-oem-4.15.0/drivers/usb/gadget/udc/net2272.c --- linux-oem-4.15.0/drivers/usb/gadget/udc/net2272.c +++ linux-oem-4.15.0/drivers/usb/gadget/udc/net2272.c @@ -2653,8 +2653,6 @@ err_req: release_mem_region(base, len); err: - kfree(dev); - return ret; } diff -u linux-oem-4.15.0/drivers/usb/host/xhci-plat.c linux-oem-4.15.0/drivers/usb/host/xhci-plat.c --- linux-oem-4.15.0/drivers/usb/host/xhci-plat.c +++ linux-oem-4.15.0/drivers/usb/host/xhci-plat.c @@ -334,7 +334,6 @@ struct clk *clk = xhci->clk; struct usb_hcd *shared_hcd = xhci->shared_hcd; - pm_runtime_get_sync(&dev->dev); xhci->xhc_state |= XHCI_STATE_REMOVING; usb_remove_hcd(shared_hcd); @@ -348,9 +347,8 @@ clk_disable_unprepare(clk); usb_put_hcd(hcd); - pm_runtime_disable(&dev->dev); - pm_runtime_put_noidle(&dev->dev); pm_runtime_set_suspended(&dev->dev); + pm_runtime_disable(&dev->dev); return 0; } diff -u linux-oem-4.15.0/drivers/usb/host/xhci-ring.c linux-oem-4.15.0/drivers/usb/host/xhci-ring.c --- linux-oem-4.15.0/drivers/usb/host/xhci-ring.c +++ linux-oem-4.15.0/drivers/usb/host/xhci-ring.c @@ -3321,8 +3321,8 @@ /* New sg entry */ --num_sgs; sent_len -= block_len; - sg = sg_next(sg); - if (num_sgs != 0 && sg) { + if (num_sgs != 0) { + sg = sg_next(sg); block_len = sg_dma_len(sg); addr = (u64) sg_dma_address(sg); addr += sent_len; reverted: --- linux-oem-4.15.0/drivers/usb/serial/garmin_gps.c +++ linux-oem-4.15.0.orig/drivers/usb/serial/garmin_gps.c @@ -1138,8 +1138,8 @@ send it directly to the tty port */ if (garmin_data_p->flags & FLAGS_QUEUING) { pkt_add(garmin_data_p, data, data_length); + } else if (bulk_data || + getLayerId(data) == GARMIN_LAYERID_APPL) { - } else if (bulk_data || (data_length >= sizeof(u32) && - getLayerId(data) == GARMIN_LAYERID_APPL)) { spin_lock_irqsave(&garmin_data_p->lock, flags); garmin_data_p->flags |= APP_RESP_SEEN; reverted: --- linux-oem-4.15.0/drivers/usb/serial/qcserial.c +++ linux-oem-4.15.0.orig/drivers/usb/serial/qcserial.c @@ -173,7 +173,6 @@ {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ - {DEVICE_SWI(0x413c, 0x81cc)}, /* Dell Wireless 5816e */ {DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ diff -u linux-oem-4.15.0/drivers/usb/storage/unusual_uas.h linux-oem-4.15.0/drivers/usb/storage/unusual_uas.h --- linux-oem-4.15.0/drivers/usb/storage/unusual_uas.h +++ linux-oem-4.15.0/drivers/usb/storage/unusual_uas.h @@ -28,13 +28,6 @@ * and don't forget to CC: the USB development list */ -/* Reported-by: Julian Groß */ -UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999, - "LaCie", - "2Big Quadra USB3", - USB_SC_DEVICE, USB_PR_DEVICE, NULL, - US_FL_NO_REPORT_OPCODES), - /* * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI * commands in UAS mode. Observed with the 1.28 firmware; are there others? diff -u linux-oem-4.15.0/drivers/vhost/vsock.c linux-oem-4.15.0/drivers/vhost/vsock.c --- linux-oem-4.15.0/drivers/vhost/vsock.c +++ linux-oem-4.15.0/drivers/vhost/vsock.c @@ -182,14 +182,14 @@ break; } - /* Deliver to monitoring devices all packets that we - * will transmit. - */ - virtio_transport_deliver_tap_pkt(pkt); - vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len); added = true; + /* Deliver to monitoring devices all correctly transmitted + * packets. + */ + virtio_transport_deliver_tap_pkt(pkt); + pkt->off += payload_len; total_len += payload_len; @@ -499,11 +499,6 @@ mutex_unlock(&vq->mutex); } - /* Some packets may have been queued before the device was started, - * let's kick the send worker to send them. - */ - vhost_work_queue(&vsock->dev, &vsock->send_pkt_work); - mutex_unlock(&vsock->dev.mutex); return 0; diff -u linux-oem-4.15.0/fs/ceph/caps.c linux-oem-4.15.0/fs/ceph/caps.c --- linux-oem-4.15.0/fs/ceph/caps.c +++ linux-oem-4.15.0/fs/ceph/caps.c @@ -3512,7 +3512,6 @@ WARN_ON(1); tsession = NULL; target = -1; - mutex_lock(&session->s_mutex); } goto retry; diff -u linux-oem-4.15.0/fs/cifs/cifssmb.c linux-oem-4.15.0/fs/cifs/cifssmb.c --- linux-oem-4.15.0/fs/cifs/cifssmb.c +++ linux-oem-4.15.0/fs/cifs/cifssmb.c @@ -2024,8 +2024,8 @@ } } - kref_put(&wdata2->refcount, cifs_writedata_release); if (rc) { + kref_put(&wdata2->refcount, cifs_writedata_release); if (is_retryable_error(rc)) continue; i += nr_pages; diff -u linux-oem-4.15.0/fs/cifs/connect.c linux-oem-4.15.0/fs/cifs/connect.c --- linux-oem-4.15.0/fs/cifs/connect.c +++ linux-oem-4.15.0/fs/cifs/connect.c @@ -349,10 +349,8 @@ return rc; } - spin_lock(&cifs_tcp_ses_lock); rc = cifs_convert_address((struct sockaddr *)&server->dstaddr, ipaddr, strlen(ipaddr)); - spin_unlock(&cifs_tcp_ses_lock); kfree(ipaddr); return !rc ? -1 : 0; diff -u linux-oem-4.15.0/fs/configfs/dir.c linux-oem-4.15.0/fs/configfs/dir.c --- linux-oem-4.15.0/fs/configfs/dir.c +++ linux-oem-4.15.0/fs/configfs/dir.c @@ -1537,7 +1537,6 @@ spin_lock(&configfs_dirent_lock); configfs_detach_rollback(dentry); spin_unlock(&configfs_dirent_lock); - config_item_put(parent_item); return -EINTR; } frag->frag_dead = true; reverted: --- linux-oem-4.15.0/fs/coredump.c +++ linux-oem-4.15.0.orig/fs/coredump.c @@ -753,14 +753,6 @@ if (displaced) put_files_struct(displaced); if (!dump_interrupted()) { - /* - * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would - * have this set to NULL. - */ - if (!cprm.file) { - pr_info("Core dump to |%s disabled\n", cn.corename); - goto close_fail; - } file_start_write(cprm.file); core_dumped = binfmt->core_dump(&cprm); file_end_write(cprm.file); diff -u linux-oem-4.15.0/fs/exec.c linux-oem-4.15.0/fs/exec.c --- linux-oem-4.15.0/fs/exec.c +++ linux-oem-4.15.0/fs/exec.c @@ -1274,8 +1274,6 @@ */ set_mm_exe_file(bprm->mm, bprm->file); - would_dump(bprm, bprm->file); - /* * Release all of the old mmap stuff */ @@ -1809,6 +1807,8 @@ if (retval < 0) goto out; + would_dump(bprm, bprm->file); + retval = exec_binprm(bprm); if (retval < 0) goto out; diff -u linux-oem-4.15.0/fs/file.c linux-oem-4.15.0/fs/file.c --- linux-oem-4.15.0/fs/file.c +++ linux-oem-4.15.0/fs/file.c @@ -75,7 +75,7 @@ */ static void copy_fdtable(struct fdtable *nfdt, struct fdtable *ofdt) { - size_t cpy, set; + unsigned int cpy, set; BUG_ON(nfdt->max_fds < ofdt->max_fds); diff -u linux-oem-4.15.0/fs/gfs2/glock.c linux-oem-4.15.0/fs/gfs2/glock.c --- linux-oem-4.15.0/fs/gfs2/glock.c +++ linux-oem-4.15.0/fs/gfs2/glock.c @@ -636,6 +636,9 @@ goto out_unlock; if (nonblock) goto out_sched; + smp_mb(); + if (atomic_read(&gl->gl_revokes) != 0) + goto out_sched; set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); gl->gl_target = gl->gl_demote_state; diff -u linux-oem-4.15.0/fs/ubifs/file.c linux-oem-4.15.0/fs/ubifs/file.c --- linux-oem-4.15.0/fs/ubifs/file.c +++ linux-oem-4.15.0/fs/ubifs/file.c @@ -1393,6 +1393,7 @@ struct ubifs_info *c = inode->i_sb->s_fs_info; struct ubifs_budget_req req = { .dirtied_ino = 1, .dirtied_ino_d = ALIGN(ui->data_len, 8) }; + int iflags = I_DIRTY_TIME; int err, release; err = ubifs_budget_space(c, &req); @@ -1407,8 +1408,11 @@ if (flags & S_MTIME) inode->i_mtime = *time; + if (!(inode->i_sb->s_flags & SB_LAZYTIME)) + iflags |= I_DIRTY_SYNC; + release = ui->dirty; - __mark_inode_dirty(inode, I_DIRTY_SYNC); + __mark_inode_dirty(inode, iflags); mutex_unlock(&ui->ui_mutex); if (release) ubifs_release_budget(c, &req); diff -u linux-oem-4.15.0/include/linux/compiler.h linux-oem-4.15.0/include/linux/compiler.h --- linux-oem-4.15.0/include/linux/compiler.h +++ linux-oem-4.15.0/include/linux/compiler.h @@ -329,8 +329,2 @@ -/* - * This is needed in functions which generate the stack canary, see - * arch/x86/kernel/smpboot.c::start_secondary() for an example. - */ -#define prevent_tail_call_optimization() mb() - #endif /* __LINUX_COMPILER_H */ diff -u linux-oem-4.15.0/include/linux/fs.h linux-oem-4.15.0/include/linux/fs.h --- linux-oem-4.15.0/include/linux/fs.h +++ linux-oem-4.15.0/include/linux/fs.h @@ -900,7 +900,7 @@ __u32 handle_bytes; int handle_type; /* file identifier */ - unsigned char f_handle[]; + unsigned char f_handle[0]; }; static inline struct file *get_file(struct file *f) diff -u linux-oem-4.15.0/include/linux/ieee80211.h linux-oem-4.15.0/include/linux/ieee80211.h --- linux-oem-4.15.0/include/linux/ieee80211.h +++ linux-oem-4.15.0/include/linux/ieee80211.h @@ -622,15 +622,6 @@ } /** - * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame - * @fc: frame control bytes in little-endian byteorder - */ -static inline bool ieee80211_is_any_nullfunc(__le16 fc) -{ - return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); -} - -/** * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU * @fc: frame control field in little-endian byteorder */ reverted: --- linux-oem-4.15.0/include/linux/padata.h +++ linux-oem-4.15.0.orig/include/linux/padata.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -84,14 +85,18 @@ * @serial: List to wait for serialization after reordering. * @pwork: work struct for parallelization. * @swork: work struct for serialization. + * @pd: Backpointer to the internal control structure. * @work: work struct for parallelization. + * @reorder_work: work struct for reordering. * @num_obj: Number of objects that are processed by this cpu. * @cpu_index: Index of the cpu. */ struct padata_parallel_queue { struct padata_list parallel; struct padata_list reorder; + struct parallel_data *pd; struct work_struct work; + struct work_struct reorder_work; atomic_t num_obj; int cpu_index; }; @@ -117,10 +122,10 @@ * @reorder_objects: Number of objects waiting in the reorder queues. * @refcnt: Number of objects holding a reference on this parallel_data. * @max_seq_nr: Maximal used sequence number. - * @cpu: Next CPU to be processed. * @cpumask: The cpumasks in use for parallel and serial workers. - * @reorder_work: work struct for reordering. * @lock: Reorder lock. + * @processed: Number of already processed objects. + * @timer: Reorder timer. */ struct parallel_data { struct padata_instance *pinst; @@ -129,10 +134,10 @@ atomic_t reorder_objects; atomic_t refcnt; atomic_t seq_nr; - int cpu; struct padata_cpumask cpumask; - struct work_struct reorder_work; spinlock_t lock ____cacheline_aligned; + unsigned int processed; + struct timer_list timer; }; /** reverted: --- linux-oem-4.15.0/include/linux/pnp.h +++ linux-oem-4.15.0.orig/include/linux/pnp.h @@ -220,8 +220,10 @@ #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list) #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list) #define to_pnp_card(n) container_of(n, struct pnp_card, dev) +#define pnp_for_each_card(card) \ + for((card) = global_to_pnp_card(pnp_cards.next); \ + (card) != global_to_pnp_card(&pnp_cards); \ + (card) = global_to_pnp_card((card)->global_list.next)) -#define pnp_for_each_card(card) \ - list_for_each_entry(card, &pnp_cards, global_list) struct pnp_card_link { struct pnp_card *card; @@ -274,9 +276,14 @@ #define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list) #define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list) #define to_pnp_dev(n) container_of(n, struct pnp_dev, dev) +#define pnp_for_each_dev(dev) \ + for((dev) = global_to_pnp_dev(pnp_global.next); \ + (dev) != global_to_pnp_dev(&pnp_global); \ + (dev) = global_to_pnp_dev((dev)->global_list.next)) +#define card_for_each_dev(card,dev) \ + for((dev) = card_to_pnp_dev((card)->devices.next); \ + (dev) != card_to_pnp_dev(&(card)->devices); \ + (dev) = card_to_pnp_dev((dev)->card_list.next)) -#define pnp_for_each_dev(dev) list_for_each_entry(dev, &pnp_global, global_list) -#define card_for_each_dev(card, dev) \ - list_for_each_entry(dev, &(card)->devices, card_list) #define pnp_dev_name(dev) (dev)->name static inline void *pnp_get_drvdata(struct pnp_dev *pdev) @@ -430,10 +437,14 @@ }; #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list) +#define protocol_for_each_card(protocol,card) \ + for((card) = protocol_to_pnp_card((protocol)->cards.next); \ + (card) != protocol_to_pnp_card(&(protocol)->cards); \ + (card) = protocol_to_pnp_card((card)->protocol_list.next)) +#define protocol_for_each_dev(protocol,dev) \ + for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \ + (dev) != protocol_to_pnp_dev(&(protocol)->devices); \ + (dev) = protocol_to_pnp_dev((dev)->protocol_list.next)) -#define protocol_for_each_card(protocol, card) \ - list_for_each_entry(card, &(protocol)->cards, protocol_list) -#define protocol_for_each_dev(protocol, dev) \ - list_for_each_entry(dev, &(protocol)->devices, protocol_list) extern struct bus_type pnp_bus_type; diff -u linux-oem-4.15.0/include/linux/tty.h linux-oem-4.15.0/include/linux/tty.h --- linux-oem-4.15.0/include/linux/tty.h +++ linux-oem-4.15.0/include/linux/tty.h @@ -65,7 +65,7 @@ int read; int flags; /* Data points here */ - unsigned long data[]; + unsigned long data[0]; }; /* Values for .flags field of tty_buffer */ diff -u linux-oem-4.15.0/include/linux/virtio_net.h linux-oem-4.15.0/include/linux/virtio_net.h --- linux-oem-4.15.0/include/linux/virtio_net.h +++ linux-oem-4.15.0/include/linux/virtio_net.h @@ -3,8 +3,6 @@ #define _LINUX_VIRTIO_NET_H #include -#include -#include #include static inline int virtio_net_hdr_set_proto(struct sk_buff *skb, @@ -30,25 +28,17 @@ bool little_endian) { unsigned int gso_type = 0; - unsigned int thlen = 0; - unsigned int ip_proto; if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { case VIRTIO_NET_HDR_GSO_TCPV4: gso_type = SKB_GSO_TCPV4; - ip_proto = IPPROTO_TCP; - thlen = sizeof(struct tcphdr); break; case VIRTIO_NET_HDR_GSO_TCPV6: gso_type = SKB_GSO_TCPV6; - ip_proto = IPPROTO_TCP; - thlen = sizeof(struct tcphdr); break; case VIRTIO_NET_HDR_GSO_UDP: gso_type = SKB_GSO_UDP; - ip_proto = IPPROTO_UDP; - thlen = sizeof(struct udphdr); break; default: return -EINVAL; @@ -67,20 +57,16 @@ if (!skb_partial_csum_set(skb, start, off)) return -EINVAL; - - if (skb_transport_offset(skb) + thlen > skb_headlen(skb)) - return -EINVAL; } else { /* gso packets without NEEDS_CSUM do not set transport_offset. * probe and drop if does not match one of the above types. */ if (gso_type && skb->network_header) { - struct flow_keys keys; - if (!skb->protocol) virtio_net_hdr_set_proto(skb, hdr); retry: - if (!skb_flow_dissect_flow_keys(skb, &keys, 0)) { + skb_probe_transport_header(skb, -1); + if (!skb_transport_header_was_set(skb)) { /* UFO does not specify ipv4 or 6: try both */ if (gso_type & SKB_GSO_UDP && skb->protocol == htons(ETH_P_IP)) { @@ -89,12 +75,6 @@ } return -EINVAL; } - - if (keys.control.thoff + thlen > skb_headlen(skb) || - keys.basic.ip_proto != ip_proto) - return -EINVAL; - - skb_set_transport_header(skb, keys.control.thoff); } } diff -u linux-oem-4.15.0/include/net/netfilter/nf_conntrack.h linux-oem-4.15.0/include/net/netfilter/nf_conntrack.h --- linux-oem-4.15.0/include/net/netfilter/nf_conntrack.h +++ linux-oem-4.15.0/include/net/netfilter/nf_conntrack.h @@ -80,7 +80,7 @@ struct hlist_node nat_bysource; #endif /* all members below initialized via memset */ - struct { } __nfct_init_offset; + u8 __nfct_init_offset[0]; /* If we were expected by an expectation, this will be it */ struct nf_conn *master; diff -u linux-oem-4.15.0/include/sound/rawmidi.h linux-oem-4.15.0/include/sound/rawmidi.h --- linux-oem-4.15.0/include/sound/rawmidi.h +++ linux-oem-4.15.0/include/sound/rawmidi.h @@ -76,7 +76,6 @@ size_t avail_min; /* min avail for wakeup */ size_t avail; /* max used buffer for wakeup */ size_t xruns; /* over/underruns counter */ - int buffer_ref; /* buffer reference count */ /* misc */ spinlock_t lock; wait_queue_head_t sleep; diff -u linux-oem-4.15.0/include/uapi/linux/ndctl.h linux-oem-4.15.0/include/uapi/linux/ndctl.h --- linux-oem-4.15.0/include/uapi/linux/ndctl.h +++ linux-oem-4.15.0/include/uapi/linux/ndctl.h @@ -301,7 +301,6 @@ #define NVDIMM_FAMILY_HPE1 1 #define NVDIMM_FAMILY_HPE2 2 #define NVDIMM_FAMILY_MSFT 3 -#define NVDIMM_FAMILY_HYPERV 4 #define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\ struct nd_cmd_pkg) diff -u linux-oem-4.15.0/init/main.c linux-oem-4.15.0/init/main.c --- linux-oem-4.15.0/init/main.c +++ linux-oem-4.15.0/init/main.c @@ -712,8 +712,6 @@ /* Do the rest non-__init'ed, we're now alive */ rest_init(); - - prevent_tail_call_optimization(); } /* Call all constructor functions linked into the kernel. */ diff -u linux-oem-4.15.0/ipc/util.c linux-oem-4.15.0/ipc/util.c --- linux-oem-4.15.0/ipc/util.c +++ linux-oem-4.15.0/ipc/util.c @@ -763,21 +763,21 @@ total++; } - ipc = NULL; + *new_pos = pos + 1; if (total >= ids->in_use) - goto out; + return NULL; for (; pos < IPCMNI; pos++) { ipc = idr_find(&ids->ipcs_idr, pos); if (ipc != NULL) { rcu_read_lock(); ipc_lock_object(ipc); - break; + return ipc; } } -out: - *new_pos = pos + 1; - return ipc; + + /* Out of range - return NULL to terminate iteration */ + return NULL; } static void *sysvipc_proc_next(struct seq_file *s, void *it, loff_t *pos) diff -u linux-oem-4.15.0/kernel/padata.c linux-oem-4.15.0/kernel/padata.c --- linux-oem-4.15.0/kernel/padata.c +++ linux-oem-4.15.0/kernel/padata.c @@ -166,12 +166,23 @@ */ static struct padata_priv *padata_get_next(struct parallel_data *pd) { + int cpu, num_cpus; + unsigned int next_nr, next_index; struct padata_parallel_queue *next_queue; struct padata_priv *padata; struct padata_list *reorder; - int cpu = pd->cpu; + num_cpus = cpumask_weight(pd->cpumask.pcpu); + + /* + * Calculate the percpu reorder queue and the sequence + * number of the next object. + */ + next_nr = pd->processed; + next_index = next_nr % num_cpus; + cpu = padata_index_to_cpu(pd, next_index); next_queue = per_cpu_ptr(pd->pqueue, cpu); + reorder = &next_queue->reorder; spin_lock(&reorder->lock); @@ -182,8 +193,7 @@ list_del_init(&padata->list); atomic_dec(&pd->reorder_objects); - pd->cpu = cpumask_next_wrap(cpu, pd->cpumask.pcpu, -1, - false); + pd->processed++; spin_unlock(&reorder->lock); goto out; @@ -206,7 +216,6 @@ struct padata_priv *padata; struct padata_serial_queue *squeue; struct padata_instance *pinst = pd->pinst; - struct padata_parallel_queue *next_queue; /* * We need to ensure that only one cpu can work on dequeueing of @@ -238,6 +247,7 @@ * so exit immediately. */ if (PTR_ERR(padata) == -ENODATA) { + del_timer(&pd->timer); spin_unlock_bh(&pd->lock); return; } @@ -256,29 +266,70 @@ /* * The next object that needs serialization might have arrived to - * the reorder queues in the meantime. + * the reorder queues in the meantime, we will be called again + * from the timer function if no one else cares for it. * - * Ensure reorder queue is read after pd->lock is dropped so we see - * new objects from another task in padata_do_serial. Pairs with + * Ensure reorder_objects is read after pd->lock is dropped so we see + * an increment from another task in padata_do_serial. Pairs with * smp_mb__after_atomic in padata_do_serial. */ smp_mb(); + if (atomic_read(&pd->reorder_objects) + && !(pinst->flags & PADATA_RESET)) + mod_timer(&pd->timer, jiffies + HZ); + else + del_timer(&pd->timer); - next_queue = per_cpu_ptr(pd->pqueue, pd->cpu); - if (!list_empty(&next_queue->reorder.list)) - queue_work(pinst->wq, &pd->reorder_work); + return; } static void invoke_padata_reorder(struct work_struct *work) { + struct padata_parallel_queue *pqueue; struct parallel_data *pd; local_bh_disable(); - pd = container_of(work, struct parallel_data, reorder_work); + pqueue = container_of(work, struct padata_parallel_queue, reorder_work); + pd = pqueue->pd; padata_reorder(pd); local_bh_enable(); } +static void padata_reorder_timer(struct timer_list *t) +{ + struct parallel_data *pd = from_timer(pd, t, timer); + unsigned int weight; + int target_cpu, cpu; + + cpu = get_cpu(); + + /* We don't lock pd here to not interfere with parallel processing + * padata_reorder() calls on other CPUs. We just need any CPU out of + * the cpumask.pcpu set. It would be nice if it's the right one but + * it doesn't matter if we're off to the next one by using an outdated + * pd->processed value. + */ + weight = cpumask_weight(pd->cpumask.pcpu); + target_cpu = padata_index_to_cpu(pd, pd->processed % weight); + + /* ensure to call the reorder callback on the correct CPU */ + if (cpu != target_cpu) { + struct padata_parallel_queue *pqueue; + struct padata_instance *pinst; + + /* The timer function is serialized wrt itself -- no locking + * needed. + */ + pinst = pd->pinst; + pqueue = per_cpu_ptr(pd->pqueue, target_cpu); + queue_work_on(target_cpu, pinst->wq, &pqueue->reorder_work); + } else { + padata_reorder(pd); + } + + put_cpu(); +} + static void padata_serial_worker(struct work_struct *serial_work) { struct padata_serial_queue *squeue; @@ -323,23 +374,47 @@ */ void padata_do_serial(struct padata_priv *padata) { - struct parallel_data *pd = padata->pd; - struct padata_parallel_queue *pqueue = per_cpu_ptr(pd->pqueue, - padata->cpu); + int cpu; + struct padata_parallel_queue *pqueue; + struct parallel_data *pd; + int reorder_via_wq = 0; + + pd = padata->pd; + + cpu = get_cpu(); + + /* We need to run on the same CPU padata_do_parallel(.., padata, ..) + * was called on -- or, at least, enqueue the padata object into the + * correct per-cpu queue. + */ + if (cpu != padata->cpu) { + reorder_via_wq = 1; + cpu = padata->cpu; + } + + pqueue = per_cpu_ptr(pd->pqueue, cpu); spin_lock(&pqueue->reorder.lock); - list_add_tail(&padata->list, &pqueue->reorder.list); atomic_inc(&pd->reorder_objects); + list_add_tail(&padata->list, &pqueue->reorder.list); spin_unlock(&pqueue->reorder.lock); /* - * Ensure the addition to the reorder list is ordered correctly + * Ensure the atomic_inc of reorder_objects above is ordered correctly * with the trylock of pd->lock in padata_reorder. Pairs with smp_mb * in padata_reorder. */ smp_mb__after_atomic(); - padata_reorder(pd); + put_cpu(); + + /* If we're running on the wrong CPU, call padata_reorder() via a + * kernel worker. + */ + if (reorder_via_wq) + queue_work_on(cpu, pd->pinst->wq, &pqueue->reorder_work); + else + padata_reorder(pd); } EXPORT_SYMBOL(padata_do_serial); @@ -395,12 +470,14 @@ continue; } + pqueue->pd = pd; pqueue->cpu_index = cpu_index; cpu_index++; __padata_list_init(&pqueue->reorder); __padata_list_init(&pqueue->parallel); INIT_WORK(&pqueue->work, padata_parallel_worker); + INIT_WORK(&pqueue->reorder_work, invoke_padata_reorder); atomic_set(&pqueue->num_obj, 0); } } @@ -428,13 +505,12 @@ padata_init_pqueues(pd); padata_init_squeues(pd); + timer_setup(&pd->timer, padata_reorder_timer, 0); atomic_set(&pd->seq_nr, -1); atomic_set(&pd->reorder_objects, 0); atomic_set(&pd->refcnt, 1); pd->pinst = pinst; spin_lock_init(&pd->lock); - pd->cpu = cpumask_first(pd->cpumask.pcpu); - INIT_WORK(&pd->reorder_work, invoke_padata_reorder); return pd; diff -u linux-oem-4.15.0/kernel/trace/trace.c linux-oem-4.15.0/kernel/trace/trace.c --- linux-oem-4.15.0/kernel/trace/trace.c +++ linux-oem-4.15.0/kernel/trace/trace.c @@ -7672,19 +7672,6 @@ */ allocate_snapshot = false; #endif - - /* - * Because of some magic with the way alloc_percpu() works on - * x86_64, we need to synchronize the pgd of all the tables, - * otherwise the trace events that happen in x86_64 page fault - * handlers can't cope with accessing the chance that a - * alloc_percpu()'d memory might be touched in the page fault trace - * event. Oh, and we need to audit all other alloc_percpu() and vmalloc() - * calls in tracing, because something might get triggered within a - * page fault trace event! - */ - vmalloc_sync_mappings(); - return 0; } reverted: --- linux-oem-4.15.0/kernel/umh.c +++ linux-oem-4.15.0.orig/kernel/umh.c @@ -404,11 +404,6 @@ * Runs a user-space application. The application is started * asynchronously if wait is not set, and runs as a child of system workqueues. * (ie. it runs with full root capabilities and optimized affinity). - * - * Note: successful return value does not guarantee the helper was called at - * all. You can't rely on sub_info->{init,cleanup} being called even for - * UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers - * into a successful no-op. */ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait) { diff -u linux-oem-4.15.0/lib/Makefile linux-oem-4.15.0/lib/Makefile --- linux-oem-4.15.0/lib/Makefile +++ linux-oem-4.15.0/lib/Makefile @@ -261,8 +261,6 @@ obj-$(CONFIG_UBSAN) += ubsan.o UBSAN_SANITIZE_ubsan.o := n -KASAN_SANITIZE_ubsan.o := n -CFLAGS_ubsan.o := $(call cc-option, -fno-stack-protector) $(DISABLE_STACKLEAK_PLUGIN) obj-$(CONFIG_SBITMAP) += sbitmap.o reverted: --- linux-oem-4.15.0/lib/mpi/longlong.h +++ linux-oem-4.15.0.orig/lib/mpi/longlong.h @@ -756,22 +756,22 @@ do { \ if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else \ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "%r" ((USItype)(al)), \ @@ -781,36 +781,36 @@ do { \ if (__builtin_constant_p(ah) && (ah) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else \ __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ + : "=r" ((USItype)(sh)), \ + "=&r" ((USItype)(sl)) \ - : "=r" (sh), \ - "=&r" (sl) \ : "r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ @@ -821,7 +821,7 @@ do { \ USItype __m0 = (m0), __m1 = (m1); \ __asm__ ("mulhwu %0,%1,%2" \ + : "=r" ((USItype) ph) \ - : "=r" (ph) \ : "%r" (__m0), \ "r" (__m1)); \ (pl) = __m0 * __m1; \ diff -u linux-oem-4.15.0/mm/page_alloc.c linux-oem-4.15.0/mm/page_alloc.c --- linux-oem-4.15.0/mm/page_alloc.c +++ linux-oem-4.15.0/mm/page_alloc.c @@ -1413,7 +1413,6 @@ if (!__pageblock_pfn_to_page(block_start_pfn, block_end_pfn, zone)) return; - cond_resched(); } /* We confirm that there is no hole */ diff -u linux-oem-4.15.0/mm/shmem.c linux-oem-4.15.0/mm/shmem.c --- linux-oem-4.15.0/mm/shmem.c +++ linux-oem-4.15.0/mm/shmem.c @@ -2138,11 +2138,7 @@ struct shmem_inode_info *info = SHMEM_I(inode); int retval = -ENOMEM; - /* - * What serializes the accesses to info->flags? - * ipc_lock_object() when called from shmctl_do_lock(), - * no serialization needed when called from shm_destroy(). - */ + spin_lock_irq(&info->lock); if (lock && !(info->flags & VM_LOCKED)) { if (!user_shm_lock(inode->i_size, user)) goto out_nomem; @@ -2157,6 +2153,7 @@ retval = 0; out_nomem: + spin_unlock_irq(&info->lock); return retval; } diff -u linux-oem-4.15.0/net/batman-adv/bat_v_ogm.c linux-oem-4.15.0/net/batman-adv/bat_v_ogm.c --- linux-oem-4.15.0/net/batman-adv/bat_v_ogm.c +++ linux-oem-4.15.0/net/batman-adv/bat_v_ogm.c @@ -734,7 +734,7 @@ orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig); if (!orig_node) - goto out; + return; neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming, ethhdr->h_source); diff -u linux-oem-4.15.0/net/batman-adv/network-coding.c linux-oem-4.15.0/net/batman-adv/network-coding.c --- linux-oem-4.15.0/net/batman-adv/network-coding.c +++ linux-oem-4.15.0/net/batman-adv/network-coding.c @@ -1017,8 +1017,15 @@ */ static u8 batadv_nc_random_weight_tq(u8 tq) { + u8 rand_val, rand_tq; + + get_random_bytes(&rand_val, sizeof(rand_val)); + /* randomize the estimated packet loss (max TQ - estimated TQ) */ - u8 rand_tq = prandom_u32_max(BATADV_TQ_MAX_VALUE + 1 - tq); + rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq); + + /* normalize the randomized packet loss */ + rand_tq /= BATADV_TQ_MAX_VALUE; /* convert to (randomized) estimated tq again */ return BATADV_TQ_MAX_VALUE - rand_tq; diff -u linux-oem-4.15.0/net/batman-adv/sysfs.c linux-oem-4.15.0/net/batman-adv/sysfs.c --- linux-oem-4.15.0/net/batman-adv/sysfs.c +++ linux-oem-4.15.0/net/batman-adv/sysfs.c @@ -1081,7 +1081,7 @@ ret = batadv_parse_throughput(net_dev, buff, "throughput_override", &tp_override); if (!ret) - goto out; + return count; old_tp_override = atomic_read(&hard_iface->bat_v.throughput_override); if (old_tp_override == tp_override) @@ -1114,7 +1114,6 @@ tp_override = atomic_read(&hard_iface->bat_v.throughput_override); - batadv_hardif_put(hard_iface); return sprintf(buff, "%u.%u MBit\n", tp_override / 10, tp_override % 10); } diff -u linux-oem-4.15.0/net/core/dev.c linux-oem-4.15.0/net/core/dev.c --- linux-oem-4.15.0/net/core/dev.c +++ linux-oem-4.15.0/net/core/dev.c @@ -7561,13 +7561,11 @@ netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n", &feature, lower->name); lower->wanted_features &= ~feature; - __netdev_update_features(lower); + netdev_update_features(lower); if (unlikely(lower->features & feature)) netdev_WARN(upper, "failed to disable %pNF on %s!\n", &feature, lower->name); - else - netdev_features_change(lower); } } } reverted: --- linux-oem-4.15.0/net/core/drop_monitor.c +++ linux-oem-4.15.0.orig/net/core/drop_monitor.c @@ -154,7 +154,6 @@ static void trace_drop_common(struct sk_buff *skb, void *location) { struct net_dm_alert_msg *msg; - struct net_dm_drop_point *point; struct nlmsghdr *nlh; struct nlattr *nla; int i; @@ -173,13 +172,11 @@ nlh = (struct nlmsghdr *)dskb->data; nla = genlmsg_data(nlmsg_data(nlh)); msg = nla_data(nla); - point = msg->points; for (i = 0; i < msg->entries; i++) { + if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) { + msg->points[i].count++; - if (!memcmp(&location, &point->pc, sizeof(void *))) { - point->count++; goto out; } - point++; } if (msg->entries == dm_hit_limit) goto out; @@ -188,8 +185,8 @@ */ __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point)); nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point)); + memcpy(msg->points[msg->entries].pc, &location, sizeof(void *)); + msg->points[msg->entries].count = 1; - memcpy(point->pc, &location, sizeof(void *)); - point->count = 1; msg->entries++; if (!timer_pending(&data->send_timer)) { diff -u linux-oem-4.15.0/net/core/netclassid_cgroup.c linux-oem-4.15.0/net/core/netclassid_cgroup.c --- linux-oem-4.15.0/net/core/netclassid_cgroup.c +++ linux-oem-4.15.0/net/core/netclassid_cgroup.c @@ -131,8 +131,10 @@ cs->classid = (u32)value; css_task_iter_start(css, 0, &it); - while ((p = css_task_iter_next(&it))) + while ((p = css_task_iter_next(&it))) { update_classid_task(p, cs->classid); + cond_resched(); + } css_task_iter_end(&it); return 0; reverted: --- linux-oem-4.15.0/net/core/netprio_cgroup.c +++ linux-oem-4.15.0.orig/net/core/netprio_cgroup.c @@ -240,8 +240,6 @@ struct task_struct *p; struct cgroup_subsys_state *css; - cgroup_sk_alloc_disable(); - cgroup_taskset_for_each(p, css, tset) { void *v = (void *)(unsigned long)css->cgroup->id; diff -u linux-oem-4.15.0/net/dsa/dsa2.c linux-oem-4.15.0/net/dsa/dsa2.c --- linux-oem-4.15.0/net/dsa/dsa2.c +++ linux-oem-4.15.0/net/dsa/dsa2.c @@ -389,7 +389,7 @@ err = dsa_switch_setup(ds); if (err) - continue; + return err; for (port = 0; port < ds->num_ports; port++) { dp = &ds->ports[port]; diff -u linux-oem-4.15.0/net/ipv4/cipso_ipv4.c linux-oem-4.15.0/net/ipv4/cipso_ipv4.c --- linux-oem-4.15.0/net/ipv4/cipso_ipv4.c +++ linux-oem-4.15.0/net/ipv4/cipso_ipv4.c @@ -1272,8 +1272,7 @@ return ret_val; } - if (secattr->attr.mls.cat) - secattr->flags |= NETLBL_SECATTR_MLS_CAT; + secattr->flags |= NETLBL_SECATTR_MLS_CAT; } return 0; @@ -1454,8 +1453,7 @@ return ret_val; } - if (secattr->attr.mls.cat) - secattr->flags |= NETLBL_SECATTR_MLS_CAT; + secattr->flags |= NETLBL_SECATTR_MLS_CAT; } return 0; diff -u linux-oem-4.15.0/net/ipv4/route.c linux-oem-4.15.0/net/ipv4/route.c --- linux-oem-4.15.0/net/ipv4/route.c +++ linux-oem-4.15.0/net/ipv4/route.c @@ -921,7 +921,7 @@ /* Check for load limit; set rate_last to the latest sent * redirect. */ - if (peer->n_redirects == 0 || + if (peer->rate_tokens == 0 || time_after(jiffies, (peer->rate_last + (ip_rt_redirect_load << peer->n_redirects)))) { diff -u linux-oem-4.15.0/net/ipv4/tcp.c linux-oem-4.15.0/net/ipv4/tcp.c --- linux-oem-4.15.0/net/ipv4/tcp.c +++ linux-oem-4.15.0/net/ipv4/tcp.c @@ -1998,15 +1998,13 @@ tp->urg_data = 0; tcp_fast_path_check(sk); } + if (used + offset < skb->len) + continue; if (TCP_SKB_CB(skb)->has_rxtstamp) { tcp_update_recv_tstamps(skb, &tss); has_tss = true; } - - if (used + offset < skb->len) - continue; - if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) goto found_fin_ok; if (!(flags & MSG_PEEK)) diff -u linux-oem-4.15.0/net/ipv6/af_inet6.c linux-oem-4.15.0/net/ipv6/af_inet6.c --- linux-oem-4.15.0/net/ipv6/af_inet6.c +++ linux-oem-4.15.0/net/ipv6/af_inet6.c @@ -1092,11 +1092,11 @@ igmp_fail: ndisc_cleanup(); ndisc_fail: - icmpv6_cleanup(); -icmp_fail: ip6_mr_cleanup(); -ipmr_fail: +icmp_fail: unregister_pernet_subsys(&inet6_net_ops); +ipmr_fail: + icmpv6_cleanup(); register_pernet_fail: sock_unregister(PF_INET6); rtnl_unregister_all(PF_INET6); diff -u linux-oem-4.15.0/net/ipv6/calipso.c linux-oem-4.15.0/net/ipv6/calipso.c --- linux-oem-4.15.0/net/ipv6/calipso.c +++ linux-oem-4.15.0/net/ipv6/calipso.c @@ -1061,8 +1061,7 @@ goto getattr_return; } - if (secattr->attr.mls.cat) - secattr->flags |= NETLBL_SECATTR_MLS_CAT; + secattr->flags |= NETLBL_SECATTR_MLS_CAT; } secattr->type = NETLBL_NLTYPE_CALIPSO; diff -u linux-oem-4.15.0/net/ipv6/route.c linux-oem-4.15.0/net/ipv6/route.c --- linux-oem-4.15.0/net/ipv6/route.c +++ linux-oem-4.15.0/net/ipv6/route.c @@ -2080,10 +2080,8 @@ const struct in6_addr *daddr, *saddr; struct rt6_info *rt6 = (struct rt6_info *)dst; - /* Note: do *NOT* check dst_metric_locked(dst, RTAX_MTU) - * IPv6 pmtu discovery isn't optional, so 'mtu lock' cannot disable it. - * [see also comment in rt6_mtu_change_route()] - */ + if (dst_metric_locked(dst, RTAX_MTU)) + return; if (iph) { daddr = &iph->daddr; diff -u linux-oem-4.15.0/net/mac80211/mlme.c linux-oem-4.15.0/net/mac80211/mlme.c --- linux-oem-4.15.0/net/mac80211/mlme.c +++ linux-oem-4.15.0/net/mac80211/mlme.c @@ -2261,7 +2261,7 @@ if (!ieee80211_is_data(hdr->frame_control)) return; - if (ieee80211_is_any_nullfunc(hdr->frame_control) && + if (ieee80211_is_nullfunc(hdr->frame_control) && sdata->u.mgd.probe_send_count > 0) { if (ack) ieee80211_sta_reset_conn_monitor(sdata); diff -u linux-oem-4.15.0/net/mac80211/rx.c linux-oem-4.15.0/net/mac80211/rx.c --- linux-oem-4.15.0/net/mac80211/rx.c +++ linux-oem-4.15.0/net/mac80211/rx.c @@ -1255,7 +1255,8 @@ return RX_CONTINUE; if (ieee80211_is_ctl(hdr->frame_control) || - ieee80211_is_any_nullfunc(hdr->frame_control) || + ieee80211_is_nullfunc(hdr->frame_control) || + ieee80211_is_qos_nullfunc(hdr->frame_control) || is_multicast_ether_addr(hdr->addr1)) return RX_CONTINUE; @@ -1642,7 +1643,8 @@ * Drop (qos-)data::nullfunc frames silently, since they * are used only to control station power saving mode. */ - if (ieee80211_is_any_nullfunc(hdr->frame_control)) { + if (ieee80211_is_nullfunc(hdr->frame_control) || + ieee80211_is_qos_nullfunc(hdr->frame_control)) { I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); /* @@ -2132,7 +2134,7 @@ /* Drop unencrypted frames if key is set. */ if (unlikely(!ieee80211_has_protected(fc) && - !ieee80211_is_any_nullfunc(fc) && + !ieee80211_is_nullfunc(fc) && ieee80211_is_data(fc) && rx->key)) return -EACCES; diff -u linux-oem-4.15.0/net/mac80211/status.c linux-oem-4.15.0/net/mac80211/status.c --- linux-oem-4.15.0/net/mac80211/status.c +++ linux-oem-4.15.0/net/mac80211/status.c @@ -478,7 +478,8 @@ rcu_read_lock(); sdata = ieee80211_sdata_from_skb(local, skb); if (sdata) { - if (ieee80211_is_any_nullfunc(hdr->frame_control)) + if (ieee80211_is_nullfunc(hdr->frame_control) || + ieee80211_is_qos_nullfunc(hdr->frame_control)) cfg80211_probe_status(sdata->dev, hdr->addr1, cookie, acked, GFP_ATOMIC); @@ -855,7 +856,7 @@ I802_DEBUG_INC(local->dot11FailedCount); } - if (ieee80211_is_any_nullfunc(fc) && + if ((ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)) && ieee80211_has_pm(fc) && ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS) && !(info->flags & IEEE80211_TX_CTL_INJECTED) && diff -u linux-oem-4.15.0/net/mac80211/tx.c linux-oem-4.15.0/net/mac80211/tx.c --- linux-oem-4.15.0/net/mac80211/tx.c +++ linux-oem-4.15.0/net/mac80211/tx.c @@ -296,7 +296,7 @@ if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && !ieee80211_is_probe_req(hdr->frame_control) && - !ieee80211_is_any_nullfunc(hdr->frame_control)) + !ieee80211_is_nullfunc(hdr->frame_control)) /* * When software scanning only nullfunc frames (to notify * the sleep state to the AP) and probe requests (for the diff -u linux-oem-4.15.0/net/netfilter/nf_conntrack_core.c linux-oem-4.15.0/net/netfilter/nf_conntrack_core.c --- linux-oem-4.15.0/net/netfilter/nf_conntrack_core.c +++ linux-oem-4.15.0/net/netfilter/nf_conntrack_core.c @@ -1208,9 +1208,9 @@ *(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev) = hash; ct->status = 0; write_pnet(&ct->ct_net, net); - memset(&ct->__nfct_init_offset, 0, + memset(&ct->__nfct_init_offset[0], 0, offsetof(struct nf_conn, proto) - - offsetof(struct nf_conn, __nfct_init_offset)); + offsetof(struct nf_conn, __nfct_init_offset[0])); nf_ct_zone_add(ct, zone); reverted: --- linux-oem-4.15.0/net/netfilter/nf_nat_proto_udp.c +++ linux-oem-4.15.0.orig/net/netfilter/nf_nat_proto_udp.c @@ -66,14 +66,15 @@ enum nf_nat_manip_type maniptype) { struct udphdr *hdr; + bool do_csum; if (!skb_make_writable(skb, hdroff + sizeof(*hdr))) return false; hdr = (struct udphdr *)(skb->data + hdroff); + do_csum = hdr->check || skb->ip_summed == CHECKSUM_PARTIAL; - __udp_manip_pkt(skb, l3proto, iphdroff, hdr, tuple, maniptype, - !!hdr->check); + __udp_manip_pkt(skb, l3proto, iphdroff, hdr, tuple, maniptype, do_csum); return true; } diff -u linux-oem-4.15.0/net/netfilter/nft_set_rbtree.c linux-oem-4.15.0/net/netfilter/nft_set_rbtree.c --- linux-oem-4.15.0/net/netfilter/nft_set_rbtree.c +++ linux-oem-4.15.0/net/netfilter/nft_set_rbtree.c @@ -35,11 +35,6 @@ (*nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END); } -static bool nft_rbtree_interval_start(const struct nft_rbtree_elem *rbe) -{ - return !nft_rbtree_interval_end(rbe); -} - static bool nft_rbtree_equal(const struct nft_set *set, const void *this, const struct nft_rbtree_elem *interval) { @@ -71,7 +66,7 @@ if (interval && nft_rbtree_equal(set, this, interval) && nft_rbtree_interval_end(this) && - nft_rbtree_interval_start(interval)) + !nft_rbtree_interval_end(interval)) continue; interval = rbe; } else if (d > 0) @@ -91,7 +86,7 @@ if (set->flags & NFT_SET_INTERVAL && interval != NULL && nft_set_elem_active(&interval->ext, genmask) && - nft_rbtree_interval_start(interval)) { + !nft_rbtree_interval_end(interval)) { *ext = &interval->ext; return true; } @@ -214,9 +209,9 @@ p = &parent->rb_right; else { if (nft_rbtree_interval_end(rbe) && - nft_rbtree_interval_start(new)) { + !nft_rbtree_interval_end(new)) { p = &parent->rb_left; - } else if (nft_rbtree_interval_start(rbe) && + } else if (!nft_rbtree_interval_end(rbe) && nft_rbtree_interval_end(new)) { p = &parent->rb_right; } else if (nft_set_elem_active(&rbe->ext, genmask)) { @@ -302,10 +297,10 @@ parent = parent->rb_right; else { if (nft_rbtree_interval_end(rbe) && - nft_rbtree_interval_start(this)) { + !nft_rbtree_interval_end(this)) { parent = parent->rb_left; continue; - } else if (nft_rbtree_interval_start(rbe) && + } else if (!nft_rbtree_interval_end(rbe) && nft_rbtree_interval_end(this)) { parent = parent->rb_right; continue; diff -u linux-oem-4.15.0/net/netlabel/netlabel_kapi.c linux-oem-4.15.0/net/netlabel/netlabel_kapi.c --- linux-oem-4.15.0/net/netlabel/netlabel_kapi.c +++ linux-oem-4.15.0/net/netlabel/netlabel_kapi.c @@ -748,12 +748,6 @@ if ((off & (BITS_PER_LONG - 1)) != 0) return -EINVAL; - /* a null catmap is equivalent to an empty one */ - if (!catmap) { - *offset = (u32)-1; - return 0; - } - if (off < catmap->startbit) { off = catmap->startbit; *offset = off; diff -u linux-oem-4.15.0/net/rxrpc/rxkad.c linux-oem-4.15.0/net/rxrpc/rxkad.c --- linux-oem-4.15.0/net/rxrpc/rxkad.c +++ linux-oem-4.15.0/net/rxrpc/rxkad.c @@ -1111,7 +1111,7 @@ ret = rxkad_decrypt_ticket(conn, skb, ticket, ticket_len, &session_key, &expiry, _abort_code); if (ret < 0) - goto temporary_error_free_ticket; + goto temporary_error_free_resp; /* use the session key from inside the ticket to decrypt the * response */ @@ -1193,6 +1193,7 @@ temporary_error_free_ticket: kfree(ticket); +temporary_error_free_resp: kfree(response); temporary_error: /* Ignore the response packet if we got a temporary error such as reverted: --- linux-oem-4.15.0/net/sched/sch_choke.c +++ linux-oem-4.15.0.orig/net/sched/sch_choke.c @@ -327,8 +327,7 @@ sch->q.qlen = 0; sch->qstats.backlog = 0; + memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *)); - if (q->tab) - memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *)); q->head = q->tail = 0; red_restart(&q->vars); } diff -u linux-oem-4.15.0/net/sched/sch_fq_codel.c linux-oem-4.15.0/net/sched/sch_fq_codel.c --- linux-oem-4.15.0/net/sched/sch_fq_codel.c +++ linux-oem-4.15.0/net/sched/sch_fq_codel.c @@ -428,7 +428,7 @@ q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM])); if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]) - q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); + q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])); if (tb[TCA_FQ_CODEL_MEMORY_LIMIT]) q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT])); diff -u linux-oem-4.15.0/net/sched/sch_sfq.c linux-oem-4.15.0/net/sched/sch_sfq.c --- linux-oem-4.15.0/net/sched/sch_sfq.c +++ linux-oem-4.15.0/net/sched/sch_sfq.c @@ -641,15 +641,6 @@ if (ctl->divisor && (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536)) return -EINVAL; - - /* slot->allot is a short, make sure quantum is not too big. */ - if (ctl->quantum) { - unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum); - - if (scaled <= 0 || scaled > SHRT_MAX) - return -EINVAL; - } - if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max, ctl_v1->Wlog)) return -EINVAL; diff -u linux-oem-4.15.0/net/sctp/sm_make_chunk.c linux-oem-4.15.0/net/sctp/sm_make_chunk.c --- linux-oem-4.15.0/net/sctp/sm_make_chunk.c +++ linux-oem-4.15.0/net/sctp/sm_make_chunk.c @@ -863,11 +863,7 @@ struct sctp_chunk *retval; __u32 ctsn; - if (chunk && chunk->asoc) - ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map); - else - ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); - + ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); shut.cum_tsn_ack = htonl(ctsn); retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0, diff -u linux-oem-4.15.0/net/sctp/sm_statefuns.c linux-oem-4.15.0/net/sctp/sm_statefuns.c --- linux-oem-4.15.0/net/sctp/sm_statefuns.c +++ linux-oem-4.15.0/net/sctp/sm_statefuns.c @@ -1838,7 +1838,7 @@ */ sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, - SCTP_ST_CHUNK(0), repl, + SCTP_ST_CHUNK(0), NULL, commands); } else { sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, @@ -5418,7 +5418,7 @@ * in the Cumulative TSN Ack field the last sequential TSN it * has received from the peer. */ - reply = sctp_make_shutdown(asoc, arg); + reply = sctp_make_shutdown(asoc, NULL); if (!reply) goto nomem; @@ -6016,7 +6016,7 @@ disposition = SCTP_DISPOSITION_CONSUME; if (sctp_outq_is_empty(&asoc->outqueue)) { disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, - NULL, commands); + arg, commands); } return disposition; reverted: --- linux-oem-4.15.0/scripts/config +++ linux-oem-4.15.0.orig/scripts/config @@ -7,9 +7,6 @@ # If no prefix forced, use the default CONFIG_ CONFIG_="${CONFIG_-CONFIG_}" -# We use an uncommon delimiter for sed substitutions -SED_DELIM=$(echo -en "\001") - usage() { cat >&2 <"$tmpfile" - sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" # replace original file with the edited one mv "$tmpfile" "$infile" } reverted: --- linux-oem-4.15.0/scripts/decodecode +++ linux-oem-4.15.0.orig/scripts/decodecode @@ -107,7 +107,7 @@ faultline=`cat $T.dis | head -1 | cut -d":" -f2-` faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'` +cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" -cat $T.oo | sed -e "${faultlinenum}s/^\([^:]*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/" echo cat $T.aa cleanup reverted: --- linux-oem-4.15.0/scripts/gcc-plugins/Makefile +++ linux-oem-4.15.0.orig/scripts/gcc-plugins/Makefile @@ -10,7 +10,6 @@ HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable - HOST_EXTRACXXFLAGS += -Wno-format-diag export HOST_EXTRACXXFLAGS endif diff -u linux-oem-4.15.0/scripts/gcc-plugins/gcc-common.h linux-oem-4.15.0/scripts/gcc-plugins/gcc-common.h --- linux-oem-4.15.0/scripts/gcc-plugins/gcc-common.h +++ linux-oem-4.15.0/scripts/gcc-plugins/gcc-common.h @@ -35,9 +35,7 @@ #include "ggc.h" #include "timevar.h" -#if BUILDING_GCC_VERSION < 10000 #include "params.h" -#endif #if BUILDING_GCC_VERSION <= 4009 #include "pointer-set.h" @@ -843,7 +841,6 @@ return gimple_build_assign(lhs, subcode, op1, op2 PASS_MEM_STAT); } -#if BUILDING_GCC_VERSION < 10000 template <> template <> inline bool is_a_helper::test(const_gimple gs) @@ -857,7 +854,6 @@ { return gs->code == GIMPLE_RETURN; } -#endif static inline gasm *as_a_gasm(gimple stmt) { diff -u linux-oem-4.15.0/security/apparmor/apparmorfs.c linux-oem-4.15.0/security/apparmor/apparmorfs.c --- linux-oem-4.15.0/security/apparmor/apparmorfs.c +++ linux-oem-4.15.0/security/apparmor/apparmorfs.c @@ -427,7 +427,7 @@ */ error = aa_may_manage_policy(label, ns, mask); if (error) - goto end_section; + return error; data = aa_simple_write_to_buffer(buf, size, size, pos); error = PTR_ERR(data); @@ -435,7 +435,6 @@ error = aa_replace_profiles(ns, label, mask, data); aa_put_loaddata(data); } -end_section: end_current_label_crit_section(label); return error; diff -u linux-oem-4.15.0/security/integrity/evm/evm_crypto.c linux-oem-4.15.0/security/integrity/evm/evm_crypto.c --- linux-oem-4.15.0/security/integrity/evm/evm_crypto.c +++ linux-oem-4.15.0/security/integrity/evm/evm_crypto.c @@ -90,7 +90,7 @@ algo = evm_hash; } - if (IS_ERR_OR_NULL(*tfm)) { + if (*tfm == NULL) { mutex_lock(&mutex); if (*tfm) goto out; diff -u linux-oem-4.15.0/security/integrity/ima/ima_crypto.c linux-oem-4.15.0/security/integrity/ima/ima_crypto.c --- linux-oem-4.15.0/security/integrity/ima/ima_crypto.c +++ linux-oem-4.15.0/security/integrity/ima/ima_crypto.c @@ -415,7 +415,7 @@ loff_t i_size; int rc; struct file *f = file; - bool new_file_instance = false, modified_mode = false; + bool new_file_instance = false, modified_flags = false; /* * For consistency, fail file's opened with the O_DIRECT flag on @@ -435,13 +435,13 @@ f = dentry_open(&file->f_path, flags, file->f_cred); if (IS_ERR(f)) { /* - * Cannot open the file again, lets modify f_mode + * Cannot open the file again, lets modify f_flags * of original and continue */ pr_info_ratelimited("Unable to reopen file for reading.\n"); f = file; - f->f_mode |= FMODE_READ; - modified_mode = true; + f->f_flags |= FMODE_READ; + modified_flags = true; } else { new_file_instance = true; } @@ -459,8 +459,8 @@ out: if (new_file_instance) fput(f); - else if (modified_mode) - f->f_mode &= ~FMODE_READ; + else if (modified_flags) + f->f_flags &= ~FMODE_READ; return rc; } diff -u linux-oem-4.15.0/security/integrity/ima/ima_fs.c linux-oem-4.15.0/security/integrity/ima/ima_fs.c --- linux-oem-4.15.0/security/integrity/ima/ima_fs.c +++ linux-oem-4.15.0/security/integrity/ima/ima_fs.c @@ -340,7 +340,8 @@ integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL, "policy_update", "signed policy required", 1, 0); - result = -EACCES; + if (ima_appraise & IMA_APPRAISE_ENFORCE) + result = -EACCES; } else { result = ima_parse_add_rule(data); } diff -u linux-oem-4.15.0/sound/core/pcm_lib.c linux-oem-4.15.0/sound/core/pcm_lib.c --- linux-oem-4.15.0/sound/core/pcm_lib.c +++ linux-oem-4.15.0/sound/core/pcm_lib.c @@ -440,7 +440,6 @@ no_delta_check: if (runtime->status->hw_ptr == new_hw_ptr) { - runtime->hw_ptr_jiffies = curr_jiffies; update_audio_tstamp(substream, &curr_tstamp, &audio_tstamp); return 0; } diff -u linux-oem-4.15.0/sound/core/rawmidi.c linux-oem-4.15.0/sound/core/rawmidi.c --- linux-oem-4.15.0/sound/core/rawmidi.c +++ linux-oem-4.15.0/sound/core/rawmidi.c @@ -108,17 +108,6 @@ runtime->event(runtime->substream); } -/* buffer refcount management: call with runtime->lock held */ -static inline void snd_rawmidi_buffer_ref(struct snd_rawmidi_runtime *runtime) -{ - runtime->buffer_ref++; -} - -static inline void snd_rawmidi_buffer_unref(struct snd_rawmidi_runtime *runtime) -{ - runtime->buffer_ref--; -} - static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream) { struct snd_rawmidi_runtime *runtime; @@ -136,7 +125,7 @@ runtime->avail = 0; else runtime->avail = runtime->buffer_size; - if ((runtime->buffer = kzalloc(runtime->buffer_size, GFP_KERNEL)) == NULL) { + if ((runtime->buffer = kmalloc(runtime->buffer_size, GFP_KERNEL)) == NULL) { kfree(runtime); return -ENOMEM; } @@ -661,15 +650,10 @@ return -EINVAL; } if (params->buffer_size != runtime->buffer_size) { - newbuf = kzalloc(params->buffer_size, GFP_KERNEL); + newbuf = kmalloc(params->buffer_size, GFP_KERNEL); if (!newbuf) return -ENOMEM; spin_lock_irq(&runtime->lock); - if (runtime->buffer_ref) { - spin_unlock_irq(&runtime->lock); - kfree(newbuf); - return -EBUSY; - } oldbuf = runtime->buffer; runtime->buffer = newbuf; runtime->buffer_size = params->buffer_size; @@ -978,10 +962,8 @@ long result = 0, count1; struct snd_rawmidi_runtime *runtime = substream->runtime; unsigned long appl_ptr; - int err = 0; spin_lock_irqsave(&runtime->lock, flags); - snd_rawmidi_buffer_ref(runtime); while (count > 0 && runtime->avail) { count1 = runtime->buffer_size - runtime->appl_ptr; if (count1 > count) @@ -1000,19 +982,16 @@ if (userbuf) { spin_unlock_irqrestore(&runtime->lock, flags); if (copy_to_user(userbuf + result, - runtime->buffer + appl_ptr, count1)) - err = -EFAULT; + runtime->buffer + appl_ptr, count1)) { + return result > 0 ? result : -EFAULT; + } spin_lock_irqsave(&runtime->lock, flags); - if (err) - goto out; } result += count1; count -= count1; } - out: - snd_rawmidi_buffer_unref(runtime); spin_unlock_irqrestore(&runtime->lock, flags); - return result > 0 ? result : err; + return result; } long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream, @@ -1283,7 +1262,6 @@ return -EAGAIN; } } - snd_rawmidi_buffer_ref(runtime); while (count > 0 && runtime->avail > 0) { count1 = runtime->buffer_size - runtime->appl_ptr; if (count1 > count) @@ -1315,7 +1293,6 @@ } __end: count1 = runtime->avail < runtime->buffer_size; - snd_rawmidi_buffer_unref(runtime); spin_unlock_irqrestore(&runtime->lock, flags); if (count1) snd_rawmidi_output_trigger(substream, 1); diff -u linux-oem-4.15.0/sound/pci/hda/hda_intel.c linux-oem-4.15.0/sound/pci/hda/hda_intel.c --- linux-oem-4.15.0/sound/pci/hda/hda_intel.c +++ linux-oem-4.15.0/sound/pci/hda/hda_intel.c @@ -2171,10 +2171,9 @@ * some HD-audio PCI entries are exposed without any codecs, and such devices * should be ignored from the beginning. */ -static const struct pci_device_id driver_blacklist[] = { - { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */ - { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ - { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ +static const struct snd_pci_quirk driver_blacklist[] = { + SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0), + SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0), {} }; @@ -2197,7 +2196,7 @@ bool schedule_probe; int err; - if (pci_match_id(driver_blacklist, pci)) { + if (snd_pci_quirk_lookup(pci, driver_blacklist)) { dev_info(&pci->dev, "Skipping the blacklisted device\n"); return -ENODEV; } diff -u linux-oem-4.15.0/sound/pci/hda/patch_hdmi.c linux-oem-4.15.0/sound/pci/hda/patch_hdmi.c --- linux-oem-4.15.0/sound/pci/hda/patch_hdmi.c +++ linux-oem-4.15.0/sound/pci/hda/patch_hdmi.c @@ -2311,9 +2311,7 @@ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx); - struct hdmi_eld *pin_eld = &per_pin->sink_eld; - pin_eld->eld_valid = false; hdmi_present_sense(per_pin, 0); } diff -u linux-oem-4.15.0/sound/pci/hda/patch_realtek.c linux-oem-4.15.0/sound/pci/hda/patch_realtek.c --- linux-oem-4.15.0/sound/pci/hda/patch_realtek.c +++ linux-oem-4.15.0/sound/pci/hda/patch_realtek.c @@ -327,6 +327,8 @@ alc_update_coef_idx(codec, 0x4, 1<<15, 0); break; case 0x10ec0225: + codec->power_save_node = 1; + /* fall through */ case 0x10ec0295: case 0x10ec0299: alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); @@ -2440,7 +2442,6 @@ SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE), SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950), - SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), @@ -2456,9 +2457,6 @@ SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), - SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), - SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), - SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530), @@ -5608,15 +5606,6 @@ } } -static void alc225_fixup_s3_pop_noise(struct hda_codec *codec, - const struct hda_fixup *fix, int action) -{ - if (action != HDA_FIXUP_ACT_PRE_PROBE) - return; - - codec->power_save_node = 1; -} - /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ static void alc274_fixup_bind_dacs(struct hda_codec *codec, const struct hda_fixup *fix, int action) @@ -5697,7 +5686,6 @@ ALC269_FIXUP_HP_LINE1_MIC1_LED, ALC269_FIXUP_INV_DMIC, ALC269_FIXUP_LENOVO_DOCK, - ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, ALC269_FIXUP_NO_SHUTUP, ALC286_FIXUP_SONY_MIC_NO_PRESENCE, ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, @@ -5781,7 +5769,6 @@ ALC233_FIXUP_LENOVO_MULTI_CODECS, ALC294_FIXUP_LENOVO_MIC_LOCATION, ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, - ALC225_FIXUP_S3_POP_NOISE, ALC700_FIXUP_INTEL_REFERENCE, ALC274_FIXUP_DELL_BIND_DACS, ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, @@ -6006,12 +5993,6 @@ .chained = true, .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT }, - [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc269_fixup_limit_int_mic_boost, - .chained = true, - .chain_id = ALC269_FIXUP_LENOVO_DOCK, - }, [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = { .type = HDA_FIXUP_FUNC, .v.func = alc269_fixup_pincfg_no_hp_to_lineout, @@ -6646,12 +6627,6 @@ { } }, .chained = true, - .chain_id = ALC225_FIXUP_S3_POP_NOISE - }, - [ALC225_FIXUP_S3_POP_NOISE] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc225_fixup_s3_pop_noise, - .chained = true, .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC }, [ALC700_FIXUP_INTEL_REFERENCE] = { @@ -7056,7 +7031,7 @@ SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE), SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE), - SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST), + SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK), SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK), SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK), SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK), @@ -7193,7 +7168,6 @@ {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"}, {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"}, {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"}, - {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"}, {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"}, {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"}, {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"}, reverted: --- linux-oem-4.15.0/sound/pci/ice1712/ice1712.c +++ linux-oem-4.15.0.orig/sound/pci/ice1712/ice1712.c @@ -2377,8 +2377,7 @@ pci_write_config_byte(ice->pci, 0x61, ice->eeprom.data[ICE_EEP1_ACLINK]); pci_write_config_byte(ice->pci, 0x62, ice->eeprom.data[ICE_EEP1_I2SID]); pci_write_config_byte(ice->pci, 0x63, ice->eeprom.data[ICE_EEP1_SPDIF]); + if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24) { - if (ice->eeprom.subvendor != ICE1712_SUBDEVICE_STDSP24 && - ice->eeprom.subvendor != ICE1712_SUBDEVICE_STAUDIO_ADCIII) { ice->gpio.write_mask = ice->eeprom.gpiomask; ice->gpio.direction = ice->eeprom.gpiodir; snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, diff -u linux-oem-4.15.0/sound/soc/codecs/hdac_hdmi.c linux-oem-4.15.0/sound/soc/codecs/hdac_hdmi.c --- linux-oem-4.15.0/sound/soc/codecs/hdac_hdmi.c +++ linux-oem-4.15.0/sound/soc/codecs/hdac_hdmi.c @@ -142,14 +142,14 @@ hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi, struct hdac_hdmi_cvt *cvt) { - struct hdac_hdmi_pcm *pcm; + struct hdac_hdmi_pcm *pcm = NULL; list_for_each_entry(pcm, &hdmi->pcm_list, head) { if (pcm->cvt == cvt) - return pcm; + break; } - return NULL; + return pcm; } static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm, diff -u linux-oem-4.15.0/sound/soc/codecs/sgtl5000.c linux-oem-4.15.0/sound/soc/codecs/sgtl5000.c --- linux-oem-4.15.0/sound/soc/codecs/sgtl5000.c +++ linux-oem-4.15.0/sound/soc/codecs/sgtl5000.c @@ -1563,40 +1563,6 @@ dev_err(&client->dev, "Error %d initializing CHIP_CLK_CTRL\n", ret); - /* Mute everything to avoid pop from the following power-up */ - ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_CTRL, - SGTL5000_CHIP_ANA_CTRL_DEFAULT); - if (ret) { - dev_err(&client->dev, - "Error %d muting outputs via CHIP_ANA_CTRL\n", ret); - goto disable_clk; - } - - /* - * If VAG is powered-on (e.g. from previous boot), it would be disabled - * by the write to ANA_POWER in later steps of the probe code. This - * may create a loud pop even with all outputs muted. The proper way - * to circumvent this is disabling the bit first and waiting the proper - * cool-down time. - */ - ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, &value); - if (ret) { - dev_err(&client->dev, "Failed to read ANA_POWER: %d\n", ret); - goto disable_clk; - } - if (value & SGTL5000_VAG_POWERUP) { - ret = regmap_update_bits(sgtl5000->regmap, - SGTL5000_CHIP_ANA_POWER, - SGTL5000_VAG_POWERUP, - 0); - if (ret) { - dev_err(&client->dev, "Error %d disabling VAG\n", ret); - goto disable_clk; - } - - msleep(SGTL5000_VAG_POWERDOWN_DELAY); - } - /* Follow section 2.2.1.1 of AN3663 */ ana_pwr = SGTL5000_ANA_POWER_DEFAULT; if (sgtl5000->num_supplies <= VDDD) { reverted: --- linux-oem-4.15.0/sound/soc/codecs/sgtl5000.h +++ linux-oem-4.15.0.orig/sound/soc/codecs/sgtl5000.h @@ -236,7 +236,6 @@ /* * SGTL5000_CHIP_ANA_CTRL */ -#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133 #define SGTL5000_LINE_OUT_MUTE 0x0100 #define SGTL5000_HP_SEL_MASK 0x0040 #define SGTL5000_HP_SEL_SHIFT 6 diff -u linux-oem-4.15.0/sound/soc/sh/rcar/ssi.c linux-oem-4.15.0/sound/soc/sh/rcar/ssi.c --- linux-oem-4.15.0/sound/soc/sh/rcar/ssi.c +++ linux-oem-4.15.0/sound/soc/sh/rcar/ssi.c @@ -620,16 +620,10 @@ * Capture: It might not receave data. Do nothing */ if (rsnd_io_is_play(io)) { - rsnd_mod_write(mod, SSICR, cr | ssi->cr_en); + rsnd_mod_write(mod, SSICR, cr | EN); rsnd_ssi_status_check(mod, DIRQ); } - /* In multi-SSI mode, stop is performed by setting ssi0129 in - * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here. - */ - if (rsnd_ssi_multi_slaves_runtime(io)) - return 0; - /* * disable SSI, * and, wait idle state @@ -749,9 +743,6 @@ if (!rsnd_rdai_is_clk_master(rdai)) return; - if (rsnd_ssi_is_multi_slave(mod, io)) - return; - switch (rsnd_mod_id(mod)) { case 1: case 2: reverted: --- linux-oem-4.15.0/sound/soc/sh/rcar/ssiu.c +++ linux-oem-4.15.0.orig/sound/soc/sh/rcar/ssiu.c @@ -175,7 +175,7 @@ i; for_each_rsnd_mod_array(i, pos, io, rsnd_ssi_array) { + shift = (i * 4) + 16; - shift = (i * 4) + 20; val = (val & ~(0xF << shift)) | rsnd_mod_id(pos) << shift; } diff -u linux-oem-4.15.0/sound/soc/soc-topology.c linux-oem-4.15.0/sound/soc/soc-topology.c --- linux-oem-4.15.0/sound/soc/soc-topology.c +++ linux-oem-4.15.0/sound/soc/soc-topology.c @@ -1954,9 +1954,7 @@ _pcm = pcm; } else { abi_match = false; - ret = pcm_new_ver(tplg, pcm, &_pcm); - if (ret < 0) - return ret; + pcm_new_ver(tplg, pcm, &_pcm); } /* create the FE DAIs and DAI links */ diff -u linux-oem-4.15.0/sound/usb/quirks.c linux-oem-4.15.0/sound/usb/quirks.c --- linux-oem-4.15.0/sound/usb/quirks.c +++ linux-oem-4.15.0/sound/usb/quirks.c @@ -1323,14 +1323,13 @@ && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) mdelay(20); - /* Zoom R16/24, Logitech H650e, Jabra 550a, Kingston HyperX needs a tiny - * delay here, otherwise requests like get/set frequency return as - * failed despite actually succeeding. + /* Zoom R16/24, Logitech H650e, Jabra 550a needs a tiny delay here, + * otherwise requests like get/set frequency return as failed despite + * actually succeeding. */ if ((chip->usb_id == USB_ID(0x1686, 0x00dd) || chip->usb_id == USB_ID(0x046d, 0x0a46) || - chip->usb_id == USB_ID(0x0b0e, 0x0349) || - chip->usb_id == USB_ID(0x0951, 0x16ad)) && + chip->usb_id == USB_ID(0x0b0e, 0x0349)) && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) mdelay(1); } diff -u linux-oem-4.15.0/tools/objtool/check.c linux-oem-4.15.0/tools/objtool/check.c --- linux-oem-4.15.0/tools/objtool/check.c +++ linux-oem-4.15.0/tools/objtool/check.c @@ -1291,7 +1291,7 @@ struct cfi_reg *cfa = &state->cfa; struct stack_op *op = &insn->stack_op; - if (cfa->base != CFI_SP && cfa->base != CFI_SP_INDIRECT) + if (cfa->base != CFI_SP) return 0; /* push */ diff -u linux-oem-4.15.0/tools/testing/selftests/ipc/msgque.c linux-oem-4.15.0/tools/testing/selftests/ipc/msgque.c --- linux-oem-4.15.0/tools/testing/selftests/ipc/msgque.c +++ linux-oem-4.15.0/tools/testing/selftests/ipc/msgque.c @@ -137,7 +137,7 @@ for (kern_id = 0; kern_id < 256; kern_id++) { ret = msgctl(kern_id, MSG_STAT, &ds); if (ret < 0) { - if (errno == EINVAL) + if (errno == -EINVAL) continue; printf("Failed to get stats for IPC queue with id %d\n", kern_id); diff -u linux-oem-4.15.0/virt/kvm/arm/vgic/vgic-mmio.c linux-oem-4.15.0/virt/kvm/arm/vgic/vgic-mmio.c --- linux-oem-4.15.0/virt/kvm/arm/vgic/vgic-mmio.c +++ linux-oem-4.15.0/virt/kvm/arm/vgic/vgic-mmio.c @@ -249,7 +249,7 @@ static void vgic_change_active_prepare(struct kvm_vcpu *vcpu, u32 intid) { if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 || - intid >= VGIC_NR_PRIVATE_IRQS) + intid > VGIC_NR_PRIVATE_IRQS) kvm_arm_halt_guest(vcpu->kvm); } @@ -257,7 +257,7 @@ static void vgic_change_active_finish(struct kvm_vcpu *vcpu, u32 intid) { if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3 || - intid >= VGIC_NR_PRIVATE_IRQS) + intid > VGIC_NR_PRIVATE_IRQS) kvm_arm_resume_guest(vcpu->kvm); }