Skip to content

Commit b64845a

Browse files
sreekanthbrcmmartinkpetersen
authored andcommitted
scsi: mpi3mr: Detect async reset that occurred in firmware
Detect asynchronous reset that occurred in the firmware by polling for reset history bit of IOC status register is set and if that bit is set, then the driver waits for the controller to become ready and then re-initializes the controller. Also reduce the time driver is waiting for the controller to acknowledge the reset action after issuing a specific reset action to the controller. The wait time is reduced from 510 seconds to 30 seconds. If the controller didn't acknowledge a specific reset action within the time interval then the driver marks the controller as unrecoverable instead of retrying two more times prior to giving up. Link: https://lore.kernel.org/r/20211220141159.16117-17-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c0b00a9 commit b64845a

3 files changed

Lines changed: 120 additions & 163 deletions

File tree

drivers/scsi/mpi3mr/mpi3mr.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ extern int prot_mask;
110110
#define MPI3MR_TSUPDATE_INTERVAL 900
111111
#define MPI3MR_DEFAULT_SHUTDOWN_TIME 120
112112
#define MPI3MR_RAID_ERRREC_RESET_TIMEOUT 180
113+
#define MPI3MR_RESET_ACK_TIMEOUT 30
113114

114115
#define MPI3MR_WATCHDOG_INTERVAL 1000 /* in milli seconds */
115116

@@ -210,7 +211,8 @@ enum mpi3mr_reset_reason {
210211
MPI3MR_RESET_FROM_GETPKGVER_TIMEOUT = 21,
211212
MPI3MR_RESET_FROM_PELABORT_TIMEOUT = 22,
212213
MPI3MR_RESET_FROM_SYSFS = 23,
213-
MPI3MR_RESET_FROM_SYSFS_TIMEOUT = 24
214+
MPI3MR_RESET_FROM_SYSFS_TIMEOUT = 24,
215+
MPI3MR_RESET_FROM_FIRMWARE = 27,
214216
};
215217

216218
/**
@@ -678,9 +680,9 @@ struct scmd_priv {
678680
* @removepend_bitmap: Remove pending bitmap
679681
* @delayed_rmhs_list: Delayed device removal list
680682
* @ts_update_counter: Timestamp update counter
681-
* @fault_dbg: Fault debug flag
682683
* @reset_in_progress: Reset in progress flag
683684
* @unrecoverable: Controller unrecoverable flag
685+
* @prev_reset_result: Result of previous reset
684686
* @reset_mutex: Controller reset mutex
685687
* @reset_waitq: Controller reset wait queue
686688
* @diagsave_timeout: Diagnostic information save timeout
@@ -804,9 +806,9 @@ struct mpi3mr_ioc {
804806
struct list_head delayed_rmhs_list;
805807

806808
u32 ts_update_counter;
807-
u8 fault_dbg;
808809
u8 reset_in_progress;
809810
u8 unrecoverable;
811+
int prev_reset_result;
810812
struct mutex reset_mutex;
811813
wait_queue_head_t reset_waitq;
812814

@@ -891,8 +893,6 @@ void mpi3mr_stop_watchdog(struct mpi3mr_ioc *mrioc);
891893

892894
int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
893895
u32 reset_reason, u8 snapdump);
894-
int mpi3mr_diagfault_reset_handler(struct mpi3mr_ioc *mrioc,
895-
u32 reset_reason);
896896
void mpi3mr_ioc_disable_intr(struct mpi3mr_ioc *mrioc);
897897
void mpi3mr_ioc_enable_intr(struct mpi3mr_ioc *mrioc);
898898

@@ -907,5 +907,7 @@ void mpi3mr_invalidate_devhandles(struct mpi3mr_ioc *mrioc);
907907
void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc);
908908
void mpi3mr_flush_delayed_rmhs_list(struct mpi3mr_ioc *mrioc);
909909
void mpi3mr_check_rh_fault_ioc(struct mpi3mr_ioc *mrioc, u32 reason_code);
910+
void mpi3mr_print_fault_info(struct mpi3mr_ioc *mrioc);
911+
void mpi3mr_check_rh_fault_ioc(struct mpi3mr_ioc *mrioc, u32 reason_code);
910912

911913
#endif /*MPI3MR_H_INCLUDED*/

0 commit comments

Comments
 (0)