]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: flush coredump work before HW teardown
authorJesse Zhang <Jesse.Zhang@amd.com>
Tue, 24 Mar 2026 09:31:43 +0000 (17:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 30 Mar 2026 18:32:12 +0000 (14:32 -0400)
commitbf89091035e38baf0bba277450f54904e134f113
tree479466025600f6a9e23d47cff3fdea7581396ede
parent557fa5a453c9ccb49a22f30a7ad0545573d434b7
drm/amdgpu: flush coredump work before HW teardown

In amdgpu_device_fini_hw(), deferred coredump formatting work may still
be pending when hardware and IP components are being torn down. Since
the work may access device registers and memory that will be freed or
powered off, it must be completed before proceeding.

Add a flush_work() call for adev->coredump_work, guarded by
CONFIG_DEV_COREDUMP, to ensure any pending coredump work finishes
before the device enters the early IP fini stage.

This avoids potential use-after-free or accessing hardware resources
that are no longer available.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c