From 00e52529a8431a6520b8e1bbcbfa44b4cc86be80 Mon Sep 17 00:00:00 2001 From: Jonathan McCaffrey Date: Thu, 17 Aug 2017 23:51:03 -0700 Subject: gpu: gp10b: add gfxp_wfi_timeout sysfs node Add a sysfs node to allow root user to set PRI_FE_GFXP_WFI_TIMEOUT, for gp10b only, in units of sysclk cycles. Store the set value in a variable, and write the set value to register after GPU is un-railgated. NV_PGRAPH_PRI_FE_GFXP_WFI_TIMEOUT is engine_reset after Bug 1623341. Change default value to be specified in cycles, rather than time. This value is almost the current value in cycles calculated each boot. Bug 1932782 Change-Id: I0a4207e637cd1413a1be95abe2bcce3adccf76fa Reviewed-on: https://git-master.nvidia.com/r/1540939 Signed-off-by: Jonathan McCaffrey Reviewed-on: https://git-master.nvidia.com/r/1580999 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index a6d72907..78be072f 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -49,8 +49,6 @@ #include #include -#define NVGPU_GFXP_WFI_TIMEOUT_US 100LL - bool gr_gp10b_is_valid_class(struct gk20a *g, u32 class_num) { bool valid = false; @@ -2336,11 +2334,8 @@ int gp10b_gr_fuse_override(struct gk20a *g) int gr_gp10b_init_preemption_state(struct gk20a *g) { u32 debug_2; - u64 sysclk_rate; - u32 sysclk_cycles; - - sysclk_rate = g->ops.clk.get_rate(g, CTRL_CLK_DOMAIN_GPCCLK); - sysclk_cycles = (u32)((sysclk_rate * NVGPU_GFXP_WFI_TIMEOUT_US) / 1000000ULL); + struct gr_gk20a *gr = &g->gr; + u32 sysclk_cycles = gr->gfxp_wfi_timeout_count; gk20a_writel(g, gr_fe_gfxp_wfi_timeout_r(), gr_fe_gfxp_wfi_timeout_count_f(sysclk_cycles)); -- cgit v1.2.2