Skip to contentSkip to conversation

emac/zmii link warnings

DISCUSSION Sean MacLennan 3 participants 7 messages Jan 15, 2008 – Feb 14, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

I keep getting these link(?) warnings:

WARNING: vmlinux.o(.data+0x16178): Section mismatch: reference to .init.text:emac_of_bus_notify (between 'emac_of_bus_notifier' and 'emac_phy_map_lock')
WARNING: vmlinux.o(.init.text+0x16ba8): Section mismatch: reference to .exit.text:zmii_detach (between 'emac_probe' and 'zmii_probe')
WARNING: vmlinux.o(.init.text+0x16bb4): Section mismatch: reference to .exit.text:mal_unregister_commac (between 'emac_probe' and 'zmii_probe')

Any hints as to what might be wrong? Or are they "normal".

Cheers,
Sean

#1 lore raw
Quoted 4 lines · On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <[email protected]>…

I keep getting these link(?) warnings:

WARNING: vmlinux.o(.data+0x16178): Section mismatch: reference to .init.text:emac_of_bus_notify (between 'emac_of_bus_notifier' and 'emac_phy_map_lock')

emac_of_bus_notify is marked __devinit and is referred to by emac_of_bus_notifier (which is not marked thus) (in drivers/net/ibm_newemac/core.c).

Quoted 2 lines

WARNING: vmlinux.o(.init.text+0x16ba8): Section mismatch: reference to .exit.text:zmii_detach (between 'emac_probe' and 'zmii_probe')
WARNING: vmlinux.o(.init.text+0x16bb4): Section mismatch: reference to .exit.text:mal_unregister_commac (between 'emac_probe' and 'zmii_probe')

These will be similar but function calls.

Quoted 1 line

Any hints as to what might be wrong? Or are they "normal".

They need to be fixed.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#2 lore raw
Quoted 11 lines · Stephen Rothwell
Quoted 4 lines · On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <[email protected]>…

I keep getting these link(?) warnings:

WARNING: vmlinux.o(.data+0x16178): Section mismatch: reference to .init.text:emac_of_bus_notify (between 'emac_of_bus_notifier' and 'emac_phy_map_lock')

emac_of_bus_notify is marked __devinit and is referred to by emac_of_bus_notifier (which is not marked thus) (in drivers/net/ibm_newemac/core.c).

Adding the __devinit to emacs_of_bus_notifier causes a problem with emac_phy_map_lock (a mutex). But removing the __devinit from emac_of_bus_notify cleans up that warning. Is the __devinit really necessary?

Cheers,
Sean

#3 lore raw
Quoted 8 lines · On Mon, 14 Jan 2008 23:45:17 -0500 Sean MacLennan <[email protected]>…
Quoted 5 lines · Stephen Rothwell
Quoted 3 lines · On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <[email protected]>…

I keep getting these link(?) warnings:

WARNING: vmlinux.o(.data+0x16178): Section mismatch: reference to .init.text:emac_of_bus_notify (between 'emac_of_bus_notifier' and 'emac_phy_map_lock')

Quoted 8 lines
Quoted 3 lines

emac_of_bus_notify is marked __devinit and is referred to by emac_of_bus_notifier (which is not marked thus) (in drivers/net/ibm_newemac/core.c).

Adding the __devinit to emacs_of_bus_notifier causes a problem with emac_phy_map_lock (a mutex). But removing the __devinit from emac_of_bus_notify cleans up that warning. Is the __devinit really necessary?

What problem do you get. The correct fix is to mark emac_of_bus_notifier as __devinitdata. The __devinit marking of emac_of_bus_notify is not strictly necessary, but some people care about the size of their kernels.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/
#4 lore raw
In reply to Stephen Rothwell
Quoted 12 lines · Stephen Rothwell
Quoted 4 lines · On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <[email protected]>…

I keep getting these link(?) warnings:

WARNING: vmlinux.o(.data+0x16178): Section mismatch: reference to .init.text:emac_of_bus_notify (between 'emac_of_bus_notifier' and 'emac_phy_map_lock')

emac_of_bus_notify is marked __devinit and is referred to by emac_of_bus_notifier (which is not marked thus) (in drivers/net/ibm_newemac/core.c).

The __devinitdata solves this.

Quoted 7 lines
Quoted 3 lines

WARNING: vmlinux.o(.init.text+0x16ba8): Section mismatch: reference to .exit.text:zmii_detach (between 'emac_probe' and 'zmii_probe')
WARNING: vmlinux.o(.init.text+0x16bb4): Section mismatch: reference to .exit.text:mal_unregister_commac (between 'emac_probe' and 'zmii_probe')

These will be similar but function calls.

The problem here is that emac_probe calls zmii_detach. emacs_probe is a __devinit and zmii_detach is a __devexit. At least I assume that is the problem.

I am a long time emacs (actually xemacs) user. If I had a nickel for every time I typed emacs rather than emac, I would be a very rich man.

Cheers,
Sean

#5 lore raw

Ok, here is my best shot at removing the warnings. It seems to me that functions called from a dev_init section should not be dev_exit.

Cheers,
Sean

---

drivers/net/ibm_newemac/core.c +0 -0
index e6c69f7..21fe06f 100644
@@ -2230,7 +2230,7 @@ static int __devinit emac_of_bus_notify(struct notifier_block *nb,
	return 0;
}

-static struct notifier_block emac_of_bus_notifier = { +static struct notifier_block __devinitdata emac_of_bus_notifier = {
.notifier_call = emac_of_bus_notify
};

drivers/net/ibm_newemac/mal.c +0 -0
index 6869f08..0ba0a68 100644
@@ -61,8 +61,9 @@ int __devinit mal_register_commac(struct mal_instance	*mal,
	return 0;
}

-void __devexit mal_unregister_commac(struct mal_instance *mal,
- struct mal_commac *commac)
+/* This cannot be a __devexit since it is called from __devinit functions. */
+void mal_unregister_commac(struct mal_instance *mal,
+ struct mal_commac *commac)

{
	unsigned long flags;
drivers/net/ibm_newemac/zmii.c +0 -0
index 2ea472a..5e6231b 100644
@@ -189,7 +189,8 @@ void zmii_set_speed(struct of_device *ofdev, int input, int speed)
	mutex_unlock(&dev->lock);
}

-void __devexit zmii_detach(struct of_device *ofdev, int input) +/* This cannot be a __devexit since it is called from __devinit functions. */ +void zmii_detach(struct of_device *ofdev, int input)

{
	struct zmii_instance *dev = dev_get_drvdata(&ofdev->dev);
#6 lore raw
Quoted 2 lines · On Thu, 07 Feb 2008 00:08:33 -0500 Sean MacLennan <[email protected]>…

Ok, here is my best shot at removing the warnings. It seems to me that functions called from a dev_init section should not be dev_exit.

This seems to fix those specific warnings, but there are others lurking in some of the other files (rgmii, tah, etc). We should probably get those fixed up too.

josh