Bug 31084

Summary: xe driver device probe fails in CIS tuple scan
Product: Base System Reporter: sebster <sebster>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.4-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
xe-patch none

Description sebster 2001-10-06 15:10:00 UTC
After upgrading from 4.3-STABLE to 4.4-STABLE on my laptop, FreeBSD
no longer recognizes my Xircom CEM56 ethernet card/modem. There were
no changes to the kernel config or pccardd config. Checking CVSWeb,
there are indeed no changes even to the files in /usr/src/sys/dev/xe.

The problem occurs in the xe_probe routine in if_xe.c. When xe_probe
scans the CIS tuples the first tuple returned is the 0xFF terminator
tuple. No real tuples are found, causing driver allocation to fail.
When using pccard dumpcis, the tuples on the card are returned, and
I get the following output:

Code 136 not found
Code 136 not found
code Unknown ignored
Code 138 not found
Code 138 not found
code Unknown ignored
Code 139 not found
Code 139 not found
code Unknown ignored
Configuration data for card in slot 0
Tuple #1, code = 0x1 (Common memory descriptor), length = 2
    000:  00 ff
        Common memory device information:
                Device number 1, type No device, WPS = OFF
                Speed = No speed, Memory block size = reserved, 32 units
Tuple #2, code = 0x17 (Attribute memory descriptor), length = 2
    000:  00 ff
        Attribute memory device information:
                Device number 1, type No device, WPS = OFF
                Speed = No speed, Memory block size = reserved, 32 units
Tuple #3, code = 0x15 (Version 1 info), length = 59
    000:  05 00 58 69 72 63 6f 6d 00 43 72 65 64 69 74 43
    010:  61 72 64 20 45 74 68 65 72 6e 65 74 20 31 30 2f
    020:  31 30 30 20 2b 20 4d 6f 64 65 6d 20 35 36 00 43
    030:  45 4d 35 36 00 31 2e 30 30 00 ff
        Version = 5.0, Manuf = [Xircom], card vers = [CreditCard Ethernet 10/100 + Modem 56]
        Addit. info = [CEM56],[1.00]
Tuple #4, code = 0x0 (Null tuple), length = 8
    000:  6a 10 f1 00 00 00 00 00
Tuple #5, code = 0x20 (Manufacturer ID), length = 5
    000:  05 01 0a 11 46
        PCMCIA ID = 0x105, OEM ID = 0x110a
Tuple #6, code = 0x44 (Card init date), length = 4
    000:  aa 8e d8 24
Tuple #7, code = 0x1a (Configuration map), length = 5
    000:  01 3f 80 ff 67
        Reg len = 2, config register addr = 0xff80, last config = 0x3f
        Registers: XXX--XX- 
Tuple #8, code = 0x1b (Configuration entry), length = 20
    000:  e7 c1 9d 0f 55 4d 5d 4e e0 17 17 ea 60 e8 02 07
    010:  f0 bc 8e 20
        Config index = 0x27(default)
        Interface byte = 0xc1 (I/O)  +RDY/-BSY active, wait signal supported
        Vcc pwr:
                Nominal operating supply voltage: 5 x 1V
                Minimum operating supply voltage: 4.5 x 1V
                Maximum operating supply voltage: 5.5 x 1V
                Continuous supply current: 4.5 x 100mA
        Wait scale Speed = 1.2 x 10 ms
        RDY/BSY scale Speed = 1.2 x 10 ms
        Card decodes 10 address lines, full 8/16 Bit I/O
                I/O address # 1: block start = 0x2e8 block length = 0x8
                IRQ modes: Level, Pulse, Shared
                IRQs:  2 3 4 5 7 9 10 11 15
        Max twin cards = 0
        Misc attr: (Power down supported)
Tuple #9, code = 0x1b (Configuration entry), length = 7
    000:  1f 08 ea 60 e8 03 07
        Config index = 0x1f
        Card decodes 10 address lines, full 8/16 Bit I/O
                I/O address # 1: block start = 0x3e8 block length = 0x8
Tuple #10, code = 0x1b (Configuration entry), length = 7
    000:  17 08 ea 60 f8 02 07
        Config index = 0x17
        Card decodes 10 address lines, full 8/16 Bit I/O
                I/O address # 1: block start = 0x2f8 block length = 0x8
Tuple #11, code = 0x1b (Configuration entry), length = 7
    000:  0f 08 ea 60 f8 03 07
        Config index = 0xf
        Card decodes 10 address lines, full 8/16 Bit I/O
                I/O address # 1: block start = 0x3f8 block length = 0x8
Tuple #12, code = 0x1b (Configuration entry), length = 3
    000:  3f 08 63
        Config index = 0x3f
        Card decodes 3 address lines, full 8/16 Bit I/O
Tuple #13, code = 0x21 (Functional ID), length = 2
    000:  02 00
        Serial port/modem
Tuple #14, code = 0x22 (Functional EXT), length = 4
    000:  00 02 0f 5c
        Serial interface extension:
                16550 UART, Parity - Space,Mark,Odd,Even
                Data bit - 7bit,8bit, Stop bit - 1bit,2bit
Tuple #15, code = 0x22 (Functional EXT), length = 12
    000:  02 06 00 3f 1c 03 03 0f 07 00 01 b5
        Data modem services available:
Tuple #16, code = 0x22 (Functional EXT), length = 8
    000:  13 06 00 0b 00 02 00 b5
        Fax1/modem services available:
Tuple #17, code = 0x21 (Functional ID), length = 2
    000:  06 00
        Network/LAN adapter
Tuple #18, code = 0x22 (Functional EXT), length = 8
    000:  04 06 00 10 a4 f1 10 6a
        Network node ID: 00 10 a4 f1 10 6a
Tuple #19, code = 0x0 (Null tuple), length = 12
    000:  39 30 30 31 48 44 46 31 31 30 36 41
Tuple #20, code = 0x0 (Null tuple), length = 4
    000:  01 00 00 00
Tuple #21, code = 0x14 (No link), length = 0
Tuple #22, code = 0xff (Terminator), length = 0
2 slots found

How-To-Repeat: Not sure. Only thing I know is that the ONLY change I made to the
system was an upgrade from 4.3-STABLE to 4.4-STABLE. Nothing else
changed whatsoever. Unless it is my SPECIFIC hardware configuration
which causes the problem the CEM56 card should no longer work under
4.4. Here is a dump of my dmesg to be sure:
Copyright (c) 1992-2001 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 4.4-STABLE #41: Fri Oct  5 12:30:24 CEST 2001
    root@roo.sebster.com:/usr/src/sys/compile/ROO
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium/P55C (quarter-micron) (233.29-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x581  Stepping = 1
  Features=0x8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX>
real memory  = 100794368 (98432K bytes)
avail memory = 94142464 (91936K bytes)
Preloaded elf kernel "kernel" at 0xc03d7000.
Intel Pentium detected, installing workaround for F00F bug
VESA: v2.0, 2048k memory, flags:0x0, mode table:0xc0361b40 (1000040)
VESA: CHIPS 6x555 Super VGA
md0: Malloc disk
Using $PIR table, 4 entries at 0xc00f8e80
apm0: <APM BIOS> on motherboard
apm: found APM BIOS v1.2, connected at v1.2
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pci0: <Chips & Technologies 65555 SVGA controller> at 4.0
ohci0: <NEC uPD 9210 USB controller> mem 0xfcfff000-0xfcffffff irq 11 at device 11.0 on pci0
usb0: OHCI version 1.0
usb0: <NEC uPD 9210 USB controller> on ohci0
usb0: USB revision 1.0
uhub0: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
chip1: <Toshiba Fast Infra Red controller> port 0xffe0-0xffff irq 11 at device 17.0 on pci0
pci_cfgintr_virgin: using routable interrupt 3
pci_cfgintr: 0:19 INTA routed to irq 3
pcic0: <Toshiba ToPIC97 PCI-CardBus Bridge> irq 3 at device 19.0 on pci0
pcic0: PCI Memory allocated: 0x44000000
pccard0: <PC Card bus (classic)> on pcic0
pci_cfgintr_search: linked (1) to configured irq 3 at 0:19:0
pci_cfgintr: 0:19 INTB routed to irq 3
pcic1: <Toshiba ToPIC97 PCI-CardBus Bridge> irq 3 at device 19.1 on pci0
pcic1: PCI Memory allocated: 0x44001000
pccard1: <PC Card bus (classic)> on pcic1
isa0: <ISA bus> on motherboard
orm0: <Option ROM> at iomem 0xc0000-0xc97ff on isa0
fdc0: <NEC 765 or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ata0 at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0
ata1 at port 0x170-0x177,0x376 irq 15 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model GlidePoint, device ID 0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/16 bytes threshold
ppi0: <Parallel I/O> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
plip0: <PLIP network interface> on ppbus0
pcm0: <OPL3-SAx (YMF719)> at port 0x530-0x537,0x370-0x371,0xf8c-0xf94,0xe0e irq 5 drq 1 flags 0xc110 on isa0
IP Filter: v3.4.20 initialized.  Default = block all, Logging = enabled
pccard: card inserted, slot 0
pccard: card inserted, slot 0
ata1-slave: ata_command: timeout waiting for intr
ata1-slave: identify failed
ad0: 3909MB <TOSHIBA MK4006MAV> [7944/16/63] at ata0-master BIOSPIO
acd0: CDROM <CD-220EA> at ata1-master using BIOSPIO
Mounting root from ufs:/dev/ad0s2a
xe0: xe: Probing
xe0: Set RES flags
xe0: Grep through CIS
xe0: Got type: 255
xe0: Done checking CIS

This is with XE_DEBUG defined as 1000, and several extra debug messages
added by me. As you can see, the only CIS tuple it finds is type 255,
the terminator.
Comment 1 Joseph Koshy freebsd_committer freebsd_triage 2001-10-08 06:20:23 UTC
Responsible Changed
From-To: freebsd-bugs->imp

<imp> handles this driver.
Comment 2 Joseph Koshy freebsd_committer freebsd_triage 2001-10-10 05:56:56 UTC
Warner Losh <imp@freebsd.org> was kind enough to forward the following
patch. This works on a HP Omnibook 900, but not on an HP mnibook 6000.

An immediate workaround is to use a 4.3-STABLE kernel before Aug 14 2001.

Koshy
<jkoshy@freebsd.org>
Comment 3 Warner Losh 2001-10-10 07:25:42 UTC
In message <200110100500.f9A503x43054@freefall.freebsd.org> Joseph Koshy writes:
:  Warner Losh <imp@freebsd.org> was kind enough to forward the following
:  patch. This works on a HP Omnibook 900, but not on an HP mnibook 6000.
:  
:  An immediate workaround is to use a 4.3-STABLE kernel before Aug 14 2001.

One bandaid would be to set machdep.pccard.mem_start to be 0xd0000
rather than 0xa0000 that it is now.  That may have been a bad choice.

There are other issues, but that's one way around it.

Warner
Comment 4 Murray Stokely freebsd_committer freebsd_triage 2001-10-10 07:54:50 UTC
  The xl driver on -CURRENT recently started failing as well.  This
device has been working fine for 6 months.  I haven't narrowed down
when exactly this broke but I assume the problem is known.  If you
need more details then I can debug this further.  The laptop in
question will also be at BSDCon Europe next month if you need to look
at the problem further.

Dell Inspiron 7000
3Com 3C575 Adapter (Dell branded)

TUPLE: LINKTARGET[3]: 43 49 53
Manufacturer ID: 01015752
TUPLE: CONFIG_CB [6]: 03 01 00 00 00 00
TUPLE: CFTABLE_ENTRY_CB [13]: 41 9a 01 b5 1e 01 b5 1e 02 30 ff ff 01
cardbus1: Opening BAR: type=IO, bar=10, len=0040
Product version: 5.0
Product name: 3Com Corporation | 3CCFE575CT | LAN Cardbus Card | 004 |
Functions: Network Adaptor, Memory
CIS reading done
cardbus1: Resource not specified in CIS: id=14, size=80
cardbus1: Resource not specified in CIS: id=18, size=80
cardbus1: Non-prefetchable memory at 44000000-440000ff
cardbus1: Non-prefetchable memory rid=14 at 44000000-4400007f (80)
cardbus1: Non-prefetchable memory rid=18 at 44000000-440000ff (80)
cardbus1: IO port at 1080-10bf
cardbus1: IO port rid=10 at 1080-10bf
xl0: <3Com 3c575C Fast Etherlink XL> port 0x1080-0x10bf mem 0x44000000-0x4400007f,0x44000080-0x440000ff irq 11 at device 0.0 on cardbus1
xl0: Ethernet address: 00:50:da:31:1a:0e
xl0: no PHY found!
device_probe_and_attach: xl0 attach returned 6
cardbus1: release_all_resource: Resource still owned by child,
oops. (type=3, rid=24, addr=44000000)
pccbb1: pccbb_power: CARD_VCC_0V and CARD_VPP_0V [44]
pccbb1: card activation failed

	- Murray
Comment 5 Warner Losh 2001-10-10 08:29:38 UTC
In message <20011009235450.D25329@windriver.com> Murray Stokely writes:
: 
:   The xl driver on -CURRENT recently started failing as well.  This
: device has been working fine for 6 months.  I haven't narrowed down
: when exactly this broke but I assume the problem is known.  If you
: need more details then I can debug this further.  The laptop in
: question will also be at BSDCon Europe next month if you need to look
: at the problem further.

That's completely differnt.

also, the problem is likely due to the spamage of cardbus by jon
chen's latest commits.  I've not even had a chance to catch up to
those changes.  I'll be looking into them over the next few weeks.

please file a different pr for this.

Warner
Comment 6 Joseph Koshy freebsd_committer freebsd_triage 2001-10-10 09:46:23 UTC
> One bandaid would be to set machdep.pccard.mem_start to be 0xd0000
> rather than 0xa0000 that it is now.

For the record, this brings up the Xircom card successfully on 
the Omnibook 6000.

For those who are reading the PR logs: you can add the following line
to "/etc/sysctl.conf" and have this automatically set at boot time.

"/etc/sysctl.conf"
---CUT-HERE---
machdep.pccard.mem_start=0xd0000
---CUT-HERE---

Alternately, after the machine has booted, run the following as "root":

	# sysctl machdep.pccard.mem_start=0xd0000

Koshy
<jkoshy@freebsd.org>
Comment 7 Warner Losh freebsd_committer freebsd_triage 2002-09-30 01:03:06 UTC
State Changed
From-To: open->closed

A number of things have conspired to make this problem 
go away.  Current's driver doesn't suffer from this 
problem.  And the default range to use is safer.