From owner-freebsd-stable@FreeBSD.ORG Wed Mar 17 08:13:54 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8366616A4CE for ; Wed, 17 Mar 2004 08:13:54 -0800 (PST) Received: from www.ambrisko.com (adsl-64-174-51-42.dsl.snfc21.pacbell.net [64.174.51.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 246F043D2D for ; Wed, 17 Mar 2004 08:13:54 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.9p2/8.12.9) with ESMTP id i2HGDoCf064215; Wed, 17 Mar 2004 08:13:51 -0800 (PST) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.12.9p2/8.12.9/Submit) id i2HGDomg064214; Wed, 17 Mar 2004 08:13:50 -0800 (PST) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200403171613.i2HGDomg064214@ambrisko.com> In-Reply-To: To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= Date: Wed, 17 Mar 2004 08:13:50 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT cc: stable@freebsd.org Subject: Re: Backporting S-ATA driver SiI 3112a to FreeBSD-STABLE? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2004 16:13:54 -0000 Dag-Erling Smørgrav writes: | Doug Ambrisko writes: | > BTW a failure mode in the SATA spec. says freeze (ie. lock up the | > system if you don't acknowledge SATA issues). | | Huh? Care to elaborate? >From the Serial ATA Spec. 1.0a. Section 11.1 for error handling: Error responses are generally classified into four categories Freeze Abort Retry Track/ignore The error handling responses described in this section are not comprehensive and are included to cover specific known error scenarios as well as to illustrate typical error control and recovery actions. This section is therefore descriptive and supplemental to the error reporting interface defined in section 10 and implementations may vary in their internal error recovery and control actions. For the most severe error conditions in which state has been critically perturbed in a way that it is not recoverable, the appropriate error response is to freeze and rely on a reset or similar operation to restore all necessary state to return to normal operation. I have seen freeze result in system lock-ups in which an NMI can't break into the debugger etc. With the Promise SATA cards if I have interrupts enabled and the interrupt handler checks whether or not a drive has left then the system lock ups go away with the Promise controller. For the Intel 6300ESB I need to poll the SATA serror register to look for SATA errors or the system will lock up. The way I generate an error is to either power off the SATA drive or pull the cable while the system is running. I'm running with ata-raid. Unfortunately the Intel parts don't interrupt on a SATA condition so I have to poll it. I need to put a timeout to check for drives coming or going then it should work close how the Promise controller works. The Intel 6300ESB does indeed have both sstatus and serror registers even though they only claim the serror is there. The sstatus register says whether or not a drive is there. Most of the existing ATA code will just bang on the controller and if a SATA error happens it is ignored and eventually just doing a inb or outb to the controller will lock up the system. I did initial instrumentation to that level of inb/outb. This wasn't a lot of fun to debug since if I messed up I'd get a system lock up. Granted in normal operation this isn't a problem but during failure recovery that I was testing system lock ups are not good. Now I really like the SATA stuff since it is pretty easy to implement kernel support for hot plug like USB drives etc. Doug A.