linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] irq: print depth in __enable_irq WARNING
@ 2022-03-25  1:33 Chen Lifu
  2022-04-10 19:40 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Lifu @ 2022-03-25  1:33 UTC (permalink / raw)
  To: tglx, linux-kernel

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

Signed-off-by: Chen Lifu <chenlifu@huawei.com>
---
 kernel/irq/manage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c03f71d5ec10..83bb9d9ee71a 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -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: */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] irq: print depth in __enable_irq WARNING
  2022-03-25  1:33 [PATCH -next] irq: print depth in __enable_irq WARNING Chen Lifu
@ 2022-04-10 19:40 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2022-04-10 19:40 UTC (permalink / raw)
  To: Chen Lifu, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-10 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25  1:33 [PATCH -next] irq: print depth in __enable_irq WARNING Chen Lifu
2022-04-10 19:40 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).