Date: Sat, 2 Aug 1997 16:18:33 -0700 (PDT) From: ehm@cris.com To: freebsd-gnats-submit@FreeBSD.ORG Subject: kern/4217: Tek390 driver fails with other vendor's (am53c974) SCSI Host Adapter Message-ID: <199708022318.QAA21097@hub.freebsd.org> Resent-Message-ID: <199708022320.QAA21185@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4217 >Category: kern >Synopsis: Tek390 driver fails with other vendor's (am53c974) SCSI Host Adapter >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 2 16:20:02 PDT 1997 >Last-Modified: >Originator: Erik H. Moe >Organization: >Release: 2.2.1-RELEASE >Environment: FreeBSD wombat.cris.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #9: Sat Aug 2 16:44:46 CDT 1997 ehm@wombat.cris.com:/usr/src/sys/compile/WOMBAT-SCSI i386 >Description: TekRam has supplied a driver for their DC390 and DC390T SCSI host adapters. These boards are based on the AMD am53c974 PCI SCSI chip. The TekRam driver is reported to work with other vendor's host adapters which are also built around this AMD chip. I have a Qlogic Fast!SCSI PCI Basic host adapter which is am53c974 based. The only difference between the DC390 and the Qlogic product is that the DC390 has an eeprom to store adapter settings, while the Qlogic adapter doesn't. The TekRam driver detects which adapters have eeprom memory and provides a reasonable set of defaults for those adapters that don't. The problem is that the routine which defaults the eeprom settings, "DC390_DefaultEEprom()", has a pointer bug which causes memory corruption and fails to intialize the driver with the correct settings. This failure causes the SCSI adapter to become unresponsive to commands, ie. it becomes "wedged". >How-To-Repeat: Use the TekRam driver with a non-TekTram adapter. >Fix: The following patch applied against version 1.5 of "tekram.c" will correct this bug and fix some deficiencies in error handling. --- /home/ehm/tek390-1.5.c Sat Aug 2 14:51:26 1997 +++ tek390.c Sat Aug 2 16:43:43 1997 @@ -666,7 +666,7 @@ pACB->pFreeSRB = pSRB; pcmd->error = XS_DRIVER_STUFFUP; splx(flags); - return (HAD_ERROR); + return (COMPLETE); } } else @@ -712,7 +712,8 @@ } if( pcmd->timeout == 0 ) { - return(HAD_ERROR); + pcmd->error = XS_DRIVER_STUFFUP; + return(COMPLETE); } else { @@ -720,10 +721,7 @@ } } while( !(pcmd->flags & ITSDONE) ); - if( pcmd->error == XS_TIMEOUT) - return(HAD_ERROR); - else - return(COMPLETE); + return(COMPLETE); } } @@ -1497,9 +1495,9 @@ *ptr = (TAG_QUEUING_|EN_DISCONNECT_|SYNC_NEGO_|PARITY_CHK_); ptr += 4; } - ptr[EE_ADAPT_SCSI_ID] = 7; - ptr[EE_MODE2] = (LUN_CHECK|ACTIVE_NEGATION); - ptr[EE_TAG_CMD_NUM] = 4; + eepromBuf[index][EE_ADAPT_SCSI_ID] = 7; + eepromBuf[index][EE_MODE2] = (LUN_CHECK|ACTIVE_NEGATION); + eepromBuf[index][EE_TAG_CMD_NUM] = 4; return 0; } >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708022318.QAA21097>