summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ecc_gk20a.h
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-05-31 09:43:43 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-06-15 08:04:16 -0400
commit8f2cb85983c7cd0c913e6a06df16f929d58a10a9 (patch)
tree8b56f492d2e422104690f38606bba824ded45cff /drivers/gpu/nvgpu/gk20a/ecc_gk20a.h
parent19e9a791955811416729ae3a94439c09000b3952 (diff)
gpu: nvgpu: update ecc sysfs node handling
Make ecc sysfs hash table per GPU by adding it as part of nvgpu_os_linux. Using a single hash table might give incorrect results as GPUs have same filenames and a filename is used as a key for a lookup. Add device_attribute as part of struct gk20a_ecc_stat. Using a single array of pointers of device attribute for an ecc_stat results in memory leak and incorrect stats if multiple GPUs are present on the system. This array of pointers will always hold info for GPU which created sysfs nodes last. Fix this by making device attribute array per ecc stat per GPU. Fix ecc stat removal to consider zero sub-units for a given number of hwunits. The multiplication with zero results in not removing any sysfs node at all. Bug 1987855 Change-Id: Ifcacc5623cede8decfe228c02d72786337cd0876 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1735989 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ecc_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ecc_gk20a.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ecc_gk20a.h b/drivers/gpu/nvgpu/gk20a/ecc_gk20a.h
index af10f828..9c50a809 100644
--- a/drivers/gpu/nvgpu/gk20a/ecc_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/ecc_gk20a.h
@@ -30,6 +30,7 @@ struct gk20a_ecc_stat {
30 u32 count; 30 u32 count;
31#ifdef CONFIG_SYSFS 31#ifdef CONFIG_SYSFS
32 struct hlist_node hash_node; 32 struct hlist_node hash_node;
33 struct device_attribute *attr_array;
33#endif 34#endif
34}; 35};
35 36