From: netdev-bot+sashiko@kernel.org
To: ahmadexp@gmail.com
Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
richardcochran@gmail.com, andrew+netdev@lunn.ch,
arkadiusz.kubalewski@intel.com, davem@davemloft.net,
edumazet@kernel.org, jiri@resnulli.us, kuba@kernel.org,
pabeni@redhat.com
Subject: Re: [PATCH net v2 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations
Date: Mon, 23 Nov 2026 21:49:50 +0000 [thread overview]
Message-ID: <179547059011.3135.15780033567922335113@kernel.org> (raw)
In-Reply-To: <20261119-timecard-common-v2-078fe69f33-2-ahmadexp@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · 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).
- [High] On ADVA TimeCard X1 boards (PCI_DEVICE_DATA(ADVA, TIMECARD_X1)
-> ocp_adva_x1_sma_op), DPLL get and dump can still fail for an…
--
ptp: ocp: use hardware selectors in DPLL frequency operations
The DPLL frequency_set op now passes the selector table value to
ptp_ocp_sma_store_val() instead of the table index. The frequency_get op
now masks the readback with SMA_SELECT_MASK before the table lookup, so
the direction enable bit does not prevent a match.
Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 4c98558e96b9c..f1f97c1fa0978 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
[ ... ]
> @@ -5921,6 +5922,7 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,
> int i;
>
> val = bp->sma_op->get(bp, sma_nr + 1);
> + val &= SMA_SELECT_MASK;
> tbl = bp->sma_op->tbl[sma->mode];
> for (i = 0; tbl[i].name; i++)
> if (val == tbl[i].value) {
[Severity: High]
Does this fully fix the get/dump failure on ADVA TimeCard X1 boards? The
commit message says:
Mask the direction enable bit before the frequency lookup. Otherwise an
enabled, direction-configurable pin has no matching table entry and its
DPLL get or dump fails. Apply both corrections to all board variants.
ptp_ocp_dpll_direction_set() switches a pin to input with selector 0:
return ptp_ocp_sma_store_val(bp, 0, mode, sma_nr + 1);
When the direction is not fixed, ptp_ocp_sma_store_val() adds the enable
bit:
if (!sma->fixed_dir)
val |= SMA_ENABLE;
The hardware therefore holds 0x8000. With the new mask, the readback in
ptp_ocp_dpll_frequency_get() becomes 0. However, ptp_ocp_adva_x1_sma_in[]
has no 0x0000 entry:
static const struct ocp_selector ptp_ocp_adva_x1_sma_in[] = {
{ .name = "PPS1", .value = 0x0001, .frequency = 1 },
...
{ .name = "None", .value = SMA_DISABLE, .frequency = 0 },
The "None" entry is BIT(16), and SMA_SELECT_MASK clears that bit. The
lookup finds no entry and returns -EINVAL.
On X1 the direction is configurable (sma_map2->gpio2 != 0xffffffff in
ptp_ocp_sma_fb_init()). In that case, does a direction change to input
through DPLL leave the pin in a state that frequency_get cannot decode?
If so, the error has three effects:
dpll_msg_add_pin_freq() passes the error up, so DPLL_CMD_PIN_GET fails
for that pin.
dpll_nl_pin_get_dumpit() only skips -ENODEV, so a system-wide pin dump
also stops with -EINVAL.
dpll_pin_freq_set() calls frequency_get() before frequency_set(). It
fails with "unable to get old frequency value", so the pin cannot be
moved to a valid frequency through DPLL either. The only way to recover
is through sysfs.
A later commit in the series, "ptp: ocp: report disabled SMA inputs
consistently over DPLL", maps disabled inputs to SMA_DISABLE ("None").
That handles the disabled-input case. The override only applies when
sma->disabled is set, though, and direction_set leaves disabled false.
So the direction_set case still appears to fail at the end of the series
(d6d7d7a64ee6).
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-timecard-common-v2-078fe69f33-0-ahmadexp%40gmail.com
next prev parent reply other threads:[~2026-11-23 21:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 21:19 [PATCH net v2 0/4] ptp: ocp: fix timestamp teardown and DPLL routing Ahmad Byagowi
2026-11-19 21:19 ` [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach Ahmad Byagowi
2026-11-19 22:23 ` Vadim Fedorenko
2026-11-19 23:46 ` Ahmad Byagowi
2026-11-20 19:31 ` Vadim Fedorenko
2026-11-20 21:21 ` Ahmad Byagowi
2026-11-19 21:19 ` [PATCH net v2 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations Ahmad Byagowi
2026-11-19 22:23 ` Vadim Fedorenko
2026-11-23 21:49 ` netdev-bot+sashiko [this message]
2026-11-23 21:58 ` Ahmad Byagowi
2026-11-19 21:19 ` [PATCH net v2 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL Ahmad Byagowi
2026-11-19 22:24 ` Vadim Fedorenko
2026-11-19 21:19 ` [PATCH net v2 4/4] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-19 22:24 ` Vadim Fedorenko
2026-11-23 21:49 ` netdev-bot+sashiko
2026-11-23 21:58 ` Ahmad Byagowi
2026-11-23 22:07 ` [PATCH net v2 0/4] ptp: ocp: fix timestamp teardown and DPLL routing Ahmad Byagowi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179547059011.3135.15780033567922335113@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=ahmadexp@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox