<div dir="ltr">Hi Geert,<div><br></div><div><br></div><div>I am seeing this -71 EPROTO error on two occasions. The one I am currently seeing is happening with Telit LN960A18's. </div><div>We pass traffic over the modem with iperf3 and it resets after a time period with those errors, usually within 30 minutes.</div><div>If I force the modem to USB2.0 it seems to not happen. I'm currently trying to find out why this is happening, I am looking at the</div><div>kernel debug and am seeing a "do warm reset" debug message from the driver (hub.c) and have been trying to track down why.</div><div><br></div><div>The second was covered in detail in another thread on here called "MTU issues", here was the finding:</div><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Enabled traces for usbnet.c and xhci-ring.c file in debugfs as follows:<br><font face="monospace"><span class="gmail-im" style="color:rgb(80,0,80)">mount -t debugfs none /sys/kernel/debug<br></span></font><font face="monospace"><span class="gmail-im" style="color:rgb(80,0,80)">echo -n 'file usbnet.c +p' > /sys/kernel/debug/dynamic_debug/control<br></span></font><font face="monospace">echo -n 'file xhci-ring.c +p' > /sys/kernel/debug/dynamic_debug/control</font><br>Saw a lot of errors indicating URB with len=0 when it was expecting len=1430. This was preceded by an URB of len 1024 bytes:<br><font face="monospace">xhci_hcd 0000:00:14.0: Babble error for slot 10 ep 12 on endpoint<br></font><font face="monospace">xhci_hcd 0000:00:14.0: Giveback URB ffff8802193be540, len = 1024, expected = 1430, status = -75<br></font><font face="monospace">xhci_hcd 0000:00:14.0: Transfer error for slot 10 ep 12 on endpoint<br></font>/repeated<br>Error -75 is EOVERFLOW, which makes sense as per<i> include/uapi/asm-generic/errno.h</i><br><font face="monospace">#define EOVERFLOW 75 /* Value too large for defined data type */</font><br><b>"Babble error"</b>: When a packet larger than <span class="gmail-il">MTU</span> arrives in Linux from the modem and is discarded with -EOVERFLOW error.<br>This is seen on USB3.0 and USB2.0 busses. This is essentially because the MRU (Max Receive Size) is not a separate entity to the <span class="gmail-il">MTU</span> (Max Transmit Size) and the received packets can be larger than those transmitted.<br><b>"Endless input error"</b>: Following the babble error we see an endless supply of zero-length URBs which are rejected with -EPROTO (increasing the rx input error counter each time).<br>This is only seen on USB3.0. These continue to come ad infinitum until the modem is shutdown.<br>There appears to be a bug in the core USB handling code in Linux that doesn't deal well with network <span class="gmail-il">MTUs</span> smaller than 1500 bytes. By default the dev->hard_mtu (the "real" <span class="gmail-il">MTU</span>) is in lockstep with dev->rx_urb_size (essentially an MRU), and it's the latter that is causing trouble. This has nothing to do with the modems; the issue can be reproduced by getting a USB-Ethernet dongle, setting the <span class="gmail-il">MTU</span> to 1430, and pinging with size greater than 1406.<br>Will submit the below patch that solves the issue, if that is acceptable?<br><font face="arial, sans-serif"><br></font><font face="arial, sans-serif">+diff -Naur linux-4.14.73/drivers/net/usb/qmi_wwan.c linux-4.14.73-rx_size_fix/drivers/net/usb/qmi_wwan.c<br></font><font face="arial, sans-serif">+--- linux-4.14.73/drivers/net/usb/qmi_wwan.c 2018-09-29 11:06:07.000000000 +0100<br></font><font face="arial, sans-serif">++++ linux-4.14.73-rx_size_fix/drivers/net/usb/qmi_wwan.c 2020-01-31 18:05:07.709008785 +0000<br></font><font face="arial, sans-serif">+@@ -740,6 +740,14 @@<br></font><font face="arial, sans-serif">+ }<br></font><font face="arial, sans-serif">+ dev->net->netdev_ops = &qmi_wwan_netdev_ops;<br></font><font face="arial, sans-serif">+ dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group;<br></font><font face="arial, sans-serif">++<br></font><font face="arial, sans-serif">++ /* LTE Networks don't always respect their own <span class="gmail-il">MTU</span> on receive side; <br></font><font face="arial, sans-serif">++ * e.g. AT&T pushes 1430 <span class="gmail-il">MTU</span> but still allows 1500 byte packets from <br></font><font face="arial, sans-serif">++ * far-end network. Make receive buffer large enough to accommodate<br></font><font face="arial, sans-serif">++ * them, and add four bytes so <span class="gmail-il">MTU</span> does not equal MRU on network<br></font><font face="arial, sans-serif">++ * with 1500 <span class="gmail-il">MTU</span> otherwise usbnet_change_mtu() will change both.<br></font><font face="arial, sans-serif">++ * </font><font face="arial, sans-serif">This is a sufficient max receive buffer as over 1500 <span class="gmail-il">MTU</span>, <br></font><font face="arial, sans-serif">++ * USB driver issues are not seen.<br></font><font face="arial, sans-serif">++ */<br></font><font face="arial, sans-serif">++ dev->rx_urb_size = ETH_DATA_LEN + 4;<br></font><font face="arial, sans-serif">+ err:<br></font><font face="arial, sans-serif">+ return status;<br></font><font face="arial, sans-serif">+ }</font></blockquote><div><br></div><div><br></div><div>I submitted this fix to the kernel but you just reminded me that it was rejected due to formatting and I completely forgot to resubmit.</div><div><br></div><div>--</div><div>Paul </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 26 May 2020 at 13:00, <<a href="mailto:libqmi-devel-request@lists.freedesktop.org" target="_blank">libqmi-devel-request@lists.freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send libqmi-devel mailing list submissions to<br>
<a href="mailto:libqmi-devel@lists.freedesktop.org" target="_blank">libqmi-devel@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/libqmi-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/libqmi-devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:libqmi-devel-request@lists.freedesktop.org" target="_blank">libqmi-devel-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:libqmi-devel-owner@lists.freedesktop.org" target="_blank">libqmi-devel-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of libqmi-devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. USB errors with qmi-wwan (Geert Lens)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 25 May 2020 15:42:56 +0200<br>
From: Geert Lens <<a href="mailto:g.lens@livetech-systems.com" target="_blank">g.lens@livetech-systems.com</a>><br>
To: <a href="mailto:libqmi-devel@lists.freedesktop.org" target="_blank">libqmi-devel@lists.freedesktop.org</a><br>
Subject: USB errors with qmi-wwan<br>
Message-ID:<br>
<CAOCF0GO7xCyfRyTJmJnT=<a href="mailto:iZ9MoDCo6XL1Fa0YrOZz5GWm-%2Bd3g@mail.gmail.com" target="_blank">iZ9MoDCo6XL1Fa0YrOZz5GWm-+d3g@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
<br>
We are using the QMI interface on the Quectel BG96 modem and everything<br>
works fine, but after a few hours the connection is suddenly disconnected<br>
and the qmi_proxy starts hogging CPU.<br>
<br>
During this time the USB interfaces of the modem are not responding and<br>
will only work again after the modem is physically turned off and on.<br>
<br>
Output from dmesg:<br>
<br>
*qmi_wwan 1-1:1.4: nonzero urb status received: -71*<br>
*qmi_wwan 1-1:1.4: wdm_int_callback - 0 bytes*<br>
*qmi_wwan 1-1:1.4: nonzero urb status received: -71*<br>
*qmi_wwan 1-1:1.4: wdm_int_callback - 0 bytes*<br>
*qmi_wwan 1-1:1.4: nonzero urb status received: -71*<br>
*qmi_wwan 1-1:1.4: wdm_int_callback - 0 bytes*<br>
*qmi_wwan 1-1:1.4: nonzero urb status received: -71*<br>
*qmi_wwan 1-1:1.4: wdm_int_callback - 0 bytes*<br>
<br>
I have read that the -71 (EPROTO) is mostly caused by hardware or firmware<br>
issues and that it can cause the kernel to disable the device, is<br>
this correct? Or could it be something else?<br>
<br>
Version used:<br>
- Linux kernel: v4.14.78<br>
- ModemManager: v1.12.10<br>
- libqmi: v1.24.10<br>
<br>
*Geert*<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://lists.freedesktop.org/archives/libqmi-devel/attachments/20200525/c827d211/attachment-0001.htm" rel="noreferrer" target="_blank">https://lists.freedesktop.org/archives/libqmi-devel/attachments/20200525/c827d211/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
libqmi-devel mailing list<br>
<a href="mailto:libqmi-devel@lists.freedesktop.org" target="_blank">libqmi-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/libqmi-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/libqmi-devel</a><br>
<br>
<br>
------------------------------<br>
<br>
End of libqmi-devel Digest, Vol 102, Issue 8<br>
********************************************<br>
</blockquote></div>