Skip to contentSkip to conversation

drm/amdgpu: skip kfd-iommu suspend/resume for S0ix

PATCH In review Aaron Liu 4 participants 5 messages Apr 5, 2023 – Apr 13, 2023

Subsystems (2)
lore
Share & tools
lore

Aaron Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: skip kfd-iommu suspend/resume for S0ix

GFX is in gfxoff mode during s0ix so we shouldn't need to actually execute kfd_iommu_suspend/kfd_iommu_resume operation.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -3
index 3b6b85d9e0be..5094be94fa06 100644
@@ -3304,9 +3304,11 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
 {
 	int r;
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		return r;
+	if (!adev->in_s0ix) {
+		r = amdgpu_amdkfd_resume_iommu(adev);
+		if (r)
+			return r;
+	}
 
 	r = amdgpu_device_ip_resume_phase1(adev);
 	if (r)
Signature · 1 line
2.39.0
#1 lore raw
Quoted 5 lines · Aaron

GFX is in gfxoff mode during s0ix so we shouldn't need to actually execute kfd_iommu_suspend/kfd_iommu_resume operation.

---

Probably should add to this patch:

Quoted 25 lines
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -4
index 3b6b85d9e0be..5094be94fa06 100644
@@ -3304,9 +3304,11 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
  {
         int r;
 
-       r = amdgpu_amdkfd_resume_iommu(adev);
-       if (r)
-               return r;
+       if (!adev->in_s0ix) {
+               r = amdgpu_amdkfd_resume_iommu(adev);
+               if (r)
+                       return r;
+       }
 
         r = amdgpu_device_ip_resume_phase1(adev);
         if (r)
--

2.39.0

Acked-by
#2 lore raw
Quoted 10 lines · Mario
Quoted 5 lines · Aaron

GFX is in gfxoff mode during s0ix so we shouldn't need to actually execute kfd_iommu_suspend/kfd_iommu_resume operation.

---

Probably should add to this patch:

Quoted 27 lines
Quoted 26 lines
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -4
index 3b6b85d9e0be..5094be94fa06 100644
@@ -3304,9 +3304,11 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
  {
         int r;
 
-       r = amdgpu_amdkfd_resume_iommu(adev);
-       if (r)
-               return r;
+       if (!adev->in_s0ix) {
+               r = amdgpu_amdkfd_resume_iommu(adev);
+               if (r)
+                       return r;
+       }
 
         r = amdgpu_device_ip_resume_phase1(adev);
         if (r)
--

2.39.0

Reviewed-by on v1 1/1
#3 lore raw
In reply to Aaron Liu
Quoted 5 lines · Aaron Liu

GFX is in gfxoff mode during s0ix so we shouldn't need to actually execute kfd_iommu_suspend/kfd_iommu_resume operation.

Quoted 23 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -3
index 3b6b85d9e0be..5094be94fa06 100644
@@ -3304,9 +3304,11 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
  {
  	int r;
 
-	r = amdgpu_amdkfd_resume_iommu(adev);
-	if (r)
-		return r;
+	if (!adev->in_s0ix) {
+		r = amdgpu_amdkfd_resume_iommu(adev);
+		if (r)
+			return r;
+	}
 
  	r = amdgpu_device_ip_resume_phase1(adev);
  	if (r)
Reviewed-by
#4 lore raw

[AMD Official Use Only - General]

Thanks for sorting out this, that is making sense since driver already skip kfd device suspend and this will skip kfd_iommu_suspend() as well.

Regards,
--Prike

Quoted 40 lines

-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Thursday, April 13, 2023 9:25 AM
To: Liu, Aaron <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kuehling, Felix <[email protected]>; Liang, Prike <[email protected]>
Subject: Re: drm/amdgpu: skip kfd-iommu suspend/resume for S0ix

Quoted 5 lines · Aaron Liu

GFX is in gfxoff mode during s0ix so we shouldn't need to actually execute kfd_iommu_suspend/kfd_iommu_resume operation.

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_resume(struct

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 3b6b85d9e0be..5094be94fa06 100644
@@ -3304,9 +3304,11 @@ static int amdgpu_device_ip_resume(struct

amdgpu_device *adev)

Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +5 -3
  {
    int r;
 
-   r = amdgpu_amdkfd_resume_iommu(adev);
-   if (r)
-           return r;
+   if (!adev->in_s0ix) {
+           r = amdgpu_amdkfd_resume_iommu(adev);
+           if (r)
+                   return r;
+   }
 
    r = amdgpu_device_ip_resume_phase1(adev);
    if (r)