From owner-freebsd-mips@freebsd.org Thu Oct 29 18:41:56 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D024A216DB for ; Thu, 29 Oct 2015 18:41:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 123291386 for ; Thu, 29 Oct 2015 18:41:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igvi2 with SMTP id i2so30493215igv.0 for ; Thu, 29 Oct 2015 11:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0aBTzIJkwdUNYyWU11dJPcvfK+/z8WpZwiyE+9+U5Gs=; b=xl6N8XETbuyXiOWJRhEJjNukXFuyZitmTtGgqmNZD3D4hv+f3z1kehsRepF6BmVj6j VYXw2fjc5/vPiNmi2fLo7xrK+T+HlGGc782wdX7AYEXqKm2ut7zU1ZXaleZRL6n9oXOF K1f35vnoItHwKWfp0Yde23jNZ4d3XOxVCEBNExIuuqTmnBROg/iurxEAp1FOF3IwAzEa 94X6wo4+fMpY3EGtmv+gUf90OnS6knF5ZJAWei8a1nr+mi2122+aZQ2c5ZlWyj8GDCdW 5vALACdnC+hA5BA503vB3NrdIGXGT4k/QKO905kcKF7EIL+v9U/hXVxEK/l9RfFw00Xs XBpw== MIME-Version: 1.0 X-Received: by 10.50.178.141 with SMTP id cy13mr5345347igc.61.1446144115428; Thu, 29 Oct 2015 11:41:55 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Thu, 29 Oct 2015 11:41:55 -0700 (PDT) In-Reply-To: <56325769.8070202@grosbein.net> References: <562CBEC3.8030308@rdtc.ru> <562E3027.4020806@grosbein.net> <562F75E2.9000505@grosbein.net> <5630E844.2080807@grosbein.net> <56321ED9.4050602@grosbein.net> <56323496.609@grosbein.net> <56325769.8070202@grosbein.net> Date: Thu, 29 Oct 2015 14:41:55 -0400 Message-ID: Subject: Re: arge1 on TL WDR3600 From: Adrian Chadd To: Eugene Grosbein Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 18:41:56 -0000 AH, ok. So it says TX_UNDERRUN + TX_PKT_SENT. So hm. The way this is supposed to work is .. odd. You queue TX packets to the hardware. The hardware increments TXPKTCOUNT in the TX DMA status register. Then for each packet you see transmitted, you write TXPKTSENT to the TX DMA status register and that decrements TXPKTCOUNT. Once it's zero, you won't see any more TX interrupts. Now, the 'arge_tx_cnt' value tracks that; it should be zero if it's idle. It's 126, which means there are still things to process. there's 128 ring slots, so that prod/cons value indicates there's 126 things in the ring. arge_tx_locked() does the decrementing and poking TXPKTSENT. So, I bet the driver and hardware is out of sync. I bet that the (ctrl & ARGE_DESC_EMPTY) check is triggering on the current frame in that ring. I don't know if it's because prod/cons are out of whack, or it's currently trying to check a descriptor in a multi-frame TX descriptor, or whether the hardware is just plain buggy and it didn't update that. But, that's actually what's going on. So that's my 5 minute analysis of it. I wish I could reproduce it on what I have here because then I could see what the state of the ring is and whether the hardware is buggy or our tx prod/cons tracking is busted. I'd reaally appreciate help here :( -adrian