diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-02-04 02:36:59 +0300 |
---|---|---|
committer | Bills, Jason M <jason.m.bills@intel.com> | 2020-02-06 19:07:45 +0300 |
commit | 915fd4bb87508f88960eb2d4e51ae1bdc454b5b0 (patch) | |
tree | b071c852f3aa2e2a5162362be89851b020d688d2 | |
parent | c33ba00b914c267d14f395a1127aca5dda17fee2 (diff) | |
download | provingground-915fd4bb87508f88960eb2d4e51ae1bdc454b5b0.tar.xz |
Add PECI_CC_TIMEOUT response
If the driver times-out on a PECI call and returns ETIMEDOUT,
return a new PECI_CC_TIMEOUT response to the caller.
Tested:
Ran a PECI command with a timeout and confirmed that it returns
PECI_CC_TIMEOUT.
Change-Id: I93e25948ef05d0e7f137500310a4dfa99ed8980c
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
-rw-r--r-- | libpeci/peci.c | 5 | ||||
-rw-r--r-- | libpeci/peci.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libpeci/peci.c b/libpeci/peci.c index 58079bc..4929547 100644 --- a/libpeci/peci.c +++ b/libpeci/peci.c @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. */ +#include <errno.h> #include <fcntl.h> #include <peci.h> #include <string.h> @@ -114,6 +115,10 @@ static EPECIStatus HW_peci_issue_cmd(unsigned int cmd, char* cmdPtr, if (ioctl(peci_fd, cmd, cmdPtr) != 0) { + if (errno == ETIMEDOUT) + { + return PECI_CC_TIMEOUT; + } return PECI_CC_DRIVER_ERR; } diff --git a/libpeci/peci.h b/libpeci/peci.h index 33b664d..53a8bba 100644 --- a/libpeci/peci.h +++ b/libpeci/peci.h @@ -45,6 +45,7 @@ typedef enum PECI_CC_DRIVER_ERR, PECI_CC_CPU_NOT_PRESENT, PECI_CC_MEM_ERR, + PECI_CC_TIMEOUT, } EPECIStatus; // PECI Timeout Options |