Revert "video: tegra: host: gk20a: Do not suspend if active"
Arto Merilainen [Mon, 25 Nov 2013 14:10:54 +0000 (16:10 +0200)]
This reverts commit 63078e87a62b265111622e58e66d9e67a2e1519b. The
original patch was added to protect kernel from applications that
injected jobs just after pm had suspended the device. This lead
the bookkeeping to get mixed as some callbacks were not called
correctly before the device was suspended.

We have now revisited the suspend sequences and identified that
we actually used to use some callbacks in a wrong way and the
original patch was simply a workaround to hide the issue. Now
that the issues are fixed, we can safely remove the hack.

Bug 1426717

Change-Id: I42d884bc21baad1a37001c354ef1a80e2eba140c
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/358575
(cherry picked from commit 12d0c2928fb62b4ba649dcd88b6fa0b057f1182c)
Reviewed-on: http://git-master/r/335100
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/364149
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jeetesh Burman <jburman@nvidia.com>
Tested-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

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

index 6a17914..6351555 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/spinlock.h>
 #include <linux/tegra-powergate.h>
 
-#include <linux/suspend.h>
 #include <linux/sched.h>
 #include <linux/input-cfboost.h>
 
@@ -975,18 +974,6 @@ static struct thermal_cooling_device_ops tegra_gpu_cooling_ops = {
        .set_cur_state = tegra_gpu_set_cur_state,
 };
 
-static int gk20a_suspend_notifier(struct notifier_block *notifier,
-                                 unsigned long pm_event, void *unused)
-{
-       struct gk20a *g = container_of(notifier, struct gk20a,
-                                      system_suspend_notifier);
-
-       if (pm_event == PM_USERSPACE_FROZEN)
-               return g->power_on ? NOTIFY_BAD : NOTIFY_OK;
-
-       return NOTIFY_DONE;
-}
-
 static int gk20a_create_device(
        struct platform_device *pdev, int devno, const char *cdev_name,
        struct cdev *cdev, struct device **out,
@@ -1147,12 +1134,6 @@ static int gk20a_probe(struct platform_device *dev)
                return err;
        }
 
-       if (platform->can_powergate) {
-               gk20a->system_suspend_notifier.notifier_call =
-                       gk20a_suspend_notifier;
-               register_pm_notifier(&gk20a->system_suspend_notifier);
-       }
-
        err = nvhost_as_init_device(dev);
        if (err) {
                nvhost_dbg_fn("failed to init client address space"
index c92072e..96e20d6 100644 (file)
@@ -106,7 +106,6 @@ struct gk20a {
 
        void (*remove_support)(struct platform_device *);
 
-       struct notifier_block system_suspend_notifier;
        u64 pg_ingating_time_us;
        u64 pg_ungating_time_us;
        u32 pg_gating_cnt;