linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] clk: keystone: gate: fix clk_init_data initialization
@ 2014-01-30 18:03 Ivan Khoronzhuk
  2014-01-31 14:46 ` Santosh Shilimkar
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Khoronzhuk @ 2014-01-30 18:03 UTC (permalink / raw)
  To: santosh.shilimkar
  Cc: mturquette, linux-arm-kernel, linux-kernel, Ivan Khoronzhuk

The clk_init_data struct is allocated in the stack. All members of
this struct should be initialized before using otherwise it will
lead to unpredictable situation as it can contain garbage.

Ultimately the clk->flag field contains garbage. In my case it leads
that flag CLK_IGNORE_UNUSED is set for most of clocks. As result a
bunch of unused clocks cannot be disabled.

So initialize flags in this structure too.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
---
Based on
git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
keystone/master

v1..v2:
- updated commit description only

 drivers/clk/keystone/gate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c
index 17a5983..86f1e36 100644
--- a/drivers/clk/keystone/gate.c
+++ b/drivers/clk/keystone/gate.c
@@ -179,6 +179,7 @@ static struct clk *clk_register_psc(struct device *dev,
 
 	init.name = name;
 	init.ops = &clk_psc_ops;
+	init.flags = 0;
 	init.parent_names = (parent_name ? &parent_name : NULL);
 	init.num_parents = (parent_name ? 1 : 0);
 
-- 
1.8.3.2


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

* Re: [PATCH v2] clk: keystone: gate: fix clk_init_data initialization
  2014-01-30 18:03 [PATCH v2] clk: keystone: gate: fix clk_init_data initialization Ivan Khoronzhuk
@ 2014-01-31 14:46 ` Santosh Shilimkar
  0 siblings, 0 replies; 2+ messages in thread
From: Santosh Shilimkar @ 2014-01-31 14:46 UTC (permalink / raw)
  To: Ivan Khoronzhuk; +Cc: mturquette, linux-arm-kernel, linux-kernel

On Thursday 30 January 2014 01:03 PM, Ivan Khoronzhuk wrote:
> The clk_init_data struct is allocated in the stack. All members of
> this struct should be initialized before using otherwise it will
> lead to unpredictable situation as it can contain garbage.
> 
> Ultimately the clk->flag field contains garbage. In my case it leads
> that flag CLK_IGNORE_UNUSED is set for most of clocks. As result a
> bunch of unused clocks cannot be disabled.
> 
> So initialize flags in this structure too.
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
> ---
> Based on
> git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
> keystone/master
> 
> v1..v2:
> - updated commit description only
> 
Thanks for the update. 

>  drivers/clk/keystone/gate.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/keystone/gate.c b/drivers/clk/keystone/gate.c
> index 17a5983..86f1e36 100644
> --- a/drivers/clk/keystone/gate.c
> +++ b/drivers/clk/keystone/gate.c
> @@ -179,6 +179,7 @@ static struct clk *clk_register_psc(struct device *dev,
>  
>  	init.name = name;
>  	init.ops = &clk_psc_ops;
> +	init.flags = 0;
>  	init.parent_names = (parent_name ? &parent_name : NULL);
>  	init.num_parents = (parent_name ? 1 : 0);
>  
> 


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

end of thread, other threads:[~2014-01-31 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-30 18:03 [PATCH v2] clk: keystone: gate: fix clk_init_data initialization Ivan Khoronzhuk
2014-01-31 14:46 ` Santosh Shilimkar

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).