From 612acdc86b520a6c7d9e68058bb7b0d22c0e7bc8 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 6 Apr 2017 12:33:42 -0700 Subject: gpu: nvgpu: boardobj: Use new error macros gk20a_err() and gk20a_warn() require a struct device pointer, which is not portable across operating systems. The new nvgpu_err() and nvgpu_warn() macros take struct gk20a pointer. Convert code to use the more portable macros. JIRA NVGPU-16 Change-Id: I4a5c99c2ba33140e1cf876958ed753c42613bd52 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1457350 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/boardobj/boardobjgrp.c | 44 ++++++++++++--------------- drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c | 2 +- drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c | 2 +- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp.c b/drivers/gpu/nvgpu/boardobj/boardobjgrp.c index d9ba00a0..2c2238e1 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobjgrp.c +++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp.c @@ -193,14 +193,14 @@ u32 boardobjgrp_pmuinithandle_impl(struct gk20a *g, status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp, &pboardobjgrp->pmu.set); if (status) { - gk20a_err(dev_from_gk20a(g), "failed to init pmu set cmd"); + nvgpu_err(g, "failed to init pmu set cmd"); goto boardobjgrp_pmuinithandle_exit; } status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp, &pboardobjgrp->pmu.getstatus); if (status) { - gk20a_err(dev_from_gk20a(g), "failed to init get status command"); + nvgpu_err(g, "failed to init get status command"); goto boardobjgrp_pmuinithandle_exit; } @@ -212,7 +212,7 @@ u32 boardobjgrp_pmuinithandle_impl(struct gk20a *g, /* Send the BOARDOBJGRP to the pmu via RM_PMU_BOARDOBJ_CMD_GRP. */ status = pboardobjgrp->pmuset(g, pboardobjgrp); if (status) - gk20a_err(dev_from_gk20a(g), "failed to send boardobg grp to PMU"); + nvgpu_err(g, "failed to send boardobg grp to PMU"); boardobjgrp_pmuinithandle_exit: return status; @@ -277,8 +277,7 @@ u32 boardobjgrp_pmudatainit_legacy(struct gk20a *g, /* Obtain pointer to the current instance of the Object from the Group */ pboardobj = pboardobjgrp->objgetbyidx(pboardobjgrp, index); if (NULL == pboardobj) { - gk20a_err(dev_from_gk20a(g), - "could not get object instance"); + nvgpu_err(g, "could not get object instance"); status = -EINVAL; goto boardobjgrppmudatainit_legacy_done; } @@ -287,15 +286,14 @@ u32 boardobjgrp_pmudatainit_legacy(struct gk20a *g, (struct nv_pmu_boardobjgrp *)pboardobjgrppmu, &ppmudata, index); if (status) { - gk20a_err(dev_from_gk20a(g), - "could not get object instance"); + nvgpu_err(g, "could not get object instance"); goto boardobjgrppmudatainit_legacy_done; } /* Initialize the PMU Data */ status = pboardobj->pmudatainit(g, pboardobj, ppmudata); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "could not parse pmu for device %d", index); goto boardobjgrppmudatainit_legacy_done; } @@ -326,8 +324,7 @@ u32 boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pboardobjgrppmu, pboardobjgrp->mask); if (status) { - gk20a_err(dev_from_gk20a(g), - "unable to init boardobjgrp pmuhdr data"); + nvgpu_err(g, "unable to init boardobjgrp pmuhdr data"); goto boardobjgrppmudatainit_super_done; } @@ -336,15 +333,14 @@ u32 boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp (struct nv_pmu_boardobjgrp *)pboardobjgrppmu, &ppmudata, index); if (status) { - gk20a_err(dev_from_gk20a(g), - "could not get object instance"); + nvgpu_err(g, "could not get object instance"); goto boardobjgrppmudatainit_super_done; } /* Initialize the PMU Data and send to PMU */ status = pboardobj->pmudatainit(g, pboardobj, ppmudata); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "could not parse pmu for device %d", index); goto boardobjgrppmudatainit_super_done; } @@ -390,8 +386,7 @@ u32 boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp) status = pboardobjgrp->pmudatainit(g, pboardobjgrp, pcmd->buf); if (status) { - gk20a_err(dev_from_gk20a(g), - "could not parse pmu data"); + nvgpu_err(g, "could not parse pmu data"); goto boardobjgrp_pmuset_exit; } @@ -415,7 +410,7 @@ u32 boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp) status = boardobjgrp_pmucmdsend(g, pboardobjgrp, pcmd); if (status) { - gk20a_err(dev_from_gk20a(g), "could not send SET CMD to PMU"); + nvgpu_err(g, "could not send SET CMD to PMU"); goto boardobjgrp_pmuset_exit; } @@ -484,7 +479,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp, status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pcmd->buf, mask); if (status) { - gk20a_err(dev_from_gk20a(g), "could not init PMU HDR data"); + nvgpu_err(g, "could not init PMU HDR data"); goto boardobjgrp_pmugetstatus_exit; } @@ -493,8 +488,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp, status = boardobjgrp_pmucmdsend(g, pboardobjgrp, &pboardobjgrp->pmu.getstatus); if (status) { - gk20a_err(dev_from_gk20a(g), - "could not send GET_STATUS cmd to PMU"); + nvgpu_err(g, "could not send GET_STATUS cmd to PMU"); goto boardobjgrp_pmugetstatus_exit; } @@ -668,7 +662,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, pgrpmsg = &msg->msg.boardobj.grp; if (pgrpmsg->class_id != pboardobjgrp->pmu.classid) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "Unrecognized GRP type: unit %x class id=0x%02x cmd id %x", msg->hdr.unit_id, pboardobjgrp->pmu.classid, pgrpcmd->id); @@ -676,7 +670,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, } if (msg->msg.boardobj.msg_type != pgrpcmd->msgid) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "unsupported msg for unit %x class %x cmd id %x msg %x", msg->hdr.unit_id, pboardobjgrp->pmu.classid, pgrpcmd->id, msg->msg.boardobj.msg_type); @@ -684,7 +678,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, } if (msg->msg.boardobj.grp_set.flcn_status != 0) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "cmd abort for unit %x class %x cmd id %x status %x", msg->hdr.unit_id, pboardobjgrp->pmu.classid, pgrpcmd->id, @@ -695,7 +689,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, phandlerparams->success = pgrpmsg->b_success ? 1 : 0; if (!pgrpmsg->b_success) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "failed GRPCMD: msgtype=0x%x, classid=0x%x, cmd id %x", pgrpmsg->msg_type, pgrpmsg->class_id, pgrpcmd->id); @@ -756,7 +750,7 @@ static u32 boardobjgrp_pmucmdsend(struct gk20a *g, (void *)&handlerparams, &seqdesc, ~0); if (status) { - gk20a_err(dev_from_gk20a(g), + nvgpu_err(g, "unable to post boardobj grp cmd for unit %x cmd id %x", cmd.hdr.unit_id, pcmd->id); goto boardobjgrp_pmucmdsend_exit; @@ -765,7 +759,7 @@ static u32 boardobjgrp_pmucmdsend(struct gk20a *g, gk20a_get_gr_idle_timeout(g), &handlerparams.success, 1); if (handlerparams.success == 0) { - gk20a_err(dev_from_gk20a(g), "could not process cmd\n"); + nvgpu_err(g, "could not process cmd"); status = -ETIMEDOUT; goto boardobjgrp_pmucmdsend_exit; } diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c index 2510f636..eb692fa7 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c +++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c @@ -82,7 +82,7 @@ u32 boardobjgrp_pmuhdrdatainit_e255(struct gk20a *g, mask->bitcount, &pgrpe255->obj_mask.super); if (status) { - gk20a_err(dev_from_gk20a(g), "e255 init:failed export grpmask"); + nvgpu_err(g, "e255 init:failed export grpmask"); return status; } diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c index 70b3c8f0..3af86408 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c +++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c @@ -81,7 +81,7 @@ u32 boardobjgrp_pmuhdrdatainit_e32(struct gk20a *g, mask->bitcount, &pgrpe32->obj_mask.super); if (status) { - gk20a_err(dev_from_gk20a(g), "e32 init:failed export grpmask"); + nvgpu_err(g, "e32 init:failed export grpmask"); return status; } -- cgit v1.2.2