All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: "Mike Turquette" <mturquette@linaro.org>,
	"Javier Martinez Canillas" <javier.martinez@collabora.co.uk>,
	"Jiri Kosina" <jkosina@suse.cz>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Boris Brezillon" <boris.brezillon@free-electrons.com>,
	"Emilio López" <emilio@elopez.com.ar>,
	"Maxime Ripard" <maxime.ripard@free-electrons.com>,
	"Manuel Lauss" <manuel.lauss@gmail.com>,
	"Alex Elder" <elder@linaro.org>,
	"Matt Porter" <mporter@linaro.org>,
	"Tim Kryger" <tim.kryger@linaro.org>,
	"Haojian Zhuang" <haojian.zhuang@linaro.org>,
	"Zhangfei Gao" <zhangfei.gao@linaro.org>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mips@linux-mips.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 6/8] clk: Change clk_ops->determine_rate to return a clk_hw as the best parent
Date: Thu, 9 Oct 2014 13:44:33 -0700	[thread overview]
Message-ID: <20141009204433.GE5493@codeaurora.org> (raw)
In-Reply-To: <1412866903-6970-7-git-send-email-tomeu.vizoso@collabora.com>

On 10/09, Tomeu Vizoso wrote:
> @@ -946,6 +946,7 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
>  {
>  	unsigned long parent_rate = 0;
>  	struct clk *parent;
> +	struct clk_hw *parent_hw;
>  
>  	if (!clk)
>  		return 0;
> @@ -956,7 +957,7 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
>  
>  	if (clk->ops->determine_rate)
>  		return clk->ops->determine_rate(clk->hw, rate, &parent_rate,
> -						&parent);
> +						&parent_hw);

We should assign the value of parent_hw somewhere here so that
drivers don't need to if they want the current parent. This would
match the current behavior where parent is already assigned the
current parent.

>  	else if (clk->ops->round_rate)
>  		return clk->ops->round_rate(clk->hw, rate, &parent_rate);
>  	else if (clk->flags & CLK_SET_RATE_PARENT)
> @@ -1345,6 +1346,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
>  {
>  	struct clk *top = clk;
>  	struct clk *old_parent, *parent;
> +	struct clk_hw *parent_hw;
>  	unsigned long best_parent_rate = 0;
>  	unsigned long new_rate;
>  	int p_index = 0;
> @@ -1362,7 +1364,8 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
>  	if (clk->ops->determine_rate) {
>  		new_rate = clk->ops->determine_rate(clk->hw, rate,
>  						    &best_parent_rate,
> -						    &parent);
> +						    &parent_hw);
> +		parent = parent_hw->clk;

Same comment here.

>  	} else if (clk->ops->round_rate) {
>  		new_rate = clk->ops->round_rate(clk->hw, rate,
>  						&best_parent_rate);
> 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/8] clk: Change clk_ops->determine_rate to return a clk_hw as the best parent
Date: Thu, 9 Oct 2014 13:44:33 -0700	[thread overview]
Message-ID: <20141009204433.GE5493@codeaurora.org> (raw)
In-Reply-To: <1412866903-6970-7-git-send-email-tomeu.vizoso@collabora.com>

On 10/09, Tomeu Vizoso wrote:
> @@ -946,6 +946,7 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
>  {
>  	unsigned long parent_rate = 0;
>  	struct clk *parent;
> +	struct clk_hw *parent_hw;
>  
>  	if (!clk)
>  		return 0;
> @@ -956,7 +957,7 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
>  
>  	if (clk->ops->determine_rate)
>  		return clk->ops->determine_rate(clk->hw, rate, &parent_rate,
> -						&parent);
> +						&parent_hw);

We should assign the value of parent_hw somewhere here so that
drivers don't need to if they want the current parent. This would
match the current behavior where parent is already assigned the
current parent.

>  	else if (clk->ops->round_rate)
>  		return clk->ops->round_rate(clk->hw, rate, &parent_rate);
>  	else if (clk->flags & CLK_SET_RATE_PARENT)
> @@ -1345,6 +1346,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
>  {
>  	struct clk *top = clk;
>  	struct clk *old_parent, *parent;
> +	struct clk_hw *parent_hw;
>  	unsigned long best_parent_rate = 0;
>  	unsigned long new_rate;
>  	int p_index = 0;
> @@ -1362,7 +1364,8 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
>  	if (clk->ops->determine_rate) {
>  		new_rate = clk->ops->determine_rate(clk->hw, rate,
>  						    &best_parent_rate,
> -						    &parent);
> +						    &parent_hw);
> +		parent = parent_hw->clk;

Same comment here.

>  	} else if (clk->ops->round_rate) {
>  		new_rate = clk->ops->round_rate(clk->hw, rate,
>  						&best_parent_rate);
> 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2014-10-09 20:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 15:01 [PATCH v3 0/8] Per-user clock constraints Tomeu Vizoso
2014-10-09 15:01 ` Tomeu Vizoso
2014-10-09 15:01 ` [PATCH v3 1/8] MIPS: Alchemy: Remove direct access to prepare_count field of struct clk Tomeu Vizoso
2014-10-09 20:45   ` Stephen Boyd
2014-10-09 15:01 ` [PATCH v3 2/8] clk: Remove unused function __clk_get_prepare_count Tomeu Vizoso
2014-10-09 15:01 ` [PATCH v3 3/8] clk: Don't try to use a struct clk* after it could have been freed Tomeu Vizoso
2014-10-09 20:27   ` Stephen Boyd
2014-10-09 15:01 ` [PATCH v3 4/8] clk: Don't expose __clk_get_accuracy Tomeu Vizoso
2014-10-09 15:01 ` [PATCH v3 5/8] clk: change clk_debugfs_add_file to take a struct clk_hw Tomeu Vizoso
2014-10-09 15:01 ` [PATCH v3 6/8] clk: Change clk_ops->determine_rate to return a clk_hw as the best parent Tomeu Vizoso
2014-10-09 15:01   ` Tomeu Vizoso
2014-10-09 20:44   ` Stephen Boyd [this message]
2014-10-09 20:44     ` Stephen Boyd
2014-10-09 15:01 ` [PATCH v3 7/8] clk: Make clk API return per-user struct clk instances Tomeu Vizoso
2014-10-09 15:01   ` Tomeu Vizoso
2014-10-09 23:22   ` Stephen Boyd
2014-10-09 23:22     ` Stephen Boyd
2014-10-09 23:42     ` Kodiak Furr
2014-10-09 23:42       ` Kodiak Furr
2014-10-09 23:42       ` Kodiak Furr
2014-10-13 14:23     ` Tomeu Vizoso
2014-10-13 14:23       ` Tomeu Vizoso
2014-10-09 15:01 ` [PATCH v3 8/8] clk: Add floor and ceiling constraints to clock rates Tomeu Vizoso
2014-10-10 23:55   ` Stephen Boyd
2014-10-14 13:27     ` Tomeu Vizoso
2014-10-24  0:54       ` Stephen Boyd

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=20141009204433.GE5493@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=elder@linaro.org \
    --cc=emilio@elopez.com.ar \
    --cc=haojian.zhuang@linaro.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=jh80.chung@samsung.com \
    --cc=jkosina@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=manuel.lauss@gmail.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mporter@linaro.org \
    --cc=mturquette@linaro.org \
    --cc=ralf@linux-mips.org \
    --cc=tim.kryger@linaro.org \
    --cc=tomeu.vizoso@collabora.com \
    --cc=zhangfei.gao@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.