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 <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2266501
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-12-20 16:09:38 -05:00
committed by Alex Waterman
parent cb273476b6
commit 5f8b8f0ef9

View File

@@ -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__);