aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-08-24 21:50:00 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-13 09:28:53 -0400
commitd7c255b26d8e3f12164d82093de3bf22efad2b4a (patch)
tree0b3467eda322ec2d90e5a7369891ab4ba12ff0a1 /drivers/scsi/lpfc/lpfc_els.c
parent34b02dcdcf1865405f4762b991965c0c3b8a3ae0 (diff)
[SCSI] lpfc 8.2.8 : Miscellaneous Bug Fixes
Miscellaneous Fixes: - Fix the wrong variable name used for checking node active usage status - Fix numerous duplicate log message numbers - Fix change KERN_WARNING messages to KERN_INFO. - Stop sending erroneous LOGO to fabric after vport is already terminated - Fix HBQ allocates that were kalloc'ing w/ GFP_KERNEL while holding a lock. - Fix gcc 4.3.2 compiler warnings and a sparse warning - Fix bugs in handling unsolicited ct event queue - Reorder some of the initial link up checks, to remove odd VPI states. - Correct poor VPI handling - Add debug messages - Expand Update_CFG mailbox definition - Fix handling of VPD data offsets - Reorder loopback flags - convert to use offsetof() Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c87
1 files changed, 44 insertions, 43 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 89bd9ab46de7..d0730e79c1a7 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -473,7 +473,7 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
473 */ 473 */
474 list_for_each_entry_safe(np, next_np, 474 list_for_each_entry_safe(np, next_np,
475 &vport->fc_nodes, nlp_listp) { 475 &vport->fc_nodes, nlp_listp) {
476 if (!NLP_CHK_NODE_ACT(ndlp)) 476 if (!NLP_CHK_NODE_ACT(np))
477 continue; 477 continue;
478 if ((np->nlp_state != NLP_STE_NPR_NODE) || 478 if ((np->nlp_state != NLP_STE_NPR_NODE) ||
479 !(np->nlp_flag & NLP_NPR_ADISC)) 479 !(np->nlp_flag & NLP_NPR_ADISC))
@@ -2585,7 +2585,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2585 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID)) 2585 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID))
2586 ) { 2586 ) {
2587 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, 2587 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2588 "0123 FDISC Failed (x%x). " 2588 "0122 FDISC Failed (x%x). "
2589 "Fabric Detected Bad WWN\n", 2589 "Fabric Detected Bad WWN\n",
2590 stat.un.lsRjtError); 2590 stat.un.lsRjtError);
2591 lpfc_vport_set_state(vport, 2591 lpfc_vport_set_state(vport,
@@ -3966,7 +3966,7 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3966 if (rscn_id == hba_id) { 3966 if (rscn_id == hba_id) {
3967 /* ALL NPortIDs in RSCN are on HBA */ 3967 /* ALL NPortIDs in RSCN are on HBA */
3968 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 3968 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
3969 "0214 Ignore RSCN " 3969 "0219 Ignore RSCN "
3970 "Data: x%x x%x x%x x%x\n", 3970 "Data: x%x x%x x%x x%x\n",
3971 vport->fc_flag, payload_len, 3971 vport->fc_flag, payload_len,
3972 *lp, vport->fc_rscn_id_cnt); 3972 *lp, vport->fc_rscn_id_cnt);
@@ -5165,8 +5165,6 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
5165 } 5165 }
5166 5166
5167 phba->fc_stat.elsRcvFrame++; 5167 phba->fc_stat.elsRcvFrame++;
5168 if (elsiocb->context1)
5169 lpfc_nlp_put(elsiocb->context1);
5170 5168
5171 elsiocb->context1 = lpfc_nlp_get(ndlp); 5169 elsiocb->context1 = lpfc_nlp_get(ndlp);
5172 elsiocb->vport = vport; 5170 elsiocb->vport = vport;
@@ -5376,6 +5374,8 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
5376 NULL); 5374 NULL);
5377 } 5375 }
5378 5376
5377 lpfc_nlp_put(elsiocb->context1);
5378 elsiocb->context1 = NULL;
5379 return; 5379 return;
5380 5380
5381dropit: 5381dropit:
@@ -5440,6 +5440,7 @@ lpfc_els_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
5440 struct lpfc_dmabuf *bdeBuf1 = elsiocb->context2; 5440 struct lpfc_dmabuf *bdeBuf1 = elsiocb->context2;
5441 struct lpfc_dmabuf *bdeBuf2 = elsiocb->context3; 5441 struct lpfc_dmabuf *bdeBuf2 = elsiocb->context3;
5442 5442
5443 elsiocb->context1 = NULL;
5443 elsiocb->context2 = NULL; 5444 elsiocb->context2 = NULL;
5444 elsiocb->context3 = NULL; 5445 elsiocb->context3 = NULL;
5445 5446
@@ -5487,8 +5488,6 @@ lpfc_els_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
5487 * The different unsolicited event handlers would tell us 5488 * The different unsolicited event handlers would tell us
5488 * if they are done with "mp" by setting context2 to NULL. 5489 * if they are done with "mp" by setting context2 to NULL.
5489 */ 5490 */
5490 lpfc_nlp_put(elsiocb->context1);
5491 elsiocb->context1 = NULL;
5492 if (elsiocb->context2) { 5491 if (elsiocb->context2) {
5493 lpfc_in_buf_free(phba, (struct lpfc_dmabuf *)elsiocb->context2); 5492 lpfc_in_buf_free(phba, (struct lpfc_dmabuf *)elsiocb->context2);
5494 elsiocb->context2 = NULL; 5493 elsiocb->context2 = NULL;
@@ -5750,54 +5749,56 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
5750 goto out; 5749 goto out;
5751 /* FDISC failed */ 5750 /* FDISC failed */
5752 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, 5751 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
5753 "0124 FDISC failed. (%d/%d)\n", 5752 "0126 FDISC failed. (%d/%d)\n",
5754 irsp->ulpStatus, irsp->un.ulpWord[4]); 5753 irsp->ulpStatus, irsp->un.ulpWord[4]);
5754 goto fdisc_failed;
5755 }
5755 if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING) 5756 if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING)
5756 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 5757 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
5757 lpfc_nlp_put(ndlp); 5758 lpfc_nlp_put(ndlp);
5758 /* giving up on FDISC. Cancel discovery timer */ 5759 /* giving up on FDISC. Cancel discovery timer */
5759 lpfc_can_disctmo(vport); 5760 lpfc_can_disctmo(vport);
5760 } else { 5761 spin_lock_irq(shost->host_lock);
5761 spin_lock_irq(shost->host_lock); 5762 vport->fc_flag |= FC_FABRIC;
5762 vport->fc_flag |= FC_FABRIC; 5763 if (vport->phba->fc_topology == TOPOLOGY_LOOP)
5763 if (vport->phba->fc_topology == TOPOLOGY_LOOP) 5764 vport->fc_flag |= FC_PUBLIC_LOOP;
5764 vport->fc_flag |= FC_PUBLIC_LOOP; 5765 spin_unlock_irq(shost->host_lock);
5765 spin_unlock_irq(shost->host_lock);
5766 5766
5767 vport->fc_myDID = irsp->un.ulpWord[4] & Mask_DID; 5767 vport->fc_myDID = irsp->un.ulpWord[4] & Mask_DID;
5768 lpfc_vport_set_state(vport, FC_VPORT_ACTIVE); 5768 lpfc_vport_set_state(vport, FC_VPORT_ACTIVE);
5769 if ((vport->fc_prevDID != vport->fc_myDID) && 5769 if ((vport->fc_prevDID != vport->fc_myDID) &&
5770 !(vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)) { 5770 !(vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)) {
5771 /* If our NportID changed, we need to ensure all 5771 /* If our NportID changed, we need to ensure all
5772 * remaining NPORTs get unreg_login'ed so we can 5772 * remaining NPORTs get unreg_login'ed so we can
5773 * issue unreg_vpi. 5773 * issue unreg_vpi.
5774 */ 5774 */
5775 list_for_each_entry_safe(np, next_np, 5775 list_for_each_entry_safe(np, next_np,
5776 &vport->fc_nodes, nlp_listp) { 5776 &vport->fc_nodes, nlp_listp) {
5777 if (!NLP_CHK_NODE_ACT(ndlp) || 5777 if (!NLP_CHK_NODE_ACT(ndlp) ||
5778 (np->nlp_state != NLP_STE_NPR_NODE) || 5778 (np->nlp_state != NLP_STE_NPR_NODE) ||
5779 !(np->nlp_flag & NLP_NPR_ADISC)) 5779 !(np->nlp_flag & NLP_NPR_ADISC))
5780 continue; 5780 continue;
5781 spin_lock_irq(shost->host_lock);
5782 np->nlp_flag &= ~NLP_NPR_ADISC;
5783 spin_unlock_irq(shost->host_lock);
5784 lpfc_unreg_rpi(vport, np);
5785 }
5786 lpfc_mbx_unreg_vpi(vport);
5787 spin_lock_irq(shost->host_lock); 5781 spin_lock_irq(shost->host_lock);
5788 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 5782 np->nlp_flag &= ~NLP_NPR_ADISC;
5789 spin_unlock_irq(shost->host_lock); 5783 spin_unlock_irq(shost->host_lock);
5784 lpfc_unreg_rpi(vport, np);
5790 } 5785 }
5791 5786 lpfc_mbx_unreg_vpi(vport);
5792 if (vport->fc_flag & FC_VPORT_NEEDS_REG_VPI) 5787 spin_lock_irq(shost->host_lock);
5793 lpfc_register_new_vport(phba, vport, ndlp); 5788 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
5794 else 5789 spin_unlock_irq(shost->host_lock);
5795 lpfc_do_scr_ns_plogi(phba, vport);
5796
5797 /* Unconditionaly kick off releasing fabric node for vports */
5798 lpfc_nlp_put(ndlp);
5799 } 5790 }
5800 5791
5792 if (vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)
5793 lpfc_register_new_vport(phba, vport, ndlp);
5794 else
5795 lpfc_do_scr_ns_plogi(phba, vport);
5796 goto out;
5797fdisc_failed:
5798 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
5799 /* Cancel discovery timer */
5800 lpfc_can_disctmo(vport);
5801 lpfc_nlp_put(ndlp);
5801out: 5802out:
5802 lpfc_els_free_iocb(phba, cmdiocb); 5803 lpfc_els_free_iocb(phba, cmdiocb);
5803} 5804}