]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fix ndlp nodelist not empty wait timeout during driver unloading (CR 127052)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:25 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:26 +0000 (17:01 -0700)
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 <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index f5a04ea880ee9d10cdcb81194801cc9cff7f4aa2..81ddb10b725017adafc4ff5f267717e7a3ca2f05 100644 (file)
@@ -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