Article View: linux.kernel.netdev
Article #14454Re: [PATCH net-next v3 10/14] selftests: dpll: add pin frequency test
From: netdev-bot+sashiko
Date: Wed, 11 Nov 2026 09:37
Date: Wed, 11 Nov 2026 09:37
164 lines
13797 bytes
13797 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · 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] test_pin_frequency_set_get() in
tools/testing/selftests/drivers/dpll/dpll_features.sh only checks that…
- [Medium] test_pin_frequency_set_get() reprograms the frequency of
PIN_TUNE_ID.
--
selftests: dpll: add pin frequency test
This adds test_pin_frequency_set_get() to dpll_features.sh. The test
takes a supported frequency other than the current one from an input
pin's frequency-supported list, sets it, reads it back and restores the
original value. It also adds a dpll_pin_set_frequency() helper to
dpll_lib.sh, which keeps the tool's error output in DPLL_LAST_ERR.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index b4b1eff322a21..6649936c710e4 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
[ ... ]
> @@ -237,6 +238,69 @@ test_pin_state_transitions()
> log_test "DPLL pin state transitions"
> }
>
> +test_pin_frequency_set_get()
> +{
[ ... ]
> + before=$(dpll_pin_get_frequency "$PIN_TUNE_ID")
> + if [ -z "$before" ]; then
> + dpll_log_test_skip_or_fail "DPLL pin frequency set/get" \
> + "frequency not reported"
> + return
> + fi
> + defer dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"
[Severity: Medium]
Can the original frequency always be written back here? The only check
on before is that it is not empty. The DPLL core refuses any value
outside the pin's frequency-supported ranges, and it does this before
it compares the value with the current frequency:
drivers/dpll/dpll_netlink.c:dpll_pin_freq_set() {
...
if (!dpll_pin_is_freq_supported(pin, freq)) {
NL_SET_ERR_MSG_ATTR(extack, a, "frequency is not supported by the device");
return -EINVAL;
}
...
}
zl3073x hits this case on purpose. It reads a sub-Hz reference back as
0 Hz and leaves 0 out of freq_supported:
drivers/dpll/zl3073x/prop.c:zl3073x_pin_props_get() {
...
/* Start with current frequency at index 0. A sub-Hz frequency is
* read back as 0 Hz and cannot be set, so it is not offered.
*/
j = 0;
if (curr_freq) {
...
}
Here is what happens on such a pin on a device the user provided:
- before=0 passes the -z check.
- The jq filter picks the first advertised frequency as target.
- Setting target succeeds and reprograms the hardware reference.
- The explicit restore and the deferred restore are both refused with
EINVAL.
Wouldn't this leave the user's device on a frequency the test picked?
The commit message says the test "restores the original value".
The phase adjust test later in the series bails out before it schedules
the restore when the current value could not be written back. Would a
similar check fit here, one that confirms before lies inside an
advertised frequency-supported range before the pin is touched?
> +
> + # 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.
> + target=$(dpll_pin_json "$PIN_TUNE_ID" | \
> + jq -r --argjson cur "$before" \
> + '[.["frequency-supported"][]? |
> + .["frequency-min"], .["frequency-max"] |
> + numbers | select(. != $cur)][0] // empty')
[ ... ]
> + # 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]
Is it safe to reprogram this pin's frequency based only on its state on
DPLL_DEV_ID? pick_tune_pin() counts a pin as spare when it is
disconnected or selectable on that one device:
tools/testing/selftests/drivers/dpll/dpll_features.sh:pick_tune_pin() {
...
state=$(dpll_pin_get_state "$DPLL_DEV_ID" "$pin_id")
case "$state" in
disconnected|selectable)
...
}
State and priority are per parent device, but frequency belongs to the
pin itself. It is shared by every DPLL device the pin is registered
with.
On zl3073x, every channel gets the same dpll_pin for an input index
through dpll_pin_get(clock_id, index). The setter then writes the
chip-wide reference state:
drivers/dpll/zl3073x/dpll.c:zl3073x_dpll_input_pin_frequency_set() {
...
ref_id = zl3073x_input_pin_ref_get(pin->id);
ref = *zl3073x_ref_state_get(zldev, ref_id);
/* Update frequency */
zl3073x_ref_freq_set(&ref, frequency);
/* Commit reference state */
return zl3073x_ref_state_set(zldev, ref_id, &ref);
}
Say the chosen input is selectable on the EEC channel but is the locked
reference of the PPS channel. Could the PPS channel then lose lock, go
into holdover or switch references until the restore runs? ice also
registers its inputs with both its EEC and PPS DPLLs. The test never
checks that the other channel locks again.
Should the pin be checked against all of its parent devices before this
test changes its frequency?
> + 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/20261109093523.931201-1-poros%40redhat.com
Technical Details
Message-ID:
<179438987253.2199510.13974311226677874539@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-360956-linux-kernel-netdev=dewy.ruReferences:
<20261109093523.931201-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-360956-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 10/14] selftests: dpll: add pin frequency test Date: Wed, 11 Nov 2026 09:37:52 +0000 Organization: Usenet Network Message-ID: <179438987253.2199510.13974311226677874539@kernel.org> References: <20261109093523.931201-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="820804"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:onynfu4WgfjTaNxXD2p7NROlrio= sha256:ul/pWc65CQUfBNd/9jHD0YHh7maNvPUab+D1UYIJrR4= sha1:Ep14nuWpIJpypQpECOZjUTz8Ytw= sha256:zhob74CtLE0LKMlFp8dV8fq5VEECmeFXgBWTnNi8hno= 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 88017113E7C; Wed, 11 Nov 2026 12:39:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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] 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 xNfZXhcAzp5D; Wed, 11 Nov 2026 12:39:28 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-360956-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 5E4B2113E79; Wed, 11 Nov 2026 12:39:20 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 39CF96411D9; Wed, 11 Nov 2026 09:38:39 +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=1794389880; b=xeCWV77C+yzdIDAPbX7bX3N74/Ouxg/rrXOb4RekOR/l5O73a1Oou2vWEUHQp/ta/uvo ZuCIoMJuxnBqjPOp9aijsHNfZHmF2uX8ir5P5QCDwYXxYjOwWvAJLDz3WY2Ea8acwrNMe u7+sztzDvDUCsQXSNrYWNbXkGSh6Iu/V0GFAXvRP/QO4Uctorvh0wNIidA8OWlN/+WKHI crhSRSHTtf4gTkik5v8iHoBRxkZKyO+BMR+UaQOvT0+JDHxXh9dz51UOSwo3z9lpqJVWQ V/PnPuhi6+2fA6l0KScpBPeBUa2Bkvm7CEbMKgG4ulQwh/N/8TU/Y6GZZcwh7An7LcQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794389880; 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=PkJfKwkqKNE4ImiCuQKubmjkOE1XDfvLZ9rc4/zmoHU=; b=Fy11b8H2vYRrlbqgzhFlyEUuUZ12lsR1VBWW3kn9oggeVoL3vUZRZuf+y+qWantGX7oV JgvdTZpSW0+swixVQ8aIZKyPnSRPrWvXnIRAC/DwcyklO7XybY+UoQe5N7MnvQ9kzCdAj c5y+FBmSmBFPuyrtCsnso+JHEroE8mtWWdpppEEFrtfoK9wr5IrFHHsA7iyLUjwbKqxI3 5eoZCp8QZ+h7mNkt5VRKDqDJTX1OywpBLKFfQni347SExENFVHTwWkd8OiF+O/37tTtbT FCKFvDSaizKdLYBvR45z2wxDkovyMjf8WjjyERJfmar6zMZIYe7vohfXkZOknie7mvg== 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=PJC9HxML; 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 2FB2C60A382A; Wed, 11 Nov 2026 09:38:00 +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=PJC9HxML 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=1794389874; b=iQC9RfgqI5W/bZ8mHc7CgCOZLQDDDd9UIY9fmijFCTpJtwjHQZhzclfc786eTCzykSyw 7KK1dk4GYzZGG3xorB1yo/KJEGgfxCWPjYZYNk7G8ObnpBeSV2vqIzPJBPiFBgJNz32UT SfSD7wnP6FPVdik+aKHgNKi3SuAea+A/db7H6o6IX1rfb7rzscBe2NHIC401icQ69CfMC UIYQ38QOdVFi/7UchrOT9m6AVVENlLCfJlKtMUnyVcCfkzjrOr6fRNo++OT6CIaaGE/8z PC0FQLnXErIOwWUSocO1joO8423Skl5ZPY0eQYQdPrQ45o3OclhJqMh/RY8sdUKNtsg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794389874; 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=PkJfKwkqKNE4ImiCuQKubmjkOE1XDfvLZ9rc4/zmoHU=; b=27KtWIYJTPumvkVA0KQKPz4EMS9C+lnifsq73o1Rufan23U4u8rK2TOVJhqHOgryJEFc C7BIP9ec4Od3KeU0TalVaT00Z2hcbRGj9tKDuk26nG8Tnrh2e+plrVE1xnPxztmh8d7Hz G+KYGCPzKBnEL8oZlzoCuzKkq88E7Qu4WQz4ZGsQ2VcO5vA6Zyprx2+UbfOMk5v2a4wl0 BnjMltfynLXFMQU0J2JlbqYFQY//rUQ/yhWRqvZM2n7ThRwxIrP31gWOuE96hJ0eMycNs Sg2JA6PGAZ7yCElI3ZqRhVkneRHj/FGssodYy74PyGf7JcPMlAlEIXOBMZBg0jIegAA== 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=PJC9HxML; 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 4D413606A338; Wed, 11 Nov 2026 09:37:54 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA01E1F00A0C; Wed, 11 Nov 2026 09:37:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794389873; bh=PkJfKwkqKNE4ImiCuQKubmjkOE1XDfvLZ9rc4/zmoHU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=PJC9HxML0ZEOhuM6eIC49L6nzywHpT9Rj1sf0JsA0f8CO0CnuZ8yzDwG8O6ATyYfL AevD6G+sQ2Mmovqqzuztd8/MKbvQLJikgfYVSisGWcUC1PLEjLe6wqtBrRRj+yPPHs tJ1h9Q9vuqNzRBAFDvwapgKTk52jNjtfVKxTrLR5HjhqTSt7vPOKxyLgdaF0puf8t1 K2PjVg2OuRFmV1sigsMGzU3eNRXFmdgdRw0Cyn33LrKhiNhlfRv3rxSOI/AvnZh9b/ G3nb0ZVuPfnBb5dcDWaRUrrvUo4G2UKrrfgwintp3MlK+PQKZ1VfPOhKdQ75qLEVSQ 2fxtgQupFuYdQ== 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: <20261109093523.931201-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