diff mbox series

[net,v3] net: ngbe: Fix phy mode set to external phy

Message ID E6759CF1387CF84C+20240820030425.93003-1-mengyuanlou@net-swift.com (mailing list archive)
State Accepted
Commit f2916c83d746eb99f50f42c15cf4c47c2ea5f3b3
Delegated to: Netdev Maintainers
Headers show
Series [net,v3] net: ngbe: Fix phy mode set to external phy | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: rmk+kernel@armlinux.org.uk; 3 maintainers not CCed: linux@armlinux.org.uk rmk+kernel@armlinux.org.uk edumazet@google.com
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-20--09-00 (tests: 712)

Commit Message

Mengyuan Lou Aug. 20, 2024, 3:04 a.m. UTC
The MAC only has add the TX delay and it can not be modified.
MAC and PHY are both set the TX delay cause transmission problems.
So just disable TX delay in PHY, when use rgmii to attach to
external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
And it is does not matter to internal phy.

Fixes: bc2426d74aa3 ("net: ngbe: convert phylib to phylink")
Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
Cc: stable@vger.kernel.org # 6.3+
---
v3:
-Rebase the fix commit for net.
v2:
-Add a comment for the code modification.
-Add the problem in commit messages.
https://lore.kernel.org/netdev/E9C427FDDCF0CBC3+20240812103025.42417-1-mengyuanlou@net-swift.com/
v1:
https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/

 drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jacob Keller Aug. 20, 2024, 9:46 p.m. UTC | #1
On 8/19/2024 8:04 PM, Mengyuan Lou wrote:
> The MAC only has add the TX delay and it can not be modified.
> MAC and PHY are both set the TX delay cause transmission problems.
> So just disable TX delay in PHY, when use rgmii to attach to
> external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
> And it is does not matter to internal phy.
> 
> Fixes: bc2426d74aa3 ("net: ngbe: convert phylib to phylink")
> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> Cc: stable@vger.kernel.org # 6.3+
> ---
> v3:
> -Rebase the fix commit for net.
> v2:
> -Add a comment for the code modification.
> -Add the problem in commit messages.
> https://lore.kernel.org/netdev/E9C427FDDCF0CBC3+20240812103025.42417-1-mengyuanlou@net-swift.com/
> v1:
> https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/
> 
>  drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> index ec54b18c5fe7..a5e9b779c44d 100644
> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
> @@ -124,8 +124,12 @@ static int ngbe_phylink_init(struct wx *wx)
>  				   MAC_SYM_PAUSE | MAC_ASYM_PAUSE;
>  	config->mac_managed_pm = true;
>  
> -	phy_mode = PHY_INTERFACE_MODE_RGMII_ID;
> -	__set_bit(PHY_INTERFACE_MODE_RGMII_ID, config->supported_interfaces);
> +	/* The MAC only has add the Tx delay and it can not be modified.
> +	 * So just disable TX delay in PHY, and it is does not matter to
> +	 * internal phy.
> +	 */

The language of the comment seems a bit weird to me. It makes more sense
if it read "as it does not matter to the internal PHY".

That being said, its a bit of a nit. With our without changing the comment:

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

> +	phy_mode = PHY_INTERFACE_MODE_RGMII_RXID;
> +	__set_bit(PHY_INTERFACE_MODE_RGMII_RXID, config->supported_interfaces);
>  
>  	phylink = phylink_create(config, NULL, phy_mode, &ngbe_mac_ops);
>  	if (IS_ERR(phylink))
patchwork-bot+netdevbpf@kernel.org Aug. 22, 2024, 11 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue, 20 Aug 2024 11:04:25 +0800 you wrote:
> The MAC only has add the TX delay and it can not be modified.
> MAC and PHY are both set the TX delay cause transmission problems.
> So just disable TX delay in PHY, when use rgmii to attach to
> external phy, set PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
> And it is does not matter to internal phy.
> 
> Fixes: bc2426d74aa3 ("net: ngbe: convert phylib to phylink")
> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> Cc: stable@vger.kernel.org # 6.3+
> 
> [...]

Here is the summary with links:
  - [net,v3] net: ngbe: Fix phy mode set to external phy
    https://git.kernel.org/netdev/net/c/f2916c83d746

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
index ec54b18c5fe7..a5e9b779c44d 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
@@ -124,8 +124,12 @@  static int ngbe_phylink_init(struct wx *wx)
 				   MAC_SYM_PAUSE | MAC_ASYM_PAUSE;
 	config->mac_managed_pm = true;
 
-	phy_mode = PHY_INTERFACE_MODE_RGMII_ID;
-	__set_bit(PHY_INTERFACE_MODE_RGMII_ID, config->supported_interfaces);
+	/* The MAC only has add the Tx delay and it can not be modified.
+	 * So just disable TX delay in PHY, and it is does not matter to
+	 * internal phy.
+	 */
+	phy_mode = PHY_INTERFACE_MODE_RGMII_RXID;
+	__set_bit(PHY_INTERFACE_MODE_RGMII_RXID, config->supported_interfaces);
 
 	phylink = phylink_create(config, NULL, phy_mode, &ngbe_mac_ops);
 	if (IS_ERR(phylink))