Linux Documentation
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
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
Subject: Re: [PATCH net-next v6 06/14] selftests: dpll: add pin state tests
Date: Thu, 03 Dec 2026 15:36:07 +0000	[thread overview]
Message-ID: <179631216737.3146.9610878079136648096@kernel.org> (raw)
In-Reply-To: <20261202153223.2725780-7-poros@redhat.com>

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

  reply	other threads:[~2026-12-03 15:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 15:32 [PATCH net-next v6 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 01/14] dpll: dpllsim: Add " Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 06/14] selftests: dpll: add pin state tests Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko [this message]
2026-12-02 15:32 ` [PATCH net-next v6 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 08/14] selftests: dpll: add pin priority test Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-12-03 15:36   ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-12-03 15:36   ` 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=179631216737.3146.9610878079136648096@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jani.nikula@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vadim.fedorenko@linux.dev \
    /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