diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 72c1cf15ef2..b4ef8362353 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1013,14 +1013,10 @@ out: | |||
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | static void | 1015 | static void |
1016 | lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | 1016 | lpfc_enable_la(struct lpfc_hba *phba) |
1017 | { | 1017 | { |
1018 | uint32_t control; | 1018 | uint32_t control; |
1019 | struct lpfc_sli *psli = &phba->sli; | 1019 | struct lpfc_sli *psli = &phba->sli; |
1020 | |||
1021 | lpfc_linkdown(phba); | ||
1022 | |||
1023 | /* turn on Link Attention interrupts - no CLEAR_LA needed */ | ||
1024 | spin_lock_irq(&phba->hbalock); | 1020 | spin_lock_irq(&phba->hbalock); |
1025 | psli->sli_flag |= LPFC_PROCESS_LA; | 1021 | psli->sli_flag |= LPFC_PROCESS_LA; |
1026 | control = readl(phba->HCregaddr); | 1022 | control = readl(phba->HCregaddr); |
@@ -1030,6 +1026,15 @@ lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | |||
1030 | spin_unlock_irq(&phba->hbalock); | 1026 | spin_unlock_irq(&phba->hbalock); |
1031 | } | 1027 | } |
1032 | 1028 | ||
1029 | static void | ||
1030 | lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | ||
1031 | { | ||
1032 | lpfc_linkdown(phba); | ||
1033 | lpfc_enable_la(phba); | ||
1034 | /* turn on Link Attention interrupts - no CLEAR_LA needed */ | ||
1035 | } | ||
1036 | |||
1037 | |||
1033 | /* | 1038 | /* |
1034 | * This routine handles processing a READ_LA mailbox | 1039 | * This routine handles processing a READ_LA mailbox |
1035 | * command upon completion. It is setup in the LPFC_MBOXQ | 1040 | * command upon completion. It is setup in the LPFC_MBOXQ |
@@ -1077,8 +1082,12 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1077 | } | 1082 | } |
1078 | 1083 | ||
1079 | phba->fc_eventTag = la->eventTag; | 1084 | phba->fc_eventTag = la->eventTag; |
1085 | if (la->mm) | ||
1086 | phba->sli.sli_flag |= LPFC_MENLO_MAINT; | ||
1087 | else | ||
1088 | phba->sli.sli_flag &= ~LPFC_MENLO_MAINT; | ||
1080 | 1089 | ||
1081 | if (la->attType == AT_LINK_UP) { | 1090 | if (la->attType == AT_LINK_UP && (!la->mm)) { |
1082 | phba->fc_stat.LinkUp++; | 1091 | phba->fc_stat.LinkUp++; |
1083 | if (phba->link_flag & LS_LOOPBACK_MODE) { | 1092 | if (phba->link_flag & LS_LOOPBACK_MODE) { |
1084 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1093 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
@@ -1090,13 +1099,15 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1090 | } else { | 1099 | } else { |
1091 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1100 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1092 | "1303 Link Up Event x%x received " | 1101 | "1303 Link Up Event x%x received " |
1093 | "Data: x%x x%x x%x x%x\n", | 1102 | "Data: x%x x%x x%x x%x x%x x%x %d\n", |
1094 | la->eventTag, phba->fc_eventTag, | 1103 | la->eventTag, phba->fc_eventTag, |
1095 | la->granted_AL_PA, la->UlnkSpeed, | 1104 | la->granted_AL_PA, la->UlnkSpeed, |
1096 | phba->alpa_map[0]); | 1105 | phba->alpa_map[0], |
1106 | la->mm, la->fa, | ||
1107 | phba->wait_4_mlo_maint_flg); | ||
1097 | } | 1108 | } |
1098 | lpfc_mbx_process_link_up(phba, la); | 1109 | lpfc_mbx_process_link_up(phba, la); |
1099 | } else { | 1110 | } else if (la->attType == AT_LINK_DOWN) { |
1100 | phba->fc_stat.LinkDown++; | 1111 | phba->fc_stat.LinkDown++; |
1101 | if (phba->link_flag & LS_LOOPBACK_MODE) { | 1112 | if (phba->link_flag & LS_LOOPBACK_MODE) { |
1102 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1113 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
@@ -1109,11 +1120,46 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1109 | else { | 1120 | else { |
1110 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1121 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1111 | "1305 Link Down Event x%x received " | 1122 | "1305 Link Down Event x%x received " |
1123 | "Data: x%x x%x x%x x%x x%x\n", | ||
1124 | la->eventTag, phba->fc_eventTag, | ||
1125 | phba->pport->port_state, vport->fc_flag, | ||
1126 | la->mm, la->fa); | ||
1127 | } | ||
1128 | lpfc_mbx_issue_link_down(phba); | ||
1129 | } | ||
1130 | if (la->mm && la->attType == AT_LINK_UP) { | ||
1131 | if (phba->link_state != LPFC_LINK_DOWN) { | ||
1132 | phba->fc_stat.LinkDown++; | ||
1133 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | ||
1134 | "1312 Link Down Event x%x received " | ||
1135 | "Data: x%x x%x x%x\n", | ||
1136 | la->eventTag, phba->fc_eventTag, | ||
1137 | phba->pport->port_state, vport->fc_flag); | ||
1138 | lpfc_mbx_issue_link_down(phba); | ||
1139 | } else | ||
1140 | lpfc_enable_la(phba); | ||
1141 | |||
1142 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | ||
1143 | "1310 Menlo Maint Mode Link up Event x%x rcvd " | ||
1112 | "Data: x%x x%x x%x\n", | 1144 | "Data: x%x x%x x%x\n", |
1113 | la->eventTag, phba->fc_eventTag, | 1145 | la->eventTag, phba->fc_eventTag, |
1114 | phba->pport->port_state, vport->fc_flag); | 1146 | phba->pport->port_state, vport->fc_flag); |
1147 | /* | ||
1148 | * The cmnd that triggered this will be waiting for this | ||
1149 | * signal. | ||
1150 | */ | ||
1151 | /* WAKEUP for MENLO_SET_MODE or MENLO_RESET command. */ | ||
1152 | if (phba->wait_4_mlo_maint_flg) { | ||
1153 | phba->wait_4_mlo_maint_flg = 0; | ||
1154 | wake_up_interruptible(&phba->wait_4_mlo_m_q); | ||
1115 | } | 1155 | } |
1116 | lpfc_mbx_issue_link_down(phba); | 1156 | } |
1157 | |||
1158 | if (la->fa) { | ||
1159 | if (la->mm) | ||
1160 | lpfc_issue_clear_la(phba, vport); | ||
1161 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | ||
1162 | "1311 fa %d\n", la->fa); | ||
1117 | } | 1163 | } |
1118 | 1164 | ||
1119 | lpfc_mbx_cmpl_read_la_free_mbuf: | 1165 | lpfc_mbx_cmpl_read_la_free_mbuf: |