All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] scsi_dh_rdac : Detect the different RDAC operating modes
@ 2011-04-08 17:38 Moger, Babu
  2011-04-20 15:10 ` Moger, Babu
  0 siblings, 1 reply; 2+ messages in thread
From: Moger, Babu @ 2011-04-08 17:38 UTC (permalink / raw)
  To: linux-scsi, device-mapper development
  Cc: Qi, Yanling, Chauhan, Vijay, Stankey, Robert, Arumugam, Anburaja,
	Krishnasamy, Somasundaram, Dachepalli, Sudhir

This patch detects different operating RDAC modes during the discovery. It also collects the information about
the preferred path.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Reviewed-by: Yanling Qi <yanling.qi@lsi.com> 
Reviewed-by: Sudhir Dachepalli <Sudhir.Dachepalli@lis.com>
Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Reviewed-by: Bob Stankey <Robert.Stankey@lsi.com>
Reviewed-by: Vijay Chauhan <Vijay.Chauhan@lsi.com>

--- 
--- linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2011-03-17 16:51:40.000000000 -0500
+++ linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c	2011-03-17 16:53:33.000000000 -0500
@@ -194,7 +194,6 @@ struct rdac_dh_data {
 
 #define RDAC_LUN_UNOWNED	0
 #define RDAC_LUN_OWNED		1
-#define RDAC_LUN_AVT		2
 	char			lun_state;
 
 #define RDAC_PREFERRED		0
@@ -473,25 +472,33 @@ static int check_ownership(struct scsi_d
 	int err;
 	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;
-		if ((inqp->avte_cvp >> 7) == 0x1) {
-			/* LUN in AVT mode */
-			sdev_printk(KERN_NOTICE, sdev,
-				    "%s: AVT mode detected\n",
-				    RDAC_NAME);
-			h->lun_state = RDAC_LUN_AVT;
-		} else if ((inqp->avte_cvp & 0x1) != 0) {
-			/* LUN was owned by the controller */
+		/* detect the operating mode */
+		if ((inqp->avte_cvp >> 5) & 0x1)
+			h->mode = RDAC_MODE_IOSHIP; /* LUN in IOSHIP mode */
+		else if (inqp->avte_cvp >> 7)
+			h->mode = RDAC_MODE_AVT; /* LUN in AVT mode */
+		else
+			h->mode = RDAC_MODE; /* LUN in RDAC mode */
+
+		/* Update ownership */
+		if (inqp->avte_cvp & 0x1)
 			h->lun_state = RDAC_LUN_OWNED;
+		else {
+			h->lun_state = RDAC_LUN_UNOWNED;
+			if (h->mode == RDAC_MODE)
+				h->state = RDAC_STATE_PASSIVE;
 		}
-	}
 
-	if (h->lun_state == RDAC_LUN_UNOWNED)
-		h->state = RDAC_STATE_PASSIVE;
+		/* Update path prio*/
+		if (inqp->path_prio & 0x1)
+			h->preferred = RDAC_PREFERRED;
+		else
+			h->preferred = RDAC_NON_PREFERRED;
+	}
 
 	return err;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH 2/3] scsi_dh_rdac : Detect the different RDAC operating modes
  2011-04-08 17:38 [PATCH 2/3] scsi_dh_rdac : Detect the different RDAC operating modes Moger, Babu
@ 2011-04-20 15:10 ` Moger, Babu
  0 siblings, 0 replies; 2+ messages in thread
From: Moger, Babu @ 2011-04-20 15:10 UTC (permalink / raw)
  To: linux-scsi, device-mapper development; +Cc: Cummins, Charles, James Bottomley

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Moger, Babu
> Sent: Friday, April 08, 2011 12:39 PM
> To: linux-scsi@vger.kernel.org; device-mapper development
> Cc: Qi, Yanling; Chauhan, Vijay; Stankey, Robert; Arumugam, Anburaja;
> Krishnasamy, Somasundaram; Dachepalli, Sudhir
> Subject: [PATCH 2/3] scsi_dh_rdac : Detect the different RDAC operating
> modes
> 
> This patch detects different operating RDAC modes during the discovery.
> It also collects the information about
> the preferred path.
> 
> Signed-off-by: Babu Moger <babu.moger@lsi.com>
> Reviewed-by: Yanling Qi <yanling.qi@lsi.com>
> Reviewed-by: Sudhir Dachepalli <Sudhir.Dachepalli@lis.com>
> Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
> Reviewed-by: Bob Stankey <Robert.Stankey@lsi.com>
> Reviewed-by: Vijay Chauhan <Vijay.Chauhan@lsi.com>

Tested-by: Charles Cummins <Charles.cummins@lsi.com>

> 
> ---
> --- linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2011-
> 03-17 16:51:40.000000000 -0500
> +++ linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c	2011-03-17
> 16:53:33.000000000 -0500
> @@ -194,7 +194,6 @@ struct rdac_dh_data {
> 
>  #define RDAC_LUN_UNOWNED	0
>  #define RDAC_LUN_OWNED		1
> -#define RDAC_LUN_AVT		2
>  	char			lun_state;
> 
>  #define RDAC_PREFERRED		0
> @@ -473,25 +472,33 @@ static int check_ownership(struct scsi_d
>  	int err;
>  	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;
> -		if ((inqp->avte_cvp >> 7) == 0x1) {
> -			/* LUN in AVT mode */
> -			sdev_printk(KERN_NOTICE, sdev,
> -				    "%s: AVT mode detected\n",
> -				    RDAC_NAME);
> -			h->lun_state = RDAC_LUN_AVT;
> -		} else if ((inqp->avte_cvp & 0x1) != 0) {
> -			/* LUN was owned by the controller */
> +		/* detect the operating mode */
> +		if ((inqp->avte_cvp >> 5) & 0x1)
> +			h->mode = RDAC_MODE_IOSHIP; /* LUN in IOSHIP mode */
> +		else if (inqp->avte_cvp >> 7)
> +			h->mode = RDAC_MODE_AVT; /* LUN in AVT mode */
> +		else
> +			h->mode = RDAC_MODE; /* LUN in RDAC mode */
> +
> +		/* Update ownership */
> +		if (inqp->avte_cvp & 0x1)
>  			h->lun_state = RDAC_LUN_OWNED;
> +		else {
> +			h->lun_state = RDAC_LUN_UNOWNED;
> +			if (h->mode == RDAC_MODE)
> +				h->state = RDAC_STATE_PASSIVE;
>  		}
> -	}
> 
> -	if (h->lun_state == RDAC_LUN_UNOWNED)
> -		h->state = RDAC_STATE_PASSIVE;
> +		/* Update path prio*/
> +		if (inqp->path_prio & 0x1)
> +			h->preferred = RDAC_PREFERRED;
> +		else
> +			h->preferred = RDAC_NON_PREFERRED;
> +	}
> 
>  	return err;
>  }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-20 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08 17:38 [PATCH 2/3] scsi_dh_rdac : Detect the different RDAC operating modes Moger, Babu
2011-04-20 15:10 ` Moger, Babu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.