Source-Changes-HG archive

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

[src/trunk]: src Do not use xcall(9) in cpufreq_register(9), as it requires k...



details:   https://anonhg.NetBSD.org/src/rev/049cee824f48
branches:  trunk
changeset: 770524:049cee824f48
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu Oct 20 06:48:24 2011 +0000

description:
Do not use xcall(9) in cpufreq_register(9), as it requires kthreads to be
running and may impose hacks like config_interrupts(9) in the backend.

diffstat:

 share/man/man9/cpufreq.9 |  7 ++++---
 sys/kern/subr_cpufreq.c  |  8 +++-----
 2 files changed, 7 insertions(+), 8 deletions(-)

diffs (71 lines):

diff -r d0270b83c625 -r 049cee824f48 share/man/man9/cpufreq.9
--- a/share/man/man9/cpufreq.9  Thu Oct 20 03:05:14 2011 +0000
+++ b/share/man/man9/cpufreq.9  Thu Oct 20 06:48:24 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: cpufreq.9,v 1.4 2011/09/30 04:21:17 jruoho Exp $ */
+.\" $NetBSD: cpufreq.9,v 1.5 2011/10/20 06:48:24 jruoho Exp $ */
 .\"
 .\" Copyright (c) 2011 Jukka Ruohonen <jruohonen.iki.fi>
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 30, 2011
+.Dd October 20, 2011
 .Dt CPUFREQ 9
 .Os
 .Sh NAME
@@ -115,7 +115,7 @@
 Only one backend can be registered.
 Upon successful completion,
 .Fn cpufreq_register
-returns 0 and sets the frequency to the maximum available level.
+returns 0.
 .Pp
 The following elements in
 .Vt struct cpufreq
@@ -277,6 +277,7 @@
 This, and the use of
 .Xr xcall 9 ,
 implies that no memory can be allocated in the backend during the calls.
+Nor should the functions be called from interrupt context.
 .Sh CODE REFERENCES
 The
 .Nm
diff -r d0270b83c625 -r 049cee824f48 sys/kern/subr_cpufreq.c
--- a/sys/kern/subr_cpufreq.c   Thu Oct 20 03:05:14 2011 +0000
+++ b/sys/kern/subr_cpufreq.c   Thu Oct 20 06:48:24 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_cpufreq.c,v 1.4 2011/09/30 04:10:54 jruoho Exp $ */
+/*     $NetBSD: subr_cpufreq.c,v 1.5 2011/10/20 06:48:24 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_cpufreq.c,v 1.4 2011/09/30 04:10:54 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cpufreq.c,v 1.5 2011/10/20 06:48:24 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -62,7 +62,7 @@
 int
 cpufreq_register(struct cpufreq *cf)
 {
-       uint32_t c, i, j, k, m;
+       uint32_t c, i, j, k;
        int rv;
 
        KASSERT(cf != NULL);
@@ -138,8 +138,6 @@
                return rv;
        }
 
-       m = cpufreq_get_max();
-       cpufreq_set_all_raw(m);
        mutex_exit(&cpufreq_lock);
 
        return 0;



Home | Main Index | Thread Index | Old Index