[SCSI] fusion - move some debug firmware event debug msgs to verbose level
authorMoore, Eric <Eric.Moore@lsil.com>
Tue, 14 Mar 2006 16:14:03 +0000 (09:14 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Tue, 14 Mar 2006 20:27:43 +0000 (14:27 -0600)
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>
drivers/message/fusion/Makefile
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptspi.c

index 33ace373241cb4b80997b60bb52b29dc46c87f8b..51740b346224b35fd80d79ad7e56882647d4a18b 100644 (file)
@@ -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
index 39c0b16d8d04e9a6a49b6206b96ce9cdabe9ef3d..9960ef10366ffa31cd3661446ea3f9cd910252b5 100644 (file)
@@ -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));
                }
        }
index f4197a9962a3c25f339702fe5d5c342329c5b9ae..fb22b28d1ab60ab1962c6711222ad832aee2a5fc 100644 (file)
@@ -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
index 9b64e07400da464606d1153fce1f6c20f1eb7d4d..3d555b724ed0f46439e93f0f740e4b1b94b2ea39 100644 (file)
@@ -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"));
        }
 
index 8ea12ea652ad981595d5fe3d82785886c5a4ca42..5a30621051c3b690c6dc6766b71776ee10f6bb14 100644 (file)
@@ -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"));
        }
 
index 74f4368c79ab221aec72393b2acd6b718987908a..ba93ef13a41eccf387e58e3bc6214b171f5b62c3 100644 (file)
@@ -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"));
        }
 
index a2183103b8c3e221ddf7c5987ac6b628cdf52c58..77289fd07fe7802e250024cc6cb2043d7858ec5a 100644 (file)
@@ -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 ||
index 437189f871b0f64fb826b05283f7743624d470f4..9af69dd66f8b71b2b3119ca93aa31a138926a490 100644 (file)
@@ -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"));
        }