Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4444633ybg; Tue, 29 Oct 2019 07:16:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyixMgwUeiw7PA3QWLhV856Fmu/yJKtHBUso2ZIO0sM9on8pb3CiGDKQuTsDpUE4gyNp4Fd X-Received: by 2002:aa7:d312:: with SMTP id p18mr25947437edq.303.1572358613217; Tue, 29 Oct 2019 07:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572358613; cv=none; d=google.com; s=arc-20160816; b=dBtvSo5swHgYCE11kyYmxL2V7L1U2vIsEXVXM5Uhv9zajYixJN+NlCrTJr8NWPC65w BCbx2uJGXo/S0LDRd4l0DLZTl2goPO/uYrDjobtz+zsefhNVE239ZHxV+ftUPDmHtJjf D6lLx9MoaeX6YRjNMbeDln3DySZVrzA2H8KdJEkBVRYXA3hg/8Tekzib7L0ZNz7dbi4M Lz3bpb7CA+Qma2/Bhh5aUINhSMziSVRofNVSCquI63jGOGQgpH/2TZhiItu9x/ySLUmH y5U374ngtLB2lvj+hLvDN0nyQG001tEYtqoYg/UUz9q7D4dHa4/5ARdFGerZNLH5FcOP C7IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=oatp5IrXI568Nr/m1df9EVC6zDbMOFR6dW+ALo2hknU=; b=GjRl5U9SKSFH/qYeF78RZVGi1RLPPw2+pwiJXoohXiHLJWmUlvSrJWz1lNHqWBiFU1 yxp6hN7ySdZ+nk1zItSDBRnjZ2PPH15DhV6Cj7lxxIG7lUHc9cMpBa1uRlOgBGAo8dGa z5Oqy2Mqao8xqJiTVumQ2LbkvpW4cIJOvsl0yeYeiNPNQU5Q0apmOq3HxG/Q0QavG/b6 IxZNEoOLnUkpG8rsK+n2D54utxBEZSpTwuNA4Y2Wpp6J2LH4BSpNIh6MFLG9Axga0mYg TEsFtq/zqeB+qdWW8SQ4IrnbxZHIABLtxiY/E9ccQFB+bsATOxqTRDDpu2ch9YZjPKNl Wf8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Rwr5V11u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si12127805edi.304.2019.10.29.07.16.28; Tue, 29 Oct 2019 07:16:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Rwr5V11u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389185AbfJ2OPT (ORCPT + 99 others); Tue, 29 Oct 2019 10:15:19 -0400 Received: from dc8-smtprelay2.synopsys.com ([198.182.47.102]:53318 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389090AbfJ2OPR (ORCPT ); Tue, 29 Oct 2019 10:15:17 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 814CFC0C40; Tue, 29 Oct 2019 14:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1572358517; bh=YDnL8bpwK/tRJL9FcP1ml8xixy+yOmNErBznAAvEsXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Rwr5V11uBs9LeQGmi99GYlUb0IqNiA6e1qolrjxyTpqCuC3Cicfk2uT/nzBGpxk8W +jXvIMeQWjJJdOYq4RFQodQhJ35/PeYcUY5P/9BOS7YyatD0N2V6Lx+EPQxfRW9AoB 7lkkWZGcO7j91ONJr/NgaVMV9rnpPQMVBztHuZaCXEdRXoqLTtIuEPBphduL++PF7J g6ZZmBgUmtNFFRmwtz3Kl9c9J3GUXp+vO2nGt1n+6N9pQOx6DqEZc/syY4FedsHdwN 7OELlq3edN8pp9W8Ke7U0HwvpyErLglkwj517Qes3BwCTyyqN2B3anTxr6rh2SPl71 0gxP4YXRZiz/A== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 20D86A007D; Tue, 29 Oct 2019 14:15:15 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 8/9] net: stmmac: xgmac: Disable Flow Control when 1 or more queues are in AV Date: Tue, 29 Oct 2019 15:14:52 +0100 Message-Id: <238f9ff3de526e122a4f2db43a597553649c4339.1572355609.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When in AVB mode we need to disable flow control to prevent MAC from pausing in TX side. Fixes: ec6ea8e3eee9 ("net: stmmac: Add CBS support in XGMAC2") Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Maxime Coquelin Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c index 7bd1447f9f47..f148cb2061d8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c @@ -473,6 +473,7 @@ static void dwxgmac2_enable_tso(void __iomem *ioaddr, bool en, u32 chan) static void dwxgmac2_qmode(void __iomem *ioaddr, u32 channel, u8 qmode) { u32 value = readl(ioaddr + XGMAC_MTL_TXQ_OPMODE(channel)); + u32 flow = readl(ioaddr + XGMAC_RX_FLOW_CTRL); value &= ~XGMAC_TXQEN; if (qmode != MTL_QUEUE_AVB) { @@ -480,6 +481,7 @@ static void dwxgmac2_qmode(void __iomem *ioaddr, u32 channel, u8 qmode) writel(0, ioaddr + XGMAC_MTL_TCx_ETS_CONTROL(channel)); } else { value |= 0x1 << XGMAC_TXQEN_SHIFT; + writel(flow & (~XGMAC_RFE), ioaddr + XGMAC_RX_FLOW_CTRL); } writel(value, ioaddr + XGMAC_MTL_TXQ_OPMODE(channel)); -- 2.7.4