From c2c3d40c7b7ae85cec77dbe7a2e8effc25bb0c21 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 24 Apr 2009 16:03:01 +0000 Subject: [PATCH] Check the status value for validity before waiting for a device. If it has an invalid value, assume the device is not present. Should fix long boot pauses in VMWare and maybe also on some hardware. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30381 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp index 5373986f29..493260852c 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp @@ -322,6 +322,13 @@ ATAChannel::Reset(bool *presence, uint16 *signatures) uint8 deviceCount = fDeviceCount; for (uint8 i = 0; i < deviceCount; i++) { SelectDevice(i); + + if (AltStatus() == 0xff) { + TRACE_ALWAYS("illegal status value for device %d," + " assuming not present\n", i); + continue; + } + if (SelectedDevice() != i) { TRACE_ALWAYS("cannot select device %d, assuming not present\n", i); continue;