ioatdma: fix "ioatdma frees DMA memory with wrong function"
authorMaciej Sosnowski <maciej.sosnowski@intel.com>
Thu, 23 Apr 2009 10:31:51 +0000 (12:31 +0200)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 May 2009 21:41:47 +0000 (14:41 -0700)
commit4f005dbe5584fe54c9f6d6d4f0acd3fb29be84da
treed9a4add9553af6c50fae59a79e9ab217945a7090
parentca50a51e890b0a62b44b5642c1ba5049909e5a8b
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>
drivers/dma/dmaengine.c
drivers/dma/ioat_dma.c
include/linux/dmaengine.h