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=1795948738; b=HADaKFJems4rv9Z5QfMh1c/Ec3YZPwKp8M7DOtt6wiz+PMvLPidjRUEU6V7Q2CwQe7dS zMjkadyD8wB9t//pwz5vfQYqNrEi5FLkhOQikrlEljB6DRO6tH0r1t892y4sWhzy9RLJM QbQViNURnjwgKLqKAO8FQ8xcAJaHoWfQ9lWXpwZVlwhiZgKNK4fYCDUIF9npsKVTPMT0L 4sZDPEjpOvM9J2cAxIDgTxxA56pqMi+1SREnapaPw111lxvkwuvy6HrxSNzA0D5c3hs0G hdTg1K4n+sgrDeew2UQEy07qveMBJCbXRxnWArXWuenPa4FAcbHXidyMWmGW/KQA7XQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795948738; 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=lcP03ov499QQmKXHvJXUyjVwp7YEkTe82RthMKzJJPQ=; b=EsvHDTbXGC4z7aMNZbbQMSyXNfTq6hKKVuUiCR7qjIyaln+cNhpSpA3xgSVzK5vvHdao h6AvxIHvAyv22Tt4XOXUPzkQRzJHm5q95NvqKDqUsBFOAxrQfMqCjLctwOclde760Tyzr zzMQ2+LSEP1B4+Gd01lheUoHyyVe+YXWvOxj5jSYUgFk5wtTqOaylv6nKq9m095Nf3WVN +SsxJSsG6NEvss+aOm6PojlUsH01T0/iHlM/ptmX5hyqppLl3o8LboGRu55Qsoi2c0xZ7 r2x0agWPtj39jo0lNePUnNci35Siw0iXPxnqcomkUXWEyz6Ufufq79G4m4zZ/MBLM3w== 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=IDDh6o8g; 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 70D70606A327; Sun, 29 Nov 2026 10:38:58 +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=IDDh6o8g Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0EBB1F000C1; Sun, 29 Nov 2026 10:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795948737; bh=lcP03ov499QQmKXHvJXUyjVwp7YEkTe82RthMKzJJPQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=IDDh6o8g/KlmlzP46ZDVnkhUMjUj3HVV7qVXmpLUWzcgqCh8zIopJYmyCTrJ6XkAc Hd/gMgtLtsCJcVvQfHrRA3iwHhGT8duumTLC9qaNflD7UclpgD20UbiMdlLgzSfD0F uKoOQ7p3jbgUnj/bMYkn9dv1TniLeN75WVEd6tPjdIhP802D6pvrc8ZawC0dlXEeaA bmJWoP7o/lxBbbRLc5P6Vard08u5wmIEu3FJu5+3W1FdEmGOuyfqPGIO04VCQB0Ybk NN5W+ul8l6DOOne9+Utw/pcATaq8KQds8CVNhvoDV0kfNnEIHQpJY3XIb9pwoGWjvL 8y/heGHan/yAQ== Subject: Re: [PATCH net-next v5 12/14] selftests: dpll: add pin phase adjust test 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:56 +0000 Message-ID: <179594873656.3146.399595190325088649@kernel.org> In-Reply-To: <20261125090522.3777494-13-poros@redhat.com> References: <20261125090522.3777494-13-poros@redhat.com> X-sashiko-severity: Low 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 more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] In test_pin_phase_adjust_set_get() (tools/testing/selftests/drivers/dpll/dpll_features.sh), the branch… - [Low] In test_pin_phase_adjust_set_get() (tools/testing/selftests/drivers/dpll/dpll_features.sh), the comment… -- selftests: dpll: add pin phase adjust test This adds test_pin_phase_adjust_set_get() to dpll_features.sh. The test reads the phase adjust range and granularity a pin advertises, picks a different value, sets it, reads it back and restores the original value. It also adds dpll_pin_get_phase_adjust() and dpll_pin_set_phase_adjust() helpers to dpll_lib.sh. > diff --git a/tools/testing/selftests/drivers/dpll/dpll_features.sh b/tools/testing/selftests/drivers/dpll/dpll_features.sh > index acaf61b36624c..ebcd0d09293b7 100755 > --- a/tools/testing/selftests/drivers/dpll/dpll_features.sh > +++ b/tools/testing/selftests/drivers/dpll/dpll_features.sh [ ... ] > @@ -456,6 +457,149 @@ test_pin_state_transitions() > log_test "DPLL pin state transitions" > } > > +test_pin_phase_adjust_set_get() > +{ [ ... ] > + # Pick a target inside the advertised range different from the > + # current value and a multiple of the granularity. > + min=$(jq -r '.["phase-adjust-min"] // empty' <<< "$json") > + max=$(jq -r '.["phase-adjust-max"] // empty' <<< "$json") > + gran=$(jq -r '.["phase-adjust-gran"] // empty' <<< "$json") > + if [ -z "$min" ] || [ -z "$max" ]; then > + dpll_log_test_skip_or_fail "DPLL pin phase-adjust set/get" \ > + "no adjust range" > + return > + fi [ ... ] > + if [ -n "$DPLL_CREATED_DEVICE" ]; then > + # The simulator is checked at the ends of its range. Shell > + # division truncates towards zero, so round the bounds towards > + # the inside of the range explicitly, which matters for > + # negative ones. > + [ -n "$gran" ] || gran=1 [Severity: Low] On the created device, should a missing phase-adjust-gran go through dpll_log_test_skip_or_fail(), as a missing phase-adjust, phase-adjust-min or phase-adjust-max already does, instead of being replaced with 1? dpllsim always advertises a granularity: drivers/dpll/dpllsim/dpll.c:dpllsim_pin_props() { ... prop->phase_gran = DPLLSIM_PHASE_ADJUST_GRAN; ... } The core emits DPLL_A_PIN_PHASE_ADJUST_GRAN whenever phase_gran is non-zero. On the created device, a missing value can therefore only come from a regression in dpllsim, in the core or in the dpll tool's JSON output. The comment above dpll_log_test_skip_or_fail() in dpll_lib.sh says such a condition is a failure there: # known, so a missing pin, attribute or capability on it can only mean a # failed query or broken tooling. Report such a condition as a failure # on the created device and as a skip on a device the user provided, The commit message describes the fallback as intended ("Without it the target on the created device is computed with a granularity of 1"). That does not match the rule above. DPLLSIM_PHASE_ADJUST_MAX is S32_MAX - S32_MAX % 100 = 2147483600, which is already a multiple of 100. With gran=1 the target is the same value and the core accepts it, so the test passes even when granularity reporting is broken. The test also never submits a value that is off the granularity, so the core's granularity check is not exercised here. > + target=$((max / gran * gran)) > + [ "$target" -gt "$max" ] && target=$((target - gran)) > + if [ "$target" = "$before" ]; then > + target=$((min / gran * gran)) > + [ "$target" -lt "$min" ] && target=$((target + gran)) > + fi [Severity: Low] Can this min-end branch be reached on the created device? The comment above says "The simulator is checked at the ends of its range" and that the rounding "matters for negative ones". However, dpllsim_pin_reset() zeroes the phase adjust when the device goes live: drivers/dpll/dpllsim/dpll.c:dpllsim_pin_reset() { ... pin->phase_adjust = 0; } No earlier test in ALL_TESTS changes the phase adjust, so before is always 0 on the freshly created device. The first target is max / gran * gran = 2147483600. That never equals before, so the switch to min never happens. As a result, the min-end computation and its rounding for negative bounds are dead code here. A negative phase adjust is never set or read back. Would it make sense to exercise both ends, or to change the comment so it matches what is actually tested? > + else > + # On hardware the end of the range can be a large phase step, > + # 2.1 ms on zl3073x, which the outputs see once the pin becomes > + # the reference. Step by the granularity, or by 1 ns when the > + # driver reports none, towards the inside of the range. > + step=${gran:-1000} > + target=$((before + step)) > + [ "$target" -gt "$max" ] && target=$((before - step)) > + fi [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com