]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/libata-eh.c
ACPI: bay: use IS_ERR for return of register_platform_device_simple
[linux-2.6-omap-h63xx.git] / drivers / ata / libata-eh.c
index 5aa7f0907e83dfa54b2068309363f91425fde8f9..748435807d689cbc8ac3aa511576dc87e656b427 100644 (file)
@@ -332,7 +332,7 @@ void ata_scsi_error(struct Scsi_Host *host)
        if (ap->pflags & ATA_PFLAG_LOADING)
                ap->pflags &= ~ATA_PFLAG_LOADING;
        else if (ap->pflags & ATA_PFLAG_SCSI_HOTPLUG)
-               queue_work(ata_aux_wq, &ap->hotplug_task);
+               queue_delayed_work(ata_aux_wq, &ap->hotplug_task, 0);
 
        if (ap->pflags & ATA_PFLAG_RECOVERED)
                ata_port_printk(ap, KERN_INFO, "EH complete\n");
@@ -1136,19 +1136,21 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
                break;
 
        case ATA_DEV_ATAPI:
-               tmp = atapi_eh_request_sense(qc->dev,
-                                            qc->scsicmd->sense_buffer);
-               if (!tmp) {
-                       /* ATA_QCFLAG_SENSE_VALID is used to tell
-                        * atapi_qc_complete() that sense data is
-                        * already valid.
-                        *
-                        * TODO: interpret sense data and set
-                        * appropriate err_mask.
-                        */
-                       qc->flags |= ATA_QCFLAG_SENSE_VALID;
-               } else
-                       qc->err_mask |= tmp;
+               if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) {
+                       tmp = atapi_eh_request_sense(qc->dev,
+                                                    qc->scsicmd->sense_buffer);
+                       if (!tmp) {
+                               /* ATA_QCFLAG_SENSE_VALID is used to
+                                * tell atapi_qc_complete() that sense
+                                * data is already valid.
+                                *
+                                * TODO: interpret sense data and set
+                                * appropriate err_mask.
+                                */
+                               qc->flags |= ATA_QCFLAG_SENSE_VALID;
+                       } else
+                               qc->err_mask |= tmp;
+               }
        }
 
        if (qc->err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT | AC_ERR_ATA_BUS))
@@ -1690,9 +1692,6 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap,
                           ata_class_enabled(ehc->classes[dev->devno])) {
                        dev->class = ehc->classes[dev->devno];
 
-                       if (ap->flags & ATA_FLAG_DETECT_POLLING)
-                               readid_flags |= ATA_READID_DETECT;
-
                        rc = ata_dev_read_id(dev, &dev->class, readid_flags,
                                             dev->id);
                        if (rc == 0) {
@@ -1797,7 +1796,7 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev)
                *r_failed_dev = dev;
 
        DPRINTK("EXIT\n");
-       return 0;
+       return rc;
 }
 
 /**
@@ -1980,6 +1979,10 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
 
                ehc->tries[dev->devno] = ATA_EH_DEV_TRIES;
 
+               /* collect port action mask recorded in dev actions */
+               ehc->i.action |= ehc->i.dev_action[i] & ~ATA_EH_PERDEV_MASK;
+               ehc->i.dev_action[i] &= ATA_EH_PERDEV_MASK;
+
                /* process hotplug request */
                if (dev->flags & ATA_DFLAG_DETACH)
                        ata_eh_detach_dev(dev);