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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ACCEPTED                    |FIXINPROGRESS




--- Comment #4 from Bill Holler <bill.holler at sun.com>  2008-12-02 18:22:46 
---
(In reply to comment #2)
> Can we just setup HPET interrupt in the early boot but enable it later when
> detecting c-state is supported?


Yes.  The current implementation sets up the HPET's interrupt early in
boot, but the HPET's timer is not enabled to generate interrupts until
later when the cpudrv sets it up.

The behavior we are seeing now is as if the IOAPIC has the wrong
interrupt polarity.  It appears to be always asserting this interrupt.

The simplest fix is to setup the HPET's timer with the correct 
polarity (INTR_PO_ACTIVE_HIGH) early in boot.
This change fixes the bug in initial testing:


diff -r 76db9217a6b1 usr/src/uts/i86pc/io/hpet_acpi.c
--- a/usr/src/uts/i86pc/io/hpet_acpi.c  Mon Nov 17 10:19:27 2008 -0800
+++ b/usr/src/uts/i86pc/io/hpet_acpi.c  Tue Dec 02 18:16:30 2008 -0800
@@ -463,15 +463,24 @@
                return (DDI_FAILURE);
        }

+       hpet_init_proxys();
+
        if (hpet_install_interrupt_handler(&hpet_isr,
            hpet_info.cstate_timer.intr) != AE_OK) {
                cmn_err(CE_WARN, "!hpet_acpi: install interrupt failed.");
                return (DDI_FAILURE);
        }
+
        *hpet_vect = hpet_info.cstate_timer.intr;
        hpet_flags->intr_el = INTR_EL_LEVEL;
        hpet_flags->intr_po = INTR_PO_ACTIVE_HIGH;
        hpet_flags->bustype = BUS_PCI;          /*  we *do* conform to PCI */
+
+       if (hpet_timer_setup(&hpet_info, hpet_info.cstate_timer.timer,
+           hpet_info.cstate_timer.intr)) {
+               cmn_err(CE_WARN, "!hpet_acpi: timer setup failed.");
+               return (DDI_FAILURE);
+       }

        /*
         * All HPET functionality is supported.
@@ -496,17 +505,8 @@
                hpet_info.gethrtime[i] = gethrtime();
        }

-       if (hpet_timer_setup(&hpet_info, hpet_info.cstate_timer.timer,
-           hpet_info.cstate_timer.intr)) {
-               hpet_init_proxys();
-               hpet_enable_timer(&hpet_info, hpet_info.cstate_timer.timer);
-               hpet_state.proxy_installed = B_TRUE;
-       } else {
-               cmn_err(CE_WARN, "!hpet_acpi: timer setup failed.");
-               hpet.supported = HPET_TIMER_SUPPORT;
-               hpet_uninstall_interrupt_handler();
-               return (B_FALSE);
-       }
+       hpet_enable_timer(&hpet_info, hpet_info.cstate_timer.timer);
+       hpet_state.proxy_installed = B_TRUE;

        return (B_TRUE);

-- 
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