Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Nabige Aala" <nabige.aala@oss.qualcomm.com>
Cc: linux-phy@lists.infradead.org, vkoul@kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v6 07/11] phy: qualcomm: qmp-combo: Extract common DP PHY init sequence
Date: Wed, 28 Oct 2026 10:47:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-187773@kernel.org> (raw)
In-Reply-To: <20261028-glymur-phy-v3-v6-7-1f1d2e565a66@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] phy: qualcomm: qmp-combo: wrong caller updated in qmp_v4_configure_dp_phy()
- [High] phy: qualcomm: qmp-combo: missing dp_aux_cfg2 in nord_usb3dpphy_cfg
--

commit c0d8ea9d3475aca913f861f23b13efab33c9a844
Author: Ritesh Kumar <ritesh.kumar@oss.qualcomm.com>

phy: qualcomm: qmp-combo: Extract common DP PHY init sequence

This commit extracts the common DisplayPort PHY initialization sequence into
qmp_combo_configure_dp_phy_common() to share it between the v4/v5/v6 and v8
DisplayPort PHY configuration paths.

> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 2ca67c70b17a6..ff7f0293638db 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -3844,6 +3844,62 @@ static void qmp_v4_dp_aux_init(struct qmp_combo *qmp)
>  	       qmp->dp_dp_phy + QSERDES_V4_DP_PHY_AUX_INTERRUPT_MASK);
>  }
>  
> +static int qmp_combo_configure_dp_phy_common(struct qmp_combo *qmp)
> +{
> +	const struct qmp_phy_cfg *cfg = qmp->cfg;
> +	u32 status;
> +	int ret;
> +
> +	if (!cfg->dp_aux_cfg2) {
> +		dev_err(qmp->dev, "DP AUX CFG2 value not configured\n");
> +		return -EINVAL;
> +	}
> +
> +	writel(cfg->dp_phy_cfg1, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG_1);

[Severity: High]
Will this cause qmp_combo_dp_power_on() -> qmp_v4_configure_dp_phy() ->
qmp_combo_configure_dp_phy_common() to fail with -EINVAL on Nord platforms?

Prior to this change, qmp_v456_configure_dp_phy() wrote hardcoded 0x0f and
0xa4 values to QSERDES_DP_PHY_CFG_1 and QSERDES_DP_PHY_AUX_CFG2.

In drivers/phy/qualcomm/phy-qcom-qmp-combo.c, nord_usb3dpphy_cfg sets
.configure_dp_phy = qmp_v4_configure_dp_phy, but does not initialize
.dp_aux_cfg2 or .dp_phy_cfg1 (which were missed for Nord in commit
e183e9431641 ("phy: qualcomm: qmp-combo: Add hardware-specific dp_aux_cfg2 and
dp_phy_cfg1 fields")):

drivers/phy/qualcomm/phy-qcom-qmp-combo.c:nord_usb3dpphy_cfg {
	...
	.dp_aux_init		= qmp_v4_dp_aux_init,
	.configure_dp_tx	= qmp_v4_configure_dp_tx,
	.configure_dp_clocks	= qmp_v3_configure_dp_clocks,
	.configure_dp_phy	= qmp_v4_configure_dp_phy,

	.regs			= qmp_v6_usb3phy_regs_layout,
	...
};

Because cfg->dp_aux_cfg2 is zero on Nord, qmp_combo_configure_dp_phy_common()
immediately returns -EINVAL and aborts DisplayPort PHY initialization. Should
nord_usb3dpphy_cfg also set .dp_aux_cfg2 and .dp_phy_cfg1?

[ ... ]

> @@ -3944,48 +4000,10 @@ static int qmp_v456_configure_dp_phy(struct qmp_combo *qmp)
>  	u32 status;
>  	int ret;
>  
> -	writel(0x0f, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG_1);
> -
> -	qmp_combo_configure_dp_mode(qmp);
> -
> -	writel(0x13, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG1);
> -	writel(0xa4, qmp->dp_dp_phy + QSERDES_DP_PHY_AUX_CFG2);
> -
> -	writel(0x05, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_TX0_TX1_LANE_CTL);
> -	writel(0x05, qmp->dp_dp_phy + QSERDES_V4_DP_PHY_TX2_TX3_LANE_CTL);
> -
> -	ret = qmp->cfg->configure_dp_clocks(qmp);
> +	ret = qmp_combo_configure_dp_phy_common(qmp);
>  	if (ret)
>  		return ret;
>  
> -	writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG);
> -	writel(0x05, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG);
> -	writel(0x01, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG);
> -	writel(0x09, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG);
> -
> -	writel(0x20, qmp->dp_serdes + cfg->regs[QPHY_COM_RESETSM_CNTRL]);
> -
> -	if (readl_poll_timeout(qmp->dp_serdes + cfg->regs[QPHY_COM_C_READY_STATUS],
> -			status,
> -			((status & BIT(0)) > 0),
> -			500,
> -			10000))
> -		return -ETIMEDOUT;
> -
> -	if (readl_poll_timeout(qmp->dp_serdes + cfg->regs[QPHY_COM_CMN_STATUS],
> -			status,
> -			((status & BIT(0)) > 0),
> -			500,
> -			10000))
> -		return -ETIMEDOUT;
> -
> -	if (readl_poll_timeout(qmp->dp_serdes + cfg->regs[QPHY_COM_CMN_STATUS],
> -			status,
> -			((status & BIT(1)) > 0),
> -			500,
> -			10000))
> -		return -ETIMEDOUT;
> -
>  	writel(0x19, qmp->dp_dp_phy + QSERDES_DP_PHY_CFG);
>  
>  	if (readl_poll_timeout(qmp->dp_dp_phy + cfg->regs[QPHY_DP_PHY_STATUS],
> @@ -4014,7 +4032,7 @@ static int qmp_v4_configure_dp_phy(struct qmp_combo *qmp)
>  	u32 status;
>  	int ret;
>  
> -	ret = qmp_v456_configure_dp_phy(qmp);
> +	ret = qmp_combo_configure_dp_phy_common(qmp);
>  	if (ret < 0)
>  		return ret;

[Severity: High]
Was this hunk intended to modify qmp_v8_configure_dp_phy() rather than
qmp_v4_configure_dp_phy()?

The commit description states that qmp_v8_configure_dp_phy() is updated to
call qmp_combo_configure_dp_phy_common() directly instead of going through
qmp_v456_configure_dp_phy().

However, this hunk updates qmp_v4_configure_dp_phy() instead. As a result, all
v4, v5, and v6 platforms using qmp_v4_configure_dp_phy() now bypass
qmp_v456_configure_dp_phy(), skipping the QSERDES_DP_PHY_CFG (0x19) write and
QPHY_DP_PHY_STATUS polling before programming the TX driver and transceiver
bias registers.

Meanwhile, qmp_v8_configure_dp_phy() still calls qmp_v456_configure_dp_phy():

drivers/phy/qualcomm/phy-qcom-qmp-combo.c:qmp_v8_configure_dp_phy() {
	...
	ret = qmp_v456_configure_dp_phy(qmp);
	if (ret < 0)
		return ret;
	...
}

Should qmp_v4_configure_dp_phy() keep calling qmp_v456_configure_dp_phy(), and
qmp_v8_configure_dp_phy() be updated to call
qmp_combo_configure_dp_phy_common() instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028-glymur-phy-v3-v6-0-1f1d2e565a66@oss.qualcomm.com?part=7

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-10-28 10:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 10:37 [PATCH v6 00/11] phy: qualcomm: qmp-combo: update DP PHY PLL programming on Glymur Nabige Aala
2026-10-28 10:37 ` [PATCH v6 01/11] phy: qualcomm: qmp-combo: Add DP COM v8 header and fix register layout Nabige Aala
2026-10-28 10:37 ` [PATCH v6 02/11] phy: qualcomm: qmp-combo: Update DP PHY common init tables Nabige Aala
2026-10-28 10:37 ` [PATCH v6 03/11] phy: qualcomm: qmp-combo: Update link rate specific DP PHY tables Nabige Aala
2026-10-28 10:38 ` [PATCH v6 04/11] phy: qualcomm: qmp-combo: Ignore Type-C orientation for Glymur DP mode Nabige Aala
2026-10-28 10:38 ` [PATCH v6 05/11] phy: qualcomm: qmp-combo: Add hardware-specific dp_aux_cfg2 and dp_phy_cfg1 fields Nabige Aala
2026-10-28 10:48   ` sashiko-bot
2026-10-28 10:38 ` [PATCH v6 06/11] phy: qualcomm: qmp-combo: Add v8 PCS-level drive level tables for Glymur Nabige Aala
2026-10-28 10:38 ` [PATCH v6 07/11] phy: qualcomm: qmp-combo: Extract common DP PHY init sequence Nabige Aala
2026-10-28 10:47   ` sashiko-bot [this message]
2026-10-28 10:38 ` [PATCH v6 08/11] phy: qualcomm: qmp-combo: Remove VCO_DIV programming from qmp_v8_configure_dp_clocks() Nabige Aala
2026-10-28 10:38 ` [PATCH v6 09/11] phy: qualcomm: qmp-combo: Add per-link-rate auxless/LFPS and drive level for Glymur Nabige Aala
2026-10-28 10:53   ` sashiko-bot
2026-10-28 10:38 ` [PATCH v6 10/11] phy: qualcomm: qmp-combo: Fix Glymur v8 DP PHY init and configure sequences Nabige Aala
2026-10-28 11:01   ` sashiko-bot
2026-10-28 10:38 ` [PATCH v6 11/11] phy: qualcomm: qmp-combo: Fix error propagation in qmp_combo_dp_power_on() Nabige Aala
2026-10-28 10:55   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-187773@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=nabige.aala@oss.qualcomm.com \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox