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 <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2101939
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sagar Kamble
2019-04-19 10:39:49 +05:30
committed by mobile promotions
parent b31eee15b4
commit 3225c8e3b8

View File

@@ -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;