In OCR(Online Controller Reset) path, driver sets adapter state to 
MEGASAS_HBA_OPERATIONAL before getting new RAID map.
There will be a small window where IO will come from OS with old RAID map.
This patch will update adapter state to MEGASAS_HBA_OPERATIONAL, only after 
driver has new RAID map to avoid
any IOs getting build using old RAID map.

Signed-off-by: Sumit Saxena <sumit.sax...@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.de...@avagotech.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c 
b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index b8411a1..aeb76d3 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -2801,11 +2801,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
iotimeout)
                                }
                        }
 
-                       clear_bit(MEGASAS_FUSION_IN_RESET,
-                                 &instance->reset_flags);
-                       instance->instancet->enable_intr(instance);
-                       instance->adprecovery = MEGASAS_HBA_OPERATIONAL;
-
                        if (megasas_get_ctrl_info(instance)) {
                                dev_info(&instance->pdev->dev,
                                        "Failed from %s %d\n",
@@ -2823,6 +2818,11 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int 
iotimeout)
                        if (!megasas_get_map_info(instance))
                                megasas_sync_map_info(instance);
 
+                       clear_bit(MEGASAS_FUSION_IN_RESET,
+                                 &instance->reset_flags);
+                       instance->instancet->enable_intr(instance);
+                       instance->adprecovery = MEGASAS_HBA_OPERATIONAL;
+
                        /* Restart SR-IOV heartbeat */
                        if (instance->requestorId) {
                                if (!megasas_sriov_start_heartbeat(instance, 0))
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to