diff options
author | Moore, Eric <Eric.Moore@lsil.com> | 2006-03-14 09:14:03 -0700 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-14 14:27:43 -0600 |
commit | 3a892bef3f7e94c4d6c2c20b9a1b546f43679fd3 (patch) | |
tree | 5777985afb6a2bbfef93ef60b8952f41612b7396 /drivers | |
parent | 5bf52c4fda97325976ffaf338d2e81b73b3db446 (diff) |
[SCSI] fusion - move some debug firmware event debug msgs to verbose level
Created a debug level MPT_DEBUG_VERBOSE_EVENTS.
Moving some of the more vebose debug messages
for firwmare events into new debug level. Also
added some more firmware events descriptions.
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/fusion/Makefile | 1 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.c | 125 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 8 | ||||
-rw-r--r-- | drivers/message/fusion/mptctl.c | 6 | ||||
-rw-r--r-- | drivers/message/fusion/mptfc.c | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.c | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 2 |
8 files changed, 122 insertions, 26 deletions
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile index 33ace373241..51740b34622 100644 --- a/drivers/message/fusion/Makefile +++ b/drivers/message/fusion/Makefile @@ -4,6 +4,7 @@ #EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME #EXTRA_CFLAGS += -DMPT_DEBUG_SG #EXTRA_CFLAGS += -DMPT_DEBUG_EVENTS +#EXTRA_CFLAGS += -DMPT_DEBUG_VERBOSE_EVENTS #EXTRA_CFLAGS += -DMPT_DEBUG_INIT #EXTRA_CFLAGS += -DMPT_DEBUG_EXIT #EXTRA_CFLAGS += -DMPT_DEBUG_FAIL diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 39c0b16d8d0..9960ef10366 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -428,7 +428,7 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) results = ProcessEventNotification(ioc, pEvReply, &evHandlers); if (results != evHandlers) { /* CHECKME! Any special handling needed here? */ - devtprintk((MYIOC_s_WARN_FMT "Called %d event handlers, sum results = %d\n", + devtverboseprintk((MYIOC_s_WARN_FMT "Called %d event handlers, sum results = %d\n", ioc->name, evHandlers, results)); } @@ -438,10 +438,10 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) */ if (pEvReply->MsgFlags & MPI_MSGFLAGS_CONTINUATION_REPLY) { freereq = 0; - devtprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p does not return Request frame\n", + devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p does not return Request frame\n", ioc->name, pEvReply)); } else { - devtprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n", + devtverboseprintk((MYIOC_s_WARN_FMT "EVENT_NOTIFICATION reply %p returns Request frame\n", ioc->name, pEvReply)); } @@ -5079,13 +5079,13 @@ SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch) evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc); if (evnp == NULL) { - devtprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n", + devtverboseprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n", ioc->name)); return 0; } memset(evnp, 0, sizeof(*evnp)); - devtprintk((MYIOC_s_INFO_FMT "Sending EventNotification (%d) request %p\n", ioc->name, EvSwitch, evnp)); + devtverboseprintk((MYIOC_s_INFO_FMT "Sending EventNotification (%d) request %p\n", ioc->name, EvSwitch, evnp)); evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; evnp->ChainOffset = 0; @@ -5840,24 +5840,27 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) break; case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: { + char buf[50]; + u8 id = (u8)(evData0); u8 ReasonCode = (u8)(evData0 >> 16); switch (ReasonCode) { case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: - ds = "SAS Device Status Change: Added"; + sprintf(buf,"SAS Device Status Change: Added: id=%d", id); break; case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: - ds = "SAS Device Status Change: Deleted"; + sprintf(buf,"SAS Device Status Change: Deleted: id=%d", id); break; case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: - ds = "SAS Device Status Change: SMART Data"; + sprintf(buf,"SAS Device Status Change: SMART Data: id=%d", id); break; case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: - ds = "SAS Device Status Change: No Persistancy Added"; + sprintf(buf,"SAS Device Status Change: No Persistancy Added: id=%d", id); break; default: - ds = "SAS Device Status Change: Unknown"; + sprintf(buf,"SAS Device Status Change: Unknown: id=%d", id); break; } + ds = buf; break; } case MPI_EVENT_ON_BUS_TIMER_EXPIRED: @@ -5873,11 +5876,97 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) ds = "Persistent Table Full"; break; case MPI_EVENT_SAS_PHY_LINK_STATUS: - ds = "SAS PHY Link Status"; + { + char buf[50]; + u8 LinkRates = (u8)(evData0 >> 8); + u8 PhyNumber = (u8)(evData0); + LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> + MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; + switch (LinkRates) { + case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Rate Unknown",PhyNumber); + break; + case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Phy Disabled",PhyNumber); + break; + case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Failed Speed Nego",PhyNumber); + break; + case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Sata OOB Completed",PhyNumber); + break; + case MPI_EVENT_SAS_PLS_LR_RATE_1_5: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Rate 1.5 Gbps",PhyNumber); + break; + case MPI_EVENT_SAS_PLS_LR_RATE_3_0: + sprintf(buf,"SAS PHY Link Status: Phy=%d:" + " Rate 3.0 Gpbs",PhyNumber); + break; + default: + sprintf(buf,"SAS PHY Link Status: Phy=%d", PhyNumber); + break; + } + ds = buf; break; + } case MPI_EVENT_SAS_DISCOVERY_ERROR: ds = "SAS Discovery Error"; break; + case MPI_EVENT_IR_RESYNC_UPDATE: + { + u8 resync_complete = (u8)(evData0 >> 16); + char buf[40]; + sprintf(buf,"IR Resync Update: Complete = %d:",resync_complete); + ds = buf; + break; + } + case MPI_EVENT_IR2: + { + u8 ReasonCode = (u8)(evData0 >> 16); + switch (ReasonCode) { + case MPI_EVENT_IR2_RC_LD_STATE_CHANGED: + ds = "IR2: LD State Changed"; + break; + case MPI_EVENT_IR2_RC_PD_STATE_CHANGED: + ds = "IR2: PD State Changed"; + break; + case MPI_EVENT_IR2_RC_BAD_BLOCK_TABLE_FULL: + ds = "IR2: Bad Block Table Full"; + break; + case MPI_EVENT_IR2_RC_PD_INSERTED: + ds = "IR2: PD Inserted"; + break; + case MPI_EVENT_IR2_RC_PD_REMOVED: + ds = "IR2: PD Removed"; + break; + case MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED: + ds = "IR2: Foreign CFG Detected"; + break; + case MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR: + ds = "IR2: Rebuild Medium Error"; + break; + default: + ds = "IR2"; + break; + } + break; + } + case MPI_EVENT_SAS_DISCOVERY: + { + if (evData0) + ds = "SAS Discovery: Start"; + else + ds = "SAS Discovery: Stop"; + break; + } + case MPI_EVENT_LOG_ENTRY_ADDED: + ds = "SAS Log Entry Added"; + break; /* * MPT base "custom" events may be added here... @@ -5922,12 +6011,12 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply } EventDescriptionStr(event, evData0, evStr); - devtprintk((MYIOC_s_INFO_FMT "MPT event (%s=%02Xh) detected!\n", + devtprintk((MYIOC_s_INFO_FMT "MPT event:(%02Xh) : %s\n", ioc->name, - evStr, - event)); + event, + evStr)); -#if defined(MPT_DEBUG) || defined(MPT_DEBUG_EVENTS) +#if defined(MPT_DEBUG) || defined(MPT_DEBUG_VERBOSE_EVENTS) printk(KERN_INFO MYNAM ": Event data:\n" KERN_INFO); for (ii = 0; ii < evDataLen; ii++) printk(" %08x", le32_to_cpu(pEventReply->Data[ii])); @@ -5986,7 +6075,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply */ for (ii=MPT_MAX_PROTOCOL_DRIVERS-1; ii; ii--) { if (MptEvHandlers[ii]) { - devtprintk((MYIOC_s_INFO_FMT "Routing Event to event handler #%d\n", + devtverboseprintk((MYIOC_s_INFO_FMT "Routing Event to event handler #%d\n", ioc->name, ii)); r += (*(MptEvHandlers[ii]))(ioc, pEventReply); handlers++; @@ -5998,10 +6087,10 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply * If needed, send (a single) EventAck. */ if (pEventReply->AckRequired == MPI_EVENT_NOTIFICATION_ACK_REQUIRED) { - devtprintk((MYIOC_s_WARN_FMT + devtverboseprintk((MYIOC_s_WARN_FMT "EventAck required\n",ioc->name)); if ((ii = SendEventAck(ioc, pEventReply)) != 0) { - devtprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n", + devtverboseprintk((MYIOC_s_WARN_FMT "SendEventAck returned %d\n", ioc->name, ii)); } } diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index f4197a9962a..fb22b28d1ab 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -719,12 +719,18 @@ typedef struct _mpt_sge { #define dhsprintk(x) #endif -#ifdef MPT_DEBUG_EVENTS +#if defined(MPT_DEBUG_EVENTS) || defined(MPT_DEBUG_VERBOSE_EVENTS) #define devtprintk(x) printk x #else #define devtprintk(x) #endif +#ifdef MPT_DEBUG_VERBOSE_EVENTS +#define devtverboseprintk(x) printk x +#else +#define devtverboseprintk(x) +#endif + #ifdef MPT_DEBUG_RESET #define drsprintk(x) printk x #else diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index 9b64e07400d..3d555b724ed 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c @@ -497,7 +497,7 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) if (event == 0x21 ) { ioc->aen_event_read_flag=1; dctlprintk(("Raised SIGIO to application\n")); - devtprintk(("Raised SIGIO to application\n")); + devtverboseprintk(("Raised SIGIO to application\n")); kill_fasync(&async_queue, SIGIO, POLL_IN); return 1; } @@ -515,7 +515,7 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) if (ioc->events && (ioc->eventTypes & ( 1 << event))) { ioc->aen_event_read_flag=1; dctlprintk(("Raised SIGIO to application\n")); - devtprintk(("Raised SIGIO to application\n")); + devtverboseprintk(("Raised SIGIO to application\n")); kill_fasync(&async_queue, SIGIO, POLL_IN); } return 1; @@ -2968,7 +2968,7 @@ static int __init mptctl_init(void) } if (mpt_event_register(mptctl_id, mptctl_event_process) == 0) { - devtprintk((KERN_INFO MYNAM + devtverboseprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); } diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 8ea12ea652a..5a30621051c 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -941,7 +941,7 @@ mptfc_init(void) mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER); if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) { - devtprintk((KERN_INFO MYNAM + devtverboseprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); } diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 74f4368c79a..ba93ef13a41 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -1993,7 +1993,7 @@ mptsas_init(void) mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); if (mpt_event_register(mptsasDoneCtx, mptsas_event_process) == 0) { - devtprintk((KERN_INFO MYNAM + devtverboseprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); } diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index a2183103b8c..77289fd07fe 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -2531,7 +2531,7 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) int work_count; unsigned long flags; - devtprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", + devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", ioc->name, event)); if (ioc->sh == NULL || diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 437189f871b..9af69dd66f8 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -1057,7 +1057,7 @@ mptspi_init(void) mptspiInternalCtx = mpt_register(mptscsih_scandv_complete, MPTSPI_DRIVER); if (mpt_event_register(mptspiDoneCtx, mptspi_event_process) == 0) { - devtprintk((KERN_INFO MYNAM + devtverboseprintk((KERN_INFO MYNAM ": Registered for IOC event notifications\n")); } |