]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
cpuquiet: Fix locking in driver_unregister
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Thu, 12 Dec 2013 23:25:53 +0000 (15:25 -0800)
committerSai Gurrappadi <sgurrappadi@nvidia.com>
Fri, 13 Dec 2013 16:01:02 +0000 (08:01 -0800)
cpuquiet_switch_governors needs to be protected with the cpuquiet_lock.

Change-Id: I948d1190a270b9e8b732eaad80a303560fe9f282
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/345013
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
drivers/cpuquiet/driver.c

index fb9912b86e5e6e622019196ce3cfefd9ac91ad21..097d2e36b79d8067bb9f1c6427d814600d51b2ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012 NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2013 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
@@ -197,10 +197,10 @@ void cpuquiet_unregister_driver(struct cpuquiet_driver *drv)
                return;
        }
 
-       /* stop current governor first */
-       cpuquiet_switch_governor(NULL);
-
        mutex_lock(&cpuquiet_lock);
+
+       /* Stop current governor first */
+       cpuquiet_switch_governor(NULL);
        cpuquiet_curr_driver = NULL;
 
        for_each_possible_cpu(cpu) {