Re: [PATCH net v2 4/4] ptp: ocp: correct the DCF output frequency

From
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date
2026-11-19 22:24:20
Reply to
Ahmad Byagowi, 2026-11-19
On 19/11/2026 21:19, Ahmad Byagowi wrote:
quoted hunk ↗ jump to hunk
The output selector table uses 77000 Hz for DCF, whereas the input table
and the DPLL supported frequency list use 77500 Hz. A request for the
advertised DCF77 frequency consequently fails on an output, and reading
that output reports a frequency outside its advertised set.

Use 77500 Hz for the DCF output selector as well.

Reported by the netdev Sashiko AI review and confirmed by code
inspection. Source-derived C regression tests pass with ASan/UBSan;
restoring the faulty selector, mask, disabled-state or DCF value makes
the corresponding regression fail. Tests use stubbed MMIO, not hardware.
The driver object builds on current net with W=1 and KCFLAGS=-Werror. No
physical card was tested.

Codex prepared the fix, tests and changelog from the review and upstream
source, at the request to separate common-driver fixes from WiWi support
and validate removal ordering.

Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org (local)
Signed-off-by: Ahmad Byagowi <redacted>
---
  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 06d05fac6e..0d3d9ffd1f 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -1375,7 +1375,7 @@ static const struct ocp_selector ptp_ocp_sma_out[] = {
  	{ .name = "GNSS1",	.value = 0x0004,  .frequency = 1 },
  	{ .name = "GNSS2",	.value = 0x0008,  .frequency = 1 },
  	{ .name = "IRIG",	.value = 0x0010,  .frequency = 10000 },
-	{ .name = "DCF",	.value = 0x0020,  .frequency = 77000 },
+	{ .name = "DCF",	.value = 0x0020,  .frequency = 77500 },
  	{ .name = "GEN1",	.value = 0x0040 },
  	{ .name = "GEN2",	.value = 0x0080 },
  	{ .name = "GEN3",	.value = 0x0100 },
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Thread (12 messages) 12 messages, 2 authors, last reply 52m ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help