Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2011 00:54:18 +0900
From:      Taku YAMAMOTO <taku@tackymt.homeip.net>
To:        freebsd-acpi@FreeBSD.org
Subject:   Fw: Follow-up: (Missing) power states of an Atom N455-based netbook
Message-ID:  <20110725005418.4f9711fd.taku@tackymt.homeip.net>

next in thread | raw e-mail | index | archive | help
For those interested in the native Cx patch:
in short, I found that a call to ACPI_ENABLE_IRQS(); , right before return,
was missing in the C1 code path.


Begin forwarded message:

Date: Sun, 24 Jul 2011 18:02:19 +0900
From: Taku YAMAMOTO <taku@tackymt.homeip.net>
To: Jung-uk Kim <jkim@FreeBSD.org>
Cc: avg@FreeBSD.org
Subject: Follow-up: (Missing) power states of an Atom N455-based netbook


On Sat, 23 Jul 2011 04:25:13 +0900
Taku YAMAMOTO <taku@tackymt.homeip.net> wrote:

> I've managed to update my X60 to the r224243 and your acpi_cx_native2.diff
> still works nicely.

Actually it didn't generally, though it happened to work in a way I usually
use. Putting single kenv (like boot_single=YES) was enough to break.
And, I finally found a small but fatal bug.

We (assuming acpi_cx_native2.patch already applied) have the following code
in acpi_cpu_idle():

    if (cx_next->type == ACPI_STATE_C1) {
        AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock);
        acpi_cpu_idle_cx(cx_next, sc->cpu_cx_native);
        AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock);
        end_time = PM_USEC(acpi_TimerDelta(end_time, start_time));
        if (curthread->td_critnest == 0)
                end_time = min(end_time, 500000 / hz);
        sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + end_time) / 4;
        return;
    }

In this code, however, interrupts are left disabled after the return when we
are using MWAIT.
Inserting ACPI_ENABLE_IRQS(); before the return statement is the way to fix.

Hope this helps.

-- 
-|-__   YAMAMOTO, Taku
 | __ <     <taku@tackymt.homeip.net>

      - A chicken is an egg's way of producing more eggs. -


-- 
-|-__   山本 拓 / YAMAMOTO, Taku
 | __ <     <taku@tackymt.homeip.net>

      - A chicken is an egg's way of producing more eggs. -



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110725005418.4f9711fd.taku>