usb: gadget: f_mdm_data: Do not queue OUT requests if MDM is disconnected

Consider a case where multiple OUT requests are queued onto the
bus. When the MDM is disconnected, then bridge is closed. But
because of the USB composition on the EAP, the host still thinks
that this is a bridge usecase and keeps sending data onto the OUT
endpoint. As expected, all these data packets fail when we try to
send it onto the MDM's endpoint. But mdm_data_start_rx still
keeps queueing these completed requests back onto the bus. Thus
host keeps sending data packets and the log is full of
data_bridge_write errors. Fix this by not queueing requests any
more if MDM is disconnected.

Change-Id: I59010942f3a79ab1759ac340088dc299c31b0b3c
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
This commit is contained in:
Ajay Agarwal 2020-07-21 12:17:11 +05:30
parent d195d54998
commit bd22616c61

View File

@ -579,6 +579,15 @@ static void mdm_data_start_rx(struct mdm_data_port *port)
return;
}
if (!test_bit(CH_READY, &port->bridge_sts)) {
while (!list_empty(&port->rx_idle)) {
req = list_first_entry(&port->rx_idle,
struct usb_request, list);
list_del(&req->list);
usb_ep_free_request(ep, req);
}
}
while (atomic_read(&port->connected) && !list_empty(&port->rx_idle)) {
if (port->rx_skb_q.qlen > mdm_data_pend_limit_with_bridge)
break;