summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Dagenais <jeff.dagenais@gmail.com>2019-04-18 17:36:17 -0700
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2019-12-13 13:26:58 -0800
commit3ce7063666504951db56761b08ec371a19ec689d (patch)
tree80020333c2e280dcbfb1c09de3ae253f8d58ff4e
parent9c8125defb8aee4ced0bcefc21b0aa17ae3810d2 (diff)
downloadmeta-xilinx-3ce7063666504951db56761b08ec371a19ec689d.tar.gz
kernel-module-mali: add patch to check dma_map_page error
This fixes an error when using the module in a kernel configured with the CONFIG_DMA_API_DEBUG flag. utgard fd4b0000.gpu: DMA-API: device driver failed to check map error[device address=0x00000000325b0000] [size=4096 bytes] [mapped as page] ... [<ffffff80082f72bc>] check_unmap+0x44c/0x7e8 [<ffffff80082f76b8>] debug_dma_unmap_page+0x60/0x68 [<ffffff8000622e60>] mali_mem_os_alloc_pages+0x230/0x498 [mali] ... Acked-by: Hyun Kwon <hyun.kwon@xilinx.com> Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb1
-rw-r--r--meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch17
2 files changed, 18 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
index fe2fbdcf..be9e7197 100644
--- a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali.bb
@@ -24,6 +24,7 @@ SRC_URI = " \
24 file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\ 24 file://0012-linux-mali_memory_os_alloc-Remove-__GFP_COLD.patch\
25 file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\ 25 file://0013-linux-mali_memory_secure-Add-header-file-dma-direct..patch\
26 file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\ 26 file://0014-linux-mali_-timer-Get-rid-of-init_timer.patch\
27 file://0015-fix-driver-failed-to-check-map-error.patch \
27 " 28 "
28SRC_URI[md5sum] = "8f04ae86957fd56197ad5a9d017b84ff" 29SRC_URI[md5sum] = "8f04ae86957fd56197ad5a9d017b84ff"
29SRC_URI[sha256sum] = "bfd14fa3f75a71d4ba313534e651ca1c58dc354e882c0b39867e335882a06350" 30SRC_URI[sha256sum] = "bfd14fa3f75a71d4ba313534e651ca1c58dc354e882c0b39867e335882a06350"
diff --git a/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch
new file mode 100644
index 00000000..5363c37e
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali/0015-fix-driver-failed-to-check-map-error.patch
@@ -0,0 +1,17 @@
1Index: mali/linux/mali_memory_os_alloc.c
2===================================================================
3--- mali.orig/linux/mali_memory_os_alloc.c
4+++ mali/linux/mali_memory_os_alloc.c
5@@ -239,8 +239,10 @@ int mali_mem_os_alloc_pages(mali_mem_os_
6 /* Ensure page is flushed from CPU caches. */
7 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
8 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
9- dma_unmap_page(&mali_platform_device->dev, dma_addr,
10- _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
11+ err = dma_mapping_error(&mali_platform_device->dev, dma_addr);
12+ if (likely(!err))
13+ dma_unmap_page(&mali_platform_device->dev, dma_addr,
14+ _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
15 dma_addr = dma_map_page(&mali_platform_device->dev, new_page,
16 0, _MALI_OSK_MALI_PAGE_SIZE, DMA_BIDIRECTIONAL);
17