From 0e95bb3404da586e9507a9b40eff987959aaead4 Mon Sep 17 00:00:00 2001 From: Chaitanya Pratapa Date: Tue, 14 Dec 2021 13:08:43 -0800 Subject: [PATCH] msm: ipa: use a single panic notifier Make changes to use single panic notifier to get all the information in one shot. Change-Id: I8030f17b58a5d4da0a93e5109d5b9717e67d466a Signed-off-by: Chaitanya Pratapa --- drivers/platform/msm/ipa/ipa_v3/ipa.c | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index f446e3bbf1..c35d67cbaf 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -630,27 +630,6 @@ static int ipa3_clean_mhip_dl_rule(void) return 0; } -static int ipa3_active_clients_panic_notifier(struct notifier_block *this, - unsigned long event, void *ptr) -{ - if (ipa3_ctx != NULL) - { - if (ipa3_ctx->is_device_crashed) - return NOTIFY_DONE; - ipa3_ctx->is_device_crashed = true; - } - - ipa3_active_clients_log_print_table(active_clients_table_buf, - IPA3_ACTIVE_CLIENTS_TABLE_BUF_SIZE); - IPAERR("%s\n", active_clients_table_buf); - - return NOTIFY_DONE; -} - -static struct notifier_block ipa3_active_clients_panic_blk = { - .notifier_call = ipa3_active_clients_panic_notifier, -}; - #ifdef CONFIG_IPA_DEBUG static int ipa3_active_clients_log_insert(const char *string) { @@ -702,9 +681,6 @@ static int ipa3_active_clients_log_init(void) ipa3_ctx->ipa3_active_clients_logging.log_tail = IPA3_ACTIVE_CLIENTS_LOG_BUFFER_SIZE_LINES - 1; hash_init(ipa3_ctx->ipa3_active_clients_logging.htable); - /* 2nd ipa3_active_clients_panic_notifier */ - atomic_notifier_chain_register(&panic_notifier_list, - &ipa3_active_clients_panic_blk); ipa3_ctx->ipa3_active_clients_logging.log_rdy = true; return 0; @@ -7066,6 +7042,7 @@ static int ipa3_panic_notifier(struct notifier_block *this, { if (ipa3_ctx->is_device_crashed) return NOTIFY_DONE; + ipa3_ctx->is_device_crashed = true; } ipa3_freeze_clock_vote_and_notify_modem(); @@ -7086,6 +7063,10 @@ static int ipa3_panic_notifier(struct notifier_block *this, ipa_wigig_save_regs(); } + ipa3_active_clients_log_print_table(active_clients_table_buf, + IPA3_ACTIVE_CLIENTS_TABLE_BUF_SIZE); + IPAERR("%s\n", active_clients_table_buf); + return NOTIFY_DONE; }