drm/amdgpu: Don't send warning when close drm obj if drm device has been unplug
Subsystems (2)
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
@@ -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
ping
Quoted 33 lines · Xiaogang.Chen
From: Xiaogang Chen <[email protected]>
During
amdgpu_gem_object_closeamdgpu driver cleans vm mapping for the closing drm obj. If the correspondent adev has been unplug got error-ENODEVcode. In this case do not need send warning message.Signed-off-by Xiaogang Chen<[email protected]>--- 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@@ -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); }
Russell, Kent
Reviewed-by[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 unplugping
Quoted 3 lines · Xiaogang.Chen
From: Xiaogang Chen <[email protected]>
During
amdgpu_gem_object_closeamdgpu driver cleans vm mapping for theclosing
Review
Quoted 9 lines
drm obj. If the correspondent adev has been unplug got error
-ENODEVcode. In this case do not need send warning message.Signed-off-by Xiaogang Chen<[email protected]>--- 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.cdrivers/gpu/drm/amd/amdgpu/amdgpu_gem.c static void amdgpu_gem_object_close(struct
Quoted 4 lines
index
e3f65977eeee..1b9a6b15b29f100644drivers/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
-1goto 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
-1dma_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); }