Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Aug 2006 19:39:46 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        Dinesh Nair <dinesh@alphaque.com>
Cc:        freebsd-hackers@freebsd.org, freebsd-hardware@freebsd.org
Subject:   Re: Unable to get RealTek 8139C+ to work with re(4) under FreeBSD 6.1
Message-ID:  <20060814103946.GC36904@cdnetworks.co.kr>
In-Reply-To: <44E040CF.9080205@alphaque.com>
References:  <44E040CF.9080205@alphaque.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 14, 2006 at 05:22:23PM +0800, Dinesh Nair wrote:
 > 
 > i've got a single board computer with VIA C3 Samuel 2, 256MB RAM and 4 
 > onboard Realtek 8139C+ NICs. I'm attempting to get FreeBSD 6.1-STABLE 
 > working on them, but the realtek NICs just don't seem to want to work. 
 > booting up led to a kernel trap with the following,
 > 
 > rlphy0: <RealTek internal media interface> on miibus0
 > rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 > re0: Ethernet address: 00:60:e0:e1:21:d7
 > re0: diagnostic failed, failed to receive packet in loopback mode
 > re0: attach aborted due to hardware diag failure
 > kernel trap 12 with interrupts disabled
 > 
 > Fatal trap 12: page fault while in kernel mode
 > fault virtual address   = 0x74
 > fault code              = supervisor read, page not present
 > instruction pointer     = 0x20:0xc0625d45
 > stack pointer           = 0x28:0xc2420a50
 > frame pointer           = 0x28:0xc2420a54
 > code segment            = base 0x0, limit 0xfffff, type 0x1b
 >                        = DPL 0, pres 1, def32 1, gran 1
 > processor eflags        = resume, IOPL = 0
 > current process         = 0 (swapper)
 > trap number             = 12
 > panic: page fault
 > Uptime: 1s
 > 
 > looking through /usr/src/sys/dev/re/if_re.c, and reading this thread, 
 > http://lists.freebsd.org/pipermail/freebsd-current/2004-June/029373.html, 
 > i've patched if_re.c to skip the re_diag() routine if the NIC is not a 
 > Realtek 8169. the patch follows,
 > 
 > ----- CUT HERE -----
 > --- if_re.c.orig	Mon Aug 14 14:43:05 2006
 > +++ if_re.c	Mon Aug 14 14:42:16 2006
 > @@ -1235,12 +1235,14 @@
 >  	ether_ifattach(ifp, eaddr);
 > 
 >  	/* Perform hardware diagnostic. */
 > -	error = re_diag(sc);
 > +	if (sc->rl_type == RL_8169) {
 > +		error = re_diag(sc);
 > 
 > -	if (error) {
 > -		device_printf(dev, "attach aborted due to hardware diag 
 > failure\n");
 > -		ether_ifdetach(ifp);
 > -		goto fail;
 > +		if (error) {
 > +			device_printf(dev, "attach aborted due to hardware 
 > diag failure\n");
 > +			ether_ifdetach(ifp);
 > +			goto fail;
 > +		}
 >  	}
 > 
 >  	/* Hook interrupt last to avoid having to lock softc */
 > ----- CUT HERE -----
 > 
 > with the patch applied, the kernel trap goes away and the box boots up. 
 > however, though the link light comes on, the device is effectively 
 > unuseable for ethernet traffic. nothing seems to go in or out of the device 
 > with ping and other tcp/udp traffic failing. note the media state and the 
 > missing status line from the ifconfig output.
 > 
 > any clue as to what's happenning here or to pointers/patches to fix this 
 > would be much appreciated. i've got the box sitting beside me, so testing 
 > patches et al would be highly possible.
 > 

Recent changes from wpaul disabled re_diag() routine by default so it
wouldn't trigger the panic you've seen anymore.
However I've seen one user reported re(4) breakage on stable.
http://lists.freebsd.org/pipermail/freebsd-stable/2006-August/027356.html

Please try latest stable and show your results. If it still does not
work please let us know. I don't have 8139C+ based NICs so it would be
difficult for me to fix the issue. :-(

-- 
Regards,
Pyun YongHyeon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060814103946.GC36904>