diff options
| author | Yu Wang <yyuwang@codeaurora.org> | 2017-01-26 15:39:00 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-17 00:10:50 -0700 |
| commit | 2d4f3f55ff09efb0c5a21e4d3e5d7a4d5751688c (patch) | |
| tree | 6b229c4e28319d7d83937fcf62dcdace4827a3f1 | |
| parent | 98e0ac4e34172d70ff142b60f80df96aebb3807d (diff) | |
qcacld-2.0: inject fw crash in crash-shutdown
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.
Change-Id: I97a696a02dfd73aaca212ef1bca9f3597df1e382
CRs-Fixed: 1114509
| -rw-r--r-- | CORE/SERVICES/HIF/PCIe/if_pci.c | 30 |
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); |
