From: yuanlinyu Sent: Thursday, March 14, 2024 4:14 PM To: 'Oliver Neukum' oneukum@suse.com; Alan Stern stern@rowland.harvard.edu; Greg Kroah-Hartman gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org; stable@vger.kernel.org Subject: RE: [PATCH v1] usb: f_mass_storage: reduce chance to queue disable ep
From: Oliver Neukum oneukum@suse.com Sent: Thursday, March 14, 2024 3:54 PM
Sorry, now for the longer explanation. You'd introduce a deadlock. You just cannot sleep with a spinlock held. It seems to me that
I didn't review usb_ep_queue() clearly, in my test, I didn't hit sleep. But the concern is good, will find better way to avoid it.
Oliver, could you share one example which can sleep ?
I check several UDC drivers, like dwc3, cdnsp, cdns3, Both disable/queue function have spinlock, this means no sleep, right ?
if you want to do this cleanly, you need to revisit the locking to use locks you can sleep under.
HTH Oliver