mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nabige Aala <nabige.aala@oss.qualcomm.com>
To: Oleg Keri <okerixx@gmail.com>, Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ritesh Kumar <ritesh.kumar@oss.qualcomm.com>,
	Mahadevan P <mahadevan.p@oss.qualcomm.com>
Subject: Re: [PATCH v4 4/9] phy: qualcomm: qmp-combo: Add hardware-specific DP PHY config fields
Date: Wed, 30 Sep 2026 17:33:16 +0530	[thread overview]
Message-ID: <c201bdf4-7b23-4f7f-83fd-b19a8d2aba9c@oss.qualcomm.com> (raw)
In-Reply-To: <178966967452.3333.16125740437772430030@gmail.com>


On 9/17/2026 11:57 PM, Oleg Keri wrote:
> Hi Nabige,
>
> On Tue, Sep 08, 2026, Nabige Aala wrote:
>> Update qmp_combo_configure_dp_mode() to honor dp_mode_ignore_reverse,
>> so Glymur can bypass TypeC orientation-based lane reversal.
> This breaks 2-lane DP with a reversed plug on a Lenovo Yoga Slim 7x
> Gen 11 (Glymur), with the whole v4 series on next-20260916.
>
> With dp_mode_ignore_reverse set, qmp_combo_configure_dp_mode() always
> programs the normal side (DP_PHY_MODE 0x5c, lane 2/3 power bits in
> DP_PHY_PD_CTL), while qmp_v8_configure_dp_phy() still follows the real
> orientation and enables TXA for a reversed plug. With fewer than four
> lanes the two no longer match.
>
> On a 2-lane DP + USB3 dock (HBR2, one LTTPR) the reversed plug passes
> clock recovery and then never reaches channel EQ: the LTTPR reports
> CR_DONE on both lanes but never EQ_DONE or SYMBOL_LOCKED, walks its
> pre-emphasis request up to level 3 at swing level 0, and then clock
> recovery is lost. All four attempts end the same way:
>
>    [drm:msm_dp_ctrl_link_train_1_2] *ERROR* link training #2 on phy 1 failed. ret=-110
>    [drm:msm_dp_ctrl_setup_main_link] *ERROR* link training of LTTPR(s) failed. ret=-110
>    [drm:msm_dp_display_atomic_enable] *ERROR* Failed link training (rc=-104)
>
> The same dock trains at once with the plug the other way round. UCSI
> and pmic_glink_altmode report the same orientation in both cases, so
> the orientation itself is right.
>
> Ignoring the orientation only when all four lanes carry DP fixes it
> here, both orientations train:
>
> -	bool reverse = (qmp->orientation == TYPEC_ORIENTATION_REVERSE) &&
> -		       !cfg->dp_mode_ignore_reverse;
>   	const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
> +	bool reverse = (qmp->orientation == TYPEC_ORIENTATION_REVERSE) &&
> +		       !(cfg->dp_mode_ignore_reverse && dp_opts->lanes == 4);
>
> I have no 4-lane sink to check whether 0x5c is really needed for a
> reversed 4-lane link; could you say what the flag is for?
>
> Separately, on 7/9: LN0/LN1_DRV_LVL is now looked up from v/p levels,
> but only in qmp_v8_configure_dp_clocks(), i.e. at power-on when both
> are zero. Level changes during training go through configure_dp_tx(),
> which does not touch these registers, so they stay at the [0][0] entry
> (0x02 at HBR2) where the old code had 0x1f. I can test a v5 on this
> machine.

Hi Oleg,

Thanks for testing and the detailed report.

You are right. The root cause is that in patch 4/9,
dp_mode_ignore_reverse was applied to the reverse variable itself,
which caused it to suppress not just the DP_PHY_MODE write but also
the PD_CTL lane power-down selection. For a 2-lane reversed plug,
PD_CTL was programming the wrong lane pair as active, while
qmp_v8_configure_dp_phy() was still using the raw orientation for
the driver-enable registers. The two were no longer in agreement,
causing the link training failure you observed.

The fix decouples the two: reverse is now always the raw cable
orientation, and dp_mode_ignore_reverse is applied only to the
DP_PHY_MODE write, which is the only register that actually needs
to be fixed to 0x5c for Glymur regardless of orientation:

-     bool reverse = (qmp->orientation == TYPEC_ORIENTATION_REVERSE) &&
-                    !cfg->dp_mode_ignore_reverse;
       const struct phy_configure_opts_dp *dp_opts = &qmp->dp_opts;
+     bool reverse = (qmp->orientation == TYPEC_ORIENTATION_REVERSE);

-     if (reverse)
+     if (reverse && !cfg->dp_mode_ignore_reverse)
               writel(0x4c, qmp->dp_dp_phy + QSERDES_DP_PHY_MODE);
       else
               writel(0x5c, qmp->dp_dp_phy + QSERDES_DP_PHY_MODE);

I have verified this on both 2-lane and 4-lane in both orientations.

Regarding dp_mode_ignore_reverse for 4-lane: I have confirmed with
the glymur HPG guide DP_PHY_MODE must always be 0x5c for Glymur
regardless of orientation. The flag exists solely to suppress the
0x4c write. I will add this fix in the next revision v5.


Thanks,

Nabige Aala

> Thanks,
> Oleg

  reply	other threads:[~2026-09-30 12:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 14:00 [PATCH v4 0/9] phy: qualcomm: qmp-combo: update DP PHY PLL programming on Glymur Nabige Aala
2026-09-08 14:00 ` [PATCH v4 1/9] phy: qualcomm: qmp-combo: Add DP COM v8 header and fix register layout Nabige Aala
2026-09-08 14:00 ` [PATCH v4 2/9] phy: qualcomm: qmp-combo: Update DP PHY common init tables Nabige Aala
2026-09-08 14:00 ` [PATCH v4 3/9] phy: qualcomm: qmp-combo: Update link rate specific DP PHY tables Nabige Aala
2026-09-08 14:00 ` [PATCH v4 4/9] phy: qualcomm: qmp-combo: Add hardware-specific DP PHY config fields Nabige Aala
2026-09-11  5:25   ` Manivannan Sadhasivam
2026-09-17 18:27   ` Oleg Keri
2026-09-30 12:03     ` Nabige Aala [this message]
2026-09-08 14:00 ` [PATCH v4 5/9] phy: qualcomm: qmp-combo: Add v8 PCS-level drive level tables for Glymur Nabige Aala
2026-09-11  5:27   ` Manivannan Sadhasivam
2026-09-08 14:00 ` [PATCH v4 6/9] phy: qualcomm: qmp-combo: Extract common DP PHY init sequence Nabige Aala
2026-09-11  5:30   ` Manivannan Sadhasivam
2026-09-11 12:25     ` Nabige Aala
2026-09-08 14:01 ` [PATCH v4 7/9] phy: qualcomm: qmp-combo: Update qmp_v8_configure_dp_clocks() for Glymur Nabige Aala
2026-09-11  5:37   ` Manivannan Sadhasivam
2026-09-08 14:01 ` [PATCH v4 8/9] phy: qualcomm: qmp-combo: Fix Glymur v8 DP PHY init and configure sequences Nabige Aala
2026-09-11  5:38   ` Manivannan Sadhasivam
2026-09-08 14:01 ` [PATCH v4 9/9] phy: qualcomm: qmp-combo: Fix error propagation in qmp_combo_dp_power_on() Nabige Aala
2026-09-11  5:39   ` Manivannan Sadhasivam

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=c201bdf4-7b23-4f7f-83fd-b19a8d2aba9c@oss.qualcomm.com \
    --to=nabige.aala@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mahadevan.p@oss.qualcomm.com \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=okerixx@gmail.com \
    --cc=ritesh.kumar@oss.qualcomm.com \
    --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

all inboxes | Powered by JetHome®