Hello Jassi Brar, The patch 48ba02b2e2b1: "usb: gadget: add udc driver for max3420" from Jan 21, 2020, leads to the following Smatch static checker warning: drivers/usb/gadget/udc/max3420_udc.c:1307 max3420_remove() warn: sleeping in atomic context drivers/usb/gadget/udc/max3420_udc.c 1298 static void max3420_remove(struct spi_device *spi) 1299 { 1300 struct max3420_udc *udc = spi_get_drvdata(spi); 1301 unsigned long flags; 1302 1303 usb_del_gadget_udc(&udc->gadget); 1304 1305 spin_lock_irqsave(&udc->lock, flags); ^^^^^^^^^^^^^^^^^ 1306 --> 1307 kthread_stop(udc->thread_task); ^^^^^^^^^^^^ We can't call thread_stop() if we're holding a spin_lock because it has a sleep while we wait_for_completion(&kthread->exited). 1308 1309 spin_unlock_irqrestore(&udc->lock, flags); 1310 } Similar issue: drivers/usb/gadget/udc/core.c:740 usb_gadget_disconnect() warn: sleeping in atomic context max3420_vbus_handler() <- disables preempt -> usb_udc_vbus_handler() -> usb_udc_connect_control() -> usb_gadget_disconnect() regards, dan carpenter