ARM: tegra: cpuquiet: Notify the cpuquiet governor when the driver is busy
authorSai Charan Gurrappadi <sgurrappadi@nvidia.com>
Wed, 11 Jul 2012 00:33:58 +0000 (17:33 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 18 May 2015 08:07:07 +0000 (16:07 +0800)
Added generic busy/free notifiers that the driver can invoke to let the
governor know that it cannot process further core online/offline
requests (invoked in our case whenever we switch to the LP cluster).

Change-Id: I5e3f7f28f38806a7f87050e8d0c8d2f2cf7521aa
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/114807
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>
drivers/cpuquiet/governor.c
include/linux/cpuquiet.h

index 7895fccc7f42e9c04dac184acfd55dba97c888bb..176ba3bd705f7e6fd7e931dcc0c0c3c63ce6d706 100644 (file)
@@ -100,3 +100,17 @@ void cpuquiet_unregister_governor(struct cpuquiet_governor *gov)
        list_del(&gov->governor_list);
        mutex_unlock(&cpuquiet_lock);
 }
+
+void cpuquiet_device_busy(void)
+{
+       if (cpuquiet_curr_governor &&
+                       cpuquiet_curr_governor->device_busy_notification)
+               cpuquiet_curr_governor->device_busy_notification();
+}
+
+void cpuquiet_device_free(void)
+{
+       if (cpuquiet_curr_governor &&
+                       cpuquiet_curr_governor->device_free_notification)
+               cpuquiet_curr_governor->device_free_notification();
+}
index fe5a037277393b22302321768f77d02156c2e049..5558c015bb507030d0a196301f2b436a10ae52fd 100644 (file)
@@ -30,6 +30,8 @@ struct cpuquiet_governor {
        int (*start)            (void);
        void (*stop)            (void);
        int (*store_active)     (unsigned int cpu, bool active);
+       void (*device_free_notification) (void);
+       void (*device_busy_notification) (void);
        struct module           *owner;
 };
 
@@ -47,6 +49,8 @@ extern int cpuquiet_register_driver(struct cpuquiet_driver *drv);
 extern void cpuquiet_unregister_driver(struct cpuquiet_driver *drv);
 extern int cpuquiet_add_group(struct attribute_group *attrs);
 extern void cpuquiet_remove_group(struct attribute_group *attrs);
+extern void cpuquiet_device_busy(void);
+extern void cpuquiet_device_free(void);
 int cpuquiet_kobject_init(struct kobject *kobj, struct kobj_type *type,
                                char *name);
 extern unsigned int nr_cluster_ids;