From owner-freebsd-amd64@FreeBSD.ORG Tue Dec 18 10:00:01 2012 Return-Path: Delivered-To: freebsd-amd64@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB227A32 for ; Tue, 18 Dec 2012 10:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8673F8FC14 for ; Tue, 18 Dec 2012 10:00:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qBIA016C005187 for ; Tue, 18 Dec 2012 10:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qBIA010e005186; Tue, 18 Dec 2012 10:00:01 GMT (envelope-from gnats) Date: Tue, 18 Dec 2012 10:00:01 GMT Message-Id: <201212181000.qBIA010e005186@freefall.freebsd.org> To: freebsd-amd64@FreeBSD.org Cc: From: Andriy Gapon Subject: Re: amd64/174409: stopping during resume caused by io_apic.c change(r243764) X-Mailman-Approved-At: Tue, 18 Dec 2012 12:25:03 +0000 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Andriy Gapon List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2012 10:00:01 -0000 The following reply was made to PR amd64/174409; it has been noted by GNATS. From: Andriy Gapon To: KAHO Toshikazu Cc: bug-followup@FreeBSD.org Subject: Re: amd64/174409: stopping during resume caused by io_apic.c change(r243764) Date: Tue, 18 Dec 2012 11:55:09 +0200 on 18/12/2012 03:54 KAHO Toshikazu said the following: > Hello, and thanks for your work. > >> Could you please try the following patch? >> I suspect that it might not be sufficient, I am working on some >> additional changes. > > The patched kernel dosen't solve the problem. On waking up, > the machine hangs with LCD backlight on, but it shows nothing. > Power off is all that I can do. Each revision (r243764 or r227309) > of io_apic.c with the patch makes the machine hangs. The machine > can wake up with io_apic.c reverted to r227309 and without the patch. > I understand. Could you please try the following patch on top of the previous one (without reverting r227309, of course) ? --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -261,12 +261,17 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, #endif } + /* + * Re-program IO-APIC pins to their correct states before + * enabling Local APICs (which is done when CPUs are restarted). + */ + intr_resume(); + #ifdef SMP if (!CPU_EMPTY(&suspcpus)) restart_cpus(suspcpus); #endif mca_resume(); - intr_resume(); AcpiSetFirmwareWakingVector(0); } else { --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -287,11 +287,11 @@ intr_resume(void) atpic_reset(); #endif mtx_lock(&intr_table_lock); - lapic_setup(0); STAILQ_FOREACH(pic, &pics, pics) { if (pic->pic_resume != NULL) pic->pic_resume(pic); } + lapic_setup(0); mtx_unlock(&intr_table_lock); } I've put the combined patch here: http://people.freebsd.org/~avg/apic-resume.diff -- Andriy Gapon