From 356812d2c49d3548d0f0437b5dd70676a83e2e96 Mon Sep 17 00:00:00 2001 From: Rajesh Devaraj Date: Mon, 6 Feb 2023 19:44:59 +0000 Subject: [PATCH] gpu: nvgpu: update debug print in rpc recieve To aid debugging in the RPC receive path, this patch updates debug prints to include the received physical address and nvgpu mem address. JIRA NVGPU-9283 Change-Id: I71917c1ec6594ae57f836df3968c10ce4b1d1bf3 Signed-off-by: Rajesh Devaraj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2854022 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: svc-mobile-misra Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/sim/sim.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/common/sim/sim.c b/drivers/gpu/nvgpu/common/sim/sim.c index a371713de..e5db371cf 100644 --- a/drivers/gpu/nvgpu/common/sim/sim.c +++ b/drivers/gpu/nvgpu/common/sim/sim.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2023, 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"), @@ -134,6 +134,7 @@ static inline u32 *sim_recv_ring_bfr(struct gk20a *g, u32 byte_offset) static int rpc_recv_poll(struct gk20a *g) { u64 recv_phys_addr; + u64 nvgpu_mem_addr; /* XXX This read is not required (?) */ /*pVGpu->recv_ring_get = VGPU_REG_RD32(pGpu, NV_VGPU_RECV_GET);*/ @@ -157,10 +158,14 @@ static int rpc_recv_poll(struct gk20a *g) recv_phys_addr = (u64)recv_phys_addr_hi << 32 | (u64)recv_phys_addr_lo << sim_dma_addr_lo_b(); - if (recv_phys_addr != - nvgpu_mem_get_addr(g, &g->sim->msg_bfr)) { - nvgpu_err(g, "%s Error in RPC reply", - __func__); + nvgpu_mem_addr = nvgpu_mem_get_addr(g, &g->sim->msg_bfr); + + if (recv_phys_addr != nvgpu_mem_addr) { + nvgpu_err(g, "%s Error in RPC reply: " + "recv_phys_addr(0x%llx), " + "nvgpu_mem_addr(0x%llx)", + __func__, recv_phys_addr, + nvgpu_mem_addr); return -1; }