From 4d6aafe2807f046eb89a2fa517106fab6c397493 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Tue, 11 Jun 2019 14:48:56 -0700 Subject: [PATCH] gpu: nvgpu: unit: stub l2_flush for channel setup bind Stub g->ops.mm.l2_flush for channel setup bind, as calling HALs is failing in GVS. This does not affect branch coverage for this unit test. Bug 2621189 Change-Id: I3a286f8d09456fe94c661d4be7140791a5ddca61 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/2134652 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/fifo/channel/nvgpu-channel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/userspace/units/fifo/channel/nvgpu-channel.c b/userspace/units/fifo/channel/nvgpu-channel.c index 78e451c99..9ef01a66a 100644 --- a/userspace/units/fifo/channel/nvgpu-channel.c +++ b/userspace/units/fifo/channel/nvgpu-channel.c @@ -626,6 +626,11 @@ static int stub_ramfc_setup_EINVAL(struct nvgpu_channel *ch, u64 gpfifo_base, return -EINVAL; } +static int stub_mm_l2_flush(struct gk20a *g, bool invalidate) +{ + return 0; +} + static int test_channel_setup_bind(struct unit_module *m, struct gk20a *g, void *args) { @@ -662,6 +667,7 @@ static int test_channel_setup_bind(struct unit_module *m, assert(ch != NULL); g->ops.gr.intr.flush_channel_tlb = stub_gr_intr_flush_channel_tlb; + g->ops.mm.cache.l2_flush = stub_mm_l2_flush; /* bug 2621189 */ mm.g = g; vm.mm = &mm;