Re: Add common interface for clock debug information

2010-11-09 Thread Jeremy Kerr
Hi Yong, > To do so, I need to make somethings done, and some of them are related to > common clock code, for which I am more than happy to hear your comments. Definitely, I'm happy to help out. > 1. Create clock information based on common clock device, more specific, > based on struct clk_look

Re: Add common interface for clock debug information

2010-11-10 Thread Jeremy Kerr
Hi Yong, > This means that you have already forced each SOC to have a unified > 'struct clk', or at least force some fields inside the struct tp be unified, > right? > My understanding is that leaving 'struct clk' definition to SOC related > code is to give freedom for 'struct clk' definition to S

[PATCH] clocks: add clock debugging file

2010-11-14 Thread Jeremy Kerr
Add a debugfs file to expose system clocks. Signed-off-by: Jeremy Kerr --- Yong: as promised, here's the sample debug code for the common struck clk --- arch/Kconfig |4 + arch/arm/common/clkdev.c |2 include/linux/clk.h | 20 kernel/

Re: [PATCH] clocks: add clock debugging file

2010-11-15 Thread Jeremy Kerr
Hi Yong, > Yes, it's also nice to have a file containing all the clock information > which you have implemented in the email. > Since we expect more features like enable/disable clocks in the debugfs, we > also like to have tree-like debugfs for clock information. Sure; if you want the extended f

Re: [PATCH] clocks: add clock debugging file

2010-11-15 Thread Jeremy Kerr
Hi Amit, > > @@ -64,14 +66,25 @@ struct clk { > > > > struct mutexmutex; > > spinlock_t spinlock; > > > > } lock; > > > > +#ifdef CONFIG_CLK_DEBUG > > + const char name[CLK_NAME_LEN]; > > + struct list_headlist; > > +#endif /* CO

Re: [PATCH] clocks: add clock debugging file

2010-11-16 Thread Jeremy Kerr
Hi Yong, Looks good, just a couple of things: > diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c > index 9e4c4d9..cf81e70 100644 > --- a/arch/arm/common/clkdev.c > +++ b/arch/arm/common/clkdev.c Why not do this in the core clock code (kernel/clk.c) instead? No need to make it AR

Re: [PATCH] clocks: add clock debugging file

2010-11-16 Thread Jeremy Kerr
Hi Yong, A few more comments: > diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig > index 0a34c81..0300c95 100644 > --- a/arch/arm/common/Kconfig > +++ b/arch/arm/common/Kconfig > @@ -41,3 +41,10 @@ config SHARP_SCOOP > config COMMON_CLKDEV > bool > select HAVE_CLK > + > +config

Re: [PATCH] clocks: add clock debugging file

2010-11-17 Thread Jeremy Kerr
Hi Yong, > the time of clock registering (normally at board initialization or other > early stage of boot up), debug fs system has not been initialized (happends > in core_initcall). Therefore, it is better to leave it in a standalone > function which will be called in late_initcall. If you rely

Re: [PATCH] clocks: add clock debugging file

2010-11-21 Thread Jeremy Kerr
Hi Yong, > diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c > index 9e4c4d9..936684f 100644 > --- a/arch/arm/common/clkdev.c > +++ b/arch/arm/common/clkdev.c > @@ -19,6 +19,9 @@ > #include > #include > #include > +#ifdef CONFIG_CLK_DEBUG > +#include > +#endif With changes s

Re: [PATCH] export clock debug information to user space

2010-12-08 Thread Jeremy Kerr
Hi Yong, We're getting pretty close - just a couple of changes: > + } else { > + struct preinit_clk *p; > + mutex_lock(&preinit_lock); > + p = kmalloc(sizeof(*p), GFP_KERNEL); > + if (!p) > + goto unlock; > +

Re: [PATCH] export clock debug information to user space

2010-12-08 Thread Jeremy Kerr
Hi Yong, > >> +static int __init clk_debugfs_init(void) > >> +{ > >> + struct preinit_clk *pclk, *tmp; > >> + > >> + if (debugfs_initialized()) > >> + init_done = 1; > > > > No need to check debugfs_initialised() here; if it's not initialised > > we're in trouble anyway. > >