gpu: nvgpu: Init clock debugfs after clock support

Initialized GK20A clock debugfs after clock support
hardware and software are ready.

Bug 1450787

Change-Id: I8ec2ef303a84b9151b7ce209a1864f1729382a44
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/440973
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
This commit is contained in:
Alex Frid
2014-07-22 18:28:43 -07:00
committed by Dan Willemsen
parent 10571e9db7
commit b972f8d15e
4 changed files with 13 additions and 9 deletions

View File

@@ -42,6 +42,10 @@ struct pll_parms gpc_pll_params = {
1, 32, /* PL */
};
#ifdef CONFIG_DEBUG_FS
static int clk_gk20a_debugfs_init(struct gk20a *g);
#endif
static u8 pl_to_div[] = {
/* PL: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 */
/* p: */ 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 12, 16, 20, 24, 32 };
@@ -661,6 +665,12 @@ int gk20a_init_clk_support(struct gk20a *g)
if (err)
return err;
#ifdef CONFIG_DEBUG_FS
if (!clk->debugfs_set) {
if (!clk_gk20a_debugfs_init(g))
clk->debugfs_set = true;
}
#endif
return err;
}
@@ -800,11 +810,10 @@ static int monitor_get(void *data, u64 *val)
}
DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n");
int clk_gk20a_debugfs_init(struct platform_device *dev)
static int clk_gk20a_debugfs_init(struct gk20a *g)
{
struct dentry *d;
struct gk20a_platform *platform = platform_get_drvdata(dev);
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = platform_get_drvdata(g->dev);
d = debugfs_create_file(
"rate", S_IRUGO|S_IWUSR, platform->debugfs, g, &rate_fops);

View File

@@ -56,6 +56,7 @@ struct clk_gk20a {
struct mutex clk_mutex;
bool sw_ready;
bool clk_hw_on;
bool debugfs_set;
};
int gk20a_init_clk_support(struct gk20a *g);

View File

@@ -1502,8 +1502,6 @@ static int gk20a_probe(struct platform_device *dev)
gk20a_create_sysfs(dev);
#ifdef CONFIG_DEBUG_FS
clk_gk20a_debugfs_init(dev);
spin_lock_init(&gk20a->debugfs_lock);
gk20a->mm.ltc_enabled = true;
gk20a->mm.ltc_enabled_debug = true;

View File

@@ -591,10 +591,6 @@ static inline int support_gk20a_pmu(void){return 0;}
void gk20a_create_sysfs(struct platform_device *dev);
#ifdef CONFIG_DEBUG_FS
int clk_gk20a_debugfs_init(struct platform_device *dev);
#endif
#define GK20A_BAR0_IORESOURCE_MEM 0
#define GK20A_BAR1_IORESOURCE_MEM 1
#define GK20A_SIM_IORESOURCE_MEM 2