diff options
author | Maciej Sosnowski <maciej.sosnowski@intel.com> | 2009-04-23 06:31:51 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-05-12 17:41:47 -0400 |
commit | 4f005dbe5584fe54c9f6d6d4f0acd3fb29be84da (patch) | |
tree | d9a4add9553af6c50fae59a79e9ab217945a7090 /include | |
parent | ca50a51e890b0a62b44b5642c1ba5049909e5a8b (diff) |
ioatdma: fix "ioatdma frees DMA memory with wrong function"
as reported by Alexander Beregalov <a.beregalov@gmail.com>
ioatdma 0000:00:08.0: DMA-API: device driver frees DMA memory with
wrong function [device address=0x000000007f76f800] [size=2000 bytes]
[map
ped as single] [unmapped as page]
The ioatdma driver was unmapping all regions
(either allocated as page or single) using unmap_page.
This patch lets dma driver recognize if unmap_single or unmap_page should be used.
It introduces two new dma control flags:
DMA_COMPL_SRC_UNMAP_SINGLE and DMA_COMPL_DEST_UNMAP_SINGLE.
They should be set to indicate dma driver to do dma-unmapping as single
(first one for the source, tha latter for the destination).
If respective flag is not set, the driver assumes dma-unmapping as page.
Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Reported-by: Alexander Beregalov <a.beregalov@gmail.com>
Tested-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmaengine.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 2e2aa3df170c..ffefba81c818 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -78,12 +78,18 @@ enum dma_transaction_type { | |||
78 | * dependency chains | 78 | * dependency chains |
79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | 80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) |
81 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | ||
82 | * (if not set, do the source dma-unmapping as page) | ||
83 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | ||
84 | * (if not set, do the destination dma-unmapping as page) | ||
81 | */ | 85 | */ |
82 | enum dma_ctrl_flags { | 86 | enum dma_ctrl_flags { |
83 | DMA_PREP_INTERRUPT = (1 << 0), | 87 | DMA_PREP_INTERRUPT = (1 << 0), |
84 | DMA_CTRL_ACK = (1 << 1), | 88 | DMA_CTRL_ACK = (1 << 1), |
85 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | 89 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), |
86 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 90 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), |
91 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | ||
92 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | /** | 95 | /** |