diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/mc_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/mc_gp10b.c | 54 |
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 | ||
71 | irqreturn_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 | |||
102 | void mc_gp10b_isr_stall(struct gk20a *g) | 71 | void 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 | ||
142 | u32 mc_gp10b_intr_nonstall(struct gk20a *g) | ||
143 | { | ||
144 | return gk20a_readl(g, mc_intr_r(NVGPU_MC_INTR_NONSTALLING)); | ||
145 | } | ||
146 | |||
147 | void 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 | |||
153 | void 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 | |||
173 | static bool mc_gp10b_is_intr1_pending(struct gk20a *g, | 159 | static 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; |