ARM: tegra: power: Cancel hotplug work upon disable
Antti P Miettinen [Fri, 6 Apr 2012 11:21:26 +0000 (14:21 +0300)]
Cancel hotplug work when auto hotplug gets disabled to prevent
e.g. cpu_up() getting called in LP cluster.

Bug 965777

Change-Id: I058fe6a5e0c2fd3203ce9bc951d0973b60e033e0
Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com>
Reviewed-on: http://git-master/r/95076
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

arch/arm/mach-tegra/cpu-tegra3.c

index 526e80b..4102b10 100644 (file)
@@ -147,9 +147,12 @@ static int hp_state_set(const char *arg, const struct kernel_param *kp)
 
        if (ret == 0) {
                if ((hp_state == TEGRA_HP_DISABLED) &&
-                   (old_state != TEGRA_HP_DISABLED))
+                   (old_state != TEGRA_HP_DISABLED)) {
+                       mutex_unlock(tegra3_cpu_lock);
+                       cancel_delayed_work_sync(&hotplug_work);
+                       mutex_lock(tegra3_cpu_lock);
                        pr_info("Tegra auto-hotplug disabled\n");
-               else if (hp_state != TEGRA_HP_DISABLED) {
+               } else if (hp_state != TEGRA_HP_DISABLED) {
                        if (old_state == TEGRA_HP_DISABLED) {
                                pr_info("Tegra auto-hotplug enabled\n");
                                hp_init_stats();