From patchwork Thu Jan 28 21:25:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8154461 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9FC049F9E8 for ; Thu, 28 Jan 2016 21:55:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C535A2021B for ; Thu, 28 Jan 2016 21:55:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED9C820218 for ; Thu, 28 Jan 2016 21:55:33 +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 1aOuVy-0006zn-JC; Thu, 28 Jan 2016 21:54:06 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOu86-00068o-2T for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 21:29:27 +0000 Received: by mail-pa0-x233.google.com with SMTP id yy13so29105599pab.3 for ; Thu, 28 Jan 2016 13:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4bvrWXjb1nPVrTBWUe8QII8/d5mpMwfWUcs3df6MYhg=; b=OyRCtX/K6Ach3Hf9fP/Tr2zeMr7vsWLW5kuxf/MKmrDu62ibfDVDYSfDRLOeudT5hX yHMt9Sv+34RT0rWNT1q5PCK0J2G+VmTSDwosfwa0MyWsXnWDytmyWAS3mYvipbaA9Hdv 2GI4+4B7wz3qA4G0YTJhqXMK85CKJyAA9jbVbLsAqap5CPJL9wfy7ZRmx9gtJ3fEwl36 Jgj1wZDGBqEG/ouyYv/hnFU+xY6AdtnI6cAIFtZ9ylDyyrUX/tNpBPWpcODsH599AxVj Ym1+UnFiFY4Gl08dwrbYLWxqls7WrH0mOII4H3MAyu3AC5MLQr83mj6uCcWhjJ/mQjja HRSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4bvrWXjb1nPVrTBWUe8QII8/d5mpMwfWUcs3df6MYhg=; b=C4HteC6vbInPM3cAU8GoAgz+zeE31D0YHq+eOwRbBnKVSRqcl70Xrws47GyGvNoR6M DV2j+V9D2Vo1G4EM1a7rn8KYGZxl4/N9IKsLU9ki0xuzoY4WdTNpeiaEEuHN8BGRtsNF iNce+j9oCZqHuz9pXDLd9Tin3YrwZOnuZ94DEBHegz3FhhBppIyp0FjYTM2FWFRSklCc 3MIrx10isGganXsySK3sVXSrO4YBxkM3bBrrWuDrxoTt+WRO1EDrc8ZeZGx4NewGYdLl fxCaFFY9Tkp61Xa1Fy1SQDRAJTJ7+nkZu3qFUdmEhZC8k0+fandvhetJiNI61l7pR47s tNOA== X-Gm-Message-State: AG10YOS5OnUet+GaXVEet8landDK2kER1NchhuX/0FQOcn6MkJft5zdP/0uuBfwO4feFIg== X-Received: by 10.66.121.194 with SMTP id lm2mr7979228pab.27.1454016545676; Thu, 28 Jan 2016 13:29:05 -0800 (PST) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id c90sm18583190pfd.31.2016.01.28.13.29.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 13:29:05 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next 34/40] net: fec: update dirty_tx even if no skb Date: Thu, 28 Jan 2016 14:25:58 -0700 Message-Id: <1454016364-30985-35-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> References: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_132926_318288_1890BC93 X-CRM114-Status: GOOD ( 10.94 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, andrew@lunn.ch, linux@arm.linux.org.uk, Troy Kisky , laci@boundarydevices.com, l.stach@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, tremyfr@gmail.com 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 If dirty_tx isn't updated, then dma_unmap_single will be called twice. Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 512b1ad..8dea600 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1236,10 +1236,8 @@ static void fec_txq(struct net_device *ndev, struct fec_enet_private *fep, dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr, bdp->cbd_datlen, DMA_TO_DEVICE); bdp->cbd_bufaddr = 0; - if (!skb) { - bdp = fec_enet_get_nextdesc(bdp, &txq->bd); - continue; - } + if (!skb) + goto skb_done; /* Check for errors. */ if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | @@ -1278,7 +1276,7 @@ static void fec_txq(struct net_device *ndev, struct fec_enet_private *fep, /* Free the sk buffer associated with this last transmit */ dev_kfree_skb_any(skb); - +skb_done: /* Make sure the update to bdp and tx_skbuff are performed * before dirty_tx */