From f4f2f6f56579c90eccd120cc91038d5a7c3d62b2 Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Mon, 7 Sep 2009 23:52:58 +0000 Subject: [PATCH] Add more debug code. I see spurius device selection timeouts. When this happens, no recovery is possible right now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32989 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/bus_managers/ata/ATAChannel.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp index 7ae3dcef22..83667d63d8 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp @@ -577,11 +577,22 @@ ATAChannel::RecoverLostInterrupt() status_t ATAChannel::SendRequest(ATARequest *request, uint32 flags) { + // TODO: implement this: + // resetting the device here would discard current configuration, + // it's better when the SCSI bus manager requests an external reset. + TRACE_FUNCTION("\n"); ATADevice *device = request->Device(); - if (device->Select() != B_OK || WaitForIdle() != B_OK) { - // resetting the device here will discard current configuration, - // it's better when the SCSI bus manager requests an external reset. + + TRACE("SendRequest status 0x%02x\n", AltStatus()); + + if (device->Select() != B_OK) { + TRACE_ERROR("device selection failed\n"); + request->SetStatus(SCSI_SEL_TIMEOUT); + return B_TIMED_OUT; + } + + if (WaitForIdle() != B_OK) { TRACE_ERROR("device selection timeout\n"); request->SetStatus(SCSI_SEL_TIMEOUT); return B_TIMED_OUT;