2008-08-10 22:08:23

by Marcin Slusarz

[permalink] [raw]
Subject: [PATCH] x86, tsc: fix section mismatch warning

WARNING: vmlinux.o(.text+0x7950): Section mismatch in reference from the function native_calibrate_tsc() to the function .init.text:tsc_read_refs()
The function native_calibrate_tsc() references
the function __init tsc_read_refs().
This is often because native_calibrate_tsc lacks a __init
annotation or the annotation of tsc_read_refs is wrong.

tsc_read_refs is called from native_calibrate_tsc which is not __init
and native_calibrate_tsc cannot be marked __init

Signed-off-by: Marcin Slusarz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/tsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 7603c05..46af716 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -104,7 +104,7 @@ __setup("notsc", notsc_setup);
/*
* Read TSC and the reference counters. Take care of SMI disturbance
*/
-static u64 __init tsc_read_refs(u64 *pm, u64 *hpet)
+static u64 tsc_read_refs(u64 *pm, u64 *hpet)
{
u64 t1, t2;
int i;
--
1.5.4.5


2008-08-11 05:08:08

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86, tsc: fix section mismatch warning

Thanks!

I have pulled these four patches into tip:x86/cleanups.

-hpa

2008-08-17 19:12:59

by Adrian Bunk

[permalink] [raw]
Subject: Re: [PATCH] x86, tsc: fix section mismatch warning

On Sun, Aug 10, 2008 at 10:07:31PM -0700, H. Peter Anvin wrote:
> Thanks!
>
> I have pulled these four patches into tip:x86/cleanups.

Section fixes are not cleanups but bugfixes.

E.g. this patch by Marcin fixes the following 2.6.27 regression
(that was found 4 days after you applied his patch):
http://bugzilla.kernel.org/show_bug.cgi?id=11330

Can you make sure that Marcin's bugfixes makes it into 2.6.27?

> -hpa

TIA
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed