From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 01:13:59 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 78E52106564A; Sat, 30 Oct 2010 01:13:59 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 40F918FC08; Sat, 30 Oct 2010 01:13:59 +0000 (UTC) Received: by pvc22 with SMTP id 22so222448pvc.13 for ; Fri, 29 Oct 2010 18:13:58 -0700 (PDT) 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=MeXf745Zk8kh4uMe/1vmmGnuLbgqBMAthi0r0w18Sok=; b=cb78oEOY2EsJ21Jcp/TTJ7Ij+9kDw+6b3sxqPn7Z9+o6FP04Uu9UJu/VnWc60b1C9a XrmqzOnRVRC60XxQRDvQw14bpk2qVGdNZsZXvMfUUv2q9G1zDlNsNDdds6KHeRYmXAcY zL2uKCaRz+Hcf0TqX+r8i3b78aNGi+mABi+yc= 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=AJJdoOS8w7RtHD+1Spls9MvLE0VfPms3YyHj++BAWd8680+lceAXGY6ZAF3JbTOhnC CQq3Xb74D6gKxJokrneGFPqu1/+St5YYT0eN2Os7P8CfGblPqwhfOGX9/pmM2bwa8qn0 Bx/0Xdb8EtS7hYhePR8VKA/vb/RM4KywUDoAo= Received: by 10.142.177.16 with SMTP id z16mr1985741wfe.214.1288401238553; Fri, 29 Oct 2010 18:13:58 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id w26sm2818052wfd.9.2010.10.29.18.13.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 18:13:57 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 29 Oct 2010 18:12:27 -0700 From: Pyun YongHyeon Date: Fri, 29 Oct 2010 18:12:27 -0700 To: Kris Moore Message-ID: <20101030011227.GD19479@michelle.cdnetworks.com> References: <20101029101516.GA66384@pcbsd.org> <20101029165531.GA19479@michelle.cdnetworks.com> <20101030004422.GA13657@pcbsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101030004422.GA13657@pcbsd.org> User-Agent: Mutt/1.4.2.3i 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 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: Sat, 30 Oct 2010 01:13:59 -0000 On Fri, Oct 29, 2010 at 08:44:22PM -0400, Kris Moore wrote: > 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 a lot for testing! > Thanks for the quick fix, will you put this into HEAD soon? > Patch committed(r214542).