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=1796295992; b=QbDqBRN3tWXRdjKHPuzR8y8uhL4zvvOhh3fqFwE8DhkD5m91KZz/HDS0ruE5VXOkWO1K FZi/V7eqfkl4hWZY0a1+hyyq751rABFxOzSmY8LMhhanbWB8GQu6c5c/H4EIu3R9sBnZ/ h4ckFgItKoY5GEILN60WNpri7gEmPU8l2B9hWLHmlXewzYBne1l+nJeZnfp2iTddqbPkQ h4yyPL/2kFNQmKDeF8+tHmfcdRP8kPdCTef/Rm22gnqzTDO5pRk6EBxRiULfCeKXJW8YW 3XPTdHsQ1Nd8825XTtCO/ndxoKvn2QWY1+4iMgQirurgroMnx7b0snPgYxP5cUwHnFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796295992; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=XZilPxcC98GXuPctgQDl8lghpLPqV8cTNgqlgT8lvgA=; b=ksc/4YxDnUQLooDCh2e9kYgJVSYbO5MeYWk2pXSpebEWpB1Uxv7Of+fMxe16EY0hwlDY VYgPZI/f6p8lSjKsy7itbLbN5nmGRrAgpXjgV1McQo3+mUzkxi+nhDNk4cmGTc2Alag63 e5DerQRl9JTedC0YHm+udUfMRL+XhUr5hBVIF4z/WS8u1tme/7vXC/xUw9o2Us+WDeuxz g+Sq1JFxYzLxKkP5aDeaw9xjVKSgvkFXbsywhc0EWgCSz0jXBw09cQqGfSreaFf4ueijc xrZ6i+UCFPNECcQ9LkVM/zHw5cBw712wQ+cuXp25cb2ktNznUF42JlxXf/k0kQeTprA== 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=ZrzSb7v+; 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 60C11606A322 for ; Thu, 3 Dec 2026 11:06:32 +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=ZrzSb7v+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86AFB1F00896; Thu, 3 Dec 2026 11:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796295991; bh=XZilPxcC98GXuPctgQDl8lghpLPqV8cTNgqlgT8lvgA=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZrzSb7v+BjdIgy4J/cxPEp01QLueN2etZ1KTRpt2NUZrXAVGVnJDeSKFZxy9warDM Ex4oriT9xnE3CwVK56VeHjQ6aosCFR6O0mVNukU4wKqGJyszhu8C242aNLcFjAznMV dWG+7fm48/brduJL/s8PmEzKJj1j5IKwFtIS2PhXPaAfTQE6P5rlCzx9euMI46Sc68 gx0TjwQwjppDypWySCsNdq0+9AoV2GmQo4wprkA5sH7U7ZihE4LveTTNe0rK/ASdMH 5cK1SLLrkTBbMJt0YE9pLHahK5Z6jwxRKOITn75LhaqlwCUrR4u/yIi4OH1hMUfRPa sXnoUFRksPGug== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 10/10] phy: qcom: edp: Add Nord DP PHY support Reply-To: sashiko-reviews@lists.linux.dev To: "Nabige Aala" Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org, neil.armstrong@linaro.org, olteanv@gmail.com In-Reply-To: <20261203-nord-drv-dt-v4-10-a899d23af07a@oss.qualcomm.com> References: <20261203-nord-drv-dt-v4-0-a899d23af07a@oss.qualcomm.com> <20261203-nord-drv-dt-v4-10-a899d23af07a@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:06:31 +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 3 potential issues to consider: - [Medium] phy: qcom: edp: qcom_edp_dcc_calibrate_nord() polls all lanes in 1-lane mode - [Low] phy: qcom: edp: duplicate v6/v8 code and misplaced Nord definitions - [Low] phy: qcom: edp: extra AUX/DRV_LVL writes in qcom_edp_tx_res_config_nord() -- commit a5802c72f11d33fa941a827664efb57ba7c55383 Author: Ritesh Kumar phy: qcom: edp: Add Nord DP PHY support This commit adds DisplayPort PHY support for the Qualcomm Nord SoC, reusing the v6 QSERDES COM register layout and making com_ldo_config optional in struct phy_ver_ops. > diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/p= hy-qcom-edp.c > index 46bc9a7797675..77e8a92c1bc67 100644 > --- a/drivers/phy/qualcomm/phy-qcom-edp.c > +++ b/drivers/phy/qualcomm/phy-qcom-edp.c [ ... ] > @@ -1521,6 +1525,299 @@ static int qcom_edp_phy_probe(struct platform_dev= ice *pdev) [ ... ] > +static int qcom_edp_tx_res_config_nord(const struct qcom_edp *edp) > +{ > + u32 aux_cfg2; > + u32 tx_band; > + > + if (edp->dp_opts.link_rate =3D=3D 8100) { > + aux_cfg2 =3D 0xa0; > + tx_band =3D 0x07; > + } else { > + aux_cfg2 =3D 0xa4; > + tx_band =3D 0x05; > + } > + > + writel(aux_cfg2, edp->edp + DP_PHY_AUX_CFG(2)); > + writel(0x06, edp->tx0 + TXn_RES_CODE_LANE_OFFSET_TX0); > + writel(0x06, edp->tx0 + TXn_RES_CODE_LANE_OFFSET_TX1); > + writel(0x06, edp->tx1 + TXn_RES_CODE_LANE_OFFSET_TX0); > + writel(0x06, edp->tx1 + TXn_RES_CODE_LANE_OFFSET_TX1); > + writel(0x06, edp->tx0 + TXn_TX_EMP_POST1_LVL); > + writel(0x06, edp->tx1 + TXn_TX_EMP_POST1_LVL); > + writel(tx_band, edp->tx0 + TXn_TX_BAND_NORD); > + writel(tx_band, edp->tx1 + TXn_TX_BAND_NORD); > + writel(0x12, edp->edp + DP_PHY_TX_LN0_DRV_LVL_NORD); > + writel(0x12, edp->edp + DP_PHY_TX_LN1_DRV_LVL_NORD); > + > + return 0; > +} [Severity: Low] As reported by Dmitry Baryshkov on v2 [1], should qcom_edp_tx_res_config_nord() be reprogramming DP_PHY_AUX_CFG(2) and DP_PHY_TX_LN0/1_DRV_LVL_NORD inside tx_res_config()? qcom_edp_tx_res_config_default() only configures TXn_TX_BAND, TXn_RES_CODE_LANE_OFFSET_TX0/1, and TXn_TX_EMP_POST1_LVL, leaving the initial drive-level writes to TXn_TX_DRV_LVL hardcoded in qcom_edp_phy_power_on(). Because of that, qcom_edp_phy_power_on() still unconditionally writes 0x1f to edp->tx0/tx1 + TXn_TX_DRV_LVL on Nord right after tx_res_config() returns, even though Nord relocates drive-level control to DP_PHY_TX_LN0/1_DRV_LVL_NORD. Moving the initial TXn_TX_DRV_LVL writes into qcom_edp_tx_res_config_default() and keeping DP_PHY_AUX_CFG(2) outside tx_res_config() would avoid those legacy writes on Nord and keep the callback symmetric across SoCs. [ ... ] > +static int qcom_edp_dcc_calibrate_nord(const struct qcom_edp *edp) > +{ > + u32 tx0_done =3D 0; > + u32 tx1_done =3D 0; > + int tx0_ret; > + int tx1_ret; > + > + writel(0x07, edp->tx0 + TXn_DCC0_CTRL_NORD); > + writel(0x07, edp->tx0 + TXn_DCC1_CTRL_NORD); > + writel(0x07, edp->tx1 + TXn_DCC0_CTRL_NORD); > + writel(0x07, edp->tx1 + TXn_DCC1_CTRL_NORD); > + > + usleep_range(200, 250); > + > + tx0_ret =3D readl_poll_timeout(edp->tx0 + TXn_DCC_DONE_NORD, tx0_done, > + (tx0_done & 0x03) =3D=3D 0x03, 50, 10000); > + tx1_ret =3D readl_poll_timeout(edp->tx1 + TXn_DCC_DONE_NORD, tx1_done, > + (tx1_done & 0x03) =3D=3D 0x03, 50, 10000); > + > + qcom_edp_dcc_disable_nord(edp); > + > + return tx0_ret ?: tx1_ret; > +} [Severity: Medium] Can qcom_edp_dcc_calibrate_nord() time out in 1-lane mode? nord_edp_phy_cfg sets .bias1_en_2lane =3D 0x03 to keep TX1 transceiver bias enabled in 2-lane mode, but in 1-lane mode qcom_edp_phy_power_on() still hardcodes bias0_en =3D 0x01 and bias1_en =3D 0x00 right before calling dcc_calibrate(). Yet qcom_edp_dcc_calibrate_nord() enables DCC and polls both sub-lanes of tx0 and tx1 regardless of edp->dp_opts.lanes. With a 1-lane sink or after lane down-shift via msm_dp_ctrl_link_lane_down_shift() -> msm_dp_ctrl_enable_mainlink_clocks(), TX0 lane 1 and both TX1 lanes are unbiased during calibration. If DCC completion depends on transceiver bias, qcom_edp_phy_power_on() returns -ETIMEDOUT, skipping clk_set_rate() for the link and pixel clocks while msm_dp_ctrl_enable_mainlink_clocks() ignores the error and breaks 1-lane bring-up. Separately, if tx0_ret already timed out, polling tx1 still waits up to another 10 ms before discarding tx1_ret. Either gating DCC enablement and polling on edp->dp_opts.lanes (or biasing all calibrated lanes in 1-lane mode) and skipping the tx1 poll on tx0_ret failure would address this. [ ... ] > +static int qcom_edp_phy_com_resetsm_cntrl_nord(const struct qcom_edp *ed= p) > +{ > + u32 val; > + > + writel(0x20, edp->pll + QSERDES_V6_COM_RESETSM_CNTRL); > + > + return readl_poll_timeout(edp->pll + QSERDES_V6_COM_C_READY_STATUS, > + val, val & BIT(0), 500, 10000); > +} [ ... ] > +static const struct phy_ver_ops qcom_edp_phy_ops_nord =3D { > + .com_power_on =3D qcom_edp_phy_power_on_nord, > + .com_resetsm_cntrl =3D qcom_edp_phy_com_resetsm_cntrl_nord, > + .com_bias_en_clkbuflr =3D qcom_edp_com_bias_en_clkbuflr_v8, > + .com_clk_fwd_cfg =3D qcom_edp_com_clk_fwd_cfg_v4, > + .com_configure_pll =3D qcom_edp_com_configure_pll_nord, > + .com_configure_ssc =3D qcom_edp_com_configure_ssc_nord, > + .tx_res_config =3D qcom_edp_tx_res_config_nord, > + .set_voltages =3D qcom_edp_set_voltages_nord, > + .dcc_calibrate =3D qcom_edp_dcc_calibrate_nord, > +}; [ ... ] > { .compatible =3D "qcom,x1e80100-dp-phy", .data =3D &x1e80100_phy_cfg, = }, > + { .compatible =3D "qcom,nord-dp-phy", .data =3D &nord_edp_phy_cfg, }, > { } > }; [Severity: Low] As reported by Dmitry Baryshkov on v1 [2], can qcom_edp_phy_ops_nord reuse the existing v6/v8 definitions instead of duplicating them? qcom_edp_phy_com_resetsm_cntrl_nord() is an exact duplicate of qcom_edp_phy_com_resetsm_cntrl_v6(), and edp_phy_vco_div_cfg_nord is an exact duplicate of edp_phy_vco_div_cfg_v8. In addition, qcom_edp_phy_ops_nord assigns qcom_edp_com_bias_en_clkbuflr_v8 instead of qcom_edp_com_bias_en_clkbuflr_v6 even though Nord uses the QSERDES_V6_COM_* register layout everywhere else. Also, placing the Nord macros, tables, callbacks, ops, and config structs after qcom_edp_phy_probe() differs from the other SoCs defined earlier in the file, and qcom,nord-dp-phy is out of alphabetical order in qcom_edp_phy_match_table[]. [1] https://lore.kernel.org/r/qqfucmyebsvemdr5px33wabsxxq4owozwmxcqu62sprs5= k32bo@kb5pjx2m4ucq [2] https://lore.kernel.org/r/53h45tzuwxcpa3dgto5jcpc74hpeifzuhdjwvwlgsbvkx= axlcg@p2p5rciv3e2g --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-nord-drv-d= t-v4-0-a899d23af07a@oss.qualcomm.com?part=3D10