mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] free_irq(): Actually handle DEBUG_SHIRQ
Date: Wed, 12 Sep 2007 12:17:58 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64N.0709121122120.24030@blysk.ds.pg.gda.pl> (raw)

 Code used for DEBUG_SHIRQ in free_irq() is unreachable -- the for() loop 
within never terminates otherwise than by return.  This is an obvious fix.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
 Please apply.

 While at it, I have a question about the complementary code within 
request_irq(): when the option in question is enabled, a spurious IRQ is 
posted before internal setup is done by setup_irq().  This includes the 
->depth counter.  Now if the interrupt handler of some driver calls
disable_irq_nosync(), then code in setup_irq() will mess up the state of 
->depth afterwards if this is the first handler being installed (i.e. 
within the "if (!shared)" block).  This is reported later on when 
enable_irq() called by the driver, by means of a message like this:

Unbalanced enable for IRQ 34
WARNING: at kernel/irq/manage.c:158 enable_irq()

Now given DEBUG_SHIRQ is a debug facility, not to be normally used for 
production, is the phenomenon as described considered a design limitation 
we can live with, or is it a bug that qualifies for a fix?

 I can reproduce this problem easily with phylib.

  Maciej

patch-mips-2.6.23-rc5-20070904-debug-shirq-0
diff -up --recursive --new-file linux-mips-2.6.23-rc5-20070904.macro/kernel/irq/manage.c linux-mips-2.6.23-rc5-20070904/kernel/irq/manage.c
--- linux-mips-2.6.23-rc5-20070904.macro/kernel/irq/manage.c	2007-09-04 04:56:21.000000000 +0000
+++ linux-mips-2.6.23-rc5-20070904/kernel/irq/manage.c	2007-09-11 23:58:59.000000000 +0000
@@ -448,7 +448,7 @@ void free_irq(unsigned int irq, void *de
 			if (action->flags & IRQF_SHARED)
 				handler = action->handler;
 			kfree(action);
-			return;
+			break;
 		}
 		printk(KERN_ERR "Trying to free already-free IRQ %d\n", irq);
 		spin_unlock_irqrestore(&desc->lock, flags);

             reply	other threads:[~2007-09-12 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-12 11:17 Maciej W. Rozycki [this message]
2007-09-12 11:29 ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64N.0709121122120.24030@blysk.ds.pg.gda.pl \
    --to=macro@linux-mips.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®