Skip to content
/ linux Public

Commit ae3cfa5

Browse files
DanielmachonSasha Levin
authored andcommitted
net: sparx5/lan969x: fix PTP clock max_adj value
[ Upstream commit a49d2a2 ] The max_adj field in ptp_clock_info tells userspace how much the PHC clock frequency can be adjusted. ptp4l reads this and will never request a correction larger than max_adj. On both sparx5 and lan969x the clock offset may never converge because the servo needs a frequency correction larger than the current max_adj of 200000 (200 ppm) allows. The servo rails at the max and the offset stays in the tens of microseconds. The hardware has no inherent max adjustment limit; frequency correction is done by writing a 64-bit clock period increment to CLK_PER_CFG, and the register has plenty of range. The 200000 value was just an overly conservative software limit. The max_adj is shared between sparx5 and lan969x, and the increased value is safe for both. Fix this by increasing max_adj to 10000000 (10000 ppm), giving the servo sufficient headroom. Fixes: 0933bd0 ("net: sparx5: Add support for ptp clocks") Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260212-sparx5-ptp-max-adj-v2-v1-1-06b200e50ce3@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent bf5009a commit ae3cfa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static int sparx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
562562
static struct ptp_clock_info sparx5_ptp_clock_info = {
563563
.owner = THIS_MODULE,
564564
.name = "sparx5 ptp",
565-
.max_adj = 200000,
565+
.max_adj = 10000000,
566566
.gettime64 = sparx5_ptp_gettime64,
567567
.settime64 = sparx5_ptp_settime64,
568568
.adjtime = sparx5_ptp_adjtime,

0 commit comments

Comments
 (0)