Bug 64656

Summary: Bugs with Ethernet driver "bfe"
Product: Base System Reporter: Jianqin Qu <jqu>
Component: i386Assignee: freebsd-i386 (Nobody) <i386>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
tcp52.patch
none
if_bfe.c
none
bfe521.patch
none
if_bfe.c
none
tcp52.patch
none
if_bfe.c none

Description Jianqin Qu 2003-05-10 13:01:54 UTC
More tests showed that this problem does not appear every time at boot 
on my Dell Optiplex 160L.
 
I found a tempory workaround for that.  When the problem occurs, simply 
shut down your computer completely (not just switch off the power button 
on your computer, but also detach your power cable!!! )   and  wait for 
sufficiently long time  and  then restart your computer to boot into 
FreeBSD 5.2.1 directly.   Here sufficiently long time varies, but 30 
minutes seems sufficient for my case most of time.

If  you switch off your computer power button without unplugging the 
power cable and the LED light on the system board is on, then after some 
time (several hours) when you boot your computer into FreeBSD 5.2.1, 
this problem almost certainly occur.

Rebooting into FreeBSD 5.2.1 release from another operating system 
installed on the same box  may reproduce the problem too.  Particularly 
rebooting into FreeBSD from a Linux system with a NIC driver of version 
3.0.7 from BroadCom  always results in the occurence of this problem. 
When the problem occurs, the link and activity indicator of the NIC are 
both off.   So it seems the bfe driver fails to reset the NIC card to a 
correct state in some cases.

A patch with the bfe driver  is attached, which fixes the bug.  The 
patch is against 5.2.1 Release and had been tested with it.   The 
patched file "if_bfe.c" is also attached for reference.

Jianqin
Comment 1 Jianqin Qu 2004-03-24 13:30:21 UTC
Below is the ouput from "dmesg", whose bottom lines state the bug in bfe drivers in a very clear way by itself.


Copyright (c) 1992-2004 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 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004
    root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0a35000.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc0a35244.
ACPI APIC Table: <DELL   160L   >
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2392.29-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
real memory  = 259473408 (247 MB)
avail memory = 242401280 (231 MB)
ioapic0: Changing APIC ID to 1
ioapic0 <Version 2.0> irqs 0-23 on motherboard
Pentium Pro MTRR support enabled
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <DELL   160L   > on motherboard
pcibios: BIOS version 2.10
Using $PIR table, 7 entries at 0xc00feae0
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
acpi_cpu0: <CPU> on acpi0
acpi_cpu1: <CPU> on acpi0
device_probe_and_attach: acpi_cpu1 attach returned 6
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82845G (845G GMCH) SVGA controller> mem 0xfeb80000-0xfebfffff,0xe8000000-0xefffffff irq 16 at device 2.0 on pci0
agp0: detected 8060k stolen memory
agp0: aperture size is 128M
uhci0: <Intel 82801DB (ICH4) USB controller USB-A> port 0xff80-0xff9f irq 16 at device 29.0 on pci0
usb0: <Intel 82801DB (ICH4) USB controller USB-A> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <Intel 82801DB (ICH4) USB controller USB-B> port 0xff60-0xff7f irq 19 at device 29.1 on pci0
usb1: <Intel 82801DB (ICH4) USB controller USB-B> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2: <Intel 82801DB (ICH4) USB controller USB-C> port 0xff40-0xff5f irq 18 at device 29.2 on pci0
usb2: <Intel 82801DB (ICH4) USB controller USB-C> on uhci2
usb2: USB revision 1.0
uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
pci0: <serial bus, USB> at device 29.7 (no driver attached)
pcib1: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci1: <ACPI PCI bus> on pcib1
bfe0: <Broadcom BCM4401 Fast Ethernet> mem 0xfe9fe000-0xfe9fffff irq 17 at device 9.0 on pci1
bfe0: Ethernet address: 00:0b:db:b6:6f:5e
miibus0: <MII bus> on bfe0
bmtphy0: <BCM4401 10/100baseTX PHY> on miibus0
bmtphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH4 UDMA100 controller> port 0xffa0-0xffaf,0xed8c-0xed8f,0xed98-0xed9f,0xed88-0xed8b,0xed90-0xed97 mem 0xfeb7fc00-0xfeb7ffff irq 18 at device 31.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata0: [MPSAFE]
ata1: at 0x170 irq 15 on atapci0
ata1: [MPSAFE]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
pci0: <multimedia, audio> at device 31.5 (no driver attached)
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on acpi0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
sio0 port 0x3f8-0x3ff irq 4 on acpi0
sio0: type 16550A
ppc0 port 0x778-0x77f,0x378-0x37f irq 7 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
acpi_cpu1: <CPU> on acpi0
device_probe_and_attach: acpi_cpu1 attach returned 6
orm0: <Option ROMs> at iomem 0xcd000-0xcffff,0xcb800-0xccfff,0xc0000-0xcb7ff on isa0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 2392290076 Hz quality 800
Timecounters tick every 10.000 msec
GEOM: create disk ad0 dp=0xc2d0de60
ad0: 76293MB <ST380011A> [155009/16/63] at ata0-master UDMA100
acd0: CDROM <GCR-8481B> at ata1-master PIO4
Mounting root from ufs:/dev/ad0s4a
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.
bfe0: BUG!  Timeout waiting for bit 80000000 of register 428 to clear.

Fix: 

Bug-fix with "bfe" driver
How-To-Repeat: Install FreeBSD 5.2.1 (i386) to any machine with a Broadcom 4401 Ethernet card  and the problem arises when you boot FreeBSD
Comment 2 Jianqin Qu 2004-05-10 14:50:48 UTC
More tests showed that this problem does not appear every time at boot
on my Dell Optiplex 160L.

I found a tempory workaround for that.  When the problem occurs, simply
shut down your computer completely (not just switch off the power button
on your computer, but also detach your power cable!!! )   and  wait for
sufficiently long time  and  then restart your computer to boot into
FreeBSD 5.2.1 directly.   Here sufficiently long time varies, but 30
minutes seems sufficient for my case most of time.

If  you switch off your computer power button without unplugging the
power cable and the LED light on the system board is on, then after some
time (several hours) when you boot your computer into FreeBSD 5.2.1,
this problem almost certainly occur.

Rebooting into FreeBSD 5.2.1 release from another operating system
installed on the same box  may reproduce the problem too.  Particularly
rebooting into FreeBSD from a Linux system with a NIC driver of version
3.0.7 from BroadCom  always results in the occurence of this problem.
When the problem occurs, the link and activity indicator of the NIC are
both off.   So it seems the bfe driver fails to reset the NIC card to a
correct state in some cases.

A patch with the bfe driver  is attached, which fixes the bug.  The
patch is against 5.2.1 Release and had been tested with it.   The
patched file "if_bfe.c" is also attached for reference.

Jianqin
Comment 3 Jianqin Qu 2004-05-10 15:44:16 UTC
Sorry, the wrong files were ataached to last message. The correct
files for patches are attached to this message.

Jianqin
Comment 4 Jianqin Qu 2004-05-15 02:56:55 UTC
Sorry, the patch attached with previous message are either wrong
or somehow gargbled. So now I'm putting it on the URL:

     http://www.jexplore.com/~jqu/bfe_current.patch

The patch is made against FreeBSD-current, but it's tested to work
for FreeBSD-5.2.1-Release too. It should work for 5.2 as well.
Please check out and have a try. Just type:
    # cd /usr/src
    # patch < /path/bfe_current.patch


Jianqin Qu
Comment 5 Duncan Barclay freebsd_committer freebsd_triage 2004-05-23 09:40:08 UTC
State Changed
From-To: open->closed

Patch supplied commited to tree.