Skip to content

Commit 3e21385

Browse files
committed
Merge tag 'amd-drm-next-6.20-2026-02-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.20-2026-02-13: amdgpu: - SMU 13.x fixes - DC resume lag fix - MPO fixes - DCN 3.6 fix - VSDB fixes - HWSS clean up - Replay fixes - DCE cursor fixes - DCN 3.5 SR DDR5 latency fixes - HPD fixes - Error path unwind fixes - SMU13/14 mode1 reset fixes - PSP 15 updates - SMU 15 updates - RAS fixes - Sync fix in amdgpu_dma_buf_move_notify() - HAINAN fix - PSP 13.x fix - GPUVM locking fix amdkfd: - APU GTT as VRAM fix radeon: - HAINAN fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260213220825.1454189-1-alexander.deucher@amd.com
2 parents 42ebf3b + fd1fa48 commit 3e21385

91 files changed

Lines changed: 612 additions & 390 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
878878
struct amdgpu_bo *bo[2] = {NULL, NULL};
879879
struct amdgpu_bo_va *bo_va;
880880
bool same_hive = false;
881+
struct drm_exec exec;
881882
int i, ret;
882883

883884
if (!va) {
@@ -958,19 +959,25 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
958959
goto unwind;
959960
}
960961

961-
/* Add BO to VM internal data structures */
962-
ret = amdgpu_bo_reserve(bo[i], false);
963-
if (ret) {
964-
pr_debug("Unable to reserve BO during memory attach");
965-
goto unwind;
962+
drm_exec_init(&exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
963+
drm_exec_until_all_locked(&exec) {
964+
ret = amdgpu_vm_lock_pd(vm, &exec, 0);
965+
drm_exec_retry_on_contention(&exec);
966+
if (unlikely(ret))
967+
goto unwind;
968+
ret = drm_exec_lock_obj(&exec, &bo[i]->tbo.base);
969+
drm_exec_retry_on_contention(&exec);
970+
if (unlikely(ret))
971+
goto unwind;
966972
}
973+
967974
bo_va = amdgpu_vm_bo_find(vm, bo[i]);
968975
if (!bo_va)
969976
bo_va = amdgpu_vm_bo_add(adev, vm, bo[i]);
970977
else
971978
++bo_va->ref_count;
972979
attachment[i]->bo_va = bo_va;
973-
amdgpu_bo_unreserve(bo[i]);
980+
drm_exec_fini(&exec);
974981
if (unlikely(!attachment[i]->bo_va)) {
975982
ret = -ENOMEM;
976983
pr_err("Failed to add BO object to VM. ret == %d\n",

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4652,9 +4652,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
46524652
dev_info(adev->dev, "Pending hive reset.\n");
46534653
amdgpu_set_init_level(adev,
46544654
AMDGPU_INIT_LEVEL_MINIMAL_XGMI);
4655-
} else if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 10) &&
4656-
!amdgpu_device_has_display_hardware(adev)) {
4657-
r = psp_gpu_reset(adev);
46584655
} else {
46594656
tmp = amdgpu_reset_method;
46604657
/* It should do a default reset when loading or reloading the driver,

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,7 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev)
21642164
case IP_VERSION(13, 0, 11):
21652165
case IP_VERSION(13, 0, 12):
21662166
case IP_VERSION(13, 0, 14):
2167+
case IP_VERSION(13, 0, 15):
21672168
case IP_VERSION(14, 0, 0):
21682169
case IP_VERSION(14, 0, 1):
21692170
case IP_VERSION(14, 0, 4):
@@ -2988,9 +2989,11 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
29882989
case IP_VERSION(11, 5, 1):
29892990
case IP_VERSION(11, 5, 2):
29902991
case IP_VERSION(11, 5, 3):
2991-
case IP_VERSION(11, 5, 4):
29922992
adev->family = AMDGPU_FAMILY_GC_11_5_0;
29932993
break;
2994+
case IP_VERSION(11, 5, 4):
2995+
adev->family = AMDGPU_FAMILY_GC_11_5_4;
2996+
break;
29942997
case IP_VERSION(12, 0, 0):
29952998
case IP_VERSION(12, 0, 1):
29962999
case IP_VERSION(12, 1, 0):

drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,15 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
514514
r = dma_resv_reserve_fences(resv, 2);
515515
if (!r)
516516
r = amdgpu_vm_clear_freed(adev, vm, NULL);
517+
518+
/* Don't pass 'ticket' to amdgpu_vm_handle_moved: we want the clear=true
519+
* path to be used otherwise we might update the PT of another process
520+
* while it's using the BO.
521+
* With clear=true, amdgpu_vm_bo_update will sync to command submission
522+
* from the same VM.
523+
*/
517524
if (!r)
518-
r = amdgpu_vm_handle_moved(adev, vm, ticket);
525+
r = amdgpu_vm_handle_moved(adev, vm, NULL);
519526

520527
if (r && r != -EBUSY)
521528
DRM_ERROR("Failed to invalidate VM page tables (%d))\n",

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
232232
struct amdgpu_vm *vm = &fpriv->vm;
233233
struct amdgpu_bo_va *bo_va;
234234
struct mm_struct *mm;
235+
struct drm_exec exec;
235236
int r;
236237

237238
mm = amdgpu_ttm_tt_get_usermm(abo->tbo.ttm);
@@ -242,9 +243,18 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
242243
!amdgpu_vm_is_bo_always_valid(vm, abo))
243244
return -EPERM;
244245

245-
r = amdgpu_bo_reserve(abo, false);
246-
if (r)
247-
return r;
246+
drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 0);
247+
drm_exec_until_all_locked(&exec) {
248+
r = drm_exec_prepare_obj(&exec, &abo->tbo.base, 1);
249+
drm_exec_retry_on_contention(&exec);
250+
if (unlikely(r))
251+
goto out_unlock;
252+
253+
r = amdgpu_vm_lock_pd(vm, &exec, 0);
254+
drm_exec_retry_on_contention(&exec);
255+
if (unlikely(r))
256+
goto out_unlock;
257+
}
248258

249259
amdgpu_vm_bo_update_shared(abo);
250260
bo_va = amdgpu_vm_bo_find(vm, abo);
@@ -260,8 +270,7 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
260270
amdgpu_bo_unreserve(abo);
261271
return r;
262272
}
263-
264-
amdgpu_bo_unreserve(abo);
273+
drm_exec_fini(&exec);
265274

266275
/* Validate and add eviction fence to DMABuf imports with dynamic
267276
* attachment in compute VMs. Re-validation will be done by
@@ -294,7 +303,10 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
294303
}
295304
}
296305
mutex_unlock(&vm->process_info->lock);
306+
return r;
297307

308+
out_unlock:
309+
drm_exec_fini(&exec);
298310
return r;
299311
}
300312

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned int num_ibs,
229229
r = amdgpu_vm_flush(ring, job, need_pipe_sync);
230230
if (r) {
231231
amdgpu_ring_undo(ring);
232-
return r;
232+
goto free_fence;
233233
}
234234
}
235235

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,7 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
14451445
{
14461446
struct amdgpu_device *adev = drm_to_adev(dev);
14471447
struct amdgpu_fpriv *fpriv;
1448+
struct drm_exec exec;
14481449
int r, pasid;
14491450

14501451
/* Ensure IB tests are run on ring */
@@ -1484,7 +1485,16 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
14841485
if (r)
14851486
goto error_pasid;
14861487

1488+
drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 0);
1489+
drm_exec_until_all_locked(&exec) {
1490+
r = amdgpu_vm_lock_pd(&fpriv->vm, &exec, 0);
1491+
drm_exec_retry_on_contention(&exec);
1492+
if (unlikely(r))
1493+
goto error_vm;
1494+
}
1495+
14871496
fpriv->prt_va = amdgpu_vm_bo_add(adev, &fpriv->vm, NULL);
1497+
drm_exec_fini(&exec);
14881498
if (!fpriv->prt_va) {
14891499
r = -ENOMEM;
14901500
goto error_vm;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
148148
break;
149149
case IP_VERSION(13, 0, 6):
150150
case IP_VERSION(13, 0, 14):
151+
case IP_VERSION(13, 0, 15):
151152
ret = psp_init_cap_microcode(psp, ucode_prefix);
152153
ret &= psp_init_ta_microcode(psp, ucode_prefix);
153154
break;
@@ -219,6 +220,7 @@ static int psp_early_init(struct amdgpu_ip_block *ip_block)
219220
psp->autoload_supported = false;
220221
break;
221222
case IP_VERSION(13, 0, 12):
223+
case IP_VERSION(13, 0, 15):
222224
psp_v13_0_set_psp_funcs(psp);
223225
psp->autoload_supported = false;
224226
adev->psp.sup_ifwi_up = !amdgpu_sriov_vf(adev);
@@ -383,7 +385,8 @@ static bool psp_get_runtime_db_entry(struct amdgpu_device *adev,
383385

384386
if (amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6) ||
385387
amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 12) ||
386-
amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14))
388+
amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 14) ||
389+
amdgpu_ip_version(adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 15))
387390
return false;
388391

389392
db_header_pos = adev->gmc.mc_vram_size - PSP_RUNTIME_DB_OFFSET;
@@ -735,7 +738,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
735738
ras_intr = amdgpu_ras_intr_triggered();
736739
if (ras_intr)
737740
break;
738-
usleep_range(10, 100);
741+
usleep_range(60, 100);
739742
amdgpu_device_invalidate_hdp(psp->adev, NULL);
740743
}
741744

drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,10 +1701,12 @@ int amdgpu_ras_eeprom_check(struct amdgpu_ras_eeprom_control *control)
17011701
}
17021702

17031703
res = __verify_ras_table_checksum(control);
1704-
if (res)
1704+
if (res) {
17051705
dev_err(adev->dev,
17061706
"RAS table incorrect checksum or error:%d\n",
17071707
res);
1708+
return -EINVAL;
1709+
}
17081710

17091711
/* Warn if we are at 90% of the threshold or above
17101712
*/

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,8 @@ struct amdgpu_bo_va *amdgpu_vm_bo_add(struct amdgpu_device *adev,
17351735
{
17361736
struct amdgpu_bo_va *bo_va;
17371737

1738+
amdgpu_vm_assert_locked(vm);
1739+
17381740
bo_va = kzalloc(sizeof(struct amdgpu_bo_va), GFP_KERNEL);
17391741
if (bo_va == NULL) {
17401742
return NULL;

0 commit comments

Comments
 (0)