]> git.baikalelectronics.ru Git - kernel.git/commit
PM / devfreq: tegra: Fix kHz to Hz conversion
authorDmitry Osipenko <digetx@gmail.com>
Wed, 1 May 2019 23:38:00 +0000 (02:38 +0300)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Sat, 24 Aug 2019 11:11:12 +0000 (20:11 +0900)
commit8a78ad4174e36a6f7375cc27697d1b806343173f
tree29f4f7020b89eea8274004d36e4ab614e19b25cb
parent75eaf80f84ebc7588c50189fc3b72bcd0f66e5fc
PM / devfreq: tegra: Fix kHz to Hz conversion

The kHz to Hz is incorrectly converted in a few places in the code,
this results in a wrong frequency being calculated because devfreq core
uses OPP frequencies that are given in Hz to clamp the rate, while
tegra-devfreq gives to the core value in kHz and then it also expects to
receive value in kHz from the core. In a result memory freq is always set
to a value which is close to ULONG_MAX because of the bug. Hence the EMC
frequency is always capped to the maximum and the driver doesn't do
anything useful. This patch was tested on Tegra30 and Tegra124 SoC's, EMC
frequency scaling works properly now.

Cc: <stable@vger.kernel.org> # 4.14+
Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
drivers/devfreq/tegra-devfreq.c