Re: [PATCH V4 1/3] net: stmmac: Fix PTP ref clock for Tegra234

Simon Horman
2026-04-03T15:17:03Z

On Wed, Apr 01, 2026 at 11:29:39AM +0100, Jon Hunter wrote:
> Since commit 030ce919e114 ("net: stmmac: make sure that ptp_rate is not
> 0 before configuring timestamping") was added the following error is
> observed on Tegra234:
>
> ERR KERN tegra-mgbe 6800000.ethernet eth0: Invalid PTP clock rate
> WARNING KERN tegra-mgbe 6800000.ethernet eth0: PTP init failed
>
> It turns out that the Tegra234 device-tree binding defines the PTP ref
> clock name as 'ptp-ref' and not 'ptp_ref' and the above commit now
> exposes this and that the PTP clock is not configured correctly.
>
> In order to update device-tree to use the correct 'ptp_ref' name, update
> the Tegra MGBE driver to use 'ptp_ref' by default and fallback to using
> 'ptp-ref' if this clock name is present.
>
> Fixes: d8ca113724e7 ("net: stmmac: tegra: Add MGBE support")
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

The nit below notwithstanding this looks good to me.

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
> .../net/ethernet/stmicro/stmmac/dwmac-tegra.c | 20 +++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> index b4b39e6a169e..3af2f001fada 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c

...

> @@ -216,6 +216,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
> struct plat_stmmacenet_data *plat;
> struct stmmac_resources res;
> struct tegra_mgbe *mgbe;
> + bool use_legacy_ptp = false;
> int irq, err, i;
> u32 value;
>

nit: As this is Networking code, please retain reverse xmas tree order --
longest line to shortest -- for local variable declarations.

...