diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-06 16:02:43 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-10 15:24:22 -0400 |
commit | 3a1104c3699b05201abf48ed9283bb8ccbe42732 (patch) | |
tree | a2e9445f730e9de76cbb7e68d3410a97ded588fa /drivers/gpu/nvgpu/perf | |
parent | 54eb74539342ce0fa6961e46f2ce22b68ad2fb21 (diff) |
gpu: nvgpu: therm: 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: I50bab058076c6896acfc6fa82f78f52a949dd3cf
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1457354
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/perf')
-rw-r--r-- | drivers/gpu/nvgpu/perf/perf.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_equ.c | 20 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/perf/vfe_var.c | 21 |
3 files changed, 21 insertions, 28 deletions
diff --git a/drivers/gpu/nvgpu/perf/perf.c b/drivers/gpu/nvgpu/perf/perf.c index 58efdd6c..3c27c6fc 100644 --- a/drivers/gpu/nvgpu/perf/perf.c +++ b/drivers/gpu/nvgpu/perf/perf.c | |||
@@ -30,8 +30,7 @@ static void perfrpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg, | |||
30 | gk20a_dbg_info(""); | 30 | gk20a_dbg_info(""); |
31 | 31 | ||
32 | if (msg->msg.perf.msg_type != NV_PMU_PERF_MSG_ID_RPC) { | 32 | if (msg->msg.perf.msg_type != NV_PMU_PERF_MSG_ID_RPC) { |
33 | gk20a_err(dev_from_gk20a(g), | 33 | nvgpu_err(g, "unsupported msg for VFE LOAD RPC %x", |
34 | "unsupported msg for VFE LOAD RPC %x", | ||
35 | msg->msg.perf.msg_type); | 34 | msg->msg.perf.msg_type); |
36 | return; | 35 | return; |
37 | } | 36 | } |
@@ -97,8 +96,7 @@ u32 perf_pmu_vfe_load(struct gk20a *g) | |||
97 | &seqdesc, ~0); | 96 | &seqdesc, ~0); |
98 | 97 | ||
99 | if (status) { | 98 | if (status) { |
100 | gk20a_err(dev_from_gk20a(g), | 99 | nvgpu_err(g, "unable to post perf RPC cmd %x", |
101 | "unable to post perf RPC cmd %x", | ||
102 | cmd.cmd.perf.cmd_type); | 100 | cmd.cmd.perf.cmd_type); |
103 | goto done; | 101 | goto done; |
104 | } | 102 | } |
@@ -109,7 +107,7 @@ u32 perf_pmu_vfe_load(struct gk20a *g) | |||
109 | 107 | ||
110 | if (handler.success == 0) { | 108 | if (handler.success == 0) { |
111 | status = -EINVAL; | 109 | status = -EINVAL; |
112 | gk20a_err(dev_from_gk20a(g), "rpc call to load VFE failed"); | 110 | nvgpu_err(g, "rpc call to load VFE failed"); |
113 | } | 111 | } |
114 | done: | 112 | done: |
115 | return status; | 113 | return status; |
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.c b/drivers/gpu/nvgpu/perf/vfe_equ.c index f8a79a22..bb443265 100644 --- a/drivers/gpu/nvgpu/perf/vfe_equ.c +++ b/drivers/gpu/nvgpu/perf/vfe_equ.c | |||
@@ -34,8 +34,7 @@ static u32 _vfe_equs_pmudatainit(struct gk20a *g, | |||
34 | 34 | ||
35 | status = boardobjgrp_pmudatainit_e255(g, pboardobjgrp, pboardobjgrppmu); | 35 | status = boardobjgrp_pmudatainit_e255(g, pboardobjgrp, pboardobjgrppmu); |
36 | if (status) { | 36 | if (status) { |
37 | gk20a_err(dev_from_gk20a(g), | 37 | nvgpu_err(g, "error updating pmu boardobjgrp for vfe equ 0x%x", |
38 | "error updating pmu boardobjgrp for vfe equ 0x%x", | ||
39 | status); | 38 | status); |
40 | goto done; | 39 | goto done; |
41 | } | 40 | } |
@@ -74,7 +73,7 @@ u32 vfe_equ_sw_setup(struct gk20a *g) | |||
74 | 73 | ||
75 | status = boardobjgrpconstruct_e255(&g->perf_pmu.vfe_equobjs.super); | 74 | status = boardobjgrpconstruct_e255(&g->perf_pmu.vfe_equobjs.super); |
76 | if (status) { | 75 | if (status) { |
77 | gk20a_err(dev_from_gk20a(g), | 76 | nvgpu_err(g, |
78 | "error creating boardobjgrp for clk domain, status - 0x%x", | 77 | "error creating boardobjgrp for clk domain, status - 0x%x", |
79 | status); | 78 | status); |
80 | goto done; | 79 | goto done; |
@@ -88,7 +87,7 @@ u32 vfe_equ_sw_setup(struct gk20a *g) | |||
88 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, | 87 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, |
89 | perf, PERF, vfe_equ, VFE_EQU); | 88 | perf, PERF, vfe_equ, VFE_EQU); |
90 | if (status) { | 89 | if (status) { |
91 | gk20a_err(dev_from_gk20a(g), | 90 | nvgpu_err(g, |
92 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", | 91 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", |
93 | status); | 92 | status); |
94 | goto done; | 93 | goto done; |
@@ -223,8 +222,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, | |||
223 | break; | 222 | break; |
224 | 223 | ||
225 | default: | 224 | default: |
226 | gk20a_err(dev_from_gk20a(g), | 225 | nvgpu_err(g, "unrecognized output id @vfeequ index %d", |
227 | "unrecognized output id @vfeequ index %d", | ||
228 | index); | 226 | index); |
229 | goto done; | 227 | goto done; |
230 | } | 228 | } |
@@ -278,7 +276,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, | |||
278 | CTRL_PERF_VFE_EQU_COMPARE_FUNCTION_GREATER; | 276 | CTRL_PERF_VFE_EQU_COMPARE_FUNCTION_GREATER; |
279 | break; | 277 | break; |
280 | default: | 278 | default: |
281 | gk20a_err(dev_from_gk20a(g), | 279 | nvgpu_err(g, |
282 | "invalid vfe compare index %x type %x ", | 280 | "invalid vfe compare index %x type %x ", |
283 | index, cmp_func); | 281 | index, cmp_func); |
284 | status = -EINVAL; | 282 | status = -EINVAL; |
@@ -295,8 +293,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, | |||
295 | } | 293 | } |
296 | default: | 294 | default: |
297 | status = -EINVAL; | 295 | status = -EINVAL; |
298 | gk20a_err(dev_from_gk20a(g), | 296 | nvgpu_err(g, "Invalid equ[%d].type = 0x%x.", |
299 | "Invalid equ[%d].type = 0x%x.", | ||
300 | index, (u8)equ.type); | 297 | index, (u8)equ.type); |
301 | goto done; | 298 | goto done; |
302 | } | 299 | } |
@@ -305,7 +302,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, | |||
305 | pequ = construct_vfe_equ(g, (void *)&equ_data); | 302 | pequ = construct_vfe_equ(g, (void *)&equ_data); |
306 | 303 | ||
307 | if (pequ == NULL) { | 304 | if (pequ == NULL) { |
308 | gk20a_err(dev_from_gk20a(g), | 305 | nvgpu_err(g, |
309 | "error constructing vfe_equ boardobj %d", index); | 306 | "error constructing vfe_equ boardobj %d", index); |
310 | status = -EINVAL; | 307 | status = -EINVAL; |
311 | goto done; | 308 | goto done; |
@@ -314,8 +311,7 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g, | |||
314 | status = boardobjgrp_objinsert(&pvfeequobjs->super.super, | 311 | status = boardobjgrp_objinsert(&pvfeequobjs->super.super, |
315 | (struct boardobj *)pequ, index); | 312 | (struct boardobj *)pequ, index); |
316 | if (status) { | 313 | if (status) { |
317 | gk20a_err(dev_from_gk20a(g), | 314 | nvgpu_err(g, "error adding vfe_equ boardobj %d", index); |
318 | "error adding vfe_equ boardobj %d", index); | ||
319 | status = -EINVAL; | 315 | status = -EINVAL; |
320 | goto done; | 316 | goto done; |
321 | } | 317 | } |
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c index 7170f502..996929c2 100644 --- a/drivers/gpu/nvgpu/perf/vfe_var.c +++ b/drivers/gpu/nvgpu/perf/vfe_var.c | |||
@@ -40,7 +40,7 @@ static u32 _vfe_vars_pmudatainit(struct gk20a *g, | |||
40 | 40 | ||
41 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); | 41 | status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu); |
42 | if (status) { | 42 | if (status) { |
43 | gk20a_err(dev_from_gk20a(g), | 43 | nvgpu_err(g, |
44 | "error updating pmu boardobjgrp for vfe var 0x%x", | 44 | "error updating pmu boardobjgrp for vfe var 0x%x", |
45 | status); | 45 | status); |
46 | goto done; | 46 | goto done; |
@@ -100,7 +100,7 @@ u32 vfe_var_sw_setup(struct gk20a *g) | |||
100 | 100 | ||
101 | status = boardobjgrpconstruct_e32(&g->perf_pmu.vfe_varobjs.super); | 101 | status = boardobjgrpconstruct_e32(&g->perf_pmu.vfe_varobjs.super); |
102 | if (status) { | 102 | if (status) { |
103 | gk20a_err(dev_from_gk20a(g), | 103 | nvgpu_err(g, |
104 | "error creating boardobjgrp for clk domain, status - 0x%x", | 104 | "error creating boardobjgrp for clk domain, status - 0x%x", |
105 | status); | 105 | status); |
106 | goto done; | 106 | goto done; |
@@ -114,7 +114,7 @@ u32 vfe_var_sw_setup(struct gk20a *g) | |||
114 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, | 114 | status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp, |
115 | perf, PERF, vfe_var, VFE_VAR); | 115 | perf, PERF, vfe_var, VFE_VAR); |
116 | if (status) { | 116 | if (status) { |
117 | gk20a_err(dev_from_gk20a(g), | 117 | nvgpu_err(g, |
118 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", | 118 | "error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x", |
119 | status); | 119 | status); |
120 | goto done; | 120 | goto done; |
@@ -132,7 +132,7 @@ u32 vfe_var_sw_setup(struct gk20a *g) | |||
132 | &g->perf_pmu.vfe_varobjs.super.super, | 132 | &g->perf_pmu.vfe_varobjs.super.super, |
133 | perf, PERF, vfe_var, VFE_VAR); | 133 | perf, PERF, vfe_var, VFE_VAR); |
134 | if (status) { | 134 | if (status) { |
135 | gk20a_err(dev_from_gk20a(g), | 135 | nvgpu_err(g, |
136 | "error constructing PMU_BOARDOBJ_CMD_GRP_GET_STATUS interface - 0x%x", | 136 | "error constructing PMU_BOARDOBJ_CMD_GRP_GET_STATUS interface - 0x%x", |
137 | status); | 137 | status); |
138 | goto done; | 138 | goto done; |
@@ -196,14 +196,14 @@ u32 dev_init_get_vfield_info(struct gk20a *g, | |||
196 | memcpy(&vregheader, vfieldregtableptr, VFIELD_REG_HEADER_SIZE); | 196 | memcpy(&vregheader, vfieldregtableptr, VFIELD_REG_HEADER_SIZE); |
197 | 197 | ||
198 | if (vregheader.version != VBIOS_VFIELD_REG_TABLE_VERSION_1_0) { | 198 | if (vregheader.version != VBIOS_VFIELD_REG_TABLE_VERSION_1_0) { |
199 | gk20a_err(dev_from_gk20a(g), "invalid vreg header version"); | 199 | nvgpu_err(g, "invalid vreg header version"); |
200 | goto done; | 200 | goto done; |
201 | } | 201 | } |
202 | 202 | ||
203 | memcpy(&vheader, vfieldtableptr, VFIELD_HEADER_SIZE); | 203 | memcpy(&vheader, vfieldtableptr, VFIELD_HEADER_SIZE); |
204 | 204 | ||
205 | if (vregheader.version != VBIOS_VFIELD_TABLE_VERSION_1_0) { | 205 | if (vregheader.version != VBIOS_VFIELD_TABLE_VERSION_1_0) { |
206 | gk20a_err(dev_from_gk20a(g), "invalid vfield header version"); | 206 | nvgpu_err(g, "invalid vfield header version"); |
207 | goto done; | 207 | goto done; |
208 | } | 208 | } |
209 | 209 | ||
@@ -660,13 +660,13 @@ static u32 vfe_var_construct_single_sensed_fuse(struct gk20a *g, | |||
660 | dev_init_get_vfield_info(g, pvfevar); | 660 | dev_init_get_vfield_info(g, pvfevar); |
661 | /*check whether fuse segment got initialized*/ | 661 | /*check whether fuse segment got initialized*/ |
662 | if (pvfevar->vfield_info.fuse.segment_count == 0) { | 662 | if (pvfevar->vfield_info.fuse.segment_count == 0) { |
663 | gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x", | 663 | nvgpu_err(g, "unable to get fuse reg info %x", |
664 | pvfevar->vfield_info.v_field_id); | 664 | pvfevar->vfield_info.v_field_id); |
665 | status = -EINVAL; | 665 | status = -EINVAL; |
666 | goto exit; | 666 | goto exit; |
667 | } | 667 | } |
668 | if (pvfevar->vfield_ver_info.fuse.segment_count == 0) { | 668 | if (pvfevar->vfield_ver_info.fuse.segment_count == 0) { |
669 | gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x", | 669 | nvgpu_err(g, "unable to get fuse reg info %x", |
670 | pvfevar->vfield_ver_info.v_field_id_ver); | 670 | pvfevar->vfield_ver_info.v_field_id_ver); |
671 | status = -EINVAL; | 671 | status = -EINVAL; |
672 | goto exit; | 672 | goto exit; |
@@ -997,7 +997,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g, | |||
997 | 997 | ||
998 | pvar = construct_vfe_var(g, &var_data); | 998 | pvar = construct_vfe_var(g, &var_data); |
999 | if (pvar == NULL) { | 999 | if (pvar == NULL) { |
1000 | gk20a_err(dev_from_gk20a(g), | 1000 | nvgpu_err(g, |
1001 | "error constructing vfe_var boardobj %d", | 1001 | "error constructing vfe_var boardobj %d", |
1002 | index); | 1002 | index); |
1003 | status = -EINVAL; | 1003 | status = -EINVAL; |
@@ -1007,8 +1007,7 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g, | |||
1007 | status = boardobjgrp_objinsert(&pvfevarobjs->super.super, | 1007 | status = boardobjgrp_objinsert(&pvfevarobjs->super.super, |
1008 | (struct boardobj *)pvar, index); | 1008 | (struct boardobj *)pvar, index); |
1009 | if (status) { | 1009 | if (status) { |
1010 | gk20a_err(dev_from_gk20a(g), | 1010 | nvgpu_err(g, "error adding vfe_var boardobj %d", index); |
1011 | "error adding vfe_var boardobj %d", index); | ||
1012 | status = -EINVAL; | 1011 | status = -EINVAL; |
1013 | goto done; | 1012 | goto done; |
1014 | } | 1013 | } |