]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
drivers: cpuquiet: Fix governor start/stop
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Thu, 29 May 2014 19:57:57 +0000 (12:57 -0700)
committerSai Gurrappadi <sgurrappadi@nvidia.com>
Thu, 29 May 2014 23:04:54 +0000 (16:04 -0700)
Don't start/stop the governor unnecessarily when switching to the same
governor.

Change-Id: Ia61a5b704de7e2e092d4b682bddf9523da5fa3c0
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/416749
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit

drivers/cpuquiet/governor.c

index 176ba3bd705f7e6fd7e931dcc0c0c3c63ce6d706..85b5158674edf92eafaf4ff89f35c691e5b742f6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2014 NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,6 +50,10 @@ int cpuquiet_switch_governor(struct cpuquiet_governor *gov)
 {
        int err = 0;
 
+       /* Governor is already set, bail early */
+       if (cpuquiet_curr_governor == gov)
+               return err;
+
        if (cpuquiet_curr_governor) {
                if (cpuquiet_curr_governor->stop)
                        cpuquiet_curr_governor->stop();