From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 14 10:38:24 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48E5E16A4E0 for ; Mon, 14 Aug 2006 10:38:24 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38BE343D5E for ; Mon, 14 Aug 2006 10:38:19 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id c59so1184162pyc for ; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=VnwN8kTWpzeJbnnj/cZ70W4TIXjJJaW7jilkkHM/lTii0g7d/CFWpZAKuNXEvIn36l3iAQgNCpH2YdO8/Oe0x05haVTUstrRETVprHUF84k1mcohnGIu6Cw6oPBbMCyYLzdbTcvbVRPUU0gaFh549SAp3pCpRXzq/mm2uAVbso4= Received: by 10.64.204.3 with SMTP id b3mr6621135qbg; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 34sm111867nza.2006.08.14.03.38.16; Mon, 14 Aug 2006 03:38:18 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k7EAdmcV038520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Aug 2006 19:39:48 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k7EAdkGZ038519; Mon, 14 Aug 2006 19:39:46 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 14 Aug 2006 19:39:46 +0900 From: Pyun YongHyeon To: Dinesh Nair Message-ID: <20060814103946.GC36904@cdnetworks.co.kr> References: <44E040CF.9080205@alphaque.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E040CF.9080205@alphaque.com> User-Agent: Mutt/1.4.2.1i 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 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 10:38:24 -0000 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: 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