From owner-freebsd-stable@FreeBSD.ORG Fri Oct 31 15:24:33 2003 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 D9FD616A4CE for ; Fri, 31 Oct 2003 15:24:33 -0800 (PST) Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) by mx1.FreeBSD.org (Postfix) with SMTP id 4713B43F3F for ; Fri, 31 Oct 2003 15:24:32 -0800 (PST) (envelope-from darcy@wavefire.com) Received: (qmail 17207 invoked from network); 31 Oct 2003 23:47:43 -0000 Received: from dbitech.wavefire.com (HELO 64.141.15.253) (darcy@64.141.15.253) by radius.wavefire.com with SMTP; 31 Oct 2003 23:47:43 -0000 From: Darcy Buskermolen Organization: Wavefire Technologies Corp. To: Juan Manuel Sanchez , freebsd-stable@freebsd.org Date: Fri, 31 Oct 2003 15:24:30 -0800 User-Agent: KMail/1.5.4 References: <3FA1F3ED.1010306@mi.madritel.es> In-Reply-To: <3FA1F3ED.1010306@mi.madritel.es> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310311524.30836.darcy@wavefire.com> Subject: Re: [PATCH] avoid kernel panic during ATA probe 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: Fri, 31 Oct 2003 23:24:34 -0000 This patch does apear to prevent the panic as described in PR kern/57369. However the system still falls back to PIO4 when it should be capable of UDMA33 (at least) On October 30, 2003 09:32 pm, Juan Manuel Sanchez wrote: > The ata raid code in STABLE allows 15 seconds for reading the disk > headers. If during probe the ata channels need several resets to find a > working configuration that time might be exceeded. When the request > finally succeds the buffer was already freed by ar_rw(), and kernel > panics at any access to corrupt pointers. > > Try this simple patch: > > ----------------------------------------------------------------------- > Index: ata-raid.c > =================================================================== > RCS file: /usr/home/ncvs/src/sys/dev/ata/ata-raid.c,v > retrieving revision 1.3.2.19 > diff -w -u -r1.3.2.19 ata-raid.c > --- ata-raid.c 30 Jan 2003 07:19:59 -0000 1.3.2.19 > +++ ata-raid.c 30 Oct 2003 22:28:30 -0000 > @@ -1427,8 +1427,8 @@ > AR_STRATEGY((struct buf *)bp); > > if (flags & AR_WAIT) { > - while ((retry++ < (15*hz/10)) && (error = !(bp->b_flags & B_DONE))) > - error = tsleep(bp, PRIBIO, "arrw", 10); > + /* AR_STRATEGY success or timeout will wake us up */ > + error = tsleep(bp, PRIBIO, "arrw", 0); > if (!error && (bp->b_flags & B_ERROR)) > error = bp->b_error; > free(bp, M_AR); > ----------------------------------------------------------------------- > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" -- Darcy Buskermolen Wavefire Technologies Corp. ph: 250.717.0200 fx: 250.763.1759 http://www.wavefire.com