Hi Andrew, On Tue, Apr 16, 2024 at 3:05 PM Andrew Lunn <andrew@xxxxxxx> wrote: > > > > + if (!of_property_read_u32(np, "rx-internal-delay-ps", &delay)) > > > > + if (delay) > > > > + val |= GPOUT_RDM; > > > > + > > > > + /* Valid values are 0 and 2000, according to DT bindings */ > > > > + if (!of_property_read_u32(np, "tx-internal-delay-ps", &delay)) > > > > + if (delay) > > > > + val |= GPOUT_TDM; > > > > + > > > > + rtsn_write(priv, GPOUT, val); > > > > > > So you seem to be using it as bool? > > > > Yes. > > > > > That is wrong. It is a number of pico seconds! > > > > The issue is that the hardware only supports no delay or a fixed delay > > that can depend on electric properties of the board. > > The general convention is that the MAC does not add delays, it leaves > it to the PHY. Probably 95% of boards are like this, and many MAC > drivers don't even add support for configuring their hardware delays, > it is not needed. Those that do, it is generally for fine tuning the > delays, being able to add/remove 100s of pico seconds, not the full > 2us. This hardware cannot do that. > > So i suggest you drop all this code, and just hard code the delay to > 0ps. IIRC (from users of RAVB, which have similar delay bits), the issue is that some boards require a larger delay than the maximum delay supported by the Micrel KSZ9031 PHY (960 ps). Hence these boards need to enable the MAC delay. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds