Commit 213aaca3 authored by Kashyap, Desai's avatar Kashyap, Desai Committed by James Bottomley

[SCSI] mptfusion: Extra debug prints added relavent to Device missing delay error handling

Adding function name in original debug prints and few more debug prints are
added.
Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent c9de7dc4
...@@ -115,6 +115,7 @@ MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault" ...@@ -115,6 +115,7 @@ MODULE_PARM_DESC(mpt_fwfault_debug, "Enable detection of Firmware fault"
" and halt Firmware on fault - (default=0)"); " and halt Firmware on fault - (default=0)");
static char MptCallbacksName[MPT_MAX_PROTOCOL_DRIVERS][50];
#ifdef MFCNT #ifdef MFCNT
static int mfcounter = 0; static int mfcounter = 0;
...@@ -213,7 +214,7 @@ static int ProcessEventNotification(MPT_ADAPTER *ioc, ...@@ -213,7 +214,7 @@ static int ProcessEventNotification(MPT_ADAPTER *ioc,
static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf);
static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info);
static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info); static void mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info , u8 cb_idx);
static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc); static int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc); static void mpt_inactive_raid_list_free(MPT_ADAPTER *ioc);
...@@ -490,7 +491,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa) ...@@ -490,7 +491,7 @@ mpt_reply(MPT_ADAPTER *ioc, u32 pa)
else if (ioc->bus_type == SPI) else if (ioc->bus_type == SPI)
mpt_spi_log_info(ioc, log_info); mpt_spi_log_info(ioc, log_info);
else if (ioc->bus_type == SAS) else if (ioc->bus_type == SAS)
mpt_sas_log_info(ioc, log_info); mpt_sas_log_info(ioc, log_info, cb_idx);
} }
if (ioc_stat & MPI_IOCSTATUS_MASK) if (ioc_stat & MPI_IOCSTATUS_MASK)
...@@ -644,7 +645,7 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply) ...@@ -644,7 +645,7 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply)
* considered an error by the caller. * considered an error by the caller.
*/ */
u8 u8
mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass) mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass, char *func_name)
{ {
u8 cb_idx; u8 cb_idx;
last_drv_idx = MPT_MAX_PROTOCOL_DRIVERS; last_drv_idx = MPT_MAX_PROTOCOL_DRIVERS;
...@@ -659,6 +660,8 @@ mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass) ...@@ -659,6 +660,8 @@ mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass)
MptDriverClass[cb_idx] = dclass; MptDriverClass[cb_idx] = dclass;
MptEvHandlers[cb_idx] = NULL; MptEvHandlers[cb_idx] = NULL;
last_drv_idx = cb_idx; last_drv_idx = cb_idx;
memcpy(MptCallbacksName[cb_idx], func_name,
strlen(func_name) > 50 ? 50 : strlen(func_name));
break; break;
} }
} }
...@@ -8002,7 +8005,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info) ...@@ -8002,7 +8005,7 @@ mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
* Refer to lsi/mpi_log_sas.h. * Refer to lsi/mpi_log_sas.h.
**/ **/
static void static void
mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info) mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info, u8 cb_idx)
{ {
union loginfo_type { union loginfo_type {
u32 loginfo; u32 loginfo;
...@@ -8056,21 +8059,22 @@ union loginfo_type { ...@@ -8056,21 +8059,22 @@ union loginfo_type {
if (sub_code_desc != NULL) if (sub_code_desc != NULL)
printk(MYIOC_s_INFO_FMT printk(MYIOC_s_INFO_FMT
"LogInfo(0x%08x): Originator={%s}, Code={%s}," "LogInfo(0x%08x): Originator={%s}, Code={%s},"
" SubCode={%s}\n", " SubCode={%s} cb_idx %s\n",
ioc->name, log_info, originator_desc, code_desc, ioc->name, log_info, originator_desc, code_desc,
sub_code_desc); sub_code_desc, MptCallbacksName[cb_idx]);
else if (code_desc != NULL) else if (code_desc != NULL)
printk(MYIOC_s_INFO_FMT printk(MYIOC_s_INFO_FMT
"LogInfo(0x%08x): Originator={%s}, Code={%s}," "LogInfo(0x%08x): Originator={%s}, Code={%s},"
" SubCode(0x%04x)\n", " SubCode(0x%04x) cb_idx %s\n",
ioc->name, log_info, originator_desc, code_desc, ioc->name, log_info, originator_desc, code_desc,
sas_loginfo.dw.subcode); sas_loginfo.dw.subcode, MptCallbacksName[cb_idx]);
else else
printk(MYIOC_s_INFO_FMT printk(MYIOC_s_INFO_FMT
"LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x),"
" SubCode(0x%04x)\n", " SubCode(0x%04x) cb_idx %s\n",
ioc->name, log_info, originator_desc, ioc->name, log_info, originator_desc,
sas_loginfo.dw.code, sas_loginfo.dw.subcode); sas_loginfo.dw.code, sas_loginfo.dw.subcode,
MptCallbacksName[cb_idx]);
} }
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...@@ -8435,7 +8439,8 @@ fusion_init(void) ...@@ -8435,7 +8439,8 @@ fusion_init(void)
/* Register ourselves (mptbase) in order to facilitate /* Register ourselves (mptbase) in order to facilitate
* EventNotification handling. * EventNotification handling.
*/ */
mpt_base_index = mpt_register(mptbase_reply, MPTBASE_DRIVER); mpt_base_index = mpt_register(mptbase_reply, MPTBASE_DRIVER,
"mptbase_reply");
/* Register for hard reset handling callbacks. /* Register for hard reset handling callbacks.
*/ */
......
...@@ -926,7 +926,8 @@ extern void mpt_detach(struct pci_dev *pdev); ...@@ -926,7 +926,8 @@ extern void mpt_detach(struct pci_dev *pdev);
extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state); extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state);
extern int mpt_resume(struct pci_dev *pdev); extern int mpt_resume(struct pci_dev *pdev);
#endif #endif
extern u8 mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); extern u8 mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass,
char *func_name);
extern void mpt_deregister(u8 cb_idx); extern void mpt_deregister(u8 cb_idx);
extern int mpt_event_register(u8 cb_idx, MPT_EVHANDLER ev_cbfunc); extern int mpt_event_register(u8 cb_idx, MPT_EVHANDLER ev_cbfunc);
extern void mpt_event_deregister(u8 cb_idx); extern void mpt_event_deregister(u8 cb_idx);
......
...@@ -3018,7 +3018,8 @@ static int __init mptctl_init(void) ...@@ -3018,7 +3018,8 @@ static int __init mptctl_init(void)
* Install our handler * Install our handler
*/ */
++where; ++where;
mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER); mptctl_id = mpt_register(mptctl_reply, MPTCTL_DRIVER,
"mptctl_reply");
if (!mptctl_id || mptctl_id >= MPT_MAX_PROTOCOL_DRIVERS) { if (!mptctl_id || mptctl_id >= MPT_MAX_PROTOCOL_DRIVERS) {
printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusion MPT base driver\n"); printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusion MPT base driver\n");
misc_deregister(&mptctl_miscdev); misc_deregister(&mptctl_miscdev);
...@@ -3026,7 +3027,8 @@ static int __init mptctl_init(void) ...@@ -3026,7 +3027,8 @@ static int __init mptctl_init(void)
goto out_fail; goto out_fail;
} }
mptctl_taskmgmt_id = mpt_register(mptctl_taskmgmt_reply, MPTCTL_DRIVER); mptctl_taskmgmt_id = mpt_register(mptctl_taskmgmt_reply, MPTCTL_DRIVER,
"mptctl_taskmgmt_reply");
if (!mptctl_taskmgmt_id || mptctl_taskmgmt_id >= MPT_MAX_PROTOCOL_DRIVERS) { if (!mptctl_taskmgmt_id || mptctl_taskmgmt_id >= MPT_MAX_PROTOCOL_DRIVERS) {
printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusion MPT base driver\n"); printk(KERN_ERR MYNAM ": ERROR: Failed to register with Fusion MPT base driver\n");
mpt_deregister(mptctl_id); mpt_deregister(mptctl_id);
......
...@@ -1472,9 +1472,12 @@ mptfc_init(void) ...@@ -1472,9 +1472,12 @@ mptfc_init(void)
if (!mptfc_transport_template) if (!mptfc_transport_template)
return -ENODEV; return -ENODEV;
mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER); mptfcDoneCtx = mpt_register(mptscsih_io_done, MPTFC_DRIVER,
mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER); "mptscsih_scandv_complete");
mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER); mptfcTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTFC_DRIVER,
"mptscsih_scandv_complete");
mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER,
"mptscsih_scandv_complete");
mpt_event_register(mptfcDoneCtx, mptfc_event_process); mpt_event_register(mptfcDoneCtx, mptfc_event_process);
mpt_reset_register(mptfcDoneCtx, mptfc_ioc_reset); mpt_reset_register(mptfcDoneCtx, mptfc_ioc_reset);
......
...@@ -1452,7 +1452,9 @@ static int __init mpt_lan_init (void) ...@@ -1452,7 +1452,9 @@ static int __init mpt_lan_init (void)
{ {
show_mptmod_ver(LANAME, LANVER); show_mptmod_ver(LANAME, LANVER);
if ((LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER)) <= 0) { LanCtx = mpt_register(lan_reply, MPTLAN_DRIVER,
"lan_reply");
if (LanCtx <= 0) {
printk (KERN_ERR MYNAM ": Failed to register with MPT base driver\n"); printk (KERN_ERR MYNAM ": Failed to register with MPT base driver\n");
return -EBUSY; return -EBUSY;
} }
......
...@@ -5368,13 +5368,18 @@ mptsas_init(void) ...@@ -5368,13 +5368,18 @@ mptsas_init(void)
return -ENODEV; return -ENODEV;
mptsas_transport_template->eh_timed_out = mptsas_eh_timed_out; mptsas_transport_template->eh_timed_out = mptsas_eh_timed_out;
mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER); mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER,
mptsasTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSAS_DRIVER); "mptscsih_io_done");
mptsasTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSAS_DRIVER,
"mptscsih_taskmgmt_complete");
mptsasInternalCtx = mptsasInternalCtx =
mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER,
mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); "mptscsih_scandv_complete");
mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER,
"mptsas_mgmt_done");
mptsasDeviceResetCtx = mptsasDeviceResetCtx =
mpt_register(mptsas_taskmgmt_complete, MPTSAS_DRIVER); mpt_register(mptsas_taskmgmt_complete, MPTSAS_DRIVER,
"mptsas_taskmgmt_complete");
mpt_event_register(mptsasDoneCtx, mptsas_event_process); mpt_event_register(mptsasDoneCtx, mptsas_event_process);
mpt_reset_register(mptsasDoneCtx, mptsas_ioc_reset); mpt_reset_register(mptsasDoneCtx, mptsas_ioc_reset);
......
...@@ -1551,9 +1551,12 @@ mptspi_init(void) ...@@ -1551,9 +1551,12 @@ mptspi_init(void)
if (!mptspi_transport_template) if (!mptspi_transport_template)
return -ENODEV; return -ENODEV;
mptspiDoneCtx = mpt_register(mptscsih_io_done, MPTSPI_DRIVER); mptspiDoneCtx = mpt_register(mptscsih_io_done, MPTSPI_DRIVER,
mptspiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSPI_DRIVER); "mptscsih_io_done");
mptspiInternalCtx = mpt_register(mptscsih_scandv_complete, MPTSPI_DRIVER); mptspiTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSPI_DRIVER,
"mptscsih_taskmgmt_complete");
mptspiInternalCtx = mpt_register(mptscsih_scandv_complete,
MPTSPI_DRIVER, "mptscsih_scandv_complete");
mpt_event_register(mptspiDoneCtx, mptspi_event_process); mpt_event_register(mptspiDoneCtx, mptspi_event_process);
mpt_reset_register(mptspiDoneCtx, mptspi_ioc_reset); mpt_reset_register(mptspiDoneCtx, mptspi_ioc_reset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment