1. 07 Dec, 2017 1 commit
    • Chris Wilson's avatar
      drm/i915: Call i915_gem_init_userptr() before taking struct_mutex · ef78970a
      Chris Wilson authored
      We don't need struct_mutex to initialise userptr (it just allocates a
      workqueue for itself etc), but we do need struct_mutex later on in
      i915_gem_init() in order to feed requests onto the HW.
      
      This should break the chain
      
      [  385.697902] ======================================================
      [  385.697907] WARNING: possible circular locking dependency detected
      [  385.697913] 4.14.0-CI-Patchwork_7234+ #1 Tainted: G     U
      [  385.697917] ------------------------------------------------------
      [  385.697922] perf_pmu/2631 is trying to acquire lock:
      [  385.697927]  (&mm->mmap_sem){++++}, at: [<ffffffff811bfe1e>] __might_fault+0x3e/0x90
      [  385.697941]
                     but task is already holding lock:
      [  385.697946]  (&cpuctx_mutex){+.+.}, at: [<ffffffff8116fe8c>] perf_event_ctx_lock_nested+0xbc/0x1d0
      [  385.697957]
                     which lock already depends on the new lock.
      
      [  385.697963]
                     the existing dependency chain (in reverse order) is:
      [  385.697970]
                     -> #4 (&cpuctx_mutex){+.+.}:
      [  385.697980]        __mutex_lock+0x86/0x9b0
      [  385.697985]        perf_event_init_cpu+0x5a/0x90
      [  385.697991]        perf_event_init+0x178/0x1a4
      [  385.697997]        start_kernel+0x27f/0x3f1
      [  385.698003]        verify_cpu+0x0/0xfb
      [  385.698006]
                     -> #3 (pmus_lock){+.+.}:
      [  385.698015]        __mutex_lock+0x86/0x9b0
      [  385.698020]        perf_event_init_cpu+0x21/0x90
      [  385.698025]        cpuhp_invoke_callback+0xca/0xc00
      [  385.698030]        _cpu_up+0xa7/0x170
      [  385.698035]        do_cpu_up+0x57/0x70
      [  385.698039]        smp_init+0x62/0xa6
      [  385.698044]        kernel_init_freeable+0x97/0x193
      [  385.698050]        kernel_init+0xa/0x100
      [  385.698055]        ret_from_fork+0x27/0x40
      [  385.698058]
                     -> #2 (cpu_hotplug_lock.rw_sem){++++}:
      [  385.698068]        cpus_read_lock+0x39/0xa0
      [  385.698073]        apply_workqueue_attrs+0x12/0x50
      [  385.698078]        __alloc_workqueue_key+0x1d8/0x4d8
      [  385.698134]        i915_gem_init_userptr+0x5f/0x80 [i915]
      [  385.698176]        i915_gem_init+0x7c/0x390 [i915]
      [  385.698213]        i915_driver_load+0x99e/0x15c0 [i915]
      [  385.698250]        i915_pci_probe+0x33/0x90 [i915]
      [  385.698256]        pci_device_probe+0xa1/0x130
      [  385.698262]        driver_probe_device+0x293/0x440
      [  385.698267]        __driver_attach+0xde/0xe0
      [  385.698272]        bus_for_each_dev+0x5c/0x90
      [  385.698277]        bus_add_driver+0x16d/0x260
      [  385.698282]        driver_register+0x57/0xc0
      [  385.698287]        do_one_initcall+0x3e/0x160
      [  385.698292]        do_init_module+0x5b/0x1fa
      [  385.698297]        load_module+0x2374/0x2dc0
      [  385.698302]        SyS_finit_module+0xaa/0xe0
      [  385.698307]        entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  385.698311]
                     -> #1 (&dev->struct_mutex){+.+.}:
      [  385.698320]        __mutex_lock+0x86/0x9b0
      [  385.698361]        i915_mutex_lock_interruptible+0x4c/0x130 [i915]
      [  385.698403]        i915_gem_fault+0x206/0x760 [i915]
      [  385.698409]        __do_fault+0x1a/0x70
      [  385.698413]        __handle_mm_fault+0x7c4/0xdb0
      [  385.698417]        handle_mm_fault+0x154/0x300
      [  385.698440]        __do_page_fault+0x2d6/0x570
      [  385.698445]        page_fault+0x22/0x30
      [  385.698449]
                     -> #0 (&mm->mmap_sem){++++}:
      [  385.698459]        lock_acquire+0xaf/0x200
      [  385.698464]        __might_fault+0x68/0x90
      [  385.698470]        _copy_to_user+0x1e/0x70
      [  385.698475]        perf_read+0x1aa/0x290
      [  385.698480]        __vfs_read+0x23/0x120
      [  385.698484]        vfs_read+0xa3/0x150
      [  385.698488]        SyS_read+0x45/0xb0
      [  385.698493]        entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  385.698497]
                     other info that might help us debug this:
      
      [  385.698505] Chain exists of:
                       &mm->mmap_sem --> pmus_lock --> &cpuctx_mutex
      
      [  385.698517]  Possible unsafe locking scenario:
      
      [  385.698522]        CPU0                    CPU1
      [  385.698526]        ----                    ----
      [  385.698529]   lock(&cpuctx_mutex);
      [  385.698553]                                lock(pmus_lock);
      [  385.698558]                                lock(&cpuctx_mutex);
      [  385.698564]   lock(&mm->mmap_sem);
      [  385.698568]
                      *** DEADLOCK ***
      
      [  385.698574] 1 lock held by perf_pmu/2631:
      [  385.698578]  #0:  (&cpuctx_mutex){+.+.}, at: [<ffffffff8116fe8c>] perf_event_ctx_lock_nested+0xbc/0x1d0
      [  385.698589]
                     stack backtrace:
      [  385.698595] CPU: 3 PID: 2631 Comm: perf_pmu Tainted: G     U          4.14.0-CI-Patchwork_7234+ #1
      [  385.698602] Hardware name:                  /NUC6CAYB, BIOS AYAPLCEL.86A.0040.2017.0619.1722 06/19/2017
      [  385.698609] Call Trace:
      [  385.698615]  dump_stack+0x5f/0x86
      [  385.698621]  print_circular_bug.isra.18+0x1d0/0x2c0
      [  385.698627]  __lock_acquire+0x19c3/0x1b60
      [  385.698634]  ? generic_exec_single+0x77/0xe0
      [  385.698640]  ? lock_acquire+0xaf/0x200
      [  385.698644]  lock_acquire+0xaf/0x200
      [  385.698650]  ? __might_fault+0x3e/0x90
      [  385.698655]  __might_fault+0x68/0x90
      [  385.698660]  ? __might_fault+0x3e/0x90
      [  385.698665]  _copy_to_user+0x1e/0x70
      [  385.698670]  perf_read+0x1aa/0x290
      [  385.698675]  __vfs_read+0x23/0x120
      [  385.698682]  ? __fget+0x101/0x1f0
      [  385.698686]  vfs_read+0xa3/0x150
      [  385.698691]  SyS_read+0x45/0xb0
      [  385.698696]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [  385.698701] RIP: 0033:0x7ff1c46876ed
      [  385.698705] RSP: 002b:00007fff13552f90 EFLAGS: 00000293 ORIG_RAX: 0000000000000000
      [  385.698712] RAX: ffffffffffffffda RBX: ffffc90000647ff0 RCX: 00007ff1c46876ed
      [  385.698718] RDX: 0000000000000010 RSI: 00007fff13552fa0 RDI: 0000000000000005
      [  385.698723] RBP: 000056063d300580 R08: 0000000000000000 R09: 0000000000000060
      [  385.698729] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000046
      [  385.698734] R13: 00007fff13552c6f R14: 00007ff1c6279d00 R15: 00007ff1c6279a40
      
      Testcase: igt/perf_pmu
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171122172621.16158-1-chris@chris-wilson.co.ukReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      (cherry picked from commit ee48700d)
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      ef78970a
  2. 05 Dec, 2017 3 commits
  3. 03 Dec, 2017 5 commits
  4. 02 Dec, 2017 4 commits
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.15-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 2db767d9
      Linus Torvalds authored
      Pull NFS client fixes from Anna Schumaker:
       "These patches fix a problem with compiling using an old version of
        gcc, and also fix up error handling in the SUNRPC layer.
      
         - NFSv4: Ensure gcc 4.4.4 can compile initialiser for
           "invalid_stateid"
      
         - SUNRPC: Allow connect to return EHOSTUNREACH
      
         - SUNRPC: Handle ENETDOWN errors"
      
      * tag 'nfs-for-4.15-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        SUNRPC: Handle ENETDOWN errors
        SUNRPC: Allow connect to return EHOSTUNREACH
        NFSv4: Ensure gcc 4.4.4 can compile initialiser for "invalid_stateid"
      2db767d9
    • Linus Torvalds's avatar
      Merge tag 'xfs-4.15-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 788c1da0
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "Here are some bug fixes for 4.15-rc2.
      
         - fix memory leaks that appeared after removing ifork inline data
           buffer
      
         - recover deferred rmap update log items in correct order
      
         - fix memory leaks when buffer construction fails
      
         - fix memory leaks when bmbt is corrupt
      
         - fix some uninitialized variables and math problems in the quota
           scrubber
      
         - add some omitted attribution tags on the log replay commit
      
         - fix some UBSAN complaints about integer overflows with large sparse
           files
      
         - implement an effective inode mode check in online fsck
      
         - fix log's inability to retry quota item writeout due to transient
           errors"
      
      * tag 'xfs-4.15-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: Properly retry failed dquot items in case of error during buffer writeback
        xfs: scrub inode mode properly
        xfs: remove unused parameter from xfs_writepage_map
        xfs: ubsan fixes
        xfs: calculate correct offset in xfs_scrub_quota_item
        xfs: fix uninitialized variable in xfs_scrub_quota
        xfs: fix leaks on corruption errors in xfs_bmap.c
        xfs: fortify xfs_alloc_buftarg error handling
        xfs: log recovery should replay deferred ops in order
        xfs: always free inline data before resetting inode fork during ifree
      788c1da0
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-4.15-rc2_cleanups' of... · e1ba1c99
      Linus Torvalds authored
      Merge tag 'riscv-for-linus-4.15-rc2_cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux
      
      Pull RISC-V cleanups and ABI fixes from Palmer Dabbelt:
       "This contains a handful of small cleanups that are a result of
        feedback that didn't make it into our original patch set, either
        because the feedback hadn't been given yet, I missed the original
        emails, or we weren't ready to submit the changes yet.
      
        I've been maintaining the various cleanup patch sets I have as their
        own branches, which I then merged together and signed. Each merge
        commit has a short summary of the changes, and each branch is based on
        your latest tag (4.15-rc1, in this case). If this isn't the right way
        to do this then feel free to suggest something else, but it seems sane
        to me.
      
        Here's a short summary of the changes, roughly in order of how
        interesting they are.
      
         - libgcc.h has been moved from include/lib, where it's the only
           member, to include/linux. This is meant to avoid tab completion
           conflicts.
      
         - VDSO entries for clock_get/gettimeofday/getcpu have been added.
           These are simple syscalls now, but we want to let glibc use them
           from the start so we can make them faster later.
      
         - A VDSO entry for instruction cache flushing has been added so
           userspace can flush the instruction cache.
      
         - The VDSO symbol versions for __vdso_cmpxchg{32,64} have been
           removed, as those VDSO entries don't actually exist.
      
         - __io_writes has been corrected to respect the given type.
      
         - A new READ_ONCE in arch_spin_is_locked().
      
         - __test_and_op_bit_ord() is now actually ordered.
      
         - Various small fixes throughout the tree to enable allmodconfig to
           build cleanly.
      
         - Removal of some dead code in our atomic support headers.
      
         - Improvements to various comments in our atomic support headers"
      
      * tag 'riscv-for-linus-4.15-rc2_cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux: (23 commits)
        RISC-V: __io_writes should respect the length argument
        move libgcc.h to include/linux
        RISC-V: Clean up an unused include
        RISC-V: Allow userspace to flush the instruction cache
        RISC-V: Flush I$ when making a dirty page executable
        RISC-V: Add missing include
        RISC-V: Use define for get_cycles like other architectures
        RISC-V: Provide stub of setup_profiling_timer()
        RISC-V: Export some expected symbols for modules
        RISC-V: move empty_zero_page definition to C and export it
        RISC-V: io.h: type fixes for warnings
        RISC-V: use RISCV_{INT,SHORT} instead of {INT,SHORT} for asm macros
        RISC-V: use generic serial.h
        RISC-V: remove spin_unlock_wait()
        RISC-V: `sfence.vma` orderes the instruction cache
        RISC-V: Add READ_ONCE in arch_spin_is_locked()
        RISC-V: __test_and_op_bit_ord should be strongly ordered
        RISC-V: Remove smb_mb__{before,after}_spinlock()
        RISC-V: Remove __smp_bp__{before,after}_atomic
        RISC-V: Comment on why {,cmp}xchg is ordered how it is
        ...
      e1ba1c99
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 4b1967c9
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "The critical one here is a fix for fpsimd register corruption across
        signals which was introduced by the SVE support code (the register
        files overlap), but the others are worth having as well.
      
        Summary:
      
         - Fix FP register corruption when SVE is not available or in use
      
         - Fix out-of-tree module build failure when CONFIG_ARM64_MODULE_PLTS=y
      
         - Missing 'const' generating errors with LTO builds
      
         - Remove unsupported events from Cortex-A73 PMU description
      
         - Removal of stale and incorrect comments"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: context: Fix comments and remove pointless smp_wmb()
        arm64: cpu_ops: Add missing 'const' qualifiers
        arm64: perf: remove unsupported events for Cortex-A73
        arm64: fpsimd: Fix failure to restore FPSIMD state after signals
        arm64: pgd: Mark pgd_cache as __ro_after_init
        arm64: ftrace: emit ftrace-mod.o contents through code
        arm64: module-plts: factor out PLT generation code for ftrace
        arm64: mm: cleanup stale AIVIVT references
      4b1967c9
  5. 01 Dec, 2017 21 commits
    • Palmer Dabbelt's avatar
      RISC-V: Fixes for clean allmodconfig build · 3b62de26
      Palmer Dabbelt authored
      Olaf said: Here's a short series of patches that produces a working
      allmodconfig. Would be nice to see them go in so we can add build
      coverage.
      
      I've dropped patches 8 and 10 from the original set:
      
      * [PATCH 08/10] (RISC-V: Set __ARCH_WANT_RENAMEAT to pick up generic
        version) has a better fix that I've sent out for review, we don't want
        renameat.
      * [PATCH 10/10] (input: joystick: riscv has get_cycles) has already been
        taken into Dmitry Torokhov's tree.
      3b62de26
    • Palmer Dabbelt's avatar
      move libgcc.h to include/linux · 185e788c
      Palmer Dabbelt authored
      185e788c
    • Palmer Dabbelt's avatar
      7382fbde
    • Palmer Dabbelt's avatar
      RISC-V: User-Visible Changes · 07f8ba74
      Palmer Dabbelt authored
      This merge contains the user-visible, ABI-breaking changes that we want
      to make sure we have in Linux before our first release.   Highlights
      include:
      
      * VDSO entries for clock_get/gettimeofday/getcpu have been added.  These
        are simple syscalls now, but we want to let glibc use them from the
        start so we can make them faster later.
      * A VDSO entry for instruction cache flushing has been added so
        userspace can flush the instruction cache.
      * The VDSO symbol versions for __vdso_cmpxchg{32,64} have been removed,
        as those VDSO entries don't actually exist.
      
      Conflicts:
              arch/riscv/include/asm/tlbflush.h
      07f8ba74
    • Palmer Dabbelt's avatar
      RISC-V Atomic Cleanups · f8182f61
      Palmer Dabbelt authored
      This patch set is the result of some feedback that filtered through
      after our original patch set was reviewed, some of which was the result
      of me missing some email.  It contains:
      
      * A new READ_ONCE in arch_spin_is_locked()
      * __test_and_op_bit_ord() is now actually ordered
      * Improvements to various comments
      * Removal of some dead code
      f8182f61
    • Palmer Dabbelt's avatar
      RISC-V: __io_writes should respect the length argument · da894ff1
      Palmer Dabbelt authored
      Whoops -- I must have just been being an idiot again.  Thanks to Segher
      for finding the bug :).
      
      CC: Segher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      da894ff1
    • Christoph Hellwig's avatar
      move libgcc.h to include/linux · 4db2b604
      Christoph Hellwig authored
      Introducing a new include/lib directory just for this file totally
      messes up tab completion for include/linux, which is highly annoying.
      
      Move it to include/linux where we have headers for all kinds of other
      lib/ code as well.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      4db2b604
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a0651c7f
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Two fixes for nasty kexec/kdump crashes in certain configurations.
      
        A couple of minor fixes for the new TIDR code.
      
        A fix for an oops in a CXL error handling path.
      
        Thanks to: Andrew Donnellan, Christophe Lombard, David Gibson, Mahesh
        Salgaonkar, Vaibhav Jain"
      
      * tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Do not assign thread.tidr if already assigned
        powerpc: Avoid signed to unsigned conversion in set_thread_tidr()
        powerpc/kexec: Fix kexec/kdump in P9 guest kernels
        powerpc/powernv: Fix kexec crashes caused by tlbie tracing
        cxl: Check if vphb exists before iterating over AFU devices
      a0651c7f
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · ae753ee2
      Linus Torvalds authored
      Pull AFS fixes from David Howells:
       "Two fix patches for the AFS filesystem:
      
         - Fix the refcounting on permit caching.
      
         - AFS inode (afs_vnode) fields need resetting after allocation
           because they're only initialised when slab pages are obtained from
           the page allocator"
      
      * tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Properly reset afs_vnode (inode) fields
        afs: Fix permit refcounting
      ae753ee2
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 3c1c4ddf
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Ensure that debugfs files are removed properly
         - Fix missing blk_put_request()
         - Deal with errors from blk_get_request()
         - Rewind mmc bus suspend operations at failures
         - Prepend '0x' to ocr and pre_eol_info in sysfs to identify as hex
      
        MMC host:
         - sdhci-msm: Make it optional to wait for signal level changes
         - sdhci: Avoid swiotlb buffer being full"
      
      * tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: core: prepend 0x to OCR entry in sysfs
        mmc: core: prepend 0x to pre_eol_info entry in sysfs
        mmc: sdhci: Avoid swiotlb buffer being full
        mmc: sdhci-msm: Optionally wait for signal level changes
        mmc: block: Ensure that debugfs files are removed
        mmc: core: Do not leave the block driver in a suspended state
        mmc: block: Check return value of blk_get_request()
        mmc: block: Fix missing blk_put_request()
      3c1c4ddf
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux · 5dc9cbc4
      Linus Torvalds authored
      Pull drm fixes and cleanups from Dave Airlie:
       "The main thing are a bunch of fixes for the new amd display code, a
        bunch of smatch fixes.
      
        core:
         - Atomic helper regression fix.
         - Deferred fbdev fallout regression fix.
      
        amdgpu:
         - New display code (dc) dpms, suspend/resume and smatch fixes, along
           with some others
         - Some regression fixes for amdkfd/radeon.
         - Fix a ttm regression for swiotlb disabled
      
        bridge:
         - A bunch of fixes for the tc358767 bridge
      
        mali-dp + hdlcd:
         - some fixes and internal API catchups.
      
        imx-drm:
         -regression fix in atomic code.
      
        omapdrm:
         - platform detection regression fixes"
      
      * tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux: (76 commits)
        drm/imx: always call wait_for_flip_done in commit_tail
        omapdrm: hdmi4_cec: signedness bug in hdmi4_cec_init()
        drm: omapdrm: Fix DPI on platforms using the DSI VDDS
        omapdrm: hdmi4: Correct the SoC revision matching
        drm/omap: displays: panel-dpi: add backlight dependency
        drm/omap: Fix error handling path in 'omap_dmm_probe()'
        drm/i915: Disable THP until we have a GPU read BW W/A
        drm/bridge: tc358767: fix 1-lane behavior
        drm/bridge: tc358767: fix AUXDATAn registers access
        drm/bridge: tc358767: fix timing calculations
        drm/bridge: tc358767: fix DP0_MISC register set
        drm/bridge: tc358767: filter out too high modes
        drm/bridge: tc358767: do no fail on hi-res displays
        drm/bridge: Fix lvds-encoder since the panel_bridge rework.
        drm/bridge: synopsys/dw-hdmi: Enable cec clock
        drm/bridge: adv7511/33: Fix adv7511_cec_init() failure handling
        drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
        drm/ttm: fix populate_and_map() functions once more
        drm/fb_helper: Disable all crtc's when initial setup fails.
        drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
        ...
      5dc9cbc4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 75f64f68
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A selection of fixes/changes that should make it into this series.
        This contains:
      
         - NVMe, two merges, containing:
              - pci-e, rdma, and fc fixes
              - Device quirks
      
         - Fix for a badblocks leak in null_blk
      
         - bcache fix from Rui Hua for a race condition regression where
           -EINTR was returned to upper layers that didn't expect it.
      
         - Regression fix for blktrace for a bug introduced in this series.
      
         - blktrace cleanup for cgroup id.
      
         - bdi registration error handling.
      
         - Small series with cleanups for blk-wbt.
      
         - Various little fixes for typos and the like.
      
        Nothing earth shattering, most important are the NVMe and bcache fixes"
      
      * 'for-linus' of git://git.kernel.dk/linux-block: (34 commits)
        nvme-pci: fix NULL pointer dereference in nvme_free_host_mem()
        nvme-rdma: fix memory leak during queue allocation
        blktrace: fix trace mutex deadlock
        nvme-rdma: Use mr pool
        nvme-rdma: Check remotely invalidated rkey matches our expected rkey
        nvme-rdma: wait for local invalidation before completing a request
        nvme-rdma: don't complete requests before a send work request has completed
        nvme-rdma: don't suppress send completions
        bcache: check return value of register_shrinker
        bcache: recover data from backing when data is clean
        bcache: Fix building error on MIPS
        bcache: add a comment in journal bucket reading
        nvme-fc: don't use bit masks for set/test_bit() numbers
        blk-wbt: fix comments typo
        blk-wbt: move wbt_clear_stat to common place in wbt_done
        blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
        blk-wbt: remove duplicated setting in wbt_init
        nvme-pci: add quirk for delay before CHK RDY for WDC SN200
        block: remove useless assignment in bio_split
        null_blk: fix dev->badblocks leak
        ...
      75f64f68
    • Will Deacon's avatar
      arm64: context: Fix comments and remove pointless smp_wmb() · 3a33c760
      Will Deacon authored
      The comments in the ASID allocator incorrectly hint at an MP-style idiom
      using the asid_generation and the active_asids array. In fact, the
      synchronisation is achieved using a combination of an xchg operation
      and a spinlock, so update the comments and remove the pointless smp_wmb().
      
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      3a33c760
    • Yury Norov's avatar
      arm64: cpu_ops: Add missing 'const' qualifiers · 770ba060
      Yury Norov authored
      Building the kernel with an LTO-enabled GCC spits out the following "const"
      warning for the cpu_ops code:
      
        mm/percpu.c:2168:20: error: pcpu_fc_names causes a section type conflict
        with dt_supported_cpu_ops
        const char * const pcpu_fc_names[PCPU_FC_NR] __initconst = {
                ^
        arch/arm64/kernel/cpu_ops.c:34:37: note: ‘dt_supported_cpu_ops’ was declared here
        static const struct cpu_operations *dt_supported_cpu_ops[] __initconst = {
      
      Fix it by adding missed const qualifiers.
      Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      770ba060
    • Xu YiPing's avatar
      arm64: perf: remove unsupported events for Cortex-A73 · f8ada189
      Xu YiPing authored
      bus access read/write events are not supported in A73, based on the
      Cortex-A73 TRM r0p2, section 11.9 Events (pages 11-457 to 11-460).
      
      Fixes: 5561b6c5 "arm64: perf: add support for Cortex-A73"
      Acked-by: default avatarJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: default avatarXu YiPing <xuyiping@hisilicon.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      f8ada189
    • Dave Martin's avatar
      arm64: fpsimd: Fix failure to restore FPSIMD state after signals · 9de52a75
      Dave Martin authored
      The fpsimd_update_current_state() function is responsible for
      loading the FPSIMD state from the user signal frame into the
      current task during sigreturn.  When implementing support for SVE,
      conditional code was added to this function in order to handle the
      case where SVE state need to be loaded for the task and merged with
      the FPSIMD data from the signal frame; however, the FPSIMD-only
      case was unintentionally dropped.
      
      As a result of this, sigreturn does not currently restore the
      FPSIMD state of the task, except in the case where the system
      supports SVE and the signal frame contains SVE state in addition to
      FPSIMD state.
      
      This patch fixes this bug by making the copy-in of the FPSIMD data
      from the signal frame to thread_struct unconditional.
      
      This remains a performance regression from v4.14, since the FPSIMD
      state is now copied into thread_struct and then loaded back,
      instead of _only_ being loaded into the CPU FPSIMD registers.
      However, it is essential to call task_fpsimd_load() here anyway in
      order to ensure that the SVE enable bit in CPACR_EL1 is set
      correctly before returning to userspace.  This could use some
      refactoring, but since sigreturn is not a fast path I have kept
      this patch as a pure fix and left the refactoring for later.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Fixes: 8cd969d2 ("arm64/sve: Signal handling support")
      Reported-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Tested-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      9de52a75
    • Jinbum Park's avatar
      arm64: pgd: Mark pgd_cache as __ro_after_init · a349b302
      Jinbum Park authored
      pgd_cache is setup once while init stage and never changed after
      that, so it is good candidate for __ro_after_init
      Signed-off-by: default avatarJinbum Park <jinb.park7@gmail.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      a349b302
    • Ard Biesheuvel's avatar
      arm64: ftrace: emit ftrace-mod.o contents through code · be0f272b
      Ard Biesheuvel authored
      When building the arm64 kernel with both CONFIG_ARM64_MODULE_PLTS and
      CONFIG_DYNAMIC_FTRACE enabled, the ftrace-mod.o object file is built
      with the kernel and contains a trampoline that is linked into each
      module, so that modules can be loaded far away from the kernel and
      still reach the ftrace entry point in the core kernel with an ordinary
      relative branch, as is emitted by the compiler instrumentation code
      dynamic ftrace relies on.
      
      In order to be able to build out of tree modules, this object file
      needs to be included into the linux-headers or linux-devel packages,
      which is undesirable, as it makes arm64 a special case (although a
      precedent does exist for 32-bit PPC).
      
      Given that the trampoline essentially consists of a PLT entry, let's
      not bother with a source or object file for it, and simply patch it
      in whenever the trampoline is being populated, using the existing
      PLT support routines.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      be0f272b
    • Ard Biesheuvel's avatar
      arm64: module-plts: factor out PLT generation code for ftrace · 7e8b9c1d
      Ard Biesheuvel authored
      To allow the ftrace trampoline code to reuse the PLT entry routines,
      factor it out and move it into asm/module.h.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      7e8b9c1d
    • David Howells's avatar
      afs: Properly reset afs_vnode (inode) fields · f8de483e
      David Howells authored
      When an AFS inode is allocated by afs_alloc_inode(), the allocated
      afs_vnode struct isn't necessarily reset from the last time it was used as
      an inode because the slab constructor is only invoked once when the memory
      is obtained from the page allocator.
      
      This means that information can leak from one inode to the next because
      we're not calling kmem_cache_zalloc().  Some of the information isn't
      reset, in particular the permit cache pointer.
      
      Bring the clearances up to date.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      f8de483e
    • David Howells's avatar
      afs: Fix permit refcounting · 1bcab125
      David Howells authored
      Fix four refcount bugs in afs_cache_permit():
      
       (1) When checking the result of the kzalloc(), we can't just return, but
           must put 'permits'.
      
       (2) We shouldn't put permits immediately after hashing a new permit as we
           need to keep the pointer stable so that we can check to see if
           vnode->permit_cache has changed before we decide whether to assign to
           it.
      
       (3) 'permits' is being put twice.
      
       (4) We need to put either the replacement or the thing replaced after the
           assignment to vnode->permit_cache.
      
      Without this, lots of the following are seen:
      
        Kernel BUG at ffffffffa039857b [verbose debug info unavailable]
        ------------[ cut here ]------------
        Kernel BUG at ffffffffa039858a [verbose debug info unavailable]
        ------------[ cut here ]------------
      
      The addresses are in the .text..refcount section of the kafs.ko module.
      Following the relocation records for the __ex_table section shows one to be
      due to the decrement in afs_put_permits() and the other to be key_get() in
      afs_cache_permit().
      
      Occasionally, the following is seen:
      
        refcount_t overflow at afs_cache_permit+0x57d/0x5c0 [kafs] in cc1[562], uid/euid: 0/0
        WARNING: CPU: 0 PID: 562 at kernel/panic.c:657 refcount_error_report+0x9c/0xac
        ...
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      1bcab125
  6. 30 Nov, 2017 6 commits
    • Linus Torvalds's avatar
      Merge tag 'apparmor-pr-2017-11-30' of... · df8ba95c
      Linus Torvalds authored
      Merge tag 'apparmor-pr-2017-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor
      
      Pull apparmor bugfix from John Johansen:
       "Fix oops in audit_signal_cb hook marked for stable"
      
      * tag 'apparmor-pr-2017-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
        apparmor: fix oops in audit_signal_cb hook
      df8ba95c
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 42062b98
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix a regression related to the ACPI EC handling during system
        suspend/resume on some platforms and prevent modalias from being
        exposed to user space for ACPI device object with "not functional and
        not present" status.
      
        Specifics:
      
         - Fix an ACPI EC driver regression (from the 4.9 cycle) causing the
           driver's power management operations to be omitted during system
           suspend/resume on platforms where the EC instance from the ECDT
           table is used instead of the one from the DSDT (Lv Zheng).
      
         - Prevent modalias from being exposed to user space for ACPI device
           objects with _STA returning 0 (not present and not functional) to
           prevent driver modules from being loaded automatically for hardware
           that is not actually present on some platforms (Hans de Goede)"
      
      * tag 'acpi-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / EC: Fix regression related to PM ops support in ECDT device
        ACPI / bus: Leave modalias empty for devices which are not present
      42062b98
    • Linus Torvalds's avatar
      Merge tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 0cf710f8
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
      
       - add missing module information to the Mediatek cpufreq driver module
         (Jesse Chan)
      
       - fix config dependencies for the Loongson cpufreq driver (James Hogan)
      
       - fix two issues related to CPU offline in the cpupower utility
         (Abhishek Goel).
      
      * tag 'pm-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: mediatek: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
        cpufreq: Add Loongson machine dependencies
        cpupower : Fix cpupower working when cpu0 is offline
        cpupowerutils: bench - Fix cpu online check
      0cf710f8
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 9c41180b
      Linus Torvalds authored
      Pull quota & reiserfs changes from Jan Kara:
      
       - two error checking improvements for quota
      
       - remove bogus i_version increase for reiserfs
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: Check for register_shrinker() failure.
        quota: propagate error from __dquot_initialize
        reiserfs: remove unneeded i_version bump
      9c41180b
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 503505bf
      Dave Airlie authored
      Fixes for 4.15.  Highlights:
      - DC fixes for S3, gamma, audio, pageflipping, etc.
      - fix a regression in radeon from kfd removal
      - fix a ttm regression with swiotlb disabled
      - misc other fixes
      
      * 'drm-fixes-4.15' of git://people.freedesktop.org/~agd5f/linux: (36 commits)
        drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
        drm/ttm: fix populate_and_map() functions once more
        drm/amd/display: USB-C / thunderbolt dock specific workaround
        drm/amd/display: Switch to drm_atomic_helper_wait_for_flip_done
        drm/amd/display: fix gamma setting
        drm/amd/display: Do not put drm_atomic_state on resume
        drm/amd/display: Fix couple more inconsistent NULL checks in dc_resource
        drm/amd/display: Fix potential NULL and mem leak in create_links
        drm/amd/display: Fix hubp check in set_cursor_position
        drm/amd/display: Fix use before NULL check in validate_timing
        drm/amd/display: Bunch of smatch error and warning fixes in DC
        drm/amd/display: Fix amdgpu_dm bugs found by smatch
        drm/amd/display: try to find matching audio inst for enc inst first
        drm/amd/display: fix seq issue: turn on clock before programming afmt.
        drm/amd/display: fix memory leaks on error exit return
        drm/amd/display: check plane state before validating fbc
        drm/amd/display: Do DC mode-change check when adding CRTCs
        drm/amd/display: Revert noisy assert messages
        drm/amd/display: fix split viewport rounding error
        drm/amd/display: Check aux channel before MST resume
        ...
      503505bf
    • Dave Airlie's avatar
      Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-fixes · 062076e8
      Dave Airlie authored
      mali-dp interface cleanups.
      
      * 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld:
        drm: mali-dp: Disable planes when their CRTC gets disabled.
        drm: mali-dp: Separate static internal data into a read-only structure.
        drm/arm: Replace instances of drm_dev_unref with drm_dev_put.
        drm: mali-dp: switch to drm_*_get(), drm_*_put() helpers
      062076e8