drm/amd/powerplay: correct swSMU baco reset related settings
Added bif doorbell interrupt setting and applied different settings for BACO reset for RAS recovery. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2aa87ba568
commit
b4f8285a19
|
@ -1668,6 +1668,10 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
|
|||
{
|
||||
|
||||
struct smu_baco_context *smu_baco = &smu->smu_baco;
|
||||
struct amdgpu_device *adev = smu->adev;
|
||||
struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
|
||||
uint32_t bif_doorbell_intr_cntl;
|
||||
uint32_t data;
|
||||
int ret = 0;
|
||||
|
||||
if (smu_v11_0_baco_get_state(smu) == state)
|
||||
|
@ -1675,10 +1679,30 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
|
|||
|
||||
mutex_lock(&smu_baco->mutex);
|
||||
|
||||
if (state == SMU_BACO_STATE_ENTER)
|
||||
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, BACO_SEQ_BACO);
|
||||
else
|
||||
bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL);
|
||||
|
||||
if (state == SMU_BACO_STATE_ENTER) {
|
||||
bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
|
||||
BIF_DOORBELL_INT_CNTL,
|
||||
DOORBELL_INTERRUPT_DISABLE, 1);
|
||||
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
|
||||
|
||||
if (!ras || !ras->supported) {
|
||||
data = RREG32_SOC15(THM, 0, mmTHM_BACO_CNTL);
|
||||
data |= 0x80000000;
|
||||
WREG32_SOC15(THM, 0, mmTHM_BACO_CNTL, data);
|
||||
|
||||
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 0);
|
||||
} else {
|
||||
ret = smu_send_smc_msg_with_param(smu, SMU_MSG_EnterBaco, 1);
|
||||
}
|
||||
} else {
|
||||
ret = smu_send_smc_msg(smu, SMU_MSG_ExitBaco);
|
||||
bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
|
||||
BIF_DOORBELL_INT_CNTL,
|
||||
DOORBELL_INTERRUPT_DISABLE, 0);
|
||||
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl);
|
||||
}
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
|
Loading…
Reference in New Issue