From owner-freebsd-hardware@FreeBSD.ORG Tue Nov 6 19:58:56 2007 Return-Path: Delivered-To: freebsd-hardware@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9619A16A41A; Tue, 6 Nov 2007 19:58:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from av-tac-rtp.cisco.com (hen.cisco.com [64.102.19.198]) by mx1.freebsd.org (Postfix) with ESMTP id 3545B13C49D; Tue, 6 Nov 2007 19:58:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) X-TACSUNS: Virus Scanned Received: from rooster.cisco.com (localhost [127.0.0.1]) by av-tac-rtp.cisco.com (8.11.7p3+Sun/8.11.7) with ESMTP id lA6JZbJ26742; Tue, 6 Nov 2007 14:35:37 -0500 (EST) Received: from [64.102.220.97] (dhcp-64-102-220-97.cisco.com [64.102.220.97]) by rooster.cisco.com (8.11.7p3+Sun/8.11.7) with ESMTP id lA6JZt626419; Tue, 6 Nov 2007 14:35:55 -0500 (EST) Message-ID: <4730C209.3070703@FreeBSD.org> Date: Tue, 06 Nov 2007 14:35:37 -0500 From: Joe Marcus Clarke Organization: FreeBSD, Inc. User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Rui Paulo References: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> In-Reply-To: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-hardware@FreeBSD.org Subject: Re: MacBook users: possible fix for the SMP problem X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2007 19:58:56 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rui Paulo wrote: > Hi, > I've been contacted by Marco Trillo and I think he has found the source > of the SMP problem. > The problem seems to rely on Intel ICH7. Basically we need to disable > the "LEGACY_USB" bit before we calibrate the clocks. > "LEGACY_USB", according to Marco (I don't have the ICH7 spec at hand), > "causes legacy USB circuit to generate SMIs". > > Please try the following patch: > --- sys/amd64/isa/clock.c.orig 2007-11-04 20:31:09.000000000 +0000 > +++ sys/amd64/isa/clock.c 2007-11-04 20:34:59.000000000 +0000 > @@ -577,6 +577,8 @@ startrtclock() > writertc(RTC_STATUSA, rtc_statusa); > writertc(RTC_STATUSB, RTCSB_24HR); > > + outl(0x430, inl(0x430) & ~0x8); > + > freq = calibrate_clocks(); > #ifdef CLK_CALIBRATION_LOOP > if (bootverbose) { > --- sys/i386/isa/clock.c.orig 2007-11-04 20:34:03.000000000 +0000 > +++ sys/i386/isa/clock.c 2007-11-04 20:34:30.000000000 +0000 > @@ -621,6 +621,8 @@ startrtclock() > writertc(RTC_STATUSA, rtc_statusa); > writertc(RTC_STATUSB, RTCSB_24HR); > > + outl(0x430, inl(0x430) & ~0x8); > + > freq = calibrate_clocks(); > #ifdef CLK_CALIBRATION_LOOP > if (bootverbose) { > > > This should probably fix two issues: > 1) The second core should start without any trick (e.g. key press) > 2) We should be able to run with HZ=1000 (the default) without any > problem. To check if this is indeed the case, try booting with HZ=1000 > (loader.conf variable kern.hz) and check if your CPU clock shows up > correctly in the dmesg. After that, please also check if 'time sleep 1' > takes one second (not more and not less). > > Also, please test if there are any USB problems. > > Note: this is still a hack. I'm still thinking about a way to correctly > identify on which systems we need to apply this fix. I can confirm on my MacBook Pro Core Duo 15", that this patch does fix the second CPU init problem (no more key presses), and kern.hz=1000 works as expected (CPU @ 2.0 GHz). Thanks! Joe - -- Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHMMIIb2iPiv4Uz4cRAlqPAKCZkhhP5QgOHT7N0f1QeTwGMIau1wCgpeDi YysjxnhelxMxC1C2GQtIoik= =fk/Q -----END PGP SIGNATURE-----