]> git.baikalelectronics.ru Git - kernel.git/commit
net: fec: fix hardware time stamping by external devices
authorSergey Organov <sorganov@gmail.com>
Tue, 14 Jul 2020 16:28:02 +0000 (19:28 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 18:20:38 +0000 (11:20 -0700)
commit0376e87788680afedea0d4d4e3003a267adf642a
treed6e24f207a028a60d16b23793098fba0ba141c8f
parent43577af9a8a367f9d63586fabaf3fdf2af3530d7
net: fec: fix hardware time stamping by external devices

Fix support for external PTP-aware devices such as DSA or PTP PHY:

Make sure we never time stamp tx packets when hardware time stamping
is disabled.

Check for PTP PHY being in use and then pass ioctls related to time
stamping of Ethernet packets to the PTP PHY rather than handle them
ourselves. In addition, disable our own hardware time stamping in this
case.

Fixes: 04c83bada231 ("FEC: Add time stamping code and a PTP hardware clock")
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c
drivers/net/ethernet/freescale/fec_ptp.c