Re: [PATCH 1/1] usb: dwc3: gadget: fix IRQ storm on invalid event buffer count
From: Thinh Nguyen
Date: Fri Aug 07 2026 - 19:10:04 EST
Hi Liu Jiazi,
On Fri, Aug 07, 2026, Liu Jiazi wrote:
> Hi @Thinh.Nguyen@xxxxxxxxxxxx
>
> Thanks for the review suggestions. I've updated the patch accordingly.
> On thing I'd like to discuss: in dwc3_err_recovery_work(), after
> soft_disconnect succeeds, should we attempt soft_connect to
> recover the controller, or just leave it disconnected and let the
> upper layer (e.g. function driver like ADB) handle reconnection
> on its own?
But what would trigger the usb core to reconnect?
>
> In my testing, calling soft_connect after soft_disconnect triggers an
Can you confirm where exactly the RCU stall happens? Did you add
synchronize_irq() before the soft_connect?
> RCU stall. Simply doing soft_disconnect and notifying the
> gadget driver via dwc3_disconnect_gadget_sleepable() is sufficient —
> ADB recovers on its own after that.
> What's your recommendation here?
>
> Brs
> Jiazi
>
Also, we may need to add a resuscitate counter and a "dying" state.
Before scheduling the dwc3_err_recovery_work(), increment the counter
and set the dying state. While in this state, the controller should
reject all gadget driver's requests.
If we fail to recover more than 3 times, stop doing soft_connect.
BR,
Thinh