From d475ecde4786a97182ab766b056b8bf648b5979d Mon Sep 17 00:00:00 2001 From: "GL.iNet-Xinfa.Deng" Date: Mon, 29 Nov 2021 10:45:40 +0800 Subject: [PATCH] patches-siflower-18.x: update siflower SDK to 6a62b16 --- config-siflower-18.x.yml | 2 +- ...ix-disable-hwnat-on-vpn-or-tethering.patch | 24 +++---- .../0304-fix-EC20-dongle-panic.patch | 66 +++++++++++++++++++ ...e-min_free_kbytes-from-16384-to-4096.patch | 43 ------------ .../0307-feat-add-UE-country-code.patch | 38 +++++++++++ ...nment-to-start-at-allocated-boundary.patch | 47 +++++++++++++ 6 files changed, 160 insertions(+), 60 deletions(-) create mode 100644 patches-siflower-18.x/0304-fix-EC20-dongle-panic.patch delete mode 100644 patches-siflower-18.x/0304-fix-modified-the-min_free_kbytes-from-16384-to-4096.patch create mode 100644 patches-siflower-18.x/0307-feat-add-UE-country-code.patch create mode 100644 patches-siflower-18.x/0308-fix-DMA-alignment-to-start-at-allocated-boundary.patch diff --git a/config-siflower-18.x.yml b/config-siflower-18.x.yml index 85a399f..9d1231a 100644 --- a/config-siflower-18.x.yml +++ b/config-siflower-18.x.yml @@ -2,7 +2,7 @@ repo: https://github.com/Siflower/1806_SDK.git branch: release git_clone_dir: openwrt-18.06/siflower openwrt_root_dir: openwrt-18.06/siflower/openwrt-18.06 -revision: 3279b2bb4b4d9cb6a5f1755103d724d6bd5ba8f9 +revision: 6a62b16b49008c51092386d058f843b005a62b7f patch_folders: - patches-siflower-18.x/ diff --git a/patches-siflower-18.x/0303-fix-disable-hwnat-on-vpn-or-tethering.patch b/patches-siflower-18.x/0303-fix-disable-hwnat-on-vpn-or-tethering.patch index ecdb490..e6594bc 100644 --- a/patches-siflower-18.x/0303-fix-disable-hwnat-on-vpn-or-tethering.patch +++ b/patches-siflower-18.x/0303-fix-disable-hwnat-on-vpn-or-tethering.patch @@ -1,28 +1,17 @@ -From 362fe4ea55bcbabca707a103c1a2ecb3a559dccf Mon Sep 17 00:00:00 2001 +From 97778894bc310687d1dfd4ccdb46bb3cbe77143c Mon Sep 17 00:00:00 2001 From: "GL.iNet-Xinfa.Deng" -Date: Mon, 23 Aug 2021 17:26:41 +0800 +Date: Mon, 15 Nov 2021 10:08:38 +0800 Subject: [PATCH] fix: disable hwnat on vpn or tethering -Signed-off-by: GL.iNet-Xinfa.Deng --- .../linux-4.14.90/net/netfilter/xt_FLOWOFFLOAD.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/linux-4.14.90-dev/linux-4.14.90/net/netfilter/xt_FLOWOFFLOAD.c b/linux-4.14.90-dev/linux-4.14.90/net/netfilter/xt_FLOWOFFLOAD.c -index e2a7fce..eab348e 100644 +index be92545..fced9a3 100644 --- a/linux-4.14.90-dev/linux-4.14.90/net/netfilter/xt_FLOWOFFLOAD.c +++ b/linux-4.14.90-dev/linux-4.14.90/net/netfilter/xt_FLOWOFFLOAD.c -@@ -203,6 +203,9 @@ xt_flowoffload_skip(struct sk_buff *skb, int family) - return true; - } - -+ if (family == NFPROTO_IPV6) -+ return true; -+ - return false; - } - -@@ -528,6 +531,11 @@ flowoffload_tg(struct sk_buff *skb, const struct xt_action_param *par) +@@ -531,6 +531,14 @@ flowoffload_tg(struct sk_buff *skb, const struct xt_action_param *par) if (xt_flowoffload_skip(skb, xt_family(par))) return XT_CONTINUE; @@ -30,11 +19,14 @@ index e2a7fce..eab348e 100644 + return XT_CONTINUE; + + if ((xt_in(par)->type == ARPHRD_NONE) || (xt_out(par)->type == ARPHRD_NONE)) ++ return XT_CONTINUE; ++ ++ if (!strcmp(xt_in(par)->name,"3g-modem_1_1") || !strcmp(xt_out(par)->name,"3g-modem_1_1")) + return XT_CONTINUE; ct = nf_ct_get(skb, &ctinfo); if (ct == NULL) -@@ -599,6 +607,12 @@ flowoffload_tg(struct sk_buff *skb, const struct xt_action_param *par) +@@ -602,6 +610,12 @@ flowoffload_tg(struct sk_buff *skb, const struct xt_action_param *par) if (flow_offload_add(&nf_flowtable, flow) < 0) goto err_flow_add; diff --git a/patches-siflower-18.x/0304-fix-EC20-dongle-panic.patch b/patches-siflower-18.x/0304-fix-EC20-dongle-panic.patch new file mode 100644 index 0000000..acea1a5 --- /dev/null +++ b/patches-siflower-18.x/0304-fix-EC20-dongle-panic.patch @@ -0,0 +1,66 @@ +From 034d2febe7b5bb49a47f144cabb40ad5a68cac11 Mon Sep 17 00:00:00 2001 +From: "GL.iNet-Xinfa.Deng" +Date: Thu, 18 Nov 2021 11:35:20 +0800 +Subject: [PATCH] fix: EC20 dongle panic + +--- + .../linux-4.14.90/drivers/usb/dwc2/hcd_intr.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd_intr.c b/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd_intr.c +index 17905ba..60f9915 100644 +--- a/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd_intr.c ++++ b/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd_intr.c +@@ -487,7 +487,7 @@ static int dwc2_update_urb_state(struct dwc2_hsotg *hsotg, + &short_read); + + if (urb->actual_length + xfer_length > urb->length) { +- dev_warn(hsotg->dev, "%s(): trimming xfer length\n", __func__); ++ dev_dbg(hsotg->dev, "%s(): trimming xfer length\n", __func__); + xfer_length = urb->length - urb->actual_length; + } + +@@ -1160,7 +1160,7 @@ static void dwc2_update_urb_state_abn(struct dwc2_hsotg *hsotg, + u32 hctsiz; + + if (urb->actual_length + xfer_length > urb->length) { +- dev_warn(hsotg->dev, "%s(): trimming xfer length\n", __func__); ++ dev_dbg(hsotg->dev, "%s(): trimming xfer length\n", __func__); + xfer_length = urb->length - urb->actual_length; + } + +@@ -1919,10 +1919,10 @@ static void dwc2_hc_chhltd_intr_dma(struct dwc2_hsotg *hsotg, + dwc2_halt_channel(hsotg, chan, qtd, + DWC2_HC_XFER_PERIODIC_INCOMPLETE); + } else { +- dev_err(hsotg->dev, ++ dev_dbg(hsotg->dev, + "%s: Channel %d - ChHltd set, but reason is unknown\n", + __func__, chnum); +- dev_err(hsotg->dev, ++ dev_dbg(hsotg->dev, + "hcint 0x%08x, intsts 0x%08x\n", + chan->hcint, + dwc2_readl(hsotg->regs + GINTSTS)); +@@ -1938,6 +1938,18 @@ error: + qtd->error_count++; + dwc2_update_urb_state_abn(hsotg, chan, chnum, qtd->urb, + qtd, DWC2_HC_XFER_XACT_ERR); ++ /* ++ * We can get here after a completed transaction ++ * (urb->actual_length >= urb->length) which was not reported ++ * as completed. If that is the case, and we do not abort ++ * the transfer, a transfer of size 0 will be enqueued ++ * subsequently. If urb->actual_length is not DMA-aligned, ++ * the buffer will then point to an unaligned address, and ++ * the resulting behavior is undefined. Bail out in that ++ * situation. ++ */ ++ if (qtd->urb->actual_length >= qtd->urb->length) ++ qtd->error_count = 3; + dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); + dwc2_halt_channel(hsotg, chan, qtd, DWC2_HC_XFER_XACT_ERR); + } +-- +2.7.4 + diff --git a/patches-siflower-18.x/0304-fix-modified-the-min_free_kbytes-from-16384-to-4096.patch b/patches-siflower-18.x/0304-fix-modified-the-min_free_kbytes-from-16384-to-4096.patch deleted file mode 100644 index 9594f5e..0000000 --- a/patches-siflower-18.x/0304-fix-modified-the-min_free_kbytes-from-16384-to-4096.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9593f4b59592c41f5bed35ca1a1abd828d1b69ef Mon Sep 17 00:00:00 2001 -From: "GL.iNet-Xinfa.Deng" -Date: Thu, 14 Oct 2021 14:57:57 +0800 -Subject: [PATCH] fix: modified the min_free_kbytes from 16384 to 4096 - ---- - .../package/base-files/files/etc/init.d/sysctl | 20 +++++++++++--------- - 1 file changed, 11 insertions(+), 9 deletions(-) - -diff --git a/openwrt-18.06/package/base-files/files/etc/init.d/sysctl b/openwrt-18.06/package/base-files/files/etc/init.d/sysctl -index 4db5644..9295f30 100755 ---- a/openwrt-18.06/package/base-files/files/etc/init.d/sysctl -+++ b/openwrt-18.06/package/base-files/files/etc/init.d/sysctl -@@ -7,15 +7,17 @@ apply_defaults() { - local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)" - local min_free frag_low_thresh frag_high_thresh - -- if [ "$mem" -gt 65536 ]; then # 128M -- min_free=16384 -- elif [ "$mem" -gt 32768 ]; then # 64M -- min_free=8192 -- else -- min_free=1024 -- frag_low_thresh=393216 -- frag_high_thresh=524288 -- fi -+ #Fixed SF oom bug -+ min_free=4096 -+ #if [ "$mem" -gt 65536 ]; then # 128M -+ # min_free=16384 -+ #elif [ "$mem" -gt 32768 ]; then # 64M -+ # min_free=8192 -+ #else -+ # min_free=1024 -+ # frag_low_thresh=393216 -+ # frag_high_thresh=524288 -+ #fi - - sysctl -qw vm.min_free_kbytes="$min_free" - --- -2.7.4 - diff --git a/patches-siflower-18.x/0307-feat-add-UE-country-code.patch b/patches-siflower-18.x/0307-feat-add-UE-country-code.patch new file mode 100644 index 0000000..c100bdb --- /dev/null +++ b/patches-siflower-18.x/0307-feat-add-UE-country-code.patch @@ -0,0 +1,38 @@ +From d3df9ccd2678a148a3a4a5fa43f9ec313ea316b3 Mon Sep 17 00:00:00 2001 +From: "GL.iNet-Xinfa.Deng" +Date: Thu, 18 Nov 2021 12:17:40 +0800 +Subject: [PATCH] feat: add UE country code + +--- + .../wireless-regdb/patches/501-add-UE-code.patch | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + create mode 100644 openwrt-18.06/package/firmware/wireless-regdb/patches/501-add-UE-code.patch + +diff --git a/openwrt-18.06/package/firmware/wireless-regdb/patches/501-add-UE-code.patch b/openwrt-18.06/package/firmware/wireless-regdb/patches/501-add-UE-code.patch +new file mode 100644 +index 0000000..a37f7c4 +--- /dev/null ++++ b/openwrt-18.06/package/firmware/wireless-regdb/patches/501-add-UE-code.patch +@@ -0,0 +1,19 @@ ++Index: wireless-regdb-2017-10-20-4343d359/db.txt ++=================================================================== ++--- wireless-regdb-2017-10-20-4343d359.orig/db.txt +++++ wireless-regdb-2017-10-20-4343d359/db.txt ++@@ -360,6 +360,14 @@ country CZ: DFS-ETSI ++ # Bereich 57 GHz - 66 GHz für Funkanwendungen für weitbandige ++ # Datenübertragungssysteme; „Multiple Gigabit WAS/RLAN Systems (MGWS)“). ++ # https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2011_08_MGWS_pdf.pdf +++country UE: DFS-ETSI +++ (2400 - 2483.5 @ 40), (100 mW) +++ (5150 - 5250 @ 80), (100 mW), NO-OUTDOOR, AUTO-BW +++ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW +++ (5470 - 5725 @ 160), (500 mW), DFS +++ # short range devices (ETSI EN 300 440-1) +++ # 60 GHz band channels 1-4 (ETSI EN 302 567) +++ (57000 - 66000 @ 2160), (40) ++ ++ country DE: DFS-ETSI ++ (2400 - 2483.5 @ 40), (100 mW) +-- +2.7.4 + diff --git a/patches-siflower-18.x/0308-fix-DMA-alignment-to-start-at-allocated-boundary.patch b/patches-siflower-18.x/0308-fix-DMA-alignment-to-start-at-allocated-boundary.patch new file mode 100644 index 0000000..f8d748f --- /dev/null +++ b/patches-siflower-18.x/0308-fix-DMA-alignment-to-start-at-allocated-boundary.patch @@ -0,0 +1,47 @@ +From 69d874827de04468e1418d8783bd8036a6f8a7aa Mon Sep 17 00:00:00 2001 +From: "GL.iNet-Xinfa.Deng" +Date: Wed, 24 Nov 2021 14:20:08 +0800 +Subject: [PATCH] fix: DMA alignment to start at allocated boundary + +--- + linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd.c b/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd.c +index 3c4658b..2d9cb5f 100644 +--- a/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd.c ++++ b/linux-4.14.90-dev/linux-4.14.90/drivers/usb/dwc2/hcd.c +@@ -2675,8 +2675,10 @@ static void dwc2_free_dma_aligned_buffer(struct urb *urb) + return; + + /* Restore urb->transfer_buffer from the end of the allocated area */ +- memcpy(&stored_xfer_buffer, urb->transfer_buffer + +- urb->transfer_buffer_length, sizeof(urb->transfer_buffer)); ++ memcpy(&stored_xfer_buffer, ++ PTR_ALIGN(urb->transfer_buffer + urb->transfer_buffer_length, ++ dma_get_cache_alignment()), ++ sizeof(urb->transfer_buffer)); + + if (usb_urb_dir_in(urb)) { + if (usb_pipeisoc(urb->pipe)) +@@ -2708,6 +2710,7 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) + * DMA + */ + kmalloc_size = urb->transfer_buffer_length + ++ (dma_get_cache_alignment() - 1) + + sizeof(urb->transfer_buffer); + + kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); +@@ -2718,7 +2721,8 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) + * Position value of original urb->transfer_buffer pointer to the end + * of allocation for later referencing + */ +- memcpy(kmalloc_ptr + urb->transfer_buffer_length, ++ memcpy(PTR_ALIGN(kmalloc_ptr + urb->transfer_buffer_length, ++ dma_get_cache_alignment()), + &urb->transfer_buffer, sizeof(urb->transfer_buffer)); + + if (usb_urb_dir_out(urb)) +-- +2.7.4 +