Message ID | 20221123105110.23617-1-wei.sheng.goh@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2719020wrr; Wed, 23 Nov 2022 03:03:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qFamTUZNubljX3D3LK9h+PWOODhpkO0DZ/G2asNpS6L/NjfCCRpItAhqVAbgOzATgb1st X-Received: by 2002:aa7:c78b:0:b0:467:97e4:6339 with SMTP id n11-20020aa7c78b000000b0046797e46339mr24658359eds.381.1669201417245; Wed, 23 Nov 2022 03:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669201417; cv=none; d=google.com; s=arc-20160816; b=AIhLLb0QEFbG470bjJ0hVZUpRH8WkYOMPIhD81JndBpIEdk/plO29sXk6Jt5XfoD8e q/3QxP8xHMcUxqNG42mR2XquyEfXWNagjOWiOLJLuzfiB2x24DbvzwvENNm1m1fY8fQG EaUSBrxHDrS0HAp9zpyu0D9CKySFXqIeuNTZ9fmYvZlyhWSpIzaYidNVgMzxzV+BohPQ SpzHQ5cpHhCfaTBQVl/Joa5QrCjHXO/XwY/N/Cp3E1F25C/Bq2dIyCYzIPt2T2BXUyn2 pSuTN2A8LUmkk3nf3+ZP3GWHUcK7FTo17TwCznDvpcSjaS4l6GVqKrkYTsHvO6o/8c5L ZWfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=48QXFhN6n76rA0uThOZcaSP23Uq2OevMHaou3Dl+PuQ=; b=qVmC1nfqrPOM796QMAvtWLP5PfkTG4GDaGmSa0wz/Bo7Pco0FUq/PmSCO7PCJGhGJh f6kiAsFC64gw8GJrdE5jygQ37SahcsRNXLhOOD2WJHFQIKNYLtaVK6mUkGR6TCxrHaWY j42PyT/fEJnYaSRrm06Bia1ENn65Fw+BYBz8XNem5yVZqW5QuCl28IOLNbmjN0iSXs4g lj9VLIaf1q5ixiUwSZvPSydySsgBGqjCwuNgYnJVnmdUH6DNH9fK0wg73+YR4/K8C6AL Ugw2C+7NJojCNQkmpUydm7RDIGM6e4oeSgd7mPy236JVu8+OZwjDte0ZYKDB7rXZ9qs3 XCTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Lea1g6qP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk42-20020a1709077faa00b0078dad659776si4508020ejc.320.2022.11.23.03.03.11; Wed, 23 Nov 2022 03:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Lea1g6qP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237300AbiKWK7F (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Wed, 23 Nov 2022 05:59:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236924AbiKWK6e (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 05:58:34 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C71581CD; Wed, 23 Nov 2022 02:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669200718; x=1700736718; h=from:to:cc:subject:date:message-id; bh=6iGjfHGImnQA/ryUfPU7pulSh2j0yD9AxLZ5NGkr2kQ=; b=Lea1g6qPwXgmFe2iceq3WySE50RDe4CbHDGA2O4wHfgi+XMWbRYLlS1U FlXlP//toEF1wPsn1mp1aCNwfINtJRomQW7xjHzx9lZ1z5d4vQBRTGsCl IbT/bi3KG5SXAcc1E5y1Z2JKRFq0N3LyQh5g/tybZHbOr4Lt3mv2fVwcH GPadzMci7qHzw/txGR1RhA+xvasyW41Tl1yA/8aJKWb6iGp+xpyGSUT8P DVf3tXsXme4n9HqSS1dXm5sLBSNCNxS7Q3sWxew94Mgw2jHUdvzpnRPTh YsyPGs11s83vylKcGG661is2Q5MHpVn01lbiWK9/ArNn7lmZDHgA8RHkn g==; X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="297399779" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="297399779" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2022 02:51:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10539"; a="672837333" X-IronPort-AV: E=Sophos;i="5.96,187,1665471600"; d="scan'208";a="672837333" Received: from p12ill01gohweish.png.intel.com ([10.88.229.16]) by orsmga008.jf.intel.com with ESMTP; 23 Nov 2022 02:51:53 -0800 From: "Goh, Wei Sheng" <wei.sheng.goh@intel.com> To: Giuseppe Cavallaro <peppe.cavallaro@st.com>, Alexandre Torgue <alexandre.torgue@st.com>, Jose Abreu <joabreu@synopsys.com>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Torgue <alexandre.torgue@foss.st.com>, Ong Boon Leong <boon.leong.ong@intel.com>, Voon Wei Feng <weifeng.voon@intel.com>, Tan Tee Min <tee.min.tan@intel.com>, Ahmad Tarmizi Noor Azura <noor.azura.ahmad.tarmizi@intel.com>, Looi Hong Aun <hong.aun.looi@intel.com>, Goh Wei Sheng <wei.sheng.goh@intel.com> Subject: [PATCH net v4] net: stmmac: Set MAC's flow control register to reflect current settings Date: Wed, 23 Nov 2022 18:51:10 +0800 Message-Id: <20221123105110.23617-1-wei.sheng.goh@intel.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=0.9 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750277869470501173?= X-GMAIL-MSGID: =?utf-8?q?1750284545304879419?= |
Series |
[net,v4] net: stmmac: Set MAC's flow control register to reflect current settings
|
|
Commit Message
Goh, Wei Sheng
Nov. 23, 2022, 10:51 a.m. UTC
Currently, pause frame register GMAC_RX_FLOW_CTRL_RFE is not updated correctly when 'ethtool -A <IFACE> autoneg off rx off tx off' command is issued. This fix ensures the flow control change is reflected directly in the GMAC_RX_FLOW_CTRL_RFE register. Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()") Cc: <stable@vger.kernel.org> # 5.10.x Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com> Signed-off-by: Noor Azura Ahmad Tarmizi <noor.azura.ahmad.tarmizi@intel.com> --- V3 -> V4: Fix commit message and incorrect insertions(+) value V2 -> V3: Removed value assign for 'flow' in else statement based on review comments V1 -> V2: Removed needless condition based on review comments drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)
Comments
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Wed, 23 Nov 2022 18:51:10 +0800 you wrote: > Currently, pause frame register GMAC_RX_FLOW_CTRL_RFE is not updated > correctly when 'ethtool -A <IFACE> autoneg off rx off tx off' command > is issued. This fix ensures the flow control change is reflected directly > in the GMAC_RX_FLOW_CTRL_RFE register. > > Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()") > Cc: <stable@vger.kernel.org> # 5.10.x > Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com> > Signed-off-by: Noor Azura Ahmad Tarmizi <noor.azura.ahmad.tarmizi@intel.com> > > [...] Here is the summary with links: - [net,v4] net: stmmac: Set MAC's flow control register to reflect current settings https://git.kernel.org/netdev/net/c/cc3d2b5fc0d6 You are awesome, thank you!
From: "Goh, Wei Sheng" <wei.sheng.goh@intel.com> Date: Wed, 23 Nov 2022 18:51:10 +0800 > Currently, pause frame register GMAC_RX_FLOW_CTRL_RFE is not updated > correctly when 'ethtool -A <IFACE> autoneg off rx off tx off' command > is issued. This fix ensures the flow control change is reflected directly > in the GMAC_RX_FLOW_CTRL_RFE register. Any particular reason why you completely ignored by review comments to the v3[0]? I'd like to see them fixed or at least replied. > > Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in mac_link_up()") > Cc: <stable@vger.kernel.org> # 5.10.x > Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com> > Signed-off-by: Noor Azura Ahmad Tarmizi <noor.azura.ahmad.tarmizi@intel.com> > --- > V3 -> V4: Fix commit message and incorrect insertions(+) value > V2 -> V3: Removed value assign for 'flow' in else statement based on review comments > V1 -> V2: Removed needless condition based on review comments > > drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 ++ > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++++-- > 2 files changed, 12 insertions(+), 2 deletions(-) [...] > -- > 2.17.1 [0] https://lore.kernel.org/netdev/20221123180947.488302-1-alexandr.lobakin@intel.com Thanks, Olek
Hi, > -----Original Message----- > From: Lobakin, Alexandr <alexandr.lobakin@intel.com> > Sent: Saturday, 26 November, 2022 12:02 AM > To: Goh, Wei Sheng <wei.sheng.goh@intel.com> > Cc: Lobakin, Alexandr <alexandr.lobakin@intel.com>; Giuseppe Cavallaro > <peppe.cavallaro@st.com>; Alexandre Torgue <alexandre.torgue@st.com>; > Jose Abreu <joabreu@synopsys.com>; David S . Miller <davem@davemloft.net>; > Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; > Paolo Abeni <pabeni@redhat.com>; Maxime Coquelin > <mcoquelin.stm32@gmail.com>; netdev@vger.kernel.org; linux-stm32@st-md- > mailman.stormreply.com; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org; Alexandre Torgue <alexandre.torgue@foss.st.com>; > Ong, Boon Leong <boon.leong.ong@intel.com>; Voon, Weifeng > <weifeng.voon@intel.com>; Tan, Tee Min <tee.min.tan@intel.com>; Ahmad > Tarmizi, Noor Azura <noor.azura.ahmad.tarmizi@intel.com>; Looi, Hong Aun > <hong.aun.looi@intel.com> > Subject: Re: [PATCH net v4] net: stmmac: Set MAC's flow control register to > reflect current settings > > From: "Goh, Wei Sheng" <wei.sheng.goh@intel.com> > Date: Wed, 23 Nov 2022 18:51:10 +0800 > > > Currently, pause frame register GMAC_RX_FLOW_CTRL_RFE is not updated > > correctly when 'ethtool -A <IFACE> autoneg off rx off tx off' command > > is issued. This fix ensures the flow control change is reflected > > directly in the GMAC_RX_FLOW_CTRL_RFE register. > > Any particular reason why you completely ignored by review comments to the > v3[0]? I'd like to see them fixed or at least replied. > > > > > Fixes: 46f69ded988d ("net: stmmac: Use resolved link config in > > mac_link_up()") > > Cc: <stable@vger.kernel.org> # 5.10.x > > Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com> > > Signed-off-by: Noor Azura Ahmad Tarmizi > > <noor.azura.ahmad.tarmizi@intel.com> > > --- > > V3 -> V4: Fix commit message and incorrect insertions(+) value > > V2 -> V3: Removed value assign for 'flow' in else statement based on > > review comments > > V1 -> V2: Removed needless condition based on review comments > > > > drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 ++ > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++++++-- > > 2 files changed, 12 insertions(+), 2 deletions(-) > > [...] > > > -- > > 2.17.1 > > [0] https://lore.kernel.org/netdev/20221123180947.488302-1- > alexandr.lobakin@intel.com > > Thanks, > Olek Due to v4 is being accepted. Therefore I will submit a new patch to address your review comments. Thanks and appreciate your effort for reviewing my patch.
On Mon, Nov 28, 2022 at 06:06:11AM +0000, Goh, Wei Sheng wrote: > Hi, > > > -----Original Message----- > > From: Lobakin, Alexandr <alexandr.lobakin@intel.com> > > Any particular reason why you completely ignored by review comments to the > > v3[0]? I'd like to see them fixed or at least replied. > > > > [0] https://lore.kernel.org/netdev/20221123180947.488302-1- > > alexandr.lobakin@intel.com > > > > Thanks, > > Olek > > Due to v4 is being accepted. Therefore I will submit a new patch to address your review comments. > Thanks and appreciate your effort for reviewing my patch. And on that very same subject, why did you ignore my review comments on v2?
Hi, > -----Original Message----- > From: Russell King <linux@armlinux.org.uk> > Sent: Saturday, 3 December, 2022 1:24 AM > To: Goh, Wei Sheng <wei.sheng.goh@intel.com> > Cc: Lobakin, Alexandr <alexandr.lobakin@intel.com>; Giuseppe Cavallaro > <peppe.cavallaro@st.com>; Alexandre Torgue <alexandre.torgue@st.com>; > Jose Abreu <joabreu@synopsys.com>; David S . Miller > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub > Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Maxime > Coquelin <mcoquelin.stm32@gmail.com>; netdev@vger.kernel.org; linux- > stm32@st-md-mailman.stormreply.com; linux-arm- > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Alexandre Torgue > <alexandre.torgue@foss.st.com>; Ong, Boon Leong > <boon.leong.ong@intel.com>; Voon, Weifeng <weifeng.voon@intel.com>; > Tan, Tee Min <tee.min.tan@intel.com>; Ahmad Tarmizi, Noor Azura > <noor.azura.ahmad.tarmizi@intel.com>; Looi, Hong Aun > <hong.aun.looi@intel.com> > Subject: Re: [PATCH net v4] net: stmmac: Set MAC's flow control register to > reflect current settings > > On Mon, Nov 28, 2022 at 06:06:11AM +0000, Goh, Wei Sheng wrote: > > Hi, > > > > > -----Original Message----- > > > From: Lobakin, Alexandr <alexandr.lobakin@intel.com> Any particular > > > reason why you completely ignored by review comments to the v3[0]? > > > I'd like to see them fixed or at least replied. > > > > > > [0] https://lore.kernel.org/netdev/20221123180947.488302-1- > > > alexandr.lobakin@intel.com > > > > > > Thanks, > > > Olek > > > > Due to v4 is being accepted. Therefore I will submit a new patch to address > your review comments. > > Thanks and appreciate your effort for reviewing my patch. > > And on that very same subject, why did you ignore my review comments on > v2? > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! Sorry I missed some of your comment. Will try to address them in the next submission. Also thanks and appreciate your effort for reviewing my patch.
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index c25bfecb4a2d..369db308b1dd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -748,6 +748,8 @@ static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex, if (fc & FLOW_RX) { pr_debug("\tReceive Flow-Control ON\n"); flow |= GMAC_RX_FLOW_CTRL_RFE; + } else { + pr_debug("\tReceive Flow-Control OFF\n"); } writel(flow, ioaddr + GMAC_RX_FLOW_CTRL); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8273e6a175c8..ab7f48f32f5b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1061,8 +1061,16 @@ static void stmmac_mac_link_up(struct phylink_config *config, ctrl |= priv->hw->link.duplex; /* Flow Control operation */ - if (tx_pause && rx_pause) - stmmac_mac_flow_ctrl(priv, duplex); + if (rx_pause && tx_pause) + priv->flow_ctrl = FLOW_AUTO; + else if (rx_pause && !tx_pause) + priv->flow_ctrl = FLOW_RX; + else if (!rx_pause && tx_pause) + priv->flow_ctrl = FLOW_TX; + else + priv->flow_ctrl = FLOW_OFF; + + stmmac_mac_flow_ctrl(priv, duplex); if (ctrl != old_ctrl) writel(ctrl, priv->ioaddr + MAC_CTRL_REG);