diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-01-06 04:33:37 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-01-13 11:36:02 -0500 |
commit | 2f4c782c2e06fbaef2ac2b6b7abd796b96abd98b (patch) | |
tree | 2e20c691b1612614345ea369b64bd5f36107a4a6 /drivers/message/fusion/mptbase.c | |
parent | e382968ba618e016ff7922dff9a6140c2f9108c8 (diff) |
[SCSI] mpt fusion: Add Firmware debug support
Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 37 |
1 files changed, 37 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. |