linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>
Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v1 1/8] PM / devfreq: tegra: Fix kHz to Hz conversion
Date: Fri, 12 Apr 2019 19:56:58 +0300	[thread overview]
Message-ID: <ab8dfa58-5e38-7538-3d82-d762341cd1b9@gmail.com> (raw)
In-Reply-To: <20190411222914.25539-2-digetx@gmail.com>

12.04.2019 1:29, Dmitry Osipenko пишет:
> 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. Let's provide OPP with rates in kHz since this eliminates
> few multiplies and divisions in the code. This patch was tested on Tegra30
> and Tegra124 SoC's, EMC frequency scaling works properly now.
> 
> Cc: <stable@vger.kernel.org>
> Tested-by: Steev Klimaszewski <steev@kali.org>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/devfreq/tegra-devfreq.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
> index c89ba7b834ff..ec4ff55f5eea 100644
> --- a/drivers/devfreq/tegra-devfreq.c
> +++ b/drivers/devfreq/tegra-devfreq.c
> @@ -394,7 +394,7 @@ static int tegra_actmon_rate_notify_cb(struct notifier_block *nb,
>  
>  	tegra = container_of(nb, struct tegra_devfreq, rate_change_nb);
>  
> -	tegra->cur_freq = data->new_rate / KHZ;
> +	tegra->cur_freq = data->new_rate;

This was a last-minute change and it is incorrect. The cur_freq should be kept in kHz, I'll fix it up in v2 and re-test everything properly once again.

  parent reply	other threads:[~2019-04-12 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 22:29 [PATCH v1 0/8] devfreq: Tegra devfreq fixes / improvements and Tegra30 support Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 1/8] PM / devfreq: tegra: Fix kHz to Hz conversion Dmitry Osipenko
     [not found]   ` <20190412013413.4D52D20818@mail.kernel.org>
2019-04-12 10:14     ` Dmitry Osipenko
2019-04-12 16:56   ` Dmitry Osipenko [this message]
2019-04-11 22:29 ` [PATCH v1 2/8] PM / devfreq: tegra: Replace readl-writel with relaxed versions Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 3/8] PM / devfreq: tegra: Don't ignore clk errors Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 4/8] PM / devfreq: tegra: Don't release IRQ manually on driver removal Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 5/8] PM / devfreq: tegra: Don't set EMC clock rate to maximum on probe Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 6/8] PM / devfreq: tegra: Drop spinlock Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 7/8] PM / devfreq: tegra: Remove OPP entries on driver removal Dmitry Osipenko
2019-04-11 22:29 ` [PATCH v1 8/8] PM / devfreq: tegra: Support Tegra30 Dmitry Osipenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab8dfa58-5e38-7538-3d82-d762341cd1b9@gmail.com \
    --to=digetx@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=jonathanh@nvidia.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).