]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: Add 'UNKNOWN' status for shared_opp in struct opp_table
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 16 Jun 2016 13:33:11 +0000 (19:03 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 16 Jun 2016 13:50:36 +0000 (15:50 +0200)
commit400a0cb0679fbb09498eb875e803e9a460add2d5
treea81eb12f087ea733260210bba0fa9a1a612f54d3
parent94a927a80428eed489121b218059d67bb19271a4
PM / OPP: Add 'UNKNOWN' status for shared_opp in struct opp_table

dev_pm_opp_get_sharing_cpus() returns 0 even in the case when the OPP
core doesn't know whether or not the table is shared. It works on the
majority of platforms, where the OPP table is never created before
invoking the function and then -ENODEV is returned by it.

But in the case of one platform (Jetson TK1) at least, the situation
is a bit different. The OPP table has been created (somehow) before
dev_pm_opp_get_sharing_cpus() is called and it returns 0. Its caller
treats that as 'the CPUs don't share OPPs' and that leads to degraded
performance.

Fix this by converting 'shared_opp' in struct opp_table to an enum
and making dev_pm_opp_get_sharing_cpus() return -EINVAL in case when
the value of that field is "access unknown", so that the caller can
handle it accordingly (cpufreq-dt considers that as 'all CPUs share
the table', for example).

Fixes: 0f3e3f7132dd "PM / OPP: Add dev_pm_opp_get_sharing_cpus()"
Reported-and-tested-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw : Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/cpu.c
drivers/base/power/opp/of.c
drivers/base/power/opp/opp.h