linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerlando Falauto <gerlando.falauto@keymile.com>
To: linux-kernel@vger.kernel.org
Cc: Gerlando Falauto <gerlando.falauto@keymile.com>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Holger Brunck <holger.brunck@keymile.com>
Subject: [PATCH 1/1] genirq: drop synchronize_irq() unless CONFIG_SMP
Date: Wed, 18 Jan 2012 08:59:57 +0100	[thread overview]
Message-ID: <1326873597-19188-2-git-send-email-gerlando.falauto@keymile.com> (raw)
In-Reply-To: <1326873597-19188-1-git-send-email-gerlando.falauto@keymile.com>

Since synchronize_irq() only makes sense under SMP,
restore the behavior prior to:

:commit 3aa551c9b4c40018f0e261a178e3d25478dc04a9
:Author: Thomas Gleixner <tglx@linutronix.de>
:Date:   Mon Mar 23 18:28:15 2009 +0100
:
:    genirq: add threaded interrupt handler support

so that it is declared and defined only when CONFIG_SMP=y.
Note that kernel/irq/manage.c only gets compiled when
CONFIG_GENERIC_HARDIRQS=y -- if this is not the case,
you should implement your own.

This fixes startup deadlocks in SMP-unaware drivers which call
disable_irq() within its own handler, and used to work
(by chance), up until 2.6.29.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
---
 include/linux/hardirq.h |    2 +-
 kernel/irq/manage.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index ba36217..82b2e75 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -123,7 +123,7 @@
 # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
 #endif
 
-#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS)
+#if defined(CONFIG_SMP)
 extern void synchronize_irq(unsigned int irq);
 #else
 # define synchronize_irq(irq)	barrier()
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 0a7840a..410da46 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -28,6 +28,7 @@ static int __init setup_forced_irqthreads(char *arg)
 early_param("threadirqs", setup_forced_irqthreads);
 #endif
 
+#if defined(CONFIG_SMP)
 /**
  *	synchronize_irq - wait for pending IRQ handlers (on other CPUs)
  *	@irq: interrupt number to wait for
@@ -72,7 +73,6 @@ void synchronize_irq(unsigned int irq)
 }
 EXPORT_SYMBOL(synchronize_irq);
 
-#ifdef CONFIG_SMP
 cpumask_var_t irq_default_affinity;
 
 /**
-- 
1.7.1


      reply	other threads:[~2012-01-18  8:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  7:59 [PATCH 0/1] genirq: drop synchronize_irq() unless CONFIG_SMP Gerlando Falauto
2012-01-18  7:59 ` Gerlando Falauto [this message]

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=1326873597-19188-2-git-send-email-gerlando.falauto@keymile.com \
    --to=gerlando.falauto@keymile.com \
    --cc=holger.brunck@keymile.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).