]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-retry-UA
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / scsi-dh-alua-retry-UA
diff --git a/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-retry-UA b/src/patches/suse-2.6.27.31/patches.fixes/scsi-dh-alua-retry-UA
new file mode 100644 (file)
index 0000000..b96e50e
--- /dev/null
@@ -0,0 +1,48 @@
+From: Hannes Reinecke <hare@suse.de>
+Subject: Retry ALUA device handler initialization on Unit Attention
+
+Whenever we receive a UNIT ATTENTION sense code we should just retry
+the command. We only should take care to pass through 04/02 as this
+is handled later on by the generic code in scsi_check_sense().
+
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+
+diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
+index e356b43..a3660a6 100644
+--- a/drivers/scsi/device_handler/scsi_dh_alua.c
++++ b/drivers/scsi/device_handler/scsi_dh_alua.c
+@@ -444,24 +444,16 @@ static int alua_check_sense(struct scsi_device *sdev,
+                       return SUCCESS;
+               break;
+       case UNIT_ATTENTION:
+-              if (sense_hdr->asc == 0x29 && sense_hdr->ascq == 0x00)
+-                      /*
+-                       * Power On, Reset, or Bus Device Reset, just retry.
+-                       */
+-                      return ADD_TO_MLQUEUE;
+-              if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06) {
+-                      /*
+-                       * ALUA state changed
+-                       */
+-                      return ADD_TO_MLQUEUE;
+-              }
+-              if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07) {
+-                      /*
+-                       * Implicit ALUA state transition failed
+-                       */
+-                      return ADD_TO_MLQUEUE;
+-              }
+-              break;
++              if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02)
++                      /*
++                       * LUN not ready, initialization command required
++                       */
++                      return SCSI_RETURN_NOT_HANDLED;
++
++              /*
++               * Just retry for UNIT_ATTENTION
++               */
++              return ADD_TO_MLQUEUE;
+       }
+       return SCSI_RETURN_NOT_HANDLED;