From owner-freebsd-current@FreeBSD.ORG Tue Aug 3 07:25:12 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 3CC7316A4CE for ; Tue, 3 Aug 2004 07:25:12 +0000 (GMT) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id E12AA43D1F for ; Tue, 3 Aug 2004 07:25:11 +0000 (GMT) (envelope-from will+freebsd-current@will.iki.fi) Received: from [10.0.20.162] (fa-3-0-0.fw.exomi.com [217.169.64.99]) by will.iki.fi (Postfix) with ESMTP id C4E4E24; Tue, 3 Aug 2004 10:27:22 +0300 (EEST) Message-ID: <410F3DD0.5030104@will.iki.fi> Date: Tue, 03 Aug 2004 10:25:04 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040708) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?S=F8ren_Schmidt?= References: <410E688D.7020709@will.iki.fi> <410E74F7.1070000@will.iki.fi> <20040802132802.3d7kgoow0c80ss0s@www.sweetdreamsracing.biz> <410E7B8B.3080407@will.iki.fi> <410E81B8.1000206@DeepCore.dk> <410E8594.7070600@will.iki.fi> <410EA92C.6090506@DeepCore.dk> In-Reply-To: <410EA92C.6090506@DeepCore.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-current@freebsd.org Subject: Re: ATA driver races with interrupts 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: Tue, 03 Aug 2004 07:25:12 -0000 Søren Schmidt wrote: > If the controller doesn't have a bit saying if the interrupt is for > us, then its impossible to close the race completely (without the > above measures in place). However some devices use the DMA interrupt > bits even in PIO mode (ie HPT does this) but I have no docs on the > VIA's on that, but its worth a try at least... The current situation seems to me like ata_generic_intr can't work for *any* controller sharing interrupts, even with DMA on a controller that sets ATA_BMSTAT_INTERRUPT correctly, since if an interrupt occurs before ATA_DMA_ACTIVE is set, ATA_BMSTAT_PORT is never even checked. IMHO ch->running != NULL is an insufficient condition based on which to assume that an interrupt is intended for a specific channel... Something similar to my patch + disabling interrupts to avoid a race between the interrupt and ATA_EXPECT_INTR being set should at least improve the situation. What races would that leave open?