From owner-freebsd-net@FreeBSD.ORG Fri Jan 15 00:54:04 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5359D106566C for ; Fri, 15 Jan 2010 00:54:04 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id E93C08FC0C for ; Fri, 15 Jan 2010 00:54:03 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so25952qwb.7 for ; Thu, 14 Jan 2010 16:54:00 -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=CDe2SMXfERz0+pmT0quI6Ei+UOF1U/DJ4I8AgQmxbm8=; b=h1AWmlTAXZPT+2D6FV2bdONuJqwpPoUhEOwuGDoheDlgUhbI+9SJUrtE3xN0LHkMiB pIUPNmx149m+8tc+71cSzoIgvbE3w6nhwKyW+3McnANo6w+RRb3MTdrfOxoSuzA00HOO KayhXkUWbaVLYMZPCUakEkcbQLQiMs37YVd2g= 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=HRou3XHNZM6S3utErhl/1ix88E4aRmb9NxGZoBEvP26CX4ckommmLmmu4hvufpXFye /91y87cJVKnfva+3imhJ5KlJhu1fS52HCdd+nERlnzmZvxOy7Njz3fVoI6WjJjTl1tDt rBdNLYJbDP8DL+Hm7y9KPPxUDaZQA/A8Mzukw= Received: by 10.224.50.146 with SMTP id z18mr1688515qaf.216.1263516838624; Thu, 14 Jan 2010 16:53:58 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 26sm3321681qwa.10.2010.01.14.16.53.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 16:53:57 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 14 Jan 2010 16:53:16 -0800 From: Pyun YongHyeon Date: Thu, 14 Jan 2010 16:53:16 -0800 To: Floris Bos Message-ID: <20100115005316.GB1228@michelle.cdnetworks.com> References: <201001140140.o0E1e5hr072464@freefall.freebsd.org> <201001142108.02941.info@je-eigen-domein.nl> <20100114201144.GA1228@michelle.cdnetworks.com> <201001142148.56444.info@je-eigen-domein.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="JkW1gnuWHDypiMFO" Content-Disposition: inline In-Reply-To: <201001142148.56444.info@je-eigen-domein.nl> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: kern/92090: [bge] bge: watchdog timeout -- resetting X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 00:54:04 -0000 --JkW1gnuWHDypiMFO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 14, 2010 at 09:48:56PM +0100, Floris Bos wrote: > On Thursday 14 January 2010 09:11:44 pm Pyun YongHyeon wrote: > > On Thu, Jan 14, 2010 at 09:08:02PM +0100, Floris Bos wrote: > > > On Thursday 14 January 2010 06:56:03 pm Pyun YongHyeon wrote: > > > > On Thu, Jan 14, 2010 at 04:33:19AM +0100, Floris Bos wrote: > > > > > Hi, > > > > > > > > > > On Thursday 14 January 2010 03:54:52 am Pyun YongHyeon wrote: > > > > > > > == > > > > > > > bge0: mem 0xdf900000-0xdf90ffff irq 16 at device 0.0 on pci32 > > > > > > > == > > > > > > > > > > > > > > After boot, the network works for about 5 seconds, barely enough time to get an IP by DHCP, and sent a ping or 2. > > > > > > > Then network connectivity goes down, and after some time there is a "bge0: watchdog timeout -- resetting" message. > > > > > > > > > > > > > > Then network works again for 5 seconds, and goes down again. All the time, repeatedly. > > > > > > > > > > > > > > The system works fine under Ubuntu. So I assume the hardware is ok. > > > > > > > > > > > > > > > > > > > I'm not sure but it looks like you have a BCM5784 controller. What is > > > > > > the output of "devinfo -rv | grep phy"? > > > > > > > > > > == > > > > > ukphy0 pnpinfo oui=0x50ef model=0x3a rev=0x4 at phyno=1 > > > > > ukphy1 pnpinfo oui=0x50ef model=0x3a rev=0x4 at phyno=1 > > > > > == > > > > > > > > Support for the PHY was added in r202269. > > > > Please try again after applying the change. Or you can download > > > > sys/dev/mii/miidevs and sys/dev/mii/brgphy.c from HEAD and rebuild > > > > kernel. > > > > > > Fetched the latest source using CVS on another computer, and transferred it to the system concerned by USB stick. > > > Rebuild the kernel, but the problem is still there. > > > > > Would you show me full dmesg output including "watchodg timeout" > > messages? > > === > Copyright (c) 1992-2010 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. [...] > bge0: mem 0xdf900000-0xdf90ffff irq 16 at device 0.0 on pci32 > miibus0: on bge0 > brgphy0: PHY 1 on miibus0 > brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto > bge0: Ethernet address: f4:ce:46:0f:2a:2c > bge0: [FILTER] > pcib4: irq 16 at device 28.5 on pci0 > pci34: on pcib4 > bge1: mem 0xdfa00000-0xdfa0ffff irq 17 at device 0.0 on pci34 > miibus1: on bge1 > brgphy1: PHY 1 on miibus1 > brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto > bge1: Ethernet address: f4:ce:46:0f:2a:2d > bge1: [FILTER] [...] Would you give attached patch try? I don't know whether it help or not though. I couldn't find any related information for possible clue of the issue in publicly available datasheet. --JkW1gnuWHDypiMFO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="bge.clkreq.patch" Index: sys/dev/bge/if_bgereg.h =================================================================== --- sys/dev/bge/if_bgereg.h (revision 202295) +++ sys/dev/bge/if_bgereg.h (working copy) @@ -2615,6 +2615,7 @@ #define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_40BIT_BUG 0x00020000 #define BGE_FLAG_4G_BNDRY_BUG 0x00040000 +#define BGE_FLAG_CLKREQ_BUG 0x00080000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c (revision 202295) +++ sys/dev/bge/if_bge.c (working copy) @@ -898,9 +898,22 @@ { struct bge_softc *sc; struct mii_data *mii; + uint16_t link; + sc = device_get_softc(dev); mii = device_get_softc(sc->bge_miibus); + if ((sc->bge_flags & BGE_FLAG_CLKREQ_BUG) != 0) { + link = pci_read_config(dev, + sc->bge_expcap + PCIR_EXPRESS_LINK_CTL, 2); + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) + link &= ~0x0100; + else + link |= 0x0100; + pci_write_config(dev, + sc->bge_expcap + PCIR_EXPRESS_LINK_CTL, link, 2); + } BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) @@ -2520,6 +2533,7 @@ struct ifnet *ifp; struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; + uint16_t link; u_char eaddr[ETHER_ADDR_LEN]; int error, msicount, reg, rid, trys; @@ -2672,6 +2686,18 @@ */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; + link = pci_read_config(dev, reg + PCIR_EXPRESS_LINK_CTL, 2); + /* Check for CLKREQ. */ + if (link & 0x0100) { +#if 1 + device_printf(sc->bge_dev, "CLKREQ set!\n"); +#endif + if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_chipid == BGE_CHIPID_BCM57780_A0 || + sc->bge_chipid == BGE_CHIPID_BCM57780_A1) + sc->bge_flags |= BGE_FLAG_CLKREQ_BUG; + } bge_set_max_readrq(sc); } else { /* --JkW1gnuWHDypiMFO--