drm/amdgpu: Add reset_context flag for host FLR
Subsystems (2)
PATCH 1/1 drm/amdgpu: Add reset_context flag for host FLR
Using the job pointer to check if the FLR comes from the host is wrong, there are other reset triggers that pass NULL for job. So add a flag explicitly for host triggered reset.
Signed-off-by Yunxiang Li <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 1 + drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 1 + drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 1 + drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 1 + 5 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -1
@@ -5678,6 +5678,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,int i, r =0 ;bool need_emergency_restart = false;bool audio_suspended = false; +bool from_hypervisor = false;/* * Special case: RAS triggered and full reset isn't supported
@@ -5825,7 +5826,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,/* Actual ASIC resets if needed.*/ /* Host driver will handle XGMI hive reset for SRIOV */ if (amdgpu_sriov_vf (adev)) { - r =amdgpu_device_reset_sriov (adev, job ? false : true); + from_hypervisor =test_bit (AMDGPU_HOST_FLR , &reset_context.flags); + r =amdgpu_device_reset_sriov (adev, from_hypervisor);if (r) adev->asic_reset_res = r;
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h +1 -0
@@ -33,6 +33,7 @@ enum AMDGPU_RESET_FLAGS {AMDGPU_NEED_FULL_RESET =0 ,AMDGPU_SKIP_HW_RESET =1 ,AMDGPU_SKIP_COREDUMP =2 , + AMDGPU_HOST_FLR = 3, }; struct amdgpu_reset_context {
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +1 -0
@@ -292,6 +292,7 @@ static void xgpu_ai_mailbox_flr_work(struct work_struct *work) reset_context.method =AMD_RESET_METHOD_NONE ; reset_context.reset_req_dev = adev;clear_bit (AMDGPU_NEED_FULL_RESET , &reset_context.flags); +set_bit (AMDGPU_HOST_FLR , &reset_context.flags);amdgpu_device_gpu_recover (adev,NULL , &reset_context); }
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +1 -0
@@ -328,6 +328,7 @@ static void xgpu_nv_mailbox_flr_work(struct work_struct *work) reset_context.method =AMD_RESET_METHOD_NONE ; reset_context.reset_req_dev = adev;clear_bit (AMDGPU_NEED_FULL_RESET , &reset_context.flags); +set_bit (AMDGPU_HOST_FLR , &reset_context.flags);amdgpu_device_gpu_recover (adev,NULL , &reset_context); }
drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c +1 -0
@@ -529,6 +529,7 @@ static void xgpu_vi_mailbox_flr_work(struct work_struct *work) reset_context.method =AMD_RESET_METHOD_NONE ; reset_context.reset_req_dev = adev;clear_bit (AMDGPU_NEED_FULL_RESET , &reset_context.flags); +set_bit (AMDGPU_HOST_FLR , &reset_context.flags);amdgpu_device_gpu_recover (adev,NULL , &reset_context); }
Signature · 1 line
2.34.1