diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-09-14 08:55:09 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:13 -0400 |
commit | 242f9dcb8ba6f68fcd217a119a7648a4f69290e9 (patch) | |
tree | 1bfe245ffbc50d204d76665cd8f90d85100f86a1 /drivers/ata/libata-eh.c | |
parent | 608aeef17a91747d6303de4df5e2c2e6899a95e8 (diff) |
block: unify request timeout handling
Right now SCSI and others do their own command timeout handling.
Move those bits to the block layer.
Instead of having a timer per command, we try to be a bit more clever
and simply have one per-queue. This avoids the overhead of having to
tear down and setup a timer for each command, so it will result in a lot
less timer fiddling.
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c1db2f234d2e..bd0b2bc76f10 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -33,6 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
36 | #include <linux/blkdev.h> | ||
36 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
37 | #include <scsi/scsi.h> | 38 | #include <scsi/scsi.h> |
38 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
@@ -457,29 +458,29 @@ static void ata_eh_clear_action(struct ata_link *link, struct ata_device *dev, | |||
457 | * RETURNS: | 458 | * RETURNS: |
458 | * EH_HANDLED or EH_NOT_HANDLED | 459 | * EH_HANDLED or EH_NOT_HANDLED |
459 | */ | 460 | */ |
460 | enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd) | 461 | enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd) |
461 | { | 462 | { |
462 | struct Scsi_Host *host = cmd->device->host; | 463 | struct Scsi_Host *host = cmd->device->host; |
463 | struct ata_port *ap = ata_shost_to_port(host); | 464 | struct ata_port *ap = ata_shost_to_port(host); |
464 | unsigned long flags; | 465 | unsigned long flags; |
465 | struct ata_queued_cmd *qc; | 466 | struct ata_queued_cmd *qc; |
466 | enum scsi_eh_timer_return ret; | 467 | enum blk_eh_timer_return ret; |
467 | 468 | ||
468 | DPRINTK("ENTER\n"); | 469 | DPRINTK("ENTER\n"); |
469 | 470 | ||
470 | if (ap->ops->error_handler) { | 471 | if (ap->ops->error_handler) { |
471 | ret = EH_NOT_HANDLED; | 472 | ret = BLK_EH_NOT_HANDLED; |
472 | goto out; | 473 | goto out; |
473 | } | 474 | } |
474 | 475 | ||
475 | ret = EH_HANDLED; | 476 | ret = BLK_EH_HANDLED; |
476 | spin_lock_irqsave(ap->lock, flags); | 477 | spin_lock_irqsave(ap->lock, flags); |
477 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 478 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
478 | if (qc) { | 479 | if (qc) { |
479 | WARN_ON(qc->scsicmd != cmd); | 480 | WARN_ON(qc->scsicmd != cmd); |
480 | qc->flags |= ATA_QCFLAG_EH_SCHEDULED; | 481 | qc->flags |= ATA_QCFLAG_EH_SCHEDULED; |
481 | qc->err_mask |= AC_ERR_TIMEOUT; | 482 | qc->err_mask |= AC_ERR_TIMEOUT; |
482 | ret = EH_NOT_HANDLED; | 483 | ret = BLK_EH_NOT_HANDLED; |
483 | } | 484 | } |
484 | spin_unlock_irqrestore(ap->lock, flags); | 485 | spin_unlock_irqrestore(ap->lock, flags); |
485 | 486 | ||
@@ -831,7 +832,7 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc) | |||
831 | * Note that ATA_QCFLAG_FAILED is unconditionally set after | 832 | * Note that ATA_QCFLAG_FAILED is unconditionally set after |
832 | * this function completes. | 833 | * this function completes. |
833 | */ | 834 | */ |
834 | scsi_req_abort_cmd(qc->scsicmd); | 835 | blk_abort_request(qc->scsicmd->request); |
835 | } | 836 | } |
836 | 837 | ||
837 | /** | 838 | /** |