diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-03-30 10:44:03 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 22:04:19 -0400 |
commit | 3ba374a5d94f8c2067731155afaf79f03e6c390c (patch) | |
tree | d8a2bd0d52b1e8862510aedeb7529944c0b7e28e /drivers/gpu/nvgpu/gk20a/gk20a.c | |
parent | 2be51206af88aba6662cdd9de5bd6c18989bbcbd (diff) |
gpu: nvgpu: gk20a: Use new error macro
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: Ia51f36d94c5ce57a5a0ab83b3c83a6bce09e2d5c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1331694
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index c8acf6f7..05e3c3f4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -282,7 +282,7 @@ static int gk20a_init_support(struct platform_device *dev) | |||
282 | g->regs = gk20a_ioremap_resource(dev, GK20A_BAR0_IORESOURCE_MEM, | 282 | g->regs = gk20a_ioremap_resource(dev, GK20A_BAR0_IORESOURCE_MEM, |
283 | &g->reg_mem); | 283 | &g->reg_mem); |
284 | if (IS_ERR(g->regs)) { | 284 | if (IS_ERR(g->regs)) { |
285 | dev_err(dev_from_gk20a(g), "failed to remap gk20a registers\n"); | 285 | nvgpu_err(g, "failed to remap gk20a registers\n"); |
286 | err = PTR_ERR(g->regs); | 286 | err = PTR_ERR(g->regs); |
287 | goto fail; | 287 | goto fail; |
288 | } | 288 | } |
@@ -290,7 +290,7 @@ static int gk20a_init_support(struct platform_device *dev) | |||
290 | g->bar1 = gk20a_ioremap_resource(dev, GK20A_BAR1_IORESOURCE_MEM, | 290 | g->bar1 = gk20a_ioremap_resource(dev, GK20A_BAR1_IORESOURCE_MEM, |
291 | &g->bar1_mem); | 291 | &g->bar1_mem); |
292 | if (IS_ERR(g->bar1)) { | 292 | if (IS_ERR(g->bar1)) { |
293 | dev_err(dev_from_gk20a(g), "failed to remap gk20a bar1\n"); | 293 | nvgpu_err(g, "failed to remap gk20a bar1\n"); |
294 | err = PTR_ERR(g->bar1); | 294 | err = PTR_ERR(g->bar1); |
295 | goto fail; | 295 | goto fail; |
296 | } | 296 | } |
@@ -411,7 +411,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
411 | if (platform->busy) { | 411 | if (platform->busy) { |
412 | err = platform->busy(dev); | 412 | err = platform->busy(dev); |
413 | if (err < 0) { | 413 | if (err < 0) { |
414 | dev_err(dev, "%s: failed to poweron platform dependency\n", | 414 | nvgpu_err(g, "%s: failed to poweron platform dependency\n", |
415 | __func__); | 415 | __func__); |
416 | goto done; | 416 | goto done; |
417 | } | 417 | } |
@@ -467,7 +467,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
467 | if (g->ops.clk.init_clk_support) { | 467 | if (g->ops.clk.init_clk_support) { |
468 | err = g->ops.clk.init_clk_support(g); | 468 | err = g->ops.clk.init_clk_support(g); |
469 | if (err) { | 469 | if (err) { |
470 | gk20a_err(dev, "failed to init gk20a clk"); | 470 | nvgpu_err(g, "failed to init gk20a clk"); |
471 | goto done; | 471 | goto done; |
472 | } | 472 | } |
473 | } | 473 | } |
@@ -475,7 +475,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
475 | err = g->ops.fifo.reset_enable_hw(g); | 475 | err = g->ops.fifo.reset_enable_hw(g); |
476 | 476 | ||
477 | if (err) { | 477 | if (err) { |
478 | gk20a_err(dev, "failed to reset gk20a fifo"); | 478 | nvgpu_err(g, "failed to reset gk20a fifo"); |
479 | goto done; | 479 | goto done; |
480 | } | 480 | } |
481 | 481 | ||
@@ -484,13 +484,13 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
484 | 484 | ||
485 | err = gk20a_init_mm_support(g); | 485 | err = gk20a_init_mm_support(g); |
486 | if (err) { | 486 | if (err) { |
487 | gk20a_err(dev, "failed to init gk20a mm"); | 487 | nvgpu_err(g, "failed to init gk20a mm"); |
488 | goto done; | 488 | goto done; |
489 | } | 489 | } |
490 | 490 | ||
491 | err = gk20a_init_fifo_support(g); | 491 | err = gk20a_init_fifo_support(g); |
492 | if (err) { | 492 | if (err) { |
493 | gk20a_err(dev, "failed to init gk20a fifo"); | 493 | nvgpu_err(g, "failed to init gk20a fifo"); |
494 | goto done; | 494 | goto done; |
495 | } | 495 | } |
496 | 496 | ||
@@ -501,7 +501,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
501 | 501 | ||
502 | err = gk20a_enable_gr_hw(g); | 502 | err = gk20a_enable_gr_hw(g); |
503 | if (err) { | 503 | if (err) { |
504 | gk20a_err(dev, "failed to enable gr"); | 504 | nvgpu_err(g, "failed to enable gr"); |
505 | goto done; | 505 | goto done; |
506 | } | 506 | } |
507 | 507 | ||
@@ -509,7 +509,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
509 | if (g->ops.pmu.prepare_ucode) | 509 | if (g->ops.pmu.prepare_ucode) |
510 | err = g->ops.pmu.prepare_ucode(g); | 510 | err = g->ops.pmu.prepare_ucode(g); |
511 | if (err) { | 511 | if (err) { |
512 | gk20a_err(dev, "failed to init pmu ucode"); | 512 | nvgpu_err(g, "failed to init pmu ucode"); |
513 | goto done; | 513 | goto done; |
514 | } | 514 | } |
515 | } | 515 | } |
@@ -518,7 +518,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
518 | if (g->ops.pmupstate) { | 518 | if (g->ops.pmupstate) { |
519 | err = gk20a_init_pstate_support(g); | 519 | err = gk20a_init_pstate_support(g); |
520 | if (err) { | 520 | if (err) { |
521 | gk20a_err(dev, "failed to init pstates"); | 521 | nvgpu_err(g, "failed to init pstates"); |
522 | goto done; | 522 | goto done; |
523 | } | 523 | } |
524 | } | 524 | } |
@@ -527,21 +527,21 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
527 | if (g->ops.pmu.is_pmu_supported(g)) { | 527 | if (g->ops.pmu.is_pmu_supported(g)) { |
528 | err = gk20a_init_pmu_support(g); | 528 | err = gk20a_init_pmu_support(g); |
529 | if (err) { | 529 | if (err) { |
530 | gk20a_err(dev, "failed to init gk20a pmu"); | 530 | nvgpu_err(g, "failed to init gk20a pmu"); |
531 | goto done; | 531 | goto done; |
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
535 | err = gk20a_init_gr_support(g); | 535 | err = gk20a_init_gr_support(g); |
536 | if (err) { | 536 | if (err) { |
537 | gk20a_err(dev, "failed to init gk20a gr"); | 537 | nvgpu_err(g, "failed to init gk20a gr"); |
538 | goto done; | 538 | goto done; |
539 | } | 539 | } |
540 | 540 | ||
541 | if (g->ops.pmu.mclk_init) { | 541 | if (g->ops.pmu.mclk_init) { |
542 | err = g->ops.pmu.mclk_init(g); | 542 | err = g->ops.pmu.mclk_init(g); |
543 | if (err) { | 543 | if (err) { |
544 | gk20a_err(dev, "failed to set mclk"); | 544 | nvgpu_err(g, "failed to set mclk"); |
545 | /* Indicate error dont goto done */ | 545 | /* Indicate error dont goto done */ |
546 | } | 546 | } |
547 | } | 547 | } |
@@ -550,37 +550,37 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
550 | if (g->ops.pmupstate) { | 550 | if (g->ops.pmupstate) { |
551 | err = gk20a_init_pstate_pmu_support(g); | 551 | err = gk20a_init_pstate_pmu_support(g); |
552 | if (err) { | 552 | if (err) { |
553 | gk20a_err(dev, "failed to init pstates"); | 553 | nvgpu_err(g, "failed to init pstates"); |
554 | goto done; | 554 | goto done; |
555 | } | 555 | } |
556 | } | 556 | } |
557 | 557 | ||
558 | err = nvgpu_clk_arb_init_arbiter(g); | 558 | err = nvgpu_clk_arb_init_arbiter(g); |
559 | if (err) { | 559 | if (err) { |
560 | gk20a_err(dev, "failed to init clk arb"); | 560 | nvgpu_err(g, "failed to init clk arb"); |
561 | goto done; | 561 | goto done; |
562 | } | 562 | } |
563 | #endif | 563 | #endif |
564 | 564 | ||
565 | err = gk20a_init_therm_support(g); | 565 | err = gk20a_init_therm_support(g); |
566 | if (err) { | 566 | if (err) { |
567 | gk20a_err(dev, "failed to init gk20a therm"); | 567 | nvgpu_err(g, "failed to init gk20a therm"); |
568 | goto done; | 568 | goto done; |
569 | } | 569 | } |
570 | 570 | ||
571 | err = g->ops.chip_init_gpu_characteristics(g); | 571 | err = g->ops.chip_init_gpu_characteristics(g); |
572 | if (err) { | 572 | if (err) { |
573 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); | 573 | nvgpu_err(g, "failed to init gk20a gpu characteristics"); |
574 | goto done; | 574 | goto done; |
575 | } | 575 | } |
576 | 576 | ||
577 | err = gk20a_ctxsw_trace_init(g); | 577 | err = gk20a_ctxsw_trace_init(g); |
578 | if (err) | 578 | if (err) |
579 | gk20a_warn(dev, "could not initialize ctxsw tracing"); | 579 | nvgpu_warn(g, "could not initialize ctxsw tracing"); |
580 | 580 | ||
581 | err = gk20a_sched_ctrl_init(g); | 581 | err = gk20a_sched_ctrl_init(g); |
582 | if (err) { | 582 | if (err) { |
583 | gk20a_err(dev, "failed to init sched control"); | 583 | nvgpu_err(g, "failed to init sched control"); |
584 | goto done; | 584 | goto done; |
585 | } | 585 | } |
586 | 586 | ||
@@ -619,7 +619,7 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
619 | speed = 1 << (fls(speed) - 1); | 619 | speed = 1 << (fls(speed) - 1); |
620 | err = g->ops.xve.set_speed(g, speed); | 620 | err = g->ops.xve.set_speed(g, speed); |
621 | if (err) { | 621 | if (err) { |
622 | gk20a_err(dev, "Failed to set PCIe bus speed!\n"); | 622 | nvgpu_err(g, "Failed to set PCIe bus speed!\n"); |
623 | goto done; | 623 | goto done; |
624 | } | 624 | } |
625 | } | 625 | } |
@@ -1312,7 +1312,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset) | |||
1312 | } while (ref_cnt != target_ref_cnt && !nvgpu_timeout_expired(&timeout)); | 1312 | } while (ref_cnt != target_ref_cnt && !nvgpu_timeout_expired(&timeout)); |
1313 | 1313 | ||
1314 | if (ref_cnt != target_ref_cnt) { | 1314 | if (ref_cnt != target_ref_cnt) { |
1315 | gk20a_err(dev, "failed to idle - refcount %d != 1\n", | 1315 | nvgpu_err(g, "failed to idle - refcount %d != 1\n", |
1316 | ref_cnt); | 1316 | ref_cnt); |
1317 | goto fail_drop_usage_count; | 1317 | goto fail_drop_usage_count; |
1318 | } | 1318 | } |
@@ -1344,7 +1344,7 @@ int __gk20a_do_idle(struct device *dev, bool force_reset) | |||
1344 | if (is_railgated) { | 1344 | if (is_railgated) { |
1345 | return 0; | 1345 | return 0; |
1346 | } else { | 1346 | } else { |
1347 | gk20a_err(dev, "failed to idle in timeout\n"); | 1347 | nvgpu_err(g, "failed to idle in timeout\n"); |
1348 | goto fail_timeout; | 1348 | goto fail_timeout; |
1349 | } | 1349 | } |
1350 | } else { | 1350 | } else { |