Subject: apic timing/clock problem in 4.0_RC3, MacBook 2x2.0
To: None <port-i386@netbsd.org>
From: Marco Trillo <marcotrillo@gmail.com>
List: port-i386
Date: 11/03/2007 14:19:37
Hi all,

I installed NetBSD 4.0_RC3/i386 on a 2x2.0 MacBook (the original model
with a 32-bit Core Duo, not the one with 64-bit Core 2 Duo) -- dmesg
attached.

I'm running the GENERIC.MP and everything works fine (SMP, devices,
etc.) except one timing problem.

The timing/clock appears to be uncalibrated. For example, if you run:

# sleep 1
(will sleep 3.5 seconds approx)
# sleep 2
(will sleep 7 seconds)
# sleep 3
(will sleep 11 seconds)

In general, everything that has to do with delays or timing (sleep(1),
logout delay, keyboard repeat rate, kernel delays, etc.) runs slow --
in this case with a factor of 3.5, but this changes each reboot; it
may be a factor of 2 .

In the dmesg there is this line:
cpu0: calibrating local timer
cpu0: apic clock running at 579 MHz

that value seems to be different in each reboot, I got 3xx MHz values.

Thanks in advanced,
Marco.

Full dmesg:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.0_RC3 (GENERIC.MP) #0: Wed Oct 31 15:40:38 PDT 2007
	builds@wb34:/home/builds/ab/netbsd-4/i386/200710310002Z-obj/home/builds/ab/netbsd-4/src/sys/arch/i386/compile/GENERIC.MP
total memory = 480 MB
rbus: rbus_min_start set to 0x40000000
avail memory = 461 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
mainbus0 (root)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel Pentium M (Yonah) (686-class), 2063.77 MHz, id 0x6e8
cpu0: features bfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features bfe9fbff<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features bfe9fbff<FXSR,SSE,SSE2,SS,HTT,TM,SBF>
cpu0: features2 c1a9<SSE3,MONITOR,VMX,EST,TM2,xTPR>
cpu0: "Genuine Intel(R) CPU           T2500  @ 2.00GHz"
cpu0: I-cache 32 KB 64B/line 8-way, D-cache 32 KB 64B/line 8-way
cpu0: L2 cache 2 MB 64B/line 8-way
cpu0: using thermal monitor 1
cpu0: Enhanced SpeedStep (1260 mV) 1667 MHz
cpu0: unknown Enhanced SpeedStep CPU.
cpu0: using only highest, current and lowest power states.
cpu0: Enhanced SpeedStep frequencies available (MHz): 2000 1667 1000
cpu0: calibrating local timer
cpu0: apic clock running at 579 MHz
cpu0: 64 page colors
cpu1 at mainbus0: apid 1 (application processor)
cpu1: starting
cpu1: Intel Pentium M (Yonah) (686-class), 7122.27 MHz, id 0x6e8
cpu1: features bfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu1: features bfe9fbff<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu1: features bfe9fbff<FXSR,SSE,SSE2,SS,HTT,TM,SBF>
cpu1: features2 c1a9<SSE3,MONITOR,VMX,EST,TM2,xTPR>
cpu1: "Genuine Intel(R) CPU           T2500  @ 2.00GHz"
cpu1: I-cache 32 KB 64B/line 8-way, D-cache 32 KB 64B/line 8-way
cpu1: L2 cache 2 MB 64B/line 8-way
cpu1: using thermal monitor 1
ioapic0 at mainbus0 apid 1 (I/O APIC)
ioapic0: pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0
ioapic0: remapped to apic 1
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <APPLE , Apple00,00000061>, AslId <    ,01000013>
acpi0: found ECDT, GPE 23
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
ACPI-Fast 24-bit timer
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
acpiacad0 at acpi0 (ACPI0003): ACPI AC Adapter
acpilid0 at acpi0 (PNP0C0D): ACPI Lid Switch
APP0002 at acpi0 not configured
acpibut0 at acpi0 (PNP0C0C): ACPI Power Button
acpibut1 at acpi0 (PNP0C0E): ACPI Sleep Button
PNP0A08 [PCI Express/PCI-X Mode-2 Host Bridge] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
APP0001 at acpi0 not configured
APP0003 at acpi0 not configured
acpiec0 at acpi0 (PNP0C09): ACPI Embedded Controller
acpiec0: io 0x62,0x66
acpiec0: unable to map data register
ACPI0002 [Smart Battery Subsystem] at acpi0 not configured
IFX0101 at acpi0 not configured
PNP0200 [AT DMA Controller] at acpi0 not configured
INT0800 [Intel FWH Random Number Generator] at acpi0 not configured
PNP0103 [HPET Timer] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
npx1 at acpi0 (PNP0C04)
npx1: io 0xf0 irq 13
npx1: reported by CPUID; using exception 16
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
attimer1 at acpi0 (PNP0100): AT Timer
attimer1: io 0x40-0x43,0x50-0x53
acpibat0 at acpi0 (PNP0C0A-0): ACPI Battery (Control Method)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82945GM/PM/GMS Host Bridge (rev. 0x03)
agp0 at pchb0: unknown memory configuration, disabling
vga1 at pci0 dev 2 function 0: Intel 82945GM/PM/GMS Integrated
Graphics Device (rev. 0x03)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
Intel 82945GM/PM/GMS Integrated Graphics Device (miscellaneous
display, revision 0x03) at pci0 dev 2 function 1 not configured
Intel product 0x27a3 (Time and Frequency DASP, revision 0x03) at pci0
dev 7 function 0 not configured
azalia0 at pci0 dev 27 function 0: Generic High Definition Audio Controller
azalia0: interrupting at ioapic0 pin 22 (irq 11)
azalia0: host: Intel 82801GB/GR High Definition Audio Controller (rev. 2)
azalia0: host: High Definition Audio rev. 1.0
ppb0 at pci0 dev 28 function 0: Intel 82801GB/GR PCI Express Port #1 (rev. 0x02)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled, rd/line, wr/inv ok
mskc0 at pci1 dev 0 function 0mskc0: interrupt moderation is 0 us
, Yukon-2 EC rev. A3 (0x2): ioapic0 pin 16 (irq 11)
msk0 at mskc0 port A: Ethernet address 00:16:cb:ce:d1:cc
makphy0 at msk0 phy 0: Marvell 88E1111 Gigabit PHY, rev. 2
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,
1000baseT-FDX, auto
ppb1 at pci0 dev 28 function 1: Intel 82801GB/GR PCI Express Port #2 (rev. 0x02)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled, rd/line, wr/inv ok
ath0 at pci2 dev 0 function 0
ath0: interrupting at ioapic0 pin 17 (irq 11)
ath0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
ath0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ath0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps
24Mbps 36Mbps 48Mbps 54Mbps
ath0: mac 10.3 phy 6.1 radio 10.2
uhci0 at pci0 dev 29 function 0: Intel 82801GB/GR USB UHCI Controller
(rev. 0x02)
uhci0: interrupting at ioapic0 pin 21 (irq 11)
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1: Intel 82801GB/GR USB UHCI Controller
(rev. 0x02)
uhci1: interrupting at ioapic0 pin 19 (irq 11)
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2: Intel 82801GB/GR USB UHCI Controller
(rev. 0x02)
uhci2: interrupting at ioapic0 pin 18 (irq 11)
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 29 function 3: Intel 82801GB/GR USB UHCI Controller
(rev. 0x02)
uhci3: interrupting at ioapic0 pin 16 (irq 10)
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7: Intel 82801GB/GR USB EHCI Controller
(rev. 0x02)
ehci0: interrupting at ioapic0 pin 21 (irq 11)
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
ppb2 at pci0 dev 30 function 0: Intel 82801BAM Hub-PCI Bridge (rev. 0xe2)
pci3 at ppb2 bus 3
pci3: i/o space, memory space enabled
fwohci0 at pci3 dev 3 function 0: Lucent Technologies FW322/323 IEEE
1394 Host Controller (rev. 0x61)
fwohci0: interrupting at ioapic0 pin 19 (irq 11)
fwohci0: OHCI version 1.0 (ROM=0)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:16:cb:ff:fe:e1:c5:34
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
pcib0 at pci0 dev 31 function 0
pcib0: Intel 82801GBM LPC Interface Bridge (rev. 0x02)
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801GB/GR IDE Controller (ICH7) (rev. 0x02)
piixide0: bus-master DMA support present
piixide0: primary channel configured to compatibility mode
piixide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus0 at piixide0 channel 0
piixide0: secondary channel configured to compatibility mode
piixide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus1 at piixide0 channel 1
piixide1 at pci0 dev 31 function 2
piixide1: Intel 82801GBM/GHM Serial ATA Controller (ICH7) (rev. 0x02)
piixide1: bus-master DMA support present
piixide1: primary channel configured to native-PCI mode
piixide1: using ioapic0 pin 19 (irq 11) for native-PCI interrupt
atabus2 at piixide1 channel 0
piixide1: secondary channel configured to native-PCI mode
atabus3 at piixide1 channel 1
Intel 82801GB/GR SMBus Controller (SMBus serial bus, revision 0x02) at
pci0 dev 31 function 3 not configured
isa0 at pcib0
pcppi0 at isa0 port 0x61
pcppi0: children must have an explicit unit
midi0 at pcppi0: PC speaker (CPU-intensive output)
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
pcppi0: attached to attimer1
isapnp0: no ISA Plug 'n Play devices found
ioapic0: enabling
WARNING: Callback scheduled before sysmon task queue thread present.
fwohci0: node_id=0xc000ffc0, gen=2, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
ieee1394if0: bus manager 0 (me)
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
azalia0: codec[0]: Sigmatel STAC9221 (rev. 52.1)
azalia0: codec[0]: High Definition Audio rev. 1.0
azalia0: playback: max channels=8, encodings=1<PCM>
azalia0: playback: PCM
formats=e07e0<24bit,20bit,16bit,192kHz,176.4kHz,96kHz,88.2kHz,48kHz,44.1kHz>
azalia0: recording: max channels=4, encodings=1<PCM>
azalia0: recording: PCM
formats=e07e0<24bit,20bit,16bit,192kHz,176.4kHz,96kHz,88.2kHz,48kHz,44.1kHz>
audio0 at azalia0: full duplex, independent
Kernelized RAIDframe activated
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <MATSHITADVD-R   UJ-857, , HBEA> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
cd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using DMA)
wd0 at atabus2 drive 1: <ST96812AS>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 57231 MB, 116280 cyl, 16 head, 63 sec, 512 bytes/sect x 117210240 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(piixide1:0:1): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
uhidev0 at uhub0 port 2 configuration 1 interface 0
uhidev0: Apple Computer Apple Internal Keyboard / Trackpad, rev
2.00/0.64, addr 2, iclass 3/1
ukbd0 at uhidev0
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1
uhidev1: Apple Computer Apple Internal Keyboard / Trackpad, rev
2.00/0.64, addr 2, iclass 3/1
uhidev1: 5 report ids
ums0 at uhidev1 reportid 2: 3 buttons
wsmouse0 at ums0 mux 0
uhid0 at uhidev1 reportid 5: input=63, output=0, feature=16
uhidev2 at uhub0 port 2 configuration 1 interface 2ugen0 at uhub4 port 4
ugen0: Apple Computer product 0x8300, rev 2.00/0.0c, addr 2

uhidev2: Apple Computer Apple Internal Keyboard / Trackpad, rev
2.00/0.64, addr 2, iclass 3/0
uhid1 at uhidev2: input=1, output=0, feature=0
uhub5 at uhub1 port 1
uhub5: Mitsumi Electric Hub in Apple Extended USB Keyboard, class 9/0,
rev 1.10/4.10, addr 2
uhub5: 3 ports with 2 removable, bus powered
uhidev3 at uhub5 port 3 configuration 1 interface 0
uhidev3: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/4.10,
addr 3, iclass 3/1
ukbd1 at uhidev3
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
cpu1: CPU 1 running
mskc0: interrupt moderation is 1000 us
wskbd1 at ukbd1 mux 1
wskbd1: connecting to wsdisplay0
uhidev4 at uhub5 port 3 configuration 1 interface 1
uhidev4: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/4.10,
addr 3, iclass 3/0
uhidev4: 3 report ids
uhid2 at uhidev4 reportid 2: input=1, output=0, feature=0
uhid3 at uhidev4 reportid 3: input=3, output=0, feature=0
uhidev5 at uhub2 port 2 configuration 1 interface 0
uhidev5: Apple Computer, Inc. IR Receiver, rev 2.00/1.10, addr 2, iclass 3/0
uhidev5: 38 report ids
uhid4 at uhidev5 reportid 36: input=4, output=0, feature=0
uhid5 at uhidev5 reportid 37: input=4, output=0, feature=0
uhid6 at uhidev5 reportid 38: input=4, output=0, feature=0
uhidev6 at uhub3 port 1 configuration 1 interface 0
uhidev6: Apple Computer product 0x1000, rev 2.00/19.65, addr 2, iclass 3/1
ukbd2 at uhidev6
wskbd2 at ukbd2 mux 1
wskbd2: connecting to wsdisplay0
uhidev7 at uhub3 port 1 configuration 1 interface 1
uhidev7: Apple Computer product 0x1000, rev 2.00/19.65, addr 2, iclass 3/1
ums1 at uhidev7: 5 buttons
wsmouse1 at ums1 mux 0
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)