Module Name: src Committed By: jruoho Date: Fri Aug 27 03:05:26 UTC 2010
Modified Files: src/share/man/man4: acpicpu.4 src/sys/dev/acpi: acpi_cpu.c acpi_cpu.h Log Message: Fix PR kern/43765 from Scott Ellis. Note that the solution is not optimal. If ichlpcib(4) provides SpeedStep support, possible I/O resource conflicts may occur with acpicpu(4). Ideally, as noted for instance in Windows design documents, ichlpcib(4) should never expose SpeedStep when ACPI is being used. The probability for potential race conditions is however very small, being limited to few P4-era machines and being dependent on user actions. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/share/man/man4/acpicpu.4 cvs rdiff -u -r1.21 -r1.22 src/sys/dev/acpi/acpi_cpu.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/acpi/acpi_cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man4/acpicpu.4 diff -u src/share/man/man4/acpicpu.4:1.15 src/share/man/man4/acpicpu.4:1.16 --- src/share/man/man4/acpicpu.4:1.15 Tue Aug 24 07:27:59 2010 +++ src/share/man/man4/acpicpu.4 Fri Aug 27 03:05:26 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: acpicpu.4,v 1.15 2010/08/24 07:27:59 jruoho Exp $ +.\" $NetBSD: acpicpu.4,v 1.16 2010/08/27 03:05:26 jruoho Exp $ .\" .\" Coyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi> .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 24, 2010 +.Dd August 27, 2010 .Dt ACPICPU 4 .Os .Sh NAME @@ -284,13 +284,18 @@ driver conflicts with the following kernel configuration .Xr options 4 : .Dv ENHANCED_SPEEDSTEP , -.Dv INTEL_ONDEMAND_CLOCKMOD , -.Dv POWERNOW_K7 , +.Dv POWERNOW_K8 , and -.Dv POWERNOW_K8 . +.Dv INTEL_ONDEMAND_CLOCKMOD . These options must be disabled if .Nm is used. +Furthermore, in the unlikely case where both +.Nm +and +.Xr ichlpcib 4 +provides support for P-states, +either one but not both may be used. .Sh SEE ALSO .Xr acpi 4 , .Xr acpitz 4 , Index: src/sys/dev/acpi/acpi_cpu.c diff -u src/sys/dev/acpi/acpi_cpu.c:1.21 src/sys/dev/acpi/acpi_cpu.c:1.22 --- src/sys/dev/acpi/acpi_cpu.c:1.21 Fri Aug 27 02:44:05 2010 +++ src/sys/dev/acpi/acpi_cpu.c Fri Aug 27 03:05:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $ */ +/* $NetBSD: acpi_cpu.c,v 1.22 2010/08/27 03:05:26 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.21 2010/08/27 02:44:05 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.22 2010/08/27 03:05:26 jruoho Exp $"); #include <sys/param.h> #include <sys/cpu.h> @@ -115,9 +115,7 @@ sc->sc_dev = self; sc->sc_cold = true; - sc->sc_mapped = false; sc->sc_passive = false; - sc->sc_iot = aa->aa_iot; sc->sc_node = aa->aa_node; sc->sc_cpuid = acpicpu_id(sc->sc_object.ao_procid); @@ -141,20 +139,6 @@ mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE); - /* - * We should claim the bus space. However, we do this only - * to announce that the space is in use. As is noted in - * ichlpcib(4), we can continue our I/O without bus_space(9). - */ - if (sc->sc_object.ao_pblklen == 6 && sc->sc_object.ao_pblkaddr != 0) { - - rv = bus_space_map(sc->sc_iot, sc->sc_object.ao_pblkaddr, - sc->sc_object.ao_pblklen, 0, &sc->sc_ioh); - - if (rv == 0) - sc->sc_mapped = true; - } - acpicpu_cstate_attach(self); acpicpu_pstate_attach(self); acpicpu_tstate_attach(self); @@ -168,7 +152,6 @@ acpicpu_detach(device_t self, int flags) { struct acpicpu_softc *sc = device_private(self); - const bus_addr_t addr = sc->sc_object.ao_pblkaddr; static ONCE_DECL(once_detach); int rv = 0; @@ -198,9 +181,6 @@ if (rv != 0) return rv; - if (sc->sc_mapped != false) - bus_space_unmap(sc->sc_iot, sc->sc_ioh, addr); - mutex_destroy(&sc->sc_mtx); return 0; Index: src/sys/dev/acpi/acpi_cpu.h diff -u src/sys/dev/acpi/acpi_cpu.h:1.24 src/sys/dev/acpi/acpi_cpu.h:1.25 --- src/sys/dev/acpi/acpi_cpu.h:1.24 Tue Aug 24 07:27:59 2010 +++ src/sys/dev/acpi/acpi_cpu.h Fri Aug 27 03:05:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu.h,v 1.24 2010/08/24 07:27:59 jruoho Exp $ */ +/* $NetBSD: acpi_cpu.h,v 1.25 2010/08/27 03:05:26 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruoho...@iki.fi> @@ -201,14 +201,10 @@ uint32_t sc_tstate_min; kmutex_t sc_mtx; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - uint32_t sc_cap; uint32_t sc_flags; cpuid_t sc_cpuid; bool sc_cold; - bool sc_mapped; bool sc_passive; };