aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-01-18 16:25:25 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:08:53 -0500
commiteff4a01b6e9f8cee3c541ab7f2ad18b5bbffd124 (patch)
treef77ae41ac94f3bdc6cfde5fb5847f807c1f257ae /drivers/scsi
parentacd6859b084d1e1b3ec8bc9befe6532223260d33 (diff)
[SCSI] lpfc 8.3.29: FC Discovery state machine fixes
FC Discovery state machine fixes. - Fix bug with driver returning the inactive ndlp (125743) - Fix discovery problem when in pt2pt by copying old ndlp state before state change (126887) - Fix ndlp nodelist not empty wait timeout during driver unloading (127052) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c9
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 2e7709f680bc..8db2fb3b45ec 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1526,7 +1526,6 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
1526 memcpy(&ndlp->active_rrqs.xri_bitmap, 1526 memcpy(&ndlp->active_rrqs.xri_bitmap,
1527 &rrq.xri_bitmap, 1527 &rrq.xri_bitmap,
1528 sizeof(ndlp->active_rrqs.xri_bitmap)); 1528 sizeof(ndlp->active_rrqs.xri_bitmap));
1529 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
1530 /* Since we are swapping the ndlp passed in with the new one 1529 /* Since we are swapping the ndlp passed in with the new one
1531 * and the did has already been swapped, copy over the 1530 * and the did has already been swapped, copy over the
1532 * state and names. 1531 * state and names.
@@ -1536,6 +1535,7 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
1536 memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename, 1535 memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename,
1537 sizeof(struct lpfc_name)); 1536 sizeof(struct lpfc_name));
1538 new_ndlp->nlp_state = ndlp->nlp_state; 1537 new_ndlp->nlp_state = ndlp->nlp_state;
1538 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
1539 /* Fix up the rport accordingly */ 1539 /* Fix up the rport accordingly */
1540 rport = ndlp->rport; 1540 rport = ndlp->rport;
1541 if (rport) { 1541 if (rport) {
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 678a4b11059c..2cadb8271f10 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -5332,6 +5332,10 @@ lpfc_filter_by_rpi(struct lpfc_nodelist *ndlp, void *param)
5332{ 5332{
5333 uint16_t *rpi = param; 5333 uint16_t *rpi = param;
5334 5334
5335 /* check for active node */
5336 if (!NLP_CHK_NODE_ACT(ndlp))
5337 return 0;
5338
5335 return ndlp->nlp_rpi == *rpi; 5339 return ndlp->nlp_rpi == *rpi;
5336} 5340}
5337 5341
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index d9628770f11e..a91914968cbb 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2341,13 +2341,20 @@ lpfc_cleanup(struct lpfc_vport *vport)
2341 continue; 2341 continue;
2342 } 2342 }
2343 2343
2344 /* take care of nodes in unused state before the state
2345 * machine taking action.
2346 */
2347 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
2348 lpfc_nlp_put(ndlp);
2349 continue;
2350 }
2351
2344 if (ndlp->nlp_type & NLP_FABRIC) 2352 if (ndlp->nlp_type & NLP_FABRIC)
2345 lpfc_disc_state_machine(vport, ndlp, NULL, 2353 lpfc_disc_state_machine(vport, ndlp, NULL,
2346 NLP_EVT_DEVICE_RECOVERY); 2354 NLP_EVT_DEVICE_RECOVERY);
2347 2355
2348 lpfc_disc_state_machine(vport, ndlp, NULL, 2356 lpfc_disc_state_machine(vport, ndlp, NULL,
2349 NLP_EVT_DEVICE_RM); 2357 NLP_EVT_DEVICE_RM);
2350
2351 } 2358 }
2352 2359
2353 /* At this point, ALL ndlp's should be gone 2360 /* At this point, ALL ndlp's should be gone