Do not register ne2k-pci device until initialized
Subsystems (2)
PATCH 1/1 Do not register ne2k-pci device until initialized
Doing it in reverse order causes uevent to be sent before we have a MAC address, which confuses udev.
--- drivers/net/ne2k-pci.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/ne2k-pci.c +3 -4
@@ -374,18 +374,17 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, dev->ethtool_ops = &ne2k_pci_ethtool_ops;NS8390_init (dev,0 ); +memcpy (dev->dev_addr, SA_prom,6 ); +memcpy (dev->perm_addr, dev->dev_addr, dev->addr_len); + i =register_netdev (dev);if (i) goto err_out_free_netdev; -for (i =0 ; i <6 ; i++) - dev->dev_addr[i] = SA_prom[i];printk ("%s: %s found at %#lx, IRQ %d, %pM.\n" , dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq, dev->dev_addr); -memcpy (dev->perm_addr, dev->dev_addr, dev->addr_len); -return 0 ; err_out_free_netdev:
Signature · 1 line
"Excuse all the blood" -- Dead
Quoted 4 lines · Lubomir Rintel
Doing it in reverse order causes uevent to be sent before we have a MAC address, which confuses udev.
Signed-off-by Lubomir Rintel <[email protected]>
Good spotting, that fixes a clear startup race
Hi,
Quoted 1 line
Good spotting, that fixes a clear startup race
I saw this and thought that this must be one of those non-singular bugs again... ;)
(I checked for dev_addr manipulations _after_ register_netdev)
And, well...:
smsc911x.c looks like it has the same issue (in case of a non-specified MAC address - invalid EEPROM content).
Dito ucc_geth.c
Dito arm/ixp4xx_eth.c
Dito wireless/netwave_cs.c
Given that several drivers seem to violate this rule: is there a way to add a check against this problem?
Andreas Mohr
David Miller
maintainerFrom: Andreas Mohr <[email protected]>
Date: Sat, 2 May 2009 19:58:11 +0200
Quoted 5 lines
And, well...:
smsc911x.clooks like it has the same issue (in case of a non-specified MAC address - invalid EEPROM content).
Quoted 8 lines
Dito
ucc_geth.cDito
arm/ixp4xx_eth.cDito
wireless/netwave_cs.cGiven that several drivers seem to violate this rule: is there a way to add a check against this problem?
I'm pretty sure we have a valid ethernet address check somewhere already... hmmm..
From: Jeff Garzik <[email protected]>
Date: Sat, 02 May 2009 13:05:34 -0400
Quoted 8 lines
Quoted 3 lines · Lubomir Rintel
Doing it in reverse order causes uevent to be sent before we have a MAC address, which confuses udev.
Signed-off-by Lubomir Rintel <[email protected]>Acked-by Jeff Garzik <[email protected]>Good spotting, that fixes a clear startup race
Applied, thanks.
Quoted 1 line · Andreas Mohr
Dito
arm/ixp4xx_eth.c
Right, will have a patch soon (mainline only, IMHO it's not worth it to bother "stable" people because of no practical impact of this bug, especially on this ARM IXP4xx arch).
Thanks.
Signature · 1 line
Krzysztof Halasa