Subject: port-i386/14974: 3com 3cx576 fails on pcmcia0 at cardslot0, works on pcic0
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 12/17/2001 00:50:07
>Number:         14974
>Category:       port-i386
>Synopsis:       3com 3cx576 fails on pcmcia0 at cardslot0, works on pcic0
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 16 21:55:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        -current of 5 Dec 2001
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.5Z NetBSD 1.5Z (ZORKMID-$Revision: 1.12 $) #110: Sun Dec 16 22:49:07 EST 2001 jhawk@zorkmid.mit.edu:/usr/local/netbsd-current/src/sys/arch/i386/compile/ZORKMID i386


>Description:

Try to use a 3Com Megahertz, 3CXM756/3CCM756 (manufacturer 0x0101,
product 0x003f) pcmcia card on my Sony VAIO Z505HE. It seems to work
fine when cardbus is disabled and it is attached on pcmcia0 at pcic0,
but it fails when attached on cardslot0 at cbb0.

The specific failure appears to be one of interrupts. Despite the fact
that an interrupt handler appears to be registered, no interrupts
are generated when the card is plugged in (e.g. a breakpoint on Xintr9
never triggers). Interrupts work fine with wi0 attached in the same way.

>How-To-Repeat:

Here's dmesg output with CBB_DEBUG, PCIBIOS interrupt debugging,
and perhaps some other kinds of debugging, too.

NetBSD 1.5Z (ZORKMID-$Revision: 1.12 $) #110: Sun Dec 16 22:49:07 EST 2001
    jhawk@zorkmid.mit.edu:/usr/local/netbsd-current/src/sys/arch/i386/compile/ZORKMID
cpu0: Intel Pentium III (Coppermine) (686-class), 446.70 MHz
cpu0: I-cache 16 KB 32b/line 4-way, D-cache 16 KB 32b/line 2-way
cpu0: L2 cache 256 KB 32b/line 8-way
cpu0: features 383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features 383f9ff<PGE,MCA,CMOV,FGPAT,PSE36,MMX,FXSR,SSE>
total memory = 65084 KB
avail memory = 54240 KB
using 839 buffers containing 3356 KB of memory
BIOS32 rev. 0 found at 0xfd880
PCI BIOS rev. 2.1 found at 0xfd99e
pcibios: config mechanism [1][x], special cycles [x][x], last bus 1
PCI IRQ Routing Table rev. 1.0 found at 0xfdf40, size 160 bytes (8 entries)
PCI Interrupt Router at 000:07:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
PIR Entry 0:
	Bus: 0  Device: 1
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x61 bitmap 0x0200
		INTC: link 0x62 bitmap 0x0200
		INTD: link 0x63 bitmap 0x0200
PIR Entry 1:
	Bus: 0  Device: 7
		INTA: link 0x00 bitmap 0x0000
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x63 bitmap 0x0200
PIR Entry 2:
	Bus: 0  Device: 8
		INTA: link 0x63 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 3:
	Bus: 0  Device: 9
		INTA: link 0x62 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 4:
	Bus: 0  Device: 10
		INTA: link 0x61 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 5:
	Bus: 0  Device: 11
		INTA: link 0x60 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 6:
	Bus: 0  Device: 12
		INTA: link 0x61 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
PIR Entry 7:
	Bus: 0  Device: 13
		INTA: link 0x61 bitmap 0x0200
		INTB: link 0x00 bitmap 0x0000
		INTC: link 0x00 bitmap 0x0000
		INTD: link 0x00 bitmap 0x0000
pciintr_link_fixup: PIRQ 0x00 already connected to IRQ 9
pciintr_link_fixup: PIRQ 0x01 not connected, assigning IRQ 9
pciintr_link_fixup: PIRQ 0x02 not connected, assigning IRQ 9
pciintr_link_fixup: PIRQ 0x03 not connected, assigning IRQ 9
pciintr_link_route: route of PIRQ 0x00 -> IRQ 9 preserved BIOS setting
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:07:2 0x8086 0x7112   D  0x03   9  1    fixed up
000:08:0 0x104d 0x8039   A  0x03   9  1    fixed up
000:09:0 0x1073 0x0010   A  0x02   9  1    already assigned
000:10:0 0x14f1 0x2443   A  0x01   9  1    already assigned
000:11:0 0x8086 0x1229   A  0x00   9  0    already assigned
000:12:0 0x1180 0x0475   A  0x01   9  1    fixed up
000:13:0 0x104d 0x808a   A  0x01   9  1    fixed up
------------------------------------------
PCI fixup examining 8086:7190
PCI fixup examining 8086:7191
PCI fixup examining 10c8:05
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI fixup examining 8086:7110
PCI fixup examining 8086:7111
PCI fixup examining 8086:7112
PCI fixup examining 8086:7113
PCI fixup examining 104d:8039
PCI fixup examining 1073:10
PCI fixup examining 14f1:2443
PCI fixup examining 8086:1229
PCI fixup examining 1180:475
PCI bridge 1: primary 0, secondary 2, subordinate 2
PCI fixup examining 104d:808a
PCI bus #2 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x7190 
	10h mem  0x40000000 0x01000000
		[OK]
000:01:0 0x8086 0x7191 
		[OK]
000:07:0 0x8086 0x7110 
		[OK]
000:07:1 0x8086 0x7111 
	20h port 0x0000fcb0 0x00000010
		[OK]
000:07:2 0x8086 0x7112 
	20h port 0x0000fc60 0x00000020
		[OK]
000:07:3 0x8086 0x7113 
		[OK]
000:08:0 0x104d 0x8039 
	10h mem  0xfecfe000 0x00000800
	14h mem  0xfecfec00 0x00000200
		[OK]
000:09:0 0x1073 0x0010 
	10h mem  0xfecf0000 0x00008000
	14h port 0x0000fc00 0x00000040
	18h port 0x0000fcac 0x00000004
		[OK]
000:10:0 0x14f1 0x2443 
	10h mem  0xfece0000 0x00010000
	14h port 0x0000fca0 0x00000008
		[OK]
000:11:0 0x8086 0x1229 
	10h mem  0xfecff000 0x00001000
	14h port 0x0000fcc0 0x00000040
	18h mem  0xfed00000 0x00100000
		[OK]
000:12:0 0x1180 0x0475 
	10h mem  0x00000000 0x00001000
		[NG]
000:13:0 0x104d 0x808a 
	10h mem  0xfecfe800 0x00000400
		[OK]
001:00:0 0x10c8 0x0005 
	10h mem  0xfd000000 0x01000000
	14h mem  0xfe400000 0x00400000
	18h mem  0xfeb00000 0x00100000
		[OK]
--------------------------[  1 devices bogus]
WARNING: can't reserve area for I/O APIC.
 Physical memory end: 0x03fd0000
 PCI memory mapped I/O space start: 0x04000000
[PCIBIOS fixup stage]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x7190 
	10h mem  0x40000000 0x01000000
		[OK]
000:01:0 0x8086 0x7191 
		[OK]
000:07:0 0x8086 0x7110 
		[OK]
000:07:1 0x8086 0x7111 
	20h port 0x0000fcb0 0x00000010
		[OK]
000:07:2 0x8086 0x7112 
	20h port 0x0000fc60 0x00000020
		[OK]
000:07:3 0x8086 0x7113 
		[OK]
000:08:0 0x104d 0x8039 
	10h mem  0xfecfe000 0x00000800
	14h mem  0xfecfec00 0x00000200
		[OK]
000:09:0 0x1073 0x0010 
	10h mem  0xfecf0000 0x00008000
	14h port 0x0000fc00 0x00000040
	18h port 0x0000fcac 0x00000004
		[OK]
000:10:0 0x14f1 0x2443 
	10h mem  0xfece0000 0x00010000
	14h port 0x0000fca0 0x00000008
		[OK]
000:11:0 0x8086 0x1229 
	10h mem  0xfecff000 0x00001000
	14h port 0x0000fcc0 0x00000040
	18h mem  0xfed00000 0x00100000
		[OK]
000:12:0 0x1180 0x0475 
	10h mem  0x04000000 0x00001000
		[OK]
000:13:0 0x104d 0x808a 
	10h mem  0xfecfe800 0x00000400
		[OK]
001:00:0 0x10c8 0x0005 
	10h mem  0xfd000000 0x01000000
	14h mem  0xfe400000 0x00400000
	18h mem  0xfeb00000 0x00100000
		[OK]
--------------------------[  0 devices bogus]
mainbus0 (root)
pnpbios0 at mainbus0: nodes 17, max len 210
com0 at pnpbios0 index 14 (PNP0501)
com0: io 3f8-3ff, irq 4
com0: ns16550a, working fifo
lpt0 at pnpbios0 index 18 (PNP0401)
lpt0: io 378-37f 778-77f, irq 7, dma 3
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
agp at pchb0 not configured
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Neomagic MagicMedia 256AV VGA (rev. 0x20)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <TOSHIBA MK8113MAT>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 7815 MB, 16938 cyl, 15 head, 63 sec, 512 bytes/sect x 16006410 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: disabling secondary channel (no drives)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 0x01)
uhci0: interrupting at irq 9
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
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x03) at pci0 dev 7 function 3 not configured
Sony CXD3222 OHCI IEEE 1394 Host Controller (Firewire serial bus, interface 0x10, revision 0x02) at pci0 dev 8 function 0 not configured
yds0 at pci0 dev 9 function 0: Yamaha 744 (DS-1S) Audio (rev. 0x02)
yds0: interrupting at irq 9
yds0: Asahi Kasei AK4543 codec; headphone, 18 bit DAC, 18 bit ADC, AZTECH 3D
audio0 at yds0: full duplex, mmap, independent
Conexant Systems SoftK56 PCI Software Modem (miscellaneous communications, revision 0x01) at pci0 dev 10 function 0 not configured
fxp0 at pci0 dev 11 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at irq 9
fxp0: Ethernet address 08:00:46:06:00:6b
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
cbb0 at pci0 dev 12 function 0: Ricoh 5C475 PCI-CardBus bridge (rev. 0x80) (chipflags 2)
cbb0: socket base address 0x4000000
cbb0: intrpin A, intrtag 9
Sony Memory Stick I/F Controller (flash memory, revision 0x01) at pci0 dev 13 function 0 not configured
isa0 at pcib0
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
isapnp0: no ISA Plug 'n Play devices found
opl0 at yds0: model OPL3
midi1 at opl0: DS-1 integrated Yamaha OPL3
mpu0 at yds0
midi2 at mpu0: Yamaha DS-1 MIDI UART
CardBus latency timer 0x20 (20020200)
PCI latency timer 0x10 (21000)
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
cbb0: interrupting at irq 9
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0
pcmcia0 at cardslot0
pccbb_pcmcia_card_detect
pccbbattach: found cardslot
apm0 at mainbus0: Power Management spec V1.2
biomask ef6d netmask ef6d ttymask ffef
pccbb_pcmcia_socket_enable: 5V card
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
pccbb_power: CARDBUS_VCC_5V and CARDBUS_VPP_VCC [15]
pccbb_pcmcia_wait_ready: status 0x5f
cbb0: pccbb_pcmcia_socket_enable 00 cardtype mem 50
pccbb_pcmcia_alloc_mem: addr 0x41000000 size 0x400, realsize 0x1000
pccbb_pcmcia_mem_map window 0 bus 41000000+0+400 at card addr 0
pccbb_pcmcia_do_mem_map: start 0x41000000 end 0x410003ff off 0xbf000000
pccbb_pcmcia_do_mem_map window 0: 0000 0080 0070 41
pccbb_pcmcia_socket_disable
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
com1 at pcmcia0 function 0pccbb_pcmcia_socket_enable: 5V card
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
pccbb_power: CARDBUS_VCC_5V and CARDBUS_VPP_VCC [15]
pccbb_pcmcia_wait_ready: status 0x5f
cbb0: pccbb_pcmcia_socket_enable 00 cardtype io 70
pccbb_pcmcia_alloc_mem: addr 0x41000000 size 0x14, realsize 0x1000
pccbb_pcmcia_mem_map window 0 bus 41000000+300+14 at card addr 0
pccbb_pcmcia_do_mem_map: start 0x41000000 end 0x41000313 off 0xbf000000
pccbb_pcmcia_do_mem_map window 0: 0000 0080 0070 41
pccbb_pcmcia_io_map window 0 io8 port 43f8+8
pccbb_pcmcia_do_io_map win 0 addr 0x43f8 size 0x8 width 8
 start f8 43, stop ff 43, ioctl 00 enable 61
: serial device
com1: ns16550a, working fifo
pccbb_pcmcia_socket_disable
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
pccbb_intr_establish start. 0x0
pccbb_intr_establish add pil. 0xc0824390
pccbb_pcmcia_socket_enable: 5V card
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
pccbb_power: CARDBUS_VCC_5V and CARDBUS_VPP_VCC [15]
pccbb_pcmcia_wait_ready: status 0x5f
cbb0: pccbb_pcmcia_socket_enable 00 cardtype io 70
pccbb_pcmcia_do_io_map win 0 addr 0x43f8 size 0x8 width 8
 start f8 43, stop ff 43, ioctl 00 enable 40
pccbb_pcmcia_alloc_mem: addr 0x41000000 size 0x14, realsize 0x1000
pccbb_pcmcia_mem_map window 0 bus 41000000+300+14 at card addr 0
pccbb_pcmcia_do_mem_map: start 0x41000000 end 0x41000313 off 0xbf000000
pccbb_pcmcia_do_mem_map window 0: 0000 0080 0070 41
pccbb_pcmcia_socket_disable
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
pccbb_intr_disestablish start. 0xc0824390
pccbb_intr_disestablish frees one pil
pccbb_intr_disestablish: no interrupt handler
IP Filter: v3.4.16 initialized.  Default = pass all, Logging = enabled
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)
<5>Accounting started


Here's what happens when I try to actually use it (interrupts aren't
registered until the device is openned...)

pccbb_intr_establish start. 0x0
pccbb_intr_establish add pil. 0xc09000b0
pccbb_pcmcia_socket_enable: 5V card
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
pccbb_power: CARDBUS_VCC_5V and CARDBUS_VPP_VCC [15]
pccbb_pcmcia_wait_ready: status 0x5f
cbb0: pccbb_pcmcia_socket_enable 00 cardtype io 70
pccbb_pcmcia_do_io_map win 0 addr 0x43f8 size 0x8 width 8
 start f8 43, stop ff 43, ioctl 00 enable 40
pccbb_pcmcia_alloc_mem: addr 0x41000000 size 0x14, realsize 0x1000
pccbb_pcmcia_mem_map window 0 bus 41000000+300+14 at card addr 0
pccbb_pcmcia_do_mem_map: start 0x41000000 end 0x41000313 off 0xbf000000
pccbb_pcmcia_do_mem_map window 0: 0000 0080 0070 41

Which all looks totally normal. 

pccbb_intr_establish() and it's companion pccbb_intr_route() both
appear to be really straightforward functions without a lot of stuff
to go wrong.


>Fix:
	
Well, using the pcmcia attachment works just fine. I dunno beyond that.

It was suggested I try futzing with the PCIBIOS fixup options.
INTR fixups are required for my cbb to even attach, and beyond
that, the other combinations appear to have no practical effect.

I'm really at a loss to how to debug this. I'd appreciate some
assistance...
>Release-Note:
>Audit-Trail:
>Unformatted: