Re: [PATCH net 4/4] ptp: ocp: correct the DCF output frequency
From: netdev-bot+sashiko
Date: Sun Nov 22 2026 - 15:41:23 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch fixes one bad entry in a selector table from commit
09eeb3aecc6c, the one named in its Fixes: tag.
--
ptp: ocp: correct the DCF output frequency
The patch changes the DCF entry in the ptp_ocp_sma_out[] selector table
from 77000 Hz to 77500 Hz. That brings it in line with the input table
and the DPLL supported frequency list, so the advertised DCF77 frequency
can be set and read back on an output pin.
Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@xxxxxxxxxx
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 650047581fd41..aa950cae68f46 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -1376,7 +1376,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 },
[Severity: Medium]
Should the ART input table get the same kind of fix? Commit 09eeb3aecc6c,
the one in the Fixes: tag, also added this entry to ptp_ocp_art_sma_in[]:
drivers/ptp/ptp_ocp.c:
static const struct ocp_selector ptp_ocp_art_sma_in[] = {
{ .name = "PPS1", .value = 0x0001, .frequency = 1 },
{ .name = "10Mhz", .value = 0x0008, .frequency = 1000000 },
{ }
};
The entry is named "10Mhz" but has a frequency of 1 MHz. The "10Mhz"
entry in ptp_ocp_art_sma_out[] uses 10000000.
ptp_ocp_art_sma_init() registers the ART pins with ptp_ocp_sma_freq
as their supported list:
.freq_supported_num = ARRAY_SIZE(ptp_ocp_sma_freq),
.freq_supported = ptp_ocp_sma_freq,
That list contains DPLL_PIN_FREQUENCY_10MHZ but not 1 MHz.
This seems to give the same two symptoms the commit message describes
for DCF, but on ART input pins.
On set, a DPLL netlink request for 10000000 passes
dpll_pin_is_freq_supported() in the core. It then reaches the
exact-match loop in ptp_ocp_dpll_frequency_set():
for (i = 0; tbl[i].name; i++)
if (tbl[i].frequency == frequency)
return ptp_ocp_sma_store_val(bp, tbl[i].value,
sma->mode, sma_nr + 1);
return -EINVAL;
Nothing in the table matches, so the call returns -EINVAL.
On get, ptp_ocp_dpll_frequency_get() reports 1000000 for an ART input
that selects 0x08. That value is not in the pin's advertised set. Fixed
pins hit this too, because sma[0].default_fcn is 0x08 ("IN: 10Mhz").
Would it make sense to change that entry to 10000000 in this patch, or
in a follow-up?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-timecard-common-301f823ddd-0-ahmadexp%40gmail.com