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_init.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_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index dcf6106f557a..62677da28c9d 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -386,8 +386,7 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
386 | * Setup the ring 0 (els) timeout handler | 386 | * Setup the ring 0 (els) timeout handler |
387 | */ | 387 | */ |
388 | timeout = phba->fc_ratov << 1; | 388 | timeout = phba->fc_ratov << 1; |
389 | phba->els_tmofunc.expires = jiffies + HZ * timeout; | 389 | mod_timer(&phba->els_tmofunc, jiffies + HZ * timeout); |
390 | add_timer(&phba->els_tmofunc); | ||
391 | 390 | ||
392 | lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed); | 391 | lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed); |
393 | pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; | 392 | pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
@@ -633,7 +632,7 @@ lpfc_handle_latt_free_mbuf: | |||
633 | lpfc_handle_latt_free_mp: | 632 | lpfc_handle_latt_free_mp: |
634 | kfree(mp); | 633 | kfree(mp); |
635 | lpfc_handle_latt_free_pmb: | 634 | lpfc_handle_latt_free_pmb: |
636 | kfree(pmb); | 635 | mempool_free(pmb, phba->mbox_mem_pool); |
637 | lpfc_handle_latt_err_exit: | 636 | lpfc_handle_latt_err_exit: |
638 | /* Enable Link attention interrupts */ | 637 | /* Enable Link attention interrupts */ |
639 | spin_lock_irq(phba->host->host_lock); | 638 | spin_lock_irq(phba->host->host_lock); |
@@ -1174,7 +1173,7 @@ lpfc_hba_init(struct lpfc_hba *phba, uint32_t *hbainit) | |||
1174 | } | 1173 | } |
1175 | 1174 | ||
1176 | static void | 1175 | static void |
1177 | lpfc_cleanup(struct lpfc_hba * phba, uint32_t save_bind) | 1176 | lpfc_cleanup(struct lpfc_hba * phba) |
1178 | { | 1177 | { |
1179 | struct lpfc_nodelist *ndlp, *next_ndlp; | 1178 | struct lpfc_nodelist *ndlp, *next_ndlp; |
1180 | 1179 | ||
@@ -1262,21 +1261,6 @@ lpfc_stop_timer(struct lpfc_hba * phba) | |||
1262 | { | 1261 | { |
1263 | struct lpfc_sli *psli = &phba->sli; | 1262 | struct lpfc_sli *psli = &phba->sli; |
1264 | 1263 | ||
1265 | /* Instead of a timer, this has been converted to a | ||
1266 | * deferred procedding list. | ||
1267 | */ | ||
1268 | while (!list_empty(&phba->freebufList)) { | ||
1269 | |||
1270 | struct lpfc_dmabuf *mp = NULL; | ||
1271 | |||
1272 | list_remove_head((&phba->freebufList), mp, | ||
1273 | struct lpfc_dmabuf, list); | ||
1274 | if (mp) { | ||
1275 | lpfc_mbuf_free(phba, mp->virt, mp->phys); | ||
1276 | kfree(mp); | ||
1277 | } | ||
1278 | } | ||
1279 | |||
1280 | del_timer_sync(&phba->fcp_poll_timer); | 1264 | del_timer_sync(&phba->fcp_poll_timer); |
1281 | del_timer_sync(&phba->fc_estabtmo); | 1265 | del_timer_sync(&phba->fc_estabtmo); |
1282 | del_timer_sync(&phba->fc_disctmo); | 1266 | del_timer_sync(&phba->fc_disctmo); |
@@ -1339,7 +1323,7 @@ lpfc_offline(struct lpfc_hba * phba) | |||
1339 | pring = &psli->ring[i]; | 1323 | pring = &psli->ring[i]; |
1340 | /* The linkdown event takes 30 seconds to timeout. */ | 1324 | /* The linkdown event takes 30 seconds to timeout. */ |
1341 | while (pring->txcmplq_cnt) { | 1325 | while (pring->txcmplq_cnt) { |
1342 | mdelay(10); | 1326 | msleep(10); |
1343 | if (cnt++ > 3000) { | 1327 | if (cnt++ > 3000) { |
1344 | lpfc_printf_log(phba, | 1328 | lpfc_printf_log(phba, |
1345 | KERN_WARNING, LOG_INIT, | 1329 | KERN_WARNING, LOG_INIT, |
@@ -1366,7 +1350,7 @@ lpfc_offline(struct lpfc_hba * phba) | |||
1366 | /* Bring down the SLI Layer and cleanup. The HBA is offline | 1350 | /* Bring down the SLI Layer and cleanup. The HBA is offline |
1367 | now. */ | 1351 | now. */ |
1368 | lpfc_sli_hba_down(phba); | 1352 | lpfc_sli_hba_down(phba); |
1369 | lpfc_cleanup(phba, 1); | 1353 | lpfc_cleanup(phba); |
1370 | spin_lock_irqsave(phba->host->host_lock, iflag); | 1354 | spin_lock_irqsave(phba->host->host_lock, iflag); |
1371 | phba->fc_flag |= FC_OFFLINE_MODE; | 1355 | phba->fc_flag |= FC_OFFLINE_MODE; |
1372 | spin_unlock_irqrestore(phba->host->host_lock, iflag); | 1356 | spin_unlock_irqrestore(phba->host->host_lock, iflag); |
@@ -1445,9 +1429,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1445 | goto out_put_host; | 1429 | goto out_put_host; |
1446 | 1430 | ||
1447 | host->unique_id = phba->brd_no; | 1431 | host->unique_id = phba->brd_no; |
1448 | INIT_LIST_HEAD(&phba->ctrspbuflist); | ||
1449 | INIT_LIST_HEAD(&phba->rnidrspbuflist); | ||
1450 | INIT_LIST_HEAD(&phba->freebufList); | ||
1451 | 1432 | ||
1452 | /* Initialize timers used by driver */ | 1433 | /* Initialize timers used by driver */ |
1453 | init_timer(&phba->fc_estabtmo); | 1434 | init_timer(&phba->fc_estabtmo); |
@@ -1773,7 +1754,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev) | |||
1773 | free_irq(phba->pcidev->irq, phba); | 1754 | free_irq(phba->pcidev->irq, phba); |
1774 | pci_disable_msi(phba->pcidev); | 1755 | pci_disable_msi(phba->pcidev); |
1775 | 1756 | ||
1776 | lpfc_cleanup(phba, 0); | 1757 | lpfc_cleanup(phba); |
1777 | lpfc_stop_timer(phba); | 1758 | lpfc_stop_timer(phba); |
1778 | phba->work_hba_events = 0; | 1759 | phba->work_hba_events = 0; |
1779 | 1760 | ||