]> Git Repo - linux.git/blobdiff - drivers/scsi/scsi_error.c
scsi: read host_busy via scsi_host_busy()
[linux.git] / drivers / scsi / scsi_error.c
index 9c02ba2e7ef3a353c018ebe51123ac9d8d219465..6a014fd15fe9ec410faf5992ad04e16f17592a51 100644 (file)
@@ -38,6 +38,7 @@
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
 #include <scsi/scsi_dh.h>
+#include <scsi/scsi_devinfo.h>
 #include <scsi/sg.h>
 
 #include "scsi_priv.h"
@@ -65,7 +66,7 @@ void scsi_eh_wakeup(struct Scsi_Host *shost)
 {
        lockdep_assert_held(shost->host_lock);
 
-       if (atomic_read(&shost->host_busy) == shost->host_failed) {
+       if (scsi_host_busy(shost) == shost->host_failed) {
                trace_scsi_eh_wakeup(shost);
                wake_up_process(shost->ehandler);
                SCSI_LOG_ERROR_RECOVERY(5, shost_printk(KERN_INFO, shost,
@@ -525,6 +526,12 @@ int scsi_check_sense(struct scsi_cmnd *scmd)
                if (sshdr.asc == 0x10) /* DIF */
                        return SUCCESS;
 
+               if (sshdr.asc == 0x44 && sdev->sdev_bflags & BLIST_RETRY_ITF)
+                       return ADD_TO_MLQUEUE;
+               if (sshdr.asc == 0xc1 && sshdr.ascq == 0x01 &&
+                   sdev->sdev_bflags & BLIST_RETRY_ASC_C1)
+                       return ADD_TO_MLQUEUE;
+
                return NEEDS_RETRY;
        case NOT_READY:
        case UNIT_ATTENTION:
@@ -2148,7 +2155,7 @@ int scsi_error_handler(void *data)
                        break;
 
                if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) ||
-                   shost->host_failed != atomic_read(&shost->host_busy)) {
+                   shost->host_failed != scsi_host_busy(shost)) {
                        SCSI_LOG_ERROR_RECOVERY(1,
                                shost_printk(KERN_INFO, shost,
                                             "scsi_eh_%d: sleeping\n",
@@ -2163,7 +2170,7 @@ int scsi_error_handler(void *data)
                                     "scsi_eh_%d: waking up %d/%d/%d\n",
                                     shost->host_no, shost->host_eh_scheduled,
                                     shost->host_failed,
-                                    atomic_read(&shost->host_busy)));
+                                    scsi_host_busy(shost)));
 
                /*
                 * We have a host that is failing for some reason.  Figure out
This page took 0.03435 seconds and 4 git commands to generate.