]> git.hungrycats.org Git - linux/commit
ptp: ocp: fix PCIe delay estimation calculation
authorVadim Fedorenko <vadim.fedorenko@linux.dev>
Wed, 7 Oct 2026 20:33:59 +0000 (20:33 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Oct 2026 18:01:02 +0000 (11:01 -0700)
commitf8c8bd159a9bf626dd4921b7746ff481fce8c758
tree2b97f1992807f5413ad59c280aa11e4bf4915391
parent93ccaf1c26e2133396173b76a071e59024daa622
ptp: ocp: fix PCIe delay estimation calculation

The commit in fixes introduced a high cap for delayas U64_MAX value
while ktime_t is actually s64. This is wrong cap as it becomes negative
value and any comparison to a real delay will fail to update delay
value. Use KTIME_MAX constant as correct max cap for PCIe delay.

The issue was hit in production (a negative value is observed):

  # cat /sys/class/timecard/ocp0/ts_window_adjust
  -3

Fixes: aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261007203359.417270-1-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c