netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: ngbe: Fix phy mode set to external phy
@ 2024-08-12 10:30 Mengyuan Lou
  2024-08-15 10:15 ` Paolo Abeni
  0 siblings, 1 reply; 10+ messages in thread
From: Mengyuan Lou @ 2024-08-12 10:30 UTC (permalink / raw)
  To: netdev; +Cc: przemyslaw.kitszel, andrew, jiawenwu, duanqiangwen, 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: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")
Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
---
v2:
-Add a comment for the code modification.
-Add the problem in commit messages.
v1:
https://lore.kernel.org/netdev/C1587837D62D1BC0+20240806082520.29193-1-mengyuanlou@net-swift.com/

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

diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
index ba33a57b42c2..0876b2e810c0 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
@@ -215,10 +215,14 @@ int ngbe_phy_connect(struct wx *wx)
 {
 	int ret;
 
+	/* 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.
+	 */
 	ret = phy_connect_direct(wx->netdev,
 				 wx->phydev,
 				 ngbe_handle_link_change,
-				 PHY_INTERFACE_MODE_RGMII_ID);
+				 PHY_INTERFACE_MODE_RGMII_RXID);
 	if (ret) {
 		wx_err(wx, "PHY connect failed.\n");
 		return ret;
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH net] net: ngbe: Fix phy mode set to external phy
@ 2024-08-06  8:25 Mengyuan Lou
  2024-08-06 11:13 ` Przemek Kitszel
  0 siblings, 1 reply; 10+ messages in thread
From: Mengyuan Lou @ 2024-08-06  8:25 UTC (permalink / raw)
  To: netdev; +Cc: Mengyuan Lou

When use rgmmi to attach to external phy, set
PHY_INTERFACE_MODE_RGMII_RXID to phy drivers.
And it is does matter to internal phy.

Fixes: a1cf597b99a7 ("net: ngbe: Add ngbe mdio bus driver.")
Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
---
 drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
index ba33a57b42c2..be99ef5833da 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c
@@ -218,7 +218,7 @@ int ngbe_phy_connect(struct wx *wx)
 	ret = phy_connect_direct(wx->netdev,
 				 wx->phydev,
 				 ngbe_handle_link_change,
-				 PHY_INTERFACE_MODE_RGMII_ID);
+				 PHY_INTERFACE_MODE_RGMII_RXID);
 	if (ret) {
 		wx_err(wx, "PHY connect failed.\n");
 		return ret;
-- 
2.43.2


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

end of thread, other threads:[~2024-08-16 15:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 10:30 [PATCH net] net: ngbe: Fix phy mode set to external phy Mengyuan Lou
2024-08-15 10:15 ` Paolo Abeni
2024-08-16  6:11   ` mengyuanlou
2024-08-16 15:19     ` Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2024-08-06  8:25 Mengyuan Lou
2024-08-06 11:13 ` Przemek Kitszel
2024-08-07  5:42   ` mengyuanlou
2024-08-07 12:58     ` Andrew Lunn
2024-08-08  7:23       ` mengyuanlou
2024-08-08 14:32         ` Andrew Lunn

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