Pārlūkot izejas kodu

cnss2: Try to collect RDDM even when it's timed out

There are some cases that device has entered RDDM mode, but RDDM
notification fails to reach driver. Hence when RDDM timeout happens,
do a last check to see if device is in RDDM mode. If yes, just wait
and collect the dump.

Change-Id: Ic7a6cc2d791277d166a9c4da1743be4e3f14e3af
Yue Ma 3 gadi atpakaļ
vecāks
revīzija
5719f4aa59
1 mainītis faili ar 13 papildinājumiem un 5 dzēšanām
  1. 13 5
      cnss2/pci.c

+ 13 - 5
cnss2/pci.c

@@ -5514,19 +5514,27 @@ static void cnss_dev_rddm_timeout_hdlr(struct timer_list *t)
 {
 	struct cnss_pci_data *pci_priv =
 		from_timer(pci_priv, t, dev_rddm_timer);
+	enum mhi_ee_type mhi_ee;
 
 	if (!pci_priv)
 		return;
 
 	cnss_fatal_err("Timeout waiting for RDDM notification\n");
 
-	if (mhi_get_exec_env(pci_priv->mhi_ctrl) == MHI_EE_PBL)
+	mhi_ee = mhi_get_exec_env(pci_priv->mhi_ctrl);
+	if (mhi_ee == MHI_EE_PBL)
 		cnss_pr_err("Unable to collect ramdumps due to abrupt reset\n");
 
-	cnss_mhi_debug_reg_dump(pci_priv);
-	cnss_pci_soc_scratch_reg_dump(pci_priv);
-
-	cnss_schedule_recovery(&pci_priv->pci_dev->dev, CNSS_REASON_TIMEOUT);
+	if (mhi_ee == MHI_EE_RDDM) {
+		cnss_pr_info("Device MHI EE is RDDM, try to collect dump\n");
+		cnss_schedule_recovery(&pci_priv->pci_dev->dev,
+				       CNSS_REASON_RDDM);
+	} else {
+		cnss_mhi_debug_reg_dump(pci_priv);
+		cnss_pci_soc_scratch_reg_dump(pci_priv);
+		cnss_schedule_recovery(&pci_priv->pci_dev->dev,
+				       CNSS_REASON_TIMEOUT);
+	}
 }
 
 static void cnss_boot_debug_timeout_hdlr(struct timer_list *t)