usb/gadget: f_midi: Replace tasklet with work
authorDavidlohr Bueso <dave@stgolabs.net>
Mon, 11 Jan 2021 04:28:55 +0000 (20:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 11:52:28 +0000 (12:52 +0100)
commit8653d71ce3763aedcf3d2331f59beda3fecd79e4
treec7b041caeb00e3466c430d4280247148cc8b3812
parent0c0a20f6da04780b94e3ccc43101dde6f536ab37
usb/gadget: f_midi: Replace tasklet with work

Currently a tasklet is used to transmit input substream buffer
data. However, tasklets have long been deprecated as being too
heavy on the system by running in irq context - and this is not
a performance critical path. If a higher priority process wants
to run, it must wait for the tasklet to finish before doing so.

Deferring work to a workqueue and executing in process context
should be fine considering the callback already does
f_midi_do_transmit() under the transmit_lock and thus changes in
semantics are ok regarding concurrency - tasklets being serialized
against itself.

Cc: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Link: https://lore.kernel.org/r/20210111042855.73289-1-dave@stgolabs.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_midi.c