]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
UBUNTU: SAUCE: (no-up) Allow filtering of cpufreq drivers
authorTim Gardner <tim.gardner@canonical.com>
Tue, 24 Apr 2012 17:47:18 +0000 (11:47 -0600)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 2 Nov 2021 07:24:37 +0000 (08:24 +0100)
Harmless patch that allows k8 powernow machines to boot. Carry until
conflict.

BugLink: http://bugs.launchpad.net/bugs/984288
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Herton Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Documentation/admin-guide/kernel-parameters.txt
drivers/cpufreq/cpufreq.c

index 43dc35fe5bc038ee93bd32f0c7fe641038427bd1..5664f1c163d27f06ef60a82a736558a9b999a1c0 100644 (file)
                        0: default value, disable debugging
                        1: enable debugging at boot time
 
+       cpufreq_driver= [X86] Allow only the named cpu frequency scaling driver
+                       to register. Example: cpufreq_driver=powernow-k8
+                       Format: { none | STRING }
+
        cpuidle.off=1   [CPU_IDLE]
                        disable the cpuidle sub-system
 
index 5782b15a8caad06117ccbf7fd6f3fd5a93052ea3..f1d6ddd3f1fea48b4bc63fbff6a281f34a763f7f 100644 (file)
@@ -2749,6 +2749,20 @@ static int cpuhp_cpufreq_offline(unsigned int cpu)
        return 0;
 }
 
+static char cpufreq_driver_name[CPUFREQ_NAME_LEN];
+
+static int __init cpufreq_driver_setup(char *str)
+{
+       strlcpy(cpufreq_driver_name, str, CPUFREQ_NAME_LEN);
+       return 1;
+}
+
+/*
+ * Set this name to only allow one specific cpu freq driver, e.g.,
+ * cpufreq_driver=powernow-k8
+ */
+__setup("cpufreq_driver=", cpufreq_driver_setup);
+
 /**
  * cpufreq_register_driver - register a CPU Frequency driver
  * @driver_data: A struct cpufreq_driver containing the values#
@@ -2783,7 +2797,13 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
             (!driver_data->online != !driver_data->offline))
                return -EINVAL;
 
-       pr_debug("trying to register driver %s\n", driver_data->name);
+       pr_debug("trying to register driver %s, cpufreq_driver=%s\n",
+               driver_data->name, cpufreq_driver_name);
+
+       if (cpufreq_driver_name[0])
+               if (!driver_data->name ||
+                       strcmp(cpufreq_driver_name, driver_data->name))
+                               return -EINVAL;
 
        /* Protect against concurrent CPU online/offline. */
        cpus_read_lock();