Re: [PATCH v5 02/11] usb: dwc3: qcom: Disarm wakeup IRQs on system suspend without wakeup

From: Peter Chen

Date: Thu Nov 26 2026 - 02:44:26 EST


On 26-11-23 16:17:17, Faisal Hassan wrote:
> Runtime suspend always arms the wakeup interrupts in host mode, even if
> the device is not wakeup capable. If the controller is still runtime
> suspended when system suspend runs without wakeup enabled, the
> interrupts stay armed as wakeup sources, so they can still wake the
> system. System resume does not disarm them either, as it only does so
> when wakeup is enabled, so they remain armed after resume and the next
> runtime suspend arms them a second time.
>
> Disarm them in system suspend when the controller is already runtime
> suspended and wakeup is not enabled, so the state matches what a system
> suspend without a preceding runtime suspend would have left.
>
> Signed-off-by: Faisal Hassan <faisal.hassan@xxxxxxxxxxxxxxxx>

Reviewed-by: Peter Chen <peter.chen@xxxxxxxxxxxxxxxx>

Peter
> ---
> drivers/usb/dwc3/dwc3-qcom.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 7a7225b900b3..18db19cf2065 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -350,8 +350,16 @@ static int dwc3_qcom_suspend(struct dwc3_qcom *qcom, pm_message_t msg)
> u32 val;
> int i, ret;
>
> - if (qcom->is_suspended)
> + if (qcom->is_suspended) {
> + /*
> + * Runtime suspend arms the wakeup interrupts in host mode
> + * regardless of the device wakeup setting. If system suspend
> + * runs without wakeup, disarm them here, as resume will not.
> + */
> + if (dwc3_qcom_is_host(qcom) && !wakeup)
> + dwc3_qcom_disable_interrupts(qcom);
> return 0;
> + }
>
> for (i = 0; i < qcom->num_ports; i++) {
> val = readl(qcom->qscratch_base + pwr_evnt_irq_stat_reg[i]);
> --
> 2.34.1
>

--

Thanks,
Peter Chen