[PATCH 2/2] cpufreq: demand load governor modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Demand-load cpufreq governor modules if needed.

Signed-off-by: Jeremy Fitzhardinge <[email protected]>

---
drivers/cpufreq/cpufreq.c |   17 +++++++++++++++++
1 file changed, 17 insertions(+)


diff -r 4650553b3f11 drivers/cpufreq/cpufreq.c
--- a/drivers/cpufreq/cpufreq.c	Wed Jul 05 15:21:25 2006 -0700
+++ b/drivers/cpufreq/cpufreq.c	Wed Jul 05 15:25:52 2006 -0700
@@ -320,6 +320,23 @@ static int cpufreq_parse_governor (char mutex_lock(&cpufreq_governor_mutex);

		t = __find_governor(str_governor);
+
+		if (t == NULL) {
+			char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
+
+			if (name) {
+				int ret;
+
+				mutex_unlock(&cpufreq_governor_mutex);
+				ret = request_module(name);
+				mutex_lock(&cpufreq_governor_mutex);
+
+				if (ret == 0)
+					t = __find_governor(str_governor);
+			}
+
+			kfree(name);
+		}

		if (t != NULL) {
			*governor = t;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux