From patchwork Fri Aug 12 11:21:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 9276809 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 E3EC7600CB for ; Fri, 12 Aug 2016 11:32:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D25892899D for ; Fri, 12 Aug 2016 11:32:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C72F12899F; Fri, 12 Aug 2016 11:32:44 +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=-2.7 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable 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 872FF2899D for ; Fri, 12 Aug 2016 11:32:44 +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 1bYAg3-0004Up-U2; Fri, 12 Aug 2016 11:31:03 +0000 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bYAYv-0004aX-Ps for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2016 11:23:45 +0000 Received: by mail-pa0-x243.google.com with SMTP id ez1so1365623pab.3 for ; Fri, 12 Aug 2016 04:23:23 -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=RoBBukUwHED2GfMUqYdsIHo9b+jHBy7Mbt/wPnSATQw=; b=v4wy3dssGkgVHJg8uG7BiyG8t/MUQFssqN9+GdvWwyrrlnhSQwN0tscVkRYSGaiyje U9M2qVwX+ikNh33FKDC/m1QLSGPY6nIul2D2saKhSWOlH0RnajSa4bh9lmu1EIHQzGr3 Z6kKnoXTKSRqjYYi6ob/x6tinu/d3QUPqDCXX7v2hZ7WQYMtYOT4NlfZch7gzR8PlKiR 86YZUz9VreDHgTleNonr1MO4kMNUcMfWhjwhKsVo0rPbf5FKqQWr5PfDDHo25Dlxbz8X cszFGldOnUPl3ArvKw3PoaChK6nWsrVVwjchmtkyzw4gc5IS8gQ0LEnzPFOkKffKDOj7 L0Wg== 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=RoBBukUwHED2GfMUqYdsIHo9b+jHBy7Mbt/wPnSATQw=; b=gLhrkzQj8vHyfxmEFvPQi1jz7pgpy8I7CVcZGhRanTOzY/ZatpYYB6LU9EGzhR8Dz0 tzkYt7UpuuUqDvxWXs8D8H5JFtz6psGd44oxJSAM8ftskCzFOAkQoZip7j4lOKE2UoQf EUI/dRWdxWp+6/2Tia50vUqvlN15lLQrxj0Hwn5HONZTsf/cPys7pkPxurhP0yZVFy1Y DfUMKYTghQnp0rrcm1nSI+vCBXoDq+I/BnS4ZaK6DrMslSqEeypCHeHqKvYrCvWV72Zv HbsTZHt0ffm4N484SQSip/map1fKRIW3EcT10XpZB1pr04m5IyeB17vbdbgFuyF/FA1X 4VNg== X-Gm-Message-State: AEkoouuitOmCeOHdOoqDoH3zLntRElYJC7UA7O6unwovLzKdGYjsUDtgYutWJeVGTpa2Gg== X-Received: by 10.66.150.202 with SMTP id uk10mr26155478pab.10.1471001002514; Fri, 12 Aug 2016 04:23:22 -0700 (PDT) Received: from machine421.in.caveonetworks.com ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id ww14sm12306817pac.34.2016.08.12.04.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Aug 2016 04:23:21 -0700 (PDT) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH v2 21/21] net: thunderx: Don't set RX_PACKET_DIS while initializing Date: Fri, 12 Aug 2016 16:51:44 +0530 Message-Id: <1471000904-21715-22-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471000904-21715-1-git-send-email-sunil.kovvuri@gmail.com> References: <1471000904-21715-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160812_042342_175314_73B89961 X-CRM114-Status: GOOD ( 13.13 ) 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: Sunil Goutham , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 From: Sunil Goutham Setting BGXX_SPUX_MISC_CONTROL::RX_PACKET_DIS is not needed as packet reception is anyway disabled by BGXX_CMRX_CONFIG::DATA_PKT_RX_EN. Also setting RX_PACKET_DIS causes a bogus remote fault condition which delays link detection. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index ca58d7f..8bbaedb 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -459,12 +459,14 @@ static int bgx_lmac_xaui_init(struct bgx *bgx, struct lmac *lmac) bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_LOW_POWER); /* Set interleaved running disparity for RXAUI */ - if (lmac->lmac_type != BGX_MODE_RXAUI) - bgx_reg_modify(bgx, lmacid, - BGX_SPUX_MISC_CONTROL, SPU_MISC_CTL_RX_DIS); - else + if (lmac->lmac_type == BGX_MODE_RXAUI) bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL, - SPU_MISC_CTL_RX_DIS | SPU_MISC_CTL_INTLV_RDISP); + SPU_MISC_CTL_INTLV_RDISP); + + /* Clear receive packet disable */ + cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_MISC_CONTROL); + cfg &= ~SPU_MISC_CTL_RX_DIS; + bgx_reg_write(bgx, lmacid, BGX_SPUX_MISC_CONTROL, cfg); /* clear all interrupts */ cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_INT); @@ -537,7 +539,6 @@ static int bgx_xaui_check_link(struct lmac *lmac) int lmac_type = lmac->lmac_type; u64 cfg; - bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL, SPU_MISC_CTL_RX_DIS); if (lmac->use_training) { cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT); if (!(cfg & (1ull << 13))) { @@ -607,11 +608,6 @@ static int bgx_xaui_check_link(struct lmac *lmac) return -1; } - /* Clear receive packet disable */ - cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_MISC_CONTROL); - cfg &= ~SPU_MISC_CTL_RX_DIS; - bgx_reg_write(bgx, lmacid, BGX_SPUX_MISC_CONTROL, cfg); - /* Check for MAC RX faults */ cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_CTL); /* 0 - Link is okay, 1 - Local fault, 2 - Remote fault */