aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Saxena <sumit.saxena@broadcom.com>2016-04-15 03:23:31 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-04-15 16:53:20 -0400
commit64d0b8e4a6f7e9a3c366c2df93ec1f003d180ca3 (patch)
tree8b0a44ae7c94b5578ec3372f7cb171f20dc8ddf7
parentc3e385a1b985a9202ba7fbd0bdbdcb909905d00c (diff)
megaraid_sas: call ISR function to clean up pending replies in OCR path
In OCR path, before calling chip reset calls function megasas_wait_for_outstanding_fusion to check reason for OCR. In case of firmware FAULT initiated OCR and DCMD timeout initiated timeout, driver will clear any outstanding reply (yet to be processed by driver) in reply queues before going for chip reset. This code is added to handle a scenario when IO timeout initiated adapter reset and management application initiated adapter reset (by sending command to FAULT firmware) happens simultaneously since adapter reset function is safe-guarded by reset_mutex so only thread will be doing controller reset. Consider IO timeout thread gets mutex and proceeds with adapter reset process after disabling interrupts and by the time management application has fired command to firmware to do adapter reset and the same command is completed by firmware but since interrupts are disabled, driver will not get completion and the same command will be in outstanding/pending commands list of driver and refires same command from IO timeout thread after chip reset which will again FAULT firmware and eventually causes kill adapter. Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 320c1a0952d0..e2dc20566ab7 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -2762,6 +2762,7 @@ int megasas_wait_for_outstanding_fusion(struct megasas_instance *instance,
2762 dev_warn(&instance->pdev->dev, "Found FW in FAULT state," 2762 dev_warn(&instance->pdev->dev, "Found FW in FAULT state,"
2763 " will reset adapter scsi%d.\n", 2763 " will reset adapter scsi%d.\n",
2764 instance->host->host_no); 2764 instance->host->host_no);
2765 megasas_complete_cmd_dpc_fusion((unsigned long)instance);
2765 retval = 1; 2766 retval = 1;
2766 goto out; 2767 goto out;
2767 } 2768 }
@@ -2769,6 +2770,7 @@ int megasas_wait_for_outstanding_fusion(struct megasas_instance *instance,
2769 if (reason == MFI_IO_TIMEOUT_OCR) { 2770 if (reason == MFI_IO_TIMEOUT_OCR) {
2770 dev_info(&instance->pdev->dev, 2771 dev_info(&instance->pdev->dev,
2771 "MFI IO is timed out, initiating OCR\n"); 2772 "MFI IO is timed out, initiating OCR\n");
2773 megasas_complete_cmd_dpc_fusion((unsigned long)instance);
2772 retval = 1; 2774 retval = 1;
2773 goto out; 2775 goto out;
2774 } 2776 }