Subject: port-i386/10152: TEAC pcmcia wd CDROM fails on Sony VAIO
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 05/18/2000 12:22:17
>Number:         10152
>Category:       port-i386
>Synopsis:       TEAC pcmcia wd CDROM fails on Sony VAIO
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 18 12:23:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        -current from 14 May 2000
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.4Y NetBSD 1.4Y (ZORKMID-$Revision: 1.8 $) #90: Wed May 17 14:24:01 EDT 2000 jhawk@zorkmid.mit.edu:/usr/local/current-src/sys/arch/i386/compile/ZORKMID i386


>Description:
	The PCMCIA cdrom that comes with my Sony VAIO PCG-Z505HE
doesn't seem to work under NetBSD.

It hangs hard after the wdc2 probe after booting.

It happens both with:
	pcic enabled and cardbus disabled
	cardbus enabled and pcic disabled

>How-To-Repeat:

	Insert the PCMCIA card (permanenetly cabled to the cdrom
drive), and boot. It just hangs.
Here's some output with a breakpoint at wdc_pcmcia_attach:


>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 >> NetBSD/i386 vers.c, Revision 2.7
 >> (jhawk@zorkmid.mit.edu, Sat May 13 01:31:07 EDT 2000)
 >> Memory: 638/64448 k
 > boot -d
 booting wd0a:netbsd (howto 0x40)
 3543040+258048+296764+[190644+237420]=0x450f60
 [ netbsd ELF symbol table not valid ]
 [ preserving 428064 bytes of netbsd a.out symbol table ]
 Stopped in  at  _cpu_Debugger+0x4:      leave
 db> b wdc_pcmcia_attach
 db> c
 Copyright (c) 1996, 1997, 1998, 1999, 2000
 
     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 1.4Y (ZORKMID-$Revision: 1.8 $) #90: Wed May 17 14:24:01 EDT 2000
     jhawk@zorkmid.mit.edu:/usr/local/current-src/sys/arch/i386/compile/ZORKMID
 cpu0: family 6 model 8 step 1
 cpu0: Intel Pentium III (E) (686-class)
 total memory = 65088 KB
 avail memory = 55588 KB
 using 839 buffers containing 3356 KB of memory
 BIOS32 rev. 0 found at 0xfd880
 PCI BIOS rev. 2.1 found at 0xfd99e
 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))
 WARNING: can't reserve area for I/O APIC.
 pci_addr_fixup: 000:12:0 0x1180 0x0475 new address 0x04000000
 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
 com0: console
 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)
 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
 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
 pciide0: primary channel interrupting at irq 14
 wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
 pciide0: secondary channel wired to compatibility mode
 Mpciide0: 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 configur
 ed
 Sony CXD3222 OHCI i.LINK(IEEE 1394) PCI controller (Firewire serial bus, interface 0x10, revision 0x02) at pci0 dev 8 functio
 n 0 not configured
 ymf: legacy audio enabled
 Yamaha 744 (DS-1S) Audio (audio multimedia, revision 0x02) at pci0 dev 9 function 0 not configured
 Conexant Systems SoftK56 PCI Software Modem (miscellaneous communications, revision 0x01) at pci0 dev 10 function 0 not confi
 gured
 fxp0 at pci0 dev 11 function 0: Intel i82557 Ethernet, rev 8
 fxp0: interrupting at irq 9
 fxp0: Ethernet address 08:00:46:06:00:6b, 10/100 Mb/s
 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)
 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
 pms0 at pckbc0 (aux slot)
 pckbc0: using irq 12 for aux slot
 wsmouse0 at pms0 mux 0
 sb0 at isa0 port 0x220-0x237 irq 5 drq 1: dsp v3.01
 audio0 at sb0: half duplex, mmap, independent
 midi0 at sb0: SB MIDI UART
 opl0 at sb0: model OPL3
 midi1 at opl0: SB Yamaha OPL3
 pcppi0 at isa0 port 0x61
 midi2 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
 cbb0: interrupting at irq 9
 cbb0: cacheline 0x0 lattimer 0x20
 cbb0: bhlc 0x21000 lscp 0x20020200
 cardslot0 at cbb0 slot 0 flags 0
 cardbus0 at cardslot0: bus 2 device 0 cacheline 0x0, lattimer 0x20
 pcmcia0 at cardslot0
 apm0 at mainbus0: Power Management spec V1.2
 biomask ef4d netmask ef4d ttymask ffcf
 wdc2 at pcmcia0 function 0
 Breakpoint in cardslot0 at      _wdc_pcmcia_attach:     pushl   %ebp
 db> t
 _wdc_pcmcia_attach(c06f9a00,c0706600,cd5dbf5c,c0706600,cd5dbf5c) at _wdc_pcmcia_
 attach
 _config_attach(c06f9a00,c0462ed4,cd5dbf5c,c0421fcc,c0700300) at _config_attach+0
 x30a
 _config_found_sm(c06f9a00,cd5dbf5c,c0421fcc,c0421f88,c06d7500) at _config_found_
 sm+0x29
 _pcmcia_card_attach(c06f9a00) at _pcmcia_card_attach+0x10d
 _cardslot_event_thread(c06d7500) at _cardslot_event_thread+0x1e9
 Bad frame pointer: 0xc0553ea4
 db> u
 After 37 instructions (0 loads, 0 stores),
 Stopped in cardslot0 at _wdc_pcmcia_attach+0x68:        call    *%eax
 db> u
 After 26 instructions (0 loads, 0 stores),
 Stopped in cardslot0 at _pccbb_pcmcia_io_alloc+0x37:    call    _rbus_space_alloc
 db> n
 After 371 instructions (0 loads, 0 stores),
 Stopped in cardslot0 at _rbus_space_alloc+0x28: ret
 db> n
 After 17 instructions (0 loads, 0 stores),
 Stopped in cardslot0 at _pccbb_pcmcia_io_alloc+0x68:    ret
 db> n
 : TEAC IDE Card/II
 ~After 282429 instructions (0 loads, 0 stores),
 Stopped in cardslot0 at _Xdoreti+0x57:  iret
 db> t
 _cpu_Debugger(c06e3da0,c0101f28,c06d9000,c000ef4c,cd5d0010) at _cpu_Debugger+0x4
 
 _comintr(c06d9c00) at _comintr+0xcd
 _Xintr4() at _Xintr4+0x6c
 --- interrupt ---
 _pccbbintr(c06d9000) at _pccbbintr+0x12
 _Xintr9() at _Xintr9+0x70
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _gettick(c070ea7c,c070ea7c,c0761480,cd5dbd54,c016f7fa) at _gettick+0xcd
 _delay(3e8) at _delay+0x1c
 _wdcprobe(c070ea7c) at _wdcprobe+0x14e
 _wdcattach(c070ea7c,0,c0463f5c,c070ea00,c070ea7c) at _wdcattach+0x42
 _wdc_pcmcia_attach(c06f9a00,c070ea00,cd5dbf5c,c070ea00,cd5dbf5c) at _wdc_pcmcia_
 attach+0x2ca
 _config_attach(c06f9a00,c0462ed4,cd5dbf5c,c0421ffc,c0761a00) at _config_attach+0
 x30a
 _config_found_sm(c06f9a00,cd5dbf5c,c0421ffc,c0421fb8,c06d7500) at _config_found_
 sm+0x29
 _pcmcia_card_attach(c06f9a00) at _pcmcia_card_attach+0x10d
 _cardslot_event_thread(c06d7500) at _cardslot_event_thread+0x1e9
 Bad frame pointer: 0xc0553ea4
 db> 
 
 It would be nice to know what the bad fp was doing there.
 We seem to build up more and more interrupts
 as time goes by, producing things like:
 
 db> t
 _cpu_Debugger(c06d9c00) at _cpu_Debugger+0x5
 _Xintr4() at _Xintr4+0x6c
 --- interrupt ---
 _Xdoreti() at _Xdoreti
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _Xdoreti() at _Xdoreti+0x1b
 --- interrupt ---
 _eintrnames(5,0,cd5dbc5c) at _eintrnames+0xe
 _trap() at _trap+0x168
 --- trap (number 5) ---
 _Xdoreti() at _Xdoreti+0x7
 db> c      
 
 Pulling the card makes the problem stop and the system unhang.
 Setting wdcdebug_mask, and friends to all ones does not seem
 to produce any output prior to the hang.