public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers
@ 2018-02-12  5:39 Shivasharan S
  2018-02-13  9:44 ` Hannes Reinecke
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shivasharan S @ 2018-02-12  5:39 UTC (permalink / raw)
  To: linux-scsi; +Cc: kashyap.desai, sumit.saxena, Shivasharan S, stable

Problem Statement:
Sending I/O through 32 bit descriptors to Ventura series of controller
results in IO timeout on certain conditions.
 
This error only occurs on systems with high I/O activity on
Ventura series controllers.
  
Changes in this patch will prevent driver from using 32 bit descriptor
and use 64 bit Descriptors.

Cc: <stable@vger.kernel.org>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 37 ++++++++++-------------------
 1 file changed, 12 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 073ced07e662..09f2bdb14b0a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -226,26 +226,21 @@ static void
 megasas_fire_cmd_fusion(struct megasas_instance *instance,
 		union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc)
 {
-	if (instance->adapter_type == VENTURA_SERIES)
-		writel(le32_to_cpu(req_desc->u.low),
-			&instance->reg_set->inbound_single_queue_port);
-	else {
 #if defined(writeq) && defined(CONFIG_64BIT)
-		u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
-				le32_to_cpu(req_desc->u.low));
+	u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
+		le32_to_cpu(req_desc->u.low));
 
-		writeq(req_data, &instance->reg_set->inbound_low_queue_port);
+	writeq(req_data, &instance->reg_set->inbound_low_queue_port);
 #else
-		unsigned long flags;
-		spin_lock_irqsave(&instance->hba_lock, flags);
-		writel(le32_to_cpu(req_desc->u.low),
-			&instance->reg_set->inbound_low_queue_port);
-		writel(le32_to_cpu(req_desc->u.high),
-			&instance->reg_set->inbound_high_queue_port);
-		mmiowb();
-		spin_unlock_irqrestore(&instance->hba_lock, flags);
+	unsigned long flags;
+	spin_lock_irqsave(&instance->hba_lock, flags);
+	writel(le32_to_cpu(req_desc->u.low),
+		&instance->reg_set->inbound_low_queue_port);
+	writel(le32_to_cpu(req_desc->u.high),
+		&instance->reg_set->inbound_high_queue_port);
+	mmiowb();
+	spin_unlock_irqrestore(&instance->hba_lock, flags);
 #endif
-	}
 }
 
 /**
@@ -982,7 +977,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
 	const char *sys_info;
 	MFI_CAPABILITIES *drv_ops;
 	u32 scratch_pad_2;
-	unsigned long flags;
 	ktime_t time;
 	bool cur_fw_64bit_dma_capable;
 
@@ -1121,14 +1115,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
 			break;
 	}
 
-	/* For Ventura also IOC INIT required 64 bit Descriptor write. */
-	spin_lock_irqsave(&instance->hba_lock, flags);
-	writel(le32_to_cpu(req_desc.u.low),
-	       &instance->reg_set->inbound_low_queue_port);
-	writel(le32_to_cpu(req_desc.u.high),
-	       &instance->reg_set->inbound_high_queue_port);
-	mmiowb();
-	spin_unlock_irqrestore(&instance->hba_lock, flags);
+	megasas_fire_cmd_fusion(instance, &req_desc);
 
 	wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);
 
-- 
2.14.1.dirty

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

* Re: [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers
  2018-02-12  5:39 [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Shivasharan S
@ 2018-02-13  9:44 ` Hannes Reinecke
  2018-02-13 15:39 ` Tomas Henzl
  2018-02-14  2:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2018-02-13  9:44 UTC (permalink / raw)
  To: Shivasharan S, linux-scsi; +Cc: kashyap.desai, sumit.saxena, stable

On 02/12/2018 06:39 AM, Shivasharan S wrote:
> Problem Statement:
> Sending I/O through 32 bit descriptors to Ventura series of controller
> results in IO timeout on certain conditions.
>  
> This error only occurs on systems with high I/O activity on
> Ventura series controllers.
>   
> Changes in this patch will prevent driver from using 32 bit descriptor
> and use 64 bit Descriptors.
> 
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_fusion.c | 37 ++++++++++-------------------
>  1 file changed, 12 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index 073ced07e662..09f2bdb14b0a 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -226,26 +226,21 @@ static void
>  megasas_fire_cmd_fusion(struct megasas_instance *instance,
>  		union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc)
>  {
> -	if (instance->adapter_type == VENTURA_SERIES)
> -		writel(le32_to_cpu(req_desc->u.low),
> -			&instance->reg_set->inbound_single_queue_port);
> -	else {
>  #if defined(writeq) && defined(CONFIG_64BIT)
> -		u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
> -				le32_to_cpu(req_desc->u.low));
> +	u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
> +		le32_to_cpu(req_desc->u.low));
>  
> -		writeq(req_data, &instance->reg_set->inbound_low_queue_port);
> +	writeq(req_data, &instance->reg_set->inbound_low_queue_port);
>  #else
> -		unsigned long flags;
> -		spin_lock_irqsave(&instance->hba_lock, flags);
> -		writel(le32_to_cpu(req_desc->u.low),
> -			&instance->reg_set->inbound_low_queue_port);
> -		writel(le32_to_cpu(req_desc->u.high),
> -			&instance->reg_set->inbound_high_queue_port);
> -		mmiowb();
> -		spin_unlock_irqrestore(&instance->hba_lock, flags);
> +	unsigned long flags;
> +	spin_lock_irqsave(&instance->hba_lock, flags);
> +	writel(le32_to_cpu(req_desc->u.low),
> +		&instance->reg_set->inbound_low_queue_port);
> +	writel(le32_to_cpu(req_desc->u.high),
> +		&instance->reg_set->inbound_high_queue_port);
> +	mmiowb();
> +	spin_unlock_irqrestore(&instance->hba_lock, flags);
>  #endif
> -	}
>  }
>  
>  /**
> @@ -982,7 +977,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
>  	const char *sys_info;
>  	MFI_CAPABILITIES *drv_ops;
>  	u32 scratch_pad_2;
> -	unsigned long flags;
>  	ktime_t time;
>  	bool cur_fw_64bit_dma_capable;
>  
> @@ -1121,14 +1115,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
>  			break;
>  	}
>  
> -	/* For Ventura also IOC INIT required 64 bit Descriptor write. */
> -	spin_lock_irqsave(&instance->hba_lock, flags);
> -	writel(le32_to_cpu(req_desc.u.low),
> -	       &instance->reg_set->inbound_low_queue_port);
> -	writel(le32_to_cpu(req_desc.u.high),
> -	       &instance->reg_set->inbound_high_queue_port);
> -	mmiowb();
> -	spin_unlock_irqrestore(&instance->hba_lock, flags);
> +	megasas_fire_cmd_fusion(instance, &req_desc);
>  
>  	wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +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)

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

* Re: [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers
  2018-02-12  5:39 [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Shivasharan S
  2018-02-13  9:44 ` Hannes Reinecke
@ 2018-02-13 15:39 ` Tomas Henzl
  2018-02-14  2:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Tomas Henzl @ 2018-02-13 15:39 UTC (permalink / raw)
  To: Shivasharan S, linux-scsi; +Cc: kashyap.desai, sumit.saxena, stable

On 02/12/2018 06:39 AM, Shivasharan S wrote:
> Problem Statement:
> Sending I/O through 32 bit descriptors to Ventura series of controller
> results in IO timeout on certain conditions.
>  
> This error only occurs on systems with high I/O activity on
> Ventura series controllers.
>   
> Changes in this patch will prevent driver from using 32 bit descriptor
> and use 64 bit Descriptors.
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_fusion.c | 37 ++++++++++-------------------
>  1 file changed, 12 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> index 073ced07e662..09f2bdb14b0a 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
> @@ -226,26 +226,21 @@ static void
>  megasas_fire_cmd_fusion(struct megasas_instance *instance,
>  		union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc)
>  {
> -	if (instance->adapter_type == VENTURA_SERIES)
> -		writel(le32_to_cpu(req_desc->u.low),
> -			&instance->reg_set->inbound_single_queue_port);
> -	else {
>  #if defined(writeq) && defined(CONFIG_64BIT)
> -		u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
> -				le32_to_cpu(req_desc->u.low));
> +	u64 req_data = (((u64)le32_to_cpu(req_desc->u.high) << 32) |
> +		le32_to_cpu(req_desc->u.low));
>  
> -		writeq(req_data, &instance->reg_set->inbound_low_queue_port);
> +	writeq(req_data, &instance->reg_set->inbound_low_queue_port);
>  #else
> -		unsigned long flags;
> -		spin_lock_irqsave(&instance->hba_lock, flags);
> -		writel(le32_to_cpu(req_desc->u.low),
> -			&instance->reg_set->inbound_low_queue_port);
> -		writel(le32_to_cpu(req_desc->u.high),
> -			&instance->reg_set->inbound_high_queue_port);
> -		mmiowb();
> -		spin_unlock_irqrestore(&instance->hba_lock, flags);
> +	unsigned long flags;
> +	spin_lock_irqsave(&instance->hba_lock, flags);
> +	writel(le32_to_cpu(req_desc->u.low),
> +		&instance->reg_set->inbound_low_queue_port);
> +	writel(le32_to_cpu(req_desc->u.high),
> +		&instance->reg_set->inbound_high_queue_port);
> +	mmiowb();
> +	spin_unlock_irqrestore(&instance->hba_lock, flags);
>  #endif
> -	}
>  }
>  
>  /**
> @@ -982,7 +977,6 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
>  	const char *sys_info;
>  	MFI_CAPABILITIES *drv_ops;
>  	u32 scratch_pad_2;
> -	unsigned long flags;
>  	ktime_t time;
>  	bool cur_fw_64bit_dma_capable;
>  
> @@ -1121,14 +1115,7 @@ megasas_ioc_init_fusion(struct megasas_instance *instance)
>  			break;
>  	}
>  
> -	/* For Ventura also IOC INIT required 64 bit Descriptor write. */
> -	spin_lock_irqsave(&instance->hba_lock, flags);
> -	writel(le32_to_cpu(req_desc.u.low),
> -	       &instance->reg_set->inbound_low_queue_port);
> -	writel(le32_to_cpu(req_desc.u.high),
> -	       &instance->reg_set->inbound_high_queue_port);
> -	mmiowb();
> -	spin_unlock_irqrestore(&instance->hba_lock, flags);
> +	megasas_fire_cmd_fusion(instance, &req_desc);
>  
>  	wait_and_poll(instance, cmd, MFI_POLL_TIMEOUT_SECS);
>  

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Please also remove the text
 * Ventura supports 32 bit Descriptor.
 * Prior to Ventura (12G) MR controller supports 64 bit Descriptor.
from the function description (not urgent may happen later)

Thanks,
Tomas

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

* Re: [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers
  2018-02-12  5:39 [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Shivasharan S
  2018-02-13  9:44 ` Hannes Reinecke
  2018-02-13 15:39 ` Tomas Henzl
@ 2018-02-14  2:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2018-02-14  2:33 UTC (permalink / raw)
  To: Shivasharan S; +Cc: linux-scsi, kashyap.desai, sumit.saxena, stable


Shivasharan,

> Sending I/O through 32 bit descriptors to Ventura series of controller
> results in IO timeout on certain conditions.

Please address Tomas' and Hannes' comments and repost these two.

Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2018-02-14  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12  5:39 [PATCH] megaraid_sas: Do not use 32-bit atomic request descriptor for Ventura controllers Shivasharan S
2018-02-13  9:44 ` Hannes Reinecke
2018-02-13 15:39 ` Tomas Henzl
2018-02-14  2:33 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox