From 32ba8cd22e6663126ec7fa631f65400879aaf77d Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 19:54:43 +0100 Subject: [PATCH 1/4] Fix issue with ipeth --- .../999-fix-oeoverflow-ipheth.patch | 57 +++++++++++++++++++ .../999-fix-oeoverflow-ipheth.patch | 57 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 root/target/linux/generic/pending-5.15/999-fix-oeoverflow-ipheth.patch create mode 100644 root/target/linux/generic/pending-5.4/999-fix-oeoverflow-ipheth.patch diff --git a/root/target/linux/generic/pending-5.15/999-fix-oeoverflow-ipheth.patch b/root/target/linux/generic/pending-5.15/999-fix-oeoverflow-ipheth.patch new file mode 100644 index 00000000..594fa62c --- /dev/null +++ b/root/target/linux/generic/pending-5.15/999-fix-oeoverflow-ipheth.patch @@ -0,0 +1,57 @@ +From 63e4b45c82ed1bde979da7052229a4229ce9cabf Mon Sep 17 00:00:00 2001 +From: Georgi Valkov +Date: Tue, 1 Feb 2022 08:16:18 +0100 +Subject: ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback + +When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, +which reduces the usable size by 2 bytes. Otherwise we have 1512 +bytes usable instead of 1514, and if we receive more than 1512 +bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, +after which the driver malfunctiones and all communication stops. + +Resolves ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 + +Fixes: f33d9e2b48a3 ("usbnet: ipheth: fix connectivity with iOS 14") +Signed-off-by: Georgi Valkov +Tested-by: Jan Kiszka +Link: https://lore.kernel.org/all/B60B8A4B-92A0-49B3-805D-809A2433B46C@abv.bg/ +Link: https://lore.kernel.org/all/24851bd2769434a5fc24730dce8e8a984c5a4505.1643699778.git.jan.kiszka@siemens.com/ +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/ipheth.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c +index cd33955df0b65f..6a769df0b4213c 100644 +--- a/drivers/net/usb/ipheth.c ++++ b/drivers/net/usb/ipheth.c +@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone) + if (tx_buf == NULL) + goto free_rx_urb; + +- rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, ++ rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, + GFP_KERNEL, &rx_urb->transfer_dma); + if (rx_buf == NULL) + goto free_tx_buf; +@@ -146,7 +146,7 @@ error_nomem: + + static void ipheth_free_urbs(struct ipheth_device *iphone) + { +- usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, ++ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf, + iphone->rx_urb->transfer_dma); + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, + iphone->tx_urb->transfer_dma); +@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags) + + usb_fill_bulk_urb(dev->rx_urb, udev, + usb_rcvbulkpipe(udev, dev->bulk_in), +- dev->rx_buf, IPHETH_BUF_SIZE, ++ dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, + ipheth_rcvbulk_callback, + dev); + dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; +-- +cgit + diff --git a/root/target/linux/generic/pending-5.4/999-fix-oeoverflow-ipheth.patch b/root/target/linux/generic/pending-5.4/999-fix-oeoverflow-ipheth.patch new file mode 100644 index 00000000..594fa62c --- /dev/null +++ b/root/target/linux/generic/pending-5.4/999-fix-oeoverflow-ipheth.patch @@ -0,0 +1,57 @@ +From 63e4b45c82ed1bde979da7052229a4229ce9cabf Mon Sep 17 00:00:00 2001 +From: Georgi Valkov +Date: Tue, 1 Feb 2022 08:16:18 +0100 +Subject: ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback + +When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, +which reduces the usable size by 2 bytes. Otherwise we have 1512 +bytes usable instead of 1514, and if we receive more than 1512 +bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, +after which the driver malfunctiones and all communication stops. + +Resolves ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 + +Fixes: f33d9e2b48a3 ("usbnet: ipheth: fix connectivity with iOS 14") +Signed-off-by: Georgi Valkov +Tested-by: Jan Kiszka +Link: https://lore.kernel.org/all/B60B8A4B-92A0-49B3-805D-809A2433B46C@abv.bg/ +Link: https://lore.kernel.org/all/24851bd2769434a5fc24730dce8e8a984c5a4505.1643699778.git.jan.kiszka@siemens.com/ +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/ipheth.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c +index cd33955df0b65f..6a769df0b4213c 100644 +--- a/drivers/net/usb/ipheth.c ++++ b/drivers/net/usb/ipheth.c +@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone) + if (tx_buf == NULL) + goto free_rx_urb; + +- rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, ++ rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, + GFP_KERNEL, &rx_urb->transfer_dma); + if (rx_buf == NULL) + goto free_tx_buf; +@@ -146,7 +146,7 @@ error_nomem: + + static void ipheth_free_urbs(struct ipheth_device *iphone) + { +- usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, ++ usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf, + iphone->rx_urb->transfer_dma); + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, + iphone->tx_urb->transfer_dma); +@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags) + + usb_fill_bulk_urb(dev->rx_urb, udev, + usb_rcvbulkpipe(udev, dev->bulk_in), +- dev->rx_buf, IPHETH_BUF_SIZE, ++ dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, + ipheth_rcvbulk_callback, + dev); + dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; +-- +cgit + From 351be80ef8e7a12cb8046395390ecfc236602aec Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 19:54:59 +0100 Subject: [PATCH 2/4] Force remove netifd --- build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 819ae006..6f28f99a 100755 --- a/build.sh +++ b/build.sh @@ -622,6 +622,7 @@ rm -rf feeds/luci/modules/luci-mod-network [ -d feeds/${OMR_DIST}/luci-mod-status ] && rm -rf feeds/luci/modules/luci-mod-status [ -d feeds/${OMR_DIST}/luci-app-statistics ] && rm -rf feeds/luci/applications/luci-app-statistics [ -d feeds/${OMR_DIST}/luci-proto-modemmanager ] && rm -rf feeds/luci/protocols/luci-proto-modemmanager +[ -d feeds/${OMR_DIST}/netifd ] && rm -rf package/network/config/netifd echo "Add Occitan translation support" if ! patch -Rf -N -p1 -s --dry-run < patches/luci-occitan.patch; then @@ -646,9 +647,6 @@ scripts/feeds update -a #echo "Done" #cd "$OMR_TARGET/source" -# force netifd remove -rm -rf package/network/config/netifd - if [ "$OMR_ALL_PACKAGES" = "yes" ]; then scripts/feeds install -a -d m -p packages scripts/feeds install -a -d m -p luci From 069768ed7d626e8f05f35073babb70fe22dfa252 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 19:56:29 +0100 Subject: [PATCH 3/4] Force remove openwrt iperf3 --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 6f28f99a..ecefb26f 100755 --- a/build.sh +++ b/build.sh @@ -623,6 +623,7 @@ rm -rf feeds/luci/modules/luci-mod-network [ -d feeds/${OMR_DIST}/luci-app-statistics ] && rm -rf feeds/luci/applications/luci-app-statistics [ -d feeds/${OMR_DIST}/luci-proto-modemmanager ] && rm -rf feeds/luci/protocols/luci-proto-modemmanager [ -d feeds/${OMR_DIST}/netifd ] && rm -rf package/network/config/netifd +[ -d feeds/${OMR_DIST}/iperf3 ] && rm -rf feeds/packages/net/iperf3 echo "Add Occitan translation support" if ! patch -Rf -N -p1 -s --dry-run < patches/luci-occitan.patch; then From d94f42a40b716b6fade944f377d639a40adcc7f4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 22:39:13 +0100 Subject: [PATCH 4/4] Fix release number --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index ecefb26f..7b94d28e 100755 --- a/build.sh +++ b/build.sh @@ -187,13 +187,13 @@ fi #src/gz openwrt_telephony http://downloads.openwrt.org/releases/18.06.0/packages/${OMR_REAL_TARGET}/telephony #EOF -if [ -f "$OMR_TARGET_CONFIG" ]; then +if [ -f $OMR_TARGET_CONFIG ]; then cat "$OMR_TARGET_CONFIG" config -> "$OMR_TARGET/source/.config" <<-EOF CONFIG_IMAGEOPT=y CONFIG_VERSIONOPT=y CONFIG_VERSION_DIST="$OMR_DIST" CONFIG_VERSION_REPO="$OMR_REPO" - CONFIG_VERSION_NUMBER="$(git -C "$OMR_FEED" tag --sort=committerdate | tail -1)" + CONFIG_VERSION_NUMBER="$(git -C "$OMR_FEED" describe --tags `git rev-list --tags --max-count=1` | tail -1 | cut -d '-' -f1)" EOF else cat config -> "$OMR_TARGET/source/.config" <<-EOF @@ -201,7 +201,7 @@ else CONFIG_VERSIONOPT=y CONFIG_VERSION_DIST="$OMR_DIST" CONFIG_VERSION_REPO="$OMR_REPO" - CONFIG_VERSION_NUMBER="$(git -C "$OMR_FEED" tag --sort=committerdate | tail -1)-$(git -C "$OMR_FEED" rev-parse --short HEAD)" + CONFIG_VERSION_NUMBER="$(git -C "$OMR_FEED" describe --tags `git rev-list --tags --max-count=1` | tail -1 | cut -d '-' -f1)-$(git -C "$OMR_FEED" rev-parse --short HEAD)" EOF fi #if [ "$OMR_KERNEL" = "5.14" ]; then