Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 967fbb8e authored by Yue Ma's avatar Yue Ma Committed by Matt Wagantall
Browse files

cnss: Add support to trigger kernel panic when PCIe link down happens



Currently when PCIe link down is detected, CNSS/WLAN tries to schedule
a recovery. For debugging purpose, add the option to trigger kernel panic
when PCIe link down happens in order to catch the issues.

Change-Id: I532deb2edf6bdb7b388e4615084cbe8dd8a350ad
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 18dab37e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -277,6 +277,11 @@ static struct cnss_data {
	unsigned long last_activity;
} *penv;

static unsigned int pcie_link_down_panic;
module_param(pcie_link_down_panic, uint, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(pcie_link_down_panic,
		"Trigger kernel panic when PCIe link down is detected");

static int cnss_wlan_vreg_on(struct cnss_wlan_vreg_info *vreg_info)
{
	int ret;
@@ -1506,6 +1511,9 @@ void cnss_pci_events_cb(struct msm_pcie_notify *notify)
	switch (notify->event) {

	case MSM_PCIE_EVENT_LINKDOWN:
		if (pcie_link_down_panic)
			panic("PCIe link is down!\n");

		spin_lock_irqsave(&pci_link_down_lock, flags);
		if (penv->pcie_link_down_ind) {
			pr_debug("PCI link down recovery is in progress, ignore!\n");
@@ -1537,6 +1545,9 @@ void cnss_wlan_pci_link_down(void)
{
	unsigned long flags;

	if (pcie_link_down_panic)
		panic("PCIe link is down!\n");

	spin_lock_irqsave(&pci_link_down_lock, flags);
	if (penv->pcie_link_down_ind) {
		pr_debug("PCI link down recovery is in progress, ignore!\n");