From owner-freebsd-stable@FreeBSD.ORG Fri Sep 26 02:28:36 2008 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 DB208106568A for ; Fri, 26 Sep 2008 02:28:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3DB8FC08 for ; Fri, 26 Sep 2008 02:28:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so645785rvf.43 for ; Thu, 25 Sep 2008 19:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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; bh=z6u3nbXffSQ7Ye8jv6z+QXEniNAGZQ4joIAxDP8485g=; b=v8SQevnmIqIL1ABIBz4Tj71v3e8cLjR+1ReT72pi8eqVxGvX+P3Fx3JKoIion9WdHp 7Nd61k0uvush30nimUQEC/BLFAF++6Xwnitsazoqqqoc+UAWDGKTlE45YthzPsZsrvqt FmXv7j3Pn5+k7XFYAB/aXKYB+SJerwTGgZLE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Ffbh/H1pilxQH/Zq+LkSo9YHRvlxtWCOYtanCmKX6lQS6tBnep6ZJfAE9563vwdQul RSQ8WKiwK+HMNSJV5uzHJOBpXVtmvkVG59yFToaWj9saRzbo1raQsB0RghMoHKLpK+Hf uqpJ03eR4BqNAnrjdovCe21Phzx3AKqJqHVmU= Received: by 10.140.162.21 with SMTP id k21mr284808rve.110.1222392951595; Thu, 25 Sep 2008 18:35:51 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id g31sm1942645rvb.7.2008.09.25.18.35.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Sep 2008 18:35:50 -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 m8Q1XnOe043377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Sep 2008 10:33:49 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m8Q1XkXd043376; Fri, 26 Sep 2008 10:33:46 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Fri, 26 Sep 2008 10:33:46 +0900 From: Pyun YongHyeon To: Julian Stacey Message-ID: <20080926013346.GA43015@cdnetworks.co.kr> References: <200809251536.m8PFaido092110@fire.js.berklix.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <200809251536.m8PFaido092110@fire.js.berklix.net> User-Agent: Mutt/1.4.2.1i Cc: stable@freebsd.org Subject: Re: rl0: watchdog timeout + 40, 000 ms ping with 7.1-BETA-i386-disc1.iso 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: Fri, 26 Sep 2008 02:28:36 -0000 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 25, 2008 at 05:36:44PM +0200, Julian Stacey wrote: > Hi stable@, > I just imported an old tower from a friend. Used to run Linux OK. > Reset BIOS to defaults, turned off power saving etc, installed > 7.1-BETA-i386-disc1.iso > I now sees > rl0: watchdog timeout + 40,000 ms ping outgoing. > ping incoming fails, > it's not my net switch, I've moved to different segments etc & all else fine > > I'm remaking binaries, & will look around for netstat r whatever > commands later, meanwhile here's dmesg (via a floppy) > > Of course it could be somehow a hardaware bad config, its a new box to me. > > Copyright (c) 1992-2008 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. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 7.1-BETA #0: Sun Sep 7 13:49:18 UTC 2008 > root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Intel Pentium III (651.48-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0x681 Stepping = 1 > Features=0x383f9ff > real memory = 134152192 (127 MB) > avail memory = 117157888 (111 MB) [...] > rl0: port 0xd800-0xd8ff mem 0xee000000-0xee0000ff irq 12 at device 10.0 on pci0 > miibus0: on rl0 > rlphy0: PHY 0 on miibus0 > rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto > rl0: Ethernet address: 00:08:a1:6d:65:07 > rl0: [ITHREAD] [...] > rl0: link state changed to UP > rl0: watchdog timeout > rl0: link state changed to DOWN > rl0: link state changed to UP > rl0: link state changed to DOWN > rl0: link state changed to UP > rl0: watchdog timeout > rl0: watchdog timeout > Is there reliable way to reproduce the issue? Anyway, would you try attached patch and let me know result? -- Regards, Pyun YongHyeon --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rl.patch" Index: sys/pci/if_rl.c =================================================================== --- sys/pci/if_rl.c (revision 183366) +++ sys/pci/if_rl.c (working copy) @@ -650,6 +650,34 @@ static void rl_miibus_statchg(device_t dev) { + struct rl_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->rl_miibus); + ifp = sc->rl_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->rl_flags &= ~RL_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->rl_flags |= RL_FLAG_LINK; + break; + default: + break; + } + } + /* + * RealTek controllers does not provide any interface to + * Tx/Rx MACs for resolved speed, duplex and flow-control + * parameters. + */ } /* @@ -1236,7 +1264,6 @@ CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ - rl_reset(sc); rl_init_locked(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -1305,10 +1332,8 @@ /* XXX We should check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -1345,10 +1370,8 @@ rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1423,6 +1446,10 @@ RL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) + return; + while (RL_CUR_TXMBUF(sc) == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -1489,6 +1516,8 @@ */ rl_stop(sc); + rl_reset(sc); + /* * Init our MAC address. Even though the chipset * documentation doesn't mention it, we need to enter "Config @@ -1564,6 +1593,7 @@ /* Enable receiver and transmitter. */ CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); + sc->rl_flags &= ~RL_FLAG_LINK; mii_mediachg(mii); CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); @@ -1709,9 +1739,19 @@ sc->rl_watchdog_timer = 0; callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->rl_flags &= ~RL_FLAG_LINK; + CSR_WRITE_2(sc, RL_IMR, 0x0000); CSR_WRITE_1(sc, RL_COMMAND, 0x00); - CSR_WRITE_2(sc, RL_IMR, 0x0000); + for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(1); + if ((CSR_READ_1(sc, RL_COMMAND) & + (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0) + break; + } + if (i == RL_TIMEOUT) + device_printf(sc->rl_dev, "stopping Tx/Rx MAC timed out!\n"); + bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); /* --4Ckj6UjgE2iN1+kY--