icnss2: Cache notif->crashed flag for collecting MSA0 ramdump

When WPSS crashes, remoteproc module sets notif->crashed to 1 in case
of BEFORE_SHUTDOWN, whereas, in case of AFTER_SHUTDOWN, remoteproc
module sets notif->crashed to 0.

To avoid MSA0 ramdump collection on graceful shutdown case, save
notif->crashed flag to determine WPSS crash and collect MSA0 ramdump
only when WPSS crashes.

Change-Id: I48b79ba5e21ebf5d1839c2e7d863d0eb74ad592b
CRs-Fixed: 3887666
This commit is contained in:
Prateek Patil 2024-08-01 12:28:49 +05:30 committed by Ravindra Konda
parent b458d07087
commit 867a9e6cd5
2 changed files with 4 additions and 1 deletions

View File

@ -2215,12 +2215,14 @@ static int icnss_wpss_notifier_nb(struct notifier_block *nb,
switch (code) {
case QCOM_SSR_BEFORE_SHUTDOWN:
priv->notif_crashed = notif->crashed;
break;
case QCOM_SSR_AFTER_SHUTDOWN:
/* Collect ramdump only when there was a crash. */
if (notif->crashed) {
if (priv->notif_crashed) {
icnss_pr_info("Collecting msa0 segment dump\n");
icnss_msa0_ramdump(priv);
priv->notif_crashed = false;
}
goto out;
default:

View File

@ -440,6 +440,7 @@ struct icnss_priv {
void *modem_notify_handler;
void *wpss_notify_handler;
void *wpss_early_notify_handler;
bool notif_crashed;
struct notifier_block modem_ssr_nb;
struct notifier_block wpss_ssr_nb;
struct notifier_block wpss_early_ssr_nb;