diff options
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 733aa761f3ee..eb4c0593b406 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -719,19 +719,7 @@ void ata_port_schedule_eh(struct ata_port *ap) | |||
719 | DPRINTK("port EH scheduled\n"); | 719 | DPRINTK("port EH scheduled\n"); |
720 | } | 720 | } |
721 | 721 | ||
722 | /** | 722 | static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) |
723 | * ata_port_abort - abort all qc's on the port | ||
724 | * @ap: ATA port to abort qc's for | ||
725 | * | ||
726 | * Abort all active qc's of @ap and schedule EH. | ||
727 | * | ||
728 | * LOCKING: | ||
729 | * spin_lock_irqsave(host lock) | ||
730 | * | ||
731 | * RETURNS: | ||
732 | * Number of aborted qc's. | ||
733 | */ | ||
734 | int ata_port_abort(struct ata_port *ap) | ||
735 | { | 723 | { |
736 | int tag, nr_aborted = 0; | 724 | int tag, nr_aborted = 0; |
737 | 725 | ||
@@ -743,7 +731,7 @@ int ata_port_abort(struct ata_port *ap) | |||
743 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { | 731 | for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { |
744 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); | 732 | struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag); |
745 | 733 | ||
746 | if (qc) { | 734 | if (qc && (!link || qc->dev->link == link)) { |
747 | qc->flags |= ATA_QCFLAG_FAILED; | 735 | qc->flags |= ATA_QCFLAG_FAILED; |
748 | ata_qc_complete(qc); | 736 | ata_qc_complete(qc); |
749 | nr_aborted++; | 737 | nr_aborted++; |
@@ -757,6 +745,40 @@ int ata_port_abort(struct ata_port *ap) | |||
757 | } | 745 | } |
758 | 746 | ||
759 | /** | 747 | /** |
748 | * ata_link_abort - abort all qc's on the link | ||
749 | * @link: ATA link to abort qc's for | ||
750 | * | ||
751 | * Abort all active qc's active on @link and schedule EH. | ||
752 | * | ||
753 | * LOCKING: | ||
754 | * spin_lock_irqsave(host lock) | ||
755 | * | ||
756 | * RETURNS: | ||
757 | * Number of aborted qc's. | ||
758 | */ | ||
759 | int ata_link_abort(struct ata_link *link) | ||
760 | { | ||
761 | return ata_do_link_abort(link->ap, link); | ||
762 | } | ||
763 | |||
764 | /** | ||
765 | * ata_port_abort - abort all qc's on the port | ||
766 | * @ap: ATA port to abort qc's for | ||
767 | * | ||
768 | * Abort all active qc's of @ap and schedule EH. | ||
769 | * | ||
770 | * LOCKING: | ||
771 | * spin_lock_irqsave(host_set lock) | ||
772 | * | ||
773 | * RETURNS: | ||
774 | * Number of aborted qc's. | ||
775 | */ | ||
776 | int ata_port_abort(struct ata_port *ap) | ||
777 | { | ||
778 | return ata_do_link_abort(ap, NULL); | ||
779 | } | ||
780 | |||
781 | /** | ||
760 | * __ata_port_freeze - freeze port | 782 | * __ata_port_freeze - freeze port |
761 | * @ap: ATA port to freeze | 783 | * @ap: ATA port to freeze |
762 | * | 784 | * |