Bug 21752

Summary: Infortrend IFT-3102 doesn't like SCSI Cache Sync
Product: Base System Reporter: nickc <nickc>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-STABLE   
Hardware: Any   
OS: Any   

Description nickc 2000-10-04 15:30:01 UTC
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.

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:



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;--xoPQ9pD7otoKudLj1fkhq7AMgTvkvmDSFf3cYWLQVHoBH6Un
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** 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
!       }
  };
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...
Comment 1 gibbs 2000-10-04 17:03:18 UTC
> >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
Comment 2 iedowse freebsd_committer freebsd_triage 2001-11-17 17:43:21 UTC
State Changed
From-To: open->closed


Committed, thanks!