summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJason M. Bills <jason.m.bills@intel.com>2022-03-02 18:58:33 +0300
committerjmbills <jasonm.bills@yahoo.com>2022-03-11 00:27:19 +0300
commit246e36dba646e1fc5176e536bf9e80b2a3a6ba5f (patch)
tree048af9d31dc3be4ebf1f102f27264947b4573d6a /drivers/hwmon
parentf99c8aa5142aaa83cb19aaacf2166dafbb3828aa (diff)
downloadlinux-246e36dba646e1fc5176e536bf9e80b2a3a6ba5f.tar.xz
peci: add msg_len to peci_command
To support the new domain ID, we need to include an extra byte from userspace. This adds a length to the peci_command function so we can detect when the domain ID is sent from userspace. Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/peci-cputemp.c10
-rw-r--r--drivers/hwmon/peci-dimmtemp.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c
index b628dbfff6b5..bac8db9a289a 100644
--- a/drivers/hwmon/peci-cputemp.c
+++ b/drivers/hwmon/peci-cputemp.c
@@ -115,7 +115,7 @@ static int get_temp_targets(struct peci_cputemp *priv)
re_msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_END_PT_CFG, &re_msg);
+ PECI_CMD_RD_END_PT_CFG, sizeof(re_msg), &re_msg);
if (ret || re_msg.cc != PECI_DEV_CC_SUCCESS)
ret = -EAGAIN;
if (ret)
@@ -164,7 +164,7 @@ static int get_die_temp(struct peci_cputemp *priv)
msg.addr = priv->mgr->client->addr;
- ret = peci_command(priv->mgr->client->adapter, PECI_CMD_GET_TEMP, &msg);
+ ret = peci_command(priv->mgr->client->adapter, PECI_CMD_GET_TEMP, sizeof(msg), &msg);
if (ret)
return ret;
@@ -381,7 +381,7 @@ static int check_resolved_cores(struct peci_cputemp *priv)
msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(msg), &msg);
if (msg.cc != PECI_DEV_CC_SUCCESS)
ret = -EAGAIN;
if (ret)
@@ -393,7 +393,7 @@ static int check_resolved_cores(struct peci_cputemp *priv)
msg.reg = 0xd0;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(msg), &msg);
if (msg.cc != PECI_DEV_CC_SUCCESS)
ret = -EAGAIN;
@@ -413,7 +413,7 @@ static int check_resolved_cores(struct peci_cputemp *priv)
msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(msg), &msg);
if (msg.cc != PECI_DEV_CC_SUCCESS)
ret = -EAGAIN;
if (ret)
diff --git a/drivers/hwmon/peci-dimmtemp.c b/drivers/hwmon/peci-dimmtemp.c
index a50902ceb70a..e05d5961cbc1 100644
--- a/drivers/hwmon/peci-dimmtemp.c
+++ b/drivers/hwmon/peci-dimmtemp.c
@@ -91,7 +91,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
re_msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_END_PT_CFG, &re_msg);
+ PECI_CMD_RD_END_PT_CFG, sizeof(re_msg), &re_msg);
if (ret || re_msg.cc != PECI_DEV_CC_SUCCESS)
ret = -EAGAIN;
if (ret)
@@ -123,7 +123,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
re_msg.params.pci_cfg.reg = 0xd4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_END_PT_CFG, &re_msg);
+ PECI_CMD_RD_END_PT_CFG, sizeof(re_msg), &re_msg);
if (ret || re_msg.cc != PECI_DEV_CC_SUCCESS ||
!(re_msg.data[3] & BIT(7))) {
/* Use default or previous value */
@@ -135,7 +135,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
re_msg.params.pci_cfg.reg = 0xd0;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_END_PT_CFG, &re_msg);
+ PECI_CMD_RD_END_PT_CFG, sizeof(re_msg), &re_msg);
if (ret || re_msg.cc != PECI_DEV_CC_SUCCESS) {
/* Use default or previous value */
ret = 0;
@@ -168,7 +168,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
re_msg.params.mmio.offset += 0x4000;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_END_PT_CFG, &re_msg);
+ PECI_CMD_RD_END_PT_CFG, sizeof(re_msg), &re_msg);
if (ret || re_msg.cc != PECI_DEV_CC_SUCCESS ||
re_msg.data[1] == 0 || re_msg.data[2] == 0) {
/* Use default or previous value */
@@ -197,7 +197,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
rp_msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &rp_msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(rp_msg), &rp_msg);
if (ret || rp_msg.cc != PECI_DEV_CC_SUCCESS ||
rp_msg.pci_config[1] == 0 || rp_msg.pci_config[2] == 0) {
/* Use default or previous value */
@@ -223,7 +223,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
rp_msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &rp_msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(rp_msg), &rp_msg);
if (ret || rp_msg.cc != PECI_DEV_CC_SUCCESS ||
rp_msg.pci_config[1] == 0 || rp_msg.pci_config[2] == 0) {
/* Use default or previous value */
@@ -254,7 +254,7 @@ static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no)
rp_msg.rx_len = 4;
ret = peci_command(priv->mgr->client->adapter,
- PECI_CMD_RD_PCI_CFG_LOCAL, &rp_msg);
+ PECI_CMD_RD_PCI_CFG_LOCAL, sizeof(rp_msg), &rp_msg);
if (ret || rp_msg.cc != PECI_DEV_CC_SUCCESS ||
rp_msg.pci_config[1] == 0 || rp_msg.pci_config[2] == 0) {
/* Use default or previous value */