diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 67722c4c4..30445b45e 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -30,6 +30,7 @@ ccflags-y += -DNVGPU_USERD ccflags-y += -DNVGPU_CHANNEL_WDT ccflags-y += -DNVGPU_DGPU_SUPPORT ccflags-y += -DNVGPU_VPR +ccflags-y += -DNVGPU_REPLAYABLE_FAULT obj-$(CONFIG_GK20A) := nvgpu.o diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index aa1db85da..cc6473dcb 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -62,4 +62,7 @@ NVGPU_COMMON_CFLAGS += -DNVGPU_DGPU_SUPPORT NVGPU_VPR := 1 NVGPU_COMMON_CFLAGS += -DNVGPU_VPR + +NVGPU_REPLAYABLE_FAULT := 1 +NVGPU_COMMON_CFLAGS += -DNVGPU_REPLAYABLE_FAULT endif diff --git a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b.c b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b.c index e6d254ae7..15207379c 100644 --- a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b.c +++ b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b.c @@ -44,9 +44,11 @@ int gv11b_ramfc_setup(struct nvgpu_channel *ch, u64 gpfifo_base, nvgpu_memset(g, mem, 0, 0, ram_fc_size_val_v()); +#ifdef NVGPU_REPLAYABLE_FAULT if ((flags & NVGPU_SETUP_BIND_FLAGS_REPLAYABLE_FAULTS_ENABLE) != 0U) { replayable = true; } +#endif g->ops.ramin.init_subctx_pdb(g, mem, ch->vm->pdb.mem, replayable); diff --git a/drivers/gpu/nvgpu/hal/mm/mmu_fault/mmu_fault_gv11b.c b/drivers/gpu/nvgpu/hal/mm/mmu_fault/mmu_fault_gv11b.c index 10695550d..349c332b6 100644 --- a/drivers/gpu/nvgpu/hal/mm/mmu_fault/mmu_fault_gv11b.c +++ b/drivers/gpu/nvgpu/hal/mm/mmu_fault/mmu_fault_gv11b.c @@ -46,8 +46,10 @@ #include "hal/fb/fb_mmu_fault_gv11b.h" #include "hal/mm/mmu_fault/mmu_fault_gv11b.h" +#ifdef NVGPU_REPLAYABLE_FAULT static int gv11b_fb_fix_page_fault(struct gk20a *g, struct mmu_fault_info *mmufault); +#endif static const char * const invalid_str = "invalid"; @@ -305,7 +307,11 @@ void gv11b_mm_mmu_fault_handle_mmu_fault_common(struct gk20a *g, gmmu_fault_mmu_eng_id_ce0_v() + num_lce)) { /* CE page faults are not reported as replayable */ nvgpu_log(g, gpu_dbg_intr, "CE Faulted"); +#ifdef NVGPU_REPLAYABLE_FAULT err = gv11b_fb_fix_page_fault(g, mmufault); +#else + err = -EINVAL; +#endif if (mmufault->refch != NULL) { tsg = nvgpu_tsg_from_ch(mmufault->refch); @@ -401,7 +407,11 @@ void gv11b_mm_mmu_fault_handle_mmu_fault_common(struct gk20a *g, } else { if (mmufault->fault_type == gmmu_fault_type_pte_v()) { nvgpu_log(g, gpu_dbg_intr, "invalid pte! try to fix"); +#ifdef NVGPU_REPLAYABLE_FAULT err = gv11b_fb_fix_page_fault(g, mmufault); +#else + err = -EINVAL; +#endif if (err != 0) { *invalidate_replay_val |= gv11b_fb_get_replay_cancel_global_val(g); @@ -540,6 +550,7 @@ void gv11b_mm_mmu_fault_handle_other_fault_notify(struct gk20a *g, } } +#ifdef NVGPU_REPLAYABLE_FAULT static int gv11b_fb_fix_page_fault(struct gk20a *g, struct mmu_fault_info *mmufault) { @@ -594,6 +605,7 @@ static int gv11b_fb_fix_page_fault(struct gk20a *g, pte[1], pte[0]); return err; } +#endif void gv11b_mm_mmu_fault_disable_hw(struct gk20a *g) {