Fix section mismatch in de2104x.c
Subsystems (2)
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
@@ -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,
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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)
I'm a bit blind, so help me out here... what precisely is mismatched?
AFAICS everything is properly marked __init or __exit.
Jeff
Quoted 3 lines · Jeff Garzik
I'm a bit blind, so help me out here... what precisely is mismatched?
AFAICS everything is properly marked
__initor__exit.
Wasn't my patch, but the markings are now consistent with tulip_core at least.
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
__initor__exit.Wasn't my patch, but the markings are now consistent with
tulip_coreat 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
More info on section mismatches (was Re: [PATCH] [TULIP] Fix section mismatch in de2104x.c)
In reply to Jeff GarzikQuoted 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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)
Quoted 3 lines
I'm a bit blind, so help me out here... what precisely is mismatched?
AFAICS everything is properly marked
__initor__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 34bar() 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
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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)
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.
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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)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
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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)
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.
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 offset0x20)
WARNING:drivers/net/tulip/de2104x.o- Section mismatch: reference to .exit.text:de_remove_one from .data.rel.local after 'de_driver' (at offset0x28)
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.
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
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?
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