Re: [PATCH v2 1/3] phy: qcom: qmp-combo: delay Type-C mux switch while DP PHY is initializing
From: Naidu Nama
Date: Fri Nov 13 2026 - 02:57:06 EST
On 11-11-2026 19:36, Dmitry Baryshkov wrote:
On Wed, Nov 11, 2026 at 04:13:53PM +0530, naidu nama wrote:
From: Saurabh Anand <saurabh.anand@xxxxxxxxxxxxxxxx>How is going to be handled then?
The Type-C mux switch guard only checked dp_powered_on, which is set in
qmp_combo_dp_power_on(). However there is a race window between
qmp_combo_dp_init() and qmp_combo_dp_power_on() during which dp_init_count
is non-zero but dp_powered_on is still false. A Type-C orientation change
arriving in this window would proceed with the mux switch while the DP PHY
is mid-initialization, corrupting the PHY state.
With dp_init_count check, mux_set will be skipped.
Extend the guard to also block the mux switch when dp_init_count isNaidu, you are resending the other people patches, but the SoB is
non-zero, covering the full period from dp_init through dp_power_on.
Signed-off-by: Saurabh Anand <saurabh.anand@xxxxxxxxxxxxxxxx>
missing.
Sure, I will update in v3.
---Can dp_powered_on be dropped then?
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 61d8b7a5ce8f..3f93043f94e5 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -5163,7 +5163,8 @@ static int qmp_combo_typec_mux_set(struct typec_mux_dev *mux, struct typec_mux_s
return 0;
}
- if (qmp->qmpphy_mode != QMPPHY_MODE_USB3_ONLY && qmp->dp_powered_on) {
+ if (qmp->qmpphy_mode != QMPPHY_MODE_USB3_ONLY &&
+ (qmp->dp_powered_on || qmp->dp_init_count)) {
Yes, this can be dropped.
dev_dbg(qmp->dev, "typec_mux_set: DP PHY is still in use, delaying switch\n");
return 0;
}
--
2.43.0