[PATCH v1 3/7] drm/amdgpu: always keep the latest coredump

Pierre-Eric Pelloux-Prayer pierre-eric.pelloux-prayer at amd.com
Wed May 21 09:49:05 UTC 2025


Coredumps are automatically removed after 5 minutes, but if a new one
is created while one exists already, the new one is discarded silently.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
index 6fa53e070b50..1dfc5473d2ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
@@ -400,6 +400,11 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
 
 	ktime_get_ts64(&coredump->reset_time);
 
+	/* Delete the previous coredump if any, otherwise dev_coredumpm will fail silently
+	 * and the older one will be kept.
+	 */
+	dev_coredump_put(dev->dev);
+
 	dev_coredumpm(dev->dev, THIS_MODULE, coredump, 0, GFP_NOWAIT,
 		      amdgpu_devcoredump_read, amdgpu_devcoredump_free);
 
-- 
2.43.0



More information about the amd-gfx mailing list