Re: [PATCH v2 5/7] usb: dwc3: add xhci-reset-on-resume property for power-loss resume

From: Faisal Hassan

Date: Wed Sep 16 2026 - 09:37:39 EST



On 04-09-2026 11:39 am, Krishna Kurapati wrote:


On 9/3/2026 9:08 PM, Faisal Hassan wrote:
On platforms where the USB controller loses power during system
suspend, like SA8255P, resume triggers a Host Controller Error
requiring full reinitialization.

The xhci driver supports XHCI_RESET_ON_RESUME to handle this,
but dwc3 previously lacked platform-specific quirk configuration.
Add a device property "xhci-reset-on-resume" that enables this
quirk for controllers needing complete reinitialization after
power loss during suspend.

Let dwc3 manage the quirk for the usb controller using
software properties.

Co-developed-by: Sriram Dash <sriram.dash@xxxxxxxxxxxxxxxx>
Signed-off-by: Sriram Dash <sriram.dash@xxxxxxxxxxxxxxxx>
Signed-off-by: Faisal Hassan <faisal.hassan@xxxxxxxxxxxxxxxx>
---
  drivers/usb/dwc3/core.c | 4 ++++
  drivers/usb/dwc3/core.h | 5 +++++
  drivers/usb/dwc3/host.c | 5 ++++-
  3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index fd5c2cd36c59..eb6ffd5148a7 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1712,6 +1712,10 @@ static void dwc3_get_software_properties(struct dwc3 *dwc,
                             &gsbuscfg0_reqinfo);
          if (!ret)
              dwc->gsbuscfg0_reqinfo = gsbuscfg0_reqinfo;
+
+        if (!dwc->xhci_reset_on_resume &&
+            device_property_read_bool(tmpdev, "xhci-reset-on-resume"))
+            dwc->xhci_reset_on_resume = true;
      }

xHCI plat does look for properties in xhci device node as well as the ones above it in the parent chain:

"
    /* Iterate over all parent nodes for finding quirks */
    for (tmpdev = &pdev->dev; tmpdev; tmpdev = tmpdev->parent) {
"

So adding device_add_software_node in dwc3_qcom must be sufficient.

Regards,
Krishna,


Good catch, you're right. Since xhci-plat already walks the parent
chain, there's no need to round-trip this through dwc3 core. I'm
dropping this patch and attaching the software node on dwc3-qcom's own
device instead, in the "Support broken suspend for SA8255P" patch later
in the series.

Thanks,
Faisal