From patchwork Wed Aug 20 14:18:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Jensen X-Patchwork-Id: 4751991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A38A19F375 for ; Wed, 20 Aug 2014 14:21:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0093A2015E for ; Wed, 20 Aug 2014 14:21:26 +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 E8CF220155 for ; Wed, 20 Aug 2014 14:21:23 +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 1XK6jR-0008DN-V4; Wed, 20 Aug 2014 14:19:21 +0000 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XK6jP-00087W-P9 for linux-arm-kernel@lists.infradead.org; Wed, 20 Aug 2014 14:19:20 +0000 Received: by mail-lb0-f180.google.com with SMTP id v6so6777081lbi.39 for ; Wed, 20 Aug 2014 07:18:57 -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:in-reply-to:references; bh=dqh3qaiYw7xxukxU8v/Syy0ien4okuzaihBf/l8p4e4=; b=mm57W61HYH0FsPs9vfw4btdGkxTU8yQ3BcGmJmjh1bFhE1dLrkJGtZKFdQnQ+DAbnB xrM/sZ6evJ2e4jFuazNLwil0dmkwQVCT7AJihXM9sf9AeOsQrJaDJKW/WoDp6e5z++Qj HPRxw8PIH1+eO2qmPWpIGSu57aohkHzJdEK6Gsy3tenyATUYiKzqwPJX+JNmDfCyWSHG VlhP+Rl4+pLjPJRPFQPYb7thH9guA785SeXlPMOj/R4q1LTbJ9v/zpJcq6XfFQFol6m1 l41dxcsmFiyG9Y6qoBW58NAnu1jl45QaCyxBm6NVuUk/64hT4AuqicUo+e7AhRpV/EmT kMqA== X-Received: by 10.112.2.167 with SMTP id 7mr2670203lbv.103.1408544336993; Wed, 20 Aug 2014 07:18:56 -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 kc1sm11853298lbc.35.2014.08.20.07.18.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Aug 2014 07:18:55 -0700 (PDT) From: Jonas Jensen To: netdev@vger.kernel.org Subject: [PATCH v5 1/2] net: moxa: clear TX descriptor length bits Date: Wed, 20 Aug 2014 16:18:42 +0200 Message-Id: <1408544322-32023-1-git-send-email-jonas.jensen@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1408459784-9385-1-git-send-email-jonas.jensen@gmail.com> References: <1408459784-9385-1-git-send-email-jonas.jensen@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140820_071920_002765_BFD384AF X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -0.8 (/) Cc: f.fainelli@gmail.com, eric.dumazet@gmail.com, linux-kernel@vger.kernel.org, Jonas Jensen , 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: No changes since v4. Applies to next-20140820 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);