From 5f8b8f0ef98f95ebcf3188b0147bdd761bd90ca2 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Fri, 20 Dec 2019 16:09:38 -0500 Subject: [PATCH] gpu: nvgpu: unit: init: check for correct hal Add check to ensure the gv11b HAL was initialized. This satisfies the action from the init FMEA to test for the correct HAL. JIRA NVGPU-4010 Change-Id: I519872c86d204dbbf504da3322a9d0816ffc3b0f Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2266501 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/init/nvgpu-init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/userspace/units/init/nvgpu-init.c b/userspace/units/init/nvgpu-init.c index 45772950a..10c413c28 100644 --- a/userspace/units/init/nvgpu-init.c +++ b/userspace/units/init/nvgpu-init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -415,6 +415,11 @@ int test_hal_init(struct unit_module *m, return UNIT_FAIL; } + if (strcmp(g->name, "gv11b") != 0) { + unit_err(m, "%s: initialized wrong HAL!\n", __func__); + return UNIT_FAIL; + } + /* Branch test for check if already inited the hal */ if (nvgpu_detect_chip(g) != 0) { unit_err(m, "%s: failed to init HAL\n", __func__);