ptp: ocp: fix PCIe delay estimation calculation
Vadim Fedorenko
maintainerPATCH 1/1 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.
--- drivers/ptp/ptp_ocp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ptp/ptp_ocp.c +1 -1
@@ -1825,7 +1825,7 @@ ptp_ocp_watchdog(struct timer_list *t)static void ptp_ocp_estimate_pci_timing (struct ptp_ocp *bp) { -ktime_t start, end, delay =U64_MAX ; +ktime_t start, end, delay =KTIME_MAX ;u32 ctrl;int i;
Signature · 1 line
2.47.3
[email protected]
AI reviewThis is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
Hi!
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Vadim Fedorenko
maintainerQuoted 13 lines · On 07/10/2026 21:44, [email protected] wrote:
Hi!
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.
Quoted 8 lines
Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
The issue was hit in production (a negative value is observed):
# cat /sys/class/timecard/ocp0/ts_window_adjust -3
Quoted 1 line
The commit in fixes introduced a high cap for delayas
U64_MAXvalue
nit: I think delayas should be "delay as", probably not worth respining for.
Quoted 24 lines
while
ktime_tis actually s64. This is wrong cap as it becomes negative value and any comparison to a real delay will fail to update delay value. UseKTIME_MAXconstant as correct max cap for PCIe delay.Fixes aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")Signed-off-by Vadim Fedorenko <[email protected]>--- drivers/ptp/ptp_ocp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ptp/ptp_ocp.c +1
-2@@ -1825,7 +1825,7 @@ ptp_ocp_watchdog(struct timer_list *t)static void ptp_ocp_estimate_pci_timing (struct ptp_ocp *bp) { -ktime_t start, end, delay =U64_MAX ; +ktime_t start, end, delay =KTIME_MAX ;u32 ctrl;int i; --
Quoted 3 lines
2.47.3
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Wed, 7 Oct 2026 20:33:59 +0000 you wrote:
The commit in fixes introduced a high cap for delayas
U64_MAXvalue whilektime_tis actually s64. This is wrong cap as it becomes negative value and any comparison to a real delay will fail to update delay value. UseKTIME_MAXconstant as correct max cap for PCIe delay.Fixes aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")Signed-off-by Vadim Fedorenko <[email protected]>[...]
Here is the summary with links:
- [net] ptp: ocp: fix PCIe delay estimation calculation
https://git.kernel.org/netdev/net/c/f8c8bd159a9b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html