drm/amdgpu: Skip the coredump collection on reset during driver reload
Subsystems (2)
PATCH 1/1 drm/amdgpu: Skip the coredump collection on reset during driver reload
In passthrough environment, the driver triggers the mode-1 reset on reload. The reset causes the core dump collection which is delayed task and prevents driver from unloading until it is completed. Since we do not need to collect data on "reset on reload" case, we can skip core dump collection.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -1
@@ -5430,7 +5430,8 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle, vram_lost =amdgpu_device_check_vram_lost (tmp_adev); -amdgpu_coredump (tmp_adev, vram_lost, reset_context); +if (!test_bit (AMDGPU_SKIP_COREDUMP , &reset_context->flags)) +amdgpu_coredump (tmp_adev, vram_lost, reset_context);if (vram_lost) {DRM_INFO ("VRAM is lost due to GPU reset!\n" );
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -0
@@ -2481,6 +2481,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)/* Use a common context, just need to make sure full reset is done */ set_bit (AMDGPU_SKIP_HW_RESET , &reset_context.flags); +set_bit (AMDGPU_SKIP_COREDUMP , &reset_context.flags); r =amdgpu_do_asic_reset (&device_list, &reset_context);if (r) {
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +1 -0
@@ -32,6 +32,7 @@ enum AMDGPU_RESET_FLAGS {AMDGPU_NEED_FULL_RESET =0 ,AMDGPU_SKIP_HW_RESET =1 , + AMDGPU_SKIP_COREDUMP = 2, }; struct amdgpu_reset_context {
Signature · 1 line
2.34.1
Quoted 18 lines · Ahmad Rehman
In passthrough environment, the driver triggers the mode-1 reset on reload. The reset causes the core dump collection which is delayed task and prevents driver from unloading until it is completed. Since we do not need to collect data on "reset on reload" case, we can skip core dump collection.
Signed-off-by Ahmad Rehman <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_do_asic_reset(struct list_head *device_list_handle, · line 5433
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-1@@ -5430,7 +5430,8 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle, vram_lost =amdgpu_device_check_vram_lost (tmp_adev); -amdgpu_coredump (tmp_adev, vram_lost, reset_context); +if (!test_bit (AMDGPU_SKIP_COREDUMP , &reset_context->flags))
In addition, use this flag earlier and avoid calling "amdgpu_reset_reg_dumps" based on the flag.
Thanks,
Lijo
Quoted 28 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-0+amdgpu_coredump (tmp_adev, vram_lost, reset_context);if (vram_lost) {DRM_INFO ("VRAM is lost due to GPU reset!\n" );drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1
-0@@ -2481,6 +2481,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)/* Use a common context, just need to make sure full reset is done */ set_bit (AMDGPU_SKIP_HW_RESET , &reset_context.flags); +set_bit (AMDGPU_SKIP_COREDUMP , &reset_context.flags); r =amdgpu_do_asic_reset (&device_list, &reset_context);if (r) {drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +1
-0@@ -32,6 +32,7 @@ enum AMDGPU_RESET_FLAGS {AMDGPU_NEED_FULL_RESET =0 ,AMDGPU_SKIP_HW_RESET =1 , + AMDGPU_SKIP_COREDUMP = 2, }; struct amdgpu_reset_context {