[PATCH v2 1/7] usb: dwc3: qcom: re-enable wakeup interrupts on failed resume

From: Faisal Hassan

Date: Thu Sep 03 2026 - 12:49:43 EST


dwc3_qcom_resume() disables wakeup interrupts before re-enabling
clocks, then re-enables them again once resume completes. If
clk_bulk_prepare_enable() fails partway through, the function
returns early without re-enabling the interrupts that were just
disabled, leaving host-mode wakeup interrupts masked after a
failed resume.

Jump to a common cleanup path that re-enables the interrupts
before returning the error, mirroring the success path.

Signed-off-by: Faisal Hassan <faisal.hassan@xxxxxxxxxxxxxxxx>
---
drivers/usb/dwc3/dwc3-qcom.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index ac68b4218b56..49698a31b2f4 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -382,7 +382,7 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom, bool wakeup)

ret = clk_bulk_prepare_enable(qcom->num_clocks, qcom->clks);
if (ret < 0)
- return ret;
+ goto enable_irq;

ret = dwc3_qcom_interconnect_enable(qcom);
if (ret)
@@ -398,6 +398,16 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom, bool wakeup)
qcom->is_suspended = false;

return 0;
+
+enable_irq:
+ /*
+ * Re-enable interrupts if they were disabled earlier, so a failed
+ * resume doesn't leave wakeup interrupts masked.
+ */
+ if (dwc3_qcom_is_host(qcom) && wakeup)
+ dwc3_qcom_enable_interrupts(qcom);
+
+ return ret;
}

static irqreturn_t qcom_dwc3_resume_irq(int irq, void *data)
--
2.34.1