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=1796006572; b=o3LnnlnK8FXdFELy7ixNaf6TMCkjXoR1J9Bv1ChnLYxs5AFF3VEBkNn0r+YCxe8XwNTU rdgBrIcypSsPhBL3yjR9p8e1fsRBCoAZMXF6zHHcwWgWp0MZ6KrwXSUpzm/xwTmjui6yl UeKJKowKGDzDX1DH227FLqcmPj23OrIcdp5mYob34edSn7mikEXya29XIrCoYEuqG+jld 7oF4btulAk+vN2WeLvoSsHofqwudmulHl0eMFnrS+zm3qrjwTXoIEPf9KTYFN4RK+3b5R FB13GceoVjpEsgu52bU8d0wb7xglI3DcESf+GnGufUlN86MBMhE5ERdyq4lE1ARWBww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796006572; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=8vkcOSV1QZgsFfgeTapfqg7zVwOYU4NNb75SLrvLNiE=; b=UWbFLKyWEtD+0SjCiumhui3BFGaJkwAKQ28A+TJaZC/3QVplYG+IOt73pZAVv1p765Pb NattdlJChxbHYa8tbw0is+5DTw4e1zQ8PBbHiFt9FeZYdmtcWsZ5n4jSGrxSnOBSC8lmT Sy5Oe1LbTYOdrUDsir1/eTtrJ6JJl6ky2lyV0ngIPSJLmCm9ZLyUoTqOO/Otz5zcf4Id4 YXPCfhl9volhVAB1g7JgWFePsxHYLXKAk69diQHCA/ZRCTYkCqGU9SP4rv4bbn9WShKm4 Z4n8rICj0kBNa/TyCishun27Z7+aKa4bUxkJiPKp5O3OHgwf4UV+RoRnZ6VDTWpTv7w== 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=UEpmJpI3; 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 52BA9606A31C for ; Mon, 30 Nov 2026 02:42: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=UEpmJpI3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7BC81F00896; Mon, 30 Nov 2026 02:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796006571; bh=8vkcOSV1QZgsFfgeTapfqg7zVwOYU4NNb75SLrvLNiE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=UEpmJpI3iE3AxBaBCQHIzTyDjOKd9F583US3zvARNhGyf+t/If8BlxjAQ+YR/uOGX eWoyP9SuhML0EleCqEEz5ZCaiYzhfpAvWC4nSTHFBrGv0Ph/X1884lFDuVQHQWRE+e KyVfEPytqxaphAKY3IQi7hgsIlFDdrNOe0j7qWQAv0ZGqqjYoLiyFEVpLZYOzJxcMy 2d6R6XgDCSpzJtalIDXkdmzcLIHXybEyw5UKdv4HGK40jh/+YydoVRbFt7xiD00Lbu M+1lDQVTQ1rYHU18blw1JAQsGvBqnsOSUNI5qgHnofU04MHi7Sceh6V2lrjfaa7UUj sdZCuRWoz4okA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 2/5] drm/bridge: trilinear: add the DPTX hardware layer Reply-To: sashiko-reviews@lists.linux.dev To: "Luo Liu" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261130022510.762141-3-Luo.Liu@cixtech.com> References: <20261130022510.762141-1-Luo.Liu@cixtech.com> <20261130022510.762141-3-Luo.Liu@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 02:42:51 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/bridge: trilinear: off-by-one retry check in dptx_hw_link_clock_recovery() -- commit 79d7005f35e737f691dac4559a73f058da476746 Author: Luo Liu drm/bridge: trilinear: add the DPTX hardware layer This commit adds the register, AUX, DPCD, link training, and stream setup hardware layer for the Trilinear DisplayPort transmitter. > diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_hw.c b/drivers/gpu/drm= /bridge/trilinear/dptx_hw.c > new file mode 100644 > index 0000000000000..df4ba883edbaa > --- /dev/null > +++ b/drivers/gpu/drm/bridge/trilinear/dptx_hw.c [ ... ] > +static int dptx_hw_link_clock_recovery(struct dp_hw *hw, struct phy *phy, > + u8 lane_cnt) > +{ > + u8 link_status[DP_LINK_STATUS_SIZE]; > + u8 prev[DPTX_MAX_LANES]; > + bool train_done =3D false; > + int tries =3D 0; > + int i; > + int ret; > + > + ret =3D dptx_hw_link_set_pattern(hw, DP_TRAINING_PATTERN_1); > + if (ret < 0) > + return ret; > + > + memset(prev, 0xff, lane_cnt); > + > + for (i =3D 0; i < 512; i++) { > + ret =3D dptx_hw_link_vs_emph(hw, phy, lane_cnt); > + if (ret) > + return ret; > + > + drm_dp_link_train_clock_recovery_delay(&hw->aux, hw->dpcd); > + ret =3D drm_dp_dpcd_read_link_status(&hw->aux, link_status); > + if (ret < 0) > + return ret; > + > + train_done =3D drm_dp_clock_recovery_ok(link_status, lane_cnt); > + if (train_done) > + break; > + > + if (!memcmp(hw->train_setting, prev, lane_cnt)) > + tries++; > + else > + tries =3D 0; > + > + if (tries =3D=3D DP_MAX_TRAINING_TRIES) > + break; > + > + memcpy(prev, hw->train_setting, lane_cnt); > + dptx_hw_link_adjust_train(hw, lane_cnt, link_status); > + } [Severity: Medium] Should prev be saved and dptx_hw_link_adjust_train() be called before comparing hw->train_setting against prev? Because memcmp() and the tries check run before dptx_hw_link_adjust_train() updates hw->train_setting from link_status, each iteration compares the setting just transmitted against the previous iteration's setting (starting with 0x00 vs 0xff on the first pass). As a result, the same drive setting is transmitted 6 times instead of DP_MAX_TRAINING_TRIES (5), and when tries reaches DP_MAX_TRAINING_TRIES the loop breaks before parsing the newly read link_status, discarding any new voltage swing or pre-emphasis adjustment the sink requested on that pass and failing clock recovery with -EIO. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130022510.7621= 41-1-Luo.Liu@cixtech.com?part=3D2