mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-24 05:19:53 +07:00
scsi: megaraid_sas: Rework code around controller reset
No functional change. This patch reworks code around controller reset path which gets rid of a couple of goto labels. This is in preparation for the next patch which adds PCI config space access locking while controller reset is in progress. 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
f10fb8523a
commit
44e8d6930f
@ -1571,6 +1571,7 @@ enum FW_BOOT_CONTEXT {
|
||||
#define MFI_IO_TIMEOUT_SECS 180
|
||||
#define MEGASAS_SRIOV_HEARTBEAT_INTERVAL_VF (5 * HZ)
|
||||
#define MEGASAS_OCR_SETTLE_TIME_VF (1000 * 30)
|
||||
#define MEGASAS_SRIOV_MAX_RESET_TRIES_VF 1
|
||||
#define MEGASAS_ROUTINE_WAIT_TIME_VF 300
|
||||
#define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000
|
||||
#define MFI_REPLY_GEN2_MESSAGE_INTERRUPT 0x00000001
|
||||
|
@ -4567,6 +4567,8 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
|
||||
struct scsi_device *sdev;
|
||||
int ret_target_prop = DCMD_FAILED;
|
||||
bool is_target_prop = false;
|
||||
bool do_adp_reset = true;
|
||||
int max_reset_tries = MEGASAS_FUSION_MAX_RESET_TRIES;
|
||||
|
||||
instance = (struct megasas_instance *)shost->hostdata;
|
||||
fusion = instance->ctrl_context;
|
||||
@ -4685,34 +4687,30 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
|
||||
/* Let SR-IOV VF & PF sync up if there was a HB failure */
|
||||
if (instance->requestorId && !reason) {
|
||||
msleep(MEGASAS_OCR_SETTLE_TIME_VF);
|
||||
goto transition_to_ready;
|
||||
do_adp_reset = false;
|
||||
max_reset_tries = MEGASAS_SRIOV_MAX_RESET_TRIES_VF;
|
||||
}
|
||||
|
||||
/* Now try to reset the chip */
|
||||
for (i = 0; i < MEGASAS_FUSION_MAX_RESET_TRIES; i++) {
|
||||
for (i = 0; i < max_reset_tries; i++) {
|
||||
|
||||
if (instance->instancet->adp_reset
|
||||
if (do_adp_reset &&
|
||||
instance->instancet->adp_reset
|
||||
(instance, instance->reg_set))
|
||||
continue;
|
||||
transition_to_ready:
|
||||
|
||||
/* Wait for FW to become ready */
|
||||
if (megasas_transition_to_ready(instance, 1)) {
|
||||
dev_warn(&instance->pdev->dev,
|
||||
"Failed to transition controller to ready for "
|
||||
"scsi%d.\n", instance->host->host_no);
|
||||
if (instance->requestorId && !reason)
|
||||
goto fail_kill_adapter;
|
||||
else
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
megasas_reset_reply_desc(instance);
|
||||
megasas_fusion_update_can_queue(instance, OCR_CONTEXT);
|
||||
|
||||
if (megasas_ioc_init_fusion(instance)) {
|
||||
if (instance->requestorId && !reason)
|
||||
goto fail_kill_adapter;
|
||||
else
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (megasas_get_ctrl_info(instance)) {
|
||||
@ -4798,7 +4796,6 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
|
||||
|
||||
goto out;
|
||||
}
|
||||
fail_kill_adapter:
|
||||
/* Reset failed, kill the adapter */
|
||||
dev_warn(&instance->pdev->dev, "Reset failed, killing "
|
||||
"adapter scsi%d.\n", instance->host->host_no);
|
||||
|
Loading…
Reference in New Issue
Block a user