linuxtorvalds / rpms / kernel

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