linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Cc: "Mikko Perttunen" <mikko.perttunen@kapsi.fi>,
	박경민 <kyungmin.park@samsung.com>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Alexandre Courbot" <gnurou@gmail.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 5/8] PM / devfreq: tegra: remove operating-points
Date: Wed, 18 Mar 2015 05:24:00 +0000 (GMT)	[thread overview]
Message-ID: <192647817.276191426656237193.JavaMail.weblogic@epmlwas07d> (raw)

> As the DT bindings don't have an operating-points property any more,
> build the OPP table from the frequencies supported by the EMC clock.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
>  drivers/devfreq/tegra-devfreq.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
> index 5a6164c..1de3f8b 100644
> --- a/drivers/devfreq/tegra-devfreq.c
> +++ b/drivers/devfreq/tegra-devfreq.c
> @@ -618,6 +618,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
>  	struct tegra_devfreq_device *dev;
>  	struct resource *res;
>  	unsigned int i;
> +	unsigned long rate;
>  	int irq;
>  	int err;
>  
> @@ -649,12 +650,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
>  		return PTR_ERR(tegra->emc_clock);
>  	}
>  
> -	err = of_init_opp_table(&pdev->dev);
> -	if (err) {
> -		dev_err(&pdev->dev, "Failed to init operating point table\n");
> -		return err;
> -	}
> -
>  	clk_set_rate(tegra->emc_clock, ULONG_MAX);
>  
>  	tegra->rate_change_nb.notifier_call = tegra_actmon_rate_notify_cb;
> @@ -691,6 +686,11 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
>  		tegra_actmon_configure_device(tegra, dev);
>  	}
>  
> +	for (rate = 0; rate <= tegra->max_freq * KHZ; rate++) {
> +		rate = clk_round_rate(tegra->emc_clock, rate);
> +		dev_pm_opp_add(&pdev->dev, rate, 0);
> +	}
> +

Although I am not going to NACK for the single-time performance of a
single device driver for a device that I do not have or fully understand,
please note that you may be wasting several billion cycles unless
your product is running at MHZ/kHZ level.

What is going on with this loop? Do you really have such a virtually-continuous
frequency scaling in your product? (Wow.... but in such a case, I don't think
OPP is appropriate.)


Cheers,
MyungJoo


>  	irq = platform_get_irq(pdev, 0);
>  	if (irq <= 0) {
>  		dev_err(&pdev->dev, "Failed to get IRQ\n");
> -- 
> 2.1.0
> 

             reply	other threads:[~2015-03-18  5:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  5:24 MyungJoo Ham [this message]
2015-03-18  7:25 ` [PATCH v6 5/8] PM / devfreq: tegra: remove operating-points Tomeu Vizoso
  -- strict thread matches above, loose matches on Subject: below --
2015-03-17  9:36 [PATCH v6 0/8] Add support for Tegra Activity Monitor Tomeu Vizoso
     [not found] ` <1426584991-11110-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-03-17  9:36   ` [PATCH v6 5/8] PM / devfreq: tegra: remove operating-points Tomeu Vizoso

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=192647817.276191426656237193.JavaMail.weblogic@epmlwas07d \
    --to=myungjoo.ham@samsung.com \
    --cc=gnurou@gmail.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=mikko.perttunen@kapsi.fi \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    --cc=tomeu.vizoso@collabora.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).