summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-04-17 22:19:38 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-17 22:19:38 -0700
commit66f08bb4a5d8d83dc09ffa2bbbccc749d340a015 (patch)
treee33fa8cc3c2d1f8fb37ff9543d8060f5209b9a1b
parent15d203ef98affe7dd7a5c251b8d3f741780e1e8a (diff)
parent2d4f3f55ff09efb0c5a21e4d3e5d7a4d5751688c (diff)
Merge "qcacld-2.0: inject fw crash in crash-shutdown" into wlan-cld2.driver.lnx.1.0-dev
-rw-r--r--CORE/SERVICES/HIF/PCIe/if_pci.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/CORE/SERVICES/HIF/PCIe/if_pci.c b/CORE/SERVICES/HIF/PCIe/if_pci.c
index 7d28cc265b9a..94705707d4ee 100644
--- a/CORE/SERVICES/HIF/PCIe/if_pci.c
+++ b/CORE/SERVICES/HIF/PCIe/if_pci.c
@@ -46,6 +46,7 @@
#include "vos_api.h"
#include "vos_sched.h"
#include "wma_api.h"
+#include "wma.h"
#include "adf_os_atomic.h"
#include "wlan_hdd_power.h"
#include "wlan_hdd_main.h"
@@ -2651,9 +2652,38 @@ static void hif_dump_crash_debug_info(struct hif_pci_softc *sc)
struct HIF_CE_state *hif_state = (struct HIF_CE_state *)sc->hif_device;
struct ol_softc *scn = sc->ol_sc;
int ret;
+ tp_wma_handle wma_handle;
+ void *vos_context = vos_get_global_context(VOS_MODULE_ID_HIF, NULL);
if (!hif_state)
return;
+ if (vos_context == NULL) {
+ pr_err("%s: vos context is null\n", __func__);
+ return;
+ }
+ wma_handle = (tp_wma_handle) vos_get_context(
+ VOS_MODULE_ID_WDA, vos_context);
+ if (wma_handle == NULL) {
+ pr_err("%s: wma_handle is null\n", __func__);
+ return;
+ }
+
+ /*
+ * When kernel panic happen, if WiFi FW is still active,
+ * it may cause NOC errors/memory corruption, to avoid
+ * this, inject a fw crash first.
+ * send crash_inject to FW directly, because we are now
+ * in an atomic context, and preempt has been disabled,
+ * MCThread won't be scheduled at the moment, at the same
+ * time, TargetFailure event wont't be received after inject
+ * crash due to the same reason
+ */
+ ret = wma_crash_inject(wma_handle, 1, 0);
+ if (ret) {
+ pr_err("%s: failed to send crash inject - %d\n",
+ __func__, ret);
+ return;
+ }
adf_os_spin_lock_irqsave(&hif_state->suspend_lock);
hif_irq_record(HIF_CRASH, sc);