diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 98adc9e39..4f6cb2d76 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,13 +2,13 @@ LINUX_RELEASE?=1 -LINUX_VERSION-3.18 = .119 -LINUX_VERSION-4.9 = .124 -LINUX_VERSION-4.14 = .67 +LINUX_VERSION-3.18 = .122 +LINUX_VERSION-4.9 = .128 +LINUX_VERSION-4.14 = .71 -LINUX_KERNEL_HASH-3.18.119 = 2bab623ed868b679eac224f62212cc285264061bedf1e32897f72e35aa26160d -LINUX_KERNEL_HASH-4.9.124 = 5ca6b0d48c8dd1265005169f1b97149a4e893668c0d8aa566a73c7663c8e4311 -LINUX_KERNEL_HASH-4.14.67 = 3f4b056dc27233a78f7a4a35ed6fdcfd0a9680ec40b611a898bb6c8b905070ba +LINUX_KERNEL_HASH-3.18.122 = 675b1ce36af23caa500cb1d4f0ec2976791fb0a97ebb6486a5e2ebcb5527ade5 +LINUX_KERNEL_HASH-4.9.128 = bdb76f48491a6aadc89c0f0f7fdc240d77cee54da5aac59da0b5d98e226b6f12 +LINUX_KERNEL_HASH-4.14.71 = 76a4473dbcbd922c23a16130414829a36eb7e2f4e5859bd1b742fffdff907489 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch index a61d34411..015c283e1 100644 --- a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch @@ -621,7 +621,7 @@ #define IP6_MF 0x0001 #define IP6_OFFSET 0xFFF8 -@@ -444,8 +444,8 @@ static inline void __ipv6_addr_set_half( +@@ -437,8 +437,8 @@ static inline void __ipv6_addr_set_half( } #endif #endif @@ -632,7 +632,7 @@ } static inline void ipv6_addr_set(struct in6_addr *addr, -@@ -504,6 +504,8 @@ static inline bool ipv6_prefix_equal(con +@@ -497,6 +497,8 @@ static inline bool ipv6_prefix_equal(con const __be32 *a1 = addr1->s6_addr32; const __be32 *a2 = addr2->s6_addr32; unsigned int pdw, pbi; @@ -641,7 +641,7 @@ /* check complete u32 in prefix */ pdw = prefixlen >> 5; -@@ -512,7 +514,9 @@ static inline bool ipv6_prefix_equal(con +@@ -505,7 +507,9 @@ static inline bool ipv6_prefix_equal(con /* check incomplete u32 in prefix */ pbi = prefixlen & 0x1f; @@ -652,7 +652,7 @@ return false; return true; -@@ -656,13 +660,13 @@ static inline void ipv6_addr_set_v4mappe +@@ -634,13 +638,13 @@ static inline void ipv6_addr_set_v4mappe */ static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) { @@ -668,7 +668,7 @@ if (xb) return i * 32 + 31 - __fls(ntohl(xb)); } -@@ -831,17 +835,18 @@ static inline int ip6_default_np_autolab +@@ -809,17 +813,18 @@ static inline int ip6_default_np_autolab static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, __be32 flowlabel) { diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index db0d12cce..7ec530091 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -95,10 +95,19 @@ tplink,tl-wr841-v11) ubnt,bullet-m|\ ubnt,nano-m|\ ubnt,rocket-m) + ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100" + ;; +wd,mynet-wifi-rangeextender) + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100" + ;; esac board_config_flush diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 14f6c5982..54fbe7b35 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -23,9 +23,15 @@ ath79_setup_interfaces() ubnt,rocket-m|\ ubnt,unifiac-lite|\ ubnt,unifiac-mesh|\ - ubnt,unifi) + ubnt,unifi|\ + wd,mynet-wifi-rangeextender) ucidef_set_interface_lan "eth0" ;; + buffalo,wzr-hp-ag300h) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; buffalo,wzr-hp-g450h) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" @@ -39,6 +45,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" ;; + elecom,wrc-300ghbk2-i) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" + ;; embeddedwireless,dorin) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan:3" "3:lan:2" @@ -176,6 +186,9 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_text "caldata" 65440) wan_mac=$(mtd_get_mac_text "caldata" 65460) ;; + elecom,wrc-300ghbk2-i) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary ART 4098)" -2) + ;; iodata,etg3-r) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" -1) @@ -207,6 +220,9 @@ ath79_setup_macs() wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n ar7100_esa) lan_mac=$(macaddr_add "$wan_mac" 1) ;; + wd,mynet-wifi-rangeextender) + lan_mac=$(nvram get et0macaddr) + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 1af6f96be..334e7056c 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -145,6 +145,10 @@ case "$FIRMWARE" in ubnt,unifi) ath9k_eeprom_extract "art" 4096 2048 ;; + wd,mynet-wifi-rangeextender) + ath9k_eeprom_extract "art" 4096 4096 + ath9k_patch_fw_mac_crc $(nvram get wl0_hwaddr) "$mac" 2 + ;; *) ath9k_eeprom_die "board $board is not supported yet" ;; @@ -152,15 +156,16 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:11.0.bin") case $board in - dlink,dir-825-b1) - ath9k_eeprom_extract "caldata" 4096 3768 - ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 65440) 524 - ;; + buffalo,wzr-hp-ag300h|\ netgear,wndr3700|\ netgear,wndr3700v2|\ netgear,wndr3800) ath9k_eeprom_extract "art" 4096 3768 ;; + dlink,dir-825-b1) + ath9k_eeprom_extract "caldata" 4096 3768 + ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 65440) 524 + ;; *) ath9k_eeprom_die "board $board is not supported yet" ;; @@ -168,15 +173,16 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:12.0.bin") case $board in - dlink,dir-825-b1) - ath9k_eeprom_extract "caldata" 20480 3768 - ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 65460) 1) 524 - ;; + buffalo,wzr-hp-ag300h|\ netgear,wndr3700|\ netgear,wndr3700v2|\ netgear,wndr3800) ath9k_eeprom_extract "art" 20480 3768 ;; + dlink,dir-825-b1) + ath9k_eeprom_extract "caldata" 20480 3768 + ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 65460) 1) 524 + ;; *) ath9k_eeprom_die "board $board is not supported yet" ;; diff --git a/target/linux/ath79/config-4.14 b/target/linux/ath79/config-4.14 index 2b0cd4fe5..f0365e95f 100644 --- a/target/linux/ath79/config-4.14 +++ b/target/linux/ath79/config-4.14 @@ -163,6 +163,7 @@ CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y # CONFIG_MTD_MAP_BANK_WIDTH_1 is not set # CONFIG_MTD_MAP_BANK_WIDTH_4 is not set +CONFIG_MTD_PARSER_CYBERTAN=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPLIT_FIRMWARE=y @@ -172,6 +173,7 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_TPLINK_PARTS=y +CONFIG_MTD_VIRT_CONCAT=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y @@ -230,4 +232,3 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y -CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts new file mode 100644 index 000000000..8a5571ad0 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7100.dtsi" + +/ { + compatible = "buffalo,wzr-hp-ag300h", "qca,ar7161"; + model = "Buffalo WZR-HP-AG300H/WZR-600DHP"; + + aliases { + led-boot = &diag; + led-failsafe = &diag; + led-upgrade = &diag; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + gpio-leds { + compatible = "gpio-leds"; + + diag: diag { + label = "buffalo:red:diag"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; + + ath9k-leds { + // those leds are indeed attached to the wifi chips + + compatible = "gpio-leds"; + band2g_a { + label = "buffalo:amber:band2g"; + gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + usb { + label = "buffalo:green:usb"; + gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>; + default-state = "off"; + trigger-sources = <&usb_ochi_port>, <&usb_echi_port>; + linux,default-trigger = "usbport"; + }; + + band2g_g { + label = "buffalo:green:band2g"; + gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; + default-state = "off"; + linux,default-trigger = "phy0tpt"; + }; + + band5g_g { + label = "buffalo:green:band5g"; + gpios = <&ath9k1 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + linux,default-trigger = "phy1tpt"; + }; + + router { + label = "buffalo:green:router"; + gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + movie_engine { + label = "buffalo:blue:movie_engine"; + gpios = <&ath9k1 4 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + band5g_a { + label = "buffalo:amber:band5g"; + gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + usb { + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + aoss { + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_auto { + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_off { + linux,code = ; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + movie_engine { + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_usb_power { + gpio-export,name = "buffalo:power:usb"; + gpio-export,output = <1>; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + }; + + flash { + compatible = "mtd-concat"; + + devices = <&flash0 &flash1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x0040000 0x0010000>; + read-only; + }; + + art: partition@50000 { + label = "art"; + reg = <0x0050000 0x0010000>; + read-only; + }; + + partition@60000 { + label = "firmware"; + reg = <0x0060000 0x1f90000>; + }; + + partition@1ff0000 { + label = "user_property"; + reg = <0x1ff0000 0x0010000>; + read-only; + }; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + usb_ochi_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + usb_echi_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { + compatible = "pci168c,0029"; + reg = <0x8800 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { + compatible = "pci168c,0029"; + reg = <0x9000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&uart { + status = "okay"; +}; + +&pll { + clocks = <&extosc>; +}; + +&spi { + status = "okay"; + num-cs = <2>; + cs-gpios = <0>, <0>; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <104000000>; + m25p,fast-read; + }; + + flash1: flash@1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <104000000>; + m25p,fast-read; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x120c>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x520c>; + mtd-mac-address-increment = <1>; + + phy-handle = <&phy4>; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts new file mode 100644 index 000000000..1877cea3d --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + model = "Western Digital My Net Wi-Fi Range Extender"; + compatible = "wd,mynet-wifi-rangeextender", "qca,ar9344"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + leds { + compatible = "gpio-leds"; + + power: power { + label = "mynet-wifi-rangeextender:blue:power"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + /* LED has no off state. It's either on or it blinks */ + }; + + lan { + label = "mynet-wifi-rangeextender:green:lan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "mynet-wifi-rangeextender:blue:wifi"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi-rssi-low { + label = "mynet-wifi-rangeextender:blue:rssi-low"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + wifi-rssi-med { + label = "mynet-wifi-rangeextender:blue:rssi-med"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + wifi-rssi-max { + label = "mynet-wifi-rangeextender:blue:rssi-max"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <50>; + + reset { + linux,code = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + band-switch { + linux,code = ; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + linux,input-type = ; + debounce-interval = <60>; + }; + + wps { + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + num-cs = <1>; + + status = "okay"; + + flash@0 { + compatible = /* "s25fl064k", */ "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x040000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0x7a0000>; + compatible = "cybertan,trx"; + }; + + nvram: partition@7e0000 { + label = "nvram"; + reg = <0x7e0000 0x10000>; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0030"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + /* wifi MAC is stored in nvram */ + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x0e000000 0x3c000101 0x3c001313>; + + /* ethernet MAC is stored in nvram */ + phy-mode = "rgmii"; + phy-handle = <&phy4>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; + +&mdio1 { + status = "disabled"; +}; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts new file mode 100644 index 000000000..705279519 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + model = "ELECOM WRC-300GHBK2-I"; + compatible = "elecom,wrc-300ghbk2-i", "qca,qca9563"; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + leds { + compatible = "gpio-leds"; + + power: power { + label = "wrc-300ghbk2-i:white:power"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + wlan2g { + label = "wrc-300ghbk2-i:white:wlan2g"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "wrc-300ghbk2-i:red:wps"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button_wps { + label = "wps"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + ap { + label = "ap"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "nvram"; + reg = <0x050000 0x020000>; + read-only; + }; + + partition@70000 { + label = "firmware"; + reg = <0x070000 0x770000>; + }; + + partition@7e0000 { + label = "hwconfig"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + ART: partition@7f0000 { + label = "ART"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00000080 /* PORT0 PAD MODE CTRL */ + 0x50 0xcf37cf37 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&ART 0x1002>; + mtd-mac-address-increment = <(-1)>; + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&ART 0x1000>; +}; diff --git a/target/linux/ath79/files/drivers/mtd/parsers/parser_cybertan.c b/target/linux/ath79/files/drivers/mtd/parsers/parser_cybertan.c new file mode 100644 index 000000000..7b67e31b0 --- /dev/null +++ b/target/linux/ath79/files/drivers/mtd/parsers/parser_cybertan.c @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2009 Christian Daniel + * Copyright (C) 2009 Gabor Juhos + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * TRX flash partition table. + * Based on ar7 map by Felix Fietkau + * + */ + +#include +#include +#include +#include + +#include +#include +#include + +struct cybertan_header { + char magic[4]; + u8 res1[4]; + char fw_date[3]; + char fw_ver[3]; + char id[4]; + char hw_ver; + char unused; + u8 flags[2]; + u8 res2[10]; +} __packed; + +#define TRX_PARTS 3 +#define TRX_MAGIC 0x30524448 +#define TRX_MAX_OFFSET 3 + +struct trx_header { + __le32 magic; /* "HDR0" */ + __le32 len; /* Length of file including header */ + __le32 crc32; /* 32-bit CRC from flag_version to end of file */ + __le32 flag_version; /* 0:15 flags, 16:31 version */ + __le32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions from start of header */ +} __packed; + +#define IH_MAGIC 0x27051956 /* Image Magic Number */ +#define IH_NMLEN 32 /* Image Name Length */ + +struct uimage_header { + __be32 ih_magic; /* Image Header Magic Number */ + __be32 ih_hcrc; /* Image Header CRC Checksum */ + __be32 ih_time; /* Image Creation Timestamp */ + __be32 ih_size; /* Image Data Size */ + __be32 ih_load; /* Data» Load Address */ + __be32 ih_ep; /* Entry Point Address */ + __be32 ih_dcrc; /* Image Data CRC Checksum */ + uint8_t ih_os; /* Operating System */ + uint8_t ih_arch; /* CPU architecture */ + uint8_t ih_type; /* Image Type */ + uint8_t ih_comp; /* Compression Type */ + uint8_t ih_name[IH_NMLEN]; /* Image Name */ +} __packed; + +struct firmware_header { + struct cybertan_header cybertan; + struct trx_header trx; + struct uimage_header uimage; +} __packed; + +static int cybertan_parse_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +{ + struct firmware_header header; + struct trx_header *theader; + struct uimage_header *uheader; + struct mtd_partition *trx_parts; + size_t retlen; + unsigned int kernel_len; + int ret; + + trx_parts = kcalloc(TRX_PARTS, sizeof(struct mtd_partition), + GFP_KERNEL); + if (!trx_parts) { + ret = -ENOMEM; + goto out; + } + + ret = mtd_read(master, 0, sizeof(header), + &retlen, (uint8_t *)&header); + if (ret) + goto free_parts; + + if (retlen != sizeof(header)) { + ret = -EIO; + goto free_parts; + } + + theader = &header.trx; + if (theader->magic != cpu_to_le32(TRX_MAGIC)) { + printk(KERN_NOTICE "%s: no TRX header found\n", master->name); + goto free_parts; + } + + uheader = &header.uimage; + if (uheader->ih_magic != cpu_to_be32(IH_MAGIC)) { + printk(KERN_NOTICE "%s: no uImage found\n", master->name); + goto free_parts; + } + + kernel_len = le32_to_cpu(theader->offsets[1]) + + sizeof(struct cybertan_header); + + trx_parts[0].name = "header"; + trx_parts[0].offset = 0; + trx_parts[0].size = offsetof(struct firmware_header, uimage); + trx_parts[0].mask_flags = 0; + + trx_parts[1].name = "kernel"; + trx_parts[1].offset = trx_parts[0].offset + trx_parts[0].size; + trx_parts[1].size = kernel_len - trx_parts[0].size; + trx_parts[1].mask_flags = 0; + + trx_parts[2].name = "rootfs"; + trx_parts[2].offset = trx_parts[1].offset + trx_parts[1].size; + trx_parts[2].size = master->size - trx_parts[1].size - trx_parts[0].size; + trx_parts[2].mask_flags = 0; + + *pparts = trx_parts; + return TRX_PARTS; + +free_parts: + kfree(trx_parts); +out: + return ret; +} + +static const struct of_device_id mtd_parser_cybertan_of_match_table[] = { + { .compatible = "cybertan,trx" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mtd_parser_cybertan_of_match_table); + +static struct mtd_part_parser mtd_parser_cybertan = { + .parse_fn = cybertan_parse_partitions, + .name = "cybertan-trx", + .of_match_table = mtd_parser_cybertan_of_match_table, +}; +module_mtd_part_parser(mtd_parser_cybertan); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Christian Daniel "); diff --git a/target/linux/ath79/image/common-buffalo.mk b/target/linux/ath79/image/common-buffalo.mk new file mode 100644 index 000000000..a756f8448 --- /dev/null +++ b/target/linux/ath79/image/common-buffalo.mk @@ -0,0 +1,20 @@ +define Build/buffalo-tftp-header + ( \ + echo -n -e "# Airstation Public Fmt1" | dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ +endef + +define Build/buffalo-tag + $(eval product=$(word 1,$(1))) + $(STAGING_DIR_HOST)/bin/buffalo-tag \ + -c 0x80041000 -d 0x801e8000 -w 3 \ + -a ath -v 1.99 -m 1.01 -f 1 \ + -b $(product) -p $(product) \ + -r M_ -l mlang8 \ + -i $@ -o $@.new + mv $@.new $@ +endef + + diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 49f5fcc4f..d9411c6c2 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -38,7 +38,7 @@ endef define Device/ubnt-xm $(Device/ubnt) - DEVICE_PACKAGES += kmod-usb-ohci + DEVICE_PACKAGES += kmod-usb-ohci rssileds UBNT_TYPE := XM UBNT_CHIP := ar7240 ATH_SOC := ar7241 diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e35a3568a..e968dcf92 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1,5 +1,48 @@ +include ./common-buffalo.mk include ./common-netgear.mk +DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION + +define Build/cybertan-trx + @echo -n '' > $@-empty.bin + -$(STAGING_DIR_HOST)/bin/trx -o $@.new \ + -f $(IMAGE_KERNEL) -F $@-empty.bin \ + -x 32 -a 0x10000 -x -32 -f $@ + -mv "$@.new" "$@" + -rm $@-empty.bin +endef + +define Build/addpattern + -$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \ + -v v$(ADDPATTERN_VERSION) -i $@ -o $@.new + -mv "$@.new" "$@" +endef + +define Build/elecom-header + $(eval fw_size=$(word 1,$(1))) + $(eval edimax_model=$(word 2,$(1))) + $(eval product=$(word 3,$(1))) + $(eval factory_bin=$(word 4,$(1))) + if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \ + $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \ + $(STAGING_DIR_HOST)/bin/mkedimaximg \ + -b -s CSYS -m $(edimax_model) \ + -f 0x70000 -S 0x01100000 \ + -i $(factory_bin) -o $(factory_bin).new; \ + mv $(factory_bin).new $(factory_bin); \ + ( \ + echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \ + echo -n "0.00" | dd bs=16 count=1 conv=sync; \ + dd if=$(factory_bin); \ + ) > $(factory_bin).new; \ + mv $(factory_bin).new $(factory_bin); \ + $(CP) $(factory_bin) $(BIN_DIR)/; \ + else \ + echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \ + fi + +endef + define Device/avm_fritz300e ATH_SOC := ar7242 DEVICE_TITLE := AVM FRITZ!WLAN Repeater 300E @@ -26,6 +69,19 @@ define Device/avm_fritz4020 endef TARGET_DEVICES += avm_fritz4020 +define Device/buffalo_wzr-hp-ag300h + ATH_SOC := ar7161 + DEVICE_TITLE := Buffalo WZR-HP-AG300H + IMAGE_SIZE := 32256k + IMAGES += factory.bin tftp.bin + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | buffalo-tag WZR-HP-AG300H + IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport kmod-leds-reset kmod-owl-loader + SUPPORTED_DEVICES += wzr-hp-ag300h +endef +TARGET_DEVICES += buffalo_wzr-hp-ag300h + define Device/buffalo_wzr-hp-g450h ATH_SOC := ar7242 DEVICE_TITLE := Buffalo WZR-HP-G450H @@ -45,6 +101,16 @@ define Device/dlink_dir-825-b1 endef TARGET_DEVICES += dlink_dir-825-b1 +define Device/elecom_wrc-300ghbk2-i + ATH_SOC := qca9563 + DEVICE_TITLE := ELECOM WRC-300GHBK2-I + IMAGE_SIZE := 7616k + KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \ + elecom-header 7798706 RN51 WRC-300GHBK2-I \ + $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin +endef +TARGET_DEVICES += elecom_wrc-300ghbk2-i + define Device/embeddedwireless_dorin ATH_SOC := ar9331 DEVICE_TITLE := Embedded Wireless Dorin @@ -232,3 +298,16 @@ define Device/phicomm_k2t DEVICE_PACKAGES := kmod-leds-reset kmod-ath10k ath10k-firmware-qca9888 endef TARGET_DEVICES += phicomm_k2t + +define Device/wd_mynet-wifi-rangeextender + ATH_SOC := ar9344 + DEVICE_TITLE := Western Digital My Net Wi-Fi Range Extender + DEVICE_PACKAGES := rssileds nvram -swconfig + IMAGE_SIZE := 7808k + ADDPATTERN_ID := mynet-rext + ADDPATTERN_VERSION := 1.00.01 + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | cybertan-trx | \ + addpattern | append-metadata + SUPPORTED_DEVICES += mynet-rext +endef +TARGET_DEVICES += wd_mynet-wifi-rangeextender diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 004755462..531a7f30c 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -1,24 +1,7 @@ +include ./common-buffalo.mk + DEVICE_VARS += ROOTFS_SIZE -define Build/buffalo-tftp-header - ( \ - echo -n -e "# Airstation Public Fmt1" | dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ -endef - -define Build/buffalo-tag - $(eval product=$(word 1,$(1))) - $(STAGING_DIR_HOST)/bin/buffalo-tag \ - -c 0x80041000 -d 0x801e8000 -w 3 \ - -a ath -v 1.99 -m 1.01 -f 1 \ - -b $(product) -p $(product) \ - -r M_ -l mlang8 \ - -i $@ -o $@.new - mv $@.new $@ -endef - define Device/buffalo_bhr-4grv2 ATH_SOC := qca9558 DEVICE_TITLE := Buffalo BHR-4GRV2 diff --git a/target/linux/ath79/patches-4.14/404-mtd-cybertan-trx-parser.patch b/target/linux/ath79/patches-4.14/404-mtd-cybertan-trx-parser.patch new file mode 100644 index 000000000..3cc0b0dd4 --- /dev/null +++ b/target/linux/ath79/patches-4.14/404-mtd-cybertan-trx-parser.patch @@ -0,0 +1,19 @@ +--- a/drivers/mtd/parsers/Makefile ++++ b/drivers/mtd/parsers/Makefile +@@ -1 +1,2 @@ ++obj-$(CONFIG_MTD_PARSER_CYBERTAN) += parser_cybertan.o + obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o +--- a/drivers/mtd/parsers/Kconfig ++++ b/drivers/mtd/parsers/Kconfig +@@ -1,3 +1,11 @@ ++config MTD_PARSER_CYBERTAN ++ tristate "Parser for Cybertan format partitions" ++ depends on MTD && (ATH79 || COMPILE_TEST) ++ help ++ Cybertan has a proprietory header than encompasses a Broadcom trx ++ header. This driver will parse the header and take care of the ++ special offsets that result in the extra headers. ++ + config MTD_PARSER_TRX + tristate "Parser for TRX format partitions" + depends on MTD && (BCM47XX || ARCH_BCM_5301X || COMPILE_TEST) diff --git a/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch index 41e58ce8c..d86036fca 100644 --- a/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch @@ -610,7 +610,7 @@ #define IP6_MF 0x0001 #define IP6_OFFSET 0xFFF8 -@@ -444,8 +444,8 @@ static inline void __ipv6_addr_set_half( +@@ -437,8 +437,8 @@ static inline void __ipv6_addr_set_half( } #endif #endif @@ -621,7 +621,7 @@ } static inline void ipv6_addr_set(struct in6_addr *addr, -@@ -504,6 +504,8 @@ static inline bool ipv6_prefix_equal(con +@@ -497,6 +497,8 @@ static inline bool ipv6_prefix_equal(con const __be32 *a1 = addr1->s6_addr32; const __be32 *a2 = addr2->s6_addr32; unsigned int pdw, pbi; @@ -630,7 +630,7 @@ /* check complete u32 in prefix */ pdw = prefixlen >> 5; -@@ -512,7 +514,9 @@ static inline bool ipv6_prefix_equal(con +@@ -505,7 +507,9 @@ static inline bool ipv6_prefix_equal(con /* check incomplete u32 in prefix */ pbi = prefixlen & 0x1f; @@ -641,7 +641,7 @@ return false; return true; -@@ -656,13 +660,13 @@ static inline void ipv6_addr_set_v4mappe +@@ -634,13 +638,13 @@ static inline void ipv6_addr_set_v4mappe */ static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) { @@ -657,7 +657,7 @@ if (xb) return i * 32 + 31 - __fls(ntohl(xb)); } -@@ -831,17 +835,18 @@ static inline int ip6_default_np_autolab +@@ -809,17 +813,18 @@ static inline int ip6_default_np_autolab static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, __be32 flowlabel) { diff --git a/target/linux/brcm2708/patches-4.9/950-0074-Update-ds1307-driver-for-device-tree-support.patch b/target/linux/brcm2708/patches-4.9/950-0074-Update-ds1307-driver-for-device-tree-support.patch index d4f7e762c..236e55d69 100644 --- a/target/linux/brcm2708/patches-4.9/950-0074-Update-ds1307-driver-for-device-tree-support.patch +++ b/target/linux/brcm2708/patches-4.9/950-0074-Update-ds1307-driver-for-device-tree-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Ryan Coe --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c -@@ -1675,6 +1675,14 @@ static int ds1307_remove(struct i2c_clie +@@ -1682,6 +1682,14 @@ static int ds1307_remove(struct i2c_clie return 0; } diff --git a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch index ca5530ae9..96917f82a 100644 --- a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch @@ -396,7 +396,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -955,6 +967,8 @@ static void local_r4k_flush_cache_sigtra +@@ -957,6 +969,8 @@ static void local_r4k_flush_cache_sigtra } R4600_HIT_CACHEOP_WAR_IMPL; @@ -405,7 +405,7 @@ if (!cpu_has_ic_fills_f_dc) { if (dc_lsize) vaddr ? flush_dcache_line(addr & ~(dc_lsize - 1)) -@@ -1849,6 +1863,17 @@ static void coherency_setup(void) +@@ -1851,6 +1865,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -423,7 +423,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1895,6 +1920,15 @@ void r4k_cache_init(void) +@@ -1897,6 +1922,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -439,7 +439,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1972,7 +2006,15 @@ void r4k_cache_init(void) +@@ -1974,7 +2008,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/brcm47xx/patches-4.14/330-Revert-MIPS-BCM47XX-Enable-74K-Core-ExternalSync-for.patch b/target/linux/brcm47xx/patches-4.14/330-Revert-MIPS-BCM47XX-Enable-74K-Core-ExternalSync-for.patch deleted file mode 100644 index ad306210b..000000000 --- a/target/linux/brcm47xx/patches-4.14/330-Revert-MIPS-BCM47XX-Enable-74K-Core-ExternalSync-for.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 27 Jul 2018 12:39:01 +0200 -Subject: [PATCH] Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe - erratum" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit 2a027b47dba6b77ab8c8e47b589ae9bbc5ac6175. - -Enabling ExternalSync caused a regression for BCM4718A1 (used e.g. in -Netgear E3000 and ASUS RT-N16): it simply hangs during PCIe -initialization. It's likely that BCM4717A1 is also affected. - -I didn't notice that earlier as the only BCM47XX devices with PCIe I -own are: -1) BCM4706 with 2 x 14e4:4331 -2) BCM4706 with 14e4:4360 and 14e4:4331 -it appears that BCM4706 is unaffected. - -While BCM5300X-ES300-RDS.pdf seems to document that erratum and its -workarounds (according to quotes provided by Tokunori) it seems not even -Broadcom follows them. - -According to the provided info Broadcom should define CONF7_ES in their -SDK's mipsinc.h and implement workaround in the si_mips_init(). Checking -both didn't reveal such code. It *could* mean Broadcom also had some -problems with the given workaround. - -Reported-by: Michael Marley -Cc: Tokunori Ikegami -Cc: Paul Burton -Cc: Hauke Mehrtens -Cc: Chris Packham -Cc: stable@vger.kernel.org -Cc: James Hogan -Signed-off-by: Rafał Miłecki ---- - arch/mips/bcm47xx/setup.c | 6 ------ - arch/mips/include/asm/mipsregs.h | 3 --- - 2 files changed, 9 deletions(-) - ---- a/arch/mips/bcm47xx/setup.c -+++ b/arch/mips/bcm47xx/setup.c -@@ -212,12 +212,6 @@ static int __init bcm47xx_cpu_fixes(void - */ - if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706) - cpu_wait = NULL; -- -- /* -- * BCM47XX Erratum "R10: PCIe Transactions Periodically Fail" -- * Enable ExternalSync for sync instruction to take effect -- */ -- set_c0_config7(MIPS_CONF7_ES); - break; - #endif - } ---- a/arch/mips/include/asm/mipsregs.h -+++ b/arch/mips/include/asm/mipsregs.h -@@ -680,8 +680,6 @@ - #define MIPS_CONF7_WII (_ULCAST_(1) << 31) - - #define MIPS_CONF7_RPS (_ULCAST_(1) << 2) --/* ExternalSync */ --#define MIPS_CONF7_ES (_ULCAST_(1) << 8) - - #define MIPS_CONF7_IAR (_ULCAST_(1) << 10) - #define MIPS_CONF7_AR (_ULCAST_(1) << 16) -@@ -2747,7 +2745,6 @@ __BUILD_SET_C0(status) - __BUILD_SET_C0(cause) - __BUILD_SET_C0(config) - __BUILD_SET_C0(config5) --__BUILD_SET_C0(config7) - __BUILD_SET_C0(intcontrol) - __BUILD_SET_C0(intctl) - __BUILD_SET_C0(srsmap) diff --git a/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch index 9725779c3..b424da8d3 100644 --- a/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch @@ -396,7 +396,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -955,6 +967,8 @@ static void local_r4k_flush_cache_sigtra +@@ -957,6 +969,8 @@ static void local_r4k_flush_cache_sigtra } R4600_HIT_CACHEOP_WAR_IMPL; @@ -405,7 +405,7 @@ if (!cpu_has_ic_fills_f_dc) { if (dc_lsize) vaddr ? flush_dcache_line(addr & ~(dc_lsize - 1)) -@@ -1843,6 +1857,17 @@ static void coherency_setup(void) +@@ -1845,6 +1859,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -423,7 +423,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1889,6 +1914,15 @@ void r4k_cache_init(void) +@@ -1891,6 +1916,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -439,7 +439,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1966,7 +2000,15 @@ void r4k_cache_init(void) +@@ -1968,7 +2002,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/brcm47xx/patches-4.9/830-huawei_e970_support.patch b/target/linux/brcm47xx/patches-4.9/830-huawei_e970_support.patch index 5d40fe654..b6150ed8f 100644 --- a/target/linux/brcm47xx/patches-4.9/830-huawei_e970_support.patch +++ b/target/linux/brcm47xx/patches-4.9/830-huawei_e970_support.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -231,6 +232,33 @@ static struct fixed_phy_status bcm47xx_f +@@ -225,6 +226,33 @@ static struct fixed_phy_status bcm47xx_f .duplex = DUPLEX_FULL, }; @@ -42,7 +42,7 @@ static int __init bcm47xx_register_bus_complete(void) { switch (bcm47xx_bus_type) { -@@ -250,6 +278,7 @@ static int __init bcm47xx_register_bus_c +@@ -244,6 +272,7 @@ static int __init bcm47xx_register_bus_c bcm47xx_workarounds(); fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status, -1); diff --git a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch index 75e86f1b4..b279e8c30 100644 --- a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch +++ b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch @@ -228,7 +228,7 @@ Signed-off-by: Pablo Neira Ayuso err1: nf_tables_chain_destroy(chain); -@@ -1478,14 +1469,13 @@ static int nf_tables_updchain(struct nft +@@ -1478,13 +1469,12 @@ static int nf_tables_updchain(struct nft const struct nlattr * const *nla = ctx->nla; struct nft_table *table = ctx->table; struct nft_chain *chain = ctx->chain; @@ -236,7 +236,6 @@ Signed-off-by: Pablo Neira Ayuso struct nft_base_chain *basechain; struct nft_stats *stats = NULL; struct nft_chain_hook hook; - const struct nlattr *name; struct nf_hook_ops *ops; struct nft_trans *trans; - int err, i; @@ -244,7 +243,7 @@ Signed-off-by: Pablo Neira Ayuso if (nla[NFTA_CHAIN_HOOK]) { if (!nft_is_base_chain(chain)) -@@ -1502,14 +1492,12 @@ static int nf_tables_updchain(struct nft +@@ -1501,14 +1491,12 @@ static int nf_tables_updchain(struct nft return -EBUSY; } @@ -265,7 +264,7 @@ Signed-off-by: Pablo Neira Ayuso } nft_chain_release_hook(&hook); } -@@ -5113,10 +5101,9 @@ static int nf_tables_commit(struct net * +@@ -5134,10 +5122,9 @@ static int nf_tables_commit(struct net * case NFT_MSG_DELCHAIN: list_del_rcu(&trans->ctx.chain->list); nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN); @@ -279,7 +278,7 @@ Signed-off-by: Pablo Neira Ayuso break; case NFT_MSG_NEWRULE: nft_clear(trans->ctx.net, nft_trans_rule(trans)); -@@ -5253,10 +5240,9 @@ static int nf_tables_abort(struct net *n +@@ -5274,10 +5261,9 @@ static int nf_tables_abort(struct net *n } else { trans->ctx.table->use--; list_del_rcu(&trans->ctx.chain->list); @@ -293,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso } break; case NFT_MSG_DELCHAIN: -@@ -5359,7 +5345,7 @@ int nft_chain_validate_hooks(const struc +@@ -5380,7 +5366,7 @@ int nft_chain_validate_hooks(const struc if (nft_is_base_chain(chain)) { basechain = nft_base_chain(chain); @@ -302,7 +301,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; return -EOPNOTSUPP; -@@ -5841,8 +5827,7 @@ int __nft_release_basechain(struct nft_c +@@ -5862,8 +5848,7 @@ int __nft_release_basechain(struct nft_c BUG_ON(!nft_is_base_chain(ctx->chain)); @@ -312,7 +311,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { list_del(&rule->list); ctx->chain->use--; -@@ -5871,8 +5856,7 @@ static void __nft_release_afinfo(struct +@@ -5892,8 +5877,7 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) diff --git a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch index 9d6ce9808..5aae823ed 100644 --- a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch +++ b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch @@ -90,7 +90,7 @@ Signed-off-by: Pablo Neira Ayuso expired_count++; --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c -@@ -1105,6 +1105,14 @@ static const struct nla_policy ct_nla_po +@@ -1120,6 +1120,14 @@ static const struct nla_policy ct_nla_po .len = NF_CT_LABELS_MAX_SIZE }, }; @@ -105,7 +105,7 @@ Signed-off-by: Pablo Neira Ayuso static int ctnetlink_flush_conntrack(struct net *net, const struct nlattr * const cda[], u32 portid, int report) -@@ -1117,7 +1125,7 @@ static int ctnetlink_flush_conntrack(str +@@ -1132,7 +1140,7 @@ static int ctnetlink_flush_conntrack(str return PTR_ERR(filter); } @@ -114,7 +114,7 @@ Signed-off-by: Pablo Neira Ayuso portid, report); kfree(filter); -@@ -1163,6 +1171,11 @@ static int ctnetlink_del_conntrack(struc +@@ -1178,6 +1186,11 @@ static int ctnetlink_del_conntrack(struc ct = nf_ct_tuplehash_to_ctrack(h); diff --git a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch index 625de6b34..25b7ea224 100644 --- a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch +++ b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch @@ -292,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { err = nft_delobj(ctx, obj); if (err < 0) -@@ -4818,6 +4862,605 @@ static void nf_tables_obj_notify(const s +@@ -4834,6 +4878,605 @@ static void nf_tables_obj_notify(const s ctx->afi->family, ctx->report, GFP_KERNEL); } @@ -898,7 +898,7 @@ Signed-off-by: Pablo Neira Ayuso static int nf_tables_fill_gen_info(struct sk_buff *skb, struct net *net, u32 portid, u32 seq) { -@@ -4848,6 +5491,49 @@ nla_put_failure: +@@ -4864,6 +5507,49 @@ nla_put_failure: return -EMSGSIZE; } @@ -948,7 +948,7 @@ Signed-off-by: Pablo Neira Ayuso static void nf_tables_gen_notify(struct net *net, struct sk_buff *skb, int event) { -@@ -5000,6 +5686,21 @@ static const struct nfnl_callback nf_tab +@@ -5016,6 +5702,21 @@ static const struct nfnl_callback nf_tab .attr_count = NFTA_OBJ_MAX, .policy = nft_obj_policy, }, @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso }; static void nft_chain_commit_update(struct nft_trans *trans) -@@ -5045,6 +5746,9 @@ static void nf_tables_commit_release(str +@@ -5064,6 +5765,9 @@ static void nf_tables_commit_release(str case NFT_MSG_DELOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5162,6 +5866,21 @@ static int nf_tables_commit(struct net * +@@ -5183,6 +5887,21 @@ static int nf_tables_commit(struct net * nf_tables_obj_notify(&trans->ctx, nft_trans_obj(trans), NFT_MSG_DELOBJ); break; @@ -1002,7 +1002,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5199,6 +5918,9 @@ static void nf_tables_abort_release(stru +@@ -5220,6 +5939,9 @@ static void nf_tables_abort_release(stru case NFT_MSG_NEWOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -1012,7 +1012,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5290,6 +6012,17 @@ static int nf_tables_abort(struct net *n +@@ -5311,6 +6033,17 @@ static int nf_tables_abort(struct net *n nft_clear(trans->ctx.net, nft_trans_obj(trans)); nft_trans_destroy(trans); break; @@ -1030,7 +1030,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5840,6 +6573,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai +@@ -5861,6 +6594,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai /* Called by nft_unregister_afinfo() from __net_exit path, nfnl_lock is held. */ static void __nft_release_afinfo(struct net *net, struct nft_af_info *afi) { @@ -1038,7 +1038,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table, *nt; struct nft_chain *chain, *nc; struct nft_object *obj, *ne; -@@ -5853,6 +6587,9 @@ static void __nft_release_afinfo(struct +@@ -5874,6 +6608,9 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); @@ -1048,7 +1048,7 @@ Signed-off-by: Pablo Neira Ayuso /* No packets are walking on these chains anymore. */ ctx.table = table; list_for_each_entry(chain, &table->chains, list) { -@@ -5863,6 +6600,11 @@ static void __nft_release_afinfo(struct +@@ -5884,6 +6621,11 @@ static void __nft_release_afinfo(struct nf_tables_rule_release(&ctx, rule); } } @@ -1060,7 +1060,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(set, ns, &table->sets, list) { list_del(&set->list); table->use--; -@@ -5906,6 +6648,8 @@ static int __init nf_tables_module_init( +@@ -5927,6 +6669,8 @@ static int __init nf_tables_module_init( if (err < 0) goto err3; @@ -1069,7 +1069,7 @@ Signed-off-by: Pablo Neira Ayuso pr_info("nf_tables: (c) 2007-2009 Patrick McHardy \n"); return register_pernet_subsys(&nf_tables_net_ops); err3: -@@ -5920,6 +6664,7 @@ static void __exit nf_tables_module_exit +@@ -5941,6 +6685,7 @@ static void __exit nf_tables_module_exit { unregister_pernet_subsys(&nf_tables_net_ops); nfnetlink_subsys_unregister(&nf_tables_subsys); diff --git a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch index 2e8cb2016..cfb13231c 100644 --- a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch +++ b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch @@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/net/ipv6.h +++ b/include/net/ipv6.h -@@ -911,6 +911,8 @@ static inline struct sk_buff *ip6_finish +@@ -889,6 +889,8 @@ static inline struct sk_buff *ip6_finish &inet6_sk(sk)->cork); } diff --git a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch index 9c98fa73c..ae30a984d 100644 --- a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch +++ b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch @@ -82,7 +82,7 @@ Signed-off-by: Pablo Neira Ayuso hook->priority = ntohl(nla_get_be32(ha[NFTA_HOOK_PRIORITY])); type = chain_type[afi->family][NFT_CHAIN_T_DEFAULT]; -@@ -4970,7 +4967,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4986,7 +4983,7 @@ static int nf_tables_flowtable_parse_hoo return -EINVAL; hooknum = ntohl(nla_get_be32(tb[NFTA_FLOWTABLE_HOOK_NUM])); diff --git a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch index d0863b836..493ed1d27 100644 --- a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch +++ b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch @@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5394,7 +5394,7 @@ static int nf_tables_getflowtable(struct +@@ -5410,7 +5410,7 @@ static int nf_tables_getflowtable(struct flowtable = nf_tables_flowtable_lookup(table, nla[NFTA_FLOWTABLE_NAME], genmask); diff --git a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch index aeef00330..ddcdb78a6 100644 --- a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch +++ b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch @@ -62,7 +62,7 @@ Signed-off-by: Pablo Neira Ayuso if (ret >= 0) { ctx->table->flags &= ~NFT_TABLE_F_DORMANT; nft_trans_table_enable(trans) = true; -@@ -5772,7 +5765,6 @@ static int nf_tables_commit(struct net * +@@ -5791,7 +5784,6 @@ static int nf_tables_commit(struct net * if (nft_trans_table_update(trans)) { if (!nft_trans_table_enable(trans)) { nf_tables_table_disable(net, @@ -70,7 +70,7 @@ Signed-off-by: Pablo Neira Ayuso trans->ctx.table); trans->ctx.table->flags |= NFT_TABLE_F_DORMANT; } -@@ -5934,7 +5926,6 @@ static int nf_tables_abort(struct net *n +@@ -5955,7 +5947,6 @@ static int nf_tables_abort(struct net *n if (nft_trans_table_update(trans)) { if (nft_trans_table_enable(trans)) { nf_tables_table_disable(net, diff --git a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch index d7c07244f..719c2d994 100644 --- a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch +++ b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5313,8 +5313,10 @@ static int nf_tables_dump_flowtable_done +@@ -5329,8 +5329,10 @@ static int nf_tables_dump_flowtable_done if (!filter) return 0; diff --git a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch index 47ba98c19..0991f0570 100644 --- a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch +++ b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch @@ -467,7 +467,7 @@ Signed-off-by: Pablo Neira Ayuso if (err < 0) return err; -@@ -1509,7 +1504,7 @@ static int nf_tables_updchain(struct nft +@@ -1508,7 +1503,7 @@ static int nf_tables_updchain(struct nft if (!nft_is_base_chain(chain)) return -EBUSY; @@ -476,7 +476,7 @@ Signed-off-by: Pablo Neira Ayuso create); if (err < 0) return err; -@@ -1602,7 +1597,8 @@ static int nf_tables_newchain(struct net +@@ -1618,7 +1613,8 @@ static int nf_tables_newchain(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -486,7 +486,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -1642,7 +1638,7 @@ static int nf_tables_newchain(struct net +@@ -1658,7 +1654,7 @@ static int nf_tables_newchain(struct net } } @@ -495,7 +495,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain != NULL) { if (nlh->nlmsg_flags & NLM_F_EXCL) -@@ -1676,7 +1672,8 @@ static int nf_tables_delchain(struct net +@@ -1692,7 +1688,8 @@ static int nf_tables_delchain(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -505,7 +505,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -1688,7 +1685,7 @@ static int nf_tables_delchain(struct net +@@ -1704,7 +1701,7 @@ static int nf_tables_delchain(struct net chain->use > 0) return -EBUSY; @@ -514,7 +514,7 @@ Signed-off-by: Pablo Neira Ayuso use = chain->use; list_for_each_entry(rule, &chain->rules, list) { -@@ -1853,7 +1850,7 @@ static int nf_tables_expr_parse(const st +@@ -1869,7 +1866,7 @@ static int nf_tables_expr_parse(const st if (err < 0) return err; @@ -523,7 +523,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(type)) return PTR_ERR(type); -@@ -2077,7 +2074,7 @@ static void nf_tables_rule_notify(const +@@ -2093,7 +2090,7 @@ static void nf_tables_rule_notify(const goto err; err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq, @@ -532,7 +532,7 @@ Signed-off-by: Pablo Neira Ayuso ctx->chain, rule); if (err < 0) { kfree_skb(skb); -@@ -2101,7 +2098,6 @@ static int nf_tables_dump_rules(struct s +@@ -2117,7 +2114,6 @@ static int nf_tables_dump_rules(struct s { const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); const struct nft_rule_dump_ctx *ctx = cb->data; @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; const struct nft_chain *chain; const struct nft_rule *rule; -@@ -2112,39 +2108,37 @@ static int nf_tables_dump_rules(struct s +@@ -2128,39 +2124,37 @@ static int nf_tables_dump_rules(struct s rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -605,7 +605,7 @@ Signed-off-by: Pablo Neira Ayuso } } } -@@ -2222,7 +2216,8 @@ static int nf_tables_getrule(struct net +@@ -2238,7 +2232,8 @@ static int nf_tables_getrule(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -615,7 +615,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2306,7 +2301,8 @@ static int nf_tables_newrule(struct net +@@ -2322,7 +2317,8 @@ static int nf_tables_newrule(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -625,7 +625,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2345,7 +2341,7 @@ static int nf_tables_newrule(struct net +@@ -2361,7 +2357,7 @@ static int nf_tables_newrule(struct net return PTR_ERR(old_rule); } @@ -634,7 +634,7 @@ Signed-off-by: Pablo Neira Ayuso n = 0; size = 0; -@@ -2485,7 +2481,8 @@ static int nf_tables_delrule(struct net +@@ -2501,7 +2497,8 @@ static int nf_tables_delrule(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -644,7 +644,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2496,7 +2493,7 @@ static int nf_tables_delrule(struct net +@@ -2512,7 +2509,7 @@ static int nf_tables_delrule(struct net return PTR_ERR(chain); } @@ -653,7 +653,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain) { if (nla[NFTA_RULE_HANDLE]) { -@@ -2694,13 +2691,13 @@ static int nft_ctx_init_from_setattr(str +@@ -2710,13 +2707,13 @@ static int nft_ctx_init_from_setattr(str if (afi == NULL) return -EAFNOSUPPORT; @@ -670,7 +670,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -2828,7 +2825,7 @@ static int nf_tables_fill_set(struct sk_ +@@ -2844,7 +2841,7 @@ static int nf_tables_fill_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -679,7 +679,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff); -@@ -2920,10 +2917,8 @@ static int nf_tables_dump_sets(struct sk +@@ -2936,10 +2933,8 @@ static int nf_tables_dump_sets(struct sk { const struct nft_set *set; unsigned int idx, s_idx = cb->args[0]; @@ -690,7 +690,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_ctx *ctx = cb->data, ctx_set; if (cb->args[1]) -@@ -2932,51 +2927,44 @@ static int nf_tables_dump_sets(struct sk +@@ -2948,51 +2943,44 @@ static int nf_tables_dump_sets(struct sk rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -771,7 +771,7 @@ Signed-off-by: Pablo Neira Ayuso } cb->args[1] = 1; done: -@@ -3186,11 +3174,12 @@ static int nf_tables_newset(struct net * +@@ -3202,11 +3190,12 @@ static int nf_tables_newset(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -786,7 +786,7 @@ Signed-off-by: Pablo Neira Ayuso set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask); if (IS_ERR(set)) { -@@ -3459,12 +3448,12 @@ static int nft_ctx_init_from_elemattr(st +@@ -3475,12 +3464,12 @@ static int nft_ctx_init_from_elemattr(st if (IS_ERR(afi)) return PTR_ERR(afi); @@ -802,7 +802,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -3569,7 +3558,6 @@ static int nf_tables_dump_set(struct sk_ +@@ -3585,7 +3574,6 @@ static int nf_tables_dump_set(struct sk_ { struct nft_set_dump_ctx *dump_ctx = cb->data; struct net *net = sock_net(skb->sk); @@ -810,7 +810,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_set *set; struct nft_set_dump_args args; -@@ -3581,21 +3569,19 @@ static int nf_tables_dump_set(struct sk_ +@@ -3597,21 +3585,19 @@ static int nf_tables_dump_set(struct sk_ int event; rcu_read_lock(); @@ -841,7 +841,7 @@ Signed-off-by: Pablo Neira Ayuso } break; } -@@ -3615,7 +3601,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3631,7 +3617,7 @@ static int nf_tables_dump_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -850,7 +850,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(net->nft.base_seq & 0xffff); -@@ -3717,7 +3703,7 @@ static int nf_tables_fill_setelem_info(s +@@ -3733,7 +3719,7 @@ static int nf_tables_fill_setelem_info(s goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -859,7 +859,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff); -@@ -3961,7 +3947,7 @@ static int nft_add_set_elem(struct nft_c +@@ -3977,7 +3963,7 @@ static int nft_add_set_elem(struct nft_c list_for_each_entry(binding, &set->bindings, list) { struct nft_ctx bind_ctx = { .net = ctx->net, @@ -868,7 +868,7 @@ Signed-off-by: Pablo Neira Ayuso .table = ctx->table, .chain = (struct nft_chain *)binding->chain, }; -@@ -4510,7 +4496,8 @@ static int nf_tables_newobj(struct net * +@@ -4526,7 +4512,8 @@ static int nf_tables_newobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -878,7 +878,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4528,7 +4515,7 @@ static int nf_tables_newobj(struct net * +@@ -4544,7 +4531,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -887,7 +887,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4605,7 +4592,6 @@ struct nft_obj_filter { +@@ -4621,7 +4608,6 @@ struct nft_obj_filter { static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) { const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); @@ -895,7 +895,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; unsigned int idx = 0, s_idx = cb->args[0]; struct nft_obj_filter *filter = cb->data; -@@ -4620,38 +4606,37 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4636,38 +4622,37 @@ static int nf_tables_dump_obj(struct sk_ rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -960,7 +960,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -4738,7 +4723,8 @@ static int nf_tables_getobj(struct net * +@@ -4754,7 +4739,8 @@ static int nf_tables_getobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4798,7 +4784,8 @@ static int nf_tables_delobj(struct net * +@@ -4814,7 +4800,8 @@ static int nf_tables_delobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4809,7 +4796,7 @@ static int nf_tables_delobj(struct net * +@@ -4825,7 +4812,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -989,7 +989,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4847,7 +4834,7 @@ static void nf_tables_obj_notify(const s +@@ -4863,7 +4850,7 @@ static void nf_tables_obj_notify(const s struct nft_object *obj, int event) { nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event, @@ -998,7 +998,7 @@ Signed-off-by: Pablo Neira Ayuso } /* -@@ -5037,7 +5024,7 @@ void nft_flow_table_iterate(struct net * +@@ -5053,7 +5040,7 @@ void nft_flow_table_iterate(struct net * rcu_read_lock(); list_for_each_entry_rcu(afi, &net->nft.af_info, list) { @@ -1007,7 +1007,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_rcu(flowtable, &table->flowtables, list) { iter(&flowtable->data, data); } -@@ -5085,7 +5072,8 @@ static int nf_tables_newflowtable(struct +@@ -5101,7 +5088,8 @@ static int nf_tables_newflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1017,7 +1017,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5102,7 +5090,7 @@ static int nf_tables_newflowtable(struct +@@ -5118,7 +5106,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -1026,7 +1026,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5183,7 +5171,8 @@ static int nf_tables_delflowtable(struct +@@ -5199,7 +5187,8 @@ static int nf_tables_delflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1036,7 +1036,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5194,7 +5183,7 @@ static int nf_tables_delflowtable(struct +@@ -5210,7 +5199,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1045,7 +1045,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5263,40 +5252,37 @@ static int nf_tables_dump_flowtable(stru +@@ -5279,40 +5268,37 @@ static int nf_tables_dump_flowtable(stru struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1107,7 +1107,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -5381,7 +5367,8 @@ static int nf_tables_getflowtable(struct +@@ -5397,7 +5383,8 @@ static int nf_tables_getflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1117,7 +1117,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5424,7 +5411,7 @@ static void nf_tables_flowtable_notify(s +@@ -5440,7 +5427,7 @@ static void nf_tables_flowtable_notify(s err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid, ctx->seq, event, 0, @@ -1126,7 +1126,7 @@ Signed-off-by: Pablo Neira Ayuso if (err < 0) { kfree_skb(skb); goto err; -@@ -5502,17 +5489,14 @@ static int nf_tables_flowtable_event(str +@@ -5518,17 +5505,14 @@ static int nf_tables_flowtable_event(str struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct nft_flowtable *flowtable; struct nft_table *table; @@ -1147,7 +1147,7 @@ Signed-off-by: Pablo Neira Ayuso } } nfnl_unlock(NFNL_SUBSYS_NFTABLES); -@@ -6533,6 +6517,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); +@@ -6554,6 +6538,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); static int __net_init nf_tables_init_net(struct net *net) { INIT_LIST_HEAD(&net->nft.af_info); @@ -1155,7 +1155,7 @@ Signed-off-by: Pablo Neira Ayuso INIT_LIST_HEAD(&net->nft.commit_list); net->nft.base_seq = 1; return 0; -@@ -6569,10 +6554,10 @@ static void __nft_release_afinfo(struct +@@ -6590,10 +6575,10 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, diff --git a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch index 0d973ac02..d71c8e0ab 100644 --- a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch +++ b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch @@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso static struct pernet_operations clusterip_net_ops = { --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -6523,6 +6523,12 @@ static int __net_init nf_tables_init_net +@@ -6544,6 +6544,12 @@ static int __net_init nf_tables_init_net return 0; } @@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6600,6 +6606,7 @@ static void __nft_release_afinfo(struct +@@ -6621,6 +6627,7 @@ static void __nft_release_afinfo(struct static struct pernet_operations nf_tables_net_ops = { .init = nf_tables_init_net, diff --git a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch index 0ea11524f..d1325de2d 100644 --- a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch +++ b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch @@ -364,7 +364,7 @@ Signed-off-by: Pablo Neira Ayuso if (afi->family == family) return afi; } -@@ -5019,15 +5017,12 @@ void nft_flow_table_iterate(struct net * +@@ -5035,15 +5033,12 @@ void nft_flow_table_iterate(struct net * void *data) { struct nft_flowtable *flowtable; @@ -383,7 +383,7 @@ Signed-off-by: Pablo Neira Ayuso } } rcu_read_unlock(); -@@ -6514,21 +6509,6 @@ int nft_data_dump(struct sk_buff *skb, i +@@ -6535,21 +6530,6 @@ int nft_data_dump(struct sk_buff *skb, i } EXPORT_SYMBOL_GPL(nft_data_dump); @@ -405,7 +405,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6549,8 +6529,7 @@ int __nft_release_basechain(struct nft_c +@@ -6570,8 +6550,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -415,7 +415,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6560,10 +6539,11 @@ static void __nft_release_afinfo(struct +@@ -6581,10 +6560,11 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, @@ -428,7 +428,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); list_for_each_entry(flowtable, &table->flowtables, list) -@@ -6604,6 +6584,21 @@ static void __nft_release_afinfo(struct +@@ -6625,6 +6605,21 @@ static void __nft_release_afinfo(struct } } diff --git a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch index 0752d6939..868f3e68e 100644 --- a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch +++ b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -1581,7 +1489,6 @@ static int nf_tables_newchain(struct net +@@ -1597,7 +1505,6 @@ static int nf_tables_newchain(struct net const struct nlattr * uninitialized_var(name); u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -548,7 +548,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_chain *chain; u8 policy = NF_ACCEPT; -@@ -1591,11 +1498,7 @@ static int nf_tables_newchain(struct net +@@ -1607,11 +1514,7 @@ static int nf_tables_newchain(struct net create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false; @@ -561,7 +561,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -1636,7 +1539,7 @@ static int nf_tables_newchain(struct net +@@ -1652,7 +1555,7 @@ static int nf_tables_newchain(struct net } } @@ -570,7 +570,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain != NULL) { if (nlh->nlmsg_flags & NLM_F_EXCL) -@@ -1657,7 +1560,6 @@ static int nf_tables_delchain(struct net +@@ -1673,7 +1576,6 @@ static int nf_tables_delchain(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -578,7 +578,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_chain *chain; struct nft_rule *rule; -@@ -1666,11 +1568,7 @@ static int nf_tables_delchain(struct net +@@ -1682,11 +1584,7 @@ static int nf_tables_delchain(struct net u32 use; int err; @@ -591,7 +591,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -1683,7 +1581,7 @@ static int nf_tables_delchain(struct net +@@ -1699,7 +1597,7 @@ static int nf_tables_delchain(struct net chain->use > 0) return -EBUSY; @@ -600,7 +600,7 @@ Signed-off-by: Pablo Neira Ayuso use = chain->use; list_for_each_entry(rule, &chain->rules, list) { -@@ -2107,7 +2005,7 @@ static int nf_tables_dump_rules(struct s +@@ -2123,7 +2021,7 @@ static int nf_tables_dump_rules(struct s cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -609,7 +609,7 @@ Signed-off-by: Pablo Neira Ayuso continue; if (ctx && ctx->table && strcmp(ctx->table, table->name) != 0) -@@ -2130,7 +2028,7 @@ static int nf_tables_dump_rules(struct s +@@ -2146,7 +2044,7 @@ static int nf_tables_dump_rules(struct s cb->nlh->nlmsg_seq, NFT_MSG_NEWRULE, NLM_F_MULTI | NLM_F_APPEND, @@ -618,7 +618,7 @@ Signed-off-by: Pablo Neira Ayuso table, chain, rule) < 0) goto done; -@@ -2166,7 +2064,6 @@ static int nf_tables_getrule(struct net +@@ -2182,7 +2080,6 @@ static int nf_tables_getrule(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_cur(net); @@ -626,7 +626,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; const struct nft_chain *chain; const struct nft_rule *rule; -@@ -2210,11 +2107,7 @@ static int nf_tables_getrule(struct net +@@ -2226,11 +2123,7 @@ static int nf_tables_getrule(struct net return netlink_dump_start(nlsk, skb, nlh, &c); } @@ -639,7 +639,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2279,7 +2172,7 @@ static int nf_tables_newrule(struct net +@@ -2295,7 +2188,7 @@ static int nf_tables_newrule(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -648,7 +648,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_chain *chain; struct nft_rule *rule, *old_rule = NULL; -@@ -2295,11 +2188,7 @@ static int nf_tables_newrule(struct net +@@ -2311,11 +2204,7 @@ static int nf_tables_newrule(struct net create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false; @@ -661,7 +661,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2339,7 +2228,7 @@ static int nf_tables_newrule(struct net +@@ -2355,7 +2244,7 @@ static int nf_tables_newrule(struct net return PTR_ERR(old_rule); } @@ -670,7 +670,7 @@ Signed-off-by: Pablo Neira Ayuso n = 0; size = 0; -@@ -2468,18 +2357,13 @@ static int nf_tables_delrule(struct net +@@ -2484,18 +2373,13 @@ static int nf_tables_delrule(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -690,7 +690,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2491,7 +2375,7 @@ static int nf_tables_delrule(struct net +@@ -2507,7 +2391,7 @@ static int nf_tables_delrule(struct net return PTR_ERR(chain); } @@ -699,7 +699,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain) { if (nla[NFTA_RULE_HANDLE]) { -@@ -2676,26 +2560,17 @@ static int nft_ctx_init_from_setattr(str +@@ -2692,26 +2576,17 @@ static int nft_ctx_init_from_setattr(str u8 genmask) { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); @@ -729,7 +729,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -2927,7 +2802,7 @@ static int nf_tables_dump_sets(struct sk +@@ -2943,7 +2818,7 @@ static int nf_tables_dump_sets(struct sk list_for_each_entry_rcu(table, &net->nft.tables, list) { if (ctx->family != NFPROTO_UNSPEC && @@ -738,7 +738,7 @@ Signed-off-by: Pablo Neira Ayuso continue; if (ctx->table && ctx->table != table) -@@ -2948,7 +2823,7 @@ static int nf_tables_dump_sets(struct sk +@@ -2964,7 +2839,7 @@ static int nf_tables_dump_sets(struct sk ctx_set = *ctx; ctx_set.table = table; @@ -747,7 +747,7 @@ Signed-off-by: Pablo Neira Ayuso if (nf_tables_fill_set(skb, &ctx_set, set, NFT_MSG_NEWSET, -@@ -3060,8 +2935,8 @@ static int nf_tables_newset(struct net * +@@ -3076,8 +2951,8 @@ static int nf_tables_newset(struct net * { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -757,7 +757,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_set *set; struct nft_ctx ctx; -@@ -3168,16 +3043,12 @@ static int nf_tables_newset(struct net * +@@ -3184,16 +3059,12 @@ static int nf_tables_newset(struct net * create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false; @@ -776,7 +776,7 @@ Signed-off-by: Pablo Neira Ayuso set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask); if (IS_ERR(set)) { -@@ -3439,19 +3310,15 @@ static int nft_ctx_init_from_elemattr(st +@@ -3455,19 +3326,15 @@ static int nft_ctx_init_from_elemattr(st u8 genmask) { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); @@ -799,7 +799,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -3569,7 +3436,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3585,7 +3452,7 @@ static int nf_tables_dump_set(struct sk_ rcu_read_lock(); list_for_each_entry_rcu(table, &net->nft.tables, list) { if (dump_ctx->ctx.family != NFPROTO_UNSPEC && @@ -808,7 +808,7 @@ Signed-off-by: Pablo Neira Ayuso continue; if (table != dump_ctx->ctx.table) -@@ -3599,7 +3466,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3615,7 +3482,7 @@ static int nf_tables_dump_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -817,7 +817,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(net->nft.base_seq & 0xffff); -@@ -4478,7 +4345,6 @@ static int nf_tables_newobj(struct net * +@@ -4494,7 +4361,6 @@ static int nf_tables_newobj(struct net * const struct nft_object_type *type; u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -825,7 +825,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4490,11 +4356,7 @@ static int nf_tables_newobj(struct net * +@@ -4506,11 +4372,7 @@ static int nf_tables_newobj(struct net * !nla[NFTA_OBJ_DATA]) return -EINVAL; @@ -838,7 +838,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4513,7 +4375,7 @@ static int nf_tables_newobj(struct net * +@@ -4529,7 +4391,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -847,7 +847,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4605,7 +4467,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4621,7 +4483,7 @@ static int nf_tables_dump_obj(struct sk_ cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -856,7 +856,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(obj, &table->objects, list) { -@@ -4628,7 +4490,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4644,7 +4506,7 @@ static int nf_tables_dump_obj(struct sk_ cb->nlh->nlmsg_seq, NFT_MSG_NEWOBJ, NLM_F_MULTI | NLM_F_APPEND, @@ -865,7 +865,7 @@ Signed-off-by: Pablo Neira Ayuso obj, reset) < 0) goto done; -@@ -4686,7 +4548,6 @@ static int nf_tables_getobj(struct net * +@@ -4702,7 +4564,6 @@ static int nf_tables_getobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; @@ -873,7 +873,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct nft_object *obj; struct sk_buff *skb2; -@@ -4717,11 +4578,7 @@ static int nf_tables_getobj(struct net * +@@ -4733,11 +4594,7 @@ static int nf_tables_getobj(struct net * !nla[NFTA_OBJ_TYPE]) return -EINVAL; @@ -886,7 +886,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4768,7 +4625,6 @@ static int nf_tables_delobj(struct net * +@@ -4784,7 +4641,6 @@ static int nf_tables_delobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -894,7 +894,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4778,11 +4634,7 @@ static int nf_tables_delobj(struct net * +@@ -4794,11 +4650,7 @@ static int nf_tables_delobj(struct net * !nla[NFTA_OBJ_NAME]) return -EINVAL; @@ -907,7 +907,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4794,7 +4646,7 @@ static int nf_tables_delobj(struct net * +@@ -4810,7 +4662,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -916,7 +916,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4979,33 +4831,31 @@ err1: +@@ -4995,33 +4847,31 @@ err1: return err; } @@ -956,7 +956,7 @@ Signed-off-by: Pablo Neira Ayuso return ERR_PTR(-EAGAIN); } #endif -@@ -5053,7 +4903,6 @@ static int nf_tables_newflowtable(struct +@@ -5069,7 +4919,6 @@ static int nf_tables_newflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -964,7 +964,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_ctx ctx; int err, i, k; -@@ -5063,12 +4912,8 @@ static int nf_tables_newflowtable(struct +@@ -5079,12 +4928,8 @@ static int nf_tables_newflowtable(struct !nla[NFTA_FLOWTABLE_HOOK]) return -EINVAL; @@ -978,7 +978,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5085,7 +4930,7 @@ static int nf_tables_newflowtable(struct +@@ -5101,7 +4946,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -987,7 +987,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5098,7 +4943,7 @@ static int nf_tables_newflowtable(struct +@@ -5114,7 +4959,7 @@ static int nf_tables_newflowtable(struct goto err1; } @@ -996,7 +996,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(type)) { err = PTR_ERR(type); goto err2; -@@ -5158,16 +5003,11 @@ static int nf_tables_delflowtable(struct +@@ -5174,16 +5019,11 @@ static int nf_tables_delflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1014,7 +1014,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5178,7 +5018,7 @@ static int nf_tables_delflowtable(struct +@@ -5194,7 +5034,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1023,7 +1023,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5253,7 +5093,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5269,7 +5109,7 @@ static int nf_tables_dump_flowtable(stru cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -1032,7 +1032,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(flowtable, &table->flowtables, list) { -@@ -5272,7 +5112,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5288,7 +5128,7 @@ static int nf_tables_dump_flowtable(stru cb->nlh->nlmsg_seq, NFT_MSG_NEWFLOWTABLE, NLM_F_MULTI | NLM_F_APPEND, @@ -1041,7 +1041,7 @@ Signed-off-by: Pablo Neira Ayuso goto done; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); -@@ -5332,7 +5172,6 @@ static int nf_tables_getflowtable(struct +@@ -5348,7 +5188,6 @@ static int nf_tables_getflowtable(struct u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1049,7 +1049,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct sk_buff *skb2; int err; -@@ -5358,12 +5197,8 @@ static int nf_tables_getflowtable(struct +@@ -5374,12 +5213,8 @@ static int nf_tables_getflowtable(struct if (!nla[NFTA_FLOWTABLE_NAME]) return -EINVAL; @@ -1063,7 +1063,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -6529,7 +6364,7 @@ int __nft_release_basechain(struct nft_c +@@ -6550,7 +6385,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -1072,7 +1072,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6542,7 +6377,7 @@ static void __nft_release_afinfo(struct +@@ -6563,7 +6398,7 @@ static void __nft_release_afinfo(struct }; list_for_each_entry_safe(table, nt, &net->nft.tables, list) { @@ -1081,7 +1081,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); -@@ -6594,7 +6429,7 @@ static int __net_init nf_tables_init_net +@@ -6615,7 +6450,7 @@ static int __net_init nf_tables_init_net static void __net_exit nf_tables_exit_net(struct net *net) { diff --git a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch index d6736d652..037759bdb 100644 --- a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch +++ b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4869,13 +4869,13 @@ void nft_flow_table_iterate(struct net * +@@ -4885,13 +4885,13 @@ void nft_flow_table_iterate(struct net * struct nft_flowtable *flowtable; const struct nft_table *table; diff --git a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch index d0c6e46c9..232f4b67a 100644 --- a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch +++ b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch @@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso }; --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5254,17 +5254,12 @@ err: +@@ -5270,17 +5270,12 @@ err: nfnetlink_set_err(ctx->net, ctx->portid, NFNLGRP_NFTABLES, -ENOBUFS); } diff --git a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch index 89e12a5f4..f4d5237de 100644 --- a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch +++ b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch @@ -244,7 +244,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -1565,6 +1607,7 @@ static int nf_tables_delchain(struct net +@@ -1581,6 +1623,7 @@ static int nf_tables_delchain(struct net struct nft_rule *rule; int family = nfmsg->nfgen_family; struct nft_ctx ctx; @@ -252,7 +252,7 @@ Signed-off-by: Pablo Neira Ayuso u32 use; int err; -@@ -1573,7 +1616,12 @@ static int nf_tables_delchain(struct net +@@ -1589,7 +1632,12 @@ static int nf_tables_delchain(struct net if (IS_ERR(table)) return PTR_ERR(table); @@ -266,7 +266,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(chain)) return PTR_ERR(chain); -@@ -2547,6 +2595,7 @@ static const struct nla_policy nft_set_p +@@ -2563,6 +2611,7 @@ static const struct nla_policy nft_set_p [NFTA_SET_USERDATA] = { .type = NLA_BINARY, .len = NFT_USERDATA_MAXLEN }, [NFTA_SET_OBJ_TYPE] = { .type = NLA_U32 }, @@ -274,7 +274,7 @@ Signed-off-by: Pablo Neira Ayuso }; static const struct nla_policy nft_set_desc_policy[NFTA_SET_DESC_MAX + 1] = { -@@ -2590,6 +2639,22 @@ static struct nft_set *nf_tables_set_loo +@@ -2606,6 +2655,22 @@ static struct nft_set *nf_tables_set_loo return ERR_PTR(-ENOENT); } @@ -297,7 +297,7 @@ Signed-off-by: Pablo Neira Ayuso static struct nft_set *nf_tables_set_lookup_byid(const struct net *net, const struct nlattr *nla, u8 genmask) -@@ -2706,6 +2771,9 @@ static int nf_tables_fill_set(struct sk_ +@@ -2722,6 +2787,9 @@ static int nf_tables_fill_set(struct sk_ goto nla_put_failure; if (nla_put_string(skb, NFTA_SET_NAME, set->name)) goto nla_put_failure; @@ -307,7 +307,7 @@ Signed-off-by: Pablo Neira Ayuso if (set->flags != 0) if (nla_put_be32(skb, NFTA_SET_FLAGS, htonl(set->flags))) goto nla_put_failure; -@@ -3114,6 +3182,7 @@ static int nf_tables_newset(struct net * +@@ -3130,6 +3198,7 @@ static int nf_tables_newset(struct net * set->udata = udata; set->timeout = timeout; set->gc_int = gc_int; @@ -315,7 +315,7 @@ Signed-off-by: Pablo Neira Ayuso err = ops->init(set, &desc, nla); if (err < 0) -@@ -3173,7 +3242,10 @@ static int nf_tables_delset(struct net * +@@ -3189,7 +3258,10 @@ static int nf_tables_delset(struct net * if (err < 0) return err; @@ -327,7 +327,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(set)) return PTR_ERR(set); -@@ -4233,6 +4305,21 @@ struct nft_object *nf_tables_obj_lookup( +@@ -4249,6 +4321,21 @@ struct nft_object *nf_tables_obj_lookup( } EXPORT_SYMBOL_GPL(nf_tables_obj_lookup); @@ -349,7 +349,7 @@ Signed-off-by: Pablo Neira Ayuso static const struct nla_policy nft_obj_policy[NFTA_OBJ_MAX + 1] = { [NFTA_OBJ_TABLE] = { .type = NLA_STRING, .len = NFT_TABLE_MAXNAMELEN - 1 }, -@@ -4240,6 +4327,7 @@ static const struct nla_policy nft_obj_p +@@ -4256,6 +4343,7 @@ static const struct nla_policy nft_obj_p .len = NFT_OBJ_MAXNAMELEN - 1 }, [NFTA_OBJ_TYPE] = { .type = NLA_U32 }, [NFTA_OBJ_DATA] = { .type = NLA_NESTED }, @@ -357,7 +357,7 @@ Signed-off-by: Pablo Neira Ayuso }; static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, -@@ -4387,6 +4475,8 @@ static int nf_tables_newobj(struct net * +@@ -4403,6 +4491,8 @@ static int nf_tables_newobj(struct net * goto err1; } obj->table = table; @@ -366,7 +366,7 @@ Signed-off-by: Pablo Neira Ayuso obj->name = nla_strdup(nla[NFTA_OBJ_NAME], GFP_KERNEL); if (!obj->name) { err = -ENOMEM; -@@ -4433,7 +4523,9 @@ static int nf_tables_fill_obj_info(struc +@@ -4449,7 +4539,9 @@ static int nf_tables_fill_obj_info(struc nla_put_string(skb, NFTA_OBJ_NAME, obj->name) || nla_put_be32(skb, NFTA_OBJ_TYPE, htonl(obj->ops->type->type)) || nla_put_be32(skb, NFTA_OBJ_USE, htonl(obj->use)) || @@ -377,7 +377,7 @@ Signed-off-by: Pablo Neira Ayuso goto nla_put_failure; nlmsg_end(skb, nlh); -@@ -4631,7 +4723,7 @@ static int nf_tables_delobj(struct net * +@@ -4647,7 +4739,7 @@ static int nf_tables_delobj(struct net * u32 objtype; if (!nla[NFTA_OBJ_TYPE] || @@ -386,7 +386,7 @@ Signed-off-by: Pablo Neira Ayuso return -EINVAL; table = nf_tables_table_lookup(net, nla[NFTA_OBJ_TABLE], family, -@@ -4640,7 +4732,12 @@ static int nf_tables_delobj(struct net * +@@ -4656,7 +4748,12 @@ static int nf_tables_delobj(struct net * return PTR_ERR(table); objtype = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); @@ -400,7 +400,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(obj)) return PTR_ERR(obj); if (obj->use > 0) -@@ -4712,6 +4809,7 @@ static const struct nla_policy nft_flowt +@@ -4728,6 +4825,7 @@ static const struct nla_policy nft_flowt [NFTA_FLOWTABLE_NAME] = { .type = NLA_STRING, .len = NFT_NAME_MAXLEN - 1 }, [NFTA_FLOWTABLE_HOOK] = { .type = NLA_NESTED }, @@ -408,7 +408,7 @@ Signed-off-by: Pablo Neira Ayuso }; struct nft_flowtable *nf_tables_flowtable_lookup(const struct nft_table *table, -@@ -4729,6 +4827,20 @@ struct nft_flowtable *nf_tables_flowtabl +@@ -4745,6 +4843,20 @@ struct nft_flowtable *nf_tables_flowtabl } EXPORT_SYMBOL_GPL(nf_tables_flowtable_lookup); @@ -429,7 +429,7 @@ Signed-off-by: Pablo Neira Ayuso #define NFT_FLOWTABLE_DEVICE_MAX 8 static int nf_tables_parse_devices(const struct nft_ctx *ctx, -@@ -4937,6 +5049,8 @@ static int nf_tables_newflowtable(struct +@@ -4953,6 +5065,8 @@ static int nf_tables_newflowtable(struct return -ENOMEM; flowtable->table = table; @@ -438,7 +438,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable->name = nla_strdup(nla[NFTA_FLOWTABLE_NAME], GFP_KERNEL); if (!flowtable->name) { err = -ENOMEM; -@@ -5011,8 +5125,14 @@ static int nf_tables_delflowtable(struct +@@ -5027,8 +5141,14 @@ static int nf_tables_delflowtable(struct if (IS_ERR(table)) return PTR_ERR(table); @@ -455,7 +455,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(flowtable)) return PTR_ERR(flowtable); if (flowtable->use > 0) -@@ -5045,7 +5165,9 @@ static int nf_tables_fill_flowtable_info +@@ -5061,7 +5181,9 @@ static int nf_tables_fill_flowtable_info if (nla_put_string(skb, NFTA_FLOWTABLE_TABLE, flowtable->table->name) || nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || diff --git a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch index f90f41523..f12366f54 100644 --- a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch +++ b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/net/ipv6.h +++ b/include/net/ipv6.h -@@ -911,8 +911,6 @@ static inline struct sk_buff *ip6_finish +@@ -889,8 +889,6 @@ static inline struct sk_buff *ip6_finish &inet6_sk(sk)->cork); } diff --git a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch index 77e4db3ed..601df0cf9 100644 --- a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch +++ b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch @@ -236,7 +236,7 @@ Signed-off-by: Felix Fietkau .owner = THIS_MODULE, --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5064,40 +5064,38 @@ static int nf_tables_newflowtable(struct +@@ -5080,40 +5080,38 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -285,7 +285,7 @@ Signed-off-by: Felix Fietkau err3: module_put(type->owner); err2: -@@ -5378,10 +5376,8 @@ err: +@@ -5394,10 +5392,8 @@ err: static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable) { diff --git a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch index e38f22635..f173b1c4f 100644 --- a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch +++ b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4930,7 +4930,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4946,7 +4946,7 @@ static int nf_tables_flowtable_parse_hoo flowtable->ops[i].pf = NFPROTO_NETDEV; flowtable->ops[i].hooknum = hooknum; flowtable->ops[i].priority = priority; diff --git a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch index 2fcd66330..784368520 100644 --- a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch +++ b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau WARN_ON(!nf_flow_offload_gc_step(flow_table)); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4974,23 +4974,6 @@ static const struct nf_flowtable_type *n +@@ -4990,23 +4990,6 @@ static const struct nf_flowtable_type *n return ERR_PTR(-ENOENT); } diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 127707827..0e8e0660d 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -302,7 +302,7 @@ Signed-off-by: David S. Miller if (alx->flags & ALX_FLAG_USING_MSIX) { --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c -@@ -1885,7 +1885,7 @@ static int atl1c_clean(struct napi_struc +@@ -1886,7 +1886,7 @@ static int atl1c_clean(struct napi_struc if (work_done < budget) { quit_polling: @@ -1040,7 +1040,7 @@ Signed-off-by: David S. Miller writel(irq->mask, adpt->base + EMAC_INT_MASK); --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c -@@ -7577,7 +7577,7 @@ static int rtl8169_poll(struct napi_stru +@@ -7578,7 +7578,7 @@ static int rtl8169_poll(struct napi_stru } if (work_done < budget) { diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index 8e920d1c5..fcc1580de 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1228,7 +1228,6 @@ all: modules +@@ -1232,7 +1232,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1257,7 +1256,6 @@ _modinst_: +@@ -1261,7 +1260,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index cdca0bdb5..79fdb6e80 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -782,11 +787,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH +@@ -786,11 +791,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) endif diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index 86ff0fe12..3caeeaa19 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2491,6 +2491,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2496,6 +2496,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2621,16 +2625,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2626,16 +2630,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 65789d1b8..46c12e0c1 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -381,7 +381,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c -@@ -557,6 +557,9 @@ static __net_initdata struct pernet_oper +@@ -558,6 +558,9 @@ static __net_initdata struct pernet_oper int __init ip_misc_proc_init(void) { diff --git a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch index c50013830..c718f8ee6 100644 --- a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch @@ -223,7 +223,7 @@ MODULE_LICENSE("GPL"); --- a/drivers/net/phy/ar8327.c +++ b/drivers/net/phy/ar8327.c -@@ -627,11 +627,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) +@@ -619,11 +619,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) if (!priv->chip_data) return -ENOMEM; diff --git a/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch b/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch new file mode 100644 index 000000000..cd9a758e3 --- /dev/null +++ b/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch @@ -0,0 +1,96 @@ +From a99708737f566c70651015332e89d0d3b1eb5529 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 17 Sep 2018 10:13:09 +0200 +Subject: [PATCH] Revert "ubifs: xattr: Don't operate on deleted inodes" + +This reverts commit 8a23348d76a1e7716da6e76383281ac82fc071cf. + +UBIFS wants to assert that xattr operations are only issued on files +with positive link count. The said patch made this operations return +-ENOENT for unlinked files such that the asserts will no longer trigger. +This was wrong since xattr operations are perfectly fine on unlinked +files. +Instead the assertions need to be fixed/removed. + +Fixes: 11a6fc3dc743 ("ubifs: xattr: Don't operate on deleted inodes") +Reported-by: Koen Vandeputte +Signed-off-by: Richard Weinberger +--- + fs/ubifs/xattr.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +--- a/fs/ubifs/xattr.c ++++ b/fs/ubifs/xattr.c +@@ -152,12 +152,6 @@ static int create_xattr(struct ubifs_inf + ui->data_len = size; + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_cnt += 1; + host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); +@@ -189,7 +183,6 @@ out_cancel: + host_ui->xattr_size -= CALC_XATTR_BYTES(size); + host_ui->xattr_names -= fname_len(nm); + host_ui->flags &= ~UBIFS_CRYPT_FL; +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + out_free: + make_bad_inode(inode); +@@ -241,12 +234,6 @@ static int change_xattr(struct ubifs_inf + mutex_unlock(&ui->ui_mutex); + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); + host_ui->xattr_size += CALC_XATTR_BYTES(size); +@@ -268,7 +255,6 @@ static int change_xattr(struct ubifs_inf + out_cancel: + host_ui->xattr_size -= CALC_XATTR_BYTES(size); + host_ui->xattr_size += CALC_XATTR_BYTES(old_size); +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + make_bad_inode(inode); + out_free: +@@ -497,12 +483,6 @@ static int remove_xattr(struct ubifs_inf + return err; + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_cnt -= 1; + host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); +@@ -522,7 +502,6 @@ out_cancel: + host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); + host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); + host_ui->xattr_names += fname_len(nm); +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + ubifs_release_budget(c, &req); + make_bad_inode(inode); +@@ -562,9 +541,6 @@ static int ubifs_xattr_remove(struct ino + + ubifs_assert(inode_is_locked(host)); + +- if (!host->i_nlink) +- return -ENOENT; +- + if (fname_len(&nm) > UBIFS_MAX_NLEN) + return -ENAMETOOLONG; + diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch index b40f01d41..3c3353c7d 100644 --- a/target/linux/generic/pending-4.14/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -646,12 +646,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -650,12 +650,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.14/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch index bee62b266..1cfd3d7d7 100644 --- a/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch +++ b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch @@ -47,7 +47,7 @@ v2: incorporated changes suggested by Jonas Gorski select OF --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -319,7 +319,7 @@ OBJCOPYFLAGS += --remove-section=.regin +@@ -315,7 +315,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.14/308-mips32r2_tune.patch b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch index 7f98616d7..39167bf4a 100644 --- a/target/linux/generic/pending-4.14/308-mips32r2_tune.patch +++ b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch @@ -11,12 +11,12 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Makefile +++ b/arch/mips/Makefile -@@ -162,7 +162,7 @@ cflags-$(CONFIG_CPU_R4X00) += -march=r46 +@@ -161,7 +161,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) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ - -Wa,-mips32 -Wa,--trap --cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ -+cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2 -mtune=34kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ - -Wa,-mips32r2 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap +-cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,--trap ++cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -mtune=34kc -Wa,--trap cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg - cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ + cflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,--trap diff --git a/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch b/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch new file mode 100644 index 000000000..b9c6bd012 --- /dev/null +++ b/target/linux/generic/pending-4.14/495-mtd-core-add-get_mtd_device_by_node.patch @@ -0,0 +1,75 @@ +From 1bd1b740f208d1cf4071932cc51860d37266c402 Mon Sep 17 00:00:00 2001 +From: Bernhard Frauendienst +Date: Sat, 1 Sep 2018 00:30:11 +0200 +Subject: [PATCH 495/497] mtd: core: add get_mtd_device_by_node + +Add function to retrieve a mtd device by its OF node. Since drivers can +assign arbitrary names to mtd devices in the absence of a label +property, there is no other reliable way to retrieve a mtd device for a +given OF node. + +Signed-off-by: Bernhard Frauendienst +Reviewed-by: Miquel Raynal +--- + drivers/mtd/mtdcore.c | 38 ++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/mtd.h | 2 ++ + 2 files changed, 40 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -922,6 +922,44 @@ out_unlock: + } + EXPORT_SYMBOL_GPL(get_mtd_device_nm); + ++/** ++ * get_mtd_device_by_node - obtain a validated handle for an MTD device ++ * by of_node ++ * @of_node: OF node of MTD device to open ++ * ++ * This function returns MTD device description structure in case of ++ * success and an error code in case of failure. ++ */ ++struct mtd_info *get_mtd_device_by_node(const struct device_node *of_node) ++{ ++ int err = -ENODEV; ++ struct mtd_info *mtd = NULL, *other; ++ ++ mutex_lock(&mtd_table_mutex); ++ ++ mtd_for_each_device(other) { ++ if (of_node == other->dev.of_node) { ++ mtd = other; ++ break; ++ } ++ } ++ ++ if (!mtd) ++ goto out_unlock; ++ ++ err = __get_mtd_device(mtd); ++ if (err) ++ goto out_unlock; ++ ++ mutex_unlock(&mtd_table_mutex); ++ return mtd; ++ ++out_unlock: ++ mutex_unlock(&mtd_table_mutex); ++ return ERR_PTR(err); ++} ++EXPORT_SYMBOL_GPL(get_mtd_device_by_node); ++ + void put_mtd_device(struct mtd_info *mtd) + { + mutex_lock(&mtd_table_mutex); +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -579,6 +579,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); ++extern struct mtd_info *get_mtd_device_by_node( ++ const struct device_node *of_node); + extern void put_mtd_device(struct mtd_info *mtd); + + diff --git a/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch b/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch new file mode 100644 index 000000000..01f3b9ec2 --- /dev/null +++ b/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch @@ -0,0 +1,52 @@ +From 5734c6669fba7ddb5ef491ccff7159d15dba0b59 Mon Sep 17 00:00:00 2001 +From: Bernhard Frauendienst +Date: Wed, 5 Sep 2018 01:32:51 +0200 +Subject: [PATCH 496/497] dt-bindings: add bindings for mtd-concat devices + +Document virtual mtd-concat device bindings. + +Signed-off-by: Bernhard Frauendienst +--- + .../devicetree/bindings/mtd/mtd-concat.txt | 36 +++++++++++++++++++ + 1 file changed, 36 insertions(+) + create mode 100644 Documentation/devicetree/bindings/mtd/mtd-concat.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/mtd/mtd-concat.txt +@@ -0,0 +1,36 @@ ++Virtual MTD concat device ++ ++Requires properties: ++- devices: list of phandles to mtd nodes that should be concatenated ++ ++Example: ++ ++&spi { ++ flash0: flash@0 { ++ ... ++ }; ++ flash1: flash@1 { ++ ... ++ }; ++}; ++ ++flash { ++ compatible = "mtd-concat"; ++ ++ devices = <&flash0 &flash1>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x0000000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "firmware"; ++ reg = <0x0040000 0x1fc0000>; ++ }; ++ } ++} diff --git a/target/linux/generic/pending-4.14/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch b/target/linux/generic/pending-4.14/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch new file mode 100644 index 000000000..94acc883f --- /dev/null +++ b/target/linux/generic/pending-4.14/497-mtd-mtdconcat-add-dt-driver-for-concat-devices.patch @@ -0,0 +1,216 @@ +From e53f712d8eac71f54399b61038ccf87d2cee99d7 Mon Sep 17 00:00:00 2001 +From: Bernhard Frauendienst +Date: Sat, 25 Aug 2018 12:35:22 +0200 +Subject: [PATCH 497/497] mtd: mtdconcat: add dt driver for concat devices + +Some mtd drivers like physmap variants have support for concatenating +multiple mtd devices, but there is no generic way to define such a +concat device from within the device tree. + +This is useful for some SoC boards that use multiple flash chips as +memory banks of a single mtd device, with partitions spanning chip +borders. + +This commit adds a driver for creating virtual mtd-concat devices. They +must have a compatible = "mtd-concat" line, and define a list of devices +to concat in the 'devices' property, for example: + +flash { + compatible = "mtd-concat"; + + devices = <&flash0 &flash1>; + + partitions { + ... + }; +}; + +The driver is added to the very end of the mtd Makefile to increase the +likelyhood of all child devices already being loaded at the time of +probing, preventing unnecessary deferred probes. + +Signed-off-by: Bernhard Frauendienst +--- + drivers/mtd/Kconfig | 2 + + drivers/mtd/Makefile | 3 + + drivers/mtd/composite/Kconfig | 12 +++ + drivers/mtd/composite/Makefile | 6 ++ + drivers/mtd/composite/virt_concat.c | 128 ++++++++++++++++++++++++++++ + 5 files changed, 151 insertions(+) + create mode 100644 drivers/mtd/composite/Kconfig + create mode 100644 drivers/mtd/composite/Makefile + create mode 100644 drivers/mtd/composite/virt_concat.c + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -377,4 +377,6 @@ source "drivers/mtd/spi-nor/Kconfig" + + source "drivers/mtd/ubi/Kconfig" + ++source "drivers/mtd/composite/Kconfig" ++ + endif # MTD +--- a/drivers/mtd/Makefile ++++ b/drivers/mtd/Makefile +@@ -39,3 +39,6 @@ obj-y += chips/ lpddr/ maps/ devices/ n + + obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/ + obj-$(CONFIG_MTD_UBI) += ubi/ ++ ++# Composite drivers must be loaded last ++obj-y += composite/ +--- /dev/null ++++ b/drivers/mtd/composite/Kconfig +@@ -0,0 +1,12 @@ ++menu "Composite MTD device drivers" ++ depends on MTD!=n ++ ++config MTD_VIRT_CONCAT ++ tristate "Virtual concat MTD device" ++ help ++ This driver allows creation of a virtual MTD concat device, which ++ concatenates multiple underlying MTD devices to a single device. ++ This is required by some SoC boards where multiple memory banks are ++ used as one device with partitions spanning across device boundaries. ++ ++endmenu +--- /dev/null ++++ b/drivers/mtd/composite/Makefile +@@ -0,0 +1,6 @@ ++# SPDX-License-Identifier: GPL-2.0 ++# ++# linux/drivers/mtd/composite/Makefile ++# ++ ++obj-$(CONFIG_MTD_VIRT_CONCAT) += virt_concat.o +--- /dev/null ++++ b/drivers/mtd/composite/virt_concat.c +@@ -0,0 +1,128 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Virtual concat MTD device driver ++ * ++ * Copyright (C) 2018 Bernhard Frauendienst ++ * Author: Bernhard Frauendienst, kernel@nospam.obeliks.de ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * struct of_virt_concat - platform device driver data. ++ * @cmtd the final mtd_concat device ++ * @num_devices the number of devices in @devices ++ * @devices points to an array of devices already loaded ++ */ ++struct of_virt_concat { ++ struct mtd_info *cmtd; ++ int num_devices; ++ struct mtd_info **devices; ++}; ++ ++static int virt_concat_remove(struct platform_device *pdev) ++{ ++ struct of_virt_concat *info; ++ int i; ++ ++ info = platform_get_drvdata(pdev); ++ if (!info) ++ return 0; ++ ++ // unset data for when this is called after a probe error ++ platform_set_drvdata(pdev, NULL); ++ ++ if (info->cmtd) { ++ mtd_device_unregister(info->cmtd); ++ mtd_concat_destroy(info->cmtd); ++ } ++ ++ if (info->devices) { ++ for (i = 0; i < info->num_devices; i++) ++ put_mtd_device(info->devices[i]); ++ } ++ ++ return 0; ++} ++ ++static int virt_concat_probe(struct platform_device *pdev) ++{ ++ struct device_node *node = pdev->dev.of_node; ++ struct of_phandle_iterator it; ++ struct of_virt_concat *info; ++ struct mtd_info *mtd; ++ int err = 0, count; ++ ++ count = of_count_phandle_with_args(node, "devices", NULL); ++ if (count <= 0) ++ return -EINVAL; ++ ++ info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); ++ if (!info) ++ return -ENOMEM; ++ info->devices = devm_kcalloc(&pdev->dev, count, ++ sizeof(*(info->devices)), GFP_KERNEL); ++ if (!info->devices) { ++ err = -ENOMEM; ++ goto err_remove; ++ } ++ ++ platform_set_drvdata(pdev, info); ++ ++ of_for_each_phandle(&it, err, node, "devices", NULL, 0) { ++ mtd = get_mtd_device_by_node(it.node); ++ if (IS_ERR(mtd)) { ++ of_node_put(it.node); ++ err = -EPROBE_DEFER; ++ goto err_remove; ++ } ++ ++ info->devices[info->num_devices++] = mtd; ++ } ++ ++ info->cmtd = mtd_concat_create(info->devices, info->num_devices, ++ dev_name(&pdev->dev)); ++ if (!info->cmtd) { ++ err = -ENXIO; ++ goto err_remove; ++ } ++ ++ info->cmtd->dev.parent = &pdev->dev; ++ mtd_set_of_node(info->cmtd, node); ++ mtd_device_register(info->cmtd, NULL, 0); ++ ++ return 0; ++ ++err_remove: ++ virt_concat_remove(pdev); ++ ++ return err; ++} ++ ++static const struct of_device_id virt_concat_of_match[] = { ++ { .compatible = "mtd-concat", }, ++ { /* sentinel */ } ++}; ++MODULE_DEVICE_TABLE(of, virt_concat_of_match); ++ ++static struct platform_driver virt_concat_driver = { ++ .probe = virt_concat_probe, ++ .remove = virt_concat_remove, ++ .driver = { ++ .name = "virt-mtdconcat", ++ .of_match_table = virt_concat_of_match, ++ }, ++}; ++ ++module_platform_driver(virt_concat_driver); ++ ++MODULE_LICENSE("GPL v2"); ++MODULE_AUTHOR("Bernhard Frauendienst "); ++MODULE_DESCRIPTION("Virtual concat MTD device driver"); diff --git a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index bf902875d..e6d339283 100644 --- a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4917,6 +4917,14 @@ static int nf_tables_flowtable_parse_hoo +@@ -4933,6 +4933,14 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) goto err1; @@ -521,7 +521,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kzalloc(sizeof(struct nf_hook_ops) * n, GFP_KERNEL); if (!ops) { err = -ENOMEM; -@@ -5047,10 +5055,19 @@ static int nf_tables_newflowtable(struct +@@ -5063,10 +5071,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -541,7 +541,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -5148,7 +5165,8 @@ static int nf_tables_fill_flowtable_info +@@ -5164,7 +5181,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.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch index 88069581a..71c3fc790 100644 --- a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2455,7 +2455,7 @@ static inline int pskb_network_may_pull( +@@ -2460,7 +2460,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.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 9de77dfcc..36c0fb57a 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -777,6 +777,7 @@ struct sk_buff { +@@ -782,6 +782,7 @@ struct sk_buff { __u8 tc_redirected:1; __u8 tc_from_ingress:1; #endif diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index c510e42bb..8a6495b22 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -18,7 +18,7 @@ uart->capabilities = up->capabilities; --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -2233,6 +2233,7 @@ uart_report_port(struct uart_driver *drv +@@ -2240,6 +2240,7 @@ uart_report_port(struct uart_driver *drv snprintf(address, sizeof(address), "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); break; @@ -26,7 +26,7 @@ case UPIO_MEM: case UPIO_MEM16: case UPIO_MEM32: -@@ -2897,6 +2898,7 @@ int uart_match_port(struct uart_port *po +@@ -2904,6 +2905,7 @@ int uart_match_port(struct uart_port *po case UPIO_HUB6: return (port1->iobase == port2->iobase) && (port1->hub6 == port2->hub6); diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 2598cdedb..a143ad566 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -26382,7 +26382,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -280,6 +291,36 @@ struct device *caam_jr_alloc(void) +@@ -281,6 +292,36 @@ struct device *caam_jr_alloc(void) EXPORT_SYMBOL(caam_jr_alloc); /** @@ -26419,7 +26419,7 @@ Signed-off-by: Yangbo Lu * caam_jr_free() - Free the Job Ring * @rdev - points to the dev that identifies the Job ring to * be released. -@@ -496,15 +537,28 @@ static int caam_jr_probe(struct platform +@@ -497,15 +538,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -26455,7 +26455,7 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -524,10 +578,12 @@ static int caam_jr_probe(struct platform +@@ -525,10 +579,12 @@ static int caam_jr_probe(struct platform atomic_set(&jrpriv->tfm_count, 0); diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 050092905..816abbb9e 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -987,7 +987,7 @@ Signed-off-by: Yangbo Lu } --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c -@@ -440,6 +440,7 @@ struct dmar_rmrr_unit { +@@ -441,6 +441,7 @@ struct dmar_rmrr_unit { u64 end_address; /* reserved end address */ struct dmar_dev_scope *devices; /* target devices */ int devices_cnt; /* target device count */ @@ -995,7 +995,7 @@ Signed-off-by: Yangbo Lu }; struct dmar_atsr_unit { -@@ -4251,27 +4252,40 @@ static inline void init_iommu_pm_ops(voi +@@ -4267,27 +4268,40 @@ static inline void init_iommu_pm_ops(voi int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) { struct acpi_dmar_reserved_memory *rmrr; @@ -1041,7 +1041,7 @@ Signed-off-by: Yangbo Lu } static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) -@@ -4485,6 +4499,7 @@ static void intel_iommu_free_dmars(void) +@@ -4501,6 +4515,7 @@ static void intel_iommu_free_dmars(void) list_for_each_entry_safe(rmrru, rmrr_n, &dmar_rmrr_units, list) { list_del(&rmrru->list); dmar_free_dev_scope(&rmrru->devices, &rmrru->devices_cnt); @@ -1049,7 +1049,7 @@ Signed-off-by: Yangbo Lu kfree(rmrru); } -@@ -5220,6 +5235,45 @@ static void intel_iommu_remove_device(st +@@ -5236,6 +5251,45 @@ static void intel_iommu_remove_device(st iommu_device_unlink(iommu->iommu_dev, dev); } @@ -1095,7 +1095,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_INTEL_IOMMU_SVM #define MAX_NR_PASID_BITS (20) static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) -@@ -5350,19 +5404,21 @@ struct intel_iommu *intel_svm_device_to_ +@@ -5366,19 +5420,21 @@ struct intel_iommu *intel_svm_device_to_ #endif /* CONFIG_INTEL_IOMMU_SVM */ static const struct iommu_ops intel_iommu_ops = { diff --git a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch index 22904eec9..b798a366b 100644 --- a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch @@ -402,10 +402,10 @@ Signed-off-by: Yangbo Lu + goto out_master_put; } - dspi_init(dspi); + dspi->clk = devm_clk_get(&pdev->dev, "dspi"); @@ -740,6 +1031,13 @@ static int dspi_probe(struct platform_de - if (ret) - goto out_master_put; + goto out_clk_put; + } + if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) { + if (dspi_request_dma(dspi, res->start)) { diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index 7afef36e4..3c278099d 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -1658,7 +1658,7 @@ Signed-off-by: Yangbo Lu return IRQ_HANDLED; } } -@@ -923,12 +932,32 @@ int usb_otg_start(struct platform_device +@@ -925,12 +934,32 @@ int usb_otg_start(struct platform_device temp &= ~(PORTSC_PHY_TYPE_SEL | PORTSC_PTW); switch (pdata->phy_mode) { case FSL_USB2_PHY_ULPI: diff --git a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch index 7ff586cd1..f21f8083e 100644 --- a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3962,6 +3962,15 @@ static int mvneta_ethtool_set_wol(struct +@@ -3961,6 +3961,15 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3972,6 +3981,7 @@ static const struct net_device_ops mvnet +@@ -3971,6 +3980,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch index 3549c8997..ea51cc2ef 100644 --- a/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch @@ -278,7 +278,7 @@ Signed-off-by: Russell King if (!pp->neta_armada3700) { for_each_online_cpu(cpu) { -@@ -3252,103 +3209,232 @@ static int mvneta_set_mac_addr(struct ne +@@ -3251,103 +3208,232 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -585,7 +585,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3627,10 +3713,9 @@ static int mvneta_stop(struct net_device +@@ -3626,10 +3712,9 @@ static int mvneta_stop(struct net_device static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -598,7 +598,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3641,44 +3726,25 @@ mvneta_ethtool_set_link_ksettings(struct +@@ -3640,44 +3725,25 @@ mvneta_ethtool_set_link_ksettings(struct const struct ethtool_link_ksettings *cmd) { struct mvneta_port *pp = netdev_priv(ndev); @@ -657,7 +657,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3770,6 +3836,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3769,6 +3835,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -680,7 +680,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3786,26 +3868,35 @@ static void mvneta_ethtool_update_stats( +@@ -3785,26 +3867,35 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -721,7 +721,7 @@ Signed-off-by: Russell King } } -@@ -3940,28 +4031,65 @@ static int mvneta_ethtool_get_rxfh(struc +@@ -3939,28 +4030,65 @@ static int mvneta_ethtool_get_rxfh(struc static void mvneta_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { @@ -795,7 +795,7 @@ Signed-off-by: Russell King static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback) -@@ -3985,13 +4113,15 @@ static const struct net_device_ops mvnet +@@ -3984,13 +4112,15 @@ static const struct net_device_ops mvnet }; static const struct ethtool_ops mvneta_eth_tool_ops = { @@ -812,7 +812,7 @@ Signed-off-by: Russell King .get_strings = mvneta_ethtool_get_strings, .get_ethtool_stats = mvneta_ethtool_get_stats, .get_sset_count = mvneta_ethtool_get_sset_count, -@@ -3999,10 +4129,12 @@ static const struct ethtool_ops mvneta_e +@@ -3998,10 +4128,12 @@ static const struct ethtool_ops mvneta_e .get_rxnfc = mvneta_ethtool_get_rxnfc, .get_rxfh = mvneta_ethtool_get_rxfh, .set_rxfh = mvneta_ethtool_set_rxfh, @@ -826,7 +826,7 @@ Signed-off-by: Russell King }; /* Initialize hw */ -@@ -4147,14 +4279,13 @@ static int mvneta_probe(struct platform_ +@@ -4146,14 +4278,13 @@ static int mvneta_probe(struct platform_ { struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -842,7 +842,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -4170,31 +4301,11 @@ static int mvneta_probe(struct platform_ +@@ -4169,31 +4300,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -875,7 +875,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4205,12 +4316,7 @@ static int mvneta_probe(struct platform_ +@@ -4204,12 +4315,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -889,7 +889,7 @@ Signed-off-by: Russell King pp->rxq_def = rxq_def; -@@ -4232,7 +4338,7 @@ static int mvneta_probe(struct platform_ +@@ -4231,7 +4337,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -898,7 +898,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4358,6 +4464,14 @@ static int mvneta_probe(struct platform_ +@@ -4357,6 +4463,14 @@ static int mvneta_probe(struct platform_ /* 9676 == 9700 - 20 and rounding to 8 */ dev->max_mtu = 9676; @@ -913,7 +913,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4369,14 +4483,6 @@ static int mvneta_probe(struct platform_ +@@ -4368,14 +4482,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -928,7 +928,7 @@ Signed-off-by: Russell King return 0; err_netdev: -@@ -4387,16 +4493,14 @@ err_netdev: +@@ -4386,16 +4492,14 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -947,7 +947,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4408,7 +4512,6 @@ err_free_netdev: +@@ -4407,7 +4511,6 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -955,7 +955,7 @@ Signed-off-by: Russell King struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); -@@ -4416,10 +4519,8 @@ static int mvneta_remove(struct platform +@@ -4415,10 +4518,8 @@ static int mvneta_remove(struct platform clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); @@ -967,7 +967,7 @@ Signed-off-by: Russell King free_netdev(dev); if (pp->bm_priv) { -@@ -4471,9 +4572,6 @@ static int mvneta_resume(struct device * +@@ -4470,9 +4571,6 @@ static int mvneta_resume(struct device * return err; } diff --git a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch index 88ea6973e..906c163ac 100644 --- a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch +++ b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch @@ -18,7 +18,7 @@ Signed-off-by: Russell King struct device_node *dn; unsigned int tx_csum_limit; struct phylink *phylink; -@@ -4316,6 +4317,7 @@ static int mvneta_probe(struct platform_ +@@ -4315,6 +4316,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); diff --git a/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index 6f9c4dd59..7d02b0a93 100644 --- a/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -34,7 +34,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3543,8 +3541,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3542,8 +3540,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -44,7 +44,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3585,8 +3582,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3584,8 +3581,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch index f359eb3d7..39eb33ac2 100644 --- a/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4046,6 +4046,22 @@ static int mvneta_ethtool_set_wol(struct +@@ -4045,6 +4045,22 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -33,7 +33,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4130,6 +4146,8 @@ static const struct ethtool_ops mvneta_e +@@ -4129,6 +4145,8 @@ static const struct ethtool_ops mvneta_e .set_link_ksettings = mvneta_ethtool_set_link_ksettings, .get_wol = mvneta_ethtool_get_wol, .set_wol = mvneta_ethtool_set_wol, diff --git a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch index 51b6a62ce..9b8107cee 100644 --- a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch +++ b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch @@ -15,7 +15,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4046,22 +4046,6 @@ static int mvneta_ethtool_set_wol(struct +@@ -4045,22 +4045,6 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -38,7 +38,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4146,8 +4130,6 @@ static const struct ethtool_ops mvneta_e +@@ -4145,8 +4129,6 @@ static const struct ethtool_ops mvneta_e .set_link_ksettings = mvneta_ethtool_set_link_ksettings, .get_wol = mvneta_ethtool_get_wol, .set_wol = mvneta_ethtool_set_wol, diff --git a/target/linux/mvebu/patches-4.14/421-rtc-armada38x-reset-after-rtc-power-loss.patch b/target/linux/mvebu/patches-4.14/421-rtc-armada38x-reset-after-rtc-power-loss.patch new file mode 100644 index 000000000..885e3d7c5 --- /dev/null +++ b/target/linux/mvebu/patches-4.14/421-rtc-armada38x-reset-after-rtc-power-loss.patch @@ -0,0 +1,73 @@ +From 1a990fefb641398fb580a0ea0be99b0ff27cbb9b Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Thu, 21 Jun 2018 20:40:23 +0300 +Subject: [PATCH] rtc: armada38x: reset after rtc power loss + +When the RTC block looses power it needs a reset sequence to make it +usable again. Otherwise, writes to the time register have no effect. + +This reset sequence combines information from the mvebu_rtc driver in +the Marvell provided U-Boot, and the SolidRun provided U-Boot repo. + +Tested on the Armada 388 based SolidRun Clearfog Base. + +Signed-off-by: Baruch Siach +Acked-by: Gregory CLEMENT +Signed-off-by: Alexandre Belloni +--- + drivers/rtc/rtc-armada38x.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/drivers/rtc/rtc-armada38x.c ++++ b/drivers/rtc/rtc-armada38x.c +@@ -30,6 +30,8 @@ + #define RTC_IRQ_FREQ_1HZ BIT(2) + #define RTC_CCR 0x18 + #define RTC_CCR_MODE BIT(15) ++#define RTC_CONF_TEST 0x1C ++#define RTC_NOMINAL_TIMING BIT(13) + + #define RTC_TIME 0xC + #define RTC_ALARM1 0x10 +@@ -75,6 +77,7 @@ struct armada38x_rtc { + void __iomem *regs_soc; + spinlock_t lock; + int irq; ++ bool initialized; + struct value_to_freq *val_to_freq; + struct armada38x_rtc_data *data; + }; +@@ -226,6 +229,23 @@ static int armada38x_rtc_read_time(struc + return 0; + } + ++static void armada38x_rtc_reset(struct armada38x_rtc *rtc) ++{ ++ u32 reg; ++ ++ reg = rtc->data->read_rtc_reg(rtc, RTC_CONF_TEST); ++ /* If bits [7:0] are non-zero, assume RTC was uninitialized */ ++ if (reg & 0xff) { ++ rtc_delayed_write(0, rtc, RTC_CONF_TEST); ++ msleep(500); /* Oscillator startup time */ ++ rtc_delayed_write(0, rtc, RTC_TIME); ++ rtc_delayed_write(SOC_RTC_ALARM1 | SOC_RTC_ALARM2, rtc, ++ RTC_STATUS); ++ rtc_delayed_write(RTC_NOMINAL_TIMING, rtc, RTC_CCR); ++ } ++ rtc->initialized = true; ++} ++ + static int armada38x_rtc_set_time(struct device *dev, struct rtc_time *tm) + { + struct armada38x_rtc *rtc = dev_get_drvdata(dev); +@@ -237,6 +257,9 @@ static int armada38x_rtc_set_time(struct + if (ret) + goto out; + ++ if (!rtc->initialized) ++ armada38x_rtc_reset(rtc); ++ + spin_lock_irqsave(&rtc->lock, flags); + rtc_delayed_write(time, rtc, RTC_TIME); + spin_unlock_irqrestore(&rtc->lock, flags); diff --git a/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch b/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch index fe93b2114..d1189eeb8 100644 --- a/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch +++ b/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch @@ -57,13 +57,14 @@ Signed-off-by: Ian Pozella source "drivers/mtd/ubi/Kconfig" --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile -@@ -37,5 +37,6 @@ inftl-objs := inftlcore.o inftlmount.o +@@ -37,6 +37,7 @@ inftl-objs := inftlcore.o inftlmount.o obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/ +obj-$(CONFIG_MTD_SPI_NAND) += spi-nand/ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/ obj-$(CONFIG_MTD_UBI) += ubi/ + --- /dev/null +++ b/drivers/mtd/spi-nand/Kconfig @@ -0,0 +1,7 @@ diff --git a/target/linux/ramips/patches-4.14/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch b/target/linux/ramips/patches-4.14/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch new file mode 100644 index 000000000..77f2622b9 --- /dev/null +++ b/target/linux/ramips/patches-4.14/0003-MIPS-Fix-memory-reservation-in-bootmem_init-for-cert.patch @@ -0,0 +1,45 @@ +From: Tobias Wolf +Subject: [v2] MIPS: Fix memory reservation in bootmem_init for certain non-usermem setups + +Commit 67a3ba25aa95 ("MIPS: Fix incorrect mem=X@Y handling") introduced a new +issue for rt288x where "PHYS_OFFSET" is 0x0 but the calculated "ramstart" is +not. As the prerequisite of custom memory map has been removed, this results +in the full memory range of 0x0 - 0x8000000 to be marked as reserved for this +platform. + +v2: Correctly compare that usermem is not null. + +This patch adds the originally intended prerequisite again. + +Signed-off-by: Tobias Wolf +--- + +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -369,6 +369,8 @@ static unsigned long __init bootmap_byte + return ALIGN(bytes, sizeof(long)); + } + ++static int usermem __initdata; ++ + static void __init bootmem_init(void) + { + unsigned long reserved_end; +@@ -442,7 +444,7 @@ static void __init bootmem_init(void) + /* + * Reserve any memory between the start of RAM and PHYS_OFFSET + */ +- if (ramstart > PHYS_OFFSET) ++ if (usermem && ramstart > PHYS_OFFSET) + add_memory_region(PHYS_OFFSET, ramstart - PHYS_OFFSET, + BOOT_MEM_RESERVED); + +@@ -652,8 +654,6 @@ static void __init bootmem_init(void) + * initialization hook for anything else was introduced. + */ + +-static int usermem __initdata; +- + static int __init early_parse_mem(char *p) + { + phys_addr_t start, size; diff --git a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch index b71d8f38e..634033d18 100644 --- a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch +++ b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -411,6 +411,9 @@ uart_get_baud_rate(struct uart_port *por +@@ -418,6 +418,9 @@ uart_get_baud_rate(struct uart_port *por break; } diff --git a/target/linux/zynq/patches-4.14/022-v4.19-dts-set-correct-manufacturer-for-ZedBoard-and-MicroZed.patch b/target/linux/zynq/patches-4.14/022-v4.19-dts-set-correct-manufacturer-for-ZedBoard-and-MicroZed.patch new file mode 100644 index 000000000..3091846a6 --- /dev/null +++ b/target/linux/zynq/patches-4.14/022-v4.19-dts-set-correct-manufacturer-for-ZedBoard-and-MicroZed.patch @@ -0,0 +1,38 @@ +From ef4c422d167afcd15c8bae1f841ef59334c1f973 Mon Sep 17 00:00:00 2001 +From: Luis Araneda +Date: Thu, 12 Jul 2018 00:10:19 -0400 +Subject: [PATCH] ARM: dts: zynq: Set correct manufacturer for ZedBoard and + MicroZed boards + +Both boards are made by Avnet, Inc. So add an additional +value to the compatible property + +Signed-off-by: Luis Araneda +Signed-off-by: Michal Simek +--- + arch/arm/boot/dts/zynq-microzed.dts | 2 +- + arch/arm/boot/dts/zynq-zed.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/zynq-microzed.dts ++++ b/arch/arm/boot/dts/zynq-microzed.dts +@@ -16,7 +16,7 @@ + + / { + model = "Zynq MicroZED Development Board"; +- compatible = "xlnx,zynq-microzed", "xlnx,zynq-7000"; ++ compatible = "avnet,zynq-microzed", "xlnx,zynq-microzed", "xlnx,zynq-7000"; + + aliases { + ethernet0 = &gem0; +--- a/arch/arm/boot/dts/zynq-zed.dts ++++ b/arch/arm/boot/dts/zynq-zed.dts +@@ -16,7 +16,7 @@ + + / { + model = "Zynq Zed Development Board"; +- compatible = "xlnx,zynq-zed", "xlnx,zynq-7000"; ++ compatible = "avnet,zynq-zed", "xlnx,zynq-zed", "xlnx,zynq-7000"; + + aliases { + ethernet0 = &gem0;