From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7305E606A323 for ; Wed, 2 Dec 2026 15:28:41 +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=Fo0ucN4o Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A99E310E03F; Wed, 2 Dec 2026 15:28:35 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 72D1810E03F for ; Wed, 2 Dec 2026 15:28:29 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id C74BE628D3; Wed, 2 Dec 2026 15:28:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F5F41F00919; Wed, 2 Dec 2026 15:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796225308; bh=JwUTaGTIr2iq5GmPytM6PY7wLsNax0xml90Ga9okk5k=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Fo0ucN4oeAmo7EbI7D3mVyMP2xH0uzErLpKUblqDSiamdwdL9x4vwXOMOrQDWIBeK gsfCXgNeQzOu8yHRPU32XcPasNwNhkcgFyMsHWPlyODGZL+W/6+mpEwc9hmowuhDUz xPjTbzG7aadgjAgiKOmWPFEkI2MTQWkt08T5DHmpy0R9Wf6Mr34K9bhWJzca7w7bpL wSKxeDMqI9N1jJerAQ3/K8W5JZFhA+s/2lGcYb+V6bFQZ9uMBlbp5cRi0ESpGIgRY/ kdQNrIdvZ7UMuw9E0tE1YC7ktJ/VHPcgmpe2V5wFxgidk/Kvq1Xf87WnyFv1zC32z3 Uq0UimnFiV9LQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 11/22] phy: cadence-torrent: use link lane count and mlane for DP config To: "Benjamin Robin" Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-phy@lists.infradead.org, robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com In-Reply-To: <20261202-phy-cadence-torrent-ng-v2-11-0b493387347b@bootlin.com> References: <20261202-phy-cadence-torrent-ng-v2-0-0b493387347b@bootlin.com> <20261202-phy-cadence-torrent-ng-v2-11-0b493387347b@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 15:28:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] phy: cadence-torrent: per-lane CDB init uses num_lanes instead of max_lanes -- commit a7bb6d81b805f076baf2e912724f7f59b580f8d8 Author: Benjamin Robin phy: cadence-torrent: use link lane count and mlane for DP config This commit splits the link lane count into max_lanes and num_lanes in struct tp_link so DisplayPort reconfiguration uses the active lane count when set_lanes is not set, and shifts per-lane register masks by link->mlane. > diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cade= nce/phy-cadence-torrent.c > index 28627bd234458..6e48c315e6b1a 100644 > --- a/drivers/phy/cadence/phy-cadence-torrent.c > +++ b/drivers/phy/cadence/phy-cadence-torrent.c [ ... ] > @@ -1190,7 +1209,7 @@ static int tp_dp_configure_rate(struct tp_data *tp_= data, struct tp_link *link, > /* PMA common configuration 100MHz */ > cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(tp_data, dp->link_rate, dp->ssc= ); > =20 > - cdns_torrent_dp_pma_cmn_rate(tp_data, link, dp->link_rate, dp->lanes); > + cdns_torrent_dp_pma_cmn_rate(tp_data, link, dp->link_rate, link->num_la= nes); > =20 > /* Enable the associated PLL (cmn_pll0_en or cmn_pll1_en) */ > tp_reg_set_bits(reg_base, PHY_PMA_PLL_RAW_CTRL, pll_mask); [ ... ] > @@ -1286,58 +1295,53 @@ static void cdns_torrent_dp_set_a0_pll(struct tp_= data *tp_data, [ ... ] > + /* release master lane reset */ > + value |=3D 1 << mlane; > tp_reg_dptx_write(tp_data, PHY_RESET, value); > =20 > + /* update the number of used lanes */ > + link->num_lanes =3D num_lanes; > + > /* Wait, until PHY gets ready after releasing PHY reset signal. */ > ret =3D tp_dptx_wait_pma_cmn_ready(tp_data); [Severity: Medium] Does updating link->num_lanes to the active DisplayPort lane count leave upper physical lanes unconfigured when the lane count is later increased? After tp_dp_set_lanes() reduces link->num_lanes below link->max_lanes (for example from 4 lanes to 1 or 2), cdns_torrent_phy_configure_multilink() (called on system resume by tp_resume_noirq() after reset assertion) and tp_phy_init() still loop up to link->num_lanes instead of link->max_lanes when programming per-lane CDB tables (xcvr_diag_vals, tx_ln_vals, rx_ln_vals): drivers/phy/cadence/phy-cadence-torrent.c:cdns_torrent_phy_configure_multil= ink() { ... mlane =3D tp_data->links[node].mlane; ssc =3D tp_data->links[node].ssc_mode; num_lanes =3D tp_data->links[node].num_lanes; ... if (xcvr_diag_vals) { reg_pairs =3D xcvr_diag_vals->reg_pairs; num_regs =3D xcvr_diag_vals->num_regs; for (i =3D 0; i < num_lanes; i++) { ... } If the system suspends and resumes while fewer than max_lanes are active and a later phy_configure() increases dp->lanes back to 4, tp_dp_set_lanes() releases the upper lanes from reset without their per-lane CDB registers initialized (which also remains the case in tp_configure_links() after commit "phy: cadence-torrent: rewrite Torrent PHY driver"). Similarly, tp_dp_configure_rate() passes link->num_lanes to cdns_torrent_dp_pma_cmn_rate(), which only writes XCVR_DIAG_HSCLK_DIV for 0 .. link->num_lanes - 1; if a rate change happens at 1 or 2 lanes and a subsequent phy_configure() increases the lane count via set_lanes without set_rate, the newly enabled lanes keep stale XCVR_DIAG_HSCLK_DIV values (though commit "phy: cadence-torrent: rewrite Torrent PHY driver" later updates the XCVR_DIAG_HSCLK_DIV write to use link->max_lanes). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-phy-cadenc= e-torrent-ng-v2-0-0b493387347b@bootlin.com?part=3D11