From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 00:44:28 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 D2C55106566B; Sat, 30 Oct 2010 00:44:28 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mta21.charter.net (mta21.charter.net [216.33.127.81]) by mx1.freebsd.org (Postfix) with ESMTP id 67FA08FC0C; Sat, 30 Oct 2010 00:44:28 +0000 (UTC) Received: from imp09 ([10.20.200.9]) by mta21.charter.net (InterMail vM.7.09.02.04 201-2219-117-106-20090629) with ESMTP id <20101030004427.BFIB3705.mta21.charter.net@imp09>; Fri, 29 Oct 2010 20:44:27 -0400 Received: from moorefam.homeunix.org ([96.38.85.215]) by imp09 with smtp.charter.net id QokP1f0034elNjk05okQBa; Fri, 29 Oct 2010 20:44:26 -0400 X-Authority-Analysis: v=1.0 c=1 a=kj9zAlcOel0A:10 a=ExQ5TvhgJEjoZYdoVS4A:9 a=yBx2zgVaMOlguUbvEQkA:7 a=KHp1pku8FcG74aDwfMk2DwvG_kIA:4 a=CjuIK1q_8ugA:10 Received: by moorefam.homeunix.org (sSMTP sendmail emulation); Fri, 29 Oct 2010 20:44:22 -0400 Date: Fri, 29 Oct 2010 20:44:22 -0400 From: Kris Moore To: Pyun YongHyeon Message-ID: <20101030004422.GA13657@pcbsd.org> References: <20101029101516.GA66384@pcbsd.org> <20101029165531.GA19479@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101029165531.GA19479@michelle.cdnetworks.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, yongari@freebsd.org Subject: Re: Hardlock with alc0 device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 00:44:29 -0000 On Fri, Oct 29, 2010 at 09:55:31AM -0700, Pyun YongHyeon wrote: > On Fri, Oct 29, 2010 at 06:15:16AM -0400, Kris Moore wrote: > > > > I'm running into a rather interesting problem here on HEAD with a newer Asus > > EEE PC and the "alc" network driver. The device works great when a > > cable is plugged in, no issues at all. However, if I unplug the ethernet > > and reboot then I get a hard-lock when it tries to bring up the device. > > > > I disabled ifconfig_alc0="DHCP" in rc.conf, and now the system boots > > normally, but just for kicks I tried running "dhclient alc0" on it > > manually, and sure enough it resulted in another system lockup. (No kern dump, > > doesn't even get that far) > > > > Here's some information about the system / device, let me know if there > > is any other data / commands I should run and send over. > > > > > > FreeBSD mininova 9.0-CURRENT FreeBSD 9.0-CURRENT #14: Sat Oct 23 13:11:00 PDT 2010 > > > > alc0@pci0:1:0:0: class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00 > > vendor = 'Attansic (Now owned by Atheros)' > > device = 'Atheros AR8132 PCI-E Fast Ethernet Controller (AR8132)' > > class = network > > subclass = ethernet > > > > > > alc0: flags=8802 metric 0 mtu 1500 > > options=c3198 > > ether 20:cf:30:1e:b2:38 > > media: Ethernet autoselect > > > > I was not able to reproduce it with sample board so I'm not sure > what register access could trigger the stuck. Given that there are > some configuration changes in BIOS for better power saving(ASPM) it > could be related with accessing ALC_PM_CFG register. > I also remember some user reported controller couldn't establish > link when system booted without UTP cable plugged in. Not sure this > is also the same issue as sample board does not show the issue. > > Anyway, would you try attached patch? > Index: sys/dev/alc/if_alc.c > =================================================================== > --- sys/dev/alc/if_alc.c (revision 214514) > +++ sys/dev/alc/if_alc.c (working copy) > @@ -331,8 +331,8 @@ > reg = CSR_READ_4(sc, ALC_MAC_CFG); > reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; > CSR_WRITE_4(sc, ALC_MAC_CFG, reg); > + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > } > - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > } > > static void Well, so far with the attached patch, after a couple reboots, and trying to use dhclient, it's still working fine. Also after the initial dhclient times out I get a link status of "status: no carrier" now, which didn't show up before, so thats good too. Thanks for the quick fix, will you put this into HEAD soon? -- Kris Moore PC-BSD Software