Commit 3acec69a authored by Lukasz Luba's avatar Lukasz Luba Committed by Rafael J. Wysocki

PM: EM: Force device drivers to provide power in uW

The EM only supports power in uW. Make sure that it is not possible to
register some downstream driver which doesn't provide power in uW.
The only exception is artificial EM, but that EM is ignored by the rest of
kernel frameworks (thermal, powercap, etc).
Reported-by: default avatarPoShao Chen <poshao.chen@mediatek.com>
Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 07abb19a
...@@ -612,6 +612,17 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, ...@@ -612,6 +612,17 @@ int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
else if (cb->get_cost) else if (cb->get_cost)
flags |= EM_PERF_DOMAIN_ARTIFICIAL; flags |= EM_PERF_DOMAIN_ARTIFICIAL;
/*
* EM only supports uW (exception is artificial EM).
* Therefore, check and force the drivers to provide
* power in uW.
*/
if (!microwatts && !(flags & EM_PERF_DOMAIN_ARTIFICIAL)) {
dev_err(dev, "EM: only supports uW power values\n");
ret = -EINVAL;
goto unlock;
}
ret = em_create_pd(dev, nr_states, cb, cpus, flags); ret = em_create_pd(dev, nr_states, cb, cpus, flags);
if (ret) if (ret)
goto unlock; goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment