From 6d1ea40ef8a8d43e266d04e8d31db976d7c0a497 Mon Sep 17 00:00:00 2001 From: Naman Padhiar Date: Thu, 21 Oct 2021 14:28:04 +0530 Subject: [PATCH] icnss2: Fix incomplete fw_build_id in IPC logs Fix incomplete fw_build_id in IPC logging due to MAX character limit. Cleaned up in debug code. Change-Id: Ia0f104158645e27f774d9598883cfcd8ec765d3c Signed-off-by: Naman Padhiar --- drivers/soc/qcom/icnss2/debug.h | 63 ++++++--------------------------- drivers/soc/qcom/icnss2/qmi.c | 6 ++-- 2 files changed, 14 insertions(+), 55 deletions(-) diff --git a/drivers/soc/qcom/icnss2/debug.h b/drivers/soc/qcom/icnss2/debug.h index c050ad3beef3..7f2455d1c82c 100644 --- a/drivers/soc/qcom/icnss2/debug.h +++ b/drivers/soc/qcom/icnss2/debug.h @@ -17,6 +17,7 @@ extern void *icnss_ipc_log_long_context; extern void *icnss_ipc_log_smp2p_context; extern void *icnss_ipc_soc_wake_context; +#if IS_ENABLED(CONFIG_IPC_LOGGING) #define icnss_ipc_log_string(_x...) \ ipc_log_string(icnss_ipc_log_context, _x) @@ -28,6 +29,15 @@ extern void *icnss_ipc_soc_wake_context; #define icnss_ipc_soc_wake_string(_x...) \ ipc_log_string(icnss_ipc_soc_wake_context, _x) +#else +#define icnss_ipc_log_string(_x...) + +#define icnss_ipc_log_long_string(_x...) + +#define icnss_ipc_log_smp2p_string(_x...) + +#define icnss_ipc_soc_wake_string(_x...) +#endif #define icnss_pr_err(_fmt, ...) do { \ printk("%s" pr_fmt(_fmt), KERN_ERR, ##__VA_ARGS__); \ @@ -47,7 +57,6 @@ extern void *icnss_ipc_soc_wake_context; ##__VA_ARGS__); \ } while (0) -#if defined(CONFIG_DYNAMIC_DEBUG) #define icnss_pr_dbg(_fmt, ...) do { \ pr_debug(_fmt, ##__VA_ARGS__); \ icnss_ipc_log_string(pr_fmt(_fmt), ##__VA_ARGS__); \ @@ -68,58 +77,6 @@ extern void *icnss_ipc_soc_wake_context; icnss_ipc_soc_wake_string(pr_fmt(_fmt), ##__VA_ARGS__); \ } while (0) -#elif defined(DEBUG) -#define icnss_pr_dbg(_fmt, ...) do { \ - printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_log_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_vdbg(_fmt, ...) do { \ - printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_log_long_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_smp2p(_fmt, ...) do { \ - pr_debug(_fmt, ##__VA_ARGS__); \ - icnss_ipc_log_smp2p_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_soc_wake(_fmt, ...) do { \ - pr_debug(_fmt, ##__VA_ARGS__); \ - icnss_ipc_soc_wake_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#else -#define icnss_pr_dbg(_fmt, ...) do { \ - no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_log_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_vdbg(_fmt, ...) do { \ - no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_log_long_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_smp2p(_fmt, ...) do { \ - no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_log_smp2p_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#define icnss_pr_soc_wake(_fmt, ...) do { \ - no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \ - icnss_ipc_soc_wake_string("%s" pr_fmt(_fmt), "", \ - ##__VA_ARGS__); \ - } while (0) - -#endif - #ifdef CONFIG_ICNSS2_DEBUG #define ICNSS_ASSERT(_condition) do { \ if (!(_condition)) { \ diff --git a/drivers/soc/qcom/icnss2/qmi.c b/drivers/soc/qcom/icnss2/qmi.c index d6fc2c99e40c..26bbacaa6621 100644 --- a/drivers/soc/qcom/icnss2/qmi.c +++ b/drivers/soc/qcom/icnss2/qmi.c @@ -710,9 +710,11 @@ int wlfw_cap_send_sync_msg(struct icnss_priv *priv) resp->rd_card_chain_cap == WLFW_RD_CARD_CHAIN_CAP_1x1_V01) priv->is_chain1_supported = false; - icnss_pr_dbg("Capability, chip_id: 0x%x, chip_family: 0x%x, board_id: 0x%x, soc_id: 0x%x, fw_version: 0x%x, fw_build_timestamp: %s, fw_build_id: %s", + icnss_pr_dbg("Capability, chip_id: 0x%x, chip_family: 0x%x, board_id: 0x%x, soc_id: 0x%x", priv->chip_info.chip_id, priv->chip_info.chip_family, - priv->board_id, priv->soc_id, + priv->board_id, priv->soc_id); + + icnss_pr_dbg("fw_version: 0x%x, fw_build_timestamp: %s, fw_build_id: %s", priv->fw_version_info.fw_version, priv->fw_version_info.fw_build_timestamp, priv->fw_build_id);