|
@@ -719,19 +719,7 @@ void ata_port_schedule_eh(struct ata_port *ap)
|
|
|
DPRINTK("port EH scheduled\n");
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * ata_port_abort - abort all qc's on the port
|
|
|
- * @ap: ATA port to abort qc's for
|
|
|
- *
|
|
|
- * Abort all active qc's of @ap and schedule EH.
|
|
|
- *
|
|
|
- * LOCKING:
|
|
|
- * spin_lock_irqsave(host lock)
|
|
|
- *
|
|
|
- * RETURNS:
|
|
|
- * Number of aborted qc's.
|
|
|
- */
|
|
|
-int ata_port_abort(struct ata_port *ap)
|
|
|
+static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link)
|
|
|
{
|
|
|
int tag, nr_aborted = 0;
|
|
|
|
|
@@ -743,7 +731,7 @@ int ata_port_abort(struct ata_port *ap)
|
|
|
for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
|
|
|
struct ata_queued_cmd *qc = ata_qc_from_tag(ap, tag);
|
|
|
|
|
|
- if (qc) {
|
|
|
+ if (qc && (!link || qc->dev->link == link)) {
|
|
|
qc->flags |= ATA_QCFLAG_FAILED;
|
|
|
ata_qc_complete(qc);
|
|
|
nr_aborted++;
|
|
@@ -756,6 +744,40 @@ int ata_port_abort(struct ata_port *ap)
|
|
|
return nr_aborted;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * ata_link_abort - abort all qc's on the link
|
|
|
+ * @link: ATA link to abort qc's for
|
|
|
+ *
|
|
|
+ * Abort all active qc's active on @link and schedule EH.
|
|
|
+ *
|
|
|
+ * LOCKING:
|
|
|
+ * spin_lock_irqsave(host lock)
|
|
|
+ *
|
|
|
+ * RETURNS:
|
|
|
+ * Number of aborted qc's.
|
|
|
+ */
|
|
|
+int ata_link_abort(struct ata_link *link)
|
|
|
+{
|
|
|
+ return ata_do_link_abort(link->ap, link);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * ata_port_abort - abort all qc's on the port
|
|
|
+ * @ap: ATA port to abort qc's for
|
|
|
+ *
|
|
|
+ * Abort all active qc's of @ap and schedule EH.
|
|
|
+ *
|
|
|
+ * LOCKING:
|
|
|
+ * spin_lock_irqsave(host_set lock)
|
|
|
+ *
|
|
|
+ * RETURNS:
|
|
|
+ * Number of aborted qc's.
|
|
|
+ */
|
|
|
+int ata_port_abort(struct ata_port *ap)
|
|
|
+{
|
|
|
+ return ata_do_link_abort(ap, NULL);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* __ata_port_freeze - freeze port
|
|
|
* @ap: ATA port to freeze
|