Skip to contentSkip to conversation

megaraid_sas: boot hangs while LD is offline

PATCH In review Hannes Reinecke 2 participants 3 messages Aug 15, 2017 – Aug 16, 2017

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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +7 -2
index 5202c2f..39b08fc 100644
@@ -1897,14 +1897,19 @@ static void megasas_set_static_target_properties(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;
 	int ret_target_prop = DCMD_FAILED;
 	bool is_target_prop = false;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
 	if (instance->pd_list_not_supported) {
-		if (!MEGASAS_IS_LOGICAL(sdev) && sdev->type == TYPE_DISK) {
+		if (MEGASAS_IS_LOGICAL(sdev)) {
+			ld_index = ((sdev->channel - MEGASAS_MAX_PD_CHANNELS) *
+				    MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id;
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;
+		} else if (sdev->type == TYPE_DISK) {
 			pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
 				sdev->id;
 			if (instance->pd_list[pd_index].driveState !=
Signature · 1 line
1.8.5.6
maintainer
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Hannes Reinecke [mailto:[email protected]]
Sent: Tuesday, August 15, 2017 5:29 PM
To: Martin K. Petersen
Cc: Christoph Hellwig; James Bottomley; Sumit Saxena; Kashyap Desai; [email protected]; [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

drives

Quoted 1 line

(PDs).

Hi Hannes,

You have submitted this patch in past as it was part of SLES kernel but missing in upstream and it was concluded to drop this patch then. This issue was fixed in firmware 4 years back and many firmware versions should be available with the fix so this fix is not required in driver(upstream
as well SLES kernel). Do you see any functional issue without this patch ? If not, I would request to back out this patch from SLES kernel also.

Thanks,
Sumit

Quoted 39 lines

---
drivers/scsi/megaraid/megaraid_sas_base.c | 9 +++++++--

1 file changed, 7 insertions(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -2
index 5202c2f..39b08fc 100644
@@ -1897,14 +1897,19 @@ static void
 megasas_set_static_target_properties(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;
 	int ret_target_prop = DCMD_FAILED;
 	bool is_target_prop = false;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
 	if (instance->pd_list_not_supported) {
-		if (!MEGASAS_IS_LOGICAL(sdev) && sdev->type ==
 TYPE_DISK) {
+		if (MEGASAS_IS_LOGICAL(sdev)) {
+			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 +3 -0
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;
+		} else if (sdev->type == TYPE_DISK) {
			pd_index = (sdev->channel *
MEGASAS_MAX_DEV_PER_CHANNEL) +
				sdev->id;
			if (instance->pd_list[pd_index].driveState !=

--
1.8.5.6

#2 lore raw
Quoted 18 lines · Sumit Saxena
Quoted 10 lines

-----Original Message-----
From: Hannes Reinecke [mailto:[email protected]]
Sent: Tuesday, August 15, 2017 5:29 PM
To: Martin K. Petersen
Cc: Christoph Hellwig; James Bottomley; Sumit Saxena; Kashyap Desai; [email protected]; [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

drives

Quoted 1 line

(PDs).

Hi Hannes,

Quoted 8 lines

You have submitted this patch in past as it was part of SLES kernel but missing in upstream and it was concluded to drop this patch then. This issue was fixed in firmware 4 years back and many firmware versions should be available with the fix so this fix is not required in driver(upstream
as well SLES kernel). Do you see any functional issue without this patch ? If not, I would request to back out this patch from SLES kernel also.

Okay, if you say so.
Will be removing it.

Martin, please drop this patch.

Cheers,

Hannes

Signature · 5 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)