drm/amdgpu/sdma5: fix number of sdma5 trap irq types for navi1x
Subsystems (2)
PATCH 1/1 drm/amdgpu/sdma5: fix number of sdma5 trap irq types for navi1x
navi1x has 2 sdma engines but commit
"e7b58d03b678 drm/amdgpu: reorganize sdma v4 code to support more instances" changes the max number of sdma irq types (AMDGPU_SDMA_IRQ_LAST) from 2 to 8 which causes amdgpu_irq_gpu_reset_resume_helper() to recover irq of sdma engines with following logic:
(enable irq for sdma0) * 1 time
(enable irq for sdma1) * 1 time
(disable irq for sdma1) * 6 times
as a result, after gpu reset, interrupt for sdma1 is lost.
for asics with more sdma5 engines, we need to set 'num_types' depending on asic type just like what sdma_v4_0_set_irq_funcs() does.
--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -1
@@ -1625,7 +1625,7 @@ static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = {static void sdma_v5_0_set_irq_funcs (struct amdgpu_device *adev) { - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_INSTANCE2 ; adev->sdma.trap_irq.funcs = &sdma_v5_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v5_0_illegal_inst_irq_funcs; }
Signature · 6 lines
2.20.1 _______________________________________________ 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): [email protected]
Quoted 26 lines · Xiaojie
navi1x has 2 sdma engines but commit
"e7b58d03b678drm/amdgpu: reorganize sdma v4 code to support more instances" changes the max number of sdma irq types (AMDGPU_SDMA_IRQ_LAST) from 2 to 8 which causesamdgpu_irq_gpu_reset_resume_helper()to recover irq of sdma engines with following logic:(enable irq for sdma0) * 1 time
(enable irq for sdma1) * 1 time
(disable irq for sdma1) * 6 timesas a result, after gpu reset, interrupt for sdma1 is lost.
for asics with more sdma5 engines, we need to set '
num_types' depending on asic type just like whatsdma_v4_0_set_irq_funcs()does.Signed-off-by Xiaojie Yuan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = { · line 1628
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1
-1@@ -1625,7 +1625,7 @@ static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = {static void sdma_v5_0_set_irq_funcs (struct amdgpu_device *adev) { - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_INSTANCE2 ;
It would be more future proof to set the num_types based on the num instances.
Alex
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +0
-1adev->sdma.trap_irq.funcs = &sdma_v5_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v5_0_illegal_inst_irq_funcs; } --2.20.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): CADnq5_PgU-L3CmCC6m-R3Tb6EG7-YUB6yS5Miy2_oqW8OngyZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Thanks Alex. I've sent out patch v2.
BR,
Xiaojie
Quoted 30 lines · Alex Deucher
Quoted 29 lines · Xiaojie
navi1x has 2 sdma engines but commit
"e7b58d03b678drm/amdgpu: reorganize sdma v4 code to support more instances" changes the max number of sdma irq types (AMDGPU_SDMA_IRQ_LAST) from 2 to 8 which causesamdgpu_irq_gpu_reset_resume_helper()to recover irq of sdma engines with following logic:(enable irq for sdma0) * 1 time
(enable irq for sdma1) * 1 time
(disable irq for sdma1) * 6 timesas a result, after gpu reset, interrupt for sdma1 is lost.
for asics with more sdma5 engines, we need to set '
num_types' depending on asic type just like whatsdma_v4_0_set_irq_funcs()does.Signed-off-by Xiaojie Yuan <[email protected]>---
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +0
-0@@ -1625,7 +1625,7 @@ static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = {
Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = { · line 1628
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1
-1static void sdma_v5_0_set_irq_funcs (struct amdgpu_device *adev) { - adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_LAST ; + adev->sdma.trap_irq.num_types =AMDGPU_SDMA_IRQ_INSTANCE2 ;It would be more future proof to set the
num_typesbased on the num instances.Alex
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +0
-1adev->sdma.trap_irq.funcs = &sdma_v5_0_trap_irq_funcs; adev->sdma.illegal_inst_irq.funcs = &sdma_v5_0_illegal_inst_irq_funcs; } --2.20.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx