From owner-freebsd-acpi@FreeBSD.ORG Tue Dec 2 19:19:27 2008 Return-Path: Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C211065673; Tue, 2 Dec 2008 19:19:27 +0000 (UTC) (envelope-from nate@root.org) Received: from nlpi025.prodigy.net (nlpi025.sbcis.sbc.com [207.115.36.54]) by mx1.freebsd.org (Postfix) with ESMTP id 25CDF8FC1C; Tue, 2 Dec 2008 19:19:26 +0000 (UTC) (envelope-from nate@root.org) Received: from [10.0.5.18] (ppp-71-139-15-215.dsl.snfc21.pacbell.net [71.139.15.215]) (authenticated bits=0) by nlpi025.prodigy.net (8.13.8 smtpauth/dk/map_regex/8.13.8) with ESMTP id mB2JJOwW028282; Tue, 2 Dec 2008 13:19:25 -0600 Message-ID: <49358A3F.7020701@root.org> Date: Tue, 02 Dec 2008 11:19:27 -0800 From: Nate Lawson User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Alexander Motin References: <1224616985.00027652.1224606603@10.7.7.3> <1224728582.00028075.1224715806@10.7.7.3> <4932F34C.1040804@FreeBSD.org> <200812021243.08513.jkim@FreeBSD.org> <49358684.7010508@FreeBSD.org> In-Reply-To: <49358684.7010508@FreeBSD.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: peter@FreeBSD.org, freebsd-acpi@FreeBSD.org, freebsd-amd64@FreeBSD.org, Jung-uk Kim Subject: Re: Semi-working patch for amd64 suspend/resume X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 19:19:27 -0000 Alexander Motin wrote: > Hi. > > Jung-uk Kim wrote: >>> Here is problems I still have now: >>> - SMP kernel resume is not working, system reboots while doing >>> acpi_wakeup_cpus(); >> >> My dual-core CPU seems to resume okay but quite unstable. Can you try >> something like the following in amd64/mp_machdep.c and tell me if it >> helps? >> >> ------------ >> @@ -57,6 +57,7 @@ >> #include >> >> #include >> +#include >> #include >> #include >> #include >> @@ -1121,6 +1121,8 @@ >> int cpumask = PCPU_GET(cpumask); >> >> if (savectx2(&stopxpcbs[cpu])) { >> + /* Flush CPU cache. */ >> + wbinvd(); >> /* Indicate that we are suspended. */ >> atomic_set_int(&stopped_cpus, cpumask); >> } else { >> ------------ > > Wow, it works! > > I am writing this letter just after suspending/resuming my dual-core C2D > system 4 times straight. Music plays, USB, SATA, all other hardware > works fine. What kind of instability do you have? Thank you both for debugging this. It's good to see progress on suspend/resume. > The only strange effect I have noticed was incorrect CPU time some > processes got: > %ps ax > PID TT STAT TIME COMMAND > 12 ?? WL 280503:38,05 [intr] > 1430 ?? Ss 280503:38,34 icewm > > But I think it is more timer driver related then resume itself. If you are using the LAPIC timer (default), it won't be running properly during resume. However, this wide discrepancy seems to indicate that the timer state is not being resumed properly. What if you use the ACPI timer (hw.timecounter.* I think are the sysctls)? -- Nate