diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-23 20:29:16 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-23 20:29:16 (GMT) |
commit | b23c9cc0ce652089a2f0af8c7f1541f10dc9b5db (patch) | |
tree | d2e429bbb74c268c071790761e4a2b59d96ea3f7 /drivers/scsi/lpfc/lpfc_sli.c | |
parent | 1e8352784abaedb424e63fa700e93e6c1307785f (diff) | |
parent | cfb37ae1e9d31fe2c1d21734ab51405e0c3afb7e (diff) | |
download | linux-fsl-qoriq-b23c9cc0ce652089a2f0af8c7f1541f10dc9b5db.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (25 commits)
[SCSI] qlogicpt: section fixes
[SCSI] mvsas: convert from rough draft to working driver
[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver
[SCSI] libsas: correctly flush the LU queue on error recovery
[SCSI] aic94xx: fix sequencer hang on error recovery
[SCSI] st: compile fix when DEBUG set to one
[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb
[SCSI] stex: stex_direct_copy shouldn't call dma_map_sg
[SCSI] lpfc: Balance locking
[SCSI] qla4xxx: fix up residual handling
[SCSI] libsas: fix error handling
[SCSI] arcmsr: fix message allocation
[SCSI] mptbase: fix use-after-free's
[SCSI] iscsi transport: make 2 functions static
[SCSI] lpfc: make lpfc_disable_node() static
[SCSI] ips: fix data buffer accessors conversion bug
[SCSI] gdth: don't call pci_free_consistent under spinlock
[SCSI] qla2xxx: fix compile warning for printk format
[SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic
[SCSI] scsi_debug: disable clustering
...
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index f532064..fc0d950 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -648,28 +648,24 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count) unsigned long flags; struct hbq_dmabuf *hbq_buffer; - if (!phba->hbqs[hbqno].hbq_alloc_buffer) { + if (!phba->hbqs[hbqno].hbq_alloc_buffer) return 0; - } start = phba->hbqs[hbqno].buffer_count; end = count + start; - if (end > lpfc_hbq_defs[hbqno]->entry_count) { + if (end > lpfc_hbq_defs[hbqno]->entry_count) end = lpfc_hbq_defs[hbqno]->entry_count; - } /* Check whether HBQ is still in use */ spin_lock_irqsave(&phba->hbalock, flags); - if (!phba->hbq_in_use) { - spin_unlock_irqrestore(&phba->hbalock, flags); - return 0; - } + if (!phba->hbq_in_use) + goto out; /* Populate HBQ entries */ for (i = start; i < end; i++) { hbq_buffer = (phba->hbqs[hbqno].hbq_alloc_buffer)(phba); if (!hbq_buffer) - return 1; + goto err; hbq_buffer->tag = (i | (hbqno << 16)); if (lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer)) phba->hbqs[hbqno].buffer_count++; @@ -677,8 +673,12 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count) (phba->hbqs[hbqno].hbq_free_buffer)(phba, hbq_buffer); } + out: spin_unlock_irqrestore(&phba->hbalock, flags); return 0; + err: + spin_unlock_irqrestore(&phba->hbalock, flags); + return 1; } int |