aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sx4.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-22 23:09:37 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 22:36:28 -0500
commita72ec4ce6d3ae92e76baf5b2c65cc26e5e775e83 (patch)
treef5a177cc30c9b39d8ae7dcad29d03d27534b9f78 /drivers/scsi/sata_sx4.c
parent041c5fc33cb7ed4fe5322585a611fb6e29a05d3a (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/sata_sx4.c')
-rw-r--r--drivers/scsi/sata_sx4.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index 3175c6bb4fec..9f992fbcf2e7 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -872,20 +872,11 @@ static void pdc_eng_timeout(struct ata_port *ap)
872 goto out; 872 goto out;
873 } 873 }
874 874
875 /* hack alert! We cannot use the supplied completion
876 * function from inside the ->eh_strategy_handler() thread.
877 * libata is the only user of ->eh_strategy_handler() in
878 * any kernel, so the default scsi_done() assumes it is
879 * not being called from the SCSI EH.
880 */
881 qc->scsidone = scsi_finish_command;
882
883 switch (qc->tf.protocol) { 875 switch (qc->tf.protocol) {
884 case ATA_PROT_DMA: 876 case ATA_PROT_DMA:
885 case ATA_PROT_NODATA: 877 case ATA_PROT_NODATA:
886 printk(KERN_ERR "ata%u: command timeout\n", ap->id); 878 printk(KERN_ERR "ata%u: command timeout\n", ap->id);
887 qc->err_mask |= __ac_err_mask(ata_wait_idle(ap)); 879 qc->err_mask |= __ac_err_mask(ata_wait_idle(ap));
888 ata_qc_complete(qc);
889 break; 880 break;
890 881
891 default: 882 default:
@@ -895,12 +886,13 @@ static void pdc_eng_timeout(struct ata_port *ap)
895 ap->id, qc->tf.command, drv_stat); 886 ap->id, qc->tf.command, drv_stat);
896 887
897 qc->err_mask |= ac_err_mask(drv_stat); 888 qc->err_mask |= ac_err_mask(drv_stat);
898 ata_qc_complete(qc);
899 break; 889 break;
900 } 890 }
901 891
902out: 892out:
903 spin_unlock_irqrestore(&host_set->lock, flags); 893 spin_unlock_irqrestore(&host_set->lock, flags);
894 if (qc)
895 ata_eh_qc_complete(qc);
904 DPRINTK("EXIT\n"); 896 DPRINTK("EXIT\n");
905} 897}
906 898