diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/driver_common.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index 4e2cb2b4..bd1b7611 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -38,8 +38,8 @@ static void nvgpu_init_vars(struct gk20a *g) | |||
38 | struct device *dev = dev_from_gk20a(g); | 38 | struct device *dev = dev_from_gk20a(g); |
39 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 39 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
40 | 40 | ||
41 | init_waitqueue_head(&g->sw_irq_stall_last_handled_wq); | 41 | init_waitqueue_head(&l->sw_irq_stall_last_handled_wq); |
42 | init_waitqueue_head(&g->sw_irq_nonstall_last_handled_wq); | 42 | init_waitqueue_head(&l->sw_irq_nonstall_last_handled_wq); |
43 | gk20a_init_gr(g); | 43 | gk20a_init_gr(g); |
44 | 44 | ||
45 | init_rwsem(&g->busy_lock); | 45 | init_rwsem(&g->busy_lock); |
@@ -236,18 +236,19 @@ static int cyclic_delta(int a, int b) | |||
236 | */ | 236 | */ |
237 | void nvgpu_wait_for_deferred_interrupts(struct gk20a *g) | 237 | void nvgpu_wait_for_deferred_interrupts(struct gk20a *g) |
238 | { | 238 | { |
239 | int stall_irq_threshold = atomic_read(&g->hw_irq_stall_count); | 239 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
240 | int nonstall_irq_threshold = atomic_read(&g->hw_irq_nonstall_count); | 240 | int stall_irq_threshold = atomic_read(&l->hw_irq_stall_count); |
241 | int nonstall_irq_threshold = atomic_read(&l->hw_irq_nonstall_count); | ||
241 | 242 | ||
242 | /* wait until all stalling irqs are handled */ | 243 | /* wait until all stalling irqs are handled */ |
243 | wait_event(g->sw_irq_stall_last_handled_wq, | 244 | wait_event(l->sw_irq_stall_last_handled_wq, |
244 | cyclic_delta(stall_irq_threshold, | 245 | cyclic_delta(stall_irq_threshold, |
245 | atomic_read(&g->sw_irq_stall_last_handled)) | 246 | atomic_read(&l->sw_irq_stall_last_handled)) |
246 | <= 0); | 247 | <= 0); |
247 | 248 | ||
248 | /* wait until all non-stalling irqs are handled */ | 249 | /* wait until all non-stalling irqs are handled */ |
249 | wait_event(g->sw_irq_nonstall_last_handled_wq, | 250 | wait_event(l->sw_irq_nonstall_last_handled_wq, |
250 | cyclic_delta(nonstall_irq_threshold, | 251 | cyclic_delta(nonstall_irq_threshold, |
251 | atomic_read(&g->sw_irq_nonstall_last_handled)) | 252 | atomic_read(&l->sw_irq_nonstall_last_handled)) |
252 | <= 0); | 253 | <= 0); |
253 | } | 254 | } |