From c28e73ee2f92d1d287637a22d40d170b42771f96 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Sat, 1 Sep 2018 14:05:36 -0700 Subject: gpu: nvgpu: fix race condition in pmu_rpc_handler There was a race condition between pmu_rpc_handler and nvgpu_pmu_rpc_execute. The later could free the buffer before pmu_rpc_handler could access related data. Added explicit field in rpc_payload, so that nvgpu_pmu_rpc_execute can wait until pmu_rpc_handler completes. Bug 2331655 Change-Id: Ic2653524159eff10504b9c2625b5241610b5f5f0 Reviewed-on: https://git-master.nvidia.com/r/1811299 Signed-off-by: Vaikundanathan S Reviewed-on: https://git-master.nvidia.com/r/1817582 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/pmu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h index 81abdb24..7283755a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h @@ -192,6 +192,7 @@ typedef void (*pmu_callback)(struct gk20a *, struct pmu_msg *, void *, u32, struct rpc_handler_payload { void *rpc_buff; bool is_mem_free_set; + bool complete; }; struct pmu_rpc_desc { -- cgit v1.2.2