[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Fix for a DEPCA ethernet lockup
From:       <mmogilvi () elbert ! uccs ! edu>
Date:       1997-08-31 14:31:27
[Download RAW message or body]

     When the DEPCA ethernet driver in linux 2.0.30 probes for EISA
cards in my non-EISA system, it locks up the machine when it
tries to probe for an EISA signature at I/O port 0xfc80.  This
address is where my PCI AHA-2940W SCSI controller is.
     The following patch fixes this by causing the the driver to
check_region() before, instead of after, the probe.  This patch also
fixes a similar problem in the ISA probe.   In addition, I modified
it so that check_region() isn't called if the user supplied the I/O address
to probe.
     This should definately go into the development kernel, and
should probably go into the stable kernel as well.  Other then this
problem, my Linux machines have been working well.  Keep up the good work!
                                     - Matthew Ogilvie

diff -ur linux-2.0.30/drivers/net/depca.c linux/drivers/net/depca.c
--- linux-2.0.30/drivers/net/depca.c	Sun Aug 31 08:40:54 1997
+++ linux/drivers/net/depca.c	Sun Aug 31 13:49:55 1997
@@ -1225,16 +1225,14 @@
   }
 
   for (; (i<maxSlots) && (dev!=NULL) && ports[i]; i++) {
-    if (DevicePresent(ports[i]) == 0) { 
-      if (check_region(ports[i], DEPCA_TOTAL_SIZE) == 0) {
+    if (ioaddr || check_region(ports[i], DEPCA_TOTAL_SIZE) == 0) {
+      if (DevicePresent(ports[i]) == 0) { 
 	if ((dev = alloc_device(dev, ports[i])) != NULL) {
 	  if (depca_hw_init(dev, ports[i]) == 0) {
 	    num_depcas++;
 	  }
 	  num_eth++;
 	}
-      } else if (autoprobed) {
-	printk("%s: region already allocated at 0x%04x.\n", dev->name,ports[i]);
       }
     }
   }
@@ -1267,17 +1265,15 @@
   if ((iobase & 0x0fff) == 0) iobase += DEPCA_EISA_IO_PORTS;
 
   for (; (i<maxSlots) && (dev!=NULL); i++, iobase+=EISA_SLOT_INC) {
-    if (EISA_signature(name, EISA_ID)) {
-      if (DevicePresent(iobase) == 0) { 
-	if (check_region(iobase, DEPCA_TOTAL_SIZE) == 0) {
+    if (ioaddr || check_region(iobase, DEPCA_TOTAL_SIZE) == 0) {
+      if (EISA_signature(name, EISA_ID)) {
+	if (DevicePresent(iobase) == 0) { 
 	  if ((dev = alloc_device(dev, iobase)) != NULL) {
 	    if (depca_hw_init(dev, iobase) == 0) {
 	      num_depcas++;
 	    }
 	    num_eth++;
 	  }
-	} else if (autoprobed) {
-	  printk("%s: region already allocated at 0x%04lx.\n",dev->name,iobase);
 	}
       }
     }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic