From patchwork Wed Apr 6 02:25:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8757651 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 43B039F336 for ; Wed, 6 Apr 2016 02:32:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 798F52035B for ; Wed, 6 Apr 2016 02:32:42 +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 A57AF202A1 for ; Wed, 6 Apr 2016 02:32:41 +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 1andEt-0001pm-GC; Wed, 06 Apr 2016 02:30:39 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1andD0-0007jS-Ji for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2016 02:28:43 +0000 Received: by mail-pa0-x229.google.com with SMTP id fe3so22788974pab.1 for ; Tue, 05 Apr 2016 19:28:25 -0700 (PDT) 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=v2FF9Lp198YL7euJXtgHdjeHrhxq+fMjY1aylQEvQcM=; b=rvKlyI6bS8m5JwNqkDI+LiZTg7BsbCWvsfnScJXMYZD+Uod3YYOjS8z0xv4cKu/hJs +uJ8UapVNY0yHu8LpSUYegA20fO+EqYIhX35GjrvUVuivQEoTWfr9iWp0nwMcn09c+S2 BAxyUeoUOoCGvv6+ZiBnD5fMv1BwwnEGWMAban7vXefiQ/nFlv8iJPn49/19h99brbbU FgvKfPnb+mSjEAitKa3FTowQlsyQZ7dbCyciPiMjhJLn9nb+xuayz+cz6GDhnIdSmblc tVTjQEYdXui8AVKt13cNaJsAJrKq0UTStKlfz4jx/+zHpUODBc6yYweXsr4lnHWH6dGA 42VQ== 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=v2FF9Lp198YL7euJXtgHdjeHrhxq+fMjY1aylQEvQcM=; b=hqpEkVwghuJpqyIF7Ml+C86DsgEL79uqlhF/pF87zIUNsfZpJLU5lE4cqFaIYBX5Ih wDddemSfacBcHgFibcdvs2Tr+L2smrmUvGPNHVCrmlxKlH4Ox6G0f7mQdhkzfkt4eX9l WemelkExAl6ePcbXsIRZY1eoOuVBsD1PpVzDzQqvzLRCL3mzREKYzWFc2iAbK/uF3Uuk +KwPrnbZHRF3W+GyVhHZVNvtFdSt/GVTUrSJHBbafNv3MH/1UNpnLifaJZh6cGw0eQjW WKjKpylCIM/aYQ+F3iZELejfCOOvxYgtGZ7GGtYCI0YtqyLY2X1M5I1bve+jXfWT4pbD qIYg== X-Gm-Message-State: AD7BkJIxA83ZhloEtpSeYNNtTuE1L5WlCFcP/JFyhAoEzDA1Gtk7V5+g/sdpaMtEMRsTtw== X-Received: by 10.66.235.129 with SMTP id um1mr66834740pac.17.1459909705481; Tue, 05 Apr 2016 19:28:25 -0700 (PDT) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id l14sm528682pfi.23.2016.04.05.19.28.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2016 19:28:25 -0700 (PDT) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, fugang.duan@nxp.com, lznuaa@gmail.com Subject: [PATCH net-next V3 10/16] net: fec: move restart test for efficiency Date: Tue, 5 Apr 2016 19:25:56 -0700 Message-Id: <1459909562-22865-11-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459909562-22865-1-git-send-email-troy.kisky@boundarydevices.com> References: <1459909562-22865-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160405_192842_784936_BA003531 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -1.9 (-) 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: andrew@lunn.ch, stillcompiling@gmail.com, arnd@arndb.de, sergei.shtylyov@cogentembedded.com, Troy Kisky , gerg@uclinux.org, fabio.estevam@nxp.com, johannes@sipsolutions.net, l.stach@pengutronix.de, 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=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 Move restart test to earlier in fec_txq() which saves one comparison. Signed-off-by: Troy Kisky --- v3: change commit message --- 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 349fda1..a2a9dca 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_priv_tx_q *txq) /* 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_priv_tx_q *txq) 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