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)
commit340746398b67e3ce5019698748ebaa7adf048114
treed6e24f207a028a60d16b23793098fba0ba141c8f
parentc28d9a285668c799eeae2f7f93e929a6028a4d6d
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: 6605b730c061 ("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