Skip to content

Commit

Permalink
generic: 5.15: rework pending patch
Browse files Browse the repository at this point in the history
Rework pending patch for kernel 5.15

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel authored and dangowrt committed Mar 27, 2022
1 parent 1f302af commit 4835036
Show file tree
Hide file tree
Showing 31 changed files with 89 additions and 561 deletions.
Expand Up @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -213,6 +213,8 @@ void ftrace_likely_update(struct ftrace_
@@ -211,6 +211,8 @@ void ftrace_likely_update(struct ftrace_
__v; \
})

Expand All @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* __KERNEL__ */

/*
@@ -245,6 +247,4 @@ static inline void *offset_to_ptr(const
@@ -243,6 +245,4 @@ static inline void *offset_to_ptr(const
*/
#define prevent_tail_call_optimization() mb()

Expand Down
Expand Up @@ -9,9 +9,9 @@ Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -682,6 +682,7 @@ static const struct of_device_id spidev_
{ .compatible = "lwn,bk4" },
{ .compatible = "dh,dhcom-board" },
{ .compatible = "menlo,m53cpld" },
{ .compatible = "cisco,spi-petra" },
{ .compatible = "micron,spi-authenta" },
+ { .compatible = "siliconlabs,si3210" },
{},
};
Expand Down
Expand Up @@ -8,13 +8,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>

--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -609,7 +609,8 @@ static int jffs2_rmdir (struct inode *di
@@ -609,8 +609,8 @@ static int jffs2_rmdir (struct inode *di
return ret;
}

-static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode, dev_t rdev)
+static int __jffs2_mknod (struct inode *dir_i, struct dentry *dentry,
+ umode_t mode, dev_t rdev, bool whiteout)
-static int jffs2_mknod (struct user_namespace *mnt_userns, struct inode *dir_i,
- struct dentry *dentry, umode_t mode, dev_t rdev)
+static int __jffs2_mknod (struct user_namespace *mnt_userns, struct inode *dir_i,
+ struct dentry *dentry, umode_t mode, dev_t rdev, bool whiteout)
{
struct jffs2_inode_info *f, *dir_f;
struct jffs2_sb_info *c;
Expand All @@ -31,24 +32,26 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;

fail:
@@ -756,6 +761,17 @@ static int jffs2_mknod (struct inode *di
@@ -756,6 +761,19 @@ static int jffs2_mknod (struct inode *di
return ret;
}

+static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode, dev_t rdev)
+static int jffs2_mknod (struct user_namespace *mnt_userns, struct inode *dir_i,
+ struct dentry *dentry, umode_t mode, dev_t rdev)
+{
+ return __jffs2_mknod(dir_i, dentry, mode, rdev, false);
+ return __jffs2_mknod(mnt_userns, dir_i, dentry, mode, rdev, false);
+}
+
+static int jffs2_whiteout (struct inode *old_dir, struct dentry *old_dentry)
+static int jffs2_whiteout (struct user_namespace *mnt_userns, struct inode *old_dir,
+ struct dentry *old_dentry)
+{
+ return __jffs2_mknod(old_dir, old_dentry, S_IFCHR | WHITEOUT_MODE,
+ return __jffs2_mknod(mnt_userns, old_dir, old_dentry, S_IFCHR | WHITEOUT_MODE,
+ WHITEOUT_DEV, true);
+}
+
static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
static int jffs2_rename (struct user_namespace *mnt_userns,
struct inode *old_dir_i, struct dentry *old_dentry,
struct inode *new_dir_i, struct dentry *new_dentry,
unsigned int flags)
@@ -766,7 +782,7 @@ static int jffs2_rename (struct inode *o
uint8_t type;
uint32_t now;
Expand All @@ -67,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- old_dentry->d_name.name, old_dentry->d_name.len, NULL, now);
+ if (flags & RENAME_WHITEOUT)
+ /* Replace with whiteout */
+ ret = jffs2_whiteout(old_dir_i, old_dentry);
+ ret = jffs2_whiteout(mnt_userns, old_dir_i, old_dentry);
+ else
+ /* Unlink the original */
+ ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i),
Expand Down
Expand Up @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@@ -851,6 +864,12 @@ static int jffs2_rename (struct inode *o
if (flags & RENAME_WHITEOUT)
/* Replace with whiteout */
ret = jffs2_whiteout(old_dir_i, old_dentry);
ret = jffs2_whiteout(mnt_userns, old_dir_i, old_dentry);
+ else if (flags & RENAME_EXCHANGE)
+ /* Replace the original */
+ ret = jffs2_do_link(c, JFFS2_INODE_INFO(old_dir_i),
Expand Down
Expand Up @@ -17,15 +17,15 @@ Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
--- a/drivers/platform/Kconfig
+++ b/drivers/platform/Kconfig
@@ -13,3 +13,5 @@ source "drivers/platform/chrome/Kconfig"
source "drivers/platform/mellanox/Kconfig"

source "drivers/platform/olpc/Kconfig"

source "drivers/platform/surface/Kconfig"
+
+source "drivers/platform/mikrotik/Kconfig"
--- a/drivers/platform/Makefile
+++ b/drivers/platform/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_MIPS) += mips/
obj-$(CONFIG_OLPC_EC) += olpc/
obj-$(CONFIG_GOLDFISH) += goldfish/
obj-$(CONFIG_CHROME_PLATFORMS) += chrome/
obj-$(CONFIG_SURFACE_PLATFORMS) += surface/
+obj-$(CONFIG_MIKROTIK) += mikrotik/
6 changes: 3 additions & 3 deletions target/linux/generic/pending-5.15/305-mips_module_reloc.patch
Expand Up @@ -270,7 +270,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int apply_r_mips_none(struct module *me, u32 *location,
u32 base, Elf_Addr v, bool rela)
@@ -54,9 +261,40 @@ static int apply_r_mips_32(struct module
return 0;
*location = base + v;
}

+static Elf_Addr add_plt_entry_to(unsigned *plt_offset,
Expand Down Expand Up @@ -302,8 +302,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+}
+
static int apply_r_mips_26(struct module *me, u32 *location,
u32 base, Elf_Addr v, bool rela)
static int apply_r_mips_26(struct module *me, u32 *location, u32 base,
Elf_Addr v)
{
+ u32 ofs = base & 0x03ffffff;
+
Expand Down
Expand Up @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -138,6 +138,120 @@ static int show_cpuinfo(struct seq_file
@@ -138,6 +138,116 @@ static int show_cpuinfo(struct seq_file
seq_printf(m, "micromips kernel\t: %s\n",
(read_c0_config3() & MIPS_CONF3_ISA_OE) ? "yes" : "no");
}
Expand Down Expand Up @@ -45,10 +45,6 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+ seq_printf(m, "%s", " 3k_cache");
+ if (cpu_has_4k_cache)
+ seq_printf(m, "%s", " 4k_cache");
+ if (cpu_has_6k_cache)
+ seq_printf(m, "%s", " 6k_cache");
+ if (cpu_has_8k_cache)
+ seq_printf(m, "%s", " 8k_cache");
+ if (cpu_has_tx39_cache)
+ seq_printf(m, "%s", " tx39_cache");
+ if (cpu_has_octeon_cache)
Expand Down
Expand Up @@ -238,12 +238,14 @@ Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+#endif
--- a/arch/mips/kernel/relocate_kernel.S
+++ b/arch/mips/kernel/relocate_kernel.S
@@ -10,8 +10,9 @@
@@ -10,10 +10,11 @@
#include <asm/mipsregs.h>
#include <asm/stackframe.h>
#include <asm/addrspace.h>
+#include "machine_kexec.h"

#include <kernel-entry-init.h>

-LEAF(relocate_new_kernel)
+LEAF(kexec_relocate_new_kernel)
PTR_L a0, arg0
Expand All @@ -259,7 +261,7 @@ Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
#ifdef CONFIG_SMP
/*
@@ -182,9 +183,15 @@ kexec_indirection_page:
PTR 0
PTR_WD 0
.size kexec_indirection_page, PTRSIZE

-relocate_new_kernel_end:
Expand All @@ -275,7 +277,7 @@ Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

-relocate_new_kernel_size:
- EXPORT(relocate_new_kernel_size)
- PTR relocate_new_kernel_end - relocate_new_kernel
- PTR_WD relocate_new_kernel_end - relocate_new_kernel
- .size relocate_new_kernel_size, PTRSIZE
+kexec_relocate_new_kernel_end:
+ EXPORT(kexec_relocate_new_kernel_end)

This file was deleted.

4 changes: 2 additions & 2 deletions target/linux/generic/pending-5.15/420-mtd-redboot_space.patch
Expand Up @@ -16,9 +16,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
names += strlen(names)+1;

-#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) {
if (fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) {
- i++;
- parts[i].offset = parts[i-1].size + parts[i-1].offset;
- parts[i].offset = parts[i - 1].size + parts[i - 1].offset;
- parts[i].size = fl->next->img->flash_base - parts[i].offset;
- parts[i].name = nullname;
- }
Expand Down
Expand Up @@ -17,9 +17,9 @@ Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
--- a/drivers/mtd/parsers/Kconfig
+++ b/drivers/mtd/parsers/Kconfig
@@ -195,3 +195,12 @@ config MTD_REDBOOT_PARTS_READONLY
'FIS directory' images, enable this option.

endif # MTD_REDBOOT_PARTS
help
This provides support for parsing partitions from Shared Memory (SMEM)
for NAND and SPI flash on Qualcomm platforms.
+
+config MTD_ROUTERBOOT_PARTS
+ tristate "RouterBoot flash partition parser"
Expand All @@ -32,7 +32,7 @@ Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
--- a/drivers/mtd/parsers/Makefile
+++ b/drivers/mtd/parsers/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o
obj-$(CONFIG_MTD_SHARPSL_PARTS) += sharpslpart.o
obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
obj-$(CONFIG_MTD_QCOMSMEM_PARTS) += qcomsmempart.o
+obj-$(CONFIG_MTD_ROUTERBOOT_PARTS) += routerbootpart.o
Expand Up @@ -48,6 +48,6 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ if (!mount_ubi_rootfs())
+ return;
+#endif
#ifdef CONFIG_BLOCK
{
int err = create_dev("/dev/root", ROOT_DEV);
if (ROOT_DEV == 0 && root_device_name && root_fs_names) {
if (mount_nodev_root() == 0)
return;
Expand Up @@ -351,7 +351,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
+ LZMA_FREE(address);
+}
+
+static ISzAlloc lzma_alloc = { .Alloc = p_lzma_malloc, .Free = p_lzma_free };
+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free};
+
+#endif
--- /dev/null
Expand Down
Expand Up @@ -15,9 +15,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+/* Do not check the TCP window for incoming packets */
+static int nf_ct_tcp_no_window_check __read_mostly = 1;
+
/* "Be conservative in what you do,
be liberal in what you accept from others."
If it's non-zero, we mark only out of window RST segments as INVALID. */
/* FIXME: Examine ipfilter's timeouts and conntrack transitions more
closely. They're more complex. --RR */

@@ -476,6 +479,9 @@ static bool tcp_in_window(const struct n
s32 receiver_offset;
bool res, in_recv_win;
Expand Down
Expand Up @@ -110,7 +110,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
return -EINVAL;
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -95,6 +95,8 @@ static int ip6_pkt_discard(struct sk_bu
@@ -94,6 +94,8 @@ static int ip6_pkt_discard(struct sk_bu
static int ip6_pkt_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
static int ip6_pkt_prohibit(struct sk_buff *skb);
static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff *skb);
Expand All @@ -119,7 +119,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static void ip6_link_failure(struct sk_buff *skb);
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu,
@@ -310,6 +312,18 @@ static const struct rt6_info ip6_prohibi
@@ -309,6 +311,18 @@ static const struct rt6_info ip6_prohibi
.rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP),
};

Expand All @@ -138,15 +138,15 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
static const struct rt6_info ip6_blk_hole_entry_template = {
.dst = {
.__refcnt = ATOMIC_INIT(1),
@@ -1031,6 +1045,7 @@ static const int fib6_prop[RTN_MAX + 1]
@@ -1030,6 +1044,7 @@ static const int fib6_prop[RTN_MAX + 1]
[RTN_BLACKHOLE] = -EINVAL,
[RTN_UNREACHABLE] = -EHOSTUNREACH,
[RTN_PROHIBIT] = -EACCES,
+ [RTN_POLICY_FAILED] = -EACCES,
[RTN_THROW] = -EAGAIN,
[RTN_NAT] = -EINVAL,
[RTN_XRESOLVE] = -EINVAL,
@@ -1066,6 +1081,10 @@ static void ip6_rt_init_dst_reject(struc
@@ -1065,6 +1080,10 @@ static void ip6_rt_init_dst_reject(struc
rt->dst.output = ip6_pkt_prohibit_out;
rt->dst.input = ip6_pkt_prohibit;
break;
Expand Down
Expand Up @@ -15,11 +15,11 @@ early has to be increased.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
drivers/of/of_net.c | 43 +++++++++++++++++++++++++++++++++++++++----
net/core/of_net.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 39 insertions(+), 4 deletions(-)

--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
--- a/net/core/of_net.c
+++ b/net/core/of_net.c
@@ -115,27 +115,62 @@ static int of_get_mac_addr_nvmem(struct
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
Expand Down
@@ -1,5 +1,5 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
--- a/net/core/of_net.c
+++ b/net/core/of_net.c
@@ -95,6 +95,27 @@ static int of_get_mac_addr_nvmem(struct
return 0;
}
Expand Down

0 comments on commit 4835036

Please sign in to comment.