Subject: Fwd: Thinkpad 760XD PCMCIA problems?
To: None <port-i386@netbsd.org>
From: John D.Baker <jdbaker@mylinuxisp.com>
List: port-i386
Date: 11/05/2007 05:46:14
I've been trying to post this for several days, but my ISP's mail
server hits the greylist and doesn't retry, so I have to send it
again myself...

At long last, I've been able to revisit the problems I described in:

     http://mail-index.netbsd.org/port-i386/2007/03/14/0000.html

and related messages.

When I saw these:

     http://mail-index.netbsd.org/source-changes/2007/10/26/0058.html
     http://mail-index.netbsd.org/source-changes/2007/10/26/0061.html

a few days ago, I had hoped it might spell relief for, or at least
shed more light on the problems I was having.

Unfortunately, not only does it not solve the problems I was having,
it actually makes things very much worse.  But before filing a PR, I'd
like to hear thoughts and opinions on the situation.

The machine still can't bring up "cbb*":

[...]
NetBSD 4.0_RC3 (TANKPAD) #1: Mon Oct 29 17:19:24 CDT 2007
          
sysop@plexor.technoskunk.fur:/d0/build/netbsd-4/obj/i386/sys/arch/i386/ 
compile/TANKPAD
[...]
cbb0 at pci0 dev 2 function 0: Texas Instruments PCI1130 PCI-CardBus  
Bridge (rev
. 0x04)
cbb1 at pci0 dev 2 function 1: Texas Instruments PCI1130 PCI-CardBus  
Bridge (rev
. 0x04)
[...]
cbb0: bad Vcc request. sock_ctrl 0x0, sock_status 0x30000710
cbb0: disabling socket
new status 0x30000710
pci_intr_map: no mapping for pin A (line=ff)
cbb0: couldn't map interrupt
pci_intr_map: no mapping for pin B (line=ff)
cbb1: couldn't map interrupt
[...]

I have no clue why this is misbehaving.  The interrupts claim to be
configured at IRQ9 and IRQ10 in the DOS-based "PS2" setup utility
for the TP760XD.

And of course, there's no PCMCIA at all in this state.

As the note in the commit log suggests, to regain "pcic*" support, I
disabled cbb at boot:

 >> NetBSD/i386 BIOS Boot, Revision 3.3
 >> (sysop@jdb-test.cis.sac.accd.edu, Tue Jul 11 00:23:57 CDT 2006)
 >> Memory: 639/105472 k
 > boot netbsd.tst -sc
booting hd0a:netbsd.tst (howto 0x1002)
4865796+251236+247604 [292128+284806]=0x5abcdc
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 (TANKPAD) #1: Mon Oct 29 17:19:24 CDT 2007
          
sysop@plexor.technoskunk.fur:/d0/build/netbsd-4/obj/i386/sys/arch/i386/ 
compile/TANKPAD
[...]
userconf: configure system autoconfiguration:
uc> disable cbb
[ 85] cbb* disabled
uc> exit
Continuing...
[...]

But as soon as a PCMCIA card was found, the system crashed:

[...]
cd0(piixide0:0:1): using PIO mode 4, DMA mode 2 (using DMA)
pcmcia0: CIS version PC Card Standard 5.0
pcmcia0: CIS info: Compaq, Netelligent 10/100 PC Card, CPQ-10/100, 1.00
pcmcia0: Manufacturer code 0x183, product 0x10a
pcmcia0: function 0: network adapter, ccr addr 800 mask 3
pcmcia0: function 0, config table entry 1: I/O card; irq mask 8ebc;  
iomask 4, iospace 0-f; memspace 0-fff; mwait_required rdybsy_active io8  
io16 irqpulse irqlevel powerdown
xirc0 at pcmcia0 function 0: <Compaq, Netelligent 10/100 PC Card,  
CPQ-10/100, 1.00>
xirc0: id=0143
pcic0: port 0x300-0x30f
uvm_fault(0xc0619780, 0, 1) -> 0xe
kernel: supervisor trap page fault, code=0
Stopped in pid 4.1 (pcic0,0,0) at       netbsd:strlen+0x10:     movl     
0(%eax),
%ecx
db> bt
strlen(c05a038c,5,0,0,c930eac8) at netbsd:strlen+0x10
printf(c05a038c,1c,0,0,c098ab80) at netbsd:printf+0x35
pcmcia_intr_establish(c098ab80,7,c0247a60,c098fc00,400) at  
netbsd:pcmcia_intr_es
tablish+0x6b
ne_pcmcia_enable(c098fc00,c04813c0,c930eb3c,c0393076,10) at  
netbsd:ne_pcmcia_ena
ble+0x21
ne_pcmcia_attach(c0966800,c098fc00,c930ebcc,0,c03924f0) at  
netbsd:ne_pcmcia_atta
ch+0x73
config_attach_loc(c0966800,c05a7160,c930ebdc,c930ebcc,c047d220) at  
netbsd:config
_attach_loc+0x2e2
pcmcia_rescan(c0966800,c054a86d,c052654c,0,c096a8b0) at  
netbsd:pcmcia_rescan+0x8
f
pcmcia_card_attach(c0966800,0,c930ec6c,c047b66c,c047b5c0) at  
netbsd:pcmcia_card_
attach+0xad
pcic_attach_card(c096a8b0,2,0,246,0) at netbsd:pcic_attach_card+0x3f
pcic_event_thread(c096a8b0,0,c01002d2,fbff,c01002d2) at  
netbsd:pcic_event_thread
+0x1c3
db> sync
syncing disks... done

The same would occur whether a PCMCIA card was in the machine at boot
or if it was installed later.  All of the cards I knew to work before
this change failed in exactly the same way as shown.  The cards that
didn't work at all before continued to not work, in exactly the same
way as described in my original post in March 2007.

I have eventually characterized the behavior as follows:

If "cbb*" is ever allowed to attach/configure, rebooting and disabling
"cbb*" will always result in a crash, regardless of pcic* slot or card.

The only way to recover is to power-cycle the machine and make sure
"cbb" is disabled before booting.

And of course, omit "cbb* at pci?" from a kernel config entirely.

But I'd rather have working CardBus on my ThinkPad 760XD.

Thanks.

--
John D. Baker                            NetBSD     Darwin/MacOS X
http://mylinuxisp(dot)com/(tilde)jdbaker/     OpenBSD            FreeBSD
BSD.  It just sits there and _works_.
GPG fingerprint = D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645