[PATCH] libata: implement ATA_EHI_PRINTINFO
[powerpc.git] / drivers / ata / libata-eh.c
index 2c476ee..7c44644 100644 (file)
@@ -32,7 +32,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
@@ -200,7 +199,7 @@ void ata_scsi_error(struct Scsi_Host *host)
        /* synchronize with port task */
        ata_port_flush_task(ap);
 
-       /* synchronize with host_set lock and sort out timeouts */
+       /* synchronize with host lock and sort out timeouts */
 
        /* For new EH, all qcs are finished in one of three ways -
         * normal completion, error completion, and SCSI timeout.
@@ -377,7 +376,7 @@ void ata_port_wait_eh(struct ata_port *ap)
        spin_unlock_irqrestore(ap->lock, flags);
 
        /* make sure SCSI EH is complete */
-       if (scsi_host_in_recovery(ap->host)) {
+       if (scsi_host_in_recovery(ap->scsi_host)) {
                msleep(10);
                goto retry;
        }
@@ -486,7 +485,7 @@ void ata_eng_timeout(struct ata_port *ap)
  *     other commands are drained.
  *
  *     LOCKING:
- *     spin_lock_irqsave(host_set lock)
+ *     spin_lock_irqsave(host lock)
  */
 void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
 {
@@ -513,14 +512,14 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
  *     all commands are drained.
  *
  *     LOCKING:
- *     spin_lock_irqsave(host_set lock)
+ *     spin_lock_irqsave(host lock)
  */
 void ata_port_schedule_eh(struct ata_port *ap)
 {
        WARN_ON(!ap->ops->error_handler);
 
        ap->pflags |= ATA_PFLAG_EH_PENDING;
-       scsi_schedule_eh(ap->host);
+       scsi_schedule_eh(ap->scsi_host);
 
        DPRINTK("port EH scheduled\n");
 }
@@ -532,7 +531,7 @@ void ata_port_schedule_eh(struct ata_port *ap)
  *     Abort all active qc's of @ap and schedule EH.
  *
  *     LOCKING:
- *     spin_lock_irqsave(host_set lock)
+ *     spin_lock_irqsave(host lock)
  *
  *     RETURNS:
  *     Number of aborted qc's.
@@ -575,7 +574,7 @@ int ata_port_abort(struct ata_port *ap)
  *     is frozen.
  *
  *     LOCKING:
- *     spin_lock_irqsave(host_set lock)
+ *     spin_lock_irqsave(host lock)
  */
 static void __ata_port_freeze(struct ata_port *ap)
 {
@@ -596,7 +595,7 @@ static void __ata_port_freeze(struct ata_port *ap)
  *     Abort and freeze @ap.
  *
  *     LOCKING:
- *     spin_lock_irqsave(host_set lock)
+ *     spin_lock_irqsave(host lock)
  *
  *     RETURNS:
  *     Number of aborted commands.
@@ -1516,7 +1515,11 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
        if (prereset) {
                rc = prereset(ap);
                if (rc) {
-                       ata_port_printk(ap, KERN_ERR,
+                       if (rc == -ENOENT) {
+                               ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n");
+                               ap->eh_context.i.action &= ~ATA_EH_RESET_MASK;
+                       } else
+                               ata_port_printk(ap, KERN_ERR,
                                        "prereset failed (errno=%d)\n", rc);
                        return rc;
                }
@@ -1658,8 +1661,11 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
                        dev->class = ehc->classes[dev->devno];
 
                        rc = ata_dev_read_id(dev, &dev->class, 1, dev->id);
-                       if (rc == 0)
-                               rc = ata_dev_configure(dev, 1);
+                       if (rc == 0) {
+                               ehc->i.flags |= ATA_EHI_PRINTINFO;
+                               rc = ata_dev_configure(dev);
+                               ehc->i.flags &= ~ATA_EHI_PRINTINFO;
+                       }
 
                        if (rc) {
                                dev->class = ATA_DEV_UNKNOWN;