usb: gadget: f_midi: pre-allocate IN requests
authorFelipe F. Tonello <eu@felipetonello.com>
Tue, 1 Dec 2015 18:31:02 +0000 (18:31 +0000)
committerFelipe Balbi <balbi@ti.com>
Wed, 16 Dec 2015 16:07:29 +0000 (10:07 -0600)
commite1e3d7ec5da32af3bded733a61c248d7db0b4e34
treea4cf0c8bb87df506e28d48c5ed3a5c03d76402b5
parentf0f1b8cac4d8d973e95f25d9ea132775fb43c5f4
usb: gadget: f_midi: pre-allocate IN requests

This patch introduces pre-allocation of IN endpoint USB requests. This
improves on latency (requires no usb request allocation on transmit) and avoid
several potential probles on allocating too many usb requests (which involves
DMA pool allocation problems).

This implementation also handles better multiple MIDI Gadget ports, always
processing the last processed MIDI substream if the last USB request wasn't
enought to handle the whole stream.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_midi.c
drivers/usb/gadget/legacy/gmidi.c