diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 266414ca2814..9080853fe283 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1189,7 +1189,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1189 | ioc->diagPending = 0; | 1189 | ioc->diagPending = 0; |
1190 | spin_lock_init(&ioc->diagLock); | 1190 | spin_lock_init(&ioc->diagLock); |
1191 | spin_lock_init(&ioc->fc_rescan_work_lock); | 1191 | spin_lock_init(&ioc->fc_rescan_work_lock); |
1192 | spin_lock_init(&ioc->fc_rport_lock); | ||
1193 | spin_lock_init(&ioc->initializing_hba_lock); | 1192 | spin_lock_init(&ioc->initializing_hba_lock); |
1194 | 1193 | ||
1195 | /* Initialize the event logging. | 1194 | /* Initialize the event logging. |
@@ -5736,11 +5735,13 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
5736 | return rc; | 5735 | return rc; |
5737 | } | 5736 | } |
5738 | 5737 | ||
5738 | # define EVENT_DESCR_STR_SZ 100 | ||
5739 | |||
5739 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5740 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
5740 | static void | 5741 | static void |
5741 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) | 5742 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) |
5742 | { | 5743 | { |
5743 | char *ds; | 5744 | char *ds = NULL; |
5744 | 5745 | ||
5745 | switch(event) { | 5746 | switch(event) { |
5746 | case MPI_EVENT_NONE: | 5747 | case MPI_EVENT_NONE: |
@@ -5777,9 +5778,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5777 | if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP) | 5778 | if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP) |
5778 | ds = "Loop State(LIP) Change"; | 5779 | ds = "Loop State(LIP) Change"; |
5779 | else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE) | 5780 | else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE) |
5780 | ds = "Loop State(LPE) Change"; /* ??? */ | 5781 | ds = "Loop State(LPE) Change"; /* ??? */ |
5781 | else | 5782 | else |
5782 | ds = "Loop State(LPB) Change"; /* ??? */ | 5783 | ds = "Loop State(LPB) Change"; /* ??? */ |
5783 | break; | 5784 | break; |
5784 | case MPI_EVENT_LOGOUT: | 5785 | case MPI_EVENT_LOGOUT: |
5785 | ds = "Logout"; | 5786 | ds = "Logout"; |
@@ -5841,27 +5842,32 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5841 | break; | 5842 | break; |
5842 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: | 5843 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: |
5843 | { | 5844 | { |
5844 | char buf[50]; | ||
5845 | u8 id = (u8)(evData0); | 5845 | u8 id = (u8)(evData0); |
5846 | u8 ReasonCode = (u8)(evData0 >> 16); | 5846 | u8 ReasonCode = (u8)(evData0 >> 16); |
5847 | switch (ReasonCode) { | 5847 | switch (ReasonCode) { |
5848 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: | 5848 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: |
5849 | sprintf(buf,"SAS Device Status Change: Added: id=%d", id); | 5849 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5850 | "SAS Device Status Change: Added: id=%d", id); | ||
5850 | break; | 5851 | break; |
5851 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: | 5852 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: |
5852 | sprintf(buf,"SAS Device Status Change: Deleted: id=%d", id); | 5853 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5854 | "SAS Device Status Change: Deleted: id=%d", id); | ||
5853 | break; | 5855 | break; |
5854 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: | 5856 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: |
5855 | sprintf(buf,"SAS Device Status Change: SMART Data: id=%d", id); | 5857 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5858 | "SAS Device Status Change: SMART Data: id=%d", | ||
5859 | id); | ||
5856 | break; | 5860 | break; |
5857 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: | 5861 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: |
5858 | sprintf(buf,"SAS Device Status Change: No Persistancy Added: id=%d", id); | 5862 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5863 | "SAS Device Status Change: No Persistancy " | ||
5864 | "Added: id=%d", id); | ||
5859 | break; | 5865 | break; |
5860 | default: | 5866 | default: |
5861 | sprintf(buf,"SAS Device Status Change: Unknown: id=%d", id); | 5867 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5862 | break; | 5868 | "SAS Device Status Change: Unknown: id=%d", id); |
5869 | break; | ||
5863 | } | 5870 | } |
5864 | ds = buf; | ||
5865 | break; | 5871 | break; |
5866 | } | 5872 | } |
5867 | case MPI_EVENT_ON_BUS_TIMER_EXPIRED: | 5873 | case MPI_EVENT_ON_BUS_TIMER_EXPIRED: |
@@ -5878,41 +5884,46 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5878 | break; | 5884 | break; |
5879 | case MPI_EVENT_SAS_PHY_LINK_STATUS: | 5885 | case MPI_EVENT_SAS_PHY_LINK_STATUS: |
5880 | { | 5886 | { |
5881 | char buf[50]; | ||
5882 | u8 LinkRates = (u8)(evData0 >> 8); | 5887 | u8 LinkRates = (u8)(evData0 >> 8); |
5883 | u8 PhyNumber = (u8)(evData0); | 5888 | u8 PhyNumber = (u8)(evData0); |
5884 | LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> | 5889 | LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> |
5885 | MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; | 5890 | MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; |
5886 | switch (LinkRates) { | 5891 | switch (LinkRates) { |
5887 | case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: | 5892 | case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: |
5888 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5893 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5894 | "SAS PHY Link Status: Phy=%d:" | ||
5889 | " Rate Unknown",PhyNumber); | 5895 | " Rate Unknown",PhyNumber); |
5890 | break; | 5896 | break; |
5891 | case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: | 5897 | case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: |
5892 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5898 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5899 | "SAS PHY Link Status: Phy=%d:" | ||
5893 | " Phy Disabled",PhyNumber); | 5900 | " Phy Disabled",PhyNumber); |
5894 | break; | 5901 | break; |
5895 | case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: | 5902 | case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: |
5896 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5903 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5904 | "SAS PHY Link Status: Phy=%d:" | ||
5897 | " Failed Speed Nego",PhyNumber); | 5905 | " Failed Speed Nego",PhyNumber); |
5898 | break; | 5906 | break; |
5899 | case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: | 5907 | case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: |
5900 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5908 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5909 | "SAS PHY Link Status: Phy=%d:" | ||
5901 | " Sata OOB Completed",PhyNumber); | 5910 | " Sata OOB Completed",PhyNumber); |
5902 | break; | 5911 | break; |
5903 | case MPI_EVENT_SAS_PLS_LR_RATE_1_5: | 5912 | case MPI_EVENT_SAS_PLS_LR_RATE_1_5: |
5904 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5913 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5914 | "SAS PHY Link Status: Phy=%d:" | ||
5905 | " Rate 1.5 Gbps",PhyNumber); | 5915 | " Rate 1.5 Gbps",PhyNumber); |
5906 | break; | 5916 | break; |
5907 | case MPI_EVENT_SAS_PLS_LR_RATE_3_0: | 5917 | case MPI_EVENT_SAS_PLS_LR_RATE_3_0: |
5908 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5918 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5919 | "SAS PHY Link Status: Phy=%d:" | ||
5909 | " Rate 3.0 Gpbs",PhyNumber); | 5920 | " Rate 3.0 Gpbs",PhyNumber); |
5910 | break; | 5921 | break; |
5911 | default: | 5922 | default: |
5912 | sprintf(buf,"SAS PHY Link Status: Phy=%d", PhyNumber); | 5923 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5924 | "SAS PHY Link Status: Phy=%d", PhyNumber); | ||
5913 | break; | 5925 | break; |
5914 | } | 5926 | } |
5915 | ds = buf; | ||
5916 | break; | 5927 | break; |
5917 | } | 5928 | } |
5918 | case MPI_EVENT_SAS_DISCOVERY_ERROR: | 5929 | case MPI_EVENT_SAS_DISCOVERY_ERROR: |
@@ -5921,9 +5932,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5921 | case MPI_EVENT_IR_RESYNC_UPDATE: | 5932 | case MPI_EVENT_IR_RESYNC_UPDATE: |
5922 | { | 5933 | { |
5923 | u8 resync_complete = (u8)(evData0 >> 16); | 5934 | u8 resync_complete = (u8)(evData0 >> 16); |
5924 | char buf[40]; | 5935 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5925 | sprintf(buf,"IR Resync Update: Complete = %d:",resync_complete); | 5936 | "IR Resync Update: Complete = %d:",resync_complete); |
5926 | ds = buf; | ||
5927 | break; | 5937 | break; |
5928 | } | 5938 | } |
5929 | case MPI_EVENT_IR2: | 5939 | case MPI_EVENT_IR2: |
@@ -5976,7 +5986,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5976 | ds = "Unknown"; | 5986 | ds = "Unknown"; |
5977 | break; | 5987 | break; |
5978 | } | 5988 | } |
5979 | strcpy(evStr,ds); | 5989 | if (ds) |
5990 | strncpy(evStr, ds, EVENT_DESCR_STR_SZ); | ||
5980 | } | 5991 | } |
5981 | 5992 | ||
5982 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5993 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -5998,7 +6009,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply | |||
5998 | int ii; | 6009 | int ii; |
5999 | int r = 0; | 6010 | int r = 0; |
6000 | int handlers = 0; | 6011 | int handlers = 0; |
6001 | char evStr[100]; | 6012 | char evStr[EVENT_DESCR_STR_SZ]; |
6002 | u8 event; | 6013 | u8 event; |
6003 | 6014 | ||
6004 | /* | 6015 | /* |