From: Vaios Papadimitriou Date: Tue, 8 May 2012 22:01:25 +0000 (-0500) Subject: Fix ndlp nodelist not empty wait timeout during driver unloading (CR 127052) X-Git-Tag: v2.6.39-400.9.0~423^2~123^2~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bf67e535299309d003d79af963a54d5bbdaeae36;p=users%2Fjedix%2Flinux-maple.git Fix ndlp nodelist not empty wait timeout during driver unloading (CR 127052) In lpfc_set_rrq_active the code allocates an RRQ while lock are held. The driver either need to make this allocation ATOMIC or remove the allocation from the lock. We choose to remove the locked version of lpfc_set_rrq_active since there were no users of this function. Then rearrange the code so that the allocation does not occur while the lock is held. commit id: eff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124 Signed-off-by: Maxim Uvarov --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index f5a04ea880ee9..81ddb10b72501 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2323,13 +2323,20 @@ lpfc_cleanup(struct lpfc_vport *vport) continue; } + /* take care of nodes in unused state before the state + * machine taking action. + */ + if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) { + lpfc_nlp_put(ndlp); + continue; + } + if (ndlp->nlp_type & NLP_FABRIC) lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RECOVERY); lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); - } /* At this point, ALL ndlp's should be gone