Linux USB
 help / color / mirror / Atom feed
* [bug report] usb: gadget: add udc driver for max3420
@ 2023-02-08 14:41 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-02-08 14:41 UTC (permalink / raw)
  To: jaswinder.singh; +Cc: linux-usb

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-08 14:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08 14:41 [bug report] usb: gadget: add udc driver for max3420 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox