SOURCES (LINUX_2_6): kernel-small_fixes.patch - added bunch of SCSI DH fixes
baggins
baggins at pld-linux.org
Wed Dec 31 01:20:59 CET 2008
Author: baggins Date: Wed Dec 31 00:20:59 2008 GMT
Module: SOURCES Tag: LINUX_2_6
---- Log message:
- added bunch of SCSI DH fixes
---- Files affected:
SOURCES:
kernel-small_fixes.patch (1.1.2.16 -> 1.1.2.17)
---- Diffs:
================================================================
Index: SOURCES/kernel-small_fixes.patch
diff -u SOURCES/kernel-small_fixes.patch:1.1.2.16 SOURCES/kernel-small_fixes.patch:1.1.2.17
--- SOURCES/kernel-small_fixes.patch:1.1.2.16 Thu Dec 25 21:46:37 2008
+++ SOURCES/kernel-small_fixes.patch Wed Dec 31 01:20:53 2008
@@ -139,3 +139,163 @@
#include "squashfs.h"
+From: Hannes Reinecke <hare at 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. No point in checking the various sense codes here.
+
+Signed-off-by: Hannes Reinecke <hare at 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,10 @@ 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;
++ /*
++ * Just retry for UNIT_ATTENTION
++ */
++ return ADD_TO_MLQUEUE;
+ }
+
+ return SCSI_RETURN_NOT_HANDLED;
+From: Hannes Reinecke <hare at suse.de>
+Subject: Always send STPG for explicit tgps mode
+
+When we are in explicit tgps mode we should always send an STPG
+command to enable the active/optimized mode.
+
+Signed-off-by: Hannes Reinecke <hare at suse.de>
+
+---
+ drivers/scsi/device_handler/scsi_dh_alua.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+--- a/drivers/scsi/device_handler/scsi_dh_alua.c
++++ b/drivers/scsi/device_handler/scsi_dh_alua.c
+@@ -593,13 +593,11 @@ static int alua_activate(struct scsi_dev
+ struct alua_dh_data *h = get_alua_data(sdev);
+ int err = SCSI_DH_OK;
+
+- if (h->group_id != -1) {
+- err = alua_rtpg(sdev, h);
+- if (err != SCSI_DH_OK)
+- goto out;
+- }
++ err = alua_rtpg(sdev, h);
++ if (err != SCSI_DH_OK)
++ goto out;
+
+- if (h->tpgs == TPGS_MODE_EXPLICIT && h->state != TPGS_STATE_OPTIMIZED)
++ if ((h->tpgs & TPGS_MODE_EXPLICIT) && h->state != TPGS_STATE_OPTIMIZED)
+ err = alua_stpg(sdev, TPGS_STATE_OPTIMIZED, h);
+
+ out:
+Subject: Retry mode select in RDAC device handler
+From: Chandra Seetharaman <sekharan at us.ibm.com>
+References: bnc#441337
+
+When the mode select sent to the controller fails with the retryable
+error, it is better to retry the mode_select from the hardware handler
+itself, instead of propagating the failure to dm-multipath.
+
+Signed-off-by: Chandra Seetharaman <sekharan at us.ibm.com>
+Signed-off-by: Hannes Reinecke <hare at suse.de>
+
+---
+---
+ drivers/scsi/device_handler/scsi_dh_rdac.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
++++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
+@@ -24,6 +24,7 @@
+ #include <scsi/scsi_dh.h>
+
+ #define RDAC_NAME "rdac"
++#define RDAC_RETRY_COUNT 5
+
+ /*
+ * LSI mode page stuff
+@@ -475,21 +476,27 @@ static int send_mode_select(struct scsi_
+ {
+ struct request *rq;
+ struct request_queue *q = sdev->request_queue;
+- int err = SCSI_DH_RES_TEMP_UNAVAIL;
++ int err, retry_cnt = RDAC_RETRY_COUNT;
+
++retry:
++ err = SCSI_DH_RES_TEMP_UNAVAIL;
+ rq = rdac_failover_get(sdev, h);
+ if (!rq)
+ goto done;
+
+- sdev_printk(KERN_INFO, sdev, "queueing MODE_SELECT command.\n");
++ sdev_printk(KERN_INFO, sdev, "%s MODE_SELECT command.\n",
++ (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying");
+
+ err = blk_execute_rq(q, NULL, rq, 1);
+- if (err != SCSI_DH_OK)
++ blk_put_request(rq);
++ if (err != SCSI_DH_OK) {
+ err = mode_select_handle_sense(sdev, h->sense);
++ if (err == SCSI_DH_RETRY && retry_cnt--)
++ goto retry;
++ }
+ if (err == SCSI_DH_OK)
+ h->state = RDAC_STATE_ACTIVE;
+
+- blk_put_request(rq);
+ done:
+ return err;
+ }
+Subject: scsi_dh_rdac: make sure the ownership is set correctly
+From: Chandra Seetharaman <sekharan at us.ibm.com>
+Patch-Mainline: 2.6.28
+References: bnc#441337
+
+When the controller ownership is changed (from passive to active),
+check_ownership() doesn't set the state of the device to ACTIVE.
+
+This patch fixes the problem.
+
+Signed-off-by: Chandra Seetharaman <sekharan at us.ibm.com>
+Reported and tested by: "Moger, Babu" <Babu.Moger at lsi.com>
+Signed-off-by: Hannes Reinecke <hare at suse.de>
+
+---
+---
+ drivers/scsi/device_handler/scsi_dh_rdac.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
++++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
+@@ -386,6 +386,7 @@ static int check_ownership(struct scsi_d
+ struct c9_inquiry *inqp;
+
+ h->lun_state = RDAC_LUN_UNOWNED;
++ h->state = RDAC_STATE_ACTIVE;
+ err = submit_inquiry(sdev, 0xC9, sizeof(struct c9_inquiry), h);
+ if (err == SCSI_DH_OK) {
+ inqp = &h->inq.c9;
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-small_fixes.patch?r1=1.1.2.16&r2=1.1.2.17&f=u
More information about the pld-cvs-commit
mailing list