diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c index c9b2b4935..30e7351c0 100644 --- a/drivers/gpu/nvgpu/common/mm/mm.c +++ b/drivers/gpu/nvgpu/common/mm/mm.c @@ -159,10 +159,8 @@ static void nvgpu_remove_mm_support(struct mm_gk20a *mm) if (g->ops.mm.remove_bar2_vm) g->ops.mm.remove_bar2_vm(g); - if (g->ops.mm.is_bar1_supported(g)) { - nvgpu_free_inst_block(g, &mm->bar1.inst_block); - nvgpu_vm_put(mm->bar1.vm); - } + nvgpu_free_inst_block(g, &mm->bar1.inst_block); + nvgpu_vm_put(mm->bar1.vm); nvgpu_free_inst_block(g, &mm->pmu.inst_block); nvgpu_free_inst_block(g, &mm->hwpm.inst_block); @@ -377,11 +375,10 @@ static int nvgpu_init_mm_setup_sw(struct gk20a *g) if (err) return err; - if (g->ops.mm.is_bar1_supported(g)) { - err = nvgpu_init_bar1_vm(mm); - if (err) - return err; - } + err = nvgpu_init_bar1_vm(mm); + if (err) + return err; + if (g->ops.mm.init_bar2_vm) { err = g->ops.mm.init_bar2_vm(g); if (err) diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index 1a7f08749..87775a3f5 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -24,6 +24,7 @@ #include "common/bus/bus_gk20a.h" #include "common/bus/bus_gp10b.h" +#include "common/bus/bus_gm20b.h" #include "common/clock_gating/gv11b_gating_reglist.h" #include "common/ptimer/ptimer_gk20a.h" @@ -745,7 +746,7 @@ static const struct gpu_ops gv11b_ops = { .bus = { .init_hw = gk20a_bus_init_hw, .isr = gk20a_bus_isr, - .bar1_bind = NULL, + .bar1_bind = gm20b_bus_bar1_bind, .bar2_bind = gp10b_bus_bar2_bind, .set_bar0_window = gk20a_bus_set_bar0_window, }, diff --git a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c index e1d908292..0cf08d4a1 100644 --- a/drivers/gpu/nvgpu/gv11b/mm_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/mm_gv11b.c @@ -249,7 +249,11 @@ void gv11b_mm_l2_flush(struct gk20a *g, bool invalidate) g->ops.mm.fb_flush(g); gk20a_mm_l2_flush(g, invalidate); - g->ops.mm.fb_flush(g); + if (g->ops.bus.bar1_bind) + g->ops.fb.tlb_invalidate(g, + g->mm.bar1.vm->pdb.mem); + else + g->ops.mm.fb_flush(g); } /* diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index fd408e3ad..2b65c992f 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -21,6 +21,7 @@ */ #include "common/bus/bus_gk20a.h" +#include "common/bus/bus_gm20b.h" #include "common/clock_gating/gv11b_gating_reglist.h" #include @@ -597,7 +598,7 @@ static const struct gpu_ops vgpu_gv11b_ops = { .bus = { .init_hw = gk20a_bus_init_hw, .isr = gk20a_bus_isr, - .bar1_bind = NULL, + .bar1_bind = gm20b_bus_bar1_bind, .bar2_bind = NULL, .set_bar0_window = gk20a_bus_set_bar0_window, },