Re: [PATCH -next] irq: print depth in __enable_irq WARNING

From: Thomas Gleixner
Date: Sun Apr 10 2022 - 15:40:35 EST


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'

> 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 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

> 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));

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