diff options
author | Thomas Fleury <tfleury@nvidia.com> | 2017-10-26 19:41:24 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-06 16:41:36 -0500 |
commit | 94feb18de8a687bef7c94999161b6bebaa382709 (patch) | |
tree | 8bea74e24b9e29e5e0a920b956abbe73e90edff3 /drivers/gpu/nvgpu/boardobj/boardobjgrp.h | |
parent | 4e7c9c3008e8bd354afa471e1d97ba88b12194da (diff) |
gpu: nvgpu: call destructor for boardobj and boardobjgrp
Maintain a list of boardobj and boardobjgrp, so that we can free
related objects when removing pmu support. A flag is added in
boardobj so that the destructor can determine if it should free
the object. This 'allocated' flag is false when the object is
embedded into another structure, which should be freed through
other means.
JIRA EVLR-1959
Bug 200352099
Change-Id: I6a3ff3c57f7428dd145deacf98f2992a9be9796d
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1586596
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj/boardobjgrp.h')
-rw-r--r-- | drivers/gpu/nvgpu/boardobj/boardobjgrp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h index 14d7c1bb..32e92ae0 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobjgrp.h +++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp.h | |||
@@ -199,6 +199,7 @@ struct boardobjgrp { | |||
199 | 199 | ||
200 | boardobjgrp_pmudatainstget *pmudatainstget; | 200 | boardobjgrp_pmudatainstget *pmudatainstget; |
201 | boardobjgrp_pmustatusinstget *pmustatusinstget; | 201 | boardobjgrp_pmustatusinstget *pmustatusinstget; |
202 | struct nvgpu_list_node node; | ||
202 | }; | 203 | }; |
203 | 204 | ||
204 | /* | 205 | /* |
@@ -404,4 +405,12 @@ void boardobjgrpe32hdrset(struct nv_pmu_boardobjgrp *hdr, u32 objmask); | |||
404 | idx += 1; \ | 405 | idx += 1; \ |
405 | (n32) = idx; \ | 406 | (n32) = idx; \ |
406 | } | 407 | } |
408 | |||
409 | static inline struct boardobjgrp * | ||
410 | boardobjgrp_from_node(struct nvgpu_list_node *node) | ||
411 | { | ||
412 | return (struct boardobjgrp *) | ||
413 | ((uintptr_t)node - offsetof(struct boardobjgrp, node)); | ||
414 | }; | ||
415 | |||
407 | #endif | 416 | #endif |