]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: unmap all user mappings of framebuffer and doorbell before mode1 reset
authorYifan Zhang <yifan1.zhang@amd.com>
Mon, 11 May 2026 14:14:23 +0000 (22:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 16:14:55 +0000 (12:14 -0400)
commit353f7430d1eccd481cc089decd1fc377d4312f4a
tree67444122913e1185cf1cd1f336811946bf29b3bb
parent6c92f6d9600efa3ef0d9e560a2b52776d9803c29
drm/amdgpu: unmap all user mappings of framebuffer and doorbell before mode1 reset

During Mode 1 reset, the ASIC undergoes a reset cycle and becomes temporarily
inaccessible via PCIe. Any attempt to access framebuffer or MMIO registers during
this window can result in uncompleted PCIe transactions, leading to NMI panics or
system hangs.

To prevent this, Unmap all of the applications mappings of the framebuffer
and doorbell BARs before mode1 reset. Also prevent new mappings from coming in
during the reset process.

v2: remove inode in kfd_dev (Christian)
v3: correct unmap offset (Felix), remove prevent new mappings part
to avoid deadlock (Christian)

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 70cadefcc6160c575b04f763ada34c20e868d577)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h