mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
scsi: mpi3mr: Fix controller init failure on fault during queue creation
Firmware can enter a transient fault while creating operational queues. The driver fails the load immediately. Add a retry loop that checks controller status and history bit after queue creation. If either indicates a fault, retry init up to a set limit before failing. Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com> Link: https://lore.kernel.org/r/20250820084138.228471-3-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
d6c8e8b7c9
commit
829fa1582b
@@ -2353,6 +2353,8 @@ static int mpi3mr_create_op_queues(struct mpi3mr_ioc *mrioc)
|
||||
{
|
||||
int retval = 0;
|
||||
u16 num_queues = 0, i = 0, msix_count_op_q = 1;
|
||||
u32 ioc_status;
|
||||
enum mpi3mr_iocstate ioc_state;
|
||||
|
||||
num_queues = min_t(int, mrioc->facts.max_op_reply_q,
|
||||
mrioc->facts.max_op_req_q);
|
||||
@@ -2408,6 +2410,14 @@ static int mpi3mr_create_op_queues(struct mpi3mr_ioc *mrioc)
|
||||
retval = -1;
|
||||
goto out_failed;
|
||||
}
|
||||
ioc_status = readl(&mrioc->sysif_regs->ioc_status);
|
||||
ioc_state = mpi3mr_get_iocstate(mrioc);
|
||||
if ((ioc_status & MPI3_SYSIF_IOC_STATUS_RESET_HISTORY) ||
|
||||
ioc_state != MRIOC_STATE_READY) {
|
||||
mpi3mr_print_fault_info(mrioc);
|
||||
retval = -1;
|
||||
goto out_failed;
|
||||
}
|
||||
mrioc->num_op_reply_q = mrioc->num_op_req_q = i;
|
||||
ioc_info(mrioc,
|
||||
"successfully created %d operational queue pairs(default/polled) queue = (%d/%d)\n",
|
||||
|
||||
Reference in New Issue
Block a user