summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authorAnand Lodnoor <anand.lodnoor@broadcom.com>2020-01-14 16:51:17 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2020-01-15 23:21:03 -0500
commiteeb63c23ffe1704990202af279400bf2b448ad89 (patch)
tree7998e9779463d6fb8dc691369ab067a3f35e063a /drivers/scsi/megaraid
parent9330a0fd827a02234ebdb536810d6adbbb6a2aaa (diff)
scsi: megaraid_sas: Do not set HBA Operational if FW is not in operational state
After issuing a adapter reset, driver blindly used to set adprecovery flag to OPERATIONAL state. Add a check to see if the FW is operational before setting the flag and marking reset adapter successful. Link: https://lore.kernel.org/r/1579000882-20246-7-git-send-email-anand.lodnoor@broadcom.com Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Anand Lodnoor <anand.lodnoor@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index ef20234660ac..6860fd288d0f 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -4991,6 +4991,15 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
megasas_set_dynamic_target_properties(sdev, is_target_prop);
}
+ status_reg = instance->instancet->read_fw_status_reg
+ (instance);
+ abs_state = status_reg & MFI_STATE_MASK;
+ if (abs_state != MFI_STATE_OPERATIONAL) {
+ dev_info(&instance->pdev->dev,
+ "Adapter is not OPERATIONAL, state 0x%x for scsi:%d\n",
+ abs_state, instance->host->host_no);
+ goto out;
+ }
atomic_set(&instance->adprecovery, MEGASAS_HBA_OPERATIONAL);
dev_info(&instance->pdev->dev,