* [PATCH net] ptp: ocp: fix PCIe delay estimation calculation
@ 2026-10-07 20:33 Vadim Fedorenko
2026-10-07 20:44 ` netdev-bot+sinfo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Vadim Fedorenko @ 2026-10-07 20:33 UTC (permalink / raw)
To: Richard Cochran, Andrew Lunn, David S. Miller, Jakub Kicinski
Cc: Eric Dumazet, Paolo Abeni, netdev, Vadim Fedorenko
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.
Fixes: aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
drivers/ptp/ptp_ocp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 3d26ec1f7b9e..a8cba2f64b98 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -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;
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] ptp: ocp: fix PCIe delay estimation calculation
2026-10-07 20:33 [PATCH net] ptp: ocp: fix PCIe delay estimation calculation Vadim Fedorenko
@ 2026-10-07 20:44 ` netdev-bot+sinfo
2026-10-07 21:25 ` Vadim Fedorenko
2026-10-08 10:35 ` Daniel Machon
2026-10-08 18:40 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: netdev-bot+sinfo @ 2026-10-07 20:44 UTC (permalink / raw)
To: Vadim Fedorenko
Cc: Richard Cochran, Andrew Lunn, David S. Miller, Jakub Kicinski,
Eric Dumazet, Paolo Abeni, netdev
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ptp: ocp: fix PCIe delay estimation calculation
2026-10-07 20:44 ` netdev-bot+sinfo
@ 2026-10-07 21:25 ` Vadim Fedorenko
0 siblings, 0 replies; 5+ messages in thread
From: Vadim Fedorenko @ 2026-10-07 21:25 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: Richard Cochran, Andrew Lunn, David S. Miller, Jakub Kicinski,
Eric Dumazet, Paolo Abeni, netdev
On 07/10/2026 21:44, netdev-bot+sinfo@kernel.org 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.
>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ptp: ocp: fix PCIe delay estimation calculation
2026-10-07 20:33 [PATCH net] ptp: ocp: fix PCIe delay estimation calculation Vadim Fedorenko
2026-10-07 20:44 ` netdev-bot+sinfo
@ 2026-10-08 10:35 ` Daniel Machon
2026-10-08 18:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Machon @ 2026-10-08 10:35 UTC (permalink / raw)
To: Vadim Fedorenko
Cc: Richard Cochran, Andrew Lunn, David S. Miller, Jakub Kicinski,
Eric Dumazet, Paolo Abeni, netdev
> The commit in fixes introduced a high cap for delayas U64_MAX value
nit: I think delayas should be "delay as", probably not worth respining for.
> 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.
>
> Fixes: aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> ---
> drivers/ptp/ptp_ocp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 3d26ec1f7b9e..a8cba2f64b98 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -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;
>
> --
> 2.47.3
>
>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ptp: ocp: fix PCIe delay estimation calculation
2026-10-07 20:33 [PATCH net] ptp: ocp: fix PCIe delay estimation calculation Vadim Fedorenko
2026-10-07 20:44 ` netdev-bot+sinfo
2026-10-08 10:35 ` Daniel Machon
@ 2026-10-08 18:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-08 18:40 UTC (permalink / raw)
To: Vadim Fedorenko
Cc: richardcochran, andrew+netdev, davem, kuba, edumazet, pabeni,
netdev
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 7 Oct 2026 20:33:59 +0000 you wrote:
> 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.
>
> Fixes: aa05fe67bcd64 ("ptp: ocp: Improve PCIe delay estimation")
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-08 18:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 20:33 [PATCH net] ptp: ocp: fix PCIe delay estimation calculation Vadim Fedorenko
2026-10-07 20:44 ` netdev-bot+sinfo
2026-10-07 21:25 ` Vadim Fedorenko
2026-10-08 10:35 ` Daniel Machon
2026-10-08 18:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox