Yannick Vignon 80d4609008 net: stmmac: ensure PTP time register reads are consistent
Even if protected from preemption and interrupts, a small time window
remains when the 2 register reads could return inconsistent values,
each time the "seconds" register changes. This could lead to an about
1-second error in the reported time.

Add logic to ensure the "seconds" and "nanoseconds" values are consistent.

Fixes: 92ba6888510c ("stmmac: add the support for PTP hw clock driver")
Signed-off-by: Yannick Vignon <yannick.vignon@nxp.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20220203160025.750632-1-yannick.vignon@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-03 13:54:19 -08:00
..
2022-01-14 18:50:52 -05:00
2021-12-22 10:22:13 +00:00
2022-01-16 15:53:00 +02:00
2021-12-06 09:32:47 +01:00
2021-12-24 10:23:47 +00:00
2021-11-29 20:15:03 -08:00
2022-01-23 06:20:44 +02:00