From nobody@FreeBSD.org  Thu Jan 15 16:36:33 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 839D61065678
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Jan 2009 16:36:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 726B08FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Jan 2009 16:36:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0FGaXSI039976
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Jan 2009 16:36:33 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n0FGaXAU039975;
	Thu, 15 Jan 2009 16:36:33 GMT
	(envelope-from nobody)
Message-Id: <200901151636.n0FGaXAU039975@www.freebsd.org>
Date: Thu, 15 Jan 2009 16:36:33 GMT
From: Henrik Friedrichsen <hrkfdn@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: if_re doesn't always attach to Realtek 8111C
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130586
>Category:       kern
>Synopsis:       [re] if_re doesn't always attach to Realtek 8111C
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 15 16:40:03 UTC 2009
>Closed-Date:    Tue Feb 17 07:50:55 UTC 2009
>Last-Modified:  Tue Feb 17 07:50:55 UTC 2009
>Originator:     Henrik Friedrichsen
>Release:        7.1-RELEASE
>Organization:
>Environment:
FreeBSD canaan.connecticut 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Sun Jan 4 20:18:09 CET 2009 root@canaan.megawr.ath.cx:/usr/obj/usr/src/sys/PLUTONIUM i386
>Description:
I have a NIC with the Realtek 8111C on a Gigabyte GA-EP43-DS3L.
However, the if_re driver doesn't always attach. I have not found out when it does or doesn't, it seems to be random, once it has attached, which is rarely the case, it works fine though.

if_re prints the following messages ..

. if it works:
re0: <RealTek 8168/8168B/8168C/8168CP/8168D/8111B/8111C/8111CP PCIe Gigabit Ethernet> port 0xd000-0xd0ff mem 0xe9010000-0xe9010fff,0xe9000000-0xe900ffff irq 17 at device 0.0 on pci4
re0: Chip rev. 0x3c000000
re0: MAC rev. 0x00400000
miibus0: <MII bus> on re0
re0: Ethernet address: 00:1f:d0:8e:95:4c
re0: [FILTER]
re0: link state changed to UP

. if it doesn't work:
re0: <RealTek 8168/8168B/8168C/8168CP/8168D/8111B/8111C/8111CP PCIe Gigabit Ethernet> port 0xd000-0xd0ff mem 0xe9010000-0xe9010fff,0xe9000000-0xe900ffff irq 17 at device 0.0 on pci4
re0: Chip rev. 0x3c000000
re0: MAC rev. 0x00400000
re0: PHY write failed
re0: PHY write failed
re0: MII without any phy!
device_attach: re0 attach returned 6

pciconf output:
re0@pci0:4:0:0:	class=0x020000 card=0xe0001458 chip=0x816810ec rev=0x02 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC'
    class      = network
    subclass   = ethernet

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Dennis Herrmann <adox@mcx2.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/130586: if_re doesn't always attach to Realtek 8111C
Date: Thu, 15 Jan 2009 19:14:48 +0100

 I have the same problem here, but with a 8169.
 
 .lspci
 02:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
 RTL-8110SC/8169SC Gigabit Ethernet (rev 10)
 
 .pciconf
 re0@pci0:2:15:0:        class=0x020000 card=0xe0001458 chip=0x816710ec
 rev=0x10 hdr=0x00
 	vendor     = 'Realtek Semiconductor'
 	device     = 'RTL8169/8110 Family Gigabit Ethernet NIC'
 	class      = network
 	subclass   = ethernet
 
 -Dennis
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Jan 15 21:38:20 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130586 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Fri Jan 16 02:14:46 UTC 2009 
State-Changed-Why:  
I believe HEAD has fix for the issue. Would you try re(4) in HEAD? 
To get the re(4) of HEAD you may have to get following files 
from HEAD and rebuild kernel. 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/re/if_re.c 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/pci/if_rlreg.h 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/pci/if_rl.c 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Fri Jan 16 02:14:46 UTC 2009 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130586 

From: "Henrik Friedrichsen" <hrkfdn@gmail.com>
To: bug-followup@FreeBSD.org, hrkfdn@gmail.com
Cc:  
Subject: Re: kern/130586: [re] if_re doesn't always attach to Realtek 8111C
Date: Fri, 16 Jan 2009 14:24:21 +0100

 I tried that before, but I can't build it due to declarations missing.
 To name a few:
 RL_GPIO RL_MACDBG RL_FLAG_MACSLEEP RL_CMD_STOPREQ
 
 What other files do I have to grab from CURRENT ?

From: "Henrik Friedrichsen" <hrkfdn@gmail.com>
To: bug-followup@FreeBSD.org, hrkfdn@gmail.com
Cc:  
Subject: Re: kern/130586: [re] if_re doesn't always attach to Realtek 8111C
Date: Fri, 16 Jan 2009 14:35:58 +0100

 Duh, nevermind. That was a mistake I made. I grabbed the one from
 RELENG_7 because that was the latest commit. Time to rebuild :)

From: "Henrik Friedrichsen" <hrkfdn@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/130586: [re] if_re doesn't always attach to Realtek 8111C
Date: Fri, 16 Jan 2009 16:12:38 +0100

 Alright, seems to work fine on my side :)
 Thanks for the good work!
State-Changed-From-To: feedback->patched 
State-Changed-By: yongari 
State-Changed-When: Sat Jan 17 05:10:20 UTC 2009 
State-Changed-Why:  
Submitter confirms that re(4) in HEAD fixed the issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130586 

From: Henrik Friedrichsen <hrkfdn@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/130586: [re] if_re doesn't always attach to Realtek 8111C
Date: Wed, 28 Jan 2009 20:04:47 +0100

 So when is this patch going to be MFC'd ?

From: Warren Block <wblock@wonkity.com>
To: bug-followup@FreeBSD.org, hrkfdn@gmail.com
Cc:  
Subject: Re: kern/130586: [re] if_re doesn't always attach to Realtek 8111C
Date: Mon, 16 Feb 2009 23:16:59 -0700 (MST)

 The patch also fixes a similar issue with a related Realtek chip on an 
 MSI P45 Neo3-FR motherboard.  The re0 interface is only rarely detected 
 at boot, and is not shown in ifconfig's output until an ifconfig command 
 accessing the card is given ('ifconfig re0').  After that, re0 behaves 
 normally.
 
 The patch seems to correct that for 8-CURRENT; thanks!  7-STABLE could 
 really use the same fix.
 
 re0@pci0:4:0:0: class=0x020000 card=0x514c1462 chip=0x816810ec rev=0x02 hdr=0x00
     vendor     = 'Realtek Semiconductor'
     device     = 'RTL8168/8111 PCI-E Gigabit Ethernet NIC'
     class      = network
     subclass   = ethernet
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Tue Feb 17 07:50:23 UTC 2009 
State-Changed-Why:  
MFC done. Thanks for testing! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130586 
>Unformatted:
