]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
drivers: cpuquiet: Fix hotplug stats
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Thu, 6 Nov 2014 21:23:44 +0000 (13:23 -0800)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Tue, 11 Nov 2014 22:00:30 +0000 (14:00 -0800)
/d/hotplug/stats now works with manual and auto-hotplug. Removed the
false depedency on cpuquiet driver-enable so that stats are reported
correctly all the time. Also corrected the format of the output by
adding a missing newline.

Also changed the naming of the stats node to /d/tegra_hotplug/stats to
stay consistent with prior chips.

Bug 1572364

Change-Id: Icdf1881927736cba9dd0a439f1aaf6d4cc0adb73
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/595036
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
drivers/cpuquiet/cpuquiet-smp-hotplug.c

index 2773aa98dff372340aec2af746d8acc76f4aced1..e4ec5287157980fa4bd2e09dd4092650516f87e5 100644 (file)
@@ -423,24 +423,21 @@ static int hp_stats_show(struct seq_file *s, void *data)
        int i;
        u64 cur_jiffies = get_jiffies_64();
 
-       mutex_lock(&cpuquiet_lock);
-
        mutex_lock(&cpq_lock_stats);
 
-       if (cpq_state != CPQ_DISABLED) {
-               for (i = 0; i < ARRAY_SIZE(hp_stats); i++) {
-                       bool was_up = (hp_stats[i].up_down_count & 0x1);
-                       __hp_stats_update(i, was_up);
-               }
+       for (i = 0; i < ARRAY_SIZE(hp_stats); i++) {
+               bool was_up = (hp_stats[i].up_down_count & 0x1);
+               __hp_stats_update(i, was_up);
        }
-       mutex_unlock(&cpq_lock_stats);
 
-       mutex_unlock(&cpuquiet_lock);
+       mutex_unlock(&cpq_lock_stats);
 
        seq_printf(s, "%-15s ", "cpu:");
        for (i = 0; i < ARRAY_SIZE(hp_stats); i++)
                seq_printf(s, "%-9d ", i);
 
+       seq_puts(s, "\n");
+
        seq_printf(s, "%-15s ", "transitions:");
        for (i = 0; i < ARRAY_SIZE(hp_stats); i++)
                seq_printf(s, "%-10u ", hp_stats[i].up_down_count);
@@ -477,7 +474,7 @@ static const struct file_operations hp_stats_fops = {
 static int __init cpuquiet_debug_init(void)
 {
 
-       hp_debugfs_root = debugfs_create_dir("hotplug", NULL);
+       hp_debugfs_root = debugfs_create_dir("tegra_hotplug", NULL);
        if (!hp_debugfs_root)
                return -ENOMEM;