cpufreq: interactive: Add Uevent Signal on Gov Start
Matt Wagner [Thu, 6 Sep 2012 18:46:13 +0000 (11:46 -0700)]
Sends kobject_uevent signal back to userspace to signal that
the cpufreq governor has been set to interactive

Bug 1039141

Change-Id: I699e9d5834a1874b36c675764c080112ccba0f9f
Signed-off-by: Matt Wagner <mwagner@nvidia.com>
Reviewed-on: http://git-master/r/131224
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>

drivers/cpufreq/cpufreq_interactive.c

index 20a9b6d..7821e41 100644 (file)
@@ -61,6 +61,7 @@ static spinlock_t up_cpumask_lock;
 static cpumask_t down_cpumask;
 static spinlock_t down_cpumask_lock;
 static struct mutex set_speed_lock;
+static struct kobject *interactive_kobj;
 
 /* Go to max speed when CPU load at or above this value. */
 #define DEFAULT_GO_MAXSPEED_LOAD 85
@@ -660,6 +661,10 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
 
                rc = sysfs_create_group(cpufreq_global_kobject,
                                &interactive_attr_group);
+               interactive_kobj = kobject_create_and_add(
+                                       "gov_interactive",
+                                       cpufreq_global_kobject);
+               kobject_uevent(interactive_kobj, KOBJ_ADD);
                if (rc)
                        return rc;
 
@@ -687,6 +692,8 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
 
                sysfs_remove_group(cpufreq_global_kobject,
                                &interactive_attr_group);
+               kobject_uevent(interactive_kobj, KOBJ_REMOVE);
+               kobject_put(interactive_kobj);
 
                break;