Re: [PATCH] net: renesas: Fix rgmii-id delays

Andrew Lunn
2021-10-19T15:47:33Z

On Tue, Oct 19, 2021 at 04:57:17PM +0200, Kory Maincent wrote:
> 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.

This gets messy. As a general rule of thumb, the MAC should not be
adding delays, the PHY should. ravb has historically ignored that, and
it adds delays. It then needs to be careful with what it passes to the
PHY.

So with rgmii-rxid, what is actually passed to the PHY? Is your
problem you get twice the delay in one direction, and no delay in the
other?

Andrew