netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: renesas: Fix rgmii-id delays
@ 2021-10-19 14:57 Kory Maincent
  2021-10-19 15:13 ` Geert Uytterhoeven
  2021-10-19 15:47 ` Andrew Lunn
  0 siblings, 2 replies; 11+ messages in thread
From: Kory Maincent @ 2021-10-19 14:57 UTC (permalink / raw)
  To: netdev, linux-renesas-soc, linux-kernel
  Cc: thomas.petazzoni, Sergey Shtylyov, David S. Miller,
	Jakub Kicinski, Lad Prabhakar, Biju Das, Sergei Shtylyov,
	Andrew Lunn, Adam Ford, Yoshihiro Shimoda, Geert Uytterhoeven,
	Yang Yingliang

Invert the configuration of the RGMII delay selected by RGMII_RXID and
RGMII_TXID.

The ravb MAC is adding RX delay if RGMII_RXID is selected and TX delay
if RGMII_TXID but that behavior is wrong.
Indeed according to the ethernet.txt documentation the ravb configuration
should be inverted:
  * "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
     should not add an RX delay in this case)
  * "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
     should not add an TX delay in this case)

This patch inverts the behavior, i.e adds TX delay when RGMII_RXID is
selected and RX delay when RGMII_TXID is selected.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 drivers/net/ethernet/renesas/ravb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 0f85f2d97b18..89cd88e5b450 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2114,13 +2114,13 @@ static void ravb_parse_delay_mode(struct device_node *np, struct net_device *nde
 	/* Fall back to legacy rgmii-*id behavior */
 	if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
 	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) {
-		priv->rxcidm = 1;
+		priv->txcidm = 1;
 		priv->rgmii_override = 1;
 	}
 
 	if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
 	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
-		priv->txcidm = 1;
+		priv->rxcidm = 1;
 		priv->rgmii_override = 1;
 	}
 }
-- 
2.25.1


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

end of thread, other threads:[~2021-10-20 12:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-19 14:57 [PATCH] net: renesas: Fix rgmii-id delays Kory Maincent
2021-10-19 15:13 ` Geert Uytterhoeven
2021-10-19 15:35   ` Köry Maincent
2021-10-19 15:41     ` Andrew Lunn
2021-10-19 15:57       ` Thomas Petazzoni
2021-10-19 20:05         ` Geert Uytterhoeven
2021-10-20  8:53           ` Köry Maincent
2021-10-20  9:05             ` Geert Uytterhoeven
2021-10-20 12:16             ` Andrew Lunn
2021-10-19 15:44     ` Geert Uytterhoeven
2021-10-19 15:47 ` 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).