Re: [PATCH v2] usb: dwc3: qcom: Add support to skip phy management by USB core
From: Peter Chen
Date: Thu Nov 26 2026 - 22:27:25 EST
On 26-11-26 22:05:56, Krishna Kurapati wrote:
> DWC3 driver does manage phys itself sufficiently for Qualcomm platforms.
> If xhci-skip-phy-init is not set, the HCD core does a phy_init and phy_
> exit is done only when roothub is being destroyed. Due to this, during
> system suspend in host mode, although phy_exit is done by DWC3 core, the
> init_count on phy is never down to zero since HCD core also did an init.
> consequently causing phy's exit routine to not be called. Hence, add
> support to skip phy management by USB core.
>
> Some Exynos platforms still do rely on USB core for phy_calibrate calls,
> hence disable USB core management for Qualcomm platforms only.
>
> Signed-off-by: Krishna Kurapati <krishna.kurapati@xxxxxxxxxxxxxxxx>
Reviewed-by: Peter Chen <peter.chen@xxxxxxxxxxxxxxxx>
Peter
> ---
> Initially, a patch was sent adding software_node properties [1]. But it
> was causing a bootup issue as mentioned in [2]. Hence a revert was sent
> to fix it [3]. This patch uses a different approach as opposed to adding
> sofware node properties and was tested on sm8750 mtp.
>
> Changes in v2:
> - Rebased on top of Thinh's latest patch series [4]
> - Removed Thinh's ACK since code changes are different in this version
>
> Link to v1:
> https://lore.kernel.org/all/20260914-xhci-skip-phy-init-v1-1-9c46b31a5a39@xxxxxxxxxxxxxxxx/
>
> [1]: https://lore.kernel.org/all/20260723-dwc3-skip-init-quirk-v1-1-97682bb44ebd@xxxxxxxxxxxxxxxx/
> [2]: https://lore.kernel.org/all/cbb4ae94-7862-4d91-b01d-0d7f18d49a45@xxxxxxxxxxxx/
> [3]: https://lore.kernel.org/all/20260909-xhci-fixes-revert-v1-1-7cc97fa0f307@xxxxxxxxxxxxxxxx/
> [4]: https://lore.kernel.org/all/cover.1795559405.git.Thinh.Nguyen@xxxxxxxxxxxx/
> ---
> drivers/usb/dwc3/core.h | 3 +++
> drivers/usb/dwc3/dwc3-qcom.c | 7 +++++++
> drivers/usb/dwc3/host.c | 5 ++++-
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index d103a637a4f7..9b9714fdba9e 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -1139,6 +1139,7 @@ struct dwc3_glue_ops {
> * @usb2_gadget_lpm_disable: set to disable usb2 lpm for gadget
> * @needs_full_reinit: set to indicate the core may lose power and need full
> * initialization during system pm
> + * @skip_phy_init: set to skip xHCI PHY initialization on host init
> * @disable_scramble_quirk: set if we enable the disable scramble quirk
> * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk
> * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
> @@ -1408,6 +1409,8 @@ struct dwc3 {
> unsigned usb2_gadget_lpm_disable:1;
> unsigned needs_full_reinit:1;
>
> + unsigned skip_phy_init:1;
> +
> unsigned disable_scramble_quirk:1;
> unsigned u2exit_lfps_quirk:1;
> unsigned u2ss_inp3_quirk:1;
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index ef38308023aa..3fe2e0fb3eb7 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -636,6 +636,12 @@ static struct dwc3_glue_ops dwc3_qcom_glue_ops = {
> .pre_run_stop = dwc3_qcom_run_stop_notifier,
> };
>
> +static void dwc3_qcom_fixup_properties(struct dwc3 *dwc,
> + struct dwc3_properties *props)
> +{
> + props->skip_phy_init = true;
> +}
> +
> static int dwc3_qcom_probe(struct platform_device *pdev)
> {
> struct dwc3_probe_data probe_data = {};
> @@ -745,6 +751,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
> probe_data.dwc = &qcom->dwc;
> probe_data.res = &res;
> probe_data.ignore_clocks_and_resets = true;
> + probe_data.fixup_properties = dwc3_qcom_fixup_properties;
> ret = dwc3_core_probe(&probe_data);
> if (ret) {
> ret = dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index c5674161b2b0..3fb8be8be590 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -130,7 +130,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
>
> int dwc3_host_init(struct dwc3 *dwc)
> {
> - struct property_entry props[6];
> + struct property_entry props[7];
> struct platform_device *xhci;
> int ret, irq;
> int prop_idx = 0;
> @@ -174,6 +174,9 @@ int dwc3_host_init(struct dwc3 *dwc)
> if (dwc->usb2_lpm_disable)
> props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable");
>
> + if (dwc->skip_phy_init)
> + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk");
> +
> /**
> * WORKAROUND: dwc3 revisions <=3.00a have a limitation
> * where Port Disable command doesn't work.
>
> ---
> base-commit: a431ab75251f0ae5b7019efe7221b851716c2c3c
> change-id: 20261126-xhci-skip-phy-init-v2-6d0b35508b0b
>
> Best regards,
> --
> Krishna Kurapati <krishna.kurapati@xxxxxxxxxxxxxxxx>
>
>
--
Thanks,
Peter Chen