Skip to content

Commit dbd5397

Browse files
Ranjan Kumarmartinkpetersen
authored andcommitted
scsi: mpi3mr: Clear reset history on ready and recheck state after timeout
The driver retains reset history even after the IOC has successfully reached the READY state. That leaves stale reset information active during normal operation and can mislead recovery and diagnostics. In addition, if the IOC becomes READY just as the ready timeout loop exits, the driver still follows the failure path and may retry or report failure incorrectly. Clear reset history once READY is confirmed so driver state matches actual IOC status. After the timeout loop, recheck the IOC state and treat READY as success instead of failing. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://patch.msgid.link/20260225082622.82588-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1ac22c8 commit dbd5397

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/scsi/mpi3mr/mpi3mr_fw.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,7 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc)
16181618
ioc_info(mrioc,
16191619
"successfully transitioned to %s state\n",
16201620
mpi3mr_iocstate_name(ioc_state));
1621+
mpi3mr_clear_reset_history(mrioc);
16211622
return 0;
16221623
}
16231624
ioc_status = readl(&mrioc->sysif_regs->ioc_status);
@@ -1637,6 +1638,15 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc)
16371638
elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000;
16381639
} while (elapsed_time_sec < mrioc->ready_timeout);
16391640

1641+
ioc_state = mpi3mr_get_iocstate(mrioc);
1642+
if (ioc_state == MRIOC_STATE_READY) {
1643+
ioc_info(mrioc,
1644+
"successfully transitioned to %s state after %llu seconds\n",
1645+
mpi3mr_iocstate_name(ioc_state), elapsed_time_sec);
1646+
mpi3mr_clear_reset_history(mrioc);
1647+
return 0;
1648+
}
1649+
16401650
out_failed:
16411651
elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000;
16421652
if ((retry < 2) && (elapsed_time_sec < (mrioc->ready_timeout - 60))) {

0 commit comments

Comments
 (0)