Ver código fonte

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
Prateek Patil 7 meses atrás
pai
commit
867a9e6cd5
2 arquivos alterados com 4 adições e 1 exclusões
  1. 3 1
      icnss2/main.c
  2. 1 0
      icnss2/main.h

+ 3 - 1
icnss2/main.c

@@ -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:

+ 1 - 0
icnss2/main.h

@@ -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;