mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-17 06:39:37 +02:00
net: sparx5: Fix invalid timestamps
[ Upstream commit151ac45348
] Bit 270-271 are occasionally unexpectedly set by the hardware. This issue was observed with 10G SFPs causing huge time errors (> 30ms) in PTP. Only 30 bits are needed for the nanosecond part of the timestamp, clear 2 most significant bits before extracting timestamp from the internal frame header. Fixes:70dfe25cd8
("net: sparx5: Update extraction/injection for timestamping") Signed-off-by: Aakash Menon <aakash.menon@protempis.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d6c4c08670
commit
70db858273
|
@ -45,8 +45,12 @@ void sparx5_ifh_parse(u32 *ifh, struct frame_info *info)
|
|||
fwd = (fwd >> 5);
|
||||
info->src_port = FIELD_GET(GENMASK(7, 1), fwd);
|
||||
|
||||
/*
|
||||
* Bit 270-271 are occasionally unexpectedly set by the hardware,
|
||||
* clear bits before extracting timestamp
|
||||
*/
|
||||
info->timestamp =
|
||||
((u64)xtr_hdr[2] << 24) |
|
||||
((u64)(xtr_hdr[2] & GENMASK(5, 0)) << 24) |
|
||||
((u64)xtr_hdr[3] << 16) |
|
||||
((u64)xtr_hdr[4] << 8) |
|
||||
((u64)xtr_hdr[5] << 0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user