ARM: Section mismatch warnings
Subsystems (7)
Hi Russell.
I've been building all defconfigs for ARM on latest -linus tree and got the following results with respect to section mismatch warnings.
Unpatched: 105 section mismatch warnings
Applied a path to ignore section mismatch warnings from variables named *_timer.
Result: 39 section mismatch warnings.
I will carry this patch in kbuild.git since it touches only modpost.c
39 looked like a managebale set of warnings so I took a closer look.
With patches that I will post as follow-up for this mail:
Result: 19 section mismatch warnings (where some are duplicates from more than one defconfig).
The remaining warnings are the following:
# This symbol is exported and marked __init.
# Eiteher drop the export or drop the __init marking.
o-arm-mx1ads/log.out:WARNING: arch/arm/mach-imx/built-in.o(__ksymtab+0x80): Section mismatch: reference to .init.text:set_imx_fb_info (after '__ksymtab_set_imx_fb_info')
# These are all almost trivial if one knows the device-model. I did not know enough about the devicemodel to fix them. # I suspect several symbols should NOT be marked __init since they are used in .add assignments and the like
# or mayby __Devinit since they are used only in HOTPLUG scenarios. o-arm-ks8695/log.out:WARNING: arch/arm/mach-ks8695/built-in.o(.data+0x108): Section mismatch: reference to .init.text:micrel_pci_map_irq (after 'micrel_pci') o-arm-lubbock/log.out:WARNING: drivers/built-in.o(.text+0x39f2c): Section mismatch: reference to .init.text:pcmcia_lubbock_init (between 'pcmcia_probe' and 'sa1111_pcmcia_socket_suspend') o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1748): Section mismatch: reference to .init.text:sa1110_mb_disable (between 'neponset_init' and 'neponset_resume') o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x17ac): Section mismatch: reference to .init.data:devices (between 'neponset_init' and 'neponset_resume') o-arm-neponset/log.out:WARNING: drivers/built-in.o(.text+0x4e0a8): Section mismatch: reference to .init.text:pcmcia_neponset_init (between 'pcmcia_probe' and 'sa1111_pcmcia_socket_suspend') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2410/built-in.o(.text+0x80): Section mismatch: reference to .init.data:s3c2410_dma_order (between 's3c2410_dma_add' and 's3c2410_pm_add') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2410/built-in.o(.text+0x84): Section mismatch: reference to .init.data:s3c2410_dma_sel (between 's3c2410_dma_add' and 's3c2410_pm_add') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2412/built-in.o(.text+0x738): Section mismatch: reference to .init.data:s3c2412_dma_sel (between 's3c2412_dma_add' and 's3c2412_pm_prepare') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2440/built-in.o(.text+0x4b8): Section mismatch: reference to .init.data:s3c2440_dma_order (between 's3c2440_dma_add' and 'anubis_nand_select') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2440/built-in.o(.text+0x4bc): Section mismatch: reference to .init.data:s3c2440_dma_sel (between 's3c2440_dma_add' and 'anubis_nand_select') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x1ac): Section mismatch: reference to .init.text:s3c2443_add_sub (between 's3c2443_irq_add' and 's3c2443_irq_wdtac97_mask') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x1c8): Section mismatch: reference to .init.text:s3c2443_add_sub (between 's3c2443_irq_add' and 's3c2443_irq_wdtac97_mask') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x1e4): Section mismatch: reference to .init.text:s3c2443_add_sub (between 's3c2443_irq_add' and 's3c2443_irq_wdtac97_mask') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x200): Section mismatch: reference to .init.text:s3c2443_add_sub (between 's3c2443_irq_add' and 's3c2443_irq_wdtac97_mask') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0x21c): Section mismatch: reference to .init.text:s3c2443_add_sub (between 's3c2443_irq_add' and 's3c2443_irq_wdtac97_mask') o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2443/built-in.o(.text+0xf0c): Section mismatch: reference to .init.data:s3c2443_dma_sel (after 's3c2443_dma_add')
# Assembler stuff. It looked to me like __INIT was used wrongly but then I did not feel confident enough to patch it up - and I cannot test it. o-arm-realview-smp/log.out:WARNING: arch/arm/vfp/built-in.o(.data+0x0): Section mismatch: reference to .init.text:vfp_testing_entry (between 'vfp_vector' and 'vfp_notifier_block') o-arm-versatile/log.out:WARNING: arch/arm/vfp/built-in.o(.data+0x0): Section mismatch: reference to .init.text:vfp_testing_entry (between 'vfp_vector' and 'vfp_notifier_block')
Sam
PATCH 1/1 arm: fix section mismatch warnings
The following patch fixes these section mismatch warnings:
WARNING: drivers/built-in.o(.text+0x49f5c): Section mismatch: reference to .init.text:pcmcia_assabet_init (between 'sa11x0_drv_pcmcia_probe' and 'assabet_pcmcia_socket_state')
WARNING: arch/arm/mach-at91/built-in.o(.text+0xdf4): Section mismatch: reference to .init.data:dk_nand_partition (between 'nand_partitions' and 'at91_leds_event')
WARNING: arch/arm/mach-at91/built-in.o(.text+0xbdc): Section mismatch: reference to .init.data:ek_nand_partition (after 'nand_partitions')
WARNING: arch/arm/mach-at91/built-in.o(.text+0xbdc): Section mismatch: reference to .init.data:ek_nand_partition (between 'nand_partitions' and 'ads7843_pendown_state')
WARNING: arch/arm/mach-at91/built-in.o(.text+0xbdc): Section mismatch: reference to .init.data:ek_nand_partition (after 'nand_partitions')
WARNING: drivers/pcmcia/sa1100_cs.o(.text+0xc): Section mismatch: reference to .init.text:pcmcia_cerf_init (between 'sa11x0_drv_pcmcia_probe' and 'cerf_pcmcia_socket_state')
WARNING: arch/arm/mach-footbridge/built-in.o(.text+0xaa4): Section mismatch: reference to .init.data:cats_pci (between 'cats_pci_init' and 'ebsa285_leds_event')
WARNING: drivers/built-in.o(.text+0x3df80): Section mismatch: reference to .init.text:pcmcia_h3600_init (between 'sa11x0_drv_pcmcia_probe' and 'h3600_pcmcia_socket_state')
WARNING: arch/arm/mach-ixp2000/built-in.o(.text+0xb54): Section mismatch: reference to .init.text:ixp2000_init_irq (between 'ixdp2x00_init_irq' and 'ixdp2x00_irq_handler')
WARNING: arch/arm/mach-ixp23xx/built-in.o(.text+0x670): Section mismatch: reference to .init.text:ixp23xx_pci_common_init (between 'ixp23xx_pci_slave_init' and 'ixp23xx_pci_scan_bus')
WARNING: arch/arm/mach-ixp23xx/built-in.o(.text+0x890): Section mismatch: reference to .init.text:ixp23xx_init_irq (between 'ixdp2351_init_irq' and 'roadrunner_pci_preinit')
WARNING: arch/arm/mach-ixp23xx/built-in.o(.text+0x9a8): Section mismatch: reference to .init.text:ixp23xx_pci_preinit (after 'roadrunner_pci_preinit')
WARNING: arch/arm/mach-at91/built-in.o(.text+0xc28): Section mismatch: reference to .init.data:kb9202_nand_partition (after 'nand_partitions')
WARNING: arch/arm/mach-ks8695/built-in.o(.text+0x2b8): Section mismatch: reference to .init.text:ks8695_add_device_wan (after 'micrel_init')
WARNING: arch/arm/mach-ks8695/built-in.o(.text+0x2bc): Section mismatch: reference to .init.text:ks8695_add_device_lan (after 'micrel_init')
WARNING: drivers/built-in.o(.text+0x3f100): Section mismatch: reference to .init.text:ps2_clear_input (between 'ps2_probe' and 'ps2_cmd_aborted')
WARNING: drivers/built-in.o(.text+0x3f1c8): Section mismatch: reference to .init.text:ps2_clear_input (between 'ps2_probe' and 'ps2_cmd_aborted')
WARNING: arch/arm/mach-imx/built-in.o(__ksymtab+0x80): Section mismatch: reference to .init.text:imx_set_mmc_info (between '__ksymtab_imx_set_mmc_info' and '__ksymtab_set_imx_fb_info')
WARNING: arch/arm/mach-imx/built-in.o(__ksymtab+0x88): Section mismatch: reference to .init.text:set_imx_fb_info (after '__ksymtab_set_imx_fb_info')
WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1930): Section mismatch: reference to .init.data:neponset_port_fns (between 'neponset_probe' and 'assabet_leds_event')
WARNING: drivers/built-in.o(.text+0x4dc8c): Section mismatch: reference to .init.text:pcmcia_assabet_init (between 'sa11x0_drv_pcmcia_probe' and 'assabet_pcmcia_socket_state')
WARNING: drivers/built-in.o(.text+0x4e0bc): Section mismatch: reference to .init.text:pcmcia_neponset_init (between 'pcmcia_probe' and 'sa1111_pcmcia_socket_suspend')
WARNING: drivers/built-in.o(.text+0x4f988): Section mismatch: reference to .init.text:ps2_clear_input (between 'ps2_probe' and 'ps2_cmd_aborted')
WARNING: drivers/built-in.o(.text+0x4fa50): Section mismatch: reference to .init.text:ps2_clear_input (between 'ps2_probe' and 'ps2_cmd_aborted')
All changes are build tested only.
The ones that introduce __devinit ought to have a close review before applying. The rest are trivial.
---
arch/arm/mach-at91/board-dk.c +1 -1
@@ -132,7 +132,7 @@ static struct mtd_partition __initdata dk_nand_partition[] = { }, }; -static struct mtd_partition *nand_partitions (int size,int *num_partitions) +static struct mtd_partition *__init nand_partitions (int size,int *num_partitions) { *num_partitions =ARRAY_SIZE (dk_nand_partition);return dk_nand_partition;
arch/arm/mach-at91/board-kb9202.c +1 -1
@@ -96,7 +96,7 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = { }, }; -static struct mtd_partition *nand_partitions (int size,int *num_partitions) +static struct mtd_partition *__init nand_partitions (int size,int *num_partitions) { *num_partitions =ARRAY_SIZE (kb9202_nand_partition);return kb9202_nand_partition;
arch/arm/mach-at91/board-sam9261ek.c +1 -1
@@ -178,7 +178,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = { }, }; -static struct mtd_partition *nand_partitions (int size,int *num_partitions) +static struct mtd_partition *__init nand_partitions (int size,int *num_partitions) { *num_partitions =ARRAY_SIZE (ek_nand_partition);return ek_nand_partition;
arch/arm/mach-at91/board-sam9263ek.c +1 -1
@@ -180,7 +180,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = { }, }; -static struct mtd_partition *nand_partitions (int size,int *num_partitions) +static struct mtd_partition *__init nand_partitions (int size,int *num_partitions) { *num_partitions =ARRAY_SIZE (ek_nand_partition);return ek_nand_partition;
arch/arm/mach-at91/board-sam9rlek.c +1 -1
@@ -87,7 +87,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = { }, }; -static struct mtd_partition *nand_partitions (int size,int *num_partitions) +static struct mtd_partition *__init nand_partitions (int size,int *num_partitions) { *num_partitions =ARRAY_SIZE (ek_nand_partition);return ek_nand_partition;
arch/arm/mach-footbridge/cats-pci.c +1 -1
@@ -45,7 +45,7 @@ static struct hw_pci cats_pci __initdata = { .postinit = dc21285_postinit, }; -static int cats_pci_init (void ) +static int __init cats_pci_init (void ) {if (machine_is_cats ())pci_common_init (&cats_pci);
arch/arm/mach-imx/generic.c +0 -1
@@ -201,7 +201,6 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info) { imx_mmc_device.dev.platform_data = info; } -EXPORT_SYMBOL (imx_set_mmc_info);static struct imxfb_mach_info imx_fb_info;
arch/arm/mach-ixp2000/ixdp2400.c +1 -1
@@ -164,7 +164,7 @@ int __init ixdp2400_pci_init(void)subsys_initcall (ixdp2400_pci_init); -void ixdp2400_init_irq (void ) +void __init ixdp2400_init_irq (void ) {ixdp2x00_init_irq (IXDP2400_CPLD_INT_STAT ,IXDP2400_CPLD_INT_MASK ,IXDP2400_NR_IRQS ); }
arch/arm/mach-ixp2000/ixdp2800.c +1 -1
@@ -279,7 +279,7 @@ int __init ixdp2800_pci_init(void)subsys_initcall (ixdp2800_pci_init); -void ixdp2800_init_irq (void ) +void __init ixdp2800_init_irq (void ) {ixdp2x00_init_irq (IXDP2800_CPLD_INT_STAT ,IXDP2800_CPLD_INT_MASK ,IXDP2800_NR_IRQS ); }
arch/arm/mach-ixp2000/ixdp2x00.c +1 -1
@@ -145,7 +145,7 @@ static struct irq_chip ixdp2x00_cpld_irq_chip = { .unmask = ixdp2x00_irq_unmask }; -void ixdp2x00_init_irq (volatile unsigned long *stat_reg,volatile unsigned long *mask_reg,unsigned long nr_irqs) +void __init ixdp2x00_init_irq (volatile unsigned long *stat_reg,volatile unsigned long *mask_reg,unsigned long nr_irqs) {unsigned int irq;
arch/arm/mach-ixp23xx/ixdp2351.c +1 -1
@@ -124,7 +124,7 @@ static struct irq_chip ixdp2351_intb_chip = { .unmask = ixdp2351_intb_unmask }; -void ixdp2351_init_irq (void ) +void __init ixdp2351_init_irq (void ) {int irq;
arch/arm/mach-ixp23xx/pci.c +1 -1
@@ -284,7 +284,7 @@ int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys)return 1 ; } -void ixp23xx_pci_slave_init (void ) +void __init ixp23xx_pci_slave_init (void ) {ixp23xx_pci_common_init (); }
arch/arm/mach-ixp23xx/roadrunner.c +1 -1
@@ -110,7 +110,7 @@ static int __init roadrunner_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)return NO_IRQ ; } -static void roadrunner_pci_preinit (void ) +static void __init roadrunner_pci_preinit (void ) {set_irq_type (IRQ_ROADRUNNER_PCI_INTC ,IRQT_LOW );set_irq_type (IRQ_ROADRUNNER_PCI_INTD ,IRQT_LOW );
arch/arm/mach-ks8695/board-micrel.c +1 -1
@@ -35,7 +35,7 @@ static struct ks8695_pci_cfg micrel_pci = {#endif -static void micrel_init (void ) +static void __init micrel_init (void ) {printk (KERN_INFO "Micrel KS8695 Development Board initializing\n" );
arch/arm/mach-sa1100/neponset.c +3 -3
@@ -139,12 +139,12 @@ static u_int neponset_get_mctrl(struct uart_port *port)return ret; } -static struct sa1100_port_fns neponset_port_fns__initdata = { +static struct sa1100_port_fns neponset_port_fns__devinitdata = { .set_mctrl = neponset_set_mctrl, .get_mctrl = neponset_get_mctrl, }; -static int neponset_probe (struct platform_device *dev) +static int __devinit neponset_probe (struct platform_device *dev) {sa1100_register_uart_fns (&neponset_port_fns);
@@ -299,7 +299,7 @@ static struct platform_device *devices[] __initdata = { &smc91x_device, }; -static int __init neponset_init (void ) +static int __devinit neponset_init (void ) {platform_driver_register (&neponset_device_driver);
drivers/input/serio/sa1111ps2.c +2 -2
@@ -170,7 +170,7 @@ static void ps2_close(struct serio *io)/* * Clear the input buffer. */ -static void __init ps2_clear_input (struct ps2if *ps2if) +static void __devinit ps2_clear_input (struct ps2if *ps2if) {int maxread =100 ;
@@ -228,7 +228,7 @@ static int __init ps2_test(struct ps2if *ps2if)/* * Add one device to this driver. */ -static int ps2_probe (struct sa1111_dev *dev) +static int __devinit ps2_probe (struct sa1111_dev *dev) {struct ps2if *ps2if;struct serio *serio;
drivers/pcmcia/sa1100_generic.c +2 -2
@@ -44,7 +44,7 @@int __init pcmcia_collie_init (struct device *dev); -static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { +static int (*sa11x0_pcmcia_hw_init[])(struct device *dev)__initdata = { #ifdef CONFIG_SA1100_ASSABET pcmcia_assabet_init, #endif
@@ -65,7 +65,7 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = {#endif }; -static int sa11x0_drv_pcmcia_probe (struct device *dev) +static int __init sa11x0_drv_pcmcia_probe (struct device *dev) {int i, ret = -ENODEV ;
Re: [PATCH] arm: fix section mismatch warnings
Quoted 20 lines · Sam Ravnborg
arch/arm/mach-sa1100/neponset.c +2
-2@@ -139,12 +139,12 @@ static u_int neponset_get_mctrl(struct uart_port *port)return ret; } -static struct sa1100_port_fns neponset_port_fns__initdata = { +static struct sa1100_port_fns neponset_port_fns__devinitdata = { .set_mctrl = neponset_set_mctrl, .get_mctrl = neponset_get_mctrl, }; -static int neponset_probe (struct platform_device *dev) +static int __devinit neponset_probe (struct platform_device *dev) {sa1100_register_uart_fns (&neponset_port_fns);
arch/arm/mach-sa1100/neponset.c static struct platform_device *devices[] __initdata = { · line 305
Quoted 8 lines
arch/arm/mach-sa1100/neponset.c +1
-1@@ -299,7 +299,7 @@ static struct platform_device *devices[] __initdata = { &smc91x_device, }; -static int __init neponset_init (void ) +static int __devinit neponset_init (void ) {platform_driver_register (&neponset_device_driver);
How can this hunk be correct? neponset_init() is only called from subsys_initcall() - it's not something we want to keep at init time. I'm afraid I suspect faulty section analysis.
Given that (in the other messages) that there's other problems with the warnings being generated, I'm reluctant to apply this off-hand. I feel that the patch need quite careful review to make sure that we're not introducing incorrect stuff such as the above.
I'll try and commit some of these changes this week though.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Re: [PATCH] arm: fix section mismatch warnings
Quoted 10 lines
arch/arm/mach-sa1100/neponset.c static struct platform_device *devices[] __initdata = { · line 304
Quoted 6 lines
arch/arm/mach-sa1100/neponset.c +1
-1-static int __init neponset_init (void ) +static int __devinit neponset_init (void ) {platform_driver_register (&neponset_device_driver);How can this hunk be correct?
neponset_init()is only called fromsubsys_initcall()- it's not something we want to keep at init time. I'm afraid I suspect faulty section analysis.
As covered in other mail - it is not.
The __devinit stuff should all be redone by a knowledgeable person.
Sam
Quoted 7 lines · Sam Ravnborg
# These are all almost trivial if one knows the device-model. I did not know enough about the devicemodel to fix them.
# I suspect several symbols should NOT be marked__initsince they are used in .add assignments and the like# or mayby __Devinit since they are used only in HOTPLUG scenarios.o-arm-ks8695/log.out:WARNING: arch/arm/mach-ks8695/built-in.o(.data+0x108):
Section mismatch: reference to .init.text:micrel_pci_map_irq (after 'micrel_pci')
If this platform can have PCI stuff hotplugged, then this is a problem. If it's fixed then it isn't - PCI IRQ routing will only be used at boot time. IOW, whether such a thing is a problem is conditional on the hardware/configuration which I'm not aware of.
Something for Andrew Victor to comment on.
Quoted 1 line
o-arm-lubbock/log.out:WARNING: drivers/built-in.o(.text+0x39f2c):
Section mismatch: reference to .init.text:pcmcia_lubbock_init (between 'pcmcia_probe' and 'sa1111_pcmcia_socket_suspend')
Quoted 1 line
o-arm-neponset/log.out:WARNING: drivers/built-in.o(.text+0x4e0a8):
Section mismatch: reference to .init.text:pcmcia_neponset_init (between 'pcmcia_probe' and 'sa1111_pcmcia_socket_suspend')
Don't care about the PCMCIA crappy SA11x0 or PXA drivers anymore since they never got converted to a reasonable device model. As long as they work functionally (which they do.) Fixing it without breaking stuff is too big a job for one person, so I'll just ignore this one.
Quoted 1 line
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1748):
Section mismatch: reference to .init.text:sa1110_mb_disable (between 'neponset_init' and 'neponset_resume')
This one looks quite bogus. sa1110_mb_disable() is marked __init, and it's called from neponset_init() which is also marked __init.
Quoted 1 line
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x17ac):
Section mismatch: reference to .init.data:devices (between 'neponset_init' and 'neponset_resume')
No reference to 'devices' (marked __initdata) in neponset_resume but there is in neponset_init(), which is the only reference to it, and it is marked __init. Another false positive?
Quoted 1 line
o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2410/built-in.o(.text+0x80):
Section mismatch: reference to .init.data:s3c2410_dma_order (between 's3c2410_dma_add' and 's3c2410_pm_add')
Don't know enough about s3c stuff, but this one looks like a false positive as well - it's registering a sysdev driver at boot time, and the class and sysdev is only ever also registered at boot time and never unregistered. Adding __init to s3c2410_dma_add would probably be the right thing to do but will move the problem to be a reference to s3c2410_dma_add from s3c2410_dma_driver instead.
Once that's done, might need an annotation of some sort? Not sure.
Quoted 3 lines
# Assembler stuff. It looked to me like
__INITwas used wrongly but then I did not feel confident enough to patch it up - and I cannot test it. o-arm-realview-smp/log.out:WARNING: arch/arm/vfp/built-in.o(.data+0x0):
Section mismatch: reference to .init.text:vfp_testing_entry (between 'vfp_vector' and 'vfp_notifier_block')
This one is probably a real oops waiting to happen - if VFP hardware isn't found and userspace tries to issue a VFP instruction, it could oops the kernel. Will fix (though the fix is rather more in-depth than just removing __INIT.)
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
hi Russell,
Quoted 8 lines
Quoted 1 line
o-arm-ks8695/log.out:WARNING: arch/arm/mach-ks8695/built-in.o(.data+0x108):
Section mismatch: reference to .init.text:micrel_pci_map_irq (after '
micrel_pci')If this platform can have PCI stuff hotplugged, then this is a problem. If it's fixed then it isn't - PCI IRQ routing will only be used at boot time. IOW, whether such a thing is a problem is conditional on the hardware/configuration which I'm not aware of.
The Micrel board doesn't support hotplugged PCI devices.
I guess other KS8695-based boards can have a PCI-to-Cardbus controller, and that would need hotpluged PCI support.
But technically that function should probably not be marked as __init. And "struct ks8695_pci_cfg" should be __initdata.
The PCI support for the KS8695 is not currently merged in mainline. So I will fix this (if nobody has yet) once the PCI support goes in.
Regards,
Andrew Victor
Quoted 7 lines
Quoted 2 lines
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1748):
Section mismatch: reference to .init.text:sa1110_mb_disable (between '
neponset_init' and 'neponset_resume')This one looks quite bogus.
sa1110_mb_disable()is marked__init, and it's called fromneponset_init()which is also marked__init.
Created a neponset.i file - output:
static int neponset_init(void)
{
platform_driver_register(&neponset_device_driver);
So we loose the __init marker during preprocessing. Which is due the the buggy part of my path that adds __devinit.
There was a reason I noted the devinit markers should be reviewed carefully - this one seems wrong.
Quoted 8 lines
Quoted 2 lines
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x17ac):
Section mismatch: reference to .init.data:devices (between '
neponset_init' and 'neponset_resume')No reference to 'devices' (marked
__initdata) inneponset_resumebut there is inneponset_init(), which is the only reference to it, and it is marked__init. Another false positive?
It is between the symbols so the rference will never be in the latter function. In this case it is due to my wrong __devinit marking (again).
Quoted 5 lines
Quoted 2 lines
o-arm-s3c2410/log.out:WARNING: arch/arm/mach-s3c2410/built-in.o(.text+0x80):
Section mismatch: reference to .init.data:s3c2410_dma_order (between '
s3c2410_dma_add' and 's3c2410_pm_add')
Quoted 8 lines
Don't know enough about s3c stuff, but this one looks like a false positive as well - it's registering a sysdev driver at boot time, and the class and sysdev is only ever also registered at boot time and never unregistered. Adding
__inittos3c2410_dma_addwould probably be the right thing to do but will move the problem to be a reference tos3c2410_dma_addfroms3c2410_dma_driverinstead.Once that's done, might need an annotation of some sort? Not sure.
modpost allows references to .init.text from variables named *_driver - so that would work out.
And it is not a 'false positive' in the sense that there is indeed a reference from a .text section to a .init.text section - so the calling function ougth to be marked __init.
So conclusion is that most of these were caused by a wrong marking from my side. But at least I had requested special attention to that part in my patch submission because I knew I was not sure.
I did not see any wrong-doings by modpost.
Sam
Quoted 14 lines · Sam Ravnborg
Quoted 7 lines
Quoted 2 lines
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1748):
Section mismatch: reference to .init.text:sa1110_mb_disable (between '
neponset_init' and 'neponset_resume')This one looks quite bogus.
sa1110_mb_disable()is marked__init, and it's called fromneponset_init()which is also marked__init.Created a neponset.i file - output:
static int
neponset_init(void)
{
platform_driver_register(&neponset_device_driver);
Quoted 5 lines
So we loose the
__initmarker during preprocessing. Which is due the the buggy part of my path that adds__devinit.There was a reason I noted the devinit markers should be reviewed carefully - this one seems wrong.
I don't understand why you added that __devinit in the first place. What happens if you leave it as a mere __init function, as it should be?
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Quoted 15 lines · Russell King
Quoted 14 lines · Sam Ravnborg
Quoted 7 lines
Quoted 2 lines
o-arm-neponset/log.out:WARNING: arch/arm/mach-sa1100/built-in.o(.text+0x1748):
Section mismatch: reference to .init.text:sa1110_mb_disable (between '
neponset_init' and 'neponset_resume')This one looks quite bogus.
sa1110_mb_disable()is marked__init, and it's called fromneponset_init()which is also marked__init.Created a neponset.i file - output:
static int
neponset_init(void)
{
platform_driver_register(&neponset_device_driver);
Quoted 7 lines
Quoted 5 lines
So we loose the
__initmarker during preprocessing. Which is due the the buggy part of my path that adds__devinit.There was a reason I noted the devinit markers should be reviewed carefully - this one seems wrong.
I don't understand why you added that
__devinitin the first place.
Too many children running around seeking attention?
Quoted 1 line
What happens if you leave it as a mere
__initfunction, as it should be?
$ o-arm/scripts/mod/modpost o-arm/arch/arm/mach-sa1100/neponset.o WARNING: o-arm/arch/arm/mach-sa1100/neponset.o(.text+0x300): Section mismatch: reference to .init.data:devices (after 'neponset_probe')
Declaring neponset_probe __init cured it. Sorry for posting the wrong patch in the first place.
Patch below.
Sam
Subject: arm: fix two warnings in mach-sa1100/neponset.c
Fix following warnings:
CC arch/arm/mach-sa1100/neponset.o/home/sam/kernel/kbuild.git/arch/arm/mach-sa1100/neponset.c: In function 'neponset_init':/home/sam/kernel/kbuild.git/arch/arm/mach-sa1100/neponset.c:317: warning: implicit declaration of function 'sa1110_mb_disable'
WARNING: o-arm/arch/arm/mach-sa1100/neponset.o(.text+0x300): Section mismatch: reference to .init.data:devices (after 'neponset_probe')
---
arch/arm/mach-sa1100/neponset.c +3 -1
@@ -21,6 +21,8 @@#include <asm/hardware/sa1111.h> #include <asm/sizes.h> +#include "generic.h" +/* * Install handler for Neponset IRQ. Note that we have to loop here * since the ETHERNET and USAR IRQs are level based, and we need to
@@ -144,7 +146,7 @@ static struct sa1100_port_fns neponset_port_fns __initdata = { .get_mctrl = neponset_get_mctrl, }; -static int neponset_probe (struct platform_device *dev) +static int __init neponset_probe (struct platform_device *dev) {sa1100_register_uart_fns (&neponset_port_fns);
Quoted 2 lines · Sam Ravnborg
Declaring
neponset_probe__initcured it. Sorry for posting the wrong patch in the first place.
Arguably, making neponset_probe __devinit and neponset_port_fns __devinitdata is arguably more correct since any device driver can be bound and unbound at any time (grumble).
I don't think David's platform_driver_probe() is a proper answer since it's still possible to unbind the driver, leaving no way to re-bind. IOW, it only solves half the problem. Really, the allowance of bind/unbind should be a per-driver and per-bus thing imho. That's for a separate discussion though.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: