summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGowtham Tammana2020-03-10 14:17:12 -0500
committerGowtham Tammana2020-03-10 14:21:45 -0500
commit2a4fbe8353fa56011a613aeeaf69e274cd07a825 (patch)
treeff939d5271b93ac4006ae37802ea5f79e15d5c5a
parentbd1c9751af7c693bdf1a0e6b8b96226305d45a8c (diff)
downloadti-gc320-driver-ti-5.0.11.p7-k5.4.tar.gz
ti-gc320-driver-ti-5.0.11.p7-k5.4.tar.xz
ti-gc320-driver-ti-5.0.11.p7-k5.4.zip
km: Pass device handle for dma APIsti-5.0.11.p7-k5.4
NULL is being passed as device handle for some of the dma_* api. Change it to pass the right device handle. Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rwxr-xr-xsrc/hal/os/linux/kernel/gc_hal_kernel_os.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/hal/os/linux/kernel/gc_hal_kernel_os.c b/src/hal/os/linux/kernel/gc_hal_kernel_os.c
index bfc364f..85e0af5 100755
--- a/src/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/src/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -1182,6 +1182,9 @@ gckOS_MapMemory(
1182{ 1182{
1183 PLINUX_MDL_MAP mdlMap; 1183 PLINUX_MDL_MAP mdlMap;
1184 PLINUX_MDL mdl = (PLINUX_MDL)Physical; 1184 PLINUX_MDL mdl = (PLINUX_MDL)Physical;
1185#ifndef NO_DMA_COHERENT
1186 struct device *dev;
1187#endif
1185 1188
1186 gcmkHEADER_ARG("Os=0x%X Physical=0x%X Bytes=%lu", Os, Physical, Bytes); 1189 gcmkHEADER_ARG("Os=0x%X Physical=0x%X Bytes=%lu", Os, Physical, Bytes);
1187 1190
@@ -1277,7 +1280,8 @@ gckOS_MapMemory(
1277 } 1280 }
1278 1281
1279#ifndef NO_DMA_COHERENT 1282#ifndef NO_DMA_COHERENT
1280 if (dma_mmap_wc(gcvNULL, 1283 dev = &Os->device->platform->device->dev;
1284 if (dma_mmap_wc(dev,
1281 mdlMap->vma, 1285 mdlMap->vma,
1282 mdl->addr, 1286 mdl->addr,
1283 mdl->dmaHandle, 1287 mdl->dmaHandle,
@@ -1599,9 +1603,9 @@ gckOS_AllocateNonPagedMemory(
1599 1603
1600#ifndef NO_DMA_COHERENT 1604#ifndef NO_DMA_COHERENT
1601#ifdef CONFIG_ARM64 1605#ifdef CONFIG_ARM64
1602 addr = dma_alloc_coherent(gcvNULL, 1606 addr = dma_alloc_coherent(dev,
1603#else 1607#else
1604 addr = dma_alloc_wc(gcvNULL, 1608 addr = dma_alloc_wc(dev,
1605#endif 1609#endif
1606 mdl->numPages * PAGE_SIZE, 1610 mdl->numPages * PAGE_SIZE,
1607 &mdl->dmaHandle, 1611 &mdl->dmaHandle,
@@ -1727,7 +1731,7 @@ gckOS_AllocateNonPagedMemory(
1727 } 1731 }
1728 1732
1729#ifndef NO_DMA_COHERENT 1733#ifndef NO_DMA_COHERENT
1730 if (dma_mmap_coherent(gcvNULL, 1734 if (dma_mmap_coherent(dev,
1731 mdlMap->vma, 1735 mdlMap->vma,
1732 mdl->addr, 1736 mdl->addr,
1733 mdl->dmaHandle, 1737 mdl->dmaHandle,
@@ -1865,6 +1869,8 @@ gceSTATUS gckOS_FreeNonPagedMemory(
1865#ifdef NO_DMA_COHERENT 1869#ifdef NO_DMA_COHERENT
1866 unsigned size; 1870 unsigned size;
1867 gctPOINTER vaddr; 1871 gctPOINTER vaddr;
1872#else
1873 struct device *dev;
1868#endif /* NO_DMA_COHERENT */ 1874#endif /* NO_DMA_COHERENT */
1869 1875
1870 gcmkHEADER_ARG("Os=0x%X Bytes=%lu Physical=0x%X Logical=0x%X", 1876 gcmkHEADER_ARG("Os=0x%X Bytes=%lu Physical=0x%X Logical=0x%X",
@@ -1882,10 +1888,11 @@ gceSTATUS gckOS_FreeNonPagedMemory(
1882 MEMORY_LOCK(Os); 1888 MEMORY_LOCK(Os);
1883 1889
1884#ifndef NO_DMA_COHERENT 1890#ifndef NO_DMA_COHERENT
1891 dev = &Os->device->platform->device->dev;
1885#ifdef CONFIG_ARM64 1892#ifdef CONFIG_ARM64
1886 dma_free_coherent(gcvNULL, 1893 dma_free_coherent(dev,
1887#else 1894#else
1888 dma_free_wc(gcvNULL, 1895 dma_free_wc(dev,
1889#endif 1896#endif
1890 mdl->numPages * PAGE_SIZE, 1897 mdl->numPages * PAGE_SIZE,
1891 mdl->addr, 1898 mdl->addr,