From patchwork Mon Oct 31 23:00:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyappan Subramanian X-Patchwork-Id: 9406667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E77C960721 for ; Mon, 31 Oct 2016 23:02:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D994B28CC3 for ; Mon, 31 Oct 2016 23:02:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE26128DEA; Mon, 31 Oct 2016 23:02:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 8D09528CC3 for ; Mon, 31 Oct 2016 23:02:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1LZX-00066T-0d; Mon, 31 Oct 2016 23:00:55 +0000 Received: from mail-oi0-x231.google.com ([2607:f8b0:4003:c06::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c1LZI-0005tz-BF for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2016 23:00:41 +0000 Received: by mail-oi0-x231.google.com with SMTP id 128so59561017oih.0 for ; Mon, 31 Oct 2016 16:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=twGq2qDU7baoY9hbebA5X6U0JSiyuToZ5qfPe53tbJQ=; b=XplG5LPEaaxSe2ZE2NZ9vCnjtpOLwFilscreNm6Zd9acKOnzfov9hTgZqpHVQVTS0s RuTHju2jDbEo6NnHwT9HbdgIuqEVvHlU2UeCHkf9udHTlgphFVayykNLUYhP51gfn3FT Qt4/MavUOtcXr6tkn0N0/p95/WQaC9Nb/0SHk= 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=twGq2qDU7baoY9hbebA5X6U0JSiyuToZ5qfPe53tbJQ=; b=achtnemYdKOmXfJO5O9aWZG16ge91Mjst/8DPW5liu+tmnrUYaO1u3tEoWkKdPNf2S +eTngRt9zoluq1w67KfZqOjOmZ9LzcaDX3k8clWT88UoYAcTfcftOcdtCDR8r1lxq35p NIBUAi6zQiFTx0ZAqfoTiTpQQNGKv6TVqlv67qOf6ByPIuGe7+0PTCeFLZe6eLQxkiYL XSs5LuaMGXP3rlF4mmt+4HQdRMM/CsHP90l0sqspl/HzqXtvudsYUtR5CcprKUxyLDpB LQuMk0UHiPa7l7KArV94neyujNlsI1O8Ba6g+VAuvGjbXAWHwK6fTe5uDWwGD32IuEGo zEYw== X-Gm-Message-State: ABUngvc/kV/+FVojxYGqEjBw8KQ/vjLs47j5CCbTAC2fu28qXxUc3z6ueijPNCZuCf7H69Rh X-Received: by 10.36.225.135 with SMTP id n129mr9931514ith.56.1477954818524; Mon, 31 Oct 2016 16:00:18 -0700 (PDT) Received: from isubrama-dev.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id h137sm9333680itb.17.2016.10.31.16.00.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 16:00:18 -0700 (PDT) From: Iyappan Subramanian To: davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH net-next 1/2] drivers: net: xgene: fix: Disable coalescing on v1 hardware Date: Mon, 31 Oct 2016 16:00:26 -0700 Message-Id: <1477954827-9951-2-git-send-email-isubramanian@apm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477954827-9951-1-git-send-email-isubramanian@apm.com> References: <1477954827-9951-1-git-send-email-isubramanian@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161031_160040_495239_6168A66B X-CRM114-Status: GOOD ( 11.88 ) 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: Toan Le , patches@apm.com, linux-arm-kernel@lists.infradead.org, Iyappan Subramanian MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since ethernet v1 hardware has a bug related to coalescing, disabling this feature. Signed-off-by: Iyappan Subramanian Signed-off-by: Toan Le --- drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 12 ------------ drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 3 ++- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c index c481f10..5390ae8 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c @@ -204,17 +204,6 @@ static u32 xgene_enet_ring_len(struct xgene_enet_desc_ring *ring) return num_msgs; } -static void xgene_enet_setup_coalescing(struct xgene_enet_desc_ring *ring) -{ - u32 data = 0x7777; - - xgene_enet_ring_wr32(ring, CSR_PBM_COAL, 0x8e); - xgene_enet_ring_wr32(ring, CSR_PBM_CTICK1, data); - xgene_enet_ring_wr32(ring, CSR_PBM_CTICK2, data << 16); - xgene_enet_ring_wr32(ring, CSR_THRESHOLD0_SET1, 0x40); - xgene_enet_ring_wr32(ring, CSR_THRESHOLD1_SET1, 0x80); -} - void xgene_enet_parse_error(struct xgene_enet_desc_ring *ring, struct xgene_enet_pdata *pdata, enum xgene_enet_err_code status) @@ -929,5 +918,4 @@ struct xgene_ring_ops xgene_ring1_ops = { .clear = xgene_enet_clear_ring, .wr_cmd = xgene_enet_wr_cmd, .len = xgene_enet_ring_len, - .coalesce = xgene_enet_setup_coalescing, }; diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 3fc7b0d..1352b52 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -1188,7 +1188,8 @@ static int xgene_enet_create_desc_rings(struct net_device *ndev) tx_ring->dst_ring_num = xgene_enet_dst_ring_num(cp_ring); } - pdata->ring_ops->coalesce(pdata->tx_ring[0]); + if (pdata->ring_ops->coalesce) + pdata->ring_ops->coalesce(pdata->tx_ring[0]); pdata->tx_qcnt_hi = pdata->tx_ring[0]->slots - 128; return 0;