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 | |
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')
-rw-r--r-- | drivers/ata/libata-eh.c | 13 | ||||
-rw-r--r-- | drivers/ata/libata.h | 2 |
2 files changed, 8 insertions, 7 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 | /** |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index ade5c75b6144..24f5005478b0 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -152,7 +152,7 @@ extern int ata_bus_probe(struct ata_port *ap); | |||
152 | /* libata-eh.c */ | 152 | /* libata-eh.c */ |
153 | extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd); | 153 | extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd); |
154 | extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd); | 154 | extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd); |
155 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | 155 | extern enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); |
156 | extern void ata_scsi_error(struct Scsi_Host *host); | 156 | extern void ata_scsi_error(struct Scsi_Host *host); |
157 | extern void ata_port_wait_eh(struct ata_port *ap); | 157 | extern void ata_port_wait_eh(struct ata_port *ap); |
158 | extern void ata_eh_fastdrain_timerfn(unsigned long arg); | 158 | extern void ata_eh_fastdrain_timerfn(unsigned long arg); |