do not sleep in ULTs

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-10-21 10:50:55 +00:00
committed by Compute-Runtime-Automation
parent 3724807eed
commit 9ad3f6190f
15 changed files with 76 additions and 32 deletions

View File

@@ -10,6 +10,7 @@
#include "shared/source/built_ins/sip.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/sleep.h"
#include "shared/source/helpers/string.h"
#include "level_zero/core/source/device/device_imp.h"
@@ -1264,7 +1265,7 @@ ze_result_t DebugSessionImp::waitForCmdReady(EuThread::ThreadId threadId, uint16
if (sipCommand.command == static_cast<uint32_t>(NEO::SipKernel::COMMAND::READY)) {
break;
}
std::this_thread::sleep_for(std::chrono::microseconds(100));
NEO::sleep(std::chrono::microseconds(100));
}
if (sipCommand.command != static_cast<uint32_t>(NEO::SipKernel::COMMAND::READY)) {

View File

@@ -7,6 +7,7 @@
#include "level_zero/tools/source/sysman/diagnostics/linux/os_diagnostics_imp.h"
#include "shared/source/helpers/sleep.h"
#include "shared/source/helpers/string.h"
#include "level_zero/core/source/device/device_imp.h"
@@ -84,7 +85,7 @@ ze_result_t LinuxDiagnosticsImp::waitForQuiescentCompletion() {
result = pSysfsAccess->write(quiescentGpuFile, intVal);
if (ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE == result) {
count++;
this->pSleepFunctionSecs(1); // Sleep for 1second every loop, gives enough time for KMD to clear all allocations and wedge the system
NEO::sleep(std::chrono::seconds(1)); // Sleep for 1second every loop, gives enough time for KMD to clear all allocations and wedge the system
auto processResult = gpuProcessCleanup();
if (ZE_RESULT_SUCCESS != processResult) {
return processResult;

View File

@@ -25,7 +25,6 @@ class LinuxDiagnosticsImp : public OsDiagnostics, NEO::NonCopyableOrMovableClass
LinuxDiagnosticsImp(OsSysman *pOsSysman, const std::string &diagTests);
~LinuxDiagnosticsImp() override = default;
std::string osDiagType = "unknown";
decltype(&L0::SysmanUtils::sleep) pSleepFunctionSecs = L0::SysmanUtils::sleep;
protected:
LinuxSysmanImp *pLinuxSysmanImp = nullptr;

View File

@@ -7,6 +7,7 @@
#include "level_zero/tools/source/sysman/linux/os_sysman_imp.h"
#include "shared/source/helpers/sleep.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/device_factory.h"
@@ -328,7 +329,7 @@ void LinuxSysmanImp::clearHPIE(int fd) {
this->preadFunction(fd, &value, 0x01, offset);
resetValue = value & (~PCI_EXP_SLTCTL_HPIE);
this->pwriteFunction(fd, &resetValue, 0x01, offset);
this->pSleepFunctionSecs(10); // Sleep for 10seconds just to make sure the change is propagated.
NEO::sleep(std::chrono::seconds(10)); // Sleep for 10seconds just to make sure the change is propagated.
}
// A 'warm reset' is a conventional reset that is triggered across a PCI express link.
@@ -353,9 +354,9 @@ ze_result_t LinuxSysmanImp::osWarmReset() {
return result;
}
if (diagnosticsReset) {
this->pSleepFunctionSecs(30); // Sleep for 30seconds to make sure that the config spaces of all devices are saved correctly after IFR
NEO::sleep(std::chrono::seconds(30)); // Sleep for 30seconds to make sure that the config spaces of all devices are saved correctly after IFR
} else {
this->pSleepFunctionSecs(10); // Sleep for 10seconds to make sure that the config spaces of all devices are saved correctly
NEO::sleep(std::chrono::seconds(10)); // Sleep for 10seconds to make sure that the config spaces of all devices are saved correctly
}
clearHPIE(fd);
@@ -367,18 +368,18 @@ ze_result_t LinuxSysmanImp::osWarmReset() {
this->preadFunction(fd, &value, 0x01, offset);
resetValue = value | PCI_BRIDGE_CTL_BUS_RESET;
this->pwriteFunction(fd, &resetValue, 0x01, offset);
this->pSleepFunctionSecs(10); // Sleep for 10seconds just to make sure the change is propagated.
NEO::sleep(std::chrono::seconds(10)); // Sleep for 10seconds just to make sure the change is propagated.
this->pwriteFunction(fd, &value, 0x01, offset);
this->pSleepFunctionSecs(10); // Sleep for 10seconds to make sure the change is propagated. before rescan is done.
NEO::sleep(std::chrono::seconds(10)); // Sleep for 10seconds to make sure the change is propagated. before rescan is done.
result = pFsAccess->write(rootPortPath + '/' + "rescan", "1");
if (ZE_RESULT_SUCCESS != result) {
return result;
}
if (diagnosticsReset) {
this->pSleepFunctionSecs(30); // Sleep for 30seconds to make sure that the config spaces of all devices are saved correctly after IFR
NEO::sleep(std::chrono::seconds(30)); // Sleep for 30seconds to make sure that the config spaces of all devices are saved correctly after IFR
} else {
this->pSleepFunctionSecs(10); // Sleep for 10seconds, allows the rescan to complete on all devices attached to the root port.
NEO::sleep(std::chrono::seconds(10)); // Sleep for 10seconds, allows the rescan to complete on all devices attached to the root port.
}
int ret = this->closeFunction(fd);
@@ -418,7 +419,7 @@ ze_result_t LinuxSysmanImp::osColdReset() {
if (ZE_RESULT_SUCCESS != result) {
return result;
}
std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Sleep for 100 milliseconds just to make sure, 1 ms is defined as part of spec
NEO::sleep(std::chrono::milliseconds(100)); // Sleep for 100 milliseconds just to make sure, 1 ms is defined as part of spec
result = pFsAccess->write((slotPath + slot + "/power"), "1"); // turn on power
if (ZE_RESULT_SUCCESS != result) {
return result;

View File

@@ -74,7 +74,6 @@ class LinuxSysmanImp : public OsSysman, NEO::NonCopyableOrMovableClass {
decltype(&NEO::SysCalls::close) closeFunction = NEO::SysCalls::close;
decltype(&NEO::SysCalls::pread) preadFunction = NEO::SysCalls::pread;
decltype(&NEO::SysCalls::pwrite) pwriteFunction = NEO::SysCalls::pwrite;
decltype(&L0::SysmanUtils::sleep) pSleepFunctionSecs = L0::SysmanUtils::sleep;
std::string devicePciBdf = "";
uint32_t rootDeviceIndex = 0u;
NEO::ExecutionEnvironment *executionEnvironment = nullptr;

View File

@@ -7,6 +7,8 @@
#include "level_zero/tools/source/sysman/sysman.h"
#include "shared/source/helpers/sleep.h"
#include "level_zero/core/source/device/device_imp.h"
#include "level_zero/core/source/driver/driver.h"
#include "level_zero/core/source/driver/driver_handle_imp.h"
@@ -68,7 +70,7 @@ ze_result_t DriverHandleImp::sysmanEventsListen(
if (gotSysmanEvent) {
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(10)); // Sleep for 10 milliseconds before next check of events
NEO::sleep(std::chrono::milliseconds(10)); // Sleep for 10 milliseconds before next check of events
} while ((L0::steadyClock::now() <= timeToExitLoop));
return ZE_RESULT_SUCCESS;
@@ -94,7 +96,7 @@ ze_result_t DriverHandleImp::sysmanEventsListenEx(
if (gotSysmanEvent) {
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(10)); // Sleep for 10 milliseconds before next check of events
NEO::sleep(std::chrono::milliseconds(10)); // Sleep for 10 milliseconds before next check of events
} while ((L0::steadyClock::now() <= timeToExitLoop));
return ZE_RESULT_SUCCESS;

View File

@@ -7,6 +7,8 @@
#include "level_zero/tools/source/sysman/sysman_imp.h"
#include "shared/source/helpers/sleep.h"
#include "level_zero/core/source/driver/driver.h"
#include "level_zero/core/source/driver/driver_handle_imp.h"
#include "level_zero/tools/source/sysman/ecc/ecc_imp.h"
@@ -213,9 +215,4 @@ ze_result_t SysmanDeviceImp::deviceSetEccState(const zes_device_ecc_desc_t *newS
return pEcc->setEccState(newState, pState);
}
namespace SysmanUtils {
void sleep(int64_t seconds) {
std::this_thread::sleep_for(std::chrono::seconds(seconds));
}
} // namespace SysmanUtils
} // namespace L0

View File

@@ -87,7 +87,4 @@ struct SysmanDeviceImp : SysmanDevice, NEO::NonCopyableOrMovableClass {
}
}
};
namespace SysmanUtils {
void sleep(int64_t seconds);
}
} // namespace L0