Commit aad6d96a authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amdgpu: perform srbm soft reset always on SDMA resume

This can address the random SDMA hang after pci config reset
seen on Hawaii.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Tested-by: default avatarSandeep Raghuraman <sandy.8925@gmail.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 93b96255
...@@ -1071,22 +1071,19 @@ static int cik_sdma_soft_reset(void *handle) ...@@ -1071,22 +1071,19 @@ static int cik_sdma_soft_reset(void *handle)
{ {
u32 srbm_soft_reset = 0; u32 srbm_soft_reset = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
u32 tmp = RREG32(mmSRBM_STATUS2); u32 tmp;
if (tmp & SRBM_STATUS2__SDMA_BUSY_MASK) { /* sdma0 */
/* sdma0 */ tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET);
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET); tmp |= SDMA0_F32_CNTL__HALT_MASK;
tmp |= SDMA0_F32_CNTL__HALT_MASK; WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp);
WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp); srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK;
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK;
} /* sdma1 */
if (tmp & SRBM_STATUS2__SDMA1_BUSY_MASK) { tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET);
/* sdma1 */ tmp |= SDMA0_F32_CNTL__HALT_MASK;
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET); WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp);
tmp |= SDMA0_F32_CNTL__HALT_MASK; srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK;
WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp);
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK;
}
if (srbm_soft_reset) { if (srbm_soft_reset) {
tmp = RREG32(mmSRBM_SOFT_RESET); tmp = RREG32(mmSRBM_SOFT_RESET);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment