From 4ce9c114d58ba720526c56c527f0dba06e0001f5 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 5 Nov 2018 15:37:38 -0800 Subject: [PATCH] gpu: nvgpu: Fix secure buffer size for 64K PAGES Increment secure buffer size by 64K when page size is 64K. This fixes the secure buffer allocation issue as otherwise the buffer runs out of space. Bug 2441531 Change-Id: I16741341bcaca2fee093adef4c461a42124cd928 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1943609 Reviewed-by: Rohit Khanna Tested-by: Rohit Khanna GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index 565641cef..e2912b993 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -630,6 +630,9 @@ int gk20a_tegra_init_secure_alloc(struct gk20a_platform *platform) if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) return 0; +#if PAGE_SIZE > 4096 + platform->secure_buffer_size += SZ_64K; +#endif dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, __DMA_ATTR(attrs)); (void)dma_alloc_attrs(&tegra_vpr_dev, platform->secure_buffer_size, &iova, GFP_KERNEL, __DMA_ATTR(attrs));