fix: Fix abort on device get state

Related-To: NEO-9980

Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com>
This commit is contained in:
Bellekallu Rajkiran
2024-01-19 11:59:41 +00:00
committed by Compute-Runtime-Automation
parent c073106907
commit 1002cb9f34
12 changed files with 109 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -165,6 +165,22 @@ uint32_t SysmanKmdInterface::getEventTypeImpl(std::string &dirName, const bool i
return eventTypeVal;
}
void SysmanKmdInterface::getWedgedStatusImpl(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) {
NEO::GemContextCreateExt gcc{};
auto hwDeviceId = pLinuxSysmanImp->getSysmanHwDeviceIdInstance();
auto pDrm = pLinuxSysmanImp->getDrm();
// Device is said to be in wedged if context creation returns EIO.
auto ret = pDrm->getIoctlHelper()->ioctl(NEO::DrmIoctl::gemContextCreateExt, &gcc);
if (ret == 0) {
pDrm->destroyDrmContext(gcc.contextId);
return;
}
if (pDrm->getErrno() == EIO) {
pState->reset |= ZES_RESET_REASON_FLAG_WEDGED;
}
}
std::string SysmanKmdInterfaceI915::getBasePathI915(uint32_t subDeviceId) {
return "gt/gt" + std::to_string(subDeviceId) + "/";
}