Commit d55957fb authored by Yifan Zhang's avatar Yifan Zhang Committed by Alex Deucher

drm/amdkfd: bail out early if no get_atc_vmid_pasid_mapping_info

it makes no sense to continue with an undefined vmid.

Fixes: c8b0507f ("drm/amdkfd: judge get_atc_vmid_pasid_mapping_info before call")
Signed-off-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 53b97af4
...@@ -500,21 +500,24 @@ static int dbgdev_wave_reset_wavefronts(struct kfd_dev *dev, struct kfd_process ...@@ -500,21 +500,24 @@ static int dbgdev_wave_reset_wavefronts(struct kfd_dev *dev, struct kfd_process
pr_debug("Killing all process wavefronts\n"); pr_debug("Killing all process wavefronts\n");
if (!dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) {
pr_err("no vmid pasid mapping supported \n");
return -EOPNOTSUPP;
}
/* Scan all registers in the range ATC_VMID8_PASID_MAPPING .. /* Scan all registers in the range ATC_VMID8_PASID_MAPPING ..
* ATC_VMID15_PASID_MAPPING * ATC_VMID15_PASID_MAPPING
* to check which VMID the current process is mapped to. * to check which VMID the current process is mapped to.
*/ */
if (dev->kfd2kgd->get_atc_vmid_pasid_mapping_info) { for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) {
for (vmid = first_vmid_to_scan; vmid <= last_vmid_to_scan; vmid++) { status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info
status = dev->kfd2kgd->get_atc_vmid_pasid_mapping_info (dev->adev, vmid, &queried_pasid);
(dev->adev, vmid, &queried_pasid);
if (status && queried_pasid == p->pasid) { if (status && queried_pasid == p->pasid) {
pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n", pr_debug("Killing wave fronts of vmid %d and pasid 0x%x\n",
vmid, p->pasid); vmid, p->pasid);
break; break;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment