public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: hl <hl@rock-chips.com>
To: myungjoo.ham@gmail.com
Cc: "Heiko Stübner" <heiko@sntech.de>,
	airlied@linux.ie, mturquette@baylibre.com,
	dbasehore@chromium.org, "Stephen Boyd" <sboyd@codeaurora.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org, dianders@chromium.org,
	linux-rockchip@lists.infradead.org,
	"Kyungmin Park" <kyungmin.park@samsung.com>,
	linux-clk@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	mark.yao@rock-chips.com
Subject: Re: [RFC PATCH 3/4] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc
Date: Thu, 2 Jun 2016 09:54:32 +0800	[thread overview]
Message-ID: <574F91D8.70606@rock-chips.com> (raw)
In-Reply-To: <CAJ0PZbQaPm1YjgAgEzGbPYSzfi7kk5NG=zAj80t4XmBV5MqEqg@mail.gmail.com>

Hi Myungloo Ham,


On 2016年06月01日 18:47, MyungJoo Ham wrote:
> On Wed, Jun 1, 2016 at 6:35 PM, Lin Huang <hl@rock-chips.com> wrote:
>> there is dfi controller on rk3399 platform, it can monitor
>> ddr load, register this controller to devfreq framework, and
>> default to use simple_ondeamnd policy, and do ddr frequency
>> scaling base on this result.
>>
>> Signed-off-by: Lin Huang <hl@rock-chips.com>
>> ---
>>   drivers/devfreq/Kconfig                 |   2 +-
>>   drivers/devfreq/Makefile                |   1 +
>>   drivers/devfreq/rockchip/Kconfig        |  14 +
>>   drivers/devfreq/rockchip/Makefile       |   2 +
>>   drivers/devfreq/rockchip/rk3399_dmc.c   | 438 ++++++++++++++++++++++++++++++++
>>   drivers/devfreq/rockchip/rockchip_dmc.c | 132 ++++++++++
>>   include/soc/rockchip/rockchip_dmc.h     |  44 ++++
>>   7 files changed, 632 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/devfreq/rockchip/Kconfig
>>   create mode 100644 drivers/devfreq/rockchip/Makefile
>>   create mode 100644 drivers/devfreq/rockchip/rk3399_dmc.c
>>   create mode 100644 drivers/devfreq/rockchip/rockchip_dmc.c
>>   create mode 100644 include/soc/rockchip/rockchip_dmc.h
>>
>> +
>> +       /* check the rate we get whether correct */
>> +       dmcfreq->rate = clk_get_rate(dmcfreq->dmc_clk);
>> +       if (dmcfreq->rate != target_rate) {
>> +               dev_err(dev, "get wrong ddr frequency, Request freq %lu,\
>> +                       Current freq %lu\n", target_rate, dmcfreq->rate);
>> +               regulator_set_voltage(dmcfreq->vdd_center, dmcfreq->volt,
>> +                                     dmcfreq->volt);
> Why do you need to check this and
> more importantly, why do you assume that dmvfreq->volt
> will be safe in this case? (what if the new dmcfreq->rate is
> larger than the old dmcfreq->rate after clk_get_rate?)
> Note that you didn't update dmcfreq->volt after clk_get_rate()
     Now we will set the ddr clock rate in bl31 use dcf controller(as i 
show in the patch cover letter),
      and there only two result we can get, set clock rate fail(ddr 
clock still in old rate) or set clock rate
     sucessful(use the new ddr rate), if the set rate fail, we should 
keep the voltage old value. Ah, you
     remind me, i should check clock rate before:
         if (old_clk_rate > target_rate)
     otherwise there have chance set high rate fail and use low voltage.

     And about the dmcfreq->volt, i will update this value when into the 
function, throuth

     opp = devfreq_recommended_opp(dev, &dmcfreq->rate, flags);
     if (IS_ERR(opp)) {
         rcu_read_unlock();
         return PTR_ERR(opp);
     }
     dmcfreq->volt = dev_pm_opp_get_voltage(opp);
>
>> +EXPORT_SYMBOL_GPL(dmc_event);
>> +EXPORT_SYMBOL_GPL(rockchip_dmc_enabled);
>> +EXPORT_SYMBOL_GPL(rockchip_dmc_enable);
>> +EXPORT_SYMBOL_GPL(rockchip_dmc_disable);
>> +EXPORT_SYMBOL_GPL(dmc_register_notifier);
>> +EXPORT_SYMBOL_GPL(dmc_unregister_notifier);
>> +EXPORT_SYMBOL_GPL(rockchip_dmc_get);
>> +EXPORT_SYMBOL_GPL(rockchip_dmc_put);
> Do you really need to export all these device driver specific
> functions? Looks like a design flaw here.
>
     there is some situation we need to disable ddr frequency 
scaling(connect two panel etc)
     on rk3399 platform, and it should be also needed on other rockchip 
platform, so i move these
     funticon as separate file.
>
> Cheers,
> MyungJoo
>
>

-- 
Lin Huang

  reply	other threads:[~2016-06-02  1:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  9:35 [RFC PATCH 0/4] rk3399 support ddr frequency scaling Lin Huang
2016-06-01  9:35 ` [RFC PATCH 1/4] rockchip: rockchip: add new clock-type for the ddrclk Lin Huang
2016-06-01  9:35 ` [RFC PATCH 2/4] clk: rockchip: rk3399: add ddrc clock support Lin Huang
2016-06-01 15:24   ` Doug Anderson
2016-06-01 15:46     ` Heiko Stübner
2016-06-02  1:32       ` hl
2016-06-01  9:35 ` [RFC PATCH 3/4] PM / devfreq: rockchip: add devfreq driver for rk3399 dmc Lin Huang
2016-06-01 10:47   ` MyungJoo Ham
2016-06-02  1:54     ` hl [this message]
2016-06-01 11:47   ` Chanwoo Choi
2016-06-02  3:26     ` hl
2016-06-01  9:35 ` [RFC PATCH 4/4] drm/rockchip: Add dmc notifier in vop driver Lin Huang
2016-06-03  4:07   ` dbasehore .

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=574F91D8.70606@rock-chips.com \
    --to=hl@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=dbasehore@chromium.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=mturquette@baylibre.com \
    --cc=myungjoo.ham@gmail.com \
    --cc=sboyd@codeaurora.org \
    /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