Scsi tape - returns ENXIO after an error (aha1542) [PATCH]

Richard Fish (rjf@estinc.com)
Thu, 12 Nov 1998 15:11:20 -0700


This is a multi-part message in MIME format.
--------------C59B75A1474C264A691CFAFC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Ok, my brain really wasn't working very well when I sent this, because I
also meant it to go the linux-kernel list...

-- 
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
--------------C59B75A1474C264A691CFAFC
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Return-Path: <owner-linux-scsi-outgoing@vger.rutgers.edu> Received: from nile.inhouse (rjf@nile.inhouse [192.168.0.31]) by nile.inhouse (8.8.7/8.8.7) with ESMTP id OAA00810 for <rjf@nile.inhouse>; Thu, 12 Nov 1998 14:30:04 -0700 Received: from dbserv by nile.inhouse (fetchmail-4.5.3 POP3) for <rjf/nile.inhouse> (single-drop); Thu, 12 Nov 1998 14:30:04 MST Received: from canopus.estinc.com (IDENT:root@canopus.inhouse [192.168.0.1]) by dbserv.inhouse (8.9.0/8.9.0) with ESMTP id VAA22684 for <rjf@dbserv.inhouse>; Thu, 12 Nov 1998 21:16:02 GMT Received: from listserv.funet.fi (listserv.funet.fi [128.214.248.27]) by canopus.estinc.com (8.8.7/8.8.7) with ESMTP id OAA29456 for <rjf@estinc.com>; Thu, 12 Nov 1998 14:28:06 -0700 Received: from vger.rutgers.edu ([128.6.190.2]:27762 "EHLO vger.rutgers.edu" ident: "NO-IDENT-SERVICE[2]") by listserv.funet.fi with ESMTP id <8475-31466>; Thu, 12 Nov 1998 23:23:39 +0200 Received: by vger.rutgers.edu id <154330-28307>; Thu, 12 Nov 1998 14:30:00 -0500 Received: from canopus.estinc.com ([209.140.128.15]:4161 "EHLO canopus.estinc.com" ident: "root") by vger.rutgers.edu with ESMTP id <154332-28307>; Thu, 12 Nov 1998 13:24:40 -0500 Received: from estinc.com (rjf@nile.inhouse [192.168.0.31]) by canopus.estinc.com (8.8.7/8.8.7) with ESMTP id LAA29142; Thu, 12 Nov 1998 11:47:34 -0700 Message-ID: <364B2C98.B67D5644@estinc.com> Date: Thu, 12 Nov 1998 11:44:40 -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: [Fwd: Scsi tape - returns ENXIO after an error (aha1542) [PATCH]] Content-Type: multipart/mixed; boundary="------------BB5C540CCFC8E71A7E19CB77" X-Orcpt: rfc822;linux-scsi@vger.rutgers.edu Sender: owner-linux-scsi@vger.rutgers.edu Precedence: bulk X-Loop: majordomo@vger.rutgers.edu

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  

--------------C59B75A1474C264A691CFAFC--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/