linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: Fallback to older scanning if not disks are found
@ 2016-01-15 14:13 Hannes Reinecke
  2016-01-15 21:59 ` Lee Duncan
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2016-01-15 14:13 UTC (permalink / raw)
  To: Sumit Saxena
  Cc: Kashyap Desai, megaraidlinux.pdl, Martin K. Petersen,
	James Bottomley, linux-scsi, Hannes Reinecke

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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index f97ec34..79dff70 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -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);
-- 
1.8.5.6


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

* Re: [PATCH] megaraid_sas: Fallback to older scanning if not disks are found
  2016-01-15 14:13 [PATCH] megaraid_sas: Fallback to older scanning if not disks are found Hannes Reinecke
@ 2016-01-15 21:59 ` Lee Duncan
  2016-01-18  5:14   ` Kashyap Desai
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Duncan @ 2016-01-15 21:59 UTC (permalink / raw)
  To: Hannes Reinecke, Sumit Saxena
  Cc: Kashyap Desai, megaraidlinux.pdl, Martin K. Petersen,
	James Bottomley, linux-scsi

On 01/15/2016 06:13 AM, Hannes Reinecke wrote:
> 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.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index f97ec34..79dff70 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -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);
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>

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

* RE: [PATCH] megaraid_sas: Fallback to older scanning if not disks are found
  2016-01-15 21:59 ` Lee Duncan
@ 2016-01-18  5:14   ` Kashyap Desai
  0 siblings, 0 replies; 3+ messages in thread
From: Kashyap Desai @ 2016-01-18  5:14 UTC (permalink / raw)
  To: Lee Duncan, Hannes Reinecke, Sumit Saxena
  Cc: PDL,MEGARAIDLINUX, Martin K. Petersen, James Bottomley,
	linux-scsi

> -----Original Message-----
> From: Lee Duncan [mailto:lduncan@suse.com]
> Sent: Saturday, January 16, 2016 3:29 AM
> To: Hannes Reinecke; Sumit Saxena
> Cc: Kashyap Desai; megaraidlinux.pdl@avagotech.com; Martin K. Petersen;
> James Bottomley; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH] megaraid_sas: Fallback to older scanning if not
disks
> are found
>
> On 01/15/2016 06:13 AM, Hannes Reinecke wrote:
> > 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.
> >
> > Signed-off-by: Hannes Reinecke <hare@suse.de>
> > ---
> >  drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> > b/drivers/scsi/megaraid/megaraid_sas_base.c
> > index f97ec34..79dff70 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> > @@ -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);
> >
>
> Reviewed-by: Lee Duncan <lduncan@suse.com>

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.

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

end of thread, other threads:[~2016-01-18  5:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 14:13 [PATCH] megaraid_sas: Fallback to older scanning if not disks are found Hannes Reinecke
2016-01-15 21:59 ` Lee Duncan
2016-01-18  5:14   ` Kashyap Desai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).