From pritc003@maroon.tc.umn.edu  Sat Mar 18 16:33:54 1995
Received: from maroon.tc.umn.edu (root@maroon.tc.umn.edu [128.101.118.21]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id QAA00396 for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Mar 1995 16:33:53 -0800
Received: by maroon.tc.umn.edu; Sat, 18 Mar 95 17:59:11 -0500
Message-Id: <2f6b73cf120e002@maroon.tc.umn.edu>
Date: Sat, 18 Mar 1995 17:59:10 -0600 (CST)
From: pritc003@maroon.tc.umn.edu
Reply-To: pritc003@maroon.tc.umn.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: Tagged queuing doesn't work w/Adaptec 2842 controller
X-Send-Pr-Version: 3.2

>Number:         253
>Category:       kern
>Synopsis:       Tagged queuing with an Adaptec 2842 controller doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 18 16:40:01 1995
>Closed-Date:    Tue Jul 18 08:45:57 PDT 1995
>Last-Modified:
>Originator:     Mike Pritchard
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
None
>Environment:

Adaptec 2842VL SCSI controller
1 Seagate ST1239N SCSI-1 hard disk
1 Seagate ST31230 SCSI-2 hard disk

>Description:

System fails to boot when using the latest version of the Adaptec 2842
drive (sys/i386/scsi/aic7xxx.c).  About 15 - 20 "sd1: Target Busy" 
messages are displayed on the console, and the system panics because
it is unable to mount the root file system.  

I tracked this down to the fact that the driver is now enabling "tagged
queuing" for the ST31230 SCSI-2 disk.  If I disable the line of code
that does this, the system boots fine.

>How-To-Repeat:

Boot with a device that supports tagged queuing (or one that the
driver thinks does).

Here is all of the relevant information from the boot sequence after
I disabled the tagged queing code and with AHC_DEBUG turned on.

ahc0: scb 2104 bytes; SCB_SIZE 19 bytes, ahc_dma 8 bytes
ahc0: reading board settings
ahc0: 284x Single Channel, SCSI Id=7, aic7770 <= Rev C, 4 SCBs
NEEDSDTR == 0xfffa
NEEDWDTR == 0x0
ahc0: Downloading Sequencer Program...Done
ahc0 at 0x1000-0x10ff irq 11 on eisa slot 1
ahc0: Probing channel A
scbus0: ahc0 waiting for scsi devices to settle
ahc0: target 0, lun 0 (probe0) requests Check Status
ahc0: target 0, lun 0 (probe0) Sending Sense
(ahc0:0:0): "CDC ST1239NS 9212" is a type 0 fixed SCSI 1
sd0(ahc0:0:0): Direct-Access 
sd0(ahc0:0:0): 194MB (398790 sectors), 1268 C 9 H 34 S/T 512 B/S
ahc0: target 1 synchronous at 10.0MB/s, offset = 0xf
ahc0: target 1, lun 0 (probe0) requests Check Status
ahc0: target 1, lun 0 (probe0) Sending Sense
ahc0: target 1 Tagged Queuing Device
(ahc0:1:0): "SEAGATE ST31230N 0290" is a type 0 fixed SCSI 2
sd1(ahc0:1:0): Direct-Access 
sd1(ahc0:1:0): 1010MB (2069860 sectors), 3992 C 5 H 103 S/T 512 B/S
ahc0: target 2, lun 0 (probe0) requests Check Status
ahc0: target 2, lun 0 (probe0) Sending Sense
(ahc0:2:0): "ARCHIVE VIPER 150  21944 -001" is a type 1 removable SCSI 1
st0(ahc0:2:0): Sequential-Access st0: Archive  Viper 150 is a known rogue
density code 0x0, ahc0: target 2, lun 0 (st0) requests Check Status
ahc0: target 2, lun 0 (st0) Sending Sense
 drive empty
ahc0: target 1, lun 0 (sd1) requests Check Status
ahc0: target 1, lun 0 (sd1) Sending Sense
ahc0: target 1, lun 0 (sd1) requests Check Status
ahc0: target 1, lun 0 (sd1) Sending Sense
...

>Fix:
	
A workaround is to disable tagged queuing for now:

*** orig/aic7xxx.c	Sat Mar 18 15:12:43 1995
--- ./aic7xxx.c	Sat Mar 18 17:28:25 1995
***************
*** 1652,1659 ****
--- 1653,1662 ----
  		scb->control |= SCB_NEEDSDTR;
  		ahc->sdtrpending |= mask;
  	}
+ #ifdef	BROKEN
  	else if(ahc->tagenable & mask)
  		scb->control |= SCB_TE;
+ #endif
  	scb->target_channel_lun = ((xs->sc_link->target << 4) & 0xF0) | 
  				  ((u_long)xs->sc_link->fordriver & 0x08) |
  				  (xs->sc_link->lun & 0x07);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sat Jul 8 18:56:24 MET DST 1995 
State-Changed-Why:  
From mpp@legarto.minn.net (Mike Pritchard): 

I filed this report originally.  This is working in -current (with  
AHC_TAGENABLE defined).  I think that Justin Gibbs is still working 
on something to allow tagged queuing to be enabled/disabled on 
a device-by-device basis, so he might not want this closed yet. 

State-Changed-From-To: closed->analyzed 
State-Changed-By: joerg 
State-Changed-When: Sat Jul 8 19:04:03 MET DST 1995 
State-Changed-Why:  
Accidentally closed; seems Justin Gibbs is still working here... 

State-Changed-From-To: analyzed->closed 
State-Changed-By: gibbs 
State-Changed-When: Tue Jul 18 08:45:57 PDT 1995 
State-Changed-Why:  
With the addition of disabling tagged queuing for devices that say 
the support tagged queuing but reject tagged queuing messages, the 
driver appears to work with every drive I've tested and tagged queing 
enabled.  It would be nice to allow tagged queuing more selectively, 
but I look at that as a task to be performed generically by the SCSI 
system, but not by individual drivers. 
>Unformatted:




