Skip to contentSkip to conversation

Revert "drm/amdgpu: init iommu after amdkfd device init"

PATCH Applied Armin Wolf 5 participants 9 messages May 23, 2024 – Jun 13, 2024

Subsystems (3)
lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH 1/1 Revert "drm/amdgpu: init iommu after amdkfd device init"

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

---
 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 222a1d9ecf16..5f6c32ec674d 100644
@@ -2487,6 +2487,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;
@@ -2525,10 +2529,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:

--
2.39.2

author
#1 lore raw

Am 23.05.24 um 19:30 schrieb Armin Wolf:

Quoted 11 lines

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

Hi,

what is the status of this?

Armin Wolf

Quoted 37 lines
---
  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 -5
index 222a1d9ecf16..5f6c32ec674d 100644
@@ -2487,6 +2487,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;
@@ -2525,10 +2529,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:
--

2.39.2

Reviewed-by Acked-by Christian König Tested-by Mike Lothian
#2 lore raw
Quoted 10 lines · Armin Wolf

Am 23.05.24 um 19:30 schrieb Armin Wolf:

Quoted 8 lines

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

Quoted 7 lines
Quoted 3 lines

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

Hi,

what is the status of this?

Which branch is this for? This patch won't apply to anything after Linux 6.5. Support for IOMMUv2 was removed from amdgpu in Linux 6.6 by:

commit c99a2e7ae291e5b19b60443eb6397320ef9e8571
Author: Alex Deucher <[email protected]>
Date:   Fri Jul 28 12:20:12 2023 -0400

    drm/amdkfd: drop IOMMUv2 support

    Now that we use the dGPU path for all APUs, drop the IOMMUv2 support.

    v2: drop the now unused queue manager functions for gfx7/8 APUs

Regards,
  Felix

Quoted 42 lines

Armin Wolf

Quoted 39 lines

---
  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 -0
index 222a1d9ecf16..5f6c32ec674d 100644
@@ -2487,6 +2487,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;

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -2525,10 +2529,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:

Signature · 1 line
2.39.2
#3 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 30 lines

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Tuesday, June 4, 2024 2:25 PM
To: Armin Wolf <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Zhang, Yifan <[email protected]>; Liang, Prike <[email protected]>; dri- [email protected]; [email protected]
Subject: Re: [PATCH] Revert "drm/amdgpu: init iommu after amdkfd device init"

Quoted 7 lines · Armin Wolf

Am 23.05.24 um 19:30 schrieb Armin Wolf:

Quoted 5 lines

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works

again.

Quoted 7 lines
Quoted 6 lines

He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

Quoted 5 lines
Quoted 3 lines

Hi,

what is the status of this?

Which branch is this for? This patch won't apply to anything after Linux 6.5.

It's applicable to 5.15 stable only. The original patch caused a regression on 5.15 so probably should not have been applied there.

Alex

Quoted 65 lines

Support for IOMMUv2 was removed from amdgpu in Linux 6.6 by:

commit c99a2e7ae291e5b19b60443eb6397320ef9e8571

Author: Alex Deucher <[email protected]>
Date:   Fri Jul 28 12:20:12 2023 -0400

drm/amdkfd: drop IOMMUv2 support

Now that we use the dGPU path for all APUs, drop the IOMMUv2 support.

v2: drop the now unused queue manager functions for gfx7/8 APUs

Regards,
Felix

Quoted 43 lines

Armin Wolf

Quoted 40 lines
---
  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 -0
index 222a1d9ecf16..5f6c32ec674d 100644
@@ -2487,6 +2487,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;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -2525,10 +2529,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:
--
2.39.2

author
#4 lore raw

Am 04.06.24 um 20:28 schrieb Deucher, Alexander:

Quoted 31 lines

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 29 lines

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Tuesday, June 4, 2024 2:25 PM
To: Armin Wolf <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Zhang, Yifan <[email protected]>; Liang, Prike <[email protected]>; dri- [email protected]; [email protected]
Subject: Re: [PATCH] Revert "drm/amdgpu: init iommu after amdkfd device init"

Quoted 7 lines · Armin Wolf

Am 23.05.24 um 19:30 schrieb Armin Wolf:

Quoted 5 lines

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works

again.

Quoted 6 lines
Quoted 6 lines

He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Hi,

what is the status of this?

Which branch is this for? This patch won't apply to anything after Linux 6.5.

It's applicable to 5.15 stable only. The original patch caused a regression on 5.15 so probably should not have been applied there.

Alex

Correct, and i would be very grateful if this regression could be resolved in the near future. The user already wrote a blog post about the whole issue, see here:

https://bkhome.org/news/202405/kernel-amd-gpu-disaster-fixed.html

Thanks,
Armin Wolf

Quoted 63 lines
Quoted 63 lines

Support for IOMMUv2 was removed from amdgpu in Linux 6.6 by:

commit c99a2e7ae291e5b19b60443eb6397320ef9e8571

Author: Alex Deucher <[email protected]>
Date:   Fri Jul 28 12:20:12 2023 -0400

drm/amdkfd: drop IOMMUv2 support

Now that we use the dGPU path for all APUs, drop the IOMMUv2 support.

v2: drop the now unused queue manager functions for gfx7/8 APUs

Regards,
Felix

Quoted 41 lines

Armin Wolf

Quoted 39 lines
---
   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 -0
index 222a1d9ecf16..5f6c32ec674d 100644
@@ -2487,6 +2487,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;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -2525,10 +2529,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:
--
2.39.2

maintainer Applied
#7 lore raw

Patch "Revert "drm/amdgpu: init iommu after amdkfd device init"" has been added to the 5.15-stable tree

In reply to Armin Wolf

This is a note to let you know that I've just added the patch titled

Revert "drm/amdgpu: init iommu after amdkfd device init"

to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
revert-drm-amdgpu-init-iommu-after-amdkfd-device-init.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Wed Jun 12 14:43:21 2024
From: Armin Wolf <[email protected]>
Date: Thu, 23 May 2024 19:30:31 +0200
Subject: Revert "drm/amdgpu: init iommu after amdkfd device init"
To: [email protected], [email protected], [email protected], [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Message-ID: <[email protected]>

From: Armin Wolf <[email protected]>

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

---
 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
@@ -2487,6 +2487,10 @@ static int amdgpu_device_ip_init(struct
 	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;
@@ -2525,10 +2529,6 @@ static int amdgpu_device_ip_init(struct
 	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:

Patches currently in stable-queue which might be from [email protected] are

queue-5.15/revert-drm-amdgpu-init-iommu-after-amdkfd-device-init.patch

author
#8 lore raw

Re: Patch "Revert "drm/amdgpu: init iommu after amdkfd device init"" has been added to the 5.15-stable tree

Am 12.06.24 um 14:45 schrieb [email protected]:

Quoted 10 lines

This is a note to let you know that I've just added the patch titled

Revert "drm/amdgpu: init iommu after amdkfd device init"

to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
revert-drm-amdgpu-init-iommu-after-amdkfd-device-init.patch
and it can be found in the queue-5.15 subdirectory.

Thank you :)

Quoted 64 lines

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Wed Jun 12 14:43:21 2024
From: Armin Wolf <[email protected]>
Date: Thu, 23 May 2024 19:30:31 +0200
Subject: Revert "drm/amdgpu: init iommu after amdkfd device init"
To: [email protected], [email protected], [email protected], [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Message-ID: <[email protected]>

From: Armin Wolf <[email protected]>

This reverts commit 56b522f4668167096a50c39446d6263c96219f5f.

A user reported that this commit breaks the integrated gpu of his notebook, causing a black screen. He was able to bisect the problematic commit and verified that by reverting it the notebook works again. He also confirmed that kernel 6.8.1 also works on his device, so the upstream commit itself seems to be ok.

An amdgpu developer (Alex Deucher) confirmed that this patch should have never been ported to 5.15 in the first place, so revert this commit from the 5.15 stable series.

---
  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
@@ -2487,6 +2487,10 @@ static int amdgpu_device_ip_init(struct
  	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;
@@ -2525,10 +2529,6 @@ static int amdgpu_device_ip_init(struct
  	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:

Patches currently in stable-queue which might be from [email protected] are

queue-5.15/revert-drm-amdgpu-init-iommu-after-amdkfd-device-init.patch