summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2019-02-14 16:36:19 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2019-05-02 05:43:02 -0400
commitef69df6dae3dd21f10b035e687381a578344e417 (patch)
tree0cb1571076dcb6219e48e043976cc90bd95bd776 /drivers/gpu/nvgpu/gv11b
parent9bde6f8950c7f19f60d1e907e2458b965d35b8ff (diff)
gpu: nvgpu: add hal to mask/unmask intr during teardown
ctxsw timeout error prevents recovery as it can get triggered periodically. Disable ctxsw timeout interrupt to allow recovery. Bug 2092051 Bug 2429295 Bug 2484211 Bug 1890287 Change-Id: I47470e13968d8b26cdaf519b62fd510bc7ea05d9 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2019645 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> (cherry picked from commit 68c13e2f0447118d7391807c9b9269749d09a4ec in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2024899 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c31
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.h2
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c2
3 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index b5af2972..5b84df47 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -982,6 +982,33 @@ static void gv11b_fifo_locked_abort_runlist_active_tsgs(struct gk20a *g,
982 } 982 }
983} 983}
984 984
985void gv11b_fifo_teardown_mask_intr(struct gk20a *g)
986{
987 u32 val;
988
989 /*
990 * ctxsw timeout error prevents recovery, and ctxsw error will retrigger
991 * every 100ms. Disable ctxsw timeout error to allow recovery.
992 */
993 val = gk20a_readl(g, fifo_intr_en_0_r());
994 val &= ~ fifo_intr_0_ctxsw_timeout_pending_f();
995 gk20a_writel(g, fifo_intr_en_0_r(), val);
996 gk20a_writel(g, fifo_intr_ctxsw_timeout_r(),
997 gk20a_readl(g, fifo_intr_ctxsw_timeout_r()));
998
999}
1000
1001void gv11b_fifo_teardown_unmask_intr(struct gk20a *g)
1002{
1003 u32 val;
1004
1005 /* enable ctxsw timeout interrupt */
1006 val = gk20a_readl(g, fifo_intr_en_0_r());
1007 val |= fifo_intr_0_ctxsw_timeout_pending_f();
1008 gk20a_writel(g, fifo_intr_en_0_r(), val);
1009}
1010
1011
985void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, 1012void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask,
986 u32 id, unsigned int id_type, unsigned int rc_type, 1013 u32 id, unsigned int id_type, unsigned int rc_type,
987 struct mmu_fault_info *mmfault) 1014 struct mmu_fault_info *mmfault)
@@ -1001,6 +1028,8 @@ void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask,
1001 runlist_lock); 1028 runlist_lock);
1002 } 1029 }
1003 1030
1031 g->ops.fifo.teardown_mask_intr(g);
1032
1004 /* get runlist id and tsg */ 1033 /* get runlist id and tsg */
1005 if (id_type == ID_TYPE_TSG) { 1034 if (id_type == ID_TYPE_TSG) {
1006 if (id != FIFO_INVAL_TSG_ID) { 1035 if (id != FIFO_INVAL_TSG_ID) {
@@ -1195,6 +1224,8 @@ void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask,
1195 nvgpu_pmu_enable_elpg(g); 1224 nvgpu_pmu_enable_elpg(g);
1196 } 1225 }
1197 1226
1227 g->ops.fifo.teardown_unmask_intr(g);
1228
1198 /* release runlist_lock */ 1229 /* release runlist_lock */
1199 if (runlist_id != FIFO_INVAL_RUNLIST_ID) { 1230 if (runlist_id != FIFO_INVAL_RUNLIST_ID) {
1200 nvgpu_log_fn(g, "release runlist_lock runlist_id = %d", 1231 nvgpu_log_fn(g, "release runlist_lock runlist_id = %d",
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h
index 3d491bad..bc6b0f1c 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.h
@@ -87,6 +87,8 @@ int gv11b_fifo_enable_tsg(struct tsg_gk20a *tsg);
87void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, 87void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask,
88 u32 id, unsigned int id_type, unsigned int rc_type, 88 u32 id, unsigned int id_type, unsigned int rc_type,
89 struct mmu_fault_info *mmfault); 89 struct mmu_fault_info *mmfault);
90void gv11b_fifo_teardown_mask_intr(struct gk20a *g);
91void gv11b_fifo_teardown_unmask_intr(struct gk20a *g);
90void gv11b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f); 92void gv11b_fifo_init_pbdma_intr_descs(struct fifo_gk20a *f);
91int gv11b_init_fifo_reset_enable_hw(struct gk20a *g); 93int gv11b_init_fifo_reset_enable_hw(struct gk20a *g);
92bool gv11b_fifo_handle_sched_error(struct gk20a *g); 94bool gv11b_fifo_handle_sched_error(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index d52d1c7e..718b6f93 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -601,6 +601,8 @@ static const struct gpu_ops gv11b_ops = {
601 .init_pbdma_intr_descs = gv11b_fifo_init_pbdma_intr_descs, 601 .init_pbdma_intr_descs = gv11b_fifo_init_pbdma_intr_descs,
602 .reset_enable_hw = gv11b_init_fifo_reset_enable_hw, 602 .reset_enable_hw = gv11b_init_fifo_reset_enable_hw,
603 .teardown_ch_tsg = gv11b_fifo_teardown_ch_tsg, 603 .teardown_ch_tsg = gv11b_fifo_teardown_ch_tsg,
604 .teardown_mask_intr = gv11b_fifo_teardown_mask_intr,
605 .teardown_unmask_intr = gv11b_fifo_teardown_unmask_intr,
604 .handle_sched_error = gv11b_fifo_handle_sched_error, 606 .handle_sched_error = gv11b_fifo_handle_sched_error,
605 .handle_pbdma_intr_0 = gv11b_fifo_handle_pbdma_intr_0, 607 .handle_pbdma_intr_0 = gv11b_fifo_handle_pbdma_intr_0,
606 .handle_pbdma_intr_1 = gv11b_fifo_handle_pbdma_intr_1, 608 .handle_pbdma_intr_1 = gv11b_fifo_handle_pbdma_intr_1,