aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-31 06:41:11 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-31 10:14:42 -0500
commit8e0e694a3a48212bfe29a9ad3cd592bf68dfec81 (patch)
tree82f2b114160c8f1a6537c471fea7b41e50a80814 /drivers/scsi/libata-core.c
parente4a70e76add280db6068426716a9b2a74099144f (diff)
[PATCH] libata: make ata_qc_issue complete failed qcs
There is no reason for the issuer to diddle with a failed qc as the issuer has complete control over when a qc gets freed (usually in ->complete_fn). Make ata_qc_issue() responsible for completing qcs which failed to issue. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index eb4df01d9fa..63ae23b5c07 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -989,9 +989,7 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev,
989 qc->private_data = &wait; 989 qc->private_data = &wait;
990 qc->complete_fn = ata_qc_complete_internal; 990 qc->complete_fn = ata_qc_complete_internal;
991 991
992 qc->err_mask = ata_qc_issue(qc); 992 ata_qc_issue(qc);
993 if (qc->err_mask)
994 ata_qc_complete(qc);
995 993
996 spin_unlock_irqrestore(&ap->host_set->lock, flags); 994 spin_unlock_irqrestore(&ap->host_set->lock, flags);
997 995
@@ -3997,12 +3995,8 @@ static inline int ata_should_dma_map(struct ata_queued_cmd *qc)
3997 * 3995 *
3998 * LOCKING: 3996 * LOCKING:
3999 * spin_lock_irqsave(host_set lock) 3997 * spin_lock_irqsave(host_set lock)
4000 *
4001 * RETURNS:
4002 * Zero on success, AC_ERR_* mask on failure
4003 */ 3998 */
4004 3999void ata_qc_issue(struct ata_queued_cmd *qc)
4005unsigned int ata_qc_issue(struct ata_queued_cmd *qc)
4006{ 4000{
4007 struct ata_port *ap = qc->ap; 4001 struct ata_port *ap = qc->ap;
4008 4002
@@ -4023,14 +4017,18 @@ unsigned int ata_qc_issue(struct ata_queued_cmd *qc)
4023 4017
4024 ap->ops->qc_prep(qc); 4018 ap->ops->qc_prep(qc);
4025 4019
4026 return ap->ops->qc_issue(qc); 4020 qc->err_mask |= ap->ops->qc_issue(qc);
4021 if (unlikely(qc->err_mask))
4022 goto err;
4023 return;
4027 4024
4028sg_err: 4025sg_err:
4029 qc->flags &= ~ATA_QCFLAG_DMAMAP; 4026 qc->flags &= ~ATA_QCFLAG_DMAMAP;
4030 return AC_ERR_SYSTEM; 4027 qc->err_mask |= AC_ERR_SYSTEM;
4028err:
4029 ata_qc_complete(qc);
4031} 4030}
4032 4031
4033
4034/** 4032/**
4035 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner 4033 * ata_qc_issue_prot - issue taskfile to device in proto-dependent manner
4036 * @qc: command to issue to device 4034 * @qc: command to issue to device