aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Schneider <valentin.schneider@arm.com>2017-11-15 17:04:56 +0000
committerArvind Chauhan <arvind.chauhan@arm.com>2018-01-24 14:43:05 +0530
commit98a21b7733b037f2e9bfa437ead86be3196d9681 (patch)
tree762fced2dad3a4c8abe4725f04e96fdfad2d0b0e
parentcd7e8610fdcd853fe9c10eff9fc7c38dc0814b7c (diff)
drivers/firmware/arm_scmi/perf: Temp fix for OPP tablesack-4.9-armlt-20180206ack-4.9-armlt-18.01
Right now, the SCMI OPP power channel is being used to fetch OPP voltage data. Ideally, we'd want to only pass power data, but some frameworks like thermal still expect independant frequency and voltage values to compute power. As a temporary bugfix, the power channel will still be used to collect voltage values and populate the OPP table. This commit adds a comment regarding this matter, and makes it so SCMI populates OPP tables with micro-volt values (previously milli-volts, which would break the thermal framework). Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
-rw-r--r--drivers/firmware/arm_scmi/perf.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 1cb4ba705094..27fe6e6f46de 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -414,7 +414,20 @@ static int scmi_dvfs_add_opps_to_device(struct device *dev)
for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) {
freq = opp->perf * dom->mult_factor;
- ret = dev_pm_opp_add(dev, freq, opp->power);
+ /*
+ * TODO: find a better solution to pass the OPP voltage.
+ *
+ * Right now, the SCMI OPP power channel is being used
+ * to fetch OPP voltage data. Ideally, we'd want to only pass
+ * power data, but some frameworks like thermal still expect
+ * independant frequency and voltage values to compute power.
+ *
+ * As a temporary bugfix, the power channel will still be used
+ * to collect voltage values and populate the OPP table. SCMI
+ * returns values in milli-Volts, but the OPP table standard
+ * is micro-Volts, so it is x1000'ed.
+ */
+ ret = dev_pm_opp_add(dev, freq, 1000 * opp->power);
if (ret) {
dev_warn(dev, "failed to add opp %luHz %umV\n",
freq, opp->power);