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
/*
- * 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
{
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();