mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 00:28:54 +02:00
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:
|
||
|---|---|---|
| .. | ||
| Makefile | ||
| xgbe-common.h | ||
| xgbe-dcb.c | ||
| xgbe-debugfs.c | ||
| xgbe-desc.c | ||
| xgbe-dev.c | ||
| xgbe-drv.c | ||
| xgbe-ethtool.c | ||
| xgbe-hwtstamp.c | ||
| xgbe-i2c.c | ||
| xgbe-main.c | ||
| xgbe-mdio.c | ||
| xgbe-pci.c | ||
| xgbe-phy-v1.c | ||
| xgbe-phy-v2.c | ||
| xgbe-platform.c | ||
| xgbe-pps.c | ||
| xgbe-ptp.c | ||
| xgbe-selftest.c | ||
| xgbe-smn.h | ||
| xgbe.h | ||