1. 02 Nov, 2019 2 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20191101' of git://git.kernel.dk/linux-block · 0821de28
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Two small nvme fixes, one is a fabrics connection fix, the other one
         a cleanup made possible by that fix (Anton, via Keith)
      
       - Fix requeue handling in umb ubd (Anton)
      
       - Fix spin_lock_irq() nesting in blk-iocost (Dan)
      
       - Three small io_uring fixes:
           - Install io_uring fd after done with ctx (me)
           - Clear ->result before every poll issue (me)
           - Fix leak of shadow request on error (Pavel)
      
      * tag 'for-linus-20191101' of git://git.kernel.dk/linux-block:
        iocost: don't nest spin_lock_irq in ioc_weight_write()
        io_uring: ensure we clear io_kiocb->result before each issue
        um-ubd: Entrust re-queue to the upper layers
        nvme-multipath: remove unused groups_only mode in ana log
        nvme-multipath: fix possible io hang after ctrl reconnect
        io_uring: don't touch ctx in setup after ring fd install
        io_uring: Fix leaked shadow_req
      0821de28
    • Linus Torvalds's avatar
      Merge tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e5897c7d
      Linus Torvalds authored
      Pull RISC-V fixes from Paul Walmsley:
       "One fix for PCIe users:
      
         - Fix legacy PCI I/O port access emulation
      
        One set of cleanups:
      
         - Resolve most of the warnings generated by sparse across arch/riscv.
           No functional changes
      
        And one MAINTAINERS update:
      
         - Update Palmer's E-mail address"
      
      * tag 'riscv/for-v5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        MAINTAINERS: Change to my personal email address
        RISC-V: Add PCIe I/O BAR memory mapping
        riscv: for C functions called only from assembly, mark with __visible
        riscv: fp: add missing __user pointer annotations
        riscv: add missing header file includes
        riscv: mark some code and data as file-static
        riscv: init: merge split string literals in preprocessor directive
        riscv: add prototypes for assembly language functions from head.S
      e5897c7d
  2. 01 Nov, 2019 17 commits
  3. 31 Oct, 2019 12 commits
  4. 30 Oct, 2019 9 commits
    • Takashi Iwai's avatar
      ALSA: timer: Fix mutex deadlock at releasing card · a3933186
      Takashi Iwai authored
      When a card is disconnected while in use, the system waits until all
      opened files are closed then releases the card.  This is done via
      put_device() of the card device in each device release code.
      
      The recently reported mutex deadlock bug happens in this code path;
      snd_timer_close() for the timer device deals with the global
      register_mutex and it calls put_device() there.  When this timer
      device is the last one, the card gets freed and it eventually calls
      snd_timer_free(), which has again the protection with the global
      register_mutex -- boom.
      
      Basically put_device() call itself is race-free, so a relative simple
      workaround is to move this put_device() call out of the mutex.  For
      achieving that, in this patch, snd_timer_close_locked() got a new
      argument to store the card device pointer in return, and each caller
      invokes put_device() with the returned object after the mutex unlock.
      Reported-and-tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a3933186
    • Jens Axboe's avatar
      io_uring: ensure we clear io_kiocb->result before each issue · 6873e0bd
      Jens Axboe authored
      We use io_kiocb->result == -EAGAIN as a way to know if we need to
      re-submit a polled request, as -EAGAIN reporting happens out-of-line
      for IO submission failures. This field is cleared when we originally
      allocate the request, but it isn't reset when we retry the submission
      from async context. This can cause issues where we think something
      needs a re-issue, but we're really just reading stale data.
      
      Reset ->result whenever we re-prep a request for polled submission.
      
      Cc: stable@vger.kernel.org
      Fixes: 9e645e11 ("io_uring: add support for sqe links")
      Reported-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6873e0bd
    • Sven Schnelle's avatar
      parisc: fix frame pointer in ftrace_regs_caller() · 3d252454
      Sven Schnelle authored
      The current code in ftrace_regs_caller() doesn't assign
      %r3 to contain the address of the current frame. This
      is hidden if the kernel is compiled with FRAME_POINTER,
      but without it just crashes because it tries to dereference
      an arbitrary address. Fix this by always setting %r3 to the
      current stack frame.
      Signed-off-by: default avatarSven Schnelle <svens@stackframe.org>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      3d252454
    • Nick Desaulniers's avatar
      drm/amdgpu: enable -msse2 for GCC 7.1+ users · e8a170ff
      Nick Desaulniers authored
      A final attempt at enabling sse2 for GCC users.
      
      Orininally attempted in:
      commit 10117450 ("drm/amd/display: add -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines")
      
      Reverted due to "reported instability" in:
      commit 193392ed ("Revert "drm/amd/display: add -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines"")
      
      Re-added just for Clang in:
      commit 0f0727d9 ("drm/amd/display: readd -msse2 to prevent Clang from emitting libcalls to undefined SW FP routines")
      
      The original report didn't have enough information to know if the GPF
      was due to misalignment, but I suspect that it was. (The missing
      information was the disassembly of the function at the bottom of the
      trace, to see if the instruction pointer pointed to an instruction with
      16B alignment memory operand requirements.  The stack trace does show
      the stack was only 8B but not 16B aligned though, which makes this a
      strong possibility).
      
      Now that the stack misalignment issue has been fixed for users of GCC
      7.1+, reattempt adding -msse2. This matches Clang.
      
      It will likely never be safe to enable this for pre-GCC 7.1 AND use a
      16B aligned stack in these translation units.
      
      This is only a functional change for GCC 7.1+ users, and should be boot
      tested.
      
      Link: https://bugs.freedesktop.org/show_bug.cgi?id=109487Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      e8a170ff
    • Nick Desaulniers's avatar
      drm/amdgpu: fix stack alignment ABI mismatch for GCC 7.1+ · 00db2971
      Nick Desaulniers authored
      GCC earlier than 7.1 errors when compiling code that makes use of
      `double`s and sets a stack alignment outside of the range of [2^4-2^12]:
      
      $ cat foo.c
      double foo(double x, double y) {
        return x + y;
      }
      $ gcc-4.9 -mpreferred-stack-boundary=3 foo.c
      error: -mpreferred-stack-boundary=3 is not between 4 and 12
      
      This is likely why the AMDGPU driver was ever compiled with a different
      stack alignment (and thus different ABI) than the rest of the x86
      kernel. The kernel uses 8B stack alignment, while the driver was using
      16B stack alignment in a few places.
      
      Since GCC 7.1+ doesn't error, fix the ABI mismatch for users of newer
      versions of GCC.
      
      There was discussion about whether to mark the driver broken or not for
      users of GCC earlier than 7.1, but since the driver currently is
      working, don't explicitly break the driver for them here.
      
      Relying on differing stack alignment is unspecified behavior, and
      brittle, and may break in the future.
      
      This patch is no functional change for GCC users earlier than 7.1. It's
      been compile tested on GCC 4.9 and 8.3 to check the correct flags. It
      should be boot tested when built with GCC 7.1+.
      
      -mincoming-stack-boundary= or -mstackrealign may help keep this code
      building for pre-GCC 7.1 users.
      
      The version check for GCC is broken into two conditionals, both because
      cc-ifversion is currently GCC specific, and it simplifies a subsequent
      patch.
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      00db2971
    • Nick Desaulniers's avatar
      drm/amdgpu: fix stack alignment ABI mismatch for Clang · c868868f
      Nick Desaulniers authored
      The x86 kernel is compiled with an 8B stack alignment via
      `-mpreferred-stack-boundary=3` for GCC since 3.6-rc1 via
      commit d9b0cde9 ("x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported")
      or `-mstack-alignment=8` for Clang. Parts of the AMDGPU driver are
      compiled with 16B stack alignment.
      
      Generally, the stack alignment is part of the ABI. Linking together two
      different translation units with differing stack alignment is dangerous,
      particularly when the translation unit with the smaller stack alignment
      makes calls into the translation unit with the larger stack alignment.
      While 8B aligned stacks are sometimes also 16B aligned, they are not
      always.
      
      Multiple users have reported General Protection Faults (GPF) when using
      the AMDGPU driver compiled with Clang. Clang is placing objects in stack
      slots assuming the stack is 16B aligned, and selecting instructions that
      require 16B aligned memory operands.
      
      At runtime, syscall handlers with 8B aligned stack call into code that
      assumes 16B stack alignment.  When the stack is a multiple of 8B but not
      16B, these instructions result in a GPF.
      
      Remove the code that added compatibility between the differing compiler
      flags, as it will result in runtime GPFs when built with Clang. Cleanups
      for GCC will be sent in later patches in the series.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/735Debugged-by: default avatarYuxuan Shui <yshuiv7@gmail.com>
      Reported-by: default avatarShirish S <shirish.s@amd.com>
      Reported-by: default avatarYuxuan Shui <yshuiv7@gmail.com>
      Suggested-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      c868868f
    • Kyle Mahlkuch's avatar
      drm/radeon: Fix EEH during kexec · 72260843
      Kyle Mahlkuch authored
      During kexec some adapters hit an EEH since they are not properly
      shut down in the radeon_pci_shutdown() function. Adding
      radeon_suspend_kms() fixes this issue.
      Enabled only on PPC because this patch causes issues on some other
      boards.
      Signed-off-by: default avatarKyle Mahlkuch <kmahlkuc@linux.vnet.ibm.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      72260843
    • Alex Deucher's avatar
      drm/amdgpu/gmc10: properly set BANK_SELECT and FRAGMENT_SIZE · 30ef5c7e
      Alex Deucher authored
      These were not aligned for optimal performance for GPUVM.
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarTianci Yin <tianci.yin@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      30ef5c7e
    • Pelle van Gils's avatar
      drm/amdgpu/powerplay/vega10: allow undervolting in p7 · e6f4e274
      Pelle van Gils authored
      The vega10_odn_update_soc_table() function does not allow the SCLK
      dependent voltage to be set for power-state 7 to a value below the default
      in pptable. Change the for-loop condition to allow undervolting in the
      highest state.
      
      Bug: https://bugzilla.kernel.org/show_bug.cgi?id=205277Signed-off-by: default avatarPelle van Gils <pelle@vangils.xyz>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      e6f4e274