Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129831
b: refs/heads/master
c: 2f4c782
h: refs/heads/master
i:
  129829: a2ccc5c
  129827: e8f355d
  129823: 0dc7e4f
v: v3
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Jan 13, 2009
1 parent 49145a2 commit 36dfb75
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e382968ba618e016ff7922dff9a6140c2f9108c8
refs/heads/master: 2f4c782c2e06fbaef2ac2b6b7abd796b96abd98b
37 changes: 37 additions & 0 deletions trunk/drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h \
- (default=0)");

int mpt_fwfault_debug;
EXPORT_SYMBOL(mpt_fwfault_debug);
module_param_call(mpt_fwfault_debug, param_set_int, param_get_int,
&mpt_fwfault_debug, 0600);
MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault"
" and halt Firmware on fault - (default=0)");



#ifdef MFCNT
static int mfcounter = 0;
Expand Down Expand Up @@ -6337,6 +6345,33 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh
*size = y;
}


/**
* mpt_halt_firmware - Halts the firmware if it is operational and panic
* the kernel
* @ioc: Pointer to MPT_ADAPTER structure
*
**/
void
mpt_halt_firmware(MPT_ADAPTER *ioc)
{
u32 ioc_raw_state;

ioc_raw_state = mpt_GetIocState(ioc, 0);

if ((ioc_raw_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_FAULT) {
printk(MYIOC_s_ERR_FMT "IOC is in FAULT state (%04xh)!!!\n",
ioc->name, ioc_raw_state & MPI_DOORBELL_DATA_MASK);
panic("%s: IOC Fault (%04xh)!!!\n", ioc->name,
ioc_raw_state & MPI_DOORBELL_DATA_MASK);
} else {
CHIPREG_WRITE32(&ioc->chip->Doorbell, 0xC0FFEE00);
panic("%s: Firmware is halted due to command timeout\n",
ioc->name);
}
}
EXPORT_SYMBOL(mpt_halt_firmware);

/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Reset Handling
Expand Down Expand Up @@ -6369,6 +6404,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
printk(MYIOC_s_INFO_FMT "HardResetHandler Entered!\n", ioc->name);
printk("MF count 0x%x !\n", ioc->mfcnt);
#endif
if (mpt_fwfault_debug)
mpt_halt_firmware(ioc);

/* Reset the adapter. Prevent more than 1 call to
* mpt_do_ioc_recovery at any instant in time.
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,14 @@ extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhysDiskPage0_t phys_disk);
extern void mpt_halt_firmware(MPT_ADAPTER *ioc);


/*
* Public data decl's...
*/
extern struct list_head ioc_list;
extern int mpt_fwfault_debug;

/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* } __KERNEL__ */
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/message/fusion/mptscsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
if (hd->timeouts < -1)
hd->timeouts++;

if (mpt_fwfault_debug)
mpt_halt_firmware(ioc);

/* Most important! Set TaskMsgContext to SCpnt's MsgContext!
* (the IO to be ABORT'd)
*
Expand Down

0 comments on commit 36dfb75

Please sign in to comment.