drm/amdgpu: Correct the irq types' num of sdma
Subsystems (2)
PATCH 1/1 drm/amdgpu: Correct the irq types' num of sdma
Fix the issue about TDR-2 will have "fallback timer expired on ring sdma1". It is because the wrong number of irq types setting.
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +3 -3
@@ -1908,7 +1908,7 @@ static int sdma_v4_0_set_ecc_irq_state(struct amdgpu_device *adev, {u32 sdma_edc_config; -u32 reg_offset = (type ==AMDGPU_SDMA_IRQ_ECC0 ) ? +u32 reg_offset = (type ==0 ) ?sdma_v4_0_get_reg_offset (adev,0 , mmSDMA0_EDC_CONFIG) :sdma_v4_0_get_reg_offset (adev,1 , mmSDMA0_EDC_CONFIG);
@@ -2196,10 +2196,10 @@ static const struct amdgpu_irq_src_funcs sdma_v4_0_ecc_irq_funcs = {static void sdma_v4_0_set_irq_funcs (struct amdgpu_device *adev) { - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =2 ; adev->sdma.trap_irq.funcs = &sdma_v4_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v4_0_illegal_inst_irq_funcs; - adev->sdma.ecc_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.ecc_irq.num_types =2 ; adev->sdma.ecc_irq.funcs = &sdma_v4_0_ecc_irq_funcs; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1553672291-31228-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
Am 27.03.19 um 08:38 schrieb Emily Deng:
Quoted 2 lines
Fix the issue about TDR-2 will have "fallback timer expired on ring sdma1". It is because the wrong number of irq types setting.
Good catch, but the solution is not really clean. The correct approach would be to fix the amdgpu_sdma_irq enum.
See the definition:
Quoted 8 lines
enum
amdgpu_sdma_irq{
AMDGPU_SDMA_IRQ_TRAP0= 0,
AMDGPU_SDMA_IRQ_TRAP1,
AMDGPU_SDMA_IRQ_ECC0,
AMDGPU_SDMA_IRQ_ECC1,
AMDGPU_SDMA_IRQ_LAST
};
As far as I can see that doesn't make any sense, cause it denotes the source of the interrupt and not the type.
The AMDGPU_SDMA_IRQ_TRAP0 and AMDGPU_SDMA_IRQ_TRAP1 should be renamed to AMDGPU_SDMA_IRQ_INSTANCE0 and AMDGPU_SDMA_IRQ_INSTANCE1 and the _ECC values removed altogether.
Christian.
Quoted 22 lines
Signed-off-by Emily Deng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1
-1@@ -1908,7 +1908,7 @@ static int sdma_v4_0_set_ecc_irq_state(struct amdgpu_device *adev, {u32 sdma_edc_config; -u32 reg_offset = (type ==AMDGPU_SDMA_IRQ_ECC0 ) ? +u32 reg_offset = (type ==0 ) ?sdma_v4_0_get_reg_offset (adev,0 , mmSDMA0_EDC_CONFIG) :sdma_v4_0_get_reg_offset (adev,1 , mmSDMA0_EDC_CONFIG);@@ -2196,10 +2196,10 @@ static const struct amdgpu_irq_src_funcs sdma_v4_0_ecc_irq_funcs = {static void sdma_v4_0_set_irq_funcs (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c static const struct amdgpu_irq_src_funcs sdma_v4_0_ecc_irq_funcs = { · line 2205
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2
-2{ - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =2 ; adev->sdma.trap_irq.funcs = &sdma_v4_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v4_0_illegal_inst_irq_funcs; - adev->sdma.ecc_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.ecc_irq.num_types =2 ; adev->sdma.ecc_irq.funcs = &sdma_v4_0_ecc_irq_funcs; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 8edd0675-c318-4999-eb59-ba191153c9c2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Thanks, will modify the patch as your good suggestion.
Best wishes
Emily Deng
Quoted 57 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Wednesday, March 27, 2019 7:40 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Correct the irq types' num of sdmaAm 27.03.19 um 08:38 schrieb Emily Deng:
Quoted 2 lines
Fix the issue about TDR-2 will have "fallback timer expired on ring sdma1". It is because the wrong number of irq types setting.
Good catch, but the solution is not really clean. The correct approach would be to fix the
amdgpu_sdma_irqenum.See the definition:
Quoted 8 lines
enum
amdgpu_sdma_irq{
AMDGPU_SDMA_IRQ_TRAP0= 0,
AMDGPU_SDMA_IRQ_TRAP1,
AMDGPU_SDMA_IRQ_ECC0,
AMDGPU_SDMA_IRQ_ECC1,
AMDGPU_SDMA_IRQ_LAST
};As far as I can see that doesn't make any sense, cause it denotes the source of the interrupt and not the type.
The
AMDGPU_SDMA_IRQ_TRAP0andAMDGPU_SDMA_IRQ_TRAP1should be renamed toAMDGPU_SDMA_IRQ_INSTANCE0andAMDGPU_SDMA_IRQ_INSTANCE1and the_ECCvalues removed altogether.Christian.
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c static int sdma_v4_0_set_ecc_irq_state(struct
Quoted 12 lines
Signed-off-by Emily Deng <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +0
-0@@ -1908,7 +1908,7 @@ static int sdma_v4_0_set_ecc_irq_state(struct
amdgpu_device*adev,Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1
-1{u32 sdma_edc_config; -u32 reg_offset = (type ==AMDGPU_SDMA_IRQ_ECC0 ) ? +u32 reg_offset = (type ==0 ) ?sdma_v4_0_get_reg_offset (adev,0 , mmSDMA0_EDC_CONFIG) :sdma_v4_0_get_reg_offset (adev,1 , mmSDMA0_EDC_CONFIG);@@ -2196,10 +2196,10 @@ static const struct amdgpu_irq_src_funcs sdma_v4_0_ecc_irq_funcs = {
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c static const struct amdgpu_irq_src_funcs sdma_v4_0_ecc_irq_funcs = { · line 2204
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2
-2static void sdma_v4_0_set_irq_funcs (struct amdgpu_device *adev) { - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =2 ; adev->sdma.trap_irq.funcs = &sdma_v4_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v4_0_illegal_inst_irq_funcs; - adev->sdma.ecc_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.ecc_irq.num_types =2 ; adev->sdma.ecc_irq.funcs = &sdma_v4_0_ecc_irq_funcs; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx