From d505e7f6859e9b73e31546e407262f43fd277415 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Mon, 16 Jan 2017 09:23:46 -0800 Subject: gpu: nvgpu: fix failures in VF table update The variable indicating the size of the buffer for GPC vf points was not reset before the query, thus sporadic failures could happen if the number of available VF points changed on an update Maximum number of points increased to 256. This is the maximum that can fit in the boardobj table bug 200269804 Change-Id: Icb4ae386135a9bb40d4345eb73c5584fecd79147 Signed-off-by: David Nieto Reviewed-on: http://git-master/r/1286028 Reviewed-on: http://git-master/r/1287589 Reviewed-by: svccoveritychecker Reviewed-by: Thomas Fleury GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/clk/clk_arb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/clk') diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index d6cbe137..2dee209e 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -24,7 +24,7 @@ #include "clk/clk_arb.h" -#define MAX_F_POINTS 127 +#define MAX_F_POINTS 256 #define DEFAULT_EVENT_NUMBER 32 struct nvgpu_clk_dev; @@ -685,6 +685,9 @@ static int nvgpu_clk_arb_update_vf_table(struct nvgpu_clk_arb *arb) goto exit_vf_table; } + table->gpc2clk_num_points = MAX_F_POINTS; + table->mclk_num_points = MAX_F_POINTS; + if (clk_domain_get_f_points(arb->g, NVGPU_GPU_CLK_DOMAIN_GPC2CLK, &table->gpc2clk_num_points, arb->gpc2clk_f_points)) { gk20a_err(dev_from_gk20a(g), @@ -692,9 +695,6 @@ static int nvgpu_clk_arb_update_vf_table(struct nvgpu_clk_arb *arb) goto exit_vf_table; } - table->gpc2clk_num_points = MAX_F_POINTS; - table->mclk_num_points = MAX_F_POINTS; - if (clk_domain_get_f_points(arb->g, NVGPU_GPU_CLK_DOMAIN_MCLK, &table->mclk_num_points, arb->mclk_f_points)) { gk20a_err(dev_from_gk20a(g), -- cgit v1.2.2