From nobody@FreeBSD.org  Tue Mar 15 14:15:43 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B0D5C16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Mar 2005 14:15:43 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9262543D41
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Mar 2005 14:15:43 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j2FEFh6p071233
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 15 Mar 2005 14:15:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j2FEFhuS071232;
	Tue, 15 Mar 2005 14:15:43 GMT
	(envelope-from nobody)
Message-Id: <200503151415.j2FEFhuS071232@www.freebsd.org>
Date: Tue, 15 Mar 2005 14:15:43 GMT
From: Ben Laurie <ben@algroup.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Adaptec 29160 fails with IBM LTO-2 drive if disconnect is enabled
X-Send-Pr-Version: www-2.3

>Number:         78868
>Category:       kern
>Synopsis:       [scsi] Adaptec 29160 fails with IBM LTO-2 drive if disconnect is enabled
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gibbs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 15 14:20:05 GMT 2005
>Closed-Date:    
>Last-Modified:  Tue Nov 29 06:04:21 GMT 2005
>Originator:     Ben Laurie
>Release:        4.11
>Organization:
>Environment:
FreeBSD backup.ben.algroup.co.uk 4.11-STABLE FreeBSD 4.11-STABLE #0: Thu Mar  3 14:39:07 GMT 2005     root@backup.ben.algroup.co.uk:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
I am running Amanda on this machine. If I have disconnects enabled in the
29160 BIOS for the tape drive (which is the only SCSI device connected)
then at some point during the taping I get a slew of debugging information
(which I have not preserved, but am quite willing to replicate if asked)
and the tape drive ends up disabled, pending the usual offline/rewind
thing. It can take several hours before this occurs.

With disconnects disabled, the drive appears to work flawlessly.

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gibbs 
Responsible-Changed-By: gibbs 
Responsible-Changed-When: Wed Mar 16 02:47:21 GMT 2005 
Responsible-Changed-Why:  
My driver. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78868 
State-Changed-From-To: open->feedback 
State-Changed-By: gibbs 
State-Changed-When: Wed Mar 16 02:47:49 GMT 2005 
State-Changed-Why:  
Please provide all of the diagnostic output produced by the driver. 
This is the only way for me to determine why the failure is occurring. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78868 

From: Ben Laurie <ben@algroup.co.uk>
To: freebsd-gnats-submit@FreeBSD.org, ben@algroup.co.uk
Cc:  
Subject: Re: kern/78868: Adaptec 29160 fails with IBM LTO-2 drive if disconnect
 is enabled
Date: Sat, 19 Mar 2005 13:15:35 +0000

 ahc0: Recovery Initiated
  >>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<
 ahc0: Dumping Card State while idle, at SEQADDR 0x8
 Card was paused
 ACCUM = 0x4, SINDEX = 0x27, DINDEX = 0x23, ARG_2 = 0x1
 HCNT = 0x0 SCBPTR = 0x0
 SCSIPHASE[0x0] SCSISIGI[0x0] ERROR[0x0] SCSIBUSL[0x0]
 LASTPHASE[0x1]:(P_BUSFREE) SCSISEQ[0x12]:(ENAUTOATNP|ENRSELI)
 SBLKCTL[0xa]:(SELWIDE|SELBUSB) SCSIRATE[0x0] SEQCTL[0x10]:(FASTMODE)
 SEQ_FLAGS[0xc0]:(NO_CDB_SENT|NOT_IDENTIFIED) SSTAT0[0x0]
 SSTAT1[0x8]:(BUSFREE) SSTAT2[0x0] SSTAT3[0x0] SIMODE0[0x8]:(ENSWRAP)
 SIMODE1[0xa4]:(ENSCSIPERR|ENSCSIRST|ENSELTIMO) SXFRCTL0[0x80]:(DFON)
 DFCNTRL[0x0] DFSTATUS[0x89]:(FIFOEMP|HDONE|PRELOAD_AVAIL)
 STACK: 0x0 0x164 0x179 0x3
 SCB count = 20
 Kernel NEXTQSCB = 14
 Card NEXTQSCB = 14
 QINFIFO entries:
 Waiting Queue entries:
 Disconnected Queue entries: 0:7
 QOUTFIFO entries:
 Sequencer Free SCB List: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
 20 21 22 23 24 25 26 27 28 29 30 31
 Sequencer SCB Info:
    0 SCB_CONTROL[0x44]:(DISCONNECTED|DISCENB) SCB_SCSIID[0x27]
 SCB_LUN[0x0] SCB_TAG[0x7]
    1 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    2 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    3 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    4 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    5 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    6 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    7 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    8 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
    9 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   10 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   11 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   12 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   13 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   14 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   15 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   16 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   17 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   18 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   19 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   20 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   21 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   22 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   23 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   24 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   25 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   26 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   27 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   28 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   29 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   30 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
   31 SCB_CONTROL[0x0] SCB_SCSIID[0xff]:(TWIN_CHNLB|OID|TWIN_TID)
 SCB_LUN[0xff]:(SCB_XFERLEN_ODD|LID) SCB_TAG[0xff]
 Pending list:
    7 SCB_CONTROL[0x40]:(DISCENB) SCB_SCSIID[0x27] SCB_LUN[0x0]
 Kernel Free SCB list: 15 16 17 18 19 0 1 2 3 4 5 6 8 9 13 12 11 10
 Untagged Q(2): 7
 
 <<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>
 (sa0:ahc0:0:2:0): SCB 0x7 - timed out
 sg[0] - Addr 0x1829c000 : Length 4096
 sg[1] - Addr 0xb33d000 : Length 4096
 sg[2] - Addr 0x16c3e000 : Length 4096
 sg[3] - Addr 0x19d7f000 : Length 4096
 sg[4] - Addr 0x17960000 : Length 4096
 sg[5] - Addr 0xf421000 : Length 4096
 sg[6] - Addr 0x3ae2000 : Length 4096
 sg[7] - Addr 0xf023000 : Length 4096
 (sa0:ahc0:0:2:0): Queuing a BDR SCB
 (sa0:ahc0:0:2:0): Bus Device Reset Message Sent
 ahc0: Timedout SCBs already complete. Interrupts may not be functioning.
 (sa0:ahc0:0:2:0): no longer in timeout, status = 34b
 ahc0: Bus Device Reset on A:2. 1 SCBs aborted
 (sa0:ahc0:0:2:0): WRITE FILEMARKS. CDB: 10 0 0 0 2 0
 (sa0:ahc0:0:2:0): UNIT ATTENTION asc:29,0
 (sa0:ahc0:0:2:0): Power on, reset, or bus device reset occurred field 
 replaceable unit: 30
 (sa0:ahc0:0:2:0): failed to write terminating filemark(s)
 (sa0:ahc0:0:2:0): tape is now frozen- use an OFFLINE, REWIND or MTEOM 
 command to clear this state.
 
 -- 
 http://www.apache-ssl.org/ben.html       http://www.thebunker.net/
 
 "There is no limit to what a man can do or how far he can go if he
 doesn't mind who gets the credit." - Robert Woodruff
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Tue Nov 29 06:02:44 GMT 2005 
State-Changed-Why:  
Feedback was received quite some time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78868 
>Unformatted:
According to the SCSI controller, the LTO has disconnected without
bothering to reconnect to complete a transaction.  Without a SCSI
bus analyzer, there is no way to know for sure if the SCSI controller's
perception of events is accurate, but in the past, it has been.
I would suggest contacting the tape drive vendor to inquire about
updated firmware for your drive.  It may be a known problem that
has already been corrected.
