1. 03 Aug, 2019 2 commits
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-08-02-1' of git://anongit.freedesktop.org/drm/drm · 0e31225f
      Linus Torvalds authored
      Pull more drm fixes from Daniel Vetter:
       "Dave sends his pull, everyone realizes they've been asleep at the
        wheel and hits send on their own pulls :-/
      
        Normally I'd just ignore these all because w/e for me and Dave. But
        this time around the latecomers also included drm-intel-fixes, which
        failed to send out a -fixes pull thus far for this release (screwed up
        vacation coverage, despite that 2/3 maintainers were around ... they
        all look appropriately guilty), and that really is overdue to get
        landed.
      
        And since I had to do a pull request anyway I pulled the other two
        late ones too.
      
        intel fixes (didn't have any ever since the main merge window pull):
         - gvt fixes (2 cc: stable)
         - fix gpu reset vs mm-shrinker vs wakeup fun (needed a few patches)
         - two gem locking fixes (one cc: stable)
         - pile of misc fixes all over with minor impact, 6 cc: stable, others
           from this window
      
        exynos:
         - misc minor fixes
      
        misc:
         - some build/Kconfig fixes
         - regression fix for vm scalability perf test which seems to mostly
           exercise dmesg/console logging ...
         - the vgem cache flush fix for arm64 broke the world on x86, so
           that's reverted again
      
      * tag 'drm-fixes-2019-08-02-1' of git://anongit.freedesktop.org/drm/drm: (42 commits)
        Revert "drm/vgem: fix cache synchronization on arm/arm64"
        drm/exynos: fix missing decrement of retry counter
        drm/exynos: add CONFIG_MMU dependency
        drm/exynos: remove redundant assignment to pointer 'node'
        drm/exynos: using dev_get_drvdata directly
        drm/bochs: Use shadow buffer for bochs framebuffer console
        drm/fb-helper: Instanciate shadow FB if configured in device's mode_config
        drm/fb-helper: Map DRM client buffer only when required
        drm/client: Support unmapping of DRM client buffers
        drm/i915: Only recover active engines
        drm/i915: Add a wakeref getter for iff the wakeref is already active
        drm/i915: Lift intel_engines_resume() to callers
        drm/vgem: fix cache synchronization on arm/arm64
        drm/i810: Use CONFIG_PREEMPTION
        drm/bridge: tc358764: Fix build error
        drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m
        drm/i915/gvt: Adding ppgtt to GVT GEM context after shadow pdps settled.
        drm/i915/gvt: grab runtime pm first for forcewake use
        drm/i915/gvt: fix incorrect cache entry for guest page mapping
        drm/i915/gvt: Checking workload's gma earlier
        ...
      0e31225f
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20190801' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 4f1a6ef1
      Linus Torvalds authored
      Pull selinux fix from Paul Moore:
       "One more small fix for a potential memory leak in an error path"
      
      * tag 'selinux-pr-20190801' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinux: fix memory leak in policydb_init()
      4f1a6ef1
  2. 02 Aug, 2019 29 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.3a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · dcb8cfbd
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - a small cleanup
      
       - a fix for a build error on ARM with some configs
      
       - a fix of a patch for the Xen gntdev driver
      
       - three patches for fixing a potential problem in the swiotlb-xen
         driver which Konrad was fine with me carrying them through the Xen
         tree
      
      * tag 'for-linus-5.3a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/swiotlb: remember having called xen_create_contiguous_region()
        xen/swiotlb: simplify range_straddles_page_boundary()
        xen/swiotlb: fix condition for calling xen_destroy_contiguous_region()
        xen: avoid link error on ARM
        xen/gntdev.c: Replace vm_map_pages() with vm_map_pages_zero()
        xen/pciback: remove set but not used variable 'old_state'
      dcb8cfbd
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · a507f25d
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - Update the compat layer to allow single-byte watchpoints on all
         addresses (similar to the native support)
      
       - arm_pmu: fix the restoration of the counters on the
         CPU_PM_ENTER_FAILED path
      
       - Fix build regression with vDSO and Makefile not stripping
         CROSS_COMPILE_COMPAT
      
       - Fix the CTR_EL0 (cache type register) sanitisation on heterogeneous
         machines (e.g. big.LITTLE)
      
       - Fix the interrupt controller priority mask value when pseudo-NMIs are
         enabled
      
       - arm64 kprobes fixes: recovering of the PSTATE.D flag in the
         single-step exception handler, NOKPROBE annotations for
         unwind_frame() and walk_stackframe(), remove unneeded
         rcu_read_lock/unlock from debug handlers
      
       - Several gcc fall-through warnings
      
       - Unused variable warnings
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Make debug exception handlers visible from RCU
        arm64: kprobes: Recover pstate.D in single-step exception handler
        arm64/mm: fix variable 'tag' set but not used
        arm64/mm: fix variable 'pud' set but not used
        arm64: Remove unneeded rcu_read_lock from debug handlers
        arm64: unwind: Prohibit probing on return_address()
        arm64: Lower priority mask for GIC_PRIO_IRQON
        arm64/efi: fix variable 'si' set but not used
        arm64: cpufeature: Fix feature comparison for CTR_EL0.{CWG,ERG}
        arm64: vdso: Fix Makefile regression
        arm64: module: Mark expected switch fall-through
        arm64: smp: Mark expected switch fall-through
        arm64: hw_breakpoint: Fix warnings about implicit fallthrough
        drivers/perf: arm_pmu: Fix failure path in PM notifier
        arm64: compat: Allow single-byte watchpoints on all addresses
      a507f25d
    • Linus Torvalds's avatar
      Merge branch 'parisc-5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 9100fc5a
      Linus Torvalds authored
      Pull parisc fixes from Helge Deller:
       "A few small fixes for the parisc architecture:
      
         - Fix fall-through warnings in parisc math emu code
      
         - Fix vmlinuz linking failure with debug-enabled kernels
      
         - Fix a race condition in kernel live-patching code
      
         - Add missing archclean Makefile target & defconfig adjustments"
      
      * 'parisc-5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Add archclean Makefile target
        parisc: Strip debug info from kernel before creating compressed vmlinuz
        parisc: Fix build of compressed kernel even with debug enabled
        parisc: fix race condition in patching code
        parisc: rename default_defconfig to defconfig
        parisc: Fix fall-through warnings in fpudispatch.c
        parisc: Mark expected switch fall-throughs in fault.c
      9100fc5a
    • Linus Torvalds's avatar
      Merge tag 's390-5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 4dd68199
      Linus Torvalds authored
      Pull s390 updates from Vasily Gorbik:
      
       - Default configs updates
      
       - Minor qdio cleanup
      
       - Sparse warnings fixes
      
       - Implicit-fallthrough warnings fixes
      
      * tag 's390-5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/zcrypt: adjust switch fall through comments for -Wimplicit-fallthrough
        vfio-ccw: make vfio_ccw_async_region_ops static
        s390/3215: add switch fall through comment for -Wimplicit-fallthrough
        s390/tape: add fallthrough annotations
        s390/mm: add fallthrough annotations
        s390/mm: make gmap_test_and_clear_dirty_pmd static
        s390/kexec: add missing include to machine_kexec_reloc.c
        s390/perf: make cf_diag_csd static
        s390/lib: add missing include
        s390/boot: add missing declarations and includes
        s390: update configs
        s390: clean up qdio.h
      4dd68199
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6e6d0536
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Seven fixes to four drivers with no core changes.
      
        The mpt3sas one is theoretical until we get a CPU that goes up to 64
        bits physical, the qla2xxx one fixes an oops in a driver
        initialization error leg and the others are mostly cosmetic"
      
      [ The fcoe patches may be worth highlighting - they may be "just"
        cleanups, but they simplify and fix the odd fc_rport_priv structure
        handling rules so that the new gcc-9 warnings about memset crossing
        structure boundaries are gone.
      
        The old code was hard for humans to understand too, and really
        confused the compiler sanity checks  - Linus ]
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qla2xxx: Fix possible fcport null-pointer dereferences
        scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
        scsi: hpsa: remove printing internal cdb on tag collision
        scsi: hpsa: correct scsi command status issue after reset
        scsi: fcoe: pass in fcoe_rport structure instead of fc_rport_priv
        scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure
        scsi: libfc: Whitespace cleanup in libfc.h
      6e6d0536
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190802' of git://git.kernel.dk/linux-block · 10e5ddd7
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "Here's a small collection of fixes that should go into this series.
        This contains:
      
         - io_uring potential use-after-free fix (Jackie)
      
         - loop regression fix (Jan)
      
         - O_DIRECT fragmented bio regression fix (Damien)
      
         - Mark Denis as the new floppy maintainer (Denis)
      
         - ataflop switch fall-through annotation (Gustavo)
      
         - libata zpodd overflow fix (Kees)
      
         - libata ahci deferred probe fix (Miquel)
      
         - nbd invalidation BUG_ON() fix (Munehisa)
      
         - dasd endless loop fix (Stefan)"
      
      * tag 'for-linus-20190802' of git://git.kernel.dk/linux-block:
        s390/dasd: fix endless loop after read unit address configuration
        block: Fix __blkdev_direct_IO() for bio fragments
        MAINTAINERS: floppy: take over maintainership
        nbd: replace kill_bdev() with __invalidate_device() again
        ata: libahci: do not complain in case of deferred probe
        io_uring: fix KASAN use after free in io_sq_wq_submit_work
        loop: Fix mount(2) failure due to race with LOOP_SET_FD
        libata: zpodd: Fix small read overflow in zpodd_get_mech_type()
        ataflop: Mark expected switch fall-through
      10e5ddd7
    • Linus Torvalds's avatar
      Merge tag 'for-5.3/dm-fixes-1' of... · b2c74237
      Linus Torvalds authored
      Merge tag 'for-5.3/dm-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
       "Fix NULL pointer and various whitespace issues with DM's recent DAX
        code changes from commit in 5.3 merge"
      
      * tag 'for-5.3/dm-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm table: fix various whitespace issues with recent DAX code
        dm table: fix dax_dev NULL dereference in device_synchronous()
      b2c74237
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · b07042ca
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "Here's our second -rc pull request. Nothing particularly special in
        this one. The client removal deadlock fix is kindy tricky, but we had
        multiple eyes on it and no one could find a fault in it. A couple
        Spectre V1 fixes too. Otherwise, all just normal -rc fodder:
      
         - A couple Spectre V1 fixes (umad, hfi1)
      
         - Fix a tricky deadlock in the rdma core code with refcounting
           instead of locks (client removal patches)
      
         - Build errors (hns)
      
         - Fix a scheduling while atomic issue (mlx5)
      
         - Use after free fix (mad)
      
         - Fix error path return code (hns)
      
         - Null deref fix (siw_crypto_hash)
      
         - A few other misc. minor fixes"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp()
        RDMA/mlx5: Release locks during notifier unregister
        IB/hfi1: Fix Spectre v1 vulnerability
        IB/mad: Fix use-after-free in ib mad completion handling
        RDMA/restrack: Track driver QP types in resource tracker
        IB/mlx5: Fix MR registration flow to use UMR properly
        RDMA/devices: Remove the lock around remove_client_context
        RDMA/devices: Do not deadlock during client removal
        IB/core: Add mitigation for Spectre V1
        Do not dereference 'siw_crypto_shash' before checking
        RDMA/qedr: Fix the hca_type and hca_rev returned in device attributes
        RDMA/hns: Fix build error
      b07042ca
    • Linus Torvalds's avatar
      Merge tag 'for-5.3-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · d38c3fa6
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
      
       - tiny race window during 2 transactions aborting at the same time can
         accidentally lead to a commit
      
       - regression fix, possible deadlock during fiemap
      
       - fix for an old bug when incremental send can fail on a file that has
         been deduplicated in a special way
      
      * tag 'for-5.3-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Btrfs: fix deadlock between fiemap and transaction commits
        Btrfs: fix race leading to fs corruption after transaction abort
        Btrfs: fix incremental send failure after deduplication
      d38c3fa6
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.3-rc2.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 97b00aff
      Linus Torvalds authored
      Pull gfs2 fix from Andreas Gruenbacher:
       "Fix gfs2 cluster coherency bug"
      
      * tag 'gfs2-v5.3-rc2.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Inode dirtying fix
      97b00aff
    • Linus Torvalds's avatar
      Merge tag 'pm-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 755f1fed
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Fix recent regression affecting ACPI device power management"
      
      * tag 'pm-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: PM: Fix regression in acpi_device_set_power()
      755f1fed
    • Linus Torvalds's avatar
      Merge tag 'sound-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 75cdf416
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
      
       - A further fix for syzcaller issues with USB-audio, addressing NULL
         dereference that was introduced by the recent fix
      
       - Avoid a long delay at boot with HD-audio when i915 module was built
         but not installed, found on some Debian systems
      
       - A fix of small race window at PCM draining
      
      * tag 'sound-5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usb-audio: Fix gpf in snd_usb_pipe_sanity_check
        ALSA: pcm: fix lost wakeup event scenarios in snd_pcm_drain
        ALSA: hda: Fix 1-minute detection delay when i915 module is not available
      75cdf416
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-08-02' of git://anongit.freedesktop.org/drm/drm · f26dbb23
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Thanks to Daniel for handling the email the last couple of weeks, flus
        and break-ins combined to derail me. Surprised nothing materialised
        today to take me out again.
      
        Just more amdgpu navi fixes, msm fixes and a single nouveau regression
        fix:
      
        amdgpu:
         - navi10 temperature and pstate fixes
         - vcn dynamic power management fix
         - CS ioctl error handling fix
         - debugfs info leak fix
         - amdkfd VegaM fix
      
        msm:
         - dma sync call fix
         - mdp5 dsi command mode fix
         - fall-through fixes
         - disabled GPU fix
      
        nouveau:
         - regression fix for displayport MST support"
      
      * tag 'drm-fixes-2019-08-02' of git://anongit.freedesktop.org/drm/drm:
        drm/nouveau: Only release VCPI slots on mode changes
        drm: msm: Fix add_gpu_components
        drm/msm: Annotate intentional switch statement fall throughs
        drm/msm: add support for per-CRTC max_vblank_count on mdp5
        drm/msm: Use the correct dma_sync calls in msm_gem
        drm/amd/powerplay: correct UVD/VCE/VCN power status retrieval
        drm/amd/powerplay: correct Navi10 VCN powergate control (v2)
        drm/amd/powerplay: support VCN powergate status retrieval for SW SMU
        drm/amd/powerplay: support VCN powergate status retrieval on Raven
        drm/amd/powerplay: add new sensor type for VCN powergate status
        drm/amdgpu: fix a potential information leaking bug
        drm/amdgpu: fix error handling in amdgpu_cs_process_fence_dep
        drm/amd/powerplay: enable SW SMU reset functionality
        drm/amd/powerplay: fix null pointer dereference around dpm state relates
        drm/amdgpu/powerplay: use proper revision id for navi
        drm/amd/powerplay: fix temperature granularity error in smu11
        drm/amd/powerplay: add callback function of get_thermal_temperature_range
        drm/amdkfd: Fix byte align on VegaM
      f26dbb23
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 42d21900
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A few fixes for code that came in during the merge window or that
        started getting exercised differently this time around:
      
         - Select regmap MMIO kconfig in spreadtrum driver to avoid compile
           errors
      
         - Complete kerneldoc on devm_clk_bulk_get_optional()
      
         - Register an essential clk earlier on mediatek mt8183 SoCs so the
           clocksource driver can use it
      
         - Fix divisor math in the at91 driver
      
         - Plug a race in Renesas reset control logic"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: renesas: cpg-mssr: Fix reset control race condition
        clk: sprd: Select REGMAP_MMIO to avoid compile errors
        clk: mediatek: mt8183: Register 13MHz clock earlier for clocksource
        clk: Add missing documentation of devm_clk_bulk_get_optional() argument
        clk: at91: generated: Truncate divisor to GENERATED_MAX_DIV + 1
      42d21900
    • Linus Torvalds's avatar
      Merge tag 'arm-swiotlb-5.3' of git://git.infradead.org/users/hch/dma-mapping · 234172f6
      Linus Torvalds authored
      Pull arm swiotlb support from Christoph Hellwig:
       "This fixes a cascade of regressions that originally started with the
        addition of the ia64 port, but only got fatal once we removed most
        uses of block layer bounce buffering in Linux 4.18.
      
        The reason is that while the original i386/PAE code that was the first
        architecture that supported > 4GB of memory without an iommu decided
        to leave bounce buffering to the subsystems, which in those days just
        mean block and networking as no one else consumed arbitrary userspace
        memory.
      
        Later with ia64, x86_64 and other ports we assumed that either an
        iommu or something that fakes it up ("software IOTLB" in beautiful
        Intel speak) is present and that subsystems can rely on that for
        dealing with addressing limitations in devices. Except that the ARM
        LPAE scheme that added larger physical address to 32-bit ARM did not
        follow that scheme and thus only worked by chance and only for block
        and networking I/O directly to highmem.
      
        Long story, short fix - add swiotlb support to arm when build for LPAE
        platforms, which actuallys turns out to be pretty trivial with the
        modern dma-direct / swiotlb code to fix the Linux 4.18-ish regression"
      
      * tag 'arm-swiotlb-5.3' of git://git.infradead.org/users/hch/dma-mapping:
        arm: use swiotlb for bounce buffering on LPAE configs
        dma-mapping: check pfn validity in dma_common_{mmap,get_sgtable}
      234172f6
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.3-3' of git://git.infradead.org/users/hch/dma-mapping · 35fca9f8
      Linus Torvalds authored
      Pull dma-mapping regression fixes from Christoph Hellwig:
       "Two related regression fixes for changes from this merge window to fix
        alignment issues introduced in the CMA allocation rework (Nicolin
        Chen)"
      
      * tag 'dma-mapping-5.3-3' of git://git.infradead.org/users/hch/dma-mapping:
        dma-contiguous: page-align the size in dma_free_contiguous()
        dma-contiguous: do not overwrite align in dma_alloc_contiguous()
      35fca9f8
    • Daniel Vetter's avatar
      Merge tag 'exynos-drm-fixes-for-v5.3-rc3' of... · 9c8c9c7c
      Daniel Vetter authored
      Merge tag 'exynos-drm-fixes-for-v5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
      
      - Two cleanup patches
        . use dev_get_drvdata for readability instead of platform_get_drvdata
        . remove redundant assignment to node.
      - Two fixup patches
        . fix undefined reference to 'vmf_insert_mixed' with NOMMU configuration.
        . fix potential infinite spin issue by decrementing 'retry' variable in
          scaler_reset function of exynos_drm_scaler.c
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      From: Inki Dae <inki.dae@samsung.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1564734791-745-1-git-send-email-inki.dae@samsung.com
      9c8c9c7c
    • Chris Wilson's avatar
      Revert "drm/vgem: fix cache synchronization on arm/arm64" · 63dc6e63
      Chris Wilson authored
      commit 7e9e5ead ("drm/vgem: fix cache synchronization on arm/arm64")
      broke all of the !llc i915-vgem coherency tests in CI, and left the HW
      very, very unhappy (which is even more scary).
      
      Fixes: 7e9e5ead ("drm/vgem: fix cache synchronization on arm/arm64")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Rob Clark <robdclark@chromium.org>
      Cc: Sean Paul <seanpaul@chromium.org>
      Acked-by: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190801124458.24949-1-chris@chris-wilson.co.uk
      63dc6e63
    • Daniel Vetter's avatar
      Merge tag 'drm-misc-fixes-2019-08-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 5fd5d2b7
      Daniel Vetter authored
      drm-misc-fixes for v5.3-rc3:
      - Fix some build errors in drm/bridge.
      - Do not build i810 on CONFIG_PREEMPTION.
      - Fix cache sync on arm in vgem.
      - Allow mapping fb in drm_client only when required, and use it to fix bochs fbdev.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/af0dc371-16e0-cee8-0d71-4824d44aa973@linux.intel.com
      5fd5d2b7
    • Vasily Gorbik's avatar
      s390/zcrypt: adjust switch fall through comments for -Wimplicit-fallthrough · 3cdd9860
      Vasily Gorbik authored
      Silence the following warnings when built with -Wimplicit-fallthrough=3
      enabled by default since 5.3-rc2:
      In file included from ./include/linux/preempt.h:11,
                       from ./include/linux/spinlock.h:51,
                       from ./include/linux/mmzone.h:8,
                       from ./include/linux/gfp.h:6,
                       from ./include/linux/slab.h:15,
                       from drivers/s390/crypto/ap_queue.c:13:
      drivers/s390/crypto/ap_queue.c: In function 'ap_sm_recv':
      ./include/linux/list.h:577:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
        577 |  for (pos = list_first_entry(head, typeof(*pos), member); \
            |  ^~~
      drivers/s390/crypto/ap_queue.c:147:3: note: in expansion of macro 'list_for_each_entry'
        147 |   list_for_each_entry(ap_msg, &aq->pendingq, list) {
            |   ^~~~~~~~~~~~~~~~~~~
      drivers/s390/crypto/ap_queue.c:155:2: note: here
        155 |  case AP_RESPONSE_NO_PENDING_REPLY:
            |  ^~~~
      drivers/s390/crypto/zcrypt_msgtype6.c: In function 'convert_response_ep11_xcrb':
      drivers/s390/crypto/zcrypt_msgtype6.c:871:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        871 |   if (msg->cprbx.cprb_ver_id == 0x04)
            |      ^
      drivers/s390/crypto/zcrypt_msgtype6.c:874:2: note: here
        874 |  default: /* Unknown response type, this should NEVER EVER happen */
            |  ^~~~~~~
      drivers/s390/crypto/zcrypt_msgtype6.c: In function 'convert_response_rng':
      drivers/s390/crypto/zcrypt_msgtype6.c:901:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        901 |   if (msg->cprbx.cprb_ver_id == 0x02)
            |      ^
      drivers/s390/crypto/zcrypt_msgtype6.c:907:2: note: here
        907 |  default: /* Unknown response type, this should NEVER EVER happen */
            |  ^~~~~~~
      drivers/s390/crypto/zcrypt_msgtype6.c: In function 'convert_response_xcrb':
      drivers/s390/crypto/zcrypt_msgtype6.c:838:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        838 |   if (msg->cprbx.cprb_ver_id == 0x02)
            |      ^
      drivers/s390/crypto/zcrypt_msgtype6.c:844:2: note: here
        844 |  default: /* Unknown response type, this should NEVER EVER happen */
            |  ^~~~~~~
      drivers/s390/crypto/zcrypt_msgtype6.c: In function 'convert_response_ica':
      drivers/s390/crypto/zcrypt_msgtype6.c:801:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
        801 |   if (msg->cprbx.cprb_ver_id == 0x02)
            |      ^
      drivers/s390/crypto/zcrypt_msgtype6.c:808:2: note: here
        808 |  default: /* Unknown response type, this should NEVER EVER happen */
            |  ^~~~~~~
      Acked-by: default avatarPatrick Steuer <patrick.steuer@de.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      3cdd9860
    • Masami Hiramatsu's avatar
      arm64: Make debug exception handlers visible from RCU · d8bb6718
      Masami Hiramatsu authored
      Make debug exceptions visible from RCU so that synchronize_rcu()
      correctly track the debug exception handler.
      
      This also introduces sanity checks for user-mode exceptions as same
      as x86's ist_enter()/ist_exit().
      
      The debug exception can interrupt in idle task. For example, it warns
      if we put a kprobe on a function called from idle task as below.
      The warning message showed that the rcu_read_lock() caused this
      problem. But actually, this means the RCU is lost the context which
      is already in NMI/IRQ.
      
        /sys/kernel/debug/tracing # echo p default_idle_call >> kprobe_events
        /sys/kernel/debug/tracing # echo 1 > events/kprobes/enable
        /sys/kernel/debug/tracing # [  135.122237]
        [  135.125035] =============================
        [  135.125310] WARNING: suspicious RCU usage
        [  135.125581] 5.2.0-08445-g9187c508bdc7 #20 Not tainted
        [  135.125904] -----------------------------
        [  135.126205] include/linux/rcupdate.h:594 rcu_read_lock() used illegally while idle!
        [  135.126839]
        [  135.126839] other info that might help us debug this:
        [  135.126839]
        [  135.127410]
        [  135.127410] RCU used illegally from idle CPU!
        [  135.127410] rcu_scheduler_active = 2, debug_locks = 1
        [  135.128114] RCU used illegally from extended quiescent state!
        [  135.128555] 1 lock held by swapper/0/0:
        [  135.128944]  #0: (____ptrval____) (rcu_read_lock){....}, at: call_break_hook+0x0/0x178
        [  135.130499]
        [  135.130499] stack backtrace:
        [  135.131192] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.2.0-08445-g9187c508bdc7 #20
        [  135.131841] Hardware name: linux,dummy-virt (DT)
        [  135.132224] Call trace:
        [  135.132491]  dump_backtrace+0x0/0x140
        [  135.132806]  show_stack+0x24/0x30
        [  135.133133]  dump_stack+0xc4/0x10c
        [  135.133726]  lockdep_rcu_suspicious+0xf8/0x108
        [  135.134171]  call_break_hook+0x170/0x178
        [  135.134486]  brk_handler+0x28/0x68
        [  135.134792]  do_debug_exception+0x90/0x150
        [  135.135051]  el1_dbg+0x18/0x8c
        [  135.135260]  default_idle_call+0x0/0x44
        [  135.135516]  cpu_startup_entry+0x2c/0x30
        [  135.135815]  rest_init+0x1b0/0x280
        [  135.136044]  arch_call_rest_init+0x14/0x1c
        [  135.136305]  start_kernel+0x4d4/0x500
        [  135.136597]
      
      So make debug exception visible to RCU can fix this warning.
      Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Acked-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      d8bb6718
    • Masami Hiramatsu's avatar
      arm64: kprobes: Recover pstate.D in single-step exception handler · b3980e48
      Masami Hiramatsu authored
      kprobes manipulates the interrupted PSTATE for single step, and
      doesn't restore it. Thus, if we put a kprobe where the pstate.D
      (debug) masked, the mask will be cleared after the kprobe hits.
      
      Moreover, in the most complicated case, this can lead a kernel
      crash with below message when a nested kprobe hits.
      
      [  152.118921] Unexpected kernel single-step exception at EL1
      
      When the 1st kprobe hits, do_debug_exception() will be called.
      At this point, debug exception (= pstate.D) must be masked (=1).
      But if another kprobes hits before single-step of the first kprobe
      (e.g. inside user pre_handler), it unmask the debug exception
      (pstate.D = 0) and return.
      Then, when the 1st kprobe setting up single-step, it saves current
      DAIF, mask DAIF, enable single-step, and restore DAIF.
      However, since "D" flag in DAIF is cleared by the 2nd kprobe, the
      single-step exception happens soon after restoring DAIF.
      
      This has been introduced by commit 7419333f ("arm64: kprobe:
      Always clear pstate.D in breakpoint exception handler")
      
      To solve this issue, this stores all DAIF bits and restore it
      after single stepping.
      Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Fixes: 7419333f ("arm64: kprobe: Always clear pstate.D in breakpoint exception handler")
      Reviewed-by: default avatarJames Morse <james.morse@arm.com>
      Tested-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      b3980e48
    • Daniel Vetter's avatar
      Merge tag 'drm-intel-fixes-2019-08-02' of... · ab35c8a5
      Daniel Vetter authored
      Merge tag 'drm-intel-fixes-2019-08-02' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      drm/i915 fixes for v5.3-rc3:
      - GVT fixes
      - Fix TBT aux powerwell
      - Fix PSR2 training pattern duration
      - Fix memory leak in runtime wakeref tracking
      - Fix ICL memory bandwidth issue preventing planes from being enabled
      - Fix OA mux configuration delays for accurate performance data
      - Fix VLV/CHV DP audio cdclk frequency requirements
      - Fix register whitelisting to fix a number of GL & Vulkan CTS tests
      - Fix ICL perf register offsets
      - Fix Gen11 Sampler Prefetch workaround, impacting dEQP tests
      - Fix various gen2 tracepoints
      - A number of GEM locking fixes addressing lockdep issues
      - Fix idle engine reset, recover only active engines
      - Fix incorrect MCR programming
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      From: Jani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/87d0hnncgo.fsf@intel.com
      ab35c8a5
    • Colin Ian King's avatar
      drm/exynos: fix missing decrement of retry counter · 1bbbab09
      Colin Ian King authored
      Currently the retry counter is not being decremented, leading to a
      potential infinite spin if the scalar_reads don't change state.
      
      Addresses-Coverity: ("Infinite loop")
      Fixes: 280e54c9 ("drm/exynos: scaler: Reset hardware before starting the operation")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
      1bbbab09
    • Arnd Bergmann's avatar
      drm/exynos: add CONFIG_MMU dependency · d6f25bd9
      Arnd Bergmann authored
      Compile-testing this driver on a NOMMU configuration shows a link failure:
      
      drivers/gpu/drm/exynos/exynos_drm_gem.o: In function `exynos_drm_gem_fault':
      exynos_drm_gem.c:(.text+0x484): undefined reference to `vmf_insert_mixed'
      
      Add a CONFIG_MMU dependency to ensure we only enable this in configurations
      that build correctly.
      
      Many other drm drivers have the same dependency. It would be nice to
      make this work in MMU-less configurations, but evidently nobody has
      ever needed this so far.
      
      Fixes: 156bdac9 ("drm/exynos: trigger build of all modules")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: default avatarInki Dae <daeinki@gmail.com>
      d6f25bd9
    • Colin Ian King's avatar
      drm/exynos: remove redundant assignment to pointer 'node' · 59d43174
      Colin Ian King authored
      The pointer 'node' is being assigned with a value that is never
      read and is re-assigned later. The assignment is redundant and
      can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarInki Dae <daeinki@gmail.com>
      59d43174
    • Fuqian Huang's avatar
      drm/exynos: using dev_get_drvdata directly · 9eae7c3b
      Fuqian Huang authored
      Several drivers cast a struct device pointer to a struct
      platform_device pointer only to then call platform_get_drvdata().
      To improve readability, these constructs can be simplified
      by using dev_get_drvdata() directly.
      Signed-off-by: default avatarFuqian Huang <huangfq.daxian@gmail.com>
      Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
      Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
      9eae7c3b
    • Stefan Haberland's avatar
      s390/dasd: fix endless loop after read unit address configuration · 41995342
      Stefan Haberland authored
      After getting a storage server event that causes the DASD device driver
      to update its unit address configuration during a device shutdown there is
      the possibility of an endless loop in the device driver.
      
      In the system log there will be ongoing DASD error messages with RC: -19.
      
      The reason is that the loop starting the ruac request only terminates when
      the retry counter is decreased to 0. But in the sleep_on function there are
      early exit paths that do not decrease the retry counter.
      
      Prevent an endless loop by handling those cases separately.
      
      Remove the unnecessary do..while loop since the sleep_on function takes
      care of retries by itself.
      
      Fixes: 8e09f215 ("[S390] dasd: add hyper PAV support to DASD device driver, part 1")
      Cc: stable@vger.kernel.org # 2.6.25+
      Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
      Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      41995342
    • Dave Airlie's avatar
      Merge tag 'msm-fixes-2019_08_01' of https://gitlab.freedesktop.org/drm/msm into drm-fixes · f8981e03
      Dave Airlie authored
      - Fix the dma_sync calls applied last week (Rob)
      - Fix mdp5 dsi command mode (Brian)
      - Squash fall through warnings (Jordan)
      - Don't add disabled gpu nodes to the of device list (Jeffrey)
      
      Cc: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
      Cc: Jordan Crouse <jcrouse@codeaurora.org>
      Cc: Brian Masney <masneyb@onstation.org>
      Cc: Rob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      # gpg: Signature made Fri 02 Aug 2019 05:54:27 AM AEST
      # gpg:                using RSA key 96F70DFDA84A070A
      # gpg: Can't check signature: public key not found
      From: Sean Paul <sean@poorly.run>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190801200439.GV104440@art_vandelay
      f8981e03
  3. 01 Aug, 2019 9 commits
    • Lyude Paul's avatar
      drm/nouveau: Only release VCPI slots on mode changes · 412e85b6
      Lyude Paul authored
      Looks like a regression got introduced into nv50_mstc_atomic_check()
      that somehow didn't get found until now. If userspace changes
      crtc_state->active to false but leaves the CRTC enabled, we end up
      calling drm_dp_atomic_find_vcpi_slots() using the PBN calculated in
      asyh->dp.pbn. However, if the display is inactive we end up calculating
      a PBN of 0, which inadvertently causes us to have an allocation of 0.
      >From there, if userspace then disables the CRTC afterwards we end up
      accidentally attempting to free the VCPI twice:
      
      WARNING: CPU: 0 PID: 1484 at drivers/gpu/drm/drm_dp_mst_topology.c:3336
      drm_dp_atomic_release_vcpi_slots+0x87/0xb0 [drm_kms_helper]
      RIP: 0010:drm_dp_atomic_release_vcpi_slots+0x87/0xb0 [drm_kms_helper]
      Call Trace:
       drm_atomic_helper_check_modeset+0x3f3/0xa60 [drm_kms_helper]
       ? drm_atomic_check_only+0x43/0x780 [drm]
       drm_atomic_helper_check+0x15/0x90 [drm_kms_helper]
       nv50_disp_atomic_check+0x83/0x1d0 [nouveau]
       drm_atomic_check_only+0x54d/0x780 [drm]
       ? drm_atomic_set_crtc_for_connector+0xec/0x100 [drm]
       drm_atomic_commit+0x13/0x50 [drm]
       drm_atomic_helper_set_config+0x81/0x90 [drm_kms_helper]
       drm_mode_setcrtc+0x194/0x6a0 [drm]
       ? vprintk_emit+0x16a/0x230
       ? drm_ioctl+0x163/0x390 [drm]
       ? drm_mode_getcrtc+0x180/0x180 [drm]
       drm_ioctl_kernel+0xaa/0xf0 [drm]
       drm_ioctl+0x208/0x390 [drm]
       ? drm_mode_getcrtc+0x180/0x180 [drm]
       nouveau_drm_ioctl+0x63/0xb0 [nouveau]
       do_vfs_ioctl+0x405/0x660
       ? recalc_sigpending+0x17/0x50
       ? _copy_from_user+0x37/0x60
       ksys_ioctl+0x5e/0x90
       ? exit_to_usermode_loop+0x92/0xe0
       __x64_sys_ioctl+0x16/0x20
       do_syscall_64+0x59/0x190
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      WARNING: CPU: 0 PID: 1484 at drivers/gpu/drm/drm_dp_mst_topology.c:3336
      drm_dp_atomic_release_vcpi_slots+0x87/0xb0 [drm_kms_helper]
      ---[ end trace 4c395c0c51b1f88d ]---
      [drm:drm_dp_atomic_release_vcpi_slots [drm_kms_helper]] *ERROR* no VCPI for
      [MST PORT:00000000e288eb7d] found in mst state 000000008e642070
      
      So, fix this by doing what we probably should have done from the start: only
      call drm_dp_atomic_find_vcpi_slots() when crtc_state->mode_changed is set, so
      that VCPI allocations remain for as long as the CRTC is enabled.
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Fixes: 232c9eec ("drm/nouveau: Use atomic VCPI helpers for MST")
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@redhat.com>
      Cc: Jerry Zuo <Jerry.Zuo@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Juston Li <juston.li@intel.com>
      Cc: Karol Herbst <karolherbst@gmail.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Ilia Mirkin <imirkin@alum.mit.edu>
      Cc: <stable@vger.kernel.org> # v5.1+
      Acked-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190801220216.15323-1-lyude@redhat.com
      412e85b6
    • Dave Airlie's avatar
      Merge tag 'drm-fixes-5.3-2019-07-31' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 4b381ee2
      Dave Airlie authored
      drm-fixes-5.3-2019-07-31:
      
      amdgpu:
      - Fix temperature granularity for navi
      - Fix stable pstate setting for navi
      - Fix VCN DPM enablement on navi
      - Fix error handling on CS ioctl when processing dependencies
      - Fix possible information leak in debugfs
      
      amdkfd:
      - fix memory alignment for VegaM
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190731191648.25729-1-alexander.deucher@amd.com
      4b381ee2
    • Rafael J. Wysocki's avatar
      ACPI: PM: Fix regression in acpi_device_set_power() · 42787ed7
      Rafael J. Wysocki authored
      Commit f850a48a ("ACPI: PM: Allow transitions to D0 to occur in
      special cases") overlooked the fact that acpi_power_transition() may
      change the power.state value for the target device and if that
      happens, it may confuse acpi_device_set_power() and cause it to
      omit the _PS0 evaluation which on some systems is necessary to
      change power states of devices from low-power to D0.
      
      Fix that by saving the current value of power.state for the
      target device before passing it to acpi_power_transition() and
      using the saved value in a subsequent check.
      
      Fixes: f850a48a ("ACPI: PM: Allow transitions to D0 to occur in special cases")
      Reported-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Reported-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      42787ed7
    • Damien Le Moal's avatar
      block: Fix __blkdev_direct_IO() for bio fragments · 0eb6ddfb
      Damien Le Moal authored
      The recent fix to properly handle IOCB_NOWAIT for async O_DIRECT IO
      (patch 6a43074e) introduced two problems with BIO fragment handling
      for direct IOs:
      1) The dio size processed is calculated by incrementing the ret variable
      by the size of the bio fragment issued for the dio. However, this size
      is obtained directly from bio->bi_iter.bi_size AFTER the bio submission
      which may result in referencing the bi_size value after the bio
      completed, resulting in an incorrect value use.
      2) The ret variable is not incremented by the size of the last bio
      fragment issued for the bio, leading to an invalid IO size being
      returned to the user.
      
      Fix both problem by using dio->size (which is incremented before the bio
      submission) to update the value of ret after bio submissions, including
      for the last bio fragment issued.
      
      Fixes: 6a43074e ("block: properly handle IOCB_NOWAIT for async O_DIRECT IO")
      Reported-by: default avatarMasato Suzuki <masato.suzuki@wdc.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0eb6ddfb
    • Wei Yongjun's avatar
      RDMA/hns: Fix error return code in hns_roce_v1_rsv_lp_qp() · 020fb3be
      Wei Yongjun authored
      Fix to return error code -ENOMEM from the rdma_zalloc_drv_obj() error
      handling case instead of 0, as done elsewhere in this function.
      
      Fixes: e8ac9389 ("RDMA: Fix allocation failure on pointer pd")
      Fixes: 21a428a0 ("RDMA: Handle PD allocations by IB/core")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190801012725.150493-1-weiyongjun1@huawei.comSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      020fb3be
    • Jeffrey Hugo's avatar
      drm: msm: Fix add_gpu_components · 9ca7ad6c
      Jeffrey Hugo authored
      add_gpu_components() adds found GPU nodes from the DT to the match list,
      regardless of the status of the nodes.  This is a problem, because if the
      nodes are disabled, they should not be on the match list because they will
      not be matched.  This prevents display from initing if a GPU node is
      defined, but it's status is disabled.
      
      Fix this by checking the node's status before adding it to the match list.
      
      Fixes: dc3ea265 (drm/msm: Drop the gpu binding)
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarJeffrey Hugo <jeffrey.l.hugo@gmail.com>
      Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190626180015.45242-1-jeffrey.l.hugo@gmail.com
      9ca7ad6c
    • Leon Romanovsky's avatar
      RDMA/mlx5: Release locks during notifier unregister · 23eaf3b5
      Leon Romanovsky authored
      The below kernel panic was observed when created bond mode LACP
      with GRE tunnel on top. The reason to it was not released spinlock
      during mlx5 notify unregsiter sequence.
      
      [  234.562007] BUG: scheduling while atomic: sh/10900/0x00000002
      [  234.563005] Preemption disabled at:
      [  234.566864] ------------[ cut here ]------------
      [  234.567120] DEBUG_LOCKS_WARN_ON(val > preempt_count())
      [  234.567139] WARNING: CPU: 16 PID: 10900 at kernel/sched/core.c:3203 preempt_count_sub+0xca/0x170
      [  234.569550] CPU: 16 PID: 10900 Comm: sh Tainted: G        W 5.2.0-rc1-for-linust-dbg-2019-05-25_04-57-33-60 #1
      [  234.569886] Hardware name: Dell Inc. PowerEdge R720/0X3D66, BIOS 2.6.1 02/12/2018
      [  234.570183] RIP: 0010:preempt_count_sub+0xca/0x170
      [  234.570404] Code: 03 38
      d0 7c 08 84 d2 0f 85 b0 00 00 00 8b 15 dd 02 03 04 85 d2 75 ba 48 c7 c6
      00 e1 88 83 48 c7 c7 40 e1 88 83 e8 76 11 f7 ff <0f> 0b 5b c3 65 8b 05
      d3 1f d8 7e 84 c0 75 82 e8 62 c3 c3 00 85 c0
      [  234.570911] RSP: 0018:ffff888b94477b08 EFLAGS: 00010286
      [  234.571133] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
      [  234.571391] RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000246
      [  234.571648] RBP: ffff888ba5560000 R08: fffffbfff08962d5 R09: fffffbfff08962d5
      [  234.571902] R10: 0000000000000001 R11: fffffbfff08962d4 R12: ffff888bac6e9548
      [  234.572157] R13: ffff888babfaf728 R14: ffff888bac6e9568 R15: ffff888babfaf750
      [  234.572412] FS: 00007fcafa59b740(0000) GS:ffff888bed200000(0000) knlGS:0000000000000000
      [  234.572686] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  234.572914] CR2: 00007f984f16b140 CR3: 0000000b2bf0a001 CR4: 00000000001606e0
      [  234.573172] Call Trace:
      [  234.573336] _raw_spin_unlock+0x2e/0x50
      [  234.573542] mlx5_ib_unbind_slave_port+0x1bc/0x690 [mlx5_ib]
      [  234.573793] mlx5_ib_cleanup_multiport_master+0x1d3/0x660 [mlx5_ib]
      [  234.574039] mlx5_ib_stage_init_cleanup+0x4c/0x360 [mlx5_ib]
      [  234.574271]  ? kfree+0xf5/0x2f0
      [  234.574465] __mlx5_ib_remove+0x61/0xd0 [mlx5_ib]
      [  234.574688]  ? __mlx5_ib_remove+0xd0/0xd0 [mlx5_ib]
      [  234.574951] mlx5_remove_device+0x234/0x300 [mlx5_core]
      [  234.575224] mlx5_unregister_device+0x4d/0x1e0 [mlx5_core]
      [  234.575493] remove_one+0x4f/0x160 [mlx5_core]
      [  234.575704] pci_device_remove+0xef/0x2a0
      [  234.581407]  ? pcibios_free_irq+0x10/0x10
      [  234.587143]  ? up_read+0xc1/0x260
      [  234.592785] device_release_driver_internal+0x1ab/0x430
      [  234.598442] unbind_store+0x152/0x200
      [  234.604064]  ? sysfs_kf_write+0x3b/0x180
      [  234.609441]  ? sysfs_file_ops+0x160/0x160
      [  234.615021] kernfs_fop_write+0x277/0x440
      [  234.620288]  ? __sb_start_write+0x1ef/0x2c0
      [  234.625512] vfs_write+0x15e/0x460
      [  234.630786] ksys_write+0x156/0x1e0
      [  234.635988]  ? __ia32_sys_read+0xb0/0xb0
      [  234.641120]  ? trace_hardirqs_off_thunk+0x1a/0x1c
      [  234.646163] do_syscall_64+0x95/0x470
      [  234.651106] entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [  234.656004] RIP: 0033:0x7fcaf9c9cfd0
      [  234.660686] Code: 73 01
      c3 48 8b 0d c0 6e 2d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00
      83 3d cd cf 2d 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73
      31 c3 48 83 ec 08 e8 ee cb 01 00 48 89 04 24
      [  234.670128] RSP: 002b:00007ffd3b01ddd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [  234.674811] RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007fcaf9c9cfd0
      [  234.679387] RDX: 000000000000000d RSI: 00007fcafa5c1000 RDI: 0000000000000001
      [  234.683848] RBP: 00007fcafa5c1000 R08: 000000000000000a R09: 00007fcafa59b740
      [  234.688167] R10: 00007ffd3b01d8e0 R11: 0000000000000246 R12: 00007fcaf9f75400
      [  234.692386] R13: 000000000000000d R14: 0000000000000001 R15: 0000000000000000
      [  234.696495] irq event stamp: 153067
      [  234.700525] hardirqs last enabled at (153067): [<ffffffff83258c39>] _raw_spin_unlock_irqrestore+0x59/0x70
      [  234.704665] hardirqs last disabled at (153066): [<ffffffff83259382>] _raw_spin_lock_irqsave+0x22/0x90
      [  234.708722] softirqs last enabled at (153058): [<ffffffff836006c5>] __do_softirq+0x6c5/0xb4e
      [  234.712673] softirqs last disabled at (153051): [<ffffffff81227c1d>] irq_exit+0x17d/0x1d0
      [  234.716601] ---[ end trace 5dbf096843ee9ce6 ]---
      
      Fixes: df097a27 ("IB/mlx5: Use the new mlx5 core notifier API")
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190731083852.584-1-leon@kernel.orgSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      23eaf3b5
    • Gustavo A. R. Silva's avatar
      IB/hfi1: Fix Spectre v1 vulnerability · 6497d0a9
      Gustavo A. R. Silva authored
      sl is controlled by user-space, hence leading to a potential
      exploitation of the Spectre variant 1 vulnerability.
      
      Fix this by sanitizing sl before using it to index ibp->sl_to_sc.
      
      Notice that given that speculation windows are large, the policy is
      to kill the speculation on the first load and not worry if it can be
      completed with a dependent load/store [1].
      
      [1] https://lore.kernel.org/lkml/20180423164740.GY17484@dhcp22.suse.cz/
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Link: https://lore.kernel.org/r/20190731175428.GA16736@embeddedorSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      6497d0a9
    • Jack Morgenstein's avatar
      IB/mad: Fix use-after-free in ib mad completion handling · 770b7d96
      Jack Morgenstein authored
      We encountered a use-after-free bug when unloading the driver:
      
      [ 3562.116059] BUG: KASAN: use-after-free in ib_mad_post_receive_mads+0xddc/0xed0 [ib_core]
      [ 3562.117233] Read of size 4 at addr ffff8882ca5aa868 by task kworker/u13:2/23862
      [ 3562.118385]
      [ 3562.119519] CPU: 2 PID: 23862 Comm: kworker/u13:2 Tainted: G           OE     5.1.0-for-upstream-dbg-2019-05-19_16-44-30-13 #1
      [ 3562.121806] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu2 04/01/2014
      [ 3562.123075] Workqueue: ib-comp-unb-wq ib_cq_poll_work [ib_core]
      [ 3562.124383] Call Trace:
      [ 3562.125640]  dump_stack+0x9a/0xeb
      [ 3562.126911]  print_address_description+0xe3/0x2e0
      [ 3562.128223]  ? ib_mad_post_receive_mads+0xddc/0xed0 [ib_core]
      [ 3562.129545]  __kasan_report+0x15c/0x1df
      [ 3562.130866]  ? ib_mad_post_receive_mads+0xddc/0xed0 [ib_core]
      [ 3562.132174]  kasan_report+0xe/0x20
      [ 3562.133514]  ib_mad_post_receive_mads+0xddc/0xed0 [ib_core]
      [ 3562.134835]  ? find_mad_agent+0xa00/0xa00 [ib_core]
      [ 3562.136158]  ? qlist_free_all+0x51/0xb0
      [ 3562.137498]  ? mlx4_ib_sqp_comp_worker+0x1970/0x1970 [mlx4_ib]
      [ 3562.138833]  ? quarantine_reduce+0x1fa/0x270
      [ 3562.140171]  ? kasan_unpoison_shadow+0x30/0x40
      [ 3562.141522]  ib_mad_recv_done+0xdf6/0x3000 [ib_core]
      [ 3562.142880]  ? _raw_spin_unlock_irqrestore+0x46/0x70
      [ 3562.144277]  ? ib_mad_send_done+0x1810/0x1810 [ib_core]
      [ 3562.145649]  ? mlx4_ib_destroy_cq+0x2a0/0x2a0 [mlx4_ib]
      [ 3562.147008]  ? _raw_spin_unlock_irqrestore+0x46/0x70
      [ 3562.148380]  ? debug_object_deactivate+0x2b9/0x4a0
      [ 3562.149814]  __ib_process_cq+0xe2/0x1d0 [ib_core]
      [ 3562.151195]  ib_cq_poll_work+0x45/0xf0 [ib_core]
      [ 3562.152577]  process_one_work+0x90c/0x1860
      [ 3562.153959]  ? pwq_dec_nr_in_flight+0x320/0x320
      [ 3562.155320]  worker_thread+0x87/0xbb0
      [ 3562.156687]  ? __kthread_parkme+0xb6/0x180
      [ 3562.158058]  ? process_one_work+0x1860/0x1860
      [ 3562.159429]  kthread+0x320/0x3e0
      [ 3562.161391]  ? kthread_park+0x120/0x120
      [ 3562.162744]  ret_from_fork+0x24/0x30
      ...
      [ 3562.187615] Freed by task 31682:
      [ 3562.188602]  save_stack+0x19/0x80
      [ 3562.189586]  __kasan_slab_free+0x11d/0x160
      [ 3562.190571]  kfree+0xf5/0x2f0
      [ 3562.191552]  ib_mad_port_close+0x200/0x380 [ib_core]
      [ 3562.192538]  ib_mad_remove_device+0xf0/0x230 [ib_core]
      [ 3562.193538]  remove_client_context+0xa6/0xe0 [ib_core]
      [ 3562.194514]  disable_device+0x14e/0x260 [ib_core]
      [ 3562.195488]  __ib_unregister_device+0x79/0x150 [ib_core]
      [ 3562.196462]  ib_unregister_device+0x21/0x30 [ib_core]
      [ 3562.197439]  mlx4_ib_remove+0x162/0x690 [mlx4_ib]
      [ 3562.198408]  mlx4_remove_device+0x204/0x2c0 [mlx4_core]
      [ 3562.199381]  mlx4_unregister_interface+0x49/0x1d0 [mlx4_core]
      [ 3562.200356]  mlx4_ib_cleanup+0xc/0x1d [mlx4_ib]
      [ 3562.201329]  __x64_sys_delete_module+0x2d2/0x400
      [ 3562.202288]  do_syscall_64+0x95/0x470
      [ 3562.203277]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      The problem was that the MAD PD was deallocated before the MAD CQ.
      There was completion work pending for the CQ when the PD got deallocated.
      When the mad completion handling reached procedure
      ib_mad_post_receive_mads(), we got a use-after-free bug in the following
      line of code in that procedure:
         sg_list.lkey = qp_info->port_priv->pd->local_dma_lkey;
      (the pd pointer in the above line is no longer valid, because the
      pd has been deallocated).
      
      We fix this by allocating the PD before the CQ in procedure
      ib_mad_port_open(), and deallocating the PD after freeing the CQ
      in procedure ib_mad_port_close().
      
      Since the CQ completion work queue is flushed during ib_free_cq(),
      no completions will be pending for that CQ when the PD is later
      deallocated.
      
      Note that freeing the CQ before deallocating the PD is the practice
      in the ULPs.
      
      Fixes: 4be90bc6 ("IB/mad: Remove ib_get_dma_mr calls")
      Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Link: https://lore.kernel.org/r/20190801121449.24973-1-leon@kernel.orgSigned-off-by: default avatarDoug Ledford <dledford@redhat.com>
      770b7d96