From 872be3a4ac16f4d139a9597b3fdae4355cb4baf2 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Wed, 17 Jan 2018 12:09:38 -0800 Subject: gpu: nvgpu: ramin_big_page_size default val is set to 64kb -MMU_CTRL_USE_PDB_BIG_PAGE_SIZE is set to TRUE and hence RAMIN_BIG_PAGE_SIZE should be set to 64KB i.e. val 1. By default this is set to 128KB i.e. val 0. -This change will also fix an issue where perfbuffer_enable and nvgpu_init_hwpm function pass 0 as big page size while initializing inst_block and due to which ramin_big_page_size does not get updated to 64KB and remains set to unsupported 128KB value. -Volta supports 64KB for big pages. Selecting 128KB for big pages results in an UNBOUND_INSTANCE fault. Bug 200327596 Change-Id: Ie304e4e5ff7bedaead27e9380d64c59013dd64ca Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1639540 Reviewed-by: svc-mobile-coverity Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/mm_gp10b.c | 3 ++- .../nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h | 22 +++++++++++++++++++++- .../nvgpu/include/nvgpu/hw/gv11b/hw_ram_gv11b.h | 22 +++++++++++++++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c index 8cefbd3e..33591edc 100644 --- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c @@ -431,8 +431,9 @@ void gp10b_mm_init_pdb(struct gk20a *g, struct nvgpu_mem *inst_block, ram_in_page_dir_base_target_sys_mem_ncoh_f(), ram_in_page_dir_base_target_vid_mem_f()) | ram_in_page_dir_base_vol_true_f() | + ram_in_big_page_size_64kb_f() | ram_in_page_dir_base_lo_f(pdb_addr_lo) | - 1 << 10); + ram_in_use_ver2_pt_format_true_f()); nvgpu_mem_wr32(g, inst_block, ram_in_page_dir_base_hi_w(), ram_in_page_dir_base_hi_f(pdb_addr_hi)); diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h index a94fc0a2..cc83f520 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_ram_gp10b.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2018, 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"), @@ -124,6 +124,26 @@ static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void) { return 0x20U; } +static inline u32 ram_in_use_ver2_pt_format_f(u32 v) +{ + return (v & 0x1U) << 10U; +} +static inline u32 ram_in_use_ver2_pt_format_m(void) +{ + return 0x1U << 10U; +} +static inline u32 ram_in_use_ver2_pt_format_w(void) +{ + return 128U; +} +static inline u32 ram_in_use_ver2_pt_format_true_f(void) +{ + return 0x400U; +} +static inline u32 ram_in_use_ver2_pt_format_false_f(void) +{ + return 0x0U; +} static inline u32 ram_in_big_page_size_f(u32 v) { return (v & 0x1U) << 11U; diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_ram_gv11b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_ram_gv11b.h index 1191e580..f6134f46 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_ram_gv11b.h +++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gv11b/hw_ram_gv11b.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2018, 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"), @@ -128,6 +128,26 @@ static inline u32 ram_in_page_dir_base_fault_replay_gcc_true_f(void) { return 0x20U; } +static inline u32 ram_in_use_ver2_pt_format_f(u32 v) +{ + return (v & 0x1U) << 10U; +} +static inline u32 ram_in_use_ver2_pt_format_m(void) +{ + return 0x1U << 10U; +} +static inline u32 ram_in_use_ver2_pt_format_w(void) +{ + return 128U; +} +static inline u32 ram_in_use_ver2_pt_format_true_f(void) +{ + return 0x400U; +} +static inline u32 ram_in_use_ver2_pt_format_false_f(void) +{ + return 0x0U; +} static inline u32 ram_in_big_page_size_f(u32 v) { return (v & 0x1U) << 11U; -- cgit v1.2.2