summaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-11-20 06:04:08 +0100
committerSuren A. Chilingaryan <csa@suren.me>2015-11-20 06:04:08 +0100
commit517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1 (patch)
treebc3349f5f682a578050150318f2500a6c8a7a63f /driver
parent2bda41263f2464c271509b0bd9ea9062c239d851 (diff)
downloadpcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.gz
pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.bz2
pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.xz
pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.zip
Support large DMA pages in IPEDMA
Diffstat (limited to 'driver')
-rw-r--r--driver/kmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver/kmem.c b/driver/kmem.c
index 2c72e38..7539ae6 100644
--- a/driver/kmem.c
+++ b/driver/kmem.c
@@ -56,7 +56,7 @@ int pcidriver_kmem_alloc(pcidriver_privdata_t *privdata, kmem_handle_t *kmem_han
return -EINVAL;
}
- if ((kmem_handle->type&PCILIB_KMEM_TYPE_MASK) == PCILIB_KMEM_TYPE_PAGE) {
+ if (((kmem_handle->type&PCILIB_KMEM_TYPE_MASK) == PCILIB_KMEM_TYPE_PAGE)&&(kmem_handle->size == 0)) {
kmem_handle->size = kmem_entry->size;
} else if (kmem_handle->size != kmem_entry->size) {
mod_info("Invalid size of reusable kmem_entry, currently: %lu, but requested: %lu\n", kmem_entry->size, kmem_handle->size);
@@ -151,10 +151,12 @@ int pcidriver_kmem_alloc(pcidriver_privdata_t *privdata, kmem_handle_t *kmem_han
kmem_handle->size = PAGE_SIZE;
else if (kmem_handle->size%PAGE_SIZE)
goto kmem_alloc_mem_fail;
+ else
+ flags |= __GFP_COMP;
retptr = (void*)__get_free_pages(flags, get_order(kmem_handle->size));
kmem_entry->dma_handle = 0;
-
+
if (retptr) {
if (kmem_entry->type == PCILIB_KMEM_TYPE_DMA_S2C_PAGE) {
kmem_entry->direction = PCI_DMA_TODEVICE;