From 3225c8e3b87a4be324abddaed3d029ad2a93b1a5 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Fri, 19 Apr 2019 10:39:49 +0530 Subject: [PATCH] gpu: nvgpu: address CCM deviations for nvgpu_pmu_rpc_handler nvgpu_pmu_rpc_handler CCM value was higher than 10. Move the unit specific rpc handling to new function pmu_rpc_handler. JIRA NVGPU-3194 Change-Id: I0cd0576ab626d7fb9713df39ce43d34746fcfad6 Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/2101939 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/pmu/ipc/pmu_msg.c | 48 +++++++++++++--------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_msg.c b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_msg.c index 8d8784253..a42b3e741 100644 --- a/drivers/gpu/nvgpu/common/pmu/ipc/pmu_msg.c +++ b/drivers/gpu/nvgpu/common/pmu/ipc/pmu_msg.c @@ -537,28 +537,11 @@ int nvgpu_pmu_process_message(struct nvgpu_pmu *pmu) return 0; } -void nvgpu_pmu_rpc_handler(struct gk20a *g, struct pmu_msg *msg, - void *param, u32 status) +static void pmu_rpc_handler(struct gk20a *g, struct pmu_msg *msg, + struct nv_pmu_rpc_header rpc, + struct rpc_handler_payload *rpc_payload) { - struct nv_pmu_rpc_header rpc; struct nvgpu_pmu *pmu = &g->pmu; - struct rpc_handler_payload *rpc_payload = - (struct rpc_handler_payload *)param; - - if (nvgpu_can_busy(g) == 0) { - return ; - } - - (void) memset(&rpc, 0, sizeof(struct nv_pmu_rpc_header)); - nvgpu_memcpy((u8 *)&rpc, (u8 *)rpc_payload->rpc_buff, - sizeof(struct nv_pmu_rpc_header)); - - if (rpc.flcn_status != 0U) { - nvgpu_err(g, - "failed RPC response, unit-id=0x%x, func=0x%x, status=0x%x", - rpc.unit_id, rpc.function, rpc.flcn_status); - goto exit; - } switch (msg->hdr.unit_id) { case PMU_UNIT_ACR: @@ -589,6 +572,31 @@ void nvgpu_pmu_rpc_handler(struct gk20a *g, struct pmu_msg *msg, rpc.flcn_status); break; } +} + +void nvgpu_pmu_rpc_handler(struct gk20a *g, struct pmu_msg *msg, + void *param, u32 status) +{ + struct nv_pmu_rpc_header rpc; + struct rpc_handler_payload *rpc_payload = + (struct rpc_handler_payload *)param; + + if (nvgpu_can_busy(g) == 0) { + return; + } + + (void) memset(&rpc, 0, sizeof(struct nv_pmu_rpc_header)); + nvgpu_memcpy((u8 *)&rpc, (u8 *)rpc_payload->rpc_buff, + sizeof(struct nv_pmu_rpc_header)); + + if (rpc.flcn_status != 0U) { + nvgpu_err(g, + "failed RPC response, unit-id=0x%x, func=0x%x, status=0x%x", + rpc.unit_id, rpc.function, rpc.flcn_status); + goto exit; + } + + pmu_rpc_handler(g, msg, rpc, rpc_payload); exit: rpc_payload->complete = true;