From d928d85f202e92dc404bb32adbc5db2c9899d144 Mon Sep 17 00:00:00 2001 From: Cong Zhang Date: Fri, 24 Jun 2022 10:08:18 +0800 Subject: [PATCH] soc: qcom: minidump_log: Fix compile issue of module minidump Fix undefined function when minidump enabled and panic dump disabled. Change-Id: I16afe91bb2fbfdec20a597f6cb55f45beb29475f Signed-off-by: Cong Zhang --- drivers/soc/qcom/minidump_log.c | 4 ++-- include/soc/qcom/minidump.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/minidump_log.c b/drivers/soc/qcom/minidump_log.c index 299f2c60d776..9de42139c57a 100644 --- a/drivers/soc/qcom/minidump_log.c +++ b/drivers/soc/qcom/minidump_log.c @@ -1159,7 +1159,6 @@ static void md_register_panic_data(void) md_register_memory_dump(md_dma_buf_procs_size, "DMABUF_PROCS"); md_debugfs_dmabufprocs(minidump_dir); } -#endif static int register_vmap_mem(const char *name, void *virual_addr, size_t dump_len) { @@ -1281,6 +1280,7 @@ static void md_register_module_data(void) android_debug_for_each_module(md_get_present_module, NULL); } +#endif #ifdef CONFIG_QCOM_MINIDUMP_PSTORE static void register_pstore_info(void) @@ -1384,8 +1384,8 @@ int msm_minidump_log_init(void) #ifdef CONFIG_QCOM_MINIDUMP_FTRACE md_register_trace_buf(); #endif - md_register_module_data(); #ifdef CONFIG_QCOM_MINIDUMP_PANIC_DUMP + md_register_module_data(); md_register_panic_data(); atomic_notifier_chain_register(&panic_notifier_list, &md_panic_blk); #ifdef CONFIG_QCOM_MINIDUMP_PANIC_CPU_CONTEXT diff --git a/include/soc/qcom/minidump.h b/include/soc/qcom/minidump.h index e0fe4f7e4cb8..c5ae8c11c9fd 100644 --- a/include/soc/qcom/minidump.h +++ b/include/soc/qcom/minidump.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef __MINIDUMP_H @@ -46,7 +47,6 @@ extern bool msm_minidump_enabled(void); extern struct md_region *md_get_region(char *name); extern void dump_stack_minidump(u64 sp); extern int msm_minidump_get_available_region(void); -extern void md_dump_process(void); #else static inline int msm_minidump_add_region(const struct md_region *entry) { @@ -61,6 +61,11 @@ static inline bool msm_minidump_enabled(void) { return false; } static inline struct md_region *md_get_region(char *name) { return NULL; } static inline void dump_stack_minidump(u64 sp) {} static inline void add_trace_event(char *buf, size_t size) {} +#endif + +#if IS_ENABLED(CONFIG_QCOM_MINIDUMP_PANIC_DUMP) +extern void md_dump_process(void); +#else static inline void md_dump_process(void) {} #endif