From: Mieczyslaw Nalewaj Date: Wed, 30 Apr 2025 09:52:08 +0000 (+0200) Subject: generic: 6.12: manually rebuild hack patches X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4cfd329178d3d13cdeeaac1ca5deff510aa989a;p=thirdparty%2Fopenwrt.git generic: 6.12: manually rebuild hack patches Manually rebuild hack patches: - 200-tools_portability.patch - 204-module_strip.patch - 210-darwin_scripts_include.patch - 251-kconfig.patch - 421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch - 610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch - 721-net-add-packet-mangeling.patch - 725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch - 760-net-usb-r8152-add-LED-configuration-from-OF.patch - 800-GPIO-add-named-gpio-exports.patch - 901-debloat_sock_diag.patch - 902-debloat_proc.patch - 904-debloat_dma_buf.patch - 910-kobject_uevent.patch - 911-kobject_add_broadcast_uevent.patch - 930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch Signed-off-by: Mieczyslaw Nalewaj [ improve commit title ] Link: https://github.com/openwrt/openwrt/pull/16547 Signed-off-by: Christian Marangi --- diff --git a/target/linux/generic/hack-6.12/200-tools_portability.patch b/target/linux/generic/hack-6.12/200-tools_portability.patch index e58b4db5bc1..58ef2231c0f 100644 --- a/target/linux/generic/hack-6.12/200-tools_portability.patch +++ b/target/linux/generic/hack-6.12/200-tools_portability.patch @@ -40,20 +40,7 @@ Signed-off-by: Felix Fietkau # sysroots and flags or to avoid the GCC call in pure Clang builds. --- a/tools/include/linux/types.h +++ b/tools/include/linux/types.h -@@ -10,8 +10,12 @@ - #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */ - #endif - -+#ifndef __linux__ -+#include -+#else - #include - #include -+#endif - - struct page; - struct kmem_cache; -@@ -56,6 +60,7 @@ typedef __s8 s8; +@@ -56,6 +56,7 @@ typedef __s8 s8; #define __user #endif #define __must_check @@ -61,19 +48,6 @@ Signed-off-by: Felix Fietkau #define __cold typedef __u16 __bitwise __le16; ---- a/tools/lib/subcmd/exec-cmd.c -+++ b/tools/lib/subcmd/exec-cmd.c -@@ -12,7 +12,10 @@ - #include "subcmd-config.h" - - #define MAX_ARGS 32 -+ -+#ifndef PATH_MAX - #define PATH_MAX 4096 -+#endif - - static const char *argv_exec_path; - static const char *argv0_path; --- a/tools/objtool/include/objtool/objtool.h +++ b/tools/objtool/include/objtool/objtool.h @@ -12,6 +12,7 @@ @@ -93,14 +67,14 @@ Signed-off-by: Felix Fietkau +#include + /** - * fls - find last (most-significant) bit set + * generic_fls - find last (most-significant) bit set * @x: the word to search @@ -10,6 +12,7 @@ * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ -+#define fls __linux_fls - static __always_inline int fls(unsigned int x) ++#define generic_fls __linux_fls + static __always_inline int generic_fls(unsigned int x) { int r = 32; --- a/tools/lib/string.c @@ -134,29 +108,24 @@ Signed-off-by: Felix Fietkau --- a/tools/arch/x86/include/asm/orc_types.h +++ b/tools/arch/x86/include/asm/orc_types.h -@@ -46,7 +46,6 @@ +@@ -46,7 +46,17 @@ #define ORC_TYPE_REGS_PARTIAL 4 #ifndef __ASSEMBLY__ --#include ++#ifdef __APPLE__ ++#include ++ ++#if __BYTE_ORDER == __LITTLE_ENDIAN ++#define __LITTLE_ENDIAN_BITFIELD ++#elif __BYTE_ORDER == __BIG_ENDIAN ++#define __BIG_ENDIAN_BITFIELD ++#endif ++#else + #include ++#endif /* * This struct is more or less a vastly simplified version of the DWARF Call -@@ -59,12 +58,12 @@ - struct orc_entry { - s16 sp_offset; - s16 bp_offset; --#if defined(__LITTLE_ENDIAN_BITFIELD) -+#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned sp_reg:4; - unsigned bp_reg:4; - unsigned type:3; - unsigned signal:1; --#elif defined(__BIG_ENDIAN_BITFIELD) -+#elif __BYTE_ORDER == __BIG_ENDIAN - unsigned bp_reg:4; - unsigned sp_reg:4; - unsigned unused:4; --- a/tools/include/linux/rbtree.h +++ b/tools/include/linux/rbtree.h @@ -18,7 +18,6 @@ @@ -167,53 +136,19 @@ Signed-off-by: Felix Fietkau struct rb_node { unsigned long __rb_parent_color; ---- a/tools/include/tools/be_byteshift.h -+++ b/tools/include/tools/be_byteshift.h -@@ -2,6 +2,10 @@ - #ifndef _TOOLS_BE_BYTESHIFT_H - #define _TOOLS_BE_BYTESHIFT_H +--- a/tools/lib/subcmd/exec-cmd.c ++++ b/tools/lib/subcmd/exec-cmd.c +@@ -12,7 +12,10 @@ + #include "subcmd-config.h" -+#ifndef __linux__ -+#include "linux_types.h" -+#endif + #define MAX_ARGS 32 + - #include - - static inline uint16_t __get_unaligned_be16(const uint8_t *p) ---- a/tools/include/tools/le_byteshift.h -+++ b/tools/include/tools/le_byteshift.h -@@ -2,6 +2,10 @@ - #ifndef _TOOLS_LE_BYTESHIFT_H - #define _TOOLS_LE_BYTESHIFT_H - -+#ifndef __linux__ -+#include "linux_types.h" ++#ifndef PATH_MAX + #define PATH_MAX 4096 +#endif -+ - #include - static inline uint16_t __get_unaligned_le16(const uint8_t *p) ---- /dev/null -+++ b/tools/include/tools/linux_types.h -@@ -0,0 +1,18 @@ -+#ifndef __LINUX_TYPES_H -+#define __LINUX_TYPES_H -+ -+#include -+ -+typedef int8_t __s8; -+typedef uint8_t __u8; -+ -+typedef int16_t __s16; -+typedef uint16_t __u16; -+ -+typedef int32_t __s32; -+typedef uint32_t __u32; -+ -+typedef int64_t __s64; -+typedef uint64_t __u64; -+ -+#endif + static const char *argv_exec_path; + static const char *argv0_path; --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -39,6 +39,8 @@ OBJTOOL_LDFLAGS := $(LIBELF_LIBS) $(LIBS @@ -225,40 +160,11 @@ Signed-off-by: Felix Fietkau # Always want host compilation. HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" ---- a/tools/objtool/orc_dump.c -+++ b/tools/objtool/orc_dump.c -@@ -4,10 +4,10 @@ - */ - - #include --#include - #include - #include - #include -+#include - - static const char *reg_name(unsigned int reg) - { ---- a/tools/objtool/orc_gen.c -+++ b/tools/objtool/orc_gen.c -@@ -7,11 +7,11 @@ - #include - - #include --#include - - #include - #include - #include -+#include - - static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi, - struct instruction *insn) --- a/tools/arch/x86/lib/insn.c +++ b/tools/arch/x86/lib/insn.c @@ -15,7 +15,11 @@ #include "../include/asm/insn.h" /* __ignore_sync_check__ */ - #include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */ + #include /* __ignore_sync_check__ */ +#ifdef __KERNEL__ #include diff --git a/target/linux/generic/hack-6.12/204-module_strip.patch b/target/linux/generic/hack-6.12/204-module_strip.patch index 9eadd2ce16b..2a0ea01e7f6 100644 --- a/target/linux/generic/hack-6.12/204-module_strip.patch +++ b/target/linux/generic/hack-6.12/204-module_strip.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau /* For userspace: you can also call me... */ #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) -@@ -233,12 +234,12 @@ extern void cleanup_module(void); +@@ -239,12 +240,12 @@ extern void cleanup_module(void); * Author(s), use "Name " or just "Name", for multiple * authors use multiple MODULE_AUTHOR() statements/lines. */ @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE(type, name) \ extern typeof(name) __mod_##type##__##name##_device_table \ -@@ -265,7 +266,9 @@ extern typeof(name) __mod_##type##__##na +@@ -271,7 +272,9 @@ extern typeof(name) __mod_##type##__##na */ #if defined(MODULE) || !defined(CONFIG_SYSFS) @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau #else #define MODULE_VERSION(_version) \ MODULE_INFO(version, _version); \ -@@ -288,7 +291,7 @@ extern typeof(name) __mod_##type##__##na +@@ -294,7 +297,7 @@ extern typeof(name) __mod_##type##__##na /* Optional firmware file (or files) needed by the module * format is simply firmware file name. Multiple firmware * files require multiple MODULE_FIRMWARE() specifiers */ @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau --- a/kernel/module/Kconfig +++ b/kernel/module/Kconfig -@@ -389,4 +389,11 @@ config MODULES_TREE_LOOKUP +@@ -401,4 +401,11 @@ config MODULES_TREE_LOOKUP def_bool y depends on PERF_EVENTS || TRACING || CFI_CLANG @@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau endif # MODULES --- a/kernel/module/main.c +++ b/kernel/module/main.c -@@ -997,6 +997,7 @@ size_t modinfo_attrs_count = ARRAY_SIZE( +@@ -999,6 +999,7 @@ size_t modinfo_attrs_count = ARRAY_SIZE( static const char vermagic[] = VERMAGIC_STRING; @@ -110,7 +110,7 @@ Signed-off-by: Felix Fietkau int try_to_force_load(struct module *mod, const char *reason) { #ifdef CONFIG_MODULE_FORCE_LOAD -@@ -1008,6 +1009,7 @@ int try_to_force_load(struct module *mod +@@ -1010,6 +1011,7 @@ int try_to_force_load(struct module *mod return -ENOEXEC; #endif } @@ -118,7 +118,7 @@ Signed-off-by: Felix Fietkau /* Parse tag=value strings from .modinfo section */ char *module_next_tag_pair(char *string, unsigned long *secsize) -@@ -2075,9 +2077,11 @@ static void module_augment_kernel_taints +@@ -2093,9 +2095,11 @@ static void module_augment_kernel_taints static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau if (flags & MODULE_INIT_IGNORE_VERMAGIC) modmagic = NULL; -@@ -2091,6 +2095,7 @@ static int check_modinfo(struct module * +@@ -2109,6 +2113,7 @@ static int check_modinfo(struct module * info->name, modmagic, vermagic); return -ENOEXEC; } @@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau if (err) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1666,7 +1666,9 @@ static void read_symbols(const char *mod +@@ -1601,7 +1601,9 @@ static void read_symbols(const char *mod symname = remove_dot(info.strtab + sym->st_name); handle_symbol(mod, &info, sym, symname); @@ -151,40 +151,31 @@ Signed-off-by: Felix Fietkau } check_sec_ref(mod, &info); -@@ -1839,8 +1841,10 @@ static void add_header(struct buffer *b, - buf_printf(b, "BUILD_SALT;\n"); - buf_printf(b, "BUILD_LTO_INFO;\n"); +@@ -1758,7 +1760,9 @@ static void add_header(struct buffer *b, + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); buf_printf(b, "\n"); +#ifndef CONFIG_MODULE_STRIPPED - buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); +#endif buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__section(\".gnu.linkonce.this_module\") = {\n"); -@@ -1854,8 +1858,10 @@ static void add_header(struct buffer *b, +@@ -1772,11 +1776,13 @@ static void add_header(struct buffer *b, buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n"); buf_printf(b, "};\n"); +#ifndef CONFIG_MODULE_STRIPPED if (!external_module) buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); -+#endif - - buf_printf(b, - "\n" -@@ -1863,8 +1869,10 @@ static void add_header(struct buffer *b, - "MODULE_INFO(retpoline, \"Y\");\n" - "#endif\n"); -+#ifndef CONFIG_MODULE_STRIPPED if (strstarts(mod->name, "drivers/staging")) buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); +#endif if (strstarts(mod->name, "tools/testing")) buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n"); -@@ -1974,11 +1982,13 @@ static void add_depends(struct buffer *b +@@ -1886,11 +1892,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -198,7 +189,7 @@ Signed-off-by: Felix Fietkau } static void write_buf(struct buffer *b, const char *fname) -@@ -2061,7 +2071,9 @@ static void write_mod_c_file(struct modu +@@ -1973,7 +1981,9 @@ static void write_mod_c_file(struct modu add_exported_symbols(&buf, mod); add_versions(&buf, mod); add_depends(&buf, mod); diff --git a/target/linux/generic/hack-6.12/210-darwin_scripts_include.patch b/target/linux/generic/hack-6.12/210-darwin_scripts_include.patch index b94554ffcee..be59ca4fc92 100644 --- a/target/linux/generic/hack-6.12/210-darwin_scripts_include.patch +++ b/target/linux/generic/hack-6.12/210-darwin_scripts_include.patch @@ -3039,7 +3039,7 @@ Signed-off-by: Florian Fainelli main(int argc, char **argv) --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h -@@ -9,7 +9,11 @@ +@@ -10,7 +10,11 @@ #include #include #include @@ -3050,4 +3050,4 @@ Signed-off-by: Florian Fainelli +#endif #include "../../include/linux/module_symbol.h" - #include "list.h" + #include diff --git a/target/linux/generic/hack-6.12/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch b/target/linux/generic/hack-6.12/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch index 965a331a190..190fecc1a0e 100644 --- a/target/linux/generic/hack-6.12/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch +++ b/target/linux/generic/hack-6.12/421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch @@ -25,9 +25,9 @@ Signed-off-by: Ansuel Smith #include +#include - /* debug macro */ - #if 0 -@@ -323,6 +324,68 @@ static int mtdpart_setup_real(char *s) + /* special size referring to all the remaining space in a partition */ + #define SIZE_REMAINING ULLONG_MAX +@@ -315,6 +316,68 @@ static int mtdpart_setup_real(char *s) return 0; } @@ -96,7 +96,7 @@ Signed-off-by: Ansuel Smith /* * Main function to be called from the MTD mapping driver/device to * obtain the partitioning information. At this point the command line -@@ -338,6 +401,7 @@ static int parse_cmdline_partitions(stru +@@ -330,6 +393,7 @@ static int parse_cmdline_partitions(stru int i, err; struct cmdline_mtd_partition *part; const char *mtd_id = master->name; @@ -104,7 +104,7 @@ Signed-off-by: Ansuel Smith /* parse command line */ if (!cmdline_parsed) { -@@ -382,6 +446,13 @@ static int parse_cmdline_partitions(stru +@@ -374,6 +438,13 @@ static int parse_cmdline_partitions(stru sizeof(*part->parts) * (part->num_parts - i)); i--; } diff --git a/target/linux/generic/hack-6.12/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch b/target/linux/generic/hack-6.12/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch index c1f59591310..9537bb76e3d 100644 --- a/target/linux/generic/hack-6.12/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch +++ b/target/linux/generic/hack-6.12/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch @@ -16,15 +16,17 @@ Signed-off-by: Felix Fietkau --- a/net/core/page_pool.c +++ b/net/core/page_pool.c -@@ -873,12 +873,23 @@ static void page_pool_release_retry(stru - { +@@ -1063,7 +1063,7 @@ static void page_pool_release_retry(stru struct delayed_work *dwq = to_delayed_work(wq); struct page_pool *pool = container_of(dwq, typeof(*pool), release_dw); + void *netdev; - int inflight; + int cpu, inflight; inflight = page_pool_release(pool); - if (!inflight) + /* In rare cases, a driver bug may cause inflight to go negative. +@@ -1075,6 +1075,17 @@ static void page_pool_release_retry(stru + if (inflight <= 0) return; + /* Run NET_RX_SOFTIRQ in order to free pending skbs in softnet_data @@ -38,6 +40,6 @@ Signed-off-by: Felix Fietkau + smp_call_function_single_async(cpu, &sd->defer_csd); + } + - /* Periodic warning */ - if (time_after_eq(jiffies, pool->defer_warn)) { - int sec = (s32)((u32)jiffies - (u32)pool->defer_start) / HZ; + /* Periodic warning for page pools the user can't see */ + netdev = READ_ONCE(pool->slow.netdev); + if (time_after_eq(jiffies, pool->defer_warn) && diff --git a/target/linux/generic/hack-6.12/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.12/721-net-add-packet-mangeling.patch index 0935a0b9c0a..5ad34a4517b 100644 --- a/target/linux/generic/hack-6.12/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.12/721-net-add-packet-mangeling.patch @@ -9,33 +9,25 @@ packets. Signed-off-by: Felix Fietkau --- - include/linux/netdevice.h | 11 +++++++++++ + include/linux/netdevice.h | 10 ++++++++++ include/linux/skbuff.h | 14 ++++---------- net/Kconfig | 6 ++++++ net/core/dev.c | 20 +++++++++++++++----- net/core/skbuff.c | 17 +++++++++++++++++ net/ethernet/eth.c | 6 ++++++ - 6 files changed, 59 insertions(+), 15 deletions(-) + 6 files changed, 58 insertions(+), 15 deletions(-) --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1758,6 +1758,7 @@ enum netdev_priv_flags { +@@ -1687,6 +1687,7 @@ enum netdev_priv_flags { + IFF_L3MDEV_RX_HANDLER = 1<<29, + IFF_NO_ADDRCONF = BIT_ULL(30), IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), - IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), - IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33), -+ IFF_NO_IP_ALIGN = BIT_ULL(34), ++ IFF_NO_IP_ALIGN = BIT_ULL(32), }; - #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1791,6 +1792,7 @@ enum netdev_priv_flags { - #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE - #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER - #define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR -+#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN - /* Specifies the type of the struct net_device::ml_priv pointer */ - enum netdev_ml_priv_type { -@@ -2183,6 +2185,11 @@ struct net_device { +@@ -2168,6 +2169,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -44,10 +36,10 @@ Signed-off-by: Felix Fietkau + struct sk_buff *(*eth_mangle_tx)(struct net_device *dev, struct sk_buff *skb); +#endif + - const struct header_ops *header_ops; + unsigned int operstate; + unsigned char link_mode; - unsigned char operstate; -@@ -2256,6 +2263,10 @@ struct net_device { +@@ -2237,6 +2243,10 @@ struct net_device { struct mctp_dev __rcu *mctp_ptr; #endif @@ -60,7 +52,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -3095,6 +3095,10 @@ static inline int pskb_trim(struct sk_bu +@@ -3213,6 +3213,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -71,7 +63,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -3260,16 +3264,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -3378,16 +3382,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -105,7 +97,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3628,6 +3628,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3646,6 +3646,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); @@ -119,17 +111,17 @@ Signed-off-by: Felix Fietkau rc = netdev_start_xmit(skb, dev, txq, more); --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -62,6 +62,7 @@ - #include +@@ -64,6 +64,7 @@ #include #include + #include +#include #include #include -@@ -844,6 +845,22 @@ skb_fail: +@@ -326,6 +327,22 @@ void *__napi_alloc_frag_align(unsigned i } - EXPORT_SYMBOL(__napi_alloc_skb); + EXPORT_SYMBOL(__napi_alloc_frag_align); +struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length, gfp_t gfp) @@ -147,9 +139,9 @@ Signed-off-by: Felix Fietkau +} +EXPORT_SYMBOL(__netdev_alloc_skb_ip_align); + - void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, - int size, unsigned int truesize) + void *__netdev_alloc_frag_align(unsigned int fragsz, unsigned int align_mask) { + void *data; --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -159,6 +159,12 @@ __be16 eth_type_trans(struct sk_buff *sk @@ -164,4 +156,4 @@ Signed-off-by: Felix Fietkau + skb_reset_mac_header(skb); - eth = (struct ethhdr *)skb->data; + eth = eth_skb_pull_mac(skb); diff --git a/target/linux/generic/hack-6.12/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch b/target/linux/generic/hack-6.12/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch index ed47187a3e8..7443ad2f50b 100644 --- a/target/linux/generic/hack-6.12/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch +++ b/target/linux/generic/hack-6.12/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch @@ -12,16 +12,16 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c -@@ -31,6 +31,8 @@ - #define PHY_ID_AQR113C 0x31c31c12 +@@ -32,6 +32,8 @@ #define PHY_ID_AQR114C 0x31c31c22 + #define PHY_ID_AQR115C 0x31c31c33 #define PHY_ID_AQR813 0x31c31cb2 +#define PHY_ID_AQR112C 0x03a1b790 +#define PHY_ID_AQR112R 0x31c31d12 #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -1061,6 +1063,30 @@ static struct phy_driver aqr_driver[] = +@@ -1205,6 +1207,30 @@ static struct phy_driver aqr_driver[] = .led_hw_control_get = aqr_phy_led_hw_control_get, .led_polarity_set = aqr_phy_led_polarity_set, }, @@ -52,9 +52,9 @@ Signed-off-by: Daniel Golle }; module_phy_driver(aqr_driver); -@@ -1081,6 +1107,8 @@ static struct mdio_device_id __maybe_unu - { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, +@@ -1226,6 +1252,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR114C) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR115C) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) }, diff --git a/target/linux/generic/hack-6.12/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-6.12/760-net-usb-r8152-add-LED-configuration-from-OF.patch index 069c6823033..3b61638cb66 100644 --- a/target/linux/generic/hack-6.12/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-6.12/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -14,15 +14,15 @@ Signed-off-by: David Bauer --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c -@@ -11,6 +11,7 @@ - #include +@@ -12,6 +12,7 @@ #include + #include #include +#include #include #include #include -@@ -7044,6 +7045,22 @@ static void rtl_tally_reset(struct r8152 +@@ -7047,6 +7048,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -7085,6 +7102,8 @@ static void r8152b_init(struct r8152 *tp +@@ -7088,6 +7105,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7225,6 +7244,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7228,6 +7247,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7307,6 +7328,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7310,6 +7331,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch b/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch index e6dcdfd92b6..3bfc612c136 100644 --- a/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch +++ b/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" #include "gpiolib-of.h" -@@ -1129,3 +1131,73 @@ void of_gpiochip_remove(struct gpio_chip +@@ -1189,3 +1191,73 @@ void of_gpiochip_remove(struct gpio_chip { of_node_put(dev_of_node(&chip->gpiodev->dev)); } @@ -91,7 +91,7 @@ Signed-off-by: John Crispin +#endif --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h -@@ -644,7 +644,10 @@ static inline struct gpio_desc *acpi_get +@@ -628,7 +628,10 @@ static inline int devm_acpi_dev_add_driv #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) @@ -102,7 +102,7 @@ Signed-off-by: John Crispin int gpiod_export_link(struct device *dev, const char *name, struct gpio_desc *desc); void gpiod_unexport(struct gpio_desc *desc); -@@ -653,11 +656,25 @@ void gpiod_unexport(struct gpio_desc *de +@@ -637,11 +640,25 @@ void gpiod_unexport(struct gpio_desc *de #include @@ -130,25 +130,25 @@ Signed-off-by: John Crispin struct gpio_desc *desc) --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -558,7 +558,7 @@ static struct class gpio_class = { - * - * Returns zero on success, else an error. +@@ -571,7 +571,7 @@ static struct class gpio_class = { + * Returns: + * 0 on success, or negative errno on failure. */ -int gpiod_export(struct gpio_desc *desc, bool direction_may_change) +int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name) { - struct gpio_chip *chip; - struct gpio_device *gdev; -@@ -620,6 +620,8 @@ int gpiod_export(struct gpio_desc *desc, + const char *ioname = NULL; + struct gpio_device *gdev; +@@ -629,6 +629,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); - if (chip->names && chip->names[offset]) - ioname = chip->names[offset]; + if (guard.gc->names && guard.gc->names[offset]) + ioname = guard.gc->names[offset]; + if (name) + ioname = name; dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -641,8 +643,21 @@ err_unlock: +@@ -650,8 +652,21 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } diff --git a/target/linux/generic/hack-6.12/901-debloat_sock_diag.patch b/target/linux/generic/hack-6.12/901-debloat_sock_diag.patch index c0ba6c008e8..d130b82dd6c 100644 --- a/target/linux/generic/hack-6.12/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-6.12/901-debloat_sock_diag.patch @@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau --- a/net/Kconfig +++ b/net/Kconfig -@@ -129,6 +129,9 @@ source "net/mptcp/Kconfig" +@@ -138,6 +138,9 @@ source "net/mptcp/Kconfig" endif # if INET @@ -41,8 +41,8 @@ Signed-off-by: Felix Fietkau +obj-$(CONFIG_SOCK_DIAG) += sock_diag.o obj-y += net-sysfs.o - obj-$(CONFIG_PAGE_POOL) += page_pool.o - obj-$(CONFIG_PROC_FS) += net-procfs.o + obj-y += hotdata.o + obj-y += netdev_rx_queue.o --- a/net/core/sock.c +++ b/net/core/sock.c @@ -118,6 +118,7 @@ @@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau #include -@@ -150,6 +151,7 @@ +@@ -152,6 +153,7 @@ static DEFINE_MUTEX(proto_list_mutex); static LIST_HEAD(proto_list); @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau static void sock_def_write_space_wfree(struct sock *sk); static void sock_def_write_space(struct sock *sk); -@@ -590,6 +592,21 @@ discard_and_relse: +@@ -587,6 +589,21 @@ discard_and_relse: } EXPORT_SYMBOL(__sk_receive_skb); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *, u32)); INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *, -@@ -2242,9 +2259,11 @@ static void __sk_free(struct sock *sk) +@@ -2326,9 +2343,11 @@ static void __sk_free(struct sock *sk) if (likely(sk->sk_net_refcnt)) sock_inuse_add(sock_net(sk), -1); @@ -161,7 +161,7 @@ Signed-off-by: Felix Fietkau Support for PF_PACKET sockets monitoring interface used by the ss tool. --- a/net/unix/Kconfig +++ b/net/unix/Kconfig -@@ -29,6 +29,7 @@ config AF_UNIX_OOB +@@ -24,6 +24,7 @@ config AF_UNIX_OOB config UNIX_DIAG tristate "UNIX: socket monitoring interface" depends on UNIX diff --git a/target/linux/generic/hack-6.12/902-debloat_proc.patch b/target/linux/generic/hack-6.12/902-debloat_proc.patch index 8a2f3330abf..5c8be5fe2d7 100644 --- a/target/linux/generic/hack-6.12/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.12/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2895,6 +2895,8 @@ static const struct seq_operations locks +@@ -2971,6 +2971,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau depends on PROC_FS --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c -@@ -107,6 +107,9 @@ static const struct seq_operations conso +@@ -110,6 +110,9 @@ static const struct seq_operations conso static int __init proc_consoles_init(void) { @@ -158,7 +158,7 @@ Signed-off-by: Felix Fietkau IPC_SEM_IDS, sysvipc_sem_proc_show); --- a/ipc/shm.c +++ b/ipc/shm.c -@@ -154,6 +154,8 @@ pure_initcall(ipc_ns_init); +@@ -155,6 +155,8 @@ pure_initcall(ipc_ns_init); void __init shm_init(void) { @@ -192,7 +192,7 @@ Signed-off-by: Felix Fietkau } --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c -@@ -341,6 +341,9 @@ void register_irq_proc(unsigned int irq, +@@ -339,6 +339,9 @@ void register_irq_proc(unsigned int irq, void __maybe_unused *irqp = (void *)(unsigned long) irq; char name [MAX_NAMELEN]; @@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) return; -@@ -394,6 +397,9 @@ void unregister_irq_proc(unsigned int ir +@@ -397,6 +400,9 @@ void unregister_irq_proc(unsigned int ir { char name [MAX_NAMELEN]; @@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir || !desc->dir) return; #ifdef CONFIG_SMP -@@ -432,6 +438,9 @@ void init_irq_proc(void) +@@ -435,6 +441,9 @@ void init_irq_proc(void) unsigned int irq; struct irq_desc *desc; @@ -224,7 +224,7 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir) --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c -@@ -350,6 +350,8 @@ static int __init init_timer_list_procfs +@@ -354,6 +354,8 @@ static int __init init_timer_list_procfs { struct proc_dir_entry *pe; @@ -235,18 +235,18 @@ Signed-off-by: Felix Fietkau if (!pe) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -4450,6 +4450,8 @@ static const struct seq_operations vmall - - static int __init proc_vmalloc_init(void) +@@ -5034,6 +5034,8 @@ static int __init proc_vmalloc_init(void { + void *priv_data = NULL; + + if (IS_ENABLED(CONFIG_PROC_STRIPPED)) + return 0; if (IS_ENABLED(CONFIG_NUMA)) - proc_create_seq_private("vmallocinfo", 0400, NULL, - &vmalloc_op, + priv_data = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL); + --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -2136,10 +2136,12 @@ void __init init_mm_internals(void) +@@ -2195,10 +2195,12 @@ void __init init_mm_internals(void) start_shepherd_timer(); #endif #ifdef CONFIG_PROC_FS @@ -286,7 +286,7 @@ Signed-off-by: Felix Fietkau goto err; --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c -@@ -327,10 +327,12 @@ static int __net_init dev_proc_net_init( +@@ -295,10 +295,12 @@ static int __net_init dev_proc_net_init( if (!proc_create_net("dev", 0444, net->proc_net, &dev_seq_ops, sizeof(struct seq_net_private))) goto out; @@ -301,7 +301,7 @@ Signed-off-by: Felix Fietkau sizeof(struct seq_net_private))) goto out_softnet; -@@ -340,9 +342,11 @@ static int __net_init dev_proc_net_init( +@@ -308,9 +310,11 @@ static int __net_init dev_proc_net_init( out: return rc; out_ptype: @@ -315,7 +315,7 @@ Signed-off-by: Felix Fietkau out_dev: remove_proc_entry("dev", net->proc_net); goto out; -@@ -352,8 +356,10 @@ static void __net_exit dev_proc_net_exit +@@ -320,8 +324,10 @@ static void __net_exit dev_proc_net_exit { wext_proc_exit(net); @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -4143,6 +4143,8 @@ static __net_initdata struct pernet_oper +@@ -4256,6 +4256,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { @@ -385,7 +385,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c -@@ -557,5 +557,8 @@ static __net_initdata struct pernet_oper +@@ -563,5 +563,8 @@ static __net_initdata struct pernet_oper int __init ip_misc_proc_init(void) { @@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau } --- a/net/ipv4/route.c +++ b/net/ipv4/route.c -@@ -381,6 +381,9 @@ static struct pernet_operations ip_rt_pr +@@ -378,6 +378,9 @@ static struct pernet_operations ip_rt_pr static int __init ip_rt_proc_init(void) { @@ -408,7 +408,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c -@@ -266,7 +266,7 @@ void __inet_twsk_schedule(struct inet_ti +@@ -296,7 +296,7 @@ void __inet_twsk_schedule(struct inet_ti */ if (!rearm) { diff --git a/target/linux/generic/hack-6.12/904-debloat_dma_buf.patch b/target/linux/generic/hack-6.12/904-debloat_dma_buf.patch index 4d2ea46212d..2e953023c94 100644 --- a/target/linux/generic/hack-6.12/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-6.12/904-debloat_dma_buf.patch @@ -9,7 +9,8 @@ Signed-off-by: Felix Fietkau drivers/dma-buf/Makefile | 10 +++++++--- drivers/dma-buf/dma-buf.c | 4 +++- kernel/sched/core.c | 1 + - 4 files changed, 12 insertions(+), 5 deletions(-) + net/Kconfig | 2 +- + 5 files changed, 13 insertions(+), 6 deletions(-) --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -64,7 +65,7 @@ Signed-off-by: Felix Fietkau +dma-shared-buffer-objs := $(dma-buf-objs-y) --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -1731,4 +1731,5 @@ static void __exit dma_buf_deinit(void) +@@ -1743,4 +1743,5 @@ static void __exit dma_buf_deinit(void) kern_unmount(dma_buf_mnt); dma_buf_uninit_sysfs_statistics(); } @@ -73,7 +74,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4486,6 +4486,7 @@ int wake_up_state(struct task_struct *p, +@@ -4422,6 +4422,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } @@ -91,3 +92,14 @@ Signed-off-by: Felix Fietkau char *simple_dname(struct dentry *dentry, char *buffer, int buflen) { +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -74,7 +74,7 @@ config SKB_EXTENSIONS + + config NET_DEVMEM + def_bool y +- depends on DMA_SHARED_BUFFER ++ depends on DMA_SHARED_BUFFER=y + depends on GENERIC_ALLOCATOR + depends on PAGE_POOL + diff --git a/target/linux/generic/hack-6.12/910-kobject_uevent.patch b/target/linux/generic/hack-6.12/910-kobject_uevent.patch index c4c41ca400a..99dd5a70537 100644 --- a/target/linux/generic/hack-6.12/910-kobject_uevent.patch +++ b/target/linux/generic/hack-6.12/910-kobject_uevent.patch @@ -5,25 +5,28 @@ Subject: lib: add uevent_next_seqnum() Signed-off-by: Felix Fietkau --- - include/linux/kobject.h | 5 +++++ - lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++ - 2 files changed, 42 insertions(+) + include/linux/kobject.h | 2 ++ + lib/kobject_uevent.c | 6 ++++++ + 2 files changed, 8 insertions(+) +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -219,4 +219,6 @@ int kobject_synth_uevent(struct kobject + __printf(2, 3) + int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); + ++u64 uevent_next_seqnum(void); ++ + #endif /* _KOBJECT_H_ */ --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c -@@ -179,6 +179,18 @@ out: +@@ -178,6 +178,12 @@ out: return r; } +u64 uevent_next_seqnum(void) +{ -+ u64 seq; -+ -+ mutex_lock(&uevent_sock_mutex); -+ seq = ++uevent_seqnum; -+ mutex_unlock(&uevent_sock_mutex); -+ -+ return seq; ++ return atomic64_inc_return(&uevent_seqnum); +} +EXPORT_SYMBOL_GPL(uevent_next_seqnum); + diff --git a/target/linux/generic/hack-6.12/911-kobject_add_broadcast_uevent.patch b/target/linux/generic/hack-6.12/911-kobject_add_broadcast_uevent.patch index 372ac6fa7db..df160baff60 100644 --- a/target/linux/generic/hack-6.12/911-kobject_add_broadcast_uevent.patch +++ b/target/linux/generic/hack-6.12/911-kobject_add_broadcast_uevent.patch @@ -20,9 +20,9 @@ Signed-off-by: Felix Fietkau #ifdef CONFIG_UEVENT_HELPER /* path to the userspace helper executed on an event */ extern char uevent_helper[]; -@@ -219,4 +221,7 @@ int kobject_synth_uevent(struct kobject - __printf(2, 3) - int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); +@@ -221,4 +223,7 @@ int add_uevent_var(struct kobj_uevent_en + + u64 uevent_next_seqnum(void); +int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, + gfp_t allocation); @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #endif /* _KOBJECT_H_ */ --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c -@@ -706,6 +706,43 @@ int add_uevent_var(struct kobj_uevent_en +@@ -699,6 +699,43 @@ int add_uevent_var(struct kobj_uevent_en EXPORT_SYMBOL_GPL(add_uevent_var); #if defined(CONFIG_NET) diff --git a/target/linux/generic/hack-6.12/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch b/target/linux/generic/hack-6.12/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch index 85a19027fda..a7c8a8efd2a 100644 --- a/target/linux/generic/hack-6.12/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch +++ b/target/linux/generic/hack-6.12/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch @@ -19,11 +19,11 @@ Signed-off-by: Rafał Miłecki --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -1658,7 +1658,7 @@ static void device_links_purge(struct de +@@ -1653,7 +1653,7 @@ static void device_links_purge(struct de #define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \ DL_FLAG_PM_RUNTIME) --static u32 fw_devlink_flags = FW_DEVLINK_FLAGS_ON; +-static u32 fw_devlink_flags = FW_DEVLINK_FLAGS_RPM; +static u32 fw_devlink_flags = FW_DEVLINK_FLAGS_PERMISSIVE; static int __init fw_devlink_setup(char *arg) {