netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] net: ngbe: Fix phy mode set to external phy
@ 2024-08-20  3:04 Mengyuan Lou
  2024-08-20 21:46 ` Jacob Keller
  2024-08-22 11:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Mengyuan Lou @ 2024-08-20  3:04 UTC (permalink / raw)
  To: netdev
  Cc: pabeni, kuba, przemyslaw.kitszel, andrew, jiawenwu, duanqiangwen,
	stable, Mengyuan Lou

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.
+	 */
+	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))
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v3] net: ngbe: Fix phy mode set to external phy
  2024-08-20  3:04 [PATCH net v3] net: ngbe: Fix phy mode set to external phy Mengyuan Lou
@ 2024-08-20 21:46 ` Jacob Keller
  2024-08-22 11:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2024-08-20 21:46 UTC (permalink / raw)
  To: Mengyuan Lou, netdev
  Cc: pabeni, kuba, przemyslaw.kitszel, andrew, jiawenwu, duanqiangwen,
	stable



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))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v3] net: ngbe: Fix phy mode set to external phy
  2024-08-20  3:04 [PATCH net v3] net: ngbe: Fix phy mode set to external phy Mengyuan Lou
  2024-08-20 21:46 ` Jacob Keller
@ 2024-08-22 11:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-22 11:00 UTC (permalink / raw)
  To: Mengyuan Lou
  Cc: netdev, pabeni, kuba, przemyslaw.kitszel, andrew, jiawenwu,
	duanqiangwen, stable

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-22 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  3:04 [PATCH net v3] net: ngbe: Fix phy mode set to external phy Mengyuan Lou
2024-08-20 21:46 ` Jacob Keller
2024-08-22 11:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).