提交 e5da6519 编写于 作者: B Bokun Zhang 提交者: Alex Deucher

drm/amdgpu: Fix SDMA engine resume issue under SRIOV

- Under SRIOV, SDMA engine is shared between VFs. Therefore,
  we will not stop SDMA during hw_fini. This is not an issue
  with normal dirver loading and unloading.

- However, when we put the SDMA engine to suspend state and resume
  it, the issue starts to show up. Something could attempt to use
  that SDMA engine to clear or move memory before the engine is
  initialized since the DRM entity is still there.

- Therefore, we will call sdma_v5_2_enable(false) during hw_fini,
  and if we are under SRIOV, we will call sdma_v5_2_enable(true)
  afterwards to allow other VFs to use SDMA. This way, the DRM
  entity of SDMA engine is emptied and it will follow the flow
  of resume code path.
Tested-by: NBokun Zhang <Bokun.Zhang@amd.com>
Signed-off-by: NBokun Zhang <Bokun.Zhang@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 97997023
......@@ -1357,12 +1357,19 @@ static int sdma_v5_2_hw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (amdgpu_sriov_vf(adev))
return 0;
/*
* Under SRIOV, the VF cannot single-mindedly stop SDMA engine
* However, we still need to clean up the DRM entity
* Therefore, we will re-enable SDMA afterwards.
*/
sdma_v5_2_ctx_switch_enable(adev, false);
sdma_v5_2_enable(adev, false);
if (amdgpu_sriov_vf(adev)) {
sdma_v5_2_enable(adev, true);
sdma_v5_2_ctx_switch_enable(adev, true);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册