Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Aug 2004 12:27:53 +0300
From:      Ville-Pertti Keinonen <will+freebsd-current@will.iki.fi>
To:        =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk>
Cc:        freebsd-current@freebsd.org
Subject:   Re: ATA driver races with interrupts
Message-ID:  <410F5A99.8070005@will.iki.fi>
In-Reply-To: <410F4F66.8040201@DeepCore.dk>
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> <410F3DD0.5030104@will.iki.fi> <410F4F66.8040201@DeepCore.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Søren Schmidt wrote:

> We dont want to disable interrupts, ever.

That makes avoiding races difficult for some hardware...

> I have one change in a tree here that you could try, but as long as 
> the hardware doesn't support proper interrupt status its impossible to 
> close the race window completely. Please remember that this is part of 
> a bigger patchset, so I might have edited it too much, YMMV,,

It introduces the same race as my patch - if the interrupt occurs after 
ATA_DMA_ACTIVE is set but before running is set, the interrupt may be 
acknowledged (I assume that's what writing BMSTAT_PORT does) but ignored 
(because running == NULL).

It seems to me that reliable solutions would all involve atomically 
(from an interrupt perspective) performing the final activation of the 
transaction and marking the transaction active for the interrupt handler 
to check.  What the correct way to ensure such atomicity in -current is, 
I don't know.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?410F5A99.8070005>