From 1bf9309f17a01f86821a8b225271ea75bd10ab79 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Thu, 2 Jun 2022 10:56:02 +0530 Subject: [PATCH] gpu: nvgpu: update dma_mask based on H/W compatibility To be able to access the full physical memory range, gpu's dma_mask needs to be set to the max value of H/W compatible range. For example. In order to support from 2GB to 66 GB, GV11B's dma_mask needs to be atleast 37 bits. Set GV11B's dma_mask to 38 bit and T23X's dma_mask to 39 bit. These values are supported by H/W Bug 3656729 Signed-off-by: Debarshi Dutta Change-Id: Icfff3c36a8c9cf074a254fa773c42e18020ae5de Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2723640 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Brad Griffis Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Tested-by: Brad Griffis --- drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c | 4 ++-- drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c index d56a9ba1f..19bb0a4b4 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_ga10b_tegra.c @@ -765,7 +765,7 @@ struct gk20a_platform ga10b_tegra_platform = { * This specifies the maximum contiguous size of a DMA mapping to Linux * kernel's DMA framework. * The IOMMU is capable of mapping all of physical memory and hence - * dma_mask is set to memory size (128GB in this case). + * dma_mask is set to memory size (512GB in this case). * For iGPU, nvgpu executes own dma allocs (e.g. alloc_page()) and * sg_table construction. No IOMMU mapping is required and so dma_mask * value is not important. @@ -773,7 +773,7 @@ struct gk20a_platform ga10b_tegra_platform = { * significant. In this case, IOMMU bit in GPU physical address is not * relevant. */ - .dma_mask = DMA_BIT_MASK(37), + .dma_mask = DMA_BIT_MASK(39), .reset_assert = gp10b_tegra_reset_assert, .reset_deassert = gp10b_tegra_reset_deassert, diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index 88d751374..b0ca6538d 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c @@ -1,7 +1,7 @@ /* * GV11B Tegra Platform Interface * - * Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -307,7 +307,7 @@ struct gk20a_platform gv11b_tegra_platform = { .honors_aperture = true, .unified_memory = true, - .dma_mask = DMA_BIT_MASK(36), + .dma_mask = DMA_BIT_MASK(38), .reset_assert = gp10b_tegra_reset_assert, .reset_deassert = gp10b_tegra_reset_deassert,