summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-06-26 20:37:40 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-19 19:43:58 -0400
commit7f14aafc2c02eb0fab458324d0ba91a7fdea3086 (patch)
treecda9f48839fbde3444fde521a9b0069eb06cd81a /drivers/gpu/nvgpu/gp10b/gr_gp10b.c
parent5ff1b3fe5a30c926e59a55ad25dd4daf430c8579 (diff)
gpu: nvgpu: rework ecc structure and sysfs
- create common file common/ecc.c which include common functions for add ecc counters and remove counters. - common code will create a list of all counter which make it easier to iterate all counters. - Add chip specific file for adding ecc counters. - add linux specific file os/linux/ecc_sysfs.c to export counters to sysfs. - remove obsolete code - MISRA violation for using snprintf is not solved, tracking with jira NVGPU-859 Jira NVGPUT-115 Change-Id: I1905c43c5c9b2b131199807533dee8e63ddc12f4 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1763536 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index 16eddeca..17c4e8b7 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -176,7 +176,7 @@ int gr_gp10b_handle_sm_exception(struct gk20a *g,
176 lrf_ecc_ded_status, 176 lrf_ecc_ded_status,
177 &lrf_single_count_delta, 177 &lrf_single_count_delta,
178 lrf_double_count_delta); 178 lrf_double_count_delta);
179 g->ecc.gr.sm_lrf_single_err_count.counters[tpc] += 179 g->ecc.gr.sm_lrf_ecc_single_err_count[gpc][tpc].counter +=
180 lrf_single_count_delta; 180 lrf_single_count_delta;
181 } 181 }
182 if (lrf_ecc_ded_status) { 182 if (lrf_ecc_ded_status) {
@@ -188,7 +188,7 @@ int gr_gp10b_handle_sm_exception(struct gk20a *g,
188 lrf_ecc_ded_status, 188 lrf_ecc_ded_status,
189 &lrf_double_count_delta, 189 &lrf_double_count_delta,
190 lrf_single_count_delta); 190 lrf_single_count_delta);
191 g->ecc.gr.sm_lrf_double_err_count.counters[tpc] += 191 g->ecc.gr.sm_lrf_ecc_double_err_count[gpc][tpc].counter +=
192 lrf_double_count_delta; 192 lrf_double_count_delta;
193 } 193 }
194 gk20a_writel(g, gr_pri_gpc0_tpc0_sm_lrf_ecc_status_r() + offset, 194 gk20a_writel(g, gr_pri_gpc0_tpc0_sm_lrf_ecc_status_r() + offset,
@@ -213,9 +213,9 @@ int gr_gp10b_handle_sm_exception(struct gk20a *g,
213 ecc_stats_reg_val = 213 ecc_stats_reg_val =
214 gk20a_readl(g, 214 gk20a_readl(g,
215 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r() + offset); 215 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r() + offset);
216 g->ecc.gr.sm_shm_sec_count.counters[tpc] += 216 g->ecc.gr.sm_shm_ecc_sec_count[gpc][tpc].counter +=
217 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_v(ecc_stats_reg_val); 217 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_v(ecc_stats_reg_val);
218 g->ecc.gr.sm_shm_sed_count.counters[tpc] += 218 g->ecc.gr.sm_shm_ecc_sed_count[gpc][tpc].counter +=
219 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_v(ecc_stats_reg_val); 219 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_v(ecc_stats_reg_val);
220 ecc_stats_reg_val &= ~(gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_m() | 220 ecc_stats_reg_val &= ~(gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_corrected_m() |
221 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_m()); 221 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_single_detected_m());
@@ -235,7 +235,7 @@ int gr_gp10b_handle_sm_exception(struct gk20a *g,
235 ecc_stats_reg_val = 235 ecc_stats_reg_val =
236 gk20a_readl(g, 236 gk20a_readl(g,
237 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r() + offset); 237 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_r() + offset);
238 g->ecc.gr.sm_shm_ded_count.counters[tpc] += 238 g->ecc.gr.sm_shm_ecc_ded_count[gpc][tpc].counter +=
239 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_v(ecc_stats_reg_val); 239 gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_v(ecc_stats_reg_val);
240 ecc_stats_reg_val &= ~(gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_m()); 240 ecc_stats_reg_val &= ~(gr_pri_gpc0_tpc0_sm_shm_ecc_err_count_double_detected_m());
241 gk20a_writel(g, 241 gk20a_writel(g,
@@ -276,7 +276,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
276 276
277 ecc_stats_reg_val = gk20a_readl(g, 277 ecc_stats_reg_val = gk20a_readl(g,
278 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset); 278 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset);
279 g->ecc.gr.tex_total_sec_pipe0_count.counters[tpc] += 279 g->ecc.gr.tex_ecc_total_sec_pipe0_count[gpc][tpc].counter +=
280 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_v(ecc_stats_reg_val); 280 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_v(ecc_stats_reg_val);
281 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_m(); 281 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_m();
282 gk20a_writel(g, 282 gk20a_writel(g,
@@ -285,7 +285,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
285 285
286 ecc_stats_reg_val = gk20a_readl(g, 286 ecc_stats_reg_val = gk20a_readl(g,
287 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset); 287 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset);
288 g->ecc.gr.tex_unique_sec_pipe0_count.counters[tpc] += 288 g->ecc.gr.tex_unique_ecc_sec_pipe0_count[gpc][tpc].counter +=
289 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_v(ecc_stats_reg_val); 289 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_v(ecc_stats_reg_val);
290 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_m(); 290 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_m();
291 gk20a_writel(g, 291 gk20a_writel(g,
@@ -300,7 +300,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
300 300
301 ecc_stats_reg_val = gk20a_readl(g, 301 ecc_stats_reg_val = gk20a_readl(g,
302 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset); 302 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset);
303 g->ecc.gr.tex_total_sec_pipe1_count.counters[tpc] += 303 g->ecc.gr.tex_ecc_total_sec_pipe1_count[gpc][tpc].counter +=
304 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_v(ecc_stats_reg_val); 304 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_v(ecc_stats_reg_val);
305 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_m(); 305 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_sec_m();
306 gk20a_writel(g, 306 gk20a_writel(g,
@@ -309,7 +309,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
309 309
310 ecc_stats_reg_val = gk20a_readl(g, 310 ecc_stats_reg_val = gk20a_readl(g,
311 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset); 311 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset);
312 g->ecc.gr.tex_unique_sec_pipe1_count.counters[tpc] += 312 g->ecc.gr.tex_unique_ecc_sec_pipe1_count[gpc][tpc].counter +=
313 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_v(ecc_stats_reg_val); 313 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_v(ecc_stats_reg_val);
314 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_m(); 314 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_sec_m();
315 gk20a_writel(g, 315 gk20a_writel(g,
@@ -332,7 +332,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
332 332
333 ecc_stats_reg_val = gk20a_readl(g, 333 ecc_stats_reg_val = gk20a_readl(g,
334 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset); 334 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset);
335 g->ecc.gr.tex_total_ded_pipe0_count.counters[tpc] += 335 g->ecc.gr.tex_ecc_total_ded_pipe0_count[gpc][tpc].counter +=
336 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_v(ecc_stats_reg_val); 336 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_v(ecc_stats_reg_val);
337 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_m(); 337 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_m();
338 gk20a_writel(g, 338 gk20a_writel(g,
@@ -341,7 +341,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
341 341
342 ecc_stats_reg_val = gk20a_readl(g, 342 ecc_stats_reg_val = gk20a_readl(g,
343 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset); 343 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset);
344 g->ecc.gr.tex_unique_ded_pipe0_count.counters[tpc] += 344 g->ecc.gr.tex_unique_ecc_ded_pipe0_count[gpc][tpc].counter +=
345 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_v(ecc_stats_reg_val); 345 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_v(ecc_stats_reg_val);
346 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_m(); 346 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_m();
347 gk20a_writel(g, 347 gk20a_writel(g,
@@ -356,7 +356,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
356 356
357 ecc_stats_reg_val = gk20a_readl(g, 357 ecc_stats_reg_val = gk20a_readl(g,
358 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset); 358 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_r() + offset);
359 g->ecc.gr.tex_total_ded_pipe1_count.counters[tpc] += 359 g->ecc.gr.tex_ecc_total_ded_pipe1_count[gpc][tpc].counter +=
360 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_v(ecc_stats_reg_val); 360 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_v(ecc_stats_reg_val);
361 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_m(); 361 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_total_ded_m();
362 gk20a_writel(g, 362 gk20a_writel(g,
@@ -365,7 +365,7 @@ int gr_gp10b_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
365 365
366 ecc_stats_reg_val = gk20a_readl(g, 366 ecc_stats_reg_val = gk20a_readl(g,
367 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset); 367 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_r() + offset);
368 g->ecc.gr.tex_unique_ded_pipe1_count.counters[tpc] += 368 g->ecc.gr.tex_unique_ecc_ded_pipe1_count[gpc][tpc].counter +=
369 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_v(ecc_stats_reg_val); 369 gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_v(ecc_stats_reg_val);
370 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_m(); 370 ecc_stats_reg_val &= ~gr_pri_gpc0_tpc0_tex_m_ecc_cnt_unique_ded_m();
371 gk20a_writel(g, 371 gk20a_writel(g,