Files
wlan-ap/patches/0008-kernel-fix-crashlog-for-ARM.patch
John Crispin 7ae17f821b ipq807x: update kernel patches and add new boards
Signed-off-by: John Crispin <john@phrozen.org>
2021-01-18 08:03:29 +01:00

145 lines
4.6 KiB
Diff

From f7b3b958e9651bb1fd17d2d98cb69dd4a01c0048 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Fri, 24 Jul 2020 11:55:31 +0200
Subject: [PATCH 08/40] kernel: fix crashlog for ARM
The current driver was MIPS specific, make it work on ARM.
Signed-off-by: John Crispin <john@phrozen.org>
---
config/Config-kernel.in | 2 +-
.../generic/hack-4.14/930-crashlog.patch | 52 +++++++++++--------
2 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 87053b7f23..eb61db542f 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -28,7 +28,7 @@ config KERNEL_PRINTK
config KERNEL_CRASHLOG
bool "Crash logging"
- depends on !(arm || powerpc || sparc || TARGET_uml || i386 || x86_64)
+ depends on !(powerpc || sparc || TARGET_uml || i386 || x86_64)
default y
config KERNEL_SWAP
diff --git a/target/linux/generic/hack-4.14/930-crashlog.patch b/target/linux/generic/hack-4.14/930-crashlog.patch
index 9d09dbd760..0489e0ef41 100644
--- a/target/linux/generic/hack-4.14/930-crashlog.patch
+++ b/target/linux/generic/hack-4.14/930-crashlog.patch
@@ -19,8 +19,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
create mode 100644 include/linux/crashlog.h
create mode 100644 kernel/crashlog.c
+Index: linux-4.14.187/include/linux/crashlog.h
+===================================================================
--- /dev/null
-+++ b/include/linux/crashlog.h
++++ linux-4.14.187/include/linux/crashlog.h
@@ -0,0 +1,17 @@
+#ifndef __CRASHLOG_H
+#define __CRASHLOG_H
@@ -39,8 +41,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+#endif
+
+#endif
---- a/init/Kconfig
-+++ b/init/Kconfig
+Index: linux-4.14.187/init/Kconfig
+===================================================================
+--- linux-4.14.187.orig/init/Kconfig
++++ linux-4.14.187/init/Kconfig
@@ -1009,6 +1009,10 @@ config RELAY
If unsure, say N.
@@ -52,8 +56,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config BLK_DEV_INITRD
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
depends on BROKEN || !FRV
---- a/kernel/Makefile
-+++ b/kernel/Makefile
+Index: linux-4.14.187/kernel/Makefile
+===================================================================
+--- linux-4.14.187.orig/kernel/Makefile
++++ linux-4.14.187/kernel/Makefile
@@ -110,6 +110,7 @@ obj-$(CONFIG_CONTEXT_TRACKING) += contex
obj-$(CONFIG_TORTURE_TEST) += torture.o
@@ -62,9 +68,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
$(obj)/configs.o: $(obj)/config_data.h
+Index: linux-4.14.187/kernel/crashlog.c
+===================================================================
--- /dev/null
-+++ b/kernel/crashlog.c
-@@ -0,0 +1,213 @@
++++ linux-4.14.187/kernel/crashlog.c
+@@ -0,0 +1,205 @@
+/*
+ * Crash information logger
+ * Copyright (C) 2010 Felix Fietkau <nbd@nbd.name>
@@ -131,17 +139,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+ if (crashlog_addr)
+ return false;
-+
-+ if (addr > limit)
++ if (size <= limit)
+ return false;
-+
-+ if (addr + size > limit)
-+ size = limit - addr;
-+
-+ crashlog_addr = addr;
-+
-+ if (addr + size > CRASHLOG_OFFSET)
-+ crashlog_addr += size - CRASHLOG_OFFSET;
++ crashlog_addr = addr + limit - CRASHLOG_OFFSET;
+
+ return true;
+}
@@ -278,8 +278,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ return 0;
+}
+module_init(crashlog_init_fs);
---- a/kernel/module.c
-+++ b/kernel/module.c
+Index: linux-4.14.187/kernel/module.c
+===================================================================
+--- linux-4.14.187.orig/kernel/module.c
++++ linux-4.14.187/kernel/module.c
@@ -256,6 +256,9 @@ static void mod_update_bounds(struct mod
#ifdef CONFIG_KGDB_KDB
struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */
@@ -290,8 +292,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static void module_assert_mutex(void)
{
---- a/mm/bootmem.c
-+++ b/mm/bootmem.c
+Index: linux-4.14.187/mm/bootmem.c
+===================================================================
+--- linux-4.14.187.orig/mm/bootmem.c
++++ linux-4.14.187/mm/bootmem.c
@@ -15,6 +15,7 @@
#include <linux/export.h>
#include <linux/kmemleak.h>
@@ -308,8 +312,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
map = bdata->node_bootmem_map;
start = bdata->node_min_pfn;
end = bdata->node_low_pfn;
---- a/mm/memblock.c
-+++ b/mm/memblock.c
+Index: linux-4.14.187/mm/memblock.c
+===================================================================
+--- linux-4.14.187.orig/mm/memblock.c
++++ linux-4.14.187/mm/memblock.c
@@ -19,6 +19,7 @@
#include <linux/debugfs.h>
#include <linux/seq_file.h>
--
2.25.1