From 5ff1b3fe5a30c926e59a55ad25dd4daf430c8579 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 10 Jul 2018 11:08:23 -0700 Subject: gpu: nvgpu: gv11b: issue runlist preempt during teardown -During teardown issue runlist preempt -preempt_ch_tsg hal is removed as it is no more required. This hal was added to be called from teardown so that if there is preempt timeout, preempt timeout recovery is not triggered. Bug 200426402 Change-Id: I679e3306aa890ff0cfa211cfcc7d5405b7cb1211 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1775443 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 - drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 - drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 56 +-------------------------- drivers/gpu/nvgpu/gv11b/fifo_gv11b.h | 1 - drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 1 - drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 1 - 6 files changed, 1 insertion(+), 61 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 17b0a60b..7cb8462f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -686,8 +686,6 @@ struct gpu_ops { u32 (*intr_0_error_mask)(struct gk20a *g); int (*is_preempt_pending)(struct gk20a *g, u32 id, unsigned int id_type); - int (*preempt_ch_tsg)(struct gk20a *g, u32 id, - unsigned int id_type); void (*init_pbdma_intr_descs)(struct fifo_gk20a *f); int (*reset_enable_hw)(struct gk20a *g); int (*setup_userd)(struct channel_gk20a *c); diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index ebcab011..fdbbef36 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -638,7 +638,6 @@ static const struct gpu_ops gv100_ops = { .resetup_ramfc = NULL, .device_info_fault_id = top_device_info_data_fault_id_enum_v, .free_channel_ctx_header = gv11b_free_subctx_header, - .preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg, .runlist_hw_submit = gk20a_fifo_runlist_hw_submit, .runlist_wait_pending = gk20a_fifo_runlist_wait_pending, .ring_channel_doorbell = gv11b_ring_channel_doorbell, diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 7e0bbf81..210a863b 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c @@ -951,52 +951,6 @@ static void gv11b_fifo_locked_preempt_runlists(struct gk20a *g, u32 runlists_mas nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); } -static int __locked_fifo_preempt_ch_tsg(struct gk20a *g, u32 id, - unsigned int id_type) -{ - int ret; - struct fifo_gk20a *f = &g->fifo; - - nvgpu_log_fn(g, "id:%d id_type:%d", id, id_type); - - /* Issue tsg preempt. Channel preempt is noop */ - if (id_type == ID_TYPE_CHANNEL) - gk20a_fifo_issue_preempt(g, f->channel[id].tsgid, true); - else - gk20a_fifo_issue_preempt(g, id, true); - - /* wait for preempt */ - ret = g->ops.fifo.is_preempt_pending(g, id, id_type); - - /* No recovery even if preempt timed out since - * this is called from recovery path - */ - - return ret; -} - - -int gv11b_fifo_preempt_ch_tsg(struct gk20a *g, u32 id, - unsigned int id_type) -{ - u32 ret = 0; - u32 token = PMU_INVALID_MUTEX_OWNER_ID; - u32 mutex_ret = 0; - - mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); - /* - * This is called from teardown path only. runlist_lock - * is already acquired before calling this function. - */ - ret = __locked_fifo_preempt_ch_tsg(g, id, id_type); - - if (!mutex_ret) - nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); - - return ret; - -} - static void gv11b_fifo_locked_abort_runlist_active_tsgs(struct gk20a *g, unsigned int rc_type, u32 runlists_mask) @@ -1174,15 +1128,7 @@ void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, * that all PBDMAs serving the engine are not loaded when engine is * reset. */ - if (tsg) { - int preempt_failed; - - preempt_failed = g->ops.fifo.preempt_ch_tsg(g, id, id_type); - if (preempt_failed) - gv11b_fifo_locked_preempt_runlists(g, runlists_mask); - } else { - gv11b_fifo_locked_preempt_runlists(g, runlists_mask); - } + gv11b_fifo_locked_preempt_runlists(g, runlists_mask); /* check if engine reset should be deferred */ for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h index ec89bc5b..1703fbdc 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h @@ -84,7 +84,6 @@ int gv11b_fifo_is_preempt_pending(struct gk20a *g, u32 id, int gv11b_fifo_preempt_channel(struct gk20a *g, u32 chid); int gv11b_fifo_preempt_tsg(struct gk20a *g, u32 tsgid); int gv11b_fifo_enable_tsg(struct tsg_gk20a *tsg); -int gv11b_fifo_preempt_ch_tsg(struct gk20a *g, u32 id, unsigned int id_type); void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, u32 id, unsigned int id_type, unsigned int rc_type, struct mmu_fault_info *mmfault); diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 00367e5b..366d6928 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -602,7 +602,6 @@ static const struct gpu_ops gv11b_ops = { .resetup_ramfc = NULL, .device_info_fault_id = top_device_info_data_fault_id_enum_v, .free_channel_ctx_header = gv11b_free_subctx_header, - .preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg, .handle_ctxsw_timeout = gv11b_fifo_handle_ctxsw_timeout, .runlist_hw_submit = gk20a_fifo_runlist_hw_submit, .runlist_wait_pending = gk20a_fifo_runlist_wait_pending, diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index 386389b7..5da9fed5 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -448,7 +448,6 @@ static const struct gpu_ops vgpu_gv11b_ops = { .reschedule_runlist = NULL, .device_info_fault_id = top_device_info_data_fault_id_enum_v, .free_channel_ctx_header = vgpu_gv11b_free_subctx_header, - .preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg, .handle_ctxsw_timeout = gv11b_fifo_handle_ctxsw_timeout, .runlist_hw_submit = gk20a_fifo_runlist_hw_submit, .runlist_wait_pending = gk20a_fifo_runlist_wait_pending, -- cgit v1.2.2