From 7f14aafc2c02eb0fab458324d0ba91a7fdea3086 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 26 Jun 2018 17:37:40 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1763536 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fb/fb_gv11b.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/gpu/nvgpu/common/fb/fb_gv11b.c') 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) uncorrected_delta += (0x1UL << fb_mmu_l2tlb_ecc_uncorrected_err_count_total_s()); - g->ecc.fb.mmu_l2tlb_corrected_err_count.counters[0] += + g->ecc.fb.mmu_l2tlb_ecc_corrected_err_count[0].counter += corrected_delta; - g->ecc.fb.mmu_l2tlb_uncorrected_err_count.counters[0] += + g->ecc.fb.mmu_l2tlb_ecc_uncorrected_err_count[0].counter += uncorrected_delta; 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) "ecc error address: 0x%x", ecc_addr); nvgpu_log(g, gpu_dbg_intr, "ecc error count corrected: %d, uncorrected %d", - g->ecc.fb.mmu_l2tlb_corrected_err_count.counters[0], - g->ecc.fb.mmu_l2tlb_uncorrected_err_count.counters[0]); + g->ecc.fb.mmu_l2tlb_ecc_corrected_err_count[0].counter, + g->ecc.fb.mmu_l2tlb_ecc_uncorrected_err_count[0].counter); } void 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) uncorrected_delta += (0x1UL << fb_mmu_hubtlb_ecc_uncorrected_err_count_total_s()); - g->ecc.fb.mmu_hubtlb_corrected_err_count.counters[0] += + g->ecc.fb.mmu_hubtlb_ecc_corrected_err_count[0].counter += corrected_delta; - g->ecc.fb.mmu_hubtlb_uncorrected_err_count.counters[0] += + g->ecc.fb.mmu_hubtlb_ecc_uncorrected_err_count[0].counter += uncorrected_delta; 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) "ecc error address: 0x%x", ecc_addr); nvgpu_log(g, gpu_dbg_intr, "ecc error count corrected: %d, uncorrected %d", - g->ecc.fb.mmu_hubtlb_corrected_err_count.counters[0], - g->ecc.fb.mmu_hubtlb_uncorrected_err_count.counters[0]); + g->ecc.fb.mmu_hubtlb_ecc_corrected_err_count[0].counter, + g->ecc.fb.mmu_hubtlb_ecc_uncorrected_err_count[0].counter); } void 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) uncorrected_delta += (0x1UL << fb_mmu_fillunit_ecc_uncorrected_err_count_total_s()); - g->ecc.fb.mmu_fillunit_corrected_err_count.counters[0] += + g->ecc.fb.mmu_fillunit_ecc_corrected_err_count[0].counter += corrected_delta; - g->ecc.fb.mmu_fillunit_uncorrected_err_count.counters[0] += + g->ecc.fb.mmu_fillunit_ecc_uncorrected_err_count[0].counter += uncorrected_delta; 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) "ecc error address: 0x%x", ecc_addr); nvgpu_log(g, gpu_dbg_intr, "ecc error count corrected: %d, uncorrected %d", - g->ecc.fb.mmu_fillunit_corrected_err_count.counters[0], - g->ecc.fb.mmu_fillunit_uncorrected_err_count.counters[0]); + g->ecc.fb.mmu_fillunit_ecc_corrected_err_count[0].counter, + g->ecc.fb.mmu_fillunit_ecc_uncorrected_err_count[0].counter); } static void gv11b_fb_parse_mmfault(struct mmu_fault_info *mmfault) -- cgit v1.2.2