ATA driver races with interrupts

Søren Schmidt sos at DeepCore.dk
Mon Aug 2 13:51:00 PDT 2004


Ville-Pertti Keinonen wrote:
> Søren Schmidt wrote:
> 
>> There is no good solution to this *unless* the HW has bits to 
>> determine which channel caused the interrupt. Now all decent 
>> controller has this, but I have no idea about the VIA since they are 
>> not one of those companies that hands out docs.
>>
>> The only way to safeguard is to "serialize" access to the channels as 
>> I've done on a few oh so broken chipsets...
> 
> 
> Ok, I see where it should be detected now - in ata_generic_intr, before 
> ata_generic_interrupt...
> 
> There is an actual test for the interrupt on the channel, so there 
> should be no race if the controller works correctly.  Apparently the VIA 
> doesn't...
> 
> The detection only applies to DMA - is PIO sensitive to unexpected 
> interrupts, even on working controllers?  If so, shouldn't there be some 
> protection against this?

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...

-- 
-Søren



More information about the freebsd-current mailing list