diff options
author | Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com> | 2021-03-02 01:49:09 +0300 |
---|---|---|
committer | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2021-10-20 01:10:38 +0300 |
commit | 7b4c6c685577bd27ec5671ca044dce58e70a7bd3 (patch) | |
tree | 2a3379da18a4eea422e519e933b6ee1c8a7e0dfe | |
parent | a143d9a3849e5ca445fc81765328f0190ed708bf (diff) | |
download | linux-7b4c6c685577bd27ec5671ca044dce58e70a7bd3.tar.xz |
hwmon: peci: Stop reading DRAM_MIN_PWR
This commit is about disabling reading DRAM_MIN_PWR from
DRAM_POWER_INFO PCS. Starting from SPR DRAM_MIN_PWR is deprecated. BIOS
does not update DRAM min power anymore.
Value of 0 shall be reported as DRAM min power.
Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
-rw-r--r-- | drivers/hwmon/peci-dimmpower.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/drivers/hwmon/peci-dimmpower.c b/drivers/hwmon/peci-dimmpower.c index 7c4eb86a1600..18ea4a3d032a 100644 --- a/drivers/hwmon/peci-dimmpower.c +++ b/drivers/hwmon/peci-dimmpower.c @@ -286,40 +286,16 @@ peci_dimmpower_read_min_power(void *ctx, struct peci_sensor_conf *sensor_conf, struct peci_sensor_data *sensor_data) { struct peci_dimmpower *priv = (struct peci_dimmpower *)ctx; - union peci_dram_power_info_low power_info; - ulong jif; - int ret; - - if (!peci_sensor_need_update_with_time(sensor_data, - sensor_conf->update_interval)) { - dev_dbg(priv->dev, "skip reading peci, min power %dmW\n", - sensor_data->value); - return 0; - } - - ret = peci_pcs_get_units(priv->mgr, &priv->units, &priv->units_valid); - if (ret) { - dev_dbg(priv->dev, "not able to read units\n"); - return ret; - } - jif = jiffies; - ret = peci_pcs_read(priv->mgr, PECI_MBX_INDEX_DDR_PWR_INFO_LOW, - PECI_PCS_PARAM_ZERO, &power_info.value); - if (ret) { - dev_dbg(priv->dev, "not able to read power info\n"); - return ret; - } - - sensor_data->value = peci_pcs_xn_to_munits(power_info.bits.min_pwr, - priv->units.bits.pwr_unit); - peci_sensor_mark_updated_with_time(sensor_data, jif); - - dev_dbg(priv->dev, "raw min power %u, unit %u, min power %dmW\n", - power_info.bits.min_pwr, priv->units.bits.pwr_unit, - sensor_data->value); - - return ret; + /* DRAM_POWER_INFO.DRAM_MIN_PWR is no more supported in CPU starting from + * SPR. So BIOS doesn't update this. That's why there is still default + * value (15W) which doesn't make sense. There should be a case when + * MAX_PWR/TDP is smaller than 15W. + * 0 seems to be a reasonable value for that parameter. + */ + sensor_data->value = 0; + dev_dbg(priv->dev, "min power %dmW\n", sensor_data->value); + return 0; } static int |