Re: [PATCH 1/1] usb: dwc3: gadget: fix IRQ storm on invalid event buffer count

Thinh Nguyen <[email protected]>
Newsgroups org.kernel.vger.linux-usb,dev.linux.lists.oe-kbuild-all,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <anZYnWfDlNPRQBq3@vbox>
Hi Liu Jiazi,

On Fri, Aug 07, 2026, Liu Jiazi wrote:
> Hi @[email protected]
> 
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.