scsi: mpi3mr: Handling of fault code for insufficient power
BugLink: https://bugs.launchpad.net/bugs/2103869 [ Upstream commit fb6eb98f3965e2ee92cbcb466051d2f2acf552d1 ] Before retrying initialization, check and abort if the fault code indicates insufficient power. Also mark the controller as unrecoverable instead of issuing reset in the watch dog timer if the fault code indicates insufficient power. Signed-off-by: Prayas Patel <prayas.patel@broadcom.com> Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Link: https://lore.kernel.org/r/20241110194405.10108-5-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
7f9609f55f
commit
0103349099
@@ -1017,6 +1017,31 @@ static const char *mpi3mr_reset_type_name(u16 reset_type)
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* mpi3mr_is_fault_recoverable - Read fault code and decide
|
||||
* whether the controller can be recoverable
|
||||
* @mrioc: Adapter instance reference
|
||||
* Return: true if fault is recoverable, false otherwise.
|
||||
*/
|
||||
static inline bool mpi3mr_is_fault_recoverable(struct mpi3mr_ioc *mrioc)
|
||||
{
|
||||
u32 fault;
|
||||
|
||||
fault = (readl(&mrioc->sysif_regs->fault) &
|
||||
MPI3_SYSIF_FAULT_CODE_MASK);
|
||||
|
||||
switch (fault) {
|
||||
case MPI3_SYSIF_FAULT_CODE_COMPLETE_RESET_NEEDED:
|
||||
case MPI3_SYSIF_FAULT_CODE_POWER_CYCLE_REQUIRED:
|
||||
ioc_warn(mrioc,
|
||||
"controller requires system power cycle, marking controller as unrecoverable\n");
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* mpi3mr_print_fault_info - Display fault information
|
||||
* @mrioc: Adapter instance reference
|
||||
@@ -1347,6 +1372,11 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc)
|
||||
ioc_info(mrioc, "ioc_status(0x%08x), ioc_config(0x%08x), ioc_info(0x%016llx) at the bringup\n",
|
||||
ioc_status, ioc_config, base_info);
|
||||
|
||||
if (!mpi3mr_is_fault_recoverable(mrioc)) {
|
||||
mrioc->unrecoverable = 1;
|
||||
goto out_device_not_present;
|
||||
}
|
||||
|
||||
/*The timeout value is in 2sec unit, changing it to seconds*/
|
||||
mrioc->ready_timeout =
|
||||
((base_info & MPI3_SYSIF_IOC_INFO_LOW_TIMEOUT_MASK) >>
|
||||
@@ -2689,6 +2719,11 @@ static void mpi3mr_watchdog_work(struct work_struct *work)
|
||||
mpi3mr_print_fault_info(mrioc);
|
||||
mrioc->diagsave_timeout = 0;
|
||||
|
||||
if (!mpi3mr_is_fault_recoverable(mrioc)) {
|
||||
mrioc->unrecoverable = 1;
|
||||
goto schedule_work;
|
||||
}
|
||||
|
||||
switch (trigger_data.fault) {
|
||||
case MPI3_SYSIF_FAULT_CODE_COMPLETE_RESET_NEEDED:
|
||||
case MPI3_SYSIF_FAULT_CODE_POWER_CYCLE_REQUIRED:
|
||||
|
||||
Reference in New Issue
Block a user