netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Mixed PCI/ISA device name conflicts
@ 2003-12-22 17:11 Stephen Hemminger
  2004-03-23  1:56 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2003-12-22 17:11 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

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.c b/net/core/dev.c
--- a/net/core/dev.c	Fri Dec 19 14:47:46 2003
+++ b/net/core/dev.c	Fri Dec 19 14:47:46 2003
@@ -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;

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

* Re: [PATCH] Mixed PCI/ISA device name conflicts
  2003-12-22 17:11 [PATCH] Mixed PCI/ISA device name conflicts Stephen Hemminger
@ 2004-03-23  1:56 ` Jeff Garzik
       [not found]   ` <20040329153236.0cf427c9@dell_ss3.pdx.osdl.net>
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2004-03-23  1:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> 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.c b/net/core/dev.c
> --- a/net/core/dev.c	Fri Dec 19 14:47:46 2003
> +++ b/net/core/dev.c	Fri Dec 19 14:47:46 2003
> @@ -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;


Is this patch still needed?

	Jeff

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

* [PATCH] Mixed PCI/ISA device name conflicts
       [not found]     ` <407C33A4.3010804@pobox.com>
@ 2004-04-16 16:46       ` Stephen Hemminger
  2004-04-19 16:49         ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2004-04-16 16:46 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

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

diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c	Fri Apr 16 09:37:20 2004
+++ b/net/core/dev.c	Fri Apr 16 09:37:20 2004
@@ -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;

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

* Re: [PATCH] Mixed PCI/ISA device name conflicts
  2004-04-16 16:46       ` Stephen Hemminger
@ 2004-04-19 16:49         ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2004-04-19 16:49 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

applied, thanks for the resend

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

end of thread, other threads:[~2004-04-19 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-22 17:11 [PATCH] Mixed PCI/ISA device name conflicts Stephen Hemminger
2004-03-23  1:56 ` Jeff Garzik
     [not found]   ` <20040329153236.0cf427c9@dell_ss3.pdx.osdl.net>
     [not found]     ` <407C33A4.3010804@pobox.com>
2004-04-16 16:46       ` Stephen Hemminger
2004-04-19 16:49         ` Jeff Garzik

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