gpu: nvgpu: update fb unit ecc init, handling

The ecc init, handling for the fb unit is refactored to improve reusability
for nvgpu-next.

The following changes have been done:
- fb.ecc:
  This is a new subunit within fb and contains the following functions:
  - init: Moved from fb.fb_ecc_init.
  - free: Moved from fb.fb_ecc_free.
  - l2tlb_error_mask: Fetch bit mask for corrected, uncorrected errors supported
    by the unit.
- fb.intr:
  This unit has been updated to include the following ecc interrupt, error
  handlers:
  - handle_ecc: Top level interrupt handler for fb ecc errors.
  - handle_ecc_l2tlb: Handle errors within l2tlb memory.
  - handle_ecc_hubtlb: Handle errors within hubtlb memory.
  - handle_ecc_fillunit: Handle errors within fillunit memory

Jira: NVGPU-5032

Change-Id: I1a26c1823eb992e0e0175250b969f1186dff6e62
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2333271
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2020-04-22 21:43:51 +05:30
committed by Alex Waterman
parent 8f715117d4
commit 50dcfe1637
24 changed files with 348 additions and 131 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -192,7 +192,7 @@ int test_ecc_free(struct unit_module *m, struct gk20a *g,
* - "nvgpu_ecc_free" should skip freeing ecc counters for fb, fpba,
* pmu and return without faulting.
*/
g->ops.fb.fb_ecc_free = NULL;
g->ops.fb.ecc.free = NULL;
g->ops.pmu.ecc_free = NULL;
g->ecc.ltc.ecc_sec_count = nvgpu_kzalloc(g,
sizeof(*g->ecc.ltc.ecc_sec_count));
@@ -210,7 +210,7 @@ int test_ecc_free(struct unit_module *m, struct gk20a *g,
* - fb and pmu ecc HALs have ecc free handles are set.
* - "nvgpu_ecc_free" should return without faulting.
*/
g->ops.fb.fb_ecc_free = mock_ecc_free;
g->ops.fb.ecc.free = mock_ecc_free;
g->ops.pmu.ecc_free = mock_ecc_free;
g->ecc.ltc.ecc_sec_count = nvgpu_kzalloc(g,
sizeof(*g->ecc.ltc.ecc_sec_count));