Revert the revision 1.5 in cpufreq(9). Instead, document that the KPI can

not be used before interrupts have been enabled. Suggested by macallan@.
This commit is contained in:
jruoho 2011-10-27 05:25:07 +00:00
parent f630290057
commit 67fcddd627
3 changed files with 18 additions and 14 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: cpufreq.9,v 1.5 2011/10/20 06:48:24 jruoho Exp $ */
.\" $NetBSD: cpufreq.9,v 1.6 2011/10/27 05:25:08 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 October 20, 2011
.Dd October 27, 2011
.Dt CPUFREQ 9
.Os
.Sh NAME
@ -115,7 +115,11 @@ a machine-dependent backend with the framework.
Only one backend can be registered.
Upon successful completion,
.Fn cpufreq_register
returns 0.
returns 0 and sets the frequency of all processors
to the maximum available level.
Note that the registration can be done
only after interrupts have been enabled; cf.
.Xr config_interrupts 9 .
.Pp
The following elements in
.Vt struct cpufreq

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_cpu.c,v 1.46 2011/10/20 06:57:23 jruoho Exp $ */
/* $NetBSD: acpi_cpu.c,v 1.47 2011/10/27 05:25:07 jruoho Exp $ */
/*-
* Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen@iki.fi>
@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.46 2011/10/20 06:57:23 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.47 2011/10/27 05:25:07 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@ -327,12 +327,6 @@ acpicpu_start(device_t self)
if (cpufreq_register(&cf) != 0)
aprint_error_dev(self, "failed to register cpufreq\n");
else {
/*
* Initialize the states to P0.
*/
cpufreq_set_all(sc->sc_pstate[0].ps_freq);
}
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_cpufreq.c,v 1.7 2011/10/25 18:26:09 christos Exp $ */
/* $NetBSD: subr_cpufreq.c,v 1.8 2011/10/27 05:25:07 jruoho Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -30,11 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_cpufreq.c,v 1.7 2011/10/25 18:26:09 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_cpufreq.c,v 1.8 2011/10/27 05:25:07 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
#include <sys/cpufreq.h>
#include <sys/kernel.h>
#include <sys/kmem.h>
#include <sys/mutex.h>
#include <sys/time.h>
@ -62,9 +63,12 @@ cpufreq_init(void)
int
cpufreq_register(struct cpufreq *cf)
{
uint32_t c, i, j, k;
uint32_t c, i, j, k, m;
int rv;
if (cold != 0)
return EBUSY;
KASSERT(cf != NULL);
KASSERT(cf_backend != NULL);
KASSERT(cf->cf_get_freq != NULL);
@ -138,6 +142,8 @@ cpufreq_register(struct cpufreq *cf)
return rv;
}
m = cpufreq_get_max();
cpufreq_set_all_raw(m);
mutex_exit(&cpufreq_lock);
return 0;