]> err.no Git - linux-2.6/blobdiff - drivers/ata/libata-eh.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / drivers / ata / libata-eh.c
index e69f3df2ea3936b6f8babb6053309f04f7add43a..08ad44b3e48fe47c17db93df394890c8aad4b855 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))
@@ -1433,16 +1435,39 @@ static void ata_eh_report(struct ata_port *ap)
        }
 
        for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
+               static const char *dma_str[] = {
+                       [DMA_BIDIRECTIONAL]     = "bidi",
+                       [DMA_TO_DEVICE]         = "out",
+                       [DMA_FROM_DEVICE]       = "in",
+                       [DMA_NONE]              = "",
+               };
                struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
+               struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
+               unsigned int nbytes;
 
                if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
                        continue;
 
-               ata_dev_printk(qc->dev, KERN_ERR, "tag %d cmd 0x%x "
-                              "Emask 0x%x stat 0x%x err 0x%x (%s)\n",
-                              qc->tag, qc->tf.command, qc->err_mask,
-                              qc->result_tf.command, qc->result_tf.feature,
-                              ata_err_string(qc->err_mask));
+               nbytes = qc->nbytes;
+               if (!nbytes)
+                       nbytes = qc->nsect << 9;
+
+               ata_dev_printk(qc->dev, KERN_ERR,
+                       "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+                       "tag %d cdb 0x%x data %u %s\n         "
+                       "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
+                       "Emask 0x%x (%s)\n",
+                       cmd->command, cmd->feature, cmd->nsect,
+                       cmd->lbal, cmd->lbam, cmd->lbah,
+                       cmd->hob_feature, cmd->hob_nsect,
+                       cmd->hob_lbal, cmd->hob_lbam, cmd->hob_lbah,
+                       cmd->device, qc->tag, qc->cdb[0], nbytes,
+                       dma_str[qc->dma_dir],
+                       res->command, res->feature, res->nsect,
+                       res->lbal, res->lbam, res->lbah,
+                       res->hob_feature, res->hob_nsect,
+                       res->hob_lbal, res->hob_lbam, res->hob_lbah,
+                       res->device, qc->err_mask, ata_err_string(qc->err_mask));
        }
 }
 
@@ -1667,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) {