megaraid_sas: Fallback to older scanning if not disks are found
Subsystems (2)
PATCH 1/1 megaraid_sas: Fallback to older scanning if not disks are found
commit 21c9e160a51383d4cb0b882398534b0c95c0cc3b implemented a new driver lookup using the MR_DCMD_LD_LIST_QUERY firmware command. However, this command might not work properly on older firmware, causing the command to return no drives instead of an error. This causes a regression on older firmware as the driver will no longer detect any drives.
This patch checks if MR_DCMD_LD_LIST_QUERY return no drives, and falls back to the original method if so.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/megaraid/megaraid_sas_base.c +4 -0
@@ -4107,6 +4107,10 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type) ret =megasas_issue_polled (instance, cmd); tgtid_count =le32_to_cpu (ci->count); +if (tgtid_count ==0 ) { +/* No drives found, try the older LD list DCMD */ + ret =1 ; + }if ((ret ==0 ) && (tgtid_count <= (instance->fw_supported_vd_count))) {memset (instance->ld_ids,0xff ,MEGASAS_MAX_LD_IDS );
Signature · 1 line
1.8.5.6
Quoted 20 lines · Hannes Reinecke
commit
21c9e160a51383d4cb0b882398534b0c95c0cc3bimplemented a new driver lookup using theMR_DCMD_LD_LIST_QUERYfirmware command. However, this command might not work properly on older firmware, causing the command to return no drives instead of an error. This causes a regression on older firmware as the driver will no longer detect any drives.
This patch checks ifMR_DCMD_LD_LIST_QUERYreturn no drives, and falls back to the original method if so.Signed-off-by Hannes Reinecke <[email protected]>--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/scsi/megaraid/megaraid_sas_base.c +0
-0
drivers/scsi/megaraid/megaraid_sas_base.c megasas_ld_list_query(struct megasas_instance *instance, u8 query_type) · line 4116
Quoted 10 lines
drivers/scsi/megaraid/megaraid_sas_base.c +4
-0@@ -4107,6 +4107,10 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type) ret =megasas_issue_polled (instance, cmd); tgtid_count =le32_to_cpu (ci->count); +if (tgtid_count ==0 ) { +/* No drives found, try the older LD list DCMD */ + ret =1 ; + }if ((ret ==0 ) && (tgtid_count <= (instance->fw_supported_vd_count))) {memset (instance->ld_ids,0xff ,MEGASAS_MAX_LD_IDS );
Quoted 7 lines
-----Original Message-----
From: Lee Duncan [mailto:[email protected]]
Sent: Saturday, January 16, 2016 3:29 AM
To: Hannes Reinecke; Sumit Saxena
Cc: Kashyap Desai; [email protected]; Martin K. Petersen; James Bottomley; [email protected]
Subject: Re: [PATCH]megaraid_sas: Fallback to older scanning if not
disks
Quoted 33 lines
are found
Quoted 1 line · Hannes Reinecke
commit
21c9e160a51383d4cb0b882398534b0c95c0cc3bimplemented anew
drivers/scsi/megaraid/megaraid_sas_base.c megasas_ld_list_query(struct
Quoted 19 lines
driver lookup using the
MR_DCMD_LD_LIST_QUERYfirmware command. However, this command might not work properly on older firmware, causing the command to return no drives instead of an error. This causes a regression on older firmware as the driver will no longer detect any drives.
This patch checks ifMR_DCMD_LD_LIST_QUERYreturn no drives, and falls back to the original method if so.Signed-off-by Hannes Reinecke <[email protected]>--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/scsi/megaraid/megaraid_sas_base.c +0
-0@@ -4107,6 +4107,10 @@ megasas_ld_list_query(struct
megasas_instance*instance, u8query_type)Quoted 8 lines
drivers/scsi/megaraid/megaraid_sas_base.c +4
-0ret =megasas_issue_polled (instance, cmd); tgtid_count =le32_to_cpu (ci->count); +if (tgtid_count ==0 ) { +/* No drives found, try the older LD list DCMD */ + ret =1 ; + }
Quoted 6 lines
Quoted 4 lines
drivers/scsi/megaraid/megaraid_sas_base.c +0
-0if ((ret ==0 ) && (tgtid_count <= (instance- fw_supported_vd_count))) {
memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);Reviewed-by Lee Duncan <[email protected]>
NACK as fix is already provided in another patch.
Please review patch - http://marc.info/?l=linux-scsi&m=145044529215209&w=2
It has changes to handle this particular issue as well along with many other areas of MFI DCMD timeout.