From patchwork Tue Aug 19 14:49:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Jensen X-Patchwork-Id: 4743651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A064C0338 for ; Tue, 19 Aug 2014 14:52:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10AB420155 for ; Tue, 19 Aug 2014 14:52:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E916A20154 for ; Tue, 19 Aug 2014 14:52:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XJkkJ-00033G-Fh; Tue, 19 Aug 2014 14:50:47 +0000 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XJkk1-0001hq-9Z for linux-arm-kernel@lists.infradead.org; Tue, 19 Aug 2014 14:50:29 +0000 Received: by mail-la0-f45.google.com with SMTP id ty20so6006360lab.32 for ; Tue, 19 Aug 2014 07:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HS1kg+6EN4f95aCMX/935AzKJw1Hfi/ASRlg8NHa8P4=; b=YRPTbCTb7xN/l40p1roKi/1QcaZzVXl2sNSiGWj2dw0jzqciJZn21v+NNWuqb7yxW8 DO2kaW98ERBNAzlDWyfRyxnwznm1MJ4+r/KDqNUxW9Tui3Dk6UrpIbZNwUSyV7OrK2gN /7HpYYop+j4AdNkZMAyUB/asABOAg62JL4h4j3xRPsmYg8kT1WLvTgsc9bTv7gF4t9+L 4BudIPxhuq08LkHt5qZCgu2Dfy5yCjN2p7llz0VNxKog8F8gKMjGkp0eNL99s4Gxf064 s4oWlpdM2sPsxo+dXDqvXUKS6O6Kk0kLLJDkrzX8/G5vWWH8thFafuCq+t2njjPkrNFs Rcxw== X-Received: by 10.152.4.97 with SMTP id j1mr37380034laj.10.1408459804139; Tue, 19 Aug 2014 07:50:04 -0700 (PDT) Received: from Ildjarn.ath.cx (static-213-115-41-10.sme.bredbandsbolaget.se. [213.115.41.10]) by mx.google.com with ESMTPSA id o15sm12620111laa.44.2014.08.19.07.50.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 07:50:03 -0700 (PDT) From: Jonas Jensen To: netdev@vger.kernel.org Subject: [PATCH v4 1/2] net: moxa: clear TX descriptor length bits Date: Tue, 19 Aug 2014 16:49:43 +0200 Message-Id: <1408459784-9385-1-git-send-email-jonas.jensen@gmail.com> X-Mailer: git-send-email 1.8.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140819_075029_524291_AAE5C97A X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -0.1 (/) Cc: f.fainelli@gmail.com, linux-kernel@vger.kernel.org, Jonas Jensen , bhutchings@solarflare.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TX buffer length is not cleared on ndo_start_xmit(). Failing to do so can bug/hang the controller and cause TX interrupts to stop altogether. Add TX_DESC1_BUF_SIZE_MASK to bits that are cleared, before the TX buffer length is set. Addresses https://bugzilla.kernel.org/show_bug.cgi?id=69031 Signed-off-by: Jonas Jensen --- Notes: Changes since v3: 1. commit message reworded Applies to next-20140818 drivers/net/ethernet/moxa/moxart_ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index 5020fd4..aa45607 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c @@ -348,7 +348,8 @@ static int moxart_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev) txdes1 = readl(desc + TX_REG_OFFSET_DESC1); txdes1 |= TX_DESC1_LTS | TX_DESC1_FTS; - txdes1 &= ~(TX_DESC1_FIFO_COMPLETE | TX_DESC1_INTR_COMPLETE); + txdes1 &= ~(TX_DESC1_FIFO_COMPLETE | TX_DESC1_INTR_COMPLETE | + TX_DESC1_BUF_SIZE_MASK); txdes1 |= (len & TX_DESC1_BUF_SIZE_MASK); writel(txdes1, desc + TX_REG_OFFSET_DESC1); writel(TX_DESC0_DMA_OWN, desc + TX_REG_OFFSET_DESC0);