From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Subject: Re: [git pull] sparseirq / irq updates for v2.6.29
Date: Mon, 29 Dec 2008 10:52:44 +0100 [thread overview]
Message-ID: <20081229095244.GA8715@elte.hu> (raw)
In-Reply-To: <20081229094434.GD27293@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> By far the best solution is to move them into a different compilation
> unit - i.e. your first patch - i'll apply that one.
your patch didnt apply, and it also missed the following detail:
kernel/irq/ is only included on genirq architectures - not on some others.
So i ended up with the refactored patch below.
Ingo
---------------->
>From 18aa3101b32c90738182dba89d43f7c984e90e82 Mon Sep 17 00:00:00 2001
From: Yinghai Lu <yhlu.kernel@gmail.com>
Date: Sun, 28 Dec 2008 16:01:13 -0800
Subject: [PATCH] sparseirq: move __weak symbols into separate compilation unit
GCC has a bug with __weak alias functions: if the functions are in
the same compilation unit as their call site, GCC can decide to
inline them - and thus rob the linker of the opportunity to override
the weak alias with the real thing.
So move all the IRQ handling related __weak symbols to kernel/irq/chip.c.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
init/main.c | 10 ----------
kernel/irq/manage.c | 9 ---------
kernel/softirq.c | 20 ++++++++++++++++++++
3 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/init/main.c b/init/main.c
index c314aa1..2c183ab 100644
--- a/init/main.c
+++ b/init/main.c
@@ -539,16 +539,6 @@ void __init __weak thread_info_cache_init(void)
{
}
-int __init __weak arch_early_irq_init(void)
-{
- return 0;
-}
-
-int __init __weak early_irq_init(void)
-{
- return arch_early_irq_init();
-}
-
asmlinkage void __init start_kernel(void)
{
char * command_line;
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c2741b0..46953a0 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -261,15 +261,6 @@ void enable_irq(unsigned int irq)
}
EXPORT_SYMBOL(enable_irq);
-/*
- * [ Not in kernel/irq/handle.c, so that GCC does not
- * inline the __weak alias: ]
- */
-int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
-{
- return 0;
-}
-
static int set_irq_wake_real(unsigned int irq, unsigned int on)
{
struct irq_desc *desc = irq_to_desc(irq);
diff --git a/kernel/softirq.c b/kernel/softirq.c
index e7c69a7..daf4635 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -797,3 +797,23 @@ int on_each_cpu(void (*func) (void *info), void *info, int wait)
}
EXPORT_SYMBOL(on_each_cpu);
#endif
+
+/*
+ * [ These __weak aliases are kept in a separate compilation unit, so that
+ * GCC does not inline them incorrectly. ]
+ */
+
+int __init __weak early_irq_init(void)
+{
+ return 0;
+}
+
+int __init __weak arch_early_irq_init(void)
+{
+ return 0;
+}
+
+int __weak arch_init_chip_data(struct irq_desc *desc, int cpu)
+{
+ return 0;
+}
next prev parent reply other threads:[~2008-12-29 9:53 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-25 16:07 [git pull] sparseirq / irq updates for v2.6.29 Ingo Molnar
2008-12-27 13:32 ` Ingo Molnar
2008-12-27 17:27 ` KOSAKI Motohiro
2008-12-27 17:38 ` Ingo Molnar
2008-12-28 23:11 ` Linus Torvalds
2008-12-28 23:23 ` Yinghai Lu
2008-12-28 23:27 ` Ingo Molnar
2008-12-28 23:30 ` Ingo Molnar
2008-12-29 0:01 ` Yinghai Lu
2008-12-29 8:39 ` KOSAKI Motohiro
2008-12-29 11:09 ` Ingo Molnar
2008-12-29 11:20 ` KOSAKI Motohiro
2008-12-29 0:28 ` Yinghai Lu
2008-12-29 0:53 ` Yinghai Lu
2008-12-29 9:44 ` Ingo Molnar
2008-12-29 9:52 ` Ingo Molnar [this message]
2008-12-29 11:00 ` Kamalesh Babulal
2008-12-29 11:05 ` Ingo Molnar
2008-12-29 16:05 ` Kamalesh Babulal
2008-12-29 16:20 ` Ingo Molnar
2008-12-29 16:22 ` KOSAKI Motohiro
2008-12-29 16:36 ` Ingo Molnar
2008-12-28 23:55 ` H. Peter Anvin
2008-12-29 0:06 ` Yinghai Lu
2008-12-29 0:38 ` H. Peter Anvin
2008-12-29 9:34 ` Ingo Molnar
2008-12-28 23:10 ` [git pull] sparseirq / irq fixes Ingo Molnar
2008-12-29 12:52 ` Ingo Molnar
2008-12-31 0:22 ` Linus Torvalds
2008-12-31 6:48 ` Ingo Molnar
2008-12-31 12:00 ` [sparseirq] remove debug printks (io_apic.c) Markus Trippelsdorf
2009-01-02 22:21 ` Ingo Molnar
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=20081229095244.GA8715@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yinghai@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