From 3e9aa581b61a3ecbcf01a8988b1d12a8af8e2a45 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 9 Jan 2018 02:50:08 -0800 Subject: gpu: nvgpu: skip comptag re-initialization In case we need to re-initialize GR after floorsweeping TPC, gp10b_ltc_init_comptags() will try to allocate comptag memory again Skip this during re-initialization since it is unnecessary to re-allocate all those buffers Comptag buffer size is 33MB and reallocating causes huge memory leak anyways Bug 2031635 Change-Id: I935f96eb133283d6f935589c0e581e0997e980e2 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1634737 Reviewed-by: Bharat Nihalani GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/ltc_gp10b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp10b/ltc_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c index bf95f1fd..d191d778 100644 --- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c @@ -1,7 +1,7 @@ /* * GP10B L2 * - * 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"), @@ -88,6 +88,10 @@ int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) if (max_comptag_lines == 0) return 0; + /* Already initialized */ + if (gr->cacheline_size) + return 0; + if (max_comptag_lines > hw_max_comptag_lines) max_comptag_lines = hw_max_comptag_lines; -- cgit v1.2.2