diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 63caf7fe9725..08a0c00cfc30 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -102,9 +102,8 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba, | |||
102 | uint16_t cmdSize, | 102 | uint16_t cmdSize, |
103 | uint8_t retry, struct lpfc_nodelist * ndlp, uint32_t elscmd) | 103 | uint8_t retry, struct lpfc_nodelist * ndlp, uint32_t elscmd) |
104 | { | 104 | { |
105 | struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; | ||
106 | struct lpfc_sli_ring *pring; | 105 | struct lpfc_sli_ring *pring; |
107 | struct lpfc_iocbq *elsiocb = NULL; | 106 | struct lpfc_iocbq *elsiocb; |
108 | struct lpfc_dmabuf *pcmd, *prsp, *pbuflist; | 107 | struct lpfc_dmabuf *pcmd, *prsp, *pbuflist; |
109 | struct ulp_bde64 *bpl; | 108 | struct ulp_bde64 *bpl; |
110 | IOCB_t *icmd; | 109 | IOCB_t *icmd; |
@@ -114,15 +113,13 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba, | |||
114 | if (phba->hba_state < LPFC_LINK_UP) | 113 | if (phba->hba_state < LPFC_LINK_UP) |
115 | return NULL; | 114 | return NULL; |
116 | 115 | ||
117 | |||
118 | /* Allocate buffer for command iocb */ | 116 | /* Allocate buffer for command iocb */ |
119 | spin_lock_irq(phba->host->host_lock); | 117 | spin_lock_irq(phba->host->host_lock); |
120 | list_remove_head(lpfc_iocb_list, elsiocb, struct lpfc_iocbq, list); | 118 | elsiocb = lpfc_sli_get_iocbq(phba); |
121 | spin_unlock_irq(phba->host->host_lock); | 119 | spin_unlock_irq(phba->host->host_lock); |
122 | 120 | ||
123 | if (elsiocb == NULL) | 121 | if (elsiocb == NULL) |
124 | return NULL; | 122 | return NULL; |
125 | memset(elsiocb, 0, sizeof (struct lpfc_iocbq)); | ||
126 | icmd = &elsiocb->iocb; | 123 | icmd = &elsiocb->iocb; |
127 | 124 | ||
128 | /* fill in BDEs for command */ | 125 | /* fill in BDEs for command */ |
@@ -133,7 +130,9 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba, | |||
133 | if (pcmd) | 130 | if (pcmd) |
134 | kfree(pcmd); | 131 | kfree(pcmd); |
135 | 132 | ||
136 | list_add_tail(&elsiocb->list, lpfc_iocb_list); | 133 | spin_lock_irq(phba->host->host_lock); |
134 | lpfc_sli_release_iocbq(phba, elsiocb); | ||
135 | spin_unlock_irq(phba->host->host_lock); | ||
137 | return NULL; | 136 | return NULL; |
138 | } | 137 | } |
139 | 138 | ||
@@ -150,7 +149,9 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba, | |||
150 | kfree(prsp); | 149 | kfree(prsp); |
151 | lpfc_mbuf_free(phba, pcmd->virt, pcmd->phys); | 150 | lpfc_mbuf_free(phba, pcmd->virt, pcmd->phys); |
152 | kfree(pcmd); | 151 | kfree(pcmd); |
153 | list_add_tail(&elsiocb->list, lpfc_iocb_list); | 152 | spin_lock_irq(phba->host->host_lock); |
153 | lpfc_sli_release_iocbq(phba, elsiocb); | ||
154 | spin_unlock_irq(phba->host->host_lock); | ||
154 | return NULL; | 155 | return NULL; |
155 | } | 156 | } |
156 | INIT_LIST_HEAD(&prsp->list); | 157 | INIT_LIST_HEAD(&prsp->list); |
@@ -164,7 +165,9 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba, | |||
164 | pbuflist->virt = lpfc_mbuf_alloc(phba, MEM_PRI, | 165 | pbuflist->virt = lpfc_mbuf_alloc(phba, MEM_PRI, |
165 | &pbuflist->phys); | 166 | &pbuflist->phys); |
166 | if (pbuflist == 0 || pbuflist->virt == 0) { | 167 | if (pbuflist == 0 || pbuflist->virt == 0) { |
167 | list_add_tail(&elsiocb->list, lpfc_iocb_list); | 168 | spin_lock_irq(phba->host->host_lock); |
169 | lpfc_sli_release_iocbq(phba, elsiocb); | ||
170 | spin_unlock_irq(phba->host->host_lock); | ||
168 | lpfc_mbuf_free(phba, pcmd->virt, pcmd->phys); | 171 | lpfc_mbuf_free(phba, pcmd->virt, pcmd->phys); |
169 | lpfc_mbuf_free(phba, prsp->virt, prsp->phys); | 172 | lpfc_mbuf_free(phba, prsp->virt, prsp->phys); |
170 | kfree(pcmd); | 173 | kfree(pcmd); |
@@ -596,10 +599,8 @@ lpfc_els_abort_flogi(struct lpfc_hba * phba) | |||
596 | spin_unlock_irq(phba->host->host_lock); | 599 | spin_unlock_irq(phba->host->host_lock); |
597 | (iocb->iocb_cmpl) (phba, iocb, iocb); | 600 | (iocb->iocb_cmpl) (phba, iocb, iocb); |
598 | spin_lock_irq(phba->host->host_lock); | 601 | spin_lock_irq(phba->host->host_lock); |
599 | } else { | 602 | } else |
600 | list_add_tail(&iocb->list, | 603 | lpfc_sli_release_iocbq(phba, iocb); |
601 | &phba->lpfc_iocb_list); | ||
602 | } | ||
603 | } | 604 | } |
604 | } | 605 | } |
605 | } | 606 | } |
@@ -1713,7 +1714,7 @@ lpfc_els_free_iocb(struct lpfc_hba * phba, struct lpfc_iocbq * elsiocb) | |||
1713 | kfree(buf_ptr); | 1714 | kfree(buf_ptr); |
1714 | } | 1715 | } |
1715 | spin_lock_irq(phba->host->host_lock); | 1716 | spin_lock_irq(phba->host->host_lock); |
1716 | list_add_tail(&elsiocb->list, &phba->lpfc_iocb_list); | 1717 | lpfc_sli_release_iocbq(phba, elsiocb); |
1717 | spin_unlock_irq(phba->host->host_lock); | 1718 | spin_unlock_irq(phba->host->host_lock); |
1718 | return 0; | 1719 | return 0; |
1719 | } | 1720 | } |
@@ -2929,9 +2930,8 @@ lpfc_els_timeout_handler(struct lpfc_hba *phba) | |||
2929 | spin_unlock_irq(phba->host->host_lock); | 2930 | spin_unlock_irq(phba->host->host_lock); |
2930 | (piocb->iocb_cmpl) (phba, piocb, piocb); | 2931 | (piocb->iocb_cmpl) (phba, piocb, piocb); |
2931 | spin_lock_irq(phba->host->host_lock); | 2932 | spin_lock_irq(phba->host->host_lock); |
2932 | } else { | 2933 | } else |
2933 | list_add_tail(&piocb->list, &phba->lpfc_iocb_list); | 2934 | lpfc_sli_release_iocbq(phba, piocb); |
2934 | } | ||
2935 | } | 2935 | } |
2936 | if (phba->sli.ring[LPFC_ELS_RING].txcmplq_cnt) { | 2936 | if (phba->sli.ring[LPFC_ELS_RING].txcmplq_cnt) { |
2937 | phba->els_tmofunc.expires = jiffies + HZ * timeout; | 2937 | phba->els_tmofunc.expires = jiffies + HZ * timeout; |
@@ -2996,7 +2996,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba) | |||
2996 | spin_lock_irq(phba->host->host_lock); | 2996 | spin_lock_irq(phba->host->host_lock); |
2997 | } | 2997 | } |
2998 | else | 2998 | else |
2999 | list_add_tail(&piocb->list, &phba->lpfc_iocb_list); | 2999 | lpfc_sli_release_iocbq(phba, piocb); |
3000 | } | 3000 | } |
3001 | 3001 | ||
3002 | list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) { | 3002 | list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) { |
@@ -3033,7 +3033,7 @@ lpfc_els_flush_cmd(struct lpfc_hba * phba) | |||
3033 | spin_lock_irq(phba->host->host_lock); | 3033 | spin_lock_irq(phba->host->host_lock); |
3034 | } | 3034 | } |
3035 | else | 3035 | else |
3036 | list_add_tail(&piocb->list, &phba->lpfc_iocb_list); | 3036 | lpfc_sli_release_iocbq(phba, piocb); |
3037 | } | 3037 | } |
3038 | spin_unlock_irq(phba->host->host_lock); | 3038 | spin_unlock_irq(phba->host->host_lock); |
3039 | return; | 3039 | return; |