From nobody@FreeBSD.ORG  Wed Oct  4 07:22:10 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id E255D37B66D; Wed,  4 Oct 2000 07:22:10 -0700 (PDT)
Message-Id: <20001004142210.E255D37B66D@hub.freebsd.org>
Date: Wed,  4 Oct 2000 07:22:10 -0700 (PDT)
From: nickc@corp.firstindustrial.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Infortrend IFT-3102 doesn't like SCSI Cache Sync
X-Send-Pr-Version: www-1.0

>Number:         21752
>Category:       kern
>Synopsis:       Infortrend IFT-3102 doesn't like SCSI Cache Sync
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 04 07:30:01 PDT 2000
>Closed-Date:    Sat Nov 17 09:43:21 PST 2001
>Last-Modified:  Sat Nov 17 09:43:38 PST 2001
>Originator:     Nick R. Colakovic
>Release:        4.1.1-STABLE
>Organization:
First Industrial Realty Trust
>Environment:
FreeBSD stvincent2.firstindustrial.com 4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Wed Sep 27 09:48:02 CDT 2000     nickc@stvincent2.firstindustrial.com:/usr/obj/usr/src/sys/SCLEAN  i386

Hardware Environment:

Intel L440GX+ Server Board
2 X PII-450
128MB RAM
Onboard Adaptec AIC-78xx U2 Controller attached to channel 0 on IFT-3102
w/ both IFT-3102 and system board controllers set at 80 MB/s U2 operation.
Onboard Intel Pro/100+ NIC


>Description:
The Infortrend IFT-3102 is a external multihost U2 SCSI to U2 SCSI controller.   The logical drives/partions created using the controller  appear on a conventional SCSI controller as a normal SCSI disk drive.  The advantage of this was to provide host OS independance for RAID support (esp. given the 2.x and 3.x branches limited HW raid support).
   FreeBSD 3.x and 4.x are setup to send SCSI CACHE_SYNC commands to SCSI disk drives unless they are listed in the scsi_da.c quirk table as not supporting this.  The IFT-3102 doesn't accept this command and as a result a kernel error message is seen at shutdown.  I haven't yet experienced a operational problem under 4.1-STABLE and greater as a result.  But this problem did cause 3.5-RELEASE to crash during the post install reboot.  
>How-To-Repeat:
Install FreeBSD 3.4-RELEASE and greater on a IFT-3102 hosted logical drive.  Reboot and you will get an error like the following:

syncing disks... 12
done
Uptime: 21h18m36s
(da0:ahc0:0:0:0): SYNCHRONIZE CACHE. CDB: 35 0 0 0 0 0 0 0 0 0
(da0:ahc0:0:0:0): ILLEGAL REQUEST asc:20,0
(da0:ahc0:0:0:0): Invalid command operation code
Rebooting...

>Fix:
Add the IFT-3102 to the scsi_da.c quirks table disabling Sync Cache.  Apply the following patch to sys/cam/scsi_da.c, recompile your kernel and reboot:

*** sys/cam/scsi/scsi_da.c.orig Wed Oct  4 09:10:18 2000
--- sys/cam/scsi/scsi_da.c      Wed Oct  4 09:10:32 2000
***************
*** 215,221 ****
                 */
                {T_DIRECT, SIP_MEDIA_REMOVABLE, "Y-E DATA", "USB-FDU", "*"},
                /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
!       }
  };

  static        d_open_t        daopen;
--- 215,230 ----
                 */
                {T_DIRECT, SIP_MEDIA_REMOVABLE, "Y-E DATA", "USB-FDU", "*"},
                /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
!       },
!       {
!               /*
!                * Infortrend IFT-3102 SCSI to SCSI controller as of
!                * Firmware Version 2.23 doesn't like SCSI SYNC_CACHE
!                */
!               {T_DIRECT, SIP_MEDIA_FIXED, "IFT", "3102", "*"},
!               /* quirks*/ DA_Q_NO_SYNC_CACHE
!       }
!
  };

  static        d_open_t        daopen;



>Release-Note:
>Audit-Trail:

From: Justin Gibbs <gibbs@plutotech.com>
To: nickc@corp.firstindustrial.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/21752: Infortrend IFT-3102 doesn't like SCSI Cache Sync
Date: Wed, 4 Oct 2000 10:03:18 -0600 (MDT)

 > >Synopsis:       Infortrend IFT-3102 doesn't like SCSI Cache Sync
 
 >    FreeBSD 3.x and 4.x are setup to send SCSI CACHE_SYNC commands
 > to SCSI disk drives unless they are listed in the scsi_da.c quirk
 > table as not supporting this.  The IFT-3102 doesn't accept this
 > command and as a result a kernel error message is seen at shutdown.
 > I haven't yet experienced a operational problem under 4.1-STABLE
 > and greater as a result.  But this problem did cause 3.5-RELEASE
 > to crash during the post install reboot.
 
 I don't know why 3.5R would crash because the command failed, but
 so long as the device does not die due to the sync cache command,
 I would rather not place an entry into the quirk table.  Unfortunately,
 there are several entries (perhaps all but those for MO devices) in
 the quirk table that shouldn't need to be there.
 
 I am still confused as to why the system prints any error at all.  The
 code in both dashutdown and daclose is supposed to prevent the error
 from being reported if the device does not support the command.  Perhaps
 you could spend some time instrumenting the "error avoidance" code
 to determine exactly why it doesn't work.
 
 --
 Justin
 
State-Changed-From-To: open->closed 
State-Changed-By: iedowse 
State-Changed-When: Sat Nov 17 09:43:21 PST 2001 
State-Changed-Why:  

Committed, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21752 
>Unformatted:
