Skip to content

net: stmmac: correctly populate ptp_clock_ops.getcrosststamp

Russell King (Oracle) linux-arm-kernel netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 2 patches 1 replyApplied

Patches in v1 Applied

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] net: stmmac: correctly populate ptp_clock_ops.getcrosststamp

Hi,

While reviewing code in the stmmac PTP driver, I noticed that the getcrosststamp() method is always populated, irrespective of whether it is implemented or not by the stmmac platform specific glue layer.

Where a platform specific glue layer does not implement it, the core stmmac driver code returns -EOPNOTSUPP. However, the PTP clock core code uses the presence of the method in ptp_clock_ops to determine whether this facility should be advertised to userspace (see ptp_clock_getcaps()).

Moreover, the only platform glue that implements this method is the Intel glue, and for it not to return -EOPNOTSUPP, the CPU has to support X86_FEATURE_ART.

This series updates the core stmmac code to only provide the getcrosststamp() method in ptp_clock_ops when the platform glue code provides an implementation, and then updates the Intel glue code to only provide its implementation when the CPU has the necessary X86_FEATURE_ART feature.

As I do not have an Intel card to test with, these changes are untested, so if anyone has such a card, please test. Thanks.

 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c |  7 +++----
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c  | 10 ++++------
 2 files changed, 7 insertions(+), 10 deletions(-)
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!