diff options
| author | Prashanth Bhatta <bhattap@codeaurora.org> | 2017-03-21 17:53:25 -0700 |
|---|---|---|
| committer | Prashanth Bhatta <bhattap@codeaurora.org> | 2017-03-28 14:31:54 -0700 |
| commit | bbdda72e6dfa041877adde2db082ff90120f3ef4 (patch) | |
| tree | 563cdb85050cf0db57e114be25a6943a11966cb5 | |
| parent | fec225ae45829184255a95a00d81cf1387fd6a84 (diff) | |
icnss: Separate debug and verbose log
Right now all the logs are dumped to IPC log buffer but there
are some logs which are logged most often and they overwrite log
buffer where in important logs required for debugging may be
lost. Create debug and verbose log level such that logs which are
logged most often and not as important as debug logs are moved to
verbose log level.
Change-Id: Iccab3e5485700efe71ffc85dc7c5f39b0872dfb4
CRs-fixed: 2025867
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
| -rw-r--r-- | drivers/soc/qcom/icnss.c | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/drivers/soc/qcom/icnss.c b/drivers/soc/qcom/icnss.c index 16ab2400cd69..70874da9d176 100644 --- a/drivers/soc/qcom/icnss.c +++ b/drivers/soc/qcom/icnss.c @@ -62,7 +62,7 @@ module_param(qmi_timeout, ulong, 0600); #define WLFW_CLIENT_ID 0x4b4e454c #define MAX_PROP_SIZE 32 #define NUM_LOG_PAGES 10 -#define NUM_REG_LOG_PAGES 4 +#define NUM_LOG_LONG_PAGES 4 #define ICNSS_MAGIC 0x5abc5abc #define ICNSS_SERVICE_LOCATION_CLIENT_NAME "ICNSS-WLAN" @@ -77,6 +77,11 @@ module_param(qmi_timeout, ulong, 0600); ipc_log_string(icnss_ipc_log_context, _x); \ } while (0) +#define icnss_ipc_log_long_string(_x...) do { \ + if (icnss_ipc_log_long_context) \ + ipc_log_string(icnss_ipc_log_long_context, _x); \ + } while (0) + #define icnss_pr_err(_fmt, ...) do { \ pr_err(_fmt, ##__VA_ARGS__); \ icnss_ipc_log_string("ERR: " pr_fmt(_fmt), \ @@ -101,6 +106,12 @@ module_param(qmi_timeout, ulong, 0600); ##__VA_ARGS__); \ } while (0) +#define icnss_pr_vdbg(_fmt, ...) do { \ + pr_debug(_fmt, ##__VA_ARGS__); \ + icnss_ipc_log_long_string("DBG: " pr_fmt(_fmt), \ + ##__VA_ARGS__); \ + } while (0) + #ifdef CONFIG_ICNSS_DEBUG #define ICNSS_ASSERT(_condition) do { \ if (!(_condition)) { \ @@ -138,6 +149,7 @@ uint64_t dynamic_feature_mask = QMI_WLFW_FW_REJUVENATE_V01; module_param(dynamic_feature_mask, ullong, 0600); void *icnss_ipc_log_context; +void *icnss_ipc_log_long_context; #define ICNSS_EVENT_PENDING 2989 @@ -367,7 +379,7 @@ static void icnss_pm_stay_awake(struct icnss_priv *priv) if (atomic_inc_return(&priv->pm_count) != 1) return; - icnss_pr_dbg("PM stay awake, state: 0x%lx, count: %d\n", priv->state, + icnss_pr_vdbg("PM stay awake, state: 0x%lx, count: %d\n", priv->state, atomic_read(&priv->pm_count)); pm_stay_awake(&priv->pdev->dev); @@ -384,7 +396,7 @@ static void icnss_pm_relax(struct icnss_priv *priv) if (r != 0) return; - icnss_pr_dbg("PM relax, state: 0x%lx, count: %d\n", priv->state, + icnss_pr_vdbg("PM relax, state: 0x%lx, count: %d\n", priv->state, atomic_read(&priv->pm_count)); pm_relax(&priv->pdev->dev); @@ -718,7 +730,7 @@ static int icnss_vreg_on(struct icnss_priv *priv) if (!vreg_info->reg) continue; - icnss_pr_dbg("Regulator %s being enabled\n", vreg_info->name); + icnss_pr_vdbg("Regulator %s being enabled\n", vreg_info->name); ret = regulator_set_voltage(vreg_info->reg, vreg_info->min_v, vreg_info->max_v); @@ -780,7 +792,7 @@ static int icnss_vreg_off(struct icnss_priv *priv) if (!vreg_info->reg) continue; - icnss_pr_dbg("Regulator %s being disabled\n", vreg_info->name); + icnss_pr_vdbg("Regulator %s being disabled\n", vreg_info->name); ret = regulator_disable(vreg_info->reg); if (ret) @@ -814,7 +826,7 @@ static int icnss_clk_init(struct icnss_priv *priv) if (!clk_info->handle) continue; - icnss_pr_dbg("Clock %s being enabled\n", clk_info->name); + icnss_pr_vdbg("Clock %s being enabled\n", clk_info->name); if (clk_info->freq) { ret = clk_set_rate(clk_info->handle, clk_info->freq); @@ -861,7 +873,7 @@ static int icnss_clk_deinit(struct icnss_priv *priv) if (!clk_info->handle) continue; - icnss_pr_dbg("Clock %s being disabled\n", clk_info->name); + icnss_pr_vdbg("Clock %s being disabled\n", clk_info->name); clk_disable_unprepare(clk_info->handle); } @@ -1734,7 +1746,7 @@ static void icnss_qmi_wlfw_clnt_notify_work(struct work_struct *work) if (!penv || !penv->wlfw_clnt) return; - icnss_pr_dbg("Receiving Event in work queue context\n"); + icnss_pr_vdbg("Receiving Event in work queue context\n"); do { } while ((ret = qmi_recv_msg(penv->wlfw_clnt)) == 0); @@ -1742,13 +1754,13 @@ static void icnss_qmi_wlfw_clnt_notify_work(struct work_struct *work) if (ret != -ENOMSG) icnss_pr_err("Error receiving message: %d\n", ret); - icnss_pr_dbg("Receiving Event completed\n"); + icnss_pr_vdbg("Receiving Event completed\n"); } static void icnss_qmi_wlfw_clnt_notify(struct qmi_handle *handle, enum qmi_event_type event, void *notify_priv) { - icnss_pr_dbg("QMI client notify: %d\n", event); + icnss_pr_vdbg("QMI client notify: %d\n", event); if (!penv || !penv->wlfw_clnt) return; @@ -2309,7 +2321,7 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb, struct icnss_priv *priv = container_of(nb, struct icnss_priv, modem_ssr_nb); - icnss_pr_dbg("Modem-Notify: event %lu\n", code); + icnss_pr_vdbg("Modem-Notify: event %lu\n", code); if (code == SUBSYS_AFTER_SHUTDOWN && notif->crashed == CRASH_STATUS_ERR_FATAL) { @@ -2656,7 +2668,7 @@ int icnss_ce_request_irq(unsigned int ce_id, goto out; } - icnss_pr_dbg("CE request IRQ: %d, state: 0x%lx\n", ce_id, penv->state); + icnss_pr_vdbg("CE request IRQ: %d, state: 0x%lx\n", ce_id, penv->state); if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) { icnss_pr_err("Invalid CE ID, ce_id: %d\n", ce_id); @@ -2682,7 +2694,7 @@ int icnss_ce_request_irq(unsigned int ce_id, irq_entry->irq = irq; irq_entry->handler = handler; - icnss_pr_dbg("IRQ requested: %d, ce_id: %d\n", irq, ce_id); + icnss_pr_vdbg("IRQ requested: %d, ce_id: %d\n", irq, ce_id); penv->stats.ce_irqs[ce_id].request++; out: @@ -2701,7 +2713,7 @@ int icnss_ce_free_irq(unsigned int ce_id, void *ctx) goto out; } - icnss_pr_dbg("CE free IRQ: %d, state: 0x%lx\n", ce_id, penv->state); + icnss_pr_vdbg("CE free IRQ: %d, state: 0x%lx\n", ce_id, penv->state); if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) { icnss_pr_err("Invalid CE ID to free, ce_id: %d\n", ce_id); @@ -2735,7 +2747,7 @@ void icnss_enable_irq(unsigned int ce_id) return; } - icnss_pr_dbg("Enable IRQ: ce_id: %d, state: 0x%lx\n", ce_id, + icnss_pr_vdbg("Enable IRQ: ce_id: %d, state: 0x%lx\n", ce_id, penv->state); if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) { @@ -2759,7 +2771,7 @@ void icnss_disable_irq(unsigned int ce_id) return; } - icnss_pr_dbg("Disable IRQ: ce_id: %d, state: 0x%lx\n", ce_id, + icnss_pr_vdbg("Disable IRQ: ce_id: %d, state: 0x%lx\n", ce_id, penv->state); if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) { @@ -4259,7 +4271,7 @@ static int icnss_pm_suspend(struct device *dev) return -EINVAL; } - icnss_pr_dbg("PM Suspend, state: 0x%lx\n", priv->state); + icnss_pr_vdbg("PM Suspend, state: 0x%lx\n", priv->state); if (!priv->ops || !priv->ops->pm_suspend || !test_bit(ICNSS_DRIVER_PROBED, &priv->state)) @@ -4288,7 +4300,7 @@ static int icnss_pm_resume(struct device *dev) return -EINVAL; } - icnss_pr_dbg("PM resume, state: 0x%lx\n", priv->state); + icnss_pr_vdbg("PM resume, state: 0x%lx\n", priv->state); if (!priv->ops || !priv->ops->pm_resume || !test_bit(ICNSS_DRIVER_PROBED, &priv->state)) @@ -4317,7 +4329,7 @@ static int icnss_pm_suspend_noirq(struct device *dev) return -EINVAL; } - icnss_pr_dbg("PM suspend_noirq, state: 0x%lx\n", priv->state); + icnss_pr_vdbg("PM suspend_noirq, state: 0x%lx\n", priv->state); if (!priv->ops || !priv->ops->suspend_noirq || !test_bit(ICNSS_DRIVER_PROBED, &priv->state)) @@ -4346,7 +4358,7 @@ static int icnss_pm_resume_noirq(struct device *dev) return -EINVAL; } - icnss_pr_dbg("PM resume_noirq, state: 0x%lx\n", priv->state); + icnss_pr_vdbg("PM resume_noirq, state: 0x%lx\n", priv->state); if (!priv->ops || !priv->ops->resume_noirq || !test_bit(ICNSS_DRIVER_PROBED, &priv->state)) @@ -4397,6 +4409,11 @@ static int __init icnss_initialize(void) if (!icnss_ipc_log_context) icnss_pr_err("Unable to create log context\n"); + icnss_ipc_log_long_context = ipc_log_context_create(NUM_LOG_LONG_PAGES, + "icnss_long", 0); + if (!icnss_ipc_log_long_context) + icnss_pr_err("Unable to create log long context\n"); + return platform_driver_register(&icnss_driver); } @@ -4405,6 +4422,8 @@ static void __exit icnss_exit(void) platform_driver_unregister(&icnss_driver); ipc_log_context_destroy(icnss_ipc_log_context); icnss_ipc_log_context = NULL; + ipc_log_context_destroy(icnss_ipc_log_long_context); + icnss_ipc_log_long_context = NULL; } |
