mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-17 17:31:27 +00:00
145 lines
4.7 KiB
Diff
145 lines
4.7 KiB
Diff
From 0bdad100b63efeed317b9d1792df87ec39b5291d Mon Sep 17 00:00:00 2001
|
|
From: Poovendhan Selvaraj <quic_poovendh@quicinc.com>
|
|
Date: Thu, 23 Nov 2023 12:58:20 +0530
|
|
Subject: [PATCH] minidump: Add new config file for minidum and minidump
|
|
functioanlity
|
|
|
|
This change adds new compile flag CONFIG_QCA_MINIDUMP
|
|
for minidump functionality. Minidump will be disabled
|
|
for lowmem profiles.
|
|
This change also add support for minidump functionality to save mandatory
|
|
information from drivers.
|
|
|
|
(cherry picked from commit e0cb60019e34c6e9f05c3252b56cef082d6a3e63 and
|
|
2c39b38c0dd28e11628cce7a4a9949868b66f13e)
|
|
|
|
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
|
|
Signed-off-by: Gitanjali Krishna <gitanjal@codeaurora.org>
|
|
Change-Id: I563c0c8798bdacfc45bba6ec7a9692a4211b53cb
|
|
Signed-off-by: Poovendhan Selvaraj <quic_poovendh@quicinc.com>
|
|
---
|
|
arch/arm/mm/init.c | 8 ++++++++
|
|
arch/arm64/mm/init.c | 8 ++++++++
|
|
include/linux/printk.h | 4 ++++
|
|
init/version.c | 12 ++++++++++++
|
|
kernel/module/main.c | 5 +++++
|
|
kernel/printk/printk.c | 11 ++++++++++-
|
|
6 files changed, 47 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
|
|
index ce64bdb55a16..f6fb097c52dc 100644
|
|
--- a/arch/arm/mm/init.c
|
|
+++ b/arch/arm/mm/init.c
|
|
@@ -486,3 +486,11 @@ void free_initrd_mem(unsigned long start, unsigned long end)
|
|
free_reserved_area((void *)start, (void *)end, -1, "initrd");
|
|
}
|
|
#endif
|
|
+
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+void minidump_get_pgd_info(uint64_t *pt_start, uint64_t *pt_len)
|
|
+{
|
|
+ *pt_start = (uintptr_t)swapper_pg_dir;
|
|
+ *pt_len = SZ_16K;
|
|
+}
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
|
|
index 4b4651ee47f2..5e119585b9d6 100644
|
|
--- a/arch/arm64/mm/init.c
|
|
+++ b/arch/arm64/mm/init.c
|
|
@@ -502,3 +502,11 @@ void dump_mem_limit(void)
|
|
pr_emerg("Memory Limit: none\n");
|
|
}
|
|
}
|
|
+
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+void minidump_get_pgd_info(uint64_t *pt_start, uint64_t *pt_len)
|
|
+{
|
|
+ *pt_start = (uintptr_t)swapper_pg_dir;
|
|
+ *pt_len = SZ_4K;
|
|
+}
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
diff --git a/include/linux/printk.h b/include/linux/printk.h
|
|
index 8c81806c2e99..e0a6ea5c7100 100644
|
|
--- a/include/linux/printk.h
|
|
+++ b/include/linux/printk.h
|
|
@@ -184,6 +184,10 @@ extern int dmesg_restrict;
|
|
|
|
extern void wake_up_klogd(void);
|
|
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+extern void get_log_buf_info(uint64_t *log_buf, uint64_t *log_buf_len);
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
+
|
|
char *log_buf_addr_get(void);
|
|
u32 log_buf_len_get(void);
|
|
void log_buf_vmcoreinfo_setup(void);
|
|
diff --git a/init/version.c b/init/version.c
|
|
index 01d4ab05f0ba..23d0b4d72378 100644
|
|
--- a/init/version.c
|
|
+++ b/init/version.c
|
|
@@ -52,4 +52,16 @@ const char linux_banner[] __weak;
|
|
|
|
#include "version-timestamp.c"
|
|
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+const char *linux_banner_ptr = linux_banner;
|
|
+uint64_t linux_banner_size = sizeof(linux_banner);
|
|
+
|
|
+void minidump_get_linux_buf_info(uint64_t *plinux_buf, uint64_t *plinux_buf_len)
|
|
+{
|
|
+ *plinux_buf = (uint64_t)((uintptr_t)linux_banner_ptr);
|
|
+ *plinux_buf_len = linux_banner_size;
|
|
+}
|
|
+EXPORT_SYMBOL(minidump_get_linux_buf_info);
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
+
|
|
EXPORT_SYMBOL_GPL(init_uts_ns);
|
|
diff --git a/kernel/module/main.c b/kernel/module/main.c
|
|
index 39da8b4afbcc..e53dbafe3cb4 100644
|
|
--- a/kernel/module/main.c
|
|
+++ b/kernel/module/main.c
|
|
@@ -244,6 +244,11 @@ static __maybe_unused void *any_section_objs(const struct load_info *info,
|
|
#define symversion(base, idx) ((base != NULL) ? ((base) + (idx)) : NULL)
|
|
#endif
|
|
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+struct list_head *minidump_modules = &modules;
|
|
+EXPORT_SYMBOL(minidump_modules);
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
+
|
|
static const char *kernel_symbol_name(const struct kernel_symbol *sym)
|
|
{
|
|
#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
|
|
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
|
|
index e4f1e7478b52..acf95f4f8657 100644
|
|
--- a/kernel/printk/printk.c
|
|
+++ b/kernel/printk/printk.c
|
|
@@ -406,7 +406,8 @@ static struct latched_seq clear_seq = {
|
|
#define LOG_BUF_LEN_MAX (u32)(1 << 31)
|
|
static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN);
|
|
static char *log_buf = __log_buf;
|
|
-static u32 log_buf_len = __LOG_BUF_LEN;
|
|
+u32 log_buf_len = __LOG_BUF_LEN;
|
|
+EXPORT_SYMBOL(log_buf_len);
|
|
|
|
/*
|
|
* Define the average message size. This only affects the number of
|
|
@@ -2296,6 +2297,14 @@ EXPORT_SYMBOL(_printk);
|
|
static bool pr_flush(int timeout_ms, bool reset_on_progress);
|
|
static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress);
|
|
|
|
+#ifdef CONFIG_QCA_MINIDUMP
|
|
+void minidump_get_log_buf_info(uint64_t *plog_buf, uint64_t *plog_buf_len)
|
|
+{
|
|
+ *plog_buf = (uint64_t)(uintptr_t)log_buf;
|
|
+ *plog_buf_len = (uint64_t)__pa(&log_buf_len);
|
|
+}
|
|
+#endif /* CONFIG_QCA_MINIDUMP */
|
|
+
|
|
#else /* CONFIG_PRINTK */
|
|
|
|
#define CONSOLE_LOG_MAX 0
|
|
--
|
|
2.34.1
|
|
|