From a8adb83208020c913f010cb4e26d09e25300db8e Mon Sep 17 00:00:00 2001 From: James Smart Date: Sat, 27 Oct 2007 13:37:53 -0400 Subject: [SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 2 Miscellaneous Small Fixes - part 2 - Fix ndlp left in PLOGI state after link up - Fix cannot rcv unsol ELS frames after running HBA resets for a few minutes - Fix HBQ buffer_count implemention - Fix RPI leak - Fix crash while deleting vports while HBA is reset - Revert the FCP Fbits offset back to 7 - Fix panic when deleting vports - Remove unused code in switch statement outside of a case - Reject PLOGI from invalid PName or NName of 0 - Ignore PLOGI responses from WWPName or WWNName of 0 - Fix debugfs hbqinfo display for ppc - Added 8G to list of supported speeds for sysfs parameter - Defer ndlp cleanup to dev-loss timeout handler - Added support for WRITE_VPARMS mailbox command by applications Signed-off-by: James Smart Signed-off-by: James Bottomley --- drivers/scsi/lpfc/lpfc_els.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'drivers/scsi/lpfc/lpfc_els.c') diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 0a5006ea9909..9315c3c2e6f6 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2069,9 +2069,25 @@ int lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb) { struct lpfc_dmabuf *buf_ptr, *buf_ptr1; + struct lpfc_nodelist *ndlp; - if (elsiocb->context1) { - lpfc_nlp_put(elsiocb->context1); + ndlp = (struct lpfc_nodelist *)elsiocb->context1; + if (ndlp) { + if (ndlp->nlp_flag & NLP_DEFER_RM) { + lpfc_nlp_put(ndlp); + + /* If the ndlp is not being used by another discovery + * thread, free it. + */ + if (!lpfc_nlp_not_used(ndlp)) { + /* If ndlp is being used by another discovery + * thread, just clear NLP_DEFER_RM + */ + ndlp->nlp_flag &= ~NLP_DEFER_RM; + } + } + else + lpfc_nlp_put(ndlp); elsiocb->context1 = NULL; } /* context2 = cmd, context2->next = rsp, context3 = bpl */ @@ -2130,13 +2146,15 @@ lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) lpfc_mbuf_free(phba, mp->virt, mp->phys); kfree(mp); mempool_free(pmb, phba->mbox_mem_pool); - lpfc_nlp_put(ndlp); + if (ndlp) { + lpfc_nlp_put(ndlp); - /* This is the end of the default RPI cleanup logic for this - * ndlp. If no other discovery threads are using this ndlp. - * we should free all resources associated with it. - */ - lpfc_nlp_not_used(ndlp); + /* This is the end of the default RPI cleanup logic for this + * ndlp. If no other discovery threads are using this ndlp. + * we should free all resources associated with it. + */ + lpfc_nlp_not_used(ndlp); + } return; } -- cgit v1.2.1