commit 6b3252287aa248cb49befa5de2a68fed6413c814
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sat Oct 20 09:47:10 2018 +0200

    Linux 4.18.16

commit 645ad2d5cccc4d52bd66f6132bd846211bdd6e48
Author: Alexey Brodkin <abrodkin@synopsys.com>
Date:   Sun Sep 16 23:47:57 2018 +0300

    ARC: build: Don't set CROSS_COMPILE in arch's Makefile
    
    commit 40660f1fcee8d524a60b5101538e42b1f39f106d upstream.
    
    There's not much sense in doing that because if user or
    his build-system didn't set CROSS_COMPILE we still may
    very well make incorrect guess.
    
    But as it turned out setting CROSS_COMPILE is not as harmless
    as one may think: with recent changes that implemented automatic
    discovery of __host__ gcc features unconditional setup of
    CROSS_COMPILE leads to failures on execution of "make xxx_defconfig"
    with absent cross-compiler, for more info see [1].
    
    Set CROSS_COMPILE as well gets in the way if we want only to build
    .dtb's (again with absent cross-compiler which is not really needed
    for building .dtb's), see [2].
    
    Note, we had to change LIBGCC assignment type from ":=" to "="
    so that is is resolved on its usage, otherwise if it is resolved
    at declaration time with missing CROSS_COMPILE we're getting this
    error message from host GCC:
    
    | gcc: error: unrecognized command line option -mmedium-calls
    | gcc: error: unrecognized command line option -mno-sdata
    
    [1] http://lists.infradead.org/pipermail/linux-snps-arc/2018-September/004308.html
    [2] http://lists.infradead.org/pipermail/linux-snps-arc/2018-September/004320.html
    
    Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
    Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    Cc: Rob Herring <robh@kernel.org>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit dfed0698a22e1ceb848b426ab08475a9b2e789f5
Author: Alexey Brodkin <abrodkin@synopsys.com>
Date:   Thu Sep 13 23:24:28 2018 +0300

    ARC: build: Get rid of toolchain check
    
    commit 615f64458ad890ef94abc879a66d8b27236e733a upstream.
    
    This check is very naive: we simply test if GCC invoked without
    "-mcpu=XXX" has ARC700 define set. In that case we think that GCC
    was built with "--with-cpu=arc700" and has libgcc built for ARC700.
    
    Otherwise if ARC700 is not defined we think that everythng was built
    for ARCv2.
    
    But in reality our life is much more interesting.
    
    1. Regardless of GCC configuration (i.e. what we pass in "--with-cpu"
       it may generate code for any ARC core).
    
    2. libgcc might be built with explicitly specified "--mcpu=YYY"
    
    That's exactly what happens in case of multilibbed toolchains:
     - GCC is configured with default settings
     - All the libs built for many different CPU flavors
    
    I.e. that check gets in the way of usage of multilibbed
    toolchains. And even non-multilibbed toolchains are affected.
    OpenEmbedded also builds GCC without "--with-cpu" because
    each and every target component later is compiled with explicitly
    set "-mcpu=ZZZ".
    
    Acked-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d80183541e6006563334eaec9e8d1dc6e40efeb7
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Fri Oct 12 15:22:59 2018 -0700

    mremap: properly flush TLB before releasing the page
    
    commit eb66ae030829605d61fbef1909ce310e29f78821 upstream.
    
    Jann Horn points out that our TLB flushing was subtly wrong for the
    mremap() case.  What makes mremap() special is that we don't follow the
    usual "add page to list of pages to be freed, then flush tlb, and then
    free pages".  No, mremap() obviously just _moves_ the page from one page
    table location to another.
    
    That matters, because mremap() thus doesn't directly control the
    lifetime of the moved page with a freelist: instead, the lifetime of the
    page is controlled by the page table locking, that serializes access to
    the entry.
    
    As a result, we need to flush the TLB not just before releasing the lock
    for the source location (to avoid any concurrent accesses to the entry),
    but also before we release the destination page table lock (to avoid the
    TLB being flushed after somebody else has already done something to that
    page).
    
    This also makes the whole "need_flush" logic unnecessary, since we now
    always end up flushing the TLB for every valid entry.
    
    Reported-and-tested-by: Jann Horn <jannh@google.com>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Tested-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 94d2da5ba1dd55c246757e58b7e74bbe45a5cc0a
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Oct 18 14:22:54 2018 +0200

    Revert "vfs: fix freeze protection in mnt_want_write_file() for overlayfs"
    
    This reverts commit 5e1002ab5c9bde81a0c1eed12f243987e98f7bd0 which was
    commit a6795a585929d94ca3e931bc8518f8deb8bbe627 upstream.
    
    Turns out this causes problems and was to fix a patch only in the 4.19
    and newer tree.
    
    Reported-by: Amir Goldstein <amir73il@gmail.com>
    Cc: Miklos Szeredi <mszeredi@redhat.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7fde798123ef4b4b3e9a3ba9c4a201ad764d77e9
Author: Kairui Song <kasong@redhat.com>
Date:   Thu Sep 27 20:38:45 2018 +0800

    x86/boot: Fix kexec booting failure in the SEV bit detection code
    
    [ Upstream commit bdec8d7fa55e6f5314ed72e5a0b435d90ff90548 ]
    
    Commit
    
      1958b5fc4010 ("x86/boot: Add early boot support when running with SEV active")
    
    can occasionally cause system resets when kexec-ing a second kernel even
    if SEV is not active.
    
    That's because get_sev_encryption_bit() uses 32-bit rIP-relative
    addressing to read the value of enc_bit - a variable which caches a
    previously detected encryption bit position - but kexec may allocate
    the early boot code to a higher location, beyond the 32-bit addressing
    limit.
    
    In this case, garbage will be read and get_sev_encryption_bit() will
    return the wrong value, leading to accessing memory with the wrong
    encryption setting.
    
    Therefore, remove enc_bit, and thus get rid of the need to do 32-bit
    rIP-relative addressing in the first place.
    
     [ bp: massage commit message heavily. ]
    
    Fixes: 1958b5fc4010 ("x86/boot: Add early boot support when running with SEV active")
    Suggested-by: Borislav Petkov <bp@suse.de>
    Signed-off-by: Kairui Song <kasong@redhat.com>
    Signed-off-by: Borislav Petkov <bp@suse.de>
    Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
    Cc: linux-kernel@vger.kernel.org
    Cc: tglx@linutronix.de
    Cc: mingo@redhat.com
    Cc: hpa@zytor.com
    Cc: brijesh.singh@amd.com
    Cc: kexec@lists.infradead.org
    Cc: dyoung@redhat.com
    Cc: bhe@redhat.com
    Cc: ghook@redhat.com
    Link: https://lkml.kernel.org/r/20180927123845.32052-1-kasong@redhat.com
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 44e564aa4525e70ca52255438e2ffe1fd7e6e4b8
Author: Arindam Nath <arindam.nath@amd.com>
Date:   Tue Sep 18 15:40:58 2018 +0530

    iommu/amd: Return devid as alias for ACPI HID devices
    
    [ Upstream commit 5ebb1bc2d63d90dd204169e21fd7a0b4bb8c776e ]
    
    ACPI HID devices do not actually have an alias for
    them in the IVRS. But dev_data->alias is still used
    for indexing into the IOMMU device table for devices
    being handled by the IOMMU. So for ACPI HID devices,
    we simply return the corresponding devid as an alias,
    as parsed from IVRS table.
    
    Signed-off-by: Arindam Nath <arindam.nath@amd.com>
    Fixes: 2bf9a0a12749 ('iommu/amd: Add iommu support for ACPI HID devices')
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0e963ecefb72163771f9084c1b4f2fa3d97c48e6
Author: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Date:   Tue Sep 25 17:55:15 2018 +0530

    powerpc/numa: Use associativity if VPHN hcall is successful
    
    [ Upstream commit 2483ef056f6e42f61cd266452e2841165dfe1b5c ]
    
    Currently associativity is used to lookup node-id even if the
    preceding VPHN hcall failed. However this can cause CPU to be made
    part of the wrong node, (most likely to be node 0). This is because
    VPHN is not enabled on KVM guests.
    
    With 2ea6263 ("powerpc/topology: Get topology for shared processors at
    boot"), associativity is used to set to the wrong node. Hence KVM
    guest topology is broken.
    
    For example : A 4 node KVM guest before would have reported.
    
      [root@localhost ~]#  numactl -H
      available: 4 nodes (0-3)
      node 0 cpus: 0 1 2 3
      node 0 size: 1746 MB
      node 0 free: 1604 MB
      node 1 cpus: 4 5 6 7
      node 1 size: 2044 MB
      node 1 free: 1765 MB
      node 2 cpus: 8 9 10 11
      node 2 size: 2044 MB
      node 2 free: 1837 MB
      node 3 cpus: 12 13 14 15
      node 3 size: 2044 MB
      node 3 free: 1903 MB
      node distances:
      node   0   1   2   3
        0:  10  40  40  40
        1:  40  10  40  40
        2:  40  40  10  40
        3:  40  40  40  10
    
    Would now report:
    
      [root@localhost ~]# numactl -H
      available: 4 nodes (0-3)
      node 0 cpus: 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15
      node 0 size: 1746 MB
      node 0 free: 1244 MB
      node 1 cpus:
      node 1 size: 2044 MB
      node 1 free: 2032 MB
      node 2 cpus: 1
      node 2 size: 2044 MB
      node 2 free: 2028 MB
      node 3 cpus:
      node 3 size: 2044 MB
      node 3 free: 2032 MB
      node distances:
      node   0   1   2   3
        0:  10  40  40  40
        1:  40  10  40  40
        2:  40  40  10  40
        3:  40  40  40  10
    
    Fix this by skipping associativity lookup if the VPHN hcall failed.
    
    Fixes: 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot")
    Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4a079f0a5398664e860dc1de4044f5b8cce1fa4a
Author: Michael Neuling <mikey@neuling.org>
Date:   Tue Sep 25 19:36:47 2018 +1000

    powerpc/tm: Avoid possible userspace r1 corruption on reclaim
    
    [ Upstream commit 96dc89d526ef77604376f06220e3d2931a0bfd58 ]
    
    Current we store the userspace r1 to PACATMSCRATCH before finally
    saving it to the thread struct.
    
    In theory an exception could be taken here (like a machine check or
    SLB miss) that could write PACATMSCRATCH and hence corrupt the
    userspace r1. The SLB fault currently doesn't touch PACATMSCRATCH, but
    others do.
    
    We've never actually seen this happen but it's theoretically
    possible. Either way, the code is fragile as it is.
    
    This patch saves r1 to the kernel stack (which can't fault) before we
    turn MSR[RI] back on. PACATMSCRATCH is still used but only with
    MSR[RI] off. We then copy r1 from the kernel stack to the thread
    struct once we have MSR[RI] back on.
    
    Suggested-by: Breno Leitao <leitao@debian.org>
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8725b910e72defbd96f068589f7eec560bb6c707
Author: Michael Neuling <mikey@neuling.org>
Date:   Mon Sep 24 17:27:04 2018 +1000

    powerpc/tm: Fix userspace r13 corruption
    
    [ Upstream commit cf13435b730a502e814c63c84d93db131e563f5f ]
    
    When we treclaim we store the userspace checkpointed r13 to a scratch
    SPR and then later save the scratch SPR to the user thread struct.
    
    Unfortunately, this doesn't work as accessing the user thread struct
    can take an SLB fault and the SLB fault handler will write the same
    scratch SPRG that now contains the userspace r13.
    
    To fix this, we store r13 to the kernel stack (which can't fault)
    before we access the user thread struct.
    
    Found by running P8 guest + powervm + disable_1tb_segments + TM. Seen
    as a random userspace segfault with r13 looking like a kernel address.
    
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Reviewed-by: Breno Leitao <leitao@debian.org>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b0b9016005506446128e68db4df6ee8d4aef6544
Author: Daniel Kurtz <djkurtz@chromium.org>
Date:   Sat Sep 22 13:58:26 2018 -0600

    pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type
    
    [ Upstream commit b85bfa246efd24ea3fdb5ee949c28e3110c6d299 ]
    
    >From the AMD BKDG, if WAKE_INT_MASTER_REG.MaskStsEn is set, a software
    write to the debounce registers of *any* gpio will block wake/interrupt
    status generation for *all* gpios for a length of time that depends on
    WAKE_INT_MASTER_REG.MaskStsLength[11:0].  During this period the Interrupt
    Delivery bit (INTERRUPT_ENABLE) will read as 0.
    
    In commit 4c1de0414a1340 ("pinctrl/amd: poll InterruptEnable bits in
    enable_irq") we tried to fix this same "gpio Interrupts are blocked
    immediately after writing debounce registers" problem, but incorrectly
    assumed it only affected the gpio whose debounce was being configured
    and not ALL gpios.
    
    To solve this for all gpios, we move the polling loop from
    amd_gpio_irq_enable() to amd_gpio_irq_set_type(), while holding the gpio
    spinlock.  This ensures that another gpio operation (e.g.
    amd_gpio_irq_unmask()) can read a temporarily disabled IRQ and
    incorrectly disable it while trying to modify some other register bits.
    
    Fixes: 4c1de0414a1340 pinctrl/amd: poll InterruptEnable bits in enable_irq
    Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0fe04d27b5e34bc5c296cf98b5c1bb513f622cda
Author: Heiko Stuebner <heiko@sntech.de>
Date:   Mon Aug 27 12:56:24 2018 +0200

    iommu/rockchip: Free irqs in shutdown handler
    
    [ Upstream commit 74bc2abca7603c956d1e331e8b9bee7b874c1eec ]
    
    In the iommu's shutdown handler we disable runtime-pm which could
    result in the irq-handler running unclocked and since commit
        3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework")
    we warn about that fact.
    
    This can cause warnings on shutdown on some Rockchip machines, so
    free the irqs in the shutdown handler before we disable runtime-pm.
    
    Reported-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
    Fixes: 3fc7c5c0cff3 ("iommu/rockchip: Handle errors returned from PM framework")
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
    Acked-by: Marc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1e23af485f89da3bd5be0eb6ac9bff0927f411fe
Author: James Cowgill <jcowgill@debian.org>
Date:   Thu Sep 6 22:57:56 2018 +0100

    RISC-V: include linux/ftrace.h in asm-prototypes.h
    
    [ Upstream commit 57a489786de9ec37d6e25ef1305dc337047f0236 ]
    
    Building a riscv kernel with CONFIG_FUNCTION_TRACER and
    CONFIG_MODVERSIONS enabled results in these two warnings:
    
      MODPOST vmlinux.o
    WARNING: EXPORT symbol "return_to_handler" [vmlinux] version generation failed, symbol will not be versioned.
    WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned.
    
    When exporting symbols from an assembly file, the MODVERSIONS code
    requires their prototypes to be defined in asm-prototypes.h (see
    scripts/Makefile.build). Since both of these symbols have prototypes
    defined in linux/ftrace.h, include this header from RISC-V's
    asm-prototypes.h.
    
    Reported-by: Karsten Merker <merker@debian.org>
    Signed-off-by: James Cowgill <jcowgill@debian.org>
    Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 086906d90bae0fa214e9043b47d7ed1d0be92d38
Author: Selvin Xavier <selvin.xavier@broadcom.com>
Date:   Thu Sep 20 22:33:00 2018 -0700

    RDMA/bnxt_re: Fix system crash during RDMA resource initialization
    
    [ Upstream commit de5c95d0f518537f59ee5aef762abc46f868c377 ]
    
    bnxt_re_ib_reg acquires and releases the rtnl lock whenever it accesses
    the L2 driver.
    
    The following sequence can trigger a crash
    
    Acquires the rtnl_lock ->
            Registers roce driver callback with L2 driver ->
                    release the rtnl lock
    bnxt_re acquires the rtnl_lock ->
            Request for MSIx vectors ->
                    release the rtnl_lock
    
    Issue happens when bnxt_re proceeds with remaining part of initialization
    and L2 driver invokes bnxt_ulp_irq_stop as a part of bnxt_open_nic.
    
    The crash is in bnxt_qplib_nq_stop_irq as the NQ structures are
    not initialized yet,
    
    <snip>
    [ 3551.726647] BUG: unable to handle kernel NULL pointer dereference at (null)
    [ 3551.726656] IP: [<ffffffffc0840ee9>] bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re]
    [ 3551.726674] PGD 0
    [ 3551.726679] Oops: 0002 1 SMP
    ...
    [ 3551.726822] Hardware name: Dell Inc. PowerEdge R720/08RW36, BIOS 2.4.3 07/09/2014
    [ 3551.726826] task: ffff97e30eec5ee0 ti: ffff97e3173bc000 task.ti: ffff97e3173bc000
    [ 3551.726829] RIP: 0010:[<ffffffffc0840ee9>] [<ffffffffc0840ee9>]
    bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re]
    ...
    [ 3551.726872] Call Trace:
    [ 3551.726886] [<ffffffffc082cb9e>] bnxt_re_stop_irq+0x4e/0x70 [bnxt_re]
    [ 3551.726899] [<ffffffffc07d6a53>] bnxt_ulp_irq_stop+0x43/0x70 [bnxt_en]
    [ 3551.726908] [<ffffffffc07c82f4>] bnxt_reserve_rings+0x174/0x1e0 [bnxt_en]
    [ 3551.726917] [<ffffffffc07cafd8>] __bnxt_open_nic+0x368/0x9a0 [bnxt_en]
    [ 3551.726925] [<ffffffffc07cb62b>] bnxt_open_nic+0x1b/0x50 [bnxt_en]
    [ 3551.726934] [<ffffffffc07cc62f>] bnxt_setup_mq_tc+0x11f/0x260 [bnxt_en]
    [ 3551.726943] [<ffffffffc07d5f58>] bnxt_dcbnl_ieee_setets+0xb8/0x1f0 [bnxt_en]
    [ 3551.726954] [<ffffffff890f983a>] dcbnl_ieee_set+0x9a/0x250
    [ 3551.726966] [<ffffffff88fd6d21>] ? __alloc_skb+0xa1/0x2d0
    [ 3551.726972] [<ffffffff890f72fa>] dcb_doit+0x13a/0x210
    [ 3551.726981] [<ffffffff89003ff7>] rtnetlink_rcv_msg+0xa7/0x260
    [ 3551.726989] [<ffffffff88ffdb00>] ? rtnl_unicast+0x20/0x30
    [ 3551.726996] [<ffffffff88bf9dc8>] ? __kmalloc_node_track_caller+0x58/0x290
    [ 3551.727002] [<ffffffff890f7326>] ? dcb_doit+0x166/0x210
    [ 3551.727007] [<ffffffff88fd6d0d>] ? __alloc_skb+0x8d/0x2d0
    [ 3551.727012] [<ffffffff89003f50>] ? rtnl_newlink+0x880/0x880
    ...
    [ 3551.727104] [<ffffffff8911f7d5>] system_call_fastpath+0x1c/0x21
    ...
    [ 3551.727164] RIP [<ffffffffc0840ee9>] bnxt_qplib_nq_stop_irq+0x59/0xb0 [bnxt_re]
    [ 3551.727175] RSP <ffff97e3173bf788>
    [ 3551.727177] CR2: 0000000000000000
    
    Avoid this inconsistent state and  system crash by acquiring
    the rtnl lock for the entire duration of device initialization.
    Re-factor the code to remove the rtnl lock from the individual function
    and acquire and release it from the caller.
    
    Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
    Fixes: 6e04b1035689 ("RDMA/bnxt_re: Fix broken RoCE driver due to recent L2 driver changes")
    Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 87e75317fe81e2bc24ea5a2b59bc0237f80dc242
Author: Tao Ren <taoren@fb.com>
Date:   Wed Sep 19 15:13:31 2018 -0700

    clocksource/drivers/fttmr010: Fix set_next_event handler
    
    [ Upstream commit 4451d3f59f2a6f95e5d205c2d04ea072955d080d ]
    
    Currently, the aspeed MATCH1 register is updated to <current_count -
    cycles> in set_next_event handler, with the assumption that COUNT
    register value is preserved when the timer is disabled and it continues
    decrementing after the timer is enabled. But the assumption is wrong:
    RELOAD register is loaded into COUNT register when the aspeed timer is
    enabled, which means the next event may be delayed because timer
    interrupt won't be generated until <0xFFFFFFFF - current_count +
    cycles>.
    
    The problem can be fixed by updating RELOAD register to <cycles>, and
    COUNT register will be re-loaded when the timer is enabled and interrupt
    is generated when COUNT register overflows.
    
    The test result on Facebook Backpack-CMM BMC hardware (AST2500) shows
    the issue is fixed: without the patch, usleep(100) suspends the process
    for several milliseconds (and sometimes even over 40 milliseconds);
    after applying the fix, usleep(100) takes averagely 240 microseconds to
    return under the same workload level.
    
    Signed-off-by: Tao Ren <taoren@fb.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Tested-by: Lei YU <mine260309@gmail.com>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 323ad743618496c0da45ffeb3d28a461a3a05b9b
Author: Nathan Chancellor <natechancellor@gmail.com>
Date:   Fri Sep 21 02:44:12 2018 -0700

    net/mlx4: Use cpumask_available for eq->affinity_mask
    
    [ Upstream commit 8ac1ee6f4d62e781e3b3fd8b9c42b70371427669 ]
    
    Clang warns that the address of a pointer will always evaluated as true
    in a boolean context:
    
    drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of
    array 'eq->affinity_mask' will always evaluate to 'true'
    [-Wpointer-bool-conversion]
            if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask))
                ~~~~~^~~~~~~~~~~~~
    1 warning generated.
    
    Use cpumask_available, introduced in commit f7e30f01a9e2 ("cpumask: Add
    helper cpumask_available()"), which does the proper checking and avoids
    this warning.
    
    Link: https://github.com/ClangBuiltLinux/linux/issues/86
    Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bcb2acdf27b3844439bb252cb49e6ac422236993
Author: John Fastabend <john.fastabend@gmail.com>
Date:   Tue Sep 18 09:01:54 2018 -0700

    bpf: test_maps, only support ESTABLISHED socks
    
    [ Upstream commit 5028027844cfc6168e39650abecd817ba64c9d98 ]
    
    Ensure that sockets added to a sock{map|hash} that is not in the
    ESTABLISHED state is rejected.
    
    Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks")
    Signed-off-by: John Fastabend <john.fastabend@gmail.com>
    Acked-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 19e43942cbb7d8721c926ecbce49b72e34a46944
Author: John Fastabend <john.fastabend@gmail.com>
Date:   Tue Sep 18 09:01:49 2018 -0700

    bpf: sockmap, fix transition through disconnect without close
    
    [ Upstream commit b05545e15e1ff1d6a6a8593971275f9cc3e6b92b ]
    
    It is possible (via shutdown()) for TCP socks to go trough TCP_CLOSE
    state via tcp_disconnect() without actually calling tcp_close which
    would then call our bpf_tcp_close() callback. Because of this a user
    could disconnect a socket then put it in a LISTEN state which would
    break our assumptions about sockets always being ESTABLISHED state.
    
    To resolve this rely on the unhash hook, which is called in the
    disconnect case, to remove the sock from the sockmap.
    
    Reported-by: Eric Dumazet <edumazet@google.com>
    Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks")
    Signed-off-by: John Fastabend <john.fastabend@gmail.com>
    Acked-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 60c302b7aea508917611e6eb47c1bb1eba36fb5c
Author: John Fastabend <john.fastabend@gmail.com>
Date:   Tue Sep 18 09:01:44 2018 -0700

    bpf: sockmap only allow ESTABLISHED sock state
    
    [ Upstream commit 5607fff303636d48b88414c6be353d9fed700af2 ]
    
    After this patch we only allow socks that are in ESTABLISHED state or
    are being added via a sock_ops event that is transitioning into an
    ESTABLISHED state. By allowing sock_ops events we allow users to
    manage sockmaps directly from sock ops programs. The two supported
    sock_ops ops are BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB and
    BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB.
    
    Similar to TLS ULP this ensures sk_user_data is correct.
    
    Reported-by: Eric Dumazet <edumazet@google.com>
    Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks")
    Signed-off-by: John Fastabend <john.fastabend@gmail.com>
    Acked-by: Yonghong Song <yhs@fb.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 019a15f9bd4495a1700d41ed6ff6d993cbe22f3a
Author: Johannes Thumshirn <jthumshirn@suse.de>
Date:   Fri Sep 21 09:01:01 2018 +0200

    scsi: sd: don't crash the host on invalid commands
    
    [ Upstream commit f1f1fadacaf08b7cf11714c0c29f8fa4d4ef68a9 ]
    
    When sd_init_command() get's a command with a unknown req_op() it crashes the
    system via BUG().
    
    This makes debugging the actual reason for the broken request cmd_flags pretty
    hard as the system is down before it's able to write out debugging data on the
    serial console or the trace buffer.
    
    Change the BUG() to a WARN_ON() and return BLKPREP_KILL to fail gracefully and
    return an I/O error to the producer of the request.
    
    Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
    Cc: Hannes Reinecke <hare@suse.de>
    Cc: Bart Van Assche <bvanassche@acm.org>
    Cc: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6dba1e338b6e9db4dbab4ccfd0083a3de3ee77ae
Author: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Date:   Thu Sep 20 19:32:12 2018 -0500

    scsi: ipr: System hung while dlpar adding primary ipr adapter back
    
    [ Upstream commit 318ddb34b2052f838aa243d07173e2badf3e630e ]
    
    While dlpar adding primary ipr adapter back, driver goes through adapter
    initialization then schedule ipr_worker_thread to start te disk scan by
    dropping the host lock, calling scsi_add_device.  Then get the adapter reset
    request again, so driver does scsi_block_requests, this will cause the
    scsi_add_device get hung until we unblock. But we can't run ipr_worker_thread
    to do the unblock because its stuck in scsi_add_device.
    
    This patch fixes the issue.
    
    [mkp: typo and whitespace fixes]
    
    Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
    Acked-by: Brian King <brking@linux.vnet.ibm.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ce32caf41e5397042efd5404ab6b5e3b08dc5eb6
Author: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Date:   Mon Jul 16 11:07:07 2018 +0100

    drm: mali-dp: Call drm_crtc_vblank_reset on device init
    
    [ Upstream commit 69be1984ded00a11b1ed0888c6d8e4f35370372f ]
    
    Currently, if userspace calls drm_wait_vblank before the crtc is
    activated the crtc vblank_enable hook is called, which in case of
    malidp driver triggers some warninngs. This happens because on
    device init we don't inform the drm core about the vblank state
    by calling drm_crtc_vblank_on/off/reset which together with
    drm_vblank_get have some magic that prevents calling drm_vblank_enable
    when crtc is off.
    
    Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
    Acked-by: Liviu Dudau <liviu.dudau@arm.com>
    Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit fab5471586f47fc5f57b1f6e55be8da84e7f45d3
Author: James Smart <jsmart2021@gmail.com>
Date:   Thu Sep 13 15:41:10 2018 -0700

    scsi: lpfc: Synchronize access to remoteport via rport
    
    [ Upstream commit 9e210178267b80c4eeb832fade7e146a18c84915 ]
    
    The driver currently uses the ndlp to get the local rport which is then used
    to get the nvme transport remoteport pointer. There can be cases where a stale
    remoteport pointer is obtained as synchronization isn't done through the
    different dereferences.
    
    Correct by using locks to synchronize the dereferences.
    
    Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7dc74b2622c2aaa550fb2d0175a4fe4ce4035282
Author: Majd Dibbiny <majd@mellanox.com>
Date:   Tue Sep 18 10:51:37 2018 +0300

    RDMA/uverbs: Fix validity check for modify QP
    
    [ Upstream commit 4eeed3686981ff887bbdd7254139e2eca276534c ]
    
    Uverbs shouldn't enforce QP state in the command unless the user set the QP
    state bit in the attribute mask.
    
    In addition, only copy qp attr fields which have the corresponding bit set
    in the attribute mask over to the internal attr structure.
    
    Fixes: 88de869bbe4f ("RDMA/uverbs: Ensure validity of current QP state value")
    Fixes: bc38a6abdd5a ("[PATCH] IB uverbs: core implementation")
    Signed-off-by: Majd Dibbiny <majd@mellanox.com>
    Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2c93f6f118adb99dc613ff4e4d33c5226289ca90
Author: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Date:   Thu Sep 20 16:32:52 2018 -0500

    PCI: dwc: Fix scheduling while atomic issues
    
    [ Upstream commit 9024143e700f89d74b8cdaf316a3499d74fc56fe ]
    
    When programming the inbound/outbound ATUs, we call usleep_range() after
    each checking PCIE_ATU_ENABLE bit. Unfortunately, the ATU programming
    can be executed in atomic context:
    
    inbound ATU programming could be called through
    pci_epc_write_header()
      =>dw_pcie_ep_write_header()
        =>dw_pcie_prog_inbound_atu()
    
    outbound ATU programming could be called through
    pci_bus_read_config_dword()
      =>dw_pcie_rd_conf()
        =>dw_pcie_prog_outbound_atu()
    
    Fix this issue by calling mdelay() instead.
    
    Fixes: f8aed6ec624f ("PCI: dwc: designware: Add EP mode support")
    Fixes: d8bbeb39fbf3 ("PCI: designware: Wait for iATU enable")
    Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
    [lorenzo.pieralisi@arm.com: commit log update]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1093a05b582887d2318c9a11ea9e8737d8d0fca5
Author: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date:   Wed Sep 19 21:59:11 2018 -0700

    qed: Do not add VLAN 0 tag to untagged frames in multi-function mode.
    
    [ Upstream commit 0216da9413afa546627a1b0d319dfd17fef34050 ]
    
    In certain multi-function switch dependent modes, firmware adds vlan tag 0
    to the untagged frames. This leads to double tagging for the traffic
    if the dcbx is enabled, which is not the desired behavior. To avoid this,
    driver needs to set "dcb_dont_add_vlan0" flag.
    
    Fixes: cac6f691 ("qed: Add support for Unified Fabric Port")
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c23f22169cac6850085c7fb360cebf9a48e32603
Author: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date:   Wed Sep 19 21:59:10 2018 -0700

    qed: Fix populating the invalid stag value in multi function mode.
    
    [ Upstream commit 50fdf60181b01b7383b85d4b9acbb842263d96a2 ]
    
    In multi-function mode, driver receives the stag value (outer vlan)
    for a PF from management FW (MFW). If the stag value is negotiated prior to
    the driver load, then the stag is not notified to the driver and hence
    driver will have the invalid stag value.
    The fix is to request the MFW for STAG value during the driver load time.
    
    Fixes: cac6f691 ("qed: Add support for Unified Fabric Port")
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 9bdac39234d00718cd17a0cceee5d417b3ab2107
Author: YueHaibing <yuehaibing@huawei.com>
Date:   Tue Sep 18 15:46:38 2018 +0200

    net/smc: fix sizeof to int comparison
    
    [ Upstream commit 381897798a94065ffcad0772eecdc6b04a7ff23d ]
    
    Comparing an int to a size, which is unsigned, causes the int to become
    unsigned, giving the wrong result. kernel_sendmsg can return a negative
    error code.
    
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4b238ea05476f335f865712745fa7e33e9a7711f
Author: Ursula Braun <ubraun@linux.ibm.com>
Date:   Tue Sep 18 15:46:34 2018 +0200

    net/smc: fix non-blocking connect problem
    
    [ Upstream commit 648a5a7aed346c3b8fe7c32a835edfb0dfbf4451 ]
    
    In state SMC_INIT smc_poll() delegates polling to the internal
    CLC socket. This means, once the connect worker has finished
    its kernel_connect() step, the poll wake-up may occur. This is not
    intended. The wake-up should occur from the wake up call in
    smc_connect_work() after __smc_connect() has finished.
    Thus in state SMC_INIT this patch now calls sock_poll_wait() on the
    main SMC socket.
    
    Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6b7d727a2d185a6197bdf413ff6369e3ba2b0d0b
Author: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Date:   Tue Sep 18 12:22:26 2018 +0200

    ravb: do not write 1 to reserved bits
    
    [ Upstream commit 2fe397a3959de8a472f165e6d152f64cb77fa2cc ]
    
    EtherAVB hardware requires 0 to be written to status register bits in
    order to clear them, however, care must be taken not to:
    
    1. Clear other bits, by writing zero to them
    2. Write one to reserved bits
    
    This patch corrects the ravb driver with respect to the second point above.
    This is done by defining reserved bit masks for the affected registers and,
    after auditing the code, ensure all sites that may write a one to a
    reserved bit use are suitably masked.
    
    Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
    Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 14bbe1ab20acb74bf197a8e1f4a9f6fd7a1b4c3e
Author: Christian Lamparter <chunkeey@gmail.com>
Date:   Mon Sep 17 17:22:40 2018 +0200

    net: emac: fix fixed-link setup for the RTL8363SB switch
    
    [ Upstream commit 08e39982ef64f800fd1f9b9b92968d14d5fafa82 ]
    
    On the Netgear WNDAP620, the emac ethernet isn't receiving nor
    xmitting any frames from/to the RTL8363SB (identifies itself
    as a RTL8367RB).
    
    This is caused by the emac hardware not knowing the forced link
    parameters for speed, duplex, pause, etc.
    
    This begs the question, how this was working on the original
    driver code, when it was necessary to set the phy_address and
    phy_map to 0xffffffff. But I guess without access to the old
    PPC405/440/460 hardware, it's not possible to know.
    
    Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 66acb86c090592eae29ffbec5aa8636411914dbf
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Mon Sep 17 15:30:06 2018 +0200

    selftests: pmtu: properly redirect stderr to /dev/null
    
    [ Upstream commit 0a286afee5a1e8dca86d824209dbd3200294f86f ]
    
    The cleanup function uses "$CMD 2 > /dev/null", which doesn't actually
    send stderr to /dev/null, so when the netns doesn't exist, the error
    message is shown. Use "2> /dev/null" instead, so that those messages
    disappear, as was intended.
    
    Fixes: d1f1b9cbf34c ("selftests: net: Introduce first PMTU test")
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
    Acked-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6a08cbb10aac20eb9ccc831407dafdd1fa4035c0
Author: Michael Schmitz <schmitzmic@gmail.com>
Date:   Mon Sep 17 15:27:49 2018 -0700

    Input: atakbd - fix Atari CapsLock behaviour
    
    [ Upstream commit 52d2c7bf7c90217fbe875d2d76f310979c48eb83 ]
    
    The CapsLock key on Atari keyboards is not a toggle, it does send the
    normal make and break scancodes.
    
    Drop the CapsLock toggle handling code, which did cause the CapsLock
    key to merely act as a Shift key.
    
    Tested-by: Michael Schmitz <schmitzmic@gmail.com>
    Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
    Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ef17628c07daf45474f50d87d1eec4380b314a46
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Mon Sep 17 12:43:34 2018 -0700

    Input: atakbd - fix Atari keymap
    
    [ Upstream commit 9e62df51be993035c577371ffee5477697a56aad ]
    
    Fix errors in Atari keymap (mostly in keypad, help and undo keys).
    
    Patch provided on debian-68k ML by Andreas Schwab <schwab@linux-m68k.org>,
    keymap array size and unhandled scancode limit adjusted to 0x73 by me.
    
    Tested-by: Michael Schmitz <schmitzmic@gmail.com>
    Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
    Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 462809659a397f708b39c677bd97c34878b93dd9
Author: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Date:   Tue Sep 18 16:10:49 2018 +0300

    intel_th: pci: Add Ice Lake PCH support
    
    [ Upstream commit 59d08d00d43c644ee2011d7ff1807bdd69f31fe0 ]
    
    This adds Intel(R) Trace Hub PCI ID for Ice Lake PCH.
    
    Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ee43eeb4d1b96b40bcfaddb0e522367e96ff5ce6
Author: Laura Abbott <labbott@redhat.com>
Date:   Tue Sep 11 12:22:26 2018 -0700

    scsi: ibmvscsis: Ensure partition name is properly NUL terminated
    
    [ Upstream commit adad633af7b970bfa5dd1b624a4afc83cac9b235 ]
    
    While reviewing another part of the code, Kees noticed that the strncpy of the
    partition name might not always be NUL terminated. Switch to using strscpy
    which does this safely.
    
    Reported-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Laura Abbott <labbott@redhat.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 10ad9dcade4b5e7d7e49fab5a4aab21d47620e70
Author: Laura Abbott <labbott@redhat.com>
Date:   Tue Sep 11 12:22:25 2018 -0700

    scsi: ibmvscsis: Fix a stringop-overflow warning
    
    [ Upstream commit d792d4c4fc866ae224b0b0ca2aabd87d23b4d6cc ]
    
    There's currently a warning about string overflow with strncat:
    
    drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_probe':
    drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3479:2: error: 'strncat' specified
    bound 64 equals destination size [-Werror=stringop-overflow=]
      strncat(vscsi->eye, vdev->name, MAX_EYE);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Switch to a single snprintf instead of a strcpy + strcat to handle this
    cleanly.
    
    Signed-off-by: Laura Abbott <labbott@redhat.com>
    Suggested-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit bb59249268cf94712686417fac1f253c7878a78c
Author: Keerthy <j-keerthy@ti.com>
Date:   Wed Aug 8 18:44:59 2018 +0530

    clocksource/drivers/ti-32k: Add CLOCK_SOURCE_SUSPEND_NONSTOP flag for non-am43 SoCs
    
    [ Upstream commit 3b7d96a0dbb6b630878597a1838fc39f808b761b ]
    
    The 32k clocksource is NONSTOP for non-am43 SoCs. Hence
    add the flag for all the other SoCs.
    
    Reported-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Keerthy <j-keerthy@ti.com>
    Acked-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 385ce0611598bf23e651ad1a567350cf465fd136
Author: Steve Wise <swise@opengridcomputing.com>
Date:   Fri Aug 31 11:52:00 2018 -0700

    cxgb4: fix abort_req_rss6 struct
    
    [ Upstream commit 9f34519a82356f6cf0ccb8480ee0ed99b3d0af75 ]
    
    Remove the incorrect WR_HDR field which can cause a misinterpretation
    of ABORT CPL by ULDs, such as iw_cxgb4.
    
    Fixes: a3cdaa69e4ae ("cxgb4: Adds CPL support for Shared Receive Queues")
    Signed-off-by: Steve Wise <swise@opengridcomputing.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 413baacefef92ea5de0c8eb81541e8f2b945dd2c
Author: Marek Lindner <mareklindner@neomailbox.ch>
Date:   Fri Sep 7 05:45:55 2018 +0800

    batman-adv: fix hardif_neigh refcount on queue_work() failure
    
    [ Upstream commit 4c4af6900844ab04c9434c972021d7b48610e06a ]
    
    The hardif_neigh refcounter is to be decreased by the queued work and
    currently is never decreased if the queue_work() call fails.
    Fix by checking the queue_work() return value and decrease refcount
    if necessary.
    
    Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 04125a63ea54f4f5238bd2bcd3578468b5612560
Author: Marek Lindner <mareklindner@neomailbox.ch>
Date:   Fri Sep 7 05:45:54 2018 +0800

    batman-adv: fix backbone_gw refcount on queue_work() failure
    
    [ Upstream commit 5af96b9c59c72fb2af2d19c5cc2f3cdcee391dff ]
    
    The backbone_gw refcounter is to be decreased by the queued work and
    currently is never decreased if the queue_work() call fails.
    Fix by checking the queue_work() return value and decrease refcount
    if necessary.
    
    Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 39b0e1c4c79fbba0ad3ea5b75cf9f91fe5fdb53b
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Aug 12 21:04:45 2018 +0200

    batman-adv: Prevent duplicated tvlv handler
    
    [ Upstream commit ae3cdc97dc10c7a3b31f297dab429bfb774c9ccb ]
    
    The function batadv_tvlv_handler_register is responsible for adding new
    tvlv_handler to the handler_list. It first checks whether the entry
    already is in the list or not. If it is, then the creation of a new entry
    is aborted.
    
    But the lock for the list is only held when the list is really modified.
    This could lead to duplicated entries because another context could create
    an entry with the same key between the check and the list manipulation.
    
    The check and the manipulation of the list must therefore be in the same
    locked code section.
    
    Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c25ae7c479af34db045dace75e85802853bc06b7
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Aug 12 21:04:44 2018 +0200

    batman-adv: Prevent duplicated global TT entry
    
    [ Upstream commit e7136e48ffdfb9f37b0820f619380485eb407361 ]
    
    The function batadv_tt_global_orig_entry_add is responsible for adding new
    tt_orig_list_entry to the orig_list. It first checks whether the entry
    already is in the list or not. If it is, then the creation of a new entry
    is aborted.
    
    But the lock for the list is only held when the list is really modified.
    This could lead to duplicated entries because another context could create
    an entry with the same key between the check and the list manipulation.
    
    The check and the manipulation of the list must therefore be in the same
    locked code section.
    
    Fixes: d657e621a0f5 ("batman-adv: add reference counting for type batadv_tt_orig_list_entry")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 71d6d75e58019223691ce7f381d12ab02f7082bc
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Aug 12 21:04:43 2018 +0200

    batman-adv: Prevent duplicated softif_vlan entry
    
    [ Upstream commit 94cb82f594ed86be303398d6dfc7640a6f1d45d4 ]
    
    The function batadv_softif_vlan_get is responsible for adding new
    softif_vlan to the softif_vlan_list. It first checks whether the entry
    already is in the list or not. If it is, then the creation of a new entry
    is aborted.
    
    But the lock for the list is only held when the list is really modified.
    This could lead to duplicated entries because another context could create
    an entry with the same key between the check and the list manipulation.
    
    The check and the manipulation of the list must therefore be in the same
    locked code section.
    
    Fixes: 5d2c05b21337 ("batman-adv: add per VLAN interface attribute framework")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 2d1749b0fab0470a7ea28dcdb15af6572951b6bf
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Aug 12 21:04:42 2018 +0200

    batman-adv: Prevent duplicated nc_node entry
    
    [ Upstream commit fa122fec8640eb7186ce5a41b83a4c1744ceef8f ]
    
    The function batadv_nc_get_nc_node is responsible for adding new nc_nodes
    to the in_coding_list and out_coding_list. It first checks whether the
    entry already is in the list or not. If it is, then the creation of a new
    entry is aborted.
    
    But the lock for the list is only held when the list is really modified.
    This could lead to duplicated entries because another context could create
    an entry with the same key between the check and the list manipulation.
    
    The check and the manipulation of the list must therefore be in the same
    locked code section.
    
    Fixes: d56b1705e28c ("batman-adv: network coding - detect coding nodes and remove these after timeout")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit d8ed2b187456e3db53d72dcb2546edd214ebaf69
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun Aug 12 21:04:41 2018 +0200

    batman-adv: Prevent duplicated gateway_node entry
    
    [ Upstream commit dff9bc42ab0b2d38c5e90ddd79b238fed5b4c7ad ]
    
    The function batadv_gw_node_add is responsible for adding new gw_node to
    the gateway_list. It is expecting that the caller already checked that
    there is not already an entry with the same key or not.
    
    But the lock for the list is only held when the list is really modified.
    This could lead to duplicated entries because another context could create
    an entry with the same key between the check and the list manipulation.
    
    The check and the manipulation of the list must therefore be in the same
    locked code section.
    
    Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit eddab21dd463b6893ebff9ba2b2f843c4d535c6a
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri Aug 31 16:56:29 2018 +0200

    batman-adv: Fix segfault when writing to sysfs elp_interval
    
    [ Upstream commit a25bab9d723a08bd0bdafb1529faf9094c690b70 ]
    
    The per hardif sysfs file "batman_adv/elp_interval" is using the generic
    functions to store/show uint values. The helper __batadv_store_uint_attr
    requires the softif net_device as parameter to print the resulting change
    as info text when the users writes to this file. It uses the helper
    function batadv_info to add it at the same time to the kernel ring buffer
    and to the batman-adv debug log (when CONFIG_BATMAN_ADV_DEBUG is enabled).
    
    The function batadv_info requires as first parameter the batman-adv softif
    net_device. This parameter is then used to find the private buffer which
    contains the debug log for this batman-adv interface. But
    batadv_store_throughput_override used as first argument the slave
    net_device. This slave device doesn't have the batadv_priv private data
    which is access by batadv_info.
    
    Writing to this file with CONFIG_BATMAN_ADV_DEBUG enabled can either lead
    to a segfault or to memory corruption.
    
    Fixes: 0744ff8fa8fa ("batman-adv: Add hard_iface specific sysfs wrapper macros for UINT")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 54231bb59a9a3b85fb6dd4e709ef2d72da2e696e
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri Aug 31 16:46:47 2018 +0200

    batman-adv: Fix segfault when writing to throughput_override
    
    [ Upstream commit b9fd14c20871e6189f635e49b32d7789e430b3c8 ]
    
    The per hardif sysfs file "batman_adv/throughput_override" prints the
    resulting change as info text when the users writes to this file. It uses
    the helper function batadv_info to add it at the same time to the kernel
    ring buffer and to the batman-adv debug log (when CONFIG_BATMAN_ADV_DEBUG
    is enabled).
    
    The function batadv_info requires as first parameter the batman-adv softif
    net_device. This parameter is then used to find the private buffer which
    contains the debug log for this batman-adv interface. But
    batadv_store_throughput_override used as first argument the slave
    net_device. This slave device doesn't have the batadv_priv private data
    which is access by batadv_info.
    
    Writing to this file with CONFIG_BATMAN_ADV_DEBUG enabled can either lead
    to a segfault or to memory corruption.
    
    Fixes: 0b5ecc6811bd ("batman-adv: add throughput override attribute to hard_ifaces")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Marek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 52406f34bbb692666b0b1fffa2d8ff961befacb9
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri Aug 31 15:08:44 2018 +0200

    batman-adv: Avoid probe ELP information leak
    
    [ Upstream commit 88d0895d0ea9d4431507d576c963f2ff9918144d ]
    
    The probe ELPs for WiFi interfaces are expanded to contain at least
    BATADV_ELP_MIN_PROBE_SIZE bytes. This is usually a lot more than the
    number of bytes which the template ELP packet requires.
    
    These extra padding bytes were not initialized and thus could contain data
    which were previously stored at the same location. It is therefore required
    to set it to some predefined or random values to avoid leaking private
    information from the system transmitting these kind of packets.
    
    Fixes: e4623c913508 ("batman-adv: Avoid probe ELP information leak")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Acked-by: Antonio Quartulli <a@unstable.cc>
    Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 26c0bac0c117d9ef59ec22ffd2e66c1d88886267
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Tue Sep 4 15:39:30 2018 +0200

    spi: gpio: Fix copy-and-paste error
    
    [ Upstream commit 1723c3155f117ee6e00f28fadf6e9eda4fc85806 ]
    
    This fixes an embarrassing copy-and-paste error in the
    errorpath of spi_gpio_request(): we were checking the wrong
    struct member for error code right after retrieveing the
    sck GPIO.
    
    Fixes: 9b00bc7b901ff672 ("spi: spi-gpio: Rewrite to use GPIO descriptors")
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit affb1840c5788a7d84d551515c9f923e32c4cee7
Author: Jozef Balga <jozef.balga@gmail.com>
Date:   Tue Aug 21 05:01:04 2018 -0400

    media: af9035: prevent buffer overflow on write
    
    [ Upstream commit 312f73b648626a0526a3aceebb0a3192aaba05ce ]
    
    When less than 3 bytes are written to the device, memcpy is called with
    negative array size which leads to buffer overflow and kernel panic. This
    patch adds a condition and returns -EOPNOTSUPP instead.
    Fixes bugzilla issue 64871
    
    [mchehab+samsung@kernel.org: fix a merge conflict and changed the
     condition to match the patch's comment, e. g. len == 3 could
     also be valid]
    Signed-off-by: Jozef Balga <jozef.balga@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1228a75335e09243cac5e5cfdfe3a02234c6baf8
Author: Sanyog Kale <sanyog.r.kale@intel.com>
Date:   Fri Jul 27 14:44:10 2018 +0530

    soundwire: Fix acquiring bus lock twice during master release
    
    [ Upstream commit 8d6ccf5cebbc7ed1dee9986e36853a78dfb64084 ]
    
    As part of sdw_stream_remove_master(), sdw_stream_remove_slave() is called
    which results in bus lock being acquired twice.
    
    So, fix it by performing specific Slave remove operations in
    sdw_release_master_stream() instead of calling sdw_stream_remove_slave().
    
    Signed-off-by: Sanyog Kale <sanyog.r.kale@intel.com>
    Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
    Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ad9107d7e1c77ef4676eebc64333dcdf155ae8b2
Author: Shreyas NC <shreyas.nc@intel.com>
Date:   Fri Jul 27 14:44:09 2018 +0530

    soundwire: Fix incorrect exit after configuring stream
    
    [ Upstream commit 3fef1a2259c556cce34df2791688cb3001f81c92 ]
    
    In sdw_stream_add_master() after the Master ports are configured,
    the stream is released incorrectly.
    
    So, fix it by avoiding stream release after configuring the Master
    for the stream.
    While at it, rename the label appropriately.
    
    Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
    Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit b1bafbe4ff2d5e0ab21cfeef869d02f0cc4cef7a
Author: Shreyas NC <shreyas.nc@intel.com>
Date:   Fri Jul 27 14:44:08 2018 +0530

    soundwire: Fix duplicate stream state assignment
    
    [ Upstream commit 0aebe40bae6cf5652fdc3d05ecee15fbf5748194 ]
    
    For a SoundWire stream it is expected that a Slave is added to the
    stream before Master is added.
    
    So, move the stream state to CONFIGURED after the first Slave is
    added and remove the stream state assignment for Master add.
    Along with these changes, add additional comments to explain the same.
    
    Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
    Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>