aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index c39564e85e94..bd7bbedb941e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -147,11 +147,14 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
147 ndlp->nlp_state, ndlp->nlp_rpi); 147 ndlp->nlp_state, ndlp->nlp_rpi);
148 } 148 }
149 149
150 ndlp->rport = NULL; 150 if (!(phba->fc_flag & FC_UNLOADING) &&
151 rdata->pnode = NULL; 151 !(ndlp->nlp_flag & NLP_DELAY_TMO) &&
152 152 !(ndlp->nlp_flag & NLP_NPR_2B_DISC))
153 if (!(phba->fc_flag & FC_UNLOADING))
154 lpfc_disc_state_machine(phba, ndlp, NULL, NLP_EVT_DEVICE_RM); 153 lpfc_disc_state_machine(phba, ndlp, NULL, NLP_EVT_DEVICE_RM);
154 else {
155 rdata->pnode = NULL;
156 ndlp->rport = NULL;
157 }
155 158
156 return; 159 return;
157} 160}
@@ -1569,16 +1572,6 @@ lpfc_freenode(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1569 1572
1570 lpfc_nlp_list(phba, ndlp, NLP_JUST_DQ); 1573 lpfc_nlp_list(phba, ndlp, NLP_JUST_DQ);
1571 1574
1572 /*
1573 * if unloading the driver - just leave the remote port in place.
1574 * The driver unload will force the attached devices to detach
1575 * and flush cache's w/o generating flush errors.
1576 */
1577 if ((ndlp->rport) && !(phba->fc_flag & FC_UNLOADING)) {
1578 lpfc_unregister_remote_port(phba, ndlp);
1579 ndlp->nlp_sid = NLP_NO_SID;
1580 }
1581
1582 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ 1575 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */
1583 if ((mb = phba->sli.mbox_active)) { 1576 if ((mb = phba->sli.mbox_active)) {
1584 if ((mb->mb.mbxCommand == MBX_REG_LOGIN64) && 1577 if ((mb->mb.mbxCommand == MBX_REG_LOGIN64) &&
@@ -1627,6 +1620,7 @@ lpfc_freenode(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1627int 1620int
1628lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp) 1621lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1629{ 1622{
1623 struct lpfc_rport_data *rdata;
1630 1624
1631 if (ndlp->nlp_flag & NLP_DELAY_TMO) { 1625 if (ndlp->nlp_flag & NLP_DELAY_TMO) {
1632 lpfc_cancel_retry_delay_tmo(phba, ndlp); 1626 lpfc_cancel_retry_delay_tmo(phba, ndlp);
@@ -1638,6 +1632,13 @@ lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1638 spin_unlock_irq(phba->host->host_lock); 1632 spin_unlock_irq(phba->host->host_lock);
1639 } else { 1633 } else {
1640 lpfc_freenode(phba, ndlp); 1634 lpfc_freenode(phba, ndlp);
1635
1636 if ((ndlp->rport) && !(phba->fc_flag & FC_UNLOADING)) {
1637 rdata = ndlp->rport->dd_data;
1638 rdata->pnode = NULL;
1639 ndlp->rport = NULL;
1640 }
1641
1641 mempool_free( ndlp, phba->nlp_mem_pool); 1642 mempool_free( ndlp, phba->nlp_mem_pool);
1642 } 1643 }
1643 return 0; 1644 return 0;