Bug 257

Summary: Broadcom b44 driver won't work
Product: Drivers Reporter: Martin Imobersteg (imm)
Component: NetworkAssignee: Jeff Garzik (jgarzik)
Status: RESOLVED CODE_FIX    
Severity: high CC: bmc_, frlinux, simon
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.0-test1 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Fix link check in b44.c
Pekka Pietikainen's b44 fixes

Description Martin Imobersteg 2003-01-09 04:53:06 UTC
Exact Kernel version: 2.5.46
Distribution: Crux Linux 1.0
Hardware Environment: ASUS A7V8X with onboard Broadcom 4401 LAN 
Software Environment: gcc 3.2.1 / glibc 2.3.1
Problem Description: The NIC shows up as eth0 but can't ping anything else than
localhost. Kernel 2.4.20 with the Broadcom provided driver works. If i try to
build b44 as a module, it fails due to unresolved symbols. I can't build the
dummy driver as a module neither.

Steps to reproduce:
Comment 1 Martin Imobersteg 2003-01-09 04:59:25 UTC
Sorry, i meant 2.5.54 and just saw that 2.5.55 is out so i will give it a try
again.  
Comment 2 Martin Imobersteg 2003-01-16 06:27:40 UTC
Ok the install of module-init-tools fixed building as module but the driver 
still won't work on 2.5.58.
Is there something i can do to help fixing this bug other than fix it myself or 
pay someone to do it ?
The driver says nothing but "b44: link is down" but that says the Broadcom 
driver also while working just fine.
Comment 3 Alexander Kellett 2003-03-04 09:07:19 UTC
same here with gentoo distribution (gcc 3.2.2) 
and kernel 2.5.55, shall try .50 (before jeff's 
trivial cleanup's) tonight and report back. 
 
broadcom driver with 2.4.20 works well. 
not building as module with 2.5. same thing  
happens as the bug report, ("b44: link is down") 
 
any idea where to start debugging? 
davem's rewrite makes it actually 
readable code at least :) 
 
exact same motherboard, further info: 
  00:09.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01) 
eth1 (a via rhine) works perfectly. 
 
thanks, 
Alex 
Comment 4 Dave Jones 2003-03-24 20:19:51 UTC
Does the eth0 entry in /proc/interrupts increase when you transmit packets?
What happens if you boot with acpi=off noapic ? (or a combination of 1/the
other/all those options)
Comment 5 Martin Imobersteg 2003-03-25 07:32:50 UTC
The count goes up for about 5 per second.
For me it seems that the NIC is sending but cannont receive packets.

acpi=off and/or noapic didn't change anything.

I used 2.5.66 this time.
Comment 6 Francisco Calafat 2003-04-27 13:05:42 UTC
Same problem here.
Same hardware (ASUS A7V8X with onboard Broadcom 4401 LAN).
Debian Sid.
Kernel 2.5.68

Driver reports link is down, but link is up (LEDs on switch ok).
Pinging another machine returns nothing. Interrupts for eth0 increase at 1 per
second.
Ping's destination doesn't see packets (used TCPDUMP on remote host). LEDs on
switch don't blink, so there's no activity.
Tried pinging the other way around (from a remote machine to our 2.5.68 machine)
and local machine doesn't see packets (again using TCPDUMP).

Tried following kernel parameters:

noapic
Result: continuous message on console (APIC error on CPU0:40(40)). Nothing else
changes.

acpi=off
Result: new message when loading driver (IRQ for dev 00:09.0 doesn'match PIRQ
mask - try pci=usepirqmask). Nothing else changes.

noapic acpi=off
Result: doesn't work either

It all works fine with kernel 2.4.20 and Broadcom's drivers.
Comment 7 Amir C. Akhavan 2003-04-27 18:15:27 UTC
Hi! 

I've got the same problem on an Acer Travelmate 800 LCi (kernel 2.5.68-bk8), 
but I think I can point at something interesting:

I've compared the b44 behaviour with a PCMCIA NIC attached to the same laptop.
The only suspicious difference (for me) between the PCMCIA NIC and the Broadcom
NIC is in the output of lspic -vv and /proc/ioports:
The PCMCIA card has an additional Memory-Range plus an IO-Port
assigned (Region 2, and Region 1, respectively), whereas the Broadcom
has just one Memory-Range of 8k (see output of lspci -vv below). 
I can't see any IO-Port for the NIC at /proc/ioports either (see below).
But that might be alright as well, I just have no clue. 

I've also tried the noapic/acpi stuff - useless. 
2.4.20 + bcm4400 works.

I think I've already been too verbose, but in case something's missing,
please ask. 

thanks a lot,
Amir C. Akhavan

#################################################
The system:

Acer Travelmate 800 LCi
Pentium M 1.3GHz
Centrino chipset 

Broadcom 4401 onboard ethernet card.

PhoenixBIOS Version 3A15
ACPI

SuSE 8.1 (modified to match 2.5-kernels)
Kernel 2.5.68-bk8
gcc 3.2

from /var/log/messages:
Apr 27 00:57:25 nomad kernel: b44.c:v0.6 (Nov 11, 2002)
Apr 27 00:57:25 nomad kernel: eth0: Broadcom 4400 10/100BaseT Ethernet
00:c0:9f:16:2d:e7
...
Apr 27 00:57:25 nomad kernel: b44: eth0: Link is down.


nomad:~ # ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:C0:9F:16:2D:E7  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:88 errors:0 dropped:85 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:5677 (5.5 Kb)  TX bytes:3968 (3.8 Kb)
          Interrupt:5 

nomad:~ # cat /proc/interrupts 
           CPU0       
  0:    1175386          XT-PIC  timer
  1:       1012          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  5:        418          XT-PIC  eth0, uhci-hcd
  9:         44          XT-PIC  acpi
 10:      54256          XT-PIC  Intel 82801DB-ICH4, PCI device 1217:7114 (O2
Micro, Inc.), PCI device 1217:7114 (O2 Micro, Inc.), ehci-hcd, uhci-hcd, uhci-hcd
 12:        215          XT-PIC  i8042
 14:      32149          XT-PIC  ide0
 15:          8          XT-PIC  ide1
NMI:          0 
ERR:          0

nomad:~ # lspci -vv
02:02.0 Ethernet controller: Broadcom Corporation: Unknown device 4401 (rev 01)
        Subsystem: Acer Incorporated [ALI]: Unknown device 001f
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ <TAbort-
<MAbort- >SERR- <PERR-
        Latency: 64
        Interrupt: pin A routed to IRQ 5
        Region 0: Memory at d0204000 (32-bit, non-prefetchable) [size=8K]
        Expansion ROM at <unassigned> [disabled] [size=32K]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=2 PME-

for comparison:
03:00.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 0d)
        Subsystem: Intel Corp. EtherExpress PRO/100 S Mobile Adapter
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (2000ns min, 14000ns max)
        Interrupt: pin A routed to IRQ 10
        Region 0: Memory at d0320000 (32-bit, non-prefetchable) [size=4K]
        Region 1: I/O ports at 4400 [size=64]
        Region 2: Memory at d0300000 (32-bit, non-prefetchable) [size=128K]
        Capabilities: [dc] Power Management version 2
                Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=2 PME-

nomad:~ # cat /proc/iomem  (the PCMCIA NIC is not attached)
00000000-0009f7ff : System RAM
0009f800-0009ffff : reserved
000a0000-000bffff : Video RAM area
000d0000-000d17ff : Extension ROM
000f0000-000fffff : System ROM
00100000-1ff6ffff : System RAM
  00100000-0027c507 : Kernel code
  0027c508-00323203 : Kernel data
1ff70000-1ff7afff : ACPI Tables
1ff7b000-1ff7ffff : ACPI Non-volatile Storage
1ff80000-1fffffff : reserved
20000000-200003ff : PCI device 8086:24ca (Intel Corp.)
20001000-20001fff : PCI device 1217:7114 (O2 Micro, Inc.)
20400000-207fffff : PCI CardBus #07
20800000-20bfffff : PCI CardBus #07
d0000000-d00003ff : Intel Corp. 82801DB USB EHCI Con
  d0000000-d00003ff : ehci-hcd
d0000800-d00008ff : Intel Corp. 82801DB AC'97 Audio
  d0000800-d00008ff : Intel 82801DB-ICH4 - Controller
d0000c00-d0000dff : Intel Corp. 82801DB AC'97 Audio
  d0000c00-d0000dff : Intel 82801DB-ICH4 - AC'97
d0100000-d01fffff : PCI Bus #01
  d0100000-d010ffff : ATI Technologies Inc Radeon R250 Lf [Rade
d0200000-d0203fff : Texas Instruments TSB43AB21 IEEE-1394a
d0204000-d0205fff : Broadcom Corporation BCM4401 100Base-T
  d0204000-d0205fff : b44
d0206000-d0206fff : PCI device 8086:1043 (Intel Corp.)
d0207000-d0207fff : PCI device 1217:7114 (O2 Micro, Inc.)
d0208000-d0208fff : PCI device 1217:7110 (O2 Micro, Inc.)
d0209000-d02097ff : Texas Instruments TSB43AB21 IEEE-1394a
d0300000-d03fffff : PCI CardBus #03
d0400000-d04fffff : PCI CardBus #03
d8000000-dfffffff : PCI Bus #01
  d8000000-dfffffff : ATI Technologies Inc Radeon R250 Lf [Rade
e0000000-efffffff : PCI device 8086:3340 (Intel Corp.)
ff800000-ffbfffff : reserved
fff00000-ffffffff : reserved

cat /proc/ioports (the PCMCIA NIC is not attached)

0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
02f8-02ff : serial
0376-0376 : ide1
03c0-03df : vga+
03f6-03f6 : ide0
0cf8-0cff : PCI conf1
1000-10ff : PCI CardBus #07
1400-14ff : PCI CardBus #07
1800-181f : Intel Corp. 82801DB USB (Hub #1)
  1800-181f : uhci-hcd
1820-183f : Intel Corp. 82801DB USB (Hub #2)
  1820-183f : uhci-hcd
1840-185f : Intel Corp. 82801DB USB (Hub #3)
  1840-185f : uhci-hcd
1860-186f : PCI device 8086:24ca (Intel Corp.)
  1860-1867 : ide0
  1868-186f : ide1
1880-189f : Intel Corp. 82801DB SMBus
18c0-18ff : Intel Corp. 82801DB AC'97 Audio
1c00-1cff : Intel Corp. 82801DB AC'97 Audio
2000-207f : Intel Corp. 82801DB AC'97 Modem
2400-24ff : Intel Corp. 82801DB AC'97 Modem
3000-3fff : PCI Bus #01
  3000-30ff : ATI Technologies Inc Radeon R250 Lf [Rade
4000-40ff : PCI CardBus #03
4400-44ff : PCI CardBus #03
Comment 8 walt 2003-05-18 19:45:02 UTC
Those of you with the ASUS A7V8X motherboard -- (mine is the 
Broadcom BCM5702X Gigabit Ethernet, ASIC rev. 0x1002) --  what
do you see if you do an 'ifconfig eth0 down' followed by an
'ifconfig eth0 up'.  (You will most likely need to re-add the
default route to your routing table after that.  Or instead,
just use your /etc/rc.d or /etc/init.d scripts to restart the
network.  e.g. for me it's just '/etc/init.d/net.eth0 restart'
in Gentoo linux, but yours will probably be a bit different.)

I find that the chip starts working normally at that point
and continues to work until the next reboot.
Comment 9 Stefano Fedrigo 2003-05-24 09:55:53 UTC
Created attachment 372 [details]
Fix link check in b44.c

I have a ASUS A7V8X motherboard with bcm4401, 2.5.69-ac1 kernel, driver
compiled as a 
module. As soon as I do an "ifconfig eth0... " the kernel reports "b44: eth0:
Link is down.". The 
link led is ON... 
Comparing the source with the original Broadcom code I found what I think is an
error: in 
b44_check_phy(), the check for the link going down should be done against the 
BMSR_LSTATUS bit, as in the previous if statement (the one testing if the link
is going up). 
 
However this fix alone doesn't solve the problem, but it is a safe bet to
apply, since the original 
2.4 driver works that way.
Comment 10 FRLinux 2003-06-28 04:26:08 UTC
I confirm that this is a critical bug, the interface goes up and down less than
2 seconds after. It is still valid on 2.5.73

FRLinux
Comment 11 Simon Watson 2003-07-14 11:58:52 UTC
I can report this bug still occuring on kernel 2.5.75.
Comment 12 FRLinux 2003-07-14 16:40:15 UTC
Argh, this is still happening in 2.6.0-test1, please don't tell me i need to
stick a new network card in my box ...

i got around the link down stuff by comparing the bcm4400 driver provided with
my Asus motherboard and your 2.5/6 sources, but still it doesn't work ...

FRLinux
Comment 13 Jeff Garzik 2003-07-14 16:49:37 UTC
Created attachment 538 [details]
Pekka Pietikainen's b44 fixes
Comment 14 Jeff Garzik 2003-07-14 16:50:34 UTC
Will apply Pekka's fixes soon (see attachment).
Comment 15 FRLinux 2003-07-14 17:44:43 UTC
Ok, applied those to my 2.6.0, good news is it works very nicely, i'm currently
writing to you using 2.6.0-test1. The only thing is if you ever restart
networking, you lose the network completely, then have to stop network, unload
module, reload then start network and all is happy again.

FRLinux
Comment 16 bmc 2003-07-20 23:47:42 UTC
*** Bug 970 has been marked as a duplicate of this bug. ***
Comment 17 Bruce Stephens 2003-09-15 14:59:50 UTC
I'm still seeing b44 not working, with 2.6.0-test5-mm2.  /proc/interrupts shows
maybe 10 interrupts, and that seems to go up slowly if at all when I try pinging
anything.  Shutting down the network and bringing it up again doesn't seem to 
help, and neither does unloading and reloading the module.

Basically it seems dead.  This is with an ASUS A7V8X, Broadcom 4401.  Works fine
with the Broadcom supplied driver with 2.4.22.

Is this supposed to be fixed in 2.6.0-test5, or should I have applied some patch?
Comment 18 Pekka Pietikainen 2003-10-24 06:45:06 UTC
Do the issues you are seeing still exist in 2.6.0-test8 (b44.c 0.91)
or can this bug be closed completely?
Comment 19 FRLinux 2003-10-24 15:16:32 UTC
It is all working good on my asus a7v8x.

Steph
Comment 20 Martin J. Bligh 2003-11-26 16:15:24 UTC
Jeff, looks like this is all cleaned up and merged. Can we close it?
Comment 21 Ludovic Drolez 2004-03-05 02:19:29 UTC
No, I still have problems with my 2.6.2.
Is it the same bug http://bugzilla.kernel.org/show_bug.cgi?id=664 ?