Subject: Re: ACPI interrupt routing, take 2
To: None <port-i386@netbsd.org>
From: Rui Paulo <rpaulo@fnop.net>
List: port-i386
Date: 03/23/2006 16:24:33
Frank van der Linden <fvdl@netbsd.org> writes:

> I've updated my changes for ACPI interrupt routing, and put new kernels
> in ftp://ftp.netbsd.org/pub/NetBSD/misc/fvdl/acpi/
>
> Changes are:
>
> 	* Fixes from Masanori Kanaoka for legacy IRQ use and cardbus.
> 	  (should fix legacy IRQ problems that a few people saw).
> 	* Get the ioapic register settings right for ioapic routes
> 	  using a PCI link device (should fix problem reported
> 	  by Matt Thomas).
> 	* More debug output if you patch the kernel to have mp_verbose = 2
> 	  (e.g:
> 		gdb --write netbsd.acpi
> 		set mp_verbose=2
> 		quit
> 	  )
> 	* Stepping through the MPACPI configuration, requiring user a
> 	  console keypress, if mpacpi_step = 1.
>
> Many thanks for the testers who helped so far,

Ok, here are my problems:
using your changes, I can't boot a non-MPACPI kernel with ioapic. I
could do this without your patches.
Booting with ioapic + mpacpi yelds the less problems with your
patch. I used to have problems with cardbus/pcmcia but now they are
gone, but I still have problems with USB (I can only make usb work
fine without your patches and without ioapic -- perhaps a problem with
our usb stack ?)

Here's the dmesg:
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    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 3.99.17 (PHI) #26: Thu Mar 23 16:07:52 WET 2006
	rpaulo@phi.internal.fnop.net:/usr/obj/sys/arch/i386/compile/PHI
total memory = 510 MB
avail memory = 495 MB
BIOS32 rev. 0 found at 0xfd560
PCI BIOS rev. 2.1 found at 0xfd7be
pcibios: config mechanism [1][x], special cycles [x][x], last bus 7
PCI IRQ Routing Table rev. 1.0 found at 0xfdd70, size 0 bytes (-2 entries)
pcibios_pir_init: bad IRQ table size
PCI BIOS has 12 Interrupt Routing table entries
mainbus0 (root)
pci_addr_fixup: 000:31:1 0x8086 0x266f new address 0x00005800
pci_addr_fixup: 000:31:1 0x8086 0x266f new address 0x00005808
pci_addr_fixup: 000:31:1 0x8086 0x266f new address 0x00005810
pci_addr_fixup: 000:31:1 0x8086 0x266f new address 0x0000580c
ACPI (tbget-0390): Table [DSDT] replaced by host OS [20060217]
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel Pentium M (Dothan) (686-class), 1596.11 MHz, id 0x6d8
cpu0: features afe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features afe9fbff<PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX>
cpu0: features afe9fbff<FXSR,SSE,SSE2,SS,TM,SBF>
cpu0: features2 180<EST,TM2>
cpu0: "Intel(R) Pentium(R) M processor 1.60GHz"
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 2
cpu0: Enhanced SpeedStep (1308 mV) 1600 MHz
cpu0: Enhanced SpeedStep frequencies available (MHz): 1600 1333 1200 1067 800
cpu0: calibrating local timer
cpu0: apic clock running at 133 MHz
cpu0: 64 page colors
ioapic0 at mainbus0 apid 1 (I/O APIC)
ioapic0: pa 0xfec00000, version 20, 24 pins
ioapic1 at mainbus0 apid 2 (I/O APIC)
ioapic1: pa 0xfec20000, version ff, 256 pins
ioapic1: misconfigured as apic 15
ioapic1: can't remap to apid 2
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <PTLTD ,  RSDT  ,06040000>, AslId < LTP,00000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
allocated pic ioapic0 type level pin 9 level 10 to cpu0 slot 16 idt entry 160
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
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
acpiec0 at acpi0 (PNP0C09): ACPI Embedded Controller
acpiec0: io 0x62,0x66
acpiec0: EcWrite: timeout waiting for EC to process write command
ACPI Exception (evregion-0521): AE_ERROR, Returned by Handler for [EmbeddedControl] [20060217]
ACPI Error (psparse-0626): Method parse/execution failed [\_SB_.PCI0.LPCB.EC0_._REG] (Node 0xc0fe0040), AE_ERROR
acpiec0: unable to install address space handler: AE_ERROR
PNP0200 [AT DMA Controller] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
npx0 at acpi0 (PNP0C04)
npx0: io 0xf0 irq 13
npx0: using exception 16
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
attimer0 at acpi0 (PNP0100): AT Timer
attimer0: io 0x40-0x43,0x50-0x53 irq 0
PNP0A05 [Generic Container Device] at acpi0 not configured
com0 at acpi0 (NSC6001)
com0: io 0x2f8-0x2ff irq 3 drq 1
com0: ns16550a, working fifo
allocated pic ioapic0 type edge pin 3 level 13 to cpu0 slot 3 idt entry 208
PNP0303 [IBM Enhanced (101/102-key, PS/2 mouse support)] at acpi0 not configured
SYN1003 [Synaptics PS/2-style Touchpad] at acpi0 not configured
acpiacad0 at acpi0 (ACPI0003): ACPI AC Adapter
acpibat0 at acpi0 (PNP0C0A-1): ACPI Battery (Control Method)
acpibat1 at acpi0 (PNP0C0A-2): ACPI Battery (Control Method)
acpilid0 at acpi0 (PNP0C0D): ACPI Lid Switch
acpibut0 at acpi0 (PNP0C0C): ACPI Power Button
acpibut1 at acpi0 (PNP0C0E): ACPI Sleep Button
acpitz0 at acpi0: ACPI Thermal Zone
acpitz0: unable to get polling interval; using default of 30.0s
acpitz0: passive cooling mode only
acpitz0: critical 97.0C passive 60.0C
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 82915PM/GM/GMS,82910GML Host Bridge (rev. 0x03)
agp at pchb0 not configured
ppb0 at pci0 dev 1 function 0: Intel 82915PM/GM PCI Express Bridge (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled, rd/line, wr/inv ok
vga0 at pci1 dev 0 function 0: ATI Technologies Radeon Mobility X600 (rev. 0x00)
wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
ppb1 at pci0 dev 28 function 0: Intel 82801FB/FR PCI Express Port #0 (rev. 0x04)
pci2 at ppb1 bus 2
pci2: no spaces enabled!
ppb2 at pci0 dev 28 function 1: Intel 82801FB/FR PCI Express Port #1 (rev. 0x04)
pci3 at ppb2 bus 3
pci3: no spaces enabled!
ppb3 at pci0 dev 28 function 2: Intel 82801FB/FR PCI Express Port #2 (rev. 0x04)
pci4 at ppb3 bus 4
pci4: no spaces enabled!
uhci0 at pci0 dev 29 function 0: Intel 82801FB/FR USB UHCI Controller (rev. 0x04)
allocated pic ioapic0 type level pin 23 level 6 to cpu0 slot 11 idt entry 96
uhci0: interrupting at ioapic0 pin 23 (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 82801FB/FR USB UHCI Controller (rev. 0x04)
allocated pic ioapic0 type level pin 19 level 6 to cpu0 slot 17 idt entry 97
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 82801FB/FR USB UHCI Controller (rev. 0x04)
allocated pic ioapic0 type level pin 18 level 6 to cpu0 slot 18 idt entry 98
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 82801FB/FR USB UHCI Controller (rev. 0x04)
allocated pic ioapic0 type level pin 16 level 6 to cpu0 slot 10 idt entry 99
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 82801FB/FR USB EHCI Controller (rev. 0x04)
allocated pic ioapic0 type level pin 23 level 6 to cpu0 slot 11 idt entry 96
ehci0: interrupting at ioapic0 pin 23 (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
ppb4 at pci0 dev 30 function 0: Intel 82801BAM Hub-PCI Bridge (rev. 0xd4)
pci5 at ppb4 bus 5
pci5: i/o space, memory space enabled
cbb0 at pci5 dev 1 function 0: Texas Instruments PCI7x21/7x11 Cardbus Controller (rev. 0x00)
fwohci0 at pci5 dev 1 function 2: Texas Instruments PCI7x21/7x11 IEEE 1394 Host Controller (rev. 0x00)
allocated pic ioapic0 type level pin 18 level 6 to cpu0 slot 18 idt entry 98
fwohci0: interrupting at ioapic0 pin 18 (irq 11)
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:c0:9f:00:00:3d:4e:33
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
ieee1394if0 at fwohci0: IEEE1394 bus
fwip0 at ieee1394if0: IP over IEEE1394
fwohci0: Initiate bus reset
Texas Instruments PCI7x21/7x11 Integrated FlashMedia Controller (miscellaneous mass storage) at pci5 dev 1 function 3 not configured
iwi0 at pci5 dev 3 function 0: Intel PRO/Wireless LAN 2200BG Mini-PCI Adapter (rev. 0x05)
allocated pic ioapic0 type level pin 17 level 7 to cpu0 slot 19 idt entry 112
iwi0: interrupting at ioapic0 pin 17 (irq 11)
iwi0: 802.11 address 00:12:f0:06:c3:41
iwi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
bge0 at pci5 dev 8 function 0: Broadcom BCM5788 Gigabit Ethernet
allocated pic ioapic0 type level pin 16 level 7 to cpu0 slot 10 idt entry 99
bge0: interrupting at ioapic0 pin 16 (irq 10)
bge0: ASIC BCM5705 A3 (0x3003), Ethernet address 00:c0:9f:83:2b:7d
bge0: setting short Tx thresholds
brgphy0 at bge0 phy 1: BCM5705 1000BASE-T media interface, rev. 2
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
allocated pic ioapic0 type level pin 18 level 6 to cpu0 slot 18 idt entry 98
cbb0: interrupting at ioapic0 pin 18 (irq 11)
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 6
pcmcia0 at cardslot0
Intel 82801FB/FR AC'97 Audio Controller (audio multimedia, revision 0x04) at pci0 dev 30 function 2 not configured
Intel 82801FB/FR AC'97 Modem Controller (modem communications, revision 0x04) at pci0 dev 30 function 3 not configured
ichlpcib0 at pci0 dev 31 function 0
ichlpcib0: Intel 82801FBM ICH6M LPC Interface Bridge (rev. 0x04)
ichlpcib0: TCO (watchdog) timer configured.
ichlpcib0: No SpeedStep
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801FB IDE Controller (ICH6) (rev. 0x04)
piixide0: bus-master DMA support present
piixide0: primary channel configured to compatibility mode
allocated pic ioapic0 type edge pin 14 level 6 to cpu0 slot 14 idt entry 100
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 ignored (disabled)
Intel 82801FB/FR SMBus Controller (SMBus serial bus, revision 0x04) at pci0 dev 31 function 3 not configured
isa0 at ichlpcib0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
allocated pic ioapic0 type edge pin 1 level 9 to cpu0 slot 1 idt entry 144
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pms0: Synaptics touchpad version 5.9
pms0: Up/down buttons, Palm detect, Multi-finger
allocated pic ioapic0 type edge pin 12 level 9 to cpu0 slot 12 idt entry 145
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
ioapic0: enabling
ioapic1: enabling
fwohci0: node_id=0xc000ffc0, gen=1, CYCLEMASTER mode
ieee1394if0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
ieee1394if0: bus manager 0 (me)
IPsec: Initialized Security Association Processing.
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 1: <MATSHITAUJ-840D, , 1.00> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
wd0 at atabus0 drive 0: <IC25N080ATMR04-0>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 76319 MB, 155061 cyl, 16 head, 63 sec, 512 bytes/sect x 156301488 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
cd0(piixide0:0:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
pcmcia0: CIS version PC Card Standard 5.0
pcmcia0: CIS info: Lucent Technologies, WaveLAN/IEEE, Version 01.01, 
pcmcia0: Manufacturer code 0x156, product 0x2
pcmcia0: function 0: network adapter, ccr addr 3e0 mask 1
pcmcia0: function 0, config table entry 1: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqpulse irqlevel
wi0 at pcmcia0 function 0: <Lucent Technologies, WaveLAN/IEEE, Version 01.01, >
wi0: 802.11 address 00:02:2d:0a:5f:95
wi0: using Lucent Technologies, WaveLAN/IEEE
wi0: Lucent Firmware: Station (7.28.1)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
ehci0: handing over full speed device on port 4 to uhci1
uhub4: port 4, device disappeared after reset
ehci0: handing over low speed device on port 6 to uhci2
uhub4: port 6, device disappeared after reset
boot device: wd0
root on wd0a dumps on wd0b
mountroot: trying lfs...
mountroot: trying ffs...
root file system type: ffs
init: copying out path `/sbin/init' 11
uaudio0 at uhub1 port 2 configuration 1 interface 0: Plantronics Plantronics Headset, rev 1.10/0.04, addr 2
uaudio0: audio rev 1.00
audio0 at uaudio0: full duplex, independent
uhidev0 at uhub1 port 2 configuration 1 interface 3
uhidev0: Plantronics Plantronics Headset, rev 1.10/0.04, addr 2, iclass 3/0
uhid0 at uhidev0: input=2, output=0, feature=0
uhidev1 at uhub2 port 2 configuration 1 interface 0
uhidev1: Logitech Optical USB Mouse, rev 2.00/3.40, addr 2, iclass 3/1
ums0 at uhidev1: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
bge0: link state changed to DOWN
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)
wi0 detached
pcmcia0: CIS version PC Card Standard 5.0
pcmcia0: CIS info: Lucent Technologies, WaveLAN/IEEE, Version 01.01, 
pcmcia0: Manufacturer code 0x156, product 0x2
pcmcia0: function 0: network adapter, ccr addr 3e0 mask 1
pcmcia0: function 0, config table entry 1: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqpulse irqlevel
wi0 at pcmcia0 function 0: <Lucent Technologies, WaveLAN/IEEE, Version 01.01, >
wi0: 802.11 address 00:02:2d:0a:5f:95
wi0: using Lucent Technologies, WaveLAN/IEEE
wi0: Lucent Firmware: Station (7.28.1)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
uhidev1: at uhub2 port 2 (addr 2) disconnected
wsmouse1 detached
ums0 detached
uhidev1 detached
uaudio0: at uhub1 port 2 (addr 2) disconnected
audio0 detached
uaudio0 detached
uhidev0: at uhub1 port 2 (addr 2) disconnected
uhid0 detached
uhidev0 detached
iwi0: link state changed to UP
wi0 detached
pcmcia0: CIS version PC Card Standard 5.0
pcmcia0: CIS info: Lucent Technologies, WaveLAN/IEEE, Version 01.01, 
pcmcia0: Manufacturer code 0x156, product 0x2
pcmcia0: function 0: network adapter, ccr addr 3e0 mask 1
pcmcia0: function 0, config table entry 1: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqpulse irqlevel
wi0 at pcmcia0 function 0: <Lucent Technologies, WaveLAN/IEEE, Version 01.01, >
wi0: 802.11 address 00:02:2d:0a:5f:95
wi0: using Lucent Technologies, WaveLAN/IEEE
wi0: Lucent Firmware: Station (7.28.1)
wi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wi0 detached


-- 
  Rui Paulo			<rpaulo@{NetBSD{,-PT}.org,fnop.net}>