From owner-freebsd-stable@FreeBSD.ORG Tue Jul 31 00:55:55 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693DC16A417 for ; Tue, 31 Jul 2007 00:55:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3A12413C4B6 for ; Tue, 31 Jul 2007 00:55:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so1831597waf for ; Mon, 30 Jul 2007 17:55:52 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=nhHxhGcfn0DpGebUtHD1+BSbwWeZxO7sbMK95s5qxlRw7Kh3bXMjpABm/mQmKZ5x7vonUDbMGcqpT9lVZdlezxOiGwO2FM5Eb1iWnURu2YZYNtxBVTokdHMgAk7s9WqwYRHj3Ar2ubc14lY7NIQTQfzhFzgZkwNvHS6+DaW7pMs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=qpGst6d9cwLsIfAYwYy46eW8ewWajhqoLlM9Cu6rauOrE+UA5i/AvMt/X4WVB0qfcXU/n/rWzwy0FJ0bXIZ4xZunLos2Z0Pfy+oNBugeRuW0ssRRee481IYJafwDjcZLny35nbj327Em74LEeoI8zSVk1+SdI+NIA7ub6lw8sWY= Received: by 10.114.135.1 with SMTP id i1mr6142079wad.1185843352709; Mon, 30 Jul 2007 17:55:52 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id m27sm1905807wag.2007.07.30.17.55.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2007 17:55:51 -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 l6V0tjMo093003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 Jul 2007 09:55:45 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id l6V0tiBM093002; Tue, 31 Jul 2007 09:55:44 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Tue, 31 Jul 2007 09:55:41 +0900 From: Pyun YongHyeon To: Michael Nottebrock Message-ID: <20070731005541.GA92601@cdnetworks.co.kr> References: <200707292113.01023.lofi@freebsd.org> <46ACFD01.1030406@timkapel.nl> <20070730050354.GB88265@cdnetworks.co.kr> <200707310132.02537.lofi@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <200707310132.02537.lofi@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: Laurens Timmermans , freebsd-stable@freebsd.org Subject: Re: Various problems with re(4) on a PCIe 8168/8111B onboard NIC X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2007 00:55:55 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 31, 2007 at 01:31:59AM +0200, Michael Nottebrock wrote: > On Monday, 30. July 2007, Pyun YongHyeon wrote: > > > Thanks for reporting. I don't have these hardware models so I couldn't > > verify the issue. After reading the vendor's code I've made attached > > patch. I don't know whether it works or not, it's just guess work. > > Works fine here! > Since HEAD is in code freeze I guess minimal patch would be more preferable. Would you try attached patch again? -- Regards, Pyun YongHyeon --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="re.power.patch2" Index: if_re.c =================================================================== RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v retrieving revision 1.92 diff -u -r1.92 if_re.c --- if_re.c 24 Jul 2007 01:24:02 -0000 1.92 +++ if_re.c 31 Jul 2007 00:49:34 -0000 @@ -1300,6 +1300,28 @@ goto fail; } + /* Take PHY out of power down mode. */ + if (sc->rl_type == RL_8169) { + uint32_t rev; + + rev = CSR_READ_4(sc, RL_TXCFG); + /* HWVERID 0, 1 and 2 : bit26-30, bit23 */ + rev &= 0x7c800000; + if (rev != 0) { + /* RTL8169S single chip */ + switch (rev) { + case RL_HWREV_8169_8110SB: + case RL_HWREV_8169_8110SC: + case RL_HWREV_8168_SPIN2: + re_gmii_writereg(dev, 1, 0x1f, 0); + re_gmii_writereg(dev, 1, 0x0e, 0); + break; + default: + break; + } + } + } + ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; --J2SCkAp4GZ/dPZZf--