All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
@ 2021-10-11 12:57 Yifan Zhang
  2021-10-11 12:57 ` [PATCH 2/2] drm/amdkfd: fix resume error when iommu " Yifan Zhang
  2021-10-12 14:39 ` [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is " Zhu, James
  0 siblings, 2 replies; 3+ messages in thread
From: Yifan Zhang @ 2021-10-11 12:57 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, jamesz, youling257, Yifan Zhang

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

Reported-by: youling <youling257@gmail.com>
Tested-by: youling <youling257@gmail.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index af9bdf16eefd..9dfcef2015c8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2432,10 +2432,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 	if (!adev->gmc.xgmi.pending_reset)
 		amdgpu_amdkfd_device_init(adev);
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		goto init_failed;
-
 	amdgpu_fru_get_product_info(adev);
 
 init_failed:
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 4a416231b24c..bb652ee35c25 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -920,6 +920,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 		goto device_iommu_error;
 	}
 
+	if(kgd2kfd_resume_iommu(kfd))
+		goto device_iommu_error;
+
 	kfd_cwsr_init(kfd);
 
 	svm_migrate_init((struct amdgpu_device *)kfd->kgd);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/amdkfd: fix resume error when iommu disabled in Picasso
  2021-10-11 12:57 [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso Yifan Zhang
@ 2021-10-11 12:57 ` Yifan Zhang
  2021-10-12 14:39 ` [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is " Zhu, James
  1 sibling, 0 replies; 3+ messages in thread
From: Yifan Zhang @ 2021-10-11 12:57 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, jamesz, youling257, Yifan Zhang

When IOMMU disabled in sbios and kfd in iommuv2 path,
IOMMU resume failure blocks system resume. Don't allow kfd to
use iommu v2 when iommu is disabled.

Reported-by: youling <youling257@gmail.com>
Tested-by: youling <youling257@gmail.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index bb652ee35c25..1fadc9fb168d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -916,6 +916,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 	kfd_double_confirm_iommu_support(kfd);
 
 	if (kfd_iommu_device_init(kfd)) {
+		kfd->use_iommu_v2 = false;
 		dev_err(kfd_device, "Error initializing iommuv2\n");
 		goto device_iommu_error;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
  2021-10-11 12:57 [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso Yifan Zhang
  2021-10-11 12:57 ` [PATCH 2/2] drm/amdkfd: fix resume error when iommu " Yifan Zhang
@ 2021-10-12 14:39 ` Zhu, James
  1 sibling, 0 replies; 3+ messages in thread
From: Zhu, James @ 2021-10-12 14:39 UTC (permalink / raw)
  To: Zhang, Yifan, amd-gfx; +Cc: Kuehling, Felix, youling257

[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]

[AMD Official Use Only]



________________________________
From: Zhang, Yifan <Yifan1.Zhang@amd.com>
Sent: Monday, October 11, 2021 8:57 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Kuehling, Felix <Felix.Kuehling@amd.com>; Zhu, James <James.Zhu@amd.com>; youling257@gmail.com <youling257@gmail.com>; Zhang, Yifan <Yifan1.Zhang@amd.com>
Subject: [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

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

Reported-by: youling <youling257@gmail.com>
Tested-by: youling <youling257@gmail.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index af9bdf16eefd..9dfcef2015c8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2432,10 +2432,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
         if (!adev->gmc.xgmi.pending_reset)
                 amdgpu_amdkfd_device_init(adev);

-       r = amdgpu_amdkfd_resume_iommu(adev);
-       if (r)
-               goto init_failed;
-
         amdgpu_fru_get_product_info(adev);

 init_failed:
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 4a416231b24c..bb652ee35c25 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -920,6 +920,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
                 goto device_iommu_error;
         }

+       if(kgd2kfd_resume_iommu(kfd))
+               goto device_iommu_error;
+
         kfd_cwsr_init(kfd);

         svm_migrate_init((struct amdgpu_device *)kfd->kgd);
[JZ] Move the above change to here, the device init sequence will be closer to initial design.
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 4012 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-12 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 12:57 [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso Yifan Zhang
2021-10-11 12:57 ` [PATCH 2/2] drm/amdkfd: fix resume error when iommu " Yifan Zhang
2021-10-12 14:39 ` [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is " Zhu, James

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.