Defer Sysman Fabric Port and Fan Module Initialization

With this change, init for sysman Fabric Port/Fan API would
not be done during zeInit.
init and thereby Fabric Port/Fan API handle creation would be done
only when user explicitly requests to enumerate handles
using zesDeviceEnumFabricPorts/zesDeviceEnumFans.

Also, ECC module init calls are cleared as they are no longer needed.

Related-To: LOCI-3127

Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
Kulkarni, Ashwin Kumar
2022-07-20 09:51:46 +00:00
committed by Compute-Runtime-Automation
parent 9c45ced969
commit 2d8176fdbd
10 changed files with 18 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -29,6 +29,9 @@ void FanHandleContext::init() {
}
ze_result_t FanHandleContext::fanGet(uint32_t *pCount, zes_fan_handle_t *phFan) {
std::call_once(initFanOnce, [this]() {
this->init();
});
uint32_t handleListSize = static_cast<uint32_t>(handleList.size());
uint32_t numToCopy = std::min(*pCount, handleListSize);
if (0 == *pCount || *pCount > handleListSize) {