* [PATCH 0/11] fix 25 section mismatch warnings..
@ 2008-01-31 22:04 Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
` (11 more replies)
0 siblings, 12 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:04 UTC (permalink / raw)
To: Greg KH, Adrian Bunk, Ingo Molnar, LKML, Andrew Morton
The following set of patches fixes 25 Section mismatch warnings
in following directories:
kernel/
mm/
drivers/pci
arch/x86/
When build individually they are now clean.
The shortlog:
Sam Ravnborg (11):
pci: fix section mismatch warnings referring to pci_do_scan_bus
pci: fix 4x section mismatch warnings
cpu: fix section mismatch warnings for enable_nonboot_cpus
cpu: fix section mismatch related to cpu_chain
cpu: do not annotate exported register_cpu_notifier()
cpu: silence section mismatch warnings for hotcpu notifies
mm: fix section mismatch warning in sparse.c
x86: fix section mismatch warning in acpi/boot.c
x86: silence section mismatch warning in smpboot_64.c
x86: fix section mismatch warning in kernel/pci-calgary
x86: fix section mismatch warnings when referencing notifiers
With these patches applied I have a clean build of arch/x86/
with an allyesconfig.
I expect Greg to pick up the pci patches - but as they conflict with
patches recently posted by Adrian a qualified selection should be made.
The cpu patches are cc:ed to Gautham R Shenoy but I think they
need to go in via Andrew.
The mm patch are cc:ed the Mel, Christoph and Andy but I think this one
should also go in via Andrew.
The x86 patches are cc:ed to the x86 gang and should all go in via the x86 tree.
I would like some extra review of the following patches:
-> The pci patches
-> x86: silence section mismatch warning in smpboot_64.c
The others are more strightforward but please eye ball them too.
For my allyesconfig build I still has 116 warnings - but this is without
Adrian's patches applied.
Of these 8 happens only when running the final check on vmlinux.o which
is due to references between the sub directories (kernel/ <-> arch/x86/kernel/)
Patches follows unnumbered as they are independent of each other.
Sam
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-02-02 10:26 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix 4x section mismatch warnings Sam Ravnborg
` (10 subsequent siblings)
11 siblings, 1 reply; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Greg KH, Adrian Bunk
Fix following warnings:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xb054): Section mismatch in reference from the function cpci_configure_slot() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x153ab): Section mismatch in reference from the function shpchp_configure_device() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(__ksymtab+0xc0): Section mismatch in reference from the variable __ksymtab_pci_do_scan_bus to the function .devinit.text:pci_do_scan_bus()
PCI hotplug were the only user of pci_do_scan_bus()
so moving this function to the directory of
PCI Hotplug was a logical way to fix so
we only include this function in the kernel
when the CONFIG_HOTPLUG_PCI is enabled.
Then the abuse of __devinit could be dropped and
we no longer trigger the above warnings.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Greg KH <gregkh@suse.de>
Cc: Adrian Bunk <bunk@kernel.org>
---
drivers/pci/hotplug/Makefile | 1 +
drivers/pci/hotplug/pci-core.c | 20 ++++++++++++++++++++
drivers/pci/probe.c | 15 ---------------
3 files changed, 21 insertions(+), 15 deletions(-)
create mode 100644 drivers/pci/hotplug/pci-core.c
diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index 34a1891..f755a6e 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -1,6 +1,7 @@
#
# Makefile for the Linux kernel pci hotplug controller drivers.
#
+obj-y := pci-core.o
obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o
obj-$(CONFIG_HOTPLUG_PCI_FAKE) += fakephp.o
diff --git a/drivers/pci/hotplug/pci-core.c b/drivers/pci/hotplug/pci-core.c
new file mode 100644
index 0000000..e0fb169
--- /dev/null
+++ b/drivers/pci/hotplug/pci-core.c
@@ -0,0 +1,20 @@
+/* Core PCI functionality used only by PCI hotplug */
+
+#include <linux/pci.h>
+#include "../pci.h"
+
+
+unsigned int pci_do_scan_bus(struct pci_bus *bus)
+{
+ unsigned int max;
+
+ max = pci_scan_child_bus(bus);
+
+ /*
+ * Make the discovered devices available.
+ */
+ pci_bus_add_devices(bus);
+
+ return max;
+}
+EXPORT_SYMBOL(pci_do_scan_bus);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5fd5852..496fc13 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1050,20 +1050,6 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
return max;
}
-unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
-{
- unsigned int max;
-
- max = pci_scan_child_bus(bus);
-
- /*
- * Make the discovered devices available.
- */
- pci_bus_add_devices(bus);
-
- return max;
-}
-
struct pci_bus * pci_create_bus(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
{
@@ -1156,7 +1142,6 @@ EXPORT_SYMBOL(pci_scan_bus_parented);
#ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_add_new_bus);
-EXPORT_SYMBOL(pci_do_scan_bus);
EXPORT_SYMBOL(pci_scan_slot);
EXPORT_SYMBOL(pci_scan_bridge);
EXPORT_SYMBOL(pci_scan_single_device);
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] pci: fix 4x section mismatch warnings
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch warnings for enable_nonboot_cpus Sam Ravnborg
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Greg KH, Adrian Bunk
The following warnings were issued during build of
drivers/pci with an allyesconfig build:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xdaf): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x15e2): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b0c5): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b32d): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()
Investigating each case closer it looked like all
referred functions are only used in the init phase
or during hotplug.
So to avoid wasting too much memory in the non-hotplug
case the simpler fix was to allow the fuctions to
use code/data from the __devinit sections.
This was done in all four case by adding the __ref
annotation.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Greg KH <gregkh@suse.de>
Cc: Adrian Bunk <bunk@kernel.org>
---
drivers/pci/probe.c | 4 ++--
drivers/pci/setup-bus.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 496fc13..f419026 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -442,7 +442,7 @@ error_register:
return NULL;
}
-struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
+struct pci_bus *__ref pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
{
struct pci_bus *child;
@@ -959,7 +959,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
up_write(&pci_bus_sem);
}
-struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
+struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
{
struct pci_dev *dev;
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 401e03c..86bb6f8 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -440,7 +440,7 @@ pci_bus_size_cardbus(struct pci_bus *bus)
}
}
-void pci_bus_size_bridges(struct pci_bus *bus)
+void __ref pci_bus_size_bridges(struct pci_bus *bus)
{
struct pci_dev *dev;
unsigned long mask, prefmask;
@@ -495,7 +495,7 @@ void pci_bus_size_bridges(struct pci_bus *bus)
}
EXPORT_SYMBOL(pci_bus_size_bridges);
-void pci_bus_assign_resources(struct pci_bus *bus)
+void __ref pci_bus_assign_resources(struct pci_bus *bus)
{
struct pci_bus *b;
struct pci_dev *dev;
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] cpu: fix section mismatch warnings for enable_nonboot_cpus
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix 4x section mismatch warnings Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch related to cpu_chain Sam Ravnborg
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Gautham R Shenoy
Fix following warning:
WARNING: o-x86_64/kernel/built-in.o(.text+0x36d8b): Section mismatch in reference from the function enable_nonboot_cpus() to the function .cpuinit.text:_cpu_up()
enable_nonboot_cpus() are used solely from CONFIG_CONFIG_PM_SLEEP_SMP=y
and PM_SLEEP_SMP imply HOTPLUG_CPU therefore the reference
to _cpu_up() is valid.
Annotate enable_nonboot_cpus() with __ref to silence modpost.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Gautham R Shenoy <ego@in.ibm.com>
---
kernel/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index e0d3a4f..2eff3f6 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -389,7 +389,7 @@ int disable_nonboot_cpus(void)
return error;
}
-void enable_nonboot_cpus(void)
+void __ref enable_nonboot_cpus(void)
{
int cpu, error;
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] cpu: fix section mismatch related to cpu_chain
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (2 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch warnings for enable_nonboot_cpus Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: do not annotate exported register_cpu_notifier() Sam Ravnborg
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Gautham R Shenoy
Fix following warnings:
WARNING: o-x86_64/kernel/built-in.o(.text+0x36de9): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: o-x86_64/kernel/built-in.o(.text+0x36e86): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: o-x86_64/kernel/built-in.o(.text+0x36ea9): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: o-x86_64/kernel/built-in.o(.text+0x36f40): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: o-x86_64/kernel/built-in.o(.text+0x36f8f): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: o-x86_64/kernel/built-in.o(.text+0x370aa): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain
cpu_chain is used by unregister_cpu_notifier() that is used
by the kvm module. So we can call the unregister_cpu_notifier() long
after init completed.
Drop the __cpuinitdata annotation to avoid freeing cpu_chain.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Gautham R Shenoy <ego@in.ibm.com>
---
kernel/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2eff3f6..df9430f 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -18,7 +18,7 @@
/* Serializes the updates to cpu_online_map, cpu_present_map */
static DEFINE_MUTEX(cpu_add_remove_lock);
-static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain);
+static RAW_NOTIFIER_HEAD(cpu_chain);
/* If set, cpu_up and cpu_down will return -EBUSY and do nothing.
* Should always be manipulated under cpu_add_remove_lock
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] cpu: do not annotate exported register_cpu_notifier()
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (3 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch related to cpu_chain Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: silence section mismatch warnings for hotcpu notifies Sam Ravnborg
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Gautham R Shenoy
Fix following warning:
WARNING: o-x86_64/kernel/built-in.o(__ksymtab+0xfb0): Section mismatch in reference from the variable __ksymtab_register_cpu_notifier to the function .cpuinit.text:register_cpu_notifier()
register_cpu_notifier() are used from modules that may be
loaded long after init has completed.
Drop the annotation so the function is kept after init.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Gautham R Shenoy <ego@in.ibm.com>
---
kernel/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c
index df9430f..6fc9864 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -136,7 +136,7 @@ static void cpu_hotplug_done(void)
mutex_unlock(&cpu_hotplug.lock);
}
/* Need to know about CPUs going up/down? */
-int __cpuinit register_cpu_notifier(struct notifier_block *nb)
+int register_cpu_notifier(struct notifier_block *nb)
{
int ret;
cpu_maps_update_begin();
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] cpu: silence section mismatch warnings for hotcpu notifies
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (4 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] cpu: do not annotate exported register_cpu_notifier() Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] mm: fix section mismatch warning in sparse.c Sam Ravnborg
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg, Gautham R Shenoy
The hotcpu_notifier is used to create notifiers to be called later.
It really looks like the functions that are registered are only
relevant in a HOTPLUG_CPU configuration and the correct fix was
to wrap them in an #ifdef / #endif or similar.
But for now just tell modpost to silence the warning by annotating
the static variable with __refdata.
This silences the following warnings in kernel/:
WARNING: o-x86_64/kernel/built-in.o(.data+0x960): Section mismatch in reference from the variable profile_cpu_callback_nb.17240 to the function .devinit.text:profile_cpu_callback()
WARNING: o-x86_64/kernel/built-in.o(.data+0x3fa0): Section mismatch in reference from the variable workqueue_cpu_callback_nb.14663 to the function .devinit.text:workqueue_cpu_callback()
WARNING: o-x86_64/kernel/built-in.o(.data+0xe280): Section mismatch in reference from the variable relay_hotcpu_callback_nb.19247 to the function .cpuinit.text:relay_hotcpu_callback()
Additional warnings are silenced with this change but
they are left put.
This patch is just a workaround for the bad practice
to use __cpuinit to annotate code solely used for
HOTPLUG_CPU.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Gautham R Shenoy <ego@in.ibm.com>
---
include/linux/cpu.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0be8d65..cebb8c0 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -109,7 +109,7 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
extern void get_online_cpus(void);
extern void put_online_cpus(void);
#define hotcpu_notifier(fn, pri) { \
- static struct notifier_block fn##_nb = \
+ static struct notifier_block fn##_nb __refdata = \
{ .notifier_call = fn, .priority = pri }; \
register_cpu_notifier(&fn##_nb); \
}
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] mm: fix section mismatch warning in sparse.c
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (5 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] cpu: silence section mismatch warnings for hotcpu notifies Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in acpi/boot.c Sam Ravnborg
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton
Cc: Sam Ravnborg, Andy Whitcroft, Mel Gorman, Christoph Lameter
Fix following warning:
WARNING: mm/built-in.o(.text+0x22069): Section mismatch in reference from the function sparse_early_usemap_alloc() to the function .init.text:__alloc_bootmem_node()
static sparse_early_usemap_alloc() were used only by sparse_init()
and with sparse_init() annotated _init it is safe to
annotate sparse_early_usemap_alloc with __init too.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <clameter@sgi.com>
---
mm/sparse.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/sparse.c b/mm/sparse.c
index a2183cb..231c7b5 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -237,7 +237,7 @@ static unsigned long *__kmalloc_section_usemap(void)
}
#endif /* CONFIG_MEMORY_HOTPLUG */
-static unsigned long *sparse_early_usemap_alloc(unsigned long pnum)
+static unsigned long *__init sparse_early_usemap_alloc(unsigned long pnum)
{
unsigned long *usemap;
struct mem_section *ms = __nr_to_section(pnum);
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] x86: fix section mismatch warning in acpi/boot.c
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (6 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] mm: fix section mismatch warning in sparse.c Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: silence section mismatch warning in smpboot_64.c Sam Ravnborg
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg
Fix following warning:
WARNING: o-x86_64/arch/x86/kernel/built-in.o(.text+0x13d15): Section mismatch in reference from the function acpi_map_lsapic() to the function .cpuinit.text:mp_register_lapic()
The function acpi_map_lsapic() is exported and thus not annotated.
But the sole user is acpi/processor_core.c in a __cpuinit path.
So create a small wrapper and put back the annotation thus
avoiding the warning.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/x86/kernel/acpi/boot.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 0ca27c7..d2a5843 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -496,7 +496,8 @@ EXPORT_SYMBOL(acpi_register_gsi);
* ACPI based hotplug support for CPU
*/
#ifdef CONFIG_ACPI_HOTPLUG_CPU
-int acpi_map_lsapic(acpi_handle handle, int *pcpu)
+
+static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *obj;
@@ -551,6 +552,11 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
return 0;
}
+/* wrapper to silence section mismatch warning */
+int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu)
+{
+ return _acpi_map_lsapic(handle, pcpu);
+}
EXPORT_SYMBOL(acpi_map_lsapic);
int acpi_unmap_lsapic(int cpu)
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] x86: silence section mismatch warning in smpboot_64.c
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (7 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in acpi/boot.c Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in kernel/pci-calgary Sam Ravnborg
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton
Cc: Sam Ravnborg, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
Silence the following warning:
WARNING: o-x86_64/arch/x86/kernel/built-in.o(.text+0x17cd3): Section mismatch in reference from the function remove_cpu_from_maps() to the variable .cpuinit.data:cpu_initialized
remove_cpu:maps() had a single user: __cpu_disable() so
mark it static and annotate it with __ref to silence the
warning from modpost.
_cpu_disable() has a single user in kernel/cpu.c:
=> take_cpu_down()
which again has a single user in the following call:
=> __stop_machine_run(take_cpu_down, &tcd_param, cpu);
Here a kthread is created.
So maybe the warning is correct and the right fix is to
remove the __cpuinitdata annotation of cpu_initialized?
Note: The analysis were disturbed by the fact that we had a variable
with the same name in cpu/common.c - but this is 32 bit only]
Note: Should smpboot_64 use cpu_clear()?
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
arch/x86/kernel/smpboot_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index cc64b80..d53bd6f 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -1019,7 +1019,7 @@ static void remove_siblinginfo(int cpu)
cpu_clear(cpu, cpu_sibling_setup_map);
}
-void remove_cpu_from_maps(void)
+static void __ref remove_cpu_from_maps(void)
{
int cpu = smp_processor_id();
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] x86: fix section mismatch warning in kernel/pci-calgary
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (8 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] x86: silence section mismatch warning in smpboot_64.c Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warnings when referencing notifiers Sam Ravnborg
2008-01-31 22:39 ` [PATCH 0/11] fix 25 section mismatch warnings Ingo Molnar
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Sam Ravnborg
Fix following warning:
WARNING: arch/x86/kernel/built-in.o(.text+0x1eb41): Section mismatch in reference from the function calgary_handle_quirks() to the function .init.text:calgary_set_split_completion_timeout()
calgary_handle_quirks() are only called at
__init time (in calgary_init_one() via handle_quirks ops).
So annotate this function and the sister function __init.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/x86/kernel/pci-calgary_64.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 21f34db..1fe7f04 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1006,7 +1006,7 @@ static void __init calgary_set_split_completion_timeout(void __iomem *bbar,
readq(target); /* flush */
}
-static void calioc2_handle_quirks(struct iommu_table *tbl, struct pci_dev *dev)
+static void __init calioc2_handle_quirks(struct iommu_table *tbl, struct pci_dev *dev)
{
unsigned char busnum = dev->bus->number;
void __iomem *bbar = tbl->bbar;
@@ -1022,7 +1022,7 @@ static void calioc2_handle_quirks(struct iommu_table *tbl, struct pci_dev *dev)
writel(cpu_to_be32(val), target);
}
-static void calgary_handle_quirks(struct iommu_table *tbl, struct pci_dev *dev)
+static void __init calgary_handle_quirks(struct iommu_table *tbl, struct pci_dev *dev)
{
unsigned char busnum = dev->bus->number;
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] x86: fix section mismatch warnings when referencing notifiers
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (9 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in kernel/pci-calgary Sam Ravnborg
@ 2008-01-31 22:10 ` Sam Ravnborg
2008-01-31 22:39 ` [PATCH 0/11] fix 25 section mismatch warnings Ingo Molnar
11 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-01-31 22:10 UTC (permalink / raw)
To: LKML, Andrew Morton
Cc: Sam Ravnborg, Ingo Molnar, Thomas Gleixner, H. Peter Anvin
Fix the following warnings:
WARNING: arch/x86/kernel/built-in.o(.exit.text+0xf8): Section mismatch in reference from the function msr_exit() to the variable .cpuinit.data:msr_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x158): Section mismatch in reference from the function cpuid_exit() to the variable .cpuinit.data:cpuid_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x171): Section mismatch in reference from the function microcode_exit() to the variable .cpuinit.data:mc_cpu_notifier
In all three cases there were a function annotated __exit
that referenced a variable annotated __cpuinitdata.
The fix was to replace the annotation of the notifier
with __refdata to tell modpost that the reference to
a _cpuinit function in the notifier are OK.
The unregister call that references the notifier
variable will simple delete the function pointer
so there is no problem ignoring the reference.
Note: This looks like another case where __cpuinit
has been used as replacement for proper use
of CONFIG_HOTPLUG_CPU to decide what code are used for
HOTPLUG_CPU.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
arch/x86/kernel/cpuid.c | 2 +-
arch/x86/kernel/microcode.c | 2 +-
arch/x86/kernel/msr.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index dec66e4..a63432d 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -170,7 +170,7 @@ static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb,
return err ? NOTIFY_BAD : NOTIFY_OK;
}
-static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
+static struct notifier_block __refdata cpuid_class_cpu_notifier =
{
.notifier_call = cpuid_class_cpu_callback,
};
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 6ff447f..f2702d0 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -797,7 +797,7 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
return NOTIFY_OK;
}
-static struct notifier_block __cpuinitdata mc_cpu_notifier = {
+static struct notifier_block __refdata mc_cpu_notifier = {
.notifier_call = mc_cpu_callback,
};
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 21f6e3c..bd82850 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -168,7 +168,7 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
return err ? NOTIFY_BAD : NOTIFY_OK;
}
-static struct notifier_block __cpuinitdata msr_class_cpu_notifier = {
+static struct notifier_block __refdata msr_class_cpu_notifier = {
.notifier_call = msr_class_cpu_callback,
};
--
1.5.4.rc3.14.g44397
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 0/11] fix 25 section mismatch warnings..
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
` (10 preceding siblings ...)
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warnings when referencing notifiers Sam Ravnborg
@ 2008-01-31 22:39 ` Ingo Molnar
11 siblings, 0 replies; 14+ messages in thread
From: Ingo Molnar @ 2008-01-31 22:39 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Greg KH, Adrian Bunk, LKML, Andrew Morton
* Sam Ravnborg <sam@ravnborg.org> wrote:
> x86: fix section mismatch warning in acpi/boot.c
> x86: silence section mismatch warning in smpboot_64.c
> x86: fix section mismatch warning in kernel/pci-calgary
> x86: fix section mismatch warnings when referencing notifiers
thanks Sam, i've applied your 4 x86 related fixes to x86.git.
Ingo
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus
2008-01-31 22:10 ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
@ 2008-02-02 10:26 ` Sam Ravnborg
0 siblings, 0 replies; 14+ messages in thread
From: Sam Ravnborg @ 2008-02-02 10:26 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Greg KH, Adrian Bunk
On Thu, Jan 31, 2008 at 11:10:30PM +0100, Sam Ravnborg wrote:
> Fix following warnings:
> WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xb054): Section mismatch in reference from the function cpci_configure_slot() to the function .devinit.text:pci_do_scan_bus()
> WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x153ab): Section mismatch in reference from the function shpchp_configure_device() to the function .devinit.text:pci_do_scan_bus()
> WARNING: o-x86_64/drivers/pci/built-in.o(__ksymtab+0xc0): Section mismatch in reference from the variable __ksymtab_pci_do_scan_bus to the function .devinit.text:pci_do_scan_bus()
>
> PCI hotplug were the only user of pci_do_scan_bus()
> so moving this function to the directory of
> PCI Hotplug was a logical way to fix so
> we only include this function in the kernel
> when the CONFIG_HOTPLUG_PCI is enabled.
>
> Then the abuse of __devinit could be dropped and
> we no longer trigger the above warnings.
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Greg KH <gregkh@suse.de>
> Cc: Adrian Bunk <bunk@kernel.org>
> ---
This patch is bogus - I will send an updated version later this weekend.
Sam
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2008-02-02 10:26 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-31 22:04 [PATCH 0/11] fix 25 section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix section mismatch warnings referring to pci_do_scan_bus Sam Ravnborg
2008-02-02 10:26 ` Sam Ravnborg
2008-01-31 22:10 ` [PATCH] pci: fix 4x section mismatch warnings Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch warnings for enable_nonboot_cpus Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: fix section mismatch related to cpu_chain Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: do not annotate exported register_cpu_notifier() Sam Ravnborg
2008-01-31 22:10 ` [PATCH] cpu: silence section mismatch warnings for hotcpu notifies Sam Ravnborg
2008-01-31 22:10 ` [PATCH] mm: fix section mismatch warning in sparse.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in acpi/boot.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: silence section mismatch warning in smpboot_64.c Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warning in kernel/pci-calgary Sam Ravnborg
2008-01-31 22:10 ` [PATCH] x86: fix section mismatch warnings when referencing notifiers Sam Ravnborg
2008-01-31 22:39 ` [PATCH 0/11] fix 25 section mismatch warnings Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox