[5112] in linux-scsi channel archive
[Fwd: Scsi tape - returns ENXIO after an error (aha1542) [PATCH]]
daemon@ATHENA.MIT.EDU (Richard Fish)
Thu Nov 12 16:24:28 1998
Date: Thu, 12 Nov 1998 11:44:40 -0700
From: Richard Fish <rjf@estinc.com>
To: linux-scsi@vger.rutgers.edu
CC: Harald Koenig <koenig@tat.physik.uni-tuebingen.de>,
Peter Waltenberg <peterw@dascom.com>
This is a multi-part message in MIME format.
--------------BB5C540CCFC8E71A7E19CB77
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Ooops. Here is the new patch...
--
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
--------------BB5C540CCFC8E71A7E19CB77
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Mozilla-Status2: 00000000
Message-ID: <364B2BCA.E4AAC038@estinc.com>
Date: Thu, 12 Nov 1998 11:41:14 -0700
From: Richard Fish <rjf@estinc.com>
X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.1.127 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: linux-scsi@vger.rutgers.edu
CC: Harald Koenig <koenig@tat.physik.uni-tuebingen.de>,
Peter Waltenberg <peterw@dascom.com>
Subject: Re: Scsi tape - returns ENXIO after an error (aha1542) [PATCH]
References: <3649ADCF.87BC328A@estinc.com> <19981112114520.A338@tat.physik.uni-tuebingen.de>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Ok, here is my second attempt. This patch will need to be applied to
the original aha1542.c file, so be sure to either back out the last
patch or extract an original aha1542.c from the kernel source.
Basically, now if the device is a tape drive and the result byte looks
like something that st should be able to handle, we'll just pass the
error up to st.
Harald Koenig wrote:
>
> On Nov 11, Richard Fish wrote:
>
> > Some weeks ago, there was discussion on linux-kernel about a problem
> > with SCSI tape drives connected to a 1542 being put offline after any
> > kind of error. Since it still occurs in the 2.1.127 kernel, I'm
> > assuming there was no fix for this.
>
> thanks! I just tried your patch with 2.1.126 (since 2.1.127 frequently
> locks up for me in scheduler). it seems to fix only half of the problem,
> but the more important half;)
--
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
--------------BB5C540CCFC8E71A7E19CB77
Content-Type: text/plain; charset=us-ascii;
name="aha1542-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="aha1542-patch"
--- aha1542.c.old Wed Oct 7 15:52:55 1998
+++ aha1542.c Thu Nov 12 11:31:48 1998
@@ -18,6 +18,10 @@
* 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 code for tape drives
+ * for various events like EOF, EOM, EOD, etc...
+ * 11-Nov-1998
*/
#include <linux/module.h>
@@ -242,6 +246,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 +493,24 @@
/* 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 - suppress error handler for tape drives when the status
+ is GOOD or CHECK_CONDITION. This will hopefully allow EOM, EOF, etc
+ "failures" to be reported to the st driver, which is better
+ suited to handling these... */
+ /* NOTE - why does mbistatus != 1 when the command result is GOOD? */
+ if (SCtmp->device->type == TYPE_TAPE &&
+ ((status_byte(SCtmp->result) == GOOD) ||
+ (status_byte(SCtmp->result) & CHECK_CONDITION))) {
+ 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);
--------------BB5C540CCFC8E71A7E19CB77--
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu