public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock
@ 2015-06-25 22:35 Hai Li
  2015-06-26 10:46 ` Archit Taneja
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hai Li @ 2015-06-25 22:35 UTC (permalink / raw)
  To: linux-kernel, sboyd
  Cc: mturquette, georgi.djakov, tomeu.vizoso, architt, Hai Li

Since the parent rate has been recalculated, pixel RCG clock
should rely on it to find the correct M/N values during set_rate,
instead of calling __clk_round_rate() to its parent again.

Signed-off-by: Hai Li <hali@codeaurora.org>
---
 drivers/clk/qcom/clk-rcg2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 4d3e2f7..b344899 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -615,10 +615,11 @@ static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
 	if (!parent)
 		return -EINVAL;
 
+	src_rate = parent_rate;
+
 	for (; frac->num; frac++) {
 		request = (rate * frac->den) / frac->num;
 
-		src_rate = __clk_round_rate(parent, request);
 		if ((src_rate < (request - delta)) ||
 			(src_rate > (request + delta)))
 			continue;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock
  2015-06-25 22:35 [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock Hai Li
@ 2015-06-26 10:46 ` Archit Taneja
  2015-07-02 16:48 ` Stephen Boyd
  2015-07-06 14:49 ` [PATCH v2] " Hai Li
  2 siblings, 0 replies; 5+ messages in thread
From: Archit Taneja @ 2015-06-26 10:46 UTC (permalink / raw)
  To: Hai Li, linux-kernel, sboyd; +Cc: mturquette, georgi.djakov, tomeu.vizoso



On 06/26/2015 04:05 AM, Hai Li wrote:
> Since the parent rate has been recalculated, pixel RCG clock
> should rely on it to find the correct M/N values during set_rate,
> instead of calling __clk_round_rate() to its parent again.

Tested-by: Archit Taneja <architt@codeaurora.org>

>
> Signed-off-by: Hai Li <hali@codeaurora.org>
> ---
>   drivers/clk/qcom/clk-rcg2.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
> index 4d3e2f7..b344899 100644
> --- a/drivers/clk/qcom/clk-rcg2.c
> +++ b/drivers/clk/qcom/clk-rcg2.c
> @@ -615,10 +615,11 @@ static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
>   	if (!parent)
>   		return -EINVAL;
>
> +	src_rate = parent_rate;
> +
>   	for (; frac->num; frac++) {
>   		request = (rate * frac->den) / frac->num;
>
> -		src_rate = __clk_round_rate(parent, request);
>   		if ((src_rate < (request - delta)) ||
>   			(src_rate > (request + delta)))
>   			continue;
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock
  2015-06-25 22:35 [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock Hai Li
  2015-06-26 10:46 ` Archit Taneja
@ 2015-07-02 16:48 ` Stephen Boyd
  2015-07-06 14:49 ` [PATCH v2] " Hai Li
  2 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2015-07-02 16:48 UTC (permalink / raw)
  To: Hai Li; +Cc: linux-kernel, mturquette, georgi.djakov, tomeu.vizoso, architt

On 06/25, Hai Li wrote:
> Since the parent rate has been recalculated, pixel RCG clock
> should rely on it to find the correct M/N values during set_rate,
> instead of calling __clk_round_rate() to its parent again.
> 
> Signed-off-by: Hai Li <hali@codeaurora.org>
> ---

Applied to clk-fixes, but please send patches based on
clk-fixes/clk-next instead of whatever was done here. I had to fixup
conflicts.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] clk: qcom: Use parent rate when set rate to pixel RCG clock
  2015-06-25 22:35 [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock Hai Li
  2015-06-26 10:46 ` Archit Taneja
  2015-07-02 16:48 ` Stephen Boyd
@ 2015-07-06 14:49 ` Hai Li
  2015-07-06 19:32   ` Stephen Boyd
  2 siblings, 1 reply; 5+ messages in thread
From: Hai Li @ 2015-07-06 14:49 UTC (permalink / raw)
  To: sboyd
  Cc: mturquette, georgi.djakov, tomeu.vizoso, architt, linux-clk,
	linux-kernel, Hai Li

Since the parent rate has been recalculated, pixel RCG clock
should rely on it to find the correct M/N values during set_rate,
instead of calling __clk_round_rate() to its parent again.

v2: Rebase on clk-next and avoid build warning

Signed-off-by: Hai Li <hali@codeaurora.org>
Tested-by: Archit Taneja <architt@codeaurora.org>
Fixes: 99cbd064b059 ("clk: qcom: Support display RCG clocks")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clk/qcom/clk-rcg2.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index b95d17f..92936f0 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -530,19 +530,16 @@ static int clk_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
 	struct clk_rcg2 *rcg = to_clk_rcg2(hw);
 	struct freq_tbl f = *rcg->freq_tbl;
 	const struct frac_entry *frac = frac_table_pixel;
-	unsigned long request, src_rate;
+	unsigned long request;
 	int delta = 100000;
 	u32 mask = BIT(rcg->hid_width) - 1;
 	u32 hid_div;
-	int index = qcom_find_src_index(hw, rcg->parent_map, f.src);
-	struct clk *parent = clk_get_parent_by_index(hw->clk, index);
 
 	for (; frac->num; frac++) {
 		request = (rate * frac->den) / frac->num;
 
-		src_rate = __clk_round_rate(parent, request);
-		if ((src_rate < (request - delta)) ||
-			(src_rate > (request + delta)))
+		if ((parent_rate < (request - delta)) ||
+			(parent_rate > (request + delta)))
 			continue;
 
 		regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + CFG_REG,
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] clk: qcom: Use parent rate when set rate to pixel RCG clock
  2015-07-06 14:49 ` [PATCH v2] " Hai Li
@ 2015-07-06 19:32   ` Stephen Boyd
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2015-07-06 19:32 UTC (permalink / raw)
  To: Hai Li
  Cc: mturquette, georgi.djakov, tomeu.vizoso, architt, linux-clk,
	linux-kernel

On 07/06/2015 07:49 AM, Hai Li wrote:
> Since the parent rate has been recalculated, pixel RCG clock
> should rely on it to find the correct M/N values during set_rate,
> instead of calling __clk_round_rate() to its parent again.
>
> v2: Rebase on clk-next and avoid build warning
>
> Signed-off-by: Hai Li <hali@codeaurora.org>
> Tested-by: Archit Taneja <architt@codeaurora.org>
> Fixes: 99cbd064b059 ("clk: qcom: Support display RCG clocks")
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---

Huh? I didn't sign this off. The original patch was already applied, so
a new patch on top of the patch in -next that removed the index and
parent lines and renamed the variable should have been sent. Then we
have the option of applying the new patch on top to silence the warning,
or to squash it into the original patch if we want to redo clk-fixes.
I've opted to redo clk-fixes this time.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-06 19:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 22:35 [PATCH] clk: qcom: Use parent rate when set rate to pixel RCG clock Hai Li
2015-06-26 10:46 ` Archit Taneja
2015-07-02 16:48 ` Stephen Boyd
2015-07-06 14:49 ` [PATCH v2] " Hai Li
2015-07-06 19:32   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox