summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-06-05 17:25:35 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-07 23:07:00 -0400
commit942029a433390f3385ed9d6fc35476bbf9eafd98 (patch)
tree5a3ad7164d71908c3b0da0d95fb0220cc247af36 /drivers/gpu/nvgpu/gp10b/mc_gp10b.c
parentfc724baa4becf051b3e6647858a6ded90f1cee86 (diff)
gpu: nvgpu: Split non-stall interrupt handling
Split handling of stalling interrupt to Linux specific chip agnostic and OS independent chip specific parts. Linux specific chip independent part contains handler for ISR and passing the control to a bottom half worker. It uses the new MC HALs intr_nonstall (query interrupt status), intr_nonstall_pause (pause interrupts), intr_nonstall_resume (resume interrupts), and is_intr1_pending (query per-engine interrupt bit). MC HAL isr_nonstall is removed, because its work is now handled in chip independent code. JIRA NVGPU-26 Change-Id: I3e4c9905ef6eef7f1cc9f71b0278518ae663f87e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1497048 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mc_gp10b.c')
-rw-r--r--drivers/gpu/nvgpu/gp10b/mc_gp10b.c54
1 files changed, 20 insertions, 34 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/mc_gp10b.c b/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
index 7ccea370..39ad8f9b 100644
--- a/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/mc_gp10b.c
@@ -68,37 +68,6 @@ void mc_gp10b_intr_unit_config(struct gk20a *g, bool enable,
68 gk20a_writel(g, reg, mask); 68 gk20a_writel(g, reg, mask);
69} 69}
70 70
71irqreturn_t mc_gp10b_isr_nonstall(struct gk20a *g)
72{
73 u32 mc_intr_1;
74 u32 hw_irq_count;
75
76 if (!g->power_on)
77 return IRQ_NONE;
78
79 /* not from gpu when sharing irq with others */
80 mc_intr_1 = gk20a_readl(g, mc_intr_r(1));
81 if (unlikely(!mc_intr_1))
82 return IRQ_NONE;
83
84 gk20a_writel(g, mc_intr_en_clear_r(1), 0xffffffff);
85
86 if (g->ops.mc.isr_thread_nonstall)
87 g->ops.mc.isr_thread_nonstall(g, mc_intr_1);
88
89 hw_irq_count = atomic_inc_return(&g->hw_irq_nonstall_count);
90
91 gk20a_writel(g, mc_intr_en_set_r(NVGPU_MC_INTR_NONSTALLING),
92 g->ops.mc.intr_mask_restore[NVGPU_MC_INTR_NONSTALLING]);
93
94 /* sync handled irq counter before re-enabling interrupts */
95 atomic_set(&g->sw_irq_nonstall_last_handled, hw_irq_count);
96
97 wake_up_all(&g->sw_irq_nonstall_last_handled_wq);
98
99 return IRQ_HANDLED;
100}
101
102void mc_gp10b_isr_stall(struct gk20a *g) 71void mc_gp10b_isr_stall(struct gk20a *g)
103{ 72{
104 u32 mc_intr_0; 73 u32 mc_intr_0;
@@ -170,6 +139,23 @@ void mc_gp10b_intr_stall_resume(struct gk20a *g)
170 g->ops.mc.intr_mask_restore[NVGPU_MC_INTR_STALLING]); 139 g->ops.mc.intr_mask_restore[NVGPU_MC_INTR_STALLING]);
171} 140}
172 141
142u32 mc_gp10b_intr_nonstall(struct gk20a *g)
143{
144 return gk20a_readl(g, mc_intr_r(NVGPU_MC_INTR_NONSTALLING));
145}
146
147void mc_gp10b_intr_nonstall_pause(struct gk20a *g)
148{
149 gk20a_writel(g, mc_intr_en_clear_r(NVGPU_MC_INTR_NONSTALLING),
150 0xffffffff);
151}
152
153void mc_gp10b_intr_nonstall_resume(struct gk20a *g)
154{
155 gk20a_writel(g, mc_intr_en_set_r(NVGPU_MC_INTR_NONSTALLING),
156 g->ops.mc.intr_mask_restore[NVGPU_MC_INTR_NONSTALLING]);
157}
158
173static bool mc_gp10b_is_intr1_pending(struct gk20a *g, 159static bool mc_gp10b_is_intr1_pending(struct gk20a *g,
174 enum nvgpu_unit unit, u32 mc_intr_1) 160 enum nvgpu_unit unit, u32 mc_intr_1)
175{ 161{
@@ -202,9 +188,9 @@ void gp10b_init_mc(struct gpu_ops *gops)
202 gops->mc.intr_stall = mc_gp10b_intr_stall; 188 gops->mc.intr_stall = mc_gp10b_intr_stall;
203 gops->mc.intr_stall_pause = mc_gp10b_intr_stall_pause; 189 gops->mc.intr_stall_pause = mc_gp10b_intr_stall_pause;
204 gops->mc.intr_stall_resume = mc_gp10b_intr_stall_resume; 190 gops->mc.intr_stall_resume = mc_gp10b_intr_stall_resume;
205 gops->mc.isr_nonstall = mc_gp10b_isr_nonstall; 191 gops->mc.intr_nonstall = mc_gp10b_intr_nonstall;
206 gops->mc.isr_thread_nonstall = mc_gk20a_intr_thread_nonstall; 192 gops->mc.intr_nonstall_pause = mc_gp10b_intr_nonstall_pause;
207 gops->mc.isr_nonstall_cb = mc_gk20a_nonstall_cb; 193 gops->mc.intr_nonstall_resume = mc_gp10b_intr_nonstall_resume;
208 gops->mc.enable = gk20a_mc_enable; 194 gops->mc.enable = gk20a_mc_enable;
209 gops->mc.disable = gk20a_mc_disable; 195 gops->mc.disable = gk20a_mc_disable;
210 gops->mc.reset = gk20a_mc_reset; 196 gops->mc.reset = gk20a_mc_reset;