Skip to contentSkip to conversation

clk: sunxi: fix sun6i PLL1 .recalc_rate() result

PATCH Superseded Chen-Yu Tsai 3 participants 7 messages Jan 24, 2015 – Jan 29, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12

---

Somehow I remember doing this during the A23 bring-up, but never sent it, and the patch was lost.

Changes in v2:

Added better commit message.

---
 drivers/clk/sunxi/clk-sunxi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/sunxi/clk-sunxi.c +1 -0
index 24c7cc12e9e1..699458e0f9b2 100644
@@ -584,6 +584,7 @@ static struct clk_factors_config sun6i_a31_pll1_config = {
 	.kwidth = 2,
 	.mshift = 0,
 	.mwidth = 2,
+	.n_start = 1,
 };
 
 static struct clk_factors_config sun8i_a23_pll1_config = {
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Hi Mike,

Quoted 7 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12

Could you queue this for 3.19?

Thanks,
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150124/30267c02/attachment.sig>
#2 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Quoting Maxime Ripard (2015-01-24 07:29:44)

Quoted 7 lines

Hi Mike,

Quoted 4 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Quoted 5 lines
Quoted 3 lines
Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12

Could you queue this for 3.19?

This is fixed in 76820fc in clk-next, destined for 3.20.

Also I'm confused by the stable tags above. Looks like 9a5e6c7eb5cc was merged for 3.16, not 3.12.

Regards,
Mike

Quoted 8 lines

Thanks,
Maxime

Signature · 3 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Quoted 12 lines · Mike Turquette

Quoting Maxime Ripard (2015-01-24 07:29:44)

Quoted 11 lines

Hi Mike,

Quoted 7 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12
Quoted 6 lines
Quoted 1 line

Could you queue this for 3.19?

This is fixed in 76820fc in clk-next, destined for 3.20.

Also I'm confused by the stable tags above. Looks like 9a5e6c7eb5cc was merged for 3.16, not 3.12.

I think so. I wasn't quite sure what the version number was supposed to be, the first version it is applicable? or the first version the specific patch was merged.

ChenYu

Quoted 8 lines
Quoted 8 lines

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#4 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Quoting Chen-Yu Tsai (2015-01-27 22:19:22)

Quoted 15 lines · Mike Turquette
Quoted 14 lines

Quoting Maxime Ripard (2015-01-24 07:29:44)

Quoted 12 lines

Hi Mike,

Quoted 7 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12

Could you queue this for 3.19?

Quoted 8 lines
Quoted 4 lines

This is fixed in 76820fc in clk-next, destined for 3.20.

Also I'm confused by the stable tags above. Looks like 9a5e6c7eb5cc was merged for 3.16, not 3.12.

I think so. I wasn't quite sure what the version number was supposed to be, the first version it is applicable? or the first version the specific patch was merged.

Chen-Yu,

I think that struct clk_factors_config did not have the n_start member before 9a5e6c7eb5cc, so this patch could not apply without 9a5e6c7eb5cc. That's from memory though, and I might be mis-remembering.

The fix is not for a new regression, thus it is going into 3.20 and I am remiss to rebase my tree to add a stable tag. Can you submit this to stable yourself after 3.20-rc1? I think the proper thing to do is to reference this patch and the commitlog to show that it was fixed upstream.

Regards,
Mike

Quoted 11 lines

ChenYu

Quoted 8 lines
Quoted 8 lines

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#5 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Quoted 25 lines · Mike Turquette

Quoting Chen-Yu Tsai (2015-01-27 22:19:22)

Quoted 15 lines · Mike Turquette
Quoted 14 lines

Quoting Maxime Ripard (2015-01-24 07:29:44)

Quoted 12 lines

Hi Mike,

Quoted 7 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12

Could you queue this for 3.19?

Quoted 8 lines
Quoted 4 lines

This is fixed in 76820fc in clk-next, destined for 3.20.

Also I'm confused by the stable tags above. Looks like 9a5e6c7eb5cc was merged for 3.16, not 3.12.

I think so. I wasn't quite sure what the version number was supposed to be, the first version it is applicable? or the first version the specific patch was merged.

Quoted 5 lines

Chen-Yu,

I think that struct clk_factors_config did not have the n_start member before 9a5e6c7eb5cc, so this patch could not apply without 9a5e6c7eb5cc. That's from memory though, and I might be mis-remembering.

AFAIK the stable-commit doc explains the format above as cherry-picking 9a5e6c7eb5cc first, then applying this patch.

Quoted 5 lines

The fix is not for a new regression, thus it is going into 3.20 and I am remiss to rebase my tree to add a stable tag. Can you submit this to stable yourself after 3.20-rc1? I think the proper thing to do is to reference this patch and the commitlog to show that it was fixed upstream.

Sure. Also CC-ing Hans, as his name is on the patch for 3.20. :)

ChenYu

Quoted 14 lines

Regards,
Mike

Quoted 11 lines

ChenYu

Quoted 8 lines
Quoted 8 lines

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#6 lore raw

PATCH v2 1/1 clk: sunxi: fix sun6i PLL1 .recalc_rate() result

Quoting Chen-Yu Tsai (2015-01-28 13:57:14)

Quoted 26 lines · Mike Turquette
Quoted 25 lines

Quoting Chen-Yu Tsai (2015-01-27 22:19:22)

Quoted 23 lines · Mike Turquette
Quoted 12 lines

Quoting Maxime Ripard (2015-01-24 07:29:44)

Quoted 11 lines

Hi Mike,

Quoted 7 lines · Chen-Yu Tsai

PLL1 on sun6i has its N factor start from 1 (N = register value + 1). Make the factors clk driver aware of this so clk_factors_recalc_rate() gives the correct result.

Cc <[email protected]> # 3.12 9a5e6c7eb5cc clk: sunxi: Support factor
Cc <[email protected]> # 3.12
Quoted 6 lines
Quoted 1 line

Could you queue this for 3.19?

This is fixed in 76820fc in clk-next, destined for 3.20.

Also I'm confused by the stable tags above. Looks like 9a5e6c7eb5cc was merged for 3.16, not 3.12.

I think so. I wasn't quite sure what the version number was supposed to be, the first version it is applicable? or the first version the specific patch was merged.

Quoted 8 lines
Quoted 5 lines

Chen-Yu,

I think that struct clk_factors_config did not have the n_start member before 9a5e6c7eb5cc, so this patch could not apply without 9a5e6c7eb5cc. That's from memory though, and I might be mis-remembering.

AFAIK the stable-commit doc explains the format above as cherry-picking 9a5e6c7eb5cc first, then applying this patch.

I just learned something new. I didn't know about the cherry-picking format. That's cool.

Quoted 8 lines
Quoted 6 lines

The fix is not for a new regression, thus it is going into 3.20 and I am remiss to rebase my tree to add a stable tag. Can you submit this to stable yourself after 3.20-rc1? I think the proper thing to do is to reference this patch and the commitlog to show that it was fixed upstream.

Sure. Also CC-ing Hans, as his name is on the patch for 3.20. :)

Thanks!

Regards,
Mike

Quoted 17 lines

ChenYu

Quoted 14 lines

Regards,
Mike

Quoted 11 lines

ChenYu

Quoted 8 lines
Quoted 8 lines

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com