diff options
author | David Nieto <dmartineznie@nvidia.com> | 2017-02-13 14:22:59 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-20 19:39:55 -0400 |
commit | 74fe1caa2b56aab24c17ad4dd2524128fc237894 (patch) | |
tree | 0793bb92b67d64690658f3f7cd1a8e1ea93206ba /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 469308becaff326da02fcf791e803e812e1cf9f8 (diff) |
gpu: nvgpu: Add refcounting to driver fds
The main driver structure is not refcounted properly,
so when the driver unload, file desciptors associated to the
driver are kept open with dangling references to the main object.
This change adds referencing to the gk20a structure.
bug 200277762
JIRA: EVLR-1023
Change-Id: Id892e9e1677a344789e99bf649088c076f0bf8de
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1317420
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a4f0799a..3ba05e84 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -857,6 +857,7 @@ struct gk20a { | |||
857 | atomic_t nonstall_ops; | 857 | atomic_t nonstall_ops; |
858 | struct work_struct nonstall_fn_work; | 858 | struct work_struct nonstall_fn_work; |
859 | struct workqueue_struct *nonstall_work_queue; | 859 | struct workqueue_struct *nonstall_work_queue; |
860 | struct kref refcount; | ||
860 | 861 | ||
861 | struct resource *reg_mem; | 862 | struct resource *reg_mem; |
862 | void __iomem *regs; | 863 | void __iomem *regs; |
@@ -1468,6 +1469,9 @@ static inline void gk20a_channel_trace_sched_param( | |||
1468 | 1469 | ||
1469 | void nvgpu_wait_for_deferred_interrupts(struct gk20a *g); | 1470 | void nvgpu_wait_for_deferred_interrupts(struct gk20a *g); |
1470 | 1471 | ||
1472 | struct gk20a * __must_check gk20a_get(struct gk20a *g); | ||
1473 | void gk20a_put(struct gk20a *g); | ||
1474 | |||
1471 | #ifdef CONFIG_DEBUG_FS | 1475 | #ifdef CONFIG_DEBUG_FS |
1472 | int gk20a_railgating_debugfs_init(struct device *dev); | 1476 | int gk20a_railgating_debugfs_init(struct device *dev); |
1473 | #endif | 1477 | #endif |