Skip to content
Commit 80d46090 authored by Yannick Vignon's avatar Yannick Vignon Committed by Jakub Kicinski
Browse files

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: 92ba6888 ("stmmac: add the support for PTP hw clock driver")
Signed-off-by: default avatarYannick Vignon <yannick.vignon@nxp.com>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20220203160025.750632-1-yannick.vignon@oss.nxp.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 77b1b8b4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment