[bug report] USB: gadget: Fix obscure lockdep violation for udc_mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Alan Stern,

The patch 1016fc0c096c: "USB: gadget: Fix obscure lockdep violation
for udc_mutex" from Aug 26, 2022, leads to the following Smatch
static checker warning:

	drivers/usb/gadget/udc/core.c:767 usb_gadget_disconnect()
	warn: sleeping in atomic context

drivers/usb/gadget/udc/core.c
    757                  * Gadget will stay disconnected after activation.
    758                  */
    759                 gadget->connected = false;
    760                 goto out;
    761         }
    762 
    763         ret = gadget->ops->pullup(gadget, 0);
    764         if (!ret)
    765                 gadget->connected = 0;
    766 
--> 767         mutex_lock(&udc_lock);
    768         if (gadget->udc->driver)
    769                 gadget->udc->driver->disconnect(gadget);
    770         mutex_unlock(&udc_lock);
    771 

The call tree where we're holding a spinlock is:

max3420_vbus_handler() <- disables preempt
-> usb_udc_vbus_handler()
   -> usb_udc_connect_control()
      -> usb_gadget_disconnect()

regards,
dan carpenter



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux