From 9953b17ae18c32fb1657afb4fc14e32ad161318b Mon Sep 17 00:00:00 2001 From: Nicolas Benech Date: Thu, 17 Jan 2019 11:26:51 -0500 Subject: [PATCH] gpu: nvgpu: unit: init dma field to 0 In the C1 test, the "dma" field of the supplied SGLs was not properly initialized to 0 which could cause crashes. JIRA NVGPU-907 Change-Id: I7cf2a4a455251817c64d255813c7495f24d5c6af Signed-off-by: Nicolas Benech Reviewed-on: https://git-master.nvidia.com/r/1997936 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/mm/gmmu/page_table/page_table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/userspace/units/mm/gmmu/page_table/page_table.c b/userspace/units/mm/gmmu/page_table/page_table.c index 4d79a68be..7eceb10a9 100644 --- a/userspace/units/mm/gmmu/page_table/page_table.c +++ b/userspace/units/mm/gmmu/page_table/page_table.c @@ -956,7 +956,7 @@ static struct vm_gk20a *init_test_req_vm(struct gk20a *g) static int test_nvgpu_page_table_c1_full(struct unit_module *m, struct gk20a *g, void *args) { - u32 mem_i; + u32 mem_i, i; struct nvgpu_mem mem[REQ_C1_NUM_MEMS] = {}; struct nvgpu_sgt *mixed_sgt = NULL; u32 nr_sgls = 5; @@ -998,6 +998,9 @@ static int test_nvgpu_page_table_c1_full(struct unit_module *m, mixed_sgl_list[4].length = SZ_64K * 10; mixed_sgl_list[4].phys = mixed_sgl_list[3].phys + mixed_sgl_list[3].length + TEST_HOLE_SIZE; + for (i = 0; i < nr_sgls; i++) { + mixed_sgl_list[i].dma = 0; + } mixed_sgt = custom_sgt_create(m, g, &mem[2], mixed_sgl_list, nr_sgls);