aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-4.19
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2019-06-12 01:14:25 +0200
committerDaniel Golle <daniel@makrotopia.org>2019-06-12 01:18:52 +0200
commit000d400baa0af2e42c9a462e42df7dc9abde1ec7 (patch)
treea11c2dd570e8f02c4a141f135fc8db1e1d391ef2 /target/linux/generic/backport-4.19
parentc4e727f01cc40bd57274d0b885b0f75cde9c4683 (diff)
downloadupstream-000d400baa0af2e42c9a462e42df7dc9abde1ec7.tar.gz
upstream-000d400baa0af2e42c9a462e42df7dc9abde1ec7.tar.bz2
upstream-000d400baa0af2e42c9a462e42df7dc9abde1ec7.zip
kernel: drop everything not on kernel version 4.14
* Remove testing patches for kernel version 4.19 * remove targets ar7, ixp4xx, orion Those targets are still on kernel 4.9, patches for 4.14 were not ready in time. They may be readded once people prepare and test patches for kernel 4.14. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/backport-4.19')
-rw-r--r--target/linux/generic/backport-4.19/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch30
-rw-r--r--target/linux/generic/backport-4.19/011-kbuild-export-SUBARCH.patch23
-rw-r--r--target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch558
-rw-r--r--target/linux/generic/backport-4.19/047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch58
-rw-r--r--target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch55
-rw-r--r--target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch199
-rw-r--r--target/linux/generic/backport-4.19/080-v5.1-0002-bcma-use-dev_-printing-functions.patch36
-rw-r--r--target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch79
-rw-r--r--target/linux/generic/backport-4.19/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch46
-rw-r--r--target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch99
-rw-r--r--target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch82
-rw-r--r--target/linux/generic/backport-4.19/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch110
-rw-r--r--target/linux/generic/backport-4.19/371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch24
-rw-r--r--target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch617
-rw-r--r--target/linux/generic/backport-4.19/450-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch196
-rw-r--r--target/linux/generic/backport-4.19/451-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch129
-rw-r--r--target/linux/generic/backport-4.19/500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch46
17 files changed, 0 insertions, 2387 deletions
diff --git a/target/linux/generic/backport-4.19/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch b/target/linux/generic/backport-4.19/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch
deleted file mode 100644
index 7ac4f9d240..0000000000
--- a/target/linux/generic/backport-4.19/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 13b1ecc3401653a355798eb1dee10cc1608202f4 Mon Sep 17 00:00:00 2001
-From: Felix Fietkau <nbd@nbd.name>
-Date: Mon, 18 Jan 2016 12:27:49 +0100
-Subject: [PATCH 33/34] Kbuild: don't hardcode path to awk in
- scripts/ld-version.sh
-
-On some systems /usr/bin/awk does not exist, or is broken. Find it via
-$PATH instead.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- scripts/ld-version.sh | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/scripts/ld-version.sh
-+++ b/scripts/ld-version.sh
-@@ -1,6 +1,7 @@
--#!/usr/bin/awk -f
-+#!/bin/sh
- # SPDX-License-Identifier: GPL-2.0
- # extract linker version number from stdin and turn into single number
-+exec awk '
- {
- gsub(".*\\)", "");
- gsub(".*version ", "");
-@@ -9,3 +10,4 @@
- print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
- exit
- }
-+'
diff --git a/target/linux/generic/backport-4.19/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.19/011-kbuild-export-SUBARCH.patch
deleted file mode 100644
index b5f654906a..0000000000
--- a/target/linux/generic/backport-4.19/011-kbuild-export-SUBARCH.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 173019b66dcc9d68ad9333aa744dad1e369b5aa8 Mon Sep 17 00:00:00 2001
-From: Felix Fietkau <nbd@nbd.name>
-Date: Sun, 9 Jul 2017 00:26:53 +0200
-Subject: [PATCH 34/34] kernel: add compile fix for linux 4.9 on x86
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/Makefile
-+++ b/Makefile
-@@ -431,8 +431,8 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/s
- KBUILD_LDFLAGS :=
- GCC_PLUGINS_CFLAGS :=
-
--export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
--export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
-+export ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD
-+export CC CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
- export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
- export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
-
diff --git a/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch
deleted file mode 100644
index 3a35381ce3..0000000000
--- a/target/linux/generic/backport-4.19/020-backport_netfilter_rtcache.patch
+++ /dev/null
@@ -1,558 +0,0 @@
-From 1bb0c3ec899827cfa4668bb63a08713a40744d21 Mon Sep 17 00:00:00 2001
-From: Florian Westphal <fw@strlen.de>
-Date: Sun, 9 Jul 2017 08:58:30 +0200
-Subject: [PATCH] netfilter: conntrack: cache route for forwarded connections
-
-... to avoid per-packet FIB lookup if possible.
-
-The cached dst is re-used provided the input interface
-is the same as that of the previous packet in the same direction.
-
-If not, the cached dst is invalidated.
-
-For ipv6 we also need to store sernum, else dst_check doesn't work,
-pointed out by Eric Dumazet.
-
-This should speed up forwarding when conntrack is already in use
-anyway, especially when using reverse path filtering -- active RPF
-enforces two FIB lookups for each packet.
-
-Before the routing cache removal this didn't matter since RPF was performed
-only when route cache didn't yield a result; but without route cache it
-comes at higher price.
-
-Julian Anastasov suggested to add NETDEV_UNREGISTER handler to
-avoid holding on to dsts of 'frozen' conntracks.
-
-Signed-off-by: Florian Westphal <fw@strlen.de>
----
- include/net/netfilter/nf_conntrack_extend.h | 4 +
- include/net/netfilter/nf_conntrack_rtcache.h | 34 +++
- net/netfilter/Kconfig | 12 +
- net/netfilter/Makefile | 3 +
- net/netfilter/nf_conntrack_rtcache.c | 428 +++++++++++++++++++++++++++
- 5 files changed, 481 insertions(+)
- create mode 100644 include/net/netfilter/nf_conntrack_rtcache.h
- create mode 100644 net/netfilter/nf_conntrack_rtcache.c
-
---- a/include/net/netfilter/nf_conntrack_extend.h
-+++ b/include/net/netfilter/nf_conntrack_extend.h
-@@ -28,6 +28,9 @@ enum nf_ct_ext_id {
- #if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
- NF_CT_EXT_SYNPROXY,
- #endif
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE)
-+ NF_CT_EXT_RTCACHE,
-+#endif
- NF_CT_EXT_NUM,
- };
-
-@@ -40,6 +43,7 @@ enum nf_ct_ext_id {
- #define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
- #define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
- #define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy
-+#define NF_CT_EXT_RTCACHE_TYPE struct nf_conn_rtcache
-
- /* Extensions: optional stuff which isn't permanently in struct. */
- struct nf_ct_ext {
---- /dev/null
-+++ b/include/net/netfilter/nf_conntrack_rtcache.h
-@@ -0,0 +1,34 @@
-+#include <linux/gfp.h>
-+#include <net/netfilter/nf_conntrack.h>
-+#include <net/netfilter/nf_conntrack_extend.h>
-+
-+struct dst_entry;
-+
-+struct nf_conn_dst_cache {
-+ struct dst_entry *dst;
-+ int iif;
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+ u32 cookie;
-+#endif
-+
-+};
-+
-+struct nf_conn_rtcache {
-+ struct nf_conn_dst_cache cached_dst[IP_CT_DIR_MAX];
-+};
-+
-+static inline
-+struct nf_conn_rtcache *nf_ct_rtcache_find(const struct nf_conn *ct)
-+{
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE)
-+ return nf_ct_ext_find(ct, NF_CT_EXT_RTCACHE);
-+#else
-+ return NULL;
-+#endif
-+}
-+
-+static inline int nf_conn_rtcache_iif_get(const struct nf_conn_rtcache *rtc,
-+ enum ip_conntrack_dir dir)
-+{
-+ return rtc->cached_dst[dir].iif;
-+}
---- a/net/netfilter/Kconfig
-+++ b/net/netfilter/Kconfig
-@@ -135,6 +135,18 @@ config NF_CONNTRACK_EVENTS
-
- If unsure, say `N'.
-
-+config NF_CONNTRACK_RTCACHE
-+ tristate "Cache route entries in conntrack objects"
-+ depends on NETFILTER_ADVANCED
-+ depends on NF_CONNTRACK
-+ help
-+ If this option is enabled, the connection tracking code will
-+ cache routing information for each connection that is being
-+ forwarded, at a cost of 32 bytes per conntrack object.
-+
-+ To compile it as a module, choose M here. If unsure, say N.
-+ The module will be called nf_conntrack_rtcache.
-+
- config NF_CONNTRACK_TIMEOUT
- bool 'Connection tracking timeout'
- depends on NETFILTER_ADVANCED
---- a/net/netfilter/Makefile
-+++ b/net/netfilter/Makefile
-@@ -25,6 +25,9 @@ obj-$(CONFIG_NETFILTER_NETLINK_OSF) += n
- # connection tracking
- obj-$(CONFIG_NF_CONNTRACK) += nf_conntrack.o
-
-+# optional conntrack route cache extension
-+obj-$(CONFIG_NF_CONNTRACK_RTCACHE) += nf_conntrack_rtcache.o
-+
- obj-$(CONFIG_NF_CT_PROTO_GRE) += nf_conntrack_proto_gre.o
-
- # netlink interface for nf_conntrack
---- /dev/null
-+++ b/net/netfilter/nf_conntrack_rtcache.c
-@@ -0,0 +1,428 @@
-+/* route cache for netfilter.
-+ *
-+ * (C) 2014 Red Hat GmbH
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-+
-+#include <linux/types.h>
-+#include <linux/netfilter.h>
-+#include <linux/skbuff.h>
-+#include <linux/stddef.h>
-+#include <linux/kernel.h>
-+#include <linux/netdevice.h>
-+#include <linux/export.h>
-+#include <linux/module.h>
-+
-+#include <net/dst.h>
-+
-+#include <net/netfilter/nf_conntrack.h>
-+#include <net/netfilter/nf_conntrack_core.h>
-+#include <net/netfilter/nf_conntrack_extend.h>
-+#include <net/netfilter/nf_conntrack_rtcache.h>
-+
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+#include <net/ip6_fib.h>
-+#endif
-+
-+static void __nf_conn_rtcache_destroy(struct nf_conn_rtcache *rtc,
-+ enum ip_conntrack_dir dir)
-+{
-+ struct dst_entry *dst = rtc->cached_dst[dir].dst;
-+
-+ dst_release(dst);
-+}
-+
-+static void nf_conn_rtcache_destroy(struct nf_conn *ct)
-+{
-+ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct);
-+
-+ if (!rtc)
-+ return;
-+
-+ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_ORIGINAL);
-+ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_REPLY);
-+}
-+
-+static void nf_ct_rtcache_ext_add(struct nf_conn *ct)
-+{
-+ struct nf_conn_rtcache *rtc;
-+
-+ rtc = nf_ct_ext_add(ct, NF_CT_EXT_RTCACHE, GFP_ATOMIC);
-+ if (rtc) {
-+ rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif = -1;
-+ rtc->cached_dst[IP_CT_DIR_ORIGINAL].dst = NULL;
-+ rtc->cached_dst[IP_CT_DIR_REPLY].iif = -1;
-+ rtc->cached_dst[IP_CT_DIR_REPLY].dst = NULL;
-+ }
-+}
-+
-+static struct nf_conn_rtcache *nf_ct_rtcache_find_usable(struct nf_conn *ct)
-+{
-+ return nf_ct_rtcache_find(ct);
-+}
-+
-+static struct dst_entry *
-+nf_conn_rtcache_dst_get(const struct nf_conn_rtcache *rtc,
-+ enum ip_conntrack_dir dir)
-+{
-+ return rtc->cached_dst[dir].dst;
-+}
-+
-+static u32 nf_rtcache_get_cookie(int pf, const struct dst_entry *dst)
-+{
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+ if (pf == NFPROTO_IPV6) {
-+ const struct rt6_info *rt = (const struct rt6_info *)dst;
-+
-+ if (rt->from && rt->from->fib6_node)
-+ return (u32)rt->from->fib6_node->fn_sernum;
-+ }
-+#endif
-+ return 0;
-+}
-+
-+static void nf_conn_rtcache_dst_set(int pf,
-+ struct nf_conn_rtcache *rtc,
-+ struct dst_entry *dst,
-+ enum ip_conntrack_dir dir, int iif)
-+{
-+ if (rtc->cached_dst[dir].iif != iif)
-+ rtc->cached_dst[dir].iif = iif;
-+
-+ if (rtc->cached_dst[dir].dst != dst) {
-+ struct dst_entry *old;
-+
-+ dst_hold(dst);
-+
-+ old = xchg(&rtc->cached_dst[dir].dst, dst);
-+ dst_release(old);
-+
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+ if (pf == NFPROTO_IPV6)
-+ rtc->cached_dst[dir].cookie =
-+ nf_rtcache_get_cookie(pf, dst);
-+#endif
-+ }
-+}
-+
-+static void nf_conn_rtcache_dst_obsolete(struct nf_conn_rtcache *rtc,
-+ enum ip_conntrack_dir dir)
-+{
-+ struct dst_entry *old;
-+
-+ pr_debug("Invalidate iif %d for dir %d on cache %p\n",
-+ rtc->cached_dst[dir].iif, dir, rtc);
-+
-+ old = xchg(&rtc->cached_dst[dir].dst, NULL);
-+ dst_release(old);
-+ rtc->cached_dst[dir].iif = -1;
-+}
-+
-+static unsigned int nf_rtcache_in(u_int8_t pf,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ struct nf_conn_rtcache *rtc;
-+ enum ip_conntrack_info ctinfo;
-+ enum ip_conntrack_dir dir;
-+ struct dst_entry *dst;
-+ struct nf_conn *ct;
-+ int iif;
-+ u32 cookie;
-+
-+ if (skb_dst(skb) || skb->sk)
-+ return NF_ACCEPT;
-+
-+ ct = nf_ct_get(skb, &ctinfo);
-+ if (!ct)
-+ return NF_ACCEPT;
-+
-+ rtc = nf_ct_rtcache_find_usable(ct);
-+ if (!rtc)
-+ return NF_ACCEPT;
-+
-+ /* if iif changes, don't use cache and let ip stack
-+ * do route lookup.
-+ *
-+ * If rp_filter is enabled it might toss skb, so
-+ * we don't want to avoid these checks.
-+ */
-+ dir = CTINFO2DIR(ctinfo);
-+ iif = nf_conn_rtcache_iif_get(rtc, dir);
-+ if (state->in->ifindex != iif) {
-+ pr_debug("ct %p, iif %d, cached iif %d, skip cached entry\n",
-+ ct, iif, state->in->ifindex);
-+ return NF_ACCEPT;
-+ }
-+ dst = nf_conn_rtcache_dst_get(rtc, dir);
-+ if (dst == NULL)
-+ return NF_ACCEPT;
-+
-+ cookie = nf_rtcache_get_cookie(pf, dst);
-+
-+ dst = dst_check(dst, cookie);
-+ pr_debug("obtained dst %p for skb %p, cookie %d\n", dst, skb, cookie);
-+ if (likely(dst))
-+ skb_dst_set_noref(skb, dst);
-+ else
-+ nf_conn_rtcache_dst_obsolete(rtc, dir);
-+
-+ return NF_ACCEPT;
-+}
-+
-+static unsigned int nf_rtcache_forward(u_int8_t pf,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ struct nf_conn_rtcache *rtc;
-+ enum ip_conntrack_info ctinfo;
-+ enum ip_conntrack_dir dir;
-+ struct nf_conn *ct;
-+ struct dst_entry *dst = skb_dst(skb);
-+ int iif;
-+
-+ ct = nf_ct_get(skb, &ctinfo);
-+ if (!ct)
-+ return NF_ACCEPT;
-+
-+ if (dst && dst_xfrm(dst))
-+ return NF_ACCEPT;
-+
-+ if (!nf_ct_is_confirmed(ct)) {
-+ if (WARN_ON(nf_ct_rtcache_find(ct)))
-+ return NF_ACCEPT;
-+ nf_ct_rtcache_ext_add(ct);
-+ return NF_ACCEPT;
-+ }
-+
-+ rtc = nf_ct_rtcache_find_usable(ct);
-+ if (!rtc)
-+ return NF_ACCEPT;
-+
-+ dir = CTINFO2DIR(ctinfo);
-+ iif = nf_conn_rtcache_iif_get(rtc, dir);
-+ pr_debug("ct %p, skb %p, dir %d, iif %d, cached iif %d\n",
-+ ct, skb, dir, iif, state->in->ifindex);
-+ if (likely(state->in->ifindex == iif))
-+ return NF_ACCEPT;
-+
-+ nf_conn_rtcache_dst_set(pf, rtc, skb_dst(skb), dir, state->in->ifindex);
-+ return NF_ACCEPT;
-+}
-+
-+static unsigned int nf_rtcache_in4(void *priv,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ return nf_rtcache_in(NFPROTO_IPV4, skb, state);
-+}
-+
-+static unsigned int nf_rtcache_forward4(void *priv,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ return nf_rtcache_forward(NFPROTO_IPV4, skb, state);
-+}
-+
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+static unsigned int nf_rtcache_in6(void *priv,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ return nf_rtcache_in(NFPROTO_IPV6, skb, state);
-+}
-+
-+static unsigned int nf_rtcache_forward6(void *priv,
-+ struct sk_buff *skb,
-+ const struct nf_hook_state *state)
-+{
-+ return nf_rtcache_forward(NFPROTO_IPV6, skb, state);
-+}
-+#endif
-+
-+static int nf_rtcache_dst_remove(struct nf_conn *ct, void *data)
-+{
-+ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct);
-+ struct net_device *dev = data;
-+
-+ if (!rtc)
-+ return 0;
-+
-+ if (dev->ifindex == rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif ||
-+ dev->ifindex == rtc->cached_dst[IP_CT_DIR_REPLY].iif) {
-+ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_ORIGINAL);
-+ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_REPLY);
-+ }
-+
-+ return 0;
-+}
-+
-+static int nf_rtcache_netdev_event(struct notifier_block *this,
-+ unsigned long event, void *ptr)
-+{
-+ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
-+ struct net *net = dev_net(dev);
-+
-+ if (event == NETDEV_DOWN)
-+ nf_ct_iterate_cleanup_net(net, nf_rtcache_dst_remove, dev, 0, 0);
-+
-+ return NOTIFY_DONE;
-+}
-+
-+static struct notifier_block nf_rtcache_notifier = {
-+ .notifier_call = nf_rtcache_netdev_event,
-+};
-+
-+static struct nf_hook_ops rtcache_ops[] = {
-+ {
-+ .hook = nf_rtcache_in4,
-+ .pf = NFPROTO_IPV4,
-+ .hooknum = NF_INET_PRE_ROUTING,
-+ .priority = NF_IP_PRI_LAST,
-+ },
-+ {
-+ .hook = nf_rtcache_forward4,
-+ .pf = NFPROTO_IPV4,
-+ .hooknum = NF_INET_FORWARD,
-+ .priority = NF_IP_PRI_LAST,
-+ },
-+#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6)
-+ {
-+ .hook = nf_rtcache_in6,
-+ .pf = NFPROTO_IPV6,
-+ .hooknum = NF_INET_PRE_ROUTING,
-+ .priority = NF_IP_PRI_LAST,
-+ },
-+ {
-+ .hook = nf_rtcache_forward6,
-+ .pf = NFPROTO_IPV6,
-+ .hooknum = NF_INET_FORWARD,
-+ .priority = NF_IP_PRI_LAST,
-+ },
-+#endif
-+};
-+
-+static struct nf_ct_ext_type rtcache_extend __read_mostly = {
-+ .len = sizeof(struct nf_conn_rtcache),
-+ .align = __alignof__(struct nf_conn_rtcache),
-+ .id = NF_CT_EXT_RTCACHE,
-+ .destroy = nf_conn_rtcache_destroy,
-+};
-+
-+static void __net_exit rtcache_net_exit(struct net *net)
-+{
-+ /* remove hooks so no new connections get rtcache extension */
-+ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops));
-+}
-+
-+static struct pernet_operations rtcache_ops_net_ops = {
-+ .exit = rtcache_net_exit,
-+};
-+
-+static int __init nf_conntrack_rtcache_init(void)
-+{
-+ int ret = nf_ct_extend_register(&rtcache_extend);
-+
-+ if (ret < 0) {
-+ pr_err("nf_conntrack_rtcache: Unable to register extension\n");
-+ return ret;
-+ }
-+
-+ ret = register_pernet_subsys(&rtcache_ops_net_ops);
-+ if (ret) {
-+ nf_ct_extend_unregister(&rtcache_extend);
-+ return ret;
-+ }
-+
-+ ret = nf_register_net_hooks(&init_net, rtcache_ops,
-+ ARRAY_SIZE(rtcache_ops));
-+ if (ret < 0) {
-+ nf_ct_extend_unregister(&rtcache_extend);
-+ unregister_pernet_subsys(&rtcache_ops_net_ops);
-+ return ret;
-+ }
-+
-+ ret = register_netdevice_notifier(&nf_rtcache_notifier);
-+ if (ret) {
-+ nf_unregister_net_hooks(&init_net, rtcache_ops,
-+ ARRAY_SIZE(rtcache_ops));
-+ nf_ct_extend_unregister(&rtcache_extend);
-+ unregister_pernet_subsys(&rtcache_ops_net_ops);
-+ }
-+
-+ return ret;
-+}
-+
-+static int nf_rtcache_ext_remove(struct nf_conn *ct, void *data)
-+{
-+ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct);
-+
-+ return rtc != NULL;
-+}
-+
-+static bool __exit nf_conntrack_rtcache_wait_for_dying(struct net *net)
-+{
-+ bool wait = false;
-+ int cpu;
-+
-+ for_each_possible_cpu(cpu) {
-+ struct nf_conntrack_tuple_hash *h;
-+ struct hlist_nulls_node *n;
-+ struct nf_conn *ct;
-+ struct ct_pcpu *pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu);
-+
-+ rcu_read_lock();
-+ spin_lock_bh(&pcpu->lock);
-+
-+ hlist_nulls_for_each_entry(h, n, &pcpu->dying, hnnode) {
-+ ct = nf_ct_tuplehash_to_ctrack(h);
-+ if (nf_ct_rtcache_find(ct) != NULL) {
-+ wait = true;
-+ break;
-+ }
-+ }
-+ spin_unlock_bh(&pcpu->lock);
-+ rcu_read_unlock();
-+ }
-+
-+ return wait;
-+}
-+
-+static void __exit nf_conntrack_rtcache_fini(void)
-+{
-+ struct net *net;
-+ int count = 0;
-+
-+ synchronize_net();
-+
-+ unregister_netdevice_notifier(&nf_rtcache_notifier);
-+
-+ rtnl_lock();
-+
-+ /* zap all conntracks with rtcache extension */
-+ for_each_net(net)
-+ nf_ct_iterate_cleanup_net(net, nf_rtcache_ext_remove, NULL, 0, 0);
-+
-+ for_each_net(net) {
-+ /* .. and make sure they're gone from dying list, too */
-+ while (nf_conntrack_rtcache_wait_for_dying(net)) {
-+ msleep(200);
-+ WARN_ONCE(++count > 25, "Waiting for all rtcache conntracks to go away\n");
-+ }
-+ }
-+
-+ rtnl_unlock();
-+ synchronize_net();
-+ nf_ct_extend_unregister(&rtcache_extend);
-+}
-+module_init(nf_conntrack_rtcache_init);
-+module_exit(nf_conntrack_rtcache_fini);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Florian Westphal <fw@strlen.de>");
-+MODULE_DESCRIPTION("Conntrack route cache extension");
diff --git a/target/linux/generic/backport-4.19/047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch b/target/linux/generic/backport-4.19/047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch
deleted file mode 100644
index d587c9ec07..0000000000
--- a/target/linux/generic/backport-4.19/047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 1186af457cc186c5ed01708da71b1ffbdf0a2638 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Tue, 20 Nov 2018 09:55:45 +0100
-Subject: [PATCH] mtd: keep original flags for every struct mtd_info
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When allocating a new partition mtd subsystem runs internal tests in the
-allocate_partition(). They may result in modifying specified flags (e.g.
-dropping some /features/ like write access).
-
-Those constraints don't have to be necessary true for subpartitions. It
-may happen parent partition isn't block aligned (effectively disabling
-write access) while subpartition may fit blocks nicely. In such case all
-checks should be run again (starting with original flags value).
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
----
- drivers/mtd/mtdcore.c | 2 ++
- drivers/mtd/mtdpart.c | 3 ++-
- include/linux/mtd/mtd.h | 1 +
- 3 files changed, 5 insertions(+), 1 deletion(-)
-
---- a/drivers/mtd/mtdcore.c
-+++ b/drivers/mtd/mtdcore.c
-@@ -665,6 +665,8 @@ static void mtd_set_dev_defaults(struct
- } else {
- pr_debug("mtd device won't show a device symlink in sysfs\n");
- }
-+
-+ mtd->orig_flags = mtd->flags;
- }
-
- /**
---- a/drivers/mtd/mtdpart.c
-+++ b/drivers/mtd/mtdpart.c
-@@ -346,7 +346,8 @@ static struct mtd_part *allocate_partiti
-
- /* set up the MTD object for this partition */
- slave->mtd.type = parent->type;
-- slave->mtd.flags = parent->flags & ~part->mask_flags;
-+ slave->mtd.flags = parent->orig_flags & ~part->mask_flags;
-+ slave->mtd.orig_flags = slave->mtd.flags;
- slave->mtd.size = part->size;
- slave->mtd.writesize = parent->writesize;
- slave->mtd.writebufsize = parent->writebufsize;
---- a/include/linux/mtd/mtd.h
-+++ b/include/linux/mtd/mtd.h
-@@ -207,6 +207,7 @@ struct mtd_debug_info {
- struct mtd_info {
- u_char type;
- uint32_t flags;
-+ uint32_t orig_flags; /* Flags as before running mtd checks */
- uint64_t size; // Total size of the MTD
-
- /* "Major" erase size for the device. Naïve users may take this
diff --git a/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch b/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch
deleted file mode 100644
index 02296276b0..0000000000
--- a/target/linux/generic/backport-4.19/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 6750f61a13a0197c40e4a40739117493b15f19e8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Tue, 20 Nov 2018 10:24:09 +0100
-Subject: [PATCH] mtd: improve calculating partition boundaries when checking
- for alignment
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When checking for alignment mtd should check absolute offsets. It's
-important for subpartitions as it doesn't make sense to check their
-relative addresses.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
----
- drivers/mtd/mtdpart.c | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
---- a/drivers/mtd/mtdpart.c
-+++ b/drivers/mtd/mtdpart.c
-@@ -61,6 +61,15 @@ static inline struct mtd_part *mtd_to_pa
- return container_of(mtd, struct mtd_part, mtd);
- }
-
-+static u64 part_absolute_offset(struct mtd_info *mtd)
-+{
-+ struct mtd_part *part = mtd_to_part(mtd);
-+
-+ if (!mtd_is_partition(mtd))
-+ return 0;
-+
-+ return part_absolute_offset(part->parent) + part->offset;
-+}
-
- /*
- * MTD methods which simply translate the effective address and pass through
-@@ -518,7 +527,7 @@ static struct mtd_part *allocate_partiti
- if (!(slave->mtd.flags & MTD_NO_ERASE))
- wr_alignment = slave->mtd.erasesize;
-
-- tmp = slave->offset;
-+ tmp = part_absolute_offset(parent) + slave->offset;
- remainder = do_div(tmp, wr_alignment);
- if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
- /* Doesn't start on a boundary of major erase size */
-@@ -529,7 +538,7 @@ static struct mtd_part *allocate_partiti
- part->name);
- }
-
-- tmp = slave->mtd.size;
-+ tmp = part_absolute_offset(parent) + slave->mtd.size;
- remainder = do_div(tmp, wr_alignment);
- if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
- slave->mtd.flags &= ~MTD_WRITEABLE;
diff --git a/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch b/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch
deleted file mode 100644
index cc32aee17b..0000000000
--- a/target/linux/generic/backport-4.19/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From 5a1c18b761ddb299a06746948b9ec2814b04fa92 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Wed, 2 Jan 2019 00:00:01 +0100
-Subject: [PATCH] bcma: keep a direct pointer to the struct device
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Accessing struct device is pretty useful/common so having a direct
-pointer:
-1) Simplifies some code
-2) Makes bcma_bus_get_host_dev() unneeded
-3) Allows further improvements like using dev_* printing helpers
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/bcma/bcma_private.h | 1 -
- drivers/bcma/driver_gpio.c | 2 +-
- drivers/bcma/host_pci.c | 2 ++
- drivers/bcma/host_soc.c | 4 ++--
- drivers/bcma/main.c | 45 +++++++++----------------------------
- include/linux/bcma/bcma.h | 11 +++------
- 6 files changed, 18 insertions(+), 47 deletions(-)
-
---- a/drivers/bcma/bcma_private.h
-+++ b/drivers/bcma/bcma_private.h
-@@ -33,7 +33,6 @@ int __init bcma_bus_early_register(struc
- int bcma_bus_suspend(struct bcma_bus *bus);
- int bcma_bus_resume(struct bcma_bus *bus);
- #endif
--struct device *bcma_bus_get_host_dev(struct bcma_bus *bus);
-
- /* scan.c */
- void bcma_detect_chip(struct bcma_bus *bus);
---- a/drivers/bcma/driver_gpio.c
-+++ b/drivers/bcma/driver_gpio.c
-@@ -183,7 +183,7 @@ int bcma_gpio_init(struct bcma_drv_cc *c
- chip->direction_input = bcma_gpio_direction_input;
- chip->direction_output = bcma_gpio_direction_output;
- chip->owner = THIS_MODULE;
-- chip->parent = bcma_bus_get_host_dev(bus);
-+ chip->parent = bus->dev;
- #if IS_BUILTIN(CONFIG_OF)
- chip->of_node = cc->core->dev.of_node;
- #endif
---- a/drivers/bcma/host_pci.c
-+++ b/drivers/bcma/host_pci.c
-@@ -196,6 +196,8 @@ static int bcma_host_pci_probe(struct pc
- goto err_pci_release_regions;
- }
-
-+ bus->dev = &dev->dev;
-+
- /* Map MMIO */
- err = -ENOMEM;
- bus->mmio = pci_iomap(dev, 0, ~0UL);
---- a/drivers/bcma/host_soc.c
-+++ b/drivers/bcma/host_soc.c
-@@ -179,7 +179,6 @@ int __init bcma_host_soc_register(struct
- /* Host specific */
- bus->hosttype = BCMA_HOSTTYPE_SOC;
- bus->ops = &bcma_host_soc_ops;
-- bus->host_pdev = NULL;
-
- /* Initialize struct, detect chip */
- bcma_init_bus(bus);
-@@ -213,6 +212,8 @@ static int bcma_host_soc_probe(struct pl
- if (!bus)
- return -ENOMEM;
-
-+ bus->dev = dev;
-+
- /* Map MMIO */
- bus->mmio = of_iomap(np, 0);
- if (!bus->mmio)
-@@ -221,7 +222,6 @@ static int bcma_host_soc_probe(struct pl
- /* Host specific */
- bus->hosttype = BCMA_HOSTTYPE_SOC;
- bus->ops = &bcma_host_soc_ops;
-- bus->host_pdev = pdev;
-
- /* Initialize struct, detect chip */
- bcma_init_bus(bus);
---- a/drivers/bcma/main.c
-+++ b/drivers/bcma/main.c
-@@ -223,8 +223,8 @@ unsigned int bcma_core_irq(struct bcma_d
- mips_irq = bcma_core_mips_irq(core);
- return mips_irq <= 4 ? mips_irq + 2 : 0;
- }
-- if (bus->host_pdev)
-- return bcma_of_get_irq(&bus->host_pdev->dev, core, num);
-+ if (bus->dev)
-+ return bcma_of_get_irq(bus->dev, core, num);
- return 0;
- case BCMA_HOSTTYPE_SDIO:
- return 0;
-@@ -239,18 +239,18 @@ void bcma_prepare_core(struct bcma_bus *
- core->dev.release = bcma_release_core_dev;
- core->dev.bus = &bcma_bus_type;
- dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
-- core->dev.parent = bcma_bus_get_host_dev(bus);
-- if (core->dev.parent)
-- bcma_of_fill_device(core->dev.parent, core);
-+ core->dev.parent = bus->dev;
-+ if (bus->dev)
-+ bcma_of_fill_device(bus->dev, core);
-
- switch (bus->hosttype) {
- case BCMA_HOSTTYPE_PCI:
-- core->dma_dev = &bus->host_pci->dev;
-+ core->dma_dev = bus->dev;
- core->irq = bus->host_pci->irq;
- break;
- case BCMA_HOSTTYPE_SOC:
-- if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
-- core->dma_dev = &bus->host_pdev->dev;
-+ if (IS_ENABLED(CONFIG_OF) && bus->dev) {
-+ core->dma_dev = bus->dev;
- } else {
- core->dev.dma_mask = &core->dev.coherent_dma_mask;
- core->dma_dev = &core->dev;
-@@ -261,28 +261,6 @@ void bcma_prepare_core(struct bcma_bus *
- }
- }
-
--struct device *bcma_bus_get_host_dev(struct bcma_bus *bus)
--{
-- switch (bus->hosttype) {
-- case BCMA_HOSTTYPE_PCI:
-- if (bus->host_pci)
-- return &bus->host_pci->dev;
-- else
-- return NULL;
-- case BCMA_HOSTTYPE_SOC:
-- if (bus->host_pdev)
-- return &bus->host_pdev->dev;
-- else
-- return NULL;
-- case BCMA_HOSTTYPE_SDIO:
-- if (bus->host_sdio)
-- return &bus->host_sdio->dev;
-- else
-- return NULL;
-- }
-- return NULL;
--}
--
- void bcma_init_bus(struct bcma_bus *bus)
- {
- mutex_lock(&bcma_buses_mutex);
-@@ -402,7 +380,6 @@ int bcma_bus_register(struct bcma_bus *b
- {
- int err;
- struct bcma_device *core;
-- struct device *dev;
-
- /* Scan for devices (cores) */
- err = bcma_bus_scan(bus);
-@@ -425,10 +402,8 @@ int bcma_bus_register(struct bcma_bus *b
- bcma_core_pci_early_init(&bus->drv_pci[0]);
- }
-
-- dev = bcma_bus_get_host_dev(bus);
-- if (dev) {
-- of_platform_default_populate(dev->of_node, NULL, dev);
-- }
-+ if (bus->dev)
-+ of_platform_default_populate(bus->dev->of_node, NULL, bus->dev);
-
- /* Cores providing flash access go before SPROM init */
- list_for_each_entry(core, &bus->cores, list) {
---- a/include/linux/bcma/bcma.h
-+++ b/include/linux/bcma/bcma.h
-@@ -332,6 +332,8 @@ extern int bcma_arch_register_fallback_s
- struct ssb_sprom *out));
-
- struct bcma_bus {
-+ struct device *dev;
-+
- /* The MMIO area. */
- void __iomem *mmio;
-
-@@ -339,14 +341,7 @@ struct bcma_bus {
-
- enum bcma_hosttype hosttype;
- bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */
-- union {
-- /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */
-- struct pci_dev *host_pci;
-- /* Pointer to the SDIO device (only for BCMA_HOSTTYPE_SDIO) */
-- struct sdio_func *host_sdio;
-- /* Pointer to platform device (only for BCMA_HOSTTYPE_SOC) */
-- struct platform_device *host_pdev;
-- };
-+ struct pci_dev *host_pci; /* PCI bus pointer (BCMA_HOSTTYPE_PCI only) */
-
- struct bcma_chipinfo chipinfo;
-
diff --git a/target/linux/generic/backport-4.19/080-v5.1-0002-bcma-use-dev_-printing-functions.patch b/target/linux/generic/backport-4.19/080-v5.1-0002-bcma-use-dev_-printing-functions.patch
deleted file mode 100644
index 7ce8ba8967..0000000000
--- a/target/linux/generic/backport-4.19/080-v5.1-0002-bcma-use-dev_-printing-functions.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 777bc4801a6868fcbff09ffb6e30f023e7c5ed38 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Wed, 2 Jan 2019 00:00:02 +0100
-Subject: [PATCH] bcma: use dev_* printing functions
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-It provides more meaningful messages.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
----
- drivers/bcma/bcma_private.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/bcma/bcma_private.h
-+++ b/drivers/bcma/bcma_private.h
-@@ -10,13 +10,13 @@
- #include <linux/delay.h>
-
- #define bcma_err(bus, fmt, ...) \
-- pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
-+ dev_err((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
- #define bcma_warn(bus, fmt, ...) \
-- pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
-+ dev_warn((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
- #define bcma_info(bus, fmt, ...) \
-- pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
-+ dev_info((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
- #define bcma_debug(bus, fmt, ...) \
-- pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
-+ dev_dbg((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
-
- struct bcma_bus;
-
diff --git a/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch b/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch
deleted file mode 100644
index 5d49a406c4..0000000000
--- a/target/linux/generic/backport-4.19/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 46bf067870156abd61fe24d14c2486d15b8b502c Mon Sep 17 00:00:00 2001
-From: Dave Taht <dave@taht.net>
-Date: Fri, 14 Dec 2018 18:38:40 +0000
-Subject: [PATCH 1/1] Allow class-e address assignment in ifconfig and early
- boot
-
-While the linux kernel became mostly "class-e clean" a decade ago,
-and most distributions long ago switched to the iproute2 suite
-of utilities, which allow class-e (240.0.0.0/4) address assignment,
-distributions relying on busybox, toybox and other forms of
-ifconfig cannot assign class-e addresses without this kernel patch.
-
-With this patch, also, a boot command line on these addresses is feasible:
-(ip=248.0.1.2::248.0.1.1:255.255.255.0).
-
-While CIDR has been obsolete for 2 decades, and a survey of all the
-userspace open source code in the world shows most IN_whatever macros
-are also obsolete... rather than obsolete CIDR from this ioctl entirely,
-this patch merely enables class-e assignment, sanely.
-
-H/T to Vince Fuller and his original patch here:
- https://lkml.org/lkml/2008/1/7/370
-
-Signed-off-by: Dave Taht <dave.taht@gmail.com>
-Reviewed-by: John Gilmore <gnu@toad.com>
----
- include/uapi/linux/in.h | 8 ++++++--
- net/ipv4/devinet.c | 4 +++-
- net/ipv4/ipconfig.c | 2 ++
- 3 files changed, 11 insertions(+), 3 deletions(-)
-
---- a/include/uapi/linux/in.h
-+++ b/include/uapi/linux/in.h
-@@ -268,8 +268,12 @@ struct sockaddr_in {
- #define IN_MULTICAST(a) IN_CLASSD(a)
- #define IN_MULTICAST_NET 0xF0000000
-
--#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
--#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
-+#define IN_BADCLASS(a) (((long int) (a) ) == (long int)0xffffffff)
-+#define IN_EXPERIMENTAL(a) IN_BADCLASS((a))
-+
-+#define IN_CLASSE(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
-+#define IN_CLASSE_NET 0xffffffff
-+#define IN_CLASSE_NSHIFT 0
-
- /* Address to accept any incoming messages. */
- #define INADDR_ANY ((unsigned long int) 0x00000000)
---- a/net/ipv4/devinet.c
-+++ b/net/ipv4/devinet.c
-@@ -941,7 +941,7 @@ static int inet_abc_len(__be32 addr)
- {
- int rc = -1; /* Something else, probably a multicast. */
-
-- if (ipv4_is_zeronet(addr))
-+ if (ipv4_is_zeronet(addr) || ipv4_is_lbcast(addr))
- rc = 0;
- else {
- __u32 haddr = ntohl(addr);
-@@ -952,6 +952,8 @@ static int inet_abc_len(__be32 addr)
- rc = 16;
- else if (IN_CLASSC(haddr))
- rc = 24;
-+ else if (IN_CLASSE(haddr))
-+ rc = 32;
- }
-
- return rc;
---- a/net/ipv4/ipconfig.c
-+++ b/net/ipv4/ipconfig.c
-@@ -429,6 +429,8 @@ static int __init ic_defaults(void)
- ic_netmask = htonl(IN_CLASSB_NET);
- else if (IN_CLASSC(ntohl(ic_myaddr)))
- ic_netmask = htonl(IN_CLASSC_NET);
-+ else if (IN_CLASSE(ntohl(ic_myaddr)))
-+ ic_netmask = htonl(IN_CLASSE_NET);
- else {
- pr_err("IP-Config: Unable to guess netmask for address %pI4\n",
- &ic_myaddr);
diff --git a/target/linux/generic/backport-4.19/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch b/target/linux/generic/backport-4.19/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch
deleted file mode 100644
index 2b3384391a..0000000000
--- a/target/linux/generic/backport-4.19/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 4cc30de79d293f1e8c5f50ae3a9c005def9564a0 Mon Sep 17 00:00:00 2001
-From: Koen Vandeputte <koen.vandeputte@ncentric.com>
-Date: Mon, 7 Jan 2019 14:14:27 +0100
-Subject: [PATCH 2/2] arm: cns3xxx: use actual size reads for PCIe
-
-commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors")
-reimplemented cns3xxx_pci_read_config() using pci_generic_config_read32(),
-which preserved the property of only doing 32-bit reads.
-
-It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(),
-so it changed writes from always being 32 bits to being the actual size,
-which works just fine.
-
-Due to:
-- The documentation does not mention that only 32 bit access is allowed.
-- Writes are already executed using the actual size
-- Extensive testing shows that 8b, 16b and 32b reads work as intended
-
-It makes perfectly sense to also swap 32 bit reading in favor of actual size.
-
-Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors")
-Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
-Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
-CC: Arnd Bergmann <arnd@arndb.de>
-CC: Krzysztof Halasa <khalasa@piap.pl>
-CC: Olof Johansson <olof@lixom.net>
-CC: Robin Leblon <robin.leblon@ncentric.com>
-CC: Rob Herring <robh@kernel.org>
-CC: Russell King <linux@armlinux.org.uk>
-CC: Tim Harvey <tharvey@gateworks.com>
-CC: stable@vger.kernel.org # v4.0+
----
- arch/arm/mach-cns3xxx/pcie.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struc
- u32 mask = (0x1ull << (size * 8)) - 1;
- int shift = (where % 4) * 8;
-
-- ret = pci_generic_config_read32(bus, devfn, where, size, val);
-+ ret = pci_generic_config_read(bus, devfn, where, size, val);
-
- if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
- (where & 0xffc) == PCI_CLASS_REVISION)
diff --git a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
deleted file mode 100644
index f8ccfcc95d..0000000000
--- a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From: Pablo Neira Ayuso <pablo@netfilter.org>
-Date: Thu, 25 Jan 2018 12:58:55 +0100
-Subject: [PATCH] netfilter: nft_flow_offload: handle netdevice events from
- nf_flow_table
-
-Move the code that deals with device events to the core.
-
-Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
----
-
---- a/net/netfilter/nf_flow_table_core.c
-+++ b/net/netfilter/nf_flow_table_core.c
-@@ -520,5 +520,35 @@ void nf_flow_table_free(struct nf_flowta
- }
- EXPORT_SYMBOL_GPL(nf_flow_table_free);
-
-+static int nf_flow_table_netdev_event(struct notifier_block *this,
-+ unsigned long event, void *ptr)
-+{
-+ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
-+
-+ if (event != NETDEV_DOWN)
-+ return NOTIFY_DONE;
-+
-+ nf_flow_table_cleanup(dev_net(dev), dev);
-+
-+ return NOTIFY_DONE;
-+}
-+
-+static struct notifier_block flow_offload_netdev_notifier = {
-+ .notifier_call = nf_flow_table_netdev_event,
-+};
-+
-+static int __init nf_flow_table_module_init(void)
-+{
-+ return register_netdevice_notifier(&flow_offload_netdev_notifier);
-+}
-+
-+static void __exit nf_flow_table_module_exit(void)
-+{
-+ unregister_netdevice_notifier(&flow_offload_netdev_notifier);
-+}
-+
-+module_init(nf_flow_table_module_init);
-+module_exit(nf_flow_table_module_exit);
-+
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Pablo Neira Ayuso <pablo@netfilter.org>");
---- a/net/netfilter/nft_flow_offload.c
-+++ b/net/netfilter/nft_flow_offload.c
-@@ -196,47 +196,14 @@ static struct nft_expr_type nft_flow_off
- .owner = THIS_MODULE,
- };
-
--static int flow_offload_netdev_event(struct notifier_block *this,
-- unsigned long event, void *ptr)
--{
-- struct net_device *dev = netdev_notifier_info_to_dev(ptr);
--
-- if (event != NETDEV_DOWN)
-- return NOTIFY_DONE;
--
-- nf_flow_table_cleanup(dev_net(dev), dev);
--
-- return NOTIFY_DONE;
--}
--
--static struct notifier_block flow_offload_netdev_notifier = {
-- .notifier_call = flow_offload_netdev_event,
--};
--
- static int __init nft_flow_offload_module_init(void)
- {
-- int err;
--
-- err = register_netdevice_notifier(&flow_offload_netdev_notifier);
-- if (err)
-- goto err;
--
-- err = nft_register_expr(&nft_flow_offload_type);
-- if (err < 0)
-- goto register_expr;
--
-- return 0;
--
--register_expr:
-- unregister_netdevice_notifier(&flow_offload_netdev_notifier);
--err:
-- return err;
-+ return nft_register_expr(&nft_flow_offload_type);
- }
-
- static void __exit nft_flow_offload_module_exit(void)
- {
- nft_unregister_expr(&nft_flow_offload_type);
-- unregister_netdevice_notifier(&flow_offload_netdev_notifier);
- }
-
- module_init(nft_flow_offload_module_init);
diff --git a/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch b/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch
deleted file mode 100644
index ac7a73b60e..0000000000
--- a/target/linux/generic/backport-4.19/366-netfilter-nf_flow_table-clean-up-and-fix-dst-handlin.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Thu, 15 Mar 2018 18:21:43 +0100
-Subject: [PATCH] netfilter: nf_flow_table: clean up and fix dst handling
-
-dst handling in the code is inconsistent and possibly wrong. In my test,
-skb_dst(skb) holds the dst entry after routing but before NAT, so the
-code could possibly return the same dst entry for both directions of a
-connection.
-Additionally, there was some confusion over the dst entry vs the address
-passed as parameter to rt_nexthop/rt6_nexthop.
-
-Do an explicit dst lookup for both ends of the connection and always use
-the source address for it. When running the IP hook, use the dst entry
-for the opposite direction for determining the route.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/netfilter/nf_flow_table_ip.c
-+++ b/net/netfilter/nf_flow_table_ip.c
-@@ -241,7 +241,7 @@ nf_flow_offload_ip_hook(void *priv, stru
-
- dir = tuplehash->tuple.dir;
- flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
-- rt = (struct rtable *)flow->tuplehash[dir].tuple.dst_cache;
-+ rt = (struct rtable *)flow->tuplehash[!dir].tuple.dst_cache;
-
- if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)) &&
- (ip_hdr(skb)->frag_off & htons(IP_DF)) != 0)
-@@ -459,7 +459,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
-
- dir = tuplehash->tuple.dir;
- flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
-- rt = (struct rt6_info *)flow->tuplehash[dir].tuple.dst_cache;
-+ rt = (struct rt6_info *)flow->tuplehash[!dir].tuple.dst_cache;
-
- if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
- return NF_ACCEPT;
---- a/net/netfilter/nft_flow_offload.c
-+++ b/net/netfilter/nft_flow_offload.c
-@@ -18,13 +18,11 @@ struct nft_flow_offload {
- struct nft_flowtable *flowtable;
- };
-
--static int nft_flow_route(const struct nft_pktinfo *pkt,
-- const struct nf_conn *ct,
-- struct nf_flow_route *route,
-- enum ip_conntrack_dir dir)
-+static struct dst_entry *
-+nft_flow_dst(const struct nf_conn *ct, enum ip_conntrack_dir dir,
-+ const struct nft_pktinfo *pkt)
- {
-- struct dst_entry *this_dst = skb_dst(pkt->skb);
-- struct dst_entry *other_dst = NULL;
-+ struct dst_entry *dst;
- struct flowi fl;
-
- memset(&fl, 0, sizeof(fl));
-@@ -39,8 +37,21 @@ static int nft_flow_route(const struct n
- break;
- }
-
-- nf_route(nft_net(pkt), &other_dst, &fl, false, nft_pf(pkt));
-- if (!other_dst)
-+ nf_route(nft_net(pkt), &dst, &fl, false, nft_pf(pkt));
-+
-+ return dst;
-+}
-+
-+static int nft_flow_route(const struct nft_pktinfo *pkt,
-+ const struct nf_conn *ct,
-+ struct nf_flow_route *route,
-+ enum ip_conntrack_dir dir)
-+{
-+ struct dst_entry *this_dst, *other_dst;
-+
-+ this_dst = nft_flow_dst(ct, dir, pkt);
-+ other_dst = nft_flow_dst(ct, !dir, pkt);
-+ if (!this_dst || !other_dst)
- return -ENOENT;
-
- route->tuple[dir].dst = this_dst;
diff --git a/target/linux/generic/backport-4.19/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch b/target/linux/generic/backport-4.19/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch
deleted file mode 100644
index cc8e00353d..0000000000
--- a/target/linux/generic/backport-4.19/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Wed, 13 Jun 2018 12:33:39 +0200
-Subject: [PATCH] netfilter: nf_flow_table: fix offloaded connection timeout
- corner case
-
-The full teardown of offloaded flows is deferred to a gc work item,
-however processing of packets by netfilter needs to happen immediately
-after a teardown is requested, because the conntrack state needs to be
-fixed up.
-
-Since the IPS_OFFLOAD_BIT is still kept until the teardown is complete,
-the netfilter conntrack gc can accidentally bump the timeout of a
-connection where offload was just stopped, causing a conntrack entry
-leak.
-
-Fix this by moving the conntrack timeout bumping from conntrack core to
-the nf_flow_offload and add a check to prevent bogus timeout bumps.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/netfilter/nf_conntrack_core.c
-+++ b/net/netfilter/nf_conntrack_core.c
-@@ -1178,18 +1178,6 @@ static bool gc_worker_can_early_drop(con
- return false;
- }
-
--#define DAY (86400 * HZ)
--
--/* Set an arbitrary timeout large enough not to ever expire, this save
-- * us a check for the IPS_OFFLOAD_BIT from the packet path via
-- * nf_ct_is_expired().
-- */
--static void nf_ct_offload_timeout(struct nf_conn *ct)
--{
-- if (nf_ct_expires(ct) < DAY / 2)
-- ct->timeout = nfct_time_stamp + DAY;
--}
--
- static void gc_worker(struct work_struct *work)
- {
- unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u);
-@@ -1226,10 +1214,8 @@ static void gc_worker(struct work_struct
- tmp = nf_ct_tuplehash_to_ctrack(h);
-
- scanned++;
-- if (test_bit(IPS_OFFLOAD_BIT, &tmp->status)) {
-- nf_ct_offload_timeout(tmp);
-+ if (test_bit(IPS_OFFLOAD_BIT, &tmp->status))
- continue;
-- }
-
- if (nf_ct_is_expired(tmp)) {
- nf_ct_gc_expired(tmp);
---- a/net/netfilter/nf_flow_table_core.c
-+++ b/net/netfilter/nf_flow_table_core.c
-@@ -183,8 +183,27 @@ static const struct rhashtable_params nf
- .automatic_shrinking = true,
- };
-
-+#define DAY (86400 * HZ)
-+
-+/* Set an arbitrary timeout large enough not to ever expire, this save
-+ * us a check for the IPS_OFFLOAD_BIT from the packet path via
-+ * nf_ct_is_expired().
-+ */
-+static void nf_ct_offload_timeout(struct flow_offload *flow)
-+{
-+ struct flow_offload_entry *entry;
-+ struct nf_conn *ct;
-+
-+ entry = container_of(flow, struct flow_offload_entry, flow);
-+ ct = entry->ct;
-+
-+ if (nf_ct_expires(ct) < DAY / 2)
-+ ct->timeout = nfct_time_stamp + DAY;
-+}
-+
- int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
- {
-+ nf_ct_offload_timeout(flow);
- flow->timeout = (u32)jiffies;
-
- rhashtable_insert_fast(&flow_table->rhashtable,
-@@ -305,6 +324,8 @@ static int nf_flow_offload_gc_step(struc
- rhashtable_walk_start(&hti);
-
- while ((tuplehash = rhashtable_walk_next(&hti))) {
-+ bool teardown;
-+
- if (IS_ERR(tuplehash)) {
- err = PTR_ERR(tuplehash);
- if (err != -EAGAIN)
-@@ -317,9 +338,13 @@ static int nf_flow_offload_gc_step(struc
-
- flow = container_of(tuplehash, struct flow_offload, tuplehash[0]);
-
-- if (nf_flow_has_expired(flow) ||
-- (flow->flags & (FLOW_OFFLOAD_DYING |
-- FLOW_OFFLOAD_TEARDOWN)))
-+ teardown = flow->flags & (FLOW_OFFLOAD_DYING |
-+ FLOW_OFFLOAD_TEARDOWN);
-+
-+ if (!teardown)
-+ nf_ct_offload_timeout(flow);
-+
-+ if (nf_flow_has_expired(flow) || teardown)
- flow_offload_del(flow_table, flow);
- }
- out:
diff --git a/target/linux/generic/backport-4.19/371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch b/target/linux/generic/backport-4.19/371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch
deleted file mode 100644
index 5ee55b8f08..0000000000
--- a/target/linux/generic/backport-4.19/371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Thu, 14 Jun 2018 11:20:09 +0200
-Subject: [PATCH] netfilter: nf_flow_table: fix up ct state of flows after
- timeout
-
-If a connection simply times out instead of being torn down, it is left
-active with a long timeout. Fix this by calling flow_offload_fixup_ct_state
-here as well.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/netfilter/nf_flow_table_core.c
-+++ b/net/netfilter/nf_flow_table_core.c
-@@ -231,6 +231,9 @@ static void flow_offload_del(struct nf_f
- e = container_of(flow, struct flow_offload_entry, flow);
- clear_bit(IPS_OFFLOAD_BIT, &e->ct->status);
-
-+ if (!(flow->flags & FLOW_OFFLOAD_TEARDOWN))
-+ flow_offload_fixup_ct_state(e->ct);
-+
- flow_offload_free(flow);
- }
-
diff --git a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch b/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch
deleted file mode 100644
index 632f41ef98..0000000000
--- a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch
+++ /dev/null
@@ -1,617 +0,0 @@
-From 402c8d61d2f27060be14849fcb30682f75f3bf3b Mon Sep 17 00:00:00 2001
-From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-Date: Wed, 13 Mar 2019 20:54:49 +0000
-Subject: [PATCH] net: sched: Introduce act_ctinfo action
-
-ctinfo is a new tc filter action module. It is designed to restore DSCPs
-stored in conntrack marks into the ipv4/v6 diffserv field.
-
-The feature is intended for use and has been found useful for restoring
-ingress classifications based on egress classifications across links
-that bleach or otherwise change DSCP, typically home ISP Internet links.
-Restoring DSCP on ingress on the WAN link allows qdiscs such as CAKE to
-shape inbound packets according to policies that are easier to indicate
-on egress.
-
-Ingress classification is traditionally a challenging task since
-iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
-lookups, hence are unable to see internal IPv4 addresses as used on the
-typical home masquerading gateway.
-
-ctinfo understands the following parameters:
-
-dscp dscpmask[/statemask]
-
-dscpmask - a 32 bit mask of at least 6 contiguous bits and indicates
-where ctinfo will find the DSCP bits stored in the conntrack mark.
-
-statemask - a 32 bit mask of (usually) 1 bit length, outside the area
-specified by dscpmask. This represents a conditional operation flag
-whereby the DSCP is only restored if the flag is set. This is useful to
-implement a 'one shot' iptables based classification where the
-'complicated' iptables rules are only run once to classify the
-connection on initial (egress) packet and subsequent packets are all
-marked/restored with the same DSCP. A mask of zero disables the
-conditional behaviour ie. the conntrack mark DSCP bits are always
-restored to the ip diffserv field (assuming the conntrack entry is found
-& the skb is an ipv4/ipv6 type)
-
-optional parameters:
-
-zone - conntrack zone
-
-control - action related control (reclassify | pipe | drop | continue |
-ok | goto chain <CHAIN_INDEX>)
-
-e.g. dscp 0xfc000000/0x01000000
-
-|----0xFC----conntrack mark----000000---|
-| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0|
-| DSCP | unused | flag |unused |
-|-----------------------0x01---000000---|
- | |
- | |
- ---| Conditional flag
- v only restore if set
-|-ip diffserv-|
-| 6 bits |
-|-------------|
-
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
----
- include/net/tc_act/tc_ctinfo.h | 28 ++
- include/uapi/linux/pkt_cls.h | 3 +-
- include/uapi/linux/tc_act/tc_ctinfo.h | 34 ++
- net/sched/Kconfig | 17 +
- net/sched/Makefile | 1 +
- net/sched/act_ctinfo.c | 395 ++++++++++++++++++++++
- tools/testing/selftests/tc-testing/config | 1 +
- 7 files changed, 478 insertions(+), 1 deletion(-)
- create mode 100644 include/net/tc_act/tc_ctinfo.h
- create mode 100644 include/uapi/linux/tc_act/tc_ctinfo.h
- create mode 100644 net/sched/act_ctinfo.c
-
-diff --git a/include/net/tc_act/tc_ctinfo.h b/include/net/tc_act/tc_ctinfo.h
-new file mode 100644
-index 000000000000..d6a688571672
---- /dev/null
-+++ b/include/net/tc_act/tc_ctinfo.h
-@@ -0,0 +1,28 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+#ifndef __NET_TC_CTINFO_H
-+#define __NET_TC_CTINFO_H
-+
-+#include <net/act_api.h>
-+
-+struct tcf_ctinfo_params {
-+ struct rcu_head rcu;
-+ struct net *net;
-+ u32 dscpmask;
-+ u32 dscpstatemask;
-+ u32 cpmarkmask;
-+ u16 zone;
-+ u8 mode;
-+ u8 dscpmaskshift;
-+};
-+
-+struct tcf_ctinfo {
-+ struct tc_action common;
-+ struct tcf_ctinfo_params __rcu *params;
-+ u64 stats_dscp_set;
-+ u64 stats_dscp_error;
-+ u64 stats_cpmark_set;
-+};
-+
-+#define to_ctinfo(a) ((struct tcf_ctinfo *)a)
-+
-+#endif /* __NET_TC_CTINFO_H */
-diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
-index be382fb0592d..71e10c5a96a0 100644
---- a/include/uapi/linux/pkt_cls.h
-+++ b/include/uapi/linux/pkt_cls.h
-@@ -68,7 +68,8 @@ enum {
- TCA_ID_UNSPEC=0,
- TCA_ID_POLICE=1,
- /* other actions go here */
-- __TCA_ID_MAX=255
-+ TCA_ID_CTINFO,
-+ __TCA_ID_MAX = 255
- };
-
- #define TCA_ID_MAX __TCA_ID_MAX
-diff --git a/include/uapi/linux/tc_act/tc_ctinfo.h b/include/uapi/linux/tc_act/tc_ctinfo.h
-new file mode 100644
-index 000000000000..da803e05a89b
---- /dev/null
-+++ b/include/uapi/linux/tc_act/tc_ctinfo.h
-@@ -0,0 +1,34 @@
-+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-+#ifndef __UAPI_TC_CTINFO_H
-+#define __UAPI_TC_CTINFO_H
-+
-+#include <linux/types.h>
-+#include <linux/pkt_cls.h>
-+
-+struct tc_ctinfo {
-+ tc_gen;
-+};
-+
-+enum {
-+ TCA_CTINFO_UNSPEC,
-+ TCA_CTINFO_PAD,
-+ TCA_CTINFO_TM,
-+ TCA_CTINFO_ACT,
-+ TCA_CTINFO_ZONE,
-+ TCA_CTINFO_PARMS_DSCP_MASK,
-+ TCA_CTINFO_PARMS_DSCP_STATEMASK,
-+ TCA_CTINFO_PARMS_CPMARK_MASK,
-+ TCA_CTINFO_STATS_DSCP_SET,
-+ TCA_CTINFO_STATS_DSCP_ERROR,
-+ TCA_CTINFO_STATS_CPMARK_SET,
-+ __TCA_CTINFO_MAX
-+};
-+
-+#define TCA_CTINFO_MAX (__TCA_CTINFO_MAX - 1)
-+
-+enum {
-+ CTINFO_MODE_DSCP = BIT(0),
-+ CTINFO_MODE_CPMARK = BIT(1)
-+};
-+
-+#endif
-diff --git a/net/sched/Kconfig b/net/sched/Kconfig
-index e95741388311..1d79d5dba6e4 100644
---- a/net/sched/Kconfig
-+++ b/net/sched/Kconfig
-@@ -866,6 +866,23 @@ config NET_ACT_CONNMARK
- To compile this code as a module, choose M here: the
- module will be called act_connmark.
-
-+config NET_ACT_CTINFO
-+ tristate "Netfilter Connection Mark Actions"
-+ depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
-+ depends on NF_CONNTRACK && NF_CONNTRACK_MARK
-+ help
-+ Say Y here to allow transfer of a connmark stored information.
-+ Current actions transfer connmark stored DSCP into
-+ ipv4/v6 diffserv and/or to transfer connmark to packet
-+ mark. Both are useful for restoring egress based marks
-+ back onto ingress connections for qdisc priority mapping
-+ purposes.
-+
-+ If unsure, say N.
-+
-+ To compile this code as a module, choose M here: the
-+ module will be called act_ctinfo.
-+
- config NET_ACT_SKBMOD
- tristate "skb data modification action"
- depends on NET_CLS_ACT
-diff --git a/net/sched/Makefile b/net/sched/Makefile
-index f0403f49edcb..bb3c2bc44af7 100644
---- a/net/sched/Makefile
-+++ b/net/sched/Makefile
-@@ -21,6 +21,7 @@ obj-$(CONFIG_NET_ACT_CSUM) += act_csum.o
- obj-$(CONFIG_NET_ACT_VLAN) += act_vlan.o
- obj-$(CONFIG_NET_ACT_BPF) += act_bpf.o
- obj-$(CONFIG_NET_ACT_CONNMARK) += act_connmark.o
-+obj-$(CONFIG_NET_ACT_CTINFO) += act_ctinfo.o
- obj-$(CONFIG_NET_ACT_SKBMOD) += act_skbmod.o
- obj-$(CONFIG_NET_ACT_IFE) += act_ife.o
- obj-$(CONFIG_NET_IFE_SKBMARK) += act_meta_mark.o
-diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c
-new file mode 100644
-index 000000000000..8975cb4976aa
---- /dev/null
-+++ b/net/sched/act_ctinfo.c
-@@ -0,0 +1,395 @@
-+// SPDX-License-Identifier: GPL-2.0+
-+/* net/sched/act_ctinfo.c netfilter ctinfo connmark actions
-+ *
-+ * Copyright (c) 2019 Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/skbuff.h>
-+#include <linux/rtnetlink.h>
-+#include <linux/pkt_cls.h>
-+#include <linux/ip.h>
-+#include <linux/ipv6.h>
-+#include <net/netlink.h>
-+#include <net/pkt_sched.h>
-+#include <net/act_api.h>
-+#include <net/pkt_cls.h>
-+#include <uapi/linux/tc_act/tc_ctinfo.h>
-+#include <net/tc_act/tc_ctinfo.h>
-+
-+#include <net/netfilter/nf_conntrack.h>
-+#include <net/netfilter/nf_conntrack_core.h>
-+#include <net/netfilter/nf_conntrack_ecache.h>
-+#include <net/netfilter/nf_conntrack_zones.h>
-+
-+static struct tc_action_ops act_ctinfo_ops;
-+static unsigned int ctinfo_net_id;
-+
-+static void tcf_ctinfo_dscp_set(struct nf_conn *ct, struct tcf_ctinfo *ca,
-+ struct tcf_ctinfo_params *cp,
-+ struct sk_buff *skb, int wlen, int proto)
-+{
-+ u8 dscp, newdscp;
-+
-+ newdscp = (((ct->mark & cp->dscpmask) >> cp->dscpmaskshift) << 2) &
-+ ~INET_ECN_MASK;
-+
-+ switch (proto) {
-+ case NFPROTO_IPV4:
-+ dscp = ipv4_get_dsfield(ip_hdr(skb)) & ~INET_ECN_MASK;
-+ if (dscp != newdscp) {
-+ if (likely(!skb_try_make_writable(skb, wlen))) {
-+ ipv4_change_dsfield(ip_hdr(skb),
-+ INET_ECN_MASK,
-+ newdscp);
-+ ca->stats_dscp_set++;
-+ } else {
-+ ca->stats_dscp_error++;
-+ }
-+ }
-+ break;
-+ case NFPROTO_IPV6:
-+ dscp = ipv6_get_dsfield(ipv6_hdr(skb)) & ~INET_ECN_MASK;
-+ if (dscp != newdscp) {
-+ if (likely(!skb_try_make_writable(skb, wlen))) {
-+ ipv6_change_dsfield(ipv6_hdr(skb),
-+ INET_ECN_MASK,
-+ newdscp);
-+ ca->stats_dscp_set++;
-+ } else {
-+ ca->stats_dscp_error++;
-+ }
-+ }
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+static void tcf_ctinfo_cpmark_set(struct nf_conn *ct, struct tcf_ctinfo *ca,
-+ struct tcf_ctinfo_params *cp,
-+ struct sk_buff *skb)
-+{
-+ ca->stats_cpmark_set++;
-+ skb->mark = ct->mark & cp->cpmarkmask;
-+}
-+
-+static int tcf_ctinfo_act(struct sk_buff *skb, const struct tc_action *a,
-+ struct tcf_result *res)
-+{
-+ const struct nf_conntrack_tuple_hash *thash = NULL;
-+ struct tcf_ctinfo *ca = to_ctinfo(a);
-+ struct nf_conntrack_tuple tuple;
-+ struct nf_conntrack_zone zone;
-+ enum ip_conntrack_info ctinfo;
-+ struct tcf_ctinfo_params *cp;
-+ struct nf_conn *ct;
-+ int proto, wlen;
-+ int action;
-+
-+ cp = rcu_dereference_bh(ca->params);
-+
-+ tcf_lastuse_update(&ca->tcf_tm);
-+ bstats_update(&ca->tcf_bstats, skb);
-+ action = READ_ONCE(ca->tcf_action);
-+
-+ wlen = skb_network_offset(skb);
-+ if (tc_skb_protocol(skb) == htons(ETH_P_IP)) {
-+ wlen += sizeof(struct iphdr);
-+ if (!pskb_may_pull(skb, wlen))
-+ goto out;
-+
-+ proto = NFPROTO_IPV4;
-+ } else if (tc_skb_protocol(skb) == htons(ETH_P_IPV6)) {
-+ wlen += sizeof(struct ipv6hdr);
-+ if (!pskb_may_pull(skb, wlen))
-+ goto out;
-+
-+ proto = NFPROTO_IPV6;
-+ } else {
-+ goto out;
-+ }
-+
-+ ct = nf_ct_get(skb, &ctinfo);
-+ if (!ct) { /* look harder, usually ingress */
-+ if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
-+ proto, cp->net, &tuple))
-+ goto out;
-+ zone.id = cp->zone;
-+ zone.dir = NF_CT_DEFAULT_ZONE_DIR;
-+
-+ thash = nf_conntrack_find_get(cp->net, &zone, &tuple);
-+ if (!thash)
-+ goto out;
-+
-+ ct = nf_ct_tuplehash_to_ctrack(thash);
-+ }
-+
-+ if (cp->mode & CTINFO_MODE_DSCP)
-+ if (!cp->dscpstatemask || (ct->mark & cp->dscpstatemask))
-+ tcf_ctinfo_dscp_set(ct, ca, cp, skb, wlen, proto);
-+
-+ if (cp->mode & CTINFO_MODE_CPMARK)
-+ tcf_ctinfo_cpmark_set(ct, ca, cp, skb);
-+
-+ if (thash)
-+ nf_ct_put(ct);
-+out:
-+ return action;
-+}
-+
-+static const struct nla_policy ctinfo_policy[TCA_CTINFO_MAX + 1] = {
-+ [TCA_CTINFO_ACT] = { .len = sizeof(struct
-+ tc_ctinfo) },
-+ [TCA_CTINFO_ZONE] = { .type = NLA_U16 },
-+ [TCA_CTINFO_PARMS_DSCP_MASK] = { .type = NLA_U32 },
-+ [TCA_CTINFO_PARMS_DSCP_STATEMASK] = { .type = NLA_U32 },
-+ [TCA_CTINFO_PARMS_CPMARK_MASK] = { .type = NLA_U32 },
-+};
-+
-+static int tcf_ctinfo_init(struct net *net, struct nlattr *nla,
-+ struct nlattr *est, struct tc_action **a,
-+ int ovr, int bind, bool rtnl_held,
-+ struct netlink_ext_ack *extack)
-+{
-+ struct tc_action_net *tn = net_generic(net, ctinfo_net_id);
-+ struct nlattr *tb[TCA_CTINFO_MAX + 1];
-+ struct tcf_ctinfo_params *cp_new;
-+/* struct tcf_chain *goto_ch = NULL; */
-+ u32 dscpmask = 0, dscpstatemask;
-+ struct tc_ctinfo *actparm;
-+ struct tcf_ctinfo *ci;
-+ u8 dscpmaskshift;
-+ int ret = 0, err;
-+
-+ if (!nla)
-+ return -EINVAL;
-+
-+ err = nla_parse_nested(tb, TCA_CTINFO_MAX, nla, ctinfo_policy, NULL);
-+ if (err < 0)
-+ return err;
-+
-+ if (!tb[TCA_CTINFO_ACT])
-+ return -EINVAL;
-+ actparm = nla_data(tb[TCA_CTINFO_ACT]);
-+
-+ /* do some basic validation here before dynamically allocating things */
-+ /* that we would otherwise have to clean up. */
-+ if (tb[TCA_CTINFO_PARMS_DSCP_MASK]) {
-+ dscpmask = nla_get_u32(tb[TCA_CTINFO_PARMS_DSCP_MASK]);
-+ /* need contiguous 6 bit mask */
-+ dscpmaskshift = dscpmask ? __ffs(dscpmask) : 0;
-+ if ((~0 & (dscpmask >> dscpmaskshift)) != 0x3f)
-+ return -EINVAL;
-+ dscpstatemask = tb[TCA_CTINFO_PARMS_DSCP_STATEMASK] ?
-+ nla_get_u32(tb[TCA_CTINFO_PARMS_DSCP_STATEMASK]) : 0;
-+ /* mask & statemask must not overlap */
-+ if (dscpmask & dscpstatemask)
-+ return -EINVAL;
-+ }
-+
-+ /* done the validation:now to the actual action allocation */
-+ err = tcf_idr_check_alloc(tn, &actparm->index, a, bind);
-+ if (!err) {
-+ ret = tcf_idr_create(tn, actparm->index, est, a,
-+ &act_ctinfo_ops, bind, false);
-+ if (ret) {
-+ tcf_idr_cleanup(tn, actparm->index);
-+ return ret;
-+ }
-+ ret = ACT_P_CREATED;
-+ } else if (err > 0) {
-+ if (bind) /* don't override defaults */
-+ return 0;
-+ if (!ovr) {
-+ tcf_idr_release(*a, bind);
-+ return -EEXIST;
-+ }
-+ } else {
-+ return err;
-+ }
-+
-+/* err = tcf_action_check_ctrlact(actparm->action, tp, &goto_ch, extack);
-+ if (err < 0)
-+ goto release_idr;
-+ */
-+
-+ ci = to_ctinfo(*a);
-+
-+ cp_new = kzalloc(sizeof(*cp_new), GFP_KERNEL);
-+ if (unlikely(!cp_new)) {
-+ err = -ENOMEM;
-+ goto put_chain;
-+ }
-+
-+ cp_new->net = net;
-+ cp_new->zone = tb[TCA_CTINFO_ZONE] ?
-+ nla_get_u16(tb[TCA_CTINFO_ZONE]) : 0;
-+ if (dscpmask) {
-+ cp_new->dscpmask = dscpmask;
-+ cp_new->dscpmaskshift = dscpmaskshift;
-+ cp_new->dscpstatemask = dscpstatemask;
-+ cp_new->mode |= CTINFO_MODE_DSCP;
-+ }
-+
-+ if (tb[TCA_CTINFO_PARMS_CPMARK_MASK]) {
-+ cp_new->cpmarkmask =
-+ nla_get_u32(tb[TCA_CTINFO_PARMS_CPMARK_MASK]);
-+ cp_new->mode |= CTINFO_MODE_CPMARK;
-+ }
-+
-+ spin_lock_bh(&ci->tcf_lock);
-+/* goto_ch = tcf_action_set_ctrlact(*a, actparm->action, goto_ch); */
-+ ci->tcf_action = actparm->action;
-+ rcu_swap_protected(ci->params, cp_new,
-+ lockdep_is_held(&ci->tcf_lock));
-+ spin_unlock_bh(&ci->tcf_lock);
-+
-+/* if (goto_ch)
-+ tcf_chain_put_by_act(goto_ch); */
-+ if (cp_new)
-+ kfree_rcu(cp_new, rcu);
-+
-+ if (ret == ACT_P_CREATED)
-+ tcf_idr_insert(tn, *a);
-+
-+ return ret;
-+
-+put_chain:
-+/* if (goto_ch)
-+ tcf_chain_put_by_act(goto_ch);
-+release_idr: */
-+ tcf_idr_release(*a, bind);
-+ return err;
-+}
-+
-+static int tcf_ctinfo_dump(struct sk_buff *skb, struct tc_action *a,
-+ int bind, int ref)
-+{
-+ struct tcf_ctinfo *ci = to_ctinfo(a);
-+ struct tc_ctinfo opt = {
-+ .index = ci->tcf_index,
-+ .refcnt = refcount_read(&ci->tcf_refcnt) - ref,
-+ .bindcnt = atomic_read(&ci->tcf_bindcnt) - bind,
-+ };
-+ unsigned char *b = skb_tail_pointer(skb);
-+ struct tcf_ctinfo_params *cp;
-+ struct tcf_t t;
-+
-+ spin_lock_bh(&ci->tcf_lock);
-+ cp = rcu_dereference_protected(ci->params,
-+ lockdep_is_held(&ci->tcf_lock));
-+
-+ tcf_tm_dump(&t, &ci->tcf_tm);
-+ if (nla_put_64bit(skb, TCA_CTINFO_TM, sizeof(t), &t, TCA_CTINFO_PAD))
-+ goto nla_put_failure;
-+
-+ opt.action = ci->tcf_action;
-+ if (nla_put(skb, TCA_CTINFO_ACT, sizeof(opt), &opt))
-+ goto nla_put_failure;
-+
-+ if (nla_put_u16(skb, TCA_CTINFO_ZONE, cp->zone))
-+ goto nla_put_failure;
-+
-+ if (cp->mode & CTINFO_MODE_DSCP) {
-+ if (nla_put_u32(skb, TCA_CTINFO_PARMS_DSCP_MASK,
-+ cp->dscpmask))
-+ goto nla_put_failure;
-+ if (nla_put_u32(skb, TCA_CTINFO_PARMS_DSCP_STATEMASK,
-+ cp->dscpstatemask))
-+ goto nla_put_failure;
-+ }
-+
-+ if (cp->mode & CTINFO_MODE_CPMARK) {
-+ if (nla_put_u32(skb, TCA_CTINFO_PARMS_CPMARK_MASK,
-+ cp->cpmarkmask))
-+ goto nla_put_failure;
-+ }
-+
-+ if (nla_put_u64_64bit(skb, TCA_CTINFO_STATS_DSCP_SET,
-+ ci->stats_dscp_set, TCA_CTINFO_PAD))
-+ goto nla_put_failure;
-+
-+ if (nla_put_u64_64bit(skb, TCA_CTINFO_STATS_DSCP_ERROR,
-+ ci->stats_dscp_error, TCA_CTINFO_PAD))
-+ goto nla_put_failure;
-+
-+ if (nla_put_u64_64bit(skb, TCA_CTINFO_STATS_CPMARK_SET,
-+ ci->stats_cpmark_set, TCA_CTINFO_PAD))
-+ goto nla_put_failure;
-+
-+ spin_unlock_bh(&ci->tcf_lock);
-+ return skb->len;
-+
-+nla_put_failure:
-+ spin_unlock_bh(&ci->tcf_lock);
-+ nlmsg_trim(skb, b);
-+ return -1;
-+}
-+
-+static int tcf_ctinfo_walker(struct net *net, struct sk_buff *skb,
-+ struct netlink_callback *cb, int type,
-+ const struct tc_action_ops *ops,
-+ struct netlink_ext_ack *extack)
-+{
-+ struct tc_action_net *tn = net_generic(net, ctinfo_net_id);
-+
-+ return tcf_generic_walker(tn, skb, cb, type, ops, extack);
-+}
-+
-+static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 index,
-+ struct netlink_ext_ack *extack)
-+{
-+ struct tc_action_net *tn = net_generic(net, ctinfo_net_id);
-+
-+ return tcf_idr_search(tn, a, index);
-+}
-+
-+static struct tc_action_ops act_ctinfo_ops = {
-+ .kind = "ctinfo",
-+ .type = TCA_ID_CTINFO,
-+ .owner = THIS_MODULE,
-+ .act = tcf_ctinfo_act,
-+ .dump = tcf_ctinfo_dump,
-+ .init = tcf_ctinfo_init,
-+ .walk = tcf_ctinfo_walker,
-+ .lookup = tcf_ctinfo_search,
-+ .size = sizeof(struct tcf_ctinfo),
-+};
-+
-+static __net_init int ctinfo_init_net(struct net *net)
-+{
-+ struct tc_action_net *tn = net_generic(net, ctinfo_net_id);
-+
-+ return tc_action_net_init(tn, &act_ctinfo_ops);
-+}
-+
-+static void __net_exit ctinfo_exit_net(struct list_head *net_list)
-+{
-+ tc_action_net_exit(net_list, ctinfo_net_id);
-+}
-+
-+static struct pernet_operations ctinfo_net_ops = {
-+ .init = ctinfo_init_net,
-+ .exit_batch = ctinfo_exit_net,
-+ .id = &ctinfo_net_id,
-+ .size = sizeof(struct tc_action_net),
-+};
-+
-+static int __init ctinfo_init_module(void)
-+{
-+ return tcf_register_action(&act_ctinfo_ops, &ctinfo_net_ops);
-+}
-+
-+static void __exit ctinfo_cleanup_module(void)
-+{
-+ tcf_unregister_action(&act_ctinfo_ops, &ctinfo_net_ops);
-+}
-+
-+module_init(ctinfo_init_module);
-+module_exit(ctinfo_cleanup_module);
-+MODULE_AUTHOR("Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>");
-+MODULE_DESCRIPTION("Connection tracking mark actions");
-+MODULE_LICENSE("GPL");
-diff --git a/tools/testing/selftests/tc-testing/config b/tools/testing/selftests/tc-testing/config
-index 203302065458..9d1fddcfb887 100644
---- a/tools/testing/selftests/tc-testing/config
-+++ b/tools/testing/selftests/tc-testing/config
-@@ -37,6 +37,7 @@ CONFIG_NET_ACT_SKBEDIT=m
- CONFIG_NET_ACT_CSUM=m
- CONFIG_NET_ACT_VLAN=m
- CONFIG_NET_ACT_BPF=m
-+CONFIG_NET_ACT_CONNDSCP=m
- CONFIG_NET_ACT_CONNMARK=m
- CONFIG_NET_ACT_SKBMOD=m
- CONFIG_NET_ACT_IFE=m
---
-2.20.1 (Apple Git-117)
-
diff --git a/target/linux/generic/backport-4.19/450-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch b/target/linux/generic/backport-4.19/450-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch
deleted file mode 100644
index 15f761ab9d..0000000000
--- a/target/linux/generic/backport-4.19/450-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-From c93c613214ac70c87beab5422a60077bf126b855 Mon Sep 17 00:00:00 2001
-From: Chuanhong Guo <gch981213@gmail.com>
-Date: Wed, 28 Nov 2018 21:07:25 +0800
-Subject: [PATCH] mtd: spinand: add support for GigaDevice GD5FxGQ4xA
-
-Add support for GigaDevice GD5F1G/2G/4GQ4xA SPI NAND.
-
-Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
-Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
-Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
----
- drivers/mtd/nand/spi/Makefile | 2 +-
- drivers/mtd/nand/spi/core.c | 1 +
- drivers/mtd/nand/spi/gigadevice.c | 148 ++++++++++++++++++++++++++++++++++++++
- include/linux/mtd/spinand.h | 1 +
- 4 files changed, 151 insertions(+), 1 deletion(-)
- create mode 100644 drivers/mtd/nand/spi/gigadevice.c
-
---- a/drivers/mtd/nand/spi/Makefile
-+++ b/drivers/mtd/nand/spi/Makefile
-@@ -1,3 +1,3 @@
- # SPDX-License-Identifier: GPL-2.0
--spinand-objs := core.o macronix.o micron.o winbond.o
-+spinand-objs := core.o gigadevice.o macronix.o micron.o winbond.o
- obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
---- a/drivers/mtd/nand/spi/core.c
-+++ b/drivers/mtd/nand/spi/core.c
-@@ -762,6 +762,7 @@ static const struct nand_ops spinand_ops
- };
-
- static const struct spinand_manufacturer *spinand_manufacturers[] = {
-+ &gigadevice_spinand_manufacturer,
- &macronix_spinand_manufacturer,
- &micron_spinand_manufacturer,
- &winbond_spinand_manufacturer,
---- /dev/null
-+++ b/drivers/mtd/nand/spi/gigadevice.c
-@@ -0,0 +1,148 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * Author:
-+ * Chuanhong Guo <gch981213@gmail.com>
-+ */
-+
-+#include <linux/device.h>
-+#include <linux/kernel.h>
-+#include <linux/mtd/spinand.h>
-+
-+#define SPINAND_MFR_GIGADEVICE 0xC8
-+#define GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS (1 << 4)
-+#define GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS (3 << 4)
-+
-+static SPINAND_OP_VARIANTS(read_cache_variants,
-+ SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
-+ SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
-+ SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
-+ SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
-+ SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
-+ SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
-+
-+static SPINAND_OP_VARIANTS(write_cache_variants,
-+ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
-+ SPINAND_PROG_LOAD(true, 0, NULL, 0));
-+
-+static SPINAND_OP_VARIANTS(update_cache_variants,
-+ SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
-+ SPINAND_PROG_LOAD(false, 0, NULL, 0));
-+
-+static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section,
-+ struct mtd_oob_region *region)
-+{
-+ if (section > 3)
-+ return -ERANGE;
-+
-+ region->offset = (16 * section) + 8;
-+ region->length = 8;
-+
-+ return 0;
-+}
-+
-+static int gd5fxgq4xa_ooblayout_free(struct mtd_info *mtd, int section,
-+ struct mtd_oob_region *region)
-+{
-+ if (section > 3)
-+ return -ERANGE;
-+
-+ if (section) {
-+ region->offset = 16 * section;
-+ region->length = 8;
-+ } else {
-+ /* section 0 has one byte reserved for bad block mark */
-+ region->offset = 1;
-+ region->length = 7;
-+ }
-+ return 0;
-+}
-+
-+static int gd5fxgq4xa_ecc_get_status(struct spinand_device *spinand,
-+ u8 status)
-+{
-+ switch (status & STATUS_ECC_MASK) {
-+ case STATUS_ECC_NO_BITFLIPS:
-+ return 0;
-+
-+ case GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS:
-+ /* 1-7 bits are flipped. return the maximum. */
-+ return 7;
-+
-+ case GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS:
-+ return 8;
-+
-+ case STATUS_ECC_UNCOR_ERROR:
-+ return -EBADMSG;
-+
-+ default:
-+ break;
-+ }
-+
-+ return -EINVAL;
-+}
-+
-+static const struct mtd_ooblayout_ops gd5fxgq4xa_ooblayout = {
-+ .ecc = gd5fxgq4xa_ooblayout_ecc,
-+ .free = gd5fxgq4xa_ooblayout_free,
-+};
-+
-+static const struct spinand_info gigadevice_spinand_table[] = {
-+ SPINAND_INFO("GD5F1GQ4xA", 0xF1,
-+ NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1),
-+ NAND_ECCREQ(8, 512),
-+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+ &write_cache_variants,
-+ &update_cache_variants),
-+ 0,
-+ SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
-+ gd5fxgq4xa_ecc_get_status)),
-+ SPINAND_INFO("GD5F2GQ4xA", 0xF2,
-+ NAND_MEMORG(1, 2048, 64, 64, 2048, 1, 1, 1),
-+ NAND_ECCREQ(8, 512),
-+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+ &write_cache_variants,
-+ &update_cache_variants),
-+ 0,
-+ SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
-+ gd5fxgq4xa_ecc_get_status)),
-+ SPINAND_INFO("GD5F4GQ4xA", 0xF4,
-+ NAND_MEMORG(1, 2048, 64, 64, 4096, 1, 1, 1),
-+ NAND_ECCREQ(8, 512),
-+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+ &write_cache_variants,
-+ &update_cache_variants),
-+ 0,
-+ SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
-+ gd5fxgq4xa_ecc_get_status)),
-+};
-+
-+static int gigadevice_spinand_detect(struct spinand_device *spinand)
-+{
-+ u8 *id = spinand->id.data;
-+ int ret;
-+
-+ /*
-+ * For GD NANDs, There is an address byte needed to shift in before IDs
-+ * are read out, so the first byte in raw_id is dummy.
-+ */
-+ if (id[1] != SPINAND_MFR_GIGADEVICE)
-+ return 0;
-+
-+ ret = spinand_match_and_init(spinand, gigadevice_spinand_table,
-+ ARRAY_SIZE(gigadevice_spinand_table),
-+ id[2]);
-+ if (ret)
-+ return ret;
-+
-+ return 1;
-+}
-+
-+static const struct spinand_manufacturer_ops gigadevice_spinand_manuf_ops = {
-+ .detect = gigadevice_spinand_detect,
-+};
-+
-+const struct spinand_manufacturer gigadevice_spinand_manufacturer = {
-+ .id = SPINAND_MFR_GIGADEVICE,
-+ .name = "GigaDevice",
-+ .ops = &gigadevice_spinand_manuf_ops,
-+};
---- a/include/linux/mtd/spinand.h
-+++ b/include/linux/mtd/spinand.h
-@@ -194,6 +194,7 @@ struct spinand_manufacturer {
- };
-
- /* SPI NAND manufacturers */
-+extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;
- extern const struct spinand_manufacturer macronix_spinand_manufacturer;
- extern const struct spinand_manufacturer micron_spinand_manufacturer;
- extern const struct spinand_manufacturer winbond_spinand_manufacturer;
diff --git a/target/linux/generic/backport-4.19/451-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch b/target/linux/generic/backport-4.19/451-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch
deleted file mode 100644
index f6d6764707..0000000000
--- a/target/linux/generic/backport-4.19/451-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From c40c7a990a46e5102a1cc4190557bf315d32d80d Mon Sep 17 00:00:00 2001
-From: Stefan Roese <sr@denx.de>
-Date: Thu, 24 Jan 2019 13:48:06 +0100
-Subject: [PATCH] mtd: spinand: Add support for GigaDevice GD5F1GQ4UExxG
-
-Add support for GigaDevice GD5F1GQ4UExxG SPI NAND chip.
-
-Signed-off-by: Stefan Roese <sr@denx.de>
-Cc: Chuanhong Guo <gch981213@gmail.com>
-Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
-Cc: Miquel Raynal <miquel.raynal@bootlin.com>
-Cc: Boris Brezillon <bbrezillon@kernel.org>
-Reviewed-by: Boris Brezillon <bbrezillon@kernel.org>
-Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
----
- drivers/mtd/nand/spi/gigadevice.c | 83 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 83 insertions(+)
-
---- a/drivers/mtd/nand/spi/gigadevice.c
-+++ b/drivers/mtd/nand/spi/gigadevice.c
-@@ -12,6 +12,8 @@
- #define GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS (1 << 4)
- #define GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS (3 << 4)
-
-+#define GD5FXGQ4UEXXG_REG_STATUS2 0xf0
-+
- static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
-@@ -81,11 +83,83 @@ static int gd5fxgq4xa_ecc_get_status(str
- return -EINVAL;
- }
-
-+static int gd5fxgq4uexxg_ooblayout_ecc(struct mtd_info *mtd, int section,
-+ struct mtd_oob_region *region)
-+{
-+ if (section)
-+ return -ERANGE;
-+
-+ region->offset = 64;
-+ region->length = 64;
-+
-+ return 0;
-+}
-+
-+static int gd5fxgq4uexxg_ooblayout_free(struct mtd_info *mtd, int section,
-+ struct mtd_oob_region *region)
-+{
-+ if (section)
-+ return -ERANGE;
-+
-+ /* Reserve 1 bytes for the BBM. */
-+ region->offset = 1;
-+ region->length = 63;
-+
-+ return 0;
-+}
-+
-+static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand,
-+ u8 status)
-+{
-+ u8 status2;
-+ struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQ4UEXXG_REG_STATUS2,
-+ &status2);
-+ int ret;
-+
-+ switch (status & STATUS_ECC_MASK) {
-+ case STATUS_ECC_NO_BITFLIPS:
-+ return 0;
-+
-+ case GD5FXGQ4XA_STATUS_ECC_1_7_BITFLIPS:
-+ /*
-+ * Read status2 register to determine a more fine grained
-+ * bit error status
-+ */
-+ ret = spi_mem_exec_op(spinand->spimem, &op);
-+ if (ret)
-+ return ret;
-+
-+ /*
-+ * 4 ... 7 bits are flipped (1..4 can't be detected, so
-+ * report the maximum of 4 in this case
-+ */
-+ /* bits sorted this way (3...0): ECCS1,ECCS0,ECCSE1,ECCSE0 */
-+ return ((status & STATUS_ECC_MASK) >> 2) |
-+ ((status2 & STATUS_ECC_MASK) >> 4);
-+
-+ case GD5FXGQ4XA_STATUS_ECC_8_BITFLIPS:
-+ return 8;
-+
-+ case STATUS_ECC_UNCOR_ERROR:
-+ return -EBADMSG;
-+
-+ default:
-+ break;
-+ }
-+
-+ return -EINVAL;
-+}
-+
- static const struct mtd_ooblayout_ops gd5fxgq4xa_ooblayout = {
- .ecc = gd5fxgq4xa_ooblayout_ecc,
- .free = gd5fxgq4xa_ooblayout_free,
- };
-
-+static const struct mtd_ooblayout_ops gd5fxgq4uexxg_ooblayout = {
-+ .ecc = gd5fxgq4uexxg_ooblayout_ecc,
-+ .free = gd5fxgq4uexxg_ooblayout_free,
-+};
-+
- static const struct spinand_info gigadevice_spinand_table[] = {
- SPINAND_INFO("GD5F1GQ4xA", 0xF1,
- NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1),
-@@ -114,6 +188,15 @@ static const struct spinand_info gigadev
- 0,
- SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout,
- gd5fxgq4xa_ecc_get_status)),
-+ SPINAND_INFO("GD5F1GQ4UExxG", 0xd1,
-+ NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
-+ NAND_ECCREQ(8, 512),
-+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+ &write_cache_variants,
-+ &update_cache_variants),
-+ 0,
-+ SPINAND_ECCINFO(&gd5fxgq4uexxg_ooblayout,
-+ gd5fxgq4uexxg_ecc_get_status)),
- };
-
- static int gigadevice_spinand_detect(struct spinand_device *spinand)
diff --git a/target/linux/generic/backport-4.19/500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch b/target/linux/generic/backport-4.19/500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch
deleted file mode 100644
index 7bd3ed9fad..0000000000
--- a/target/linux/generic/backport-4.19/500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From d62e98ed1efcaa94caa004f622944afdce5f1c3c Mon Sep 17 00:00:00 2001
-From: Gabor Juhos <juhosg@openwrt.org>
-Date: Sun, 9 Dec 2018 18:12:13 +0100
-Subject: [PATCH] ubifs: Fix default compression selection in ubifs
-
-When ubifs is build without the LZO compressor and no compressor is
-given the creation of the default file system will fail. before
-selection the LZO compressor check if it is present and if not fall back
-to the zlib or none.
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-Signed-off-by: Richard Weinberger <richard@nod.at>
----
- fs/ubifs/sb.c | 13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
-
---- a/fs/ubifs/sb.c
-+++ b/fs/ubifs/sb.c
-@@ -63,6 +63,17 @@
- /* Default time granularity in nanoseconds */
- #define DEFAULT_TIME_GRAN 1000000000
-
-+static int get_default_compressor(struct ubifs_info *c)
-+{
-+ if (ubifs_compr_present(c, UBIFS_COMPR_LZO))
-+ return UBIFS_COMPR_LZO;
-+
-+ if (ubifs_compr_present(c, UBIFS_COMPR_ZLIB))
-+ return UBIFS_COMPR_ZLIB;
-+
-+ return UBIFS_COMPR_NONE;
-+}
-+
- /**
- * create_default_filesystem - format empty UBI volume.
- * @c: UBIFS file-system description object
-@@ -186,7 +197,7 @@ static int create_default_filesystem(str
- if (c->mount_opts.override_compr)
- sup->default_compr = cpu_to_le16(c->mount_opts.compr_type);
- else
-- sup->default_compr = cpu_to_le16(UBIFS_COMPR_LZO);
-+ sup->default_compr = cpu_to_le16(get_default_compressor(c));
-
- generate_random_uuid(sup->uuid);
-