[4958] in linux-scsi channel archive
AHA1542 2.1.125 EOM/FMK problem & patch
daemon@ATHENA.MIT.EDU (Richard Fish)
Wed Oct 21 15:56:33 1998
Date: Wed, 21 Oct 1998 10:59:46 -0700
From: Richard Fish <rjf@estinc.com>
To: Linux SCSI Mailing List <linux-scsi@vger.rutgers.edu>
This is a multi-part message in MIME format.
--------------EB7E0D892B8CE4937D28D5BD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Greetings from newbie kernel hacker!
I've discovered and solved a problem when using an Adaptec 1542 with an
Archive 150 tape drive that prevents multiple-volume backups to the tape
drive. Basically, when EOM is reached on a write, the scsi module
enters the error recover routines which do a device reset, bus reset,
and then a host reset. Because none of these actions can fix the
original "problem", the write command still fails, and the drive ends up
being marked as offline. Then, the open() for the second volume returns
ENXIO. The same thing occurs when reading a tape and a filemark is
encountered. Although my testing was with a Archive 150, I believe this
problem would affect any SCSI tape drive running off a 1542 and current
kernel.
The correct behavior, which occurs with the BusLogic, Advansys and
AIC7xxx drivers, is for the EOM/FMK conditions to be passed through to
the st driver, which can then handle them appropriately. Although my
testing was with a Archive 150, I believe this problem would affect any
SCSI tape drive running off a 1542 and current kernel.
I have prepared a patch for the 1542 driver that fixes this problem, but
I'm not sure what to do with it now.... the MAINTAINERS file for the
2.1.125 kernel doesn't list a maintainer for the 1542 driver, so I'm
assuming there is none...
Assuming this is the case, I have included the patch here. I would
really appreciate it if someone else could give it a look and give me
any feedback. I would appreciate it even more if a couple of you with
1542's could apply and test and make sure I didn't break anything.
Finally, how do I go about getting this included in the kernel?
Thanks in advance...
--
Richard Fish Enhanced Software Technologies, Inc.
Software Developer 4014 E Broadway Rd Suite 405
rjf@estinc.com Phoenix, AZ 85040
(602) 470-1115 http://www.estinc.com
--------------EB7E0D892B8CE4937D28D5BD
Content-Type: text/plain; charset=us-ascii; name="scsi-2.1.125-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="scsi-2.1.125-patch"
diff -ur linux-2.1.125/drivers/scsi/aha1542.c linux-2.1.125-new/drivers/scsi/aha1542.c
--- linux-2.1.125/drivers/scsi/aha1542.c Wed Oct 7 15:52:55 1998
+++ linux-2.1.126/drivers/scsi/aha1542.c Wed Oct 21 08:49:14 1998
@@ -18,6 +18,9 @@
* 1-Jan-97
* Modified by Bjorn L. Thordarson and Einar Thor Einarsson
* Recognize that DMA0 is valid DMA channel -- 13-Jul-98
+ * Modified by Richard Fish
+ * Suppress reset/retry error handling at EOM/EOF conditions
+ * 20-Oct-98
*/
#include <linux/module.h>
@@ -242,6 +245,8 @@
switch (hosterr) {
case 0x0:
case 0xa: /* Linked command complete without error and linked normally */
+ break;
+
case 0xb: /* Linked command complete without error, interrupt generated */
hosterr = 0;
break;
@@ -487,12 +492,19 @@
/* is there mail :-) */
/* more error checking left out here */
- if (mbistatus != 1)
- /* This is surely wrong, but I don't know what's right */
- errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat);
- else
+ if (mbistatus != 1) {
+ /* RJF - catch for EOM/EOF -- not really an error so we don't want the error
+ handler to run */
+ if (SCtmp->sense_buffer[2] & 0x40 || SCtmp->sense_buffer[2] & 0x80) {
+ errstatus = makecode(DID_PASSTHROUGH, ccb[mbo].tarstat);
+ } else {
+ /* This is surely wrong, but I don't know what's right */
+ errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat);
+ }
+ } else {
errstatus = 0;
-
+ }
+
#ifdef DEBUG
if(errstatus) printk("(aha1542 error:%x %x %x) ",errstatus,
ccb[mbo].hastat, ccb[mbo].tarstat);
--------------EB7E0D892B8CE4937D28D5BD--
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu