summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
authorDavid Nieto <dmartineznie@nvidia.com>2017-03-13 23:23:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-25 05:06:55 -0400
commite0f2afe5eb43fb32490ccabd504879c3e3e54623 (patch)
treed227311914fd44e88e1ab13b652870c0fa772cf1 /drivers/gpu/nvgpu/gk20a/gk20a.h
parentb48186488d0108dee7b3fb755b2d99f4652780df (diff)
gpu: nvgpu: refactor teardown to support unbind
This change refactors the teardown in remove to ensure that it is possible to unload the driver while leaving fds open. This is achieved by making sure that the SW state is kept alive till all fds are closed and by checking that subsequent calls to ioctls after the teardown fail. Normally, this would be achieved ny calls into gk20a_busy(), but in kickoff we dont call into that to reduce latency, so we need to check the driver status directly, and also in some of the functions as we need to make sure the ioctl does not dereference the device or platform struct bug 200277762 JIRA: EVLR-1023 Change-Id: I163e47a08c29d4d5b3ab79f0eb531ef234f40bde Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1320219 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 30f1b371..f4ca5649 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -877,6 +877,9 @@ struct gk20a {
877 atomic_t nonstall_ops; 877 atomic_t nonstall_ops;
878 struct work_struct nonstall_fn_work; 878 struct work_struct nonstall_fn_work;
879 struct workqueue_struct *nonstall_work_queue; 879 struct workqueue_struct *nonstall_work_queue;
880
881 bool is_fmodel;
882
880 struct kref refcount; 883 struct kref refcount;
881 884
882 struct resource *reg_mem; 885 struct resource *reg_mem;
@@ -987,7 +990,7 @@ struct gk20a {
987 bool global_profiler_reservation_held; 990 bool global_profiler_reservation_held;
988 int profiler_reservation_count; 991 int profiler_reservation_count;
989 992
990 void (*remove_support)(struct device *); 993 void (*remove_support)(struct gk20a *);
991 994
992 u64 pg_ingating_time_us; 995 u64 pg_ingating_time_us;
993 u64 pg_ungating_time_us; 996 u64 pg_ungating_time_us;
@@ -1455,7 +1458,7 @@ extern struct class nvgpu_class;
1455 1458
1456int gk20a_pm_init(struct device *dev); 1459int gk20a_pm_init(struct device *dev);
1457int gk20a_pm_finalize_poweron(struct device *dev); 1460int gk20a_pm_finalize_poweron(struct device *dev);
1458void gk20a_remove_support(struct device *dev); 1461void gk20a_remove_support(struct gk20a *g);
1459 1462
1460static inline struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch) 1463static inline struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)
1461{ 1464{