]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: gk20a: Postpone mm init
authorTerje Bergstrom <tbergstrom@nvidia.com>
Mon, 3 Mar 2014 07:45:27 +0000 (09:45 +0200)
committerJuha Tukkinen <jtukkinen@nvidia.com>
Wed, 5 Mar 2014 13:07:00 +0000 (05:07 -0800)
Initialize mm only once first client attaches.

Change-Id: Ida770ea89fa4fc40d5167ca80a8c9e8d07dd55ad
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/376453
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shreshtha Sahu <ssahu@nvidia.com>
Tested-by: Shreshtha Sahu <ssahu@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
drivers/video/tegra/host/gk20a/gk20a.c

index 7c522146c6d0394db0d0369abc8d5fb1e59a083a..9295fd588515f499ae2b586223b5e015ce430daf 100644 (file)
@@ -677,14 +677,6 @@ static int gk20a_init_support(struct platform_device *dev)
        mutex_init(&g->dbg_sessions_lock);
        mutex_init(&g->client_lock);
 
-       /* gk20a_as alloc_share can be called before gk20a is powered on.
-          It requires mm sw states configured so init mm sw early here. */
-       err = gk20a_init_mm_setup_sw(g);
-       if (err)
-               goto fail;
-
-       /* other inits are deferred until gpu is powered up. */
-
        g->remove_support = gk20a_remove_support;
        return 0;
 
@@ -695,12 +687,19 @@ static int gk20a_init_support(struct platform_device *dev)
 
 static int gk20a_init_client(struct platform_device *dev)
 {
+       struct gk20a *g = get_gk20a(dev);
+       int err;
+
        nvhost_dbg_fn("");
 
 #ifndef CONFIG_PM_RUNTIME
        nvhost_gk20a_finalize_poweron(dev);
 #endif
 
+       err = gk20a_init_mm_setup_sw(g);
+       if (err)
+               return err;
+
        if (IS_ENABLED(CONFIG_GK20A_DEVFREQ))
                nvhost_gk20a_scale_hw_init(dev);
        return 0;