diff --git a/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache.c b/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache.c index 2e8294123..ff41343ff 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -449,7 +449,7 @@ static void nvgpu_pd_cache_do_free(struct gk20a *g, * fill them with zero. */ if ((nvgpu_iommuable(g)) && - (NVGPU_PD_CACHE_SIZE > PAGE_SIZE) && + (NVGPU_PD_CACHE_SIZE > NVGPU_CPU_SMALL_PAGE_SIZE) && (pd->mem->cpu_va != NULL)) { (void)memset(((u8 *)pd->mem->cpu_va + pd->mem_offs), 0, pd->pd_size); diff --git a/drivers/gpu/nvgpu/include/nvgpu/utils.h b/drivers/gpu/nvgpu/include/nvgpu/utils.h index 2e903f58f..e59e6265e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/utils.h +++ b/drivers/gpu/nvgpu/include/nvgpu/utils.h @@ -36,7 +36,9 @@ * PAGE_SIZE is OS specific and can vary across OSes. Depending on the OS it maybe * defined to 4K or 64K. */ -#define NVGPU_CPU_PAGE_SIZE PAGE_SIZE +#define NVGPU_CPU_PAGE_SIZE PAGE_SIZE + +#define NVGPU_CPU_SMALL_PAGE_SIZE 4096U /** * @file