diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/dts.c | 9 | ||||
-rw-r--r-- | hw/fsp/fsp-sensor.c | 7 | ||||
-rw-r--r-- | hw/occ-sensor.c | 2 |
3 files changed, 10 insertions, 8 deletions
@@ -276,14 +276,15 @@ static void dts_async_read_temp(struct timer *t __unused, void *data, rc = dts_read_core_temp_p9(cpu->pir, &dts); if (!rc) { if (cpu->sensor_attr == SENSOR_DTS_ATTR_TEMP_MAX) - *(u32 *)cpu->sensor_data = dts.temp; + *cpu->sensor_data = dts.temp; else if (cpu->sensor_attr == SENSOR_DTS_ATTR_TEMP_TRIP) - *(u32 *)cpu->sensor_data = dts.trip; + *cpu->sensor_data = dts.trip; } if (!swkup_rc) dctl_clear_special_wakeup(cpu); + check_sensor_read(cpu->token); rc = opal_queue_msg(OPAL_MSG_ASYNC_COMP, NULL, NULL, cpu->token, rc); if (rc) prerror("Failed to queue async message\n"); @@ -292,7 +293,7 @@ static void dts_async_read_temp(struct timer *t __unused, void *data, } static int dts_read_core_temp(u32 pir, struct dts *dts, u8 attr, - int token, u32 *sensor_data) + int token, u64 *sensor_data) { struct cpu_thread *cpu; int rc; @@ -390,7 +391,7 @@ enum sensor_dts_class { */ #define centaur_get_id(rid) (0x80000000 | ((rid) & 0x3ff)) -int64_t dts_sensor_read(u32 sensor_hndl, int token, u32 *sensor_data) +int64_t dts_sensor_read(u32 sensor_hndl, int token, u64 *sensor_data) { uint8_t attr = sensor_get_attr(sensor_hndl); uint32_t rid = sensor_get_rid(sensor_hndl); diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 6363530..eff5d21 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -87,7 +87,7 @@ enum spcn_attr { /* Parsed sensor attributes, passed through OPAL */ struct opal_sensor_data { uint64_t async_token; /* Asynchronous token */ - uint32_t *sensor_data; /* Kernel pointer to copy data */ + uint64_t *sensor_data; /* Kernel pointer to copy data */ enum spcn_attr spcn_attr; /* Modifier attribute */ uint16_t rid; /* Sensor RID */ uint8_t frc; /* Sensor resource class */ @@ -306,8 +306,9 @@ static int fsp_sensor_process_read(struct fsp_msg *resp_msg) static void queue_msg_for_delivery(int rc, struct opal_sensor_data *attr) { - prlog(PR_INSANE, "%s: rc:%d, data:%d\n", + prlog(PR_INSANE, "%s: rc:%d, data:%lld\n", __func__, rc, *(attr->sensor_data)); + check_sensor_read(attr->async_token); opal_queue_msg(OPAL_MSG_ASYNC_COMP, NULL, NULL, attr->async_token, rc); spcn_mod_data[attr->mod_index].entry_count = 0; @@ -512,7 +513,7 @@ static int64_t parse_sensor_id(uint32_t handler, struct opal_sensor_data *attr) int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, - uint32_t *sensor_data) + uint64_t *sensor_data) { struct opal_sensor_data *attr; int64_t rc; diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c index 1e103cb..4a25a9b 100644 --- a/hw/occ-sensor.c +++ b/hw/occ-sensor.c @@ -322,7 +322,7 @@ static inline u32 sensor_handler(int occ_num, int sensor_id, int attr) return sensor_make_handler(SENSOR_OCC, occ_num, sensor_id, attr); } -int occ_sensor_read(u32 handle, u32 *data) +int occ_sensor_read(u32 handle, u64 *data) { struct occ_sensor_data_header *hb; struct occ_sensor_name *md; |