Date: Mon, 24 Mar 1997 00:04:08 -0600
From: Chris Lawrence <quango@ix.netcom.com>
To: Linux/m68k Mailing List <linux-m68k@phil.uni-sb.de>,
        Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
Subject: L68K: Zorro diff for GVP
Organization: Kathie Lee's Sweatshops
X-Operating-System: Linux/m68k 2.1.29
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

The original Zorro diff doesn't seem to like my system... the system hangs
at the point just before the GVP Series II driver info is reported.

I've looked at the patched code, and I think I have a fix (relative to the
patched version).  It looks like the old code would get stuck in an infinite
loop; this gets around it by searching for boards after a stored key.

There was also a major whopper typo in zorro.c that made it always return
the first board detected (this relative to the patch from the misc kit at
James's page, it may have been accidentally added there or in the original
patch set from Geert, dunno which -- without my Multiface and Cybervision
[aka Expensive Zorro Slot Filler] I'd never have detected the problem).

--- linux/arch/m68k/amiga/zorro.c~	Sun Mar 23 21:56:42 1997
+++ linux/arch/m68k/amiga/zorro.c	Sun Mar 23 23:13:33 1997
@@ -822,7 +822,6 @@
 	     prod != ZORRO_PROD(ZORRO_PROD_GVP_EPC_BASE) ||
 	     (*(u_short *)ZTWO_VADDR(addr+0x8000) & GVP_PRODMASK) == epc))
 	    break;
-	break;
     }
     return(key <= zorro_num_autocon ? key : 0);
 }
--- linux/drivers/scsi/gvp11.c.geert	Sun Mar 23 21:56:46 1997
+++ linux/drivers/scsi/gvp11.c	Sun Mar 23 22:19:44 1997
@@ -204,7 +204,7 @@
     struct Scsi_Host *instance;
     caddr_t address;
     u_int epc;
-    u_int key = 0;
+    u_int key = 0, skey;
     const struct ConfigDev *cd;
     u_int default_dma_xfer_mask;
 
@@ -221,15 +221,17 @@
 	 * all the different GVP SCSI controllers (except for the
 	 * SERIES I though).
 	 */
-	if ((key = zorro_find(ZORRO_PROD_GVP_COMBO_030_R3_SCSI, 0, key)) ||
-	    (key = zorro_find(ZORRO_PROD_GVP_SERIES_II, 0, key)))
+	skey = key;
+
+	if ((key = zorro_find(ZORRO_PROD_GVP_COMBO_030_R3_SCSI, 0, skey)) ||
+	    (key = zorro_find(ZORRO_PROD_GVP_SERIES_II, 0, skey)))
 	    default_dma_xfer_mask = ~0x00ffffff;
-	else if ((key = zorro_find(ZORRO_PROD_GVP_GFORCE_030_SCSI, 0, key)) ||
-		 (key = zorro_find(ZORRO_PROD_GVP_A530_SCSI, 0, key)) ||
-		 (key = zorro_find(ZORRO_PROD_GVP_COMBO_030_R4_SCSI, 0, key)))
+	else if ((key = zorro_find(ZORRO_PROD_GVP_GFORCE_030_SCSI, 0, skey)) ||
+		 (key = zorro_find(ZORRO_PROD_GVP_A530_SCSI, 0, skey)) ||
+		 (key = zorro_find(ZORRO_PROD_GVP_COMBO_030_R4_SCSI, 0, skey)))
 	    default_dma_xfer_mask = ~0x01ffffff;
-	else if ((key = zorro_find(ZORRO_PROD_GVP_A1291, 0, key)) ||
-		 (key = zorro_find(ZORRO_PROD_GVP_GFORCE_040_SCSI_1, 0, key)))
+	else if ((key = zorro_find(ZORRO_PROD_GVP_A1291, 0, skey)) ||
+		 (key = zorro_find(ZORRO_PROD_GVP_GFORCE_040_SCSI_1, 0, skey)))
 	    default_dma_xfer_mask = ~0x07ffffff;
 	else
 	    break;

Well, at least it now works on my system, YMMV :-)


Chris

P.S. My kernel is 80 bytes larger that it was before with the Zorro diff
(and most of the difference is probably in the GVP patch).
-- 
============================================================================
|        Chris Lawrence        |               My home page:               |
|    <quango@ix.netcom.com>    |    http://www.clark.net/pub/lawrencc/     |
|                              |                                           |
|      Amiga A4000/040 and     |       Visit the Amiga Web Directory       |
|       Linux/m68k 2.1.29      |      http://www.cucug.org/amiga.html      |
============================================================================
