From: netdev-bot+sashiko@kernel.org
To: ahmadexp@gmail.com
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
arkadiusz.kubalewski@intel.com, davem@davemloft.net,
edumazet@kernel.org, jiri@resnulli.us, kuba@kernel.org,
pabeni@redhat.com, richardcochran@gmail.com,
rmk+kernel@armlinux.org.uk, vadim.fedorenko@linux.dev,
vladimir.oltean@nxp.com
Subject: Re: [PATCH net v4 3/5] ptp: ocp: preserve disabled SMA inputs across driver rebind
Date: Tue, 24 Nov 2026 01:58:34 +0000 [thread overview]
Message-ID: <179548551472.3135.11972018356692852897@kernel.org> (raw)
In-Reply-To: <20261122-timecard-common-v4-e0db4ab1aa-3-ahmadexp@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message describes an ADVA X1 failure that no longer
exists in the tree this patch applies to.
- [Low] The Fixes: tag is incomplete.
--
ptp: ocp: preserve disabled SMA inputs across driver rebind
This patch makes ptp_ocp_dpll_frequency_get() substitute SMA_DISABLE for
disabled inputs, so the None entry reports zero Hz. It also recovers the
disabled flag from the mux enable bits in ptp_ocp_sma_fb_init() for
direction-configurable connectors, so a disabled input stays disabled
across a driver rebind.
Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org
Link: https://lore.kernel.org/r/179538006912.3135.16971430532149423594@kernel.org
> Disabling an SMA input clears its mux field. Zero is also the selector
> for 10 MHz on FB and ADVA, so a DPLL read reports 10 MHz while sysfs
> reports None. The DPLL core then skips a 10 MHz request as unchanged,
> leaving the input disabled. ADVA X1 has no zero selector; its disabled
> input instead fails the frequency lookup, blocking DPLL reads and later
> frequency changes.
[Severity: Low]
Does the ADVA X1 part of this description still hold for the tree this
patch applies to?
The previous patch in this series, "ptp: ocp: handle hardware selectors
and combined DPLL input routes", changed ptp_ocp_dpll_frequency_get().
An input that fails the exact match now falls through to the
combined-destination loop instead of returning -EINVAL:
drivers/ptp/ptp_ocp.c:ptp_ocp_dpll_frequency_get() {
...
if (sma->mode == SMA_MODE_OUT)
return -EINVAL;
/* Inputs can feed several destinations, including timestampers. */
*frequency = 0;
for (i = 0; tbl[i].name; i++) {
if (!(val & tbl[i].value))
continue;
...
return 0;
}
For a disabled ADVA X1 input, ptp_ocp_sma_store_val() has written 0 to
the mux, so val == 0. No entry in ptp_ocp_adva_x1_sma_in has value 0, so
the exact match fails. The loop then matches no bits, and the function
returns 0 with *frequency = 0. So the DPLL read succeeds, and
dpll_pin_freq_set() is not blocked.
With this patch, val = SMA_DISABLE matches the None entry, which gives
the same 0 Hz result. On ADVA X1, the new frequency_get hunk does not
appear to change anything visible. Only the rebind recovery in
ptp_ocp_sma_fb_init() has an effect there, since ocp_adva_x1_sma_op also
uses ptp_ocp_sma_fb_init.
The description matches the original 09eeb3aecc6c code. Could the
changelog say what this patch changes on top of the previous patch in
the series?
> Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
[Severity: Low]
Should this also have a Fixes: tag for b2c4f0ac53f3 ("ptp: ocp: Add
ability to disable input selectors.")?
The init-time recovery in ptp_ocp_sma_fb_init() fixes a lost disabled
state that goes back to that commit. It added the software-only
sma->disabled flag and the SMA_DISABLE substitution in
ptp_ocp_sma_show(). It also added this write in ptp_ocp_sma_store_val(),
which clears the SMA_ENABLE bit:
if (sma->disabled)
val = 0;
After a rebind with an input set to "IN: None", bp is freshly zeroed, so
disabled is false. For SMA1, for example, ptp_ocp_sma_fb_init() sees
BIT(15) of sma_map1->gpio1 clear and sets mode = SMA_MODE_OUT. Sysfs then
reports an output function for a connector with neither buffer enabled.
This happens without any DPLL involvement.
With only Fixes: 09eeb3aecc6c, stable trees that have b2c4f0ac53f3 but
not the DPLL ops commit would not be offered the rebind part of this
fix.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122-timecard-common-v4-e0db4ab1aa-0-ahmadexp%40gmail.com
next prev parent reply other threads:[~2026-11-24 1:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 1:57 [PATCH net v4 0/5] Fix PTP teardown and Time Card DPLL operations Ahmad Byagowi
2026-11-23 1:57 ` [PATCH net v4 1/5] ptp: disable all timestamp channels after removing the user interfaces Ahmad Byagowi
2026-11-24 1:58 ` netdev-bot+sashiko
2026-11-24 4:42 ` Ahmad Byagowi
2026-11-23 1:57 ` [PATCH net v4 2/5] ptp: ocp: handle hardware selectors and combined DPLL input routes Ahmad Byagowi
2026-11-23 1:57 ` [PATCH net v4 3/5] ptp: ocp: preserve disabled SMA inputs across driver rebind Ahmad Byagowi
2026-11-24 1:58 ` netdev-bot+sashiko [this message]
2026-11-24 4:42 ` Ahmad Byagowi
2026-11-23 1:57 ` [PATCH net v4 4/5] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-23 1:57 ` [PATCH net v4 5/5] ptp: ocp: correct the ART 10 MHz input frequency 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=179548551472.3135.11972018356692852897@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=rmk+kernel@armlinux.org.uk \
--cc=vadim.fedorenko@linux.dev \
--cc=vladimir.oltean@nxp.com \
/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