drm/amd/display: add a WARN() to irq service functions
Subsystems (3)
PATCH 1/1 drm/amd/display: add a WARN() to irq service functions
Currently, if we encounter unimplemented functions, it is difficult to tell what caused them just by looking at dmesg and that is compounded by the fact that it is often hard to reproduce said issues. So, to have access to more detailed debugging information, add a WARN() to dal_irq_service_ack() and dal_irq_service_set() that only triggers when we encounter an unimplemented function.
--- drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +8 -2
@@ -112,8 +112,11 @@ bool dal_irq_service_set(dal_irq_service_ack (irq_service, source); -if (info->funcs && info->funcs->set) +if (info->funcs && info->funcs->set) { +WARN (info->funcs->set == dal_irq_service_dummy_set, +"%s: src: %d, st: %d\n" , __func__, source, enable);return info->funcs->set (irq_service, info, enable); + }dal_irq_service_set_generic (irq_service, info, enable);
@@ -146,8 +149,11 @@ bool dal_irq_service_ack(return false; } -if (info->funcs && info->funcs->ack) +if (info->funcs && info->funcs->ack) { +WARN (info->funcs->ack == dal_irq_service_dummy_ack, +"%s: src: %d\n" , __func__, source);return info->funcs->ack (irq_service, info); + }dal_irq_service_ack_generic (irq_service, info);
Signature · 1 line
2.38.0
Hi Hamza,
Quoted 6 lines · Hamza Mahfooz
Currently, if we encounter unimplemented functions, it is difficult to tell what caused them just by looking at dmesg and that is compounded by the fact that it is often hard to reproduce said issues. So, to have access to more detailed debugging information, add a
WARN()todal_irq_service_ack()anddal_irq_service_set()that only triggers when we encounter an unimplemented function.
Do you know the specific issue that triggered this unimplemented function? It might be useful to describe the situation in the commit message where you see this problem.
Quoted 11 lines
Signed-off-by Hamza Mahfooz <[email protected]>--- drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/irq/irq_service.c +0
-0
drivers/gpu/drm/amd/display/dc/irq/irq_service.c bool dal_irq_service_set( · line 118
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +3
-1@@ -112,8 +112,11 @@ bool dal_irq_service_set(dal_irq_service_ack (irq_service, source); -if (info->funcs && info->funcs->set) +if (info->funcs && info->funcs->set) { +WARN (info->funcs->set == dal_irq_service_dummy_set, +"%s: src: %d, st: %d\n" , __func__, source, enable);return info->funcs->set (irq_service, info, enable);
Do you know if we may hit this condition multiple times?
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +1
-0+ }dal_irq_service_set_generic (irq_service, info, enable);@@ -146,8 +149,11 @@ bool dal_irq_service_ack(return false; }
drivers/gpu/drm/amd/display/dc/irq/irq_service.c bool dal_irq_service_ack( · line 159
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +4
-1-if (info->funcs && info->funcs->ack) +if (info->funcs && info->funcs->ack) { +WARN (info->funcs->ack == dal_irq_service_dummy_ack, +"%s: src: %d\n" , __func__, source);return info->funcs->ack (irq_service, info); + }dal_irq_service_ack_generic (irq_service, info);
Just for curiosity, did you run some IGT tests?
Thanks
Siqueira
Quoted 12 lines · Rodrigo Siqueira
Hi Hamza,
Quoted 6 lines · Hamza Mahfooz
Currently, if we encounter unimplemented functions, it is difficult to tell what caused them just by looking at dmesg and that is compounded by the fact that it is often hard to reproduce said issues. So, to have access to more detailed debugging information, add a
WARN()todal_irq_service_ack()anddal_irq_service_set()that only triggers when we encounter an unimplemented function.Do you know the specific issue that triggered this unimplemented function? It might be useful to describe the situation in the commit message where you see this problem.
Ya, I'll do that in v2.
Quoted 6 lines
Quoted 6 lines
Signed-off-by Hamza Mahfooz <[email protected]>---
drivers/gpu/drm/amd/display/dc/irq/irq_service.c| 10 ++++++++--1 file changed, 8 insertions(+), 2 deletions(-)
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c bool dal_irq_service_set( · line 116
Quoted 11 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +3
-1@@ -112,8 +112,11 @@ bool dal_irq_service_set( dal_irq_service_ack(irq_service, source); - if (info->funcs && info->funcs->set) + if (info->funcs && info->funcs->set) { + WARN(info->funcs->set == dal_irq_service_dummy_set, + "%s: src: %d, st: %d\n", __func__, source, enable); return info->funcs->set(irq_service, info, enable);Do you know if we may hit this condition multiple times?
Yes, it is possible that it will be hit multiple times from different callers.
Quoted 15 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c bool dal_irq_service_ack( · line 156
Quoted 13 lines
drivers/gpu/drm/amd/display/dc/irq/irq_service.c +5
-1+ } dal_irq_service_set_generic(irq_service, info, enable);@@ -146,8 +149,11 @@ bool dal_irq_service_ack( return false; } - if (info->funcs && info->funcs->ack) + if (info->funcs && info->funcs->ack) { + WARN(info->funcs->ack == dal_irq_service_dummy_ack, + "%s: src: %d\n", __func__, source); return info->funcs->ack(irq_service, info); + } dal_irq_service_ack_generic(irq_service, info);Just for curiosity, did you run some IGT tests?
No, this was encountered during manual testing.
Quoted 4 lines
Thanks
Siqueira
Signature · 1 line
Hamza