From e1df72771ba5e5331888f5bfc171f71bd8f4aed7 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 27 Jul 2017 12:15:19 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1528177 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sourab Gupta GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/gk20a.c | 26 -------------------------- drivers/gpu/nvgpu/gk20a/gk20a.h | 14 -------------- drivers/gpu/nvgpu/gk20a/mc_gk20a.c | 5 ----- 3 files changed, 45 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 21e861fe..6350bcf5 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -358,32 +358,6 @@ int gk20a_can_busy(struct gk20a *g) return 1; } -/* - * Start the process for unloading the driver. Set NVGPU_DRIVER_IS_DYING. - */ -void gk20a_driver_start_unload(struct gk20a *g) -{ - gk20a_dbg(gpu_dbg_shutdown, "Driver is now going down!\n"); - - down_write(&g->busy_lock); - __nvgpu_set_enabled(g, NVGPU_DRIVER_IS_DYING, true); - up_write(&g->busy_lock); - - if (g->is_virtual) - return; - - gk20a_wait_for_idle(dev_from_gk20a(g)); - - nvgpu_wait_for_deferred_interrupts(g); - gk20a_channel_cancel_pending_sema_waits(g); - - if (g->nonstall_work_queue) { - cancel_work_sync(&g->nonstall_fn_work); - destroy_workqueue(g->nonstall_work_queue); - g->nonstall_work_queue = NULL; - } -} - int gk20a_wait_for_idle(struct device *dev) { struct gk20a *g = get_gk20a(dev); diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 90c35a7b..8d9318b2 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1042,10 +1042,6 @@ struct gk20a { atomic_t usage_count; - atomic_t nonstall_ops; - struct work_struct nonstall_fn_work; - struct workqueue_struct *nonstall_work_queue; - struct kref refcount; struct resource *reg_mem; @@ -1224,15 +1220,6 @@ struct gk20a { u32 max_ltc_count; u32 ltc_count; - atomic_t hw_irq_stall_count; - atomic_t hw_irq_nonstall_count; - - atomic_t sw_irq_stall_last_handled; - wait_queue_head_t sw_irq_stall_last_handled_wq; - - atomic_t sw_irq_nonstall_last_handled; - wait_queue_head_t sw_irq_nonstall_last_handled_wq; - struct gk20a_channel_worker { struct nvgpu_thread poll_task; atomic_t put; @@ -1485,7 +1472,6 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset); int __gk20a_do_unidle(struct gk20a *g); int gk20a_can_busy(struct gk20a *g); -void gk20a_driver_start_unload(struct gk20a *g); int gk20a_wait_for_idle(struct device *dev); #define NVGPU_GPU_ARCHITECTURE_SHIFT 4 diff --git a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c index accda972..e25fcfc3 100644 --- a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c @@ -27,13 +27,11 @@ void mc_gk20a_isr_stall(struct gk20a *g) { u32 mc_intr_0; - int hw_irq_count; u32 engine_id_idx; u32 active_engine_id = 0; u32 engine_enum = ENGINE_INVAL_GK20A; mc_intr_0 = g->ops.mc.intr_stall(g); - hw_irq_count = atomic_read(&g->hw_irq_stall_count); gk20a_dbg(gpu_dbg_intr, "stall intr %08x\n", mc_intr_0); @@ -67,9 +65,6 @@ void mc_gk20a_isr_stall(struct gk20a *g) g->ops.ltc.isr(g); if (mc_intr_0 & mc_intr_0_pbus_pending_f()) g->ops.bus.isr(g); - - /* sync handled irq counter before re-enabling interrupts */ - atomic_set(&g->sw_irq_stall_last_handled, hw_irq_count); } void mc_gk20a_intr_enable(struct gk20a *g) -- cgit v1.2.2