summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
authorDavid Nieto <dmartineznie@nvidia.com>2017-02-06 18:44:55 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-14 14:46:38 -0400
commit403874fa75dbb00e974a8d0f88b6e92be01ba42e (patch)
tree0492e82ded3c4ce7ee4438b29bcadc2db9472279 /drivers/gpu/nvgpu/gk20a/gk20a.h
parent4deb494ad114088f5253d02d9ec31f9aaeb2778a (diff)
gpu: nvgpu: refactor interrupt handling
JIRA: EVLR-1004 (*) Refactor the non-stalling interrupt path to execute clear on the top half, so on dGPU case processing of stalling interrupts does not block non-stalling one. (*) Use a worker thread to do semaphore wakeups and allow batching of the non-stalling operations. (*) Fix a bug where some gpus will not properly track the completion of interrupts, preventing safe driver unloads Change-Id: Icc90a3acba544c97ec6a9285ab235d337ab9eefa Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1312796 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Lakshmanan M <lm@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Navneet Kumar <navneetk@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 12c9a3ea..092bf7ae 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -155,7 +155,7 @@ struct gpu_ops {
155 } ltc; 155 } ltc;
156 struct { 156 struct {
157 void (*isr_stall)(struct gk20a *g, u32 inst_id, u32 pri_base); 157 void (*isr_stall)(struct gk20a *g, u32 inst_id, u32 pri_base);
158 void (*isr_nonstall)(struct gk20a *g, u32 inst_id, u32 pri_base); 158 int (*isr_nonstall)(struct gk20a *g, u32 inst_id, u32 pri_base);
159 } ce2; 159 } ce2;
160 struct { 160 struct {
161 int (*init_fs_state)(struct gk20a *g); 161 int (*init_fs_state)(struct gk20a *g);
@@ -735,7 +735,8 @@ struct gpu_ops {
735 irqreturn_t (*isr_stall)(struct gk20a *g); 735 irqreturn_t (*isr_stall)(struct gk20a *g);
736 irqreturn_t (*isr_nonstall)(struct gk20a *g); 736 irqreturn_t (*isr_nonstall)(struct gk20a *g);
737 irqreturn_t (*isr_thread_stall)(struct gk20a *g); 737 irqreturn_t (*isr_thread_stall)(struct gk20a *g);
738 irqreturn_t (*isr_thread_nonstall)(struct gk20a *g); 738 void (*isr_thread_nonstall)(struct gk20a *g, u32 intr);
739 void (*isr_nonstall_cb)(struct work_struct *work);
739 u32 intr_mask_restore[4]; 740 u32 intr_mask_restore[4];
740 } mc; 741 } mc;
741 struct { 742 struct {
@@ -848,6 +849,10 @@ struct gk20a {
848 atomic_t usage_count; 849 atomic_t usage_count;
849 int driver_is_dying; 850 int driver_is_dying;
850 851
852 atomic_t nonstall_ops;
853 struct work_struct nonstall_fn_work;
854 struct workqueue_struct *nonstall_work_queue;
855
851 struct resource *reg_mem; 856 struct resource *reg_mem;
852 void __iomem *regs; 857 void __iomem *regs;
853 void __iomem *regs_saved; 858 void __iomem *regs_saved;
@@ -1151,6 +1156,12 @@ enum gk20a_dbg_categories {
1151 gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */ 1156 gpu_dbg_mem = BIT(31), /* memory accesses, very verbose */
1152}; 1157};
1153 1158
1159/* operations that will need to be executed on non stall workqueue */
1160enum gk20a_nonstall_ops {
1161 gk20a_nonstall_ops_wakeup_semaphore = BIT(0), /* wake up semaphore */
1162 gk20a_nonstall_ops_post_events = BIT(1),
1163};
1164
1154extern u32 gk20a_dbg_mask; 1165extern u32 gk20a_dbg_mask;
1155#ifdef CONFIG_GK20A_TRACE_PRINTK 1166#ifdef CONFIG_GK20A_TRACE_PRINTK
1156extern u32 gk20a_dbg_ftrace; 1167extern u32 gk20a_dbg_ftrace;