Permalink
Browse files

[PATCH] Set Intel CPUFreq driver (P-state passive mode) by default

  • Loading branch information...
xanmod committed Mar 18, 2017
1 parent bfae110 commit 48408a1af21f40c4a7bdcb50038de9e35b2eb3f6
Showing with 13 additions and 6 deletions.
  1. +13 −6 drivers/cpufreq/intel_pstate.c
@@ -4,6 +4,9 @@
* (C) Copyright 2012 Intel Corporation
* Author: Dirk Brandewie <dirk.j.brandewie@intel.com>
*
+ * Default Passive mode patch by Alexandre Frade
+ * (C) 2017 XanMod Kernel <kernel@xanmod.org>
+ *
* 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 the Free Software Foundation; version 2
@@ -2297,7 +2300,7 @@ static struct cpufreq_driver intel_cpufreq = {
.name = "intel_cpufreq",
};
-static struct cpufreq_driver *intel_pstate_driver = &intel_pstate;
+static struct cpufreq_driver *intel_pstate_driver = &intel_cpufreq;
static int no_load __initdata;
static int no_hwp __initdata;
@@ -2520,8 +2523,13 @@ static int __init intel_pstate_init(void)
if (intel_pstate_platform_pwr_mgmt_exists())
return -ENODEV;
- pr_info("Intel P-state driver initializing\n");
+ pr_info("Intel P-State driver initializing\n");
+ if (intel_pstate_driver == &intel_cpufreq) {
+ no_hwp = 1;
+ pr_info("Passive mode enabled\n");
+ }
+
all_cpu_data = vzalloc(sizeof(void *) * num_possible_cpus());
if (!all_cpu_data)
return -ENOMEM;
@@ -2569,10 +2577,9 @@ static int __init intel_pstate_setup(char *str)
if (!strcmp(str, "disable")) {
no_load = 1;
- } else if (!strcmp(str, "passive")) {
- pr_info("Passive mode enabled\n");
- intel_pstate_driver = &intel_cpufreq;
- no_hwp = 1;
+ } else if (!strcmp(str, "enable")) {
+ pr_info("Native mode enabled\n");
+ intel_pstate_driver = &intel_pstate;
}
if (!strcmp(str, "no_hwp")) {
pr_info("HWP disabled\n");

0 comments on commit 48408a1

Please sign in to comment.