Mixed PCI/ISA device name conflicts
Subsystems (2)
PATCH 1/1 Mixed PCI/ISA device name conflicts
PCI is getting initialized before the old ISA probing code, so on mixed ISA/PCI systems a PCI card will get eth0 before the ISA probing starts. Then when the first ISA card is probed it will (unsuccessfully) try and claim eth0.
This fixes it by just having the ISA code skip eth0. It relies on the convention that if the ioaddr is one, the device should be skipped.
Patch against net-drivers-2.5-exp
net/core/dev.c +4 -0
@@ -382,6 +382,7 @@* The found settings are set for the device to be used * later in the device probing. * Returns 0 if no settings found. +* 1 if device already exists */ unsigned long netdev_boot_base (const char *prefix,int unit) {
@@ -390,6 +391,9 @@int i;sprintf (name,"%s%d" , prefix, unit); +if (__dev_get_by_name (name)) +return 1 ; +for (i =0 ; i <NETDEV_BOOT_SETUP_MAX ; i++)if (!strcmp (name, s[i].name))return s[i].map.base_addr;
Quoted 22 lines · Stephen Hemminger
PCI is getting initialized before the old ISA probing code, so on mixed ISA/PCI systems a PCI card will get eth0 before the ISA probing starts. Then when the first ISA card is probed it will (unsuccessfully) try and claim eth0.
This fixes it by just having the ISA code skip eth0. It relies on the convention that if the ioaddr is one, the device should be skipped.
Patch against net-drivers-2.5-exp
diff -Nru
a/net/core/dev.cb/net/core/dev.cnet/core/dev.c +1
-0@@ -382,6 +382,7 @@* The found settings are set for the device to be used * later in the device probing. * Returns 0 if no settings found. +* 1 if device already exists */ unsigned long netdev_boot_base (const char *prefix,int unit) {
net/core/dev.c line 399
Quoted 9 lines
net/core/dev.c +3
-0@@ -390,6 +391,9 @@int i;sprintf (name,"%s%d" , prefix, unit); +if (__dev_get_by_name (name)) +return 1 ; +for (i =0 ; i <NETDEV_BOOT_SETUP_MAX ; i++)if (!strcmp (name, s[i].name))return s[i].map.base_addr;
Is this patch still needed?
Jeff
PATCH 1/1 Mixed PCI/ISA device name conflicts
In reply to a message not in the archiveIn systems with mixed network cards, and all drivers compiled into the kernel; the PCI device (eth0) will get probed first, before the ISA.
The problem is that the ISA device can mistakenly try to probe for eth0. The problem is that the ISA driver will not detect the failure until it goes to call register_netdevice, and not all drivers have perfect error unwind code.
This patch short circuits the device probe, so it won't bother looking for devices that already are registered.
net/core/dev.c +8 -0
@@ -432,6 +432,14 @@int i;sprintf (name,"%s%d" , prefix, unit); + +/* +* If device already registered then return base of 1 +* to indicate not to probe for this interface +*/ +if (__dev_get_by_name (name)) +return 1 ; +for (i =0 ; i <NETDEV_BOOT_SETUP_MAX ; i++)if (!strcmp (name, s[i].name))return s[i].map.base_addr;
Jeff Garzik
Appliedapplied, thanks for the resend