Article View: linux.kernel.netdev
Article #17262Re: [PATCH net-next v4 10/14] selftests: dpll: add pin frequency test
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:30
Date: Mon, 16 Nov 2026 14:30
202 lines
15851 bytes
15851 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 3
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] test_pin_frequency_set_get
(tools/testing/selftests/drivers/dpll/dpll_features.sh) only re-checks…
- [Low] test_pin_frequency_set_get registers `defer dpll_restore
dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"` before any frequency…
- [Low] pin_is_spare/pick_tune_pin do not look at reference-sync pairing.
- [Low] Two statements in the commit message do not match the code.
--
selftests: dpll: add pin frequency test
This adds test_pin_frequency_set_get() to dpll_features.sh. The test picks
a supported frequency of the spare input pin other than the current one,
sets it, reads it back and restores the original value. A new
dpll_pin_set_frequency() helper in dpll_lib.sh keeps the error output of
the tool in DPLL_LAST_ERR.
> constraints of its own refuses values the advertised ranges allow,
> zl3073x for instance wants the frequencies of an output pair to divide
> each other.
[Severity: Low]
Does this example apply to this test? The divisibility check is only in
zl3073x_dpll_output_pin_frequency_set():
"OUT%uN freq must divide OUT%uP freq",
This test only changes PIN_TUNE_ID, which is taken from the input pins.
> A pin that reports no frequency or advertises a single frequency only
> is a skip on a device provided by the user and a failure on the device
> the script created, whose pins advertise several.
Is this accurate for the gnss pins of the created device?
dpllsim_pin_props() gives gnss pins a single 1 Hz range:
static struct dpll_pin_frequency dpllsim_freq_1pps[] = {
DPLL_PIN_FREQUENCY_RANGE(1, 1),
};
dpllsim_setup_standard_device() creates gnss0 before ext0. The test passes
on the created device only because pick_tune_pin() ends up choosing ext0.
If that choice changed, the created device would fail with "no
alternative supported frequency".
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index f7340bd89602f..ebb52c8526201 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> @@ -28,6 +28,7 @@ input_pins=()
> ALL_TESTS="
> test_pin_state_transitions
> test_pin_priority_get_set
> + test_pin_frequency_set_get
> "
[ ... ]
> @@ -297,6 +298,95 @@ test_pin_state_transitions()
> log_test "DPLL pin state transitions"
> }
>
> +test_pin_frequency_set_get()
> +{
> + local before target after reason json
> +
> + RET=0
> +
[ ... ]
> + # The core refuses a frequency outside the supported ranges, the
> + # current one included, and a driver may report one it does not
> + # offer, zl3073x reads a sub-Hz reference back as 0 Hz. Such a pin
> + # could not be restored, so bail out before it is touched.
> + if ! jq -e --argjson cur "$before" \
> + 'any(.["frequency-supported"][]?;
> + .["frequency-min"] <= $cur and
> + .["frequency-max"] >= $cur)' <<< "$json" &> /dev/null; then
> + dpll_log_test_skip_or_fail "DPLL pin frequency set/get" \
> + "current frequency is not a supported one"
> + return
> + fi
> + defer dpll_restore dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"
[Severity: Low]
The restore is deferred here, before any frequency write has worked. The
commit message covers "A driver without a frequency setter refuses every
value with EOPNOTSUPP". On such a driver the target set below fails, the
test skips and returns, and then the deferred restore runs.
In dpll_pin_freq_set() the ops check comes before the no-op shortcut:
drivers/dpll/dpll_netlink.c:dpll_pin_freq_set() {
...
if (!ops->frequency_set || !ops->frequency_get) {
NL_SET_ERR_MSG(extack,
"frequency set not supported by the device");
return -EOPNOTSUPP;
}
...
if (freq == old_freq)
return 0;
...
}
So writing back the unchanged value fails as well. dpll_restore() then
logs "restore failed: dpll_pin_set_frequency ..." with the "frequency set
not supported by the device" reason, for a pin that was never changed.
All in-tree drivers currently pair frequency_get with frequency_set, so
this needs a driver that implements only frequency_get.
Could this do what test_pin_priority_get_set() does? That test writes the
current value back first and defers the restore only after that write
succeeds.
> +
> + # Pick a supported frequency different from the current one. Both
> + # ends of every supported range are candidates, so a pin with a
> + # single range still has an alternative unless it is one value wide.
[ ... ]
> + # A driver without a frequency setter or with constraints of its own
> + # may refuse the candidate, a skip on a device the user provided, the
> + # simulator accepts every advertised value.
> + if ! dpll_pin_set_frequency "$PIN_TUNE_ID" "$target"; then
[Severity: Medium]
Can PIN_TUNE_ID have become the reference by the time this runs?
test_pin_priority_get_set() runs just before this test and gives the pin a
better priority (before - 1, 1 or 7). A qualified input with that priority
can win the automatic selection. A non-revertive device can stay on it
after the priority is put back.
test_pin_state_transitions() checks for exactly this:
# The automatic selection may have taken the pin since it was
# picked, it is the reference then and not to be touched.
if [ "$mode" = automatic ] && [ "$before" = connected ]; then
dpll_log_test_skip_or_fail "DPLL pin state transitions" \
"spare input pin became the reference"
This test only relies on the pin_is_spare() check that pick_tune_pin()
does once when the script starts.
On zl3073x, zl3073x_dpll_input_pin_frequency_set() writes the new
frequency with zl3073x_ref_state_set(). That configuration is shared by
every channel the reference feeds, so a locked channel could lose lock or
go into holdover until the restore runs.
The commit message says "the pin the script picks must not be the
reference of any of them". Should the pin's state on each parent device
be checked again before this set, as test_pin_state_transitions() does?
[Severity: Low]
Could PIN_TUNE_ID be the reference-sync partner of the active reference?
On zl3073x, zl3073x_dpll_input_pin_ref_sync_set() checks the pair rules
only when the pair is enabled:
if (sync_freq > 8000) {
NL_SET_ERR_MSG(extack,
"sync frequency must be 8 kHz or less");
It also sets the priority of the sync partner to none on every channel. In
automatic mode that partner then reports disconnected. pin_is_spare() only
looks at state and operstate on the parent devices, so it treats the
partner as spare.
zl3073x_dpll_input_pin_frequency_set() and dpll_pin_freq_set() do not check
the ref-sync rules again. The test could therefore set the sync input to
an advertised endpoint above 8 kHz, for example 10 MHz instead of 1 Hz. It
would stay paired with the locked reference until the restore runs.
Should pin_is_spare() also treat a pin as not spare when it has a connected
reference-sync entry in the output of dpll pin show -j?
> + reason=${DPLL_LAST_ERR%%$'\n'*}
> + dpll_log_test_skip_or_fail "DPLL pin frequency set/get" \
> + "cannot set frequency=$target${reason:+, $reason}"
> + return
> + fi
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112130359.840795-1-poros%40redhat.com
Technical Details
Message-ID:
<179483940555.3136.5523095972528283974@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364451-linux-kernel-netdev=dewy.ruReferences:
<20261112130359.840795-11-poros@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364451-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 10/14] selftests: dpll: add pin frequency test Date: Mon, 16 Nov 2026 14:30:05 +0000 Organization: Usenet Network Message-ID: <179483940555.3136.5523095972528283974@kernel.org> References: <20261112130359.840795-11-poros@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2086890"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:APFW1q0vu4pxWCatSShu+FTEuic= sha256:5HYBW88b5A27EDCvyTMNe0ytaXJoiOW7FNikmtqmXOo= sha1:Y4fXf9rLfbJnsGDXSTpyx14VWZc= sha256:tf4pGCn6CGFFJH+VK03aMY8Q6dBKPIcVTei9OBAS9/c= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id E586E114C85; Mon, 16 Nov 2026 17:30:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R1oTvgbCWdlM; Mon, 16 Nov 2026 17:30:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364451-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C219F114C7D; Mon, 16 Nov 2026 17:30:22 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 74CA739838; Mon, 16 Nov 2026 14:30:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794839408; b=EHV0pKGCXj7nKsZMsIEFZ/tD+/6djXeBsWJ+rg4KTXFWBQ3VkNXky1CKTYaT1bt1RRQd bDn9qXRqoJmUE3qzI3GyuPRuUqcFwPLJ56h5Hk7PT6KKV2nIMtIFpCzb5B2KcJ2u0wSE8 O14PFD4dq64RIrxAWek7VOoQRwVd3dDuYcNBlbUo5qTnUG7u6Az7F6wKfT9evfLEdaDSa JJ55c7Gzz9iO6TjYkE9cMZMwZ5nMqpFv7crElKwNBipp5b8mDlDvTJCe6GS8eVlrze6/V sP3VnjkbI/azMewjAJUEDensNZHAn9ObL7zzMw42xqk5XqSy2GtWXyYoWn0NZ2Sc+fA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794839408; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=VsvQOmy+WVg70rJS0fmQOllgfUN6zg5nW954YzZCliE=; b=0h2HGjhubPstU5fGqvF5xWKkPssuFBnjwik17oLjbJM6+5rYDn9vfUz0vD+V2k19dNWF FzsKpW//3OBwxWtYKv2wGkbnHYYkjOC521U6qw6Hfnnj+0eS+SYJDMjfi39mDsfoAwYZM NbRnde1Fv5a+VDfr6MuEw8BwlVVlH5QiIoaUi+ELgEHILWaah4Qw/DDSor6sIwO4zWy4L tPLN0Efcb6Y+JZ2ogu8co05A41JeLqV0tio7Az5h6DpYN1/yh7eeKOMvj+/iZYsEOI3mI quR62aOjLqmOGJ1CS8njRJ6eUl37mBszBCh3jiVe5bTBT0q4kJKUHYjDo1K0vmrSh7g== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UtDT6H6U; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71564606A89A; Mon, 16 Nov 2026 14:30:08 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UtDT6H6U X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794839407; b=tW08+Ojcv+Ulsq0injmSsaUKL60q/AXaJlp2y/CZmzhZSfJPl5t6upXS4yypzT0Zk/69 65m7gEJc85dSrP7+X9dMzRAtr5jorNHvNSx7hhBlS6InkGrIT1O0us3pX0nBtd3rGi7At JzDFMI9fSqRbSS35VpC6AuEx9YHEDr4xos+McKdnl6/Xzvv+PnpnvzxZBYmb1Du9oPM5Q XAXJjN9PaBnWIW91+LRbMBxcDPC+dbrx+IV6OPEV15BZaDGYy4QycRIIujumcJKLB+1F0 RCY+N/enRZXAb+U1PiDmZbgXxjEW/T3by4fBoenRfhL2B3Uqb5P8fBwZ9WJF0c5ljYg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794839407; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=VsvQOmy+WVg70rJS0fmQOllgfUN6zg5nW954YzZCliE=; b=5DqypqJaJnNLuEY+Ol+eMrgoo5j0wH/ZRlpjkR171AcNsOga/HpJMgtJsXLb7X2tAq0l WamyfOxPHUme3WIqMzYnMyIG2f+9rI+XKBWYXonOyTl4qzBv0oLF0cK3WyCXMxscOzR9T 8QJGxxJqQael1eDgern/Zfbu6ID6e15K1SO4zePHmr+bY1k1Ik2cWW76L/tGbqR2or5KH 3lxnaCxbBdbyo5AI6Jsfky1MHbZGelhS5iDVATAnOCTJhbLlzawrUF9ezb9fwOS5m3b04 1sJ+5OeUxWBiPsV4dEBS2JfJ99ae6JPbLi9YBR6HAWGSugh5q4ZmdsUQf9+1xkDHOcw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UtDT6H6U; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F660606A336; Mon, 16 Nov 2026 14:30:07 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C6F81F000C4; Mon, 16 Nov 2026 14:30:05 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794839407; bh=VsvQOmy+WVg70rJS0fmQOllgfUN6zg5nW954YzZCliE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UtDT6H6UhxnZOHm3/9bTHdp56LUAwMUnGmnwGRc4TZG9q5EFs74bkohvgwc5pg7VD r9iIrADxBW3Vd2S4QyggwdqsdGTVDm758CMkr44vNB3TZXpM6uSbsPmo8CjIC+UA2Y yUEC4DvdJriFHGpcNAtRc2TGcGjUsCInZ3NhfwlNcNoDpH0J3PsRH0aNDPSc5j2W8R 3GOjGHgTItfT7zFpS/iP38sadFydIJnOw2935RNqk3ETyO47YAJ3L+qzF5RGG+Jgp+ edfG+Xpb5JTVBF7imYj0pgCyE8hJZZAEA1bn/39gK1BwuXZGWGAIrCC3B5piu2gWT7 pMDISa7r2+4fw== X-Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com, corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org, rdunlap@infradead.org, jani.nikula@intel.com, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org X-In-Reply-To: <20261112130359.840795-11-poros@redhat.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list