Re: [PATCH v4 0/2] usb: dwc3: qcom: Keep USB 2.0 working in DisplayPort-only modes
From: Peter Chen
Date: Thu Dec 03 2026 - 03:21:18 EST
On 26-11-23 18:47:07, Peter Chen wrote:
>
> Thanks for explaining the trade-off in the cover letter, I may
> still prefer that the PHY notifies the controller is better, for
> the reasons below.
>
> - The controller may not know well what the PHY really did or is going
> to do:
>
> qmp_combo_typec_mux_set() has its own policy. It does not
> reconfigure while DP is powered on, and it skips the switch when
> the PHY is not initialized
> (drivers/phy/qualcomm/phy-qcom-qmp-combo.c):
>
> if (qmp->qmpphy_mode != QMPPHY_MODE_USB3_ONLY && qmp->dp_powered_on) {
> dev_dbg(qmp->dev, "typec_mux_set: DP PHY is still in use, delaying switch\n");
> return 0;
> }
>
> /* The mux still receives Type-C events, even if all PHYs are uninitialized */
> if (!qmp->init_count)
> return 0;
>
> At above cases, no switch clock from PIPE to UMTI is needed.
> If qmp-combo calls the controller right before it tears the PHY down
> and again after it brings it up with the new mode, the controller does
> not add wrong or useless settings. It uses the UTMI clock while the
> PHY is being reconfigured, and goes back to the PIPE clock only if the
> new mode has USB3.
>
> - Once DT ABI is added, it combines the kernel code with DTS. It needs
> to maintain both DT property (graph) and kernel code correctly, eg,
> it also depends on the layout at pmic-glink node. If using PHY notifies
> controller solution, it adapts for all related SoCs, and no dts
> dependencies.
>
Hi Joonhoe,
We may want this feature to move on since it is important for USB/DP altmode
application. The similar solution at Rockship seems to settle down [1], there
is no more comments from both USB and PHY maintainer, would you accept
the notify solution from PHY to Controller? If you accept, do you want to
implement by yourself or could accept that we (qcom) implement it? Thanks.
[1] https://lore.kernel.org/all/20261114-b4-rockchip-dwc3-rockchip-glue-v19-0-b79fb5f4b42a@xxxxxxxxxxxxx/
Peter
> Thinh, What's your opinion?
>
> Peter
>
> >
> > On Kaanapali the PHY becomes a mode switch with Balaji Kalkonda's
> > DisplayPort series [2]. The controller side for that SoC is a DTS patch
> > sent separately to the Qualcomm tree [3], and Tapas Rana has sent the
> > same for Glymur [4]. Neither should be applied before patch 2: once the
> > controller node has "mode-switch", pmic_glink_altmode defers its probe
> > until dwc3-qcom registers the mux, which only patch 2 does.
> >
> > Patch 2 is on top of Filippo Falezza's "usb: dwc3: qcom: Restore UTMI
> > PIPE clock on resume" [5] and reads the selected clock back from
> > QSCRATCH, which loses its contents in system suspend on SM7250. [5] is
> > still under review; patch 2 will be rebased if it changes.
> >
> > Patch 2 adds "depends on TYPEC || TYPEC=n" to USB_DWC3_QCOM, so with the
> > arm64 defconfig (TYPEC=m) dwc3-qcom is built as a module.
> > pmic_glink_altmode then probes later, and a monitor attached at boot
> > depends on Yongxing Mou's "drm/bridge: aux-hpd-bridge: replay last HPD
> > status on hpd_enable" [6] to be detected.
> >
> > Tested on a Lenovo Y700 Gen 5 (TB323FU, Kaanapali) with the series
> > backported to a v7.3-based tree that also has [2], [3] and [5], with a
> > USB-C monitor that has an MST hub (two displays, DisplayPort over four
> > lanes) and a USB 2.0 hub. On each of 5 plugs the controller switched to
> > the UTMI clock 1-2 ms before the PHY switched, back to the PIPE clock on
> > the next USB state, and the monitor's hub enumerated. After each of
> > three s2idle cycles with the monitor attached, both displays and the hub
> > came back. Plugging the monitor in during s2idle woke the tablet. The
> > mode arrived after the glue had resumed and was applied right away,
> > before the PHY switched (once with each clock selected beforehand); the
> > path that applies a recorded state on resume was not hit. A USB-C hub
> > with DisplayPort and USB 3 kept the PIPE clock, and a USB 3 stick on it
> > ran at SuperSpeed.
> >
> > Changes in v4:
> > - Patch 1: add Reviewed-by from Krzysztof
> > - Patch 2: mutex_lock()/mutex_unlock() where nothing returns early
> > (Krzysztof)
> > - Patch 2: leave the probe code as it was apart from the new argument
> > (Krzysztof)
> > - Rebase on next-20261118
> > - Link to v3: https://lore.kernel.org/all/20261112113838.506-1-26rote@xxxxxxxxx/
> >
> > [1] https://lore.kernel.org/all/avZ7-Ax-_VwcJhYG@xxxxxxxxxxxxxxxxxxxxxxxxx/
> > [2] https://lore.kernel.org/all/20261022-kaanapali_dp-v3-0-b5ae8e6083c3@xxxxxxxxxxxxxxxx/
> > [3] https://lore.kernel.org/all/20261112113921.1143-1-26rote@xxxxxxxxx/
> > [4] https://lore.kernel.org/all/20261117113834.925310-1-tapas.rana@xxxxxxxxxxxxxxxx/
> > [5] https://lore.kernel.org/all/20261027-dwc3-utmi-resume-v1-1-ca9f0aa65783@xxxxxxxxx/
> > [6] https://lore.kernel.org/all/20260803-drm-usbdp-preboot-v1-1-2539b362be00@xxxxxxxxxxxxxxxx/
> >
> > Joonhoe Kim (2):
> > dt-bindings: usb: qcom,snps-dwc3: Add mode-switch
> > usb: dwc3: qcom: Use the UTMI clock as PIPE clock in DisplayPort-only
> > modes
> >
> > .../bindings/usb/qcom,snps-dwc3.yaml | 5 +
> > drivers/usb/dwc3/Kconfig | 1 +
> > drivers/usb/dwc3/dwc3-qcom.c | 150 ++++++++++++++++--
> > 3 files changed, 143 insertions(+), 13 deletions(-)
> >
> >
> > base-commit: e8017d29067fd1310a65c3494ce1a1b492adbac6
> > prerequisite-patch-id: a793fca7329dac964c21459f8d7a8b003d36d84d
> > --
> > 2.53.0
> >
>
> --
>
> Thanks,
> Peter Chen
--
Thanks,
Peter Chen