diff options
author | James Smart <James.Smart@Emulex.Com> | 2007-08-02 11:10:31 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-08-01 13:24:10 -0400 |
commit | 51ef4c26891a734bc8416b639ad460a8162926bc (patch) | |
tree | 8279e11bf1a0a3200e8aa9bb3d956345ef73533c /drivers/scsi/lpfc/lpfc_mem.c | |
parent | 78b2d852a88cd2a55e3ab632109de045d58b83e3 (diff) |
[SCSI] lpfc 8.2.2 : Miscellaneous Bug Fixes
- Fix vport ndlp ref counting errors
- Fix use after free of ndlp structure
- Use the correct flag to check for LOADING setting.
- Fix driver unload bugs (related to shost references) after link down or rscn
- Fix up HBQ initialization
- Fix port_list locking around driver unload.
- Fix references to hostdata as a phba
- Fix GFFID type offset to work correctly with big endian structure.
- Only call pci_disable_msi if the pci_enable_msi succeeded
- Fix vport_delete wait/fail if in discovery
- Put a reference on the nameservers ndlp when performing CT traffic.
- Remove unbalanced hba unlock.
- Fix up HBQ processing
- Fix lpfc debugfs discovery trace output for ELS rsp cmpl
- Send ADISC when rpi is 0
- Stop FDISC retrying forever
- Unable to retrieve correct config parameter for vport
- Fix sli_validate_fcp_iocb, sli_sum_iocb, sli_abort_iocb to be vport-aware.
- Fix index-out-of-range error in iocb. Spotted by Coverity.
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_mem.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_mem.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c index 3594c469494f..43c3b8a0d76a 100644 --- a/drivers/scsi/lpfc/lpfc_mem.c +++ b/drivers/scsi/lpfc/lpfc_mem.c | |||
@@ -231,21 +231,34 @@ lpfc_mbuf_free(struct lpfc_hba * phba, void *virt, dma_addr_t dma) | |||
231 | return; | 231 | return; |
232 | } | 232 | } |
233 | 233 | ||
234 | void * | 234 | struct hbq_dmabuf * |
235 | lpfc_hbq_alloc(struct lpfc_hba *phba, int mem_flags, dma_addr_t *handle) | 235 | lpfc_els_hbq_alloc(struct lpfc_hba *phba) |
236 | { | 236 | { |
237 | void *ret; | 237 | struct hbq_dmabuf *hbqbp; |
238 | ret = pci_pool_alloc(phba->lpfc_hbq_pool, GFP_ATOMIC, handle); | 238 | |
239 | return ret; | 239 | hbqbp = kmalloc(sizeof(struct hbq_dmabuf), GFP_KERNEL); |
240 | if (!hbqbp) | ||
241 | return NULL; | ||
242 | |||
243 | hbqbp->dbuf.virt = pci_pool_alloc(phba->lpfc_hbq_pool, GFP_KERNEL, | ||
244 | &hbqbp->dbuf.phys); | ||
245 | if (!hbqbp->dbuf.virt) { | ||
246 | kfree(hbqbp); | ||
247 | return NULL; | ||
248 | } | ||
249 | hbqbp->size = LPFC_BPL_SIZE; | ||
250 | return hbqbp; | ||
240 | } | 251 | } |
241 | 252 | ||
242 | void | 253 | void |
243 | lpfc_hbq_free(struct lpfc_hba *phba, void *virt, dma_addr_t dma) | 254 | lpfc_els_hbq_free(struct lpfc_hba *phba, struct hbq_dmabuf *hbqbp) |
244 | { | 255 | { |
245 | pci_pool_free(phba->lpfc_hbq_pool, virt, dma); | 256 | pci_pool_free(phba->lpfc_hbq_pool, hbqbp->dbuf.virt, hbqbp->dbuf.phys); |
257 | kfree(hbqbp); | ||
246 | return; | 258 | return; |
247 | } | 259 | } |
248 | 260 | ||
261 | /* This is ONLY called for the LPFC_ELS_HBQ */ | ||
249 | void | 262 | void |
250 | lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) | 263 | lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) |
251 | { | 264 | { |
@@ -254,9 +267,8 @@ lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) | |||
254 | if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) { | 267 | if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) { |
255 | hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf); | 268 | hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf); |
256 | if (hbq_entry->tag == -1) { | 269 | if (hbq_entry->tag == -1) { |
257 | lpfc_hbq_free(phba, hbq_entry->dbuf.virt, | 270 | (phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer) |
258 | hbq_entry->dbuf.phys); | 271 | (phba, hbq_entry); |
259 | kfree(hbq_entry); | ||
260 | } else { | 272 | } else { |
261 | lpfc_sli_free_hbq(phba, hbq_entry); | 273 | lpfc_sli_free_hbq(phba, hbq_entry); |
262 | } | 274 | } |