aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.19
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/pending-4.19')
-rw-r--r--target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch24
-rw-r--r--target/linux/generic/pending-4.19/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch2
-rw-r--r--target/linux/generic/pending-4.19/110-ehci_hcd_ignore_oc.patch12
-rw-r--r--target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch2
-rw-r--r--target/linux/generic/pending-4.19/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch2
-rw-r--r--target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch4
-rw-r--r--target/linux/generic/pending-4.19/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch18
-rw-r--r--target/linux/generic/pending-4.19/171-usb-dwc2-Fix-inefficient-copy-of-unaligned-buffers.patch50
-rw-r--r--target/linux/generic/pending-4.19/180-net-phy-at803x-add-support-for-AT8032.patch16
-rw-r--r--target/linux/generic/pending-4.19/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch43
-rw-r--r--target/linux/generic/pending-4.19/201-extra_optimization.patch2
-rw-r--r--target/linux/generic/pending-4.19/203-kallsyms_uncompressed.patch22
-rw-r--r--target/linux/generic/pending-4.19/205-backtrace_module_info.patch6
-rw-r--r--target/linux/generic/pending-4.19/220-optimize_inlining.patch18
-rw-r--r--target/linux/generic/pending-4.19/300-mips_expose_boot_raw.patch4
-rw-r--r--target/linux/generic/pending-4.19/304-mips_disable_fpu.patch4
-rw-r--r--target/linux/generic/pending-4.19/307-mips_highmem_offset.patch2
-rw-r--r--target/linux/generic/pending-4.19/308-mips32r2_tune.patch2
-rw-r--r--target/linux/generic/pending-4.19/332-arc-add-OWRTDTB-section.patch4
-rw-r--r--target/linux/generic/pending-4.19/340-MIPS-mm-remove-mips_dma_mapping_error.patch32
-rw-r--r--target/linux/generic/pending-4.19/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch160
-rw-r--r--target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch8
-rw-r--r--target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch4
-rw-r--r--target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch4
-rw-r--r--target/linux/generic/pending-4.19/403-mtd-hook-mtdsplit-to-Kbuild.patch2
-rw-r--r--target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch6
-rw-r--r--target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch106
-rw-r--r--target/linux/generic/pending-4.19/412-mtd-partial_eraseblock_unlock.patch2
-rw-r--r--target/linux/generic/pending-4.19/430-mtd-add-myloader-partition-parser.patch2
-rw-r--r--target/linux/generic/pending-4.19/440-block2mtd_init.patch20
-rw-r--r--target/linux/generic/pending-4.19/441-block2mtd_probe.patch8
-rw-r--r--target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch36
-rw-r--r--target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch4
-rw-r--r--target/linux/generic/pending-4.19/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch2
-rw-r--r--target/linux/generic/pending-4.19/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch2
-rw-r--r--target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch14
-rw-r--r--target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch14
-rw-r--r--target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch2
-rw-r--r--target/linux/generic/pending-4.19/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch2
-rw-r--r--target/linux/generic/pending-4.19/476-mtd-spi-nor-add-eon-en25q128.patch4
-rw-r--r--target/linux/generic/pending-4.19/477-mtd-add-spi-nor-add-mx25u3235f.patch2
-rw-r--r--target/linux/generic/pending-4.19/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch30
-rw-r--r--target/linux/generic/pending-4.19/479-mtd-spi-nor-add-eon-en25qh32.patch10
-rw-r--r--target/linux/generic/pending-4.19/480-mtd-set-rootfs-to-be-root-dev.patch2
-rw-r--r--target/linux/generic/pending-4.19/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch4
-rw-r--r--target/linux/generic/pending-4.19/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch4
-rw-r--r--target/linux/generic/pending-4.19/494-mtd-ubi-add-EOF-marker-support.patch2
-rw-r--r--target/linux/generic/pending-4.19/495-mtd-core-add-get_mtd_device_by_node.patch4
-rw-r--r--target/linux/generic/pending-4.19/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch2
-rw-r--r--target/linux/generic/pending-4.19/530-jffs2_make_lzma_available.patch6
-rw-r--r--target/linux/generic/pending-4.19/551-ubifs-fix-default-compression-selection.patch8
-rw-r--r--target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch2
-rw-r--r--target/linux/generic/pending-4.19/600-netfilter_conntrack_flush.patch43
-rw-r--r--target/linux/generic/pending-4.19/610-netfilter_match_bypass_default_checks.patch12
-rw-r--r--target/linux/generic/pending-4.19/611-netfilter_match_bypass_default_table.patch63
-rw-r--r--target/linux/generic/pending-4.19/612-netfilter_match_reduce_memory_access.patch2
-rw-r--r--target/linux/generic/pending-4.19/613-netfilter_optional_tcp_window_check.patch6
-rw-r--r--target/linux/generic/pending-4.19/616-net_optimize_xfrm_calls.patch4
-rw-r--r--target/linux/generic/pending-4.19/620-net_sched-codel-do-not-defer-queue-length-update.patch4
-rw-r--r--target/linux/generic/pending-4.19/630-packet_socket_type.patch16
-rw-r--r--target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch47
-rw-r--r--target/linux/generic/pending-4.19/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch8
-rw-r--r--target/linux/generic/pending-4.19/642-net-8021q-support-hardware-flow-table-offload.patch4
-rw-r--r--target/linux/generic/pending-4.19/643-net-bridge-support-hardware-flow-table-offload.patch4
-rw-r--r--target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch6
-rw-r--r--target/linux/generic/pending-4.19/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch2
-rw-r--r--target/linux/generic/pending-4.19/655-increase_skb_pad.patch2
-rw-r--r--target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch28
-rw-r--r--target/linux/generic/pending-4.19/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch86
-rw-r--r--target/linux/generic/pending-4.19/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch4
-rw-r--r--target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch26
-rw-r--r--target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch8
-rw-r--r--target/linux/generic/pending-4.19/701-phy_extension.patch2
-rw-r--r--target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch4
-rw-r--r--target/linux/generic/pending-4.19/734-net-phy-at803x-allow-to-configure-via-pdata.patch12
-rw-r--r--target/linux/generic/pending-4.19/735-net-phy-at803x-fix-at8033-sgmii-mode.patch2
-rw-r--r--target/linux/generic/pending-4.19/736-net-phy-at803x-allow-to-configure-via-dt.patch6
-rw-r--r--target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch36
-rw-r--r--target/linux/generic/pending-4.19/811-pci_disable_usb_common_quirks.patch18
-rw-r--r--target/linux/generic/pending-4.19/834-ledtrig-libata.patch12
-rw-r--r--target/linux/generic/pending-4.19/920-mangle_bootargs.patch6
-rw-r--r--target/linux/generic/pending-4.19/950-tty-serial-exar-generalize-rs485-setup.patch76
82 files changed, 449 insertions, 847 deletions
diff --git a/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch b/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
index 0c4a13f9df..be9ceebc3a 100644
--- a/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
+++ b/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
@@ -15,24 +15,12 @@ Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
-@@ -112,17 +112,16 @@ static int w1_gpio_probe_dt(struct platf
- static int w1_gpio_probe(struct platform_device *pdev)
- {
- struct w1_bus_master *master;
-- struct w1_gpio_platform_data *pdata;
-+ struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
+@@ -79,7 +79,7 @@ static int w1_gpio_probe(struct platform
+ enum gpiod_flags gflags = GPIOD_OUT_LOW_OPEN_DRAIN;
int err;
- if (of_have_populated_dt()) {
-+ if (of_have_populated_dt() && !pdata) {
- err = w1_gpio_probe_dt(pdev);
- if (err < 0)
- return err;
-+ pdata = dev_get_platdata(&pdev->dev);
- }
-
-- pdata = dev_get_platdata(&pdev->dev);
--
- if (!pdata) {
- dev_err(&pdev->dev, "No configuration data\n");
- return -ENXIO;
++ if (of_have_populated_dt() && !dev_get_platdata(&pdev->dev)) {
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata)
+ return -ENOMEM;
diff --git a/target/linux/generic/pending-4.19/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch b/target/linux/generic/pending-4.19/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch
index 92e86b24e7..0b87f493ec 100644
--- a/target/linux/generic/pending-4.19/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch
+++ b/target/linux/generic/pending-4.19/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
-@@ -360,6 +360,8 @@ static inline int is_sp_move_ins(union m
+@@ -361,6 +361,8 @@ static inline int is_sp_move_ins(union m
if (ip->i_format.opcode == addiu_op ||
ip->i_format.opcode == daddiu_op) {
diff --git a/target/linux/generic/pending-4.19/110-ehci_hcd_ignore_oc.patch b/target/linux/generic/pending-4.19/110-ehci_hcd_ignore_oc.patch
index b45b1c079c..cad00b5527 100644
--- a/target/linux/generic/pending-4.19/110-ehci_hcd_ignore_oc.patch
+++ b/target/linux/generic/pending-4.19/110-ehci_hcd_ignore_oc.patch
@@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
-@@ -651,7 +651,7 @@ static int ehci_run (struct usb_hcd *hcd
+@@ -638,7 +638,7 @@ static int ehci_run (struct usb_hcd *hcd
"USB %x.%x started, EHCI %x.%02x%s\n",
((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),
temp >> 8, temp & 0xff,
@@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
&ehci->regs->intr_enable); /* Turn On Interrupts */
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
-@@ -646,7 +646,7 @@ ehci_hub_status_data (struct usb_hcd *hc
+@@ -641,7 +641,7 @@ ehci_hub_status_data (struct usb_hcd *hc
* always set, seem to clear PORT_OCC and PORT_CSC when writing to
* PORT_POWER; that's surprising, but maybe within-spec.
*/
@@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
mask = PORT_CSC | PORT_PEC | PORT_OCC;
else
mask = PORT_CSC | PORT_PEC;
-@@ -1016,7 +1016,7 @@ int ehci_hub_control(
+@@ -1011,7 +1011,7 @@ int ehci_hub_control(
if (temp & PORT_PEC)
status |= USB_PORT_STAT_C_ENABLE << 16;
@@ -48,7 +48,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
/*
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
-@@ -263,6 +263,8 @@ static int ehci_platform_probe(struct pl
+@@ -208,6 +208,8 @@ static int ehci_platform_probe(struct pl
hcd->has_tt = 1;
if (pdata->reset_on_resume)
priv->reset_on_resume = true;
@@ -59,7 +59,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
if (ehci->big_endian_mmio) {
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
-@@ -231,6 +231,7 @@ struct ehci_hcd { /* one per controlle
+@@ -218,6 +218,7 @@ struct ehci_hcd { /* one per controlle
unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */
unsigned need_oc_pp_cycle:1; /* MPC834X port power */
unsigned imx28_write_fix:1; /* For Freescale i.MX28 */
@@ -69,7 +69,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
#define OHCI_CTRL_HCFS (3 << 6)
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
-@@ -49,6 +49,7 @@ struct usb_ehci_pdata {
+@@ -50,6 +50,7 @@ struct usb_ehci_pdata {
unsigned no_io_watchdog:1;
unsigned reset_on_resume:1;
unsigned dma_mask_64:1;
diff --git a/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
index 88870bc99e..9f13539fde 100644
--- a/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
+++ b/target/linux/generic/pending-4.19/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -6141,7 +6141,7 @@ static void __ref alloc_node_mem_map(str
+@@ -6370,7 +6370,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)
diff --git a/target/linux/generic/pending-4.19/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch b/target/linux/generic/pending-4.19/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch
index 9603385aed..bd5ed6f888 100644
--- a/target/linux/generic/pending-4.19/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch
+++ b/target/linux/generic/pending-4.19/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
-@@ -729,7 +729,7 @@ static void spi_set_cs(struct spi_device
+@@ -733,7 +733,7 @@ static void spi_set_cs(struct spi_device
enable = !enable;
if (gpio_is_valid(spi->cs_gpio)) {
diff --git a/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch b/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch
index 9fcffdee06..c8e68c2c96 100644
--- a/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch
+++ b/target/linux/generic/pending-4.19/150-bridge_allow_receiption_on_disabled_port.patch
@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
-@@ -239,7 +239,8 @@ static int br_handle_local_finish(struct
+@@ -197,7 +197,8 @@ static int br_handle_local_finish(struct
{
struct net_bridge_port *p = br_port_get_rcu(skb->dev);
@@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
BR_INPUT_SKB_CB(skb)->brdev = p->br->dev;
br_pass_frame_up(skb);
-@@ -327,6 +328,15 @@ rx_handler_result_t br_handle_frame(stru
+@@ -286,6 +287,15 @@ rx_handler_result_t br_handle_frame(stru
forward:
switch (p->state) {
diff --git a/target/linux/generic/pending-4.19/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.19/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch
index 9625a51129..c82ea5ab56 100644
--- a/target/linux/generic/pending-4.19/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch
+++ b/target/linux/generic/pending-4.19/161-mtd-part-add-generic-parsing-of-linux-part-probe.patch
@@ -21,9 +21,9 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- a/Documentation/devicetree/bindings/mtd/nand.txt
+++ b/Documentation/devicetree/bindings/mtd/nand.txt
-@@ -44,6 +44,22 @@ Optional NAND chip properties:
- used by the upper layers, and you want to make your NAND
- as reliable as possible.
+@@ -49,6 +49,22 @@ Optional NAND chip properties:
+
+ - nand-rb: shall contain the native Ready/Busy ids.
+- linux,part-probe: list of name as strings of the partition parser
+ which should be used to parse the partition table.
@@ -46,7 +46,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
errors per {size} bytes".
--- a/drivers/mtd/maps/physmap_of_core.c
+++ b/drivers/mtd/maps/physmap_of_core.c
-@@ -114,37 +114,9 @@ static struct mtd_info *obsolete_probe(s
+@@ -115,37 +115,9 @@ static struct mtd_info *obsolete_probe(s
static const char * const part_probe_types_def[] = {
"cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
@@ -59,7 +59,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
- if (count < 0)
- return part_probe_types_def;
-
-- res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL);
+- res = kcalloc(count + 1, sizeof(*res), GFP_KERNEL);
- if (!res)
- return NULL;
-
@@ -84,7 +84,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
const struct of_device_id *match;
struct device_node *dp = dev->dev.of_node;
struct resource res;
-@@ -310,14 +282,8 @@ static int of_flash_probe(struct platfor
+@@ -316,14 +288,8 @@ static int of_flash_probe(struct platfor
info->cmtd->dev.parent = &dev->dev;
mtd_set_of_node(info->cmtd, dp);
@@ -110,7 +110,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#include <linux/err.h>
#include <linux/of.h>
-@@ -844,6 +845,37 @@ void deregister_mtd_parser(struct mtd_pa
+@@ -796,6 +797,37 @@ void deregister_mtd_parser(struct mtd_pa
}
EXPORT_SYMBOL_GPL(deregister_mtd_parser);
@@ -148,7 +148,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
/*
* Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you
* are changing this array!
-@@ -993,6 +1025,13 @@ int parse_mtd_partitions(struct mtd_info
+@@ -948,6 +980,13 @@ int parse_mtd_partitions(struct mtd_info
struct mtd_partitions pparts = { };
struct mtd_part_parser *parser;
int ret, err = 0;
@@ -162,7 +162,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
if (!types)
types = mtd_is_partition(master) ? default_subpartition_types :
-@@ -1034,6 +1073,7 @@ int parse_mtd_partitions(struct mtd_info
+@@ -989,6 +1028,7 @@ int parse_mtd_partitions(struct mtd_info
if (ret < 0 && !err)
err = ret;
}
diff --git a/target/linux/generic/pending-4.19/171-usb-dwc2-Fix-inefficient-copy-of-unaligned-buffers.patch b/target/linux/generic/pending-4.19/171-usb-dwc2-Fix-inefficient-copy-of-unaligned-buffers.patch
deleted file mode 100644
index 588b571e01..0000000000
--- a/target/linux/generic/pending-4.19/171-usb-dwc2-Fix-inefficient-copy-of-unaligned-buffers.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 81da1738eee68f1961e03bdeb2d60cf0eb4dd713 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Antti=20Sepp=C3=A4l=C3=A4?= <a.seppala@gmail.com>
-Date: Thu, 5 Jul 2018 12:06:18 +0300
-Subject: [PATCH 2/2] usb: dwc2: Fix inefficient copy of unaligned buffers
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Make sure only to copy any actual data rather than the whole buffer,
-when releasing the temporary buffer used for unaligned non-isochronous
-transfers.
-
-Taken directly from commit 0efd937e27d5e ("USB: ehci-tegra: fix inefficient
-copy of unaligned buffers")
-
-Tested with Lantiq xRX200 (MIPS) and RPi Model B Rev 2 (ARM)
-
-Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
----
- drivers/usb/dwc2/hcd.c | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
---- a/drivers/usb/dwc2/hcd.c
-+++ b/drivers/usb/dwc2/hcd.c
-@@ -2669,6 +2669,7 @@ static int dwc2_alloc_split_dma_aligned_
- static void dwc2_free_dma_aligned_buffer(struct urb *urb)
- {
- void *stored_xfer_buffer;
-+ size_t length;
-
- if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER))
- return;
-@@ -2677,9 +2678,14 @@ static void dwc2_free_dma_aligned_buffer
- memcpy(&stored_xfer_buffer, urb->transfer_buffer +
- urb->transfer_buffer_length, sizeof(urb->transfer_buffer));
-
-- if (usb_urb_dir_in(urb))
-- memcpy(stored_xfer_buffer, urb->transfer_buffer,
-- urb->transfer_buffer_length);
-+ if (usb_urb_dir_in(urb)) {
-+ if (usb_pipeisoc(urb->pipe))
-+ length = urb->transfer_buffer_length;
-+ else
-+ length = urb->actual_length;
-+
-+ memcpy(stored_xfer_buffer, urb->transfer_buffer, length);
-+ }
- kfree(urb->transfer_buffer);
- urb->transfer_buffer = stored_xfer_buffer;
-
diff --git a/target/linux/generic/pending-4.19/180-net-phy-at803x-add-support-for-AT8032.patch b/target/linux/generic/pending-4.19/180-net-phy-at803x-add-support-for-AT8032.patch
index 828b160be9..e496301e4e 100644
--- a/target/linux/generic/pending-4.19/180-net-phy-at803x-add-support-for-AT8032.patch
+++ b/target/linux/generic/pending-4.19/180-net-phy-at803x-add-support-for-AT8032.patch
@@ -19,17 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
MODULE_DESCRIPTION("Atheros 803x PHY driver");
MODULE_AUTHOR("Matus Ujhelyi");
-@@ -256,7 +258,8 @@ static int at803x_probe(struct phy_devic
- if (!priv)
- return -ENOMEM;
-
-- if (phydev->drv->phy_id != ATH8030_PHY_ID)
-+ if (phydev->drv->phy_id != ATH8030_PHY_ID &&
-+ phydev->drv->phy_id != ATH8032_PHY_ID)
- goto does_not_require_reset_workaround;
-
- gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
-@@ -332,7 +335,7 @@ static void at803x_link_change_notify(st
+@@ -308,7 +310,7 @@ static void at803x_link_change_notify(st
struct at803x_priv *priv = phydev->priv;
/*
@@ -38,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* 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
-@@ -444,6 +447,24 @@ static struct phy_driver at803x_driver[]
+@@ -414,6 +416,24 @@ static struct phy_driver at803x_driver[]
.aneg_done = at803x_aneg_done,
.ack_interrupt = &at803x_ack_interrupt,
.config_intr = &at803x_config_intr,
@@ -63,7 +53,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
} };
module_phy_driver(at803x_driver);
-@@ -451,6 +472,7 @@ module_phy_driver(at803x_driver);
+@@ -421,6 +441,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 },
diff --git a/target/linux/generic/pending-4.19/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.19/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch
deleted file mode 100644
index 54858657cb..0000000000
--- a/target/linux/generic/pending-4.19/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From patchwork Fri Jul 21 18:36:24 2017
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [2/5] e1000e: Fix wrong comment related to link detection
-From: Benjamin Poirier <bpoirier@suse.com>
-X-Patchwork-Id: 9857489
-Message-Id: <20170721183627.13373-2-bpoirier@suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-Cc: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>,
- intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
- linux-kernel@vger.kernel.org
-Date: Fri, 21 Jul 2017 11:36:24 -0700
-
-Reading e1000e_check_for_copper_link() shows that get_link_status is set to
-false after link has been detected. Therefore, it stays TRUE until then.
-
-Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
-Tested-by: Aaron Brown <aaron.f.brown@intel.com>
----
- drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/ethernet/intel/e1000e/netdev.c
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
-@@ -5082,7 +5082,7 @@ static bool e1000e_has_link(struct e1000
-
- /* get_link_status is set on LSC (link status) interrupt or
- * Rx sequence error interrupt. get_link_status will stay
-- * false until the check_for_link establishes link
-+ * true until the check_for_link establishes link
- * for copper adapters ONLY
- */
- switch (hw->phy.media_type) {
-@@ -5100,7 +5100,7 @@ static bool e1000e_has_link(struct e1000
- break;
- case e1000_media_type_internal_serdes:
- ret_val = hw->mac.ops.check_for_link(hw);
-- link_active = adapter->hw.mac.serdes_has_link;
-+ link_active = hw->mac.serdes_has_link;
- break;
- default:
- case e1000_media_type_unknown:
diff --git a/target/linux/generic/pending-4.19/201-extra_optimization.patch b/target/linux/generic/pending-4.19/201-extra_optimization.patch
index c7790657fd..d86e29fc75 100644
--- a/target/linux/generic/pending-4.19/201-extra_optimization.patch
+++ b/target/linux/generic/pending-4.19/201-extra_optimization.patch
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
-@@ -654,12 +654,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
+@@ -659,12 +659,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
diff --git a/target/linux/generic/pending-4.19/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-4.19/203-kallsyms_uncompressed.patch
index fa68f307d4..074f0c45ed 100644
--- a/target/linux/generic/pending-4.19/203-kallsyms_uncompressed.patch
+++ b/target/linux/generic/pending-4.19/203-kallsyms_uncompressed.patch
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1081,6 +1081,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
+@@ -1140,6 +1140,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
the unaligned access emulation.
see arch/parisc/kernel/unaligned.c for reference
@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
-@@ -108,6 +108,11 @@ static unsigned int kallsyms_expand_symb
+@@ -74,6 +74,11 @@ static unsigned int kallsyms_expand_symb
* For every byte on the compressed symbol data, copy the table
* entry for that byte.
*/
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
while (len) {
tptr = &kallsyms_token_table[kallsyms_token_index[*data]];
data++;
-@@ -140,6 +145,9 @@ tail:
+@@ -106,6 +111,9 @@ tail:
*/
static char kallsyms_get_symbol_type(unsigned int off)
{
@@ -63,9 +63,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int all_symbols = 0;
+static int uncompressed = 0;
static int absolute_percpu = 0;
- static char symbol_prefix_char = '\0';
static int base_relative = 0;
-@@ -457,6 +458,9 @@ static void write_src(void)
+
+@@ -439,6 +440,9 @@ static void write_src(void)
free(markers);
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
output_label("kallsyms_token_table");
off = 0;
for (i = 0; i < 256; i++) {
-@@ -515,6 +519,9 @@ static void *find_token(unsigned char *s
+@@ -497,6 +501,9 @@ static void *find_token(unsigned char *s
{
int i;
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
for (i = 0; i < len - 1; i++) {
if (str[i] == token[0] && str[i+1] == token[1])
return &str[i];
-@@ -587,6 +594,9 @@ static void optimize_result(void)
+@@ -569,6 +576,9 @@ static void optimize_result(void)
{
int i, best;
@@ -95,9 +95,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* using the '\0' symbol last allows compress_symbols to use standard
* fast string functions */
for (i = 255; i >= 0; i--) {
-@@ -775,6 +785,8 @@ int main(int argc, char **argv)
- symbol_prefix_char = *p;
- } else if (strcmp(argv[i], "--base-relative") == 0)
+@@ -751,6 +761,8 @@ int main(int argc, char **argv)
+ absolute_percpu = 1;
+ else if (strcmp(argv[i], "--base-relative") == 0)
base_relative = 1;
+ else if (strcmp(argv[i], "--uncompressed") == 0)
+ uncompressed = 1;
@@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
-@@ -164,6 +164,10 @@ kallsyms()
+@@ -133,6 +133,10 @@ kallsyms()
kallsymopt="${kallsymopt} --base-relative"
fi
diff --git a/target/linux/generic/pending-4.19/205-backtrace_module_info.patch b/target/linux/generic/pending-4.19/205-backtrace_module_info.patch
index 4040f91021..5671173d45 100644
--- a/target/linux/generic/pending-4.19/205-backtrace_module_info.patch
+++ b/target/linux/generic/pending-4.19/205-backtrace_module_info.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
-@@ -670,8 +670,10 @@ char *symbol_string(char *buf, char *end
+@@ -681,8 +681,10 @@ char *symbol_string(char *buf, char *end
struct printf_spec spec, const char *fmt)
{
unsigned long value;
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
if (fmt[1] == 'R')
-@@ -685,11 +687,16 @@ char *symbol_string(char *buf, char *end
+@@ -696,11 +698,16 @@ char *symbol_string(char *buf, char *end
sprint_symbol(sym, value);
else
sprint_symbol_no_offset(sym, value);
@@ -42,4 +42,4 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ return string(buf, end, sym, spec);
}
- static noinline_for_stack
+ static const struct printf_spec default_str_spec = {
diff --git a/target/linux/generic/pending-4.19/220-optimize_inlining.patch b/target/linux/generic/pending-4.19/220-optimize_inlining.patch
index dca1dcb204..1411586086 100644
--- a/target/linux/generic/pending-4.19/220-optimize_inlining.patch
+++ b/target/linux/generic/pending-4.19/220-optimize_inlining.patch
@@ -1,6 +1,6 @@
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
-@@ -284,20 +284,6 @@ config CPA_DEBUG
+@@ -276,20 +276,6 @@ config CPA_DEBUG
---help---
Do change_page_attr() self-tests every 30 seconds.
@@ -23,7 +23,7 @@
depends on DEBUG_KERNEL
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
-@@ -137,6 +137,20 @@ endmenu # "printk and dmesg options"
+@@ -150,6 +150,20 @@ endmenu # "printk and dmesg options"
menu "Compile-time checks and compiler options"
@@ -46,7 +46,7 @@
depends on DEBUG_KERNEL && !COMPILE_TEST
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
-@@ -296,9 +296,6 @@ config ZONE_DMA32
+@@ -306,9 +306,6 @@ config ZONE_DMA32
config AUDIT_ARCH
def_bool y if X86_64
@@ -56,15 +56,15 @@
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
def_bool y
---- a/include/linux/compiler-gcc.h
-+++ b/include/linux/compiler-gcc.h
-@@ -90,8 +90,7 @@
+--- a/include/linux/compiler_types.h
++++ b/include/linux/compiler_types.h
+@@ -260,8 +260,7 @@ struct ftrace_likely_data {
* of extern inline functions at link time.
* A lot of inline functions can cause havoc with function tracing.
*/
--#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
-- !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-+#if !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
+-#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
#else
diff --git a/target/linux/generic/pending-4.19/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-4.19/300-mips_expose_boot_raw.patch
index 5384be15ca..5be7ea7c12 100644
--- a/target/linux/generic/pending-4.19/300-mips_expose_boot_raw.patch
+++ b/target/linux/generic/pending-4.19/300-mips_expose_boot_raw.patch
@@ -9,7 +9,7 @@ Acked-by: Rob Landley <rob@landley.net>
---
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -1067,9 +1067,6 @@ config FW_ARC
+@@ -1059,9 +1059,6 @@ config FW_ARC
config ARCH_MAY_HAVE_PC_FDC
bool
@@ -19,7 +19,7 @@ Acked-by: Rob Landley <rob@landley.net>
config CEVT_BCM1480
bool
-@@ -2967,6 +2964,18 @@ choice
+@@ -2965,6 +2962,18 @@ choice
bool "Extend builtin kernel arguments with bootloader arguments"
endchoice
diff --git a/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch
index 22e2e86206..61f0378a47 100644
--- a/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch
+++ b/target/linux/generic/pending-4.19/304-mips_disable_fpu.patch
@@ -24,7 +24,7 @@ v2: incorporated changes suggested by Jonas Gorski
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -2891,6 +2891,20 @@ config MIPS_O32_FP64_SUPPORT
+@@ -2889,6 +2889,20 @@ config MIPS_O32_FP64_SUPPORT
If unsure, say N.
@@ -47,7 +47,7 @@ v2: incorporated changes suggested by Jonas Gorski
select OF
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
-@@ -315,7 +315,7 @@ OBJCOPYFLAGS += --remove-section=.regin
+@@ -322,7 +322,7 @@ OBJCOPYFLAGS += --remove-section=.regin
head-y := arch/mips/kernel/head.o
libs-y += arch/mips/lib/
diff --git a/target/linux/generic/pending-4.19/307-mips_highmem_offset.patch b/target/linux/generic/pending-4.19/307-mips_highmem_offset.patch
index 0529b0c5c8..9dd2fa9863 100644
--- a/target/linux/generic/pending-4.19/307-mips_highmem_offset.patch
+++ b/target/linux/generic/pending-4.19/307-mips_highmem_offset.patch
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/include/asm/mach-generic/spaces.h
+++ b/arch/mips/include/asm/mach-generic/spaces.h
-@@ -46,7 +46,7 @@
+@@ -50,7 +50,7 @@
* Memory above this physical address will be considered highmem.
*/
#ifndef HIGHMEM_START
diff --git a/target/linux/generic/pending-4.19/308-mips32r2_tune.patch b/target/linux/generic/pending-4.19/308-mips32r2_tune.patch
index 39167bf4ae..17c867acc5 100644
--- a/target/linux/generic/pending-4.19/308-mips32r2_tune.patch
+++ b/target/linux/generic/pending-4.19/308-mips32r2_tune.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
-@@ -161,7 +161,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4
+@@ -171,7 +171,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
diff --git a/target/linux/generic/pending-4.19/332-arc-add-OWRTDTB-section.patch b/target/linux/generic/pending-4.19/332-arc-add-OWRTDTB-section.patch
index 58f14b6ca5..963547eedd 100644
--- a/target/linux/generic/pending-4.19/332-arc-add-OWRTDTB-section.patch
+++ b/target/linux/generic/pending-4.19/332-arc-add-OWRTDTB-section.patch
@@ -38,7 +38,7 @@ Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
;----------------------------------------------------------------
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
-@@ -421,6 +421,8 @@ static inline int is_kernel(unsigned lon
+@@ -456,6 +456,8 @@ static inline int is_kernel(unsigned lon
return 0;
}
@@ -47,7 +47,7 @@ Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
void __init setup_arch(char **cmdline_p)
{
#ifdef CONFIG_ARC_UBOOT_SUPPORT
-@@ -434,7 +436,7 @@ void __init setup_arch(char **cmdline_p)
+@@ -469,7 +471,7 @@ void __init setup_arch(char **cmdline_p)
#endif
{
/* No, so try the embedded one */
diff --git a/target/linux/generic/pending-4.19/340-MIPS-mm-remove-mips_dma_mapping_error.patch b/target/linux/generic/pending-4.19/340-MIPS-mm-remove-mips_dma_mapping_error.patch
deleted file mode 100644
index 8d6cada842..0000000000
--- a/target/linux/generic/pending-4.19/340-MIPS-mm-remove-mips_dma_mapping_error.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Tue, 5 Dec 2017 12:34:31 +0100
-Subject: [PATCH] MIPS: mm: remove mips_dma_mapping_error
-
-dma_mapping_error() already checks if ops->mapping_error is a null
-pointer
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/arch/mips/mm/dma-default.c
-+++ b/arch/mips/mm/dma-default.c
-@@ -373,11 +373,6 @@ static void mips_dma_sync_sg_for_device(
- }
- }
-
--static int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
--{
-- return 0;
--}
--
- static int mips_dma_supported(struct device *dev, u64 mask)
- {
- return plat_dma_supported(dev, mask);
-@@ -406,7 +401,6 @@ static const struct dma_map_ops mips_def
- .sync_single_for_device = mips_dma_sync_single_for_device,
- .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu,
- .sync_sg_for_device = mips_dma_sync_sg_for_device,
-- .mapping_error = mips_dma_mapping_error,
- .dma_supported = mips_dma_supported
- };
-
diff --git a/target/linux/generic/pending-4.19/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.19/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch
index de2dd65b17..44d1520639 100644
--- a/target/linux/generic/pending-4.19/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch
+++ b/target/linux/generic/pending-4.19/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch
@@ -1,140 +1,82 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Tue, 5 Dec 2017 12:46:01 +0100
-Subject: [PATCH] MIPS: mm: remove no-op dma_map_ops where possible
+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
-If no post-DMA flush is required, and the platform does not provide
-plat_unmap_dma_mem(), there is no need to include unmap or sync_for_cpu
-ops.
+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.
-With this patch they are compiled out to improve icache footprint
-on devices that handle lots of DMA traffic (especially network routers).
+This will hopefully improve the performance of the not affected devices.
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
+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
-@@ -221,6 +221,7 @@ config BMIPS_GENERIC
- select BRCMSTB_L2_IRQ
- select IRQ_MIPS_CPU
- select DMA_NONCOHERENT
-+ select DMA_UNMAP_POST_FLUSH
- select SYS_SUPPORTS_32BIT_KERNEL
- select SYS_SUPPORTS_LITTLE_ENDIAN
- select SYS_SUPPORTS_BIG_ENDIAN
-@@ -346,6 +347,7 @@ config MACH_JAZZ
- select CSRC_R4K
- select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN
- select GENERIC_ISA_DMA
-+ select DMA_UNMAP_POST_FLUSH
- select HAVE_PCSPKR_PLATFORM
- select IRQ_MIPS_CPU
- select I8253
-@@ -1128,6 +1130,9 @@ config DMA_NONCOHERENT
+@@ -1113,7 +1113,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
-
-+config DMA_UNMAP_POST_FLUSH
-+ bool
-+
- config NEED_DMA_MAP_STATE
- bool
-
-@@ -1652,6 +1657,7 @@ config CPU_R10000
- select CPU_SUPPORTS_64BIT_KERNEL
- select CPU_SUPPORTS_HIGHMEM
- select CPU_SUPPORTS_HUGEPAGES
-+ select DMA_UNMAP_POST_FLUSH
- help
- MIPS Technologies R10000-series processors.
-
-@@ -1900,9 +1906,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
- bool
+ select DMA_NONCOHERENT_MMAP
+ select DMA_NONCOHERENT_CACHE_SYNC
+@@ -1894,9 +1893,11 @@ config SYS_HAS_CPU_MIPS32_R3_5
config SYS_HAS_CPU_MIPS32_R5
-+ select DMA_UNMAP_POST_FLUSH
bool
++ select ARCH_HAS_SYNC_DMA_FOR_CPU
config SYS_HAS_CPU_MIPS32_R6
-+ select DMA_UNMAP_POST_FLUSH
bool
++ select ARCH_HAS_SYNC_DMA_FOR_CPU
config SYS_HAS_CPU_MIPS64_R1
-@@ -1912,6 +1920,7 @@ config SYS_HAS_CPU_MIPS64_R2
bool
+@@ -1906,6 +1907,7 @@ config SYS_HAS_CPU_MIPS64_R2
config SYS_HAS_CPU_MIPS64_R6
-+ select DMA_UNMAP_POST_FLUSH
bool
++ select ARCH_HAS_SYNC_DMA_FOR_CPU
config SYS_HAS_CPU_R3000
---- a/arch/mips/mm/dma-default.c
-+++ b/arch/mips/mm/dma-default.c
-@@ -267,8 +267,9 @@ static inline void __dma_sync(struct pag
- } while (left);
- }
+ bool
+@@ -1942,6 +1944,7 @@ config SYS_HAS_CPU_R8000
--static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,
-- size_t size, enum dma_data_direction direction, unsigned long attrs)
-+static void __maybe_unused
-+mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
-+ enum dma_data_direction direction, unsigned long attrs)
- {
- if (cpu_needs_post_dma_flush(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC))
- __dma_sync(dma_addr_to_page(dev, dma_addr),
-@@ -308,9 +309,10 @@ static dma_addr_t mips_dma_map_page(stru
- return plat_map_dma_mem_page(dev, page) + offset;
- }
+ config SYS_HAS_CPU_R10000
+ bool
++ select ARCH_HAS_SYNC_DMA_FOR_CPU
--static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
-- int nhwentries, enum dma_data_direction direction,
-- unsigned long attrs)
-+static void __maybe_unused
-+mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
-+ int nhwentries, enum dma_data_direction direction,
-+ unsigned long attrs)
- {
- int i;
- struct scatterlist *sg;
-@@ -325,8 +327,9 @@ static void mips_dma_unmap_sg(struct dev
- }
+ config SYS_HAS_CPU_RM7000
+ bool
+@@ -1970,6 +1973,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);
}
--static void mips_dma_sync_single_for_cpu(struct device *dev,
-- dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
-+static void __maybe_unused
-+mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
-+ size_t size, enum dma_data_direction direction)
++#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(dma_addr_to_page(dev, dma_handle),
-@@ -342,9 +345,9 @@ static void mips_dma_sync_single_for_dev
- dma_handle & ~PAGE_MASK, size, direction);
+ dma_sync_phys(paddr, size, dir);
}
-
--static void mips_dma_sync_sg_for_cpu(struct device *dev,
-- struct scatterlist *sglist, int nelems,
-- enum dma_data_direction direction)
-+static void __maybe_unused
-+mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist,
-+ int nelems, enum dma_data_direction direction)
- {
- int i;
- struct scatterlist *sg;
-@@ -394,12 +397,14 @@ static const struct dma_map_ops mips_def
- .free = mips_dma_free_coherent,
- .mmap = mips_dma_mmap,
- .map_page = mips_dma_map_page,
-- .unmap_page = mips_dma_unmap_page,
- .map_sg = mips_dma_map_sg,
-+#ifdef CONFIG_DMA_UNMAP_POST_FLUSH
-+ .unmap_page = mips_dma_unmap_page,
- .unmap_sg = mips_dma_unmap_sg,
- .sync_single_for_cpu = mips_dma_sync_single_for_cpu,
-- .sync_single_for_device = mips_dma_sync_single_for_device,
- .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu,
+#endif
-+ .sync_single_for_device = mips_dma_sync_single_for_device,
- .sync_sg_for_device = mips_dma_sync_sg_for_device,
- .dma_supported = mips_dma_supported
- };
+
+ void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+ enum dma_data_direction direction)
diff --git a/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch
index 5f8899ea61..c449fef041 100644
--- a/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/pending-4.19/400-mtd-add-rootfs-split-support.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -12,6 +12,23 @@ menuconfig MTD
+@@ -11,6 +11,23 @@ menuconfig MTD
if MTD
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
* the pointer to that structure.
-@@ -668,6 +672,7 @@ int mtd_add_partition(struct mtd_info *p
+@@ -620,6 +624,7 @@ int mtd_add_partition(struct mtd_info *p
mutex_unlock(&mtd_partitions_mutex);
add_mtd_device(&new->mtd);
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
mtd_add_partition_attrs(new);
-@@ -746,6 +751,29 @@ int mtd_del_partition(struct mtd_info *m
+@@ -698,6 +703,29 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* 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
-@@ -777,6 +805,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -729,6 +757,7 @@ int add_mtd_partitions(struct mtd_info *
mutex_unlock(&mtd_partitions_mutex);
add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch
index 359c4c167b..a454b5cf7a 100644
--- a/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch
+++ b/target/linux/generic/pending-4.19/401-mtd-add-support-for-different-partition-parser-types.patch
@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
/*
* Given a pointer to the MTD object in the mtd_part structure, we can retrieve
-@@ -751,6 +755,36 @@ int mtd_del_partition(struct mtd_info *m
+@@ -703,6 +707,36 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
@@ -57,7 +57,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
#else
-@@ -1122,6 +1156,61 @@ void mtd_part_parser_cleanup(struct mtd_
+@@ -1077,6 +1111,61 @@ void mtd_part_parser_cleanup(struct mtd_
}
}
diff --git a/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
index e870663355..afe3ec7756 100644
--- a/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
+++ b/target/linux/generic/pending-4.19/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch
@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -793,6 +793,7 @@ run_parsers_by_type(struct mtd_part *sla
+@@ -745,6 +745,7 @@ run_parsers_by_type(struct mtd_part *sla
static void split_firmware(struct mtd_info *master, struct mtd_part *part)
{
@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
}
static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part)
-@@ -802,6 +803,12 @@ static void mtd_partition_split(struct m
+@@ -754,6 +755,12 @@ static void mtd_partition_split(struct m
if (rootfs_found)
return;
diff --git a/target/linux/generic/pending-4.19/403-mtd-hook-mtdsplit-to-Kbuild.patch b/target/linux/generic/pending-4.19/403-mtd-hook-mtdsplit-to-Kbuild.patch
index 89c202bc0d..60cf043e9b 100644
--- a/target/linux/generic/pending-4.19/403-mtd-hook-mtdsplit-to-Kbuild.patch
+++ b/target/linux/generic/pending-4.19/403-mtd-hook-mtdsplit-to-Kbuild.patch
@@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -27,6 +27,8 @@ config MTD_SPLIT_FIRMWARE_NAME
+@@ -26,6 +26,8 @@ config MTD_SPLIT_FIRMWARE_NAME
depends on MTD_SPLIT_FIRMWARE
default "firmware"
diff --git a/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch
index 94c59df01d..f50d933e1b 100644
--- a/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch
+++ b/target/linux/generic/pending-4.19/404-mtd-add-more-helper-functions.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -1235,6 +1235,24 @@ int mtd_is_partition(const struct mtd_in
+@@ -1190,6 +1190,24 @@ int mtd_is_partition(const struct mtd_in
}
EXPORT_SYMBOL_GPL(mtd_is_partition);
@@ -38,8 +38,8 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
{
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
-@@ -494,6 +494,24 @@ static inline uint32_t mtd_mod_by_eb(uin
- return do_div(sz, mtd->erasesize);
+@@ -507,6 +507,24 @@ static inline void mtd_align_erase_req(s
+ req->len += mtd->erasesize - mod;
}
+static inline uint64_t mtd_roundup_to_eb(uint64_t sz, struct mtd_info *mtd)
diff --git a/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch
index 3b862dae61..978d6a6f7b 100644
--- a/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch
+++ b/target/linux/generic/pending-4.19/411-mtd-partial_eraseblock_write.patch
@@ -19,95 +19,86 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Our partition linked list */
static LIST_HEAD(mtd_partitions);
static DEFINE_MUTEX(mtd_partitions_mutex);
-@@ -255,13 +257,61 @@ static int part_erase(struct mtd_info *m
+@@ -221,6 +223,53 @@ static int part_erase(struct mtd_info *m
+ {
struct mtd_part *part = mtd_to_part(mtd);
int ret;
-
++ size_t wrlen = 0;
++ u8 *erase_buf = NULL;
++ u32 erase_buf_ofs = 0;
++ bool partial_start = false;
+
-+ instr->partial_start = false;
+ if (mtd->flags & MTD_ERASE_PARTIAL) {
+ size_t readlen = 0;
+ u64 mtd_ofs;
+
-+ instr->erase_buf = kmalloc(part->parent->erasesize, GFP_ATOMIC);
-+ if (!instr->erase_buf)
++ erase_buf = kmalloc(part->parent->erasesize, GFP_ATOMIC);
++ if (!erase_buf)
+ return -ENOMEM;
+
+ mtd_ofs = part->offset + instr->addr;
-+ instr->erase_buf_ofs = do_div(mtd_ofs, part->parent->erasesize);
++ erase_buf_ofs = do_div(mtd_ofs, part->parent->erasesize);
+
-+ if (instr->erase_buf_ofs > 0) {
-+ instr->addr -= instr->erase_buf_ofs;
++ if (erase_buf_ofs > 0) {
++ instr->addr -= erase_buf_ofs;
+ ret = mtd_read(part->parent,
+ instr->addr + part->offset,
+ part->parent->erasesize,
-+ &readlen, instr->erase_buf);
++ &readlen, erase_buf);
+
-+ instr->len += instr->erase_buf_ofs;
-+ instr->partial_start = true;
++ instr->len += erase_buf_ofs;
++ partial_start = true;
+ } else {
+ mtd_ofs = part->offset + part->mtd.size;
-+ instr->erase_buf_ofs = part->parent->erasesize -
++ erase_buf_ofs = part->parent->erasesize -
+ do_div(mtd_ofs, part->parent->erasesize);
+
-+ if (instr->erase_buf_ofs > 0) {
-+ instr->len += instr->erase_buf_ofs;
++ if (erase_buf_ofs > 0) {
++ instr->len += erase_buf_ofs;
+ ret = mtd_read(part->parent,
+ part->offset + instr->addr +
+ instr->len - part->parent->erasesize,
+ part->parent->erasesize, &readlen,
-+ instr->erase_buf);
++ erase_buf);
+ } else {
+ ret = 0;
+ }
+ }
+ if (ret < 0) {
-+ kfree(instr->erase_buf);
++ kfree(erase_buf);
+ return ret;
+ }
+
+ }
-+
+
instr->addr += part->offset;
ret = part->parent->_erase(part->parent, instr);
- if (ret) {
- if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
- instr->fail_addr -= part->offset;
- instr->addr -= part->offset;
-+ if (mtd->flags & MTD_ERASE_PARTIAL)
-+ kfree(instr->erase_buf);
- }
+@@ -228,6 +277,24 @@ static int part_erase(struct mtd_info *m
+ instr->fail_addr -= part->offset;
+ instr->addr -= part->offset;
+
++ if (mtd->flags & MTD_ERASE_PARTIAL) {
++ if (partial_start) {
++ part->parent->_write(part->parent,
++ instr->addr, erase_buf_ofs,
++ &wrlen, erase_buf);
++ instr->addr += erase_buf_ofs;
++ } else {
++ instr->len -= erase_buf_ofs;
++ part->parent->_write(part->parent,
++ instr->addr + instr->len,
++ erase_buf_ofs, &wrlen,
++ erase_buf +
++ part->parent->erasesize -
++ erase_buf_ofs);
++ }
++ kfree(erase_buf);
++ }
+
return ret;
}
-@@ -269,6 +319,25 @@ void mtd_erase_callback(struct erase_inf
- {
- if (instr->mtd->_erase == part_erase) {
- struct mtd_part *part = mtd_to_part(instr->mtd);
-+ size_t wrlen = 0;
-+
-+ if (instr->mtd->flags & MTD_ERASE_PARTIAL) {
-+ if (instr->partial_start) {
-+ part->parent->_write(part->parent,
-+ instr->addr, instr->erase_buf_ofs,
-+ &wrlen, instr->erase_buf);
-+ instr->addr += instr->erase_buf_ofs;
-+ } else {
-+ instr->len -= instr->erase_buf_ofs;
-+ part->parent->_write(part->parent,
-+ instr->addr + instr->len,
-+ instr->erase_buf_ofs, &wrlen,
-+ instr->erase_buf +
-+ part->parent->erasesize -
-+ instr->erase_buf_ofs);
-+ }
-+ kfree(instr->erase_buf);
-+ }
-
- if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
- instr->fail_addr -= part->offset;
-@@ -584,19 +653,22 @@ static struct mtd_part *allocate_partiti
+@@ -536,19 +603,22 @@ static struct mtd_part *allocate_partiti
remainder = do_div(tmp, wr_alignment);
if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
/* Doesn't start on a boundary of major erase size */
@@ -139,16 +130,3 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
mtd_set_ooblayout(&slave->mtd, &part_ooblayout_ops);
---- a/include/linux/mtd/mtd.h
-+++ b/include/linux/mtd/mtd.h
-@@ -56,6 +56,10 @@ struct erase_info {
- u_long priv;
- u_char state;
- struct erase_info *next;
-+
-+ u8 *erase_buf;
-+ u32 erase_buf_ofs;
-+ bool partial_start;
- };
-
- struct mtd_erase_region_info {
diff --git a/target/linux/generic/pending-4.19/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.19/412-mtd-partial_eraseblock_unlock.patch
index 3ac3496c69..e038c4e60c 100644
--- a/target/linux/generic/pending-4.19/412-mtd-partial_eraseblock_unlock.patch
+++ b/target/linux/generic/pending-4.19/412-mtd-partial_eraseblock_unlock.patch
@@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey <tharvey@gateworks.com>
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
-@@ -357,7 +357,16 @@ static int part_lock(struct mtd_info *mt
+@@ -307,7 +307,16 @@ static int part_lock(struct mtd_info *mt
static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
{
struct mtd_part *part = mtd_to_part(mtd);
diff --git a/target/linux/generic/pending-4.19/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/pending-4.19/430-mtd-add-myloader-partition-parser.patch
index 889c452057..bd49893dd8 100644
--- a/target/linux/generic/pending-4.19/430-mtd-add-myloader-partition-parser.patch
+++ b/target/linux/generic/pending-4.19/430-mtd-add-myloader-partition-parser.patch
@@ -12,7 +12,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -178,6 +178,22 @@ menu "Partition parsers"
+@@ -177,6 +177,22 @@ menu "Partition parsers"
source "drivers/mtd/parsers/Kconfig"
endmenu
diff --git a/target/linux/generic/pending-4.19/440-block2mtd_init.patch b/target/linux/generic/pending-4.19/440-block2mtd_init.patch
index 8834788732..b8ec11f3dd 100644
--- a/target/linux/generic/pending-4.19/440-block2mtd_init.patch
+++ b/target/linux/generic/pending-4.19/440-block2mtd_init.patch
@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mutex.h>
#include <linux/mount.h>
#include <linux/slab.h>
-@@ -219,7 +220,7 @@ static void block2mtd_free_device(struct
+@@ -214,7 +215,7 @@ static void block2mtd_free_device(struct
static struct block2mtd_dev *add_device(char *devname, int erase_size,
@@ -25,15 +25,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
#ifndef MODULE
int i;
-@@ -227,6 +228,7 @@ static struct block2mtd_dev *add_device(
+@@ -222,6 +223,7 @@ static struct block2mtd_dev *add_device(
const fmode_t mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL;
- struct block_device *bdev = ERR_PTR(-ENODEV);
+ struct block_device *bdev;
struct block2mtd_dev *dev;
+ struct mtd_partition *part;
char *name;
if (!devname)
-@@ -283,13 +285,16 @@ static struct block2mtd_dev *add_device(
+@@ -278,13 +280,16 @@ static struct block2mtd_dev *add_device(
/* Setup the MTD structure */
/* make the name contain the block device in */
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
dev->mtd.erasesize = erase_size;
dev->mtd.writesize = 1;
dev->mtd.writebufsize = PAGE_SIZE;
-@@ -302,7 +307,11 @@ static struct block2mtd_dev *add_device(
+@@ -297,7 +302,11 @@ static struct block2mtd_dev *add_device(
dev->mtd.priv = dev;
dev->mtd.owner = THIS_MODULE;
@@ -65,7 +65,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Device didn't get added, so free the entry */
goto err_destroy_mutex;
}
-@@ -310,8 +319,7 @@ static struct block2mtd_dev *add_device(
+@@ -305,8 +314,7 @@ static struct block2mtd_dev *add_device(
list_add(&dev->list, &blkmtd_device_list);
pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n",
dev->mtd.index,
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return dev;
err_destroy_mutex:
-@@ -384,7 +392,7 @@ static int block2mtd_setup2(const char *
+@@ -379,7 +387,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;
@@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
char *name;
size_t erase_size = PAGE_SIZE;
unsigned long timeout = MTD_DEFAULT_TIMEOUT;
-@@ -398,7 +406,7 @@ static int block2mtd_setup2(const char *
+@@ -393,7 +401,7 @@ static int block2mtd_setup2(const char *
strcpy(str, val);
kill_final_newline(str);
@@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
token[i] = strsep(&str, ",");
if (str) {
-@@ -424,8 +432,10 @@ static int block2mtd_setup2(const char *
+@@ -419,8 +427,10 @@ static int block2mtd_setup2(const char *
return 0;
}
}
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;
}
-@@ -459,7 +469,7 @@ static int block2mtd_setup(const char *v
+@@ -454,7 +464,7 @@ static int block2mtd_setup(const char *v
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
diff --git a/target/linux/generic/pending-4.19/441-block2mtd_probe.patch b/target/linux/generic/pending-4.19/441-block2mtd_probe.patch
index fee970ab61..7e974e01ed 100644
--- a/target/linux/generic/pending-4.19/441-block2mtd_probe.patch
+++ b/target/linux/generic/pending-4.19/441-block2mtd_probe.patch
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
-@@ -392,7 +392,7 @@ static int block2mtd_setup2(const char *
+@@ -387,7 +387,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;
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
char *name;
size_t erase_size = PAGE_SIZE;
unsigned long timeout = MTD_DEFAULT_TIMEOUT;
-@@ -406,7 +406,7 @@ static int block2mtd_setup2(const char *
+@@ -401,7 +401,7 @@ static int block2mtd_setup2(const char *
strcpy(str, val);
kill_final_newline(str);
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
token[i] = strsep(&str, ",");
if (str) {
-@@ -435,6 +435,9 @@ static int block2mtd_setup2(const char *
+@@ -430,6 +430,9 @@ static int block2mtd_setup2(const char *
if (token[2] && (strlen(token[2]) + 1 > 80))
pr_err("mtd device name too long\n");
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
add_device(name, erase_size, token[2], timeout);
return 0;
-@@ -469,7 +472,7 @@ static int block2mtd_setup(const char *v
+@@ -464,7 +467,7 @@ static int block2mtd_setup(const char *v
module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
diff --git a/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch b/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
deleted file mode 100644
index accd63df58..0000000000
--- a/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 23 Feb 2018 17:12:16 +0100
-Subject: [PATCH] mtd: m25p80: allow fallback from spi_flash_read to regular
- SPI transfer
-
-Some flash controllers, e.g. on the ath79 platform can support a fast
-flash read via memory mapping, but only if the flash chip is in
-3-byte address mode.
-
-Since spi_flash_read_supported does not have access to the same data as
-spi_flash_read, the driver can't detect an unsupported call until m25p80
-has decided to use spi_flash_read.
-
-Allow the driver to indicate a fallback to a regular SPI transfer by
-returning -EOPNOTSUPP
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -170,9 +170,11 @@ static ssize_t m25p80_read(struct spi_no
- msg.data_nbits = data_nbits;
-
- ret = spi_flash_read(spi, &msg);
-- if (ret < 0)
-- return ret;
-- return msg.retlen;
-+ if (ret != -EOPNOTSUPP) {
-+ if (ret < 0)
-+ return ret;
-+ return msg.retlen;
-+ }
- }
-
- spi_message_init(&m);
diff --git a/target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch b/target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch
index 571c9b885f..ecc3ea1de6 100644
--- a/target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch
+++ b/target/linux/generic/pending-4.19/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1377,7 +1377,7 @@ static int spi_nor_write(struct mtd_info
+@@ -1455,7 +1455,7 @@ static int spi_nor_write(struct mtd_info
write_enable(nor);
ret = nor->write(nor, addr, page_remain, buf + i);
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto write_err;
written = ret;
-@@ -1386,13 +1386,6 @@ static int spi_nor_write(struct mtd_info
+@@ -1464,13 +1464,6 @@ static int spi_nor_write(struct mtd_info
goto write_err;
*retlen += written;
i += written;
diff --git a/target/linux/generic/pending-4.19/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch b/target/linux/generic/pending-4.19/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch
index 41f9d31cb0..88d386302a 100644
--- a/target/linux/generic/pending-4.19/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch
+++ b/target/linux/generic/pending-4.19/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -811,7 +811,7 @@ static int get_chip(struct map_info *map
+@@ -812,7 +812,7 @@ static int get_chip(struct map_info *map
return 0;
case FL_ERASING:
diff --git a/target/linux/generic/pending-4.19/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch b/target/linux/generic/pending-4.19/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch
index ed84c69744..f4ba5b72f7 100644
--- a/target/linux/generic/pending-4.19/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch
+++ b/target/linux/generic/pending-4.19/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch
@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -1833,6 +1833,7 @@ static int __xipram do_write_buffer(stru
+@@ -1832,6 +1832,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);
diff --git a/target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch
index b41710276f..fa25c65564 100644
--- a/target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch
+++ b/target/linux/generic/pending-4.19/465-m25p80-mx-disable-software-protection.patch
@@ -8,11 +8,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2714,6 +2714,7 @@ int spi_nor_scan(struct spi_nor *nor, co
-
- if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
- JEDEC_MFR(info) == SNOR_MFR_INTEL ||
-+ JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
- JEDEC_MFR(info) == SNOR_MFR_SST ||
- info->flags & SPI_NOR_HAS_LOCK) {
+@@ -2733,6 +2733,7 @@ static int spi_nor_init(struct spi_nor *
+ */
+ if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
+ 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);
diff --git a/target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
index 55d9709761..dcb86f69bf 100644
--- a/target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
+++ b/target/linux/generic/pending-4.19/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch
@@ -17,15 +17,15 @@ Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2716,6 +2716,7 @@ int spi_nor_scan(struct spi_nor *nor, co
- JEDEC_MFR(info) == SNOR_MFR_INTEL ||
- JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
- JEDEC_MFR(info) == SNOR_MFR_SST ||
-+ JEDEC_MFR(info) == SNOR_MFR_WINBOND ||
- info->flags & SPI_NOR_HAS_LOCK) {
+@@ -2735,6 +2735,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 ||
++ JEDEC_MFR(nor->info) == SNOR_MFR_WINBOND ||
+ nor->info->flags & SPI_NOR_HAS_LOCK) {
write_enable(nor);
write_sr(nor, 0);
-@@ -2734,7 +2735,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -2871,7 +2872,8 @@ 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 ||
diff --git a/target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
index 231f9c21a4..2f6ef14b04 100644
--- a/target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
+++ b/target/linux/generic/pending-4.19/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on ARCH_AT91 || (ARM && COMPILE_TEST)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -2561,10 +2561,12 @@ static int spi_nor_select_erase(struct s
+@@ -2647,10 +2647,12 @@ static int spi_nor_select_erase(struct s
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
diff --git a/target/linux/generic/pending-4.19/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.19/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
index f751bfd3b2..8b5dc4eb01 100644
--- a/target/linux/generic/pending-4.19/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
+++ b/target/linux/generic/pending-4.19/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
@@ -20,7 +20,7 @@ Changes in v2:
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1165,6 +1165,11 @@ static const struct flash_info spi_nor_i
+@@ -1239,6 +1239,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)
},
diff --git a/target/linux/generic/pending-4.19/476-mtd-spi-nor-add-eon-en25q128.patch b/target/linux/generic/pending-4.19/476-mtd-spi-nor-add-eon-en25q128.patch
index ac1fda5159..69ac17ce4c 100644
--- a/target/linux/generic/pending-4.19/476-mtd-spi-nor-add-eon-en25q128.patch
+++ b/target/linux/generic/pending-4.19/476-mtd-spi-nor-add-eon-en25q128.patch
@@ -8,11 +8,11 @@ Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -954,6 +954,7 @@ static const struct flash_info spi_nor_i
+@@ -994,6 +994,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) },
+ { "en25qh32", INFO(0x1c7016, 0, 64 * 1024, 64, 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) },
diff --git a/target/linux/generic/pending-4.19/477-mtd-add-spi-nor-add-mx25u3235f.patch b/target/linux/generic/pending-4.19/477-mtd-add-spi-nor-add-mx25u3235f.patch
index 2d94959c5c..0648b12e12 100644
--- a/target/linux/generic/pending-4.19/477-mtd-add-spi-nor-add-mx25u3235f.patch
+++ b/target/linux/generic/pending-4.19/477-mtd-add-spi-nor-add-mx25u3235f.patch
@@ -8,7 +8,7 @@ Signed-off-by: André Valentin <avalentin@marcant.net>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1022,6 +1022,7 @@ static const struct flash_info spi_nor_i
+@@ -1083,6 +1083,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) },
diff --git a/target/linux/generic/pending-4.19/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.19/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
deleted file mode 100644
index 4ecf53621d..0000000000
--- a/target/linux/generic/pending-4.19/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From b02f3405c935a28200db26b63e42086057565cf4 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Sat, 31 Mar 2018 20:09:54 +0200
-Subject: [PATCH] mtd: spi-nor: Add support for XM25QH64A and XM25QH128A
-
-These devices are produced by Wuhan Xinxin Semiconductor Manufacturing
-Corp. (XMC) and found on some routers from Chinese manufactures.
-
-The data sheets can be found here:
-http://www.xmcwh.com/Uploads/2018-03-01/5a9799e4cb355.pdf
-http://www.xmcwh.com/Uploads/2018-02-05/5a77e6dbe968b.pdf
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- drivers/mtd/spi-nor/spi-nor.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1192,6 +1192,10 @@ static const struct flash_info spi_nor_i
- { "3S400AN", S3AN_INFO(0x1f2400, 256, 264) },
- { "3S700AN", S3AN_INFO(0x1f2500, 512, 264) },
- { "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) },
-+
-+ /* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */
-+ { "XM25QH64A", INFO(0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-+ { "XM25QH128A", INFO(0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
- { },
- };
-
diff --git a/target/linux/generic/pending-4.19/479-mtd-spi-nor-add-eon-en25qh32.patch b/target/linux/generic/pending-4.19/479-mtd-spi-nor-add-eon-en25qh32.patch
deleted file mode 100644
index b8d5101514..0000000000
--- a/target/linux/generic/pending-4.19/479-mtd-spi-nor-add-eon-en25qh32.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -955,6 +955,7 @@ static const struct flash_info spi_nor_i
- { "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) },
-+ { "en25qh32", INFO(0x1c7016, 0, 64 * 1024, 64, 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) },
diff --git a/target/linux/generic/pending-4.19/480-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/pending-4.19/480-mtd-set-rootfs-to-be-root-dev.patch
index 6cddaf01b7..dce0432fac 100644
--- a/target/linux/generic/pending-4.19/480-mtd-set-rootfs-to-be-root-dev.patch
+++ b/target/linux/generic/pending-4.19/480-mtd-set-rootfs-to-be-root-dev.patch
@@ -20,7 +20,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-@@ -578,6 +579,15 @@ int add_mtd_device(struct mtd_info *mtd)
+@@ -593,6 +594,15 @@ int add_mtd_device(struct mtd_info *mtd)
of this try_ nonsense, and no bitching about it
either. :) */
__module_get(THIS_MODULE);
diff --git a/target/linux/generic/pending-4.19/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.19/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch
index 992aa4662e..79d18d036f 100644
--- a/target/linux/generic/pending-4.19/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch
+++ b/target/linux/generic/pending-4.19/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch
@@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
-@@ -1172,6 +1172,73 @@ static struct mtd_info * __init open_mtd
+@@ -1181,6 +1181,73 @@ static struct mtd_info * __init open_mtd
return mtd;
}
@@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
static int __init ubi_init(void)
{
int err, i, k;
-@@ -1255,6 +1322,12 @@ static int __init ubi_init(void)
+@@ -1264,6 +1331,12 @@ static int __init ubi_init(void)
}
}
diff --git a/target/linux/generic/pending-4.19/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch b/target/linux/generic/pending-4.19/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
index 3c82a064eb..b76e83e4a3 100644
--- a/target/linux/generic/pending-4.19/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
+++ b/target/linux/generic/pending-4.19/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch
@@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
-@@ -437,7 +437,28 @@ retry:
+@@ -427,7 +427,28 @@ retry:
out:
put_page(page);
}
@@ -38,7 +38,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
#ifdef CONFIG_ROOT_NFS
#define NFSROOT_TIMEOUT_MIN 5
-@@ -531,6 +552,10 @@ void __init mount_root(void)
+@@ -521,6 +542,10 @@ void __init mount_root(void)
change_floppy("root floppy");
}
#endif
diff --git a/target/linux/generic/pending-4.19/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.19/494-mtd-ubi-add-EOF-marker-support.patch
index a3b58dd66f..e38f11e592 100644
--- a/target/linux/generic/pending-4.19/494-mtd-ubi-add-EOF-marker-support.patch
+++ b/target/linux/generic/pending-4.19/494-mtd-ubi-add-EOF-marker-support.patch
@@ -50,7 +50,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
break;
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
-@@ -785,6 +785,7 @@ struct ubi_attach_info {
+@@ -789,6 +789,7 @@ struct ubi_attach_info {
int mean_ec;
uint64_t ec_sum;
int ec_count;
diff --git a/target/linux/generic/pending-4.19/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-4.19/495-mtd-core-add-get_mtd_device_by_node.patch
index 2886742d4d..1446ca2abc 100644
--- a/target/linux/generic/pending-4.19/495-mtd-core-add-get_mtd_device_by_node.patch
+++ b/target/linux/generic/pending-4.19/495-mtd-core-add-get_mtd_device_by_node.patch
@@ -17,7 +17,7 @@ Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
-@@ -924,6 +924,44 @@ out_unlock:
+@@ -938,6 +938,44 @@ out_unlock:
}
EXPORT_SYMBOL_GPL(get_mtd_device_nm);
@@ -64,7 +64,7 @@ Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
mutex_lock(&mtd_table_mutex);
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
-@@ -580,6 +580,8 @@ extern struct mtd_info *get_mtd_device(s
+@@ -589,6 +589,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);
diff --git a/target/linux/generic/pending-4.19/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch b/target/linux/generic/pending-4.19/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch
index 94acc883f3..6584e22882 100644
--- a/target/linux/generic/pending-4.19/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch
+++ b/target/linux/generic/pending-4.19/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch
@@ -43,7 +43,7 @@ Signed-off-by: Bernhard Frauendienst <kernel@nospam.obeliks.de>
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -377,4 +377,6 @@ source "drivers/mtd/spi-nor/Kconfig"
+@@ -374,4 +374,6 @@ source "drivers/mtd/spi-nor/Kconfig"
source "drivers/mtd/ubi/Kconfig"
diff --git a/target/linux/generic/pending-4.19/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.19/530-jffs2_make_lzma_available.patch
index 4e1dfbe776..645b938f3a 100644
--- a/target/linux/generic/pending-4.19/530-jffs2_make_lzma_available.patch
+++ b/target/linux/generic/pending-4.19/530-jffs2_make_lzma_available.patch
@@ -38,7 +38,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
--- a/fs/jffs2/Kconfig
+++ b/fs/jffs2/Kconfig
-@@ -139,6 +139,15 @@ config JFFS2_LZO
+@@ -135,6 +135,15 @@ config JFFS2_LZO
This feature was added in July, 2007. Say 'N' if you need
compatibility with older bootloaders or kernels.
@@ -1087,7 +1087,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
#define JFFS2_NODE_ACCURATE 0x2000
--- a/lib/Kconfig
+++ b/lib/Kconfig
-@@ -259,6 +259,12 @@ config ZSTD_DECOMPRESS
+@@ -278,6 +278,12 @@ config ZSTD_DECOMPRESS
source "lib/xz/Kconfig"
@@ -1119,7 +1119,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
ifdef CONFIG_FUNCTION_TRACER
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
-@@ -122,6 +132,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
+@@ -128,6 +138,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/
obj-$(CONFIG_XZ_DEC) += xz/
obj-$(CONFIG_RAID6_PQ) += raid6/
diff --git a/target/linux/generic/pending-4.19/551-ubifs-fix-default-compression-selection.patch b/target/linux/generic/pending-4.19/551-ubifs-fix-default-compression-selection.patch
index 4782fc9ed8..60d5619989 100644
--- a/target/linux/generic/pending-4.19/551-ubifs-fix-default-compression-selection.patch
+++ b/target/linux/generic/pending-4.19/551-ubifs-fix-default-compression-selection.patch
@@ -12,12 +12,12 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
/* Default time granularity in nanoseconds */
#define DEFAULT_TIME_GRAN 1000000000
-+static int get_default_compressor(void)
++static int get_default_compressor(struct ubifs_info *c)
+{
-+ if (ubifs_compr_present(UBIFS_COMPR_LZO))
++ if (ubifs_compr_present(c, UBIFS_COMPR_LZO))
+ return UBIFS_COMPR_LZO;
+
-+ if (ubifs_compr_present(UBIFS_COMPR_ZLIB))
++ if (ubifs_compr_present(c, UBIFS_COMPR_ZLIB))
+ return UBIFS_COMPR_ZLIB;
+
+ return UBIFS_COMPR_NONE;
@@ -31,7 +31,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
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());
++ sup->default_compr = cpu_to_le16(get_default_compressor(c));
generate_random_uuid(sup->uuid);
diff --git a/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch b/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
index 4b413996f2..02c9b4c0fa 100644
--- a/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
+++ b/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch
@@ -20,7 +20,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- a/fs/ubifs/Kconfig
+++ b/fs/ubifs/Kconfig
-@@ -74,3 +74,16 @@ config UBIFS_FS_SECURITY
+@@ -85,3 +85,16 @@ config UBIFS_FS_SECURITY
the extended attribute support in advance.
If you are not using a security module, say N.
diff --git a/target/linux/generic/pending-4.19/600-netfilter_conntrack_flush.patch b/target/linux/generic/pending-4.19/600-netfilter_conntrack_flush.patch
index 10da96b7ed..fa32f88e17 100644
--- a/target/linux/generic/pending-4.19/600-netfilter_conntrack_flush.patch
+++ b/target/linux/generic/pending-4.19/600-netfilter_conntrack_flush.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
-@@ -17,6 +17,7 @@
+@@ -9,6 +9,7 @@
#include <linux/percpu.h>
#include <linux/netdevice.h>
#include <linux/security.h>
@@ -17,8 +17,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <net/net_namespace.h>
#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
-@@ -381,10 +382,66 @@ static int ct_open(struct inode *inode,
- sizeof(struct ct_iter_state));
+@@ -433,6 +434,56 @@ static int ct_cpu_seq_show(struct seq_fi
+ return 0;
}
+struct kill_request {
@@ -44,13 +44,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3));
+}
+
-+static ssize_t ct_file_write(struct file *file, const char __user *buf,
-+ size_t count, loff_t *ppos)
++static int ct_file_write(struct file *file, char *buf, size_t count)
+{
+ struct seq_file *seq = file->private_data;
+ struct net *net = seq_file_net(seq);
+ struct kill_request kr = { };
-+ char req[INET6_ADDRSTRLEN] = { };
+
+ if (count == 0)
+ return 0;
@@ -58,38 +56,33 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ if (count >= INET6_ADDRSTRLEN)
+ count = INET6_ADDRSTRLEN - 1;
+
-+ if (copy_from_user(req, buf, count))
-+ return -EFAULT;
-+
-+ if (strnchr(req, count, ':')) {
++ if (strnchr(buf, count, ':')) {
+ kr.family = AF_INET6;
-+ if (!in6_pton(req, count, (void *)&kr.addr, '\n', NULL))
++ if (!in6_pton(buf, count, (void *)&kr.addr, '\n', NULL))
+ return -EINVAL;
-+ } else if (strnchr(req, count, '.')) {
++ } else if (strnchr(buf, count, '.')) {
+ kr.family = AF_INET;
-+ if (!in4_pton(req, count, (void *)&kr.addr, '\n', NULL))
++ if (!in4_pton(buf, count, (void *)&kr.addr, '\n', NULL))
+ return -EINVAL;
+ }
+
+ nf_ct_iterate_cleanup_net(net, kill_matching, &kr, 0, 0);
+
-+ return count;
++ return 0;
+}
+
- static const struct file_operations ct_file_ops = {
- .owner = THIS_MODULE,
- .open = ct_open,
- .read = seq_read,
-+ .write = ct_file_write,
- .llseek = seq_lseek,
- .release = seq_release_net,
- };
-@@ -488,7 +545,7 @@ static int nf_conntrack_standalone_init_
+ 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_
kuid_t root_uid;
kgid_t root_gid;
-- pde = proc_create("nf_conntrack", 0440, net->proc_net, &ct_file_ops);
-+ pde = proc_create("nf_conntrack", 0660, net->proc_net, &ct_file_ops);
+- pde = proc_create_net("nf_conntrack", 0440, net->proc_net, &ct_seq_ops,
+- sizeof(struct ct_iter_state));
++ pde = proc_create_net_data_write("nf_conntrack", 0440, net->proc_net,
++ &ct_seq_ops, &ct_file_write,
++ sizeof(struct ct_iter_state), NULL);
if (!pde)
goto out_nf_conntrack;
diff --git a/target/linux/generic/pending-4.19/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.19/610-netfilter_match_bypass_default_checks.patch
index 2541230ff5..1691146825 100644
--- a/target/linux/generic/pending-4.19/610-netfilter_match_bypass_default_checks.patch
+++ b/target/linux/generic/pending-4.19/610-netfilter_match_bypass_default_checks.patch
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
-@@ -52,6 +52,9 @@ ip_packet_match(const struct iphdr *ip,
+@@ -53,6 +53,9 @@ ip_packet_match(const struct iphdr *ip,
{
unsigned long ret;
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (NF_INVF(ipinfo, IPT_INV_SRCIP,
(ip->saddr & ipinfo->smsk.s_addr) != ipinfo->src.s_addr) ||
NF_INVF(ipinfo, IPT_INV_DSTIP,
-@@ -82,6 +85,29 @@ ip_packet_match(const struct iphdr *ip,
+@@ -83,6 +86,29 @@ ip_packet_match(const struct iphdr *ip,
return true;
}
@@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static bool
ip_checkentry(const struct ipt_ip *ip)
{
-@@ -537,6 +563,8 @@ find_check_entry(struct ipt_entry *e, st
+@@ -527,6 +553,8 @@ find_check_entry(struct ipt_entry *e, st
struct xt_mtchk_param mtpar;
struct xt_entry_match *ematch;
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!xt_percpu_counter_alloc(alloc_state, &e->counters))
return -ENOMEM;
-@@ -818,6 +846,7 @@ copy_entries_to_user(unsigned int total_
+@@ -821,6 +849,7 @@ copy_entries_to_user(unsigned int total_
const struct xt_table_info *private = table->private;
int ret = 0;
const void *loc_cpu_entry;
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
counters = alloc_counters(table);
if (IS_ERR(counters))
-@@ -845,6 +874,14 @@ copy_entries_to_user(unsigned int total_
+@@ -848,6 +877,14 @@ copy_entries_to_user(unsigned int total_
goto free_counters;
}
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
for (i = sizeof(struct ipt_entry);
i < e->target_offset;
i += m->u.match_size) {
-@@ -1227,12 +1264,15 @@ compat_copy_entry_to_user(struct ipt_ent
+@@ -1228,12 +1265,15 @@ compat_copy_entry_to_user(struct ipt_ent
compat_uint_t origsize;
const struct xt_entry_match *ematch;
int ret = 0;
diff --git a/target/linux/generic/pending-4.19/611-netfilter_match_bypass_default_table.patch b/target/linux/generic/pending-4.19/611-netfilter_match_bypass_default_table.patch
index 11f07e12b3..ba976b0751 100644
--- a/target/linux/generic/pending-4.19/611-netfilter_match_bypass_default_table.patch
+++ b/target/linux/generic/pending-4.19/611-netfilter_match_bypass_default_table.patch
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
-@@ -248,6 +248,33 @@ struct ipt_entry *ipt_next_entry(const s
+@@ -249,6 +249,33 @@ struct ipt_entry *ipt_next_entry(const s
return (void *)entry + entry->next_offset;
}
@@ -42,35 +42,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Returns one of the generic firewall policies, like NF_ACCEPT. */
unsigned int
ipt_do_table(struct sk_buff *skb,
-@@ -268,24 +295,8 @@ ipt_do_table(struct sk_buff *skb,
+@@ -269,27 +296,28 @@ ipt_do_table(struct sk_buff *skb,
unsigned int addend;
/* Initialization */
-- stackidx = 0;
-- ip = ip_hdr(skb);
-- indev = state->in ? state->in->name : nulldevname;
-- outdev = state->out ? state->out->name : nulldevname;
-- /* We handle fragments by dealing with the first fragment as
-- * if it was a normal packet. All other fragments are treated
-- * normally, except that they will NEVER match rules that ask
-- * things we don't know, ie. tcp syn flag or ports). If the
-- * rule is also a fragment-specific rule, non-fragments won't
-- * match it. */
-- acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
-- acpar.thoff = ip_hdrlen(skb);
-- acpar.hotdrop = false;
-- acpar.state = state;
--
- WARN_ON(!(table->valid_hooks & (1 << hook)));
- local_bh_disable();
-- addend = xt_write_recseq_begin();
- private = table->private;
- cpu = smp_processor_id();
- /*
-@@ -294,6 +305,23 @@ ipt_do_table(struct sk_buff *skb,
- */
- smp_read_barrier_depends();
- table_base = private->entries;
++ WARN_ON(!(table->valid_hooks & (1 << hook)));
++ local_bh_disable();
++ private = READ_ONCE(table->private); /* Address dependency. */
++ cpu = smp_processor_id();
++ table_base = private->entries;
+
+ e = get_entry(table_base, private->hook_entry[hook]);
+ if (ipt_handle_default_rule(e, &verdict)) {
@@ -82,16 +62,31 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ return verdict;
+ }
+
-+ stackidx = 0;
-+ ip = ip_hdr(skb);
-+ indev = state->in ? state->in->name : nulldevname;
-+ outdev = state->out ? state->out->name : nulldevname;
-+
-+ addend = xt_write_recseq_begin();
+ stackidx = 0;
+ ip = ip_hdr(skb);
+ indev = state->in ? state->in->name : nulldevname;
+ outdev = state->out ? state->out->name : nulldevname;
+- /* We handle fragments by dealing with the first fragment as
+- * if it was a normal packet. All other fragments are treated
+- * normally, except that they will NEVER match rules that ask
+- * things we don't know, ie. tcp syn flag or ports). If the
+- * rule is also a fragment-specific rule, non-fragments won't
+- * match it. */
+- acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
+- acpar.thoff = ip_hdrlen(skb);
+- acpar.hotdrop = false;
+- acpar.state = state;
+
+- WARN_ON(!(table->valid_hooks & (1 << hook)));
+- local_bh_disable();
+ addend = xt_write_recseq_begin();
+- private = READ_ONCE(table->private); /* Address dependency. */
+- cpu = smp_processor_id();
+- table_base = private->entries;
jumpstack = (struct ipt_entry **)private->jumpstack[cpu];
/* Switch to alternate jumpstack if we're being invoked via TEE.
-@@ -306,7 +334,16 @@ ipt_do_table(struct sk_buff *skb,
+@@ -302,7 +330,16 @@ ipt_do_table(struct sk_buff *skb,
if (static_key_false(&xt_tee_enabled))
jumpstack += private->stacksize * __this_cpu_read(nf_skb_duplicated);
diff --git a/target/linux/generic/pending-4.19/612-netfilter_match_reduce_memory_access.patch b/target/linux/generic/pending-4.19/612-netfilter_match_reduce_memory_access.patch
index 183c74c1c7..cd6fcf8e74 100644
--- a/target/linux/generic/pending-4.19/612-netfilter_match_reduce_memory_access.patch
+++ b/target/linux/generic/pending-4.19/612-netfilter_match_reduce_memory_access.patch
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
-@@ -55,9 +55,9 @@ ip_packet_match(const struct iphdr *ip,
+@@ -56,9 +56,9 @@ ip_packet_match(const struct iphdr *ip,
if (ipinfo->flags & IPT_F_NO_DEF_MATCH)
return true;
diff --git a/target/linux/generic/pending-4.19/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-4.19/613-netfilter_optional_tcp_window_check.patch
index 69c165bb41..f9613a1ff6 100644
--- a/target/linux/generic/pending-4.19/613-netfilter_optional_tcp_window_check.patch
+++ b/target/linux/generic/pending-4.19/613-netfilter_optional_tcp_window_check.patch
@@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -33,6 +33,9 @@
+@@ -34,6 +34,9 @@
#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* "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. */
-@@ -508,6 +511,9 @@ static bool tcp_in_window(const struct n
+@@ -483,6 +486,9 @@ static bool tcp_in_window(const struct n
s32 receiver_offset;
bool res, in_recv_win;
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Get the required data from the packet.
*/
-@@ -1489,6 +1495,13 @@ static struct ctl_table tcp_sysctl_table
+@@ -1476,6 +1482,13 @@ static struct ctl_table tcp_sysctl_table
.mode = 0644,
.proc_handler = proc_dointvec,
},
diff --git a/target/linux/generic/pending-4.19/616-net_optimize_xfrm_calls.patch b/target/linux/generic/pending-4.19/616-net_optimize_xfrm_calls.patch
index c64694ea3c..6a5801027c 100644
--- a/target/linux/generic/pending-4.19/616-net_optimize_xfrm_calls.patch
+++ b/target/linux/generic/pending-4.19/616-net_optimize_xfrm_calls.patch
@@ -8,8 +8,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
-@@ -90,6 +90,9 @@ int nf_xfrm_me_harder(struct net *net, s
- struct dst_entry *dst;
+@@ -110,6 +110,9 @@ int nf_xfrm_me_harder(struct net *net, s
+ struct sock *sk = skb->sk;
int err;
+ if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT])
diff --git a/target/linux/generic/pending-4.19/620-net_sched-codel-do-not-defer-queue-length-update.patch b/target/linux/generic/pending-4.19/620-net_sched-codel-do-not-defer-queue-length-update.patch
index b3c35ee350..457c812841 100644
--- a/target/linux/generic/pending-4.19/620-net_sched-codel-do-not-defer-queue-length-update.patch
+++ b/target/linux/generic/pending-4.19/620-net_sched-codel-do-not-defer-queue-length-update.patch
@@ -46,7 +46,7 @@ Link: https://bugzilla.kernel.org/show_bug.cgi?id=109581
}
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
-@@ -316,6 +316,21 @@ begin:
+@@ -317,6 +317,21 @@ begin:
flow->dropped += q->cstats.drop_count - prev_drop_count;
flow->dropped += q->cstats.ecn_mark - prev_ecn_mark;
@@ -68,7 +68,7 @@ Link: https://bugzilla.kernel.org/show_bug.cgi?id=109581
if (!skb) {
/* force a pass through old_flows to prevent starvation */
if ((head == &q->new_flows) && !list_empty(&q->old_flows))
-@@ -326,15 +341,6 @@ begin:
+@@ -327,15 +342,6 @@ begin:
}
qdisc_bstats_update(sch, skb);
flow->deficit -= qdisc_pkt_len(skb);
diff --git a/target/linux/generic/pending-4.19/630-packet_socket_type.patch b/target/linux/generic/pending-4.19/630-packet_socket_type.patch
index d55d678549..5834ab14c1 100644
--- a/target/linux/generic/pending-4.19/630-packet_socket_type.patch
+++ b/target/linux/generic/pending-4.19/630-packet_socket_type.patch
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define PACKET_FANOUT_LB 1
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
-@@ -1829,6 +1829,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1789,6 +1789,7 @@ static int packet_rcv_spkt(struct sk_buf
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* When we registered the protocol we saved the socket in the data
-@@ -1836,6 +1837,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1796,6 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf
*/
sk = pt->af_packet_priv;
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Yank back the headers [hope the device set this
-@@ -1848,7 +1850,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1808,7 +1810,7 @@ static int packet_rcv_spkt(struct sk_buf
* so that this procedure is noop.
*/
@@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto out;
if (!net_eq(dev_net(dev), sock_net(sk)))
-@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk
+@@ -2036,12 +2038,12 @@ static int packet_rcv(struct sk_buff *sk
unsigned int snaplen, res;
bool is_drop_n_account = false;
@@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s
+@@ -2167,12 +2169,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);
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!net_eq(dev_net(dev), sock_net(sk)))
goto drop;
-@@ -3265,6 +3267,7 @@ static int packet_create(struct net *net
+@@ -3228,6 +3230,7 @@ static int packet_create(struct net *net
mutex_init(&po->pg_vec_lock);
po->rollover = NULL;
po->prot_hook.func = packet_rcv;
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (sock->type == SOCK_PACKET)
po->prot_hook.func = packet_rcv_spkt;
-@@ -3878,6 +3881,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3839,6 +3842,16 @@ packet_setsockopt(struct socket *sock, i
po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
return 0;
}
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default:
return -ENOPROTOOPT;
}
-@@ -3930,6 +3943,13 @@ static int packet_getsockopt(struct sock
+@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock
case PACKET_VNET_HDR:
val = po->has_vnet_hdr;
break;
diff --git a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch
index ad78b684a0..6126436b99 100644
--- a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch
+++ b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch
@@ -23,9 +23,9 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -826,6 +826,13 @@ struct xfrmdev_ops {
+@@ -918,6 +918,13 @@ struct dev_ifalias {
+ char ifalias[];
};
- #endif
+struct flow_offload;
+
@@ -37,7 +37,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
/*
* This structure defines the management hooks for network devices.
* The following hooks can be defined; unless noted otherwise, they are
-@@ -1057,6 +1064,10 @@ struct xfrmdev_ops {
+@@ -1150,6 +1157,10 @@ struct dev_ifalias {
* int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh,
* u16 flags);
*
@@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* 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
-@@ -1281,6 +1292,8 @@ struct net_device_ops {
+@@ -1377,6 +1388,8 @@ struct net_device_ops {
int (*ndo_bridge_dellink)(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags);
@@ -110,7 +110,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
-@@ -1341,6 +1341,7 @@ enum nft_object_attributes {
+@@ -1464,6 +1464,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)
@@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
*/
enum nft_flowtable_attributes {
NFTA_FLOWTABLE_UNSPEC,
-@@ -1350,6 +1351,7 @@ enum nft_flowtable_attributes {
+@@ -1473,6 +1474,7 @@ enum nft_flowtable_attributes {
NFTA_FLOWTABLE_USE,
NFTA_FLOWTABLE_HANDLE,
NFTA_FLOWTABLE_PAD,
@@ -128,7 +128,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
#define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1)
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -692,6 +692,15 @@ config NF_FLOW_TABLE
+@@ -714,6 +714,15 @@ config NF_FLOW_TABLE
To compile it as a module, choose M here.
@@ -146,7 +146,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
default m if NETFILTER_ADVANCED=n
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -116,6 +116,7 @@ obj-$(CONFIG_NF_FLOW_TABLE) += nf_flow_t
+@@ -126,6 +126,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
@@ -156,7 +156,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
-@@ -218,10 +218,16 @@ int flow_offload_add(struct nf_flowtable
+@@ -215,10 +215,16 @@ int flow_offload_add(struct nf_flowtable
}
EXPORT_SYMBOL_GPL(flow_offload_add);
@@ -173,7 +173,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
rhashtable_remove_fast(&flow_table->rhashtable,
&flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].node,
-@@ -236,6 +242,9 @@ static void flow_offload_del(struct nf_f
+@@ -233,6 +239,9 @@ static void flow_offload_del(struct nf_f
if (!(flow->flags & FLOW_OFFLOAD_TEARDOWN))
flow_offload_fixup_ct_state(e->ct);
@@ -183,7 +183,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
flow_offload_free(flow);
}
-@@ -349,6 +358,9 @@ static int nf_flow_offload_gc_step(struc
+@@ -346,6 +355,9 @@ static int nf_flow_offload_gc_step(struc
if (!teardown)
nf_ct_offload_timeout(flow);
@@ -193,7 +193,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
if (nf_flow_has_expired(flow) || teardown)
flow_offload_del(flow_table, flow);
}
-@@ -484,10 +496,43 @@ int nf_flow_dnat_port(const struct flow_
+@@ -481,10 +493,43 @@ int nf_flow_dnat_port(const struct flow_
}
EXPORT_SYMBOL_GPL(nf_flow_dnat_port);
@@ -237,7 +237,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
INIT_DEFERRABLE_WORK(&flowtable->gc_work, nf_flow_offload_work_gc);
err = rhashtable_init(&flowtable->rhashtable,
-@@ -525,6 +570,8 @@ static void nf_flow_table_iterate_cleanu
+@@ -522,6 +567,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);
@@ -246,7 +246,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
}
void nf_flow_table_cleanup(struct net *net, struct net_device *dev)
-@@ -538,6 +585,26 @@ void nf_flow_table_cleanup(struct net *n
+@@ -535,6 +582,26 @@ void nf_flow_table_cleanup(struct net *n
}
EXPORT_SYMBOL_GPL(nf_flow_table_cleanup);
@@ -273,7 +273,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
void nf_flow_table_free(struct nf_flowtable *flow_table)
{
mutex_lock(&flowtable_lock);
-@@ -547,9 +614,58 @@ void nf_flow_table_free(struct nf_flowta
+@@ -544,9 +611,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));
rhashtable_destroy(&flow_table->rhashtable);
@@ -506,22 +506,21 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+MODULE_ALIAS("nf-flow-table-hw");
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
-@@ -4934,6 +4934,14 @@ static int nf_tables_flowtable_parse_hoo
+@@ -5396,6 +5396,13 @@ static int nf_tables_flowtable_parse_hoo
if (err < 0)
- goto err1;
+ return err;
+ for (i = 0; i < n; i++) {
+ if (flowtable->data.flags & NF_FLOWTABLE_F_HW &&
+ !dev_array[i]->netdev_ops->ndo_flow_offload) {
-+ err = -EOPNOTSUPP;
-+ goto err1;
++ return -EOPNOTSUPP;
+ }
+ }
+
- ops = kzalloc(sizeof(struct nf_hook_ops) * n, GFP_KERNEL);
- if (!ops) {
- err = -ENOMEM;
-@@ -5064,10 +5072,19 @@ static int nf_tables_newflowtable(struct
+ ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL);
+ if (!ops)
+ return -ENOMEM;
+@@ -5527,10 +5534,19 @@ static int nf_tables_newflowtable(struct
}
flowtable->data.type = type;
@@ -541,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK],
flowtable);
if (err < 0)
-@@ -5165,7 +5182,8 @@ static int nf_tables_fill_flowtable_info
+@@ -5656,7 +5672,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),
diff --git a/target/linux/generic/pending-4.19/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch b/target/linux/generic/pending-4.19/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch
index 9311725346..87ff634793 100644
--- a/target/linux/generic/pending-4.19/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch
+++ b/target/linux/generic/pending-4.19/641-netfilter-nf_flow_table-support-hw-offload-through-v.patch
@@ -15,15 +15,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -827,6 +827,7 @@ struct xfrmdev_ops {
- #endif
+@@ -919,6 +919,7 @@ struct dev_ifalias {
+ };
struct flow_offload;
+struct flow_offload_hw_path;
enum flow_offload_type {
FLOW_OFFLOAD_ADD = 0,
-@@ -1064,8 +1065,15 @@ enum flow_offload_type {
+@@ -1157,8 +1158,15 @@ enum flow_offload_type {
* int (*ndo_bridge_dellink)(struct net_device *dev, struct nlmsghdr *nlh,
* u16 flags);
*
@@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Adds/deletes flow entry to/from net device flowtable.
*
* int (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);
-@@ -1292,8 +1300,11 @@ struct net_device_ops {
+@@ -1388,8 +1396,11 @@ struct net_device_ops {
int (*ndo_bridge_dellink)(struct net_device *dev,
struct nlmsghdr *nlh,
u16 flags);
diff --git a/target/linux/generic/pending-4.19/642-net-8021q-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.19/642-net-8021q-support-hardware-flow-table-offload.patch
index 0d6eab16fd..4fabfdcb6c 100644
--- a/target/linux/generic/pending-4.19/642-net-8021q-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-4.19/642-net-8021q-support-hardware-flow-table-offload.patch
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include "vlan.h"
#include "vlanproc.h"
-@@ -766,6 +770,27 @@ static int vlan_dev_get_iflink(const str
+@@ -768,6 +772,27 @@ static int vlan_dev_get_iflink(const str
return real_dev->ifindex;
}
@@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct ethtool_ops vlan_ethtool_ops = {
.get_link_ksettings = vlan_ethtool_get_link_ksettings,
.get_drvinfo = vlan_ethtool_get_drvinfo,
-@@ -803,6 +828,9 @@ static const struct net_device_ops vlan_
+@@ -805,6 +830,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,
diff --git a/target/linux/generic/pending-4.19/643-net-bridge-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.19/643-net-bridge-support-hardware-flow-table-offload.patch
index a070fe1636..7d9c8abe9c 100644
--- a/target/linux/generic/pending-4.19/643-net-bridge-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-4.19/643-net-bridge-support-hardware-flow-table-offload.patch
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/uaccess.h>
#include "br_private.h"
-@@ -340,6 +344,28 @@ static const struct ethtool_ops br_ethto
+@@ -370,6 +374,28 @@ static const struct ethtool_ops br_ethto
.get_link = ethtool_op_get_link,
};
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static const struct net_device_ops br_netdev_ops = {
.ndo_open = br_dev_open,
.ndo_stop = br_dev_stop,
-@@ -367,6 +393,9 @@ static const struct net_device_ops br_ne
+@@ -397,6 +423,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,
diff --git a/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch
index edba04ccf6..456c08b90c 100644
--- a/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
-@@ -56,6 +56,11 @@
+@@ -57,6 +57,11 @@
#include <net/net_namespace.h>
#include <net/netns/generic.h>
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#define PPP_VERSION "2.4.2"
/*
-@@ -1382,12 +1387,37 @@ static void ppp_dev_priv_destructor(stru
+@@ -1368,12 +1373,37 @@ static void ppp_dev_priv_destructor(stru
ppp_destroy_interface(ppp);
}
@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
-@@ -977,8 +982,36 @@ static int pppoe_xmit(struct ppp_channel
+@@ -975,8 +980,36 @@ static int pppoe_xmit(struct ppp_channel
return __pppoe_xmit(sk, skb);
}
diff --git a/target/linux/generic/pending-4.19/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch b/target/linux/generic/pending-4.19/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
index 8f0793491b..2b3725f81e 100644
--- a/target/linux/generic/pending-4.19/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
+++ b/target/linux/generic/pending-4.19/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
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
-@@ -358,7 +358,7 @@ static int nf_flow_offload_gc_step(struc
+@@ -355,7 +355,7 @@ static int nf_flow_offload_gc_step(struc
if (!teardown)
nf_ct_offload_timeout(flow);
diff --git a/target/linux/generic/pending-4.19/655-increase_skb_pad.patch b/target/linux/generic/pending-4.19/655-increase_skb_pad.patch
index adb6b04529..c19290f8d8 100644
--- a/target/linux/generic/pending-4.19/655-increase_skb_pad.patch
+++ b/target/linux/generic/pending-4.19/655-increase_skb_pad.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2476,7 +2476,7 @@ static inline int pskb_network_may_pull(
+@@ -2480,7 +2480,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
diff --git a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index 7c60d7e799..40f7962b67 100644
--- a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -156,7 +156,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (dev == ip6n->fb_tnl_dev)
RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL);
else
-@@ -779,6 +796,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t,
+@@ -772,6 +789,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t,
}
EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl);
@@ -264,7 +264,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi,
struct metadata_dst *tun_dst,
-@@ -831,6 +949,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl
+@@ -824,6 +942,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl
skb_reset_network_header(skb);
memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
@@ -292,7 +292,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
__skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
err = dscp_ecn_decapsulate(tunnel, ipv6h, skb);
-@@ -962,6 +1101,7 @@ static void init_tel_txopt(struct ipv6_t
+@@ -955,6 +1094,7 @@ static void init_tel_txopt(struct ipv6_t
opt->ops.opt_nflen = 8;
}
@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
/**
* ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
* @t: the outgoing tunnel device
-@@ -1305,6 +1445,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1312,6 +1452,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
{
struct ip6_tnl *t = netdev_priv(dev);
struct ipv6hdr *ipv6h;
@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
int encap_limit = -1;
__u16 offset;
struct flowi6 fl6;
-@@ -1371,6 +1512,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1379,6 +1520,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL);
@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
-@@ -1499,6 +1652,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1507,6 +1660,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.link = p->link;
t->parms.proto = p->proto;
t->parms.fwmark = p->fwmark;
@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
dst_cache_reset(&t->dst_cache);
ip6_tnl_link_config(t);
return 0;
-@@ -1537,6 +1698,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1545,6 +1706,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
memcpy(p->name, u->name, sizeof(u->name));
}
-@@ -1923,6 +2085,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1931,6 +2093,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
-@@ -1960,6 +2131,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1968,6 +2139,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_FWMARK])
parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
}
static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2075,6 +2286,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2083,6 +2294,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
-@@ -2104,6 +2321,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2112,6 +2329,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(0) +
/* IFLA_IPTUN_FWMARK */
nla_total_size(4) +
@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
0;
}
-@@ -2111,6 +2346,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2119,6 +2354,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2120,9 +2358,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2128,9 +2366,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) ||
@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2162,6 +2418,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2170,6 +2426,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
[IFLA_IPTUN_FWMARK] = { .type = NLA_U32 },
diff --git a/target/linux/generic/pending-4.19/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.19/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index 1397580382..a022c2c556 100644
--- a/target/linux/generic/pending-4.19/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-4.19/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -20,9 +20,9 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
-@@ -69,6 +69,7 @@ struct netns_ipv6 {
- #ifdef CONFIG_IPV6_MULTIPLE_TABLES
- bool fib6_has_custom_rules;
+@@ -78,6 +78,7 @@ struct netns_ipv6 {
+ unsigned int fib6_rules_require_fldissect;
+ bool fib6_has_custom_rules;
struct rt6_info *ip6_prohibit_entry;
+ struct rt6_info *ip6_policy_failed_entry;
struct rt6_info *ip6_blk_hole_entry;
@@ -30,7 +30,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
struct fib_rules_ops *fib6_rules_ops;
--- a/include/uapi/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
-@@ -73,6 +73,10 @@ enum {
+@@ -82,6 +82,10 @@ enum {
FR_ACT_BLACKHOLE, /* Drop without notification */
FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
FR_ACT_PROHIBIT, /* Drop with EACCES */
@@ -43,7 +43,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
-@@ -221,6 +221,7 @@ enum {
+@@ -228,6 +228,7 @@ enum {
RTN_THROW, /* Not in this table */
RTN_NAT, /* Translate this address */
RTN_XRESOLVE, /* Use external resolver */
@@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void rt_fibinfo_free(struct rtable __rcu **rtp)
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
-@@ -2460,6 +2460,7 @@ static const char *const rtn_type_names[
+@@ -2465,6 +2465,7 @@ static const char *const rtn_type_names[
[RTN_THROW] = "THROW",
[RTN_NAT] = "NAT",
[RTN_XRESOLVE] = "XRESOLVE",
@@ -76,7 +76,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static inline const char *rtn_type(char *buf, size_t len, unsigned int t)
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
-@@ -161,6 +161,7 @@ static int ipmr_rule_action(struct fib_r
+@@ -177,6 +177,7 @@ static int ipmr_rule_action(struct fib_r
case FR_ACT_UNREACHABLE:
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
@@ -86,7 +86,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
default:
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
-@@ -121,6 +121,10 @@ static int fib6_rule_action(struct fib_r
+@@ -221,6 +221,10 @@ static int __fib6_rule_action(struct fib
err = -EACCES;
rt = net->ipv6.ip6_prohibit_entry;
goto discard_pkt;
@@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
tb_id = fib_rule_get_table(rule, arg);
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
-@@ -168,6 +168,8 @@ static int ip6mr_rule_action(struct fib_
+@@ -159,6 +159,8 @@ static int ip6mr_rule_action(struct fib_
return -ENETUNREACH;
case FR_ACT_PROHIBIT:
return -EACCES;
@@ -110,7 +110,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
return -EINVAL;
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -91,6 +91,8 @@ static int ip6_pkt_discard(struct sk_bu
+@@ -97,6 +97,8 @@ static int ip6_pkt_discard(struct sk_bu
static int ip6_pkt_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
static int ip6_pkt_prohibit(struct sk_buff *skb);
static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff *skb);
@@ -119,8 +119,8 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void ip6_link_failure(struct sk_buff *skb);
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu);
-@@ -321,6 +323,21 @@ static const struct rt6_info ip6_prohibi
- .rt6i_ref = ATOMIC_INIT(1),
+@@ -324,6 +326,18 @@ static const struct rt6_info ip6_prohibi
+ .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
};
+static const struct rt6_info ip6_policy_failed_entry_template = {
@@ -133,27 +133,31 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+ .output = ip6_pkt_policy_failed_out,
+ },
+ .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
-+ .rt6i_protocol = RTPROT_KERNEL,
-+ .rt6i_metric = ~(u32) 0,
-+ .rt6i_ref = ATOMIC_INIT(1),
+};
+
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
-@@ -2046,6 +2063,11 @@ static struct rt6_info *ip6_route_info_c
- rt->dst.output = ip6_pkt_prohibit_out;
- rt->dst.input = ip6_pkt_prohibit;
- break;
-+ case RTN_POLICY_FAILED:
-+ rt->dst.error = -EACCES;
-+ rt->dst.output = ip6_pkt_policy_failed_out;
-+ rt->dst.input = ip6_pkt_policy_failed;
-+ break;
- case RTN_THROW:
- case RTN_UNREACHABLE:
- default:
-@@ -2771,6 +2793,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -901,6 +915,7 @@ static const int fib6_prop[RTN_MAX + 1]
+ [RTN_BLACKHOLE] = -EINVAL,
+ [RTN_UNREACHABLE] = -EHOSTUNREACH,
+ [RTN_PROHIBIT] = -EACCES,
++ [RTN_POLICY_FAILED] = -EACCES,
+ [RTN_THROW] = -EAGAIN,
+ [RTN_NAT] = -EINVAL,
+ [RTN_XRESOLVE] = -EINVAL,
+@@ -938,6 +953,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_POLICY_FAILED:
++ rt->dst.output = ip6_pkt_policy_failed_out;
++ rt->dst.input = ip6_pkt_policy_failed;
++ break;
+ case RTN_THROW:
+ case RTN_UNREACHABLE:
+ default:
+@@ -3745,6 +3764,17 @@ static int ip6_pkt_prohibit_out(struct n
return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
}
@@ -171,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
/*
* Allocate a dst for local (unicast / anycast) address.
*/
-@@ -3007,7 +3040,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4192,7 +4222,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 ||
@@ -181,17 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
cfg->fc_flags |= RTF_REJECT;
if (rtm->rtm_type == RTN_LOCAL)
-@@ -3502,6 +3536,9 @@ static int rt6_fill_node(struct net *net
- case -EACCES:
- rtm->rtm_type = RTN_PROHIBIT;
- break;
-+ case -EPERM:
-+ rtm->rtm_type = RTN_POLICY_FAILED;
-+ break;
- case -EAGAIN:
- rtm->rtm_type = RTN_THROW;
- break;
-@@ -3820,6 +3857,8 @@ static int ip6_route_dev_notify(struct n
+@@ -5031,6 +5062,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);
@@ -200,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
#endif
-@@ -3831,6 +3870,7 @@ static int ip6_route_dev_notify(struct n
+@@ -5042,6 +5075,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);
@@ -208,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
#endif
}
-@@ -4047,6 +4087,17 @@ static int __net_init ip6_route_net_init
+@@ -5236,6 +5270,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);
@@ -218,15 +212,13 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+ sizeof(*net->ipv6.ip6_policy_failed_entry), GFP_KERNEL);
+ if (!net->ipv6.ip6_policy_failed_entry)
+ goto out_ip6_blk_hole_entry;
-+ net->ipv6.ip6_policy_failed_entry->dst.path =
-+ (struct dst_entry *)net->ipv6.ip6_policy_failed_entry;
+ net->ipv6.ip6_policy_failed_entry->dst.ops = &net->ipv6.ip6_dst_ops;
+ dst_init_metrics(&net->ipv6.ip6_policy_failed_entry->dst,
+ ip6_template_metrics, true);
#endif
net->ipv6.sysctl.flush_delay = 0;
-@@ -4065,6 +4116,8 @@ out:
+@@ -5254,6 +5297,8 @@ out:
return ret;
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -235,7 +227,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
out_ip6_prohibit_entry:
kfree(net->ipv6.ip6_prohibit_entry);
out_ip6_null_entry:
-@@ -4082,6 +4135,7 @@ static void __net_exit ip6_route_net_exi
+@@ -5274,6 +5319,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);
@@ -243,7 +235,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
#endif
dst_entries_destroy(&net->ipv6.ip6_dst_ops);
}
-@@ -4155,6 +4209,9 @@ void __init ip6_route_init_special_entri
+@@ -5350,6 +5396,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);
diff --git a/target/linux/generic/pending-4.19/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch b/target/linux/generic/pending-4.19/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch
index cfea527e3d..85adfedc94 100644
--- a/target/linux/generic/pending-4.19/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch
+++ b/target/linux/generic/pending-4.19/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch
@@ -17,7 +17,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
--- a/include/uapi/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
-@@ -80,6 +80,8 @@ enum {
+@@ -89,6 +89,8 @@ enum {
__FR_ACT_MAX,
};
@@ -39,7 +39,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
*/
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
-@@ -225,6 +225,8 @@ enum {
+@@ -232,6 +232,8 @@ enum {
__RTN_MAX
};
diff --git a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index 236a7833d2..9ea7612123 100644
--- a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1763,6 +1763,8 @@ struct net_device {
+@@ -1876,6 +1876,8 @@ struct net_device {
struct netdev_hw_addr_list mc;
struct netdev_hw_addr_list dev_addrs;
@@ -22,9 +22,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -782,6 +782,7 @@ struct sk_buff {
- __u8 tc_redirected:1;
- __u8 tc_from_ingress:1;
+@@ -799,6 +799,7 @@ struct sk_buff {
+ #ifdef CONFIG_TLS_DEVICE
+ __u8 decrypted:1;
#endif
+ __u8 gro_skip:1;
@@ -32,8 +32,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__u16 tc_index; /* traffic control index */
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -4805,6 +4805,9 @@ static enum gro_result dev_gro_receive(s
- enum gro_result ret;
+@@ -5447,6 +5447,9 @@ static enum gro_result dev_gro_receive(s
+ int same_flow;
int grow;
+ if (skb->gro_skip)
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (netif_elide_gro(skb->dev))
goto normal;
-@@ -6279,6 +6282,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -6941,6 +6944,48 @@ static void __netdev_adjacent_dev_unlink
&upper_dev->adj_list.lower);
}
@@ -90,24 +90,24 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master,
- void *upper_priv, void *upper_info)
-@@ -6317,6 +6362,7 @@ static int __netdev_upper_dev_link(struc
+ void *upper_priv, void *upper_info,
+@@ -6988,6 +7033,7 @@ static int __netdev_upper_dev_link(struc
if (ret)
return ret;
+ netdev_update_addr_mask(dev);
- ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
+ ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
ret = notifier_to_errno(ret);
-@@ -6394,6 +6440,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -7074,6 +7120,7 @@ void netdev_upper_dev_unlink(struct net_
__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
+ netdev_update_addr_mask(dev);
- call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
+ call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
&changeupper_info.info);
}
-@@ -6966,6 +7013,7 @@ int dev_set_mac_address(struct net_devic
+@@ -7697,6 +7744,7 @@ int dev_set_mac_address(struct net_devic
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch
index 2b89a05238..13f5640590 100644
--- a/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch
+++ b/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch
@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
-@@ -10,6 +10,7 @@
+@@ -11,6 +11,7 @@
#include <linux/of_net.h>
#include <linux/phy.h>
#include <linux/export.h>
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* of_get_phy_mode - Get phy mode for given device_node
-@@ -38,7 +39,7 @@ int of_get_phy_mode(struct device_node *
+@@ -39,7 +40,7 @@ int of_get_phy_mode(struct device_node *
}
EXPORT_SYMBOL_GPL(of_get_phy_mode);
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
struct property *pp = of_find_property(np, name, NULL);
-@@ -47,6 +48,79 @@ static const void *of_get_mac_addr(struc
+@@ -48,6 +49,79 @@ static const void *of_get_mac_addr(struc
return NULL;
}
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* 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
-@@ -64,11 +138,18 @@ static const void *of_get_mac_addr(struc
+@@ -65,11 +139,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.
diff --git a/target/linux/generic/pending-4.19/701-phy_extension.patch b/target/linux/generic/pending-4.19/701-phy_extension.patch
index 0f0b0e0467..a340872e56 100644
--- a/target/linux/generic/pending-4.19/701-phy_extension.patch
+++ b/target/linux/generic/pending-4.19/701-phy_extension.patch
@@ -85,7 +85,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
* @phydev: the phy_device struct
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
-@@ -909,6 +909,7 @@ void phy_ethtool_ksettings_get(struct ph
+@@ -1045,6 +1045,7 @@ void phy_ethtool_ksettings_get(struct ph
struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);
diff --git a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch
index 11436a2166..bc45d4ed68 100644
--- a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch
+++ b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch
@@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1102,6 +1102,9 @@ void phy_detach(struct phy_device *phyde
+@@ -1133,6 +1133,9 @@ void phy_detach(struct phy_device *phyde
struct module *ndev_owner = dev->dev.parent->driver->owner;
struct mii_bus *bus;
@@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev");
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
-@@ -559,6 +559,12 @@ struct phy_driver {
+@@ -560,6 +560,12 @@ struct phy_driver {
*/
int (*did_interrupt)(struct phy_device *phydev);
diff --git a/target/linux/generic/pending-4.19/734-net-phy-at803x-allow-to-configure-via-pdata.patch b/target/linux/generic/pending-4.19/734-net-phy-at803x-allow-to-configure-via-pdata.patch
index 27bbf572e9..e56e77addf 100644
--- a/target/linux/generic/pending-4.19/734-net-phy-at803x-allow-to-configure-via-pdata.patch
+++ b/target/linux/generic/pending-4.19/734-net-phy-at803x-allow-to-configure-via-pdata.patch
@@ -40,15 +40,15 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
#define AT803X_DEBUG_ADDR 0x1D
#define AT803X_DEBUG_DATA 0x1E
-@@ -74,6 +81,7 @@ MODULE_LICENSE("GPL");
+@@ -73,6 +80,7 @@ MODULE_LICENSE("GPL");
+
struct at803x_priv {
bool phy_reset:1;
- struct gpio_desc *gpiod_reset;
+ int prev_speed;
};
struct at803x_context {
-@@ -274,8 +282,16 @@ does_not_require_reset_workaround:
+@@ -249,8 +257,16 @@ static int at803x_probe(struct phy_devic
return 0;
}
@@ -65,7 +65,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
int ret;
ret = genphy_config_init(phydev);
-@@ -296,6 +312,26 @@ static int at803x_config_init(struct phy
+@@ -271,6 +287,26 @@ static int at803x_config_init(struct phy
return ret;
}
@@ -92,7 +92,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
return 0;
}
-@@ -333,6 +369,8 @@ static int at803x_config_intr(struct phy
+@@ -308,6 +344,8 @@ static int at803x_config_intr(struct phy
static void at803x_link_change_notify(struct phy_device *phydev)
{
struct at803x_priv *priv = phydev->priv;
@@ -101,7 +101,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
/*
* Conduct a hardware reset for AT8030/2 every time a link loss is
-@@ -361,6 +399,24 @@ static void at803x_link_change_notify(st
+@@ -336,6 +374,24 @@ static void at803x_link_change_notify(st
} else {
priv->phy_reset = false;
}
diff --git a/target/linux/generic/pending-4.19/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-4.19/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
index 8c5c21b1bc..1f81b37f71 100644
--- a/target/linux/generic/pending-4.19/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
+++ b/target/linux/generic/pending-4.19/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
@@ -21,7 +21,7 @@ Signed-off-by: Roman Yeryomin <roman@advem.lv>
#define AT803X_PCS_SMART_EEE_CTRL3 0x805D
#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK 0x3
-@@ -293,6 +294,27 @@ static int at803x_config_init(struct phy
+@@ -268,6 +269,27 @@ static int at803x_config_init(struct phy
{
struct at803x_platform_data *pdata;
int ret;
diff --git a/target/linux/generic/pending-4.19/736-net-phy-at803x-allow-to-configure-via-dt.patch b/target/linux/generic/pending-4.19/736-net-phy-at803x-allow-to-configure-via-dt.patch
index 6bc626dd6a..496700f377 100644
--- a/target/linux/generic/pending-4.19/736-net-phy-at803x-allow-to-configure-via-dt.patch
+++ b/target/linux/generic/pending-4.19/736-net-phy-at803x-allow-to-configure-via-dt.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
-@@ -354,6 +354,14 @@ static int at803x_config_init(struct phy
+@@ -329,6 +329,14 @@ static int at803x_config_init(struct phy
AT803X_DEBUG_TX_CLK_DLY_EN, 0);
}
@@ -15,7 +15,7 @@
return 0;
}
-@@ -392,6 +400,7 @@ static void at803x_link_change_notify(st
+@@ -367,6 +375,7 @@ static void at803x_link_change_notify(st
{
struct at803x_priv *priv = phydev->priv;
struct at803x_platform_data *pdata;
@@ -23,7 +23,7 @@
pdata = dev_get_platdata(&phydev->mdio.dev);
/*
-@@ -421,8 +430,19 @@ static void at803x_link_change_notify(st
+@@ -396,8 +405,19 @@ static void at803x_link_change_notify(st
} else {
priv->phy_reset = false;
}
diff --git a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch
index c80e58105d..3f452ebf48 100644
--- a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch
+++ b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch
@@ -9,7 +9,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
-@@ -71,6 +71,12 @@ config XEN_PCIDEV_FRONTEND
+@@ -89,6 +89,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.
@@ -19,37 +19,39 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+ help
+ If you don't know what to do here, say N.
+
- config HT_IRQ
- bool "Interrupts on hypertransport devices"
- default y
++
+ config PCI_ATS
+ bool
+
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
-@@ -43,6 +43,7 @@ static void quirk_mmio_always_on(struct
+@@ -207,6 +207,7 @@ static void quirk_mmio_always_on(struct
DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
+#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
- /* The Mellanox Tavor device gives false positive parity errors
- * Mark this device with a broken_parity_status, to allow
- * PCI scanning code to "skip" this now blacklisted device.
-@@ -3077,6 +3078,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
+ /*
+ * The Mellanox Tavor device gives false positive parity errors. Mark this
+ * device with a broken_parity_status to allow PCI scanning code to "skip"
+@@ -3135,6 +3136,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);
+#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */
-
++
/*
- * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To
-@@ -3133,6 +3135,8 @@ static void fixup_debug_report(struct pc
- }
- }
+ * 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
+@@ -3160,6 +3163,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);
+#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS
+
/*
- * Some BIOS implementations leave the Intel GPU interrupts enabled,
- * even though no one is handling them (f.e. i915 driver is never loaded).
-@@ -3171,6 +3175,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
+ * Some BIOS implementations leave the Intel GPU interrupts enabled, even
+ * though no one is handling them (e.g., if the i915 driver is never
+@@ -3198,6 +3203,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);
diff --git a/target/linux/generic/pending-4.19/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-4.19/811-pci_disable_usb_common_quirks.patch
index f40214c29b..7d36af7d26 100644
--- a/target/linux/generic/pending-4.19/811-pci_disable_usb_common_quirks.patch
+++ b/target/linux/generic/pending-4.19/811-pci_disable_usb_common_quirks.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
-@@ -124,6 +124,8 @@ struct amd_chipset_type {
+@@ -125,6 +125,8 @@ struct amd_chipset_type {
u8 rev;
};
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static struct amd_chipset_info {
struct pci_dev *nb_dev;
struct pci_dev *smbus_dev;
-@@ -620,6 +622,10 @@ bool usb_amd_pt_check_port(struct device
+@@ -621,6 +623,10 @@ bool usb_amd_pt_check_port(struct device
}
EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/*
* Make sure the controller is completely inactive, unable to
* generate interrupts or do DMA.
-@@ -699,8 +705,17 @@ reset_needed:
+@@ -700,8 +706,17 @@ reset_needed:
uhci_reset_hc(pdev, base);
return 1;
}
@@ -48,10 +48,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
{
u16 cmd;
-@@ -1287,3 +1302,4 @@ bool usb_xhci_needs_pci_reset(struct pci
- return false;
+@@ -1268,3 +1283,4 @@ static void quirk_usb_early_handoff(stru
}
- EXPORT_SYMBOL_GPL(usb_xhci_needs_pci_reset);
+ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff);
+#endif
--- a/drivers/usb/host/pci-quirks.h
+++ b/drivers/usb/host/pci-quirks.h
@@ -65,7 +65,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
int usb_amd_find_chipset_info(void);
int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev);
bool usb_amd_hang_symptom_quirk(void);
-@@ -20,6 +23,18 @@ bool usb_xhci_needs_pci_reset(struct pci
+@@ -19,6 +22,18 @@ void sb800_prefetch(struct device *dev,
bool usb_amd_pt_check_port(struct device *device, int port);
#else
struct pci_dev;
@@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static inline void usb_amd_quirk_pll_disable(void) {}
static inline void usb_amd_quirk_pll_enable(void) {}
static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
-@@ -30,6 +45,11 @@ static inline bool usb_amd_pt_check_port
+@@ -29,6 +44,11 @@ static inline bool usb_amd_pt_check_port
{
return false;
}
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* __LINUX_USB_PCI_QUIRKS_H */
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
-@@ -465,7 +465,14 @@ extern int usb_hcd_pci_probe(struct pci_
+@@ -473,7 +473,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);
diff --git a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch
index 2eec024b72..d89bfec897 100644
--- a/target/linux/generic/pending-4.19/834-ledtrig-libata.patch
+++ b/target/linux/generic/pending-4.19/834-ledtrig-libata.patch
@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/**
* ata_build_rw_tf - Build ATA taskfile for given read/write request
* @tf: Target ATA taskfile
-@@ -5120,6 +5133,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
+@@ -5129,6 +5142,9 @@ struct ata_queued_cmd *ata_qc_new_init(s
if (tag < 0)
return NULL;
}
@@ -74,8 +74,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+#endif
qc = __ata_qc_from_tag(ap, tag);
- qc->tag = tag;
-@@ -6021,6 +6037,9 @@ struct ata_port *ata_port_alloc(struct a
+ qc->tag = qc->hw_tag = tag;
+@@ -6039,6 +6055,9 @@ struct ata_port *ata_port_alloc(struct a
ap->stats.unhandled_irq = 1;
ap->stats.idle_irq = 1;
#endif
@@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
ata_sff_port_init(ap);
return ap;
-@@ -6042,6 +6061,12 @@ static void ata_host_release(struct devi
+@@ -6074,6 +6093,12 @@ static void ata_host_release(struct kref
kfree(ap->pmp_link);
kfree(ap->slave_link);
@@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
kfree(ap);
host->ports[i] = NULL;
}
-@@ -6488,7 +6513,23 @@ int ata_host_register(struct ata_host *h
+@@ -6537,7 +6562,23 @@ int ata_host_register(struct ata_host *h
host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
host->ports[i]->local_port_no = i + 1;
}
@@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
-@@ -890,6 +893,12 @@ struct ata_port {
+@@ -893,6 +896,12 @@ struct ata_port {
#ifdef CONFIG_ATA_ACPI
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif
diff --git a/target/linux/generic/pending-4.19/920-mangle_bootargs.patch b/target/linux/generic/pending-4.19/920-mangle_bootargs.patch
index adeb9f12f9..85e6b97bb1 100644
--- a/target/linux/generic/pending-4.19/920-mangle_bootargs.patch
+++ b/target/linux/generic/pending-4.19/920-mangle_bootargs.patch
@@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
--- a/init/Kconfig
+++ b/init/Kconfig
-@@ -1427,6 +1427,15 @@ config EMBEDDED
+@@ -1522,6 +1522,15 @@ config EMBEDDED
an embedded system so certain expert options are available
for configuration.
@@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
help
--- a/init/main.c
+++ b/init/main.c
-@@ -359,6 +359,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -366,6 +366,29 @@ static inline void setup_nr_cpu_ids(void
static inline void smp_prepare_cpus(unsigned int maxcpus) { }
#endif
@@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
/*
* We need to store the untouched command line for future reference.
* We also need to store the touched command line since the parameter
-@@ -540,6 +563,7 @@ asmlinkage __visible void __init start_k
+@@ -558,6 +581,7 @@ asmlinkage __visible void __init start_k
add_device_randomness(command_line, strlen(command_line));
boot_init_stack_canary();
mm_init_cpumask(&init_mm);
diff --git a/target/linux/generic/pending-4.19/950-tty-serial-exar-generalize-rs485-setup.patch b/target/linux/generic/pending-4.19/950-tty-serial-exar-generalize-rs485-setup.patch
deleted file mode 100644
index 869bf7b9b2..0000000000
--- a/target/linux/generic/pending-4.19/950-tty-serial-exar-generalize-rs485-setup.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 24d5ba8ad40c3ac7903f688580c345aafa764dc7 Mon Sep 17 00:00:00 2001
-From: Daniel Golle <daniel@makrotopia.org>
-Date: Mon, 4 Jun 2018 14:51:29 +0200
-Subject: [PATCH] tty: serial: exar: generalize rs485 setup
-To: linux-serial@vger.kernel.org,
- Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Cc: Linus Walleij <linus.walleij@linaro.org>,
- Jan Kiszka <jan.kiszka@siemens.com>
-
-Move the non-board-specific part of the RS485 initialization
-from iot2040_rs485_config function to a new generic function
-used also for other boards.
-This allows using PCIe boards which are hard-wired to RS485
-or have jumpers for their configurations.
-
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- drivers/tty/serial/8250/8250_exar.c | 38 +++++++++++++++++++----------
- 1 file changed, 25 insertions(+), 13 deletions(-)
-
---- a/drivers/tty/serial/8250/8250_exar.c
-+++ b/drivers/tty/serial/8250/8250_exar.c
-@@ -275,8 +275,32 @@ static int xr17v35x_register_gpio(struct
- return 0;
- }
-
-+static int generic_rs485_config(struct uart_port *port,
-+ struct serial_rs485 *rs485)
-+{
-+ bool is_rs485 = !!(rs485->flags & SER_RS485_ENABLED);
-+ u8 __iomem *p = port->membase;
-+ u8 value;
-+
-+ value = readb(p + UART_EXAR_FCTR);
-+ if (is_rs485)
-+ value |= UART_FCTR_EXAR_485;
-+ else
-+ value &= ~UART_FCTR_EXAR_485;
-+
-+ writeb(value, p + UART_EXAR_FCTR);
-+
-+ if (is_rs485)
-+ writeb(UART_EXAR_RS485_DLY(4), p + UART_MSR);
-+
-+ port->rs485 = *rs485;
-+
-+ return 0;
-+}
-+
- static const struct exar8250_platform exar8250_default_platform = {
- .register_gpio = xr17v35x_register_gpio,
-+ .rs485_config = generic_rs485_config,
- };
-
- static int iot2040_rs485_config(struct uart_port *port,
-@@ -309,19 +333,7 @@ static int iot2040_rs485_config(struct u
- value |= mode;
- writeb(value, p + UART_EXAR_MPIOLVL_7_0);
-
-- value = readb(p + UART_EXAR_FCTR);
-- if (is_rs485)
-- value |= UART_FCTR_EXAR_485;
-- else
-- value &= ~UART_FCTR_EXAR_485;
-- writeb(value, p + UART_EXAR_FCTR);
--
-- if (is_rs485)
-- writeb(UART_EXAR_RS485_DLY(4), p + UART_MSR);
--
-- port->rs485 = *rs485;
--
-- return 0;
-+ return generic_rs485_config(port, rs485);
- }
-
- static const struct property_entry iot2040_gpio_properties[] = {