Skip to contentSkip to conversation

Fix section mismatch in de2104x.c

PATCH In review Matthew Wilcox 4 participants 11 messages Oct 6, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix section mismatch in de2104x.c

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

---
 drivers/net/tulip/de2104x.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/tulip/de2104x.c +4 -4
index 2cfd963..f6b3a94 100644
@@ -1730,7 +1730,7 @@ static void __init de21040_get_media_inf
 }
 
 /* Note: this routine returns extra data bits for size detection. */
-static unsigned __init tulip_read_eeprom(void __iomem *regs, int location, int addr_len)
+static unsigned __devinit tulip_read_eeprom(void __iomem *regs, int location, int addr_len)
 {
 	int i;
 	unsigned retval = 0;
@@ -1926,7 +1926,7 @@ bad_srom:
 	goto fill_defaults;
 }
 
-static int __init de_init_one (struct pci_dev *pdev,
+static int __devinit de_init_one (struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
 	struct net_device *dev;
@@ -2082,7 +2082,7 @@ err_out_free:
 	return rc;
 }
 
-static void __exit de_remove_one (struct pci_dev *pdev)
+static void __devexit de_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct de_private *de = dev->priv;
@@ -2164,7 +2164,7 @@ static struct pci_driver de_driver = {
 	.name		= DRV_NAME,
 	.id_table	= de_pci_tbl,
 	.probe		= de_init_one,
-	.remove		= __exit_p(de_remove_one),
+	.remove		= __devexit_p(de_remove_one),
 #ifdef CONFIG_PM
 	.suspend	= de_suspend,
 	.resume		= de_resume,
#1 lore raw
Quoted 4 lines · Matthew Wilcox

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

I'm a bit blind, so help me out here... what precisely is mismatched?

AFAICS everything is properly marked __init or __exit.

Jeff

#2 lore raw
Quoted 3 lines · Jeff Garzik

I'm a bit blind, so help me out here... what precisely is mismatched?

AFAICS everything is properly marked __init or __exit.

Wasn't my patch, but the markings are now consistent with tulip_core at least.

#3 lore raw
Quoted 6 lines · Matthew Wilcox
Quoted 3 lines · Jeff Garzik

I'm a bit blind, so help me out here... what precisely is mismatched?

AFAICS everything is properly marked __init or __exit.

Wasn't my patch, but the markings are now consistent with tulip_core at least.

That's a totally separate driver :)

These section mismatch warnings occasionally stump me, and this is one of them. I don't want to ACK it until I know _why_ it is needed...

Jeff

#4 lore raw

More info on section mismatches (was Re: [PATCH] [TULIP] Fix section mismatch in de2104x.c)

In reply to Jeff Garzik
Quoted 10 lines · Jeff Garzik
Quoted 8 lines · Matthew Wilcox

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

Quoted 3 lines

I'm a bit blind, so help me out here... what precisely is mismatched?

AFAICS everything is properly marked __init or __exit.

(Cc'd Richard Henderson as resident gcc guru.)

We're discussing a way to get more information out of section mismatch reports so that the causes of section mismatches are a little more obvious. I'd like to see something like:

foo() is marked __init at line 34
bar() calls foo() at line 57

Arjan points out that optimization may make this difficult; I'm happy with a separate script running at a lower level of optimization that you can run by hand when one of these warnings shows up.

Ideas?

-VAL

#5 lore raw
In reply to Matthew Wilcox
Quoted 4 lines · On Fri, 06 Oct 2006 12:12:34 -0600 Matthew Wilcox <[email protected]> wrote:

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

This is caused because with PCI hotplug the device might be probed after the init section has been removed. Ditto for remove.

The fix looks correct.

#6 lore raw
Quoted 10 lines · Stephen Hemminger
Quoted 4 lines · On Fri, 06 Oct 2006 12:12:34 -0600 Matthew Wilcox <[email protected]> wrote:

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

This is caused because with PCI hotplug the device might be probed after the init section has been removed. Ditto for remove.

This device will never ever meet a platform where it can be hotplugged.

Jeff

#7 lore raw
Quoted 13 lines · Jeff Garzik
Quoted 12 lines · Stephen Hemminger
Quoted 8 lines · On Fri, 06 Oct 2006 12:12:34 -0600 Matthew Wilcox <[email protected]> wrote:

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

Quoted 5 lines
Quoted 3 lines

This is caused because with PCI hotplug the device might be probed after the init section
has been removed. Ditto for remove.

This device will never ever meet a platform where it can be hotplugged.

According to a FreeBSD list from 1995, you could get these chips on a PCI card from several different vendors.

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=37148+0+archive/1995/freebsd-hardware/19951001.freebsd-hardware

#8 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 8 lines · Jeff Garzik
Quoted 7 lines · Stephen Hemminger
Quoted 4 lines · On Fri, 06 Oct 2006 12:12:34 -0600 Matthew Wilcox <[email protected]> wrote:

From: Helge Deller <[email protected]>

WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .init.text:de_init_one from .data.rel.local after 'de_driver' (at offset 0x20)
WARNING: drivers/net/tulip/de2104x.o - Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset 0x28)

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

This is caused because with PCI hotplug the device might be probed after the init section has been removed. Ditto for remove.

This device will never ever meet a platform where it can be hotplugged.

According to a FreeBSD list from 1995, you could get these chips on a PCI card from several different vendors.

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=37148+0+archive/1995/freebsd-hardware/19951001.freebsd-hardware

Yes, they are ancient 32-bit PCI cards, which will never make an appearance on a PCI hotplug platform. So, it's wasteful to support hotplug in code that will never be hotplugged (as I've said for years).

Jeff

#9 lore raw
Quoted 11 lines · Jeff Garzik
Quoted 6 lines · Matthew Wilcox
Quoted 1 line · Jeff Garzik

This device will never ever meet a platform where it can be hotplugged.

According to a FreeBSD list from 1995, you could get these chips on a PCI card from several different vendors.

Yes, they are ancient 32-bit PCI cards, which will never make an appearance on a PCI hotplug platform. So, it's wasteful to support hotplug in code that will never be hotplugged (as I've said for years).

Sorry, you're saying that anyone who has found one of these cards and wants to plug them into a hotplug slot in their shiny new server is just SOL? That makes no sense, Jeff. We've fixed *so* many old drivers to confirm to these rules, why's this one so special? I'd understand if it were only found on motherboards, but it can be found on cards.

Plus it silences a warning. Isn't that enough reason of its own?

#10 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 7 lines · Jeff Garzik
Quoted 5 lines · Matthew Wilcox
Quoted 1 line · Jeff Garzik

This device will never ever meet a platform where it can be hotplugged.

According to a FreeBSD list from 1995, you could get these chips on a PCI card from several different vendors.

Yes, they are ancient 32-bit PCI cards, which will never make an appearance on a PCI hotplug platform. So, it's wasteful to support hotplug in code that will never be hotplugged (as I've said for years).

Quoted 7 lines

Sorry, you're saying that anyone who has found one of these cards and wants to plug them into a hotplug slot in their shiny new server is just SOL? That makes no sense, Jeff. We've fixed *so* many old drivers to confirm to these rules, why's this one so special? I'd understand if it were only found on motherboards, but it can be found on cards.

Plus it silences a warning. Isn't that enough reason of its own?

Early tulips were electrically "special", so I am highly doubtful it would work in any case.

But overall it doesn't make sense to me to force code to exist, that we know will likely never ever be needed.

Whatever. This patch comes up every year or two, so I suppose I should just quit fighting and eat the needless code size increase, to silence the human warnings :)

Jeff