Re: [PATCH net v5 8/8] ptp: ocp: correct the ART 10 MHz input frequency

From: netdev-bot+sashiko

Date: Tue Nov 24 2026 - 23:44:58 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 only the 10 MHz case.

--

ptp: ocp: correct the ART 10 MHz input frequency

This commit changes the frequency of the ART input selector named 10Mhz
from 1000000 Hz to 10000000 Hz. That makes it match the 10 MHz value that
ART pins advertise and the matching ART output entry, so DPLL frequency
set requests for 10 MHz no longer fail with -EINVAL.

Link: https://lore.kernel.org/r/179538006772.3135.15875996486888374193@xxxxxxxxxx
Link: https://lore.kernel.org/r/179538007070.3135.8275620503580456948@xxxxxxxxxx

> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 821ecd1a13c8e..93923d5a29922 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -1385,7 +1385,7 @@ static const struct ocp_selector ptp_ocp_sma_out[] = {
>
> static const struct ocp_selector ptp_ocp_art_sma_in[] = {
> { .name = "PPS1", .value = 0x0001, .frequency = 1 },
> - { .name = "10Mhz", .value = 0x0008, .frequency = 1000000 },
> + { .name = "10Mhz", .value = 0x0008, .frequency = 10000000 },
> { }
> };

[Severity: Medium]
The table change looks correct. Is the failure described in the commit
message still reachable on ART pins for two other advertised frequencies?

ptp_ocp_art_sma_init() registers every ART SMA pin with the shared
generic list:

drivers/ptp/ptp_ocp.c:ptp_ocp_art_sma_init() {
...
.freq_supported_num = ARRAY_SIZE(ptp_ocp_sma_freq),
.freq_supported = ptp_ocp_sma_freq,
...
}

That list also advertises IRIG-B (10000 Hz) and DCF77 (77500 Hz):

static struct dpll_pin_frequency ptp_ocp_sma_freq[] = {
DPLL_PIN_FREQUENCY_1PPS,
DPLL_PIN_FREQUENCY_10MHZ,
DPLL_PIN_FREQUENCY_IRIG_B,
DPLL_PIN_FREQUENCY_DCF77,
};

Neither ptp_ocp_art_sma_in[] nor ptp_ocp_art_sma_out[] has an entry for
10000 or 77500 Hz:

static const struct ocp_selector ptp_ocp_art_sma_out[] = {
{ .name = "PHC", .value = 0x0002, .frequency = 1 },
{ .name = "GNSS", .value = 0x0004, .frequency = 1 },
{ .name = "10Mhz", .value = 0x0010, .frequency = 10000000 },
{ }
};

dpll_pin_freq_set() in drivers/dpll/dpll_netlink.c validates a request
only against the advertised list through dpll_pin_is_freq_supported().
That means DPLL_CMD_PIN_SET with DPLL_A_PIN_FREQUENCY set to 10000 or
77500 on a non-fixed_fcn ART pin passes the core check.

The request then reaches ptp_ocp_dpll_frequency_set(), where it finds no
match and returns -EINVAL:

tbl = bp->sma_op->tbl[sma->mode];
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;

Pin-get also keeps reporting IRIG-B and DCF77 for every ART pin, even
though the ART hardware has no selector for them.

Would it make sense to give ART pins their own freq_supported list that
contains only DPLL_PIN_FREQUENCY_1PPS and DPLL_PIN_FREQUENCY_10MHZ, either
in this patch or in a follow-up?

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123-timecard-common-v5-d669cfa034-0-ahmadexp%40gmail.com