HACK: lib/kobject_uevent.c: ignore thermal uevent when suspend
authorHuang, Tao <huangtao@rock-chips.com>
Fri, 26 Aug 2016 11:19:04 +0000 (19:19 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 26 Aug 2016 11:44:52 +0000 (19:44 +0800)
Android healthd try to listen power_supply subsystem uevent,
but which will block system from suspend on big.LITTLE system
because thermal_cooling_device_unregister will called when
cpufreq_exit. So ignore this uevent when suspend.

Change-Id: I35948498916560d5ec75fe561c9e9d588663ad22
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
lib/kobject_uevent.c

index f6c2c1e7779c9c93a11133a27c57081746f5fd2c..586f2f57fbfc359946d50c7098c621038ac99de0 100644 (file)
@@ -223,6 +223,21 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
                return 0;
        }
 
+       if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP) &&
+           IS_ENABLED(CONFIG_FREEZER) &&
+           IS_ENABLED(CONFIG_ANDROID)) {
+               /*
+                * Android healthd try to listen power_supply subsystem uevent,
+                * but which will block system from suspend on big.LITTLE system
+                * because thermal_cooling_device_unregister will called when
+                * cpufreq_exit. So ignore this uevent when suspend.
+                */
+               extern bool pm_freezing;
+
+               if (pm_freezing && !strcmp(subsystem, "thermal"))
+                       return 0;
+       }
+
        /* environment buffer */
        env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL);
        if (!env)