Source-Changes-HG archive

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

[src/trunk]: src Fix PR kern/43765 from Scott Ellis.



details:   https://anonhg.NetBSD.org/src/rev/9f792e626719
branches:  trunk
changeset: 757372:9f792e626719
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Fri Aug 27 03:05:26 2010 +0000

description:
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.

diffstat:

 share/man/man4/acpicpu.4 |  15 ++++++++++-----
 sys/dev/acpi/acpi_cpu.c  |  24 ++----------------------
 sys/dev/acpi/acpi_cpu.h  |   6 +-----
 3 files changed, 13 insertions(+), 32 deletions(-)

diffs (131 lines):

diff -r efd436b4b8d3 -r 9f792e626719 share/man/man4/acpicpu.4
--- a/share/man/man4/acpicpu.4  Fri Aug 27 02:44:05 2010 +0000
+++ b/share/man/man4/acpicpu.4  Fri Aug 27 03:05:26 2010 +0000
@@ -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 <jruohonen%iki.fi@localhost>
 .\" 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 ,
diff -r efd436b4b8d3 -r 9f792e626719 sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c   Fri Aug 27 02:44:05 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.c   Fri Aug 27 03:05:26 2010 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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;
diff -r efd436b4b8d3 -r 9f792e626719 sys/dev/acpi/acpi_cpu.h
--- a/sys/dev/acpi/acpi_cpu.h   Fri Aug 27 02:44:05 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.h   Fri Aug 27 03:05:26 2010 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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;
 };
 



Home | Main Index | Thread Index | Old Index