cpufreq (4/7): updated cpufreq ref-counting and locking scheme
PATCH 1/1 cpufreq (4/7): updated cpufreq ref-counting and locking scheme
----- Forwarded message from Dominik Brodowski <[email protected]> -----
From: Dominik Brodowski <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH] cpufreq (4/7): updated cpufreq ref-counting and locking scheme
Date: Fri, 7 Mar 2003 11:09:10 +0100
Hi Linus,
This patch takes use of the now-working cpufreq_interface.kset and cpufreq_policy.kobj to use reference counting within the cpufreq core wherever this is more appropriate than the previous approach -- using one semaphore. Additionally, the callbacks to the driver modules are protected now.
Please apply,
Dominik
arch/i386/kernel/cpu/cpufreq/acpi.c | 1 arch/i386/kernel/cpu/cpufreq/elanfreq.c | 1 arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 1 arch/i386/kernel/cpu/cpufreq/longhaul.c | 1 arch/i386/kernel/cpu/cpufreq/longrun.c | 1 arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | 1 arch/i386/kernel/cpu/cpufreq/powernow-k6.c | 1 arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 1 arch/i386/kernel/cpu/cpufreq/speedstep.c | 1 arch/sparc64/kernel/us3_cpufreq.c | 1 drivers/cpufreq/userspace.c | 2 include/linux/cpufreq.h | 10 kernel/cpufreq.c | 357 ++++++++++++++++------------- 13 files changed, 216 insertions(+), 163 deletions(-)
arch/i386/kernel/cpu/cpufreq/acpi.c +1 -0
@@ -619,6 +619,7 @@ .init = acpi_cpufreq_cpu_init, .exit = acpi_cpufreq_cpu_exit, .name = "acpi-cpufreq", + .owner = THIS_MODULE, };
arch/i386/kernel/cpu/cpufreq/elanfreq.c +1 -0
@@ -250,6 +250,7 @@ .target = elanfreq_target, .init = elanfreq_cpu_init, .name = "elanfreq", + .owner = THIS_MODULE, };
arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +1 -0
@@ -451,6 +451,7 @@ .target = cpufreq_gx_target, .init = cpufreq_gx_cpu_init, .name = "gx-suspmod", + .owner = THIS_MODULE, };static int __init cpufreq_gx_init (void )
arch/i386/kernel/cpu/cpufreq/longhaul.c +1 -0
@@ -649,6 +649,7 @@ .target = longhaul_target, .init = longhaul_cpu_init, .name = "longhaul", + .owner = THIS_MODULE, };static int __init longhaul_init (void )
arch/i386/kernel/cpu/cpufreq/longrun.c +1 -0
@@ -253,6 +253,7 @@ .setpolicy = longrun_set_policy, .init = longrun_cpu_init, .name = "longrun", + .owner = THIS_MODULE, };
arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +1 -0
@@ -236,6 +236,7 @@ .init = cpufreq_p4_cpu_init, .exit = cpufreq_p4_cpu_exit, .name = "p4-clockmod", + .owner = THIS_MODULE, };
arch/i386/kernel/cpu/cpufreq/powernow-k6.c +1 -0
@@ -190,6 +190,7 @@ .init = powernow_k6_cpu_init, .exit = powernow_k6_cpu_exit, .name = "powernow-k6", + .owner = THIS_MODULE, };
arch/i386/kernel/cpu/cpufreq/powernow-k7.c +1 -0
@@ -377,6 +377,7 @@ .target = powernow_target, .init = powernow_cpu_init, .name = "powernow-k7", + .owner = THIS_MODULE, };static int __init powernow_init (void )
arch/i386/kernel/cpu/cpufreq/speedstep.c +1 -0
@@ -658,6 +658,7 @@ .verify = speedstep_verify, .target = speedstep_target, .init = speedstep_cpu_init, + .owner = THIS_MODULE, };
arch/sparc64/kernel/us3_cpufreq.c +1 -0
@@ -276,6 +276,7 @@ driver->target = us3freq_target; driver->init = us3freq_cpu_init; driver->exit = us3freq_cpu_exit; + driver->owner =THIS_MODULE ,strcpy (driver->name,"UltraSPARC-III" ); cpufreq_us3_driver = driver;
drivers/cpufreq/userspace.c +1 -1
@@ -113,7 +113,7 @@if (freq > cpu_max_freq[cpu]) freq = cpu_max_freq[cpu]; - ret =cpufreq_driver_target_l (¤t_policy[cpu], freq, + ret =cpufreq_driver_target (¤t_policy[cpu], freq,CPUFREQ_RELATION_L ); err:
include/linux/cpufreq.h +4 -6
@@ -70,6 +70,8 @@struct cpufreq_cpuinfo cpuinfo;/* see above */ struct device * dev;struct kobject kobj; +struct semaphore lock;/* CPU ->setpolicy or ->target may +only be called once a time */ };#define CPUFREQ_ADJUST (0)
@@ -132,18 +134,13 @@ };/* pass a target to the cpufreq driver -* _l : (cpufreq_driver_sem is not held) */ inline int cpufreq_driver_target (struct cpufreq_policy *policy,unsigned int target_freq,unsigned int relation); -inline int cpufreq_driver_target_l (struct cpufreq_policy *policy, -unsigned int target_freq, -unsigned int relation); -/* pass an event to the cpufreq governor */ -int cpufreq_governor_l (unsigned int cpu,unsigned int event); +int cpufreq_governor (unsigned int cpu,unsigned int event);int cpufreq_register_governor (struct cpufreq_governor *governor);void cpufreq_unregister_governor (struct cpufreq_governor *governor);
@@ -165,6 +162,7 @@int (*target) (struct cpufreq_policy *policy,unsigned int target_freq,unsigned int relation); +struct module *owner;/* optional, for the moment */ int (*init) (struct cpufreq_policy *policy);int (*exit) (struct cpufreq_policy *policy);
kernel/cpufreq.c +201 -156
690 lines not on this page · raw message
_______________________________________________
Cpufreq mailing list
[email protected]
http://www.linux.org.uk/mailman/listinfo/cpufreq
----- End forwarded message -----
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html