summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/clk/clk_domain.c15
-rw-r--r--drivers/gpu/nvgpu/clk/clk_fll.c15
-rw-r--r--drivers/gpu/nvgpu/clk/clk_vin.c15
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_equ.c18
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_var.c27
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrdev.c15
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrmonitor.c15
-rw-r--r--drivers/gpu/nvgpu/pmgr/pwrpolicy.c15
-rw-r--r--drivers/gpu/nvgpu/therm/thrmchannel.c15
-rw-r--r--drivers/gpu/nvgpu/therm/thrmdev.c15
10 files changed, 88 insertions, 77 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_domain.c b/drivers/gpu/nvgpu/clk/clk_domain.c
index fe3db5d6..892437de 100644
--- a/drivers/gpu/nvgpu/clk/clk_domain.c
+++ b/drivers/gpu/nvgpu/clk/clk_domain.c
@@ -263,13 +263,14 @@ static u32 devinit_get_clocks_table(struct gk20a *g,
263 263
264 gk20a_dbg_info(""); 264 gk20a_dbg_info("");
265 265
266 if (g->ops.bios.get_perf_table_ptrs) { 266 if (!g->ops.bios.get_perf_table_ptrs)
267 clocks_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 267 return -EINVAL;
268 g->bios.clock_token, CLOCKS_TABLE); 268
269 if (clocks_table_ptr == NULL) { 269 clocks_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
270 status = -EINVAL; 270 g->bios.clock_token, CLOCKS_TABLE);
271 goto done; 271 if (clocks_table_ptr == NULL) {
272 } 272 status = -EINVAL;
273 goto done;
273 } 274 }
274 275
275 memcpy(&clocks_table_header, clocks_table_ptr, 276 memcpy(&clocks_table_header, clocks_table_ptr,
diff --git a/drivers/gpu/nvgpu/clk/clk_fll.c b/drivers/gpu/nvgpu/clk/clk_fll.c
index 0de857f5..d83f3e15 100644
--- a/drivers/gpu/nvgpu/clk/clk_fll.c
+++ b/drivers/gpu/nvgpu/clk/clk_fll.c
@@ -236,13 +236,14 @@ static u32 devinit_get_fll_device_table(struct gk20a *g,
236 236
237 gk20a_dbg_info(""); 237 gk20a_dbg_info("");
238 238
239 if (g->ops.bios.get_perf_table_ptrs) { 239 if (!g->ops.bios.get_perf_table_ptrs)
240 fll_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 240 return -EINVAL;
241 g->bios.clock_token, FLL_TABLE); 241
242 if (fll_table_ptr == NULL) { 242 fll_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
243 status = -1; 243 g->bios.clock_token, FLL_TABLE);
244 goto done; 244 if (fll_table_ptr == NULL) {
245 } 245 status = -1;
246 goto done;
246 } 247 }
247 248
248 memcpy(&fll_desc_table_header_sz, fll_table_ptr, 249 memcpy(&fll_desc_table_header_sz, fll_table_ptr,
diff --git a/drivers/gpu/nvgpu/clk/clk_vin.c b/drivers/gpu/nvgpu/clk/clk_vin.c
index e8e4b753..649eb234 100644
--- a/drivers/gpu/nvgpu/clk/clk_vin.c
+++ b/drivers/gpu/nvgpu/clk/clk_vin.c
@@ -339,13 +339,14 @@ static u32 devinit_get_vin_device_table(struct gk20a *g,
339 339
340 gk20a_dbg_info(""); 340 gk20a_dbg_info("");
341 341
342 if (g->ops.bios.get_perf_table_ptrs) { 342 if (!g->ops.bios.get_perf_table_ptrs)
343 vin_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 343 return -EINVAL;
344 g->bios.clock_token, VIN_TABLE); 344
345 if (vin_table_ptr == NULL) { 345 vin_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
346 status = -1; 346 g->bios.clock_token, VIN_TABLE);
347 goto done; 347 if (vin_table_ptr == NULL) {
348 } 348 status = -1;
349 goto done;
349 } 350 }
350 351
351 memcpy(&vin_desc_table_header, vin_table_ptr, 352 memcpy(&vin_desc_table_header, vin_table_ptr,
diff --git a/drivers/gpu/nvgpu/perf/vfe_equ.c b/drivers/gpu/nvgpu/perf/vfe_equ.c
index 6630fb21..78a7c57c 100644
--- a/drivers/gpu/nvgpu/perf/vfe_equ.c
+++ b/drivers/gpu/nvgpu/perf/vfe_equ.c
@@ -150,14 +150,16 @@ static u32 devinit_get_vfe_equ_table(struct gk20a *g,
150 150
151 gk20a_dbg_info(""); 151 gk20a_dbg_info("");
152 152
153 if (g->ops.bios.get_perf_table_ptrs) { 153 if (!g->ops.bios.get_perf_table_ptrs)
154 vfeequs_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 154 return -EINVAL;
155 g->bios.perf_token, 155
156 CONTINUOUS_VIRTUAL_BINNING_TABLE); 156 vfeequs_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
157 if (vfeequs_tbl_ptr == NULL) { 157 g->bios.perf_token,
158 status = -EINVAL; 158 CONTINUOUS_VIRTUAL_BINNING_TABLE);
159 goto done; 159
160 } 160 if (vfeequs_tbl_ptr == NULL) {
161 status = -EINVAL;
162 goto done;
161 } 163 }
162 164
163 memcpy(&vfeequs_tbl_header, vfeequs_tbl_ptr, 165 memcpy(&vfeequs_tbl_header, vfeequs_tbl_ptr,
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c
index 4f8dc83b..f4c3f276 100644
--- a/drivers/gpu/nvgpu/perf/vfe_var.c
+++ b/drivers/gpu/nvgpu/perf/vfe_var.c
@@ -182,20 +182,21 @@ u32 dev_init_get_vfield_info(struct gk20a *g,
182 u8 *psegmentcount = NULL; 182 u8 *psegmentcount = NULL;
183 u32 status = 0; 183 u32 status = 0;
184 184
185 if (g->ops.bios.get_perf_table_ptrs) { 185 if (!g->ops.bios.get_perf_table_ptrs)
186 vfieldregtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 186 return -EINVAL;
187 g->bios.virt_token, VP_FIELD_REGISTER);
188 if (vfieldregtableptr == NULL) {
189 status = -EINVAL;
190 goto done;
191 }
192 187
193 vfieldtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 188 vfieldregtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
194 g->bios.virt_token, VP_FIELD_TABLE); 189 g->bios.virt_token, VP_FIELD_REGISTER);
195 if (vfieldtableptr == NULL) { 190 if (vfieldregtableptr == NULL) {
196 status = -EINVAL; 191 status = -EINVAL;
197 goto done; 192 goto done;
198 } 193 }
194
195 vfieldtableptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
196 g->bios.virt_token, VP_FIELD_TABLE);
197 if (vfieldtableptr == NULL) {
198 status = -EINVAL;
199 goto done;
199 } 200 }
200 201
201 memcpy(&vregheader, vfieldregtableptr, VFIELD_REG_HEADER_SIZE); 202 memcpy(&vregheader, vfieldregtableptr, VFIELD_REG_HEADER_SIZE);
diff --git a/drivers/gpu/nvgpu/pmgr/pwrdev.c b/drivers/gpu/nvgpu/pmgr/pwrdev.c
index 03e2eb34..da034b31 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrdev.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrdev.c
@@ -140,13 +140,14 @@ static u32 devinit_get_pwr_device_table(struct gk20a *g,
140 140
141 gk20a_dbg_info(""); 141 gk20a_dbg_info("");
142 142
143 if (g->ops.bios.get_perf_table_ptrs != NULL) { 143 if (!g->ops.bios.get_perf_table_ptrs)
144 pwr_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 144 return -EINVAL;
145 g->bios.perf_token, POWER_SENSORS_TABLE); 145
146 if (pwr_device_table_ptr == NULL) { 146 pwr_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
147 status = -EINVAL; 147 g->bios.perf_token, POWER_SENSORS_TABLE);
148 goto done; 148 if (pwr_device_table_ptr == NULL) {
149 } 149 status = -EINVAL;
150 goto done;
150 } 151 }
151 152
152 memcpy(&pwr_sensor_table_header, pwr_device_table_ptr, 153 memcpy(&pwr_sensor_table_header, pwr_device_table_ptr,
diff --git a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
index c28751fd..f14bac07 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrmonitor.c
@@ -187,13 +187,14 @@ static u32 devinit_get_pwr_topology_table(struct gk20a *g,
187 187
188 gk20a_dbg_info(""); 188 gk20a_dbg_info("");
189 189
190 if (g->ops.bios.get_perf_table_ptrs != NULL) { 190 if (!g->ops.bios.get_perf_table_ptrs)
191 pwr_topology_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 191 return -EINVAL;
192 g->bios.perf_token, POWER_TOPOLOGY_TABLE); 192
193 if (pwr_topology_table_ptr == NULL) { 193 pwr_topology_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
194 status = -EINVAL; 194 g->bios.perf_token, POWER_TOPOLOGY_TABLE);
195 goto done; 195 if (pwr_topology_table_ptr == NULL) {
196 } 196 status = -EINVAL;
197 goto done;
197 } 198 }
198 199
199 memcpy(&pwr_topology_table_header, pwr_topology_table_ptr, 200 memcpy(&pwr_topology_table_header, pwr_topology_table_ptr,
diff --git a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
index d7926773..cce3bd5e 100644
--- a/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
+++ b/drivers/gpu/nvgpu/pmgr/pwrpolicy.c
@@ -466,13 +466,14 @@ static u32 devinit_get_pwr_policy_table(struct gk20a *g,
466 466
467 gk20a_dbg_info(""); 467 gk20a_dbg_info("");
468 468
469 if (g->ops.bios.get_perf_table_ptrs != NULL) { 469 if (!g->ops.bios.get_perf_table_ptrs)
470 pwr_policy_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 470 return -EINVAL;
471 g->bios.perf_token, POWER_CAPPING_TABLE); 471
472 if (pwr_policy_table_ptr == NULL) { 472 pwr_policy_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
473 status = -EINVAL; 473 g->bios.perf_token, POWER_CAPPING_TABLE);
474 goto done; 474 if (pwr_policy_table_ptr == NULL) {
475 } 475 status = -EINVAL;
476 goto done;
476 } 477 }
477 478
478 memcpy(&pwr_policy_table_header.version, 479 memcpy(&pwr_policy_table_header.version,
diff --git a/drivers/gpu/nvgpu/therm/thrmchannel.c b/drivers/gpu/nvgpu/therm/thrmchannel.c
index b5a7dfd2..aa40dac8 100644
--- a/drivers/gpu/nvgpu/therm/thrmchannel.c
+++ b/drivers/gpu/nvgpu/therm/thrmchannel.c
@@ -131,13 +131,14 @@ static u32 devinit_get_therm_channel_table(struct gk20a *g,
131 131
132 gk20a_dbg_info(""); 132 gk20a_dbg_info("");
133 133
134 if (g->ops.bios.get_perf_table_ptrs) { 134 if (!g->ops.bios.get_perf_table_ptrs)
135 therm_channel_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 135 return -EINVAL;
136 g->bios.perf_token, THERMAL_CHANNEL_TABLE); 136
137 if (therm_channel_table_ptr == NULL) { 137 therm_channel_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
138 status = -EINVAL; 138 g->bios.perf_token, THERMAL_CHANNEL_TABLE);
139 goto done; 139 if (therm_channel_table_ptr == NULL) {
140 } 140 status = -EINVAL;
141 goto done;
141 } 142 }
142 143
143 memcpy(&therm_channel_table_header, therm_channel_table_ptr, 144 memcpy(&therm_channel_table_header, therm_channel_table_ptr,
diff --git a/drivers/gpu/nvgpu/therm/thrmdev.c b/drivers/gpu/nvgpu/therm/thrmdev.c
index 83ac9739..9bb77537 100644
--- a/drivers/gpu/nvgpu/therm/thrmdev.c
+++ b/drivers/gpu/nvgpu/therm/thrmdev.c
@@ -81,13 +81,14 @@ static u32 devinit_get_therm_device_table(struct gk20a *g,
81 81
82 gk20a_dbg_info(""); 82 gk20a_dbg_info("");
83 83
84 if (g->ops.bios.get_perf_table_ptrs) { 84 if (!g->ops.bios.get_perf_table_ptrs)
85 therm_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 85 return -EINVAL;
86 g->bios.perf_token, THERMAL_DEVICE_TABLE); 86
87 if (therm_device_table_ptr == NULL) { 87 therm_device_table_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
88 status = -EINVAL; 88 g->bios.perf_token, THERMAL_DEVICE_TABLE);
89 goto done; 89 if (therm_device_table_ptr == NULL) {
90 } 90 status = -EINVAL;
91 goto done;
91 } 92 }
92 93
93 memcpy(&therm_device_table_header, therm_device_table_ptr, 94 memcpy(&therm_device_table_header, therm_device_table_ptr,