linux/drivers/net/ethernet/amd
Gregory Fuchedgi 383d0fb894 amd-xgbe: fix PTP addend overflow causing frozen clock
XGBE_PTP_ACT_CLK_FREQ and XGBE_V2_PTP_ACT_CLK_FREQ were 10x too
large (500MHz/1GHz instead of 50MHz/100MHz), causing the computed
addend to overflow the 32-bit tstamp_addend. In the general case
this would result in the clock advancing at the wrong rate. For v2
(PCI), ptpclk_rate is hardcoded to 125MHz, so the addend formula
(ACT_CLK_FREQ << 32) / ptpclk_rate yields exactly 8 * 2^32, and
when stored to the 32-bit tstamp_addend the value is zero. With
addend = 0 the hardware accumulator never overflows and the PTP
clock is fully stopped. For v1 (platform), ptpclk_rate is read from
ACPI/DT so the exact overflow behavior depends on the
firmware-reported frequency.

Define the constants as NSEC_PER_SEC / SSINC so the relationship is
explicit and cannot drift out of sync.

Fixes: fbd47be098 ("amd-xgbe: add hardware PTP timestamping support")
Tested-by: Gregory Fuchedgi <gfuchedgi@gmail.com>
Signed-off-by: Gregory Fuchedgi <gfuchedgi@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260429-fix-xgbe-ptp-addend-v1-1-fca5b0ca5e62@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-02 10:16:27 -07:00
..
pds_core Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
xgbe amd-xgbe: fix PTP addend overflow causing frozen clock 2026-05-02 10:16:27 -07:00
7990.c net: amd: add missing MODULE_DESCRIPTION() macros 2024-06-19 17:21:40 -07:00
7990.h net: 7990: Fix use correct return type for ndo_start_xmit() 2020-05-06 14:26:14 -07:00
a2065.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
a2065.h
amd8111e.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
amd8111e.h net: amd8111e: Remove duplicate definition of PCI_VENDOR_ID_AMD 2024-10-28 15:48:51 -07:00
ariadne.c net: amd: add missing MODULE_DESCRIPTION() macros 2024-06-19 17:21:40 -07:00
ariadne.h
atarilance.c net: amd: add missing MODULE_DESCRIPTION() macros 2024-06-19 17:21:40 -07:00
au1000_eth.c net: au1000_eth: Mark au1000_ReleaseDB() static 2025-03-25 08:27:27 -07:00
au1000_eth.h au1000_eth: stop using virt_to_bus() 2022-06-08 11:32:02 -07:00
declance.c declance: Include the offending address with DMA errors 2026-03-31 19:32:41 -07:00
hplance.c net: amd: add missing MODULE_DESCRIPTION() macros 2024-06-19 17:21:40 -07:00
hplance.h
Kconfig drivers: net: amd: nmclan: Remove this driver 2026-04-23 15:56:49 -07:00
Makefile drivers: net: amd: nmclan: Remove this driver 2026-04-23 15:56:49 -07:00
mvme147.c net: amd: mvme147: Fix probe banner message 2024-10-09 12:45:51 +01:00
pcnet32.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
sun3lance.c net: amd: add missing MODULE_DESCRIPTION() macros 2024-06-19 17:21:40 -07:00
sunlance.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00