From owner-freebsd-mips@FreeBSD.ORG Sat Dec 31 16:01:23 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3011106564A for ; Sat, 31 Dec 2011 16:01:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A86008FC12 for ; Sat, 31 Dec 2011 16:01:23 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so20061519vbb.13 for ; Sat, 31 Dec 2011 08:01:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=apMxpT5E4JFMjLQctlC4VeH08aR/vSnu5E5nVLPry/k=; b=e1zLGuqYOcy3l61BtuIbbBZxXQbRLE4XcHE+Krw25SXTRv47ZmBKvJ5tEEMXYFU9QX 4Xxbjuch0tC1UI75YBVBg5av2xt5QnJBBNg9c6fZzV+13x1QNiwSQaKKwe8i3rz++WVH aHeuxKvNLltyJ3KRFK650fz7yWWpDKsbDd43c= MIME-Version: 1.0 Received: by 10.52.23.44 with SMTP id j12mr14248713vdf.117.1325347282976; Sat, 31 Dec 2011 08:01:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Sat, 31 Dec 2011 08:01:22 -0800 (PST) In-Reply-To: <2A05E0AA-5AA5-47FD-90EA-BD6B23A01EFE@lassitu.de> References: <20111231000638.d257448c.ray@ddteam.net> <98BA8EF5-E808-43F8-92A8-68B14CAF998F@lassitu.de> <2A05E0AA-5AA5-47FD-90EA-BD6B23A01EFE@lassitu.de> Date: Sat, 31 Dec 2011 08:01:22 -0800 X-Google-Sender-Auth: S81dCZ-WaYFCbeTZ6mQJJ7cCvWM Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Aleksandr Rybalko , freebsd-mips@freebsd.org Subject: Re: arge problem on MR3420 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 16:01:24 -0000 On 31 December 2011 04:36, Stefan Bethke wrote: > Am 30.12.2011 um 23:49 schrieb Stefan Bethke: > >> OK, trying to pull in everyone. =A0There seems to be a problem with if_a= rge on certain chips/platforms. =A0I've encountered it on TL-MR3420 and WRT= -160NL. =A0I'm currently working off Adrians gitorious repo. > > The problem is limited to BOOTP; if I mount a USB stick as root, I can br= ing up arge1 without issue. > > On the AR7241, arge0 is connected to a phy and the blue WAN port, arge1 i= s connected to the built-in switch. =A0The port speeds are fixed (1000 for = the switch, 100 for the phy). > > With BOOTP enabled, I'm getting an interrupt storm on intr 3. =A0I've ena= bled debugging for arge, and it seems there is a TX underrun that is not be= ing cleared in that case. =A0I'm not fully understanding the code, so I'm n= ot sure why the TX underrun is not being cleared, or keeps reoccurring. Is the bootp code somehow tickling the interface setup in a way that isn't the same as the userland-driven config? Ie, a tx underrun should only occur if it runs out of TX descriptor slots. That's fine, it just means that it go to the end of the descriptor list. It's not _necessarily_ an error condition. And it should only _keep_ occuring if someone/something keeps tickling the DMA_TX_CONTROL_EN bit. So when the underrun occurs, what's the state of the TX ring head/tail poin= ters? The code in arge_intr() should be self explanatory. If any frames were sent, call arge_start_locked(). The call to arge_encap() throws something into the TX ring and then sets DMA_TX_CONTROL_EN. How about adding a printf() to arge_start_locked() and arge_encap(), see if they're constantly being called. Adrian