diff options
author | Tejun Heo <htejun@gmail.com> | 2006-02-10 01:10:48 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-10 06:50:45 -0500 |
commit | 341963b909a01d2f38d86f5db8dd1f8c80bd6dbf (patch) | |
tree | b19def143135b45b64d62e4e048aaae5b711696f /drivers/scsi | |
parent | 1fdffbce0332b3e00993d741e76935e7f4f0d40f (diff) |
[PATCH] libata: add ATA_QCFLAG_EH_SCHEDULED
Add ATA_QCFLAG_EH_SCHEDULED. If this flag is set, the qc is owned by
EH and normal completion path is not allowed to finish it. This patch
doesn't actually use this flag.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 33 | ||||
-rw-r--r-- | drivers/scsi/libata-scsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libata.h | 1 |
3 files changed, 22 insertions, 14 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 22db73932253..977a53dd1677 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3620,19 +3620,7 @@ void ata_qc_free(struct ata_queued_cmd *qc) | |||
3620 | } | 3620 | } |
3621 | } | 3621 | } |
3622 | 3622 | ||
3623 | /** | 3623 | inline void __ata_qc_complete(struct ata_queued_cmd *qc) |
3624 | * ata_qc_complete - Complete an active ATA command | ||
3625 | * @qc: Command to complete | ||
3626 | * @err_mask: ATA Status register contents | ||
3627 | * | ||
3628 | * Indicate to the mid and upper layers that an ATA | ||
3629 | * command has completed, with either an ok or not-ok status. | ||
3630 | * | ||
3631 | * LOCKING: | ||
3632 | * spin_lock_irqsave(host_set lock) | ||
3633 | */ | ||
3634 | |||
3635 | void ata_qc_complete(struct ata_queued_cmd *qc) | ||
3636 | { | 3624 | { |
3637 | assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */ | 3625 | assert(qc != NULL); /* ata_qc_from_tag _might_ return NULL */ |
3638 | assert(qc->flags & ATA_QCFLAG_ACTIVE); | 3626 | assert(qc->flags & ATA_QCFLAG_ACTIVE); |
@@ -3650,6 +3638,25 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
3650 | qc->complete_fn(qc); | 3638 | qc->complete_fn(qc); |
3651 | } | 3639 | } |
3652 | 3640 | ||
3641 | /** | ||
3642 | * ata_qc_complete - Complete an active ATA command | ||
3643 | * @qc: Command to complete | ||
3644 | * @err_mask: ATA Status register contents | ||
3645 | * | ||
3646 | * Indicate to the mid and upper layers that an ATA | ||
3647 | * command has completed, with either an ok or not-ok status. | ||
3648 | * | ||
3649 | * LOCKING: | ||
3650 | * spin_lock_irqsave(host_set lock) | ||
3651 | */ | ||
3652 | void ata_qc_complete(struct ata_queued_cmd *qc) | ||
3653 | { | ||
3654 | if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED)) | ||
3655 | return; | ||
3656 | |||
3657 | __ata_qc_complete(qc); | ||
3658 | } | ||
3659 | |||
3653 | static inline int ata_should_dma_map(struct ata_queued_cmd *qc) | 3660 | static inline int ata_should_dma_map(struct ata_queued_cmd *qc) |
3654 | { | 3661 | { |
3655 | struct ata_port *ap = qc->ap; | 3662 | struct ata_port *ap = qc->ap; |
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index b007bb409382..1df468eb2bf3 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -770,7 +770,7 @@ static void __ata_eh_qc_complete(struct ata_queued_cmd *qc) | |||
770 | 770 | ||
771 | spin_lock_irqsave(&ap->host_set->lock, flags); | 771 | spin_lock_irqsave(&ap->host_set->lock, flags); |
772 | qc->scsidone = ata_eh_scsidone; | 772 | qc->scsidone = ata_eh_scsidone; |
773 | ata_qc_complete(qc); | 773 | __ata_qc_complete(qc); |
774 | assert(!ata_tag_valid(qc->tag)); | 774 | assert(!ata_tag_valid(qc->tag)); |
775 | spin_unlock_irqrestore(&ap->host_set->lock, flags); | 775 | spin_unlock_irqrestore(&ap->host_set->lock, flags); |
776 | 776 | ||
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h index 9d76923a2253..1cd071a32e93 100644 --- a/drivers/scsi/libata.h +++ b/drivers/scsi/libata.h | |||
@@ -46,6 +46,7 @@ extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, | |||
46 | extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); | 46 | extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); |
47 | extern void ata_qc_free(struct ata_queued_cmd *qc); | 47 | extern void ata_qc_free(struct ata_queued_cmd *qc); |
48 | extern unsigned int ata_qc_issue(struct ata_queued_cmd *qc); | 48 | extern unsigned int ata_qc_issue(struct ata_queued_cmd *qc); |
49 | extern void __ata_qc_complete(struct ata_queued_cmd *qc); | ||
49 | extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); | 50 | extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); |
50 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, | 51 | extern void ata_dev_select(struct ata_port *ap, unsigned int device, |
51 | unsigned int wait, unsigned int can_sleep); | 52 | unsigned int wait, unsigned int can_sleep); |