Date: Fri, 2 Jan 2004 08:16:05 -0800 (PST) From: David Wolfskill <david@catwhisker.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: wpaul@FreeBSD.org Subject: kern/60824: No driver associated with Realtek 8129-based NIC Message-ID: <200401021616.i02GG50j000783@freebeast.catwhisker.org> Resent-Message-ID: <200401021620.i02GKMOQ058152@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 60824 >Category: kern >Synopsis: No driver associated with Realtek 8129-based NIC >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 02 08:20:22 PST 2004 >Closed-Date: >Last-Modified: >Originator: David Wolfskill >Release: FreeBSD 5.2-CURRENT i386 >Organization: Wolfskill & Dowling Residence >Environment: System: FreeBSD freebeast.catwhisker.org 5.2-CURRENT FreeBSD 5.2-CURRENT #54: Fri Jan 2 07:11:30 PST 2004 root@freebeast.catwhisker.org:/common/S4/obj/usr/src/sys/FREEBEAST i386 Also (excerpted from dmesg output): pcib0: matched entry for 0.9.INTA (source ) pcib0: device is hardwired to IRQ 16 found-> vendor=0x10ec, dev=0x8129, revid=0x00 bus=0, slot=9, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0200, cachelnsz=0 (dwords) lattimer=0x20 (960 ns), mingnt=0x20 (8000 ns), maxlat=0x40 (16000 ns) intpin=a, irq=16 map[10]: type 4, range 32, base 0100c400, size 7, enabled map[14]: type 1, range 32, base d9000000, size 7, enabled map[18]: type 1, range 32, base 01000000, size 24, enabled map[1c]: type 1, range 32, base 01000000, size 24, enabled map[20]: type 1, range 32, base 01000000, size 24, enabled map[24]: type 1, range 32, base 01000000, size 24, enabled ... rl0: <RealTek 8129 10/100BaseTX> port 0xc000-0xc07f mem 0xda401000-0xda40107f ir q 16 at device 9.0 on pci0 rl0: Ethernet address: 00:80:c6:f9:08:58 miibus0: <MII bus> on rl0 rlphy0: <RealTek internal media interface> on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto rl0: bpf attached [This last is *after* the below patch is applied; before, the PCI probe sees the device, but no driver attaches.] >Description: Following the mid-September, 2003 breakout of the "re" driver from the "rl" driver, (at least some) Realtek 8129-based NICs no longer have a driver associated with them (despite probing OK). The card had been working since August, 2000 in both -CURRENT and -STABLE; it never stopped working in -STABLE. With the below patch, it works again in -CURRENT (but I don't have a way to know if the patch makes things worse for other Realtek-based NICs, since I don't have any). I apologize if I overly-inflated the severity of the problem; it is certainly "serious" for machines with such cards. Then again, since I had mentioned the problem in -current@ a few times, but saw no indication that anyone else saw the problem, maybe I'm the only person in the world trying to run a recent -CURRENT on a box with an 8129-based NIC.... :-/ Anyhow, I decided that filing a PR would probably be a better way to help track the issue to resolution (than merely bugging folks privately). >How-To-Repeat: Boot up a machine running unpatched FreeBSD-CURRENT as of a date after about 08 September, 2003, that has a Realtek 8129-based NIC in it. Specifically, one that has a "hwrev" of 0x00, since the code in sys/pci/if_rl.c, as written, treats the card as being 8169-based, and causes the rl driver to skip it (but the re driver doesn't pick it up). >Fix: The following patch works for me. Please note (again) that I do not know if it Does The Right Thing: I based the approach on results obtained by experiments suggested by Scott Long, in which it became apparent that my 8129-based NIC reported itself as having a "hwrev" value of 0x00. Thus, it seemed to me that basing the tests in the stanza in question only on hwrev was likely to be problematic, at best: indeed, it wasn't clear to me why the tests would be made on hwrev, vs. rl_did in the first place (given the comment), but I'm sure that what little the code's author has forgotten about such things far exceeds my knowledge of them, and likely always will. :-} Index: sys/pci/if_rl.c =================================================================== RCS file: /cvs/freebsd/src/sys/pci/if_rl.c,v retrieving revision 1.128 diff -u -r1.128 if_rl.c --- sys/pci/if_rl.c 23 Dec 2003 02:36:42 -0000 1.128 +++ sys/pci/if_rl.c 28 Dec 2003 02:56:47 -0000 @@ -876,10 +876,14 @@ mtx_destroy(&sc->rl_mtx); /* Don't attach to 8139C+ or 8169/8110 chips. */ - if (hwrev == RL_HWREV_8139CPLUS || - hwrev == RL_HWREV_8169 || - hwrev == RL_HWREV_8169S || - hwrev == RL_HWREV_8110S) { + if (((t->rl_did == RT_DEVICEID_8139) && + (hwrev == RL_HWREV_8139CPLUS)) || + ((t->rl_did == RT_DEVICEID_8169) && + (hwrev == RL_HWREV_8169)) || + ((t->rl_did == RT_DEVICEID_8169) && + (hwrev == RL_HWREV_8169S)) || + ((t->rl_did == RT_DEVICEID_8100) && + (hwrev == RL_HWREV_8110S))) { t++; continue; } Please season to taste. :-) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401021616.i02GG50j000783>