From owner-freebsd-current@FreeBSD.ORG Fri Aug 6 23:35:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B3CB16A4CE for ; Fri, 6 Aug 2004 23:35:45 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B7A243D2D for ; Fri, 6 Aug 2004 23:35:45 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-67-127-84-57.dsl.snfc21.pacbell.net [67.127.84.57]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id i76NZb8U030808; Fri, 6 Aug 2004 16:35:37 -0700 Message-ID: <411415C8.4070600@root.org> Date: Fri, 06 Aug 2004 16:35:36 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7 (X11/20040702) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?S=F8ren_Schmidt?= References: <4113EB2A.7060401@root.org> <41140722.10807@DeepCore.dk> In-Reply-To: <41140722.10807@DeepCore.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: Ceri Davies cc: current@freebsd.org cc: Radek Kozlowski Subject: Re: Panic on boot with today's CURRENT, ata related X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2004 23:35:45 -0000 Søren Schmidt wrote: > Nate Lawson wrote: > >> I took a quick look at this ATA panic. The exact same one occurs for >> Ceri. A quick dissassemble shows that the testb is the check for the >> DMA flag at the very end of ata_generic_transaction(). The bug >> appears to be that this may be a PIO request (since the DMA check is >> outside the switch() statement). The fix is to make sure it's a DMA >> request before dereferencing an element of the DMA struct. Try the >> attached patch. > > No, the fix is to make sure there is a valid ch->dma pointer, the below > is the correct fix. > > --- ata-lowlevel.c 5 Aug 2004 21:13:41 -0000 1.41 > +++ ata-lowlevel.c 6 Aug 2004 22:31:16 -0000 > @@ -295,7 +295,7 @@ > } > > /* request finish here */ > - if (ch->dma->flags & ATA_DMA_LOADED) > + if (ch->dma && ch->dma->flags & ATA_DMA_LOADED) > ch->dma->unload(ch); > return ATA_OP_FINISHED; > } Thanks. Under what circumstances is a request generated with ATA_R_DMA set in the flags but where the channel's dma struct has not been allocated? -Nate