summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/boardobj/boardobjgrp.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-04-06 15:33:42 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-04-10 15:24:22 -0400
commit612acdc86b520a6c7d9e68058bb7b0d22c0e7bc8 (patch)
tree093f885aa6fec8034c6eb2a4e6b587f0c8b1cb54 /drivers/gpu/nvgpu/boardobj/boardobjgrp.c
parent94b62d68655f1ba45edf57df4a221f16c6562558 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1457350 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj/boardobjgrp.c')
-rw-r--r--drivers/gpu/nvgpu/boardobj/boardobjgrp.c44
1 files changed, 19 insertions, 25 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,
193 status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp, 193 status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
194 &pboardobjgrp->pmu.set); 194 &pboardobjgrp->pmu.set);
195 if (status) { 195 if (status) {
196 gk20a_err(dev_from_gk20a(g), "failed to init pmu set cmd"); 196 nvgpu_err(g, "failed to init pmu set cmd");
197 goto boardobjgrp_pmuinithandle_exit; 197 goto boardobjgrp_pmuinithandle_exit;
198 } 198 }
199 199
200 status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp, 200 status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
201 &pboardobjgrp->pmu.getstatus); 201 &pboardobjgrp->pmu.getstatus);
202 if (status) { 202 if (status) {
203 gk20a_err(dev_from_gk20a(g), "failed to init get status command"); 203 nvgpu_err(g, "failed to init get status command");
204 goto boardobjgrp_pmuinithandle_exit; 204 goto boardobjgrp_pmuinithandle_exit;
205 } 205 }
206 206
@@ -212,7 +212,7 @@ u32 boardobjgrp_pmuinithandle_impl(struct gk20a *g,
212 /* Send the BOARDOBJGRP to the pmu via RM_PMU_BOARDOBJ_CMD_GRP. */ 212 /* Send the BOARDOBJGRP to the pmu via RM_PMU_BOARDOBJ_CMD_GRP. */
213 status = pboardobjgrp->pmuset(g, pboardobjgrp); 213 status = pboardobjgrp->pmuset(g, pboardobjgrp);
214 if (status) 214 if (status)
215 gk20a_err(dev_from_gk20a(g), "failed to send boardobg grp to PMU"); 215 nvgpu_err(g, "failed to send boardobg grp to PMU");
216 216
217boardobjgrp_pmuinithandle_exit: 217boardobjgrp_pmuinithandle_exit:
218 return status; 218 return status;
@@ -277,8 +277,7 @@ u32 boardobjgrp_pmudatainit_legacy(struct gk20a *g,
277 /* Obtain pointer to the current instance of the Object from the Group */ 277 /* Obtain pointer to the current instance of the Object from the Group */
278 pboardobj = pboardobjgrp->objgetbyidx(pboardobjgrp, index); 278 pboardobj = pboardobjgrp->objgetbyidx(pboardobjgrp, index);
279 if (NULL == pboardobj) { 279 if (NULL == pboardobj) {
280 gk20a_err(dev_from_gk20a(g), 280 nvgpu_err(g, "could not get object instance");
281 "could not get object instance");
282 status = -EINVAL; 281 status = -EINVAL;
283 goto boardobjgrppmudatainit_legacy_done; 282 goto boardobjgrppmudatainit_legacy_done;
284 } 283 }
@@ -287,15 +286,14 @@ u32 boardobjgrp_pmudatainit_legacy(struct gk20a *g,
287 (struct nv_pmu_boardobjgrp *)pboardobjgrppmu, 286 (struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
288 &ppmudata, index); 287 &ppmudata, index);
289 if (status) { 288 if (status) {
290 gk20a_err(dev_from_gk20a(g), 289 nvgpu_err(g, "could not get object instance");
291 "could not get object instance");
292 goto boardobjgrppmudatainit_legacy_done; 290 goto boardobjgrppmudatainit_legacy_done;
293 } 291 }
294 292
295 /* Initialize the PMU Data */ 293 /* Initialize the PMU Data */
296 status = pboardobj->pmudatainit(g, pboardobj, ppmudata); 294 status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
297 if (status) { 295 if (status) {
298 gk20a_err(dev_from_gk20a(g), 296 nvgpu_err(g,
299 "could not parse pmu for device %d", index); 297 "could not parse pmu for device %d", index);
300 goto boardobjgrppmudatainit_legacy_done; 298 goto boardobjgrppmudatainit_legacy_done;
301 } 299 }
@@ -326,8 +324,7 @@ u32 boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp
326 status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pboardobjgrppmu, 324 status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pboardobjgrppmu,
327 pboardobjgrp->mask); 325 pboardobjgrp->mask);
328 if (status) { 326 if (status) {
329 gk20a_err(dev_from_gk20a(g), 327 nvgpu_err(g, "unable to init boardobjgrp pmuhdr data");
330 "unable to init boardobjgrp pmuhdr data");
331 goto boardobjgrppmudatainit_super_done; 328 goto boardobjgrppmudatainit_super_done;
332 } 329 }
333 330
@@ -336,15 +333,14 @@ u32 boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp
336 (struct nv_pmu_boardobjgrp *)pboardobjgrppmu, 333 (struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
337 &ppmudata, index); 334 &ppmudata, index);
338 if (status) { 335 if (status) {
339 gk20a_err(dev_from_gk20a(g), 336 nvgpu_err(g, "could not get object instance");
340 "could not get object instance");
341 goto boardobjgrppmudatainit_super_done; 337 goto boardobjgrppmudatainit_super_done;
342 } 338 }
343 339
344 /* Initialize the PMU Data and send to PMU */ 340 /* Initialize the PMU Data and send to PMU */
345 status = pboardobj->pmudatainit(g, pboardobj, ppmudata); 341 status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
346 if (status) { 342 if (status) {
347 gk20a_err(dev_from_gk20a(g), 343 nvgpu_err(g,
348 "could not parse pmu for device %d", index); 344 "could not parse pmu for device %d", index);
349 goto boardobjgrppmudatainit_super_done; 345 goto boardobjgrppmudatainit_super_done;
350 } 346 }
@@ -390,8 +386,7 @@ u32 boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp)
390 status = pboardobjgrp->pmudatainit(g, pboardobjgrp, 386 status = pboardobjgrp->pmudatainit(g, pboardobjgrp,
391 pcmd->buf); 387 pcmd->buf);
392 if (status) { 388 if (status) {
393 gk20a_err(dev_from_gk20a(g), 389 nvgpu_err(g, "could not parse pmu data");
394 "could not parse pmu data");
395 goto boardobjgrp_pmuset_exit; 390 goto boardobjgrp_pmuset_exit;
396 } 391 }
397 392
@@ -415,7 +410,7 @@ u32 boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp)
415 status = boardobjgrp_pmucmdsend(g, pboardobjgrp, 410 status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
416 pcmd); 411 pcmd);
417 if (status) { 412 if (status) {
418 gk20a_err(dev_from_gk20a(g), "could not send SET CMD to PMU"); 413 nvgpu_err(g, "could not send SET CMD to PMU");
419 goto boardobjgrp_pmuset_exit; 414 goto boardobjgrp_pmuset_exit;
420 } 415 }
421 416
@@ -484,7 +479,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp,
484 status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, 479 status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp,
485 pcmd->buf, mask); 480 pcmd->buf, mask);
486 if (status) { 481 if (status) {
487 gk20a_err(dev_from_gk20a(g), "could not init PMU HDR data"); 482 nvgpu_err(g, "could not init PMU HDR data");
488 goto boardobjgrp_pmugetstatus_exit; 483 goto boardobjgrp_pmugetstatus_exit;
489 } 484 }
490 485
@@ -493,8 +488,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp,
493 status = boardobjgrp_pmucmdsend(g, pboardobjgrp, 488 status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
494 &pboardobjgrp->pmu.getstatus); 489 &pboardobjgrp->pmu.getstatus);
495 if (status) { 490 if (status) {
496 gk20a_err(dev_from_gk20a(g), 491 nvgpu_err(g, "could not send GET_STATUS cmd to PMU");
497 "could not send GET_STATUS cmd to PMU");
498 goto boardobjgrp_pmugetstatus_exit; 492 goto boardobjgrp_pmugetstatus_exit;
499 } 493 }
500 494
@@ -668,7 +662,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
668 pgrpmsg = &msg->msg.boardobj.grp; 662 pgrpmsg = &msg->msg.boardobj.grp;
669 663
670 if (pgrpmsg->class_id != pboardobjgrp->pmu.classid) { 664 if (pgrpmsg->class_id != pboardobjgrp->pmu.classid) {
671 gk20a_err(dev_from_gk20a(g), 665 nvgpu_err(g,
672 "Unrecognized GRP type: unit %x class id=0x%02x cmd id %x", 666 "Unrecognized GRP type: unit %x class id=0x%02x cmd id %x",
673 msg->hdr.unit_id, pboardobjgrp->pmu.classid, 667 msg->hdr.unit_id, pboardobjgrp->pmu.classid,
674 pgrpcmd->id); 668 pgrpcmd->id);
@@ -676,7 +670,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
676 } 670 }
677 671
678 if (msg->msg.boardobj.msg_type != pgrpcmd->msgid) { 672 if (msg->msg.boardobj.msg_type != pgrpcmd->msgid) {
679 gk20a_err(dev_from_gk20a(g), 673 nvgpu_err(g,
680 "unsupported msg for unit %x class %x cmd id %x msg %x", 674 "unsupported msg for unit %x class %x cmd id %x msg %x",
681 msg->hdr.unit_id, pboardobjgrp->pmu.classid, 675 msg->hdr.unit_id, pboardobjgrp->pmu.classid,
682 pgrpcmd->id, msg->msg.boardobj.msg_type); 676 pgrpcmd->id, msg->msg.boardobj.msg_type);
@@ -684,7 +678,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
684 } 678 }
685 679
686 if (msg->msg.boardobj.grp_set.flcn_status != 0) { 680 if (msg->msg.boardobj.grp_set.flcn_status != 0) {
687 gk20a_err(dev_from_gk20a(g), 681 nvgpu_err(g,
688 "cmd abort for unit %x class %x cmd id %x status %x", 682 "cmd abort for unit %x class %x cmd id %x status %x",
689 msg->hdr.unit_id, pboardobjgrp->pmu.classid, 683 msg->hdr.unit_id, pboardobjgrp->pmu.classid,
690 pgrpcmd->id, 684 pgrpcmd->id,
@@ -695,7 +689,7 @@ static void boardobjgrp_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
695 phandlerparams->success = pgrpmsg->b_success ? 1 : 0; 689 phandlerparams->success = pgrpmsg->b_success ? 1 : 0;
696 690
697 if (!pgrpmsg->b_success) { 691 if (!pgrpmsg->b_success) {
698 gk20a_err(dev_from_gk20a(g), 692 nvgpu_err(g,
699 "failed GRPCMD: msgtype=0x%x, classid=0x%x, cmd id %x", 693 "failed GRPCMD: msgtype=0x%x, classid=0x%x, cmd id %x",
700 pgrpmsg->msg_type, pgrpmsg->class_id, 694 pgrpmsg->msg_type, pgrpmsg->class_id,
701 pgrpcmd->id); 695 pgrpcmd->id);
@@ -756,7 +750,7 @@ static u32 boardobjgrp_pmucmdsend(struct gk20a *g,
756 (void *)&handlerparams, 750 (void *)&handlerparams,
757 &seqdesc, ~0); 751 &seqdesc, ~0);
758 if (status) { 752 if (status) {
759 gk20a_err(dev_from_gk20a(g), 753 nvgpu_err(g,
760 "unable to post boardobj grp cmd for unit %x cmd id %x", 754 "unable to post boardobj grp cmd for unit %x cmd id %x",
761 cmd.hdr.unit_id, pcmd->id); 755 cmd.hdr.unit_id, pcmd->id);
762 goto boardobjgrp_pmucmdsend_exit; 756 goto boardobjgrp_pmucmdsend_exit;
@@ -765,7 +759,7 @@ static u32 boardobjgrp_pmucmdsend(struct gk20a *g,
765 gk20a_get_gr_idle_timeout(g), 759 gk20a_get_gr_idle_timeout(g),
766 &handlerparams.success, 1); 760 &handlerparams.success, 1);
767 if (handlerparams.success == 0) { 761 if (handlerparams.success == 0) {
768 gk20a_err(dev_from_gk20a(g), "could not process cmd\n"); 762 nvgpu_err(g, "could not process cmd");
769 status = -ETIMEDOUT; 763 status = -ETIMEDOUT;
770 goto boardobjgrp_pmucmdsend_exit; 764 goto boardobjgrp_pmucmdsend_exit;
771 } 765 }