gpu: nvgpu: unit: fix crash in handle_bar2_fault test

In release config, the handle_bar2_fault test was failing. This
was caused by pointers to string not being initialized in the
mmu_fault_info structure.

JIRA NVGPU-932

Change-Id: Ie47f414c3701b851dc175bed19b68d9c9aec87d9
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2264181
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2019-12-17 10:48:23 -05:00
committed by Alex Waterman
parent cb117411ca
commit 533d9e1dc0

View File

@@ -274,6 +274,7 @@ int fb_mmu_fault_gv11b_handle_bar2_fault(struct unit_module *m, struct gk20a *g,
struct mmu_fault_info mmufault;
struct nvgpu_channel refch;
u32 fault_status = 0;
static const char *const error_str = "test error";
(void) memset(&mmufault, 0, sizeof(mmufault));
(void) memset(&refch, 0, sizeof(refch));
@@ -288,6 +289,10 @@ int fb_mmu_fault_gv11b_handle_bar2_fault(struct unit_module *m, struct gk20a *g,
/* Now set it up properly */
mmufault.valid = true;
mmufault.refch = &refch;
mmufault.fault_type_desc = error_str;
mmufault.client_type_desc = error_str;
mmufault.client_id_desc = error_str;
gv11b_fb_mmu_fault_info_dump(g, &mmufault);
fault_status = fb_mmu_fault_status_non_replayable_error_m();
g->ops.fb.fault_buf_set_state_hw(g, 0, NVGPU_MMU_FAULT_BUF_ENABLED);