From: Emil Medve <hidden> Date: 2015-01-20 10:13:24
These patches are based on:
http://patchwork.ozlabs.org/patch/417297http://patchwork.ozlabs.org/patch/417295http://patchwork.ozlabs.org/patch/417292
The first 5 patches below are checkpatch/static analysis fixes
Emil Medve (8):
clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT
clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY
clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT
clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE
clk: ppc-corenet: Make local symbol 'static'
clk: ppc-corenet: Replace kzalloc() with kmalloc()
powerpc/corenet: Enable CLK_PPC_CORENET
clk: ppc-corenet: Add support for the platform PLL
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/configs/corenet64_smp_defconfig | 1 +
drivers/clk/clk-ppc-corenet.c | 120 ++++++++++++++++++++++-----
3 files changed, 101 insertions(+), 21 deletions(-)
--
2.2.2
From: Emil Medve <hidden> Date: 2015-01-20 10:13:24
drivers/clk/clk-ppc-corenet.c:63:22: warning: symbol 'cmux_ops' was not declared. Should it be static?
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -85,7 +85,7 @@ static void __init core_mux_init(struct device_node *np)pr_err("%s: get clock count error\n",np->name);return;}-parent_names=kzalloc((sizeof(char*)*count),GFP_KERNEL);+parent_names=kcalloc(count,sizeof(char*),GFP_KERNEL);if(!parent_names){pr_err("%s: could not allocate parent_names\n",__func__);return;
@@ -184,7 +184,7 @@ static void __init core_pll_init(struct device_node *np)/* output clock number per PLL */clocks_per_pll=count;-subclks=kzalloc(sizeof(structclk*)*count,GFP_KERNEL);+subclks=kcalloc(count,sizeof(structclk*),GFP_KERNEL);if(!subclks){pr_err("%s: could not allocate subclks\n",__func__);gotoerr_map;
@@ -147,6 +147,7 @@ CONFIG_STAGING=y CONFIG_MEMORY=y CONFIG_VIRT_DRIVERS=y CONFIG_FSL_HV_MANAGER=y+CONFIG_CLK_PPC_CORENET=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
From: Emil Medve <hidden> Date: 2015-01-20 10:13:26
Where the memset() is not necessary
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Emil Medve <hidden> Date: 2015-01-20 10:27:58
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+ if (!parent_names) {
+ pr_err("%s: could not allocate parent_names\n", __func__);
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+ if (!cmux_clk) {
+ pr_err("%s: could not allocate cmux_clk\n", __func__);
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+ if (!subclks) {
+ pr_err("%s: could not allocate subclks\n", __func__);
WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message
+ if (!onecell_data) {
+ pr_err("%s: could not allocate onecell_data\n", __func__);
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
@@ -86,19 +86,16 @@ static void __init core_mux_init(struct device_node *np)return;}parent_names=kcalloc(count,sizeof(char*),GFP_KERNEL);-if(!parent_names){-pr_err("%s: could not allocate parent_names\n",__func__);+if(!parent_names)return;-}for(i=0;i<count;i++)parent_names[i]=of_clk_get_parent_name(np,i);cmux_clk=kzalloc(sizeof(*cmux_clk),GFP_KERNEL);-if(!cmux_clk){-pr_err("%s: could not allocate cmux_clk\n",__func__);+if(!cmux_clk)gotoerr_name;-}+cmux_clk->reg=of_iomap(np,0);if(!cmux_clk->reg){pr_err("%s: could not map register\n",__func__);
@@ -185,16 +182,12 @@ static void __init core_pll_init(struct device_node *np)clocks_per_pll=count;subclks=kcalloc(count,sizeof(structclk*),GFP_KERNEL);-if(!subclks){-pr_err("%s: could not allocate subclks\n",__func__);+if(!subclks)gotoerr_map;-}onecell_data=kzalloc(sizeof(*onecell_data),GFP_KERNEL);-if(!onecell_data){-pr_err("%s: could not allocate onecell_data\n",__func__);+if(!onecell_data)gotoerr_clks;-}for(i=0;i<count;i++){rc=of_property_read_string_index(np,"clock-output-names",
From: Emil Medve <hidden> Date: 2015-01-20 10:28:22
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+ rc = of_property_read_string_index(np, "clock-output-names",
+ 0, &clk_name);
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+ pr_err("Could not register clock provider for node:%s\n",
+ np->name);
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+ rc = of_property_read_string_index(np, "clock-output-names",
+ i, &clk_name);
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
+ pr_err("Could not register clk provider for node:%s\n",
+ np->name);
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -132,7 +132,7 @@ static void __init core_mux_init(struct device_node *np)rc=of_clk_add_provider(np,of_clk_src_simple_get,clk);if(rc){pr_err("Could not register clock provider for node:%s\n",-np->name);+np->name);gotoerr_clk;}gotoerr_name;
@@ -198,7 +198,7 @@ static void __init core_pll_init(struct device_node *np)for(i=0;i<count;i++){rc=of_property_read_string_index(np,"clock-output-names",-i,&clk_name);+i,&clk_name);if(rc){pr_err("%s: could not get clock names\n",np->name);gotoerr_cell;
@@ -230,7 +230,7 @@ static void __init core_pll_init(struct device_node *np)rc=of_clk_add_provider(np,of_clk_src_onecell_get,onecell_data);if(rc){pr_err("Could not register clk provider for node:%s\n",-np->name);+np->name);gotoerr_cell;}
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Tuesday, January 20, 2015 6:09 PM
To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; mturquette@linaro.o=
rg;
haokexin@gmail.com; Tang Yuantian-B29983
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 0/8] clk: ppc-corenet: Add support for the platform PLL
=20
These patches are based on:
=20
http://patchwork.ozlabs.org/patch/417297http://patchwork.ozlabs.org/patch/417295http://patchwork.ozlabs.org/patch/417292
=20
The first 5 patches below are checkpatch/static analysis fixes
=20
Emil Medve (8):
clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT
clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY
clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT
clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE
clk: ppc-corenet: Make local symbol 'static'
clk: ppc-corenet: Replace kzalloc() with kmalloc()
powerpc/corenet: Enable CLK_PPC_CORENET
clk: ppc-corenet: Add support for the platform PLL
=20
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/configs/corenet64_smp_defconfig | 1 +
drivers/clk/clk-ppc-corenet.c | 120
++++++++++++++++++++++-----
3 files changed, 101 insertions(+), 21 deletions(-)
=20
--
2.2.2
Which platform are you trying to use this on? Can this be initialized by co=
re pll function core_pll_init()?
I just saw most of this function is silimar to the core_pll_init().
Thanks,
Yuantian
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Tuesday, January 20, 2015 6:10 PM
To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; mturquette@linaro.o=
rg;
quoted hunk
haokexin@gmail.com; Tang Yuantian-B29983
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL
=20
Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 85
+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
=20
From: Emil Medve <hidden> Date: 2015-01-21 06:25:49
Hello Yuan-Tian,
On 01/20/2015 07:40 PM, Tang Yuantian-B29983 wrote:
Hi Emil,
Thanks for fixing those warnings. The patch set you based on is merged.
I sent another two patches and one of them got merged. You probably need to rebase your patches.
My patch link:
http://patchwork.ozlabs.org/patch/429257/
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Tuesday, January 20, 2015 6:09 PM
To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; mturquette@linaro.org;
haokexin@gmail.com; Tang Yuantian-B29983
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 0/8] clk: ppc-corenet: Add support for the platform PLL
These patches are based on:
http://patchwork.ozlabs.org/patch/417297http://patchwork.ozlabs.org/patch/417295http://patchwork.ozlabs.org/patch/417292
The first 5 patches below are checkpatch/static analysis fixes
Emil Medve (8):
clk: ppc-corenet: Fix checkpatch type PARENTHESIS_ALIGNMENT
clk: ppc-corenet: Fix checkpatch type ALLOC_WITH_MULTIPLY
clk: ppc-corenet: Fix checkpatch type ALLOC_SIZEOF_STRUCT
clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE
clk: ppc-corenet: Make local symbol 'static'
clk: ppc-corenet: Replace kzalloc() with kmalloc()
powerpc/corenet: Enable CLK_PPC_CORENET
clk: ppc-corenet: Add support for the platform PLL
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/configs/corenet64_smp_defconfig | 1 +
drivers/clk/clk-ppc-corenet.c | 120
++++++++++++++++++++++-----
3 files changed, 101 insertions(+), 21 deletions(-)
--
2.2.2
Hi Emil,
I don't think it is the best to add a function that is very similar to exis=
ting one.=20
If you think the function name is not appropriate, rename it.
Thanks,
Yuantian
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Wednesday, January 21, 2015 4:20 PM
To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B0742=
1;
mturquette@linaro.org; haokexin@gmail.com
Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform P=
From: Emil Medve <hidden> Date: 2015-01-21 09:03:52
Hello Yuan-Tian,
On 01/21/2015 02:35 AM, Tang Yuantian-B29983 wrote:
Hi Emil,
I don't think it is the best to add a function that is very similar to existing one.
If you think the function name is not appropriate, rename it.
It's not a naming matter. As I said, core_pll_init() assumptions and
decisions based on the number of clocks in the DT. My hunch is some of
these assumptions are not necessary and/or should be explicit based on
the node/device compatible. Having a standalone platform PLL
initialization function wasn't a unilateral lack of foresight
Cheers,
Thanks,
Yuantian
quoted
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Wednesday, January 21, 2015 4:20 PM
To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
mturquette@linaro.org; haokexin@gmail.com
Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL
Hello Yuan-Tian,
On 01/20/2015 11:42 PM, Tang Yuantian-B29983 wrote:
quoted
Which platform are you trying to use this on?
CoreNet chassis v1 and v2 SoC(s)
quoted
Can this be initialized by core pll function core_pll_init()?
I just saw most of this function is silimar to the core_pll_init().
Yes, the flow is similar, but core_pll_init() makes assumptions that it shouldn't or
are not relevant to the platform PLL
Cheers,
quoted
Thanks,
Yuantian
quoted
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Tuesday, January 20, 2015 6:10 PM
To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
mturquette@linaro.org; haokexin@gmail.com; Tang Yuantian-B29983
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform
PLL
Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 85
+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/drivers/clk/clk-ppc-corenet.c
b/drivers/clk/clk-ppc-corenet.c index
91816b1..ff425e1 100644
From the RM and your code, I didn't see any difference between the two type=
of PLL.
Could you provide some use cases or feature that prove this is necessary?
If there did have some features that current function didn't contain, can w=
e expend the current one to include it?
BTW: if you did need this, please update the binding as well, if any:
Documentation/devicetree/bindings/clock/qoriq-clock.txt
Thanks,
Yuantian
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Wednesday, January 21, 2015 5:03 PM
To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B0742=
1;
mturquette@linaro.org; haokexin@gmail.com
Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform P=
From: Emil Medve <hidden> Date: 2015-01-21 09:59:37
Hello Yuan-Tian,
On 01/21/2015 03:37 AM, Tang Yuantian-B29983 wrote:
Hello Emil,
quoted
From the RM and your code, I didn't see any difference between the two type of PLL.
Could you provide some use cases or feature that prove this is necessary?
I said the DT makes the core_pll_init() code stand out. Yes, the
register layout is identical, but that's not the entire story about the
place of these PLL(s) in the SoC clocking hierarchy/tree
If there did have some features that current function didn't
contain, can we expend the current one to include it?
Once core_pll_init() gets fixed/cleaned up somebody should look into
unifying *_pll_init()
BTW: if you did need this, please update the binding as well, if any:
Documentation/devicetree/bindings/clock/qoriq-clock.txt
The platform PLL binding is already there
Cheers,
Thanks,
Yuantian
quoted
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Wednesday, January 21, 2015 5:03 PM
To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
mturquette@linaro.org; haokexin@gmail.com
Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the platform PLL
Hello Yuan-Tian,
On 01/21/2015 02:35 AM, Tang Yuantian-B29983 wrote:
quoted
Hi Emil,
I don't think it is the best to add a function that is very similar to existing one.
If you think the function name is not appropriate, rename it.
It's not a naming matter. As I said, core_pll_init() assumptions and decisions
based on the number of clocks in the DT. My hunch is some of these assumptions
are not necessary and/or should be explicit based on the node/device compatible.
Having a standalone platform PLL initialization function wasn't a unilateral lack of
foresight
Cheers,
quoted
Thanks,
Yuantian
quoted
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Wednesday, January 21, 2015 4:20 PM
To: Tang Yuantian-B29983; linuxppc-dev@lists.ozlabs.org; Wood
Scott-B07421; mturquette@linaro.org; haokexin@gmail.com
Subject: Re: [PATCH 8/8] clk: ppc-corenet: Add support for the
platform PLL
Hello Yuan-Tian,
On 01/20/2015 11:42 PM, Tang Yuantian-B29983 wrote:
quoted
Which platform are you trying to use this on?
CoreNet chassis v1 and v2 SoC(s)
quoted
Can this be initialized by core pll function core_pll_init()?
I just saw most of this function is silimar to the core_pll_init().
Yes, the flow is similar, but core_pll_init() makes assumptions that
it shouldn't or are not relevant to the platform PLL
Cheers,
quoted
Thanks,
Yuantian
quoted
-----Original Message-----
From: Emil Medve [mailto:Emilian.Medve@Freescale.com]
Sent: Tuesday, January 20, 2015 6:10 PM
To: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
mturquette@linaro.org; haokexin@gmail.com; Tang Yuantian-B29983
Cc: Medve Emilian-EMMEDVE1
Subject: [PATCH 8/8] clk: ppc-corenet: Add support for the platform
PLL
Change-Id: Iac11ed95f274485a86d2c11f32a3dc502bcd020f
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 85
+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/drivers/clk/clk-ppc-corenet.c
b/drivers/clk/clk-ppc-corenet.c index
91816b1..ff425e1 100644
From: Scott Wood <hidden> Date: 2015-02-25 01:14:33
On Tue, 2015-01-20 at 04:09 -0600, Emil Medve wrote:
Change-Id: I1a80ad7b9f6854791bd270b746f93a91439155a6
Signed-off-by: Emil Medve <redacted>
No Change-Id, and don't bundle patches meant for my tree in the same
patchset as patches meant for other trees. There's no dependency
between them.
-Scott
From: Scott Wood <hidden> Date: 2015-02-25 01:17:33
On Tue, 2015-01-20 at 04:09 -0600, Emil Medve wrote:
quoted hunk
Where the memset() is not necessary
Signed-off-by: Emil Medve <redacted>
---
drivers/clk/clk-ppc-corenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)