Commit 149021cb authored by James Bottomley's avatar James Bottomley

megaraid: fix a bug in kioc dma buffer deallocation

From: 	Bagalkote, Sreenivas <sreenib@lsil.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 1196c68c
Release Date : Thu Dec 9 19:02:14 EST 2004 - Sreenivas Bagalkote <sreenib@lsil.com>
Current Version : 2.20.4.1 (scsi module), 2.20.2.3 (cmm module)
Older Version : 2.20.4.1 (scsi module), 2.20.2.2 (cmm module)
i. Fix a bug in kioc's dma buffer deallocation
Release Date : Thu Nov 4 18:24:56 EST 2004 - Sreenivas Bagalkote <sreenib@lsil.com> Release Date : Thu Nov 4 18:24:56 EST 2004 - Sreenivas Bagalkote <sreenib@lsil.com>
Current Version : 2.20.4.1 (scsi module), 2.20.2.2 (cmm module) Current Version : 2.20.4.1 (scsi module), 2.20.2.2 (cmm module)
......
...@@ -142,7 +142,7 @@ typedef struct uioc { ...@@ -142,7 +142,7 @@ typedef struct uioc {
caddr_t buf_vaddr; caddr_t buf_vaddr;
dma_addr_t buf_paddr; dma_addr_t buf_paddr;
uint8_t pool_index; int8_t pool_index;
uint8_t free_buf; uint8_t free_buf;
uint8_t timedout; uint8_t timedout;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
* *
* FILE : megaraid_mm.c * FILE : megaraid_mm.c
* Version : v2.20.2.2 (Nov 04 2004) * Version : v2.20.2.3 (Dec 09 2004)
* *
* Common management module * Common management module
*/ */
...@@ -614,23 +614,27 @@ mraid_mm_dealloc_kioc(mraid_mmadp_t *adp, uioc_t *kioc) ...@@ -614,23 +614,27 @@ mraid_mm_dealloc_kioc(mraid_mmadp_t *adp, uioc_t *kioc)
mm_dmapool_t *pool; mm_dmapool_t *pool;
unsigned long flags; unsigned long flags;
if (kioc->pool_index != -1) {
pool = &adp->dma_pool_list[kioc->pool_index]; pool = &adp->dma_pool_list[kioc->pool_index];
/* This routine may be called in non-isr context also */ /* This routine may be called in non-isr context also */
spin_lock_irqsave(&pool->lock, flags); spin_lock_irqsave(&pool->lock, flags);
/* /*
* While attaching the dma buffer, if we didn't get the required * While attaching the dma buffer, if we didn't get the
* buffer from the pool, we would have allocated it at the run time * required buffer from the pool, we would have allocated
* and set the free_buf flag. We must free that buffer. Otherwise, * it at the run time and set the free_buf flag. We must
* just mark that the buffer is not in use * free that buffer. Otherwise, just mark that the buffer is
* not in use
*/ */
if (kioc->free_buf == 1) if (kioc->free_buf == 1)
pci_pool_free(pool->handle, kioc->buf_vaddr, kioc->buf_paddr); pci_pool_free(pool->handle, kioc->buf_vaddr,
kioc->buf_paddr);
else else
pool->in_use = 0; pool->in_use = 0;
spin_unlock_irqrestore(&pool->lock, flags); spin_unlock_irqrestore(&pool->lock, flags);
}
/* Return the kioc to the free pool */ /* Return the kioc to the free pool */
spin_lock_irqsave(&adp->kioc_pool_lock, flags); spin_lock_irqsave(&adp->kioc_pool_lock, flags);
......
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
#include "megaraid_ioctl.h" #include "megaraid_ioctl.h"
#define LSI_COMMON_MOD_VERSION "2.20.2.2" #define LSI_COMMON_MOD_VERSION "2.20.2.3"
#define LSI_COMMON_MOD_EXT_VERSION \ #define LSI_COMMON_MOD_EXT_VERSION \
"(Release Date: Thu Nov 4 17:46:29 EST 2004)" "(Release Date: Thu Dec 9 19:02:14 EST 2004)"
#define LSI_DBGLVL dbglevel #define LSI_DBGLVL dbglevel
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment