jianhai / rpms / kernel

Forked from rpms/kernel 3 years ago
Clone
a8a466
From b151f44de5717ff9be9695f744c9bd0060b3fcb4 Mon Sep 17 00:00:00 2001
a8a466
From: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
a8a466
Date: Tue, 10 Jan 2017 18:20:51 -0500
a8a466
Subject: [PATCH 09/11] scsi: megaraid_sas: ldio_outstanding variable is not
a8a466
 decremented in completion path
a8a466
a8a466
ldio outstanding variable needs to be decremented in io completion path for
a8a466
iMR dual queue depth
a8a466
a8a466
Signed-off-by: Sasikumar Chandrasekaran <sasikumar.pc@broadcom.com>
a8a466
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
a8a466
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
a8a466
---
a8a466
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 +++++--
a8a466
 1 file changed, 5 insertions(+), 2 deletions(-)
a8a466
a8a466
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
a8a466
index 5689a44..82dd2da 100644
a8a466
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
a8a466
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
a8a466
@@ -2580,7 +2580,6 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,
a8a466
 
a8a466
 	if (atomic_inc_return(&instance->fw_outstanding) >
a8a466
 			instance->host->can_queue) {
a8a466
-		dev_err(&instance->pdev->dev, "Throttle IOs beyond Controller queue depth\n");
a8a466
 		atomic_dec(&instance->fw_outstanding);
a8a466
 		return SCSI_MLQUEUE_HOST_BUSY;
a8a466
 	}
a8a466
@@ -2811,6 +2810,9 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex)
a8a466
 					extStatus, data_length, sense);
a8a466
 				scsi_io_req->RaidContext.raid_context.status = 0;
a8a466
 				scsi_io_req->RaidContext.raid_context.ex_status = 0;
a8a466
+				if (instance->ldio_threshold
a8a466
+					&& megasas_cmd_type(scmd_local) == READ_WRITE_LDIO)
a8a466
+					atomic_dec(&instance->ldio_outstanding);
a8a466
 				megasas_return_cmd_fusion(instance, cmd_fusion);
a8a466
 				scsi_dma_unmap(scmd_local);
a8a466
 				scmd_local->scsi_done(scmd_local);
a8a466
@@ -3955,7 +3957,8 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
a8a466
 				scmd_local->result =
a8a466
 					megasas_check_mpio_paths(instance,
a8a466
 							scmd_local);
a8a466
-				if (megasas_cmd_type(scmd_local) == READ_WRITE_LDIO)
a8a466
+				if (instance->ldio_threshold &&
a8a466
+					megasas_cmd_type(scmd_local) == READ_WRITE_LDIO)
a8a466
 					atomic_dec(&instance->ldio_outstanding);
a8a466
 				megasas_return_cmd_fusion(instance, cmd_fusion);
a8a466
 				scsi_dma_unmap(scmd_local);
a8a466
-- 
a8a466
1.8.3.1
a8a466