1. 04 Sep, 2019 1 commit
  2. 30 Aug, 2019 8 commits
  3. 28 Aug, 2019 5 commits
    • Rob Herring's avatar
      drm/panfrost: Use mutex_trylock in panfrost_gem_purge · 55b9a054
      Rob Herring authored
      Lockdep reports a circular locking dependency with pages_lock taken in
      the shrinker callback. The deadlock can't actually happen with current
      users at least as a BO will never be purgeable when pages_lock is held.
      To be safe, let's use mutex_trylock() instead and bail if a BO is locked
      already.
      
      Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Acked-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823021216.5862-7-robh@kernel.org
      55b9a054
    • Rob Herring's avatar
      drm/shmem: Use mutex_trylock in drm_gem_shmem_purge · edbd7f31
      Rob Herring authored
      Lockdep reports a circular locking dependency with pages_lock taken in
      the shrinker callback. The deadlock can't actually happen with current
      users at least as a BO will never be purgeable when pages_lock is held.
      To be safe, let's use mutex_trylock() instead and bail if a BO is locked
      already.
      
      WARNING: possible circular locking dependency detected
      5.3.0-rc1+ #100 Tainted: G             L
      ------------------------------------------------------
      kswapd0/171 is trying to acquire lock:
      000000009b9823fd (&shmem->pages_lock){+.+.}, at: drm_gem_shmem_purge+0x20/0x40
      
      but task is already holding lock:
      00000000f82369b6 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x40
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (fs_reclaim){+.+.}:
             fs_reclaim_acquire.part.18+0x34/0x40
             fs_reclaim_acquire+0x20/0x28
             __kmalloc_node+0x6c/0x4c0
             kvmalloc_node+0x38/0xa8
             drm_gem_get_pages+0x80/0x1d0
             drm_gem_shmem_get_pages+0x58/0xa0
             drm_gem_shmem_get_pages_sgt+0x48/0xd0
             panfrost_mmu_map+0x38/0xf8 [panfrost]
             panfrost_gem_open+0xc0/0xe8 [panfrost]
             drm_gem_handle_create_tail+0xe8/0x198
             drm_gem_handle_create+0x3c/0x50
             panfrost_gem_create_with_handle+0x70/0xa0 [panfrost]
             panfrost_ioctl_create_bo+0x48/0x80 [panfrost]
             drm_ioctl_kernel+0xb8/0x110
             drm_ioctl+0x244/0x3f0
             do_vfs_ioctl+0xbc/0x910
             ksys_ioctl+0x78/0xa8
             __arm64_sys_ioctl+0x1c/0x28
             el0_svc_common.constprop.0+0x90/0x168
             el0_svc_handler+0x28/0x78
             el0_svc+0x8/0xc
      
      -> #0 (&shmem->pages_lock){+.+.}:
             __lock_acquire+0xa2c/0x1d70
             lock_acquire+0xdc/0x228
             __mutex_lock+0x8c/0x800
             mutex_lock_nested+0x1c/0x28
             drm_gem_shmem_purge+0x20/0x40
             panfrost_gem_shrinker_scan+0xc0/0x180 [panfrost]
             do_shrink_slab+0x208/0x500
             shrink_slab+0x10c/0x2c0
             shrink_node+0x28c/0x4d8
             balance_pgdat+0x2c8/0x570
             kswapd+0x22c/0x638
             kthread+0x128/0x130
             ret_from_fork+0x10/0x18
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(fs_reclaim);
                                     lock(&shmem->pages_lock);
                                     lock(fs_reclaim);
        lock(&shmem->pages_lock);
      
       *** DEADLOCK ***
      
      3 locks held by kswapd0/171:
       #0: 00000000f82369b6 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x40
       #1: 00000000ceb37808 (shrinker_rwsem){++++}, at: shrink_slab+0xbc/0x2c0
       #2: 00000000f31efa81 (&pfdev->shrinker_lock){+.+.}, at: panfrost_gem_shrinker_scan+0x34/0x180 [panfrost]
      
      Fixes: 17acb9f3 ("drm/shmem: Add madvise state and purge helpers")
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Acked-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823021216.5862-6-robh@kernel.org
      edbd7f31
    • Rob Herring's avatar
      drm/shmem: Do dma_unmap_sg before purging pages · fe20d1cc
      Rob Herring authored
      Calling dma_unmap_sg() in drm_gem_shmem_free_object() is too late if the
      backing pages have already been released by the shrinker. The result is
      the following abort:
      
      Unable to handle kernel paging request at virtual address ffff8000098ed000
      Mem abort info:
        ESR = 0x96000147
        Exception class = DABT (current EL), IL = 32 bits
        SET = 0, FnV = 0
        EA = 0, S1PTW = 0
      Data abort info:
        ISV = 0, ISS = 0x00000147
        CM = 1, WnR = 1
      swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000002f51000
      [ffff8000098ed000] pgd=00000000401f8003, pud=00000000401f7003, pmd=00000000401b1003, pte=00e80000098ed712
      Internal error: Oops: 96000147 [#1] SMP
      Modules linked in: panfrost gpu_sched
      CPU: 5 PID: 902 Comm: gnome-shell Not tainted 5.3.0-rc1+ #95
      Hardware name: 96boards Rock960 (DT)
      pstate: 40000005 (nZcv daif -PAN -UAO)
      pc : __dma_inv_area+0x40/0x58
      lr : arch_sync_dma_for_cpu+0x28/0x30
      sp : ffff00001321ba30
      x29: ffff00001321ba30 x28: ffff00001321bd08
      x27: 0000000000000000 x26: 0000000000000009
      x25: 0000ffffc1f86170 x24: 0000000000000000
      x23: 0000000000000000 x22: 0000000000000000
      x21: 0000000000021000 x20: ffff80003bb2d810
      x19: 00000000098ed000 x18: 0000000000000000
      x17: 0000000000000000 x16: ffff800023fd9480
      x15: 0000000000000000 x14: 0000000000000000
      x13: 0000000000000000 x12: 0000000000000000
      x11: 00000000fffb9fff x10: 0000000000000000
      x9 : 0000000000000000 x8 : ffff800023fd9c18
      x7 : 0000000000000000 x6 : 00000000ffffffff
      x5 : 0000000000000000 x4 : 0000000000021000
      Purging 5693440 bytes
      x3 : 000000000000003f x2 : 0000000000000040
      x1 : ffff80000990e000 x0 : ffff8000098ed000
      Call trace:
       __dma_inv_area+0x40/0x58
       dma_direct_sync_single_for_cpu+0x7c/0x80
       dma_direct_unmap_page+0x80/0x88
       dma_direct_unmap_sg+0x54/0x80
       drm_gem_shmem_free_object+0xfc/0x108
       panfrost_gem_free_object+0x118/0x128 [panfrost]
       drm_gem_object_free+0x18/0x90
       drm_gem_object_put_unlocked+0x58/0x80
       drm_gem_object_handle_put_unlocked+0x64/0xb0
       drm_gem_object_release_handle+0x70/0x98
       drm_gem_handle_delete+0x64/0xb0
       drm_gem_close_ioctl+0x28/0x38
       drm_ioctl_kernel+0xb8/0x110
       drm_ioctl+0x244/0x3f0
       do_vfs_ioctl+0xbc/0x910
       ksys_ioctl+0x78/0xa8
       __arm64_sys_ioctl+0x1c/0x28
       el0_svc_common.constprop.0+0x88/0x150
       el0_svc_handler+0x28/0x78
       el0_svc+0x8/0xc
       Code: 8a230000 54000060 d50b7e20 14000002 (d5087620)
      
      Fixes: 17acb9f3 ("drm/shmem: Add madvise state and purge helpers")
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823021216.5862-5-robh@kernel.org
      fe20d1cc
    • Rob Herring's avatar
      drm/panfrost: Fix possible suspend in panfrost_remove · aebe8c22
      Rob Herring authored
      Calls to panfrost_device_fini() access the h/w, but we already done a
      pm_runtime_put_sync_autosuspend() beforehand. This only works if the
      autosuspend delay is long enough. A 0ms delay will hang the system when
      removing the device. Fix this by moving the pm_runtime_put_sync_suspend()
      after the panfrost_device_fini() call.
      
      Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Acked-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823021216.5862-2-robh@kernel.org
      aebe8c22
    • Steven Price's avatar
      drm/panfrost: Add missing check for pfdev->regulator · c90f3081
      Steven Price authored
      When modifying panfrost_devfreq_target() to support a device without a
      regulator defined I missed the check on the error path. Let's add it.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Fixes: e21dd290 ("drm/panfrost: Enable devfreq to work without regulator")
      Signed-off-by: default avatarSteven Price <steven.price@arm.com>
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190822093218.26014-1-steven.price@arm.com
      c90f3081
  4. 27 Aug, 2019 5 commits
    • Dave Airlie's avatar
      Merge tag 'drm-next-5.4-2019-08-23' of git://people.freedesktop.org/~agd5f/linux into drm-next · 578d2342
      Dave Airlie authored
      drm-next-5.4-2019-08-23:
      
      amdgpu:
      - Enable power features on Navi12
      - Enable power features on Arcturus
      - RAS updates
      - Initial Renoir APU support
      - Enable power featyres on Renoir
      - DC gamma fixes
      - DCN2 fixes
      - GPU reset support for Picasso
      - Misc cleanups and fixes
      
      scheduler:
      - Possible race fix
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823202620.3870-1-alexander.deucher@amd.com
      578d2342
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-2019-08-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-next · c8723711
      Dave Airlie authored
      drm-misc-next for 5.4:
      
      UAPI Changes:
      
      Cross-subsystem Changes:
      
      Core Changes:
        - dma-buf: dma-fence selftests
      
      Driver Changes:
        - kirin: Various cleanups and reworks
        - komeda: Add support for DT memory-regions
        - meson: Rely on the compatible to detect vpu features
        - omap: Implement alpha and pixel blend mode properties
        - panfrost: Implement per-fd address spaces, various fixes
        - rockchip: DSI DT binding rework
        - fbdev: Various cleanups
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <maxime.ripard@bootlin.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823083509.c7mduqdqjnxc7ubb@flea
      c8723711
    • Dave Airlie's avatar
      Merge tag 'drm-hisilicon-hibmc-next-2019-08-26' of https://github.com/xin3liang/linux into drm-next · 8c973fb6
      Dave Airlie authored
      Three small cleanup and fix patches for 5.4 hisilicon hibmc driver.
      I have tested and verified on taishan 2280v1/v2 machines.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: xinliang <z.liuxinliang@hisilicon.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/5D63A271.7080400@hisilicon.com
      8c973fb6
    • Dave Airlie's avatar
      Merge tag 'imx-drm-next-2019-08-23' of git://git.pengutronix.de/pza/linux into drm-next · 2467d946
      Dave Airlie authored
      drm/imx: IPUv3 image converter fixes and improvements
      
      Fix image converter seam handling for 1024x1024 pixel hardware
      limitation at the main processing section input, improve error
      handling, and slightly optimize for 1:1 conversions.
      Add support for newly defined 32-bit RGB V4L2 pixel formats.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Philipp Zabel <p.zabel@pengutronix.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/1566573659.23587.2.camel@pengutronix.de
      2467d946
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2019-08-22' of git://anongit.freedesktop.org/drm/drm-intel into drm-next · 29d9d76a
      Dave Airlie authored
      - More TGL enabling work (Michel, Jose, Lucas)
      - Fixes on DP MST (Ville)
      - More GTT and Execlists fixes and improvements (Chris)
      - Code style clean-up on hdmi and dp side (Jani)
      - Fix null pointer dereferrence (Xiong)
      - Fix a couple of missing serialization on selftests (Chris)
      - More vm locking rework (Chris)
      
      drm-intel-next-2019-08-20:
      - GuC and HuC related fixes and improvements (Daniele, Michal)
      - Improve debug with more engine information and rework on debugfs files (Chris, Stuart)
      - Simplify appearture address handling (Chris)
      - Other fixes and cleanups around engines and execlists (Chris)
      - Selftests fixes (Matt, Chris)
      - Gen11 cache flush related fixes and improvements (Mika)
      - More work around requests, timelines and locks to allow removal of struct_mutex (Chris)
      - Add missing CML PCI ID (Anusha)
      - More work on the new i915 buddy allocator (Matt)
      - More headers, files and directories reorg (Daniele)
      - Improvements on ggtt’s get pdp (Mika)
      - Fix GPU reset (Chris)
      - Fix GPIO pins on gen11 (Matt)
      - Fix HW readout for crtc_clock in HDMI mode (Imre)
      - Sanitize display Phy during unitit to workaround messages of HW state change during suspend (Imre)
      - Be defensive when starting vma activity (Chris)
      - More Tiger Lake enabling work (Michel, Daniele, Lucas)
      - Relax pd_used assertion (Chris)
      
      drm-intel-next-2019-08-13:
      - More Tiger Lake enabling work (Lucas, Jose, Tomasz, Michel, Jordan, Anusha, Vandita)
      - More selftest organization reworks, fixes and improvements (Lucas, Chris)
      - Simplifications on GEM code like context and cleanup_early (Chris, Daniele)
      - GuC and HuC related fixes and improvements (Daniele, Michal, Chris)
      - Some clean up and fixes on headers, Makefile, and generated files (Lucas, Jani)
      - MOCS setup clean up (Tvrtko)
      - More Elkhartlake enabling work (Jose, Matt)
      - Fix engine reset by clearing in flight execlists requests (Chris)
      - Fix possible memory leak on intel_hdcp_auth_downstream (Wei)
      - Introduce intel_gt_runtime_suspend/resume (Daniele)
      - PMU improvements (Tvrtko)
      - Flush extra hard after writing relocations through the GTT (Chris)
      - Documentations fixes (Michal, Chris)
      - Report dma_reserv allocation failure (Chris)
      - Improvements around shrinker (Chris)
      - More improvements around engine handling (Chris)
      - Also more s/dev_priv/i915 (Chris)
      - Abstract display suspend/resume operations (Rodrigo/Jani)
      - Drop VM_IO from GTT mappings (Chris)
      - Fix some NULL vs IS_ERR conditions (Dan)
      - General improvements on error state (Chris)
      - Isolate i915_getparam_iocrtl to its own file (Chris)
      - Perf OA object refactor (Umesh)
      - Ignore central i915->kernel_context and allocate it directly (Chris)
      - More fixes and improvements around wakerefs (Chris)
      - Clean-up and improvements around debugfs (Chris)
      - Free the imported shmemfs file for phys objects (Chris)
      - Many other fix and cleanups around engines and execlists (Chris)
      - Split out uncore_mmio_debug (Daniele)
      - Memory management fixes for blk and gtt (Matt)
      - Introduction of buddy allocator to handle huge-pages for GTT (Matt)
      - Fix ICL and TGL PG3 power domains (Anshuman)
      - Extract GT IRQ to gt/ (Andi)
      - Drop last_fence tracking in favor of whole vma->active (Chris)
      - Make overlay to use i915_active instead of i915_active_request (Chris)
      - Move misc display IRQ handling to its own function (Jose)
      - Introduce new _TRANS2() macro in preparation for some coming PSR related work (Jose)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190823051435.GA23885@intel.com
      29d9d76a
  5. 26 Aug, 2019 3 commits
  6. 23 Aug, 2019 18 commits