http://defect.opensolaris.org/bz/show_bug.cgi?id=6577


Bill Holler <bill.holler at sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |CAUSEKNOWN




--- Comment #1 from Bill Holler <bill.holler at sun.com>  2009-02-11 17:28:49 
---
Inside the spin loop before switching from LAPIC Timer to HPET Timer
the check for un-initialized LAPIC Timer was lumped together with
the check for "Deep C-states currently unsupported".  These two 
conditions should return different results, but did not.

Also adding hpet_proxy_lock protection of the uni_ctate "state".


bash-3.2$ hg pdiff hpet_acpi.c 
Enter passphrase for key '/home/bholler/.ssh/id_dsa': 
diff -r 707a918d0774 usr/src/uts/i86pc/io/hpet_acpi.c
--- a/usr/src/uts/i86pc/io/hpet_acpi.c  Wed Feb 11 16:08:22 2009 -0800
+++ b/usr/src/uts/i86pc/io/hpet_acpi.c  Wed Feb 11 17:24:09 2009 -0800
@@ -932,10 +932,22 @@
 static void
 hpet_cst_callback(uint32_t code)
 {
+       ulong_t intr;
+
        switch (code) {
        case CST_EVENT_ONE_CSTATE:
+               intr = intr_clear();
+               while (!mutex_tryenter(&hpet_proxy_lock)) {
+                       /*
+                        * spin
+                        */
+                       intr_restore(intr);
+                       intr = intr_clear();
+               }
                hpet_state.uni_cstate = B_TRUE;
                hpet_expire_all();
+               mutex_exit(&hpet_proxy_lock);
+               intr_restore(intr);
                break;

        case CST_EVENT_MULTIPLE_CSTATES:
@@ -1213,17 +1225,20 @@
                lapic_count = apic_timer_stop_count();
                now = gethrtime();
                *lapic_expire = expire = now + lapic_count;
-               if ((lapic_count == (hrtime_t)-1) ||
-                   (hpet_state.cpr == B_TRUE) ||
-                   (hpet_state.cpu_deep_idle == B_FALSE) ||
-                   (hpet_state.proxy_installed == B_FALSE) ||
-                   (hpet_state.uni_cstate == B_TRUE)) {
+               if (lapic_count == (hrtime_t)-1) {
                        /*
                         * LAPIC timer is currently disabled.
                         * Will not use the HPET as a LAPIC Timer proxy.
                         */
                        *lapic_expire = (hrtime_t)HPET_INFINITY;
                        return (B_TRUE);
+               }
+               if ((hpet_state.cpr == B_TRUE) ||
+                   (hpet_state.cpu_deep_idle == B_FALSE) ||
+                   (hpet_state.proxy_installed == B_FALSE) ||
+                   (hpet_state.uni_cstate == B_TRUE)) {
+                       *lapic_expire = (hrtime_t)HPET_INFINITY;
+                       return (B_FALSE);
                }
        }

-- 
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Reply via email to