diff options
author | Tejun Heo <htejun@gmail.com> | 2006-01-22 23:09:37 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-26 22:36:28 -0500 |
commit | a72ec4ce6d3ae92e76baf5b2c65cc26e5e775e83 (patch) | |
tree | f5a177cc30c9b39d8ae7dcad29d03d27534b9f78 /drivers/scsi/libata-core.c | |
parent | 041c5fc33cb7ed4fe5322585a611fb6e29a05d3a (diff) |
[PATCH] libata: implement and apply ata_eh_qc_complete/retry()
Implement ata_eh_qc_complete/retry() using scsi_eh_finish_cmd() and
scsi_eh_flush_done_q(). This removes all eh scsicmd finish hacks from
low level drivers.
This change was first suggested by Jeff Garzik.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b29bf0dc948a..93ae2dcc837c 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3449,14 +3449,6 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc) | |||
3449 | 3449 | ||
3450 | spin_lock_irqsave(&host_set->lock, flags); | 3450 | spin_lock_irqsave(&host_set->lock, flags); |
3451 | 3451 | ||
3452 | /* hack alert! We cannot use the supplied completion | ||
3453 | * function from inside the ->eh_strategy_handler() thread. | ||
3454 | * libata is the only user of ->eh_strategy_handler() in | ||
3455 | * any kernel, so the default scsi_done() assumes it is | ||
3456 | * not being called from the SCSI EH. | ||
3457 | */ | ||
3458 | qc->scsidone = scsi_finish_command; | ||
3459 | |||
3460 | switch (qc->tf.protocol) { | 3452 | switch (qc->tf.protocol) { |
3461 | 3453 | ||
3462 | case ATA_PROT_DMA: | 3454 | case ATA_PROT_DMA: |
@@ -3480,12 +3472,13 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc) | |||
3480 | 3472 | ||
3481 | /* complete taskfile transaction */ | 3473 | /* complete taskfile transaction */ |
3482 | qc->err_mask |= ac_err_mask(drv_stat); | 3474 | qc->err_mask |= ac_err_mask(drv_stat); |
3483 | ata_qc_complete(qc); | ||
3484 | break; | 3475 | break; |
3485 | } | 3476 | } |
3486 | 3477 | ||
3487 | spin_unlock_irqrestore(&host_set->lock, flags); | 3478 | spin_unlock_irqrestore(&host_set->lock, flags); |
3488 | 3479 | ||
3480 | ata_eh_qc_complete(qc); | ||
3481 | |||
3489 | DPRINTK("EXIT\n"); | 3482 | DPRINTK("EXIT\n"); |
3490 | } | 3483 | } |
3491 | 3484 | ||
@@ -4422,6 +4415,7 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host, | |||
4422 | 4415 | ||
4423 | INIT_WORK(&ap->packet_task, atapi_packet_task, ap); | 4416 | INIT_WORK(&ap->packet_task, atapi_packet_task, ap); |
4424 | INIT_WORK(&ap->pio_task, ata_pio_task, ap); | 4417 | INIT_WORK(&ap->pio_task, ata_pio_task, ap); |
4418 | INIT_LIST_HEAD(&ap->eh_done_q); | ||
4425 | 4419 | ||
4426 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 4420 | for (i = 0; i < ATA_MAX_DEVICES; i++) |
4427 | ap->device[i].devno = i; | 4421 | ap->device[i].devno = i; |
@@ -5165,6 +5159,8 @@ EXPORT_SYMBOL_GPL(ata_dev_classify); | |||
5165 | EXPORT_SYMBOL_GPL(ata_dev_id_string); | 5159 | EXPORT_SYMBOL_GPL(ata_dev_id_string); |
5166 | EXPORT_SYMBOL_GPL(ata_dev_config); | 5160 | EXPORT_SYMBOL_GPL(ata_dev_config); |
5167 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); | 5161 | EXPORT_SYMBOL_GPL(ata_scsi_simulate); |
5162 | EXPORT_SYMBOL_GPL(ata_eh_qc_complete); | ||
5163 | EXPORT_SYMBOL_GPL(ata_eh_qc_retry); | ||
5168 | 5164 | ||
5169 | EXPORT_SYMBOL_GPL(ata_pio_need_iordy); | 5165 | EXPORT_SYMBOL_GPL(ata_pio_need_iordy); |
5170 | EXPORT_SYMBOL_GPL(ata_timing_compute); | 5166 | EXPORT_SYMBOL_GPL(ata_timing_compute); |