linux_dsm_epyc7002/drivers/usb/gadget
Jerry Zhang 2d19cdc1cb usb: gadget: f_midi: Use snd_card_free_when_closed with refcount
Currenly, f_midi_free uses snd_card_free, which will wait
until the user has released the sound card before
returning. However, if the user doesn't release the sound
card, then f_midi_free can block for an arbitrary amount
of time, which also blocks any gadget operations on that
thread.

Instead, we can use snd_card_free_when_closed which returns
before all handles are released. Since f_midi can be
accessed through rmidi if usb_put_function is called before
release_card_device, add refcounting to f_midi_free and
have rawmidi's private free call it. The f_midi memory
is only kfreed when usb_put_function and release_card_device
have both been called.

Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-08-15 14:18:47 +03:00
..
function usb: gadget: f_midi: Use snd_card_free_when_closed with refcount 2017-08-15 14:18:47 +03:00
legacy usb: changes for v4.13 merge window 2017-06-20 11:39:34 +08:00
udc usb: gadget: dummy: fix infinite loop because of missing loop decrement 2017-08-15 12:46:04 +03:00
composite.c usb: changes for v4.13 merge window 2017-06-20 11:39:34 +08:00
config.c
configfs.c usb: gadget: configfs: use hexadecimal values and new line 2017-06-13 13:21:01 +03:00
configfs.h
epautoconf.c
functions.c
Kconfig usb: gadget: add f_uac1 variant based on a new u_audio api 2017-06-19 09:22:47 +03:00
Makefile
u_f.c
u_f.h
u_os_desc.h
usbstring.c