aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 0143baf4ba3b..f32cd9acd3f6 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -547,8 +547,10 @@ void
547lpfc_hb_timeout_handler(struct lpfc_hba *phba) 547lpfc_hb_timeout_handler(struct lpfc_hba *phba)
548{ 548{
549 LPFC_MBOXQ_t *pmboxq; 549 LPFC_MBOXQ_t *pmboxq;
550 struct lpfc_dmabuf *buf_ptr;
550 int retval; 551 int retval;
551 struct lpfc_sli *psli = &phba->sli; 552 struct lpfc_sli *psli = &phba->sli;
553 LIST_HEAD(completions);
552 554
553 if ((phba->link_state == LPFC_HBA_ERROR) || 555 if ((phba->link_state == LPFC_HBA_ERROR) ||
554 (phba->pport->load_flag & FC_UNLOADING) || 556 (phba->pport->load_flag & FC_UNLOADING) ||
@@ -575,6 +577,24 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
575 } 577 }
576 spin_unlock_irq(&phba->pport->work_port_lock); 578 spin_unlock_irq(&phba->pport->work_port_lock);
577 579
580 if (phba->elsbuf_cnt &&
581 (phba->elsbuf_cnt == phba->elsbuf_prev_cnt)) {
582 spin_lock_irq(&phba->hbalock);
583 list_splice_init(&phba->elsbuf, &completions);
584 phba->elsbuf_cnt = 0;
585 phba->elsbuf_prev_cnt = 0;
586 spin_unlock_irq(&phba->hbalock);
587
588 while (!list_empty(&completions)) {
589 list_remove_head(&completions, buf_ptr,
590 struct lpfc_dmabuf, list);
591 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys);
592 kfree(buf_ptr);
593 }
594 }
595 phba->elsbuf_prev_cnt = phba->elsbuf_cnt;
596
597
578 /* If there is no heart beat outstanding, issue a heartbeat command */ 598 /* If there is no heart beat outstanding, issue a heartbeat command */
579 if (!phba->hb_outstanding) { 599 if (!phba->hb_outstanding) {
580 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL); 600 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL);
@@ -1999,6 +2019,9 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1999 /* Initialize list of fabric iocbs */ 2019 /* Initialize list of fabric iocbs */
2000 INIT_LIST_HEAD(&phba->fabric_iocb_list); 2020 INIT_LIST_HEAD(&phba->fabric_iocb_list);
2001 2021
2022 /* Initialize list to save ELS buffers */
2023 INIT_LIST_HEAD(&phba->elsbuf);
2024
2002 vport = lpfc_create_port(phba, phba->brd_no, &phba->pcidev->dev); 2025 vport = lpfc_create_port(phba, phba->brd_no, &phba->pcidev->dev);
2003 if (!vport) 2026 if (!vport)
2004 goto out_kthread_stop; 2027 goto out_kthread_stop;