Bug 7487 - (net sundance) driver fails to recognize carrier status
Summary: (net sundance) driver fails to recognize carrier status
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Jeff Garzik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-10 08:18 UTC by Dan Nicholson
Modified: 2009-03-18 08:51 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.19-rc5/2.6.18.x
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg with loglevel=7 and sundance.debug=7 on 2.6.19-rc5 (13.95 KB, text/plain)
2006-11-10 08:20 UTC, Dan Nicholson
Details
Set carrier status on link changed events (4.62 KB, patch)
2008-04-05 00:11 UTC, Dan Nicholson
Details | Diff

Description Dan Nicholson 2006-11-10 08:18:07 UTC
Most recent kernel where this bug did not occur: Don't know. Only began checking
on 2.6.17, and it didn't work there.

Distribution: Linux from Scratch

Hardware Environment: PIII 500.

$ lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge
(rev 03)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge
(rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:0c.0 Multimedia audio controller: Yamaha Corporation YMF-724F [DS-1 Audio
Controller] (rev 03)
00:0e.0 USB Controller: NEC Corporation USB (rev 43)
00:0e.1 USB Controller: NEC Corporation USB (rev 43)
00:0e.2 USB Controller: NEC Corporation USB 2.0 (rev 04)
00:0f.0 Ethernet controller: D-Link System Inc DL10050 Sundance Ethernet (rev 12)
00:10.0 Serial controller: 3Com Corp, Modem Division 56K FaxModem Model 5610
(rev 01)
01:00.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200 PRO]
(rev 01)
01:00.1 Display controller: ATI Technologies Inc RV280 [Radeon 9200 PRO]
(Secondary) (rev 01)

Software Environment:

Linux silky 2.6.18.1-1 #1 PREEMPT Wed Oct 18 18:04:39 PDT 2006 i686 pentium3
i386 GNU/Linux

Gnu C                  4.0.3
Gnu make               3.80
binutils               2.16.1
util-linux             2.12r
mount                  2.12r
module-init-tools      3.2.2
e2fsprogs              1.38
Linux C Library        2.3.6
Dynamic linker (ldd)   2.3.6
Linux C++ Library      6.0.7
Procps                 3.2.6
Net-tools              1.60
Kbd                    1.12
Sh-utils               5.94
udev                   096
Modules Loaded         radeon drm ipv6 ipt_REJECT xt_tcpudp iptable_nat ip_nat
ipt_LOG xt_state ip_conntrack_ftp ip_conntrack nfnetlink iptable_filter
ip_tables x_tables binfmt_misc nls_iso8859_1 nls_cp437 vfat fat joydev usbhid
usblp snd_ymfpci gameport snd_ac97_codec snd_ac97_bus snd_pcm_oss snd_mixer_oss
snd_pcm snd_opl3_lib snd_timer snd_hwdep snd_page_alloc snd_mpu401_uart
snd_rawmidi snd_seq_device evdev snd sundance intel_agp soundcore agpgart
ehci_hcd mii uhci_hcd ohci_hcd dm_crypt dm_mod fuse

Problem Description:

Using the D-Link 550-TX with the sundance driver fails to change the carrier
status when plugging/unplugging network cable. Some userspace stats:

# cat /sys/class/net/eth0/carrier
1
# ip link show eth0
2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc pfifo_fast
qlen 1000
    link/ether 00:05:5d:e5:ae:08 brd ff:ff:ff:ff:ff:ff
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:05:5D:E5:AE:08
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:608 (608.0 b)  TX bytes:7777 (7.5 Kb)
          Interrupt:10 Base address:0x1000
# grep . /sys/class/net/eth0/*
/sys/class/net/eth0/address:00:05:5d:e5:ae:08
/sys/class/net/eth0/addr_len:6
/sys/class/net/eth0/broadcast:ff:ff:ff:ff:ff:ff
/sys/class/net/eth0/carrier:1
/sys/class/net/eth0/dormant:0
/sys/class/net/eth0/features:0x0
/sys/class/net/eth0/flags:0x1023
/sys/class/net/eth0/ifindex:2
/sys/class/net/eth0/iflink:2
/sys/class/net/eth0/link_mode:0
/sys/class/net/eth0/mtu:1500
/sys/class/net/eth0/operstate:unknown
/sys/class/net/eth0/tx_queue_len:1000
/sys/class/net/eth0/type:1
grep: /sys/class/net/eth0/uevent: Permission denied
/sys/class/net/eth0/weight:0

These are all exactly the same when the cable is unplugged.

Steps to reproduce:

Bring up network interface, unplug cable. Carrier status doesn't change.
Comment 1 Dan Nicholson 2006-11-10 08:20:40 UTC
Created attachment 9452 [details]
dmesg with loglevel=7 and sundance.debug=7 on 2.6.19-rc5
Comment 2 Natalie Protasevich 2007-07-19 22:29:16 UTC
Has it been any progress on this, have you tested with 2.6.22+?
Thanks.
Comment 3 Andrew Morton 2007-07-25 14:08:49 UTC
I have asked Jesse Huang <jesse@icplus.com.tw> if he can
take a look at this report.
Comment 4 Dan Nicholson 2007-08-09 14:26:44 UTC
Status is the same on 2.6.22.1.
Comment 5 Natalie Protasevich 2008-04-04 09:23:39 UTC
There were relevant fixes to sundance since. Dan can you please update/retest with recent kernel.
Thanks.
Comment 6 Dan Nicholson 2008-04-04 09:41:19 UTC
Great. How recent? 2.6.24.x or 2.6.25-rcx?
Comment 7 Natalie Protasevich 2008-04-04 09:55:38 UTC
I'd say the latest (.25-rc), or the newest git. I would try the latest stable too,  if 2.6.25.XX worked.
Comment 8 Dan Nicholson 2008-04-05 00:11:45 UTC
Created attachment 15609 [details]
Set carrier status on link changed events

Turns out this was pretty easy to enable. Copied some code from dl2k to check the MII link status on link change events and then call netif_carrier_on/off. Patch is against Linus' git. It could be more useful, but this is enough to get the change reported to userspace.
Comment 9 Dan Nicholson 2008-04-05 00:16:36 UTC
Should I send this patch to linux-net?
Comment 10 Andrew Morton 2008-04-05 00:26:47 UTC
Please email it to netdev@vger.kernel.org and cc myself and
Jeff Garzik <jeff@garzik.org>, thanks.

Note You need to log in before you can comment on or make changes to this bug.