summaryrefslogtreecommitdiff
path: root/drivers/hwmon/occ/common.h
diff options
context:
space:
mode:
authorEddie James <eajames@linux.ibm.com>2022-06-28 15:30:29 -0500
committerGuenter Roeck <linux@roeck-us.net>2022-06-29 13:59:23 -0700
commit1bbb2809040a1f9c7c53c9f06c21aa83275ed27b (patch)
tree8891dc3129bf5cc7ee668c62526c6ff1de0866ba /drivers/hwmon/occ/common.h
parenta111daf0c53ae91e71fd2bfe7497862d14132e3e (diff)
hwmon: (occ) Prevent power cap command overwriting poll response
Currently, the response to the power cap command overwrites the first eight bytes of the poll response, since the commands use the same buffer. This means that user's get the wrong data between the time of sending the power cap and the next poll response update. Fix this by specifying a different buffer for the power cap command response. Fixes: 5b5513b88002 ("hwmon: Add On-Chip Controller (OCC) hwmon driver") Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20220628203029.51747-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/occ/common.h')
-rw-r--r--drivers/hwmon/occ/common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/occ/common.h b/drivers/hwmon/occ/common.h
index 64d5ec7e169b..7ac4b2febce6 100644
--- a/drivers/hwmon/occ/common.h
+++ b/drivers/hwmon/occ/common.h
@@ -96,7 +96,8 @@ struct occ {
int powr_sample_time_us; /* average power sample time */
u8 poll_cmd_data; /* to perform OCC poll command */
- int (*send_cmd)(struct occ *occ, u8 *cmd, size_t len);
+ int (*send_cmd)(struct occ *occ, u8 *cmd, size_t len, void *resp,
+ size_t resp_len);
unsigned long next_update;
struct mutex lock; /* lock OCC access */