Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: ahmadexp@gmail.com
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, vladimir.oltean@nxp.com,
	vadim.fedorenko@linux.dev, andrew@lunn.ch,
	linux-kernel@vger.kernel.org, arkadiusz.kubalewski@intel.com,
	jiri@resnulli.us, jonathan.lemon@gmail.com
Subject: Re: [PATCH net v6 5/8] ptp: ocp: report disabled SMA inputs as zero Hz
Date: Fri, 27 Nov 2026 16:48:04 +0000	[thread overview]
Message-ID: <179579808454.3135.16893919920037495221@kernel.org> (raw)
In-Reply-To: <20261126-timecard-driver-v6-5-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 changelog blames a 'stale selector frequency', but that is
  not what happens on the normal disable path.
- [Low] Two submission-hygiene problems.

--

ptp: ocp: report disabled SMA inputs as zero Hz

This commit makes ptp_ocp_dpll_frequency_get() report zero frequency for
disabled SMA input pins by forcing the selector value to SMA_DISABLE. The
goal is to let a DPLL frequency set re-enable a disabled input, since the
DPLL core compares the request against the current frequency first.

> A disabled SMA input has no active signal and should report zero frequency through DPLL. The DPLL core reads the current frequency before applying a new value, so reporting the stale selector frequency can prevent a disabled input from being re-enabled.

[Severity: Low]
Does "stale selector frequency" accurately describe what happens here?

When an input is disabled through sysfs, ptp_ocp_sma_store_val() writes 0
to the selector instead of leaving the old value in place:

drivers/ptp/ptp_ocp.c:ptp_ocp_sma_store_val() {
    ...
	if (sma->disabled)
		val = 0;
    ...
}

In ptp_ocp_sma_in[] and ptp_ocp_adva_sma_in[], selector 0x0000 is the
10 MHz entry:

	{ .name = "10Mhz",  .value = 0x0000,      .frequency = 10000000 },

So before this patch, a disabled input always read back as 10 MHz. It did
not read back as the previously configured source. For example, an input
set to PPS1 and then disabled would report 10 MHz, not 1 Hz.

The result is that only a 10 MHz re-enable request was silently dropped,
by this check in dpll_pin_freq_set():

	if (freq == old_freq)
		return 0;

On adva_x1 boards, ptp_ocp_adva_x1_sma_in[] has no 0x0000 entry. A
disabled input there already reported 0, so those boards were not
affected.

The code change itself looks correct. Could the changelog describe the
clash between the disabled value and the 0x0000 / 10 MHz encoding? It
would also help to name the affected frequency and boards, so backporters
can judge which boards and requests were affected.

> A coding assistant helped check the DPLL get-before-set behavior, develop the regression test and prepare this changelog.

[Severity: Low]
This isn't a bug, but which regression test does this refer to? The commit
only adds two lines to drivers/ptp/ptp_ocp.c and includes no selftest or
KUnit change, so the test can't be reviewed or run.

> Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>

The author line is "ahmadexp <ahmadexp@gmail.com>", but the Signed-off-by
is "Ahmad Byagowi <ahmadexp@gmail.com>". The email matches and the name
does not, which checkpatch reports as a From/Signed-off-by name mismatch.

If applied as is, the commit would be credited to "ahmadexp". The other
patches in the series have the same metadata.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126-timecard-driver-v6-0-ahmadexp%40gmail.com

  reply	other threads:[~2026-11-27 16:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:42 [PATCH net v6 0/8] ptp: fix OCP routes and SJA1105 pin direction Ahmad Byagowi
2026-11-26 16:42 ` [PATCH net v6 1/8] net: dsa: sja1105: keep pin function on EXTTS disable Ahmad Byagowi
2026-11-27 16:47   ` netdev-bot+sashiko
2026-11-26 16:42 ` [PATCH net v6 2/8] net: dsa: sja1105: keep pin function on PEROUT disable Ahmad Byagowi
2026-11-27 16:47   ` netdev-bot+sashiko
2026-11-26 16:42 ` [PATCH net v6 3/8] ptp: ocp: preserve timestamp routes on DPLL frequency changes Ahmad Byagowi
2026-11-27 16:48   ` netdev-bot+sashiko
2026-11-27 16:53   ` Olech, Milena
2026-11-26 16:42 ` [PATCH net v6 4/8] ptp: ocp: restore disabled SMA inputs when binding Ahmad Byagowi
2026-11-27 16:48   ` netdev-bot+sashiko
2026-11-26 16:42 ` [PATCH net v6 5/8] ptp: ocp: report disabled SMA inputs as zero Hz Ahmad Byagowi
2026-11-27 16:48   ` netdev-bot+sashiko [this message]
2026-11-26 16:42 ` [PATCH net v6 6/8] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-27 16:48   ` netdev-bot+sashiko
2026-11-26 16:42 ` [PATCH net v6 7/8] ptp: ocp: match ART DPLL frequencies to selectors Ahmad Byagowi
2026-11-26 16:42 ` [PATCH net v6 8/8] ptp: ocp: defer timestamp shutdown to clock unregister Ahmad Byagowi
2026-11-27 16:48   ` netdev-bot+sashiko

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=179579808454.3135.16893919920037495221@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ahmadexp@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --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