Merge branch 'for-jeff' of git://htj.dyndns.org/libata-tj into tejun-merge
authorJeff Garzik <jeff@garzik.org>
Mon, 15 May 2006 15:26:53 +0000 (11:26 -0400)
committerJeff Garzik <jeff@garzik.org>
Mon, 15 May 2006 15:26:53 +0000 (11:26 -0400)
1  2 
drivers/scsi/scsi_lib.c

diff --combined drivers/scsi/scsi_lib.c
@@@ -566,7 -566,7 +566,7 @@@ void scsi_device_unbusy(struct scsi_dev
        spin_lock_irqsave(shost->host_lock, flags);
        shost->host_busy--;
        if (unlikely(scsi_host_in_recovery(shost) &&
-                    shost->host_failed))
+                    (shost->host_failed || shost->host_eh_scheduled)))
                scsi_eh_wakeup(shost);
        spin_unlock(shost->host_lock);
        spin_lock(sdev->request_queue->queue_lock);
@@@ -1067,29 -1067,16 +1067,29 @@@ void scsi_io_completion(struct scsi_cmn
                        break;
                case NOT_READY:
                        /*
 -                       * If the device is in the process of becoming ready,
 -                       * retry.
 +                       * If the device is in the process of becoming
 +                       * ready, or has a temporary blockage, retry.
                         */
 -                      if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) {
 -                              scsi_requeue_command(q, cmd);
 -                              return;
 +                      if (sshdr.asc == 0x04) {
 +                              switch (sshdr.ascq) {
 +                              case 0x01: /* becoming ready */
 +                              case 0x04: /* format in progress */
 +                              case 0x05: /* rebuild in progress */
 +                              case 0x06: /* recalculation in progress */
 +                              case 0x07: /* operation in progress */
 +                              case 0x08: /* Long write in progress */
 +                              case 0x09: /* self test in progress */
 +                                      scsi_requeue_command(q, cmd);
 +                                      return;
 +                              default:
 +                                      break;
 +                              }
                        }
 -                      if (!(req->flags & REQ_QUIET))
 +                      if (!(req->flags & REQ_QUIET)) {
                                scmd_printk(KERN_INFO, cmd,
 -                                         "Device not ready.\n");
 +                                         "Device not ready: ");
 +                              scsi_print_sense_hdr("", &sshdr);
 +                      }
                        scsi_end_request(cmd, 0, this_count, 1);
                        return;
                case VOLUME_OVERFLOW: