scsi: megaraid_sas: Add check for reset adapter bit
For SAS3 and later controllers, FW sets the reset adapter bit indicating the driver to perform a controller reset. Driver needs to check if this bit is set before doing a reset. This reduces the driver probe failure time to 180seconds in case there is a faulty controller connected. Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
9155cf30a3
commit
de93b40d98
|
@ -5300,7 +5300,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
||||||
{
|
{
|
||||||
u32 max_sectors_1;
|
u32 max_sectors_1;
|
||||||
u32 max_sectors_2, tmp_sectors, msix_enable;
|
u32 max_sectors_2, tmp_sectors, msix_enable;
|
||||||
u32 scratch_pad_2, scratch_pad_3, scratch_pad_4;
|
u32 scratch_pad_2, scratch_pad_3, scratch_pad_4, status_reg;
|
||||||
resource_size_t base_addr;
|
resource_size_t base_addr;
|
||||||
struct megasas_register_set __iomem *reg_set;
|
struct megasas_register_set __iomem *reg_set;
|
||||||
struct megasas_ctrl_info *ctrl_info = NULL;
|
struct megasas_ctrl_info *ctrl_info = NULL;
|
||||||
|
@ -5308,6 +5308,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
||||||
int i, j, loop, fw_msix_count = 0;
|
int i, j, loop, fw_msix_count = 0;
|
||||||
struct IOV_111 *iovPtr;
|
struct IOV_111 *iovPtr;
|
||||||
struct fusion_context *fusion;
|
struct fusion_context *fusion;
|
||||||
|
bool do_adp_reset = true;
|
||||||
|
|
||||||
fusion = instance->ctrl_context;
|
fusion = instance->ctrl_context;
|
||||||
|
|
||||||
|
@ -5356,19 +5357,29 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (megasas_transition_to_ready(instance, 0)) {
|
if (megasas_transition_to_ready(instance, 0)) {
|
||||||
atomic_set(&instance->fw_reset_no_pci_access, 1);
|
if (instance->adapter_type >= INVADER_SERIES) {
|
||||||
instance->instancet->adp_reset
|
status_reg = instance->instancet->read_fw_status_reg(
|
||||||
(instance, instance->reg_set);
|
instance->reg_set);
|
||||||
atomic_set(&instance->fw_reset_no_pci_access, 0);
|
do_adp_reset = status_reg & MFI_RESET_ADAPTER;
|
||||||
dev_info(&instance->pdev->dev,
|
}
|
||||||
"FW restarted successfully from %s!\n",
|
|
||||||
__func__);
|
|
||||||
|
|
||||||
/*waitting for about 30 second before retry*/
|
if (do_adp_reset) {
|
||||||
ssleep(30);
|
atomic_set(&instance->fw_reset_no_pci_access, 1);
|
||||||
|
instance->instancet->adp_reset
|
||||||
|
(instance, instance->reg_set);
|
||||||
|
atomic_set(&instance->fw_reset_no_pci_access, 0);
|
||||||
|
dev_info(&instance->pdev->dev,
|
||||||
|
"FW restarted successfully from %s!\n",
|
||||||
|
__func__);
|
||||||
|
|
||||||
if (megasas_transition_to_ready(instance, 0))
|
/*waiting for about 30 second before retry*/
|
||||||
|
ssleep(30);
|
||||||
|
|
||||||
|
if (megasas_transition_to_ready(instance, 0))
|
||||||
|
goto fail_ready_state;
|
||||||
|
} else {
|
||||||
goto fail_ready_state;
|
goto fail_ready_state;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
megasas_init_ctrl_params(instance);
|
megasas_init_ctrl_params(instance);
|
||||||
|
|
Loading…
Reference in New Issue