summaryrefslogtreecommitdiffstats
path: root/driver/kmem.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-02 02:49:28 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-02 02:49:28 +0100
commit3c58980b3ca558096340e51c215897e8614ba00a (patch)
tree54d5f8cf48c7331586ed110a548b33b161f8093e /driver/kmem.c
parentadc657ebcd01ecc2cc5f110453ef00dffde2d5c0 (diff)
parenta5da7db50d02878b6d9c844b18d0d3f8ccf6c62b (diff)
downloadpcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.gz
pcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.bz2
pcitool-3c58980b3ca558096340e51c215897e8614ba00a.tar.xz
pcitool-3c58980b3ca558096340e51c215897e8614ba00a.zip
Distinguish between hardware and bus addresses in pcilib and fix cli reading from DMA when very low DMA timeout is set
Diffstat (limited to 'driver/kmem.c')
-rw-r--r--driver/kmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver/kmem.c b/driver/kmem.c
index 805ace1..9bc1eb7 100644
--- a/driver/kmem.c
+++ b/driver/kmem.c
@@ -86,7 +86,8 @@ int pcidriver_kmem_alloc(pcidriver_privdata_t *privdata, kmem_handle_t *kmem_han
kmem_handle->handle_id = kmem_entry->id;
- kmem_handle->pa = (unsigned long)(kmem_entry->dma_handle);
+ kmem_handle->ba = (unsigned long)(kmem_entry->dma_handle);
+ kmem_handle->pa = virt_to_phys((void*)kmem_entry->cpua);
kmem_handle->flags = KMEM_FLAG_REUSED;
if (kmem_entry->refs&KMEM_REF_HW) kmem_handle->flags |= KMEM_FLAG_REUSED_HW;
@@ -197,7 +198,8 @@ int pcidriver_kmem_alloc(pcidriver_privdata_t *privdata, kmem_handle_t *kmem_han
kmem_entry->size = kmem_handle->size;
kmem_entry->cpua = (unsigned long)retptr;
- kmem_handle->pa = (unsigned long)(kmem_entry->dma_handle);
+ kmem_handle->ba = (unsigned long)(kmem_entry->dma_handle);
+ kmem_handle->pa = virt_to_phys(retptr);
kmem_entry->mode = 1;
if (kmem_handle->flags&KMEM_FLAG_REUSE) {