Re: [PATCH net-next 5/5] net: mdio: bcm-unimac: implement timestamped MDIO writes
flat view
From: James Clark <hidden>
Date: 2026-10-12 00:54:45
Also in:
lkml
On Sun, Oct 11, 2026 at 8:22 PM Nicolai Buchwitz [off-list ref] wrote:
quoted
Let me just confirm how I would need to adapt my patch with that fix: in the pdata branch of the probe, I would call devm_clk_get_optional to find the clock on the mdio node, falling back to pdata->clk. I would still add the chip-specific compatible string because the number of MDC periods has only been measured on that specific hardware.In the unimac patch you would only need clk_get_rate() and can gate write_sts() on it. Not sure about pdata->clk though: bcmgenet passes its "enet" MAC clock there, which isn't necessarily the MDC reference. If write_sts() only trusts a clock on the mdio node itself, you don't need the compatible either.
Sashiko wanted write_sts limited to BCM2711 because the 63.5 to 64.5 window has only been measured on BCM2711 and we don't have evidence that it applies elsewhere. If it doesn't, then we could potentially violate what PTP_SYS_OFFSET_EXTENDED promises. I think one could argue that this is too conservative: clause 22 specifies 64 bits and the 63.5 to 64.5 range falls out of that given a free-running MDC and some other reasonable assumptions. Andrew made a similar point on 4/5 (https://lore.kernel.org/netdev/c136b0ad-6d7e-4695-b988-55eb37550d01@lunn.ch/ (local)). Florian said he wanted a compatible string but I am not sure whether because of this or because of the clock. In any case, I am happy to do it whichever way you and Florian decide. In the probe, I believe I still need to add a call to devm_clk_get_optional() in the pdata branch, which is used when GENET creates the UniMAC device. At the moment this branch does priv->clk = pdata->clk, so it would not pick up the new GISB clock from the mdio node. I think this new clock would live alongside the existing pdata->clk: the write_sts rate would come from the mdio node clock, but pdata->clk would be used for gating. I was not planning for this series to make clk_set use the new GISB clock. James