summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJae Hyun Yoo <jae.hyun.yoo@intel.com>2021-01-29 05:42:43 +0300
committerYoo, Jae Hyun <jae.hyun.yoo@intel.com>2021-02-02 02:45:57 +0300
commitb4eba4e0978d8ace0cf19db67eebd76f9aa620a2 (patch)
treeaeaf21f492e489fae5e6b9b492ba3509a030a1e6
parent629ba88c9d4875ac39e2c330adb941878a4d18a4 (diff)
downloadlinux-b4eba4e0978d8ace0cf19db67eebd76f9aa620a2.tar.xz
fixup! peci: Add peci_revision property
When an adapter is registered in CPU power off state, all PECI commands are not available except GetDIB, GetTemp and Ping commands. This commit removes incorrect revision setting to make it retry the revision checking if an adapter doesn't have pre-defined revision value. Change-Id: If405c8127a6db08e92cd8c1b7ef1ff1c3aadb9ef Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
-rw-r--r--drivers/peci/peci-core.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
index 0fc2f246ada8..04b56b4e2a53 100644
--- a/drivers/peci/peci-core.c
+++ b/drivers/peci/peci-core.c
@@ -304,15 +304,16 @@ static int peci_scan_cmd_mask(struct peci_adapter *adapter)
msg->tx_buf[0] = PECI_GET_DIB_CMD;
ret = peci_xfer(adapter, msg);
- if (ret || msg->rx_buf[0] == PECI_DEV_CC_INVALID_REQ) {
+ if (ret) {
+ ret = -EAGAIN;
+ goto out;
+ }
+ if (msg->rx_buf[0] == PECI_DEV_CC_INVALID_REQ) {
/*
* if GetDIB() is not supported, use a revision property of
* hardware adapter
*/
- if (adapter->peci_revision != 0)
- revision = adapter->peci_revision;
- else
- revision = 0;
+ revision = adapter->peci_revision;
} else {
dib = le64_to_cpup((__le64 *)msg->rx_buf);