From owner-freebsd-stable@FreeBSD.ORG Tue Mar 3 12:00:52 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2537F1065673; Tue, 3 Mar 2009 12:00:52 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by mx1.freebsd.org (Postfix) with ESMTP id D8AB78FC19; Tue, 3 Mar 2009 12:00:51 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id f6so3140710rvb.43 for ; Tue, 03 Mar 2009 04:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=MXU3Rt6cC0gEpAnCAZL/tbDUETNMQ6POhqxX789kYZ4=; b=AuiO61iuxrnbZmdpn5B41oVl/THXBeWITZAsUJIBDi25MnNVXpV/ZUoFu0A/nIhM3L MAmp68tPqxrdJExvLux4rcvZ9jLuBy3yF7VqnMj9uZkWgiwtqqw3YBl9jYnRb3OLoi4g ALkoGiiieE/C2R5IRAh5mb8QMaWLpLigt+Nd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=QcmNGPL04XspPPvQhP6ezvvxBAocfILW8wqNhBl6OXs84JGmLPxV3Oh/3pqavfQIXc 6XesetCusq6Cp2XNc0NvOf9ypCQc2FpDYxOxl9uH5C9ratg6YTs1AyP2eCB7yj9FRaLV AteXcKr0xFDySzS62VFjO/wk2kM7Ws4gBE2gE= Received: by 10.140.199.15 with SMTP id w15mr3484434rvf.140.1236081651465; Tue, 03 Mar 2009 04:00:51 -0800 (PST) Received: from michelle.cdnetworks.co.kr ([114.111.62.249]) by mx.google.com with ESMTPS id f21sm4273434rvb.2.2009.03.03.04.00.47 (version=SSLv3 cipher=RC4-MD5); Tue, 03 Mar 2009 04:00:48 -0800 (PST) Received: by michelle.cdnetworks.co.kr (sSMTP sendmail emulation); Tue, 3 Mar 2009 21:07:34 +0900 From: Pyun YongHyeon Date: Tue, 3 Mar 2009 21:07:34 +0900 To: Steve Wills Message-ID: <20090303120734.GB84434@michelle.cdnetworks.co.kr> References: <20090226003842.GB63173@michelle.cdnetworks.co.kr> <95AD32AC-93AE-4945-A18E-CE7099BEC3CA@stevenwills.com> <20090226041023.GD63173@michelle.cdnetworks.co.kr> <594BAC6A-498A-4B82-A18B-EB09FEA2F322@stevenwills.com> <20090226042732.GE63173@michelle.cdnetworks.co.kr> <22F5A82D-290D-4B84-92AB-670EDB49AF22@stevenwills.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <22F5A82D-290D-4B84-92AB-670EDB49AF22@stevenwills.com> User-Agent: Mutt/1.4.2.3i Cc: stable@freebsd.org, yongari@freebsd.org Subject: Re: 7.1-R to RELENG_7 upgrade breaks re 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, 03 Mar 2009 12:00:52 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 26, 2009 at 12:36:48AM -0500, Steve Wills wrote: > On Feb 25, 2009, at 11:27 PM, Pyun YongHyeon wrote: > > >On Wed, Feb 25, 2009 at 11:15:38PM -0500, Steve Wills wrote: > > > >[...] > >>>I guess re(4) thinks it lost established link. How about unplug and > >>>then replug UTP cable? Would you show me "devinfo -rv | grep phy"? > >> > >>rgephy0 pnpinfo oui=0x732 model=0x11 rev=0x2 at phyno=1 > >> > > > >And unpluging/repluging didn't help? > > No, didn't help. > Ok, when you plug UTP cable can you see "re0: link state changed to UP" in dmesg output? Or if you unplug the cable, you should see "re0: link state changed to DOWN"(With "tail -f /var/log/message", you can easily check this.) If this is not the case something is wrong on RTL8168D. Since you've said re0 works for a short time, can you see "re0: link state changed to DOWN" on your dmesg output right before seeing "re0: PHY read failed" message? I've also attached patch which may apply to your case. Would you give it spin? Note, the patch was generated against CURRENT, so you should use re(4) in CURRENT. Just save your old re(4)/rl(4) files and download if_re.c, if_rl.c and if_rlreg.h from CURRENT and apply the patch. --qDbXVdCdHGoSgWSk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.RTL8168D.patch" Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 189300) +++ sys/dev/re/if_re.c (working copy) @@ -1266,6 +1266,8 @@ /* FALLTHROUGH */ case RL_HWREV_8168CP: case RL_HWREV_8168D: + if (hw_rev->rl_rev == RL_HWREV_8168D) + sc->rl_flags |= RL_FLAG_PMCH; sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP; /* @@ -1361,7 +1363,8 @@ CSR_WRITE_1(sc, RL_GPIO, CSR_READ_1(sc, RL_GPIO) & ~0x01); } - + if ((sc->rl_flags & RL_FLAG_PMCH) != 0) + CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); /* Take PHY out of power down mode. */ if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); @@ -2982,6 +2985,8 @@ CSR_WRITE_1(sc, RL_GPIO, CSR_READ_1(sc, RL_GPIO) | 0x01); } + if ((sc->rl_flags & RL_FLAG_PMCH) != 0) + CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) @@ -3043,6 +3048,8 @@ CSR_WRITE_1(sc, RL_GPIO, CSR_READ_1(sc, RL_GPIO) & ~0x01); } + if ((sc->rl_flags & RL_FLAG_PMCH) != 0) + CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) & ~0x80); if ((ifp->if_capenable & IFCAP_WOL) != 0 && (sc->rl_flags & RL_FLAG_WOLRXENB) != 0) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_RX_ENB); Index: sys/pci/if_rlreg.h =================================================================== --- sys/pci/if_rlreg.h (revision 189300) +++ sys/pci/if_rlreg.h (working copy) @@ -133,6 +133,7 @@ #define RL_GMEDIASTAT 0x006C /* 8 bits */ #define RL_MACDBG 0x006D /* 8 bits, 8168C SPIN2 only */ #define RL_GPIO 0x006E /* 8 bits, 8168C SPIN2 only */ +#define RL_PMCH 0x006F /* 8 bits, 8168D only */ #define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */ #define RL_GTXSTART 0x0038 /* 8 bits */ @@ -880,6 +881,7 @@ int rl_txstart; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 +#define RL_FLAG_PMCH 0x0002 #define RL_FLAG_PHYWAKE 0x0008 #define RL_FLAG_NOJUMBO 0x0010 #define RL_FLAG_PAR 0x0020 --qDbXVdCdHGoSgWSk--