summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/driver_common.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-07-27 15:15:19 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-03 11:44:58 -0400
commite1df72771ba5e5331888f5bfc171f71bd8f4aed7 (patch)
tree26e367639be69587c2ba577a2b0a4ea8cb91efce /drivers/gpu/nvgpu/common/linux/driver_common.c
parent11e29991acd25baef5b786605e136b5e71737b8e (diff)
gpu: nvgpu: Move isr related fields from gk20a
Move fields in struct gk20a related to interrupt handling into Linux specific nvgpu_os_linux. At the same time move the counter logic from function in HAL into Linux specific code, and two Linux specific power management functions from generic gk20a.c to Linux specific module.c. JIRA NVGPU-123 Change-Id: I0a08fd2e81297c8dff7a85c263ded928496c4de0 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1528177 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sourab Gupta <sourabg@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/driver_common.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/driver_common.c17
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 */
237void nvgpu_wait_for_deferred_interrupts(struct gk20a *g) 237void 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}