)]}'
{
  "commit": "631c3b1859809decbdb3bd96226b59efd1004389",
  "tree": "f4bddb54f75fea97bbb3478bfe8bd43459ecc0f9",
  "parents": [
    "1f1f8e8c5176234fa31858cd25f2e9b88aac0a45",
    "23d23e6c6517d0fea4f64340a23e33c89f82c03c"
  ],
  "author": {
    "name": "Paolo Abeni",
    "email": "pabeni@redhat.com",
    "time": "Mon Nov 02 15:02:49 2026 +0100"
  },
  "committer": {
    "name": "Paolo Abeni",
    "email": "pabeni@redhat.com",
    "time": "Mon Nov 02 15:02:49 2026 +0100"
  },
  "message": "Merge branch \u0027sfc-fix-ptp-synchronization-races\u0027\n\nAlex Austin says:\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nsfc: fix PTP synchronization races\n\nThis series fixes PTP synchronization races found by code inspection, and\na related frequency-adjustment bug found while reviewing the locking.\n\nefx_ptp_start() resets the driver\u0027s cached current_adjfreq as though\nMC_CMD_PTP_OP_ENABLE also resets the NIC\u0027s frequency adjustment on the\nMC. It does not, so the next time-only adjustment reprograms the clock\nfrom a stale cache. Patch 1 removes this reset.\n\nefx_ptp_pps_worker() and the SIOCSHWTSTAMP path through\nefx_ptp_change_mode() both call efx_ptp_synchronize(). Concurrent calls\ncan interfere with the shared DMA handshake and the shared timeset\nresults, because the MCDI interface is released inside\nefx_mcdi_rpc_finish() and acquired after the handshake flag is cleared.\nPatch 2 serializes a function\u0027s synchronization transactions and clock\noperations under a new mutex. Patch 3 returns the PPS timestamp in\ncaller-owned storage to prevent concurrent synchronization from\noverwriting it while the PPS worker reads it.\n\nTested on two hosts with X2522-25G NICs cabled back to back at 25G.\nBoth PCI functions share one clock.\n\nClock operations on the function that registers the clock were run\nagainst repeated efx_ptp_change_mode() -\u003e efx_ptp_synchronize() on the\nother function:\n\n  hwstamp_ctl -i ens41f0np0 -r 1 -t 1\n  hwstamp_ctl -i ens41f1np1 -r 1 -t 1\n\n  for i in $(seq 150); do\n          phc_ctl /dev/ptp1 freq 1000\n          phc_ctl /dev/ptp1 adj 0.0001\n          phc_ctl /dev/ptp1 get\n  done \u0026\n  for i in $(seq 40); do\n          hwstamp_ctl -i ens41f1np1 -r 0 -t 0\n          hwstamp_ctl -i ens41f1np1 -r 1 -t 1\n  done \u0026\n  wait\n\n  ethtool -S ens41f1np1 | grep ptp_\n\n                                without    with\n  ptp_good_syncs                     400     400\n  ptp_bad_syncs                        0       0\n  ptp_sync_timeouts                    0       0\n  ptp_no_time_syncs                    0       0\n  ptp_invalid_sync_windows             0       0\n  ptp_undersize_sync_windows           0       8\n  ptp_oversize_sync_windows            0       0\n\nThe undersize counter rejects readings as implausibly fast rather than\ninaccurate. FW reports a 40ns minimum sync window; without the series\nthe fastest readings sit exactly on that limit, and with it they sit a\nfew nanoseconds below. The shift tracks the barrier in the mutex\nacquisition rather than the serialization it provides: an smp_mb() alone\nwhere the mutex is taken reproduces the counter on an otherwise\nunmodified driver, while a plain memory access there does not. No\nsynchronization failed: each takes eight readings and needs one to\nsucceed.\n\nEnd-to-end PTP sync quality is unchanged (tested with ptp4l and\nphc2sys).\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nLink: https://patch.msgid.link/20261026123023.3566549-1-alex.austin@amd.com\nSigned-off-by: Paolo Abeni \u003cpabeni@redhat.com\u003e\n",
  "tree_diff": []
}
