mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Sysman: increase sleep duration in warm reset
warm reset needs to have a longer sleep duaration after remove to ensure that the PCIe state is save and restored safely. Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f06ebef745
commit
0d23fa1a98
@@ -327,8 +327,11 @@ ze_result_t LinuxSysmanImp::osWarmReset() {
|
|||||||
if (ZE_RESULT_SUCCESS != result) {
|
if (ZE_RESULT_SUCCESS != result) {
|
||||||
return 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
|
||||||
|
} else {
|
||||||
this->pSleepFunctionSecs(10); // Sleep for 10seconds to make sure that the config spaces of all devices are saved correctly
|
this->pSleepFunctionSecs(10); // Sleep for 10seconds to make sure that the config spaces of all devices are saved correctly
|
||||||
|
}
|
||||||
rootPortPath = getPciRootPortDirectoryPath(gtDevicePath);
|
rootPortPath = getPciRootPortDirectoryPath(gtDevicePath);
|
||||||
|
|
||||||
int fd, ret = 0;
|
int fd, ret = 0;
|
||||||
@@ -355,7 +358,11 @@ ze_result_t LinuxSysmanImp::osWarmReset() {
|
|||||||
if (ZE_RESULT_SUCCESS != result) {
|
if (ZE_RESULT_SUCCESS != result) {
|
||||||
return 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
|
||||||
|
} else {
|
||||||
this->pSleepFunctionSecs(10); // Sleep for 10seconds, allows the rescan to complete on all devices attached to the root port.
|
this->pSleepFunctionSecs(10); // Sleep for 10seconds, allows the rescan to complete on all devices attached to the root port.
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -537,6 +537,18 @@ TEST_F(ZesDiagnosticsFixture, GivenValidSysmanImpPointerWhenCallingWarmResetThen
|
|||||||
EXPECT_EQ(ZE_RESULT_SUCCESS, pLinuxSysmanImp->osWarmReset());
|
EXPECT_EQ(ZE_RESULT_SUCCESS, pLinuxSysmanImp->osWarmReset());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ZesDiagnosticsFixture, GivenValidSysmanImpPointerWhenCallingWarmResetfromDiagnosticsThenCallSucceeds) {
|
||||||
|
pLinuxSysmanImp->gtDevicePath = "/sys/devices/pci0000:89/0000:89:02.0/0000:8a:00.0/0000:8b:01.0/0000:8c:00.0";
|
||||||
|
pLinuxSysmanImp->openFunction = openMockDiag;
|
||||||
|
pLinuxSysmanImp->closeFunction = closeMockDiag;
|
||||||
|
pLinuxSysmanImp->preadFunction = preadMockDiag;
|
||||||
|
pLinuxSysmanImp->pwriteFunction = pwriteMockDiag;
|
||||||
|
pLinuxSysmanImp->pSleepFunctionSecs = mockSleepFunctionSecs;
|
||||||
|
pLinuxSysmanImp->diagnosticsReset = true;
|
||||||
|
|
||||||
|
EXPECT_EQ(ZE_RESULT_SUCCESS, pLinuxSysmanImp->osWarmReset());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(ZesDiagnosticsFixture, GivenValidSysmanImpPointerWhenCallingWarmResetAndRootPortConfigFileFailsToOpenThenCallFails) {
|
TEST_F(ZesDiagnosticsFixture, GivenValidSysmanImpPointerWhenCallingWarmResetAndRootPortConfigFileFailsToOpenThenCallFails) {
|
||||||
pLinuxSysmanImp->gtDevicePath = "/sys/devices/pci0000:89/0000:89:02.0/0000:8a:00.0/0000:8b:01.0/0000:8c:00.0";
|
pLinuxSysmanImp->gtDevicePath = "/sys/devices/pci0000:89/0000:89:02.0/0000:8a:00.0/0000:8b:01.0/0000:8c:00.0";
|
||||||
pLinuxSysmanImp->openFunction = openMockDiagFail;
|
pLinuxSysmanImp->openFunction = openMockDiagFail;
|
||||||
|
|||||||
Reference in New Issue
Block a user