Date: Wed, 26 Aug 1998 11:18:47 -0700 (PDT)
From: Michael Schmitz <SCHMITZ@LCBVAX.CCHEM.BERKELEY.EDU>
To: terrylr@tbcnet.com
CC: linux-m68k@lists.linux-m68k.org
Subject: Re: L68K: Linux-2.1.115 & Mac IIvx
Sender: owner-linux-m68k@phil.uni-sb.de

Hi,

>In looking further at the current scsi problem I am having it is not at
>all clear which SCSI driver CONFIG_MAC_SCSI should enable.
>
>Currently I have the following:
>CONFIG_MAC_SCSI_OLD enables mac_scsi.c
>CONFIG_MAC_SCSI     enables mac_scsinew.c

Right.

>mac_scsi.c works.

But will plague you with timeouts on heavy I/O load.

>mac_scsinew.c is flaky.

Because the generic 5380 driver core (NCR5380.c) is broken for m68k. See my
description what to patch. I've seen it running on SE/30 and IIcx, it's not
broken. 

>Michael references mac_5380.c and NCR5380.c neither of which are being
>enabled.

Use the source. Both are the generic core drivers, included via the respective
machine specific driver files (mac_scsi[new].c).

>Comparing mac_5380.c and NCR5380.c there are vast differences.

Yep, mac_NCR5380.c was derived from atari_NCR5380.c The differences are
NCR_main running as bottom half, changes to the reset code and probably more.

>Given that the patch of 980712 on wave.lm.com /incoming is patching
>NCR5380.c it would seem that this should be the one being used.
>
>The simple question is which one should be enabled?

mac_scsinew.c, it includes NCR5380.c.

Patch (minimal, whitespace-broken probably):

diff -u drivers/scsi/NCR5380.c.org drivers/scsi/NCR5380.c | more
--- drivers/scsi/NCR5380.c.org  Thu Jun 18 15:17:35 1998
+++ drivers/scsi/NCR5380.c      Thu Jun 18 15:17:36 1998
@@ -1320,7 +1320,7 @@
                                                tmp->host_scribble = NULL;

                                                /* reenable interrupts after finding one */
-                                               restore_flags(flags);
+                                               sti();   /* XXX MS: THIS one is critical !! */

                                                /*
                                                 * Attempt to establish an I_T_L nexus here.
@@ -1367,7 +1367,7 @@
                                                           hostdata->issue_queue;
                                                        hostdata->issue_queue = tmp;
                                                        done = 0;
-                                                       restore_flags(flags);
+                                                       sti();
 #if (NDEBUG & (NDEBUG_MAIN | NDEBUG_QUEUES))
                                                        printk("scsi%d : main(): select() failed, returned to issue_queue\n",
								instance->host_no);
@@ -1476,7 +1476,7 @@
                                        if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) ==
                                            (SR_SEL | SR_IO)) {
                                                done = 0;
-                                               restore_flags(flags);
+                                               ENABLE_IRQ(); /*was: sti();*/
 #if (NDEBUG & NDEBUG_INTR)
                                                printk("scsi%d : SEL interrupt\n", instance->host_no);
 #endif


	Michael

