From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795948732; b=Xc3rtDOxA1tIeTaxWq0Y5jJXyeAHiZ1G4r+J1gHgCfrJq8sEy4K6oNCk2f81zHnzMsy5 DSzErznnA4ZzKznU679sFN18YGpx15xKP7hVG9UV6gJ9Oeq2B71QkAjru35RD7uFDuXYq XOP0MzAST4G1MTDTU3UjbyChAZysxqpMieXOSMUFDIMZvZ0zHaJiwLtEPmvHEzqw2hv4A PuYo5jwcjDV9DfAyC/3EgzbaGOKlbPPzhk6xKpfxoEO9ixEXcYyACFz9R3AC1jmzaR/Mm 1OrfM2/ivgSyKA0FibjqWIIpIgEs9aRR4grk8l1Ye4Sny0aY5Gb6KOqLGu0k5T3Fmcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795948732; 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=yOPRQVvDx9kk+1saXXX2yVpzulTc99MbscCaAsBmLRE=; b=HW61aAwTpDszvvjuBBZOCxjIRKyjSPFn83FWyXpyI7Oofsx8P72tOys2vjXXOVZeTFFv A/XMriGxN5q8Ar40+09VO72ycD4nPUS2kHYQ1iCELTLmeIvZO5VoZdX+Ji8k0iihzvDTT IKAVT9wTc5QNI6FXwE7EDCLKTzBCh/FlEeNdGo5dHFm8oxq4tKGcLolIAAWhU7kHwa0nA ui8Y3bmek8vnkSgMDpCym/pBovrofMPV7dBDwqMcHkA4L+rvYfZi7xI8ySFJtSwcg4bsr nvEfV07v1jLimZX8nG74xv2nUQufY/wIYJL7jZf4AoDK08wYf8qz60lXwK+E7hDnJUQ== 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=XN01PeAa; arc=none smtp.remote-ip=100.103.45.18 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 8BBC7606A32D; Sun, 29 Nov 2026 10:38:52 +0000 (UTC) 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=XN01PeAa Received: by smtp.kernel.org (Postfix) with ESMTPSA id 136AC1F0089F; Sun, 29 Nov 2026 10:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795948732; bh=yOPRQVvDx9kk+1saXXX2yVpzulTc99MbscCaAsBmLRE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=XN01PeAac95QAjRf/ZZQMcecpPLC0ZVgdzzK+lZ9CFHzn/2E+0EOkLjfVm671nNoO pcEVbY0xaXk2V4Smnjatw1R6fT7th86wqtYO73XzqHf+FdRhqFXU8wJA+jeuaB6iWq TqPbkXyMc+BeRWfJdmNpuB1fknQxiPPYfhuoZW73yFmspYbvK6By5cK7Bl2IGf3Z0p CdfvC5kP+vqkFkbp8Of3yqSso85Q20y4KcN1wg4Mf2yurD9HtkpbaaTMB1Wl/n/xwx lJiZXOq3USbxVZZoQceNpjcEHAdJV4Nj+MYdnu1VDd8qfXxY9dunVgKyNF+T88UGyt CP2Nkvqde4oTw== Subject: Re: [PATCH net-next v5 06/14] selftests: dpll: add pin state tests From: netdev-bot+sashiko@kernel.org To: poros@redhat.com 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 Date: Sun, 29 Nov 2026 10:38:50 +0000 Message-ID: <179594873061.3146.3568965349074234043@kernel.org> In-Reply-To: <20261125090522.3777494-7-poros@redhat.com> References: <20261125090522.3777494-7-poros@redhat.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 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 ice E810-T, test_pin_state_transitions can leave SMA2 changed and still report PASS when it picks U.FL2 as PIN_TUNE_ID. - [Low] pin_is_spare() in tools/testing/selftests/drivers/dpll/dpll_features.sh reads the two… -- selftests: dpll: add pin state tests This adds dpll_features.sh. The script picks a spare input pin on a dpllsim device or on a device the user names, moves it between disconnected and selectable in automatic mode, reads each state back and restores the original state. The library gains a pin state setter, a device mode getter and a pin set keyword check, and the stress script gains a test that floods one pin with 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..61ebfd9e71892 > --- /dev/null > +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh > @@ -0,0 +1,477 @@ [ ... ] > + for state in disconnected selectable; do > + changed=$TUNE_CHANGED > + [ "$state" = "$before" ] || TUNE_CHANGED=1 > + if ! dpll_pin_set_state "$DPLL_DEV_ID" "$PIN_TUNE_ID" \ > + "$state"; then [ ... ] > + done [ ... ] > + 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. > + 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 ice E810-T, can test_pin_state_transitions() leave SMA2 changed and still log a pass when U.FL2 is picked as PIN_TUNE_ID? On a device the user provides, U.FL2 passes pin_is_spare(). It is of type ext, disconnected by default and has state-can-change. It also passes pin_ranks_below_refs() whenever SMA2 ranks below the reference, because U.FL2 reports the priority of the CGU input it shares with SMA2: drivers/net/ethernet/intel/ice/ice_dpll.c:ice_dpll_sw_input_prio_get() { ... *prio = d->input_prio[p->input->idx]; ... } In the loop, disconnected does nothing because DIR_EN is clear. Selectable then does this: drivers/net/ethernet/intel/ice/ice_dpll.c:ice_dpll_ufl_pin_state_set() { ... 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; ... } ice_dpll_init_info_sw_pins() sets ICE_SMA2_TX_EN by default. With DIR_EN also set, the value matches ICE_SMA2_INACTIVE_MASK, so ice_dpll_sw_pins_update() reports SMA2 as inactive. If TX_EN was clear, SMA2 is reported as an output instead. The restore to disconnected only does this: data |= ICE_SMA2_UFL2_RX_DIS; enable = false; ... ret = ice_dpll_pin_disable(hw, target, type, extack); ICE_SMA2_DIR_EN is never cleared, and the CGU input shared with SMA2 is disabled. The U.FL2 readback above shows disconnected. The test therefore clears TUNE_CHANGED, the deferred restore does nothing and the test passes. SMA2 started as an active input and ends up inactive or as an output, with its CGU input disabled. A backup reference on SMA2 then drops out of automatic selection without anything reporting it. The header does say that reconfiguring U.FL2 changes the other pin too. It also says the tests restore the pin and "leave alone what could change the input a device uses". Is there a way for the test to detect or avoid this case? The script is unchanged in this respect at the end of the series. [ ... ] > +pin_is_spare() > +{ > + local devs pins > + > + devs=$(dpll device show -j 2>/dev/null) || return 2 > + pins=$(dpll pin show -j 2>/dev/null) || return 2 [Severity: Low] Would it be safer to dump the pins before the devices here? $held is built from the lock-status in the device dump, and $shown from the pin dump, which is taken afterwards. A parent device can go from unlocked to locked between the two calls while its new reference shows only through operstate. The comment above says this is the case for zl3073x with iproute2 up to 7.1. In that case the stale unlocked status keeps the device out of $held. The new reference, still reported selectable, is not in $shown. It then passes as spare in pick_tune_pin() and in the recheck in pin_tune_spare(), and test_pin_state_transitions() can set it disconnected. With the pin dump first, the same transition puts the device in $held but not in $shown, and every pin on it is rejected. The order is the same at the end of the series, in "selftests: dpll: add reference leak tests". > + jq -e -s --argjson dev "$1" --argjson id "$2" ' > + (.[0].device? // [.[0]]) as $devs | > + (.[1].pin? // [.[1]]) as $pins | > + [$pins[] | .["parent-device"][]? | > + select(.direction == "input" and > + (.state == "connected" or .operstate == "active")) | > + .["parent-id"]] as $shown | > + [$devs[] | select(.["lock-status"] != "unlocked") | .id] > + as $held | [ ... ] > + all($on[]; .state != "connected" and > + .operstate != "active" and > + (.["parent-id"] as $p | > + ($shown | index($p)) != null or > + ($held | index($p)) == null))' \ > + <<< "$devs"$'\n'"$pins" &> /dev/null || return 1 > +} -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com