Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Oct 2006 14:24:18 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Andrea Bittau <a.bittau@cs.ucl.ac.uk>
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]
Message-ID:  <200610021424.18562.jhb@freebsd.org>
In-Reply-To: <20060921000628.GA1832@shorty.sorbonet.org>
References:  <20060921000628.GA1832@shorty.sorbonet.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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