diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 1280f0e54636..7f427f9c4688 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -224,18 +224,16 @@ lpfc_gen_req(struct lpfc_hba *phba, struct lpfc_dmabuf *bmp, | |||
224 | 224 | ||
225 | struct lpfc_sli *psli = &phba->sli; | 225 | struct lpfc_sli *psli = &phba->sli; |
226 | struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING]; | 226 | struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING]; |
227 | struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; | ||
228 | IOCB_t *icmd; | 227 | IOCB_t *icmd; |
229 | struct lpfc_iocbq *geniocb = NULL; | 228 | struct lpfc_iocbq *geniocb; |
230 | 229 | ||
231 | /* Allocate buffer for command iocb */ | 230 | /* Allocate buffer for command iocb */ |
232 | spin_lock_irq(phba->host->host_lock); | 231 | spin_lock_irq(phba->host->host_lock); |
233 | list_remove_head(lpfc_iocb_list, geniocb, struct lpfc_iocbq, list); | 232 | geniocb = lpfc_sli_get_iocbq(phba); |
234 | spin_unlock_irq(phba->host->host_lock); | 233 | spin_unlock_irq(phba->host->host_lock); |
235 | 234 | ||
236 | if (geniocb == NULL) | 235 | if (geniocb == NULL) |
237 | return 1; | 236 | return 1; |
238 | memset(geniocb, 0, sizeof (struct lpfc_iocbq)); | ||
239 | 237 | ||
240 | icmd = &geniocb->iocb; | 238 | icmd = &geniocb->iocb; |
241 | icmd->un.genreq64.bdl.ulpIoTag32 = 0; | 239 | icmd->un.genreq64.bdl.ulpIoTag32 = 0; |
@@ -279,7 +277,7 @@ lpfc_gen_req(struct lpfc_hba *phba, struct lpfc_dmabuf *bmp, | |||
279 | geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT; | 277 | geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT; |
280 | spin_lock_irq(phba->host->host_lock); | 278 | spin_lock_irq(phba->host->host_lock); |
281 | if (lpfc_sli_issue_iocb(phba, pring, geniocb, 0) == IOCB_ERROR) { | 279 | if (lpfc_sli_issue_iocb(phba, pring, geniocb, 0) == IOCB_ERROR) { |
282 | list_add_tail(&geniocb->list, lpfc_iocb_list); | 280 | lpfc_sli_release_iocbq(phba, geniocb); |
283 | spin_unlock_irq(phba->host->host_lock); | 281 | spin_unlock_irq(phba->host->host_lock); |
284 | return 1; | 282 | return 1; |
285 | } | 283 | } |
@@ -487,7 +485,7 @@ out: | |||
487 | kfree(inp); | 485 | kfree(inp); |
488 | kfree(bmp); | 486 | kfree(bmp); |
489 | spin_lock_irq(phba->host->host_lock); | 487 | spin_lock_irq(phba->host->host_lock); |
490 | list_add_tail(&cmdiocb->list, &phba->lpfc_iocb_list); | 488 | lpfc_sli_release_iocbq(phba, cmdiocb); |
491 | spin_unlock_irq(phba->host->host_lock); | 489 | spin_unlock_irq(phba->host->host_lock); |
492 | return; | 490 | return; |
493 | } | 491 | } |
@@ -526,7 +524,7 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
526 | kfree(inp); | 524 | kfree(inp); |
527 | kfree(bmp); | 525 | kfree(bmp); |
528 | spin_lock_irq(phba->host->host_lock); | 526 | spin_lock_irq(phba->host->host_lock); |
529 | list_add_tail(&cmdiocb->list, &phba->lpfc_iocb_list); | 527 | lpfc_sli_release_iocbq(phba, cmdiocb); |
530 | spin_unlock_irq(phba->host->host_lock); | 528 | spin_unlock_irq(phba->host->host_lock); |
531 | return; | 529 | return; |
532 | } | 530 | } |
@@ -735,7 +733,7 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba * phba, | |||
735 | kfree(inp); | 733 | kfree(inp); |
736 | kfree(bmp); | 734 | kfree(bmp); |
737 | spin_lock_irq(phba->host->host_lock); | 735 | spin_lock_irq(phba->host->host_lock); |
738 | list_add_tail(&cmdiocb->list, &phba->lpfc_iocb_list); | 736 | lpfc_sli_release_iocbq(phba, cmdiocb); |
739 | spin_unlock_irq(phba->host->host_lock); | 737 | spin_unlock_irq(phba->host->host_lock); |
740 | return; | 738 | return; |
741 | } | 739 | } |