Skip to contentSkip to conversation

drm/amdgpu: Don't send warning when close drm obj if drm device has been unplug

PATCH In review Xiaogang.Chen 2 participants 3 messages Nov 17, 2025 – Nov 20, 2025

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

PATCH 1/1 drm/amdgpu: Don't send warning when close drm obj if drm device has been unplug

From: Xiaogang Chen <[email protected]>

During amdgpu_gem_object_close amdgpu driver cleans vm mapping for the closing drm obj. If the correspondent adev has been unplug got error -ENODEV code. In this case do not need send warning message.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
index e3f65977eeee..1b9a6b15b29f 100644
@@ -377,7 +377,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
 		goto out_unlock;
 
 	r = amdgpu_vm_clear_freed(adev, vm, &fence);
-	if (unlikely(r < 0))
+	if (unlikely(r < 0) && !drm_dev_is_unplugged(adev_to_drm(adev)))
 		dev_err(adev->dev, "failed to clear page "
 			"tables on GEM object close (%ld)\n", r);
 	if (r || !fence)
@@ -387,7 +387,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
 	dma_fence_put(fence);
 
 out_unlock:
-	if (r)
+	if (r && !drm_dev_is_unplugged(adev_to_drm(adev)))
 		dev_err(adev->dev, "leaking bo va (%ld)\n", r);
 	drm_exec_fini(&exec);
 }
Signature · 1 line
2.34.1
#1 lore raw

ping

Quoted 33 lines · Xiaogang.Chen

From: Xiaogang Chen <[email protected]>

During amdgpu_gem_object_close amdgpu driver cleans vm mapping for the closing drm obj. If the correspondent adev has been unplug got error -ENODEV code. In this case do not need send warning message.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +2 -2
index e3f65977eeee..1b9a6b15b29f 100644
@@ -377,7 +377,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
  		goto out_unlock;
 
  	r = amdgpu_vm_clear_freed(adev, vm, &fence);
-	if (unlikely(r < 0))
+	if (unlikely(r < 0) && !drm_dev_is_unplugged(adev_to_drm(adev)))
  		dev_err(adev->dev, "failed to clear page "
  			"tables on GEM object close (%ld)\n", r);
  	if (r || !fence)
@@ -387,7 +387,7 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
  	dma_fence_put(fence);
 
  out_unlock:
-	if (r)
+	if (r && !drm_dev_is_unplugged(adev_to_drm(adev)))
  		dev_err(adev->dev, "leaking bo va (%ld)\n", r);
  	drm_exec_fini(&exec);
  }
Reviewed-by
#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Seems straight-forward enough.

Quoted 49 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Chen, Xiaogang
Sent: Thursday, November 20, 2025 9:28 AM
To: Chen, Xiaogang <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Don't send warning when close drm obj if drm device has been unplug

ping

Quoted 3 lines · Xiaogang.Chen

From: Xiaogang Chen <[email protected]>

During amdgpu_gem_object_close amdgpu driver cleans vm mapping for the

closing

Review

Quoted 9 lines

drm obj. If the correspondent adev has been unplug got error -ENODEV code. In this case do not need send warning message.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c static void amdgpu_gem_object_close(struct

Quoted 4 lines

index e3f65977eeee..1b9a6b15b29f 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
@@ -377,7 +377,7 @@ static void amdgpu_gem_object_close(struct

drm_gem_object *obj,

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c static void amdgpu_gem_object_close(struct

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
            goto out_unlock;
 
    r = amdgpu_vm_clear_freed(adev, vm, &fence);
-   if (unlikely(r < 0))
+   if (unlikely(r < 0) && !drm_dev_is_unplugged(adev_to_drm(adev)))
            dev_err(adev->dev, "failed to clear page "
                    "tables on GEM object close (%ld)\n", r);
    if (r || !fence)
@@ -387,7 +387,7 @@ static void amdgpu_gem_object_close(struct

drm_gem_object *obj,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
    dma_fence_put(fence);
 
  out_unlock:
-   if (r)
+   if (r && !drm_dev_is_unplugged(adev_to_drm(adev)))
            dev_err(adev->dev, "leaking bo va (%ld)\n", r);
    drm_exec_fini(&exec);
  }