Skip to contentSkip to conversation

Bug:211277 fix backport for 5.10 stable

PATCH In review James Zhu 3 participants 14 messages Dec 9, 2021 – Dec 10, 2021

Subsystems (4)
lore
Share & tools
lore

James Zhu

author
#0 lore raw

cover Bug:211277 fix backport for 5.10 stable

These patches are back port for 5.10 stable.
They are cherry-picked from 5.14 stable.

BugFix: https://bugzilla.kernel.org/show_bug.cgi?id=211277

James Zhu (3):
drm/amdkfd: separate kfd_iommu_resume from kfd_resume drm/amdgpu: add amdgpu_amdkfd_resume_iommu drm/amdgpu: move iommu_resume before ip init/resume

Lang Yu (1):
drm/amd/amdkfd: adjust dummy functions' placement

Yifan Zhang (2):
drm/amdgpu: init iommu after amdkfd device init drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c |  97 ++------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 145 ++++++++++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |   8 ++
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    |  15 ++-
 4 files changed, 155 insertions(+), 110 deletions(-)
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/6 drm/amd/amdkfd: adjust dummy functions' placement

From: Lang Yu <[email protected]>

commit cd63989e0e6aa2eb66b461f2bae769e2550e47ac upstream.

Move all the dummy functions in amdgpu_amdkfd.c to amdgpu_amdkfd.h as inline functions.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c |  87 -------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 138 ++++++++++++++++++---
 2 files changed, 119 insertions(+), 106 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +0 -87
index 0544460653b9..b23b31dc570e 100644
@@ -47,12 +47,8 @@ int amdgpu_amdkfd_init(void)
 	amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh;
 	amdgpu_amdkfd_total_mem_size *= si.mem_unit;
 
-#ifdef CONFIG_HSA_AMD
 	ret = kgd2kfd_init();
 	amdgpu_amdkfd_gpuvm_init_mem_limits();
-#else
-	ret = -ENOENT;
-#endif
 	kfd_initialized = !ret;
 
 	return ret;
@@ -695,86 +691,3 @@ bool amdgpu_amdkfd_have_atomics_support(struct kgd_dev *kgd)
 
 	return adev->have_atomics_support;
 }
-
-#ifndef CONFIG_HSA_AMD
-bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm)
-{
-	return false;
-}
-
-void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo)
-{
-}
-
-int amdgpu_amdkfd_remove_fence_on_pt_pd_bos(struct amdgpu_bo *bo)
-{
-	return 0;
-}
-
-void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev,
-					struct amdgpu_vm *vm)
-{
-}
-
-struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f)
-{
-	return NULL;
-}
-
-int amdgpu_amdkfd_evict_userptr(struct kgd_mem *mem, struct mm_struct *mm)
-{
-	return 0;
-}
-
-struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev,
-			      unsigned int asic_type, bool vf)
-{
-	return NULL;
-}
-
-bool kgd2kfd_device_init(struct kfd_dev *kfd,
-			 struct drm_device *ddev,
-			 const struct kgd2kfd_shared_resources *gpu_resources)
-{
-	return false;
-}
-
-void kgd2kfd_device_exit(struct kfd_dev *kfd)
-{
-}
-
-void kgd2kfd_exit(void)
-{
-}
-
-void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
-{
-}
-
-int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
-{
-	return 0;
-}
-
-int kgd2kfd_pre_reset(struct kfd_dev *kfd)
-{
-	return 0;
-}
-
-int kgd2kfd_post_reset(struct kfd_dev *kfd)
-{
-	return 0;
-}
-
-void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry)
-{
-}
-
-void kgd2kfd_set_sram_ecc_flag(struct kfd_dev *kfd)
-{
-}
-
-void kgd2kfd_smi_event_throttle(struct kfd_dev *kfd, uint32_t throttle_bitmask)
-{
-}
-#endif
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +119 -19

186 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 2/6 drm/amdkfd: separate kfd_iommu_resume from kfd_resume

In reply to James Zhu

commit fefc01f042f44ede373ee66773b8238dd8fdcb55 upstream.

Separate kfd_iommu_resume from kfd_resume for fine-tuning of amdgpu device init/resume/reset/recovery sequence.

v2: squash in fix for !CONFIG_HSA_AMD

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |  6 ++++++
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 12 ++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +6 -0
index a81d9cacf9b8..8a402a3df412 100644
@@ -305,6 +305,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 			 const struct kgd2kfd_shared_resources *gpu_resources);
 void kgd2kfd_device_exit(struct kfd_dev *kfd);
 void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm);
+int kgd2kfd_resume_iommu(struct kfd_dev *kfd);
 int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm);
 int kgd2kfd_pre_reset(struct kfd_dev *kfd);
 int kgd2kfd_post_reset(struct kfd_dev *kfd);
@@ -343,6 +344,11 @@ static inline void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
 {
 }
 
+static int __maybe_unused kgd2kfd_resume_iommu(struct kfd_dev *kfd)
+{
+	return 0;
+}
+
 static inline int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
 {
 	return 0;
drivers/gpu/drm/amd/amdkfd/kfd_device.c +8 -4
index 5751bddc9cad..1204dae85797 100644
@@ -896,17 +896,21 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
 	return ret;
 }
 
-static int kfd_resume(struct kfd_dev *kfd)
+int kgd2kfd_resume_iommu(struct kfd_dev *kfd)
 {
 	int err = 0;
 
 	err = kfd_iommu_resume(kfd);
-	if (err) {
+	if (err)
 		dev_err(kfd_device,
 			"Failed to resume IOMMU for device %x:%x\n",
 			kfd->pdev->vendor, kfd->pdev->device);
-		return err;
-	}
+	return err;
+}
+
+static int kfd_resume(struct kfd_dev *kfd)
+{
+	int err = 0;
 
 	err = kfd->dqm->ops.start(kfd->dqm);
 	if (err) {
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH 3/6 drm/amdgpu: add amdgpu_amdkfd_resume_iommu

In reply to James Zhu

commit 8066008482e533e91934bee49765bf8b4a7c40db upstream.

Add amdgpu_amdkfd_resume_iommu for amdgpu.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 10 ++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |  1 +
 2 files changed, 11 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +10 -0
index b23b31dc570e..fb6230c62daa 100644
@@ -190,6 +190,16 @@ void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm)
 		kgd2kfd_suspend(adev->kfd.dev, run_pm);
 }
 
+int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev)
+{
+	int r = 0;
+
+	if (adev->kfd.dev)
+		r = kgd2kfd_resume_iommu(adev->kfd.dev);
+
+	return r;
+}
+
 int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm)
 {
 	int r = 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +1 -0
index 8a402a3df412..32e385f287cb 100644
@@ -121,6 +121,7 @@ int amdgpu_amdkfd_init(void);
 void amdgpu_amdkfd_fini(void);
 
 void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool run_pm);
+int amdgpu_amdkfd_resume_iommu(struct amdgpu_device *adev);
 int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool run_pm);
 void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev,
 			const void *ih_ring_entry);
Signature · 1 line
2.25.1
author
#4 lore raw

PATCH 4/6 drm/amdgpu: move iommu_resume before ip init/resume

In reply to James Zhu

commit f02abeb0779700c308e661a412451b38962b8a0b upstream.

Separate iommu_resume from kfd_resume, and move it before other amdgpu ip init/resume.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +12 -0
index 97723f2b5ece..2947bded074a 100644
@@ -2220,6 +2220,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 	if (r)
 		goto init_failed;
 
+	r = amdgpu_amdkfd_resume_iommu(adev);
+	if (r)
+		goto init_failed;
+
 	r = amdgpu_device_ip_hw_init_phase1(adev);
 	if (r)
 		goto init_failed;
@@ -2913,6 +2917,10 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
 {
 	int r;
 
+	r = amdgpu_amdkfd_resume_iommu(adev);
+	if (r)
+		return r;
+
 	r = amdgpu_device_ip_resume_phase1(adev);
 	if (r)
 		return r;
@@ -4296,6 +4304,10 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
 
 			if (!r) {
 				dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n");
+				r = amdgpu_amdkfd_resume_iommu(tmp_adev);
+				if (r)
+					goto out;
+
 				r = amdgpu_device_ip_resume_phase1(tmp_adev);
 				if (r)
 					goto out;
Signature · 1 line
2.25.1
author
#5 lore raw

PATCH 5/6 drm/amdgpu: init iommu after amdkfd device init

In reply to James Zhu

From: Yifan Zhang <[email protected]>

[ Upstream commit 714d9e4574d54596973ee3b0624ee4a16264d700 ]

This patch is to 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/amdgpu/amdgpu_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -4
index 2947bded074a..488e574f5da1 100644
@@ -2220,10 +2220,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 	if (r)
 		goto init_failed;
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
 	r = amdgpu_device_ip_hw_init_phase1(adev);
 	if (r)
 		goto init_failed;
@@ -2259,6 +2255,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 		amdgpu_xgmi_add_device(adev);
 	amdgpu_amdkfd_device_init(adev);
 
+	r = amdgpu_amdkfd_resume_iommu(adev);
+	if (r)
+		goto init_failed;
+
 	amdgpu_fru_get_product_info(adev);
 
 init_failed:
Signature · 1 line
2.25.1
author
#6 lore raw

PATCH 6/6 drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

In reply to James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 		amdgpu_xgmi_add_device(adev);
 	amdgpu_amdkfd_device_init(adev);
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
 	amdgpu_fru_get_product_info(adev);
 
 init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
 	kfd_cwsr_init(kfd);
 
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
+
 	if (kfd_resume(kfd))
 		goto kfd_resume_error;
 
Signature · 1 line
2.25.1
#7 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 51 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 		amdgpu_xgmi_add_device(adev);
 	amdgpu_amdkfd_device_init(adev);
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
 	amdgpu_fru_get_product_info(adev);
 
 init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
 	kfd_cwsr_init(kfd);
 
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
+
 	if (kfd_resume(kfd))
 		goto kfd_resume_error;
 
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

greg k-h

#8 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 49 lines · Greg Kroah-Hartman
Quoted 48 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
  drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
  2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
  		amdgpu_xgmi_add_device(adev);
  	amdgpu_amdkfd_device_init(adev);
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
  	amdgpu_fru_get_product_info(adev);
 
  init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
  	kfd_cwsr_init(kfd);
 
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
+
  	if (kfd_resume(kfd))
  		goto kfd_resume_error;
 
Quoted 5 lines
Quoted 3 lines
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

[JZ] Yes, I should add more explanation next time.

Backport conflict fix to remove  svm_migrate_init((struct amdgpu_device *)kfd->kgd);

new AMD svm feature has not been added for 5.10 So it is safe to remove it.

Quoted 2 lines

greg k-h

#9 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 52 lines · James Zhu
Quoted 41 lines · Greg Kroah-Hartman
Quoted 40 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
  drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
  2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
  		amdgpu_xgmi_add_device(adev);
  	amdgpu_amdkfd_device_init(adev);
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
  	amdgpu_fru_get_product_info(adev);
  init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
  	kfd_cwsr_init(kfd);
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -0
+
  	if (kfd_resume(kfd))
  		goto kfd_resume_error;
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

Quoted 6 lines

[JZ] Yes, I should add more explanation next time.

Backport conflict fix to remove  svm_migrate_init((struct amdgpu_device *)kfd->kgd);

new AMD svm feature has not been added for 5.10 So it is safe to remove it.

No, I am talking about the fact that you fixed up a coding style fix in this backport that is not in the original commit in Linus's tree.

#10 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 51 lines · Greg Kroah-Hartman
Quoted 50 lines · James Zhu
Quoted 49 lines · Greg Kroah-Hartman
Quoted 46 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
   drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
   2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
   		amdgpu_xgmi_add_device(adev);
   	amdgpu_amdkfd_device_init(adev);
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
   	amdgpu_fru_get_product_info(adev);
   init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +3 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
   	kfd_cwsr_init(kfd);
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
+
   	if (kfd_resume(kfd))
   		goto kfd_resume_error;
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

Quoted 8 lines
Quoted 6 lines

[JZ] Yes, I should add more explanation next time.

Backport conflict fix to remove  svm_migrate_init((struct amdgpu_device *)kfd->kgd);

new AMD svm feature has not been added for 5.10 So it is safe to remove it.

No, I am talking about the fact that you fixed up a coding style fix in this backport that is not in the original commit in Linus's tree.

[JZ] I see. this fix is not necessary. Do you want me to send v2 with

this unnecessary coding style fix dropping for backport?

#11 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 58 lines · James Zhu
Quoted 56 lines · Greg Kroah-Hartman
Quoted 55 lines · James Zhu
Quoted 41 lines · Greg Kroah-Hartman
Quoted 40 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
   drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
   2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
   		amdgpu_xgmi_add_device(adev);
   	amdgpu_amdkfd_device_init(adev);
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
   	amdgpu_fru_get_product_info(adev);
   init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
   	kfd_cwsr_init(kfd);
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -0
+
   	if (kfd_resume(kfd))
   		goto kfd_resume_error;
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

[JZ] Yes, I should add more explanation next time.

Backport conflict fix to remove  svm_migrate_init((struct amdgpu_device *)kfd->kgd);

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

new AMD svm feature has not been added for 5.10 So it is safe to remove it.

No, I am talking about the fact that you fixed up a coding style fix in this backport that is not in the original commit in Linus's tree.

[JZ] I see. this fix is not necessary. Do you want me to send v2 with

this unnecessary coding style fix dropping for backport?

I took what was in Linus's tree already. Please verify that what I applied to the queue still works.

thanks,

greg k-h

#12 lore raw

Re: [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

Quoted 59 lines · Greg Kroah-Hartman
Quoted 58 lines · James Zhu
Quoted 57 lines · Greg Kroah-Hartman
Quoted 56 lines · James Zhu
Quoted 41 lines · Greg Kroah-Hartman
Quoted 40 lines · James Zhu

From: Yifan Zhang <[email protected]>

commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2 init will fail. But this failure should not block amdgpu driver init.

---
    drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
    drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
    2 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
index 488e574f5da1..f262c4e7a48a 100644
@@ -2255,10 +2255,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
    		amdgpu_xgmi_add_device(adev);
    	amdgpu_amdkfd_device_init(adev);
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
    	amdgpu_fru_get_product_info(adev);
    init_failed:
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -0
index 1204dae85797..b35f0af71f00 100644
@@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
    	kfd_cwsr_init(kfd);
+	if (kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
Quoted 8 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +1 -0
+
    	if (kfd_resume(kfd))
    		goto kfd_resume_error;
Signature · 1 line
2.25.1

Like I said last time, do not change the backport unless you HAVE to. You did it here again for no good reason :(

[JZ] Yes, I should add more explanation next time.

Backport conflict fix to remove  svm_migrate_init((struct amdgpu_device *)kfd->kgd);

new AMD svm feature has not been added for 5.10 So it is safe to remove it.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

No, I am talking about the fact that you fixed up a coding style fix in this backport that is not in the original commit in Linus's tree.

[JZ] I see. this fix is not necessary. Do you want me to send v2 with

this unnecessary coding style fix dropping for backport?

I took what was in Linus's tree already. Please verify that what I applied to the queue still works.

[JZ] I verified it. It still work fine. Thanks for correction!

Quoted 4 lines

thanks,

greg k-h

maintainer
#13 lore raw
In reply to James Zhu
Quoted 10 lines · James Zhu

These patches are back port for 5.10 stable.
They are cherry-picked from 5.14 stable.

BugFix: https://bugzilla.kernel.org/show_bug.cgi?id=211277

James Zhu (3):
drm/amdkfd: separate kfd_iommu_resume from kfd_resume drm/amdgpu: add amdgpu_amdkfd_resume_iommu drm/amdgpu: move iommu_resume before ip init/resume

Quoted 6 lines

Lang Yu (1):
drm/amd/amdkfd: adjust dummy functions' placement

Yifan Zhang (2):
drm/amdgpu: init iommu after amdkfd device init drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

What has changed from the last time this series was submitted?

thanks,

greg k-h