irq: print depth in __enable_irq WARNING
PATCH 1/1 irq: print depth in __enable_irq WARNING
Since case 0 and 1 of desc->depth may print same warning messages as follows, according to the messages, we do not know in which case the warning is generated. This patch prints extra desc->depth in the warning messages to distinguish these cases.
This patch just does warning message changes,no functional changes.
[20220314100142]------------[ cut here ]------------
[20220314100142]WARNING: CPU: 1 PID: 10332 at kernel/irq/manage.c:723 __enable_irq+0x58/0xa4 [20220314100142]Unbalanced enable for IRQ 38
......
--- kernel/irq/manage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +2 -2
@@ -769,12 +769,12 @@ void disable_nmi_nosync(unsigned int irq)void __enable_irq (struct irq_desc *desc) {switch (desc->depth) {case 0 : err_out: -WARN (1 ,KERN_WARNING "Unbalanced enable for IRQ %d\n" , -irq_desc_get_irq (desc)); +WARN (1 ,KERN_WARNING "depth %u: Unbalanced enable for IRQ %d\n" , + desc->depth,irq_desc_get_irq (desc));break ;case 1 : {if (desc->istate &IRQS_SUSPENDED ) goto err_out;/* Prevent probing on this irq: */
Signature · 1 line
2.35.1
Chen!
On Fri, Mar 25 2022 at 09:33, Chen Lifu wrote:
The subsystem prefix for the interrupt core is 'genirq' as you can easy check via 'git log kernel/irq/manage.c'
Quoted 4 lines
Since case 0 and 1 of
desc->depthmay print same warning messages as follows, according to the messages, we do not know in which case the warning is generated. This patch prints extradesc->depthin the warning messages to distinguish these cases.
This patch prints? The patch cannot print anything.
Please read the patch submission notes in Documentation/process/ including the tip tree specific rules in Documentation/process/maintainer-tip.html
kernel/irq/manage.c void disable_nmi_nosync(unsigned int irq) · line 775
Quoted 9 lines
void
__enable_irq(struct irq_desc *desc)
{kernel/irq/manage.c +2
-2switch (desc->depth) {case 0 : err_out: -WARN (1 ,KERN_WARNING "Unbalanced enable for IRQ %d\n" , -irq_desc_get_irq (desc)); +WARN (1 ,KERN_WARNING "depth %u: Unbalanced enable for IRQ %d\n" , + desc->depth,irq_desc_get_irq (desc));
If we change this then we really want separate messages which makes it clear what this is about. Something like:
if (likely(depth == 1)) {
if (WARN_ONCE(suspended, "Enable of suspended irq %d", irq))
return;
....
return;
}
if (WARN_ONCE(!depth, "Unbalanced enable of irq %d", irq))
return;
desc->depth--;Hmm?
Thanks,
tglx