Skip to contentSkip to conversation

ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

PATCH Superseded amit.daniel at samsung.com 4 participants 5 messages Nov 16, 2010 – Nov 22, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

From: Amit Daniel Kachhap <[email protected]>

This patch adds support for clock information exposed to debug-fs interface.

---
 arch/arm/plat-samsung/clock.c              |   92 ++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +92 -0
index e8d20b0..0ba209d 100644
@@ -39,6 +39,7 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned long xtal)
 	return 0;
 }
 
+#if defined(CONFIG_DEBUG_FS)
+/*
+ *	debugfs support to trace clock tree hierarchy and attributes
+ */
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+	int err;
+	struct dentry *d, *child, *child_tmp;
+	struct clk *pa = c->parent;
+	char s[255];
+	char *p = s;
+
+	p += sprintf(p, "%s", c->name);
+#ifdef CONFIG_PLAT_SAMSUNG
+	/*Append id field with name also*/
+	if (c->id >= 0)
+		p += sprintf(p, ":%d", c->id);
+#endif
+
+	d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+	if (!d)
+		return -ENOMEM;
+
+	c->dent = d;
+
+	d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usage);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	return 0;
+
+err_out:
+	d = c->dent;
+	list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
+		debugfs_remove(child);
+	debugfs_remove(c->dent);
+	return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+	int err;
+	struct clk *pa = c->parent;
+
+	if (pa && !pa->dent) {
+		err = clk_debugfs_register(pa);
+		if (err)
+			return err;
+	}
+
+	if (!c->dent) {
+		err = clk_debugfs_register_one(c);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+	struct clk *c;
+	struct dentry *d;
+	int err;
+
+	d = debugfs_create_dir("clock", NULL);
+	if (!d)
+		return -ENOMEM;
+	clk_debugfs_root = d;
+
+	list_for_each_entry(c, &clocks, list) {
+		err = clk_debugfs_register(c);
+		if (err)
+			goto err_out;
+	}
+	return 0;
+err_out:
+	debugfs_remove_recursive(clk_debugfs_root);
+	return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat-samsung/include/plat/clock.h +3 -0
index 0fbcd0e..f6180ab 100644
@@ -47,6 +47,9 @@ struct clk {
 
 	struct clk_ops		*ops;
 	int		    (*enable)(struct clk *, int enable);
+#if defined(CONFIG_DEBUG_FS)
+	struct dentry		*dent;	/* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

Hi Amit,

We are trying to make this clock debug interface generic, so every platform can benefit from it. Maybe it is better to wait for a while until the common interface comes out.

Yong

Quoted 141 lines · On Tue, Nov 16, 2010 at 6:54 PM, <[email protected]> wrote:

From: Amit Daniel Kachhap <[email protected]>

This patch adds support for clock information exposed to debug-fs interface.

---
 arch/arm/plat-samsung/clock.c              |   92
++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +29 -0
index e8d20b0..0ba209d 100644
@@ -39,6 +39,7 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned long
 xtal)
       return 0;
 }
 
+#if defined(CONFIG_DEBUG_FS)
+/*
+ *     debugfs support to trace clock tree hierarchy and attributes
+ */
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+       int err;
+       struct dentry *d, *child, *child_tmp;
+       struct clk *pa = c->parent;
+       char s[255];
+       char *p = s;
+
+       p += sprintf(p, "%s", c->name);
+#ifdef CONFIG_PLAT_SAMSUNG
+       /*Append id field with name also*/
+       if (c->id >= 0)
+               p += sprintf(p, ":%d", c->id);
+#endif
+
+       d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+       if (!d)
+               return -ENOMEM;
+
+       c->dent = d;
+
+       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

arch/arm/plat-samsung/clock.c +14 -0
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       return 0;
+
+err_out:
+       d = c->dent;
+       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

arch/arm/plat-samsung/clock.c +49 -0
+               debugfs_remove(child);
+       debugfs_remove(c->dent);
+       return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+       int err;
+       struct clk *pa = c->parent;
+
+       if (pa && !pa->dent) {
+               err = clk_debugfs_register(pa);
+               if (err)
+                       return err;
+       }
+
+       if (!c->dent) {
+               err = clk_debugfs_register_one(c);
+               if (err)
+                       return err;
+       }
+       return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+       struct clk *c;
+       struct dentry *d;
+       int err;
+
+       d = debugfs_create_dir("clock", NULL);
+       if (!d)
+               return -ENOMEM;
+       clk_debugfs_root = d;
+
+       list_for_each_entry(c, &clocks, list) {
+               err = clk_debugfs_register(c);
+               if (err)
+                       goto err_out;
+       }
+       return 0;
+err_out:
+       debugfs_remove_recursive(clk_debugfs_root);
+       return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat-samsung/include/plat/clock.h +3 -1
index 0fbcd0e..f6180ab 100644
@@ -47,6 +47,9 @@ struct clk {
 
       struct clk_ops          *ops;
       int                 (*enable)(struct clk *, int enable);
+#if defined(CONFIG_DEBUG_FS)
+       struct dentry           *dent;  /* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
--

1.6.0.6

Quoted 5 lines

_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101116/c3995728/attachment-0001.html>

#2 lore raw

PATCH 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

Yong,

No. The work that you're doing is long-term. It will take time for platforms to move to the common struct clk - almost unlikely for the next Linaro release.

In the short-term, we still need all partner platforms to expose this debug information for our tools in a consistent way - OMAP already does it this way. So we want this patch applied to the Samsung platform after review and similar ones for other SoC kernels.

/Amit

Quoted 161 lines · Yong Shen

Hi Amit,

We are trying to make this clock debug interface generic, so every platform can benefit from it. Maybe it is better to wait for a while until the common interface comes out.

Yong

Quoted 141 lines · On Tue, Nov 16, 2010 at 6:54 PM, <[email protected]> wrote:

From: Amit Daniel Kachhap <[email protected]>

This patch adds support for clock information exposed to debug-fs interface.

---
 arch/arm/plat-samsung/clock.c              |   92
++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)
arch/arm/plat-samsung/clock.c +29 -0
index e8d20b0..0ba209d 100644
@@ -39,6 +39,7 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned long
 xtal)
       return 0;
 }
 
+#if defined(CONFIG_DEBUG_FS)
+/*
+ *     debugfs support to trace clock tree hierarchy and attributes
+ */
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+       int err;
+       struct dentry *d, *child, *child_tmp;
+       struct clk *pa = c->parent;
+       char s[255];
+       char *p = s;
+
+       p += sprintf(p, "%s", c->name);
+#ifdef CONFIG_PLAT_SAMSUNG
+       /*Append id field with name also*/
+       if (c->id >= 0)
+               p += sprintf(p, ":%d", c->id);
+#endif
+
+       d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+       if (!d)
+               return -ENOMEM;
+
+       c->dent = d;
+
+       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

arch/arm/plat-samsung/clock.c +14 -0
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       return 0;
+
+err_out:
+       d = c->dent;
+       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

arch/arm/plat-samsung/clock.c +49 -0
+               debugfs_remove(child);
+       debugfs_remove(c->dent);
+       return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+       int err;
+       struct clk *pa = c->parent;
+
+       if (pa && !pa->dent) {
+               err = clk_debugfs_register(pa);
+               if (err)
+                       return err;
+       }
+
+       if (!c->dent) {
+               err = clk_debugfs_register_one(c);
+               if (err)
+                       return err;
+       }
+       return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+       struct clk *c;
+       struct dentry *d;
+       int err;
+
+       d = debugfs_create_dir("clock", NULL);
+       if (!d)
+               return -ENOMEM;
+       clk_debugfs_root = d;
+
+       list_for_each_entry(c, &clocks, list) {
+               err = clk_debugfs_register(c);
+               if (err)
+                       goto err_out;
+       }
+       return 0;
+err_out:
+       debugfs_remove_recursive(clk_debugfs_root);
+       return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat-samsung/include/plat/clock.h +3 -1
index 0fbcd0e..f6180ab 100644
@@ -47,6 +47,9 @@ struct clk {
 
       struct clk_ops          *ops;
       int                 (*enable)(struct clk *, int enable);
+#if defined(CONFIG_DEBUG_FS)
+       struct dentry           *dent;  /* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
--

1.6.0.6

Quoted 5 lines

_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

#3 lore raw

PATCH 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

In that case, please see my few comments inline.

Yong

Quoted 42 lines · Amit Kucheria

Yong,

No. The work that you're doing is long-term. It will take time for platforms
to move to the common struct clk - almost unlikely for the next Linaro release.

In the short-term, we still need all partner platforms to expose this debug information for our tools in a consistent way - OMAP already does it this way. So we want this patch applied to the Samsung platform after review and
similar ones for other SoC kernels.

/Amit

Quoted 3 lines · Yong Shen

Hi Amit,

We are trying to make this clock debug interface generic, so every

platform

Quoted 1 line

can benefit from it. Maybe it is better to wait for a while until the

common

Quoted 11 lines

interface comes out.

Yong

Quoted 5 lines · On Tue, Nov 16, 2010 at 6:54 PM, <[email protected]> wrote:

From: Amit Daniel Kachhap <[email protected]>

This patch adds support for clock information exposed to debug-fs interface.

Quoted 8 lines

Review

Quoted 8 lines
---
 arch/arm/plat-samsung/clock.c              |   92
++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/plat-samsung/clock.c

Quoted 9 lines
Quoted 8 lines

arch/arm/plat-samsung/clock.c line 42

Quoted 8 lines

index e8d20b0..0ba209d 100644

arch/arm/plat-samsung/clock.c +1 -0
@@ -39,6 +39,7 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>

Also enclose this head in macro CONFIG_DEBUG_FS
And you may also want to use CONFIG_PM_DEBUG combined with CONFIG_DEBUG_FS, and this may apply to below cases.

Quoted 111 lines
Quoted 4 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned

Quoted 4 lines
arch/arm/plat-samsung/clock.c +0 -0
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned

long

Quoted 31 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 451

Quoted 5 lines
arch/arm/plat-samsung/clock.c +1 -0
 xtal)
       return 0;
 }
 
+#if defined(CONFIG_DEBUG_FS)

+/*

Quoted 24 lines

+ * debugfs support to trace clock tree hierarchy and attributes
+ */

arch/arm/plat-samsung/clock.c +22 -0
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+       int err;
+       struct dentry *d, *child, *child_tmp;
+       struct clk *pa = c->parent;
+       char s[255];
+       char *p = s;
+
+       p += sprintf(p, "%s", c->name);
+#ifdef CONFIG_PLAT_SAMSUNG
+       /*Append id field with name also*/
+       if (c->id >= 0)
+               p += sprintf(p, ":%d", c->id);
+#endif
+
+       d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+       if (!d)
+               return -ENOMEM;
+
+       c->dent = d;
Quoted 8 lines

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 8 lines
arch/arm/plat-samsung/clock.c +2 -0
+
+       d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

arch/arm/plat-samsung/clock.c +5 -0
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32

*)&c->rate);

Quoted 66 lines
Quoted 66 lines
arch/arm/plat-samsung/clock.c +9 -0
+       if (!d) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+       return 0;
+
+err_out:
+       d = c->dent;
+       list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

arch/arm/plat-samsung/clock.c +49 -0
+               debugfs_remove(child);
+       debugfs_remove(c->dent);
+       return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+       int err;
+       struct clk *pa = c->parent;
+
+       if (pa && !pa->dent) {
+               err = clk_debugfs_register(pa);
+               if (err)
+                       return err;
+       }
+
+       if (!c->dent) {
+               err = clk_debugfs_register_one(c);
+               if (err)
+                       return err;
+       }
+       return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+       struct clk *c;
+       struct dentry *d;
+       int err;
+
+       d = debugfs_create_dir("clock", NULL);
+       if (!d)
+               return -ENOMEM;
+       clk_debugfs_root = d;
+
+       list_for_each_entry(c, &clocks, list) {
+               err = clk_debugfs_register(c);
+               if (err)
+                       goto err_out;
+       }
+       return 0;
+err_out:
+       debugfs_remove_recursive(clk_debugfs_root);
+       return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat-samsung/include/plat/clock.h +0 -0
index 0fbcd0e..f6180ab 100644
@@ -47,6 +47,9 @@ struct clk {
 
Quoted 25 lines
Quoted 4 lines

arch/arm/plat-samsung/include/plat/clock.h struct clk {

Quoted 4 lines
arch/arm/plat-samsung/include/plat/clock.h +2 -0
       struct clk_ops          *ops;
       int                 (*enable)(struct clk *, int enable);
+#if defined(CONFIG_DEBUG_FS)
+       struct dentry           *dent;  /* For visible tree hierarchy

*/

Quoted 18 lines
Quoted 8 lines
arch/arm/plat-samsung/include/plat/clock.h +1 -1
+#endif
 };
 
 /* other clocks which may be registered by board support */
--

1.6.0.6

Quoted 5 lines

_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101117/97eb604c/attachment-0001.html>

#4 lore raw

PATCH 1/1 ARM: SAMSUNG: Add support for clock debugging through debug-fs interface

In reply to amit.daniel at samsung.com
Quoted 1 line · amit.daniel at samsung.com

Maybe missed set name in your e-mail client.

Quoted 5 lines

From: Amit Daniel Kachhap <[email protected]>

This patch adds support for clock information exposed to debug-fs interface.

Quoted 7 lines
---
 arch/arm/plat-samsung/clock.c              |   92
++++++++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 95 insertions(+), 0 deletions(-)

Please add Ben Dooks in Cc next time.

Quoted 13 lines
arch/arm/plat-samsung/clock.c +1 -0
index e8d20b0..0ba209d 100644
@@ -39,6 +39,7 @@
 #include <linux/clk.h>
 #include <linux/spinlock.h>
 #include <linux/io.h>
+#include <linux/debugfs.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long · line 454

Quoted 8 lines
arch/arm/plat-samsung/clock.c +4 -0
@@ -447,3 +448,94 @@ int __init s3c24xx_register_baseclocks(unsigned long
 xtal)
 	return 0;
 }
 
+#if defined(CONFIG_DEBUG_FS)
+/*
+ *	debugfs support to trace clock tree hierarchy and attributes
+ */

One line comment format/style is "/* ... */"

Quoted 5 lines
arch/arm/plat-samsung/clock.c +5 -0
+static struct dentry *clk_debugfs_root;
+
+static int clk_debugfs_register_one(struct clk *c)
+{
+	int err;

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 469

Quoted 10 lines
arch/arm/plat-samsung/clock.c +10 -0
+	struct dentry *d, *child, *child_tmp;
+	struct clk *pa = c->parent;
+	char s[255];
+	char *p = s;
+
+	p += sprintf(p, "%s", c->name);
+#ifdef CONFIG_PLAT_SAMSUNG
+	/*Append id field with name also*/
+	if (c->id >= 0)
+		p += sprintf(p, ":%d", c->id);

Not more used p...so just sprint(p,...);

Quoted 1 line

+#endif

Actually this file(plat-samsung/clock.c) already depends on CONFIG_PLAT_SAMSUNG.

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 8 lines
arch/arm/plat-samsung/clock.c +8 -0
+
+	d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
+	if (!d)
+		return -ENOMEM;
+
+	c->dent = d;
+
+	d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8

*)&c->usage);

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal) · line 489

Quoted 11 lines
arch/arm/plat-samsung/clock.c +11 -0
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
+	if (!d) {
+		err = -ENOMEM;
+		goto err_out;
+	}
+	return 0;
+

Could you please show demo sample on board?

arch/arm/plat-samsung/clock.c int __init s3c24xx_register_baseclocks(unsigned long xtal)

Quoted 3 lines
arch/arm/plat-samsung/clock.c +3 -0
+err_out:
+	d = c->dent;
+	list_for_each_entry_safe(child, child_tmp, &d->d_subdirs,

d_u.d_child)

Quoted 55 lines
arch/arm/plat-samsung/clock.c +49 -0
+		debugfs_remove(child);
+	debugfs_remove(c->dent);
+	return err;
+}
+
+static int clk_debugfs_register(struct clk *c)
+{
+	int err;
+	struct clk *pa = c->parent;
+
+	if (pa && !pa->dent) {
+		err = clk_debugfs_register(pa);
+		if (err)
+			return err;
+	}
+
+	if (!c->dent) {
+		err = clk_debugfs_register_one(c);
+		if (err)
+			return err;
+	}
+	return 0;
+}
+
+static int __init clk_debugfs_init(void)
+{
+	struct clk *c;
+	struct dentry *d;
+	int err;
+
+	d = debugfs_create_dir("clock", NULL);
+	if (!d)
+		return -ENOMEM;
+	clk_debugfs_root = d;
+
+	list_for_each_entry(c, &clocks, list) {
+		err = clk_debugfs_register(c);
+		if (err)
+			goto err_out;
+	}
+	return 0;
+err_out:
+	debugfs_remove_recursive(clk_debugfs_root);
+	return err;
+}
+late_initcall(clk_debugfs_init);
+
+#endif /* defined(CONFIG_DEBUG_FS) */
+
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/clock.h +0 -0

samsung/include/plat/clock.h
index 0fbcd0e..f6180ab 100644

arch/arm/plat-samsung/include/plat/clock.h struct clk {

Quoted 10 lines
arch/arm/plat-samsung/include/plat/clock.h +3 -1
@@ -47,6 +47,9 @@ struct clk {
 
 	struct clk_ops		*ops;
 	int		    (*enable)(struct clk *, int enable);
+#if defined(CONFIG_DEBUG_FS)
+	struct dentry		*dent;	/* For visible tree hierarchy */
+#endif
 };
 
 /* other clocks which may be registered by board support */
--

I think, you just copied this from omap.
Of course, there is small changes...

I mean, would be better, if you could add more useful debug-fs i/f for Samsung SoCs' clock.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.