From owner-cvs-src@FreeBSD.ORG Fri Jun 27 21:46:55 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C03AD37B404; Fri, 27 Jun 2003 21:46:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6798543FE1; Fri, 27 Jun 2003 21:46:55 -0700 (PDT) (envelope-from gibbs@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h5S4kt0U058770; Fri, 27 Jun 2003 21:46:55 -0700 (PDT) (envelope-from gibbs@repoman.freebsd.org) Received: (from gibbs@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h5S4ktPr058769; Fri, 27 Jun 2003 21:46:55 -0700 (PDT) Message-Id: <200306280446.h5S4ktPr058769@repoman.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 27 Jun 2003 21:46:55 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/aic7xxx aic79xx.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2003 04:46:56 -0000 gibbs 2003/06/27 21:46:55 PDT FreeBSD src repository Modified files: sys/dev/aic7xxx aic79xx.c Log: Fix a race condition in the flushing of commands that have completed across the bus but not to the host before processing of an exception condition (busfree, bus reset, etc.). When flushing the controller of completed commands, we also look for packetized commands that have completed with good status and are stored in the "good status fifo". The hardware will post to the good status fifo even if data for that command is still active in a FIFO. In one particular failure case, a command outstanding on the bus reconnected, transferred data into a FIFO, and provided good status while the host driver was processing an expected busfree event (PPR message negotiation). This resulted in an entry in the good status fifo that we completed, but since the sequencer was paused, the data in the data FIFO for this command had never been transferred to the host. Once the busfree processing was complete, the sequencer was unpaused, and the data completed its transfer to the host. In some instances, the client for the data was notified of the completion and attempted to view the data before it arrived. This case only occurred during FreeBSD's multi-target probe of the SCSI bus while some devices are negotiating to go packetized and some devices are already running in packetized. The fix is to run and FIFOs active with a context in the good status fifo to completion before completing the command to the SCSI layer. This requies duplicating the FIFO rundown operations in the host driver that would usually be handled by the firmware, but there is no other alternative. Don't blindly shutdown the SCB dma engine when restarting the sequencer. We may be killing an operation that is not supposed to be cancelled. The cases where we need to shutdown these dma engines are already handled elsewhere in the driver. Fix a few more ahd_in?() -> ahd_in?_scbram() instances. Revision Changes Path 1.24 +379 -49 src/sys/dev/aic7xxx/aic79xx.c