Article View: linux.kernel.netdev
Article #26467Re: [PATCH net-next v6 10/14] selftests: dpll: add pin frequency test
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 15:36
Date: Thu, 03 Dec 2026 15:36
162 lines
13919 bytes
13919 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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 can leave an…
--
selftests: dpll: add pin frequency test
This adds test_pin_frequency_set_get() to the dpll selftests. It picks a
supported frequency other than the current one for a spare input pin, sets
it, reads it back and restores the original value. A deferred restore
covers interrupted runs.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> index e50b60608f1e9..dd5320a1e9498 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
[ ... ]
> + # 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
> + # A driver without a frequency setter refuses the current value as
> + # well, writing it changes nothing otherwise. The restore is
> + # deferred once that went through.
> + if ! dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"; then
> + reason=${DPLL_LAST_ERR%%$'\n'*}
> + dpll_log_test_skip_or_fail "DPLL pin frequency set/get" \
> + "cannot write the frequency back${reason:+, $reason}"
> + return
> + fi
> + TUNE_CHANGED=0
> + defer tune_restore dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"
[ ... ]
> + # A refused restore is taken like in the state test, the deferred
> + # one tries again. A driver may swallow the refusal of a value it
> + # cannot program, zl3073x lists the current frequency of a
> + # reference whether or not it can factorize it back into a base
> + # and a multiplier, so the restore of one it cannot reports
> + # success and leaves the pin at the target, which the readback
> + # reports and the interface cannot undo.
> + if ! dpll_pin_set_frequency "$PIN_TUNE_ID" "$before"; then
> + reason=${DPLL_LAST_ERR%%$'\n'*}
> + reason=${reason:+, $reason}
> + if [ "$RET" -eq 0 ]; then
> + dpll_log_test_skip_or_fail \
> + "DPLL pin frequency set/get" \
> + "cannot restore frequency$reason"
> + return
> + fi
> + check_err 1 "cannot restore frequency$reason"
> + else
> + TUNE_CHANGED=0
> + fi
[Severity: Medium]
Can this leave a zl3073x input reference on a user-provided device stuck
at the target frequency?
The comment above describes this case, but neither of the two guards that
run before the first set catches it.
The jq check always passes on zl3073x. zl3073x_pin_props_get() lists
curr_freq without the zl3073x_pin_check_freq() factorizability check that
the firmware-node entries go through:
drivers/dpll/zl3073x/prop.c:zl3073x_pin_props_get() {
...
if (curr_freq) {
struct dpll_pin_frequency freq = DPLL_PIN_FREQUENCY(curr_freq);
ranges[j++] = freq;
}
...
}
curr_freq is base * mult * M / N. With a fractional FEC ratio, for example
156.25 MHz * 66 / 64 = 161132812, zl3073x_ref_freq_factorize() returns
-EINVAL for it.
The write-back of $before never reaches the driver either. The core
returns early when the value has not changed:
drivers/dpll/dpll_netlink.c:dpll_pin_freq_set() {
...
if (freq == old_freq)
return 0;
...
}
So that probe only catches a missing setter or a value outside the
advertised ranges.
The set to the target then succeeds, because the firmware-node values
factorize. On the restore, zl3073x_dpll_input_pin_frequency_set() drops
the error from zl3073x_ref_freq_set() and commits the ref unchanged:
drivers/dpll/zl3073x/dpll.c:zl3073x_dpll_input_pin_frequency_set() {
...
/* Update frequency */
zl3073x_ref_freq_set(&ref, frequency);
/* Commit reference state */
return zl3073x_ref_state_set(zldev, ref_id, &ref);
}
That call returns 0, so the else branch here sets TUNE_CHANGED=0 and the
deferred tune_restore does nothing. A retry would fail the same way. The
readback only logs "frequency not restored", and the standby reference
stays at a nominal frequency that no longer matches its signal.
The commit message says:
the restore is deferred before the pin is changed so that an
interrupted run restores it too.
and:
A refused restore is taken as in the state test, the deferred
one tries again.
Neither of these holds in this case.
The driver was already dropping this return value before this patch, but
this test is what now exercises it on user hardware.
Could zl3073x_dpll_input_pin_frequency_set() return the error as part of
this series, along these lines:
rc = zl3073x_ref_freq_set(&ref, frequency);
if (rc)
return rc;
Or could the test skip the destructive set on such a device? No later
patch in the series touches drivers/dpll/zl3073x/ or dpll_netlink.c, and
the comment above is still in dpll_features.sh at the end of the series.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202153223.2725780-1-poros%40redhat.com
Technical Details
Message-ID:
<179631217029.3146.839603646090989679@kernel.org>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376719-linux-kernel-netdev=dewy.ruReferences:
<20261202153223.2725780-11-poros@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376719-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 10/14] selftests: dpll: add pin frequency test Date: Thu, 03 Dec 2026 15:36:10 +0000 Organization: Usenet Network Message-ID: <179631217029.3146.839603646090989679@kernel.org> References: <20261202153223.2725780-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="2529678"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:vTcJUpPuEZXxcIrz/IdLppsMo8s= sha256:oXylnxHbsMh91JLpNDoWFO4hkTBvZ2MnMgEpjHa5j2E= sha1:M9lhe7xKysOzmqRVRgPiEQzyAE4= sha256:sZyb9n/nIM5n3hWihQjobnVSZEJ4e3RmVyR/YW2npNs= 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 5152A1179B1; Thu, 3 Dec 2026 18:36:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 75RTMXgLbv3W; Thu, 3 Dec 2026 18:36:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376719-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 0A4001179B0; Thu, 3 Dec 2026 18:36:23 +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 608F1291E1; Thu, 3 Dec 2026 15:36:13 +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=1796312173; b=o7blRY7SwyO+myTNPnfaDmyvlbAuFfC4SG3jX4mXrU5i20EtyjHnrLL4yg4Yo0zb3iR2 EQJcTHjAoTFCO5N1kmeCgSnOQQ8r68CZcVGXZkNa91XQ1CXSis69LZM3pYVjQeevtN/Db 8SrYOp5gQg+OTPS0eoBTqNlZS03JTuzPtGZtcmM3By1ok76gts2TxKrzWU4cgiXiKgLGM AZiEuw96nIhfmLHbRvbul9CN170NsFkYM+b1pig27CghBukRD9df9LNHdYxMFuTnfnZEj 4HfgQp2hn5UrgK5mvHDfqJXQHJfRnGrtA4x5kLG1iaCEOr9HR0OpeGLB5K579f/Fv/A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312173; 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=ZSLAdCvOmbyB66NMlLlk9bj/t28xP+ox/kX6MgtP0mI=; b=PoOqXyHPe/hiqBnrajDgD5CzinL6868aHZcKuRF2Z0w7QdkwL+kcQZARwja/rA2pvjZw uu5wtmJq+WjfHtq0MkVeTXhsaoyEoKwMiXmg5Q6tZSLL20JcHs3JYcuGOROY2YTvq0vSX FUF+4H3J4H4s0ubscsN9xOeL7Lfsuo0Sr3sfYDKVZMLChwN4LPhP+ntq7iUvNz/bf9ZAc D9MOHiOiofhvAYWhjUY79J/sYmF5W57Y/mV27n4cM7U83eSD2blYKdPgXwC4XFCfy6b7l 05xFU+7sCPfuf0s229AH6c2PPWm4jVMIw8CN8iBHjGVUPYb/p+awvSh6ETTJhHTV5Jg== 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=cTUPT26J; 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 39964606A337; Thu, 3 Dec 2026 15:36:13 +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=cTUPT26J 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=1796312172; b=MRqOsEYhbZv1ug7c1Mx3uterX8XRFWNNIVietO00W50/5CjaUt66QbBw8K9EUBScrbKP B9RXp3dMWeY31ghrvfpGTeRQJi8zuW1CJtQycVOj3XkLyR7jr/sBbnPexSijL1O65FTay pK2VYsw4s+hRxtOHeeBmn2kM8TWbSWc3uif0wnnDmICRxYVN0BX319UYP1W01/HM2H3tr she8RcfHM8ENNB8LjHOQ7N7upRvNqlf8WRbAs6t7lJu03rIDJnHf26L6ehdTaxz2RBd0e wEGuOrpTM45DSkZ6moDU22SqMStAExm+z0DqFfsKoFs9S1UEs7RTUfBHpTU8+2SDBuA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312172; 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=ZSLAdCvOmbyB66NMlLlk9bj/t28xP+ox/kX6MgtP0mI=; b=NYTkSACVJULQhI7O7vp1wDu8eMO/CKcdf80tvCh4pI60s56VDIZkj9+Ql13D+x5pUyBq BgG46SPlKVSg9n5CEAeCDqIpnwtkqPcB1+jLH+auZ8WKgeESLDk9XPcdv70Zv7qTayexU 4HmJOgTtd7zsgjGV12cKLVNLdKKHpBXkFgZOaKjerm/w8d1pnuI6GAOSojUA/EqnAC/cM vmIFDprf6rbQxRqzELW5r3hqPAD95bGmBDwpwxg5i2zIb7hqoJNCTWyIgcll65NqlGLdK rZiUS6HXrTNs13V4MkyPqxchiW3slYvIw/3+bP31/u5WIlX90PSpLesywggVKH9LQjA== 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=cTUPT26J; 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 5868D606A32C; Thu, 3 Dec 2026 15:36:11 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5C941F000C1; Thu, 3 Dec 2026 15:36:10 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796312171; bh=ZSLAdCvOmbyB66NMlLlk9bj/t28xP+ox/kX6MgtP0mI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cTUPT26J/Y2gnQOkhJGZMeuvOQl3a8/g1S2wF7DnriRQHA7S3XhiPSKGX0EFw7IlY 6b2sTB7kKmKwDvZIu1ALFI5+G3FOObELZEt7EPhXpdUfYNwb1F4VVJdHHSlcvFeIo0 kjDwheWzfatUDbQi1MPF5+TfKKwKdx50PUls9H3f7DeeNk3MQhEaXKlH1SsXfDVTmj OUJ7s1H/YB+S4VihK9PTe68FfKFXxVjslSEVmR3mQzIg/cr2fnfKo5tbO4ZdMcWHfQ IZsOOHSby185Rf8zTfwDvxoZubCLRUScspcOI/dcuEbK3rA69KJIf5u2cKUCGjPnv1 dmzxb8Wh3oj3w== X-Cc: netdev@vger.kernel.org, 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, ivecera@redhat.com, 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: <20261202153223.2725780-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