Need to make sure gfxoff is disallowed when we touch GC
registers over MMIO.

Cc: Yifan Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
index 4d5c6bdd8cad7..d5ca57b670cd0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
@@ -4787,6 +4787,7 @@ static int gfx_v12_0_set_eop_interrupt_state(struct 
amdgpu_device *adev,
                                            unsigned type,
                                            enum amdgpu_interrupt_state state)
 {
+       amdgpu_gfx_off_ctrl(adev, false);
        switch (type) {
        case AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP:
                gfx_v12_0_set_gfx_eop_interrupt_state(adev, 0, 0, state);
@@ -4809,6 +4810,8 @@ static int gfx_v12_0_set_eop_interrupt_state(struct 
amdgpu_device *adev,
        default:
                break;
        }
+       amdgpu_gfx_off_ctrl(adev, true);
+
        return 0;
 }
 
@@ -4873,6 +4876,7 @@ static int gfx_v12_0_set_priv_reg_fault_state(struct 
amdgpu_device *adev,
        u32 cp_int_cntl_reg, cp_int_cntl;
        int i, j;
 
+       amdgpu_gfx_off_ctrl(adev, false);
        switch (state) {
        case AMDGPU_IRQ_STATE_DISABLE:
        case AMDGPU_IRQ_STATE_ENABLE:
@@ -4907,6 +4911,7 @@ static int gfx_v12_0_set_priv_reg_fault_state(struct 
amdgpu_device *adev,
        default:
                break;
        }
+       amdgpu_gfx_off_ctrl(adev, true);
 
        return 0;
 }
@@ -4919,6 +4924,7 @@ static int gfx_v12_0_set_bad_op_fault_state(struct 
amdgpu_device *adev,
        u32 cp_int_cntl_reg, cp_int_cntl;
        int i, j;
 
+       amdgpu_gfx_off_ctrl(adev, false);
        switch (state) {
        case AMDGPU_IRQ_STATE_DISABLE:
        case AMDGPU_IRQ_STATE_ENABLE:
@@ -4953,6 +4959,8 @@ static int gfx_v12_0_set_bad_op_fault_state(struct 
amdgpu_device *adev,
        default:
                break;
        }
+       amdgpu_gfx_off_ctrl(adev, true);
+
        return 0;
 }
 
@@ -4964,6 +4972,7 @@ static int gfx_v12_0_set_priv_inst_fault_state(struct 
amdgpu_device *adev,
        u32 cp_int_cntl_reg, cp_int_cntl;
        int i, j;
 
+       amdgpu_gfx_off_ctrl(adev, false);
        switch (state) {
        case AMDGPU_IRQ_STATE_DISABLE:
        case AMDGPU_IRQ_STATE_ENABLE:
@@ -4984,6 +4993,7 @@ static int gfx_v12_0_set_priv_inst_fault_state(struct 
amdgpu_device *adev,
        default:
                break;
        }
+       amdgpu_gfx_off_ctrl(adev, true);
 
        return 0;
 }
-- 
2.52.0

Reply via email to