From 0a4c0b455783f67ba5cb84b352f9b4e821b77326 Mon Sep 17 00:00:00 2001 From: Bhaumik Bhatt Date: Fri, 24 Jul 2020 12:23:51 -0700 Subject: [PATCH] cnss2: print message for abrupt device reset to PBL At times, the device can abruptly reset due to power rail or other related issues which can manifest as a linkdown on the host. As linkdown recovery mechanism is put in place, it would be helpful to understand why a set of ramdumps was not collected in these abrupt reset cases. Hence, it is wise to add a print message to check whether the device has reset to PBL and make the users aware. Change-Id: I545a5b87461b05ea436e383fddd2a8d037a8389d Signed-off-by: Bhaumik Bhatt --- drivers/net/wireless/cnss2/pci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/cnss2/pci.c b/drivers/net/wireless/cnss2/pci.c index 57ceee858961..e7c6ba369380 100644 --- a/drivers/net/wireless/cnss2/pci.c +++ b/drivers/net/wireless/cnss2/pci.c @@ -4300,12 +4300,18 @@ 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); + struct mhi_controller *mhi_ctrl = pci_priv->mhi_ctrl; if (!pci_priv) return; cnss_fatal_err("Timeout waiting for RDDM notification\n"); + if (mhi_get_exec_env(mhi_ctrl) == MHI_EE_PBL) + cnss_pr_err("Unable to collect ramdumps due to abrupt reset\n"); + + mhi_debug_reg_dump(mhi_ctrl); + cnss_schedule_recovery(&pci_priv->pci_dev->dev, CNSS_REASON_TIMEOUT); }