From owner-freebsd-mobile@FreeBSD.ORG Mon Oct 2 19:22:01 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D028716A416; Mon, 2 Oct 2006 19:22:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36B7843D53; Mon, 2 Oct 2006 19:21:58 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k92JLmp6018637; Mon, 2 Oct 2006 15:21:50 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andrea Bittau Date: Mon, 2 Oct 2006 14:24:18 -0400 User-Agent: KMail/1.9.1 References: <20060921000628.GA1832@shorty.sorbonet.org> In-Reply-To: <20060921000628.GA1832@shorty.sorbonet.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610021424.18562.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 02 Oct 2006 15:21:50 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1973/Mon Oct 2 11:18:33 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: hack for getting suspend/resume to half work on an IBM Thinkpad x60s [SMP] X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2006 19:22:01 -0000 On Wednesday 20 September 2006 20:06, Andrea Bittau wrote: > This is a half working hack for getting suspend/resume to "work" on an IBM > > ... > > 2) apic. FreeBSD reconfigures the io apic upon resume, but not the local apic. > The patch attached to this mail fixes this. Indeed, it almost does so in the > "proper" way and not so much of a hack =D. I actually have made a full patch for APIC I think (thanks for your work as it reminded me about needing to resume lapic). You can find it at http://www.FreeBSD.org/~jhb/patches/apic_resume.patch It changes the x86 interrupt code to resume interrupt controllers, not interrupt sources. It then uses this to make sure the 8259A PICs are properly reset on resume as well as resuming the local APIC. Can you test this w/o SMP and make sure it works? > 3) SMP. The second core needs to be killed and woken up as appropriate. The > way I do this is quite lame. > - Force the second core in the idle loop by setting machdep.hlt_cpus=2. > - make system look like UP instead of SMP [i.e. deactivate SMP] & suspend. > - resume, wake up other core [which will run idle process] and activate SMP. Probably we need to get onto the BSP via sched_bind() during suspend and then stop the other CPUs using stop_cpus(). The hard part, however, is properly resuming the darn things. Do you know what mode the CPUs come back up in? It looks like we need to resend startup IPIs to them from your patch. -- John Baldwin