From ebbbba153372407a2d808d50e3fd08ac1384c66f Mon Sep 17 00:00:00 2001 From: Anup Mahindre Date: Fri, 12 Jun 2020 11:44:08 +0530 Subject: [PATCH] video: tegra: host: nvdla: Avoid contiguos alloc Avoid requesting physically contiguos allocation where it is not required since this can fail in case of fragementation. Bug 200621525 Change-Id: Icdf5f88b5336950212c62f8a7f0469b7b16e0ac5 Signed-off-by: Anup Mahindre Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2360778 Tested-by: Bharat Nihalani Tested-by: mobile promotions Reviewed-by: Bharat Nihalani Reviewed-by: Ken Adams Reviewed-by: Mitch Harwell Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/nvdla/dla_queue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/dla_queue.c b/drivers/video/tegra/host/nvdla/dla_queue.c index 2f31f501..4b966a3e 100644 --- a/drivers/video/tegra/host/nvdla/dla_queue.c +++ b/drivers/video/tegra/host/nvdla/dla_queue.c @@ -71,8 +71,8 @@ static int nvdla_queue_task_pool_alloc(struct platform_device *pdev, /* Allocate the kernel memory needed for the task */ if (queue->task_kmem_size) { - task_pool->kmem_addr = kcalloc(num_tasks, - queue->task_kmem_size, GFP_KERNEL); + size_t kmem_pool_size = num_tasks * queue->task_kmem_size; + task_pool->kmem_addr = vzalloc(kmem_pool_size); if (!task_pool->kmem_addr) { nvhost_err(&pdev->dev, "failed to allocate task_pool->kmem_addr"); @@ -115,7 +115,7 @@ static void nvdla_queue_task_free_pool(struct platform_device *pdev, task_pool->va, task_pool->dma_addr, 0); - kfree(task_pool->kmem_addr); + vfree(task_pool->kmem_addr); task_pool->max_task_cnt = 0; task_pool->alloc_table = 0; }