From owner-freebsd-acpi@FreeBSD.ORG Sun Feb 26 22:00:25 2012 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 ECC58106566C for ; Sun, 26 Feb 2012 22:00:24 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0958FC12 for ; Sun, 26 Feb 2012 22:00:24 +0000 (UTC) Received: (qmail 22471 invoked from network); 26 Feb 2012 16:33:43 -0500 Received: from c-76-119-101-151.hsd1.ma.comcast.net (HELO ?192.168.1.6?) (76.119.101.151) by mail.atlantawebhost.com with SMTP; 26 Feb 2012 16:33:42 -0500 Message-ID: <4F4AA530.4030606@shadowsun.net> Date: Sun, 26 Feb 2012 16:33:36 -0500 From: Eric McCorkle User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.1) Gecko/20120215 Thunderbird/10.0.1 MIME-Version: 1.0 To: freebsd-acpi@FreeBSD.org X-Enigmail-Version: 1.3.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC7CDEC818CD110CE184C3295" Cc: Subject: Suspend/resume on Macbooks: partial diagnosis 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: Sun, 26 Feb 2012 22:00:25 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC7CDEC818CD110CE184C3295 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable A while ago, I tried to diagnose the reason why suspend/resume doesn't work on my macbook (9.0-STABLE, 13' unibody macbook pro, 5,5, I think).=20 I got a partial answer, but then got busy and never finished. The recent KDE update apparently triggers a suspend, so I had incentive to look at it again, and also to report my previous findings, in case someone else has information or can fix it. Here's what I have: The USB system sometimes fails to come back up, but this seems to be a more general issue not specific to the hardware. The firewire system would also sometimes trigger a kernel panic, but that was almost a year ago on 9-CURRENT, and firewire was causing other issues, so I disabled it and haven't used it since. The VGA system fails to come back up, reporting "vga0: failed to reload state". I traced this error using extra logging messages to the BIOS POST call, at which point the x86emu system emulates the bios. From looking at the error message, disassembly of the BIOS code, and the memory map I am almost certain I know why. I'd meant to confirm it 100%, but I got busy. The root problem seems to be bad BIOS code that accesses the stack one word above the region allocated by the BIOS memory map (the map allocates 0x1000-0x1fff, the code dereferences 0x2000, or something similar). This is *technically* an error, but it does not cause a problem during boot, because there is always good memory at that address. The BIOS emulation system, however, seems to only allocate the regions described by the memory map, and thus treats it as an error (as a strictly-conforming BIOS implementation would). A quick-and-dirty fix might be to add an extra page above the stack region. I'm not sure what a more "legitimate" fix might be, since it's the BIOS code and not FreeBSD that's causing the problem. I'll probably take a closer look in the near future. Hope this helps someone. --------------enigC7CDEC818CD110CE184C3295 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQIcBAEBAgAGBQJPSqUwAAoJENSCzbQ+koZ7PzAP/37fw/HoP/1YSFd5qovUqGNc WKJOPPk8JLxoKUn210PEk4BMHTakzv/39SSp7qWc88lifHmEJ0J/2b0GdefGaHHh qXkkFcdIk8imnmKjhCFRKX7HUojHO2ZmqEJYg1y5Qvr6CWsfyaKq0iis6Cd81Fd1 8j+aZXJvbiVg3Gkl/Vy1XMcdgogOC0nri234xQ/Vi54T87PRkocCcNh8p7ZipUP5 5kt9MKTWJX2xm93GqQ951FMDnUJo0E7Liq4IQXULK0t/F2YPfhu4ww7PPPzbCWDw 9bZgegH4kgpFMWcOQh89p1XhU+OksFwYBd1Ec+isnLO+QUwR5QUwo6cZ53jcq5Uv tTaZ7K7XCwtlABaKMcBLLHbu9YyJ8NRH/l+PJjZCmAinQvwyoYh3vt0gdPVfUh1h UuqV1JNJzOdtN6uAyiYRySRr0kPMxB/o1RaUvD2v5BFx/2oCz4f9zS0qs2FMfubo L6PbCByojFWO8eDS6TPP4L5D9mbrpmj7PDCwwpzUNywVysbF/xmErQP5PyQo19Gc 5eC1tvhPqRZMgKcrhdmQZvwKp4W4PslIUwvoUpYTpxZGSxLeD/EHMT+zk3vHNvnE zZOKuDsI8s4zoV2ynbCJxm8EICD8ZA4kAIiO9hOEQPkoUpAWFqYzhWGJyK0eBrPk I64p/cFq15hKNHVqOO/s =BxYH -----END PGP SIGNATURE----- --------------enigC7CDEC818CD110CE184C3295--