[BUG 2.6.34-rc1] bogus "(null)" in tulip init messages

Previous thread: [PATCH net-next-2.6] bridge: ensure to unlock in error path in br_multicast_query(). by YOSHIFUJI Hideaki on Wednesday, March 10, 2010 - 8:07 am. (2 messages)

Next thread: bug: route metric signing by Curtis Doty on Wednesday, March 10, 2010 - 8:41 am. (1 message)
From: Mikael Pettersson
Date: Wednesday, March 10, 2010 - 8:33 am

Booting 2.6.34-rc1 on a machine with a tulip nic I see
a number of kernel messages that include "(null)" where
previous kernels included the string "tulip0":

--- dmesg-2.6.33	2010-02-26 12:58:32.000000000 +0100
+++ dmesg-2.6.34-rc1	2010-03-10 16:17:06.000000000 +0100
...
 Linux Tulip driver version 1.1.15 (Feb 27, 2007)
 tulip 0000:00:0f.0: enabling device (0014 -> 0017)
-tulip0:  EEPROM default media type Autosense.
-tulip0:  Index #0 - Media 10baseT (#0) described by a 21142 Serial PHY (2) block.
-tulip0:  Index #1 - Media 10baseT-FDX (#4) described by a 21142 Serial PHY (2) block.
-tulip0:  Index #2 - Media 100baseTx (#3) described by a 21143 SYM PHY (4) block.
-tulip0:  Index #3 - Media 100baseTx-FDX (#5) described by a 21143 SYM PHY (4) block.
-tulip0:  Index #4 - Media 100baseTx (#3) described by a 21143 reset method (5) block.
-eth0: Digital DS21142/43 Tulip rev 48 at Port 0x800, 00:00:c5:50:f9:51, IRQ 25.
+ (null): EEPROM default media type Autosense
+ (null): Index #0 - Media 10baseT (#0) described by a 21142 Serial PHY (2) block
+ (null): Index #1 - Media 10baseT-FDX (#4) described by a 21142 Serial PHY (2) block
+ (null): Index #2 - Media 100baseTx (#3) described by a 21143 SYM PHY (4) block
+ (null): Index #3 - Media 100baseTx-FDX (#5) described by a 21143 SYM PHY (4) block
+ (null): Index #4 - Media 100baseTx (#3) described by a 21143 reset method (5) block
+net eth0: Digital DS21142/43 Tulip rev 48 at Port 0x800, 00:00:c5:50:f9:51, IRQ 25

Apart from this the tulip driver seems to work in 2.6.34-rc1.

/Mikael
--

From: David Miller
Date: Wednesday, March 10, 2010 - 9:41 am

From: Mikael Pettersson <mikpe@it.uu.se>

CC:'ing the guilty party :-)  It's one of the following
commits:

commit 44298ec0f20c45b9be96e181976aef1152d373b2
Author: Joe Perches <joe@perches.com>
Date:   Thu Jan 28 20:59:29 2010 +0000

    tulip/xircom_cb.c: Use dev_<level> and pr_<level>
    
    Convert printks to dev_<level> where a dev is available
    Convert printks to pr_<level> where not
    Coalesce format strings
    Change print formats with %d.dx to %0dx
    Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    Remove DRV_NAME and xircom_cb from pr_<level>
    Convert embedded function names in logging messages to %s, __func__
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit a1e37bc5e2d0ff8d025221e27c2bfff762072311
Author: Joe Perches <joe@perches.com>
Date:   Thu Jan 28 20:59:28 2010 +0000

    tulip/winbond-840.c: Use dev_<level> and pr_<level>
    
    Convert printks to dev_<level> where a dev is available
    Convert printks to pr_<level> where not
    Coalesce format strings
    Change print formats with %d.dx to %0dx
    Convert %d.%d.%d.%d to %pI4
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit e02fb7aa0714ca9357571bb15ef0fe278a150cc7
Author: Joe Perches <joe@perches.com>
Date:   Thu Jan 28 20:59:27 2010 +0000

    tulip/uli526x.c: Use dev_<level> and pr_<level>
    
    Convert printks to dev_<level> where a dev is available
    Convert printks to pr_<level> where not
    Coalesce format strings
    Change print formats with %d.dx to %0dx
    Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    Remove DRV_NAME from logging messages
    Add do {} while(0) to ULI526X_DBUG macro
    Make SHOW_MEDIA_TYPE macro more readable
    
    Signed-off-by: Joe Perches <joe@perches.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 27146c43c4dbb727c4a211541af46577de2984af
Author: Joe Perches ...
From: Joe Perches
Date: Wednesday, March 10, 2010 - 10:34 am

Thanks Mikael.

Anonymity has some good attributes.
Blame avoidance is one of them.

I've broad shoulders.  It's me, then Dwight Howard...

There might be another few of these where ->name or ->dev
was used before struct device or net_device was registered.
I'll go back and check.

tulip_core has:

	if (tp->flags & HAS_MEDIA_TABLE) {
		sprintf(dev->name, DRV_NAME "%d", board_idx);	/* hack */
		tulip_parse_eeprom(dev);
		strcpy(dev->name, "eth%d");			/* un-hack */
	}

So I don't feel _too_ bad.

tulip_parse_eeprom is done before register_netdev so the logging
there can not use netdev_<level> or dev_<level>(&dev->dev

Signed-off-by: Joe Perches <joe@perches.com>
 drivers/net/tulip/eeprom.c |   54 ++++++++++++++++++++++++-------------------
 1 files changed, 30 insertions(+), 24 deletions(-)
---
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 93f4e83..49f05d1 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -143,6 +143,12 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
 
 void __devinit tulip_parse_eeprom(struct net_device *dev)
 {
+	/*
+	  dev is not registered at this point, so logging messages can't
+	  use dev_<level> or netdev_<level> but dev->name is good via a
+	  hack in the caller
+	*/
+
 	/* The last media info list parsed, for multiport boards.  */
 	static struct mediatable *last_mediatable;
 	static unsigned char *last_ee_data;
@@ -161,15 +167,14 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
 		if (ee_data[0] == 0xff) {
 			if (last_mediatable) {
 				controller_index++;
-				dev_info(&dev->dev,
-					 "Controller %d of multiport board\n",
-					 controller_index);
+				pr_info("%s: Controller %d of multiport board\n",
+					dev->name, controller_index);
 				tp->mtable = last_mediatable;
 				ee_data = last_ee_data;
 				goto subsequent_board;
 			} else
-				dev_info(&dev->dev,
-					 "Missing EEPROM, this interface may not work ...
From: Mikael Pettersson
Date: Wednesday, March 10, 2010 - 12:16 pm

Joe Perches writes:
 > On Wed, 2010-03-10 at 08:41 -0800, David Miller wrote:
 > > From: Mikael Pettersson <mikpe@it.uu.se>
 > > Date: Wed, 10 Mar 2010 16:33:28 +0100
 > > > Booting 2.6.34-rc1 on a machine with a tulip nic I see
 > > > a number of kernel messages that include "(null)" where
 > > > previous kernels included the string "tulip0":
 > > CC:'ing the guilty party :-)  It's one of the following
 > > commits:
 > 
 > Thanks Mikael.
 > 
 > Anonymity has some good attributes.
 > Blame avoidance is one of them.
 > 
 > I've broad shoulders.  It's me, then Dwight Howard...
 > 
 > There might be another few of these where ->name or ->dev
 > was used before struct device or net_device was registered.
 > I'll go back and check.
 > 
 > tulip_core has:
 > 
 > 	if (tp->flags & HAS_MEDIA_TABLE) {
 > 		sprintf(dev->name, DRV_NAME "%d", board_idx);	/* hack */
 > 		tulip_parse_eeprom(dev);
 > 		strcpy(dev->name, "eth%d");			/* un-hack */
 > 	}
 > 
 > So I don't feel _too_ bad.
 > 
 > tulip_parse_eeprom is done before register_netdev so the logging
 > there can not use netdev_<level> or dev_<level>(&dev->dev
 > 
 > Signed-off-by: Joe Perches <joe@perches.com>
 >  drivers/net/tulip/eeprom.c |   54 ++++++++++++++++++++++++-------------------
 >  1 files changed, 30 insertions(+), 24 deletions(-)

Thanks, that fixed it:

tulip 0000:00:0f.0: enabling device (0014 -> 0017)
tulip0: EEPROM default media type Autosense
tulip0: Index #0 - Media 10baseT (#0) described by a 21142 Serial PHY (2) block
tulip0: Index #1 - Media 10baseT-FDX (#4) described by a 21142 Serial PHY (2) block
tulip0: Index #2 - Media 100baseTx (#3) described by a 21143 SYM PHY (4) block
tulip0: Index #3 - Media 100baseTx-FDX (#5) described by a 21143 SYM PHY (4) block
tulip0: Index #4 - Media 100baseTx (#3) described by a 21143 reset method (5) block
net eth0: Digital DS21142/43 Tulip rev 48 at Port 0x800, 00:00:c5:50:f9:51, IRQ 25

Tested-by: Mikael Pettersson <mikpe@it.uu.se>

 > ---
 > diff --git ...
From: David Miller
Date: Saturday, March 13, 2010 - 1:26 pm

From: Mikael Pettersson <mikpe@it.uu.se>

Applied, thanks everyone.
--

Previous thread: [PATCH net-next-2.6] bridge: ensure to unlock in error path in br_multicast_query(). by YOSHIFUJI Hideaki on Wednesday, March 10, 2010 - 8:07 am. (2 messages)

Next thread: bug: route metric signing by Curtis Doty on Wednesday, March 10, 2010 - 8:41 am. (1 message)