diff options
author | Richard Zhao <rizhao@nvidia.com> | 2018-06-05 19:40:50 -0400 |
---|---|---|
committer | Tejal Kudav <tkudav@nvidia.com> | 2018-06-14 09:44:08 -0400 |
commit | 7a5d498a711833990a9d8fc3f5d3f3e26bee301c (patch) | |
tree | 8fd4d77ea3835bd7c61681eeb90bd5c9f4df1cf9 /drivers | |
parent | d6c9f9f170a1d7a6bedbf5f7e2f1ec5cf4c9a3f1 (diff) |
gpu: nvgpu: handle replayable mmu fault during waiting for SM lockdown
outstanding replayable mmu fault will prevent SM from lockdown, so
handle the replayable mmu fault while polling lockdown status.
Jira EVLR-2643
Bug 200405202
Change-Id: I811f16ef4394a6cc42a5f37a17e426dd749c5652
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1741997
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fb_gv11b.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fb_gv11b.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 23 |
3 files changed, 27 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c index 9fd6c857..18906c01 100644 --- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.c | |||
@@ -1289,6 +1289,18 @@ void gv11b_fb_handle_dropped_mmu_fault(struct gk20a *g, u32 fault_status) | |||
1289 | } | 1289 | } |
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | void gv11b_fb_handle_replayable_mmu_fault(struct gk20a *g) | ||
1293 | { | ||
1294 | u32 fault_status = gk20a_readl(g, fb_mmu_fault_status_r()); | ||
1295 | |||
1296 | if (!(fault_status & fb_mmu_fault_status_replayable_m())) | ||
1297 | return; | ||
1298 | |||
1299 | if (gv11b_fb_is_fault_buf_enabled(g, NONREPLAY_REG_INDEX)) { | ||
1300 | gv11b_fb_handle_mmu_nonreplay_replay_fault(g, | ||
1301 | fault_status, REPLAY_REG_INDEX); | ||
1302 | } | ||
1303 | } | ||
1292 | 1304 | ||
1293 | static void gv11b_fb_handle_mmu_fault(struct gk20a *g, u32 niso_intr) | 1305 | static void gv11b_fb_handle_mmu_fault(struct gk20a *g, u32 niso_intr) |
1294 | { | 1306 | { |
diff --git a/drivers/gpu/nvgpu/gv11b/fb_gv11b.h b/drivers/gpu/nvgpu/gv11b/fb_gv11b.h index a28d1ff7..6f809b89 100644 --- a/drivers/gpu/nvgpu/gv11b/fb_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/fb_gv11b.h | |||
@@ -77,6 +77,7 @@ void gv11b_fb_handle_nonreplay_fault_overflow(struct gk20a *g, | |||
77 | u32 fault_status); | 77 | u32 fault_status); |
78 | void gv11b_fb_handle_replay_fault_overflow(struct gk20a *g, | 78 | void gv11b_fb_handle_replay_fault_overflow(struct gk20a *g, |
79 | u32 fault_status); | 79 | u32 fault_status); |
80 | void gv11b_fb_handle_replayable_mmu_fault(struct gk20a *g); | ||
80 | void gv11b_handle_l2tlb_ecc_isr(struct gk20a *g, u32 ecc_status); | 81 | void gv11b_handle_l2tlb_ecc_isr(struct gk20a *g, u32 ecc_status); |
81 | void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status); | 82 | void gv11b_handle_hubtlb_ecc_isr(struct gk20a *g, u32 ecc_status); |
82 | void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status); | 83 | void gv11b_handle_fillunit_ecc_isr(struct gk20a *g, u32 ecc_status); |
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 378bdc13..9bd48fdc 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "gv11b/subctx_gv11b.h" | 48 | #include "gv11b/subctx_gv11b.h" |
49 | #include "gv11b/gv11b.h" | 49 | #include "gv11b/gv11b.h" |
50 | #include "gv11b/gr_pri_gv11b.h" | 50 | #include "gv11b/gr_pri_gv11b.h" |
51 | #include "gv11b/fb_gv11b.h" | ||
51 | 52 | ||
52 | #include <nvgpu/hw/gv11b/hw_gr_gv11b.h> | 53 | #include <nvgpu/hw/gv11b/hw_gr_gv11b.h> |
53 | #include <nvgpu/hw/gv11b/hw_fifo_gv11b.h> | 54 | #include <nvgpu/hw/gv11b/hw_fifo_gv11b.h> |
@@ -3735,15 +3736,19 @@ int gv11b_gr_wait_for_sm_lock_down(struct gk20a *g, | |||
3735 | return 0; | 3736 | return 0; |
3736 | } | 3737 | } |
3737 | 3738 | ||
3738 | /* if an mmu fault is pending and mmu debug mode is not | 3739 | if (mmu_debug_mode_enabled) { |
3739 | * enabled, the sm will never lock down. | 3740 | gv11b_fb_handle_replayable_mmu_fault(g); |
3740 | */ | 3741 | } else { |
3741 | if (!mmu_debug_mode_enabled && | 3742 | /* if an mmu fault is pending and mmu debug mode is not |
3742 | (g->ops.mm.mmu_fault_pending(g))) { | 3743 | * enabled, the sm will never lock down. |
3743 | nvgpu_err(g, | 3744 | */ |
3744 | "GPC%d TPC%d: mmu fault pending," | 3745 | if (g->ops.mm.mmu_fault_pending(g)) { |
3745 | " SM%d will never lock down!", gpc, tpc, sm); | 3746 | nvgpu_err(g, |
3746 | return -EFAULT; | 3747 | "GPC%d TPC%d: mmu fault pending," |
3748 | " SM%d will never lock down!", | ||
3749 | gpc, tpc, sm); | ||
3750 | return -EFAULT; | ||
3751 | } | ||
3747 | } | 3752 | } |
3748 | 3753 | ||
3749 | nvgpu_usleep_range(delay, delay * 2); | 3754 | nvgpu_usleep_range(delay, delay * 2); |