๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26465

Re: [PATCH net-next v6 06/14] selftests: dpll: add pin state tests

#26465
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 15:36
117 lines
12801 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] On an Intel E810-T device that the user provides (DPLL_DEV_ID
  / DPLL_DRIVER=ice), dpll_features.sh can pick U.FL2 as PIN_TUNE_ID.

--

selftests: dpll: add pin state tests

This adds dpll_features.sh. It picks a spare input pin, moves it between
disconnected and selectable, reads the state back after each step and
restores it at the end. By default it runs against a dpllsim device, or
against a device given by DPLL_DEV_ID or DPLL_DRIVER. The library gains
a pin state setter and getters for the device mode and pin operstate,
and the stress script gains a test that floods pin state changes.

> diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> new file mode 100755
> index 0000000000000..9dcf53d019987
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh
> @@ -0,0 +1,500 @@

[ ... ]

> +	if ! dpll_pin_set_state "$DPLL_DEV_ID" "$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 state transitions" \
> +			    "cannot set pin state to $before$reason"
> +			return
> +		fi
> +		check_err 1 "cannot restore pin state$reason"
> +	else
> +		TUNE_CHANGED=0
> +	fi
> +	# The automatic selection may pick a pin that is selectable again,
> +	# like it may in the loop above. A pin that shares its input with
> +	# another one, as U.FL2 does with SMA2 on E810-T, reads
> +	# disconnected once it is restored, while the partner pin stays
> +	# changed, so the readback cannot tell it from a pin that was
> +	# restored cleanly, the sharing is what the interface does not
> +	# show, see the script header.
> +	after=$(dpll_pin_get_state "$DPLL_DEV_ID" "$PIN_TUNE_ID")
> +	if [ -z "$after" ]; then
> +		check_err 1 "cannot read the restored pin state back"
> +	elif [ "$after" != "$before" ] &&
> +	     [ "$may_pick/$before/$after" != 1/selectable/connected ]; then
> +		check_err 1 "pin state not restored, got '$after'"
> +	fi
> +
> +	log_test "DPLL pin state transitions"
> +}

[Severity: Medium]
On an E810-T device given through DPLL_DEV_ID or DPLL_DRIVER=ice, can
this test leave the SMA2 connector reconfigured and still report PASS?

When SMA2 is an input that is not the reference, U.FL2 is inactive and
reads disconnected. pin_is_spare() accepts it. pin_ranks_below_refs()
also passes when the reference ranks above the CGU input that the two
pins share. So pick_tune_pin() can choose U.FL2 when no earlier input
qualifies.

The loop in test_pin_state_transitions() then sets U.FL2 to selectable,
and the final restore sets it back to disconnected. In
ice_dpll_ufl_pin_state_set() those two transitions do:

	case ICE_DPLL_PIN_SW_2_IDX:
		if (state == DPLL_PIN_STATE_SELECTABLE) {
			data |= ICE_SMA2_DIR_EN;
			data &= ~ICE_SMA2_UFL2_RX_DIS;
			enable = true;
		} else if (state == DPLL_PIN_STATE_DISCONNECTED) {
			...
			data |= ICE_SMA2_UFL2_RX_DIS;
			enable = false;

The disconnected branch never clears ICE_SMA2_DIR_EN, and it disables
the shared CGU input. After the test, ice_dpll_sw_pins_update() reports
SMA2 differently:

	else if (data & ICE_SMA2_DIR_EN)
		p->direction = DPLL_PIN_DIRECTION_OUTPUT;

SMA2 shows up as an output, or as inactive if TX_EN was set, where it
used to be an input. If TX_EN was clear, SMA2 is now an active output on
a connector that may be wired to external equipment as an input.

U.FL2 itself reads back disconnected, which matches $before, so the
readback passes and log_test reports PASS. The deferred tune_restore
covers only PIN_TUNE_ID.

Is the comment right that the interface does not show the sharing? The
script header says the same thing. ice calls
ice_dpll_sw_pin_notify_peer() after the set, and the change to SMA2's
direction and state is visible in dpll pin show.

Could the test dump the other pins of the device before the first set
and compare them after the restore? It could then fail, or skip a pin
whose state change rewires another pin, rather than only documenting
the risk in the header.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202153223.2725780-1-poros%40redhat.com
Technical Details
Message-ID: <179631216737.3146.9610878079136648096@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!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-376717-linux-kernel-netdev=dewy.ru
References: <20261202153223.2725780-7-poros@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!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-376717-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 06/14] selftests: dpll: add pin state tests
Date: Thu, 03 Dec 2026 15:36:07 +0000
Organization: Usenet Network
Message-ID: <179631216737.3146.9610878079136648096@kernel.org>
References: <20261202153223.2725780-7-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2529471"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dmO75rmGAUHbrKltNbcamHZ2Fxs= sha256:Vyohu0rDAROunXqNIfHgZMLp3xa9kC444AiaMyZ3jVo=
	sha1:iO55uwQ6niGkoLLRNBEDzb7ZZYU= sha256:pwcuZfEJRXGkiXxKLUWAIJur2fAUqUx8N29/HiL+tSs=
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 765991179B2; Thu,  3 Dec 2026 18:36:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.74
X-Spam-Status: No, score=-3.74 tagged_above=-9999 required=6.31
	tests=[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 Dbq0XU8EV_Sh;
	Thu,  3 Dec 2026 18:36:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376717-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 050511179AC; Thu,  3 Dec 2026 18:36:11 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id E6F1B2386F; Thu,  3 Dec 2026 15:36:09 +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=1796312169;
	b=CvyY49N8QtFLkwqgLKnfIE/40VXgA+iWJcn7LHrBx7cbDsWET8sCRHJxl2TauPk+hdJZ
	 FlSghK7B8/D8b1JWTzk8oajqbkpODOGEUQgHtHsPnxXHSy2Ex5o8y2RGj0dBRQ+RC0ZuP
	 L76a6xO78fxNyoDK6xhW7eMtqbsgyw6IjCGDEj3yfm9IAFLj8wIgbEDPPKEdfSmmCvNZQ
	 qEWc6IT2wYQ+bk+ezZKg/NrAGObZnEgA7dkbNr6BeIKp/KjbXyIGVqQlT4ouETkVVco6f
	 cNfcIzb1YQka7/fa0dBTxZ09dR+M7o8iEZsCxWtjiYnF5NCkLICHoVJK0A1DjdPZ3UQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796312169;
	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=GT/KWP59DJt2WdKb+j4rW/NyQ17f7IFxvnZAwHNOAdg=;
	b=lSgV4kEPSWE+l8qx/y5pPvwTstGf9oPWtlLOVIjxMFiuqt5v99Ixc8LxgicpANUrlLw1
	 PoIlb4ObNhL6qOAW9yJyNgfdNV3Xstt2f3DG2X9fGde3vqFnhCx9eYqh+BjmYZ1hdZ/pH
	 acRSWQeOMqVQjw/xr0upUaJ0eeh/Nc/bT0AHCoOG8NI61uLO7VTJaqYMExv/qk3MoTxRi
	 3Aa5tlvhvjXBbcD+V0nmqgYmFJ1s7w/CXEJ8LVpWJpIroRJ3Famn9bO1xTO9ugEUCdDFg
	 4nPMTZ55Ax4JbcRqZARjI983b5LNcqzsr4SWF7ukqtJrgeLNWD/MdAwlAmuFeqzb0xA==
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=ZE1aCVTH;
	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 A49F3606A334;
	Thu,  3 Dec 2026 15:36:09 +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=ZE1aCVTH
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=1796312168;
	b=oWJnfMqWJHGJuvvdLhjxa5G/OpukHELz8Ic1jJFMNv4jybDCLjZYqoHJYOkQ0YmxJZtt
	 gIr2uqfLAqWD6iJJgWWGHwZkh85Gjfi06bE3uFmlhtHo1uNyxralTjLVjTKUwfXgE5xTb
	 GzrtQvrdjHk7xrADnh+/6PHC/lcGdxGZPfPJJVzinXlXDmDUUxTG8Phc9VuE+Mdxy4X/N
	 +dO1Q6o3gfa2Ari4csDNPGZQtbAt7K6wigkYK+lqYb7BdWQwYrvgD4GuZajGgh8I5t7ok
	 VQmVYB4ieI2NPvAaxSHfS1J7fzBS5CSzTfWPZORA2lheCwpSKiqsT7iAYoDc2Ia+WrA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796312168;
	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=GT/KWP59DJt2WdKb+j4rW/NyQ17f7IFxvnZAwHNOAdg=;
	b=brS9nasnghysl3sNfX13Oc0LmpKaQdV6thjTDTuA5JAL/qFkgYFsjqtR5/qrc1IpFq3F
	 Cy4beGOGPxb2UH3BL/bc94xCFJY7QtNCaSdbk+UqM52jnXfBGKsK7+a5JVDMMvXJpHYQD
	 B209qEpTINiAwyZwnxAXKJgN8oPwkkCOZY0v6UE/O9Y/ofkFE3yjIZLaPSSFF9HzasYmH
	 +x4kMrcM9nBaOjZCj2LQp+TcpyILkSUTALwE+hfOd4VUqpD2/S+y8bN2rcT0bCNPi9RT5
	 P5/ZTMEqGRERYFaGaF6s/gVW1P/xhslrmo5hKz6pAegLtAZIXnZgdn0hq1BJojO0P3Q==
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=ZE1aCVTH;
	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 C7A3B606A33A;
	Thu,  3 Dec 2026 15:36:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3F521F000C1;
	Thu,  3 Dec 2026 15:36:07 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796312168;
	bh=GT/KWP59DJt2WdKb+j4rW/NyQ17f7IFxvnZAwHNOAdg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ZE1aCVTH4NZ2q5cdips6wkklxcrrtLWlQQgnr1wjksVZFVSxfy0/cn8Qg+uQ6Kihk
	 W6hnuu9+fMo3kxF0ctdrpJmvOSx0LQ8yRVb54KawIOn3tsSyMxuxABjcGiV3s8HiBh
	 Vap/Ja/ev/6Py44M0owhhBKAujxEdUR6wIK8aEyLQ0eAoRaz5+irPz+c902BbkXSq3
	 zSIB63Wl3rkDvfYxmHN8r3XATkC1N6kO9ud4FiQelyutqRymwBcuoibz0VNj2b7187
	 rrcZLR71lvZTmRZsn77xgntXw0y9w7p/RcRC+7Gtg3kJ8xcY2y//x7/yaHlU07Up8U
	 R2x02HznbjleQ==
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-7-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