public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] f_midi_complete to call tasklet_hi_schedule
@ 2025-02-07 20:34 Jill Donahue
  2025-02-08  7:14 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jill Donahue @ 2025-02-07 20:34 UTC (permalink / raw)
  To: gregkh, linux-usb, linux-kernel; +Cc: Jill Donahue, stable

When using USB MIDI, a lock is attempted to be acquired twice through a
re-entrant call to f_midi_transmit, causing a deadlock.

Fix it by using tasklet_hi_schedule() to schedule the inner
f_midi_transmit() via a tasklet from the completion handler.

Link: https://lore.kernel.org/all/CAArt=LjxU0fUZOj06X+5tkeGT+6RbXzpWg1h4t4Fwa_KGVAX6g@mail.gmail.com/
Fixes: d5daf49b58661 ("USB: gadget: midi: add midi function driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jill Donahue <jilliandonahue58@gmail.com>
---
 drivers/usb/gadget/function/f_midi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 837fcdfa3840..37d438e5d451 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -283,7 +283,7 @@ f_midi_complete(struct usb_ep *ep, struct usb_request *req)
 			/* Our transmit completed. See if there's more to go.
 			 * f_midi_transmit eats req, don't queue it again. */
 			req->length = 0;
-			f_midi_transmit(midi);
+			tasklet_hi_schedule(&midi->tasklet);
 			return;
 		}
 		break;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-11  6:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 20:34 [PATCH v3] f_midi_complete to call tasklet_hi_schedule Jill Donahue
2025-02-08  7:14 ` Greg KH
2025-02-08 12:10 ` kernel test robot
2025-02-08 12:42 ` kernel test robot
2025-02-10 17:18   ` Jillian Donahue
2025-02-11  5:59     ` Greg KH

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