diff options
author | sos <sos@FreeBSD.org> | 2003-10-07 13:47:40 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-10-07 13:47:40 +0000 |
commit | 5efe096026ae312d9c43e0f7a233190c09af371c (patch) | |
tree | cce3992ea02a8df9182c1328cbc558302647af46 /sys | |
parent | d6450d69ba0b0e8069baef90933896b89383986a (diff) | |
download | FreeBSD-src-5efe096026ae312d9c43e0f7a233190c09af371c.zip FreeBSD-src-5efe096026ae312d9c43e0f7a233190c09af371c.tar.gz |
Improve timeout handling and reporting.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/ata-queue.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index dac66cb..734fae9 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -316,7 +316,7 @@ ata_timeout(struct ata_request *request) { /* clear timeout etc */ request->timeout_handle.callout = NULL; - +#if 0 /* call interrupt to try finish up the command */ request->device->channel->hw.interrupt(request->device->channel); @@ -327,6 +327,7 @@ ata_timeout(struct ata_request *request) ata_cmd2str(request)); return; } +#endif /* if this was a DMA request stop the engine to be on the safe side */ if (request->flags & ATA_R_DMA) { @@ -334,22 +335,37 @@ ata_timeout(struct ata_request *request) request->device->channel->dma->stop(request->device->channel); } + /* report that we timed out */ + if (request->retries > 0 && !(request->flags & ATA_R_QUIET)) + ata_prtdev(request->device, + "TIMEOUT - %s retrying (%d retr%s left)\n", + ata_cmd2str(request), request->retries, + request->retries == 1 ? "y" : "ies"); + /* try to adjust HW's attitude towards work */ ata_reinit(request->device->channel); - /* if retries still permit, reinject this request */ - if (request->retries-- > 0) { + /* if device disappeared nothing more to do here */ + if (!request->device->softc) { if (!(request->flags & ATA_R_QUIET)) ata_prtdev(request->device, - "TIMEOUT - %s retrying (%d retr%s left)\n", - ata_cmd2str(request), request->retries, - request->retries == 1 ? "y" : "ies"); + "FAILURE - %s device lockup/removed\n", + ata_cmd2str(request)); + return; + } + + /* if retries still permit, reinject this request */ + if (request->retries-- > 0) { request->flags |= (ATA_R_AT_HEAD | ATA_R_REQUEUE); request->flags &= ~ATA_R_SKIPSTART; ata_queue_request(request); } /* otherwise just schedule finish with error */ else { + if (!(request->flags & ATA_R_QUIET)) + ata_prtdev(request->device, + "FAILURE - %s timed out\n", + ata_cmd2str(request)); request->status = ATA_S_ERROR; TASK_INIT(&request->task, 0, ata_completed, request); taskqueue_enqueue(taskqueue_swi, &request->task); |