From patchwork Thu Feb 25 00:36:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8415551 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26EF1C0553 for ; Thu, 25 Feb 2016 00:46:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F1F82010C for ; Thu, 25 Feb 2016 00:46:50 +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 7042E20108 for ; Thu, 25 Feb 2016 00:46:49 +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 1aYk23-0001qh-I0; Thu, 25 Feb 2016 00:43:51 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYjz5-000813-91 for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2016 00:40:48 +0000 Received: by mail-pf0-x22d.google.com with SMTP id x65so22282461pfb.1 for ; Wed, 24 Feb 2016 16:40:27 -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=NZUjE9HLoQQqrmSOqwpU0x8HyjBTO/b7FK7SaitRosM=; b=ozG6sONAifiG6Tup8xfJmuK2YyZgvPQOJwyTWpqJBlDwmlE/yEGXMN6BxjDFY+89KM niyyANSC15VxWprTdCdw8Qbkqd1/ueuu4MVmpCjs5xDc3AF3Tlk6GrzUclA6G2/tYnfe dUyNUPF4PhBphjpQK1CiVLj/xQ5kx0NI+MUvkSb1DDyWxpQ+xdsCHOLji4ANE74I7+Q5 tATSh97hQEd/O7H/lrUQKKHKVRTU4ScW80e4M3qT0w2QlXO/AyhbRa5hwNK2ZJ5/5vFI X4Ej6nFyXQSEu4VZUMtgJXHP7uEiTwRLnRomVW2I2+kU95sD7t55ppyCoOm70awP7Phq NpOQ== 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=NZUjE9HLoQQqrmSOqwpU0x8HyjBTO/b7FK7SaitRosM=; b=cgkkjiM+Ne65EAuO1Uyy2Mw4mZsk9L67xMFVUl1akcmrMO1ksT/+PL52c67Fu4rLkH ZVo/JY2Sxjben8/JNJSPbNhAOfQ9Q3Ns9iKOmoRDKNh2YhUziJjGdyg1eS+0LdYRixBY KuKif61XWi64EidLKDQ4XNCrMuD79NALJj1Oa4n9o2JZF9UsabsUgynlpkgBZEu3yGBP BOVc34KMQYArzQ1FAzmLes9ktvd6HAsL3+8DvxlH+nBLZ6xJvfKJHYbHy/lsOfIl0QeC 5neSyQnvY6ynGjnra2yTIsZ4wNoOlno+7yuxFPbMM25JP6QzNoA6O27Ari2xJd250d4x xZTA== X-Gm-Message-State: AG10YOTzyBQK7M3Ixkr1+AFZOUGOf5ezFTe0XonT8dYxAhmjAxRxkPM0uNfWYqsv5zkuLg== X-Received: by 10.98.87.141 with SMTP id i13mr58274168pfj.72.1456360827598; Wed, 24 Feb 2016 16:40:27 -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 79sm7561982pfr.22.2016.02.24.16.40.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 16:40:26 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next V2 09/16] net: fec: move restart test for efficiency Date: Wed, 24 Feb 2016 17:36:52 -0700 Message-Id: <1456360619-24390-10-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456360619-24390-1-git-send-email-troy.kisky@boundarydevices.com> References: <1456360619-24390-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_164047_485106_1F3680E2 X-CRM114-Status: GOOD ( 11.69 ) 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, stillcompiling@gmail.com, linux@arm.linux.org.uk, arnd@arndb.de, sergei.shtylyov@cogentembedded.com, Troy Kisky , laci@boundarydevices.com, johannes@sipsolutions.net, 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 This saves 1 comparison. Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index b5ed287..1902897 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1157,8 +1157,13 @@ static void fec_txq(struct net_device *ndev, struct fec_enet_private *fep, /* Order the load of bd.cur and cbd_sc */ rmb(); status = fec16_to_cpu(READ_ONCE(bdp->cbd_sc)); - if (status & BD_ENET_TX_READY) + if (status & BD_ENET_TX_READY) { + if (!readl(txq->bd.reg_desc_active)) { + /* ERR006358 has hit, restart tx */ + writel(0, txq->bd.reg_desc_active); + } break; + } index = fec_enet_get_bd_index(bdp, &txq->bd); @@ -1230,11 +1235,6 @@ static void fec_txq(struct net_device *ndev, struct fec_enet_private *fep, netif_tx_wake_queue(nq); } } - - /* ERR006538: Keep the transmitter going */ - if (bdp != txq->bd.cur && - readl(txq->bd.reg_desc_active) == 0) - writel(0, txq->bd.reg_desc_active); } static int