linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* emac/zmii link warnings
@ 2008-01-15  4:15 Sean MacLennan
  2008-01-15  4:27 ` Stephen Rothwell
  0 siblings, 1 reply; 7+ messages in thread
From: Sean MacLennan @ 2008-01-15  4:15 UTC (permalink / raw)
  To: linuxppc-dev

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emac/zmii link warnings
  2008-01-15  4:15 emac/zmii link warnings Sean MacLennan
@ 2008-01-15  4:27 ` Stephen Rothwell
  2008-01-15  4:45   ` Sean MacLennan
  2008-01-15  5:45   ` Sean MacLennan
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Rothwell @ 2008-01-15  4:27 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <smaclennan@pikatech.com> wrote:
>
> 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).

> 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.

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

They need to be fixed.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emac/zmii link warnings
  2008-01-15  4:27 ` Stephen Rothwell
@ 2008-01-15  4:45   ` Sean MacLennan
  2008-01-15  5:26     ` Stephen Rothwell
  2008-01-15  5:45   ` Sean MacLennan
  1 sibling, 1 reply; 7+ messages in thread
From: Sean MacLennan @ 2008-01-15  4:45 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

Stephen Rothwell wrote:
> On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <smaclennan@pikatech.com> wrote:
>   
>> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emac/zmii link warnings
  2008-01-15  4:45   ` Sean MacLennan
@ 2008-01-15  5:26     ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2008-01-15  5:26 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

On Mon, 14 Jan 2008 23:45:17 -0500 Sean MacLennan <smaclennan@pikatech.com> wrote:
>
> Stephen Rothwell wrote:
> > On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <smaclennan@pikatech.com> wrote:
> >   
> >> 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?

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.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emac/zmii link warnings
  2008-01-15  4:27 ` Stephen Rothwell
  2008-01-15  4:45   ` Sean MacLennan
@ 2008-01-15  5:45   ` Sean MacLennan
  2008-02-07  5:08     ` [PATCH] " Sean MacLennan
  1 sibling, 1 reply; 7+ messages in thread
From: Sean MacLennan @ 2008-01-15  5:45 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

Stephen Rothwell wrote:
> On Mon, 14 Jan 2008 23:15:41 -0500 Sean MacLennan <smaclennan@pikatech.com> wrote:
>   
>> 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.
>> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] emac/zmii link warnings
  2008-01-15  5:45   ` Sean MacLennan
@ 2008-02-07  5:08     ` Sean MacLennan
  2008-02-14 15:30       ` Josh Boyer
  0 siblings, 1 reply; 7+ messages in thread
From: Sean MacLennan @ 2008-02-07  5:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Stephen Rothwell

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

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index e6c69f7..21fe06f 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -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
 };
 
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c
index 6869f08..0ba0a68 100644
--- a/drivers/net/ibm_newemac/mal.c
+++ b/drivers/net/ibm_newemac/mal.c
@@ -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;
 
diff --git a/drivers/net/ibm_newemac/zmii.c b/drivers/net/ibm_newemac/zmii.c
index 2ea472a..5e6231b 100644
--- a/drivers/net/ibm_newemac/zmii.c
+++ b/drivers/net/ibm_newemac/zmii.c
@@ -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);
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] emac/zmii link warnings
  2008-02-07  5:08     ` [PATCH] " Sean MacLennan
@ 2008-02-14 15:30       ` Josh Boyer
  0 siblings, 0 replies; 7+ messages in thread
From: Josh Boyer @ 2008-02-14 15:30 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev, Stephen Rothwell

On Thu, 07 Feb 2008 00:08:33 -0500
Sean MacLennan <smaclennan@pikatech.com> wrote:

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-14 15:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-15  4:15 emac/zmii link warnings Sean MacLennan
2008-01-15  4:27 ` Stephen Rothwell
2008-01-15  4:45   ` Sean MacLennan
2008-01-15  5:26     ` Stephen Rothwell
2008-01-15  5:45   ` Sean MacLennan
2008-02-07  5:08     ` [PATCH] " Sean MacLennan
2008-02-14 15:30       ` Josh Boyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).