usb: gadget: eem: fix echo command packet response issue
authorLinyu Yuan <linyyuan@codeaurora.com>
Wed, 16 Jun 2021 11:51:42 +0000 (19:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jun 2021 09:27:22 +0000 (11:27 +0200)
commit4249d6fbc10fd997abdf8a1ea49c0389a0edf706
treee0f73a50a745f6ed38064795d7da56e428142632
parent33cb46c4676d01956811b68a29157ea969a5df70
usb: gadget: eem: fix echo command packet response issue

when receive eem echo command, it will send a response,
but queue this response to the usb request which allocate
from gadget device endpoint zero,
and transmit the request to IN endpoint of eem interface.

on dwc3 gadget, it will trigger following warning in function
__dwc3_gadget_ep_queue(),

if (WARN(req->dep != dep, "request %pK belongs to '%s'\n",
&req->request, req->dep->name))
return -EINVAL;

fix it by allocating a usb request from IN endpoint of eem interface,
and transmit the usb request to same IN endpoint of eem interface.

Signed-off-by: Linyu Yuan <linyyuan@codeaurora.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210616115142.34075-1-linyyuan@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_eem.c