Skip to contentSkip to conversation

megaraid_sas: boot hangs while LD is offline

PATCH In review Hannes Reinecke 2 participants 3 messages Jan 15, 2016 – Jan 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 megaraid_sas: boot hangs while LD is offline

Offline Logical drives (LDs) should not allowed to be visible to the OS, as the OS will hang trying to send commands to it. This patch skips offline LDs like it already does for non-system physical drives (PDs).

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +6 -1
index 97a1c1c..f32831b 100644
@@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct scsi_device *sdev)
 
 static int megasas_slave_configure(struct scsi_device *sdev)
 {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_index;
 	struct megasas_instance *instance;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
@@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct scsi_device *sdev)
 			if (instance->pd_list[pd_index].driveState !=
 				MR_PD_STATE_SYSTEM)
 				return -ENXIO;
+		} else {
+			ld_index = ((sdev->channel - MEGASAS_MAX_PD_CHANNELS) *
+				    MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id;
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;
 		}
 	}
 	megasas_set_dma_alignment(sdev);
Signature · 1 line
1.8.5.6
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Hannes Reinecke [mailto:[email protected]]
Sent: Friday, January 15, 2016 7:13 PM
To: Sumit Saxena
Cc: Kashyap Desai; [email protected]; Martin K. Petersen; James Bottomley; [email protected]; Hannes Reinecke; Hannes Reinecke
Subject: [PATCH] megaraid_sas: boot hangs while LD is offline

Offline Logical drives (LDs) should not allowed to be visible to the OS,

as the

Quoted 2 lines

OS will hang trying to send commands to it.
This patch skips offline LDs like it already does for non-system

physical

Quoted 31 lines

drives (PDs).

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -1
index 97a1c1c..f32831b 100644
@@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct
 scsi_device *sdev)
 
 static int megasas_slave_configure(struct scsi_device *sdev)  {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_index;
 	struct megasas_instance *instance;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
@@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct
 scsi_device *sdev)
 			if (instance->pd_list[pd_index].driveState !=
 				MR_PD_STATE_SYSTEM)
 				return -ENXIO;
+		} else {
+			ld_index = ((sdev->channel -

MEGASAS_MAX_PD_CHANNELS) *

drivers/scsi/megaraid/megaraid_sas_base.c +1 -0
+				    MEGASAS_MAX_DEV_PER_CHANNEL) +

sdev->id;

drivers/scsi/megaraid/megaraid_sas_base.c static int megasas_slave_configure(struct scsi_device *sdev) · line 1779

Quoted 2 lines
drivers/scsi/megaraid/megaraid_sas_base.c +2 -0
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;

Hannes - We attempted this code change for one of the issue in past. This code drop was just a quick workaround to unblock that customer issue. Avago provided FW fix for this issue as new FW (again fix was done 2 years before, so many latest FW will have this fix) return below sense key for TUR.
SenseKey=0x2, asc=0x4, ascq=0x3(LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED)

Have you seen any issue w.r.t VD Offline or trying to optimize code in megaraid driver ?

Quoted 5 lines
drivers/scsi/megaraid/megaraid_sas_base.c +0 -1
 		}
 	}
 	megasas_set_dma_alignment(sdev);
--

1.8.5.6

#2 lore raw
Quoted 56 lines · Kashyap Desai
Quoted 10 lines

-----Original Message-----
From: Hannes Reinecke [mailto:[email protected]]
Sent: Friday, January 15, 2016 7:13 PM
To: Sumit Saxena
Cc: Kashyap Desai; [email protected]; Martin K. Petersen; James Bottomley; [email protected]; Hannes Reinecke; Hannes Reinecke
Subject: [PATCH] megaraid_sas: boot hangs while LD is offline

Offline Logical drives (LDs) should not allowed to be visible to the OS,

as the

Quoted 2 lines

OS will hang trying to send commands to it.
This patch skips offline LDs like it already does for non-system

physical

Quoted 31 lines

drives (PDs).

---
  drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -1
index 97a1c1c..f32831b 100644
@@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct
 scsi_device *sdev)
 
  static int megasas_slave_configure(struct scsi_device *sdev)  {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_index;
  	struct megasas_instance *instance;
 
  	instance = megasas_lookup_instance(sdev->host->host_no);
@@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct
 scsi_device *sdev)
  			if (instance->pd_list[pd_index].driveState !=
  				MR_PD_STATE_SYSTEM)
  				return -ENXIO;
+		} else {
+			ld_index = ((sdev->channel -

MEGASAS_MAX_PD_CHANNELS) *

drivers/scsi/megaraid/megaraid_sas_base.c +1 -0
+				    MEGASAS_MAX_DEV_PER_CHANNEL) +

sdev->id;

drivers/scsi/megaraid/megaraid_sas_base.c static int megasas_slave_configure(struct scsi_device *sdev) · line 1779

Quoted 2 lines
drivers/scsi/megaraid/megaraid_sas_base.c +2 -0
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;

Hannes - We attempted this code change for one of the issue in past. This code drop was just a quick workaround to unblock that customer issue. Avago provided FW fix for this issue as new FW (again fix was done 2 years before, so many latest FW will have this fix) return below sense key for TUR.
SenseKey=0x2, asc=0x4, ascq=0x3(LOGICAL UNIT NOT READY, MANUAL INTERVENTION REQUIRED)

Quoted 3 lines

Have you seen any issue w.r.t VD Offline or trying to optimize code in megaraid driver ?

Currently I'm in the process to review all non-mainstream SLES patches. And this is one of them which do not have a clear equivalent in mainline. But as all are customers are running _with_ this patch, we wouldn't know if the upstream fix resolves this issue, too.

But thanks for the review, I'll drop this patch.

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html