summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fb
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/common/fb
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/common/fb')
-rw-r--r--drivers/gpu/nvgpu/common/fb/fb_gv11b.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c
index 26dabd72..53f04188 100644
--- a/drivers/gpu/nvgpu/common/fb/fb_gv11b.c
+++ b/drivers/gpu/nvgpu/common/fb/fb_gv11b.c
@@ -445,9 +445,9 @@ void gv11b_handle_l2tlb_ecc_isr(struct gk20a *g, u32 ecc_status)
445 uncorrected_delta += (0x1UL << fb_mmu_l2tlb_ecc_uncorrected_err_count_total_s()); 445 uncorrected_delta += (0x1UL << fb_mmu_l2tlb_ecc_uncorrected_err_count_total_s());
446 446
447 447
448 g->ecc.fb.mmu_l2tlb_corrected_err_count.counters[0] += 448 g->ecc.fb.mmu_l2tlb_ecc_corrected_err_count[0].counter +=
449 corrected_delta; 449 corrected_delta;
450 g->ecc.fb.mmu_l2tlb_uncorrected_err_count.counters[0] += 450 g->ecc.fb.mmu_l2tlb_ecc_uncorrected_err_count[0].counter +=
451 uncorrected_delta; 451 uncorrected_delta;
452 452
453 if (ecc_status & fb_mmu_l2tlb_ecc_status_corrected_err_l2tlb_sa_data_m()) 453 if (ecc_status & fb_mmu_l2tlb_ecc_status_corrected_err_l2tlb_sa_data_m())
@@ -461,8 +461,8 @@ void gv11b_handle_l2tlb_ecc_isr(struct gk20a *g, u32 ecc_status)
461 "ecc error address: 0x%x", ecc_addr); 461 "ecc error address: 0x%x", ecc_addr);
462 nvgpu_log(g, gpu_dbg_intr, 462 nvgpu_log(g, gpu_dbg_intr,
463 "ecc error count corrected: %d, uncorrected %d", 463 "ecc error count corrected: %d, uncorrected %d",
464 g->ecc.fb.mmu_l2tlb_corrected_err_count.counters[0], 464 g->ecc.fb.mmu_l2tlb_ecc_corrected_err_count[0].counter,
465 g->ecc.fb.mmu_l2tlb_uncorrected_err_count.counters[0]); 465 g->ecc.fb.mmu_l2tlb_ecc_uncorrected_err_count[0].counter);
466} 466}
467 467
468void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status) 468void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status)
@@ -503,9 +503,9 @@ void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status)
503 uncorrected_delta += (0x1UL << fb_mmu_hubtlb_ecc_uncorrected_err_count_total_s()); 503 uncorrected_delta += (0x1UL << fb_mmu_hubtlb_ecc_uncorrected_err_count_total_s());
504 504
505 505
506 g->ecc.fb.mmu_hubtlb_corrected_err_count.counters[0] += 506 g->ecc.fb.mmu_hubtlb_ecc_corrected_err_count[0].counter +=
507 corrected_delta; 507 corrected_delta;
508 g->ecc.fb.mmu_hubtlb_uncorrected_err_count.counters[0] += 508 g->ecc.fb.mmu_hubtlb_ecc_uncorrected_err_count[0].counter +=
509 uncorrected_delta; 509 uncorrected_delta;
510 510
511 if (ecc_status & fb_mmu_hubtlb_ecc_status_corrected_err_sa_data_m()) 511 if (ecc_status & fb_mmu_hubtlb_ecc_status_corrected_err_sa_data_m())
@@ -519,8 +519,8 @@ void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status)
519 "ecc error address: 0x%x", ecc_addr); 519 "ecc error address: 0x%x", ecc_addr);
520 nvgpu_log(g, gpu_dbg_intr, 520 nvgpu_log(g, gpu_dbg_intr,
521 "ecc error count corrected: %d, uncorrected %d", 521 "ecc error count corrected: %d, uncorrected %d",
522 g->ecc.fb.mmu_hubtlb_corrected_err_count.counters[0], 522 g->ecc.fb.mmu_hubtlb_ecc_corrected_err_count[0].counter,
523 g->ecc.fb.mmu_hubtlb_uncorrected_err_count.counters[0]); 523 g->ecc.fb.mmu_hubtlb_ecc_uncorrected_err_count[0].counter);
524} 524}
525 525
526void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status) 526void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status)
@@ -561,9 +561,9 @@ void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status)
561 uncorrected_delta += (0x1UL << fb_mmu_fillunit_ecc_uncorrected_err_count_total_s()); 561 uncorrected_delta += (0x1UL << fb_mmu_fillunit_ecc_uncorrected_err_count_total_s());
562 562
563 563
564 g->ecc.fb.mmu_fillunit_corrected_err_count.counters[0] += 564 g->ecc.fb.mmu_fillunit_ecc_corrected_err_count[0].counter +=
565 corrected_delta; 565 corrected_delta;
566 g->ecc.fb.mmu_fillunit_uncorrected_err_count.counters[0] += 566 g->ecc.fb.mmu_fillunit_ecc_uncorrected_err_count[0].counter +=
567 uncorrected_delta; 567 uncorrected_delta;
568 568
569 if (ecc_status & fb_mmu_fillunit_ecc_status_corrected_err_pte_data_m()) 569 if (ecc_status & fb_mmu_fillunit_ecc_status_corrected_err_pte_data_m())
@@ -582,8 +582,8 @@ void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status)
582 "ecc error address: 0x%x", ecc_addr); 582 "ecc error address: 0x%x", ecc_addr);
583 nvgpu_log(g, gpu_dbg_intr, 583 nvgpu_log(g, gpu_dbg_intr,
584 "ecc error count corrected: %d, uncorrected %d", 584 "ecc error count corrected: %d, uncorrected %d",
585 g->ecc.fb.mmu_fillunit_corrected_err_count.counters[0], 585 g->ecc.fb.mmu_fillunit_ecc_corrected_err_count[0].counter,
586 g->ecc.fb.mmu_fillunit_uncorrected_err_count.counters[0]); 586 g->ecc.fb.mmu_fillunit_ecc_uncorrected_err_count[0].counter);
587} 587}
588 588
589static void gv11b_fb_parse_mmfault(struct mmu_fault_info *mmfault) 589static void gv11b_fb_parse_mmfault(struct mmu_fault_info *mmfault)