]> git.ipfire.org Git - thirdparty/linux.git/commit
igc: add lock preventing multiple simultaneous PTM transactions
authorChristopher S M Hall <christopher.s.hall@intel.com>
Tue, 1 Apr 2025 23:35:34 +0000 (16:35 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 11 Apr 2025 16:13:28 +0000 (09:13 -0700)
commit1a931c4f5e6862e61a4b130cb76b422e1415f644
tree22caef628d788fe46b59e34684263e426825b1fb
parent1f025759ba394dd53e434d2668cb0597886d9b69
igc: add lock preventing multiple simultaneous PTM transactions

Add a mutex around the PTM transaction to prevent multiple transactors

Multiple processes try to initiate a PTM transaction, one or all may
fail. This can be reproduced by running two instances of the
following:

$ sudo phc2sys -O 0 -i tsn0 -m

PHC2SYS exits with:

"ioctl PTP_OFFSET_PRECISE: Connection timed out" when the PTM transaction
 fails

Note: Normally two instance of PHC2SYS will not run, but one process
 should not break another.

Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()")
Signed-off-by: Christopher S M Hall <christopher.s.hall@intel.com>
Reviewed-by: Corinna Vinschen <vinschen@redhat.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc.h
drivers/net/ethernet/intel/igc/igc_ptp.c