In that case, please see my few comments inline.<div><br></div><div>Yong<br><br><div class="gmail_quote">On Tue, Nov 16, 2010 at 8:40 PM, Amit Kucheria <span dir="ltr"><<a href="mailto:amit.kucheria@linaro.org">amit.kucheria@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Yong,<br>
<br>
No. The work that you're doing is long-term. It will take time for platforms<br>
to move to the common struct clk - almost unlikely for the next Linaro release.<br>
<br>
In the short-term, we still need all partner platforms to expose this debug<br>
information for our tools in a consistent way - OMAP already does it this<br>
way. So we want this patch applied to the Samsung platform after review and<br>
similar ones for other SoC kernels.<br>
<font color="#888888"><br>
/Amit<br>
</font><div><div></div><div class="h5"><br>
On 10 Nov 16, Yong Shen wrote:<br>
> Hi Amit,<br>
><br>
> We are trying to make this clock debug interface generic, so every platform<br>
> can benefit from it. Maybe it is better to wait for a while until the common<br>
> interface comes out.<br>
><br>
> Yong<br>
><br>
> On Tue, Nov 16, 2010 at 6:54 PM, <<a href="mailto:amit.daniel@samsung.com">amit.daniel@samsung.com</a>> wrote:<br>
><br>
> > From: Amit Daniel Kachhap <<a href="mailto:amit.daniel@samsung.com">amit.daniel@samsung.com</a>><br>
> ><br>
> > This patch adds support for clock information exposed to debug-fs<br>
> > interface.<br>
> ><br>
> > Signed-off-by: Amit Daniel Kachhap <<a href="mailto:amit.daniel@samsung.com">amit.daniel@samsung.com</a>><br>
> > ---<br>
> > arch/arm/plat-samsung/clock.c | 92<br>
> > ++++++++++++++++++++++++++++<br>
> > arch/arm/plat-samsung/include/plat/clock.h | 3 +<br>
> > 2 files changed, 95 insertions(+), 0 deletions(-)<br>
> ><br>
> > diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c<br>
> > index e8d20b0..0ba209d 100644<br>
> > --- a/arch/arm/plat-samsung/clock.c<br>
> > +++ b/arch/arm/plat-samsung/clock.c<br>
> > @@ -39,6 +39,7 @@<br>
> > #include <linux/clk.h><br>
> > #include <linux/spinlock.h><br>
> > #include <linux/io.h><br>
> > +#include <linux/debugfs.h><br></div></div></blockquote><div>Also enclose this head in macro CONFIG_DEBUG_FS</div><div>And you may also want to use CONFIG_PM_DEBUG combined with CONFIG_DEBUG_FS, and this may apply to below cases.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
> ><br>
> > #include <mach/hardware.h><br>
> > #include <asm/irq.h><br>
> > @@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned long<br>
> > xtal)<br>
> > return 0;<br>
> > }<br>
> ><br>
> > +#if defined(CONFIG_DEBUG_FS)</div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">
> > +/*<br>
> > + * debugfs support to trace clock tree hierarchy and attributes<br>
> > + */<br>
> > +static struct dentry *clk_debugfs_root;<br>
> > +<br>
> > +static int clk_debugfs_register_one(struct clk *c)<br>
> > +{<br>
> > + int err;<br>
> > + struct dentry *d, *child, *child_tmp;<br>
> > + struct clk *pa = c->parent;<br>
> > + char s[255];<br>
> > + char *p = s;<br>
> > +<br>
> > + p += sprintf(p, "%s", c->name);<br>
> > +#ifdef CONFIG_PLAT_SAMSUNG<br>
> > + /*Append id field with name also*/<br>
> > + if (c->id >= 0)<br>
> > + p += sprintf(p, ":%d", c->id);<br>
> > +#endif<br>
> > +<br>
> > + d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);<br>
> > + if (!d)<br>
> > + return -ENOMEM;<br>
> > +<br>
> > + c->dent = d;<br>
> > +<br>
> > + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8<br>
> > *)&c->usage);<br>
> > + if (!d) {<br>
> > + err = -ENOMEM;<br>
> > + goto err_out;<br>
> > + }<br>
> > + d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);<br>
> > + if (!d) {<br>
> > + err = -ENOMEM;<br>
> > + goto err_out;<br>
> > + }<br>
> > + return 0;<br>
> > +<br>
> > +err_out:<br>
> > + d = c->dent;<br>
> > + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,<br>
> > d_u.d_child)<br>
> > + debugfs_remove(child);<br>
> > + debugfs_remove(c->dent);<br>
> > + return err;<br>
> > +}<br>
> > +<br>
> > +static int clk_debugfs_register(struct clk *c)<br>
> > +{<br>
> > + int err;<br>
> > + struct clk *pa = c->parent;<br>
> > +<br>
> > + if (pa && !pa->dent) {<br>
> > + err = clk_debugfs_register(pa);<br>
> > + if (err)<br>
> > + return err;<br>
> > + }<br>
> > +<br>
> > + if (!c->dent) {<br>
> > + err = clk_debugfs_register_one(c);<br>
> > + if (err)<br>
> > + return err;<br>
> > + }<br>
> > + return 0;<br>
> > +}<br>
> > +<br>
> > +static int __init clk_debugfs_init(void)<br>
> > +{<br>
> > + struct clk *c;<br>
> > + struct dentry *d;<br>
> > + int err;<br>
> > +<br>
> > + d = debugfs_create_dir("clock", NULL);<br>
> > + if (!d)<br>
> > + return -ENOMEM;<br>
> > + clk_debugfs_root = d;<br>
> > +<br>
> > + list_for_each_entry(c, &clocks, list) {<br>
> > + err = clk_debugfs_register(c);<br>
> > + if (err)<br>
> > + goto err_out;<br>
> > + }<br>
> > + return 0;<br>
> > +err_out:<br>
> > + debugfs_remove_recursive(clk_debugfs_root);<br>
> > + return err;<br>
> > +}<br>
> > +late_initcall(clk_debugfs_init);<br>
> > +<br>
> > +#endif /* defined(CONFIG_DEBUG_FS) */<br>
> > +<br>
> > diff --git a/arch/arm/plat-samsung/include/plat/clock.h<br>
> > b/arch/arm/plat-samsung/include/plat/clock.h<br>
> > index 0fbcd0e..f6180ab 100644<br>
> > --- a/arch/arm/plat-samsung/include/plat/clock.h<br>
> > +++ b/arch/arm/plat-samsung/include/plat/clock.h<br>
> > @@ -47,6 +47,9 @@ struct clk {<br>
> ><br>
> > struct clk_ops *ops;<br>
> > int (*enable)(struct clk *, int enable);<br>
> > +#if defined(CONFIG_DEBUG_FS)<br>
> > + struct dentry *dent; /* For visible tree hierarchy */<br>
> > +#endif<br>
> > };<br>
> ><br>
> > /* other clocks which may be registered by board support */<br>
> > --<br>
> > 1.6.0.6<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > linaro-dev mailing list<br>
> > <a href="mailto:linaro-dev@lists.linaro.org">linaro-dev@lists.linaro.org</a><br>
> > <a href="http://lists.linaro.org/mailman/listinfo/linaro-dev" target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-dev</a><br>
> ><br>
<br>
> _______________________________________________<br>
> linaro-dev mailing list<br>
> <a href="mailto:linaro-dev@lists.linaro.org">linaro-dev@lists.linaro.org</a><br>
> <a href="http://lists.linaro.org/mailman/listinfo/linaro-dev" target="_blank">http://lists.linaro.org/mailman/listinfo/linaro-dev</a><br>
<br>
</div></div></blockquote></div><br></div>