diff options
author | James Smart <James.Smart@Emulex.Com> | 2007-04-25 09:51:30 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-06 10:33:12 -0400 |
commit | 1dcb58e5680b6673bf984696d3d8b9033b6e41bf (patch) | |
tree | 7421ad398ef2ee04d2c7b22bb975219593885f01 /drivers/scsi/lpfc/lpfc_hbadisc.c | |
parent | e555db930f7512491485cfc43df4306192835373 (diff) |
[SCSI] lpfc 8.1.12 : Misc bug fixes and code cleanup
Misc bug fixes and code cleanup:
- Fix system hang while running on systems with IOMMU
- Fix use after free issues with rports
- Don't free mailbox structure if it's still on the mboxq list
- Decrement txq_cnt rather than txcmplq_cnt when parsing the txq list
- Use msleep for long delays to prevent soft lockup bug check
- Don't remove node during dev_loss_tmo if discovery is active
- Fix memory leaks in get/reset statistics and link attention paths
- Fixed lpfc_ns_rsp to handle entire GID_FT response.
- mbox interface should use MAILBOX_CMD_SIZE rather than sizeof(MAILBOX_t)
- Fixed bug check in add_timer.
- Fixup messages 0116, 0117, and 0128 to report ELS I/O tag.
- Remove unused parameter to lpfc_cleanup.
- Change mailbox timeout handling.
- Remove unused buflist. Code cleanup.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 29 |
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) | |||
1627 | int | 1620 | int |
1628 | lpfc_nlp_remove(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp) | 1621 | lpfc_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; |