Skip to contentSkip to conversation

drm/amdkfd: remove redundant iommu cleanup code

PATCH New Yifan Zhang 1 participant 2 messages Sep 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdkfd: remove redundant iommu cleanup code

kfd_resume doesn't involve iommu operation, remove redundant iommu cleanup code.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -7
index c2a4d920da40..4a416231b24c 100644
@@ -1085,18 +1085,12 @@ static int kfd_resume(struct kfd_dev *kfd)
 	int err = 0;
 
 	err = kfd->dqm->ops.start(kfd->dqm);
-	if (err) {
+	if (err)
 		dev_err(kfd_device,
 			"Error starting queue manager for device %x:%x\n",
 			kfd->pdev->vendor, kfd->pdev->device);
-		goto dqm_start_error;
-	}
 
 	return err;
-
-dqm_start_error:
-	kfd_iommu_suspend(kfd);
-	return err;
 }
 
 static inline void kfd_queue_work(struct workqueue_struct *wq,
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm/amdkfd: configure iommu when kfd init

fix clinfo failure in Raven/Picasso:

Number of platforms: 1
Platform Profile: FULL_PROFILE
Platform Version: OpenCL 2.2 AMD-APP (3364.0) Platform Name: AMD Accelerated Parallel Processing Platform Vendor: Advanced Micro Devices, Inc. Platform Extensions: cl_khr_icd cl_amd_event_callback

Platform Name: AMD Accelerated Parallel Processing
Number of devices: 0

---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +5 -0
index 4a416231b24c..16bd64852b61 100644
@@ -924,6 +924,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
 	svm_migrate_init((struct amdgpu_device *)kfd->kgd);
 
+	if (kgd2kfd_resume_iommu(kfd))
+		goto kfd_iommu_resume_error;
+
 	if (kfd_resume(kfd))
 		goto kfd_resume_error;
 
@@ -947,6 +950,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
 kfd_topology_add_device_error:
 kfd_resume_error:
+	kfd_iommu_suspend(kfd);
+kfd_iommu_resume_error:
 device_iommu_error:
 gws_error:
 	device_queue_manager_uninit(kfd->dqm);
Signature · 1 line
2.25.1