diff options
-rw-r--r-- | drivers/message/fusion/mptbase.c | 37 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 3 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 3 |
3 files changed, 43 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 787a12648dbc..96ac88317b8e 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -107,6 +107,14 @@ module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int, | |||
107 | MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \ | 107 | MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \ |
108 | - (default=0)"); | 108 | - (default=0)"); |
109 | 109 | ||
110 | int mpt_fwfault_debug; | ||
111 | EXPORT_SYMBOL(mpt_fwfault_debug); | ||
112 | module_param_call(mpt_fwfault_debug, param_set_int, param_get_int, | ||
113 | &mpt_fwfault_debug, 0600); | ||
114 | MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" | ||
115 | " and halt Firmware on fault - (default=0)"); | ||
116 | |||
117 | |||
110 | 118 | ||
111 | #ifdef MFCNT | 119 | #ifdef MFCNT |
112 | static int mfcounter = 0; | 120 | static int mfcounter = 0; |
@@ -6337,6 +6345,33 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh | |||
6337 | *size = y; | 6345 | *size = y; |
6338 | } | 6346 | } |
6339 | 6347 | ||
6348 | |||
6349 | /** | ||
6350 | * mpt_halt_firmware - Halts the firmware if it is operational and panic | ||
6351 | * the kernel | ||
6352 | * @ioc: Pointer to MPT_ADAPTER structure | ||
6353 | * | ||
6354 | **/ | ||
6355 | void | ||
6356 | mpt_halt_firmware(MPT_ADAPTER *ioc) | ||
6357 | { | ||
6358 | u32 ioc_raw_state; | ||
6359 | |||
6360 | ioc_raw_state = mpt_GetIocState(ioc, 0); | ||
6361 | |||
6362 | if ((ioc_raw_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) { | ||
6363 | printk(MYIOC_s_ERR_FMT "IOC is in FAULT state (%04xh)!!!\n", | ||
6364 | ioc->name, ioc_raw_state & MPI_DOORBELL_DATA_MASK); | ||
6365 | panic("%s: IOC Fault (%04xh)!!!\n", ioc->name, | ||
6366 | ioc_raw_state & MPI_DOORBELL_DATA_MASK); | ||
6367 | } else { | ||
6368 | CHIPREG_WRITE32(&ioc->chip->Doorbell, 0xC0FFEE00); | ||
6369 | panic("%s: Firmware is halted due to command timeout\n", | ||
6370 | ioc->name); | ||
6371 | } | ||
6372 | } | ||
6373 | EXPORT_SYMBOL(mpt_halt_firmware); | ||
6374 | |||
6340 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6375 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
6341 | /* | 6376 | /* |
6342 | * Reset Handling | 6377 | * Reset Handling |
@@ -6369,6 +6404,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
6369 | printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name); | 6404 | printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name); |
6370 | printk("MF count 0x%x !\n", ioc->mfcnt); | 6405 | printk("MF count 0x%x !\n", ioc->mfcnt); |
6371 | #endif | 6406 | #endif |
6407 | if (mpt_fwfault_debug) | ||
6408 | mpt_halt_firmware(ioc); | ||
6372 | 6409 | ||
6373 | /* Reset the adapter. Prevent more than 1 call to | 6410 | /* Reset the adapter. Prevent more than 1 call to |
6374 | * mpt_do_ioc_recovery at any instant in time. | 6411 | * mpt_do_ioc_recovery at any instant in time. |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index dff048cfa101..b3e981d2a506 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -922,11 +922,14 @@ extern void mpt_free_fw_memory(MPT_ADAPTER *ioc); | |||
922 | extern int mpt_findImVolumes(MPT_ADAPTER *ioc); | 922 | extern int mpt_findImVolumes(MPT_ADAPTER *ioc); |
923 | extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); | 923 | extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); |
924 | extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk); | 924 | extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk); |
925 | extern void mpt_halt_firmware(MPT_ADAPTER *ioc); | ||
926 | |||
925 | 927 | ||
926 | /* | 928 | /* |
927 | * Public data decl's... | 929 | * Public data decl's... |
928 | */ | 930 | */ |
929 | extern struct list_head ioc_list; | 931 | extern struct list_head ioc_list; |
932 | extern int mpt_fwfault_debug; | ||
930 | 933 | ||
931 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 934 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
932 | #endif /* } __KERNEL__ */ | 935 | #endif /* } __KERNEL__ */ |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index ee090413e598..e62c6bc4ad33 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -1846,6 +1846,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1846 | if (hd->timeouts < -1) | 1846 | if (hd->timeouts < -1) |
1847 | hd->timeouts++; | 1847 | hd->timeouts++; |
1848 | 1848 | ||
1849 | if (mpt_fwfault_debug) | ||
1850 | mpt_halt_firmware(ioc); | ||
1851 | |||
1849 | /* Most important! Set TaskMsgContext to SCpnt's MsgContext! | 1852 | /* Most important! Set TaskMsgContext to SCpnt's MsgContext! |
1850 | * (the IO to be ABORT'd) | 1853 | * (the IO to be ABORT'd) |
1851 | * | 1854 | * |