Re: [PATCH 06/19] usb: gadget: snps_udc_plat: lock out the interrupt

From: Herve Codina

Date: Tue Oct 27 2026 - 14:18:01 EST


Hi Greg,

On Tue, 27 Oct 2026 15:57:46 +0100
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

> From: Josef Bacik <josef@xxxxxxxxxxxxxx>
>
> stop_udc() is called from a work item, when the extcon device reports
> that the cable has been unplugged. It takes udc->lock with interrupts
> enabled. udc_irq(), the hard interrupt handler of the controller, takes
> the same lock. If the controller raises an interrupt on the CPU which
> is in stop_udc(), and it is likely to have something to report when the
> cable is pulled, the handler spins on a lock which the interrupted work
> holds: the CPU is stuck.
>
> Disable interrupts while the lock is held. They are enabled again for
> the ->disconnect() callback of the gadget driver, for which the lock is
> dropped as before.
>
> Fixes: 1b9f35adb0ff ("usb: gadget: udc: Add Synopsys UDC Platform driver")
> Cc: stable <stable@xxxxxxxxxx>
> Cc: Neill Kapron <nkapron@xxxxxxxxxx>
> Cc: Ijae Kim <ae878000@xxxxxxxxx>
> Cc: Herve Codina <herve.codina@xxxxxxxxxxx>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> drivers/usb/gadget/udc/snps_udc_plat.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>

LGTM.

Reviewed-by: Herve Codina <herve.codina@xxxxxxxxxxx>

Best regards,
Hervé