From ae243fa1ebce3b0fcfe4f3c71703909415d02c92 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 3 Jun 2021 17:30:07 -0700 Subject: [PATCH] gpu: nvgpu: set l3_alloc hint based on L3 errata If errata for L3 SCF cache not supported is set, then force l3_alloc hint to false, so that L3 memory traffic will not be generated from nvgpu driver. Bug 3186312 Bug 3288192 Change-Id: Icf776673c2975fdc04cc02bfae28ef26c8deba4d Signed-off-by: Seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2539599 Tested-by: mobile promotions Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: svcacv Reviewed-by: svc-mobile-misra Reviewed-by: svc_kernel_abi Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/mm/gmmu/page_table.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c b/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c index e2963f458..4fe32b526 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu/page_table.c @@ -36,6 +36,9 @@ #include #include #include +#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include +#endif #ifdef CONFIG_NVGPU_TRACE #define nvgpu_gmmu_dbg(g, attrs, fmt, args...) \ @@ -953,6 +956,14 @@ u64 nvgpu_gmmu_map_locked(struct vm_gk20a *vm, #endif attrs.l3_alloc = ((flags & NVGPU_VM_MAP_L3_ALLOC) != 0U); +#if defined(CONFIG_NVGPU_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) + if (nvgpu_is_errata_present(g, NVGPU_ERRATA_3288192) && + (attrs.l3_alloc)) { + nvgpu_gmmu_dbg_v(g, &attrs, + "L3 alloc is requested when L3 cache is not supported"); + attrs.l3_alloc = false; + } +#endif /* * Only allocate a new GPU VA range if we haven't already been passed a