fanghuilin / rpms / kernel

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