drm/amdgpu: fix disable ras feature failed when unload drvier v2
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix disable ras feature failed when unload drvier v2
v2:
still need call ras_disable_all_featrures to handle ras initilization failure case.
Function amdgpu_device_fini_hw is called before amdgpu_device_fini_sw, so ras ta will unload before send ras disable command, ras dsiable operation must before hw fini.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 - 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -2
@@ -2838,8 +2838,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)if (amdgpu_sriov_vf (adev) && adev->virt.ras_init_done)amdgpu_virt_release_ras_err_handler_data (adev); -amdgpu_ras_pre_fini (adev); -if (adev->gmc.xgmi.num_physical_nodes >1 )amdgpu_xgmi_remove_device (adev);
@@ -3959,6 +3957,9 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)amdgpu_fbdev_fini (adev); +/* disable ras feature must before hw fini */ +amdgpu_ras_pre_fini (adev); +amdgpu_device_ip_fini_early (adev);amdgpu_irq_fini_hw (adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
@@ -2484,7 +2484,6 @@ void amdgpu_ras_late_fini(struct amdgpu_device *adev,amdgpu_ras_sysfs_remove (adev, ras_block);if (ih_info->cb)amdgpu_ras_interrupt_remove_handler (adev, ih_info); -amdgpu_ras_feature_enable (adev, ras_block,0 ); }/* do some init work after IP late init as dependence.
Signature · 1 line
2.17.1
[AMD Official Use Only]
Thanks!
Regards,
Hawking
-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Friday, November 26, 2021 21:26
To: [email protected]; Zhang, Hawking <[email protected]>; Clements, John <[email protected]>; Zhou1, Tao <[email protected]>; Li, Candice <[email protected]>; Chai, Thomas <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review 1/1] drm/amdgpu: fix disable ras feature failed when unload drvier v2
v2:
still need call ras_disable_all_featrures to handle ras initilization failure case.
Function amdgpu_device_fini_hw is called before amdgpu_device_fini_sw, so ras ta will unload before send ras disable command, ras dsiable operation must before hw fini.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 - 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -2
@@ -2838,8 +2838,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)if (amdgpu_sriov_vf (adev) && adev->virt.ras_init_done)amdgpu_virt_release_ras_err_handler_data (adev); -amdgpu_ras_pre_fini (adev); -if (adev->gmc.xgmi.num_physical_nodes >1 )amdgpu_xgmi_remove_device (adev);
@@ -3959,6 +3957,9 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)amdgpu_fbdev_fini (adev); +/* disable ras feature must before hw fini */ +amdgpu_ras_pre_fini (adev); +amdgpu_device_ip_fini_early (adev);amdgpu_irq_fini_hw (adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
@@ -2484,7 +2484,6 @@ void amdgpu_ras_late_fini(struct amdgpu_device *adev,amdgpu_ras_sysfs_remove (adev, ras_block);if (ih_info->cb)amdgpu_ras_interrupt_remove_handler (adev, ih_info); -amdgpu_ras_feature_enable (adev, ras_block,0 ); }/* do some init work after IP late init as dependence.
--
2.17.1