1. 23 May, 2024 1 commit
  2. 22 May, 2024 2 commits
  3. 20 May, 2024 2 commits
    • Lang Yu's avatar
      drm/amdkfd: Let VRAM allocations go to GTT domain on small APUs · eb853413
      Lang Yu authored
      Small APUs(i.e., consumer, embedded products) usually have a small
      carveout device memory which can't satisfy most compute workloads
      memory allocation requirements.
      
      We can't even run a Basic MNIST Example with a default 512MB carveout.
      https://github.com/pytorch/examples/tree/main/mnist. Error Log:
      
      "torch.cuda.OutOfMemoryError: HIP out of memory. Tried to allocate
      84.00 MiB. GPU 0 has a total capacity of 512.00 MiB of which 0 bytes
      is free. Of the allocated memory 103.83 MiB is allocated by PyTorch,
      and 22.17 MiB is reserved by PyTorch but unallocated"
      
      Though we can change BIOS settings to enlarge carveout size,
      which is inflexible and may bring complaint. On the other hand,
      the memory resource can't be effectively used between host and device.
      
      The solution is MI300A approach, i.e., let VRAM allocations go to GTT.
      Then device and host can flexibly and effectively share memory resource.
      
      v2: Report local_mem_size_private as 0. (Felix)
      Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
      Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      eb853413
    • Lang Yu's avatar
      drm/amdkfd: handle duplicate BOs in reserve_bo_and_cond_vms · 2a705f3e
      Lang Yu authored
      Observed on gfx8 ASIC where KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM is used.
      Two attachments use the same VM, root PD would be locked twice.
      
      [   57.910418] Call Trace:
      [   57.793726]  ? reserve_bo_and_cond_vms+0x111/0x1c0 [amdgpu]
      [   57.793820]  amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu+0x6c/0x1c0 [amdgpu]
      [   57.793923]  ? idr_get_next_ul+0xbe/0x100
      [   57.793933]  kfd_process_device_free_bos+0x7e/0xf0 [amdgpu]
      [   57.794041]  kfd_process_wq_release+0x2ae/0x3c0 [amdgpu]
      [   57.794141]  ? process_scheduled_works+0x29c/0x580
      [   57.794147]  process_scheduled_works+0x303/0x580
      [   57.794157]  ? __pfx_worker_thread+0x10/0x10
      [   57.794160]  worker_thread+0x1a2/0x370
      [   57.794165]  ? __pfx_worker_thread+0x10/0x10
      [   57.794167]  kthread+0x11b/0x150
      [   57.794172]  ? __pfx_kthread+0x10/0x10
      [   57.794177]  ret_from_fork+0x3d/0x60
      [   57.794181]  ? __pfx_kthread+0x10/0x10
      [   57.794184]  ret_from_fork_asm+0x1b/0x30
      Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
      Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      2a705f3e
  4. 19 May, 2024 1 commit
  5. 16 May, 2024 2 commits
  6. 13 May, 2024 10 commits
  7. 10 May, 2024 3 commits
  8. 09 May, 2024 2 commits
  9. 08 May, 2024 2 commits
  10. 07 May, 2024 2 commits
  11. 05 May, 2024 2 commits
  12. 04 May, 2024 8 commits
  13. 03 May, 2024 1 commit
  14. 02 May, 2024 2 commits
    • Sean Anderson's avatar
      drm: zynqmp_dpsub: Always register bridge · be3f3042
      Sean Anderson authored
      We must always register the DRM bridge, since zynqmp_dp_hpd_work_func
      calls drm_bridge_hpd_notify, which in turn expects hpd_mutex to be
      initialized. We do this before zynqmp_dpsub_drm_init since that calls
      drm_bridge_attach. This fixes the following lockdep warning:
      
      [   19.217084] ------------[ cut here ]------------
      [   19.227530] DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      [   19.227768] WARNING: CPU: 0 PID: 140 at kernel/locking/mutex.c:582 __mutex_lock+0x4bc/0x550
      [   19.241696] Modules linked in:
      [   19.244937] CPU: 0 PID: 140 Comm: kworker/0:4 Not tainted 6.6.20+ #96
      [   19.252046] Hardware name: xlnx,zynqmp (DT)
      [   19.256421] Workqueue: events zynqmp_dp_hpd_work_func
      [   19.261795] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   19.269104] pc : __mutex_lock+0x4bc/0x550
      [   19.273364] lr : __mutex_lock+0x4bc/0x550
      [   19.277592] sp : ffffffc085c5bbe0
      [   19.281066] x29: ffffffc085c5bbe0 x28: 0000000000000000 x27: ffffff88009417f8
      [   19.288624] x26: ffffff8800941788 x25: ffffff8800020008 x24: ffffffc082aa3000
      [   19.296227] x23: ffffffc080d90e3c x22: 0000000000000002 x21: 0000000000000000
      [   19.303744] x20: 0000000000000000 x19: ffffff88002f5210 x18: 0000000000000000
      [   19.311295] x17: 6c707369642e3030 x16: 3030613464662072 x15: 0720072007200720
      [   19.318922] x14: 0000000000000000 x13: 284e4f5f4e524157 x12: 0000000000000001
      [   19.326442] x11: 0001ffc085c5b940 x10: 0001ff88003f388b x9 : 0001ff88003f3888
      [   19.334003] x8 : 0001ff88003f3888 x7 : 0000000000000000 x6 : 0000000000000000
      [   19.341537] x5 : 0000000000000000 x4 : 0000000000001668 x3 : 0000000000000000
      [   19.349054] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff88003f3880
      [   19.356581] Call trace:
      [   19.359160]  __mutex_lock+0x4bc/0x550
      [   19.363032]  mutex_lock_nested+0x24/0x30
      [   19.367187]  drm_bridge_hpd_notify+0x2c/0x6c
      [   19.371698]  zynqmp_dp_hpd_work_func+0x44/0x54
      [   19.376364]  process_one_work+0x3ac/0x988
      [   19.380660]  worker_thread+0x398/0x694
      [   19.384736]  kthread+0x1bc/0x1c0
      [   19.388241]  ret_from_fork+0x10/0x20
      [   19.392031] irq event stamp: 183
      [   19.395450] hardirqs last  enabled at (183): [<ffffffc0800b9278>] finish_task_switch.isra.0+0xa8/0x2d4
      [   19.405140] hardirqs last disabled at (182): [<ffffffc081ad3754>] __schedule+0x714/0xd04
      [   19.413612] softirqs last  enabled at (114): [<ffffffc080133de8>] srcu_invoke_callbacks+0x158/0x23c
      [   19.423128] softirqs last disabled at (110): [<ffffffc080133de8>] srcu_invoke_callbacks+0x158/0x23c
      [   19.432614] ---[ end trace 0000000000000000 ]---
      
      Fixes: eb2d64bf ("drm: xlnx: zynqmp_dpsub: Report HPD through the bridge")
      Signed-off-by: default avatarSean Anderson <sean.anderson@linux.dev>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240308204741.3631919-1-sean.anderson@linux.dev
      (cherry picked from commit 61ba791c)
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      be3f3042
    • Luca Ceresoli's avatar
      Revert "drm/bridge: ti-sn65dsi83: Fix enable error path" · ad81feb5
      Luca Ceresoli authored
      This reverts commit 8a91b29f.
      
      The regulator_disable() added by the original commit solves one kind of
      regulator imbalance but adds another one as it allows the regulator to be
      disabled one more time than it is enabled in the following scenario:
      
       1. Start video pipeline -> sn65dsi83_atomic_pre_enable -> regulator_enable
       2. PLL lock fails -> regulator_disable
       3. Stop video pipeline -> sn65dsi83_atomic_disable -> regulator_disable
      
      The reason is clear from the code flow, which looks like this (after
      removing unrelated code):
      
        static void sn65dsi83_atomic_pre_enable()
        {
            regulator_enable(ctx->vcc);
      
            if (PLL failed locking) {
                regulator_disable(ctx->vcc);  <---- added by patch being reverted
                return;
            }
        }
      
        static void sn65dsi83_atomic_disable()
        {
            regulator_disable(ctx->vcc);
        }
      
      The use case for introducing the additional regulator_disable() was
      removing the module for debugging (see link below for the discussion). If
      the module is removed after a .atomic_pre_enable, i.e. with an active
      pipeline from the DRM point of view, .atomic_disable is not called and thus
      the regulator would not be disabled.
      
      According to the discussion however there is no actual use case for
      removing the module with an active pipeline, except for
      debugging/development.
      
      On the other hand, the occurrence of a PLL lock failure is possible due to
      any physical reason (e.g. a temporary hardware failure for electrical
      reasons) so handling it gracefully should be supported. As there is no way
      for .atomic[_pre]_enable to report an error to the core, the only clean way
      to support it is calling regulator_disabled() only in .atomic_disable,
      unconditionally, as it was before.
      
      Link: https://lore.kernel.org/all/15244220.uLZWGnKmhe@steina-w/
      Fixes: 8a91b29f ("drm/bridge: ti-sn65dsi83: Fix enable error path")
      Reviewed-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
      Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Signed-off-by: default avatarRobert Foss <rfoss@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240426122259.46808-1-luca.ceresoli@bootlin.com
      (cherry picked from commit 2940ee03)
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      ad81feb5