From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796310707; b=gxB5/eIugNqexW7YgzU7v8swopBZdrlVZdI+GaWMLlV2MN6ulZvJrviSyP2miixz5PZF VJNZ1b+G5WTRGLasLeSNe6bMze5ZiwtTnlitC67ug2VWD+CppV2DdCTrgmxcWbLFXzncD kf3HSFQV299EVFjINppGGVorW6lkrvgoUvex6AhbbjR3+cUS+Tm95PwQ2IL7RXd3WH4b5 JYZQRniT5VCiuA6XDm0ixkWGUpcwzrZRTg4VSh1NLVCgTV+m5Lj3eLHkmlyYqWKgeevoU 3dB8yMN84w1/B/N0R8p54iVNSj+okhtOBs18NqwY4gD+9+JQdzcMahu1CHcdd0+fRHA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796310707; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:Date:Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type:X-Last-TLS-Session-Version; bh=tn0+7eax+tLt45/53c8f/61NKOWn+n+aRA8e9bLnfaU=; b=VfvaATWIx67X9QY5N3LBrxdsTFjGk9daEUKn6Z1LPa4buB2Nd6D2xs5ybJWjS36T3CCc 7GtcOrS2ntGt8GPD1iLNiKeg5xVdy7qIpJN5ttJNKNxPXpNehq7oUTEz2LK5ehSx2WOTP x4SlsD2Z8DmoeF7eqEzFHbyj35uTFFzF5bNjpaUj7x7a4KDNsZtWtuMSMXd94/nfPAbyB Q3Fk8nDJn7yP7ZlGGTPuZRxWSQdR0H2+Pf8MEKMAOhjTLUv/3K0QwJubZ9AdmcaiuG5b4 wxwAMd6Ba64/QiOm36BYrXlWHmVoHNB4RR176c0HF5vWL1tRmIDPCLE+1dKN3noyzhA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=PjUGi1gp; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 B00FD606A332 for ; Thu, 3 Dec 2026 15:11:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B00FD606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=PjUGi1gp Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 7FD98C0133F; Thu, 3 Dec 2026 15:11:56 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0E292604ED; Thu, 3 Dec 2026 15:11:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A078A11EA1896; Thu, 03 Dec 2026 16:11:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796310700; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=tn0+7eax+tLt45/53c8f/61NKOWn+n+aRA8e9bLnfaU=; b=PjUGi1gp5q7ooubSfIhPrZOMtM69OtA5TyXClXPAy5RyGGbUfBnDEpyXDnhoN59ElQvM7f a//ZBJJfnIXTtV0YtThTx7JMiDeDgjeqtTRw8eMnqdaeIhjAdxx5UMH9xsg49ZtURbS4b1 TU0uSj7bv8YeQ/044TCFu2271EqKfsRofwdDuBy+uXyawkP1Pdy8WulOyByHtMT5XaPnLo y81OGTZW3PtaQhJ2tCdgPd3Vl907yo8rETzFmFOZNLk1RKLGTaIkGq/khXN33XsrrH5zkH G+DVTL5nM2p1tVhBi4P7vxbqNqgSrLgc7F3v3ycz37NEmMRDDeFdgnruBdjMKQ== From: Benjamin Robin To: sashiko-reviews@lists.linux.dev 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 Subject: Re: [PATCH v2 11/22] phy: cadence-torrent: use link lane count and mlane for DP config Date: Thu, 03 Dec 2026 16:11:36 +0100 Message-ID: In-Reply-To: References: <20261202-phy-cadence-torrent-ng-v2-0-0b493387347b@bootlin.com> <20261202-phy-cadence-torrent-ng-v2-11-0b493387347b@bootlin.com> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Last-TLS-Session-Version: TLSv1.3 On Wednesday, December 2, 2026 at 4:28=E2=80=AFPM, sashiko-bot@kernel.org w= rote: > 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 > -- >=20 > commit a7bb6d81b805f076baf2e912724f7f59b580f8d8 > Author: Benjamin Robin >=20 > phy: cadence-torrent: use link lane count and mlane for DP config >=20 > 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. >=20 > > diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/ca= dence/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 *t= p_data, struct tp_link *link, > > /* PMA common configuration 100MHz */ > > cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(tp_data, dp->link_rate, dp->s= sc); > > =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_= lanes); > > =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 t= p_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); >=20 > [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? This indeed could be an issue. A lot of registers should be programmed by using the max_lanes instead of num_lanes. This will be fixed in v3. =20 > 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): >=20 > drivers/phy/cadence/phy-cadence-torrent.c:cdns_torrent_phy_configure_mult= ilink() { > ... > 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++) { > ... > } >=20 > 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"). >=20 > 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). =2D-=20 Benjamin Robin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com