--- a/Makefile
+++ b/Makefile
-@@ -431,8 +431,8 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/s
+@@ -454,8 +454,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 ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
+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 MAKE LEX YACC AWK INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
depends on NETFILTER_ADVANCED
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -25,6 +25,9 @@ obj-$(CONFIG_NETFILTER_NETLINK_OSF) += n
+@@ -26,6 +26,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
+ obj-$(CONFIG_NF_CT_NETLINK) += nf_conntrack_netlink.o
+ obj-$(CONFIG_NF_CT_NETLINK_TIMEOUT) += nfnetlink_cttimeout.o
--- /dev/null
+++ b/net/netfilter/nf_conntrack_rtcache.c
@@ -0,0 +1,428 @@
+++ /dev/null
-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
+++ /dev/null
-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;
+++ /dev/null
-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;
-
+++ /dev/null
-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;
-
+++ /dev/null
-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);
+++ /dev/null
-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)
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
-@@ -272,6 +272,23 @@ static void dwc2_set_param_power_down(st
+@@ -273,6 +273,23 @@ static void dwc2_set_param_power_down(st
hsotg->params.power_down = val;
}
/**
* dwc2_set_default_params() - Set all core parameters to their
* auto-detected default values.
-@@ -290,6 +307,7 @@ static void dwc2_set_default_params(stru
+@@ -291,6 +308,7 @@ static void dwc2_set_default_params(stru
dwc2_set_param_speed(hsotg);
dwc2_set_param_phy_utmi_width(hsotg);
dwc2_set_param_power_down(hsotg);
p->phy_ulpi_ddr = false;
p->phy_ulpi_ext_vbus = false;
-@@ -302,11 +320,6 @@ static void dwc2_set_default_params(stru
+@@ -303,11 +321,6 @@ static void dwc2_set_default_params(stru
p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
p->uframe_sched = true;
p->external_id_pin_ctl = false;
- p->hird_threshold_en = true;
- p->hird_threshold = 4;
p->ipg_isoc_en = false;
+ p->service_interval = false;
p->max_packet_count = hw->max_packet_count;
- p->max_transfer_size = hw->max_transfer_size;
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
-@@ -531,5 +531,35 @@ void nf_flow_table_free(struct nf_flowta
+@@ -501,5 +501,35 @@ void nf_flow_table_free(struct nf_flowta
}
EXPORT_SYMBOL_GPL(nf_flow_table_free);
+ if (event != NETDEV_DOWN)
+ return NOTIFY_DONE;
+
-+ nf_flow_table_cleanup(dev_net(dev), dev);
++ nf_flow_table_cleanup(dev);
+
+ return NOTIFY_DONE;
+}
- if (event != NETDEV_DOWN)
- return NOTIFY_DONE;
-
-- nf_flow_table_cleanup(dev_net(dev), dev);
+- nf_flow_table_cleanup(dev);
-
- return NOTIFY_DONE;
-}
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)) &&
(ip_hdr(skb)->frag_off & htons(IP_DF)) != 0)
-@@ -465,7 +465,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
+@@ -464,7 +464,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
dir = tuplehash->tuple.dir;
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
--- 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
+@@ -1209,18 +1209,6 @@ static bool gc_worker_can_early_drop(con
return false;
}
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
+@@ -1257,10 +1245,8 @@ static void gc_worker(struct work_struct
tmp = nf_ct_tuplehash_to_ctrack(h);
scanned++;
flow->timeout = (u32)jiffies;
return 0;
}
-@@ -316,6 +335,8 @@ static int nf_flow_offload_gc_step(struc
- rhashtable_walk_start(&hti);
-
- while ((tuplehash = rhashtable_walk_next(&hti))) {
-+ bool teardown;
+@@ -301,9 +320,14 @@ static inline bool nf_flow_has_expired(c
+ static void nf_flow_offload_gc_step(struct flow_offload *flow, void *data)
+ {
+ struct nf_flowtable *flow_table = data;
++ bool teardown;
+
- if (IS_ERR(tuplehash)) {
- err = PTR_ERR(tuplehash);
- if (err != -EAGAIN)
-@@ -328,9 +349,13 @@ static int nf_flow_offload_gc_step(struc
++ teardown = flow->flags & (FLOW_OFFLOAD_DYING | FLOW_OFFLOAD_TEARDOWN);
++
++ if (!teardown)
++ nf_ct_offload_timeout(flow);
- flow = container_of(tuplehash, struct flow_offload, tuplehash[0]);
+- if (nf_flow_has_expired(flow) ||
+- (flow->flags & (FLOW_OFFLOAD_DYING | FLOW_OFFLOAD_TEARDOWN)))
++ if (nf_flow_has_expired(flow) || teardown)
+ flow_offload_del(flow_table, flow);
+ }
-- 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:
+#endif /* __NET_TC_CTINFO_H */
--- 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,
+@@ -105,6 +105,7 @@ enum tca_id {
+ TCA_ID_IFE = TCA_ACT_IFE,
+ TCA_ID_SAMPLE = TCA_ACT_SAMPLE,
/* other actions go here */
-- __TCA_ID_MAX=255
+ TCA_ID_CTINFO,
-+ __TCA_ID_MAX = 255
+ __TCA_ID_MAX = 255
};
- #define TCA_ID_MAX __TCA_ID_MAX
--- /dev/null
+++ b/include/uapi/linux/tc_act/tc_ctinfo.h
@@ -0,0 +1,29 @@
+#endif
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
-@@ -866,6 +866,23 @@ config NET_ACT_CONNMARK
+@@ -876,6 +876,23 @@ config NET_ACT_CONNMARK
To compile this code as a module, choose M here: the
module will be called act_connmark.
+++ /dev/null
-From 8c6c37fdc20ec9ffaa342f827a8e20afe736fb0c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
-Date: Wed, 9 Jan 2019 17:09:44 +0100
-Subject: [PATCH] sch_cake: Correctly update parent qlen when splitting GSO
- packets
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-To ensure parent qdiscs have the same notion of the number of enqueued
-packets even after splitting a GSO packet, update the qdisc tree with the
-number of packets that was added due to the split.
-
-Reported-by: Pete Heist <pete@heistp.net>
-Tested-by: Pete Heist <pete@heistp.net>
-Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
----
- net/sched/sch_cake.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
---- a/net/sched/sch_cake.c
-+++ b/net/sched/sch_cake.c
-@@ -1666,7 +1666,7 @@ static s32 cake_enqueue(struct sk_buff *
- if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) {
- struct sk_buff *segs, *nskb;
- netdev_features_t features = netif_skb_features(skb);
-- unsigned int slen = 0;
-+ unsigned int slen = 0, numsegs = 0;
-
- segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
- if (IS_ERR_OR_NULL(segs))
-@@ -1682,6 +1682,7 @@ static s32 cake_enqueue(struct sk_buff *
- flow_queue_add(flow, segs);
-
- sch->q.qlen++;
-+ numsegs++;
- slen += segs->len;
- q->buffer_used += segs->truesize;
- b->packets++;
-@@ -1695,7 +1696,7 @@ static s32 cake_enqueue(struct sk_buff *
- sch->qstats.backlog += slen;
- q->avg_window_bytes += slen;
-
-- qdisc_tree_reduce_backlog(sch, 1, len);
-+ qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen);
- consume_skb(skb);
- } else {
- /* not splitting */
+++ /dev/null
-From 712639929912c5eefb09facccb48d55b3f72c9f8 Mon Sep 17 00:00:00 2001
-From: George Amanakis <gamanakis@gmail.com>
-Date: Fri, 1 Mar 2019 16:04:05 +0100
-Subject: [PATCH] sch_cake: Make the dual modes fairer
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-CAKE host fairness does not work well with TCP flows in dual-srchost and
-dual-dsthost setup. The reason is that ACKs generated by TCP flows are
-classified as sparse flows, and affect flow isolation from other hosts. Fix
-this by calculating host_load based only on the bulk flows a host
-generates. In a hash collision the host_bulk_flow_count values must be
-decremented on the old hosts and incremented on the new ones *if* the queue
-is in the bulk set.
-
-Reported-by: Pete Heist <peteheist@gmail.com>
-Signed-off-by: George Amanakis <gamanakis@gmail.com>
-Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
----
- net/sched/sch_cake.c | 92 ++++++++++++++++++++++++++++++--------------
- 1 file changed, 63 insertions(+), 29 deletions(-)
-
---- a/net/sched/sch_cake.c
-+++ b/net/sched/sch_cake.c
-@@ -138,8 +138,8 @@ struct cake_flow {
- struct cake_host {
- u32 srchost_tag;
- u32 dsthost_tag;
-- u16 srchost_refcnt;
-- u16 dsthost_refcnt;
-+ u16 srchost_bulk_flow_count;
-+ u16 dsthost_bulk_flow_count;
- };
-
- struct cake_heap_entry {
-@@ -746,8 +746,10 @@ skip_hash:
- * queue, accept the collision, update the host tags.
- */
- q->way_collisions++;
-- q->hosts[q->flows[reduced_hash].srchost].srchost_refcnt--;
-- q->hosts[q->flows[reduced_hash].dsthost].dsthost_refcnt--;
-+ if (q->flows[outer_hash + k].set == CAKE_SET_BULK) {
-+ q->hosts[q->flows[reduced_hash].srchost].srchost_bulk_flow_count--;
-+ q->hosts[q->flows[reduced_hash].dsthost].dsthost_bulk_flow_count--;
-+ }
- allocate_src = cake_dsrc(flow_mode);
- allocate_dst = cake_ddst(flow_mode);
- found:
-@@ -767,13 +769,14 @@ found:
- }
- for (i = 0; i < CAKE_SET_WAYS;
- i++, k = (k + 1) % CAKE_SET_WAYS) {
-- if (!q->hosts[outer_hash + k].srchost_refcnt)
-+ if (!q->hosts[outer_hash + k].srchost_bulk_flow_count)
- break;
- }
- q->hosts[outer_hash + k].srchost_tag = srchost_hash;
- found_src:
- srchost_idx = outer_hash + k;
-- q->hosts[srchost_idx].srchost_refcnt++;
-+ if (q->flows[reduced_hash].set == CAKE_SET_BULK)
-+ q->hosts[srchost_idx].srchost_bulk_flow_count++;
- q->flows[reduced_hash].srchost = srchost_idx;
- }
-
-@@ -789,13 +792,14 @@ found_src:
- }
- for (i = 0; i < CAKE_SET_WAYS;
- i++, k = (k + 1) % CAKE_SET_WAYS) {
-- if (!q->hosts[outer_hash + k].dsthost_refcnt)
-+ if (!q->hosts[outer_hash + k].dsthost_bulk_flow_count)
- break;
- }
- q->hosts[outer_hash + k].dsthost_tag = dsthost_hash;
- found_dst:
- dsthost_idx = outer_hash + k;
-- q->hosts[dsthost_idx].dsthost_refcnt++;
-+ if (q->flows[reduced_hash].set == CAKE_SET_BULK)
-+ q->hosts[dsthost_idx].dsthost_bulk_flow_count++;
- q->flows[reduced_hash].dsthost = dsthost_idx;
- }
- }
-@@ -1793,20 +1797,30 @@ static s32 cake_enqueue(struct sk_buff *
- b->sparse_flow_count++;
-
- if (cake_dsrc(q->flow_mode))
-- host_load = max(host_load, srchost->srchost_refcnt);
-+ host_load = max(host_load, srchost->srchost_bulk_flow_count);
-
- if (cake_ddst(q->flow_mode))
-- host_load = max(host_load, dsthost->dsthost_refcnt);
-+ host_load = max(host_load, dsthost->dsthost_bulk_flow_count);
-
- flow->deficit = (b->flow_quantum *
- quantum_div[host_load]) >> 16;
- } else if (flow->set == CAKE_SET_SPARSE_WAIT) {
-+ struct cake_host *srchost = &b->hosts[flow->srchost];
-+ struct cake_host *dsthost = &b->hosts[flow->dsthost];
-+
- /* this flow was empty, accounted as a sparse flow, but actually
- * in the bulk rotation.
- */
- flow->set = CAKE_SET_BULK;
- b->sparse_flow_count--;
- b->bulk_flow_count++;
-+
-+ if (cake_dsrc(q->flow_mode))
-+ srchost->srchost_bulk_flow_count++;
-+
-+ if (cake_ddst(q->flow_mode))
-+ dsthost->dsthost_bulk_flow_count++;
-+
- }
-
- if (q->buffer_used > q->buffer_max_used)
-@@ -1974,23 +1988,8 @@ retry:
- dsthost = &b->hosts[flow->dsthost];
- host_load = 1;
-
-- if (cake_dsrc(q->flow_mode))
-- host_load = max(host_load, srchost->srchost_refcnt);
--
-- if (cake_ddst(q->flow_mode))
-- host_load = max(host_load, dsthost->dsthost_refcnt);
--
-- WARN_ON(host_load > CAKE_QUEUES);
--
- /* flow isolation (DRR++) */
- if (flow->deficit <= 0) {
-- /* The shifted prandom_u32() is a way to apply dithering to
-- * avoid accumulating roundoff errors
-- */
-- flow->deficit += (b->flow_quantum * quantum_div[host_load] +
-- (prandom_u32() >> 16)) >> 16;
-- list_move_tail(&flow->flowchain, &b->old_flows);
--
- /* Keep all flows with deficits out of the sparse and decaying
- * rotations. No non-empty flow can go into the decaying
- * rotation, so they can't get deficits
-@@ -1999,6 +1998,13 @@ retry:
- if (flow->head) {
- b->sparse_flow_count--;
- b->bulk_flow_count++;
-+
-+ if (cake_dsrc(q->flow_mode))
-+ srchost->srchost_bulk_flow_count++;
-+
-+ if (cake_ddst(q->flow_mode))
-+ dsthost->dsthost_bulk_flow_count++;
-+
- flow->set = CAKE_SET_BULK;
- } else {
- /* we've moved it to the bulk rotation for
-@@ -2008,6 +2014,22 @@ retry:
- flow->set = CAKE_SET_SPARSE_WAIT;
- }
- }
-+
-+ if (cake_dsrc(q->flow_mode))
-+ host_load = max(host_load, srchost->srchost_bulk_flow_count);
-+
-+ if (cake_ddst(q->flow_mode))
-+ host_load = max(host_load, dsthost->dsthost_bulk_flow_count);
-+
-+ WARN_ON(host_load > CAKE_QUEUES);
-+
-+ /* The shifted prandom_u32() is a way to apply dithering to
-+ * avoid accumulating roundoff errors
-+ */
-+ flow->deficit += (b->flow_quantum * quantum_div[host_load] +
-+ (prandom_u32() >> 16)) >> 16;
-+ list_move_tail(&flow->flowchain, &b->old_flows);
-+
- goto retry;
- }
-
-@@ -2028,6 +2050,13 @@ retry:
- &b->decaying_flows);
- if (flow->set == CAKE_SET_BULK) {
- b->bulk_flow_count--;
-+
-+ if (cake_dsrc(q->flow_mode))
-+ srchost->srchost_bulk_flow_count--;
-+
-+ if (cake_ddst(q->flow_mode))
-+ dsthost->dsthost_bulk_flow_count--;
-+
- b->decaying_flow_count++;
- } else if (flow->set == CAKE_SET_SPARSE ||
- flow->set == CAKE_SET_SPARSE_WAIT) {
-@@ -2041,14 +2070,19 @@ retry:
- if (flow->set == CAKE_SET_SPARSE ||
- flow->set == CAKE_SET_SPARSE_WAIT)
- b->sparse_flow_count--;
-- else if (flow->set == CAKE_SET_BULK)
-+ else if (flow->set == CAKE_SET_BULK) {
- b->bulk_flow_count--;
-- else
-+
-+ if (cake_dsrc(q->flow_mode))
-+ srchost->srchost_bulk_flow_count--;
-+
-+ if (cake_ddst(q->flow_mode))
-+ dsthost->dsthost_bulk_flow_count--;
-+
-+ } else
- b->decaying_flow_count--;
-
- flow->set = CAKE_SET_NONE;
-- srchost->srchost_refcnt--;
-- dsthost->dsthost_refcnt--;
- }
- goto begin;
- }
+++ /dev/null
-From 0b5c7efdfc6e389ec6840579fe90bdb6f42b08dc Mon Sep 17 00:00:00 2001
-From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-Date: Fri, 1 Mar 2019 16:04:05 +0100
-Subject: [PATCH] sch_cake: Permit use of connmarks as tin classifiers
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add flag 'FWMARK' to enable use of firewall connmarks as tin selector.
-The connmark (skbuff->mark) needs to be in the range 1->tin_cnt ie.
-for diffserv3 the mark needs to be 1->3.
-
-Background
-
-Typically CAKE uses DSCP as the basis for tin selection. DSCP values
-are relatively easily changed as part of the egress path, usually with
-iptables & the mangle table, ingress is more challenging. CAKE is often
-used on the WAN interface of a residential gateway where passthrough of
-DSCP from the ISP is either missing or set to unhelpful values thus use
-of ingress DSCP values for tin selection isn't helpful in that
-environment.
-
-An approach to solving the ingress tin selection problem is to use
-CAKE's understanding of tc filters. Naive tc filters could match on
-source/destination port numbers and force tin selection that way, but
-multiple filters don't scale particularly well as each filter must be
-traversed whether it matches or not. e.g. a simple example to map 3
-firewall marks to tins:
-
-MAJOR=$( tc qdisc show dev $DEV | head -1 | awk '{print $3}' )
-tc filter add dev $DEV parent $MAJOR protocol all handle 0x01 fw action skbedit priority ${MAJOR}1
-tc filter add dev $DEV parent $MAJOR protocol all handle 0x02 fw action skbedit priority ${MAJOR}2
-tc filter add dev $DEV parent $MAJOR protocol all handle 0x03 fw action skbedit priority ${MAJOR}3
-
-Another option is to use eBPF cls_act with tc filters e.g.
-
-MAJOR=$( tc qdisc show dev $DEV | head -1 | awk '{print $3}' )
-tc filter add dev $DEV parent $MAJOR bpf da obj my-bpf-fwmark-to-class.o
-
-This has the disadvantages of a) needing someone to write & maintain
-the bpf program, b) a bpf toolchain to compile it and c) needing to
-hardcode the major number in the bpf program so it matches the cake
-instance (or forcing the cake instance to a particular major number)
-since the major number cannot be passed to the bpf program via tc
-command line.
-
-As already hinted at by the previous examples, it would be helpful
-to associate tins with something that survives the Internet path and
-ideally allows tin selection on both egress and ingress. Netfilter's
-conntrack permits setting an identifying mark on a connection which
-can also be restored to an ingress packet with tc action connmark e.g.
-
-tc filter add dev eth0 parent ffff: protocol all prio 10 u32 \
- match u32 0 0 flowid 1:1 action connmark action mirred egress redirect dev ifb1
-
-Since tc's connmark action has restored any connmark into skb->mark,
-any of the previous solutions are based upon it and in one form or
-another copy that mark to the skb->priority field where again CAKE
-picks this up.
-
-This change cuts out at least one of the (less intuitive &
-non-scalable) middlemen and permit direct access to skb->mark.
-
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- include/uapi/linux/pkt_sched.h | 1 +
- net/sched/sch_cake.c | 34 +++++++++++++++++++++++++++-------
- 2 files changed, 28 insertions(+), 7 deletions(-)
-
---- a/include/uapi/linux/pkt_sched.h
-+++ b/include/uapi/linux/pkt_sched.h
-@@ -991,6 +991,7 @@ enum {
- TCA_CAKE_INGRESS,
- TCA_CAKE_ACK_FILTER,
- TCA_CAKE_SPLIT_GSO,
-+ TCA_CAKE_FWMARK,
- __TCA_CAKE_MAX
- };
- #define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1)
---- a/net/sched/sch_cake.c
-+++ b/net/sched/sch_cake.c
-@@ -258,7 +258,8 @@ enum {
- CAKE_FLAG_AUTORATE_INGRESS = BIT(1),
- CAKE_FLAG_INGRESS = BIT(2),
- CAKE_FLAG_WASH = BIT(3),
-- CAKE_FLAG_SPLIT_GSO = BIT(4)
-+ CAKE_FLAG_SPLIT_GSO = BIT(4),
-+ CAKE_FLAG_FWMARK = BIT(5)
- };
-
- /* COBALT operates the Codel and BLUE algorithms in parallel, in order to
-@@ -2623,6 +2624,13 @@ static int cake_change(struct Qdisc *sch
- q->rate_flags &= ~CAKE_FLAG_SPLIT_GSO;
- }
-
-+ if (tb[TCA_CAKE_FWMARK]) {
-+ if (!!nla_get_u32(tb[TCA_CAKE_FWMARK]))
-+ q->rate_flags |= CAKE_FLAG_FWMARK;
-+ else
-+ q->rate_flags &= ~CAKE_FLAG_FWMARK;
-+ }
-+
- if (q->tins) {
- sch_tree_lock(sch);
- cake_reconfigure(sch);
-@@ -2782,6 +2790,10 @@ static int cake_dump(struct Qdisc *sch,
- !!(q->rate_flags & CAKE_FLAG_SPLIT_GSO)))
- goto nla_put_failure;
-
-+ if (nla_put_u32(skb, TCA_CAKE_FWMARK,
-+ !!(q->rate_flags & CAKE_FLAG_FWMARK)))
-+ goto nla_put_failure;
-+
- return nla_nest_end(skb, opts);
-
- nla_put_failure:
+++ /dev/null
-From eab2fc822af38f31fd5f4e731b5d10b94904d919 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
-Date: Thu, 14 Mar 2019 23:08:22 +0100
-Subject: [PATCH] sch_cake: Interpret fwmark parameter as a bitmask
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-We initially interpreted the fwmark parameter as a flag that simply turned
-on the feature, using the whole skb->mark field as the index into the CAKE
-tin_order array. However, it is quite common for different applications to
-use different parts of the mask field for their own purposes, each using a
-different mask.
-
-Support this use of subsets of the mark by interpreting the TCA_CAKE_FWMARK
-parameter as a bitmask to apply to the fwmark field when reading it. The
-result will be right-shifted by the number of unset lower bits of the mask
-before looking up the tin.
-
-In the original commit message we also failed to credit Felix Resch with
-originally suggesting the fwmark feature back in 2017; so the Suggested-By
-in this commit covers the whole fwmark feature.
-
-Fixes: 0b5c7efdfc6e ("sch_cake: Permit use of connmarks as tin classifiers")
-Suggested-by: Felix Resch <fuller@beif.de>
-Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
----
- net/sched/sch_cake.c | 25 ++++++++++++-------------
- 1 file changed, 12 insertions(+), 13 deletions(-)
-
---- a/net/sched/sch_cake.c
-+++ b/net/sched/sch_cake.c
-@@ -211,6 +211,9 @@ struct cake_sched_data {
- u8 ack_filter;
- u8 atm_mode;
-
-+ u32 fwmark_mask;
-+ u16 fwmark_shft;
-+
- /* time_next = time_this + ((len * rate_ns) >> rate_shft) */
- u16 rate_shft;
- ktime_t time_next_packet;
-@@ -258,8 +261,7 @@ enum {
- CAKE_FLAG_AUTORATE_INGRESS = BIT(1),
- CAKE_FLAG_INGRESS = BIT(2),
- CAKE_FLAG_WASH = BIT(3),
-- CAKE_FLAG_SPLIT_GSO = BIT(4),
-- CAKE_FLAG_FWMARK = BIT(5)
-+ CAKE_FLAG_SPLIT_GSO = BIT(4)
- };
-
- /* COBALT operates the Codel and BLUE algorithms in parallel, in order to
-@@ -1554,7 +1556,7 @@ static struct cake_tin_data *cake_select
- struct sk_buff *skb)
- {
- struct cake_sched_data *q = qdisc_priv(sch);
-- u32 tin;
-+ u32 tin, mark;
- u8 dscp;
-
- /* Tin selection: Default to diffserv-based selection, allow overriding
-@@ -1562,6 +1564,7 @@ static struct cake_tin_data *cake_select
- */
- dscp = cake_handle_diffserv(skb,
- q->rate_flags & CAKE_FLAG_WASH);
-+ mark = (skb->mark & q->fwmark_mask) >> q->fwmark_shft;
-
- if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
- tin = 0;
-@@ -2178,6 +2181,7 @@ static const struct nla_policy cake_poli
- [TCA_CAKE_MPU] = { .type = NLA_U32 },
- [TCA_CAKE_INGRESS] = { .type = NLA_U32 },
- [TCA_CAKE_ACK_FILTER] = { .type = NLA_U32 },
-+ [TCA_CAKE_FWMARK] = { .type = NLA_U32 },
- };
-
- static void cake_set_rate(struct cake_tin_data *b, u64 rate, u32 mtu,
-@@ -2625,10 +2629,8 @@ static int cake_change(struct Qdisc *sch
- }
-
- if (tb[TCA_CAKE_FWMARK]) {
-- if (!!nla_get_u32(tb[TCA_CAKE_FWMARK]))
-- q->rate_flags |= CAKE_FLAG_FWMARK;
-- else
-- q->rate_flags &= ~CAKE_FLAG_FWMARK;
-+ q->fwmark_mask = nla_get_u32(tb[TCA_CAKE_FWMARK]);
-+ q->fwmark_shft = q->fwmark_mask ? __ffs(q->fwmark_mask) : 0;
- }
-
- if (q->tins) {
-@@ -2790,8 +2792,7 @@ static int cake_dump(struct Qdisc *sch,
- !!(q->rate_flags & CAKE_FLAG_SPLIT_GSO)))
- goto nla_put_failure;
-
-- if (nla_put_u32(skb, TCA_CAKE_FWMARK,
-- !!(q->rate_flags & CAKE_FLAG_FWMARK)))
-+ if (nla_put_u32(skb, TCA_CAKE_FWMARK, q->fwmark_mask))
- goto nla_put_failure;
-
- return nla_nest_end(skb, opts);
+++ /dev/null
-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,
- ¯onix_spinand_manufacturer,
- µn_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;
+++ /dev/null
-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)
+++ /dev/null
-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);
-
# CONFIG_104_QUAD_8 is not set
CONFIG_32BIT=y
+CONFIG_64BIT_TIME=y
# CONFIG_6LOWPAN is not set
# CONFIG_6LOWPAN_DEBUGFS is not set
# CONFIG_6PACK is not set
# CONFIG_AR7 is not set
# CONFIG_AR8216_PHY is not set
# CONFIG_AR8216_PHY_LEDS is not set
+CONFIG_ARCH_32BIT_OFF_T=y
# CONFIG_ARCH_ACTIONS is not set
# CONFIG_ARCH_ALPINE is not set
# CONFIG_ARCH_ARTPEC is not set
# CONFIG_CB710_CORE is not set
# CONFIG_CC10001_ADC is not set
# CONFIG_CCS811 is not set
+CONFIG_CC_HAS_ASM_GOTO=y
CONFIG_CC_HAS_SANCOV_TRACE_PC=y
CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
+CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
CONFIG_CC_IS_GCC=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_COMPACTION=y
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_COMPAT is not set
+CONFIG_COMPAT_32BIT_TIME=y
# CONFIG_COMPAT_BRK is not set
# CONFIG_COMPILE_TEST is not set
# CONFIG_CONFIGFS_FS is not set
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_CRYPTO=y
# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_ADIANTUM is not set
# CONFIG_CRYPTO_AEAD is not set
# CONFIG_CRYPTO_AEGIS128 is not set
# CONFIG_CRYPTO_AEGIS128L is not set
# CONFIG_CRYPTO_MORUS640 is not set
# CONFIG_CRYPTO_MORUS640_SSE2 is not set
# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_OFB is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_PCOMP is not set
# CONFIG_CRYPTO_PCOMP2 is not set
# CONFIG_CRYPTO_SM3 is not set
# CONFIG_CRYPTO_SM4 is not set
# CONFIG_CRYPTO_SPECK is not set
+# CONFIG_CRYPTO_STREEBOG is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TEST is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EFI is not set
CONFIG_EFI_PARTITION=y
+CONFIG_EFI_EARLYCON=y
# CONFIG_EFS_FS is not set
CONFIG_ELFCORE=y
# CONFIG_ELF_CORE is not set
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_FM10K is not set
# CONFIG_FMC is not set
+CONFIG_FONT_8x16=y
+CONFIG_FONT_AUTOSELECT=y
+CONFIG_FONT_SUPPORT=y
# CONFIG_FORCEDETH is not set
CONFIG_FORCE_MAX_ZONEORDER=11
CONFIG_FORTIFY_SOURCE=y
# CONFIG_GPIO_ADNP is not set
# CONFIG_GPIO_ADP5588 is not set
# CONFIG_GPIO_ALTERA is not set
+# CONFIG_GPIO_AMD_FCH is not set
# CONFIG_GPIO_AMD8111 is not set
# CONFIG_GPIO_AMDPT is not set
# CONFIG_GPIO_BCM_KONA is not set
# CONFIG_GPIO_BT8XX is not set
+# CONFIG_GPIO_CADENCE is not set
# CONFIG_GPIO_CS5535 is not set
# CONFIG_GPIO_DWAPB is not set
# CONFIG_GPIO_EM is not set
# CONFIG_GPIO_PL061 is not set
# CONFIG_GPIO_RCAR is not set
# CONFIG_GPIO_RDC321X is not set
+# CONFIG_GPIO_SAMA5D2_PIOBU is not set
# CONFIG_GPIO_SCH is not set
# CONFIG_GPIO_SCH311X is not set
# CONFIG_GPIO_SX150X is not set
# CONFIG_GS_FPGABOOT is not set
# CONFIG_GTP is not set
# CONFIG_GUP_BENCHMARK is not set
+# CONFIG_HABANA_AI is not set
# CONFIG_HAMACHI is not set
# CONFIG_HAMRADIO is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_I2C_XILINX is not set
+# CONFIG_I3C is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_I6300ESB_WDT is not set
# CONFIG_IFB is not set
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
+# CONFIG_IGC is not set
# CONFIG_IIO is not set
# CONFIG_IIO_BUFFER_CB is not set
# CONFIG_IIO_BUFFER_HW_CONSUMER is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_MSM_VIBRATOR is not set
# CONFIG_INPUT_PALMAS_PWRBUTTON is not set
# CONFIG_INPUT_PCF8574 is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INTEL_TH is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_INTERCONNECT is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_INV_MPU6050_I2C is not set
# CONFIG_INV_MPU6050_IIO is not set
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IO_STRICT_DEVMEM=y
+CONFIG_IO_URING=y
# CONFIG_IP17XX_PHY is not set
# CONFIG_IP6_NF_FILTER is not set
# CONFIG_IP6_NF_IPTABLES is not set
# CONFIG_KALLSYMS_UNCOMPRESSED is not set
# CONFIG_KARMA_PARTITION is not set
# CONFIG_KASAN is not set
+CONFIG_KASAN_STACK=1
# CONFIG_KCOV is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_CAT is not set
# CONFIG_LEDS_TLC591XX is not set
CONFIG_LEDS_TRIGGERS=y
# CONFIG_LEDS_TRIGGER_ACTIVITY is not set
+# CONFIG_LEDS_TRIGGER_AUDIO is not set
# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
# CONFIG_LEDS_TRIGGER_CAMERA is not set
# CONFIG_LEDS_TRIGGER_CPU is not set
CONFIG_LEDS_TRIGGER_NETDEV=y
# CONFIG_LEDS_TRIGGER_ONESHOT is not set
# CONFIG_LEDS_TRIGGER_PANIC is not set
+# CONFIG_LEDS_TRIGGER_PATTERN is not set
CONFIG_LEDS_TRIGGER_TIMER=y
# CONFIG_LEDS_TRIGGER_TRANSIENT is not set
# CONFIG_LEDS_USER is not set
# CONFIG_LPC_SCH is not set
# CONFIG_LP_CONSOLE is not set
# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_LSM="yama,loadpin,safesetid,integrity"
# CONFIG_LTC2471 is not set
# CONFIG_LTC2485 is not set
# CONFIG_LTC2497 is not set
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set
# CONFIG_MDIO_DEVICE is not set
# CONFIG_MDIO_HISI_FEMAC is not set
# CONFIG_MDIO_MSCC_MIIM is not set
# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TPS68470 is not set
# CONFIG_MFD_TPS80031 is not set
+# CONFIG_MFD_TQMX86 is not set
# CONFIG_MFD_VIPERBOARD is not set
# CONFIG_MFD_VX855 is not set
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MIPS_ALCHEMY is not set
# CONFIG_MIPS_CDMM is not set
# CONFIG_MIPS_COBALT is not set
-# CONFIG_MIPS_FPU_EMULATOR is not set
+CONFIG_MIPS_FP_SUPPORT=y
# CONFIG_MIPS_GENERIC is not set
# CONFIG_MIPS_MALTA is not set
# CONFIG_MIPS_O32_FP64_SUPPORT is not set
# CONFIG_MIPS_PARAVIRT is not set
# CONFIG_MIPS_PLATFORM_DEVICES is not set
# CONFIG_MIPS_SEAD3 is not set
+# CONFIG_MISC_ALCOR_PCI is not set
CONFIG_MISC_FILESYSTEMS=y
# CONFIG_MISC_RTSX_PCI is not set
# CONFIG_MISC_RTSX_USB is not set
# CONFIG_NET_SCH_SFB is not set
# CONFIG_NET_SCH_SFQ is not set
# CONFIG_NET_SCH_SKBPRIO is not set
+# CONFIG_NET_SCH_TAPRIO is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCTPPROBE is not set
# CONFIG_NF_TABLES_SET is not set
# CONFIG_NF_TPROXY_IPV4 is not set
# CONFIG_NF_TPROXY_IPV6 is not set
+# CONFIG_NI_XGE_MANAGEMENT_ENET is not set
# CONFIG_NI65 is not set
# CONFIG_NI903X_WDT is not set
# CONFIG_NIC7018_WDT is not set
# CONFIG_PCIEPORTBUS is not set
# CONFIG_PCIE_ALTERA is not set
# CONFIG_PCIE_ARMADA_8K is not set
+# CONFIG_PCIE_BW is not set
# CONFIG_PCIE_CADENCE_HOST is not set
# CONFIG_PCIE_DPC is not set
# CONFIG_PCIE_DW_PLAT is not set
# CONFIG_PHONET is not set
# CONFIG_PHYLIB is not set
# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_PHY_CADENCE_DP is not set
+# CONFIG_PHY_CADENCE_DPHY is not set
+# CONFIG_PHY_CADENCE_SIERRA is not set
# CONFIG_PHY_CPCAP_USB is not set
# CONFIG_PHY_EXYNOS_DP_VIDEO is not set
# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set
+# CONFIG_PHY_FSL_IMX8MQ_USB is not set
# CONFIG_PHY_MAPPHONE_MDM6600 is not set
+# CONFIG_PHY_OCELOT_SERDES is not set
# CONFIG_PHY_PXA_28NM_HSIC is not set
# CONFIG_PHY_PXA_28NM_USB2 is not set
# CONFIG_PHY_QCOM_DWC3 is not set
# CONFIG_PINCTRL_EXYNOS is not set
# CONFIG_PINCTRL_EXYNOS5440 is not set
# CONFIG_PINCTRL_ICELAKE is not set
+# CONFIG_PINCTRL_INGENIC is not set
# CONFIG_PINCTRL_MCP23S08 is not set
# CONFIG_PINCTRL_MSM8X74 is not set
+# CONFIG_PINCTRL_OCELOT is not set
CONFIG_PINCTRL_SINGLE=y
# CONFIG_PINCTRL_SX150X is not set
CONFIG_PINMUX=y
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_PRINTK=y
+# CONFIG_PRINTK_CALLER is not set
CONFIG_PRINTK_NMI=y
CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
# CONFIG_PRINTK_TIME is not set
# CONFIG_PROVE_RCU_REPEATEDLY is not set
# CONFIG_PSAMPLE is not set
# CONFIG_PSB6970_PHY is not set
+# CONFIG_PSI is not set
# CONFIG_PSTORE is not set
# CONFIG_PTP_1588_CLOCK is not set
# CONFIG_PTP_1588_CLOCK_IXP46X is not set
# CONFIG_PTP_1588_CLOCK_KVM is not set
# CONFIG_PTP_1588_CLOCK_PCH is not set
# CONFIG_PUBLIC_KEY_ALGO_RSA is not set
+# CONFIG_PVPANIC is not set
# CONFIG_PWM is not set
# CONFIG_PWM_FSL_FTM is not set
# CONFIG_PWM_PCA9685 is not set
# CONFIG_SCSI_MVSAS is not set
# CONFIG_SCSI_MVSAS_DEBUG is not set
# CONFIG_SCSI_MVUMI is not set
+# CONFIG_SCSI_MYRB is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NETLINK is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SPI_MEM is not set
# CONFIG_SPI_MPC52xx is not set
# CONFIG_SPI_MPC52xx_PSC is not set
+# CONFIG_SPI_MTK_QUADSPI is not set
+# CONFIG_SPI_MXIC is not set
+# CONFIG_SPI_NXP_FLEXSPI is not set
# CONFIG_SPI_OCTEON is not set
# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_ORION is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_S3C64XX is not set
# CONFIG_SPI_SC18IS602 is not set
+# CONFIG_SPI_SIFIVE is not set
# CONFIG_SPI_SLAVE is not set
# CONFIG_SPI_SPIDEV is not set
# CONFIG_SPI_THUNDERX is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_MEMCAT_P is not set
# CONFIG_TEST_OVERFLOW is not set
# CONFIG_TEST_POWER is not set
# CONFIG_TEST_PRINTF is not set
# CONFIG_TEST_RHASHTABLE is not set
# CONFIG_TEST_SORT is not set
+# CONFIG_TEST_STACKINIT is not set
# CONFIG_TEST_STATIC_KEYS is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_SYSCTL is not set
# CONFIG_TEST_UDELAY is not set
# CONFIG_TEST_USER_COPY is not set
# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_VMALLOC is not set
+# CONFIG_TEST_XARRAY is not set
CONFIG_TEXTSEARCH=y
# CONFIG_TEXTSEARCH_BM is not set
# CONFIG_TEXTSEARCH_FSM is not set
# CONFIG_TI_AM335X_ADC is not set
# CONFIG_TI_CPSW is not set
# CONFIG_TI_CPSW_ALE is not set
+# CONFIG_TI_CPSW_PHY_SEL is not set
# CONFIG_TI_CPTS is not set
# CONFIG_TI_DAC082S085 is not set
# CONFIG_TI_DAC5571 is not set
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARMLINUX=y
# CONFIG_USB_ATM is not set
+CONFIG_USB_AUTOSUSPEND_DELAY=2
# CONFIG_USB_BDC_UDC is not set
CONFIG_USB_BELKIN=y
# CONFIG_USB_C67X00_HCD is not set
# CONFIG_UTS_NS is not set
# CONFIG_UWB is not set
# CONFIG_U_SERIAL_CONSOLE is not set
+CONFIG_VALIDATE_FS_PARSER=y
# CONFIG_V4L_MEM2MEM_DRIVERS is not set
# CONFIG_V4L_TEST_DRIVERS is not set
# CONFIG_VBOXGUEST is not set
val = swahb32(val);
}
-#ifdef CONFIG_LANTIQ
- val = swab32(val);
-#endif
-
- __raw_writel(val, mem + reg);
+ writel(val, mem + reg);
udelay(100);
}
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/switch.h>
+#include <linux/version.h>
#include <asm/io.h>
#include <asm/irq.h>
static int adm6996_config_init(struct phy_device *pdev)
{
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmode) = { 0, };
+#endif
struct adm6996_priv *priv;
int ret;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, linkmode);
+ linkmode_copy(pdev->supported, linkmode);
+ linkmode_copy(pdev->advertising, pdev->supported);
+#else
pdev->supported = ADVERTISED_100baseT_Full;
pdev->advertising = ADVERTISED_100baseT_Full;
+#endif
if (pdev->mdio.addr != 0) {
pr_info ("%s: PHY overlaps ADM6996, providing fixed PHY 0x%x.\n"
struct switch_port_link link;
/* check for switch port link changes */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,20,0)
+ if ((phydev->state == PHY_RUNNING) || (phydev->state == PHY_NOLINK))
+#else
if (phydev->state == PHY_CHANGELINK)
+#endif
ar8xxx_check_link_states(priv);
if (phydev->mdio.addr != 0)
static int
ar8xxx_phy_probe(struct phy_device *phydev)
{
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmode) = { 0, };
+#endif
struct ar8xxx_priv *priv;
struct switch_dev *swdev;
int ret;
if (phydev->mdio.addr == 0) {
if (ar8xxx_has_gige(priv)) {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+ linkmode);
+#else
phydev->supported = SUPPORTED_1000baseT_Full;
phydev->advertising = ADVERTISED_1000baseT_Full;
+#endif
} else {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
+ linkmode);
+#else
phydev->supported = SUPPORTED_100baseT_Full;
phydev->advertising = ADVERTISED_100baseT_Full;
+#endif
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_copy(phydev->supported, linkmode);
+ linkmode_copy(phydev->advertising, phydev->supported);
+#endif
+
if (priv->chip->config_at_probe) {
priv->phy = phydev;
}
} else {
if (ar8xxx_has_gige(priv)) {
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+ linkmode);
+ linkmode_copy(phydev->supported, linkmode);
+ linkmode_copy(phydev->advertising, phydev->supported);
+#else
phydev->supported |= SUPPORTED_1000baseT_Full;
phydev->advertising |= ADVERTISED_1000baseT_Full;
+#endif
}
if (priv->chip->phy_rgmii_set)
priv->chip->phy_rgmii_set(priv, phydev);
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/if_vlan.h>
+#include <linux/version.h>
#include <asm/io.h>
#include <asm/irq.h>
static int
mvswitch_config_init(struct phy_device *pdev)
{
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmode) = { 0, };
+#endif
struct mvswitch_priv *priv = to_mvsw(pdev);
struct net_device *dev = pdev->attached_dev;
u8 vlmap = 0;
return -EINVAL;
printk("%s: Marvell 88E6060 PHY driver attached.\n", dev->name);
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, linkmode);
+ linkmode_copy(pdev->supported, linkmode);
+ linkmode_copy(pdev->advertising, pdev->supported);
+#else
pdev->supported = ADVERTISED_100baseT_Full;
pdev->advertising = ADVERTISED_100baseT_Full;
+#endif
dev->phy_ptr = priv;
pdev->irq = PHY_POLL;
#ifdef HEADER_MODE
#include <linux/netdevice.h>
#include <linux/switch.h>
#include <linux/phy.h>
+#include <linux/version.h>
#define PSB6970_MAX_VLANS 16
#define PSB6970_NUM_PORTS 7
static int psb6970_config_init(struct phy_device *pdev)
{
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmode) = { 0, };
+#endif
struct psb6970_priv *priv;
struct net_device *dev = pdev->attached_dev;
struct switch_dev *swdev;
return 0;
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(4,19,0)
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, linkmode);
+ linkmode_copy(pdev->supported, linkmode);
+ linkmode_copy(pdev->advertising, pdev->supported);
+#else
pdev->supported = pdev->advertising = SUPPORTED_100baseT_Full;
+#endif
mutex_init(&priv->reg_mutex);
priv->read = psb6970_mii_read;
--- a/include/linux/module.h
+++ b/include/linux/module.h
-@@ -160,6 +160,7 @@ extern void cleanup_module(void);
+@@ -159,6 +159,7 @@ extern void cleanup_module(void);
/* Generic info of form tag = "info" */
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
/* For userspace: you can also call me... */
#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
-@@ -203,12 +204,12 @@ extern void cleanup_module(void);
+@@ -218,12 +219,12 @@ extern void cleanup_module(void);
* Author(s), use "Name <email>" or just "Name", for multiple
* authors use multiple MODULE_AUTHOR() statements/lines.
*/
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
-@@ -235,7 +236,9 @@ extern typeof(name) __mod_##type##__##na
+@@ -250,7 +251,9 @@ extern typeof(name) __mod_##type##__##na
*/
#if defined(MODULE) || !defined(CONFIG_SYSFS)
#else
#define MODULE_VERSION(_version) \
static struct module_version_attribute ___modver_attr = { \
-@@ -257,7 +260,7 @@ extern typeof(name) __mod_##type##__##na
+@@ -272,7 +275,7 @@ extern typeof(name) __mod_##type##__##na
/* Optional firmware file (or files) needed by the module
* format is simply firmware file name. Multiple firmware
* files require multiple MODULE_FIRMWARE() specifiers */
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1997,6 +1997,13 @@ config TRIM_UNUSED_KSYMS
+@@ -2054,6 +2054,13 @@ config TRIM_UNUSED_KSYMS
If unsure, or if you need to build out-of-tree modules, say N.
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
-@@ -3009,9 +3009,11 @@ static int setup_load_info(struct load_i
+@@ -3007,9 +3007,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
-@@ -3032,6 +3034,7 @@ static int check_modinfo(struct module *
+@@ -3030,6 +3032,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
-@@ -1971,7 +1971,9 @@ static void read_symbols(const char *mod
+@@ -1978,7 +1978,9 @@ static void read_symbols(const char *mod
symname = remove_dot(info.strtab + sym->st_name);
handle_modversions(mod, &info, sym, symname);
}
if (!is_vmlinux(modname) || vmlinux_section_warnings)
check_sec_ref(mod, modname, &info);
-@@ -2134,8 +2136,10 @@ static void add_header(struct buffer *b,
+@@ -2155,8 +2157,10 @@ static void add_header(struct buffer *b,
buf_printf(b, "\n");
buf_printf(b, "BUILD_SALT;\n");
buf_printf(b, "\n");
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
-@@ -2152,8 +2156,10 @@ static void add_header(struct buffer *b,
+@@ -2173,8 +2177,10 @@ static void add_header(struct buffer *b,
static void add_intree_flag(struct buffer *b, int is_intree)
{
}
/* Cannot check for assembler */
-@@ -2166,8 +2172,10 @@ static void add_retpoline(struct buffer
+@@ -2187,8 +2193,10 @@ static void add_retpoline(struct buffer
static void add_staging_flag(struct buffer *b, const char *name)
{
}
/**
-@@ -2266,11 +2274,13 @@ static void add_depends(struct buffer *b
+@@ -2276,11 +2284,13 @@ static void add_depends(struct buffer *b
static void add_srcversion(struct buffer *b, struct module *mod)
{
}
static void write_if_changed(struct buffer *b, const char *fname)
-@@ -2507,7 +2517,9 @@ int main(int argc, char **argv)
+@@ -2509,7 +2519,9 @@ int main(int argc, char **argv)
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
- add_depends(&buf, mod, modules);
+ add_depends(&buf, mod);
+#ifndef CONFIG_MODULE_STRIPPED
add_moddevtable(&buf, mod);
+#endif
--- a/Makefile
+++ b/Makefile
-@@ -1224,7 +1224,6 @@ all: modules
+@@ -1263,7 +1263,6 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1253,7 +1252,6 @@ _modinst_:
+@@ -1292,7 +1291,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
-@@ -78,7 +78,7 @@ modorder-target := $(obj)/modules.order
+@@ -70,7 +70,7 @@ endif
# We keep a list of all modules in $(MODVERDIR)
__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
--- a/Makefile
+++ b/Makefile
-@@ -294,6 +294,11 @@ else
- scripts/Kbuild.include: ;
+@@ -318,6 +318,11 @@ else
+
include scripts/Kbuild.include
+ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
-@@ -780,11 +785,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
+@@ -806,11 +811,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -98,6 +98,7 @@ config ARM
+@@ -101,6 +101,7 @@ config ARM
select HAVE_UID16
select HAVE_VIRT_CPU_ACCOUNTING_GEN
select IRQ_FORCED_THREADING
+ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
select MODULES_USE_ELF_REL
select NEED_DMA_MAP_STATE
- select NO_BOOTMEM
+ select OF_EARLY_FLATTREE if OF
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
-@@ -106,6 +106,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y)
+@@ -107,6 +107,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
endif
__stubs_end = .; \
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -43,6 +43,7 @@ config MIPS
+@@ -46,6 +46,7 @@ config MIPS
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS)
select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS)
select HAVE_CONTEXT_TRACKING
select HAVE_COPY_THREAD_TLS
select HAVE_C_RECORDMCOUNT
---- a/arch/mips/kernel/vmlinux.lds.S
-+++ b/arch/mips/kernel/vmlinux.lds.S
-@@ -72,7 +72,7 @@ SECTIONS
- /* Exception table for data bus errors */
- __dbe_table : {
- __start___dbe_table = .;
-- *(__dbe_table)
-+ KEEP(*(__dbe_table))
- __stop___dbe_table = .;
- }
-
-@@ -123,7 +123,7 @@ SECTIONS
- . = ALIGN(4);
- .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
- __mips_machines_start = .;
-- *(.mips.machines.init)
-+ KEEP(*(.mips.machines.init))
- __mips_machines_end = .;
- }
-
/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)
-@@ -372,14 +382,14 @@
+@@ -384,14 +394,14 @@
/* Kernel symbol table: Normal symbols */ \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
__start___ksymtab = .; \
__stop___ksymtab_gpl = .; \
} \
\
-@@ -441,7 +451,7 @@
+@@ -453,7 +463,7 @@
\
/* Kernel symbol table: strings */ \
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
} \
\
/* __*init sections */ \
-@@ -841,6 +851,8 @@
+@@ -842,6 +852,8 @@
EXIT_TEXT \
EXIT_DATA \
EXIT_CALL \
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
-@@ -408,7 +408,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
+@@ -371,7 +371,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(
# Linker scripts preprocessor (.lds.S -> .lds)
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds_S = LDS $@
{ {0x02, 0x21}, "lz4", unlz4 },
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
-@@ -324,7 +324,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
+@@ -347,7 +347,7 @@ quiet_cmd_bzip2 = BZIP2 $@
+ # ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@
- cmd_lzma = (cat $(filter-out FORCE,$^) | \
-- lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
-+ lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
- (rm -f $@ ; false)
+- cmd_lzma = { cat $(real-prereqs) | lzma -9 && $(size_append); } > $@
++ cmd_lzma = { cat $(real-prereqs) | lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(size_append); } > $@
quiet_cmd_lzo = LZO $@
+ cmd_lzo = { cat $(real-prereqs) | lzop -9 && $(size_append); } > $@
--- a/usr/gen_initramfs_list.sh
+++ b/usr/gen_initramfs_list.sh
@@ -229,7 +229,7 @@ cpio_list=
depends on NETFILTER_ADVANCED
help
H.323 is a VoIP signalling protocol from ITU-T. As one of the most
-@@ -1077,7 +1076,6 @@ config NETFILTER_XT_TARGET_SECMARK
+@@ -1081,7 +1080,6 @@ config NETFILTER_XT_TARGET_SECMARK
config NETFILTER_XT_TARGET_TCPMSS
tristate '"TCPMSS" target support'
bool
--- a/lib/Kconfig
+++ b/lib/Kconfig
-@@ -377,16 +377,16 @@ config BCH_CONST_T
+@@ -385,16 +385,16 @@ config BCH_CONST_T
# Textsearch support is select'ed if needed
#
config TEXTSEARCH
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/of.h>
-@@ -3037,3 +3038,5 @@ static int __init regmap_initcall(void)
+@@ -3120,3 +3121,5 @@ static int __init regmap_initcall(void)
return 0;
}
postcore_initcall(regmap_initcall);
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
-@@ -71,6 +71,7 @@ config OF_IRQ
+@@ -72,6 +72,7 @@ config OF_IRQ
config OF_NET
depends on NETDEVICES
---
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
-@@ -683,16 +683,48 @@ static inline void prot##extra##blast_##
+@@ -617,14 +617,46 @@ static inline void prot##extra##blast_##
unsigned long end) \
{ \
unsigned long lsize = cpu_##desc##_line_size(); \
+ unsigned long aend = (end + lsize - 1) & ~(lsize - 1); \
+ int lines = (aend - addr) / lsize; \
\
- __##pfx##flush_prologue \
- \
- while (1) { \
+ while (lines >= 8) { \
+ prot##cache_op(hitop, addr); \
- break; \
- addr += lsize; \
} \
- \
- __##pfx##flush_epilogue \
+ }
+
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -1143,6 +1143,10 @@ config SYNC_R4K
+@@ -1148,6 +1148,10 @@ config SYNC_R4K
config MIPS_MACHINE
def_bool n
+++ b/arch/mips/kernel/head.S
@@ -79,6 +79,12 @@ FEXPORT(__kernel_entry)
j kernel_entry
- #endif
+ #endif /* CONFIG_BOOT_RAW */
+#ifdef CONFIG_IMAGE_CMDLINE_HACK
+ .ascii "CMDLINE:"
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
-@@ -60,20 +60,6 @@ machine-$(CONFIG_PPC64) += 64
+@@ -64,20 +64,6 @@ machine-$(CONFIG_PPC64) += 64
machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le
UTS_MACHINE := $(subst $(space),,$(machine-y))
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
-@@ -416,19 +416,14 @@ out_free_page:
+@@ -417,19 +417,14 @@ out_free_page:
return ret;
}
ret = -EOPNOTSUPP;
goto out;
}
-@@ -457,7 +452,9 @@ static void lo_complete_rq(struct reques
+@@ -458,7 +453,9 @@ static void lo_complete_rq(struct reques
if (!cmd->use_aio || cmd->ret < 0 || cmd->ret == blk_rq_bytes(rq) ||
req_op(rq) != REQ_OP_READ) {
case REQ_OP_WRITE:
if (lo->transfer)
return lo_write_transfer(lo, rq, pos);
-@@ -853,6 +855,21 @@ static void loop_config_discard(struct l
+@@ -852,6 +854,21 @@ static void loop_config_discard(struct l
struct file *file = lo->lo_backing_file;
struct inode *inode = file->f_mapping->host;
struct request_queue *q = lo->lo_queue;
/*
* We use punch hole to reclaim the free space used by the
-@@ -860,22 +877,24 @@ static void loop_config_discard(struct l
+@@ -859,22 +876,24 @@ static void loop_config_discard(struct l
* encryption is enabled, because it may give an attacker
* useful information.
*/
}
static void loop_unprepare_queue(struct loop_device *lo)
-@@ -1893,7 +1912,10 @@ static void loop_handle_cmd(struct loop_
+@@ -1892,7 +1911,10 @@ static void loop_handle_cmd(struct loop_
failed:
/* complete non-aio request */
if (!cmd->use_aio || ret) {
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
-@@ -163,6 +163,8 @@ struct nf_flow_table_hw {
+@@ -159,6 +159,8 @@ struct nf_flow_table_hw {
int nf_flow_table_hw_register(const struct nf_flow_table_hw *offload);
void nf_flow_table_hw_unregister(const struct nf_flow_table_hw *offload);
/* For layer 4 checksum field offset. */
#include <linux/tcp.h>
#include <linux/udp.h>
-@@ -268,6 +269,7 @@ nf_flow_offload_ip_hook(void *priv, stru
+@@ -267,6 +268,7 @@ nf_flow_offload_ip_hook(void *priv, stru
skb->dev = outdev;
nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
skb_dst_set_noref(skb, &rt->dst);
neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb);
return NF_STOLEN;
-@@ -488,6 +490,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
+@@ -486,6 +488,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
skb->dev = outdev;
nexthop = rt6_nexthop(rt, &flow->tuplehash[!dir].tuple.src_v6);
skb_dst_set_noref(skb, &rt->dst);
--- /dev/null
+From f116460ff4e55b4ea3c648486fb33bfa83408a39 Mon Sep 17 00:00:00 2001
+From: Mathias Kresin <dev@kresin.me>
+Date: Sun, 7 Jul 2019 11:47:33 +0200
+Subject: [PATCH] Revert "netfilter: nf_flow_table: make
+ nf_flow_table_iterate() static"
+
+This reverts commit 49de9c090f3cc747cb7f2dc79c175d7bd1d3f1e7.
+---
+ include/net/netfilter/nf_flow_table.h | 4 ++++
+ net/netfilter/nf_flow_table_core.c | 8 ++++----
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+--- a/include/net/netfilter/nf_flow_table.h
++++ b/include/net/netfilter/nf_flow_table.h
+@@ -118,6 +118,10 @@ void flow_offload_free(struct flow_offlo
+ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow);
+ struct flow_offload_tuple_rhash *flow_offload_lookup(struct nf_flowtable *flow_table,
+ struct flow_offload_tuple *tuple);
++int nf_flow_table_iterate(struct nf_flowtable *flow_table,
++ void (*iter)(struct flow_offload *flow, void *data),
++ void *data);
++
+ void nf_flow_table_cleanup(struct net_device *dev);
+
+ int nf_flow_table_init(struct nf_flowtable *flow_table);
+--- a/net/netfilter/nf_flow_table_core.c
++++ b/net/netfilter/nf_flow_table_core.c
+@@ -307,10 +307,9 @@ flow_offload_lookup(struct nf_flowtable
+ }
+ EXPORT_SYMBOL_GPL(flow_offload_lookup);
+
+-static int
+-nf_flow_table_iterate(struct nf_flowtable *flow_table,
+- void (*iter)(struct flow_offload *flow, void *data),
+- void *data)
++int nf_flow_table_iterate(struct nf_flowtable *flow_table,
++ void (*iter)(struct flow_offload *flow, void *data),
++ void *data)
+ {
+ struct flow_offload_tuple_rhash *tuplehash;
+ struct rhashtable_iter hti;
+@@ -340,6 +339,7 @@ nf_flow_table_iterate(struct nf_flowtabl
+
+ return err;
+ }
++EXPORT_SYMBOL_GPL(nf_flow_table_iterate);
+
+ static inline bool nf_flow_has_expired(const struct flow_offload *flow)
+ {
depends on !NF_CONNTRACK || NF_CONNTRACK
--- a/net/ipv6/netfilter/Kconfig
+++ b/net/ipv6/netfilter/Kconfig
-@@ -80,7 +80,6 @@ config NFT_FIB_IPV6
+@@ -52,7 +52,6 @@ config NFT_FIB_IPV6
multicast or blackhole.
endif # NF_TABLES_IPV6
config NF_FLOW_TABLE_IPV6
tristate "Netfilter flow table IPv6 module"
-@@ -90,6 +89,8 @@ config NF_FLOW_TABLE_IPV6
+@@ -62,6 +61,8 @@ config NF_FLOW_TABLE_IPV6
To compile it as a module, choose M here.
depends on !NF_CONNTRACK || NF_CONNTRACK
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -693,8 +693,6 @@ config NFT_FIB_NETDEV
+@@ -697,8 +697,6 @@ config NFT_FIB_NETDEV
endif # NF_TABLES_NETDEV
config NF_FLOW_TABLE_INET
tristate "Netfilter flow table mixed IPv4/IPv6 module"
depends on NF_FLOW_TABLE
-@@ -703,11 +701,12 @@ config NF_FLOW_TABLE_INET
+@@ -707,11 +705,12 @@ config NF_FLOW_TABLE_INET
To compile it as a module, choose M here.
help
This option adds the flow table core infrastructure.
-@@ -996,6 +995,15 @@ config NETFILTER_XT_TARGET_NOTRACK
+@@ -1000,6 +999,15 @@ config NETFILTER_XT_TARGET_NOTRACK
depends on NETFILTER_ADVANCED
select NETFILTER_XT_TARGET_CT
depends on NETFILTER_ADVANCED
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -144,6 +144,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF
+@@ -142,6 +142,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF
obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o
obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
-@@ -481,12 +481,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
+@@ -564,12 +564,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
extern struct Qdisc_ops pfifo_fast_ops;
extern struct Qdisc_ops mq_qdisc_ops;
extern struct Qdisc_ops noqueue_qdisc_ops;
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
-@@ -2157,7 +2157,7 @@ static int __init pktsched_init(void)
+@@ -2238,7 +2238,7 @@ static int __init pktsched_init(void)
return err;
}
EXPORT_SYMBOL(default_qdisc_ops);
/* Main transmission queue. */
-@@ -1004,7 +1004,7 @@ static void attach_one_default_qdisc(str
+@@ -1044,7 +1044,7 @@ static void attach_one_default_qdisc(str
void *_unused)
{
struct Qdisc *qdisc;
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
-@@ -595,207 +595,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
+@@ -607,207 +607,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
.owner = THIS_MODULE,
};
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
-@@ -209,6 +209,89 @@ config LED_TRIGGER_PHY
+@@ -224,6 +224,89 @@ config LED_TRIGGER_PHY
for any speed known to the PHY.
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
-@@ -548,6 +548,12 @@ struct phy_driver {
+@@ -526,6 +526,12 @@ struct phy_driver {
/* Determines the negotiated speed and duplex */
int (*read_status)(struct phy_device *phydev);
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1506,6 +1506,9 @@ int genphy_update_link(struct phy_device
+@@ -1707,6 +1707,9 @@ int genphy_update_link(struct phy_device
{
int status;
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1514,6 +1514,7 @@ enum netdev_priv_flags {
+@@ -1558,6 +1558,7 @@ enum netdev_priv_flags {
IFF_FAILOVER_SLAVE = 1<<28,
IFF_L3MDEV_RX_HANDLER = 1<<29,
IFF_LIVE_RENAME_OK = 1<<30,
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
-@@ -1546,6 +1547,7 @@ enum netdev_priv_flags {
+@@ -1590,6 +1591,7 @@ enum netdev_priv_flags {
#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK
/**
* struct net_device - The DEVICE structure.
-@@ -1844,6 +1846,11 @@ struct net_device {
+@@ -1885,6 +1887,11 @@ struct net_device {
const struct tlsdev_ops *tlsdev_ops;
#endif
const struct header_ops *header_ops;
unsigned int flags;
-@@ -1919,6 +1926,10 @@ struct net_device {
+@@ -1960,6 +1967,10 @@ struct net_device {
struct mpls_dev __rcu *mpls_ptr;
#endif
*/
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2529,6 +2529,10 @@ static inline int pskb_trim(struct sk_bu
+@@ -2625,6 +2625,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
-@@ -2660,16 +2664,6 @@ static inline struct sk_buff *dev_alloc_
+@@ -2756,16 +2760,6 @@ static inline struct sk_buff *dev_alloc_
}
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -3252,10 +3252,20 @@ static int xmit_one(struct sk_buff *skb,
- if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
+@@ -3287,10 +3287,20 @@ static int xmit_one(struct sk_buff *skb,
+ if (dev_nit_active(dev))
dev_queue_xmit_nit(skb, dev);
- len = skb->len;
#include <net/protocol.h>
#include <net/dst.h>
-@@ -503,6 +504,22 @@ skb_fail:
+@@ -506,6 +507,22 @@ skb_fail:
}
EXPORT_SYMBOL(__napi_alloc_skb);
{
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
-@@ -172,6 +172,12 @@ __be16 eth_type_trans(struct sk_buff *sk
+@@ -173,6 +173,12 @@ __be16 eth_type_trans(struct sk_buff *sk
const struct ethhdr *eth;
skb->dev = dev;
#include <linux/bcm47xx_nvram.h>
#include <linux/phy.h>
#include <linux/phy_fixed.h>
-@@ -1409,6 +1410,17 @@ static const struct ethtool_ops bgmac_et
+@@ -1407,6 +1408,17 @@ static const struct ethtool_ops bgmac_et
.set_link_ksettings = phy_ethtool_set_link_ksettings,
};
/**************************************************
* MII
**************************************************/
-@@ -1540,6 +1552,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
+@@ -1538,6 +1550,14 @@ int bgmac_enet_probe(struct bgmac *bgmac
net_dev->hw_features = net_dev->features;
net_dev->vlan_features = net_dev->features;
err = register_netdev(bgmac->net_dev);
if (err) {
dev_err(bgmac->dev, "Cannot register net device\n");
-@@ -1562,6 +1582,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
+@@ -1560,6 +1580,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
void bgmac_enet_remove(struct bgmac *bgmac)
{
--- a/net/Kconfig
+++ b/net/Kconfig
-@@ -98,6 +98,9 @@ source "net/netlabel/Kconfig"
+@@ -101,6 +101,9 @@ source "net/netlabel/Kconfig"
endif # if INET
obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
- sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \
-+ dev_ioctl.o tso.o sock_reuseport.o \
- fib_notifier.o xdp.o
++ dev_ioctl.o tso.o sock_reuseport.o \
+ fib_notifier.o xdp.o flow_offload.o
+obj-$(CONFIG_SOCK_DIAG) += sock_diag.o
obj-y += net-sysfs.o
obj-$(CONFIG_PROC_FS) += net-procfs.o
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -490,6 +490,18 @@ discard_and_relse:
+@@ -544,6 +544,18 @@ discard_and_relse:
}
EXPORT_SYMBOL(__sk_receive_skb);
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = __sk_dst_get(sk);
-@@ -1598,9 +1610,11 @@ static void __sk_free(struct sock *sk)
+@@ -1736,9 +1748,11 @@ static void __sk_free(struct sock *sk)
if (likely(sk->sk_net_refcnt))
sock_inuse_add(sock_net(sk), -1);
Support for PF_PACKET sockets monitoring interface used by the ss tool.
--- a/net/unix/Kconfig
+++ b/net/unix/Kconfig
-@@ -22,6 +22,7 @@ config UNIX
+@@ -27,6 +27,7 @@ config UNIX_SCM
config UNIX_DIAG
tristate "UNIX: socket monitoring interface"
depends on UNIX
--- a/fs/locks.c
+++ b/fs/locks.c
-@@ -2786,6 +2786,8 @@ static const struct seq_operations locks
+@@ -2881,6 +2881,8 @@ static const struct seq_operations locks
static int __init proc_locks_init(void)
{
do { \
--- a/ipc/msg.c
+++ b/ipc/msg.c
-@@ -1291,6 +1291,9 @@ void __init msg_init(void)
+@@ -1316,6 +1316,9 @@ void __init msg_init(void)
{
msg_init_ns(&init_ipc_ns);
if (!root_irq_dir)
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
-@@ -374,6 +374,8 @@ static int __init init_timer_list_procfs
+@@ -369,6 +369,8 @@ static int __init init_timer_list_procfs
{
struct proc_dir_entry *pe;
if (!pe)
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
-@@ -2740,6 +2740,8 @@ static const struct seq_operations vmall
+@@ -2770,6 +2770,8 @@ static const struct seq_operations vmall
static int __init proc_vmalloc_init(void)
{
&vmalloc_op,
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
-@@ -1971,10 +1971,12 @@ void __init init_mm_internals(void)
+@@ -1968,10 +1968,12 @@ void __init init_mm_internals(void)
start_shepherd_timer();
#endif
#ifdef CONFIG_PROC_FS
--- a/net/core/sock.c
+++ b/net/core/sock.c
-@@ -3480,6 +3480,8 @@ static __net_initdata struct pernet_oper
+@@ -3557,6 +3557,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
-@@ -2717,11 +2717,13 @@ static const struct seq_operations fib_r
+@@ -2732,11 +2732,13 @@ static const struct seq_operations fib_r
int __net_init fib_proc_init(struct net *net)
{
fib_triestat_seq_show, NULL))
goto out2;
-@@ -2732,17 +2734,21 @@ int __net_init fib_proc_init(struct net
+@@ -2747,17 +2749,21 @@ int __net_init fib_proc_init(struct net
return 0;
out3:
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
-@@ -524,5 +524,8 @@ static __net_initdata struct pernet_oper
+@@ -525,5 +525,8 @@ static __net_initdata struct pernet_oper
int __init ip_misc_proc_init(void)
{
select IRQ_WORK
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
-@@ -1,3 +1,7 @@
+@@ -1,4 +1,8 @@
-obj-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o
-obj-$(CONFIG_SYNC_FILE) += sync_file.o
-obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
+dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
+
+dma-shared-buffer-objs := $(dma-buf-objs-y)
+ obj-$(CONFIG_UDMABUF) += udmabuf.o
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -34,6 +34,7 @@
#include <uapi/linux/dma-buf.h>
-@@ -1158,4 +1159,5 @@ static void __exit dma_buf_deinit(void)
+@@ -1147,4 +1148,5 @@ static void __exit dma_buf_deinit(void)
{
dma_buf_uninit_debugfs();
}
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
-@@ -2129,6 +2129,7 @@ int wake_up_state(struct task_struct *p,
+@@ -2177,6 +2177,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}
#endif /* _KOBJECT_H_ */
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
-@@ -688,6 +688,43 @@ int add_uevent_var(struct kobj_uevent_en
+@@ -690,6 +690,43 @@ int add_uevent_var(struct kobj_uevent_en
EXPORT_SYMBOL_GPL(add_uevent_var);
#if defined(CONFIG_NET)
+++ /dev/null
-From 6b1ab74a9917012d0c559edc4ed299d9228ac89f Mon Sep 17 00:00:00 2001
-From: Felix Fietkau <nbd@nbd.name>
-Date: Sat, 8 Jul 2017 08:26:47 +0200
-Subject: kernel: add the new 'crashlog' feature
-
-this tries to store kernel oops/panic logs in a fixed location in RAM to
-recover them available to user space using debugfs
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- include/linux/crashlog.h | 17 ++++
- init/Kconfig | 4 +
- kernel/Makefile | 1 +
- kernel/crashlog.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++
- kernel/module.c | 3 +
- mm/bootmem.c | 2 +
- mm/memblock.c | 5 ++
- 7 files changed, 245 insertions(+)
- create mode 100644 include/linux/crashlog.h
- create mode 100644 kernel/crashlog.c
-
---- /dev/null
-+++ b/include/linux/crashlog.h
-@@ -0,0 +1,17 @@
-+#ifndef __CRASHLOG_H
-+#define __CRASHLOG_H
-+
-+#ifdef CONFIG_CRASHLOG
-+void crashlog_init_bootmem(struct bootmem_data *bdata);
-+void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size);
-+#else
-+static inline void crashlog_init_bootmem(struct bootmem_data *bdata)
-+{
-+}
-+
-+static inline void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size)
-+{
-+}
-+#endif
-+
-+#endif
---- a/init/Kconfig
-+++ b/init/Kconfig
-@@ -1049,6 +1049,10 @@ config RELAY
-
- If unsure, say N.
-
-+config CRASHLOG
-+ bool "Crash logging"
-+ depends on (!NO_BOOTMEM || HAVE_MEMBLOCK)
-+
- config BLK_DEV_INITRD
- bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
- help
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -117,6 +117,7 @@ obj-$(CONFIG_TORTURE_TEST) += torture.o
- obj-$(CONFIG_HAS_IOMEM) += iomem.o
- obj-$(CONFIG_ZONE_DEVICE) += memremap.o
- obj-$(CONFIG_RSEQ) += rseq.o
-+obj-$(CONFIG_CRASHLOG) += crashlog.o
-
- $(obj)/configs.o: $(obj)/config_data.h
-
---- /dev/null
-+++ b/kernel/crashlog.c
-@@ -0,0 +1,213 @@
-+/*
-+ * Crash information logger
-+ * Copyright (C) 2010 Felix Fietkau <nbd@nbd.name>
-+ *
-+ * Based on ramoops.c
-+ * Copyright (C) 2010 Marco Stornelli <marco.stornelli@gmail.com>
-+ *
-+ * 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.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/bootmem.h>
-+#include <linux/memblock.h>
-+#include <linux/debugfs.h>
-+#include <linux/crashlog.h>
-+#include <linux/kmsg_dump.h>
-+#include <linux/module.h>
-+#include <linux/pfn.h>
-+#include <linux/vmalloc.h>
-+#include <asm/io.h>
-+
-+#define CRASHLOG_PAGES 4
-+#define CRASHLOG_SIZE (CRASHLOG_PAGES * PAGE_SIZE)
-+#define CRASHLOG_MAGIC 0xa1eedead
-+
-+/*
-+ * Start the log at 1M before the end of RAM, as some boot loaders like
-+ * to use the end of the RAM for stack usage and other things
-+ * If this fails, fall back to using the last part.
-+ */
-+#define CRASHLOG_OFFSET (1024 * 1024)
-+
-+struct crashlog_data {
-+ u32 magic;
-+ u32 len;
-+ u8 data[];
-+};
-+
-+static struct debugfs_blob_wrapper crashlog_blob;
-+static unsigned long crashlog_addr = 0;
-+static struct crashlog_data *crashlog_buf;
-+static struct kmsg_dumper dump;
-+static bool first = true;
-+
-+extern struct list_head *crashlog_modules;
-+
-+static bool crashlog_set_addr(phys_addr_t addr, phys_addr_t size)
-+{
-+ /* Limit to lower 64 MB to avoid highmem */
-+ phys_addr_t limit = 64 * 1024 * 1024;
-+
-+ if (crashlog_addr)
-+ return false;
-+
-+ if (addr > limit)
-+ return false;
-+
-+ if (addr + size > limit)
-+ size = limit - addr;
-+
-+ crashlog_addr = addr;
-+
-+ if (addr + size > CRASHLOG_OFFSET)
-+ crashlog_addr += size - CRASHLOG_OFFSET;
-+
-+ return true;
-+}
-+
-+#ifndef CONFIG_NO_BOOTMEM
-+void __init crashlog_init_bootmem(bootmem_data_t *bdata)
-+{
-+ phys_addr_t start, end;
-+
-+ start = PFN_PHYS(bdata->node_low_pfn);
-+ end = PFN_PHYS(bdata->node_min_pfn);
-+ if (!crashlog_set_addr(start, end - start))
-+ return;
-+
-+ if (reserve_bootmem(crashlog_addr, CRASHLOG_SIZE, BOOTMEM_EXCLUSIVE) < 0) {
-+ printk("Crashlog failed to allocate RAM at address 0x%lx\n",
-+ crashlog_addr);
-+ crashlog_addr = 0;
-+ }
-+}
-+#endif
-+
-+#ifdef CONFIG_HAVE_MEMBLOCK
-+void __init_memblock crashlog_init_memblock(phys_addr_t addr, phys_addr_t size)
-+{
-+ if (!crashlog_set_addr(addr, size))
-+ return;
-+
-+ if (memblock_reserve(crashlog_addr, CRASHLOG_SIZE)) {
-+ printk("Crashlog failed to allocate RAM at address 0x%lx\n",
-+ crashlog_addr);
-+ crashlog_addr = 0;
-+ }
-+}
-+#endif
-+
-+static void __init crashlog_copy(void)
-+{
-+ if (crashlog_buf->magic != CRASHLOG_MAGIC)
-+ return;
-+
-+ if (!crashlog_buf->len || crashlog_buf->len >
-+ CRASHLOG_SIZE - sizeof(*crashlog_buf))
-+ return;
-+
-+ crashlog_blob.size = crashlog_buf->len;
-+ crashlog_blob.data = kmemdup(crashlog_buf->data,
-+ crashlog_buf->len, GFP_KERNEL);
-+
-+ debugfs_create_blob("crashlog", 0700, NULL, &crashlog_blob);
-+}
-+
-+static int get_maxlen(void)
-+{
-+ return CRASHLOG_SIZE - sizeof(*crashlog_buf) - crashlog_buf->len;
-+}
-+
-+static void crashlog_printf(const char *fmt, ...)
-+{
-+ va_list args;
-+ int len = get_maxlen();
-+
-+ if (!len)
-+ return;
-+
-+ va_start(args, fmt);
-+ crashlog_buf->len += vscnprintf(
-+ &crashlog_buf->data[crashlog_buf->len],
-+ len, fmt, args);
-+ va_end(args);
-+}
-+
-+static void crashlog_do_dump(struct kmsg_dumper *dumper,
-+ enum kmsg_dump_reason reason)
-+{
-+ struct timeval tv;
-+ struct module *m;
-+ char *buf;
-+ size_t len;
-+
-+ if (!first)
-+ crashlog_printf("\n===================================\n");
-+
-+ do_gettimeofday(&tv);
-+ crashlog_printf("Time: %lu.%lu\n",
-+ (long)tv.tv_sec, (long)tv.tv_usec);
-+
-+ if (first) {
-+ crashlog_printf("Modules:");
-+ list_for_each_entry(m, crashlog_modules, list) {
-+ crashlog_printf("\t%s@%p+%x", m->name,
-+ m->core_layout.base, m->core_layout.size,
-+ m->init_layout.base, m->init_layout.size);
-+ }
-+ crashlog_printf("\n");
-+ first = false;
-+ }
-+
-+ buf = (char *)&crashlog_buf->data[crashlog_buf->len];
-+
-+ kmsg_dump_get_buffer(dumper, true, buf, get_maxlen(), &len);
-+
-+ crashlog_buf->len += len;
-+}
-+
-+
-+int __init crashlog_init_fs(void)
-+{
-+ struct page *pages[CRASHLOG_PAGES];
-+ pgprot_t prot;
-+ int i;
-+
-+ if (!crashlog_addr) {
-+ printk("No memory allocated for crashlog\n");
-+ return -ENOMEM;
-+ }
-+
-+ printk("Crashlog allocated RAM at address 0x%lx\n", (unsigned long) crashlog_addr);
-+ for (i = 0; i < CRASHLOG_PAGES; i++)
-+ pages[i] = pfn_to_page((crashlog_addr >> PAGE_SHIFT) + i);
-+
-+ prot = pgprot_writecombine(PAGE_KERNEL);
-+ crashlog_buf = vmap(pages, CRASHLOG_PAGES, VM_MAP, prot);
-+
-+ crashlog_copy();
-+
-+ crashlog_buf->magic = CRASHLOG_MAGIC;
-+ crashlog_buf->len = 0;
-+
-+ dump.max_reason = KMSG_DUMP_OOPS;
-+ dump.dump = crashlog_do_dump;
-+ kmsg_dump_register(&dump);
-+
-+ return 0;
-+}
-+module_init(crashlog_init_fs);
---- a/kernel/module.c
-+++ b/kernel/module.c
-@@ -256,6 +256,9 @@ static void mod_update_bounds(struct mod
- #ifdef CONFIG_KGDB_KDB
- struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
- #endif /* CONFIG_KGDB_KDB */
-+#ifdef CONFIG_CRASHLOG
-+struct list_head *crashlog_modules = &modules;
-+#endif
-
- static void module_assert_mutex(void)
- {
---- a/mm/bootmem.c
-+++ b/mm/bootmem.c
-@@ -15,6 +15,7 @@
- #include <linux/export.h>
- #include <linux/kmemleak.h>
- #include <linux/range.h>
-+#include <linux/crashlog.h>
- #include <linux/bug.h>
- #include <linux/io.h>
- #include <linux/bootmem.h>
-@@ -215,6 +216,7 @@ static unsigned long __init free_all_boo
- if (!bdata->node_bootmem_map)
- return 0;
-
-+ crashlog_init_bootmem(bdata);
- map = bdata->node_bootmem_map;
- start = bdata->node_min_pfn;
- end = bdata->node_low_pfn;
---- a/mm/memblock.c
-+++ b/mm/memblock.c
-@@ -21,6 +21,7 @@
- #include <linux/seq_file.h>
- #include <linux/memblock.h>
- #include <linux/bootmem.h>
-+#include <linux/crashlog.h>
-
- #include <asm/sections.h>
- #include <linux/io.h>
-@@ -547,6 +548,8 @@ static void __init_memblock memblock_ins
- memblock_set_region_node(rgn, nid);
- type->cnt++;
- type->total_size += size;
-+ if (type == &memblock.memory)
-+ crashlog_init_memblock(base, size);
- }
-
- /**
-@@ -586,6 +589,8 @@ int __init_memblock memblock_add_range(s
- type->regions[0].flags = flags;
- memblock_set_region_node(&type->regions[0], nid);
- type->total_size = size;
-+ if (type == &memblock.memory)
-+ crashlog_init_memblock(base, size);
- return 0;
- }
- repeat:
+ kfree(hook);
+ }
+
-+ nf_flow_table_cleanup(dev_net(dev), dev);
++ nf_flow_table_cleanup(dev);
+
+ return NOTIFY_DONE;
+}
+++ /dev/null
-From 852a88f35f4b7e5ebb717fed3c3a3330d5ad4336 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
-Date: Wed, 10 Apr 2019 16:43:27 +0200
-Subject: [PATCH v2] MIPS: perf: ath79: Fix perfcount IRQ assignment
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Currently it's not possible to use perf on ath79 due to genirq flags
-mismatch happening on static virtual IRQ 13 which is used for
-performance counters hardware IRQ 5.
-
-On TP-Link Archer C7v5:
-
- CPU0
- 2: 0 MIPS 2 ath9k
- 4: 318 MIPS 4 19000000.eth
- 7: 55034 MIPS 7 timer
- 8: 1236 MISC 3 ttyS0
- 12: 0 INTC 1 ehci_hcd:usb1
- 13: 0 gpio-ath79 2 keys
- 14: 0 gpio-ath79 5 keys
- 15: 31 AR724X PCI 1 ath10k_pci
-
- $ perf top
- genirq: Flags mismatch irq 13. 00014c83 (mips_perf_pmu) vs. 00002003 (keys)
-
-On TP-Link Archer C7v4:
-
- CPU0
- 4: 0 MIPS 4 19000000.eth
- 5: 7135 MIPS 5 1a000000.eth
- 7: 98379 MIPS 7 timer
- 8: 30 MISC 3 ttyS0
- 12: 90028 INTC 0 ath9k
- 13: 5520 INTC 1 ehci_hcd:usb1
- 14: 4623 INTC 2 ehci_hcd:usb2
- 15: 32844 AR724X PCI 1 ath10k_pci
- 16: 0 gpio-ath79 16 keys
- 23: 0 gpio-ath79 23 keys
-
- $ perf top
- genirq: Flags mismatch irq 13. 00014c80 (mips_perf_pmu) vs. 00000080 (ehci_hcd:usb1)
-
-This problem is happening, because currently statically assigned virtual
-IRQ 13 for performance counters is not claimed during the initialization
-of MIPS PMU during the bootup, so the IRQ subsystem doesn't know, that
-this interrupt isn't available for further use.
-
-So this patch fixes the issue by simply booking hardware IRQ 5 for MIPS PMU.
-
-Tested-by: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-Signed-off-by: Petr Å tetiar <ynezz@true.cz>
----
-
-Changes since v1:
-
- I've incorporated two comments which I've received on IRC from blogic and
- I've also reworded the commit message to match the changes in v2 of this
- patch.
-
- * use actual hardware perfcount IRQ 5 instead of the virtual IRQ 13
- * dropped the CONFIG_PERF_EVENTS ifdef around irq_create_mapping
-
- arch/mips/ath79/setup.c | 6 ------
- drivers/irqchip/irq-ath79-misc.c | 11 +++++++++++
- 2 files changed, 11 insertions(+), 6 deletions(-)
-
---- a/arch/mips/ath79/setup.c
-+++ b/arch/mips/ath79/setup.c
-@@ -211,12 +211,6 @@ const char *get_system_type(void)
- return ath79_sys_type;
- }
-
--int get_c0_perfcount_int(void)
--{
-- return ATH79_MISC_IRQ(5);
--}
--EXPORT_SYMBOL_GPL(get_c0_perfcount_int);
--
- unsigned int get_c0_compare_int(void)
- {
- return CP0_LEGACY_COMPARE_IRQ;
---- a/drivers/irqchip/irq-ath79-misc.c
-+++ b/drivers/irqchip/irq-ath79-misc.c
-@@ -22,6 +22,15 @@
- #define AR71XX_RESET_REG_MISC_INT_ENABLE 4
-
- #define ATH79_MISC_IRQ_COUNT 32
-+#define ATH79_MISC_PERF_IRQ 5
-+
-+static int ath79_perfcount_irq;
-+
-+int get_c0_perfcount_int(void)
-+{
-+ return ath79_perfcount_irq;
-+}
-+EXPORT_SYMBOL_GPL(get_c0_perfcount_int);
-
- static void ath79_misc_irq_handler(struct irq_desc *desc)
- {
-@@ -113,6 +122,8 @@ static void __init ath79_misc_intc_domai
- {
- void __iomem *base = domain->host_data;
-
-+ ath79_perfcount_irq = irq_create_mapping(domain, ATH79_MISC_PERF_IRQ);
-+
- /* Disable and clear all interrupts */
- __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_ENABLE);
- __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_STATUS);
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6395,7 +6395,7 @@ static void __ref alloc_node_mem_map(str
+@@ -6710,7 +6710,7 @@ static void __ref alloc_node_mem_map(str
mem_map = NODE_DATA(0)->node_mem_map;
#if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM)
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
-@@ -669,6 +669,7 @@ static const struct of_device_id spidev_
+@@ -668,6 +668,7 @@ static const struct of_device_id spidev_
+ { .compatible = "rohm,dh2228fv" },
{ .compatible = "lineartechnology,ltc2488" },
{ .compatible = "ge,achc" },
- { .compatible = "semtech,sx1301" },
+ { .compatible = "siliconlabs,si3210" },
+ { .compatible = "semtech,sx1301" },
+ { .compatible = "lwn,bk4" },
{},
- };
- MODULE_DEVICE_TABLE(of, spidev_dt_ids);
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Subject: spi: use gpio_set_value_cansleep for setting chipselect GPIO
-
-Sleeping is safe inside spi_transfer_one_message, and some GPIO chips
-need to sleep for setting values
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/drivers/spi/spi.c
-+++ b/drivers/spi/spi.c
-@@ -733,7 +733,7 @@ static void spi_set_cs(struct spi_device
- enable = !enable;
-
- if (gpio_is_valid(spi->cs_gpio)) {
-- gpio_set_value(spi->cs_gpio, !enable);
-+ gpio_set_value_cansleep(spi->cs_gpio, !enable);
- /* Some SPI masters need both GPIO CS & slave_select */
- if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
- spi->controller->set_cs)
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
-@@ -195,6 +195,9 @@ static void __br_handle_local_finish(str
+@@ -197,6 +197,9 @@ static void __br_handle_local_finish(str
/* note: already called with rcu_read_lock */
static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{
__br_handle_local_finish(skb);
/* return 1 to signal the okfn() was called so it's ok to use the skb */
-@@ -291,6 +294,17 @@ rx_handler_result_t br_handle_frame(stru
+@@ -293,6 +296,17 @@ rx_handler_result_t br_handle_frame(stru
forward:
switch (p->state) {
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
-@@ -62,8 +62,10 @@
+@@ -55,8 +55,10 @@
#define ATH8030_PHY_ID 0x004dd076
#define ATH8031_PHY_ID 0x004dd074
MODULE_DESCRIPTION("Atheros 803x PHY driver");
MODULE_AUTHOR("Matus Ujhelyi");
-@@ -308,7 +310,7 @@ static void at803x_link_change_notify(st
+@@ -327,7 +329,7 @@ static void at803x_link_change_notify(st
struct at803x_priv *priv = phydev->priv;
/*
* signalled. This is necessary to circumvent a hardware bug that
* occurs when the cable is unplugged while TX packets are pending
* in the FIFO. In such cases, the FIFO enters an error mode it
-@@ -414,6 +416,24 @@ static struct phy_driver at803x_driver[]
+@@ -430,6 +432,23 @@ static struct phy_driver at803x_driver[]
.aneg_done = at803x_aneg_done,
.ack_interrupt = &at803x_ack_interrupt,
.config_intr = &at803x_config_intr,
+ .suspend = at803x_suspend,
+ .resume = at803x_resume,
+ .features = PHY_BASIC_FEATURES,
-+ .flags = PHY_HAS_INTERRUPT,
+ .config_aneg = genphy_config_aneg,
+ .read_status = genphy_read_status,
+ .ack_interrupt = at803x_ack_interrupt,
} };
module_phy_driver(at803x_driver);
-@@ -421,6 +441,7 @@ module_phy_driver(at803x_driver);
+@@ -437,6 +456,7 @@ module_phy_driver(at803x_driver);
static struct mdio_device_id __maybe_unused atheros_tbl[] = {
{ ATH8030_PHY_ID, AT803X_PHY_ID_MASK },
{ ATH8031_PHY_ID, AT803X_PHY_ID_MASK },
--- a/Makefile
+++ b/Makefile
-@@ -655,12 +655,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+@@ -681,9 +681,9 @@ KBUILD_CFLAGS += $(call cc-disable-warni
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
--KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
-+KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
- else
- ifdef CONFIG_PROFILE_ALL_BRANCHES
--KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
-+KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
+-KBUILD_CFLAGS += -Os
++KBUILD_CFLAGS += -Os $(EXTRA_OPTIMIZATION)
else
-KBUILD_CFLAGS += -O2
-+KBUILD_CFLAGS += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
- endif
++KBUILD_CFLAGS += -O2 $(EXTRA_OPTIMIZATION)
endif
+ ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1149,6 +1149,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
+@@ -1197,6 +1197,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
the unaligned access emulation.
see arch/parisc/kernel/unaligned.c for reference
* and return the first char from this token.
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
-@@ -61,6 +61,7 @@ static struct addr_range percpu_range =
+@@ -59,6 +59,7 @@ static struct addr_range percpu_range =
static struct sym_entry *table;
static unsigned int table_size, table_cnt;
static int all_symbols = 0;
static int absolute_percpu = 0;
static int base_relative = 0;
-@@ -439,6 +440,9 @@ static void write_src(void)
+@@ -437,6 +438,9 @@ static void write_src(void)
free(markers);
output_label("kallsyms_token_table");
off = 0;
for (i = 0; i < 256; i++) {
-@@ -497,6 +501,9 @@ static void *find_token(unsigned char *s
+@@ -495,6 +499,9 @@ static void *find_token(unsigned char *s
{
int i;
for (i = 0; i < len - 1; i++) {
if (str[i] == token[0] && str[i+1] == token[1])
return &str[i];
-@@ -569,6 +576,9 @@ static void optimize_result(void)
+@@ -567,6 +574,9 @@ static void optimize_result(void)
{
int i, best;
/* using the '\0' symbol last allows compress_symbols to use standard
* fast string functions */
for (i = 255; i >= 0; i--) {
-@@ -751,6 +761,8 @@ int main(int argc, char **argv)
+@@ -746,6 +756,8 @@ int main(int argc, char **argv)
absolute_percpu = 1;
else if (strcmp(argv[i], "--base-relative") == 0)
base_relative = 1;
}
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
-@@ -133,6 +133,10 @@ kallsyms()
+@@ -110,6 +110,10 @@ kallsyms()
kallsymopt="${kallsymopt} --base-relative"
fi
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
-@@ -681,8 +681,10 @@ char *symbol_string(char *buf, char *end
+@@ -786,8 +786,10 @@ char *symbol_string(char *buf, char *end
struct printf_spec spec, const char *fmt)
{
unsigned long value;
#endif
if (fmt[1] == 'R')
-@@ -696,11 +698,16 @@ char *symbol_string(char *buf, char *end
+@@ -801,11 +803,16 @@ char *symbol_string(char *buf, char *end
sprint_symbol(sym, value);
else
sprint_symbol_no_offset(sym, value);
early_print("no ATAGS support: can't continue\n");
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
-@@ -365,7 +365,7 @@ static inline bool cpu_have_feature(unsi
+@@ -406,7 +406,7 @@ static inline bool cpu_have_feature(unsi
}
/* System capability check for constant caps */
{
if (num >= ARM64_NCAPS)
return false;
-@@ -379,7 +379,7 @@ static inline bool cpus_have_cap(unsigne
+@@ -420,7 +420,7 @@ static inline bool cpus_have_cap(unsigne
return test_bit(num, cpu_hwcaps);
}
return __cpus_have_const_cap(num);
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
-@@ -463,7 +463,7 @@ static inline void __clear_bit_unlock(un
+@@ -482,7 +482,7 @@ static inline void __clear_bit_unlock(un
* Return the bit position (0..63) of the most significant 1 bit in a word
* Returns -1 if no 1 bit exists
*/
{
int num;
-@@ -529,7 +529,7 @@ static inline unsigned long __fls(unsign
+@@ -548,7 +548,7 @@ static inline unsigned long __fls(unsign
* Returns 0..SZLONG-1
* Undefined if no bit exists, so code should check against 0 first.
*/
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -42,8 +42,8 @@ static inline void align_mod(const int a
- : GCC_IMM_ASM() (align), GCC_IMM_ASM() (mod));
+ : "n"(align), "n"(mod));
}
-static inline void mult_sh_align_mod(long *v1, long *v2, long *w,
int m1, m2;
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
-@@ -498,14 +498,14 @@ static int __init prom_next_node(phandle
+@@ -501,14 +501,14 @@ static int __init prom_next_node(phandle
}
}
{
int set;
-@@ -918,7 +918,7 @@ void radix__tlb_flush(struct mmu_gather
+@@ -928,7 +928,7 @@ void radix__tlb_flush(struct mmu_gather
tlb->need_flush_all = 0;
}
__cpacf_query(opcode, mask);
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -276,20 +276,6 @@ config CPA_DEBUG
+@@ -266,20 +266,6 @@ config CPA_DEBUG
---help---
Do change_page_attr() self-tests every 30 seconds.
depends on DEBUG_KERNEL
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
-@@ -373,7 +373,7 @@ static int vf610_nfc_cmd(struct nand_chi
+@@ -364,7 +364,7 @@ static int vf610_nfc_cmd(struct nand_chi
{
const struct nand_op_instr *instr;
struct vf610_nfc *nfc = chip_to_nfc(chip);
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
-@@ -309,6 +309,20 @@ config HEADERS_CHECK
+@@ -310,6 +310,20 @@ config HEADERS_CHECK
exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in
your build tree), to make sure they're suitable.
help
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -306,9 +306,6 @@ config ZONE_DMA32
+@@ -310,9 +310,6 @@ config ZONE_DMA32
config AUDIT_ARCH
def_bool y if X86_64
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
-@@ -268,8 +268,7 @@ struct ftrace_likely_data {
- * of extern inline functions at link time.
- * A lot of inline functions can cause havoc with function tracing.
+@@ -140,8 +140,7 @@ struct ftrace_likely_data {
+ * Do not use __always_inline here, since currently it expands to inline again
+ * (which would break users of __always_inline).
*/
-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
- !defined(CONFIG_OPTIMIZE_INLINING)
+#if !defined(CONFIG_OPTIMIZE_INLINING)
- #define inline \
- inline __attribute__((always_inline, unused)) notrace __gnu_inline
+ #define inline inline __attribute__((__always_inline__)) __gnu_inline \
+ __maybe_unused notrace
#else
-$(deps_initramfs): klibcdirs
+$(deps_initramfs_sane): klibcdirs
# We rebuild initramfs_data.cpio if:
- # 1) Any included file is newer then initramfs_data.cpio
+ # 1) Any included file is newer than initramfs_data.cpio
# 2) There are changes in which files are included (added or deleted)
# 3) If gen_init_cpio are newer than initramfs_data.cpio
- # 4) arguments to gen_initramfs.sh changes
+ # 4) Arguments to gen_initramfs.sh changes
-$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
+$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs
$(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
---
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -1062,9 +1062,6 @@ config FW_ARC
+@@ -1065,9 +1065,6 @@ config FW_ARC
config ARCH_MAY_HAVE_PC_FDC
bool
config CEVT_BCM1480
bool
-@@ -2968,6 +2965,18 @@ choice
+@@ -3060,6 +3057,18 @@ choice
bool "Extend builtin kernel arguments with bootloader arguments"
endchoice
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
-@@ -90,7 +90,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
+@@ -91,7 +91,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
# machines may also. Since BFD is incredibly buggy with respect to
# crossformat linking we rely on the elf2ecoff tool for format conversion.
#
+++ /dev/null
-From: Manuel Lauss <manuel.lauss@gmail.com>
-Subject: [RFC PATCH v4 2/2] MIPS: make FPU emulator optional
-
-This small patch makes the MIPS FPU emulator optional. The kernel
-kills float-users on systems without a hardware FPU by sending a SIGILL.
-
-Disabling the emulator shrinks vmlinux by about 54kBytes (32bit,
-optimizing for size).
-
-Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
----
-v4: rediffed because of patch 1/2, should now work with micromips as well
-v3: updated patch description with size savings.
-v2: incorporated changes suggested by Jonas Gorski
- force the fpu emulator on for micromips: relocating the parts
- of the mmips code in the emulator to other areas would be a
- much larger change; I went the cheap route instead with this.
-
- arch/mips/Kbuild | 2 +-
- arch/mips/Kconfig | 14 ++++++++++++++
- arch/mips/include/asm/fpu.h | 5 +++--
- arch/mips/include/asm/fpu_emulator.h | 15 +++++++++++++++
- 4 files changed, 33 insertions(+), 3 deletions(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -2892,6 +2892,20 @@ config MIPS_O32_FP64_SUPPORT
-
- If unsure, say N.
-
-+config MIPS_FPU_EMULATOR
-+ bool "MIPS FPU Emulator"
-+ default y
-+ help
-+ This option lets you disable the built-in MIPS FPU (Coprocessor 1)
-+ emulator, which handles floating-point instructions on processors
-+ without a hardware FPU. It is generally a good idea to keep the
-+ emulator built-in, unless you are perfectly sure you have a
-+ complete soft-float environment. With the emulator disabled, all
-+ users of float operations will be killed with an illegal instr-
-+ uction exception.
-+
-+ Say Y, please.
-+
- config USE_OF
- bool
- select OF
---- a/arch/mips/Makefile
-+++ b/arch/mips/Makefile
-@@ -322,7 +322,7 @@ OBJCOPYFLAGS += --remove-section=.regin
- head-y := arch/mips/kernel/head.o
-
- libs-y += arch/mips/lib/
--libs-y += arch/mips/math-emu/
-+libs-$(CONFIG_MIPS_FPU_EMULATOR) += arch/mips/math-emu/
-
- # See arch/mips/Kbuild for content of core part of the kernel
- core-y += arch/mips/
---- a/arch/mips/include/asm/fpu.h
-+++ b/arch/mips/include/asm/fpu.h
-@@ -230,8 +230,10 @@ static inline int init_fpu(void)
- /* Restore FRE */
- write_c0_config5(config5);
- enable_fpu_hazard();
-- } else
-+ } else if (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR))
- fpu_emulator_init_fpu();
-+ else
-+ ret = SIGILL;
-
- return ret;
- }
---- a/arch/mips/include/asm/fpu_emulator.h
-+++ b/arch/mips/include/asm/fpu_emulator.h
-@@ -30,6 +30,7 @@
- #include <asm/local.h>
- #include <asm/processor.h>
-
-+#ifdef CONFIG_MIPS_FPU_EMULATOR
- #ifdef CONFIG_DEBUG_FS
-
- struct mips_fpu_emulator_stats {
-@@ -179,6 +180,16 @@ do { \
- extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
- struct mips_fpu_struct *ctx, int has_fpu,
- void __user **fault_addr);
-+#else /* no CONFIG_MIPS_FPU_EMULATOR */
-+static inline int fpu_emulator_cop1Handler(struct pt_regs *xcp,
-+ struct mips_fpu_struct *ctx, int has_fpu,
-+ void __user **fault_addr)
-+{
-+ *fault_addr = NULL;
-+ return SIGILL; /* we don't speak MIPS FPU */
-+}
-+#endif /* CONFIG_MIPS_FPU_EMULATOR */
-+
- void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
- struct task_struct *tsk);
- int process_fpemu_return(int sig, void __user *fault_addr,
---- a/arch/mips/include/asm/dsemul.h
-+++ b/arch/mips/include/asm/dsemul.h
-@@ -41,6 +41,7 @@ struct task_struct;
- extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
- unsigned long branch_pc, unsigned long cont_pc);
-
-+#ifdef CONFIG_MIPS_FPU_EMULATOR
- /**
- * do_dsemulret() - Return from a delay slot 'emulation' frame
- * @xcp: User thread register context.
-@@ -88,5 +89,27 @@ extern bool dsemul_thread_rollback(struc
- * before @mm is freed in order to avoid memory leaks.
- */
- extern void dsemul_mm_cleanup(struct mm_struct *mm);
-+#else
-+static inline bool do_dsemulret(struct pt_regs *xcp)
-+{
-+ return false;
-+}
-+
-+static inline bool dsemul_thread_cleanup(struct task_struct *tsk)
-+{
-+ return false;
-+}
-+
-+static inline bool dsemul_thread_rollback(struct pt_regs *regs)
-+{
-+ return false;
-+}
-+
-+static inline void dsemul_mm_cleanup(struct mm_struct *mm)
-+{
-+
-+}
-+
-+#endif
-
- #endif /* __MIPS_ASM_DSEMUL_H__ */
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
-@@ -93,8 +93,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
+@@ -94,8 +94,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely
cflags-y += -msoft-float
LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
- strnlen_user.o uncached.o
+ strnlen_user.o uncached.o memcmp.o
- obj-y += iomap.o iomap_copy.o
+ obj-y += iomap_copy.o
obj-$(CONFIG_PCI) += iomap-pci.o
--- /dev/null
+++ b/arch/mips/lib/memcmp.c
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
-@@ -176,7 +176,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4
+@@ -177,7 +177,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4
cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap
--- a/arch/mips/kernel/machine_kexec.c
+++ b/arch/mips/kernel/machine_kexec.c
-@@ -10,14 +10,11 @@
- #include <linux/mm.h>
+@@ -11,14 +11,11 @@
#include <linux/delay.h>
+ #include <linux/libfdt.h>
+#include <asm/bootinfo.h>
#include <asm/cacheflush.h>
+#include <linux/uaccess.h>
+#include "machine_kexec.h"
- int (*_machine_kexec_prepare)(struct kimage *) = NULL;
+ static unsigned long reboot_code_buffer;
+
+@@ -32,6 +29,99 @@ void (*_crash_smp_send_stop)(void) = NUL
void (*_machine_kexec_shutdown)(void) = NULL;
-@@ -28,6 +25,99 @@ atomic_t kexec_ready_to_reboot = ATOMIC_
- void (*_crash_smp_send_stop)(void) = NULL;
- #endif
+ void (*_machine_crash_shutdown)(struct pt_regs *regs) = NULL;
+static void machine_kexec_print_args(void)
+{
static void kexec_image_info(const struct kimage *kimage)
{
unsigned long i;
-@@ -52,6 +142,18 @@ int
- machine_kexec_prepare(struct kimage *kimage)
- {
+@@ -101,6 +191,18 @@ machine_kexec_prepare(struct kimage *kim
+ #endif
+
kexec_image_info(kimage);
+ /*
+ * Whenever arguments passed from kexec-tools, Init the arguments as
if (_machine_kexec_prepare)
return _machine_kexec_prepare(kimage);
-@@ -89,10 +191,12 @@ machine_kexec(struct kimage *image)
+@@ -214,10 +316,12 @@ machine_kexec(struct kimage *image)
unsigned long *ptr;
reboot_code_buffer =
if (image->type == KEXEC_TYPE_DEFAULT) {
kexec_indirection_page =
-@@ -100,9 +204,19 @@ machine_kexec(struct kimage *image)
+@@ -225,9 +329,19 @@ machine_kexec(struct kimage *image)
} else {
kexec_indirection_page = (unsigned long)&image->head;
}
/*
* The generic kexec code builds a page list with physical
-@@ -124,15 +238,16 @@ machine_kexec(struct kimage *image)
+@@ -249,16 +363,17 @@ machine_kexec(struct kimage *image)
/*
* we do not want to be bothered.
*/
- printk("Bye ...\n");
+ pr_info("Will call new kernel at %08lx\n", image->start);
+ pr_info("Bye ...\n");
+ /* Make reboot code buffer available to the boot CPU. */
__flush_cache_all();
#ifdef CONFIG_SMP
/* All secondary cpus now may jump to kexec_wait cycle */
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
-@@ -59,6 +59,16 @@
+@@ -64,6 +64,16 @@
#endif
.endm
;----------------------------------------------------------------
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
-@@ -528,7 +528,7 @@ ignore_uboot_args:
- #endif
+@@ -532,7 +532,7 @@ void __init handle_uboot_args(void)
+ ignore_uboot_args:
if (use_embedded_dtb) {
- machine_desc = setup_machine_fdt(__dtb_start);
if (!machine_desc)
panic("Embedded DT invalid\n");
}
-@@ -544,6 +544,8 @@ ignore_uboot_args:
+@@ -548,6 +548,8 @@ ignore_uboot_args:
}
}
+++ /dev/null
-From 203f17906ff45705fbdaa0430dbbc71142c2640f Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Sat, 8 Dec 2018 21:45:53 +0100
-Subject: [PATCH 1/3] MIPS: Compile post DMA flush only when needed
-
-dma_sync_phys() is only called for some CPUs when a mapping is removed.
-Add ARCH_HAS_SYNC_DMA_FOR_CPU only for the CPUs listed in
-cpu_needs_post_dma_flush() which need this extra call and do not compile
-this code in for other CPUs. We need this for R10000, R12000, BMIPS5000
-CPUs and CPUs supporting MAAR which was introduced in MIPS32r5.
-
-This will hopefully improve the performance of the not affected devices.
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- arch/mips/Kconfig | 6 +++++-
- arch/mips/mm/dma-noncoherent.c | 2 ++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -1116,7 +1116,6 @@ config DMA_PERDEV_COHERENT
- config DMA_NONCOHERENT
- bool
- select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-- select ARCH_HAS_SYNC_DMA_FOR_CPU
- select NEED_DMA_MAP_STATE
- select DMA_NONCOHERENT_MMAP
- select DMA_NONCOHERENT_CACHE_SYNC
-@@ -1897,9 +1896,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
-
- config SYS_HAS_CPU_MIPS32_R5
- bool
-+ select ARCH_HAS_SYNC_DMA_FOR_CPU
-
- config SYS_HAS_CPU_MIPS32_R6
- bool
-+ select ARCH_HAS_SYNC_DMA_FOR_CPU
-
- config SYS_HAS_CPU_MIPS64_R1
- bool
-@@ -1909,6 +1910,7 @@ config SYS_HAS_CPU_MIPS64_R2
-
- config SYS_HAS_CPU_MIPS64_R6
- bool
-+ select ARCH_HAS_SYNC_DMA_FOR_CPU
-
- config SYS_HAS_CPU_R3000
- bool
-@@ -1945,6 +1947,7 @@ config SYS_HAS_CPU_R8000
-
- config SYS_HAS_CPU_R10000
- bool
-+ select ARCH_HAS_SYNC_DMA_FOR_CPU
-
- config SYS_HAS_CPU_RM7000
- bool
-@@ -1973,6 +1976,7 @@ config SYS_HAS_CPU_BMIPS4380
- config SYS_HAS_CPU_BMIPS5000
- bool
- select SYS_HAS_CPU_BMIPS
-+ select ARCH_HAS_SYNC_DMA_FOR_CPU
-
- config SYS_HAS_CPU_XLR
- bool
---- a/arch/mips/mm/dma-noncoherent.c
-+++ b/arch/mips/mm/dma-noncoherent.c
-@@ -191,12 +191,14 @@ void arch_sync_dma_for_device(struct dev
- dma_sync_phys(paddr, size, dir);
- }
-
-+#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
- void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
- size_t size, enum dma_data_direction dir)
- {
- if (cpu_needs_post_dma_flush(dev))
- dma_sync_phys(paddr, size, dir);
- }
-+#endif
-
- void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
- enum dma_data_direction direction)
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
-@@ -197,7 +197,7 @@ config PPC
+@@ -200,7 +200,7 @@ config PPC
select HAVE_IOREMAP_PROT
select HAVE_IRQ_EXIT_ON_IRQ_STACK
select HAVE_KERNEL_GZIP
-- select HAVE_KERNEL_XZ if PPC_BOOK3S
-+ select HAVE_KERNEL_XZ if PPC_BOOK3S || PPC_85xx
+- select HAVE_KERNEL_XZ if PPC_BOOK3S || 44x
++ select HAVE_KERNEL_XZ if PPC_BOOK3S || 44x || PPC_85xx
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
select HAVE_KRETPROBES
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -11,6 +11,23 @@ menuconfig MTD
+@@ -12,6 +12,23 @@ menuconfig MTD
if MTD
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
* the pointer to that structure.
-@@ -623,6 +627,7 @@ int mtd_add_partition(struct mtd_info *p
- mutex_unlock(&mtd_partitions_mutex);
+@@ -626,6 +630,7 @@ int mtd_add_partition(struct mtd_info *p
+ if (ret)
+ goto err_remove_part;
- add_mtd_device(&new->mtd);
+ mtd_partition_split(parent, new);
-
mtd_add_partition_attrs(new);
-@@ -701,6 +706,29 @@ int mtd_del_partition(struct mtd_info *m
+ return 0;
+@@ -712,6 +717,29 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
-@@ -732,6 +760,7 @@ int add_mtd_partitions(struct mtd_info *
- mutex_unlock(&mtd_partitions_mutex);
+@@ -752,6 +780,7 @@ int add_mtd_partitions(struct mtd_info *
+ goto err_del_partitions;
+ }
- add_mtd_device(&slave->mtd);
+ mtd_partition_split(master, slave);
mtd_add_partition_attrs(slave);
/* Look for subpartitions */
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
-@@ -706,6 +710,36 @@ int mtd_del_partition(struct mtd_info *m
+@@ -717,6 +721,36 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -1041,6 +1075,61 @@ void mtd_part_parser_cleanup(struct mtd_
+@@ -1066,6 +1100,61 @@ void mtd_part_parser_cleanup(struct mtd_
}
}
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -748,6 +748,7 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -759,6 +759,7 @@ run_parsers_by_type(struct mtd_part *sla
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
}
static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part)
-@@ -757,6 +758,12 @@ static void mtd_partition_split(struct m
+@@ -768,6 +769,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -26,6 +26,8 @@ config MTD_SPLIT_FIRMWARE_NAME
+@@ -27,6 +27,8 @@ config MTD_SPLIT_FIRMWARE_NAME
depends on MTD_SPLIT_FIRMWARE
default "firmware"
+obj-$(CONFIG_MTD_SPLIT) += mtdsplit/
+
obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
+ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1154,6 +1154,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1179,6 +1179,24 @@ int mtd_is_partition(const struct mtd_in
}
EXPORT_SYMBOL_GPL(mtd_is_partition);
{
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
-@@ -507,6 +507,24 @@ static inline void mtd_align_erase_req(s
+@@ -509,6 +509,24 @@ static inline void mtd_align_erase_req(s
req->len += mtd->erasesize - mod;
}
+++ /dev/null
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Subject: [PATCH] mtd: redboot: add of_match_table with DT binding
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows parsing RedBoot compatible partitions for properly described
-flash device in DT.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
-
---- a/drivers/mtd/redboot.c
-+++ b/drivers/mtd/redboot.c
-@@ -289,9 +289,16 @@ static int parse_redboot_partitions(stru
- return ret;
- }
-
-+static const struct of_device_id redboot_parser_of_match_table[] = {
-+ { .compatible = "ecoscentric,redboot-fis-partitions" },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, redboot_parser_of_match_table);
-+
- static struct mtd_part_parser redboot_parser = {
- .parse_fn = parse_redboot_partitions,
- .name = "RedBoot",
-+ .of_match_table = redboot_parser_of_match_table,
- };
- module_mtd_part_parser(redboot_parser);
-
drivers/mtd/redboot.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
---- a/drivers/mtd/redboot.c
-+++ b/drivers/mtd/redboot.c
-@@ -265,14 +265,21 @@ static int parse_redboot_partitions(stru
+--- a/drivers/mtd/parsers/redboot.c
++++ b/drivers/mtd/parsers/redboot.c
+@@ -288,14 +288,21 @@ static int parse_redboot_partitions(stru
#endif
names += strlen(names)+1;
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -177,6 +177,22 @@ menu "Partition parsers"
+@@ -128,6 +128,22 @@ menu "Partition parsers"
source "drivers/mtd/parsers/Kconfig"
endmenu
#
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
-@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
+@@ -15,6 +15,7 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o
obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o
obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o
return dev;
err_destroy_mutex:
-@@ -379,7 +387,7 @@ static int block2mtd_setup2(const char *
+@@ -381,7 +389,7 @@ static int block2mtd_setup2(const char *
/* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
char buf[80 + 12 + 80 + 8];
char *str = buf;
char *name;
size_t erase_size = PAGE_SIZE;
unsigned long timeout = MTD_DEFAULT_TIMEOUT;
-@@ -393,7 +401,7 @@ static int block2mtd_setup2(const char *
+@@ -395,7 +403,7 @@ static int block2mtd_setup2(const char *
strcpy(str, val);
kill_final_newline(str);
token[i] = strsep(&str, ",");
if (str) {
-@@ -419,8 +427,10 @@ static int block2mtd_setup2(const char *
+@@ -421,8 +429,10 @@ static int block2mtd_setup2(const char *
return 0;
}
}
return 0;
}
-@@ -454,7 +464,7 @@ static int block2mtd_setup(const char *v
+@@ -456,7 +466,7 @@ static int block2mtd_setup(const char *v
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
-@@ -387,7 +387,7 @@ static int block2mtd_setup2(const char *
+@@ -389,7 +389,7 @@ static int block2mtd_setup2(const char *
/* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
char buf[80 + 12 + 80 + 8];
char *str = buf;
char *name;
size_t erase_size = PAGE_SIZE;
unsigned long timeout = MTD_DEFAULT_TIMEOUT;
-@@ -401,7 +401,7 @@ static int block2mtd_setup2(const char *
+@@ -403,7 +403,7 @@ static int block2mtd_setup2(const char *
strcpy(str, val);
kill_final_newline(str);
token[i] = strsep(&str, ",");
if (str) {
-@@ -430,6 +430,9 @@ static int block2mtd_setup2(const char *
+@@ -432,6 +432,9 @@ static int block2mtd_setup2(const char *
if (token[2] && (strlen(token[2]) + 1 > 80))
pr_err("mtd device name too long\n");
add_device(name, erase_size, token[2], timeout);
return 0;
-@@ -464,7 +467,7 @@ static int block2mtd_setup(const char *v
+@@ -466,7 +469,7 @@ static int block2mtd_setup(const char *v
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1455,7 +1455,7 @@ static int spi_nor_write(struct mtd_info
+@@ -2241,7 +2241,7 @@ static int spi_nor_write(struct mtd_info
write_enable(nor);
ret = nor->write(nor, addr, page_remain, buf + i);
goto write_err;
written = ret;
-@@ -1464,13 +1464,6 @@ static int spi_nor_write(struct mtd_info
- goto write_err;
- *retlen += written;
- i += written;
-- if (written != page_remain) {
-- dev_err(nor->dev,
-- "While writing %zu bytes written %zd bytes\n",
-- page_remain, written);
-- ret = -EIO;
-- goto write_err;
-- }
- }
-
- write_err:
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2733,6 +2733,7 @@ static int spi_nor_init(struct spi_nor *
+@@ -3916,6 +3916,7 @@ static int spi_nor_init(struct spi_nor *
*/
if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2735,6 +2735,7 @@ static int spi_nor_init(struct spi_nor *
+@@ -3918,6 +3918,7 @@ static int spi_nor_init(struct spi_nor *
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX ||
JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
nor->info->flags & SPI_NOR_HAS_LOCK) {
write_enable(nor);
write_sr(nor, 0);
-@@ -2871,7 +2872,8 @@ int spi_nor_scan(struct spi_nor *nor, co
-
+@@ -4065,6 +4066,7 @@ int spi_nor_scan(struct spi_nor *nor, co
/* NOR protection support for STmicro/Micron chips and similar */
- if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||
-- info->flags & SPI_NOR_HAS_LOCK) {
+ if (JEDEC_MFR(info) == SNOR_MFR_ST ||
+ JEDEC_MFR(info) == SNOR_MFR_MICRON ||
+ JEDEC_MFR(info) == SNOR_MFR_WINBOND ||
-+ info->flags & SPI_NOR_HAS_LOCK) {
+ info->flags & SPI_NOR_HAS_LOCK) {
nor->flash_lock = stm_lock;
nor->flash_unlock = stm_unlock;
- nor->flash_is_locked = stm_is_locked;
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
-@@ -39,6 +39,17 @@ config SPI_ASPEED_SMC
- and support for the SPI flash memory controller (SPI) for
- the host firmware. The implementation only supports SPI NOR.
+@@ -21,6 +21,17 @@ config MTD_SPI_NOR_USE_4K_SECTORS
+ Please note that some tools/drivers/filesystems may not work with
+ 4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum).
+config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT
+ int "Maximum flash chip size to use 4K sectors on (in KiB)"
+ depends on MTD_SPI_NOR_USE_4K_SECTORS
-+ default "4096"
++ default 4096
+ help
+ There are many flash chips that support 4K sectors, but are so large
+ that using them significantly slows down writing large amounts of
+ Any flash chip larger than the size specified in this option will
+ not use 4K sectors.
+
- config SPI_ATMEL_QUADSPI
- tristate "Atmel Quad SPI Controller"
- depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
+ config SPI_ASPEED_SMC
+ tristate "Aspeed flash controllers in SPI mode"
+ depends on ARCH_ASPEED || COMPILE_TEST
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2647,10 +2647,12 @@ static int spi_nor_select_erase(struct s
-
+@@ -3815,7 +3815,8 @@ static int spi_nor_select_erase(struct s
+ */
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
-- if (info->flags & SECT_4K) {
-+ if ((info->flags & SECT_4K) && (mtd->size <=
-+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
- nor->erase_opcode = SPINOR_OP_BE_4K;
- mtd->erasesize = 4096;
-- } else if (info->flags & SECT_4K_PMC) {
-+ } else if ((info->flags & SECT_4K_PMC) && (mtd->size <=
-+ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) {
- nor->erase_opcode = SPINOR_OP_BE_4K_PMC;
- mtd->erasesize = 4096;
- } else
+- wanted_size = 4096u;
++ if (mtd.size <= CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)
++ wanted_size = 4096u;
+ #endif
+
+ if (spi_nor_has_uniform_erase(nor)) {
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1239,6 +1239,11 @@ static const struct flash_info spi_nor_i
+@@ -2025,6 +2025,11 @@ static const struct flash_info spi_nor_i
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
},
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -994,6 +994,7 @@ static const struct flash_info spi_nor_i
+@@ -1745,6 +1745,7 @@ static const struct flash_info spi_nor_i
{ "en25q32b", INFO(0x1c3016, 0, 64 * 1024, 64, 0) },
{ "en25p64", INFO(0x1c2017, 0, 64 * 1024, 128, 0) },
{ "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) },
+ { "en25q128", INFO(0x1c3018, 0, 64 * 1024, 256, SECT_4K) },
+ { "en25q80a", INFO(0x1c3014, 0, 64 * 1024, 16,
+ SECT_4K | SPI_NOR_DUAL_READ) },
{ "en25qh32", INFO(0x1c7016, 0, 64 * 1024, 64, 0) },
- { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) },
- { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) },
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1083,6 +1083,7 @@ static const struct flash_info spi_nor_i
+@@ -1845,6 +1845,7 @@ static const struct flash_info spi_nor_i
{ "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) },
{ "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) },
{ "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
+ { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, 0) },
{ "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) },
- { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) },
- { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) },
+ { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+++ /dev/null
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -996,6 +996,7 @@ static const struct flash_info spi_nor_i
- { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) },
- { "en25q128", INFO(0x1c3018, 0, 64 * 1024, 256, SECT_4K) },
- { "en25qh32", INFO(0x1c7016, 0, 64 * 1024, 64, 0) },
-+ { "en25qh64", INFO(0x1c7017, 0, 64 * 1024, 128, 0) },
- { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) },
- { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) },
- { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) },
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
-@@ -41,6 +41,7 @@
- #include <linux/reboot.h>
+@@ -42,6 +42,7 @@
#include <linux/leds.h>
#include <linux/debugfs.h>
+ #include <linux/nvmem-provider.h>
+#include <linux/root_dev.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-@@ -593,6 +594,15 @@ int add_mtd_device(struct mtd_info *mtd)
+@@ -644,6 +645,15 @@ int add_mtd_device(struct mtd_info *mtd)
of this try_ nonsense, and no bitching about it
either. :) */
__module_get(THIS_MODULE);
+
return 0;
- fail_added:
+ fail_nvmem_add:
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
-@@ -427,7 +427,28 @@ retry:
+@@ -459,7 +459,28 @@ retry:
out:
put_page(page);
}
#ifdef CONFIG_ROOT_NFS
#define NFSROOT_TIMEOUT_MIN 5
-@@ -521,6 +542,10 @@ void __init mount_root(void)
+@@ -553,6 +574,10 @@ void __init mount_root(void)
change_floppy("root floppy");
}
#endif
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
-@@ -938,6 +938,44 @@ out_unlock:
+@@ -995,6 +995,44 @@ out_unlock:
}
EXPORT_SYMBOL_GPL(get_mtd_device_nm);
mutex_lock(&mtd_table_mutex);
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
-@@ -589,6 +589,8 @@ extern struct mtd_info *get_mtd_device(s
+@@ -591,6 +591,8 @@ extern struct mtd_info *get_mtd_device(s
extern int __get_mtd_device(struct mtd_info *mtd);
extern void __put_mtd_device(struct mtd_info *mtd);
extern struct mtd_info *get_mtd_device_nm(const char *name);
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -374,4 +374,6 @@ source "drivers/mtd/spi-nor/Kconfig"
+@@ -325,4 +325,6 @@ source "drivers/mtd/spi-nor/Kconfig"
source "drivers/mtd/ubi/Kconfig"
endif # MTD
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
-@@ -39,3 +39,6 @@ obj-y += chips/ lpddr/ maps/ devices/ n
+@@ -38,3 +38,6 @@ obj-y += chips/ lpddr/ maps/ devices/ n
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
obj-$(CONFIG_MTD_UBI) += ubi/
#define JFFS2_NODE_ACCURATE 0x2000
--- a/lib/Kconfig
+++ b/lib/Kconfig
-@@ -278,6 +278,12 @@ config ZSTD_DECOMPRESS
+@@ -286,6 +286,12 @@ config ZSTD_DECOMPRESS
source "lib/xz/Kconfig"
ifdef CONFIG_FUNCTION_TRACER
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
-@@ -139,6 +149,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
+@@ -149,6 +159,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/
obj-$(CONFIG_XZ_DEC) += xz/
obj-$(CONFIG_RAID6_PQ) += raid6/
--- a/fs/ubifs/Kconfig
+++ b/fs/ubifs/Kconfig
-@@ -85,3 +85,16 @@ config UBIFS_FS_SECURITY
- the extended attribute support in advance.
+@@ -85,4 +85,17 @@ config UBIFS_FS_AUTHENTICATION
+ sha256, these are not selected automatically since there are many
+ different options.
- If you are not using a security module, say N.
-+
+config UBIFS_FS_FORMAT4
+ bool "Use file system format version 4 for new file systems"
+ depends on UBIFS_FS
+ format version 5 for ubifs file systems created with version 5.
+
+ If you are unsure, say N.
++
+ endif # UBIFS_FS
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
-@@ -176,7 +176,9 @@ static int create_default_filesystem(str
+@@ -187,7 +187,9 @@ static int create_default_filesystem(str
tmp64 = (long long)max_buds * c->leb_size;
if (big_lpt)
sup_flags |= UBIFS_FLG_BIGLPT;
sup_flags |= UBIFS_FLG_DOUBLE_HASH;
+#endif
- sup->ch.node_type = UBIFS_SB_NODE;
- sup->key_hash = UBIFS_KEY_HASH_R5;
-@@ -192,7 +194,11 @@ static int create_default_filesystem(str
+ if (ubifs_authenticated(c)) {
+ sup_flags |= UBIFS_FLG_AUTHENTICATION;
+@@ -213,7 +215,11 @@ static int create_default_filesystem(str
sup->jhead_cnt = cpu_to_le32(DEFAULT_JHEADS_CNT);
sup->fanout = cpu_to_le32(DEFAULT_FANOUT);
sup->lsave_cnt = cpu_to_le32(c->lsave_cnt);
#include <net/net_namespace.h>
#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
-@@ -433,6 +434,56 @@ static int ct_cpu_seq_show(struct seq_fi
+@@ -454,6 +455,56 @@ static int ct_cpu_seq_show(struct seq_fi
return 0;
}
static const struct seq_operations ct_cpu_seq_ops = {
.start = ct_cpu_seq_start,
.next = ct_cpu_seq_next,
-@@ -446,8 +497,9 @@ static int nf_conntrack_standalone_init_
+@@ -467,8 +518,9 @@ static int nf_conntrack_standalone_init_
kuid_t root_uid;
kgid_t root_gid;
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Subject: netfilter: optional tcp window check
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
- net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
---- a/net/netfilter/nf_conntrack_proto_tcp.c
-+++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -34,6 +34,9 @@
- #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
- #include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
-
-+/* Do not check the TCP window for incoming packets */
-+static int nf_ct_tcp_no_window_check __read_mostly = 1;
-+
- /* "Be conservative in what you do,
- be liberal in what you accept from others."
- If it's non-zero, we mark only out of window RST segments as INVALID. */
-@@ -483,6 +486,9 @@ static bool tcp_in_window(const struct n
- s32 receiver_offset;
- bool res, in_recv_win;
-
-+ if (nf_ct_tcp_no_window_check)
-+ return true;
-+
- /*
- * Get the required data from the packet.
- */
-@@ -1057,7 +1063,7 @@ static int tcp_packet(struct nf_conn *ct
- IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED &&
- timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK])
- timeout = timeouts[TCP_CONNTRACK_UNACK];
-- else if (ct->proto.tcp.last_win == 0 &&
-+ else if (!nf_ct_tcp_no_window_check && ct->proto.tcp.last_win == 0 &&
- timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS])
- timeout = timeouts[TCP_CONNTRACK_RETRANS];
- else
-@@ -1506,6 +1512,13 @@ static struct ctl_table tcp_sysctl_table
- .mode = 0644,
- .proc_handler = proc_dointvec,
- },
-+ {
-+ .procname = "nf_conntrack_tcp_no_window_check",
-+ .data = &nf_ct_tcp_no_window_check,
-+ .maxlen = sizeof(unsigned int),
-+ .mode = 0644,
-+ .proc_handler = proc_dointvec,
-+ },
- { }
- };
- #endif /* CONFIG_SYSCTL */
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
-@@ -110,6 +110,9 @@ int nf_xfrm_me_harder(struct net *net, s
+@@ -158,6 +158,9 @@ int nf_xfrm_me_harder(struct net *net, s
struct sock *sk = skb->sk;
int err;
/* Packet socket options */
-@@ -57,6 +59,7 @@ struct sockaddr_ll {
- #define PACKET_QDISC_BYPASS 20
+@@ -58,6 +60,7 @@ struct sockaddr_ll {
#define PACKET_ROLLOVER_STATS 21
#define PACKET_FANOUT_DATA 22
-+#define PACKET_RECV_TYPE 23
+ #define PACKET_IGNORE_OUTGOING 23
++#define PACKET_RECV_TYPE 24
#define PACKET_FANOUT_HASH 0
#define PACKET_FANOUT_LB 1
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
-@@ -2036,12 +2038,12 @@ static int packet_rcv(struct sk_buff *sk
+@@ -2046,12 +2048,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -2167,12 +2169,12 @@ static int tpacket_rcv(struct sk_buff *s
+@@ -2177,12 +2179,12 @@ static int tpacket_rcv(struct sk_buff *s
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net
+@@ -3250,6 +3252,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
-@@ -3862,6 +3865,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3884,6 +3887,16 @@ packet_setsockopt(struct socket *sock, i
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
return 0;
}
default:
return -ENOPROTOOPT;
}
-@@ -3914,6 +3927,13 @@ static int packet_getsockopt(struct sock
+@@ -3936,6 +3949,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -918,6 +918,13 @@ struct dev_ifalias {
- char ifalias[];
- };
+@@ -943,6 +943,13 @@ struct dev_ifalias {
+
+ struct devlink;
+struct flow_offload;
+
/*
* This structure defines the management hooks for network devices.
* The following hooks can be defined; unless noted otherwise, they are
-@@ -1150,6 +1157,10 @@ struct dev_ifalias {
+@@ -1176,6 +1183,10 @@ struct devlink;
* int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh,
* u16 flags);
*
* int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
* Called to change device carrier. Soft-devices (like dummy, team, etc)
* which do not represent real hardware may define this to allow their
-@@ -1377,6 +1388,8 @@ struct net_device_ops {
+@@ -1418,6 +1429,8 @@ struct net_device_ops {
int (*ndo_bridge_dellink)(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags);
struct flow_offload {
struct flow_offload_tuple_rhash tuplehash[FLOW_OFFLOAD_DIR_MAX];
-@@ -125,6 +132,22 @@ unsigned int nf_flow_offload_ip_hook(voi
+@@ -121,6 +128,22 @@ unsigned int nf_flow_offload_ip_hook(voi
unsigned int nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
const struct nf_hook_state *state);
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
-@@ -1464,6 +1464,7 @@ enum nft_object_attributes {
+@@ -1488,6 +1488,7 @@ enum nft_object_attributes {
* @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32)
* @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32)
* @NFTA_FLOWTABLE_HANDLE: object handle (NLA_U64)
*/
enum nft_flowtable_attributes {
NFTA_FLOWTABLE_UNSPEC,
-@@ -1473,6 +1474,7 @@ enum nft_flowtable_attributes {
+@@ -1497,6 +1498,7 @@ enum nft_flowtable_attributes {
NFTA_FLOWTABLE_USE,
NFTA_FLOWTABLE_HANDLE,
NFTA_FLOWTABLE_PAD,
#define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1)
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -714,6 +714,15 @@ config NF_FLOW_TABLE
+@@ -718,6 +718,15 @@ config NF_FLOW_TABLE
To compile it as a module, choose M here.
default m if NETFILTER_ADVANCED=n
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -126,6 +126,7 @@ obj-$(CONFIG_NF_FLOW_TABLE) += nf_flow_t
+@@ -124,6 +124,7 @@ obj-$(CONFIG_NF_FLOW_TABLE) += nf_flow_t
nf_flow_table-objs := nf_flow_table_core.o nf_flow_table_ip.o
obj-$(CONFIG_NF_FLOW_TABLE_INET) += nf_flow_table_inet.o
flow_offload_free(flow);
}
-@@ -358,6 +367,9 @@ static int nf_flow_offload_gc_step(struc
- if (!teardown)
- nf_ct_offload_timeout(flow);
+@@ -330,6 +339,9 @@ static void nf_flow_offload_gc_step(stru
+ if (!teardown)
+ nf_ct_offload_timeout(flow);
-+ if (nf_flow_in_hw(flow) && !teardown)
-+ continue;
++ if (nf_flow_in_hw(flow) && !teardown)
++ return;
+
- if (nf_flow_has_expired(flow) || teardown)
- flow_offload_del(flow_table, flow);
- }
-@@ -493,10 +505,43 @@ int nf_flow_dnat_port(const struct flow_
+ if (nf_flow_has_expired(flow) || teardown)
+ flow_offload_del(flow_table, flow);
+ }
+@@ -459,10 +471,43 @@ int nf_flow_dnat_port(const struct flow_
}
EXPORT_SYMBOL_GPL(nf_flow_dnat_port);
INIT_DEFERRABLE_WORK(&flowtable->gc_work, nf_flow_offload_work_gc);
err = rhashtable_init(&flowtable->rhashtable,
-@@ -534,6 +579,8 @@ static void nf_flow_table_iterate_cleanu
+@@ -503,6 +548,8 @@ static void nf_flow_table_iterate_cleanu
{
nf_flow_table_iterate(flowtable, nf_flow_table_do_cleanup, dev);
flush_delayed_work(&flowtable->gc_work);
+ flush_work(&nf_flow_offload_hw_work);
}
- void nf_flow_table_cleanup(struct net *net, struct net_device *dev)
-@@ -547,6 +594,26 @@ void nf_flow_table_cleanup(struct net *n
+ void nf_flow_table_cleanup(struct net_device *dev)
+@@ -516,6 +563,26 @@ void nf_flow_table_cleanup(struct net_de
}
EXPORT_SYMBOL_GPL(nf_flow_table_cleanup);
void nf_flow_table_free(struct nf_flowtable *flow_table)
{
mutex_lock(&flowtable_lock);
-@@ -556,9 +623,58 @@ void nf_flow_table_free(struct nf_flowta
+@@ -525,9 +592,58 @@ void nf_flow_table_free(struct nf_flowta
nf_flow_table_iterate(flow_table, nf_flow_table_do_cleanup, NULL);
- WARN_ON(!nf_flow_offload_gc_step(flow_table));
+ nf_flow_table_iterate(flow_table, nf_flow_offload_gc_step, flow_table);
rhashtable_destroy(&flow_table->rhashtable);
+ if (flow_table->flags & NF_FLOWTABLE_F_HW)
+ nf_flow_offload_hw_free(flow_table);
+MODULE_ALIAS("nf-flow-table-hw");
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
-@@ -5463,6 +5463,13 @@ static int nf_tables_flowtable_parse_hoo
+@@ -5580,6 +5580,13 @@ static int nf_tables_flowtable_parse_hoo
if (err < 0)
return err;
ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL);
if (!ops)
return -ENOMEM;
-@@ -5594,10 +5601,19 @@ static int nf_tables_newflowtable(struct
+@@ -5711,10 +5718,19 @@ static int nf_tables_newflowtable(struct
}
flowtable->data.type = type;
err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK],
flowtable);
if (err < 0)
-@@ -5723,7 +5739,8 @@ static int nf_tables_fill_flowtable_info
+@@ -5840,7 +5856,8 @@ static int nf_tables_fill_flowtable_info
nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) ||
nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) ||
nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle),
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -919,6 +919,7 @@ struct dev_ifalias {
- };
+@@ -944,6 +944,7 @@ struct dev_ifalias {
+ struct devlink;
struct flow_offload;
+struct flow_offload_hw_path;
enum flow_offload_type {
FLOW_OFFLOAD_ADD = 0,
-@@ -1157,8 +1158,15 @@ enum flow_offload_type {
+@@ -1183,8 +1184,15 @@ enum flow_offload_type {
* int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh,
* u16 flags);
*
* Adds/deletes flow entry to/from net device flowtable.
*
* int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
-@@ -1388,8 +1396,11 @@ struct net_device_ops {
+@@ -1429,8 +1437,11 @@ struct net_device_ops {
int (*ndo_bridge_dellink)(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags);
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
-@@ -32,6 +32,10 @@
+@@ -31,6 +31,10 @@
+ #include <linux/ethtool.h>
#include <linux/phy.h>
#include <net/arp.h>
- #include <net/switchdev.h>
+#if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
+#include <linux/netfilter.h>
+#include <net/netfilter/nf_flow_table.h>
#include "vlan.h"
#include "vlanproc.h"
-@@ -770,6 +774,27 @@ static int vlan_dev_get_iflink(const str
+@@ -772,6 +776,27 @@ static int vlan_dev_get_iflink(const str
return real_dev->ifindex;
}
static const struct ethtool_ops vlan_ethtool_ops = {
.get_link_ksettings = vlan_ethtool_get_link_ksettings,
.get_drvinfo = vlan_ethtool_get_drvinfo,
-@@ -807,6 +832,9 @@ static const struct net_device_ops vlan_
+@@ -811,6 +836,9 @@ static const struct net_device_ops vlan_
.ndo_fix_features = vlan_dev_fix_features,
.ndo_get_lock_subclass = vlan_dev_get_lock_subclass,
.ndo_get_iflink = vlan_dev_get_iflink,
#include <linux/uaccess.h>
#include "br_private.h"
-@@ -370,6 +374,28 @@ static const struct ethtool_ops br_ethto
+@@ -380,6 +384,28 @@ static const struct ethtool_ops br_ethto
.get_link = ethtool_op_get_link,
};
static const struct net_device_ops br_netdev_ops = {
.ndo_open = br_dev_open,
.ndo_stop = br_dev_stop,
-@@ -397,6 +423,9 @@ static const struct net_device_ops br_ne
+@@ -408,6 +434,9 @@ static const struct net_device_ops br_ne
.ndo_bridge_setlink = br_setlink,
.ndo_bridge_dellink = br_dellink,
.ndo_features_check = passthru_features_check,
struct flow_offload_tuple_rhash tuplehash[FLOW_OFFLOAD_DIR_MAX];
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
-@@ -367,7 +367,7 @@ static int nf_flow_offload_gc_step(struc
- if (!teardown)
- nf_ct_offload_timeout(flow);
+@@ -339,7 +339,7 @@ static void nf_flow_offload_gc_step(stru
+ if (!teardown)
+ nf_ct_offload_timeout(flow);
-- if (nf_flow_in_hw(flow) && !teardown)
-+ if ((flow->flags & FLOW_OFFLOAD_KEEP) && !teardown)
- continue;
+- if (nf_flow_in_hw(flow) && !teardown)
++ if ((flow->flags & FLOW_OFFLOAD_KEEP) && !teardown)
+ return;
- if (nf_flow_has_expired(flow) || teardown)
+ if (nf_flow_has_expired(flow) || teardown)
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2493,7 +2493,7 @@ static inline int pskb_network_may_pull(
+@@ -2591,7 +2591,7 @@ static inline int pskb_network_may_pull(
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
#ifndef NET_SKB_PAD
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
-@@ -78,6 +78,7 @@ struct netns_ipv6 {
+@@ -79,6 +79,7 @@ struct netns_ipv6 {
unsigned int fib6_rules_require_fldissect;
bool fib6_has_custom_rules;
struct rt6_info *ip6_prohibit_entry;
static void rt_fibinfo_free(struct rtable __rcu **rtp)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
-@@ -2474,6 +2474,7 @@ static const char *const rtn_type_names[
+@@ -2489,6 +2489,7 @@ static const char *const rtn_type_names[
[RTN_THROW] = "THROW",
[RTN_NAT] = "NAT",
[RTN_XRESOLVE] = "XRESOLVE",
static inline const char *rtn_type(char *buf, size_t len, unsigned int t)
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
-@@ -179,6 +179,7 @@ static int ipmr_rule_action(struct fib_r
+@@ -178,6 +178,7 @@ static int ipmr_rule_action(struct fib_r
case FR_ACT_UNREACHABLE:
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
tb_id = fib_rule_get_table(rule, arg);
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
-@@ -162,6 +162,8 @@ static int ip6mr_rule_action(struct fib_
+@@ -166,6 +166,8 @@ static int ip6mr_rule_action(struct fib_
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
return -EACCES;
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
-@@ -900,6 +914,7 @@ static const int fib6_prop[RTN_MAX + 1]
+@@ -897,6 +911,7 @@ static const int fib6_prop[RTN_MAX + 1]
[RTN_BLACKHOLE] = -EINVAL,
[RTN_UNREACHABLE] = -EHOSTUNREACH,
[RTN_PROHIBIT] = -EACCES,
[RTN_THROW] = -EAGAIN,
[RTN_NAT] = -EINVAL,
[RTN_XRESOLVE] = -EINVAL,
-@@ -937,6 +952,10 @@ static void ip6_rt_init_dst_reject(struc
+@@ -934,6 +949,10 @@ static void ip6_rt_init_dst_reject(struc
rt->dst.output = ip6_pkt_prohibit_out;
rt->dst.input = ip6_pkt_prohibit;
break;
case RTN_THROW:
case RTN_UNREACHABLE:
default:
-@@ -3774,6 +3793,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -3728,6 +3747,17 @@ static int ip6_pkt_prohibit_out(struct n
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
/*
* Allocate a dst for local (unicast / anycast) address.
*/
-@@ -4221,7 +4251,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4183,7 +4213,8 @@ static int rtm_to_fib6_config(struct sk_
if (rtm->rtm_type == RTN_UNREACHABLE ||
rtm->rtm_type == RTN_BLACKHOLE ||
rtm->rtm_type == RTN_PROHIBIT ||
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
-@@ -5069,6 +5100,8 @@ static int ip6_route_dev_notify(struct n
+@@ -5106,6 +5137,8 @@ static int ip6_route_dev_notify(struct n
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
net->ipv6.ip6_prohibit_entry->dst.dev = dev;
net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
-@@ -5080,6 +5113,7 @@ static int ip6_route_dev_notify(struct n
+@@ -5117,6 +5150,7 @@ static int ip6_route_dev_notify(struct n
in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
#endif
}
-@@ -5274,6 +5308,15 @@ static int __net_init ip6_route_net_init
+@@ -5328,6 +5362,15 @@ static int __net_init ip6_route_net_init
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
ip6_template_metrics, true);
#endif
net->ipv6.sysctl.flush_delay = 0;
-@@ -5292,6 +5335,8 @@ out:
+@@ -5347,6 +5390,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
-@@ -5312,6 +5357,7 @@ static void __net_exit ip6_route_net_exi
+@@ -5367,6 +5412,7 @@ static void __net_exit ip6_route_net_exi
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
kfree(net->ipv6.ip6_prohibit_entry);
kfree(net->ipv6.ip6_blk_hole_entry);
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
}
-@@ -5388,6 +5434,9 @@ void __init ip6_route_init_special_entri
+@@ -5443,6 +5489,9 @@ void __init ip6_route_init_special_entri
init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
#endif
--- a/include/uapi/linux/icmpv6.h
+++ b/include/uapi/linux/icmpv6.h
-@@ -119,6 +119,8 @@ struct icmp6hdr {
+@@ -121,6 +121,8 @@ struct icmp6hdr {
#define ICMPV6_POLICY_FAIL 5
#define ICMPV6_REJECT_ROUTE 6
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1882,6 +1882,8 @@ struct net_device {
+@@ -1923,6 +1923,8 @@ struct net_device {
struct netdev_hw_addr_list mc;
struct netdev_hw_addr_list dev_addrs;
#endif
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -799,6 +799,7 @@ struct sk_buff {
+@@ -833,6 +833,7 @@ struct sk_buff {
#ifdef CONFIG_TLS_DEVICE
__u8 decrypted:1;
#endif
__u16 tc_index; /* traffic control index */
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -5468,6 +5468,9 @@ static enum gro_result dev_gro_receive(s
+@@ -5541,6 +5541,9 @@ static enum gro_result dev_gro_receive(s
int same_flow;
int grow;
if (netif_elide_gro(skb->dev))
goto normal;
-@@ -6962,6 +6965,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -7046,6 +7049,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
void *upper_priv, void *upper_info,
-@@ -7009,6 +7054,7 @@ static int __netdev_upper_dev_link(struc
+@@ -7093,6 +7138,7 @@ static int __netdev_upper_dev_link(struc
if (ret)
return ret;
ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
ret = notifier_to_errno(ret);
-@@ -7095,6 +7141,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -7179,6 +7225,7 @@ void netdev_upper_dev_unlink(struct net_
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
}
-@@ -7718,6 +7765,7 @@ int dev_set_mac_address(struct net_devic
+@@ -7831,6 +7878,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;
return 0;
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
-@@ -144,6 +144,18 @@ u32 eth_get_headlen(void *data, unsigned
+@@ -145,6 +145,18 @@ u32 eth_get_headlen(void *data, unsigned
}
EXPORT_SYMBOL(eth_get_headlen);
/**
* eth_type_trans - determine the packet's protocol ID.
* @skb: received socket data
-@@ -172,8 +184,12 @@ __be16 eth_type_trans(struct sk_buff *sk
- skb->pkt_type = PACKET_MULTICAST;
- }
- else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
-- dev->dev_addr)))
-+ dev->dev_addr))) {
- skb->pkt_type = PACKET_OTHERHOST;
+@@ -176,6 +188,10 @@ __be16 eth_type_trans(struct sk_buff *sk
+ } else {
+ skb->pkt_type = PACKET_OTHERHOST;
+ }
++
+ if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
+ dev->local_addr_mask))
+ skb->gro_skip = 1;
-+ }
+ }
/*
- * Some variants of DSA tagging don't have an ethertype field
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
-@@ -11,6 +11,7 @@
+@@ -10,6 +10,7 @@
#include <linux/of_net.h>
#include <linux/phy.h>
#include <linux/export.h>
/**
* of_get_phy_mode - Get phy mode for given device_node
-@@ -39,7 +40,7 @@ int of_get_phy_mode(struct device_node *
+@@ -38,7 +39,7 @@ int of_get_phy_mode(struct device_node *
}
EXPORT_SYMBOL_GPL(of_get_phy_mode);
{
struct property *pp = of_find_property(np, name, NULL);
-@@ -48,6 +49,79 @@ static const void *of_get_mac_addr(struc
+@@ -47,6 +48,79 @@ static const void *of_get_mac_addr(struc
return NULL;
}
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
* checked first, because that is supposed to contain to "most recent" MAC
-@@ -65,11 +139,18 @@ static const void *of_get_mac_addr(struc
+@@ -64,11 +138,18 @@ static const void *of_get_mac_addr(struc
* addresses. Some older U-Boots only initialized 'local-mac-address'. In
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1130,6 +1130,9 @@ void phy_detach(struct phy_device *phyde
+@@ -1352,6 +1352,9 @@ void phy_detach(struct phy_device *phyde
struct module *ndev_owner = dev->dev.parent->driver->owner;
struct mii_bus *bus;
sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
-@@ -560,6 +560,12 @@ struct phy_driver {
+@@ -538,6 +538,12 @@ struct phy_driver {
*/
int (*did_interrupt)(struct phy_device *phydev);
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
-@@ -12,12 +12,14 @@
+@@ -8,12 +8,14 @@
*/
#include <linux/phy.h>
#define AT803X_INTR_ENABLE 0x12
#define AT803X_INTR_ENABLE_AUTONEG_ERR BIT(15)
-@@ -45,6 +47,11 @@
+@@ -38,6 +40,11 @@
#define AT803X_REG_CHIP_CONFIG 0x1f
#define AT803X_BT_BX_REG_SEL 0x8000
#define AT803X_DEBUG_ADDR 0x1D
#define AT803X_DEBUG_DATA 0x1E
-@@ -73,6 +80,7 @@ MODULE_LICENSE("GPL");
+@@ -66,6 +73,7 @@ MODULE_LICENSE("GPL");
struct at803x_priv {
bool phy_reset:1;
};
struct at803x_context {
-@@ -249,8 +257,16 @@ static int at803x_probe(struct phy_devic
+@@ -247,8 +255,16 @@ static int at803x_probe(struct phy_devic
return 0;
}
int ret;
ret = genphy_config_init(phydev);
-@@ -271,6 +287,26 @@ static int at803x_config_init(struct phy
- return ret;
- }
+@@ -272,8 +288,11 @@ static int at803x_config_init(struct phy
+ if (ret < 0)
+ return ret;
+ pdata = dev_get_platdata(&phydev->mdio.dev);
-+ if (pdata) {
-+ if (pdata->disable_smarteee)
-+ at803x_disable_smarteee(phydev);
-+
-+ if (pdata->enable_rgmii_rx_delay)
-+ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
-+ AT803X_DEBUG_RX_CLK_DLY_EN);
-+ else
-+ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
-+ AT803X_DEBUG_RX_CLK_DLY_EN, 0);
+
-+ if (pdata->enable_rgmii_tx_delay)
-+ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
-+ AT803X_DEBUG_TX_CLK_DLY_EN);
-+ else
-+ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
-+ AT803X_DEBUG_TX_CLK_DLY_EN, 0);
-+ }
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+- phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
++ phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
++ (pdata && pdata->enable_rgmii_rx_delay)) {
+ /* If RGMII_ID or RGMII_RXID are specified enable RX delay,
+ * otherwise keep it disabled
+ */
+@@ -283,13 +302,17 @@ static int at803x_config_init(struct phy
+ }
+
+ if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+- phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
++ phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
++ (pdata && pdata->enable_rgmii_tx_delay)) {
+ /* If RGMII_ID or RGMII_TXID are specified enable TX delay,
+ * otherwise keep it disabled
+ */
+ ret = at803x_enable_tx_delay(phydev);
+ }
+
++ if (pdata && pdata->disable_smarteee)
++ at803x_disable_smarteee(phydev);
+
- return 0;
+ return ret;
}
-@@ -308,6 +344,8 @@ static int at803x_config_intr(struct phy
+@@ -327,6 +350,8 @@ static int at803x_config_intr(struct phy
static void at803x_link_change_notify(struct phy_device *phydev)
{
struct at803x_priv *priv = phydev->priv;
/*
* Conduct a hardware reset for AT8030/2 every time a link loss is
-@@ -336,6 +374,24 @@ static void at803x_link_change_notify(st
+@@ -355,6 +380,24 @@ static void at803x_link_change_notify(st
} else {
priv->phy_reset = false;
}
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
-@@ -46,6 +46,7 @@
- #define AT803X_FUNC_DATA 0x4003
+@@ -39,6 +39,7 @@
+ #define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A
#define AT803X_REG_CHIP_CONFIG 0x1f
#define AT803X_BT_BX_REG_SEL 0x8000
+#define AT803X_SGMII_ANEG_EN 0x1000
#define AT803X_PCS_SMART_EEE_CTRL3 0x805D
#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK 0x3
-@@ -268,6 +269,27 @@ static int at803x_config_init(struct phy
+@@ -266,6 +267,27 @@ static int at803x_config_init(struct phy
{
struct at803x_platform_data *pdata;
int ret;
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
-@@ -329,6 +329,14 @@ static int at803x_config_init(struct phy
- AT803X_DEBUG_TX_CLK_DLY_EN, 0);
+@@ -332,8 +332,12 @@ static int at803x_config_init(struct phy
+ ret = at803x_enable_tx_delay(phydev);
}
-+#ifdef CONFIG_OF_MDIO
-+ if (phydev->mdio.dev.of_node &&
-+ of_property_read_bool(phydev->mdio.dev.of_node,
-+ "at803x-disable-smarteee")) {
-+ at803x_disable_smarteee(phydev);
+- if (pdata && pdata->disable_smarteee)
++ if ((pdata && pdata->disable_smarteee) ||
++ (phydev->mdio.dev.of_node &&
++ of_property_read_bool(phydev->mdio.dev.of_node,
++ "at803x-disable-smarteee"))) {
+ at803x_disable_smarteee(phydev);
+ }
-+#endif
-+
- return 0;
- }
-@@ -367,6 +375,7 @@ static void at803x_link_change_notify(st
+ return ret;
+ }
+@@ -373,6 +377,7 @@ static void at803x_link_change_notify(st
{
struct at803x_priv *priv = phydev->priv;
struct at803x_platform_data *pdata;
pdata = dev_get_platdata(&phydev->mdio.dev);
/*
-@@ -396,8 +405,19 @@ static void at803x_link_change_notify(st
+@@ -402,8 +407,19 @@ static void at803x_link_change_notify(st
} else {
priv->phy_reset = false;
}
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
-@@ -89,6 +89,13 @@ config XEN_PCIDEV_FRONTEND
+@@ -115,6 +115,13 @@ config XEN_PCIDEV_FRONTEND
The PCI device frontend driver allows the kernel to import arbitrary
PCI devices from a PCI backend to support PCI driver domains.
/*
* The Mellanox Tavor device gives false positive parity errors. Mark this
* device with a broken_parity_status to allow PCI scanning code to "skip"
-@@ -3152,6 +3153,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
+@@ -3177,6 +3178,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
/*
* Ivytown NTB BAR sizes are misreported by the hardware due to an erratum.
* To work around this, query the size it should be configured to by the
-@@ -3177,6 +3180,8 @@ static void quirk_intel_ntb(struct pci_d
+@@ -3202,6 +3205,8 @@ static void quirk_intel_ntb(struct pci_d
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb);
/*
* Some BIOS implementations leave the Intel GPU interrupts enabled, even
* though no one is handling them (e.g., if the i915 driver is never
-@@ -3215,6 +3220,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
+@@ -3240,6 +3245,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
{
u16 cmd;
-@@ -1268,3 +1283,4 @@ static void quirk_usb_early_handoff(stru
+@@ -1262,3 +1277,4 @@ static void quirk_usb_early_handoff(stru
}
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff);
#endif /* __LINUX_USB_PCI_QUIRKS_H */
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
-@@ -473,7 +473,14 @@ extern int usb_hcd_pci_probe(struct pci_
+@@ -472,7 +472,14 @@ extern int usb_hcd_pci_probe(struct pci_
extern void usb_hcd_pci_remove(struct pci_dev *dev);
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
-@@ -46,6 +46,22 @@ config ATA_VERBOSE_ERROR
+@@ -45,6 +45,22 @@ config ATA_VERBOSE_ERROR
If unsure, say Y.
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
-@@ -893,6 +896,12 @@ struct ata_port {
+@@ -892,6 +895,12 @@ struct ata_port {
#ifdef CONFIG_ATA_ACPI
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1531,6 +1531,15 @@ config EMBEDDED
+@@ -1588,6 +1588,15 @@ config EMBEDDED
an embedded system so certain expert options are available
for configuration.
help
--- a/init/main.c
+++ b/init/main.c
-@@ -366,6 +366,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -365,6 +365,29 @@ static inline void setup_nr_cpu_ids(void
static inline void smp_prepare_cpus(unsigned int maxcpus) { }
#endif
/*
* We need to store the untouched command line for future reference.
* We also need to store the touched command line since the parameter
-@@ -558,6 +581,7 @@ asmlinkage __visible void __init start_k
+@@ -572,6 +595,7 @@ asmlinkage __visible void __init start_k
add_device_randomness(command_line, strlen(command_line));
boot_init_stack_canary();
mm_init_cpumask(&init_mm);