Skip to content

Commit d55957f

Browse files
yifancomalexdeucher
authored andcommitted
drm/amdkfd: bail out early if no get_atc_vmid_pasid_mapping_info
it makes no sense to continue with an undefined vmid. Fixes: c8b0507 ("drm/amdkfd: judge get_atc_vmid_pasid_mapping_info before call") Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com> Reported-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 53b97af commit d55957f

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -500,21 +500,24 @@ static int dbgdev_wave_reset_wavefronts(struct kfd_dev *dev, struct kfd_process
500500

501501
pr_debug("Killing all process wavefronts\n");
502502

503+
if (!dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
504+
pr_err("no vmid pasid mapping supported \n");
505+
return -EOPNOTSUPP;
506+
}
507+
503508
/* Scan all registers in the range ATC_VMID8_PASID_MAPPING ..
504509
* ATC_VMID15_PASID_MAPPING
505510
* to check which VMID the current process is mapped to.
506511
*/
507512

508-
if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
509-
for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) {
510-
status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info
511-
(dev->adev, vmid, &queried_pasid);
513+
for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) {
514+
status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info
515+
(dev->adev, vmid, &queried_pasid);
512516

513-
if (status && queried_pasid == p->pasid) {
514-
pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n",
515-
vmid, p->pasid);
516-
break;
517-
}
517+
if (status && queried_pasid == p->pasid) {
518+
pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n",
519+
vmid, p->pasid);
520+
break;
518521
}
519522
}
520523

0 commit comments

Comments
 (0)