From 5c1b9399b0b932d0508b52f45fe31b4554a8749d Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 14 Jul 2023 11:07:26 +0200 Subject: [PATCH] linux.port: add usb_net_pinephone.patch The PinePhone Modems' CDC Ethernet Interface does not respond if RX/TX queue size is greater 12 (experimentally determined), the default would be 60, meaning 60 RX Bulk URBs are sent at once to the device. issue #4958 --- .../dde_linux/patches/usb_net_pinephone.patch | 23 +++++++++++++++++++ repos/dde_linux/ports/linux.hash | 2 +- repos/dde_linux/ports/linux.port | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 repos/dde_linux/patches/usb_net_pinephone.patch diff --git a/repos/dde_linux/patches/usb_net_pinephone.patch b/repos/dde_linux/patches/usb_net_pinephone.patch new file mode 100644 index 0000000000..c80cc2bfcb --- /dev/null +++ b/repos/dde_linux/patches/usb_net_pinephone.patch @@ -0,0 +1,23 @@ +The PinePhone Modems' CDC Ethernet Interface does not respond if RX/TX queue size +is greater 12 (experimentally determined), the default would be 60, meaning 60 +RX Bulk URBs are sent at once to the device. + +diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c +index 64a9a80..0a119ba 100644 +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -356,6 +356,14 @@ EXPORT_SYMBOL_GPL(usbnet_skb_return); + void usbnet_update_max_qlen(struct usbnet *dev) + { + enum usb_device_speed speed = dev->udev->speed; ++ struct usb_device_descriptor *descr = &dev->udev->descriptor; ++ ++ /* Quectel EG25-G does not respond on queue size > 12 */ ++ if (descr->idVendor == 0x2c7c && descr->idProduct == 0x0125) { ++ printk("Quectel EG25-G detected limiting TX/RX queue size to 12 (from 60)\n"); ++ dev->rx_qlen = dev->tx_qlen = 12; ++ return; ++ } + + if (!dev->rx_urb_size || !dev->hard_mtu) + goto insanity; diff --git a/repos/dde_linux/ports/linux.hash b/repos/dde_linux/ports/linux.hash index 9dac3aacd8..7f14373024 100644 --- a/repos/dde_linux/ports/linux.hash +++ b/repos/dde_linux/ports/linux.hash @@ -1 +1 @@ -564e03bbd3b6d72497bed4f3267ebdc1c407517b +00e8b314800d990be43b16cec7eebc5418245fc2 diff --git a/repos/dde_linux/ports/linux.port b/repos/dde_linux/ports/linux.port index 1518be3cef..adba2ddc34 100644 --- a/repos/dde_linux/ports/linux.port +++ b/repos/dde_linux/ports/linux.port @@ -12,8 +12,10 @@ DIR(linux) := src/linux PATCH_FILES := i915_irq.patch \ iwlwifi_enable_irq_before_pnvm.patch \ iwlwifi_limit_rx_bufs.patch \ + usb_net_pinephone.patch \ workqueue_deadlock.patch PATCHES += $(addprefix patches/,$(PATCH_FILES)) PATCH_OPT(patches/i915_irq.patch) := -p1 -d${DIR(linux)} +PATCH_OPT(patches/usb_net_pinephone.patch) := -p1 -d${DIR(linux)} PATCH_OPT(patches/workqueue_deadlock.patch) := -p1 -d${DIR(linux)}