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/fecs_trace_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/fecs_trace_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 96b94ea7..ad228a8c 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include "gk20a.h" | 31 | #include "gk20a.h" |
32 | #include "gr_gk20a.h" | 32 | #include "gr_gk20a.h" |
33 | 33 | ||
34 | #include <nvgpu/log.h> | ||
35 | |||
34 | #include <nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h> | 36 | #include <nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h> |
35 | #include <nvgpu/hw/gk20a/hw_gr_gk20a.h> | 37 | #include <nvgpu/hw/gk20a/hw_gr_gk20a.h> |
36 | 38 | ||
@@ -156,7 +158,7 @@ static int gk20a_fecs_trace_hash_add(struct gk20a *g, u32 context_ptr, pid_t pid | |||
156 | 158 | ||
157 | he = nvgpu_kzalloc(g, sizeof(*he)); | 159 | he = nvgpu_kzalloc(g, sizeof(*he)); |
158 | if (unlikely(!he)) { | 160 | if (unlikely(!he)) { |
159 | gk20a_warn(dev_from_gk20a(g), | 161 | nvgpu_warn(g, |
160 | "can't alloc new hash entry for context_ptr=%x pid=%d", | 162 | "can't alloc new hash entry for context_ptr=%x pid=%d", |
161 | context_ptr, pid); | 163 | context_ptr, pid); |
162 | return -ENOMEM; | 164 | return -ENOMEM; |
@@ -255,7 +257,7 @@ static int gk20a_fecs_trace_ring_read(struct gk20a *g, int index) | |||
255 | "consuming record trace=%p read=%d record=%p", trace, index, r); | 257 | "consuming record trace=%p read=%d record=%p", trace, index, r); |
256 | 258 | ||
257 | if (unlikely(!gk20a_fecs_trace_is_valid_record(r))) { | 259 | if (unlikely(!gk20a_fecs_trace_is_valid_record(r))) { |
258 | gk20a_warn(dev_from_gk20a(g), | 260 | nvgpu_warn(g, |
259 | "trace=%p read=%d record=%p magic_lo=%08x magic_hi=%08x (invalid)", | 261 | "trace=%p read=%d record=%p magic_lo=%08x magic_hi=%08x (invalid)", |
260 | trace, index, r, r->magic_lo, r->magic_hi); | 262 | trace, index, r, r->magic_lo, r->magic_hi); |
261 | return -EINVAL; | 263 | return -EINVAL; |
@@ -342,7 +344,7 @@ static int gk20a_fecs_trace_poll(struct gk20a *g) | |||
342 | nvgpu_mutex_acquire(&trace->poll_lock); | 344 | nvgpu_mutex_acquire(&trace->poll_lock); |
343 | write = gk20a_fecs_trace_get_write_index(g); | 345 | write = gk20a_fecs_trace_get_write_index(g); |
344 | if (unlikely((write < 0) || (write >= GK20A_FECS_TRACE_NUM_RECORDS))) { | 346 | if (unlikely((write < 0) || (write >= GK20A_FECS_TRACE_NUM_RECORDS))) { |
345 | gk20a_err(dev_from_gk20a(g), | 347 | nvgpu_err(g, |
346 | "failed to acquire write index, write=%d", write); | 348 | "failed to acquire write index, write=%d", write); |
347 | err = write; | 349 | err = write; |
348 | goto done; | 350 | goto done; |
@@ -571,7 +573,7 @@ static int gk20a_fecs_trace_init(struct gk20a *g) | |||
571 | 573 | ||
572 | trace = nvgpu_kzalloc(g, sizeof(struct gk20a_fecs_trace)); | 574 | trace = nvgpu_kzalloc(g, sizeof(struct gk20a_fecs_trace)); |
573 | if (!trace) { | 575 | if (!trace) { |
574 | gk20a_warn(dev_from_gk20a(g), "failed to allocate fecs_trace"); | 576 | nvgpu_warn(g, "failed to allocate fecs_trace"); |
575 | return -ENOMEM; | 577 | return -ENOMEM; |
576 | } | 578 | } |
577 | g->fecs_trace = trace; | 579 | g->fecs_trace = trace; |
@@ -586,7 +588,7 @@ static int gk20a_fecs_trace_init(struct gk20a *g) | |||
586 | BUG_ON(!is_power_of_2(GK20A_FECS_TRACE_NUM_RECORDS)); | 588 | BUG_ON(!is_power_of_2(GK20A_FECS_TRACE_NUM_RECORDS)); |
587 | err = gk20a_fecs_trace_alloc_ring(g); | 589 | err = gk20a_fecs_trace_alloc_ring(g); |
588 | if (err) { | 590 | if (err) { |
589 | gk20a_warn(dev_from_gk20a(g), "failed to allocate FECS ring"); | 591 | nvgpu_warn(g, "failed to allocate FECS ring"); |
590 | goto clean_hash_lock; | 592 | goto clean_hash_lock; |
591 | } | 593 | } |
592 | 594 | ||
@@ -754,7 +756,7 @@ static int gk20a_fecs_trace_enable(struct gk20a *g) | |||
754 | 756 | ||
755 | task = kthread_run(gk20a_fecs_trace_periodic_polling, g, __func__); | 757 | task = kthread_run(gk20a_fecs_trace_periodic_polling, g, __func__); |
756 | if (unlikely(IS_ERR(task))) { | 758 | if (unlikely(IS_ERR(task))) { |
757 | gk20a_warn(dev_from_gk20a(g), | 759 | nvgpu_warn(g, |
758 | "failed to create FECS polling task"); | 760 | "failed to create FECS polling task"); |
759 | return PTR_ERR(task); | 761 | return PTR_ERR(task); |
760 | } | 762 | } |