From 4a2e45ea3661645fa7ad0c9436b93024ebf355e8 Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Sun, 26 Apr 2009 21:02:16 +0000 Subject: [PATCH] According to ATA-4 specification, the error and device-fault bit (and all other status register bits) are only valid when the busy bit is zero. This makes PIO mode work on a WD Raptor. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30443 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp index e00e998301..393e1a5878 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp @@ -394,12 +394,14 @@ ATAChannel::Wait(uint8 setBits, uint8 clearedBits, uint32 flags, while (true) { uint8 status = AltStatus(); if ((flags & ATA_CHECK_ERROR_BIT) != 0 + && (status & ATA_STATUS_BUSY) == 0 && (status & ATA_STATUS_ERROR) != 0) { TRACE("error bit set while waiting\n"); return B_ERROR; } if ((flags & ATA_CHECK_DEVICE_FAULT) != 0 + && (status & ATA_STATUS_BUSY) == 0 && (status & ATA_STATUS_DEVICE_FAULT) != 0) { TRACE("device fault bit set while waiting\n"); return B_ERROR;