video: tegra: host: gk20a: Do not defer ELPG init
Naveen Kumar S [Fri, 21 Feb 2014 11:44:38 +0000 (16:44 +0530)]
Currently the second phase of PMU initialisation runs asynchronously
with other code. This optimises the boot-up time, however, it may
cause unexpected race in PMU code as some functions are called while
the ELPG is still being initialised.

This patch modifies the ELPG initialisation to happen synchronously
as part of power on sequence.

Bug 1456985
Bug 1460116
Bug 1458353

Change-Id: Ic979b3e054a17c0bc6979da2cf03d98f8d416c26
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Naveen Kumar S <nkumars@nvidia.com>
Reviewed-on: http://git-master/r/368702
(cherry picked from commit 4100add7d80ff68669cec4f8f47b26e232dc7da5)
Reviewed-on: http://git-master/r/372853
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/video/tegra/host/gk20a/gk20a.c

index 6351555..bfc80f5 100644 (file)
@@ -897,6 +897,12 @@ int nvhost_gk20a_finalize_poweron(struct platform_device *dev)
                goto done;
        }
 
+       err = gk20a_init_pmu_setup_hw2(g);
+       if (err) {
+               nvhost_err(&dev->dev, "failed to init gk20a pmu_hw2");
+               goto done;
+       }
+
        err = gk20a_init_therm_support(g);
        if (err) {
                nvhost_err(&dev->dev, "failed to init gk20a therm");
@@ -912,7 +918,6 @@ int nvhost_gk20a_finalize_poweron(struct platform_device *dev)
        gk20a_channel_resume(g);
        set_user_nice(current, nice_value);
 
-       schedule_work(&(g->pmu.pg_init));
 done:
        return err;
 }