]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: cpsw: disable PTPv1 hw timestamping advertisement
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 29 Oct 2020 19:09:10 +0000 (21:09 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 2 Nov 2020 22:17:51 +0000 (14:17 -0800)
commit162c0a876be987f144eef241564281d958fe11d2
tree77fb71316ef26e25409e70672f699f87255b4601
parentc05fc49d95b2ca6434e5aa289f60ab77f458b1a1
net: ethernet: ti: cpsw: disable PTPv1 hw timestamping advertisement

The TI CPTS does not natively support PTPv1, only PTPv2. But, as it
happens, the CPTS can provide HW timestamp for PTPv1 Sync messages, because
CPTS HW parser looks for PTP messageType id in PTP message octet 0 which
value is 0 for PTPv1. As result, CPTS HW can detect Sync messages for PTPv1
and PTPv2 (Sync messageType = 0 for both), but it fails for any other PTPv1
messages (Delay_req/resp) and will return PTP messageType id 0 for them.

The commit 99a8c629d581 ("net: ethernet: ti: cpsw: enable
HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter") added PTPv1 hw timestamping
advertisement by mistake, only to make Linux Kernel "timestamping" utility
work, and this causes issues with only PTPv1 compatible HW/SW - Sync HW
timestamped, but Delay_req/resp are not.

Hence, fix it disabling PTPv1 hw timestamping advertisement, so only PTPv1
compatible HW/SW can properly roll back to SW timestamping.

Fixes: 99a8c629d581 ("net: ethernet: ti: cpsw: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Link: https://lore.kernel.org/r/20201029190910.30789-1-grygorii.strashko@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/cpsw_ethtool.c
drivers/net/ethernet/ti/cpsw_priv.c